You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

160 line
6.5 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_BOX_H__
  29. #define __GTK_BOX_H__
  30. #include <gtk/gtkcontainer.h>
  31. G_BEGIN_DECLS
  32. #define GTK_TYPE_BOX (gtk_box_get_type ())
  33. #define GTK_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_BOX, GtkBox))
  34. #define GTK_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_BOX, GtkBoxClass))
  35. #define GTK_IS_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_BOX))
  36. #define GTK_IS_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_BOX))
  37. #define GTK_BOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_BOX, GtkBoxClass))
  38. typedef struct _GtkBox GtkBox;
  39. typedef struct _GtkBoxClass GtkBoxClass;
  40. struct _GtkBox
  41. {
  42. GtkContainer container;
  43. /*< public >*/
  44. GList *GSEAL (children);
  45. gint16 GSEAL (spacing);
  46. guint GSEAL (homogeneous) : 1;
  47. };
  48. struct _GtkBoxClass
  49. {
  50. GtkContainerClass parent_class;
  51. };
  52. /**
  53. * GtkBoxChild:
  54. * @widget: the child widget, packed into the GtkBox.
  55. * @padding: the number of extra pixels to put between this child and its
  56. * neighbors, set when packed, zero by default.
  57. * @expand: flag indicates whether extra space should be given to this child.
  58. * Any extra space given to the parent GtkBox is divided up among all children
  59. * with this attribute set to %TRUE; set when packed, %TRUE by default.
  60. * @fill: flag indicates whether any extra space given to this child due to its
  61. * @expand attribute being set is actually allocated to the child, rather than
  62. * being used as padding around the widget; set when packed, %TRUE by default.
  63. * @pack: one of #GtkPackType indicating whether the child is packed with
  64. * reference to the start (top/left) or end (bottom/right) of the GtkBox.
  65. * @is_secondary: %TRUE if the child is secondary
  66. *
  67. * The #GtkBoxChild holds a child widget of #GtkBox and describes how the child
  68. * is to be packed into the #GtkBox. All fields of this #GtkBoxChild should be
  69. * considered read-only and they should never be set directly by an application.
  70. * Use gtk_box_query_child_packing() and gtk_box_set_child_packing() to query
  71. * and set the #GtkBoxChild.padding, #GtkBoxChild.expand, #GtkBoxChild.fill and
  72. * #GtkBoxChild.pack fields.
  73. *
  74. * Deprecated: 2.22: Use gtk_container_get_children() instead.
  75. */
  76. #if !defined (GTK_DISABLE_DEPRECATED) || defined (GTK_COMPILATION)
  77. typedef struct _GtkBoxChild GtkBoxChild;
  78. struct _GtkBoxChild
  79. {
  80. GtkWidget *widget;
  81. guint16 padding;
  82. guint expand : 1;
  83. guint fill : 1;
  84. guint pack : 1;
  85. guint is_secondary : 1;
  86. };
  87. #endif
  88. GType gtk_box_get_type (void) G_GNUC_CONST;
  89. GtkWidget* _gtk_box_new (GtkOrientation orientation,
  90. gboolean homogeneous,
  91. gint spacing);
  92. void gtk_box_pack_start (GtkBox *box,
  93. GtkWidget *child,
  94. gboolean expand,
  95. gboolean fill,
  96. guint padding);
  97. void gtk_box_pack_end (GtkBox *box,
  98. GtkWidget *child,
  99. gboolean expand,
  100. gboolean fill,
  101. guint padding);
  102. #ifndef GTK_DISABLE_DEPRECATED
  103. void gtk_box_pack_start_defaults (GtkBox *box,
  104. GtkWidget *widget);
  105. void gtk_box_pack_end_defaults (GtkBox *box,
  106. GtkWidget *widget);
  107. #endif
  108. void gtk_box_set_homogeneous (GtkBox *box,
  109. gboolean homogeneous);
  110. gboolean gtk_box_get_homogeneous (GtkBox *box);
  111. void gtk_box_set_spacing (GtkBox *box,
  112. gint spacing);
  113. gint gtk_box_get_spacing (GtkBox *box);
  114. void gtk_box_reorder_child (GtkBox *box,
  115. GtkWidget *child,
  116. gint position);
  117. void gtk_box_query_child_packing (GtkBox *box,
  118. GtkWidget *child,
  119. gboolean *expand,
  120. gboolean *fill,
  121. guint *padding,
  122. GtkPackType *pack_type);
  123. void gtk_box_set_child_packing (GtkBox *box,
  124. GtkWidget *child,
  125. gboolean expand,
  126. gboolean fill,
  127. guint padding,
  128. GtkPackType pack_type);
  129. /* internal API */
  130. void _gtk_box_set_old_defaults (GtkBox *box);
  131. gboolean _gtk_box_get_spacing_set (GtkBox *box);
  132. void _gtk_box_set_spacing_set (GtkBox *box,
  133. gboolean spacing_set);
  134. G_END_DECLS
  135. #endif /* __GTK_BOX_H__ */