PageRenderTime 47ms CodeModel.GetById 18ms RepoModel.GetById 1ms app.codeStats 0ms

/gtk+-3.4.4/gtk/gtkiconview.h

#
C Header | 261 lines | 192 code | 28 blank | 41 comment | 1 complexity | d9d661e79a15e2042419aae091d137bc MD5 | raw file
Possible License(s): LGPL-2.0, AGPL-3.0, LGPL-2.1
  1. /* gtkiconview.h
  2. * Copyright (C) 2002, 2004 Anders Carlsson <andersca@gnome.org>
  3. *
  4. * This library is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Library General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2 of the License, or (at your option) any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * Library General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Library General Public
  15. * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  16. */
  17. #if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
  18. #error "Only <gtk/gtk.h> can be included directly."
  19. #endif
  20. #ifndef __GTK_ICON_VIEW_H__
  21. #define __GTK_ICON_VIEW_H__
  22. #include <gtk/gtkcontainer.h>
  23. #include <gtk/gtktreemodel.h>
  24. #include <gtk/gtkcellrenderer.h>
  25. #include <gtk/gtkcellarea.h>
  26. #include <gtk/gtkselection.h>
  27. #include <gtk/gtktooltip.h>
  28. G_BEGIN_DECLS
  29. #define GTK_TYPE_ICON_VIEW (gtk_icon_view_get_type ())
  30. #define GTK_ICON_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_ICON_VIEW, GtkIconView))
  31. #define GTK_ICON_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_ICON_VIEW, GtkIconViewClass))
  32. #define GTK_IS_ICON_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_ICON_VIEW))
  33. #define GTK_IS_ICON_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_ICON_VIEW))
  34. #define GTK_ICON_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_ICON_VIEW, GtkIconViewClass))
  35. typedef struct _GtkIconView GtkIconView;
  36. typedef struct _GtkIconViewClass GtkIconViewClass;
  37. typedef struct _GtkIconViewPrivate GtkIconViewPrivate;
  38. /**
  39. * GtkIconViewForeachFunc:
  40. * @icon_view: a #GtkIconView
  41. * @path: The #GtkTreePath of a selected row
  42. * @data: user data
  43. *
  44. * A function used by gtk_icon_view_selected_foreach() to map all
  45. * selected rows. It will be called on every selected row in the view.
  46. */
  47. typedef void (* GtkIconViewForeachFunc) (GtkIconView *icon_view,
  48. GtkTreePath *path,
  49. gpointer data);
  50. /**
  51. * GtkIconViewDropPosition:
  52. * @GTK_ICON_VIEW_NO_DROP: no drop possible
  53. * @GTK_ICON_VIEW_DROP_INTO: dropped item replaces the item
  54. * @GTK_ICON_VIEW_DROP_LEFT: droppped item is inserted to the left
  55. * @GTK_ICON_VIEW_DROP_RIGHT: dropped item is inserted to the right
  56. * @GTK_ICON_VIEW_DROP_ABOVE: dropped item is inserted above
  57. * @GTK_ICON_VIEW_DROP_BELOW: dropped item is inserted below
  58. *
  59. * An enum for determining where a dropped item goes.
  60. */
  61. typedef enum
  62. {
  63. GTK_ICON_VIEW_NO_DROP,
  64. GTK_ICON_VIEW_DROP_INTO,
  65. GTK_ICON_VIEW_DROP_LEFT,
  66. GTK_ICON_VIEW_DROP_RIGHT,
  67. GTK_ICON_VIEW_DROP_ABOVE,
  68. GTK_ICON_VIEW_DROP_BELOW
  69. } GtkIconViewDropPosition;
  70. struct _GtkIconView
  71. {
  72. GtkContainer parent;
  73. /*< private >*/
  74. GtkIconViewPrivate *priv;
  75. };
  76. struct _GtkIconViewClass
  77. {
  78. GtkContainerClass parent_class;
  79. void (* item_activated) (GtkIconView *icon_view,
  80. GtkTreePath *path);
  81. void (* selection_changed) (GtkIconView *icon_view);
  82. /* Key binding signals */
  83. void (* select_all) (GtkIconView *icon_view);
  84. void (* unselect_all) (GtkIconView *icon_view);
  85. void (* select_cursor_item) (GtkIconView *icon_view);
  86. void (* toggle_cursor_item) (GtkIconView *icon_view);
  87. gboolean (* move_cursor) (GtkIconView *icon_view,
  88. GtkMovementStep step,
  89. gint count);
  90. gboolean (* activate_cursor_item) (GtkIconView *icon_view);
  91. /* Padding for future expansion */
  92. void (*_gtk_reserved1) (void);
  93. void (*_gtk_reserved2) (void);
  94. void (*_gtk_reserved3) (void);
  95. void (*_gtk_reserved4) (void);
  96. };
  97. GType gtk_icon_view_get_type (void) G_GNUC_CONST;
  98. GtkWidget * gtk_icon_view_new (void);
  99. GtkWidget * gtk_icon_view_new_with_area (GtkCellArea *area);
  100. GtkWidget * gtk_icon_view_new_with_model (GtkTreeModel *model);
  101. void gtk_icon_view_set_model (GtkIconView *icon_view,
  102. GtkTreeModel *model);
  103. GtkTreeModel * gtk_icon_view_get_model (GtkIconView *icon_view);
  104. void gtk_icon_view_set_text_column (GtkIconView *icon_view,
  105. gint column);
  106. gint gtk_icon_view_get_text_column (GtkIconView *icon_view);
  107. void gtk_icon_view_set_markup_column (GtkIconView *icon_view,
  108. gint column);
  109. gint gtk_icon_view_get_markup_column (GtkIconView *icon_view);
  110. void gtk_icon_view_set_pixbuf_column (GtkIconView *icon_view,
  111. gint column);
  112. gint gtk_icon_view_get_pixbuf_column (GtkIconView *icon_view);
  113. void gtk_icon_view_set_item_orientation (GtkIconView *icon_view,
  114. GtkOrientation orientation);
  115. GtkOrientation gtk_icon_view_get_item_orientation (GtkIconView *icon_view);
  116. void gtk_icon_view_set_columns (GtkIconView *icon_view,
  117. gint columns);
  118. gint gtk_icon_view_get_columns (GtkIconView *icon_view);
  119. void gtk_icon_view_set_item_width (GtkIconView *icon_view,
  120. gint item_width);
  121. gint gtk_icon_view_get_item_width (GtkIconView *icon_view);
  122. void gtk_icon_view_set_spacing (GtkIconView *icon_view,
  123. gint spacing);
  124. gint gtk_icon_view_get_spacing (GtkIconView *icon_view);
  125. void gtk_icon_view_set_row_spacing (GtkIconView *icon_view,
  126. gint row_spacing);
  127. gint gtk_icon_view_get_row_spacing (GtkIconView *icon_view);
  128. void gtk_icon_view_set_column_spacing (GtkIconView *icon_view,
  129. gint column_spacing);
  130. gint gtk_icon_view_get_column_spacing (GtkIconView *icon_view);
  131. void gtk_icon_view_set_margin (GtkIconView *icon_view,
  132. gint margin);
  133. gint gtk_icon_view_get_margin (GtkIconView *icon_view);
  134. void gtk_icon_view_set_item_padding (GtkIconView *icon_view,
  135. gint item_padding);
  136. gint gtk_icon_view_get_item_padding (GtkIconView *icon_view);
  137. GtkTreePath * gtk_icon_view_get_path_at_pos (GtkIconView *icon_view,
  138. gint x,
  139. gint y);
  140. gboolean gtk_icon_view_get_item_at_pos (GtkIconView *icon_view,
  141. gint x,
  142. gint y,
  143. GtkTreePath **path,
  144. GtkCellRenderer **cell);
  145. gboolean gtk_icon_view_get_visible_range (GtkIconView *icon_view,
  146. GtkTreePath **start_path,
  147. GtkTreePath **end_path);
  148. void gtk_icon_view_selected_foreach (GtkIconView *icon_view,
  149. GtkIconViewForeachFunc func,
  150. gpointer data);
  151. void gtk_icon_view_set_selection_mode (GtkIconView *icon_view,
  152. GtkSelectionMode mode);
  153. GtkSelectionMode gtk_icon_view_get_selection_mode (GtkIconView *icon_view);
  154. void gtk_icon_view_select_path (GtkIconView *icon_view,
  155. GtkTreePath *path);
  156. void gtk_icon_view_unselect_path (GtkIconView *icon_view,
  157. GtkTreePath *path);
  158. gboolean gtk_icon_view_path_is_selected (GtkIconView *icon_view,
  159. GtkTreePath *path);
  160. gint gtk_icon_view_get_item_row (GtkIconView *icon_view,
  161. GtkTreePath *path);
  162. gint gtk_icon_view_get_item_column (GtkIconView *icon_view,
  163. GtkTreePath *path);
  164. GList *gtk_icon_view_get_selected_items (GtkIconView *icon_view);
  165. void gtk_icon_view_select_all (GtkIconView *icon_view);
  166. void gtk_icon_view_unselect_all (GtkIconView *icon_view);
  167. void gtk_icon_view_item_activated (GtkIconView *icon_view,
  168. GtkTreePath *path);
  169. void gtk_icon_view_set_cursor (GtkIconView *icon_view,
  170. GtkTreePath *path,
  171. GtkCellRenderer *cell,
  172. gboolean start_editing);
  173. gboolean gtk_icon_view_get_cursor (GtkIconView *icon_view,
  174. GtkTreePath **path,
  175. GtkCellRenderer **cell);
  176. void gtk_icon_view_scroll_to_path (GtkIconView *icon_view,
  177. GtkTreePath *path,
  178. gboolean use_align,
  179. gfloat row_align,
  180. gfloat col_align);
  181. /* Drag-and-Drop support */
  182. void gtk_icon_view_enable_model_drag_source (GtkIconView *icon_view,
  183. GdkModifierType start_button_mask,
  184. const GtkTargetEntry *targets,
  185. gint n_targets,
  186. GdkDragAction actions);
  187. void gtk_icon_view_enable_model_drag_dest (GtkIconView *icon_view,
  188. const GtkTargetEntry *targets,
  189. gint n_targets,
  190. GdkDragAction actions);
  191. void gtk_icon_view_unset_model_drag_source (GtkIconView *icon_view);
  192. void gtk_icon_view_unset_model_drag_dest (GtkIconView *icon_view);
  193. void gtk_icon_view_set_reorderable (GtkIconView *icon_view,
  194. gboolean reorderable);
  195. gboolean gtk_icon_view_get_reorderable (GtkIconView *icon_view);
  196. /* These are useful to implement your own custom stuff. */
  197. void gtk_icon_view_set_drag_dest_item (GtkIconView *icon_view,
  198. GtkTreePath *path,
  199. GtkIconViewDropPosition pos);
  200. void gtk_icon_view_get_drag_dest_item (GtkIconView *icon_view,
  201. GtkTreePath **path,
  202. GtkIconViewDropPosition *pos);
  203. gboolean gtk_icon_view_get_dest_item_at_pos (GtkIconView *icon_view,
  204. gint drag_x,
  205. gint drag_y,
  206. GtkTreePath **path,
  207. GtkIconViewDropPosition *pos);
  208. cairo_surface_t *gtk_icon_view_create_drag_icon (GtkIconView *icon_view,
  209. GtkTreePath *path);
  210. void gtk_icon_view_convert_widget_to_bin_window_coords (GtkIconView *icon_view,
  211. gint wx,
  212. gint wy,
  213. gint *bx,
  214. gint *by);
  215. void gtk_icon_view_set_tooltip_item (GtkIconView *icon_view,
  216. GtkTooltip *tooltip,
  217. GtkTreePath *path);
  218. void gtk_icon_view_set_tooltip_cell (GtkIconView *icon_view,
  219. GtkTooltip *tooltip,
  220. GtkTreePath *path,
  221. GtkCellRenderer *cell);
  222. gboolean gtk_icon_view_get_tooltip_context (GtkIconView *icon_view,
  223. gint *x,
  224. gint *y,
  225. gboolean keyboard_tip,
  226. GtkTreeModel **model,
  227. GtkTreePath **path,
  228. GtkTreeIter *iter);
  229. void gtk_icon_view_set_tooltip_column (GtkIconView *icon_view,
  230. gint column);
  231. gint gtk_icon_view_get_tooltip_column (GtkIconView *icon_view);
  232. G_END_DECLS
  233. #endif /* __GTK_ICON_VIEW_H__ */