From 3bed5334bfcab480ae31ffc1761e20253b9d58aa Mon Sep 17 00:00:00 2001 From: Maximiliano Sandoval R Date: Thu, 6 Jan 2022 17:36:12 +0100 Subject: [PATCH 1/4] docs: Improve docs for gdktexture.c --- gdk/gdktexture.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/gdk/gdktexture.c b/gdk/gdktexture.c index 2cf33fda5c..9a0e6c7d87 100644 --- a/gdk/gdktexture.c +++ b/gdk/gdktexture.c @@ -25,14 +25,14 @@ * multiple frames, and will be used for a long time. * * There are various ways to create `GdkTexture` objects from a - * `GdkPixbuf`, or a Cairo surface, or other pixel data. + * [class@GdkPixbuf.Pixbuf], or a Cairo surface, or other pixel data. * * The ownership of the pixel data is transferred to the `GdkTexture` * instance; you can only make a copy of it, via [method@Gdk.Texture.download]. * * `GdkTexture` is an immutable object: That means you cannot change * anything about it other than increasing the reference count via - * g_object_ref(). + * [method@GObject.Object.ref]. */ #include "config.h" @@ -346,7 +346,7 @@ gdk_texture_init (GdkTexture *self) * * Creates a new texture object representing the surface. * - * @surface must be an image surface with format CAIRO_FORMAT_ARGB32. + * @surface must be an image surface with format `CAIRO_FORMAT_ARGB32`. * * Returns: a new `GdkTexture` */ @@ -384,7 +384,7 @@ gdk_texture_new_for_surface (cairo_surface_t *surface) * Creates a new texture object representing the `GdkPixbuf`. * * This function is threadsafe, so that you can e.g. use GTask - * and g_task_run_in_thread() to avoid blocking the main thread + * and [method@Gio.Task.run_in_thread] to avoid blocking the main thread * while loading a big image. * * Returns: a new `GdkTexture` @@ -430,7 +430,7 @@ gdk_texture_new_for_pixbuf (GdkPixbuf *pixbuf) * [ctor@Gdk.Texture.new_from_file] to load it. * * This function is threadsafe, so that you can e.g. use GTask - * and g_task_run_in_thread() to avoid blocking the main thread + * and [method@Gio.Task.run_in_thread] to avoid blocking the main thread * while loading a big image. * * Return value: A newly-created `GdkTexture` @@ -472,7 +472,7 @@ gdk_texture_new_from_resource (const char *resource_path) * If %NULL is returned, then @error will be set. * * This function is threadsafe, so that you can e.g. use GTask - * and g_task_run_in_thread() to avoid blocking the main thread + * and [method@Gio.Task.run_in_thread] to avoid blocking the main thread * while loading a big image. * * Return value: A newly-created `GdkTexture` @@ -565,7 +565,7 @@ gdk_texture_new_from_bytes_pixbuf (GBytes *bytes, * If %NULL is returned, then @error will be set. * * This function is threadsafe, so that you can e.g. use GTask - * and g_task_run_in_thread() to avoid blocking the main thread + * and [method@Gio.Task.run_in_thread] to avoid blocking the main thread * while loading a big image. * * Return value: A newly-created `GdkTexture` @@ -611,7 +611,7 @@ gdk_texture_new_from_bytes (GBytes *bytes, * If %NULL is returned, then @error will be set. * * This function is threadsafe, so that you can e.g. use GTask - * and g_task_run_in_thread() to avoid blocking the main thread + * and [method@Gio.Task.run_in_thread] to avoid blocking the main thread * while loading a big image. * * Return value: A newly-created `GdkTexture` @@ -796,7 +796,7 @@ gdk_texture_get_render_data (GdkTexture *self, * * This is a utility function intended for debugging and testing. * If you want more control over formats, proper error handling or - * want to store to a `GFile` or other location, you might want to + * want to store to a [iface@Gio.File] or other location, you might want to * use [method@Gdk.Texture.save_to_png_bytes] or look into the * gdk-pixbuf library. * From ef9dbf73cc8551d85e01cb20100bef63a33ae261 Mon Sep 17 00:00:00 2001 From: Maximiliano Sandoval R Date: Thu, 6 Jan 2022 17:39:06 +0100 Subject: [PATCH 2/4] gir: Add type annotations for {GL,Memory}Texture --- gdk/gdkgltexture.c | 3 ++- gdk/gdkmemorytexture.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/gdk/gdkgltexture.c b/gdk/gdkgltexture.c index a1c75a62fd..40ccaf2add 100644 --- a/gdk/gdkgltexture.c +++ b/gdk/gdkgltexture.c @@ -383,7 +383,8 @@ gdk_gl_texture_determine_format (GdkGLTexture *self) * which will happen when the GdkTexture object is finalized, or due to * an explicit call of [method@Gdk.GLTexture.release]. * - * Return value: (transfer full): A newly-created `GdkTexture` + * Return value: (transfer full) (type GdkGLTexture): A newly-created + * `GdkTexture` */ GdkTexture * gdk_gl_texture_new (GdkGLContext *context, diff --git a/gdk/gdkmemorytexture.c b/gdk/gdkmemorytexture.c index 71df887b0b..68fdff616d 100644 --- a/gdk/gdkmemorytexture.c +++ b/gdk/gdkmemorytexture.c @@ -136,7 +136,7 @@ gdk_memory_sanitize (GBytes *bytes, * The `GBytes` must contain @stride x @height pixels * in the given format. * - * Returns: A newly-created `GdkTexture` + * Returns: (type GdkMemoryTexture): A newly-created `GdkTexture` */ GdkTexture * gdk_memory_texture_new (int width, From ce2c4f0f086353cea815e212affd208431671a46 Mon Sep 17 00:00:00 2001 From: Maximiliano Sandoval R Date: Thu, 6 Jan 2022 17:40:26 +0100 Subject: [PATCH 3/4] docs: Improve docs for MemoryTexture --- gdk/gdkmemorytexture.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdk/gdkmemorytexture.c b/gdk/gdkmemorytexture.c index 68fdff616d..c9aecd5cea 100644 --- a/gdk/gdkmemorytexture.c +++ b/gdk/gdkmemorytexture.c @@ -133,7 +133,7 @@ gdk_memory_sanitize (GBytes *bytes, * * Creates a new texture for a blob of image data. * - * The `GBytes` must contain @stride x @height pixels + * The `GBytes` must contain @stride × @height pixels * in the given format. * * Returns: (type GdkMemoryTexture): A newly-created `GdkTexture` From ee71effe98a2ef8a5da0cc78f0141c6fe9aca940 Mon Sep 17 00:00:00 2001 From: Maximiliano Sandoval R Date: Thu, 6 Jan 2022 17:42:17 +0100 Subject: [PATCH 4/4] docs: State that Textures are thread safe gobjects --- gdk/gdktexture.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdk/gdktexture.c b/gdk/gdktexture.c index 9a0e6c7d87..c8d7730c6d 100644 --- a/gdk/gdktexture.c +++ b/gdk/gdktexture.c @@ -32,7 +32,7 @@ * * `GdkTexture` is an immutable object: That means you cannot change * anything about it other than increasing the reference count via - * [method@GObject.Object.ref]. + * [method@GObject.Object.ref], and consequently, it is a thread-safe object. */ #include "config.h"