"Fossies" - the Fresh Open Source Software Archive 
Member "netmapr-1.9c/netmapr.h" (14 Dec 2009, 8502 Bytes) of package /linux/privat/old/netmapr-1.9c.tar.gz:
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style:
standard) with prefixed line numbers and
code folding option.
Alternatively you can here
view or
download the uninterpreted source code file.
For more information about "netmapr.h" see the
Fossies "Dox" file reference documentation.
1 #include "constants.h"
2
3 #ifndef __CONSTANTS_H
4 #define __CONSTANTS_H
5 #ifdef WINDOWS
6 #define STDOUT (FILE *)1
7 #else
8 #define STDOUT stdout
9 #endif
10 #endif
11
12 typedef struct {
13 int x;
14 int y;
15 } xy_t;
16
17 struct {
18 int x;
19 int y;
20 int width;
21 int height;
22 int pos;
23 int gridsize;
24 int gridrowlen;
25 SDL_Color gridcol;
26 SDL_Color gridbgcol;
27 SDL_Color bgcol;
28 } obox;
29
30 struct {
31 int x;
32 int y;
33 int width;
34 int height;
35 int gridsize;
36 int gridrowlen;
37 SDL_Color gridcol;
38 SDL_Color bgcol;
39 } toolbox;
40
41 struct {
42 int x;
43 int y;
44 int width;
45 int height;
46 int offset;
47 } mapbox;
48
49
50 typedef struct {
51 char text[BUFLEN];
52 int x;
53 int y;
54 int w;
55 int h;
56 /* top bit of c.unused says whether or not this is a flow */
57 SDL_Color c;
58 int anchor;
59 } text_t;
60
61
62 typedef struct {
63 int srcobj;
64 int srcxoff;
65 int srcyoff;
66 int dstobj;
67 int dstxoff;
68 int dstyoff;
69 int npoints;
70 xy_t point[MAXPOINTS];
71 /* top bit of c.unused says whether or not this is a flow */
72 SDL_Color col;
73 int style;
74 } link_t;
75
76
77 typedef struct {
78 int type; /* line, square */
79 int x1,y1;
80 int x2,y2;
81 SDL_Color c;
82 SDL_Color fc;
83 } vector_t;
84
85 typedef struct {
86 int w;
87 int h;
88 vector_t vector[MAXVECTORSPERIMAGE];
89 int vnum;
90 } vectorimg_t;
91
92 typedef struct {
93 char name[BUFLEN];
94 int canscale;
95 int defw;
96 int defh;
97 vectorimg_t vimg;
98 } object_t;
99
100
101
102 //struct {
103 // vectorimg_t vect;
104 // char name;
105 //} letter[MAXLETTERVECTS];
106
107 typedef struct {
108 int id;
109 int type;
110 } thing_t;
111
112 object_t objtype[MAXOBJTYPES];
113
114 typedef struct {
115 int type; /* index into objtype[] */
116 int x;
117 int y;
118 int w;
119 int h;
120 int child;
121 /* fillcol.unused top bit unused says whether or not this is a flow */
122 /* (fillcol.unused & 1) == 1 means to fill with this colour */
123 /* (fillcol.unused & 1) == NOCOLOUR means to ignore this*/
124 SDL_Color fillcol;
125 } mapobject_t;
126
127 typedef struct {
128 int type; /* index into objtype[] */
129 int x;
130 int y;
131 int w;
132 int h;
133 int child;
134 } mapobject099a_t;
135
136 typedef struct {
137 char name[BUFLEN];
138 SDL_Surface *img;
139 } button_t;
140 button_t button[MAXBUTTONS];
141
142 typedef struct {
143 int width;
144 int height;
145 int bpp;
146 SDL_Color bgcol;
147 SDL_Color boxcol;
148 int numthings;
149 int numobjects;
150 int numlinks;
151 int numtext;
152
153 int selecteditem;
154 int selecteditemtype;
155 int selectedlinkpoint;
156 int selectedtype;
157
158 int curobj; /* object being moved/dragged/etc */
159 int curlink; /* link being moved/dragged/etc */
160 int curlinkpoint; /* link point being moved/dragged/etc */
161 int curtext; /* text being moved/dragged/etc */
162 int startx,starty;
163 int textanchor;
164 char text[BUFLEN];
165
166 char name[BUFLEN];
167
168 /* actual data */
169 text_t textob[MAXTEXT];
170 mapobject_t obj[MAXOBJECTS];
171 thing_t thing[MAXOBJECTS + MAXLINKS];
172 link_t olink[MAXLINKS];
173
174 } map_t;
175
176 map_t map[MAXMAPS];
177
178 char typedesc[6][BUFLEN];
179
180
181 void adjustendpoint(SDL_Surface *screen, int *adjx, int *adjy, double x1, double y1, double x2, double y2, int arrowstyle, int arrowpos );
182 void addlinkpoint(int linkid, int x, int y);
183 int addvector(vectorimg_t *vimg, int type, int x1, int y1, int x2, int y2, SDL_Color *c, SDL_Color *fc);
184 void changegridsize(void);
185 void changelinearrow(int changeby);
186 void changelinestyle(int changeby);
187 void changelinethickness(int changeby);
188 void changemap(int newmap);
189 void changestate(int newstate);
190 void cleanup(void);
191 void copy(void);
192 int createobject(int type, int x, int y);
193 void calcmapdimensions(void);
194 void copyline(SDL_Surface *screen,int x1, int y1, int x2, int y2, int *lbuf);
195 void deletething(int id, int type);
196 void deletelink(int linkid);
197 void deleteobject(int oid );
198 void deletetext(int textid);
199 int dosearch(void);
200 int dosearchnext(void);
201 void drawarrowhead(SDL_Surface *screen, double x1, double y1, double x2, double y2, SDL_Color c, int arrowstyle, int arrowpos);
202 void drawarrowheadSVG(double x1, double y1, double x2, double y2, SDL_Color c, int arrowstyle, int arrowpos);
203 void lerp(int *newx, int *newy, int ax, int ay, int bx, int by, float t);
204 void drawbezier(SDL_Surface *screen, int x1, int y1, int x2,int y2, int x3,int y3, int x4,int y4, SDL_Color c);
205 void drawbox(SDL_Surface *screen, int x1, int y1, int x2, int y2, SDL_Color c, SDL_Color *fc);
206 void drawellipsepoints(SDL_Surface *screen, int x1, int y1, int x, int y, SDL_Color c);
207 void drawellipse(SDL_Surface *screen, int x1, int y1, int x2, int y2, SDL_Color c);
208 void drawflowbox(SDL_Surface *dest, int oid, int otype);
209 void drawcolorchart(SDL_Surface *dest);
210 void drawmaplist(SDL_Surface *dest);
211 void drawline(SDL_Surface *screen, int x1, int y1, int x2, int y2, SDL_Color c, int linestyle);
212 void drawlinebehind(SDL_Surface *screen, int x1, int y1, int x2, int y2, SDL_Color c);
213 void drawlink(SDL_Surface *dest, link_t *l);
214 void drawlinkSVG(link_t *l);
215 void drawobject(SDL_Surface *dest, mapobject_t *o, int doublebuffer, int adjust);
216 void drawobjectSVG(SDL_Surface *dest, mapobject_t *o, int doublebuffer);
217 void drawpixel(SDL_Surface *screen, int x, int y, SDL_Color c);
218 void drawmap(int wantdecs);
219 void drawmapbox(void);
220 void drawobox(void);
221 void drawscreen(void);
222 void drawsearchflash(void);
223 void drawstatusbar(void);
224 void drawtext(SDL_Surface *dest, text_t *t, int adjust);
225 void drawtextat(SDL_Surface *dest, int x, int y, char *text, int size, SDL_Color c);
226 void drawtextSVG(text_t *t);
227 void drawtoolbox(void);
228 void drawtoolboxselector(int buttonid, int altcolour);
229 void drawvector(SDL_Surface *dest, vectorimg_t *vimg, int x, int y, int w, int h,SDL_Color *overridefg, SDL_Color *overridebg );
230 void drawvectorSVG(vectorimg_t *vimg, int x, int y, int w, int h, SDL_Color *overridefg, SDL_Color *overridebg);
231 int drawSVG(char *svgfilename);
232 void drawxscrollbar(void);
233 void drawyscrollbar(void);
234 void drillto(int mapnum);
235 int endobjmove(int x, int y);
236 int endresize(int x, int y);
237 int endtextresize(int x, int y);
238 int endlink(int x, int y);
239 int endlinkmove(int x, int y);
240 int endlinkdstmove(int x, int y);
241 int endlinkpointmove(int x, int y);
242 int endlinksrcmove(int x, int y);
243 int endtext(void);
244 int endtextedit(void);
245 int endtextmove(int x, int y);
246 void endSVG(void);
247 int findpointpos(link_t *l, int px, int py);
248 void floodfill(SDL_Surface *dest, int x, int y, SDL_Color fillcol);
249 void floodfill2(SDL_Surface *dest, int x, int y, SDL_Color fillcol, SDL_Color bgcol);
250 void floodfill3(SDL_Surface *dest, int x1, int x2, int y, SDL_Color fillcol, SDL_Color bgcol);
251 void floodfill4(SDL_Surface *dest, int x, int y, SDL_Color fillcol, SDL_Color bgcol);
252 int getcolor(SDL_Surface *dest, int x, int y, SDL_Color *col);
253 int getmousepos(int x, int y);
254 void drawyn(char *prompt);
255 int getyn(int x, int y);
256 void goback(void);
257 int linelen(int x1,int y1,int x2,int y2);
258 int getlinkat(int x, int y);
259 int loadmap(void);
260 void lowerselected(int amt);
261 int objat(int x, int y);
262 void paste(void);
263 void pasteline(SDL_Surface *screen, int *lbuf);
264 void pop(int *x, int *y);
265 void push(int x, int y);
266 int initgraphics(void);
267 void initmap(int mapnum);
268 int initobject(int onum);
269 int isinhistory(int mapid);
270 int isflow(int oid, int otype);
271 int isonline (int fx, int fy, int x1, int y1, int x2, int y2);
272 int isonlink(int linkid, int mx, int my);
273 int isonlinkdst(int lineid, int mx, int my);
274 int isonlinkpoint(int lineid, int mx, int my);
275 int isonlinksrc(int lineid, int mx, int my);
276 int isonmap (int x, int y);
277 int isonobox (int x, int y);
278 int isontoolbox (int x, int y);
279 int isonmapbox (int x, int y);
280 int isonmapboxchildren (int x, int y);
281 int isonmapname (int x, int y);
282 int isongoback (int x, int y);
283 int isonxscrollbar(int x, int y);
284 int isonyscrollbar(int x, int y);
285 void initvars(void);
286 void raiseselected(int amt);
287 void seterror(int errnum);
288 void setinfo(int infonum);
289 void setsearchflash(int num);
290 void setmod(int tf);
291 int savemap(void);
292 void scrollmaplist(int amt);
293 void scrollobox(int amt);
294 int showfiledialog(void);
295 void startedittext (int o);
296 int startlink (int x, int y);
297 int startlinkdstmove(int x, int y);
298 int startlinkpointmove(int x, int y);
299 int startlinksrcmove(int x, int y);
300 int startlinkmove(int x, int y);
301 int startobjmove(int x, int y);
302 int startresize (int x, int y);
303 int startresizetext (int x, int y);
304 int startSVG(char *svgfilename);
305 int starttextmove(int x, int y);
306 int textat(int x, int y);
307 void toggleflow(int oid, int otype);
308 void togglegrid(void);
309 int thingat(int x, int y);
310 int updatefilename(void);
311 int updatelinkshadow(int x, int y);
312 int updatelinkpointshadow(int x, int y);
313 int updatemoveshadow(int x, int y);
314 int updateresizeshadow(int x, int y);
315 int updateresizetextshadow(int x, int y);
316 int updatetextcursor(void);
317 int updatetextshadow(int x, int y);
318 void updatewm(void);
319 void validatescreenpos(void);