gdkgc.inc 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. // included by gdk2.pp
  2. {$IFDEF read_forward_definitions}
  3. { GC function types.
  4. Copy: Overwrites destination pixels with the source pixels.
  5. Invert: Inverts the destination pixels.
  6. Xor: Xor's the destination pixels with the source pixels.
  7. Clear: set pixels to 0
  8. And: source AND destination
  9. And Reverse: source AND (NOT destination)
  10. And Invert: (NOT source) AND destination
  11. Noop: destination
  12. Or: source OR destination
  13. Nor: (NOT source) AND (NOT destination)
  14. Equiv: (NOT source) XOR destination
  15. Xor Reverse: source OR (NOT destination)
  16. Copy Inverted: NOT source
  17. Xor Inverted: (NOT source) OR destination
  18. Nand: (NOT source) OR (NOT destination)
  19. Set: set pixels to 1
  20. }
  21. PGdkFunction = ^TGdkFunction;
  22. TGdkFunction = (
  23. GDK_COPY,
  24. GDK_INVERT,
  25. GDK_XOR,
  26. GDK_CLEAR,
  27. GDK_AND,
  28. GDK_AND_REVERSE,
  29. GDK_AND_INVERT,
  30. GDK_NOOP,
  31. GDK_OR,
  32. GDK_EQUIV,
  33. GDK_OR_REVERSE,
  34. GDK_COPY_INVERT,
  35. GDK_OR_INVERT,
  36. GDK_NAND,
  37. GDK_NOR,
  38. GDK_SET
  39. );
  40. { GC cap styles
  41. CapNotLast:
  42. CapButt:
  43. CapRound:
  44. CapProjecting:
  45. }
  46. PGdkCapStyle = ^TGdkCapStyle;
  47. TGdkCapStyle = (
  48. GDK_CAP_NOT_LAST,
  49. GDK_CAP_BUTT,
  50. GDK_CAP_ROUND,
  51. GDK_CAP_PROJECTING
  52. );
  53. { GC fill types.
  54. Solid:
  55. Tiled:
  56. Stippled:
  57. OpaqueStippled:
  58. }
  59. PGdkFill = ^TGdkFill;
  60. TGdkFill = (
  61. GDK_SOLID,
  62. GDK_TILED,
  63. GDK_STIPPLED,
  64. GDK_OPAQUE_STIPPLED
  65. );
  66. { GC join styles
  67. JoinMiter:
  68. JoinRound:
  69. JoinBevel:
  70. }
  71. PGdkJoinStyle = ^TGdkJoinStyle;
  72. TGdkJoinStyle = (
  73. GDK_JOIN_MITER,
  74. GDK_JOIN_ROUND,
  75. GDK_JOIN_BEVEL
  76. );
  77. { GC line styles
  78. Solid:
  79. OnOffDash:
  80. DoubleDash:
  81. }
  82. PGdkLineStyle = ^TGdkLineStyle;
  83. TGdkLineStyle = (
  84. GDK_LINE_SOLID,
  85. GDK_LINE_ON_OFF_DASH,
  86. GDK_LINE_DOUBLE_DASH
  87. );
  88. PGdkSubwindowMode = ^TGdkSubwindowMode;
  89. TGdkSubwindowMode = integer; // see below for possible values
  90. PGdkGCValuesMask = ^TGdkGCValuesMask;
  91. TGdkGCValuesMask = longint; // see below for possible values
  92. PGdkGCValues = ^TGdkGCValues;
  93. TGdkGCValues = record
  94. foreground : TGdkColor;
  95. background : TGdkColor;
  96. font : PGdkFont;
  97. _function : TGdkFunction;
  98. fill : TGdkFill;
  99. tile : PGdkPixmap;
  100. stipple : PGdkPixmap;
  101. clip_mask : PGdkPixmap;
  102. subwindow_mode : TGdkSubwindowMode;
  103. ts_x_origin : gint;
  104. ts_y_origin : gint;
  105. clip_x_origin : gint;
  106. clip_y_origin : gint;
  107. graphics_exposures : gint;
  108. line_width : gint;
  109. line_style : TGdkLineStyle;
  110. cap_style : TGdkCapStyle;
  111. join_style : TGdkJoinStyle;
  112. end;
  113. PGdkGC = ^TGdkGC;
  114. TGdkGC = record
  115. parent_instance : TGObject;
  116. clip_x_origin : gint;
  117. clip_y_origin : gint;
  118. ts_x_origin : gint;
  119. ts_y_origin : gint;
  120. colormap : PGdkColormap;
  121. end;
  122. {$ENDIF read_forward_definitions}
  123. //------------------------------------------------------------------------------
  124. {$IFDEF read_interface_types}
  125. { Padding for future expansion }
  126. PGdkGCClass = ^TGdkGCClass;
  127. TGdkGCClass = record
  128. parent_class : TGObjectClass;
  129. get_values : procedure (gc:PGdkGC; values:PGdkGCValues); cdecl;
  130. set_values : procedure (gc:PGdkGC; values:PGdkGCValues; mask:TGdkGCValuesMask); cdecl;
  131. set_dashes : procedure (gc:PGdkGC; dash_offset:gint; dash_list:array of gint8; n:gint); cdecl;
  132. _gdk_reserved1 : procedure ; cdecl;
  133. _gdk_reserved2 : procedure ; cdecl;
  134. _gdk_reserved3 : procedure ; cdecl;
  135. _gdk_reserved4 : procedure ; cdecl;
  136. end;
  137. {$ENDIF read_interface_types}
  138. //------------------------------------------------------------------------------
  139. {$IFDEF read_interface_rest}
  140. const
  141. // values for TGdkGCValuesMask
  142. GDK_GC_FOREGROUND = 1 shl 0;
  143. GDK_GC_BACKGROUND = 1 shl 1;
  144. GDK_GC_FONT = 1 shl 2;
  145. GDK_GC_FUNCTION = 1 shl 3;
  146. GDK_GC_FILL = 1 shl 4;
  147. GDK_GC_TILE = 1 shl 5;
  148. GDK_GC_STIPPLE = 1 shl 6;
  149. GDK_GC_CLIP_MASK = 1 shl 7;
  150. GDK_GC_SUBWINDOW = 1 shl 8;
  151. GDK_GC_TS_X_ORIGIN = 1 shl 9;
  152. GDK_GC_TS_Y_ORIGIN = 1 shl 10;
  153. GDK_GC_CLIP_X_ORIGIN = 1 shl 11;
  154. GDK_GC_CLIP_Y_ORIGIN = 1 shl 12;
  155. GDK_GC_EXPOSURES = 1 shl 13;
  156. GDK_GC_LINE_WIDTH = 1 shl 14;
  157. GDK_GC_LINE_STYLE = 1 shl 15;
  158. GDK_GC_CAP_STYLE = 1 shl 16;
  159. GDK_GC_JOIN_STYLE = 1 shl 17;
  160. // values for TGdkSubwindowMode
  161. GDK_CLIP_BY_CHILDREN = 0;
  162. GDK_INCLUDE_INFERIORS = 1;
  163. function GDK_TYPE_GC : GType;
  164. function GDK_GC(anObject : Pointer) : PGdkGC;
  165. function GDK_GC_CLASS(klass : Pointer) : PGdkGCClass;
  166. function GDK_IS_GC(anObject : Pointer) : boolean;
  167. function GDK_IS_GC_CLASS(klass : Pointer) : boolean;
  168. function GDK_GC_GET_CLASS(obj : Pointer) : PGdkGCClass;
  169. function gdk_gc_get_type:GType; cdecl; external gdklib;
  170. function gdk_gc_new(drawable:PGdkDrawable):PGdkGC; cdecl; external gdklib;
  171. function gdk_gc_new_with_values(drawable:PGdkDrawable; values:PGdkGCValues; values_mask:TGdkGCValuesMask):PGdkGC; cdecl; external gdklib;
  172. {$ifndef GDK_DISABLE_DEPRECATED}
  173. function gdk_gc_ref(gc:PGdkGC):PGdkGC; cdecl; external gdklib;
  174. procedure gdk_gc_unref(gc:PGdkGC); cdecl; external gdklib;
  175. {$endif}
  176. procedure gdk_gc_get_values(gc:PGdkGC; values:PGdkGCValues); cdecl; external gdklib;
  177. procedure gdk_gc_set_values(gc:PGdkGC; values:PGdkGCValues; values_mask:TGdkGCValuesMask); cdecl; external gdklib;
  178. procedure gdk_gc_set_foreground(gc:PGdkGC; color:PGdkColor); cdecl; external gdklib;
  179. procedure gdk_gc_set_background(gc:PGdkGC; color:PGdkColor); cdecl; external gdklib;
  180. {$ifndef GDK_DISABLE_DEPRECATED}
  181. procedure gdk_gc_set_font(gc:PGdkGC; font:PGdkFont); cdecl; external gdklib;
  182. {$endif}
  183. { GDK_DISABLE_DEPRECATED }
  184. procedure gdk_gc_set_function(gc:PGdkGC; _function:TGdkFunction); cdecl; external gdklib;
  185. procedure gdk_gc_set_fill(gc:PGdkGC; fill:TGdkFill); cdecl; external gdklib;
  186. procedure gdk_gc_set_tile(gc:PGdkGC; tile:PGdkPixmap); cdecl; external gdklib;
  187. procedure gdk_gc_set_stipple(gc:PGdkGC; stipple:PGdkPixmap); cdecl; external gdklib;
  188. procedure gdk_gc_set_ts_origin(gc:PGdkGC; x:gint; y:gint); cdecl; external gdklib;
  189. procedure gdk_gc_set_clip_origin(gc:PGdkGC; x:gint; y:gint); cdecl; external gdklib;
  190. procedure gdk_gc_set_clip_mask(gc:PGdkGC; mask:PGdkBitmap); cdecl; external gdklib;
  191. procedure gdk_gc_set_clip_rectangle(gc:PGdkGC; rectangle:PGdkRectangle); cdecl; external gdklib;
  192. procedure gdk_gc_set_clip_region(gc:PGdkGC; region:PGdkRegion); cdecl; external gdklib;
  193. procedure gdk_gc_set_subwindow(gc:PGdkGC; mode:TGdkSubwindowMode); cdecl; external gdklib;
  194. procedure gdk_gc_set_exposures(gc:PGdkGC; exposures:gboolean); cdecl; external gdklib;
  195. procedure gdk_gc_set_line_attributes(gc:PGdkGC; line_width:gint; line_style:TGdkLineStyle; cap_style:TGdkCapStyle; join_style:TGdkJoinStyle); cdecl; external gdklib;
  196. procedure gdk_gc_set_dashes(gc:PGdkGC; dash_offset:gint; dash_list:array of gint8; n:gint); cdecl; external gdklib;
  197. procedure gdk_gc_offset(gc:PGdkGC; x_offset:gint; y_offset:gint); cdecl; external gdklib;
  198. procedure gdk_gc_copy(dst_gc:PGdkGC; src_gc:PGdkGC); cdecl; external gdklib;
  199. procedure gdk_gc_set_colormap(gc:PGdkGC; colormap:PGdkColormap); cdecl; external gdklib;
  200. function gdk_gc_get_colormap(gc:PGdkGC):PGdkColormap; cdecl; external gdklib;
  201. procedure gdk_gc_set_rgb_fg_color(gc:PGdkGC; color:PGdkColor); cdecl; external gdklib;
  202. procedure gdk_gc_set_rgb_bg_color(gc:PGdkGC; color:PGdkColor); cdecl; external gdklib;
  203. function gdk_gc_get_screen(gc:PGdkGC):PGdkScreen; cdecl; external gdklib;
  204. {$ifndef GDK_DISABLE_DEPRECATED}
  205. procedure gdk_gc_destroy(gc:PGdkGC);
  206. {$endif}
  207. {$endif read_interface_rest}
  208. //------------------------------------------------------------------------------
  209. {$IFDEF read_implementation}
  210. function GDK_TYPE_GC : GType;
  211. begin
  212. GDK_TYPE_GC:=gdk_gc_get_type;
  213. end;
  214. function GDK_GC(anObject : Pointer) : PGdkGC;
  215. begin
  216. GDK_GC:=PGdkGC(G_TYPE_CHECK_INSTANCE_CAST(anObject,GDK_TYPE_GC));
  217. end;
  218. function GDK_GC_CLASS(klass : Pointer) : PGdkGCClass;
  219. begin
  220. GDK_GC_CLASS:=PGdkGCClass(G_TYPE_CHECK_CLASS_CAST(klass,GDK_TYPE_GC));
  221. end;
  222. function GDK_IS_GC(anObject : Pointer) : boolean;
  223. begin
  224. GDK_IS_GC:=G_TYPE_CHECK_INSTANCE_TYPE(anObject,GDK_TYPE_GC);
  225. end;
  226. function GDK_IS_GC_CLASS(klass : Pointer) : boolean;
  227. begin
  228. GDK_IS_GC_CLASS:=G_TYPE_CHECK_CLASS_TYPE(klass,GDK_TYPE_GC);
  229. end;
  230. function GDK_GC_GET_CLASS(obj : Pointer) : PGdkGCClass;
  231. begin
  232. GDK_GC_GET_CLASS:=PGdkGCClass(G_TYPE_INSTANCE_GET_CLASS(obj,GDK_TYPE_GC));
  233. end;
  234. procedure gdk_gc_destroy(gc:PGdkGC);
  235. begin
  236. g_object_unref(G_OBJECT(gc));
  237. end;
  238. {$ENDIF}