annotate src/gui_gtk_f.c @ 4537:5cc98a5898cf v7.3.1016

updated for version 7.3.1016 Problem: Unused field in nfa_state. Solution: Remove lastthread.
author Bram Moolenaar <bram@vim.org>
date Sat, 25 May 2013 15:31:05 +0200
parents e4d849f4df03
children 3456e2ebebd4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 /* vi:set ts=8 sts=4 sw=4:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 *
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 * VIM - Vi IMproved by Bram Moolenaar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4 *
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5 * Do ":help uganda" in Vim to read copying and usage conditions.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 * Do ":help credits" in Vim to see a list of people who contributed.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 * See README.txt for an overview of the Vim source code.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 /*
66
99064882c85b updated for version 7.0030
vimboss
parents: 7
diff changeset
11 * (C) 1998,1999 by Marcin Dalecki <martin@dalecki.de>
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 *
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 * Support for GTK+ 2 was added by:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 *
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 * (C) 2002,2003 Jason Hildebrand <jason@peaceworks.ca>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 * Daniel Elstner <daniel.elstner@gmx.net>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 *
1207
beed57a8fcd1 updated for version 7.1b
vimboss
parents: 129
diff changeset
18 * This is a special purpose container widget, which manages arbitrary
beed57a8fcd1 updated for version 7.1b
vimboss
parents: 129
diff changeset
19 * children at arbitrary positions width arbitrary sizes. This finally puts
beed57a8fcd1 updated for version 7.1b
vimboss
parents: 129
diff changeset
20 * an end on our resize problems with which we where struggling for such a
beed57a8fcd1 updated for version 7.1b
vimboss
parents: 129
diff changeset
21 * long time.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 #include "vim.h"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 #include <gtk/gtk.h> /* without this it compiles, but gives errors at
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 runtime! */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 #include "gui_gtk_f.h"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 #include <gtk/gtksignal.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 #ifdef WIN3264
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 # include <gdk/gdkwin32.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 #else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 # include <gdk/gdkx.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 typedef struct _GtkFormChild GtkFormChild;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 struct _GtkFormChild
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 GtkWidget *widget;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 GdkWindow *window;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 gint x; /* relative subwidget x position */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 gint y; /* relative subwidget y position */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 gint mapped;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 };
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 static void gtk_form_class_init(GtkFormClass *klass);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 static void gtk_form_init(GtkForm *form);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 static void gtk_form_realize(GtkWidget *widget);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 static void gtk_form_unrealize(GtkWidget *widget);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 static void gtk_form_map(GtkWidget *widget);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 static void gtk_form_size_request(GtkWidget *widget,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 GtkRequisition *requisition);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 static void gtk_form_size_allocate(GtkWidget *widget,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 GtkAllocation *allocation);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 static gint gtk_form_expose(GtkWidget *widget,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 GdkEventExpose *event);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 static void gtk_form_remove(GtkContainer *container,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 GtkWidget *widget);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 static void gtk_form_forall(GtkContainer *container,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 gboolean include_internals,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 GtkCallback callback,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 gpointer callback_data);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 static void gtk_form_attach_child_window(GtkForm *form,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 GtkFormChild *child);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 static void gtk_form_realize_child(GtkForm *form,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 GtkFormChild *child);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 static void gtk_form_position_child(GtkForm *form,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 GtkFormChild *child,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 gboolean force_allocate);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 static void gtk_form_position_children(GtkForm *form);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 static GdkFilterReturn gtk_form_filter(GdkXEvent *gdk_xevent,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 GdkEvent *event,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 gpointer data);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 static GdkFilterReturn gtk_form_main_filter(GdkXEvent *gdk_xevent,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 GdkEvent *event,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 gpointer data);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 static void gtk_form_set_static_gravity(GdkWindow *window,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 gboolean use_static);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 static void gtk_form_send_configure(GtkForm *form);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 static void gtk_form_child_map(GtkWidget *widget, gpointer user_data);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 static void gtk_form_child_unmap(GtkWidget *widget, gpointer user_data);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91 static GtkWidgetClass *parent_class = NULL;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93 /* Public interface
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96 GtkWidget *
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97 gtk_form_new(void)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99 GtkForm *form;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101 form = gtk_type_new(gtk_form_get_type());
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
102
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103 return GTK_WIDGET(form);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106 void
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107 gtk_form_put(GtkForm *form,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108 GtkWidget *child_widget,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
109 gint x,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
110 gint y)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
111 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
112 GtkFormChild *child;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
113
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
114 g_return_if_fail(GTK_IS_FORM(form));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
115
129
2983cde45542 updated for version 7.0044
vimboss
parents: 66
diff changeset
116 /* LINTED: avoid warning: conversion to 'unsigned long' */
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
117 child = g_new(GtkFormChild, 1);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
118
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
119 child->widget = child_widget;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
120 child->window = NULL;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
121 child->x = x;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
122 child->y = y;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
123 child->widget->requisition.width = 0;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
124 child->widget->requisition.height = 0;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
125 child->mapped = FALSE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
126
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
127 form->children = g_list_append(form->children, child);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
128
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
129 /* child->window must be created and attached to the widget _before_
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
130 * it has been realized, or else things will break with GTK2. Note
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
131 * that gtk_widget_set_parent() realizes the widget if it's visible
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
132 * and its parent is mapped.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
133 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
134 if (GTK_WIDGET_REALIZED(form))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
135 gtk_form_attach_child_window(form, child);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
136
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
137 gtk_widget_set_parent(child_widget, GTK_WIDGET(form));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
138 gtk_widget_size_request(child->widget, NULL);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
139
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
140 if (GTK_WIDGET_REALIZED(form) && !GTK_WIDGET_REALIZED(child_widget))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
141 gtk_form_realize_child(form, child);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
142
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
143 gtk_form_position_child(form, child, TRUE);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
144 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
145
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
146 void
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
147 gtk_form_move(GtkForm *form,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
148 GtkWidget *child_widget,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
149 gint x,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
150 gint y)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
151 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
152 GList *tmp_list;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
153 GtkFormChild *child;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
154
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
155 g_return_if_fail(GTK_IS_FORM(form));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
156
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
157 for (tmp_list = form->children; tmp_list; tmp_list = tmp_list->next)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
158 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
159 child = tmp_list->data;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
160 if (child->widget == child_widget)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
161 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
162 child->x = x;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
163 child->y = y;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
164
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
165 gtk_form_position_child(form, child, TRUE);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
166 return;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
167 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
168 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
169 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
170
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
171 void
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
172 gtk_form_freeze(GtkForm *form)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
173 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
174 g_return_if_fail(GTK_IS_FORM(form));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
175
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
176 ++form->freeze_count;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
177 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
178
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
179 void
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
180 gtk_form_thaw(GtkForm *form)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
181 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
182 g_return_if_fail(GTK_IS_FORM(form));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
183
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
184 if (form->freeze_count)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
185 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
186 if (!(--form->freeze_count))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
187 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
188 gtk_form_position_children(form);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
189 gtk_widget_queue_draw(GTK_WIDGET(form));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
190 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
191 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
192 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
193
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
194 /* Basic Object handling procedures
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
195 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
196 GtkType
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
197 gtk_form_get_type(void)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
198 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
199 static GtkType form_type = 0;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
200
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
201 if (!form_type)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
202 {
1884
3dd986bfef63 updated for version 7.2-181
vimboss
parents: 1207
diff changeset
203 GtkTypeInfo form_info;
3dd986bfef63 updated for version 7.2-181
vimboss
parents: 1207
diff changeset
204
1885
605f5c2f77ba updated for version 7.2-182
vimboss
parents: 1884
diff changeset
205 vim_memset(&form_info, 0, sizeof(form_info));
1884
3dd986bfef63 updated for version 7.2-181
vimboss
parents: 1207
diff changeset
206 form_info.type_name = "GtkForm";
3dd986bfef63 updated for version 7.2-181
vimboss
parents: 1207
diff changeset
207 form_info.object_size = sizeof(GtkForm);
3dd986bfef63 updated for version 7.2-181
vimboss
parents: 1207
diff changeset
208 form_info.class_size = sizeof(GtkFormClass);
3dd986bfef63 updated for version 7.2-181
vimboss
parents: 1207
diff changeset
209 form_info.class_init_func = (GtkClassInitFunc)gtk_form_class_init;
3dd986bfef63 updated for version 7.2-181
vimboss
parents: 1207
diff changeset
210 form_info.object_init_func = (GtkObjectInitFunc)gtk_form_init;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
211
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
212 form_type = gtk_type_unique(GTK_TYPE_CONTAINER, &form_info);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
213 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
214 return form_type;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
215 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
216
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
217 static void
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
218 gtk_form_class_init(GtkFormClass *klass)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
219 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
220 GtkWidgetClass *widget_class;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
221 GtkContainerClass *container_class;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
222
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
223 widget_class = (GtkWidgetClass *) klass;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
224 container_class = (GtkContainerClass *) klass;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
225
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
226 parent_class = gtk_type_class(gtk_container_get_type());
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
227
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
228 widget_class->realize = gtk_form_realize;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
229 widget_class->unrealize = gtk_form_unrealize;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
230 widget_class->map = gtk_form_map;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
231 widget_class->size_request = gtk_form_size_request;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
232 widget_class->size_allocate = gtk_form_size_allocate;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
233 widget_class->expose_event = gtk_form_expose;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
234
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
235 container_class->remove = gtk_form_remove;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
236 container_class->forall = gtk_form_forall;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
237 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
238
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
239 static void
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
240 gtk_form_init(GtkForm *form)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
241 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
242 form->children = NULL;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
243
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
244 form->width = 1;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
245 form->height = 1;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
246
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
247 form->bin_window = NULL;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
248
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
249 form->configure_serial = 0;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
250 form->visibility = GDK_VISIBILITY_PARTIAL;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
251
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
252 form->freeze_count = 0;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
253 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
254
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
255 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
256 * Widget methods
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
257 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
258
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
259 static void
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
260 gtk_form_realize(GtkWidget *widget)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
261 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
262 GList *tmp_list;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
263 GtkForm *form;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
264 GdkWindowAttr attributes;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
265 gint attributes_mask;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
266
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
267 g_return_if_fail(GTK_IS_FORM(widget));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
268
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
269 form = GTK_FORM(widget);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
270 GTK_WIDGET_SET_FLAGS(form, GTK_REALIZED);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
271
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
272 attributes.window_type = GDK_WINDOW_CHILD;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
273 attributes.x = widget->allocation.x;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
274 attributes.y = widget->allocation.y;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
275 attributes.width = widget->allocation.width;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
276 attributes.height = widget->allocation.height;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
277 attributes.wclass = GDK_INPUT_OUTPUT;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
278 attributes.visual = gtk_widget_get_visual(widget);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
279 attributes.colormap = gtk_widget_get_colormap(widget);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
280 attributes.event_mask = GDK_VISIBILITY_NOTIFY_MASK;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
281
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
282 attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
283
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
284 widget->window = gdk_window_new(gtk_widget_get_parent_window(widget),
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
285 &attributes, attributes_mask);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
286 gdk_window_set_user_data(widget->window, widget);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
287
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
288 attributes.x = 0;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
289 attributes.y = 0;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
290 attributes.event_mask = gtk_widget_get_events(widget);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
291
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
292 form->bin_window = gdk_window_new(widget->window,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
293 &attributes, attributes_mask);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
294 gdk_window_set_user_data(form->bin_window, widget);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
295
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
296 gtk_form_set_static_gravity(form->bin_window, TRUE);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
297
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
298 widget->style = gtk_style_attach(widget->style, widget->window);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
299 gtk_style_set_background(widget->style, widget->window, GTK_STATE_NORMAL);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
300 gtk_style_set_background(widget->style, form->bin_window, GTK_STATE_NORMAL);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
301
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
302 gdk_window_add_filter(widget->window, gtk_form_main_filter, form);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
303 gdk_window_add_filter(form->bin_window, gtk_form_filter, form);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
304
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
305 for (tmp_list = form->children; tmp_list; tmp_list = tmp_list->next)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
306 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
307 GtkFormChild *child = tmp_list->data;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
308
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
309 gtk_form_attach_child_window(form, child);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
310
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
311 if (GTK_WIDGET_VISIBLE(child->widget))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
312 gtk_form_realize_child(form, child);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
313 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
314 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
315
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
316
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
317 /* After reading the documentation at
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
318 * http://developer.gnome.org/doc/API/2.0/gtk/gtk-changes-2-0.html
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
319 * I think it should be possible to remove this function when compiling
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
320 * against gtk-2.0. It doesn't seem to cause problems, though.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
321 *
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
322 * Well, I reckon at least the gdk_window_show(form->bin_window)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
323 * is necessary. GtkForm is anything but a usual container widget.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
324 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
325 static void
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
326 gtk_form_map(GtkWidget *widget)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
327 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
328 GList *tmp_list;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
329 GtkForm *form;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
330
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
331 g_return_if_fail(GTK_IS_FORM(widget));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
332
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
333 form = GTK_FORM(widget);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
334
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
335 GTK_WIDGET_SET_FLAGS(widget, GTK_MAPPED);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
336
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
337 gdk_window_show(widget->window);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
338 gdk_window_show(form->bin_window);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
339
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
340 for (tmp_list = form->children; tmp_list; tmp_list = tmp_list->next)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
341 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
342 GtkFormChild *child = tmp_list->data;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
343
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
344 if (GTK_WIDGET_VISIBLE(child->widget)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
345 && !GTK_WIDGET_MAPPED(child->widget))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
346 gtk_widget_map(child->widget);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
347 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
348 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
349
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
350 static void
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
351 gtk_form_unrealize(GtkWidget *widget)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
352 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
353 GList *tmp_list;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
354 GtkForm *form;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
355
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
356 g_return_if_fail(GTK_IS_FORM(widget));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
357
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
358 form = GTK_FORM(widget);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
359
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
360 tmp_list = form->children;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
361
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
362 gdk_window_set_user_data(form->bin_window, NULL);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
363 gdk_window_destroy(form->bin_window);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
364 form->bin_window = NULL;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
365
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
366 while (tmp_list)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
367 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
368 GtkFormChild *child = tmp_list->data;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
369
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
370 if (child->window != NULL)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
371 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
372 gtk_signal_disconnect_by_func(GTK_OBJECT(child->widget),
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
373 GTK_SIGNAL_FUNC(gtk_form_child_map),
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
374 child);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
375 gtk_signal_disconnect_by_func(GTK_OBJECT(child->widget),
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
376 GTK_SIGNAL_FUNC(gtk_form_child_unmap),
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
377 child);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
378
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
379 gdk_window_set_user_data(child->window, NULL);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
380 gdk_window_destroy(child->window);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
381
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
382 child->window = NULL;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
383 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
384
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
385 tmp_list = tmp_list->next;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
386 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
387
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
388 if (GTK_WIDGET_CLASS (parent_class)->unrealize)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
389 (* GTK_WIDGET_CLASS (parent_class)->unrealize) (widget);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
390 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
391
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
392 static void
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
393 gtk_form_size_request(GtkWidget *widget, GtkRequisition *requisition)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
394 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
395 GList *tmp_list;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
396 GtkForm *form;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
397
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
398 g_return_if_fail(GTK_IS_FORM(widget));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
399
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
400 form = GTK_FORM(widget);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
401
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
402 requisition->width = form->width;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
403 requisition->height = form->height;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
404
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
405 tmp_list = form->children;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
406
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
407 while (tmp_list)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
408 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
409 GtkFormChild *child = tmp_list->data;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
410 gtk_widget_size_request(child->widget, NULL);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
411 tmp_list = tmp_list->next;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
412 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
413 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
414
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
415 static void
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
416 gtk_form_size_allocate(GtkWidget *widget, GtkAllocation *allocation)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
417 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
418 GList *tmp_list;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
419 GtkForm *form;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
420 gboolean need_reposition;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
421
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
422 g_return_if_fail(GTK_IS_FORM(widget));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
423
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
424 if (widget->allocation.x == allocation->x
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
425 && widget->allocation.y == allocation->y
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
426 && widget->allocation.width == allocation->width
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
427 && widget->allocation.height == allocation->height)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
428 return;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
429
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
430 need_reposition = widget->allocation.width != allocation->width
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
431 || widget->allocation.height != allocation->height;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
432 form = GTK_FORM(widget);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
433
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
434 if (need_reposition)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
435 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
436 tmp_list = form->children;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
437
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
438 while (tmp_list)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
439 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
440 GtkFormChild *child = tmp_list->data;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
441 gtk_form_position_child(form, child, TRUE);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
442
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
443 tmp_list = tmp_list->next;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
444 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
445 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
446
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
447 if (GTK_WIDGET_REALIZED(widget))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
448 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
449 gdk_window_move_resize(widget->window,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
450 allocation->x, allocation->y,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
451 allocation->width, allocation->height);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
452 gdk_window_move_resize(GTK_FORM(widget)->bin_window,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
453 0, 0,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
454 allocation->width, allocation->height);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
455 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
456 widget->allocation = *allocation;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
457 if (need_reposition)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
458 gtk_form_send_configure(form);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
459 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
460
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
461 static gint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
462 gtk_form_expose(GtkWidget *widget, GdkEventExpose *event)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
463 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
464 GList *tmp_list;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
465 GtkForm *form;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
466
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
467 g_return_val_if_fail(GTK_IS_FORM(widget), FALSE);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
468
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
469 form = GTK_FORM(widget);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
470
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
471 if (event->window == form->bin_window)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
472 return FALSE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
473
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
474 for (tmp_list = form->children; tmp_list; tmp_list = tmp_list->next)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
475 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
476 GtkFormChild *formchild = tmp_list->data;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
477 GtkWidget *child = formchild->widget;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
478 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
479 * The following chunk of code is taken from gtkcontainer.c. The
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
480 * gtk1.x code synthesized expose events directly on the child widgets,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
481 * which can't be done in gtk2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
482 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
483 if (GTK_WIDGET_DRAWABLE(child) && GTK_WIDGET_NO_WINDOW(child)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
484 && child->window == event->window)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
485 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
486 GdkEventExpose child_event;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
487 child_event = *event;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
488
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
489 child_event.region = gtk_widget_region_intersect(child, event->region);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
490 if (!gdk_region_empty(child_event.region))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
491 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
492 gdk_region_get_clipbox(child_event.region, &child_event.area);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
493 gtk_widget_send_expose(child, (GdkEvent *)&child_event);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
494 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
495 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
496 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
497
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
498 return FALSE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
499 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
500
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
501 /* Container method
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
502 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
503 static void
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
504 gtk_form_remove(GtkContainer *container, GtkWidget *widget)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
505 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
506 GList *tmp_list;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
507 GtkForm *form;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
508 GtkFormChild *child = NULL; /* init for gcc */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
509
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
510 g_return_if_fail(GTK_IS_FORM(container));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
511
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
512 form = GTK_FORM(container);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
513
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
514 tmp_list = form->children;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
515 while (tmp_list)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
516 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
517 child = tmp_list->data;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
518 if (child->widget == widget)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
519 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
520 tmp_list = tmp_list->next;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
521 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
522
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
523 if (tmp_list)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
524 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
525 if (child->window)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
526 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
527 gtk_signal_disconnect_by_func(GTK_OBJECT(child->widget),
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
528 GTK_SIGNAL_FUNC(&gtk_form_child_map), child);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
529 gtk_signal_disconnect_by_func(GTK_OBJECT(child->widget),
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
530 GTK_SIGNAL_FUNC(&gtk_form_child_unmap), child);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
531
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
532 /* FIXME: This will cause problems for reparenting NO_WINDOW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
533 * widgets out of a GtkForm
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
534 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
535 gdk_window_set_user_data(child->window, NULL);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
536 gdk_window_destroy(child->window);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
537 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
538 gtk_widget_unparent(widget);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
539
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
540 form->children = g_list_remove_link(form->children, tmp_list);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
541 g_list_free_1(tmp_list);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
542 g_free(child);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
543 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
544 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
545
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
546 static void
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
547 gtk_form_forall(GtkContainer *container,
1884
3dd986bfef63 updated for version 7.2-181
vimboss
parents: 1207
diff changeset
548 gboolean include_internals UNUSED,
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
549 GtkCallback callback,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
550 gpointer callback_data)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
551 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
552 GtkForm *form;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
553 GtkFormChild *child;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
554 GList *tmp_list;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
555
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
556 g_return_if_fail(GTK_IS_FORM(container));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
557 g_return_if_fail(callback != NULL);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
558
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
559 form = GTK_FORM(container);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
560
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
561 tmp_list = form->children;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
562 while (tmp_list)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
563 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
564 child = tmp_list->data;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
565 tmp_list = tmp_list->next;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
566
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
567 (*callback) (child->widget, callback_data);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
568 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
569 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
570
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
571 /* Operations on children
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
572 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
573
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
574 static void
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
575 gtk_form_attach_child_window(GtkForm *form, GtkFormChild *child)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
576 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
577 if (child->window != NULL)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
578 return; /* been there, done that */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
579
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
580 if (GTK_WIDGET_NO_WINDOW(child->widget))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
581 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
582 GtkWidget *widget;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
583 GdkWindowAttr attributes;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
584 gint attributes_mask;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
585
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
586 widget = GTK_WIDGET(form);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
587
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
588 attributes.window_type = GDK_WINDOW_CHILD;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
589 attributes.x = child->x;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
590 attributes.y = child->y;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
591 attributes.width = child->widget->requisition.width;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
592 attributes.height = child->widget->requisition.height;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
593 attributes.wclass = GDK_INPUT_OUTPUT;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
594 attributes.visual = gtk_widget_get_visual(widget);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
595 attributes.colormap = gtk_widget_get_colormap(widget);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
596 attributes.event_mask = GDK_EXPOSURE_MASK;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
597
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
598 attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
599 child->window = gdk_window_new(form->bin_window,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
600 &attributes, attributes_mask);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
601 gdk_window_set_user_data(child->window, widget);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
602
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
603 gtk_style_set_background(widget->style,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
604 child->window,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
605 GTK_STATE_NORMAL);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
606
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
607 gtk_widget_set_parent_window(child->widget, child->window);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
608 gtk_form_set_static_gravity(child->window, TRUE);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
609 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
610 * Install signal handlers to map/unmap child->window
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
611 * alongside with the actual widget.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
612 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
613 gtk_signal_connect(GTK_OBJECT(child->widget), "map",
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
614 GTK_SIGNAL_FUNC(&gtk_form_child_map), child);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
615 gtk_signal_connect(GTK_OBJECT(child->widget), "unmap",
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
616 GTK_SIGNAL_FUNC(&gtk_form_child_unmap), child);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
617 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
618 else if (!GTK_WIDGET_REALIZED(child->widget))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
619 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
620 gtk_widget_set_parent_window(child->widget, form->bin_window);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
621 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
622 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
623
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
624 static void
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
625 gtk_form_realize_child(GtkForm *form, GtkFormChild *child)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
626 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
627 gtk_form_attach_child_window(form, child);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
628 gtk_widget_realize(child->widget);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
629
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
630 if (child->window == NULL) /* might be already set, see above */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
631 gtk_form_set_static_gravity(child->widget->window, TRUE);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
632 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
633
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
634 static void
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
635 gtk_form_position_child(GtkForm *form, GtkFormChild *child,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
636 gboolean force_allocate)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
637 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
638 gint x;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
639 gint y;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
640
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
641 x = child->x;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
642 y = child->y;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
643
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
644 if ((x >= G_MINSHORT) && (x <= G_MAXSHORT) &&
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
645 (y >= G_MINSHORT) && (y <= G_MAXSHORT))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
646 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
647 if (!child->mapped)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
648 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
649 if (GTK_WIDGET_MAPPED(form) && GTK_WIDGET_VISIBLE(child->widget))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
650 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
651 if (!GTK_WIDGET_MAPPED(child->widget))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
652 gtk_widget_map(child->widget);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
653
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
654 child->mapped = TRUE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
655 force_allocate = TRUE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
656 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
657 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
658
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
659 if (force_allocate)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
660 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
661 GtkAllocation allocation;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
662
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
663 if (GTK_WIDGET_NO_WINDOW(child->widget))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
664 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
665 if (child->window)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
666 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
667 gdk_window_move_resize(child->window,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
668 x, y,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
669 child->widget->requisition.width,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
670 child->widget->requisition.height);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
671 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
672
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
673 allocation.x = 0;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
674 allocation.y = 0;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
675 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
676 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
677 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
678 allocation.x = x;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
679 allocation.y = y;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
680 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
681
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
682 allocation.width = child->widget->requisition.width;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
683 allocation.height = child->widget->requisition.height;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
684
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
685 gtk_widget_size_allocate(child->widget, &allocation);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
686 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
687 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
688 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
689 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
690 if (child->mapped)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
691 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
692 child->mapped = FALSE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
693
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
694 if (GTK_WIDGET_MAPPED(child->widget))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
695 gtk_widget_unmap(child->widget);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
696 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
697 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
698 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
699
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
700 static void
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
701 gtk_form_position_children(GtkForm *form)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
702 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
703 GList *tmp_list;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
704
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
705 for (tmp_list = form->children; tmp_list; tmp_list = tmp_list->next)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
706 gtk_form_position_child(form, tmp_list->data, FALSE);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
707 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
708
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
709 /* Callbacks */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
710
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
711 /* The main event filter. Actually, we probably don't really need
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
712 * to install this as a filter at all, since we are calling it
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
713 * directly above in the expose-handling hack.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
714 *
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
715 * This routine identifies expose events that are generated when
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
716 * we've temporarily moved the bin_window_origin, and translates
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
717 * them or discards them, depending on whether we are obscured
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
718 * or not.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
719 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
720 static GdkFilterReturn
1884
3dd986bfef63 updated for version 7.2-181
vimboss
parents: 1207
diff changeset
721 gtk_form_filter(GdkXEvent *gdk_xevent, GdkEvent *event UNUSED, gpointer data)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
722 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
723 XEvent *xevent;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
724 GtkForm *form;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
725
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
726 xevent = (XEvent *) gdk_xevent;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
727 form = GTK_FORM(data);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
728
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
729 switch (xevent->type)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
730 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
731 case Expose:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
732 if (xevent->xexpose.serial == form->configure_serial)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
733 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
734 if (form->visibility == GDK_VISIBILITY_UNOBSCURED)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
735 return GDK_FILTER_REMOVE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
736 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
737 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
738 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
739 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
740
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
741 case ConfigureNotify:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
742 if ((xevent->xconfigure.x != 0) || (xevent->xconfigure.y != 0))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
743 form->configure_serial = xevent->xconfigure.serial;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
744 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
745 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
746
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
747 return GDK_FILTER_CONTINUE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
748 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
749
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
750 /* Although GDK does have a GDK_VISIBILITY_NOTIFY event,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
751 * there is no corresponding event in GTK, so we have
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
752 * to get the events from a filter
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
753 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
754 static GdkFilterReturn
1884
3dd986bfef63 updated for version 7.2-181
vimboss
parents: 1207
diff changeset
755 gtk_form_main_filter(GdkXEvent *gdk_xevent,
3dd986bfef63 updated for version 7.2-181
vimboss
parents: 1207
diff changeset
756 GdkEvent *event UNUSED,
3dd986bfef63 updated for version 7.2-181
vimboss
parents: 1207
diff changeset
757 gpointer data)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
758 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
759 XEvent *xevent;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
760 GtkForm *form;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
761
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
762 xevent = (XEvent *) gdk_xevent;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
763 form = GTK_FORM(data);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
764
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
765 if (xevent->type == VisibilityNotify)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
766 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
767 switch (xevent->xvisibility.state)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
768 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
769 case VisibilityFullyObscured:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
770 form->visibility = GDK_VISIBILITY_FULLY_OBSCURED;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
771 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
772
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
773 case VisibilityPartiallyObscured:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
774 form->visibility = GDK_VISIBILITY_PARTIAL;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
775 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
776
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
777 case VisibilityUnobscured:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
778 form->visibility = GDK_VISIBILITY_UNOBSCURED;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
779 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
780 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
781
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
782 return GDK_FILTER_REMOVE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
783 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
784 return GDK_FILTER_CONTINUE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
785 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
786
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
787 static void
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
788 gtk_form_set_static_gravity(GdkWindow *window, gboolean use_static)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
789 {
1960
3c838658fc35 updated for version 7.2-257
vimboss
parents: 1885
diff changeset
790 /* We don't check if static gravity is actually supported, because it
3c838658fc35 updated for version 7.2-257
vimboss
parents: 1885
diff changeset
791 * results in an annoying assertion error message. */
3c838658fc35 updated for version 7.2-257
vimboss
parents: 1885
diff changeset
792 gdk_window_set_static_gravities(window, use_static);
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
793 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
794
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
795 void
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
796 gtk_form_move_resize(GtkForm *form, GtkWidget *widget,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
797 gint x, gint y, gint w, gint h)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
798 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
799 widget->requisition.width = w;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
800 widget->requisition.height = h;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
801
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
802 gtk_form_move(form, widget, x, y);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
803 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
804
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
805 static void
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
806 gtk_form_send_configure(GtkForm *form)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
807 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
808 GtkWidget *widget;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
809 GdkEventConfigure event;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
810
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
811 widget = GTK_WIDGET(form);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
812
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
813 event.type = GDK_CONFIGURE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
814 event.window = widget->window;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
815 event.x = widget->allocation.x;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
816 event.y = widget->allocation.y;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
817 event.width = widget->allocation.width;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
818 event.height = widget->allocation.height;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
819
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
820 gtk_main_do_event((GdkEvent*)&event);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
821 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
822
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
823 static void
1884
3dd986bfef63 updated for version 7.2-181
vimboss
parents: 1207
diff changeset
824 gtk_form_child_map(GtkWidget *widget UNUSED, gpointer user_data)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
825 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
826 GtkFormChild *child;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
827
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
828 child = (GtkFormChild *)user_data;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
829
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
830 child->mapped = TRUE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
831 gdk_window_show(child->window);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
832 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
833
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
834 static void
1884
3dd986bfef63 updated for version 7.2-181
vimboss
parents: 1207
diff changeset
835 gtk_form_child_unmap(GtkWidget *widget UNUSED, gpointer user_data)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
836 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
837 GtkFormChild *child;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
838
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
839 child = (GtkFormChild *)user_data;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
840
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
841 child->mapped = FALSE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
842 gdk_window_hide(child->window);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
843 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
844