This includes improvements on the out-of-gamut colored corner being shown for
unbounded component types out of the [0; 1] range (with some small margin of
error to avoid e.g. a -0.0000001 value to show as out-of-gamut).
There are still improvements to be made on the color rendering. In particular,
it still draws as CAIRO_FORMAT_RGB24 cairo surface. We should probably move to
draw as CAIRO_FORMAT_RGBA128F eventually (more precision and even allowing to
draw unbounded colors with a possible option, instead of always clipping).
Also adding the libgimpwidgets API gimp_widget_get_render_space().
Since it appeared with GLib 2.68.0, we could not change this until we
bumped the dependency which has only become possible a few days ago
(since Debian testing is our baseline for dependency bumps). Cf.
previous commit.
As this is a drop-in replacement (just a guint parameter changed to
gsize to avoid integer overflow), search-and-replace with:
> sed -i 's/g_memdup\>/g_memdup2/g' `grep -rIl 'g_memdup\>' *`
… followed by a few manual alignment tweaks when necessary.
This gets rid of the many deprecation warnings which we had lately when
building with a recent GLib version.
For single drawable drag, we still display the name of this only layer.
Also apply some basic markups, showing the drawable count as italic
subscript in parentheses to differentiate it from a drawable name.
This whole drag'n drop code is quite overwhelming, I'm pretty sure this
commit introduced various bugs, and there are already several areas of
improvements I noticed. But at some point, I need to split at a not-too
broken code state or I'll just make things worse.
In GTK+3 GIMP, without a "width-chars" even short layer names (a few
letters) were always ellipsized to nothingness with the "ellipsize"
property.
So add a reasonable prefered width char (which will be at most 10
characters, less if the layer name is smaller).
Also drop "xpad" property as this is now deprecated.
Add tool-group support to GimpToolEditor, used to organize tools in
the Preferences dialog, including creating, rearranging, and
deleting groups. Also, major cleanup.
and use GtkNotebook's implementation instead. This is mostly moving
dockable adding and removing code to GtkNotebook::page_added() and
::page_removed() and removing lots of code.
...from tool options crashes GIMP
Applied a modified patch that actually removes the target list if it
became empty. This may or may not fix the bug; I can't tell because I
couldn't reproduce it any longer.
...after in-DND image switching
This was actually two issues:
First, DND data is normally transferred on drop. In this situation the
contents of the source widget change in the middle of DND, so when the
drop happens there is nothing to transfer. Fixed this by attaching the
thing to transfer (image, item, color etc) to the GdkDragContext when
the DND operation starts, and trying to retrieve it on drop. Only when
nothing is attached we fall back to the traditional way of asking the
source widget. This is expected and an obvious fix.
Second, and not so obvious, the source part of the GTK+-internal state
of the DND operation (GtkDragSourceInfo) contains a *reference* (not a
copy) of the source widget's target list. When we change images in the
middle of DND, the source layer view's target list gets modified, and
because GtkDragSourceInfo only references it, the state of the ongoing
DND operation gets destroyed with it. Fixed this by changing
gimp_dnd_data_source_remove() to never change a source widget's target
list but instead create a new list without the removed target and
replace the source widget's list, keeping the ongoing drag's list
unaffected.
Also kept all the GIMP_LOG() stuff I added during debugging there, it
turned out to be quite useful.
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-10-09 Michael Natterer <mitch@gimp.org>
Add GEGL_CFLAGS and #includes as if gimpdrawable.h and gimpimage.h
had a GEGL dependency (they will have in the next commit, but I
wanted to keep the commit separate).
* app/dialogs/Makefile.am
* app/file/Makefile.am
* app/gui/Makefile.am
* app/menus/Makefile.am
* app/paint/Makefile.am
* app/plug-in/Makefile.am
* app/text/Makefile.am
* app/vectors/Makefile.am
* app/widgets/Makefile.am
* app/xcf/Makefile.am: add GEGL_CFLAGS.
* app/actions/*.c
* app/core/*.c
* app/dialogs/*.c
* app/display/*.c
* app/file/*.c
* app/gui/*.c
* app/menus/*.c
* app/paint/*.c
* app/pdb/gimppdb-utils.c
* app/pdb/gimpprocedure.c
* app/plug-in/*.c
* app/text/*.c
* app/tools/*.c
* app/vectors/*.c
* app/widgets/*.c
* app/xcf/*.c: add <gegl.h> or replace <glib-object.h> by <gegl.h>
to all files which include a drawable subclass or gimpimage.h
* tools/pdbgen/app.pl: include <gegl.h> instead of <glib-object.h>
in all generated files.
* app/pdb/*-cmds.c: regenerated.
* data/images/gimp-splash.png: the goat is still sleeping.
By Aurore Derriennic.
svn path=/trunk/; revision=27202
2007-10-16 Sven Neumann <sven@gimp.org>
* libgimp/gimppatternselectbutton.c
* libgimp/gimpbrushselectbutton.c
* libgimpwidgets/gimpcolorarea.c
* app/widgets/gimpdnd.c
* app/widgets/gimpdockbook.c: set GDK_WINDOW_TYPE_HINT_DND on
popup windows used to implement a DND cursor.
svn path=/trunk/; revision=23841
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-07-25 Michael Natterer <mitch@gimp.org>
Some DND fixes / cleanup:
* app/widgets/widgets-enums.h: renamed GIMP_DND_TYPE_TOOL to
GIMP_DND_TYPE_TOOL_INFO.
* app/widgets/gimpselectiondata.[ch]: s/tool/tool_info/g. Moved
private functions to the end of the file. Include GIMP's PID in
all GtkSelectionData strings which are used to pass around stuff
by reference. For things which are referenced by name, also encode
the object's address in the GtkSelectionData so having a brush
called "Standard" or a named buffer called "Global Buffer" will
work together with DND.
* app/widgets/gimpdnd.[ch]: s/tool/tool_info/g. Renamed
gimp_dnd_get_data_data() to gimp_dnd_get_object_data() since it's
not limited to GimpData objects. Follow above selection data API
changes. Cleanup.
* libgimp/gimpbrushmenu.c
* libgimp/gimpdrawablecombobox.c
* libgimp/gimpfontselectbutton.c
* libgimp/gimpgradientmenu.c
* libgimp/gimpimagecombobox.c
* libgimp/gimppalettemenu.c
* libgimp/gimppatternmenu.c: follow GtkSelectionData format change
and check the dropped things' PID against the return value of
gimp_getpid().
2005-06-04 Sven Neumann <sven@gimp.org>
* app/widgets/gimpdnd.c (gimp_dnd_get_viewable_icon): use the
viewable's description in the drag icon. Use a larger preview.
* app/widgets/gimpdockbook.c: tweak spacing and border-width of
the tab widget if it is being used as drag icon.
2005-06-04 Sven Neumann <sven@gimp.org>
* app/widgets/gimpdnd.c (gimp_dnd_get_viewable_icon): reduced the
number of characters to show before ellipsizing the label.
* libgimpwidgets/gimpcolorarea.c: added a "draw-border" property.
* app/widgets/gimpcolorframe.c: draw a border around the color area.
2005-05-29 Sven Neumann <sven@gimp.org>
* app/widgets/gimpdnd.c (gimp_dnd_get_color_icon): pass
GIMP_COLOR_AREA_CHECKS_SMALL instead of TRUE for the type of the
GimpColorArea.
* app/widgets/gimpcoloreditor.c: added a "context" property.
* libgimpwidgets/gimpcolorarea.c (gimp_color_area_set_color):
always use gimp_rgba_distance(), regardless of the area's type.
2005-05-25 Michael Natterer <mitch@gimp.org>
* app/core/gimpviewable.[ch]: added virtual function
GimpViewable::get_size() and public API gimp_viewable_get_size()
which return width and height and a boolean indicating if the
viewable has a size at all.
Added default implementation of GimpViewable::get_popup_size()
using the new get_size() API.
* app/core/gimpbrush.c
* app/core/gimpbuffer.c
* app/core/gimpdrawable.c
* app/core/gimpimage.c
* app/core/gimppattern.c: implement GimpViewable::get_size().
* app/core/gimpbrush.c
* app/core/gimppattern.c: removed GimpViewable::get_popup_size()
implementations, the default one is good enough.
* app/core/gimpbrushpipe.c (gimp_brush_pipe_get_popup_size):
redirect to gimp_viewable_get_size() instead of duplicating its
return values.
* app/widgets/gimpcontainertreeview.c
* app/widgets/gimpview.c: allow pixbuf dragging out of any
viewable that has a size.
* app/widgets/gimpdrawabletreeview.c: removed pixbuf dragging code
here.
* app/widgets/gimpdnd.c: set gimp busy around encoding/decoding
pixbufs into/from GtkSelectionData, because it can be a time
consuming operation.
2005-04-09 Michael Natterer <mitch@gimp.org>
Implement dragging and dropping in any GdkPixbuf supported
format. Fixes bug #172794 and bug #172795.
* app/core/gimplayer.[ch] (gimp_layer_new_from_region): new
function which contains all stuff that was in
gimp_layer_new_from_tiles().
(gimp_layer_new_from_tiles): use above function.
(gimp_layer_new_from_pixbuf): new function.
* app/widgets/Makefile.am
* app/widgets/gimppixbuf.[ch]: new files containing GdkPixbuf
utility functions for clipboard and DnD.
* app/widgets/gimpselectiondata.[ch]: removed
gimp_selection_data_set,get_pixbuf(), GTK+ provides the same API.
Also removed GdkAtom parameters all over the place because it's
always the same as selection_data->target.
* app/widgets/gimpclipboard.c: use the new pixbuf utility
functions and gtk_selection_data_set,get_pixbuf().
* app/widgets/widgets-enums.h
* app/widgets/gimpdnd.[ch]: removed never-implemented
GIMP_DND_TYPE_PNG and added a generic GIMP_DND_TYPE_PIXBUF
instead. Added API to drag and drop GdkPixbufs which transparently
converts from/to and GdkPixbuf-supported image format. Removed
passing around of GdkAtoms, since they were always the same
as selection_data->target.
* app/widgets/gimpdnd-xds.[ch]: follow GdkAtom parameter removal.
* app/widgets/gimpcontainertreeview.[ch]: added virtual function
GimpContainerTreeView::drop_pixbuf().
* app/widgets/gimpcontainertreeview-dnd.c: dispatch drop_pixbuf().
* app/widgets/gimplayertreeview.c: implement drop_pixbuf().
* app/widgets/gimpdrawabletreeview.c: allow to drag all drawables
as pixbufs.
* app/display/gimpdisplayshell-dnd.c: allow dropping of pixbufs.
2005-03-26 Sven Neumann <sven@gimp.org>
* app/widgets/gimpdnd.c: don't add the same target multiple times.
This used to happen when gimp_dnd_foo_source_add() is called
after calling gimp_dnd_drag_source_set_by_type().
2005-03-25 Sven Neumann <sven@gimp.org>
* app/widgets/gimpview.[ch]: virtualized GimpView::set_viewable.
* app/widgets/gimptoolbox-image-area.c: hook into "set_viewable"
and add an XDS drag source.
* app/widgets/gimpdnd-xds.c
* app/widgets/gimpdnd.c: unset the XdndDirectSave0 property when
the drag ends, minor cleanups.
2005-03-25 Sven Neumann <sven@gimp.org>
* app/widgets/Makefile.am
* app/widgets/gimpdnd-xds.[ch]: new files.
* app/widgets/gimpdnd.[ch]
* app/widgets/widgets-enums.h: added a basic XDS (Direct Save
Protocol) implementation.
* app/widgets/gimpimageview.c: allow to save images by dragging
them from the Images dialog to an XDS capable file manager.
2005-01-15 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpdnd.c: added gimp_dnd_get_component_icon().
* app/widgets/gimpcomponenteditor.c: allow to drag
components. They can't be dropped anywhere yet.
2005-01-15 Michael Natterer <mitch@gimp.org>
* app/widgets/widgets-enums.h (enum GimpDndType): reordered so
COMPONENT is after IMAGE.
* app/widgets/gimpdnd.[ch]
* app/widgets/gimpselectiondata.[ch]: added API for passing
components around via DND. Speaks in terms of a
(GimpImage,GimpChannelType) tuple.
2004-12-31 Michael Natterer <mitch@gimp.org>
Applied modified patch from Ben Campbell which adds drop
coordinates to the color drop callback and uses it to insert
colors in the palette editor. Extended the patch to add drop
coordinates to all drop callbacks.
* app/core/gimppalette.[ch]: added gimp_palette_insert_entry().
* app/display/gimpdisplayshell-dnd.[ch]: added drop coordinates
to all drop callbacks.
* app/dialogs/palette-import-dialog.c
* app/widgets/gimpcolormapeditor.c
* app/widgets/gimpcontainerview.c
* app/widgets/gimpdnd.[ch]
* app/widgets/gimpdrawabletreeview.c
* app/widgets/gimpfgbgeditor.c
* app/widgets/gimpgradienteditor.c
* app/widgets/gimpitemtreeview.c
* app/widgets/gimppaletteeditor.c
* app/widgets/gimppropwidgets.c
* app/widgets/gimpselectioneditor.c
* app/widgets/gimptoolbox-dnd.c
* app/widgets/gimptoolbox-image-area.c
* app/widgets/gimptoolbox-indicator-area.c
* app/widgets/gimptooloptionseditor.c
* libgimpwidgets/gimpcolorselect.c: changed accordingly. The passed
drop coordiantes are so far unused.
* app/widgets/gimppaletteeditor.c: use the drop coordinates to
insert the new color into the palette at the right place instead
of always appending. Fixes bug #150030.
2004-10-06 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpdnd.c (gimp_dnd_data_drag_begin): remember for
which GdkDragContext the icon_widget was made.
(gimp_dnd_data_drag_end): destroy the icon_widget only if it was
created for this GdkDragContext. Fixes broken DND icon_widgets
when dragging the same source again while the old icon_widget is
still floating back from an unsuccessful drop. Fixes bug #139337.
2004-09-16 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpdnd.c (gimp_dnd_uri_list_dest_add): reverse
order of DND dests so "text/uri-list" is preferred again after my
DND change of 2004-06-29. Fixes dropping of multiple files.
2004-06-30 Sven Neumann <sven@gimp.org>
* app/widgets/gimpselectiondata.[ch]: renamed the SVG related
functions so that they deal with an anonymous data stream that
could as well be a PNG image.
* app/widgets/gimpdnd.[ch]
* app/widgets/gimpcontainertreeview-dnd.c: changed accordingly.
* app/display/gimpdisplayshell-dnd.[ch]
* app/vectors/gimpvectors-import.[ch]
* app/widgets/gimpcontainertreeview-dnd.c
* app/widgets/gimpvectorstreeview.c: use gsize for the length of
the buffer.
* app/widgets/gimpdnd.[ch]
* app/widgets/widgets-enums.[ch]: added GIMP_DND_TYPE_PNG which isn't
used yet.
2004-06-30 Michael Natterer <mitch@gimp.org>
* widgets/gimpselectiondata.[ch] (gimp_selection_data_get_svg):
changed return value from gchar* to const gchar*. Renamed
parameters to be consistent with other SVG functions.
* widgets/gimpcontainertreeview-dnd.c
* widgets/gimpdnd.c: changed accordingly.
2004-06-29 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpdnd.c: use gtk_target_list_add() instead of
gtk_target_list_add_table() because the latter prepends the
targets to the internal list which screws the order (== priority)
of DND targets.
* app/widgets/gimpselectiondata.c: added some more checks for
failed drops (selection_data->length < 0).