From 759605940eb679b0531a726ca56b3e435c187e70 Mon Sep 17 00:00:00 2001 From: joncruz Date: Sun, 18 May 2008 00:23:30 +0000 Subject: [PATCH] Fixed warnings from deprecated function --- src/widgets/sp-color-notebook.cpp | 33 +++++++++++++++++-------------- src/widgets/sp-color-notebook.h | 2 +- src/widgets/sp-color-wheel.cpp | 25 ++++++++++++----------- src/widgets/sp-color-wheel.h | 2 +- 4 files changed, 34 insertions(+), 28 deletions(-) diff --git a/src/widgets/sp-color-notebook.cpp b/src/widgets/sp-color-notebook.cpp index bf690e968..376cd8ee5 100644 --- a/src/widgets/sp-color-notebook.cpp +++ b/src/widgets/sp-color-notebook.cpp @@ -55,22 +55,25 @@ static SPColorSelectorClass *parent_class; #define XPAD 4 #define YPAD 1 -GtkType -sp_color_notebook_get_type (void) +GType sp_color_notebook_get_type(void) { - static GtkType type = 0; - if (!type) { - GtkTypeInfo info = { - "SPColorNotebook", - sizeof (SPColorNotebook), - sizeof (SPColorNotebookClass), - (GtkClassInitFunc) sp_color_notebook_class_init, - (GtkObjectInitFunc) sp_color_notebook_init, - NULL, NULL, NULL - }; - type = gtk_type_unique (SP_TYPE_COLOR_SELECTOR, &info); - } - return type; + static GtkType type = 0; + if (!type) { + GTypeInfo info = { + sizeof(SPColorNotebookClass), + 0, // base_init + 0, // base_finalize + (GClassInitFunc)sp_color_notebook_class_init, + 0, // class_finalize + 0, // class_data + sizeof(SPColorNotebook), + 0, // n_preallocs + (GInstanceInitFunc)sp_color_notebook_init, + 0 // value_table + }; + type = g_type_register_static(SP_TYPE_COLOR_SELECTOR, "SPColorNotebook", &info, static_cast(0)); + } + return type; } static void diff --git a/src/widgets/sp-color-notebook.h b/src/widgets/sp-color-notebook.h index 4acd7ecd4..bf6fb1002 100644 --- a/src/widgets/sp-color-notebook.h +++ b/src/widgets/sp-color-notebook.h @@ -93,7 +93,7 @@ struct SPColorNotebookClass { void (* changed) (SPColorNotebook *rgbsel); }; -GtkType sp_color_notebook_get_type (void); +GType sp_color_notebook_get_type(void); GtkWidget *sp_color_notebook_new (void); diff --git a/src/widgets/sp-color-wheel.cpp b/src/widgets/sp-color-wheel.cpp index 7cfa991b0..a31857101 100644 --- a/src/widgets/sp-color-wheel.cpp +++ b/src/widgets/sp-color-wheel.cpp @@ -72,20 +72,23 @@ get_time (void) } */ -GtkType -sp_color_wheel_get_type (void) +GType sp_color_wheel_get_type(void) { - static GtkType type = 0; + static GType type = 0; if (!type) { - GtkTypeInfo info = { - "SPColorWheel", - sizeof (SPColorWheel), - sizeof (SPColorWheelClass), - (GtkClassInitFunc) sp_color_wheel_class_init, - (GtkObjectInitFunc) sp_color_wheel_init, - NULL, NULL, NULL + GTypeInfo info = { + sizeof(SPColorWheelClass), + 0, // base_init + 0, // base_finalize + (GClassInitFunc)sp_color_wheel_class_init, + 0, // class_finalize + 0, // class_data + sizeof(SPColorWheel), + 0, // n_preallocs + (GInstanceInitFunc)sp_color_wheel_init, + 0 // value_table }; - type = gtk_type_unique (GTK_TYPE_WIDGET, &info); + type = g_type_register_static(GTK_TYPE_WIDGET, "SPColorWheel", &info, static_cast(0)); } return type; } diff --git a/src/widgets/sp-color-wheel.h b/src/widgets/sp-color-wheel.h index d8fceb908..699750bed 100644 --- a/src/widgets/sp-color-wheel.h +++ b/src/widgets/sp-color-wheel.h @@ -57,7 +57,7 @@ struct SPColorWheelClass { void (* changed) (SPColorWheel *wheel); }; -GtkType sp_color_wheel_get_type (void); +GType sp_color_wheel_get_type(void); GtkWidget *sp_color_wheel_new (); -- 2.30.2