From ed2d178da359fc68f33dbefff1a42c8060747f0b Mon Sep 17 00:00:00 2001 From: Martin Nordholts Date: Mon, 1 Feb 2010 21:55:18 +0100 Subject: [PATCH] app: Get rid of config -> display module dependency In order to make a clear separation between the core modules and the UI modules, move the necessary enums from display-enums.h and widgets-enums.h to config-enums.h and the files gimpdisplayoptions.[ch] from the display to the config module. This removes the config -> display dependency. This change has three main benefits * It lets us remove includes of display files from the config module * We don't have to link gimp-console and test-config with a subset of object files from the display module * It is reflected in devel-docs/gimp-module-dependencies.svg that the application is made up of core modules and UI modules and that no core module depends on any UI module --- app/Makefile.am | 3 - app/actions/view-actions.c | 2 +- app/actions/view-commands.c | 2 +- app/config/Makefile.am | 38 +- app/config/config-enums.c | 226 ++++++ app/config/config-enums.h | 105 +++ app/config/config-types.h | 7 +- app/config/gimpdisplayconfig.c | 9 +- app/config/gimpdisplayconfig.h | 2 - app/{display => config}/gimpdisplayoptions.c | 5 +- app/{display => config}/gimpdisplayoptions.h | 0 app/config/gimpguiconfig.h | 2 - app/config/gimppluginconfig.h | 2 - app/core/core-types.h | 3 - app/display/Makefile.am | 2 - app/display/display-enums.c | 124 ---- app/display/display-enums.h | 49 -- app/display/gimpdisplayshell-appearance.c | 3 +- app/display/gimpdisplayshell-handlers.c | 2 +- app/display/gimpdisplayshell.c | 2 +- app/widgets/widgets-enums.c | 89 --- app/widgets/widgets-enums.h | 34 - devel-docs/gimp-module-dependencies.svg | 698 ++++++++++--------- po/POTFILES.in | 4 +- 24 files changed, 735 insertions(+), 678 deletions(-) create mode 100644 app/config/config-enums.c create mode 100644 app/config/config-enums.h rename app/{display => config}/gimpdisplayoptions.c (99%) rename app/{display => config}/gimpdisplayoptions.h (100%) diff --git a/app/Makefile.am b/app/Makefile.am index 3654e79f6d..dd5ef21817 100644 --- a/app/Makefile.am +++ b/app/Makefile.am @@ -142,9 +142,6 @@ AM_LDFLAGS = \ $(workaround_that_file_depends_on_plug_in) gimpconsoleldadd = \ - display/gimpdisplayoptions.o \ - display/display-enums.o \ - widgets/widgets-enums.o \ xcf/libappxcf.a \ pdb/libappinternal-procs.a \ pdb/libapppdb.a \ diff --git a/app/actions/view-actions.c b/app/actions/view-actions.c index d83312b865..b245653b12 100644 --- a/app/actions/view-actions.c +++ b/app/actions/view-actions.c @@ -26,6 +26,7 @@ #include "actions-types.h" +#include "config/gimpdisplayoptions.h" #include "config/gimpguiconfig.h" #include "core/gimp.h" @@ -39,7 +40,6 @@ #include "widgets/gimpwidgets-utils.h" #include "display/gimpdisplay.h" -#include "display/gimpdisplayoptions.h" #include "display/gimpdisplayshell.h" #include "display/gimpdisplayshell-appearance.h" #include "display/gimpdisplayshell-scale.h" diff --git a/app/actions/view-commands.c b/app/actions/view-commands.c index cacdd1680b..ace7806b7e 100644 --- a/app/actions/view-commands.c +++ b/app/actions/view-commands.c @@ -25,6 +25,7 @@ #include "actions-types.h" +#include "config/gimpdisplayoptions.h" #include "config/gimpguiconfig.h" #include "core/gimp.h" @@ -35,7 +36,6 @@ #include "display/gimpdisplay.h" #include "display/gimpdisplay-foreach.h" -#include "display/gimpdisplayoptions.h" #include "display/gimpdisplayshell.h" #include "display/gimpdisplayshell-appearance.h" #include "display/gimpdisplayshell-filter-dialog.h" diff --git a/app/config/Makefile.am b/app/config/Makefile.am index c3ad7c5c5a..968c37ccb1 100644 --- a/app/config/Makefile.am +++ b/app/config/Makefile.am @@ -21,7 +21,8 @@ INCLUDES = \ noinst_LIBRARIES = libappconfig.a -libappconfig_a_SOURCES = \ +libappconfig_a_sources = \ + config-enums.h \ config-types.h \ gimpconfig-dump.c \ gimpconfig-dump.h \ @@ -35,6 +36,8 @@ libappconfig_a_SOURCES = \ gimpcoreconfig.h \ gimpdisplayconfig.c \ gimpdisplayconfig.h \ + gimpdisplayoptions.c \ + gimpdisplayoptions.h \ gimpguiconfig.c \ gimpguiconfig.h \ gimppluginconfig.c \ @@ -51,6 +54,14 @@ libappconfig_a_SOURCES = \ gimpxmlparser.c \ gimpxmlparser.h +libappconfig_a_built_sources = \ + config-enums.c + +libappconfig_a_SOURCES = \ + $(libappconfig_a_built_sources) \ + $(libappconfig_a_sources) + + EXTRA_PROGRAMS = test-config EXTRA_DIST = makefile.msc @@ -77,9 +88,6 @@ test_config_LDFLAGS = \ -u $(SYMPREFIX)gimp_image_map_config_get_type test_config_LDADD = \ - ../display/gimpdisplayoptions.o \ - ../display/display-enums.o \ - ../widgets/widgets-enums.o \ ../xcf/libappxcf.a \ ../pdb/libappinternal-procs.a \ ../pdb/libapppdb.a \ @@ -107,3 +115,25 @@ test_config_LDADD = \ $(GLIB_LIBS) CLEANFILES = $(EXTRA_PROGRAMS) foorc + +# +# rules to generate built sources +# +# setup autogeneration dependencies +gen_sources = xgen-dec +CLEANFILES += $(gen_sources) + +config-enums.c: $(srcdir)/config-enums.h $(GIMP_MKENUMS) + $(GIMP_MKENUMS) \ + --fhead "#include \"config.h\"\n#include \n#include \"libgimpbase/gimpbase.h\"\n#include \"config-enums.h\"\n#include\"gimp-intl.h\"" \ + --fprod "\n/* enumerations from \"@filename@\" */" \ + --vhead "GType\n@enum_name@_get_type (void)\n{\n static const G@Type@Value values[] =\n {" \ + --vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \ + --vtail " { 0, NULL, NULL }\n };\n" \ + --dhead " static const Gimp@Type@Desc descs[] =\n {" \ + --dprod " { @VALUENAME@, @valuedesc@, @valuehelp@ }," \ + --dtail " { 0, NULL, NULL }\n };\n\n static GType type = 0;\n\n if (G_UNLIKELY (! type))\n {\n type = g_@type@_register_static (\"@EnumName@\", values);\n gimp_type_set_translation_context (type, \"@enumnick@\");\n gimp_@type@_set_value_descriptions (type, descs);\n }\n\n return type;\n}\n" \ + $(srcdir)/config-enums.h > xgen-dec \ + && cp xgen-dec $(@F) \ + && rm -f xgen-dec + diff --git a/app/config/config-enums.c b/app/config/config-enums.c new file mode 100644 index 0000000000..4844f87a61 --- /dev/null +++ b/app/config/config-enums.c @@ -0,0 +1,226 @@ + +/* Generated data (by gimp-mkenums) */ + +#include "config.h" +#include +#include "libgimpbase/gimpbase.h" +#include "config-enums.h" +#include"gimp-intl.h" + +/* enumerations from "./config-enums.h" */ +GType +gimp_cursor_mode_get_type (void) +{ + static const GEnumValue values[] = + { + { GIMP_CURSOR_MODE_TOOL_ICON, "GIMP_CURSOR_MODE_TOOL_ICON", "tool-icon" }, + { GIMP_CURSOR_MODE_TOOL_CROSSHAIR, "GIMP_CURSOR_MODE_TOOL_CROSSHAIR", "tool-crosshair" }, + { GIMP_CURSOR_MODE_CROSSHAIR, "GIMP_CURSOR_MODE_CROSSHAIR", "crosshair" }, + { 0, NULL, NULL } + }; + + static const GimpEnumDesc descs[] = + { + { GIMP_CURSOR_MODE_TOOL_ICON, NC_("cursor-mode", "Tool icon"), NULL }, + { GIMP_CURSOR_MODE_TOOL_CROSSHAIR, NC_("cursor-mode", "Tool icon with crosshair"), NULL }, + { GIMP_CURSOR_MODE_CROSSHAIR, NC_("cursor-mode", "Crosshair only"), NULL }, + { 0, NULL, NULL } + }; + + static GType type = 0; + + if (G_UNLIKELY (! type)) + { + type = g_enum_register_static ("GimpCursorMode", values); + gimp_type_set_translation_context (type, "cursor-mode"); + gimp_enum_set_value_descriptions (type, descs); + } + + return type; +} + +GType +gimp_canvas_padding_mode_get_type (void) +{ + static const GEnumValue values[] = + { + { GIMP_CANVAS_PADDING_MODE_DEFAULT, "GIMP_CANVAS_PADDING_MODE_DEFAULT", "default" }, + { GIMP_CANVAS_PADDING_MODE_LIGHT_CHECK, "GIMP_CANVAS_PADDING_MODE_LIGHT_CHECK", "light-check" }, + { GIMP_CANVAS_PADDING_MODE_DARK_CHECK, "GIMP_CANVAS_PADDING_MODE_DARK_CHECK", "dark-check" }, + { GIMP_CANVAS_PADDING_MODE_CUSTOM, "GIMP_CANVAS_PADDING_MODE_CUSTOM", "custom" }, + { 0, NULL, NULL } + }; + + static const GimpEnumDesc descs[] = + { + { GIMP_CANVAS_PADDING_MODE_DEFAULT, NC_("canvas-padding-mode", "From theme"), NULL }, + { GIMP_CANVAS_PADDING_MODE_LIGHT_CHECK, NC_("canvas-padding-mode", "Light check color"), NULL }, + { GIMP_CANVAS_PADDING_MODE_DARK_CHECK, NC_("canvas-padding-mode", "Dark check color"), NULL }, + { GIMP_CANVAS_PADDING_MODE_CUSTOM, NC_("canvas-padding-mode", "Custom color"), NULL }, + { 0, NULL, NULL } + }; + + static GType type = 0; + + if (G_UNLIKELY (! type)) + { + type = g_enum_register_static ("GimpCanvasPaddingMode", values); + gimp_type_set_translation_context (type, "canvas-padding-mode"); + gimp_enum_set_value_descriptions (type, descs); + } + + return type; +} + +GType +gimp_space_bar_action_get_type (void) +{ + static const GEnumValue values[] = + { + { GIMP_SPACE_BAR_ACTION_NONE, "GIMP_SPACE_BAR_ACTION_NONE", "none" }, + { GIMP_SPACE_BAR_ACTION_PAN, "GIMP_SPACE_BAR_ACTION_PAN", "pan" }, + { GIMP_SPACE_BAR_ACTION_MOVE, "GIMP_SPACE_BAR_ACTION_MOVE", "move" }, + { 0, NULL, NULL } + }; + + static const GimpEnumDesc descs[] = + { + { GIMP_SPACE_BAR_ACTION_NONE, NC_("space-bar-action", "No action"), NULL }, + { GIMP_SPACE_BAR_ACTION_PAN, NC_("space-bar-action", "Pan view"), NULL }, + { GIMP_SPACE_BAR_ACTION_MOVE, NC_("space-bar-action", "Switch to Move tool"), NULL }, + { 0, NULL, NULL } + }; + + static GType type = 0; + + if (G_UNLIKELY (! type)) + { + type = g_enum_register_static ("GimpSpaceBarAction", values); + gimp_type_set_translation_context (type, "space-bar-action"); + gimp_enum_set_value_descriptions (type, descs); + } + + return type; +} + +GType +gimp_zoom_quality_get_type (void) +{ + static const GEnumValue values[] = + { + { GIMP_ZOOM_QUALITY_LOW, "GIMP_ZOOM_QUALITY_LOW", "low" }, + { GIMP_ZOOM_QUALITY_HIGH, "GIMP_ZOOM_QUALITY_HIGH", "high" }, + { 0, NULL, NULL } + }; + + static const GimpEnumDesc descs[] = + { + { GIMP_ZOOM_QUALITY_LOW, NC_("zoom-quality", "Low"), NULL }, + { GIMP_ZOOM_QUALITY_HIGH, NC_("zoom-quality", "High"), NULL }, + { 0, NULL, NULL } + }; + + static GType type = 0; + + if (G_UNLIKELY (! type)) + { + type = g_enum_register_static ("GimpZoomQuality", values); + gimp_type_set_translation_context (type, "zoom-quality"); + gimp_enum_set_value_descriptions (type, descs); + } + + return type; +} + +GType +gimp_help_browser_type_get_type (void) +{ + static const GEnumValue values[] = + { + { GIMP_HELP_BROWSER_GIMP, "GIMP_HELP_BROWSER_GIMP", "gimp" }, + { GIMP_HELP_BROWSER_WEB_BROWSER, "GIMP_HELP_BROWSER_WEB_BROWSER", "web-browser" }, + { 0, NULL, NULL } + }; + + static const GimpEnumDesc descs[] = + { + { GIMP_HELP_BROWSER_GIMP, NC_("help-browser-type", "GIMP help browser"), NULL }, + { GIMP_HELP_BROWSER_WEB_BROWSER, NC_("help-browser-type", "Web browser"), NULL }, + { 0, NULL, NULL } + }; + + static GType type = 0; + + if (G_UNLIKELY (! type)) + { + type = g_enum_register_static ("GimpHelpBrowserType", values); + gimp_type_set_translation_context (type, "help-browser-type"); + gimp_enum_set_value_descriptions (type, descs); + } + + return type; +} + +GType +gimp_window_hint_get_type (void) +{ + static const GEnumValue values[] = + { + { GIMP_WINDOW_HINT_NORMAL, "GIMP_WINDOW_HINT_NORMAL", "normal" }, + { GIMP_WINDOW_HINT_UTILITY, "GIMP_WINDOW_HINT_UTILITY", "utility" }, + { GIMP_WINDOW_HINT_KEEP_ABOVE, "GIMP_WINDOW_HINT_KEEP_ABOVE", "keep-above" }, + { 0, NULL, NULL } + }; + + static const GimpEnumDesc descs[] = + { + { GIMP_WINDOW_HINT_NORMAL, NC_("window-hint", "Normal window"), NULL }, + { GIMP_WINDOW_HINT_UTILITY, NC_("window-hint", "Utility window"), NULL }, + { GIMP_WINDOW_HINT_KEEP_ABOVE, NC_("window-hint", "Keep above"), NULL }, + { 0, NULL, NULL } + }; + + static GType type = 0; + + if (G_UNLIKELY (! type)) + { + type = g_enum_register_static ("GimpWindowHint", values); + gimp_type_set_translation_context (type, "window-hint"); + gimp_enum_set_value_descriptions (type, descs); + } + + return type; +} + +GType +gimp_cursor_format_get_type (void) +{ + static const GEnumValue values[] = + { + { GIMP_CURSOR_FORMAT_BITMAP, "GIMP_CURSOR_FORMAT_BITMAP", "bitmap" }, + { GIMP_CURSOR_FORMAT_PIXBUF, "GIMP_CURSOR_FORMAT_PIXBUF", "pixbuf" }, + { 0, NULL, NULL } + }; + + static const GimpEnumDesc descs[] = + { + { GIMP_CURSOR_FORMAT_BITMAP, NC_("cursor-format", "Black & white"), NULL }, + { GIMP_CURSOR_FORMAT_PIXBUF, NC_("cursor-format", "Fancy"), NULL }, + { 0, NULL, NULL } + }; + + static GType type = 0; + + if (G_UNLIKELY (! type)) + { + type = g_enum_register_static ("GimpCursorFormat", values); + gimp_type_set_translation_context (type, "cursor-format"); + gimp_enum_set_value_descriptions (type, descs); + } + + return type; +} + + +/* Generated data ends here */ + diff --git a/app/config/config-enums.h b/app/config/config-enums.h new file mode 100644 index 0000000000..0bb477860c --- /dev/null +++ b/app/config/config-enums.h @@ -0,0 +1,105 @@ +/* GIMP - The GNU 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 3 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, see . + */ + +#ifndef __CONFIG_ENUMS_H__ +#define __CONFIG_ENUMS_H__ + + +#define GIMP_TYPE_CURSOR_MODE (gimp_cursor_mode_get_type ()) + +GType gimp_cursor_mode_get_type (void) G_GNUC_CONST; + +typedef enum +{ + GIMP_CURSOR_MODE_TOOL_ICON, /*< desc="Tool icon" >*/ + GIMP_CURSOR_MODE_TOOL_CROSSHAIR, /*< desc="Tool icon with crosshair" >*/ + GIMP_CURSOR_MODE_CROSSHAIR /*< desc="Crosshair only" >*/ +} GimpCursorMode; + + +#define GIMP_TYPE_CANVAS_PADDING_MODE (gimp_canvas_padding_mode_get_type ()) + +GType gimp_canvas_padding_mode_get_type (void) G_GNUC_CONST; + +typedef enum +{ + GIMP_CANVAS_PADDING_MODE_DEFAULT, /*< desc="From theme" >*/ + GIMP_CANVAS_PADDING_MODE_LIGHT_CHECK, /*< desc="Light check color" >*/ + GIMP_CANVAS_PADDING_MODE_DARK_CHECK, /*< desc="Dark check color" >*/ + GIMP_CANVAS_PADDING_MODE_CUSTOM, /*< desc="Custom color" >*/ + GIMP_CANVAS_PADDING_MODE_RESET = -1 /*< skip >*/ +} GimpCanvasPaddingMode; + + +#define GIMP_TYPE_SPACE_BAR_ACTION (gimp_space_bar_action_get_type ()) + +GType gimp_space_bar_action_get_type (void) G_GNUC_CONST; + +typedef enum +{ + GIMP_SPACE_BAR_ACTION_NONE, /*< desc="No action" >*/ + GIMP_SPACE_BAR_ACTION_PAN, /*< desc="Pan view" >*/ + GIMP_SPACE_BAR_ACTION_MOVE /*< desc="Switch to Move tool" >*/ +} GimpSpaceBarAction; + + +#define GIMP_TYPE_ZOOM_QUALITY (gimp_zoom_quality_get_type ()) + +GType gimp_zoom_quality_get_type (void) G_GNUC_CONST; + +typedef enum +{ + GIMP_ZOOM_QUALITY_LOW, /*< desc="Low" >*/ + GIMP_ZOOM_QUALITY_HIGH /*< desc="High" >*/ +} GimpZoomQuality; + + +#define GIMP_TYPE_HELP_BROWSER_TYPE (gimp_help_browser_type_get_type ()) + +GType gimp_help_browser_type_get_type (void) G_GNUC_CONST; + +typedef enum +{ + GIMP_HELP_BROWSER_GIMP, /*< desc="GIMP help browser" >*/ + GIMP_HELP_BROWSER_WEB_BROWSER /*< desc="Web browser" >*/ +} GimpHelpBrowserType; + + +#define GIMP_TYPE_WINDOW_HINT (gimp_window_hint_get_type ()) + +GType gimp_window_hint_get_type (void) G_GNUC_CONST; + +typedef enum +{ + GIMP_WINDOW_HINT_NORMAL, /*< desc="Normal window" >*/ + GIMP_WINDOW_HINT_UTILITY, /*< desc="Utility window" >*/ + GIMP_WINDOW_HINT_KEEP_ABOVE /*< desc="Keep above" >*/ +} GimpWindowHint; + + +#define GIMP_TYPE_CURSOR_FORMAT (gimp_cursor_format_get_type ()) + +GType gimp_cursor_format_get_type (void) G_GNUC_CONST; + +typedef enum +{ + GIMP_CURSOR_FORMAT_BITMAP, /*< desc="Black & white" >*/ + GIMP_CURSOR_FORMAT_PIXBUF /*< desc="Fancy" >*/ +} GimpCursorFormat; + + +#endif /* __CONFIG_ENUMS_H__ */ diff --git a/app/config/config-types.h b/app/config/config-types.h index 97fa63c1d3..eed275dbce 100644 --- a/app/config/config-types.h +++ b/app/config/config-types.h @@ -24,6 +24,12 @@ #include "libgimpconfig/gimpconfigtypes.h" +#include "config/config-enums.h" + + +#define GIMP_OPACITY_TRANSPARENT 0.0 +#define GIMP_OPACITY_OPAQUE 1.0 + typedef struct _GimpBaseConfig GimpBaseConfig; typedef struct _GimpCoreConfig GimpCoreConfig; @@ -34,7 +40,6 @@ typedef struct _GimpRc GimpRc; typedef struct _GimpXmlParser GimpXmlParser; -/* should be in display/display-types.h */ typedef struct _GimpDisplayOptions GimpDisplayOptions; /* should be in core/core-types.h */ diff --git a/app/config/gimpdisplayconfig.c b/app/config/gimpdisplayconfig.c index e2f0697ad6..5ce6399ee0 100644 --- a/app/config/gimpdisplayconfig.c +++ b/app/config/gimpdisplayconfig.c @@ -28,16 +28,9 @@ #include "config-types.h" -/* FIXME: If we can get rid of this dependency to the display module, - * we will greatly improve the module dependencies in the core, see - * devel-docs/gimp-module-dependencies.svg. In particular, we will get - * rid of the (transitive) dependency from the core to the UI code - */ -#include "display/display-enums.h" -#include "display/gimpdisplayoptions.h" - #include "gimprc-blurbs.h" #include "gimpdisplayconfig.h" +#include "gimpdisplayoptions.h" #include "gimp-intl.h" diff --git a/app/config/gimpdisplayconfig.h b/app/config/gimpdisplayconfig.h index ca184f4295..cfdbdf2a5d 100644 --- a/app/config/gimpdisplayconfig.h +++ b/app/config/gimpdisplayconfig.h @@ -21,8 +21,6 @@ #ifndef __GIMP_DISPLAY_CONFIG_H__ #define __GIMP_DISPLAY_CONFIG_H__ -#include "display/display-enums.h" - #include "config/gimpcoreconfig.h" diff --git a/app/display/gimpdisplayoptions.c b/app/config/gimpdisplayoptions.c similarity index 99% rename from app/display/gimpdisplayoptions.c rename to app/config/gimpdisplayoptions.c index 5cff716b44..82eb38805c 100644 --- a/app/display/gimpdisplayoptions.c +++ b/app/config/gimpdisplayoptions.c @@ -27,10 +27,9 @@ #include "libgimpcolor/gimpcolor.h" #include "libgimpconfig/gimpconfig.h" -#include "core/core-types.h" -#include "display-enums.h" +#include "config-types.h" -#include "config/gimprc-blurbs.h" +#include "gimprc-blurbs.h" #include "gimpdisplayoptions.h" diff --git a/app/display/gimpdisplayoptions.h b/app/config/gimpdisplayoptions.h similarity index 100% rename from app/display/gimpdisplayoptions.h rename to app/config/gimpdisplayoptions.h diff --git a/app/config/gimpguiconfig.h b/app/config/gimpguiconfig.h index 6963d74b5e..1e6d7f7785 100644 --- a/app/config/gimpguiconfig.h +++ b/app/config/gimpguiconfig.h @@ -21,8 +21,6 @@ #ifndef __GIMP_GUI_CONFIG_H__ #define __GIMP_GUI_CONFIG_H__ -#include "widgets/widgets-enums.h" - #include "config/gimpdisplayconfig.h" diff --git a/app/config/gimppluginconfig.h b/app/config/gimppluginconfig.h index 3f27fd5b11..bf34fd9330 100644 --- a/app/config/gimppluginconfig.h +++ b/app/config/gimppluginconfig.h @@ -21,8 +21,6 @@ #ifndef __GIMP_PLUGIN_CONFIG_H__ #define __GIMP_PLUGIN_CONFIG_H__ -#include "widgets/widgets-enums.h" - #include "config/gimpguiconfig.h" diff --git a/app/core/core-types.h b/app/core/core-types.h index ae01983097..eea2ac2b5a 100644 --- a/app/core/core-types.h +++ b/app/core/core-types.h @@ -29,9 +29,6 @@ /* defines */ -#define GIMP_OPACITY_TRANSPARENT 0.0 -#define GIMP_OPACITY_OPAQUE 1.0 - #define GIMP_COORDS_MIN_PRESSURE 0.0 #define GIMP_COORDS_MAX_PRESSURE 1.0 #define GIMP_COORDS_DEFAULT_PRESSURE 1.0 diff --git a/app/display/Makefile.am b/app/display/Makefile.am index 031ec421ea..987c99580c 100644 --- a/app/display/Makefile.am +++ b/app/display/Makefile.am @@ -23,8 +23,6 @@ libappdisplay_a_sources = \ gimpcursorview.h \ gimpdisplay.c \ gimpdisplay.h \ - gimpdisplayoptions.c \ - gimpdisplayoptions.h \ gimpdisplay-foreach.c \ gimpdisplay-foreach.h \ gimpdisplay-handlers.c \ diff --git a/app/display/display-enums.c b/app/display/display-enums.c index 7e48a1e0a2..0db113e5a1 100644 --- a/app/display/display-enums.c +++ b/app/display/display-enums.c @@ -8,37 +8,6 @@ #include"gimp-intl.h" /* enumerations from "./display-enums.h" */ -GType -gimp_cursor_mode_get_type (void) -{ - static const GEnumValue values[] = - { - { GIMP_CURSOR_MODE_TOOL_ICON, "GIMP_CURSOR_MODE_TOOL_ICON", "tool-icon" }, - { GIMP_CURSOR_MODE_TOOL_CROSSHAIR, "GIMP_CURSOR_MODE_TOOL_CROSSHAIR", "tool-crosshair" }, - { GIMP_CURSOR_MODE_CROSSHAIR, "GIMP_CURSOR_MODE_CROSSHAIR", "crosshair" }, - { 0, NULL, NULL } - }; - - static const GimpEnumDesc descs[] = - { - { GIMP_CURSOR_MODE_TOOL_ICON, NC_("cursor-mode", "Tool icon"), NULL }, - { GIMP_CURSOR_MODE_TOOL_CROSSHAIR, NC_("cursor-mode", "Tool icon with crosshair"), NULL }, - { GIMP_CURSOR_MODE_CROSSHAIR, NC_("cursor-mode", "Crosshair only"), NULL }, - { 0, NULL, NULL } - }; - - static GType type = 0; - - if (G_UNLIKELY (! type)) - { - type = g_enum_register_static ("GimpCursorMode", values); - gimp_type_set_translation_context (type, "cursor-mode"); - gimp_enum_set_value_descriptions (type, descs); - } - - return type; -} - GType gimp_cursor_precision_get_type (void) { @@ -70,99 +39,6 @@ gimp_cursor_precision_get_type (void) return type; } -GType -gimp_canvas_padding_mode_get_type (void) -{ - static const GEnumValue values[] = - { - { GIMP_CANVAS_PADDING_MODE_DEFAULT, "GIMP_CANVAS_PADDING_MODE_DEFAULT", "default" }, - { GIMP_CANVAS_PADDING_MODE_LIGHT_CHECK, "GIMP_CANVAS_PADDING_MODE_LIGHT_CHECK", "light-check" }, - { GIMP_CANVAS_PADDING_MODE_DARK_CHECK, "GIMP_CANVAS_PADDING_MODE_DARK_CHECK", "dark-check" }, - { GIMP_CANVAS_PADDING_MODE_CUSTOM, "GIMP_CANVAS_PADDING_MODE_CUSTOM", "custom" }, - { 0, NULL, NULL } - }; - - static const GimpEnumDesc descs[] = - { - { GIMP_CANVAS_PADDING_MODE_DEFAULT, NC_("canvas-padding-mode", "From theme"), NULL }, - { GIMP_CANVAS_PADDING_MODE_LIGHT_CHECK, NC_("canvas-padding-mode", "Light check color"), NULL }, - { GIMP_CANVAS_PADDING_MODE_DARK_CHECK, NC_("canvas-padding-mode", "Dark check color"), NULL }, - { GIMP_CANVAS_PADDING_MODE_CUSTOM, NC_("canvas-padding-mode", "Custom color"), NULL }, - { 0, NULL, NULL } - }; - - static GType type = 0; - - if (G_UNLIKELY (! type)) - { - type = g_enum_register_static ("GimpCanvasPaddingMode", values); - gimp_type_set_translation_context (type, "canvas-padding-mode"); - gimp_enum_set_value_descriptions (type, descs); - } - - return type; -} - -GType -gimp_space_bar_action_get_type (void) -{ - static const GEnumValue values[] = - { - { GIMP_SPACE_BAR_ACTION_NONE, "GIMP_SPACE_BAR_ACTION_NONE", "none" }, - { GIMP_SPACE_BAR_ACTION_PAN, "GIMP_SPACE_BAR_ACTION_PAN", "pan" }, - { GIMP_SPACE_BAR_ACTION_MOVE, "GIMP_SPACE_BAR_ACTION_MOVE", "move" }, - { 0, NULL, NULL } - }; - - static const GimpEnumDesc descs[] = - { - { GIMP_SPACE_BAR_ACTION_NONE, NC_("space-bar-action", "No action"), NULL }, - { GIMP_SPACE_BAR_ACTION_PAN, NC_("space-bar-action", "Pan view"), NULL }, - { GIMP_SPACE_BAR_ACTION_MOVE, NC_("space-bar-action", "Switch to Move tool"), NULL }, - { 0, NULL, NULL } - }; - - static GType type = 0; - - if (G_UNLIKELY (! type)) - { - type = g_enum_register_static ("GimpSpaceBarAction", values); - gimp_type_set_translation_context (type, "space-bar-action"); - gimp_enum_set_value_descriptions (type, descs); - } - - return type; -} - -GType -gimp_zoom_quality_get_type (void) -{ - static const GEnumValue values[] = - { - { GIMP_ZOOM_QUALITY_LOW, "GIMP_ZOOM_QUALITY_LOW", "low" }, - { GIMP_ZOOM_QUALITY_HIGH, "GIMP_ZOOM_QUALITY_HIGH", "high" }, - { 0, NULL, NULL } - }; - - static const GimpEnumDesc descs[] = - { - { GIMP_ZOOM_QUALITY_LOW, NC_("zoom-quality", "Low"), NULL }, - { GIMP_ZOOM_QUALITY_HIGH, NC_("zoom-quality", "High"), NULL }, - { 0, NULL, NULL } - }; - - static GType type = 0; - - if (G_UNLIKELY (! type)) - { - type = g_enum_register_static ("GimpZoomQuality", values); - gimp_type_set_translation_context (type, "zoom-quality"); - gimp_enum_set_value_descriptions (type, descs); - } - - return type; -} - GType gimp_zoom_focus_get_type (void) { diff --git a/app/display/display-enums.h b/app/display/display-enums.h index 9455aceff4..28a1ae1839 100644 --- a/app/display/display-enums.h +++ b/app/display/display-enums.h @@ -19,18 +19,6 @@ #define __DISPLAY_ENUMS_H__ -#define GIMP_TYPE_CURSOR_MODE (gimp_cursor_mode_get_type ()) - -GType gimp_cursor_mode_get_type (void) G_GNUC_CONST; - -typedef enum -{ - GIMP_CURSOR_MODE_TOOL_ICON, /*< desc="Tool icon" >*/ - GIMP_CURSOR_MODE_TOOL_CROSSHAIR, /*< desc="Tool icon with crosshair" >*/ - GIMP_CURSOR_MODE_CROSSHAIR /*< desc="Crosshair only" >*/ -} GimpCursorMode; - - #define GIMP_TYPE_CURSOR_PRECISION (gimp_cursor_precision_get_type ()) GType gimp_cursor_precision_get_type (void) G_GNUC_CONST; @@ -43,43 +31,6 @@ typedef enum } GimpCursorPrecision; -#define GIMP_TYPE_CANVAS_PADDING_MODE (gimp_canvas_padding_mode_get_type ()) - -GType gimp_canvas_padding_mode_get_type (void) G_GNUC_CONST; - -typedef enum -{ - GIMP_CANVAS_PADDING_MODE_DEFAULT, /*< desc="From theme" >*/ - GIMP_CANVAS_PADDING_MODE_LIGHT_CHECK, /*< desc="Light check color" >*/ - GIMP_CANVAS_PADDING_MODE_DARK_CHECK, /*< desc="Dark check color" >*/ - GIMP_CANVAS_PADDING_MODE_CUSTOM, /*< desc="Custom color" >*/ - GIMP_CANVAS_PADDING_MODE_RESET = -1 /*< skip >*/ -} GimpCanvasPaddingMode; - - -#define GIMP_TYPE_SPACE_BAR_ACTION (gimp_space_bar_action_get_type ()) - -GType gimp_space_bar_action_get_type (void) G_GNUC_CONST; - -typedef enum -{ - GIMP_SPACE_BAR_ACTION_NONE, /*< desc="No action" >*/ - GIMP_SPACE_BAR_ACTION_PAN, /*< desc="Pan view" >*/ - GIMP_SPACE_BAR_ACTION_MOVE /*< desc="Switch to Move tool" >*/ -} GimpSpaceBarAction; - - -#define GIMP_TYPE_ZOOM_QUALITY (gimp_zoom_quality_get_type ()) - -GType gimp_zoom_quality_get_type (void) G_GNUC_CONST; - -typedef enum -{ - GIMP_ZOOM_QUALITY_LOW, /*< desc="Low" >*/ - GIMP_ZOOM_QUALITY_HIGH /*< desc="High" >*/ -} GimpZoomQuality; - - #define GIMP_TYPE_ZOOM_FOCUS (gimp_zoom_focus_get_type ()) GType gimp_zoom_focus_get_type (void) G_GNUC_CONST; diff --git a/app/display/gimpdisplayshell-appearance.c b/app/display/gimpdisplayshell-appearance.c index 3bc5bbd896..269d3d9e0d 100644 --- a/app/display/gimpdisplayshell-appearance.c +++ b/app/display/gimpdisplayshell-appearance.c @@ -25,6 +25,8 @@ #include "display-types.h" +#include "config/gimpdisplayoptions.h" + #include "core/gimp.h" #include "core/gimpcontext.h" #include "core/gimpimage.h" @@ -39,7 +41,6 @@ #include "gimpcanvas.h" #include "gimpdisplay.h" -#include "gimpdisplayoptions.h" #include "gimpdisplayshell.h" #include "gimpdisplayshell-appearance.h" #include "gimpdisplayshell-expose.h" diff --git a/app/display/gimpdisplayshell-handlers.c b/app/display/gimpdisplayshell-handlers.c index 79e77d4ced..58b8cb8a1b 100644 --- a/app/display/gimpdisplayshell-handlers.c +++ b/app/display/gimpdisplayshell-handlers.c @@ -27,6 +27,7 @@ #include "display-types.h" #include "config/gimpdisplayconfig.h" +#include "config/gimpdisplayoptions.h" #include "core/gimp.h" #include "core/gimpcontainer.h" @@ -39,7 +40,6 @@ #include "widgets/gimpwidgets-utils.h" #include "gimpdisplay.h" -#include "gimpdisplayoptions.h" #include "gimpdisplayshell.h" #include "gimpdisplayshell-appearance.h" #include "gimpdisplayshell-callbacks.h" diff --git a/app/display/gimpdisplayshell.c b/app/display/gimpdisplayshell.c index dddca53c92..e6c9d31e8e 100644 --- a/app/display/gimpdisplayshell.c +++ b/app/display/gimpdisplayshell.c @@ -33,6 +33,7 @@ #include "config/gimpcoreconfig.h" #include "config/gimpdisplayconfig.h" +#include "config/gimpdisplayoptions.h" #include "core/gimp.h" #include "core/gimpchannel.h" @@ -53,7 +54,6 @@ #include "gimpcanvas.h" #include "gimpdisplay.h" -#include "gimpdisplayoptions.h" #include "gimpdisplayshell.h" #include "gimpdisplayshell-appearance.h" #include "gimpdisplayshell-callbacks.h" diff --git a/app/widgets/widgets-enums.c b/app/widgets/widgets-enums.c index e56215b014..826edb1eb4 100644 --- a/app/widgets/widgets-enums.c +++ b/app/widgets/widgets-enums.c @@ -163,64 +163,6 @@ gimp_color_pick_state_get_type (void) return type; } -GType -gimp_cursor_format_get_type (void) -{ - static const GEnumValue values[] = - { - { GIMP_CURSOR_FORMAT_BITMAP, "GIMP_CURSOR_FORMAT_BITMAP", "bitmap" }, - { GIMP_CURSOR_FORMAT_PIXBUF, "GIMP_CURSOR_FORMAT_PIXBUF", "pixbuf" }, - { 0, NULL, NULL } - }; - - static const GimpEnumDesc descs[] = - { - { GIMP_CURSOR_FORMAT_BITMAP, NC_("cursor-format", "Black & white"), NULL }, - { GIMP_CURSOR_FORMAT_PIXBUF, NC_("cursor-format", "Fancy"), NULL }, - { 0, NULL, NULL } - }; - - static GType type = 0; - - if (G_UNLIKELY (! type)) - { - type = g_enum_register_static ("GimpCursorFormat", values); - gimp_type_set_translation_context (type, "cursor-format"); - gimp_enum_set_value_descriptions (type, descs); - } - - return type; -} - -GType -gimp_help_browser_type_get_type (void) -{ - static const GEnumValue values[] = - { - { GIMP_HELP_BROWSER_GIMP, "GIMP_HELP_BROWSER_GIMP", "gimp" }, - { GIMP_HELP_BROWSER_WEB_BROWSER, "GIMP_HELP_BROWSER_WEB_BROWSER", "web-browser" }, - { 0, NULL, NULL } - }; - - static const GimpEnumDesc descs[] = - { - { GIMP_HELP_BROWSER_GIMP, NC_("help-browser-type", "GIMP help browser"), NULL }, - { GIMP_HELP_BROWSER_WEB_BROWSER, NC_("help-browser-type", "Web browser"), NULL }, - { 0, NULL, NULL } - }; - - static GType type = 0; - - if (G_UNLIKELY (! type)) - { - type = g_enum_register_static ("GimpHelpBrowserType", values); - gimp_type_set_translation_context (type, "help-browser-type"); - gimp_enum_set_value_descriptions (type, descs); - } - - return type; -} - GType gimp_histogram_scale_get_type (void) { @@ -320,37 +262,6 @@ gimp_tag_entry_mode_get_type (void) return type; } -GType -gimp_window_hint_get_type (void) -{ - static const GEnumValue values[] = - { - { GIMP_WINDOW_HINT_NORMAL, "GIMP_WINDOW_HINT_NORMAL", "normal" }, - { GIMP_WINDOW_HINT_UTILITY, "GIMP_WINDOW_HINT_UTILITY", "utility" }, - { GIMP_WINDOW_HINT_KEEP_ABOVE, "GIMP_WINDOW_HINT_KEEP_ABOVE", "keep-above" }, - { 0, NULL, NULL } - }; - - static const GimpEnumDesc descs[] = - { - { GIMP_WINDOW_HINT_NORMAL, NC_("window-hint", "Normal window"), NULL }, - { GIMP_WINDOW_HINT_UTILITY, NC_("window-hint", "Utility window"), NULL }, - { GIMP_WINDOW_HINT_KEEP_ABOVE, NC_("window-hint", "Keep above"), NULL }, - { 0, NULL, NULL } - }; - - static GType type = 0; - - if (G_UNLIKELY (! type)) - { - type = g_enum_register_static ("GimpWindowHint", values); - gimp_type_set_translation_context (type, "window-hint"); - gimp_enum_set_value_descriptions (type, descs); - } - - return type; -} - /* Generated data ends here */ diff --git a/app/widgets/widgets-enums.h b/app/widgets/widgets-enums.h index 13df471ac8..8404478d6f 100644 --- a/app/widgets/widgets-enums.h +++ b/app/widgets/widgets-enums.h @@ -83,28 +83,6 @@ typedef enum } GimpColorPickState; -#define GIMP_TYPE_CURSOR_FORMAT (gimp_cursor_format_get_type ()) - -GType gimp_cursor_format_get_type (void) G_GNUC_CONST; - -typedef enum -{ - GIMP_CURSOR_FORMAT_BITMAP, /*< desc="Black & white" >*/ - GIMP_CURSOR_FORMAT_PIXBUF /*< desc="Fancy" >*/ -} GimpCursorFormat; - - -#define GIMP_TYPE_HELP_BROWSER_TYPE (gimp_help_browser_type_get_type ()) - -GType gimp_help_browser_type_get_type (void) G_GNUC_CONST; - -typedef enum -{ - GIMP_HELP_BROWSER_GIMP, /*< desc="GIMP help browser" >*/ - GIMP_HELP_BROWSER_WEB_BROWSER /*< desc="Web browser" >*/ -} GimpHelpBrowserType; - - #define GIMP_TYPE_HISTOGRAM_SCALE (gimp_histogram_scale_get_type ()) GType gimp_histogram_scale_get_type (void) G_GNUC_CONST; @@ -144,18 +122,6 @@ typedef enum } GimpTagEntryMode; -#define GIMP_TYPE_WINDOW_HINT (gimp_window_hint_get_type ()) - -GType gimp_window_hint_get_type (void) G_GNUC_CONST; - -typedef enum -{ - GIMP_WINDOW_HINT_NORMAL, /*< desc="Normal window" >*/ - GIMP_WINDOW_HINT_UTILITY, /*< desc="Utility window" >*/ - GIMP_WINDOW_HINT_KEEP_ABOVE /*< desc="Keep above" >*/ -} GimpWindowHint; - - /* * non-registered enums; register them if needed */ diff --git a/devel-docs/gimp-module-dependencies.svg b/devel-docs/gimp-module-dependencies.svg index 9778ed85c9..f0a36e1a79 100644 --- a/devel-docs/gimp-module-dependencies.svg +++ b/devel-docs/gimp-module-dependencies.svg @@ -1,385 +1,393 @@ - -]> - + + - - + + _anonymous_0 - - -app/tests - -app/tests - - -app/vectors - -app/vectors - - -app/tests->app/vectors - - - - -app/core - -app/core - - -app/vectors->app/core - - - - -app/xcf - -app/xcf - - -app/core->app/xcf - - - - -Cairo - -Cairo - - -app/core->Cairo - - - + -app/plug-in - -app/plug-in - - -app/xcf->app/plug-in - - - - -app/widgets - -app/widgets - - -app/dialogs - -app/dialogs - - -app/widgets->app/dialogs - - - - -libgimpmodule - -libgimpmodule - - -app/dialogs->libgimpmodule - - - - -app/gui - -app/gui - - -app/dialogs->app/gui - - - - -libgimpbase - -libgimpbase - - -libgimpmodule->libgimpbase - - - - -app/actions - -app/actions - - -app/gui->app/actions - - - - -app/file - -app/file - - -app/plug-in->app/file - - - - -app/pdb - -app/pdb - - -app/file->app/pdb - - - - -app/paint - -app/paint - - -app/pdb->app/paint - - - - -GTK+ - -GTK+ - - -GEGL - -GEGL - - -app/paint-funcs - -app/paint-funcs - - -app/paint->app/paint-funcs - - - - -GLib - -GLib - - -libgimpcolor - -libgimpcolor - - -libgimpbase->libgimpcolor - - - - -libgimpmath - -libgimpmath - - -libgimpcolor->libgimpmath - - - - -libgimpmath->GLib - - - - -libgimpthumb - -libgimpthumb - - -app/actions->libgimpthumb - - - - -app/menus - -app/menus - - -app/actions->app/menus - - - - -app/tools - -app/tools - - -app/actions->app/tools - - - - -app/display - -app/display - - -app/display->app/widgets - - - - -app/base - -app/base - - -app/paint-funcs->app/base - - - - -app/config - -app/config - - -app/base->app/config - - +app/plug-in + +app/plug-in -app/composite - -app/composite +app/composite + +app/composite - -app/base->app/composite - - + +app/plug-in->app/composite + + - -app/config->app/display - - + +app/base + +app/base -app/composite->app/base - - +app/composite->app/base + + - -libgimpconfig - -libgimpconfig + +app/config + +app/config - -libgimpconfig->libgimpbase - - + +app/base->app/config + + - -app/text - -app/text + +libgimpcolor + +libgimpcolor - -app/text->app/vectors - - + +libgimpmath + +libgimpmath - -Pango - -Pango + +libgimpcolor->libgimpmath + + - -app/text->Pango - - + +GLib + +GLib - -libgimpthumb->libgimpbase - - + +libgimpmath->GLib + + - -app/menus->app/plug-in - - + +app/core + +app/core - -app/tools->app/text - - + +app/config->app/core + + + + +GEGL + +GEGL + + +app/pdb + +app/pdb + + +app/core->app/pdb + + -app/gegl - -app/gegl +app/gegl + +app/gegl - -app/tools->app/gegl - - + +app/core->app/gegl + + - -libgimpwidgets - -libgimpwidgets + +app/xcf + +app/xcf - -app/tools->libgimpwidgets - - + +app/core->app/xcf + + + + +app/file + +app/file + + +app/pdb->app/file + + + + +libgimpmodule + +libgimpmodule + + +app/pdb->libgimpmodule + + -app/gegl->app/core - - +app/gegl->app/core + + - -app/gegl->GEGL - - + +app/text + +app/text - -libgimpwidgets->GTK+ - - + +app/xcf->app/text + + + + +app/file->app/plug-in + + + + +libgimpthumb + +libgimpthumb + + +app/file->libgimpthumb + + + + +libgimpbase + +libgimpbase + + +libgimpmodule->libgimpbase + + + + +app/vectors + +app/vectors + + +app/text->app/vectors + + + + +Pango + +Pango + + +app/text->Pango + + + + +libgimpbase->libgimpcolor + + + + +libgimpconfig + +libgimpconfig + + +libgimpconfig->libgimpbase + + + + +libgimpthumb->libgimpbase + + + + +Cairo + +Cairo + + +app/actions + +app/actions + + +app/dialogs + +app/dialogs + + +app/actions->app/dialogs + + + + +app/gui + +app/gui + + +app/dialogs->app/gui + + + + +app/display + +app/display + + +app/gui->app/display + + + + +app/widgets + +app/widgets + + +app/display->app/widgets + + + + +libgimpwidgets + +libgimpwidgets -libgimpwidgets->libgimpconfig - - +libgimpwidgets->libgimpconfig + + + + +GTK+ + +GTK+ + + +libgimpwidgets->GTK+ + + + + +app/menus + +app/menus + + +app/widgets->app/menus + + + + +app/tools + +app/tools + + +app/widgets->app/tools + + + + +app/menus->app/actions + + + + +app/tools->app/core + + + + +app/tools->app/dialogs + + + + +app/tools->libgimpwidgets + + + + +app/vectors->Cairo + + + + +app/paint + +app/paint + + +app/vectors->app/paint + + + + +app/paint->GEGL + + + + +app/paint->libgimpconfig + + + + +app/paint-funcs + +app/paint-funcs + + +app/paint->app/paint-funcs + + + + +app/paint-funcs->app/composite + + libgimp - -libgimp + +libgimp -libgimp->libgimpmodule - - +libgimp->libgimpmodule + + -libgimp->libgimpwidgets - - +libgimp->libgimpwidgets + + + + +app/tests + +app/tests + + +app/tests->app/dialogs + + diff --git a/po/POTFILES.in b/po/POTFILES.in index 17a3f01758..9e856a3e4f 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -81,7 +81,9 @@ app/actions/windows-actions.c app/base/base-enums.c app/base/tile-swap.c +app/config/config-enums.c app/config/gimpconfig-file.c +app/config/gimpdisplayoptions.c app/config/gimprc.c app/config/gimprc-blurbs.h app/config/gimprc-deserialize.c @@ -204,11 +206,9 @@ app/dialogs/vectors-export-dialog.c app/dialogs/vectors-import-dialog.c app/dialogs/vectors-options-dialog.c -app/display/display-enums.c app/display/gimpcursorview.c app/display/gimpdisplay.c app/display/gimpdisplay-handlers.c -app/display/gimpdisplayoptions.c app/display/gimpdisplayshell.c app/display/gimpdisplayshell-callbacks.c app/display/gimpdisplayshell-close.c