GimRrectangleOptions

GimRrectangleOptions

Synopsis

enum                GimpRectangleOptionsProp;
                    GimpRectangleOptions;
struct              GimpRectangleOptionsInterface;
struct              GimpRectangleOptionsPrivate;
#define             GIMP_RECTANGLE_OPTIONS_GET_PRIVATE  (obj)
GtkWidget *         gimp_rectangle_options_gui          (GimpToolOptions *tool_options);
gboolean            gimp_rectangle_options_fixed_rule_active
                                                        (GimpRectangleOptions *rectangle_options,
                                                         GimpRectangleToolFixedRule fixed_rule);
GimpRectangleOptionsPrivate * gimp_rectangle_options_get_private
                                                        (GimpRectangleOptions *options);
void                gimp_rectangle_options_install_properties
                                                        (GObjectClass *klass);
void                gimp_rectangle_options_get_property (GObject *object,
                                                         guint property_id,
                                                         GValue *value,
                                                         GParamSpec *pspec);
void                gimp_rectangle_options_set_property (GObject *object,
                                                         guint property_id,
                                                         const GValue *value,
                                                         GParamSpec *pspec);
GtkWidget *         gimp_rectangle_options_get_width_entry
                                                        (GimpRectangleOptions *rectangle_options);

Object Hierarchy

  GInterface
   +----GimpRectangleOptionsInterface

Prerequisites

GimpRectangleOptionsInterface requires GimpToolOptions.

Known Implementations

GimpRectangleOptionsInterface is implemented by GimpCropOptions, GimpRectangleSelectOptions and GimpTextOptions.

Properties

  "aspect-denominator"       gdouble               : Read / Write / Construct
  "aspect-numerator"         gdouble               : Read / Write / Construct
  "auto-shrink"              gboolean              : Read / Write / Construct
  "default-aspect-denominator" gdouble               : Read / Write / Construct
  "default-aspect-numerator" gdouble               : Read / Write / Construct
  "default-fixed-size-height" gdouble               : Read / Write
  "default-fixed-size-width" gdouble               : Read / Write
  "desired-fixed-height"     gdouble               : Read / Write / Construct
  "desired-fixed-size-height" gdouble               : Read / Write / Construct
  "desired-fixed-size-width" gdouble               : Read / Write / Construct
  "desired-fixed-width"      gdouble               : Read / Write / Construct
  "fixed-center"             gboolean              : Read / Write / Construct
  "fixed-rule"               GimpRectangleToolFixedRule  : Read / Write / Construct
  "fixed-rule-active"        gboolean              : Read / Write / Construct
  "fixed-unit"               GimpUnit              : Read / Write / Construct
  "guide"                    GimpGuidesType        : Read / Write / Construct
  "height"                   gdouble               : Read / Write / Construct
  "overridden-fixed-aspect"  gboolean              : Read / Write / Construct
  "overridden-fixed-size"    gboolean              : Read / Write / Construct
  "position-unit"            GimpUnit              : Read / Write / Construct
  "shrink-merged"            gboolean              : Read / Write / Construct
  "size-unit"                GimpUnit              : Read / Write / Construct
  "use-string-current"       gboolean              : Read / Write
  "width"                    gdouble               : Read / Write / Construct
  "x"                        gdouble               : Read / Write / Construct
  "y"                        gdouble               : Read / Write / Construct

Description

Details

enum GimpRectangleOptionsProp

