EllaCanvas

EllaCanvas

Synopsis

#define             ELLA_TYPE_TOOL
                    EllaCanvas;
                    EllaCanvasClass;
                    EllaCanvasPrivate;
enum                EllaTool;
GType               ella_canvas_get_type                (void);
EllaCanvas*         ella_canvas_new                     (void);
EllaCanvas*         ella_canvas_construct               (GType object_type);
void                ella_canvas_remove_selected_item    (EllaCanvas *self);
void                ella_canvas_export_to_png           (EllaCanvas *self);
gboolean            ella_canvas_draw                    (EllaCanvas *self,
                                                         cairo_t *cr);
void                ella_canvas_set_selection_color     (EllaCanvas *self,
                                                         gdouble r,
                                                         gdouble g,
                                                         gdouble b,
                                                         gdouble a);
void                ella_canvas_get_selection_color     (EllaCanvas *self,
                                                         EllaColor *result);
void                ella_canvas_get_selection_stroke_color
                                                        (EllaCanvas *self,
                                                         EllaColor *result);
gdouble             ella_canvas_get_selection_line_width
                                                        (EllaCanvas *self);
void                ella_canvas_set_selection_stroke_color
                                                        (EllaCanvas *self,
                                                         gdouble r,
                                                         gdouble g,
                                                         gdouble b,
                                                         gdouble a);
void                ella_canvas_set_selection_line_width
                                                        (EllaCanvas *self,
                                                         gdouble line_width);
void                ella_canvas_set_selection_text      (EllaCanvas *self,
                                                         const gchar *text);
gchar*              ella_canvas_get_selection_text      (EllaCanvas *self);
gboolean            ella_canvas_is_text_item_selected   (EllaCanvas *self);
void                ella_canvas_change_keyframe         (EllaCanvas *self,
                                                         gint time);
void                ella_canvas_add_keyframe            (EllaCanvas *self,
                                                         gint time);
void                ella_canvas_bump_maxkeyframe        (EllaCanvas *self,
                                                         gint time);
void                ella_canvas_play                    (EllaCanvas *self,
                                                         gint start,
                                                         guint speed);
void                ella_canvas_add_layer               (EllaCanvas *self,
                                                         EllaCommonLayer *layer);
void                ella_canvas_clear_all_layers        (EllaCanvas *self);
void                ella_canvas_import_png              (EllaCanvas *self,
                                                         const gchar *path,
                                                         gdouble x,
                                                         gdouble y);
EllaTool            ella_canvas_get_tool                (EllaCanvas *self);
void                ella_canvas_set_tool                (EllaCanvas *self,
                                                         EllaTool value);
gdouble             ella_canvas_get_page_width          (EllaCanvas *self);
void                ella_canvas_set_page_width          (EllaCanvas *self,
                                                         gdouble value);
gdouble             ella_canvas_get_page_height         (EllaCanvas *self);
void                ella_canvas_set_page_height         (EllaCanvas *self,
                                                         gdouble value);
gdouble             ella_canvas_get_scale               (EllaCanvas *self);
void                ella_canvas_set_scale               (EllaCanvas *self,
                                                         gdouble value);
gdouble             ella_canvas_get_page_color_red      (EllaCanvas *self);
void                ella_canvas_set_page_color_red      (EllaCanvas *self,
                                                         gdouble value);
gdouble             ella_canvas_get_page_color_green    (EllaCanvas *self);
void                ella_canvas_set_page_color_green    (EllaCanvas *self,
                                                         gdouble value);
gdouble             ella_canvas_get_page_color_blue     (EllaCanvas *self);
void                ella_canvas_set_page_color_blue     (EllaCanvas *self,
                                                         gdouble value);

Description

Details

ELLA_TYPE_TOOL

#define             ELLA_TYPE_TOOL

EllaCanvas

typedef struct {
	GtkDrawingArea parent_instance;
	EllaCanvasPrivate * priv;
} EllaCanvas;

EllaCanvasClass

typedef struct {
	GtkDrawingAreaClass parent_class;
} EllaCanvasClass;

EllaCanvasPrivate

typedef struct _EllaCanvasPrivate EllaCanvasPrivate;

enum EllaTool

typedef enum  {
	ELLA_TOOL_RECTANGLE,
	ELLA_TOOL_SELECT,
	ELLA_TOOL_CIRCLE,
	ELLA_TOOL_LINE,
	ELLA_TOOL_PATH,
	ELLA_TOOL_TEXT,
	ELLA_TOOL_IMAGE
} EllaTool;

The differents tool that the canvas can use. They can be used in the canvas with the ella_canvas_get_tool and ella_canvas_set_tool functions.


ella_canvas_get_type ()

GType               ella_canvas_get_type                (void);

For internal use only, forget that.


ella_canvas_new ()

EllaCanvas*         ella_canvas_new                     (void);

Create a new EllaCanvas widget. It is derivated from a GtkDrawingArea.


ella_canvas_construct ()

EllaCanvas*         ella_canvas_construct               (GType object_type);

For internal use only, forget that.


