From 66031fd00b9a4968e482ea9fdf2edc17d9e30199 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 13 Sep 2021 20:51:42 -0400 Subject: [PATCH] texture: Add error enum --- gdk/gdktexture.c | 2 ++ gdk/gdktexture.h | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/gdk/gdktexture.c b/gdk/gdktexture.c index ec03c72370..4ef7cb5e97 100644 --- a/gdk/gdktexture.c +++ b/gdk/gdktexture.c @@ -47,6 +47,8 @@ #include +G_DEFINE_QUARK (gdk-texture-error-quark, gdk_texture_error) + /* HACK: So we don't need to include any (not-yet-created) GSK or GTK headers */ void gtk_snapshot_append_texture (GdkSnapshot *snapshot, diff --git a/gdk/gdktexture.h b/gdk/gdktexture.h index e080679ca1..927eb11bdf 100644 --- a/gdk/gdktexture.h +++ b/gdk/gdktexture.h @@ -38,6 +38,25 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkTexture, g_object_unref) typedef struct _GdkTextureClass GdkTextureClass; +#define GDK_TEXTURE_ERROR (gdk_texture_error_quark ()) + +GDK_AVAILABLE_IN_4_6 +GQuark gdk_texture_error_quark (void); + +/** + * GdkTextureError: + * @GDK_TEXTURE_ERROR_INSUFFICIENT_MEMORY: Not enough memory to handle this image + * @GDK_TEXTURE_ERROR_CORRUPT_IMAGE: The image data appears corrupted + * @GDK_TEXTURE_ERROR_UNSUPPORTED: The image format is not supported + * + * Possible errors that can be returned by `GdkTexture` constructors. + */ +typedef enum +{ + GDK_TEXTURE_ERROR_INSUFFICIENT_MEMORY, + GDK_TEXTURE_ERROR_CORRUPT_IMAGE, + GDK_TEXTURE_ERROR_UNSUPPORTED, +} GdkTextureError; GDK_AVAILABLE_IN_ALL GType gdk_texture_get_type (void) G_GNUC_CONST;