[evolution-data-server/openismus-work-3-8: 92/116] Bump required GTK+ version to 3.10



commit 4c39917dbf3c82fa6fa816d655d5889f4e17c8c0
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date:   Mon Aug 19 20:21:06 2013 +0200

    Bump required GTK+ version to 3.10
    
    The GTK+ requirement is a soft dependancy, bumping it for the
    purpose of building the cursor example program which uses the
    new template features from GTK+

 configure.ac                          |    4 +-
 tests/cursor-example/cursor-example.c |   47 ++++++++++++++-------------------
 tests/cursor-example/cursor-search.c  |   24 ++++++----------
 tests/cursor-example/cursor-slot.c    |   21 ++++----------
 tests/cursor-example/cursor-slot.h    |    4 +-
 5 files changed, 39 insertions(+), 61 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index dc07bbe..b780c49 100644
--- a/configure.ac
+++ b/configure.ac
@@ -36,11 +36,11 @@ dnl Required Package Versions
 
 dnl Keep these two definitions in agreement.
 m4_define([glib_minimum_version], [2.34])
-m4_define([glib_encoded_version], [GLIB_VERSION_2_34])
+m4_define([glib_encoded_version], [GLIB_VERSION_2_38])
 
 dnl Keep these two definitions in agreement.
 m4_define([gdk_minimum_version], [3.9])
-m4_define([gdk_encoded_version], [GDK_VERSION_3_2])
+m4_define([gdk_encoded_version], [GDK_VERSION_3_10])
 
 dnl Keep these two definitions in agreement.
 m4_define([soup_minimum_version], [2.40.3])
diff --git a/tests/cursor-example/cursor-example.c b/tests/cursor-example/cursor-example.c
index e432ee1..ad10966 100644
--- a/tests/cursor-example/cursor-example.c
+++ b/tests/cursor-example/cursor-example.c
@@ -111,7 +111,7 @@ struct _CursorExamplePrivate {
        TimeoutActivity       activity;
 };
 
-G_DEFINE_TYPE (CursorExample, cursor_example, GTK_TYPE_WINDOW);
+G_DEFINE_TYPE_WITH_PRIVATE (CursorExample, cursor_example, GTK_TYPE_WINDOW);
 
 /************************************************************************
  *                          GObjectClass                                *
@@ -129,30 +129,26 @@ cursor_example_class_init (CursorExampleClass *klass)
        /* Bind to template */
        widget_class = GTK_WIDGET_CLASS (klass);
        gtk_widget_class_set_template_from_resource (widget_class, 
"/org/gnome/evolution/cursor-example/cursor-example.ui");
-
-       gtk_widget_class_bind_child (widget_class, CursorExamplePrivate, navigator);
-       gtk_widget_class_bind_child (widget_class, CursorExamplePrivate, browse_up_button);
-       gtk_widget_class_bind_child (widget_class, CursorExamplePrivate, browse_down_button);
-       gtk_widget_class_bind_child (widget_class, CursorExamplePrivate, alphabet_label);
-       gtk_widget_class_bind_child (widget_class, CursorExamplePrivate, total_label);
-       gtk_widget_class_bind_child (widget_class, CursorExamplePrivate, position_label);
+       gtk_widget_class_bind_template_child_private (widget_class, CursorExample, navigator);
+       gtk_widget_class_bind_template_child_private (widget_class, CursorExample, browse_up_button);
+       gtk_widget_class_bind_template_child_private (widget_class, CursorExample, browse_down_button);
+       gtk_widget_class_bind_template_child_private (widget_class, CursorExample, alphabet_label);
+       gtk_widget_class_bind_template_child_private (widget_class, CursorExample, total_label);
+       gtk_widget_class_bind_template_child_private (widget_class, CursorExample, position_label);
 
        for (i = 0; i < N_SLOTS; i++) {
                gchar *name = g_strdup_printf ("contact_slot_%d", i + 1);
 
-               /* XXX Watchout... this GTK+ API will change name soon */
-               gtk_widget_class_automate_child (widget_class, name, FALSE, -1);
+               gtk_widget_class_bind_template_child_full (widget_class, name, FALSE, 0);
                g_free (name);
        }
 
