GdaGraph

GdaGraph — Data model to keep graphs' layout

Functions

Properties

gint graph-type Read / Write
GdaObject * ref-object Read / Write

Signals

void item-added Run First
void item-dropped Run First
void item-moved Run First

Types and Values

Object Hierarchy

    GObject
    ╰── GdaObject
        ╰── GdaGraph
            ╰── GdaGraphQuery

Implemented Interfaces

GdaGraph implements GdaXmlStorage.

Description

An instance of this object is required for each unique graph that is to be created. It is the "model" part of the graph. The "view" and "controler" parts are brought by the GnomeDbCanvas and associated widgets.

The graph can be "attached" to a specific GdaObject object using the "ref_object" property. If the referenced object is destroyed, then the graph object will also automaticallu be destroyed.

Functions

gda_graph_new ()

GObject *
gda_graph_new (GdaDict *dict,
               GdaGraphType type);

Creates a new GdaGraph object. The graph type is used only to be able to sort out the different types of graphs. It brings no special functionnality.

Parameters

dict

a GdaDict object

 

type

the graph type (one of GdaGraphType)

 

Returns

the newly created object


gda_graph_get_graph_type ()

GdaGraphType
gda_graph_get_graph_type (GdaGraph *graph);

Get the graph type of graph .

Parameters

graph

a GdaGraph object

 

Returns

the type


gda_graph_get_items ()

GSList *
gda_graph_get_items (GdaGraph *graph);

Get a list of GdaGraphItem objects which are items of graph

Parameters

graph

a GdaGraph object

 

Returns

a new list of GdaGraphItem objects


gda_graph_get_item_from_obj ()

GdaGraphItem *
gda_graph_get_item_from_obj (GdaGraph *graph,
                             GdaObject *ref_obj,
                             gboolean create_if_needed);

Get a pointer to a GdaGraphItem item from the object is represents. If the searched GdaGraphItem is not found and create_if_needed is TRUE, then a new GdaGraphItem is created.

Parameters

graph

a GdaGraph object

 

ref_obj

the GdaObject the returned item references

 

Returns

the GdaGraphItem object, or NULL if not found


gda_graph_add_item ()

void
gda_graph_add_item (GdaGraph *graph,
                    GdaGraphItem *item);

Adds item to graph .

Parameters

graph

a GdaGraph object

 

item

a GdaGraphItem object

 

gda_graph_del_item ()

void
gda_graph_del_item (GdaGraph *graph,
                    GdaGraphItem *item);

Removes item from graph

Parameters

graph

a GdaGraph object

 

item

a GdaGraphItem object

 

Types and Values

GdaGraph

typedef struct _GdaGraph GdaGraph;


enum GdaGraphType

Members

GDA_GRAPH_DB_RELATIONS

   

GDA_GRAPH_QUERY_JOINS

   

GDA_GRAPH_MODELLING

   

Property Details

The “graph-type” property

  “graph-type”               gint

Flags: Read / Write

Allowed values: >= 1

Default value: 1


The “ref-object” property

  “ref-object”               GdaObject *

Flags: Read / Write

Signal Details

The “item-added” signal

void
user_function (GdaGraph     *gdagraph,
               GdaGraphItem *arg1,
               gpointer      user_data)

Parameters

gdagraph

the object which received the signal.

 

user_data

user data set when the signal handler was connected.

 

Flags: Run First


The “item-dropped” signal

void
user_function (GdaGraph     *gdagraph,
               GdaGraphItem *arg1,
               gpointer      user_data)

Parameters

gdagraph

the object which received the signal.

 

user_data

user data set when the signal handler was connected.

 

Flags: Run First


The “item-moved” signal

void
user_function (GdaGraph     *gdagraph,
               GdaGraphItem *arg1,
               gpointer      user_data)

Parameters

gdagraph

the object which received the signal.

 

user_data

user data set when the signal handler was connected.

 

Flags: Run First