00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef LIQSKETCH_H
00028 #define LIQSKETCH_H
00029
00030
00031 #include "liqimage.h"
00032
00033
00034
00035
00036 struct liqcell;
00037
00038
00039
00040
00041 typedef struct liqpoint
00042 {
00043 unsigned int usagecount;
00044 struct liqpoint *linkprev;
00045 struct liqpoint *linknext;
00046 int x;
00047 int y;
00048 int z;
00049 unsigned long t;
00050 } liqpoint;
00051
00052
00053
00054
00055
00056 liqpoint * liqpoint_new();
00057 liqpoint * liqpoint_hold(liqpoint *self);
00058 void liqpoint_release(liqpoint *self);
00059 void liqpoint_free(liqpoint *self);
00060
00061
00062
00063
00064 liqpoint *liqpoint_clone(liqpoint *s);
00065 inline void liqpoint_copy(liqpoint *self,liqpoint *s) ;
00066 inline void liqpoint_getdiff(liqpoint *self,liqpoint *s,liqpoint *e) ;
00067 inline int liqpoint_issame(liqpoint *self,liqpoint *s);
00068
00069
00070
00071 typedef struct liqpointrange
00072 {
00073 int xl;
00074 int yt;
00075 int xr;
00076 int yb;
00077 int zf;
00078 int zb;
00079 } liqpointrange;
00080 void liqpointrange_start(liqpointrange *self,liqpoint *p);
00081 void liqpointrange_extendrubberband(liqpointrange *self,liqpoint *p);
00082
00083
00084 typedef struct liqstroke
00085 {
00086 unsigned int usagecount;
00087 struct liqstroke *linkprev;
00088 struct liqstroke *linknext;
00089
00090 struct liqsketch *linkpage;
00091
00092 unsigned char pen_y;
00093 unsigned char pen_u;
00094 unsigned char pen_v;
00095 unsigned char pen_thick;
00096
00097 int strokekind;
00098
00099 short selected;
00100 short islandnumber;
00101
00102 char * mediakey;
00103
00104
00105 struct liqsketch *mediapage;
00106
00107
00108 char *quadchain;
00109
00110 int pointcount;
00111 liqpoint *pointfirst;
00112 liqpoint *pointlast;
00113 liqpointrange boundingbox;
00114
00115
00116 } liqstroke;
00117
00118
00119 liqstroke * liqstroke_new();
00120 liqstroke * liqstroke_hold(liqstroke *self);
00121 void liqstroke_release(liqstroke *self);
00122 void liqstroke_free(liqstroke *self);
00123
00124
00125
00126
00127
00128
00129
00130 void liqstroke_clear(liqstroke *self);
00131
00132 liqstroke *liqstroke_clone(liqstroke *s);
00133 void liqstroke_appendpoint(liqstroke *self,liqpoint *p);
00134
00135 void liqstroke_start(liqstroke *self,int px,int py, int pz,unsigned long pt);
00136 void liqstroke_extend(liqstroke *self,int px,int py, int pz,unsigned long pt);
00137 int liqstroke_totallength(liqstroke *self);
00138 void liqstroke_ensurepositive(liqstroke *self);
00139 int liqstroke_hittest(liqstroke *self,int px,int py);
00140 char * liqstroke_quadchainbuild(liqstroke *self);
00141
00142
00143
00144 typedef struct liqsketch
00145 {
00146 unsigned int usagecount;
00147
00148
00149 int pixelwidth;
00150 int pixelheight;
00151
00152 int dpix;
00153 int dpiy;
00154
00155 char * title;
00156 char * filename;
00157 int islandcount;
00158
00159 int strokecount;
00160 liqstroke * strokefirst;
00161 liqstroke * strokelast;
00162
00163 liqpointrange boundingbox;
00164
00165
00166 int backgroundstyle;
00167 unsigned int backgroundcoloryuv;
00168 char * backgroundfilename;
00169 liqimage * backgroundimage;
00170 struct liqsketch * backgroundsketch;
00171
00172
00173
00174
00175
00176 } liqsketch;
00177
00178
00179
00180
00181 liqsketch * liqsketch_newfromfile(char *filename);
00182
00183 liqsketch * liqsketch_new();
00184 liqsketch * liqsketch_hold(liqsketch *self);
00185 void liqsketch_release(liqsketch *self);
00186 void liqsketch_free(liqsketch *self);
00187
00188
00189
00190 void liqsketch_titlechange(liqsketch *self,char *title);
00191
00192 void liqsketch_strokeinsert(liqsketch *self,liqstroke *s);
00193 void liqsketch_strokeupdate(liqsketch *self,liqstroke *s);
00194 void liqsketch_strokeremove(liqsketch *self,liqstroke *s);
00195 void liqsketch_clear(liqsketch *self);
00196
00197 int liqsketch_filesave(liqsketch *self,char *filename);
00198 int liqsketch_fileload(liqsketch *self,char *filename);
00199
00200 void liqsketch_boundwholearea();
00201
00202 void liqsketch_coordchange_scr_to_page(liqsketch *self,int scrx,int scry,int scrw,int scrh, int scrdpix,int scrdpiy,int *rx,int *ry);
00203 void liqsketch_islandcalcall(liqsketch *self);
00204
00205
00206 #endif