-       gtk_widget_class_bind_callback (widget_class, cursor_example_navigator_changed);
-       gtk_widget_class_bind_callback (widget_class, cursor_example_up_button_press);
-       gtk_widget_class_bind_callback (widget_class, cursor_example_up_button_release);
-       gtk_widget_class_bind_callback (widget_class, cursor_example_down_button_press);
-       gtk_widget_class_bind_callback (widget_class, cursor_example_down_button_release);
-       gtk_widget_class_bind_callback (widget_class, cursor_example_sexp_changed);
-
-       g_type_class_add_private (object_class, sizeof (CursorExamplePrivate));
+       gtk_widget_class_bind_template_callback (widget_class, cursor_example_navigator_changed);
+       gtk_widget_class_bind_template_callback (widget_class, cursor_example_up_button_press);
+       gtk_widget_class_bind_template_callback (widget_class, cursor_example_up_button_release);
+       gtk_widget_class_bind_template_callback (widget_class, cursor_example_down_button_press);
+       gtk_widget_class_bind_template_callback (widget_class, cursor_example_down_button_release);
+       gtk_widget_class_bind_template_callback (widget_class, cursor_example_sexp_changed);
 }
 
 static void
@@ -161,23 +157,20 @@ cursor_example_init (CursorExample *example)
        CursorExamplePrivate *priv;
        gint i;
 
+       example->priv = priv =
+               cursor_example_get_instance_private (example);
+
        g_type_ensure (CURSOR_TYPE_NAVIGATOR);
        g_type_ensure (CURSOR_TYPE_SEARCH);
 
-       example->priv = priv = 
-               G_TYPE_INSTANCE_GET_PRIVATE (example,
-                                CURSOR_TYPE_EXAMPLE,
-                                CursorExamplePrivate);
-
        gtk_widget_init_template (GTK_WIDGET (example));
 
        for (i = 0; i < N_SLOTS; i++) {
 
-               /* XXX Watchout... this GTK+ API will change name soon */
                gchar *name = g_strdup_printf ("contact_slot_%d", i + 1);
-               priv->slots[i] = (GtkWidget *)gtk_widget_get_automated_child (GTK_WIDGET (example),
-                                                                             CURSOR_TYPE_EXAMPLE,
-                                                                             name);
+               priv->slots[i] = (GtkWidget *)gtk_widget_get_template_child (GTK_WIDGET (example),
+                                                                            CURSOR_TYPE_EXAMPLE,
+                                                                            name);
                g_free (name);
        }
 }
diff --git a/tests/cursor-example/cursor-search.c b/tests/cursor-example/cursor-search.c
index 9e8358d..6b2b45e 100644
--- a/tests/cursor-example/cursor-search.c
+++ b/tests/cursor-example/cursor-search.c
@@ -63,7 +63,7 @@ enum {
        PROP_SEXP,
 };
 
-G_DEFINE_TYPE (CursorSearch, cursor_search, GTK_TYPE_SEARCH_ENTRY);
+G_DEFINE_TYPE_WITH_PRIVATE (CursorSearch, cursor_search, GTK_TYPE_SEARCH_ENTRY);
 
 /************************************************************************
  *                          GObjectClass                                *
@@ -78,7 +78,6 @@ cursor_search_class_init (CursorSearchClass *klass)
        object_class->finalize = cursor_search_finalize;
        object_class->get_property = cursor_search_get_property;
 
-
        g_object_class_install_property (
                object_class,
                PROP_SEXP,
@@ -93,15 +92,13 @@ cursor_search_class_init (CursorSearchClass *klass)
        /* Bind to template */
        widget_class = GTK_WIDGET_CLASS (klass);
        gtk_widget_class_set_template_from_resource (widget_class, 
"/org/gnome/evolution/cursor-example/cursor-search.ui");
-       gtk_widget_class_bind_child (widget_class, CursorSearchPrivate, popup);
-       gtk_widget_class_bind_child (widget_class, CursorSearchPrivate, name_radio);
-       gtk_widget_class_bind_child (widget_class, CursorSearchPrivate, phone_radio);
-       gtk_widget_class_bind_child (widget_class, CursorSearchPrivate, email_radio);
-       gtk_widget_class_bind_callback (widget_class, cursor_search_option_toggled);
-       gtk_widget_class_bind_callback (widget_class, cursor_search_entry_changed);
-       gtk_widget_class_bind_callback (widget_class, cursor_search_icon_press);
-
-       g_type_class_add_private (object_class, sizeof (CursorSearchPrivate));
+       gtk_widget_class_bind_template_child_private (widget_class, CursorSearch, popup);
+       gtk_widget_class_bind_template_child_private (widget_class, CursorSearch, name_radio);
+       gtk_widget_class_bind_template_child_private (widget_class, CursorSearch, phone_radio);
+       gtk_widget_class_bind_template_child_private (widget_class, CursorSearch, email_radio);
+       gtk_widget_class_bind_template_callback (widget_class, cursor_search_option_toggled);
+       gtk_widget_class_bind_template_callback (widget_class, cursor_search_entry_changed);
+       gtk_widget_class_bind_template_callback (widget_class, cursor_search_icon_press);
 }
 
 static void
