Commit Graph

22559 Commits

Author SHA1 Message Date
Ell c98edaf101 app: behave as if "show all" is disabled in GimpCanvasPassePartout when keeping padding 2019-09-15 16:39:03 +03:00
Ell f418ac3e2d app: behave as if "show all" is disabled in GimpCanvasGrid when keeping padding 2019-09-15 16:39:03 +03:00
Ell c9fc2862f8 app: behave as if "show all" is disabled in the navigation dockable when keeping padding 2019-09-15 16:39:03 +03:00
Ell 3cef5b52ac app: behave as if "show all" is disabled in edit/buffers/DnD actions when keeping padding 2019-09-15 16:39:03 +03:00
Ell 2d6e80b8ed app: behave as if "show all" is disabled in scroll/zoom actions when keeping padding 2019-09-15 16:39:00 +03:00
Ell 235a20b65e app: add option to keep canvas padding in "show all" mode
Add an option to keep the normal canvas padding in "show all" mode,
instead of extending the checkerboard pattern indefinitely.  This
is useful when wanting to show the image content beyond the canvas,
while still keeping the focus on the canvas; further commits will
extend this mode to behave in more view-related cases as if "show
all" wasn't enabled.

Add a new 'View -> Padding Color -> Keep Padding in "Show All"
Mode" toggle, which controls this behavior, with a corresponding
default-value option in the preferences, under "Image Windows ->
Appearance".
2019-09-15 16:32:38 +03:00
Michael Natterer 8cdab31393 app, libgimpconfig: move gimp_param_spec_duplicate() to libgimpconfig 2019-09-14 17:35:32 +02:00
Michael Natterer f73f813e1f app: gimp_param_spec_duplicate(): don't warn
about unsupported GParamSpecs, simply return NULL and move the warning
to the only caller instead.
2019-09-14 12:23:13 +02:00
Michael Natterer 3f84fbee1e app: don't use the deprecated GTimeVal in file-remote.c
Use g_get_monotonic_time() instead.
2019-09-14 12:22:04 +02:00
Michael Natterer 81ff4941a0 libgimpmodule: clean up GimpModule and GimpModuleDB
- make all struct members private
- add accessors
- rename functions
- remove unused API
2019-09-13 13:11:23 +02:00
Ell 4fc345183b app, meson.build: fix a bunch of warnings in C++ files 2019-09-12 20:04:50 +03:00
Michael Natterer 7fa730b1c7 app: make tests build again after file_open_image() signature change 2019-09-12 00:05:17 +02:00
Michael Natterer 83a936b8fe pdb: rename all functions in the "plug_in" group
from gimp_plugin_foo() to gimp_plug_in_foo() for consistency.
2019-09-11 23:58:47 +02:00
Michael Natterer 6de4af4ade pdb: change paths and URIs in the "plug_in" group to GFiles 2019-09-11 23:54:53 +02:00
Michael Natterer 2fa9b8f030 pdb: forgot to change an URI to GFile in gimp_file_load() 2019-09-11 22:48:32 +02:00
Michael Natterer 77731d1e8e pdb: change the URIs in the color profile API to GFiles 2019-09-11 22:44:17 +02:00
Michael Natterer 14af676b51 pdb, libgimp: change "filename" to "file" in gimp_pdb_dump() 2019-09-11 22:37:40 +02:00
Michael Natterer 6468fa06c7 pdb, plug-ins: change gimp_temp_name() to gimp_temp_file() 2019-09-11 22:32:44 +02:00
Michael Natterer 6bca8c4f89 pdb, app, libgimp, plug-ins: replace most PDB filenames/URIs by GFile
and in an attack of madness, changes almost all file plug-in
code to use GFile instead of filenames, which means passing
the GFile down to the bottom and get its filename at the very
end where it's actually needed.
2019-09-11 21:48:34 +02:00
Michael Natterer a5ac3e45fe libgimpbase, libgimp, app: add libgimp support for passing GFiles
Which means support for GParamSpecObject with value_type ==
G_TYPE_FILE, and converting between GFile and its URI for wire
communication directly above the protocol layer.

This change requires passing a GParamSpec's value type as generic
member of GPParamDef, which in turn makes some members of its
sub-structures obsolete.
2019-09-11 21:40:17 +02:00
Ell d710e96d81 Issue #3781 - Display artifacts on HiDPI when render cache is invalidated
In GimpDisplayShell, scale the render cache by the window's scale
factor, and render its content in device pixels, instead of scaled
application pixels.  When painting the cache to the screen, unscale
the cairo context by the same factor, so that it's painted in the
native resolution.  Note that the various
gimp_display_shell_render_foo() functions still speak in
application pixels, and the scaling happens internally in
gimp_display_shell_render().

