VisuNodeValues

VisuNodeValues — generic way to store (and being notify) data for each node.

Functions

Properties

gboolean editable Read / Write
gboolean internal Write / Construct Only
gchar * label Read / Write / Construct Only
guint n-elements Read / Write / Construct Only
VisuNodeArray * nodes Read / Write / Construct Only
GType * type Read / Write / Construct Only

Signals

Types and Values

Object Hierarchy

    GObject
    ╰── ToolDbgObj
        ╰── VisuNodeValues
            ├── VisuNodeValuesFarray
            ├── VisuNodeValuesFrag
            ├── VisuNodeValuesId
            ├── VisuNodeValuesString
            ╰── VisuNodeValuesType

Description

This is the base object to store data for each node. In addition, it provides routines to convert this information from and to strings. It is also possible to get notification on any changes of this information.

Functions

VisuNodeValuesFromString ()

gboolean
(*VisuNodeValuesFromString) (VisuNodeValues *vals,
                             VisuNode *node,
                             const gchar *string);

Prototype of functions used to parse string and store its content for node in vals .

Parameters

vals

a VisuNodeValues object.

 

node

a VisuNode pointer.

 

string

a string.

 

Returns

TRUE on success.

Since: 3.8


VisuNodeValuestoString ()

gchar *
(*VisuNodeValuestoString) (const VisuNodeValues *vals,
                           const VisuNode *node);

Prototype of functions used to stringify the node values of node from vals .

Parameters

vals

a VisuNodeValues object.

 

node

a VisuNode pointer.

 

Returns

a newly created string representing the values of node .

[transfer full]

Since: 3.8


VisuNodeValuesSetAt ()

gboolean
(*VisuNodeValuesSetAt) (VisuNodeValues *vals,
                        const VisuNode *node,
                        GValue *value);

Prototype of functions used to store the content of value for node in vals .

Parameters

vals

a VisuNodeValues object.

 

node

a VisuNode pointer.

 

value

a value.

 

Returns

TRUE on success.

Since: 3.8


VisuNodeValuesGetAt ()

gboolean
(*VisuNodeValuesGetAt) (const VisuNodeValues *vals,
                        const VisuNode *node,
                        GValue *value);

Prototype of functions used to store in value the values associated to node from vals .

Parameters

vals

a VisuNodeValues object.

 

node

a VisuNode pointer.

 

value

a value.

 

Returns

TRUE on success.

Since: 3.8


visu_node_values_new ()

VisuNodeValues *
visu_node_values_new (VisuNodeArray *arr,
                      const gchar *label,
                      GType type,
                      guint dim);

Creates a new VisuNodeValues object, used to store dim values of type type for each node in arr .

Parameters

arr

a VisuNodeArray object.

 

label

a label.

 

type

a type.

 

dim

some dimension.

 

Returns

a newly created VisuNodeValues object.

[transfer full]

Since: 3.8


visu_node_values_fromArray ()

gboolean
visu_node_values_fromArray (VisuNodeValues *vals,
                            const VisuNodeArray *arr);

Tests if arr is used as base for vals .

Parameters

vals

a VisuNodeValues object.

 

arr

a VisuNodeArray object.

 

Returns

TRUE if vals is stored in arr .

Since: 3.8


visu_node_values_getLabel ()

const gchar *
visu_node_values_getLabel (const VisuNodeValues *vals);

Retrives the label used to identify vals .

Parameters

vals

a VisuNodeValues object.

 

Returns

a string.

Since: 3.8


visu_node_values_getDimension ()

guint
visu_node_values_getDimension (const VisuNodeValues *vals);

Retrieves how many values are stored per node, aka the column number.

Parameters

vals

a VisuNodeValues object.

 

Returns

a number of columns.

Since: 3.8


visu_node_values_setEditable ()

void
visu_node_values_setEditable (VisuNodeValues *vals,
                              gboolean status);

Change the writable status of vals .

