Commit 13cd1b35 authored by Tristan Van Berkom's avatar Tristan Van Berkom

Changed the hierarchy changed signal for a "widget-event" signal.


	* gladeui/glade-app.[ch]: Changed the hierarchy changed signal
	  for a "widget-event" signal.

	* gladeui/glade-design-layout.c: Catch the "widget-event" signal
	  and propagate the event from there, dont raise the event_window anymore.

	* gladeui/glade-widget.c: 
	  - Removed "enter-notify-event"
	  - Catch "event" signal on GtkWidget instances and forward
	    the event to GladeApp
	  - When handling selection and SHIFT is down, dont stop emmission
	    (better handling of drag/resize)

	* gladeui/glade-fixed.c: Only drag/resize with shift down
	
	* gladeui/glade-marshallers.list: added new marshaller


svn path=/trunk/; revision=1066
parent 086b27dc
2007-02-01 Tristan Van Berkom <tvb@gnome.org>
* gladeui/glade-app.[ch]: Changed the hierarchy changed signal
for a "widget-event" signal.
* gladeui/glade-design-layout.c: Catch the "widget-event" signal
and propagate the event from there, dont raise the event_window anymore.
* gladeui/glade-widget.c:
- Removed "enter-notify-event"
- Catch "event" signal on GtkWidget instances and forward
the event to GladeApp
- When handling selection and SHIFT is down, dont stop emmission
(better handling of drag/resize)
* gladeui/glade-fixed.c: Only drag/resize with shift down
* gladeui/glade-marshallers.list: added new marshaller
2007-01-31 Tristan Van Berkom <tvb@gnome.org>
* gladeui/glade-widget.[ch]:
......
......@@ -37,6 +37,7 @@
#include "glade-fixed.h"
#include "glade-binding.h"
#include "glade-marshallers.h"
#include "glade-accumulators.h"
#include <gdk/gdkkeysyms.h>
#include <gtk/gtkstock.h>
......@@ -68,7 +69,7 @@ struct _GladeAppPriv {
enum
{
HIERARCHY_CHANGED,
WIDGET_EVENT,
UPDATE_UI,
LAST_SIGNAL
};
......@@ -407,23 +408,27 @@ glade_app_class_init (GladeAppClass * klass)
/**
* GladeApp::hierarchy-changed:
* GladeApp::widget-event:
* @gladeapp: the #GladeApp which received the signal.
* @arg1: The toplevel #GladeWidget who's hierarchy was modified
* @arg1: The toplevel #GladeWidget who's hierarchy recieved an event
* @arg2: The #GdkEvent
*
* Emitted when a #GladeWidget is added or removed from a toplevel
* #GladeWidget's hierarchy.
* Emitted when a #GladeWidget or one of its children is a GtkWidget derivative
* and is about to recieve an event from gdk.
*
* Returns: whether the event was handled or not
*/
glade_app_signals[HIERARCHY_CHANGED] =
g_signal_new ("hierarchy-changed",
glade_app_signals[WIDGET_EVENT] =
g_signal_new ("widget-event",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_FIRST,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GladeAppClass,
hierarchy_changed),
NULL, NULL,
glade_marshal_VOID__OBJECT,
G_TYPE_NONE, 1, G_TYPE_OBJECT);
widget_event),
glade_boolean_handled_accumulator, NULL,
glade_marshal_BOOLEAN__OBJECT_BOXED,
G_TYPE_BOOLEAN, 2,
GLADE_TYPE_WIDGET,
GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
g_object_class_install_property
(object_class, PROP_ACTIVE_PROJECT,
......@@ -662,17 +667,38 @@ glade_app_update_ui (void)
glade_app_signals[UPDATE_UI], 0);
}
void
glade_app_hierarchy_changed (GladeWidget *widget)
/**
* glade_app_widget_event:
* @widget: the #GladeWidget that recieved the event
* @event: the #GdkEvent
*
* Notifies the core that a widget recieved an event,
* the core will then take responsability of sending
* the right event to the right widget.
*
* Returns whether the event was handled by glade.
*/
gboolean
glade_app_widget_event (GladeWidget *widget,
GdkEvent *event)
{
GladeApp *app = glade_app_get();
GladeApp *app = glade_app_get ();
GladeWidget *toplevel = widget;
gboolean retval = FALSE;
g_return_if_fail (GLADE_IS_WIDGET (widget));
g_return_val_if_fail (GLADE_IS_WIDGET (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
while (toplevel->parent)
toplevel = toplevel->parent;
g_signal_emit (G_OBJECT (app),
glade_app_signals[HIERARCHY_CHANGED], 0, widget);
glade_app_signals[WIDGET_EVENT], 0, widget, event, &retval);
return retval;
}
void
glade_app_set_window (GtkWidget *window)
{
......
......@@ -57,7 +57,9 @@ struct _GladeAppClass
void (* hide_properties) (GladeApp* app);
/* signals */
void (* hierarchy_changed)(GladeApp *app, GladeWidget *toplevel);
void (* widget_event) (GladeApp *app,
GladeWidget *toplevel,
GdkEvent *event);
void (* update_ui_signal) (GladeApp *app);
};
......@@ -70,6 +72,9 @@ GladeApp* glade_app_get (void);
LIBGLADEUI_API
void glade_app_update_ui (void);
LIBGLADEUI_API
gboolean glade_app_widget_event (GladeWidget *widget,
GdkEvent *event);
LIBGLADEUI_API
void glade_app_set_window (GtkWidget *window);
LIBGLADEUI_API
......@@ -142,9 +147,6 @@ GtkWidget *glade_app_redo_button_new (void);
LIBGLADEUI_API
GList *glade_app_get_selection (void);
LIBGLADEUI_API
void glade_app_hierarchy_changed (GladeWidget *widget);
/* These handle selection on a global scope and take care
* of multiple project logic.
......
......@@ -34,6 +34,55 @@
static GladeCursor *cursor = NULL;
static void
set_cursor_recurse (GtkWidget *widget,
GdkCursor *gdk_cursor)
{
GList *children, *list;
if (!GTK_WIDGET_VISIBLE (widget) ||
!GTK_WIDGET_REALIZED (widget))
return;
gdk_window_set_cursor (widget->window, gdk_cursor);
if (GTK_IS_CONTAINER (widget) &&
(children =
glade_util_container_get_all_children (GTK_CONTAINER (widget))) != NULL)
{
for (list = children; list; list = list->next)
{
set_cursor_recurse (GTK_WIDGET (list->data), gdk_cursor);
}
g_list_free (children);
}
}
static void
set_cursor (GdkCursor *gdk_cursor)
{
GladeProject *project;
GList *list, *projects;
for (projects = glade_app_get_projects ();
projects; projects = projects->next)
{
project = projects->data;
for (list = project->objects;
list; list = list->next)
{
GObject *object = list->data;
if (GTK_IS_WINDOW (object))
{
set_cursor_recurse (GTK_WIDGET (object), gdk_cursor);
}
}
}
}
/**
* glade_cursor_set:
* @window: a #GdkWindow
......@@ -51,7 +100,7 @@ glade_cursor_set (GdkWindow *window, GladeCursorType type)
switch (type) {
case GLADE_CURSOR_SELECTOR:
gdk_window_set_cursor (window, cursor->selector);
the_cursor = cursor->selector;
break;
case GLADE_CURSOR_ADD_WIDGET:
if ((adaptor =
......@@ -97,6 +146,7 @@ glade_cursor_set (GdkWindow *window, GladeCursorType type)
break;
}
set_cursor (cursor->selector);
gdk_window_set_cursor (window, the_cursor);
}
......
......@@ -68,14 +68,14 @@ struct _GladeDesignLayoutPrivate
GdkCursor *cursor_resize_bottom_right;
/* state machine */
GladeActivity activity; /* the current activity */
GladeActivity activity; /* the current activity */
GtkRequisition *current_size_request;
gint dx; /* child.width - event.pointer.x */
gint dy; /* child.height - event.pointer.y */
gint new_width; /* user's new requested width */
gint new_height; /* user's new requested height */
gulong hierarchy_changed_id;
gulong widget_event_id;
};
static GtkBinClass *parent_class = NULL;
......@@ -406,7 +406,10 @@ glade_design_layout_motion_notify_event (GtkWidget *widget, GdkEventMotion *ev)
gdk_window_set_cursor (priv->event_window, priv->cursor_resize_bottom_right);
else if (region == GLADE_REGION_OUTSIDE)
{
gdk_window_set_cursor (priv->event_window, NULL);
glade_cursor_set (priv->event_window, GLADE_CURSOR_SELECTOR);
}
}
return FALSE;
}
......@@ -480,48 +483,6 @@ glade_design_layout_button_release_event (GtkWidget *widget, GdkEventButton *ev)
return FALSE;
}
static gboolean
glade_design_layout_event (GtkWidget *widget, GdkEvent *ev)
{
GladeWidget *gwidget;
GtkWidget *child;
gboolean retval;
gint x, y;
gtk_widget_get_pointer (widget, &x, &y);
gwidget = glade_design_layout_deepest_gwidget_at_position
(GTK_CONTAINER (widget), GTK_CONTAINER (widget), x, y);
child = glade_design_layout_deepest_widget_at_position
(GTK_CONTAINER (widget), GTK_CONTAINER (widget), x, y);
/* First try a placeholder */
if (GLADE_IS_PLACEHOLDER (child) && ev->type != GDK_EXPOSE)
{
retval = gtk_widget_event (child, ev);
if (retval)
return retval;
}
/* Then we try a GladeWidget */
if (gwidget)
{
retval = glade_widget_event (gwidget, ev);
if (retval)
return retval;
}
/* Then we send it to a project widget (the actual GtkWidget) */
if (child && child != widget && ev->type != GDK_EXPOSE)
{
return gtk_widget_event (child, ev);
}
return FALSE;
}
static void
glade_design_layout_size_request (GtkWidget *widget, GtkRequisition *requisition)
{
......@@ -586,10 +547,10 @@ glade_design_layout_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
{
if (priv->event_window)
gdk_window_move_resize (priv->event_window,
allocation->x/* + border_width */,
allocation->y/* + border_width */,
allocation->width/* - 2 * border_width */ ,
allocation->height/* - 2 * border_width */);
allocation->x,
allocation->y,
allocation->width,
allocation->height);
}
......@@ -661,10 +622,10 @@ glade_design_layout_realize (GtkWidget *widget)
border_width = GTK_CONTAINER (widget)->border_width;
attributes.x = widget->allocation.x/* + border_width */;
attributes.y = widget->allocation.y/* + border_width */;
attributes.width = widget->allocation.width/* - 2 * border_width */;
attributes.height = widget->allocation.height/* - 2 * border_width */;
attributes.x = widget->allocation.x;
attributes.y = widget->allocation.y;
attributes.width = widget->allocation.width;
attributes.height = widget->allocation.height;
attributes.window_type = GDK_WINDOW_CHILD;
attributes.wclass = GDK_INPUT_ONLY;
......@@ -686,8 +647,6 @@ glade_design_layout_realize (GtkWidget *widget)
&attributes, attributes_mask);
gdk_window_set_user_data (priv->event_window, widget);
gdk_window_raise (priv->event_window);
widget->style = gtk_style_attach (widget->style, widget->window);
gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);
}
......@@ -725,6 +684,8 @@ glade_design_layout_add (GtkContainer *container, GtkWidget *widget)
container);
GTK_CONTAINER_CLASS (parent_class)->add (container, widget);
gdk_window_lower (layout->priv->event_window);
}
static void
......@@ -763,10 +724,9 @@ glade_design_layout_finalize (GObject *object)
{
GladeDesignLayoutPrivate *priv = GLADE_DESIGN_LAYOUT_GET_PRIVATE (object);
g_free (priv->current_size_request);
g_signal_handler_disconnect (glade_app_get (), priv->widget_event_id);
g_signal_handler_disconnect (glade_app_get (),
priv->hierarchy_changed_id);
g_free (priv->current_size_request);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
......@@ -796,8 +756,8 @@ glade_design_layout_expose_event (GtkWidget *widget, GdkEventExpose *ev)
GladeDesignLayout *layout;
GdkGC *gc;
GtkWidget *child;
int x, y, w, h;
int border_width;
gint x, y, w, h;
gint border_width;
layout = GLADE_DESIGN_LAYOUT (widget);
......@@ -843,13 +803,62 @@ glade_design_layout_expose_event (GtkWidget *widget, GdkEventExpose *ev)
return TRUE;
}
static void
glade_design_layout_hierarchy_changed (GladeApp *app,
GladeWidget *toplevel,
GladeDesignLayout *layout)
static gboolean
glade_design_layout_widget_event (GladeApp *app,
GladeWidget *event_gwidget,
GdkEvent *event,
GladeDesignLayout *layout)
{
if (layout->priv->event_window)
gdk_window_raise (layout->priv->event_window);
GladeWidget *gwidget;
GtkWidget *child;
gboolean retval;
gint x, y;
gtk_widget_get_pointer (GTK_WIDGET (layout), &x, &y);
gwidget = glade_design_layout_deepest_gwidget_at_position
(GTK_CONTAINER (layout), GTK_CONTAINER (layout), x, y);
child = glade_design_layout_deepest_widget_at_position
(GTK_CONTAINER (layout), GTK_CONTAINER (layout), x, y);
/* First try a placeholder */
if (GLADE_IS_PLACEHOLDER (child) && event->type != GDK_EXPOSE)
{
retval = gtk_widget_event (child, event);
if (retval)
return retval;
}
/* Then we try a GladeWidget */
if (gwidget)
{
retval = glade_widget_event (gwidget, event);
if (retval)
return retval;
}
return FALSE;
}
static gboolean
glade_design_layout_propagate_event (GtkWidget *widget,
GdkEvent *event)
{
GtkWidget *child;
if ((child = GTK_BIN (widget)->child) != NULL)
{
GladeWidget *gwidget =
glade_widget_get_from_gobject (child);
if (gwidget)
return glade_design_layout_widget_event (glade_app_get (),
gwidget, event,
GLADE_DESIGN_LAYOUT (widget));
}
return FALSE;
}
static void
......@@ -873,9 +882,11 @@ glade_design_layout_init (GladeDesignLayout *layout)
priv->new_width = -1;
priv->new_height = -1;
priv->hierarchy_changed_id =
g_signal_connect (glade_app_get (), "hierarchy-changed",
G_CALLBACK (glade_design_layout_hierarchy_changed), layout);
priv->widget_event_id =
g_signal_connect (glade_app_get (), "widget-event",
G_CALLBACK (glade_design_layout_widget_event),
layout);
}
static void
......@@ -896,7 +907,7 @@ glade_design_layout_class_init (GladeDesignLayoutClass *klass)
container_class->add = glade_design_layout_add;
container_class->remove = glade_design_layout_remove;
widget_class->event = glade_design_layout_event;
widget_class->event = glade_design_layout_propagate_event;
widget_class->motion_notify_event = glade_design_layout_motion_notify_event;
widget_class->leave_notify_event = glade_design_layout_leave_notify_event;
widget_class->button_press_event = glade_design_layout_button_press_event;
......
......@@ -31,6 +31,7 @@
#include <glib-object.h>
#include <glib/gi18n-lib.h>
#include <gdk/gdkkeysyms.h>
#include "glade.h"
#include "glade-accumulators.h"
......@@ -60,7 +61,6 @@ typedef struct {
gulong press_id;
gulong release_id;
gulong motion_id;
gulong enter_id;
} GFSigData;
#define CHILD_WIDTH_MIN 20
......@@ -358,7 +358,6 @@ glade_fixed_disconnect_child (GladeFixed *fixed,
{
g_signal_handler_disconnect (child, data->press_id);
g_signal_handler_disconnect (child, data->release_id);
g_signal_handler_disconnect (child, data->enter_id);
g_signal_handler_disconnect (child, data->motion_id);
g_object_set_data (G_OBJECT (child), "glade-fixed-signal-data", NULL);
......@@ -389,15 +388,12 @@ glade_fixed_connect_child (GladeFixed *fixed,
g_signal_connect
(child, "button-release-event", G_CALLBACK
(GLADE_FIXED_GET_CLASS(fixed)->child_event), fixed);
data->enter_id =
g_signal_connect
(child, "enter-notify-event", G_CALLBACK
(GLADE_FIXED_GET_CLASS(fixed)->child_event), fixed);
data->motion_id =
g_signal_connect
(child, "motion-notify-event", G_CALLBACK
(GLADE_FIXED_GET_CLASS(fixed)->child_event), fixed);
g_object_set_data_full (G_OBJECT (child), "glade-fixed-signal-data",
data, g_free);
}
......@@ -514,10 +510,10 @@ glade_fixed_handle_child_event (GladeFixed *fixed,
GdkEvent *event)
{
GladeCursorType operation;
GdkModifierType event_state = 0;
GtkWidget *fixed_widget, *child_widget;
gint fixed_x, fixed_y, child_x, child_y;
gboolean handled = FALSE, sig_handled;
gboolean button_down;
fixed_widget = GTK_WIDGET (GLADE_WIDGET (fixed)->object);
child_widget = GTK_WIDGET (child->object);
......@@ -542,24 +538,21 @@ glade_fixed_handle_child_event (GladeFixed *fixed,
else
operation = GLADE_CURSOR_DRAG;
gdk_event_get_state (event, &event_state);
switch (event->type)
{
case GDK_ENTER_NOTIFY:
case GDK_MOTION_NOTIFY:
/* Get button state */
if (event->type == GDK_ENTER_NOTIFY)
button_down =
((GdkEventCrossing *)event)->state & GDK_BUTTON1_MASK;
else
button_down =
((GdkEventMotion *)event)->state & GDK_BUTTON1_MASK;
if (fixed->configuring == NULL)
{
glade_cursor_set (((GdkEventAny *)event)->window,
operation);
} else if (fixed->configuring && !button_down)
if (event_state & GDK_SHIFT_MASK)
glade_cursor_set (((GdkEventAny *)event)->window,
operation);
else
glade_cursor_set (((GdkEventAny *)event)->window,
GLADE_CURSOR_SELECTOR);
} else if (fixed->configuring && !(event_state & GDK_BUTTON1_MASK))
{
/* Cancel drags that no longer have mouse down */
glade_cursor_set (((GdkEventAny *)event)->window,
......@@ -567,8 +560,7 @@ glade_fixed_handle_child_event (GladeFixed *fixed,
glade_fixed_cancel_operation (fixed, operation);
handled = TRUE;
} else if (fixed->configuring &&
event->type == GDK_MOTION_NOTIFY)
} else if (fixed->configuring)
{
/* Need to update mouse for configures. */
gtk_widget_get_pointer (fixed_widget,
......@@ -583,7 +575,10 @@ glade_fixed_handle_child_event (GladeFixed *fixed,
gdk_window_get_pointer (GTK_WIDGET (child->object)->window, NULL, NULL, NULL);
break;
case GDK_BUTTON_PRESS:
if (((GdkEventButton *)event)->button == 1)
/* We cant rely on GDK_BUTTON1_MASK since event->state isnt yet updated
* by the current event itself
*/
if (((GdkEventButton *)event)->button == 1 && (event_state & GDK_SHIFT_MASK))
{
fixed->configuring = child;
/* Save widget allocation and pointer pos */
......@@ -600,19 +595,21 @@ glade_fixed_handle_child_event (GladeFixed *fixed,
}
break;
case GDK_BUTTON_RELEASE:
if (((GdkEventButton *)event)->button == 1 &&
fixed->configuring)
if (((GdkEventButton *)event)->button == 1 && fixed->configuring)
{
glade_cursor_set (((GdkEventAny *)event)->window,
operation);
if (event_state & GDK_SHIFT_MASK)
glade_cursor_set (((GdkEventAny *)event)->window,
operation);
else
glade_cursor_set (((GdkEventAny *)event)->window,
GLADE_CURSOR_SELECTOR);
glade_fixed_cancel_operation (fixed, operation);
handled = TRUE;
}
break;
default:
g_debug ("Unhandled event");
break;
}
return handled;
......@@ -768,20 +765,10 @@ glade_fixed_event (GladeWidget *gwidget_fixed,
{
case GDK_BUTTON_PRESS:
case GDK_ENTER_NOTIFY:
case GDK_MOTION_NOTIFY:
case GDK_BUTTON_RELEASE:
gtk_widget_get_pointer (GTK_WIDGET (gwidget_fixed->object),
&fixed->mouse_x, &fixed->mouse_y);
#if 0
g_print ("glade_fixed_event (fixed: %s): Setting mouse pointer to %d %d "
"(event widget %p)\n",
GLADE_WIDGET (fixed)->name,
fixed->mouse_x, fixed->mouse_y, event_widget);
#endif
if (fixed->configuring)
{
return glade_fixed_handle_child_event
......@@ -816,16 +803,17 @@ glade_fixed_event (GladeWidget *gwidget_fixed,
}
}
break;
case GDK_ENTER_NOTIFY:
case GDK_MOTION_NOTIFY:
if (adaptor != NULL)
{
glade_cursor_set (((GdkEventAny *)event)->window,
GLADE_CURSOR_ADD_WIDGET);
handled = TRUE;
}
/* XXX I dont think this line is needed */
else if (GLADE_IS_FIXED (gwidget_fixed->parent) == FALSE)
glade_cursor_set (((GdkEventAny *)event)->window,
glade_cursor_set (((GdkEventAny *)event)->window,
GLADE_CURSOR_SELECTOR);
break;
default:
......
......@@ -6,8 +6,9 @@ VOID:STRING,STRING,STRING
OBJECT:POINTER
OBJECT:OBJECT,UINT
BOOLEAN:STRING
BOOLEAN:OBJECT
BOOLEAN:BOXED
BOOLEAN:OBJECT
BOOLEAN:OBJECT,BOXED
BOOLEAN:OBJECT,POINTER
BOOLEAN:OBJECT,BOOLEAN
BOOLEAN:OBJECT,UINT
......
......@@ -75,7 +75,6 @@ enum
BUTTON_PRESS_EVENT,
BUTTON_RELEASE_EVENT,
MOTION_NOTIFY_EVENT,
ENTER_NOTIFY_EVENT,
ACTION_ACTIVATED,
LAST_SIGNAL
};
......@@ -291,7 +290,12 @@ glade_widget_button_press_event_impl (GladeWidget *gwidget,
glade_util_clear_selection ();
glade_app_selection_set
(gwidget->object, TRUE);
handled = TRUE;
/* Add selection without interrupting event flow
* when shift is down, this allows better behaviour
* for GladeFixed children
*/
handled = !(event->state & GDK_SHIFT_MASK);
}
}
else if (event->button == 3)
......@@ -328,11 +332,6 @@ glade_widget_event_impl (GladeWidget *gwidget,
glade_widget_signals[MOTION_NOTIFY_EVENT], 0,
event, &handled);
break;
case GDK_ENTER_NOTIFY:
g_signal_emit (gwidget,
glade_widget_signals[ENTER_NOTIFY_EVENT], 0,
event, &handled);
break;
case GDK_EXPOSE:
case GDK_CONFIGURE:
glade_util_queue_draw_nodes (((GdkEventExpose*) event)->window);
......@@ -922,8 +921,7 @@ glade_widget_class_init (GladeWidgetClass *klass)
klass->button_press_event = glade_widget_button_press_event_impl;
klass->button_release_event = NULL;
klass->motion_notify_event = NULL;
klass->enter_notify_event = NULL;
g_object_class_install_property
(object_class, PROP_NAME,
g_param_spec_string ("name", _("Name"),
......@@ -1099,7 +1097,7 @@ glade_widget_class_init (GladeWidgetClass *klass)
glade_boolean_handled_accumulator, NULL,
glade_marshal_BOOLEAN__BOXED,
G_TYPE_BOOLEAN, 1,
GDK_TYPE_EVENT);
GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
/**
* GladeWidget::button-relese-event:
......@@ -1114,7 +1112,7 @@ glade_widget_class_init (GladeWidgetClass *klass)
glade_boolean_handled_accumulator, NULL,
glade_marshal_BOOLEAN__BOXED,
G_TYPE_BOOLEAN, 1,
GDK_TYPE_EVENT);
GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
/**
......@@ -1130,23 +1128,8 @@ glade_widget_class_init (GladeWidgetClass *klass)
glade_boolean_handled_accumulator, NULL,
glade_marshal_BOOLEAN__BOXED,
G_TYPE_BOOLEAN, 1,
GDK_TYPE_EVENT);
GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
/**
* GladeWidget::enter-notify-event:
* @gladewidget: the #GladeWidget which received the signal.
* @arg1: the #GdkEvent
*/
glade_widget_signals[ENTER_NOTIFY_EVENT] =
g_signal_new ("enter-notify-event",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GladeWidgetClass, enter_notify_event),
glade_boolean_handled_accumulator, NULL,
glade_marshal_BOOLEAN__BOXED,
G_TYPE_BOOLEAN, 1,
GDK_TYPE_EVENT);
/**
* GladeWidget::action-activated:
......@@ -1660,7 +1643,6 @@ glade_widget_set_adaptor (GladeWidget *widget, GladeWidgetAdaptor *adaptor)
}
}
/* Connects a signal handler to the 'event' signal for a widget and
all its children recursively. We need this to draw the selection
rectangles and to get button press/release events reliably. */
......@@ -1675,7 +1657,16 @@ glade_widget_connect_signal_handlers (GtkWidget *widget_gtk,
if (!g_object_get_data (G_OBJECT (widget_gtk),
GLADE_TAG_EVENT_HANDLER_CONNECTED))
{
g_signal_connect (G_OBJECT (widget_gtk), "expose-event",
/* Make sure we can recieve the kind of events we're
* connecting for
*/
gtk_widget_add_events (widget_gtk,
GDK_POINTER_MOTION_MASK | /* Handle pointer events */
GDK_POINTER_MOTION_HINT_MASK | /* for drag/resize and */
GDK_BUTTON_PRESS_MASK | /* managing selection. */
GDK_BUTTON_RELEASE_MASK);
g_signal_connect (G_OBJECT (widget_gtk), "event",
callback, gwidget);
g_object_set_data (G_OBJECT (widget_gtk),