renderer: Make gsk_renderer_is_realized() public

... and add a property for it.
This commit is contained in:
Benjamin Otte 2019-03-09 13:59:03 +01:00
parent 480d8aec06
commit 658588dfe7
4 changed files with 18 additions and 5 deletions

View File

@ -4,6 +4,7 @@ gsk_renderer_new_for_surface
gsk_renderer_get_surface
gsk_renderer_realize
gsk_renderer_unrealize
gsk_renderer_is_realized
gsk_renderer_render
gsk_renderer_render_texture
<SUBSECTION Standard>

View File

@ -79,7 +79,9 @@ typedef struct
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (GskRenderer, gsk_renderer, G_TYPE_OBJECT)
enum {
PROP_SURFACE = 1,
PROP_0,
PROP_REALIZED,
PROP_SURFACE,
N_PROPS
};
@ -147,6 +149,10 @@ gsk_renderer_get_property (GObject *gobject,
switch (prop_id)
{
case PROP_REALIZED:
g_value_set_boolean (value, priv->is_realized);
break;
case PROP_SURFACE:
g_value_set_object (value, priv->surface);
break;
@ -170,13 +176,19 @@ gsk_renderer_class_init (GskRendererClass *klass)
gobject_class->get_property = gsk_renderer_get_property;
gobject_class->dispose = gsk_renderer_dispose;
gsk_renderer_properties[PROP_REALIZED] =
g_param_spec_boolean ("realized",
"Realized",
"The renderer has been associated with a surface",
FALSE,
G_PARAM_READABLE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
gsk_renderer_properties[PROP_SURFACE] =
g_param_spec_object ("surface",
"Surface",
"The surface associated to the renderer",
GDK_TYPE_SURFACE,
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS);
G_PARAM_READABLE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
g_object_class_install_properties (gobject_class, N_PROPS, gsk_renderer_properties);
}

View File

@ -50,6 +50,8 @@ gboolean gsk_renderer_realize (GskRenderer
GError **error);
GDK_AVAILABLE_IN_ALL
void gsk_renderer_unrealize (GskRenderer *renderer);
GDK_AVAILABLE_IN_ALL
gboolean gsk_renderer_is_realized (GskRenderer *renderer);
GDK_AVAILABLE_IN_ALL
GdkTexture * gsk_renderer_render_texture (GskRenderer *renderer,

View File

@ -51,8 +51,6 @@ struct _GskRendererClass
const cairo_region_t *invalid);
};
gboolean gsk_renderer_is_realized (GskRenderer *renderer);
GskRenderNode * gsk_renderer_get_root_node (GskRenderer *renderer);
GskProfiler * gsk_renderer_get_profiler (GskRenderer *renderer);