0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.2.1878: GTK: error for redefining function

Problem:    GTK: error for redefining function. (Tony Mechelynck)
Solution:   Remove "gtk_" prefix from local functions and prepend "gui_" to
            global functions.
This commit is contained in:
Bram Moolenaar
2020-10-21 16:10:21 +02:00
parent b8f519e538
commit 8a99e66b4f
5 changed files with 109 additions and 128 deletions

View File

@@ -810,7 +810,7 @@ gui_mch_add_menu_item(vimmenu_T *menu, int idx)
void void
gui_mch_set_text_area_pos(int x, int y, int w, int h) gui_mch_set_text_area_pos(int x, int y, int w, int h)
{ {
gtk_form_move_resize(GTK_FORM(gui.formwin), gui.drawarea, x, y, w, h); gui_gtk_form_move_resize(GTK_FORM(gui.formwin), gui.drawarea, x, y, w, h);
} }
@@ -1005,7 +1005,7 @@ gui_mch_set_scrollbar_thumb(scrollbar_T *sb, long val, long size, long max)
gui_mch_set_scrollbar_pos(scrollbar_T *sb, int x, int y, int w, int h) gui_mch_set_scrollbar_pos(scrollbar_T *sb, int x, int y, int w, int h)
{ {
if (sb->id != NULL) if (sb->id != NULL)
gtk_form_move_resize(GTK_FORM(gui.formwin), sb->id, x, y, w, h); gui_gtk_form_move_resize(GTK_FORM(gui.formwin), sb->id, x, y, w, h);
} }
int int
@@ -1111,7 +1111,7 @@ gui_mch_create_scrollbar(scrollbar_T *sb, int orient)
GtkAdjustment *adjustment; GtkAdjustment *adjustment;
gtk_widget_set_can_focus(sb->id, FALSE); gtk_widget_set_can_focus(sb->id, FALSE);
gtk_form_put(GTK_FORM(gui.formwin), sb->id, 0, 0); gui_gtk_form_put(GTK_FORM(gui.formwin), sb->id, 0, 0);
adjustment = gtk_range_get_adjustment(GTK_RANGE(sb->id)); adjustment = gtk_range_get_adjustment(GTK_RANGE(sb->id));

View File

