]> granicus.if.org Git - graphviz/commitdiff
smyrna :
authorarif <devnull@localhost>
Thu, 23 Jul 2009 20:00:43 +0000 (20:00 +0000)
committerarif <devnull@localhost>
Thu, 23 Jul 2009 20:00:43 +0000 (20:00 +0000)
1)Node size bug is fixed
2)Console widget is implemented (outputwidget)
3)non-visible edges and nodes are not pickable anymore

cmd/smyrna/gui/beacon.c
cmd/smyrna/gui/callbacks.c
cmd/smyrna/gui/menucallbacks.c
cmd/smyrna/gui/topviewsettings.c
cmd/smyrna/gvprpipe.c
cmd/smyrna/main.c
cmd/smyrna/topview.c
share/gui/smyrna.glade

index 8b33e21dd75d39db5a27f00e647def928e419032..c7fd9bd6d1b4422221cb852b37412f14fdb982ef 100644 (file)
@@ -25,6 +25,9 @@ void pick_node_from_coords(float x,float y,float z)
        for (ind = 0; ind < view->Topview->Nodecount; ind++) 
        {
                n = &view->Topview->Nodes[ind];
+               if (!n->data.Visible)
+                       continue;
+
                a = ABS(n->distorted_x - view->mouse.GLX);
                b = ABS(n->distorted_y - view->mouse.GLY);
                c = ABS(n->distorted_z - view->mouse.GLZ);
@@ -40,6 +43,8 @@ void pick_node_from_coords(float x,float y,float z)
        {
                XYZ p1,p2,p3;
                e = &view->Topview->Edges[ind];
+               if (!e->data.Visible)
+                       continue;
 
                p1.X=e->Node1->distorted_x;
                p1.Y=e->Node1->distorted_y;
index c6976cc9fb61b3ae43e79c5ccadfad7435512a4e..8f8e2a0a3222ec6a81d58d4da4d0a97255931e41 100755 (executable)
@@ -227,25 +227,25 @@ _BB void on_clearconsolebtn_clicked(GtkWidget * widget, gpointer user_data)
 }
 _BB void on_hideconsolebtn_clicked(GtkWidget * widget, gpointer user_data)
 {
-    gtk_widget_hide(glade_xml_get_widget(xml, "hbox11"));
+    gtk_widget_hide(glade_xml_get_widget(xml, "vbox13"));
 }
 
 _BB void on_consoledecbtn_clicked(GtkWidget * widget, gpointer user_data)
 {
        int w,h;
        gtk_widget_get_size_request((GtkTextView*) glade_xml_get_widget(xml,"scrolledwindow7"),&w,&h);
-       h=h-5;
+       w=w-5;
        gtk_widget_set_size_request(((GtkTextView*) glade_xml_get_widget(xml,"scrolledwindow7")),
-                                                         0,h);
+                                                         w,0);
 }
 
 _BB void on_consoleincbtn_clicked(GtkWidget * widget, gpointer user_data)
 {
        int w,h;
        gtk_widget_get_size_request((GtkTextView*) glade_xml_get_widget(xml,"scrolledwindow7"),&w,&h);
-       h=h+5;
+       w=w+5;
        gtk_widget_set_size_request(((GtkTextView*) glade_xml_get_widget(xml,"scrolledwindow7")),
-                                                         0,h);
+                                                         w,0);
 }
 
 
index f40966e1df1cfb1e311e972d705f3ef6e4e5d0e2..9295178f501a717cf2ae8abd1829880fcc6830f4 100755 (executable)
@@ -172,12 +172,12 @@ void mMenuZoom(GtkWidget * widget, gpointer user_data)
 }
 void mShowConsoleSlot(GtkWidget * widget, gpointer user_data)
 {
-    gtk_widget_show(glade_xml_get_widget(xml, "hbox11"));
+    gtk_widget_show(glade_xml_get_widget(xml, "vbox13"));
 
 }
 void mHideConsoleSlot(GtkWidget * widget, gpointer user_data)
 {
-    gtk_widget_hide(glade_xml_get_widget(xml, "hbox11"));
+    gtk_widget_hide(glade_xml_get_widget(xml, "vbox13"));
 
 }
 
