diff options
| author | Jon A. Cruz <jon@joncruz.org> | 2008-05-06 07:33:22 +0000 |
|---|---|---|
| committer | joncruz <joncruz@users.sourceforge.net> | 2008-05-06 07:33:22 +0000 |
| commit | 08c28c4e7fe814f39e742fd8cd617b42daa1534e (patch) | |
| tree | 5aa758fb93a0475c27658dd4ded72c9cf7064acf /src/widgets | |
| parent | limit the change to the relative moves only (diff) | |
| download | inkscape-08c28c4e7fe814f39e742fd8cd617b42daa1534e.tar.gz inkscape-08c28c4e7fe814f39e742fd8cd617b42daa1534e.zip | |
Updating deprecated type calls.
(bzr r5617)
Diffstat (limited to 'src/widgets')
| -rw-r--r-- | src/widgets/button.cpp | 33 | ||||
| -rw-r--r-- | src/widgets/desktop-widget.cpp | 23 | ||||
| -rw-r--r-- | src/widgets/font-selector.cpp | 46 | ||||
| -rw-r--r-- | src/widgets/paint-selector.cpp | 21 | ||||
| -rw-r--r-- | src/widgets/sp-xmlview-attr-list.cpp | 37 | ||||
| -rw-r--r-- | src/widgets/sp-xmlview-content.cpp | 23 |
6 files changed, 103 insertions, 80 deletions
diff --git a/src/widgets/button.cpp b/src/widgets/button.cpp index 95d5859e8..6769fa389 100644 --- a/src/widgets/button.cpp +++ b/src/widgets/button.cpp @@ -56,22 +56,25 @@ SPActionEventVector button_event_vector = { NULL }; -GtkType -sp_button_get_type (void) +GType sp_button_get_type(void) { - static GtkType type = 0; - if (!type) { - GtkTypeInfo info = { - "SPButton", - sizeof (SPButton), - sizeof (SPButtonClass), - (GtkClassInitFunc) sp_button_class_init, - (GtkObjectInitFunc) sp_button_init, - NULL, NULL, NULL - }; - type = gtk_type_unique (GTK_TYPE_TOGGLE_BUTTON, &info); - } - return type; + static GType type = 0; + if (!type) { + GTypeInfo info = { + sizeof(SPButtonClass), + 0, // base_init + 0, // base_finalize + (GClassInitFunc)sp_button_class_init, + 0, // class_finalize + 0, // class_data + sizeof(SPButton), + 0, // n_preallocs + (GInstanceInitFunc)sp_button_init, + 0 // value_table + }; + type = g_type_register_static(GTK_TYPE_TOGGLE_BUTTON, "SPButton", &info, static_cast<GTypeFlags>(0)); + } + return type; } static void diff --git a/src/widgets/desktop-widget.cpp b/src/widgets/desktop-widget.cpp index 997b9c86f..df35f07f7 100644 --- a/src/widgets/desktop-widget.cpp +++ b/src/widgets/desktop-widget.cpp @@ -243,20 +243,23 @@ SPDesktopWidget::window_get_pointer() /** * Registers SPDesktopWidget class and returns its type number. */ -GtkType -sp_desktop_widget_get_type (void) +GType sp_desktop_widget_get_type(void) { static GtkType type = 0; if (!type) { - static const GtkTypeInfo info = { - "SPDesktopWidget", - sizeof (SPDesktopWidget), - sizeof (SPDesktopWidgetClass), - (GtkClassInitFunc) sp_desktop_widget_class_init, - (GtkObjectInitFunc) sp_desktop_widget_init, - NULL, NULL, NULL + GTypeInfo info = { + sizeof(SPDesktopWidgetClass), + 0, // base_init + 0, // base_finalize + (GClassInitFunc)sp_desktop_widget_class_init, + 0, // class_finalize + 0, // class_data + sizeof(SPDesktopWidget), + 0, // n_preallocs + (GInstanceInitFunc)sp_desktop_widget_init, + 0 // value_table }; - type = gtk_type_unique (SP_TYPE_VIEW_WIDGET, &info); + type = g_type_register_static(SP_TYPE_VIEW_WIDGET, "SPDesktopWidget", &info, static_cast<GTypeFlags>(0)); } return type; } diff --git a/src/widgets/font-selector.cpp b/src/widgets/font-selector.cpp index c6d23eee2..d6326791b 100644 --- a/src/widgets/font-selector.cpp +++ b/src/widgets/font-selector.cpp @@ -107,19 +107,23 @@ namespace { static GtkHBoxClass *fs_parent_class = NULL; static guint fs_signals[LAST_SIGNAL] = { 0 }; -GtkType sp_font_selector_get_type() +GType sp_font_selector_get_type() { - static GtkType type = 0; + static GType type = 0; if (!type) { - static const GtkTypeInfo info = { - "SPFontSelector", - sizeof(SPFontSelector), + GTypeInfo info = { sizeof(SPFontSelectorClass), - (GtkClassInitFunc) sp_font_selector_class_init, - (GtkObjectInitFunc) sp_font_selector_init, - NULL, NULL, NULL + 0, // base_init + 0, // base_finalize + (GClassInitFunc)sp_font_selector_class_init, + 0, // class_finalize + 0, // class_data + sizeof(SPFontSelector), + 0, // n_preallocs + (GInstanceInitFunc)sp_font_selector_init, + 0 // value_table }; - type = gtk_type_unique(GTK_TYPE_HBOX, &info); + type = g_type_register_static(GTK_TYPE_HBOX, "SPFontSelector", &info, static_cast<GTypeFlags>(0)); } return type; } @@ -538,19 +542,23 @@ static gint sp_font_preview_expose(GtkWidget *widget, GdkEventExpose *event); static GtkDrawingAreaClass *fp_parent_class = NULL; -GtkType sp_font_preview_get_type() +GType sp_font_preview_get_type() { - static GtkType type = 0; + static GType type = 0; if (!type) { - static const GtkTypeInfo info = { - "SPFontPreview", - sizeof (SPFontPreview), - sizeof (SPFontPreviewClass), - (GtkClassInitFunc) sp_font_preview_class_init, - (GtkObjectInitFunc) sp_font_preview_init, - NULL, NULL, NULL + GTypeInfo info = { + sizeof(SPFontPreviewClass), + 0, // base_init + 0, // base_finalize + (GClassInitFunc)sp_font_preview_class_init, + 0, // class_finalize + 0, // class_data + sizeof(SPFontPreview), + 0, // n_preallocs + (GInstanceInitFunc)sp_font_preview_init, + 0 // value_table }; - type = gtk_type_unique (GTK_TYPE_DRAWING_AREA, &info); + type = g_type_register_static(GTK_TYPE_DRAWING_AREA, "SPFontPreview", &info, static_cast<GTypeFlags>(0)); } return type; } diff --git a/src/widgets/paint-selector.cpp b/src/widgets/paint-selector.cpp index c66fbd3c7..a55b7bbc0 100644 --- a/src/widgets/paint-selector.cpp +++ b/src/widgets/paint-selector.cpp @@ -88,20 +88,23 @@ static void sp_paint_selector_set_style_buttons(SPPaintSelector *psel, GtkWidget static GtkVBoxClass *parent_class; static guint psel_signals[LAST_SIGNAL] = {0}; -GtkType -sp_paint_selector_get_type(void) +GType sp_paint_selector_get_type(void) { static GtkType type = 0; if (!type) { - GtkTypeInfo info = { - "SPPaintSelector", - sizeof(SPPaintSelector), + GTypeInfo info = { sizeof(SPPaintSelectorClass), - (GtkClassInitFunc) sp_paint_selector_class_init, - (GtkObjectInitFunc) sp_paint_selector_init, - NULL, NULL, NULL + 0, // base_init + 0, // base_finalize + (GClassInitFunc)sp_paint_selector_class_init, + 0, // class_finalize + 0, // class_data + sizeof(SPPaintSelector), + 0, // n_preallocs + (GInstanceInitFunc)sp_paint_selector_init, + 0 // value_table }; - type = gtk_type_unique(GTK_TYPE_VBOX, &info); + type = g_type_register_static(GTK_TYPE_VBOX, "SPPaintSelector", &info, static_cast<GTypeFlags>(0)); } return type; } diff --git a/src/widgets/sp-xmlview-attr-list.cpp b/src/widgets/sp-xmlview-attr-list.cpp index 923420740..008ad4970 100644 --- a/src/widgets/sp-xmlview-attr-list.cpp +++ b/src/widgets/sp-xmlview-attr-list.cpp @@ -77,24 +77,27 @@ sp_xmlview_attr_list_set_repr (SPXMLViewAttrList * list, Inkscape::XML::Node * r gtk_clist_thaw (GTK_CLIST (list)); } -GtkType -sp_xmlview_attr_list_get_type (void) +GType sp_xmlview_attr_list_get_type(void) { - static GtkType type = 0; - - if (!type) { - static const GtkTypeInfo info = { - "SPXMLViewAttrList", - sizeof (SPXMLViewAttrList), - sizeof (SPXMLViewAttrListClass), - (GtkClassInitFunc) sp_xmlview_attr_list_class_init, - (GtkObjectInitFunc) sp_xmlview_attr_list_init, - NULL, NULL, NULL - }; - type = gtk_type_unique (GTK_TYPE_CLIST, &info); - } - - return type; + static GType type = 0; + + if (!type) { + GTypeInfo info = { + sizeof(SPXMLViewAttrListClass), + 0, // base_init + 0, // base_finalize + (GClassInitFunc)sp_xmlview_attr_list_class_init, + 0, // class_finalize + 0, // class_data + sizeof(SPXMLViewAttrList), + 0, // n_preallocs + (GInstanceInitFunc)sp_xmlview_attr_list_init, + 0 // value_table + }; + type = g_type_register_static(GTK_TYPE_CLIST, "SPXMLViewAttrList", &info, static_cast<GTypeFlags>(0)); + } + + return type; } void diff --git a/src/widgets/sp-xmlview-content.cpp b/src/widgets/sp-xmlview-content.cpp index 393c136c7..7150b07fd 100644 --- a/src/widgets/sp-xmlview-content.cpp +++ b/src/widgets/sp-xmlview-content.cpp @@ -77,21 +77,24 @@ sp_xmlview_content_set_repr (SPXMLViewContent * text, Inkscape::XML::Node * repr } } -GtkType -sp_xmlview_content_get_type (void) +GType sp_xmlview_content_get_type(void) { static GtkType type = 0; if (!type) { - static const GtkTypeInfo info = { - "SPXMLViewContent", - sizeof (SPXMLViewContent), - sizeof (SPXMLViewContentClass), - (GtkClassInitFunc) sp_xmlview_content_class_init, - (GtkObjectInitFunc) sp_xmlview_content_init, - NULL, NULL, NULL + GTypeInfo info = { + sizeof(SPXMLViewContentClass), + 0, // base_init + 0, // base_finalize + (GClassInitFunc)sp_xmlview_content_class_init, + 0, // class_finalize + 0, // class_data + sizeof(SPXMLViewContent), + 0, // n_preallocs + (GInstanceInitFunc)sp_xmlview_content_init, + 0 // value_table }; - type = gtk_type_unique (GTK_TYPE_TEXT_VIEW, &info); + type = g_type_register_static(GTK_TYPE_TEXT_VIEW, "SPXMLViewContent", &info, static_cast<GTypeFlags>(0)); } return type; |
