Commit 9d8b1ec9 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

registered more enums.

2002-03-17  Sven Neumann  <sven@gimp.org>

	* app/core/core-enums.[ch]: registered more enums.

	* app/tools/gimpblendtool.c: use GimpEnumMenus.
parent 30e42429
2002-03-17 Sven Neumann <sven@gimp.org>
* app/core/core-enums.[ch]: registered more enums.
* app/tools/gimpblendtool.c: use GimpEnumMenus.
2002-03-17 Sven Neumann <sven@gimp.org> 2002-03-17 Sven Neumann <sven@gimp.org>
* app/config/gimpconfig.c: open the file with O_TRUNC. * app/config/gimpconfig.c: open the file with O_TRUNC.
......
...@@ -100,64 +100,70 @@ gimp_channel_type_get_type (void) ...@@ -100,64 +100,70 @@ gimp_channel_type_get_type (void)
} }
static const GEnumValue gimp_gradient_segment_type_enum_values[] = static const GEnumValue gimp_blend_mode_enum_values[] =
{ {
{ GIMP_GRAD_LINEAR, "GIMP_GRAD_LINEAR", "linear" }, { GIMP_FG_BG_RGB_MODE, N_("FG to BG (RGB)"), "fg-bg-rgb-mode" },
{ GIMP_GRAD_CURVED, "GIMP_GRAD_CURVED", "curved" }, { GIMP_FG_BG_HSV_MODE, N_("FG to BG (HSV)"), "fg-bg-hsv-mode" },
{ GIMP_GRAD_SINE, "GIMP_GRAD_SINE", "sine" }, { GIMP_FG_TRANS_MODE, N_("FG to Transparent"), "fg-trans-mode" },
{ GIMP_GRAD_SPHERE_INCREASING, "GIMP_GRAD_SPHERE_INCREASING", "sphere-increasing" }, { GIMP_CUSTOM_MODE, N_("Custom Gradient"), "custom-mode" },
{ GIMP_GRAD_SPHERE_DECREASING, "GIMP_GRAD_SPHERE_DECREASING", "sphere-decreasing" },
{ 0, NULL, NULL } { 0, NULL, NULL }
}; };
GType GType
gimp_gradient_segment_type_get_type (void) gimp_blend_mode_get_type (void)
{ {
static GType enum_type = 0; static GType enum_type = 0;
if (!enum_type) if (!enum_type)
enum_type = g_enum_register_static ("GimpGradientSegmentType", gimp_gradient_segment_type_enum_values); enum_type = g_enum_register_static ("GimpBlendMode", gimp_blend_mode_enum_values);
return enum_type; return enum_type;
} }
static const GEnumValue gimp_gradient_segment_color_enum_values[] = static const GEnumValue gimp_gradient_type_enum_values[] =
{ {
{ GIMP_GRAD_RGB, "GIMP_GRAD_RGB", "rgb" }, { GIMP_LINEAR, N_("Linear"), "linear" },
{ GIMP_GRAD_HSV_CCW, "GIMP_GRAD_HSV_CCW", "hsv-ccw" }, { GIMP_BILINEAR, N_("Bi-Linear"), "bilinear" },
{ GIMP_GRAD_HSV_CW, "GIMP_GRAD_HSV_CW", "hsv-cw" }, { GIMP_RADIAL, N_("Radial"), "radial" },
{ GIMP_SQUARE, N_("Square"), "square" },
{ GIMP_CONICAL_SYMMETRIC, N_("Conical (symmetric)"), "conical-symmetric" },
{ GIMP_CONICAL_ASYMMETRIC, N_("Conical (asymmetric)"), "conical-asymmetric" },
{ GIMP_SHAPEBURST_ANGULAR, N_("Shapeburst (angular)"), "shapeburst-angular" },
{ GIMP_SHAPEBURST_SPHERICAL, N_("Shapeburst (spherical)"), "shapeburst-spherical" },
{ GIMP_SHAPEBURST_DIMPLED, N_("Shapeburst (dimpled)"), "shapeburst-dimpled" },
{ GIMP_SPIRAL_CLOCKWISE, N_("Spiral (clockwise)"), "spiral-clockwise" },
{ GIMP_SPIRAL_ANTICLOCKWISE, N_("Spiral (anticlockwise)"), "spiral-anticlockwise" },
{ 0, NULL, NULL } { 0, NULL, NULL }
}; };
GType GType
gimp_gradient_segment_color_get_type (void) gimp_gradient_type_get_type (void)
{ {
static GType enum_type = 0; static GType enum_type = 0;
if (!enum_type) if (!enum_type)
enum_type = g_enum_register_static ("GimpGradientSegmentColor", gimp_gradient_segment_color_enum_values); enum_type = g_enum_register_static ("GimpGradientType", gimp_gradient_type_enum_values);
return enum_type; return enum_type;
} }
static const GEnumValue gimp_blend_mode_enum_values[] = static const GEnumValue gimp_repeat_mode_enum_values[] =
{ {
{ GIMP_FG_BG_RGB_MODE, "GIMP_FG_BG_RGB_MODE", "fg-bg-rgb-mode" }, { GIMP_REPEAT_NONE, N_("None"), "none" },
{ GIMP_FG_BG_HSV_MODE, "GIMP_FG_BG_HSV_MODE", "fg-bg-hsv-mode" }, { GIMP_REPEAT_SAWTOOTH, N_("Sawtooth Wave"), "sawtooth" },
{ GIMP_FG_TRANS_MODE, "GIMP_FG_TRANS_MODE", "fg-trans-mode" }, { GIMP_REPEAT_TRIANGULAR, N_("Triangular Wave"), "triangular" },
{ GIMP_CUSTOM_MODE, "GIMP_CUSTOM_MODE", "custom-mode" },
{ 0, NULL, NULL } { 0, NULL, NULL }
}; };
GType GType
gimp_blend_mode_get_type (void) gimp_repeat_mode_get_type (void)
{ {
static GType enum_type = 0; static GType enum_type = 0;
if (!enum_type) if (!enum_type)
enum_type = g_enum_register_static ("GimpBlendMode", gimp_blend_mode_enum_values); enum_type = g_enum_register_static ("GimpRepeatMode", gimp_repeat_mode_enum_values);
return enum_type; return enum_type;
} }
...@@ -165,8 +171,8 @@ gimp_blend_mode_get_type (void) ...@@ -165,8 +171,8 @@ gimp_blend_mode_get_type (void)
static const GEnumValue gimp_transform_direction_enum_values[] = static const GEnumValue gimp_transform_direction_enum_values[] =
{ {
{ GIMP_TRANSFORM_FORWARD, "GIMP_TRANSFORM_FORWARD", "forward" }, { GIMP_TRANSFORM_FORWARD, N_("Forward (Traditional)"), "forward" },
{ GIMP_TRANSFORM_BACKWARD, "GIMP_TRANSFORM_BACKWARD", "backward" }, { GIMP_TRANSFORM_BACKWARD, N_("Backward (Corrective)"), "backward" },
{ 0, NULL, NULL } { 0, NULL, NULL }
}; };
...@@ -182,5 +188,47 @@ gimp_transform_direction_get_type (void) ...@@ -182,5 +188,47 @@ gimp_transform_direction_get_type (void)
} }
static const GEnumValue gimp_gradient_segment_type_enum_values[] =
{
{ GIMP_GRAD_LINEAR, "GIMP_GRAD_LINEAR", "linear" },
{ GIMP_GRAD_CURVED, "GIMP_GRAD_CURVED", "curved" },
{ GIMP_GRAD_SINE, "GIMP_GRAD_SINE", "sine" },
{ GIMP_GRAD_SPHERE_INCREASING, "GIMP_GRAD_SPHERE_INCREASING", "sphere-increasing" },
{ GIMP_GRAD_SPHERE_DECREASING, "GIMP_GRAD_SPHERE_DECREASING", "sphere-decreasing" },
{ 0, NULL, NULL }
};
GType
gimp_gradient_segment_type_get_type (void)
{
static GType enum_type = 0;
if (!enum_type)
enum_type = g_enum_register_static ("GimpGradientSegmentType", gimp_gradient_segment_type_enum_values);
return enum_type;
}
static const GEnumValue gimp_gradient_segment_color_enum_values[] =
{
{ GIMP_GRAD_RGB, "GIMP_GRAD_RGB", "rgb" },
{ GIMP_GRAD_HSV_CCW, "GIMP_GRAD_HSV_CCW", "hsv-ccw" },
{ GIMP_GRAD_HSV_CW, "GIMP_GRAD_HSV_CW", "hsv-cw" },
{ 0, NULL, NULL }
};
GType
gimp_gradient_segment_color_get_type (void)
{
static GType enum_type = 0;
if (!enum_type)
enum_type = g_enum_register_static ("GimpGradientSegmentColor", gimp_gradient_segment_color_enum_values);
return enum_type;
}
/* Generated data ends here */ /* Generated data ends here */
...@@ -96,25 +96,66 @@ typedef enum ...@@ -96,25 +96,66 @@ typedef enum
} GimpChannelType; } GimpChannelType;
/* #define GIMP_TYPE_BLEND_MODE (gimp_blend_mode_get_type ())
* non-registered enums; register them if needed
*/
typedef enum /*< skip >*/ GType gimp_blend_mode_get_type (void) G_GNUC_CONST;
typedef enum /*< chop=_MODE >*/
{ {
GIMP_LINEAR, GIMP_FG_BG_RGB_MODE, /*< desc="FG to BG (RGB)" >*/
GIMP_BILINEAR, GIMP_FG_BG_HSV_MODE, /*< desc="FG to BG (HSV)" >*/
GIMP_RADIAL, GIMP_FG_TRANS_MODE, /*< desc="FG to Transparent" >*/
GIMP_SQUARE, GIMP_CUSTOM_MODE /*< desc="Custom Gradient" >*/
GIMP_CONICAL_SYMMETRIC, } GimpBlendMode;
GIMP_CONICAL_ASYMMETRIC,
GIMP_SHAPEBURST_ANGULAR,
GIMP_SHAPEBURST_SPHERICAL, #define GIMP_TYPE_GRADIENT_TYPE (gimp_gradient_type_get_type ())
GIMP_SHAPEBURST_DIMPLED,
GIMP_SPIRAL_CLOCKWISE, GType gimp_gradient_type_get_type (void) G_GNUC_CONST;
GIMP_SPIRAL_ANTICLOCKWISE
typedef enum
{
GIMP_LINEAR, /*< desc="Linear" >*/
GIMP_BILINEAR, /*< desc="Bi-Linear" >*/
GIMP_RADIAL, /*< desc="Radial" >*/
GIMP_SQUARE, /*< desc="Square" >*/
GIMP_CONICAL_SYMMETRIC, /*< desc="Conical (symmetric)" >*/
GIMP_CONICAL_ASYMMETRIC, /*< desc="Conical (asymmetric)" >*/
GIMP_SHAPEBURST_ANGULAR, /*< desc="Shapeburst (angular)" >*/
GIMP_SHAPEBURST_SPHERICAL, /*< desc="Shapeburst (spherical)" >*/
GIMP_SHAPEBURST_DIMPLED, /*< desc="Shapeburst (dimpled)" >*/
GIMP_SPIRAL_CLOCKWISE, /*< desc="Spiral (clockwise)" >*/
GIMP_SPIRAL_ANTICLOCKWISE /*< desc="Spiral (anticlockwise)" >*/
} GimpGradientType; } GimpGradientType;
#define GIMP_TYPE_REPEAT_MODE (gimp_repeat_mode_get_type ())
GType gimp_repeat_mode_get_type (void) G_GNUC_CONST;
typedef enum
{
GIMP_REPEAT_NONE, /*< desc="None" >*/
GIMP_REPEAT_SAWTOOTH, /*< desc="Sawtooth Wave" >*/
GIMP_REPEAT_TRIANGULAR /*< desc="Triangular Wave" >*/
} GimpRepeatMode;
#define GIMP_TYPE_TRANSFORM_DIRECTION (gimp_transform_direction_get_type ())
GType gimp_transform_direction_get_type (void) G_GNUC_CONST;
typedef enum /*< pdb-skip >*/
{
GIMP_TRANSFORM_FORWARD, /*< desc="Forward (Traditional)" >*/
GIMP_TRANSFORM_BACKWARD /*< desc="Backward (Corrective)" >*/
} GimpTransformDirection;
/*
* non-registered enums; register them if needed
*/
typedef enum /*< pdb-skip >*/ /*< skip >*/ typedef enum /*< pdb-skip >*/ /*< skip >*/
{ {
GIMP_GRAD_LINEAR = 0, GIMP_GRAD_LINEAR = 0,
...@@ -131,21 +172,6 @@ typedef enum /*< pdb-skip >*/ /*< skip >*/ ...@@ -131,21 +172,6 @@ typedef enum /*< pdb-skip >*/ /*< skip >*/
GIMP_GRAD_HSV_CW /* clockwise hue */ GIMP_GRAD_HSV_CW /* clockwise hue */
} GimpGradientSegmentColor; } GimpGradientSegmentColor;
typedef enum /*< chop=_MODE >*/ /*< skip >*/
{
GIMP_FG_BG_RGB_MODE,
GIMP_FG_BG_HSV_MODE,
GIMP_FG_TRANS_MODE,
GIMP_CUSTOM_MODE
} GimpBlendMode;
typedef enum /*< skip >*/
{
GIMP_REPEAT_NONE,
GIMP_REPEAT_SAWTOOTH,
GIMP_REPEAT_TRIANGULAR
} GimpRepeatMode;
typedef enum /*< skip >*/ typedef enum /*< skip >*/
{ {
GIMP_RGB_IMAGE, GIMP_RGB_IMAGE,
...@@ -163,11 +189,5 @@ typedef enum /*< skip >*/ ...@@ -163,11 +189,5 @@ typedef enum /*< skip >*/
GIMP_HIGHLIGHTS GIMP_HIGHLIGHTS
} GimpTransferMode; } GimpTransferMode;
typedef enum /*< pdb-skip >*/ /*< skip >*/
{
GIMP_TRANSFORM_FORWARD,
GIMP_TRANSFORM_BACKWARD
} GimpTransformDirection;
#endif /* __CORE_TYPES_H__ */ #endif /* __CORE_TYPES_H__ */
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
#include "display/gimpprogress.h" #include "display/gimpprogress.h"
#include "widgets/gimpdnd.h" #include "widgets/gimpdnd.h"
#include "widgets/gimpenummenu.h"
#include "gimpblendtool.h" #include "gimpblendtool.h"
#include "paint_options.h" #include "paint_options.h"
...@@ -496,93 +497,33 @@ blend_options_new (GimpToolInfo *tool_info) ...@@ -496,93 +497,33 @@ blend_options_new (GimpToolInfo *tool_info)
/* the blend mode menu */ /* the blend mode menu */
options->blend_mode_w = options->blend_mode_w =
gimp_option_menu_new2 (FALSE, gimp_enum_option_menu_new (GIMP_TYPE_BLEND_MODE,
G_CALLBACK (gimp_menu_item_update), G_CALLBACK (gimp_menu_item_update),
&options->blend_mode, &options->blend_mode);
GINT_TO_POINTER (options->blend_mode_d), gimp_option_menu_set_history (GTK_OPTION_MENU (options->blend_mode_w),
GINT_TO_POINTER (options->blend_mode_d));
_("FG to BG (RGB)"),
GINT_TO_POINTER (GIMP_FG_BG_RGB_MODE), NULL,
_("FG to BG (HSV)"),
GINT_TO_POINTER (GIMP_FG_BG_HSV_MODE), NULL,
_("FG to Transparent"),
GINT_TO_POINTER (GIMP_FG_TRANS_MODE), NULL,
_("Custom Gradient"),
GINT_TO_POINTER (GIMP_CUSTOM_MODE), NULL,
NULL);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 1, gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
_("Blend:"), 1.0, 0.5, _("Blend:"), 1.0, 0.5,
options->blend_mode_w, 2, TRUE); options->blend_mode_w, 2, TRUE);
/* the gradient type menu */ /* the gradient type menu */
options->gradient_type_w = options->gradient_type_w =
gimp_option_menu_new2 (FALSE, gimp_enum_option_menu_new (GIMP_TYPE_GRADIENT_TYPE,
G_CALLBACK (gradient_type_callback), G_CALLBACK (gradient_type_callback),
options, options);
GINT_TO_POINTER (options->gradient_type_d), gimp_option_menu_set_history (GTK_OPTION_MENU (options->gradient_type_w),
GINT_TO_POINTER (options->gradient_type_d));
_("Linear"),
GINT_TO_POINTER (GIMP_LINEAR), NULL,
_("Bi-Linear"),
GINT_TO_POINTER (GIMP_BILINEAR), NULL,
_("Radial"),
GINT_TO_POINTER (GIMP_RADIAL), NULL,
_("Square"),
GINT_TO_POINTER (GIMP_SQUARE), NULL,
_("Conical (symmetric)"),
GINT_TO_POINTER (GIMP_CONICAL_SYMMETRIC), NULL,
_("Conical (asymmetric)"),
GINT_TO_POINTER (GIMP_CONICAL_ASYMMETRIC), NULL,
_("Shapeburst (angular)"),
GINT_TO_POINTER (GIMP_SHAPEBURST_ANGULAR), NULL,
_("Shapeburst (spherical)"),
GINT_TO_POINTER (GIMP_SHAPEBURST_SPHERICAL), NULL,
_("Shapeburst (dimpled)"),
GINT_TO_POINTER (GIMP_SHAPEBURST_DIMPLED), NULL,
_("Spiral (clockwise)"),
GINT_TO_POINTER (GIMP_SPIRAL_CLOCKWISE), NULL,
_("Spiral (anticlockwise)"),
GINT_TO_POINTER (GIMP_SPIRAL_ANTICLOCKWISE), NULL,
NULL);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 2, gimp_table_attach_aligned (GTK_TABLE (table), 0, 2,
_("Gradient:"), 1.0, 0.5, _("Gradient:"), 1.0, 0.5,
options->gradient_type_w, 2, TRUE); options->gradient_type_w, 2, TRUE);
/* the repeat option */ /* the repeat option */
options->repeat_w = options->repeat_w =
gimp_option_menu_new2 (FALSE, gimp_enum_option_menu_new (GIMP_TYPE_REPEAT_MODE,
G_CALLBACK (gimp_menu_item_update), G_CALLBACK (gimp_menu_item_update),
&options->repeat, &options->repeat);
GINT_TO_POINTER (options->repeat_d), gimp_option_menu_set_history (GTK_OPTION_MENU (options->repeat_w),
GINT_TO_POINTER (options->repeat_d));
_("None"),
GINT_TO_POINTER (GIMP_REPEAT_NONE), NULL,
_("Sawtooth Wave"),
GINT_TO_POINTER (GIMP_REPEAT_SAWTOOTH), NULL,
_("Triangular Wave"),
GINT_TO_POINTER (GIMP_REPEAT_TRIANGULAR), NULL,
NULL);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 3, gimp_table_attach_aligned (GTK_TABLE (table), 0, 3,
_("Repeat:"), 1.0, 0.5, _("Repeat:"), 1.0, 0.5,
options->repeat_w, 2, TRUE); options->repeat_w, 2, TRUE);
......
...@@ -342,7 +342,6 @@ histogram_tool_dialog_new (void) ...@@ -342,7 +342,6 @@ histogram_tool_dialog_new (void)
GtkWidget *frame; GtkWidget *frame;
GtkWidget *table; GtkWidget *table;
GtkWidget *label; GtkWidget *label;
GtkWidget *option_menu;
gint i; gint i;
gint x, y; gint x, y;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment