diff --git a/configure.ac b/configure.ac index 00633ccfc1..2de98183ee 100644 --- a/configure.ac +++ b/configure.ac @@ -31,7 +31,7 @@ m4_define([gtk_api_version], [3.0]) m4_define([gtk_binary_version], [3.0.0]) # required versions of other packages -m4_define([glib_required_version], [2.25.11]) +m4_define([glib_required_version], [2.25.15]) m4_define([pango_required_version], [1.20]) m4_define([atk_required_version], [1.29.2]) m4_define([cairo_required_version], [1.9.10]) diff --git a/demos/gtk-demo/stock_browser.c b/demos/gtk-demo/stock_browser.c index 73a000304c..3dc71dded1 100644 --- a/demos/gtk-demo/stock_browser.c +++ b/demos/gtk-demo/stock_browser.c @@ -58,18 +58,10 @@ stock_item_info_copy (StockItemInfo *src) return info; } -static GType -stock_item_info_get_type (void) -{ - static GType our_type = 0; - - if (our_type == 0) - our_type = g_boxed_type_register_static ("StockItemInfo", - (GBoxedCopyFunc) stock_item_info_copy, - (GBoxedFreeFunc) stock_item_info_free); - - return our_type; -} +static +G_DEFINE_BOXED_TYPE (StockItemInfo, stock_item_info, + stock_item_info_copy, + stock_item_info_free) typedef struct _StockItemDisplay StockItemDisplay; struct _StockItemDisplay diff --git a/gdk/gdkcolor.c b/gdk/gdkcolor.c index 99307db301..69f70c56e3 100644 --- a/gdk/gdkcolor.c +++ b/gdk/gdkcolor.c @@ -156,17 +156,9 @@ gdk_color_equal (const GdkColor *colora, (colora->blue == colorb->blue)); } -GType -gdk_color_get_type (void) -{ - static GType our_type = 0; - - if (our_type == 0) - our_type = g_boxed_type_register_static (g_intern_static_string ("GdkColor"), - (GBoxedCopyFunc)gdk_color_copy, - (GBoxedFreeFunc)gdk_color_free); - return our_type; -} +G_DEFINE_BOXED_TYPE (GdkColor, gdk_color, + gdk_color_copy, + gdk_color_free) /** * gdk_color_parse: diff --git a/gdk/gdkcursor.c b/gdk/gdkcursor.c index 5d6e0d41ea..dbed4f2e10 100644 --- a/gdk/gdkcursor.c +++ b/gdk/gdkcursor.c @@ -30,17 +30,9 @@ #include "gdkinternals.h" -GType -gdk_cursor_get_type (void) -{ - static GType our_type = 0; - - if (our_type == 0) - our_type = g_boxed_type_register_static (g_intern_static_string ("GdkCursor"), - (GBoxedCopyFunc)gdk_cursor_ref, - (GBoxedFreeFunc)gdk_cursor_unref); - return our_type; -} +G_DEFINE_BOXED_TYPE (GdkCursor, gdk_cursor, + gdk_cursor_ref, + gdk_cursor_unref) /** * gdk_cursor_ref: diff --git a/gdk/gdkevents.c b/gdk/gdkevents.c index fb9373aee1..0eaf7921f4 100644 --- a/gdk/gdkevents.c +++ b/gdk/gdkevents.c @@ -1512,17 +1512,9 @@ gdk_display_set_double_click_distance (GdkDisplay *display, display->double_click_distance = distance; } -GType -gdk_event_get_type (void) -{ - static GType our_type = 0; - - if (our_type == 0) - our_type = g_boxed_type_register_static (g_intern_static_string ("GdkEvent"), - (GBoxedCopyFunc)gdk_event_copy, - (GBoxedFreeFunc)gdk_event_free); - return our_type; -} +G_DEFINE_BOXED_TYPE (GdkEvent, gdk_event, + gdk_event_copy, + gdk_event_free) /** * gdk_setting_get: diff --git a/gdk/gdkrectangle.c b/gdk/gdkrectangle.c index 060bd03ef5..1b282476e5 100644 --- a/gdk/gdkrectangle.c +++ b/gdk/gdkrectangle.c @@ -122,14 +122,6 @@ gdk_rectangle_copy (const GdkRectangle *rectangle) return result; } -GType -gdk_rectangle_get_type (void) -{ - static GType our_type = 0; - - if (our_type == 0) - our_type = g_boxed_type_register_static (g_intern_static_string ("GdkRectangle"), - (GBoxedCopyFunc)gdk_rectangle_copy, - (GBoxedFreeFunc)g_free); - return our_type; -} +G_DEFINE_BOXED_TYPE (GdkRectangle, gdk_rectangle, + gdk_rectangle_copy, + g_free) diff --git a/gtk/gtkiconfactory.c b/gtk/gtkiconfactory.c index fa915ecd0e..8898988630 100644 --- a/gtk/gtkiconfactory.c +++ b/gtk/gtkiconfactory.c @@ -1290,18 +1290,9 @@ gtk_icon_set_unref (GtkIconSet *icon_set) } } -GType -gtk_icon_set_get_type (void) -{ - static GType our_type = 0; - - if (our_type == 0) - our_type = g_boxed_type_register_static (I_("GtkIconSet"), - (GBoxedCopyFunc) gtk_icon_set_ref, - (GBoxedFreeFunc) gtk_icon_set_unref); - - return our_type; -} +G_DEFINE_BOXED_TYPE (GtkIconSet, gtk_icon_set, + gtk_icon_set_ref, + gtk_icon_set_unref) /** * gtk_icon_set_copy: @@ -1972,18 +1963,9 @@ gtk_icon_source_free (GtkIconSource *source) g_free (source); } -GType -gtk_icon_source_get_type (void) -{ - static GType our_type = 0; - - if (our_type == 0) - our_type = g_boxed_type_register_static (I_("GtkIconSource"), - (GBoxedCopyFunc) gtk_icon_source_copy, - (GBoxedFreeFunc) gtk_icon_source_free); - - return our_type; -} +G_DEFINE_BOXED_TYPE (GtkIconSource, gtk_icon_source, + gtk_icon_source_copy, + gtk_icon_source_free) static void icon_source_clear (GtkIconSource *source) diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c index fae73d7fa9..9b84eccafd 100644 --- a/gtk/gtkicontheme.c +++ b/gtk/gtkicontheme.c @@ -2598,19 +2598,10 @@ icon_data_free (GtkIconData *icon_data) /* * GtkIconInfo */ -GType -gtk_icon_info_get_type (void) -{ - static GType our_type = 0; - - if (our_type == 0) - our_type = g_boxed_type_register_static (I_("GtkIconInfo"), - (GBoxedCopyFunc) gtk_icon_info_copy, - (GBoxedFreeFunc) gtk_icon_info_free); - - return our_type; -} +G_DEFINE_BOXED_TYPE (GtkIconInfo, gtk_icon_info, + gtk_icon_info_copy, + gtk_icon_info_free) static GtkIconInfo * icon_info_new (void) diff --git a/gtk/gtkpapersize.c b/gtk/gtkpapersize.c index bc81d7b271..3d81fd9f35 100644 --- a/gtk/gtkpapersize.c +++ b/gtk/gtkpapersize.c @@ -47,17 +47,9 @@ struct _GtkPaperSize gboolean is_custom; }; -GType -gtk_paper_size_get_type (void) -{ - static GType our_type = 0; - - if (our_type == 0) - our_type = g_boxed_type_register_static (I_("GtkPaperSize"), - (GBoxedCopyFunc)gtk_paper_size_copy, - (GBoxedFreeFunc)gtk_paper_size_free); - return our_type; -} +G_DEFINE_BOXED_TYPE (GtkPaperSize, gtk_paper_size, + gtk_paper_size_copy, + gtk_paper_size_free) static const PaperInfo * lookup_paper_info (const gchar *name) diff --git a/gtk/gtkrecentmanager.c b/gtk/gtkrecentmanager.c index cabc0dd91a..6e05a05336 100644 --- a/gtk/gtkrecentmanager.c +++ b/gtk/gtkrecentmanager.c @@ -1367,17 +1367,9 @@ gtk_recent_manager_clamp_to_age (GtkRecentManager *manager, * GtkRecentInfo * *****************/ -GType -gtk_recent_info_get_type (void) -{ - static GType info_type = 0; - - if (!info_type) - info_type = g_boxed_type_register_static (I_("GtkRecentInfo"), - (GBoxedCopyFunc) gtk_recent_info_ref, - (GBoxedFreeFunc) gtk_recent_info_unref); - return info_type; -} +G_DEFINE_BOXED_TYPE (GtkRecentInfo, gtk_recent_info, + gtk_recent_info_ref, + gtk_recent_info_unref) static GtkRecentInfo * gtk_recent_info_new (const gchar *uri) diff --git a/gtk/gtkselection.c b/gtk/gtkselection.c index 5d6ad033c9..2e34884596 100644 --- a/gtk/gtkselection.c +++ b/gtk/gtkselection.c @@ -3110,31 +3110,13 @@ gtk_selection_data_free (GtkSelectionData *data) g_slice_free (GtkSelectionData, data); } -GType -gtk_selection_data_get_type (void) -{ - static GType our_type = 0; - - if (our_type == 0) - our_type = g_boxed_type_register_static (I_("GtkSelectionData"), - (GBoxedCopyFunc) gtk_selection_data_copy, - (GBoxedFreeFunc) gtk_selection_data_free); +G_DEFINE_BOXED_TYPE (GtkSelectionData, gtk_selection_data, + gtk_selection_data_copy, + gtk_selection_data_free) - return our_type; -} - -GType -gtk_target_list_get_type (void) -{ - static GType our_type = 0; - - if (our_type == 0) - our_type = g_boxed_type_register_static (I_("GtkTargetList"), - (GBoxedCopyFunc) gtk_target_list_ref, - (GBoxedFreeFunc) gtk_target_list_unref); - - return our_type; -} +G_DEFINE_BOXED_TYPE (GtkTargetList, gtk_target_list, + gtk_target_list_ref, + gtk_target_list_unref) static int gtk_selection_bytes_per_item (gint format) diff --git a/gtk/gtkstyle.c b/gtk/gtkstyle.c index d7d2ba46a7..f836ab101e 100644 --- a/gtk/gtkstyle.c +++ b/gtk/gtkstyle.c @@ -5667,18 +5667,9 @@ gtk_border_free (GtkBorder *border) g_slice_free (GtkBorder, border); } -GType -gtk_border_get_type (void) -{ - static GType our_type = 0; - - if (our_type == 0) - our_type = g_boxed_type_register_static (I_("GtkBorder"), - (GBoxedCopyFunc) gtk_border_copy, - (GBoxedFreeFunc) gtk_border_free); - - return our_type; -} +G_DEFINE_BOXED_TYPE (GtkBorder, gtk_border, + gtk_border_copy, + gtk_border_free) typedef struct _CursorInfo CursorInfo; diff --git a/gtk/gtktextiter.c b/gtk/gtktextiter.c index a4cb91b07b..9daecfc6b6 100644 --- a/gtk/gtktextiter.c +++ b/gtk/gtktextiter.c @@ -444,18 +444,9 @@ gtk_text_iter_free (GtkTextIter *iter) g_slice_free (GtkTextIter, iter); } -GType -gtk_text_iter_get_type (void) -{ - static GType our_type = 0; - - if (our_type == 0) - our_type = g_boxed_type_register_static (I_("GtkTextIter"), - (GBoxedCopyFunc) gtk_text_iter_copy, - (GBoxedFreeFunc) gtk_text_iter_free); - - return our_type; -} +G_DEFINE_BOXED_TYPE (GtkTextIter, gtk_text_iter, + gtk_text_iter_copy, + gtk_text_iter_free) GtkTextLineSegment* _gtk_text_iter_get_indexable_segment (const GtkTextIter *iter) diff --git a/gtk/gtktexttag.c b/gtk/gtktexttag.c index 25928ce0d9..a77047c4be 100644 --- a/gtk/gtktexttag.c +++ b/gtk/gtktexttag.c @@ -1883,18 +1883,9 @@ gtk_text_attributes_copy (GtkTextAttributes *src) return dest; } -GType -gtk_text_attributes_get_type (void) -{ - static GType our_type = 0; - - if (our_type == 0) - our_type = g_boxed_type_register_static (I_("GtkTextAttributes"), - (GBoxedCopyFunc) gtk_text_attributes_ref, - (GBoxedFreeFunc) gtk_text_attributes_unref); - - return our_type; -} +G_DEFINE_BOXED_TYPE (GtkTextAttributes, gtk_text_attributes, + gtk_text_attributes_ref, + gtk_text_attributes_unref) /** * gtk_text_attributes_copy_values: diff --git a/gtk/gtktreemodel.c b/gtk/gtktreemodel.c index 8782c631a3..15b978f363 100644 --- a/gtk/gtktreemodel.c +++ b/gtk/gtktreemodel.c @@ -684,18 +684,9 @@ gtk_tree_path_copy (const GtkTreePath *path) return retval; } -GType -gtk_tree_path_get_type (void) -{ - static GType our_type = 0; - - if (our_type == 0) - our_type = g_boxed_type_register_static (I_("GtkTreePath"), - (GBoxedCopyFunc) gtk_tree_path_copy, - (GBoxedFreeFunc) gtk_tree_path_free); - - return our_type; -} +G_DEFINE_BOXED_TYPE (GtkTreePath, gtk_tree_path, + gtk_tree_path_copy, + gtk_tree_path_free) /** * gtk_tree_path_compare: @@ -913,18 +904,9 @@ gtk_tree_iter_free (GtkTreeIter *iter) g_slice_free (GtkTreeIter, iter); } -GType -gtk_tree_iter_get_type (void) -{ - static GType our_type = 0; - - if (our_type == 0) - our_type = g_boxed_type_register_static (I_("GtkTreeIter"), - (GBoxedCopyFunc) gtk_tree_iter_copy, - (GBoxedFreeFunc) gtk_tree_iter_free); - - return our_type; -} +G_DEFINE_BOXED_TYPE (GtkTreeIter, gtk_tree_iter, + gtk_tree_iter_copy, + gtk_tree_iter_free) /** * gtk_tree_model_get_flags: @@ -1666,19 +1648,9 @@ static void gtk_tree_row_reference_unref_path (GtkTreePath *path, gint depth); -GType -gtk_tree_row_reference_get_type (void) -{ - static GType our_type = 0; - - if (our_type == 0) - our_type = g_boxed_type_register_static (I_("GtkTreeRowReference"), - (GBoxedCopyFunc) gtk_tree_row_reference_copy, - (GBoxedFreeFunc) gtk_tree_row_reference_free); - - return our_type; -} - +G_DEFINE_BOXED_TYPE (GtkTreeRowReference, gtk_tree_row_reference, + gtk_tree_row_reference_copy, + gtk_tree_row_reference_free) struct _GtkTreeRowReference { diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index a859bf2f3b..62ad959f3b 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -10291,18 +10291,9 @@ gtk_requisition_free (GtkRequisition *requisition) g_slice_free (GtkRequisition, requisition); } -GType -gtk_requisition_get_type (void) -{ - static GType our_type = 0; - - if (our_type == 0) - our_type = g_boxed_type_register_static (I_("GtkRequisition"), - (GBoxedCopyFunc) gtk_requisition_copy, - (GBoxedFreeFunc) gtk_requisition_free); - - return our_type; -} +G_DEFINE_BOXED_TYPE (GtkRequisition, gtk_requisition, + gtk_requisition_copy, + gtk_requisition_free) /** * gtk_widget_get_accessible: