2011-10-07 [colin] 3.7.10cvs21
[claws.git] / src / gtk / spell_entry.c
index f96e461b3f5acb4753c880667ece95f1e2f79a59..1d6dbb57f788a9cfeca28e2cf1e69942d974bfbc 100644 (file)
 static void claws_spell_entry_init             (ClawsSpellEntry *entry);
 static void claws_spell_entry_editable_init    (GtkEditableClass *iface);
 static void claws_spell_entry_finalize         (GObject *object);
+#if !GTK_CHECK_VERSION(3, 0, 0)
 static void claws_spell_entry_destroy          (GtkObject *object);
 static gint claws_spell_entry_expose           (GtkWidget *widget,
                                                 GdkEventExpose *event);
+#else
+static void claws_spell_entry_destroy          (GtkWidget *object);
+static gint claws_spell_entry_expose           (GtkWidget *widget,
+                                                cairo_t *cr);
+#endif
 static gint claws_spell_entry_button_press     (GtkWidget *widget,
                                                 GdkEventButton *event);
 static gboolean claws_spell_entry_popup_menu   (GtkWidget *widget,
@@ -76,7 +82,9 @@ G_DEFINE_TYPE_EXTENDED(ClawsSpellEntry, claws_spell_entry, GTK_TYPE_ENTRY, 0, G_
 static void claws_spell_entry_class_init(ClawsSpellEntryClass *klass)
 {
        GObjectClass    *g_object_class;
+#if !GTK_CHECK_VERSION(3, 0, 0)
        GtkObjectClass  *gtk_object_class;
+#endif
        GtkWidgetClass  *widget_class;
        
        parent_class = g_type_class_peek_parent(klass);
@@ -84,12 +92,19 @@ static void claws_spell_entry_class_init(ClawsSpellEntryClass *klass)
        g_object_class = G_OBJECT_CLASS(klass);
        g_object_class->finalize = claws_spell_entry_finalize;
        
+#if !GTK_CHECK_VERSION(3, 0, 0)
        gtk_object_class = GTK_OBJECT_CLASS(klass);
        gtk_object_class->destroy = claws_spell_entry_destroy;
+#endif
        
        widget_class = GTK_WIDGET_CLASS(klass);
-       widget_class->expose_event = claws_spell_entry_expose;
        widget_class->button_press_event = claws_spell_entry_button_press;
+#if !GTK_CHECK_VERSION(3, 0, 0)
+       widget_class->expose_event = claws_spell_entry_expose;
+#else
+       widget_class->draw = claws_spell_entry_expose;
+       widget_class->destroy = claws_spell_entry_destroy;
+#endif
        
        g_type_class_add_private(g_object_class,
                        sizeof(struct _ClawsSpellEntryPriv));
@@ -129,10 +144,17 @@ static void claws_spell_entry_finalize(GObject *object)
        G_OBJECT_CLASS(parent_class)->finalize(object);
 }
 
+#if !GTK_CHECK_VERSION(3, 0, 0)
 static void claws_spell_entry_destroy(GtkObject *object)
 {
        GTK_OBJECT_CLASS(parent_class)->destroy(object);
 }
+#else
+static void claws_spell_entry_destroy(GtkWidget *object)
+{
+       GTK_WIDGET_CLASS(parent_class)->destroy(object);
+}
+#endif
 
 GtkWidget *claws_spell_entry_new(void)
 {
@@ -436,7 +458,11 @@ void claws_spell_entry_recheck_all(ClawsSpellEntry *entry)
        }
 }
 
+#if !GTK_CHECK_VERSION(3, 0, 0)
 static gint claws_spell_entry_expose(GtkWidget *widget, GdkEventExpose *event)
+#else
+static gint claws_spell_entry_expose(GtkWidget *widget, cairo_t *cr)
+#endif
 {
        ClawsSpellEntry *entry = CLAWS_SPELL_ENTRY(widget);
        GtkEntry *gtk_entry = GTK_ENTRY(widget);
@@ -447,7 +473,11 @@ static gint claws_spell_entry_expose(GtkWidget *widget, GdkEventExpose *event)
                pango_layout_set_attributes(layout, entry->priv->attr_list);
        }
 
+#if !GTK_CHECK_VERSION(3, 0, 0)
        return GTK_WIDGET_CLASS(parent_class)->expose_event (widget, event);
+#else
+       return GTK_WIDGET_CLASS(parent_class)->draw (widget, cr);
+#endif
 }
 
 static gint claws_spell_entry_button_press(GtkWidget *widget, GdkEventButton *event)