Aside from rendering at native resolution on HiDPI, this also fixes
an issue where grid-like display artifacts would appear when the
render cache was not fully validated due to the non-native scaling.
2019-09-11 21:19:26 +03:00
Salamandar c20a8b732c Enforce libbacktrace tests. Add missing dep in app 2019-09-11 18:02:15 +00:00
lillolollo a2b74147c9 Fixing error on Windors meson build 2019-09-11 17:21:17 +00:00
Félix Piédallu ba6973e791 Fix Meson some changes not pulled from Autotools 2019-09-11 17:10:47 +02:00
Félix Piédallu 65eff6f150 Meson port. 2019-09-11 16:42:04 +02:00
Michael Natterer f3fb3d1a57 Remove the second "raw-filename"/"raw-uri" parameter from file procedures
It's an ancient concept from ancient times when we didn't have URIs
and only filenames (not to speak of GFile), and actually even from
before the ancient time before that ancient time when we first had
ones and zeros, and only had zeros.
2019-09-11 00:21:03 +02:00
Michael Natterer 6115d34fe8 Rename the "fileops" PDB group to just "file" 2019-09-10 21:38:11 +02:00
Michael Natterer 7c5cb29ca6 pdb: move the file procedure register API from "fileops" to "pdb"
because it has nothing to do with the other procedures in fileops and
only sets properties on procedures.
2019-09-10 21:24:09 +02:00
Michael Natterer fee551810b app: fix adding file procedures from pluginrc
gimp_plug_in_manager_add_to_db() used to call the PDB in order
to properly register file procedures from pluginrc. This broke
when I moved code to gimpplugin-file.c.

Instead, add gimp_plug_in_manager_add_load_procedure() and
gimp_plug_in_manager_add_save_procedure() and call them from both
gimpplugin-file.c and gimp_plug_in_manager_add_to_db(), which also has
the nice side effect that more GimpFileProcedureGroup logic gets moved
to its place in gimppluginmanager-file.c and less magic is needed in
gimpplugin-file.c.
2019-09-10 21:19:00 +02:00
Michael Natterer 56fee73441 pdb: reorder stuff in the "pdb" group to make more sense 2019-09-10 20:23:19 +02:00
Michael Natterer 21ff9999e4 app: remove gimppluginmanager-file-procedure.[ch]
and merge it into app/plug-in/gimppluginmanager-file.c, it's used from
nowhere else.
2019-09-10 20:20:40 +02:00
Michael Natterer ff9b469808 app: move the file procedure registering functions into gimpplugin-proc.c
They are simply setting properties on GimpPlugInProcedures, just like
the other functions in gimpplugin-proc.[ch], so there is no reason to
have them elsewhere and with worse checks and error messages.
2019-09-10 20:05:27 +02:00
Ell 1b3c1fb9cb app: fix CRITICAL in GimpNavigationEditor
... after commit 2c9a8a567b.  Don't
use the same function as a handler for GimpContext::display-changed
and GimpContext::image-changed -- their signatures are different.
2019-09-10 17:55:58 +03:00
Jehan b73519830e app: gimp-register-magic-load-handler renamed in a previous commit.
Cf. commit 0745043ddb.
2019-09-10 15:03:28 +02:00
Ell 2c9a8a567b app: clear navigation editor when last image is closed
In GimpNavigationEditor, make sure to clear the editor's shell when
the last image is closed, even though the corresponding display is
stil alive, so that we don't needlessly extend the lifetime of the
image.  This is necessary after the recent GimpImageViewable
changes, since the editor now (indirectly) holds a reference on the
image.
2019-09-10 15:15:42 +03:00
Michael Natterer 0745043ddb pdb, libgimp: remove _gimp_register_load_handler()
and rename _gimp_register_magic_load_handler() to
_gimp_register_load_handler().
2019-09-10 12:29:17 +02:00
Michael Natterer b1683ce692 app: remove all check for the <Load> and <Save> menu prefixes
they are an ancient concept not supported any longer.
2019-09-10 12:14:57 +02:00
Félix Piédallu 46f706a403 [libgimp,app] add missing includes for windows 2019-09-09 18:15:13 +00:00
Sabri Ünal a60ac57207 Missing mnemonics on several file dialogs
This path corrects missing mnemonics on several save/open/export dialogs.

