Commit 7aaa80ef authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann
Browse files

new function to set the sensitivity of an option_menu.

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

	* libgimpwidgets/gimpwidgets.[ch]: new function to set the sensitivity
	of an option_menu.

	* app/base/base-enums.[ch]: register and describe GimpHistogramChannel.

	* app/core/Makefile.am
	* app/core/core-enums.[ch]: build with gimp-mkenums, added core-enums.c
	to CVS, added descriptions for GimpPreviewSize.

	* app/display/Makefile.am
	* app/display/display-enums.[ch]: build with gimp-mkenums, added
	display-enums.c to CVS, added descriptions for GimpCursorMode.

	* app/gui/preferences-dialog.c: more GimpEnumMenus.

	* app/tools/gimpcurvestool.c
	* app/tools/gimphistogramtool.c
	* app/tools/gimplevelstool.c: use a GimpEnumMenu for the Channel menu.
	Allow alpha channel in HistogramView. These tools needs more work...
parent 4d4ec70f
2002-03-17 Sven Neumann <sven@gimp.org>
* libgimpwidgets/gimpwidgets.[ch]: new function to set the sensitivity
of an option_menu.
* app/base/base-enums.[ch]: register and describe GimpHistogramChannel.
* app/core/Makefile.am
* app/core/core-enums.[ch]: build with gimp-mkenums, added core-enums.c
to CVS, added descriptions for GimpPreviewSize.
* app/display/Makefile.am
* app/display/display-enums.[ch]: build with gimp-mkenums, added
display-enums.c to CVS, added descriptions for GimpCursorMode.
* app/gui/preferences-dialog.c: more GimpEnumMenus.
* app/tools/gimpcurvestool.c
* app/tools/gimphistogramtool.c
* app/tools/gimplevelstool.c: use a GimpEnumMenu for the Channel menu.
Allow alpha channel in HistogramView. These tools needs more work...
2002-03-17 Sven Neumann <sven@gimp.org>
 
