static void reset_attr_list_widgets(attr_list* l)
{
- int id=0;
- for (id;id < MAX_FILTERED_ATTR_COUNT ;id ++)
+ int id;
+ for (id=0;id < MAX_FILTERED_ATTR_COUNT ;id ++)
{
gtk_label_set_text(l->fLabels[id],"");
}
static void free_attr_list_widgets(attr_list* l)
{
- int id=0;
- for (id;id < MAX_FILTERED_ATTR_COUNT ;id ++)
+ int id;
+ for (id=0;id < MAX_FILTERED_ATTR_COUNT ;id ++)
{
gtk_object_destroy((GtkObject*)l->fLabels[id]);
}
void free_attr_list(attr_list* l)
{
- int id=0;
- for (id;id < l->attr_count; id ++)
+ int id;
+ for (id=0;id < l->attr_count; id ++)
{
free_attr(l->attributes[id]);
}
}
attr_list* attr_list_new(Agraph_t * g,int with_widgets )
{
- int id=0;
+ int id;
attr_list* l=malloc(sizeof(attr_list));
l->attr_count=0;
l->capacity=DEFAULT_ATTR_LIST_CAPACITY;
g_signal_connect((gpointer)glade_xml_get_widget(xml, "frmObject"), "motion_notify_event", G_CALLBACK(attr_label_motion), NULL);*/
if(with_widgets)
{
- for (id ; id < MAX_FILTERED_ATTR_COUNT ; id ++)
+ for (id=0 ; id < MAX_FILTERED_ATTR_COUNT ; id ++)
{
l->fLabels[id]=(GtkLabel*)gtk_label_new("");
}
void print_attr_list(attr_list* l)
{
- int id=0;
- for (id;id < l->attr_count; id ++)
+ int id;
+ for (id=0;id < l->attr_count; id ++)
{
printf ("%d %s (%d %d %d) \n",l->attributes[id]->index,l->attributes[id]->name,l->attributes[id]->objType[0],l->attributes[id]->objType[1],l->attributes[id]->objType[2]);
printf ("defG:%s defN:%s defE:%s\n",l->attributes[id]->defValG,l->attributes[id]->defValN,l->attributes[id]->defValE);
void attr_list_add(attr_list* l,attr_t* a)
{
- int id=0;
+ int id;
if ( (!l) || (!a))
return;
l->attr_count ++ ;
if (l->attr_count > 1)
attr_list_sort(l);
/*update indices*/
- for (id;id < l->attr_count; id ++)
+ for (id=0;id < l->attr_count; id ++)
l->attributes[id]->index=id;
char* a;
a=strtok(str," ");
object_type_helper(a,t);
- while (a=strtok(NULL," or "))
+ while ((a=strtok(NULL," or ")))
object_type_helper(a,t);
}
//void filter_attributes(char* prefix, attr_list* l)
{
- int ind=0;
+ int ind;
int tmp;
attr_list* l=t->attributes;
fl=attr_list_new(NULL,0);
reset_attr_list_widgets(l);
create_filtered_list(prefix,l,fl);
- for (ind;ind < fl->attr_count; ind ++)
+ for (ind=0;ind < fl->attr_count; ind ++)
{
gtk_label_set_text(l->fLabels[ind],fl->attributes[ind]->name);
}
_BB void on_attrApplyBtn_clicked (GtkWidget * widget, gpointer user_data)
{
- int ind=0;
- int cnt=0;
+ int ind;
char* attr_name;
char* value;
char* def_val;
if(objKind==AGRAPH)
agset(g,attr_name,value);
/*nodes*/
- if(objKind==AGNODE)
- {
- for (ind;ind < view->Topview->Nodecount; ind ++)
+ else if(objKind==AGNODE) {
+ for (ind=0;ind < view->Topview->Nodecount; ind ++)
{
n=&t->Nodes[ind];
if (n->data.Selected)
}
}
/*edges*/
- if(objKind==AGEDGE)
- {
+ else if(objKind==AGEDGE) {
- for (ind;ind < view->Topview->Edgecount; ind ++)
+ for (ind=0;ind < view->Topview->Edgecount; ind ++)
{
e=&t->Edges[ind];
if (e->data.Selected)
agset(e->Edge,attr_name,value);
}
}
+ else
+ fprintf (stderr, "on_attrApplyBtn_clicked: unknown object kind %d\n",
+ objKind);
}
-_BB on_attrRB0_clicked (GtkWidget * widget, gpointer user_data)
+_BB void on_attrRB0_clicked (GtkWidget * widget, gpointer user_data)
{
filter_attributes((char*)
gtk_entry_get_text((GtkEntry*)glade_xml_get_widget(xml, "txtAttr")),view->Topview);
_BB void attr_label_motion(GtkWidget * widget,GdkEventMotion * event, gpointer data)
{
+#ifdef UNUSED
float x = (float) event->x;
float y = (float) event->y;
-// printf ("%f %f \n",x,y);
+ printf ("%f %f \n",x,y);
+#endif
}
_BB void on_attrAddBtn_clicked (GtkWidget * widget, gpointer user_data)
{
- int ind=0;
+ int ind;
int cnt=0;
char* attr_name;
char* value;
}
attr->propagate=0;
- if (objKind==AGRAPH)
- {
+ if (objKind==AGRAPH) {
agattr(g, AGRAPH, attr_name,defValue);
attr->defValG=safestrdup(defValue);
attr->objType[0]=1;
}
/*nodes*/
- if (objKind==AGNODE)
- {
- for (ind;ind < view->Topview->Nodecount; ind ++)
+ else if (objKind==AGNODE) {
+ for (ind=0;ind < view->Topview->Nodecount; ind ++)
{
n=&t->Nodes[ind];
if (n->data.Selected)
}
- if (objKind==AGEDGE)
- {
+ else if (objKind==AGEDGE) {
cnt=0;
/*edges*/
- for (ind;ind < view->Topview->Edgecount; ind ++)
+ for (ind=0;ind < view->Topview->Edgecount; ind ++)
{
e=&t->Edges[ind];
if (e->data.Selected)
attr->objType[2]=1;
}
+ else
+ fprintf (stderr, "on_attrAddBtn_clicked: unknown object kind %d\n",
+ objKind);
filter_attributes(attr_name,view->Topview);
-
}
attr_list* load_attr_list(Agraph_t* g)
a=strtok(line,",");
attr->index=i;
attr->type=get_attr_data_type(a[0]);
- while (a=strtok(NULL,","))
+ while ((a=strtok(NULL,",")))
{
/*C,(0)color, (1)black, (2)EDGE Or NODE Or CLUSTER, (3)ALL_ENGINES*/
int nodeCnt;
int edgeCnt;
static char buf[512];
- int ind=0;
+ int ind;
topview* t;
topview_node* n;
t=view->Topview;
- for (ind;ind < view->Topview->Nodecount; ind ++)
+ for (ind=0;ind < view->Topview->Nodecount; ind ++)
{
n=&t->Nodes[ind];
if (n->data.Selected)
nodeCnt++;
}
}
- for (ind;ind < view->Topview->Edgecount; ind ++)
+ for (ind=0;ind < view->Topview->Edgecount; ind ++)
{
e=&t->Edges[ind];
if (e->data.Selected)
+/* $Id$Revision: */
+/* vim:set shiftwidth=4 ts=8: */
+/**********************************************************
+* This software is part of the graphviz package *
+* http://www.graphviz.org/ *
+* *
+* Copyright (c) 1994-2004 AT&T Corp. *
+* and is licensed under the *
+* Common Public License, Version 1.0 *
+* by AT&T Corp. *
+* *
+* Information and Software Systems Research *
+* AT&T Research, Florham Park NJ *
+**********************************************************/
#ifndef FRMOBJECTUI_H
#define FRMOBJECTUI_H
*/
#define ATTR_NOTEBOOK_IDX 6
+
extern attr_list* attr_list_new(Agraph_t * g,int with_widgets );
extern void attr_list_add(attr_list* l,attr_t* a);
extern void free_attr_list(attr_list* l);
extern attr_list* load_attr_list();
extern void filter_attributes(char* prefix,topview* t);
+
_BB void on_txtAttr_changed(GtkWidget * widget, gpointer user_data);
_BB void attr_label_motion(GtkWidget * widget,GdkEventMotion * event, gpointer data);
_BB void on_attrApplyBtn_clicked (GtkWidget * widget, gpointer user_data);
_BB void on_attrAddBtn_clicked (GtkWidget * widget, gpointer user_data);
-_BB on_on_attrRB0_clicked (GtkWidget * widget, gpointer user_data);
+
extern attr_list* load_attr_list(Agraph_t* g);
extern void showAttrsWidget(topview* t);
-#endif
\ No newline at end of file
+
+#endif