Commit Graph

187 Commits

Author SHA1 Message Date
Hartmut Kuhse 66bc98d299 Revert "New GimpMetadata as subclass of GExiv2Metadata"
This reverts commit 3ab08c8bfd.
2017-01-03 19:36:22 +01:00
Hartmut Kuhse 3ab08c8bfd New GimpMetadata as subclass of GExiv2Metadata 2017-01-03 19:26:35 +01:00
Michael Natterer 82a2754540 Bug 343090 - Most brushes and all patterns appear renameable but aren't
Introduce virtual function GimpViewable::is_name_editable() and class
member "gboolean name_editable" for the default value. Default to
FALSE and only return TRUE if the name can actually be edited by the
user.

When attemting an edit, check the new API and beep instead of starting
the edit.
2016-11-16 15:13:08 +01:00
Michael Natterer 3c7fbe93b3 app: make gimp_item_mask_bounds() and _intersect() honor a suspended selection
and remove the same check from the stroke and fill code.
2016-11-04 22:28:59 +01:00
Michael Natterer 31fcd79dd9 Bug 769738 - Add color tags/labels for layers/channels/paths
Add property "color-tag" of type enum GimpColorTag to GimpItem so all
layers, channels and paths can be tagged with a color.

For interoperability, use the color list from Krita which is a
superset of Photoshop's colors.

Features a "Color Tag" submenu in the layers, channels and paths
menus, a row of color radio buttons in the properties dialogs,
undo and PDB API.

As a side effect, some common code is now factores out into
items-actions.[ch] and items-commands.[ch] which adds visible, linked
and lock actions for layers and channels.
2016-10-29 17:02:16 +02:00
Michael Natterer 997ae1e28b Bug 764024 - Allow to choose fill color when resizing layers and images
Add a GimpFillType argument to GimpItem::resize() and fill type
widgets to the canvas and layer resize dialogs. Fill the new parts of
the drawable according to fill type in gimp_drawable_resize(). Make
sure places that need the old behavior get GIMP_FILL_TRANSPARENT
passed by hardcoding it in the GimpItem::resize() implemetations of
channel, mask, selection etc.
2016-10-10 00:02:16 +02:00
Michael Natterer d5ffc50c2e app: rename w, h to width, height in gimp_item_mask_bounds() 2016-09-16 23:57:24 +02:00
Michael Natterer 28e1a379e6 app: remove const qualifiers from all object parameters
They are unreliable because every type checking cast discards them,
they are useless anyway, visual clutter, added inconsistently, and
generally suck. Wanted to do this a long time ago, it was a bad idea
in the first place.
2016-05-19 23:54:14 +02:00
Michael Natterer 39909b6008 app: replace GimpList's internal GList with a GQueue
so we can easily iterate in reverse order, and access the last element
in O(1). Nothing makes use of this yet.
2016-05-01 15:22:44 +02:00
Michael Natterer 7ae81e70b9 app: move the "visible" property from GimpItem to GimpFilter
Same for the "visibility_changed" signal. GimpItem keeps its
visibility API because it adds undo over GimpItem's API.
2016-05-01 14:27:43 +02:00
Michael Natterer ff1c678058 app: add GimpItem::fill() which fills what is outlined by ::stroke()
For selections, it's different from gimp_edit_fill() because it
ignores the selection while filling, just as stroking does. Currently
unused, stay tuned...
2016-03-14 19:02:18 +01:00
Jehan e12a520c99 Revert "app: item uniquefy algorithm allowing generic numbering schemes."
This reverts commit 56b6dbaa87.
It has been discussed and decided that the no-hash numbering scheme
would have unwanted side-effects for people using number-ending layer
names for other purposes than incrementation.
This revert has been modified to keep commit c402f10.
2015-11-19 19:12:58 +01:00
Michael Natterer 76782e622d app: add "gboolean convert_profile" to GimpDrawable::convert_type()
also add "GType old_type" to GimpItem::convert() so implementations
can do things depending on the type of the original item.

In gimp_layer_convert(), if the original item is also a layer, and
color management is not off (with a FIXME because this is the wrong
check), pass convert_profile = TRUE to gimp_drawable_convert_type().

