summaryrefslogtreecommitdiff
path: root/gdk
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2018-07-15 08:48:46 -0400
committerMatthias Clasen <mclasen@redhat.com>2018-07-15 13:13:07 -0400
commitda3aaf39b92a07cee16d94061ab5793e687fa350 (patch)
treeefd1a2a6b36b2637a62c02cbcb8cbf0eabc79b89 /gdk
parenta8926c9d873ce968353a2eb1d3930c4f1ac79c94 (diff)
downloadgtk+-da3aaf39b92a07cee16d94061ab5793e687fa350.tar.gz
gdk: Drop expose events
Replace expose events with a GdkSurface::expose signal. This is part of the move to use events only for input.
Diffstat (limited to 'gdk')
-rw-r--r--gdk/gdkevents.c12
-rw-r--r--gdk/gdkevents.h4
-rw-r--r--gdk/gdkeventsprivate.h19
-rw-r--r--gdk/gdksurface.c25
4 files changed, 15 insertions, 45 deletions
diff --git a/gdk/gdkevents.c b/gdk/gdkevents.c
index d97b05771b..9ccde4f32b 100644
--- a/gdk/gdkevents.c
+++ b/gdk/gdkevents.c
@@ -646,11 +646,6 @@ gdk_event_copy (const GdkEvent *event)
g_object_ref (event->dnd.drop);
break;
- case GDK_EXPOSE:
- if (event->expose.region)
- new_event->expose.region = cairo_region_copy (event->expose.region);
- break;
-
case GDK_BUTTON_PRESS:
case GDK_BUTTON_RELEASE:
if (event->button.axes)
@@ -730,11 +725,6 @@ gdk_event_finalize (GObject *object)
g_free (event->touch.axes);
break;
- case GDK_EXPOSE:
- if (event->expose.region)
- cairo_region_destroy (event->expose.region);
- break;
-
case GDK_MOTION_NOTIFY:
g_clear_object (&event->motion.tool);
g_free (event->motion.axes);
@@ -831,7 +821,6 @@ gdk_event_get_time (const GdkEvent *event)
case GDK_NOTHING:
case GDK_DELETE:
case GDK_DESTROY:
- case GDK_EXPOSE:
case GDK_MAP:
case GDK_UNMAP:
case GDK_GRAB_BROKEN:
@@ -906,7 +895,6 @@ gdk_event_get_state (const GdkEvent *event,
case GDK_NOTHING:
case GDK_DELETE:
case GDK_DESTROY:
- case GDK_EXPOSE:
case GDK_MAP:
case GDK_UNMAP:
case GDK_GRAB_BROKEN:
diff --git a/gdk/gdkevents.h b/gdk/gdkevents.h
index b1ef21fc5f..a39d036d04 100644
--- a/gdk/gdkevents.h
+++ b/gdk/gdkevents.h
@@ -104,7 +104,6 @@ G_BEGIN_DECLS
typedef struct _GdkEventAny GdkEventAny;
-typedef struct _GdkEventExpose GdkEventExpose;
typedef struct _GdkEventMotion GdkEventMotion;
typedef struct _GdkEventButton GdkEventButton;
typedef struct _GdkEventTouch GdkEventTouch;
@@ -144,8 +143,6 @@ typedef void (*GdkEventFunc) (GdkEvent *event,
* hidden or destroyed, usually when the user clicks on a special icon in the
* title bar.
* @GDK_DESTROY: the surface has been destroyed.
- * @GDK_EXPOSE: all or part of the surface has become visible and needs to be
- * redrawn.
* @GDK_MOTION_NOTIFY: the pointer (usually a mouse) has moved.
* @GDK_BUTTON_PRESS: a mouse button has been pressed.
* @GDK_BUTTON_RELEASE: a mouse button has been released.
@@ -203,7 +200,6 @@ typedef enum
GDK_NOTHING,
GDK_DELETE,
GDK_DESTROY,
- GDK_EXPOSE,
GDK_MOTION_NOTIFY,
GDK_BUTTON_PRESS,
GDK_BUTTON_RELEASE,
diff --git a/gdk/gdkeventsprivate.h b/gdk/gdkeventsprivate.h
index ee3beace23..21f3518fbd 100644
--- a/gdk/gdkeventsprivate.h
+++ b/gdk/gdkeventsprivate.h
@@ -64,23 +64,6 @@ struct _GdkEventAny
};
/*
- * GdkEventExpose:
- * @type: the type of the event (%GDK_EXPOSE)
- * @surface: the surface which received the event.
- * @send_event: %TRUE if the event was sent explicitly.
- * @area: bounding box of @region.
- * @region: the region that needs to be redrawn.
- *
- * Generated when all or part of a surface becomes visible and needs to be
- * redrawn.
- */
-struct _GdkEventExpose
-{
- GdkEventAny any;
- cairo_region_t *region;
-};
-
-/*
* GdkEventMotion:
* @type: the type of the event.
* @surface: the surface which received the event.
@@ -573,7 +556,6 @@ struct _GdkEventPadGroupMode {
* GdkEvent:
* @type: the #GdkEventType
* @any: a #GdkEventAny
- * @expose: a #GdkEventExpose
* @motion: a #GdkEventMotion
* @button: a #GdkEventButton
* @touch: a #GdkEventTouch
@@ -624,7 +606,6 @@ struct _GdkEventPadGroupMode {
union _GdkEvent
{
GdkEventAny any;
- GdkEventExpose expose;
GdkEventMotion motion;
GdkEventButton button;
GdkEventTouch touch;
diff --git a/gdk/gdksurface.c b/gdk/gdksurface.c
index c96f45e82f..622f1d5eea 100644
--- a/gdk/gdksurface.c
+++ b/gdk/gdksurface.c
@@ -98,6 +98,7 @@
enum {
MOVED_TO_RECT,
SIZE_CHANGED,
+ RENDER,
LAST_SIGNAL
};
@@ -324,6 +325,18 @@ gdk_surface_class_init (GdkSurfaceClass *klass)
2,
G_TYPE_INT,
G_TYPE_INT);
+
+ signals[RENDER] =
+ g_signal_new (g_intern_static_string ("render"),
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ 0,
+ g_signal_accumulator_true_handled,
+ NULL,
+ NULL,
+ G_TYPE_BOOLEAN,
+ 1,
+ CAIRO_GOBJECT_TYPE_REGION);
}
static void
@@ -1631,20 +1644,13 @@ static void
gdk_surface_process_updates_recurse (GdkSurface *surface,
cairo_region_t *expose_region)
{
- GdkEvent *event;
+ gboolean handled;
if (surface->destroyed)
return;
/* Paint the surface before the children, clipped to the surface region */
-
- event = gdk_event_new (GDK_EXPOSE);
- event->any.surface = g_object_ref (surface);
- event->any.send_event = FALSE;
- event->expose.region = cairo_region_reference (expose_region);
-
- _gdk_event_emit (event);
- g_object_unref (event);
+ g_signal_emit (surface, signals[RENDER], 0, expose_region, &handled);
}
/* Process and remove any invalid area on the native surface by creating
@@ -3937,7 +3943,6 @@ _gdk_make_event (GdkSurface *surface,
case GDK_UNMAP:
case GDK_DELETE:
case GDK_DESTROY:
- case GDK_EXPOSE:
default:
break;
}