Commit Graph

407 Commits

Author SHA1 Message Date
Ell c83f0e88af app: add virtual transform/type-conversion functions to GimpLayer
The GimpLayer implementation of the GimpItem transform functions,
and the GimpDrawable convert_type() function, apply their operation
to both the layer and its mask.  The subclasses of GimpLayer --
GimpGroupLayer and GimpTextLayer -- override some of these
functions, providing their own logic for the layer part, and
duplicating the mask part.

Avoid this duplication by adding a set of virtual transform and
type-conversion functions to GimpLayer.  Have the GimpLayer
implementaion of the corresponding GimpItem and GimpDrawable
functions use these functions to apply the operation to the layer,
while taking care of the mask themselves.  Have GimpLayer's
subclasses override the new virtual functions, instead of the
GimpItem and GimpDrawable ones.

Note that the existing implementation of convert_type() in
GimpTextLayer neglected to convert the mask, hence text layer masks
retained their old format after conversion.  This issue is fixed as
a side effect of this commit.
2017-06-17 13:42:41 -04:00
Ell 3ca48a0b30 enums: don't use comments in generated enum recipes
Works in bash, but apparently not portable.
2017-06-02 11:15:43 -04:00
Ell 5bcde32caf enums: run gimp-mkenums from the build dir
Commit 1e6acbd4e1 modified the
generated enum recipes to run gimp-mkenums from the source
directory, instead of the build directory, so that only the
basenames of the corresponding header files would appear in
the comment at the top of the generated files.  This was a
mistake -- $(GIMP_MKENUMS) is expecting to be invoked from the
build directory.

Switch back to running gimp-mkenums from the build directory.  To
avoid including the relative path from the build directory to the
source directory in the generated file, add a @basename@ production
variable to gimp-mkenums, which exapnds to the basename of the
input file, and use it instead of @filename@ in the recipes for the
generated enum files.
2017-05-22 20:29:18 -04:00
Ell f9fa0d1b18 enums: don't write generated enum files to src-dir if unchanged
When regenerating an enum file, don't copy it back to the source
directory if it hasn't actually changed.  This allows using a read-
only source directory where the enum header is newer than the
generated file, as long as they're not really out of sync.

OTOH, *do* touch the generated source-dir file even when unchanged,
in order to avoid re-running its recipe on the next build, however,
allow this to silently fail (which is harmless).
2017-05-22 17:58:04 -04:00
Ell 1e6acbd4e1 enums: generate enum files in source dir
We check them into git, so this makes it easier to keep them in
sync when using a separate build directory.

Case in point -- this commit also syncs a few enum files that went
out-of-sync with their headers.
2017-05-06 17:26:16 -04:00
Michael Natterer 3cd717120c app: set the complete layer mode in gimp_text_layer_from_layer() 2017-02-22 00:59:23 +01:00
Michael Natterer 1415a78fa1 Bug 774383 - Text layer created by gimp-text-fontname doesn't...
...respect border when resized

gimp_text_layout_new(): in FIXED box mode, subtract (2 * border) when
setting the layout width.
2016-11-15 13:23:00 +01:00
Michael Natterer 87d38194d7 app, pdb: use GeglDitherMethod instead of simply an integer 2016-11-07 20:41:39 +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
Michael Natterer ecf4af88b8 app: add "gboolean new_has_alpha" to gimp_drawable_convert_type()
making its external API "complete". Remove the redundant
"new_base_type" and "new_precision" from the internal (vfunc) API (the
Babl format has the same information).
2016-10-04 01:39:15 +02:00
Michael Natterer 7f3090febb app: gimp_fonts_exit() don't disconnect from a NULL gimp->config 2016-09-13 12:24:15 +02:00
Michael Natterer 314027f0c9 app: create members of the Gimp instance earlier
Move fonts, data factories, document list, paint methods and user
context creation to gimp_init() or gimp_constructed() so that most
members are created when gimp_new() is done. This does not load any
data earlier, it just makes sure that all containers exist when
gimp_load_config() is called. It's also cleaner and less fragile,
2016-09-13 09:47:27 +02:00
Jehan 6c674e973c app, libgimp*, plug-ins, icons: revert icon names into freedesktop...
... standard icon names and GTK+ icon names as second choice.
We should only use GIMP specific icon names as last resort, when there
is no standard or GTK+ names dedicated to the function.
This is made possible thanks to commit 3cc77b0.

