gvcolor_t cl;
char *buf;
+ attribute=attribute +13;
buf = agget(view->g[view->activeGraph], attribute);
if ((!buf) || (strcmp(buf, "") == 0))
- buf = agget(view->default_attributes, attribute);
+ buf = agget(view->systemGraphs.def_attrs, attribute);
if (buf) {
colorxlate(buf, &cl, RGBA_DOUBLE);
color.red = (int) (cl.u.RGBA[0] * 65535.0);
{
GdkColor color;
char *buf = N_GNEW(256, char);
+ attribute=attribute +13;
+
gtk_color_button_get_color((GtkColorButton *)
glade_xml_get_widget(xml, widget_name),
&color);
static int get_text_widget_to_attribute(char *attribute, char *widget_name,
Agraph_t * g)
{
+ attribute=attribute +9;
+
if (strlen(attribute) > 512)
return 0;
agattr(g, AGRAPH, attribute,
static int set_text_widget(char *attribute, char *widget_name)
{
char *buf;
+ attribute=attribute +9;
+
buf = agget(view->g[view->activeGraph], attribute);
if ((!buf) || (strcmp(buf, "") == 0))
- buf = agget(view->default_attributes, attribute);
+ buf = agget(view->systemGraphs.def_attrs, attribute);
if (buf) {
gtk_entry_set_text((GtkEntry *)
glade_xml_get_widget(xml, widget_name), buf);
{
char *buf;
int value;
+ attribute=attribute +10;
+
buf = agget(view->g[view->activeGraph], attribute);
if ((!buf) || (strcmp(buf, "") == 0))
- buf = agget(view->default_attributes, attribute);
+ buf = agget(view->systemGraphs.def_attrs, attribute);
if (buf) {
value = atoi(buf);
gtk_toggle_button_set_active((GtkToggleButton *)
{
int value;
char buf[100];
+ attribute=attribute +10;
+
value = (int) gtk_toggle_button_get_active((GtkToggleButton *)
glade_xml_get_widget(xml,
widget_name));
{
char *buf;
float value;
+ attribute=attribute +12;
+
buf = agget(view->g[view->activeGraph], attribute);
if ((!buf) || (strcmp(buf, "") == 0))
- buf = agget(view->default_attributes, attribute);
+ buf = agget(view->systemGraphs.def_attrs, attribute);
if (buf) {
value = (float) atof(buf);
gtk_spin_button_set_value((GtkSpinButton *)
{
float value;
char buf[25];
+ attribute=attribute +12;
+
value = (float) gtk_spin_button_get_value((GtkSpinButton *)
glade_xml_get_widget(xml,
widget_name));
{
float value;
char buf[25];
+ attribute=attribute +13;
+
value = (float) gtk_range_get_value((GtkRange *)
glade_xml_get_widget(xml,
widget_name));
{
char *buf;
float value;
+ attribute=attribute +13;
buf = agget(view->g[view->activeGraph], attribute);
+
if ((!buf) || (strcmp(buf, "") == 0))
- buf = agget(view->default_attributes, attribute);
+ buf = agget(view->systemGraphs.def_attrs, attribute);
if (buf) {
value = (float) atof(buf);
gtk_range_set_value((GtkRange *)
{
char *buf;
int value;
+ attribute=attribute +9;
buf = agget(view->g[view->activeGraph], attribute);
-
if ((!buf) || (strcmp(buf, "") == 0))
- buf = agget(view->default_attributes, attribute);
+ buf = agget(view->systemGraphs.def_attrs, attribute);
if (buf) {
value = (int) atof(buf);
gtk_combo_box_set_active((GtkComboBox *)
{
char buf[25];
float value;
+ attribute=attribute +9;
+
value = (float)
gtk_combo_box_get_active((GtkComboBox *)
}
-
-
-
-/*
-Q-What are these set and get functions ?
-A-These are functions to set and get data from GTK widgets based on what object they are
-User click on setting windows, all window parameters are updated from current graph,
-default values are stored in a template graph ""
-
-*/
-
-
-
-
-
int load_settings_from_graph(Agraph_t * g)
{
- char *buf; /*local buffer */
- set_color_button_widget("bgcolor", "settingsColorBtn1");
- set_color_button_widget("bordercolor", "settingsColorBtn2");
- set_color_button_widget("gridcolor", "settingsColorBtn3");
- set_color_button_widget("highlightednodecolor", "settingsColorBtn6");
- set_color_button_widget("highlightededgecolor", "settingsColorBtn7");
- set_color_button_widget("selectednodecolor", "settingsColorBtn8");
- set_color_button_widget("selectededgecolor", "settingsColorBtn9");
- set_color_button_widget("defaultnodecolor", "DefaultNodeCbtn");
- set_color_button_widget("defaultedgecolor", "DefaultEdgeCbtn");
-
- set_color_button_widget("topologicaltopviewfinestcolor",
- "settingsColorBtn9");
- set_color_button_widget("topologicaltopviewcoarsestcolor",
- "settingsColorBtn9");
-
- set_color_button_widget("topologicalfisheyefinestcolor",
- "settingsColorBtn10");
- set_color_button_widget("topologicalfisheyecoarsestcolor",
- "settingsColorBtn11");
- set_text_widget("topologicalfisheyelabelattribute",
- "finenodelabelattribute");
-
-
- set_checkbox_widget("bordervisible", "settingsChkBox2");
- set_checkbox_widget("gridvisible", "settingsChkBox3");
-
- set_checkbox_widget("drawnodes", "settingsChkBox5-1");
- set_checkbox_widget("drawedges", "settingsChkBox5-2");
-
-
- /*page 2 label settings */
- set_combobox_widget("labelglutfont", "labelfont");
-
- set_color_button_widget("nodelabelcolor", "nodelabelcolor");
- set_color_button_widget("edgelabelcolor", "edgelabelcolor");
- set_text_widget("nodelabelattribute", "labelnodeattribute");
- set_text_widget("edgecolorattribute", "edgecolortxt");
-
-
- set_text_widget("edgelabelattribute", "labeledgeattribute");
- set_checkbox_widget("labelwithdegree", "labelwithdegree");
- set_spinbtn_widget("labelnumberofnodes", "labelzoomfactor");
- set_checkbox_widget("shownodelabels", "labelshownodes");
- set_checkbox_widget("showedgelabels", "labelshowedges");
-
-
-
- set_checkbox_widget("usermode", "settingsChkBox10");
- set_checkbox_widget("nodesizewithdegree", "settingsChkBox11");
- set_checkbox_widget("antialiasing", "settingsChkBox12");
-
- set_checkbox_widget("topologicalfisheyedist2limit",
- "settingsChkBox13");
- set_checkbox_widget("topologicalfisheyeanimate", "settingsChkBox14");
- set_checkbox_widget("topologicalfisheyelabelfinenodes",
- "settingsChkBox15");
- set_checkbox_widget("topologicalfisheyecolornodes",
- "settingsChkBox16");
- set_checkbox_widget("topologicalfisheyecoloredges",
- "settingsChkBox17");
- set_checkbox_widget("topologicalfisheyelabelfocus",
- "settingsChkBox18");
-
- set_checkbox_widget("defaultnodeshapegl", "settingsChkBox10_1");
- set_checkbox_widget("defaultnodeshapespherical", "settingsChkBox10_2");
- set_checkbox_widget("defaultnodeshaperectangular",
- "settingsChkBox10_3");
-
-
-
- set_spinbtn_widget("defaultmagnifierwidth", "settingsspinbutton1");
- set_spinbtn_widget("defaultmagnifierheight", "settingsspinbutton2");
- set_spinbtn_widget("defaultmagnifierkts", "settingsspinbutton3");
- set_spinbtn_widget("defaultfisheyemagnifierradius",
- "settingsspinbutton4");
- set_spinbtn_widget("defaultfisheyemagnifierdistort",
- "settingsspinbutton5");
- set_spinbtn_widget("topologicalfisheyefinenodes",
- "settingsspinbutton6");
- set_spinbtn_widget("topologicalfisheyecoarseningfactor",
- "settingsspinbutton7");
- set_spinbtn_widget("topologicalfisheyedistortionfactor",
- "settingsspinbutton8");
-
- /*alpha values,1 for nodes 1 for edges */
-
-
- set_scalebtn_widget_to_attribute("defaultnodealpha", "settingsscale1"); /*node alpha */
- set_scalebtn_widget_to_attribute("defaultedgealpha", "settingsscale2"); /*edge alpha */
- set_scalebtn_widget_to_attribute("nodesize", "nodesizescale"); /*edge alpha */
-
- /*Node Shape Combo, 0:opengl dots, 1:circle ,2:box */
- buf = agget(view->g[view->activeGraph], "defaultnodeshape");
- if (!buf)
- buf = agget(view->default_attributes, "defaultnodeshape");
- if (buf) {
- /*select the right item in combo box */
- gtk_combo_box_set_active((GtkComboBox *)
- glade_xml_get_widget(xml,
- "settingscombobox1"),
- atoi(buf));
-
- }
- /*Color theme */
- buf = agget(view->g[view->activeGraph], "colortheme");
- if (!buf)
- buf = agget(view->default_attributes, "colortheme");
- if (buf) {
- /*select the right item in combo box */
- gtk_combo_box_set_active((GtkComboBox *)
- glade_xml_get_widget(xml,
- "colorthemecb"),
- atoi(buf));
+ Agsym_t* sym=NULL;
+ while ((sym = agnxtattr(view->systemGraphs.attrs_widgets,AGRAPH, sym)))
+ {
+ if(strncmp (sym->name,"color_button",strlen("color_button"))==0)
+ set_color_button_widget(sym->name, agget(view->systemGraphs.attrs_widgets,sym->name));
+ if(strncmp (sym->name,"check_box",strlen("check_box"))==0)
+ set_checkbox_widget(sym->name, agget(view->systemGraphs.attrs_widgets,sym->name));
+ if(strncmp (sym->name,"text_box",strlen("text_box"))==0)
+ set_text_widget(sym->name, agget(view->systemGraphs.attrs_widgets,sym->name));
+ if(strncmp (sym->name,"combobox",strlen("combobox"))==0)
+ set_combobox_widget(sym->name, agget(view->systemGraphs.attrs_widgets,sym->name));
+ if(strncmp (sym->name,"spin_button",strlen("spin_button"))==0)
+ set_spinbtn_widget(sym->name, agget(view->systemGraphs.attrs_widgets,sym->name));
+ if(strncmp (sym->name,"scale_button",strlen("scale_button"))==0)
+ set_scalebtn_widget_to_attribute(sym->name, agget(view->systemGraphs.attrs_widgets,sym->name));
}
-
-
-
- /*Node Shape Combo, 0:opengl dots, 1:circle ,2:box */
-
return 1;
}
int update_graph_from_settings(Agraph_t * g)
{
-#ifdef UNUSED
- gchar *buf;
- int value;
- char buf2[10];
+ Agsym_t* sym=NULL;
+ while ((sym = agnxtattr(view->systemGraphs.attrs_widgets,AGRAPH, sym)))
+ {
+ if(strncmp (sym->name,"color_button",strlen("color_button"))==0)
+ get_color_button_widget_to_attribute(sym->name, agget(view->systemGraphs.attrs_widgets,sym->name),g);
+ if(strncmp (sym->name,"check_box",strlen("check_box"))==0)
+ get_checkbox_widget_to_attribute(sym->name, agget(view->systemGraphs.attrs_widgets,sym->name),g);
+ if(strncmp (sym->name,"text_box",strlen("text_box"))==0)
+ get_text_widget_to_attribute(sym->name, agget(view->systemGraphs.attrs_widgets,sym->name),g);
+ if(strncmp (sym->name,"combobox",strlen("combobox"))==0)
+ get_combobox_widget_to_attribute(sym->name, agget(view->systemGraphs.attrs_widgets,sym->name),g);
+ if(strncmp (sym->name,"spin_button",strlen("spin_button"))==0)
+ get_spinbtn_widget_to_attribute(sym->name, agget(view->systemGraphs.attrs_widgets,sym->name),g);
+ if(strncmp (sym->name,"scale_button",strlen("scale_button"))==0)
+ get_scalebtn_widget_to_attribute(sym->name, agget(view->systemGraphs.attrs_widgets,sym->name),g);
- buf =
- gtk_font_selection_get_font_name((GtkFontSelection *)
- glade_xml_get_widget(xml,
- "settingsFontSelection"));
- agset(g, "defaultfontname", buf);
-#endif
- get_color_button_widget_to_attribute("bgcolor", "settingsColorBtn1",
- g);
- get_color_button_widget_to_attribute("bordercolor",
- "settingsColorBtn2", g);
- get_color_button_widget_to_attribute("gridcolor", "settingsColorBtn3",
- g);
- get_color_button_widget_to_attribute("highlightednodecolor",
- "settingsColorBtn6", g);
- get_color_button_widget_to_attribute("highlightededgecolor",
- "settingsColorBtn7", g);
- get_color_button_widget_to_attribute("selectednodecolor",
- "settingsColorBtn8", g);
- get_color_button_widget_to_attribute("selectededgecolor",
- "settingsColorBtn9", g);
-
-
- get_color_button_widget_to_attribute("defaultnodecolor",
- "DefaultNodeCbtn", g);
- get_color_button_widget_to_attribute("defaultedgecolor",
- "DefaultEdgeCbtn", g);
-
-
-
- get_color_button_widget_to_attribute("topologicalfisheyefinestcolor",
- "settingsColorBtn10", g);
- get_color_button_widget_to_attribute("topologicalfisheyecoarsestcolor",
- "settingsColorBtn11", g);
- get_text_widget_to_attribute("topologicalfisheyelabelattribute",
- "finenodelabelattribute", g);
-
-
- get_checkbox_widget_to_attribute("bordervisible", "settingsChkBox2",
- g);
- get_checkbox_widget_to_attribute("gridvisible", "settingsChkBox3", g);
-
- get_checkbox_widget_to_attribute("drawnodes", "settingsChkBox5-1", g);
- get_checkbox_widget_to_attribute("drawedges", "settingsChkBox5-2", g);
-
- /*page 2 label settings */
- get_combobox_widget_to_attribute("labelglutfont", "labelfont", g);
-
- get_color_button_widget_to_attribute("nodelabelcolor",
- "nodelabelcolor", g);
- get_color_button_widget_to_attribute("edgelabelcolor",
- "edgelabelcolor", g);
-
- get_text_widget_to_attribute("nodelabelattribute",
- "labelnodeattribute", g);
- get_text_widget_to_attribute("edgelabelattribute",
- "labeledgeattribute", g);
-
- get_text_widget_to_attribute("edgecolorattribute", "edgecolortxt", g);
-
- get_checkbox_widget_to_attribute("labelwithdegree", "labelwithdegree",
- g);
- get_spinbtn_widget_to_attribute("labelnumberofnodes",
- "labelzoomfactor", g);
- get_checkbox_widget_to_attribute("shownodelabels", "labelshownodes",
- g);
- get_checkbox_widget_to_attribute("showedgelabels", "labelshowedges",
- g);
-
-
-
-
-
-
-
-
-
- get_checkbox_widget_to_attribute("usermode", "settingsChkBox10", g);
-
-
-
- get_checkbox_widget_to_attribute("nodesizewithdegree",
- "settingsChkBox11", g);
- get_checkbox_widget_to_attribute("antialiasing", "settingsChkBox12",
- g);
-
- get_checkbox_widget_to_attribute("topologicalfisheyedist2limit",
- "settingsChkBox13", g);
- get_checkbox_widget_to_attribute("topologicalfisheyeanimate",
- "settingsChkBox14", g);
- get_checkbox_widget_to_attribute("topologicalfisheyelabelfinenodes",
- "settingsChkBox15", g);
- get_checkbox_widget_to_attribute("topologicalfisheyecolornodes",
- "settingsChkBox16", g);
- get_checkbox_widget_to_attribute("topologicalfisheyecoloredges",
- "settingsChkBox17", g);
- get_checkbox_widget_to_attribute("topologicalfisheyelabelfocus",
- "settingsChkBox18", g);
-
- get_spinbtn_widget_to_attribute("defaultmagnifierwidth",
- "settingsspinbutton1", g);
- get_spinbtn_widget_to_attribute("defaultmagnifierheight",
- "settingsspinbutton2", g);
- get_spinbtn_widget_to_attribute("defaultmagnifierkts",
- "settingsspinbutton3", g);
- get_spinbtn_widget_to_attribute("defaultfisheyemagnifierradius",
- "settingsspinbutton4", g);
- get_spinbtn_widget_to_attribute("defaultfisheyemagnifierdistort",
- "settingsspinbutton5", g);
- get_spinbtn_widget_to_attribute("topologicalfisheyefinenodes",
- "settingsspinbutton6", g);
- get_spinbtn_widget_to_attribute("topologicalfisheyecoarseningfactor",
- "settingsspinbutton7", g);
- get_spinbtn_widget_to_attribute("topologicalfisheyedistortionfactor",
- "settingsspinbutton8", g);
- /*added later */
- get_scalebtn_widget_to_attribute("defaultnodealpha",
- "settingsscale1", g);
- get_scalebtn_widget_to_attribute("defaultedgealpha",
- "settingsscale2", g);
- get_scalebtn_widget_to_attribute("nodesize", "nodesizescale", g);
- get_combobox_widget_to_attribute("defaultnodeshape",
- "settingscombobox1", g);
- get_combobox_widget_to_attribute("colortheme", "colorthemecb", g);
+ }
return 1;
}
static void init_element_data(element_data * d)
{
- d->Highlighted = 0;
d->Layer = 0;
d->Visible = 1;
- d->Highlighted = 0;
d->Selected = 0;
- d->Preselected = 0;
d->NumDataCount = 0;
d->NumData = (float *) 0;
d->StrDataCount = 0;
d->StrData = (char **) 0;
- d->selectionflag = 0;
d->param = 0;
d->TVRef = -1;
}
static void setglCompColor(glCompColor * c, char *colorstr)
{
gvcolor_t cl;
+ float A=1;
/*if node has color attribute */
if ((colorstr != '\0') && (strlen(colorstr) > 0)) {
colorxlate(colorstr, &cl, RGBA_DOUBLE);
} else {
colorxlate(agget(view->g[view->activeGraph], "defaultnodecolor"),
&cl, RGBA_DOUBLE);
+
c->tag = 0;
+ A= view->defaultnodealpha;
}
c->R = (float) cl.u.RGBA[0];
c->G = (float) cl.u.RGBA[1];
c->B = (float) cl.u.RGBA[2];
- c->A = (float) cl.u.RGBA[3];
-
+ c->A = (float) cl.u.RGBA[3]*A;
+
}
#undef DIST2
/*while in the loop why dont we set some smyrna settings from graph? selected , highlighted , visible */
np->data.Selected = boolAttr(np->Node, sel, 0);
- np->data.Highlighted = boolAttr(np->Node, hilite, 0);
np->data.Visible = visible(np->Node, vis, sty);
tempStr=agget(t->Nodes[ind].Node, "size");
if(tempStr)
ep->data.edgeid = boolAttr(ep->Edge, edgeid, 0);
ep->Color = color;
ep->data.Selected = boolAttr(ep->Edge, sel, 0);
- ep->data.Highlighted = boolAttr(ep->Edge, hilite, 0);
ep->data.Visible = visible(ep->Edge, vis, sty);
}
}
-#if UNUSED
-static xdot *parseXdotwithattr(void *p, char *attr)
-{
- int ind;
- xdot *xDot;
- xdot_op* x_op;
- sdot_op* s_op;
- xDot = parseXDotF(agget(p, attr), OpFns, sizeof(sdot_op));
- if (!xDot)
- return NULL;
- for (ind = 0 ; ind < xDot->cnt; ind ++)
- {
- x_op=&(xDot->ops[ind]);
- s_op=(sdot_op*)x_op;
- s_op->font=NULL;
- s_op->layer=ind;
- }
- return xDot;
-}
-#endif
static xdot* parseXdotwithattrs(void *e)
{
Agnode_t *v;
Agedge_t *e;
Agsym_t *sym;
- int ind, ind2, data_type_count; //number of columns for custom view->Topview data ,IP ,HOST, etc
+ int ind, ind2, data_type_count;
float maxedgelen, minedgelen, edgelength;
//bind temp record;
agbindrec(v, "temp_node_record", sizeof(temp_node_record), TRUE); //graph custom data
/*initialize group index, -1 means no group */
- t->Nodes[ind].GroupIndex = -1;
t->Nodes[ind].Node = v;
t->Nodes[ind].data.TVRef = ind;
((temp_node_record *) AGDATA(v))->TVref = ind;
view->selectedNodeColor.A);
} else { //get the color from node
glColor4f(v->Color.R, v->Color.G, v->Color.B,
- v->node_alpha * view->defaultnodealpha);
+ v->node_alpha);
ddx = 0;
ddy = 0;
ddz = 0;
view->selectedEdgeColor.B, view->selectedEdgeColor.A);
return return_value;
}
- /*edge maybe in a group and group may be selected, then use groups's color example:ATT hosts */
- if ((e->Node1->GroupIndex >= 0) || (e->Node2->GroupIndex >= 0)) {
- if (view->Topview->TopviewData->hostactive[e->Node1->GroupIndex] ==
- 1) {
- gtk_color_button_get_color(view->Topview->TopviewData->
- gtkhostcolor[e->Node1->GroupIndex],
- &color);
- glColor4f((GLfloat) color.red / (GLfloat) 65535.0,
- (GLfloat) color.green / (GLfloat) 65535.0,
- (GLfloat) color.blue / (GLfloat) 65535.0,
- (GLfloat) 1);
- return return_value;
- } else {
- if (view->Topview->TopviewData->
- hostactive[e->Node2->GroupIndex] == 1) {
- gtk_color_button_get_color(view->Topview->TopviewData->
- gtkhostcolor[e->Node2->
- GroupIndex],
- &color);
- glColor4f((GLfloat) color.red / (GLfloat) 65535.0,
- (GLfloat) color.green / (GLfloat) 65535.0,
- (GLfloat) color.blue / (GLfloat) 65535.0,
- (GLfloat) 1);
- return return_value;
- }
- }
-
- }
-
/*get edge's color attribute */
if (e->Color.tag == 0)
glColor4f(e->Color.R, e->Color.G, e->Color.B, Alpha * e->Color.A);
return valid;
}
-int prepare_nodes_for_groups(topview * t, topviewdata * td, int groupindex)
-{
- GdkColor color;
- int i;
- int count = 0;
- tv_node tvn;
- gtk_color_button_get_color(td->gtkhostcolor[0], &color);
-
- for (i = 0; i < t->Nodecount; i++) {
- tvn.index = i;
- if (validate_group_node(&tvn, td->hostregex[groupindex])) {
- count++;
- gtk_color_button_get_color(td->gtkhostcolor[groupindex],
- &color);
- t->Nodes[i].GroupIndex = groupindex;
- t->Nodes[i].GroupColor.R = (float) color.red / (float) 65535.0;
- t->Nodes[i].GroupColor.G =
- (float) color.green / (float) 65535.0;
- t->Nodes[i].GroupColor.B =
- (float) color.blue / (float) 65535.0;
- }
- }
- return 1;
-}
-
-/*int load_host_buttons(topview * t, Agraph_t * g, glCompSet * s)
-{
- GtkLayout *layout;
- int btncount = 0;
- int i = 0;
- char *str;
- char hostbtncaption[50];
- char hostbtnregex[50];
- char hostbtncolorR[50];
- char hostbtncolorG[50];
- char hostbtncolorB[50];
- char hostbtncolorA[50];
- int X = 10;
- int Y = 25;
- GdkColor color;
- glCompPanel *p;
- glCompButton *b;
-
- layout =
- (GtkLayout *) glade_xml_get_widget(xml, "frmHostSelectionFixed");
- str = '\0';
- str = agget(g, "hostbtncount");
- if (str)
- btncount = atoi(str);
-
-// Graph [hostbtncaption1="AT&T",hostbtnregex1="*.ATT*",hostbtncolorR1="1",hostbtncolorG1="0",hostbtncolorB1="0",hostbtncolorA1="1"];
-
- t->TopviewData->hostregex = N_GNEW(btncount, char *);
- t->TopviewData->gtkhostbtn = N_GNEW(btncount, GtkButton *);
- t->TopviewData->gtkhostcolor = N_GNEW(btncount, GtkColorButton *);
- t->TopviewData->gtkhostbtncount = btncount;
- if (btncount > 0) {
- 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;
- glCompSetAddPanel(s, p);
- } else
- return 0;
-
- for (i = 0; i < btncount; i++) {
- sprintf(hostbtncaption, "hostbtncaption%i", i);
- sprintf(hostbtnregex, "hostbtnregex%i", i);
- sprintf(hostbtncolorR, "hostbtncolorR%i", i);
- sprintf(hostbtncolorG, "hostbtncolorG%i", i);
- sprintf(hostbtncolorB, "hostbtncolorB%i", i);
- sprintf(hostbtncolorA, "hostbtncolorA%i", i);
- agget(g, hostbtncaption),
- agget(g, hostbtnregex),
- agget(g, hostbtncolorR),
- agget(g, hostbtncolorG),
- agget(g, hostbtncolorB), 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,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));
- b->color.A = (float) 1;
- b->panel = p;
- b->groupid = -1;
- b->callbackfunc = glhost_button_clicked_Slot;
- b->data = i;
- glCompSetAddButton(s, b);
-
- t->TopviewData->gtkhostbtn[i] = (GtkButton *)
- gtk_button_new_with_label(agget(g, hostbtncaption));
- g_signal_connect((gpointer) t->TopviewData->gtkhostbtn[i],
- "clicked", G_CALLBACK(host_button_clicked_Slot),
- (gpointer) i);
-
- color.blue = 65535 * atoi(agget(g, hostbtncolorB));
- color.red = 65535 * atoi(agget(g, hostbtncolorR));
- color.green = 65535 * atoi(agget(g, hostbtncolorG));
-
- t->TopviewData->gtkhostcolor[i] =
- (GtkColorButton *) gtk_color_button_new_with_color(&color);
-
- gtk_color_button_set_alpha((GtkColorButton *) t->TopviewData->
- gtkhostbtn[i],
- 65535 * atoi(agget(g, hostbtncolorA)));
-
-
- gtk_layout_put(layout, (GtkWidget *) t->TopviewData->gtkhostbtn[i],
- X, Y);
- gtk_widget_set_size_request((GtkWidget *) t->TopviewData->
- gtkhostbtn[i], 200, 35);
-
- gtk_layout_put(layout,
- (GtkWidget *) t->TopviewData->gtkhostcolor[i],
- X + 225, Y);
- gtk_widget_set_size_request((GtkWidget *) t->TopviewData->
- gtkhostcolor[i], 40, 35);
-
- gtk_widget_show((GtkWidget *) t->TopviewData->gtkhostbtn[i]);
- gtk_widget_show((GtkWidget *) t->TopviewData->gtkhostcolor[i]);
- Y = Y + 40;
- t->TopviewData->hostactive[i] = 0;
- }
- p->height = (GLfloat) 15 + (GLfloat) (btncount + 1) * (GLfloat) 36;
- for (i = 0; i < btncount; i++) {
- prepare_nodes_for_groups(t, t->TopviewData, i);
- }
- return 1;
-}*/
-void glhost_button_clicked_Slot(void *p)
-{
- //negative active
- int user_data;
- user_data = ((glCompButton *) p)->data;
- if (view->Topview->TopviewData->hostactive[user_data] == 0)
- view->Topview->TopviewData->hostactive[user_data] = 1;
- else
- view->Topview->TopviewData->hostactive[user_data] = 0;
- glexpose();
-}
-
-/*void host_button_clicked_Slot(GtkWidget * widget, gpointer user_data)
-{
- //negative active
- if (view->Topview->TopviewData->hostactive[(int) user_data] == 0)
- view->Topview->TopviewData->hostactive[(int) user_data] = 1;
- else
- view->Topview->TopviewData->hostactive[(int) user_data] = 0;
- glexpose();
-}*/