From f4ff26c955729f8b068c64fff806216eb6e34bd4 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Mon, 3 Oct 2011 12:09:50 +0200 Subject: Use dispatch tables for tool functions --- src/presentation.h | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'src/presentation.h') diff --git a/src/presentation.h b/src/presentation.h index a654978..2685f86 100644 --- a/src/presentation.h +++ b/src/presentation.h @@ -46,10 +46,17 @@ struct slide }; -enum tool +struct toolinfo { - TOOL_SELECT, - TOOL_TEXT, + void (*click_create)(struct presentation *p, struct toolinfo *tip, + double x, double y); + void (*click_select)(struct presentation *p, struct toolinfo *tip, + double x, double y); + void (*create_default)(struct presentation *p, struct style *sty); + void (*select)(struct object *o, struct toolinfo *tip); + void (*deselect)(struct object *o, struct toolinfo *tip); + void (*drag_object)(struct toolinfo *tip, struct presentation *p, + struct object *o, double x, double y); }; @@ -59,6 +66,9 @@ struct presentation char *filename; int completely_empty; + struct toolinfo *select_tool; + struct toolinfo *text_tool; + GtkWidget *window; GtkWidget *drawingarea; GtkUIManager *ui; @@ -99,7 +109,7 @@ struct presentation struct object *editing_object; /* Tool status */ - enum tool tool; + struct toolinfo *cur_tool; double drag_offs_x; double drag_offs_y; -- cgit v1.2.3