1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
/* 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 *);
void canvas_change_layer(Canvas *, unsigned int);
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 *);
|