save: file
open: file, dds, fits, tiff
export: bmp, dds, fli, gbr, gih, mng, pat, pnm, pdf, raw, sunras, sgi, webp
2019-09-09 18:06:29 +00:00
Michael Natterer a88aa27942 app: use GError in all gimpplugin-proc.[ch] functions, not gimp_message() 2019-09-09 12:10:32 +02:00
Michael Natterer bde70bcdab pdb: avoid duplicate argument names in gimp-plugins-query
Also rename all arguments to make more sense.
2019-09-09 01:51:33 +02:00
Michael Natterer 41fa670434 Rename all "nparams" and "nreturn_vals" members in the wire protocol
to "n_params" and "n_return_vals".
2019-09-09 01:00:54 +02:00
Michael Natterer 64572b00f5 app: clean up gimp_plug_in_handle_proc_install()
Remove the hack that turns the first integer argument into
enum GimpRunMode and simplify the UTF-8 validation code.
2019-09-09 00:42:24 +02:00
Michael Natterer 22a780c9d1 pdb: add gimp_pdb_set_proc_documentation() and _attribution()
and all the needed code in libgimp/ and app/ to set them on a
procedure using the new API. Remove the strings from GPProcInstall.
2019-09-09 00:36:24 +02:00
Michael Natterer 5f60f5422b app: remove some procedure code duplication
Move the mnemonic and ellipsis removal code to
gimp_procedure_real_get_label() and cache the generated label in
GimpProcedure. Remove the same code from GimpPlugInProcedure and
GimpGeglProcedure.
2019-09-09 00:05:13 +02:00
Michael Natterer 5341c42852 app: remove "help_id" from GimpGeglProcedure
GimpProcedure handles it just right now.
2019-09-08 23:44:13 +02:00
Michael Natterer 6b0486174d app, pdb: split GimpProcedure's "strings" into "help" and "attribution" 2019-09-08 23:40:34 +02:00
Michael Natterer 26c8286675 app, pdb: take "deprecated" out of GimpProcedure's "strings" API
and add gimp_procedure_set_deprecated().
2019-09-08 23:23:32 +02:00
Michael Natterer 1716666bd1 app: keep the help_id in GimpProcedure not GimpPlugInProcedure 2019-09-08 22:25:26 +02:00
Michael Natterer f6dc18a516 app: remove code duplication in gimpplugin-proc.c
and get rid of a redundant sanity check.
2019-09-08 22:23:28 +02:00
Michael Natterer 453b4f4aa2 pdb: add gimp_pdb_set_proc_menu_label()
and all the needed code in libgimp/ and app/ to set a plug-in
procedure's menu label using the new API. Remove the menu label from
GPProcInstall.
2019-09-08 17:30:54 +02:00
Michael Natterer 2a62287439 pdb: add gimp_pdb_set_proc_image_types()
and all the needed code in libgimp/ and app/ to set a plug-in
procedure's image types using the new API. Remove the image types from
GPProcInstall.
2019-09-08 16:54:08 +02:00
Michael Natterer d75a25c565 app: move the plug-in procedure setters to gimpplugin-proc.[ch]
because there are going to be much more more.
2019-09-08 16:38:31 +02:00
Michael Natterer 303ccbedad pdb: move gimp_plugin_icon_register_invoker() from "plugin" to "pdb"
and call it gimp_pdb_set_proc_icon(). Change icon registration code in
libgimp/ and app/ so it's now possible to register icons for temporary
procedures.
2019-09-08 16:22:32 +02:00
Michael Natterer d89adebff8 pdb: move gimp_plugin_menu_register() from the "plugin" to the "pdb" group
and call it gimp_pdb_add_proc_menu_path(). Move around and rename some
code in app/ to prepare for more procedure setters to work this way.
2019-09-08 15:53:37 +02:00
Michael Natterer e82c80bf5f pdb: rename all procedure query procedures to gimp-pdb-get-proc-foo 2019-09-08 15:07:24 +02:00
Michael Natterer 388776df07 Simplify the plug-in query API and fix plugin-browser
- remove the menu path and image types from "gimp-plugins-query",
  they are available via GimpProcedure, also reorder and rename
  its remaining return values to make sense
- remove the "menu_path" parameter to gimp_proc_view_new(),
  it can also ask GimpProcedure
- adapt plugin-browser to the new API and make it use GimpProcedure
- fix plugin-browser's tree view to show all menu hierarchies
  completely, it was still expecting menu paths that contain
  the menu label too
