## GtkPlotCanvas

GtkPlotCanvas

## Synopsis

    #include <gtkextra.h>

    enum                GtkPlotCanvasAction;
    enum                GtkPlotCanvasFlag;
    enum                GtkPlotCanvasSelection;
    enum                GtkPlotCanvasSelectionMode;
    enum                GtkPlotCanvasPos;
    #define             GTK_PLOT_CANVAS_DND_FLAGS
    #define             GTK_PLOT_CANVAS_FLAGS               (canvas)
    #define             GTK_PLOT_CANVAS_SET_FLAGS           (canvas, flags)
    #define             GTK_PLOT_CANVAS_UNSET_FLAGS         (canvas, flags)
    #define             GTK_PLOT_CANVAS_CAN_DND_POINT       (canvas)
    #define             GTK_PLOT_CANVAS_CAN_DND             (canvas)
    #define             GTK_PLOT_CANVAS_CAN_SELECT_POINT    (canvas)
    #define             GTK_PLOT_CANVAS_CAN_SELECT_ITEM     (canvas)
    #define             GTK_PLOT_CANVAS_CAN_SELECT          (canvas)
    #define             GTK_PLOT_CANVAS_CHILD               (obj)
    #define             GTK_PLOT_CANVAS_CHILD_CLASS         (klass)
    #define             GTK_IS_PLOT_CANVAS_CHILD            (obj)
    #define             GTK_TYPE_PLOT_CANVAS_CHILD
    GtkType             gtk_plot_canvas_child_get_type      (void);
    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 *background);
    void                gtk_plot_canvas_get_pixel           (GtkPlotCanvas *plot_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);

## Description

## Details

### 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_DND_FLAGS

    #define             GTK_PLOT_CANVAS_DND_FLAGS

### GTK_PLOT_CANVAS_FLAGS()

    #define GTK_PLOT_CANVAS_FLAGS(canvas)	  (GTK_PLOT_CANVAS(canvas)->flags)

`canvas` : |

### GTK_PLOT_CANVAS_SET_FLAGS()

    #define GTK_PLOT_CANVAS_SET_FLAGS(canvas, flags)  (GTK_PLOT_CANVAS_FLAGS(canvas) |= (flags))

`canvas` : |
`flags` : |

### GTK_PLOT_CANVAS_UNSET_FLAGS()

    #define GTK_PLOT_CANVAS_UNSET_FLAGS(canvas, flags)  (GTK_PLOT_CANVAS_FLAGS(canvas) &= ~(flags))

`canvas` : |
`flags` : |

### GTK_PLOT_CANVAS_CAN_DND_POINT()

    #define GTK_PLOT_CANVAS_CAN_DND_POINT(canvas)  (GTK_PLOT_CANVAS_FLAGS(canvas) & GTK_PLOT_CANVAS_CAN_DND_POINT)

`canvas` : |

### GTK_PLOT_CANVAS_CAN_DND()

    #define GTK_PLOT_CANVAS_CAN_DND(canvas)  (GTK_PLOT_CANVAS_FLAGS(canvas) & GTK_PLOT_CANVAS_CAN_DND)

`canvas` : |

### GTK_PLOT_CANVAS_CAN_SELECT_POINT()

    #define GTK_PLOT_CANVAS_CAN_SELECT_POINT(canvas)  (GTK_PLOT_CANVAS_FLAGS(canvas) & GTK_PLOT_CANVAS_CAN_SELECT_POINT)

`canvas` : |

### GTK_PLOT_CANVAS_CAN_SELECT_ITEM()

    #define GTK_PLOT_CANVAS_CAN_SELECT_ITEM(canvas)  (GTK_PLOT_CANVAS_FLAGS(canvas) & GTK_PLOT_CANVAS_CAN_SELECT_ITEM)

`canvas` : |