There is no color profile conversion anywhere behind this, this is
just an API change commit.
2015-08-16 15:56:28 +02:00
Michael Natterer e90e90265b app: port everything from gimp_channel_bounds() to gimp_item_bounds()
except gimpchannel.c itself.
2015-07-03 19:38:08 +02:00
Michael Natterer 4edf70f4f1 app: add virtual function GimpItem::bounds()
Which returns a boolean indicating if there is content at all, and the
bounds as double x, y, width, height because for most use cases that's
better than x1, y1, x2, y2. Wrap the method with two functions
gimp_item_bounds() which returns integer bounds and
gimp_item_bounds_f() which returns the original double bounds.
2015-07-03 19:38:06 +02:00
Jehan 56b6dbaa87 app: item uniquefy algorithm allowing generic numbering schemes.
Any item ending with numbers (optionally followed by spaces) would
trigger incremental counting, not only hashed numbers.
2015-06-16 20:12:24 +02:00
Michael Natterer 60f23afde2 app: add a small infrastructure to validate known parasites
when they are added to items, images or globally, from the PDF or an
XCF file. None of the validation functions does anything currently,
they simply return TRUE.
2014-03-22 00:18:48 +01:00
Michael Natterer 4d6640ff79 Bug 721249 - pdb.gimp_context_set_brush_size() dont't work
Port selection/path stroking to using the PDB-controllable
paint options that live in GimpPDBContext.

Change gimp_item_stroke()'s "use_default_values" boolean which was
introduced at a time where we had no better way by a GimpPaintOptions
parameter. If a non-NULL paint_options is passed (when called from the
PDB), use it for stroking; if NULL is passed, use the actual paint
tool options from the GUI (when called from the menus or the stroke
dialog). In the PDB wrappers, get the right paint options object from
the PDB context associated with the calling plug-in.
2014-02-06 23:26:53 +01:00
Michael Natterer 697572ccc0 app,libgimp*: fix includes to follow our include policy
- 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
2013-10-15 01:58:39 +02:00
Michael Natterer 3b68ae0f3c app, pdb, libgimp: Remove all traces of the supersampling recursion level
from all transform APIs. This is no longer used since we use GEGL to
transform, the value was only passed around and never used.
2013-05-31 01:15:32 +02:00
Michael Muré 7e962d36e2 app: add a quick doc for gimp_item_mask_intersect() 2013-05-18 01:26:13 +02:00
Michael Natterer 45a6ea432c app: add new class GimpFilter as parent class of GimpItem
and move the item's GeglNode API there. The purpose of this is to
factor out "gimp object that manages a node".
2013-04-11 12:25:10 +02:00
Michael Natterer f84ed04ee5 app: actually remove the node in gimp_item_remove_offset_node()
The function is currently unused, so nobody noticed.
2013-04-11 12:25:10 +02:00
Téo Mazars d1cd90c170 Bug 674622 - Misalignment in scaling layers of different sizes
Again bad use of ROUND() on signed values...
2013-02-13 19:59:58 +01:00
Michael Natterer 908f727f0a Chain up unconditionally in GObject::constructed()
It's supported since GLib 2.28.
2012-11-12 21:51:22 +01:00
Michael Natterer d4933b3052 Bug 674160 - Redesign of "Lock panel"
Apply and heavily modify patch from remyDev which adds "lock position"
to GimpItem, similar to "lock content". Lock position disables all
sorts of translation and transform, from the GUI and the PDB.