index 7547daf3bb4ef51fe854967896df4ff76181e329..79b42b4203593c7b7aced8204d0ddd390518f693 100644 (file)
@@ -31,7 +31,9 @@ void on_settingsApplyBtn_clicked(GtkWidget * widget, gpointer user_data)
 {
     update_graph_from_settings(view->g[view->activeGraph]);
     set_viewport_settings_from_template(view, view->g[view->activeGraph]);
-       settvcolorinfo(view->g[view->activeGraph],view->Topview);
+       update_topview(view->g[view->activeGraph],view->Topview,0,0);
+/*     settvcolorinfo(view->g[view->activeGraph],view->Topview);
+       init_node_size(view->g[view->activeGraph])*/
 }
 
 
index d57111882e05fbdb5cf15ce4f3ca6c9bf556a341..6942394f4a807cbb7ded6584a1793a64e83c3c64 100644 (file)
 
 #include <gvpr.h>
 extern GladeXML *xml;                  //global libglade vars
-static ssize_t outfn (void* sp, const char *buf, size_t nbyte, void* dp)
+static void append_textview(GtkTextView* textv,char* s)
 {
+
     GtkTextIter endit;
     GtkTextBuffer * gtkbuf;
        /*get text view buffer*/
-       gtkbuf = gtk_text_view_get_buffer((GtkTextView*) glade_xml_get_widget(xml,"gvprtextoutput"));
+       gtkbuf = gtk_text_view_get_buffer(textv);
        /*set iterator to the end of the buffer*/
     gtk_text_buffer_get_end_iter (gtkbuf,&endit);
-
        /* insert buf to the end */
-       gtk_text_buffer_insert(gtkbuf,&endit,buf,nbyte);
-
-       gtkbuf = gtk_text_view_get_buffer((GtkTextView*) glade_xml_get_widget(xml,"mainsconsole"));
-       /*set iterator to the end of the buffer*/
-    gtk_text_buffer_get_end_iter (gtkbuf,&endit);
+       gtk_text_buffer_insert(gtkbuf,&endit,s,-1);
 
-       /* insert buf to the end */
-       gtk_text_buffer_insert(gtkbuf,&endit,buf,nbyte);
+}
+static ssize_t outfn (void* sp, const char *buf, size_t nbyte, void* dp)
+{
 
+       append_textview((GtkTextView*) glade_xml_get_widget(xml,"gvprtextoutput"),buf); 
+       append_textview((GtkTextView*) glade_xml_get_widget(xml,"mainconsole"),buf);    
        return nbyte;
 }
 
index 63025981571307b49f084f55cd562995b269a871..0d1911682d57a5796a2b2d289aa6494bcc5201fa 100755 (executable)
@@ -210,7 +210,9 @@ int main(int argc, char *argv[])
        gtk_gl_init(0, 0);
     /* Configure OpenGL framebuffer. */
     glconfig = configure_gl();
-       gladewidget = glade_xml_get_widget(xml, "vbox2");
+//     gladewidget = glade_xml_get_widget(xml, "vbox2");
+       gladewidget = glade_xml_get_widget(xml, "hbox11");
+
     create_window(glconfig, gladewidget);
 
        change_cursor(GDK_TOP_LEFT_ARROW);
index 1657610a5e85637bbb47e08ec90538dbf9c4913a..8c3d0700ee9dbf9525ae859834c409abaf5da2b5 100755 (executable)
@@ -320,28 +320,32 @@ void settvxdot(Agraph_t* g,topview* t)
                parseXdotwithattrs(ep->Edge, t->xdot_list);
     }
 }
