Commit Graph

205 Commits

Author SHA1 Message Date
Jehan fa02a2c64f libgimp: add an exception handler for Windows.
Drmingw already added its own exception handler which generates crash
traces in a text file, for plug-ins as well. This additional handler is
run after Drmingw handler and allows us to do things on our own, and in
particular we could display the content of the debug traces.

Right now it simply prints these to stderr, which actually won't be of
much use on Win32, first because the console is deactivated on stable
releases, also because after tests, it doesn't look like even running
GIMP from cmd outputs to console either.

We currently don't use the same debug dialog as the core on purpose,
because we don't want everyone to send us traces for every unmaintained
third party plug-ins out there. But we should definitely allow easier
trace possibilities at some point, first to improve/debug our own core
plug-ins, and also to help third party plug-in developers!
So this commit is not making visible changes yet but is actually a first
step towards these debugging goals.
2018-04-04 20:25:29 +02:00
Jehan 76bce77d09 libgimp: various warning fixes for Win32. 2018-04-04 06:32:33 +02:00
Jehan 9c8a8ae576 libgimp: do not end the fatal and signal handlers with gimp_quit().
When ending with gimp_quit(), GIMP was not displaying the "Plug-in
crashed" error dialog, which is not good, since we lose the crash
feedback for plug-ins. Just let the plug-in continue its normal run in
order to get the error dialog.
Also protect the tracing functions, which are not working on Win32.
2018-04-04 04:47:43 +02:00
Jehan e98b937643 libgimp: add a gimp_fatal_func() allowing stack tracing plug-ins on...
... various crashes.
2018-04-04 04:33:19 +02:00
Jehan c46211190f libgimp: properly catch SIGABRT signal.
SIGABRT was in the switch list in gimp_plugin_sigfatal_handler(), but it
had not been properly handled with gimp_signal_private(), making this
switch case useless. Fix this oversight, and while doing so, move it in
the "fatal error" list for which we may generate stack traces, similarly
to core signal handling. Indeed this signal can definitely happen during
various kinds of common bugs and needs to be debugged.
2018-04-04 04:08:57 +02:00
Ell 1b1fba199a app, libgimp: don't close parent pipes in libgimp; use gimp_spawn_set_cloexec()
In gimp_plug_in_open(), use gimp_spawn_set_cloexec() to prevent the
parent's end of the read/write pipes from being inherited by the
spawned plug-in, instead of passing the corresponding file
descriptors to the plug-in as command-line arguments, and having
gimp_main() close them.

Adding new command-line arguments to plug-ins is problematic, since
their ability to handle them depends on their protocol version,
which is only communicated after the plug-in is spawned.

Regardless, this is much simpler.
2018-03-06 16:31:17 -05:00
Ell b9e629abbb app, libgimp: use gimp_spawn_async() when spawning plug-ins
In gimp_plug_in_open(), use gimp_spawn_async(), added in the
previous commit, instead of g_spawn_async().  See the previous
commit for the rationale.

