From 5ecdbe5175a99de2058c4db005f0ee6205f8cca0 Mon Sep 17 00:00:00 2001 From: ellson Date: Tue, 26 Feb 2008 17:33:55 +0000 Subject: [PATCH] smyna Makefile.am update, and add a missing header --- cmd/smyrna/Makefile.am | 29 ++-- cmd/smyrna/smyrnadefs.h | 306 ++++++++++++++++++++++++++++++++++++++ lib/filter/Makefile.am | 8 +- lib/gui/Makefile.am | 19 ++- lib/utilities/Makefile.am | 11 +- lib/xdot/Makefile.am | 4 +- 6 files changed, 349 insertions(+), 28 deletions(-) create mode 100644 cmd/smyrna/smyrnadefs.h diff --git a/cmd/smyrna/Makefile.am b/cmd/smyrna/Makefile.am index 1b2bb6be3..37cb8dfc8 100644 --- a/cmd/smyrna/Makefile.am +++ b/cmd/smyrna/Makefile.am @@ -1,31 +1,36 @@ -gladedir = $(datadir)/gtktopview/glade -fontsdir = $(datadir)/gtktopview/fonts -icondir = $(datadir)/gtktopview/icons +guidir = $(pkgdatadir)/gui +icondir = $(pkgdatadir)/icons AM_CPPFLAGS = \ - -DGTKTOPVIEW_GLADE=\""$(gladedir)/gtktopview.glade"\" \ - -DGTKTOPVIEW_FONT=\""$(fontsdir)/arial.tga"\" \ - -DGTKTOPVIEW_ICONSDIR=\""$(iconsdir)"\" \ + -DSMYRNA_GLADE=\""$(guidir)/smyrna.glade"\" \ + -DSMYRNA_FONT=\""$(guidir)/arial.tga"\" \ + -DSMYRNA_ICONSDIR=\""$(iconsdir)"\" \ -I$(top_srcdir) \ -I$(top_srcdir)/lib/cgraph \ -I$(top_srcdir)/lib/cdt \ -I$(top_srcdir)/lib/filter \ -I$(top_srcdir)/lib/utilities \ -I$(top_srcdir)/lib/xdot \ - -I$(top_srcdir)/lib/GUI \ + -I$(top_srcdir)/lib/topfish \ + -I$(top_srcdir)/lib/gui \ -I$(top_srcdir)/lib/common \ $(GTK_CFLAGS) $(GTKGLEXT_CFLAGS) $(GLADE_CFLAGS) $(FREETYPE2_CFLAGS) $(FONTCONFIG_CFLAGS) -noinst_HEADERS = draw.h glTemplate.h materials.h support.h topview.h trackball.h tvnodes.h viewport.h -bin_PROGRAMS = gtktopview +if WITH_SMYRNA +noinst_HEADERS = draw.h glTemplate.h hier.h materials.h support.h topview.h \ + trackball.h tvnodes.h viewport.h smyrnadefs.h +bin_PROGRAMS = smyrna +endif -gtktopview_SOURCES = topview.c viewport.c draw.c glTemplate.c main.c support.c template.c trackball.c tvnodes.c +smyrna_SOURCES = draw.c glTemplate.c hier.c main.c support.c template.c \ + topview.c trackball.c tvnodes.c viewport.c -gtktopview_LDADD = $(top_builddir)/lib/cgraph/libcgraph_C.la \ +smyrna_LDADD = $(top_builddir)/lib/cgraph/libcgraph_C.la \ $(top_builddir)/lib/cdt/libcdt_C.la \ $(top_builddir)/lib/utilities/libutilities_C.la \ $(top_builddir)/lib/xdot/libxdot_C.la \ + $(top_builddir)/lib/topfish/libtopfish_C.la \ $(top_builddir)/lib/filter/libfilter_C.la \ - $(top_builddir)/lib/GUI/libGUI_C.la \ + $(top_builddir)/lib/gui/libgui_C.la \ $(top_builddir)/lib/common/libcommon_C.la \ $(GTK_LIBS) $(GTKGLEXT_LIBS) $(GLADE_LIBS) $(EXPAT_LIBS) diff --git a/cmd/smyrna/smyrnadefs.h b/cmd/smyrna/smyrnadefs.h new file mode 100644 index 000000000..bb94afde5 --- /dev/null +++ b/cmd/smyrna/smyrnadefs.h @@ -0,0 +1,306 @@ +#ifndef SMYRNADEFS_H +#define SMYRNADEFS_H + +#include "windows.h" +#include +#include "cgraph.h" +#include +#include +#include +#include "glCompset.h" + +#define IS_TEST_MODE_ON 0 +#define DEFAULT_MAGNIFIER_WIDTH 300 +#define DEFAULT_MAGNIFIER_HEIGHT 225 +#define DEFAULT_MAGNIFIER_KTS 3 //x3 +#define DEFAULT_FISHEYE_MAGNIFIER_RADIUS 250; +#define TOP_VIEW_USER_ADVANCED_MODE 0 +#define TOP_VIEW_USER_NOVICE_MODE 1 + +#define MAX_ZOOM -1.000033 +#define MIN_ZOOM -89.00000 +#define ZOOM_STEP 5 +#define DEG2RAD G_PI/180 + +#define UNHIGHLIGHTED_ALPHA 0.3 +#define Z_FORWARD_PLANE -0.00201 +#define Z_BACK_PLANE -0.00199 + +#define NODE_ZOOM_LIMIT -25.3 +#define NODE_CIRCLE_LIMIT -7.3 + + + +typedef struct{ + float R; + float G; + float B; + float A; //Alpha +} RGBColor; +typedef struct { + GtkButton** gtkhostbtn; + int gtkhostbtncount; + GtkColorButton** gtkhostcolor; + int hostactive[50]; //temporary static, convert to dynamic,realloc + char** hostregex; +} topviewdata; +typedef struct{ + Agnode_t* Node; + /*original coordinates*/ + float x; + float y; + float z; + /*coordinates to draw*/ + float distorted_x; + float distorted_y; + float distorted_z; + float zoom_factor; + int in_fish_eye; //boolean value if to apply fisheye + RGBColor Color; + RGBColor GroupColor; + int GroupIndex; //default -1; + int update_required; + char* Label; + char* Label2; + int degree; + float node_alpha; + int valid; +}topview_node; + +typedef struct{ + Agnode_t* Tnode; //Tail node + Agnode_t* Hnode; //Tail node + Agedge_t *Edge; //edge itself + GLfloat x1; + GLfloat y1; + GLfloat z1; + GLfloat x2; + GLfloat y2; + GLfloat z2; + topview_node* Node1; + topview_node* Node2; + RGBColor Color; + int update_required; + +}topview_edge; +typedef struct { + topview_node* Nodes; + topview_edge* Edges; + int Nodecount; + int Edgecount; + int limits[4]; + glCompSet* topviewmenu; //for novice user open gl menu + topviewdata* TopviewData; +} topview; +enum +{ + COL_NAME = 0, + COL_FILENAME, + NUM_COLS +} ; +//atributes +typedef struct _mouse_attr +{ + int mouse_down; + int mouse_mode; + int mouse_X; + int mouse_Y; +}mouse_attr; + + +typedef struct _attribute +{ + char Type; + char* Name; + char* Default; + char ApplyTo[4]; + char Engine[5]; + char** ComboValues; + int ComboValuesCount; + GtkWidget* attrWidget; + +}attribute; + +//bind this to cgraph g +typedef struct _custom_graph_data +{ + Agrec_t h; + char* GraphName; + char* GraphFileName; + int AlwaysShow; //active or not draw it + int TopView; //default 0, 1 for topview data, dots and lines + int Locked; + int Engine; //enum GVEngine{DOT,NEATO,TWOPI,CIRCO,FDP}; + //graph's location, change these to move the whole graph + int Modified; //if graph has been modified after loading + float offsetx; + float offsety; + float offsetz; + + Agraph_t** selectedGraphs; //clusters , subgraphs indeed + Agnode_t** selectedNodes; + Agedge_t** selectedEdges; + + int selectedGraphsCount; + int selectedNodesCount; + int selectedEdgesCount; +} custom_graph_data; + + + +enum GEunit{GEpixels,GEinches,GEmm}; + + +typedef struct _custom_object_data //has to be attached to every Node, Edge, Graph and cluster +{ + Agrec_t h; + int ID; + char* ObjName; + int ObjType; + int Layer; + int Visible; + int Locked; + int Highlighted; + int Selected; + int Preselected; + int NumDataCount; + float* NumData; + int StrDataCount; + char** StrData; + int selectionflag; + int param; //generic purpose param + int TVRef; //Topview reference + +}custom_object_data; + +typedef struct _selection +{ + int Active; //0 there is no selection need to be applied + char Type; //0 single selection , 1 rectangle , 2 rectangleX + float X,Y,W,H; //selection boundries + int Anti; //subtract selections if 1 + int AlreadySelected; //for single selections to avoid selecting more than one object + RGBColor SelectionColor; + +}selection; +typedef struct _magnifier +{ + float x,y; + float kts; //zoom X + float GLwidth,GLheight; + int width,height; //how big is the magnifier referenced from windows + int active; +} magnifier; + +typedef struct _fisheye_magnifier +{ + float x,y;//center coords of active circle + float distortion_factor; //distortion factor ,default 1 + int R; //radius of the magnifier referenced from windows + int active; + int fisheye_distortion_fac; +} fisheye_magnifier; + +typedef struct _ViewInfo +{ + /*view variables*/ + float panx; + float pany; + float panz; + float prevpanx; + float prevpany; + float prevpanz; + float zoom; + + /*clipping coordinates, to avoid unnecesarry rendering*/ + float clipX1,clipX2,clipY1,clipY2,clipZ1,clipZ2; + + /*background color*/ + RGBColor bgColor; + /*default pen color*/ + RGBColor penColor; + /*default fill color*/ + RGBColor fillColor; + /*selection color, selected items appear in this color*/ + RGBColor selectColor; + /*grid color*/ + RGBColor gridColor; //grid color + + /*default line width*/ + float LineWidth; + + /*grid is drawn if this variable is 1*/ + int gridVisible; + /*grid cell size in gl coords system*/ + float gridSize; //grid cell size + + /*draws a border in border colors if it is 1*/ + int bdVisible; //if borders are visible (boundries of the drawing, + /*border color*/ + RGBColor borderColor; + /*border coordinates, needs to be calculated for each graph*/ + float bdxLeft,bdyTop,bdzTop; + float bdxRight,bdyBottom,bdzBottom; + + /*reserved , not being used yet*/ + enum GEunit unit; //default pixels :0 + + /*variable to hold mouse coordinates temporarily*/ + float GLx,GLy,GLz; + /*this is second set of mouse coordinates holder for, it is needed to draw a rectangle with mouse*/ + float GLx2,GLy2,GLz2; + + /*screen window size in 2d*/ + int w,h; + /*graph pointer to hold loaded graphs*/ + Agraph_t** g; + /*number of graphs loaded*/ + int graphCount; + /*active graph*/ + int activeGraph; + + /**/ + int FontSize; + /*texture data*/ + int texture; /*1 texturing enabled, 0 disabled*/ + /*opengl depth value to convert mouse to GL coords*/ + float GLDepth; + + /*stores the info about status of mouse,pressed? what button ? where?*/ + mouse_attr mouse; + + /*selection object,refer to smyrnadefs.h for more info*/ + selection Selection; + + /*rectangular magnifier object*/ + magnifier mg; + /*fisheye magnifier object*/ + fisheye_magnifier fmg; + + /*data attributes are read from graph's attributes DataAttribute1 and DataAttribute2*/ + char* node_data_attribute1; /*for topview graphs this is the node data attribute to put as label*/ + char* node_data_attribute2; /*for topview graphs this is the node data attribute to be stored and used for something else*/ + + /*0 advanced users with editing options 1 nonice users just navigate (glmenu system)*/ + int topviewusermode; + + /*open gl canvas, used to be a globa variable before looks better wrapped in viewinfo*/ + GtkWidget *drawing_area; + + /*some boolean variable for variety hacks used in the software*/ + int SignalBlock; + + /*Topview data structure, refer topview.h for more info*/ + topview* Topview; +}ViewInfo; + +extern ViewInfo* view; +extern GtkMessageDialog* Dlg; +extern int respond; + +extern void glexpose(); + + + + +#endif diff --git a/lib/filter/Makefile.am b/lib/filter/Makefile.am index 565f157d5..462f41074 100644 --- a/lib/filter/Makefile.am +++ b/lib/filter/Makefile.am @@ -4,18 +4,20 @@ AM_CPPFLAGS = \ -I$(top_srcdir) \ -I$(top_srcdir)/lib/utilities \ - -I$(top_srcdir)/lib/GUI \ - -I$(top_srcdir)/cmd/gtktopview \ + -I$(top_srcdir)/lib/gui \ + -I$(top_srcdir)/lib/topfish \ + -I$(top_srcdir)/cmd/smyrna \ -I$(top_srcdir)/lib/xdot \ -I$(top_srcdir)/lib/cgraph \ -I$(top_srcdir)/lib/cdt \ $(GTK_CFLAGS) $(GTKGL_CFLAGS) $(GTKGLEXT_CFLAGS) $(GLADE_CFLAGS) $(FREETYPE2_CFLAGS) +if WITH_SMYRNA noinst_HEADERS = \ btree.h filter.h noinst_LTLIBRARIES = libfilter_C.la +endif libfilter_C_la_SOURCES = \ Filter.c btree.c - diff --git a/lib/gui/Makefile.am b/lib/gui/Makefile.am index eb69687bc..3575de0cd 100644 --- a/lib/gui/Makefile.am +++ b/lib/gui/Makefile.am @@ -2,22 +2,25 @@ # ## Process this file with automake to produce Makefile.in # -gladedir = $(datadir)/gtktopview/glade +guidir = $(pkgdatadir)/gui AM_CPPFLAGS = \ - -DGTKTOPVIEW_GLADE=\""$(gladedir)/gtktopview.glade"\" \ - -DGTKTOPVIEW_ATTRS=\""$(gladedir)/attrs.txt"\" \ + -DSMYRNA_GLADE=\""$(guidir)/smyrna.glade"\" \ + -DSMYRNA_ATTRS=\""$(guidir)/attrs.txt"\" \ -I$(top_srcdir) \ -I$(top_srcdir)/lib/xdot \ -I$(top_srcdir)/lib/cgraph \ -I$(top_srcdir)/lib/cdt \ -I$(top_srcdir)/lib/utilities \ - -I$(top_srcdir)/cmd/gtktopview \ + -I$(top_srcdir)/lib/topfish \ + -I$(top_srcdir)/cmd/smyrna \ $(GTK_CFLAGS) $(GTKGL_CFLAGS) $(GTKGLEXT_CFLAGS) $(GLADE_CFLAGS) $(FREETYPE2_CFLAGS) -noinst_HEADERS = callbacks.h datalistcallbacks.h gui.h \ +if WITH_SMYRNA +noinst_HEADERS = callbacks.h datalistcallbacks.h filterscallbacks.h gui.h \ menucallbacks.h toolboxcallbacks.h -noinst_LTLIBRARIES = libGUI_C.la +noinst_LTLIBRARIES = libgui_C.la +endif -libGUI_C_la_SOURCES = gui.c callbacks.c datalistcallbacks.c \ - menucallbacks.c toolboxcallbacks.c +libgui_C_la_SOURCES = callbacks.c datalistcallbacks.c filterscallbacks.c \ + gui.c menucallbacks.c toolboxcallbacks.c diff --git a/lib/utilities/Makefile.am b/lib/utilities/Makefile.am index 7a0a80bc8..74587afce 100644 --- a/lib/utilities/Makefile.am +++ b/lib/utilities/Makefile.am @@ -3,19 +3,22 @@ # AM_CPPFLAGS = \ -I$(top_srcdir) \ - -I$(top_srcdir)/cmd/gtktopview \ + -I$(top_srcdir)/cmd/smyrna \ -I$(top_srcdir)/lib/utilities \ -I$(top_srcdir)/lib/xdot \ -I$(top_srcdir)/lib/cgraph \ -I$(top_srcdir)/lib/cdt \ $(GTK_CFLAGS) $(GTKGL_CFLAGS) $(GTKGLEXT_CFLAGS) $(GLADE_CFLAGS) $(FREETYPE2_CFLAGS) +if WITH_SMYRNA noinst_HEADERS = \ - abstring.h glTexFontDefs.h glTexFont.h glTexFontInclude.h \ - glTexFontTGA.h opengl_pango.h selection.h + abstring.h cclass.h cname.h glTexFont.h glTexFontDefs.h \ + glTexFontInclude.h glTexFontTGA.h opengl_pango.h regex.h \ + regex2.h selection.h strcasecmp.h utils.h noinst_LTLIBRARIES = libutilities_C.la +endif libutilities_C_la_SOURCES = \ abstring.c glTexFont.c glTexFontColor.c glTexFontTGA.c \ - opengl_pango.c selection.c + opengl_pango.c pangotest.c selection.c strcasecmp.c diff --git a/lib/xdot/Makefile.am b/lib/xdot/Makefile.am index edd975ab7..974603e04 100644 --- a/lib/xdot/Makefile.am +++ b/lib/xdot/Makefile.am @@ -6,10 +6,12 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/lib/cgraph \ -I$(top_srcdir)/lib/cdt \ -I$(top_srcdir)/lib/utilities \ - -I$(top_srcdir)/cmd/gtktopview \ + -I$(top_srcdir)/cmd/smyrna \ $(GTK_CFLAGS) $(GTKGL_CFLAGS) $(GTKGLEXT_CFLAGS) $(GLADE_CFLAGS) $(FREETYPE2_CFLAGS) +if WITH_SMYRNA noinst_HEADERS = xdot.h noinst_LTLIBRARIES = libxdot_C.la +endif libxdot_C_la_SOURCES = xdot.c -- 2.40.0