2019-09-08 14:59:09 +02:00
Michael Natterer 48692e58c3 pdb: add pdb API to get a procedure's image types, menu label and menu paths 2019-09-07 21:08:13 +02:00
Michael Natterer a85ad31da0 app: change gimp_plug_in_procedure_add_menu_path() again
to use the real type names in error messages, they are now the actual
API.
2019-09-07 21:05:58 +02:00
Michael Natterer dbacef4fe2 plug-ins: revert temp hack in gimp_plug_in_procedure_add_menu_path()
run-mode is now always a proper enum, don't tell the user that
it can also be an integer.
2019-09-07 20:03:35 +02:00
Michael Natterer a63779e5a8 app: remove obsolete check from gimp_plug_in_menu_register()
Plug-ins can't set a full menu path at procedure installation time any
longer, no need to check and warn about it here.
2019-09-07 20:02:01 +02:00
Ell 62a6023b27 pdb: add gimp-image-merge-layer-group procedure
Oddly, we didn't have this one yet :P
2019-09-07 10:33:43 +03:00
Ell 184762cd81 app: fix empty mask when duplicating a group layer
In gimp_group_layer_mask_changed(), avoid recalculating the group's
bounding box if it hasn't been calculated yet, since, not only is
this unnecessary in this case, but it causes the group's mask to
be erroneously clipped upon duplication, when set by
gimp_layer_duplicate() while the group is still empty.
2019-09-07 10:27:16 +03:00
Massimo Valentini 44cc7d239e Issue 3100: cage transform tool -> always blurred without any action
Makes sure the tool doesn't offset everything by 0.5 pixels.
2019-09-07 01:23:54 +02:00
Ell 19c693a937 app: add "show all" support to the Perspective Clone tool
... by adapting GimpPerspectiveClone to handle buffers with
arbitrary extents.  Note that the tool doesn't seem to work well in
"sample merged" mode to begin with, but this is unrelated.
2019-09-06 20:10:31 +03:00
Ell c5bf595fe6 app: add "show all" support to the Clone tool
... by using gimp_paint_core_get_image_pickable() in
GimpSourceCore, and adapting it to handle source buffers with
arbitrary extents.
2019-09-06 20:10:31 +03:00
Ell 84656cb3d4 app: add "show all" support to the Smudge tool
... by using gimp_paint_core_get_image_pickable() in GimpSmude.
2019-09-06 20:10:30 +03:00
Ell 2523808e4a app: add gimp_paint_core_{set_show_all,get_image_pickable}()
GimpPaintCore operates indipendently of a display, and hence needs
to be explictly told when operating in "show all" mode, affecting
the result of paint tools operating in "sample merged" mode.  Add
gimp_paint_core_set_show_all() for that purpose, and call it,
passing the current display's "show all" mode, in GimpPaintTool.
This controls which pickable (the image itself, or its projection)
is used as the sampling source, as per
GimpPaintCore::saved_proj_buffer, and as returned by the new
gimp_paint_core_get_image_pickable() function.
2019-09-06 20:10:30 +03:00
Sabri Ünal 7486028ec9 Missing mnemonics on Preferences 2019-09-06 14:24:24 +00:00
Elle Stone 7880711fef Allow full range to Hue-Saturation Lightness slider
Issue #427: Hue-saturation dialog: lightness in 'Master'

For whatever reason that made sense at the time, the current
Hue-Saturation code divides the result of Lightness slider
adjustments by 2, which means the user can't ever move the
Lightness slider to produce a solid white or black image, and
requires multiple iterations if the user wants to make the image
very light or very dark.

This patch just removes the division by 2, thus allowing the full
range of Lightness changes without having to use multiple
iterations.
2019-09-06 10:31:54 +02:00
Michael Natterer b6b8e2c28d Revert the *enums.c part of the last commit
- it was changing generated files
- no dialog-specific mnemonics on generic enum labels
2019-09-06 01:39:36 +02:00
Sabri Ünal 2e766f67d4 Missing mnemonics on several dialogs
paste as brush, paste as pattern, select to new brush, select to new pattern
fill selection outline, fill path, stroke selection, distort, rounded rectangle
indexed color conversion, merge visible layers, new guide, new guide (by percent)
image properties, newsprint, fractal explorer, sample colorize, new layer