typedef enum {
  GIMP_RECTANGLE_OPTIONS_PROP_0,

  GIMP_RECTANGLE_OPTIONS_PROP_AUTO_SHRINK,
  GIMP_RECTANGLE_OPTIONS_PROP_SHRINK_MERGED,
  GIMP_RECTANGLE_OPTIONS_PROP_HIGHLIGHT,
  GIMP_RECTANGLE_OPTIONS_PROP_GUIDE,

  GIMP_RECTANGLE_OPTIONS_PROP_X,
  GIMP_RECTANGLE_OPTIONS_PROP_Y,
  GIMP_RECTANGLE_OPTIONS_PROP_WIDTH,
  GIMP_RECTANGLE_OPTIONS_PROP_HEIGHT,
  GIMP_RECTANGLE_OPTIONS_PROP_POSITION_UNIT,
  GIMP_RECTANGLE_OPTIONS_PROP_SIZE_UNIT,

  GIMP_RECTANGLE_OPTIONS_PROP_FIXED_RULE_ACTIVE,
  GIMP_RECTANGLE_OPTIONS_PROP_FIXED_RULE,
  GIMP_RECTANGLE_OPTIONS_PROP_DESIRED_FIXED_WIDTH,
  GIMP_RECTANGLE_OPTIONS_PROP_DESIRED_FIXED_HEIGHT,
  GIMP_RECTANGLE_OPTIONS_PROP_DESIRED_FIXED_SIZE_WIDTH,
  GIMP_RECTANGLE_OPTIONS_PROP_DESIRED_FIXED_SIZE_HEIGHT,
  GIMP_RECTANGLE_OPTIONS_PROP_DEFAULT_FIXED_SIZE_WIDTH,
  GIMP_RECTANGLE_OPTIONS_PROP_DEFAULT_FIXED_SIZE_HEIGHT,
  GIMP_RECTANGLE_OPTIONS_PROP_OVERRIDDEN_FIXED_SIZE,
  GIMP_RECTANGLE_OPTIONS_PROP_ASPECT_NUMERATOR,
  GIMP_RECTANGLE_OPTIONS_PROP_ASPECT_DENOMINATOR,
  GIMP_RECTANGLE_OPTIONS_PROP_DEFAULT_ASPECT_NUMERATOR,
  GIMP_RECTANGLE_OPTIONS_PROP_DEFAULT_ASPECT_DENOMINATOR,
  GIMP_RECTANGLE_OPTIONS_PROP_OVERRIDDEN_FIXED_ASPECT,
  GIMP_RECTANGLE_OPTIONS_PROP_USE_STRING_CURRENT,
  GIMP_RECTANGLE_OPTIONS_PROP_FIXED_UNIT,
  GIMP_RECTANGLE_OPTIONS_PROP_FIXED_CENTER,

  GIMP_RECTANGLE_OPTIONS_PROP_LAST = GIMP_RECTANGLE_OPTIONS_PROP_FIXED_CENTER
} GimpRectangleOptionsProp;

GIMP_RECTANGLE_OPTIONS_PROP_0

GIMP_RECTANGLE_OPTIONS_PROP_AUTO_SHRINK

GIMP_RECTANGLE_OPTIONS_PROP_SHRINK_MERGED

GIMP_RECTANGLE_OPTIONS_PROP_HIGHLIGHT

GIMP_RECTANGLE_OPTIONS_PROP_GUIDE

GIMP_RECTANGLE_OPTIONS_PROP_X

GIMP_RECTANGLE_OPTIONS_PROP_Y

GIMP_RECTANGLE_OPTIONS_PROP_WIDTH

GIMP_RECTANGLE_OPTIONS_PROP_HEIGHT

GIMP_RECTANGLE_OPTIONS_PROP_POSITION_UNIT

GIMP_RECTANGLE_OPTIONS_PROP_SIZE_UNIT

GIMP_RECTANGLE_OPTIONS_PROP_FIXED_RULE_ACTIVE

GIMP_RECTANGLE_OPTIONS_PROP_FIXED_RULE

GIMP_RECTANGLE_OPTIONS_PROP_DESIRED_FIXED_WIDTH

GIMP_RECTANGLE_OPTIONS_PROP_DESIRED_FIXED_HEIGHT

GIMP_RECTANGLE_OPTIONS_PROP_DESIRED_FIXED_SIZE_WIDTH

GIMP_RECTANGLE_OPTIONS_PROP_DESIRED_FIXED_SIZE_HEIGHT

GIMP_RECTANGLE_OPTIONS_PROP_DEFAULT_FIXED_SIZE_WIDTH

GIMP_RECTANGLE_OPTIONS_PROP_DEFAULT_FIXED_SIZE_HEIGHT

GIMP_RECTANGLE_OPTIONS_PROP_OVERRIDDEN_FIXED_SIZE

GIMP_RECTANGLE_OPTIONS_PROP_ASPECT_NUMERATOR

GIMP_RECTANGLE_OPTIONS_PROP_ASPECT_DENOMINATOR

GIMP_RECTANGLE_OPTIONS_PROP_DEFAULT_ASPECT_NUMERATOR

GIMP_RECTANGLE_OPTIONS_PROP_DEFAULT_ASPECT_DENOMINATOR

