ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

gdiplusmetaheader.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2007 Google (Evan Stade)
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
00017  */
00018 
00019 #ifndef _GDIPLUSMETAHEADER_H
00020 #define _GDIPLUSMETAHEADER_H
00021 
00022 typedef struct
00023 {
00024     DWORD   iType;
00025     DWORD   nSize;
00026     RECTL   rclBounds;
00027     RECTL   rclFrame;
00028     DWORD   dSignature;
00029     DWORD   nVersion;
00030     DWORD   nBytes;
00031     DWORD   nRecords;
00032     WORD    nHandles;
00033     WORD    sReserved;
00034     DWORD   nDescription;
00035     DWORD   offDescription;
00036     DWORD   nPalEntries;
00037     SIZEL   szlDevice;
00038     SIZEL   szlMillimeters;
00039 } ENHMETAHEADER3;
00040 
00041 #include <pshpack2.h>
00042 
00043 typedef struct
00044 {
00045     INT16  Left;
00046     INT16  Top;
00047     INT16  Right;
00048     INT16  Bottom;
00049 } PWMFRect16;
00050 
00051 typedef struct
00052 {
00053     UINT32     Key;
00054     INT16      Hmf;
00055     PWMFRect16 BoundingBox;
00056     INT16      Inch;
00057     UINT32     Reserved;
00058     INT16      Checksum;
00059 } WmfPlaceableFileHeader;
00060 
00061 #include <poppack.h>
00062 
00063 #define GDIP_EMFPLUSFLAGS_DISPLAY       0x00000001
00064 
00065 #ifdef __cplusplus
00066 class MetafileHeader
00067 {
00068 public:
00069     MetafileType        Type;
00070     UINT                Size;
00071     UINT                Version;
00072     UINT                EmfPlusFlags;
00073     REAL                DpiX;
00074     REAL                DpiY;
00075     INT                 X;
00076     INT                 Y;
00077     INT                 Width;
00078     INT                 Height;
00079     union
00080     {
00081         METAHEADER      WmfHeader;
00082         ENHMETAHEADER3  EmfHeader;
00083     };
00084     INT                 EmfPlusHeaderSize;
00085     INT                 LogicalDpiX;
00086     INT                 LogicalDpiY;
00087 
00088 public:
00089     MetafileType GetType() const { return Type; }
00090 
00091     UINT GetMetafileSize() const { return Size; }
00092 
00093     UINT GetVersion() const { return Version; }
00094 
00095     UINT GetEmfPlusFlags() const { return EmfPlusFlags; }
00096 
00097     REAL GetDpiX() const { return DpiX; }
00098 
00099     REAL GetDpiY() const { return DpiY; }
00100 
00101     VOID GetBounds (OUT Rect *r) const
00102     {
00103         r->X = X;
00104         r->Y = Y;
00105         r->Width = Width;
00106         r->Height = Height;
00107     }
00108 
00109     BOOL IsWmf() const
00110     {
00111        return ((Type == MetafileTypeWmf) || (Type == MetafileTypeWmfPlaceable));
00112     }
00113 
00114     BOOL IsWmfPlaceable() const { return (Type == MetafileTypeWmfPlaceable); }
00115 
00116     BOOL IsEmf() const { return (Type == MetafileTypeEmf); }
00117 
00118     BOOL IsEmfOrEmfPlus() const { return (Type >= MetafileTypeEmf); }
00119 
00120     BOOL IsEmfPlus() const { return (Type >= MetafileTypeEmfPlusOnly); }
00121 
00122     BOOL IsEmfPlusDual() const { return (Type == MetafileTypeEmfPlusDual); }
00123 
00124     BOOL IsEmfPlusOnly() const { return (Type == MetafileTypeEmfPlusOnly); }
00125 
00126     BOOL IsDisplay() const
00127     {
00128         return IsEmfPlus() && ((EmfPlusFlags & GDIP_EMFPLUSFLAGS_DISPLAY) != 0);
00129     }
00130 
00131     const METAHEADER * GetWmfHeader() const
00132     {
00133         return IsWmf() ? &WmfHeader : NULL;
00134     }
00135 
00136     const ENHMETAHEADER3 * GetEmfHeader() const
00137     {
00138         return IsEmfOrEmfPlus() ? &EmfHeader : NULL;
00139     }
00140 };
00141 #else /* end of c++ typedefs */
00142 
00143 typedef struct MetafileHeader
00144 {
00145     MetafileType        Type;
00146     UINT                Size;
00147     UINT                Version;
00148     UINT                EmfPlusFlags;
00149     REAL                DpiX;
00150     REAL                DpiY;
00151     INT                 X;
00152     INT                 Y;
00153     INT                 Width;
00154     INT                 Height;
00155     union
00156     {
00157         METAHEADER      WmfHeader;
00158         ENHMETAHEADER3  EmfHeader;
00159     } DUMMYUNIONNAME;
00160     INT                 EmfPlusHeaderSize;
00161     INT                 LogicalDpiX;
00162     INT                 LogicalDpiY;
00163 } MetafileHeader;
00164 
00165 #endif /* end of c typedefs */
00166 
00167 #endif /* _GDIPLUSMETAHEADER_H */

Generated on Sun May 27 2012 04:31:30 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.