Graphviz 12.0.1~dev.20240716.0800
Loading...
Searching...
No Matches
frmobjectui.c File Reference
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include "gui.h"
#include <glade/glade.h>
#include <gdk/gdkkeysyms.h>
#include <gdk/gdk.h>
#include "viewport.h"
#include "frmobjectui.h"
#include <assert.h>
#include "gvprpipe.h"
#include <cgraph/agxbuf.h>
#include <cgraph/alloc.h>
#include <cgraph/startswith.h>
#include <cgraph/strcasecmp.h>
#include <cgraph/strview.h>
#include <cgraph/unreachable.h>
#include <stdint.h>
#include <string.h>
Include dependency graph for frmobjectui.c:

Go to the source code of this file.

Functions

static char * safestrdup (const char *src)
 
static int get_object_type (void)
 
static attr_tnew_attr (void)
 
static attr_tnew_attr_with_ref (Agsym_t *sym)
 
static attr_tnew_attr_ref (attr_t *refAttr)
 
static void reset_attr_list_widgets (attr_list *l)
 
static attr_listattr_list_new (bool with_widgets)
 
static int attr_compare_core (const void *key, const void *candidate)
 
static int attr_compare (const attr_t **a, const attr_t **b)
 
static void attr_list_add (attr_list *l, attr_t *a)
 
static attr_data_type get_attr_data_type (char c)
 
static void object_type_helper (strview_t a, int *t)
 
static void set_attr_object_type (const char *str, int *t)
 
static attr_tbinarySearch (attr_list *l, const char *searchKey)
 
static attr_tpBinarySearch (attr_list *l, const char *searchKey)
 
static void create_filtered_list (const char *prefix, attr_list *sl, attr_list *tl)
 
static void filter_attributes (const char *prefix, topview *t)
 
_BB void on_txtAttr_changed (GtkWidget *widget, gpointer user_data)
 
static void set_refresh_filters (ViewInfo *v, char *name)
 
static void doApply (void)
 
_BB void on_attrApplyBtn_clicked (GtkWidget *widget, gpointer user_data)
 
_BB void on_attrRB0_clicked (GtkWidget *widget, gpointer user_data)
 
_BB void on_attrProg_toggled (GtkWidget *widget, gpointer user_data)
 
_BB void on_attrAddBtn_clicked (GtkWidget *widget, gpointer user_data)
 
attr_listload_attr_list (Agraph_t *g)
 
static void set_header_text (void)
 
void showAttrsWidget (void)
 
static void gvpr_select (const char *attrname, const char *regex_str, int objType)
 
_BB void on_attrSearchBtn_clicked (GtkWidget *widget, gpointer user_data)
 

Variables

static int sel_node
 
static int sel_edge
 
static int sel_graph
 

Function Documentation

◆ attr_compare()

static int attr_compare ( const attr_t **  a,
const attr_t **  b 
)
static

Definition at line 139 of file frmobjectui.c.

References attr_compare_core().

Referenced by attr_list_add().

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

◆ attr_compare_core()

static int attr_compare_core ( const void *  key,
const void *  candidate 
)
static

Definition at line 133 of file frmobjectui.c.

References key.

Referenced by attr_compare(), and binarySearch().

Here is the caller graph for this function:

◆ attr_list_add()

static void attr_list_add ( attr_list l,
attr_t a 
)
static

Definition at line 143 of file frmobjectui.c.

References attr_compare(), attr_list::attributes, and id.

Referenced by create_filtered_list(), load_attr_list(), and on_attrAddBtn_clicked().

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

◆ attr_list_new()

static attr_list * attr_list_new ( bool  with_widgets)
static

Definition at line 107 of file frmobjectui.c.

References Color_Widget_bg(), attr_list::fLabels, gv_alloc(), id, MAX_FILTERED_ATTR_COUNT, attr_list::with_widgets, and xml.

Referenced by filter_attributes(), and load_attr_list().

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

◆ binarySearch()

static attr_t * binarySearch ( attr_list l,
const char *  searchKey 
)
static

Definition at line 209 of file frmobjectui.c.

References attr_compare_core(), attr_list::attributes, and NULL.

Referenced by doApply(), load_attr_list(), and on_attrAddBtn_clicked().

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

◆ create_filtered_list()

static void create_filtered_list ( const char *  prefix,
attr_list sl,
attr_list tl 
)
static

