summaryrefslogtreecommitdiffstats
path: root/src/item.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2015-02-21 23:32:24 +0000
committerDavid Robillard <d@drobilla.net>2015-02-21 23:32:24 +0000
commitef71a1da33a3c68cad782029cacbc1d01328b4d6 (patch)
treef5bb6f29c467bf91c0ab8ca5072a81408522a311 /src/item.c
parent23682cbf1f98f35d4341efe354bee6f770d482e2 (diff)
downloadganv-ef71a1da33a3c68cad782029cacbc1d01328b4d6.tar.gz
ganv-ef71a1da33a3c68cad782029cacbc1d01328b4d6.tar.bz2
ganv-ef71a1da33a3c68cad782029cacbc1d01328b4d6.zip
Add API to specify module port order.
Also fix various redundant resize/update issues, improve performance. git-svn-id: http://svn.drobilla.net/lad/trunk/ganv@5592 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/item.c')
-rw-r--r--src/item.c30
1 files changed, 20 insertions, 10 deletions
diff --git a/src/item.c b/src/item.c
index f931e94..d645e23 100644
--- a/src/item.c
+++ b/src/item.c
@@ -78,6 +78,7 @@ ganv_item_init(GanvItem* item)
item->object.flags |= GANV_ITEM_VISIBLE;
item->impl = impl;
item->impl->managed = FALSE;
+ item->impl->wrapper = NULL;
}
/**
@@ -218,9 +219,10 @@ ganv_item_construct(GanvItem* item, GanvItem* parent,
{
g_return_if_fail(GANV_IS_ITEM(item));
- item->impl->parent = parent;
- item->impl->canvas = item->impl->parent->impl->canvas;
- item->impl->layer = 0;
+ item->impl->parent = parent;
+ item->impl->wrapper = NULL;
+ item->impl->canvas = item->impl->parent->impl->canvas;
+ item->impl->layer = 0;
g_object_set_valist(G_OBJECT(item), first_arg_name, args);
@@ -343,6 +345,7 @@ ganv_item_invoke_update(GanvItem* item, int flags)
if (child_flags & GCI_UPDATE_MASK) {
if (GANV_ITEM_GET_CLASS(item)->update) {
GANV_ITEM_GET_CLASS(item)->update(item, child_flags);
+ g_assert(!(GTK_OBJECT_FLAGS(item) & GANV_ITEM_NEED_UPDATE));
}
}
}
@@ -595,12 +598,6 @@ ganv_item_get_bounds(GanvItem* item, double* x1, double* y1, double* x2, double*
void
ganv_item_request_update(GanvItem* item)
{
- /* Note: At some point, if this short-circuit was enabled, the canvas stopped
- updating items entirely when connected modules are removed. */
- if (item->object.flags & GANV_ITEM_NEED_UPDATE) {
- return;
- }
-
if (!item->impl->canvas) {
/* Item is being / has been destroyed, ignore */
return;
@@ -608,7 +605,8 @@ ganv_item_request_update(GanvItem* item)
item->object.flags |= GANV_ITEM_NEED_UPDATE;
- if (item->impl->parent != NULL) {
+ if (item->impl->parent != NULL &&
+ !(item->impl->parent->object.flags & GANV_ITEM_NEED_UPDATE)) {
/* Recurse up the tree */
ganv_item_request_update(item->impl->parent);
} else {
@@ -617,6 +615,18 @@ ganv_item_request_update(GanvItem* item)
}
}
+void
+ganv_item_set_wrapper(GanvItem* item, void* wrapper)
+{
+ item->impl->wrapper = wrapper;
+}
+
+void*
+ganv_item_get_wrapper(GanvItem* item)
+{
+ return item->impl->wrapper;
+}
+
static gboolean
boolean_handled_accumulator(GSignalInvocationHint* ihint,
GValue* return_accu,