GeglGtkView

GeglGtkView — Widget for displaying a GeglNode

Stability Level

Unstable, unless otherwise indicated

Synopsis

#include <gegl-gtk.h>

GeglGtkView *       gegl_gtk_view_new                   (void);
GeglGtkView *       gegl_gtk_view_new_for_node          (GeglNode *node);
GeglNode *          gegl_gtk_view_get_node              (GeglGtkView *self);
void                gegl_gtk_view_set_node              (GeglGtkView *self,
                                                         GeglNode *node);
float               gegl_gtk_view_get_x                 (GeglGtkView *self);
void                gegl_gtk_view_set_x                 (GeglGtkView *self,
                                                         float x);
float               gegl_gtk_view_get_y                 (GeglGtkView *self);
void                gegl_gtk_view_set_y                 (GeglGtkView *self,
                                                         float y);
float               gegl_gtk_view_get_scale             (GeglGtkView *self);
void                gegl_gtk_view_set_scale             (GeglGtkView *self,
                                                         float scale);
void                gegl_gtk_view_get_transformation    (GeglGtkView *self,
                                                         GeglMatrix3 *matrix);
GeglGtkViewAutoscale gegl_gtk_view_get_autoscale_policy (GeglGtkView *self);
void                gegl_gtk_view_set_autoscale_policy  (GeglGtkView *self,
                                                         GeglGtkViewAutoscale autoscale);
enum                GeglGtkViewAutoscale;

Description

The view widget displays the output of a node in a GEGL graph. It will tracks changes in the node, and will therefore automatically show the correct content when the GEGL graph is changed.

For setting which GeglNode to display, use gegl_gtk_view_set_node(), or use the gegl_gtk_view_new_for_node() convenience constructor.

Transformations:

The widget can show a transformed view of the GeglNode. Scaling and transformations are supported, as well as autoscaling. For manual control over the transformation see methods gegl_gtk_view_set_scale(), gegl_gtk_view_set_x() and gegl_gtk_view_set_y(), or use the corresponding properties. For changing the autoscaling behavior, see gegl_gtk_view_set_autoscale_policy() For getting the effective affine transformation applied, use gegl_gtk_view_get_transformation()

Examples:

In the GEGL-GTK example directories, you can find code examples for how to use GeglGtkView in files with names starting with gegl-gtk-view

Details

gegl_gtk_view_new ()

GeglGtkView *       gegl_gtk_view_new                   (void);

Create a new GeglGtkView

Returns :

New GeglGtkView

gegl_gtk_view_new_for_node ()

GeglGtkView *       gegl_gtk_view_new_for_node          (GeglNode *node);

Create a new GeglGtkView for a given GeglNode

node :

The GeglNode to display

Returns :

New GeglGtkView displaying node

gegl_gtk_view_get_node ()

GeglNode *          gegl_gtk_view_get_node              (GeglGtkView *self);

Get the displayed GeglNode

self :

A GeglGtkView Returns: (transfer none): The GeglNode this widget displays

gegl_gtk_view_set_node ()

void                gegl_gtk_view_set_node              (GeglGtkView *self,
                                                         GeglNode *node);

Change the GeglNode to display

self :

A GeglGtkView

node :

a GeglNode instance or NULL. [transfer full][allow-none]

gegl_gtk_view_get_x ()

float               gegl_gtk_view_get_x                 (GeglGtkView *self);

Getter for the :x property

self :

A GeglGtkView

gegl_gtk_view_set_x ()

void                gegl_gtk_view_set_x                 (GeglGtkView *self,
                                                         float x);

Setter for the :x property

self :

A GeglGtkView

gegl_gtk_view_get_y ()

float               gegl_gtk_view_get_y                 (GeglGtkView *self);

Getter for the :y property

self :

A GeglGtkView

gegl_gtk_view_set_y ()

void                gegl_gtk_view_set_y                 (GeglGtkView *self,
                                                         float y);

Setter for the :y property

self :

A GeglGtkView

gegl_gtk_view_get_scale ()

float               gegl_gtk_view_get_scale             (GeglGtkView *self);

Getter for the :scale property

self :

A GeglGtkView

gegl_gtk_view_set_scale ()

void                gegl_gtk_view_set_scale             (GeglGtkView *self,
                                                         float scale);

Setter for the :scale property

self :

A GeglGtkView

gegl_gtk_view_get_transformation ()

void                gegl_gtk_view_get_transformation    (GeglGtkView *self,
                                                         GeglMatrix3 *matrix);

Get the model->view transformation

The transformation matrix describes the transformation between the model (the output of the GeglNode) and the view (the display in the widget). To transform coordinates use gegl_matrix3_transform_point(). To get a matrix representing the view->model space transformation, use gegl_matrix3_invert()

self :

A GeglGtkView

matrix :

Pointer to location for transformation matrix. [out caller-allocates]

gegl_gtk_view_get_autoscale_policy ()

GeglGtkViewAutoscale gegl_gtk_view_get_autoscale_policy (GeglGtkView *self);

Get the autoscaling policy

self :

A GeglGtkView

Returns :

Current GeglGtkViewAutoscale policy in use

gegl_gtk_view_set_autoscale_policy ()

void                gegl_gtk_view_set_autoscale_policy  (GeglGtkView *self,
                                                         GeglGtkViewAutoscale autoscale);

Set the autoscaling policy

self :

A GeglGtkView

autoscale :

GeglGtkViewAutoscale policy to use

enum GeglGtkViewAutoscale

typedef enum {
    GEGL_GTK_VIEW_AUTOSCALE_DISABLED = 0,
    GEGL_GTK_VIEW_AUTOSCALE_WIDGET,
    GEGL_GTK_VIEW_AUTOSCALE_CONTENT
} GeglGtkViewAutoscale;

Specifies the autoscaling behavior of GeglGtkView.

GEGL_GTK_VIEW_AUTOSCALE_DISABLED

Do not autoscale

GEGL_GTK_VIEW_AUTOSCALE_WIDGET

Automatically scale the widget size

GEGL_GTK_VIEW_AUTOSCALE_CONTENT

Automatically scale content to fit widget