From 9ba1ec5fe80172caab8b3d6bf536aa8f4784e659 Mon Sep 17 00:00:00 2001 From: Andrea Zagli Date: Thu, 25 Jul 2013 10:32:36 +0200 Subject: [PATCH] Changes to compile with gtk3 and libgda5. --- configure.ac | 9 +++------ libgtkform.pc.in | 2 +- libgtkformui.pc.in | 2 +- libgtkformui/gtkformdecoder.c | 20 +++++++++++--------- libgtkformui/test/query_editor.c | 8 ++++---- test/database.db | Bin 2048 -> 2048 bytes 6 files changed, 20 insertions(+), 21 deletions(-) diff --git a/configure.ac b/configure.ac index 01ffcb8..cddb7d3 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) -AC_INIT([libgtkform], [0.4.1], [azagli@libero.it]) +AC_INIT([libgtkform], [0.5.0], [azagli@libero.it]) AC_CONFIG_SRCDIR([libgtkform/form.c]) AC_CONFIG_HEADER([config.h]) @@ -46,11 +46,8 @@ PKG_CHECK_EXISTS(gladeui-1.0 >= 3.2.0, [GLADEUI_FOUND=yes], [GLADEUI_FOUND=no]) AM_CONDITIONAL(GLADEUI, test $GLADEUI_FOUND = yes) -PKG_CHECK_MODULES(GTKFORM, [glib-2.0 >= 2.26 - gtk+-2.0 >= 2.12.0 - libxml-2.0 >= 2.0.0 - libgdaex >= 0.4.0 - libgda-4.0 >= 4.2.3]) +PKG_CHECK_MODULES(GTKFORM, [libxml-2.0 >= 2.0.0 + libgdaex >= 0.5.0]) AC_SUBST(GTKFORM_CFLAGS) AC_SUBST(GTKFORM_LIBS) diff --git a/libgtkform.pc.in b/libgtkform.pc.in index 42b9efe..0968c62 100644 --- a/libgtkform.pc.in +++ b/libgtkform.pc.in @@ -7,6 +7,6 @@ modulesdir=@libdir@/@PACKAGE@/modules Name: @PACKAGE_NAME@ Description: Class to more easly manage Gtk+ forms binded to db (or not). Version: @PACKAGE_VERSION@ -Requires: gtk+-2.0, libxml-2.0, libgdaex +Requires: libxml-2.0 >= 2.0, libgdaex >= 0.5.0 Libs: -L${libdir} -lgtkform Cflags: -I${includedir} diff --git a/libgtkformui.pc.in b/libgtkformui.pc.in index 73fe473..a381a9e 100644 --- a/libgtkformui.pc.in +++ b/libgtkformui.pc.in @@ -6,6 +6,6 @@ includedir=@includedir@ Name: @PACKAGE_NAME@ui Description: Class to more easly manage Gtk+ forms binded to db (or not) UI. Version: @PACKAGE_VERSION@ -Requires: gtk+-2.0, libgtkform +Requires: libgtkform Libs: -L${libdir} -lgtkformui Cflags: -I${includedir} diff --git a/libgtkformui/gtkformdecoder.c b/libgtkformui/gtkformdecoder.c index 2620e8d..a1f6249 100644 --- a/libgtkformui/gtkformdecoder.c +++ b/libgtkformui/gtkformdecoder.c @@ -1,7 +1,7 @@ /* * GtkFormDecoder widget for GTK+ * - * Copyright (C) 2011-2012 Andrea Zagli + * Copyright (C) 2011-2013 Andrea Zagli * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -138,7 +138,7 @@ gtk_form_decoder_class_init (GtkFormDecoderClass *klass) object_class->set_property = gtk_form_decoder_set_property; object_class->get_property = gtk_form_decoder_get_property; - widget_class->size_request = gtk_form_decoder_size_request; + /*widget_class->size_request = gtk_form_decoder_size_request;*/ widget_class->size_allocate = gtk_form_decoder_size_allocate; g_object_class_install_property (object_class, PROP_GDAEX, @@ -251,7 +251,7 @@ gtk_form_decoder_init (GtkFormDecoder *decoder) GtkWidget *icon; - priv->hbox = gtk_hbox_new (FALSE, 1); + priv->hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 1); gtk_container_add (GTK_CONTAINER (decoder), priv->hbox); gtk_widget_show (priv->hbox); @@ -788,9 +788,9 @@ gtk_form_decoder_size_request (GtkWidget *widget, requisition->width = 0; requisition->height = 0; - if (bin->child && GTK_WIDGET_VISIBLE (bin->child)) + if (gtk_bin_get_child (bin) && gtk_widget_get_visible (GTK_WIDGET (gtk_bin_get_child (bin)))) { - gtk_widget_size_request (bin->child, &child_requisition); + gtk_widget_size_request (gtk_bin_get_child (bin), &child_requisition); requisition->width += child_requisition.width; requisition->height += child_requisition.height; } @@ -806,6 +806,7 @@ gtk_form_decoder_size_allocate (GtkWidget *widget, { GtkFormDecoder *decoder; GtkBin *bin; + GtkAllocation w_allocation; GtkAllocation relative_allocation; GtkAllocation child_allocation; @@ -822,16 +823,17 @@ gtk_form_decoder_size_allocate (GtkWidget *widget, border_width = gtk_container_get_border_width (GTK_CONTAINER (widget)); relative_allocation.x = border_width; relative_allocation.y = border_width; - relative_allocation.width = MAX (1, (gint)widget->allocation.width - relative_allocation.x * 2); - relative_allocation.height = MAX (1, (gint)widget->allocation.height - relative_allocation.y * 2); + gtk_widget_get_allocation (widget, &w_allocation); + relative_allocation.width = MAX (1, w_allocation.width - relative_allocation.x * 2); + relative_allocation.height = MAX (1, w_allocation.height - relative_allocation.y * 2); - if (bin->child && GTK_WIDGET_VISIBLE (bin->child)) + if (gtk_bin_get_child (bin) && gtk_widget_get_visible (GTK_WIDGET (gtk_bin_get_child (bin)))) { child_allocation.x = relative_allocation.x + allocation->x; child_allocation.y = relative_allocation.y + allocation->y; child_allocation.width = relative_allocation.width; child_allocation.height = relative_allocation.height; - gtk_widget_size_allocate (bin->child, &child_allocation); + gtk_widget_size_allocate (gtk_bin_get_child (bin), &child_allocation); } } diff --git a/libgtkformui/test/query_editor.c b/libgtkformui/test/query_editor.c index d160d09..23fea6e 100644 --- a/libgtkformui/test/query_editor.c +++ b/libgtkformui/test/query_editor.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 Andrea Zagli + * Copyright (C) 2011-2013 Andrea Zagli * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -413,15 +413,15 @@ main (int argc, char *argv[]) g_signal_connect (G_OBJECT (w), "delete-event", gtk_main_quit, NULL); - vbox = gtk_vbox_new (FALSE, 5); + vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5); gtk_container_add (GTK_CONTAINER (w), vbox); widget_qe = gdaex_query_editor_get_widget (qe); gtk_box_pack_start (GTK_BOX (vbox), widget_qe, TRUE, TRUE, 5); - hbtnbox = gtk_hbutton_box_new (); + hbtnbox = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL); gtk_button_box_set_layout (GTK_BUTTON_BOX (hbtnbox), GTK_BUTTONBOX_END); - gtk_button_box_set_spacing (GTK_BUTTON_BOX (hbtnbox), 5); + gtk_box_set_spacing (GTK_BOX (hbtnbox), 5); gtk_box_pack_start (GTK_BOX (vbox), hbtnbox, FALSE, FALSE, 5); btn_clean = gtk_button_new_from_stock ("gtk-clear"); diff --git a/test/database.db b/test/database.db index 602456713569ef10155bfc06dab307e3a5a1ddf2..1f59497cecac716841cf83235fa9d5020ef7563e 100644 GIT binary patch delta 144 zcmZn=Xb_kn&FDQ*#+l!nLHCgwF9QPuBhzmNrr#S2yO=irVB%xskYHe%#}vjSv6+vB zi^KYjOGE5F*vtTrw+|PEKh4~DF;lx7S$+OuFS%9{hOuoQw000D5Bz*t? delta 144 zcmZn=Xb_kn&FDE%#+l!fLHCgqF9QPuBhzmNrr#S2yO=irVB%xs2xDNH#}vkVW-}iP z7n9xLHJk>P>c)n~M(T&xs2dp@SegK7O9d`