ella_canvas_remove_selected_item ()

void                ella_canvas_remove_selected_item    (EllaCanvas *self);

ella_canvas_export_to_png ()

void                ella_canvas_export_to_png           (EllaCanvas *self);

ella_canvas_draw ()

gboolean            ella_canvas_draw                    (EllaCanvas *self,
                                                         cairo_t *cr);

ella_canvas_set_selection_color ()

void                ella_canvas_set_selection_color     (EllaCanvas *self,
                                                         gdouble r,
                                                         gdouble g,
                                                         gdouble b,
                                                         gdouble a);

Set the color selection.

Set the color of all the items of the current selection.

r :

red channel, between 0.0 and 1.0

g :

red channel, between 0.0 and 1.0

b :

red channel, between 0.0 and 1.0

a :

alpha channel, between 0.0 and 1.0

ella_canvas_get_selection_color ()

void                ella_canvas_get_selection_color     (EllaCanvas *self,
                                                         EllaColor *result);

ella_canvas_get_selection_stroke_color ()

void                ella_canvas_get_selection_stroke_color
                                                        (EllaCanvas *self,
                                                         EllaColor *result);

ella_canvas_get_selection_line_width ()

gdouble             ella_canvas_get_selection_line_width
                                                        (EllaCanvas *self);

ella_canvas_set_selection_stroke_color ()

void                ella_canvas_set_selection_stroke_color
                                                        (EllaCanvas *self,
                                                         gdouble r,
                                                         gdouble g,
                                                         gdouble b,
                                                         gdouble a);

ella_canvas_set_selection_line_width ()

void                ella_canvas_set_selection_line_width
                                                        (EllaCanvas *self,
                                                         gdouble line_width);

ella_canvas_set_selection_text ()

void                ella_canvas_set_selection_text      (EllaCanvas *self,
                                                         const gchar *text);

ella_canvas_get_selection_text ()

gchar*              ella_canvas_get_selection_text      (EllaCanvas *self);

ella_canvas_is_text_item_selected ()

gboolean            ella_canvas_is_text_item_selected   (EllaCanvas *self);

ella_canvas_change_keyframe ()

void                ella_canvas_change_keyframe         (EllaCanvas *self,
                                                         gint time);

ella_canvas_add_keyframe ()

void                ella_canvas_add_keyframe            (EllaCanvas *self,
                                                         gint time);

ella_canvas_bump_maxkeyframe ()

void                ella_canvas_bump_maxkeyframe        (EllaCanvas *self,
                                                         gint time);

ella_canvas_play ()

void                ella_canvas_play                    (EllaCanvas *self,
                                                         gint start,
                                                         guint speed);

ella_canvas_add_layer ()

void                ella_canvas_add_layer               (EllaCanvas *self,
                                                         EllaCommonLayer *layer);

ella_canvas_clear_all_layers ()

void                ella_canvas_clear_all_layers        (EllaCanvas *self);

ella_canvas_import_png ()

void                ella_canvas_import_png              (EllaCanvas *self,
                                                         const gchar *path,
                                                         gdouble x,
                                                         gdouble y);

ella_canvas_get_tool ()

EllaTool            ella_canvas_get_tool                (EllaCanvas *self);

ella_canvas_set_tool ()

void                ella_canvas_set_tool                (EllaCanvas *self,
                                                         EllaTool value);

ella_canvas_get_page_width ()

gdouble             ella_canvas_get_page_width          (EllaCanvas *self);

ella_canvas_set_page_width ()

void                ella_canvas_set_page_width          (EllaCanvas *self,
                                                         gdouble value);

ella_canvas_get_page_height ()

gdouble             ella_canvas_get_page_height         (EllaCanvas *self);

ella_canvas_set_page_height ()

void                ella_canvas_set_page_height         (EllaCanvas *self,
                                                         gdouble value);

ella_canvas_get_scale ()

gdouble             ella_canvas_get_scale               (EllaCanvas *self);

ella_canvas_set_scale ()

void                ella_canvas_set_scale               (EllaCanvas *self,
                                                         gdouble value);

This is the scale/zoom level of the canvas, just change it to make a zoom out/zoom in.

Scaling.

value :

the new scale value, it is absolute.

self :

a EllaCanvas widget.

ella_canvas_get_page_color_red ()

gdouble             ella_canvas_get_page_color_red      (EllaCanvas *self);

ella_canvas_set_page_color_red ()

void                ella_canvas_set_page_color_red      (EllaCanvas *self,
                                                         gdouble value);

ella_canvas_get_page_color_green ()

gdouble             ella_canvas_get_page_color_green    (EllaCanvas *self);

ella_canvas_set_page_color_green ()

void                ella_canvas_set_page_color_green    (EllaCanvas *self,
                                                         gdouble value);

ella_canvas_get_page_color_blue ()

gdouble             ella_canvas_get_page_color_blue     (EllaCanvas *self);

ella_canvas_set_page_color_blue ()

void                ella_canvas_set_page_color_blue     (EllaCanvas *self,
                                                         gdouble value);