Definition at line 238 of file frmobjectui.c.

References attr_list_add(), attr_list::attributes, get_object_type(), attr_t::index, attr_t::name, new_attr_ref(), attr_t::objType, pBinarySearch(), and prefix.

Referenced by filter_attributes().

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

◆ doApply()

static void doApply ( void  )
static

Definition at line 369 of file frmobjectui.c.

References _ViewInfo::activeGraph, agattr(), AGEDGE, agfstnode(), agfstout(), AGNODE, agnxtnode(), agnxtout(), AGRAPH, agset(), agxset(), topview::attributes, binarySearch(), ED_selected, _ViewInfo::g, get_object_type(), ND_selected, NULL, attr_t::propagate, set_refresh_filters(), _ViewInfo::Topview, view, and xml.

Referenced by on_attrApplyBtn_clicked().

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

◆ filter_attributes()

static void filter_attributes ( const char *  prefix,
topview t 
)
static

Definition at line 266 of file frmobjectui.c.

References AGEDGE, AGNODE, AGRAPH, attr_list_new(), attr_list::attributes, topview::attributes, Color_Widget_bg(), create_filtered_list(), attr_list::fLabels, get_object_type(), prefix, reset_attr_list_widgets(), sel_edge, sel_graph, sel_node, and xml.

Referenced by on_attrAddBtn_clicked(), on_attrRB0_clicked(), on_txtAttr_changed(), and showAttrsWidget().

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

◆ get_attr_data_type()

static attr_data_type get_attr_data_type ( char  c)
static

Definition at line 153 of file frmobjectui.c.

References attr_alpha, attr_bool, attr_float, and attr_int.

Referenced by load_attr_list().

Here is the caller graph for this function:

◆ get_object_type()

static int get_object_type ( void  )
static

Definition at line 42 of file frmobjectui.c.

References AGEDGE, AGNODE, AGRAPH, and xml.

Referenced by create_filtered_list(), doApply(), filter_attributes(), on_attrAddBtn_clicked(), and on_attrSearchBtn_clicked().

Here is the caller graph for this function:

◆ gvpr_select()

static void gvpr_select ( const char *  attrname,
const char *  regex_str,
int  objType 
)
static

Definition at line 626 of file frmobjectui.c.

References _ViewInfo::activeGraph, AGEDGE, AGNODE, agxbdisown(), agxbprint(), free(), _ViewInfo::g, run_gvpr(), set_header_text(), and view.

Referenced by on_attrSearchBtn_clicked().

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

◆ load_attr_list()

attr_list * load_attr_list ( Agraph_t g)

Definition at line 509 of file frmobjectui.c.

References _ViewInfo::activeGraph, AGEDGE, AGNODE, agnxtattr(), AGRAPH, attr_list_add(), attr_list_new(), binarySearch(), attr_t::defValE, attr_t::defValG, attr_t::defValN, _ViewInfo::g, get_attr_data_type(), gv_strdup(), attr_t::index, attr_t::name, new_attr(), new_attr_with_ref(), NULL, attr_t::objType, set_attr_object_type(), smyrnaPath(), attr_t::type, and view.

Referenced by initSmGraph().

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

◆ new_attr()

static attr_t * new_attr ( void  )
static

Definition at line 56 of file frmobjectui.c.

References gv_alloc().

Referenced by load_attr_list(), new_attr_with_ref(), and on_attrAddBtn_clicked().

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

◆ new_attr_ref()

static attr_t * new_attr_ref ( attr_t refAttr)
static

Definition at line 83 of file frmobjectui.c.

References attr_t::defValE, attr_t::defValG, attr_t::defValN, gv_alloc(), gv_strdup(), attr_t::name, safestrdup(), and attr_t::value.

Referenced by create_filtered_list().

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

◆ new_attr_with_ref()

static attr_t * new_attr_with_ref ( Agsym_t sym)
static

Definition at line 60 of file frmobjectui.c.

References AGEDGE, AGNODE, AGRAPH, Agsym_s::defval, attr_t::defValE, attr_t::defValG, attr_t::defValN, gv_strdup(), Agsym_s::kind, attr_t::name, Agsym_s::name, new_attr(), attr_t::objType, safestrdup(), and UNREACHABLE.

Referenced by load_attr_list().

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

◆ object_type_helper()

