VisuUiSelection

VisuUiSelection — A specialised list store handling node selection.

Functions

Properties

gboolean highlight Read / Write
VisuGlExtMarks * marks Read / Write
VisuData * model Read / Write
GArray * selection Read / Write

Types and Values

Object Hierarchy

    GObject
    ╰── GtkListStore
        ╰── VisuUiSelection

Implemented Interfaces

VisuUiSelection implements GtkTreeModel, GtkTreeDragSource, GtkTreeDragDest, GtkTreeSortable and GtkBuildable.

Description

This is a specialised GtkListStore to handle list of nodes. It is storing the node ids and their highlight status. Their highlight status is driven by a VisuGlExtMarks model, see visu_ui_selection_setHighlightModel(). If a VisuData model is provided by visu_ui_selection_setNodeModel(), then on population changes, the non existing nodes are removed from the selection list.

Functions

visu_ui_selection_new ()

VisuUiSelection *
visu_ui_selection_new ();

Create a new GtkListStore to store planes.

Returns

a newly created object.

Since: 3.8


visu_ui_selection_setNodeModel ()

gboolean
visu_ui_selection_setNodeModel (VisuUiSelection *selection,
                                VisuData *data);

Bind the set object to list .

Parameters

selection

a VisuUiSelection object.

 

data

a VisuData object.

[allow-none]

Returns

TRUE if set is changed


visu_ui_selection_setHighlightModel ()

gboolean
visu_ui_selection_setHighlightModel (VisuUiSelection *selection,
                                     VisuGlExtMarks *marks);

Bind the set object to list .

Parameters

selection

a VisuUiSelection object.

 

marks

a VisuGlExtMarks object.

[allow-none]

Returns

TRUE if set is changed


visu_ui_selection_add ()

gboolean
visu_ui_selection_add (VisuUiSelection *selection,
                       guint id);

Add the node identified by id to selection . If the node already exists or if selection has no current node model, nothing is done. If there are several nodes to insert at once, use visu_ui_selection_append() instead to ensure that the selection signalis only emitted once.

Parameters

selection

a VisuUiSelection object.

 

id

a node id.

 

Returns

TRUE if id can be added to the model.

Since: 3.8


visu_ui_selection_append ()

void
visu_ui_selection_append (VisuUiSelection *selection,
                          const GArray *ids);

Inserts every node from ids into selection . The selection signal is only emitted once.

Parameters

selection

a VisuUiSelection object.

 

ids

a list of node ids.

[element-type uint]

Since: 3.8


visu_ui_selection_appendHighlightedNodes ()

void
visu_ui_selection_appendHighlightedNodes
                               (VisuUiSelection *selection);

A convenient method to get the highlighted nodes and add them to the selection .

Parameters

selection

a VisuUiSelection object.

 

Since: 3.8


visu_ui_selection_highlight ()

void
visu_ui_selection_highlight (VisuUiSelection *selection,
                             GtkTreeIter *iter,
                             VisuGlExtMarksStatus status);

Apply the new status to nodes. If iter is NULL, all nodes stored in selection are modified, otherwise, only the node at iter .

Parameters

selection

a VisuUiSelection object.

 

iter

a GtkTreeIter structure.

[allow-none]

status

a mark status.

 

Since: 3.8


visu_ui_selection_remove ()

void
visu_ui_selection_remove (VisuUiSelection *selection,
                          const GArray *ids);

Remove a list of nodes from selection .

Parameters

selection

a VisuUiSelection object.

 

ids

a list of node ids.

[element-type uint]

Since: 3.8


visu_ui_selection_removePaths ()

void
visu_ui_selection_removePaths (VisuUiSelection *selection,
                               const GList *paths);

Remove all given paths from selection .

Parameters

selection

a VisuUiSelection object.

 

paths

a list of GtkTreePath.

[element-type GtkTreePath]

Since: 3.8


visu_ui_selection_clear ()

void
visu_ui_selection_clear (VisuUiSelection *selection);

An overloaded method of gtk_list_store_clear() to ensure that the selection signal is properly emitted.

Parameters

selection

a VisuUiSelection object.

 

Since: 3.8


visu_ui_selection_removeAt ()

gboolean
visu_ui_selection_removeAt (VisuUiSelection *selection,
                            GtkTreeIter *iter);

Remove the node stored at iter from selection . This is an overloaded function of gtk_list_store_remove() to emit the selection signal after change.

Parameters

selection

a VisuUiSelection object.

 

iter

a GtkTreeIter structure.

 

Returns

TRUE if iter was actually removed.

Since: 3.8


visu_ui_selection_at ()

gboolean
visu_ui_selection_at (VisuUiSelection *selection,
                      GtkTreeIter *iter,
                      guint id);

Inquires if the model selection is storing node id at iter .

Parameters

selection

a VisuUiSelection object.

 

iter

a GtkTreeIter structure.

 

id

a node id.

 

Returns

TRUE if node id is set at iter .

Since: 3.8


visu_ui_selection_get ()

GArray *
visu_ui_selection_get (const VisuUiSelection *selection);

Retrieves the list of node ids in the selection.

Parameters

selection

a VisuUiSelection object.

 

Returns

a list of node ids.

[transfer full][element-type guint]

Since: 3.8


visu_ui_selection_set ()

void
visu_ui_selection_set (VisuUiSelection *selection,
                       const GArray *ids);

Clear the selection and update it with the nodes from ids .

Parameters

selection

a VisuUiSelection object.

 

ids

a list of node ids.

[element-type uint]

Since: 3.8

Types and Values

struct VisuUiSelection

struct VisuUiSelection;

Common name to refer to a _VisuUiSelection.


struct VisuUiSelectionClass

struct VisuUiSelectionClass {
  GtkListStoreClass parent;
};

Common name to refer to a _VisuUiSelectionClass.

Members

GtkListStoreClass parent;

private.

 

enum VisuUiSelectionColumnId

Thesse are the description of the columns stored in the object.

Members

VISU_UI_SELECTION_NUMBER

column displaying the node id.

 

VISU_UI_SELECTION_HIGHLIGHT

column checked when the node is highlighted.

 

VISU_UI_SELECTION_N_COLUMNS

the number of columns.

 

Property Details

The “highlight” property

  “highlight”                gboolean

highlight the selection.

Flags: Read / Write

Default value: FALSE


The “marks” property

  “marks”                    VisuGlExtMarks *

highlight model.

Flags: Read / Write


The “model” property

  “model”                    VisuData *

node model.

Flags: Read / Write


The “selection” property

  “selection”                GArray *

ids of selected nodes.

Flags: Read / Write