home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 2002 April / pcpro0402.iso / essentials / graphics / Gimp / gimp-src-20001226.exe / src / gimp / app / gtkwrapbox.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-02-07  |  4.8 KB  |  141 lines

  1. /* GTK - The GIMP Toolkit
  2.  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
  3.  *
  4.  * GtkWrapBox: Wrapping box widget
  5.  * Copyright (C) 1999 Tim Janik
  6.  *
  7.  * This library is free software; you can redistribute it and/or
  8.  * modify it under the terms of the GNU Library General Public
  9.  * License as published by the Free Software Foundation; either
  10.  * version 2 of the License, or (at your option) any later version.
  11.  *
  12.  * This library is distributed in the hope that it will be useful,
  13.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  15.  * Library General Public License for more details.
  16.  *
  17.  * You should have received a copy of the GNU Library General Public
  18.  * License along with this library; if not, write to the
  19.  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  20.  * Boston, MA 02111-1307, USA.
  21.  */
  22. #ifndef __GTK_WRAP_BOX_H__
  23. #define __GTK_WRAP_BOX_H__
  24.  
  25.  
  26. #include <gdk/gdk.h>
  27. #include <gtk/gtkcontainer.h>
  28.  
  29.  
  30. #ifdef __cplusplus
  31. extern "C" {
  32. #endif /* __cplusplus */
  33.  
  34.  
  35. /* --- type macros --- */
  36. #define GTK_TYPE_WRAP_BOX         (gtk_wrap_box_get_type ())
  37. #define GTK_WRAP_BOX(obj)         (GTK_CHECK_CAST ((obj), GTK_TYPE_WRAP_BOX, GtkWrapBox))
  38. #define GTK_WRAP_BOX_CLASS(klass)    (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_WRAP_BOX, GtkWrapBoxClass))
  39. #define GTK_IS_WRAP_BOX(obj)         (GTK_CHECK_TYPE ((obj), GTK_TYPE_WRAP_BOX))
  40. #define GTK_IS_WRAP_BOX_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_WRAP_BOX))
  41. #define GTK_WRAP_BOX_GET_CLASS(obj)  (GTK_WRAP_BOX_CLASS (((GtkObject*) (obj))->klass))
  42.  
  43.  
  44. /* --- typedefs --- */
  45. typedef struct _GtkWrapBox      GtkWrapBox;
  46. typedef struct _GtkWrapBoxClass GtkWrapBoxClass;
  47. typedef struct _GtkWrapBoxChild GtkWrapBoxChild;
  48.  
  49. /* --- GtkWrapBox --- */
  50. struct _GtkWrapBox
  51. {
  52.   GtkContainer     container;
  53.   
  54.   guint            homogeneous : 1;
  55.   guint            justify : 4;
  56.   guint            line_justify : 4;
  57.   guint8           hspacing;
  58.   guint8           vspacing;
  59.   guint16          n_children;
  60.   GtkWrapBoxChild *children;
  61.   gfloat           aspect_ratio; /* 1/256..256 */
  62.   guint            child_limit;
  63. };
  64. struct _GtkWrapBoxClass
  65. {
  66.   GtkContainerClass parent_class;
  67.  
  68.   GSList* (*rlist_line_children) (GtkWrapBox       *wbox,
  69.                   GtkWrapBoxChild **child_p,
  70.                   GtkAllocation    *area,
  71.                   guint            *max_child_size,
  72.                   gboolean         *expand_line);
  73. };
  74. struct _GtkWrapBoxChild
  75. {
  76.   GtkWidget *widget;
  77.   guint      hexpand : 1;
  78.   guint      hfill : 1;
  79.   guint      vexpand : 1;
  80.   guint      vfill : 1;
  81.   guint      forced_break : 1;
  82.   
  83.   GtkWrapBoxChild *next;
  84. };
  85. #define GTK_JUSTIFY_TOP    GTK_JUSTIFY_LEFT
  86. #define GTK_JUSTIFY_BOTTOM GTK_JUSTIFY_RIGHT
  87.  
  88.  
  89. /* --- prototypes --- */
  90. GtkType       gtk_wrap_box_get_type            (void);
  91. void       gtk_wrap_box_set_homogeneous     (GtkWrapBox      *wbox,
  92.                          gboolean         homogeneous);
  93. void       gtk_wrap_box_set_hspacing        (GtkWrapBox      *wbox,
  94.                          guint            hspacing);
  95. void       gtk_wrap_box_set_vspacing        (GtkWrapBox      *wbox,
  96.                          guint            vspacing);
  97. void       gtk_wrap_box_set_justify         (GtkWrapBox      *wbox,
  98.                          GtkJustification justify);
  99. void       gtk_wrap_box_set_line_justify    (GtkWrapBox      *wbox,
  100.                          GtkJustification line_justify);
  101. void       gtk_wrap_box_set_aspect_ratio    (GtkWrapBox      *wbox,
  102.                          gfloat           aspect_ratio);
  103. void       gtk_wrap_box_pack                (GtkWrapBox      *wbox,
  104.                          GtkWidget       *child,
  105.                          gboolean         hexpand,
  106.                          gboolean         hfill,
  107.                          gboolean         vexpand,
  108.                          gboolean         vfill);
  109. void       gtk_wrap_box_reorder_child       (GtkWrapBox      *wbox,
  110.                          GtkWidget       *child,
  111.                          gint             position);
  112. void       gtk_wrap_box_query_child_packing (GtkWrapBox      *wbox,
  113.                          GtkWidget       *child,
  114.                          gboolean        *hexpand,
  115.                          gboolean        *hfill,
  116.                          gboolean        *vexpand,
  117.                          gboolean        *vfill);
  118. void       gtk_wrap_box_query_child_forced_break (GtkWrapBox *wbox,
  119.                           GtkWidget  *child,
  120.                           gboolean   *forced_break);
  121. void       gtk_wrap_box_set_child_packing   (GtkWrapBox      *wbox,
  122.                          GtkWidget       *child,
  123.                          gboolean         hexpand,
  124.                          gboolean         hfill,
  125.                          gboolean         vexpand,
  126.                          gboolean         vfill);
  127. void       gtk_wrap_box_set_child_forced_break (GtkWrapBox   *wbox,
  128.                         GtkWidget    *child,
  129.                         gboolean      forced_break);
  130. guint*       gtk_wrap_box_query_line_lengths  (GtkWrapBox         *wbox,
  131.                          guint           *n_lines);
  132.  
  133.  
  134.  
  135. #ifdef __cplusplus
  136. }
  137. #endif /* __cplusplus */
  138.  
  139.  
  140. #endif /* __GTK_WRAP_BOX_H__ */
  141.