Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 
 
 

243 linhas
12 KiB

  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, write to the
  16. * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  17. * Boston, MA 02111-1307, USA.
  18. */
  19. #if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
  20. #error "Only <gtk/gtk.h> can be included directly."
  21. #endif
  22. #ifndef __GTK_ICON_VIEW_H__
  23. #define __GTK_ICON_VIEW_H__
  24. #include <gtk/gtkcontainer.h>
  25. #include <gtk/gtktreemodel.h>
  26. #include <gtk/gtkcellrenderer.h>
  27. #include <gtk/gtkselection.h>
  28. #include <gtk/gtktooltip.h>
  29. G_BEGIN_DECLS
  30. #define GTK_TYPE_ICON_VIEW (gtk_icon_view_get_type ())
  31. #define GTK_ICON_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_ICON_VIEW, GtkIconView))
  32. #define GTK_ICON_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_ICON_VIEW, GtkIconViewClass))
  33. #define GTK_IS_ICON_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_ICON_VIEW))
  34. #define GTK_IS_ICON_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_ICON_VIEW))
  35. #define GTK_ICON_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_ICON_VIEW, GtkIconViewClass))
  36. typedef struct _GtkIconView GtkIconView;
  37. typedef struct _GtkIconViewClass GtkIconViewClass;
  38. typedef struct _GtkIconViewPrivate GtkIconViewPrivate;
  39. typedef void (* GtkIconViewForeachFunc) (GtkIconView *icon_view,
  40. GtkTreePath *path,
  41. gpointer data);
  42. typedef enum
  43. {
  44. GTK_ICON_VIEW_NO_DROP,
  45. GTK_ICON_VIEW_DROP_INTO,
  46. GTK_ICON_VIEW_DROP_LEFT,
  47. GTK_ICON_VIEW_DROP_RIGHT,
  48. GTK_ICON_VIEW_DROP_ABOVE,
  49. GTK_ICON_VIEW_DROP_BELOW
  50. } GtkIconViewDropPosition;
  51. struct _GtkIconView
  52. {
  53. GtkContainer parent;
  54. GtkIconViewPrivate *GSEAL (priv);
  55. };
  56. struct _GtkIconViewClass
  57. {
  58. GtkContainerClass parent_class;
  59. void (* set_scroll_adjustments) (GtkIconView *icon_view,
  60. GtkAdjustment *hadjustment,
  61. GtkAdjustment *vadjustment);
  62. void (* item_activated) (GtkIconView *icon_view,
  63. GtkTreePath *path);
  64. void (* selection_changed) (GtkIconView *icon_view);
  65. /* Key binding signals */
  66. void (* select_all) (GtkIconView *icon_view);
  67. void (* unselect_all) (GtkIconView *icon_view);
  68. void (* select_cursor_item) (GtkIconView *icon_view);
  69. void (* toggle_cursor_item) (GtkIconView *icon_view);
  70. gboolean (* move_cursor) (GtkIconView *icon_view,
  71. GtkMovementStep step,
  72. gint count);
  73. gboolean (* activate_cursor_item) (GtkIconView *icon_view);
  74. };
  75. GType gtk_icon_view_get_type (void) G_GNUC_CONST;
  76. GtkWidget * gtk_icon_view_new (void);
  77. GtkWidget * gtk_icon_view_new_with_model (GtkTreeModel *model);
  78. void gtk_icon_view_set_model (GtkIconView *icon_view,
  79. GtkTreeModel *model);
  80. GtkTreeModel * gtk_icon_view_get_model (GtkIconView *icon_view);
  81. void gtk_icon_view_set_text_column (GtkIconView *icon_view,
  82. gint column);
  83. gint gtk_icon_view_get_text_column (GtkIconView *icon_view);
  84. void gtk_icon_view_set_markup_column (GtkIconView *icon_view,
  85. gint column);
  86. gint gtk_icon_view_get_markup_column (GtkIconView *icon_view);
  87. void gtk_icon_view_set_pixbuf_column (GtkIconView *icon_view,
  88. gint column);
  89. gint gtk_icon_view_get_pixbuf_column (GtkIconView *icon_view);
  90. void gtk_icon_view_set_orientation (GtkIconView *icon_view,
  91. GtkOrientation orientation);
  92. GtkOrientation gtk_icon_view_get_orientation (GtkIconView *icon_view);
  93. void gtk_icon_view_set_item_orientation (GtkIconView *icon_view,
  94. GtkOrientation orientation);
  95. GtkOrientation gtk_icon_view_get_item_orientation (GtkIconView *icon_view);
  96. void gtk_icon_view_set_columns (GtkIconView *icon_view,
  97. gint columns);
  98. gint gtk_icon_view_get_columns (GtkIconView *icon_view);
  99. void gtk_icon_view_set_item_width (GtkIconView *icon_view,
  100. gint item_width);
  101. gint gtk_icon_view_get_item_width (GtkIconView *icon_view);
  102. void gtk_icon_view_set_spacing (GtkIconView *icon_view,
  103. gint spacing);
  104. gint gtk_icon_view_get_spacing (GtkIconView *icon_view);
  105. void gtk_icon_view_set_row_spacing (GtkIconView *icon_view,
  106. gint row_spacing);
  107. gint gtk_icon_view_get_row_spacing (GtkIconView *icon_view);
  108. void gtk_icon_view_set_column_spacing (GtkIconView *icon_view,
  109. gint column_spacing);
  110. gint gtk_icon_view_get_column_spacing (GtkIconView *icon_view);
  111. void gtk_icon_view_set_margin (GtkIconView *icon_view,
  112. gint margin);
  113. gint gtk_icon_view_get_margin (GtkIconView *icon_view);
  114. void gtk_icon_view_set_item_padding (GtkIconView *icon_view,
  115. gint item_padding);
  116. gint gtk_icon_view_get_item_padding (GtkIconView *icon_view);
  117. GtkTreePath * gtk_icon_view_get_path_at_pos (GtkIconView *icon_view,
  118. gint x,
  119. gint y);
  120. gboolean gtk_icon_view_get_item_at_pos (GtkIconView *icon_view,
  121. gint x,
  122. gint y,
  123. GtkTreePath **path,
  124. GtkCellRenderer **cell);
  125. gboolean gtk_icon_view_get_visible_range (GtkIconView *icon_view,
  126. GtkTreePath **start_path,
  127. GtkTreePath **end_path);
  128. void gtk_icon_view_selected_foreach (GtkIconView *icon_view,
  129. GtkIconViewForeachFunc func,
  130. gpointer data);
  131. void gtk_icon_view_set_selection_mode (GtkIconView *icon_view,
  132. GtkSelectionMode mode);
  133. GtkSelectionMode gtk_icon_view_get_selection_mode (GtkIconView *icon_view);
  134. void gtk_icon_view_select_path (GtkIconView *icon_view,
  135. GtkTreePath *path);
  136. void gtk_icon_view_unselect_path (GtkIconView *icon_view,
  137. GtkTreePath *path);
  138. gboolean gtk_icon_view_path_is_selected (GtkIconView *icon_view,
  139. GtkTreePath *path);
  140. gint gtk_icon_view_get_item_row (GtkIconView *icon_view,
  141. GtkTreePath *path);
  142. gint gtk_icon_view_get_item_column (GtkIconView *icon_view,
  143. GtkTreePath *path);
  144. GList *gtk_icon_view_get_selected_items (GtkIconView *icon_view);
  145. void gtk_icon_view_select_all (GtkIconView *icon_view);
  146. void gtk_icon_view_unselect_all (GtkIconView *icon_view);
  147. void gtk_icon_view_item_activated (GtkIconView *icon_view,
  148. GtkTreePath *path);
  149. void gtk_icon_view_set_cursor (GtkIconView *icon_view,
  150. GtkTreePath *path,
  151. GtkCellRenderer *cell,
  152. gboolean start_editing);
  153. gboolean gtk_icon_view_get_cursor (GtkIconView *icon_view,
  154. GtkTreePath **path,
  155. GtkCellRenderer **cell);
  156. void gtk_icon_view_scroll_to_path (GtkIconView *icon_view,
  157. GtkTreePath *path,
  158. gboolean use_align,
  159. gfloat row_align,
  160. gfloat col_align);
  161. /* Drag-and-Drop support */
  162. void gtk_icon_view_enable_model_drag_source (GtkIconView *icon_view,
  163. GdkModifierType start_button_mask,
  164. const GtkTargetEntry *targets,
  165. gint n_targets,
  166. GdkDragAction actions);
  167. void gtk_icon_view_enable_model_drag_dest (GtkIconView *icon_view,
  168. const GtkTargetEntry *targets,
  169. gint n_targets,
  170. GdkDragAction actions);
  171. void gtk_icon_view_unset_model_drag_source (GtkIconView *icon_view);
  172. void gtk_icon_view_unset_model_drag_dest (GtkIconView *icon_view);
  173. void gtk_icon_view_set_reorderable (GtkIconView *icon_view,
  174. gboolean reorderable);
  175. gboolean gtk_icon_view_get_reorderable (GtkIconView *icon_view);
  176. /* These are useful to implement your own custom stuff. */
  177. void gtk_icon_view_set_drag_dest_item (GtkIconView *icon_view,
  178. GtkTreePath *path,
  179. GtkIconViewDropPosition pos);
  180. void gtk_icon_view_get_drag_dest_item (GtkIconView *icon_view,
  181. GtkTreePath **path,
  182. GtkIconViewDropPosition *pos);
  183. gboolean gtk_icon_view_get_dest_item_at_pos (GtkIconView *icon_view,
  184. gint drag_x,
  185. gint drag_y,
  186. GtkTreePath **path,
  187. GtkIconViewDropPosition *pos);
  188. GdkPixmap *gtk_icon_view_create_drag_icon (GtkIconView *icon_view,
  189. GtkTreePath *path);
  190. void gtk_icon_view_convert_widget_to_bin_window_coords (GtkIconView *icon_view,
  191. gint wx,
  192. gint wy,
  193. gint *bx,
  194. gint *by);
  195. void gtk_icon_view_set_tooltip_item (GtkIconView *icon_view,
  196. GtkTooltip *tooltip,
  197. GtkTreePath *path);
  198. void gtk_icon_view_set_tooltip_cell (GtkIconView *icon_view,
  199. GtkTooltip *tooltip,
  200. GtkTreePath *path,
  201. GtkCellRenderer *cell);
  202. gboolean gtk_icon_view_get_tooltip_context (GtkIconView *icon_view,
  203. gint *x,
  204. gint *y,
  205. gboolean keyboard_tip,
  206. GtkTreeModel **model,
  207. GtkTreePath **path,
  208. GtkTreeIter *iter);
  209. void gtk_icon_view_set_tooltip_column (GtkIconView *icon_view,
  210. gint column);
  211. gint gtk_icon_view_get_tooltip_column (GtkIconView *icon_view);
  212. G_END_DECLS
  213. #endif /* __GTK_ICON_VIEW_H__ */