@@ -109,10 +106,7 @@ cursor_search_init (CursorSearch *search)
 {
        CursorSearchPrivate *priv;
 
-       search->priv = priv = 
-               G_TYPE_INSTANCE_GET_PRIVATE (search,
-                                CURSOR_TYPE_SEARCH,
-                                CursorSearchPrivate);
+       search->priv = priv = cursor_search_get_instance_private (search);
 
        gtk_widget_init_template (GTK_WIDGET (search));
 
diff --git a/tests/cursor-example/cursor-slot.c b/tests/cursor-example/cursor-slot.c
index 83d5184..2edd4e0 100644
--- a/tests/cursor-example/cursor-slot.c
+++ b/tests/cursor-example/cursor-slot.c
@@ -35,7 +35,7 @@ struct _CursorSlotPrivate {
        GtkLabel  *telephones_label;
 };
 
-G_DEFINE_TYPE (CursorSlot, cursor_slot, GTK_TYPE_GRID);
+G_DEFINE_TYPE_WITH_PRIVATE (CursorSlot, cursor_slot, GTK_TYPE_GRID);
 
 /************************************************************************
  *                          GObjectClass                                *
@@ -43,30 +43,21 @@ G_DEFINE_TYPE (CursorSlot, cursor_slot, GTK_TYPE_GRID);
 static void
 cursor_slot_class_init (CursorSlotClass *klass)
 {
-       GObjectClass *object_class;
        GtkWidgetClass *widget_class;
 
        /* Bind to template */
        widget_class = GTK_WIDGET_CLASS (klass);
        gtk_widget_class_set_template_from_resource (widget_class, 
"/org/gnome/evolution/cursor-example/cursor-slot.ui");
-       gtk_widget_class_bind_child (widget_class, CursorSlotPrivate, area);
-       gtk_widget_class_bind_child (widget_class, CursorSlotPrivate, name_label);
-       gtk_widget_class_bind_child (widget_class, CursorSlotPrivate, emails_label);
-       gtk_widget_class_bind_child (widget_class, CursorSlotPrivate, telephones_label);
-
-       object_class = G_OBJECT_CLASS (klass);
-       g_type_class_add_private (object_class, sizeof (CursorSlotPrivate));
+       gtk_widget_class_bind_template_child_private (widget_class, CursorSlot, area);
+       gtk_widget_class_bind_template_child_private (widget_class, CursorSlot, name_label);
+       gtk_widget_class_bind_template_child_private (widget_class, CursorSlot, emails_label);
+       gtk_widget_class_bind_template_child_private (widget_class, CursorSlot, telephones_label);
 }
 
 static void
 cursor_slot_init (CursorSlot *slot)
 {
-       CursorSlotPrivate *priv;
-
-       slot->priv = priv = 
-               G_TYPE_INSTANCE_GET_PRIVATE (slot,
-                                CURSOR_TYPE_SLOT,
-                                CursorSlotPrivate);
+       slot->priv = cursor_slot_get_instance_private (slot);
 
        gtk_widget_init_template (GTK_WIDGET (slot));
 }
diff --git a/tests/cursor-example/cursor-slot.h b/tests/cursor-example/cursor-slot.h
index 9f2994b..39bb672 100644
--- a/tests/cursor-example/cursor-slot.h
+++ b/tests/cursor-example/cursor-slot.h
@@ -40,14 +40,14 @@ typedef struct _CursorSlotClass    CursorSlotClass;
 
 struct _CursorSlot
 {
-       GtkWindow parent_instance;
+       GtkGrid parent_instance;
 
        CursorSlotPrivate *priv;
 };
 
 struct _CursorSlotClass
 {
-       GtkWindowClass parent_class;
+       GtkGridClass parent_class;
 };
 
 GType       cursor_slot_get_type         (void) G_GNUC_CONST;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]