Graphviz 13.0.0~dev.20241220.2304
Loading...
Searching...
No Matches
frmobjectui.c
Go to the documentation of this file.
1/*************************************************************************
2 * Copyright (c) 2011 AT&T Intellectual Property
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * https://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors: Details at https://graphviz.org
9 *************************************************************************/
10
11#include <stdbool.h>
12#include <stdio.h>
13
14#include <stdlib.h>
15#include "gui.h"
16#include <glade/glade.h>
17#include <gdk/gdkkeysyms.h>
18#include <gdk/gdk.h>
19#include "viewport.h"
20#include "frmobjectui.h"
21#include <assert.h>
22#include "gvprpipe.h"
23#include <stdint.h>
24#include <string.h>
25#include <util/agxbuf.h>
26#include <util/alloc.h>
27#include <util/strcasecmp.h>
28#include <util/startswith.h>
29#include <util/strview.h>
30#include <util/unreachable.h>
31
32static int sel_node;
33static int sel_edge;
34static int sel_graph;
35
36static char *safestrdup(const char *src) {
37 if (!src)
38 return NULL;
39 else
40 return gv_strdup(src);
41}
42static int get_object_type(void)
43{
44 if (gtk_toggle_button_get_active
45 ((GtkToggleButton *) glade_xml_get_widget(xml, "attrRB0")))
46 return AGRAPH;
47 if (gtk_toggle_button_get_active
48 ((GtkToggleButton *) glade_xml_get_widget(xml, "attrRB1")))
49 return AGNODE;
50 if (gtk_toggle_button_get_active
51 ((GtkToggleButton *) glade_xml_get_widget(xml, "attrRB2")))
52 return AGEDGE;
53 return -1;
54}
55
56static attr_t *new_attr(void) {
57 return gv_alloc(sizeof(attr_t));
58}
59
61{
62 attr_t *a = new_attr();
63 a->name = gv_strdup(sym->name);
64 switch (sym->kind) {
65 case AGRAPH:
66 a->objType[0] = 1;
67 a->defValG = safestrdup(sym->defval);
68 break;
69 case AGNODE:
70 a->objType[1] = 1;
71 a->defValN = safestrdup(sym->defval);
72 break;
73 case AGEDGE:
74 a->objType[2] = 1;
75 a->defValE = safestrdup(sym->defval);
76 break;
77 default:
79 }
80 return a;
81}
82
83static attr_t *new_attr_ref(attr_t * refAttr)
84{
85 attr_t *a = gv_alloc(sizeof(attr_t));
86 *a = *refAttr;
87 a->defValG = safestrdup(refAttr->defValG);
88 a->defValN = safestrdup(refAttr->defValN);
89 a->defValE = safestrdup(refAttr->defValE);
90 a->name = gv_strdup(refAttr->name);
91 a->value = safestrdup(refAttr->value);
92 return a;
93}
94
96{
97 int id;
98 for (id = 0; id < MAX_FILTERED_ATTR_COUNT; id++) {
99 gtk_label_set_text(l->fLabels[id], "");
100 }
101}
102
103// creates a new attr_list
104// attr_list is a basic stack implementation
105// with alphanumeric sorting functions
106// that uses quicksort
107static attr_list *attr_list_new(bool with_widgets) {
108 int id;
109 attr_list *l = gv_alloc(sizeof(attr_list));
110 /*create filter widgets */
111
112 if (with_widgets) {
113 for (id = 0; id < MAX_FILTERED_ATTR_COUNT; id++) {
114 l->fLabels[id] = (GtkLabel *) gtk_label_new("");
115
116 gtk_widget_add_events((GtkWidget *) l->fLabels[id],
117 GDK_BUTTON_MOTION_MASK |
118 GDK_POINTER_MOTION_MASK |
119 GDK_BUTTON_PRESS_MASK | GDK_KEY_PRESS |
120 GDK_BUTTON_RELEASE_MASK |
121 GDK_SCROLL | GDK_VISIBILITY_NOTIFY_MASK);
122
123 gtk_widget_show((GtkWidget *) l->fLabels[id]);
124 Color_Widget_bg("blue", (GtkWidget *) l->fLabels[id]);
125 gtk_fixed_put((GtkFixed *) glade_xml_get_widget(xml, "fixed6"),
126 (GtkWidget *) l->fLabels[id], 10, 110 + id * 13);
127 }
128 }
129 return l;
130}
131
132static int attr_compare_core(const void *key, const void *candidate) {
133 const char *k = key;
134 const attr_t *const *c = candidate;
135 return strcasecmp(k, (*c)->name);
136}
137
138static int attr_compare(const attr_t **a, const attr_t **b) {
139 return attr_compare_core((*a)->name, b);
140}
141
142static void attr_list_add(attr_list *l, attr_t *a) {
143 if (!l || !a)
144 return;
145 attrs_append(&l->attributes, a);
146 attrs_sort(&l->attributes, attr_compare);
147 /*update indices */
148 for (size_t id = 0; id < attrs_size(&l->attributes); ++id)
149 attrs_get(&l->attributes, id)->index = id;
150}
151
153{
154 switch (c) {
155 case 'A':
156 return attr_alpha;
157 break;
158 case 'F':
159 return attr_float;
160 break;
161 case 'B':
162 return attr_bool;
163 break;
164 case 'I':
165 return attr_int;
166 break;
167 default:
168 break;
169 }
170 return attr_alpha;
171}
172
173static void object_type_helper(strview_t a, int *t) {
174 if (strview_str_eq(a, "GRAPH"))
175 t[0] = 1;
176 if (strview_str_eq(a, "CLUSTER"))
177 t[0] = 1;
178 if (strview_str_eq(a, "NODE"))
179 t[1] = 1;
180 if (strview_str_eq(a, "EDGE"))
181 t[2] = 1;
182 if (strview_str_eq(a, "ANY_ELEMENT")) {
183 t[0] = 1;
184 t[1] = 1;
185 t[2] = 1;
186 }
187}
188
189static void set_attr_object_type(const char *str, int *t) {
190 strview_t a = strview(str, ' ');
191 object_type_helper(a, t);
192 while (true) {
193 const char *start = a.data + a.size;
194 if (!startswith(start, " or ")) {
195 break;
196 }
197 start += strlen(" or ");
198 const char *end = strstr(start, " or ");
199 if (end == NULL) {
200 a = strview(start, '\0');
201 } else {
202 a = (strview_t){.data = start, .size = (size_t)(end - start)};
203 }
204 object_type_helper(a, t);
205 }
206}
207
208static attr_t *binarySearch(attr_list *l, const char *searchKey) {
209 attrs_sync(&l->attributes);
210 attr_t **attrp = bsearch(searchKey, attrs_front(&l->attributes),
211 attrs_size(&l->attributes), sizeof(attr_t*),
213 if (attrp != NULL) {
214 return *attrp;
215 }
216 return NULL;
217}
218
219static int cmp(const void *key, const void *candidate) {
220 const attr_t *const a = candidate;
221 return strncasecmp(key, a->name, strlen(key));
222}
223
224static void create_filtered_list(const char *prefix, attr_list *sl,
225 attr_list *tl) {
226 int objKind = get_object_type();
227
228 if (strlen(prefix) == 0)
229 return;
230 /*locate first occurrence */
231 attrs_sync(&sl->attributes);
232 attr_t *at = bsearch(prefix, attrs_front(&sl->attributes),
233 attrs_size(&sl->attributes), sizeof(attr_t), cmp);
234 if (!at)
235 return;
236
237 /*go backward to get the first */
238 for (int res = 0; at->index > 0 && res == 0; ) {
239 at = attrs_get(&sl->attributes, at->index - 1);
240 res = strncasecmp(prefix, at->name, strlen(prefix));
241 }
242 for (int res = 0; at->index < attrs_size(&sl->attributes) && res == 0; ) {
243 at = attrs_get(&sl->attributes, at->index + 1);
244 res = strncasecmp(prefix, at->name, strlen(prefix));
245 if (res == 0 && at->objType[objKind] == 1)
247 }
248}
249
250static void filter_attributes(const char *prefix, topview *t) {
251 int tmp;
252
253 attr_list *l = t->attributes;
254 int objKind = get_object_type();
255
256 attr_list *fl = attr_list_new(false);
259 for (size_t ind = 0; ind < attrs_size(&fl->attributes); ++ind) {
260 gtk_label_set_text(l->fLabels[ind], attrs_get(&fl->attributes, ind)->name);
261 }
262
263 Color_Widget_bg("white", glade_xml_get_widget(xml, "txtAttr"));
264 if (attrs_is_empty(&fl->attributes))
265 Color_Widget_bg("red", glade_xml_get_widget(xml, "txtAttr"));
266 /*a new attribute can be entered */
267
268 gtk_widget_show(glade_xml_get_widget(xml, "txtValue"));
269 gtk_widget_show(glade_xml_get_widget(xml, "txtDefValue"));
270
271 gtk_entry_set_text((GtkEntry *)
272 glade_xml_get_widget(xml, "txtDefValue"), "");
273 gtk_entry_set_text((GtkEntry *) glade_xml_get_widget(xml, "txtValue"),
274 "");
275 gtk_widget_set_sensitive(glade_xml_get_widget(xml, "txtDefValue"), 1);
276 gtk_widget_show(glade_xml_get_widget(xml, "attrAddBtn"));
277 gtk_widget_hide(glade_xml_get_widget(xml, "attrApplyBtn"));
278 gtk_widget_hide(glade_xml_get_widget(xml, "attrApplyAllBtn"));
279 gtk_widget_hide(glade_xml_get_widget(xml, "attrSearchBtn"));
280 gtk_toggle_button_set_active((GtkToggleButton *)
281 glade_xml_get_widget(xml, "attrProg"), 0);
282
283 if (strlen(prefix) == 0) {
284 gtk_widget_hide(glade_xml_get_widget(xml, "attrAddBtn"));
285 gtk_widget_hide(glade_xml_get_widget(xml, "attrApplyBtn"));
286 gtk_widget_hide(glade_xml_get_widget(xml, "attrApplyAllBtn"));
287 gtk_widget_hide(glade_xml_get_widget(xml, "attrSearchBtn"));
288 gtk_widget_hide(glade_xml_get_widget(xml, "attrAddBtn"));
289 gtk_widget_hide(glade_xml_get_widget(xml, "txtValue"));
290 gtk_widget_hide(glade_xml_get_widget(xml, "txtDefValue"));
291 Color_Widget_bg("white", glade_xml_get_widget(xml, "txtAttr"));
292 }
293
294 for (size_t ind = 0; ind < attrs_size(&fl->attributes); ++ind) {
295 if (strcasecmp(prefix, attrs_get(&fl->attributes, ind)->name) == 0) { // an existing attribute
296
297 Color_Widget_bg("green", glade_xml_get_widget(xml, "txtAttr"));
298
299 if (get_object_type() == AGRAPH)
300 gtk_entry_set_text((GtkEntry *)
301 glade_xml_get_widget(xml,
302 "txtDefValue"),
303 attrs_get(&fl->attributes, 0)->defValG);
304 if (get_object_type() == AGNODE)
305 gtk_entry_set_text((GtkEntry *)
306 glade_xml_get_widget(xml,
307 "txtDefValue"),
308 attrs_get(&fl->attributes, 0)->defValN);
309 if (get_object_type() == AGEDGE)
310 gtk_entry_set_text((GtkEntry *)
311 glade_xml_get_widget(xml,
312 "txtDefValue"),
313 attrs_get(&fl->attributes, 0)->defValE);
314 gtk_widget_set_sensitive(glade_xml_get_widget
315 (xml, "txtDefValue"), 0);
316 gtk_widget_hide(glade_xml_get_widget(xml, "attrAddBtn"));
317 gtk_widget_show(glade_xml_get_widget(xml, "attrApplyBtn"));
318 gtk_widget_show(glade_xml_get_widget(xml, "attrApplyAllBtn"));
319 gtk_widget_show(glade_xml_get_widget(xml, "attrSearchBtn"));
320 gtk_toggle_button_set_active((GtkToggleButton *)
321 glade_xml_get_widget(xml,
322 "attrProg"),
323 attrs_get(&fl->attributes, 0)->propagate);
324 break;
325 }
326 }
327
328 tmp = (objKind == AGNODE && sel_node)
329 || (objKind == AGEDGE && sel_edge)
330 || (objKind == AGRAPH && sel_graph);
331 gtk_widget_set_sensitive(glade_xml_get_widget(xml, "attrApplyBtn"),
332 tmp);
333}
334
335// attribute text changed call back
336
337_BB void on_txtAttr_changed(GtkWidget *widget, void *user_data) {
338 (void)user_data;
339 filter_attributes(gtk_entry_get_text((GtkEntry*)widget), view->Topview);
340}
341
342static void doApply(void)
343{
344 char *attr_name;
345 int prog;
346 Agnode_t *v;
347 Agedge_t *e;
348 Agraph_t *g;
349 int objKind;
350 Agsym_t *sym;
351 attr_t *attr;
352
353 /*values to be applied to selected objects */
354 attr_name =
355 (char *) gtk_entry_get_text((GtkEntry *)
356 glade_xml_get_widget(xml, "txtAttr"));
357 const char *def_val = gtk_entry_get_text((GtkEntry *)
358 glade_xml_get_widget(xml,
359 "txtDefValue"));
360 const char *value = gtk_entry_get_text((GtkEntry *)
361 glade_xml_get_widget(xml, "txtValue"));
362 prog =
363 gtk_toggle_button_get_active((GtkToggleButton *)
364 glade_xml_get_widget(xml,
365 "attrProg"));
366 g = view->g[view->activeGraph];
367 objKind = get_object_type();
368 attr = binarySearch(view->Topview->attributes, attr_name);
369 assert(attr);
370 attr->propagate = prog;
371 sym = agattr(g, objKind, attr_name, NULL);
372 if (!sym) /*it shouldnt be null, just in case it is null */
373 sym = agattr(g, objKind, attr_name, def_val);
374 /*graph */
375 if (objKind == AGRAPH)
376 agset(g, attr_name, value);
377 /*nodes */
378 else if (objKind == AGNODE) {
379 for (v = agfstnode(g); v; v = agnxtnode(g, v)) {
380 if (ND_selected(v))
381 agxset(v, sym, value);
382 }
383 }
384 /*edges */
385 else if (objKind == AGEDGE) {
386 for (v = agfstnode(g); v; v = agnxtnode(g, v)) {
387 for (e = agfstout(g, v); e; e = agnxtout(g, e)) {
388 if (ED_selected(e))
389 agxset(e, sym, value);
390 }
391 }
392 } else
393 fprintf(stderr,
394 "on_attrApplyBtn_clicked: unknown object kind %d\n",
395 objKind);
396}
397
398_BB void on_attrApplyBtn_clicked(GtkWidget *widget, void *user_data) {
399 (void)widget;
400 (void)user_data;
401
402 doApply();
403}
404
405_BB void on_attrRB0_clicked(GtkWidget *widget, void *user_data) {
406 (void)widget;
407 (void)user_data;
408
409 filter_attributes(gtk_entry_get_text((GtkEntry*)glade_xml_get_widget(xml,
410 "txtAttr")), view->Topview);
411
412}
413
414/* This is the action attached to the publish button on the attributes
415 * window. What should happen?
416 */
417_BB void on_attrProg_toggled(GtkWidget *widget, void *user_data) {
418 (void)widget;
419 (void)user_data;
420 /* FIX */
421}
422
423_BB void on_attrAddBtn_clicked(GtkWidget *widget, void *user_data) {
424 (void)widget;
425 (void)user_data;
426
427 char *attr_name;
428 int objKind;
429 topview *t;
430 Agraph_t *g;
431 attr_t *attr;
432 objKind = get_object_type();
433
434 /*values to be applied to selected objects */
435 attr_name =
436 (char *) gtk_entry_get_text((GtkEntry *)
437 glade_xml_get_widget(xml, "txtAttr"));
438 const char *defValue = gtk_entry_get_text((GtkEntry *)
439 glade_xml_get_widget(xml,
440 "txtDefValue"));
441 g = view->g[view->activeGraph];
442 t = view->Topview;
443 /*try to find first */
444 attr = binarySearch(t->attributes, attr_name);
445 if (!attr) {
446 attr = new_attr();
447 attr->index = 0;
448 attr->name = safestrdup(attr_name);
449 attr->type = attr_alpha;
450 attr->value = gv_strdup("");
451 attr->widget = NULL;
452 attr_list_add(t->attributes, attr);
453 }
454 attr->propagate = 0;
455
456 if (objKind == AGRAPH) {
457 agattr(g, AGRAPH, attr_name, defValue);
458 attr->defValG = safestrdup(defValue);
459 attr->objType[0] = 1;
460 }
461
462 /*nodes */
463 else if (objKind == AGNODE) {
464 agattr(g, AGNODE, attr_name, defValue);
465 attr->defValN = safestrdup(defValue);
466 attr->objType[1] = 1;
467 } else if (objKind == AGEDGE) {
468 agattr(g, AGEDGE, attr_name, defValue);
469 attr->defValE = safestrdup(defValue);
470 attr->objType[2] = 1;
471 } else
472 fprintf(stderr, "on_attrAddBtn_clicked: unknown object kind %d\n",
473 objKind);
474 filter_attributes(attr_name, view->Topview);
475}
476
478{
479 attr_t *attr;
480 attr_list *l;
481 FILE *file;
482 char buffer[BUFSIZ];
483 static char *smyrna_attrs;
484 char *a;
485
486 if (!smyrna_attrs)
487 smyrna_attrs = smyrnaPath("attrs.txt");
488 g = view->g[view->activeGraph];
489 l = attr_list_new(true);
490 file = fopen(smyrna_attrs, "r");
491 if (file != NULL) {
492 for (size_t i = 0; fgets(buffer, sizeof(buffer), file) != NULL; ++i) {
493 attr = new_attr();
494 a = strtok(buffer, ",");
495 attr->index = i;
496 attr->type = get_attr_data_type(a[0]);
497 for (int idx = 0; (a = strtok(NULL, ",")); ++idx) {
498 /*C,(0)color, (1)black, (2)EDGE Or NODE Or CLUSTER, (3)ALL_ENGINES */
499
500 switch (idx) {
501 case 0:
502 attr->name = gv_strdup(a);
503 break;
504 case 1:
505 attr->defValG = gv_strdup(a);
506 attr->defValN = gv_strdup(a);
507 attr->defValE = gv_strdup(a);
508 break;
509 case 2:
511 break;
512 default:
513 break;
514 }
515 }
516 attr_list_add(l, attr);
517
518 }
519 fclose(file);
520 }
521 for (Agsym_t *sym = NULL; (sym = agnxtattr(g, AGRAPH, sym)); ) {
522 attr = binarySearch(l, sym->name);
523 if (attr)
524 attr->objType[0] = 1;
525 else {
526 attr = new_attr_with_ref(sym);
527 attr_list_add(l, attr);
528 }
529 }
530 for (Agsym_t *sym = NULL; (sym = agnxtattr(g, AGNODE, sym)); ) {
531 attr = binarySearch(l, sym->name);
532 if (attr) {
533 attr->objType[1] = 1;
534
535 } else {
536 attr = new_attr_with_ref(sym);
537 attr_list_add(l, attr);
538 }
539
540 }
541 for (Agsym_t *sym = NULL; (sym = agnxtattr(g, AGEDGE, sym)); ) {
542 attr = binarySearch(l, sym->name);
543 if (attr)
544 attr->objType[2] = 1;
545 else {
546 attr = new_attr_with_ref(sym);
547 attr_list_add(l, attr);
548 }
549 }
550 return l;
551}
552
553static void set_header_text(void)
554{
555 int nodeCnt = 0;
556 int edgeCnt = 0;
557 char buf[512];
558 Agedge_t* ep;
559 Agnode_t* v;
560 Agraph_t* g;
561
562 g = view->g[view->activeGraph];
563 for (v = agfstnode(g); v; v = agnxtnode(g, v)) {
564 if (ND_selected(v))
565 nodeCnt++;
566 for (ep = agfstout(g, v); ep; ep = agnxtout(g, ep)) {
567 if (ND_selected(v))
568 edgeCnt++;
569 }
570 }
571 sel_node = nodeCnt;
572 sel_edge = edgeCnt;
573 sel_graph = 1;
574
575 snprintf(buf, sizeof(buf), "%d Nodes and %d edges selected", nodeCnt,
576 edgeCnt);
577 gtk_label_set_text((GtkLabel *) glade_xml_get_widget(xml, "label124"),
578 buf);
579 gtk_entry_set_text((GtkEntry *) glade_xml_get_widget(xml, "txtAttr"),
580 "");
581 Color_Widget_bg("white", glade_xml_get_widget(xml, "fixed6"));
582}
583
584void showAttrsWidget(void) {
585 gtk_widget_hide(glade_xml_get_widget(xml, "dlgSettings"));
586 gtk_widget_show(glade_xml_get_widget(xml, "dlgSettings"));
587 gtk_notebook_set_current_page((GtkNotebook *)
588 glade_xml_get_widget(xml, "notebook3"),
592}
593
594static void gvpr_select(const char *attrname, const char *regex_str,
595 int objType) {
596
597 char *bf2;
598 int i, argc;
599
600 agxbuf sf = {0};
601
602 if (objType == AGNODE)
603 agxbprint(&sf, "N[%s==\"%s\"]{selected = \"1\"}", attrname, regex_str);
604 else if (objType == AGEDGE)
605 agxbprint(&sf, "E[%s==\"%s\"]{selected = \"1\"}", attrname, regex_str);
606
607 bf2 = agxbdisown(&sf);
608
609 argc = 1;
610 if (*bf2 != '\0')
611 argc++;
612 char *argv[3] = {0};
613 size_t j = 0;
614 argv[j++] = "smyrna";
615 argv[j++] = bf2;
616
617 run_gvpr(view->g[view->activeGraph], j, argv);
618 for (i = 1; i < argc; i++)
619 free(argv[i]);
621}
622
623_BB void on_attrSearchBtn_clicked(GtkWidget *widget, void *user_data) {
624 (void)widget;
625 (void)user_data;
626
627 const char *attrname = gtk_entry_get_text((GtkEntry *)
628 glade_xml_get_widget(xml, "txtAttr"));
629 const char *regex_str = gtk_entry_get_text((GtkEntry *)
630 glade_xml_get_widget(xml, "txtValue"));
631 gvpr_select(attrname, regex_str, get_object_type());
632
633}
static int agxbprint(agxbuf *xb, const char *fmt,...)
Printf-style output to an agxbuf.
Definition agxbuf.h:234
static char * agxbdisown(agxbuf *xb)
Definition agxbuf.h:327
Memory allocation wrappers that exit on failure.
static char * gv_strdup(const char *original)
Definition alloc.h:101
static void * gv_alloc(size_t size)
Definition alloc.h:47
#define _BB
Definition callbacks.h:20
static void set_attr_object_type(const char *str, int *t)
static void object_type_helper(strview_t a, int *t)
static char * safestrdup(const char *src)
Definition frmobjectui.c:36
static attr_list * attr_list_new(bool with_widgets)
_BB void on_attrApplyBtn_clicked(GtkWidget *widget, void *user_data)
static int attr_compare(const attr_t **a, const attr_t **b)
static attr_t * binarySearch(attr_list *l, const char *searchKey)
static void create_filtered_list(const char *prefix, attr_list *sl, attr_list *tl)
static void attr_list_add(attr_list *l, attr_t *a)
static int cmp(const void *key, const void *candidate)
static attr_t * new_attr_with_ref(Agsym_t *sym)
Definition frmobjectui.c:60
static attr_t * new_attr(void)
Definition frmobjectui.c:56
_BB void on_attrSearchBtn_clicked(GtkWidget *widget, void *user_data)
static attr_t * new_attr_ref(attr_t *refAttr)
Definition frmobjectui.c:83
static void reset_attr_list_widgets(attr_list *l)
Definition frmobjectui.c:95
_BB void on_attrProg_toggled(GtkWidget *widget, void *user_data)
void showAttrsWidget(void)
static void doApply(void)
static void set_header_text(void)
static attr_data_type get_attr_data_type(char c)
static void gvpr_select(const char *attrname, const char *regex_str, int objType)
static int attr_compare_core(const void *key, const void *candidate)
static int sel_node
Definition frmobjectui.c:32
static int get_object_type(void)
Definition frmobjectui.c:42
static int sel_edge
Definition frmobjectui.c:33
_BB void on_txtAttr_changed(GtkWidget *widget, void *user_data)
static void filter_attributes(const char *prefix, topview *t)
static int sel_graph
Definition frmobjectui.c:34
_BB void on_attrAddBtn_clicked(GtkWidget *widget, void *user_data)
_BB void on_attrRB0_clicked(GtkWidget *widget, void *user_data)
attr_list * load_attr_list(Agraph_t *g)
#define ATTR_NOTEBOOK_IDX
Definition frmobjectui.h:15
void free(void *)
require define api prefix
Definition gmlparse.y:17
node NULL
Definition grammar.y:163
Agsym_t * agattr(Agraph_t *g, int kind, char *name, const char *value)
creates or looks up attributes of a graph
Definition attr.c:338
int agset(void *obj, char *name, const char *value)
Definition attr.c:466
Agsym_t * agnxtattr(Agraph_t *g, int kind, Agsym_t *attr)
permits traversing the list of attributes of a given type
Definition attr.c:353
int agxset(void *obj, Agsym_t *sym, const char *value)
Definition attr.c:478
Agedge_t * agfstout(Agraph_t *g, Agnode_t *n)
Definition edge.c:24
Agedge_t * agnxtout(Agraph_t *g, Agedge_t *e)
Definition edge.c:39
Agnode_t * agnxtnode(Agraph_t *g, Agnode_t *n)
Definition node.c:47
Agnode_t * agfstnode(Agraph_t *g)
Definition node.c:40
@ AGEDGE
Definition cgraph.h:207
@ AGNODE
Definition cgraph.h:207
@ AGRAPH
Definition cgraph.h:207
void Color_Widget_bg(char *colorstring, GtkWidget *widget)
Definition gui.c:24
GladeXML * xml
Definition gui.c:22
static uint64_t id
Definition gv2gml.c:42
int run_gvpr(Agraph_t *srcGraph, size_t argc, char *argv[])
Definition gvprpipe.c:41
textitem scanner parser str
Definition htmlparse.y:224
char * smyrnaPath(char *suffix)
Definition main.c:68
ViewInfo * view
Definition viewport.c:37
attr_data_type
Definition smyrnadefs.h:60
@ attr_alpha
Definition smyrnadefs.h:60
@ attr_int
Definition smyrnadefs.h:60
@ attr_float
Definition smyrnadefs.h:60
@ attr_bool
Definition smyrnadefs.h:60
#define MAX_FILTERED_ATTR_COUNT
Definition smyrnadefs.h:58
#define ED_selected(e)
Definition smyrnadefs.h:175
#define ND_selected(n)
Definition smyrnadefs.h:162
static bool startswith(const char *s, const char *prefix)
does the string s begin with the string prefix?
Definition startswith.h:11
platform abstraction for case-insensitive string functions
graph or subgraph
Definition cgraph.h:425
string attribute descriptor symbol in Agattr_s.dict
Definition cgraph.h:637
char * name
Definition cgraph.h:639
unsigned char kind
Definition cgraph.h:642
char * defval
Definition cgraph.h:640
topview * Topview
Definition smyrnadefs.h:313
Agraph_t ** g
Definition smyrnadefs.h:296
int activeGraph
Definition smyrnadefs.h:300
GtkLabel * fLabels[MAX_FILTERED_ATTR_COUNT]
Definition smyrnadefs.h:81
attrs_t attributes
Definition smyrnadefs.h:80
char * defValN
Definition smyrnadefs.h:68
char * name
Definition smyrnadefs.h:65
int propagate
Definition smyrnadefs.h:73
size_t index
Definition smyrnadefs.h:64
GtkWidget * widget
Definition smyrnadefs.h:72
char * defValG
Definition smyrnadefs.h:67
char * value
Definition smyrnadefs.h:66
attr_data_type type
Definition smyrnadefs.h:70
int objType[3]
Definition smyrnadefs.h:71
char * defValE
Definition smyrnadefs.h:69
a non-owning string reference
Definition strview.h:20
const char * data
start of the pointed to string
Definition strview.h:21
size_t size
extent of the string in bytes
Definition strview.h:22
attr_list * attributes
Definition smyrnadefs.h:239
Non-owning string references.
static bool strview_str_eq(strview_t a, const char *b)
compare a string reference to a string for equality
Definition strview.h:98
static strview_t strview(const char *referent, char terminator)
create a string reference
Definition strview.h:26
#define UNREACHABLE()
Definition unreachable.h:30