The context can now be null unless the gradient specifically needs
the foreground/background colors, in which case
gimp_context_get_{foreground,background} will do the check and warn.
Fix the places that passed the color by either temp_buf_data_clear()
or memset(), and assign x and y manually, they are going to vanish
completely soon.
Instead, set their statically remembered pointer as a weak pointer so
it's nullified automatically if they are ever finalized. Doesn't
actually get rid of them upon exit yet, this is just a preparation.
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
Partial merge of code from Aurimas Juška.
* app/core/gimpdata.c: Implement GimpTagged::get_identifier() and
GimpTagged::get_checksum().
* app/core/gimpbrush.c:
* app/core/gimpgradient.c
* app/core/gimppalette.c
* app/core/gimppattern.c: Implement GimpTagged::get_checksum().
They all use the GimpData implementation of
GimpTagged::get_identifier().
svn path=/trunk/; revision=27784
Partial merge of code from Aurimas Juška.
* app/core/gimpdata.[ch] (gimp_data_make_internal): Add an
'identifier' parameter/instance struct member that can be used to
identify the internal GimpData object across sessions. It is the
internal-object counterpart to a file path.
* app/core/gimp.c
* app/core/gimpcurve.c
* app/core/gimpbrush.c
* app/core/gimppattern.c
* app/core/gimppalette.c
* app/core/gimpgradient.c
* app/core/gimp-gradients.c: Assign an identifier to the the
internal GimpData objects.
svn path=/trunk/; revision=27781
2007-11-04 Sven Neumann <sven@gimp.org>
* app/widgets/gimpviewrenderer.[ch]: replaced the RGB buffer
with
a Cairo surface.
* app/widgets/gimpviewrendererbuffer.c
* app/widgets/gimpviewrendererbrush.c
* app/widgets/gimpviewrendererdrawable.c
* app/widgets/gimpviewrenderergradient.c
* app/widgets/gimpviewrendererimage.c
* app/widgets/gimpviewrendererpalette.c
* app/widgets/gimpviewrenderervectors.c: changed accordingly.
There
are some loose ends here that will be fixed over the next days.
* app/widgets/gimprender.c: removed gimp_render_temp_buf; it is
not any longer needed.
* app/core/gimpgradient.c (gimp_gradient_get_preview_size):
return
an odd preview height to make the border align with the pixel
grid.
svn path=/trunk/; revision=24056
2006-10-03 Michael Natterer <mitch@gimp.org>
* app/core/gimpgradient-load.h: keep the file extension defines
here, just as we do it for brushes.
* app/core/gimpgradient.h: removed them here.
* app/core/gimpgradient.c: changed accordingly.
2006-09-20 Michael Natterer <mitch@gimp.org>
* app/core/gimpgradient.[ch]: added gimp_gradient_flatten() which
creates a copy of a gradient with all colors that refer to FG or
BG turned into constant colors.
* app/core/gimpdrawable-blend.c (gradient_fill_region): create a
flat copy of the gradient if it contains FG/BG colors. Avoids
gazillions of context color lookups while rendering, depending on
gradient and blend complexity.
2006-08-31 Michael Natterer <mitch@gimp.org>
* app/core/gimpgradient.[ch] (gimp_gradient_has_fg_bg_segments):
new funtion which returns TRUE if any of the gradient's segments
refer to FG of BG.
(gimp_gradient_segment_get_left_color_type)
(gimp_gradient_segment_set_left_color_type)
(gimp_gradient_segment_get_right_color_type)
(gimp_gradient_segment_set_right_color_type): new accessors for
the new GimpGradientColor stuff.
(gimp_gradient_segment_split_midpoint)
(gimp_gradient_segment_range_flip)
(gimp_gradient_segment_range_replicate): split, flip and replicate
the segments' color_types too.
* app/widgets/gimpviewrenderer.[ch]: added virtual functions
::set_context() and ::invalidate() and call them.
* app/widgets/gimpviewrenderergradient.[ch]: implement the virtual
functions. Connect to the context's "foreground-changed" and
"background-changed" signals if the gradient contains FG or BG
colors and invalidate the renderer whenever they change.
* app/core/gimp-gradients.c: removed signal connections which
invalidated the gradients on FG/BG changes of the user context.
2006-08-29 Michael Natterer <mitch@gimp.org>
Changed GimpViewable preview rendering to have a context to get
FG/BG/whatever from. Use the context to enable dynamic FG/BG
colors in gradients. Fixes bug #127676 and bug #352214. Addresses
bug #128367 (doesn't fix it because there's no loading/saving and
no GUI yet).
* app/core/core-enums.[ch]: added enum GimpGradientColor to enable
specifying gradient colors in terms of foreground and background.
* app/core/gimpgradient.[ch]: added color_type members to the
GimpGradientSegment struct and honor them in
gimp_gradient_get_color_at(). Added GimpContext parameters to all
functions which finally call get_color_at().
* app/core/gimp-gradients.c: use the new method to implement the
builtin gradients.
* app/core/gimpviewable.[ch]: added GimpContext parameters to all
get_preview() and get_pixbuf() functions.
* app/core/gimpbrush.c
* app/core/gimpbuffer.c
* app/core/gimpdrawable-preview.[ch]
* app/core/gimpgradient.c
* app/core/gimpimage-preview.[ch]
* app/core/gimpimagefile.c
* app/core/gimppalette.c
* app/core/gimppattern.c
* app/core/gimpundo.[ch]
* app/text/gimpfont.c
* app/vectors/gimpvectors-preview.[ch]: changed ::get_preview()
and ::get_pixbuf() implementations accordingly.
* app/core/gimpdrawable-blend.c
* app/core/gimppalette-import.[ch]
* app/dialogs/dialogs-constructors.c
* app/dialogs/palette-import-dialog.c
* app/dialogs/resize-dialog.c
* app/display/gimpdisplayshell-layer-select.c
* app/display/gimpdisplayshell.c
* app/display/gimpnavigationeditor.c
* app/paint/gimppaintoptions.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimptexttool.c
* app/actions/gradient-editor-commands.c
* app/widgets/gimpaction.c
* app/widgets/gimpbrusheditor.[ch]
* app/widgets/gimpbufferview.c
* app/widgets/gimpcellrendererviewable.c
* app/widgets/gimpchanneltreeview.c
* app/widgets/gimpclipboard.c
* app/widgets/gimpcoloreditor.c
* app/widgets/gimpcomponenteditor.c
* app/widgets/gimpcontainerbox.c
* app/widgets/gimpcontainercombobox.c
* app/widgets/gimpcontainereditor.c
* app/widgets/gimpcontainerentry.c
* app/widgets/gimpcontainergridview.c
* app/widgets/gimpcontainertreeview.[ch]
* app/widgets/gimpdataeditor.[ch]
* app/widgets/gimpdevicestatus.c
* app/widgets/gimpdnd.[ch]
* app/widgets/gimpdrawabletreeview.c
* app/widgets/gimpfiledialog.c
* app/widgets/gimpgradienteditor.[ch]
* app/widgets/gimpgradientselect.c
* app/widgets/gimpitemtreeview.c
* app/widgets/gimplayertreeview.c
* app/widgets/gimppaletteeditor.[ch]
* app/widgets/gimppropwidgets.[ch]
* app/widgets/gimpselectioneditor.c
* app/widgets/gimpthumbbox.[ch]
* app/widgets/gimptoolbox-image-area.c
* app/widgets/gimptoolbox-indicator-area.c
* app/widgets/gimptooloptionseditor.c
* app/widgets/gimpundoeditor.c
* app/widgets/gimpvectorstreeview.c
* app/widgets/gimpview-popup.[ch]
* app/widgets/gimpview.[ch]
* app/widgets/gimpviewablebutton.c
* app/widgets/gimpviewabledialog.c
* app/widgets/gimpviewrenderer.[ch]
* app/widgets/gimpviewrenderer-frame.c
* app/widgets/gimpviewrendererbrush.c
* app/widgets/gimpviewrendererbuffer.c
* app/widgets/gimpviewrendererdrawable.c
* app/widgets/gimpviewrenderergradient.c
* app/widgets/gimpviewrendererimage.c
* tools/pdbgen/pdb/drawable.pdb
* tools/pdbgen/pdb/gradient.pdb
* tools/pdbgen/pdb/gradients.pdb
* tools/pdbgen/pdb/image.pdb: added tons of GimpContext members
and parameters, implement GimpDocked::set_context() in many
widgets. Pass these locally remembered contexts to GimpViewable
functions. Did some minor cleanups on the way. There are still
some minor FIXMEs around where the code uses a NULL context (which
is allowed by the APIs)
* app/pdb/drawable_cmds.c
* app/pdb/gradient_cmds.c
* app/pdb/gradients_cmds.c
* app/pdb/image_cmds.c: regenerated.
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.
2005-06-08 Sven Neumann <sven@gimp.org>
Removed "stingy-memory-use" all over the place. This feature was
really not that useful anymore. The GUI for the preference option
was already removed for GIMP 2.2. Fixes bug #306617.
* app/config/gimpbaseconfig.[ch]: set IGNORE flag on
"stingy-memory-use".
* app/config/gimpcoreconfig.h: added a comment that the
font_path_writable variable is unused.
* app/base/temp-buf.[ch]: removed code that used to deal with
swapping temp-bufs to disk.
* app/base/base.c: made base_config a static variable.
* app/core/gimpdata.[ch]
* app/core/gimpdatafactory.[ch]: removed stingy_memory_use
parameter from data construction methods.
* app/core/gimp-gradients.c
* app/core/gimpbrush-load.[ch]
* app/core/gimpbrush.[ch]
* app/core/gimpbrushgenerated.[ch]
* app/core/gimpbrushpipe.[ch]
* app/core/gimpcontext.c
* app/core/gimpgradient-load.[ch]
* app/core/gimpgradient.[ch]
* app/core/gimppalette-import.c
* app/core/gimppalette.[ch]
* app/core/gimppattern.[ch]: changed accordingly.
2005-03-08 Sven Neumann <sven@gimp.org>
* app/core/gimpgradient.c (gimp_gradient_segment_split_uniform):
fixed brokeness introduced I when eliminating gradient->last_visited.
2005-02-27 Sven Neumann <sven@gimp.org>
* app/core/gimpgradient.[ch]: removed the "last_visited" field
from GimpGradient. Instead added the new function
gimp_gradient_get_color_at_segment() that allows the caller to do
the same optimization.
* app/actions/gradient-editor-commands.c
* app/core/gimpdrawable-blend.c
* app/core/gimppalette-import.c
* app/paint/gimppaintoptions.c
* app/widgets/gimpgradienteditor.c
* app/widgets/gimpgradientselect.c
* app/widgets/gimpviewrenderergradient.c: changed accordingly.
* app/pdb/gradient_cmds.c
* app/pdb/gradients_cmds.c: regenerated.
2004-10-04 Michael Natterer <mitch@gimp.org>
* tools/pdbgen/pdb/brush.pdb
* tools/pdbgen/pdb/gradient.pdb
* tools/pdbgen/pdb/palette.pdb: disallow the empty string for
new brushes, gradients and palettes and check the return value
of gimp_data_factory_data_new(). Cleanup.
* app/core/gimpbrushgenerated.c (gimp_brush_generated_new)
* app/core/gimpgradient.c (gimp_gradient_new)
* app/core/gimpdatafactory.c (gimp_data_factory_data_new): same
here. Fixes bug #154264.
* app/core/gimpdata.[ch] (gimp_data_set_filename): added boolean
"deletable" parameter because it's not derivable from "writable".
* app/core/gimpdatafactory.c (gimp_data_factory_load_data): need
to figure "deletable" separately from "writable" to be able to
delete unsavable stuff in the user-writable data directories.
Fixes bug #154410.
(gimp_data_factory_data_save_single): cleaned up.
* app/pdb/brush_cmds.c
* app/pdb/gradient_cmds.c
* app/pdb/palette_cmds.c
* libgimp/gimpbrush_pdb.c
* libgimp/gimpgradient_pdb.c
* libgimp/gimppalette_pdb.c: regenerated.
2004-06-13 Michael Natterer <mitch@gimp.org>
* app/core/gimpdata.[ch]: added "gint freeze_count" and
gimp_data_freeze()/thaw() functions. Emit "dirty" only if
freeze_count either is 0 or drops to 0.
* app/core/gimpbrushgenerated.[ch]
* app/core/gimpgradient.[ch]: removed freeze/thaw stuff that
was duplicated in these two subclasses and use the new
GimpData API instead.
* app/widgets/gimpbrusheditor.c
* app/widgets/gimpgradienteditor.c: changed accordingly.
2004-06-01 Michael Natterer <mitch@gimp.org>
* app/core/core-enums.h: renamed the values of the
GimpGradientSegment* enums from GIMP_GRAD_* to
GIMP_GRADIENT_SEGMENT_* because they are exported now.
* app/core/gimp-gradients.c
* app/core/gimpgradient.c
* app/actions/gradient-editor-actions.c: changed accordingly.
* libgimp/gimpenums.h
* plug-ins/pygimp/gimpenums.py
* plug-ins/script-fu/script-fu-constants.c
* tools/pdbgen/enums.pl: regenerated.
2004-05-31 Michael Natterer <mitch@gimp.org>
* app/core/core-enums.h
* app/core/gimpgradient.[ch]
* app/pdb/Makefile.am
* app/widgets/gimpgradienteditor.c
* tools/pdbgen/Makefile.am
* tools/pdbgen/groups.pl
* tools/pdbgen/pdb/gradient_edit.pdb: applied a patch from Shlomi
Fish that adds lots of gradient edit functions to
gimpgradient.[ch] and makes them available through the PDB.
Fixes bug #129675 and bug #129678.
Did some cleanups / enhancments to the patch:
* app/core/gimpgradient.[ch]: changed the naming scheme of the new
functions and changed old functions to match the new scheme.
Introduce a "freeze_count" and public freeze()/thaw() API which
enables subsequent gradient changes without "dirty" being emitted
all the time. Added GimpGradient parameters to all functions
which modify the gradient.
* app/widgets/gimpgradienteditor.c: use the new freeze/thaw
stuff to keep the gradient from updating when not in
"Instant Update" mode.
* app/actions/gradient-editor-commands.c: removed all gradient
editing code and call the new core functions.
* libgimp/Makefile.am
* tools/pdbgen/pdb/gradient_edit.pdb: changed the namespace of all
added functions. Generate libgimp wrappers for them..
* app/pdb/gradient_edit_cmds.c
* app/pdb/internal_procs.c
* libgimp/gimp_pdb.h
* libgimp/gimpenums.h
* libgimp/gimpgradientedit_pdb.[ch]
* plug-ins/pygimp/gimpenums.py
* plug-ins/script-fu/script-fu-constants.c
* tools/pdbgen/enums.pl: (re)generated.
2004-02-13 Michael Natterer <mitch@gimp.org>
Fixed GimpData's default "writable" and "deletable" behaviour:
* app/core/gimpdata.c (gimp_data_init): default to writable and
deletable == TRUE (something that has no filename was never loaded
from disk and can't be undeletable or read-only).
Fixes bug #134274.
* app/core/gimpdata.[ch]: added new function
gimp_data_make_internal() which frees the filename and sets the
data's flags accordingly.
* app/core/gimp-gradients.c (gimp_gradients_add_gradient)
* app/core/gimpbrush.c (gimp_brush_get_standard)
* app/core/gimpgradient.c (gimp_gradient_get_standard)
* app/core/gimppalette.c (gimp_palette_get_standard)
* app/core/gimppattern.c (gimp_pattern_get_standard): use the
new function for internal data objects.
* app/core/gimpdata.c (gimp_data_save, gimp_data_delete_from_disk)
* app/core/gimpdatafactory.c (gimp_data_factory_save_single):
bail out with g_return_if_fail() is the data is not writable
or deletable.
* app/widgets/gimpdataeditor.c
* app/widgets/gimpdatafactoryview.c: changed accordingly.
2004-01-29 Michael Natterer <mitch@gimp.org>
GimpData code review:
* app/core/gimpdata.c (gimp_data_init): default to
writable = FALSE and dirty = TRUE.
* app/core/gimpbrushgenerated.[ch]: added "const gchar *name" to
gimp_brush_generated_new().
* app/core/gimpbrush.c
* app/core/gimpbrushgenerated.c
* app/core/gimpbrushpipe.c
* app/core/gimpgradient.c
* app/core/gimppalette.c
* app/core/gimppattern.c: set all standard datas to clean and
internal, check for g_path_is_absolute() in all load functions,
pass the data's name as construct property to g_object_new()
instead of calling gimp_object_set_name() after creation, fixed
some UTF-8 handling, spacing, indentation, coding style, general
cleanup.
2004-01-28 Michael Natterer <mitch@gimp.org>
Added infrastructure to make sure we don't write to the global
brush, pattern etc. directories. Needed to make this configurable
because we can't rely on the global directories being read-only,
having certain names or being otherwise detectable at runtime in a
sane way. Fixes bug #132214.
* libgimpbase/gimpdatafiles.[ch]: added "const gchar *dirname" to
the GimpDataFileData struct so callbacks don't need to call
g_path_get_dirname() for each file.
* libgimpwidgets/gimpfileentry.c: made it work with non UTF-8
encoded filenames.
* libgimpwidgets/gimppatheditor.[ch]: ditto. Added GUI and API for
setting/getting a second "writable_path". The widget makes sure
that the writable_path is always a subset of the path.
* app/config/gimpconfig-utils.[ch]: added new function
gimp_config_build_writable_path().
* app/config/gimpcoreconfig.[ch]: added separate properties for
the writable brush, pattern, gradient, palette and font paths.
* app/config/gimprc-blurbs.h: added (still empty) blurbs for the
new properties.
* app/core/gimpdata.[ch] (gimp_data_set_filename): added parameter
"gboolean writable". Set data->writable to FALSE by default. If
"writable" is passed as TRUE, still check if we can write to the
file before setting data->writable to TRUE.
(gimp_data_create_filename): changed "data_path" parameter to
"dest_dir" and assume dest_dir is writable.
(gimp_data_duplicate): set data->dirty to TRUE to make sure
duplicated things will be saved.
* app/core/gimpbrush.c
* app/core/gimpbrushgenerated.c
* app/core/gimpbrushpipe.c
* app/core/gimpgradient.c
* app/core/gimppalette.c
* app/core/gimppattern.c: don't set the data's filename and don't
touch data->dirty in the _load() functions because that's done by
the data factory now. Don't touch data->dirty in the _duplicate()
functions because that's done by gimp_data_duplicate() itself now.
* app/core/gimpdatafactory.[ch] (gimp_data_factory_new): added
"writable_property_name" and remember it.
Added utility function gimp_data_factory_get_save_dir() which
determines the directory to save new datas to.
Added public function gimp_data_factory_data_save_single() which
saves a single data object.
Make sure new things get saved to the first writable directory
as specified in preferences.
* app/core/gimp.c (gimp_real_initialize): pass the writable_paths'
property names to gimp_data_factory_new().
* app/widgets/gimpdataeditor.c (gimp_data_editor_save_dirty): use
gimp_data_factory_data_save_single() instead of implementing
saving here.
* app/widgets/gimppropwidgets.[ch] (gimp_prop_path_editor_new):
added "const gchar *writable_property_name" parameter (can be
NULL).
Added the needed callbacks to handle the writable_path and made
the path_editor and file_entry code aware of non UTF-8 filename
encodings. Some general cleanup.
* app/gui/preferences-dialog.c: changed accordingly.
2004-01-19 Sven Neumann <sven@gimp.org>
* app/*/*.c: include "libgimpbase/gimpbase.h" where needed; removed
now unnecessary inclusions of "file/file-utils.h".
2004-01-19 Sven Neumann <sven@gimp.org>
* app/file/file-utils.[ch]: removed file_utils_filename_to_utf8() ...
* libgimpbase/gimputils.[ch]: ... and added it here as
gimp_filename_to_utf8(). Added some docs that promise less than
the current implementation holds so that we can change the
implementation later.
* app/*/*.c: use gimp_filename_to_utf8() where
file_utils_filenames_to_utf8() has been used before.
* libgimpbase/gimpbase.def: changed accordingly.
* configure.in: reset GIMP_INTERFACE_AGE.