/* Should include action.h before it */ /* TODO: move to config.h */ #define HISTLENGTH 2000 struct Layer { unsigned int *pix; unsigned int visible; char name[128]; }; struct Canvas { unsigned int 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, *half_pres; struct action_pixcol *temp_pix; int temp_cnt; uint *pres_pix; Action history[HISTLENGTH]; int hist_s, hist_e, hist_i, hist_isend; }; 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 int); 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 *); void action_undo(Canvas *); void action_redo(Canvas *);