[libgda] GdaDataEntry widgets can be queried for horizontal and vertical expansion requirements
- From: Vivien Malerba <vivien src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgda] GdaDataEntry widgets can be queried for horizontal and vertical expansion requirements
- Date: Fri, 16 Jul 2010 20:57:45 +0000 (UTC)
commit 6cac6b56c6d799a4b99cf3c9c20f17014fbac334
Author: Vivien Malerba <malerba gnome-db org>
Date: Fri Jul 16 22:33:24 2010 +0200
GdaDataEntry widgets can be queried for horizontal and vertical expansion requirements
doc/C/libgda-ui-sections.txt | 2 +-
doc/C/tmpl/gdaui-basic-form.sgml | 2 +-
doc/C/tmpl/gdaui-data-entry.sgml | 10 ++++++-
libgda-ui/data-entries/gdaui-entry-bin.c | 6 ++--
libgda-ui/data-entries/gdaui-entry-boolean.c | 6 ++--
libgda-ui/data-entries/gdaui-entry-combo.c | 6 ++--
libgda-ui/data-entries/gdaui-entry-common-time.c | 6 ++--
libgda-ui/data-entries/gdaui-entry-none.c | 6 ++--
libgda-ui/data-entries/gdaui-entry-number.c | 6 ++--
libgda-ui/data-entries/gdaui-entry-string.c | 6 ++--
libgda-ui/data-entries/gdaui-entry-wrapper.c | 12 ++++----
libgda-ui/data-entries/gdaui-entry-wrapper.h | 2 +-
libgda-ui/data-entries/plugins/gdaui-entry-cgrid.c | 30 ++++++++------------
libgda-ui/data-entries/plugins/gdaui-entry-cidr.c | 6 ++--
.../data-entries/plugins/gdaui-entry-filesel.c | 6 ++--
.../data-entries/plugins/gdaui-entry-password.c | 6 ++--
libgda-ui/data-entries/plugins/gdaui-entry-pict.c | 6 ++--
libgda-ui/data-entries/plugins/gdaui-entry-text.c | 6 ++--
libgda-ui/gdaui-basic-form.c | 14 ++++----
libgda-ui/gdaui-data-entry.c | 14 +++++----
libgda-ui/gdaui-data-entry.h | 15 +--------
libgda-ui/gdaui-form.c | 4 +-
testing/gdaui-test-data-entries.c | 2 +-
tools/browser/common/gdaui-entry-import.c | 8 ++--
24 files changed, 90 insertions(+), 97 deletions(-)
---
diff --git a/doc/C/libgda-ui-sections.txt b/doc/C/libgda-ui-sections.txt
index f33a0ef..2b277d7 100644
--- a/doc/C/libgda-ui-sections.txt
+++ b/doc/C/libgda-ui-sections.txt
@@ -87,7 +87,7 @@ gdaui_data_entry_set_value_default
gdaui_data_entry_set_attributes
gdaui_data_entry_get_attributes
gdaui_data_entry_get_handler
-gdaui_data_entry_expand_in_layout
+gdaui_data_entry_can_expand
gdaui_data_entry_set_editable
gdaui_data_entry_get_editable
gdaui_data_entry_grab_focus
diff --git a/doc/C/tmpl/gdaui-basic-form.sgml b/doc/C/tmpl/gdaui-basic-form.sgml
index c1b8a9d..7948294 100644
--- a/doc/C/tmpl/gdaui-basic-form.sgml
+++ b/doc/C/tmpl/gdaui-basic-form.sgml
@@ -136,7 +136,7 @@ which can be described by the following DTD.
@gdauibasicform: the object which received the signal.
-<!-- ##### ARG GdauiBasicForm:can-expand ##### -->
+<!-- ##### ARG GdauiBasicForm:can-expand-v ##### -->
<para>
</para>
diff --git a/doc/C/tmpl/gdaui-data-entry.sgml b/doc/C/tmpl/gdaui-data-entry.sgml
index 0a4f33b..92c9b7e 100644
--- a/doc/C/tmpl/gdaui-data-entry.sgml
+++ b/doc/C/tmpl/gdaui-data-entry.sgml
@@ -68,6 +68,13 @@ Data entry widget
@arg1:
@Returns:
+<!-- ##### SIGNAL GdauiDataEntry::expand-changed ##### -->
+<para>
+
+</para>
+
+ gdauidataentry: the object which received the signal.
+
<!-- ##### SIGNAL GdauiDataEntry::status-changed ##### -->
<para>
@@ -184,12 +191,13 @@ Data entry widget
@Returns:
-<!-- ##### FUNCTION gdaui_data_entry_expand_in_layout ##### -->
+<!-- ##### FUNCTION gdaui_data_entry_can_expand ##### -->
<para>
</para>
@de:
+ horiz:
@Returns:
diff --git a/libgda-ui/data-entries/gdaui-entry-bin.c b/libgda-ui/data-entries/gdaui-entry-bin.c
index 4aba67c..2a4f236 100644
--- a/libgda-ui/data-entries/gdaui-entry-bin.c
+++ b/libgda-ui/data-entries/gdaui-entry-bin.c
@@ -36,7 +36,7 @@ static GtkWidget *create_entry (GdauiEntryWrapper *mgwrap);
static void real_set_value (GdauiEntryWrapper *mgwrap, const GValue *value);
static GValue *real_get_value (GdauiEntryWrapper *mgwrap);
static void connect_signals(GdauiEntryWrapper *mgwrap, GCallback modify_cb, GCallback activate_cb);
-static gboolean expand_in_layout (GdauiEntryWrapper *mgwrap);
+static gboolean can_expand (GdauiEntryWrapper *mgwrap, gboolean horiz);
static void set_editable (GdauiEntryWrapper *mgwrap, gboolean editable);
static void grab_focus (GdauiEntryWrapper *mgwrap);
@@ -98,7 +98,7 @@ gdaui_entry_bin_class_init (GdauiEntryBinClass *class)
GDAUI_ENTRY_WRAPPER_CLASS (class)->real_set_value = real_set_value;
GDAUI_ENTRY_WRAPPER_CLASS (class)->real_get_value = real_get_value;
GDAUI_ENTRY_WRAPPER_CLASS (class)->connect_signals = connect_signals;
- GDAUI_ENTRY_WRAPPER_CLASS (class)->expand_in_layout = expand_in_layout;
+ GDAUI_ENTRY_WRAPPER_CLASS (class)->can_expand = can_expand;
GDAUI_ENTRY_WRAPPER_CLASS (class)->set_editable = set_editable;
GDAUI_ENTRY_WRAPPER_CLASS (class)->grab_focus = grab_focus;
@@ -384,7 +384,7 @@ connect_signals (GdauiEntryWrapper *mgwrap, GCallback modify_cb, GCallback activ
}
static gboolean
-expand_in_layout (GdauiEntryWrapper *mgwrap)
+can_expand (GdauiEntryWrapper *mgwrap, gboolean horiz)
{
return FALSE;
}
diff --git a/libgda-ui/data-entries/gdaui-entry-boolean.c b/libgda-ui/data-entries/gdaui-entry-boolean.c
index 1d7d728..fe2cb4c 100644
--- a/libgda-ui/data-entries/gdaui-entry-boolean.c
+++ b/libgda-ui/data-entries/gdaui-entry-boolean.c
@@ -33,7 +33,7 @@ static GtkWidget *create_entry (GdauiEntryWrapper *mgwrap);
static void real_set_value (GdauiEntryWrapper *mgwrap, const GValue *value);
static GValue *real_get_value (GdauiEntryWrapper *mgwrap);
static void connect_signals(GdauiEntryWrapper *mgwrap, GCallback modify_cb, GCallback activate_cb);
-static gboolean expand_in_layout (GdauiEntryWrapper *mgwrap);
+static gboolean can_expand (GdauiEntryWrapper *mgwrap, gboolean horiz);
static void set_editable (GdauiEntryWrapper *mgwrap, gboolean editable);
static void grab_focus (GdauiEntryWrapper *mgwrap);
@@ -85,7 +85,7 @@ gdaui_entry_boolean_class_init (GdauiEntryBooleanClass * class)
GDAUI_ENTRY_WRAPPER_CLASS (class)->real_set_value = real_set_value;
GDAUI_ENTRY_WRAPPER_CLASS (class)->real_get_value = real_get_value;
GDAUI_ENTRY_WRAPPER_CLASS (class)->connect_signals = connect_signals;
- GDAUI_ENTRY_WRAPPER_CLASS (class)->expand_in_layout = expand_in_layout;
+ GDAUI_ENTRY_WRAPPER_CLASS (class)->can_expand = can_expand;
GDAUI_ENTRY_WRAPPER_CLASS (class)->set_editable = set_editable;
GDAUI_ENTRY_WRAPPER_CLASS (class)->grab_focus = grab_focus;
}
@@ -257,7 +257,7 @@ check_toggled_cb (GtkToggleButton *toggle, GdauiEntryBoolean *mgbool)
}
static gboolean
-expand_in_layout (GdauiEntryWrapper *mgwrap)
+can_expand (GdauiEntryWrapper *mgwrap, gboolean horiz)
{
return FALSE;
}
diff --git a/libgda-ui/data-entries/gdaui-entry-combo.c b/libgda-ui/data-entries/gdaui-entry-combo.c
index 7b0e3d7..6ec77a2 100644
--- a/libgda-ui/data-entries/gdaui-entry-combo.c
+++ b/libgda-ui/data-entries/gdaui-entry-combo.c
@@ -52,7 +52,7 @@ static const GValue *gdaui_entry_combo_get_ref_value (GdauiDataEntry *de);
static void gdaui_entry_combo_set_value_default (GdauiDataEntry *de, const GValue * value);
static void gdaui_entry_combo_set_attributes (GdauiDataEntry *de, guint attrs, guint mask);
static GdaValueAttribute gdaui_entry_combo_get_attributes (GdauiDataEntry *de);
-static gboolean gdaui_entry_combo_expand_in_layout (GdauiDataEntry *de);
+static gboolean gdaui_entry_combo_can_expand (GdauiDataEntry *de, gboolean horiz);
static void gdaui_entry_combo_grab_focus (GdauiDataEntry *de);
static void _gdaui_entry_combo_construct(GdauiEntryCombo* combo,
@@ -139,7 +139,7 @@ gdaui_entry_combo_data_entry_init (GdauiDataEntryIface *iface)
iface->set_attributes = gdaui_entry_combo_set_attributes;
iface->get_attributes = gdaui_entry_combo_get_attributes;
iface->get_handler = NULL;
- iface->expand_in_layout = gdaui_entry_combo_expand_in_layout;
+ iface->can_expand = gdaui_entry_combo_can_expand;
iface->grab_focus = gdaui_entry_combo_grab_focus;
}
@@ -992,7 +992,7 @@ gdaui_entry_combo_get_attributes (GdauiDataEntry *iface)
static gboolean
-gdaui_entry_combo_expand_in_layout (GdauiDataEntry *iface)
+gdaui_entry_combo_can_expand (GdauiDataEntry *iface, gboolean horiz)
{
GdauiEntryCombo *combo;
diff --git a/libgda-ui/data-entries/gdaui-entry-common-time.c b/libgda-ui/data-entries/gdaui-entry-common-time.c
index 560391f..67c4fab 100644
--- a/libgda-ui/data-entries/gdaui-entry-common-time.c
+++ b/libgda-ui/data-entries/gdaui-entry-common-time.c
@@ -59,7 +59,7 @@ static GtkWidget *create_entry (GdauiEntryWrapper *mgwrap);
static void real_set_value (GdauiEntryWrapper *mgwrap, const GValue *value);
static GValue *real_get_value (GdauiEntryWrapper *mgwrap);
static void connect_signals(GdauiEntryWrapper *mgwrap, GCallback modify_cb, GCallback activate_cb);
-static gboolean expand_in_layout (GdauiEntryWrapper *mgwrap);
+static gboolean can_expand (GdauiEntryWrapper *mgwrap, gboolean horiz);
static void set_editable (GdauiEntryWrapper *mgwrap, gboolean editable);
static void grab_focus (GdauiEntryWrapper *mgwrap);
@@ -137,7 +137,7 @@ gdaui_entry_common_time_class_init (GdauiEntryCommonTimeClass * class)
GDAUI_ENTRY_WRAPPER_CLASS (class)->real_set_value = real_set_value;
GDAUI_ENTRY_WRAPPER_CLASS (class)->real_get_value = real_get_value;
GDAUI_ENTRY_WRAPPER_CLASS (class)->connect_signals = connect_signals;
- GDAUI_ENTRY_WRAPPER_CLASS (class)->expand_in_layout = expand_in_layout;
+ GDAUI_ENTRY_WRAPPER_CLASS (class)->can_expand = can_expand;
GDAUI_ENTRY_WRAPPER_CLASS (class)->set_editable = set_editable;
GDAUI_ENTRY_WRAPPER_CLASS (class)->grab_focus = grab_focus;
@@ -510,7 +510,7 @@ connect_signals (GdauiEntryWrapper *mgwrap, GCallback modify_cb, GCallback activ
}
static gboolean
-expand_in_layout (GdauiEntryWrapper *mgwrap)
+can_expand (GdauiEntryWrapper *mgwrap, gboolean horiz)
{
return FALSE;
}
diff --git a/libgda-ui/data-entries/gdaui-entry-none.c b/libgda-ui/data-entries/gdaui-entry-none.c
index a82c514..17017fc 100644
--- a/libgda-ui/data-entries/gdaui-entry-none.c
+++ b/libgda-ui/data-entries/gdaui-entry-none.c
@@ -35,7 +35,7 @@ static GtkWidget *create_entry (GdauiEntryWrapper *mgwrap);
static void real_set_value (GdauiEntryWrapper *mgwrap, const GValue *value);
static GValue *real_get_value (GdauiEntryWrapper *mgwrap);
static void connect_signals(GdauiEntryWrapper *mgwrap, GCallback modify_cb, GCallback activate_cb);
-static gboolean expand_in_layout (GdauiEntryWrapper *mgwrap);
+static gboolean can_expand (GdauiEntryWrapper *mgwrap, gboolean horiz);
/* get a pointer to the parents to be able to call their destructor */
@@ -85,7 +85,7 @@ gdaui_entry_none_class_init (GdauiEntryNoneClass * class)
GDAUI_ENTRY_WRAPPER_CLASS (class)->real_set_value = real_set_value;
GDAUI_ENTRY_WRAPPER_CLASS (class)->real_get_value = real_get_value;
GDAUI_ENTRY_WRAPPER_CLASS (class)->connect_signals = connect_signals;
- GDAUI_ENTRY_WRAPPER_CLASS (class)->expand_in_layout = expand_in_layout;
+ GDAUI_ENTRY_WRAPPER_CLASS (class)->can_expand = can_expand;
}
static void
@@ -223,7 +223,7 @@ connect_signals(GdauiEntryWrapper *mgwrap, GCallback modify_cb, GCallback activa
}
static gboolean
-expand_in_layout (GdauiEntryWrapper *mgwrap)
+can_expand (GdauiEntryWrapper *mgwrap, gboolean horiz)
{
return FALSE;
}
diff --git a/libgda-ui/data-entries/gdaui-entry-number.c b/libgda-ui/data-entries/gdaui-entry-number.c
index 4bc128a..a81f0b3 100644
--- a/libgda-ui/data-entries/gdaui-entry-number.c
+++ b/libgda-ui/data-entries/gdaui-entry-number.c
@@ -59,7 +59,7 @@ static GtkWidget *create_entry (GdauiEntryWrapper *mgwrap);
static void real_set_value (GdauiEntryWrapper *mgwrap, const GValue *value);
static GValue *real_get_value (GdauiEntryWrapper *mgwrap);
static void connect_signals(GdauiEntryWrapper *mgwrap, GCallback modify_cb, GCallback activate_cb);
-static gboolean expand_in_layout (GdauiEntryWrapper *mgwrap);
+static gboolean can_expand (GdauiEntryWrapper *mgwrap, gboolean horiz);
static void set_editable (GdauiEntryWrapper *mgwrap, gboolean editable);
static void grab_focus (GdauiEntryWrapper *mgwrap);
@@ -132,7 +132,7 @@ gdaui_entry_number_class_init (GdauiEntryNumberClass * klass)
GDAUI_ENTRY_WRAPPER_CLASS (klass)->real_set_value = real_set_value;
GDAUI_ENTRY_WRAPPER_CLASS (klass)->real_get_value = real_get_value;
GDAUI_ENTRY_WRAPPER_CLASS (klass)->connect_signals = connect_signals;
- GDAUI_ENTRY_WRAPPER_CLASS (klass)->expand_in_layout = expand_in_layout;
+ GDAUI_ENTRY_WRAPPER_CLASS (klass)->can_expand = can_expand;
GDAUI_ENTRY_WRAPPER_CLASS (klass)->set_editable = set_editable;
GDAUI_ENTRY_WRAPPER_CLASS (klass)->grab_focus = grab_focus;
@@ -384,7 +384,7 @@ connect_signals (GdauiEntryWrapper *mgwrap, GCallback modify_cb, GCallback activ
}
static gboolean
-expand_in_layout (GdauiEntryWrapper *mgwrap)
+can_expand (GdauiEntryWrapper *mgwrap, gboolean horiz)
{
return FALSE;
}
diff --git a/libgda-ui/data-entries/gdaui-entry-string.c b/libgda-ui/data-entries/gdaui-entry-string.c
index 46aef3d..a23801e 100644
--- a/libgda-ui/data-entries/gdaui-entry-string.c
+++ b/libgda-ui/data-entries/gdaui-entry-string.c
@@ -63,7 +63,7 @@ static GtkWidget *create_entry (GdauiEntryWrapper *mgwrap);
static void real_set_value (GdauiEntryWrapper *mgwrap, const GValue *value);
static GValue *real_get_value (GdauiEntryWrapper *mgwrap);
static void connect_signals(GdauiEntryWrapper *mgwrap, GCallback modify_cb, GCallback activate_cb);
-static gboolean expand_in_layout (GdauiEntryWrapper *mgwrap);
+static gboolean can_expand (GdauiEntryWrapper *mgwrap, gboolean horiz);
static void set_editable (GdauiEntryWrapper *mgwrap, gboolean editable);
static void grab_focus (GdauiEntryWrapper *mgwrap);
@@ -142,7 +142,7 @@ gdaui_entry_string_class_init (GdauiEntryStringClass * klass)
GDAUI_ENTRY_WRAPPER_CLASS (klass)->real_set_value = real_set_value;
GDAUI_ENTRY_WRAPPER_CLASS (klass)->real_get_value = real_get_value;
GDAUI_ENTRY_WRAPPER_CLASS (klass)->connect_signals = connect_signals;
- GDAUI_ENTRY_WRAPPER_CLASS (klass)->expand_in_layout = expand_in_layout;
+ GDAUI_ENTRY_WRAPPER_CLASS (klass)->can_expand = can_expand;
GDAUI_ENTRY_WRAPPER_CLASS (klass)->set_editable = set_editable;
GDAUI_ENTRY_WRAPPER_CLASS (klass)->grab_focus = grab_focus;
@@ -509,7 +509,7 @@ connect_signals(GdauiEntryWrapper *mgwrap, GCallback modify_cb, GCallback activa
}
static gboolean
-expand_in_layout (GdauiEntryWrapper *mgwrap)
+can_expand (GdauiEntryWrapper *mgwrap, gboolean horiz)
{
GdauiEntryString *mgstr;
diff --git a/libgda-ui/data-entries/gdaui-entry-wrapper.c b/libgda-ui/data-entries/gdaui-entry-wrapper.c
index 5ef8004..7b5d4a6 100644
--- a/libgda-ui/data-entries/gdaui-entry-wrapper.c
+++ b/libgda-ui/data-entries/gdaui-entry-wrapper.c
@@ -53,7 +53,7 @@ static void gdaui_entry_wrapper_set_value_default (GdauiDataEntry *de
static void gdaui_entry_wrapper_set_attributes (GdauiDataEntry *de, GdaValueAttribute attrs, guint mask);
static GdaValueAttribute gdaui_entry_wrapper_get_attributes (GdauiDataEntry *de);
static GdaDataHandler *gdaui_entry_wrapper_get_handler (GdauiDataEntry *de);
-static gboolean gdaui_entry_wrapper_expand_in_layout (GdauiDataEntry *de);
+static gboolean gdaui_entry_wrapper_can_expand (GdauiDataEntry *de, gboolean horiz);
static void gdaui_entry_wrapper_set_editable (GdauiDataEntry *de, gboolean editable);
static gboolean gdaui_entry_wrapper_get_editable (GdauiDataEntry *de);
static void gdaui_entry_wrapper_grab_focus (GdauiDataEntry *de);
@@ -132,7 +132,7 @@ gdaui_entry_wrapper_data_entry_init (GdauiDataEntryIface *iface)
iface->set_attributes = gdaui_entry_wrapper_set_attributes;
iface->get_attributes = gdaui_entry_wrapper_get_attributes;
iface->get_handler = gdaui_entry_wrapper_get_handler;
- iface->expand_in_layout = gdaui_entry_wrapper_expand_in_layout;
+ iface->can_expand = gdaui_entry_wrapper_can_expand;
iface->set_editable = gdaui_entry_wrapper_set_editable;
iface->get_editable = gdaui_entry_wrapper_get_editable;
iface->grab_focus = gdaui_entry_wrapper_grab_focus;
@@ -190,8 +190,8 @@ check_correct_init (GdauiEntryWrapper *mgwrap)
G_OBJECT_TYPE_NAME (mgwrap));
class_impl_error = TRUE;
}
- if (! klass->expand_in_layout) {
- g_warning ("expand_in_layout () virtual function not implemented for object class %s\n",
+ if (! klass->can_expand) {
+ g_warning ("can_expand () virtual function not implemented for object class %s\n",
G_OBJECT_TYPE_NAME (mgwrap));
class_impl_error = TRUE;
}
@@ -819,7 +819,7 @@ gdaui_entry_wrapper_get_handler (GdauiDataEntry *iface)
}
static gboolean
-gdaui_entry_wrapper_expand_in_layout (GdauiDataEntry *iface)
+gdaui_entry_wrapper_can_expand (GdauiDataEntry *iface, gboolean horiz)
{
GdauiEntryWrapper *mgwrap;
@@ -827,7 +827,7 @@ gdaui_entry_wrapper_expand_in_layout (GdauiDataEntry *iface)
mgwrap = (GdauiEntryWrapper*) iface;
check_correct_init (mgwrap);
- return (mgwrap->priv->real_class->expand_in_layout) (mgwrap);
+ return (mgwrap->priv->real_class->can_expand) (mgwrap, horiz);
}
static void
diff --git a/libgda-ui/data-entries/gdaui-entry-wrapper.h b/libgda-ui/data-entries/gdaui-entry-wrapper.h
index c329205..f068fe9 100644
--- a/libgda-ui/data-entries/gdaui-entry-wrapper.h
+++ b/libgda-ui/data-entries/gdaui-entry-wrapper.h
@@ -56,7 +56,7 @@ struct _GdauiEntryWrapperClass
void (*real_set_value) (GdauiEntryWrapper *mgwrp, const GValue *value);
GValue *(*real_get_value) (GdauiEntryWrapper *mgwrp);
void (*connect_signals) (GdauiEntryWrapper *mgwrp, GCallback modify_cb, GCallback activate_cb);
- gboolean (*expand_in_layout) (GdauiEntryWrapper *mgwrp);
+ gboolean (*can_expand) (GdauiEntryWrapper *mgwrp, gboolean horiz);
void (*set_editable) (GdauiEntryWrapper *mgwrp, gboolean editable);
gboolean (*value_is_equal_to)(GdauiEntryWrapper *mgwrp, const GValue *value);
diff --git a/libgda-ui/data-entries/plugins/gdaui-entry-cgrid.c b/libgda-ui/data-entries/plugins/gdaui-entry-cgrid.c
index cf82d07..0dc8dbd 100644
--- a/libgda-ui/data-entries/plugins/gdaui-entry-cgrid.c
+++ b/libgda-ui/data-entries/plugins/gdaui-entry-cgrid.c
@@ -1,6 +1,7 @@
/* gdaui-entry-cgrid.c
*
* Copyright (C) 2007 - 2007 Carlos Savoretti
+ * Copyright (C) 2010 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
@@ -117,15 +118,14 @@ get_row_height (GdauiEntryCGrid *cgrid)
GList *columns = gtk_tree_view_get_columns (GTK_TREE_VIEW(cgrid->priv->tree_view));
- GList *current = columns;
- while (current) {
- GList *renderers = gtk_tree_view_column_get_cell_renderers
- ((GtkTreeViewColumn *) current->data);
+ GList *current;
+ for (current = columns; current; current = current->next) {
+ GList *renderers = gtk_cell_layout_get_cells ((GtkCellLayout *) current->data);
guint cell_height = 0;
- GList *current1 = renderers;
- while (current1) {
+ GList *current1;
+ for (current1 = renderers; current1; current1 = current1->next) {
GtkCellRenderer *renderer = (GtkCellRenderer *) current1->data;
gint height;
@@ -134,16 +134,11 @@ get_row_height (GdauiEntryCGrid *cgrid)
if (height > cell_height)
cell_height = height;
-
- current1 = g_list_next (current1);
}
-
g_list_free (renderers);
if (cell_height > row_height)
row_height = cell_height;
-
- current = g_list_next (current);
}
g_list_free (columns);
@@ -801,19 +796,18 @@ connect_signals (GdauiEntryWrapper *entry_wrapper,
}
static gboolean
-expand_in_layout (GdauiEntryWrapper *entry_wrapper)
+can_expand (GdauiEntryWrapper *mgwrap, gboolean horiz)
{
- g_return_val_if_fail (GDAUI_IS_ENTRY_CGRID(entry_wrapper), FALSE);
+ g_return_val_if_fail (GDAUI_IS_ENTRY_CGRID (mgwrap), FALSE);
return FALSE;
}
static void
-set_editable (GdauiEntryWrapper *entry_wrapper,
- gboolean editable)
+set_editable (GdauiEntryWrapper *entry_wrapper, gboolean editable)
{
- g_return_if_fail (GDAUI_IS_ENTRY_CGRID(entry_wrapper));
+ g_return_if_fail (GDAUI_IS_ENTRY_CGRID (entry_wrapper));
- GdauiEntryCGrid *cgrid = GDAUI_ENTRY_CGRID(entry_wrapper);
+ GdauiEntryCGrid *cgrid = GDAUI_ENTRY_CGRID (entry_wrapper);
gtk_entry_set_editable (GTK_ENTRY(cgrid->priv->entry), editable);
}
@@ -831,7 +825,7 @@ gdaui_entry_cgrid_class_init (GdauiEntryCGridClass *klass)
wrapper_class->real_set_value = real_set_value;
wrapper_class->real_get_value = real_get_value;
wrapper_class->connect_signals = connect_signals;
- wrapper_class->expand_in_layout = expand_in_layout;
+ wrapper_class->can_expand = can_expand;
wrapper_class->set_editable = set_editable;
diff --git a/libgda-ui/data-entries/plugins/gdaui-entry-cidr.c b/libgda-ui/data-entries/plugins/gdaui-entry-cidr.c
index 0666505..b945123 100644
--- a/libgda-ui/data-entries/plugins/gdaui-entry-cidr.c
+++ b/libgda-ui/data-entries/plugins/gdaui-entry-cidr.c
@@ -37,7 +37,7 @@ static GtkWidget *create_entry (GdauiEntryWrapper *mgwrap);
static void real_set_value (GdauiEntryWrapper *mgwrap, const GValue *value);
static GValue *real_get_value (GdauiEntryWrapper *mgwrap);
static void connect_signals(GdauiEntryWrapper *mgwrap, GCallback modify_cb, GCallback activate_cb);
-static gboolean expand_in_layout (GdauiEntryWrapper *mgwrap);
+static gboolean can_expand (GdauiEntryWrapper *mgwrap, gboolean horiz);
/* get a pointer to the parents to be able to call their destructor */
static GObjectClass *parent_class = NULL;
@@ -102,7 +102,7 @@ gdaui_entry_cidr_class_init (GdauiEntryCidrClass * class)
GDAUI_ENTRY_WRAPPER_CLASS (class)->real_set_value = real_set_value;
GDAUI_ENTRY_WRAPPER_CLASS (class)->real_get_value = real_get_value;
GDAUI_ENTRY_WRAPPER_CLASS (class)->connect_signals = connect_signals;
- GDAUI_ENTRY_WRAPPER_CLASS (class)->expand_in_layout = expand_in_layout;
+ GDAUI_ENTRY_WRAPPER_CLASS (class)->can_expand = can_expand;
}
static void
@@ -594,7 +594,7 @@ connect_signals(GdauiEntryWrapper *mgwrap, GCallback modify_cb, GCallback activa
}
static gboolean
-expand_in_layout (GdauiEntryWrapper *mgwrap)
+can_expand (GdauiEntryWrapper *mgwrap, gboolean horiz)
{
return FALSE;
}
diff --git a/libgda-ui/data-entries/plugins/gdaui-entry-filesel.c b/libgda-ui/data-entries/plugins/gdaui-entry-filesel.c
index d5ca8b9..ed6cb42 100644
--- a/libgda-ui/data-entries/plugins/gdaui-entry-filesel.c
+++ b/libgda-ui/data-entries/plugins/gdaui-entry-filesel.c
@@ -35,7 +35,7 @@ static GtkWidget *create_entry (GdauiEntryWrapper *mgwrap);
static void real_set_value (GdauiEntryWrapper *mgwrap, const GValue *value);
static GValue *real_get_value (GdauiEntryWrapper *mgwrap);
static void connect_signals(GdauiEntryWrapper *mgwrap, GCallback modify_cb, GCallback activate_cb);
-static gboolean expand_in_layout (GdauiEntryWrapper *mgwrap);
+static gboolean can_expand (GdauiEntryWrapper *mgwrap, gboolean horiz);
static void set_editable (GdauiEntryWrapper *mgwrap, gboolean editable);
/* get a pointer to the parents to be able to call their destructor */
@@ -86,7 +86,7 @@ gdaui_entry_filesel_class_init (GdauiEntryFileselClass * class)
GDAUI_ENTRY_WRAPPER_CLASS (class)->real_set_value = real_set_value;
GDAUI_ENTRY_WRAPPER_CLASS (class)->real_get_value = real_get_value;
GDAUI_ENTRY_WRAPPER_CLASS (class)->connect_signals = connect_signals;
- GDAUI_ENTRY_WRAPPER_CLASS (class)->expand_in_layout = expand_in_layout;
+ GDAUI_ENTRY_WRAPPER_CLASS (class)->can_expand = can_expand;
GDAUI_ENTRY_WRAPPER_CLASS (class)->set_editable = set_editable;
}
@@ -314,7 +314,7 @@ connect_signals(GdauiEntryWrapper *mgwrap, GCallback modify_cb, GCallback activa
}
static gboolean
-expand_in_layout (GdauiEntryWrapper *mgwrap)
+can_expand (GdauiEntryWrapper *mgwrap, gboolean horiz)
{
return FALSE;
}
diff --git a/libgda-ui/data-entries/plugins/gdaui-entry-password.c b/libgda-ui/data-entries/plugins/gdaui-entry-password.c
index 77fe19a..c53d883 100644
--- a/libgda-ui/data-entries/plugins/gdaui-entry-password.c
+++ b/libgda-ui/data-entries/plugins/gdaui-entry-password.c
@@ -35,7 +35,7 @@ static GtkWidget *create_entry (GdauiEntryWrapper *mgwrap);
static void real_set_value (GdauiEntryWrapper *mgwrap, const GValue *value);
static GValue *real_get_value (GdauiEntryWrapper *mgwrap);
static void connect_signals(GdauiEntryWrapper *mgwrap, GCallback modify_cb, GCallback activate_cb);
-static gboolean expand_in_layout (GdauiEntryWrapper *mgwrap);
+static gboolean can_expand (GdauiEntryWrapper *mgwrap, gboolean horiz);
static void signal_handlers_block (GdauiEntryPassword *mgstr);
static void signal_handlers_unblock (GdauiEntryPassword *mgstr);
@@ -94,7 +94,7 @@ gdaui_entry_password_class_init (GdauiEntryPasswordClass * class)
GDAUI_ENTRY_WRAPPER_CLASS (class)->real_set_value = real_set_value;
GDAUI_ENTRY_WRAPPER_CLASS (class)->real_get_value = real_get_value;
GDAUI_ENTRY_WRAPPER_CLASS (class)->connect_signals = connect_signals;
- GDAUI_ENTRY_WRAPPER_CLASS (class)->expand_in_layout = expand_in_layout;
+ GDAUI_ENTRY_WRAPPER_CLASS (class)->can_expand = can_expand;
}
static void
@@ -298,7 +298,7 @@ connect_signals(GdauiEntryWrapper *mgwrap, GCallback modify_cb, GCallback activa
}
static gboolean
-expand_in_layout (GdauiEntryWrapper *mgwrap)
+can_expand (GdauiEntryWrapper *mgwrap, gboolean horiz)
{
return FALSE;
}
diff --git a/libgda-ui/data-entries/plugins/gdaui-entry-pict.c b/libgda-ui/data-entries/plugins/gdaui-entry-pict.c
index 08d7801..16cd2bc 100644
--- a/libgda-ui/data-entries/plugins/gdaui-entry-pict.c
+++ b/libgda-ui/data-entries/plugins/gdaui-entry-pict.c
@@ -45,7 +45,7 @@ static GtkWidget *create_entry (GdauiEntryWrapper *mgwrap);
static void real_set_value (GdauiEntryWrapper *mgwrap, const GValue *value);
static GValue *real_get_value (GdauiEntryWrapper *mgwrap);
static void connect_signals(GdauiEntryWrapper *mgwrap, GCallback modify_cb, GCallback activate_cb);
-static gboolean expand_in_layout (GdauiEntryWrapper *mgwrap);
+static gboolean can_expand (GdauiEntryWrapper *mgwrap, gboolean horiz);
static void set_editable (GdauiEntryWrapper *mgwrap, gboolean editable);
static gboolean value_is_equal_to (GdauiEntryWrapper *mgwrap, const GValue *value);
static gboolean value_is_null (GdauiEntryWrapper *mgwrap);
@@ -105,7 +105,7 @@ gdaui_entry_pict_class_init (GdauiEntryPictClass * class)
GDAUI_ENTRY_WRAPPER_CLASS (class)->real_set_value = real_set_value;
GDAUI_ENTRY_WRAPPER_CLASS (class)->real_get_value = real_get_value;
GDAUI_ENTRY_WRAPPER_CLASS (class)->connect_signals = connect_signals;
- GDAUI_ENTRY_WRAPPER_CLASS (class)->expand_in_layout = expand_in_layout;
+ GDAUI_ENTRY_WRAPPER_CLASS (class)->can_expand = can_expand;
GDAUI_ENTRY_WRAPPER_CLASS (class)->set_editable = set_editable;
GDAUI_ENTRY_WRAPPER_CLASS (class)->value_is_equal_to = value_is_equal_to;
GDAUI_ENTRY_WRAPPER_CLASS (class)->value_is_null = value_is_null;
@@ -446,7 +446,7 @@ connect_signals(GdauiEntryWrapper *mgwrap, GCallback modify_cb, GCallback activa
}
static gboolean
-expand_in_layout (GdauiEntryWrapper *mgwrap)
+can_expand (GdauiEntryWrapper *mgwrap, gboolean horiz)
{
return TRUE;
}
diff --git a/libgda-ui/data-entries/plugins/gdaui-entry-text.c b/libgda-ui/data-entries/plugins/gdaui-entry-text.c
index 3fef9c6..fb93dc0 100644
--- a/libgda-ui/data-entries/plugins/gdaui-entry-text.c
+++ b/libgda-ui/data-entries/plugins/gdaui-entry-text.c
@@ -50,7 +50,7 @@ static GtkWidget *create_entry (GdauiEntryWrapper *mgwrap);
static void real_set_value (GdauiEntryWrapper *mgwrap, const GValue *value);
static GValue *real_get_value (GdauiEntryWrapper *mgwrap);
static void connect_signals(GdauiEntryWrapper *mgwrap, GCallback modify_cb, GCallback activate_cb);
-static gboolean expand_in_layout (GdauiEntryWrapper *mgwrap);
+static gboolean can_expand (GdauiEntryWrapper *mgwrap, gboolean horiz);
static void set_editable (GdauiEntryWrapper *mgwrap, gboolean editable);
/* get a pointer to the parents to be able to call their destructor */
@@ -102,7 +102,7 @@ gdaui_entry_text_class_init (GdauiEntryTextClass * class)
GDAUI_ENTRY_WRAPPER_CLASS (class)->real_set_value = real_set_value;
GDAUI_ENTRY_WRAPPER_CLASS (class)->real_get_value = real_get_value;
GDAUI_ENTRY_WRAPPER_CLASS (class)->connect_signals = connect_signals;
- GDAUI_ENTRY_WRAPPER_CLASS (class)->expand_in_layout = expand_in_layout;
+ GDAUI_ENTRY_WRAPPER_CLASS (class)->can_expand = can_expand;
GDAUI_ENTRY_WRAPPER_CLASS (class)->set_editable = set_editable;
}
@@ -396,7 +396,7 @@ connect_signals(GdauiEntryWrapper *mgwrap, GCallback modify_cb, GCallback activa
}
static gboolean
-expand_in_layout (GdauiEntryWrapper *mgwrap)
+can_expand (GdauiEntryWrapper *mgwrap, gboolean horiz)
{
return TRUE;
}
diff --git a/libgda-ui/gdaui-basic-form.c b/libgda-ui/gdaui-basic-form.c
index 2fd20dd..7f9a870 100644
--- a/libgda-ui/gdaui-basic-form.c
+++ b/libgda-ui/gdaui-basic-form.c
@@ -129,7 +129,7 @@ enum {
PROP_HEADERS_SENSITIVE,
PROP_SHOW_ACTIONS,
PROP_ENTRIES_AUTO_DEFAULT,
- PROP_CAN_EXPAND
+ PROP_CAN_VEXPAND
};
typedef struct {
@@ -275,9 +275,9 @@ gdaui_basic_form_class_init (GdauiBasicFormClass * class)
_("Entries Auto-default"),
NULL, FALSE,
G_PARAM_READABLE | G_PARAM_WRITABLE));
- g_object_class_install_property (object_class, PROP_CAN_EXPAND,
- g_param_spec_boolean ("can-expand",
- _("TRUE if expanding the form makes sense"),
+ g_object_class_install_property (object_class, PROP_CAN_VEXPAND,
+ g_param_spec_boolean ("can-expand-v",
+ _("TRUE if expanding the form vertically makes sense"),
NULL, FALSE,
G_PARAM_READABLE));
@@ -548,7 +548,7 @@ gdaui_basic_form_get_property (GObject *object,
case PROP_ENTRIES_AUTO_DEFAULT:
g_value_set_boolean (value, form->priv->entries_auto_default);
break;
- case PROP_CAN_EXPAND: {
+ case PROP_CAN_VEXPAND: {
gboolean can_expand = FALSE;
GSList *list;
for (list = form->priv->s_entries; list; list = list->next) {
@@ -910,7 +910,7 @@ static void
pack_entry_widget (SingleEntry *sentry)
{
gboolean expand;
- expand = gdaui_data_entry_expand_in_layout (GDAUI_DATA_ENTRY (sentry->entry));
+ expand = gdaui_data_entry_can_expand (GDAUI_DATA_ENTRY (sentry->entry), FALSE);
sentry->can_expand = expand;
switch (sentry->packing_type) {
@@ -1934,7 +1934,7 @@ gdaui_basic_form_new_in_dialog (GdaSet *data_set, GtkWindow *parent,
gboolean can_expand;
- g_object_get ((GObject*) form, "can-expand", &can_expand, NULL);
+ g_object_get ((GObject*) form, "can-expand-v", &can_expand, NULL);
#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,
diff --git a/libgda-ui/gdaui-data-entry.c b/libgda-ui/gdaui-data-entry.c
index 608a124..5ba31d7 100644
--- a/libgda-ui/gdaui-data-entry.c
+++ b/libgda-ui/gdaui-data-entry.c
@@ -394,22 +394,24 @@ gdaui_data_entry_get_handler (GdauiDataEntry *de)
}
/**
- * gdaui_data_entry_expand_in_layout
+ * gdaui_data_entry_can_expand
* @de: a #GtkWidget object which implements the #GdauiDataEntry interface
+ * @horiz: %TRUE to query horizontal expansion requirements, or %FALSE for vertical
*
- * Used for the layout of the widget in containers.
+ * Used for the layout of #GdaDataEntry widgets in containers: queries if @de requires
+ * horizontal or vertical expansion, depending on @horiz
*
- * Returns: TRUE if the widget should expand
+ * Returns: TRUE if the widget requires expansion
*
* Since: 4.2
*/
gboolean
-gdaui_data_entry_expand_in_layout (GdauiDataEntry *de)
+gdaui_data_entry_can_expand (GdauiDataEntry *de, gboolean horiz)
{
g_return_val_if_fail (GDAUI_IS_DATA_ENTRY (de), FALSE);
- if (GDAUI_DATA_ENTRY_GET_IFACE (de)->expand_in_layout)
- return (GDAUI_DATA_ENTRY_GET_IFACE (de)->expand_in_layout) (de);
+ if (GDAUI_DATA_ENTRY_GET_IFACE (de)->can_expand)
+ return (GDAUI_DATA_ENTRY_GET_IFACE (de)->can_expand) (de, horiz);
else
return FALSE;
}
diff --git a/libgda-ui/gdaui-data-entry.h b/libgda-ui/gdaui-data-entry.h
index 18a173d..562333b 100644
--- a/libgda-ui/gdaui-data-entry.h
+++ b/libgda-ui/gdaui-data-entry.h
@@ -58,7 +58,7 @@ struct _GdauiDataEntryIface
void (*set_attributes) (GdauiDataEntry *de, GdaValueAttribute attrs, GdaValueAttribute mask);
GdaValueAttribute (*get_attributes) (GdauiDataEntry *de);
GdaDataHandler *(*get_handler) (GdauiDataEntry *de);
- gboolean (*expand_in_layout) (GdauiDataEntry *de);
+ gboolean (*can_expand) (GdauiDataEntry *de, gboolean horiz);
void (*set_editable) (GdauiDataEntry *de, gboolean editable);
gboolean (*get_editable) (GdauiDataEntry *de);
void (*grab_focus) (GdauiDataEntry *de);
@@ -94,22 +94,11 @@ void gdaui_data_entry_set_attributes (GdauiDataEntry *de, Gda
GdaValueAttribute gdaui_data_entry_get_attributes (GdauiDataEntry *de);
GdaDataHandler *gdaui_data_entry_get_handler (GdauiDataEntry *de);
-gboolean gdaui_data_entry_expand_in_layout (GdauiDataEntry *de);
+gboolean gdaui_data_entry_can_expand (GdauiDataEntry *de, gboolean horiz);
void gdaui_data_entry_set_editable (GdauiDataEntry *de, gboolean editable);
gboolean gdaui_data_entry_get_editable (GdauiDataEntry *de);
void gdaui_data_entry_grab_focus (GdauiDataEntry *de);
-/* TO remove and replace with properties:
- * gdaui_data_entry_expand_in_layout
- * gdaui_data_entry_get_handler
- * gdaui_data_entry_set_attributes
- * gdaui_data_entry_get_attributes
- * gdaui_data_entry_set_value_default
- *
- * Don't replace at all:
- * gdaui_data_entry_grab_focus
- */
-
G_END_DECLS
#endif
diff --git a/libgda-ui/gdaui-form.c b/libgda-ui/gdaui-form.c
index da7c50b..bb38310 100644
--- a/libgda-ui/gdaui-form.c
+++ b/libgda-ui/gdaui-form.c
@@ -172,7 +172,7 @@ static void
form_layout_changed_cb (GdauiBasicForm *raw_form, GdauiForm *form)
{
gboolean expand;
- g_object_get (G_OBJECT (form->priv->raw_form), "can-expand", &expand, NULL);
+ g_object_get (G_OBJECT (form->priv->raw_form), "can-expand-v", &expand, NULL);
gtk_container_child_set (GTK_CONTAINER (form), form->priv->raw_form,
"expand", expand, "fill", expand, NULL);
gtk_widget_queue_resize ((GtkWidget*) form);
@@ -240,7 +240,7 @@ gdaui_form_set_property (GObject *object,
gboolean expand;
model = GDA_DATA_MODEL (g_value_get_object (value));
g_object_set (G_OBJECT (form->priv->raw_form), "model", model, NULL);
- g_object_get (G_OBJECT (form->priv->raw_form), "can-expand", &expand, NULL);
+ g_object_get (G_OBJECT (form->priv->raw_form), "can-expand-v", &expand, NULL);
gtk_container_child_set (GTK_CONTAINER (form), form->priv->raw_form,
"expand", expand, "fill", expand, NULL);
gtk_widget_queue_resize ((GtkWidget*) form);
diff --git a/testing/gdaui-test-data-entries.c b/testing/gdaui-test-data-entries.c
index ca8fb06..a29c0ec 100644
--- a/testing/gdaui-test-data-entries.c
+++ b/testing/gdaui-test-data-entries.c
@@ -684,7 +684,7 @@ build_basic_test_for_gtype (GdaDataHandler *dh, GType type, const gchar *plugin_
wid = GTK_WIDGET (gdaui_new_data_entry (type, plugin_name));
g_object_set (G_OBJECT (wid), "handler", dh, NULL);
- expand = gdaui_data_entry_expand_in_layout (GDAUI_DATA_ENTRY (wid));
+ expand = gdaui_data_entry_can_expand (GDAUI_DATA_ENTRY (wid), FALSE);
if (expand)
gtk_table_attach_defaults (GTK_TABLE (table), wid, 0, 3, 1, 2);
else
diff --git a/tools/browser/common/gdaui-entry-import.c b/tools/browser/common/gdaui-entry-import.c
index af5006f..d743077 100644
--- a/tools/browser/common/gdaui-entry-import.c
+++ b/tools/browser/common/gdaui-entry-import.c
@@ -1,6 +1,6 @@
/* gdaui-entry-import.c
*
- * Copyright (C) 2009 Vivien Malerba
+ * Copyright (C) 2009 - 2010 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
@@ -36,7 +36,7 @@ static GtkWidget *create_entry (GdauiEntryWrapper *mgwrap);
static void real_set_value (GdauiEntryWrapper *mgwrap, const GValue *value);
static GValue *real_get_value (GdauiEntryWrapper *mgwrap);
static void connect_signals(GdauiEntryWrapper *mgwrap, GCallback modify_cb, GCallback activate_cb);
-static gboolean expand_in_layout (GdauiEntryWrapper *mgwrap);
+static gboolean can_expand (GdauiEntryWrapper *mgwrap, gboolean horiz);
/* get a pointer to the parents to be able to call their destructor */
static GObjectClass *parent_class = NULL;
@@ -88,7 +88,7 @@ gdaui_entry_import_class_init (GdauiEntryImportClass * class)
GDAUI_ENTRY_WRAPPER_CLASS (class)->real_set_value = real_set_value;
GDAUI_ENTRY_WRAPPER_CLASS (class)->real_get_value = real_get_value;
GDAUI_ENTRY_WRAPPER_CLASS (class)->connect_signals = connect_signals;
- GDAUI_ENTRY_WRAPPER_CLASS (class)->expand_in_layout = expand_in_layout;
+ GDAUI_ENTRY_WRAPPER_CLASS (class)->can_expand = can_expand;
}
static void
@@ -297,7 +297,7 @@ connect_signals(GdauiEntryWrapper *mgwrap, GCallback modify_cb, GCallback activa
}
static gboolean
-expand_in_layout (GdauiEntryWrapper *mgwrap)
+can_expand (GdauiEntryWrapper *mgwrap, gboolean horiz)
{
return FALSE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]