inital gtk2 patch
[claws.git] / src / gtk / gtkshruler.c
index 091c1907ed561d9e5115adececf8b087296ad815..5a79123ce1014852d20afc3d2bf9e99514d3651f 100644 (file)
@@ -48,24 +48,28 @@ static void gtk_shruler_draw_ticks  (GtkRuler        *ruler);
 static void gtk_shruler_draw_pos       (GtkRuler        *ruler);
 #endif
 
 static void gtk_shruler_draw_pos       (GtkRuler        *ruler);
 #endif
 
-guint
+GType
 gtk_shruler_get_type(void)
 {
 gtk_shruler_get_type(void)
 {
-       static guint shruler_type = 0;
+       static GType shruler_type = 0;
 
        if ( !shruler_type ) {
 
        if ( !shruler_type ) {
-               static const GtkTypeInfo shruler_info = {
-                       "GtkSHRuler",
-                       sizeof (GtkSHRuler),
+               static const GTypeInfo shruler_info = {
                        sizeof (GtkSHRulerClass),
                        sizeof (GtkSHRulerClass),
-                       (GtkClassInitFunc) gtk_shruler_class_init,
-                       (GtkObjectInitFunc) gtk_shruler_init,
-                       /* reserved_1 */ NULL,
-               /* reserved_2 */ NULL,
-               (GtkClassInitFunc) NULL,
-        };
+
+                       (GBaseInitFunc) NULL,
+                       (GBaseFinalizeFunc) NULL,
+
+                       (GClassInitFunc) gtk_shruler_class_init,
+                       (GClassFinalizeFunc) NULL,
+                       NULL,   /* class_data */
+
+                       sizeof (GtkSHRuler),
+                       0,      /* n_preallocs */
+                       (GInstanceInitFunc) gtk_shruler_init,
+               };
                /* inherit from GtkHRuler */
                /* inherit from GtkHRuler */
-       shruler_type = gtk_type_unique( gtk_hruler_get_type (), &shruler_info );
+               shruler_type = g_type_register_static (GTK_TYPE_HRULER, "GtkSHRuler", &shruler_info, (GTypeFlags)0);
        }
        return shruler_type;
 }
        }
        return shruler_type;
 }
@@ -99,15 +103,15 @@ gtk_shruler_init (GtkSHRuler * shruler)
        GtkWidget * widget;
        
        widget = GTK_WIDGET (shruler);
        GtkWidget * widget;
        
        widget = GTK_WIDGET (shruler);
-       widget->requisition.width = widget->style->klass->xthickness * 2 + 1;
-       widget->requisition.height = widget->style->klass->ythickness * 2 + RULER_HEIGHT;
+       widget->requisition.width = widget->style->xthickness * 2 + 1;
+       widget->requisition.height = widget->style->ythickness * 2 + RULER_HEIGHT;
 }
 
 
 GtkWidget*
 gtk_shruler_new(void)
 {
 }
 
 
 GtkWidget*
 gtk_shruler_new(void)
 {
-       return GTK_WIDGET( gtk_type_new( gtk_shruler_get_type() ) );
+       return GTK_WIDGET( g_object_new( gtk_shruler_get_type(), NULL ) );
 }
 
 static void
 }
 
 static void
@@ -132,10 +136,10 @@ gtk_shruler_draw_ticks(GtkRuler *ruler)
        
        gc = widget->style->fg_gc[GTK_STATE_NORMAL];
        bg_gc = widget->style->bg_gc[GTK_STATE_NORMAL];
        
        gc = widget->style->fg_gc[GTK_STATE_NORMAL];
        bg_gc = widget->style->bg_gc[GTK_STATE_NORMAL];
-       font = widget->style->font;
+       font = gtk_style_get_font(widget->style);
 
 
-       xthickness = widget->style->klass->xthickness;
-       ythickness = widget->style->klass->ythickness;
+       xthickness = widget->style->xthickness;
+       ythickness = widget->style->ythickness;
 
        width = widget->allocation.width;
        height = widget->allocation.height - ythickness * 2;
 
        width = widget->allocation.width;
        height = widget->allocation.height - ythickness * 2;