1 /*******************************************************************************
2 **3456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
3 ** 10 20 30 40 50 60 70 80
5 ** library for GtkXPaned-widget, a 2x2 grid-like variation of GtkPaned of gtk+
6 ** Copyright (C) 2005-2006 Mirco "MacSlow" Müller <macslow@bangang.de>
8 ** This library is free software; you can redistribute it and/or
9 ** modify it under the terms of the GNU Lesser General Public
10 ** License as published by the Free Software Foundation; either
11 ** version 2.1 of the License, or (at your option) any later version.
13 ** This library is distributed in the hope that it will be useful,
14 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 ** Lesser General Public License for more details.
18 ** You should have received a copy of the GNU Lesser General Public
19 ** License along with this library; if not, write to the Free Software
20 ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 ** GtkXPaned is based on GtkPaned which was done by...
24 ** "Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald"
26 ** and later modified by...
28 ** "the GTK+ Team and others 1997-2000"
30 *******************************************************************************/
35 #include <gtk/gtkcontainer.h>
38 #define GTK_TYPE_XPANED (gtk_xpaned_get_type ())
39 #define GTK_XPANED(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_XPANED, GtkXPaned))
40 #define GTK_XPANED_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_XPANED, GtkXPanedClass))
41 #define GTK_IS_XPANED(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_XPANED))
42 #define GTK_IS_XPANED_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_XPANED))
43 #define GTK_XPANED_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_XPANED, GtkXPanedClass))
44 typedef struct _GtkXPaned GtkXPaned;
45 typedef struct _GtkXPanedClass GtkXPanedClass;
46 typedef struct _GtkXPanedPrivate GtkXPanedPrivate;
48 typedef enum _GtkXPanedChild
50 GTK_XPANED_TOP_LEFT = 0,
52 GTK_XPANED_BOTTOM_LEFT,
53 GTK_XPANED_BOTTOM_RIGHT
58 GtkContainer container;
60 GtkWidget *top_left_child;
61 GtkWidget *top_right_child;
62 GtkWidget *bottom_left_child;
63 GtkWidget *bottom_right_child;
65 GdkWindow *handle_east;
66 GdkWindow *handle_west;
67 GdkWindow *handle_north;
68 GdkWindow *handle_south;
69 GdkWindow *handle_middle;
71 GdkCursorType cursor_type_east;
72 GdkCursorType cursor_type_west;
73 GdkCursorType cursor_type_north;
74 GdkCursorType cursor_type_south;
75 GdkCursorType cursor_type_middle;
78 GdkRectangle handle_pos_east;
79 GdkRectangle handle_pos_west;
80 GdkRectangle handle_pos_north;
81 GdkRectangle handle_pos_south;
82 GdkRectangle handle_pos_middle;
83 GtkRequisition top_left_child_size;
84 GtkRequisition top_right_child_size;
85 GtkRequisition bottom_left_child_size;
86 GtkRequisition bottom_right_child_size;
88 GtkRequisition last_allocation;
89 GdkPoint min_position;
90 GdkPoint max_position;
91 gboolean maximized[4];
95 guint in_drag_horiz:1;
96 guint in_drag_vert_and_horiz:1;
97 guint top_left_child_shrink:1;
98 guint top_left_child_resize:1;
99 guint top_right_child_shrink:1;
100 guint top_right_child_resize:1;
101 guint bottom_left_child_shrink:1;
102 guint bottom_left_child_resize:1;
103 guint bottom_right_child_shrink:1;
104 guint bottom_right_child_resize:1;
105 guint in_recursion:1;
106 guint handle_prelit:1;
108 GtkWidget *last_top_left_child_focus;
109 GtkWidget *last_top_right_child_focus;
110 GtkWidget *last_bottom_left_child_focus;
111 GtkWidget *last_bottom_right_child_focus;
112 GtkXPanedPrivate *priv;
115 GdkPoint original_position;
116 GdkPoint unmaximized_position;
119 struct _GtkXPanedClass
121 GtkContainerClass parent_class;
122 gboolean (*cycle_child_focus) (GtkXPaned * xpaned, gboolean reverse);
123 gboolean (*toggle_handle_focus) (GtkXPaned * xpaned);
124 gboolean (*move_handle) (GtkXPaned * xpaned, GtkScrollType scroll);
125 gboolean (*cycle_handle_focus) (GtkXPaned * xpaned, gboolean reverse);
126 gboolean (*accept_position) (GtkXPaned * xpaned);
127 gboolean (*cancel_position) (GtkXPaned * xpaned);
131 gtk_xpaned_get_type (void)
133 GtkWidget *gtk_xpaned_new (void);
134 void gtk_xpaned_add_top_left (GtkXPaned * xpaned, GtkWidget * child);
135 void gtk_xpaned_add_top_right (GtkXPaned * xpaned, GtkWidget * child);
136 void gtk_xpaned_add_bottom_left (GtkXPaned * xpaned, GtkWidget * child);
137 void gtk_xpaned_add_bottom_right (GtkXPaned * xpaned, GtkWidget * child);
138 void gtk_xpaned_pack_top_left (GtkXPaned * xpaned, GtkWidget * child,
139 gboolean resize, gboolean shrink);
140 void gtk_xpaned_pack_top_right (GtkXPaned * xpaned, GtkWidget * child,
141 gboolean resize, gboolean shrink);
142 void gtk_xpaned_pack_bottom_left (GtkXPaned * xpaned, GtkWidget * child,
143 gboolean resize, gboolean shrink);
144 void gtk_xpaned_pack_bottom_right (GtkXPaned * xpaned, GtkWidget * child,
145 gboolean resize, gboolean shrink);
146 gint gtk_xpaned_get_position_x (GtkXPaned * xpaned);
147 gint gtk_xpaned_get_position_y (GtkXPaned * xpaned);
148 void gtk_xpaned_set_position_x (GtkXPaned * xpaned, gint xposition);
149 void gtk_xpaned_set_position_y (GtkXPaned * xpaned, gint yposition);
150 void gtk_xpaned_save_unmaximized_x (GtkXPaned * xpaned);
151 void gtk_xpaned_save_unmaximized_y (GtkXPaned * xpaned);
152 gint gtk_xpaned_fetch_unmaximized_x (GtkXPaned * xpaned);
153 gint gtk_xpaned_fetch_unmaximized_y (GtkXPaned * xpaned);
154 GtkWidget *gtk_xpaned_get_top_left_child (GtkXPaned * xpaned);
155 GtkWidget *gtk_xpaned_get_top_right_child (GtkXPaned * xpaned);
156 GtkWidget *gtk_xpaned_get_bottom_right_child (GtkXPaned * xpaned);
157 GtkWidget *gtk_xpaned_get_bottom_left_child (GtkXPaned * xpaned);
158 gboolean gtk_xpaned_maximize_top_left (GtkXPaned * xpaned,
160 gboolean gtk_xpaned_maximize_top_right (GtkXPaned * xpaned,
162 gboolean gtk_xpaned_maximize_bottom_left (GtkXPaned * xpaned,
164 gboolean gtk_xpaned_maximize_bottom_right (GtkXPaned * xpaned,
167 /* Internal function */
168 #if !defined (GTK_DISABLE_DEPRECATED) || defined (GTK_COMPILATION)
169 void gtk_xpaned_compute_position (GtkXPaned * xpaned,
170 const GtkAllocation * allocation,
171 GtkRequisition * top_left_child_req,
172 GtkRequisition * top_right_child_req,
173 GtkRequisition * bottom_left_child_req,
175 bottom_right_child_req);
176 #endif /* !GTK_DISABLE_DEPRECATED || GTK_COMPILATION */
177 #ifndef GTK_DISABLE_DEPRECATED
178 #define gtk_xpaned_gutter_size(p,s) (void) 0
179 #define gtk_xpaned_set_gutter_size(p,s) (void) 0
180 #endif /* GTK_DISABLE_DEPRECATED */
183 #endif /* GTK_XPANED_H */