Commit eeec3ced authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

Added object properties for almost all tool_options values and registered

2003-02-07  Michael Natterer  <mitch@gimp.org>

	Added object properties for almost all tool_options values
	and registered lots of enums with the type system:

	Part I (enum and type cleanup):

	* app/core/core-enums.[ch]
	* app/core/core-types.h: removed InternalOrientaionType and
	register GimpOrientationType. Register GimpChannelOps.
	Removed GimpToolOptionsGUIFunc.

	* app/xcf/xcf-private.h: added XcfOrientationType with the
	same values as the old InternalOrientationType

	* app/xcf/xcf-load.c
	* app/xcf/xcf-save.c: translate between GimpOrientationType and
	XcfOrientationType.

	* app/core/gimpdrawable-transform-utils.[ch]
	* app/core/gimpdrawable-transform.[ch]
	* app/core/gimpimage-crop.c
	* app/core/gimpimage-duplicate.c
	* app/core/gimpimage-guides.c
	* app/core/gimpimage-resize.c
	* app/core/gimpimage-scale.c
	* app/core/gimpimage.h
	* app/display/gimpdisplayshell.c
	* tools/pdbgen/stddefs.pdb
	* tools/pdbgen/pdb/transform_tools.pdb: changed accordingly.

	* app/pdb/guides_cmds.c
	* app/pdb/transform_tools_cmds.c
	* libgimp/gimpenums.h
	* libgimpproxy/gimpproxytypes.h
	* plug-ins/script-fu/script-fu-constants.c
	* tools/pdbgen/enums.pl: regenerated.

	* libgimptool/gimptoolenums.[ch]: added GimpTransformGridType.

	* libgimptool/gimptooltypes.h: removed GimpToolOptionsResetFunc,
	added GimpToolOptionsGUIFunc.

	Part II (tool options changes):

	* app/config/gimpconfig-utils.c (gimp_config_reset_properties):
	don't reset object properties because they have NULL as default
	value.

	* app/widgets/gimppropwidgets.[ch]: added
	gimp_prop_[enum|boolean]_radio_frame_new(),
	gimp_prop_paint_mode_menu_new() and gimp_prop_scale_entry_new(),
	which are all needed by the new tool options GUI code.

	* app/tools/tool_options.[ch]: removed the "reset_func" since
	the virtual reset() method is used now.

	* app/paint/gimpairbrushoptions.[ch]
	* app/paint/gimpcloneoptions.[ch]
	* app/paint/gimpconvolveoptions.[ch]
	* app/paint/gimpdodgeburnoptions.[ch]
	* app/paint/gimperaseroptions.[ch]
	* app/paint/gimppaintoptions.[ch]
	* app/paint/gimpsmudgeoptions.[ch]: added properties all over the
	place and removed the widget and default_value members from
	the structs. Renamed some values (e.g. s/type/clone_type/).
	Don't #include <gtk/gtk.h>.

	* app/paint/gimpairbrush.c
	* app/paint/gimpclone.c
	* app/paint/gimpconvolve.c
	* app/paint/gimpdodgeburn.c
	* app/paint/gimperaser.c
	* app/paint/gimppaintbrush.c
	* app/paint/gimppaintcore-stroke.c
	* app/paint/gimppaintcore.c
	* app/paint/gimppencil.c
	* app/paint/gimpsmudge.c
	* app/paint/paint-types.h
	* app/paint/paint.c: changed accordingly. Don't #include <gtk/gtk.h>.

	* tools/pdbgen/pdb/paint_tools.pdb: changed accordingly.

	* app/pdb/paint_tools_cmds.c: regenerated.

	* app/tools/gimpblendoptions.[ch]
	* app/tools/gimpbucketfilloptions.[ch]
	* app/tools/gimpcolorpickeroptions.[ch]
	* app/tools/gimpcropoptions.[ch]
	* app/tools/gimpflipoptions.[ch]
	* app/tools/gimpinkoptions.c
	* app/tools/gimpmagnifyoptions.[ch]
	* app/tools/gimpmeasureoptions.[ch]
	* app/tools/gimpmoveoptions.[ch]
	* app/tools/gimptextoptions.c
	* app/tools/paint_options.[ch]
	* app/tools/selection_options.[ch]
	* app/tools/transform_options.[ch]: ditto: added properties and
	removed widget and default_value stuff. Removed most reset functions.
	Use gimp_prop widgets all over the place, renamed some values
	as above.

	* app/tools/Makefile.am
	* app/tools/gimpairbrushtool.c
	* app/tools/gimpblendtool.c
	* app/tools/gimpbucketfilltool.c
	* app/tools/gimpbycolorselecttool.c
	* app/tools/gimpclonetool.c
	* app/tools/gimpconvolvetool.c
	* app/tools/gimpcroptool.c
	* app/tools/gimpdodgeburntool.c
	* app/tools/gimperasertool.c
	* app/tools/gimpfliptool.c
	* app/tools/gimpfuzzyselecttool.c
	* app/tools/gimpmagnifytool.c
	* app/tools/gimpmovetool.c
	* app/tools/gimpselectiontool.c
	* app/tools/gimpsheartool.c
	* app/tools/gimpsmudgetool.c
	* app/tools/gimptransformtool.c
	* app/tools/gimpvectoroptions.c: changed accordingly. Ported
	the paint_options GUI constructors to gimp_prop widgets.

	* app/widgets/gimpselectioneditor.c
	* app/gui/tool-options-dialog.c: changed accordingly.
