From: ellson Date: Fri, 25 Apr 2008 14:52:35 +0000 (+0000) Subject: use smyrnaPat() to eliminat all Makefile.am -D (except default SMYRNA_PATH) X-Git-Tag: LAST_LIBGRAPH~32^2~4202 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=07a6a10bd32ae435d95b9d5026577ae9a90cf2ad;p=graphviz use smyrnaPat() to eliminat all Makefile.am -D (except default SMYRNA_PATH) --- diff --git a/cmd/smyrna/Makefile.am b/cmd/smyrna/Makefile.am index 66e921f76..688c8f15a 100644 --- a/cmd/smyrna/Makefile.am +++ b/cmd/smyrna/Makefile.am @@ -3,15 +3,6 @@ icondir = $(pkgdatadir)/icons AM_CPPFLAGS = \ -DSMYRNA_PATH=\""$(pkgdatadir)"\" \ - -DSMYRNA_GLADE=\""$(guidir)/smyrna.glade"\" \ - -DSMYRNA_ATTRS=\""$(guidir)/attrs.txt"\" \ - -DSMYRNA_FONT=\""$(guidir)/arial.tga"\" \ - -DSMYRNA_ICON_PAN=\""$(icondir)/pan.raw"\" \ - -DSMYRNA_ICON_ZOOM=\""$(icondir)/zoom.raw"\" \ - -DSMYRNA_ICON_ZOOMPLUS=\""$(icondir)/zoomplus.raw"\" \ - -DSMYRNA_ICON_ZOOMMINUS=\""$(icondir)/zoomminus.raw"\" \ - -DSMYRNA_ICON_FISHEYE=\""$(icondir)/fisheye.raw"\" \ - -DSMYRNA_ICON_ROTATE=\""$(icondir)/rotate.raw"\" \ -I$(top_srcdir) \ -I$(top_srcdir)/lib/cgraph \ -I$(top_srcdir)/lib/cdt \ diff --git a/cmd/smyrna/gltemplate.c b/cmd/smyrna/gltemplate.c index 08f75e483..f7aeb309e 100755 --- a/cmd/smyrna/gltemplate.c +++ b/cmd/smyrna/gltemplate.c @@ -132,16 +132,12 @@ static void realize(GtkWidget * widget, gpointer data) char *smyrna_font; #ifdef WIN32 -#define SMYRNA_FONT "c:/arial.tga" -// #else -// using -DSMYRNA_FONT from Makefile.am and configure.ac + smyrna_font = "c:/arial.tga" +#else + smyrna_font = smyrnaPath("gui/arial.tga"); #endif - - if ((smyrna_font = smyrnaPath("gui/arial.tga"))) { - g_print("loading font....%i\n", fontLoad(smyrna_font)); - free(smyrna_font); - } else - g_print("loading font....%i\n", fontLoad(SMYRNA_FONT)); + g_print("loading font....%i\n", fontLoad(smyrna_font)); + free(smyrna_font); /*** OpenGL BEGIN ***/ if (!gdk_gl_drawable_gl_begin(gldrawable, glcontext)) diff --git a/cmd/smyrna/gui/gui.c b/cmd/smyrna/gui/gui.c index a221165fb..19928eb35 100755 --- a/cmd/smyrna/gui/gui.c +++ b/cmd/smyrna/gui/gui.c @@ -638,8 +638,11 @@ void load_attributes() static char* smyrna_attrs; if (!smyrna_attrs) { - if (!(smyrna_attrs = smyrnaPath ("gui/attrs.txt"))) - smyrna_attrs = SMYRNA_ATTRS; +#if WIN32 + smyrna_attrs = SMYRNA_ATTRS; +#else + smyrna_attrs = smyrnaPath ("gui/attrs.txt"); +#endif } //loads attributes from a text file diff --git a/cmd/smyrna/main.c b/cmd/smyrna/main.c index d80116a0e..3fb0a933b 100755 --- a/cmd/smyrna/main.c +++ b/cmd/smyrna/main.c @@ -91,8 +91,12 @@ int main(int argc, char *argv[]) #ifdef _WIN32 #define GTKTOPVIEW_ICONSDIR "C:\\Projects\\ATT\\GTK\\GTKTest2\\GUI\\images\\" #endif - if (!(smyrnaGlade = smyrnaPath ("gui/smyrna.glade"))) { + if (!(smyrnaGlade)) { +#ifdef _WIN32 smyrnaGlade = SMYRNA_GLADE; +#else + smyrnaGlade = smyrnaPath ("gui/smyrna.glade"); +#endif } xml = glade_xml_new(smyrnaGlade, NULL, NULL); gladewidget = glade_xml_get_widget(xml, "frmMain"); diff --git a/cmd/smyrna/topview.c b/cmd/smyrna/topview.c index b8d3595f1..1eee036e4 100755 --- a/cmd/smyrna/topview.c +++ b/cmd/smyrna/topview.c @@ -947,16 +947,6 @@ void menu_click_rotate_z(void* p) view->mouse.rotate_axis=MOUSE_ROTATE_Z; } - -#ifdef _WIN32 -#define SMYRNA_ICON_PAN "c:/pan.raw" -#define SMYRNA_ICON_ZOOM "c:/zoom.raw" -#define SMYRNA_ICON_ZOOMPLUS "c:/zoomplus.raw" -#define SMYRNA_ICON_ZOOMMINUS "c:/zoomminus.raw" -#define SMYRNA_ICON_FISHEYE "c:/fisheye.raw" -#define SMYRNA_ICON_ROTATE "c:/rotate.raw" -#endif - static char* smyrna_icon_pan; static char* smyrna_icon_zoom; static char* smyrna_icon_zoomplus; @@ -964,8 +954,6 @@ static char* smyrna_icon_zoomminus; static char* smyrna_icon_fisheye; static char* smyrna_icon_rotate; -#define SET_PATH(var,sfx,dflt) if (!(var=smyrnaPath(sfx))) var = dflt - glCompSet *glcreate_gl_topview_menu() { @@ -975,12 +963,21 @@ glCompSet *glcreate_gl_topview_menu() glCompLabel *l; if (!smyrna_icon_pan) { - SET_PATH(smyrna_icon_pan,"icons/pan.raw",SMYRNA_ICON_PAN); - SET_PATH(smyrna_icon_zoom,"icons/zoom.raw",SMYRNA_ICON_ZOOM); - SET_PATH(smyrna_icon_zoomplus,"icons/zoomplus.raw",SMYRNA_ICON_ZOOMPLUS); - SET_PATH(smyrna_icon_zoomminus,"icons/zoomminus.raw",SMYRNA_ICON_ZOOMMINUS); - SET_PATH(smyrna_icon_fisheye,"icons/fisheye.raw",SMYRNA_ICON_FISHEYE); - SET_PATH(smyrna_icon_rotate,"icons/rotate.raw",SMYRNA_ICON_ROTATE); +#ifdef _WIN32 + smyrna_icon_pan = "c:/pan.raw" + smyrna_icon_zoom = "c:/zoom.raw" + smyrna_icon_zoomplus = "c:/zoomplus.raw" + smyrna_icon_zoomminus = "c:/zoomminus.raw" + smyrna_icon_fisheye = "c:/fisheye.raw" + smyrna_icon_rotate = "c:/rotate.raw" +#else + smyrna_icon_pan = smyrnaPath("icons/pan.raw"); + smyrna_icon_zoom = smyrnaPath("icons/zoom.raw"); + smyrna_icon_zoomplus = smyrnaPath("icons/zoomplus.raw"); + smyrna_icon_zoomminus = smyrnaPath("icons/zoomminus.raw"); + smyrna_icon_fisheye = smyrnaPath("icons/fisheye.raw"); + smyrna_icon_rotate = smyrnaPath("icons/rotate.raw"); +#endif } s->panelcount = 0; @@ -1062,7 +1059,7 @@ glCompSet *glcreate_gl_topview_menu() glCompSetAddButton(s, b); //rotate - b = glCompButtonNew(5, 197, 72, 72, "", SMYRNA_ICON_ROTATE, + b = glCompButtonNew(5, 197, 72, 72, "", smyrna_icon_rotate, 72, 72); b->groupid = 3; b->customptr = view; @@ -1097,7 +1094,7 @@ glCompSet *glcreate_gl_topview_menu() //pan button - b = glCompButtonNew(5, 120, 72, 72, "adasasds", SMYRNA_ICON_PAN, 72, + b = glCompButtonNew(5, 120, 72, 72, "adasasds", smyrna_icon_pan, 72, 72); b->groupid = 3; b->customptr = view; @@ -1105,7 +1102,7 @@ glCompSet *glcreate_gl_topview_menu() b->callbackfunc = menu_click_pan; glCompSetAddButton(s, b); //zoom - b = glCompButtonNew(85, 120, 72, 72, "adasasds", SMYRNA_ICON_ZOOM, 72, + b = glCompButtonNew(85, 120, 72, 72, "adasasds", smyrna_icon_zoom, 72, 72); b->groupid = 3; b->customptr = view; @@ -1113,7 +1110,7 @@ glCompSet *glcreate_gl_topview_menu() b->callbackfunc = menu_click_zoom; glCompSetAddButton(s, b); //zoom + - b = glCompButtonNew(85, 82, 36, 36, "adasasds", SMYRNA_ICON_ZOOMPLUS, + b = glCompButtonNew(85, 82, 36, 36, "adasasds", smyrna_icon_zoomplus, 36, 36); b->groupid = 0; b->customptr = view; @@ -1121,7 +1118,7 @@ glCompSet *glcreate_gl_topview_menu() b->callbackfunc = menu_click_zoom_plus; glCompSetAddButton(s, b); //zoom - - b = glCompButtonNew(121, 82, 36, 36, "adasasds", SMYRNA_ICON_ZOOMMINUS, + b = glCompButtonNew(121, 82, 36, 36, "adasasds", smyrna_icon_zoomminus, 36, 36); b->groupid = 0; b->panel = p; @@ -1129,7 +1126,7 @@ glCompSet *glcreate_gl_topview_menu() b->callbackfunc = menu_click_zoom_minus; glCompSetAddButton(s, b); - b = glCompButtonNew(5, 45, 72, 72, "adasasds", SMYRNA_ICON_FISHEYE, 72, + b = glCompButtonNew(5, 45, 72, 72, "adasasds", smyrna_icon_fisheye, 72, 72); b->groupid = 3; b->panel = p; @@ -1154,13 +1151,13 @@ glCompSet *glcreate_gl_topview_menu() p->data=2; //data panel glCompSetAddPanel(s,p); //alpha plus button - b=glCompButtonNew(75,3,36,36,"",SMYRNA_ICON_ZOOMPLUS,36,36); + b=glCompButtonNew(75,3,36,36,"",smyrna_icon_zoomplus,36,36); b->groupid=0; b->panel=p; b->callbackfunc=menu_click_alpha_plus; glCompSetAddButton(s,b); //alpha minus button - b=glCompButtonNew(113,3,36,36,"",SMYRNA_ICON_ZOOMMINUS,36,36); + b=glCompButtonNew(113,3,36,36,"",smyrna_icon_zoomminus,36,36); b->groupid=0; b->panel=p; b->callbackfunc=menu_click_alpha_plus;