s/gimp-document-recent/document-open-recent/
s/gimp-indent/format-indent-more/
s/gimp-next/go-next/
s/gimp-previous/go-previous/
s/gimp-save/document-save/
s/gimp-save-as/document-save-as/
s/gimp-revert/document-revert/
s/gimp-open/document-open/
s/gimp-document-recent/document-open-recent/
s/gimp-quit/window-close/ ou s/gimp-quit/application-exit/
s/gimp-warning/dialog-warning/
s/gimp-edit-clear/edit-clear/

s/gimp-justify-.*/gtk-justify-.*/
s/gimp-font/gtk-select-font/
s/gimp-color-palette/gtk-select-color/
s/gimp-cancel/gtk-cancel/
2016-09-03 15:49:29 +02:00
Massimo Valentini 4eef125153 Bug 766706: Deleting text layer content does not clean canvas 2016-06-27 16:48:14 +02:00
klausstaedtler 210a834f4c icons: Bug 759904
patch
gimpfont.c
2016-06-10 13:50:44 +02:00
Michael Natterer 8379f7e31d Bug 766988 - Colors applied to images are not color managed
Color manage text layer rendering.
2016-05-29 19:59:41 +02:00
Michael Natterer 2ef8719cbe app: rename more stuff from "floating sel" to "floating selection" 2016-05-20 16:46:26 +02:00
Michael Natterer ef4ab94a12 app: change GimpDrawable::convert_type() to take a target profile
instead of just a boolean "convert_profile". This takes the logic to
figure the right target profile out of gimp_layer_convert_type(), it
can't possibly know everything about how to convert anyway, and having
the logic in the callers conveniently splits it up and distributes its
parts to the places they belong.

This commit should cause no behavor change and is just preparation for
fixing bug 765176.
2016-04-30 18:35:52 +02:00
Ell 76adffa943 app: clear cond and mutex after usage 2016-04-19 17:43:55 +02:00
Michael Natterer 29f55a95ef app, pdb: minor cleanup in the new font loading code 2016-04-17 21:06:00 +01:00
Kristian Rietveld 30b73125f8 Bug 449848 - Startup: initialize fontconfig in the background ...
... to avoid long pause on start

On non-Linux operating systems the fontconfig cache is often not
initialized by default. The first time GIMP was launched, this led
to a non-responding application, confusing many users.

The initialization of fontconfig has now been moved to a separate
thread. The main thread will wait for this fontconfig thread to
complete, regularly pulsing the UI.

This patch was partly based on an earlier patch by Tor Lillqvist.
2016-04-17 17:27:06 +01:00
Michael Natterer e5b6806fe2 app: port tons of files to the new GIMP_CONFIG_PROP_FOO() macros
and remove lots of labels from calls to gimp_prop_foo_new(). Also
had to manually remove some unwanted labels that are now added
automatically, fixes bug #761880.
2016-02-11 23:46:24 +01:00
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 ac1c6d7864 app: add progress reporting to gimp_drawable_convert_type()
so it doesn't sit there appearing to do nothing while converting an
image with profile to gamma/linear.
2015-10-21 22:22:30 +02: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
Jehan 6f81975bda Bug 751836: font alias "sans" deprecated in fontconfig…
…to be replaced by "sans-serif".
2015-07-12 14:07:04 +02:00
Massimo Valentini f0028624df Bug 751178: GIMP doesn't load fonts from folders...
which path contains Cyrillic characters
2015-06-22 19:40:25 +02:00
Øyvind Kolås 7e6320497e follow gegl api changes from commit af5361ca8d, with an abyss policy argument
to gegl_buffer_copy.
2015-05-25 01:27:31 +02:00
Simon Budig a102690145 remove unnecessary if()
Spotted by Andrey Karpov using static code analysis:
   http://www.viva64.com/en/b/0273/