@@ -11,7 +11,6 @@
* (C) 1998,1999 by Marcin Dalecki <martin@dalecki.de> * (C) 1998,1999 by Marcin Dalecki <martin@dalecki.de>
* *
* Support for GTK+ 2 was added by: * Support for GTK+ 2 was added by:
*
* (C) 2002,2003 Jason Hildebrand <jason@peaceworks.ca> * (C) 2002,2003 Jason Hildebrand <jason@peaceworks.ca>
* Daniel Elstner <daniel.elstner@gmx.net> * Daniel Elstner <daniel.elstner@gmx.net>
* *
@@ -21,7 +20,6 @@
* long time. * long time.
* *
* Support for GTK+ 3 was added by: * Support for GTK+ 3 was added by:
*
* 2016 Kazunobu Kuriyama <kazunobu.kuriyama@gmail.com> * 2016 Kazunobu Kuriyama <kazunobu.kuriyama@gmail.com>
*/ */
@@ -50,52 +48,36 @@ struct _GtkFormChild
}; };
static void gtk_form_class_init(GtkFormClass *klass); static void form_class_init(GtkFormClass *klass);
static void gtk_form_init(GtkForm *form, void *g_class); static void form_init(GtkForm *form, void *g_class);
static void gtk_form_realize(GtkWidget *widget); static void form_realize(GtkWidget *widget);
static void gtk_form_unrealize(GtkWidget *widget); static void form_unrealize(GtkWidget *widget);
static void gtk_form_map(GtkWidget *widget); static void form_map(GtkWidget *widget);
static void gtk_form_size_request(GtkWidget *widget, static void form_size_request(GtkWidget *widget, GtkRequisition *requisition);
GtkRequisition *requisition);
#if GTK_CHECK_VERSION(3,0,0) #if GTK_CHECK_VERSION(3,0,0)
static void gtk_form_get_preferred_width(GtkWidget *widget, static void form_get_preferred_width(GtkWidget *widget, gint *minimal_width, gint *natural_width);
gint *minimal_width, static void form_get_preferred_height(GtkWidget *widget, gint *minimal_height, gint *natural_height);
gint *natural_width);
static void gtk_form_get_preferred_height(GtkWidget *widget,
gint *minimal_height,
gint *natural_height);
#endif #endif
static void gtk_form_size_allocate(GtkWidget *widget, static void form_size_allocate(GtkWidget *widget, GtkAllocation *allocation);
GtkAllocation *allocation);
#if GTK_CHECK_VERSION(3,0,0) #if GTK_CHECK_VERSION(3,0,0)
static gboolean gtk_form_draw(GtkWidget *widget, static gboolean form_draw(GtkWidget *widget, cairo_t *cr);
cairo_t *cr);
#else #else
static gint gtk_form_expose(GtkWidget *widget, static gint form_expose(GtkWidget *widget, GdkEventExpose *event);
GdkEventExpose *event);
#endif #endif
static void gtk_form_remove(GtkContainer *container, static void form_remove(GtkContainer *container, GtkWidget *widget);
GtkWidget *widget); static void form_forall(GtkContainer *container, gboolean include_internals, GtkCallback callback, gpointer callback_data);
static void gtk_form_forall(GtkContainer *container,
gboolean include_internals,
GtkCallback callback,
gpointer callback_data);
static void gtk_form_attach_child_window(GtkForm *form, static void form_attach_child_window(GtkForm *form, GtkFormChild *child);
GtkFormChild *child); static void form_realize_child(GtkForm *form, GtkFormChild *child);
static void gtk_form_realize_child(GtkForm *form, static void form_position_child(GtkForm *form, GtkFormChild *child, gboolean force_allocate);
GtkFormChild *child); static void form_position_children(GtkForm *form);
static void gtk_form_position_child(GtkForm *form,
GtkFormChild *child,
gboolean force_allocate);
static void gtk_form_position_children(GtkForm *form);
static void gtk_form_send_configure(GtkForm *form); static void form_send_configure(GtkForm *form);
static void gtk_form_child_map(GtkWidget *widget, gpointer user_data); static void form_child_map(GtkWidget *widget, gpointer user_data);
static void gtk_form_child_unmap(GtkWidget *widget, gpointer user_data); static void form_child_unmap(GtkWidget *widget, gpointer user_data);
#if !GTK_CHECK_VERSION(3,0,0) #if !GTK_CHECK_VERSION(3,0,0)
static GtkWidgetClass *parent_class = NULL; static GtkWidgetClass *parent_class = NULL;
@@ -104,21 +86,22 @@ static GtkWidgetClass *parent_class = NULL;
// Public interface // Public interface
GtkWidget * GtkWidget *
gtk_form_new(void) gui_gtk_form_new(void)
{ {
GtkForm *form; GtkForm *form;
#if GTK_CHECK_VERSION(3,0,0) #if GTK_CHECK_VERSION(3,0,0)
form = g_object_new(GTK_TYPE_FORM, NULL); form = g_object_new(GTK_TYPE_FORM, NULL);
#else #else
form = gtk_type_new(gtk_form_get_type()); form = gtk_type_new(gui_gtk_form_get_type());
#endif #endif
return GTK_WIDGET(form); return GTK_WIDGET(form);
} }
void void
gtk_form_put(GtkForm *form, gui_gtk_form_put(
GtkForm *form,
GtkWidget *child_widget, GtkWidget *child_widget,
gint x, gint x,
gint y) gint y)
@@ -151,19 +134,20 @@ gtk_form_put(GtkForm *form,
// that gtk_widget_set_parent() realizes the widget if it's visible // that gtk_widget_set_parent() realizes the widget if it's visible
// and its parent is mapped. // and its parent is mapped.
if (gtk_widget_get_realized(GTK_WIDGET(form))) if (gtk_widget_get_realized(GTK_WIDGET(form)))
gtk_form_attach_child_window(form, child); form_attach_child_window(form, child);
gtk_widget_set_parent(child_widget, GTK_WIDGET(form)); gtk_widget_set_parent(child_widget, GTK_WIDGET(form));
if (gtk_widget_get_realized(GTK_WIDGET(form)) if (gtk_widget_get_realized(GTK_WIDGET(form))
&& !gtk_widget_get_realized(child_widget)) && !gtk_widget_get_realized(child_widget))
gtk_form_realize_child(form, child); form_realize_child(form, child);
gtk_form_position_child(form, child, TRUE); form_position_child(form, child, TRUE);
} }
void void
gtk_form_move(GtkForm *form, gui_gtk_form_move(
GtkForm *form,
GtkWidget *child_widget, GtkWidget *child_widget,
gint x, gint x,
gint y) gint y)
@@ -181,14 +165,14 @@ gtk_form_move(GtkForm *form,
child->x = x; child->x = x;
child->y = y; child->y = y;
gtk_form_position_child(form, child, TRUE); form_position_child(form, child, TRUE);
return; return;
} }
} }
} }
void void
gtk_form_freeze(GtkForm *form) gui_gtk_form_freeze(GtkForm *form)
{ {
g_return_if_fail(GTK_IS_FORM(form)); g_return_if_fail(GTK_IS_FORM(form));
@@ -196,7 +180,7 @@ gtk_form_freeze(GtkForm *form)
} }
void void
gtk_form_thaw(GtkForm *form) gui_gtk_form_thaw(GtkForm *form)
{ {
g_return_if_fail(GTK_IS_FORM(form)); g_return_if_fail(GTK_IS_FORM(form));
@@ -204,7 +188,7 @@ gtk_form_thaw(GtkForm *form)
{ {
if (!(--form->freeze_count)) if (!(--form->freeze_count))
{ {
gtk_form_position_children(form); form_position_children(form);
gtk_widget_queue_draw(GTK_WIDGET(form)); gtk_widget_queue_draw(GTK_WIDGET(form));
} }
} }
@@ -215,7 +199,7 @@ gtk_form_thaw(GtkForm *form)
G_DEFINE_TYPE(GtkForm, gtk_form, GTK_TYPE_CONTAINER) G_DEFINE_TYPE(GtkForm, gtk_form, GTK_TYPE_CONTAINER)
#else #else
GtkType GtkType
gtk_form_get_type(void) gui_gtk_form_get_type(void)
{ {
static GtkType form_type = 0; static GtkType form_type = 0;
@@ -227,8 +211,8 @@ gtk_form_get_type(void)
form_info.type_name = "GtkForm"; form_info.type_name = "GtkForm";
form_info.object_size = sizeof(GtkForm); form_info.object_size = sizeof(GtkForm);
form_info.class_size = sizeof(GtkFormClass); form_info.class_size = sizeof(GtkFormClass);
form_info.class_init_func = (GtkClassInitFunc)gtk_form_class_init; form_info.class_init_func = (GtkClassInitFunc)form_class_init;
form_info.object_init_func = (GtkObjectInitFunc)gtk_form_init; form_info.object_init_func = (GtkObjectInitFunc)form_init;
form_type = gtk_type_unique(GTK_TYPE_CONTAINER, &form_info); form_type = gtk_type_unique(GTK_TYPE_CONTAINER, &form_info);
} }
@@ -237,7 +221,7 @@ gtk_form_get_type(void)
#endif // !GTK_CHECK_VERSION(3,0,0) #endif // !GTK_CHECK_VERSION(3,0,0)
static void static void
gtk_form_class_init(GtkFormClass *klass) form_class_init(GtkFormClass *klass)
{ {
GtkWidgetClass *widget_class; GtkWidgetClass *widget_class;
GtkContainerClass *container_class; GtkContainerClass *container_class;
@@ -249,28 +233,28 @@ gtk_form_class_init(GtkFormClass *klass)
parent_class = gtk_type_class(gtk_container_get_type()); parent_class = gtk_type_class(gtk_container_get_type());
#endif #endif
widget_class->realize = gtk_form_realize; widget_class->realize = form_realize;
widget_class->unrealize = gtk_form_unrealize; widget_class->unrealize = form_unrealize;
widget_class->map = gtk_form_map; widget_class->map = form_map;
#if GTK_CHECK_VERSION(3,0,0) #if GTK_CHECK_VERSION(3,0,0)
widget_class->get_preferred_width = gtk_form_get_preferred_width; widget_class->get_preferred_width = form_get_preferred_width;
widget_class->get_preferred_height = gtk_form_get_preferred_height; widget_class->get_preferred_height = form_get_preferred_height;
#else #else
widget_class->size_request = gtk_form_size_request; widget_class->size_request = form_size_request;
#endif #endif
widget_class->size_allocate = gtk_form_size_allocate; widget_class->size_allocate = form_size_allocate;
#if GTK_CHECK_VERSION(3,0,0) #if GTK_CHECK_VERSION(3,0,0)
widget_class->draw = gtk_form_draw; widget_class->draw = form_draw;
#else #else
widget_class->expose_event = gtk_form_expose; widget_class->expose_event = form_expose;
#endif #endif
container_class->remove = gtk_form_remove; container_class->remove = form_remove;
container_class->forall = gtk_form_forall; container_class->forall = form_forall;
} }
static void static void
gtk_form_init(GtkForm *form, void *g_class UNUSED) form_init(GtkForm *form, void *g_class UNUSED)
{ {
#if GTK_CHECK_VERSION(3,0,0) #if GTK_CHECK_VERSION(3,0,0)
gtk_widget_set_has_window(GTK_WIDGET(form), TRUE); gtk_widget_set_has_window(GTK_WIDGET(form), TRUE);
@@ -285,7 +269,7 @@ gtk_form_init(GtkForm *form, void *g_class UNUSED)
*/ */
static void static void
gtk_form_realize(GtkWidget *widget) form_realize(GtkWidget *widget)
{ {
GList *tmp_list; GList *tmp_list;
GtkForm *form; GtkForm *form;
@@ -353,10 +337,10 @@ gtk_form_realize(GtkWidget *widget)
{ {
GtkFormChild *child = tmp_list->data; GtkFormChild *child = tmp_list->data;
gtk_form_attach_child_window(form, child); form_attach_child_window(form, child);
if (gtk_widget_get_visible(child->widget)) if (gtk_widget_get_visible(child->widget))
gtk_form_realize_child(form, child); form_realize_child(form, child);
} }
} }
@@ -369,7 +353,7 @@ gtk_form_realize(GtkWidget *widget)
// Well, I reckon at least the gdk_window_show(form->bin_window) // Well, I reckon at least the gdk_window_show(form->bin_window)
// is necessary. GtkForm is anything but a usual container widget. // is necessary. GtkForm is anything but a usual container widget.
static void static void
gtk_form_map(GtkWidget *widget) form_map(GtkWidget *widget)
{ {
GList *tmp_list; GList *tmp_list;
GtkForm *form; GtkForm *form;
@@ -394,7 +378,7 @@ gtk_form_map(GtkWidget *widget)
} }
static void static void
gtk_form_unrealize(GtkWidget *widget) form_unrealize(GtkWidget *widget)
{ {
GList *tmp_list; GList *tmp_list;
GtkForm *form; GtkForm *form;
@@ -416,10 +400,10 @@ gtk_form_unrealize(GtkWidget *widget)
if (child->window != NULL) if (child->window != NULL)
{ {
g_signal_handlers_disconnect_by_func(G_OBJECT(child->widget), g_signal_handlers_disconnect_by_func(G_OBJECT(child->widget),
FUNC2GENERIC(gtk_form_child_map), FUNC2GENERIC(form_child_map),
child); child);
g_signal_handlers_disconnect_by_func(G_OBJECT(child->widget), g_signal_handlers_disconnect_by_func(G_OBJECT(child->widget),
FUNC2GENERIC(gtk_form_child_unmap), FUNC2GENERIC(form_child_unmap),
child); child);
gdk_window_set_user_data(child->window, NULL); gdk_window_set_user_data(child->window, NULL);
@@ -441,7 +425,7 @@ gtk_form_unrealize(GtkWidget *widget)
} }
static void static void
gtk_form_size_request(GtkWidget *widget, GtkRequisition *requisition) form_size_request(GtkWidget *widget, GtkRequisition *requisition)
{ {
g_return_if_fail(GTK_IS_FORM(widget)); g_return_if_fail(GTK_IS_FORM(widget));
g_return_if_fail(requisition != NULL); g_return_if_fail(requisition != NULL);
@@ -452,26 +436,26 @@ gtk_form_size_request(GtkWidget *widget, GtkRequisition *requisition)
#if GTK_CHECK_VERSION(3,0,0) #if GTK_CHECK_VERSION(3,0,0)
static void static void
gtk_form_get_preferred_width(GtkWidget *widget, form_get_preferred_width(GtkWidget *widget,
gint *minimal_width, gint *minimal_width,
gint *natural_width) gint *natural_width)
{ {
GtkRequisition requisition; GtkRequisition requisition;
gtk_form_size_request(widget, &requisition); form_size_request(widget, &requisition);
*minimal_width = requisition.width; *minimal_width = requisition.width;
*natural_width = requisition.width; *natural_width = requisition.width;
} }
static void static void
gtk_form_get_preferred_height(GtkWidget *widget, form_get_preferred_height(GtkWidget *widget,
gint *minimal_height, gint *minimal_height,
gint *natural_height) gint *natural_height)
{ {
GtkRequisition requisition; GtkRequisition requisition;
gtk_form_size_request(widget, &requisition); form_size_request(widget, &requisition);
*minimal_height = requisition.height; *minimal_height = requisition.height;
*natural_height = requisition.height; *natural_height = requisition.height;
@@ -479,7 +463,7 @@ gtk_form_get_preferred_height(GtkWidget *widget,
#endif // GTK_CHECK_VERSION(3,0,0) #endif // GTK_CHECK_VERSION(3,0,0)
static void static void
gtk_form_size_allocate(GtkWidget *widget, GtkAllocation *allocation) form_size_allocate(GtkWidget *widget, GtkAllocation *allocation)
{ {
GList *tmp_list; GList *tmp_list;
GtkForm *form; GtkForm *form;
@@ -507,7 +491,7 @@ gtk_form_size_allocate(GtkWidget *widget, GtkAllocation *allocation)
while (tmp_list) while (tmp_list)
{ {
GtkFormChild *child = tmp_list->data; GtkFormChild *child = tmp_list->data;
gtk_form_position_child(form, child, TRUE); form_position_child(form, child, TRUE);
tmp_list = tmp_list->next; tmp_list = tmp_list->next;
} }
@@ -524,7 +508,7 @@ gtk_form_size_allocate(GtkWidget *widget, GtkAllocation *allocation)
} }
gtk_widget_set_allocation(widget, allocation); gtk_widget_set_allocation(widget, allocation);
if (need_reposition) if (need_reposition)
gtk_form_send_configure(form); form_send_configure(form);
} }
#if GTK_CHECK_VERSION(3,0,0) #if GTK_CHECK_VERSION(3,0,0)
@@ -538,7 +522,7 @@ gtk_form_render_background(GtkWidget *widget, cairo_t *cr)
} }
static gboolean static gboolean
gtk_form_draw(GtkWidget *widget, cairo_t *cr) form_draw(GtkWidget *widget, cairo_t *cr)
{ {
GList *tmp_list = NULL; GList *tmp_list = NULL;
GtkForm *form = NULL; GtkForm *form = NULL;
@@ -563,9 +547,9 @@ gtk_form_draw(GtkWidget *widget, cairo_t *cr)
// gtk_widget_draw() fails and the relevant scrollbar won't // gtk_widget_draw() fails and the relevant scrollbar won't
// appear on the screen. // appear on the screen.
// //
// Calling gtk_form_position_child() like this is one of ways // Calling form_position_child() like this is one of ways
// to make sure of that. // to make sure of that.
gtk_form_position_child(form, formchild, TRUE); form_position_child(form, formchild, TRUE);
gtk_form_render_background(formchild->widget, cr); gtk_form_render_background(formchild->widget, cr);
} }
@@ -575,7 +559,7 @@ gtk_form_draw(GtkWidget *widget, cairo_t *cr)
} }
#else // !GTK_CHECK_VERSION(3,0,0) #else // !GTK_CHECK_VERSION(3,0,0)
static gint static gint
gtk_form_expose(GtkWidget *widget, GdkEventExpose *event) form_expose(GtkWidget *widget, GdkEventExpose *event)
{ {
GList *tmp_list; GList *tmp_list;
GtkForm *form; GtkForm *form;
@@ -598,7 +582,7 @@ gtk_form_expose(GtkWidget *widget, GdkEventExpose *event)
// Container method // Container method
static void static void
gtk_form_remove(GtkContainer *container, GtkWidget *widget) form_remove(GtkContainer *container, GtkWidget *widget)
{ {
GList *tmp_list; GList *tmp_list;
GtkForm *form; GtkForm *form;
@@ -625,9 +609,9 @@ gtk_form_remove(GtkContainer *container, GtkWidget *widget)
if (child->window) if (child->window)
{ {
g_signal_handlers_disconnect_by_func(G_OBJECT(child->widget), g_signal_handlers_disconnect_by_func(G_OBJECT(child->widget),
FUNC2GENERIC(&gtk_form_child_map), child); FUNC2GENERIC(&form_child_map), child);
g_signal_handlers_disconnect_by_func(G_OBJECT(child->widget), g_signal_handlers_disconnect_by_func(G_OBJECT(child->widget),
FUNC2GENERIC(&gtk_form_child_unmap), child); FUNC2GENERIC(&form_child_unmap), child);
// FIXME: This will cause problems for reparenting NO_WINDOW // FIXME: This will cause problems for reparenting NO_WINDOW
// widgets out of a GtkForm // widgets out of a GtkForm
@@ -646,7 +630,7 @@ gtk_form_remove(GtkContainer *container, GtkWidget *widget)
} }
static void static void
gtk_form_forall(GtkContainer *container, form_forall(GtkContainer *container,
gboolean include_internals UNUSED, gboolean include_internals UNUSED,
GtkCallback callback, GtkCallback callback,
gpointer callback_data) gpointer callback_data)
@@ -673,7 +657,7 @@ gtk_form_forall(GtkContainer *container,
// Operations on children // Operations on children
static void static void
gtk_form_attach_child_window(GtkForm *form, GtkFormChild *child) form_attach_child_window(GtkForm *form, GtkFormChild *child)
{ {
if (child->window != NULL) if (child->window != NULL)
return; // been there, done that return; // been there, done that
@@ -734,9 +718,9 @@ gtk_form_attach_child_window(GtkForm *form, GtkFormChild *child)
* alongside with the actual widget. * alongside with the actual widget.
*/ */
g_signal_connect(G_OBJECT(child->widget), "map", g_signal_connect(G_OBJECT(child->widget), "map",
G_CALLBACK(&gtk_form_child_map), child); G_CALLBACK(&form_child_map), child);
g_signal_connect(G_OBJECT(child->widget), "unmap", g_signal_connect(G_OBJECT(child->widget), "unmap",
G_CALLBACK(&gtk_form_child_unmap), child); G_CALLBACK(&form_child_unmap), child);
} }
else if (!gtk_widget_get_realized(child->widget)) else if (!gtk_widget_get_realized(child->widget))
{ {
@@ -745,15 +729,14 @@ gtk_form_attach_child_window(GtkForm *form, GtkFormChild *child)
} }
static void static void
gtk_form_realize_child(GtkForm *form, GtkFormChild *child) form_realize_child(GtkForm *form, GtkFormChild *child)
{ {
gtk_form_attach_child_window(form, child); form_attach_child_window(form, child);
gtk_widget_realize(child->widget); gtk_widget_realize(child->widget);
} }
static void static void
gtk_form_position_child(GtkForm *form, GtkFormChild *child, form_position_child(GtkForm *form, GtkFormChild *child, gboolean force_allocate)
gboolean force_allocate)
{ {
gint x; gint x;
gint y; gint y;
@@ -826,16 +809,16 @@ gtk_form_position_child(GtkForm *form, GtkFormChild *child,
} }
static void static void
gtk_form_position_children(GtkForm *form) form_position_children(GtkForm *form)
{ {
GList *tmp_list; GList *tmp_list;
for (tmp_list = form->children; tmp_list; tmp_list = tmp_list->next) for (tmp_list = form->children; tmp_list; tmp_list = tmp_list->next)
gtk_form_position_child(form, tmp_list->data, FALSE); form_position_child(form, tmp_list->data, FALSE);
} }
void void
gtk_form_move_resize(GtkForm *form, GtkWidget *widget, gui_gtk_form_move_resize(GtkForm *form, GtkWidget *widget,
gint x, gint y, gint w, gint h) gint x, gint y, gint w, gint h)
{ {
#if GTK_CHECK_VERSION(3,0,0) #if GTK_CHECK_VERSION(3,0,0)
@@ -845,11 +828,11 @@ gtk_form_move_resize(GtkForm *form, GtkWidget *widget,
widget->requisition.height = h; widget->requisition.height = h;
#endif #endif
gtk_form_move(form, widget, x, y); gui_gtk_form_move(form, widget, x, y);
} }
static void static void
gtk_form_send_configure(GtkForm *form) form_send_configure(GtkForm *form)
{ {
GtkWidget *widget; GtkWidget *widget;
GdkEventConfigure event; GdkEventConfigure event;
@@ -869,7 +852,7 @@ gtk_form_send_configure(GtkForm *form)
} }
static void static void
gtk_form_child_map(GtkWidget *widget UNUSED, gpointer user_data) form_child_map(GtkWidget *widget UNUSED, gpointer user_data)
{ {
GtkFormChild *child; GtkFormChild *child;
@@ -880,7 +863,7 @@ gtk_form_child_map(GtkWidget *widget UNUSED, gpointer user_data)
} }
static void static void
gtk_form_child_unmap(GtkWidget *widget UNUSED, gpointer user_data) form_child_unmap(GtkWidget *widget UNUSED, gpointer user_data)
{ {
GtkFormChild *child; GtkFormChild *child;

View File

@@ -21,7 +21,7 @@
extern "C" { extern "C" {
#endif #endif
#define GTK_TYPE_FORM (gtk_form_get_type ()) #define GTK_TYPE_FORM (gui_gtk_form_get_type ())
#ifdef USE_GTK3 #ifdef USE_GTK3
#define GTK_FORM(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GTK_TYPE_FORM, GtkForm)) #define GTK_FORM(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GTK_TYPE_FORM, GtkForm))
#define GTK_FORM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GTK_TYPE_FORM, GtkFormClass)) #define GTK_FORM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GTK_TYPE_FORM, GtkFormClass))
@@ -53,29 +53,25 @@ struct _GtkFormClass
}; };
#ifdef USE_GTK3 #ifdef USE_GTK3
GType gtk_form_get_type(void); GType gui_gtk_form_get_type(void);
#else #else
GtkType gtk_form_get_type(void); GtkType gui_gtk_form_get_type(void);
#endif #endif
GtkWidget *gtk_form_new(void); GtkWidget *gui_gtk_form_new(void);
void gtk_form_put(GtkForm * form, GtkWidget * widget, void gui_gtk_form_put(GtkForm * form, GtkWidget * widget, gint x, gint y);
gint x, gint y);
void gtk_form_move(GtkForm *form, GtkWidget * widget, void gui_gtk_form_move(GtkForm *form, GtkWidget * widget, gint x, gint y);
gint x, gint y);
void gtk_form_move_resize(GtkForm * form, GtkWidget * widget, void gui_gtk_form_move_resize(GtkForm * form, GtkWidget * widget, gint x, gint y, gint w, gint h);
gint x, gint y,
gint w, gint h);
// These disable and enable moving and repainting respectively. If you // These disable and enable moving and repainting respectively. If you
// want to update the layout's offsets but do not want it to repaint // want to update the layout's offsets but do not want it to repaint
// itself, you should use these functions. // itself, you should use these functions.
void gtk_form_freeze(GtkForm *form); void gui_gtk_form_freeze(GtkForm *form);
void gtk_form_thaw(GtkForm *form); void gui_gtk_form_thaw(GtkForm *form);
#ifdef __cplusplus #ifdef __cplusplus

View File

@@ -3811,7 +3811,7 @@ gui_mch_init(void)
G_CALLBACK(on_tabline_menu), G_OBJECT(tabline_menu)); G_CALLBACK(on_tabline_menu), G_OBJECT(tabline_menu));
#endif // FEAT_GUI_TABLINE #endif // FEAT_GUI_TABLINE
gui.formwin = gtk_form_new(); gui.formwin = gui_gtk_form_new();
gtk_container_set_border_width(GTK_CONTAINER(gui.formwin), 0); gtk_container_set_border_width(GTK_CONTAINER(gui.formwin), 0);
#if !GTK_CHECK_VERSION(3,0,0) #if !GTK_CHECK_VERSION(3,0,0)
gtk_widget_set_events(gui.formwin, GDK_EXPOSURE_MASK); gtk_widget_set_events(gui.formwin, GDK_EXPOSURE_MASK);
@@ -3840,7 +3840,7 @@ gui_mch_init(void)
GDK_POINTER_MOTION_HINT_MASK); GDK_POINTER_MOTION_HINT_MASK);
gtk_widget_show(gui.drawarea); gtk_widget_show(gui.drawarea);
gtk_form_put(GTK_FORM(gui.formwin), gui.drawarea, 0, 0); gui_gtk_form_put(GTK_FORM(gui.formwin), gui.drawarea, 0, 0);
gtk_widget_show(gui.formwin); gtk_widget_show(gui.formwin);
gtk_box_pack_start(GTK_BOX(vbox), gui.formwin, TRUE, TRUE, 0); gtk_box_pack_start(GTK_BOX(vbox), gui.formwin, TRUE, TRUE, 0);
@@ -4119,9 +4119,9 @@ form_configure_event(GtkWidget *widget UNUSED,
if (gtk_socket_id != 0) if (gtk_socket_id != 0)
usable_height -= (gui.char_height - (gui.char_height/2)); // sic. usable_height -= (gui.char_height - (gui.char_height/2)); // sic.
gtk_form_freeze(GTK_FORM(gui.formwin)); gui_gtk_form_freeze(GTK_FORM(gui.formwin));
gui_resize_shell(event->width, usable_height); gui_resize_shell(event->width, usable_height);
gtk_form_thaw(GTK_FORM(gui.formwin)); gui_gtk_form_thaw(GTK_FORM(gui.formwin));
return TRUE; return TRUE;
} }

View File

@@ -750,6 +750,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1878,
/**/ /**/
1877, 1877,
/**/ /**/