Commit fb9b0344 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

register GimpChannelType and GimpSelectionControl enums with the type

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

	* app/core/core-enums.h: register GimpChannelType and
	GimpSelectionControl enums with the type system.

	* app/core/gimpimage.c: use them in signal declarations.

	* app/widgets/Makefile.am
	* app/widgets/widgets-enums.h
	* app/widgets/widgets-types.h: split enums into it's own file and
	generate widgets-enums.c. Register GimpZoomType enum.

	* app/widgets/gimpnavigationpreview.c: use GIMP_TYPE_ZOOM_TYPE.
parent 4437febe
2002-03-13 Sven Neumann <sven@gimp.org>
* app/core/core-enums.h: register GimpChannelType and
GimpSelectionControl enums with the type system.
* app/core/gimpimage.c: use them in signal declarations.
* app/widgets/Makefile.am
* app/widgets/widgets-enums.h
* app/widgets/widgets-types.h: split enums into it's own file and
generate widgets-enums.c. Register GimpZoomType enum.
* app/widgets/gimpnavigationpreview.c: use GIMP_TYPE_ZOOM_TYPE.
2002-03-12 Michael Natterer <mitch@gimp.org>
* app/config/gimpguiconfig.[ch]: removed "global_paint_options".
......
......@@ -67,11 +67,25 @@ typedef enum /*< pdb-skip >*/
} GimpPreviewSize;
/*
* non-registered enums; register them if needed
*/
#define GIMP_TYPE_SELECTION_CONTROL (gimp_selection_control_get_type ())
typedef enum /*< skip >*/
GType gimp_selection_control_get_type (void) G_GNUC_CONST;
typedef enum /*< pdb-skip >*/
{
GIMP_SELECTION_OFF,
GIMP_SELECTION_LAYER_OFF,
GIMP_SELECTION_ON,
GIMP_SELECTION_PAUSE,
GIMP_SELECTION_RESUME
} GimpSelectionControl;
#define GIMP_TYPE_CHANNEL_TYPE (gimp_channel_type_get_type ())
GType gimp_channel_type_get_type (void) G_GNUC_CONST;
typedef enum
{
GIMP_RED_CHANNEL,
GIMP_GREEN_CHANNEL,
......@@ -81,6 +95,11 @@ typedef enum /*< skip >*/
GIMP_ALPHA_CHANNEL
} GimpChannelType;
/*
* non-registered enums; register them if needed
*/
typedef enum /*< skip >*/
{
GIMP_LINEAR,
......@@ -137,15 +156,6 @@ typedef enum /*< skip >*/
GIMP_INDEXEDA_IMAGE
} GimpImageType;
typedef enum /*< pdb-skip >*/ /*< skip >*/
{
GIMP_SELECTION_OFF,
GIMP_SELECTION_LAYER_OFF,
GIMP_SELECTION_ON,
GIMP_SELECTION_PAUSE,
GIMP_SELECTION_RESUME
} GimpSelectionControl;
typedef enum /*< skip >*/
{
GIMP_SHADOWS,
......@@ -153,7 +163,7 @@ typedef enum /*< skip >*/
GIMP_HIGHLIGHTS
} GimpTransferMode;
typedef enum /*< pdb-skip >*/ /*< skip >*/
typedef enum /*< pdb-skip >*/ /*< skip >*/
{
GIMP_TRANSFORM_FORWARD,
GIMP_TRANSFORM_BACKWARD
......
......@@ -241,9 +241,9 @@ gimp_image_class_init (GimpImageClass *klass)
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GimpImageClass, component_visibility_changed),
NULL, NULL,
gimp_marshal_VOID__INT,
gimp_marshal_VOID__ENUM,
G_TYPE_NONE, 1,
G_TYPE_INT);
GIMP_TYPE_CHANNEL_TYPE);
gimp_image_signals[COMPONENT_ACTIVE_CHANGED] =
g_signal_new ("component_active_changed",
......@@ -251,9 +251,9 @@ gimp_image_class_init (GimpImageClass *klass)
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GimpImageClass, component_active_changed),
NULL, NULL,
gimp_marshal_VOID__INT,
gimp_marshal_VOID__ENUM,
G_TYPE_NONE, 1,
G_TYPE_INT);
GIMP_TYPE_CHANNEL_TYPE);
gimp_image_signals[MASK_CHANGED] =
g_signal_new ("mask_changed",
......@@ -297,9 +297,9 @@ gimp_image_class_init (GimpImageClass *klass)
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GimpImageClass, selection_control),
NULL, NULL,
gimp_marshal_VOID__INT,
gimp_marshal_VOID__ENUM,
G_TYPE_NONE, 1,
G_TYPE_INT);
GIMP_TYPE_SELECTION_CONTROL);
gimp_image_signals[CLEAN] =
g_signal_new ("clean",
......
......@@ -4,3 +4,4 @@ Makefile.in
.libs
*.lo
libappwidgets.la
widgets-enums.c
## Process this file with automake to produce Makefile.in
AM_CPPFLAGS = @STRIP_BEGIN@ \
-DG_LOG_DOMAIN=\"Gimp-Widgets\" \
@GIMP_THREAD_FLAGS@ \
@GIMP_MP_FLAGS@ \
@STRIP_END@
INCLUDES = @STRIP_BEGIN@ \
-I$(top_builddir) \
-I$(top_srcdir) \
-I$(top_builddir)/app \
-I$(top_srcdir)/app \
$(GTK_CFLAGS) \
$(PANGOFT2_CFLAGS) \
-I$(includedir) \
@STRIP_END@
noinst_LIBRARIES = libappwidgets.a
libappwidgets_a_SOURCES = @STRIP_BEGIN@ \
libappwidgets_a_sources = @STRIP_BEGIN@ \
widgets-enums.h \
widgets-types.h \
gimpbrusheditor.c \
gimpbrusheditor.h \
......@@ -124,18 +141,26 @@ libappwidgets_a_SOURCES = @STRIP_BEGIN@ \
gimpconstrainedhwrapbox.h \
@STRIP_END@
AM_CPPFLAGS = @STRIP_BEGIN@ \
-DG_LOG_DOMAIN=\"Gimp-Widgets\" \
@GIMP_THREAD_FLAGS@ \
@GIMP_MP_FLAGS@ \
libappwidgets_a_built_sources = @STRIP_BEGIN@ \
widgets-enums.c \
@STRIP_END@
INCLUDES = @STRIP_BEGIN@ \
-I$(top_builddir) \
-I$(top_srcdir) \
-I$(top_builddir)/app \
-I$(top_srcdir)/app \
$(GTK_CFLAGS) \
$(PANGOFT2_CFLAGS) \
-I$(includedir) \
@STRIP_END@
libappwidgets_a_SOURCES = $(libappwidgets_a_built_sources) $(libappwidgets_a_sources)
#
# rules to generate built sources
#
# setup autogeneration dependancies
gen_sources = xgen-wec
CLEANFILES = $(gen_sources)
$(srcdir)/widgets-enums.c: $(srcdir)/widgets-enums.h
$(GLIB_MKENUMS) \
--fhead "#include <gtk/gtk.h>\n#include \"widgets-enums.h\"" \
--fprod "\n/* enumerations from \"@filename@\" */" \
--vhead "\nstatic const GEnumValue @enum_name@_enum_values[] =\n{" \
--vprod " { @VALUENAME@, \"@VALUENAME@\", \"@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)/widgets-enums.h > xgen-wec \
&& cp xgen-wec $(@F) \
&& rm -f xgen-wec
......@@ -133,9 +133,9 @@ gimp_navigation_preview_class_init (GimpNavigationPreviewClass *klass)
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GimpNavigationPreviewClass, zoom),
NULL, NULL,
gimp_marshal_VOID__INT,
gimp_marshal_VOID__ENUM,
G_TYPE_NONE, 1,
G_TYPE_INT);
GIMP_TYPE_ZOOM_TYPE);
preview_signals[SCROLL] =
g_signal_new ("scroll",
......
......@@ -133,9 +133,9 @@ gimp_navigation_preview_class_init (GimpNavigationPreviewClass *klass)
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GimpNavigationPreviewClass, zoom),
NULL, NULL,
gimp_marshal_VOID__INT,
gimp_marshal_VOID__ENUM,
G_TYPE_NONE, 1,
G_TYPE_INT);
GIMP_TYPE_ZOOM_TYPE);
preview_signals[SCROLL] =
g_signal_new ("scroll",
......
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __WIDGETS_ENUMS_H__
#define __WIDGETS_ENUMS_H__
/*
* these enums that are registered with the type system
*/
#define GIMP_TYPE_ZOOM_TYPE (gimp_zoom_type_get_type ())
GType gimp_zoom_type_get_type (void) G_GNUC_CONST;
typedef enum
{
GIMP_ZOOM_IN,
GIMP_ZOOM_OUT
} GimpZoomType;
/*
* non-registered enums; register them if needed
*/
typedef enum /*< skip >*/
{
GIMP_VIEW_TYPE_GRID,
GIMP_VIEW_TYPE_LIST
} GimpViewType;
typedef enum /*< skip >*/
{
GIMP_DROP_NONE,
GIMP_DROP_ABOVE,
GIMP_DROP_BELOW
} GimpDropType;
typedef enum /*< skip >*/
{
GIMP_MOUSE_CURSOR = (GDK_LAST_CURSOR + 2),
GIMP_CROSSHAIR_CURSOR,
GIMP_CROSSHAIR_SMALL_CURSOR,
GIMP_BAD_CURSOR,
GIMP_ZOOM_CURSOR,
GIMP_COLOR_PICKER_CURSOR,
GIMP_LAST_CURSOR_ENTRY
} GimpCursorType;
typedef enum /*< skip >*/
{
GIMP_TOOL_CURSOR_NONE,
GIMP_RECT_SELECT_TOOL_CURSOR,
GIMP_ELLIPSE_SELECT_TOOL_CURSOR,
GIMP_FREE_SELECT_TOOL_CURSOR,
GIMP_FUZZY_SELECT_TOOL_CURSOR,
GIMP_BEZIER_SELECT_TOOL_CURSOR,
GIMP_SCISSORS_TOOL_CURSOR,
GIMP_MOVE_TOOL_CURSOR,
GIMP_ZOOM_TOOL_CURSOR,
GIMP_CROP_TOOL_CURSOR,
GIMP_RESIZE_TOOL_CURSOR,
GIMP_ROTATE_TOOL_CURSOR,
GIMP_SHEAR_TOOL_CURSOR,
GIMP_PERSPECTIVE_TOOL_CURSOR,
GIMP_FLIP_HORIZONTAL_TOOL_CURSOR,
GIMP_FLIP_VERTICAL_TOOL_CURSOR,
GIMP_TEXT_TOOL_CURSOR,
GIMP_COLOR_PICKER_TOOL_CURSOR,
GIMP_BUCKET_FILL_TOOL_CURSOR,
GIMP_BLEND_TOOL_CURSOR,
GIMP_PENCIL_TOOL_CURSOR,
GIMP_PAINTBRUSH_TOOL_CURSOR,
GIMP_AIRBRUSH_TOOL_CURSOR,
GIMP_INK_TOOL_CURSOR,
GIMP_CLONE_TOOL_CURSOR,
GIMP_ERASER_TOOL_CURSOR,
GIMP_SMUDGE_TOOL_CURSOR,
GIMP_BLUR_TOOL_CURSOR,
GIMP_DODGE_TOOL_CURSOR,
GIMP_BURN_TOOL_CURSOR,
GIMP_MEASURE_TOOL_CURSOR,
GIMP_LAST_STOCK_TOOL_CURSOR_ENTRY
} GimpToolCursorType;
typedef enum /*< skip >*/
{
GIMP_CURSOR_MODIFIER_NONE,
GIMP_CURSOR_MODIFIER_PLUS,
GIMP_CURSOR_MODIFIER_MINUS,
GIMP_CURSOR_MODIFIER_INTERSECT,
GIMP_CURSOR_MODIFIER_MOVE,
GIMP_CURSOR_MODIFIER_RESIZE,
GIMP_CURSOR_MODIFIER_CONTROL,
GIMP_CURSOR_MODIFIER_ANCHOR,
GIMP_CURSOR_MODIFIER_FOREGROUND,
GIMP_CURSOR_MODIFIER_BACKGROUND,
GIMP_CURSOR_MODIFIER_PATTERN,
GIMP_CURSOR_MODIFIER_HAND,
GIMP_LAST_CURSOR_MODIFIER_ENTRY
} GimpCursorModifier;
typedef enum /*< skip >*/
{
GIMP_DEVICE_VALUE_MODE = 1 << 0,
GIMP_DEVICE_VALUE_AXES = 1 << 1,
GIMP_DEVICE_VALUE_KEYS = 1 << 2,
GIMP_DEVICE_VALUE_TOOL = 1 << 3,
GIMP_DEVICE_VALUE_FOREGROUND = 1 << 4,
GIMP_DEVICE_VALUE_BACKGROUND = 1 << 5,
GIMP_DEVICE_VALUE_BRUSH = 1 << 6,
GIMP_DEVICE_VALUE_PATTERN = 1 << 7,
GIMP_DEVICE_VALUE_GRADIENT = 1 << 8
} GimpDeviceValues;
#endif /* __WIDGETS_ENUMS_H__ */
......@@ -26,104 +26,7 @@
#include "display/display-types.h"
/* enums */
typedef enum
{
GIMP_VIEW_TYPE_GRID,
GIMP_VIEW_TYPE_LIST
} GimpViewType;
typedef enum
{
GIMP_DROP_NONE,
GIMP_DROP_ABOVE,
GIMP_DROP_BELOW
} GimpDropType;
typedef enum
{
GIMP_ZOOM_IN,
GIMP_ZOOM_OUT
} GimpZoomType;
typedef enum
{
GIMP_MOUSE_CURSOR = (GDK_LAST_CURSOR + 2),
GIMP_CROSSHAIR_CURSOR,
GIMP_CROSSHAIR_SMALL_CURSOR,
GIMP_BAD_CURSOR,
GIMP_ZOOM_CURSOR,
GIMP_COLOR_PICKER_CURSOR,
GIMP_LAST_CURSOR_ENTRY
} GimpCursorType;
typedef enum
{
GIMP_TOOL_CURSOR_NONE,
GIMP_RECT_SELECT_TOOL_CURSOR,
GIMP_ELLIPSE_SELECT_TOOL_CURSOR,
GIMP_FREE_SELECT_TOOL_CURSOR,
GIMP_FUZZY_SELECT_TOOL_CURSOR,
GIMP_BEZIER_SELECT_TOOL_CURSOR,
GIMP_SCISSORS_TOOL_CURSOR,
GIMP_MOVE_TOOL_CURSOR,
GIMP_ZOOM_TOOL_CURSOR,
GIMP_CROP_TOOL_CURSOR,
GIMP_RESIZE_TOOL_CURSOR,
GIMP_ROTATE_TOOL_CURSOR,
GIMP_SHEAR_TOOL_CURSOR,
GIMP_PERSPECTIVE_TOOL_CURSOR,
GIMP_FLIP_HORIZONTAL_TOOL_CURSOR,
GIMP_FLIP_VERTICAL_TOOL_CURSOR,
GIMP_TEXT_TOOL_CURSOR,
GIMP_COLOR_PICKER_TOOL_CURSOR,
GIMP_BUCKET_FILL_TOOL_CURSOR,
GIMP_BLEND_TOOL_CURSOR,
GIMP_PENCIL_TOOL_CURSOR,
GIMP_PAINTBRUSH_TOOL_CURSOR,
GIMP_AIRBRUSH_TOOL_CURSOR,
GIMP_INK_TOOL_CURSOR,
GIMP_CLONE_TOOL_CURSOR,
GIMP_ERASER_TOOL_CURSOR,
GIMP_SMUDGE_TOOL_CURSOR,
GIMP_BLUR_TOOL_CURSOR,
GIMP_DODGE_TOOL_CURSOR,
GIMP_BURN_TOOL_CURSOR,
GIMP_MEASURE_TOOL_CURSOR,
GIMP_LAST_STOCK_TOOL_CURSOR_ENTRY
} GimpToolCursorType;
typedef enum
{
GIMP_CURSOR_MODIFIER_NONE,
GIMP_CURSOR_MODIFIER_PLUS,
GIMP_CURSOR_MODIFIER_MINUS,
GIMP_CURSOR_MODIFIER_INTERSECT,
GIMP_CURSOR_MODIFIER_MOVE,
GIMP_CURSOR_MODIFIER_RESIZE,
GIMP_CURSOR_MODIFIER_CONTROL,
GIMP_CURSOR_MODIFIER_ANCHOR,
GIMP_CURSOR_MODIFIER_FOREGROUND,
GIMP_CURSOR_MODIFIER_BACKGROUND,
GIMP_CURSOR_MODIFIER_PATTERN,
GIMP_CURSOR_MODIFIER_HAND,
GIMP_LAST_CURSOR_MODIFIER_ENTRY
} GimpCursorModifier;
typedef enum
{
GIMP_DEVICE_VALUE_MODE = 1 << 0,
GIMP_DEVICE_VALUE_AXES = 1 << 1,
GIMP_DEVICE_VALUE_KEYS = 1 << 2,
GIMP_DEVICE_VALUE_TOOL = 1 << 3,
GIMP_DEVICE_VALUE_FOREGROUND = 1 << 4,
GIMP_DEVICE_VALUE_BACKGROUND = 1 << 5,
GIMP_DEVICE_VALUE_BRUSH = 1 << 6,
GIMP_DEVICE_VALUE_PATTERN = 1 << 7,
GIMP_DEVICE_VALUE_GRADIENT = 1 << 8
} GimpDeviceValues;
#include "widgets/widgets-enums.h"
/* non-widget objects */
......
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