summaryrefslogtreecommitdiffstats
path: root/src/port.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-12-14 00:47:57 +0000
committerDavid Robillard <d@drobilla.net>2011-12-14 00:47:57 +0000
commit4b806a473d03faa24f00fad5e29721622236ed43 (patch)
tree2023a9ebaa82558b957a500c54b14165334730a4 /src/port.c
parent61cae4344c83e4439d6ed57f16082b0440f26581 (diff)
downloadganv-4b806a473d03faa24f00fad5e29721622236ed43.tar.gz
ganv-4b806a473d03faa24f00fad5e29721622236ed43.tar.bz2
ganv-4b806a473d03faa24f00fad5e29721622236ed43.zip
Custom module point and port draw handlers.
git-svn-id: http://svn.drobilla.net/lad/trunk/ganv@3872 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/port.c')
-rw-r--r--src/port.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/port.c b/src/port.c
index da750aa..674be73 100644
--- a/src/port.c
+++ b/src/port.c
@@ -111,6 +111,23 @@ ganv_port_get_property(GObject* object,
}
static void
+ganv_port_draw(GanvItem* item,
+ cairo_t* cr,
+ int cx, int cy,
+ int width, int height)
+{
+ GanvPort* port = GANV_PORT(item);
+
+ GanvItemClass* item_class = GANV_ITEM_CLASS(parent_class);
+ item_class->draw(item, cr, cx, cy, width, height);
+
+ if (port->impl->control) {
+ GanvItem* const rect = GANV_ITEM(port->impl->control->rect);
+ GANV_ITEM_GET_CLASS(rect)->draw(rect, cr, cx, cy, width, height);
+ }
+}
+
+static void
ganv_port_tail_vector(const GanvNode* self,
const GanvNode* head,
double* x,
@@ -238,6 +255,7 @@ ganv_port_class_init(GanvPortClass* class)
object_class->destroy = ganv_port_destroy;
item_class->event = event;
+ item_class->draw = ganv_port_draw;
node_class->tail_vector = ganv_port_tail_vector;
node_class->head_vector = ganv_port_head_vector;