metadata editor (just a button), spyroplus (only common buttons)
2019-09-05 22:41:19 +03:00
Michael Natterer bfe4a2f9dd app, libgimp: add _gimp_gp_params_free() to gimpgpparams
which frees exactly what _gimp_value_array_to_gp_params() has
allocated, honors its "full_copy" parameter, and plugs the last
libgimp refactoring leaks I'm currently aware of.
2019-09-05 20:59:57 +02:00
Michael Natterer 8acff481a3 app: add missing procedure argument types to pluginrc
GP_PARAM_DEF_TYPE_ID_ARRAY and GP_PARAM_DEF_TYPE_PARAM_DEF.
2019-09-05 20:29:07 +02:00
Michael Natterer 0f7f322fa5 libgimp: _gimp_gp_params_to_value_array() remove "gboolean full_copy"
With all the GValue and GimpValueArray copying involved, we can't
really make a shallow copy anyway, so don't let the API pretend we
could.
2019-09-05 20:17:22 +02:00
Ell 17f8cff6f6 app: add "show all" support to the bucket-fill tool in "fill similar colors" mode
In the bucket-fill tool, allow using the tool outside the canvas
bounds with "sample merged" active in "fill similar colors" mode,
when the current display is in "show all" mode.  Additionally,
ignore "sample merged" in "fill whole selection" mode, on which it
has no effect.
2019-09-05 18:04:12 +03:00
Ell 99759a57e8 app: in gimp_pickable_contiguous_region_by_seed(), add support for arbitrary buffer extents 2019-09-05 18:04:11 +03:00
Ell 6df0be91ba app: in gimp_gegl_mask_bounds(), add support for arbitrary buffer extents 2019-09-05 18:04:11 +03:00
Ell ddbff867a1 app: fix gimp_gegl_mask_bounds() 2019-09-05 18:04:10 +03:00
Michael Natterer ee86e5630e libgimp: don't leak the GPParam array after writing procedure return values
Annotate all calls to g_free(GPParam*) with /* FIXME leaking object arrays */
because we now do, and it needs to be fixed.
2019-09-05 16:24:09 +02:00
Michael Natterer b812d6241a app, libgimp: make two functions of gimpgpparams private
and remove a "gimp" parameter that is no longer needed.
2019-09-05 16:07:15 +02:00
Michael Natterer f764fd0f82 pdb, libgimp: change all generated ID array return values to object arrays
and remove the manual libgimp wrappers which now have the same
signature as the generated functions.
2019-09-05 13:01:00 +02:00
Ell 582930aa61 app: update image-projection priority rect when switching displays
Update the image-projection priority rect to the current display's
viewport when the display becomes active, so that the right region
is rendered first when switching between different displays of the
same image.
2019-09-05 13:55:56 +03:00
Ell 43e91d632e app: make "show canvas boundary" insensitive when "show all" is disabled
... since the canvas boundary is only shown in "show all" mode.
2019-09-05 13:19:52 +03:00
Ell 19817877a5 app: various fixes in gimp_display_shell_set_show_all() 2019-09-05 13:19:51 +03:00
Ell aab9f0ee10 app: fix a few compilation warnings 2019-09-04 20:51:43 +03:00
Ell b7674faef8 app: fix transform-tool preview/bounds in show-all mode when transforming entire image
In the transform tools, when transforming the entire image in show-
all mode, don't crop the preview and the transform bounds to the
size of the canvas.
2019-09-04 20:51:43 +03:00
Ell 32dd8d2d2e app: add support for show-all mode in GimpCanvasPassePartout
Don't clip the outer rect to the size of the canvas in show-all
mode.
2019-09-04 20:51:43 +03:00
Ell 1e621680f1 app: add support for show-all mode in GimpCanvasGrid
Don't crop the grid to the canvas size in show-all mode.
2019-09-04 20:51:43 +03:00
Ell 23617c943b app: add gimp_canvas_item_untransform_viewport()
... which untransforms the viewport from display space to the
item's coordinate space (i.e., scaled and translated image space).
2019-09-04 20:51:43 +03:00
Ell cf3638391d app: add support for color picking in "show all" mode
Add a show_all parameter to gimp_image_pick_color(), which, when
TRUE, allows picking colors outside the canvas bounds in sample-
merged mode.  Forward the display's "show all" mode through this
parameter where applicable (in particular, in the color-picker tool
and the pointer dockable).
2019-09-04 20:51:43 +03:00
Ell 02943e22f6 app: fix gimp_projection_get_pixel_at() for general bounding boxes 2019-09-04 20:51:43 +03:00
Ell da701ffc3a app: fix out-of-bounds rendering when alpha channel is invisible
When the image's alpha channel is invisible, paint regions outside
the image contents as black, instead of using a checkboard pattern.
This is especially notable when viewing the image in "show all"
mode.
2019-09-04 20:51:43 +03:00
Ell 915bdffb5a app: in GimpEditSelectionTool, freeze moved items' previews
... to avoid unnecessarily updating their previews while dragging,
and, in particular, to avoid updating the image's GimpImageViewable
size in show-all mode.
2019-09-04 20:51:43 +03:00
Ell a33f549896 app: show full image contents in GimpNavigationEditor
In GimpNavigation{Editor,View}, show the full image contents when
the corresponding display is in "show all" mode.  Additionally,
when the display's "show canvas boundary" is active, show the
canvas boundary in the navigation view as well.
2019-09-04 20:51:43 +03:00
Ell f90da765b5 app: handle GimpImageViewable in GimpViewRendererImage
Allow using a GimpImageViewable as the source for a
GimpViewRenderer, by allowing GimpViewRendererImage to handle this
type of viewables.
2019-09-04 20:51:43 +03:00
Ell bce4d32d75 app: add GimpImageViewable class
Add a new GimpImageViewable class, which acts as a proxy viewable
for an image.  Unlike the image itself, whose preview is always
restricted to the size of the canvas, a GimpImageViewable provides
a show-all property, which controls whether the preview includes
the full image contents.  We're going to use GimpImageViewable as
the source viewable for GimpNavigationView.
2019-09-04 20:51:41 +03:00
Ell a64dc8d618 app: defer GimpViewable::size-changed signal emission while frozen
In GimpViewable, defer emission of the size-changed signal while
the viewable's preview is frozen, and only emit the signal once
thawed.
2019-09-04 20:47:25 +03:00
Ell e2f31852fb app, menus: add "show canvas boundary" display option
Add a "show canvas boundary" display option, and a corresponding
"View" menu item and default-apperance preferences option.  When
enabled (the default), the canvas boundary is shown as an orange/
black dashed line in "show all" mode.
2019-09-04 20:47:25 +03:00
Ell a1717a90a9 app: improve display scroll/zoom-related behavior in "show all" mode
In "show all" mode, the image is thought to be "infinite"; this
commit improves the overall scrolling/zooming behavior in this mode
according to this assumption.  In cases where a specific image size
is needed (e.g., for the scrollbar bounds, fit-image-in-window,
etc.), the image's full bounding box is used; however, in cases
where a center point is needed (e.g., for the zoomed-out scrollbar
bounds, center-image-in-window), the canvas center, rather than the
bounding-box center, is still used.
2019-09-04 20:47:25 +03:00
Ell 788b136bbf app: add "clip" parameter to gimp_display_shell_untransform_viewport()
... which specifies whether to clip the viewport to the canvas
(previously, it would always be clipped).  Use the appropriate
value in all callers, depending on the shell's "show all" mode.  In
particular, this commit avoids clipping the image projection's
priority rect to the canvas in "show all" mode.
2019-09-04 20:47:25 +03:00
Ell 86dc451bce app, menus: add "show all" mode to GimpDisplayShell; "View -> Show All" toggle
Add a "show all" mode to GimpDisplayShell, controlled through a
corresponding "View -> Show All" menu item.  When enabled, the
entire image content is displayed, instead of cropping the image
to the canvas size.  More generally, the display behaves as if the
canvas were infinite.  The following commits improve the overall
behavior in this mode.