Since gimp_spawn_async() doesn't provide a mechanism to perform any
cleanup in the child before exec()ing, move the closing of the
parent's end of the read/write pipes from the app to the plug-in's
gimp_main(), passing the relevant file descriptors to the plug-in
through argv.
2018-03-05 01:55:40 -05:00
Michael Natterer 374fee451c libgimpbase: consistent gimp_stack_trace namespace for stack trace functions
Change the rest of the source accordingly.
2018-02-22 12:35:43 +01:00
Jehan e53d0c742c libgimp: replace gimp_on_error_query() and g_on_error_stack_trace().
Our own implementation is much better.
I don't make it into a GUI yet, but at least the CLI option will use the
new implementation in plug-ins as well, which will be quite useful.
2018-02-09 02:25:58 +01:00
Jehan 2e18c80c58 libgimp: add gimp_get_pdb_status() to return the status of last...
... procedure call.
This is needed for plug-ins which depends on other plug-in's procedures.
If for instance, the second-level plug-in is interrupted interactively,
we don't want to process this as an error but as a cancellation.
Therefore we need to know the returned value of the plug-in. Currently
only way was to use gimp_get_pdb_error() but that was returning a
human-readable error, not a computer-processable error.
2018-01-19 14:19:55 +01:00
Jehan 4c4fa84f85 app, libgimp, libgimpbase: new gimp_export_(exif|xmp|iptc)() functions.
These allows plug-ins to know the preferences regarding metadata.
2018-01-11 22:17:32 +01:00
Jehan 15f7344038 libgimp, libgimpbase: allow multi-threaded plugins by locking...
...protocol calls.
Some calls are waiting for answers, for instance plugin procedures, and
tiles which expects data and acknoledgement.
This would result in error messages such as:
"expected tile ack and received: 5" (5 is GP_PROC_RUN)
Typically because a thread would run a procedure while another would
receive tiles.
2017-08-16 12:09:56 +02:00
Jehan d2ba594ab9 libgimp: minor tab cleaning. 2017-02-01 01:59:45 +01: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
Mukund Sivaraman 6a6604871f windows: Add support for generating crash backtraces using Dr. MingW 2016-01-02 18:55:37 +05:30
Michael Henning 3e0d10d860 win: Group gimp windows together on the taskbar.
The plug-ins and the main window used to be separate.
2015-08-10 22:27:45 -04:00
Michael Natterer 8005eea835 Remove the "GIMP" from all "Since: GIMP 2.x" API doc comments
because it confuses gtk-doc and breaks some links. Also change the
"Index of new symbols in GIMP 2.x" sections to be what seems to be the
modern standard (looked at the GLib and GTK+ docs), and update some
other stuff.
2015-05-31 21:18:09 +02:00
Michael Natterer 5e591eb232 app, libgimp: add log handlers for all LibGimp* log domains
Looks like they were forgotten so messages from libs went to stdout
instead of being routed through the log handlers, which would show
them in a dialog, or in the error console.
2015-05-20 11:05:45 +02:00
Mukund Sivaraman 60197c227d windows: Call SetDLLDirectory() in the app
With this patch, there should be no more need to set PATH on Windows
before running GIMP.

This patch was tested by me and drawoc, but there could be some
undetected issues lurking. Revert if any problems arise.
2015-04-13 15:45:58 +05:30
Jehan b8aabcac5c Do not use g_io_channel_unix_new() for the win32 platforms.
It is advised to use the more accurate g_io_channel_win32_new_fd() or
g_io_channel_win32_new_socket() because GLib can't differentiate between
file descriptors and sockets on Windows, which outputs a warning when
there is ambiguity.
2014-08-12 23:56:10 +00:00
Ed J df8964a1ce Doc NULL return for gimp_display_name() when no GUI. 2014-05-24 17:58:37 +01:00
Ed J d775d4ae99 There only *might* be an error string. 2014-05-03 08:39:52 +01:00
Ed J 9dfc4eb6a2 Document that gimp_run_procedure* on error return a string. 2014-05-03 00:16:29 +01:00
Michael Natterer 48b01cf297 Bug 727343 - gimp_plug_in_handle_tile_get fails for 64-bit depth images
libgimp/gimp.c: forgot to double the shared memory size for 64 bit
images.
2014-04-10 14:09:52 +02:00
Michael Natterer c42cc495bb libgimp: set GeglConfig's application-license to GPL3 here too 2014-02-26 00:12:23 +01:00
Michael Natterer 57da340f78 app, libgimp: pass "use-opencl" to plug-ins
and configure Gegl on the plug-in side accordingly. This bumps
the GIMP protocol version.
2014-02-25 21:25:40 +01:00
Michael Natterer 66ff5dd70b Remove all calls to g_type_init(), it's deprecated
The type system is initialized automatically now.
2013-05-25 22:44:20 +02:00
Michael Natterer 37d4f656d4 Bug 678925 - Debugging plugins with windows
Apply patch from Hartmut Kuhse that enables plug-in debugging on
Windows by stopping the process using Windows API, and providing a
small executable "gimp-plugin-resume.exe" to resume the stopped
plug-in.
2013-02-23 16:25:58 +01:00
Michael Natterer e4f24a539e libgimp: make GIMP_PLUGIN_DEBUG messages always visible again
by adding "LibGimp" to G_MESSAGES_DEBUG so it doesn't get filtered
away by newer GLib.
2013-02-23 16:10:19 +01:00
Michael Natterer ab801970ca Bug 677776 - filter popup windows get hidden behind main image window
Simone found a better way than setting plug-in windows to UTILITY: simply
call the proper API, [NSApp arrangeInFront: nil].
2012-11-12 23:42:15 +01:00
Michael Natterer 0b56aa0d13 Bug 677776 - filter popup windows get hidden behind main image window
On OSX, call [NSApp activateIgnoringOtherApps] when a plug-in dialog
is shown, so the plug-in process becomes the active app, and the
dialog gets focussed.

