From 42e70735c78d12d88ff9ec2d1c44d3edbadd29b5 Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Mon, 5 Nov 2012 13:56:30 +0200 Subject: [editable-label|entry] use GtkEditableClass on GTK2, GtkEditableInterface on GTK3 editable-label: rename GtkEditableClass->GtkEditableInterface http://git.gnome.org/browse/nautilus/commit/?id=a58bbde4ca6b11eeb1bca5fa4e62e60c0b26271b entry: rename GtkEditableClass->GtkEditableInterface http://git.gnome.org/browse/nautilus/commit/?id=aeb53075ed55dc2a2ef3228917ded1b8029bfdff --- libcaja-private/caja-entry.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'libcaja-private/caja-entry.c') diff --git a/libcaja-private/caja-entry.c b/libcaja-private/caja-entry.c index 31b590c3..fa3669eb 100644 --- a/libcaja-private/caja-entry.c +++ b/libcaja-private/caja-entry.c @@ -35,6 +35,10 @@ #include #include +#if !GTK_CHECK_VERSION(3, 0, 0) +#define GtkEditableInterface GtkEditableClass +#endif + struct CajaEntryDetails { gboolean user_edit; @@ -51,13 +55,13 @@ enum }; static guint signals[LAST_SIGNAL]; -static void caja_entry_editable_init (GtkEditableClass *iface); +static void caja_entry_editable_init (GtkEditableInterface *iface); G_DEFINE_TYPE_WITH_CODE (CajaEntry, caja_entry, GTK_TYPE_ENTRY, G_IMPLEMENT_INTERFACE (GTK_TYPE_EDITABLE, caja_entry_editable_init)); -static GtkEditableClass *parent_editable_interface = NULL; +static GtkEditableInterface *parent_editable_interface = NULL; static void caja_entry_init (CajaEntry *entry) @@ -373,7 +377,7 @@ caja_entry_selection_clear (GtkWidget *widget, } static void -caja_entry_editable_init (GtkEditableClass *iface) +caja_entry_editable_init (GtkEditableInterface *iface) { parent_editable_interface = g_type_interface_peek_parent (iface); -- cgit v1.2.1 From 0d0641f10e84e0de0b39e63789508c260913cc98 Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Mon, 5 Nov 2012 14:20:13 +0200 Subject: [lc-p] convert to new GDK_KEY prefix http://git.gnome.org/browse/nautilus/commit/?id=64dcbea2a005e4ed8bb4945d06a943058b8c7ba8 --- libcaja-private/caja-entry.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libcaja-private/caja-entry.c') diff --git a/libcaja-private/caja-entry.c b/libcaja-private/caja-entry.c index fa3669eb..863b1b4f 100644 --- a/libcaja-private/caja-entry.c +++ b/libcaja-private/caja-entry.c @@ -127,7 +127,7 @@ caja_entry_key_press (GtkWidget *widget, GdkEventKey *event) switch (event->keyval) { - case GDK_Tab: + case GDK_KEY_Tab: /* The location bar entry wants TAB to work kind of * like it does in the shell for command completion, * so if we get a tab and there's a selection, we -- cgit v1.2.1 From 4895118afc287dc511792a5f91f109a2e1f868d0 Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Wed, 31 Oct 2012 04:23:12 +0200 Subject: [lc-p] don't use GtkObject (GTK3) the ::destroy signal of GtkObject has only been moved to GtkWidget in GTK3 (after GtkObject removal): http://developer.gnome.org/gtk3/3.0/ch25s02.html So, we use conditionals in this case, to keep working with GTK2 Original commit: http://git.gnome.org/browse/nautilus/commit/?id=aef4cfcf93ef34a0b2d4c87b40fcec2b7a66dd06 --- libcaja-private/caja-entry.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'libcaja-private/caja-entry.c') diff --git a/libcaja-private/caja-entry.c b/libcaja-private/caja-entry.c index 863b1b4f..fb9ac38c 100644 --- a/libcaja-private/caja-entry.c +++ b/libcaja-private/caja-entry.c @@ -395,12 +395,10 @@ static void caja_entry_class_init (CajaEntryClass *class) { GtkWidgetClass *widget_class; - GtkObjectClass *object_class; GObjectClass *gobject_class; widget_class = GTK_WIDGET_CLASS (class); gobject_class = G_OBJECT_CLASS (class); - object_class = GTK_OBJECT_CLASS (class); widget_class->button_press_event = caja_entry_button_press; widget_class->button_release_event = caja_entry_button_release; @@ -413,19 +411,17 @@ caja_entry_class_init (CajaEntryClass *class) /* Set up signals */ signals[USER_CHANGED] = g_signal_new ("user_changed", - G_TYPE_FROM_CLASS (object_class), + G_TYPE_FROM_CLASS (class), G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (CajaEntryClass, - user_changed), + G_STRUCT_OFFSET (CajaEntryClass, user_changed), NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); signals[SELECTION_CHANGED] = g_signal_new ("selection_changed", - G_TYPE_FROM_CLASS (object_class), + G_TYPE_FROM_CLASS (class), G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (CajaEntryClass, - selection_changed), + G_STRUCT_OFFSET (CajaEntryClass, selection_changed), NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); -- cgit v1.2.1