-
-void update_topview(Agraph_t * g, topview * t,int init,int resetview)
+float init_node_size(Agraph_t * g,topview * t)
 {
-
-    if (init) {
        float vsize;
        int percent;
+       percent = atoi(agget(g,"nodesize"));
+       if (percent == 0)
+               percent=0.000001;
+       vsize = 0.05*sqrt((view->bdxRight - view->bdxLeft)*(view->bdyTop - view->bdyBottom));
+       t->init_node_size = vsize*2/GetOGLDistance(2)*percent/100.0/sqrt(t->Nodecount);
+       t->init_zoom = view->zoom;
+
+}
 
-       preparetopview(g,t);
+void update_topview(Agraph_t * g, topview * t,int init,int resetview)
+{
 
-       percent = atoi(agget(view->g[view->activeGraph],"nodesize"));
-       vsize = 0.05*sqrt((view->bdxRight - view->bdxLeft)*(view->bdyTop - view->bdyBottom));
-       t->init_node_size = vsize*2/GetOGLDistance(2)*percent/100.0/sqrt(t->Nodecount);
-       t->init_zoom = view->zoom;
-               free_xdotset(view->Topview->xdot_list);
-               t->xdot_list=init_xdot_set();
-    }
+       if (init) 
+               preparetopview(g,t);
+       free_xdotset(view->Topview->xdot_list);
+       t->xdot_list=init_xdot_set();
     settvposinfo(g,t);
     settvcolorinfo(g,t);
     set_boundaries(t);
     set_update_required(t);
        settvxdot(view->g[view->activeGraph],view->Topview);
+       init_node_size(g,t);
        if (resetview)
                btnToolZoomFit_clicked(NULL,NULL);
 }
