PageRenderTime 59ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 1ms

/src/wrappers/gtk/library/gtk_tree_view.e

http://github.com/tybor/Liberty
Specman e | 1487 lines | 359 code | 272 blank | 856 comment | 14 complexity | fccf372578bd2f45e8125d1ba7ce04b4 MD5 | raw file
Possible License(s): GPL-3.0, LGPL-2.1, GPL-2.0
  1. indexing
  2. description: "GtkTreeView A widget for displaying both trees and lists."
  3. copyright: "[
  4. Copyright (C) 2006 eiffel-libraries team, GTK+ team
  5. This library is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU Lesser General Public License
  7. as published by the Free Software Foundation; either version 2.1 of
  8. the License, or (at your option) any later version.
  9. This library is distributed in the hope that it will be useful, but
  10. 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. You should have received a copy of the GNU Lesser General Public
  14. License along with this library; if not, write to the Free Software
  15. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  16. 02110-1301 USA
  17. ]"
  18. date: "$Date:$"
  19. revision: "$Revision:$"
  20. class GTK_TREE_VIEW
  21. inherit
  22. GTK_CONTAINER
  23. -- GtkTreeView implements AtkImplementorIface.
  24. insert
  25. GTK_TREE_VIEW_EXTERNALS
  26. GTK_TREE_VIEW_DROP_POSITION
  27. creation make, with_model, from_external_pointer
  28. feature {} -- Creation
  29. make is
  30. -- Creates a new GtkTreeView widget.
  31. require gtk_initialized: gtk.is_initialized
  32. do
  33. from_external_pointer (gtk_tree_view_new)
  34. end
  35. with_model (a_model: GTK_TREE_MODEL) is
  36. -- Creates a new GtkTreeView widget with the model initialized to `a_model'.
  37. require
  38. gtk_initialized: gtk.is_initialized
  39. valid_model: a_model /= Void
  40. do
  41. from_external_pointer (gtk_tree_view_new_with_model (a_model.handle))
  42. end
  43. feature
  44. model: GTK_TREE_MODEL is
  45. -- The model the GtkTreeView is based on. Void if the model
  46. -- is unset.
  47. local model_factory: G_OBJECT_EXPANDED_FACTORY [GTK_TREE_MODEL]
  48. do
  49. Result := model_factory.wrapper_or_void(gtk_tree_view_get_model (handle))
  50. end
  51. set_model (a_model: GTK_TREE_MODEL) is
  52. -- Sets the model for a GtkTreeView. If the tree view already
  53. -- has a model set, it will remove it before setting the new
  54. -- model.
  55. require valid_model: a_model /= Void
  56. do
  57. gtk_tree_view_set_model (handle, a_model.handle)
  58. end
  59. unset_model is
  60. -- Unset the old model.
  61. do
  62. gtk_tree_view_set_model (handle, default_pointer)
  63. end
  64. feature
  65. selection: GTK_TREE_SELECTION is
  66. -- the GtkTreeSelection associated with tree view.
  67. local factory: G_OBJECT_EXPANDED_FACTORY[GTK_TREE_SELECTION]
  68. do
  69. Result := factory.wrapper(gtk_tree_view_get_selection (handle))
  70. end
  71. hadjustment: GTK_ADJUSTMENT is
  72. -- the GtkAdjustment currently being used for the horizontal
  73. -- aspect or Void if none is currently being used.
  74. local factory: G_OBJECT_EXPANDED_FACTORY[GTK_ADJUSTMENT]
  75. do
  76. Result := factory.wrapper(gtk_tree_view_get_hadjustment (handle))
  77. end
  78. set_hadjustment (an_adjustment: GTK_ADJUSTMENT) is
  79. -- Sets the GtkAdjustment for the current orizontal aspect.
  80. require valid_adjustment: an_adjustment/=Void
  81. do
  82. gtk_tree_view_set_hadjustment (handle, an_adjustment.handle)
  83. end
  84. unset_hadjustment is
  85. -- Unsets the GtkAdjustment for the current orizontal aspect.
  86. do
  87. gtk_tree_view_set_hadjustment (handle, default_pointer)
  88. end
  89. vadjustment: GTK_ADJUSTMENT is
  90. -- Gets the GtkAdjustment currently being used for the
  91. -- vertical aspect or Void if none is currently being used.
  92. local factory: G_OBJECT_EXPANDED_FACTORY[GTK_ADJUSTMENT]
  93. do
  94. Result := factory.wrapper(gtk_tree_view_get_vadjustment (handle))
  95. end
  96. set_vadjustment (an_adjustment: GTK_ADJUSTMENT) is
  97. -- Sets the GtkAdjustment for the current vertical aspect.
  98. require valid_adjustment: an_adjustment/=Void
  99. do
  100. gtk_tree_view_set_vadjustment (handle, an_adjustment.handle)
  101. end
  102. unset_vadjustment is
  103. -- Unsets the GtkAdjustment for the current vertical aspect.
  104. do
  105. gtk_tree_view_set_vadjustment (handle, default_pointer)
  106. end
  107. are_headers_visible: BOOLEAN is
  108. -- Are the headers on the tree view visible?
  109. do
  110. Result := gtk_tree_view_get_headers_visible(handle).to_boolean
  111. end
  112. set_headers_visible is
  113. -- Makes the headers are visible
  114. do
  115. gtk_tree_view_set_headers_visible (handle,1)
  116. ensure are_headers_visible
  117. end
  118. set_headers_invisible is
  119. -- Makes the headers are invisible
  120. do
  121. gtk_tree_view_set_headers_visible (handle,0)
  122. ensure not are_headers_visible
  123. end
  124. columns_autosize is
  125. -- Resizes all columns to their optimal width. Only works
  126. -- after the treeview has been realized.
  127. do
  128. gtk_tree_view_columns_autosize (handle)
  129. end
  130. set_headers_clickable is
  131. -- Allow the column title buttons to be clicked.
  132. do
  133. gtk_tree_view_set_headers_clickable (handle,1)
  134. end
  135. set_headers_unclickable is
  136. -- Forbid the column title buttons to be clicked.
  137. do
  138. gtk_tree_view_set_headers_clickable (handle,0)
  139. end
  140. --TODO: set_rules_hint ()
  141. -- void gtk_tree_view_set_rules_hint (GtkTreeView *tree_view,
  142. -- gboolean setting);
  143. -- This function tells GTK+ that the user interface for your
  144. -- application requires users to read across tree rows and
  145. -- associate cells with one another. By default, GTK+ will then
  146. -- render the tree with alternating row colors. Do not use it just
  147. -- because you prefer the appearance of the ruled tree; that's a
  148. -- question for the theme. Some themes will draw tree rows in
  149. -- alternating colors even when rules are turned off, and users who
  150. -- prefer that appearance all the time can choose those themes. You
  151. -- should call this function only as a semantic hint to the theme
  152. -- engine that your tree makes alternating colors useful from a
  153. -- functional standpoint (since it has lots of columns, generally).
  154. -- tree_view : a GtkTreeView
  155. -- setting : TRUE if the tree requires reading across rows
  156. -- TODO: gtk_tree_view_get_rules_hint ()
  157. -- gboolean gtk_tree_view_get_rules_hint (GtkTreeView *tree_view);
  158. -- Gets the setting set by gtk_tree_view_set_rules_hint().
  159. -- tree_view : a GtkTreeView
  160. -- Returns : TRUE if rules are useful for the user of this tree
  161. columns_number: INTEGER
  162. -- Number of columns of Current GTK_TREE_VIEW
  163. append_column (a_column: GTK_TREE_VIEW_COLUMN) is
  164. -- Appends column to the list of columns. If tree view has
  165. -- "fixed_height" mode enabled, then column must have its
  166. -- "sizing" property set to be GTK_TREE_VIEW_COLUMN_FIXED.
  167. require
  168. valid_column: a_column/=Void
  169. -- TODO: fixed_height_requirements: is_height_fixed implies a_column.is_sizing_fixed
  170. do
  171. columns_number := gtk_tree_view_append_column (handle, a_column.handle)
  172. end
  173. remove_column (a_column: GTK_TREE_VIEW_COLUMN) is
  174. -- Removes `a_column' from tree view.
  175. require
  176. valid_column: a_column/=Void
  177. do
  178. columns_number := gtk_tree_view_remove_column (handle, a_column.handle)
  179. end
  180. insert_column (a_column: GTK_TREE_VIEW_COLUMN; a_position: INTEGER) is
  181. -- This inserts `a_column' into the tree view at `a_position'. If
  182. -- position is -1, then the column is inserted at the end. If
  183. -- tree_view has "fixed_height" mode enabled, then column
  184. -- must have its "sizing" property set to be
  185. -- GTK_TREE_VIEW_COLUMN_FIXED.
  186. require
  187. valid_column: a_column /= Void
  188. valid_position: a_position >= -1
  189. do
  190. columns_number := gtk_tree_view_insert_column (handle,a_column.handle,a_position)
  191. end
  192. -- Note: gtk_tree_view_insert_column_with_attributes () unwrappable since variadic.
  193. -- TODO: Provide a feature equivalent to gtk_tree_view_insert_column_with_attributes
  194. -- gint gtk_tree_view_insert_column_with_attributes
  195. -- (GtkTreeView *tree_view,
  196. -- gint position,
  197. -- const gchar *title,
  198. -- GtkCellRenderer *cell,
  199. -- ...);
  200. -- Creates a new GtkTreeViewColumn and inserts it into the tree_view at position. If position is -1, then the newly created column is inserted at the end. The column is initialized with the attributes given. If tree_view has "fixed_height" mode enabled, then column must have its sizing property set to be GTK_TREE_VIEW_COLUMN_FIXED.
  201. -- tree_view : A GtkTreeView
  202. -- position : The position to insert the new column in.
  203. -- title : The title to set the header to.
  204. -- cell : The GtkCellRenderer.
  205. -- ... : A NULL-terminated list of attributes.
  206. -- Returns : The number of columns in tree_view after insertion.
  207. -- TODO wrap gtk_tree_view_insert_column_with_data_func ()
  208. -- gint gtk_tree_view_insert_column_with_data_func (GtkTreeView
  209. -- *tree_view, gint position, const gchar *title, GtkCellRenderer
  210. -- *cell, GtkTreeCellDataFunc func, gpointer data, GDestroyNotify
  211. -- dnotify);
  212. -- Convenience function that inserts a new column into the
  213. -- GtkTreeView with the given cell renderer and a GtkCellDataFunc
  214. -- to set cell renderer attributes (normally using data from the
  215. -- model). See also gtk_tree_view_column_set_cell_data_func(),
  216. -- gtk_tree_view_column_pack_start(). If tree_view has
  217. -- "fixed_height" mode enabled, then column must have its "sizing"
  218. -- property set to be GTK_TREE_VIEW_COLUMN_FIXED.
  219. -- tree_view : a GtkTreeView
  220. -- position : Position to insert, -1 for append
  221. -- title : column title
  222. -- cell : cell renderer for column
  223. -- func : function to set attributes of cell renderer
  224. -- data : data for func
  225. -- dnotify : destroy notifier for data
  226. -- Returns : number of columns in the tree view post-insert
  227. column (a_position: INTEGER): GTK_TREE_VIEW_COLUMN is
  228. -- the GtkTreeViewColumn at the given `a_position' in the tree view.
  229. require valid_number: a_position.in_range(0,columns.count)
  230. local ptr: POINTER
  231. do
  232. create Result.from_external_pointer (gtk_tree_view_get_column (handle, a_position))
  233. end
  234. columns: G_LIST[GTK_TREE_VIEW_COLUMN] is
  235. -- a GList of all the GtkTreeViewColumn s currently in tree view.
  236. do
  237. create {G_OBJECT_LIST[GTK_TREE_VIEW_COLUMN]}
  238. Result.from_external_pointer(gtk_tree_view_get_columns(handle))
  239. -- Note: The returned list must be freed with g_list_free().
  240. end
  241. move_column_after (a_column, a_base: GTK_TREE_VIEW_COLUMN) is
  242. -- Moves `a_column' to be after to `a_base' column. If
  243. -- `a_base' is Void, then column is placed in the first
  244. -- position.
  245. require valid_column: a_column/=Void
  246. do
  247. if a_base /= Void then
  248. gtk_tree_view_move_column_after (handle, a_column.handle, a_base.handle)
  249. else
  250. gtk_tree_view_move_column_after (handle, a_column.handle, default_pointer)
  251. end
  252. end
  253. set_expander_column (a_column: GTK_TREE_VIEW_COLUMN) is
  254. -- Sets the column to draw the expander arrow at. It must be
  255. -- in tree view. If `a_column' is Void, then the expander
  256. -- arrow is always at the first visible column.
  257. -- If you do not want expander arrow to appear in your tree,
  258. -- set the expander column to a hidden column.
  259. do
  260. if a_column = Void then
  261. gtk_tree_view_set_expander_column (handle, default_pointer)
  262. else
  263. gtk_tree_view_set_expander_column (handle, a_column.handle)
  264. end
  265. end
  266. expander_column: GTK_TREE_VIEW_COLUMN is
  267. -- the column that is the current expander column. This
  268. -- column has the expander arrow drawn next to it.
  269. do
  270. create Result.from_external_pointer (gtk_tree_view_get_expander_column (handle))
  271. end
  272. -- TODO: wrap gtk_tree_view_set_column_drag_function ()
  273. -- void gtk_tree_view_set_column_drag_function (GtkTreeView
  274. -- *tree_view, GtkTreeViewColumnDropFunc func, gpointer user_data,
  275. -- GtkDestroyNotify destroy);
  276. -- Sets a user function for determining where a column may be
  277. -- dropped when dragged. This function is called on every column
  278. -- pair in turn at the beginning of a column drag to determine
  279. -- where a drop can take place. The arguments passed to func are:
  280. -- the tree_view, the GtkTreeViewColumn being dragged, the two
  281. -- GtkTreeViewColumn s determining the drop spot, and user_data. If
  282. -- either of the GtkTreeViewColumn arguments for the drop spot are
  283. -- NULL, then they indicate an edge. If func is set to be NULL,
  284. -- then tree_view reverts to the default behavior of allowing all
  285. -- columns to be dropped everywhere.
  286. -- tree_view : A GtkTreeView.
  287. -- func : A function to determine which columns are reorderable, or NULL.
  288. -- user_data : User data to be passed to func, or NULL
  289. -- destroy : Destroy notifier for user_data, or NULL
  290. scroll_to_point (an_x, an_y: INTEGER) is
  291. -- Scrolls the tree view such that the top-left corner of the
  292. -- visible area is `an_x', `an_y', where `an_x' and `an_y'
  293. -- are specified in tree window coordinates. The tree_view
  294. -- must be realized before this function is called. If it
  295. -- isn't, you probably want to be using `scroll_to_cell'.
  296. -- If either `an_x' or `an_y' are -1, then that direction isn't scrolled.
  297. do
  298. gtk_tree_view_scroll_to_point (handle, an_x, an_y)
  299. end
  300. scroll_to_cell (a_path: GTK_TREE_PATH; a_column: GTK_TREE_VIEW_COLUMN;
  301. use_align: BOOLEAN; row_align, col_align: REAL_32) is
  302. -- Moves the alignments of tree view to the position
  303. -- specified by `a_column' and `a_path'. If `a_column' is
  304. -- Void, then no horizontal scrolling occurs. Likewise, if
  305. -- `a_path' is Void no vertical scrolling occurs. At a
  306. -- minimum, one of `a_column' or `a_path' need to be
  307. -- non-Void. `row_align' determines where the row is placed,
  308. -- and `col_align' determines where `a_column' is
  309. -- placed. Both are expected to be between 0.0 and 1.0. 0.0
  310. -- means left/top alignment, 1.0 means right/bottom
  311. -- alignment, 0.5 means center.
  312. -- If `use_align' is False, then the alignment arguments are
  313. -- ignored, and the tree does the minimum amount of work to
  314. -- scroll the cell onto the screen. This means that the cell
  315. -- will be scrolled to the edge closest to its current
  316. -- position. If the cell is currently visible on the screen,
  317. -- nothing is done.
  318. -- This function only works if the model is set, and `a_path'
  319. -- is a valid row on the model. If the model changes before
  320. -- the tree_view is realized, the centered `a_path' will be
  321. -- modified to reflect this change.
  322. -- `a_path' : The path of the row to move to, or Void.
  323. -- `a_column' : The GtkTreeViewColumn to move horizontally to, or Void.
  324. -- `use_align' : whether to use alignment arguments, or FALSE.
  325. -- `row_align' : The vertical alignment of the row specified by path.
  326. -- `col_align' : The horizontal alignment of the column specified by column.
  327. require
  328. either_column_or_path_not_void: a_column/=Void or a_path/=Void
  329. valid_row_align: row_align.in_range ({REAL_32 0.0}, {REAL_32 1.0})
  330. valid_col_align: col_align.in_range ({REAL_32 0.0}, {REAL_32 1.0})
  331. local
  332. column_ptr, path_ptr: POINTER
  333. do
  334. if a_column /= Void then column_ptr := a_column.handle end
  335. if a_path /= Void then path_ptr := a_path.handle end
  336. gtk_tree_view_scroll_to_cell (handle, path_ptr, column_ptr,
  337. use_align.to_integer, row_align, col_align)
  338. end
  339. set_cursor (a_path: GTK_TREE_PATH; a_focus_column: GTK_TREE_VIEW_COLUMN; start_editing: BOOLEAN) is
  340. -- Sets the current keyboard focus to be at `a_path', and
  341. -- selects it. This is useful when you want to focus the
  342. -- user's attention on a particular row. If `a_focus_column'
  343. -- is not Void, then focus is given to the column specified
  344. -- by it. Additionally, if `a_focus_column' is specified, and
  345. -- `start_editing' is TRUE, then editing should be started in
  346. -- the specified cell. This function is often followed by
  347. -- gtk_widget_grab_focus (tree_view) in order to give
  348. -- keyboard focus to the widget. Please note that editing can
  349. -- only happen when the widget is realized.
  350. -- `a_path' : A GtkTreePath
  351. -- `a_focus_column' : A GtkTreeViewColumn, or Void
  352. -- `start_editing' : TRUE if the specified cell should start being edited.
  353. require valid_path: a_path /= Void
  354. do
  355. if a_focus_column=Void then
  356. gtk_tree_view_set_cursor (handle, a_path.handle,
  357. default_pointer, start_editing.to_integer)
  358. else
  359. gtk_tree_view_set_cursor (handle, a_path.handle,
  360. a_focus_column.handle, start_editing.to_integer)
  361. end
  362. end
  363. set_cursor_on_cell (a_path: GTK_TREE_PATH; a_focus_column: GTK_TREE_VIEW_COLUMN;
  364. a_focus_cell: GTK_CELL_RENDERER; start_editing: BOOLEAN) is
  365. -- Sets the current keyboard focus to be at `a_path', and selects
  366. -- it. This is useful when you want to focus the user's
  367. -- attention on a particular row. If `a_focus_column' is not
  368. -- Void, then focus is given to the column specified by
  369. -- it. If `a_focus_column' and `a_focus_cell' are not Void, and
  370. -- `a_focus_column' contains 2 or more editable or activatable
  371. -- cells, then focus is given to the cell specified by
  372. -- `a_focus_cell'. Additionally, if `a_focus_column' is specified,
  373. -- and `start_editing' is TRUE, then editing should be started
  374. -- in the specified cell. This function is often followed by
  375. -- gtk_widget_grab_focus (tree_view) in order to give
  376. -- keyboard focus to the widget. Please note that editing can
  377. -- only happen when the widget is realized.
  378. -- tree_view : A GtkTreeView
  379. -- `a_path' : A GtkTreePath
  380. -- `a_focus_column' : A GtkTreeViewColumn, or Void
  381. -- `a_focus_cell' : A GtkCellRenderer, or Void
  382. -- `start_editing' : TRUE if the specified cell should start being edited.
  383. require valid_path: a_path /= Void
  384. local column_ptr,cell_ptr: POINTER
  385. do
  386. if a_focus_column/=Void then column_ptr := a_focus_column.handle end
  387. if a_focus_cell/=Void then cell_ptr := a_focus_cell.handle end
  388. gtk_tree_view_set_cursor_on_cell (handle, a_path.handle, column_ptr, cell_ptr,
  389. start_editing.to_integer)
  390. end
  391. cursor: TUPLE[GTK_TREE_PATH, GTK_TREE_VIEW_COLUMN] is
  392. -- The path and focus column with the current path and focus column. If the cursor isn't currently set, then path will be Void. If no column currently has focus, then the column will be Void.
  393. local
  394. path_ptr, column_ptr: POINTER;
  395. a_path: GTK_TREE_PATH;
  396. a_column: GTK_TREE_VIEW_COLUMN
  397. do
  398. gtk_tree_view_get_cursor (handle, $path_ptr, $column_ptr)
  399. if path_ptr.is_not_null then create a_path.from_external_pointer(path_ptr) end
  400. if column_ptr.is_not_null then create a_column.secondary_wrapper_from(column_ptr) end
  401. create Result.make_2 (a_path, a_column)
  402. ensure
  403. Result /= Void
  404. Result.first /= Void implies Result.first.is_not_null
  405. Result.second /= Void implies Result.second.is_not_null
  406. end
  407. row_expanded (a_path: GTK_TREE_PATH): BOOLEAN is
  408. -- Returns True if the node pointed to by `a_path' is expanded in Current.
  409. require
  410. a_path /= Void
  411. do
  412. Result := gtk_tree_view_row_expanded (handle, a_path.handle).to_boolean
  413. end
  414. expand_row (a_path: GTK_TREE_PATH; open_all: BOOLEAN): BOOLEAN is
  415. -- Opens the row so its children are visible.
  416. -- `open_all' indicates whether to recursively expand, or
  417. -- just expand immediate children
  418. -- Returns True if the row existed and had children
  419. require
  420. a_path /= Void
  421. do
  422. Result := gtk_tree_view_expand_row(handle, a_path.handle, open_all.to_integer) > 0
  423. end
  424. collapse_row (a_path: GTK_TREE_PATH): BOOLEAN is
  425. -- Collapses a row (hides its child rows, if they exist).
  426. -- Returns True if the row was collapsed.
  427. require
  428. a_path /= Void
  429. do
  430. Result := gtk_tree_view_collapse_row(handle, a_path.handle) > 0
  431. end
  432. expand_all is
  433. -- Recursively expands all nodes in the tree view.
  434. do
  435. gtk_tree_view_expand_all(handle)
  436. end
  437. collapse_all is
  438. -- Recursively collapses all visible, expanded nodes in tree view.
  439. do
  440. gtk_tree_view_collapse_all(handle)
  441. end
  442. expand_to_path (a_path: GTK_TREE_PATH) is
  443. -- Expands the row at `a_path'. This will also expand all parent rows of path as necessary.
  444. -- Since 2.2
  445. require
  446. a_path /= Void
  447. do
  448. gtk_tree_view_expand_to_path (handle, a_path.handle)
  449. end
  450. -- gtk_tree_view_map_expanded_rows ()
  451. -- void gtk_tree_view_map_expanded_rows (GtkTreeView *tree_view,
  452. -- GtkTreeViewMappingFunc func,
  453. -- gpointer data);
  454. -- Calls func on all expanded rows.
  455. -- tree_view : A GtkTreeView
  456. -- func : A function to be called
  457. -- data : User data to be passed to the function.
  458. set_reorderable(a_reorderable: BOOLEAN) is
  459. -- This function is a convenience function to allow you to
  460. -- reorder models that support the GtkDragSourceIface and the
  461. -- GtkDragDestIface. Both GtkTreeStore and GtkListStore support
  462. -- these. If `a_reorderable' is True, then the user can reorder
  463. -- the model by dragging and dropping rows. The developer can
  464. -- listen to these changes by connecting to the model's
  465. -- row_inserted and row_deleted signals.
  466. --
  467. -- This function does not give you any degree of control over
  468. -- the order. *Any* reordering is allowed. If more control
  469. -- is needed, you should probably handle drag and drop manually.
  470. do
  471. gtk_tree_view_set_reorderable(handle, a_reorderable.to_integer)
  472. ensure
  473. is_reorderable = a_reorderable
  474. end
  475. is_reorderable: BOOLEAN is
  476. -- Retrieves whether the user can reorder the tree via
  477. -- drag-and-drop. See set_reorderable().
  478. -- Returns True if the tree can be reordered.
  479. do
  480. Result := gtk_tree_view_get_reorderable(handle) > 0
  481. end
  482. row_activated (a_path: GTK_TREE_PATH; a_column: GTK_TREE_VIEW_COLUMN) is
  483. -- Activates the cell determined by `a_path' and `a_column'.
  484. require
  485. a_path /= Void
  486. a_column /= Void
  487. do
  488. gtk_tree_view_row_activated (handle, a_path.handle, a_column.handle)
  489. end
  490. -- gtk_tree_view_get_path_at_pos ()
  491. -- gboolean gtk_tree_view_get_path_at_pos (GtkTreeView *tree_view,
  492. -- gint x,
  493. -- gint y,
  494. -- GtkTreePath **path,
  495. -- GtkTreeViewColumn **column,
  496. -- gint *cell_x,
  497. -- gint *cell_y);
  498. -- Finds the path at the point (x, y), relative to widget coordinates. That is, x and y are relative to an events coordinates. x and y must come from an event on the tree_view only where event->window == gtk_tree_view_get_bin (). It is primarily for things like popup menus. If path is non-NULL, then it will be filled with the GtkTreePath at that point. This path should be freed with gtk_tree_path_free(). If column is non-NULL, then it will be filled with the column at that point. cell_x and cell_y return the coordinates relative to the cell background (i.e. the background_area passed to gtk_cell_renderer_render()). This function is only meaningful if tree_view is realized.
  499. -- tree_view : A GtkTreeView.
  500. -- x : The x position to be identified.
  501. -- y : The y position to be identified.
  502. -- path : A pointer to a GtkTreePath pointer to be filled in, or NULL
  503. -- column : A pointer to a GtkTreeViewColumn pointer to be filled in, or NULL
  504. -- cell_x : A pointer where the X coordinate relative to the cell can be placed, or NULL
  505. -- cell_y : A pointer where the Y coordinate relative to the cell can be placed, or NULL
  506. -- Returns : TRUE if a row exists at that coordinate.
  507. -- gtk_tree_view_get_cell_area ()
  508. -- void gtk_tree_view_get_cell_area (GtkTreeView *tree_view,
  509. -- GtkTreePath *path,
  510. -- GtkTreeViewColumn *column,
  511. -- GdkRectangle *rect);
  512. -- Fills the bounding rectangle in tree window coordinates for the cell at the row specified by path and the column specified by column. If path is NULL, or points to a path not currently displayed, the y and height fields of the rectangle will be filled with 0. If column is NULL, the x and width fields will be filled with 0. The sum of all cell rects does not cover the entire tree; there are extra pixels in between rows, for example. The returned rectangle is equivalent to the cell_area passed to gtk_cell_renderer_render(). This function is only valid if tree_view is realized.
  513. -- tree_view : a GtkTreeView
  514. -- path : a GtkTreePath for the row, or NULL to get only horizontal coordinates
  515. -- column : a GtkTreeViewColumn for the column, or NULL to get only vertical coordinates
  516. -- rect : rectangle to fill with cell rect
  517. -- gtk_tree_view_get_background_area ()
  518. -- void gtk_tree_view_get_background_area
  519. -- (GtkTreeView *tree_view,
  520. -- GtkTreePath *path,
  521. -- GtkTreeViewColumn *column,
  522. -- GdkRectangle *rect);
  523. -- Fills the bounding rectangle in tree window coordinates for the cell at the row specified by path and the column specified by column. If path is NULL, or points to a node not found in the tree, the y and height fields of the rectangle will be filled with 0. If column is NULL, the x and width fields will be filled with 0. The returned rectangle is equivalent to the background_area passed to gtk_cell_renderer_render(). These background areas tile to cover the entire tree window (except for the area used for header buttons). Contrast with the cell_area, returned by gtk_tree_view_get_cell_area(), which returns only the cell itself, excluding surrounding borders and the tree expander area.
  524. -- tree_view : a GtkTreeView
  525. -- path : a GtkTreePath for the row, or NULL to get only horizontal coordinates
  526. -- column : a GtkTreeViewColumn for the column, or NULL to get only vertical coordiantes
  527. -- rect : rectangle to fill with cell background rect
  528. -- gtk_tree_view_get_visible_rect ()
  529. -- void gtk_tree_view_get_visible_rect (GtkTreeView *tree_view,
  530. -- GdkRectangle *visible_rect);
  531. -- Fills visible_rect with the currently-visible region of the buffer, in tree coordinates. Convert to widget coordinates with gtk_tree_view_tree_to_widget_coords(). Tree coordinates start at 0,0 for row 0 of the tree, and cover the entire scrollable area of the tree.
  532. -- tree_view : a GtkTreeView
  533. -- visible_rect : rectangle to fill
  534. -- gtk_tree_view_get_visible_range ()
  535. -- gboolean gtk_tree_view_get_visible_range (GtkTreeView *tree_view,
  536. -- GtkTreePath **start_path,
  537. -- GtkTreePath **end_path);
  538. -- Sets start_path and end_path to be the first and last visible path. Note that there may be invisible paths in between.
  539. -- The paths should be freed with gtk_tree_path_free() after use.
  540. -- tree_view : A GtkTreeView
  541. -- start_path : Return location for start of region, or NULL.
  542. -- end_path : Return location for end of region, or NULL.
  543. -- Returns : TRUE, if valid paths were placed in start_path and end_path.
  544. -- Since 2.8
  545. -- gtk_tree_view_get_bin_window ()
  546. -- GdkWindow* gtk_tree_view_get_bin_window (GtkTreeView *tree_view);
  547. -- Returns the window that tree_view renders to. This is used primarily to compare to event->window to confirm that the event on tree_view is on the right window.
  548. -- tree_view : A GtkTreeView
  549. -- Returns : A GdkWindow, or NULL when tree_view hasn't been realized yet
  550. -- gtk_tree_view_widget_to_tree_coords ()
  551. -- void gtk_tree_view_widget_to_tree_coords
  552. -- (GtkTreeView *tree_view,
  553. -- gint wx,
  554. -- gint wy,
  555. -- gint *tx,
  556. -- gint *ty);
  557. -- Converts widget coordinates to coordinates for the tree window (the full scrollable area of the tree).
  558. -- tree_view : a GtkTreeView
  559. -- wx : widget X coordinate
  560. -- wy : widget Y coordinate
  561. -- tx : return location for tree X coordinate
  562. -- ty : return location for tree Y coordinate
  563. -- gtk_tree_view_tree_to_widget_coords ()
  564. -- void gtk_tree_view_tree_to_widget_coords
  565. -- (GtkTreeView *tree_view,
  566. -- gint tx,
  567. -- gint ty,
  568. -- gint *wx,
  569. -- gint *wy);
  570. -- Converts tree coordinates (coordinates in full scrollable area of the tree) to widget coordinates.
  571. -- tree_view : a GtkTreeView
  572. -- tx : tree X coordinate
  573. -- ty : tree Y coordinate
  574. -- wx : return location for widget X coordinate
  575. -- wy : return location for widget Y coordinate
  576. -- gtk_tree_view_enable_model_drag_dest ()
  577. feature -- Drag n' Drop
  578. enable_model_drag_dest (a_target: GTK_TARGET_ENTRY; some_actions: INTEGER) is
  579. -- Turns Current into a drop destination for automatic DND.
  580. -- some_targets : the table of targets that the drag will support
  581. -- n_targets : the number of items in targets
  582. -- some_actions : the bitmask of possible actions for a drag from this widget
  583. require
  584. a_target /= Void
  585. is_valid_gdk_drag_action (some_actions)
  586. do
  587. -- XXX: WATCH OUT! thsi implemetation allows the setting of only ONE target.
  588. -- In order to allow a list of them, we'd need to develop some C code so we can transform
  589. -- a NATIVE_ARRAY [POINTER] with the handle's of the different GTK_TARGET_ENTRY
  590. -- into a GtkTargetEntry *.
  591. -- nessa, 2006-10-30
  592. gtk_tree_view_enable_model_drag_dest (handle, a_target.handle, 1, some_actions)
  593. end
  594. enable_model_drag_source (a_start_button_mask: INTEGER;
  595. a_target: GTK_TARGET_ENTRY;
  596. some_actions: INTEGER) is
  597. -- Turns Current into a drag source for automatic DND.
  598. -- a_start_button_mask : Mask of allowed buttons to start drag
  599. -- some_targets : the table of targets that the drag will support
  600. -- n_targets : the number of items in targets
  601. -- some_actions : the bitmask of possible actions for a drag from this widget
  602. require
  603. is_valid_gdk_modifier_type (a_start_button_mask)
  604. a_target /= Void
  605. is_valid_gdk_drag_action (some_actions)
  606. do
  607. -- XXX: WATCH OUT! thsi implemetation allows the setting of only ONE target.
  608. -- In order to allow a list of them, we'd need to develop some C code so we can transform
  609. -- a NATIVE_ARRAY [POINTER] with the handle's of the different GTK_TARGET_ENTRY
  610. -- into a GtkTargetEntry *.
  611. -- nessa, 2006-10-30
  612. gtk_tree_view_enable_model_drag_source (handle, a_start_button_mask,
  613. a_target.handle, 1, some_actions)
  614. end
  615. unset_rows_drag_source is
  616. -- Undoes the effect of `enable_model_drag_source'.
  617. do
  618. gtk_tree_view_unset_rows_drag_source (handle)
  619. end
  620. unset_rows_drag_dest is
  621. -- Undoes the effect of `enable_model_drag_dest'.
  622. do
  623. gtk_tree_view_unset_rows_drag_dest (handle)
  624. end
  625. set_drag_dest_row (a_path: GTK_TREE_PATH; a_position: INTEGER) is
  626. -- Sets the row that is highlighted for feedback.
  627. -- a_path : The path of the row to highlight, or NULL.
  628. -- a_position : Specifies whether to drop before, after or into the row
  629. require
  630. a_path /= Void
  631. is_valid_gtk_tree_view_drop_position (a_position)
  632. do
  633. gtk_tree_view_set_drag_dest_row (handle, a_path.handle, a_position)
  634. end
  635. drag_dest_row: TUPLE [GTK_TREE_PATH, INTEGER] is
  636. -- Gets information about the row that is highlighted for feedback.
  637. -- Returns a tuple with the location for the path of the highlighted row, or NULL;
  638. -- and the location for the drop position, or NULL.
  639. local
  640. a_path: GTK_TREE_PATH
  641. a_path_ptr: POINTER
  642. a_position: INTEGER
  643. do
  644. gtk_tree_view_get_drag_dest_row (handle, $a_path_ptr, $a_position);
  645. if a_path_ptr.is_not_null then create a_path.from_external_pointer (a_path_ptr) end
  646. Result := [a_path, a_position]
  647. ensure
  648. Result /= Void
  649. Result.first /= Void implies is_valid_gtk_tree_view_drop_position (Result.second)
  650. end
  651. dest_row_at_pos (drag_x, drag_y: INTEGER): TUPLE [GTK_TREE_PATH, INTEGER] is
  652. -- Determines the destination row for a given position.
  653. -- drag_x : the position to determine the destination row for
  654. -- drag_y : the position to determine the destination row for
  655. -- a_path : Return location for the path of the highlighted row, or NULL.
  656. -- a_position : Return location for the drop position, or NULL
  657. -- Returns : whether there is a row at the given position.
  658. local
  659. a_path: GTK_TREE_PATH
  660. a_path_ptr: POINTER
  661. a_position: INTEGER
  662. row_exists: BOOLEAN
  663. do
  664. row_exists := gtk_tree_view_get_dest_row_at_pos (handle, drag_x, drag_y, $a_path_ptr, $a_position).to_boolean
  665. if row_exists then create a_path.from_external_pointer (a_path_ptr) end
  666. Result := [a_path, a_position]
  667. ensure
  668. Result /= Void
  669. Result.first /= Void implies is_valid_gtk_tree_view_drop_position (Result.second)
  670. end
  671. row_drag_icon (a_path: GTK_TREE_PATH): GDK_PIXMAP is
  672. -- Creates a GdkPixmap representation of the row at path.
  673. -- This image is used for a drag icon.
  674. -- a_path : a GtkTreePath in Current
  675. -- Returns : a newly-allocated pixmap of the drag icon.
  676. require
  677. a_path /= Void
  678. local
  679. c_ptr: POINTER
  680. do
  681. c_ptr := gtk_tree_view_create_row_drag_icon (handle, a_path.handle)
  682. create Result.from_external_pointer (c_ptr)
  683. end
  684. feature -- Search
  685. -- gtk_tree_view_set_enable_search ()
  686. -- void gtk_tree_view_set_enable_search (GtkTreeView *tree_view,
  687. -- gboolean enable_search);
  688. -- If enable_search is set, then the user can type in text to search through the tree interactively (this is sometimes called "typeahead find").
  689. -- Note that even if this is FALSE, the user can still initiate a search using the "start-interactive-search" key binding.
  690. -- tree_view : A GtkTreeView
  691. -- enable_search : TRUE, if the user can search interactively
  692. -- gtk_tree_view_get_enable_search ()
  693. -- gboolean gtk_tree_view_get_enable_search (GtkTreeView *tree_view);
  694. -- Returns whether or not the tree allows to start interactive searching by typing in text.
  695. -- tree_view : A GtkTreeView
  696. -- Returns : whether or not to let the user search interactively
  697. -- gtk_tree_view_get_search_column ()
  698. -- gint gtk_tree_view_get_search_column (GtkTreeView *tree_view);
  699. -- Gets the column searched on by the interactive search code.
  700. -- tree_view : A GtkTreeView
  701. -- Returns : the column the interactive search code searches in.
  702. -- gtk_tree_view_set_search_column ()
  703. -- void gtk_tree_view_set_search_column (GtkTreeView *tree_view,
  704. -- gint column);
  705. -- Sets column as the column where the interactive search code should search in.
  706. -- If the sort column is set, users can use the "start-interactive-search" key binding to bring up search popup. The enable-search property controls whether simply typing text will also start an interactive search.
  707. -- Note that column refers to a column of the model.
  708. -- tree_view : A GtkTreeView
  709. -- column : the column of the model to search in, or -1 to disable searching
  710. -- gtk_tree_view_get_search_equal_func ()
  711. -- GtkTreeViewSearchEqualFunc gtk_tree_view_get_search_equal_func
  712. -- (GtkTreeView *tree_view);
  713. -- Returns the compare function currently in use.
  714. -- tree_view : A GtkTreeView
  715. -- Returns : the currently used compare function for the search code.
  716. -- gtk_tree_view_set_search_equal_func ()
  717. -- void gtk_tree_view_set_search_equal_func
  718. -- (GtkTreeView *tree_view,
  719. -- GtkTreeViewSearchEqualFunc search_equal_func,
  720. -- gpointer search_user_data,
  721. -- GtkDestroyNotify search_destroy);
  722. -- Sets the compare function for the interactive search capabilities; note that somewhat like strcmp() returning 0 for equality GtkTreeViewSearchEqualFunc returns FALSE on matches.
  723. -- tree_view : A GtkTreeView
  724. -- search_equal_func : the compare function to use during the search
  725. -- search_user_data : user data to pass to search_equal_func, or NULL
  726. -- search_destroy : Destroy notifier for search_user_data, or NULL
  727. -- gtk_tree_view_get_fixed_height_mode ()
  728. -- gboolean gtk_tree_view_get_fixed_height_mode
  729. -- (GtkTreeView *tree_view);
  730. -- Returns whether fixed height mode is turned on for tree_view.
  731. -- tree_view : a GtkTreeView
  732. -- Returns : TRUE if tree_view is in fixed height mode
  733. -- Since 2.6
  734. -- gtk_tree_view_set_fixed_height_mode ()
  735. -- void gtk_tree_view_set_fixed_height_mode
  736. -- (GtkTreeView *tree_view,
  737. -- gboolean enable);
  738. -- Enables or disables the fixed height mode of tree_view. Fixed height mode speeds up GtkTreeView by assuming that all rows have the same height. Only enable this option if all rows are the same height and all columns are of type GTK_TREE_VIEW_COLUMN_FIXED.
  739. -- tree_view : a GtkTreeView
  740. -- enable : TRUE to enable fixed height mode
  741. -- Since 2.6
  742. -- gtk_tree_view_get_hover_selection ()
  743. -- gboolean gtk_tree_view_get_hover_selection
  744. -- (GtkTreeView *tree_view);
  745. -- Returns whether hover selection mode is turned on for tree_view.
  746. -- tree_view : a GtkTreeView
  747. -- Returns : TRUE if tree_view is in hover selection mode
  748. -- Since 2.6
  749. -- gtk_tree_view_set_hover_selection ()
  750. -- void gtk_tree_view_set_hover_selection
  751. -- (GtkTreeView *tree_view,
  752. -- gboolean hover);
  753. -- Enables of disables the hover selection mode of tree_view. Hover selection makes the selected row follow the pointer. Currently, this works only for the selection modes GTK_SELECTION_SINGLE and GTK_SELECTION_BROWSE.
  754. -- tree_view : a GtkTreeView
  755. -- hover : TRUE to enable hover selection mode
  756. -- Since 2.6
  757. -- gtk_tree_view_get_hover_expand ()
  758. -- gboolean gtk_tree_view_get_hover_expand (GtkTreeView *tree_view);
  759. -- Returns whether hover expansion mode is turned on for tree_view.
  760. -- tree_view : a GtkTreeView
  761. -- Returns : TRUE if tree_view is in hover expansion mode
  762. -- Since 2.6
  763. -- gtk_tree_view_set_hover_expand ()
  764. -- void gtk_tree_view_set_hover_expand (GtkTreeView *tree_view,
  765. -- gboolean expand);
  766. -- Enables of disables the hover expansion mode of tree_view. Hover expansion makes rows expand or collaps if the pointer moves over them.
  767. -- tree_view : a GtkTreeView
  768. -- expand : TRUE to enable hover selection mode
  769. -- Since 2.6
  770. -- GtkTreeDestroyCountFunc ()
  771. -- void (*GtkTreeDestroyCountFunc) (GtkTreeView *tree_view,
  772. -- GtkTreePath *path,
  773. -- gint children,
  774. -- gpointer user_data);
  775. -- tree_view :
  776. -- path :
  777. -- children :
  778. -- user_data :
  779. -- gtk_tree_view_set_destroy_count_func ()
  780. -- void gtk_tree_view_set_destroy_count_func
  781. -- (GtkTreeView *tree_view,
  782. -- GtkTreeDestroyCountFunc func,
  783. -- gpointer data,
  784. -- GtkDestroyNotify destroy);
  785. -- This function should almost never be used. It is meant for private use by ATK for determining the number of visible children that are removed when the user collapses a row, or a row is deleted.
  786. -- tree_view : A GtkTreeView
  787. -- func : Function to be called when a view row is destroyed, or NULL
  788. -- data : User data to be passed to func, or NULL
  789. -- destroy : Destroy notifier for data, or NULL
  790. -- GtkTreeViewRowSeparatorFunc ()
  791. -- gboolean (*GtkTreeViewRowSeparatorFunc) (GtkTreeModel *model,
  792. -- GtkTreeIter *iter,
  793. -- gpointer data);
  794. -- Function type for determining whether the row pointed to by iter should be rendered as a separator. A common way to implement this is to have a boolean column in the model, whose values the GtkTreeViewRowSeparatorFunc returns.
  795. -- model : the GtkTreeModel
  796. -- iter : a GtkTreeIter pointing at a row in model
  797. -- data : user data
  798. -- Returns : TRUE if the row is a separator
  799. -- gtk_tree_view_get_row_separator_func ()
  800. -- GtkTreeViewRowSeparatorFunc gtk_tree_view_get_row_separator_func
  801. -- (GtkTreeView *tree_view);
  802. -- Returns the current row separator function.
  803. -- tree_view : a GtkTreeView
  804. -- Returns : the current row separator function.
  805. -- Since 2.6
  806. -- gtk_tree_view_set_row_separator_func ()
  807. -- void gtk_tree_view_set_row_separator_func
  808. -- (GtkTreeView *tree_view,
  809. -- GtkTreeViewRowSeparatorFunc func,
  810. -- gpointer data,
  811. -- GtkDestroyNotify destroy);
  812. -- Sets the row separator function, which is used to determine whether a row should be drawn as a separator. If the row separator function is NULL, no separators are drawn. This is the default value.
  813. -- tree_view : a GtkTreeView
  814. -- func : a GtkTreeViewRowSeparatorFunc
  815. -- data : user data to pass to func, or NULL
  816. -- destroy : destroy notifier for data, or NULL
  817. -- Since 2.6
  818. -- Property Details
  819. -- The "enable-search" property
  820. -- "enable-search" gboolean : Read / Write
  821. -- View allows user to search through columns interactively.
  822. -- Default value: TRUE
  823. -- The "expander-column" property
  824. -- "expander-column" GtkTreeViewColumn : Read / Write
  825. -- Set the column for the expander column.
  826. -- The "fixed-height-mode" property
  827. -- "fixed-height-mode" gboolean : Read / Write
  828. -- Setting the ::fixed-height-mode property to TRUE speeds up GtkTreeView by assuming that all rows have the same height. Only enable this option if all rows are the same height. Please see gtk_tree_view_set_fixed_height_mode() for more information on this option.
  829. -- Default value: FALSE
  830. -- Since 2.4
  831. -- The "hadjustment" property
  832. -- "hadjustment" GtkAdjustment : Read / Write
  833. -- Horizontal Adjustment for the widget.
  834. -- The "headers-clickable" property
  835. -- "headers-clickable" gboolean : Read / Write
  836. -- Column headers respond to click events.
  837. -- Default value: FALSE
  838. -- The "headers-visible" property
  839. -- "headers-visible" gboolean : Read / Write
  840. -- Show the column header buttons.
  841. -- Default value: TRUE
  842. -- The "hover-expand" property
  843. -- "hover-expand" gboolean : Read / Write
  844. -- Enables of disables the hover expansion mode of tree_view. Hover expansion makes rows expand or collaps if the pointer moves over them.
  845. -- This mode is primarily indended for treeviews in popups, e.g. in GtkComboBox or GtkEntryCompletion.
  846. -- Default value: FALSE
  847. -- Since 2.6
  848. -- The "hover-selection" property
  849. -- "hover-selection" gboolean : Read / Write
  850. -- Enables of disables the hover selection mode of tree_view. Hover selection makes the selected row follow the pointer. Currently, this works only for the selection modes GTK_SELECTION_SINGLE and GTK_SELECTION_BROWSE.
  851. -- This mode is primarily indended for treeviews in popups, e.g. in GtkComboBox or GtkEntryCompletion.
  852. -- Default value: FALSE
  853. -- Since 2.6
  854. -- The "model" property
  855. -- "model" GtkTreeModel : Read / Write
  856. -- The model for the tree view.
  857. -- The "reorderable" property
  858. -- "reorderable" gboolean : Read / Write
  859. -- View is reorderable.
  860. -- Default value: FALSE
  861. -- The "rules-hint" property
  862. -- "rules-hint" gboolean : Read / Write
  863. -- Set a hint to the theme engine to draw rows in alternating colors.
  864. -- Default value: FALSE
  865. -- The "search-column" property
  866. -- "search-column" gint : Read / Write
  867. -- Model column to search through when searching through code.
  868. -- Allowed values: >= -1
  869. -- Default value: -1
  870. -- The "vadjustment" property
  871. -- "vadjustment" GtkAdjustment : Read / Write
  872. -- Vertical Adjustment for the widget.
  873. -- Style Property Details
  874. -- The "allow-rules" style property
  875. -- "allow-rules" gboolean : Read
  876. -- Allow drawing of alternating color rows.
  877. -- Default value: TRUE
  878. -- The "even-row-color" style property
  879. -- "even-row-color" GdkColor : Read
  880. -- Color to use for even rows.
  881. -- The "expander-size" style property
  882. -- "expander-size" gint : Read
  883. -- Size of the expander arrow.
  884. -- Allowed values: >= 0
  885. -- Default value: 12
  886. -- The "horizontal-separator" style property
  887. -- "horizontal-separator" gint : Read
  888. -- Horizontal space between cells. Must be an even number.
  889. -- Allowed values: >= 0
  890. -- Default value: 2
  891. -- The "indent-expanders" style property
  892. -- "indent-expanders" gboolean : Read
  893. -- Make the expanders indented.
  894. -- Default value: TRUE
  895. -- The "odd-row-color" style property
  896. -- "odd-row-color" GdkColor : Read
  897. -- Color to use for odd rows.
  898. -- The "vertical-separator" style property
  899. -- "vertical-separator" gint : Read
  900. -- Vertical space between cells. Must be an even number.
  901. -- Allowed values: >= 0
  902. -- Default value: 2
  903. -- Signal Details
  904. -- The "columns-changed" signal
  905. -- void user_function (GtkTreeView *treeview,
  906. -- gpointer user_data);
  907. -- treeview : the object which received the signal.
  908. -- user_data : user data set when the signal handler was connected.
  909. -- The "cursor-changed" signal
  910. -- void user_function (GtkTreeView *treeview,
  911. -- gpointer user_data);
  912. -- treeview : the object which received the signal.
  913. -- user_data : user data set when the signal handler was connected.
  914. -- The "move-cursor" signal
  915. -- gboolean user_function (GtkTreeView *treeview,
  916. -- GtkMovementStep arg1,
  917. -- gint arg2,
  918. -- gpointer user_data);
  919. -- treeview : the object which received the signal.
  920. -- arg1 :
  921. -- arg2 :
  922. -- user_data : user data set when the signal handler was connected.
  923. -- Returns :
  924. -- The "select-all" signal
  925. -- gboolean user_function (GtkTreeView *treeview,
  926. -- gpointer user_data);
  927. -- treeview : the object which received the signal.
  928. -- user_data : user data set when the signal handler was connected.
  929. -- Returns :
  930. -- The "select-cursor-parent" signal
  931. -- gboolean user_function (GtkTreeView *treeview,
  932. -- gpointer user_data);
  933. -- treeview : the object which received the signal.
  934. -- user_data : user data set when the signal handler was connected.
  935. -- Returns :
  936. -- The "select-cursor-row" signal
  937. -- gboolean user_function (GtkTreeView *treeview,
  938. -- gboolean arg1,
  939. -- gpointer user_data);
  940. -- treeview : the object which received the signal.
  941. -- arg1 :
  942. -- user_data : user data set when the signal handler was connected.
  943. -- Returns :
  944. -- The "set-scroll-adjustments" signal
  945. -- void user_function (GtkTreeView *treeview,
  946. -- GtkAdjustment *arg1,
  947. -- GtkAdjustment *arg2,
  948. -- gpointer user_data);
  949. -- treeview : the object which received the signal.
  950. -- arg1 :
  951. -- arg2 :
  952. -- user_data : user data set when the signal handler was connected.
  953. -- The "start-interactive-search" signal
  954. -- gboolean user_function (GtkTreeView *treeview,
  955. -- gpointer user_data);
  956. -- treeview : the object which received the signal.
  957. -- user_data : user data set when the signal handler was connected.
  958. -- Returns :
  959. -- The "test-collapse-row" signal
  960. -- gboolean user_function (GtkTreeView *treeview,
  961. -- GtkTreeIter *arg1,
  962. -- GtkTreePath *arg2,
  963. -- gpointer user_data);
  964. -- treeview : the object which received the signal.
  965. -- arg1 :
  966. -- arg2 :
  967. -- user_data : user data set when the signal handler was connected.
  968. -- Returns :
  969. -- The "test-expand-row" signal
  970. -- gboolean user_function (GtkTreeView *treeview,
  971. -- GtkTreeIter *arg1,
  972. -- GtkTreePath *arg2,
  973. -- gpointer user_data);
  974. -- treeview : the object which received the signal.
  975. -- arg1 :
  976. -- arg2 :
  977. -- user_data : user data set when the signal handler was connected.
  978. -- Returns :
  979. -- The "toggle-cursor-row" signal
  980. -- gboolean user_function (GtkTreeView *treeview,
  981. -- gpointer user_data);
  982. -- treeview : the object which received the signal.
  983. -- user_data : user data set when the signal handler was connected.
  984. -- Returns :
  985. feature -- "unselect-all" signal
  986. unselect_all_signal_name: STRING is "unselect-all"
  987. -- "unselect-all"
  988. -- gboolean user_function (GtkTreeView *treeview,
  989. -- gpointer user_data);
  990. enable_on_unselect_all is
  991. -- Connects "unselect-all" signal to `on_unselect_all' feature.
  992. do
  993. connect (Current, unselect_all_signal_name, $on_unselect_all)
  994. end
  995. on_unselect_all: INTEGER is
  996. -- Built-in unselect-all signal handler; empty by design; redefine it.
  997. do
  998. end
  999. connect_agent_to_unselect_all_signal (a_function: FUNCTION[ANY, TUPLE [GTK_TREE_VIEW], BOOLEAN]) is
  1000. -- treeview : the object which received the signal.
  1001. -- user_data : user data set when the signal handler was connected.
  1002. -- Returns : ?
  1003. require
  1004. valid_function: a_function /= Void
  1005. wrapper_is_stored: is_eiffel_wrapper_stored
  1006. local
  1007. unselect_all_callback: UNSELECT_ALL_CALLBACK
  1008. do
  1009. create unselect_all_callback.make
  1010. unselect_all_callback.connect (Current, a_function)
  1011. end
  1012. -- GtkWidget* gtk_tree_view_new (void);
  1013. -- GtkWidget* gtk_tree_view_new_with_model (GtkTreeModel *model);
  1014. -- GtkTreeModel* gtk_tree_view_get_model (GtkTreeView *tree_view);
  1015. -- void gtk_tree_view_set_model (GtkTreeView *tree_view,
  1016. -- GtkTreeModel *model);
  1017. -- GtkTreeSelection* gtk_tree_view_get_selection
  1018. -- (GtkTreeView *tree_view);
  1019. -- GtkAdjustment* gtk_tree_view_get_hadjustment
  1020. -- (GtkTreeView *tree_view);
  1021. -- void gtk_tree_view_set_hadjustment (GtkTreeView *tree_view,
  1022. -- GtkAdjustment *adjustment);
  1023. -- GtkAdjustment* gtk_tree_view_get_vadjustment
  1024. -- (GtkTreeView *tree_view);
  1025. -- void gtk_tree_view_set_vadjustment (GtkTreeView *tree_view,
  1026. -- GtkAdjustment *adjustment);
  1027. -- gboolean gtk_tree_view_get_headers_visible
  1028. -- (GtkTreeView *tree_view);
  1029. -- void gtk_tree_view_set_headers_visible
  1030. -- (GtkTreeView *tree_view,
  1031. -- gboolean headers_visible);
  1032. -- void gtk_tree_view_columns_autosize (GtkTreeView *tree_view);
  1033. -- void gtk_tree_view_set_headers_clickable
  1034. -- (GtkTreeView *tree_view,
  1035. -- gboolean setting);
  1036. -- void gtk_tree_view_set_rules_hint (GtkTreeView *tree_view,
  1037. -- gboolean setting);
  1038. -- gboolean gtk_tree_view_get_rules_hint (GtkTreeView *tree_view);
  1039. -- gint gtk_tree_view_append_column (GtkTreeView *tree_view,
  1040. -- GtkTreeViewColumn *column);
  1041. -- gint gtk_tree_view_remove_column (GtkTreeView *tree_view,
  1042. -- GtkTreeViewColumn *column);
  1043. -- gint gtk_tree_view_insert_column (GtkTreeView *tree_view,
  1044. -- GtkTreeViewColumn *column,
  1045. -- gint position);
  1046. -- gint gtk_tree_view_insert_column_with_attributes
  1047. -- (GtkTreeView *tree_view,
  1048. -- gint position,
  1049. -- const gchar *title,
  1050. -- GtkCellRenderer *cell,
  1051. -- ...);
  1052. -- gint gtk_tree_view_insert_column_with_data_func
  1053. -- (GtkTreeView *tree_view,
  1054. -- gint position,
  1055. -- const gchar *title,
  1056. -- GtkCellRenderer *cell,
  1057. -- GtkTreeCellDataFunc func,
  1058. -- gpointer data,
  1059. -- GDestroyNotify dnotify);
  1060. -- GtkTreeViewColumn* gtk_tree_view_get_column (GtkTreeView *tree_view,
  1061. -- gint n);
  1062. -- GList* gtk_tree_view_get_columns (GtkTreeView *tree_view);
  1063. -- void gtk_tree_view_move_column_after (GtkTreeView *tree_view,
  1064. -- GtkTreeViewColumn *column,
  1065. -- GtkTreeViewColumn *base_column);
  1066. -- void gtk_tree_view_set_expander_column
  1067. -- (GtkTreeView *tree_view,
  1068. -- GtkTreeViewColumn *column);
  1069. -- GtkTreeViewColumn* gtk_tree_view_get_expander_column
  1070. -- (GtkTreeView *tree_view);
  1071. -- void gtk_tree_view_set_column_drag_function
  1072. -- (GtkTreeView *tree_view,
  1073. -- GtkTreeViewColumnDropFunc func,
  1074. -- gpointer user_data,
  1075. -- GtkDestroyNotify destroy);
  1076. -- void gtk_tree_view_scroll_to_point (GtkTreeView *tree_view,
  1077. -- gint tree_x,
  1078. -- gint tree_y);
  1079. -- void gtk_tree_view_scroll_to_cell (GtkTreeView *tree_view,
  1080. -- GtkTreePath *path,
  1081. -- GtkTreeViewColumn *column,
  1082. -- gboolean use_align,
  1083. -- gfloat row_align,
  1084. -- gfloat col_align);
  1085. -- void gtk_tree_view_set_cursor (GtkTreeView *tree_view,
  1086. -- GtkTreePath *path,
  1087. -- GtkTreeViewColumn *focus_column,
  1088. -- gboolean start_editing);
  1089. -- void gtk_tree_view_set_cursor_on_cell
  1090. -- (GtkTreeView *tree_view,
  1091. -- GtkTreePath *path,
  1092. -- GtkTreeViewColumn *focus_column,
  1093. -- GtkCellRenderer *focus_cell,
  1094. -- gboolean start_editing);
  1095. -- void gtk_tree_view_get_cursor (GtkTreeView *tree_view,
  1096. -- GtkTreePath **path,
  1097. -- GtkTreeViewColumn **focus_column);
  1098. -- void gtk_tree_view_row_activated (GtkTreeView *tree_view,
  1099. -- GtkTreePath *path,
  1100. -- GtkTreeViewColumn *column);
  1101. -- void gtk_tree_view_expand_all (GtkTreeView *tree_view);
  1102. -- void gtk_tree_view_collapse_all (GtkTreeView *tree_view);
  1103. -- void gtk_tree_view_expand_to_path (GtkTreeView *tree_view,
  1104. -- GtkTreePath *path);
  1105. -- void gtk_tree_view_map_expanded_rows (GtkTreeView *tree_view,
  1106. -- GtkTreeViewMappingFunc func,
  1107. -- gpointer data);
  1108. -- gboolean gtk_tree_view_row_expanded (GtkTreeView *tree_view,
  1109. -- GtkTreePath *path);
  1110. -- void gtk_tree_view_set_reorderable (GtkTreeView *tree_view,
  1111. -- gboolean reorderable);
  1112. -- gboolean gtk_tree_view_get_reorderable (GtkTreeView *tree_view);
  1113. -- gboolean gtk_tree_view_get_path_at_pos (GtkTreeView *tree_view,
  1114. -- gint x,
  1115. -- gint y,
  1116. -- GtkTreePath **path,
  1117. -- GtkTreeViewColumn **column,
  1118. -- gint *cell_x,
  1119. -- gint *cell_y);
  1120. -- void gtk_tree_view_get_cell_area (GtkTreeView *tree_view,
  1121. -- GtkTreePath *path,
  1122. -- GtkTreeViewColumn *column,
  1123. -- GdkRectangle *rect);
  1124. -- void gtk_tree_view_get_background_area
  1125. -- (GtkTreeView *tree_view,
  1126. -- GtkTreePath *path,
  1127. -- GtkTreeViewColumn *column,
  1128. -- GdkRectangle *rect);
  1129. -- void gtk_tree_view_get_visible_rect (GtkTreeView *tree_view,
  1130. -- GdkRectangle *visible_rect);
  1131. -- gboolean gtk_tree_view_get_visible_range (GtkTreeView *tree_view,
  1132. -- GtkTreePath **start_path,
  1133. -- GtkTreePath **end_path);
  1134. -- GdkWindow* gtk_tree_view_get_bin_window (GtkTreeView *tree_view);
  1135. -- void gtk_tree_view_widget_to_tree_coords
  1136. -- (GtkTreeView *tree_view,
  1137. -- gint wx,
  1138. -- gint wy,
  1139. -- gint *tx,
  1140. -- gint *ty);
  1141. -- void gtk_tree_view_tree_to_widget_coords
  1142. -- (GtkTreeView *tree_view,
  1143. -- gint tx,
  1144. -- gint ty,
  1145. -- gint *wx,
  1146. -- gint *wy);
  1147. -- void gtk_tree_view_enable_model_drag_dest
  1148. -- (GtkTreeView *tree_view,
  1149. -- const GtkTargetEntry *targets,
  1150. -- gint n_targets,
  1151. -- GdkDragAction actions);
  1152. -- void gtk_tree_view_enable_model_drag_source
  1153. -- (GtkTreeView *tree_view,
  1154. -- GdkModifierType start_button_mask,
  1155. -- const GtkTargetEntry *targets,
  1156. -- gint n_targets,
  1157. -- GdkDragAction actions);
  1158. -- void gtk_tree_view_unset_rows_drag_source
  1159. -- (GtkTreeView *tree_view);
  1160. -- void gtk_tree_view_unset_rows_drag_dest
  1161. -- (GtkTreeView *tree_view);
  1162. -- void gtk_tree_view_set_drag_dest_row (GtkTreeView *tree_view,
  1163. -- GtkTreePath *path,
  1164. -- GtkTreeViewDropPosition pos);
  1165. -- void gtk_tree_view_get_drag_dest_row (GtkTreeView *tree_view,
  1166. -- GtkTreePath **path,
  1167. -- GtkTreeViewDropPosition *pos);
  1168. -- gboolean gtk_tree_view_get_dest_row_at_pos
  1169. -- (GtkTreeView *tree_view,
  1170. -- gint drag_x,
  1171. -- gint drag_y,
  1172. -- GtkTreePath **path,
  1173. -- GtkTreeViewDropPosition *pos);
  1174. -- GdkPixmap* gtk_tree_view_create_row_drag_icon
  1175. -- (GtkTreeView *tree_view,
  1176. -- GtkTreePath *path);
  1177. -- void gtk_tree_view_set_enable_search (GtkTreeView *tree_view,
  1178. -- gboolean enable_search);
  1179. -- gboolean gtk_tree_view_get_enable_search (GtkTreeView *tree_view);
  1180. -- gint gtk_tree_view_get_search_column (GtkTreeView *tree_view);
  1181. -- void gtk_tree_view_set_search_column (GtkTreeView *tree_view,
  1182. -- gint column);
  1183. -- GtkTreeViewSearchEqualFunc gtk_tree_view_get_search_equal_func
  1184. -- (GtkTreeView *tree_view);
  1185. -- void gtk_tree_view_set_search_equal_func
  1186. -- (GtkTreeView *tree_view,
  1187. -- GtkTreeViewSearchEqualFunc search_equal_func,
  1188. -- gpointer search_user_data,
  1189. -- GtkDestroyNotify search_destroy);
  1190. -- gboolean gtk_tree_view_get_fixed_height_mode
  1191. -- (GtkTreeView *tree_view);
  1192. -- void gtk_tree_view_set_fixed_height_mode
  1193. -- (GtkTreeView *tree_view,
  1194. -- gboolean enable);
  1195. -- gboolean gtk_tree_view_get_hover_selection
  1196. -- (GtkTreeView *tree_view);
  1197. -- void gtk_tree_view_set_hover_selection
  1198. -- (GtkTreeView *tree_view,
  1199. -- gboolean hover);
  1200. -- gboolean gtk_tree_view_get_hover_expand (GtkTreeView *tree_view);
  1201. -- void gtk_tree_view_set_hover_expand (GtkTreeView *tree_view,
  1202. -- gboolean expand);
  1203. -- void (*GtkTreeDestroyCountFunc) (GtkTreeView *tree_view,
  1204. -- GtkTreePath *path,
  1205. -- gint children,
  1206. -- gpointer user_data);
  1207. -- void gtk_tree_view_set_destroy_count_func
  1208. -- (GtkTreeView *tree_view,
  1209. -- GtkTreeDestroyCountFunc func,
  1210. -- gpointer data,
  1211. -- GtkDestroyNotify destroy);
  1212. -- gboolean (*GtkTreeViewRowSeparatorFunc) (GtkTreeModel *model,
  1213. -- GtkTreeIter *iter,
  1214. -- gpointer data);
  1215. -- GtkTreeViewRowSeparatorFunc gtk_tree_view_get_row_