aboutsummaryrefslogtreecommitdiffstats
path: root/e-util
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@helixcode.com>2000-03-12 15:59:42 +0800
committerChris Lahey <clahey@src.gnome.org>2000-03-12 15:59:42 +0800
commit1f7ba945b16cd5f8c01641dd864a9671d791a651 (patch)
treeb673bc2f8f4b07554ca42cbd714ccc98efd14f9b /e-util
parentf669ff481f57cf5b609ea2e8fe30cfb8dece8587 (diff)
downloadgsoc2013-evolution-1f7ba945b16cd5f8c01641dd864a9671d791a651.tar
gsoc2013-evolution-1f7ba945b16cd5f8c01641dd864a9671d791a651.tar.gz
gsoc2013-evolution-1f7ba945b16cd5f8c01641dd864a9671d791a651.tar.bz2
gsoc2013-evolution-1f7ba945b16cd5f8c01641dd864a9671d791a651.tar.lz
gsoc2013-evolution-1f7ba945b16cd5f8c01641dd864a9671d791a651.tar.xz
gsoc2013-evolution-1f7ba945b16cd5f8c01641dd864a9671d791a651.tar.zst
gsoc2013-evolution-1f7ba945b16cd5f8c01641dd864a9671d791a651.zip
Rearranged SUBDIRS for dependencies.
2000-03-12 Christopher James Lahey <clahey@helixcode.com> * widgets/Makefile.am: Rearranged SUBDIRS for dependencies. * widgets/e-text/e-text-model.c, widgets/e-text-model.h: New object which stores a piece of text data. All methods are virtual. * widgets/e-text/e-text.c, widgets/e-text/e-text.h: Modified this to use an ETextModel for its data. * widgets/e-text/Makefile.am: Added e-text-model.c and e-text-model.h. * widgets/e-minicard/test-minicard-label.c: Made this work again. * widgets/e-minicard/e-minicard.c, widgets/e-minicard/e-minicard.h: Made this use an ETableModel to get its data. * widgets/e-minicard/e-minicard-label.c, widgets/e-minicard/e-minicard-label.h: Added the ability to set the text model used for the contained text widget. * widgets/e-minicard/Makefile.am: Added e-table since e-minicard is now dependent on an e-table-model for its data. * e-util/e-canvas.c, e-util/e-canvas.h: Fixed some bugs here to speed up reflow and to make it fail less often. * addressbook/demo, addressbook/demo/.cvsignore, addressbook/demo/Makefile.am, addressbook/demo/demo.c, addressbook/demo/spec: A new program to test ETable and EMinicard integration. * configure.in: Added addressbook/demo/Makefile. * addressbook/Makefile.am: Added the demo/ subdirectory. in widgets/e-table/: 2000-03-12 Christopher James Lahey <clahey@helixcode.com> * e-table.c: Made this use an ECanvas. Fixed a bug where e_table_new_from_spec_file was calling e_table_construct instead of e_table_construct_from_spec_file. * e-table-item.c, e-table-header-item.c, e-table-column-item.c: Switched these to use GTK_TYPE_OBJECT and GTK_VALUE_OBJECT instead of GTK_TYPE_POINTER and GTK_TYPE_OBJECT. * e-cell-text.c: Got rid of a crashing bug. * e-table-text-model.c, e-table-text-model.h: A new object which is an e-text-model which uses an e-table-model for its data. * Makefile.am: Added e-table-text-model.c and e-table-text-model.h. * .cvsignore: Added table-example-1 and table-example-2. svn path=/trunk/; revision=2101
Diffstat (limited to 'e-util')
-rw-r--r--e-util/e-canvas.c39
-rw-r--r--e-util/e-canvas.h6
2 files changed, 27 insertions, 18 deletions
diff --git a/e-util/e-canvas.c b/e-util/e-canvas.c
index 68f1b0f9f3..76b9286156 100644
--- a/e-util/e-canvas.c
+++ b/e-util/e-canvas.c
@@ -93,7 +93,7 @@ e_canvas_class_init (ECanvasClass *klass)
GTK_RUN_LAST,
object_class->type,
GTK_SIGNAL_OFFSET (ECanvasClass, reflow),
- gtk_marshal_NONE__INT_INT,
+ gtk_marshal_NONE__NONE,
GTK_TYPE_NONE, 0);
gtk_object_class_add_signals (object_class, e_canvas_signals, LAST_SIGNAL);
@@ -321,39 +321,39 @@ e_canvas_focus_out (GtkWidget *widget, GdkEventFocus *event)
static void
-e_canvas_item_invoke_update (GnomeCanvasItem *item, int flags)
+e_canvas_item_invoke_reflow (GnomeCanvasItem *item, int flags)
{
GnomeCanvasGroup *group;
GList *list;
GnomeCanvasItem *child;
- if ( ! gtk_object_get_data(GTK_OBJECT(item), "ECanvasItem::descendent_needs_reflow") )
- return;
if ( GNOME_IS_CANVAS_GROUP( item ) ) {
group = GNOME_CANVAS_GROUP( item );
for ( list = group->item_list; list; list = list->next ) {
child = GNOME_CANVAS_ITEM(list->data);
- e_canvas_item_invoke_update(child, flags);
+ if ( child->object.flags & E_CANVAS_ITEM_DESCENDENT_NEEDS_REFLOW )
+ e_canvas_item_invoke_reflow(child, flags);
}
}
-
- if ( gtk_object_get_data(GTK_OBJECT(item), "ECanvasItem::needs_reflow") ) {
+
+ if ( item->object.flags & E_CANVAS_ITEM_NEEDS_REFLOW ) {
ECanvasItemReflowFunc func = gtk_object_get_data(GTK_OBJECT(item), "ECanvasItem::reflow_callback");
if ( func )
func(item, flags);
}
- gtk_object_set_data(GTK_OBJECT(item), "ECanvasItem::needs_reflow", (gpointer) 0);
- gtk_object_set_data(GTK_OBJECT(item), "ECanvasItem::descendent_needs_reflow", (gpointer) 0);
+ item->object.flags &= ~E_CANVAS_ITEM_NEEDS_REFLOW;
+ item->object.flags &= ~E_CANVAS_ITEM_DESCENDENT_NEEDS_REFLOW;
}
static void
-do_update (ECanvas *canvas)
+do_reflow (ECanvas *canvas)
{
- e_canvas_item_invoke_update (GNOME_CANVAS(canvas)->root, 0);
+ if ( GNOME_CANVAS(canvas)->root->object.flags & E_CANVAS_ITEM_DESCENDENT_NEEDS_REFLOW )
+ e_canvas_item_invoke_reflow (GNOME_CANVAS(canvas)->root, 0);
}
-/* Idle handler for the canvas. It deals with pending updates and redraws. */
+/* Idle handler for the e-canvas. It deals with pending reflows. */
static gint
idle_handler (gpointer data)
{
@@ -362,7 +362,7 @@ idle_handler (gpointer data)
GDK_THREADS_ENTER ();
canvas = E_CANVAS (data);
- do_update (canvas);
+ do_reflow (canvas);
/* Reset idle id */
canvas->idle_id = 0;
@@ -388,9 +388,10 @@ add_idle (ECanvas *canvas)
static void
e_canvas_item_descendent_needs_reflow (GnomeCanvasItem *item)
{
- if ( gtk_object_get_data(GTK_OBJECT(item), "ECanvasItem::descendent_needs_reflow") )
+ if ( item->object.flags & E_CANVAS_ITEM_DESCENDENT_NEEDS_REFLOW )
return;
- gtk_object_set_data(GTK_OBJECT(item), "ECanvasItem::descendent_needs_reflow", (gpointer) 1);
+
+ item->object.flags |= E_CANVAS_ITEM_DESCENDENT_NEEDS_REFLOW;
if ( item->parent )
e_canvas_item_descendent_needs_reflow(item->parent);
}
@@ -398,9 +399,11 @@ e_canvas_item_descendent_needs_reflow (GnomeCanvasItem *item)
void
e_canvas_item_request_reflow (GnomeCanvasItem *item)
{
- gtk_object_set_data(GTK_OBJECT(item), "ECanvasItem::needs_reflow", (gpointer) 1);
- e_canvas_item_descendent_needs_reflow(item);
- add_idle(E_CANVAS(item->canvas));
+ if ( item->object.flags & GNOME_CANVAS_ITEM_REALIZED ) {
+ item->object.flags |= E_CANVAS_ITEM_NEEDS_REFLOW;
+ e_canvas_item_descendent_needs_reflow(item);
+ add_idle(E_CANVAS(item->canvas));
+ }
}
void
diff --git a/e-util/e-canvas.h b/e-util/e-canvas.h
index e70957b6d7..f1ff1195c9 100644
--- a/e-util/e-canvas.h
+++ b/e-util/e-canvas.h
@@ -44,6 +44,12 @@ typedef void (*ECanvasItemReflowFunc) (GnomeCanvasItem *item,
typedef struct _ECanvas ECanvas;
typedef struct _ECanvasClass ECanvasClass;
+/* Object flags for items */
+enum {
+ E_CANVAS_ITEM_NEEDS_REFLOW = 1 << 13,
+ E_CANVAS_ITEM_DESCENDENT_NEEDS_REFLOW = 1 << 14
+};
+
struct _ECanvas
{
GnomeCanvas parent;