Commit 1e1131c9 authored by Nicola Fontana's avatar Nicola Fontana Committed by Javier Jardón

Do not use static GTypeInfo and GInterfaceInfo

Either g_type_register_static_simple (used by G_DEFINE_TYPE_EXTENDED)
and G_IMPLEMENT_INTERFACE use automatic variables for GTypeInfo and
GInterfaceInfo structs, while tutorials and source code often use
static variables. This commit consistently adopts the former method.

https://bugzilla.gnome.org/show_bug.cgi?id=600158
parent e41f4e85
......@@ -11154,7 +11154,7 @@ tictactoe_get_type (void)
if (!ttt_type)
{
static const GTypeInfo ttt_info =
const GTypeInfo ttt_info =
{
sizeof (TictactoeClass),
NULL, /* base_init */
......@@ -14606,7 +14606,7 @@ tictactoe_get_type (void)
if (!ttt_type)
{
static const GTypeInfo ttt_info =
const GTypeInfo ttt_info =
{
sizeof (TictactoeClass),
NULL, /* base_init */
......@@ -14963,7 +14963,7 @@ gtk_dial_get_type ()
if (!dial_type)
{
static const GTypeInfo dial_info =
const GTypeInfo dial_info =
{
sizeof (GtkDialClass),
NULL,
......
......@@ -65,7 +65,7 @@ gtk_dial_get_type ()
if (!dial_type)
{
static const GTypeInfo dial_info =
const GTypeInfo dial_info =
{
sizeof (GtkDialClass),
NULL,
......
......@@ -40,7 +40,7 @@ tictactoe_get_type (void)
if (!ttt_type)
{
static const GTypeInfo ttt_info =
const GTypeInfo ttt_info =
{
sizeof (TictactoeClass),
NULL, /* base_init */
......
......@@ -49,7 +49,7 @@ gdk_pixbuf_ani_anim_get_type (void)
static GType object_type = 0;
if (!object_type) {
static const GTypeInfo object_info = {
const GTypeInfo object_info = {
sizeof (GdkPixbufAniAnimClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
......@@ -191,7 +191,7 @@ gdk_pixbuf_ani_anim_iter_get_type (void)
static GType object_type = 0;
if (!object_type) {
static const GTypeInfo object_info = {
const GTypeInfo object_info = {
sizeof (GdkPixbufAniAnimIterClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
......
......@@ -46,7 +46,7 @@ gdk_pixbuf_gdip_anim_get_type (void)
static GType object_type = 0;
if (!object_type) {
static const GTypeInfo object_info = {
const GTypeInfo object_info = {
sizeof (GdkPixbufGdipAnimClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
......@@ -197,7 +197,7 @@ gdk_pixbuf_gdip_anim_iter_get_type (void)
static GType object_type = 0;
if (!object_type) {
static const GTypeInfo object_info = {
const GTypeInfo object_info = {
sizeof (GdkPixbufGdipAnimIterClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
......
......@@ -50,7 +50,7 @@ gdk_pixbuf_gif_anim_get_type (void)
static GType object_type = 0;
if (!object_type) {
static const GTypeInfo object_info = {
const GTypeInfo object_info = {
sizeof (GdkPixbufGifAnimClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
......@@ -206,7 +206,7 @@ gdk_pixbuf_gif_anim_iter_get_type (void)
static GType object_type = 0;
if (!object_type) {
static const GTypeInfo object_info = {
const GTypeInfo object_info = {
sizeof (GdkPixbufGifAnimIterClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
......
......@@ -73,7 +73,7 @@ gdk_colormap_get_type (void)
static GType object_type = 0;
if (!object_type) {
static const GTypeInfo object_info =
const GTypeInfo object_info =
{
sizeof (GdkColormapClass),
(GBaseInitFunc) NULL,
......
......@@ -140,7 +140,7 @@ gdk_display_dfb_get_type (void)
if (!object_type)
{
static const GTypeInfo object_info =
const GTypeInfo object_info =
{
sizeof (GdkDisplayDFBClass),
(GBaseInitFunc) NULL,
......
......@@ -123,7 +123,7 @@ gdk_drag_context_get_type (void)
if (!object_type)
{
static const GTypeInfo object_info =
const GTypeInfo object_info =
{
sizeof (GdkDragContextClass),
(GBaseInitFunc) NULL,
......
......@@ -1568,7 +1568,7 @@ gdk_drawable_impl_directfb_get_type (void)
if (!object_type)
{
static const GTypeInfo object_info =
const GTypeInfo object_info =
{
sizeof (GdkDrawableImplDirectFBClass),
(GBaseInitFunc) NULL,
......
......@@ -71,7 +71,7 @@ gdk_gc_directfb_get_type (void)
if (!object_type)
{
static const GTypeInfo object_info =
const GTypeInfo object_info =
{
sizeof (GdkGCDirectFBClass),
(GBaseInitFunc) NULL,
......
......@@ -58,7 +58,7 @@ gdk_image_get_type (void)
if (!object_type)
{
static const GTypeInfo object_info =
const GTypeInfo object_info =
{
sizeof (GdkImageClass),
(GBaseInitFunc) NULL,
......
......@@ -94,7 +94,7 @@ gdk_device_get_type (void)
if (!object_type)
{
static const GTypeInfo object_info =
const GTypeInfo object_info =
{
sizeof (GdkDeviceClass),
(GBaseInitFunc) NULL,
......
......@@ -61,7 +61,7 @@ gdk_pixmap_impl_directfb_get_type (void)
if (!object_type)
{
static const GTypeInfo object_info =
const GTypeInfo object_info =
{
sizeof (GdkPixmapImplDirectFBClass),
(GBaseInitFunc) NULL,
......
......@@ -88,7 +88,7 @@ gdk_visual_get_type (void)
if (!object_type)
{
static const GTypeInfo object_info =
const GTypeInfo object_info =
{
sizeof (GdkVisualClass),
(GBaseInitFunc) NULL,
......
......@@ -92,7 +92,7 @@ gdk_window_impl_directfb_get_type (void)
if (!object_type)
{
static const GTypeInfo object_info =
const GTypeInfo object_info =
{
sizeof (GdkWindowImplDirectFBClass),
(GBaseInitFunc) NULL,
......@@ -105,14 +105,14 @@ gdk_window_impl_directfb_get_type (void)
(GInstanceInitFunc) gdk_window_impl_directfb_init,
};
static const GInterfaceInfo paintable_info =
const GInterfaceInfo paintable_info =
{
(GInterfaceInitFunc) gdk_window_impl_directfb_paintable_init,
NULL,
NULL
};
static const GInterfaceInfo window_impl_info =
const GInterfaceInfo window_impl_info =
{
(GInterfaceInitFunc) gdk_window_impl_iface_init,
NULL,
......
......@@ -30,7 +30,7 @@ gdk_colormap_get_type (void)
if (!object_type)
{
static const GTypeInfo object_info =
const GTypeInfo object_info =
{
sizeof (GdkColormapClass),
(GBaseInitFunc) NULL,
......
......@@ -59,7 +59,7 @@ gdk_drag_context_get_type (void)
if (!object_type)
{
static const GTypeInfo object_info =
const GTypeInfo object_info =
{
sizeof (GdkDragContextClass),
(GBaseInitFunc) NULL,
......
......@@ -687,7 +687,7 @@ gdk_drawable_impl_quartz_get_type (void)
if (!object_type)
{
static const GTypeInfo object_info =
const GTypeInfo object_info =
{
sizeof (GdkDrawableImplQuartzClass),
(GBaseInitFunc) NULL,
......
......@@ -169,7 +169,7 @@ _gdk_gc_quartz_get_type (void)
if (!object_type)
{
static const GTypeInfo object_info =
const GTypeInfo object_info =
{
sizeof (GdkGCQuartzClass),
(GBaseInitFunc) NULL,
......
......@@ -202,7 +202,7 @@ gdk_image_get_type (void)
if (!object_type)
{
static const GTypeInfo object_info =
const GTypeInfo object_info =
{
sizeof (GdkImageClass),
(GBaseInitFunc) NULL,
......
......@@ -29,7 +29,7 @@ gdk_device_get_type (void)
if (!object_type)
{
static const GTypeInfo object_info =
const GTypeInfo object_info =
{
sizeof (GdkDeviceClass),
(GBaseInitFunc) NULL,
......
......@@ -83,7 +83,7 @@ gdk_device_get_type (void)
if (!object_type)
{
static const GTypeInfo object_info =
const GTypeInfo object_info =
{
sizeof (GdkDeviceClass),
(GBaseInitFunc) NULL,
......
......@@ -102,7 +102,7 @@ _gdk_pixmap_impl_quartz_get_type (void)
if (!object_type)
{
static const GTypeInfo object_info =
const GTypeInfo object_info =
{
sizeof (GdkPixmapImplQuartzClass),
(GBaseInitFunc) NULL,
......
......@@ -47,7 +47,7 @@ gdk_visual_get_type (void)
if (!object_type)
{
static const GTypeInfo object_info =
const GTypeInfo object_info =
{
sizeof (GdkVisualClass),
(GBaseInitFunc) NULL,
......
......@@ -51,7 +51,7 @@ gdk_colormap_get_type (void)
if (!object_type)
{
static const GTypeInfo object_info =
const GTypeInfo object_info =
{
sizeof (GdkColormapClass),
(GBaseInitFunc) NULL,
......
......@@ -60,7 +60,7 @@ _gdk_gc_win32_get_type (void)
if (!object_type)
{
static const GTypeInfo object_info =
const GTypeInfo object_info =
{
sizeof (GdkGCWin32Class),
(GBaseInitFunc) NULL,
......
......@@ -46,7 +46,7 @@ gdk_image_get_type (void)
if (!object_type)
{
static const GTypeInfo object_info =
const GTypeInfo object_info =
{
sizeof (GdkImageClass),
(GBaseInitFunc) NULL,
......
......@@ -73,7 +73,7 @@ gdk_device_get_type (void)
if (!object_type)
{
static const GTypeInfo object_info =
const GTypeInfo object_info =
{
sizeof (GdkDeviceClass),
(GBaseInitFunc) NULL,
......
......@@ -53,7 +53,7 @@ _gdk_pixmap_impl_win32_get_type (void)
if (!object_type)
{
static const GTypeInfo object_info =
const GTypeInfo object_info =
{
sizeof (GdkPixmapImplWin32Class),
(GBaseInitFunc) NULL,
......
......@@ -61,7 +61,7 @@ gdk_visual_get_type (void)
if (!object_type)
{
static const GTypeInfo object_info =
const GTypeInfo object_info =
{
sizeof (GdkVisualClass),
(GBaseInitFunc) NULL,
......
......@@ -70,7 +70,7 @@ _gdk_window_impl_win32_get_type (void)
if (!object_type)
{
static const GTypeInfo object_info =
const GTypeInfo object_info =
{
sizeof (GdkWindowImplWin32Class),
(GBaseInitFunc) NULL,
......
......@@ -75,7 +75,7 @@ gdk_device_get_type (void)
if (!object_type)
{
static const GTypeInfo object_info =
const GTypeInfo object_info =
{
sizeof (GdkDeviceClass),
(GBaseInitFunc) NULL,
......
......@@ -119,7 +119,7 @@ gdk_keymap_x11_get_type (void)
if (!object_type)
{
static const GTypeInfo object_info =
const GTypeInfo object_info =
{
sizeof (GdkKeymapClass),
(GBaseInitFunc) NULL,
......
......@@ -70,7 +70,7 @@ gdk_visual_get_type (void)
if (!object_type)
{
static const GTypeInfo object_info =
const GTypeInfo object_info =
{
sizeof (GdkVisualClass),
(GBaseInitFunc) NULL,
......
......@@ -131,7 +131,7 @@ gtk_action_group_get_type (void)
(GInstanceInitFunc) gtk_action_group_init,
};
static const GInterfaceInfo buildable_info =
const GInterfaceInfo buildable_info =
{
(GInterfaceInitFunc) gtk_action_group_buildable_init,
NULL,
......
......@@ -155,7 +155,7 @@ gtk_container_get_type (void)
NULL, /* value_table */
};
static const GInterfaceInfo buildable_info =
const GInterfaceInfo buildable_info =
{
(GInterfaceInitFunc) gtk_container_buildable_init,
NULL,
......
......@@ -8768,25 +8768,25 @@ gtk_icon_view_item_accessible_get_type (void)
NULL /* value table */
};
static const GInterfaceInfo atk_component_info =
const GInterfaceInfo atk_component_info =
{
(GInterfaceInitFunc) atk_component_item_interface_init,
(GInterfaceFinalizeFunc) NULL,
NULL
};
static const GInterfaceInfo atk_action_info =
const GInterfaceInfo atk_action_info =
{
(GInterfaceInitFunc) atk_action_item_interface_init,
(GInterfaceFinalizeFunc) NULL,
NULL
};
static const GInterfaceInfo atk_image_info =
const GInterfaceInfo atk_image_info =
{
(GInterfaceInitFunc) atk_image_item_interface_init,
(GInterfaceFinalizeFunc) NULL,
NULL
};
static const GInterfaceInfo atk_text_info =
const GInterfaceInfo atk_text_info =
{
(GInterfaceInitFunc) atk_text_item_interface_init,
(GInterfaceFinalizeFunc) NULL,
......@@ -9711,7 +9711,7 @@ gtk_icon_view_accessible_get_type (void)
if (!type)
{
static GTypeInfo tinfo =
GTypeInfo tinfo =
{
0, /* class size */
(GBaseInitFunc) NULL, /* base init */
......@@ -9724,13 +9724,13 @@ gtk_icon_view_accessible_get_type (void)
(GInstanceInitFunc) NULL, /* instance init */
NULL /* value table */
};
static const GInterfaceInfo atk_component_info =
const GInterfaceInfo atk_component_info =
{
(GInterfaceInitFunc) atk_component_interface_init,
(GInterfaceFinalizeFunc) NULL,
NULL
};
static const GInterfaceInfo atk_selection_info =
const GInterfaceInfo atk_selection_info =
{
(GInterfaceInitFunc) gtk_icon_view_accessible_selection_interface_init,
(GInterfaceFinalizeFunc) NULL,
......
......@@ -471,7 +471,7 @@ gtk_text_get_type (void)
(GtkClassInitFunc) NULL,
};
static const GInterfaceInfo editable_info =
const GInterfaceInfo editable_info =
{
(GInterfaceInitFunc) gtk_text_editable_init, /* interface_init */
NULL, /* interface_finalize */
......
......@@ -114,7 +114,7 @@ gtk_tool_button_get_type (void)
if (!type)
{
static const GInterfaceInfo activatable_info =
const GInterfaceInfo activatable_info =
{
(GInterfaceInitFunc) gtk_tool_button_activatable_interface_init,
(GInterfaceFinalizeFunc) NULL,
......
......@@ -34,7 +34,7 @@ GType msw_type_rc_style = 0;
void
msw_rc_style_register_type (GTypeModule *module)
{
static const GTypeInfo object_info = {
const GTypeInfo object_info = {
sizeof (MswRcStyleClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
......
......@@ -3745,7 +3745,7 @@ GType msw_type_style = 0;
void
msw_style_register_type (GTypeModule *module)
{
static const GTypeInfo object_info = {
const GTypeInfo object_info = {
sizeof (MswStyleClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
......
......@@ -1058,7 +1058,7 @@ GType pixbuf_type_style = 0;
void
pixbuf_style_register_type (GTypeModule *module)
{
static const GTypeInfo object_info =
const GTypeInfo object_info =
{
sizeof (PixbufStyleClass),
(GBaseInitFunc) NULL,
......
......@@ -140,7 +140,7 @@ GType pixbuf_type_rc_style = 0;
void
pixbuf_rc_style_register_type (GTypeModule *module)
{
static const GTypeInfo object_info =
const GTypeInfo object_info =
{
sizeof (PixbufRcStyleClass),
(GBaseInitFunc) NULL,
......
......@@ -124,7 +124,7 @@ static GObjectClass *parent_class;
void
gtk_im_context_ime_register_type (GTypeModule *type_module)
{
static const GTypeInfo im_context_ime_info = {
const GTypeInfo im_context_ime_info = {
sizeof (GtkIMContextIMEClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
......
......@@ -63,7 +63,7 @@ static void vfunc_get_preedit_string (GtkIMContext *context,
void
gtk_im_context_multipress_register_type (GTypeModule* type_module)
{
static const GTypeInfo im_context_multipress_info =
const GTypeInfo im_context_multipress_info =
{
sizeof (GtkImContextMultipressClass),
(GBaseInitFunc) NULL,
......
......@@ -43,7 +43,7 @@ GType gtk_type_im_context_thai = 0;
void
gtk_im_context_thai_register_type (GTypeModule *type_module)
{
static const GTypeInfo im_context_thai_info =
const GTypeInfo im_context_thai_info =
{
sizeof (GtkIMContextThaiClass),
(GBaseInitFunc) NULL,
......
......@@ -158,7 +158,7 @@ static GSList *status_windows = NULL;
void
gtk_im_context_xim_register_type (GTypeModule *type_module)
{
static const GTypeInfo im_context_xim_info =
const GTypeInfo im_context_xim_info =
{
sizeof (GtkIMContextXIMClass),
(GBaseInitFunc) NULL,
......
......@@ -43,7 +43,7 @@ static void am_et_init (GtkIMContextSimple *im_context);
static void
am_et_register_type (GTypeModule *module)
{
static const GTypeInfo object_info =
const GTypeInfo object_info =
{
sizeof (GtkIMContextSimpleClass),
(GBaseInitFunc) NULL,
......
......@@ -38,7 +38,7 @@ static void cedilla_init (GtkIMContextSimple *im_context);
static void
cedilla_register_type (GTypeModule *module)
{
static const GTypeInfo object_info =
const GTypeInfo object_info =
{
sizeof (GtkIMContextSimpleClass),
(GBaseInitFunc) NULL,
......
......@@ -37,7 +37,7 @@ static void cyrillic_translit_init (GtkIMContextSimple *im_context);
static void
cyrillic_translit_register_type (GTypeModule *module)
{
static const GTypeInfo object_info =
const GTypeInfo object_info =
{
sizeof (GtkIMContextSimpleClass),
(GBaseInitFunc) NULL,
......
......@@ -40,7 +40,7 @@ static void inuktitut_init (GtkIMContextSimple *im_context);
static void
inuktitut_register_type (GTypeModule *module)
{
static const GTypeInfo object_info =
const GTypeInfo object_info =
{
sizeof (GtkIMContextSimpleClass),
(GBaseInitFunc) NULL,
......
......@@ -37,7 +37,7 @@ static void ipa_init (GtkIMContextSimple *im_context);
static void
ipa_register_type (GTypeModule *module)
{
static const GTypeInfo object_info =
const GTypeInfo object_info =
{
sizeof (GtkIMContextSimpleClass),
(GBaseInitFunc) NULL,
......
......@@ -43,7 +43,7 @@ static void ti_er_init (GtkIMContextSimple *im_context);
static void
ti_er_register_type (GTypeModule *module)
{
static const GTypeInfo object_info =
const GTypeInfo object_info =
{
sizeof (GtkIMContextSimpleClass),
(GBaseInitFunc) NULL,
......
......@@ -43,7 +43,7 @@ static void ti_et_init (GtkIMContextSimple *im_context);
static void
ti_et_register_type (GTypeModule *module)
{
static const GTypeInfo object_info =
const GTypeInfo object_info =
{
sizeof (GtkIMContextSimpleClass),
(GBaseInitFunc) NULL,
......
......@@ -40,7 +40,7 @@ static void viqr_init (GtkIMContextSimple *im_context);
static void
viqr_register_type (GTypeModule *module)
{
static const GTypeInfo object_info =
const GTypeInfo object_info =
{
sizeof (GtkIMContextSimpleClass),
(GBaseInitFunc) NULL,
......
......@@ -46,7 +46,7 @@ gail_text_util_get_type(void)
if (!type)
{
static const GTypeInfo tinfo =
const GTypeInfo tinfo =
{
sizeof (GailTextUtilClass),
(GBaseInitFunc) NULL, /* base init */
......
......@@ -193,7 +193,7 @@ static gboolean request_auth_info (gpointer
static void
gtk_print_backend_cups_register_type (GTypeModule *module)
{
static const GTypeInfo print_backend_cups_info =
const GTypeInfo print_backend_cups_info =
{
sizeof (GtkPrintBackendCupsClass),
NULL, /* base_init */
......
......@@ -30,7 +30,7 @@ static GType gtk_printer_cups_type = 0;
void
gtk_printer_cups_register_type (GTypeModule *module)
{
static const GTypeInfo object_info =
const GTypeInfo object_info =
{
sizeof (GtkPrinterCupsClass),
(GBaseInitFunc) NULL,
......
......@@ -109,7 +109,7 @@ static GtkPageSetup * file_printer_get_default_page_size (GtkPrinter
static void
gtk_print_backend_file_register_type (GTypeModule *module)
{
static const GTypeInfo print_backend_file_info =
const GTypeInfo print_backend_file_info =
{
sizeof (GtkPrintBackendFileClass),
NULL, /* base_init */
......
......@@ -88,7 +88,7 @@ static void gtk_print_backend_lpr_print_stream (GtkPrintBacke
static void
gtk_print_backend_lpr_register_type (GTypeModule *module)
{
static const GTypeInfo print_backend_lpr_info =
const GTypeInfo print_backend_lpr_info =
{
sizeof (GtkPrintBackendLprClass),
NULL, /* base_init */
......
......@@ -105,7 +105,7 @@ static void papi_display_printer_status_done (gpointer use
static void
gtk_print_backend_papi_register_type (GTypeModule *module)
{
static const GTypeInfo print_backend_papi_info =
const GTypeInfo print_backend_papi_info =
{
sizeof (GtkPrintBackendPapiClass),
NULL, /* base_init */
......
......@@ -31,7 +31,7 @@ static GType gtk_printer_papi_type = 0;
void
gtk_printer_papi_register_type (GTypeModule *module)
{
static const GTypeInfo object_info =
const GTypeInfo object_info =
{
sizeof (GtkPrinterPapiClass),
(GBaseInitFunc) NULL,
......
......@@ -107,7 +107,7 @@ static void test_printer_request_details (GtkPrinter