[gtk/ebassi/gidocgen] gskrenderer: Add property annotations
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/ebassi/gidocgen] gskrenderer: Add property annotations
- Date: Thu, 25 Feb 2021 12:02:45 +0000 (UTC)
commit bd6c5fc2a5dbc12aa93267443de5e550f340ee9b
Author: Matthias Clasen <mclasen redhat com>
Date: Thu Feb 25 06:59:41 2021 -0500
gskrenderer: Add property annotations
Connect properties, getters, and setters with annotations
gsk/gskrenderer.c | 83 +++++++++++++++++++++++++++++++------------------------
1 file changed, 47 insertions(+), 36 deletions(-)
---
diff --git a/gsk/gskrenderer.c b/gsk/gskrenderer.c
index dbbfd28f35..bf40fc1fdb 100644
--- a/gsk/gskrenderer.c
+++ b/gsk/gskrenderer.c
@@ -17,19 +17,19 @@
*/
/**
- * SECTION:GskRenderer
- * @Title: GskRenderer
- * @Short_description: Renders a scene
+ * GskRenderer:
*
- * #GskRenderer is a class that renders a scene graph defined via a
- * tree of #GskRenderNode instances.
+ * `GskRenderer` is a class that renders a scene graph defined via a
+ * tree of [class@Gsk.RenderNode] instances.
*
- * Typically you will use a #GskRenderer instance to repeatedly call
- * gsk_renderer_render() to update the contents of its associated #GdkSurface.
+ * Typically you will use a `GskRenderer` instance to repeatedly call
+ * [method@Gsk.Renderer.render] to update the contents of its associated
+ * [class@Gdk.Surface].
*
- * It is necessary to realize a #GskRenderer instance using gsk_renderer_realize()
- * before calling gsk_renderer_render(), in order to create the appropriate
- * windowing system resources needed to render the scene.
+ * It is necessary to realize a `GskRenderer` instance using
+ * [method@GskRenderer.realize] before calling [method@Gsk.Renderer.render],
+ * in order to create the appropriate windowing system resources needed
+ * to render the scene.
*/
#include "config.h"
@@ -186,6 +186,11 @@ gsk_renderer_class_init (GskRendererClass *klass)
gobject_class->get_property = gsk_renderer_get_property;
gobject_class->dispose = gsk_renderer_dispose;
+ /**
+ * GskRenderer:realized: (attributes org.gtk.Property.get=gsk_renderer_is_realized)
+ *
+ * Whether the renderer has been associated with a surface.
+ */
gsk_renderer_properties[PROP_REALIZED] =
g_param_spec_boolean ("realized",
"Realized",
@@ -193,6 +198,11 @@ gsk_renderer_class_init (GskRendererClass *klass)
FALSE,
G_PARAM_READABLE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
+ /**
+ * GskRenderer:surface: (attributes org.gtk.Property.get=gsk_renderer_get_surface)
+ *
+ * The surface associated with renderer.
+ */
gsk_renderer_properties[PROP_SURFACE] =
g_param_spec_object ("surface",
"Surface",
@@ -213,13 +223,14 @@ gsk_renderer_init (GskRenderer *self)
}
/**
- * gsk_renderer_get_surface:
- * @renderer: a #GskRenderer
+ * gsk_renderer_get_surface: (attributes org.gtk.Method.get_property=surface)
+ * @renderer: a `GskRenderer`
+ *
+ * Retrieves the `GdkSurface` set using gsk_enderer_realize().
*
- * Retrieves the #GdkSurface set using gsk_renderer_realize(). If the renderer
- * has not been realized yet, %NULL will be returned.
+ * If the renderer has not been realized yet, %NULL will be returned.
*
- * Returns: (transfer none) (nullable): a #GdkSurface
+ * Returns: (transfer none) (nullable): a `GdkSurface`
*/
GdkSurface *
gsk_renderer_get_surface (GskRenderer *renderer)
@@ -250,12 +261,12 @@ gsk_renderer_get_root_node (GskRenderer *renderer)
}
/**
- * gsk_renderer_is_realized:
- * @renderer: a #GskRenderer
+ * gsk_renderer_is_realized: (attributes org.gtk.Method.get_property=realized)
+ * @renderer: a `GskRenderer`
*
* Checks whether the @renderer is realized or not.
*
- * Returns: %TRUE if the #GskRenderer was realized, and %FALSE otherwise
+ * Returns: %TRUE if the `GskRenderer` was realized, and %FALSE otherwise
*/
gboolean
gsk_renderer_is_realized (GskRenderer *renderer)
@@ -269,8 +280,8 @@ gsk_renderer_is_realized (GskRenderer *renderer)
/**
* gsk_renderer_realize:
- * @renderer: a #GskRenderer
- * @surface: the #GdkSurface renderer will be used on
+ * @renderer: a `GskRenderer`
+ * @surface: the `GdkSurface` renderer will be used on
* @error: return location for an error
*
* Creates the resources needed by the @renderer to render the scene
@@ -302,7 +313,7 @@ gsk_renderer_realize (GskRenderer *renderer,
/**
* gsk_renderer_unrealize:
- * @renderer: a #GskRenderer
+ * @renderer: a `GskRenderer`
*
* Releases all the resources created by gsk_renderer_realize().
*/
@@ -325,20 +336,20 @@ gsk_renderer_unrealize (GskRenderer *renderer)
/**
* gsk_renderer_render_texture:
- * @renderer: a realized #GskRenderer
- * @root: a #GskRenderNode
+ * @renderer: a realized `GskRenderer`
+ * @root: a `GskRenderNode`
* @viewport: (allow-none): the section to draw or %NULL to use @root's bounds
*
- * Renders the scene graph, described by a tree of #GskRenderNode instances,
- * to a #GdkTexture.
+ * Renders the scene graph, described by a tree of `GskRenderNode` instances,
+ * to a `GdkTexture`.
*
- * The @renderer will acquire a reference on the #GskRenderNode tree while
+ * The @renderer will acquire a reference on the `GskRenderNode` tree while
* the rendering is in progress.
*
- * If you want to apply any transformations to @root, you should put it into a
+ * If you want to apply any transformations to @root, you should put it into a
* transform node and pass that node instead.
*
- * Returns: (transfer full): a #GdkTexture with the rendered contents of @root.
+ * Returns: (transfer full): a `GdkTexture` with the rendered contents of @root.
*/
GdkTexture *
gsk_renderer_render_texture (GskRenderer *renderer,
@@ -388,12 +399,12 @@ gsk_renderer_render_texture (GskRenderer *renderer,
/**
* gsk_renderer_render:
- * @renderer: a #GskRenderer
- * @root: a #GskRenderNode
- * @region: (nullable): the #cairo_region_t that must be redrawn or %NULL
+ * @renderer: a `GskRenderer`
+ * @root: a `GskRenderNode`
+ * @region: (nullable): the `cairo_region_t` that must be redrawn or %NULL
* for the whole window
*
- * Renders the scene graph, described by a tree of #GskRenderNode instances,
+ * Renders the scene graph, described by a tree of `GskRenderNode` instances,
* ensuring that the given @region gets redrawn.
*
* Renderers must ensure that changes of the contents given by the @root
@@ -401,7 +412,7 @@ gsk_renderer_render_texture (GskRenderer *renderer,
* free to not redraw any pixel outside of @region if they can guarantee that
* it didn't change.
*
- * The @renderer will acquire a reference on the #GskRenderNode tree while
+ * The @renderer will acquire a reference on the `GskRenderNode` tree while
* the rendering is in progress.
*/
void
@@ -602,9 +613,9 @@ static struct {
/**
* gsk_renderer_new_for_surface:
- * @surface: a #GdkSurface
+ * @surface: a `GdkSurface`
*
- * Creates an appropriate #GskRenderer instance for the given @surface.
+ * Creates an appropriate `GskRenderer` instance for the given @surface.
*
* If the `GSK_RENDERER` environment variable is set, GSK will
* try that renderer first, before trying the backend-specific
@@ -612,7 +623,7 @@ static struct {
*
* The renderer will be realized before it is returned.
*
- * Returns: (transfer full) (nullable): a #GskRenderer
+ * Returns: (transfer full) (nullable): a `GskRenderer`
*/
GskRenderer *
gsk_renderer_new_for_surface (GdkSurface *surface)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]