static void object_type_helper ( strview_t  a,
int *  t 
)
static

Definition at line 174 of file frmobjectui.c.

References strview_str_eq().

Referenced by set_attr_object_type().

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

◆ on_attrAddBtn_clicked()

_BB void on_attrAddBtn_clicked ( GtkWidget *  widget,
gpointer  user_data 
)

◆ on_attrApplyBtn_clicked()

_BB void on_attrApplyBtn_clicked ( GtkWidget *  widget,
gpointer  user_data 
)

Definition at line 426 of file frmobjectui.c.

References doApply().

Here is the call graph for this function:

◆ on_attrProg_toggled()

_BB void on_attrProg_toggled ( GtkWidget *  widget,
gpointer  user_data 
)

Definition at line 447 of file frmobjectui.c.

◆ on_attrRB0_clicked()

_BB void on_attrRB0_clicked ( GtkWidget *  widget,
gpointer  user_data 
)

Definition at line 434 of file frmobjectui.c.

References filter_attributes(), _ViewInfo::Topview, view, and xml.

Here is the call graph for this function:

◆ on_attrSearchBtn_clicked()

_BB void on_attrSearchBtn_clicked ( GtkWidget *  widget,
gpointer  user_data 
)

Definition at line 655 of file frmobjectui.c.

References get_object_type(), gvpr_select(), and xml.

Here is the call graph for this function:

◆ on_txtAttr_changed()

_BB void on_txtAttr_changed ( GtkWidget *  widget,
gpointer  user_data 
)

Definition at line 353 of file frmobjectui.c.

References filter_attributes(), _ViewInfo::Topview, and view.

Here is the call graph for this function:

◆ pBinarySearch()

static attr_t * pBinarySearch ( attr_list l,
const char *  searchKey 
)
static

Definition at line 219 of file frmobjectui.c.

References attr_list::attributes, NULL, and SIZE_MAX.

Referenced by create_filtered_list().

Here is the caller graph for this function:

◆ reset_attr_list_widgets()

static void reset_attr_list_widgets ( attr_list l)
static

Definition at line 95 of file frmobjectui.c.

References attr_list::fLabels, id, and MAX_FILTERED_ATTR_COUNT.

Referenced by filter_attributes().

Here is the caller graph for this function:

◆ safestrdup()

static char * safestrdup ( const char *  src)
static

Definition at line 36 of file frmobjectui.c.

References gv_strdup(), and NULL.

Referenced by new_attr_ref(), new_attr_with_ref(), and on_attrAddBtn_clicked().

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

◆ set_attr_object_type()

static void set_attr_object_type ( const char *  str,
int *  t 
)
static

Definition at line 190 of file frmobjectui.c.

References strview_t::data, NULL, object_type_helper(), strview_t::size, startswith(), str, and strview().

Referenced by load_attr_list().

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

◆ set_header_text()

static void set_header_text ( void  )
static

Definition at line 585 of file frmobjectui.c.

References _ViewInfo::activeGraph, agfstnode(), agfstout(), agnxtnode(), agnxtout(), Color_Widget_bg(), _ViewInfo::g, ND_selected, sel_edge, sel_graph, sel_node, view, and xml.

Referenced by gvpr_select(), and showAttrsWidget().

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

◆ set_refresh_filters()

static void set_refresh_filters ( ViewInfo v,
char *  name 
)
static

Definition at line 359 of file frmobjectui.c.

References refresh_filter::color, refresh_filter::pos, _ViewInfo::refresh, and refresh_filter::selection.

Referenced by doApply().

Here is the caller graph for this function:

◆ showAttrsWidget()

void showAttrsWidget ( void  )

Definition at line 616 of file frmobjectui.c.

References ATTR_NOTEBOOK_IDX, filter_attributes(), set_header_text(), _ViewInfo::Topview, view, and xml.

Referenced by attrList(), and mAttributesSlot().

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

Variable Documentation

◆ sel_edge

int sel_edge
static

Definition at line 33 of file frmobjectui.c.

Referenced by filter_attributes(), and set_header_text().

◆ sel_graph

int sel_graph
static

Definition at line 34 of file frmobjectui.c.

Referenced by filter_attributes(), and set_header_text().

◆ sel_node

int sel_node
static

Definition at line 32 of file frmobjectui.c.

Referenced by filter_attributes(), and set_header_text().