Commit Graph

164 Commits

Author SHA1 Message Date
Stanislav Grinkov 619cb91230 Remove unnecessary gimpmarshal.h and gimpwidgetsmarshal.h includes. 2021-08-13 18:01:13 +00:00
Niels De Graef 878804fb01 Cleanup GObject signal marshallers
* Don't generate our own marshallers if they are available in GLib
  already
* Don't set the c_marshaller parameter in `g_signal_new()` if it's a
  default marshaller provided by GLib. See commit message of commit
  39e4aa3c57 on why this is the case.
2020-04-01 21:20:01 +00:00
Michael Natterer 7201d48231 Get rid of capitalized "ID" in function and variable names
and use "id" instead.
2019-08-23 22:23:23 +02:00
Ell d5cdcc6c02 app: add gimp_item_get_clip()
Add a new GimpItem::get_clip() virtual function, and a
corresponding gimp_item_get_clip() function, which return the
actual clipping mode to be used when transforming (or applying a
filter to) a given item, given the original clipping mode.  This
applies only to whole-item transformations (i.e., when not creating
a floating selection), and should be used by the top-level code
applying the transformation, rather than by the actual
transformation code, so that the item can be transformed using a
different clipping mode internally.

Provide a default implementation that simply returns the input
clipping mode, and override for GimpChannel (to always return CLIP)
and for GimpVecotrs (to always return ADJUST).
2019-08-09 22:22:50 +03:00
ONO Yoshio 1ff9487d00 Revert "app: make unattached vectors enable to rotate."
This reverts commit 2d415f53bf.
2018-09-06 08:39:51 +09:00
ONO Yoshio 2d415f53bf app: make unattached vectors enable to rotate. 2018-09-03 12:19:59 +09:00
Michael Natterer 5f700549e7 Change the license URL from http://www.gnu.org/licenses/ to https:// 2018-07-11 23:29:46 +02:00
Michael Natterer 7256f18447 app: change offsets parameters of GimpItem::translate() from int to double
so we can use it to precisely position paths; use SIGNED_ROUND() in
channel, layer etc. to snap to pixels.
2018-04-23 01:27:56 +02:00
Ell d9ec9386ce app: allow gimp_stroke_transform() to result in multiple strokes
The next commit is going to perform clipping when transforming
Bezier strokes.  When parts of the stroke get clipped, the result
consists of multiple strokes.

Adapt gimp_stroke_transform() in preparation, to allow for the
transformation to result in multiple strokes, by adding a GQueue*
parameter that receives the transformed strokes.

For convenience, we allow passing NULL as the argument, in which
case the current behavior is maintained.  However, NULL should only
be passed when clipping is known to be unnecessary.

Adapt the rest of the code for the change.