GIMP_RECTANGLE_OPTIONS_PROP_OVERRIDDEN_FIXED_ASPECT

GIMP_RECTANGLE_OPTIONS_PROP_USE_STRING_CURRENT

GIMP_RECTANGLE_OPTIONS_PROP_FIXED_UNIT

GIMP_RECTANGLE_OPTIONS_PROP_FIXED_CENTER

GIMP_RECTANGLE_OPTIONS_PROP_LAST


GimpRectangleOptions

typedef struct _GimpRectangleOptions GimpRectangleOptions;


struct GimpRectangleOptionsInterface

struct GimpRectangleOptionsInterface;


struct GimpRectangleOptionsPrivate

struct GimpRectangleOptionsPrivate {
  gboolean                    auto_shrink;
  gboolean                    shrink_merged;

  gboolean                    highlight;
  GimpGuidesType              guide;

  gdouble                     x;
  gdouble                     y;
  gdouble                     width;
  gdouble                     height;

  GimpUnit                    position_unit;
  GimpUnit                    size_unit;

  gboolean                    fixed_rule_active;
  GimpRectangleToolFixedRule  fixed_rule;

  gdouble                     desired_fixed_width;
  gdouble                     desired_fixed_height;

  gdouble                     desired_fixed_size_width;
  gdouble                     desired_fixed_size_height;

  gdouble                     default_fixed_size_width;
  gdouble                     default_fixed_size_height;
  gboolean                    overridden_fixed_size;

  gdouble                     aspect_numerator;
  gdouble                     aspect_denominator;

  gdouble                     default_aspect_numerator;
  gdouble                     default_aspect_denominator;
  gboolean                    overridden_fixed_aspect;

  gboolean                    fixed_center;

  /* This gboolean is not part of the actual rectangle tool options,
   * and should be refactored out along with the pointers to widgets.
   */
  gboolean                    use_string_current;

  GimpUnit                    fixed_unit;

  /* options gui */

  GtkWidget                  *auto_shrink_button;

  GtkWidget                  *fixed_width_entry;
  GtkWidget                  *fixed_height_entry;

  GtkWidget                  *fixed_aspect_hbox;
  GtkWidget                  *aspect_button_box;
  GtkListStore               *aspect_history;

  GtkWidget                  *fixed_size_hbox;
  GtkWidget                  *size_button_box;
  GtkListStore               *size_history;

  GtkWidget                  *x_entry;
  GtkWidget                  *y_entry;
  GtkWidget                  *width_entry;
  GtkWidget                  *height_entry;
};


GIMP_RECTANGLE_OPTIONS_GET_PRIVATE()

#define GIMP_RECTANGLE_OPTIONS_GET_PRIVATE(obj)   (gimp_rectangle_options_get_private (GIMP_RECTANGLE_OPTIONS (obj)))


gimp_rectangle_options_gui ()

GtkWidget *         gimp_rectangle_options_gui          (GimpToolOptions *tool_options);


gimp_rectangle_options_fixed_rule_active ()

gboolean            gimp_rectangle_options_fixed_rule_active
                                                        (GimpRectangleOptions *rectangle_options,
                                                         GimpRectangleToolFixedRule fixed_rule);

Returns :

TRUE if fixed_rule is active, FALSE otherwise.

gimp_rectangle_options_get_private ()

GimpRectangleOptionsPrivate * gimp_rectangle_options_get_private
                                                        (GimpRectangleOptions *options);


gimp_rectangle_options_install_properties ()

void                gimp_rectangle_options_install_properties
                                                        (GObjectClass *klass);

Installs the necessary properties for a class implementing GimpRectangleOptions. A GimpRectangleOptionsProp property is installed for each property, using the values from the GimpRectangleOptionsProp enumeration. The caller must make sure itself that the enumeration values don't collide with some other property values they are using (that's what GIMP_RECTANGLE_OPTIONS_PROP_LAST is good for).

klass :

the class structure for a type deriving from GObject

gimp_rectangle_options_get_property ()

void                gimp_rectangle_options_get_property (GObject *object,
                                                         guint property_id,
                                                         GValue *value,
                                                         GParamSpec *pspec);


gimp_rectangle_options_set_property ()

void                gimp_rectangle_options_set_property (GObject *object,
                                                         guint property_id,
                                                         const GValue *value,
                                                         GParamSpec *pspec);


gimp_rectangle_options_get_width_entry ()

