gtkclist.inc 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713
  1. // included by gtk2.pas
  2. {$IFDEF read_forward_definitions}
  3. {$ENDIF read_forward_definitions}
  4. //------------------------------------------------------------------------------
  5. {$IFDEF read_interface_types}
  6. PGtkCList = ^TGtkCList;
  7. PGtkCListColumn = ^TGtkCListColumn;
  8. PGtkCListRow = ^TGtkCListRow;
  9. PGtkCell = ^TGtkCell;
  10. { cell types }
  11. PGtkCellType = ^TGtkCellType;
  12. TGtkCellType = (
  13. GTK_CELL_EMPTY,
  14. GTK_CELL_TEXT,
  15. GTK_CELL_PIXMAP,
  16. GTK_CELL_PIXTEXT,
  17. GTK_CELL_WIDGET
  18. );
  19. PGtkCListDragPos = ^TGtkCListDragPos;
  20. TGtkCListDragPos = (
  21. GTK_CLIST_DRAG_NONE,
  22. GTK_CLIST_DRAG_BEFORE,
  23. GTK_CLIST_DRAG_INTO,
  24. GTK_CLIST_DRAG_AFTER
  25. );
  26. PGtkButtonAction = ^TGtkButtonAction;
  27. TGtkButtonAction = longint;
  28. TGtkCListCompareFunc = function (clist:PGtkCList; ptr1:gconstpointer; ptr2:gconstpointer):gint; cdecl;
  29. PGtkCListCellInfo = ^TGtkCListCellInfo;
  30. TGtkCListCellInfo = record
  31. row : gint;
  32. column : gint;
  33. end;
  34. PGtkCListDestInfo = ^TGtkCListDestInfo;
  35. TGtkCListDestInfo = record
  36. cell : TGtkCListCellInfo;
  37. insert_pos : TGtkCListDragPos;
  38. end;
  39. { mem chunks }
  40. { allocation rectangle after the conatiner_border_width
  41. and the width of the shadow border }
  42. { rows }
  43. { columns }
  44. { dynamicly allocated array of column structures }
  45. { the scrolling window and its height and width to
  46. make things a little speedier }
  47. { offsets for scrolling }
  48. { border shadow style }
  49. { the list's selection mode (gtkenums.h) }
  50. { list of selected rows }
  51. { mouse buttons }
  52. { dnd }
  53. { scroll adjustments }
  54. { xor GC for the vertical drag line }
  55. { gc for drawing unselected cells }
  56. { cursor used to indicate dragging }
  57. { the current x-pixel location of the xor-drag line }
  58. { focus handling }
  59. { dragging the selection }
  60. TGtkCList = record
  61. container : TGtkContainer;
  62. flags : guint16;
  63. row_mem_chunk : PGMemChunk;
  64. cell_mem_chunk : PGMemChunk;
  65. freeze_count : guint;
  66. internal_allocation : TGdkRectangle;
  67. rows : gint;
  68. row_height : gint;
  69. row_list : PGList;
  70. row_list_end : PGList;
  71. columns : gint;
  72. column_title_area : TGdkRectangle;
  73. title_window : PGdkWindow;
  74. column : PGtkCListColumn;
  75. clist_window : PGdkWindow;
  76. clist_window_width : gint;
  77. clist_window_height : gint;
  78. hoffset : gint;
  79. voffset : gint;
  80. shadow_type : TGtkShadowType;
  81. selection_mode : TGtkSelectionMode;
  82. selection : PGList;
  83. selection_end : PGList;
  84. undo_selection : PGList;
  85. undo_unselection : PGList;
  86. undo_anchor : gint;
  87. button_actions : array[0..4] of guint8;
  88. drag_button : guint8;
  89. click_cell : TGtkCListCellInfo;
  90. hadjustment : PGtkAdjustment;
  91. vadjustment : PGtkAdjustment;
  92. xor_gc : PGdkGC;
  93. fg_gc : PGdkGC;
  94. bg_gc : PGdkGC;
  95. cursor_drag : PGdkCursor;
  96. x_drag : gint;
  97. focus_row : gint;
  98. focus_header_column : gint;
  99. anchor : gint;
  100. anchor_state : TGtkStateType;
  101. drag_pos : gint;
  102. htimer : gint;
  103. vtimer : gint;
  104. sort_type : TGtkSortType;
  105. compare : TGtkCListCompareFunc;
  106. sort_column : gint;
  107. drag_highlight_row : gint;
  108. drag_highlight_pos : TGtkCListDragPos;
  109. end;
  110. PGtkCListClass = ^TGtkCListClass;
  111. TGtkCListClass = record
  112. parent_class : TGtkContainerClass;
  113. set_scroll_adjustments : procedure (clist:PGtkCList; hadjustment:PGtkAdjustment; vadjustment:PGtkAdjustment); cdecl;
  114. refresh : procedure (clist:PGtkCList); cdecl;
  115. select_row : procedure (clist:PGtkCList; row:gint; column:gint; event:PGdkEvent); cdecl;
  116. unselect_row : procedure (clist:PGtkCList; row:gint; column:gint; event:PGdkEvent); cdecl;
  117. row_move : procedure (clist:PGtkCList; source_row:gint; dest_row:gint); cdecl;
  118. click_column : procedure (clist:PGtkCList; column:gint); cdecl;
  119. resize_column : procedure (clist:PGtkCList; column:gint; width:gint); cdecl;
  120. toggle_focus_row : procedure (clist:PGtkCList); cdecl;
  121. select_all : procedure (clist:PGtkCList); cdecl;
  122. unselect_all : procedure (clist:PGtkCList); cdecl;
  123. undo_selection : procedure (clist:PGtkCList); cdecl;
  124. start_selection : procedure (clist:PGtkCList); cdecl;
  125. end_selection : procedure (clist:PGtkCList); cdecl;
  126. extend_selection : procedure (clist:PGtkCList; scroll_type:TGtkScrollType; position:gfloat; auto_start_selection:gboolean); cdecl;
  127. scroll_horizontal : procedure (clist:PGtkCList; scroll_type:TGtkScrollType; position:gfloat); cdecl;
  128. scroll_vertical : procedure (clist:PGtkCList; scroll_type:TGtkScrollType; position:gfloat); cdecl;
  129. toggle_add_mode : procedure (clist:PGtkCList); cdecl;
  130. abort_column_resize : procedure (clist:PGtkCList); cdecl;
  131. resync_selection : procedure (clist:PGtkCList; event:PGdkEvent); cdecl;
  132. selection_find : function (clist:PGtkCList; row_number:gint; row_list_element:PGList):PGList; cdecl;
  133. draw_row : procedure (clist:PGtkCList; area:PGdkRectangle; row:gint; clist_row:PGtkCListRow); cdecl;
  134. draw_drag_highlight : procedure (clist:PGtkCList; target_row:PGtkCListRow; target_row_number:gint; drag_pos:TGtkCListDragPos); cdecl;
  135. clear : procedure (clist:PGtkCList); cdecl;
  136. fake_unselect_all : procedure (clist:PGtkCList; row:gint); cdecl;
  137. sort_list : procedure (clist:PGtkCList); cdecl;
  138. insert_row : function (clist:PGtkCList; row:gint; text:array of Pgchar):gint; cdecl;
  139. remove_row : procedure (clist:PGtkCList; row:gint); cdecl;
  140. set_cell_contents : procedure (clist:PGtkCList; clist_row:PGtkCListRow; column:gint; _type:TGtkCellType; text:Pgchar;
  141. spacing:guint8; pixmap:PGdkPixmap; mask:PGdkBitmap); cdecl;
  142. cell_size_request : procedure (clist:PGtkCList; clist_row:PGtkCListRow; column:gint; requisition:PGtkRequisition); cdecl;
  143. end;
  144. TGtkCListColumn = record
  145. title : Pgchar;
  146. area : TGdkRectangle;
  147. button : PGtkWidget;
  148. window : PGdkWindow;
  149. width : gint;
  150. min_width : gint;
  151. max_width : gint;
  152. justification : TGtkJustification;
  153. flag0 : word;
  154. end;
  155. TGtkCListRow = record
  156. cell : PGtkCell;
  157. state : TGtkStateType;
  158. foreground : TGdkColor;
  159. background : TGdkColor;
  160. style : PGtkStyle;
  161. data : gpointer;
  162. destroy : TGtkDestroyNotify;
  163. flag0 : word;
  164. end;
  165. { Cell Structures }
  166. PGtkCellText = ^TGtkCellText;
  167. TGtkCellText = record
  168. _type : TGtkCellType;
  169. vertical : gint16;
  170. horizontal : gint16;
  171. style : PGtkStyle;
  172. text : Pgchar;
  173. end;
  174. PGtkCellPixmap = ^TGtkCellPixmap;
  175. TGtkCellPixmap = record
  176. _type : TGtkCellType;
  177. vertical : gint16;
  178. horizontal : gint16;
  179. style : PGtkStyle;
  180. pixmap : PGdkPixmap;
  181. mask : PGdkBitmap;
  182. end;
  183. PGtkCellPixText = ^TGtkCellPixText;
  184. TGtkCellPixText = record
  185. _type : TGtkCellType;
  186. vertical : gint16;
  187. horizontal : gint16;
  188. style : PGtkStyle;
  189. text : Pgchar;
  190. spacing : guint8;
  191. pixmap : PGdkPixmap;
  192. mask : PGdkBitmap;
  193. end;
  194. PGtkCellWidget = ^TGtkCellWidget;
  195. TGtkCellWidget = record
  196. _type : TGtkCellType;
  197. vertical : gint16;
  198. horizontal : gint16;
  199. style : PGtkStyle;
  200. widget : PGtkWidget;
  201. end;
  202. TGtkCell = record
  203. _type : TGtkCellType;
  204. vertical : gint16;
  205. horizontal : gint16;
  206. style : PGtkStyle;
  207. u : record
  208. case longint of
  209. 0 : ( text : Pgchar );
  210. 1 : ( pm : record
  211. pixmap : PGdkPixmap;
  212. mask : PGdkBitmap;
  213. end );
  214. 2 : ( pt : record
  215. text : Pgchar;
  216. spacing : guint8;
  217. pixmap : PGdkPixmap;
  218. mask : PGdkBitmap;
  219. end );
  220. 3 : ( widget : PGtkWidget );
  221. end;
  222. end;
  223. {$ENDIF read_interface_types}
  224. //------------------------------------------------------------------------------
  225. {$IFDEF read_interface_rest}
  226. const
  227. { clist flags }
  228. GTK_CLIST_IN_DRAG = 1 shl 0;
  229. GTK_CLIST_ROW_HEIGHT_SET = 1 shl 1;
  230. GTK_CLIST_SHOW_TITLES = 1 shl 2;
  231. GTK_CLIST_ADD_MODE = 1 shl 4;
  232. GTK_CLIST_AUTO_SORT = 1 shl 5;
  233. GTK_CLIST_AUTO_RESIZE_BLOCKED = 1 shl 6;
  234. GTK_CLIST_REORDERABLE = 1 shl 7;
  235. GTK_CLIST_USE_DRAG_ICONS = 1 shl 8;
  236. GTK_CLIST_DRAW_DRAG_LINE = 1 shl 9;
  237. GTK_CLIST_DRAW_DRAG_RECT = 1 shl 10;
  238. GTK_BUTTON_IGNORED = 0;
  239. GTK_BUTTON_SELECTS = 1 shl 0;
  240. GTK_BUTTON_DRAGS = 1 shl 1;
  241. GTK_BUTTON_EXPANDS = 1 shl 2;
  242. const
  243. bm_TGtkCListColumn_visible = $1;
  244. bp_TGtkCListColumn_visible = 0;
  245. bm_TGtkCListColumn_width_set = $2;
  246. bp_TGtkCListColumn_width_set = 1;
  247. bm_TGtkCListColumn_resizeable = $4;
  248. bp_TGtkCListColumn_resizeable = 2;
  249. bm_TGtkCListColumn_auto_resize = $8;
  250. bp_TGtkCListColumn_auto_resize = 3;
  251. bm_TGtkCListColumn_button_passive = $10;
  252. bp_TGtkCListColumn_button_passive = 4;
  253. bm_TGtkCListRow_fg_set = $1;
  254. bp_TGtkCListRow_fg_set = 0;
  255. bm_TGtkCListRow_bg_set = $2;
  256. bp_TGtkCListRow_bg_set = 1;
  257. bm_TGtkCListRow_selectable = $4;
  258. bp_TGtkCListRow_selectable = 2;
  259. function GTK_TYPE_CLIST : GType;
  260. function GTK_CLIST(obj: pointer) : PGtkCList;
  261. function GTK_CLIST_CLASS(klass: pointer) : PGtkCListClass;
  262. function GTK_IS_CLIST(obj: pointer) : boolean;
  263. function GTK_IS_CLIST_CLASS(klass: pointer) : boolean;
  264. function GTK_CLIST_GET_CLASS(obj: pointer) : PGtkCListClass;
  265. function GTK_CLIST_FLAGS(clist : pointer) : guint16;
  266. procedure GTK_CLIST_SET_FLAG(clist: PGtkCList; flag: guint16);
  267. // (GTK_CLIST_FLAGS (clist) |= (GTK_ ## flag)) }
  268. procedure GTK_CLIST_UNSET_FLAG(clist: PGtkCList; flag: guint16);
  269. // (GTK_CLIST_FLAGS (clist) &= ~(GTK_ ## flag)) }
  270. function GTK_CLIST_IN_DRAG_get(clist : pointer) : boolean;
  271. function GTK_CLIST_ROW_HEIGHT_SET_get(clist : pointer) : boolean;
  272. function GTK_CLIST_SHOW_TITLES_get(clist : pointer) : boolean;
  273. function GTK_CLIST_ADD_MODE_get(clist : pointer) : boolean;
  274. function GTK_CLIST_AUTO_SORT_get(clist : pointer) : boolean;
  275. function GTK_CLIST_AUTO_RESIZE_BLOCKED_get(clist : pointer) : boolean;
  276. function GTK_CLIST_REORDERABLE_get(clist : pointer) : boolean;
  277. function GTK_CLIST_USE_DRAG_ICONS_get(clist : pointer) : boolean;
  278. function GTK_CLIST_DRAW_DRAG_LINE_get(clist : pointer) : boolean;
  279. function GTK_CLIST_DRAW_DRAG_RECT_get(clist : pointer) : boolean;
  280. function GTK_CLIST_ROW_get(_glist_ : PGList) : PGtkCListRow;
  281. { pointer casting for cells }
  282. function GTK_CELL_TEXT_get(cell : pointer) : PGtkCellText;
  283. function GTK_CELL_PIXMAP_get(cell : pointer) : PGtkCellPixmap;
  284. function GTK_CELL_PIXTEXT_get(cell : pointer) : PGtkCellPixText;
  285. function GTK_CELL_WIDGET_get(cell : pointer) : PGtkCellWidget;
  286. function visible(var a : TGtkCListColumn) : guint; overload;
  287. procedure set_visible(var a : TGtkCListColumn; __visible : guint); overload;
  288. function width_set(var a : TGtkCListColumn) : guint;
  289. procedure set_width_set(var a : TGtkCListColumn; __width_set : guint);
  290. function resizeable(var a : TGtkCListColumn) : guint;
  291. procedure set_resizeable(var a : TGtkCListColumn; __resizeable : guint);
  292. function auto_resize(var a : TGtkCListColumn) : guint;
  293. procedure set_auto_resize(var a : TGtkCListColumn; __auto_resize : guint);
  294. function button_passive(var a : TGtkCListColumn) : guint;
  295. procedure set_button_passive(var a : TGtkCListColumn; __button_passive : guint);
  296. function fg_set(var a : TGtkCListRow) : guint;
  297. procedure set_fg_set(var a : TGtkCListRow; __fg_set : guint);
  298. function bg_set(var a : TGtkCListRow) : guint;
  299. procedure set_bg_set(var a : TGtkCListRow; __bg_set : guint);
  300. function selectable(var a : TGtkCListRow) : guint;
  301. procedure set_selectable(var a : TGtkCListRow; __selectable : guint);
  302. function gtk_clist_get_type:TGtkType; cdecl; external gtklib;
  303. { create a new GtkCList }
  304. function gtk_clist_new(columns:gint):PGtkWidget; cdecl; external gtklib;
  305. function gtk_clist_new_with_titles(columns:gint):PGtkWidget; varargs; cdecl; external gtklib;
  306. { set adjustments of clist }
  307. procedure gtk_clist_set_hadjustment(clist:PGtkCList; adjustment:PGtkAdjustment); cdecl; external gtklib;
  308. procedure gtk_clist_set_vadjustment(clist:PGtkCList; adjustment:PGtkAdjustment); cdecl; external gtklib;
  309. { get adjustments of clist }
  310. function gtk_clist_get_hadjustment(clist:PGtkCList):PGtkAdjustment; cdecl; external gtklib;
  311. function gtk_clist_get_vadjustment(clist:PGtkCList):PGtkAdjustment; cdecl; external gtklib;
  312. { set the border style of the clist }
  313. procedure gtk_clist_set_shadow_type(clist:PGtkCList; _type:TGtkShadowType); cdecl; external gtklib;
  314. { set the clist's selection mode }
  315. procedure gtk_clist_set_selection_mode(clist:PGtkCList; mode:TGtkSelectionMode); cdecl; external gtklib;
  316. { enable clists reorder ability }
  317. procedure gtk_clist_set_reorderable(clist:PGtkCList; reorderable:gboolean); cdecl; external gtklib;
  318. procedure gtk_clist_set_use_drag_icons(clist:PGtkCList; use_icons:gboolean); cdecl; external gtklib;
  319. procedure gtk_clist_set_button_actions(clist:PGtkCList; button:guint; button_actions:guint8); cdecl; external gtklib;
  320. { freeze all visual updates of the list, and then thaw the list after
  321. you have made a number of changes and the updates wil occure in a
  322. more efficent mannor than if you made them on a unfrozen list
  323. }
  324. procedure gtk_clist_freeze(clist:PGtkCList); cdecl; external gtklib;
  325. procedure gtk_clist_thaw(clist:PGtkCList); cdecl; external gtklib;
  326. { show and hide the column title buttons }
  327. procedure gtk_clist_column_titles_show(clist:PGtkCList); cdecl; external gtklib;
  328. procedure gtk_clist_column_titles_hide(clist:PGtkCList); cdecl; external gtklib;
  329. { set the column title to be a active title (responds to button presses,
  330. prelights, and grabs keyboard focus), or passive where it acts as just
  331. a title
  332. }
  333. procedure gtk_clist_column_title_active(clist:PGtkCList; column:gint); cdecl; external gtklib;
  334. procedure gtk_clist_column_title_passive(clist:PGtkCList; column:gint); cdecl; external gtklib;
  335. procedure gtk_clist_column_titles_active(clist:PGtkCList); cdecl; external gtklib;
  336. procedure gtk_clist_column_titles_passive(clist:PGtkCList); cdecl; external gtklib;
  337. { set the title in the column title button }
  338. procedure gtk_clist_set_column_title(clist:PGtkCList; column:gint; title:Pgchar); cdecl; external gtklib;
  339. { returns the title of column. Returns NULL if title is not set }
  340. function gtk_clist_get_column_title(clist:PGtkCList; column:gint):Pgchar; cdecl; external gtklib;
  341. { set a widget instead of a title for the column title button }
  342. procedure gtk_clist_set_column_widget(clist:PGtkCList; column:gint; widget:PGtkWidget); cdecl; external gtklib;
  343. { returns the column widget }
  344. function gtk_clist_get_column_widget(clist:PGtkCList; column:gint):PGtkWidget; cdecl; external gtklib;
  345. { set the justification on a column }
  346. procedure gtk_clist_set_column_justification(clist:PGtkCList; column:gint; justification:TGtkJustification); cdecl; external gtklib;
  347. { set visibility of a column }
  348. procedure gtk_clist_set_column_visibility(clist:PGtkCList; column:gint; visible:gboolean); cdecl; external gtklib;
  349. { enable/disable column resize operations by mouse }
  350. procedure gtk_clist_set_column_resizeable(clist:PGtkCList; column:gint; resizeable:gboolean); cdecl; external gtklib;
  351. { resize column automatically to its optimal width }
  352. procedure gtk_clist_set_column_auto_resize(clist:PGtkCList; column:gint; auto_resize:gboolean); cdecl; external gtklib;
  353. function gtk_clist_columns_autosize(clist:PGtkCList):gint; cdecl; external gtklib;
  354. { return the optimal column width, i.e. maximum of all cell widths }
  355. function gtk_clist_optimal_column_width(clist:PGtkCList; column:gint):gint; cdecl; external gtklib;
  356. { set the pixel width of a column; this is a necessary step in
  357. creating a CList because otherwise the column width is chozen from
  358. the width of the column title, which will never be right
  359. }
  360. procedure gtk_clist_set_column_width(clist:PGtkCList; column:gint; width:gint); cdecl; external gtklib;
  361. { set column minimum/maximum width. min/max_width < 0 => no restriction }
  362. procedure gtk_clist_set_column_min_width(clist:PGtkCList; column:gint; min_width:gint); cdecl; external gtklib;
  363. procedure gtk_clist_set_column_max_width(clist:PGtkCList; column:gint; max_width:gint); cdecl; external gtklib;
  364. { change the height of the rows, the default (height=0) is
  365. the hight of the current font.
  366. }
  367. procedure gtk_clist_set_row_height(clist:PGtkCList; height:guint); cdecl; external gtklib;
  368. { scroll the viewing area of the list to the given column and row;
  369. row_align and col_align are between 0-1 representing the location the
  370. row should appear on the screnn, 0.0 being top or left, 1.0 being
  371. bottom or right; if row or column is -1 then then there is no change
  372. }
  373. procedure gtk_clist_moveto(clist:PGtkCList; row:gint; column:gint; row_align:gfloat; col_align:gfloat); cdecl; external gtklib;
  374. { returns whether the row is visible }
  375. function gtk_clist_row_is_visible(clist:PGtkCList; row:gint):TGtkVisibility; cdecl; external gtklib;
  376. { returns the cell type }
  377. function gtk_clist_get_cell_type(clist:PGtkCList; row:gint; column:gint):TGtkCellType; cdecl; external gtklib;
  378. { sets a given cell's text, replacing its current contents }
  379. procedure gtk_clist_set_text(clist:PGtkCList; row:gint; column:gint; text:Pgchar); cdecl; external gtklib;
  380. { for the "get" functions, any of the return pointer can be
  381. NULL if you are not interested
  382. }
  383. function gtk_clist_get_text(clist:PGtkCList; row:gint; column:gint; text:PPgchar):gint; cdecl; external gtklib;
  384. { sets a given cell's pixmap, replacing its current contents }
  385. procedure gtk_clist_set_pixmap(clist:PGtkCList; row:gint; column:gint; pixmap:PGdkPixmap; mask:PGdkBitmap); cdecl; external gtklib;
  386. function gtk_clist_get_pixmap(clist:PGtkCList; row:gint; column:gint; var pixmap:PGdkPixmap; var mask:PGdkBitmap):gint; cdecl; external gtklib;
  387. { sets a given cell's pixmap and text, replacing its current contents }
  388. procedure gtk_clist_set_pixtext(clist:PGtkCList; row:gint; column:gint; text:Pgchar; spacing:guint8;
  389. pixmap:PGdkPixmap; mask:PGdkBitmap); cdecl; external gtklib;
  390. function gtk_clist_get_pixtext(clist:PGtkCList; row:gint; column:gint; text:PPgchar; spacing:Pguint8;
  391. var pixmap:PGdkPixmap; var mask:PGdkBitmap):gint; cdecl; external gtklib;
  392. { sets the foreground color of a row, the color must already
  393. be allocated
  394. }
  395. procedure gtk_clist_set_foreground(clist:PGtkCList; row:gint; color:PGdkColor); cdecl; external gtklib;
  396. { sets the background color of a row, the color must already
  397. be allocated
  398. }
  399. procedure gtk_clist_set_background(clist:PGtkCList; row:gint; color:PGdkColor); cdecl; external gtklib;
  400. { set / get cell styles }
  401. procedure gtk_clist_set_cell_style(clist:PGtkCList; row:gint; column:gint; style:PGtkStyle); cdecl; external gtklib;
  402. function gtk_clist_get_cell_style(clist:PGtkCList; row:gint; column:gint):PGtkStyle; cdecl; external gtklib;
  403. procedure gtk_clist_set_row_style(clist:PGtkCList; row:gint; style:PGtkStyle); cdecl; external gtklib;
  404. function gtk_clist_get_row_style(clist:PGtkCList; row:gint):PGtkStyle; cdecl; external gtklib;
  405. { this sets a horizontal and vertical shift for drawing
  406. the contents of a cell; it can be positive or negitive;
  407. this is particulary useful for indenting items in a column
  408. }
  409. procedure gtk_clist_set_shift(clist:PGtkCList; row:gint; column:gint; vertical:gint; horizontal:gint); cdecl; external gtklib;
  410. { set/get selectable flag of a single row }
  411. procedure gtk_clist_set_selectable(clist:PGtkCList; row:gint; selectable:gboolean); cdecl; external gtklib;
  412. function gtk_clist_get_selectable(clist:PGtkCList; row:gint):gboolean; cdecl; external gtklib;
  413. { prepend/append returns the index of the row you just added,
  414. making it easier to append and modify a row
  415. }
  416. function gtk_clist_prepend(clist:PGtkCList):gint; varargs; cdecl; external gtklib;
  417. function gtk_clist_append(clist:PGtkCList):gint; varargs; cdecl; external gtklib;
  418. { inserts a row at index row and returns the row where it was
  419. actually inserted (may be different from "row" in auto_sort mode)
  420. }
  421. function gtk_clist_insert(clist:PGtkCList; row:gint):gint; varargs; cdecl; external gtklib;
  422. { removes row at index row }
  423. procedure gtk_clist_remove(clist:PGtkCList; row:gint); cdecl; external gtklib;
  424. { sets a arbitrary data pointer for a given row }
  425. procedure gtk_clist_set_row_data(clist:PGtkCList; row:gint; data:gpointer); cdecl; external gtklib;
  426. { sets a data pointer for a given row with destroy notification }
  427. procedure gtk_clist_set_row_data_full(clist:PGtkCList; row:gint; data:gpointer; destroy:TGtkDestroyNotify); cdecl; external gtklib;
  428. { returns the data set for a row }
  429. function gtk_clist_get_row_data(clist:PGtkCList; row:gint):gpointer; cdecl; external gtklib;
  430. { givin a data pointer, find the first (and hopefully only!)
  431. row that points to that data, or -1 if none do
  432. }
  433. function gtk_clist_find_row_from_data(clist:PGtkCList; data:gpointer):gint; cdecl; external gtklib;
  434. { force selection of a row }
  435. procedure gtk_clist_select_row(clist:PGtkCList; row:gint; column:gint); cdecl; external gtklib;
  436. { force unselection of a row }
  437. procedure gtk_clist_unselect_row(clist:PGtkCList; row:gint; column:gint); cdecl; external gtklib;
  438. { undo the last select/unselect operation }
  439. procedure gtk_clist_undo_selection(clist:PGtkCList); cdecl; external gtklib;
  440. { clear the entire list -- this is much faster than removing
  441. each item with gtk_clist_remove
  442. }
  443. procedure gtk_clist_clear(clist:PGtkCList); cdecl; external gtklib;
  444. { return the row column corresponding to the x and y coordinates,
  445. the returned values are only valid if the x and y coordinates
  446. are respectively to a window == clist->clist_window
  447. }
  448. function gtk_clist_get_selection_info(clist:PGtkCList; x:gint; y:gint; row:Pgint; column:Pgint):gint; cdecl; external gtklib;
  449. { in multiple or extended mode, select all rows }
  450. procedure gtk_clist_select_all(clist:PGtkCList); cdecl; external gtklib;
  451. { in all modes except browse mode, deselect all rows }
  452. procedure gtk_clist_unselect_all(clist:PGtkCList); cdecl; external gtklib;
  453. { swap the position of two rows }
  454. procedure gtk_clist_swap_rows(clist:PGtkCList; row1:gint; row2:gint); cdecl; external gtklib;
  455. { move row from source_row position to dest_row position }
  456. procedure gtk_clist_row_move(clist:PGtkCList; source_row:gint; dest_row:gint); cdecl; external gtklib;
  457. { sets a compare function different to the default }
  458. procedure gtk_clist_set_compare_func(clist:PGtkCList; cmp_func:TGtkCListCompareFunc); cdecl; external gtklib;
  459. { the column to sort by }
  460. procedure gtk_clist_set_sort_column(clist:PGtkCList; column:gint); cdecl; external gtklib;
  461. { how to sort : ascending or descending }
  462. procedure gtk_clist_set_sort_type(clist:PGtkCList; sort_type:TGtkSortType); cdecl; external gtklib;
  463. { sort the list with the current compare function }
  464. procedure gtk_clist_sort(clist:PGtkCList); cdecl; external gtklib;
  465. { Automatically sort upon insertion }
  466. procedure gtk_clist_set_auto_sort(clist:PGtkCList; auto_sort:gboolean); cdecl; external gtklib;
  467. { Private function for clist, ctree }
  468. function _gtk_clist_create_cell_layout(clist:PGtkCList; clist_row:PGtkCListRow; column:gint):PPangoLayout; cdecl; external gtklib;
  469. {$ENDIF read_interface_rest}
  470. //------------------------------------------------------------------------------
  471. {$IFDEF read_implementation}
  472. function GTK_TYPE_CLIST : GType;
  473. begin
  474. GTK_TYPE_CLIST:=gtk_clist_get_type;
  475. end;
  476. function GTK_CLIST(obj: pointer) : PGtkCList;
  477. begin
  478. GTK_CLIST:=PGtkCList(GTK_CHECK_CAST(obj,GTK_TYPE_CLIST));
  479. end;
  480. function GTK_CLIST_CLASS(klass: pointer) : PGtkCListClass;
  481. begin
  482. GTK_CLIST_CLASS:=PGtkCListClass(GTK_CHECK_CLASS_CAST(klass,GTK_TYPE_CLIST));
  483. end;
  484. function GTK_IS_CLIST(obj: pointer) : boolean;
  485. begin
  486. GTK_IS_CLIST:=GTK_CHECK_TYPE(obj,GTK_TYPE_CLIST);
  487. end;
  488. function GTK_IS_CLIST_CLASS(klass: pointer) : boolean;
  489. begin
  490. GTK_IS_CLIST_CLASS:=GTK_CHECK_CLASS_TYPE(klass,GTK_TYPE_CLIST);
  491. end;
  492. function GTK_CLIST_GET_CLASS(obj: pointer) : PGtkCListClass;
  493. begin
  494. GTK_CLIST_GET_CLASS:=PGtkCListClass(GTK_CHECK_GET_CLASS(obj,GTK_TYPE_CLIST));
  495. end;
  496. function GTK_CLIST_FLAGS(clist : pointer) : guint16;
  497. begin
  498. GTK_CLIST_FLAGS:=GTK_CLIST(clist)^.flags;
  499. end;
  500. procedure GTK_CLIST_SET_FLAG(clist: PGtkCList; flag: guint16);
  501. begin
  502. clist^.flags:=GTK_CLIST(clist)^.flags or flag;
  503. end;
  504. procedure GTK_CLIST_UNSET_FLAG(clist: PGtkCList; flag: guint16);
  505. begin
  506. clist^.flags:=GTK_CLIST(clist)^.flags and not flag;
  507. end;
  508. function GTK_CLIST_IN_DRAG_get(clist : pointer) : boolean;
  509. begin
  510. GTK_CLIST_IN_DRAG_get:=((GTK_CLIST_FLAGS(clist)) and GTK_CLIST_IN_DRAG)<>0;
  511. end;
  512. function GTK_CLIST_ROW_HEIGHT_SET_get(clist : pointer) : boolean;
  513. begin
  514. GTK_CLIST_ROW_HEIGHT_SET_get:=((GTK_CLIST_FLAGS(clist)) and GTK_CLIST_ROW_HEIGHT_SET)<>0;
  515. end;
  516. function GTK_CLIST_SHOW_TITLES_get(clist : pointer) : boolean;
  517. begin
  518. GTK_CLIST_SHOW_TITLES_get:=((GTK_CLIST_FLAGS(clist)) and GTK_CLIST_SHOW_TITLES)<>0;
  519. end;
  520. function GTK_CLIST_ADD_MODE_get(clist : pointer) : boolean;
  521. begin
  522. GTK_CLIST_ADD_MODE_get:=((GTK_CLIST_FLAGS(clist)) and GTK_CLIST_ADD_MODE)<>0;
  523. end;
  524. function GTK_CLIST_AUTO_SORT_get(clist : pointer) : boolean;
  525. begin
  526. GTK_CLIST_AUTO_SORT_get:=((GTK_CLIST_FLAGS(clist)) and GTK_CLIST_AUTO_SORT)<>0;
  527. end;
  528. function GTK_CLIST_AUTO_RESIZE_BLOCKED_get(clist : pointer) : boolean;
  529. begin
  530. GTK_CLIST_AUTO_RESIZE_BLOCKED_get:=((GTK_CLIST_FLAGS(clist)) and GTK_CLIST_AUTO_RESIZE_BLOCKED)<>0;
  531. end;
  532. function GTK_CLIST_REORDERABLE_get(clist : pointer) : boolean;
  533. begin
  534. GTK_CLIST_REORDERABLE_get:=((GTK_CLIST_FLAGS(clist)) and GTK_CLIST_REORDERABLE)<>0;
  535. end;
  536. function GTK_CLIST_USE_DRAG_ICONS_get(clist : pointer) : boolean;
  537. begin
  538. GTK_CLIST_USE_DRAG_ICONS_get:=((GTK_CLIST_FLAGS(clist)) and GTK_CLIST_USE_DRAG_ICONS)<>0;
  539. end;
  540. function GTK_CLIST_DRAW_DRAG_LINE_get(clist : pointer) : boolean;
  541. begin
  542. GTK_CLIST_DRAW_DRAG_LINE_get:=((GTK_CLIST_FLAGS(clist)) and GTK_CLIST_DRAW_DRAG_LINE)<>0;
  543. end;
  544. function GTK_CLIST_DRAW_DRAG_RECT_get(clist : pointer) : boolean;
  545. begin
  546. GTK_CLIST_DRAW_DRAG_RECT_get:=((GTK_CLIST_FLAGS(clist)) and GTK_CLIST_DRAW_DRAG_RECT)<>0;
  547. end;
  548. function GTK_CLIST_ROW_get(_glist_ : PGList) : PGtkCListRow;
  549. begin
  550. GTK_CLIST_ROW_get:=PGtkCListRow(_glist_^.data);
  551. end;
  552. function GTK_CELL_TEXT_get(cell : pointer) : PGtkCellText;
  553. begin
  554. GTK_CELL_TEXT_get:=PGtkCellText(@(cell));
  555. end;
  556. function GTK_CELL_PIXMAP_get(cell : pointer) : PGtkCellPixmap;
  557. begin
  558. GTK_CELL_PIXMAP_get:=PGtkCellPixmap(@(cell));
  559. end;
  560. function GTK_CELL_PIXTEXT_get(cell : pointer) : PGtkCellPixText;
  561. begin
  562. GTK_CELL_PIXTEXT_get:=PGtkCellPixText(@(cell));
  563. end;
  564. function GTK_CELL_WIDGET_get(cell : pointer) : PGtkCellWidget;
  565. begin
  566. GTK_CELL_WIDGET_get:=PGtkCellWidget(@(cell));
  567. end;
  568. function visible(var a : TGtkCListColumn) : guint;
  569. begin
  570. visible:=(a.flag0 and bm_TGtkCListColumn_visible) shr bp_TGtkCListColumn_visible;
  571. end;
  572. procedure set_visible(var a : TGtkCListColumn; __visible : guint);
  573. begin
  574. a.flag0:=a.flag0 or ((__visible shl bp_TGtkCListColumn_visible) and bm_TGtkCListColumn_visible);
  575. end;
  576. function width_set(var a : TGtkCListColumn) : guint;
  577. begin
  578. width_set:=(a.flag0 and bm_TGtkCListColumn_width_set) shr bp_TGtkCListColumn_width_set;
  579. end;
  580. procedure set_width_set(var a : TGtkCListColumn; __width_set : guint);
  581. begin
  582. a.flag0:=a.flag0 or ((__width_set shl bp_TGtkCListColumn_width_set) and bm_TGtkCListColumn_width_set);
  583. end;
  584. function resizeable(var a : TGtkCListColumn) : guint;
  585. begin
  586. resizeable:=(a.flag0 and bm_TGtkCListColumn_resizeable) shr bp_TGtkCListColumn_resizeable;
  587. end;
  588. procedure set_resizeable(var a : TGtkCListColumn; __resizeable : guint);
  589. begin
  590. a.flag0:=a.flag0 or ((__resizeable shl bp_TGtkCListColumn_resizeable) and bm_TGtkCListColumn_resizeable);
  591. end;
  592. function auto_resize(var a : TGtkCListColumn) : guint;
  593. begin
  594. auto_resize:=(a.flag0 and bm_TGtkCListColumn_auto_resize) shr bp_TGtkCListColumn_auto_resize;
  595. end;
  596. procedure set_auto_resize(var a : TGtkCListColumn; __auto_resize : guint);
  597. begin
  598. a.flag0:=a.flag0 or ((__auto_resize shl bp_TGtkCListColumn_auto_resize) and bm_TGtkCListColumn_auto_resize);
  599. end;
  600. function button_passive(var a : TGtkCListColumn) : guint;
  601. begin
  602. button_passive:=(a.flag0 and bm_TGtkCListColumn_button_passive) shr bp_TGtkCListColumn_button_passive;
  603. end;
  604. procedure set_button_passive(var a : TGtkCListColumn; __button_passive : guint);
  605. begin
  606. a.flag0:=a.flag0 or ((__button_passive shl bp_TGtkCListColumn_button_passive) and bm_TGtkCListColumn_button_passive);
  607. end;
  608. function fg_set(var a : TGtkCListRow) : guint;
  609. begin
  610. fg_set:=(a.flag0 and bm_TGtkCListRow_fg_set) shr bp_TGtkCListRow_fg_set;
  611. end;
  612. procedure set_fg_set(var a : TGtkCListRow; __fg_set : guint);
  613. begin
  614. a.flag0:=a.flag0 or ((__fg_set shl bp_TGtkCListRow_fg_set) and bm_TGtkCListRow_fg_set);
  615. end;
  616. function bg_set(var a : TGtkCListRow) : guint;
  617. begin
  618. bg_set:=(a.flag0 and bm_TGtkCListRow_bg_set) shr bp_TGtkCListRow_bg_set;
  619. end;
  620. procedure set_bg_set(var a : TGtkCListRow; __bg_set : guint);
  621. begin
  622. a.flag0:=a.flag0 or ((__bg_set shl bp_TGtkCListRow_bg_set) and bm_TGtkCListRow_bg_set);
  623. end;
  624. function selectable(var a : TGtkCListRow) : guint;
  625. begin
  626. selectable:=(a.flag0 and bm_TGtkCListRow_selectable) shr bp_TGtkCListRow_selectable;
  627. end;
  628. procedure set_selectable(var a : TGtkCListRow; __selectable : guint);
  629. begin
  630. a.flag0:=a.flag0 or ((__selectable shl bp_TGtkCListRow_selectable) and bm_TGtkCListRow_selectable);
  631. end;
  632. {$ENDIF read_implementation}
  633. // included by gtk2.pas