If the enum value is not found among the nicks and names of the
GParamSpec's actual enum type, check if it has a "gimp-compat-enum"
GType attached as QData, and try the lookup there.
Use g_file_get_parse_name() and g_file_parse_name() in order to turn
them into strings and back. Not really sure if we will end up needing
this, but I need it for current hacking. It's clean code and easy
enough to revert, so no harm done in either case.
because it confuses gtk-doc and breaks some links. Also change the
"Index of new symbols in GIMP 2.x" sections to be what seems to be the
modern standard (looked at the GLib and GTK+ docs), and update some
other stuff.
This fix is entirely sick, so is our method of serializing units,
which we write out as (unit foo bar) instead of (unit "foo bar"). The
assumption that caused this shit was that a unit's "identifier" is
really an identifier in the C-ish sense, when in fact it's just a
random user entered string.
Here, we try to parse at least the default units shipped with gimp,
and we add code to parse (unit "foo bar") in order to be compatible
with future correct unit serializing.
2009-01-17 Michael Natterer <mitch@gimp.org>
* all files with a GPL header and all COPYING files:
Change licence to GPLv3 (and to LGPLv3 for libgimp).
Cleaned up some copyright headers and regenerated the parsers in
the ImageMap plugin.
svn path=/trunk/; revision=27913
2006-08-08 Sven Neumann <sven@gimp.org>
* libgimpconfig/gimpconfig-deserialize.c
(gimp_config_deserialize_property)
* libgimpconfig/gimpconfig-serialize.c
(gimp_config_serialize_property): check if the properties
owner_type is an object type before calling g_type_class_peek().
2005-01-25 Michael Natterer <mitch@gimp.org>
* libgimpconfig/gimpconfigtypes.h: new file holding the opaque
typedefs for libgimpconfig. Includes "libgimpbase/gimpbasetypes.h"
* libgimpconfig/Makefile.am: added the new file. Removed stuff
that is not needed.
* libgimpconfig/gimpconfigwriter.h
* libgimpconfig/gimpconfig-iface.h: removed typedefs here.
* libgimpconfig/gimpconfig-deserialize.c
* libgimpconfig/gimpconfig-iface.c
* libgimpconfig/gimpconfig-serialize.c
* libgimpconfig/gimpconfig-utils.c
* libgimpconfig/gimpconfig.h
* libgimpconfig/gimpconfigwriter.c: include it before including
any other libgimpconfig stuff.
* app/config/config-types.h: #include "libgimpbase/gimpbasetypes.h"
* app/config/gimpconfig-utils.h: changed include guards to
__APP_GIMP_CONFIG_UTILS_H__.
* app/dialogs/tips-parser.c: include <glib-object.h> instead of
just <glib.h>.
* app/tools/gimphistogramoptions.c
* app/tools/gimptextoptions.c: include "config/gimpconfig-utils.h"
* app/widgets/gimpdialogfactory.h
* app/widgets/gimpsessioninfo.h: removed inclusion of
"libgimpbase/gimpbasetypes.h".
2005-01-24 Sven Neumann <sven@gimp.org>
* app/config/gimpconfig-deserialize.[ch]
* app/config/gimpconfig-serialize.[ch]
* app/config/gimpconfig.[ch]: factored out some rather obscure
GimpConfig features that were added solely for gimprc.
* app/config/Makefile.am
* app/config/gimprc-deserialize.[ch]
* app/config/gimprc-serialize.[ch]
* app/config/gimprc-unknown.[ch]: moved gimprc-specific code to
these new files.
* app/config/gimprc.c
* app/config/test-config.c: changed accordingly.
2004-07-27 Sven Neumann <sven@gimp.org>
* libgimpbase/Makefile.am
* libgimpbase/gimpbase.h
* libgimpbase/gimpbase.def
* libgimpbase/gimpmemsize.[ch]: added new files with memsize
related functions (moved here from gimputil.c) and
GIMP_TYPE_MEMSIZE (moved here from app/config/gimpconfig-types.[ch]).
* libgimpbase/gimputils.[ch]: removed gimp_memsize_to_string() here.
* libgimpbase/gimpunit.[ch]: added GIMP_TYPE_UNIT (moved here from
app/config/gimpconfig-types.[ch]).
* libgimpbase/gimpbase-private.c
* libgimp/gimptile.c
* libgimp/gimpunitcache.c
* plug-ins/help/domain.c
* app/xcf/xcf-read.c: need to include glib-object.h.
* plug-ins/common/uniteditor.c: use GIMP_TYPE_UNIT.
* app/config/gimpconfig-types.[ch]: removed code that lives in
libgimpbase now.
* app/config/gimpconfig-deserialize.c: changed accordingly.
* app/config/gimpbaseconfig.c
* app/config/gimpdisplayconfig.c
* app/core/gimpcontext.c
* app/gui/grid-dialog.c
* app/tools/gimpcolortool.c
* app/widgets/gimpaction.c
* app/widgets/gimpunitstore.c: no need to include gimpconfig-types.h
any longer.
2004-07-08 Sven Neumann <sven@gimp.org>
* app/config/gimpconfig-deserialize.c
* app/config/gimpconfig-serialize.c: removed redundant casts.
* app/widgets/gimpsessioninfo.[ch]: added convenience functions to
get and set aux-info based on object properties.
* app/widgets/gimphistogrameditor.c: use the new functions to save
a histogram's channel and scale in the sessionrc.
2004-06-16 Michael Natterer <mitch@gimp.org>
* libgimpwidgets/gimpcontroller.[ch]: added #define
GIMP_CONTROLLER_PARAM_SERIALIZE. Made all properties serializable.
* modules/controller_linux_input.c: made "device-name"
serializable.
* app/config/gimpconfig-params.h: added macro
GIMP_CONFIG_INSTALL_PROP_POINTER() which needs to be handled
by custom (de)serialize_property() implementations.
* app/config/gimpconfig-deserialize.c
* app/config/gimpconfig-serialize.c: made object (de)serialization
work for object properties which are *not* GIMP_PARAM_AGGREGATE.
Write/parse the exact type of the object to create to enable this.
* app/core/gimpmarshal.list: new marshaller for GimpControllerInfo.
* app/widgets/gimpcontrollerinfo.[ch]: implement GimpConfigInterface
and add "controller" and "mapping" properties. Add "event-mapped"
signal which carries the action_name.
* app/widgets/gimpcontrollers.c: removed all deserialization code
and simply (de)serialize the controller container. Install a
container handler for "event-mapped" and do the action_name ->
action mapping in the callback.
* etc/controllerrc: regenerated with new syntax. Delete your old one!
2004-02-19 Michael Natterer <mitch@gimp.org>
* app/config/gimpconfig-serialize.c
(gimp_config_serialize_property)
* app/config/gimpconfig-deserialize.c
(gimp_config_deserialize_property): Reverted my last "cleanup" and
put the "obsolete" check for the exact owner class of the property
back. It appears that if a subclass does *not* implement
GimpConfigInterface *itself*, it still inherits
serialize_property()/deserialize_property().
2004-02-18 Michael Natterer <mitch@gimp.org>
Some code review:
* app/config/gimpconfig-deserialize.c
* app/config/gimpconfig-serialize.c: removed obsolete code which
made sure serialize_property()/deserialize_property() are only
called for properties of the correct class. We do it the right way
for quite a while now and clear the inherited function pointers in
gimp_config_iface_base_init().
* app/config/gimprc.c (gimp_rc_dispose): don't forget to chain up.
* app/base/gimplut.c
* app/base/lut-funcs.c
* app/config/gimpconfig-deserialize.c
* app/config/gimpconfig-serialize.c
* app/config/gimpconfig-types.c
* app/config/gimprc.c
* app/core/gimp-modules.c
* app/core/gimpbrush.c
* app/core/gimpcontainer.c
* app/core/gimpdocumentlist.c
* app/core/gimpitem.c
* app/gui/about-dialog.c
* app/gui/color-notebook.c
* app/gui/gui.c
* app/gui/tips-dialog.c
* app/paint/gimppaintcore.c
* app/paint-funcs/paint-funcs.c
* app/widgets/gimpcolorpanel.c
* app/widgets/gimpcontainergridview.c
* app/widgets/gimpcontainermenuimpl.c
* app/widgets/gimpselectioneditor.c: removed I/O includes from
files which don't use lowlevel APIs any more. Also removes
a whole bunch of G_OS_WIN32 special casing. Removed trailing
whitespace. Misc tiny cleanups.
2003-11-14 Sven Neumann <sven@gimp.org>
* app/config/gimpscanner.c
* app/config/gimpconfig-deserialize.c: configured the scanner to
use 64bit integers. This means you must now access value.v_int64
instead of value.v_int. Fortunately gimp_scanner_parse_int() hides
this ugly detail from you.
* app/config/gimpconfig-params.[ch]
* app/config/gimpconfig-types.c: derive GimpMemsize from guint64
now that support for 64bit integers is guaranteed by glib.
* app/config/gimpbaseconfig.c
* app/config/gimpcoreconfig.c
* app/config/gimpguiconfig.[ch]
* app/widgets/gimppropwidgets.c: changed accordingly.
* app/gui/preferences-dialog.c: changed a label.
2003-11-13 Sven Neumann <sven@gimp.org>
* app/config/gimpconfig-deserialize.c
(gimp_config_deserialize_unknown)
(gimp_config_deserialize_property): unset the scanner scope to
avoid identifiers that match symbol names to be parsed as symbols.
2003-10-26 Sven Neumann <sven@gimp.org>
* app/config/gimpconfig-deserialize.c
(gimp_config_deserialize_fundamental): handle negative float and
double values similar to how this is done for integers and the
like.
* app/config/gimpconfig-params.h: added two new param flags and
documented all flags in the header file (for now).
* app/config/gimpconfig-serialize.h: handle the new param flags
GIMP_PARAM_DEFAULTS and GIMP_PARAM_IGNORE.
* app/text/text-enums.[ch]
* app/text/gimptext.[ch]: added some properties that we will need
sooner or later. Mark the new properties and a lot of the existing
ones as GIMP_PARAM_DEFAULTS so that their values are not
serialized unless changed from the default value.
* app/text/gimptextlayout.c
* app/tools/gimptextoptions.c: made all length properties in
GimpText depend on a single unit.
2003-10-21 Sven Neumann <sven@gimp.org>
* base/base.c (base_init)
* app/errors.c (gimp_errors_init): moved the message about
possible debug messages to gimp_errors_init() so that it appears
before any startup debug output.
* app/app_procs.c (app_init): register a log handler for the
GimpConfig log domain.
* app/widgets/gimpwidgets-utils.c (gimp_message_box)
* app/core/gimp.c (gimp_message): added an extra newline when
sending messages to stderr. Don't output the full progname for
messages; use a simple "GIMP" like the GUI message handler does.
* app/gui/user-install-dialog.c: removed function copy_file()...
* app/config/gimpconfig-utils.[ch]: ... and added it here as
gimp_config_file_copy(). Also added utility function
gimp_config_file_backup_on_error().
* app/config/gimprc.c (gimp_rc_load): if the user gimprc can't be
parsed, create a backup and if that succeeds unlink the broken one
to cure the problem.
* app/gui/session.c: create a backup if sessionrc can't be parsed.
* config/gimpconfig-deserialize.c (gimp_config_deserialize_properties):
don't set an error when token is G_TOKEN_NONE; it should already
be set then.
2003-07-07 Sven Neumann <sven@gimp.org>
* libgimpbase/gimpbasetypes.h: include <libgimpmath/gimpmathtypes.h>.
* libgimpmath/gimpmathtypes.h
* libgimpmath/gimpmatrix.[ch]: added GimpMatrix2 struct definition
and new function gimp_matrix2_identity().
* app/config/gimpconfig-deserialize.c
* app/config/gimpconfig-params.[ch]
* app/config/gimpconfig-serialize.c
* app/config/gimpconfig-types.[ch]
* app/config/gimpconfig.c
* app/config/gimpscanner.[ch]: added a boxed type around GimpMatrix2.
* app/text/gimptext.[ch]: added new property "transformation".
2003-04-12 Michael Natterer <mitch@gimp.org>
* app/config/gimpconfig-params.h: made object properties
G_PARAM_READWRITE by default. Added flag GIMP_PARAM_AGGREGATE
which indicates that an object property is not a reference but a
real part of its owner.
* app/config/gimpconfig-deserialize.c: g_object_set_property()
object properties only if they are not GIMP_PARAM_AGGREGATE.
* app/config/gimpconfig-utils.c (gimp_config_copy_properties,
gimp_config_reset_properties): copy and reset GIMP_PARAM_AGGREGATE
object properties correctly.
* app/config/gimpconfig-serialize.c: don't call
gimp_config_writer_open/close() for properties which are handled
by a GimpConfigIface::serialize_property() implementation.
* app/core/gimpcontext.c: removed exlicit G_PARAM_WRITABLE from
object properties since that's the default now. Call
gimp_config_writer_open/close() when serializing properties.
* app/core/gimpviewable.c (gimp_viewable_get_property): use
gimp_viewable_get_stock_id().
(gimp_viewable_set_stock_id): set stock_id to NULL if the new
stock_id is the same as viewable_class->default_stock_id.
Added serialize_property() which skips stock_id serialization
if it is NULL.
* app/tools/gimptextoptions.c: made the "text" property
GIMP_PARAM_AGGREGATE. Added gimp_text_options_set_property()
(which does nothing).
* app/widgets/gimptemplateeditor.[ch]: added an optional
GimpViewableButton to change the template's icon.
* app/gui/file-new-dialog.c: create it with the icon button so it
gets some testing.
2003-03-27 Michael Natterer <mitch@gimp.org>
* app/config/gimpconfig-deserialize.c
(gimp_config_deserialize_property): allow object properties to be
set again if they are G_PARAM_WRITABLE. Fixes active brush,
pattern etc. deserialization.