/include/gdiplustypes.h

https://github.com/wesgarner/wine · C Header · 249 lines · 186 code · 42 blank · 21 comment · 10 complexity · 4796f1e0b9a59f8708afdba8915aabbf 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. #ifdef __cplusplus
  52. }
  53. #endif
  54. #ifdef __cplusplus
  55. class Point
  56. {
  57. public:
  58. Point()
  59. {
  60. X = Y = 0;
  61. }
  62. Point(IN const Point &pt)
  63. {
  64. X = pt.X;
  65. Y = pt.Y;
  66. }
  67. /* FIXME: missing constructor that takes a Size */
  68. Point(IN INT x, IN INT y)
  69. {
  70. X = x;
  71. Y = y;
  72. }
  73. Point operator+(IN const Point& pt) const
  74. {
  75. return Point(X + pt.X, Y + pt.Y);
  76. }
  77. Point operator-(IN const Point& pt) const
  78. {
  79. return Point(X - pt.X, Y - pt.Y);
  80. }
  81. BOOL Equals(IN const Point& pt)
  82. {
  83. return (X == pt.X) && (Y == pt.Y);
  84. }
  85. public:
  86. INT X;
  87. INT Y;
  88. };
  89. class PointF
  90. {
  91. public:
  92. PointF()
  93. {
  94. X = Y = 0.0f;
  95. }
  96. PointF(IN const PointF &pt)
  97. {
  98. X = pt.X;
  99. Y = pt.Y;
  100. }
  101. /* FIXME: missing constructor that takes a SizeF */
  102. PointF(IN REAL x, IN REAL y)
  103. {
  104. X = x;
  105. Y = y;
  106. }
  107. PointF operator+(IN const PointF& pt) const
  108. {
  109. return PointF(X + pt.X, Y + pt.Y);
  110. }
  111. PointF operator-(IN const PointF& pt) const
  112. {
  113. return PointF(X - pt.X, Y - pt.Y);
  114. }
  115. BOOL Equals(IN const PointF& pt)
  116. {
  117. return (X == pt.X) && (Y == pt.Y);
  118. }
  119. public:
  120. REAL X;
  121. REAL Y;
  122. };
  123. class PathData
  124. {
  125. public:
  126. PathData()
  127. {
  128. Count = 0;
  129. Points = NULL;
  130. Types = NULL;
  131. }
  132. ~PathData()
  133. {
  134. if (Points != NULL)
  135. {
  136. delete Points;
  137. }
  138. if (Types != NULL)
  139. {
  140. delete Types;
  141. }
  142. }
  143. private:
  144. PathData(const PathData &);
  145. PathData& operator=(const PathData &);
  146. public:
  147. INT Count;
  148. PointF* Points;
  149. BYTE* Types;
  150. };
  151. /* FIXME: missing the methods. */
  152. class RectF
  153. {
  154. public:
  155. REAL X;
  156. REAL Y;
  157. REAL Width;
  158. REAL Height;
  159. };
  160. /* FIXME: missing the methods. */
  161. class Rect
  162. {
  163. public:
  164. INT X;
  165. INT Y;
  166. INT Width;
  167. INT Height;
  168. };
  169. #else /* end of c++ typedefs */
  170. typedef struct Point
  171. {
  172. INT X;
  173. INT Y;
  174. } Point;
  175. typedef struct PointF
  176. {
  177. REAL X;
  178. REAL Y;
  179. } PointF;
  180. typedef struct PathData
  181. {
  182. INT Count;
  183. PointF* Points;
  184. BYTE* Types;
  185. } PathData;
  186. typedef struct RectF
  187. {
  188. REAL X;
  189. REAL Y;
  190. REAL Width;
  191. REAL Height;
  192. } RectF;
  193. typedef struct Rect
  194. {
  195. INT X;
  196. INT Y;
  197. INT Width;
  198. INT Height;
  199. } Rect;
  200. typedef struct CharacterRange
  201. {
  202. INT First;
  203. INT Length;
  204. } CharacterRange;
  205. typedef enum Status Status;
  206. #endif /* end of c typedefs */
  207. #endif