gtk: register GtkStockItem as boxed type

This commit is contained in:
Daemonratte 2026-05-10 12:29:26 +02:00
commit 71e0fbadc5
3 changed files with 17 additions and 0 deletions

View file

@ -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

View file

@ -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 */

View file

@ -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);