and remove all other tool options parent setting/unsetting and
property copying code. Also select a tool at the end of
tool_manager_init() so it is in sync with what the tool options
manager does.
We should not have essential signal connections (such as setting tool
options from brush properties) implemented in the tool options GUI
files, because they are not active until the options GUI is created.
Also, that magic is simply too hidden in the options GUI files.
Move the signal connections and the brush property copying code to
gimppaintoptions.c where is can also be done cleaner.
However, this must only be done for the main tool options instance
that is used for the GUI. Therefore, add a "gui_mode" boolean to
GimpToolOptions and set it to TRUE for all main tool options.
(this is ugly, but much less ugly and much less hidden than all the
places where code lives (like tool_manager.c) that can now be moved
into GimpToolOptions and its subclasses, and implemented cleanly
there).
More than 2000 lines of code less in app/, instead of
if (instance->member)
{
g_object_unref/g_free/g_whatever (instance->member);
instance->member = NULL;
}
we now simply use
g_clear_object/pointer (&instance->member);
gimp_directory_file(), gimp_data_directory_file() etc. The new
functions take a variable list of path elements to the file,
the list has to be NULL-terminated. Remove the newly added
gimp_personal_rc_gfile(). Start using the new functions in app/.
- don't include <gdk-pixbuf/gdk-pixbuf.h> in headers in app/
- instead, include it in many .c files instead of <glib-object.h>,
finally acknowledging the fact that app/ depends on gdk-pixbuf almost
globally
- fix up includes as if libgimpbase depended in GIO, which it soon will
- move the code that sets the tool options' "defined" and "serialize"
properties from GimpToolInto to GimpToolOptions so they are always
set correctly.
- make GimpToolOptions fix broken serialized NULL tools automatically.
- make sure a GimpToolPreset's tool options always has a tool set. If all
fails, set a NULL tool explicitly and let the logic in GimpToolOptions
find the right tool.
- set GimpToolPreset's "use" booleans to FALSE for context properties
that have no effect on the tool.
- set GimpToolPresetEditor's toggle insensitive for these properties.
Override GimpContext's "tool" property and add an evil function that
makes sure we don't set a tool that doesn't match the options. Needed
because tool options are read from disk and thus unreliable per se,
additional we were stupid and wrote wrong tool options to disk.
Begin to consider GimpObject::name as private and always use
gimp_object_get_name(). Change gimp_object_get_name() to take an
untyped pointer so we don't have to do so awfully many casts. There is
a runtime check for the type inside the function anyway.
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
2008-05-18 Michael Natterer <mitch@gimp.org>
* app/core/gimptoolinfo.[ch]: add
gimp_tool_info_build_options_filename() which creates a filename
under $GIMPDIR/tool-options/ with an optional suffix.
* app/core/gimptooloptions.c
* app/core/gimptoolpresets.c: use it and remove own build_filename()
functions.
svn path=/trunk/; revision=25701
2006-12-11 Sven Neumann <sven@gimp.org>
* app/core/gimptooloptions.[ch]: added API to delete saved
tool-options.
* app/tools/gimp-tools.c: don't deal with saving presets, just
load them on startup. Create the tool-options directory when
saving tool-options.
* app/core/gimptoolpresets.[ch]: added new signal that is
emitted
whenever the presets changes. Create the tool-options directory
when saving a preset.
* app/widgets/gimptooloptionseditor.[ch]: listen to the
"changed"
signal of GimpToolPresets and queue an idle save.
2006-12-10 Sven Neumann <sven@gimp.org>
* app/core/Makefile.am
* app/core/core-types.h
* app/core/gimptoolpresets.[ch]: added GimpToolPresets, derived
from GimpList.
* app/core/gimptoolinfo.[ch]: use the new type, renamed
member "options_presets" to "presets".
* app/actions/tool-options-actions.c
* app/actions/tool-options-commands.c
* app/core/gimptooloptions.[ch]
* app/menus/tool-options-menu.c
* app/widgets/gimptooloptionseditor.c: changed accordingly.
* app/tools/gimp-tools.c: let the GimpToolPresets object deal
with
loading and saving the presets from ${gimpdir}/tool-options.
* app/core/gimpcontainer-filter.c
* app/core/gimpdocumentlist.c
* app/core/gimplist.c
* app/text/gimpfontlist.c: use canonical property names.
2006-11-25 Michael Natterer <mitch@gimp.org>
* app/core/gimpbrushclipboard.c
* app/core/gimppatternclipboard.c
* app/core/gimptooloptions.c
* app/core/gimpundo.c
* app/widgets/gimpdevicestatus.c
* app/widgets/gimpdock.c
* app/widgets/gimpimageparasiteview.c
* app/widgets/gimpimagepropview.c: no need to cast the return
value of g_value_get_object(), it's a gpointer.
2006-01-18 Michael Natterer <mitch@gimp.org>
* app/config/config-types.c: define GIMP_PARAM_STATIC_STRINGS
which is G_PARAM_STATIC_NAME|NICK|BLURB. Also define
GIMP_PARAM_READABLE, _WRITABLE and _READWRITE which include
GIMP_PARAM_STATIC_STRINGS.
* app/*/*.c: use them for all object properties so their
strings are not copied.
2005-12-10 Michael Natterer <mitch@gimp.org>
* app/config/*.c
* app/core/*.c
* app/display/*.c
* app/text/*.c
* app/vectors/*.c: port to G_DEFINE_TYPE() and friends. Some related
core reordering and cleanup.
2004-07-03 Michael Natterer <mitch@gimp.org>
* app/core/gimpcontext.[ch]: added context->serialize_props mask
which enables specifying exactly which properties will be
serialized. Also fixes a bug that prevented undefined properties
from being serialized, breaking tool_options and device status
serialization.
* app/core/gimptoolinfo.c (gimp_tool_info_new): make only the
properties in the tool_info->context_props mask serializable, also
configure/initialize tool_info->tool_options.
* app/tools/gimp-tools.c (gimp_tools_register): removed
tool_options initialization that is now done in
gimp_tool_info_new().
* app/widgets/gimpdeviceinfo.c: make only the properties in
GIMP_DEVICE_INFO_CONTEXT_MASK serializable.
* app/widgets/gimpdevicestatus.c: add the device table to its
parent container again. Fixes "missing" devices.
* app/core/gimptooloptions.c
* app/widgets/gimpdevices.c: cleanup / code review.
2003-09-29 Michael Natterer <mitch@gimp.org>
* app/core/gimptoolinfo.[ch]: added a GimpContainer of tool
options presets.
* app/core/gimptooloptions.[ch] (gimp_tool_options_set_property):
silently accept setting the *same* tool_info again.
(gimp_tool_options_build_filename): is public now.
* app/tools/gimp-tools.c (gimp_tools_restore,save): load and save
the presets container.
* app/gui/tool-options-dialog.[ch]: removed.
* app/gui/tool-options-commands.[ch]
* app/gui/tool-options-menu.[ch]: new files implementing a menu
for the new GimpToolOptionsEditor widget. Has submenus for saving,
loading, and deleting tool options to/from the
tool_info->options_presets container.
* app/gui/Makefile.am
* app/gui/dialogs-constructors.c
* app/gui/menus.c: changed accordingly.
* app/widgets/Makefile.am
* app/widgets/widgets-types.h
* app/widgets/gimptooloptionseditor.[ch]: the tool options dialog
as proper widget. The "Load" and "Save" buttons still do the same
stuff as before. Will make them use the new presets since making
them do something useful was the reason for this whole change.
* app/widgets/gimphelp-ids.h: added missing help IDs for the tool
options dialog.
2003-08-30 Michael Natterer <mitch@gimp.org>
Fixed & cleaned up paint function registration to work without
GUI. Finishes core/GUI separation for the paint tools:
* app/core/gimppaintinfo.[ch]: removed "gchar *pdb_string" all over
the place since we don't stroke using the PDB any more.
(gimp_paint_info_new): create paint_info->paint_options here so
the paint system is fully initialized when there is no GUI.
* app/paint/paint.c: removed pdb_string stuff here, too.
* app/core/gimptoolinfo.[ch]: create tool_info->tool_options
only if tool_info->tool_options_type is not the same type
as paint_info->paint_options_type (if we are no paint tool).
* app/core/gimptooloptions.c: removed G_PARAM_CONSTRUCT_ONLY from
the "tool-info" property. Instead, changed
gimp_tool_options_set_property to ensure that it is only set once.
* app/core/gimp.c (gimp_initialize): moved paint_init() after
data_factory creation (was in gimp_init()), since GimpPaintInfo
now creates the GimpPaintOptions, which are GimpContexts, which
need gimp->*_factory to be constructed.
* app/tools/tool_manager.c: don't create tool_info->tool_options
here (it's not the job of the tool_manager to set up the core
paint system correctly, it must be already initialized before any
tool_manager function is called).
Made "Stroke Selection" and "Stroke Path" work the same way:
* app/paint/gimppaintcore-stroke.[ch]: added new function
gimp_paint_core_stroke_boundary() which strokes without using
the PDB.
* app/core/gimpimage-mask.c (gimp_image_mask_stroke): use it
instead of using the PDB. Enables all available paint options for
stroke operations. Fixes bug #119411.
* app/gui/vectors-commands.c (vectors_stroke_vectors)
* app/core/gimpimage-mask.c (gimp_image_mask_stroke): removed all
code which tries to figure how to stroke and simply look at the
active tool's tool_info->paint_info, since it is always set up
correctly now.
2003-07-24 Michael Natterer <mitch@gimp.org>
* app/core/gimptooloptions.c (gimp_tool_options_serialize):
add the name of the tool to the header and footer strings.
2003-06-23 Sven Neumann <sven@gimp.org>
* app/config/gimpconfig.[ch]
* app/config/gimpconfigwriter.[ch]
* app/config/gimpscanner.[ch]: added support for serializing to
and deserializing from strings. Had to do some smaller changes to
the GimpConfig API.
* app/config/test-config.c: added a simple test for the new
functions.
* app/config/gimpconfig-dump.c
* app/config/gimprc.c
* app/core/gimp-documents.c
* app/core/gimp-parasites.c
* app/core/gimp-templates.c
* app/core/gimpunits.c
* app/gui/session.c
* app/plug-in/plug-in-rc.c
* app/tools/tool_options.c
* app/widgets/gimpdevices.c: follow GimpConfig API changes.
* libgimpbase/gimpparasite.[ch]: declared the return value of
gimp_parasite_data() as gconstpointer.
2003-03-25 Sven Neumann <sven@gimp.org>
* Makefile.am
* gimpintl.h: removed this header file.
* gimpmiscui.c: include libgimp-intl.h.
* gimp.c (gimp_main): call setlocale() and bind to the libgimp
textdomain so that plug-ins don't need to do that explicitely.
* libgimp/stdplugins-intl.h: added the functionality that used to
live in gimpintl.h and removed the libgimp related stuff. Got rid
of the INIT_I18N_UI() macro.
* plug-ins/*/*.c: removed all occurances of INIT_I18N_UI().
Plug-ins simply call INIT_I18N() once in their run() function.
* plug-ins/script-fu/script-fu-intl.h: added the functionality
that used to live in gimpintl.h and removed the libgimp related
stuff.
* app/Makefile.am
* app/gimp-intl.h: new file that defines the gettext macros for
the GIMP core.
* app/*/*.c: include gimp-intl.h instead of libgimp/gimpintl.h.
* plug-ins/script-fu/scripts/test-sphere.scm: fixed typos.
2003-02-26 Sven Neumann <sven@gimp.org>
* app/config/gimpconfig-serialize.c (gimp_config_serialize_properties):
don't insert an extra line-break after a serialized property.
* app/config/gimpconfig-serialize.c
* app/config/gimpconfig-dump.c
* app/gui/tips-parser.c: use g_string_truncate (str, 0) instead of
assigning an empty string.
* app/tools/gimptextoptions.c: override the serialize and
deserialize methods of the GimpConfig interface and save/restore
the associated GimpText object instead of GimpTextOptions.
* app/tools/tool_options.c (gimp_tool_options_build_filename):
don't append ".default" if no extension is given.
2003-02-10 Michael Natterer <mitch@gimp.org>
* app/tools/tool_options.[ch]: added a "const gchar *extension"
parameter to gimp_tool_options_[de]serialize(). Default to
"default" if NULL is passed.
* app/tools/tool_manager.[ch]: load the tool_options from the
default files in tool_manager_restore(), added tool_manager_save()
which saves the default files.
* app/app_procs.c: call tool_manager_save() on app exit.
* app/gui/tool-options-dialog.c: pass "user" when loading/saving
the user defaults. Changed tooltips of the load & save buttons.
2003-02-09 Michael Natterer <mitch@gimp.org>
* app/core/gimpcontext.[ch]: simplified everything a lot by
merging the public GimpContextPropType enum with the internal
anonymous object property id enum. Removed the internal copy_prop
functions and handle property copying in a big switch() in
gimp_context_copy_property(). Removed the separate signal
connections for each property of the parent context and do the
same using a single "notify" handler. Emit "notify" signals all
over the place. Removed internal arrays which are no longer
needed due to enum merge and copy_property simplification.
Removed the array of signal names and use g_signal_name().
Removed gimp_context_unset_parent() and allow "parent" being NULL
in gimp_context_set_parent().
* app/tools/tool_manager.c
* app/widgets/gimpdevices.c: changed accordingly.
* libgimptool/gimptooltypes.h: changed GimpToolOptionsGUIFunc to
return a GtkWidget (the created tool options widget).
* libgimptool/gimptoolmodule.c: #include <gtk/gtk.h>
* app/tools/tool_options.[ch]: removed the "main_vbox" from the
GimpToolOptions struct. Changed gimp_tool_options_gui() to create
and return the main_vbox.
* app/tools/tool_manager.c: create the "This Tool has no Options"
label here if NULL was passed as "options_gui_func". Attach the
options widget to the tool_options object using
g_object_set_data().
* app/gui/tool-options-dialog.c: changed accordingly.
* app/tools/gimpairbrushtool.c
* app/tools/gimpblendoptions.[ch]
* app/tools/gimpbucketfilloptions.[ch]
* app/tools/gimpclonetool.c
* app/tools/gimpcolorpickeroptions.[ch]
* app/tools/gimpconvolvetool.c
* app/tools/gimpcropoptions.[ch]
* app/tools/gimpdodgeburntool.c
* app/tools/gimperasertool.c
* app/tools/gimpflipoptions.[ch]
* app/tools/gimpinkoptions.[ch]
* app/tools/gimpmagnifyoptions.[ch]
* app/tools/gimpmeasureoptions.[ch]
* app/tools/gimpmoveoptions.[ch]
* app/tools/gimpselectionoptions.[ch]
* app/tools/gimpsmudgetool.c
* app/tools/gimptextoptions.[ch]
* app/tools/gimptransformoptions.[ch]
* app/tools/gimpvectoroptions.[ch]
* app/tools/paint_options.[ch]: return the options vbox from
all tool_options_gui functions.
2001-11-20 Michael Natterer <mitch@gimp.org>
* app/tools/tools-types.h: added GimpToolRegisterFunc,
GimpToolRegisterCallback and GimpToolOptionsNewFunc typedefs
which are used to register tools.
* app/tools/tools.c: put the register funcs in an array of
GimpToolRegisterFuncs. Pass a Gimp pointer *plus* a
GimpToolRegisterCallback (which is tool_manager_register_tool())
to the tools' register functions.
* app/tools/tool_manager.[ch]: added a GimpToolOptionsNewFunc to
the parameters of tool_manager_register_tool(). Create the tool
options here, not in each tool.
* app/tools/paint_options.[ch]
* app/tools/selection_options.[ch]
* app/tools/tool_options.[ch]
* app/tools/transform_options.[ch]: all _init() and _new()
functions take a GimpToolInfo pointer now. The _reset() func needs
to be set manually now.
* app/tools/[all_tools].[ch]: changed accordingly:
- pass GimpToolOptionsNewFuncs to the register callback.
- don't create the tool options in the tools' _init() function.
- removed all static tool options variables.
- get the options from the tool system in the cases i missed
in my last commit.
- added minor hacks to get rid of the static options pointer
in some pathological cases :) (i.e. the ink tool).
2001-07-17 Michael Natterer <mitch@gimp.org>
* app/path.[ch]: removed path_to_beziersel() so this file can be
safely included from core/.
* app/tools/gimpbezierselecttool.[ch]: added it here.
* app/core/core-types.h: added a GimpToolOptions typedef. Removes
deps into tools/ and will later be a core object anyway.
* app/tools/tools-types.h: removed the ToolOptions typedef here.
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.c
* app/core/gimpimage.c
* app/core/gimptoolinfo.[ch]: removed deps into tools/, misc stuff.
* app/tools/tool_manager.[ch]: some ugly temp hacks. Please ignore.
* app/widgets/gimpdialogfactory.[ch]: added a "remember_if_open" field
to the GimpDialogFactoryEntry so we can manage dialogs which should
not be re-opened on startup.
* app/gui/dialogs-constructors.c
* app/gui/dialogs.c: register & create all editor dialog with the
"global_dialog_factory".
* app/gui/tool-options-dialog.c
* app/tools/*: s/ToolOptions/GimpToolOptions/