GtkPlotCanvas
3
GTKEXTRA Library

# GtkPlotCanvas

## Synopsis

    #include <gtkextra.h>

                        GtkPlotCanvas;
                        GtkPlotCanvasChild;
    enum                GtkPlotCanvasAction;
    enum                GtkPlotCanvasFlag;
    enum                GtkPlotCanvasSelection;
    enum                GtkPlotCanvasSelectionMode;
    enum                GtkPlotCanvasPos;
    GtkWidget*          gtk_plot_canvas_new                 (gint width,
                                                             gint height,
                                                             gdouble magnification);
    void                gtk_plot_canvas_construct           (GtkPlotCanvas *canvas,
                                                             gint width,
                                                             gint height,
                                                             gdouble magnification);
    void                gtk_plot_canvas_set_pc              (GtkPlotCanvas *canvas,
                                                             GtkPlotPC *pc);
    void                gtk_plot_canvas_paint               (GtkPlotCanvas *canvas);
    void                gtk_plot_canvas_refresh             (GtkPlotCanvas *canvas);
    void                gtk_plot_canvas_freeze              (GtkPlotCanvas *canvas);
    void                gtk_plot_canvas_thaw                (GtkPlotCanvas *canvas);
    void                gtk_plot_canvas_grid_set_visible    (GtkPlotCanvas *canvas,
                                                             gboolean visible);
    void                gtk_plot_canvas_grid_set_step       (GtkPlotCanvas *canvas,
                                                             gdouble step);
    void                gtk_plot_canvas_grid_set_attributes (GtkPlotCanvas *canvas,
                                                             GtkPlotLineStyle style,
                                                             gint width,
                                                             const GdkColor *color);
    void                gtk_plot_canvas_cancel_action       (GtkPlotCanvas *plot_canvas);
    void                gtk_plot_canvas_unselect            (GtkPlotCanvas *plot_canvas);
    GtkPlotCanvasChild * gtk_plot_canvas_get_active_item    (GtkPlotCanvas *canvas);
    void                gtk_plot_canvas_set_size            (GtkPlotCanvas *canvas,
                                                             gint width,
                                                             gint height);
    void                gtk_plot_canvas_set_magnification   (GtkPlotCanvas *canvas,
                                                             gdouble magnification);
    void                gtk_plot_canvas_set_transparent     (GtkPlotCanvas *canvas,
                                                             gboolean transparent);
    gboolean            gtk_plot_canvas_transparent         (GtkPlotCanvas *canvas);
    void                gtk_plot_canvas_set_background      (GtkPlotCanvas *canvas,
                                                             const GdkColor *bg_color);
    void                gtk_plot_canvas_get_pixel           (GtkPlotCanvas *canvas,
                                                             gdouble px,
                                                             gdouble py,
                                                             gint *x,
                                                             gint *y);
    void                gtk_plot_canvas_get_position        (GtkPlotCanvas *plot_canvas,
                                                             gint x,
                                                             gint y,
                                                             gdouble *px,
                                                             gdouble *py);
    void                gtk_plot_canvas_put_child           (GtkPlotCanvas *canvas,
                                                             GtkPlotCanvasChild *child,
                                                             gdouble x1,
                                                             gdouble y1,
                                                             gdouble x2,
                                                             gdouble y2);
    void                gtk_plot_canvas_remove_child        (GtkPlotCanvas *canvas,
                                                             GtkPlotCanvasChild *child);
    void                gtk_plot_canvas_child_move          (GtkPlotCanvas *canvas,
                                                             GtkPlotCanvasChild *child,
                                                             gdouble x1,
                                                             gdouble y1);
    void                gtk_plot_canvas_child_move_resize   (GtkPlotCanvas *canvas,
                                                             GtkPlotCanvasChild *child,
                                                             gdouble x1,
                                                             gdouble y1,
                                                             gdouble x2,
                                                             gdouble y2);
    void                gtk_plot_canvas_child_set_selection (GtkPlotCanvasChild *child,
                                                             GtkPlotCanvasSelection selection);
    void                gtk_plot_canvas_child_set_selection_mode
                                                            (GtkPlotCanvasChild *child,
                                                             GtkPlotCanvasSelectionMode mode);
    gboolean            gtk_plot_canvas_child_get_position  (GtkPlotCanvas *canvas,
                                                             GtkPlotCanvasChild *child,
                                                             double *x1,
                                                             double *y1,
                                                             double *x2,
                                                             double *y2);
    void                gtk_plot_canvas_set_line_attributes (GtkPlotCanvas *canvas,
                                                             GtkPlotLine line);

