Commit 4aa2bf93 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann
Browse files

libgimpbase/Makefile.am removed these two files again.

2005-01-26  Sven Neumann  <sven@gimp.org>

	* libgimpbase/Makefile.am
	* libgimpbase/gimppath.[ch]: removed these two files again.

	* libgimpconfig/gimpconfig-path.[ch]: merged the path type and
	param spec here. Renamed to GimpConfigPath and GimpParamConfigPath.

	* libgimpbase/gimpbase.h
	* libgimpbase/gimpbasetypes.[ch]
	* libgimpconfig/gimpconfig-deserialize.c
	* libgimpconfig/gimpconfig-params.h
	* app/config/gimpbaseconfig.c
	* app/config/gimpconfig-dump.c
	* app/config/gimpcoreconfig.c
	* app/config/gimpguiconfig.c
	* app/config/gimppluginconfig.c
	* app/widgets/gimppropwidgets.c: changed accordingly.

	* libgimpbase/gimpbase.def: updated.
parent a60420e2
2005-01-26 Sven Neumann <sven@gimp.org>
* libgimpbase/Makefile.am
* libgimpbase/gimppath.[ch]: removed these two files again.
* libgimpconfig/gimpconfig-path.[ch]: merged the path type and
param spec here. Renamed to GimpConfigPath and GimpParamConfigPath.
* libgimpbase/gimpbase.h
* libgimpbase/gimpbasetypes.[ch]
* libgimpconfig/gimpconfig-deserialize.c
* libgimpconfig/gimpconfig-params.h
* app/config/gimpbaseconfig.c
* app/config/gimpconfig-dump.c
* app/config/gimpcoreconfig.c
* app/config/gimpguiconfig.c
* app/config/gimppluginconfig.c
* app/widgets/gimppropwidgets.c: changed accordingly.
* libgimpbase/gimpbase.def: updated.
2005-01-25 Bill Skaggs <weskaggs@primate.ucdavis.edu>
* libgimpconfig/gimpconfig.def: added
......
......@@ -102,12 +102,12 @@ gimp_base_config_class_init (GimpBaseConfigClass *klass)
GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_TEMP_PATH,
"temp-path", TEMP_PATH_BLURB,
GIMP_PARAM_PATH_DIR,
GIMP_CONFIG_PATH_DIR,
"${gimp_dir}" G_DIR_SEPARATOR_S "tmp",
GIMP_PARAM_RESTART);
GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_SWAP_PATH,
"swap-path", SWAP_PATH_BLURB,
GIMP_PARAM_PATH_DIR,
GIMP_CONFIG_PATH_DIR,
"${gimp_dir}",
GIMP_PARAM_RESTART);
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_STINGY_MEMORY_USE,
......
......@@ -346,15 +346,15 @@ dump_describe_param (GParamSpec *param_spec)
"megabytes or gigabytes. If no suffix is specified the size defaults "
"to being specified in kilobytes.";
}
else if (g_type_is_a (type, GIMP_TYPE_PATH))
else if (g_type_is_a (type, GIMP_TYPE_CONFIG_PATH))
{
switch (gimp_param_spec_path_type (param_spec))
switch (gimp_param_spec_config_path_type (param_spec))
{
case GIMP_PARAM_PATH_FILE:
case GIMP_CONFIG_PATH_FILE:
values = "This is a single filename.";
break;
case GIMP_PARAM_PATH_FILE_LIST:
case GIMP_CONFIG_PATH_FILE_LIST:
switch (G_SEARCHPATH_SEPARATOR)
{
case ':':
......@@ -369,11 +369,11 @@ dump_describe_param (GParamSpec *param_spec)
}
break;
case GIMP_PARAM_PATH_DIR:
case GIMP_CONFIG_PATH_DIR:
values = "This is a single folder.";
break;
case GIMP_PARAM_PATH_DIR_LIST:
case GIMP_CONFIG_PATH_DIR_LIST:
switch (G_SEARCHPATH_SEPARATOR)
{
case ':':
......
......@@ -158,72 +158,72 @@ gimp_core_config_class_init (GimpCoreConfigClass *klass)
0);
GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_PLUG_IN_PATH,
"plug-in-path", PLUG_IN_PATH_BLURB,
GIMP_PARAM_PATH_DIR_LIST,
GIMP_CONFIG_PATH_DIR_LIST,
gimp_config_build_plug_in_path ("plug-ins"),
GIMP_PARAM_RESTART);
GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_MODULE_PATH,
"module-path", MODULE_PATH_BLURB,
GIMP_PARAM_PATH_DIR_LIST,
GIMP_CONFIG_PATH_DIR_LIST,
gimp_config_build_plug_in_path ("modules"),
GIMP_PARAM_RESTART);
GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_ENVIRON_PATH,
"environ-path", ENVIRON_PATH_BLURB,
GIMP_PARAM_PATH_DIR_LIST,
GIMP_CONFIG_PATH_DIR_LIST,
gimp_config_build_plug_in_path ("environ"),
GIMP_PARAM_RESTART);
GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_BRUSH_PATH,
"brush-path", BRUSH_PATH_BLURB,
GIMP_PARAM_PATH_DIR_LIST,
GIMP_CONFIG_PATH_DIR_LIST,
gimp_config_build_data_path ("brushes"),
GIMP_PARAM_RESTART);
GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_BRUSH_PATH_WRITABLE,
"brush-path-writable",
BRUSH_PATH_WRITABLE_BLURB,
GIMP_PARAM_PATH_DIR_LIST,
GIMP_CONFIG_PATH_DIR_LIST,
gimp_config_build_writable_path ("brushes"),
GIMP_PARAM_RESTART);
GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_PATTERN_PATH,
"pattern-path", PATTERN_PATH_BLURB,
GIMP_PARAM_PATH_DIR_LIST,
GIMP_CONFIG_PATH_DIR_LIST,
gimp_config_build_data_path ("patterns"),
GIMP_PARAM_RESTART);
GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_PATTERN_PATH_WRITABLE,
"pattern-path-writable",
PATTERN_PATH_WRITABLE_BLURB,
GIMP_PARAM_PATH_DIR_LIST,
GIMP_CONFIG_PATH_DIR_LIST,
gimp_config_build_writable_path ("patterns"),
GIMP_PARAM_RESTART);
GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_PALETTE_PATH,
"palette-path", PALETTE_PATH_BLURB,
GIMP_PARAM_PATH_DIR_LIST,
GIMP_CONFIG_PATH_DIR_LIST,
gimp_config_build_data_path ("palettes"),
GIMP_PARAM_RESTART);
GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_PALETTE_PATH_WRITABLE,
"palette-path-writable",
PALETTE_PATH_WRITABLE_BLURB,
GIMP_PARAM_PATH_DIR_LIST,
GIMP_CONFIG_PATH_DIR_LIST,
gimp_config_build_writable_path ("palettes"),
GIMP_PARAM_RESTART);
GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_GRADIENT_PATH,
"gradient-path", GRADIENT_PATH_BLURB,
GIMP_PARAM_PATH_DIR_LIST,
GIMP_CONFIG_PATH_DIR_LIST,
gimp_config_build_data_path ("gradients"),
GIMP_PARAM_RESTART);
GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_GRADIENT_PATH_WRITABLE,
"gradient-path-writable",
GRADIENT_PATH_WRITABLE_BLURB,
GIMP_PARAM_PATH_DIR_LIST,
GIMP_CONFIG_PATH_DIR_LIST,
gimp_config_build_writable_path ("gradients"),
GIMP_PARAM_RESTART);
GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_FONT_PATH,
"font-path", FONT_PATH_BLURB,
GIMP_PARAM_PATH_DIR_LIST,
GIMP_CONFIG_PATH_DIR_LIST,
gimp_config_build_data_path ("fonts"),
0);
GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_FONT_PATH_WRITABLE,
"font-path-writable",
FONT_PATH_WRITABLE_BLURB,
GIMP_PARAM_PATH_DIR_LIST,
GIMP_CONFIG_PATH_DIR_LIST,
gimp_config_build_writable_path ("fonts"),
GIMP_PARAM_RESTART);
GIMP_CONFIG_INSTALL_PROP_STRING (object_class, PROP_DEFAULT_BRUSH,
......@@ -290,7 +290,7 @@ gimp_core_config_class_init (GimpCoreConfigClass *klass)
GIMP_CONFIG_INSTALL_PROP_PATH (object_class,
PROP_PLUGINRC_PATH,
"pluginrc-path", PLUGINRC_PATH_BLURB,
GIMP_PARAM_PATH_FILE,
GIMP_CONFIG_PATH_FILE,
"${gimp_dir}" G_DIR_SEPARATOR_S "pluginrc",
GIMP_PARAM_RESTART);
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_LAYER_PREVIEWS,
......
......@@ -222,7 +222,7 @@ gimp_gui_config_class_init (GimpGuiConfigClass *klass)
0);
GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_THEME_PATH,
"theme-path", THEME_PATH_BLURB,
GIMP_PARAM_PATH_DIR_LIST,
GIMP_CONFIG_PATH_DIR_LIST,
gimp_config_build_data_path ("themes"),
GIMP_PARAM_RESTART);
GIMP_CONFIG_INSTALL_PROP_STRING (object_class, PROP_THEME,
......@@ -248,7 +248,7 @@ gimp_gui_config_class_init (GimpGuiConfigClass *klass)
0);
GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_WEB_BROWSER,
"web-browser", WEB_BROWSER_BLURB,
GIMP_PARAM_PATH_FILE,
GIMP_CONFIG_PATH_FILE,
DEFAULT_WEB_BROWSER,
0);
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_TOOLBOX_WINDOW_HINT,
......
......@@ -102,33 +102,33 @@ gimp_plugin_config_class_init (GimpPluginConfigClass *klass)
PROP_FRACTALEXPLORER_PATH,
"fractalexplorer-path",
FRACTALEXPLORER_PATH_BLURB,
GIMP_PARAM_PATH_DIR_LIST,
GIMP_CONFIG_PATH_DIR_LIST,
gimp_config_build_data_path ("fractalexplorer"),
0);
GIMP_CONFIG_INSTALL_PROP_PATH (object_class,
PROP_GFIG_PATH,
"gfig-path", GFIG_PATH_BLURB,
GIMP_PARAM_PATH_DIR_LIST,
GIMP_CONFIG_PATH_DIR_LIST,
gimp_config_build_data_path ("gfig"),
0);
GIMP_CONFIG_INSTALL_PROP_PATH (object_class,
PROP_GFLARE_PATH,
"gflare-path", GFLARE_PATH_BLURB,
GIMP_PARAM_PATH_DIR_LIST,
GIMP_CONFIG_PATH_DIR_LIST,
gimp_config_build_data_path ("gflare"),
0);
GIMP_CONFIG_INSTALL_PROP_PATH (object_class,
PROP_GIMPRESSIONIST_PATH,
"gimpressionist-path",
GIMPRESSIONIST_PATH_BLURB,
GIMP_PARAM_PATH_DIR_LIST,
GIMP_CONFIG_PATH_DIR_LIST,
gimp_config_build_data_path ("gimpressionist"),
0);
GIMP_CONFIG_INSTALL_PROP_PATH (object_class,
PROP_SCRIPT_FU_PATH,
"script-fu-path",
SCRIPT_FU_PATH_BLURB,
GIMP_PARAM_PATH_DIR_LIST,
GIMP_CONFIG_PATH_DIR_LIST,
gimp_config_build_data_path ("scripts"),
0);
}
......
......@@ -1607,7 +1607,7 @@ gimp_prop_file_entry_new (GObject *config,
gchar *value;
param_spec = check_param_spec (config, property_name,
GIMP_TYPE_PARAM_PATH, G_STRFUNC);
GIMP_TYPE_PARAM_CONFIG_PATH, G_STRFUNC);
if (! param_spec)
return NULL;
......@@ -1724,14 +1724,15 @@ gimp_prop_path_editor_new (GObject *config,
gchar *filename;
path_param_spec = check_param_spec (config, path_property_name,
GIMP_TYPE_PARAM_PATH, G_STRFUNC);
GIMP_TYPE_PARAM_CONFIG_PATH, G_STRFUNC);
if (! path_param_spec)
return NULL;
if (writable_property_name)
{
writable_param_spec = check_param_spec (config, writable_property_name,
GIMP_TYPE_PARAM_PATH, G_STRFUNC);
GIMP_TYPE_PARAM_CONFIG_PATH,
G_STRFUNC);
if (! writable_param_spec)
return NULL;
}
......
......@@ -88,8 +88,6 @@ libgimpbase_sources = \
gimpparasite.h \
gimpparasiteio.c \
gimpparasiteio.h \
gimppath.h \
gimppath.c \
gimpprotocol.c \
gimpprotocol.h \
gimpsignal.c \
......@@ -121,7 +119,6 @@ libgimpbaseinclude_HEADERS = \
gimpmemsize.h \
gimpparasite.h \
gimpparasiteio.h \
gimppath.h \
gimpsignal.h \
gimpunit.h \
gimputils.h
......
......@@ -44,10 +44,7 @@ EXPORTS
gimp_message_handler_type_get_type
gimp_paint_application_mode_get_type
gimp_param_memsize_get_type
gimp_param_path_get_type
gimp_param_spec_memsize
gimp_param_spec_path
gimp_param_spec_path_type
gimp_param_spec_unit
gimp_param_unit_get_type
gimp_parasite_compare
......@@ -63,9 +60,7 @@ EXPORTS
gimp_parasite_name
gimp_parasite_new
gimp_path_free
gimp_path_get_type
gimp_path_get_user_writable_dir
gimp_path_parse
gimp_path_to_str
gimp_pdb_arg_type_get_type
gimp_pdb_proc_type_get_type
......
......@@ -29,7 +29,6 @@
#include <libgimpbase/gimplimits.h>
#include <libgimpbase/gimpmemsize.h>
#include <libgimpbase/gimpparasite.h>
#include <libgimpbase/gimppath.h>
#include <libgimpbase/gimpunit.h>
#include <libgimpbase/gimputils.h>
#include <libgimpbase/gimpversion.h>
......
......@@ -157,31 +157,6 @@ gimp_flags_get_value_descriptions (GType flags_type)
}
/**
* gimp_path_get_type:
*
* Reveals the object type
*
* Returns: the #GType for GimpPath objects
*
* Since: GIMP 2.4
**/
GType
gimp_path_get_type (void)
{
static GType path_type = 0;
if (!path_type)
{
static const GTypeInfo type_info = { 0, };
path_type = g_type_register_static (G_TYPE_STRING, "GimpPath",
&type_info, 0);
}
return path_type;
}
/* private functions */
static GQuark
......
......@@ -69,12 +69,6 @@ void gimp_flags_set_value_descriptions (GType fl
const GimpFlagsDesc * gimp_flags_get_value_descriptions (GType flags_type);
#define GIMP_TYPE_PATH (gimp_path_get_type ())
#define GIMP_VALUE_HOLDS_PATH(value) (G_TYPE_CHECK_VALUE_TYPE ((value), GIMP_TYPE_PATH))
GType gimp_path_get_type (void) G_GNUC_CONST;
G_END_DECLS
#endif /* __GIMP_BASE_TYPES_H__ */
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <glib-object.h>
#include "gimpbasetypes.h"
#include "gimppath.h"
/*
* GIMP_TYPE_PARAM_PATH
*/
#define GIMP_PARAM_SPEC_PATH(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GIMP_TYPE_PARAM_PATH, GimpParamSpecPath))
typedef struct _GimpParamSpecPath GimpParamSpecPath;
struct _GimpParamSpecPath
{
GParamSpecString parent_instance;
GimpParamPathType type;
};
static void gimp_param_path_class_init (GParamSpecClass *class);
/**
* gimp_param_path_get_type:
*
* Reveals the object type
*
* Returns: the #GType for a directory path object
*
* Since: GIMP 2.4
**/
GType
gimp_param_path_get_type (void)
{
static GType spec_type = 0;
if (!spec_type)
{
static const GTypeInfo type_info =
{
sizeof (GParamSpecClass),
NULL, NULL,
(GClassInitFunc) gimp_param_path_class_init,
NULL, NULL,
sizeof (GimpParamSpecPath),
0, NULL, NULL
};
spec_type = g_type_register_static (G_TYPE_PARAM_STRING,
"GimpParamPath",
&type_info, 0);
}
return spec_type;
}
static void
gimp_param_path_class_init (GParamSpecClass *class)
{
class->value_type = GIMP_TYPE_PATH;
}
/**
* gimp_param_spec_path:
* @name: Canonical name of the param
* @nick: Nickname of the param
* @blurb: Brief desciption of param.
* @type: a #GimpParamPathType value.
* @default_value: Value to use if none is assigned.
* @flags: a combination of #GParamFlags
*
* Creates a param spec to hold a filename, dir name,
* or list of file or dir names.
* See g_param_spec_internal() for more information.
*
* Returns: a newly allocated #GParamSpec instance
*
* Since: GIMP 2.4
**/
GParamSpec *
gimp_param_spec_path (const gchar *name,
const gchar *nick,
const gchar *blurb,
GimpParamPathType type,
gchar *default_value,
GParamFlags flags)
{
GParamSpecString *pspec;
pspec = g_param_spec_internal (GIMP_TYPE_PARAM_PATH,
name, nick, blurb, flags);
pspec->default_value = default_value;
GIMP_PARAM_SPEC_PATH (pspec)->type = type;
return G_PARAM_SPEC (pspec);
}
/**
* gimp_param_spec_path_get_path_type:
* @pspec: A #GParamSpec for a path param
*
* Tells whether the path param encodes a filename,
* dir name, or list of file or dir names.
*
* Returns: a #GimpParamPathType value
*
* Since: GIMP 2.4
**/
GimpParamPathType
gimp_param_spec_path_type (GParamSpec *pspec)
{
g_return_val_if_fail (GIMP_IS_PARAM_SPEC_PATH (pspec), 0);
return GIMP_PARAM_SPEC_PATH (pspec)->type;
}
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GIMP_PATH_H__
#define __GIMP_PATH_H__
/* For information look into the C source or the html documentation */
/*
* GIMP_TYPE_PARAM_PATH
*/
typedef enum
{
GIMP_PARAM_PATH_FILE,
GIMP_PARAM_PATH_FILE_LIST,
GIMP_PARAM_PATH_DIR,
GIMP_PARAM_PATH_DIR_LIST
} GimpParamPathType;
#define GIMP_TYPE_PARAM_PATH (gimp_param_path_get_type ())
#define GIMP_IS_PARAM_SPEC_PATH(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), GIMP_TYPE_PARAM_PATH))
GType gimp_param_path_get_type (void) G_GNUC_CONST;
GParamSpec * gimp_param_spec_path (const gchar *name,
const gchar *nick,
const gchar *blurb,
GimpParamPathType type,
gchar *default_value,
GParamFlags flags);
GimpParamPathType gimp_param_spec_path_type (GParamSpec *pspec);
#endif /* __GIMP_PATH_H__ */
......@@ -298,7 +298,7 @@ gimp_config_deserialize_value (GValue *value,
{
return gimp_config_deserialize_memsize (value, prop_spec, scanner);
}
else if (prop_spec->value_type == GIMP_TYPE_PATH)
else if (prop_spec->value_type == GIMP_TYPE_CONFIG_PATH)
{
return gimp_config_deserialize_path (value, prop_spec, scanner);
}
......
......@@ -105,10 +105,10 @@
min, max, default,\
flags | GIMP_CONFIG_PARAM_FLAGS))
#define GIMP_CONFIG_INSTALL_PROP_PATH(class, id,\
name, blurb, type, default, flags)\
name, blurb, path_type, default, flags)\
g_object_class_install_property (class, id,\
gimp_param_spec_path (name, NULL, blurb,\
type, default,\
gimp_param_spec_config_path (name, NULL, blurb,\
path_type, default,\
flags | GIMP_CONFIG_PARAM_FLAGS))
#define GIMP_CONFIG_INSTALL_PROP_STRING(class, id,\
name, blurb, default, flags)\
......
......@@ -33,15 +33,155 @@
#include "libgimp/libgimp-intl.h"
static gchar * gimp_config_path_expand_only (const gchar *path,
GError **error);
static inline gchar * extract_token (const gchar **str);
/**
* gimp_config_path_get_type:
*
* Reveals the object type
*
* Returns: the #GType for a GimpConfigPath string property
*
* Since: GIMP 2.4
**/
GType
gimp_config_path_get_type (void)
{
static GType path_type = 0;
if (!path_type)
{
static const GTypeInfo type_info = { 0, };
path_type = g_type_register_static (G_TYPE_STRING, "GimpConfigPath",
&type_info, 0);
}
return path_type;
}
/*
* GIMP_TYPE_PARAM_CONFIG_PATH
*/
#define GIMP_PARAM_SPEC_CONFIG_PATH(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), GIMP_TYPE_PARAM_CONFIG_PATH, GimpParamSpecConfigPath))
typedef struct _GimpParamSpecConfigPath GimpParamSpecConfigPath;
struct _GimpParamSpecConfigPath
{
GParamSpecString parent_instance;
GimpConfigPathType type;
};
static void gimp_param_config_path_class_init (GParamSpecClass *class);
/**
* gimp_param_config_path_get_type:
*
* Reveals the object type
*
* Returns: the #GType for a directory path object
*
* Since: GIMP 2.4
**/
GType
gimp_param_config_path_get_type (void)