parent faf90e22
2003-02-07 Michael Natterer <mitch@gimp.org>
Added object properties for almost all tool_options values
and registered lots of enums with the type system:
Part I (enum and type cleanup):
* app/core/core-enums.[ch]
* app/core/core-types.h: removed InternalOrientaionType and
register GimpOrientationType. Register GimpChannelOps.
Removed GimpToolOptionsGUIFunc.
* app/xcf/xcf-private.h: added XcfOrientationType with the
same values as the old InternalOrientationType
* app/xcf/xcf-load.c
* app/xcf/xcf-save.c: translate between GimpOrientationType and
XcfOrientationType.
* app/core/gimpdrawable-transform-utils.[ch]
* app/core/gimpdrawable-transform.[ch]
* app/core/gimpimage-crop.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-guides.c
* app/core/gimpimage-resize.c
* app/core/gimpimage-scale.c
* app/core/gimpimage.h
* app/display/gimpdisplayshell.c
* tools/pdbgen/stddefs.pdb
* tools/pdbgen/pdb/transform_tools.pdb: changed accordingly.
* app/pdb/guides_cmds.c
* app/pdb/transform_tools_cmds.c
* libgimp/gimpenums.h
* libgimpproxy/gimpproxytypes.h
* plug-ins/script-fu/script-fu-constants.c
* tools/pdbgen/enums.pl: regenerated.
* libgimptool/gimptoolenums.[ch]: added GimpTransformGridType.
* libgimptool/gimptooltypes.h: removed GimpToolOptionsResetFunc,
added GimpToolOptionsGUIFunc.
Part II (tool options changes):
* app/config/gimpconfig-utils.c (gimp_config_reset_properties):
don't reset object properties because they have NULL as default
value.
* app/widgets/gimppropwidgets.[ch]: added
gimp_prop_[enum|boolean]_radio_frame_new(),
gimp_prop_paint_mode_menu_new() and gimp_prop_scale_entry_new(),
which are all needed by the new tool options GUI code.
* app/tools/tool_options.[ch]: removed the "reset_func" since
the virtual reset() method is used now.
* app/paint/gimpairbrushoptions.[ch]
* app/paint/gimpcloneoptions.[ch]
* app/paint/gimpconvolveoptions.[ch]
* app/paint/gimpdodgeburnoptions.[ch]
* app/paint/gimperaseroptions.[ch]
* app/paint/gimppaintoptions.[ch]
* app/paint/gimpsmudgeoptions.[ch]: added properties all over the
place and removed the widget and default_value members from
the structs. Renamed some values (e.g. s/type/clone_type/).
Don't #include <gtk/gtk.h>.
* app/paint/gimpairbrush.c
* app/paint/gimpclone.c
* app/paint/gimpconvolve.c
* app/paint/gimpdodgeburn.c
* app/paint/gimperaser.c
* app/paint/gimppaintbrush.c
* app/paint/gimppaintcore-stroke.c
* app/paint/gimppaintcore.c
* app/paint/gimppencil.c
* app/paint/gimpsmudge.c
* app/paint/paint-types.h
* app/paint/paint.c: changed accordingly. Don't #include <gtk/gtk.h>.
* tools/pdbgen/pdb/paint_tools.pdb: changed accordingly.
* app/pdb/paint_tools_cmds.c: regenerated.
* app/tools/gimpblendoptions.[ch]
* app/tools/gimpbucketfilloptions.[ch]
* app/tools/gimpcolorpickeroptions.[ch]
* app/tools/gimpcropoptions.[ch]
* app/tools/gimpflipoptions.[ch]
* app/tools/gimpinkoptions.c
* app/tools/gimpmagnifyoptions.[ch]
* app/tools/gimpmeasureoptions.[ch]
* app/tools/gimpmoveoptions.[ch]
* app/tools/gimptextoptions.c
* app/tools/paint_options.[ch]
* app/tools/selection_options.[ch]
* app/tools/transform_options.[ch]: ditto: added properties and
removed widget and default_value stuff. Removed most reset functions.
Use gimp_prop widgets all over the place, renamed some values
as above.
* app/tools/Makefile.am
* app/tools/gimpairbrushtool.c
* app/tools/gimpblendtool.c
* app/tools/gimpbucketfilltool.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpclonetool.c
* app/tools/gimpconvolvetool.c
* app/tools/gimpcroptool.c
* app/tools/gimpdodgeburntool.c
* app/tools/gimperasertool.c
* app/tools/gimpfliptool.c
* app/tools/gimpfuzzyselecttool.c
* app/tools/gimpmagnifytool.c
* app/tools/gimpmovetool.c
* app/tools/gimpselectiontool.c
* app/tools/gimpsheartool.c
* app/tools/gimpsmudgetool.c
* app/tools/gimptransformtool.c
* app/tools/gimpvectoroptions.c: changed accordingly. Ported
the paint_options GUI constructors to gimp_prop widgets.
* app/widgets/gimpselectioneditor.c
* app/gui/tool-options-dialog.c: changed accordingly.
2003-02-07 Sven Neumann <sven@gimp.org>
* app/text/gimptextlayer.c
......
......@@ -140,7 +140,8 @@ gimp_config_reset_properties (GObject *object)
prop_spec = property_specs[i];
if (prop_spec->flags & G_PARAM_WRITABLE)
if ((prop_spec->flags & G_PARAM_WRITABLE) &&
! G_IS_PARAM_SPEC_OBJECT (prop_spec))
{
GValue value = { 0, };
......
......@@ -8,6 +8,26 @@
/* enumerations from "./core-enums.h" */
static const GEnumValue gimp_orientation_type_enum_values[] =
{
{ GIMP_HORIZONTAL, N_("Horizontal"), "horizontal" },
{ GIMP_VERTICAL, N_("Vertical"), "vertical" },
{ GIMP_UNKNOWN, N_("Unknown"), "unknown" },
{ 0, NULL, NULL }
};
GType
gimp_orientation_type_get_type (void)
{
static GType enum_type = 0;
if (!enum_type)
enum_type = g_enum_register_static ("GimpOrientationType", gimp_orientation_type_enum_values);
return enum_type;
}
static const GEnumValue gimp_blend_mode_enum_values[] =
{
{ GIMP_FG_BG_RGB_MODE, N_("FG to BG (RGB)"), "fg-bg-rgb-mode" },
......@@ -323,10 +343,10 @@ gimp_transform_direction_get_type (void)
static const GEnumValue gimp_channel_ops_enum_values[] =
{
{ GIMP_CHANNEL_OP_ADD, "GIMP_CHANNEL_OP_ADD", "add" },
{ GIMP_CHANNEL_OP_SUBTRACT, "GIMP_CHANNEL_OP_SUBTRACT", "subtract" },
{ GIMP_CHANNEL_OP_REPLACE, "GIMP_CHANNEL_OP_REPLACE", "replace" },
{ GIMP_CHANNEL_OP_INTERSECT, "GIMP_CHANNEL_OP_INTERSECT", "intersect" },
{ GIMP_CHANNEL_OP_ADD, N_("Add to the current selection"), "add" },
{ GIMP_CHANNEL_OP_SUBTRACT, N_("Subtract from the current selection"), "subtract" },
{ GIMP_CHANNEL_OP_REPLACE, N_("Replace the current selection"), "replace" },
{ GIMP_CHANNEL_OP_INTERSECT, N_("Intersect with the current selection"), "intersect" },
{ 0, NULL, NULL }
};
......
......@@ -40,6 +40,22 @@
* these enums that are registered with the type system
*/
#define GIMP_TYPE_ORIENTATION_TYPE (gimp_orientation_type_get_type ())
GType gimp_orientation_type_get_type (void) G_GNUC_CONST;
typedef enum
{
GIMP_HORIZONTAL, /*< desc="Horizontal" >*/
GIMP_VERTICAL, /*< desc="Vertical" >*/
GIMP_UNKNOWN /*< desc="Unknown" >*/
} GimpOrientationType;
#define GIMP_ORIENTATION_HORIZONTAL GIMP_HORIZONTAL
#define GIMP_ORIENTATION_VERTICAL GIMP_VERTICAL
#define GIMP_ORIENTATION_UNKNOWN GIMP_UNKNOWN
#define GIMP_TYPE_BLEND_MODE (gimp_blend_mode_get_type ())
GType gimp_blend_mode_get_type (void) G_GNUC_CONST;
......@@ -242,18 +258,23 @@ typedef enum /*< pdb-skip >*/
} GimpTransformDirection;
/*
* non-registered enums; register them if needed
*/
#define GIMP_TYPE_CHANNEL_OPS (gimp_channel_ops_get_type ())
typedef enum /*< proxy-resume >*/ /*< skip >*/
GType gimp_channel_ops_get_type (void) G_GNUC_CONST;
typedef enum /*< proxy-resume >*/
{
GIMP_CHANNEL_OP_ADD,
GIMP_CHANNEL_OP_SUBTRACT,
GIMP_CHANNEL_OP_REPLACE,
GIMP_CHANNEL_OP_INTERSECT
GIMP_CHANNEL_OP_ADD, /*< desc="Add to the current selection" >*/
GIMP_CHANNEL_OP_SUBTRACT, /*< desc="Subtract from the current selection" >*/
GIMP_CHANNEL_OP_REPLACE, /*< desc="Replace the current selection" >*/
GIMP_CHANNEL_OP_INTERSECT /*< desc="Intersect with the current selection" >*/
} GimpChannelOps;
/*
* non-registered enums; register them if needed
*/
typedef enum /*< proxy-skip >*/ /*< skip >*/
{
GIMP_MAKE_PALETTE,
......
......@@ -38,20 +38,6 @@
/* enums */
typedef enum
{
HORIZONTAL,
VERTICAL,
UNKNOWN
} OrientationType;
typedef enum /*< pdb-skip >*/
{
ORIENTATION_UNKNOWN,
ORIENTATION_HORIZONTAL,
ORIENTATION_VERTICAL
} InternalOrientationType;
typedef enum
{
GIMP_PIXELS,
......@@ -123,6 +109,7 @@ typedef struct _GimpBuffer GimpBuffer;
typedef struct _GimpPaintInfo GimpPaintInfo;
typedef struct _GimpToolInfo GimpToolInfo; /*< proxy-include >*/
typedef struct _GimpToolOptions GimpToolOptions; /*< proxy-include >*/
typedef struct _GimpImagefile GimpImagefile;
typedef struct _GimpDocumentList GimpDocumentList;
......@@ -189,13 +176,6 @@ typedef struct _Path Path;
typedef struct _PathPoint PathPoint;
typedef struct _PathList PathList;
/* stuff which is forward declared here so we don't need to cross-include it
*/
typedef struct _GimpToolOptions GimpToolOptions; /*< proxy-include >*/
typedef void (* GimpToolOptionsGUIFunc) (GimpToolOptions *tool_options); /*< proxy-include >*/
/* functions */
......
......@@ -531,9 +531,9 @@ gimp_drawable_transform_tiles_affine (GimpDrawable *drawable,
}
TileManager *
gimp_drawable_transform_tiles_flip (GimpDrawable *drawable,
TileManager *orig,
InternalOrientationType flip_type)
gimp_drawable_transform_tiles_flip (GimpDrawable *drawable,
TileManager *orig,
GimpOrientationType flip_type)
{
TileManager *new;
PixelRegion srcPR, destPR;
......@@ -554,7 +554,7 @@ gimp_drawable_transform_tiles_flip (GimpDrawable *drawable,
new = tile_manager_new (orig_width, orig_height, orig_bpp);
tile_manager_set_offsets (new, orig_x, orig_y);
if (flip_type == ORIENTATION_HORIZONTAL)
if (flip_type == GIMP_ORIENTATION_HORIZONTAL)
{
for (i = 0; i < orig_width; i++)
{
......@@ -583,7 +583,7 @@ gimp_drawable_transform_tiles_flip (GimpDrawable *drawable,
/* Note that the undo structures etc are setup before we enter this
* function.
*/
if (flip_type == ORIENTATION_HORIZONTAL)
if (flip_type == GIMP_ORIENTATION_HORIZONTAL)
path_transform_flip_horz (gimage);
else
path_transform_flip_vert (gimage);
......@@ -643,8 +643,8 @@ gimp_drawable_transform_affine (GimpDrawable *drawable,
}
gboolean
gimp_drawable_transform_flip (GimpDrawable *drawable,
InternalOrientationType flip_type)
gimp_drawable_transform_flip (GimpDrawable *drawable,
GimpOrientationType flip_type)
{
GimpImage *gimage;
TileManager *float_tiles;
......
......@@ -88,13 +88,13 @@ gimp_drawable_transform_matrix_scale (gint x1,
}
void
gimp_drawable_transform_matrix_shear (gint x1,
gint y1,
gint x2,
gint y2,
InternalOrientationType orientation,
gdouble amount,
GimpMatrix3 result)
gimp_drawable_transform_matrix_shear (gint x1,
gint y1,
gint x2,
gint y2,
GimpOrientationType orientation,
gdouble amount,
GimpMatrix3 result)
{
gint width;
gint height;
......@@ -115,7 +115,7 @@ gimp_drawable_transform_matrix_shear (gint x1,
gimp_matrix3_identity (result);
gimp_matrix3_translate (result, -cx, -cy);
if (orientation == ORIENTATION_HORIZONTAL)
if (orientation == GIMP_ORIENTATION_HORIZONTAL)
gimp_matrix3_xshear (result, amount / height);
else
gimp_matrix3_yshear (result, amount / width);
......
......@@ -43,7 +43,7 @@ void gimp_drawable_transform_matrix_shear (gint x1,
gint y1,
gint x2,
gint y2,
InternalOrientationType orientation,
GimpOrientationType orientation,
gdouble amount,
GimpMatrix3 result);
void gimp_drawable_transform_matrix_perspective (gint x1,
......
......@@ -88,13 +88,13 @@ gimp_drawable_transform_matrix_scale (gint x1,
}
void
gimp_drawable_transform_matrix_shear (gint x1,
gint y1,
gint x2,
gint y2,
InternalOrientationType orientation,
gdouble amount,
GimpMatrix3 result)
gimp_drawable_transform_matrix_shear (gint x1,
gint y1,
gint x2,
gint y2,
GimpOrientationType orientation,
gdouble amount,
GimpMatrix3 result)
{
gint width;
gint height;
......@@ -115,7 +115,7 @@ gimp_drawable_transform_matrix_shear (gint x1,
gimp_matrix3_identity (result);
gimp_matrix3_translate (result, -cx, -cy);
if (orientation == ORIENTATION_HORIZONTAL)
if (orientation == GIMP_ORIENTATION_HORIZONTAL)
gimp_matrix3_xshear (result, amount / height);
else
gimp_matrix3_yshear (result, amount / width);
......
......@@ -43,7 +43,7 @@ void gimp_drawable_transform_matrix_shear (gint x1,
gint y1,
gint x2,
gint y2,
InternalOrientationType orientation,
GimpOrientationType orientation,
gdouble amount,
GimpMatrix3 result);
void gimp_drawable_transform_matrix_perspective (gint x1,
......
......@@ -531,9 +531,9 @@ gimp_drawable_transform_tiles_affine (GimpDrawable *drawable,
}
TileManager *
gimp_drawable_transform_tiles_flip (GimpDrawable *drawable,
TileManager *orig,
InternalOrientationType flip_type)
gimp_drawable_transform_tiles_flip (GimpDrawable *drawable,
TileManager *orig,
GimpOrientationType flip_type)
{
TileManager *new;
PixelRegion srcPR, destPR;
......@@ -554,7 +554,7 @@ gimp_drawable_transform_tiles_flip (GimpDrawable *drawable,
new = tile_manager_new (orig_width, orig_height, orig_bpp);
tile_manager_set_offsets (new, orig_x, orig_y);
if (flip_type == ORIENTATION_HORIZONTAL)
if (flip_type == GIMP_ORIENTATION_HORIZONTAL)
{
for (i = 0; i < orig_width; i++)
{
......@@ -583,7 +583,7 @@ gimp_drawable_transform_tiles_flip (GimpDrawable *drawable,
/* Note that the undo structures etc are setup before we enter this
* function.
*/
if (flip_type == ORIENTATION_HORIZONTAL)
if (flip_type == GIMP_ORIENTATION_HORIZONTAL)
path_transform_flip_horz (gimage);
else
path_transform_flip_vert (gimage);
......@@ -643,8 +643,8 @@ gimp_drawable_transform_affine (GimpDrawable *drawable,
}
gboolean
gimp_drawable_transform_flip (GimpDrawable *drawable,
InternalOrientationType flip_type)
gimp_drawable_transform_flip (GimpDrawable *drawable,
GimpOrientationType flip_type)
{
GimpImage *gimage;
TileManager *float_tiles;
......
......@@ -43,7 +43,7 @@ TileManager * gimp_drawable_transform_tiles_affine (GimpDrawable *drawable,
gpointer progress_data);
TileManager * gimp_drawable_transform_tiles_flip (GimpDrawable *drawable,
TileManager *orig,
InternalOrientationType flip_type);
GimpOrientationType flip_type);
gboolean gimp_drawable_transform_affine (GimpDrawable *drawable,
GimpInterpolationType interpolation_type,
......@@ -51,7 +51,7 @@ gboolean gimp_drawable_transform_affine (GimpDrawable *drawable,
GimpMatrix3 matrix,
GimpTransformDirection direction);
gboolean gimp_drawable_transform_flip (GimpDrawable *drawable,
InternalOrientationType flip_type);
GimpOrientationType flip_type);
TileManager * gimp_drawable_transform_cut (GimpDrawable *drawable,
......
......@@ -409,12 +409,12 @@ gimp_image_crop_adjust_guides (GimpImage *gimage,
switch (guide->orientation)
{
case ORIENTATION_HORIZONTAL:
case GIMP_ORIENTATION_HORIZONTAL:
if ((guide->position < y1) || (guide->position > y2))
remove_guide = TRUE;
break;
case ORIENTATION_VERTICAL:
case GIMP_ORIENTATION_VERTICAL:
if ((guide->position < x1) || (guide->position > x2))
remove_guide = TRUE;
break;
......@@ -430,14 +430,10 @@ gimp_image_crop_adjust_guides (GimpImage *gimage,
}
else
{
if (guide->orientation == ORIENTATION_HORIZONTAL)
{
guide->position -= y1 ;
}
if (guide->orientation == GIMP_ORIENTATION_HORIZONTAL)
guide->position -= y1;
else
{
guide->position -= x1;
}
guide->position -= x1;
}
}
}
......
......@@ -197,14 +197,16 @@ gimp_image_duplicate (GimpImage *gimage)
switch (guide->orientation)
{
case ORIENTATION_HORIZONTAL:
case GIMP_ORIENTATION_HORIZONTAL:
new_guide = gimp_image_add_hguide (new_gimage);
new_guide->position = guide->position;
break;
case ORIENTATION_VERTICAL:
case GIMP_ORIENTATION_VERTICAL:
new_guide = gimp_image_add_vguide (new_gimage);
new_guide->position = guide->position;
break;
default:
g_error ("Unknown guide orientation.\n");
}
......
......@@ -46,7 +46,7 @@ gimp_image_add_hguide (GimpImage *gimage)
guide->ref_count = 0;
guide->position = -1;
guide->guide_ID = gimage->gimp->next_guide_ID++;
guide->orientation = ORIENTATION_HORIZONTAL;
guide->orientation = GIMP_ORIENTATION_HORIZONTAL;
gimage->guides = g_list_prepend (gimage->guides, guide);
......@@ -65,7 +65,7 @@ gimp_image_add_vguide (GimpImage *gimage)
guide->ref_count = 0;
guide->position = -1;
guide->guide_ID = gimage->gimp->next_guide_ID++;
guide->orientation = ORIENTATION_VERTICAL;
guide->orientation = GIMP_ORIENTATION_VERTICAL;
gimage->guides = g_list_prepend (gimage->guides, guide);
......@@ -130,12 +130,12 @@ gimp_image_find_guide (GimpImage *gimage,
switch (guide->orientation)
{
case ORIENTATION_HORIZONTAL:
case GIMP_ORIENTATION_HORIZONTAL:
if (ABS (guide->position - y) < GUIDE_EPSILON)
return guide;
break;
case ORIENTATION_VERTICAL:
case GIMP_ORIENTATION_VERTICAL:
if (ABS (guide->position - x) < GUIDE_EPSILON)
return guide;
break;
......@@ -183,7 +183,7 @@ gimp_image_snap_point (GimpImage *gimage,
switch (guide->orientation)
{
case ORIENTATION_HORIZONTAL:
case GIMP_ORIENTATION_HORIZONTAL:
dist = ABS (guide->position - y);
if (dist < MIN (GUIDE_EPSILON, minydist))
......@@ -194,7 +194,7 @@ gimp_image_snap_point (GimpImage *gimage,
}
break;
case ORIENTATION_VERTICAL:
case GIMP_ORIENTATION_VERTICAL:
dist = ABS (guide->position - x);
if (dist < MIN (GUIDE_EPSILON, minxdist))
......
......@@ -91,14 +91,14 @@ gimp_image_resize (GimpImage *gimage,
switch (guide->orientation)
{
case ORIENTATION_HORIZONTAL:
case GIMP_ORIENTATION_HORIZONTAL:
undo_push_image_guide (gimage, guide);
guide->position += offset_y;
if (guide->position < 0 || guide->position > new_height)
gimp_image_delete_guide (gimage, guide);
break;
case ORIENTATION_VERTICAL:
case GIMP_ORIENTATION_VERTICAL:
undo_push_image_guide (gimage, guide);
guide->position += offset_x;
if (guide->position < 0 || guide->position > new_width)
......
......@@ -157,14 +157,16 @@ gimp_image_scale (GimpImage *gimage,
switch (guide->orientation)
{
case ORIENTATION_HORIZONTAL:
case GIMP_ORIENTATION_HORIZONTAL:
undo_push_image_guide (gimage, guide);
guide->position = (guide->position * new_height) / old_height;
break;
case ORIENTATION_VERTICAL:
case GIMP_ORIENTATION_VERTICAL:
undo_push_image_guide (gimage, guide);
guide->position = (guide->position * new_width) / old_width;
break;
default:
g_error("Unknown guide orientation II.\n");
}
......
......@@ -71,10 +71,10 @@
struct _GimpGuide
{
gint ref_count;
gint position;
InternalOrientationType orientation;
guint32 guide_ID;
gint ref_count;
gint position;
GimpOrientationType orientation;
guint32 guide_ID;
};
......
......@@ -110,9 +110,8 @@ gimp_tool_options_class_init (GimpToolOptionsClass *klass)
static void
gimp_tool_options_init (GimpToolOptions *options)
{
options->tool_info = NULL;
options->main_vbox = gtk_vbox_new (FALSE, 2);
options->reset_func = NULL;
options->tool_info = NULL;
options->main_vbox = gtk_vbox_new (FALSE, 2);
}
static void
......
......@@ -35,12 +35,11 @@ typedef struct _GimpToolOptionsClass GimpToolOptionsClass;
struct _GimpToolOptions
{
GimpContext parent_instance;
GimpContext parent_instance;
GimpToolInfo *tool_info;
GimpToolInfo *tool_info;
GtkWidget *main_vbox;
GimpToolOptionsResetFunc reset_func;
gpointer main_vbox;
};
struct _GimpToolOptionsClass
......
......@@ -1092,11 +1092,11 @@ gimp_display_shell_expose_guide (GimpDisplayShell *shell,
switch (guide->orientation)
{
case ORIENTATION_HORIZONTAL:
case GIMP_ORIENTATION_HORIZONTAL:
gimp_display_shell_add_expose_area (shell, 0, y, shell->disp_width, 1);
break;
case ORIENTATION_VERTICAL:
case GIMP_ORIENTATION_VERTICAL:
gimp_display_shell_add_expose_area (shell, x, 0, 1, shell->disp_height);
break;
......@@ -1395,7 +1395,7 @@ gimp_display_shell_draw_guide (GimpDisplayShell *shell,
if (x2 > w) x2 = w;
if (y2 > h) y2 = h;
if (guide->orientation == ORIENTATION_HORIZONTAL)
if (guide->orientation == GIMP_ORIENTATION_HORIZONTAL)
{
gimp_display_shell_transform_xy (shell,
0, guide->position, &x, &y, FALSE);
......@@ -1405,7 +1405,7 @@ gimp_display_shell_draw_guide (GimpDisplayShell *shell,
else
gdk_draw_line (shell->canvas->window, normal_hgc, x1, y, x2, y);
}
else if (guide->orientation == ORIENTATION_VERTICAL)
else if (guide->orientation == GIMP_ORIENTATION_VERTICAL)
{
gimp_display_shell_transform_xy (shell,
guide->position, 0, &x, &y, FALSE);
......
......@@ -1092,11 +1092,11 @@ gimp_display_shell_expose_guide (GimpDisplayShell *shell,
switch (guide->orientation)
{
case ORIENTATION_HORIZONTAL:
case GIMP_ORIENTATION_HORIZONTAL:
gimp_display_shell_add_expose_area (shell, 0, y, shell->disp_width, 1);
break;
case ORIENTATION_VERTICAL:
case GIMP_ORIENTATION_VERTICAL:
gimp_display_shell_add_expose_area (shell, x, 0, 1, shell->disp_height);
break;
......@@ -1395,7 +1395,7 @@ gimp_display_shell_draw_guide (GimpDisplayShell *shell,
if (x2 > w) x2 = w;
if (y2 > h) y2 = h;