In order to avoid doing this in GimpDialog (which is also used in
the core), do it in gimp_ui_init() which all interactive plug-ins
call, and when gimp_temp_proc_run() is called interactively, to
catch repeated activation of an already running plug-in.

Also, set GimpDialog's initial position to GTK_WIN_POS_CENTER,
or they will pop up in the top left corner.

Inspired by patches from Simone Karin Lehmann and Daniel Sabo.
2012-11-07 23:44:35 +01:00
Michael Natterer 52c00faad5 Bug 685590 - 16-bit Tiff loader crashes on Windows and Mac both 64-bit
The tile transfer SHM segment is now width*height*16 bytes large,
not only width*height*4. I have no clue how this could work on
32 bit systems.
2012-10-06 14:35:30 +02:00
Michael Natterer 0d481702c7 libgimp*: add GIMP_DEPRECATED macros using G_DEPRECATED
and start using them instead of GIMP_DISABLE_DEPRECATED where possible.
2012-05-03 00:54:21 +02:00
Michael Natterer 9f85f35c07 libgimp: don't recurse infinitely in gimp_parasite_detach()
(cherry picked from commit 5b59af7c2e)
2012-05-03 00:35:55 +02:00
Mukund Sivaraman 921922e95d libgimp: Change comment to point at correct alternate function 2011-12-07 10:31:24 +05:30
Michael Natterer ebbad40885 Doc fixes in both source comments and gtk-doc files 2011-11-25 21:39:55 +01:00
Michael Natterer 3d7e51c52f libgimp: #include "libgimpbase/gimpbase.h" instead of individual files 2011-04-28 13:09:30 +02:00
Michael Natterer bb6436cb44 libgimp: deprecate and rename the global pararasite functions
just as it was done for items and images. Remove the "parasite" PDB
group completely.
2011-03-08 14:31:04 +01:00
Sven Neumann 71ead96472 libgimp: deprecate gimp_min_colors() and gimp_install_cmap()
Also remove calls to gdk_rgb_set_min_colors() and gdk_rgb_set_install()
from gimp_ui_init(). These are considered obsolete nowadays.
2010-10-19 09:59:59 +02:00
Tor Lillqvist fc7831f7a1 Reduce risks on Windows also for plug-ins 2010-09-02 21:28:29 +03:00
Michael Natterer 94737aae8c libgimp: deprecate gimp_[drawable]_attach_new_parasite()
They were unused, and it's silly to have a "convenience" function
to replace three trivial lines of code.
2010-07-09 13:30:31 +02:00
Michael Natterer 2d6f808ff8 pdb: add a new PDB group "item" and move lots of functions to it
The item groups has all the duplicated functionality from drawable
and vectors (name, visible, linked etc).

