[gtk/frameclock-property] surface: Add a frame-clock property
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/frameclock-property] surface: Add a frame-clock property
- Date: Mon, 29 Apr 2019 18:50:37 +0000 (UTC)
commit 282cfc528e65e65b0682d5d01f803b11207b342b
Author: Matthias Clasen <mclasen redhat com>
Date: Mon Apr 22 01:14:28 2019 +0000
surface: Add a frame-clock property
Now that GdkSurface has properties, it makes
sense to turn the frame clock into one too.
This will make it easier to reshuffle some
of the surface constructors later.
gdk/gdksurface.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
---
diff --git a/gdk/gdksurface.c b/gdk/gdksurface.c
index 552d5e8bae..2a3f0c1d23 100644
--- a/gdk/gdksurface.c
+++ b/gdk/gdksurface.c
@@ -107,6 +107,7 @@ enum {
PROP_0,
PROP_CURSOR,
PROP_DISPLAY,
+ PROP_FRAME_CLOCK,
PROP_STATE,
PROP_MAPPED,
LAST_PROP
@@ -268,6 +269,13 @@ gdk_surface_class_init (GdkSurfaceClass *klass)
GDK_TYPE_DISPLAY,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
+ properties[PROP_FRAME_CLOCK] =
+ g_param_spec_object ("frame-clock",
+ P_("Frame Clock"),
+ P_("Frame Clock"),
+ GDK_TYPE_FRAME_CLOCK,
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
+
properties[PROP_STATE] =
g_param_spec_flags ("state",
P_("State"),
@@ -462,6 +470,10 @@ gdk_surface_set_property (GObject *object,
g_assert (surface->display != NULL);
break;
+ case PROP_FRAME_CLOCK:
+ gdk_surface_set_frame_clock (surface, GDK_FRAME_CLOCK (g_value_get_object (value));
+ break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -486,6 +498,10 @@ gdk_surface_get_property (GObject *object,
g_value_set_object (value, surface->display);
break;
+ case PROP_FRAME_CLOCK:
+ g_value_set_object (value, surface->frame_clock);
+ break;
+
case PROP_STATE:
g_value_set_flags (value, surface->state);
break;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]