From c9e0770d985a630a8d91eafc97d7c31196ea5ef3 Mon Sep 17 00:00:00 2001 From: joncruz Date: Thu, 4 Dec 2008 08:47:03 +0000 Subject: [PATCH] Warning/type cleanup. --- src/widgets/sp-color-preview.cpp | 40 +++++++++++++++++++++++--------- src/widgets/sp-color-preview.h | 22 +++++++++++++----- 2 files changed, 45 insertions(+), 17 deletions(-) diff --git a/src/widgets/sp-color-preview.cpp b/src/widgets/sp-color-preview.cpp index 183877d13..ddeb5d123 100644 --- a/src/widgets/sp-color-preview.cpp +++ b/src/widgets/sp-color-preview.cpp @@ -28,20 +28,27 @@ static void sp_color_preview_paint (SPColorPreview *cp, GdkRectangle *area); static GtkWidgetClass *parent_class; -GtkType -sp_color_preview_get_type (void) +GType sp_color_preview_get_type(void) { - static GtkType type = 0; + static GType type = 0; if (!type) { - GtkTypeInfo info = { - "SPColorPreview", - sizeof (SPColorPreview), - sizeof (SPColorPreviewClass), - (GtkClassInitFunc) sp_color_preview_class_init, - (GtkObjectInitFunc) sp_color_preview_init, - NULL, NULL, NULL + static const GTypeInfo info = { + sizeof(SPColorPreviewClass), + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc) sp_color_preview_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof(SPColorPreview), + 0, /* n_preallocs */ + (GInstanceInitFunc) sp_color_preview_init, + 0, /* value_table */ }; - type = gtk_type_unique (GTK_TYPE_WIDGET, &info); + + type = g_type_register_static( GTK_TYPE_WIDGET, + "SPColorPreview", + &info, + static_cast< GTypeFlags > (0) ); } return type; } @@ -191,3 +198,14 @@ sp_color_preview_paint (SPColorPreview *cp, GdkRectangle *area) cp->rgba | 0xff); } } + +/* + Local Variables: + mode:c++ + c-file-style:"stroustrup" + c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) + indent-tabs-mode:nil + fill-column:99 + End: +*/ +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : diff --git a/src/widgets/sp-color-preview.h b/src/widgets/sp-color-preview.h index 84f5456bb..873e59d80 100644 --- a/src/widgets/sp-color-preview.h +++ b/src/widgets/sp-color-preview.h @@ -26,20 +26,30 @@ #define SP_IS_COLOR_PREVIEW_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), SP_TYPE_COLOR_PREVIEW)) struct SPColorPreview { - GtkWidget widget; + GtkWidget widget; - guint32 rgba; + guint32 rgba; }; struct SPColorPreviewClass { - GtkWidgetClass parent_class; + GtkWidgetClass parent_class; }; -GtkType sp_color_preview_get_type (void); +GType sp_color_preview_get_type(void); -GtkWidget *sp_color_preview_new (guint32 rgba); +GtkWidget *sp_color_preview_new(guint32 rgba); -void sp_color_preview_set_rgba32 (SPColorPreview *cp, guint32 color); +void sp_color_preview_set_rgba32(SPColorPreview *cp, guint32 color); #endif // SEEN_COLOR_PREVIEW_H +/* + Local Variables: + mode:c++ + c-file-style:"stroustrup" + c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) + indent-tabs-mode:nil + fill-column:99 + End: +*/ +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : -- 2.30.2