Commit 39ab860e authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann
Browse files

app/display/Makefile.am new file with GimpCursorMode enum.

2001-12-18  Sven Neumann  <sven@gimp.org>

	* app/display/Makefile.am
	* app/display/display-enums.h: new file with GimpCursorMode enum.

	* app/display/display-types.h: removed CursorMode enum here, include
	display-enums.h.

	* app/gimprc.c
	* app/display/gimpdisplayshell.c
	* app/gui/preferences-dialog.c: changed accordingly.

	* app/config/Makefile.am
	* app/config/gimpbaseconfig.[ch]
	* app/config/gimpcoreconfig.[ch]
	* app/config/gimpdisplayconfig.[ch]
	* app/config/gimpguiconfig.[ch]: implemented the remaining properties.
parent 3ecdd091
2001-12-18 Sven Neumann <sven@gimp.org>
* app/display/Makefile.am
* app/display/display-enums.h: new file with GimpCursorMode enum.
* app/display/display-types.h: removed CursorMode enum here, include
display-enums.h.
* app/gimprc.c
* app/display/gimpdisplayshell.c
* app/gui/preferences-dialog.c: changed accordingly.
* app/config/Makefile.am
* app/config/gimpbaseconfig.[ch]
* app/config/gimpcoreconfig.[ch]
* app/config/gimpdisplayconfig.[ch]
* app/config/gimpguiconfig.[ch]: implemented the remaining properties.
2001-12-18 Sven Neumann <sven@gimp.org>
* app/config/Makefile.am
......
......@@ -50,6 +50,7 @@ test_config_DEPENDENCIES = @STRIP_BEGIN@ \
libappconfig.a \
../base/libappbase.a \
../core/libappcore.a \
../display/libappdisplay.a \
$(top_builddir)/libgimpbase/libgimpbase-$(LT_RELEASE).la \
@STRIP_END@
......
......@@ -25,8 +25,6 @@
#include "libgimpbase/gimpbase.h"
#include "base/base-enums.h"
#include "gimpconfig.h"
#include "gimpconfig-params.h"
#include "gimpconfig-types.h"
......
......@@ -22,6 +22,8 @@
#ifndef __GIMP_BASE_CONFIG_H__
#define __GIMP_BASE_CONFIG_H__
#include "base/base-enums.h"
#define GIMP_TYPE_BASE_CONFIG (gimp_base_config_get_type ())
#define GIMP_BASE_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_BASE_CONFIG, GimpBaseConfig))
......
......@@ -25,9 +25,6 @@
#include "libgimpbase/gimpbase.h"
#include "base/base-enums.h"
#include "core/core-enums.h"
#include "gimpconfig.h"
#include "gimpconfig-params.h"
#include "gimpconfig-types.h"
......
......@@ -22,6 +22,8 @@
#ifndef __GIMP_CORE_CONFIG_H__
#define __GIMP_CORE_CONFIG_H__
#include "core/core-enums.h"
#include "gimpbaseconfig.h"
......@@ -41,36 +43,27 @@ struct _GimpCoreConfig
gchar *plug_in_path;
gchar *module_path;
gchar *brush_path;
gchar *pattern_path;
gchar *palette_path;
gchar *gradient_path;
gchar *default_brush;
gchar *default_pattern;
gchar *default_palette;
gchar *default_gradient;
gchar *default_comment;
GimpImageBaseType default_image_type;
gint default_image_width;
gint default_image_height;
GimpUnit default_unit;
gdouble default_xresolution;
gdouble default_yresolution;
GimpUnit default_resolution_unit;
gint levels_of_undo;
gchar *plug_in_rc_path;
gchar *module_load_inhibit;
GimpPreviewSize preview_size;
gboolean write_thumbnails;
gdouble gamma_val;
gboolean install_cmap;
gint min_colors;
......
......@@ -25,9 +25,6 @@
#include "libgimpbase/gimpbase.h"
#include "base/base-enums.h"
#include "core/core-enums.h"
#include "gimpconfig.h"
#include "gimpconfig-params.h"
#include "gimpconfig-types.h"
......@@ -119,9 +116,12 @@ gimp_display_config_class_init (GimpDisplayConfigClass *klass)
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_DEFAULT_DOT_FOR_DOT,
"default-dot-for-dot",
TRUE);
/* FIXME: insert cursor_mode and cursor_updating here */
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_CURSOR_MODE,
"cursor-mode",
GIMP_TYPE_CURSOR_MODE, GIMP_CURSOR_MODE_TOOL_ICON);
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_CURSOR_UPDATING,
"cursor-updating",
TRUE);
GIMP_CONFIG_INSTALL_PROP_STRING (object_class, PROP_IMAGE_TITLE_FORMAT,
"image-title-format",
"%f-%p.%i (%t)");
......@@ -172,6 +172,12 @@ gimp_display_config_set_property (GObject *object,
case PROP_DEFAULT_DOT_FOR_DOT:
display_config->default_dot_for_dot = g_value_get_boolean (value);
break;
case PROP_CURSOR_MODE:
display_config->cursor_mode = g_value_get_enum (value);
break;
case PROP_CURSOR_UPDATING:
display_config->cursor_updating = g_value_get_boolean (value);
break;
case PROP_IMAGE_TITLE_FORMAT:
g_free (display_config->image_title_format);
display_config->image_title_format = g_value_dup_string (value);
......@@ -228,6 +234,12 @@ gimp_display_config_get_property (GObject *object,
case PROP_DEFAULT_DOT_FOR_DOT:
g_value_set_boolean (value, display_config->default_dot_for_dot);
break;
case PROP_CURSOR_MODE:
g_value_set_enum (value, display_config->cursor_mode);
break;
case PROP_CURSOR_UPDATING:
g_value_set_boolean (value, display_config->cursor_updating);
break;
case PROP_IMAGE_TITLE_FORMAT:
g_value_set_string (value, display_config->image_title_format);
break;
......
......@@ -22,6 +22,8 @@
#ifndef __GIMP_DISPLAY_CONFIG_H__
#define __GIMP_DISPLAY_CONFIG_H__
#include "display/display-enums.h"
#include "gimpcoreconfig.h"
......@@ -41,21 +43,15 @@ struct _GimpDisplayConfig
gint marching_ants_speed;
gboolean colormap_cycling;
gboolean resize_windows_on_zoom;
gboolean resize_windows_on_resize;
gboolean default_dot_for_dot;
gint cursor_mode;
GimpCursorMode cursor_mode;
gboolean cursor_updating;
gchar *image_title_format;
gboolean show_rulers;
gboolean show_statusbar;
gboolean confirm_on_close;
gdouble monitor_xres;
gdouble monitor_yres;
gboolean monitor_res_from_gdk;
......
......@@ -25,9 +25,6 @@
#include "libgimpbase/gimpbase.h"
#include "base/base-enums.h"
#include "core/core-enums.h"
#include "gimpconfig.h"
#include "gimpconfig-params.h"
#include "gimpconfig-types.h"
......@@ -65,9 +62,11 @@ enum
PROP_SHOW_TIPS,
PROP_SHOW_TOOL_TIPS,
PROP_TEAROFF_MENUS,
PROP_SHOW_INDICATORS,
PROP_MAX_NEW_IMAGE_SIZE,
PROP_THEME_PATH,
PROP_THEME
PROP_THEME,
PROP_USE_HELP
};
......@@ -157,6 +156,9 @@ gimp_gui_config_class_init (GimpGuiConfigClass *klass)
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_TEAROFF_MENUS,
"tearoff-menus",
TRUE);
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SHOW_INDICATORS,
"show-indicators",
TRUE);
GIMP_CONFIG_INSTALL_PROP_MEMSIZE (object_class, PROP_MAX_NEW_IMAGE_SIZE,
"max-new-image-size",
0, G_MAXUINT, 1 << 25);
......@@ -166,6 +168,9 @@ gimp_gui_config_class_init (GimpGuiConfigClass *klass)
GIMP_CONFIG_INSTALL_PROP_STRING (object_class, PROP_THEME,
"theme",
NULL);
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_USE_HELP,
"use-help",
TRUE);
}
static void
......@@ -228,6 +233,9 @@ gimp_gui_config_set_property (GObject *object,
case PROP_TEAROFF_MENUS:
gui_config->tearoff_menus = g_value_get_boolean (value);
break;
case PROP_SHOW_INDICATORS:
gui_config->show_indicators = g_value_get_boolean (value);
break;
case PROP_MAX_NEW_IMAGE_SIZE:
gui_config->max_new_image_size = g_value_get_uint (value);
break;
......@@ -239,6 +247,9 @@ gimp_gui_config_set_property (GObject *object,
g_free (gui_config->theme);
gui_config->theme = g_value_dup_string (value);
break;
case PROP_USE_HELP:
gui_config->use_help = g_value_get_boolean (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
......@@ -306,6 +317,9 @@ gimp_gui_config_get_property (GObject *object,
case PROP_TEAROFF_MENUS:
g_value_set_boolean (value, gui_config->tearoff_menus);
break;
case PROP_SHOW_INDICATORS:
g_value_set_boolean (value, gui_config->show_indicators);
break;
case PROP_MAX_NEW_IMAGE_SIZE:
g_value_set_uint (value, gui_config->max_new_image_size);
break;
......@@ -315,6 +329,9 @@ gimp_gui_config_get_property (GObject *object,
case PROP_THEME:
g_value_set_string (value, gui_config->theme);
break;
case PROP_USE_HELP:
g_value_set_boolean (value, gui_config->use_help);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
......
......@@ -40,39 +40,27 @@ struct _GimpGuiConfig
GimpDisplayConfig parent_instance;
gint last_opened_size;
GimpCheckSize transparency_size;
GimpCheckType transparency_type;
gboolean perfect_mouse;
gint default_threshold;
GimpPreviewSize nav_preview_size;
gboolean nav_window_per_display;
gboolean info_window_per_display;
gboolean global_paint_options;
gboolean trust_dirty_flag;
gboolean save_device_status;
gboolean save_session_info;
gboolean restore_session;
gboolean show_tips;
gboolean show_tool_tips;
gboolean tearoff_menus;
gboolean show_indicators;
guint max_new_image_size;
gchar *theme_path;
gchar *theme;
/* the fields below have not yet been implemented as properties */
gboolean show_indicators;
gboolean use_help;
gint help_browser;
gint help_browser; /* FIXME: not yet a property */
};
struct _GimpGuiConfigClass
......
......@@ -2325,11 +2325,11 @@ preferences_dialog_create (Gimp *gimp)
GINT_TO_POINTER (gimprc.cursor_mode),
_("Tool Icon"),
GINT_TO_POINTER (CURSOR_MODE_TOOL_ICON), NULL,
GINT_TO_POINTER (GIMP_CURSOR_MODE_TOOL_ICON), NULL,
_("Tool Icon with Crosshair"),
GINT_TO_POINTER (CURSOR_MODE_TOOL_CROSSHAIR), NULL,
GINT_TO_POINTER (GIMP_CURSOR_MODE_TOOL_CROSSHAIR), NULL,
_("Crosshair only"),
GINT_TO_POINTER (CURSOR_MODE_CROSSHAIR), NULL,
GINT_TO_POINTER (GIMP_CURSOR_MODE_CROSSHAIR), NULL,
NULL);
......
......@@ -4,3 +4,4 @@ Makefile.in
.libs
*.lo
libappdisplay.la
display-enums.c
## Process this file with automake to produce Makefile.in
AM_CPPFLAGS = @STRIP_BEGIN@ \
-DG_LOG_DOMAIN=\"Gimp-Display\" \
@GIMP_THREAD_FLAGS@ \
@GIMP_MP_FLAGS@ \
@STRIP_END@
INCLUDES = @STRIP_BEGIN@ \
-I$(top_srcdir) \
-I$(top_srcdir)/app \
$(GTK_CFLAGS) \
-I$(includedir) \
@STRIP_END@
noinst_LIBRARIES = libappdisplay.a
libappdisplay_a_SOURCES = @STRIP_BEGIN@ \
libappdisplay_a_sources = @STRIP_BEGIN@ \
display-enums.h \
display-types.h \
gimpdisplay.c \
gimpdisplay.h \
......@@ -33,15 +47,26 @@ libappdisplay_a_SOURCES = @STRIP_BEGIN@ \
gimpdisplayshell-selection.h \
@STRIP_END@
AM_CPPFLAGS = @STRIP_BEGIN@ \
-DG_LOG_DOMAIN=\"Gimp-Display\" \
@GIMP_THREAD_FLAGS@ \
@GIMP_MP_FLAGS@ \
@STRIP_END@
libappdisplay_a_built_sources = display-enums.c
INCLUDES = @STRIP_BEGIN@ \
-I$(top_srcdir) \
-I$(top_srcdir)/app \
$(GTK_CFLAGS) \
-I$(includedir) \
@STRIP_END@
libappdisplay_a_SOURCES = \
$(libappdisplay_a_built_sources) \
$(libappdisplay_a_sources)
#
# rules to generate built sources
#
# setup autogeneration dependancies
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\"" \
--fprod "\n/* enumerations from \"@filename@\" */" \
--vhead "\nstatic const GEnumValue @enum_name@_enum_values[] =\n{\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)/display-enums.h > xgen-dec \
&& cp xgen-dec $(@F) \
&& rm -f xgen-dec
/* 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 __DISPLAY_ENUMS_H__
#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,
GIMP_CURSOR_MODE_TOOL_CROSSHAIR,
GIMP_CURSOR_MODE_CROSSHAIR
} GimpCursorMode;
#endif /* __DISPLAY_ENUMS_H__ */
......@@ -22,13 +22,7 @@
#include "widgets/widgets-types.h"
typedef enum /*< pdb-skip >*/
{
CURSOR_MODE_TOOL_ICON,
CURSOR_MODE_TOOL_CROSSHAIR,
CURSOR_MODE_CROSSHAIR
} CursorMode;
#include "display/display-enums.h"
typedef struct _GimpDisplay GimpDisplay;
......
......@@ -1397,14 +1397,14 @@ gimp_display_shell_real_install_tool_cursor (GimpDisplayShell *shell,
{
switch (gimprc.cursor_mode)
{
case CURSOR_MODE_TOOL_ICON:
case GIMP_CURSOR_MODE_TOOL_ICON:
break;
case CURSOR_MODE_TOOL_CROSSHAIR:
case GIMP_CURSOR_MODE_TOOL_CROSSHAIR:
cursor_type = GIMP_CROSSHAIR_SMALL_CURSOR;
break;
case CURSOR_MODE_CROSSHAIR:
case GIMP_CURSOR_MODE_CROSSHAIR:
cursor_type = GIMP_CROSSHAIR_CURSOR;
tool_cursor = GIMP_TOOL_CURSOR_NONE;
modifier = GIMP_CURSOR_MODIFIER_NONE;
......
......@@ -1397,14 +1397,14 @@ gimp_display_shell_real_install_tool_cursor (GimpDisplayShell *shell,
{
switch (gimprc.cursor_mode)
{
case CURSOR_MODE_TOOL_ICON:
case GIMP_CURSOR_MODE_TOOL_ICON:
break;
case CURSOR_MODE_TOOL_CROSSHAIR:
case GIMP_CURSOR_MODE_TOOL_CROSSHAIR:
cursor_type = GIMP_CROSSHAIR_SMALL_CURSOR;
break;
case CURSOR_MODE_CROSSHAIR:
case GIMP_CURSOR_MODE_CROSSHAIR:
cursor_type = GIMP_CROSSHAIR_CURSOR;
tool_cursor = GIMP_TOOL_CURSOR_NONE;
modifier = GIMP_CURSOR_MODIFIER_NONE;
......
......@@ -231,7 +231,7 @@ GimpRc gimprc =
/* nav_window_per_display */ FALSE,
/* info_window_follows_mouse */ TRUE,
/* help_browser */ HELP_BROWSER_GIMP,
/* cursor_mode */ CURSOR_MODE_TOOL_ICON,
/* cursor_mode */ GIMP_CURSOR_MODE_TOOL_ICON,
/* disable_tearoff_menus */ FALSE,
/* theme_path */ NULL,
/* theme */ NULL
......@@ -2683,11 +2683,11 @@ parse_cursor_mode (gpointer val1p,
token = get_next_token ();
if (strcmp (token_sym, "tool-icon") == 0)
*((CursorMode *) val1p) = CURSOR_MODE_TOOL_ICON;
*((GimpCursorMode *) val1p) = GIMP_CURSOR_MODE_TOOL_ICON;
else if (strcmp (token_sym, "tool-crosshair") == 0)
*((CursorMode *) val1p) = CURSOR_MODE_TOOL_CROSSHAIR;
*((GimpCursorMode *) val1p) = GIMP_CURSOR_MODE_TOOL_CROSSHAIR;
else if (strcmp (token_sym, "crosshair") == 0)
*((CursorMode *) val1p) = CURSOR_MODE_CROSSHAIR;
*((GimpCursorMode *) val1p) = GIMP_CURSOR_MODE_CROSSHAIR;
token = peek_next_token ();
if (!token || (token != TOKEN_RIGHT_PAREN))
......@@ -3027,13 +3027,13 @@ static inline gchar *
cursor_mode_to_str (gpointer val1p,
gpointer val2p)
{
CursorMode mode;
GimpCursorMode mode;
mode = *((CursorMode *) val1p);
mode = *((GimpCursorMode *) val1p);
if (mode == CURSOR_MODE_TOOL_ICON)
if (mode == GIMP_CURSOR_MODE_TOOL_ICON)
return g_strdup ("tool-icon");
else if (mode == CURSOR_MODE_TOOL_CROSSHAIR)
else if (mode == GIMP_CURSOR_MODE_TOOL_CROSSHAIR)
return g_strdup ("tool-crosshair");
else
return g_strdup ("crosshair");
......
......@@ -2325,11 +2325,11 @@ preferences_dialog_create (Gimp *gimp)
GINT_TO_POINTER (gimprc.cursor_mode),
_("Tool Icon"),
GINT_TO_POINTER (CURSOR_MODE_TOOL_ICON), NULL,
GINT_TO_POINTER (GIMP_CURSOR_MODE_TOOL_ICON), NULL,
_("Tool Icon with Crosshair"),
GINT_TO_POINTER (CURSOR_MODE_TOOL_CROSSHAIR), NULL,
GINT_TO_POINTER (GIMP_CURSOR_MODE_TOOL_CROSSHAIR), NULL,
_("Crosshair only"),
GINT_TO_POINTER (CURSOR_MODE_CROSSHAIR), NULL,
GINT_TO_POINTER (GIMP_CURSOR_MODE_CROSSHAIR), NULL,
NULL);
......
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