**********************************************************/
#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;
}
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;
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);
-
-
- }
}
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]);
}
#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)
{
}
void btnTVCancel_clicked_cb (GtkWidget *widget,gpointer user_data)
{
- printf("btnTVCancel_clicked_cb\n");
}
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");
}
*/
GtkWidget* create_popup_menu (GtkWidget* drawing_area)
{
- GtkWidget *shapes_menu;
GtkWidget *actions_menu;
GtkWidget *editing_menu;
GtkWidget *menu;
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;
//call this function only ones
void create_object_properties()
{
- char** testRows;
char* data0="TEST0";
char* data1="TEST1";
char* data2="TEST2";
//call this after create_object_properties()
void object_properties_node_init()
{
- GladeXML *xml;
- GtkWidget *widget;
}
void object_properties_edge_init() //customize window for Edges
//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;
void* obj;
char line [ 128 ];
float a,b;
- char* pch;
layout=(GtkLayout*)glade_xml_get_widget(xml, "layout4");
frmObjectTypeIndex=typeIndex;
frmObjectg=g;
)
{
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 );
#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)
GtkWidget *dialog;
GtkFileFilter* filter;
- printf("mOpenSlot \n");
filter=gtk_file_filter_new ();
gtk_file_filter_add_pattern(filter,"*.dot");
}
void mOptionsSlot (GtkWidget *widget,gpointer user_data)
{
- printf("mOptionsSlot\n");
}
void mQuitSlot (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");
}
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)
void mShowCodeSlot (GtkWidget *widget,gpointer user_data)
{
- printf("mShowCodeSlot\n");
}
void mDotSlot (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");
}
#include "toolboxcallbacks.h"
#include "viewport.h"
+#include "selection.h"
+#include "gltemplate.h"
void btnToolSingleSelect_clicked(GtkWidget *widget,gpointer user_data)
{
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)
}
void btnToolFit_clicked (GtkWidget *widget,gpointer user_data)
{
- printf("btnToolFit_clicked\n");
}
void btnToolMove_clicked (GtkWidget *widget,gpointer user_data)
{
}
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);
}
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);
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);
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));
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;
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);*/
}
void test_callback()
{
- printf ("test button click\n");
}
void menu_click_control(void* p)
{
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);
#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] ) )
}
- expose_event (view->drawing_area,NULL,NULL);
+ glexpose();
}
else
{
- printf("failed to read temp filen");
return 0;
}
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);
((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(
}
else
{
- printf("failed to load %s\n",filename);
return 0;
}
return 0;
{
//tokenize
strcpy(buf,agget(obj, "pos"));
- printf ("org pos: %s\n",buf);
pch=strtok (buf,"," );
while (pch != NULL)
i++;
}
buf2[strlen(buf2)-1]='\0';
- printf ("new pos: %s\n",buf2);
agset(obj,"pos",buf2);
}
}
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
#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)