## Object Hierarchy

      GObject
       +----GInitiallyUnowned
             +----GtkObject
                   +----GtkWidget
                         +----GtkContainer
                               +----GtkFixed
                                     +----GtkPlotCanvas

      GObject
       +----GInitiallyUnowned
             +----GtkObject
                   +----GtkPlotCanvasChild
                         +----GtkPlotCanvasEllipse
                         +----GtkPlotCanvasPixmap
                         +----GtkPlotCanvasPlot
                         +----GtkPlotCanvasRectangle
                         +----GtkPlotCanvasText

## Implemented Interfaces

GtkPlotCanvas implements AtkImplementorIface and GtkBuildable.

## Properties

      "color-bg"                 gpointer              : Read / Write
      "flags"                    gint                  : Read / Write
      "grid-step"                gdouble               : Read / Write
      "height"                   gint                  : Read / Write
      "line-grid"                gpointer              : Read / Write
      "magnification"            gdouble               : Read / Write
      "show-grid"                gboolean              : Read / Write
      "transparent"              gboolean              : Read / Write
      "width"                    gint                  : Read / Write

## Signals

      "add-item"                                       : Run Last
      "changed"                                        : Run Last
      "delete-item"                                    : Run Last
      "move-item"                                      : Run Last
      "resize-item"                                    : Run Last
      "select-item"                                    : Run Last
      "select-region"                                  : Run Last

## Description

FIXME:: need long description.

## Details

### GtkPlotCanvas

    typedef struct _GtkPlotCanvas GtkPlotCanvas;

The GtkPlotCanvas struct contains only private data. It should only be accessed through the functions described below.

### GtkPlotCanvasChild

    typedef struct _GtkPlotCanvasChild GtkPlotCanvasChild;

The GtkPlotCanvasChild struct contains only private data. It should only be accessed through the functions described below.

### enum GtkPlotCanvasAction

    typedef enum
    {
          GTK_PLOT_CANVAS_ACTION_INACTIVE,
          GTK_PLOT_CANVAS_ACTION_SELECTION,
          GTK_PLOT_CANVAS_ACTION_DRAG,
          GTK_PLOT_CANVAS_ACTION_RESIZE,
    } GtkPlotCanvasAction;

### enum GtkPlotCanvasFlag

    typedef enum
    {
          GTK_PLOT_CANVAS_FROZEN            = 0,
          GTK_PLOT_CANVAS_CAN_MOVE          = 1 << 0,
          GTK_PLOT_CANVAS_CAN_RESIZE	= 1 << 1,
    } GtkPlotCanvasFlag;

### enum GtkPlotCanvasSelection

    typedef enum
    {
          GTK_PLOT_CANVAS_SELECT_NONE,
          GTK_PLOT_CANVAS_SELECT_MARKERS,
          GTK_PLOT_CANVAS_SELECT_TARGET,
    } GtkPlotCanvasSelection;

### enum GtkPlotCanvasSelectionMode

    typedef enum
    {
          GTK_PLOT_CANVAS_SELECT_CLICK_1,
          GTK_PLOT_CANVAS_SELECT_CLICK_2,
    } GtkPlotCanvasSelectionMode;