2014-08-16 00:37:14 +02:00
Simon Budig 40c06ab685 fix some copy&paste errors
Spotted by Andrey Karpov using static code analysis:
   http://www.viva64.com/en/b/0273/
2014-08-16 00:37:13 +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 9751d04b47 app: more filename -> GFile in gimp-fonts.c 2014-07-29 14:40:25 +02:00
Michael Natterer 583be797a1 app: use gimp_config_path_expand_to_files() for the font path 2014-07-24 21:23: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
Mukund Sivaraman e0015fa67a app: Update coding style (minor) 2014-05-03 19:59:00 +05:30
Mukund Sivaraman 33acc4b62b app: Use HarfBuzz directly instead of deprecated Pango functions
I have verified manually that the previews ("Aa") shown for English and
Tamil are correct (i.e., the modified function works).
2014-05-03 00:27:47 +05:30
Mukund Sivaraman 81e955ed1b build: Add HarfBuzz dependency 2014-05-03 00:27:47 +05:30
Michael Natterer 7257574b93 Bug 726495 - "Text to path" delivers a path offset from the text
In gimp_text_layout_render() do a cairo_save/restore() around drawing
the (possibly offset and transformed) text, so we can later get the
rendered path from cairo_copy_path() relative to the original coords
and not relative to the offset and transformed coords.
2014-04-11 16:56:29 +02:00
Michael Natterer 6c73f28b6d Bug 719560 - Build failure with freetype 2.5.1
Apply patch from su-v that fixes the freetype include to
the madness devised and recommended by freetype.
2013-11-29 21:57:46 +01:00
Jehan 2aabbbd9c7 Bug 662787 - Segfaults when trying to set a large text size
If a font size is too big for cairo or pango to deal with, nicely back
up from rendering and alert the user via an error dialog.
2013-10-24 20:23:51 +13: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
Jehan c7aa623a55 app: clean out a big bunch of leading tabs.
For some unknown reason, most calls to gimp_message_literal() were
indented with tabs.
2013-09-15 04:59:20 +12: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
Nils Philippsen 1c00c2e4f8 app: fix re-initializing fontconfig in gimp_fonts_reset()
Calling FcConfigSetCurrent() with NULL is just broken, it almost
immediately dereferences the passed pointer. Apparently this line
is executed seldom, otherwise we'd see way more crashes in this place.
Just use FcInitReinitialize() which exists for the very purpose of
reinitializing the fontconfig library.
2013-02-05 13:54:36 +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 a7223bbd2d Bug 352823 - Changing image mode discards text layer information
For conversions that have no dither options (like RGB -> GRAY or u8 ->
u16), always preserve text editability, for conversions that have
dither options (like RGB -> INDEXED or u16 -> u8), give the user the
choice whether to enable dithering.
2012-11-10 18:56:44 +01:00
Massimo Valentini b25f9abedf Bug 676413: Text to Path cuts off without covering the whole layer
Use an unbounded cairo_recording_surface to extract a
cairo_path_t from a pango_layout.
2012-10-30 18:07:08 +01:00
Michael Natterer 373a4e7469 app: completely remove TileManager and friends (base/ and paint-funcs/)
And along with it a lot of stuff like the drawable preview cache, the
gegl tile manager backend, temporary gimp_gegl_buffer_foo() stuff, and
the remaining bits of performance.

The projection is in an evil semi-ported state which makes it work
ok-ish for stuff like layer moving, but absolutely unbearable for
painting, there is also an off-by-one rendering glitch at some zoom
levels.
2012-06-20 21:44:09 +02:00
Simon Budig 1bbf9ca440 do not crash on fonts with 000 permissions. 2012-06-06 01:16:02 +02:00