- Rewrote Command Reference document (simplified and now includes screenshots)

- Updated example diagram to use new Traffic Flows feature
- Added an additional paste shortcut for windows compatibility ('v')
- Grid is now back to being on by default again
- Grid is automatically turned off when a new map is loaded.
- Grid is automatically turned on when all maps are cleared (via the new map
  button)
- Removed -g from Windows Makefile (since I can't make gdb work under mingw
  anyway)
- Current filename is now displayed in title bar
- Modified welcome text
- Added new vector shape:  Bezier Curve
- Redrew Cloud object to use bezier curves instead of lines
- Added Copy, Paste and Grid buttons
- Combined X&Y position matching into a single button (use RMB for Y position
  match)
- Added Traffic Flow button (LMB = toggle display of flows, RMB = define
  flows)
- 1 bit of "Unused" part of colour struct on links, objects and text is now
  used to
  show whether or not to fill this thing.
- 2 bit of "Unused" part of colour struct on links, objects and text is now
  used to
  show whether or not this thing is a traffic flow.
- Fixed bug where first toolbox button hilighted would "stick"
- Fixed bug where status text was overwritten during VIDEO_EXPOSE event
This commit is contained in:
Rob Pearce 2005-11-15 03:45:04 +00:00
parent 5300b3e324
commit edb6d59b81
13 changed files with 895 additions and 329 deletions

View File

