[libgda] GNOME 3.0 and GSeal corrections
- From: Vivien Malerba <vivien src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [libgda] GNOME 3.0 and GSeal corrections
- Date: Mon, 7 Dec 2009 21:32:26 +0000 (UTC)
commit 6e11f5e3f34b88fa5985e46ac6df2500e7cc69aa
Author: Vivien Malerba <malerba gnome-db org>
Date: Mon Dec 7 22:02:35 2009 +0100
GNOME 3.0 and GSeal corrections
control-center/cc-gray-bar.c | 117 ++++++++++---
control-center/cc-gray-bar.h | 3 +-
control-center/dsn-config.c | 3 -
control-center/dsn-config.h | 2 +-
control-center/dsn-properties-dialog.c | 28 +++-
control-center/dsn-properties-dialog.h | 4 +-
control-center/gdaui-dsn-assistant.h | 2 +-
control-center/gdaui-dsn-editor.c | 3 +-
control-center/gdaui-dsn-editor.h | 2 +-
control-center/gdaui-login-dialog.c | 18 +-
control-center/gdaui-login-dialog.h | 2 +-
control-center/main.c | 5 +-
control-center/provider-config.c | 6 +-
control-center/provider-config.h | 2 +-
doc/C/Makefile.am | 2 +-
.../data-entries/gdaui-data-cell-renderer-bin.c | 19 ++-
.../gdaui-data-cell-renderer-boolean.c | 34 +++--
.../gdaui-data-cell-renderer-boolean.h | 10 +-
.../data-entries/gdaui-data-cell-renderer-combo.c | 53 ++++--
.../data-entries/gdaui-data-cell-renderer-info.c | 40 +++--
.../gdaui-data-cell-renderer-textual.c | 28 ++--
libgda-ui/data-entries/gdaui-entry-bin.c | 16 ++-
libgda-ui/data-entries/gdaui-entry-common-time.c | 92 +++++++----
libgda-ui/data-entries/gdaui-entry-number.c | 27 +++-
libgda-ui/data-entries/gdaui-entry-string.c | 58 ++++---
libgda-ui/data-entries/gdaui-entry-time.c | 2 +-
libgda-ui/data-entries/gdaui-entry-wrapper.c | 6 +-
libgda-ui/data-entries/gdaui-entry.h | 2 +-
libgda-ui/data-entries/gdaui-formatted-entry.c | 2 +-
.../plugins/gdaui-data-cell-renderer-cgrid.c | 18 ++-
.../plugins/gdaui-data-cell-renderer-password.c | 36 +++--
.../plugins/gdaui-data-cell-renderer-pict.c | 23 ++-
libgda-ui/data-entries/plugins/gdaui-entry-cgrid.c | 49 ++++--
libgda-ui/data-entries/plugins/gdaui-entry-pict.c | 9 +-
libgda-ui/demos/cloud.c | 13 ++-
libgda-ui/demos/data_model_dir.c | 13 ++-
libgda-ui/demos/ddl_queries.c | 27 +++-
libgda-ui/demos/form.c | 13 ++-
libgda-ui/demos/form_data_layout.c | 13 ++-
libgda-ui/demos/form_pict.c | 13 ++-
libgda-ui/demos/form_rw.c | 13 ++-
libgda-ui/demos/grid.c | 13 ++-
libgda-ui/demos/grid_data_layout.c | 13 ++-
libgda-ui/demos/grid_pict.c | 13 ++-
libgda-ui/demos/grid_rw.c | 13 ++-
libgda-ui/demos/linked_grid_form.c | 13 ++-
libgda-ui/demos/linked_model_param.c | 15 ++-
libgda-ui/demos/login.c | 13 ++-
libgda-ui/demos/tree.c | 22 ++-
libgda-ui/gdaui-basic-form.c | 179 +++++++++++---------
libgda-ui/gdaui-cloud.c | 10 +-
libgda-ui/gdaui-combo.c | 15 +-
libgda-ui/gdaui-data-store.h | 2 +-
libgda-ui/gdaui-data-widget-filter.c | 12 +-
libgda-ui/gdaui-data-widget.c | 16 +-
libgda-ui/gdaui-init.c | 31 ++--
libgda-ui/gdaui-login.c | 8 +-
libgda-ui/gdaui-login.h | 2 +-
libgda-ui/gdaui-plugin.h | 2 +-
libgda-ui/gdaui-raw-form.c | 32 ++++-
libgda-ui/gdaui-raw-grid.c | 144 ++++++++++------
libgda-ui/gdaui-server-operation.c | 50 +++---
libgda-ui/internal/gdaui-dsn-selector.c | 5 +-
libgda-ui/internal/gdaui-provider-auth-editor.c | 2 -
libgda-ui/internal/gdaui-provider-auth-editor.h | 2 +-
libgda-ui/internal/gdaui-provider-spec-editor.c | 2 -
libgda-ui/internal/gdaui-provider-spec-editor.h | 2 +-
libgda-ui/internal/popup-container.c | 16 ++-
libgda-ui/internal/popup-container.h | 2 +-
libgda-ui/internal/utility.c | 5 +
po/POTFILES.in | 1 +
providers/mdb/gda-mdb-provider.c | 2 +-
tools/browser/auth-dialog.c | 21 ++-
tools/browser/browser-spinner.c | 82 ++++++----
tools/browser/canvas-example.c | 9 +
tools/browser/canvas/browser-canvas-column.c | 6 +-
tools/browser/canvas/browser-canvas-db-relations.c | 8 +
tools/browser/canvas/browser-canvas-table.c | 8 +-
tools/browser/canvas/browser-canvas.c | 47 +++++-
tools/browser/common/gdaui-entry-import.c | 6 +-
tools/browser/common/objects-cloud.c | 11 +-
tools/browser/common/objects-cloud.h | 2 +-
tools/browser/connection-binding-properties.c | 14 ++-
tools/browser/doc/tmpl/browser-connection.sgml | 21 +++
tools/browser/login-dialog.c | 13 +-
tools/browser/query-exec/query-console.c | 9 +-
tools/browser/query-exec/query-console.h | 2 +-
tools/browser/query-exec/query-editor.c | 21 ++-
tools/browser/query-exec/query-editor.h | 2 +-
tools/browser/query-exec/query-favorite-selector.c | 18 ++-
tools/browser/query-exec/query-favorite-selector.h | 2 +-
tools/browser/query-exec/query-result.h | 2 +-
tools/browser/schema-browser/favorite-selector.c | 11 +-
tools/browser/schema-browser/favorite-selector.h | 2 +-
tools/browser/schema-browser/objects-index.c | 4 +-
tools/browser/schema-browser/objects-index.h | 2 +-
tools/browser/schema-browser/relations-diagram.c | 1 -
tools/browser/schema-browser/relations-diagram.h | 2 +-
tools/browser/schema-browser/table-columns.c | 11 +-
tools/browser/schema-browser/table-info.c | 7 +-
tools/browser/schema-browser/table-info.h | 2 +-
tools/browser/support.c | 4 +
102 files changed, 1256 insertions(+), 579 deletions(-)
---
diff --git a/control-center/cc-gray-bar.c b/control-center/cc-gray-bar.c
index e93fc0a..96cfeb4 100644
--- a/control-center/cc-gray-bar.c
+++ b/control-center/cc-gray-bar.c
@@ -22,7 +22,16 @@
* Boston, MA 02111-1307, USA.
*/
+#ifdef GSEAL_ENABLE
+ #define KEEP_GSEAL_ENABLE
+ #undef GSEAL_ENABLE
+#endif
#include <gtk/gtk.h>
+#ifdef KEEP_GSEAL_ENABLE
+ #define GSEAL_ENABLE
+ #undef KEEP_GSEAL_ENABLE
+#endif
+
#include "cc-gray-bar.h"
#define PARENT_TYPE GTK_TYPE_BIN
@@ -76,14 +85,13 @@ static GObjectClass *parent_class = NULL;
static void
cc_gray_bar_realize (GtkWidget *widget)
{
+ gint border_width;
+
+ GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED); /* GTK3 FIXME */
+ border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
GdkWindowAttr attributes;
gint attributes_mask;
- gint border_width;
-
- GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
-
- border_width = GTK_CONTAINER (widget)->border_width;
-
+
attributes.x = widget->allocation.x + border_width;
attributes.y = widget->allocation.y + border_width;
attributes.width = widget->allocation.width - 2*border_width;
@@ -114,12 +122,19 @@ cc_gray_bar_size_request (GtkWidget *widget, GtkRequisition *requisition)
{
GtkBin *bin = GTK_BIN (widget);
GtkRequisition child_requisition;
+ guint bw;
+ gboolean visible = FALSE;
+ GtkWidget *child;
+
+ bw = gtk_container_get_border_width (GTK_CONTAINER (widget));
+ requisition->width = bw * 2;
+ requisition->height = requisition->width;
- requisition->width = GTK_CONTAINER (widget)->border_width * 2;
- requisition->height = GTK_CONTAINER (widget)->border_width * 2;
-
- if (bin->child && GTK_WIDGET_VISIBLE (bin->child)) {
- gtk_widget_size_request (bin->child, &child_requisition);
+ child = gtk_bin_get_child (bin);
+ if (child)
+ g_object_get ((GObject*) child, "visible", &visible, NULL);
+ if (visible) {
+ gtk_widget_size_request (child, &child_requisition);
requisition->width += child_requisition.width;
requisition->height += child_requisition.height;
@@ -131,25 +146,40 @@ cc_gray_bar_allocate (GtkWidget *widget, GtkAllocation *allocation)
{
GtkBin *bin;
GtkAllocation child_allocation;
-
+ guint bw;
+ GdkWindow *win;
+
+#if GTK_CHECK_VERSION(2,18,0)
+ gtk_widget_set_allocation (widget, allocation);
+#else
widget->allocation = *allocation;
+#endif
+
bin = GTK_BIN (widget);
child_allocation.x = 0;
child_allocation.y = 0;
- child_allocation.width = MAX (allocation->width - GTK_CONTAINER (widget)->border_width * 2, 0);
- child_allocation.height = MAX (allocation->height - GTK_CONTAINER (widget)->border_width * 2, 0);
+ bw = gtk_container_get_border_width (GTK_CONTAINER (widget));
+ child_allocation.width = MAX (allocation->width - bw * 2, 0);
+ child_allocation.height = MAX (allocation->height - bw * 2, 0);
- if (GTK_WIDGET_REALIZED (widget)) {
- gdk_window_move_resize (widget->window,
- allocation->x + GTK_CONTAINER (widget)->border_width,
- allocation->y + GTK_CONTAINER (widget)->border_width,
+#if GTK_CHECK_VERSION(2,18,0)
+ win = gtk_widget_get_window (widget);
+#else
+ win = widget->window;
+#endif
+ if (win) {
+ gdk_window_move_resize (win,
+ allocation->x + bw,
+ allocation->y + bw,
child_allocation.width,
child_allocation.height);
}
- if (bin->child)
- gtk_widget_size_allocate (bin->child, &child_allocation);
+ GtkWidget *child;
+ child = gtk_bin_get_child (bin);
+ if (child)
+ gtk_widget_size_allocate (child, &child_allocation);
}
static void
@@ -174,27 +204,54 @@ cc_gray_bar_style_set (GtkWidget *w, GtkStyle *previous_style)
static void
cc_gray_bar_paint (GtkWidget *widget, GdkRectangle *area)
{
- if (!GTK_WIDGET_APP_PAINTABLE (widget)) {
- gtk_paint_flat_box (widget->style, widget->window,
- widget->state, GTK_SHADOW_NONE,
+ gboolean paintable;
+
+#if GTK_CHECK_VERSION(2,18,0)
+ paintable = gtk_widget_get_app_paintable (widget);
+#else
+ paintable = GTK_WIDGET_APP_PAINTABLE (widget);
+#endif
+ if (!paintable) {
+ GtkStyle *style;
+ GdkWindow *win;
+ GtkAllocation alloc;
+ GtkStateType state;
+
+ style = gtk_widget_get_style (widget);
+#if GTK_CHECK_VERSION(2,18,0)
+ state = gtk_widget_get_state (widget);
+ win = gtk_widget_get_window (widget);
+ gtk_widget_get_allocation (widget, &alloc);
+#else
+ state = widget->state;
+ win = widget->window;
+ alloc = widget->allocation;
+#endif
+ gtk_paint_flat_box (style, win,
+ state, GTK_SHADOW_NONE,
area, widget, "gnomedbgraybar",
1, 1,
- (widget->allocation.width - 2),
- (widget->allocation.height - 2));
+ alloc.width - 2,
+ alloc.height - 2);
}
}
static gboolean
cc_gray_bar_expose (GtkWidget *widget, GdkEventExpose *event)
{
+ gboolean drawable;
g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (CC_IS_GRAY_BAR (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
if (event->count > 0)
return FALSE;
-
- if (GTK_WIDGET_DRAWABLE (widget)) {
+#if GTK_CHECK_VERSION(2,18,0)
+ drawable = gtk_widget_is_drawable (widget);
+#else
+ drawable = GTK_WIDGET_DRAWABLE (widget);
+#endif
+ if (drawable) {
cc_gray_bar_paint (widget, &event->area);
(* GTK_WIDGET_CLASS (parent_class)->expose_event) (widget, event);
@@ -235,9 +292,11 @@ cc_gray_bar_class_init (CcGrayBarClass *klass)
static void
cc_gray_bar_init (CcGrayBar *bar, CcGrayBarClass *klass)
{
+#if GTK_CHECK_VERSION(2,18,0)
+ gtk_widget_set_has_window (GTK_WIDGET (bar), TRUE);
+#else
GTK_WIDGET_UNSET_FLAGS (bar, GTK_NO_WINDOW);
-
- g_return_if_fail (CC_IS_GRAY_BAR (bar));
+#endif
bar->priv = g_new0 (CcGrayBarPrivate, 1);
diff --git a/control-center/cc-gray-bar.h b/control-center/cc-gray-bar.h
index d32bd17..d135dce 100644
--- a/control-center/cc-gray-bar.h
+++ b/control-center/cc-gray-bar.h
@@ -24,8 +24,7 @@
#ifndef __CC_GRAY_BAR_H__
#define __CC_GRAY_BAR_H__
-#include <gtk/gtkbin.h>
-#include <gtk/gtkimage.h>
+#include <gtk/gtk.h>
G_BEGIN_DECLS
diff --git a/control-center/dsn-config.c b/control-center/dsn-config.c
index c641d62..78d6252 100644
--- a/control-center/dsn-config.c
+++ b/control-center/dsn-config.c
@@ -25,9 +25,6 @@
#include <libgda/binreloc/gda-binreloc.h>
#include <libgda/gda-config.h>
#include <libgda/gda-data-model-array.h>
-#include <gtk/gtkstock.h>
-#include <gtk/gtktable.h>
-#include <gtk/gtkvbbox.h>
#include <libgda-ui/libgda-ui.h>
#include "dsn-config.h"
#include "dsn-properties-dialog.h"
diff --git a/control-center/dsn-config.h b/control-center/dsn-config.h
index 0819214..cd49a84 100644
--- a/control-center/dsn-config.h
+++ b/control-center/dsn-config.h
@@ -23,7 +23,7 @@
#ifndef __DSN_CONFIG_H__
#define __DSN_CONFIG_H__
-#include <gtk/gtkwidget.h>
+#include <gtk/gtk.h>
GtkWidget *dsn_config_new (void);
void dsn_config_edit_properties (GtkWidget *dsn);
diff --git a/control-center/dsn-properties-dialog.c b/control-center/dsn-properties-dialog.c
index f7af81a..7f8c293 100644
--- a/control-center/dsn-properties-dialog.c
+++ b/control-center/dsn-properties-dialog.c
@@ -21,11 +21,7 @@
*/
#include <glib/gi18n-lib.h>
-#include <gtk/gtkdialog.h>
-#include <gtk/gtklabel.h>
-#include <gtk/gtknotebook.h>
-#include <gtk/gtkstock.h>
-#include <gtk/gtktable.h>
+#include <gtk/gtk.h>
#include <libgda-ui/libgda-ui.h>
#include <libgda/binreloc/gda-binreloc.h>
#include "dsn-properties-dialog.h"
@@ -88,6 +84,12 @@ data_source_info_free (GdaDsnInfo *info)
g_free (info);
}
+static void
+delete_event_cb (GtkDialog *dlg, gpointer data)
+{
+ gtk_dialog_response (dlg, GTK_RESPONSE_OK);
+}
+
void
dsn_properties_dialog (GtkWindow *parent, const gchar *dsn)
{
@@ -114,6 +116,7 @@ dsn_properties_dialog (GtkWindow *parent, const gchar *dsn)
gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), TEST_BUTTON, pinfo ? TRUE : FALSE);
+ gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), BROWSE_BUTTON, pinfo ? TRUE : FALSE);
gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), REVERT_BUTTON, FALSE);
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
@@ -156,11 +159,18 @@ dsn_properties_dialog (GtkWindow *parent, const gchar *dsn)
gtk_label_set_markup (GTK_LABEL (label), str);
gtk_misc_set_alignment (GTK_MISC (label), 0., -1);
g_free (str);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), label, FALSE, FALSE, 0);
+
+ GtkWidget *dcontents;
+#if GTK_CHECK_VERSION(2,18,0)
+ dcontents = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
+#else
+ dcontents = GTK_DIALOG (dialog)->vbox;
+#endif
+ gtk_box_pack_start (GTK_BOX (dcontents), label, FALSE, FALSE, 0);
gtk_widget_show (label);
hbox = gtk_hbox_new (FALSE, 0); /* HIG */
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox, FALSE, FALSE, 10);
+ gtk_box_pack_start (GTK_BOX (dcontents), hbox, FALSE, FALSE, 10);
gtk_widget_show (hbox);
label = gtk_label_new (" ");
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
@@ -174,6 +184,10 @@ dsn_properties_dialog (GtkWindow *parent, const gchar *dsn)
gtk_box_pack_start (GTK_BOX (hbox), props, TRUE, TRUE, 0);
gtk_widget_set_size_request (props, 500, -1);
+ /* handle "delete-event" */
+ g_signal_connect (dialog, "delete-event",
+ G_CALLBACK (delete_event_cb), NULL);
+
/* run the dialog */
do {
result = gtk_dialog_run (GTK_DIALOG (dialog));
diff --git a/control-center/dsn-properties-dialog.h b/control-center/dsn-properties-dialog.h
index 19009d3..53cf31a 100644
--- a/control-center/dsn-properties-dialog.h
+++ b/control-center/dsn-properties-dialog.h
@@ -20,9 +20,9 @@
*/
#ifndef __DSN_PROPERTIES_DIALOG_H__
-#define __dsn_properties_dialog_h__
+#define __DSN_PROPERTIES_DIALOG_H__
-#include <gtk/gtkwindow.h>
+#include <gtk/gtk.h>
void dsn_properties_dialog (GtkWindow *parent, const gchar *dsn);
diff --git a/control-center/gdaui-dsn-assistant.h b/control-center/gdaui-dsn-assistant.h
index 2ea0a00..02080c8 100644
--- a/control-center/gdaui-dsn-assistant.h
+++ b/control-center/gdaui-dsn-assistant.h
@@ -25,7 +25,7 @@
#define __GDAUI_DSN_ASSISTANT_H__
#include <libgda/gda-config.h>
-#include <gtk/gtkassistant.h>
+#include <gtk/gtk.h>
G_BEGIN_DECLS
diff --git a/control-center/gdaui-dsn-editor.c b/control-center/gdaui-dsn-editor.c
index ba32022..1ecf009 100644
--- a/control-center/gdaui-dsn-editor.c
+++ b/control-center/gdaui-dsn-editor.c
@@ -22,8 +22,6 @@
*/
#include <string.h>
-#include <gtk/gtklabel.h>
-#include <gtk/gtktable.h>
#include <libgda/libgda.h>
#include "gdaui-dsn-editor.h"
#include <libgda-ui/gdaui-provider-selector.h>
@@ -193,6 +191,7 @@ gdaui_dsn_editor_init (GdauiDsnEditor *config, GdauiDsnEditorClass *klass)
"editing the data source's attributes is disabled</span>"));
gtk_misc_set_alignment (GTK_MISC (config->priv->warning), 0.5, -1);
gtk_label_set_justify (GTK_LABEL (config->priv->warning), GTK_JUSTIFY_CENTER);
+ gtk_label_set_line_wrap (GTK_LABEL (config->priv->warning), TRUE);
gtk_table_attach (GTK_TABLE (table), config->priv->warning, 0, 2, 8, 9,
GTK_FILL|GTK_EXPAND, GTK_FILL, 0, 0);
diff --git a/control-center/gdaui-dsn-editor.h b/control-center/gdaui-dsn-editor.h
index d80ee92..18b4b68 100644
--- a/control-center/gdaui-dsn-editor.h
+++ b/control-center/gdaui-dsn-editor.h
@@ -24,7 +24,7 @@
#ifndef __GDAUI_DSN_EDITOR_H__
#define __GDAUI_DSN_EDITOR_H__
-#include <gtk/gtkvbox.h>
+#include <gtk/gtk.h>
G_BEGIN_DECLS
diff --git a/control-center/gdaui-login-dialog.c b/control-center/gdaui-login-dialog.c
index 70985d0..7f7dcfa 100644
--- a/control-center/gdaui-login-dialog.c
+++ b/control-center/gdaui-login-dialog.c
@@ -21,13 +21,6 @@
* Boston, MA 02111-1307, USA.
*/
-#include <gtk/gtkimage.h>
-#include <gtk/gtklabel.h>
-#include <gtk/gtknotebook.h>
-#include <gtk/gtkstock.h>
-#include <gtk/gtktable.h>
-#include <gtk/gtkhbox.h>
-#include <gtk/gtkwindow.h>
#include <libgda/gda-config.h>
#include <libgda/binreloc/gda-binreloc.h>
#include <libgda-ui/gdaui-login.h>
@@ -106,9 +99,16 @@ gdaui_login_dialog_init (GdauiLoginDialog *dialog, GdauiLoginDialogClass *klass)
GtkWidget *hbox, *vbox, *image, *label;
GtkWidget *nb;
GdkPixbuf *icon;
+ GtkWidget *dcontents;
g_return_if_fail (GDAUI_IS_LOGIN_DIALOG (dialog));
+#if GTK_CHECK_VERSION(2,18,0)
+ dcontents = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
+#else
+ dcontents = GTK_DIALOG (dialog)->vbox;
+#endif
+
dialog->priv = g_new0 (GdauiLoginDialogPrivate, 1);
gtk_dialog_add_button (GTK_DIALOG (dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
@@ -116,14 +116,14 @@ gdaui_login_dialog_init (GdauiLoginDialog *dialog, GdauiLoginDialogClass *klass)
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
gtk_container_set_border_width (GTK_CONTAINER (dialog), 6);
- gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox), 12);
+ gtk_box_set_spacing (GTK_BOX (dcontents), 12);
gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
hbox = gtk_hbox_new (FALSE, 12);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 6);
gtk_widget_show (hbox);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (dcontents), hbox, TRUE, TRUE, 0);
image = gtk_image_new_from_stock (GTK_STOCK_DIALOG_AUTHENTICATION, GTK_ICON_SIZE_DIALOG);
gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0.0);
diff --git a/control-center/gdaui-login-dialog.h b/control-center/gdaui-login-dialog.h
index 136205e..9449e8f 100644
--- a/control-center/gdaui-login-dialog.h
+++ b/control-center/gdaui-login-dialog.h
@@ -25,7 +25,7 @@
#define __GDAUI_LOGIN_DIALOG_H__
#include <libgda-ui/gdaui-login.h>
-#include <gtk/gtkdialog.h>
+#include <gtk/gtk.h>
G_BEGIN_DECLS
diff --git a/control-center/main.c b/control-center/main.c
index 22c9ed3..157ce84 100644
--- a/control-center/main.c
+++ b/control-center/main.c
@@ -22,12 +22,9 @@
#include <glib/gi18n-lib.h>
#include <string.h>
-#include <gtk/gtkdialog.h>
-#include <gtk/gtkstock.h>
+#include <gtk/gtk.h>
#include <libgda-ui/libgda-ui.h>
#include <libgda/binreloc/gda-binreloc.h>
-#include <gtk/gtklabel.h>
-#include <gtk/gtknotebook.h>
#include "dsn-config.h"
#include "provider-config.h"
#include "gdaui-dsn-assistant.h"
diff --git a/control-center/provider-config.c b/control-center/provider-config.c
index 557b509..15dc299 100644
--- a/control-center/provider-config.c
+++ b/control-center/provider-config.c
@@ -25,11 +25,7 @@
#include <libgda/binreloc/gda-binreloc.h>
#include <libgda/gda-config.h>
#include <libgda/gda-data-model-array.h>
-#include <gtk/gtkimage.h>
-#include <gtk/gtklabel.h>
-#include <gtk/gtkstock.h>
-#include <gtk/gtktable.h>
-#include <gtk/gtkvbbox.h>
+#include <gtk/gtk.h>
#include <libgda-ui/libgda-ui.h>
#include "provider-config.h"
#include "cc-gray-bar.h"
diff --git a/control-center/provider-config.h b/control-center/provider-config.h
index 9c9ecf4..f91d10d 100644
--- a/control-center/provider-config.h
+++ b/control-center/provider-config.h
@@ -23,7 +23,7 @@
#ifndef __PROVIDER_CONFIG_H__
#define __PROVIDER_CONFIG_H__
-#include <gtk/gtkwidget.h>
+#include <gtk/gtk.h>
GtkWidget *provider_config_new (void);
diff --git a/doc/C/Makefile.am b/doc/C/Makefile.am
index 1007f3d..f6c48c4 100644
--- a/doc/C/Makefile.am
+++ b/doc/C/Makefile.am
@@ -48,7 +48,7 @@ GTKDOC_LIBS += $(GTK_LIBS) \
endif
# Extra options to supply to gtkdoc-mkdb
-MKDB_OPTIONS=--sgml-mode --output-format=xml --ignore-files="parser.c binreloc.c libcsv.c md5c.c"
+MKDB_OPTIONS=--sgml-mode --output-format=xml --name-space=gda --ignore-files="parser.c binreloc.c libcsv.c md5c.c"
# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE)
content_files = fdl-appendix.sgml version.xml
diff --git a/libgda-ui/data-entries/gdaui-data-cell-renderer-bin.c b/libgda-ui/data-entries/gdaui-data-cell-renderer-bin.c
index 7120031..7177fa7 100644
--- a/libgda-ui/data-entries/gdaui-data-cell-renderer-bin.c
+++ b/libgda-ui/data-entries/gdaui-data-cell-renderer-bin.c
@@ -128,9 +128,8 @@ gdaui_data_cell_renderer_bin_init (GdauiDataCellRendererBin *cell)
cell->priv->dh = NULL;
cell->priv->type = GDA_TYPE_BLOB;
cell->priv->editable = FALSE;
- GTK_CELL_RENDERER (cell)->mode = GTK_CELL_RENDERER_MODE_ACTIVATABLE;
- GTK_CELL_RENDERER (cell)->xpad = 2;
- GTK_CELL_RENDERER (cell)->ypad = 2;
+ g_object_set (G_OBJECT (cell), "mode", GTK_CELL_RENDERER_MODE_ACTIVATABLE,
+ "xpad", 2, "ypad", 2, NULL);
}
static void
@@ -361,15 +360,23 @@ gdaui_data_cell_renderer_bin_render (GtkCellRenderer *cell,
GtkCellRendererClass *pixbuf_class = g_type_class_peek (GTK_TYPE_CELL_RENDERER_PIXBUF);
(pixbuf_class->render) (cell, window, widget, background_area, cell_area, expose_area, flags);
+
+ if (GDAUI_DATA_CELL_RENDERER_BIN (cell)->priv->to_be_deleted) {
+ GtkStyle *style;
+ guint xpad;
+
+ g_object_get ((GObject*) widget, "style", &style, NULL);
+ g_object_get ((GObject*) cell, "xpad", &xpad, NULL);
- if (GDAUI_DATA_CELL_RENDERER_BIN (cell)->priv->to_be_deleted)
- gtk_paint_hline (widget->style,
+ gtk_paint_hline (style,
window, GTK_STATE_SELECTED,
cell_area,
widget,
"hline",
- cell_area->x + cell->xpad, cell_area->x + cell_area->width - cell->xpad,
+ cell_area->x + xpad, cell_area->x + cell_area->width - xpad,
cell_area->y + cell_area->height / 2.);
+ g_object_unref (style);
+ }
}
diff --git a/libgda-ui/data-entries/gdaui-data-cell-renderer-boolean.c b/libgda-ui/data-entries/gdaui-data-cell-renderer-boolean.c
index f886993..efefd38 100644
--- a/libgda-ui/data-entries/gdaui-data-cell-renderer-boolean.c
+++ b/libgda-ui/data-entries/gdaui-data-cell-renderer-boolean.c
@@ -126,9 +126,8 @@ gdaui_data_cell_renderer_boolean_init (GdauiDataCellRendererBoolean *cell)
cell->priv->dh = NULL;
cell->priv->type = G_TYPE_BOOLEAN;
cell->priv->editable = FALSE;
- GTK_CELL_RENDERER (cell)->mode = GTK_CELL_RENDERER_MODE_ACTIVATABLE;
- GTK_CELL_RENDERER (cell)->xpad = 2;
- GTK_CELL_RENDERER (cell)->ypad = 2;
+ g_object_set (G_OBJECT (cell), "mode", GTK_CELL_RENDERER_MODE_ACTIVATABLE,
+ "xpad", 2, "ypad", 2, NULL);
}
static void
@@ -367,17 +366,22 @@ gdaui_data_cell_renderer_boolean_render (GtkCellRenderer *cell,
(toggle_class->render) (cell, window, widget, background_area, cell_area, expose_area, flags);
- if (GDAUI_DATA_CELL_RENDERER_BOOLEAN (cell)->priv->to_be_deleted)
- gtk_paint_hline (widget->style,
+ if (GDAUI_DATA_CELL_RENDERER_BOOLEAN (cell)->priv->to_be_deleted) {
+ GtkStyle *style;
+ guint xpad;
+
+ g_object_get (G_OBJECT(widget), "style", &style, "xpad", &xpad, NULL);
+ gtk_paint_hline (style,
window, GTK_STATE_SELECTED,
cell_area,
widget,
"hline",
- cell_area->x + cell->xpad, cell_area->x + cell_area->width - cell->xpad,
+ cell_area->x + xpad, cell_area->x + cell_area->width - xpad,
cell_area->y + cell_area->height / 2.);
+ }
}
-
+
static gboolean
gdaui_data_cell_renderer_boolean_activate (GtkCellRenderer *cell,
GdkEvent *event,
@@ -387,20 +391,22 @@ gdaui_data_cell_renderer_boolean_activate (GtkCellRenderer *cell,
GdkRectangle *cell_area,
GtkCellRendererState flags)
{
- if (GDAUI_DATA_CELL_RENDERER_BOOLEAN (cell)->priv->editable) {
- GtkCellRendererClass *toggle_class = g_type_class_peek (GTK_TYPE_CELL_RENDERER_TOGGLE);
+ gboolean editable;
+ g_object_get (G_OBJECT(cell), "editable", &editable, NULL);
+ if (editable) {
gboolean retval, active;
GValue *value;
-
- retval = (toggle_class->activate) (cell, event, widget, path, background_area, cell_area, flags);
+
+ retval = gtk_cell_renderer_activate (cell, event, widget, path, background_area, cell_area, flags);
active = gtk_cell_renderer_toggle_get_active (GTK_CELL_RENDERER_TOGGLE (cell));
-
- g_value_set_boolean (value = gda_value_new (G_TYPE_BOOLEAN), ! active);
+
+ value = gda_value_new (G_TYPE_BOOLEAN);
+ g_value_set_boolean (value, ! active);
g_signal_emit (G_OBJECT (cell), toggle_cell_signals[CHANGED], 0, path, value);
gda_value_free (value);
return retval;
}
-
+
return FALSE;
}
diff --git a/libgda-ui/data-entries/gdaui-data-cell-renderer-boolean.h b/libgda-ui/data-entries/gdaui-data-cell-renderer-boolean.h
index 4aad136..d2488d0 100644
--- a/libgda-ui/data-entries/gdaui-data-cell-renderer-boolean.h
+++ b/libgda-ui/data-entries/gdaui-data-cell-renderer-boolean.h
@@ -39,18 +39,18 @@ typedef struct _GdauiDataCellRendererBooleanPrivate GdauiDataCellRendererBoolean
struct _GdauiDataCellRendererBoolean
{
- GtkCellRendererToggle parent;
+ GtkCellRendererToggle parent;
GdauiDataCellRendererBooleanPrivate *priv;
};
struct _GdauiDataCellRendererBooleanClass
{
- GtkCellRendererToggleClass parent_class;
+ GtkCellRendererToggleClass parent_class;
- void (* changed) (GdauiDataCellRendererBoolean *cell_renderer,
- const gchar *path,
- const GValue *new_value);
+ void (*changed) (GdauiDataCellRendererBoolean *cell_renderer,
+ const gchar *path,
+ const GValue *new_value);
};
GType gdaui_data_cell_renderer_boolean_get_type (void) G_GNUC_CONST;
diff --git a/libgda-ui/data-entries/gdaui-data-cell-renderer-combo.c b/libgda-ui/data-entries/gdaui-data-cell-renderer-combo.c
index b581ef9..b05c746 100644
--- a/libgda-ui/data-entries/gdaui-data-cell-renderer-combo.c
+++ b/libgda-ui/data-entries/gdaui-data-cell-renderer-combo.c
@@ -128,7 +128,7 @@ gdaui_data_cell_renderer_combo_get_type (void)
static void
gdaui_data_cell_renderer_combo_init (GdauiDataCellRendererCombo *datacell)
{
- GTK_CELL_RENDERER (datacell)->mode = GTK_CELL_RENDERER_MODE_ACTIVATABLE;
+ g_object_set ((GObject*) datacell, "mode", GTK_CELL_RENDERER_MODE_ACTIVATABLE, NULL);
datacell->priv = g_new0 (GdauiDataCellRendererComboPrivate, 1);
datacell->priv->attributes = 0;
datacell->priv->set_default_if_invalid = FALSE;
@@ -465,10 +465,12 @@ gdaui_data_cell_renderer_combo_get_size (GtkCellRenderer *cell,
/* Add more space for the popdown menu symbol */
if (GDAUI_DATA_CELL_RENDERER_COMBO (cell)->priv->show_expander) {
+ guint xpad, ypad;
+ g_object_get ((GObject*) cell, "xpad", &xpad, "ypad", &ypad, NULL);
gint expander_size;
gtk_widget_style_get (widget, "expander_size", &expander_size, NULL);
- calc_width = (gint) cell->xpad * 2 + expander_size;
- calc_height = (gint) cell->ypad * 2 + expander_size;
+ calc_width = (gint) xpad * 2 + expander_size;
+ calc_height = (gint) ypad * 2 + expander_size;
}
if (width)
@@ -497,13 +499,17 @@ gdaui_data_cell_renderer_combo_render (GtkCellRenderer *cell,
/* render the popdown menu symbol */
if ((flags & GTK_CELL_RENDERER_SELECTED) == GTK_CELL_RENDERER_SELECTED) {
- if (GTK_WIDGET_HAS_FOCUS (widget))
+ gboolean hasfocus;
+ g_object_get ((GObject*) widget, "has-focus", &hasfocus, NULL);
+ if (hasfocus)
state = GTK_STATE_SELECTED;
else
state = GTK_STATE_ACTIVE;
}
else {
- if (GTK_CELL_RENDERER_TEXT (cell)->editable)
+ gboolean editable;
+ g_object_get ((GObject*) cell, "editable", &editable, NULL);
+ if (editable)
state = GTK_STATE_NORMAL;
else
state = GTK_STATE_INSENSITIVE;
@@ -511,26 +517,40 @@ gdaui_data_cell_renderer_combo_render (GtkCellRenderer *cell,
if (combocell->priv->show_expander) {
gint expander_size;
+ GtkStyle *style;
+ guint xpad, ypad;
+
gtk_widget_style_get (widget, "expander_size", &expander_size, NULL);
+ g_object_get ((GObject*) widget, "style", &style, NULL);
+ g_object_get ((GObject*) cell, "xpad", &xpad, "ypad", &ypad, NULL);
- gtk_paint_expander (widget->style,
+ gtk_paint_expander (style,
window, state,
cell_area,
widget,
"expander",
- cell_area->x + cell_area->width - cell->xpad - expander_size/2.,
- cell_area->y + cell_area->height - cell->ypad - expander_size/2. ,
+ cell_area->x + cell_area->width - xpad - expander_size/2.,
+ cell_area->y + cell_area->height - ypad - expander_size/2. ,
GTK_EXPANDER_EXPANDED);
+ g_object_unref (style);
}
- if (combocell->priv->to_be_deleted)
- gtk_paint_hline (widget->style,
+ if (combocell->priv->to_be_deleted) {
+ GtkStyle *style;
+ guint xpad;
+
+ g_object_get ((GObject*) widget, "style", &style, NULL);
+ g_object_get ((GObject*) cell, "xpad", &xpad, NULL);
+
+ gtk_paint_hline (style,
window, GTK_STATE_SELECTED,
cell_area,
widget,
"hline",
- cell_area->x + cell->xpad, cell_area->x + cell_area->width - cell->xpad,
+ cell_area->x + xpad, cell_area->x + cell_area->width - xpad,
cell_area->y + cell_area->height / 2.);
+ g_object_unref (style);
+ }
}
static void gdaui_data_cell_renderer_combo_editing_done (GtkCellEditable *combo, GdauiDataCellRendererCombo *datacell);
@@ -547,15 +567,14 @@ gdaui_data_cell_renderer_combo_start_editing (GtkCellRenderer *cell,
GtkCellRendererState flags)
{
GdauiDataCellRendererCombo *datacell;
- GtkCellRendererText *cell_text;
GtkWidget *combo;
-
- datacell = GDAUI_DATA_CELL_RENDERER_COMBO (cell);
-
- cell_text = GTK_CELL_RENDERER_TEXT (cell);
- if (cell_text->editable == FALSE)
+ gboolean editable;
+
+ g_object_get ((GObject*) cell, "editable", &editable, NULL);
+ if (editable == FALSE)
return NULL;
+ datacell = GDAUI_DATA_CELL_RENDERER_COMBO (cell);
combo = gdaui_combo_new_with_model (GDA_DATA_MODEL (datacell->priv->source->source->data_model),
datacell->priv->source->shown_n_cols,
datacell->priv->source->shown_cols_index);
diff --git a/libgda-ui/data-entries/gdaui-data-cell-renderer-info.c b/libgda-ui/data-entries/gdaui-data-cell-renderer-info.c
index 96c7d16..8a16391 100644
--- a/libgda-ui/data-entries/gdaui-data-cell-renderer-info.c
+++ b/libgda-ui/data-entries/gdaui-data-cell-renderer-info.c
@@ -127,9 +127,8 @@ gdaui_data_cell_renderer_info_init (GdauiDataCellRendererInfo *cellinfo)
{
cellinfo->priv = g_new0 (GdauiDataCellRendererInfoPriv, 1);
- GTK_CELL_RENDERER (cellinfo)->mode = GTK_CELL_RENDERER_MODE_ACTIVATABLE;
- GTK_CELL_RENDERER (cellinfo)->xpad = 1;
- GTK_CELL_RENDERER (cellinfo)->ypad = 1;
+ g_object_set ((GObject*) cellinfo, "mode", GTK_CELL_RENDERER_MODE_ACTIVATABLE,
+ "xpad", 1, "ypad", 1, NULL);
}
static void
@@ -336,9 +335,11 @@ gdaui_data_cell_renderer_info_get_size (GtkCellRenderer *cell,
{
gint calc_width;
gint calc_height;
+ guint xpad, ypad;
- calc_width = (gint) cell->xpad * 2 + INFO_WIDTH;
- calc_height = (gint) cell->ypad * 2 + INFO_HEIGHT;
+ g_object_get ((GObject*) cell, "xpad", &xpad, "ypad", &ypad, NULL);
+ calc_width = (gint) xpad * 2 + INFO_WIDTH;
+ calc_height = (gint) ypad * 2 + INFO_HEIGHT;
if (width)
*width = calc_width;
@@ -348,11 +349,15 @@ gdaui_data_cell_renderer_info_get_size (GtkCellRenderer *cell,
if (cell_area) {
if (x_offset) {
- *x_offset = cell->xalign * (cell_area->width - calc_width);
+ gfloat xalign;
+ g_object_get ((GObject*) cell, "xalign", &xalign, NULL);
+ *x_offset = xalign * (cell_area->width - calc_width);
*x_offset = MAX (*x_offset, 0);
}
if (y_offset) {
- *y_offset = cell->yalign * (cell_area->height - calc_height);
+ gfloat yalign;
+ g_object_get ((GObject*) cell, "yalign", &yalign, NULL);
+ *y_offset = yalign * (cell_area->height - calc_height);
*y_offset = MAX (*y_offset, 0);
}
}
@@ -381,7 +386,11 @@ gdaui_data_cell_renderer_info_render (GtkCellRenderer *cell,
if (!colors)
colors = _gdaui_utility_entry_build_info_colors_array ();
- style = gtk_style_copy (widget->style);
+ GtkStyle *estyle;
+ g_object_get ((GObject*) widget, "style", &estyle, NULL);
+ style = gtk_style_copy (estyle);
+ g_object_unref (estyle);
+
orig_normal = & (style->bg[GTK_STATE_NORMAL]);
orig_prelight = & (style->bg[GTK_STATE_PRELIGHT]);
if (cellinfo->priv->attributes & GDA_VALUE_ATTR_IS_NULL) {
@@ -409,10 +418,13 @@ gdaui_data_cell_renderer_info_render (GtkCellRenderer *cell,
style->bg[GTK_STATE_PRELIGHT] = *prelight;
style = gtk_style_attach (style, window); /* Note that we must use the return value, because this function is documented as sometimes returning a new object. */
gdaui_data_cell_renderer_info_get_size (cell, widget, cell_area,
- &x_offset, &y_offset,
- &width, &height);
- width -= cell->xpad*2;
- height -= cell->ypad*2;
+ &x_offset, &y_offset,
+ &width, &height);
+
+ guint xpad, ypad;
+ g_object_get ((GObject*) cell, "xpad", &xpad, "ypad", &ypad, NULL);
+ width -= xpad*2;
+ height -= ypad*2;
if (width <= 0 || height <= 0)
return;
@@ -423,8 +435,8 @@ gdaui_data_cell_renderer_info_render (GtkCellRenderer *cell,
window,
state, GTK_SHADOW_NONE,
cell_area, widget, "cellcheck",
- cell_area->x + x_offset + cell->xpad,
- cell_area->y + y_offset + cell->ypad,
+ cell_area->x + x_offset + xpad,
+ cell_area->y + y_offset + ypad,
width - 1, height - 1);
gtk_style_detach (style);
g_object_unref (G_OBJECT (style));
diff --git a/libgda-ui/data-entries/gdaui-data-cell-renderer-textual.c b/libgda-ui/data-entries/gdaui-data-cell-renderer-textual.c
index 06dcc53..0a8ade3 100644
--- a/libgda-ui/data-entries/gdaui-data-cell-renderer-textual.c
+++ b/libgda-ui/data-entries/gdaui-data-cell-renderer-textual.c
@@ -157,10 +157,8 @@ gdaui_data_cell_renderer_textual_init (GdauiDataCellRendererTextual *datacell)
datacell->priv->n_decimals = -1; /* unlimited */
- GTK_CELL_RENDERER (datacell)->xalign = 0.0;
- GTK_CELL_RENDERER (datacell)->yalign = 0.5;
- GTK_CELL_RENDERER (datacell)->xpad = 2;
- GTK_CELL_RENDERER (datacell)->ypad = 2;
+ g_object_set ((GObject*) datacell, "xalign", 0.0, "yalign", 0.5,
+ "xpad", 2, "ypad", 2, NULL);
}
static void
@@ -602,14 +600,22 @@ gdaui_data_cell_renderer_textual_render (GtkCellRenderer *cell,
GtkCellRendererClass *text_class = g_type_class_peek (GTK_TYPE_CELL_RENDERER_TEXT);
(text_class->render) (cell, window, widget, background_area, cell_area, expose_area, flags);
- if (GDAUI_DATA_CELL_RENDERER_TEXTUAL (cell)->priv->to_be_deleted)
- gtk_paint_hline (widget->style,
+ if (GDAUI_DATA_CELL_RENDERER_TEXTUAL (cell)->priv->to_be_deleted) {
+ GtkStyle *style;
+ guint xpad;
+
+ g_object_get ((GObject*) widget, "style", &style, NULL);
+ g_object_get ((GObject*) cell, "xpad", &xpad, NULL);
+
+ gtk_paint_hline (style,
window, GTK_STATE_SELECTED,
cell_area,
widget,
"hline",
- cell_area->x + cell->xpad, cell_area->x + cell_area->width - cell->xpad,
+ cell_area->x + xpad, cell_area->x + cell_area->width - xpad,
cell_area->y + cell_area->height / 2.);
+ g_object_unref (style);
+ }
}
static void
@@ -628,11 +634,11 @@ gdaui_data_cell_renderer_textual_editing_done (GtkCellEditable *entry,
info->focus_out_id = 0;
}
- if (g_object_class_find_property (G_OBJECT_GET_CLASS (entry), "editing_cancelled")) {
- gboolean editing_cancelled;
+ if (g_object_class_find_property (G_OBJECT_GET_CLASS (entry), "editing-canceled")) {
+ gboolean editing_canceled;
- g_object_get (G_OBJECT (entry), "editing_cancelled", &editing_cancelled, NULL);
- if (editing_cancelled)
+ g_object_get (G_OBJECT (entry), "editing-canceled", &editing_canceled, NULL);
+ if (editing_canceled)
return;
}
diff --git a/libgda-ui/data-entries/gdaui-entry-bin.c b/libgda-ui/data-entries/gdaui-entry-bin.c
index a5af886..4aba67c 100644
--- a/libgda-ui/data-entries/gdaui-entry-bin.c
+++ b/libgda-ui/data-entries/gdaui-entry-bin.c
@@ -332,11 +332,19 @@ popup_position (PopupContainer *container, gint *out_x, gint *out_y)
gtk_widget_size_request (poswidget, &req);
- gdk_window_get_origin (poswidget->window, &x, &y);
-
- x += poswidget->allocation.x;
+#if GTK_CHECK_VERSION(2,18,0)
+ gdk_window_get_origin (gtk_widget_get_window (poswidget), &x, &y);
+ GtkAllocation alloc;
+ gtk_widget_get_allocation (poswidget, &alloc);
+ x += alloc.x;
+ y += alloc.y;
+ y += alloc.height;
+#else
+ gdk_window_get_origin (poswidget->window, &x, &y);
+ x += poswidget->allocation.x;
y += poswidget->allocation.y;
- y += poswidget->allocation.height;
+ y += poswidget->allocation.height;
+#endif
if (x < 0)
x = 0;
diff --git a/libgda-ui/data-entries/gdaui-entry-common-time.c b/libgda-ui/data-entries/gdaui-entry-common-time.c
index 35cd463..988ce2d 100644
--- a/libgda-ui/data-entries/gdaui-entry-common-time.c
+++ b/libgda-ui/data-entries/gdaui-entry-common-time.c
@@ -34,19 +34,19 @@ static void gdaui_entry_common_time_dispose (GObject *object);
static void gdaui_entry_common_time_finalize (GObject *object);
static void gdaui_entry_common_time_set_property (GObject *object,
- guint param_id,
- const GValue *value,
- GParamSpec *pspec);
+ guint param_id,
+ const GValue *value,
+ GParamSpec *pspec);
static void gdaui_entry_common_time_get_property (GObject *object,
- guint param_id,
- GValue *value,
- GParamSpec *pspec);
+ guint param_id,
+ GValue *value,
+ GParamSpec *pspec);
/* properties */
enum
{
PROP_0,
- PROP_EDITING_CANCELLED,
+ PROP_EDITING_CANCELED,
PROP_TYPE
};
@@ -75,6 +75,7 @@ struct _GdauiEntryCommonTimePrivate
GtkWidget *date;
GtkWidget *window;
GtkWidget *date_button;
+ gboolean editing_canceled;
/* for time */
GtkWidget *entry_time;
@@ -144,15 +145,23 @@ gdaui_entry_common_time_class_init (GdauiEntryCommonTimeClass * class)
object_class->set_property = gdaui_entry_common_time_set_property;
object_class->get_property = gdaui_entry_common_time_get_property;
- g_object_class_install_property (object_class, PROP_EDITING_CANCELLED,
- g_param_spec_boolean ("editing_cancelled", NULL, NULL, FALSE, G_PARAM_READABLE));
+ g_object_class_install_property (object_class, PROP_EDITING_CANCELED,
+ g_param_spec_boolean ("editing-canceled", NULL, NULL, FALSE, G_PARAM_READABLE));
g_object_class_install_property (object_class, PROP_TYPE,
g_param_spec_uint ("type", NULL, NULL, 0, G_MAXUINT, GDA_TYPE_TIME,
G_PARAM_WRITABLE | G_PARAM_READABLE));
}
+static gboolean
+key_press_event_cb (GdauiEntryCommonTime *mgtim, GdkEventKey *key_event, gpointer data)
+{
+ if (key_event->keyval == GDK_Escape)
+ mgtim->priv->editing_canceled = TRUE;
+ return FALSE;
+}
+
static void
-gdaui_entry_common_time_init (GdauiEntryCommonTime * gdaui_entry_common_time)
+gdaui_entry_common_time_init (GdauiEntryCommonTime *gdaui_entry_common_time)
{
gdaui_entry_common_time->priv = g_new0 (GdauiEntryCommonTimePrivate, 1);
gdaui_entry_common_time->priv->entry_date = NULL;
@@ -162,6 +171,9 @@ gdaui_entry_common_time_init (GdauiEntryCommonTime * gdaui_entry_common_time)
gdaui_entry_common_time->priv->date_button = NULL;
gdaui_entry_common_time->priv->hbox = NULL;
gdaui_entry_common_time->priv->last_value_set = NULL;
+ gdaui_entry_common_time->priv->editing_canceled = FALSE;
+ g_signal_connect (gdaui_entry_common_time, "key-press-event",
+ G_CALLBACK (key_press_event_cb), NULL);
}
/**
@@ -234,9 +246,9 @@ gdaui_entry_common_time_finalize (GObject * object)
static void
gdaui_entry_common_time_set_property (GObject *object,
- guint param_id,
- const GValue *value,
- GParamSpec *pspec)
+ guint param_id,
+ const GValue *value,
+ GParamSpec *pspec)
{
GdauiEntryCommonTime *mgtim;
@@ -255,24 +267,17 @@ gdaui_entry_common_time_set_property (GObject *object,
static void
gdaui_entry_common_time_get_property (GObject *object,
- guint param_id,
- GValue *value,
- GParamSpec *pspec)
+ guint param_id,
+ GValue *value,
+ GParamSpec *pspec)
{
GdauiEntryCommonTime *mgtim;
- gboolean cancelled;
mgtim = GDAUI_ENTRY_COMMON_TIME (object);
if (mgtim->priv) {
switch (param_id) {
- case PROP_EDITING_CANCELLED:
- cancelled = FALSE;
- /* FIXME */
- if (mgtim->priv->entry_date)
- cancelled = GTK_ENTRY (mgtim->priv->entry_date)->editing_canceled;
- if (!cancelled && mgtim->priv->entry_time)
- cancelled = GTK_ENTRY (mgtim->priv->entry_time)->editing_canceled;
- g_value_set_boolean (value, cancelled);
+ case PROP_EDITING_CANCELED:
+ g_value_set_boolean (value, mgtim->priv->editing_canceled);
break;
case PROP_TYPE:
g_value_set_uint (value, gdaui_data_entry_get_value_type (GDAUI_DATA_ENTRY (object)));
@@ -782,7 +787,7 @@ date_button_press_popup (GtkWidget *widget, GdkEventButton *event, GdauiEntryCom
while (child) {
if (child == widget)
return FALSE;
- child = child->parent;
+ child = gtk_widget_get_parent (child);
}
}
@@ -887,8 +892,14 @@ date_calendar_choose_cb (GtkWidget *button, GdauiEntryCommonTime *mgtim)
/* popup window */
/* Temporarily grab pointer and keyboard, copied from GnomeDateEdit */
- if (!popup_grab_on_window (button->window, gtk_get_current_event_time ()))
+#if GTK_CHECK_VERSION(2,18,0)
+ if (!popup_grab_on_window (gtk_widget_get_window (button), gtk_get_current_event_time ()))
return;
+#else
+ if (!popup_grab_on_window (button->window, gtk_get_current_event_time ()))
+ return;
+#endif
+
position_popup (mgtim);
gtk_grab_add (mgtim->priv->window);
gtk_widget_show (mgtim->priv->window);
@@ -929,8 +940,13 @@ date_calendar_choose_cb (GtkWidget *button, GdauiEntryCommonTime *mgtim)
gtk_window_move (GTK_WINDOW (mgtim->priv->window), root_x, root_y);
gtk_widget_grab_focus (mgtim->priv->date);
- popup_grab_on_window (mgtim->priv->window->window,
+#if GTK_CHECK_VERSION(2,18,0)
+ popup_grab_on_window (gtk_widget_get_window (mgtim->priv->window),
gtk_get_current_event_time ());
+#else
+ popup_grab_on_window (mgtim->priv->window->window,
+ gtk_get_current_event_time ());
+#endif
}
static gboolean
@@ -960,12 +976,22 @@ position_popup (GdauiEntryCommonTime *mgtim)
gtk_widget_size_request (mgtim->priv->window, &req);
- gdk_window_get_origin (mgtim->priv->date_button->window, &x, &y);
-
+#if GTK_CHECK_VERSION(2,18,0)
+ gdk_window_get_origin (gtk_widget_get_window (mgtim->priv->date_button), &x, &y);
+ GtkAllocation alloc;
+ gtk_widget_get_allocation (mgtim->priv->date_button, &alloc);
+ x += alloc.x;
+ y += alloc.y;
+ bwidth = alloc.width;
+ bheight = alloc.height;
+#else
+ gdk_window_get_origin (mgtim->priv->date_button->window, &x, &y);
+
x += mgtim->priv->date_button->allocation.x;
y += mgtim->priv->date_button->allocation.y;
bwidth = mgtim->priv->date_button->allocation.width;
- bheight = mgtim->priv->date_button->allocation.height;
+ bheight = mgtim->priv->date_button->allocation.height;
+#endif
x += bwidth - req.width;
y += bheight;
@@ -1103,11 +1129,11 @@ gdaui_entry_common_time_start_editing (GtkCellEditable *iface, GdkEvent *event)
{
GdauiEntryCommonTime *mgtim;
- g_return_if_fail (iface && GDAUI_IS_ENTRY_COMMON_TIME (iface));
+ g_return_if_fail (GDAUI_IS_ENTRY_COMMON_TIME (iface));
mgtim = GDAUI_ENTRY_COMMON_TIME (iface);
g_return_if_fail (mgtim->priv);
-
+ mgtim->priv->editing_canceled = FALSE;
if (mgtim->priv->date_button) {
gtk_widget_destroy (mgtim->priv->date_button);
mgtim->priv->date_button = NULL;
diff --git a/libgda-ui/data-entries/gdaui-entry-number.c b/libgda-ui/data-entries/gdaui-entry-number.c
index bdd1367..1883ef7 100644
--- a/libgda-ui/data-entries/gdaui-entry-number.c
+++ b/libgda-ui/data-entries/gdaui-entry-number.c
@@ -45,7 +45,7 @@ static void gdaui_entry_number_get_property (GObject *object,
enum
{
PROP_0,
- PROP_EDITING_CANCELLED,
+ PROP_EDITING_CANCELED,
PROP_OPTIONS
};
@@ -73,6 +73,7 @@ static GObjectClass *parent_class = NULL;
struct _GdauiEntryNumberPrivate
{
GtkWidget *entry;
+ gboolean editing_canceled;
guchar thousand_sep;
guint16 nb_decimals;
@@ -139,14 +140,22 @@ gdaui_entry_number_class_init (GdauiEntryNumberClass * klass)
object_class->set_property = gdaui_entry_number_set_property;
object_class->get_property = gdaui_entry_number_get_property;
- g_object_class_install_property (object_class, PROP_EDITING_CANCELLED,
- g_param_spec_boolean ("editing_cancelled", NULL, NULL, FALSE, G_PARAM_READABLE));
+ g_object_class_install_property (object_class, PROP_EDITING_CANCELED,
+ g_param_spec_boolean ("editing-canceled", NULL, NULL, FALSE, G_PARAM_READABLE));
g_object_class_install_property (object_class, PROP_OPTIONS,
g_param_spec_string ("options", NULL, NULL, NULL, G_PARAM_WRITABLE));
}
+static gboolean
+key_press_event_cb (GdauiEntryNumber *mgstr, GdkEventKey *key_event, gpointer data)
+{
+ if (key_event->keyval == GDK_Escape)
+ mgstr->priv->editing_canceled = TRUE;
+ return FALSE;
+}
+
static void
-gdaui_entry_number_init (GdauiEntryNumber * mgstr)
+gdaui_entry_number_init (GdauiEntryNumber *mgstr)
{
mgstr->priv = g_new0 (GdauiEntryNumberPrivate, 1);
mgstr->priv->entry = NULL;
@@ -156,6 +165,9 @@ gdaui_entry_number_init (GdauiEntryNumber * mgstr)
mgstr->priv->currency = NULL;
mgstr->priv->entry_change_sig = 0;
+
+ g_signal_connect (mgstr, "key-press-event",
+ G_CALLBACK (key_press_event_cb), NULL);
}
gboolean
@@ -272,8 +284,8 @@ gdaui_entry_number_get_property (GObject *object,
mgstr = GDAUI_ENTRY_NUMBER (object);
if (mgstr->priv) {
switch (param_id) {
- case PROP_EDITING_CANCELLED:
- g_value_set_boolean (value, GTK_ENTRY (mgstr->priv->entry)->editing_canceled);
+ case PROP_EDITING_CANCELED:
+ g_value_set_boolean (value, mgstr->priv->editing_canceled);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
@@ -419,9 +431,10 @@ gdaui_entry_number_start_editing (GtkCellEditable *iface, GdkEvent *event)
{
GdauiEntryNumber *mgstr;
- g_return_if_fail (iface && GDAUI_IS_ENTRY_NUMBER (iface));
+ g_return_if_fail (GDAUI_IS_ENTRY_NUMBER (iface));
mgstr = GDAUI_ENTRY_NUMBER (iface);
+ mgstr->priv->editing_canceled = FALSE;
g_object_set (G_OBJECT (mgstr->priv->entry), "has_frame", FALSE, "xalign", 0., NULL);
gtk_cell_editable_start_editing (GTK_CELL_EDITABLE (mgstr->priv->entry), event);
diff --git a/libgda-ui/data-entries/gdaui-entry-string.c b/libgda-ui/data-entries/gdaui-entry-string.c
index 173754b..d3bf99f 100644
--- a/libgda-ui/data-entries/gdaui-entry-string.c
+++ b/libgda-ui/data-entries/gdaui-entry-string.c
@@ -36,20 +36,20 @@ static void gdaui_entry_string_dispose (GObject *object);
static void gdaui_entry_string_finalize (GObject *object);
static void gdaui_entry_string_set_property (GObject *object,
- guint param_id,
- const GValue *value,
- GParamSpec *pspec);
+ guint param_id,
+ const GValue *value,
+ GParamSpec *pspec);
static void gdaui_entry_string_get_property (GObject *object,
- guint param_id,
- GValue *value,
- GParamSpec *pspec);
+ guint param_id,
+ GValue *value,
+ GParamSpec *pspec);
/* properties */
enum
{
PROP_0,
PROP_MULTILINE,
- PROP_EDITING_CANCELLED,
+ PROP_EDITING_CANCELED,
PROP_OPTIONS
};
@@ -81,6 +81,7 @@ struct _GdauiEntryStringPrivate
GtkWidget *vbox;
GtkWidget *entry;
+ gboolean editing_canceled;
GtkTextBuffer *buffer;
GtkWidget *sw;
@@ -152,20 +153,29 @@ gdaui_entry_string_class_init (GdauiEntryStringClass * klass)
g_object_class_install_property (object_class, PROP_MULTILINE,
g_param_spec_boolean ("multiline", NULL, NULL, FALSE,
G_PARAM_READABLE | G_PARAM_WRITABLE));
- g_object_class_install_property (object_class, PROP_EDITING_CANCELLED,
- g_param_spec_boolean ("editing_cancelled", NULL, NULL, FALSE, G_PARAM_READABLE));
+ g_object_class_install_property (object_class, PROP_EDITING_CANCELED,
+ g_param_spec_boolean ("editing-canceled", NULL, NULL, FALSE, G_PARAM_READABLE));
g_object_class_install_property (object_class, PROP_OPTIONS,
g_param_spec_string ("options", NULL, NULL, NULL, G_PARAM_WRITABLE));
}
+static gboolean
+key_press_event_cb (GdauiEntryString *mgstr, GdkEventKey *key_event, gpointer data)
+{
+ if (key_event->keyval == GDK_Escape)
+ mgstr->priv->editing_canceled = TRUE;
+ return FALSE;
+}
+
static void
-gdaui_entry_string_init (GdauiEntryString * mgstr)
+gdaui_entry_string_init (GdauiEntryString *mgstr)
{
mgstr->priv = g_new0 (GdauiEntryStringPrivate, 1);
mgstr->priv->multiline = FALSE;
mgstr->priv->hidden = FALSE;
mgstr->priv->vbox = NULL;
mgstr->priv->entry = NULL;
+ mgstr->priv->editing_canceled = FALSE;
mgstr->priv->buffer = NULL;
mgstr->priv->view = NULL;
mgstr->priv->sw = NULL;
@@ -173,6 +183,9 @@ gdaui_entry_string_init (GdauiEntryString * mgstr)
mgstr->priv->maxsize = 65535; /* eg. unlimited for GtkEntry */
mgstr->priv->entry_change_sig = 0;
+
+ g_signal_connect (mgstr, "key-press-event",
+ G_CALLBACK (key_press_event_cb), NULL);
}
/**
@@ -252,9 +265,9 @@ gdaui_entry_string_finalize (GObject * object)
static void
gdaui_entry_string_set_property (GObject *object,
- guint param_id,
- const GValue *value,
- GParamSpec *pspec)
+ guint param_id,
+ const GValue *value,
+ GParamSpec *pspec)
{
GdauiEntryString *mgstr;
@@ -286,9 +299,9 @@ gdaui_entry_string_set_property (GObject *object,
static void
gdaui_entry_string_get_property (GObject *object,
- guint param_id,
- GValue *value,
- GParamSpec *pspec)
+ guint param_id,
+ GValue *value,
+ GParamSpec *pspec)
{
GdauiEntryString *mgstr;
@@ -298,8 +311,8 @@ gdaui_entry_string_get_property (GObject *object,
case PROP_MULTILINE:
g_value_set_boolean (value, mgstr->priv->multiline);
break;
- case PROP_EDITING_CANCELLED:
- g_value_set_boolean (value, GTK_ENTRY (mgstr->priv->entry)->editing_canceled);
+ case PROP_EDITING_CANCELED:
+ g_value_set_boolean (value, mgstr->priv->editing_canceled);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
@@ -554,10 +567,11 @@ gdaui_entry_string_start_editing (GtkCellEditable *iface, GdkEvent *event)
{
GdauiEntryString *mgstr;
- g_return_if_fail (iface && GDAUI_IS_ENTRY_STRING (iface));
+ g_return_if_fail (GDAUI_IS_ENTRY_STRING (iface));
mgstr = GDAUI_ENTRY_STRING (iface);
g_return_if_fail (mgstr->priv);
+ mgstr->priv->editing_canceled = FALSE;
g_object_set (G_OBJECT (mgstr->priv->entry), "has_frame", FALSE, "xalign", 0., NULL);
gtk_text_view_set_border_window_size (GTK_TEXT_VIEW (mgstr->priv->view), GTK_TEXT_WINDOW_LEFT, 0);
gtk_text_view_set_border_window_size (GTK_TEXT_VIEW (mgstr->priv->view), GTK_TEXT_WINDOW_RIGHT, 0);
@@ -567,12 +581,12 @@ gdaui_entry_string_start_editing (GtkCellEditable *iface, GdkEvent *event)
gtk_container_set_border_width (GTK_CONTAINER (mgstr->priv->sw), 0);
gtk_cell_editable_start_editing (GTK_CELL_EDITABLE (mgstr->priv->entry), event);
- g_signal_connect (G_OBJECT (mgstr->priv->entry), "editing_done",
+ g_signal_connect (mgstr->priv->entry, "editing_done",
G_CALLBACK (gtk_cell_editable_entry_editing_done_cb), mgstr);
- g_signal_connect (G_OBJECT (mgstr->priv->entry), "remove_widget",
+ g_signal_connect (mgstr->priv->entry, "remove_widget",
G_CALLBACK (gtk_cell_editable_entry_remove_widget_cb), mgstr);
gdaui_entry_shell_refresh (GDAUI_ENTRY_SHELL (mgstr));
-
+
gtk_widget_grab_focus (mgstr->priv->entry);
gtk_widget_queue_draw (GTK_WIDGET (mgstr));
}
diff --git a/libgda-ui/data-entries/gdaui-entry-time.c b/libgda-ui/data-entries/gdaui-entry-time.c
index f8b035a..530b8ff 100644
--- a/libgda-ui/data-entries/gdaui-entry-time.c
+++ b/libgda-ui/data-entries/gdaui-entry-time.c
@@ -58,7 +58,7 @@ gdaui_entry_time_get_type (void)
static void
gdaui_entry_time_class_init (GdauiEntryTimeClass * class)
{
- GObjectClass *object_class = G_OBJECT_CLASS (class);
+ GObjectClass *object_class = G_OBJECT_CLASS (class);
parent_class = g_type_class_peek_parent (class);
}
diff --git a/libgda-ui/data-entries/gdaui-entry-wrapper.c b/libgda-ui/data-entries/gdaui-entry-wrapper.c
index d7e3e64..7fb7887 100644
--- a/libgda-ui/data-entries/gdaui-entry-wrapper.c
+++ b/libgda-ui/data-entries/gdaui-entry-wrapper.c
@@ -865,8 +865,10 @@ gdaui_entry_wrapper_grab_focus (GdauiDataEntry *iface)
if (mgwrap->priv->real_class->grab_focus)
(mgwrap->priv->real_class->grab_focus) (mgwrap);
- else {
- if (mgwrap->priv->entry && GTK_WIDGET_CAN_FOCUS (mgwrap->priv->entry))
+ else if (mgwrap->priv->entry) {
+ gboolean canfocus;
+ g_object_get ((GObject*) mgwrap->priv->entry, "can-focus", &canfocus, NULL);
+ if (canfocus)
gtk_widget_grab_focus (mgwrap->priv->entry);
}
}
diff --git a/libgda-ui/data-entries/gdaui-entry.h b/libgda-ui/data-entries/gdaui-entry.h
index 2de6968..52937ac 100644
--- a/libgda-ui/data-entries/gdaui-entry.h
+++ b/libgda-ui/data-entries/gdaui-entry.h
@@ -21,7 +21,7 @@
#ifndef __GDAUI_ENTRY_H__
#define __GDAUI_ENTRY_H__
-#include <gtk/gtkentry.h>
+#include <gtk/gtk.h>
G_BEGIN_DECLS
diff --git a/libgda-ui/data-entries/gdaui-formatted-entry.c b/libgda-ui/data-entries/gdaui-formatted-entry.c
index 701a0f6..99c59d9 100644
--- a/libgda-ui/data-entries/gdaui-formatted-entry.c
+++ b/libgda-ui/data-entries/gdaui-formatted-entry.c
@@ -517,7 +517,7 @@ void
gdaui_formatted_entry_set_insert_func (GdauiFormattedEntry *entry, GdauiFormattedEntryInsertFunc insert_func,
gpointer data)
{
- g_return_val_if_fail (GDAUI_IS_FORMATTED_ENTRY (entry), NULL);
+ g_return_if_fail (GDAUI_IS_FORMATTED_ENTRY (entry));
entry->priv->insert_func = insert_func;
entry->priv->insert_func_data = data;
diff --git a/libgda-ui/data-entries/plugins/gdaui-data-cell-renderer-cgrid.c b/libgda-ui/data-entries/plugins/gdaui-data-cell-renderer-cgrid.c
index 9c4ebd3..d2e7e0b 100644
--- a/libgda-ui/data-entries/plugins/gdaui-data-cell-renderer-cgrid.c
+++ b/libgda-ui/data-entries/plugins/gdaui-data-cell-renderer-cgrid.c
@@ -1,6 +1,6 @@
/* gdaui-data-cell-renderer-cgrid.c
*
- * Copyright (C) 2007 - 2007 Carlos Savoretti
+ * Copyright (C) 2007 - 2009 Carlos Savoretti
*
* This Library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public License as
@@ -449,15 +449,23 @@ gdaui_data_cell_renderer_cgrid_render (GtkCellRenderer *renderer,
(renderer_class->render) (renderer, window, widget, background_rectangle, cell_rectangle, expose_rectangle, flags);
- if (GDAUI_DATA_CELL_RENDERER_CGRID(renderer)->priv->to_be_deleted)
- gtk_paint_hline (widget->style,
+ if (GDAUI_DATA_CELL_RENDERER_CGRID(renderer)->priv->to_be_deleted) {
+ GtkStyle *style;
+ guint xpad;
+
+ g_object_get ((GObject*) widget, "style", &style, NULL);
+ g_object_get ((GObject*) renderer, "xpad", &xpad, NULL);
+
+ gtk_paint_hline (style,
window, GTK_STATE_SELECTED,
cell_rectangle,
widget,
"hline",
- cell_rectangle->x + renderer->xpad,
- cell_rectangle->x + cell_rectangle->width - renderer->xpad,
+ cell_rectangle->x + xpad,
+ cell_rectangle->x + cell_rectangle->width - xpad,
cell_rectangle->y + cell_rectangle->height / 2.);
+ g_object_unref (style);
+ }
}
static void
diff --git a/libgda-ui/data-entries/plugins/gdaui-data-cell-renderer-password.c b/libgda-ui/data-entries/plugins/gdaui-data-cell-renderer-password.c
index bd9882d..352ca70 100644
--- a/libgda-ui/data-entries/plugins/gdaui-data-cell-renderer-password.c
+++ b/libgda-ui/data-entries/plugins/gdaui-data-cell-renderer-password.c
@@ -1,6 +1,6 @@
/* gdaui-data-cell-renderer-password.c
*
- * Copyright (C) 2003 - 2006 Vivien Malerba <malerba gdaui org>
+ * Copyright (C) 2003 - 2009 Vivien Malerba <malerba gdaui org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -137,10 +137,8 @@ gdaui_data_cell_renderer_password_init (GdauiDataCellRendererPassword *datacell)
datacell->priv->value = NULL;
datacell->priv->options = NULL;
- GTK_CELL_RENDERER (datacell)->xalign = 0.0;
- GTK_CELL_RENDERER (datacell)->yalign = 0.5;
- GTK_CELL_RENDERER (datacell)->xpad = 2;
- GTK_CELL_RENDERER (datacell)->ypad = 2;
+ g_object_set ((GObject*) datacell, "xalign", 0., "yalign", 0.,
+ "xpad", 2, "ypad", 2, NULL);
}
static void
@@ -235,8 +233,6 @@ gdaui_data_cell_renderer_password_get_property (GObject *object,
GValue *value,
GParamSpec *pspec)
{
- GdauiDataCellRendererPassword *datacell = GDAUI_DATA_CELL_RENDERER_PASSWORD (object);
-
switch (param_id) {
case PROP_VALUE_ATTRIBUTES:
/* nothing to do */
@@ -382,19 +378,27 @@ gdaui_data_cell_renderer_password_render (GtkCellRenderer *cell,
GtkCellRendererClass *text_class = g_type_class_peek (GTK_TYPE_CELL_RENDERER_TEXT);
(text_class->render) (cell, window, widget, background_area, cell_area, expose_area, flags);
- if (GDAUI_DATA_CELL_RENDERER_PASSWORD (cell)->priv->to_be_deleted)
- gtk_paint_hline (widget->style,
+ if (GDAUI_DATA_CELL_RENDERER_PASSWORD (cell)->priv->to_be_deleted) {
+ GtkStyle *style;
+ guint xpad;
+
+ g_object_get ((GObject*) widget, "style", &style, NULL);
+ g_object_get ((GObject*) cell, "xpad", &xpad, NULL);
+
+ gtk_paint_hline (style,
window, GTK_STATE_SELECTED,
cell_area,
widget,
"hline",
- cell_area->x + cell->xpad, cell_area->x + cell_area->width - cell->xpad,
+ cell_area->x + xpad, cell_area->x + cell_area->width - xpad,
cell_area->y + cell_area->height / 2.);
+ g_object_unref (style);
+ }
}
static void
gdaui_data_cell_renderer_password_editing_done (GtkCellEditable *entry,
- gpointer data)
+ gpointer data)
{
const gchar *path;
GdauiDataCellRendererPasswordInfo *info;
@@ -408,11 +412,11 @@ gdaui_data_cell_renderer_password_editing_done (GtkCellEditable *entry,
info->focus_out_id = 0;
}
- if (g_object_class_find_property (G_OBJECT_GET_CLASS (entry), "editing_cancelled")) {
- gboolean editing_cancelled;
+ if (g_object_class_find_property (G_OBJECT_GET_CLASS (entry), "editing-canceled")) {
+ gboolean editing_canceled;
- g_object_get (G_OBJECT (entry), "editing_cancelled", &editing_cancelled, NULL);
- if (editing_cancelled)
+ g_object_get (G_OBJECT (entry), "editing-canceled", &editing_canceled, NULL);
+ if (editing_canceled)
return;
}
@@ -462,7 +466,7 @@ gdaui_data_cell_renderer_password_start_editing (GtkCellRenderer *cell,
g_object_set (G_OBJECT (entry), "is_cell_renderer", TRUE, "actions", FALSE, NULL);
- gdaui_data_entry_set_value_orig (GDAUI_DATA_ENTRY (entry), datacell->priv->value);
+ gdaui_data_entry_set_original_value (GDAUI_DATA_ENTRY (entry), datacell->priv->value);
info = g_new0 (GdauiDataCellRendererPasswordInfo, 1);
g_object_set_data_full (G_OBJECT (entry), GDAUI_DATA_CELL_RENDERER_PASSWORD_PATH, g_strdup (path), g_free);
diff --git a/libgda-ui/data-entries/plugins/gdaui-data-cell-renderer-pict.c b/libgda-ui/data-entries/plugins/gdaui-data-cell-renderer-pict.c
index 97756a1..dd1d8a0 100644
--- a/libgda-ui/data-entries/plugins/gdaui-data-cell-renderer-pict.c
+++ b/libgda-ui/data-entries/plugins/gdaui-data-cell-renderer-pict.c
@@ -1,6 +1,6 @@
/* gdaui-data-cell-renderer-pict.c
*
- * Copyright (C) 2006 - 2007 Vivien Malerba <malerba gdaui org>
+ * Copyright (C) 2006 - 2009 Vivien Malerba <malerba gdaui org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -153,10 +153,8 @@ gdaui_data_cell_renderer_pict_init (GdauiDataCellRendererPict *cell)
gtk_icon_size_lookup (GTK_ICON_SIZE_DIALOG, &(cell->priv->size.width), &(cell->priv->size.height));
- GTK_CELL_RENDERER (cell)->mode = GTK_CELL_RENDERER_MODE_ACTIVATABLE;
- GTK_CELL_RENDERER (cell)->xpad = 2;
- GTK_CELL_RENDERER (cell)->ypad = 2;
-
+ g_object_set ((GObject*) cell, "mode", GTK_CELL_RENDERER_MODE_ACTIVATABLE,
+ "xpad", 2, "ypad", 2, NULL);
g_signal_connect (G_OBJECT (cell), "notify",
G_CALLBACK (notify_property_cb), NULL);
}
@@ -399,15 +397,22 @@ gdaui_data_cell_renderer_pict_render (GtkCellRenderer *cell,
(pixbuf_class->render) (cell, window, widget, background_area, cell_area, expose_area, flags);
- if (GDAUI_DATA_CELL_RENDERER_PICT (cell)->priv->to_be_deleted)
- gtk_paint_hline (widget->style,
+ if (GDAUI_DATA_CELL_RENDERER_PICT (cell)->priv->to_be_deleted) {
+ GtkStyle *style;
+ guint xpad;
+
+ g_object_get ((GObject*) widget, "style", &style, NULL);
+ g_object_get ((GObject*) cell, "xpad", &xpad, NULL);
+
+ gtk_paint_hline (style,
window, GTK_STATE_SELECTED,
cell_area,
widget,
"hline",
- cell_area->x + cell->xpad, cell_area->x + cell_area->width - cell->xpad,
+ cell_area->x + xpad, cell_area->x + cell_area->width - xpad,
cell_area->y + cell_area->height / 2.);
-
+ g_object_unref (style);
+ }
}
static void
diff --git a/libgda-ui/data-entries/plugins/gdaui-entry-cgrid.c b/libgda-ui/data-entries/plugins/gdaui-entry-cgrid.c
index 143396d..18540aa 100644
--- a/libgda-ui/data-entries/plugins/gdaui-entry-cgrid.c
+++ b/libgda-ui/data-entries/plugins/gdaui-entry-cgrid.c
@@ -22,13 +22,7 @@
#include <gdk/gdkkeysyms.h>
-#include <gtk/gtkhbox.h>
-#include <gtk/gtkentry.h>
-#include <gtk/gtktogglebutton.h>
-#include <gtk/gtkwindow.h>
-#include <gtk/gtkscrolledwindow.h>
-#include <gtk/gtktreeview.h>
-#include <gtk/gtktreeselection.h>
+#include <gtk/gtk.h>
#include <libgda/gda-data-model.h>
#include <libgda-ui/gdaui-raw-grid.h>
@@ -133,7 +127,7 @@ get_row_height (GdauiEntryCGrid *cgrid)
GList *current1 = renderers;
while (current1) {
GtkCellRenderer *renderer = (GtkCellRenderer *) current1->data;
- guint height;
+ gint height;
gtk_cell_renderer_get_size (renderer, cgrid->priv->tree_view,
NULL, NULL, NULL, NULL, &height);
@@ -220,7 +214,7 @@ toggle_button_on_toggled (GtkToggleButton *toggle_button,
if (gtk_toggle_button_get_active (toggle_button) == TRUE) {
GdauiEntryCGrid *cgrid = (GdauiEntryCGrid *) data;
-
+ GdkWindow *gdkwin;
GtkWidget *window_popup = GDAUI_ENTRY_CGRID(cgrid)->priv->window_popup;
GtkRequisition requisition;
@@ -229,14 +223,25 @@ toggle_button_on_toggled (GtkToggleButton *toggle_button,
gint x, y, width, height;
- gdk_window_get_origin (GDK_WINDOW
- (GTK_WIDGET(cgrid)->window),
- &x, &y);
-
- x += GTK_WIDGET(cgrid)->allocation.x;
+#if GTK_CHECK_VERSION(2,18,0)
+ gdkwin = gtk_widget_get_window (GTK_WIDGET(cgrid));
+#else
+ gdkwin = GDK_WINDOW (GTK_WIDGET(cgrid)->window);
+#endif
+ gdk_window_get_origin (gdkwin, &x, &y);
+
+#if GTK_CHECK_VERSION(2,18,0)
+ GtkAllocation alloc;
+ gtk_widget_get_allocation (GTK_WIDGET (cgrid), &alloc);
+ x += alloc.x;
+ width = alloc.width;
+ height = alloc.height;
+#else
+ x += GTK_WIDGET (cgrid)->allocation.x;
/* y += cgrid->priv->entry->allocation.y; */
- width = GTK_WIDGET(cgrid)->allocation.width;
- height = GTK_WIDGET(cgrid)->allocation.height;
+ width = GTK_WIDGET (cgrid)->allocation.width;
+ height = GTK_WIDGET (cgrid)->allocation.height;
+#endif
/* x += width - requisition.width; */
y += height;
@@ -246,13 +251,22 @@ toggle_button_on_toggled (GtkToggleButton *toggle_button,
gtk_grab_add (window_popup);
gtk_window_move (GTK_WINDOW(window_popup), x, y);
gtk_widget_set_size_request (window_popup,
+#if GTK_CHECK_VERSION(2,18,0)
+ alloc.width,
+#else
GTK_WIDGET(cgrid)->allocation.width,
+#endif
((y + cgrid->priv->grid_height) > gdk_screen_height ()) ? gdk_screen_height () - y : cgrid->priv->grid_height);
gtk_widget_show (window_popup);
gtk_widget_grab_focus (cgrid->priv->tree_view);
+#if GTK_CHECK_VERSION(2,18,0)
+ popup_grab_on_window (gtk_widget_get_window (window_popup),
+ gtk_get_current_event_time ());
+#else
popup_grab_on_window (window_popup->window,
gtk_get_current_event_time ());
+#endif
}
}
@@ -358,7 +372,7 @@ window_popup_on_button_press_event (GtkWidget *window_popup,
while (event_widget) {
if (event_widget == window_popup)
return FALSE;
- event_widget = event_widget->parent;
+ event_widget = gtk_widget_get_parent (event_widget);
}
}
@@ -809,7 +823,6 @@ gdaui_entry_cgrid_class_init (GdauiEntryCGridClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
- GdauiEntryShellClass *shell_class = GDAUI_ENTRY_SHELL_CLASS(klass);
GdauiEntryWrapperClass *wrapper_class = GDAUI_ENTRY_WRAPPER_CLASS(klass);
parent_class = g_type_class_peek_parent (klass);
diff --git a/libgda-ui/data-entries/plugins/gdaui-entry-pict.c b/libgda-ui/data-entries/plugins/gdaui-entry-pict.c
index 05bdc77..0e4a338 100644
--- a/libgda-ui/data-entries/plugins/gdaui-entry-pict.c
+++ b/libgda-ui/data-entries/plugins/gdaui-entry-pict.c
@@ -1,6 +1,6 @@
/* gdaui-entry-pict.c
*
- * Copyright (C) 2006 - 2007 Vivien Malerba
+ * Copyright (C) 2006 - 2009 Vivien Malerba
*
* This Library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public License as
@@ -381,8 +381,15 @@ display_image (GdauiEntryPict *mgpict, const GValue *value, const gchar *error_s
PictAllocation alloc;
GError *error = NULL;
+#if GTK_CHECK_VERSION(2,18,0)
+ GtkAllocation walloc;
+ gtk_widget_get_allocation (mgpict->priv->sw, &walloc);
+ alloc.width = walloc.width;
+ alloc.height = walloc.height;
+#else
alloc.width = mgpict->priv->sw->allocation.width;
alloc.height = mgpict->priv->sw->allocation.height;
+#endif
pixbuf = common_pict_fetch_cached_pixbuf (&(mgpict->priv->options), value);
if (pixbuf)
diff --git a/libgda-ui/demos/cloud.c b/libgda-ui/demos/cloud.c
index a57f531..7acbb64 100644
--- a/libgda-ui/demos/cloud.c
+++ b/libgda-ui/demos/cloud.c
@@ -43,7 +43,12 @@ do_cloud (GtkWidget *do_widget)
G_CALLBACK (gtk_widget_destroyed), &window);
vbox = gtk_vbox_new (FALSE, 5);
+#if GTK_CHECK_VERSION(2,18,0)
+ gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (window))),
+ vbox, TRUE, TRUE, 0);
+#else
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), vbox, TRUE, TRUE, 0);
+#endif
gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
label = gtk_label_new ("The following GdauiCloud widget displays customers,\n"
@@ -95,10 +100,14 @@ do_cloud (GtkWidget *do_widget)
G_CALLBACK (mode_changed_cb), cloud);
}
- if (!GTK_WIDGET_VISIBLE (window))
+ gboolean visible;
+ g_object_get (G_OBJECT (window), "visible", &visible, NULL);
+ if (!visible)
gtk_widget_show_all (window);
- else
+ else {
gtk_widget_destroy (window);
+ window = NULL;
+ }
return window;
}
diff --git a/libgda-ui/demos/data_model_dir.c b/libgda-ui/demos/data_model_dir.c
index 74a1a2a..579db9e 100644
--- a/libgda-ui/demos/data_model_dir.c
+++ b/libgda-ui/demos/data_model_dir.c
@@ -62,7 +62,12 @@ do_data_model_dir (GtkWidget *do_widget)
G_CALLBACK (gtk_widget_destroyed), &window);
vbox = gtk_vbox_new (FALSE, 5);
+#if GTK_CHECK_VERSION(2,18,0)
+ gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (window))),
+ vbox, TRUE, TRUE, 0);
+#else
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), vbox, TRUE, TRUE, 0);
+#endif
gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
label = gtk_label_new ("The following GdauiForm widget displays data from a GdaDataModelDir "
@@ -106,10 +111,14 @@ do_data_model_dir (GtkWidget *do_widget)
gda_value_free (value);
}
- if (!GTK_WIDGET_VISIBLE (window))
+ gboolean visible;
+ g_object_get (G_OBJECT (window), "visible", &visible, NULL);
+ if (!visible)
gtk_widget_show_all (window);
- else
+ else {
gtk_widget_destroy (window);
+ window = NULL;
+ }
return window;
}
diff --git a/libgda-ui/demos/ddl_queries.c b/libgda-ui/demos/ddl_queries.c
index 65455a6..dd99b09 100644
--- a/libgda-ui/demos/ddl_queries.c
+++ b/libgda-ui/demos/ddl_queries.c
@@ -74,7 +74,12 @@ do_ddl_queries (GtkWidget *do_widget)
G_CALLBACK (gtk_widget_destroyed), &window);
table = gtk_table_new (3, 2, FALSE);
+#if GTK_CHECK_VERSION(2,18,0)
+ gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (window))),
+ table, TRUE, TRUE, 0);
+#else
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), table, TRUE, TRUE, 0);
+#endif
gtk_container_set_border_width (GTK_CONTAINER (table), 5);
label = gtk_label_new ("<b>Tested provider and operation:</b>");
@@ -142,10 +147,14 @@ do_ddl_queries (GtkWidget *do_widget)
gtk_combo_box_set_active (GTK_COMBO_BOX (data->op_combo), 1);
}
- if (!GTK_WIDGET_VISIBLE (window))
+ gboolean visible;
+ g_object_get (G_OBJECT (window), "visible", &visible, NULL);
+ if (!visible)
gtk_widget_show_all (window);
- else
+ else {
gtk_widget_destroy (window);
+ window = NULL;
+ }
return window;
}
@@ -407,7 +416,12 @@ show_named_parameters (GtkButton *button, DemoData *data)
label = gtk_label_new ("<b>Named parameters:</b>\n");
gtk_misc_set_alignment (GTK_MISC (label), 0., -1);
gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), label, FALSE, FALSE, 5);
+#if GTK_CHECK_VERSION(2,18,0)
+ gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dlg))),
+ label, TRUE, TRUE, 0);
+#else
+ gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), label, TRUE, TRUE, 0);
+#endif
gtk_widget_show (label);
/* text area */
@@ -433,7 +447,12 @@ show_named_parameters (GtkButton *button, DemoData *data)
gtk_container_add (GTK_CONTAINER (sw), view);
gtk_widget_show_all (sw);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), sw, TRUE, TRUE, 0);
+#if GTK_CHECK_VERSION(2,18,0)
+ gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dlg))),
+ sw, TRUE, TRUE, 0);
+#else
+ gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), sw, TRUE, TRUE, 0);
+#endif
gtk_widget_set_size_request (dlg, 530, 350);
gtk_dialog_run (GTK_DIALOG (dlg));
diff --git a/libgda-ui/demos/form.c b/libgda-ui/demos/form.c
index 28122f7..6d63e7f 100644
--- a/libgda-ui/demos/form.c
+++ b/libgda-ui/demos/form.c
@@ -33,7 +33,12 @@ do_form (GtkWidget *do_widget)
G_CALLBACK (gtk_widget_destroyed), &window);
vbox = gtk_vbox_new (FALSE, 5);
+#if GTK_CHECK_VERSION(2,18,0)
+ gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (window))),
+ vbox, TRUE, TRUE, 0);
+#else
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), vbox, TRUE, TRUE, 0);
+#endif
gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
label = gtk_label_new ("The following GdauiForm widget displays data from the 'products' table.\n\n"
@@ -50,10 +55,14 @@ do_form (GtkWidget *do_widget)
gtk_box_pack_start (GTK_BOX (vbox), form, TRUE, TRUE, 0);
}
- if (!GTK_WIDGET_VISIBLE (window))
+ gboolean visible;
+ g_object_get (G_OBJECT (window), "visible", &visible, NULL);
+ if (!visible)
gtk_widget_show_all (window);
- else
+ else {
gtk_widget_destroy (window);
+ window = NULL;
+ }
return window;
}
diff --git a/libgda-ui/demos/form_data_layout.c b/libgda-ui/demos/form_data_layout.c
index 499a509..326c518 100644
--- a/libgda-ui/demos/form_data_layout.c
+++ b/libgda-ui/demos/form_data_layout.c
@@ -39,7 +39,12 @@ do_form_data_layout (GtkWidget *do_widget)
G_CALLBACK (gtk_widget_destroyed), &window);
vbox = gtk_vbox_new (FALSE, 5);
+#if GTK_CHECK_VERSION(2,18,0)
+ gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (window))),
+ vbox, TRUE, TRUE, 0);
+#else
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), vbox, TRUE, TRUE, 0);
+#endif
gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
label = gtk_label_new ("The following GdauiForm widget displays data from the 'products' table.\n\n"
@@ -73,10 +78,14 @@ do_form_data_layout (GtkWidget *do_widget)
gtk_widget_set_size_request (window, 500, 500);
}
- if (!GTK_WIDGET_VISIBLE (window))
+ gboolean visible;
+ g_object_get (G_OBJECT (window), "visible", &visible, NULL);
+ if (!visible)
gtk_widget_show_all (window);
- else
+ else {
gtk_widget_destroy (window);
+ window = NULL;
+ }
return window;
}
diff --git a/libgda-ui/demos/form_pict.c b/libgda-ui/demos/form_pict.c
index 3ae2a2e..8070cb8 100644
--- a/libgda-ui/demos/form_pict.c
+++ b/libgda-ui/demos/form_pict.c
@@ -38,7 +38,12 @@ do_form_pict (GtkWidget *do_widget)
G_CALLBACK (gtk_widget_destroyed), &window);
vbox = gtk_vbox_new (FALSE, 5);
+#if GTK_CHECK_VERSION(2,18,0)
+ gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (window))),
+ vbox, TRUE, TRUE, 0);
+#else
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), vbox, TRUE, TRUE, 0);
+#endif
gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
label = gtk_label_new ("The following GdauiForm widget displays data from the 'pictures' table.\n\n"
@@ -69,10 +74,14 @@ do_form_pict (GtkWidget *do_widget)
gtk_widget_set_size_request (window, 500, 500);
}
- if (!GTK_WIDGET_VISIBLE (window))
+ gboolean visible;
+ g_object_get (G_OBJECT (window), "visible", &visible, NULL);
+ if (!visible)
gtk_widget_show_all (window);
- else
+ else {
gtk_widget_destroy (window);
+ window = NULL;
+ }
return window;
}
diff --git a/libgda-ui/demos/form_rw.c b/libgda-ui/demos/form_rw.c
index 5b5e650..858f0b1 100644
--- a/libgda-ui/demos/form_rw.c
+++ b/libgda-ui/demos/form_rw.c
@@ -33,7 +33,12 @@ do_form_rw (GtkWidget *do_widget)
G_CALLBACK (gtk_widget_destroyed), &window);
vbox = gtk_vbox_new (FALSE, 5);
+#if GTK_CHECK_VERSION(2,18,0)
+ gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (window))),
+ vbox, TRUE, TRUE, 0);
+#else
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), vbox, TRUE, TRUE, 0);
+#endif
gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
label = gtk_label_new ("The following GdauiForm widget displays data from the 'products' table.\n\n"
@@ -57,10 +62,14 @@ do_form_rw (GtkWidget *do_widget)
gtk_box_pack_start (GTK_BOX (vbox), form, TRUE, TRUE, 0);
}
- if (!GTK_WIDGET_VISIBLE (window))
+ gboolean visible;
+ g_object_get (G_OBJECT (window), "visible", &visible, NULL);
+ if (!visible)
gtk_widget_show_all (window);
- else
+ else {
gtk_widget_destroy (window);
+ window = NULL;
+ }
return window;
}
diff --git a/libgda-ui/demos/grid.c b/libgda-ui/demos/grid.c
index 8921601..2fa6418 100644
--- a/libgda-ui/demos/grid.c
+++ b/libgda-ui/demos/grid.c
@@ -33,7 +33,12 @@ do_grid (GtkWidget *do_widget)
G_CALLBACK (gtk_widget_destroyed), &window);
vbox = gtk_vbox_new (FALSE, 5);
+#if GTK_CHECK_VERSION(2,18,0)
+ gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (window))),
+ vbox, TRUE, TRUE, 0);
+#else
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), vbox, TRUE, TRUE, 0);
+#endif
gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
label = gtk_label_new ("The following GdauiGrid widget displays data from the 'products' table.\n\n"
@@ -50,10 +55,14 @@ do_grid (GtkWidget *do_widget)
gtk_box_pack_start (GTK_BOX (vbox), grid, TRUE, TRUE, 0);
}
- if (!GTK_WIDGET_VISIBLE (window))
+ gboolean visible;
+ g_object_get (G_OBJECT (window), "visible", &visible, NULL);
+ if (!visible)
gtk_widget_show_all (window);
- else
+ else {
gtk_widget_destroy (window);
+ window = NULL;
+ }
return window;
}
diff --git a/libgda-ui/demos/grid_data_layout.c b/libgda-ui/demos/grid_data_layout.c
index 5353419..bb40140 100644
--- a/libgda-ui/demos/grid_data_layout.c
+++ b/libgda-ui/demos/grid_data_layout.c
@@ -39,7 +39,12 @@ do_grid_data_layout (GtkWidget *do_widget)
G_CALLBACK (gtk_widget_destroyed), &window);
vbox = gtk_vbox_new (FALSE, 5);
+#if GTK_CHECK_VERSION(2,18,0)
+ gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (window))),
+ vbox, TRUE, TRUE, 0);
+#else
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), vbox, TRUE, TRUE, 0);
+#endif
gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
label = gtk_label_new ("The following GdauiGrid widget displays data from the 'products' table.\n\n"
@@ -84,10 +89,14 @@ do_grid_data_layout (GtkWidget *do_widget)
gtk_widget_set_size_request (window, 500, 500);
}
- if (!GTK_WIDGET_VISIBLE (window))
+ gboolean visible;
+ g_object_get (G_OBJECT (window), "visible", &visible, NULL);
+ if (!visible)
gtk_widget_show_all (window);
- else
+ else {
gtk_widget_destroy (window);
+ window = NULL;
+ }
return window;
}
diff --git a/libgda-ui/demos/grid_pict.c b/libgda-ui/demos/grid_pict.c
index 20831a6..4b77a45 100644
--- a/libgda-ui/demos/grid_pict.c
+++ b/libgda-ui/demos/grid_pict.c
@@ -38,7 +38,12 @@ do_grid_pict (GtkWidget *do_widget)
G_CALLBACK (gtk_widget_destroyed), &window);
vbox = gtk_vbox_new (FALSE, 5);
+#if GTK_CHECK_VERSION(2,18,0)
+ gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (window))),
+ vbox, TRUE, TRUE, 0);
+#else
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), vbox, TRUE, TRUE, 0);
+#endif
gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
label = gtk_label_new ("The following GdauiGrid widget displays data from the 'pictures' table.\n\n"
@@ -69,10 +74,14 @@ do_grid_pict (GtkWidget *do_widget)
gtk_widget_set_size_request (window, 500, 500);
}
- if (!GTK_WIDGET_VISIBLE (window))
+ gboolean visible;
+ g_object_get (G_OBJECT (window), "visible", &visible, NULL);
+ if (!visible)
gtk_widget_show_all (window);
- else
+ else {
gtk_widget_destroy (window);
+ window = NULL;
+ }
return window;
}
diff --git a/libgda-ui/demos/grid_rw.c b/libgda-ui/demos/grid_rw.c
index 919fe54..9303957 100644
--- a/libgda-ui/demos/grid_rw.c
+++ b/libgda-ui/demos/grid_rw.c
@@ -33,7 +33,12 @@ do_grid_rw (GtkWidget *do_widget)
G_CALLBACK (gtk_widget_destroyed), &window);
vbox = gtk_vbox_new (FALSE, 5);
+#if GTK_CHECK_VERSION(2,18,0)
+ gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (window))),
+ vbox, TRUE, TRUE, 0);
+#else
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), vbox, TRUE, TRUE, 0);
+#endif
gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
label = gtk_label_new ("The following GdauiGrid widget displays data from the 'products' table.\n\n"
@@ -52,10 +57,14 @@ do_grid_rw (GtkWidget *do_widget)
gtk_box_pack_start (GTK_BOX (vbox), grid, TRUE, TRUE, 0);
}
- if (!GTK_WIDGET_VISIBLE (window))
+ gboolean visible;
+ g_object_get (G_OBJECT (window), "visible", &visible, NULL);
+ if (!visible)
gtk_widget_show_all (window);
- else
+ else {
gtk_widget_destroy (window);
+ window = NULL;
+ }
return window;
}
diff --git a/libgda-ui/demos/linked_grid_form.c b/libgda-ui/demos/linked_grid_form.c
index 7e3cc25..e15886e 100644
--- a/libgda-ui/demos/linked_grid_form.c
+++ b/libgda-ui/demos/linked_grid_form.c
@@ -92,7 +92,12 @@ do_linked_grid_form (GtkWidget *do_widget)
g_object_set_data_full (G_OBJECT (window), "demodata", data, g_free);
vbox = gtk_vbox_new (FALSE, 5);
+#if GTK_CHECK_VERSION(2,18,0)
+ gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (window))),
+ vbox, TRUE, TRUE, 0);
+#else
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), vbox, TRUE, TRUE, 0);
+#endif
gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
label = gtk_label_new ("The following GdauiForm and GdauiGrid widgets\n"
@@ -168,10 +173,14 @@ do_linked_grid_form (GtkWidget *do_widget)
G_CALLBACK (sync_selections_cb), data);
}
- if (!GTK_WIDGET_VISIBLE (window))
+ gboolean visible;
+ g_object_get (G_OBJECT (window), "visible", &visible, NULL);
+ if (!visible)
gtk_widget_show_all (window);
- else
+ else {
gtk_widget_destroy (window);
+ window = NULL;
+ }
return window;
}
diff --git a/libgda-ui/demos/linked_model_param.c b/libgda-ui/demos/linked_model_param.c
index 10fd959..06b4ba4 100644
--- a/libgda-ui/demos/linked_model_param.c
+++ b/libgda-ui/demos/linked_model_param.c
@@ -45,7 +45,12 @@ do_linked_model_param (GtkWidget *do_widget)
G_CALLBACK (gtk_widget_destroyed), &window);
vbox = gtk_vbox_new (FALSE, 5);
+#if GTK_CHECK_VERSION(2,18,0)
+ gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (window))),
+ vbox, TRUE, TRUE, 0);
+#else
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), vbox, TRUE, TRUE, 0);
+#endif
gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
label = gtk_label_new ("");
@@ -105,10 +110,14 @@ do_linked_model_param (GtkWidget *do_widget)
gtk_widget_show (grid);
}
- if (!GTK_WIDGET_VISIBLE (window))
+ gboolean visible;
+ g_object_get (G_OBJECT (window), "visible", &visible, NULL);
+ if (!visible)
gtk_widget_show_all (window);
- else
+ else {
gtk_widget_destroy (window);
-
+ window = NULL;
+ }
+
return window;
}
diff --git a/libgda-ui/demos/login.c b/libgda-ui/demos/login.c
index 6d16cbb..9a78001 100644
--- a/libgda-ui/demos/login.c
+++ b/libgda-ui/demos/login.c
@@ -78,7 +78,12 @@ do_login (GtkWidget *do_widget)
table = gtk_table_new (3, 2, FALSE);
+#if GTK_CHECK_VERSION(2,18,0)
+ gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (window))),
+ table, TRUE, TRUE, 0);
+#else
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), table, TRUE, TRUE, 0);
+#endif
gtk_container_set_border_width (GTK_CONTAINER (table), 5);
/* Create the login widget */
@@ -122,10 +127,14 @@ do_login (GtkWidget *do_widget)
G_CALLBACK (login_changed_cb), status);
}
- if (!GTK_WIDGET_VISIBLE (window))
+ gboolean visible;
+ g_object_get (G_OBJECT (window), "visible", &visible, NULL);
+ if (!visible)
gtk_widget_show_all (window);
- else
+ else {
gtk_widget_destroy (window);
+ window = NULL;
+ }
return window;
}
diff --git a/libgda-ui/demos/tree.c b/libgda-ui/demos/tree.c
index c4b3cf4..8c557c2 100644
--- a/libgda-ui/demos/tree.c
+++ b/libgda-ui/demos/tree.c
@@ -126,7 +126,12 @@ do_tree (GtkWidget *do_widget)
"feeds it to a GdauiTreeStore (which implements the GtkTreeModel\n"
"interface, and creates a GtkTreeView to display the contents\n"
"of the GdaTree");
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), label, FALSE, FALSE, 0);
+#if GTK_CHECK_VERSION(2,18,0)
+ gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (window))),
+ label, TRUE, TRUE, 0);
+#else
+ gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), label, TRUE, TRUE, 0);
+#endif
/* create GdaTree */
tree = gda_tree_new ();
@@ -147,7 +152,12 @@ do_tree (GtkWidget *do_widget)
G_TYPE_BOOLEAN, "scale-set");
treeview = gtk_tree_view_new_with_model (model);
g_object_unref (model);
+#if GTK_CHECK_VERSION(2,18,0)
+ gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (window))),
+ treeview, TRUE, TRUE, 0);
+#else
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), treeview, TRUE, TRUE, 0);
+#endif
/* create GtkTreeView's column */
enum {
@@ -161,13 +171,17 @@ do_tree (GtkWidget *do_widget)
"scale-set", COLUMN_SCALE_SET,
"scale", COLUMN_SCALE,
NULL);
- gtk_tree_view_append_column (treeview, column);
+ gtk_tree_view_append_column (GTK_TREE_VIEW (treeview), column);
}
- if (!GTK_WIDGET_VISIBLE (window))
+ gboolean visible;
+ g_object_get (G_OBJECT (window), "visible", &visible, NULL);
+ if (!visible)
gtk_widget_show_all (window);
- else
+ else {
gtk_widget_destroy (window);
+ window = NULL;
+ }
return window;
}
diff --git a/libgda-ui/gdaui-basic-form.c b/libgda-ui/gdaui-basic-form.c
index 3bf38be..76b6a55 100644
--- a/libgda-ui/gdaui-basic-form.c
+++ b/libgda-ui/gdaui-basic-form.c
@@ -452,24 +452,24 @@ load_xml_data_layout_button (GdauiBasicForm *form,
gint sequence = 0;
xmlChar *str;
- str = xmlGetProp (node, "title");
+ str = xmlGetProp (node, BAD_CAST "title");
if (str) {
- title = g_strdup (str);
- g_print ("title: %s\n", str);
+ title = g_strdup ((gchar*) str);
+ g_print ("title: %s\n", (gchar*) str);
xmlFree (str);
}
- str = xmlGetProp (node, "script");
+ str = xmlGetProp (node, BAD_CAST "script");
if (str) {
- script = g_strdup (str);
- g_print ("script: %s\n", str);
+ script = g_strdup ((gchar*) str);
+ g_print ("script: %s\n", (gchar*) str);
xmlFree (str);
}
- str = xmlGetProp (node, "sequence");
+ str = xmlGetProp (node, BAD_CAST "sequence");
if (str) {
- sequence = atoi (str);
- g_print ("sequence: %s\n", str);
+ sequence = atoi ((gchar*) str);
+ g_print ("sequence: %s\n", (gchar*) str);
xmlFree (str);
}
@@ -493,7 +493,7 @@ load_xml_data_layout_button (GdauiBasicForm *form,
for (child = node->children; child != NULL; child = child->next) {
if (child->type == XML_ELEMENT_NODE &&
- !xmlStrcmp (child->name, (const xmlChar *) "script")) {
+ !xmlStrcmp (child->name, BAD_CAST "script")) {
// load_data_layout_button_script (table, child);
}
}
@@ -516,10 +516,10 @@ load_xml_data_layout_item (GdauiBasicForm *form,
gboolean sort_ascending = FALSE;
xmlChar *str;
- str = xmlGetProp (node, "name");
+ str = xmlGetProp (node, BAD_CAST "name");
if (str) {
- name = g_strdup (str);
- g_print ("name: %s\n", str);
+ name = g_strdup ((gchar*) str);
+ g_print ("name: %s\n", (gchar*) str);
xmlFree (str);
}
@@ -535,24 +535,24 @@ load_xml_data_layout_item (GdauiBasicForm *form,
/* xmlFree (str); */
/* } */
- str = xmlGetProp (node, "sequence");
+ str = xmlGetProp (node, BAD_CAST "sequence");
if (str) {
- sequence = atoi (str);
- g_print ("sequence: %s\n", str);
+ sequence = atoi ((gchar*) str);
+ g_print ("sequence: %s\n", (gchar*) str);
xmlFree (str);
}
- str = xmlGetProp (node, "editable");
+ str = xmlGetProp (node, BAD_CAST "editable");
if (str) {
editable = (*str == 't' || *str == 'T') ? TRUE : FALSE;
- g_print ("editable: %s\n", str);
+ g_print ("editable: %s\n", (gchar*) str);
xmlFree (str);
}
- str = xmlGetProp (node, "sort_ascending");
+ str = xmlGetProp (node, BAD_CAST "sort_ascending");
if (str) {
sort_ascending = (*str == 't' || *str == 'T') ? TRUE : FALSE;
- g_print ("sort_ascending: %s\n", str);
+ g_print ("sort_ascending: %s\n", (gchar*) str);
xmlFree (str);
}
@@ -672,38 +672,38 @@ load_xml_data_layout_portal (GdauiBasicForm *form,
gint columns_count = 1;
xmlChar *str;
- str = xmlGetProp (node, "name");
+ str = xmlGetProp (node, BAD_CAST "name");
if (str) {
- name = g_strdup (str);
- g_print ("name: %s\n", str);
+ name = g_strdup ((gchar*) str);
+ g_print ("name: %s\n", (gchar*) str);
xmlFree (str);
}
- str = xmlGetProp (node, "relationship");
+ str = xmlGetProp (node, BAD_CAST "relationship");
if (str) {
- relationship = g_strdup (str);
- g_print ("relationship: %s\n", str);
+ relationship = g_strdup ((gchar*) str);
+ g_print ("relationship: %s\n", (gchar*) str);
xmlFree (str);
}
- str = xmlGetProp (node, "sequence");
+ str = xmlGetProp (node, BAD_CAST "sequence");
if (str) {
- sequence = atoi (str);
- g_print ("sequence: %s\n", str);
+ sequence = atoi ((gchar*) str);
+ g_print ("sequence: %s\n", (gchar*) str);
xmlFree (str);
}
- str = xmlGetProp (node, "hidden");
+ str = xmlGetProp (node, BAD_CAST "hidden");
if (str) {
hidden = *str == 't' || *str == 'T' ? TRUE : FALSE;
- g_print ("hidden: %s\n", str);
+ g_print ("hidden: %s\n", (gchar*) str);
xmlFree (str);
}
- str = xmlGetProp (node, "columns_count");
+ str = xmlGetProp (node, BAD_CAST "columns_count");
if (str) {
- columns_count = atoi (str);
- g_print ("columns_count: %s\n", str);
+ columns_count = atoi ((gchar*) str);
+ g_print ("columns_count: %s\n", (gchar*) str);
xmlFree (str);
}
@@ -726,7 +726,7 @@ load_xml_data_layout_portal (GdauiBasicForm *form,
gtk_widget_set_name (vbox, name);
- if (!xmlStrcmp (node->parent->name, (const xmlChar *) "data_layout_group")) {
+ if (!xmlStrcmp (node->parent->name, BAD_CAST "data_layout_group")) {
gint n_columns, n_rows;
@@ -742,7 +742,7 @@ load_xml_data_layout_portal (GdauiBasicForm *form,
(GtkAttachOptions) (GTK_FILL|GTK_EXPAND),
(GtkAttachOptions) (GTK_FILL|GTK_EXPAND), 0, 0);
} else
- if (!xmlStrcmp (node->parent->name, (const xmlChar *) "data_layout_notebook")) {
+ if (!xmlStrcmp (node->parent->name, BAD_CAST "data_layout_notebook")) {
GtkLabel *label;
gchar *markup = g_strdup_printf ("<b>%s</b>", (name != NULL) ? name : "");
@@ -780,28 +780,28 @@ load_xml_data_layout_notebook (GdauiBasicForm *form,
gchar *title = NULL;
xmlChar *str;
- str = xmlGetProp (node, "name");
+ str = xmlGetProp (node, BAD_CAST "name");
if (str) {
- g_print ("name: %s\n", str);
+ g_print ("name: %s\n", (gchar*) str);
xmlFree (str);
}
- str = xmlGetProp (node, "title");
+ str = xmlGetProp (node, BAD_CAST "title");
if (str) {
- g_print ("title: %s\n", str);
+ g_print ("title: %s\n", (gchar*) str);
xmlFree (str);
}
- str = xmlGetProp (node, "sequence");
+ str = xmlGetProp (node, BAD_CAST "sequence");
if (str) {
- sequence = atoi (str);
- g_print ("sequence: %s\n", str);
+ sequence = atoi ((gchar*) str);
+ g_print ("sequence: %s\n", (gchar*) str);
xmlFree (str);
}
- str = xmlGetProp (node, "columns_count");
+ str = xmlGetProp (node, BAD_CAST "columns_count");
if (str) {
- g_print ("columns_count: %s\n", str);
+ g_print ("columns_count: %s\n", (gchar*) str);
xmlFree (str);
}
@@ -862,31 +862,31 @@ load_xml_data_layout_group (GdauiBasicForm *form,
gchar *title = NULL;
xmlChar *str;
- str = xmlGetProp (node, "name");
+ str = xmlGetProp (node, BAD_CAST "name");
if (str) {
- name = g_strdup (str);
- g_print ("name: %s\n", str);
+ name = g_strdup ((gchar*) str);
+ g_print ("name: %s\n", (gchar*) str);
xmlFree (str);
}
- str = xmlGetProp (node, "sequence");
+ str = xmlGetProp (node, BAD_CAST "sequence");
if (str) {
- sequence = atoi (str);
- g_print ("sequence: %s\n", str);
+ sequence = atoi ((gchar*) str);
+ g_print ("sequence: %s\n", (gchar*) str);
xmlFree (str);
}
- str = xmlGetProp (node, "columns_count");
+ str = xmlGetProp (node, BAD_CAST "columns_count");
if (str) {
- columns_count = atoi (str);
- g_print ("columns_count: %s\n", str);
+ columns_count = atoi ((gchar*) str);
+ g_print ("columns_count: %s\n", (gchar*) str);
xmlFree (str);
}
- str = xmlGetProp (node, "title");
+ str = xmlGetProp (node, BAD_CAST "title");
if (str) {
- title = g_strdup (str);
- g_print ("title: %s\n", str);
+ title = g_strdup ((gchar*) str);
+ g_print ("title: %s\n", (gchar*) str);
xmlFree (str);
}
@@ -908,7 +908,7 @@ load_xml_data_layout_group (GdauiBasicForm *form,
gtk_table_set_row_spacings (table, 3);
gtk_table_set_col_spacings (table, 3);
- if (!xmlStrcmp (node->parent->name, (const xmlChar *) "data_layout_groups")) {
+ if (!xmlStrcmp (node->parent->name, BAD_CAST "data_layout_groups")) {
GtkFrame *frame = GTK_FRAME(gtk_frame_new (NULL));
gtk_widget_show (GTK_WIDGET(frame));
@@ -931,7 +931,7 @@ load_xml_data_layout_group (GdauiBasicForm *form,
gtk_box_pack_start (GTK_BOX(data), GTK_WIDGET(frame), FALSE, TRUE, 0);
} else
- if (!xmlStrcmp (node->parent->name, (const xmlChar *) "data_layout_group")) {
+ if (!xmlStrcmp (node->parent->name, BAD_CAST "data_layout_group")) {
GtkFrame *frame = GTK_FRAME(gtk_frame_new (NULL));
gtk_widget_show (GTK_WIDGET(frame));
@@ -965,7 +965,7 @@ load_xml_data_layout_group (GdauiBasicForm *form,
(GtkAttachOptions) (GTK_FILL|GTK_EXPAND),
(GtkAttachOptions) (GTK_FILL|GTK_EXPAND), 0, 0);
} else
- if (!xmlStrcmp (node->parent->name, (const xmlChar *) "data_layout_notebook")) {
+ if (!xmlStrcmp (node->parent->name, BAD_CAST "data_layout_notebook")) {
gchar *text = g_strdup ((title != NULL) ? title : "");
gtk_label_set_text (label, text);
@@ -978,45 +978,45 @@ load_xml_data_layout_group (GdauiBasicForm *form,
(GTK_NOTEBOOK(data), sequence - 1),
GTK_WIDGET(label));
}
-
+
xmlNodePtr child;
for (child = node->children; child != NULL; child = child->next) {
if (child->type == XML_ELEMENT_NODE &&
- !xmlStrcmp (child->name, (const xmlChar *) "data_layout_group")) {
+ !xmlStrcmp (child->name, BAD_CAST "data_layout_group")) {
load_xml_data_layout_group (form, child, /* data */ table);
}
if (child->type == XML_ELEMENT_NODE &&
- !xmlStrcmp (child->name, (const xmlChar *) "data_layout_item")) {
+ !xmlStrcmp (child->name, BAD_CAST "data_layout_item")) {
load_xml_data_layout_item (form, child, /* data */ table);
}
if (child->type == XML_ELEMENT_NODE &&
- !xmlStrcmp (child->name, (const xmlChar *) "data_layout_portal")) {
+ !xmlStrcmp (child->name, BAD_CAST "data_layout_portal")) {
load_xml_data_layout_portal (form, child, /* data */ table);
}
if (child->type == XML_ELEMENT_NODE &&
- !xmlStrcmp (child->name, (const xmlChar *) "data_layout_notebook")) {
+ !xmlStrcmp (child->name, BAD_CAST "data_layout_notebook")) {
load_xml_data_layout_notebook (form, child, /* data */ table);
}
if (child->type == XML_ELEMENT_NODE &&
- !xmlStrcmp (child->name, (const xmlChar *) "trans_set")) {
+ !xmlStrcmp (child->name, BAD_CAST "trans_set")) {
/* load_data_layout_group_trans_set (form, child, data); */
}
if (child->type == XML_ELEMENT_NODE &&
- !xmlStrcmp (child->name, (const xmlChar *) "data_layout_button")) {
+ !xmlStrcmp (child->name, BAD_CAST "data_layout_button")) {
load_xml_data_layout_button (form, child, /* data */ table);
}
if (child->type == XML_ELEMENT_NODE &&
- !xmlStrcmp (child->name, (const xmlChar *) "data_layout_item_groupby")) {
+ !xmlStrcmp (child->name, BAD_CAST "data_layout_item_groupby")) {
}
if (child->type == XML_ELEMENT_NODE &&
- !xmlStrcmp (child->name, (const xmlChar *) "data_layout_item_header")) {
+ !xmlStrcmp (child->name, BAD_CAST "data_layout_item_header")) {
}
}
@@ -1052,7 +1052,7 @@ load_xml_data_layout_groups (GdauiBasicForm *form,
for (child = node->children; child != NULL; child = child->next) {
if (child->type == XML_ELEMENT_NODE &&
- !xmlStrcmp (child->name, (const xmlChar *) "data_layout_group")) {
+ !xmlStrcmp (child->name, BAD_CAST "data_layout_group")) {
load_xml_data_layout_group (form, child, /* data */ vbox);
}
}
@@ -1071,17 +1071,17 @@ load_xml_data_layout (GdauiBasicForm *form,
gchar *name = NULL;
xmlChar *str;
- str = xmlGetProp (node, "parent_table");
+ str = xmlGetProp (node, BAD_CAST "parent_table");
if (str) {
- parent_table = g_strdup (str);
- g_print ("parent_table: %s\n", str);
+ parent_table = g_strdup ((gchar*) str);
+ g_print ("parent_table: %s\n", (gchar*) str);
xmlFree (str);
}
- str = xmlGetProp (node, "name");
+ str = xmlGetProp (node, BAD_CAST "name");
if (str) {
- name = g_strdup (str);
- g_print ("name: %s\n", str);
+ name = g_strdup ((gchar*) str);
+ g_print ("name: %s\n", (gchar*) str);
xmlFree (str);
}
@@ -1100,7 +1100,7 @@ load_xml_data_layout (GdauiBasicForm *form,
for (child = node->children; child != NULL; child = child->next) {
if (child->type == XML_ELEMENT_NODE &&
- !xmlStrcmp (child->name, (const xmlChar *) "data_layout_groups")) {
+ !xmlStrcmp (child->name, BAD_CAST "data_layout_groups")) {
load_xml_data_layout_groups (form, child, data);
}
}
@@ -1119,7 +1119,7 @@ load_xml_data_layouts (GdauiBasicForm *form,
for (child = node->children; child != NULL; child = child->next) {
if (child->type == XML_ELEMENT_NODE &&
- !xmlStrcmp (child->name, (const xmlChar *) "data_layout")) {
+ !xmlStrcmp (child->name, BAD_CAST "data_layout")) {
load_xml_data_layout (form, child, data);
}
}
@@ -1161,31 +1161,31 @@ load_xml_data_layouts (GdauiBasicForm *form,
/* for (child = node->children; child != NULL; child = child->next) { */
/* /\* if (child->type == XML_ELEMENT_NODE && *\/ */
-/* /\* !xmlStrcmp (child->name, (const xmlChar *) "fields")) { *\/ */
+/* /\* !xmlStrcmp (child->name, BAD_CAST "fields")) { *\/ */
/* /\* load_xml_fields (table, child, data); *\/ */
/* /\* } *\/ */
/* /\* if (child->type == XML_ELEMENT_NODE && *\/ */
-/* /\* !xmlStrcmp (child->name, (const xmlChar *) "relationships")) { *\/ */
+/* /\* !xmlStrcmp (child->name, BAD_CAST "relationships")) { *\/ */
/* /\* load_xml_relationships (table, child, data); *\/ */
/* /\* } *\/ */
/* if (child->type == XML_ELEMENT_NODE && */
-/* !xmlStrcmp (child->name, (const xmlChar *) "data_layouts")) { */
+/* !xmlStrcmp (child->name, BAD_CAST "data_layouts")) { */
/* load_xml_data_layouts (form, child, data); */
/* } */
/* /\* if (child->type == XML_ELEMENT_NODE && *\/ */
-/* /\* !xmlStrcmp (child->name, (const xmlChar *) "reports")) { *\/ */
+/* /\* !xmlStrcmp (child->name, BAD_CAST "reports")) { *\/ */
/* /\* load_xml_reports (table, child, data); *\/ */
/* /\* } *\/ */
/* /\* if (child->type == XML_ELEMENT_NODE && *\/ */
-/* /\* !xmlStrcmp (child->name, (const xmlChar *) "trans_set")) { *\/ */
+/* /\* !xmlStrcmp (child->name, BAD_CAST "trans_set")) { *\/ */
/* /\* load_xml_table_trans_set (table, child, data); *\/ */
/* /\* } *\/ */
@@ -1258,7 +1258,7 @@ gdaui_basic_form_set_property (GObject *object,
for (child = node->children; child != NULL; child = child->next) {
if (child->type == XML_ELEMENT_NODE &&
- !xmlStrcmp (child->name, (const xmlChar *) "data_layout_groups")) {
+ !xmlStrcmp (child->name, BAD_CAST "data_layout_groups")) {
load_xml_data_layout_groups (form, child, NULL);
}
}
@@ -2541,12 +2541,23 @@ gdaui_basic_form_new_in_dialog (GdaSet *paramlist, GtkWindow *parent,
str = g_markup_printf_escaped ("<b>%s:</b>", header);
gtk_label_set_markup (GTK_LABEL (label), str);
g_free (str);
+#if GTK_CHECK_VERSION(2,18,0)
+ gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dlg))),
+ label, FALSE, FALSE, 5);
+#else
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), label, FALSE, FALSE, 5);
+#endif
gtk_widget_show (label);
}
+
+#if GTK_CHECK_VERSION(2,18,0)
+ gtk_container_set_border_width (GTK_CONTAINER (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dlg)))), 4);
+ gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dlg))), form,
+#else
gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dlg)->vbox), 4);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), form,
+#endif
GDAUI_BASIC_FORM (form)->priv->can_expand,
GDAUI_BASIC_FORM (form)->priv->can_expand, 10);
diff --git a/libgda-ui/gdaui-cloud.c b/libgda-ui/gdaui-cloud.c
index 727c276..9171379 100644
--- a/libgda-ui/gdaui-cloud.c
+++ b/libgda-ui/gdaui-cloud.c
@@ -690,8 +690,12 @@ static gboolean
visibility_notify_event (GtkWidget *text_view, GdkEventVisibility *event, GdauiCloud *cloud)
{
gint wx, wy, bx, by;
-
+
+#if GTK_CHECK_VERSION(2,18,0)
+ gdk_window_get_pointer (gtk_widget_get_window (text_view), &wx, &wy, NULL);
+#else
gdk_window_get_pointer (text_view->window, &wx, &wy, NULL);
+#endif
gtk_text_view_window_to_buffer_coords (GTK_TEXT_VIEW (text_view),
GTK_TEXT_WINDOW_WIDGET,
@@ -716,7 +720,11 @@ motion_notify_event (GtkWidget *text_view, GdkEventMotion *event, GdauiCloud *cl
set_cursor_if_appropriate (GTK_TEXT_VIEW (text_view), x, y, cloud);
+#if GTK_CHECK_VERSION(2,18,0)
+ gdk_window_get_pointer (gtk_widget_get_window (text_view), NULL, NULL, NULL);
+#else
gdk_window_get_pointer (text_view->window, NULL, NULL, NULL);
+#endif
return FALSE;
}
diff --git a/libgda-ui/gdaui-combo.c b/libgda-ui/gdaui-combo.c
index e1e14bf..384ce37 100644
--- a/libgda-ui/gdaui-combo.c
+++ b/libgda-ui/gdaui-combo.c
@@ -24,10 +24,9 @@
#include <string.h>
#include <glib/gi18n-lib.h>
-#include <gtk/gtkcelllayout.h>
+#include <gtk/gtk.h>
#include "gdaui-combo.h"
#include "gdaui-data-store.h"
-#include <gtk/gtk.h>
struct _GdauiComboPrivate {
GdaDataModel *model; /* proxied model (the one when _set_model() is called) */
@@ -42,13 +41,13 @@ static void gdaui_combo_class_init (GdauiComboClass *klass);
static void gdaui_combo_init (GdauiCombo *combo,
GdauiComboClass *klass);
static void gdaui_combo_set_property (GObject *object,
- guint paramid,
- const GValue *value,
- GParamSpec *pspec);
+ guint paramid,
+ const GValue *value,
+ GParamSpec *pspec);
static void gdaui_combo_get_property (GObject *object,
- guint param_id,
- GValue *value,
- GParamSpec *pspec);
+ guint param_id,
+ GValue *value,
+ GParamSpec *pspec);
static void gdaui_combo_dispose (GObject *object);
static void gdaui_combo_finalize (GObject *object);
diff --git a/libgda-ui/gdaui-data-store.h b/libgda-ui/gdaui-data-store.h
index 9c73aea..47184a3 100644
--- a/libgda-ui/gdaui-data-store.h
+++ b/libgda-ui/gdaui-data-store.h
@@ -21,7 +21,7 @@
#ifndef __GDAUI_DATA_STORE__
#define __GDAUI_DATA_STORE__
-#include <gtk/gtktreemodel.h>
+#include <gtk/gtk.h>
#include <libgda/gda-data-model.h>
#include <libgda/gda-data-proxy.h>
diff --git a/libgda-ui/gdaui-data-widget-filter.c b/libgda-ui/gdaui-data-widget-filter.c
index 1f2f8af..418a689 100644
--- a/libgda-ui/gdaui-data-widget-filter.c
+++ b/libgda-ui/gdaui-data-widget-filter.c
@@ -1,6 +1,6 @@
/* gdaui-data-widget-filter.c
*
- * Copyright (C) 2007 - 2008 Vivien Malerba
+ * Copyright (C) 2007 - 2009 Vivien Malerba
*
* This Library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public License as
@@ -118,7 +118,11 @@ set_wait_cursor (GtkWidget *w)
if (parent) {
GdkCursor* cursor;
cursor = gdk_cursor_new (GDK_WATCH);
+#if GTK_CHECK_VERSION(2,18,0)
+ gdk_window_set_cursor (gtk_widget_get_window (parent), cursor);
+#else
gdk_window_set_cursor (parent->window, cursor);
+#endif
gdk_cursor_destroy (cursor);
}
}
@@ -129,8 +133,12 @@ unset_wait_cursor (GtkWidget *w)
GtkWidget *parent;
parent = gtk_widget_get_toplevel (w);
- if (parent)
+ if (parent)
+#if GTK_CHECK_VERSION(2,18,0)
+ gdk_window_set_cursor (gtk_widget_get_window (parent), NULL);
+#else
gdk_window_set_cursor (parent->window, NULL);
+#endif
}
static void
diff --git a/libgda-ui/gdaui-data-widget.c b/libgda-ui/gdaui-data-widget.c
index 9318a29..bf319e1 100644
--- a/libgda-ui/gdaui-data-widget.c
+++ b/libgda-ui/gdaui-data-widget.c
@@ -406,7 +406,7 @@ gdaui_data_widget_set_data_layout_from_file (GdauiDataWidget *iface, const gchar
gchar *file = gda_gbr_get_file_path (GDA_DATA_DIR, LIBGDA_ABI_NAME, "dtd", "data-layout.dtd", NULL);
if (g_file_test (file, G_FILE_TEST_EXISTS))
- dtd = xmlParseDTD (NULL, file);
+ dtd = xmlParseDTD (NULL, BAD_CAST file);
if (dtd == NULL) {
g_warning (_("'%s' DTD not parsed successfully. "
"XML data layout validation will not be "
@@ -421,7 +421,7 @@ gdaui_data_widget_set_data_layout_from_file (GdauiDataWidget *iface, const gchar
/* Must have root element, a name and the name must be "data_layouts" */
if (!root_node ||
!root_node->name ||
- xmlStrcmp (root_node->name, "data_layouts")) {
+ xmlStrcmp (root_node->name, BAD_CAST "data_layouts")) {
xmlFreeDoc (doc);
return;
}
@@ -430,23 +430,23 @@ gdaui_data_widget_set_data_layout_from_file (GdauiDataWidget *iface, const gchar
for (node = root_node->children; node != NULL; node = node->next) {
if (node->type == XML_ELEMENT_NODE &&
- !xmlStrcmp (node->name, (const xmlChar *) "data_layout")) {
+ !xmlStrcmp (node->name, BAD_CAST "data_layout")) {
gboolean retval = FALSE;
xmlChar *str;
- str = xmlGetProp (node, "parent_table");
+ str = xmlGetProp (node, BAD_CAST "parent_table");
if (str) {
- if (strcmp (str, parent_table) == 0)
+ if (strcmp ((gchar*) str, parent_table) == 0)
retval = TRUE;
//g_print ("parent_table: %s\n", str);
xmlFree (str);
}
- str = xmlGetProp (node, "name");
+ str = xmlGetProp (node, BAD_CAST "name");
if (str) {
if (retval == TRUE &&
- ((GDAUI_IS_RAW_GRID (iface) && strcmp (str, "list") == 0) ||
- (GDAUI_IS_RAW_FORM (iface) &&strcmp (str, "details") == 0))) // Now proceed
+ ((GDAUI_IS_RAW_GRID (iface) && strcmp ((gchar*) str, "list") == 0) ||
+ (GDAUI_IS_RAW_FORM (iface) && strcmp ((gchar*) str, "details") == 0))) // Now proceed
(GDAUI_DATA_WIDGET_GET_IFACE (iface)->set_data_layout) (iface, node);
//g_print ("name: %s\n", str);
xmlFree (str);
diff --git a/libgda-ui/gdaui-init.c b/libgda-ui/gdaui-init.c
index 45cf083..3626e14 100644
--- a/libgda-ui/gdaui-init.c
+++ b/libgda-ui/gdaui-init.c
@@ -57,7 +57,6 @@ void
gdaui_init (void)
{
static gboolean initialized = FALSE;
- gchar *str;
if (initialized) {
gda_log_error (_("Attempt to initialize an already initialized library"));
@@ -65,6 +64,7 @@ gdaui_init (void)
}
/*
+ gchar *str;
gdaui_gbr_init ();
str = gdaui_gbr_get_locale_dir_path ();
bindtextdomain (GETTEXT_PACKAGE, str);
@@ -383,7 +383,7 @@ init_plugins_hash (void)
file = gda_gbr_get_file_path (GDA_DATA_DIR, LIBGDA_ABI_NAME, "ui", "gdaui-entry-number.xml", NULL);
xmlChar *xml_spec = get_spec_with_isocodes (file);
if (xml_spec) {
- plugin->options_xml_spec = g_strdup (xml_spec);
+ plugin->options_xml_spec = g_strdup ((gchar*) xml_spec);
xmlFree (xml_spec);
}
g_free (file);
@@ -590,12 +590,12 @@ find_child_node_from_name (xmlNodePtr parent, const gchar *name, const gchar *at
return NULL;
for (node = parent->children; node; node = node->next) {
- if (!strcmp (node->name, name)) {
+ if (!strcmp ((gchar*) node->name, name)) {
if (attr_name) {
xmlChar *prop;
- prop = xmlGetProp (node, attr_name);
+ prop = xmlGetProp (node, BAD_CAST attr_name);
if (prop) {
- if (attr_value && !strcmp (prop, attr_value)) {
+ if (attr_value && !strcmp ((gchar*) prop, attr_value)) {
xmlFree (prop);
break;
}
@@ -616,7 +616,7 @@ static xmlChar *
get_spec_with_isocodes (const gchar *file)
{
xmlDocPtr spec, isocodes = NULL;
- gchar *retval = NULL;
+ xmlChar *retval = NULL;
gchar *isofile = NULL;
GError *err = NULL;
gchar *buf = NULL;
@@ -657,20 +657,21 @@ get_spec_with_isocodes (const gchar *file)
spec_node = find_child_node_from_name (node, "gda_array_data", NULL, NULL);
xmlUnlinkNode (spec_node);
xmlFreeNode (spec_node);
- spec_node = xmlNewChild (node, NULL, "gda_array_data", NULL);
+ spec_node = xmlNewChild (node, NULL, BAD_CAST "gda_array_data", NULL);
node = xmlDocGetRootElement (isocodes);
for (node = node->children; node; node = node->next) {
- if (!strcmp (node->name, "iso_4217_entry")) {
+ if (!strcmp ((gchar*) node->name, "iso_4217_entry")) {
xmlChar *code, *name;
- code = xmlGetProp (node, "letter_code");
- name = xmlGetProp (node, "currency_name");
+ code = xmlGetProp (node, BAD_CAST "letter_code");
+ name = xmlGetProp (node, BAD_CAST "currency_name");
if (code && name) {
xmlNodePtr row;
- row = xmlNewChild (spec_node, NULL, "gda_array_row", NULL);
- xmlNewChild (row, NULL, "gda_value", code);
- xmlNewChild (row, NULL, "gda_value", code);
- xmlNewChild (row, NULL, "gda_value", dgettext ("iso_4217", name));
+ row = xmlNewChild (spec_node, NULL, BAD_CAST "gda_array_row", NULL);
+ xmlNewChild (row, NULL, BAD_CAST "gda_value", code);
+ xmlNewChild (row, NULL, BAD_CAST "gda_value", code);
+ xmlNewChild (row, NULL, BAD_CAST "gda_value",
+ BAD_CAST dgettext ("iso_4217", (gchar*) name));
}
if (code)
xmlFree (code);
@@ -691,7 +692,7 @@ get_spec_with_isocodes (const gchar *file)
node = find_child_node_from_name (xmlDocGetRootElement (spec), "parameters", NULL, NULL);
node = find_child_node_from_name (xmlDocGetRootElement (spec), "parameter", "id", "CURRENCY");
- xmlSetProp (node, "source", NULL);
+ xmlSetProp (node, BAD_CAST "source", NULL);
}
xmlDocDumpMemory (spec, (xmlChar **) &retval, &buf_len);
diff --git a/libgda-ui/gdaui-login.c b/libgda-ui/gdaui-login.c
index 86b98d1..9d6734a 100644
--- a/libgda-ui/gdaui-login.c
+++ b/libgda-ui/gdaui-login.c
@@ -30,9 +30,7 @@
#include <libgda-ui/internal/gdaui-provider-spec-editor.h>
#include <libgda-ui/internal/gdaui-provider-auth-editor.h>
#include "gdaui-enum-types.h"
-#include <gtk/gtklabel.h>
-#include <gtk/gtktable.h>
-#include <gtk/gtkstock.h>
+#include <gtk/gtk.h>
#include <string.h>
#include <libgda/binreloc/gda-binreloc.h>
@@ -390,7 +388,11 @@ run_cc_cb (GtkButton *button, GdauiLogin *login)
if (!sresult) {
GtkWidget *msgdialog;
GtkWidget *toplevel = gtk_widget_get_toplevel (GTK_WIDGET (login));
+#if GTK_CHECK_VERSION(2,18,0)
+ if (!gtk_widget_is_toplevel (toplevel))
+#else
if (!GTK_WIDGET_TOPLEVEL (toplevel))
+#endif
toplevel = NULL;
msgdialog = gtk_message_dialog_new_with_markup (GTK_WINDOW (toplevel), GTK_DIALOG_MODAL,
GTK_MESSAGE_ERROR, GTK_BUTTONS_OK,
diff --git a/libgda-ui/gdaui-login.h b/libgda-ui/gdaui-login.h
index a01a9db..dc38783 100644
--- a/libgda-ui/gdaui-login.h
+++ b/libgda-ui/gdaui-login.h
@@ -24,7 +24,7 @@
#ifndef __GDAUI_LOGIN_H__
#define __GDAUI_LOGIN_H__
-#include <gtk/gtkvbox.h>
+#include <gtk/gtk.h>
G_BEGIN_DECLS
diff --git a/libgda-ui/gdaui-plugin.h b/libgda-ui/gdaui-plugin.h
index 218c98e..c5bce00 100644
--- a/libgda-ui/gdaui-plugin.h
+++ b/libgda-ui/gdaui-plugin.h
@@ -21,7 +21,7 @@
#ifndef __GDAUI_PLUGIN__
#define __GDAUI_PLUGIN__
-#include <gtk/gtkcellrenderer.h>
+#include <gtk/gtk.h>
#include <libgda/gda-value.h>
#include "gdaui-decl.h"
diff --git a/libgda-ui/gdaui-raw-form.c b/libgda-ui/gdaui-raw-form.c
index 4a66deb..199134b 100644
--- a/libgda-ui/gdaui-raw-form.c
+++ b/libgda-ui/gdaui-raw-form.c
@@ -737,12 +737,18 @@ filter_position_func (GtkWidget *widget,
gint x, y;
gint tree_x, tree_y;
gint tree_width, tree_height;
- GdkWindow *window = GTK_WIDGET (widget)->window;
- GdkScreen *screen = gdk_drawable_get_screen (window);
+ GdkWindow *window;
+ GdkScreen *screen;
GtkRequisition requisition;
gint monitor_num;
GdkRectangle monitor;
+#if GTK_CHECK_VERSION(2,18,0)
+ window = gtk_widget_get_window (widget);
+#else
+ window = widget->window;
+#endif
+ screen = gdk_drawable_get_screen (window);
monitor_num = gdk_screen_get_monitor_at_window (screen, window);
gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor);
@@ -806,9 +812,15 @@ action_filter_cb (GtkAction *action, GdauiRawForm *form)
gtk_widget_set_events (form->priv->filter_window,
gtk_widget_get_events (form->priv->filter_window) | GDK_KEY_PRESS_MASK);
+#if GTK_CHECK_VERSION(2,18,0)
+ if (gtk_widget_is_toplevel (toplevel) && gtk_window_get_group ((GtkWindow*) toplevel))
+ gtk_window_group_add_window (gtk_window_get_group ((GtkWindow*) toplevel),
+ GTK_WINDOW (form->priv->filter_window));
+#else
if (GTK_WIDGET_TOPLEVEL (toplevel) && GTK_WINDOW (toplevel)->group)
gtk_window_group_add_window (GTK_WINDOW (toplevel)->group,
GTK_WINDOW (form->priv->filter_window));
+#endif
g_signal_connect (form->priv->filter_window, "delete_event",
G_CALLBACK (filter_event), form);
@@ -833,6 +845,16 @@ action_filter_cb (GtkAction *action, GdauiRawForm *form)
}
gtk_container_add (GTK_CONTAINER (vbox), form->priv->filter);
}
+#if GTK_CHECK_VERSION(2,18,0)
+ else if (gtk_widget_is_toplevel (toplevel)) {
+ if (gtk_window_get_group ((GtkWindow*) toplevel))
+ gtk_window_group_add_window (gtk_window_get_group ((GtkWindow*) toplevel),
+ GTK_WINDOW (form->priv->filter_window));
+ else if (gtk_window_get_group ((GtkWindow*) form->priv->filter_window))
+ gtk_window_group_remove_window (gtk_window_get_group ((GtkWindow*) form->priv->filter_window),
+ GTK_WINDOW (form->priv->filter_window));
+ }
+#else
else if (GTK_WIDGET_TOPLEVEL (toplevel)) {
if (GTK_WINDOW (toplevel)->group)
gtk_window_group_add_window (GTK_WINDOW (toplevel)->group,
@@ -841,14 +863,20 @@ action_filter_cb (GtkAction *action, GdauiRawForm *form)
gtk_window_group_remove_window (GTK_WINDOW (form->priv->filter_window)->group,
GTK_WINDOW (form->priv->filter_window));
}
+#endif
/* move the filter window to a correct location */
/* FIXME: let the user specify the position function like GtkTreeView -> search_position_func() */
gtk_grab_add (form->priv->filter_window);
filter_position_func (GTK_WIDGET (form), form->priv->filter_window, NULL);
gtk_widget_show (form->priv->filter_window);
+#if GTK_CHECK_VERSION(2,18,0)
+ popup_grab_on_window (gtk_widget_get_window (form->priv->filter_window),
+ gtk_get_current_event_time ());
+#else
popup_grab_on_window (form->priv->filter_window->window,
gtk_get_current_event_time ());
+#endif
}
diff --git a/libgda-ui/gdaui-raw-grid.c b/libgda-ui/gdaui-raw-grid.c
index bec6fcf..da05234 100644
--- a/libgda-ui/gdaui-raw-grid.c
+++ b/libgda-ui/gdaui-raw-grid.c
@@ -385,10 +385,10 @@ load_xml_data_layout_item (GdauiRawGrid *grid,
gboolean sort_ascending = FALSE;
xmlChar *str;
- str = xmlGetProp (node, "name");
+ str = xmlGetProp (node, BAD_CAST "name");
if (str) {
- name = g_strdup (str);
- g_print ("name: %s\n", str);
+ name = g_strdup ((gchar*) str);
+ g_print ("name: %s\n", (gchar*) str);
xmlFree (str);
}
@@ -404,24 +404,24 @@ load_xml_data_layout_item (GdauiRawGrid *grid,
/* xmlFree (str); */
/* } */
- str = xmlGetProp (node, "sequence");
+ str = xmlGetProp (node, BAD_CAST "sequence");
if (str) {
- sequence = atoi (str);
- g_print ("sequence: %s\n", str);
+ sequence = atoi ((gchar*) str);
+ g_print ("sequence: %s\n", (gchar*) str);
xmlFree (str);
}
- str = xmlGetProp (node, "editable");
+ str = xmlGetProp (node, BAD_CAST "editable");
if (str) {
editable = (*str == 't' || *str == 'T') ? TRUE : FALSE;
- g_print ("editable: %s\n", str);
+ g_print ("editable: %s\n", (gchar*) str);
xmlFree (str);
}
- str = xmlGetProp (node, "sort_ascending");
+ str = xmlGetProp (node, BAD_CAST "sort_ascending");
if (str) {
sort_ascending = (*str == 't' || *str == 'T') ? TRUE : FALSE;
- g_print ("sort_ascending: %s\n", str);
+ g_print ("sort_ascending: %s\n", (gchar*) str);
xmlFree (str);
}
@@ -495,31 +495,31 @@ load_xml_data_layout_group (GdauiRawGrid *grid,
gchar *title = NULL;
xmlChar *str;
- str = xmlGetProp (node, "name");
+ str = xmlGetProp (node, BAD_CAST "name");
if (str) {
- name = g_strdup (str);
- g_print ("name: %s\n", str);
+ name = g_strdup ((gchar*) str);
+ g_print ("name: %s\n", (gchar*) str);
xmlFree (str);
}
- str = xmlGetProp (node, "sequence");
+ str = xmlGetProp (node, BAD_CAST "sequence");
if (str) {
- sequence = atoi (str);
- g_print ("sequence: %s\n", str);
+ sequence = atoi ((gchar*) str);
+ g_print ("sequence: %s\n", (gchar*) str);
xmlFree (str);
}
- str = xmlGetProp (node, "columns_count");
+ str = xmlGetProp (node, BAD_CAST "columns_count");
if (str) {
- columns_count = atoi (str);
- g_print ("columns_count: %s\n", str);
+ columns_count = atoi ((gchar*) str);
+ g_print ("columns_count: %s\n", (gchar*) str);
xmlFree (str);
}
- str = xmlGetProp (node, "title");
+ str = xmlGetProp (node, BAD_CAST "title");
if (str) {
- title = g_strdup (str);
- g_print ("title: %s\n", str);
+ title = g_strdup ((gchar*) str);
+ g_print ("title: %s\n", (gchar*) str);
xmlFree (str);
}
@@ -527,37 +527,37 @@ load_xml_data_layout_group (GdauiRawGrid *grid,
for (child = node->children; child != NULL; child = child->next) {
if (child->type == XML_ELEMENT_NODE &&
- !xmlStrcmp (child->name, (const xmlChar *) "data_layout_group")) {
+ !xmlStrcmp (child->name, BAD_CAST "data_layout_group")) {
load_xml_data_layout_group (grid, child, data);
}
if (child->type == XML_ELEMENT_NODE &&
- !xmlStrcmp (child->name, (const xmlChar *) "data_layout_item")) {
+ !xmlStrcmp (child->name, BAD_CAST "data_layout_item")) {
load_xml_data_layout_item (grid, child, /* data *//* table */ title);
}
if (child->type == XML_ELEMENT_NODE &&
- !xmlStrcmp (child->name, (const xmlChar *) "data_layout_portal")) {
+ !xmlStrcmp (child->name, BAD_CAST "data_layout_portal")) {
}
if (child->type == XML_ELEMENT_NODE &&
- !xmlStrcmp (child->name, (const xmlChar *) "data_layout_notebook")) {
+ !xmlStrcmp (child->name, BAD_CAST "data_layout_notebook")) {
}
if (child->type == XML_ELEMENT_NODE &&
- !xmlStrcmp (child->name, (const xmlChar *) "trans_set")) {
+ !xmlStrcmp (child->name, BAD_CAST "trans_set")) {
/* load_xml_trans_set (grid, child, data); */
}
if (child->type == XML_ELEMENT_NODE &&
- !xmlStrcmp (child->name, (const xmlChar *) "data_layout_button")) {
+ !xmlStrcmp (child->name, BAD_CAST "data_layout_button")) {
}
if (child->type == XML_ELEMENT_NODE &&
- !xmlStrcmp (child->name, (const xmlChar *) "data_layout_item_groupby")) {
+ !xmlStrcmp (child->name, BAD_CAST "data_layout_item_groupby")) {
}
if (child->type == XML_ELEMENT_NODE &&
- !xmlStrcmp (child->name, (const xmlChar *) "data_layout_item_header")) {
+ !xmlStrcmp (child->name, BAD_CAST "data_layout_item_header")) {
}
}
@@ -577,7 +577,7 @@ load_xml_data_layout_groups (GdauiRawGrid *grid,
for (child = node->children; child != NULL; child = child->next) {
if (child->type == XML_ELEMENT_NODE &&
- !xmlStrcmp (child->name, (const xmlChar *) "data_layout_group")) {
+ !xmlStrcmp (child->name, BAD_CAST "data_layout_group")) {
load_xml_data_layout_group (grid, child, /* data */ NULL);
}
}
@@ -596,17 +596,17 @@ load_xml_data_layout (GdauiRawGrid *grid,
gchar *name = NULL;
xmlChar *str;
- str = xmlGetProp (node, "parent_table");
+ str = xmlGetProp (node, BAD_CAST "parent_table");
if (str) {
- parent_table = g_strdup (str);
- g_print ("parent_table: %s\n", str);
+ parent_table = g_strdup ((gchar*) str);
+ g_print ("parent_table: %s\n", (gchar*) str);
xmlFree (str);
}
- str = xmlGetProp (node, "name");
+ str = xmlGetProp (node, BAD_CAST "name");
if (str) {
- name = g_strdup (str);
- g_print ("name: %s\n", str);
+ name = g_strdup ((gchar*) str);
+ g_print ("name: %s\n", (gchar*) str);
xmlFree (str);
}
@@ -625,7 +625,7 @@ load_xml_data_layout (GdauiRawGrid *grid,
for (child = node->children; child != NULL; child = child->next) {
if (child->type == XML_ELEMENT_NODE &&
- !xmlStrcmp (child->name, (const xmlChar *) "data_layout_groups")) {
+ !xmlStrcmp (child->name, BAD_CAST "data_layout_groups")) {
load_xml_data_layout_groups (grid, child, data);
}
}
@@ -644,7 +644,7 @@ load_xml_data_layouts (GdauiRawGrid *grid,
for (child = node->children; child != NULL; child = child->next) {
if (child->type == XML_ELEMENT_NODE &&
- !xmlStrcmp (child->name, (const xmlChar *) "data_layout")) {
+ !xmlStrcmp (child->name, BAD_CAST "data_layout")) {
load_xml_data_layout (grid, child, data);
}
@@ -672,16 +672,16 @@ gdaui_raw_grid_query_tooltip (GtkWidget *widget,
GList *list, *columns = gtk_tree_view_get_columns (tree_view);
for (list = columns; list; list = list->next) {
GtkTreeViewColumn *column = list->data;
- if (x >= col_x && x < (col_x + column->width)) {
+ if (x >= col_x && x < (col_x + gtk_tree_view_column_get_width (column))) {
break;
} else
- col_x += column->width;
+ col_x += gtk_tree_view_column_get_width (column);
++position;
}
if (list == NULL)
return FALSE;
- GdauiRawGrid *grid = GDAUI_RAW_GRID(tree_view);
+ GdauiRawGrid *grid = GDAUI_RAW_GRID (tree_view);
ColumnData *column_data = (ColumnData *) (g_slist_nth (grid->priv->columns_data, position)->data);
g_return_val_if_fail (column_data, FALSE);
@@ -839,7 +839,7 @@ gdaui_raw_grid_set_property (GObject *object,
for (child = node->children; child != NULL; child = child->next) {
if (child->type == XML_ELEMENT_NODE &&
- !xmlStrcmp (child->name, (const xmlChar *) "data_layout_groups")) {
+ !xmlStrcmp (child->name, BAD_CAST "data_layout_groups")) {
load_xml_data_layout_groups (grid, child, NULL);
}
}
@@ -1730,12 +1730,19 @@ filter_position_func (GtkWidget *widget,
gint x, y;
gint tree_x, tree_y;
gint tree_width, tree_height;
- GdkWindow *window = GTK_WIDGET (widget)->window;
- GdkScreen *screen = gdk_drawable_get_screen (window);
+ GdkWindow *window;
+ GdkScreen *screen;
GtkRequisition requisition;
gint monitor_num;
GdkRectangle monitor;
+#if GTK_CHECK_VERSION(2,18,0)
+ window = gtk_widget_get_window (widget);
+#else
+ window = widget->window;
+#endif
+ screen = gdk_drawable_get_screen (window);
+
monitor_num = gdk_screen_get_monitor_at_window (screen, window);
gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor);
@@ -1799,9 +1806,15 @@ action_filter_cb (GtkAction *action, GdauiRawGrid *grid)
gtk_widget_set_events (grid->priv->filter_window,
gtk_widget_get_events (grid->priv->filter_window) | GDK_KEY_PRESS_MASK);
+#if GTK_CHECK_VERSION(2,18,0)
+ if (gtk_widget_is_toplevel (toplevel) && gtk_window_get_group (GTK_WINDOW (toplevel)))
+ gtk_window_group_add_window (gtk_window_get_group (GTK_WINDOW (toplevel)),
+ GTK_WINDOW (grid->priv->filter_window));
+#else
if (GTK_WIDGET_TOPLEVEL (toplevel) && GTK_WINDOW (toplevel)->group)
gtk_window_group_add_window (GTK_WINDOW (toplevel)->group,
GTK_WINDOW (grid->priv->filter_window));
+#endif
g_signal_connect (grid->priv->filter_window, "delete_event",
G_CALLBACK (filter_event), grid);
@@ -1826,6 +1839,16 @@ action_filter_cb (GtkAction *action, GdauiRawGrid *grid)
}
gtk_container_add (GTK_CONTAINER (vbox), grid->priv->filter);
}
+#if GTK_CHECK_VERSION(2,18,0)
+ else if (gtk_widget_is_toplevel (toplevel)) {
+ if (gtk_window_get_group ((GtkWindow*) toplevel))
+ gtk_window_group_add_window (gtk_window_get_group ((GtkWindow*) toplevel),
+ GTK_WINDOW (grid->priv->filter_window));
+ else if (gtk_window_get_group (GTK_WINDOW (grid->priv->filter_window)))
+ gtk_window_group_remove_window (gtk_window_get_group (GTK_WINDOW (grid->priv->filter_window)),
+ GTK_WINDOW (grid->priv->filter_window));
+ }
+#else
else if (GTK_WIDGET_TOPLEVEL (toplevel)) {
if (GTK_WINDOW (toplevel)->group)
gtk_window_group_add_window (GTK_WINDOW (toplevel)->group,
@@ -1834,13 +1857,18 @@ action_filter_cb (GtkAction *action, GdauiRawGrid *grid)
gtk_window_group_remove_window (GTK_WINDOW (grid->priv->filter_window)->group,
GTK_WINDOW (grid->priv->filter_window));
}
+#endif
/* move the filter window to a correct location */
/* FIXME: let the user specify the position function like GtkTreeView -> search_position_func() */
gtk_grab_add (grid->priv->filter_window);
filter_position_func (GTK_WIDGET (grid), grid->priv->filter_window, NULL);
gtk_widget_show (grid->priv->filter_window);
+#if GTK_CHECK_VERSION(2,18,0)
+ popup_grab_on_window (gtk_widget_get_window (grid->priv->filter_window),
+#else
popup_grab_on_window (grid->priv->filter_window->window,
+#endif
gtk_get_current_event_time ());
}
@@ -1861,7 +1889,7 @@ tree_view_event_cb (GtkWidget *treeview, GdkEvent *event, GdauiRawGrid *grid)
GtkTreeViewColumn *column;
GtkTreePath *path;
- /* FIXME: if a column is currently edited, then make sure the editing of that cell is not cancelled */
+ /* FIXME: if a column is currently edited, then make sure the editing of that cell is not canceled */
gtk_tree_view_get_cursor (GTK_TREE_VIEW (treeview), &path, &column);
if (column && path) {
GList *columns = gtk_tree_view_get_columns (GTK_TREE_VIEW (treeview));
@@ -2062,7 +2090,7 @@ menu_save_as_cb (GtkWidget *widget, GdauiRawGrid *grid)
GtkWidget *label;
GtkWidget *filename;
GtkWidget *types;
- GtkWidget *hbox, *table, *check;
+ GtkWidget *hbox, *table, *check, *dbox;
char *str;
GtkTreeSelection *sel;
gint selrows;
@@ -2084,17 +2112,23 @@ menu_save_as_cb (GtkWidget *widget, GdauiRawGrid *grid)
gtk_misc_set_alignment (GTK_MISC (label), 0., -1);
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
g_free (str);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), label, FALSE, TRUE, 2);
+
+#if GTK_CHECK_VERSION(2,18,0)
+ dbox = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
+#else
+ dbox = GTK_DIALOG (dialog)->vbox;
+#endif
+ gtk_box_pack_start (GTK_BOX (dbox), label, FALSE, TRUE, 2);
str = g_strdup_printf ("<b>%s:</b>", _("File name"));
label = gtk_label_new ("");
gtk_label_set_markup (GTK_LABEL (label), str);
gtk_misc_set_alignment (GTK_MISC (label), 0., -1);
g_free (str);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), label, FALSE, TRUE, 2);
+ gtk_box_pack_start (GTK_BOX (dbox), label, FALSE, TRUE, 2);
hbox = gtk_hbox_new (FALSE, 0); /* HIG */
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox, FALSE, FALSE, 5);
+ gtk_box_pack_start (GTK_BOX (dbox), hbox, FALSE, FALSE, 5);
gtk_widget_show (hbox);
label = gtk_label_new (" ");
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
@@ -2109,10 +2143,10 @@ menu_save_as_cb (GtkWidget *widget, GdauiRawGrid *grid)
gtk_label_set_markup (GTK_LABEL (label), str);
gtk_misc_set_alignment (GTK_MISC (label), 0., -1);
g_free (str);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), label, FALSE, TRUE, 2);
+ gtk_box_pack_start (GTK_BOX (dbox), label, FALSE, TRUE, 2);
hbox = gtk_hbox_new (FALSE, 0); /* HIG */
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox, FALSE, FALSE, 5);
+ gtk_box_pack_start (GTK_BOX (dbox), hbox, FALSE, FALSE, 5);
gtk_widget_show (hbox);
label = gtk_label_new (" ");
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
@@ -2323,9 +2357,13 @@ confirm_file_overwrite (GtkWindow *parent, const gchar *path)
GTK_DIALOG_MODAL, GTK_MESSAGE_QUESTION,
GTK_BUTTONS_CLOSE, "%s", str);
g_free (str);
-
+
button = gtk_button_new_from_stock (GTK_STOCK_CANCEL);
+#if GTK_CHECK_VERSION(2,18,0)
+ gtk_widget_set_can_default (button, TRUE);
+#else
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+#endif
gtk_dialog_add_action_widget (GTK_DIALOG (dialog),
button,
GTK_RESPONSE_NO);
diff --git a/libgda-ui/gdaui-server-operation.c b/libgda-ui/gdaui-server-operation.c
index aa901d1..084a8c8 100644
--- a/libgda-ui/gdaui-server-operation.c
+++ b/libgda-ui/gdaui-server-operation.c
@@ -900,7 +900,7 @@ static void
sequence_item_added_cb (GdaServerOperation *op, const gchar *seq_path, gint item_index, GdauiServerOperation *form)
{
GtkWidget *table;
- GList *list, *to_move = NULL;
+ GList *children, *list, *to_move = NULL;
GtkWidget *wid;
gchar *str;
WidgetData *wd;
@@ -914,13 +914,13 @@ sequence_item_added_cb (GdaServerOperation *op, const gchar *seq_path, gint item
g_assert (wd);
table = wd->widget;
g_assert (table);
- list = GTK_TABLE (table)->children;
/* resize table */
gtk_table_resize (GTK_TABLE (table), size+1, 2);
/* move children DOWN if necessary */
- while (list) {
+ children = gtk_container_get_children (GTK_CONTAINER (table));
+ for (list = children; list; list = list->next) {
GtkTableChild *tc = (GtkTableChild *) (list->data);
if (tc->widget) {
@@ -948,11 +948,11 @@ sequence_item_added_cb (GdaServerOperation *op, const gchar *seq_path, gint item
GINT_TO_POINTER (index + 1));
}
}
- list = list->next;
}
+ g_list_free (children);
- list = to_move;
- while (list) {
+
+ for (list = to_move; list; list = list->next) {
struct MoveChild *mc;
mc = (struct MoveChild *) (list->data);
@@ -960,7 +960,6 @@ sequence_item_added_cb (GdaServerOperation *op, const gchar *seq_path, gint item
"top-attach", mc->top_attach,
"bottom-attach", mc->top_attach + 1, NULL);
g_free (list->data);
- list = list->next;
}
g_list_free (to_move);
@@ -978,7 +977,7 @@ static void
sequence_item_remove_cb (GdaServerOperation *op, const gchar *seq_path, gint item_index, GdauiServerOperation *form)
{
GtkWidget *table;
- GList *list, *to_move = NULL;
+ GList *children, *list, *to_move = NULL;
gchar *str;
WidgetData *wds, *wdi;
guint min, size;
@@ -1003,21 +1002,24 @@ sequence_item_remove_cb (GdaServerOperation *op, const gchar *seq_path, gint ite
widget_data_free (wdi);
/* remove the widget associated to the sequence item */
- list = GTK_TABLE (table)->children;
- while (list) {
+ children = gtk_container_get_children (GTK_CONTAINER (table));
+ for (list = children; list; ) {
GtkTableChild *tc = (GtkTableChild *) (list->data);
if (tc->widget && (tc->top_attach == item_index)) {
gtk_widget_destroy (tc->widget);
- list = GTK_TABLE (table)->children;
+ g_list_free (children);
+ children = gtk_container_get_children (GTK_CONTAINER (table));
+ list = children;
}
else
list = list->next;
}
+ g_list_free (children);
/* move children UP if necessary */
- list = GTK_TABLE (table)->children;
- while (list) {
+ children = gtk_container_get_children (GTK_CONTAINER (table));
+ for (list = children; list; list = list->next) {
GtkTableChild *tc = (GtkTableChild *) (list->data);
if (tc->widget) {
@@ -1045,12 +1047,10 @@ sequence_item_remove_cb (GdaServerOperation *op, const gchar *seq_path, gint ite
GINT_TO_POINTER (index - 1));
}
}
-
- list = list->next;
}
+ g_list_free (children);
- list = to_move;
- while (list) {
+ for (list = to_move; list; list = list->next) {
struct MoveChild *mc;
mc = (struct MoveChild *) (list->data);
@@ -1058,7 +1058,6 @@ sequence_item_remove_cb (GdaServerOperation *op, const gchar *seq_path, gint ite
"top-attach", mc->top_attach,
"bottom-attach", mc->top_attach + 1, NULL);
g_free (list->data);
- list = list->next;
}
g_list_free (to_move);
@@ -1089,6 +1088,7 @@ gdaui_server_operation_new_in_dialog (GdaServerOperation *op, GtkWindow *parent,
{
GtkWidget *form;
GtkWidget *dlg;
+ GtkWidget *dcontents;
const gchar *rtitle;
form = gdaui_server_operation_new (op);
@@ -1104,18 +1104,24 @@ gdaui_server_operation_new_in_dialog (GdaServerOperation *op, GtkWindow *parent,
GTK_STOCK_CANCEL,
GTK_RESPONSE_REJECT,
NULL);
+#if GTK_CHECK_VERSION(2,18,0)
+ dcontents = gtk_dialog_get_content_area (GTK_DIALOG (dlg));
+#else
+ dcontents = GTK_DIALOG (dlg)->vbox;
+#endif
+
if (header && *header) {
GtkWidget *label;
label = gtk_label_new (NULL);
gtk_misc_set_alignment (GTK_MISC (label), 0, 0);
gtk_label_set_markup (GTK_LABEL (label), header);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), label, FALSE, FALSE, 5);
+ gtk_box_pack_start (GTK_BOX (dcontents), label, FALSE, FALSE, 5);
+
gtk_widget_show (label);
}
-
- gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dlg)->vbox), 4);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), form, TRUE, TRUE, 10);
+ gtk_container_set_border_width (GTK_CONTAINER (dcontents), 4);
+ gtk_box_pack_start (GTK_BOX (dcontents), form, TRUE, TRUE, 10);
gtk_widget_show_all (form);
diff --git a/libgda-ui/internal/gdaui-dsn-selector.c b/libgda-ui/internal/gdaui-dsn-selector.c
index beab50c..ba506a2 100644
--- a/libgda-ui/internal/gdaui-dsn-selector.c
+++ b/libgda-ui/internal/gdaui-dsn-selector.c
@@ -25,11 +25,10 @@
#include <string.h>
#include <libgda/gda-config.h>
#include "gdaui-dsn-selector.h"
-#include <gtk/gtkcelllayout.h>
-#include <gtk/gtkcellrenderer.h>
-#include <gtk/gtkcellrenderertext.h>
+#include <gtk/gtk.h>
struct _GdauiDsnSelectorPrivate {
+ gchar dummy;
};
static void gdaui_dsn_selector_class_init (GdauiDsnSelectorClass *klass);
diff --git a/libgda-ui/internal/gdaui-provider-auth-editor.c b/libgda-ui/internal/gdaui-provider-auth-editor.c
index 2cfc7cc..12018e7 100644
--- a/libgda-ui/internal/gdaui-provider-auth-editor.c
+++ b/libgda-ui/internal/gdaui-provider-auth-editor.c
@@ -21,8 +21,6 @@
*/
#include <string.h>
-#include <gtk/gtklabel.h>
-#include <gtk/gtktable.h>
#include <libgda/libgda.h>
#include "gdaui-provider-auth-editor.h"
#include <libgda-ui/gdaui-basic-form.h>
diff --git a/libgda-ui/internal/gdaui-provider-auth-editor.h b/libgda-ui/internal/gdaui-provider-auth-editor.h
index b5617f5..532de8b 100644
--- a/libgda-ui/internal/gdaui-provider-auth-editor.h
+++ b/libgda-ui/internal/gdaui-provider-auth-editor.h
@@ -23,7 +23,7 @@
#ifndef __GDAUI_PROVIDER_AUTH_EDITOR_H__
#define __GDAUI_PROVIDER_AUTH_EDITOR_H__
-#include <gtk/gtkvbox.h>
+#include <gtk/gtk.h>
G_BEGIN_DECLS
diff --git a/libgda-ui/internal/gdaui-provider-spec-editor.c b/libgda-ui/internal/gdaui-provider-spec-editor.c
index 8c55deb..13f36c4 100644
--- a/libgda-ui/internal/gdaui-provider-spec-editor.c
+++ b/libgda-ui/internal/gdaui-provider-spec-editor.c
@@ -21,8 +21,6 @@
*/
#include <string.h>
-#include <gtk/gtklabel.h>
-#include <gtk/gtktable.h>
#include <libgda/libgda.h>
#include "gdaui-provider-spec-editor.h"
#include <libgda-ui/gdaui-basic-form.h>
diff --git a/libgda-ui/internal/gdaui-provider-spec-editor.h b/libgda-ui/internal/gdaui-provider-spec-editor.h
index cc41512..a5d1e68 100644
--- a/libgda-ui/internal/gdaui-provider-spec-editor.h
+++ b/libgda-ui/internal/gdaui-provider-spec-editor.h
@@ -23,7 +23,7 @@
#ifndef __GDAUI_PROVIDER_SPEC_EDITOR_H__
#define __GDAUI_PROVIDER_SPEC_EDITOR_H__
-#include <gtk/gtkvbox.h>
+#include <gtk/gtk.h>
G_BEGIN_DECLS
diff --git a/libgda-ui/internal/popup-container.c b/libgda-ui/internal/popup-container.c
index c072512..013c8df 100644
--- a/libgda-ui/internal/popup-container.c
+++ b/libgda-ui/internal/popup-container.c
@@ -93,7 +93,7 @@ button_press_popup (GtkWidget *widget, GdkEventButton *event, PopupContainer *co
while (child) {
if (child == widget)
return FALSE;
- child = child->parent;
+ child = gtk_widget_get_parent (child);
}
}
gtk_widget_hide (GTK_WIDGET (container));
@@ -215,8 +215,13 @@ popup_container_show (GtkWidget *widget)
if (do_move)
gtk_window_move (GTK_WINDOW (widget), root_x, root_y);
+#if GTK_CHECK_VERSION(2,18,0)
+ popup_grab_on_window (gtk_widget_get_window (widget),
+ gtk_get_current_event_time ());
+#else
popup_grab_on_window (widget->window,
gtk_get_current_event_time ());
+#endif
}
static void
@@ -265,11 +270,20 @@ popup_position (PopupContainer *container, gint *out_x, gint *out_y)
gtk_widget_size_request (poswidget, &req);
+#if GTK_CHECK_VERSION(2,18,0)
+ GtkAllocation alloc;
+ gdk_window_get_origin (gtk_widget_get_window (poswidget), &x, &y);
+ gtk_widget_get_allocation (poswidget, &alloc);
+ x += alloc.x;
+ y += alloc.y;
+ y += alloc.height;
+#else
gdk_window_get_origin (poswidget->window, &x, &y);
x += poswidget->allocation.x;
y += poswidget->allocation.y;
y += poswidget->allocation.height;
+#endif
if (x < 0)
x = 0;
diff --git a/libgda-ui/internal/popup-container.h b/libgda-ui/internal/popup-container.h
index 836225b..ecac9b6 100644
--- a/libgda-ui/internal/popup-container.h
+++ b/libgda-ui/internal/popup-container.h
@@ -23,7 +23,7 @@
#ifndef __POPUP_CONTAINER_H__
#define __POPUP_CONTAINER_H__
-#include <gtk/gtkwindow.h>
+#include <gtk/gtk.h>
G_BEGIN_DECLS
diff --git a/libgda-ui/internal/utility.c b/libgda-ui/internal/utility.c
index 5334aad..097ad63 100644
--- a/libgda-ui/internal/utility.c
+++ b/libgda-ui/internal/utility.c
@@ -439,7 +439,12 @@ create_data_error_dialog (GdauiDataWidget *form, gboolean with_question, gboolea
gtk_container_add (GTK_CONTAINER (sw), view);
gtk_container_add (GTK_CONTAINER (exp), sw);
+#if GTK_CHECK_VERSION(2,18,0)
+ gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dlg))),
+ exp, TRUE, TRUE, 0);
+#else
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), exp, TRUE, TRUE, 0);
+#endif
gtk_widget_show_all (exp);
gtk_window_set_resizable (GTK_WINDOW (dlg), TRUE);
diff --git a/po/POTFILES.in b/po/POTFILES.in
index f6f9361..0491e60 100755
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -112,6 +112,7 @@ libgda-ui/internal/gdaui-provider-auth-editor.c
libgda-ui/internal/gdaui-provider-spec-editor.c
libgda-ui/internal/utility.c
libgda-ui/gdaui-basic-form.c
+libgda-ui/gdaui-cloud.c
libgda-ui/gdaui-combo.c
libgda-ui/gdaui-data-store.c
libgda-ui/gdaui-data-widget.c
diff --git a/providers/mdb/gda-mdb-provider.c b/providers/mdb/gda-mdb-provider.c
index 78450ad..6341b51 100644
--- a/providers/mdb/gda-mdb-provider.c
+++ b/providers/mdb/gda-mdb-provider.c
@@ -22,7 +22,7 @@
*/
#include <stdlib.h>
-#include <glib/gbacktrace.h>
+#include <glib.h>
#include <virtual/gda-vconnection-data-model.h>
#include <libgda/gda-connection-private.h>
#include <libgda/gda-server-provider-extra.h>
diff --git a/tools/browser/auth-dialog.c b/tools/browser/auth-dialog.c
index cf10aaa..1e7eee0 100644
--- a/tools/browser/auth-dialog.c
+++ b/tools/browser/auth-dialog.c
@@ -134,6 +134,7 @@ auth_dialog_init (AuthDialog *dialog)
{
GtkWidget *label, *hbox, *wid;
char *markup, *str;
+ GtkWidget *dcontents;
dialog->priv = g_new0 (AuthDialogPrivate, 1);
@@ -143,7 +144,12 @@ auth_dialog_init (AuthDialog *dialog)
GTK_STOCK_CANCEL,
GTK_RESPONSE_REJECT, NULL);
- gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox), 5);
+#if GTK_CHECK_VERSION(2,18,0)
+ dcontents = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
+#else
+ dcontents = GTK_DIALOG (dialog)->vbox;
+#endif
+ gtk_box_set_spacing (GTK_BOX (dcontents), 5);
gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), GTK_RESPONSE_ACCEPT, TRUE);
str = gda_gbr_get_file_path (GDA_DATA_DIR, LIBGDA_ABI_NAME, "pixmaps", "gda-browser-auth.png", NULL);
@@ -153,7 +159,7 @@ auth_dialog_init (AuthDialog *dialog)
/* label and spinner */
hbox = gtk_hbox_new (FALSE, 0);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 10);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (dcontents), hbox, FALSE, FALSE, 0);
str = gda_gbr_get_file_path (GDA_DATA_DIR, LIBGDA_ABI_NAME, "pixmaps", "gda-browser-auth-big.png", NULL);
wid = gtk_image_new_from_file (str);
@@ -397,6 +403,13 @@ auth_dialog_add_cnc_string (AuthDialog *dialog, const gchar *cnc_string, GError
/* add widget */
GtkWidget *hbox, *label;
gchar *str;
+ GtkWidget *dcontents;
+
+#if GTK_CHECK_VERSION(2,18,0)
+ dcontents = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
+#else
+ dcontents = GTK_DIALOG (dialog)->vbox;
+#endif
label = gtk_label_new ("");
str = g_strdup_printf ("<b>%s: %s</b>\n%s", _("For connection"), ad->ext.cnc_string,
@@ -404,11 +417,11 @@ auth_dialog_add_cnc_string (AuthDialog *dialog, const gchar *cnc_string, GError
gtk_label_set_markup (GTK_LABEL (label), str);
gtk_misc_set_alignment (GTK_MISC (label), 0., -1);
g_free (str);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), label, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (dcontents), label, FALSE, FALSE, 0);
gtk_widget_show (label);
hbox = gtk_hbox_new (FALSE, 0); /* HIG */
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (dcontents), hbox, TRUE, TRUE, 0);
label = gtk_label_new (" ");
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox), ad->auth_widget, TRUE, TRUE, 0);
diff --git a/tools/browser/browser-spinner.c b/tools/browser/browser-spinner.c
index d25fa5e..9504ba6 100644
--- a/tools/browser/browser-spinner.c
+++ b/tools/browser/browser-spinner.c
@@ -24,10 +24,17 @@
* $Id$
*/
-#include "browser-spinner.h"
-
-#include <gdk-pixbuf/gdk-pixbuf.h>
+#ifdef GSEAL_ENABLE
+ #define KEEP_GSEAL_ENABLE
+ #undef GSEAL_ENABLE
+#endif
#include <gtk/gtk.h>
+#ifdef KEEP_GSEAL_ENABLE
+ #define GSEAL_ENABLE
+ #undef KEEP_GSEAL_ENABLE
+#endif
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include "browser-spinner.h"
/* Spinner cache implementation */
@@ -572,7 +579,11 @@ browser_spinner_init (BrowserSpinner *spinner)
priv = spinner->priv = BROWSER_SPINNER_GET_PRIVATE (spinner);
+#if GTK_CHECK_VERSION(2,18,0)
+ gtk_widget_set_has_window (GTK_WIDGET (spinner), TRUE);
+#else
GTK_WIDGET_SET_FLAGS (GTK_WIDGET (spinner), GTK_NO_WINDOW);
+#endif
priv->cache = browser_spinner_cache_ref ();
priv->size = GTK_ICON_SIZE_DIALOG;
@@ -582,8 +593,7 @@ browser_spinner_init (BrowserSpinner *spinner)
}
static int
-browser_spinner_expose (GtkWidget *widget,
- GdkEventExpose *event)
+browser_spinner_expose (GtkWidget *widget, GdkEventExpose *event)
{
BrowserSpinner *spinner = BROWSER_SPINNER (widget);
BrowserSpinnerPriv *priv = spinner->priv;
@@ -592,23 +602,22 @@ browser_spinner_expose (GtkWidget *widget,
GdkGC *gc;
int x_offset, y_offset, width, height;
GdkRectangle pix_area, dest;
+ gboolean drawable;
- if (!GTK_WIDGET_DRAWABLE (spinner))
- {
+#if GTK_CHECK_VERSION(2,18,0)
+ drawable = gtk_widget_is_drawable (widget);
+#else
+ drawable = GTK_WIDGET_DRAWABLE (widget);
+#endif
+ if (!drawable)
return FALSE;
- }
- if (priv->need_load &&
- !browser_spinner_load_images (spinner))
- {
+ if (priv->need_load && !browser_spinner_load_images (spinner))
return FALSE;
- }
images = priv->images;
- if (images == NULL)
- {
+ if (!images)
return FALSE;
- }
/* Otherwise |images| will be NULL anyway */
g_assert (images->n_animation_pixbufs > 0);
@@ -624,23 +633,35 @@ browser_spinner_expose (GtkWidget *widget,
height = gdk_pixbuf_get_height (pixbuf);
/* Compute the offsets for the image centered on our allocation */
+#if GTK_CHECK_VERSION(2,18,0)
+ GtkAllocation alloc;
+ gtk_widget_get_allocation (widget, &alloc);
+ x_offset = (alloc.width - width) / 2;
+ y_offset = (alloc.height - height) / 2;
+ pix_area.x = x_offset + alloc.x;
+ pix_area.y = y_offset + alloc.y;
+#else
x_offset = (widget->allocation.width - width) / 2;
y_offset = (widget->allocation.height - height) / 2;
-
pix_area.x = x_offset + widget->allocation.x;
pix_area.y = y_offset + widget->allocation.y;
+#endif
pix_area.width = width;
pix_area.height = height;
if (!gdk_rectangle_intersect (&event->area, &pix_area, &dest))
- {
return FALSE;
- }
- gc = gdk_gc_new (widget->window);
- gdk_draw_pixbuf (widget->window, gc, pixbuf,
- dest.x - x_offset - widget->allocation.x,
- dest.y - y_offset - widget->allocation.y,
+ GdkWindow *win;
+#if GTK_CHECK_VERSION(2,18,0)
+ win = gtk_widget_get_window (widget);
+#else
+ win = widget->window;
+#endif
+ gc = gdk_gc_new (win);
+ gdk_draw_pixbuf (win, gc, pixbuf,
+ dest.x - x_offset - alloc.x,
+ dest.y - y_offset - alloc.y,
dest.x, dest.y,
dest.width, dest.height,
GDK_RGB_DITHER_MAX, 0, 0);
@@ -686,10 +707,9 @@ browser_spinner_start (BrowserSpinner *spinner)
priv->spinning = TRUE;
- if (GTK_WIDGET_MAPPED (GTK_WIDGET (spinner)) &&
+ if (GTK_WIDGET_MAPPED (GTK_WIDGET (spinner)) && /* GTK3 FIXME */
priv->timer_task == 0 &&
- browser_spinner_load_images (spinner))
- {
+ browser_spinner_load_images (spinner)) {
/* the 0th frame is the 'rest' icon */
priv->current_image = MIN (1, priv->images->n_animation_pixbufs);
@@ -707,8 +727,7 @@ browser_spinner_remove_update_callback (BrowserSpinner *spinner)
{
BrowserSpinnerPriv *priv = spinner->priv;
- if (priv->timer_task != 0)
- {
+ if (priv->timer_task != 0) {
g_source_remove (priv->timer_task);
priv->timer_task = 0;
}
@@ -728,14 +747,11 @@ browser_spinner_stop (BrowserSpinner *spinner)
priv->spinning = FALSE;
priv->current_image = 0;
- if (priv->timer_task != 0)
- {
+ if (priv->timer_task != 0) {
browser_spinner_remove_update_callback (spinner);
- if (GTK_WIDGET_MAPPED (GTK_WIDGET (spinner)))
- {
+ if (GTK_WIDGET_MAPPED (GTK_WIDGET (spinner))) /* GTK3 FIXME */
gtk_widget_queue_draw (GTK_WIDGET (spinner));
- }
}
}
diff --git a/tools/browser/canvas-example.c b/tools/browser/canvas-example.c
index 60cfd83..5b29935 100644
--- a/tools/browser/canvas-example.c
+++ b/tools/browser/canvas-example.c
@@ -133,11 +133,20 @@ label_drag_data_received (GtkWidget *label, GdkDragContext *context,
gint x, gint y, GtkSelectionData *data,
guint info, guint time)
{
+#if GTK_CHECK_VERSION(2,18,0)
+ if ((gtk_selection_data_get_length (data) >= 0) && (gtk_selection_data_get_format (data) == 8)) {
+ g_print ("Received \"%s\" in drop zone\n",
+ (gchar *) gtk_selection_data_get_data (data));
+ gtk_drag_finish (context, TRUE, FALSE, time);
+ return;
+ }
+#else
if ((data->length >= 0) && (data->format == 8)) {
g_print ("Received \"%s\" in drop zone\n", (gchar *)data->data);
gtk_drag_finish (context, TRUE, FALSE, time);
return;
}
+#endif
gtk_drag_finish (context, FALSE, FALSE, time);
}
diff --git a/tools/browser/canvas/browser-canvas-column.c b/tools/browser/canvas/browser-canvas-column.c
index 8de8f5d..47db253 100644
--- a/tools/browser/canvas/browser-canvas-column.c
+++ b/tools/browser/canvas/browser-canvas-column.c
@@ -320,6 +320,10 @@ browser_canvas_column_drag_data_get (BrowserCanvasItem *citem, GdkDragContext *d
g_free (tmp2);
g_free (tmp3);
g_free (tmp4);
- gtk_selection_data_set (data, data->target, 8, str, strlen (str));
+#if GTK_CHECK_VERSION(2,18,0)
+ gtk_selection_data_set (data, gtk_selection_data_get_target (data), 8, (guchar*) str, strlen (str));
+#else
+ gtk_selection_data_set (data, data->target, 8, (guchar*) str, strlen (str));
+#endif
g_free (str);
}
diff --git a/tools/browser/canvas/browser-canvas-db-relations.c b/tools/browser/canvas/browser-canvas-db-relations.c
index faeb5d7..44d4353 100644
--- a/tools/browser/canvas/browser-canvas-db-relations.c
+++ b/tools/browser/canvas/browser-canvas-db-relations.c
@@ -209,10 +209,18 @@ popup_position (PopupContainer *container, gint *out_x, gint *out_y)
gtk_widget_size_request (canvas, &req);
+#if GTK_CHECK_VERSION(2,18,0)
+ GtkAllocation alloc;
+ gdk_window_get_origin (gtk_widget_get_window (canvas), &x, &y);
+ gtk_widget_get_allocation (canvas, &alloc);
+ x += alloc.x;
+ y += alloc.y;
+#else
gdk_window_get_origin (canvas->window, &x, &y);
x += canvas->allocation.x;
y += canvas->allocation.y;
+#endif
if (x < 0)
x = 0;
diff --git a/tools/browser/canvas/browser-canvas-table.c b/tools/browser/canvas/browser-canvas-table.c
index b87917c..a6e8be8 100644
--- a/tools/browser/canvas/browser-canvas-table.c
+++ b/tools/browser/canvas/browser-canvas-table.c
@@ -535,7 +535,11 @@ browser_canvas_table_drag_data_get (BrowserCanvasItem *citem, GdkDragContext *dr
g_free (tmp1);
g_free (tmp2);
g_free (tmp3);
- gtk_selection_data_set (data, data->target, 8, str, strlen (str));
+#if GTK_CHECK_VERSION(2,18,0)
+ gtk_selection_data_set (data, gtk_selection_data_get_target (data), 8, (guchar*) str, strlen (str));
+#else
+ gtk_selection_data_set (data, data->target, 8, (guchar*) str, strlen (str));
+#endif
g_free (str);
}
@@ -561,7 +565,7 @@ browser_canvas_table_serialize (BrowserCanvasItem *citem)
gchar *str;
dbo = GDA_META_DB_OBJECT (ctable->priv->table);
- node = xmlNewNode (NULL, "table");
+ node = xmlNewNode (NULL, BAD_CAST "table");
xmlSetProp (node, BAD_CAST "schema", BAD_CAST (dbo->obj_schema));
xmlSetProp (node, BAD_CAST "name", BAD_CAST (dbo->obj_name));
goo_canvas_item_get_bounds (GOO_CANVAS_ITEM (citem), &bounds);
diff --git a/tools/browser/canvas/browser-canvas.c b/tools/browser/canvas/browser-canvas.c
index 103eefc..a3e5ef1 100644
--- a/tools/browser/canvas/browser-canvas.c
+++ b/tools/browser/canvas/browser-canvas.c
@@ -272,17 +272,36 @@ motion_notify_event_cb (BrowserCanvas *canvas, GdkEvent *event, GooCanvas *gcanv
if (canvas->priv->canvas_moving) {
GtkAdjustment *ha, *va;
gdouble x, y;
+ gdouble upper, lower, page_size;
ha = gtk_scrolled_window_get_hadjustment (GTK_SCROLLED_WINDOW (canvas));
va = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (canvas));
+#if GTK_CHECK_VERSION(2,18,0)
+ upper = gtk_adjustment_get_upper (ha);
+ lower = gtk_adjustment_get_lower (ha);
+ page_size = gtk_adjustment_get_page_size (ha);
+#else
+ upper = ha->upper;
+ lower = ha->lower;
+ page_size = ha->page_size;
+#endif
x = gtk_adjustment_get_value (ha);
x = CLAMP (x + canvas->xmouse - ((GdkEventMotion*) event)->x,
- ha->lower, ha->upper - ha->page_size);
+ lower, upper - page_size);
gtk_adjustment_set_value (ha, x);
+#if GTK_CHECK_VERSION(2,18,0)
+ upper = gtk_adjustment_get_upper (va);
+ lower = gtk_adjustment_get_lower (va);
+ page_size = gtk_adjustment_get_page_size (va);
+#else
+ upper = va->upper;
+ lower = va->lower;
+ page_size = va->page_size;
+#endif
y = gtk_adjustment_get_value (va);
y = CLAMP (y + canvas->ymouse - ((GdkEventMotion*) event)->y,
- va->lower, va->upper - va->page_size);
+ lower, upper - page_size);
gtk_adjustment_set_value (va, y);
}
else {
@@ -291,7 +310,13 @@ motion_notify_event_cb (BrowserCanvas *canvas, GdkEvent *event, GooCanvas *gcanv
canvas->priv->canvas_moving = TRUE;
if (! hand_cursor)
hand_cursor = gdk_cursor_new (GDK_HAND2);
- gdk_window_set_cursor (GTK_WIDGET (canvas)->window, hand_cursor);
+#if GTK_CHECK_VERSION(2,18,0)
+ gdk_window_set_cursor (gtk_widget_get_window (GTK_WIDGET (canvas)),
+ hand_cursor);
+#else
+ gdk_window_set_cursor (GTK_WIDGET (canvas)->window,
+ hand_cursor);
+#endif
}
}
done = TRUE;
@@ -396,7 +421,11 @@ canvas_event_cb (BrowserCanvas *canvas, GdkEvent *event, GooCanvas *gcanvas)
case GDK_BUTTON_RELEASE:
if (canvas->priv->canvas_moving) {
canvas->priv->canvas_moving = FALSE;
+#if GTK_CHECK_VERSION(2,18,0)
+ gdk_window_set_cursor (gtk_widget_get_window (GTK_WIDGET (canvas)), NULL);
+#else
gdk_window_set_cursor (GTK_WIDGET (canvas)->window, NULL);
+#endif
}
break;
case GDK_2BUTTON_PRESS:
@@ -468,8 +497,13 @@ popup_export_cb (GtkMenuItem *mitem, BrowserCanvas *canvas)
#define MARGIN 5.
+#if GTK_CHECK_VERSION(2,18,0)
+ if (!gtk_widget_is_toplevel (toplevel))
+ toplevel = NULL;
+#else
if (!GTK_WIDGET_TOPLEVEL (toplevel))
toplevel = NULL;
+#endif
dlg = gtk_file_chooser_dialog_new (_("Save diagram as"), (GtkWindow*) toplevel,
GTK_FILE_CHOOSER_ACTION_SAVE,
@@ -744,8 +778,15 @@ browser_canvas_fit_zoom_factor (BrowserCanvas *canvas)
g_return_val_if_fail (IS_BROWSER_CANVAS (canvas), 1.);
g_return_val_if_fail (canvas->priv, 1.);
+#if GTK_CHECK_VERSION(2,18,0)
+ GtkAllocation alloc;
+ gtk_widget_get_allocation (GTK_WIDGET (canvas), &alloc);
+ xall = alloc.width;
+ yall = alloc.height;
+#else
xall = GTK_WIDGET (canvas)->allocation.width;
yall = GTK_WIDGET (canvas)->allocation.height;
+#endif
goo_canvas_item_get_bounds (GOO_CANVAS_ITEM (goo_canvas_get_root_item (canvas->priv->goocanvas)),
&bounds);
diff --git a/tools/browser/common/gdaui-entry-import.c b/tools/browser/common/gdaui-entry-import.c
index aeae819..af5006f 100644
--- a/tools/browser/common/gdaui-entry-import.c
+++ b/tools/browser/common/gdaui-entry-import.c
@@ -178,7 +178,11 @@ open_button_clicked_cb (GtkWidget *button, GdauiEntryImport *mgtxt)
GTK_RESPONSE_REJECT,
NULL);
wid = gdaui_data_import_new ();
- gtk_container_add (GTK_CONTAINER (GTK_DIALOG(dialog)->vbox), wid);
+#if GTK_CHECK_VERSION(2,18,0)
+ gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), wid);
+#else
+ gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), wid);
+#endif
gtk_widget_show_all (dialog);
res = gtk_dialog_run (GTK_DIALOG (dialog));
diff --git a/tools/browser/common/objects-cloud.c b/tools/browser/common/objects-cloud.c
index 10eb5f0..2f81ec9 100644
--- a/tools/browser/common/objects-cloud.c
+++ b/tools/browser/common/objects-cloud.c
@@ -513,8 +513,12 @@ static gboolean
visibility_notify_event (GtkWidget *text_view, GdkEventVisibility *event, ObjectsCloud *cloud)
{
gint wx, wy, bx, by;
-
+
+#if GTK_CHECK_VERSION(2,18,0)
+ gdk_window_get_pointer (gtk_widget_get_window (text_view), &wx, &wy, NULL);
+#else
gdk_window_get_pointer (text_view->window, &wx, &wy, NULL);
+#endif
gtk_text_view_window_to_buffer_coords (GTK_TEXT_VIEW (text_view),
GTK_TEXT_WINDOW_WIDGET,
@@ -538,8 +542,11 @@ motion_notify_event (GtkWidget *text_view, GdkEventMotion *event, ObjectsCloud *
event->x, event->y, &x, &y);
set_cursor_if_appropriate (GTK_TEXT_VIEW (text_view), x, y, cloud);
-
+#if GTK_CHECK_VERSION(2,18,0)
+ gdk_window_get_pointer (gtk_widget_get_window (text_view), NULL, NULL, NULL);
+#else
gdk_window_get_pointer (text_view->window, NULL, NULL, NULL);
+#endif
return FALSE;
}
diff --git a/tools/browser/common/objects-cloud.h b/tools/browser/common/objects-cloud.h
index e92a853..b9d7aaa 100644
--- a/tools/browser/common/objects-cloud.h
+++ b/tools/browser/common/objects-cloud.h
@@ -23,7 +23,7 @@
#ifndef __OBJECTS_CLOUD_H__
#define __OBJECTS_CLOUD_H__
-#include <gtk/gtkvbox.h>
+#include <gtk/gtk.h>
#include "../browser-connection.h"
G_BEGIN_DECLS
diff --git a/tools/browser/connection-binding-properties.c b/tools/browser/connection-binding-properties.c
index 368f93a..50a473f 100644
--- a/tools/browser/connection-binding-properties.c
+++ b/tools/browser/connection-binding-properties.c
@@ -183,6 +183,14 @@ create_layout (ConnectionBindingProperties *cprop)
{
GtkWidget *sw, *vp, *label, *hbox;
gchar *str;
+ GtkWidget *dcontents;
+
+#if GTK_CHECK_VERSION(2,18,0)
+ dcontents = gtk_dialog_get_content_area (GTK_DIALOG (cprop));
+#else
+ dcontents = GTK_DIALOG (cprop)->vbox;
+#endif
+
str = g_strdup_printf ("<b>%s:</b>\n<small>%s</small>",
_("Virtual connection's properties"),
@@ -192,10 +200,10 @@ create_layout (ConnectionBindingProperties *cprop)
gtk_label_set_markup (GTK_LABEL (label), str);
gtk_misc_set_alignment (GTK_MISC (label), 0., -1);
g_free (str);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (cprop)->vbox), label, FALSE, FALSE, 10);
+ gtk_box_pack_start (GTK_BOX (dcontents), label, FALSE, FALSE, 10);
hbox = gtk_hbox_new (FALSE, 0); /* HIG */
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (cprop)->vbox), hbox, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (dcontents), hbox, TRUE, TRUE, 0);
label = gtk_label_new (" ");
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
@@ -211,7 +219,7 @@ create_layout (ConnectionBindingProperties *cprop)
cprop->priv->layout_table = GTK_TABLE (gtk_table_new (2, 2, FALSE));
gtk_container_add (GTK_CONTAINER (vp), (GtkWidget*) cprop->priv->layout_table);
- gtk_widget_show_all (GTK_DIALOG (cprop)->vbox);
+ gtk_widget_show_all (dcontents);
gtk_window_set_default_size (GTK_WINDOW (cprop), 340, 300);
gtk_dialog_set_response_sensitive (GTK_DIALOG (cprop), GTK_RESPONSE_OK, FALSE);
diff --git a/tools/browser/doc/tmpl/browser-connection.sgml b/tools/browser/doc/tmpl/browser-connection.sgml
index 9fbafa4..429a386 100644
--- a/tools/browser/doc/tmpl/browser-connection.sgml
+++ b/tools/browser/doc/tmpl/browser-connection.sgml
@@ -23,6 +23,22 @@ An opened connection
</para>
+ wrapper:
+ wrapper_jobs:
+ wrapper_results_timer:
+ executed_statements:
+ name:
+ cnc:
+ dict_file_name:
+ parser:
+ variables:
+ dsn_info:
+ p_mstruct_mutex:
+ p_mstruct:
+ mstruct:
+ bfav:
+ busy:
+ busy_reason:
<!-- ##### STRUCT BrowserConnection ##### -->
<para>
@@ -61,6 +77,11 @@ An opened connection
@browserconnection: the object which received the signal.
+<!-- ##### ARG BrowserConnection:gda-connection ##### -->
+<para>
+
+</para>
+
<!-- ##### FUNCTION browser_connection_new ##### -->
<para>
diff --git a/tools/browser/login-dialog.c b/tools/browser/login-dialog.c
index 405a716..ccd5d64 100644
--- a/tools/browser/login-dialog.c
+++ b/tools/browser/login-dialog.c
@@ -104,6 +104,13 @@ login_dialog_init (LoginDialog *dialog)
{
GtkWidget *label, *hbox, *wid;
char *markup, *str;
+ GtkWidget *dcontents;
+
+#if GTK_CHECK_VERSION(2,18,0)
+ dcontents = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
+#else
+ dcontents = GTK_DIALOG (dialog)->vbox;
+#endif
dialog->priv = g_new0 (LoginDialogPrivate, 1);
@@ -113,7 +120,7 @@ login_dialog_init (LoginDialog *dialog)
GTK_STOCK_CANCEL,
GTK_RESPONSE_REJECT, NULL);
- gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox), 5);
+ gtk_box_set_spacing (GTK_BOX (dcontents), 5);
gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), GTK_RESPONSE_ACCEPT, FALSE);
str = gda_gbr_get_file_path (GDA_DATA_DIR, LIBGDA_ABI_NAME, "pixmaps", "gda-browser-non-connected.png", NULL);
@@ -123,7 +130,7 @@ login_dialog_init (LoginDialog *dialog)
/* label and spinner */
hbox = gtk_hbox_new (FALSE, 0);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 10);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (dcontents), hbox, FALSE, FALSE, 0);
str = gda_gbr_get_file_path (GDA_DATA_DIR, LIBGDA_ABI_NAME, "pixmaps", "gda-browser-non-connected-big.png", NULL);
wid = gtk_image_new_from_file (str);
@@ -146,7 +153,7 @@ login_dialog_init (LoginDialog *dialog)
/* login (not shown) */
hbox = gtk_hbox_new (FALSE, 0); /* HIG */
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox, FALSE, FALSE, 10);
+ gtk_box_pack_start (GTK_BOX (dcontents), hbox, FALSE, FALSE, 10);
label = gtk_label_new (" ");
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
diff --git a/tools/browser/query-exec/query-console.c b/tools/browser/query-exec/query-console.c
index 4143639..2411778 100644
--- a/tools/browser/query-exec/query-console.c
+++ b/tools/browser/query-exec/query-console.c
@@ -22,7 +22,6 @@
#include <glib/gi18n-lib.h>
#include <string.h>
-#include <gtk/gtk.h>
#include "query-console.h"
#include "../dnd.h"
#include "../support.h"
@@ -790,10 +789,18 @@ popup_container_position_func (PopupContainer *cont, gint *out_x, gint *out_y)
console = g_object_get_data (G_OBJECT (cont), "console");
top = gtk_widget_get_toplevel (console);
gtk_widget_size_request ((GtkWidget*) cont, &req);
+#if GTK_CHECK_VERSION(2,18,0)
+ GtkAllocation alloc;
+ gdk_window_get_origin (gtk_widget_get_window (top), &x, &y);
+ gtk_widget_get_allocation (top, &alloc);
+ x += (alloc.width - req.width) / 2;
+ y += (alloc.height - req.height) / 2;
+#else
gdk_window_get_origin (top->window, &x, &y);
x += (top->allocation.width - req.width) / 2;
y += (top->allocation.height - req.height) / 2;
+#endif
if (x < 0)
x = 0;
diff --git a/tools/browser/query-exec/query-console.h b/tools/browser/query-exec/query-console.h
index 7b8bbeb..3b26769 100644
--- a/tools/browser/query-exec/query-console.h
+++ b/tools/browser/query-exec/query-console.h
@@ -23,7 +23,7 @@
#ifndef __QUERY_INFO_H__
#define __QUERY_CONSOLE_H__
-#include <gtk/gtkvbox.h>
+#include <gtk/gtk.h>
#include "../browser-connection.h"
G_BEGIN_DECLS
diff --git a/tools/browser/query-exec/query-editor.c b/tools/browser/query-exec/query-editor.c
index 31d3fc6..c4954d7 100644
--- a/tools/browser/query-exec/query-editor.c
+++ b/tools/browser/query-exec/query-editor.c
@@ -23,9 +23,12 @@
#include <glib/gi18n-lib.h>
#include <string.h>
-#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
#ifdef HAVE_GTKSOURCEVIEW
+ #ifdef GTK_DISABLE_SINGLE_INCLUDES
+ #undef GTK_DISABLE_SINGLE_INCLUDES
+ #endif
+
#include <gtksourceview/gtksourceview.h>
#include <gtksourceview/gtksourcelanguagemanager.h>
#include <gtksourceview/gtksourcebuffer.h>
@@ -606,11 +609,13 @@ text_view_expose_event (GtkTextView *tv, GdkEventExpose *event, QueryEditor *edi
gint win_y;
GdkGC *gc;
gint margin;
+ GtkTextBuffer *tbuffer;
- gtk_text_buffer_get_iter_at_mark (tv->buffer, &cur, editor->priv->hist_focus->start_mark);
+ tbuffer = gtk_text_view_get_buffer (tv);
+ gtk_text_buffer_get_iter_at_mark (tbuffer, &cur, editor->priv->hist_focus->start_mark);
gtk_text_view_get_line_yrange (tv, &cur, &y, &height);
- gtk_text_buffer_get_iter_at_mark (tv->buffer, &cur, editor->priv->hist_focus->end_mark);
+ gtk_text_buffer_get_iter_at_mark (tbuffer, &cur, editor->priv->hist_focus->end_mark);
gtk_text_view_get_line_yrange (tv, &cur, &ye, &heighte);
height = ye - y;
@@ -620,7 +625,7 @@ text_view_expose_event (GtkTextView *tv, GdkEventExpose *event, QueryEditor *edi
list = g_slist_last (editor->priv->hist_focus->batch->hist_items);
if (list) {
hdata = g_hash_table_lookup (editor->priv->hash, list->data);
- gtk_text_buffer_get_iter_at_mark (tv->buffer, &cur, hdata->end_mark);
+ gtk_text_buffer_get_iter_at_mark (tbuffer, &cur, hdata->end_mark);
gtk_text_view_get_line_yrange (tv, &cur, &ye, &heighte);
height = ye - y;
}
@@ -643,7 +648,13 @@ text_view_expose_event (GtkTextView *tv, GdkEventExpose *event, QueryEditor *edi
redraw_rect.width = visible_rect.width;
redraw_rect.height = visible_rect.height;
- gc = GTK_WIDGET (tv)->style->bg_gc[GTK_WIDGET_STATE (GTK_WIDGET (tv))];
+ GtkStateType state;
+#if GTK_CHECK_VERSION(2,18,0)
+ state = gtk_widget_get_state (GTK_WIDGET (tv));
+#else
+ state = GTK_WIDGET_STATE (GTK_WIDGET (tv));
+#endif
+ gc = gtk_widget_get_style (GTK_WIDGET (tv))->bg_gc[state];
margin = gtk_text_view_get_left_margin (tv);
gdk_draw_rectangle (event->window,
diff --git a/tools/browser/query-exec/query-editor.h b/tools/browser/query-exec/query-editor.h
index 046c071..077a471 100644
--- a/tools/browser/query-exec/query-editor.h
+++ b/tools/browser/query-exec/query-editor.h
@@ -24,7 +24,7 @@
#ifndef __QUERY_EDITOR_H__
#define __QUERY_EDITOR_H__
-#include <gtk/gtkvbox.h>
+#include <gtk/gtk.h>
#include <libgda/libgda.h>
G_BEGIN_DECLS
diff --git a/tools/browser/query-exec/query-favorite-selector.c b/tools/browser/query-exec/query-favorite-selector.c
index a5e7edb..00e24fd 100644
--- a/tools/browser/query-exec/query-favorite-selector.c
+++ b/tools/browser/query-exec/query-favorite-selector.c
@@ -569,14 +569,23 @@ tree_store_drag_drop_cb (GdauiTreeStore *store, const gchar *path, GtkSelectionD
gint id;
bfav = browser_connection_get_favorites (tsel->priv->bcnc);
+#if GTK_CHECK_VERSION(2,18,0)
+ id = browser_favorites_find (bfav, 0, (gchar*) gtk_selection_data_get_data (selection_data),
+ &fav, NULL);
+#else
id = browser_favorites_find (bfav, 0, (gchar*) selection_data->data, &fav, NULL);
+#endif
if (id < 0) {
memset (&fav, 0, sizeof (BrowserFavoritesAttributes));
fav.id = -1;
fav.type = BROWSER_FAVORITES_QUERIES;
fav.name = _("Unnamed query");
fav.descr = NULL;
+#if GTK_CHECK_VERSION(2,18,0)
+ fav.contents = (gchar*) gtk_selection_data_get_data (selection_data);
+#else
fav.contents = (gchar*) selection_data->data;
+#endif
}
pos = atoi (path);
@@ -623,8 +632,13 @@ tree_store_drag_get_cb (GdauiTreeStore *store, const gchar *path, GtkSelectionDa
if (cvalue) {
const gchar *str;
str = g_value_get_string (cvalue);
- gtk_selection_data_set (selection_data, selection_data->target, 8,
- (guchar*) str, strlen (str));
+#if GTK_CHECK_VERSION(2,18,0)
+ gtk_selection_data_set (selection_data, gtk_selection_data_get_target (selection_data),
+ 8, (guchar*) str, strlen (str));
+#else
+ gtk_selection_data_set (selection_data, selection_data->target,
+ 8, (guchar*) str, strlen (str));
+#endif
return TRUE;
}
}
diff --git a/tools/browser/query-exec/query-favorite-selector.h b/tools/browser/query-exec/query-favorite-selector.h
index 45cada1..acf75d7 100644
--- a/tools/browser/query-exec/query-favorite-selector.h
+++ b/tools/browser/query-exec/query-favorite-selector.h
@@ -23,7 +23,7 @@
#ifndef __QUERY_FAVORITE_SELECTOR_H__
#define __QUERY_FAVORITE_SELECTOR_H__
-#include <gtk/gtkvbox.h>
+#include <gtk/gtk.h>
#include "../browser-connection.h"
G_BEGIN_DECLS
diff --git a/tools/browser/query-exec/query-result.h b/tools/browser/query-exec/query-result.h
index e000526..ddef00c 100644
--- a/tools/browser/query-exec/query-result.h
+++ b/tools/browser/query-exec/query-result.h
@@ -23,7 +23,7 @@
#ifndef __QUERY_RESULT_H__
#define __QUERY_RESULT_H__
-#include <gtk/gtkvbox.h>
+#include <gtk/gtk.h>
#include <libgda/libgda.h>
#include "query-editor.h"
diff --git a/tools/browser/schema-browser/favorite-selector.c b/tools/browser/schema-browser/favorite-selector.c
index 6084e46..9d57073 100644
--- a/tools/browser/schema-browser/favorite-selector.c
+++ b/tools/browser/schema-browser/favorite-selector.c
@@ -22,7 +22,6 @@
#include <glib/gi18n-lib.h>
#include <string.h>
-#include <gtk/gtk.h>
#include <libgda/gda-tree.h>
#include "favorite-selector.h"
#include "../mgr-favorites.h"
@@ -344,7 +343,11 @@ tree_store_drag_drop_cb (GdauiTreeStore *store, const gchar *path, GtkSelectionD
fav.type = BROWSER_FAVORITES_TABLES;
fav.name = NULL;
fav.descr = NULL;
+#if GTK_CHECK_VERSION(2,18,0)
+ fav.contents = (gchar*) gtk_selection_data_get_data (selection_data);
+#else
fav.contents = (gchar*) selection_data->data;
+#endif
pos = atoi (path);
g_print ("%s() path => %s, pos: %d\n", __FUNCTION__, path, pos);
@@ -388,8 +391,14 @@ tree_store_drag_get_cb (GdauiTreeStore *store, const gchar *path, GtkSelectionDa
if (cvalue) {
const gchar *str;
str = g_value_get_string (cvalue);
+#if GTK_CHECK_VERSION(2,18,0)
+ gtk_selection_data_set (selection_data,
+ gtk_selection_data_get_target (selection_data), 8,
+ (guchar*) str, strlen (str));
+#else
gtk_selection_data_set (selection_data, selection_data->target, 8,
(guchar*) str, strlen (str));
+#endif
return TRUE;
}
}
diff --git a/tools/browser/schema-browser/favorite-selector.h b/tools/browser/schema-browser/favorite-selector.h
index 7074f14..1e50ac3 100644
--- a/tools/browser/schema-browser/favorite-selector.h
+++ b/tools/browser/schema-browser/favorite-selector.h
@@ -23,7 +23,7 @@
#ifndef __FAVORITE_SELECTOR_H__
#define __FAVORITE_SELECTOR_H__
-#include <gtk/gtkvbox.h>
+#include <gtk/gtk.h>
#include "../browser-connection.h"
G_BEGIN_DECLS
diff --git a/tools/browser/schema-browser/objects-index.c b/tools/browser/schema-browser/objects-index.c
index eeb1a2b..553d72a 100644
--- a/tools/browser/schema-browser/objects-index.c
+++ b/tools/browser/schema-browser/objects-index.c
@@ -180,7 +180,7 @@ objects_index_new (BrowserConnection *bcnc)
cloud = objects_cloud_new (mstruct, OBJECTS_CLOUD_TYPE_TABLE);
objects_cloud_show_schemas (OBJECTS_CLOUD (cloud), TRUE);
gtk_box_pack_start (GTK_BOX (index), cloud, TRUE, TRUE, 0);
- index->priv->cloud = cloud;
+ index->priv->cloud = OBJECTS_CLOUD (cloud);
g_signal_connect (cloud, "selected",
G_CALLBACK (cloud_object_selected_cb), index);
@@ -198,7 +198,7 @@ objects_index_new (BrowserConnection *bcnc)
G_CALLBACK (gtk_widget_show), popup);
g_object_set_data (G_OBJECT (popup), "button", wid);
- wid = objects_cloud_create_filter (cloud);
+ wid = objects_cloud_create_filter (OBJECTS_CLOUD (cloud));
gtk_container_add (GTK_CONTAINER (popup), wid);
gtk_widget_show (wid);
diff --git a/tools/browser/schema-browser/objects-index.h b/tools/browser/schema-browser/objects-index.h
index fd0258e..d2c48c1 100644
--- a/tools/browser/schema-browser/objects-index.h
+++ b/tools/browser/schema-browser/objects-index.h
@@ -23,7 +23,7 @@
#ifndef __OBJECTS_INDEX_H__
#define __OBJECTS_INDEX_H__
-#include <gtk/gtkvbox.h>
+#include <gtk/gtk.h>
#include "../browser-connection.h"
G_BEGIN_DECLS
diff --git a/tools/browser/schema-browser/relations-diagram.c b/tools/browser/schema-browser/relations-diagram.c
index c26507d..97d4514 100644
--- a/tools/browser/schema-browser/relations-diagram.c
+++ b/tools/browser/schema-browser/relations-diagram.c
@@ -22,7 +22,6 @@
#include <glib/gi18n-lib.h>
#include <string.h>
-#include <gtk/gtk.h>
#include "relations-diagram.h"
#include "../support.h"
#include "../cc-gray-bar.h"
diff --git a/tools/browser/schema-browser/relations-diagram.h b/tools/browser/schema-browser/relations-diagram.h
index 92f89df..e0bb91a 100644
--- a/tools/browser/schema-browser/relations-diagram.h
+++ b/tools/browser/schema-browser/relations-diagram.h
@@ -23,7 +23,7 @@
#ifndef __RELATIONS_DIAGRAM_H__
#define __RELATIONS_DIAGRAM_H__
-#include <gtk/gtkvbox.h>
+#include <gtk/gtk.h>
#include "../browser-connection.h"
G_BEGIN_DECLS
diff --git a/tools/browser/schema-browser/table-columns.c b/tools/browser/schema-browser/table-columns.c
index 380c821..9d18d00 100644
--- a/tools/browser/schema-browser/table-columns.c
+++ b/tools/browser/schema-browser/table-columns.c
@@ -552,7 +552,11 @@ visibility_notify_event (GtkWidget *text_view, GdkEventVisibility *event, TableC
{
gint wx, wy, bx, by;
+#if GTK_CHECK_VERSION(2,18,0)
+ gdk_window_get_pointer (gtk_widget_get_window (text_view), &wx, &wy, NULL);
+#else
gdk_window_get_pointer (text_view->window, &wx, &wy, NULL);
+#endif
gtk_text_view_window_to_buffer_coords (GTK_TEXT_VIEW (text_view),
GTK_TEXT_WINDOW_WIDGET,
@@ -576,8 +580,13 @@ motion_notify_event (GtkWidget *text_view, GdkEventMotion *event, TableColumns *
event->x, event->y, &x, &y);
set_cursor_if_appropriate (GTK_TEXT_VIEW (text_view), x, y, tcolumns);
-
+
+#if GTK_CHECK_VERSION(2,18,0)
+ gdk_window_get_pointer (gtk_widget_get_window (text_view), NULL, NULL, NULL);
+#else
gdk_window_get_pointer (text_view->window, NULL, NULL, NULL);
+#endif
+
return FALSE;
}
diff --git a/tools/browser/schema-browser/table-info.c b/tools/browser/schema-browser/table-info.c
index 35f308a..694d9ec 100644
--- a/tools/browser/schema-browser/table-info.c
+++ b/tools/browser/schema-browser/table-info.c
@@ -22,7 +22,6 @@
#include <glib/gi18n-lib.h>
#include <string.h>
-#include <gtk/gtk.h>
#include "table-info.h"
#include "../dnd.h"
#include "../support.h"
@@ -226,8 +225,14 @@ source_drag_data_get_cb (GtkWidget *widget, GdkDragContext *context,
case TARGET_KEY_VALUE: {
gchar *str;
str = table_info_to_selection (tinfo);
+#if GTK_CHECK_VERSION(2,18,0)
+ gtk_selection_data_set (selection_data,
+ gtk_selection_data_get_target (selection_data), 8, (guchar*) str,
+ strlen (str));
+#else
gtk_selection_data_set (selection_data, selection_data->target, 8, (guchar*) str,
strlen (str));
+#endif
g_free (str);
break;
}
diff --git a/tools/browser/schema-browser/table-info.h b/tools/browser/schema-browser/table-info.h
index d39297f..82a652e 100644
--- a/tools/browser/schema-browser/table-info.h
+++ b/tools/browser/schema-browser/table-info.h
@@ -23,7 +23,7 @@
#ifndef __TABLE_INFO_H__
#define __TABLE_INFO_H__
-#include <gtk/gtkvbox.h>
+#include <gtk/gtk.h>
#include "../browser-connection.h"
G_BEGIN_DECLS
diff --git a/tools/browser/support.c b/tools/browser/support.c
index 4466734..4f54b4c 100644
--- a/tools/browser/support.c
+++ b/tools/browser/support.c
@@ -207,7 +207,11 @@ browser_show_notice (GtkWindow *parent, const gchar *context, const gchar *forma
g_signal_connect_data (cb, "toggled",
G_CALLBACK (hide_notice_toggled_cb), g_strdup (context),
(GClosureNotify) g_free, 0);
+#if GTK_CHECK_VERSION(2,18,0)
+ gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), cb, FALSE, FALSE, 10);
+#else
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), cb, FALSE, FALSE, 10);
+#endif
}
gtk_widget_show_all (dialog);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]