### enum GtkPlotCanvasPos

    typedef enum
    {
          GTK_PLOT_CANVAS_OUT,
          GTK_PLOT_CANVAS_IN,
          GTK_PLOT_CANVAS_LEFT,
          GTK_PLOT_CANVAS_RIGHT,
          GTK_PLOT_CANVAS_TOP,
          GTK_PLOT_CANVAS_BOTTOM,
          GTK_PLOT_CANVAS_TOP_LEFT,
          GTK_PLOT_CANVAS_TOP_RIGHT,
          GTK_PLOT_CANVAS_BOTTOM_LEFT,
          GTK_PLOT_CANVAS_BOTTOM_RIGHT,
    } GtkPlotCanvasPos;

### gtk_plot_canvas_new ()

    GtkWidget*          gtk_plot_canvas_new                 (gint width,
                                                             gint height,
                                                             gdouble magnification);

`width` :

`height` :

`magnification` :

Returns :

### gtk_plot_canvas_construct ()

    void                gtk_plot_canvas_construct           (GtkPlotCanvas *canvas,
                                                             gint width,
                                                             gint height,
                                                             gdouble magnification);

`canvas` :

  a GtkPlotCanvas.

`width` :

`height` :

`magnification` :

### gtk_plot_canvas_set_pc ()

    void                gtk_plot_canvas_set_pc              (GtkPlotCanvas *canvas,
                                                             GtkPlotPC *pc);

`canvas` :

`pc` :

### gtk_plot_canvas_paint ()

    void                gtk_plot_canvas_paint               (GtkPlotCanvas *canvas);

`canvas` :

  a GtkPlotCanvas.

### gtk_plot_canvas_refresh ()

    void                gtk_plot_canvas_refresh             (GtkPlotCanvas *canvas);

`canvas` :

  a GtkPlotCanvas.

### gtk_plot_canvas_freeze ()

    void                gtk_plot_canvas_freeze              (GtkPlotCanvas *canvas);

`canvas` :

  a GtkPlotCanvas.

### gtk_plot_canvas_thaw ()

    void                gtk_plot_canvas_thaw                (GtkPlotCanvas *canvas);

`canvas` :

  a GtkPlotCanvas.

### gtk_plot_canvas_grid_set_visible ()

    void                gtk_plot_canvas_grid_set_visible    (GtkPlotCanvas *canvas,
                                                             gboolean visible);

`canvas` :

  a GtkPlotCanvas.

`visible` :

### gtk_plot_canvas_grid_set_step ()

    void                gtk_plot_canvas_grid_set_step       (GtkPlotCanvas *canvas,
                                                             gdouble step);

`canvas` :

  a GtkPlotCanvas.

`step` :

### gtk_plot_canvas_grid_set_attributes ()

    void                gtk_plot_canvas_grid_set_attributes (GtkPlotCanvas *canvas,
                                                             GtkPlotLineStyle style,
                                                             gint width,
                                                             const GdkColor *color);

`canvas` :

  a GtkPlotCanvas.

`style` :

`width` :

`color` :

### gtk_plot_canvas_cancel_action ()

    void                gtk_plot_canvas_cancel_action       (GtkPlotCanvas *plot_canvas);

`plot_canvas` :

  a GtkPlotCanvas.

### gtk_plot_canvas_unselect ()

    void                gtk_plot_canvas_unselect            (GtkPlotCanvas *plot_canvas);

`plot_canvas` :

  a GtkPlotCanvas.

### gtk_plot_canvas_get_active_item ()

    GtkPlotCanvasChild * gtk_plot_canvas_get_active_item    (GtkPlotCanvas *canvas);

`canvas` :

  a GtkPlotCanvas.

Returns :

### gtk_plot_canvas_set_size ()

    void                gtk_plot_canvas_set_size            (GtkPlotCanvas *canvas,
                                                             gint width,
                                                             gint height);

`canvas` :

`width` :

`height` :

### gtk_plot_canvas_set_magnification ()

    void                gtk_plot_canvas_set_magnification   (GtkPlotCanvas *canvas,
                                                             gdouble magnification);

`canvas` :

  a GtkPlotCanvas.

