## MgCanvasItem

MgCanvasItem — Base class for all the GnomeCanvasItem derived widgets in libmergeant.

## Synopsis

    struct      MgCanvasItem;
    guint       mg_canvas_item_get_type         (void);
    MgCanvas*   mg_canvas_item_get_canvas       (MgCanvasItem *item);
    MgGraphItem* mg_canvas_item_get_graph_item  (MgCanvasItem *item);

## Object Hierarchy

      GObject
       +----GtkObject
             +----GnomeCanvasItem
                   +----GnomeCanvasGroup
                         +----MgCanvasItem
                               +----MgCanvasCursor
                               +----MgCanvasText
                               +----MgCanvasEntity

## Properties

      "allow-drag"           gboolean             : Read / Write
      "allow-move"           gboolean             : Read / Write
      "graph-item"           gpointer             : Read / Write
      "tip-text"             gchararray           : Read / Write

## Signal Prototypes

    "drag-action"
                void        user_function      (MgCanvasItem *mgcanvasitem,
                                                gpointer arg1,
                                                gpointer arg2,
                                                gpointer user_data);
    "moved"     void        user_function      (MgCanvasItem *mgcanvasitem,
                                                gpointer user_data);
    "moving"    void        user_function      (MgCanvasItem *mgcanvasitem,
                                                gpointer user_data);
    "shifted"   void        user_function      (MgCanvasItem *mgcanvasitem,
                                                gpointer user_data);

## Description

This object adds some functionnalities on top of the GnomeCanvasItem objects such as synchronisation with a MgGraphItem object (to have a persistent position on the canvas), the ability to be moved on the canvas, and the ability to initiate and report simple drag and drop within the canvas.

## Details

### struct MgCanvasItem

    struct MgCanvasItem;

### mg_canvas_item_get_type ()

    guint       mg_canvas_item_get_type         (void);

Returns : |

### mg_canvas_item_get_canvas ()

    MgCanvas*   mg_canvas_item_get_canvas       (MgCanvasItem *item);

Get the MgCanvas on which `item` is drawn

`item` : | a MgCanvasItem object
Returns : | the MgCanvas widget

### mg_canvas_item_get_graph_item ()

    MgGraphItem* mg_canvas_item_get_graph_item  (MgCanvasItem *item);

Get the associated MgGraphItem to `item`.

`item` : | a MgCanvasItem object
Returns : | the MgGraphItem, or `NULL`

## Properties

"`allow-drag`" (gboolean : Read / Write) |
"`allow-move`" (gboolean : Read / Write) |
"`graph-item`" (gpointer : Read / Write) |
"`tip-text`" (gchararray : Read / Write) |

## Signals

### The "drag-action" signal

    void        user_function                  (MgCanvasItem *mgcanvasitem,
                                                gpointer arg1,
                                                gpointer arg2,
                                                gpointer user_data);

`mgcanvasitem` : | the object which received the signal.
`arg1` : | @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @: @:
`user_data` : | user data set when the signal handler was connected.

### The "moved" signal

    void        user_function                  (MgCanvasItem *mgcanvasitem,
                                                gpointer user_data);

`mgcanvasitem` : | the object which received the signal.
`user_data` : | user data set when the signal handler was connected.

### The "moving" signal

    void        user_function                  (MgCanvasItem *mgcanvasitem,
                                                gpointer user_data);

`mgcanvasitem` : | the object which received the signal.
`user_data` : | user data set when the signal handler was connected.

### The "shifted" signal

    void        user_function                  (MgCanvasItem *mgcanvasitem,
                                                gpointer user_data);

`mgcanvasitem` : | the object which received the signal.
`user_data` : | user data set when the signal handler was connected.