Graphviz 13.0.0~dev.20241212.1010
|
Modules | |
records | |
These records are attached by client programs dynamically at runtime. | |
Files | |
file | attr.c |
implementation of dynamic attributes | |
Data Structures | |
struct | Agattr_s |
string attribute container More... | |
struct | Agsym_s |
string attribute descriptor symbol in Agattr_s.dict More... | |
struct | Agdatadict_s |
Functions | |
Agdatadict_t * | agdatadict (Agraph_t *g, bool cflag) |
Agattr_t * | agattrrec (void *obj) |
void | agraphattr_init (Agraph_t *g) |
int | agraphattr_delete (Agraph_t *g) |
void | agnodeattr_init (Agraph_t *g, Agnode_t *n) |
void | agnodeattr_delete (Agnode_t *n) |
void | agedgeattr_init (Agraph_t *g, Agedge_t *e) |
void | agedgeattr_delete (Agedge_t *e) |
Agsym_t * | agattr (Agraph_t *g, int kind, char *name, const char *value) |
creates or looks up attributes of a graph | |
Agsym_t * | agattrsym (void *obj, char *name) |
looks up a string attribute for a graph object given as an argument | |
Agsym_t * | agnxtattr (Agraph_t *g, int kind, Agsym_t *attr) |
permits traversing the list of attributes of a given type | |
int | agcopyattr (void *oldobj, void *newobj) |
copies all of the attributes from one object to another | |
char * | agget (void *obj, char *name) |
char * | agxget (void *obj, Agsym_t *sym) |
int | agset (void *obj, char *name, const char *value) |
int | agxset (void *obj, Agsym_t *sym, const char *value) |
int | agsafeset (void *obj, char *name, const char *value, const char *def) |
ensures the given attribute is declared before setting it locally on an object | |
Programmer-defined values may be dynamically attached to graphs, subgraphs, nodes, and edges. Such values are either character string data (see agattr) (for I/O) or uninterpreted binary records (for implementing algorithms efficiently).
String attributes are handled automatically in reading and writing graph files. A string attribute is identified by name and by an internal symbol table entry (Agsym_t) created by Libcgraph. Attributes of nodes, edges, and graphs (with their subgraphs) have separate namespaces. The contents of an Agsym_t have a char* name for the attribute's name, a char* defval field for the attribute's default value, and an int id field containing the index of the attribute's specific value for an object in the object's array of attribute values.
g | graph. When is NULL, the default is set for all graphs created subsequently. |
kind | may be AGRAPH, AGNODE, or AGEDGE. |
value | default value. When is (char*)0, the request is to search for an existing attribute of the given kind and name. |
If the attribute already exists, its default for creating new objects is set to the given value; if it does not exist, a new attribute is created with the given default value, and the default is applied to all pre-existing objects of the given kind
Definition at line 341 of file attr.c.
References agopen(), getattr(), ProtoDesc, ProtoGraph, and setattr().
Referenced by addRevEdge(), agedgeattr(), agnodeattr(), agraphattr(), agsafeset(), attach_edge_colors(), attached_clustering(), attrstmt(), attrstmt(), bindattrs(), bindattrs(), bindedgeattr(), cloneDfltAttrs(), cloneGraph(), cloneGraph(), clust_in_layer(), color(), constrainY(), copy_attr(), copyAttr(), copyAttr(), deselect_all(), doApply(), dot_sameports(), Dot_SetClusterColor(), dotneato_args_initialize(), emit_graph(), export_dot(), fdp_init_graph(), fdp_init_node_edge(), fdp_initParams(), get_checkbox_widget_to_attribute(), get_color_button_widget_to_attribute(), get_combobox_widget_to_attribute(), get_scalebtn_widget_to_attribute(), get_spinbtn_widget_to_attribute(), get_text_widget_to_attribute(), getAttrBool(), getAttrFloat(), getAttrInt(), getAttrStr(), getDfltAttr(), getv(), getv(), getval(), global_def(), graph_init(), graphRecord(), gvContext(), gvContextPlugins(), gvplugin_graph(), Import_coord_clusters_from_dot(), Import_dot_splines(), init_info(), init_nop(), initGraphAttrs(), initialPositions(), layout(), loadGraph(), lookup(), makeDotGraph(), makeGraphData(), mkport(), mkport(), neatoModel(), nxtAttr(), on_attrAddBtn_clicked(), patchwork_init_graph(), plot_dot_map(), posOf(), post(), pre(), safe_dcl(), scan_graph_mode(), select_edge(), select_node(), set_visibility(), setattr(), setAttr(), setDfltAttr(), setedgeattributes(), setgraphattributes(), setnodeattributes(), setState(), setv(), setv(), SparseMatrix_import_dot(), twopi_layout(), update_graph_params(), updateRecord(), write_hdr(), and writeHdr().
Agattr_t * agattrrec | ( | void * | obj | ) |
Definition at line 229 of file attr.c.
References AgDataRecName, and aggetrec().
Referenced by addattr(), agattrsym(), agedgeattr_delete(), agedgeattr_init(), agget(), agnodeattr_delete(), agnodeattr_init(), agraphattr_delete(), agxget(), agxset(), irrelevant_subgraph(), not_default_attrs(), write_nondefault_attrs(), and writeNondefaultAttr().
Agsym_t * agattrsym | ( | void * | obj, |
char * | name | ||
) |
Definition at line 156 of file attr.c.
References agattrrec(), agdictsym(), and NULL.
Referenced by agcopyattr(), agget(), agset(), copyAttr(), getval(), lookup(), post(), and setattr().
int agcopyattr | ( | void * | oldobj, |
void * | newobj | ||
) |
Definition at line 552 of file attr.c.
References agattrsym(), aghtmlstr(), agmarkhtmlstr(), agnxtattr(), agraphof(), AGTYPE, agxget(), agxset(), and Agsym_s::name.
Referenced by addRevEdge(), cloneEdge(), cloneEdge(), cloneNode(), and projectG().
Agdatadict_t * agdatadict | ( | Agraph_t * | g, |
bool | cflag | ||
) |
Definition at line 48 of file attr.c.
References aggetrec(), DataDictName, and init_all_attrs().
Referenced by agdictof(), agmakedatadict(), agraphattr_delete(), agxset(), irrelevant_subgraph(), setattr(), unviewsubgraphsattr(), write_body(), write_dicts(), writeBody(), and writeDicts().
void agedgeattr_delete | ( | Agedge_t * | e | ) |
Definition at line 432 of file attr.c.
References agattrrec(), AgDataRecName, agdelrec(), and freeattr().
Referenced by agdeledge().
Definition at line 423 of file attr.c.
References agattrrec(), and agmakeattrs().
Referenced by init_all_attrs(), and newedge().
char * agget | ( | void * | obj, |
char * | name | ||
) |
Definition at line 442 of file attr.c.
References agattrrec(), agattrsym(), Agsym_s::id, and NULL.
Referenced by adjustNodes(), agwrite(), angleSet(), attach_attrs_and_arrows(), bind_shape(), changetopfishfocus(), checkClusterStyle(), chkBoundBox(), chkOrder(), circularLayout(), color(), common_init_edge(), compile_samerank(), copy_attr(), do_graph_label(), dot2_rank(), dot_mincross(), dot_rank(), dotLayout(), edgeAttrs(), emit_background(), emit_begin_edge(), emit_begin_node(), emit_cluster_colors(), emit_clusters(), emit_colors(), emit_edge_graphics(), emit_html_label(), emit_page(), epsf_init(), esepFactor(), fdp_xLayout(), gdgen_begin_page(), genRound(), get_attribute_value(), getdouble(), getdoubles2ptf(), getEdgeHead(), getEdgeTail(), getObjId(), getPack(), getPackModeInfo(), getPenColor(), graph_init(), graphAdjustMode(), graphAttrs(), gvLayoutJobs(), Import_coord_clusters_from_dot(), init_gvc(), init_job_viewport(), init_layering(), init_nop(), init_xdot(), initGraphAttrs(), initObjMapData(), is_a_cluster(), is_a_strong_cluster(), iterateBody(), iterateHdr(), labelOf(), load_settings_from_graph(), majorization(), makeCompoundEdge(), makeGraphData(), mincross_options(), neato_layout(), neatoLayout(), neatoMode(), neatoModel(), nsiter2(), object_color(), orthoEdges(), parse_layers(), parseXdotwithattrs(), poly_gencode(), poly_init(), populate_data(), prepare_topological_fisheye(), printHref(), putGraphs(), rank(), rank1(), rank_set_class(), rankset_kind(), scan_graph_mode(), sepFactor(), set_checkbox_widget(), set_color_button_widget(), set_combobox_widget(), set_label(), set_scalebtn_widget_to_attribute(), set_spinbtn_widget(), set_text_widget(), setAspect(), setEdgeType(), setRatio(), setSeed(), setup_tree(), simpleScale(), size_reclbl(), svg_begin_job(), svg_print_id_class(), TB_balance(), tuneControl(), twopi_layout(), update_graph_from_settings(), write_plain(), writeEdge(), writePort(), and xdot_begin_graph().
void agnodeattr_delete | ( | Agnode_t * | n | ) |
Definition at line 413 of file attr.c.
References agattrrec(), AgDataRecName, agdelrec(), and freeattr().
Referenced by agdelnode().
Definition at line 404 of file attr.c.
References agattrrec(), and agmakeattrs().
Referenced by init_all_attrs(), and initnode().
attr | if NULL the function returns the first attribute |
NULL
at the end of the list. Definition at line 356 of file attr.c.
References agdictof(), dtfirst, and dtnext.
Referenced by agcopyattr(), cloneAttrs(), cloneDfltAttrs(), cloneGraph(), copyAttr(), emitEdgeAttrs(), emitGraphAttrs(), emitNodeAttrs(), fillDict(), firstattr(), firstattr(), firstattr(), listEdgeAttrs(), listGraphAttrs(), listNodeAttrs(), load_attr_list(), load_settings_from_graph(), mapN(), nextattr(), nextattr(), nextattr(), nxtAttr(), update_graph_from_settings(), and write_attrs().
int agraphattr_delete | ( | Agraph_t * | g | ) |
Definition at line 384 of file attr.c.
References Ag_G_global, agattrrec(), agdatadict(), agdelrec(), agdtclose(), Agdatadict_s::dict, Agdatadict_s::e, freeattr(), Agdatadict_s::g, Agattr_s::h, Agdatadict_s::h, Agdatadict_s::n, and Agrec_s::name.
Referenced by agclose().
void agraphattr_init | ( | Agraph_t * | g | ) |
Definition at line 373 of file attr.c.
References agmakeattrs(), agmakedatadict(), agparent(), Agraph_s::desc, and Agdesc_s::has_attrs.
Referenced by agopen1(), and agraphattr_init_wrapper().
int agsafeset | ( | void * | obj, |
char * | name, | ||
const char * | value, | ||
const char * | def | ||
) |
Definition at line 510 of file attr.c.
References agattr(), agraphof(), AGTYPE, and agxset().
Referenced by addEdgeGraphics(), addEdgeGraphics(), addEdgeLabelGraphics(), addEdgeLabelGraphics(), addEdgePos(), addEdgePos(), addNodeGraphics(), addNodeGraphics(), addNodeLabelGraphics(), addNodeLabelGraphics(), addRevEdge(), gvLayout(), main(), main(), unknown(), unknown(), and xdot_end_graph().
int agset | ( | void * | obj, |
char * | name, | ||
const char * | value | ||
) |
Definition at line 469 of file attr.c.
References agattrsym(), agxset(), FAILURE, and NULL.
Referenced by attach_attrs_and_arrows(), cloneAttrs(), cloneNode(), color(), doApply(), make_flat_adj_edges(), patchwork_init_node(), setSeed(), and twopi_layout().
char * agxget | ( | void * | obj, |
Agsym_t * | sym | ||
) |
Definition at line 458 of file attr.c.
References agattrrec(), Agsym_s::id, and topdictsize().
Referenced by addRevEdge(), agcopyattr(), arrow_flags(), attached_clustering(), chkBB(), chkPos(), cloneAttrs(), common_init_edge(), common_init_node(), copyAttr(), copyAttr(), dot_sameports(), edge_seg(), edge_spline(), edgecmd_internal(), emit_begin_edge(), emitEdgeAttrs(), emitGraphAttrs(), emitNodeAttrs(), findRootNode(), finishNode(), getlength(), getval(), graphcmd_internal(), graphviz_unflatten(), gv_edge_state(), gv_graph_state(), gv_node_state(), gvevent_enter_obj(), Import_coord_clusters_from_dot(), Import_dot_splines(), initialPositions(), is_nonconstraint(), l_float(), labelOf(), late_bool(), late_quadtree_scheme(), late_smooth(), late_string(), lenattr(), lookup(), makeMatrix(), mapN(), myagxget(), noClip(), nodecmd_internal(), nonconstraint_edge(), nop_init_graphs(), posOf(), post(), renderEdgeLabels(), renderNodeLabels(), renderNodes(), renderSelectedNodes(), set_boundaries(), SparseMatrix_import_dot(), stylenode(), taperfun(), unviewsubgraphsattr(), user_pos(), user_spline(), visible(), write_attrs(), write_plain(), and write_port().
int agxset | ( | void * | obj, |
Agsym_t * | sym, | ||
const char * | value | ||
) |
Definition at line 481 of file attr.c.
References agattrrec(), agdatadict(), aglocaldictsym(), agmethod_upd(), agnewsym(), AGRAPH, agraphof(), agstrdup(), agstrfree(), AGTYPE, Agsym_s::defval, Agdatadict_s::dict, dtinsert, Agdatadict_s::g, Agsym_s::id, Agsym_s::name, Agtag_s::objtype, SUCCESS, Agobj_s::tag, and topdictsize().
Referenced by addZ(), adjustlen(), agcopyattr(), agsafeset(), agset(), applyattrs(), applyattrs(), attach_attrs_and_arrows(), attach_edge_colors(), attach_phase_attrs(), attached_clustering(), cloneGraph(), cloneSubg(), constrainY(), copyAttr(), copyAttr(), deselect_all(), doApply(), Dot_SetClusterColor(), export_dot(), finishNode(), graphviz_unflatten(), gvplugin_graph(), Import_coord_clusters_from_dot(), make_flat_adj_edges(), makeDotGraph(), mapN(), mkport(), mkport(), myagxset(), myagxset(), post(), put_escaping_backslashes(), rec_attach_bb(), select_edge(), select_node(), set_visibility(), setattr(), setattr(), setAttr(), twopi_layout(), xdot_end_cluster(), xdot_end_edge(), xdot_end_graph(), and xdot_end_node().