From b1a034e66019e6f3e63f1ac29a958add4ada8473 Mon Sep 17 00:00:00 2001 From: arif Date: Wed, 11 Mar 2009 16:28:19 +0000 Subject: [PATCH] smyrna fixes --- cmd/smyrna/gui/beacon.c | 2 +- cmd/smyrna/gui/toolboxcallbacks.c | 4 ++-- cmd/smyrna/gui/topviewsettings.c | 4 ++-- cmd/smyrna/smyrna.vcproj | 8 +++---- cmd/smyrna/topview.c | 40 +++++++++++++++---------------- cmd/smyrna/topviewdata.c | 7 ++++-- cmd/smyrna/viewport.c | 8 +++---- cmd/smyrna/viewportcamera.c | 3 ++- lib/glcomp/glCompTrackBar.c | 5 +++- lib/glcomp/glcomp.vcproj | 2 +- lib/glcomp/glcompdefs.h | 1 + 11 files changed, 45 insertions(+), 39 deletions(-) diff --git a/cmd/smyrna/gui/beacon.c b/cmd/smyrna/gui/beacon.c index 05ca2ebea..91a12ccff 100644 --- a/cmd/smyrna/gui/beacon.c +++ b/cmd/smyrna/gui/beacon.c @@ -89,7 +89,7 @@ int draw_node_hint_boxes() { draw_node_hintbox(view->Topview->picked_nodes[ind]->distorted_x, view->Topview->picked_nodes[ind]->distorted_y, - view->Topview->picked_nodes[ind]->distorted_z+0.001, + view->Topview->picked_nodes[ind]->distorted_z+(float)0.001, (GLfloat) view->FontSizeConst, agnameof(view->Topview->picked_nodes[ind]->Node)); /* fontSize(fs); diff --git a/cmd/smyrna/gui/toolboxcallbacks.c b/cmd/smyrna/gui/toolboxcallbacks.c index c610cc8fc..72a28559e 100755 --- a/cmd/smyrna/gui/toolboxcallbacks.c +++ b/cmd/smyrna/gui/toolboxcallbacks.c @@ -73,7 +73,7 @@ void btnToolZoom_clicked(GtkWidget * widget, gpointer user_data) void btnToolZoomIn_clicked(GtkWidget * widget, gpointer user_data) { - view->zoom = view->zoom + ZOOM_STEP*GetOGLDistance(250); + view->zoom = view->zoom + (float)ZOOM_STEP*GetOGLDistance(250); if (view->zoom > MAX_ZOOM) view->zoom = (float) MAX_ZOOM; glexpose(); @@ -83,7 +83,7 @@ void btnToolZoomIn_clicked(GtkWidget * widget, gpointer user_data) void btnToolZoomOut_clicked(GtkWidget * widget, gpointer user_data) { view->FontSizeConst=GetOGLDistance(14); - view->zoom = view->zoom - ZOOM_STEP*GetOGLDistance(250); + view->zoom = view->zoom - (float)ZOOM_STEP*GetOGLDistance(250); if (view->zoom < MIN_ZOOM) view->zoom = MIN_ZOOM; expose_event(view->drawing_area, NULL, NULL); diff --git a/cmd/smyrna/gui/topviewsettings.c b/cmd/smyrna/gui/topviewsettings.c index df548d9e2..a35566bc9 100644 --- a/cmd/smyrna/gui/topviewsettings.c +++ b/cmd/smyrna/gui/topviewsettings.c @@ -163,7 +163,7 @@ static int set_scalebtn_widget_to_attribute(char *attribute, char *widget_name) buf = agget(view->default_attributes, attribute); if (buf) { value = (float) atof(buf); - gtk_range_set_value((GtkSpinButton *) + gtk_range_set_value((GtkRange *) glade_xml_get_widget(xml, widget_name), value); return 1; @@ -196,7 +196,7 @@ static int get_combobox_widget_to_attribute(char *attribute, char *widget_name, char buf[25]; float value; - value= + value=(float) gtk_combo_box_get_active((GtkComboBox *) glade_xml_get_widget(xml, widget_name)); diff --git a/cmd/smyrna/smyrna.vcproj b/cmd/smyrna/smyrna.vcproj index 1dba92e6b..afe8e7d43 100644 --- a/cmd/smyrna/smyrna.vcproj +++ b/cmd/smyrna/smyrna.vcproj @@ -38,9 +38,10 @@ /> - - diff --git a/cmd/smyrna/topview.c b/cmd/smyrna/topview.c index 28955c5f5..8480b23be 100755 --- a/cmd/smyrna/topview.c +++ b/cmd/smyrna/topview.c @@ -82,7 +82,7 @@ void preparetopview(Agraph_t * g, topview * t) int maxlabelsize=0; float maxedgelen,minedgelen,len,edgelength; maxedgelen=0; - minedgelen=99999999.00000; //FIX ME if you have a giant graph or fix your graph + minedgelen=(float)99999999.00000; //FIX ME if you have a giant graph or fix your graph edgelength=0; ind = 0; @@ -202,7 +202,7 @@ void preparetopview(Agraph_t * g, topview * t) t->Edges[ind2].y2 = b; t->Edges[ind2].z2 = c; } - len=pow(pow((t->Edges[ind2].x2-t->Edges[ind2].x1),2)+pow((t->Edges[ind2].y2-t->Edges[ind2].y1),2),0.5); + len=(float)pow(pow((t->Edges[ind2].x2-t->Edges[ind2].x1),2)+pow((t->Edges[ind2].y2-t->Edges[ind2].y1),2),0.5); if (len > maxedgelen) maxedgelen=len; if (len < minedgelen) @@ -271,7 +271,6 @@ void preparetopview(Agraph_t * g, topview * t) static float set_gl_dot_size(topview * t) { - GLfloat a; static float dotsize; static float prevdotsize; if (view->active_camera==-1) @@ -281,7 +280,7 @@ static float set_gl_dot_size(topview * t) // dotsize=dotsize * DOT_SIZE_CORRECTION_FAC; if (dotsize <=1.2) - dotsize=1.2; + dotsize=(float)1.2; glPointSize((GLfloat)dotsize); return dotsize; @@ -645,13 +644,14 @@ static int draw_node_hint_boxes(void) fontColorA(view->fontset->fonts[view->fontset->activefont],0, 0, 1, 1); - fontDrawString(view->fontset->fonts[view->fontset->activefont], + fontDrawString( + view->fontset->fonts[view->fontset->activefont], (view->Topview->picked_nodes[ind]->distorted_x), (view->Topview->picked_nodes[ind]-> - distorted_y+fs+fs/5.0 ), + distorted_y+fs+fs/(GLfloat)5.0 ), fs * (float)strlen(agnameof - (view->Topview->picked_nodes[ind]->Node)) / 2.0, + (view->Topview->picked_nodes[ind]->Node)) / (GLfloat)2.0, agnameof(view->Topview->picked_nodes[ind]->Node)); } return 1; @@ -674,7 +674,7 @@ static int select_topview_node(topview_node * n) || (view->mouse.button== rightmousebutton)) //single selection or right click (picking) { - float dist=pow((view->Selection.X-n->distorted_x),2)+pow((view->Selection.Y-n->distorted_y),2); + float dist=(float)pow((view->Selection.X-n->distorted_x),2)+(float)pow((view->Selection.Y-n->distorted_y),2); if ((view->Selection.node_distance==-1) ||(dist < view->Selection.node_distance)) { view->Selection.node_distance=dist; @@ -837,8 +837,8 @@ int set_update_required(topview * t) float calculate_font_size(topview_node * v) { - double n; - n=(double)v->degree+(double)1.00; + float n; + n=(float)v->degree+(float)1.00; return n; } @@ -877,11 +877,11 @@ static int draw_topview_label(topview_node * v, float zdepth) return 0; // fs= 10; - fs= fs * 0.2; + fs= fs * (float)0.2; - fontSize(view->fontset->fonts[view->fontset->activefont],(int) fs); + fontSize(view->fontset->fonts[view->fontset->activefont],fs); if ((log((float) v->degree) * -0.6 * view->zoom) > 0) fontColorA(view->fontset->fonts[view->fontset->activefont],(float) log((double) v->degree + (double) 1), view->penColor.G, view->penColor.B, @@ -889,11 +889,11 @@ static int draw_topview_label(topview_node * v, float zdepth) (float) -0.4 * (float) view->zoom); else fontColorA(view->fontset->fonts[view->fontset->activefont],(float) log((double) v->degree + (double) 1), - view->penColor.G, view->penColor.B, 0.7); + view->penColor.G, view->penColor.B, (float)0.7); // fontColorA(0,0,0,1); - fontDrawString(view->fontset->fonts[view->fontset->activefont],(int) (v->distorted_x - ddx), - (int) (v->distorted_y - ddy), (int) (fs * strlen(v->Label)*0.6),v->Label ); + fontDrawString(view->fontset->fonts[view->fontset->activefont],(v->distorted_x - ddx), + (v->distorted_y - ddy), (fs * strlen(v->Label)*(float)0.6),v->Label ); return 1; } else @@ -1267,16 +1267,16 @@ static void menu_click_fisheye_magnifier(void *p) static void menu_click_zoom_minus(void *p) { - if ((view->zoom - ZOOM_STEP) > MIN_ZOOM) - view->zoom = view->zoom - ZOOM_STEP; + if ((view->zoom - (float)ZOOM_STEP) > (float)MIN_ZOOM) + view->zoom = view->zoom - (float)ZOOM_STEP; else - view->zoom = MIN_ZOOM; + view->zoom = (float)MIN_ZOOM; } static void menu_click_zoom_plus(void *p) { - if ((view->zoom + ZOOM_STEP) < MAX_ZOOM) - view->zoom = view->zoom + ZOOM_STEP; + if ((view->zoom + (float)ZOOM_STEP) < (float)MAX_ZOOM) + view->zoom = view->zoom + (float)ZOOM_STEP; else view->zoom = (float) MAX_ZOOM; diff --git a/cmd/smyrna/topviewdata.c b/cmd/smyrna/topviewdata.c index 9dfddb9f9..1ddc20e61 100644 --- a/cmd/smyrna/topviewdata.c +++ b/cmd/smyrna/topviewdata.c @@ -15,6 +15,9 @@ #include "topviewdata.h" #include "btree.h" +#include "glcomppanel.h" +#include "glcompbutton.h" + #include static int validate_group_node(tv_node * TV_Node, char *regex_string) @@ -85,7 +88,7 @@ int load_host_buttons(topview * t, Agraph_t * g, glCompSet * s) t->TopviewData->gtkhostcolor = N_GNEW(btncount, GtkColorButton *); t->TopviewData->gtkhostbtncount = btncount; if (btncount > 0) { - p = glCompPanelNew(25, 75, 165, 400); + p = glCompPanelNew(25, 75, 165, 400,scientific_y); p->data = 2; //data panel p->color.R = (float) 0.80; p->color.B = (float) 0.2; @@ -112,7 +115,7 @@ int load_host_buttons(topview * t, Agraph_t * g, glCompSet * s) (GLfloat) 1) * (GLfloat) 36, (GLfloat) 150, (GLfloat) 35, agget(g, hostbtncaption), - '\0', 0, 0); + '\0', 0, 0,scientific_y); b->color.R = (float) atof(agget(g, hostbtncolorR)); b->color.G = (float) atof(agget(g, hostbtncolorG)); b->color.B = (float) atof(agget(g, hostbtncolorB)); diff --git a/cmd/smyrna/viewport.c b/cmd/smyrna/viewport.c index 347afadcb..aa3d989b2 100755 --- a/cmd/smyrna/viewport.c +++ b/cmd/smyrna/viewport.c @@ -225,7 +225,7 @@ set_viewport_settings_from_template(ViewInfo * view, Agraph_t * g) /*default line width */ view->LineWidth = (float) atof(get_attribute_value("defaultlinewidth", view, g)); - view->FontSize = atoi(get_attribute_value("defaultfontsize", view, g)); + view->FontSize = (float)atof(get_attribute_value("defaultfontsize", view, g)); view->topviewusermode = atoi(get_attribute_value("usermode", view, g)); get_attribute_value("defaultmagnifierwidth", view, g); @@ -390,7 +390,7 @@ void init_viewport(ViewInfo * view) view->total_frames=1500; view->frame_length=1; /*add a call back to the main()*/ - g_timeout_add_full(G_PRIORITY_DEFAULT,100,gl_main_expose,NULL,NULL); + g_timeout_add_full((gint)G_PRIORITY_DEFAULT,(guint)100,gl_main_expose,NULL,NULL); view->Topview->topviewmenu = '\0'; view->cameras='\0';; view->camera_count=0; @@ -620,8 +620,8 @@ static char* create_xdot_for_graph(Agraph_t * graph, int keeppos) { static char buf[BUFSIZ]; static char* cmd = buf; - static int buflen = BUFSIZ; - int len; + static size_t buflen = BUFSIZ; + size_t len; int r = 0; FILE *output_file; char* fix; diff --git a/cmd/smyrna/viewportcamera.c b/cmd/smyrna/viewportcamera.c index c374d886b..c5e1a45c6 100644 --- a/cmd/smyrna/viewportcamera.c +++ b/cmd/smyrna/viewportcamera.c @@ -164,7 +164,8 @@ void attach_camera_widget(ViewInfo * view) #define CAMERA_BUTTON_WIDTH 75 - int ind, ind2, x, y; + int ind, ind2; + GLfloat x, y; char buf[256]; glCompPanel *p; glCompButton *b; diff --git a/lib/glcomp/glCompTrackBar.c b/lib/glcomp/glCompTrackBar.c index b0d9abfbb..b3fd182f8 100644 --- a/lib/glcomp/glCompTrackBar.c +++ b/lib/glcomp/glCompTrackBar.c @@ -1,4 +1,7 @@ -#include "glCompTrackBar.h" +#include "glcomptrackbar.h" +#include "gltexfont.h" + + glCompTrackBar* glCompTrackBarNew(GLfloat x, GLfloat y, GLfloat w, GLfloat h,glCompOrientation orientation) { diff --git a/lib/glcomp/glcomp.vcproj b/lib/glcomp/glcomp.vcproj index 1ab84b88d..15f9898b0 100644 --- a/lib/glcomp/glcomp.vcproj +++ b/lib/glcomp/glcomp.vcproj @@ -40,7 +40,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories=""C:\gtk\lib\glib-2.0\include";"C:\gtk\include\glib-2.0";"C:\gtk\include\pango-1.0\";C:\gtk\include;"$(SolutionDir)/lib/common";"$(SolutionDir)/lib/cdt";"$(SolutionDir)/lib/cgraph";"$(SolutionDir)/lib/xdot"" - PreprocessorDefinitions="WIN32;_DEBUG;_LIB;" + PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="3" diff --git a/lib/glcomp/glcompdefs.h b/lib/glcomp/glcompdefs.h index c57d9e6bb..826273a7f 100644 --- a/lib/glcomp/glcompdefs.h +++ b/lib/glcomp/glcompdefs.h @@ -4,6 +4,7 @@ #ifdef _WIN32 #include "windows.h" #endif +#include #include #include #include -- 2.40.0