]> granicus.if.org Git - graphviz/commitdiff
use smyrnaPat() to eliminat all Makefile.am -D (except default SMYRNA_PATH)
authorellson <devnull@localhost>
Fri, 25 Apr 2008 14:52:35 +0000 (14:52 +0000)
committerellson <devnull@localhost>
Fri, 25 Apr 2008 14:52:35 +0000 (14:52 +0000)
cmd/smyrna/Makefile.am
cmd/smyrna/gltemplate.c
cmd/smyrna/gui/gui.c
cmd/smyrna/main.c
cmd/smyrna/topview.c

index 66e921f7642b113794ece56db0082aa2ac6ade2c..688c8f15acd54e395beac002d839ea2c1a9df86e 100644 (file)
@@ -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 \
index 08f75e483d920d15f8069c42e495716285aefd77..f7aeb309eb714628b8b5d2e4a724c1f5025e710d 100755 (executable)
@@ -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))
index a221165fbb15639bef3fe5c7ad61959db2c83553..19928eb35ac3d4cb7a4a5a283646101025bf6a69 100755 (executable)
@@ -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
index d80116a0e41e1d62d42e2ef77a3294c4a436a3db..3fb0a933baa03fbc2020c0065e471984047b9186 100755 (executable)
@@ -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");
index b8d3595f1f1034b97c566363d9f6d5ced57b2a59..1eee036e4ca738bb063839f46a020cb646243c65 100755 (executable)
@@ -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;