Note that this technically affects public API: existing stroke
object IDs now become invalid after transforming their containing
vectors object.  However, this is unlikely to affect code in
practice.
2018-02-03 05:58:43 -05: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 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 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
Michael Natterer cd20669e09 app: don't leak the GList element in gimp_vectors_real_stroke_remove()
and some general cleanup in the file.
2016-01-27 22:50:56 +01:00
Mukund Sivaraman 4e05c07cd4 app: Copy to dest_vectors correctly 2016-01-25 15:29:46 +05:30
Mukund Sivaraman e14c1a0156 Use GQueue for strokes list 2016-01-25 10:56:15 +05:30
Mukund Sivaraman 992c58fe4f Use an aux hashtable and avoid g_list_find() when searching for a GimpStroke* 2016-01-25 10:25:43 +05:30
Michael Natterer e3ea383580 app, libgimpbase: move enum GimpStrokeMethod to libgimpbase
and rename its values.
2015-11-08 22:48:48 +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 658a7834fe app: remove public function gimp_vectors_bounds()
and move its code into the GimpItem::bounds() implementation.
2015-07-03 19:38:06 +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
Michael Natterer 23037b5230 app: convert all stock IDs kept around by the core by icon names
Particularly GimpViewable's stock_id. Make sure old config files
containing stock IDs are still properly parsed.
2014-05-07 01:01:56 +02:00
Rickard 5ec413a5e8 Bug 729326 - Errors found using a static code analysis program cppcheck
Fixed some memory and file leaks. And removed some code and variables
that are not used.
2014-05-05 10:34:08 +02:00
Mikael Magnusson ad0d43da87 app: remove double return 2013-06-15 22:57:10 +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 Natterer 3ad73b3658 libgimpcolor: add GdkPixbuf <-> GeglBuffer utility functions
and update tons of includes in libgimp and app.
2012-05-03 03:37:20 +02:00
Michael Natterer 2414301799 Review the last few commits and apply some style fanaticism
some completely unrelated,
2012-02-07 20:36:55 +01:00
Massimo Valentini 39368a410d plugged memory leaks 2012-02-07 17:32:02 +01:00
Michael Natterer 8b4870dad7 app: move GimpBezierDesc from app/vectors/ to app/core/ 2011-04-04 18:40:12 +02:00
Michael Natterer fcfb7cf160 Use the new g_[s]list_free_full() instead of foreach() and free() 2011-03-07 17:11:28 +01:00
Michael Natterer fc7bd98d92 app: move all GimpStrokeOptions members to private 2011-03-05 21:00:28 +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 d46b53f63d Bug 635040 - Edit -> Stroke Path performs no action on an incomplete path
Add error reporting to gimp_drawable_stroke_vectors() and produce the
same warning as the paint core when trying to stroke a path with zero
or one points only.
2010-11-25 11:31:40 +01:00
Michael Natterer 6b8141d548 app: wrap GimpBezierDesc in a boxed type to make property handling easier 2010-10-08 18:52:28 +02:00
Michael Natterer 2a965a8a78 app: argh, don't include the .c file 2010-10-06 22:49:53 +02:00
Michael Natterer a16fc33c43 app: add new() copy() and free() API around GimpBezierDesc
and use it instead of manually (de)allocating. Will also be used in a
new canvas path item.
2010-10-06 22:37:07 +02:00
Michael Natterer 428e9b908b app: more cleanup, move more variables to local scopes 2010-09-17 23:15:16 +02:00
Sven Neumann ec2be9b415 app: cache bounding box of GimpVectors object
Cache the bounding box of the GimpVectors similar to the bezier
representation.
2010-09-17 21:31:55 +02:00
Michael Natterer 97912b481e app: move variables to local scopes in gimp_vectors_bounds() 2010-09-17 16:09:30 +02:00
Sven Neumann 31fb4c9559 app: use GSlice for GimpBezierDesc 2010-09-16 23:27:25 +02:00
Sven Neumann 5abae32923 app: cache bezier representation in GimpVectors object
Introduce gimp_vectors_get_bezier() which creates the bezier
representation on demand and then caches it for subsequent calls
until the vectors object is frozen.

At some point we should introduce GimpVectors::changed instead
of relying on the fact that a vectors object is always frozen
and thawn whenever it is changed...
2010-09-16 21:36:51 +02:00
Sven Neumann 9c8736a56f app: formatting 2010-09-11 23:02:15 +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
Michael Natterer e23e99e2ab app: add missing translation context for undo descriptions 2010-07-08 18:10:33 +02:00
Michael Natterer 314a6ab926 app: merge the layer, channel and vectors repositioning APIs
into an API based on GimpItem.
2010-07-08 18:08:13 +02:00
Michael Natterer e0224cdbfb Add get_parent() API for items, layers, channels and vectors
this is pretty pointless from an abstraction point of view, but using
these functions will make the code a lot more readable by getting rid
of tons of ugly casts to and from GimpViewable whenever getting an
item's parent.
2010-02-07 12:03:07 +01:00
Michael Natterer 804e692c86 Add some item tree infrastructure that will be needed later
- add gimp_image_get_layer_tree(), channel_tree() and vectors_tree()
- change GimpItem::get_container() to GimpItem::get_tree()
- implement gimp_item_get_container() using gimp_item_get_tree()
2010-02-06 16:17:23 +01:00
Michael Natterer 88de69464e Move "layers", "channels" and "vectors" to GimpImagePrivate 2010-02-03 23:00:31 +01:00
Martin Nordholts c380512ce1 Revert "app: Add gimp_vectors_get_stroke()"
This reverts commit 2d2b6f03c5 and
adapts the code. We can use gimp_vectors_stroke_get_next (vectors,
NULL) instead of gimp_vectors_get_stroke (vectors, 0). Thanks to nomis
for pointing this out.
2010-01-02 20:20:10 +01:00
Martin Nordholts 2d2b6f03c5 app: Add gimp_vectors_get_stroke() 2010-01-02 18:55:44 +01:00