Commit Graph

414 Commits

Author SHA1 Message Date
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
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
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
Clayton Walker 76bdbf6d8f app: I actually tested it this time 2013-06-23 13:39:18 +02:00
Clayton Walker fb1d220a3f app: fix previous commit 2013-06-23 13:24:45 +02:00
Clayton Walker 03f559923b app: properly initialize more variables
Found by Coverity
2013-06-23 13:10:44 +02:00
Mikael Magnusson 0091645129 app: remove pointless NULL checks 2013-06-16 01:31:13 +02:00
Mikael Magnusson ad0d43da87 app: remove double return 2013-06-15 22:57:10 +02:00
Simon Budig 4852e59ec1 remove some disabled nonfunctional code with german comments. 2013-06-15 22:17:48 +02:00
Michael Natterer ec786816bb */Makefile.am: merge INCLUDES into AM_CPPFLAGS
automake-1.13 finally warns about this anachronism.
2013-06-05 20:48:37 +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
Ville Skyttä 6b0d1038cc Bug 692641 - Various spelling fixes 2013-01-27 18:59:02 +01:00