newlib/winsup/w32api/include/gdiplus/gdiplusmetaheader.h
Chris Sutcliffe cc077128d3 2010-07-08 Markus Koenig <basilo@users.sourceforge.net>
* include/gdiplus.h: New file.
        * include/gdiplus/gdiplus.h: New file.
        * include/gdiplus/gdiplusbase.h: New file.
        * include/gdiplus/gdiplusbrush.h: New file.
        * include/gdiplus/gdipluscolor.h: New file.
        * include/gdiplus/gdipluscolormatrix.h: New file.
        * include/gdiplus/gdipluseffects.h: New file.
        * include/gdiplus/gdiplusenums.h: New file.
        * include/gdiplus/gdiplusflat.h: New file.
        * include/gdiplus/gdiplusgpstubs.h: New file.
        * include/gdiplus/gdiplusgraphics.h: New file.
        * include/gdiplus/gdiplusheaders.h: New file.
        * include/gdiplus/gdiplusimageattributes.h: New file.
        * include/gdiplus/gdiplusimagecodec.h: New file.
        * include/gdiplus/gdiplusimaging.h: New file.
        * include/gdiplus/gdiplusimpl.h: New file.
        * include/gdiplus/gdiplusinit.h: New file.
        * include/gdiplus/gdipluslinecaps.h: New file.
        * include/gdiplus/gdiplusmatrix.h: New file.
        * include/gdiplus/gdiplusmem.h: New file.
        * include/gdiplus/gdiplusmetafile.h: New file.
        * include/gdiplus/gdiplusmetaheader.h: New file.
        * include/gdiplus/gdipluspath.h: New file.
        * include/gdiplus/gdipluspen.h: New file.
        * include/gdiplus/gdipluspixelformats.h: New file.
        * include/gdiplus/gdiplusstringformat.h: New file.
        * include/gdiplus/gdiplustypes.h: New file.
        * lib/gdiplus.c: New file containing GDI+ variable definitions
        and GUIDs.
        * lib/gdiplus.def: New file.
        * lib/Makefile.in: Add gdiplus.o to EXTRA_OBJS,
        add gdiplus.c to SOURCES.
        * lib/test.c: Include gdiplus.h.
2010-07-08 23:14:54 +00:00

194 lines
3.7 KiB
C
Executable File

/*
* gdiplusmetaheader.h
*
* GDI+ metafile header structure
*
* This file is part of the w32api package.
*
* Contributors:
* Created by Markus Koenig <markus@stber-koenig.de>
*
* THIS SOFTWARE IS NOT COPYRIGHTED
*
* This source code is offered for use in the public domain. You may
* use, modify or distribute it freely.
*
* This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
*/
#ifndef __GDIPLUS_METAHEADER_H
#define __GDIPLUS_METAHEADER_H
#if __GNUC__ >=3
#pragma GCC system_header
#endif
/*
* FIXME: is 1 the correct value for GDIP_EMFPLUSFLAGS_DISPLAY? This number
* has been determined by calling Metafile::GetMetafileHeader() on a EMF+
* metafile which was recorded on a display device context (SampleMetafile.emf).
*/
#ifdef __cplusplus
const UINT GDIP_EMFPLUSFLAGS_DISPLAY = 1;
#else
#define GDIP_EMFPLUSFLAGS_DISPLAY ((UINT) 1)
#endif
typedef struct tagENHMETAHEADER3 {
DWORD iType;
DWORD nSize;
RECTL rclBounds;
RECTL rclFrame;
DWORD dSignature;
DWORD nVersion;
DWORD nBytes;
DWORD nRecords;
WORD nHandles;
WORD sReserved;
DWORD nDescription;
DWORD offDescription;
DWORD nPalEntries;
SIZEL szlDevice;
SIZEL szlMillimeters;
} ENHMETAHEADER3,*LPENHMETAHEADER3;
typedef struct PWMFRect16 {
INT16 Left;
INT16 Top;
INT16 Right;
INT16 Bottom;
} PWMFRect16;
typedef struct WmfPlaceableFileHeader {
UINT32 Key;
INT16 Hmf;
PWMFRect16 BoundingBox;
INT16 Inch;
UINT32 Reserved;
INT16 Checksum;
} WmfPlaceableFileHeader;
typedef struct MetafileHeader {
MetafileType Type;
UINT Size;
UINT Version;
UINT EmfPlusFlags;
REAL DpiX;
REAL DpiY;
INT X;
INT Y;
INT Width;
INT Height;
__extension__ union {
METAHEADER WmfHeader;
ENHMETAHEADER3 EmfHeader;
};
INT EmfPlusHeaderSize;
INT LogicalDpiX;
INT LogicalDpiY;
#ifdef __cplusplus
public:
void GetBounds(Rect *rect) const
{
if (rect)
{
rect->X = X;
rect->Y = Y;
rect->Width = Width;
rect->Height = Height;
}
}
REAL GetDpiX() const
{
return DpiX;
}
REAL GetDpiY() const
{
return DpiY;
}
const ENHMETAHEADER3* GetEmfHeader() const
{
if (Type == MetafileTypeEmf
|| Type == MetafileTypeEmfPlusOnly
|| Type == MetafileTypeEmfPlusDual)
{
return &EmfHeader;
}
else
{
return NULL;
}
}
UINT GetEmfPlusFlags() const
{
return EmfPlusFlags;
}
UINT GetMetafileSize() const
{
return Size;
}
MetafileType GetType() const
{
return Type;
}
UINT GetVersion() const
{
return Version;
}
const METAHEADER* GetWmfHeader() const
{
if (Type == MetafileTypeWmf || Type == MetafileTypeWmfPlaceable)
{
return &WmfHeader;
}
else
{
return NULL;
}
}
BOOL IsDisplay() const
{
return EmfPlusFlags == GDIP_EMFPLUSFLAGS_DISPLAY;
}
BOOL IsEmf() const
{
return Type == MetafileTypeEmf;
}
BOOL IsEmfOrEmfPlus() const
{
return Type == MetafileTypeEmf
|| Type == MetafileTypeEmfPlusOnly
|| Type == MetafileTypeEmfPlusDual;
}
BOOL IsEmfPlus() const
{
return Type == MetafileTypeEmfPlusOnly
|| Type == MetafileTypeEmfPlusDual;
}
BOOL IsEmfPlusDual() const
{
return Type == MetafileTypeEmfPlusDual;
}
BOOL IsEmfPlusOnly() const
{
return Type == MetafileTypeEmfPlusOnly;
}
BOOL IsWmf() const
{
return Type == MetafileTypeWmf
|| Type == MetafileTypeWmfPlaceable;
}
BOOL IsWmfPlaceable() const
{
return Type == MetafileTypeWmfPlaceable;
}
#endif
} MetafileHeader;
#endif /* __GDIPLUS_METAHEADER_H */