`magnification` :

### gtk_plot_canvas_set_transparent ()

    void                gtk_plot_canvas_set_transparent     (GtkPlotCanvas *canvas,
                                                             gboolean transparent);

`canvas` :

  a GtkPlotCanvas.

`transparent` :

### gtk_plot_canvas_transparent ()

    gboolean            gtk_plot_canvas_transparent         (GtkPlotCanvas *canvas);

`canvas` :

Returns :

### gtk_plot_canvas_set_background ()

    void                gtk_plot_canvas_set_background      (GtkPlotCanvas *canvas,
                                                             const GdkColor *bg_color);

`canvas` :

  a GtkPlotCanvas.

`bg_color` :

  a GdkColor.

### gtk_plot_canvas_get_pixel ()

    void                gtk_plot_canvas_get_pixel           (GtkPlotCanvas *canvas,
                                                             gdouble px,
                                                             gdouble py,
                                                             gint *x,
                                                             gint *y);

`canvas` :

  a GtkPlotCanvas.

`px` :

`py` :

`x` :

`y` :

### gtk_plot_canvas_get_position ()

    void                gtk_plot_canvas_get_position        (GtkPlotCanvas *plot_canvas,
                                                             gint x,
                                                             gint y,
                                                             gdouble *px,
                                                             gdouble *py);

`plot_canvas` :

  a GtkPlotCanvas.

`x` :

`y` :

`px` :

`py` :

### gtk_plot_canvas_put_child ()

    void                gtk_plot_canvas_put_child           (GtkPlotCanvas *canvas,
                                                             GtkPlotCanvasChild *child,
                                                             gdouble x1,
                                                             gdouble y1,
                                                             gdouble x2,
                                                             gdouble y2);

`canvas` :

  a GtkPlotCanvas.

`child` :

`x1` :

`y1` :

`x2` :

`y2` :

### gtk_plot_canvas_remove_child ()

    void                gtk_plot_canvas_remove_child        (GtkPlotCanvas *canvas,
                                                             GtkPlotCanvasChild *child);

`canvas` :

  a GtkPlotCanvas.

`child` :

  a GtkPlotCanvasChild

### gtk_plot_canvas_child_move ()

    void                gtk_plot_canvas_child_move          (GtkPlotCanvas *canvas,
                                                             GtkPlotCanvasChild *child,
                                                             gdouble x1,
                                                             gdouble y1);

`canvas` :

  a GtkPlotCanvas.

`child` :

  a GtkPlotCanvasChild

`x1` :

`y1` :

### gtk_plot_canvas_child_move_resize ()

    void                gtk_plot_canvas_child_move_resize   (GtkPlotCanvas *canvas,
                                                             GtkPlotCanvasChild *child,
                                                             gdouble x1,
                                                             gdouble y1,
                                                             gdouble x2,
                                                             gdouble y2);

`canvas` :

  a GtkPlotCanvas.

`child` :

`x1` :

`y1` :

`x2` :

`y2` :

### gtk_plot_canvas_child_set_selection ()

    void                gtk_plot_canvas_child_set_selection (GtkPlotCanvasChild *child,
                                                             GtkPlotCanvasSelection selection);

`child` :

`selection` :

### gtk_plot_canvas_child_set_selection_mode ()

    void                gtk_plot_canvas_child_set_selection_mode
                                                            (GtkPlotCanvasChild *child,
                                                             GtkPlotCanvasSelectionMode mode);

`child` :

  a GtkPlotCanvasChild.

`mode` :

### gtk_plot_canvas_child_get_position ()

    gboolean            gtk_plot_canvas_child_get_position  (GtkPlotCanvas *canvas,
                                                             GtkPlotCanvasChild *child,
                                                             double *x1,
                                                             double *y1,
                                                             double *x2,
                                                             double *y2);

`canvas` :

  a GtkPlotCanvas.

`child` :

  a GtkPlotCanvasChild.

`x1` :

`y1` :

`x2` :