Hijack the unused GIMP_PDB_REGION and turn it into GIMP_PDB_ITEM;
change all protocol aware files accordingly and bump the protocol
version number. Change script-fu to handle the new type.
2010-07-09 09:34:44 +02:00
Michael Natterer c78e4c8d63 libgimp: move docs from template files to inline comments
Also split up the "tools" docs into separate files so it matches
the new autogenerated PDB section headers.
2010-07-07 11:48:10 +02:00
Michael Natterer d9b5207aa2 Change licence to GPLv3 (and to LGPLv3 for libgimp).
2009-01-17  Michael Natterer  <mitch@gimp.org>

	* all files with a GPL header and all COPYING files:

	Change licence to GPLv3 (and to LGPLv3 for libgimp).

	Cleaned up some copyright headers and regenerated the parsers in
	the ImageMap plugin.


svn path=/trunk/; revision=27913
2009-01-17 22:28:01 +00:00
Michael Natterer b9ec59e455 fix docs: there is no such thing as gimp_query_procedure(), the function
2008-09-19  Michael Natterer  <mitch@gimp.org>

	* libgimp/gimp.[ch] (gimp_destroy_paramdefs): fix docs: there is
	no such thing as gimp_query_procedure(), the function is called
	gimp_procedural_db_proc_info().


svn path=/trunk/; revision=27012
2008-09-19 10:42:32 +00:00
Sven Neumann 1a8859805c app/plug-in/gimppluginprocedure.c minor cleanups.
2008-09-18  Sven Neumann  <sven@gimp.org>

	* app/plug-in/gimppluginprocedure.c
	* libgimp/gimp.c: minor cleanups.


svn path=/trunk/; revision=26999
2008-09-18 16:25:39 +00:00
Sven Neumann 9d56dec5d4 translator comments must not have a line between the comment and the
string

svn path=/trunk/; revision=26606
2008-08-16 18:20:06 +00:00
Sven Neumann d0b0cca94d added translator comments.
2008-08-16  Sven Neumann  <sven@gimp.org>

	* libgimp/gimp.c (gimp_get_pdb_error): added translator 
comments.


svn path=/trunk/; revision=26605
2008-08-16 17:37:26 +00:00
Sven Neumann 2fcef8b03e Next step towards fixing bug #344818:
2008-08-16  Sven Neumann  <sven@gimp.org>

	Next step towards fixing bug #344818:

	* libgimp/gimp.[ch]: keep the last error status and error 
message
	in libgimp. Added new functon gimp_pdb_get_error() that allows 
to
	retrieve it.

	* libgimp/gimp.def: updated.

	* plug-ins/pygimp/gimpmodule.c (pygimp_vectors_import_from_file)
	(pygimp_vectors_import_from_string): use the new function to get
	a more useful error message.


svn path=/trunk/; revision=26602
2008-08-16 17:18:13 +00:00
Sven Neumann 81131c0bb4 Add new PDB data type PDB_COLORARRAY for using arrays of GimpRGB colors as
2008-07-14  Sven Neumann  <sven@gimp.org>

	Add new PDB data type PDB_COLORARRAY for using arrays of GimpRGB
	colors as argument or return value.

	* libgimpbase/gimpbaseenums.[ch] (enum GimpPDBArgType): replaced
	the unused GIMP_PDB_BOUNDARY with GIMP_PDB_COLORARRAY.

	* libgimpbase/gimpprotocol.h: increased GIMP_PROTOCOL_VERSION.
	(struct _GPParam): added d_colorarray entry to the union.

	* libgimpbase/gimpprotocol.c
	* libgimp/gimp.[ch]
	* app/pdb/gimp-pdb-compat.c
	* app/plug-in/plug-in-params.c
	* app/plug-in/gimpplugin-message.c
	* tools/pdbgen/pdb.pl: deal with the new data type.

	* tools/pdbgen/enums.pl: regenerated.

	* plug-ins/pygimp/pygimp-pdb.c
	* plug-ins/script-fu/scheme-wrapper.c: handle the new data type.


svn path=/trunk/; revision=26189
2008-07-14 14:09:16 +00:00