Add a prefernces option to control the default "show all" state.
2019-09-04 20:47:21 +03:00
Ell a9d0643992 app: in preferences dialog, add "show sample points" toggle
... to the default-appearance options.  It was previously missing.
2019-09-04 19:19:42 +03:00
Ell 4e8fa88705 app: in preferences dialog, swap position of default-appearance columns
... to match their menu order.
2019-09-04 19:19:41 +03:00
Ell 697ab6a91a app: in GimpImage, ignore "show all" when image used as pickable
In GimpImage, make sure the image's pickable interface keeps
behaving as before (i.e., restricted to the canvas size), even when
the image is in "show all" mode.  In contrast, the image's
projection, when used as a pickable, *is* affected by "show all".
2019-09-04 19:16:42 +03:00
Ell 1f9d0d275c app: add gimp_image_invalidate_all()
... which invalidates the entire image.  This replaces all calls to
gimp_image_invalidate() with the full canvas size, since the image
content can now be larger than the canvas.
2019-09-04 19:16:42 +03:00
Ell 7f629a630c app: add "show all" mode to GimpImage
Add a "show all" mode to GimpImage, which, when active, causes the
image projection's bounding box to be adjusted dynamically to the
combined bounding box of all layers and the canvas.  This mode is
controlled through the new gimp_image_{inc,dec}_show_all()
functions, which should be called by the display; a corresponding
display toggle will be added in the following commits.

Note that from the user's perspective, "show all" is a display
mode, rather than an image mode.  The GimpImage "show all" mode is
therefore merely an implementation detail, and shouldn't have any
effect on displays that don't use "show all" mode, or the PDB.
The ability to use the image with or without taking its "show all"
mode into account will be facilitated by the next commits.
2019-09-04 19:16:41 +03:00
Ell bcf2b937d9 app: notify GimpProjection::buffer when freeing the projection's buffer
... instead of only when subsequently reallocating it, so that
listeners can respond to the buffer being freed.
2019-09-04 19:16:41 +03:00
Ell 49bbf13911 app: in GimpProjection, avoid invalidating preview on flush while rendering
In GimpProjection, avoid erroneously invalidating the projectable's
preview when flushing the projection and there's nothing to be
flushed, if the chunk renderer is still running, and hence the
projection is not fully rendered yet.
2019-09-04 19:16:40 +03:00
Ell 564afeda8b app: in gimp_gegl_buffer_set_extent(), clear full OOB region
In gimp_gegl_buffer_set_extent(), clear the full now-out-of-bounds
region of the buffer, instead of only full out-of-bounds tiles;
however, we still make sure to clear full tiles, instead of partial
tiles, as much as possible.  This prevents (parts of) the old
content of the buffer from showing when it's enlarged again.  This
is especially relevant for the image projection, once we add
support for a dynamically-expanding canvas in the following
commits, since the projection of a reexpanded buffer can be
temporarily rendered to the display before it's fully
reconstructed, exposing parts of the old content.
2019-09-04 19:16:40 +03:00
Michael Natterer 7019eaa56b app, libgimp: share the code of libgimp/gimpparamspecs.c with app/
move the code to gimpparamspecs-body.c and include it from both app/
and libgimp/. They are the same apart from a minor difference which we

Also share the entire libgimp/gimpparamspecs.h header with the core.
2019-09-04 16:48:26 +02:00
Michael Natterer b92dd2c8e3 app: split GimpDisplay in two classes: GimpDisplay and GimpDisplayImpl
GimpDisplay contains only the ID logic and the "gimp" and "config"
pointers, and lives in the core.

GimpDisplayImpl is a subclass and contains all the actual display
stuff. The subclass is only an implementation detail and doesn't
appear in any API.

