"Fossies" - the Fresh Open Source Software Archive

Member "netmapr-1.9c/convert.h" (14 Dec 2009, 5703 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 "convert.h" see the Fossies "Dox" file reference documentation.

    1 #include "constants.h"
    2 
    3 typedef struct {
    4     int x;
    5     int y;
    6 } xy_t;
    7 
    8 struct {
    9     int x;
   10     int y;
   11     int width;
   12     int height;
   13     int pos;
   14     int gridsize;
   15     int gridrowlen;
   16     SDL_Color gridcol;
   17     SDL_Color gridbgcol;
   18     SDL_Color bgcol;
   19 } obox;
   20 
   21 struct {
   22     int x;
   23     int y;
   24     int width;
   25     int height;
   26     int gridsize;
   27     int gridrowlen;
   28     SDL_Color gridcol;
   29     SDL_Color bgcol;
   30 } toolbox;
   31 
   32 struct {
   33     int x;
   34     int y;
   35     int width;
   36     int height;
   37 } mapbox;
   38 
   39 
   40 typedef struct {
   41     char text[BUFLEN];
   42     int x;
   43     int y;
   44     int w;
   45     int h;
   46     SDL_Color c;
   47     int anchor;
   48 } text_t;
   49 
   50 
   51 typedef struct {
   52     int srcobj;
   53     int srcxoff;
   54     int srcyoff;
   55     int dstobj;
   56     int dstxoff;
   57     int dstyoff;
   58     int npoints;
   59     xy_t point[MAXPOINTS];
   60     SDL_Color col;
   61     int style;
   62 } link_t;
   63 
   64 
   65 typedef struct {
   66     int type; /* line, square */
   67     int x1,y1;
   68     int x2,y2;
   69     SDL_Color c;
   70 } vector_t;
   71 
   72 typedef struct {
   73     int w;
   74     int h;
   75     vector_t vector[OLDMAXVECTORSPERIMAGE];
   76     int vnum;
   77 } vectorimg_t;
   78 
   79 typedef struct {
   80     char name[BUFLEN];
   81     int canscale;
   82     int defw;
   83     int defh;
   84     vectorimg_t vimg;
   85 } object_t;
   86 
   87 struct {
   88     vectorimg_t vect;
   89     char name;
   90 } letter[MAXLETTERVECTS];
   91 
   92 typedef struct {
   93     int id;
   94     int type;
   95 } thing_t;
   96 
   97 object_t objtype[MAXOBJTYPES];
   98 
   99 typedef struct {
  100     int type; /* index into objtype[] */
  101     int x;
  102     int y;
  103     int w;
  104     int h;
  105     int child;
  106 } mapobject_t;
  107 
  108 typedef struct {
  109     char name[BUFLEN];
  110     SDL_Surface *img;
  111 } button_t;
  112 button_t button[MAXBUTTONS];
  113 
  114 typedef struct {
  115     int width;
  116     int height;
  117     int bpp;
  118     SDL_Color bgcol;
  119     SDL_Color boxcol;
  120     int numthings; 
  121     int numobjects;
  122     int numlinks;
  123     int numtext;
  124 
  125     int selecteditem;
  126     int selecteditemtype;
  127     int selectedlinkpoint;
  128     int selectedtype;
  129 
  130     int curobj; /* object being moved/dragged/etc */
  131     int curlink; /* link being moved/dragged/etc */
  132     int curlinkpoint; /* link point being moved/dragged/etc */
  133     int curtext; /* text being moved/dragged/etc */
  134     int startx,starty;
  135     int textanchor;
  136     char text[BUFLEN];
  137 
  138     char name[BUFLEN];
  139 
  140     /* actual data */
  141     text_t textob[MAXTEXT];
  142     mapobject_t obj[MAXOBJECTS];
  143     thing_t thing[MAXOBJECTS + MAXLINKS];
  144     link_t olink[MAXLINKS];
  145 
  146 } map_t;
  147 
  148 map_t map[MAXMAPS];
  149 
  150 
  151 void addlinkpoint(int linkid, int x, int y);
  152 int addvector(vectorimg_t *vimg, int type, int x1, int y1, int x2, int y2, SDL_Color *c);
  153 void changestate(int newstate);
  154 void cleanup(void);
  155 int createobject(int type, int x, int y);
  156 void copyline(SDL_Surface *screen,int x1, int y1, int x2, int y2, int *lbuf);
  157 void deletething(int id, int type);
  158 void deletelink(int linkid);
  159 void deleteobject(int oid );
  160 void deletetext(int textid);
  161 void drawbox(SDL_Surface *screen, int x1, int y1, int x2, int y2, SDL_Color c);
  162 void drawcolorchart(SDL_Surface *dest);
  163 void drawmaplist(SDL_Surface *dest);
  164 int drawletter(SDL_Surface *dest,int x, int y, int w, int h, char let, SDL_Color col);
  165 void drawline(SDL_Surface *screen, int x1, int y1, int x2, int y2, SDL_Color c);
  166 void drawlinebehind(SDL_Surface *screen, int x1, int y1, int x2, int y2, SDL_Color c);
  167 void drawlink(SDL_Surface *dest, link_t *l);
  168 void drawpixel(SDL_Surface *screen, int x, int y, SDL_Color c);
  169 void drawmap(void);
  170 void drawmapbox(void);
  171 void drawobox(void);
  172 void drawscreen(void);
  173 void drawstatusbar(void);
  174 void drawtext(SDL_Surface *dest, text_t *t);
  175 void drawtoolbox(void);
  176 void drawtoolboxselector(int buttonid);
  177 void drawvector(SDL_Surface *dest, vectorimg_t *vimg, int x, int y, int w, int h,SDL_Color *overridefg );
  178 void drillto(int mapnum);
  179 int endobjmove(int x, int y);
  180 int endresize(int x, int y);
  181 int endtextresize(int x, int y);
  182 int endlink(int x, int y);
  183 int endlinkmove(int x, int y);
  184 int endlinkdstmove(int x, int y);
  185 int endlinkpointmove(int x, int y);
  186 int endlinksrcmove(int x, int y);
  187 int endtext(void);
  188 int endtextmove(int x, int y);
  189 int findpointpos(link_t *l, int px, int py);
  190 void floodfill(SDL_Surface *dest, int x, int y, SDL_Color fillcol);
  191 void floodfill2(SDL_Surface *dest, int x, int y, SDL_Color fillcol, SDL_Color bgcol);
  192 void floodfill3(SDL_Surface *dest, int x1, int x2, int y, SDL_Color fillcol, SDL_Color bgcol);
  193 void floodfill4(SDL_Surface *dest, int x, int y, SDL_Color fillcol, SDL_Color bgcol);
  194 int getcolor(SDL_Surface *dest, int x, int y, SDL_Color *col);
  195 void drawyn(char *prompt);
  196 int getyn(int x, int y);
  197 void goback(void);
  198 int linelen(int x1,int y1,int x2,int y2);
  199 int linkat(int x, int y);
  200 int loadmap(void);
  201 void lowerselected(void);
  202 int objat(int x, int y);
  203 void pasteline(SDL_Surface *screen, int *lbuf);
  204 void pop(int *x, int *y);
  205 void push(int x, int y);
  206 int initgraphics(void);
  207 void initmap(int mapnum);
  208 int initobject(int onum);
  209 int isonline (int fx, int fy, int x1, int y1, int x2, int y2);
  210 int isonlink(int linkid, int mx, int my);
  211 int isonlinkdst(int lineid, int mx, int my);
  212 int isonlinkpoint(int lineid, int mx, int my);
  213 int isonlinksrc(int lineid, int mx, int my);
  214 int isonmap (int x, int y);
  215 int isonobox (int x, int y);
  216 int isontoolbox (int x, int y);
  217 int isonmapbox (int x, int y);
  218 int isonmapboxchildren (int x, int y);
  219 int isonmapname (int x, int y);
  220 int isongoback (int x, int y);
  221 void initvars(void);
  222 void raiseselected(void);
  223 int savemap(void);
  224 int showfiledialog(void);
  225 int startlink (int x, int y);
  226 int startlinkdstmove(int x, int y);
  227 int startlinkpointmove(int x, int y);
  228 int startlinksrcmove(int x, int y);
  229 int startlinkmove(int x, int y);
  230 int startobjmove(int x, int y);
  231 int startresize (int x, int y);
  232 int startresizetext (int x, int y);
  233 int starttextmove(int x, int y);
  234 int textat(int x, int y);
  235 int thingat(int x, int y);
  236 int updatefilename(void);
  237 int updatelinkshadow(int x, int y);
  238 int updatelinkpointshadow(int x, int y);
  239 int updatemoveshadow(int x, int y);
  240 int updateresizeshadow(int x, int y);
  241 int updateresizetextshadow(int x, int y);
  242 int updatetextcursor(void);
  243 int updatetextshadow(int x, int y);