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
This commit is contained in:
Nicola Fontana 2009-11-06 01:21:09 +01:00 committed by Javier Jardón
parent e41f4e85cf
commit 1e1131c959
66 changed files with 83 additions and 83 deletions

View File

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

View File

@ -65,7 +65,7 @@ gtk_dial_get_type ()
if (!dial_type)
{
static const GTypeInfo dial_info =
const GTypeInfo dial_info =
{
sizeof (GtkDialClass),
NULL,

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -107,7 +107,7 @@ static void test_printer_request_details (GtkPrinter
static void
gtk_print_backend_test_register_type (GTypeModule *module)
{
static const GTypeInfo print_backend_test_info =
const GTypeInfo print_backend_test_info =
{
sizeof (GtkPrintBackendTestClass),
NULL, /* base_init */

View File

@ -374,7 +374,7 @@ view_column_model_get_type (void)
if (!view_column_model_type)
{
static const GTypeInfo view_column_model_info =
const GTypeInfo view_column_model_info =
{
sizeof (GtkListStoreClass),
NULL, /* base_init */
@ -387,21 +387,21 @@ view_column_model_get_type (void)
(GInstanceInitFunc) view_column_model_init,
};
static const GInterfaceInfo tree_model_info =
const GInterfaceInfo tree_model_info =
{
(GInterfaceInitFunc) view_column_model_tree_model_init,
NULL,
NULL
};
static const GInterfaceInfo drag_source_info =
const GInterfaceInfo drag_source_info =
{
(GInterfaceInitFunc) view_column_model_drag_source_init,
NULL,
NULL
};
static const GInterfaceInfo drag_dest_info =
const GInterfaceInfo drag_dest_info =
{
(GInterfaceInitFunc) view_column_model_drag_dest_init,
NULL,

View File

@ -891,7 +891,7 @@ gtk_tree_model_types_get_type (void)
if (!model_types_type)
{
static const GTypeInfo model_types_info =
const GTypeInfo model_types_info =
{
sizeof (GtkTreeModelTypesClass),
NULL, /* base_init */
@ -904,7 +904,7 @@ gtk_tree_model_types_get_type (void)
(GInstanceInitFunc) gtk_tree_model_types_init
};
static const GInterfaceInfo tree_model_info =
const GInterfaceInfo tree_model_info =
{
(GInterfaceInitFunc) gtk_tree_model_types_tree_model_init,
NULL,