annotate src/gui_gtk_f.c @ 11087:242e0617aa51 v8.0.0431

patch 8.0.0431: 'cinoptions' cannot set indent for extern block commit https://github.com/vim/vim/commit/7720ba8599162fbbb8f7fc034f674a2ccd3ca7f1 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Mar 8 22:19:26 2017 +0100 patch 8.0.0431: 'cinoptions' cannot set indent for extern block Problem: 'cinoptions' cannot set indent for extern block. Solution: Add the "E" flag in 'cinoptions'. (Hirohito Higashi)
author Christian Brabandt <cb@256bit.org>
date Wed, 08 Mar 2017 22:30:05 +0100
parents 51888fb2599f
children cd8dbed175a1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10042
4aead6a9b7a9 commit https://github.com/vim/vim/commit/edf3f97ae2af024708ebb4ac614227327033ca47
Christian Brabandt <cb@256bit.org>
parents: 8218
diff changeset
1 /* vi:set ts=8 sts=4 sw=4 noet:
7
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.
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
22 *
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
23 * Support for GTK+ 3 was added by:
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
24 *
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
25 * 2016 Kazunobu Kuriyama <kazunobu.kuriyama@gmail.com>
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 #include "vim.h"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 #include <gtk/gtk.h> /* without this it compiles, but gives errors at
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 runtime! */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 #include "gui_gtk_f.h"
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
32 #if !GTK_CHECK_VERSION(3,0,0)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
33 # include <gtk/gtksignal.h>
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
34 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 #ifdef WIN3264
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 # include <gdk/gdkwin32.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 #else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 # include <gdk/gdkx.h>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 typedef struct _GtkFormChild GtkFormChild;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 struct _GtkFormChild
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 GtkWidget *widget;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 GdkWindow *window;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 gint x; /* relative subwidget x position */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 gint y; /* relative subwidget y position */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 gint mapped;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 };
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 static void gtk_form_class_init(GtkFormClass *klass);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 static void gtk_form_init(GtkForm *form);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 static void gtk_form_realize(GtkWidget *widget);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 static void gtk_form_unrealize(GtkWidget *widget);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 static void gtk_form_map(GtkWidget *widget);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 static void gtk_form_size_request(GtkWidget *widget,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 GtkRequisition *requisition);
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
61 #if GTK_CHECK_VERSION(3,0,0)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
62 static void gtk_form_get_preferred_width(GtkWidget *widget,
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
63 gint *minimal_width,
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
64 gint *natural_width);
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
65 static void gtk_form_get_preferred_height(GtkWidget *widget,
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
66 gint *minimal_height,
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
67 gint *natural_height);
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
68 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 static void gtk_form_size_allocate(GtkWidget *widget,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 GtkAllocation *allocation);
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
71 #if GTK_CHECK_VERSION(3,0,0)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
72 static gboolean gtk_form_draw(GtkWidget *widget,
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
73 cairo_t *cr);
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
74 #else
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 static gint gtk_form_expose(GtkWidget *widget,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 GdkEventExpose *event);
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
77 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 static void gtk_form_remove(GtkContainer *container,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 GtkWidget *widget);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 static void gtk_form_forall(GtkContainer *container,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 gboolean include_internals,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 GtkCallback callback,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 gpointer callback_data);
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_attach_child_window(GtkForm *form,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 GtkFormChild *child);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 static void gtk_form_realize_child(GtkForm *form,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 GtkFormChild *child);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90 static void gtk_form_position_child(GtkForm *form,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91 GtkFormChild *child,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92 gboolean force_allocate);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93 static void gtk_form_position_children(GtkForm *form);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
95 #if !GTK_CHECK_VERSION(3,0,0)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96 static GdkFilterReturn gtk_form_filter(GdkXEvent *gdk_xevent,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97 GdkEvent *event,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98 gpointer data);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99 static GdkFilterReturn gtk_form_main_filter(GdkXEvent *gdk_xevent,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100 GdkEvent *event,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101 gpointer data);
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
102 #endif
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
103 #if !GTK_CHECK_VERSION(3,16,0)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104 static void gtk_form_set_static_gravity(GdkWindow *window,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105 gboolean use_static);
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
106 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108 static void gtk_form_send_configure(GtkForm *form);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
109
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
110 static void gtk_form_child_map(GtkWidget *widget, gpointer user_data);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
111 static void gtk_form_child_unmap(GtkWidget *widget, gpointer user_data);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
112
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
113 #if !GTK_CHECK_VERSION(3,0,0)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
114 static GtkWidgetClass *parent_class = NULL;
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
115 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
116
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
117 /* Public interface
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
118 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
119
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
120 GtkWidget *
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
121 gtk_form_new(void)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
122 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
123 GtkForm *form;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
124
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
125 #if GTK_CHECK_VERSION(3,0,0)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
126 form = g_object_new(GTK_TYPE_FORM, NULL);
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
127 #else
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
128 form = gtk_type_new(gtk_form_get_type());
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
129 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
130
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
131 return GTK_WIDGET(form);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
132 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
133
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
134 void
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
135 gtk_form_put(GtkForm *form,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
136 GtkWidget *child_widget,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
137 gint x,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
138 gint y)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
139 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
140 GtkFormChild *child;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
141
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
142 g_return_if_fail(GTK_IS_FORM(form));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
143
129
2983cde45542 updated for version 7.0044
vimboss
parents: 66
diff changeset
144 /* LINTED: avoid warning: conversion to 'unsigned long' */
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
145 child = g_new(GtkFormChild, 1);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
146
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
147 child->widget = child_widget;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
148 child->window = NULL;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
149 child->x = x;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
150 child->y = y;
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
151 #if GTK_CHECK_VERSION(3,0,0)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
152 gtk_widget_set_size_request(child->widget, -1, -1);
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
153 #else
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
154 child->widget->requisition.width = 0;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
155 child->widget->requisition.height = 0;
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
156 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
157 child->mapped = FALSE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
158
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
159 form->children = g_list_append(form->children, child);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
160
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
161 /* child->window must be created and attached to the widget _before_
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
162 * it has been realized, or else things will break with GTK2. Note
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
163 * that gtk_widget_set_parent() realizes the widget if it's visible
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
164 * and its parent is mapped.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
165 */
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
166 #if GTK_CHECK_VERSION(3,0,0)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
167 if (gtk_widget_get_realized(GTK_WIDGET(form)))
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
168 #else
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
169 if (GTK_WIDGET_REALIZED(form))
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
170 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
171 gtk_form_attach_child_window(form, child);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
172
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
173 gtk_widget_set_parent(child_widget, GTK_WIDGET(form));
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
174 #if !GTK_CHECK_VERSION(3,0,0)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
175 gtk_widget_size_request(child->widget, NULL);
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
176 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
177
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
178 #if GTK_CHECK_VERSION(3,0,0)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
179 if (gtk_widget_get_realized(GTK_WIDGET(form))
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
180 && !gtk_widget_get_realized(child_widget))
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
181 #else
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
182 if (GTK_WIDGET_REALIZED(form) && !GTK_WIDGET_REALIZED(child_widget))
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
183 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
184 gtk_form_realize_child(form, child);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
185
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
186 gtk_form_position_child(form, child, TRUE);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
187 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
188
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
189 void
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
190 gtk_form_move(GtkForm *form,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
191 GtkWidget *child_widget,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
192 gint x,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
193 gint y)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
194 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
195 GList *tmp_list;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
196 GtkFormChild *child;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
197
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
198 g_return_if_fail(GTK_IS_FORM(form));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
199
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
200 for (tmp_list = form->children; tmp_list; tmp_list = tmp_list->next)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
201 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
202 child = tmp_list->data;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
203 if (child->widget == child_widget)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
204 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
205 child->x = x;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
206 child->y = y;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
207
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
208 gtk_form_position_child(form, child, TRUE);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
209 return;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
210 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
211 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
212 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
213
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
214 void
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
215 gtk_form_freeze(GtkForm *form)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
216 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
217 g_return_if_fail(GTK_IS_FORM(form));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
218
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
219 ++form->freeze_count;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
220 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
221
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
222 void
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
223 gtk_form_thaw(GtkForm *form)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
224 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
225 g_return_if_fail(GTK_IS_FORM(form));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
226
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
227 if (form->freeze_count)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
228 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
229 if (!(--form->freeze_count))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
230 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
231 gtk_form_position_children(form);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
232 gtk_widget_queue_draw(GTK_WIDGET(form));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
233 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
234 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
235 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
236
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
237 /* Basic Object handling procedures
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
238 */
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
239 #if GTK_CHECK_VERSION(3,0,0)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
240 G_DEFINE_TYPE(GtkForm, gtk_form, GTK_TYPE_CONTAINER)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
241 #else
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
242 GtkType
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
243 gtk_form_get_type(void)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
244 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
245 static GtkType form_type = 0;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
246
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
247 if (!form_type)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
248 {
1884
3dd986bfef63 updated for version 7.2-181
vimboss
parents: 1207
diff changeset
249 GtkTypeInfo form_info;
3dd986bfef63 updated for version 7.2-181
vimboss
parents: 1207
diff changeset
250
1885
605f5c2f77ba updated for version 7.2-182
vimboss
parents: 1884
diff changeset
251 vim_memset(&form_info, 0, sizeof(form_info));
1884
3dd986bfef63 updated for version 7.2-181
vimboss
parents: 1207
diff changeset
252 form_info.type_name = "GtkForm";
3dd986bfef63 updated for version 7.2-181
vimboss
parents: 1207
diff changeset
253 form_info.object_size = sizeof(GtkForm);
3dd986bfef63 updated for version 7.2-181
vimboss
parents: 1207
diff changeset
254 form_info.class_size = sizeof(GtkFormClass);
3dd986bfef63 updated for version 7.2-181
vimboss
parents: 1207
diff changeset
255 form_info.class_init_func = (GtkClassInitFunc)gtk_form_class_init;
3dd986bfef63 updated for version 7.2-181
vimboss
parents: 1207
diff changeset
256 form_info.object_init_func = (GtkObjectInitFunc)gtk_form_init;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
257
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
258 form_type = gtk_type_unique(GTK_TYPE_CONTAINER, &form_info);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
259 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
260 return form_type;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
261 }
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
262 #endif /* !GTK_CHECK_VERSION(3,0,0) */
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
263
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
264 static void
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
265 gtk_form_class_init(GtkFormClass *klass)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
266 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
267 GtkWidgetClass *widget_class;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
268 GtkContainerClass *container_class;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
269
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
270 widget_class = (GtkWidgetClass *) klass;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
271 container_class = (GtkContainerClass *) klass;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
272
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
273 #if !GTK_CHECK_VERSION(3,0,0)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
274 parent_class = gtk_type_class(gtk_container_get_type());
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
275 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
276
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
277 widget_class->realize = gtk_form_realize;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
278 widget_class->unrealize = gtk_form_unrealize;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
279 widget_class->map = gtk_form_map;
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
280 #if GTK_CHECK_VERSION(3,0,0)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
281 widget_class->get_preferred_width = gtk_form_get_preferred_width;
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
282 widget_class->get_preferred_height = gtk_form_get_preferred_height;
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
283 #else
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
284 widget_class->size_request = gtk_form_size_request;
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
285 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
286 widget_class->size_allocate = gtk_form_size_allocate;
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
287 #if GTK_CHECK_VERSION(3,0,0)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
288 widget_class->draw = gtk_form_draw;
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
289 #else
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
290 widget_class->expose_event = gtk_form_expose;
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
291 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
292
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
293 container_class->remove = gtk_form_remove;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
294 container_class->forall = gtk_form_forall;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
295 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
296
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
297 static void
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
298 gtk_form_init(GtkForm *form)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
299 {
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
300 #if GTK_CHECK_VERSION(3,0,0)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
301 gtk_widget_set_has_window(GTK_WIDGET(form), TRUE);
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
302 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
303 form->children = NULL;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
304
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
305 #if !GTK_CHECK_VERSION(3,0,0)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
306 form->width = 1;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
307 form->height = 1;
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
308 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
309
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
310 form->bin_window = NULL;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
311
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
312 #if !GTK_CHECK_VERSION(3,0,0)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
313 form->configure_serial = 0;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
314 form->visibility = GDK_VISIBILITY_PARTIAL;
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
315 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
316
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
317 form->freeze_count = 0;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
318 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
319
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
320 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
321 * Widget methods
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
322 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
323
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
324 static void
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
325 gtk_form_realize(GtkWidget *widget)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
326 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
327 GList *tmp_list;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
328 GtkForm *form;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
329 GdkWindowAttr attributes;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
330 gint attributes_mask;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
331
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
332 g_return_if_fail(GTK_IS_FORM(widget));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
333
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
334 form = GTK_FORM(widget);
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
335 #if GTK_CHECK_VERSION(3,0,0)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
336 gtk_widget_set_realized(widget, TRUE);
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
337 #else
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
338 GTK_WIDGET_SET_FLAGS(form, GTK_REALIZED);
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
339 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
340
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
341 attributes.window_type = GDK_WINDOW_CHILD;
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
342 #if GTK_CHECK_VERSION(3,0,0)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
343 {
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
344 GtkAllocation allocation;
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
345 gtk_widget_get_allocation(widget, &allocation);
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
346 attributes.x = allocation.x;
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
347 attributes.y = allocation.y;
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
348 attributes.width = allocation.width;
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
349 attributes.height = allocation.height;
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
350 }
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
351 #else
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
352 attributes.x = widget->allocation.x;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
353 attributes.y = widget->allocation.y;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
354 attributes.width = widget->allocation.width;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
355 attributes.height = widget->allocation.height;
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
356 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
357 attributes.wclass = GDK_INPUT_OUTPUT;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
358 attributes.visual = gtk_widget_get_visual(widget);
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
359 #if GTK_CHECK_VERSION(3,0,0)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
360 attributes.event_mask = GDK_EXPOSURE_MASK;
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
361 #else
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
362 attributes.colormap = gtk_widget_get_colormap(widget);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
363 attributes.event_mask = GDK_VISIBILITY_NOTIFY_MASK;
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
364 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
365
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
366 #if GTK_CHECK_VERSION(3,0,0)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
367 attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
368 #else
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
369 attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
370 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
371
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
372 #if GTK_CHECK_VERSION(3,0,0)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
373 gtk_widget_set_window(widget,
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
374 gdk_window_new(gtk_widget_get_parent_window(widget),
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
375 &attributes, attributes_mask));
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
376 gdk_window_set_user_data(gtk_widget_get_window(widget), widget);
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
377 #else
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
378 widget->window = gdk_window_new(gtk_widget_get_parent_window(widget),
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
379 &attributes, attributes_mask);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
380 gdk_window_set_user_data(widget->window, widget);
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
381 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
382
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
383 attributes.x = 0;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
384 attributes.y = 0;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
385 attributes.event_mask = gtk_widget_get_events(widget);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
386
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
387 #if GTK_CHECK_VERSION(3,0,0)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
388 form->bin_window = gdk_window_new(gtk_widget_get_window(widget),
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
389 &attributes, attributes_mask);
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
390 #else
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
391 form->bin_window = gdk_window_new(widget->window,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
392 &attributes, attributes_mask);
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
393 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
394 gdk_window_set_user_data(form->bin_window, widget);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
395
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
396 #if !GTK_CHECK_VERSION(3,16,0)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
397 gtk_form_set_static_gravity(form->bin_window, TRUE);
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
398 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
399
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
400 #if GTK_CHECK_VERSION(3,0,0)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
401 {
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
402 GtkStyleContext * const sctx = gtk_widget_get_style_context(widget);
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
403
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
404 gtk_style_context_add_class(sctx, "gtk-form");
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
405 gtk_style_context_set_state(sctx, GTK_STATE_FLAG_NORMAL);
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
406 # if !GTK_CHECK_VERSION(3,18,0)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
407 gtk_style_context_set_background(sctx, gtk_widget_get_window(widget));
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
408 gtk_style_context_set_background(sctx, form->bin_window);
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
409 # endif
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
410 }
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
411 #else
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
412 widget->style = gtk_style_attach(widget->style, widget->window);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
413 gtk_style_set_background(widget->style, widget->window, GTK_STATE_NORMAL);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
414 gtk_style_set_background(widget->style, form->bin_window, GTK_STATE_NORMAL);
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
415 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
416
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
417 #if !GTK_CHECK_VERSION(3,0,0)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
418 gdk_window_add_filter(widget->window, gtk_form_main_filter, form);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
419 gdk_window_add_filter(form->bin_window, gtk_form_filter, form);
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
420 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
421
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
422 for (tmp_list = form->children; tmp_list; tmp_list = tmp_list->next)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
423 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
424 GtkFormChild *child = tmp_list->data;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
425
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
426 gtk_form_attach_child_window(form, child);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
427
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
428 #if GTK_CHECK_VERSION(3,0,0)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
429 if (gtk_widget_get_visible(child->widget))
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
430 #else
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
431 if (GTK_WIDGET_VISIBLE(child->widget))
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
432 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
433 gtk_form_realize_child(form, child);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
434 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
435 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
436
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
437
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
438 /* After reading the documentation at
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
439 * http://developer.gnome.org/doc/API/2.0/gtk/gtk-changes-2-0.html
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
440 * I think it should be possible to remove this function when compiling
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
441 * against gtk-2.0. It doesn't seem to cause problems, though.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
442 *
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
443 * Well, I reckon at least the gdk_window_show(form->bin_window)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
444 * is necessary. GtkForm is anything but a usual container widget.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
445 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
446 static void
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
447 gtk_form_map(GtkWidget *widget)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
448 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
449 GList *tmp_list;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
450 GtkForm *form;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
451
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
452 g_return_if_fail(GTK_IS_FORM(widget));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
453
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
454 form = GTK_FORM(widget);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
455
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
456 #if GTK_CHECK_VERSION(3,0,0)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
457 gtk_widget_set_mapped(widget, TRUE);
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
458 #else
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
459 GTK_WIDGET_SET_FLAGS(widget, GTK_MAPPED);
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
460 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
461
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
462 #if GTK_CHECK_VERSION(3,0,0)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
463 gdk_window_show(gtk_widget_get_window(widget));
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
464 #else
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
465 gdk_window_show(widget->window);
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
466 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
467 gdk_window_show(form->bin_window);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
468
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
469 for (tmp_list = form->children; tmp_list; tmp_list = tmp_list->next)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
470 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
471 GtkFormChild *child = tmp_list->data;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
472
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
473 #if GTK_CHECK_VERSION(3,0,0)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
474 if (gtk_widget_get_visible(child->widget)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
475 && !gtk_widget_get_mapped(child->widget))
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
476 #else
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
477 if (GTK_WIDGET_VISIBLE(child->widget)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
478 && !GTK_WIDGET_MAPPED(child->widget))
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
479 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
480 gtk_widget_map(child->widget);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
481 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
482 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
483
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
484 static void
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
485 gtk_form_unrealize(GtkWidget *widget)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
486 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
487 GList *tmp_list;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
488 GtkForm *form;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
489
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
490 g_return_if_fail(GTK_IS_FORM(widget));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
491
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
492 form = GTK_FORM(widget);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
493
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
494 tmp_list = form->children;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
495
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
496 gdk_window_set_user_data(form->bin_window, NULL);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
497 gdk_window_destroy(form->bin_window);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
498 form->bin_window = NULL;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
499
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
500 while (tmp_list)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
501 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
502 GtkFormChild *child = tmp_list->data;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
503
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
504 if (child->window != NULL)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
505 {
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
506 #if GTK_CHECK_VERSION(3,0,0)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
507 g_signal_handlers_disconnect_by_func(G_OBJECT(child->widget),
10176
51888fb2599f commit https://github.com/vim/vim/commit/d47d83745ff450232328ca7a4b8b00b31bad22fc
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
508 FUNC2GENERIC(gtk_form_child_map),
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
509 child);
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
510 g_signal_handlers_disconnect_by_func(G_OBJECT(child->widget),
10176
51888fb2599f commit https://github.com/vim/vim/commit/d47d83745ff450232328ca7a4b8b00b31bad22fc
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
511 FUNC2GENERIC(gtk_form_child_unmap),
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
512 child);
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
513 #else
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
514 gtk_signal_disconnect_by_func(GTK_OBJECT(child->widget),
10176
51888fb2599f commit https://github.com/vim/vim/commit/d47d83745ff450232328ca7a4b8b00b31bad22fc
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
515 GTK_SIGNAL_FUNC(gtk_form_child_map),
51888fb2599f commit https://github.com/vim/vim/commit/d47d83745ff450232328ca7a4b8b00b31bad22fc
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
516 child);
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
517 gtk_signal_disconnect_by_func(GTK_OBJECT(child->widget),
10176
51888fb2599f commit https://github.com/vim/vim/commit/d47d83745ff450232328ca7a4b8b00b31bad22fc
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
518 GTK_SIGNAL_FUNC(gtk_form_child_unmap),
51888fb2599f commit https://github.com/vim/vim/commit/d47d83745ff450232328ca7a4b8b00b31bad22fc
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
519 child);
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
520 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
521
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
522 gdk_window_set_user_data(child->window, NULL);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
523 gdk_window_destroy(child->window);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
524
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
525 child->window = NULL;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
526 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
527
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
528 tmp_list = tmp_list->next;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
529 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
530
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
531 #if GTK_CHECK_VERSION(3,0,0)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
532 if (GTK_WIDGET_CLASS (gtk_form_parent_class)->unrealize)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
533 (* GTK_WIDGET_CLASS (gtk_form_parent_class)->unrealize) (widget);
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
534 #else
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
535 if (GTK_WIDGET_CLASS (parent_class)->unrealize)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
536 (* GTK_WIDGET_CLASS (parent_class)->unrealize) (widget);
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
537 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
538 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
539
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
540 static void
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
541 gtk_form_size_request(GtkWidget *widget, GtkRequisition *requisition)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
542 {
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
543 #if !GTK_CHECK_VERSION(3,0,0)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
544 GList *tmp_list;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
545 GtkForm *form;
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
546 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
547
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
548 g_return_if_fail(GTK_IS_FORM(widget));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
549
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
550 #if !GTK_CHECK_VERSION(3,0,0)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
551 form = GTK_FORM(widget);
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
552 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
553
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
554 #if GTK_CHECK_VERSION(3,0,0)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
555 requisition->width = 1;
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
556 requisition->height = 1;
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
557 #else
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
558 requisition->width = form->width;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
559 requisition->height = form->height;
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
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
563 while (tmp_list)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
564 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
565 GtkFormChild *child = tmp_list->data;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
566 gtk_widget_size_request(child->widget, NULL);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
567 tmp_list = tmp_list->next;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
568 }
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
569 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
570 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
571
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
572 #if GTK_CHECK_VERSION(3,0,0)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
573 static void
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
574 gtk_form_get_preferred_width(GtkWidget *widget,
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
575 gint *minimal_width,
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
576 gint *natural_width)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
577 {
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
578 GtkRequisition requisition;
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
579
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
580 gtk_form_size_request(widget, &requisition);
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
581
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
582 *minimal_width = requisition.width;
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
583 *natural_width = requisition.width;
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
584 }
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
585
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
586 static void
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
587 gtk_form_get_preferred_height(GtkWidget *widget,
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
588 gint *minimal_height,
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
589 gint *natural_height)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
590 {
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
591 GtkRequisition requisition;
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
592
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
593 gtk_form_size_request(widget, &requisition);
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
594
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
595 *minimal_height = requisition.height;
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
596 *natural_height = requisition.height;
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
597 }
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
598 #endif /* GTK_CHECK_VERSION(3,0,0) */
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
599
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
600 static void
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
601 gtk_form_size_allocate(GtkWidget *widget, GtkAllocation *allocation)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
602 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
603 GList *tmp_list;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
604 GtkForm *form;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
605 gboolean need_reposition;
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
606 #if GTK_CHECK_VERSION(3,0,0)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
607 GtkAllocation cur_alloc;
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
608 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
609
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
610 g_return_if_fail(GTK_IS_FORM(widget));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
611
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
612 #if GTK_CHECK_VERSION(3,0,0)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
613 gtk_widget_get_allocation(widget, &cur_alloc);
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
614
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
615 if (cur_alloc.x == allocation->x
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
616 && cur_alloc.y == allocation->y
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
617 && cur_alloc.width == allocation->width
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
618 && cur_alloc.height == allocation->height)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
619 #else
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
620 if (widget->allocation.x == allocation->x
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
621 && widget->allocation.y == allocation->y
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
622 && widget->allocation.width == allocation->width
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
623 && widget->allocation.height == allocation->height)
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
624 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
625 return;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
626
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
627 #if GTK_CHECK_VERSION(3,0,0)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
628 need_reposition = cur_alloc.width != allocation->width
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
629 || cur_alloc.height != allocation->height;
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
630 #else
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
631 need_reposition = widget->allocation.width != allocation->width
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
632 || widget->allocation.height != allocation->height;
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
633 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
634 form = GTK_FORM(widget);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
635
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
636 if (need_reposition)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
637 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
638 tmp_list = form->children;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
639
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
640 while (tmp_list)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
641 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
642 GtkFormChild *child = tmp_list->data;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
643 gtk_form_position_child(form, child, TRUE);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
644
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
645 tmp_list = tmp_list->next;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
646 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
647 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
648
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
649 #if GTK_CHECK_VERSION(3,0,0)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
650 if (gtk_widget_get_realized(widget))
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
651 #else
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
652 if (GTK_WIDGET_REALIZED(widget))
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
653 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
654 {
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
655 #if GTK_CHECK_VERSION(3,0,0)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
656 gdk_window_move_resize(gtk_widget_get_window(widget),
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
657 allocation->x, allocation->y,
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
658 allocation->width, allocation->height);
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
659 #else
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
660 gdk_window_move_resize(widget->window,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
661 allocation->x, allocation->y,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
662 allocation->width, allocation->height);
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
663 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
664 gdk_window_move_resize(GTK_FORM(widget)->bin_window,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
665 0, 0,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
666 allocation->width, allocation->height);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
667 }
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
668 #if GTK_CHECK_VERSION(3,0,0)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
669 gtk_widget_set_allocation(widget, allocation);
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
670 #else
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
671 widget->allocation = *allocation;
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
672 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
673 if (need_reposition)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
674 gtk_form_send_configure(form);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
675 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
676
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
677 #if GTK_CHECK_VERSION(3,0,0)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
678 static void
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
679 gtk_form_render_background(GtkWidget *widget, cairo_t *cr)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
680 {
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
681 gtk_render_background(gtk_widget_get_style_context(widget), cr,
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
682 0, 0,
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
683 gtk_widget_get_allocated_width(widget),
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
684 gtk_widget_get_allocated_height(widget));
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
685 }
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
686
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
687 static gboolean
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
688 gtk_form_draw(GtkWidget *widget, cairo_t *cr)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
689 {
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
690 GList *tmp_list = NULL;
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
691 GtkForm *form = NULL;
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
692
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
693 g_return_val_if_fail(GTK_IS_FORM(widget), FALSE);
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
694
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
695 gtk_form_render_background(widget, cr);
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
696
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
697 form = GTK_FORM(widget);
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
698 for (tmp_list = form->children; tmp_list; tmp_list = tmp_list->next)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
699 {
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
700 GtkFormChild * const formchild = tmp_list->data;
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
701
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
702 if (!gtk_widget_get_has_window(formchild->widget) &&
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
703 gtk_cairo_should_draw_window(cr, formchild->window))
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
704 {
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
705 /* To get gtk_widget_draw() to work, it is required to call
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
706 * gtk_widget_size_allocate() in advance with a well-posed
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
707 * allocation for a given child widget in order to set a
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
708 * certain private GtkWidget variable, called
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
709 * widget->priv->alloc_need, to the proper value; othewise,
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
710 * gtk_widget_draw() fails and the relevant scrollbar won't
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
711 * appear on the screen.
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
712 *
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
713 * Calling gtk_form_position_child() like this is one of ways
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
714 * to make sure of that. */
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
715 gtk_form_position_child(form, formchild, TRUE);
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
716
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
717 gtk_form_render_background(formchild->widget, cr);
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
718 }
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
719 }
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
720
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
721 return GTK_WIDGET_CLASS(gtk_form_parent_class)->draw(widget, cr);
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
722 }
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
723 #else /* !GTK_CHECK_VERSION(3,0,0) */
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
724 static gint
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
725 gtk_form_expose(GtkWidget *widget, GdkEventExpose *event)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
726 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
727 GList *tmp_list;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
728 GtkForm *form;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
729
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
730 g_return_val_if_fail(GTK_IS_FORM(widget), FALSE);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
731
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
732 form = GTK_FORM(widget);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
733
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
734 if (event->window == form->bin_window)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
735 return FALSE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
736
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
737 for (tmp_list = form->children; tmp_list; tmp_list = tmp_list->next)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
738 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
739 GtkFormChild *formchild = tmp_list->data;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
740 GtkWidget *child = formchild->widget;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
741 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
742 * The following chunk of code is taken from gtkcontainer.c. The
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
743 * gtk1.x code synthesized expose events directly on the child widgets,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
744 * which can't be done in gtk2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
745 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
746 if (GTK_WIDGET_DRAWABLE(child) && GTK_WIDGET_NO_WINDOW(child)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
747 && child->window == event->window)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
748 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
749 GdkEventExpose child_event;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
750 child_event = *event;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
751
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
752 child_event.region = gtk_widget_region_intersect(child, event->region);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
753 if (!gdk_region_empty(child_event.region))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
754 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
755 gdk_region_get_clipbox(child_event.region, &child_event.area);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
756 gtk_widget_send_expose(child, (GdkEvent *)&child_event);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
757 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
758 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
759 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
760
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
761 return FALSE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
762 }
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
763 #endif /* !GTK_CHECK_VERSION(3,0,0) */
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
764
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
765 /* Container method
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
766 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
767 static void
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
768 gtk_form_remove(GtkContainer *container, GtkWidget *widget)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
769 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
770 GList *tmp_list;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
771 GtkForm *form;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
772 GtkFormChild *child = NULL; /* init for gcc */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
773
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
774 g_return_if_fail(GTK_IS_FORM(container));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
775
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
776 form = GTK_FORM(container);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
777
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
778 tmp_list = form->children;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
779 while (tmp_list)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
780 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
781 child = tmp_list->data;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
782 if (child->widget == widget)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
783 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
784 tmp_list = tmp_list->next;
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 if (tmp_list)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
788 {
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
789 #if GTK_CHECK_VERSION(3,0,0)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
790 const gboolean was_visible = gtk_widget_get_visible(widget);
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
791 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
792 if (child->window)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
793 {
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
794 #if GTK_CHECK_VERSION(3,0,0)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
795 g_signal_handlers_disconnect_by_func(G_OBJECT(child->widget),
10176
51888fb2599f commit https://github.com/vim/vim/commit/d47d83745ff450232328ca7a4b8b00b31bad22fc
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
796 FUNC2GENERIC(&gtk_form_child_map), child);
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
797 g_signal_handlers_disconnect_by_func(G_OBJECT(child->widget),
10176
51888fb2599f commit https://github.com/vim/vim/commit/d47d83745ff450232328ca7a4b8b00b31bad22fc
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
798 FUNC2GENERIC(&gtk_form_child_unmap), child);
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
799 #else
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
800 gtk_signal_disconnect_by_func(GTK_OBJECT(child->widget),
10176
51888fb2599f commit https://github.com/vim/vim/commit/d47d83745ff450232328ca7a4b8b00b31bad22fc
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
801 GTK_SIGNAL_FUNC(&gtk_form_child_map), child);
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
802 gtk_signal_disconnect_by_func(GTK_OBJECT(child->widget),
10176
51888fb2599f commit https://github.com/vim/vim/commit/d47d83745ff450232328ca7a4b8b00b31bad22fc
Christian Brabandt <cb@256bit.org>
parents: 10042
diff changeset
803 GTK_SIGNAL_FUNC(&gtk_form_child_unmap), child);
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
804 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
805
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
806 /* FIXME: This will cause problems for reparenting NO_WINDOW
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
807 * widgets out of a GtkForm
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
808 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
809 gdk_window_set_user_data(child->window, NULL);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
810 gdk_window_destroy(child->window);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
811 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
812 gtk_widget_unparent(widget);
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
813 #if GTK_CHECK_VERSION(3,0,0)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
814 if (was_visible)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
815 gtk_widget_queue_resize(GTK_WIDGET(container));
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
816 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
817 form->children = g_list_remove_link(form->children, tmp_list);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
818 g_list_free_1(tmp_list);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
819 g_free(child);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
820 }
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
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
824 gtk_form_forall(GtkContainer *container,
1884
3dd986bfef63 updated for version 7.2-181
vimboss
parents: 1207
diff changeset
825 gboolean include_internals UNUSED,
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
826 GtkCallback callback,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
827 gpointer callback_data)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
828 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
829 GtkForm *form;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
830 GtkFormChild *child;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
831 GList *tmp_list;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
832
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
833 g_return_if_fail(GTK_IS_FORM(container));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
834 g_return_if_fail(callback != NULL);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
835
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
836 form = GTK_FORM(container);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
837
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
838 tmp_list = form->children;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
839 while (tmp_list)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
840 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
841 child = tmp_list->data;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
842 tmp_list = tmp_list->next;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
843
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
844 (*callback) (child->widget, callback_data);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
845 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
846 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
847
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
848 /* Operations on children
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
849 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
850
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
851 static void
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
852 gtk_form_attach_child_window(GtkForm *form, GtkFormChild *child)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
853 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
854 if (child->window != NULL)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
855 return; /* been there, done that */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
856
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
857 #if GTK_CHECK_VERSION(3,0,0)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
858 if (!gtk_widget_get_has_window(child->widget))
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
859 #else
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
860 if (GTK_WIDGET_NO_WINDOW(child->widget))
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
861 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
862 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
863 GtkWidget *widget;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
864 GdkWindowAttr attributes;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
865 gint attributes_mask;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
866
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
867 widget = GTK_WIDGET(form);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
868
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
869 attributes.window_type = GDK_WINDOW_CHILD;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
870 attributes.x = child->x;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
871 attributes.y = child->y;
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
872 #if GTK_CHECK_VERSION(3,0,0)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
873 {
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
874 GtkRequisition requisition;
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
875
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
876 gtk_widget_get_preferred_size(child->widget, &requisition, NULL);
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
877
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
878 attributes.width = requisition.width;
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
879 attributes.height = requisition.height;
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
880 }
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
881 #else
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
882 attributes.width = child->widget->requisition.width;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
883 attributes.height = child->widget->requisition.height;
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
884 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
885 attributes.wclass = GDK_INPUT_OUTPUT;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
886 attributes.visual = gtk_widget_get_visual(widget);
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
887 #if !GTK_CHECK_VERSION(3,0,0)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
888 attributes.colormap = gtk_widget_get_colormap(widget);
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
889 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
890 attributes.event_mask = GDK_EXPOSURE_MASK;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
891
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
892 #if GTK_CHECK_VERSION(3,0,0)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
893 attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
894 #else
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
895 attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
896 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
897 child->window = gdk_window_new(form->bin_window,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
898 &attributes, attributes_mask);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
899 gdk_window_set_user_data(child->window, widget);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
900
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
901 #if GTK_CHECK_VERSION(3,0,0)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
902 {
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
903 GtkStyleContext * const sctx = gtk_widget_get_style_context(widget);
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
904
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
905 gtk_style_context_set_state(sctx, GTK_STATE_FLAG_NORMAL);
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
906 # if !GTK_CHECK_VERSION(3,18,0)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
907 gtk_style_context_set_background(sctx, child->window);
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
908 # endif
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
909 }
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
910 #else
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
911 gtk_style_set_background(widget->style,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
912 child->window,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
913 GTK_STATE_NORMAL);
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
914 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
915
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
916 gtk_widget_set_parent_window(child->widget, child->window);
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
917 #if !GTK_CHECK_VERSION(3,16,0)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
918 gtk_form_set_static_gravity(child->window, TRUE);
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
919 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
920 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
921 * Install signal handlers to map/unmap child->window
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
922 * alongside with the actual widget.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
923 */
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
924 #if GTK_CHECK_VERSION(3,0,0)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
925 g_signal_connect(G_OBJECT(child->widget), "map",
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
926 G_CALLBACK(&gtk_form_child_map), child);
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
927 g_signal_connect(G_OBJECT(child->widget), "unmap",
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
928 G_CALLBACK(&gtk_form_child_unmap), child);
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
929 #else
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
930 gtk_signal_connect(GTK_OBJECT(child->widget), "map",
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
931 GTK_SIGNAL_FUNC(&gtk_form_child_map), child);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
932 gtk_signal_connect(GTK_OBJECT(child->widget), "unmap",
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
933 GTK_SIGNAL_FUNC(&gtk_form_child_unmap), child);
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
934 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
935 }
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
936 #if GTK_CHECK_VERSION(3,0,0)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
937 else if (!gtk_widget_get_realized(child->widget))
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
938 #else
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
939 else if (!GTK_WIDGET_REALIZED(child->widget))
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
940 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
941 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
942 gtk_widget_set_parent_window(child->widget, form->bin_window);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
943 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
944 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
945
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
946 static void
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
947 gtk_form_realize_child(GtkForm *form, GtkFormChild *child)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
948 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
949 gtk_form_attach_child_window(form, child);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
950 gtk_widget_realize(child->widget);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
951
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
952 #if !GTK_CHECK_VERSION(3,16,0)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
953 if (child->window == NULL) /* might be already set, see above */
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
954 # if GTK_CHECK_VERSION(3,0,0)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
955 gtk_form_set_static_gravity(gtk_widget_get_window(child->widget), TRUE);
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
956 # else
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
957 gtk_form_set_static_gravity(child->widget->window, TRUE);
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
958 # endif
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
959 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
960 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
961
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
962 static void
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
963 gtk_form_position_child(GtkForm *form, GtkFormChild *child,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
964 gboolean force_allocate)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
965 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
966 gint x;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
967 gint y;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
968
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
969 x = child->x;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
970 y = child->y;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
971
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
972 if ((x >= G_MINSHORT) && (x <= G_MAXSHORT) &&
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
973 (y >= G_MINSHORT) && (y <= G_MAXSHORT))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
974 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
975 if (!child->mapped)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
976 {
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
977 #if GTK_CHECK_VERSION(3,0,0)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
978 if (gtk_widget_get_mapped(GTK_WIDGET(form))
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
979 && gtk_widget_get_visible(child->widget))
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
980 #else
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
981 if (GTK_WIDGET_MAPPED(form) && GTK_WIDGET_VISIBLE(child->widget))
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
982 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
983 {
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
984 #if GTK_CHECK_VERSION(3,0,0)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
985 if (!gtk_widget_get_mapped(child->widget))
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
986 #else
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
987 if (!GTK_WIDGET_MAPPED(child->widget))
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
988 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
989 gtk_widget_map(child->widget);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
990
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
991 child->mapped = TRUE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
992 force_allocate = TRUE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
993 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
994 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
995
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
996 if (force_allocate)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
997 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
998 GtkAllocation allocation;
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
999 #if GTK_CHECK_VERSION(3,0,0)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
1000 GtkRequisition requisition;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1001
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
1002 gtk_widget_get_preferred_size(child->widget, &requisition, NULL);
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
1003 #endif
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
1004
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
1005 #if GTK_CHECK_VERSION(3,0,0)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
1006 if (!gtk_widget_get_has_window(child->widget))
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
1007 #else
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1008 if (GTK_WIDGET_NO_WINDOW(child->widget))
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
1009 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1010 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1011 if (child->window)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1012 {
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
1013 #if GTK_CHECK_VERSION(3,0,0)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
1014 gdk_window_move_resize(child->window,
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
1015 x, y,
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
1016 requisition.width,
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
1017 requisition.height);
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
1018 #else
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1019 gdk_window_move_resize(child->window,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1020 x, y,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1021 child->widget->requisition.width,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1022 child->widget->requisition.height);
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
1023 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1024 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1025
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1026 allocation.x = 0;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1027 allocation.y = 0;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1028 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1029 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1030 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1031 allocation.x = x;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1032 allocation.y = y;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1033 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1034
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
1035 #if GTK_CHECK_VERSION(3,0,0)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
1036 allocation.width = requisition.width;
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
1037 allocation.height = requisition.height;
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
1038 #else
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1039 allocation.width = child->widget->requisition.width;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1040 allocation.height = child->widget->requisition.height;
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
1041 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1042
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1043 gtk_widget_size_allocate(child->widget, &allocation);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1044 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1045 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1046 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1047 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1048 if (child->mapped)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1049 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1050 child->mapped = FALSE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1051
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
1052 #if GTK_CHECK_VERSION(3,0,0)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
1053 if (gtk_widget_get_mapped(child->widget))
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
1054 #else
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1055 if (GTK_WIDGET_MAPPED(child->widget))
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
1056 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1057 gtk_widget_unmap(child->widget);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1058 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1059 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1060 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1061
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1062 static void
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1063 gtk_form_position_children(GtkForm *form)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1064 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1065 GList *tmp_list;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1066
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1067 for (tmp_list = form->children; tmp_list; tmp_list = tmp_list->next)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1068 gtk_form_position_child(form, tmp_list->data, FALSE);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1069 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1070
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1071 /* Callbacks */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1072
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1073 /* The main event filter. Actually, we probably don't really need
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1074 * to install this as a filter at all, since we are calling it
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1075 * directly above in the expose-handling hack.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1076 *
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1077 * This routine identifies expose events that are generated when
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1078 * we've temporarily moved the bin_window_origin, and translates
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1079 * them or discards them, depending on whether we are obscured
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1080 * or not.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1081 */
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
1082 #if !GTK_CHECK_VERSION(3,0,0)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1083 static GdkFilterReturn
1884
3dd986bfef63 updated for version 7.2-181
vimboss
parents: 1207
diff changeset
1084 gtk_form_filter(GdkXEvent *gdk_xevent, GdkEvent *event UNUSED, gpointer data)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1085 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1086 XEvent *xevent;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1087 GtkForm *form;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1088
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1089 xevent = (XEvent *) gdk_xevent;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1090 form = GTK_FORM(data);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1091
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1092 switch (xevent->type)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1093 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1094 case Expose:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1095 if (xevent->xexpose.serial == form->configure_serial)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1096 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1097 if (form->visibility == GDK_VISIBILITY_UNOBSCURED)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1098 return GDK_FILTER_REMOVE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1099 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1100 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1101 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1102 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1103
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1104 case ConfigureNotify:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1105 if ((xevent->xconfigure.x != 0) || (xevent->xconfigure.y != 0))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1106 form->configure_serial = xevent->xconfigure.serial;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1107 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1108 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1109
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1110 return GDK_FILTER_CONTINUE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1111 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1112
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1113 /* Although GDK does have a GDK_VISIBILITY_NOTIFY event,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1114 * there is no corresponding event in GTK, so we have
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1115 * to get the events from a filter
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1116 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1117 static GdkFilterReturn
1884
3dd986bfef63 updated for version 7.2-181
vimboss
parents: 1207
diff changeset
1118 gtk_form_main_filter(GdkXEvent *gdk_xevent,
3dd986bfef63 updated for version 7.2-181
vimboss
parents: 1207
diff changeset
1119 GdkEvent *event UNUSED,
3dd986bfef63 updated for version 7.2-181
vimboss
parents: 1207
diff changeset
1120 gpointer data)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1121 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1122 XEvent *xevent;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1123 GtkForm *form;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1124
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1125 xevent = (XEvent *) gdk_xevent;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1126 form = GTK_FORM(data);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1127
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1128 if (xevent->type == VisibilityNotify)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1129 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1130 switch (xevent->xvisibility.state)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1131 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1132 case VisibilityFullyObscured:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1133 form->visibility = GDK_VISIBILITY_FULLY_OBSCURED;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1134 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1135
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1136 case VisibilityPartiallyObscured:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1137 form->visibility = GDK_VISIBILITY_PARTIAL;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1138 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1139
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1140 case VisibilityUnobscured:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1141 form->visibility = GDK_VISIBILITY_UNOBSCURED;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1142 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1143 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1144
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1145 return GDK_FILTER_REMOVE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1146 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1147 return GDK_FILTER_CONTINUE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1148 }
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
1149 #endif /* !GTK_CHECK_VERSION(3,0,0) */
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1150
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
1151 #if !GTK_CHECK_VERSION(3,16,0)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1152 static void
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1153 gtk_form_set_static_gravity(GdkWindow *window, gboolean use_static)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1154 {
1960
3c838658fc35 updated for version 7.2-257
vimboss
parents: 1885
diff changeset
1155 /* We don't check if static gravity is actually supported, because it
3c838658fc35 updated for version 7.2-257
vimboss
parents: 1885
diff changeset
1156 * results in an annoying assertion error message. */
3c838658fc35 updated for version 7.2-257
vimboss
parents: 1885
diff changeset
1157 gdk_window_set_static_gravities(window, use_static);
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1158 }
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
1159 #endif /* !GTK_CHECK_VERSION(3,16,0) */
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1160
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1161 void
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1162 gtk_form_move_resize(GtkForm *form, GtkWidget *widget,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1163 gint x, gint y, gint w, gint h)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1164 {
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
1165 #if GTK_CHECK_VERSION(3,0,0)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
1166 gtk_widget_set_size_request(widget, w, h);
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
1167 #else
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1168 widget->requisition.width = w;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1169 widget->requisition.height = h;
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
1170 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1171
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1172 gtk_form_move(form, widget, x, y);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1173 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1174
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1175 static void
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1176 gtk_form_send_configure(GtkForm *form)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1177 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1178 GtkWidget *widget;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1179 GdkEventConfigure event;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1180
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1181 widget = GTK_WIDGET(form);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1182
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1183 event.type = GDK_CONFIGURE;
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
1184 #if GTK_CHECK_VERSION(3,0,0)
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
1185 event.window = gtk_widget_get_window(widget);
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
1186 {
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
1187 GtkAllocation allocation;
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
1188
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
1189 gtk_widget_get_allocation(widget, &allocation);
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
1190 event.x = allocation.x;
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
1191 event.y = allocation.y;
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
1192 event.width = allocation.width;
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
1193 event.height = allocation.height;
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
1194 }
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
1195 #else
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1196 event.window = widget->window;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1197 event.x = widget->allocation.x;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1198 event.y = widget->allocation.y;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1199 event.width = widget->allocation.width;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1200 event.height = widget->allocation.height;
8218
3456e2ebebd4 commit https://github.com/vim/vim/commit/9892189d2e7ab94b750f99e6da4cbfc3c8014517
Christian Brabandt <cb@256bit.org>
parents: 2275
diff changeset
1201 #endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1202
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1203 gtk_main_do_event((GdkEvent*)&event);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1204 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1205
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1206 static void
1884
3dd986bfef63 updated for version 7.2-181
vimboss
parents: 1207
diff changeset
1207 gtk_form_child_map(GtkWidget *widget UNUSED, gpointer user_data)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1208 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1209 GtkFormChild *child;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1210
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1211 child = (GtkFormChild *)user_data;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1212
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1213 child->mapped = TRUE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1214 gdk_window_show(child->window);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1215 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1216
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1217 static void
1884
3dd986bfef63 updated for version 7.2-181
vimboss
parents: 1207
diff changeset
1218 gtk_form_child_unmap(GtkWidget *widget UNUSED, gpointer user_data)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1219 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1220 GtkFormChild *child;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1221
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1222 child = (GtkFormChild *)user_data;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1223
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1224 child->mapped = FALSE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1225 gdk_window_hide(child->window);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1226 }