Parameters

vals

a VisuNodeValues object.

 

status

a boolean.

 

Since: 3.8


visu_node_values_getEditable ()

gboolean
visu_node_values_getEditable (const VisuNodeValues *vals);

Retrieves if vals are writable or not.

Parameters

vals

a VisuNodeValues object.

 

Returns

TRUE if values can be changed.

Since: 3.8


visu_node_values_setFromString ()

gboolean
visu_node_values_setFromString (VisuNodeValues *vals,
                                VisuNode *node,
                                const gchar *from);

Parse from to set a value to node in vals .

Parameters

vals

a VisuNodeValues object.

 

node

a VisuNode pointer.

 

from

a string.

 

Returns

TRUE if value is actually changed.

Since: 3.8


visu_node_values_setFromStringForId ()

gboolean
visu_node_values_setFromStringForId (VisuNodeValues *vals,
                                     guint nodeId,
                                     const gchar *from);

Same as visu_node_values_setFromString(), but uses a node id to identify a VisuNode in vals .

Parameters

vals

a VisuNodeValues object.

 

nodeId

a node id.

 

from

a string.

 

Returns

TRUE if value is actually changed.

Since: 3.8


visu_node_values_toString ()

gchar *
visu_node_values_toString (const VisuNodeValues *vals,
                           const VisuNode *node);

Creates a string representation of the value stored for node .

Parameters

vals

a VisuNodeValues object.

 

node

a VisuNode pointer.

 

Returns

a newly created string.

[transfer full]

Since: 3.8


visu_node_values_toStringFromId ()

gchar *
visu_node_values_toStringFromId (const VisuNodeValues *vals,
                                 guint nodeId);

Like visu_node_values_toString(), but using a string id.

Parameters

vals

a VisuNodeValues object.

 

nodeId

a node id.

 

Returns

a newly created string.

[transfer full]

Since: 3.8


visu_node_values_setAt ()

gboolean
visu_node_values_setAt (VisuNodeValues *vals,
                        const VisuNode *node,
                        GValue *value);

Set value for node in vals .

Parameters

vals

a VisuNodeValues object.

 

node

a VisuNode pointer.

 

value

some value.

 

Returns

TRUE if value is actually changed.

Since: 3.8


visu_node_values_getAt ()

gboolean
visu_node_values_getAt (const VisuNodeValues *vals,
                        const VisuNode *node,
                        GValue *value);

Retrieves the value stored in vals for node . value is initialised to the proper type at each call. For repeatedly retrieving values for various nodes, prefer to use a VisuNodeValuesIter instead.

Parameters

vals

a VisuNodeValues object.

 

node

a VisuNode structure.

 

value

a value location.

[out caller-allocates]

Returns

TRUE if value is properly retrieved.

Since: 3.8


visu_node_values_getPtrAt ()

gpointer
visu_node_values_getPtrAt (const VisuNodeValues *vals,
                           const VisuNode *node);

Retrieve the values associated to node , as long as it can be stored as a pointer. This is aconvenient function to avoid instanciating a GValue.

Parameters

vals

a VisuNodeValues object.

 

node

a VisuNode object.

 

Returns

a pointer to some data.

[transfer none]

Since: 3.8


visu_node_values_copy ()

gboolean
visu_node_values_copy (VisuNodeValues *vals,
                       const VisuNodeValues *from);

Copies all values from to vals , providing that from and vals store compatible data. The values are copied using the VisuNode id. If an id for a node of vals is not found in from , no node value is copied for this node. The original id is used.

Parameters

vals

a VisuNodeValues object.

 

from

a VisuNodeValues object.

 

Returns

TRUE if vals is editable and all values from have been actually copied.

Since: 3.8


visu_node_values_getArray ()

VisuNodeArray *
visu_node_values_getArray (const VisuNodeValues *vals);

Retrieves the VisuNodeArray, vels is based on.

Parameters

vals

