… more robust.
GIMP_PARAM_NO_VALIDATE and GIMP_CONFIG_PARAM_DONT_COMPARE were the same
value, most likely because when GIMP_CONFIG_PARAM_DONT_COMPARE got added
(commit c5c807d191), the comment to keep in sync
libgimpbase/gimpparamspecs.h and libgimpconfig/gimpconfig-params.h was
missed.
Instead, since libgimpconfig can include libgimpbase, do the other way
around: first non-GLib param flags are in libgimpbase, then we add a
GIMP_PARAM_FLAG_SHIFT, then we increment from it in libgimpconfig, and
finally we increment from GIMP_CONFIG_PARAM_FLAG_SHIFT if ever we add
more flags in app/ (right now GIMP_SYMMETRY_PARAM_GUI is apparently the
only one, but this may change).
This is meant to obsolete GeglParamColor with at least an additional argument
has_alpha which we need in GIMP. It allows to advertize when a parameter wants
an opaque color, which in particular means we know when displaying a GUI to pick
colors with alpha or not.
There are no plug-ins which uses GimpRGB for procedure argument, nor is there
any base PDB procedure. We don't pass this type anymore through from/to
core/plug-ins. So let's clean the whole code out as a next step to get rid of
GimpRGB from our codebase!
- app: gimp_context_get_(foreground|background)() are now returning a GeglColor.
- libgimp: PDB functions named similarly in libgimp are returning a newly
allocated GeglColor too.
- A few other PDB functions (the ones using these functions) were updated and
their signature changed to use GeglColor too, when relevant. Plug-ins which
use any of the changed libgimp functions were fixed.
- GimpContext: signals "(foreground|background)-changed" are now passing a
GeglColor.
- libgimpconfig: new macro GIMP_CONFIG_PROP_COLOR using gegl_param_spec_color().
- GimpContext: properties "foreground" and "background" are now GeglParamColor
properties.
- app: All code interacting with GimpContext objects were updated to receive a
GeglColor (that they may still convert, or no, to GimpRGB for now).
- app: gimp_prop_gegl_color_button_new() was added as an alternative to
gimp_prop_color_button_new() when the property is a GeglParamColor. Eventually
the former should replace completely the latter.
- libgimpwidgets: gimp_prop_color_area_new() now works on GeglParamColor
properties only.
- libgimp: gimp_procedure_dialog_get_widget() will generate a GimpColorArea for
GeglTypeParamColor arguments.
In GimpText, The font used to be stored as a string containing its name,
Now, it is stored as a GimpFont object, which makes more sense and makes
operations on fonts easier (such as serialization).
The `GIMP_CONFIG_PROP_*` macros do not automatically set
`G_PARAM_STATIC_STRINGS`, which means each property that uses such a
macro does not have this flag set by default (and almost none set it
themselves). By adding `G_PARAM_STATIC_STRINGS` to
`GIMP_CONFIG_PARAM_FLAGS`, we can prevent this from happening, which
should lead to some unnecessary string copies being prevented.
The old GIMP_CONFIG_INSTALL_PROP_FOO() have the problem of always
passing NULL as the GParamSpec's "nick". I have no clue what we were
thinking back then, but this has always been a major design flaw
because (among other problems) it makes it impossible to fully
auto-generate GUIs based on properties.
Added GIMP_CONFIG_PROP_FOO() macros which do have a "nick" parameter,
will deprecate the old macros as soon as everything is ported.
This only helps to maintain proper includes in app/ and shouldn't
affect plug-ins at all, because these are supposed to only include the
main headers from libgimp/ since the beginning of time.
The gimpfootypes.h files do not have these guards, so we can continue
to maintain app/'s include policy that is very likely to error out if
wrong things are included.
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-09-24 Michael Natterer <mitch@gimp.org>
Some more proper typing instead of using pointers:
* libgimpconfig/gimpconfig-params.h: added macro
GIMP_CONFIG_INSTALL_PROP_BOXED().
* app/core/gimpcontainer.c: made "children-type" a GParamSpecGType.
* app/widgets/gimpcontrollerinfo.c: made "mapping" a
GParamSpecBoxed and use g_hash_table_unref() instead of destroy().
* app/widgets/gimppdbdialog.c: made "select-type" a GParamSpecGType.
* app/dialogs/module-dialog.c
* app/widgets/gimpcolordisplayeditor.c
* app/widgets/gimpcontrollerlist.c
* app/widgets/gimpfileprocview.c
* app/widgets/gimppluginaction.c: use proper object types, boxed
types and G_TYPE_GTYPE instead of G_TYPE_POINTER for various list
stores and signal signatues.
2006-04-27 Sven Neumann <sven@gimp.org>
* libgimpcolor/gimprgb.[ch]: added "has_alpha" to GimpParamSpecRGB.
Made the GimpParamSpecRGB struct public. When validating a color,
only look at the alpha channel if has_alpha is set.
* libgimpconfig/gimpconfig-params.h: added "has_alpha" to
GIMP_CONFIG_INSTALL_PROP_RGB macro definition.
* libgimpconfig/gimpconfig-serialize.c: serialize color values as
"(rgb r g b)" if the param-spec indicates that the alpha channel
is meaningless.
* app/config/gimpconfig-dump.c: take "has_alpha" into account when
documenting color properties.
* app/core/gimpcontext.c
* app/core/gimpgrid.c
* app/display/gimpdisplayoptions.c
* app/text/gimptext.c
* app/widgets/gimpaction.c
* app/widgets/gimpcolorbar.c
* libgimpwidgets/gimpcolorarea.c
* libgimpwidgets/gimpcolorbutton.c: specify whether color properties
have an alpha channel.
* tools/pdbgen/app.pl: handle "has_alpha" for color paramaters.
* tools/pdbgen/pdb/channel.pdb
* tools/pdbgen/pdb/context.pdb
* tools/pdbgen/pdb/grid.pdb
* tools/pdbgen/pdb/image.pdb: set the "has_alpha" flag where
appropriate.
* app/pdb/gimp-pdb-compat.c (gimp_pdb_compat_param_spec): set
"has_alpha" to TRUE for GIMP_PDB_COLOR.
* app/pdb/channel_cmds.c
* app/pdb/context_cmds.c
* app/pdb/gradient_cmds.c
* app/pdb/grid_cmds.c
* app/pdb/image_cmds.c
* app/pdb/palette_cmds.c
* app/pdb/palettes_cmds.c
* app/pdb/selection_tools_cmds.c: regenerated.
* app/config/gimpdisplayconfig.c (gimp_display_config_class_init):
removed unused code.
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!
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-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-24 Sven Neumann <sven@gimp.org>
* themes/Default/images/Makefile.am
* themes/Default/images/stock-histogram-linear-16.png
* themes/Default/images/stock-histogram-logarithmic-16.png:
added placeholders for new icons.
* libgimpwidgets/gimpstock.[ch]: register the new icons.
* app/tools/gimphistogramtool.c: made the dialog more compact by
using a stock-box for the histogram scale.
* app/widgets/gimphistogramview.c (gimp_histogram_view_expose):
don't invert the histogram view if the full range is selected.
* app/widgets/gimphistogrambox.c: moved the range widgets below
the histogram.
* app/config/gimpconfig-params.h: added macro
GIMP_CONFIG_INSTALL_PROP_RESOLUTION() that installs a double
property with the suitable range.
* app/core/gimptemplate.c
* app/config/gimpdisplayconfig.c: use it here.
2003-07-17 Michael Natterer <mitch@gimp.org>
* app/config/gimpconfig-params.[ch]: added "gboolean allow_percent"
to gimp_param_spec_unit() and to the GIMP_CONFIG_INSTALL_PROP_UNIT()
macro. Changed value validation accordingly.
* app/config/gimpconfig-types.c (string_to_unit): parse "percent"
correctly.
* app/widgets/gimppropwidgets.c (gimp_prop_unit_menu_new): show
the "Percent" menu entry if the param_spec allows percent.
* app/config/gimpcoreconfig.c
* app/core/gimpgrid.c
* app/core/gimptemplate.c
* app/text/gimptext.c: pass FALSE to disallow percent.
* app/paint/gimppaintoptions.c
* app/tools/gimpselectionoptions.c: pass TRUE. Brings back the
percent feature for fade_length, gradient_length and fixed_size
rect/ellipse select.
* app/tools/gimpbucketfilloptions.c
* app/tools/gimpmagnifyoptions.c
* app/tools/gimpselectionoptions.c
* app/tools/gimptransformoptions.c: don't call the the reset()
functions from the GUI constructors (and reset the options just
deserialized from disk). Instead, added set_defaults() functions
which do everything the old reset() functions did (except
upchaining) and call set_defaults() from reset() and from the GUI
constructors.
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-02-28 Sven Neumann <sven@gimp.org>
* app/config/gimpconfig-deserialize.c
* app/config/gimpconfig-serialize.[ch]: transparently serialize
and deserialize object properties that implement the
GimpConfigInterface.
* app/config/gimpconfig-utils.c (gimp_config_reset_properties):
call reset recursively if properties are itself objects that
implement the GimpConfigInterface.
* app/config/gimpconfig-dump.c: adapt to API changes.
* app/config/gimpconfig-params.h: made object properties installed
using GIMP_CONFIG_INSTALL_PROP_OBJECT() be not writable by default.
* app/core/gimpcontext.c (gimp_context_class_init): made objects
properties explicitely writeable.
* app/tools/gimptextoptions.c: made the GimpText object a property
of GimpTextOptions and removed lots of special handling which is
now transparently done by GimpConfigInterface.
2003-01-31 Sven Neumann <sven@gimp.org>
* app/config/gimpconfig-params.h
* app/config/gimpcoreconfig.c: added a pixels parameter to the
GIMP_CONFIG_INSTALL_PROP_UNIT() macro.
* app/core/Makefile.am
* app/core/gimpimage-text.[ch]: removed these two files.
* app/text/Makefile.am
* app/text/gimptext-compat.[ch]: new files with compatibility
routines that provide the old text API (solely for PDB calls).
* app/text/gimptext-render.[ch]: new files with text rendering
routines (not much yet).
* app/text/text-types.h
* app/text/gimptextlayer.[ch]: new object derived from GimpLayer.
* app/text/gimptext.[ch]: prepared for future improvements.
* app/pdb/text_tool_cmds.c
* app/tools/gimptexttool.c
* tools/pdbgen/pdb/text_tool.pdb: changed accordingly.
2003-01-11 Sven Neumann <sven@gimp.org>
* app/config/Makefile.am: always build gimpconfig-dump.
* app/config/gimpconfig-params.[ch]: added an enum to specify the
type of path with GIMP_PARAM_SPEC_PATH.
* app/config/gimpconfig-dump.c: document the different types of
paths differently.
* app/config/gimpbaseconfig.c
* app/config/gimpcoreconfig.c
* app/config/gimpguiconfig.c
* app/config/gimppluginconfig.c: register the path types.
* etc/gimprc: generated a new system gimprc.
* plug-ins/common/tiff.c: added missing spaces in warning and
removed trailing newlines in strings passed to g_message().
2002-11-28 Sven Neumann <sven@gimp.org>
* app/config/Makefile.am
* app/config/gimpconfig-params-blurbs.h: removed ...
* app/config/gimpconfig-blurbs.h: ... and readded under this name.
Defined all missing blurb definitions to NULL.
* app/config/gimpconfig-params.h: added a blurb parameter to all
GIMP_CONFIG_INSTALL_PROP_* macros.
* app/config/gimpbaseconfig.c
* app/config/gimpcoreconfig.c
* app/config/gimpdisplayconfig.c
* app/config/gimpguiconfig.c: register blurbs with the GimpRc
properties.
* app/config/gimpconfig-serialize.c: do proper line-breaking for
comments.
* app/core/gimpcontext.c
* app/widgets/gimpdeviceinfo.c: register NULL blurbs here.
2002-11-20 Michael Natterer <mitch@gimp.org>
* app/config/gimpconfig-params.h: added GIMP_PARAM_RESTART and
GIMP_PARAM_CONFIRM flags and changed all param spec macros
to have a "flags" parameter.
* app/config/gimpbaseconfig.c
* app/config/gimpcoreconfig.c
* app/config/gimpdisplayconfig.c
* app/config/gimpguiconfig.c: tag the values which need restart or
confirmation with the resp. flags. Changed all macro calls
accordingly.
* app/core/gimpcontext.c
* app/widgets/gimpdeviceinfo.c: changed macro calls accordingly.
2002-10-10 Sven Neumann <sven@gimp.org>
* app/config/gimpconfig-params.[ch]: optionally allow GIMP_UNIT_PIXEL
as value for GimpUnit params.
* app/core/gimpimage-text.[ch]
* app/core/gimptext.[ch]
* app/tools/gimptexttool.c: moved some code around.
2002-09-21 Sven Neumann <sven@gimp.org>
* app/config/gimpconfig-params.h: fixed some macros that were never used.
* data/images/gimp_splash.png: flattened the splash image. The alpha channel
crashed servers with buggy XRender extension (#93841) (and should have never
been there anyway).
2002-05-22 Michael Natterer <mitch@gimp.org>
* app/config/gimpconfig.[ch]: added virtual interface methods
serialize_property() and deserialize_property() which can be used
to implement (de)serialization of special properties or to
override the default implementation.
* app/config/gimpconfig-deserialize.c
* app/config/gimpconfig-serialize.c: for each property, check if
the class which added it implements the virtual functions and call
them before trying the default implementations.
* app/config/gimpconfig-params.h: added new macro
GIMP_CONFIG_INSTALL_PROP_OBJECT().
* app/core/gimpcontext.c: declare the "tool", "brush", "pattern",
"gradient" and "palette" properties as serializable and added
implementations of (de)serialize_property().
2002-05-21 Sven Neumann <sven@gimp.org>
* app/config/Makefile.am: need to link test-config against
libgimpcolor now.
* app/config/gimpconfig.c (gimp_config_serialize): write newlines
after header and before footer.
* app/config/test-config.c
* app/config/gimprc.c
* app/core/gimp-documents.c
* app/core/gimp-parasites.c
* app/gui/test-commands.c: removed the newlines here.
* app/config/gimpconfig-params.h: define GIMP_PARAM_SERIALZE flag
which can be used to mark an object property as serializable.
Make the GIMP_CONFIG_INSTALL_PROP_* macros set it.
* app/config/gimpconfig-deserialize.c
* app/config/gimpconfig-serialize.c: check the GIMP_PARAM_SERIALIZE
flag.
* app/config/gimpconfig-params.c (gimp_param_color_set_default):
fixed.
* app/core/gimpcontext.c: install serializable properties using the
GIMP_CONFIG_INSTALL_PROP_* macros.
2002-05-21 Michael Natterer <mitch@gimp.org>
* app/config/gimpconfig-types.[ch]: added GIMP_TYPE_COLOR as boxed
type encapsulating GimpRGB.
* app/config/gimpconfig-params.[ch]: added GimpParamSpecColor
which is derived from GParamSpecBoxed and adds a default value.
* app/config/gimpconfig-deserialize.c
* app/config/gimpconfig-serialize.c: added generic
(de)serialization of the new property type.
* app/core/gimpcontext.c: implement the config interface, changed
signal parameters and property types to use the new
GIMP_TYPE_COLOR.
* app/core/gimpmarshal.list: added a VOID__BOXED marshaller.
* app/gui/menus.c
* app/gui/test-commands.[ch]: some test code which (de)serializes
the user context.
2001-12-10 Sven Neumann <sven@gimp.org>
* app/config/Makefile.am
* app/config/gimpconfig-substitute.[ch]: new files with code to do
substitution magic on path strings. Similar to the code in gimprc.c
but UTF8 safe.
* app/config/gimpconfig-params.h
* app/config/gimpbaseconfig.c: added a bunch of convenience macros
to register config properties and use them for GimpBaseConfig.
* app/config/gimpconfig-types.h: added missing GIMP_VALUE_HOLDS_FOO()
macros.
* app/config/gimpconfig-deserialize.c: UTF8-validate all strings.
* app/config/gimpconfig-serialize.c: some code reorganisation.
2001-12-09 Sven Neumann <sven@gimp.org>
* app/config/gimpconfig-params.[ch]
* app/config/gimpconfig-types.[ch]: added new param_spec
GIMP_PARAM_PATH with value_type GIMP_PATH_TYPE.
* app/config/gimpconfig.[ch]: added code to store and lookup unknown
tokens.
* app/config/gimpconfig-deserialize.c: improved logic, prepared for
special handling of GIMP_PATH_TYPE; still work in progress...
* app/config/gimpbaseconfig.c: register temp-path and swap-path as
GIMP_PARAM_PATH properties.
2001-12-08 Sven Neumann <sven@gimp.org>
* app/config/Makefile.am
* app/config/gimpconfig-params.[ch]
* app/config/gimpconfig-types.[ch]: new files implementing special
GParamSpecs and GValueTypes needed for GimpConfig.
* app/config/gimpbaseconfig.c: register tile-cache-size property
with GimpParamSpecMemsize.
* app/config/gimpconfig-deserialize.[ch]
* app/config/gimpconfig-serialize.[ch]: enable serialization and
deserialization of non-fundamental types.