Remove all hacks which pass displays as gpointer, GObject or
GimpObject through the core, or even lookup its type by name,
just use GimpDisplay.
2019-09-04 14:30:43 +02:00
Michael Natterer b3b3d8160c app, libgimp: don't duplicate _gimp_gp_param_def_to_param_spec()
they are virtually the same now (except GimpParamEnum, but that one is
still the same because its special feature doesn't go over the wire).
2019-09-04 10:41:19 +02:00
Michael Natterer feaf96735f pdb: don't return any strings from _gimp_pdb_proc_info()
and instead add _gimp_pdb_proc_documentation() and
_gimp_pdb_proc_attribution().

Remove the gimp_pdb_proc_info() utility function in app/.
2019-09-04 01:38:31 +02:00
Michael Natterer a351ce9126 Remove the entire old plug-in interface 2019-09-04 00:03:12 +02:00
Jehan 1c0fb800e5 app, pdb: fix gimp_item_id_is_vectors().
It was testing for GimpDrawable!
2019-09-02 11:44:36 +02:00
Michael Natterer d7f76fbba0 app: better error messages when killing a plug-in for invalid tile access 2019-08-31 16:44:10 +02:00
Michael Natterer 8a78203aed Properly prefix the values of enum GimpPDBProcType
to be GIMP_PDB_PROC_TYPE_PLUGIN, _EXTENSION etc.
2019-08-30 12:52:28 +02:00
Michael Natterer 967cbb4fad app: use the GParamSpec's name in gimp_pdb_dump()
and remove gimp_pdb_compat_arg_type_from_gtype(). The core is now free
of PDB legacy code.
2019-08-30 11:43:53 +02:00
Michael Natterer 392f00baf5 app, libgimp: get rid of all ID GTypes and ID param specs
Turn all ID param specs into object param specs (e.g. GimpParamImageID
becomes GimpParamImage) and convert between IDs and objects in
gimpgpparams.c directly above the the wire protocol, so all of app/,
libgimp/ and plug-ins/ can deal directly with objects down to the
lowest level and not care about IDs.

Use the actual object param specs for procedure arguments and return
values again instead of a plain g_param_spec_object() and bring back
the none_ok parameter.

This implies changing the PDB type checking functions to work on pure
integers instead of IDs (one can't check whether object creation is
possible if performing that check requires the object to already
exist).

For example gimp_foo_is_valid() becomes gimp_foo_id_is_valid() and is
not involved in automatic object creation magic at the protocol
level. Added wrappers which still say gimp_foo_is_valid() and take the
respective objects.

Adapted all code, and it all becomes nicer and less convoluted, even
the generated PDB wrappers in app/ and libgimp/.
2019-08-29 11:39:34 +02:00
Michael Natterer 8eb099a24c plug-ins, app: port selection-to-path to GimpPlugIn and libgmp objects
Remove the separate "advanced" procedure. With GParamSpec default
values the differance between normal and advanced is just
non-interactive vs. interactive.
2019-08-28 03:15:08 +02:00
Jehan 6391b2bcff Issue #3263: fix critical error on bucket fill tool.
Fixes the error:
> Critical error: gimp_line_art_thaw: assertion 'line_art->priv->frozen'

This may happen in cases when we didn't actually freeze the line art at
pointer click, because we were in an invalid case (for instance,
clicking out of selection), hence we must not thaw the line art either
at button release.
2019-08-27 12:41:49 +02:00
Jehan 24af759483 pdb: update a bunch of docs where s/-1/%NULL/
Also add a none_ok on gimp_text_fontname() outarg since it is clearly
noted as being able to return no layer with invalid parameters.
2019-08-25 12:01:41 +02:00
Michael Natterer 773586f0c4 libgimp: make gimpgpparams-body.c identical for app/ and libgimp/ again
Use direct GType comparisons where possible, special case layer
because it has core subclasses but only one PDB type, special case
display because it's not visible from app/plug-in/, make code for
GPParamDef and GPParam look the same.
2019-08-23 23:31:19 +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
Øyvind Kolås fe3e945154 configure,app: depend on babl-0.1.72 2019-08-22 23:15:43 +02:00
Jehan 4db8cda24e app, pdb, libgimp: add a new GimpImage class for plug-ins.
This means that all functions which were returning or taking as
parameter an image id (as gint32) are now taking a GimpImage object
instead.
The PDB is still passing around an id only over the wire. But we create
an object for plug-ins to work on.

This is quite a huge API break, but is probably the best bet for the
future quality. It will make nicer API instrospection (and nicer API in
binding), will fix the issues with pspec on GimpImageID in Python
bindings (which makes the current Python API unusable as soon as we need
to work on images, which is most of our plug-ins!), etc.
Also it will allow to use signals on images, which will be a great asset
when we will finally have bi-directionnal communications (i.e. plug-ins
would be able to connect to image changes, destructions, and whatnot).
2019-08-22 15:54:36 +02:00
Michael Natterer 0f273a5959 app, libgimp: also UTF-8-validate all elements of PDB string arrays 2019-08-20 01:46:56 +02:00
Michael Natterer fab806089a app, libgimp: UTF-8 validate all string arguments and return values
The only way for a plug-in to prevent this is now using
GIMP_PARAM_NO_VALIDATE.
2019-08-19 13:11:02 +02:00
Michael Natterer d62e75a41f Move GimpParamSpecString from libgimp back to app
It's just too weird to be public. Remove its properties from the wire
protocol and from pluginrc. Instead, have all GParamSpecs' flags on
the wire and in pluginrc, so we can use stuff like
GIMP_PARAM_NO_VALIDATE.

Port the remaining few places to GIMP_PROC_ARG_STRING().

I'm sure something is broken now wrt UTF-8 validation,
will add tighter checks in the next commit.
2019-08-19 12:54:52 +02:00
Michael Natterer de121374ef Change the "handles uri" flag of file procedures to "handle remote"
And always pass URIs to all file procedures, the ones what didn't
register as "handles remove" will only ever get local file:// URIs.

Change all file plug-ins (also legacy ones) to expect URIs instead
of filenames, and convert to local paths in the plug-in.

The wire protocol should now be almost 100% clean of non-UTF-8 strings.
2019-08-19 12:05:12 +02:00
Michael Natterer 11ce199cea app: stop canonicalizing procedure names
on behalf of plug-in authors who have no style or can't type.

Instead, simply reject non-canonical procedure names and remove all
code that keeps aroud the original non-canonical shit just to pass it
back to the plug-in.
2019-08-18 01:55:47 +02:00
Jehan 9e9e6f0e9a app: fix a warning. 2019-08-17 10:53:29 +02:00
Niels De Graef 284ba5c870 libgimpconfig: Prevent GIR conflicts in GimpConfigWriter
GimpConfigWriter contains several constructors with the convention
`gimp_config_writer_new_* ()`. This will lead to problems however with
languages like Vala, where it cannot disambiguate the following:

```
// calls config_writer_new_string()
Gimp.ConfigWriter w = new ConfigWriter.string("xxx");
// calls config_writer_string()
w.string("xxx")
```

Using `from_` in constructors is general practice in GObject-bsed
libraries because of this.

This also fixes an error when trying to use vapigen on the GIMP .GIR
file.
2019-08-16 10:04:39 +00:00
Michael Natterer 449e84c108 pdb: use guint for tatoo, guide, sample point, which they are
and initialize GimpUnit with PIXEL instead of just 0.
2019-08-15 16:41:39 +02:00
Michael Natterer 0e1f7457b9 app: s/INT32/INT/ in error messages when installing plug-in procedures 2019-08-15 15:13:27 +02:00
Michael Natterer 4fa08458e8 pdb: remove int16 from the PDB types and rename int8 to uchar 2019-08-15 15:11:18 +02:00
Michael Natterer 652fd75891 Rename GIMP_TYPE_INT8_ARRAY to GIMP_TYPE_UINT8_ARRAY
and GimpParamSpecInt8Array to GimpParamSpecUInt8Array
2019-08-15 15:04:34 +02:00
Michael Natterer 350abba213 Remove GIMP_TYPE_INT16 and GimpParamSpecInt16
Use gint and GParamSpecInt with the right value range instead.
2019-08-15 14:17:17 +02:00
Michael Natterer 5a09523214 Remove GIMP_TYPE_INT32 and GimpParamSpecInt32
Use gint and GParamSpecInt instead.
2019-08-15 14:04:56 +02:00
Michael Natterer 1bf90ec77f Remove GIMP_TYPE_INT8 and GimpParamSpecInt8
Use guchar and GParamSpecUChar instead.
2019-08-15 13:34:11 +02:00
Michael Natterer b007269729 Use g_strlcpy() instead of strncpy() everywhere
except where I didn't understand the code after 10 seconds of
looking..
2019-08-14 23:52:38 +02:00
luz.paz 7e99aa59f5 Add other misc. typo fixes 2019-08-13 11:50:51 -04:00
Ell 1577174739 app: update projection-buffer extent when projectable size changes
In GimpProjection, when the projectable's size changes, while its
offset remains the same, simply update the projection buffer's
extent, instead of allocating a new buffer and copying the contents
over.
2019-08-13 17:44:11 +03:00
Ell b4ee9ff055 app: add gimp_tile_handler_validate_buffer_set_extent()
... which sets the extent of a buffer with an assigned
GimpTileHandlerValidate, clipping the dirty region to the new
extent.
2019-08-13 17:44:10 +03:00
Ell 90610ac87e app: add gimp_gegl_buffer_set_extent()
.... as a drop-in replacement for gegl_buffer_set_extent(), which,
in addition to setting the buffer's extent, clears any now-out-of-
bounds tiles, to free memory.
2019-08-13 17:44:10 +03:00
Michael Natterer 5c30acd5de app: gimp_procedure_get_arguments(), _return_values(): use defaults
instead of simply initializing the values to their GTypes. Plug-ins
are too smart now to get away with whatever default values...
2019-08-13 13:33:25 +02:00
Michael Natterer 298f38434b app: fix writing of GP_PARAM_DEF_TYPE_FLOAT and _STRING in pluginrc
Must not use several g_ascii_dtostr() on the same buffer in one
printf().
2019-08-13 10:52:05 +02:00
Michael Natterer 8222d3ffad pdb: don't pass nodes with parents to gimp_drawable_apply_operation() 2019-08-12 19:41:48 +02:00
Michael Natterer dcb6a2c064 app: re-use the generated gimp_enums_init() code from libgimp
In gimp_init(), call gimp_enums_init(). We need to make all enum types
known to the type system by name because the PDB is now based on enum
type names.
2019-08-12 19:26:08 +02:00