@@ -618,9 +622,9 @@ static int drawtopviewnodes(Agraph_t * g)
            else if (view->defaultnodeshape==1)
                {
                        if(v->size > 0)
-                               drawCircle(v->distorted_x - ddx,v->distorted_y - ddy,v->size*dotsize,0);
+                               drawCircle(v->distorted_x - ddx,v->distorted_y - ddy,v->size*view->Topview->init_node_size,0);
                        else
-                               drawCircle(v->distorted_x - ddx,v->distorted_y - ddy,dotsize,0);
+                               drawCircle(v->distorted_x - ddx,v->distorted_y - ddy,view->Topview->init_node_size,0);
            }
        }
        else {
index e4226efc753775f13772c50f8e2ddd4b511951ef..adcf6a882f251c90d4f75ef7619aaf866dd50404 100755 (executable)
          <property name="spacing">0</property>
 
          <child>
-           <widget class="GtkScrolledWindow" id="scrolledwindow7">
-             <property name="width_request">626</property>
-             <property name="height_request">76</property>
-             <property name="visible">True</property>
-             <property name="can_focus">True</property>
-             <property name="hscrollbar_policy">GTK_POLICY_ALWAYS</property>
-             <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property>
-             <property name="shadow_type">GTK_SHADOW_IN</property>
-             <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
-
-             <child>
-               <widget class="GtkTextView" id="mainconsole">
-                 <property name="visible">True</property>
-                 <property name="can_focus">True</property>
-                 <property name="editable">True</property>
-                 <property name="overwrite">False</property>
-                 <property name="accepts_tab">True</property>
-                 <property name="justification">GTK_JUSTIFY_LEFT</property>
-                 <property name="wrap_mode">GTK_WRAP_NONE</property>
-                 <property name="cursor_visible">True</property>
-                 <property name="pixels_above_lines">0</property>
-                 <property name="pixels_below_lines">0</property>
-                 <property name="pixels_inside_wrap">0</property>
-                 <property name="left_margin">0</property>
-                 <property name="right_margin">0</property>
-                 <property name="indent">0</property>
-                 <property name="text" translatable="yes"></property>
-               </widget>
-             </child>
-           </widget>
-           <packing>
-             <property name="padding">0</property>
-             <property name="expand">True</property>
-             <property name="fill">True</property>
-           </packing>
+           <placeholder/>
          </child>
 
          <child>
-           <widget class="GtkTable" id="table17">
+           <widget class="GtkVBox" id="vbox13">
              <property name="visible">True</property>
-             <property name="n_rows">2</property>
-             <property name="n_columns">2</property>
              <property name="homogeneous">False</property>
-             <property name="row_spacing">0</property>
-             <property name="column_spacing">0</property>
+             <property name="spacing">0</property>
 
              <child>
-               <widget class="GtkButton" id="clearconsolebtn">
+               <widget class="GtkScrolledWindow" id="scrolledwindow7">
+                 <property name="width_request">215</property>
+                 <property name="height_request">488</property>
                  <property name="visible">True</property>
                  <property name="can_focus">True</property>
-                 <property name="label" translatable="yes">Clear</property>
-                 <property name="use_underline">True</property>
-                 <property name="relief">GTK_RELIEF_NORMAL</property>
-                 <property name="focus_on_click">True</property>
-                 <signal name="clicked" handler="on_clearconsolebtn_clicked" last_modification_time="Wed, 22 Jul 2009 15:22:56 GMT"/>
-               </widget>
-               <packing>
-                 <property name="left_attach">0</property>
-                 <property name="right_attach">1</property>
-                 <property name="top_attach">0</property>
-                 <property name="bottom_attach">1</property>
-                 <property name="x_options">fill</property>
-                 <property name="y_options"></property>
-               </packing>
-             </child>
+                 <property name="hscrollbar_policy">GTK_POLICY_ALWAYS</property>
+                 <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property>
+                 <property name="shadow_type">GTK_SHADOW_IN</property>
+                 <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
 
-             <child>
-               <widget class="GtkButton" id="consoledecbtn">
-                 <property name="visible">True</property>
-                 <property name="can_focus">True</property>
-                 <property name="label" translatable="yes">-</property>
-                 <property name="use_underline">True</property>
-                 <property name="relief">GTK_RELIEF_NORMAL</property>
-                 <property name="focus_on_click">True</property>
-                 <signal name="clicked" handler="on_consoledecbtn_clicked" last_modification_time="Wed, 22 Jul 2009 15:24:50 GMT"/>
+                 <child>
+                   <widget class="GtkTextView" id="mainconsole">
+                     <property name="visible">True</property>
+                     <property name="can_focus">True</property>
+                     <property name="editable">True</property>
+                     <property name="overwrite">False</property>
+                     <property name="accepts_tab">True</property>
+                     <property name="justification">GTK_JUSTIFY_LEFT</property>
+                     <property name="wrap_mode">GTK_WRAP_NONE</property>
+                     <property name="cursor_visible">True</property>
+                     <property name="pixels_above_lines">0</property>
+                     <property name="pixels_below_lines">0</property>
+                     <property name="pixels_inside_wrap">0</property>
+                     <property name="left_margin">0</property>
+                     <property name="right_margin">0</property>
+                     <property name="indent">0</property>
+                     <property name="text" translatable="yes"></property>
+                   </widget>
+                 </child>
                </widget>
                <packing>
-                 <property name="left_attach">1</property>
-                 <property name="right_attach">2</property>
-                 <property name="top_attach">0</property>
-                 <property name="bottom_attach">1</property>
-                 <property name="x_options">fill</property>
-                 <property name="y_options"></property>
+                 <property name="padding">0</property>
+                 <property name="expand">True</property>
+                 <property name="fill">True</property>
                </packing>
              </child>
 
              <child>
-               <widget class="GtkButton" id="consoleincbtn">
+               <widget class="GtkTable" id="table17">
                  <property name="visible">True</property>
-                 <property name="can_focus">True</property>
-                 <property name="label" translatable="yes">+</property>
-                 <property name="use_underline">True</property>
-                 <property name="relief">GTK_RELIEF_NORMAL</property>
-                 <property name="focus_on_click">True</property>
-                 <signal name="clicked" handler="on_consoleincbtn_clicked" last_modification_time="Wed, 22 Jul 2009 15:24:05 GMT"/>
-               </widget>
-               <packing>
-                 <property name="left_attach">1</property>
-                 <property name="right_attach">2</property>
-                 <property name="top_attach">1</property>
-                 <property name="bottom_attach">2</property>
-                 <property name="x_options">fill</property>
-                 <property name="y_options"></property>
-               </packing>
-             </child>
+                 <property name="n_rows">1</property>
+                 <property name="n_columns">4</property>
+                 <property name="homogeneous">False</property>
+                 <property name="row_spacing">0</property>
+                 <property name="column_spacing">0</property>
 
-             <child>
-               <widget class="GtkButton" id="hideconsolebtn">
-                 <property name="visible">True</property>
-                 <property name="can_focus">True</property>
-                 <property name="label" translatable="yes">Hide</property>
-                 <property name="use_underline">True</property>
-                 <property name="relief">GTK_RELIEF_NORMAL</property>
-                 <property name="focus_on_click">True</property>
-                 <signal name="clicked" handler="on_hideconsolebtn_clicked" last_modification_time="Wed, 22 Jul 2009 15:23:55 GMT"/>
+                 <child>
+                   <widget class="GtkButton" id="consoledecbtn">
+                     <property name="width_request">27</property>
+                     <property name="visible">True</property>
+                     <property name="can_focus">True</property>
+                     <property name="label" translatable="yes">-</property>
+                     <property name="use_underline">True</property>
+                     <property name="relief">GTK_RELIEF_NORMAL</property>
+                     <property name="focus_on_click">True</property>
+                     <signal name="clicked" handler="on_consoledecbtn_clicked" last_modification_time="Wed, 22 Jul 2009 15:24:50 GMT"/>
+                   </widget>
+                   <packing>
+                     <property name="left_attach">2</property>
+                     <property name="right_attach">3</property>
+                     <property name="top_attach">0</property>
+                     <property name="bottom_attach">1</property>
+                     <property name="x_options">fill</property>
+                     <property name="y_options"></property>
+                   </packing>
+                 </child>
+
+                 <child>
+                   <widget class="GtkButton" id="consoleincbtn">
+                     <property name="width_request">27</property>
+                     <property name="visible">True</property>
+                     <property name="can_focus">True</property>
+                     <property name="label" translatable="yes">+</property>
+                     <property name="use_underline">True</property>
+                     <property name="relief">GTK_RELIEF_NORMAL</property>
+                     <property name="focus_on_click">True</property>
+                     <signal name="clicked" handler="on_consoleincbtn_clicked" last_modification_time="Thu, 23 Jul 2009 18:54:38 GMT"/>
+                   </widget>
+                   <packing>
+                     <property name="left_attach">3</property>
+                     <property name="right_attach">4</property>
+                     <property name="top_attach">0</property>
+                     <property name="bottom_attach">1</property>
+                     <property name="x_options">fill</property>
+                     <property name="y_options"></property>
+                   </packing>
+                 </child>
+
+                 <child>
+                   <widget class="GtkButton" id="clearconsolebtn">
+                     <property name="visible">True</property>
+                     <property name="can_focus">True</property>
+                     <property name="label" translatable="yes">Clear</property>
+                     <property name="use_underline">True</property>
+                     <property name="relief">GTK_RELIEF_NORMAL</property>
+                     <property name="focus_on_click">True</property>
+                     <signal name="clicked" handler="on_clearconsolebtn_clicked" last_modification_time="Wed, 22 Jul 2009 15:22:56 GMT"/>
+                   </widget>
+                   <packing>
+                     <property name="left_attach">0</property>
+                     <property name="right_attach">1</property>
+                     <property name="top_attach">0</property>
+                     <property name="bottom_attach">1</property>
+                     <property name="y_options"></property>
+                   </packing>
+                 </child>
+
+                 <child>
+                   <widget class="GtkButton" id="hideconsolebtn">
+                     <property name="visible">True</property>
+                     <property name="can_focus">True</property>
+                     <property name="label" translatable="yes">Hide</property>
+                     <property name="use_underline">True</property>
+                     <property name="relief">GTK_RELIEF_NORMAL</property>
+                     <property name="focus_on_click">True</property>
+                     <signal name="clicked" handler="on_hideconsolebtn_clicked" last_modification_time="Wed, 22 Jul 2009 15:23:55 GMT"/>
+                   </widget>
+                   <packing>
+                     <property name="left_attach">1</property>
+                     <property name="right_attach">2</property>
+                     <property name="top_attach">0</property>
+                     <property name="bottom_attach">1</property>
+                     <property name="y_options"></property>
+                   </packing>
+                 </child>
                </widget>
                <packing>
-                 <property name="left_attach">0</property>
-                 <property name="right_attach">1</property>
-                 <property name="top_attach">1</property>
-                 <property name="bottom_attach">2</property>
-                 <property name="x_options">fill</property>
-                 <property name="y_options"></property>
+                 <property name="padding">0</property>
+                 <property name="expand">False</property>
+                 <property name="fill">True</property>
                </packing>
              </child>
            </widget>
        </widget>
        <packing>
          <property name="padding">0</property>
-         <property name="expand">False</property>
+         <property name="expand">True</property>
          <property name="fill">True</property>
        </packing>
       </child>
-
-      <child>
-       <placeholder/>
-      </child>
     </widget>
   </child>
 </widget>