Code

Warning/type cleanup.
authorjoncruz <joncruz@users.sourceforge.net>
Thu, 4 Dec 2008 08:47:03 +0000 (08:47 +0000)
committerjoncruz <joncruz@users.sourceforge.net>
Thu, 4 Dec 2008 08:47:03 +0000 (08:47 +0000)
src/widgets/sp-color-preview.cpp
src/widgets/sp-color-preview.h

index 183877d13eac11e2c5bb7b1b08d6d036fc44aec4..ddeb5d123ff46f2da948ebe777f5f7ac1545a97e 100644 (file)
@@ -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 :
index 84f5456bb86451981073ae27fcec9d5c7b6d459a..873e59d80728f8486217e37d2495ac664d48dca5 100644 (file)
 #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 :