SwamiguiCanvasMod

SwamiguiCanvasMod

Synopsis

enum                SwamiguiCanvasModType;
#define             SWAMIGUI_CANVAS_MOD_TYPE_COUNT
enum                SwamiguiCanvasModAxis;
#define             SWAMIGUI_CANVAS_MOD_AXIS_COUNT
enum                SwamiguiCanvasModFlags;
enum                SwamiguiCanvasModActions;
                    SwamiguiCanvasMod;
SwamiguiCanvasMod * swamigui_canvas_mod_new             (void);
void                swamigui_canvas_mod_set_vars        (SwamiguiCanvasMod *mod,
                                                         SwamiguiCanvasModAxis axis,
                                                         SwamiguiCanvasModType type,
                                                         double mult,
                                                         double power,
                                                         double ofs);
void                swamigui_canvas_mod_get_vars        (SwamiguiCanvasMod *mod,
                                                         SwamiguiCanvasModAxis axis,
                                                         SwamiguiCanvasModType type,
                                                         double *mult,
                                                         double *power,
                                                         double *ofs);
gboolean            swamigui_canvas_mod_handle_event    (SwamiguiCanvasMod *mod,
                                                         GdkEvent *event);

Object Hierarchy

  GObject
   +----SwamiguiCanvasMod

Signals

  "snap"                                           : Run First
  "update"                                         : Run First

Description

Details

enum SwamiguiCanvasModType

typedef enum
{
  SWAMIGUI_CANVAS_MOD_SNAP_ZOOM, /* snap line zoom */
  SWAMIGUI_CANVAS_MOD_WHEEL_ZOOM, /* wheel zoom */
  SWAMIGUI_CANVAS_MOD_SNAP_SCROLL, /* snap line scroll */
  SWAMIGUI_CANVAS_MOD_WHEEL_SCROLL /* wheel scroll */
} SwamiguiCanvasModType;

SWAMIGUI_CANVAS_MOD_TYPE_COUNT

#define SWAMIGUI_CANVAS_MOD_TYPE_COUNT 4

enum SwamiguiCanvasModAxis

typedef enum
{
  SWAMIGUI_CANVAS_MOD_X,
  SWAMIGUI_CANVAS_MOD_Y
} SwamiguiCanvasModAxis;

SWAMIGUI_CANVAS_MOD_AXIS_COUNT

#define SWAMIGUI_CANVAS_MOD_AXIS_COUNT 2

enum SwamiguiCanvasModFlags

typedef enum
{
  SWAMIGUI_CANVAS_MOD_ENABLED  = 1 << 0 /* TRUE if modulator is enabled */
} SwamiguiCanvasModFlags;

enum SwamiguiCanvasModActions

typedef enum
{
  SWAMIGUI_CANVAS_MOD_ZOOM_X   = 1 << 0,
  SWAMIGUI_CANVAS_MOD_ZOOM_Y   = 1 << 1,
  SWAMIGUI_CANVAS_MOD_SCROLL_X = 1 << 2,
  SWAMIGUI_CANVAS_MOD_SCROLL_Y = 1 << 3
} SwamiguiCanvasModActions;

SwamiguiCanvasMod

typedef struct _SwamiguiCanvasMod SwamiguiCanvasMod;

swamigui_canvas_mod_new ()

SwamiguiCanvasMod * swamigui_canvas_mod_new             (void);

Create a new canvas zoom/scroll modulator object. This object is used for handling canvas events and intercepting those which apply to zooming or scrolling operations by the user.

Returns :

New canvas modulator object with a refcount of 1 which the caller owns.

swamigui_canvas_mod_set_vars ()

void                swamigui_canvas_mod_set_vars        (SwamiguiCanvasMod *mod,
                                                         SwamiguiCanvasModAxis axis,
                                                         SwamiguiCanvasModType type,
                                                         double mult,
                                                         double power,
                                                         double ofs);

Assigns equation variables for a specific modulator and axis.

mod :

Canvas zoom/scroll modulator

axis :

Axis of variables to assign (X or Y)

type :

Modulator type to assign to (snap zoom, snap scroll, wheel zoom or wheel scroll)

mult :

Multiplier value to assign to equation

power :

Power value to assign to equation

ofs :

Offset value to assign to equation

swamigui_canvas_mod_get_vars ()

void                swamigui_canvas_mod_get_vars        (SwamiguiCanvasMod *mod,
                                                         SwamiguiCanvasModAxis axis,
                                                         SwamiguiCanvasModType type,
                                                         double *mult,
                                                         double *power,
                                                         double *ofs);

Gets equation variables for a specific modulator and axis.

mod :

Canvas zoom/scroll modulator

axis :

Axis of variables to get (X or Y)

type :

Modulator type to get vars from (snap zoom, snap scroll, wheel zoom or wheel scroll)

mult :

Location to store multiplier value of equation or NULL

power :

Location to store power value of equation or NULL

ofs :

Location to store offset value of equation or NULL

swamigui_canvas_mod_handle_event ()

gboolean            swamigui_canvas_mod_handle_event    (SwamiguiCanvasMod *mod,
                                                         GdkEvent *event);

Processes canvas events and handles events related to zoom/scroll actions.

mod :

Canvas zoom/scroll modulator instance

event :

Canvas event to handle

Returns :

TRUE if event was a zoom/scroll related event (was handled), FALSE otherwise

Signal Details

The "snap" signal

void                user_function                      (SwamiguiCanvasMod *swamiguicanvasmod,
                                                        guint              arg1,
                                                        gdouble            arg2,
                                                        gdouble            arg3,
                                                        gpointer           user_data)              : Run First

The "update" signal

void                user_function                      (SwamiguiCanvasMod *swamiguicanvasmod,
                                                        gdouble            arg1,
                                                        gdouble            arg2,
                                                        gdouble            arg3,
                                                        gdouble            arg4,
                                                        gdouble            arg5,
                                                        gdouble            arg6,
                                                        gpointer           user_data)              : Run First