/include/gdiplustypes.h

https://github.com/aragaer/wine · C Header · 276 lines · 209 code · 46 blank · 21 comment · 10 complexity · e525867227c0209cd5320a7142606104 MD5 · raw file

  1. /*
  2. * Copyright (C) 2007 Google (Evan Stade)
  3. *
  4. * This library is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Lesser General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2.1 of the License, or (at your option) any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * Lesser General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser General Public
  15. * License along with this library; if not, write to the Free Software
  16. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  17. */
  18. #ifndef _GDIPLUSTYPES_H
  19. #define _GDIPLUSTYPES_H
  20. typedef float REAL;
  21. enum Status{
  22. Ok = 0,
  23. GenericError = 1,
  24. InvalidParameter = 2,
  25. OutOfMemory = 3,
  26. ObjectBusy = 4,
  27. InsufficientBuffer = 5,
  28. NotImplemented = 6,
  29. Win32Error = 7,
  30. WrongState = 8,
  31. Aborted = 9,
  32. FileNotFound = 10,
  33. ValueOverflow = 11,
  34. AccessDenied = 12,
  35. UnknownImageFormat = 13,
  36. FontFamilyNotFound = 14,
  37. FontStyleNotFound = 15,
  38. NotTrueTypeFont = 16,
  39. UnsupportedGdiplusVersion = 17,
  40. GdiplusNotInitialized = 18,
  41. PropertyNotFound = 19,
  42. PropertyNotSupported = 20,
  43. ProfileNotFound = 21
  44. };
  45. #ifdef __cplusplus
  46. extern "C" {
  47. #endif
  48. typedef BOOL (CALLBACK * ImageAbort)(VOID *);
  49. typedef ImageAbort DrawImageAbort;
  50. typedef ImageAbort GetThumbnailImageAbort;
  51. typedef BOOL (CALLBACK * EnumerateMetafileProc)(EmfPlusRecordType,UINT,UINT,const BYTE*,VOID*);
  52. #ifdef __cplusplus
  53. }
  54. #endif
  55. #ifdef __cplusplus
  56. class Point
  57. {
  58. public:
  59. Point()
  60. {
  61. X = Y = 0;
  62. }
  63. Point(IN const Point &pt)
  64. {
  65. X = pt.X;
  66. Y = pt.Y;
  67. }
  68. /* FIXME: missing constructor that takes a Size */
  69. Point(IN INT x, IN INT y)
  70. {
  71. X = x;
  72. Y = y;
  73. }
  74. Point operator+(IN const Point& pt) const
  75. {
  76. return Point(X + pt.X, Y + pt.Y);
  77. }
  78. Point operator-(IN const Point& pt) const
  79. {
  80. return Point(X - pt.X, Y - pt.Y);
  81. }
  82. BOOL Equals(IN const Point& pt)
  83. {
  84. return (X == pt.X) && (Y == pt.Y);
  85. }
  86. public:
  87. INT X;
  88. INT Y;
  89. };
  90. class PointF
  91. {
  92. public:
  93. PointF()
  94. {
  95. X = Y = 0.0f;
  96. }
  97. PointF(IN const PointF &pt)
  98. {
  99. X = pt.X;
  100. Y = pt.Y;
  101. }
  102. /* FIXME: missing constructor that takes a SizeF */
  103. PointF(IN REAL x, IN REAL y)
  104. {
  105. X = x;
  106. Y = y;
  107. }
  108. PointF operator+(IN const PointF& pt) const
  109. {
  110. return PointF(X + pt.X, Y + pt.Y);
  111. }
  112. PointF operator-(IN const PointF& pt) const
  113. {
  114. return PointF(X - pt.X, Y - pt.Y);
  115. }
  116. BOOL Equals(IN const PointF& pt)
  117. {
  118. return (X == pt.X) && (Y == pt.Y);
  119. }
  120. public:
  121. REAL X;
  122. REAL Y;
  123. };
  124. class PathData
  125. {
  126. public:
  127. PathData()
  128. {
  129. Count = 0;
  130. Points = NULL;
  131. Types = NULL;
  132. }
  133. ~PathData()
  134. {
  135. if (Points != NULL)
  136. {
  137. delete Points;
  138. }
  139. if (Types != NULL)
  140. {
  141. delete Types;
  142. }
  143. }
  144. private:
  145. PathData(const PathData &);
  146. PathData& operator=(const PathData &);
  147. public:
  148. INT Count;
  149. PointF* Points;
  150. BYTE* Types;
  151. };
  152. /* FIXME: missing the methods. */
  153. class RectF
  154. {
  155. public:
  156. REAL X;
  157. REAL Y;
  158. REAL Width;
  159. REAL Height;
  160. };
  161. /* FIXME: missing the methods. */
  162. class Rect
  163. {
  164. public:
  165. INT X;
  166. INT Y;
  167. INT Width;
  168. INT Height;
  169. };
  170. class CharacterRange
  171. {
  172. public:
  173. CharacterRange()
  174. {
  175. First = Length = 0;
  176. }
  177. CharacterRange(INT first, INT length)
  178. {
  179. First = first;
  180. Length = length;
  181. }
  182. CharacterRange& operator=(const CharacterRange& rhs)
  183. {
  184. First = rhs.First;
  185. Length = rhs.Length;
  186. return *this;
  187. }
  188. public:
  189. INT First;
  190. INT Length;
  191. };
  192. #else /* end of c++ typedefs */
  193. typedef struct Point
  194. {
  195. INT X;
  196. INT Y;
  197. } Point;
  198. typedef struct PointF
  199. {
  200. REAL X;
  201. REAL Y;
  202. } PointF;
  203. typedef struct PathData
  204. {
  205. INT Count;
  206. PointF* Points;
  207. BYTE* Types;
  208. } PathData;
  209. typedef struct RectF
  210. {
  211. REAL X;
  212. REAL Y;
  213. REAL Width;
  214. REAL Height;
  215. } RectF;
  216. typedef struct Rect
  217. {
  218. INT X;
  219. INT Y;
  220. INT Width;
  221. INT Height;
  222. } Rect;
  223. typedef struct CharacterRange
  224. {
  225. INT First;
  226. INT Length;
  227. } CharacterRange;
  228. typedef enum Status Status;
  229. #endif /* end of c typedefs */
  230. #endif