2005-01-25 19:11:26 +00:00
|
|
|
/* LIBGIMP - The GIMP Library
|
2001-12-08 03:35:38 +00:00
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
|
|
|
* ParamSpecs for config objects
|
|
|
|
* Copyright (C) 2001 Sven Neumann <sven@gimp.org>
|
|
|
|
*
|
2005-01-25 19:11:26 +00:00
|
|
|
* 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.
|
2001-12-08 03:35:38 +00:00
|
|
|
*
|
2005-01-25 19:11:26 +00:00
|
|
|
* This library is distributed in the hope that it will be useful,
|
2001-12-08 03:35:38 +00:00
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2005-01-25 19:11:26 +00:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
2001-12-08 03:35:38 +00:00
|
|
|
*
|
2005-01-25 19:11:26 +00:00
|
|
|
* 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.
|
2001-12-08 03:35:38 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __GIMP_CONFIG_PARAMS_H__
|
|
|
|
#define __GIMP_CONFIG_PARAMS_H__
|
|
|
|
|
2005-06-22 20:37:11 +00:00
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
|
|
/* For information look into the C source or the html documentation */
|
|
|
|
|
2001-12-08 03:35:38 +00:00
|
|
|
|
2003-10-26 00:03:16 +00:00
|
|
|
/*
|
2005-02-05 14:52:58 +00:00
|
|
|
* GIMP_CONFIG_PARAM_SERIALIZE - A property that can and should be
|
|
|
|
* serialized and deserialized.
|
|
|
|
* GIMP_CONFIG_PARAM_AGGREGATE - The object property is to be treated as
|
|
|
|
* part of the parent object.
|
|
|
|
* GIMP_CONFIG_PARAM_RESTART - Changes to this property take effect only
|
|
|
|
* after a restart.
|
|
|
|
* GIMP_CONFIG_PARAM_CONFIRM - Changes to this property should be
|
|
|
|
* confirmed by the user before being applied.
|
|
|
|
* GIMP_CONFIG_PARAM_DEFAULTS - Don't serialize this property if it has the
|
|
|
|
* default value.
|
|
|
|
* GIMP_CONFIG_PARAM_IGNORE - This property exists for obscure reasons
|
|
|
|
* and is needed for backward compatibility.
|
|
|
|
* Ignore the value read and don't serialize it.
|
2003-10-26 00:03:16 +00:00
|
|
|
*/
|
|
|
|
|
2005-02-05 14:52:58 +00:00
|
|
|
#define GIMP_CONFIG_PARAM_SERIALIZE (1 << (0 + G_PARAM_USER_SHIFT))
|
|
|
|
#define GIMP_CONFIG_PARAM_AGGREGATE (1 << (1 + G_PARAM_USER_SHIFT))
|
|
|
|
#define GIMP_CONFIG_PARAM_RESTART (1 << (2 + G_PARAM_USER_SHIFT))
|
|
|
|
#define GIMP_CONFIG_PARAM_CONFIRM (1 << (3 + G_PARAM_USER_SHIFT))
|
|
|
|
#define GIMP_CONFIG_PARAM_DEFAULTS (1 << (4 + G_PARAM_USER_SHIFT))
|
|
|
|
#define GIMP_CONFIG_PARAM_IGNORE (1 << (5 + G_PARAM_USER_SHIFT))
|
2002-05-21 17:33:04 +00:00
|
|
|
|
|
|
|
#define GIMP_CONFIG_PARAM_FLAGS (G_PARAM_READWRITE | \
|
|
|
|
G_PARAM_CONSTRUCT | \
|
2005-02-05 14:52:58 +00:00
|
|
|
GIMP_CONFIG_PARAM_SERIALIZE)
|
2002-05-21 17:33:04 +00:00
|
|
|
|
|
|
|
|
2001-12-16 16:33:18 +00:00
|
|
|
|
2001-12-10 18:31:35 +00:00
|
|
|
/* some convenience macros to install object properties */
|
|
|
|
|
2005-03-03 11:56:20 +00:00
|
|
|
#define GIMP_CONFIG_INSTALL_PROP_BOOLEAN(class, id, name, blurb, default, flags)\
|
2001-12-10 18:31:35 +00:00
|
|
|
g_object_class_install_property (class, id,\
|
2002-11-28 15:19:19 +00:00
|
|
|
g_param_spec_boolean (name, NULL, blurb,\
|
2001-12-11 15:58:07 +00:00
|
|
|
default,\
|
2002-11-20 19:09:40 +00:00
|
|
|
flags | GIMP_CONFIG_PARAM_FLAGS))
|
2005-03-03 11:56:20 +00:00
|
|
|
|
2006-04-27 15:19:59 +00:00
|
|
|
#define GIMP_CONFIG_INSTALL_PROP_RGB(class, id, name, blurb, has_alpha, default, flags) \
|
2002-05-21 17:33:04 +00:00
|
|
|
g_object_class_install_property (class, id,\
|
2004-07-26 19:56:47 +00:00
|
|
|
gimp_param_spec_rgb (name, NULL, blurb,\
|
2006-04-27 15:19:59 +00:00
|
|
|
has_alpha, default, \
|
2002-11-20 19:09:40 +00:00
|
|
|
flags | GIMP_CONFIG_PARAM_FLAGS))
|
2005-03-03 11:56:20 +00:00
|
|
|
|
|
|
|
#define GIMP_CONFIG_INSTALL_PROP_DOUBLE(class, id, name, blurb, min, max, default, flags)\
|
2001-12-16 16:33:18 +00:00
|
|
|
g_object_class_install_property (class, id,\
|
2002-11-28 15:19:19 +00:00
|
|
|
g_param_spec_double (name, NULL, blurb,\
|
2001-12-16 16:33:18 +00:00
|
|
|
min, max, default,\
|
2002-11-20 19:09:40 +00:00
|
|
|
flags | GIMP_CONFIG_PARAM_FLAGS))
|
2005-03-03 11:56:20 +00:00
|
|
|
|
|
|
|
#define GIMP_CONFIG_INSTALL_PROP_RESOLUTION(class, id, name, blurb, default, flags)\
|
2003-10-24 06:22:53 +00:00
|
|
|
g_object_class_install_property (class, id,\
|
|
|
|
g_param_spec_double (name, NULL, blurb,\
|
|
|
|
GIMP_MIN_RESOLUTION, GIMP_MAX_RESOLUTION, \
|
|
|
|
default,\
|
|
|
|
flags | GIMP_CONFIG_PARAM_FLAGS))
|
2005-03-03 11:56:20 +00:00
|
|
|
|
|
|
|
#define GIMP_CONFIG_INSTALL_PROP_ENUM(class, id, name, blurb, enum_type, default, flags)\
|
2001-12-10 18:31:35 +00:00
|
|
|
g_object_class_install_property (class, id,\
|
2002-11-28 15:19:19 +00:00
|
|
|
g_param_spec_enum (name, NULL, blurb,\
|
2001-12-10 18:31:35 +00:00
|
|
|
enum_type, default,\
|
2002-11-20 19:09:40 +00:00
|
|
|
flags | GIMP_CONFIG_PARAM_FLAGS))
|
2005-03-03 11:56:20 +00:00
|
|
|
|
|
|
|
#define GIMP_CONFIG_INSTALL_PROP_INT(class, id, name, blurb, min, max, default, flags)\
|
2001-12-10 18:31:35 +00:00
|
|
|
g_object_class_install_property (class, id,\
|
2002-11-28 15:19:19 +00:00
|
|
|
g_param_spec_int (name, NULL, blurb,\
|
2001-12-11 15:58:07 +00:00
|
|
|
min, max, default,\
|
2002-11-20 19:09:40 +00:00
|
|
|
flags | GIMP_CONFIG_PARAM_FLAGS))
|
2005-03-03 11:56:20 +00:00
|
|
|
|
|
|
|
#define GIMP_CONFIG_INSTALL_PROP_MATRIX2(class, id, name, blurb, default, flags)\
|
2003-07-07 16:22:45 +00:00
|
|
|
g_object_class_install_property (class, id,\
|
|
|
|
gimp_param_spec_matrix2 (name, NULL, blurb,\
|
|
|
|
default,\
|
|
|
|
flags | GIMP_CONFIG_PARAM_FLAGS))
|
2005-03-03 11:56:20 +00:00
|
|
|
|
|
|
|
#define GIMP_CONFIG_INSTALL_PROP_MEMSIZE(class, id, name, blurb, min, max, default, flags)\
|
2001-12-10 18:31:35 +00:00
|
|
|
g_object_class_install_property (class, id,\
|
2002-11-28 15:19:19 +00:00
|
|
|
gimp_param_spec_memsize (name, NULL, blurb,\
|
2001-12-10 18:31:35 +00:00
|
|
|
min, max, default,\
|
2002-11-20 19:09:40 +00:00
|
|
|
flags | GIMP_CONFIG_PARAM_FLAGS))
|
2005-03-03 11:56:20 +00:00
|
|
|
|
|
|
|
#define GIMP_CONFIG_INSTALL_PROP_PATH(class, id, name, blurb, path_type, default, flags)\
|
2001-12-10 18:31:35 +00:00
|
|
|
g_object_class_install_property (class, id,\
|
2005-01-25 23:44:05 +00:00
|
|
|
gimp_param_spec_config_path (name, NULL, blurb,\
|
|
|
|
path_type, default,\
|
2002-11-20 19:09:40 +00:00
|
|
|
flags | GIMP_CONFIG_PARAM_FLAGS))
|
2005-03-03 11:56:20 +00:00
|
|
|
|
|
|
|
#define GIMP_CONFIG_INSTALL_PROP_STRING(class, id, name, blurb, default, flags)\
|
2001-12-11 15:58:07 +00:00
|
|
|
g_object_class_install_property (class, id,\
|
2002-11-28 15:19:19 +00:00
|
|
|
g_param_spec_string (name, NULL, blurb,\
|
2001-12-11 15:58:07 +00:00
|
|
|
default,\
|
2002-11-20 19:09:40 +00:00
|
|
|
flags | GIMP_CONFIG_PARAM_FLAGS))
|
2005-03-03 11:56:20 +00:00
|
|
|
|
|
|
|
#define GIMP_CONFIG_INSTALL_PROP_UINT(class, id, name, blurb, min, max, default, flags)\
|
2001-12-11 15:58:07 +00:00
|
|
|
g_object_class_install_property (class, id,\
|
2002-11-28 15:19:19 +00:00
|
|
|
g_param_spec_uint (name, NULL, blurb,\
|
2001-12-11 15:58:07 +00:00
|
|
|
min, max, default,\
|
2002-11-20 19:09:40 +00:00
|
|
|
flags | GIMP_CONFIG_PARAM_FLAGS))
|
2005-03-03 11:56:20 +00:00
|
|
|
|
|
|
|
#define GIMP_CONFIG_INSTALL_PROP_UNIT(class, id, name, blurb, pixels, percent, default, flags)\
|
2001-12-16 16:33:18 +00:00
|
|
|
g_object_class_install_property (class, id,\
|
2002-11-28 15:19:19 +00:00
|
|
|
gimp_param_spec_unit (name, NULL, blurb,\
|
2003-07-17 15:22:21 +00:00
|
|
|
pixels, percent, default,\
|
2002-11-20 19:09:40 +00:00
|
|
|
flags | GIMP_CONFIG_PARAM_FLAGS))
|
2001-12-10 18:31:35 +00:00
|
|
|
|
|
|
|
|
2006-09-24 12:20:22 +00:00
|
|
|
/* object, boxed and pointer properties are _not_ G_PARAM_CONSTRUCT */
|
2003-02-28 17:01:13 +00:00
|
|
|
|
2005-03-03 11:56:20 +00:00
|
|
|
#define GIMP_CONFIG_INSTALL_PROP_OBJECT(class, id, name, blurb, object_type, flags)\
|
2003-02-28 17:01:13 +00:00
|
|
|
g_object_class_install_property (class, id,\
|
|
|
|
g_param_spec_object (name, NULL, blurb,\
|
|
|
|
object_type,\
|
|
|
|
flags |\
|
2005-02-05 14:52:58 +00:00
|
|
|
G_PARAM_READWRITE |\
|
|
|
|
GIMP_CONFIG_PARAM_SERIALIZE))
|
2003-02-28 17:01:13 +00:00
|
|
|
|
2006-09-24 12:20:22 +00:00
|
|
|
#define GIMP_CONFIG_INSTALL_PROP_BOXED(class, id, name, blurb, boxed_type, flags)\
|
|
|
|
g_object_class_install_property (class, id,\
|
|
|
|
g_param_spec_boxed (name, NULL, blurb,\
|
|
|
|
boxed_type,\
|
|
|
|
flags |\
|
|
|
|
G_PARAM_READWRITE |\
|
|
|
|
GIMP_CONFIG_PARAM_SERIALIZE))
|
|
|
|
|
2005-03-03 11:56:20 +00:00
|
|
|
#define GIMP_CONFIG_INSTALL_PROP_POINTER(class, id, name, blurb, flags)\
|
2004-06-16 18:14:44 +00:00
|
|
|
g_object_class_install_property (class, id,\
|
|
|
|
g_param_spec_pointer (name, NULL, blurb,\
|
|
|
|
flags |\
|
2005-02-05 14:52:58 +00:00
|
|
|
G_PARAM_READWRITE |\
|
|
|
|
GIMP_CONFIG_PARAM_SERIALIZE))
|
2004-06-16 18:14:44 +00:00
|
|
|
|
2003-02-28 17:01:13 +00:00
|
|
|
|
2005-06-22 20:37:11 +00:00
|
|
|
G_END_DECLS
|
|
|
|
|
2001-12-08 03:35:38 +00:00
|
|
|
#endif /* __GIMP_CONFIG_PARAMS_H__ */
|