@ -10,6 +10,28 @@ Ideas for future versions:
- Implement a toggle-able traffic flow display (for example, you might click - Implement a toggle-able traffic flow display (for example, you might click
a button and have arrows appear to show all SMTP mail flows) a button and have arrows appear to show all SMTP mail flows)
Version 1.4:
- Rewrote Command Reference document (simplified and now includes screenshots)
- Updated example diagram to use new Traffic Flows feature
- Added an additional paste shortcut for windows compatibility ('v')
- Grid is now back to being on by default again
- Grid is automatically turned off when a new map is loaded.
- Grid is automatically turned on when all maps are cleared (via the new map button)
- Removed -g from Windows Makefile (since I can't make gdb work under mingw anyway)
- Current filename is now displayed in title bar
- Modified welcome text
- Added new vector shape: Bezier Curve
- Redrew Cloud object to use bezier curves instead of lines
- Added Copy, Paste and Grid buttons
- Combined X&Y position matching into a single button (use RMB for Y position match)
- Added Traffic Flow button (LMB = toggle display of flows, RMB = define flows)
- 1 bit of "Unused" part of colour struct on links, objects and text is now used to
show whether or not to fill this thing.
- 2 bit of "Unused" part of colour struct on links, objects and text is now used to
show whether or not this thing is a traffic flow.
- Fixed bug where first toolbox button hilighted would "stick"
- Fixed bug where status text was overwritten during VIDEO_EXPOSE event
Version 1.3: Version 1.3:
- Grid is now off by default - Grid is now off by default
- Added keyboard shortcuts ('0' through '9' to select or define) - Added keyboard shortcuts ('0' through '9' to select or define)

View File

@ -3,14 +3,12 @@ netmapr: netmapr.c constants.h netmapr.h Makefile
ln -f netmapr netmapr-viewer ln -f netmapr netmapr-viewer
install: netmapr install: netmapr
install -C -o root -m 755 netmapr /usr/local/bin/netmapr install -C -D -o root -m 755 netmapr /usr/local/bin/netmapr
ln -f /usr/local/bin/netmapr /usr/local/bin/netmapr-viewer ln -f /usr/local/bin/netmapr /usr/local/bin/netmapr-viewer
install -C -o root -m 644 buttons.dat /usr/local/share/netmapr/buttons.dat install -C -D -o root -m 644 buttons.dat /usr/local/share/netmapr/buttons.dat
install -C -o root -m 644 objects.dat /usr/local/share/netmapr/objects.dat install -C -D -o root -m 644 objects.dat /usr/local/share/netmapr/objects.dat
install -C -o root -m 644 verdana.ttf /usr/local/share/netmapr/verdana.ttf install -C -D -o root -m 644 verdana.ttf /usr/local/share/netmapr/verdana.ttf
install -C -o root -m 644 icon.bmp /usr/local/share/netmapr/icon.bmp install -C -D -o root -m 644 icon.bmp /usr/local/share/netmapr/icon.bmp
ss: netmapr.jpg
convert netmapr.jpg -geometry 320x240 netmapr-small.jpg
convert netmapr.jpg -geometry 800x600 netmapr-fm.jpg
clean: netmapr convert netmapr-viewer
rm -f netmapr convert netmapr-viewer

View File

@ -8,3 +8,6 @@ install: netmapr
install -C -o root -m 644 objects.dat /usr/local/share/netmapr/objects.dat install -C -o root -m 644 objects.dat /usr/local/share/netmapr/objects.dat
install -C -o root -m 644 verdana.ttf /usr/local/share/netmapr/verdana.ttf install -C -o root -m 644 verdana.ttf /usr/local/share/netmapr/verdana.ttf
install -C -o root -m 644 icon.bmp /usr/local/share/netmapr/icon.bmp install -C -o root -m 644 icon.bmp /usr/local/share/netmapr/icon.bmp
clean: netmapr convert netmapr-viewer
rm -f netmapr convert netmapr-viewer

View File

@ -9,3 +9,6 @@ install: netmapr
install -C -D -o root -m 644 objects.dat /usr/local/share/netmapr/objects.dat install -C -D -o root -m 644 objects.dat /usr/local/share/netmapr/objects.dat
install -C -D -o root -m 644 verdana.ttf /usr/local/share/netmapr/verdana.ttf install -C -D -o root -m 644 verdana.ttf /usr/local/share/netmapr/verdana.ttf
install -C -D -o root -m 644 icon.bmp /usr/local/share/netmapr/icon.bmp install -C -D -o root -m 644 icon.bmp /usr/local/share/netmapr/icon.bmp
clean: netmapr convert netmapr-viewer
rm -f netmapr convert netmapr-viewer

View File

@ -3,3 +3,7 @@ netmapr: netmapr.c constants.h netmapr.h Makefile
convert: convert.c convert.h Makefile convert: convert.c convert.h Makefile
gcc -Wall -g convert.c -I/usr/local/include -oconvert -lmingw32 -L/usr/local/lib -lSDLmain -lSDL gcc -Wall -g convert.c -I/usr/local/include -oconvert -lmingw32 -L/usr/local/lib -lSDLmain -lSDL
clean: netmapr convert netmapr-viewer
rm -f netmapr convert netmapr-viewer

View File

@ -21,6 +21,60 @@ line 20 100 60 20 190 190 190
line 100 100 60 20 190 190 190 line 100 100 60 20 190 190 190
line 40 60 80 60 190 190 190 line 40 60 80 60 190 190 190
end end
button copy 120 120
# corner
line 10 20 30 0 190 190 190
line 30 0 30 20 190 190 190
line 10 20 30 20 190 190 190
# paper
line 10 20 10 70 190 190 190
line 10 70 40 70 190 190 190
line 60 40 60 0 190 190 190
line 60 0 30 0 190 190 190
# 2nd corner
line 40 60 60 40 190 190 190
line 40 60 60 60 190 190 190
line 60 40 60 60 190 190 190
# 2nd paper
line 40 60 40 110 190 190 190
line 40 110 90 110 190 190 190
line 90 110 90 40 190 190 190
line 90 40 60 40 190 190 190
end
button paste 120 120
# clip
line 45 0 55 0 190 190 190
line 55 0 70 15 190 190 190
line 45 0 30 15 190 190 190
line 30 15 70 15 190 190 190
# board
line 50 5 10 5 190 190 190
line 10 5 10 90 190 190 190
line 10 90 50 90 190 190 190
line 90 40 90 5 190 190 190
line 90 5 60 5 190 190 190
# paper
line 90 40 50 40 190 190 190
line 50 40 50 110 190 190 190
line 50 110 110 110 190 190 190
line 110 110 110 60 190 190 190
line 110 60 90 40 190 190 190
# fold
line 90 40 90 60 190 190 190
line 90 60 110 60 190 190 190
# lines
line 60 50 80 50 190 190 190
line 60 60 80 60 190 190 190
line 60 74 95 74 190 190 190
line 60 86 95 86 190 190 190
line 60 99 95 99 190 190 190
end
button grid 120 120
line 10 35 100 35 190 190 190
line 10 75 100 75 190 190 190
line 35 10 35 100 190 190 190
line 75 10 75 100 190 190 190
end
button fgcol 120 120 button fgcol 120 120
# colour box # colour box
box 10 10 100 70 190 190 190 box 10 10 100 70 190 190 190
@ -76,18 +130,25 @@ box 60 10 100 50 190 190 190
box 60 60 100 100 190 190 190 box 60 60 100 100 190 190 190
# lines # lines
line 10 10 60 10 150 150 150 line 10 10 60 10 150 150 150
line 10 30 60 30 150 150 150 line 10 10 10 100 150 150 150
line 10 50 60 50 150 150 150 #
line 25 30 60 30 150 150 150
line 25 30 25 100 150 150 150
#
line 35 50 60 50 150 150 150
line 35 50 35 100 150 150 150
end end
button matchy 120 120 button flow 120 90
#left # t
box 5 60 45 100 190 190 190 line 0 10 30 10 190 190 190
#right line 15 10 15 40 190 190 190
box 60 60 100 100 190 190 190 # c
#lines line 70 10 40 10 190 190 190
line 60 10 60 60 150 150 150 line 40 10 40 40 190 190 190
line 80 10 80 60 150 150 150 line 40 40 70 40 190 190 190
line 100 10 100 60 150 150 150 # p
box 80 10 105 20 190 190 190
line 80 20 80 40 190 190 190
end end
button drilldown 120 120 button drilldown 120 120
# down line # down line

View File

@ -1,5 +1,6 @@
#define VERSION "1.3" #define VERSION "1.4"
#define SMALLBUFLEN 64
#define BUFLEN 512 #define BUFLEN 512
#define DOUBLECLICKTHRES 250 #define DOUBLECLICKTHRES 250
@ -40,6 +41,8 @@
#define MAXFILLSTACK 500000 #define MAXFILLSTACK 500000
#define BEZIERQUALITY 50
#define SHORTCUTSIZE (10) #define SHORTCUTSIZE (10)
#define OLDMAXVECTORSPERIMAGE (60) #define OLDMAXVECTORSPERIMAGE (60)
@ -50,9 +53,8 @@
#define OBJSELHANDLEPCT (15) #define OBJSELHANDLEPCT (15)
/* used as a NULL value for colours */ #define USECOLOUR (0x01) /* used as a NULL value for colours */
#define NOCOLOUR (99) #define ISFLOW (0x02) /* used to show whether things are traffic flows */
#define USECOLOUR (100)
#define GRIDBRIGHTNESS 100 #define GRIDBRIGHTNESS 100
@ -61,7 +63,7 @@
#define T_LINK (2) #define T_LINK (2)
#define T_TEXT (3) #define T_TEXT (3)
#define T_LINKPOINT (4) #define T_LINKPOINT (4)
#define T_MAP (5) #define T_MAP (5)
#define O_ROUTER (0) #define O_ROUTER (0)
#define O_SWITCH (1) #define O_SWITCH (1)
@ -75,6 +77,7 @@
#define VT_FILL (3) #define VT_FILL (3)
#define VT_ELLIPSE (4) #define VT_ELLIPSE (4)
#define VT_FILLBOX (5) #define VT_FILLBOX (5)
#define VT_BEZIER (6)
#define TRUE (-1) #define TRUE (-1)
#define FALSE (0) #define FALSE (0)
@ -104,23 +107,27 @@
#define S_FILLCOL (22) #define S_FILLCOL (22)
#define S_EDITTEXT (23) #define S_EDITTEXT (23)
#define S_CHANGEOBJECT (24) #define S_CHANGEOBJECT (24)
#define S_DRAWFLOW (25)
#define TB_POINTER (0) #define TB_POINTER (0)
#define TB_ADDOBJ (1) #define TB_ADDOBJ (1)
#define TB_ADDTEXT (2) #define TB_ADDTEXT (2)
#define TB_FGCOL (3) #define TB_COPY (3)
#define TB_FILLCOL (4) #define TB_PASTE (4)
#define TB_LINESTYLE (5) #define TB_GRID (5)
#define TB_MATCHSIZE (6) #define TB_FGCOL (6)
#define TB_MATCHX (7) #define TB_FILLCOL (7)
#define TB_MATCHY (8) #define TB_LINESTYLE (8)
#define TB_DRILLDOWN (9) #define TB_MATCHSIZE (9)
#define TB_CREATETELE (10) #define TB_MATCHPOS (10)
#define TB_DELETEMAP (11) #define TB_FLOW (11)
#define TB_NEW (12) #define TB_DRILLDOWN (12)
#define TB_LOAD (13) #define TB_CREATETELE (13)
#define TB_SAVE (14) #define TB_DELETEMAP (14)
#define TB_NEW (15)
#define TB_LOAD (16)
#define TB_SAVE (17)
#define SIDEBARW 100 #define SIDEBARW 100

View File

@ -8,6 +8,7 @@ WINFILE=${FULLNAME}-win32.zip
mkdir ${FULLNAME} mkdir ${FULLNAME}
cp README.txt INSTALL.txt Makefile.linux Makefile.freebsd Makefile.windows objects.dat buttons.dat netmapr.c netmapr.h constants.h convert.c convert.h icon.bmp verdana.ttf example.map ${FULLNAME}/ cp README.txt INSTALL.txt Makefile.linux Makefile.freebsd Makefile.windows objects.dat buttons.dat netmapr.c netmapr.h constants.h convert.c convert.h icon.bmp verdana.ttf example.map ${FULLNAME}/
cp -R doc ${FULLNAME}/ cp -R doc ${FULLNAME}/
rm -rf ${FULLNAME}/doc/CVS
tar zcvf ${TARFILE} ${FULLNAME} tar zcvf ${TARFILE} ${FULLNAME}
rm -rf ${FULLNAME} rm -rf ${FULLNAME}
@ -15,5 +16,6 @@ rm -rf ${FULLNAME}
mkdir ${FULLNAME} mkdir ${FULLNAME}
cp README.txt INSTALL.txt objects.dat buttons.dat netmapr.exe netmapr.c netmapr.h constants.h convert.c convert.h verdana.ttf example.map icon.bmp windows_files/*.dll ${FULLNAME}/ cp README.txt INSTALL.txt objects.dat buttons.dat netmapr.exe netmapr.c netmapr.h constants.h convert.c convert.h verdana.ttf example.map icon.bmp windows_files/*.dll ${FULLNAME}/
cp -R doc ${FULLNAME}/ cp -R doc ${FULLNAME}/
rm -rf ${FULLNAME}/doc/CVS
zip -r ${WINFILE} ${FULLNAME} zip -r ${WINFILE} ${FULLNAME}
rm -rf ${FULLNAME} rm -rf ${FULLNAME}

Binary file not shown.

967
netmapr.c

File diff suppressed because it is too large Load Diff

View File

@ -44,6 +44,7 @@ typedef struct {
int y; int y;
int w; int w;
int h; int h;
/* top bit of c.unused says whether or not this is a flow */
SDL_Color c; SDL_Color c;
int anchor; int anchor;
} text_t; } text_t;
@ -58,6 +59,7 @@ typedef struct {
int dstyoff; int dstyoff;
int npoints; int npoints;
xy_t point[MAXPOINTS]; xy_t point[MAXPOINTS];
/* top bit of c.unused says whether or not this is a flow */
SDL_Color col; SDL_Color col;
int style; int style;
} link_t; } link_t;
@ -105,8 +107,9 @@ typedef struct {
int w; int w;
int h; int h;
int child; int child;
/* fillcol.unused = 1 means to fill with this colour */ /* fillcol.unused top bit unused says whether or not this is a flow */
/* fillcol.unused = NOCOLOUR means to ignore this*/ /* (fillcol.unused & 1) == 1 means to fill with this colour */
/* (fillcol.unused & 1) == NOCOLOUR means to ignore this*/
SDL_Color fillcol; SDL_Color fillcol;
} mapobject_t; } mapobject_t;
@ -161,15 +164,18 @@ typedef struct {
map_t map[MAXMAPS]; map_t map[MAXMAPS];
char typedesc[6][BUFLEN];
void addlinkpoint(int linkid, int x, int y); void addlinkpoint(int linkid, int x, int y);
int addvector(vectorimg_t *vimg, int type, int x1, int y1, int x2, int y2, SDL_Color *c); int addvector(vectorimg_t *vimg, int type, int x1, int y1, int x2, int y2, SDL_Color *c);
void changegridsize(void);
void changelinearrow(int changeby); void changelinearrow(int changeby);
void changelinestyle(int changeby); void changelinestyle(int changeby);
void changelinethickness(int changeby); void changelinethickness(int changeby);
void changemap(int newmap); void changemap(int newmap);
void changestate(int newstate); void changestate(int newstate);
void cleanup(void); void cleanup(void);
void copy(void);
int createobject(int type, int x, int y); int createobject(int type, int x, int y);
void copyline(SDL_Surface *screen,int x1, int y1, int x2, int y2, int *lbuf); void copyline(SDL_Surface *screen,int x1, int y1, int x2, int y2, int *lbuf);
void deletething(int id, int type); void deletething(int id, int type);
@ -177,10 +183,13 @@ void deletelink(int linkid);
void deleteobject(int oid ); void deleteobject(int oid );
void deletetext(int textid); void deletetext(int textid);
void drawarrowhead(SDL_Surface *screen, double x1, double y1, double x2, double y2, SDL_Color c, int arrowstyle, int arrowpos); void drawarrowhead(SDL_Surface *screen, double x1, double y1, double x2, double y2, SDL_Color c, int arrowstyle, int arrowpos);
void lerp(int *newx, int *newy, int ax, int ay, int bx, int by, float t);
void drawbezier(SDL_Surface *screen, int x1, int y1, int x2,int y2, int x3,int y3, int x4,int y4, SDL_Color c);
void drawbox(SDL_Surface *screen, int x1, int y1, int x2, int y2, SDL_Color c); void drawbox(SDL_Surface *screen, int x1, int y1, int x2, int y2, SDL_Color c);
void drawfillbox(SDL_Surface *screen, int x1, int y1, int x2, int y2, SDL_Color c); void drawfillbox(SDL_Surface *screen, int x1, int y1, int x2, int y2, SDL_Color c);
void drawellipsepoints(SDL_Surface *screen, int x1, int y1, int x, int y, SDL_Color c); void drawellipsepoints(SDL_Surface *screen, int x1, int y1, int x, int y, SDL_Color c);
void drawellipse(SDL_Surface *screen, int x1, int y1, int x2, int y2, SDL_Color c); void drawellipse(SDL_Surface *screen, int x1, int y1, int x2, int y2, SDL_Color c);
void drawflowbox(SDL_Surface *dest, int oid, int otype);
void drawcolorchart(SDL_Surface *dest); void drawcolorchart(SDL_Surface *dest);
void drawmaplist(SDL_Surface *dest); void drawmaplist(SDL_Surface *dest);
int drawletter(SDL_Surface *dest,int x, int y, int w, int h, char let, SDL_Color col); int drawletter(SDL_Surface *dest,int x, int y, int w, int h, char let, SDL_Color col);
@ -225,12 +234,14 @@ int linkat(int x, int y);
int loadmap(void); int loadmap(void);
void lowerselected(void); void lowerselected(void);
int objat(int x, int y); int objat(int x, int y);
void paste(void);
void pasteline(SDL_Surface *screen, int *lbuf); void pasteline(SDL_Surface *screen, int *lbuf);
void pop(int *x, int *y); void pop(int *x, int *y);
void push(int x, int y); void push(int x, int y);
int initgraphics(void); int initgraphics(void);
void initmap(int mapnum); void initmap(int mapnum);
int initobject(int onum); int initobject(int onum);
int isflow(int oid, int otype);
int isonline (int fx, int fy, int x1, int y1, int x2, int y2); int isonline (int fx, int fy, int x1, int y1, int x2, int y2);
int isonlink(int linkid, int mx, int my); int isonlink(int linkid, int mx, int my);
int isonlinkdst(int lineid, int mx, int my); int isonlinkdst(int lineid, int mx, int my);
@ -245,6 +256,7 @@ int isonmapname (int x, int y);
int isongoback (int x, int y); int isongoback (int x, int y);
void initvars(void); void initvars(void);
void raiseselected(void); void raiseselected(void);
void setmod(int tf);
int savemap(void); int savemap(void);
int showfiledialog(void); int showfiledialog(void);
void startedittext (int o); void startedittext (int o);
@ -258,6 +270,8 @@ int startresize (int x, int y);
int startresizetext (int x, int y); int startresizetext (int x, int y);
int starttextmove(int x, int y); int starttextmove(int x, int y);
int textat(int x, int y); int textat(int x, int y);
void toggleflow(int oid, int otype);
void togglegrid(void);
int thingat(int x, int y); int thingat(int x, int y);
int updatefilename(void); int updatefilename(void);
int updatelinkshadow(int x, int y); int updatelinkshadow(int x, int y);
@ -267,3 +281,4 @@ int updateresizeshadow(int x, int y);
int updateresizetextshadow(int x, int y); int updateresizetextshadow(int x, int y);
int updatetextcursor(void); int updatetextcursor(void);
int updatetextshadow(int x, int y); int updatetextshadow(int x, int y);
void updatewm(void);

View File

@ -222,48 +222,15 @@ line 90 30 90 80 0 0 0
# fill monitor screen # fill monitor screen
fill 50 50 0 0 255 fill 50 50 0 0 255
end end
object cloud 105 105 object cloud 102 102
# top bezier 37 15 45 0 60 0 67 15 0 0 0
# / bezier 67 15 80 0 104 15 90 37 0 0 0
line 0 15 15 0 0 0 0 bezier 90 37 104 45 104 60 90 67 0 0 0
line 15 0 30 0 0 0 0 bezier 90 67 104 75 90 104 67 89 0 0 0
line 30 0 37 10 0 0 0 bezier 67 89 60 104 45 104 37 89 0 0 0
line 37 10 45 0 0 0 0 bezier 37 89 30 104 0 90 10 67 0 0 0
line 45 0 60 0 0 0 0 bezier 10 67 0 60 0 45 10 37 0 0 0
line 60 0 67 10 0 0 0 bezier 10 37 0 30 15 0 37 15 0 0 0
line 67 10 75 0 0 0 0
line 75 0 90 0 0 0 0
line 90 0 104 15 0 0 0
# right
# |
line 104 15 104 30 0 0 0
line 104 30 90 37 0 0 0
line 90 37 104 45 0 0 0
line 104 45 104 60 0 0 0
line 104 60 90 67 0 0 0
line 90 67 104 75 0 0 0
line 104 75 104 90 0 0 0
line 104 90 90 104 0 0 0
# bottom
# _
line 90 104 75 104 0 0 0
line 75 104 67 94 0 0 0
line 67 94 60 104 0 0 0
line 60 104 45 104 0 0 0
line 45 104 37 94 0 0 0
line 37 94 30 104 0 0 0
line 30 104 15 104 0 0 0
line 15 104 0 90 0 0 0
# left
# |
line 0 90 0 75 0 0 0
line 0 75 10 67 0 0 0
line 10 67 0 60 0 0 0
line 0 60 0 45 0 0 0
line 0 45 10 37 0 0 0
line 10 37 0 30 0 0 0
line 0 30 0 15 0 0 0
# insides
fill 60 60 180 180 180 fill 60 60 180 180 180
end end
object server 120 120 object server 120 120

11
windist.sh Executable file
View File

@ -0,0 +1,11 @@
#!/bin/sh
VERSION=`cat constants.h | grep VERSION | awk '{ v=$3; gsub("\"","",v); print v }'`
FULLNAME=netmapr-${VERSION}
TARFILE=${FULLNAME}.tar.gz
WINFILE=${FULLNAME}-win32.zip
mkdir ${FULLNAME}
cp README.txt INSTALL.txt objects.dat buttons.dat netmapr.exe netmapr.c netmapr.h constants.h convert.c convert.h verdana.ttf example.map icon.bmp windows_files/*.dll ${FULLNAME}/
cp -R doc ${FULLNAME}/