GtkWidget *         gimp_rectangle_options_get_width_entry
                                                        (GimpRectangleOptions *rectangle_options);

Returns :

GtkEntry used to enter desired width of rectangle. For testing purposes.

Property Details

The "aspect-denominator" property

  "aspect-denominator"       gdouble               : Read / Write / Construct

Allowed values: [0,262144]

Default value: 1


The "aspect-numerator" property

  "aspect-numerator"         gdouble               : Read / Write / Construct

Allowed values: [0,262144]

Default value: 1


The "auto-shrink" property

  "auto-shrink"              gboolean              : Read / Write / Construct

Automatically shrink to the nearest rectangular shape in a layer.

Default value: FALSE


The "default-aspect-denominator" property

  "default-aspect-denominator" gdouble               : Read / Write / Construct

Allowed values: [0.001,262144]

Default value: 1


The "default-aspect-numerator" property

  "default-aspect-numerator" gdouble               : Read / Write / Construct

Allowed values: [0.001,262144]

Default value: 1


The "default-fixed-size-height" property

  "default-fixed-size-height" gdouble               : Read / Write

Allowed values: [0,262144]

Default value: 100


The "default-fixed-size-width" property

  "default-fixed-size-width" gdouble               : Read / Write

Allowed values: [0,262144]

Default value: 100


The "desired-fixed-height" property

  "desired-fixed-height"     gdouble               : Read / Write / Construct

Custom fixed height.

Allowed values: [0,262144]

Default value: 100


The "desired-fixed-size-height" property

  "desired-fixed-size-height" gdouble               : Read / Write / Construct

Allowed values: [0,262144]

Default value: 100


The "desired-fixed-size-width" property

  "desired-fixed-size-width" gdouble               : Read / Write / Construct

Allowed values: [0,262144]

Default value: 100


The "desired-fixed-width" property

  "desired-fixed-width"      gdouble               : Read / Write / Construct

Custom fixed width.

Allowed values: [0,262144]

Default value: 100


The "fixed-center" property

  "fixed-center"             gboolean              : Read / Write / Construct

Expand selection from center outwards.

Default value: FALSE


The "fixed-rule" property

  "fixed-rule"               GimpRectangleToolFixedRule  : Read / Write / Construct

Choose what has to be locked.

Default value: GIMP_RECTANGLE_TOOL_FIXED_ASPECT


The "fixed-rule-active" property

  "fixed-rule-active"        gboolean              : Read / Write / Construct

Enable lock of aspect ratio, width, height or size.

Default value: FALSE


The "fixed-unit" property

  "fixed-unit"               GimpUnit              : Read / Write / Construct

Unit of fixed width, height or size.

Allowed values: [0,65535]

Default value: 0


The "guide" property

  "guide"                    GimpGuidesType        : Read / Write / Construct

Composition guides such as rule of thirds.

Default value: GIMP_GUIDES_NONE


The "height" property

  "height"                   gdouble               : Read / Write / Construct

Height of selection.

Allowed values: [0,262144]

Default value: 0


The "overridden-fixed-aspect" property

  "overridden-fixed-aspect"  gboolean              : Read / Write / Construct

Default value: FALSE


The "overridden-fixed-size" property

  "overridden-fixed-size"    gboolean              : Read / Write / Construct

Default value: FALSE


The "position-unit" property

  "position-unit"            GimpUnit              : Read / Write / Construct

Unit of top left corner coordinate.

Allowed values: [0,65535]

Default value: 0


The "shrink-merged" property

  "shrink-merged"            gboolean              : Read / Write / Construct

Use all visible layers when shrinking the selection.

Default value: FALSE


The "size-unit" property

  "size-unit"                GimpUnit              : Read / Write / Construct

Unit of selection size.

Allowed values: [0,65535]

Default value: 0


The "use-string-current" property

  "use-string-current"       gboolean              : Read / Write

Default value: FALSE


The "width" property

  "width"                    gdouble               : Read / Write / Construct

Width of selection.

Allowed values: [0,262144]

Default value: 0


The "x" property

  "x"                        gdouble               : Read / Write / Construct

X coordinate of top left corner.

Allowed values: [-262144,262144]

Default value: 0


The "y" property

  "y"                        gdouble               : Read / Write / Construct

Y coordinate of top left corner.

Allowed values: [-262144,262144]

Default value: 0