Commit Graph

425 Commits

Author SHA1 Message Date
santouits 6e00a19fd0 Don't compile gimpmarshal source file many times
Also, removes gimpmarshal.h from a source file that didn't need it.
2020-09-13 18:13:29 +03:00
Liam Quin be0e63aa1c Issue #4328: Distorted path of an open/imported circle from an svg file.
Undoing the apparent mistake (revert 27e78849a2) and changing the 2nd
occurrence instead.
2020-08-02 22:08:34 +02:00
Simon Budig 44a7e92967 app/vectors: implement stroke_reverse and stroke_shift_start 2020-05-25 12:33:10 +02:00
Jehan bcacf6e2ae app: "active item" concept => "selected items".
After much thought, tests and discussions with Aryeom, we decided adding
back an active item concept additionally to the selected items ones is a
bad idea as it makes only usage unecessarily complex.
We will just have selected layers. Some kind of operations will work
when more than one item (layers, channels, vectors) are selected while
others will require exacty one item.

In particular, let's replace instances of gimp_image_(s|g)et_active_*()
by corresponding gimp_image_(s|g)et_selected_*(). Also replace single
item in various undo classes by GList of items.
Also "active-*-changed" GimpImage signals are no more, fully replaced by
"selected-*s-changed".

This is still work-in-progress.
2020-05-17 18:32:16 +02: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 27e78849a2 Issue #4328 - Distorted path of an open/imported circle...
...from an svg file

gimp_bezier_stroke_new_ellipse(): need to interpolate the path's head
and tail, not its tail and tail. Spotted by Massimo.
2020-03-07 14:47:08 +01:00
Niels De Graef cb0ae619d1 app: Use G_DEFINE_BOXED_TYPE()
This isn't any functional change, but allows us to get rid of some of
the GObject boilerplate.
2019-11-05 10:14:29 +00:00
Félix Piédallu 65eff6f150 Meson port. 2019-09-11 16:42:04 +02: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
Niels De Graef 1dda60154c Use "Returns:" to annotate return values
To be able to annotate return values through GObject-introspection, you
need to make sure it is tagged with `Returns:` and not something else.
2019-08-03 07:53:47 +00:00
Michael Natterer 63695b4b21 libgimbase: merge gimpparam.h into gimpparamspecs.h
which means that it's now included normally via gimpbase.h
and not any longer via gimpbasetypes.h which we only did out
of lazyness. A *lot* of files in libgimp* and app/ now need to
2019-07-31 10:16:21 +02:00
Jehan 613bf7c5ab app, libgimpconfig: make various usage of g_file_replace() safer.
When an error occurs, we want to prevent overwriting any previous
version of the file by incomplete contents. So run
g_output_stream_close() with a cancelled GCancellable to do so.
See also discussion in #2565.
2018-11-26 15:50:38 +01:00
Ell 0a123a81a3 Issue #2553 - Can't Move Imported or Pasted Path
Initialize the X/Y tilt fields of improted/pasted path control
points to 0, instead of 0.5, which is the normal value for these
fields in paths.  This avoids calculating bogus distances when
trying to pick the path, causing picking to fail.
2018-11-23 08:48:36 -05: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
luz.paz 7fdb963e01 Bug 794996 - Misc. typo fixes in comments in app/
Found via `codespell -q 3 --skip="./po*"`
2018-04-08 21:25:56 +02:00
Michael Natterer 539927ebfa app: replace all g_assert() by the newly added gimp_assert()
which is just a #define to g_assert for now, but can now easily be
turned into something that does some nicer debugging using our new
stack trace infrastructure. This commit also reverts all constructed()
functions to use assert again.
2018-02-11 22:23:10 +01:00
Ell dee7dbc399 app: subdivide perspective-transformed Bezier curves
The result of applying a perspective-transform to a Bezier curve is
only an approximation.  When the curve is highly nonlinear, the
result may diverge significantly from the real transformed curve.

Subdivide the curve as necessary in gimp_transform_bezier_coords()
to counter that.  Adjust gimp_bezier_stroke_transform()
accordingly.
2018-02-04 14:45:24 -05:00
Ell 53f7da0408 app: fix a few comments in last commits 2018-02-03 10:15:03 -05:00
Ell 823791164c app: use gimp_transform_bezier_coords() when transforming a GimpBezierStroke
Override GimpStroke::transform() for GimpBezierStroke, using
gimp_transform_bezier_coords() to transform the stroke's segments,
so that clipping done properly.
2018-02-03 05:58:43 -05: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
Ell 275815c808 app: misc cleanup in gimpcoords-interpolate
Fix indentation, typos, style.  Use array parameters for the
control points, instead of using individual by-value parameters.
Use GArray* for the results, instead of GArray**.  Verify
arguments.

Adapt the rest of the code to the changes.
2018-02-03 05:58:42 -05:00
Michael Natterer 0cb3e75f79 app: use a lot of g_clear_object() and g_clear_pointer()
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);
2017-07-15 18:42:44 +02:00
Massimo Valentini 99050ecee6 Bug 769022 - Improve text along path when path is short.
Extend the text along the tangent of the last path stroke.
2016-12-21 22:35:17 +01: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
Richard Kreckel dd9b0fc55b Bug 768044 - Fix many typos
This fixes many typos in comments and one in a user-visible string (msgid
"center abscisse" changed to "center abscissa" in affected po files. too).
2016-06-26 00:35:24 +02:00
Michael Natterer 5080da50e6 app: move the undo impl object typedefs out of the *-types.h files
They are completely private to the undo system and don't need to
be used anywhere else. Removes some clutter from the typed headers.
2016-05-20 18:29:13 +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
Simon Budig b3e4212dfe app/vectors: fix up the anchors types which I messed up with my last change. 2016-02-01 12:37:04 +01:00
Simon Budig 1e47343b04 Bug 735810- performance shrinkage of Paths tool
Apply revised version of Mitchs patch that
changes the anchor list to a GQueue.
2016-01-29 01:00:03 +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 789e9f2cf4 app: remove /*< skip >*/ and /*< pdb-skip >*/ annotations from enums
where their headers are not even parsed by the affected scripts.
2016-01-07 17:44:46 +01:00
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 849481a861 Clean up code around calls to g_file_replace()
- use G_FILE_CREATE_NONE instead of 0
- don't put "Could not open <file> for writing: <error>" around the
  returned error, the returned message is already verbose
2014-10-04 02:44:54 +02:00
Michael Natterer 14978bfe5d Simplify calls to g_output_stream_write_all()
It returns TRUE only if all bytes were written, so there is no need to
get and check the bytes_written return value.
2014-09-07 20:30:14 +02:00
Michael Natterer 980ba7f85a app: move memsize functions into their own files gimp-memsize.[ch] 2014-08-12 13:57:57 +02:00
Michael Natterer 673d666d0c app: port gimp_vectors_export_file() to GIO 2014-07-03 13:29:29 +02:00
Michael Natterer 3687e1b32b app: change filename in gimp_vectors_import_file() to GFile 2014-07-02 14:54:56 +02:00
Michael Natterer 632b64fedf app: change filename in gimp_vectors_export_file() to GFile 2014-07-02 14:47:11 +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