* tools/gimp-mkenums: allowing NULL for names was a bad idea...
......
......@@ -110,11 +110,11 @@ gimp_check_type_get_type (void)
static const GEnumValue gimp_histogram_channel_enum_values[] =
{
{ GIMP_HISTOGRAM_VALUE, "GIMP_HISTOGRAM_VALUE", "value" },
{ GIMP_HISTOGRAM_RED, "GIMP_HISTOGRAM_RED", "red" },
{ GIMP_HISTOGRAM_GREEN, "GIMP_HISTOGRAM_GREEN", "green" },
{ GIMP_HISTOGRAM_BLUE, "GIMP_HISTOGRAM_BLUE", "blue" },
{ GIMP_HISTOGRAM_ALPHA, "GIMP_HISTOGRAM_ALPHA", "alpha" },
{ GIMP_HISTOGRAM_VALUE, N_("Value"), "value" },
{ GIMP_HISTOGRAM_RED, N_("Red"), "red" },
{ GIMP_HISTOGRAM_GREEN, N_("Green"), "green" },
{ GIMP_HISTOGRAM_BLUE, N_("Blue"), "blue" },
{ GIMP_HISTOGRAM_ALPHA, N_("Alpha"), "alpha" },
{ 0, NULL, NULL }
};
......
......@@ -98,15 +98,29 @@ GType gimp_check_type_get_type (void) G_GNUC_CONST;
typedef enum /*< pdb-skip >*/
{
GIMP_LIGHT_CHECKS = 0, /*< desc="Light Checks" >*/
GIMP_GRAY_CHECKS = 1, /*< desc="Mid-Tone Checks" >*/
GIMP_DARK_CHECKS = 2, /*< desc="Dark Checks" >*/
GIMP_WHITE_ONLY = 3, /*< desc="White Only" >*/
GIMP_GRAY_ONLY = 4, /*< desc="Gray Only" >*/
GIMP_BLACK_ONLY = 5 /*< desc="Black Only" >*/
GIMP_LIGHT_CHECKS = 0, /*< desc="Light Checks" >*/
GIMP_GRAY_CHECKS = 1, /*< desc="Mid-Tone Checks" >*/
GIMP_DARK_CHECKS = 2, /*< desc="Dark Checks" >*/
GIMP_WHITE_ONLY = 3, /*< desc="White Only" >*/
GIMP_GRAY_ONLY = 4, /*< desc="Gray Only" >*/
GIMP_BLACK_ONLY = 5 /*< desc="Black Only" >*/
} GimpCheckType;
#define GIMP_TYPE_HISTOGRAM_CHANNEL (gimp_histogram_channel_get_type ())
GType gimp_histogram_channel_get_type (void) G_GNUC_CONST;
typedef enum /*< pdb-skip >*/
{
GIMP_HISTOGRAM_VALUE = 0, /*< desc="Value" >*/
GIMP_HISTOGRAM_RED = 1, /*< desc="Red" >*/
GIMP_HISTOGRAM_GREEN = 2, /*< desc="Green" >*/
GIMP_HISTOGRAM_BLUE = 3, /*< desc="Blue" >*/
GIMP_HISTOGRAM_ALPHA = 4 /*< desc="Alpha" >*/
} GimpHistogramChannel;
/*
* non-registered enums; register them if needed
*/
......@@ -128,14 +142,5 @@ typedef enum /*< skip >*/
GIMP_GRAY_LUT = 0 /*< skip >*/
} GimpChannelLutType;
typedef enum /*< pdb-skip >*/ /*< skip >*/
{
GIMP_HISTOGRAM_VALUE = 0,
GIMP_HISTOGRAM_RED = 1,
GIMP_HISTOGRAM_GREEN = 2,
GIMP_HISTOGRAM_BLUE = 3,
GIMP_HISTOGRAM_ALPHA = 4
} GimpHistogramChannel;
#endif /* __BASE_ENUMS_H__ */
......@@ -42,6 +42,7 @@
#include "core/gimpimage.h"
#include "widgets/gimpcursor.h"
#include "widgets/gimpenummenu.h"
#include "display/gimpdisplay.h"
#include "display/gimpdisplay-foreach.h"
......@@ -140,6 +141,9 @@ static void curves_preview (CurvesDialog *cd);
static void curves_channel_callback (GtkWidget *widget,
gpointer data);
static gboolean curves_set_sensitive_callback
(gpointer item_data,
CurvesDialog *cd);
static void curves_smooth_callback (GtkWidget *widget,
gpointer data);
static void curves_free_callback (GtkWidget *widget,
......@@ -187,8 +191,6 @@ static CurvesDialog * curves_dialog = NULL;
static GtkWidget *file_dlg = NULL;
static gboolean load_save;
static GtkWidget *channel_items[5];
static CRMatrix CR_basis =
{
{ -0.5, 1.5, -1.5, 0.5 },
......@@ -306,19 +308,10 @@ gimp_curves_tool_initialize (GimpTool *tool,
curves_dialog->color = gimp_drawable_is_rgb (curves_dialog->drawable);
curves_dialog->image_map = image_map_create (gdisp, curves_dialog->drawable);
/* check for alpha channel */
if (gimp_drawable_has_alpha (curves_dialog->drawable))
gtk_widget_set_sensitive (channel_items[4], TRUE);
else
gtk_widget_set_sensitive (channel_items[4], FALSE);
/* hide or show the channel menu based on image type */
if (curves_dialog->color)
for (i = 0; i < 4; i++)
gtk_widget_set_sensitive (channel_items[i], TRUE);
else
for (i = 1; i < 4; i++)
gtk_widget_set_sensitive (channel_items[i], FALSE);
/* set the sensitivity of the channel menu based on the drawable type */
gimp_option_menu_set_sensitive (GTK_OPTION_MENU (curves_dialog->channel_menu),
(GimpOptionMenuSensitivityCallback) curves_set_sensitive_callback,
curves_dialog);
/* set the current selection */
gtk_option_menu_set_history (GTK_OPTION_MENU (curves_dialog->channel_menu),
......@@ -383,6 +376,11 @@ gimp_curves_tool_button_press (GimpTool *tool,
curves_dialog->drawable = drawable;
curves_dialog->color = gimp_drawable_is_rgb (drawable);
curves_dialog->image_map = image_map_create (gdisp, drawable);
gimp_option_menu_set_sensitive
(GTK_OPTION_MENU (curves_dialog->channel_menu),
(GimpOptionMenuSensitivityCallback) curves_set_sensitive_callback,
curves_dialog);
}
tool->state = ACTIVE;
......@@ -678,20 +676,10 @@ curves_dialog_new (void)
label = gtk_label_new (_("Modify Curves for Channel:"));
gtk_box_pack_start (GTK_BOX (channel_hbox), label, FALSE, FALSE, 0);
cd->channel_menu = gimp_option_menu_new2
(FALSE,
G_CALLBACK (curves_channel_callback),
cd,
GINT_TO_POINTER (cd->channel),
_("Value"), GINT_TO_POINTER (GIMP_HISTOGRAM_VALUE), &channel_items[0],
_("Red"), GINT_TO_POINTER (GIMP_HISTOGRAM_RED), &channel_items[1],
_("Green"), GINT_TO_POINTER (GIMP_HISTOGRAM_GREEN), &channel_items[2],
_("Blue"), GINT_TO_POINTER (GIMP_HISTOGRAM_BLUE), &channel_items[3],
_("Alpha"), GINT_TO_POINTER (GIMP_HISTOGRAM_ALPHA), &channel_items[4],
NULL);
cd->channel_menu =
gimp_enum_option_menu_new (GIMP_TYPE_HISTOGRAM_CHANNEL,
G_CALLBACK (curves_channel_callback),
cd);
gtk_box_pack_start (GTK_BOX (channel_hbox), cd->channel_menu, FALSE, FALSE, 2);
gtk_widget_show (label);
......@@ -1264,6 +1252,27 @@ curves_channel_callback (GtkWidget *widget,
curves_update (cd, XRANGE_TOP | YRANGE | GRAPH | DRAW);
}
static gboolean
curves_set_sensitive_callback (gpointer item_data,
CurvesDialog *cd)
{
GimpHistogramChannel channel = GPOINTER_TO_INT (item_data);
switch (channel)
{
case GIMP_HISTOGRAM_VALUE:
return TRUE;
case GIMP_HISTOGRAM_RED:
case GIMP_HISTOGRAM_GREEN:
case GIMP_HISTOGRAM_BLUE:
return cd->color;
case GIMP_HISTOGRAM_ALPHA:
return gimp_drawable_has_alpha (cd->drawable);
}
return FALSE;
}
static void
curves_smooth_callback (GtkWidget *widget,
gpointer data)
......
......@@ -4,6 +4,5 @@ Makefile.in
.libs
*.lo
libappcore.la
core-enums.c
gimpmarshal.c
gimpmarshal.h
......@@ -194,12 +194,12 @@ $(srcdir)/gimpmarshal.c: $(srcdir)/gimpmarshal.h
&& cp xgen-gmc $(@F) \
&& rm -f xgen-gmc xgen-gmc~
$(srcdir)/core-enums.c: $(srcdir)/core-enums.h
$(GLIB_MKENUMS) \
--fhead "#include <glib-object.h>\n#include \"core-enums.h\"" \
$(srcdir)/core-enums.c: $(srcdir)/core-enums.h $(GIMP_MKENUMS)
$(GIMP_MKENUMS) \
--fhead "#include \"config.h\"\n#include <glib-object.h>\n#include \"core-enums.h\"\n#include\"libgimp/gimpintl.h\"" \
--fprod "\n/* enumerations from \"@filename@\" */" \
--vhead "\nstatic const GEnumValue @enum_name@_enum_values[] =\n{" \
--vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
--vprod " { @VALUENAME@, @valuedesc@, \"@valuenick@\" }," \
--vtail " { 0, NULL, NULL }\n};\n\nGType\n@enum_name@_get_type (void)\n{\n static GType enum_type = 0;\n\n if (!enum_type)\n enum_type = g_enum_register_static (\"@EnumName@\", @enum_name@_enum_values);\n\n return enum_type;\n}\n" \
$(srcdir)/core-enums.h > xgen-cec \
&& cp xgen-cec $(@F) \
......
/* Generated data (by gimp-mkenums) */
#include "config.h"
#include <glib-object.h>
#include "core-enums.h"
#include"libgimp/gimpintl.h"
/* enumerations from "./core-enums.h" */
static const GEnumValue gimp_image_base_type_enum_values[] =
{
{ GIMP_RGB, "GIMP_RGB", "rgb" },
{ GIMP_GRAY, "GIMP_GRAY", "gray" },
{ GIMP_INDEXED, "GIMP_INDEXED", "indexed" },
{ 0, NULL, NULL }
};
GType
gimp_image_base_type_get_type (void)
{
static GType enum_type = 0;
if (!enum_type)
enum_type = g_enum_register_static ("GimpImageBaseType", gimp_image_base_type_enum_values);
return enum_type;
}
static const GEnumValue gimp_preview_size_enum_values[] =
{
{ GIMP_PREVIEW_SIZE_NONE, N_("None"), "none" },
{ GIMP_PREVIEW_SIZE_TINY, N_("Tiny"), "tiny" },
{ GIMP_PREVIEW_SIZE_EXTRA_SMALL, N_("Very Small"), "extra-small" },
{ GIMP_PREVIEW_SIZE_SMALL, N_("Small"), "small" },
{ GIMP_PREVIEW_SIZE_MEDIUM, N_("Medium"), "medium" },
{ GIMP_PREVIEW_SIZE_LARGE, N_("Large"), "large" },
{ GIMP_PREVIEW_SIZE_EXTRA_LARGE, N_("Very Large"), "extra-large" },
{ GIMP_PREVIEW_SIZE_HUGE, N_("Huge"), "huge" },
{ GIMP_PREVIEW_SIZE_ENORMOUS, N_("Enormous"), "enormous" },
{ GIMP_PREVIEW_SIZE_GIGANTIC, N_("Gigantic"), "gigantic" },
{ 0, NULL, NULL }
};
GType
gimp_preview_size_get_type (void)
{
static GType enum_type = 0;
if (!enum_type)
enum_type = g_enum_register_static ("GimpPreviewSize", gimp_preview_size_enum_values);
return enum_type;
}
static const GEnumValue gimp_selection_control_enum_values[] =
{
{ GIMP_SELECTION_OFF, "GIMP_SELECTION_OFF", "off" },
{ GIMP_SELECTION_LAYER_OFF, "GIMP_SELECTION_LAYER_OFF", "layer-off" },
{ GIMP_SELECTION_ON, "GIMP_SELECTION_ON", "on" },
{ GIMP_SELECTION_PAUSE, "GIMP_SELECTION_PAUSE", "pause" },
{ GIMP_SELECTION_RESUME, "GIMP_SELECTION_RESUME", "resume" },
{ 0, NULL, NULL }
};
GType
gimp_selection_control_get_type (void)
{
static GType enum_type = 0;
if (!enum_type)
enum_type = g_enum_register_static ("GimpSelectionControl", gimp_selection_control_enum_values);
return enum_type;
}
static const GEnumValue gimp_channel_type_enum_values[] =
{
{ GIMP_RED_CHANNEL, "GIMP_RED_CHANNEL", "red-channel" },
{ GIMP_GREEN_CHANNEL, "GIMP_GREEN_CHANNEL", "green-channel" },
{ GIMP_BLUE_CHANNEL, "GIMP_BLUE_CHANNEL", "blue-channel" },
{ GIMP_GRAY_CHANNEL, "GIMP_GRAY_CHANNEL", "gray-channel" },
{ GIMP_INDEXED_CHANNEL, "GIMP_INDEXED_CHANNEL", "indexed-channel" },
{ GIMP_ALPHA_CHANNEL, "GIMP_ALPHA_CHANNEL", "alpha-channel" },
{ 0, NULL, NULL }
};
GType
gimp_channel_type_get_type (void)
{
static GType enum_type = 0;
if (!enum_type)
enum_type = g_enum_register_static ("GimpChannelType", gimp_channel_type_enum_values);
return enum_type;
}
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;
}
static const GEnumValue gimp_blend_mode_enum_values[] =
{
{ GIMP_FG_BG_RGB_MODE, "GIMP_FG_BG_RGB_MODE", "fg-bg-rgb-mode" },
{ GIMP_FG_BG_HSV_MODE, "GIMP_FG_BG_HSV_MODE", "fg-bg-hsv-mode" },
{ GIMP_FG_TRANS_MODE, "GIMP_FG_TRANS_MODE", "fg-trans-mode" },
{ GIMP_CUSTOM_MODE, "GIMP_CUSTOM_MODE", "custom-mode" },
{ 0, NULL, NULL }
};
GType
gimp_blend_mode_get_type (void)
{
static GType enum_type = 0;
if (!enum_type)
enum_type = g_enum_register_static ("GimpBlendMode", gimp_blend_mode_enum_values);
return enum_type;
}
static const GEnumValue gimp_transform_direction_enum_values[] =
{
{ GIMP_TRANSFORM_FORWARD, "GIMP_TRANSFORM_FORWARD", "forward" },
{ GIMP_TRANSFORM_BACKWARD, "GIMP_TRANSFORM_BACKWARD", "backward" },
{ 0, NULL, NULL }
};
GType
gimp_transform_direction_get_type (void)
{
static GType enum_type = 0;
if (!enum_type)
enum_type = g_enum_register_static ("GimpTransformDirection", gimp_transform_direction_enum_values);
return enum_type;
}
/* Generated data ends here */
......@@ -21,7 +21,7 @@
#if 0
This file is parsed by two scripts, enumgen.pl in tools/pdbgen
and glib-mkenums. All enums that are not marked with /*< pdb-skip >*/
and gimp-mkenums. All enums that are not marked with /*< pdb-skip >*/
are exported to libgimp and the PDB. Enums that are not marked with
/*< skip >*/ are registered with the GType system. If you want the
enum to be skipped by both scripts, you have to use /*< pdb-skip >*/
......@@ -54,16 +54,16 @@ GType gimp_preview_size_get_type (void) G_GNUC_CONST;
typedef enum /*< pdb-skip >*/
{
GIMP_PREVIEW_SIZE_NONE = 0,
GIMP_PREVIEW_SIZE_TINY = 16,
GIMP_PREVIEW_SIZE_EXTRA_SMALL = 24,
GIMP_PREVIEW_SIZE_SMALL = 32,
GIMP_PREVIEW_SIZE_MEDIUM = 48,
GIMP_PREVIEW_SIZE_LARGE = 64,
GIMP_PREVIEW_SIZE_EXTRA_LARGE = 96,
GIMP_PREVIEW_SIZE_HUGE = 128,
GIMP_PREVIEW_SIZE_ENORMOUS = 192,
GIMP_PREVIEW_SIZE_GIGANTIC = 256
GIMP_PREVIEW_SIZE_NONE = 0, /*< desc="None" >*/
GIMP_PREVIEW_SIZE_TINY = 16, /*< desc="Tiny" >*/
GIMP_PREVIEW_SIZE_EXTRA_SMALL = 24, /*< desc="Very Small" >*/
GIMP_PREVIEW_SIZE_SMALL = 32, /*< desc="Small" >*/
GIMP_PREVIEW_SIZE_MEDIUM = 48, /*< desc="Medium" >*/
GIMP_PREVIEW_SIZE_LARGE = 64, /*< desc="Large" >*/
GIMP_PREVIEW_SIZE_EXTRA_LARGE = 96, /*< desc="Very Large" >*/
GIMP_PREVIEW_SIZE_HUGE = 128, /*< desc="Huge" >*/
GIMP_PREVIEW_SIZE_ENORMOUS = 192, /*< desc="Enormous" >*/
GIMP_PREVIEW_SIZE_GIGANTIC = 256 /*< desc="Gigantic" >*/
} GimpPreviewSize;
......
......@@ -2054,33 +2054,12 @@ preferences_dialog_create (Gimp *gimp)
table = prefs_table_new (4, GTK_CONTAINER (vbox2), FALSE);
optionmenu =
gimp_option_menu_new2 (FALSE,
G_CALLBACK (prefs_preview_size_callback),
&gimprc.preview_size,
GINT_TO_POINTER (gimprc.preview_size),
_("None"),
GINT_TO_POINTER (GIMP_PREVIEW_SIZE_NONE), NULL,
_("Tiny"),
GINT_TO_POINTER (GIMP_PREVIEW_SIZE_TINY), NULL,
_("Extra Small"),
GINT_TO_POINTER (GIMP_PREVIEW_SIZE_EXTRA_SMALL), NULL,
_("Small"),
GINT_TO_POINTER (GIMP_PREVIEW_SIZE_SMALL), NULL,
_("Medium"),
GINT_TO_POINTER (GIMP_PREVIEW_SIZE_MEDIUM), NULL,
_("Large"),
GINT_TO_POINTER (GIMP_PREVIEW_SIZE_LARGE), NULL,
_("Extra Large"),
GINT_TO_POINTER (GIMP_PREVIEW_SIZE_EXTRA_LARGE), NULL,
_("Huge"),
GINT_TO_POINTER (GIMP_PREVIEW_SIZE_HUGE), NULL,
_("Gigantic"),
GINT_TO_POINTER (GIMP_PREVIEW_SIZE_GIGANTIC), NULL,
NULL);
optionmenu =
gimp_enum_option_menu_new (GIMP_TYPE_PREVIEW_SIZE,
G_CALLBACK (prefs_preview_size_callback),
&gimprc.preview_size);
gimp_option_menu_set_history (GTK_OPTION_MENU (optionmenu),
GINT_TO_POINTER (gimprc.preview_size));
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
_("Preview Size:"), 1.0, 0.5,
optionmenu, 1, TRUE);
......@@ -2425,21 +2404,11 @@ preferences_dialog_create (Gimp *gimp)
table = prefs_table_new (1, GTK_CONTAINER (vbox2), FALSE);
optionmenu =
gimp_option_menu_new2 (FALSE,
G_CALLBACK (prefs_toggle_callback),
&gimprc.cursor_mode,
GINT_TO_POINTER (gimprc.cursor_mode),
_("Tool Icon"),
GINT_TO_POINTER (GIMP_CURSOR_MODE_TOOL_ICON), NULL,
_("Tool Icon with Crosshair"),
GINT_TO_POINTER (GIMP_CURSOR_MODE_TOOL_CROSSHAIR), NULL,
_("Crosshair only"),
GINT_TO_POINTER (GIMP_CURSOR_MODE_CROSSHAIR), NULL,
NULL);
optionmenu = gimp_enum_option_menu_new (GIMP_TYPE_CURSOR_MODE,
G_CALLBACK (prefs_toggle_callback),
&gimprc.cursor_mode);
gimp_option_menu_set_history (GTK_OPTION_MENU (optionmenu),
GINT_TO_POINTER (gimprc.cursor_mode));
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
_("Cursor Mode:"), 1.0, 0.5,
optionmenu, 1, TRUE);
......@@ -2465,40 +2434,20 @@ preferences_dialog_create (Gimp *gimp)
table = prefs_table_new (2, GTK_CONTAINER (frame), TRUE);
optionmenu = gimp_option_menu_new2
(FALSE,
G_CALLBACK (prefs_toggle_callback),
&gimprc.transparency_type,
GINT_TO_POINTER (gimprc.transparency_type),
_("Light Checks"), GINT_TO_POINTER (GIMP_LIGHT_CHECKS), NULL,
_("Mid-Tone Checks"), GINT_TO_POINTER (GIMP_GRAY_CHECKS), NULL,
_("Dark Checks"), GINT_TO_POINTER (GIMP_DARK_CHECKS), NULL,
_("White Only"), GINT_TO_POINTER (GIMP_WHITE_ONLY), NULL,
_("Gray Only"), GINT_TO_POINTER (GIMP_GRAY_ONLY), NULL,
_("Black Only"), GINT_TO_POINTER (GIMP_BLACK_ONLY), NULL,
NULL);
optionmenu = gimp_enum_option_menu_new (GIMP_TYPE_CHECK_TYPE,
G_CALLBACK (prefs_toggle_callback),
&gimprc.transparency_type);
gimp_option_menu_set_history (GTK_OPTION_MENU (optionmenu),
GINT_TO_POINTER (gimprc.transparency_type));
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
_("Transparency Type:"), 1.0, 0.5,
optionmenu, 1, TRUE);
optionmenu =
gimp_option_menu_new2 (FALSE,
G_CALLBACK (prefs_toggle_callback),
&gimprc.transparency_size,
GINT_TO_POINTER (gimprc.transparency_size),
_("Small"),
GINT_TO_POINTER (GIMP_SMALL_CHECKS), NULL,
_("Medium"),
GINT_TO_POINTER (GIMP_MEDIUM_CHECKS), NULL,
_("Large"),
GINT_TO_POINTER (GIMP_LARGE_CHECKS), NULL,
NULL);
optionmenu = gimp_enum_option_menu_new (GIMP_TYPE_CHECK_SIZE,
G_CALLBACK (prefs_toggle_callback),
&gimprc.transparency_size);
gimp_option_menu_set_history (GTK_OPTION_MENU (optionmenu),
GINT_TO_POINTER (gimprc.transparency_size));
gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
_("Check Size:"), 1.0, 0.5,
optionmenu, 1, TRUE);
......
......@@ -4,4 +4,3 @@ Makefile.in
.libs
*.lo
libappdisplay.la
display-enums.c
......@@ -68,12 +68,12 @@ libappdisplay_a_SOURCES = \
gen_sources = xgen-dec
CLEANFILES = $(gen_sources)
$(srcdir)/display-enums.c: $(srcdir)/display-enums.h
$(GLIB_MKENUMS) \
--fhead "#include <glib-object.h>\n#include \"display-enums.h\"" \
$(srcdir)/display-enums.c: $(srcdir)/display-enums.h $(GIMP_MKENUMS)
$(GIMP_MKENUMS) \
--fhead "#include \"config.h\"\n#include <glib-object.h>\n#include \"display-enums.h\"\n#include\"libgimp/gimpintl.h\"" \
--fprod "\n/* enumerations from \"@filename@\" */" \
--vhead "\nstatic const GEnumValue @enum_name@_enum_values[] =\n{" \
--vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
--vprod " { @VALUENAME@, @valuedesc@, \"@valuenick@\" }," \
--vtail " { 0, NULL, NULL }\n};\n\nGType\n@enum_name@_get_type (void)\n{\n static GType enum_type = 0;\n\n if (!enum_type)\n enum_type = g_enum_register_static (\"@EnumName@\", @enum_name@_enum_values);\n\n return enum_type;\n}\n" \
$(srcdir)/display-enums.h > xgen-dec \
&& cp xgen-dec $(@F) \
......
/* Generated data (by gimp-mkenums) */
#include "config.h"
#include <glib-object.h>
#include "display-enums.h"