aboutsummaryrefslogtreecommitdiff
path: root/src/presentation.h
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2011-10-03 12:09:50 +0200
committerThomas White <taw@bitwiz.org.uk>2011-10-03 12:10:12 +0200
commitf4ff26c955729f8b068c64fff806216eb6e34bd4 (patch)
tree577a756353ac09f53e818b8f19292d3ce6326e12 /src/presentation.h
parent9a5060c094813d908d4c9ef7b8631916939bb53d (diff)
Use dispatch tables for tool functions
Diffstat (limited to 'src/presentation.h')
-rw-r--r--src/presentation.h18
1 files changed, 14 insertions, 4 deletions
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;