Cleaned up some aspects of the lock content code as well because a
second instance of similar code always shows what went wrong the first
time.
2012-11-09 11:17:25 +01:00
Mikael Magnusson f6f22ed431 Remove stray semicolons 2012-08-20 15:22:20 +02:00
Michael Natterer c73bcac2d0 app: create the offset node in GimpLayer, and manage its offset in GimpItem 2012-05-15 22:25:12 +02:00
Michael Natterer d995fefb7c app: add gimp_item_is_visible()
which returns TRUE if an item is effectively visible (it is visible
and all its parents are visible).
2011-09-23 23:43:42 +02:00
Martin Nordholts 0d529f7956 app: Use GimpIdTable 2011-05-04 22:54:35 +02:00
Michael Natterer 62f2ae80c8 app: move GimpItem's width and height members to private 2011-03-08 18:10:59 +01:00
Michael Natterer 5bd1b318af app: cosmetic cleanup 2011-03-08 17:15:47 +01:00
Michael Natterer 6a08376d49 app: add new virtual function GimpItem::unset_removed()
and implement it in GimpLayer to unset the removed flag on the layer
mask. Remove layer mask special casing from gimp_image_add_layer().
Make sure that all an item's children get their removed flag unset in
gimp_item_unset_removed().
2011-02-02 19:42:29 +01:00
Michael Natterer eacd80446d app: finally get rid of gimp_item_configure() and drawable_configure()
and turn them into gimp_item_new() and gimp_drawable_new()
2011-02-01 12:47:24 +01:00
Michael Natterer 5c8ec234cc app: add "image" as construct property to GimpItem
- The image *must* now be passed to g_object_new() when creating items
- Remove the "image" parameter from all item configure() functions
- Set the item's ID in gimp_item_set_image() if it has none yet
2011-02-01 10:28:10 +01:00
Michael Natterer 12e531f512 app: gimp_item_replace_item(): if the item has an ID, remove it from the item hash 2011-01-31 23:53:59 +01:00
Michael Natterer e893e3130c app: don't leak the item's old parasite list in gimp_item_replace_item() 2011-01-31 23:52:41 +01:00
Michael Natterer ad88eb55a2 app: add accessors for GimpItem::parasites and move it to private 2011-01-31 23:51:18 +01:00
Michael Natterer af160141db app: add gimp_item_unset_removed() and move item->removed to private 2011-01-30 21:57:45 +01:00
Michael Natterer fd655490e8 app: move most of GimpItem's members to a private struct 2011-01-30 21:49:51 +01:00
Michael Natterer 90419e0672 app: add "gboolean push_undo" to gimp_item_parasite_attach/detach()
and use this API instead of manually fiddling with the item's
GimpParasiteList.
2011-01-30 20:40:43 +01:00
Michael Natterer 0428be2944 app: add gimp_item_replace_item() which is a bad hack and documented as such
in order to get rid of fiddling with GimpItem internals inside
gimptextlayer-xcf.c
2011-01-30 19:26:32 +01:00
Michael Natterer e82e40033a app: some cosmetic cleanup in the item's node handling code 2010-12-19 20:39:18 +01:00
Michael Natterer 095ae5cc9b app: move mask_bounds() and mask_intersect() from GimpDrawable to GimpItem
There is nothing drawable-specific in there, and having them on
GimpItem enables some simplifications, esp. in upcoming PDB
wrappers. None of these refactorings is in this commit though.
2010-09-07 21:30:46 +02:00
Michael Natterer 3184c440b3 app: introduce GimpItem::to_selection()
Which replaces all the deparate functions to turn layers, channels,
layer masks and vectors into selections. Use the new virtual function
all over the place instead of calling the functions in
gimpchannel-select.c manually.
2010-07-20 23:09:19 +02:00
Barak Itkin 5930b13084 app: add context to all undo descriptions
Description of undo actions should be marked as action descriptions,
and not as commands. This is required for translation for some
language (like Hebrew) that require a different grammatical tense for
describing actions
2010-06-09 18:50:23 +02:00
Michael Natterer 5f46061830 app: add gimp_item_peek_node() and use it
so we can avoid peeking into the GimpItem struct if we want to get to
the item's node without implicitly creating it if it doesn't already
exist.
2010-02-14 13:55:45 +01:00
Michael Natterer 3514271fde Give unnamed items proper names
Use the item class' default name unstead of "Unnamed" so they
will be called "Layer", "Channel" and "Path".
2010-02-09 22:32:38 +01:00
Michael Natterer 2034a3676c Use gimp_item_tree_rename_item() also when undoing an item rename
so all item renaming goes through GimpItemTree API. Add "push_undo"
parameter to gimp_item_tree_rename_item().
2010-02-07 15:56:53 +01:00
Michael Natterer bcf7603e04 Add gimp_item_tree_rename_item()
and call it from gimp_item_real_rename() if the item is attached to an
image; simply use gimp_object_set_name() otherwise.
2010-02-07 15:39:42 +01:00