From 71e0fbadc54c82a05133434a37e2fc2bd659824c Mon Sep 17 00:00:00 2001 From: Daemonratte Date: Sun, 10 May 2026 12:29:26 +0200 Subject: [PATCH] gtk: register GtkStockItem as boxed type --- gtk/gtk.symbols | 1 + gtk/gtkstock.c | 13 +++++++++++++ gtk/gtkstock.h | 3 +++ 3 files changed, 17 insertions(+) diff --git a/gtk/gtk.symbols b/gtk/gtk.symbols index a264df87f..0a3b6b71f 100644 --- a/gtk/gtk.symbols +++ b/gtk/gtk.symbols @@ -3949,6 +3949,7 @@ gtk_statusbar_set_has_resize_grip #if IN_FILE(__GTK_STOCK_C__) gtk_stock_add gtk_stock_add_static +gtk_stock_item_get_type G_GNUC_CONST gtk_stock_item_copy gtk_stock_item_free gtk_stock_list_ids diff --git a/gtk/gtkstock.c b/gtk/gtkstock.c index 72c332c0b..a8156dbb3 100644 --- a/gtk/gtkstock.c +++ b/gtk/gtkstock.c @@ -308,6 +308,19 @@ gtk_stock_item_free (GtkStockItem *item) g_free (item); } +GType +gtk_stock_item_get_type (void) +{ + static GType our_type = 0; + + if (our_type == 0) + our_type = g_boxed_type_register_static (I_("GtkStockItem"), + (GBoxedCopyFunc) gtk_stock_item_copy, + (GBoxedFreeFunc) gtk_stock_item_free); + + return our_type; +} + static const GtkStockItem builtin_items [] = { /* KEEP IN SYNC with gtkiconfactory.c stock icons, when appropriate */ diff --git a/gtk/gtkstock.h b/gtk/gtkstock.h index ad53fa685..c67e97538 100644 --- a/gtk/gtkstock.h +++ b/gtk/gtkstock.h @@ -37,6 +37,8 @@ G_BEGIN_DECLS +#define GTK_TYPE_STOCK_ITEM (gtk_stock_item_get_type ()) + typedef struct _GtkStockItem GtkStockItem; struct _GtkStockItem @@ -60,6 +62,7 @@ gboolean gtk_stock_lookup (const gchar *stock_id, */ GSList* gtk_stock_list_ids (void); +GType gtk_stock_item_get_type (void) G_GNUC_CONST; GtkStockItem *gtk_stock_item_copy (const GtkStockItem *item); void gtk_stock_item_free (GtkStockItem *item);