aboutsummaryrefslogtreecommitdiff
path: root/src/canvas.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/canvas.h')
-rw-r--r--src/canvas.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/canvas.h b/src/canvas.h
new file mode 100644
index 0000000..2bdb775
--- /dev/null
+++ b/src/canvas.h
@@ -0,0 +1,40 @@
+struct Layer {
+ unsigned int *pix;
+};
+
+struct Canvas {
+ unsigned char layer_arr_cnt, layer_arr_sz;
+ unsigned int cur_col, cur_layer;
+ unsigned int w, h, zoom;
+ char *proj_path;
+ struct Layer **layers;
+ int x, y;
+ void *back, *pres;
+ void *temp_pix;
+ uint *pres_pix;
+};
+
+typedef struct Layer Layer;
+typedef struct Canvas Canvas;
+
+extern unsigned char is_drawing;
+extern const unsigned int maxzoom; /* move to another tab */
+extern Canvas* cur_canvas; /* current canvas */
+
+Canvas *canvas_init(unsigned int, unsigned int, void *);
+Canvas *canvas_import_png(const char *, void *);
+Canvas *canvas_open(const char *, void *); /* TODO: open function per version */
+void canvas_destroy(Canvas *);
+void canvas_redraw(Canvas *, void *, int, int);
+void canvas_present(Canvas *, void *);
+void canvas_zoom_change(Canvas *, short int);
+void canvas_point_draw(Canvas *, long int, long int);
+void canvas_mousel_up(Canvas *);
+void canvas_mousel_down(Canvas *, long int, long int);
+void canvas_mouse_move(Canvas *, long int, long int);
+void canvas_add_layer(Canvas *, unsigned char);
+void canvas_move_x(Canvas *, long int);
+void canvas_move_y(Canvas *, long int);
+void canvas_refresh(Canvas *);
+unsigned char canvas_save(Canvas *, const char *, short int);
+unsigned char canvas_export_png(Canvas *, const char *, void *);