MgGraphItem

MgGraphItem — Parts of data model used with the MgGraph object.

Synopsis




            MgGraphItem;
guint       mg_graph_item_get_type          (void);
GObject*    mg_graph_item_new               (MgConf *conf,
                                             MgBase *ref_obj);
MgBase*     mg_graph_item_get_ref_object    (MgGraphItem *item);
void        mg_graph_item_set_position      (MgGraphItem *item,
                                             gdouble x,
                                             gdouble y);
void        mg_graph_item_get_position      (MgGraphItem *item,
                                             gdouble *x,
                                             gdouble *y);

Object Hierarchy


  GObject
   +----MgBase
         +----MgGraphItem

Implemented Interfaces

MgGraphItem implements MgXmlStorage.

Properties


  "ref-object"           gpointer              : Read / Write

Signal Prototypes


"moved"     void        user_function      (MgGraphItem *mggraphitem,
                                            gpointer user_data);

Description

Each graph item which needs to have its position kept in the MgConf object (and written in the dictionnary file) has a corresponding MgGraphItem object. A graph item can hold a reference to any MgBase object, meaning that the position it stores is the position where the references object's graphical representation will be on the canvas.

Details

MgGraphItem

typedef struct _MgGraphItem MgGraphItem;


mg_graph_item_get_type ()

guint       mg_graph_item_get_type          (void);

Returns :

mg_graph_item_new ()

GObject*    mg_graph_item_new               (MgConf *conf,
                                             MgBase *ref_obj);

Creates a new MgGraphItem object

conf : a MgConf object
ref_obj : a MgBase object which the new item will reference, or NULL.
Returns : the newly created object

mg_graph_item_get_ref_object ()

MgBase*     mg_graph_item_get_ref_object    (MgGraphItem *item);

Get the referenced MgBase object, if it exists.

item : a MgGraphItem object
Returns : the referenced object, or NULL

mg_graph_item_set_position ()

void        mg_graph_item_set_position      (MgGraphItem *item,
                                             gdouble x,
                                             gdouble y);

Sets the position to be remembered for item.

item : a MgGraphItemItem object
x :
y :

mg_graph_item_get_position ()

void        mg_graph_item_get_position      (MgGraphItem *item,
                                             gdouble *x,
                                             gdouble *y);

Get item's position.

item : a MgGraphItemItem object
x : a place where to store the X part of the position, or NULL
y : a place where to store the Y part of the position, or NULL

Properties

The "ref-object" property

  "ref-object"           gpointer              : Read / Write

Signals

The "moved" signal

void        user_function                  (MgGraphItem *mggraphitem,
                                            gpointer user_data);

mggraphitem :the object which received the signal.
user_data :user data set when the signal handler was connected.

See Also

Se the MgGraph object.