Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 
 
 
 

230 rindas
8.8 KiB

  1. /* GTK - The GIMP Toolkit
  2. * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
  3. *
  4. * This library is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Lesser 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. * Lesser General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser 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. /*
  20. * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
  21. * file for a list of people on the GTK+ Team. See the ChangeLog
  22. * files for a list of changes. These files are distributed with
  23. * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
  24. */
  25. #if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
  26. #error "Only <gtk/gtk.h> can be included directly."
  27. #endif
  28. #ifndef __GTK_CONTAINER_H__
  29. #define __GTK_CONTAINER_H__
  30. #include <gtk/gtkwidget.h>
  31. #include <gtk/gtkadjustment.h>
  32. G_BEGIN_DECLS
  33. #define GTK_TYPE_CONTAINER (gtk_container_get_type ())
  34. #define GTK_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_CONTAINER, GtkContainer))
  35. #define GTK_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_CONTAINER, GtkContainerClass))
  36. #define GTK_IS_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_CONTAINER))
  37. #define GTK_IS_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CONTAINER))
  38. #define GTK_CONTAINER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_CONTAINER, GtkContainerClass))
  39. #define GTK_IS_RESIZE_CONTAINER(widget) (GTK_IS_CONTAINER (widget) && ((GtkContainer*) (widget))->resize_mode != GTK_RESIZE_PARENT)
  40. typedef struct _GtkContainer GtkContainer;
  41. typedef struct _GtkContainerClass GtkContainerClass;
  42. struct _GtkContainer
  43. {
  44. GtkWidget widget;
  45. GtkWidget *GSEAL (focus_child);
  46. guint GSEAL (border_width) : 16;
  47. /*< private >*/
  48. guint GSEAL (need_resize) : 1;
  49. guint GSEAL (resize_mode) : 2;
  50. guint GSEAL (reallocate_redraws) : 1;
  51. guint GSEAL (has_focus_chain) : 1;
  52. };
  53. struct _GtkContainerClass
  54. {
  55. GtkWidgetClass parent_class;
  56. void (*add) (GtkContainer *container,
  57. GtkWidget *widget);
  58. void (*remove) (GtkContainer *container,
  59. GtkWidget *widget);
  60. void (*check_resize) (GtkContainer *container);
  61. void (*forall) (GtkContainer *container,
  62. gboolean include_internals,
  63. GtkCallback callback,
  64. gpointer callback_data);
  65. void (*set_focus_child) (GtkContainer *container,
  66. GtkWidget *widget);
  67. GType (*child_type) (GtkContainer *container);
  68. gchar* (*composite_name) (GtkContainer *container,
  69. GtkWidget *child);
  70. void (*set_child_property) (GtkContainer *container,
  71. GtkWidget *child,
  72. guint property_id,
  73. const GValue *value,
  74. GParamSpec *pspec);
  75. void (*get_child_property) (GtkContainer *container,
  76. GtkWidget *child,
  77. guint property_id,
  78. GValue *value,
  79. GParamSpec *pspec);
  80. /* Padding for future expansion */
  81. void (*_gtk_reserved1) (void);
  82. void (*_gtk_reserved2) (void);
  83. void (*_gtk_reserved3) (void);
  84. void (*_gtk_reserved4) (void);
  85. };
  86. /* Application-level methods */
  87. GType gtk_container_get_type (void) G_GNUC_CONST;
  88. void gtk_container_set_border_width (GtkContainer *container,
  89. guint border_width);
  90. guint gtk_container_get_border_width (GtkContainer *container);
  91. void gtk_container_add (GtkContainer *container,
  92. GtkWidget *widget);
  93. void gtk_container_remove (GtkContainer *container,
  94. GtkWidget *widget);
  95. void gtk_container_set_resize_mode (GtkContainer *container,
  96. GtkResizeMode resize_mode);
  97. GtkResizeMode gtk_container_get_resize_mode (GtkContainer *container);
  98. void gtk_container_check_resize (GtkContainer *container);
  99. void gtk_container_foreach (GtkContainer *container,
  100. GtkCallback callback,
  101. gpointer callback_data);
  102. #ifndef GTK_DISABLE_DEPRECATED
  103. void gtk_container_foreach_full (GtkContainer *container,
  104. GtkCallback callback,
  105. GtkCallbackMarshal marshal,
  106. gpointer callback_data,
  107. GDestroyNotify notify);
  108. #endif /* GTK_DISABLE_DEPRECATED */
  109. GList* gtk_container_get_children (GtkContainer *container);
  110. #ifndef GTK_DISABLE_DEPRECATED
  111. #define gtk_container_children gtk_container_get_children
  112. #endif
  113. void gtk_container_propagate_expose (GtkContainer *container,
  114. GtkWidget *child,
  115. GdkEventExpose *event);
  116. void gtk_container_set_focus_chain (GtkContainer *container,
  117. GList *focusable_widgets);
  118. gboolean gtk_container_get_focus_chain (GtkContainer *container,
  119. GList **focusable_widgets);
  120. void gtk_container_unset_focus_chain (GtkContainer *container);
  121. /* Widget-level methods */
  122. void gtk_container_set_reallocate_redraws (GtkContainer *container,
  123. gboolean needs_redraws);
  124. void gtk_container_set_focus_child (GtkContainer *container,
  125. GtkWidget *child);
  126. GtkWidget *
  127. gtk_container_get_focus_child (GtkContainer *container);
  128. void gtk_container_set_focus_vadjustment (GtkContainer *container,
  129. GtkAdjustment *adjustment);
  130. GtkAdjustment *gtk_container_get_focus_vadjustment (GtkContainer *container);
  131. void gtk_container_set_focus_hadjustment (GtkContainer *container,
  132. GtkAdjustment *adjustment);
  133. GtkAdjustment *gtk_container_get_focus_hadjustment (GtkContainer *container);
  134. void gtk_container_resize_children (GtkContainer *container);
  135. GType gtk_container_child_type (GtkContainer *container);
  136. void gtk_container_class_install_child_property (GtkContainerClass *cclass,
  137. guint property_id,
  138. GParamSpec *pspec);
  139. GParamSpec* gtk_container_class_find_child_property (GObjectClass *cclass,
  140. const gchar *property_name);
  141. GParamSpec** gtk_container_class_list_child_properties (GObjectClass *cclass,
  142. guint *n_properties);
  143. void gtk_container_add_with_properties (GtkContainer *container,
  144. GtkWidget *widget,
  145. const gchar *first_prop_name,
  146. ...) G_GNUC_NULL_TERMINATED;
  147. void gtk_container_child_set (GtkContainer *container,
  148. GtkWidget *child,
  149. const gchar *first_prop_name,
  150. ...) G_GNUC_NULL_TERMINATED;
  151. void gtk_container_child_get (GtkContainer *container,
  152. GtkWidget *child,
  153. const gchar *first_prop_name,
  154. ...) G_GNUC_NULL_TERMINATED;
  155. void gtk_container_child_set_valist (GtkContainer *container,
  156. GtkWidget *child,
  157. const gchar *first_property_name,
  158. va_list var_args);
  159. void gtk_container_child_get_valist (GtkContainer *container,
  160. GtkWidget *child,
  161. const gchar *first_property_name,
  162. va_list var_args);
  163. void gtk_container_child_set_property (GtkContainer *container,
  164. GtkWidget *child,
  165. const gchar *property_name,
  166. const GValue *value);
  167. void gtk_container_child_get_property (GtkContainer *container,
  168. GtkWidget *child,
  169. const gchar *property_name,
  170. GValue *value);
  171. #define GTK_CONTAINER_WARN_INVALID_CHILD_PROPERTY_ID(object, property_id, pspec) \
  172. G_OBJECT_WARN_INVALID_PSPEC ((object), "child property id", (property_id), (pspec))
  173. void gtk_container_forall (GtkContainer *container,
  174. GtkCallback callback,
  175. gpointer callback_data);
  176. /* Non-public methods */
  177. void _gtk_container_queue_resize (GtkContainer *container);
  178. void _gtk_container_clear_resize_widgets (GtkContainer *container);
  179. gchar* _gtk_container_child_composite_name (GtkContainer *container,
  180. GtkWidget *child);
  181. void _gtk_container_dequeue_resize_handler (GtkContainer *container);
  182. GList *_gtk_container_focus_sort (GtkContainer *container,
  183. GList *children,
  184. GtkDirectionType direction,
  185. GtkWidget *old_focus);
  186. #ifndef GTK_DISABLE_DEPRECATED
  187. #define gtk_container_border_width gtk_container_set_border_width
  188. #endif /* GTK_DISABLE_DEPRECATED */
  189. G_END_DECLS
  190. #endif /* __GTK_CONTAINER_H__ */