]> granicus.if.org Git - graphviz/commitdiff
*** empty log message ***
authorarif <devnull@localhost>
Tue, 4 Mar 2008 17:54:53 +0000 (17:54 +0000)
committerarif <devnull@localhost>
Tue, 4 Mar 2008 17:54:53 +0000 (17:54 +0000)
13 files changed:
cmd/smyrna/btree.c
cmd/smyrna/gui/callbacks.c
cmd/smyrna/gui/datalistcallbacks.c
cmd/smyrna/gui/glmenu.c
cmd/smyrna/gui/gui.c
cmd/smyrna/gui/menucallbacks.c
cmd/smyrna/gui/toolboxcallbacks.c
cmd/smyrna/selection.h
cmd/smyrna/topview.c
cmd/smyrna/topviewdata.c
cmd/smyrna/viewport.c
cmd/smyrna/viewport.h
lib/cgraph/write.c

index 2ec5598ebfba3075106401d34d7f101838dfdda5..4e198e253f0a8ccf36a43fad81fc8a528107986c 100644 (file)
@@ -15,7 +15,7 @@
 **********************************************************/
 
 #include "btree.h"
-#include "regex.h"
+#include "regex_win32.h"
 btree_node* new_node(char* attribute,char* regex, float min, float max)
 {
        btree_node* n;
@@ -99,7 +99,6 @@ btree_node* look_up_node_with_string(btree_node* n,char* string_to_lookup)
 }
 int validate_lookup(btree_node* n,char* string_to_lookup)      //it can be anything, in this case attr_name
 {
-       printf ("%s == %s\n",n->attr_name,string_to_lookup);
        if (strcmp(n->attr_name,string_to_lookup)==0)
                return 1;
        return 0;
index b074ab997e0ccc66c164d423a90eae4b0bb8584b..a1d64bedc4f77eca49cf8ef8946275bb9c764678 100755 (executable)
@@ -216,13 +216,6 @@ on_newNode                     (GtkWidget     *button,
        int* b;
        a=(int*) malloc (sizeof(int));
        b=(int*) malloc (sizeof(int));
-       if(gdk_gl_query_version(a,b))
-       {
-               printf ("min ver:%i\n",a);
-               printf ("min ver:%i\n",b);
-
-
-       }
 }
 
 
@@ -308,7 +301,7 @@ void frmObjectBtnOK_clicked (GtkWidget *widget,gpointer     user_data)
                do_graph_layout(view->g[view->activeGraph],0,1);
        else
        {
-               set_update_required(&view->Topview);
+               set_update_required(view->Topview);
                deselect_all(view->g[view->activeGraph]);
        }
 
index a61b21013a4fe5841f9f565bfc8895fa3042be47..92fe78c3dd578a9e43b9e7419a0834f6f81c425d 100755 (executable)
 #include "tvnodes.h"
 void btnTVEdit_clicked_cb (GtkWidget *widget,gpointer user_data)
 {
-       printf("btnTVEdit_clicked_cb\n");
 }
 void btnTVDelete_clicked_cb (GtkWidget *widget,gpointer user_data)
 {
-       printf("btnTVDelete_clicked_cb\n");
 }
 void btnTVFilter_clicked_cb (GtkWidget *widget,gpointer user_data)
 {
@@ -62,7 +60,6 @@ void btnTVGotopage_clicked_cb (GtkWidget *widget,gpointer user_data)
 }
 void btnTVCancel_clicked_cb (GtkWidget *widget,gpointer user_data)
 {
-       printf("btnTVCancel_clicked_cb\n");
 }
 void btnTVOK_clicked_cb (GtkWidget *widget,gpointer user_data)
 {
@@ -71,11 +68,9 @@ void btnTVOK_clicked_cb (GtkWidget *widget,gpointer user_data)
 }
 void btnTVReverse_clicked_cb (GtkWidget *widget,gpointer user_data)
 {
-       printf("btnTVEdit_clicked_cb\n");
 }
 void cgbTVSelect_toggled_cb (GtkWidget *widget,gpointer user_data)
 {
-       printf("btnTVEdit_clicked_cb\n");
 }
 
 
index 14569d484b8527a6201cc4cf17f2d6a24eaea8a3..f944389c17e11f0bad83beeb9f3e19fd9bd33b4a 100644 (file)
@@ -7,7 +7,6 @@
 */
 GtkWidget* create_popup_menu (GtkWidget* drawing_area)
 {
-  GtkWidget *shapes_menu;
   GtkWidget *actions_menu;
   GtkWidget *editing_menu;
   GtkWidget *menu;
index 2d1e03a71cefc3423fa0acb937921c8ad2952274..6160b53b653ac6a2b89bb9593f5e82ac35f9431a 100755 (executable)
 
 static char guibuffer[255];    //general purpose buffer
 
+#ifdef WIN32
+extern int strcasecmp(const char *s1, const char *s2);
+extern int strncasecmp(const char *s1, const char *s2, unsigned int n);
+#endif
+
 GdkWindow* window1;
 GtkWidget *statusbar1;
 
@@ -55,7 +60,6 @@ attribute attr[MAXIMUM_WIDGET_COUNT];
 //call this function only ones
 void create_object_properties()
 {
-       char** testRows;
        char* data0="TEST0";
        char* data1="TEST1";
        char* data2="TEST2";
@@ -80,8 +84,6 @@ void create_object_properties()
 //call this after create_object_properties()
 void object_properties_node_init()
 {
-       GladeXML *xml;
-       GtkWidget *widget;
        
 }
 void object_properties_edge_init()     //customize window for Edges
@@ -295,10 +297,7 @@ int load_object_properties(int typeIndex,Agraph_t* g)      //load  from object to gui
        //load attr from first selected object
        GtkLayout* layout;
        GdkColor color;
-       FILE * file;
     char buf[100];
-       char string [100];
-       char *ss;
        int ind=0;
        int Y=45;
        int X=90;
@@ -310,7 +309,6 @@ int load_object_properties(int typeIndex,Agraph_t* g)       //load  from object to gui
        void* obj;
        char line [ 128 ];
        float a,b;
-       char* pch;
        layout=(GtkLayout*)glade_xml_get_widget(xml, "layout4");
        frmObjectTypeIndex=typeIndex;
        frmObjectg=g;
@@ -428,8 +426,8 @@ int load_object_properties(int typeIndex,Agraph_t* g)       //load  from object to gui
                 )
                 {
                        sprintf (line, "%s", agget(obj,"pos"));
-                       a=atof(strtok (line,"," ));
-                       b=atof(strtok (NULL,"," ));
+                       a=(float)atof(strtok (line,"," ));
+                       b=(float)atof(strtok (NULL,"," ));
                        gtk_spin_button_set_value ((GtkSpinButton*)glade_xml_get_widget(xml,"frmObjectPosX"), a );                                      
                        gtk_spin_button_set_value ((GtkSpinButton*)glade_xml_get_widget(xml,"frmObjectPosY"), b );                                      
                        gtk_spin_button_set_value ((GtkSpinButton*)glade_xml_get_widget(xml,"frmObjectPosZ"), 0 );                                      
index 92e20ce53e919ad88e36d42967effa31d104f9f7..27cee7af97b3d7dc935f07489659f0633a5eda66 100755 (executable)
 #include "menucallbacks.h"
 #include "viewport.h"
 #include "tvnodes.h"
+#include "selection.h"
+
 
 //file
 char buf[255];
 void mNewSlot (GtkWidget *widget,gpointer user_data)
 {
-       printf("mNewSlot \n");
 }
 
   void mOpenSlot (GtkWidget *widget,gpointer user_data)
@@ -30,7 +31,6 @@ void mNewSlot (GtkWidget *widget,gpointer user_data)
        GtkWidget *dialog;
        GtkFileFilter* filter;
 
-       printf("mOpenSlot \n");
 
        filter=gtk_file_filter_new ();
        gtk_file_filter_add_pattern(filter,"*.dot");
@@ -65,7 +65,6 @@ void mNewSlot (GtkWidget *widget,gpointer user_data)
 }
   void mOptionsSlot (GtkWidget *widget,gpointer user_data)
 {
-       printf("mOptionsSlot\n");
 }
 
   void mQuitSlot (GtkWidget *widget,gpointer user_data)
@@ -108,22 +107,18 @@ void mNewSlot (GtkWidget *widget,gpointer user_data)
 //edit
   void mCutSlot (GtkWidget *widget,gpointer user_data)
 {
-       printf("mCutSlot\n");
 }
 
   void mCopySlot (GtkWidget *widget,gpointer user_data)
 {
-       printf("mCopySlot\n");
 }
 
   void mPasteSlot (GtkWidget *widget,gpointer user_data)
 {
-       printf("mPasteSlot\n");
 }
 
   void mDeleteSlot (GtkWidget *widget,gpointer user_data)
 {
-       printf("mDeleteSlot\n");
 }
 
 
@@ -155,16 +150,13 @@ void mShowHostSelectionSlot(GtkWidget *widget,gpointer user_data)
 
   void mNewNodeSlot (GtkWidget *widget,gpointer user_data)
 {
-       printf("mNewNodeSlot\n");
 }
 
   void mNewEdgeSlot (GtkWidget *widget,gpointer user_data)
 {
-       printf("mNewEdgeSlot\n");
 }
   void mNewClusterSlot (GtkWidget *widget,gpointer user_data)
 {
-       printf("mNewClusterSlot\n");
 }
 
   void mGraphPropertiesSlot (GtkWidget *widget,gpointer user_data)
@@ -245,7 +237,6 @@ void mShowHostSelectionSlot(GtkWidget *widget,gpointer user_data)
 
   void mShowCodeSlot (GtkWidget *widget,gpointer user_data)
 {
-       printf("mShowCodeSlot\n");
 }
   void mDotSlot (GtkWidget *widget,gpointer user_data)
 {
@@ -372,27 +363,22 @@ void mUnselectAllClustersSlot(GtkWidget *widget,gpointer user_data)
 
 void mSingleSelectSlot(GtkWidget *widget,gpointer user_data)
 {
-       printf("mSingleSelectSlot\n");
 }
 
 void mSelectAreaSlot(GtkWidget *widget,gpointer user_data)
 {
-       printf("mSelectAreaSlot\n");
 }
 
 void mSelectAreaXSlot(GtkWidget *widget,gpointer user_data)
 {
-       printf("mSelectAreaXSlot\n");
 
 }
 
 //help
 void mAbout(GtkWidget *widget,gpointer user_data)
 {
-       printf("mAbout\n");
 }
 
 void mHelp(GtkWidget *widget,gpointer user_data)
 {
-       printf("mHelp\n");
 }
index acbb924d825aff7d984240cb368decc4de9ce1ca..38212842a213f70a1f5c1bcf6ee12b0c670199b4 100755 (executable)
@@ -16,6 +16,8 @@
 
 #include "toolboxcallbacks.h"
 #include "viewport.h"
+#include "selection.h"
+#include "gltemplate.h"
 
 
 void btnToolSingleSelect_clicked(GtkWidget *widget,gpointer user_data)
@@ -64,8 +66,8 @@ void btnToolZoomIn_clicked                       (GtkWidget *widget,gpointer use
 {
        view->zoom = view->zoom + ZOOM_STEP;
        if(view->zoom > MAX_ZOOM)
-               view->zoom=MAX_ZOOM;
-       expose_event (view->drawing_area,NULL,NULL);
+               view->zoom=(float)MAX_ZOOM;
+       glexpose();
 
 }
 void btnToolZoomOut_clicked                       (GtkWidget *widget,gpointer user_data)
@@ -77,7 +79,6 @@ void btnToolZoomOut_clicked                       (GtkWidget *widget,gpointer us
 }
 void btnToolFit_clicked                       (GtkWidget *widget,gpointer user_data)
 {
-       printf("btnToolFit_clicked\n");
 }
 void btnToolMove_clicked                       (GtkWidget *widget,gpointer user_data)
 {
@@ -85,26 +86,19 @@ void btnToolMove_clicked                       (GtkWidget *widget,gpointer user_
 }
 void btnToolAddNode_clicked                       (GtkWidget *widget,gpointer user_data)
 {
-       printf("btnToolAddNode_clicked\n");
 }
 void btnToolDeleteNode_clicked                       (GtkWidget *widget,gpointer user_data)
 {
-       printf("btnToolDeleteNode_clicked\n");
 }
 void btnToolFindNode_clicked                       (GtkWidget *widget,gpointer user_data)
 {
-       printf("btnToolFindNode_clicked\n");
 }
 void btnToolAddEdge_clicked                       (GtkWidget *widget,gpointer user_data)
 {
-       printf("btnToolAddEdge_clicked\n");
 }
 void btnToolDeleteEdge_clicked                       (GtkWidget *widget,gpointer user_data)
 {
-       printf("btnToolDeleteEdge_clicked\n");
 }
 void btnToolFindEdge_clicked                       (GtkWidget *widget,gpointer user_data)
 {
-       printf("btnToolFindEdge_clicked\n");
-       printf("zoom :%f\n",view->zoom);
 }
index 3ba50ca481e6611231774a063b1da8bb86e8a81c..c1e052f21790d3694a15ae66ce98ea578071f225 100644 (file)
@@ -53,7 +53,7 @@ int SelectImage(xdot_op* op);
 int spline_in_rect(xdot_op* op);
 int spline_x_rect(xdot_op* op);
 
-int polygon_int_rect(xdot_op* op);
+int polygon_in_rect(xdot_op* op);
 int polygon_x_rect(xdot_op* op);
 
 int polyline_in_rect(xdot_op* op);
@@ -85,7 +85,7 @@ int select_all_graphs(Agraph_t* g);
 
 int deselect_all_nodes(Agraph_t* g);
 int deselect_all_edges(Agraph_t* g);
-int deselect_all_gprahs(Agraph_t* g);
+int deselect_all_graphs(Agraph_t* g);
 
 int select_all(Agraph_t* g);
 int deselect_all(Agraph_t* g);
index 092ef3791148f7b813aa62ec9c0477835390092c..4875c1fdd8d06ee0c3b5574bc1630a0aee2b6fbf 100755 (executable)
@@ -66,14 +66,19 @@ void preparetopview(Agraph_t *g,topview* t)
        t->Edges=NULL;
        t->Nodes=NULL;
        /*initialize node and edge array*/
-       printf ("edge memory required %i \n",sizeof(topview_edge)*agnedges(g));
        t->Edges=malloc(sizeof(topview_edge)*agnedges(g));
-       if (t->Edges)
-               printf ("Edge malloc is ok\n");
+       if (!t->Edges)
+       {
+               printf ("memory allocation problem\n");
+               exit(1);
+       }
 
        t->Nodes=malloc(sizeof(topview_node)*agnnodes(g));
-       if (t->Nodes)
-               printf ("Nodes malloc is ok\n");
+       if (!t->Nodes)
+       {
+               printf ("memory allocation problem\n");
+               exit(1);
+       }
 
        printf ("# of edges :%i\n",agnnodes(g));
        printf ("# of edges :%i\n",agnedges(g));
@@ -475,7 +480,6 @@ int draw_topview_label(topview_node* v,float zdepth)
                else
                        fontColorA ((float)log((double)v->degree+(double)1),view->penColor.G,view->penColor.B,1);
 
-//             printf("%f \n",view->penColor.A/log((float)v->degree)*-0.02*view->zoom);
                fontDrawString ((int)(v->distorted_x-ddx),(int)(v->distorted_y-ddy),v->Label,(int)(fs*5));
 
                return 1;
@@ -528,10 +532,6 @@ void set_boundries(topview* t)
        view->bdyBottom=bottom;
        view->bdzTop=0;
        view->bdzBottom=0;
-/*     printf("top view graph boundries\n");
-       printf("------------------------\n");
-       printf("lower left (%f,%f)\n",view->bdxLeft,view->bdyBottom);
-       printf("upper right(%f,%f)\n",view->bdxRight,view->bdyTop);*/
 }
 
 
@@ -846,7 +846,6 @@ double G(double x)
 
 void test_callback()
 {
-       printf ("test button click\n");
 }
 void menu_click_control(void* p)
 {
index d8024325db5628589d517aa12d478266999e9fb6..9c6d3b38e0306b4b53186b8a0b7f0a0736d87eec 100644 (file)
@@ -73,13 +73,12 @@ int load_host_buttons(topview* t,Agraph_t *g,glCompSet* s)
                sprintf(hostbtncolorG,"hostbtncolorG%i",i);
                sprintf(hostbtncolorB,"hostbtncolorB%i",i);
                sprintf(hostbtncolorA,"hostbtncolorA%i",i);
-               printf ("caption:%s regex:%s Color(%s,%s,%s,%s)\n",
                        agget(g,hostbtncaption ),
                        agget(g,hostbtnregex),
                        agget(g,hostbtncolorR),
                        agget(g,hostbtncolorG),
                        agget(g,hostbtncolorB),
-                       agget(g,hostbtncolorA));
+                       agget(g,hostbtncolorA);
                t->TopviewData->hostregex[i]=agget(g,hostbtnregex);
 
                b=glCompButtonNew((GLfloat)5,(GLfloat)7+((GLfloat)i+(GLfloat)1)*(GLfloat)36,(GLfloat)150,(GLfloat)35,agget(g,hostbtncaption ),'\0',0,0);
index 475b9eae28974fc0c95193c973380f02ae3823c0..306f31b844b999a2b9bcceeb0b5f5360802ec15d 100755 (executable)
 #include <glade/glade.h>
 #include "gui.h"
 #include "string.h"
+#include "topview.h"
+#include "gltemplate.h"
+#include "colorprocs.h"
+
 
 #define countof( array ) ( sizeof( array )/sizeof( array[0] ) )
 
@@ -223,7 +227,7 @@ void refreshControls(ViewInfo* v)
 
 
        }
-       expose_event (view->drawing_area,NULL,NULL);
+       glexpose();
 
                
 
@@ -489,7 +493,6 @@ int do_graph_layout(Agraph_t* graph,int Engine,int keeppos) //changes the layout
        }
        else
        {
-               printf("failed to read temp filen");
                return 0;
        }
 
@@ -515,13 +518,6 @@ Agraph_t* loadGraph(char* filename)
                g_print("Cannot open %s\n", filename);
        else if (g = agread(input_file,NIL(Agdisc_t*)))
        {
-               printf("%s has been loaded sucessfully\n",filename);
-               printf("Graph statistics\n");
-               printf("----------------\n");
-               printf("# of edges %i\n",agnnodes(g));
-               printf("# of nodes %i\n",agnedges(g));
-               printf("checking xdot data\n");
-               printf("binding graph record\n");
                attach_object_custom_data_to_graph(g);
                load_graph_params(g);
 
@@ -560,7 +556,6 @@ Agraph_t* loadGraph(char* filename)
                ((custom_graph_data*)AGDATA(g))->GraphFileName=(char*)malloc((strlen(filename)+1)*sizeof(char)); 
                //attaching rec for graph objects
                strcpy(((custom_graph_data*)AGDATA(g))->GraphFileName,filename); 
-               printf("Topview:%s------",agget(g, "TopView"));
                /*if(strcasecmp(agget(g, "TopView"),"1")==0)
                {
                        if(
@@ -584,7 +579,6 @@ Agraph_t* loadGraph(char* filename)
        }
        else
        {
-               printf("failed to load %s\n",filename);
                return 0;
        }
        return 0;
@@ -755,7 +749,6 @@ void move_node(void* obj,float dx,float dy)
        {
                //tokenize 
                strcpy(buf,agget(obj, "pos"));
-               printf ("org pos: %s\n",buf);
 
                pch=strtok (buf,"," );
                while (pch != NULL)
@@ -768,7 +761,6 @@ void move_node(void* obj,float dx,float dy)
                        i++;
                }
                buf2[strlen(buf2)-1]='\0';
-               printf ("new pos: %s\n",buf2);
                agset(obj,"pos",buf2);
        }
 }
index 84b3339644017b7b3c8e41377adcfa25d536e0f7..f20a1cf5d7d66988c79f01f1b48b2b0577f225b6 100755 (executable)
@@ -60,4 +60,5 @@ void glexpose();
 void move_nodes(Agraph_t* g);  //move selected nodes 
 //helper functions
 int SetGdkColor(GdkColor* c,char* color);
+int init_object_custom_data(Agraph_t* graph,void* obj);//creates a custom_object_data 
 #endif
index c382d7e5268874a1aa7dc6d66555c756887ea2ab..b18c0c5cb69183aee13279c60df74020dc8e5e61 100644 (file)
 #define EMPTY(s)               ((s == 0) || (s)[0] == '\0')
 #define MAX(a,b)     ((a)>(b)?(a):(b))
 
+#ifdef WIN32
+extern int strcasecmp(const char *s1, const char *s2);
+extern int strncasecmp(const char *s1, const char *s2, unsigned int n);
+#endif
+
+
 typedef void iochan_t;
 
 static void ioput(Agraph_t * g, iochan_t * ofile, char *str)