Graphviz 13.0.0~dev.20241220.2304
Loading...
Searching...
No Matches
tvnodes.c File Reference
#include <assert.h>
#include "tvnodes.h"
#include "viewport.h"
#include "topviewfuncs.h"
#include <cgraph/tokenize.h>
#include <stdbool.h>
#include <string.h>
#include <util/alloc.h>
#include <util/strview.h>
Include dependency graph for tvnodes.c:

Go to the source code of this file.

Data Structures

struct  gridCol
 
struct  grid_t
 

Functions

static void induceEdges (Agraph_t *g, Agraph_t *sg)
 
static int create_save_subgraph_from_filter (char *filename, int withEdges)
 
static void set_visibility (Agraph_t *g, int visibility)
 
int tv_show_all (void)
 
int tv_hide_all (void)
 
int tv_save_as (int withEdges)
 
static void create_text_column (char *Title, GtkTreeView *tree, int asso, bool editable)
 
static void create_toggle_column (char *Title, GtkTreeView *tree, int asso, bool editable)
 
static void populate_data (Agraph_t *g, grid_t *grid)
 
static GtkTreeStore * update_tree_store (GtkTreeStore *store, int ncolumns, GType *types)
 
static void create_column (gridCol *c, GtkTreeView *tree, int id)
 
static GtkTreeView * update_tree (GtkTreeView *tree, grid_t *g)
 
static void add_column (grid_t *g, strview_t name, bool editable, GType g_type)
 
static void clearGrid (grid_t *g)
 
static grid_tinitGrid (void)
 
static grid_tupdate_columns (grid_t *g, char *str)
 
void setup_tree (Agraph_t *g)
 

Variables

static char * ID = "ID"
 
static char * Name = "Name"
 
static char * Visible = "Visible"
 

Function Documentation

◆ add_column()

static void add_column ( grid_t g,
strview_t  name,
bool  editable,
GType  g_type 
)
static

Definition at line 306 of file tvnodes.c.

References grid_t::columns, grid_t::count, gridCol::editable, gv_recalloc(), gridCol::name, strview_str(), strview_str_eq(), and gridCol::type.

Referenced by update_columns().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ clearGrid()

static void clearGrid ( grid_t g)
static

Definition at line 318 of file tvnodes.c.

References grid_t::buf, grid_t::columns, grid_t::count, grid_t::flds, free(), id, and gridCol::name.

Referenced by gAdjust(), and update_columns().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_column()

static void create_column ( gridCol c,
GtkTreeView *  tree,
int  id 
)
static

Definition at line 255 of file tvnodes.c.

References create_text_column(), create_toggle_column(), gridCol::editable, gridCol::name, NULL, tree, and gridCol::type.

Referenced by update_tree().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_save_subgraph_from_filter()

static int create_save_subgraph_from_filter ( char *  filename,
int  withEdges 
)
static

Definition at line 58 of file tvnodes.c.

References _ViewInfo::activeGraph, agdelsubg(), agfstnode(), agnxtnode(), agsubg(), agsubnode(), agwrite(), _ViewInfo::g, induceEdges(), ND_selected, and view.

Referenced by tv_save_as().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_text_column()

static void create_text_column ( char *  Title,
GtkTreeView *  tree,
int  asso,
bool  editable 
)
static

Definition at line 148 of file tvnodes.c.

References NULL, and tree.

Referenced by create_column().

Here is the caller graph for this function:

◆ create_toggle_column()

static void create_toggle_column ( char *  Title,
GtkTreeView *  tree,
int  asso,
bool  editable 
)
static

Definition at line 175 of file tvnodes.c.

References NULL, and tree.

Referenced by create_column().

Here is the caller graph for this function:

◆ induceEdges()

static void induceEdges ( Agraph_t g,
Agraph_t sg 
)
static

Definition at line 41 of file tvnodes.c.

References agfstnode(), agfstout(), aghead, agnxtnode(), agnxtout(), agsubedge(), and agsubnode().

Referenced by create_save_subgraph_from_filter().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ initGrid()

static grid_t * initGrid ( void  )
static

Definition at line 330 of file tvnodes.c.

References grid_t::buf, grid_t::columns, grid_t::count, gv_alloc(), and NULL.

Referenced by update_columns().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ populate_data()

static void populate_data ( Agraph_t g,
grid_t grid 
)
static

Definition at line 193 of file tvnodes.c.

References agfstnode(), agget(), agnameof(), agnxtnode(), grid, ID, id, gridCol::name, Name, ND_selected, NULL, gridCol::type, and Visible.

Referenced by setup_tree().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_visibility()

static void set_visibility ( Agraph_t g,
int  visibility 
)
static

Definition at line 86 of file tvnodes.c.

References agattr(), agfstnode(), AGNODE, agnxtnode(), agxset(), GN_selected, GN_visible, ND_selected, and visibility().

Referenced by tv_hide_all(), and tv_show_all().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setup_tree()

void setup_tree ( Agraph_t g)

Definition at line 358 of file tvnodes.c.

References agget(), populate_data(), tree, update_columns(), and update_tree().

Referenced by mNodeListSlot().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tv_hide_all()

int tv_hide_all ( void  )

Definition at line 114 of file tvnodes.c.

References _ViewInfo::activeGraph, _ViewInfo::g, set_visibility(), _ViewInfo::Topview, updateSmGraph(), and view.

Referenced by btnTVHideAll_clicked_cb().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tv_save_as()

int tv_save_as ( int  withEdges)

Definition at line 122 of file tvnodes.c.

References create_save_subgraph_from_filter(), and NULL.

Referenced by btnTVSaveAs_clicked_cb(), and btnTVSaveWith_clicked_cb().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tv_show_all()

int tv_show_all ( void  )

Definition at line 107 of file tvnodes.c.

References _ViewInfo::activeGraph, _ViewInfo::g, set_visibility(), _ViewInfo::Topview, updateSmGraph(), and view.

Referenced by btnTVShowAll_clicked_cb().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_columns()

static grid_t * update_columns ( grid_t g,
char *  str 
)
static

Definition at line 338 of file tvnodes.c.

References add_column(), clearGrid(), grid_t::flds, initGrid(), Name, str, strview(), tok(), tok_end(), tok_get(), and tok_next().

Referenced by setup_tree().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_tree()

static GtkTreeView * update_tree ( GtkTreeView *  tree,
grid_t g 
)
static

Definition at line 271 of file tvnodes.c.

References grid_t::columns, grid_t::count, create_column(), free(), gv_calloc(), NULL, grid_t::store, store(), tree, gridCol::type, update_tree_store(), and xml.

Referenced by setup_tree().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_tree_store()

static GtkTreeStore * update_tree_store ( GtkTreeStore *  store,
int  ncolumns,
GType *  types 
)
static

Definition at line 240 of file tvnodes.c.

References NULL, and store().

Referenced by update_tree().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ ID

char* ID = "ID"
static

Definition at line 34 of file tvnodes.c.

Referenced by populate_data().

◆ Name

char* Name = "Name"
static

Definition at line 35 of file tvnodes.c.

Referenced by populate_data(), and update_columns().

◆ Visible

char* Visible = "Visible"
static

Definition at line 36 of file tvnodes.c.

Referenced by populate_data().