a VisuNodeValues object.

 

Returns

a VisuNodeArray object.

[transfer full][allow-none]

Since: 3.8


visu_node_values_reset ()

void
visu_node_values_reset (VisuNodeValues *vals);

Reset all stored values.

Parameters

vals

a VisuNodeValues object.

 

Since: 3.8


visu_node_values_iter_new ()

gboolean
visu_node_values_iter_new (VisuNodeValuesIter *iter,
                           VisuNodeArrayIterType type,
                           VisuNodeValues *vals);

Creates an iterator to run over node values stored in vals , following type way of iterate.

Parameters

iter

an iterator location.

[out caller-allocates]

type

a iteration type.

 

vals

a VisuNodeValues object.

 

Returns

TRUE if the iterator is in a valid state.

Since: 3.8


visu_node_values___iter__ ()

void
visu_node_values___iter__ (VisuNodeValues *vals,
                           VisuNodeValuesIter *iter);

Creates an iterator to run over node values stored in vals . This routine is mainly for Python bindings, use visu_node_values_iter_new() instead.

Parameters

iter

an iterator location.

[out caller-allocates]

vals

a VisuNodeValues object.

 

Since: 3.8


visu_node_values_iter_next ()

gboolean
visu_node_values_iter_next (VisuNodeValuesIter *iter);

Iterates to the next node value.

Parameters

iter

a VisuNodeValuesIter object.

 

Returns

TRUE if the iterator is still in a valid state.

Since: 3.8

Types and Values

struct VisuNodeValues

struct VisuNodeValues;

Common name to refer to a _VisuNodeValues.


struct VisuNodeValuesClass

struct VisuNodeValuesClass {
  VisuObjectClass parent;

  VisuNodeValuesFromString parse;
  VisuNodeValuestoString   serialize;

  VisuNodeValuesSetAt setAt;
  VisuNodeValuesGetAt getAt;
};

Common name to refer to a _VisuNodeValuesClass.

Members

VisuObjectClass parent;

private.

 

VisuNodeValuesFromString parse;

a routine to get values from a string.

 

VisuNodeValuestoString serialize;

a routine to write format into a string.

 

VisuNodeValuesSetAt setAt;

a routine to store values at a node.

 

VisuNodeValuesGetAt getAt;

a routine to get values at a node.

 

struct VisuNodeValuesIter

struct VisuNodeValuesIter {
  GValue value;
  VisuNodeArrayIter iter;
  
  /* Private. */
  VisuNodeValues *vals;
};

Iterator structure used to read values of nodes.

Members

GValue value;

the stored value.

 

VisuNodeArrayIter iter;

the iterator used to span nodes.

 

VisuNodeValues *vals;

the parent VisuNodeValues object.

 

Since: 3.8

Property Details

The “editable” property

  “editable”                 gboolean

user can modify the value.

Flags: Read / Write

Default value: TRUE


The “internal” property

  “internal”                 gboolean

internal to VisuNode structure.

Flags: Write / Construct Only

Default value: FALSE


The “label” property

  “label”                    gchar *

description label.

Flags: Read / Write / Construct Only

Default value: ""


The “n-elements” property

  “n-elements”               guint

number of dimensions.

Flags: Read / Write / Construct Only

Allowed values: [1,G_MAXINT]

Default value: 1


The “nodes” property

  “nodes”                    VisuNodeArray *

nodes values are related to.

Flags: Read / Write / Construct Only


The “type” property

  “type”                     GType *

type of the values.

Flags: Read / Write / Construct Only

Allowed values: void

Signal Details

The “changed” signal

void
user_function (VisuNodeValues *vals,
               VisuNode       *node,
               gpointer        user_data)

Gets emitted when the values corresponding to this node property are changed for node .

Parameters

vals

the object which received the signal ;

 

node

the VisuNode that is modified.

 

user_data

user data set when the signal handler was connected.

 

Flags: No Hooks

Since: 3.8