CrZoomer

CrZoomer — A object for setting up box zooming on a CrCanvas widget.

Synopsis

                    CrZoomer;
CrZoomer*           cr_zoomer_new                       (CrCanvas *canvas,
                                                         const gchar *first_arg_name,
                                                         ...);
void                cr_zoomer_activate                  (CrZoomer *zoomer);
void                cr_zoomer_deactivate                (CrZoomer *zoomer);

Object Hierarchy

  GObject
   +----CrZoomer

Properties

  "active"                   gboolean              : Read / Write
  "canvas"                   CrCanvas*             : Read / Write
  "corner-to-corner"         gboolean              : Read / Write
  "cursor"                   gint                  : Read / Write
  "fill-color"               gchar*                : Read / Write
  "fill-color-rgba"          guint                 : Read / Write
  "line-width"               gdouble               : Read / Write
  "maintain-aspect"          gboolean              : Read / Write
  "outline-color"            gchar*                : Read / Write
  "outline-color-rgba"       guint                 : Read / Write

Signals

  "activate"                                       : Run First
  "deactivate"                                     : Run First
  "select"                                         : Run Last

Description

By default "fill-color" and "outline-color" properties are disabled. These should be set at construction time in order to see the zoom box.

Details

CrZoomer

typedef struct _CrZoomer CrZoomer;


cr_zoomer_new ()

CrZoomer*           cr_zoomer_new                       (CrCanvas *canvas,
                                                         const gchar *first_arg_name,
                                                         ...);

A factory to create a CrZoomer object and connect it to a CrCanvas in one step.

canvas :

The canvas widget to operate on.

first_arg_name :

A list of object argument name/value pairs, NULL-terminated, used to configure the item.

... :

Returns :

A newly created CrZoomer object. You must call g_object_unref when finished with it.

cr_zoomer_activate ()

void                cr_zoomer_activate                  (CrZoomer *zoomer);

zoomer :


cr_zoomer_deactivate ()

void                cr_zoomer_deactivate                (CrZoomer *zoomer);

zoomer :

Property Details

The "active" property

  "active"                   gboolean              : Read / Write

Active/Deactivate the zoomer object or check the activation status.

Default value: FALSE


The "canvas" property

  "canvas"                   CrCanvas*             : Read / Write

Reference to CrCanvas widget.


The "corner-to-corner" property

  "corner-to-corner"         gboolean              : Read / Write

If the zoombox should be made by dragging from corner to corner. The default is to drag from the center.

Default value: FALSE


The "cursor" property

  "cursor"                   gint                  : Read / Write

GDK Cursor to use when zoombox is selected.

Allowed values: [0,153]

Default value: 64


The "fill-color" property

  "fill-color"               gchar*                : Read / Write

A string color such as 'red', or '#123456' to be used to fill the zoombox.

Default value: NULL


The "fill-color-rgba" property

  "fill-color-rgba"          guint                 : Read / Write

Zoombox Fill Color RGBA.

Default value: 0


The "line-width" property

  "line-width"               gdouble               : Read / Write

Line width in user units.

Default value: 2


The "maintain-aspect" property

  "maintain-aspect"          gboolean              : Read / Write

If the aspect ratio of the rectangle should match the aspect of the canvas widget.

Default value: TRUE


The "outline-color" property

  "outline-color"            gchar*                : Read / Write

A string color such as 'red', or '#123456' to be used to sroke the zoombox.

Default value: NULL


The "outline-color-rgba" property

  "outline-color-rgba"       guint                 : Read / Write

Zoombox Outline Color RGBA.

Default value: 0

Signal Details

The "activate" signal

void                user_function                      (CrZoomer *zoomer,
                                                        gpointer  user_data)      : Run First

This signal is emitted whenever the zoombox is first activated.

zoomer :

user_data :

user data set when the signal handler was connected.

The "deactivate" signal

void                user_function                      (CrZoomer *zoomer,
                                                        gpointer  user_data)      : Run First

This signal is emitted whenever the zoombox is deactivated. It can be used to get to a callback from a zoombox selection.

zoomer :

user_data :

user data set when the signal handler was connected.

The "select" signal

gboolean            user_function                      (CrZoomer *zoomer,
                                                        gdouble   cx,
                                                        gdouble   cy,
                                                        gdouble   w,
                                                        gdouble   h,
                                                        gpointer  user_data)      : Run Last

This signal is emitted just prior to zooming the canvas. It can be intercepted and used to change the default behavior of the zoomer to possibly do something other than zoom the canvas.

zoomer :

cx :

The selected area center x coordinate.

cy :

The selected area center y coordinate.

w :

The selected area width.

h :

The selected area height.

user_data :

user data set when the signal handler was connected.

Returns :

True to stop the canvas from being zoomed. False to allow the canvas to be zoomed.