### GTK_PLOT_CANVAS_CAN_SELECT()

    #define GTK_PLOT_CANVAS_CAN_SELECT(canvas)  (GTK_PLOT_CANVAS_FLAGS(canvas) & GTK_PLOT_CANVAS_CAN_SELECT)

`canvas` : |

### GTK_PLOT_CANVAS_CHILD()

    #define GTK_PLOT_CANVAS_CHILD(obj)        GTK_CHECK_CAST (obj, gtk_plot_canvas_child_get_type (), GtkPlotCanvasChild)

`obj` : |

### GTK_PLOT_CANVAS_CHILD_CLASS()

    #define GTK_PLOT_CANVAS_CHILD_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_plot_canvas_child_get_type(), GtkPlotCanvasChildClass)

`klass` : |

### GTK_IS_PLOT_CANVAS_CHILD()

    #define GTK_IS_PLOT_CANVAS_CHILD(obj)     GTK_CHECK_TYPE (obj, gtk_plot_canvas_child_get_type ())

`obj` : |

### GTK_TYPE_PLOT_CANVAS_CHILD

    #define GTK_TYPE_PLOT_CANVAS_CHILD (gtk_plot_canvas_child_get_type ())

### gtk_plot_canvas_child_get_type ()

    GtkType             gtk_plot_canvas_child_get_type      (void);

Returns : |

### 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` : |
`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` : |

### gtk_plot_canvas_refresh ()

    void                gtk_plot_canvas_refresh             (GtkPlotCanvas *canvas);

`canvas` : |

### gtk_plot_canvas_freeze ()

    void                gtk_plot_canvas_freeze              (GtkPlotCanvas *canvas);

`canvas` : |

### gtk_plot_canvas_thaw ()

    void                gtk_plot_canvas_thaw                (GtkPlotCanvas *canvas);

`canvas` : |

### gtk_plot_canvas_grid_set_visible ()

    void                gtk_plot_canvas_grid_set_visible    (GtkPlotCanvas *canvas,
                                                             gboolean visible);

`canvas` : |
`visible` : |

### gtk_plot_canvas_grid_set_step ()

    void                gtk_plot_canvas_grid_set_step       (GtkPlotCanvas *canvas,
                                                             gdouble step);

`canvas` : |
`step` : |

### gtk_plot_canvas_grid_set_attributes ()

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

`canvas` : |
`style` : |
`width` : |
`color` : |

### gtk_plot_canvas_cancel_action ()

    void                gtk_plot_canvas_cancel_action       (GtkPlotCanvas *plot_canvas);

`plot_canvas` : |

### gtk_plot_canvas_unselect ()

    void                gtk_plot_canvas_unselect            (GtkPlotCanvas *plot_canvas);

`plot_canvas` : |

### gtk_plot_canvas_get_active_item ()

    GtkPlotCanvasChild * gtk_plot_canvas_get_active_item    (GtkPlotCanvas *canvas);

`canvas` : |
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` : |
`magnification` : |

### gtk_plot_canvas_set_transparent ()

    void                gtk_plot_canvas_set_transparent     (GtkPlotCanvas *canvas,
                                                             gboolean transparent);

`canvas` : |
`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 *background);

`canvas` : |
`background` : |

### gtk_plot_canvas_get_pixel ()

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

`plot_canvas` : |
`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` : |
`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` : |
`child` : |
`x1` : |
`y1` : |
`x2` : |
`y2` : |

### gtk_plot_canvas_remove_child ()

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

`canvas` : |
`child` : |

### gtk_plot_canvas_child_move ()

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

`canvas` : |
`child` : |
`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` : |
`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` : |
`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` : |
`child` : |
`x1` : |
`y1` : |
`x2` : |
`y2` : |
Returns : |

### gtk_plot_canvas_set_line_attributes ()

    void                gtk_plot_canvas_set_line_attributes (GtkPlotCanvas *canvas,
                                                             GtkPlotLine line);

`canvas` : |
`line` : |