aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table/e-table-group-container.c
diff options
context:
space:
mode:
authorMiguel de Icaza <miguel@helixcode.com>2000-04-26 22:47:10 +0800
committerMiguel de Icaza <miguel@src.gnome.org>2000-04-26 22:47:10 +0800
commit3c1ddb743e12aa5baa0e1fdab25eaddf4730b00d (patch)
tree8380806df76f23fd1b81eefa0c0b70dba9bc1a3a /widgets/table/e-table-group-container.c
parentb2ae704032d1bd7b090b99a05be8a514b7ef1ea6 (diff)
downloadgsoc2013-evolution-3c1ddb743e12aa5baa0e1fdab25eaddf4730b00d.tar
gsoc2013-evolution-3c1ddb743e12aa5baa0e1fdab25eaddf4730b00d.tar.gz
gsoc2013-evolution-3c1ddb743e12aa5baa0e1fdab25eaddf4730b00d.tar.bz2
gsoc2013-evolution-3c1ddb743e12aa5baa0e1fdab25eaddf4730b00d.tar.lz
gsoc2013-evolution-3c1ddb743e12aa5baa0e1fdab25eaddf4730b00d.tar.xz
gsoc2013-evolution-3c1ddb743e12aa5baa0e1fdab25eaddf4730b00d.tar.zst
gsoc2013-evolution-3c1ddb743e12aa5baa0e1fdab25eaddf4730b00d.zip
Add argument handling here.
2000-04-24 Miguel de Icaza <miguel@helixcode.com> * e-table.c (e_table_class_init): Add argument handling here. * e-table-group-leaf.c (e_table_group_apply_to_leafs): New method. Enables us to walk all the children of an ETableGroup. * e-table.c (et_get_arg, et_set_arg): Implement ::get and ::set methods. (e_table_construct_from_spec_file): Now we return the etable. (e_table_construct): ditto. (et_real_construct): Now we return the ETable. Returns NULL on construct failure. (e_table_new): ditto. (e_table_new_from_spec_file): ditto. * (et_build_grouping_spec): Removed vestige code that still contained references to the etable->specification XML code. Dumped all the ifdefed out code. * e-table.h: Removed ETable->specification finally. svn path=/trunk/; revision=2632
Diffstat (limited to 'widgets/table/e-table-group-container.c')
-rw-r--r--widgets/table/e-table-group-container.c39
1 files changed, 29 insertions, 10 deletions
diff --git a/widgets/table/e-table-group-container.c b/widgets/table/e-table-group-container.c
index f660cd01c3..ac93cecc69 100644
--- a/widgets/table/e-table-group-container.c
+++ b/widgets/table/e-table-group-container.c
@@ -12,6 +12,7 @@
#include <config.h>
#include <gtk/gtksignal.h>
#include "e-table-group-container.h"
+#include "e-table-group-leaf.h"
#include "e-table-item.h"
#include <libgnomeui/gnome-canvas-rect-ellipse.h>
#include "e-util/e-util.h"
@@ -81,19 +82,19 @@ etgc_destroy (GtkObject *object)
{
ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (object);
- if (etgc->font){
+ if (etgc->font)
gdk_font_unref (etgc->font);
etgc->font = NULL;
- }
- if (etgc->ecol){
+
+ if (etgc->ecol)
gtk_object_unref (GTK_OBJECT(etgc->ecol));
- }
- if (etgc->sort_info){
+
+ if (etgc->sort_info)
gtk_object_unref (GTK_OBJECT(etgc->sort_info));
- }
- if (etgc->rect){
+
+ if (etgc->rect)
gtk_object_destroy (GTK_OBJECT(etgc->rect));
- }
+
e_table_group_container_list_free (etgc);
GTK_OBJECT_CLASS (etgc_parent_class)->destroy (object);
@@ -555,7 +556,7 @@ child_row_selection (ETableGroup *etg, int row, gboolean selected,
static void
etgc_add (ETableGroup *etg, gint row)
{
- ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER(etg);
+ ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (etg);
void *val = e_table_model_value_at (etg->model, etgc->ecol->col_idx, row);
GCompareFunc comp = etgc->ecol->compare;
GList *list = etgc->children;
@@ -565,7 +566,8 @@ etgc_add (ETableGroup *etg, gint row)
for (; list; list = g_list_next (list), i++){
int comp_val;
- child_node = (ETableGroupContainerChildNode *)(list->data);
+
+ child_node = list->data;
comp_val = (*comp)(child_node->key, val);
if (comp_val == 0) {
child = child_node->child;
@@ -881,6 +883,23 @@ etgc_init (GtkObject *object)
E_MAKE_TYPE (e_table_group_container, "ETableGroupContainer", ETableGroupContainer, etgc_class_init, etgc_init, PARENT_TYPE);
+void
+e_table_group_apply_to_leafs (ETableGroup *etg, ETableGroupLeafFn fn, void *closure)
+{
+ if (E_IS_TABLE_GROUP_CONTAINER (etg)){
+ ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (etg);
+ GList *list = etgc->children;
+ for (list = etgc->children; list; list = list->next){
+ ETableGroupContainerChildNode *child_node = list->data;
+ e_table_group_apply_to_leafs (child_node->child, fn, closure);
+ }
+ } else if (E_IS_TABLE_GROUP_LEAF (etg)){
+ (*fn) (E_TABLE_GROUP_LEAF (etg)->item, closure);
+ } else {
+ g_error ("Unknown ETableGroup found: %s",
+ gtk_type_name (GTK_OBJECT (etg)->klass->type));
+ }
+}