`y2` :

Returns :

### gtk_plot_canvas_set_line_attributes ()

    void                gtk_plot_canvas_set_line_attributes (GtkPlotCanvas *canvas,
                                                             GtkPlotLine line);

`canvas` :

  a GtkPlotCanvas.

`line` :

## Property Details

### The `"color-bg"` property

      "color-bg"                 gpointer              : Read / Write

### The `"flags"` property

      "flags"                    gint                  : Read / Write

Allowed values: >= 0

Default value: 0

### The `"grid-step"` property

      "grid-step"                gdouble               : Read / Write

Allowed values: >= 0

Default value: 0

### The `"height"` property

      "height"                   gint                  : Read / Write

Allowed values: >= 0

Default value: 1

### The `"line-grid"` property

      "line-grid"                gpointer              : Read / Write

### The `"magnification"` property

      "magnification"            gdouble               : Read / Write

Allowed values: >= 0

Default value: 1

### The `"show-grid"` property

      "show-grid"                gboolean              : Read / Write

Default value: FALSE

### The `"transparent"` property

      "transparent"              gboolean              : Read / Write

Default value: TRUE

### The `"width"` property

      "width"                    gint                  : Read / Write

Allowed values: >= 0

Default value: 1

## Signal Details

### The `"add-item"` signal

    void                user_function                      (GtkPlotCanvas      *plotcanvas,
                                                            GtkPlotCanvasChild *arg1,
                                                            gpointer            user_data)       : Run Last

`plotcanvas` :

  the object which received the signal.

`arg1` :

`user_data` :

  user data set when the signal handler was connected.

### The `"changed"` signal

    void                user_function                      (GtkPlotCanvas *canvas,
                                                            gpointer       user_data)      : Run Last

`canvas` :

`user_data` :

  user data set when the signal handler was connected.

### The `"delete-item"` signal

    gboolean            user_function                      (GtkPlotCanvas      *plotcanvas,
                                                            GtkPlotCanvasChild *arg1,
                                                            gpointer            user_data)       : Run Last

`plotcanvas` :

  the object which received the signal.

`arg1` :

`user_data` :

  user data set when the signal handler was connected.

Returns :

### The `"move-item"` signal

    gboolean            user_function                      (GtkPlotCanvas      *plotcanvas,
                                                            GtkPlotCanvasChild *arg1,
                                                            gdouble             arg2,
                                                            gdouble             arg3,
                                                            gpointer            user_data)       : Run Last

`plotcanvas` :

  the object which received the signal.

`arg1` :

`arg2` :

`arg3` :

`user_data` :

  user data set when the signal handler was connected.

Returns :

### The `"resize-item"` signal

    gboolean            user_function                      (GtkPlotCanvas      *plotcanvas,
                                                            GtkPlotCanvasChild *arg1,
                                                            gdouble             arg2,
                                                            gdouble             arg3,
                                                            gpointer            user_data)       : Run Last

`plotcanvas` :

  the object which received the signal.

`arg1` :

`arg2` :

`arg3` :

`user_data` :

  user data set when the signal handler was connected.

Returns :

### The `"select-item"` signal

    gboolean            user_function                      (GtkPlotCanvas      *plotcanvas,
                                                            GdkEvent           *event,
                                                            GtkPlotCanvasChild *arg1,
                                                            gpointer            user_data)       : Run Last

`plotcanvas` :

  the object which received the signal.

`event` :

`arg1` :

`user_data` :

  user data set when the signal handler was connected.

Returns :

### The `"select-region"` signal

    void                user_function                      (GtkPlotCanvas *plotcanvas,
                                                            gdouble        arg1,
                                                            gdouble        arg2,
                                                            gdouble        arg3,
                                                            gdouble        arg4,
                                                            gpointer       user_data)       : Run Last

`plotcanvas` :

  the object which received the signal.

`arg1` :

`arg2` :

`arg3` :

`arg4` :

`user_data` :

  user data set when the signal handler was connected.