1998-01-25 18:26:47 +08:00
|
|
|
/* LIBGIMP - The GIMP Library
|
|
|
|
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
|
|
|
|
*
|
2000-06-01 20:20:13 +08:00
|
|
|
* gimp.c
|
|
|
|
*
|
2009-01-18 06:28:01 +08:00
|
|
|
* This library is free software: you can redistribute it and/or
|
1999-11-18 05:13:50 +08:00
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
1998-01-25 18:26:47 +08:00
|
|
|
* License as published by the Free Software Foundation; either
|
2009-01-18 06:28:01 +08:00
|
|
|
* version 3 of the License, or (at your option) any later version.
|
1998-01-25 18:26:47 +08:00
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
1999-11-18 05:13:50 +08:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2009-01-18 06:28:01 +08:00
|
|
|
* License along with this library. If not, see
|
2018-07-12 05:27:07 +08:00
|
|
|
* <https://www.gnu.org/licenses/>.
|
1998-01-25 18:26:47 +08:00
|
|
|
*/
|
2000-05-31 07:38:46 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
#include "config.h"
|
|
|
|
|
2006-06-17 00:21:35 +08:00
|
|
|
#define _GNU_SOURCE /* for the sigaction stuff */
|
2006-05-30 09:55:42 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
#include <errno.h>
|
|
|
|
#include <stdarg.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <sys/types.h>
|
2000-05-11 19:51:09 +08:00
|
|
|
|
1999-03-07 20:56:03 +08:00
|
|
|
#ifdef HAVE_SYS_TIME_H
|
1997-11-25 06:05:25 +08:00
|
|
|
#include <sys/time.h>
|
1999-03-07 20:56:03 +08:00
|
|
|
#endif
|
2000-05-11 19:51:09 +08:00
|
|
|
|
1999-03-07 20:56:03 +08:00
|
|
|
#ifdef HAVE_SYS_PARAM_H
|
1997-11-25 06:05:25 +08:00
|
|
|
#include <sys/param.h>
|
1999-03-07 20:56:03 +08:00
|
|
|
#endif
|
2000-05-11 19:51:09 +08:00
|
|
|
|
2000-05-11 05:21:23 +08:00
|
|
|
#ifdef HAVE_SYS_WAIT_H
|
|
|
|
#include <sys/wait.h>
|
|
|
|
#endif
|
2000-05-11 19:51:09 +08:00
|
|
|
|
1999-03-07 20:56:03 +08:00
|
|
|
#ifdef HAVE_UNISTD_H
|
1997-11-25 06:05:25 +08:00
|
|
|
#include <unistd.h>
|
1999-03-07 20:56:03 +08:00
|
|
|
#endif
|
2000-05-11 19:51:09 +08:00
|
|
|
|
|
|
|
#ifndef WAIT_ANY
|
|
|
|
#define WAIT_ANY -1
|
|
|
|
#endif
|
|
|
|
|
2012-11-08 06:44:35 +08:00
|
|
|
#include <gtk/gtk.h> /* need GDK_WINDOWING_FOO defines */
|
2000-05-31 07:38:46 +08:00
|
|
|
|
2000-04-23 03:47:01 +08:00
|
|
|
#ifndef G_OS_WIN32
|
2001-05-21 21:58:46 +08:00
|
|
|
#include "libgimpbase/gimpsignal.h"
|
2015-08-31 21:26:51 +08:00
|
|
|
|
2018-04-04 12:30:36 +08:00
|
|
|
#else
|
|
|
|
|
2015-08-31 21:26:51 +08:00
|
|
|
#ifdef HAVE_EXCHNDL
|
|
|
|
#include <time.h>
|
|
|
|
#include <exchndl.h>
|
|
|
|
#endif
|
|
|
|
|
2000-04-23 03:47:01 +08:00
|
|
|
#include <signal.h>
|
|
|
|
#endif
|
1999-03-07 20:56:03 +08:00
|
|
|
|
2003-12-27 16:07:15 +08:00
|
|
|
#ifdef HAVE_SYS_SELECT_H
|
|
|
|
#include <sys/select.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(USE_SYSV_SHM)
|
|
|
|
|
1998-08-29 07:01:46 +08:00
|
|
|
#ifdef HAVE_IPC_H
|
|
|
|
#include <sys/ipc.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_SHM_H
|
|
|
|
#include <sys/shm.h>
|
|
|
|
#endif
|
|
|
|
|
2003-12-27 16:07:15 +08:00
|
|
|
#elif defined(USE_POSIX_SHM)
|
|
|
|
|
|
|
|
#ifdef HAVE_UNISTD_H
|
|
|
|
#include <unistd.h>
|
1997-11-25 06:05:25 +08:00
|
|
|
#endif
|
|
|
|
|
2003-12-27 16:07:15 +08:00
|
|
|
#include <fcntl.h>
|
|
|
|
#include <sys/mman.h>
|
|
|
|
|
|
|
|
#endif /* USE_POSIX_SHM */
|
|
|
|
|
2012-11-08 06:44:35 +08:00
|
|
|
#ifdef GDK_WINDOWING_QUARTZ
|
|
|
|
#include <Cocoa/Cocoa.h>
|
|
|
|
#endif
|
|
|
|
|
1999-10-07 05:27:18 +08:00
|
|
|
#if defined(G_OS_WIN32) || defined(G_WITH_CYGWIN)
|
2018-04-04 12:30:36 +08:00
|
|
|
# ifdef STRICT
|
|
|
|
# undef STRICT
|
|
|
|
# endif
|
1999-03-07 20:56:03 +08:00
|
|
|
# define STRICT
|
2018-04-04 12:30:36 +08:00
|
|
|
|
|
|
|
# ifdef _WIN32_WINNT
|
|
|
|
# undef _WIN32_WINNT
|
|
|
|
# endif
|
2010-09-03 02:28:29 +08:00
|
|
|
# define _WIN32_WINNT 0x0601
|
2018-04-04 12:30:36 +08:00
|
|
|
|
1999-03-07 20:56:03 +08:00
|
|
|
# include <windows.h>
|
2013-02-23 23:25:58 +08:00
|
|
|
# include <tlhelp32.h>
|
1999-10-03 08:43:05 +08:00
|
|
|
# undef RGB
|
2003-12-27 16:07:15 +08:00
|
|
|
# define USE_WIN32_SHM 1
|
1999-03-07 20:56:03 +08:00
|
|
|
#endif
|
2003-05-24 07:34:13 +08:00
|
|
|
|
2003-03-26 00:38:19 +08:00
|
|
|
#include <locale.h>
|
|
|
|
|
2011-04-28 19:09:30 +08:00
|
|
|
#include "libgimpbase/gimpbase.h"
|
2003-11-16 06:53:28 +08:00
|
|
|
#include "libgimpbase/gimpbase-private.h"
|
2001-05-21 21:58:46 +08:00
|
|
|
#include "libgimpbase/gimpprotocol.h"
|
2019-08-03 18:50:34 +08:00
|
|
|
#include "libgimpbase/gimpwire.h"
|
2001-05-21 21:58:46 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
#include "gimp.h"
|
2019-07-31 05:48:37 +08:00
|
|
|
#include "gimp-private.h"
|
app, libgimp, libgimpbase: plug-in and PDB protocol refactoring part two
- Change the wire protocol's GPProcInstall to transmit the entire
information needed for constructing all GParamSpecs we use, don't
use GimpPDBArgType in GPProcInstall but an enum private to the wire
protocol plus the GParamSpec's GType name. Bump the wire protocol
version.
- Add gimpgpparamspecs.[ch] in both app/plug-in/ and libgimp/ which
take care of converting between GPParamDef and GParamSpec. They
share code as far as possible.
- Change pluginrc writing and parsing to re-use GPParamDef and the
utility functions from gimpgpparamspecs.
- Remove gimp_pdb_compat_param_spec() from app/pdb/gimp-pdb-compat.[ch],
the entire core uses proper GParamSpecs from the wire protocol now,
the whole file will follow down the drain once we use a GValue
representation on the wire too.
- In gimp_plug_in_handle_proc_install(), change the "run-mode"
parameter to a GParamSpecEnum(GIMP_TYPE_RUN_MODE) (if it is not
already an enum). and change all places in app/ to treat it as an
enum value.
- plug-ins: fix cml-explorer to register correctly, a typo in
"run-mode" was never noticed until now.
- Add gimpgpcompat.[ch] in libgimp to deal with all the transforms
between old-style wire communication and using GParamSpec and
GValue, it contains some functions that are subject to change or
even removal in the next steps.
- Change the libgimp GimpProcedure and GimpPlugIn in many ways to be
able to actually install procedures the new way.
- plug-ins: change goat-exercise to completely use the new GimpPlugIn
and GimpProcedure API, look here to see how plug-ins will look in
the future, of course subject to change until this is finished.
- Next: changing GPParam to transmit all information about a GValue.
2019-07-27 22:37:55 +08:00
|
|
|
#include "gimpgpcompat.h"
|
app, libgimp, libgimpbase: big plug-in API refactoring part three
- libgimpbase: change GPParam to transfer all information about the
GValues we use, in the same way done for GPParamDef. GPParam is now
different from GimpParam from libgimp, pointers can't be casted any
longer. The protocol is now completely GimpPDBArgType-free. Remove
gp_params_destroy() from the public API.
- libgimp: add API to convert between an array of GPParams and
GimpValueArray, the latter is now the new official API for dealing
with procedure arguments and return values, GimpParam is cruft (the
wire now talks with GimpPlugIn more directly than with the members
of GimpPlugInInfo, which need additional compat conversions).
- libgimp, app: rename gimpgpparamspecs.[ch] to simply
gimpgpparams.[ch] which is also more accurate because they now
contain GValue functions too. The code that used to live in
app/plug-in/plug-in-params.h is now completely in libgimp.
- app: contains no protocol compat code any longer, the only place
that uses GimpPDBArgType is the PDB query procedure implementation,
which also needs to change.
- app: change some forgotten int32 run-modes to enums.
2019-07-29 07:56:58 +08:00
|
|
|
#include "gimpgpparams.h"
|
2019-07-26 05:07:24 +08:00
|
|
|
#include "gimpplugin-private.h"
|
2003-11-16 06:53:28 +08:00
|
|
|
#include "gimpunitcache.h"
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2008-08-17 01:18:13 +08:00
|
|
|
#include "libgimp-intl.h"
|
|
|
|
|
2003-03-26 00:38:19 +08:00
|
|
|
|
2014-04-10 20:08:47 +08:00
|
|
|
#define TILE_MAP_SIZE (_tile_width * _tile_height * 32)
|
2003-12-27 16:07:15 +08:00
|
|
|
|
|
|
|
#define ERRMSG_SHM_FAILED "Could not attach to gimp shared memory segment"
|
|
|
|
|
2003-02-10 04:49:38 +08:00
|
|
|
/* Maybe this should go in a public header if we add other things to it */
|
Changed the semantics of GIMP_EXTENSION and (to some extent) of
2003-06-19 Michael Natterer <mitch@gimp.org>
Changed the semantics of GIMP_EXTENSION and (to some extent)
of GIMP_PLUGIN:
The old meaning of EXTENSION was "I live in the toolbox" and
PLUGIN meant "I take RUN-MODE,IMAGE,DRAWABLE args (but only if I
am invoked interactively)". This is completely useless, since
living in the toolbox means having "<Toolbox>" in the menu_path
and taking RUN-MODE,IMAGE,DRAWABLE means just that, regardless of
what type of procedure we are.
The new meaning of GIMP_PLUGIN is just "I am an ordinary procedure,
I am invoked, do my job and finish", while GIMP_EXTENSION means
"I will install temporary procedures and I will keep running to
keep them available".
(A GIMP_EXTENSION *must* call gimp_extension_ack() now to tell the
core that it's ready to run, or the core will block waiting for
the message !!!).
* configure.in: bumped version number to 1.3.16.
* libgimpbase/gimpprotocol.h: increased protocol version number so
old extensions will refuse to load.
* app/gui/plug-in-commands.c (plug_in_run_cmd_callback): don't
blindly pass RUN-MODE,IMAGE,DRAWABLE to GIMP_PLUGIN procedures but
look at their parameters and pass them either RUN-MODE, or
RUN-MODE,IMAGE, or RUN-MODE,IMAGE,DRAWABLE.
* app/pdb/procedural_db.c: cleaned up, better error reporting,
replaced an impossible error message by g_return_if_fail()
* app/plug-in/plug-in-message.c (plug_in_handle_proc_install):
better error messages.
* app/plug-in/plug-in-params.c: allocate parameter arrays using
g_new0() so we don't have to worry about uninitialized stuff
later.
* app/plug-in/plug-in-run.c (plug_in_run): wait for
gimp_extension_ack() installation confirmation for ALL extensions,
not just for automatically started ones.
* app/plug-in/plug-ins.c: cleanup.
* libgimp/gimp.[ch]: cleaned up and API-documented massively. Made
all magic values given in the GPConfig message static and added
accessor functions for them. Added gimp_tile_width()/height().
Added new function gimp_extension_enable() which turns on
asynchronous processing of temp_proc run requests without having
to enter an endless gimp_extension_process() loop. Moved all
private functions to the end of the file. Added tons of
g_return_if_fail() all over the place. Call gimp_run_procedure2()
from gimp_run_procedure() instead of duplicating the
code. Indentation, spacing, stuff...
* libgimp/gimptile.[ch]: removed gimp_tile_width()/height().
* libgimp/gimpdrawable.c
* libgimp/gimppixelrgn.c
* libgimp/gimptile.c: use the gimp_tile_width()/height() accessor
functions.
* libgimp/gimp.def: added gimp_extension_enable.
* libgimp/gimpmenu.c: removed evil code which connected to
_readchannel manually and use gimp_extension_enable() for watching
temp_procs.
* plug-ins/helpbrowser/helpbrowser.c: removed the same evil code
here and call gimp_extension_enable(). Call gimp_extension_ack()
to let the core know that the temp_proc is installed.
* plug-ins/script-fu/script-fu.c: made all procedures except the
permanently running "extension_script_fu" ordinary GIMP_PLUGIN
procedures.
* plug-ins/common/curve_bend.c
* plug-ins/common/plugindetails.c
* plug-ins/common/screenshot.c
* plug-ins/common/uniteditor.c
* plug-ins/common/winclipboard.c
* plug-ins/dbbrowser/dbbrowser.c
* plug-ins/gfli/gfli.c
* plug-ins/twain/twain.c
* plug-ins/webbrowser/webbrowser.c
* plug-ins/winsnap/winsnap.c: made them all ordinary GIMP_PLUGIN
procedures and renamed them from "extension_*" to "plug_in_*".
Random cleanups.
* app/widgets/gimphelp.c
* plug-ins/maze/maze_face.c: call "plug_in_web_browser" now.
2003-06-20 01:12:00 +08:00
|
|
|
typedef enum
|
|
|
|
{
|
2004-11-20 04:08:14 +08:00
|
|
|
GIMP_DEBUG_PID = 1 << 0,
|
|
|
|
GIMP_DEBUG_FATAL_WARNINGS = 1 << 1,
|
|
|
|
GIMP_DEBUG_QUERY = 1 << 2,
|
|
|
|
GIMP_DEBUG_INIT = 1 << 3,
|
|
|
|
GIMP_DEBUG_RUN = 1 << 4,
|
|
|
|
GIMP_DEBUG_QUIT = 1 << 5,
|
|
|
|
|
|
|
|
GIMP_DEBUG_DEFAULT = (GIMP_DEBUG_RUN | GIMP_DEBUG_FATAL_WARNINGS)
|
2003-02-10 04:49:38 +08:00
|
|
|
} GimpDebugFlag;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
#define WRITE_BUFFER_SIZE 1024
|
|
|
|
|
|
|
|
|
2019-07-26 05:07:24 +08:00
|
|
|
static gint gimp_main_internal (GType plug_in_type,
|
|
|
|
const GimpPlugInInfo *info,
|
|
|
|
gint argc,
|
|
|
|
gchar *argv[]);
|
|
|
|
|
2019-08-03 00:44:34 +08:00
|
|
|
static void gimp_close (void);
|
2003-02-10 04:49:38 +08:00
|
|
|
static void gimp_debug_stop (void);
|
Changed the semantics of GIMP_EXTENSION and (to some extent) of
2003-06-19 Michael Natterer <mitch@gimp.org>
Changed the semantics of GIMP_EXTENSION and (to some extent)
of GIMP_PLUGIN:
The old meaning of EXTENSION was "I live in the toolbox" and
PLUGIN meant "I take RUN-MODE,IMAGE,DRAWABLE args (but only if I
am invoked interactively)". This is completely useless, since
living in the toolbox means having "<Toolbox>" in the menu_path
and taking RUN-MODE,IMAGE,DRAWABLE means just that, regardless of
what type of procedure we are.
The new meaning of GIMP_PLUGIN is just "I am an ordinary procedure,
I am invoked, do my job and finish", while GIMP_EXTENSION means
"I will install temporary procedures and I will keep running to
keep them available".
(A GIMP_EXTENSION *must* call gimp_extension_ack() now to tell the
core that it's ready to run, or the core will block waiting for
the message !!!).
* configure.in: bumped version number to 1.3.16.
* libgimpbase/gimpprotocol.h: increased protocol version number so
old extensions will refuse to load.
* app/gui/plug-in-commands.c (plug_in_run_cmd_callback): don't
blindly pass RUN-MODE,IMAGE,DRAWABLE to GIMP_PLUGIN procedures but
look at their parameters and pass them either RUN-MODE, or
RUN-MODE,IMAGE, or RUN-MODE,IMAGE,DRAWABLE.
* app/pdb/procedural_db.c: cleaned up, better error reporting,
replaced an impossible error message by g_return_if_fail()
* app/plug-in/plug-in-message.c (plug_in_handle_proc_install):
better error messages.
* app/plug-in/plug-in-params.c: allocate parameter arrays using
g_new0() so we don't have to worry about uninitialized stuff
later.
* app/plug-in/plug-in-run.c (plug_in_run): wait for
gimp_extension_ack() installation confirmation for ALL extensions,
not just for automatically started ones.
* app/plug-in/plug-ins.c: cleanup.
* libgimp/gimp.[ch]: cleaned up and API-documented massively. Made
all magic values given in the GPConfig message static and added
accessor functions for them. Added gimp_tile_width()/height().
Added new function gimp_extension_enable() which turns on
asynchronous processing of temp_proc run requests without having
to enter an endless gimp_extension_process() loop. Moved all
private functions to the end of the file. Added tons of
g_return_if_fail() all over the place. Call gimp_run_procedure2()
from gimp_run_procedure() instead of duplicating the
code. Indentation, spacing, stuff...
* libgimp/gimptile.[ch]: removed gimp_tile_width()/height().
* libgimp/gimpdrawable.c
* libgimp/gimppixelrgn.c
* libgimp/gimptile.c: use the gimp_tile_width()/height() accessor
functions.
* libgimp/gimp.def: added gimp_extension_enable.
* libgimp/gimpmenu.c: removed evil code which connected to
_readchannel manually and use gimp_extension_enable() for watching
temp_procs.
* plug-ins/helpbrowser/helpbrowser.c: removed the same evil code
here and call gimp_extension_enable(). Call gimp_extension_ack()
to let the core know that the temp_proc is installed.
* plug-ins/script-fu/script-fu.c: made all procedures except the
permanently running "extension_script_fu" ordinary GIMP_PLUGIN
procedures.
* plug-ins/common/curve_bend.c
* plug-ins/common/plugindetails.c
* plug-ins/common/screenshot.c
* plug-ins/common/uniteditor.c
* plug-ins/common/winclipboard.c
* plug-ins/dbbrowser/dbbrowser.c
* plug-ins/gfli/gfli.c
* plug-ins/twain/twain.c
* plug-ins/webbrowser/webbrowser.c
* plug-ins/winsnap/winsnap.c: made them all ordinary GIMP_PLUGIN
procedures and renamed them from "extension_*" to "plug_in_*".
Random cleanups.
* app/widgets/gimphelp.c
* plug-ins/maze/maze_face.c: call "plug_in_web_browser" now.
2003-06-20 01:12:00 +08:00
|
|
|
static void gimp_message_func (const gchar *log_domain,
|
2005-12-29 05:24:12 +08:00
|
|
|
GLogLevelFlags log_level,
|
|
|
|
const gchar *message,
|
|
|
|
gpointer data);
|
2018-04-04 10:33:19 +08:00
|
|
|
static void gimp_fatal_func (const gchar *log_domain,
|
|
|
|
GLogLevelFlags flags,
|
|
|
|
const gchar *message,
|
|
|
|
gpointer data);
|
2018-04-05 00:04:34 +08:00
|
|
|
#ifdef G_OS_WIN32
|
|
|
|
#ifdef HAVE_EXCHNDL
|
|
|
|
static LONG WINAPI gimp_plugin_sigfatal_handler (PEXCEPTION_POINTERS pExceptionInfo);
|
|
|
|
#endif
|
|
|
|
#else
|
2000-07-31 01:33:37 +08:00
|
|
|
static void gimp_plugin_sigfatal_handler (gint sig_num);
|
app/appenv.h New file. Includes <math.h>. Move G_PI, RINT(), ROUND() etc
1999-09-01 Tor Lillqvist <tml@iki.fi>
* app/appenv.h
* libgimp/gimpmath.h: New file. Includes <math.h>. Move G_PI,
RINT(), ROUND() etc from app/appenv.h here, so plug-ins can
use them, too. Remove some commented-out old stuff in appenv.h.
* libgimp/gimp.h: Include gimpmath.h.
* libgimp/gimp.c (gimp_main): Win32: Don't install signal
handlers, we can't do anything useful in the handler ourselves
anyway (it would be nice to print out a backtrace, but that seems
pretty hard to do, even if not impossible). Let Windows inform the
user about the crash. If the plug-in was compiled with MSVC, and
the user also has it, she is offered a chance to start the
debugger automatically anyway.
* app/*several*.c: Include gimpmath.h for G_PI etc. Don't include
<math.h>, as gimpmath.h includes it.
* plug-ins/*/*many*.c: Include config.h. Don't include <math.h>.
Remove all the duplicated definitions of G_PI and rint(). Use
RINT() instead of rint().
* app/app_procs.[ch]: app_exit() takes a gboolean.
* app/batch.c
* app/commands.c
* app/interface.c: Call app_exit() with FALSE or TRUE.
* app/main.c (on_error): Call gimp_fatal_error. (main): Don't
install any signal handler on Win32 here, either.
* app/errors.c (gimp_fatal_error, gimp_terminate): Win32: Format
the message and call MessageBox with it. g_on_error_query doesn't
do anything useful on Win32, and printf'ing a message to stdout or
stderr doesn't do anything, either, in a windowing application.
1999-09-02 04:30:56 +08:00
|
|
|
#endif
|
2005-12-13 22:11:56 +08:00
|
|
|
static gboolean gimp_plugin_io_error_handler (GIOChannel *channel,
|
2005-12-29 05:24:12 +08:00
|
|
|
GIOCondition cond,
|
|
|
|
gpointer data);
|
2005-12-13 22:11:56 +08:00
|
|
|
static gboolean gimp_write (GIOChannel *channel,
|
2006-03-12 01:33:36 +08:00
|
|
|
const guint8 *buf,
|
2005-12-29 05:24:12 +08:00
|
|
|
gulong count,
|
2005-12-13 22:11:56 +08:00
|
|
|
gpointer user_data);
|
|
|
|
static gboolean gimp_flush (GIOChannel *channel,
|
|
|
|
gpointer user_data);
|
2000-03-26 02:49:05 +08:00
|
|
|
|
2019-07-29 18:42:47 +08:00
|
|
|
static void gimp_set_pdb_error (GimpValueArray *return_vals);
|
2008-08-17 01:18:13 +08:00
|
|
|
|
2019-08-02 23:04:24 +08:00
|
|
|
|
2018-04-05 00:04:34 +08:00
|
|
|
#if defined G_OS_WIN32 && defined HAVE_EXCHNDL
|
|
|
|
static LPTOP_LEVEL_EXCEPTION_FILTER _prevExceptionFilter = NULL;
|
|
|
|
static gchar *plug_in_backtrace_path = NULL;
|
|
|
|
#endif
|
|
|
|
|
2019-08-02 17:06:48 +08:00
|
|
|
GIOChannel *_gimp_readchannel = NULL;
|
2019-07-31 05:48:37 +08:00
|
|
|
GIOChannel *_gimp_writechannel = NULL;
|
1999-03-07 20:56:03 +08:00
|
|
|
|
2003-12-27 16:07:15 +08:00
|
|
|
#ifdef USE_WIN32_SHM
|
1999-03-07 20:56:03 +08:00
|
|
|
static HANDLE shm_handle;
|
|
|
|
#endif
|
1998-07-15 10:28:31 +08:00
|
|
|
|
2004-09-03 20:19:26 +08:00
|
|
|
static gint _tile_width = -1;
|
|
|
|
static gint _tile_height = -1;
|
|
|
|
static gint _shm_ID = -1;
|
|
|
|
static guchar *_shm_addr = NULL;
|
2004-10-05 00:21:52 +08:00
|
|
|
static gboolean _show_help_button = TRUE;
|
2018-06-18 08:19:41 +08:00
|
|
|
static gboolean _export_profile = FALSE;
|
2018-01-11 12:14:07 +08:00
|
|
|
static gboolean _export_exif = FALSE;
|
|
|
|
static gboolean _export_xmp = FALSE;
|
|
|
|
static gboolean _export_iptc = FALSE;
|
2004-09-03 20:19:26 +08:00
|
|
|
static GimpCheckSize _check_size = GIMP_CHECK_SIZE_MEDIUM_CHECKS;
|
|
|
|
static GimpCheckType _check_type = GIMP_CHECK_TYPE_GRAY_CHECKS;
|
|
|
|
static gint _gdisp_ID = -1;
|
|
|
|
static gchar *_wm_class = NULL;
|
|
|
|
static gchar *_display_name = NULL;
|
|
|
|
static gint _monitor_number = 0;
|
2008-03-28 00:30:29 +08:00
|
|
|
static guint32 _timestamp = 0;
|
libgimpbase, libgimp, app: pass icon theme dir to plug-ins through config
Pass the current icon theme directory to plug-ins through the
config message, and add a gimp_icon_theme_dir() libgimp function
for retrieving it. Note that we already have a similar
gimp_icon_get_theme_dir() PDB function, which we keep around, since
it can be used to dynamically query for the current icon dir,
unlike the former, and since it returns a dynamically-allocated
string, while the rest of the config-related functions return
statically allocated strings.
Use the new function, instead of gimp_get_icon_theme_dir(), in
gimp_ui_init(). This allows gimp_ui_init() to run without making
any PDB calls. Consequently, this allows us to start plug-ins that
call gimp_ui_init() without entering the main loop in the main app.
We're going to add a plug-in that displays an interactive dialog
while the main app is blocking waiting for an operation to
complete, and we need to be able to start the plug-in without
entering the main loop, to avoid the possibility of arbitrary code
being executed during the wait.
Bump the protocol version.
2018-05-29 23:20:54 +08:00
|
|
|
static gchar *_icon_theme_dir = NULL;
|
2004-09-03 20:19:26 +08:00
|
|
|
static const gchar *progname = NULL;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2005-08-16 08:48:20 +08:00
|
|
|
static gchar write_buffer[WRITE_BUFFER_SIZE];
|
|
|
|
static gulong write_buffer_index = 0;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-07-16 20:49:04 +08:00
|
|
|
static GimpStackTraceMode stack_trace_mode = GIMP_STACK_TRACE_NEVER;
|
|
|
|
|
2004-10-05 00:21:52 +08:00
|
|
|
static guint gimp_debug_flags = 0;
|
2003-02-10 04:49:38 +08:00
|
|
|
|
Changed the semantics of GIMP_EXTENSION and (to some extent) of
2003-06-19 Michael Natterer <mitch@gimp.org>
Changed the semantics of GIMP_EXTENSION and (to some extent)
of GIMP_PLUGIN:
The old meaning of EXTENSION was "I live in the toolbox" and
PLUGIN meant "I take RUN-MODE,IMAGE,DRAWABLE args (but only if I
am invoked interactively)". This is completely useless, since
living in the toolbox means having "<Toolbox>" in the menu_path
and taking RUN-MODE,IMAGE,DRAWABLE means just that, regardless of
what type of procedure we are.
The new meaning of GIMP_PLUGIN is just "I am an ordinary procedure,
I am invoked, do my job and finish", while GIMP_EXTENSION means
"I will install temporary procedures and I will keep running to
keep them available".
(A GIMP_EXTENSION *must* call gimp_extension_ack() now to tell the
core that it's ready to run, or the core will block waiting for
the message !!!).
* configure.in: bumped version number to 1.3.16.
* libgimpbase/gimpprotocol.h: increased protocol version number so
old extensions will refuse to load.
* app/gui/plug-in-commands.c (plug_in_run_cmd_callback): don't
blindly pass RUN-MODE,IMAGE,DRAWABLE to GIMP_PLUGIN procedures but
look at their parameters and pass them either RUN-MODE, or
RUN-MODE,IMAGE, or RUN-MODE,IMAGE,DRAWABLE.
* app/pdb/procedural_db.c: cleaned up, better error reporting,
replaced an impossible error message by g_return_if_fail()
* app/plug-in/plug-in-message.c (plug_in_handle_proc_install):
better error messages.
* app/plug-in/plug-in-params.c: allocate parameter arrays using
g_new0() so we don't have to worry about uninitialized stuff
later.
* app/plug-in/plug-in-run.c (plug_in_run): wait for
gimp_extension_ack() installation confirmation for ALL extensions,
not just for automatically started ones.
* app/plug-in/plug-ins.c: cleanup.
* libgimp/gimp.[ch]: cleaned up and API-documented massively. Made
all magic values given in the GPConfig message static and added
accessor functions for them. Added gimp_tile_width()/height().
Added new function gimp_extension_enable() which turns on
asynchronous processing of temp_proc run requests without having
to enter an endless gimp_extension_process() loop. Moved all
private functions to the end of the file. Added tons of
g_return_if_fail() all over the place. Call gimp_run_procedure2()
from gimp_run_procedure() instead of duplicating the
code. Indentation, spacing, stuff...
* libgimp/gimptile.[ch]: removed gimp_tile_width()/height().
* libgimp/gimpdrawable.c
* libgimp/gimppixelrgn.c
* libgimp/gimptile.c: use the gimp_tile_width()/height() accessor
functions.
* libgimp/gimp.def: added gimp_extension_enable.
* libgimp/gimpmenu.c: removed evil code which connected to
_readchannel manually and use gimp_extension_enable() for watching
temp_procs.
* plug-ins/helpbrowser/helpbrowser.c: removed the same evil code
here and call gimp_extension_enable(). Call gimp_extension_ack()
to let the core know that the temp_proc is installed.
* plug-ins/script-fu/script-fu.c: made all procedures except the
permanently running "extension_script_fu" ordinary GIMP_PLUGIN
procedures.
* plug-ins/common/curve_bend.c
* plug-ins/common/plugindetails.c
* plug-ins/common/screenshot.c
* plug-ins/common/uniteditor.c
* plug-ins/common/winclipboard.c
* plug-ins/dbbrowser/dbbrowser.c
* plug-ins/gfli/gfli.c
* plug-ins/twain/twain.c
* plug-ins/webbrowser/webbrowser.c
* plug-ins/winsnap/winsnap.c: made them all ordinary GIMP_PLUGIN
procedures and renamed them from "extension_*" to "plug_in_*".
Random cleanups.
* app/widgets/gimphelp.c
* plug-ins/maze/maze_face.c: call "plug_in_web_browser" now.
2003-06-20 01:12:00 +08:00
|
|
|
static const GDebugKey gimp_debug_keys[] =
|
|
|
|
{
|
|
|
|
{ "pid", GIMP_DEBUG_PID },
|
|
|
|
{ "fatal-warnings", GIMP_DEBUG_FATAL_WARNINGS },
|
|
|
|
{ "fw", GIMP_DEBUG_FATAL_WARNINGS },
|
|
|
|
{ "query", GIMP_DEBUG_QUERY },
|
|
|
|
{ "init", GIMP_DEBUG_INIT },
|
|
|
|
{ "run", GIMP_DEBUG_RUN },
|
|
|
|
{ "quit", GIMP_DEBUG_QUIT },
|
|
|
|
{ "on", GIMP_DEBUG_DEFAULT }
|
2003-02-10 04:49:38 +08:00
|
|
|
};
|
|
|
|
|
app, libgimp, libgimpbase: plug-in and PDB protocol refactoring part two
- Change the wire protocol's GPProcInstall to transmit the entire
information needed for constructing all GParamSpecs we use, don't
use GimpPDBArgType in GPProcInstall but an enum private to the wire
protocol plus the GParamSpec's GType name. Bump the wire protocol
version.
- Add gimpgpparamspecs.[ch] in both app/plug-in/ and libgimp/ which
take care of converting between GPParamDef and GParamSpec. They
share code as far as possible.
- Change pluginrc writing and parsing to re-use GPParamDef and the
utility functions from gimpgpparamspecs.
- Remove gimp_pdb_compat_param_spec() from app/pdb/gimp-pdb-compat.[ch],
the entire core uses proper GParamSpecs from the wire protocol now,
the whole file will follow down the drain once we use a GValue
representation on the wire too.
- In gimp_plug_in_handle_proc_install(), change the "run-mode"
parameter to a GParamSpecEnum(GIMP_TYPE_RUN_MODE) (if it is not
already an enum). and change all places in app/ to treat it as an
enum value.
- plug-ins: fix cml-explorer to register correctly, a typo in
"run-mode" was never noticed until now.
- Add gimpgpcompat.[ch] in libgimp to deal with all the transforms
between old-style wire communication and using GParamSpec and
GValue, it contains some functions that are subject to change or
even removal in the next steps.
- Change the libgimp GimpProcedure and GimpPlugIn in many ways to be
able to actually install procedures the new way.
- plug-ins: change goat-exercise to completely use the new GimpPlugIn
and GimpProcedure API, look here to see how plug-ins will look in
the future, of course subject to change until this is finished.
- Next: changing GPParam to transmit all information about a GValue.
2019-07-27 22:37:55 +08:00
|
|
|
static GimpPlugIn *PLUG_IN = NULL;
|
|
|
|
static GimpPlugInInfo PLUG_IN_INFO = { 0, };
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2008-08-17 01:18:13 +08:00
|
|
|
static GimpPDBStatusType pdb_error_status = GIMP_PDB_SUCCESS;
|
|
|
|
static gchar *pdb_error_message = NULL;
|
|
|
|
|
|
|
|
|
Changed the semantics of GIMP_EXTENSION and (to some extent) of
2003-06-19 Michael Natterer <mitch@gimp.org>
Changed the semantics of GIMP_EXTENSION and (to some extent)
of GIMP_PLUGIN:
The old meaning of EXTENSION was "I live in the toolbox" and
PLUGIN meant "I take RUN-MODE,IMAGE,DRAWABLE args (but only if I
am invoked interactively)". This is completely useless, since
living in the toolbox means having "<Toolbox>" in the menu_path
and taking RUN-MODE,IMAGE,DRAWABLE means just that, regardless of
what type of procedure we are.
The new meaning of GIMP_PLUGIN is just "I am an ordinary procedure,
I am invoked, do my job and finish", while GIMP_EXTENSION means
"I will install temporary procedures and I will keep running to
keep them available".
(A GIMP_EXTENSION *must* call gimp_extension_ack() now to tell the
core that it's ready to run, or the core will block waiting for
the message !!!).
* configure.in: bumped version number to 1.3.16.
* libgimpbase/gimpprotocol.h: increased protocol version number so
old extensions will refuse to load.
* app/gui/plug-in-commands.c (plug_in_run_cmd_callback): don't
blindly pass RUN-MODE,IMAGE,DRAWABLE to GIMP_PLUGIN procedures but
look at their parameters and pass them either RUN-MODE, or
RUN-MODE,IMAGE, or RUN-MODE,IMAGE,DRAWABLE.
* app/pdb/procedural_db.c: cleaned up, better error reporting,
replaced an impossible error message by g_return_if_fail()
* app/plug-in/plug-in-message.c (plug_in_handle_proc_install):
better error messages.
* app/plug-in/plug-in-params.c: allocate parameter arrays using
g_new0() so we don't have to worry about uninitialized stuff
later.
* app/plug-in/plug-in-run.c (plug_in_run): wait for
gimp_extension_ack() installation confirmation for ALL extensions,
not just for automatically started ones.
* app/plug-in/plug-ins.c: cleanup.
* libgimp/gimp.[ch]: cleaned up and API-documented massively. Made
all magic values given in the GPConfig message static and added
accessor functions for them. Added gimp_tile_width()/height().
Added new function gimp_extension_enable() which turns on
asynchronous processing of temp_proc run requests without having
to enter an endless gimp_extension_process() loop. Moved all
private functions to the end of the file. Added tons of
g_return_if_fail() all over the place. Call gimp_run_procedure2()
from gimp_run_procedure() instead of duplicating the
code. Indentation, spacing, stuff...
* libgimp/gimptile.[ch]: removed gimp_tile_width()/height().
* libgimp/gimpdrawable.c
* libgimp/gimppixelrgn.c
* libgimp/gimptile.c: use the gimp_tile_width()/height() accessor
functions.
* libgimp/gimp.def: added gimp_extension_enable.
* libgimp/gimpmenu.c: removed evil code which connected to
_readchannel manually and use gimp_extension_enable() for watching
temp_procs.
* plug-ins/helpbrowser/helpbrowser.c: removed the same evil code
here and call gimp_extension_enable(). Call gimp_extension_ack()
to let the core know that the temp_proc is installed.
* plug-ins/script-fu/script-fu.c: made all procedures except the
permanently running "extension_script_fu" ordinary GIMP_PLUGIN
procedures.
* plug-ins/common/curve_bend.c
* plug-ins/common/plugindetails.c
* plug-ins/common/screenshot.c
* plug-ins/common/uniteditor.c
* plug-ins/common/winclipboard.c
* plug-ins/dbbrowser/dbbrowser.c
* plug-ins/gfli/gfli.c
* plug-ins/twain/twain.c
* plug-ins/webbrowser/webbrowser.c
* plug-ins/winsnap/winsnap.c: made them all ordinary GIMP_PLUGIN
procedures and renamed them from "extension_*" to "plug_in_*".
Random cleanups.
* app/widgets/gimphelp.c
* plug-ins/maze/maze_face.c: call "plug_in_web_browser" now.
2003-06-20 01:12:00 +08:00
|
|
|
/**
|
|
|
|
* gimp_main:
|
2019-07-26 05:07:24 +08:00
|
|
|
* @plug_in_type: the type of the #GimpPlugIn subclass of the plug-in
|
|
|
|
* @argc: the number of arguments
|
|
|
|
* @argv: (array length=argc): the arguments
|
|
|
|
*
|
|
|
|
* The main procedure that must be called with the plug-in's
|
|
|
|
* #GimpPlugIn subclass type and the 'argc' and 'argv' that are passed
|
|
|
|
* to "main".
|
|
|
|
*
|
|
|
|
* Returns: an exit status as defined by the C library,
|
|
|
|
* on success EXIT_SUCCESS.
|
|
|
|
**/
|
|
|
|
gint
|
|
|
|
gimp_main (GType plug_in_type,
|
|
|
|
gint argc,
|
|
|
|
gchar *argv[])
|
|
|
|
{
|
|
|
|
return gimp_main_internal (plug_in_type, NULL, argc, argv);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_main_legacy:
|
|
|
|
* @info: the #GimpPlugInInfo structure
|
Changed the semantics of GIMP_EXTENSION and (to some extent) of
2003-06-19 Michael Natterer <mitch@gimp.org>
Changed the semantics of GIMP_EXTENSION and (to some extent)
of GIMP_PLUGIN:
The old meaning of EXTENSION was "I live in the toolbox" and
PLUGIN meant "I take RUN-MODE,IMAGE,DRAWABLE args (but only if I
am invoked interactively)". This is completely useless, since
living in the toolbox means having "<Toolbox>" in the menu_path
and taking RUN-MODE,IMAGE,DRAWABLE means just that, regardless of
what type of procedure we are.
The new meaning of GIMP_PLUGIN is just "I am an ordinary procedure,
I am invoked, do my job and finish", while GIMP_EXTENSION means
"I will install temporary procedures and I will keep running to
keep them available".
(A GIMP_EXTENSION *must* call gimp_extension_ack() now to tell the
core that it's ready to run, or the core will block waiting for
the message !!!).
* configure.in: bumped version number to 1.3.16.
* libgimpbase/gimpprotocol.h: increased protocol version number so
old extensions will refuse to load.
* app/gui/plug-in-commands.c (plug_in_run_cmd_callback): don't
blindly pass RUN-MODE,IMAGE,DRAWABLE to GIMP_PLUGIN procedures but
look at their parameters and pass them either RUN-MODE, or
RUN-MODE,IMAGE, or RUN-MODE,IMAGE,DRAWABLE.
* app/pdb/procedural_db.c: cleaned up, better error reporting,
replaced an impossible error message by g_return_if_fail()
* app/plug-in/plug-in-message.c (plug_in_handle_proc_install):
better error messages.
* app/plug-in/plug-in-params.c: allocate parameter arrays using
g_new0() so we don't have to worry about uninitialized stuff
later.
* app/plug-in/plug-in-run.c (plug_in_run): wait for
gimp_extension_ack() installation confirmation for ALL extensions,
not just for automatically started ones.
* app/plug-in/plug-ins.c: cleanup.
* libgimp/gimp.[ch]: cleaned up and API-documented massively. Made
all magic values given in the GPConfig message static and added
accessor functions for them. Added gimp_tile_width()/height().
Added new function gimp_extension_enable() which turns on
asynchronous processing of temp_proc run requests without having
to enter an endless gimp_extension_process() loop. Moved all
private functions to the end of the file. Added tons of
g_return_if_fail() all over the place. Call gimp_run_procedure2()
from gimp_run_procedure() instead of duplicating the
code. Indentation, spacing, stuff...
* libgimp/gimptile.[ch]: removed gimp_tile_width()/height().
* libgimp/gimpdrawable.c
* libgimp/gimppixelrgn.c
* libgimp/gimptile.c: use the gimp_tile_width()/height() accessor
functions.
* libgimp/gimp.def: added gimp_extension_enable.
* libgimp/gimpmenu.c: removed evil code which connected to
_readchannel manually and use gimp_extension_enable() for watching
temp_procs.
* plug-ins/helpbrowser/helpbrowser.c: removed the same evil code
here and call gimp_extension_enable(). Call gimp_extension_ack()
to let the core know that the temp_proc is installed.
* plug-ins/script-fu/script-fu.c: made all procedures except the
permanently running "extension_script_fu" ordinary GIMP_PLUGIN
procedures.
* plug-ins/common/curve_bend.c
* plug-ins/common/plugindetails.c
* plug-ins/common/screenshot.c
* plug-ins/common/uniteditor.c
* plug-ins/common/winclipboard.c
* plug-ins/dbbrowser/dbbrowser.c
* plug-ins/gfli/gfli.c
* plug-ins/twain/twain.c
* plug-ins/webbrowser/webbrowser.c
* plug-ins/winsnap/winsnap.c: made them all ordinary GIMP_PLUGIN
procedures and renamed them from "extension_*" to "plug_in_*".
Random cleanups.
* app/widgets/gimphelp.c
* plug-ins/maze/maze_face.c: call "plug_in_web_browser" now.
2003-06-20 01:12:00 +08:00
|
|
|
* @argc: the number of arguments
|
2019-07-25 17:02:53 +08:00
|
|
|
* @argv: (array length=argc): the arguments
|
2003-11-08 01:29:02 +08:00
|
|
|
*
|
2019-07-26 05:07:24 +08:00
|
|
|
* The main procedure that must be called with the #GimpPlugInInfo
|
|
|
|
* structure and the 'argc' and 'argv' that are passed to "main".
|
2003-11-08 01:29:02 +08:00
|
|
|
*
|
2010-07-07 17:48:10 +08:00
|
|
|
* Returns: an exit status as defined by the C library,
|
2019-07-24 07:18:30 +08:00
|
|
|
* on success EXIT_SUCCESS.
|
Changed the semantics of GIMP_EXTENSION and (to some extent) of
2003-06-19 Michael Natterer <mitch@gimp.org>
Changed the semantics of GIMP_EXTENSION and (to some extent)
of GIMP_PLUGIN:
The old meaning of EXTENSION was "I live in the toolbox" and
PLUGIN meant "I take RUN-MODE,IMAGE,DRAWABLE args (but only if I
am invoked interactively)". This is completely useless, since
living in the toolbox means having "<Toolbox>" in the menu_path
and taking RUN-MODE,IMAGE,DRAWABLE means just that, regardless of
what type of procedure we are.
The new meaning of GIMP_PLUGIN is just "I am an ordinary procedure,
I am invoked, do my job and finish", while GIMP_EXTENSION means
"I will install temporary procedures and I will keep running to
keep them available".
(A GIMP_EXTENSION *must* call gimp_extension_ack() now to tell the
core that it's ready to run, or the core will block waiting for
the message !!!).
* configure.in: bumped version number to 1.3.16.
* libgimpbase/gimpprotocol.h: increased protocol version number so
old extensions will refuse to load.
* app/gui/plug-in-commands.c (plug_in_run_cmd_callback): don't
blindly pass RUN-MODE,IMAGE,DRAWABLE to GIMP_PLUGIN procedures but
look at their parameters and pass them either RUN-MODE, or
RUN-MODE,IMAGE, or RUN-MODE,IMAGE,DRAWABLE.
* app/pdb/procedural_db.c: cleaned up, better error reporting,
replaced an impossible error message by g_return_if_fail()
* app/plug-in/plug-in-message.c (plug_in_handle_proc_install):
better error messages.
* app/plug-in/plug-in-params.c: allocate parameter arrays using
g_new0() so we don't have to worry about uninitialized stuff
later.
* app/plug-in/plug-in-run.c (plug_in_run): wait for
gimp_extension_ack() installation confirmation for ALL extensions,
not just for automatically started ones.
* app/plug-in/plug-ins.c: cleanup.
* libgimp/gimp.[ch]: cleaned up and API-documented massively. Made
all magic values given in the GPConfig message static and added
accessor functions for them. Added gimp_tile_width()/height().
Added new function gimp_extension_enable() which turns on
asynchronous processing of temp_proc run requests without having
to enter an endless gimp_extension_process() loop. Moved all
private functions to the end of the file. Added tons of
g_return_if_fail() all over the place. Call gimp_run_procedure2()
from gimp_run_procedure() instead of duplicating the
code. Indentation, spacing, stuff...
* libgimp/gimptile.[ch]: removed gimp_tile_width()/height().
* libgimp/gimpdrawable.c
* libgimp/gimppixelrgn.c
* libgimp/gimptile.c: use the gimp_tile_width()/height() accessor
functions.
* libgimp/gimp.def: added gimp_extension_enable.
* libgimp/gimpmenu.c: removed evil code which connected to
_readchannel manually and use gimp_extension_enable() for watching
temp_procs.
* plug-ins/helpbrowser/helpbrowser.c: removed the same evil code
here and call gimp_extension_enable(). Call gimp_extension_ack()
to let the core know that the temp_proc is installed.
* plug-ins/script-fu/script-fu.c: made all procedures except the
permanently running "extension_script_fu" ordinary GIMP_PLUGIN
procedures.
* plug-ins/common/curve_bend.c
* plug-ins/common/plugindetails.c
* plug-ins/common/screenshot.c
* plug-ins/common/uniteditor.c
* plug-ins/common/winclipboard.c
* plug-ins/dbbrowser/dbbrowser.c
* plug-ins/gfli/gfli.c
* plug-ins/twain/twain.c
* plug-ins/webbrowser/webbrowser.c
* plug-ins/winsnap/winsnap.c: made them all ordinary GIMP_PLUGIN
procedures and renamed them from "extension_*" to "plug_in_*".
Random cleanups.
* app/widgets/gimphelp.c
* plug-ins/maze/maze_face.c: call "plug_in_web_browser" now.
2003-06-20 01:12:00 +08:00
|
|
|
**/
|
|
|
|
gint
|
2019-07-26 05:07:24 +08:00
|
|
|
gimp_main_legacy (const GimpPlugInInfo *info,
|
|
|
|
gint argc,
|
|
|
|
gchar *argv[])
|
|
|
|
{
|
|
|
|
return gimp_main_internal (G_TYPE_NONE, info, argc, argv);
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
gimp_main_internal (GType plug_in_type,
|
|
|
|
const GimpPlugInInfo *info,
|
|
|
|
gint argc,
|
|
|
|
gchar *argv[])
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2018-03-05 14:40:59 +08:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
ARG_PROGNAME,
|
|
|
|
ARG_GIMP,
|
2018-05-02 22:35:06 +08:00
|
|
|
ARG_PROTOCOL_VERSION,
|
2018-03-05 14:40:59 +08:00
|
|
|
ARG_READ_FD,
|
|
|
|
ARG_WRITE_FD,
|
|
|
|
ARG_MODE,
|
|
|
|
ARG_STACK_TRACE_MODE,
|
|
|
|
|
|
|
|
N_ARGS
|
|
|
|
};
|
|
|
|
|
2003-02-10 04:49:38 +08:00
|
|
|
gchar *basename;
|
|
|
|
const gchar *env_string;
|
|
|
|
gchar *debug_string;
|
2018-05-02 22:35:06 +08:00
|
|
|
gint protocol_version;
|
2001-08-30 01:48:28 +08:00
|
|
|
|
1999-10-05 03:26:07 +08:00
|
|
|
#ifdef G_OS_WIN32
|
2001-07-16 04:47:03 +08:00
|
|
|
gint i, j, k;
|
1999-08-29 01:00:33 +08:00
|
|
|
|
2010-09-03 02:28:29 +08:00
|
|
|
/* Reduce risks */
|
|
|
|
{
|
|
|
|
typedef BOOL (WINAPI *t_SetDllDirectoryA) (LPCSTR lpPathName);
|
|
|
|
t_SetDllDirectoryA p_SetDllDirectoryA;
|
|
|
|
|
2018-04-04 12:30:36 +08:00
|
|
|
p_SetDllDirectoryA = (t_SetDllDirectoryA) GetProcAddress (GetModuleHandle ("kernel32.dll"),
|
|
|
|
"SetDllDirectoryA");
|
2010-09-03 02:28:29 +08:00
|
|
|
if (p_SetDllDirectoryA)
|
|
|
|
(*p_SetDllDirectoryA) ("");
|
|
|
|
}
|
2015-04-13 02:47:06 +08:00
|
|
|
|
|
|
|
/* On Windows, set DLL search path to $INSTALLDIR/bin so that GEGL
|
|
|
|
file operations can find their respective file library DLLs (such
|
|
|
|
as jasper, etc.) without needing to set external PATH. */
|
|
|
|
{
|
|
|
|
const gchar *install_dir;
|
|
|
|
gchar *bin_dir;
|
|
|
|
LPWSTR w_bin_dir;
|
|
|
|
int n;
|
|
|
|
|
|
|
|
w_bin_dir = NULL;
|
|
|
|
install_dir = gimp_installation_directory ();
|
|
|
|
bin_dir = g_build_filename (install_dir, "bin", NULL);
|
|
|
|
|
|
|
|
n = MultiByteToWideChar (CP_UTF8, MB_ERR_INVALID_CHARS,
|
|
|
|
bin_dir, -1, NULL, 0);
|
|
|
|
if (n == 0)
|
|
|
|
goto out;
|
|
|
|
|
|
|
|
w_bin_dir = g_malloc_n (n + 1, sizeof (wchar_t));
|
|
|
|
n = MultiByteToWideChar (CP_UTF8, MB_ERR_INVALID_CHARS,
|
|
|
|
bin_dir, -1,
|
|
|
|
w_bin_dir, (n + 1) * sizeof (wchar_t));
|
|
|
|
if (n == 0)
|
|
|
|
goto out;
|
|
|
|
|
|
|
|
SetDllDirectoryW (w_bin_dir);
|
|
|
|
|
|
|
|
out:
|
|
|
|
if (w_bin_dir)
|
|
|
|
g_free (w_bin_dir);
|
|
|
|
g_free (bin_dir);
|
|
|
|
}
|
|
|
|
|
2015-08-31 21:26:51 +08:00
|
|
|
#ifdef HAVE_EXCHNDL
|
|
|
|
/* Use Dr. Mingw (dumps backtrace on crash) if it is available. */
|
|
|
|
{
|
2018-04-05 00:04:34 +08:00
|
|
|
time_t t;
|
|
|
|
gchar *filename;
|
|
|
|
gchar *dir;
|
2015-08-31 21:26:51 +08:00
|
|
|
|
|
|
|
/* This has to be the non-roaming directory (i.e., the local
|
|
|
|
directory) as backtraces correspond to the binaries on this
|
|
|
|
system. */
|
|
|
|
dir = g_build_filename (g_get_user_data_dir (),
|
|
|
|
GIMPDIR, GIMP_USER_VERSION, "CrashLog",
|
|
|
|
NULL);
|
|
|
|
/* Ensure the path exists. */
|
|
|
|
g_mkdir_with_parents (dir, 0700);
|
|
|
|
|
|
|
|
time (&t);
|
|
|
|
filename = g_strdup_printf ("%s-crash-%" G_GUINT64_FORMAT ".txt",
|
|
|
|
g_get_prgname(), t);
|
2018-04-05 00:04:34 +08:00
|
|
|
plug_in_backtrace_path = g_build_filename (dir, filename, NULL);
|
2015-08-31 21:26:51 +08:00
|
|
|
g_free (filename);
|
|
|
|
g_free (dir);
|
|
|
|
|
2018-04-05 00:04:34 +08:00
|
|
|
/* Similar to core crash handling in app/signals.c, the order here
|
|
|
|
* is very important!
|
|
|
|
*/
|
|
|
|
if (! _prevExceptionFilter)
|
|
|
|
_prevExceptionFilter = SetUnhandledExceptionFilter (gimp_plugin_sigfatal_handler);
|
2015-08-31 21:26:51 +08:00
|
|
|
|
2018-04-05 00:04:34 +08:00
|
|
|
ExcHndlInit ();
|
|
|
|
ExcHndlSetLogFileNameA (plug_in_backtrace_path);
|
2015-08-31 21:26:51 +08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2010-09-03 02:28:29 +08:00
|
|
|
#ifndef _WIN64
|
|
|
|
{
|
|
|
|
typedef BOOL (WINAPI *t_SetProcessDEPPolicy) (DWORD dwFlags);
|
|
|
|
t_SetProcessDEPPolicy p_SetProcessDEPPolicy;
|
|
|
|
|
|
|
|
p_SetProcessDEPPolicy = GetProcAddress (GetModuleHandle ("kernel32.dll"),
|
2017-02-01 06:39:04 +08:00
|
|
|
"SetProcessDEPPolicy");
|
2010-09-03 02:28:29 +08:00
|
|
|
if (p_SetProcessDEPPolicy)
|
|
|
|
(*p_SetProcessDEPPolicy) (PROCESS_DEP_ENABLE|PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2015-08-11 10:27:45 +08:00
|
|
|
/* Group all our windows together on the taskbar */
|
|
|
|
{
|
|
|
|
typedef HRESULT (WINAPI *t_SetCurrentProcessExplicitAppUserModelID) (PCWSTR lpPathName);
|
|
|
|
t_SetCurrentProcessExplicitAppUserModelID p_SetCurrentProcessExplicitAppUserModelID;
|
|
|
|
|
2018-04-04 12:30:36 +08:00
|
|
|
p_SetCurrentProcessExplicitAppUserModelID = (t_SetCurrentProcessExplicitAppUserModelID) GetProcAddress (GetModuleHandle ("shell32.dll"),
|
|
|
|
"SetCurrentProcessExplicitAppUserModelID");
|
2015-08-11 10:27:45 +08:00
|
|
|
if (p_SetCurrentProcessExplicitAppUserModelID)
|
|
|
|
(*p_SetCurrentProcessExplicitAppUserModelID) (L"gimp.GimpApplication");
|
|
|
|
}
|
|
|
|
|
1999-08-29 01:00:33 +08:00
|
|
|
/* Check for exe file name with spaces in the path having been split up
|
|
|
|
* by buggy NT C runtime, or something. I don't know why this happens
|
|
|
|
* on NT (including w2k), but not on w95/98.
|
|
|
|
*/
|
|
|
|
|
|
|
|
for (i = 1; i < argc; i++)
|
|
|
|
{
|
|
|
|
k = strlen (argv[i]);
|
2003-05-24 07:34:13 +08:00
|
|
|
|
1999-08-29 01:00:33 +08:00
|
|
|
if (k > 10)
|
2005-12-29 05:24:12 +08:00
|
|
|
{
|
|
|
|
if (g_ascii_strcasecmp (argv[i] + k - 4, ".exe") == 0)
|
|
|
|
{
|
|
|
|
/* Found the end of the executable name, most probably.
|
|
|
|
* Splice the parts of the name back together.
|
|
|
|
*/
|
|
|
|
GString *s;
|
2003-05-24 07:34:13 +08:00
|
|
|
|
2018-03-05 14:40:59 +08:00
|
|
|
s = g_string_new (argv[ARG_PROGNAME]);
|
2003-05-24 07:34:13 +08:00
|
|
|
|
2005-12-29 05:24:12 +08:00
|
|
|
for (j = 1; j <= i; j++)
|
|
|
|
{
|
|
|
|
s = g_string_append_c (s, ' ');
|
|
|
|
s = g_string_append (s, argv[j]);
|
|
|
|
}
|
2003-05-24 07:34:13 +08:00
|
|
|
|
2018-03-05 14:40:59 +08:00
|
|
|
argv[ARG_PROGNAME] = s->str;
|
2003-05-24 07:34:13 +08:00
|
|
|
|
2005-12-29 05:24:12 +08:00
|
|
|
/* Move rest of argv down */
|
|
|
|
for (j = 1; j < argc - i; j++)
|
|
|
|
argv[j] = argv[j + i];
|
2003-05-24 07:34:13 +08:00
|
|
|
|
2005-12-29 05:24:12 +08:00
|
|
|
argv[argc - i] = NULL;
|
|
|
|
argc -= i;
|
2003-05-24 07:34:13 +08:00
|
|
|
|
2005-12-29 05:24:12 +08:00
|
|
|
break;
|
|
|
|
}
|
2003-05-24 07:34:13 +08:00
|
|
|
}
|
2000-05-31 14:15:06 +08:00
|
|
|
}
|
1999-03-07 20:56:03 +08:00
|
|
|
#endif
|
|
|
|
|
2019-07-26 05:07:24 +08:00
|
|
|
g_assert ((plug_in_type != G_TYPE_NONE && info == NULL) ||
|
|
|
|
(plug_in_type == G_TYPE_NONE && info != NULL));
|
2003-05-24 07:34:13 +08:00
|
|
|
|
2018-03-05 14:40:59 +08:00
|
|
|
if ((argc != N_ARGS) || (strcmp (argv[ARG_GIMP], "-gimp") != 0))
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2004-11-20 04:08:14 +08:00
|
|
|
g_printerr ("%s is a GIMP plug-in and must be run by GIMP to be used\n",
|
2018-03-05 14:40:59 +08:00
|
|
|
argv[ARG_PROGNAME]);
|
2018-06-07 01:20:32 +08:00
|
|
|
return EXIT_FAILURE;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2005-11-06 09:06:41 +08:00
|
|
|
gimp_env_init (TRUE);
|
|
|
|
|
2018-03-05 14:40:59 +08:00
|
|
|
progname = argv[ARG_PROGNAME];
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-08-30 01:48:28 +08:00
|
|
|
basename = g_path_get_basename (progname);
|
|
|
|
|
|
|
|
g_set_prgname (basename);
|
|
|
|
|
2018-05-02 22:35:06 +08:00
|
|
|
protocol_version = atoi (argv[ARG_PROTOCOL_VERSION]);
|
|
|
|
|
|
|
|
if (protocol_version < GIMP_PROTOCOL_VERSION)
|
|
|
|
{
|
2018-06-07 01:20:32 +08:00
|
|
|
g_printerr ("Could not execute plug-in \"%s\"\n(%s)\n"
|
|
|
|
"because GIMP is using an older version of the "
|
|
|
|
"plug-in protocol.\n",
|
|
|
|
gimp_filename_to_utf8 (g_get_prgname ()),
|
|
|
|
gimp_filename_to_utf8 (progname));
|
|
|
|
return EXIT_FAILURE;
|
2018-05-02 22:35:06 +08:00
|
|
|
}
|
|
|
|
else if (protocol_version > GIMP_PROTOCOL_VERSION)
|
|
|
|
{
|
2018-06-07 01:20:32 +08:00
|
|
|
g_printerr ("Could not execute plug-in \"%s\"\n(%s)\n"
|
|
|
|
"because it uses an obsolete version of the "
|
|
|
|
"plug-in protocol.\n",
|
|
|
|
gimp_filename_to_utf8 (g_get_prgname ()),
|
|
|
|
gimp_filename_to_utf8 (progname));
|
|
|
|
return EXIT_FAILURE;
|
2018-05-02 22:35:06 +08:00
|
|
|
}
|
|
|
|
|
2003-02-10 04:49:38 +08:00
|
|
|
env_string = g_getenv ("GIMP_PLUGIN_DEBUG");
|
|
|
|
|
|
|
|
if (env_string)
|
|
|
|
{
|
2013-02-23 23:10:19 +08:00
|
|
|
const gchar *debug_messages;
|
|
|
|
|
2003-02-10 04:49:38 +08:00
|
|
|
debug_string = strchr (env_string, ',');
|
|
|
|
|
|
|
|
if (debug_string)
|
|
|
|
{
|
|
|
|
gint len = debug_string - env_string;
|
|
|
|
|
2005-12-29 05:24:12 +08:00
|
|
|
if ((strlen (basename) == len) &&
|
2003-02-10 04:49:38 +08:00
|
|
|
(strncmp (basename, env_string, len) == 0))
|
|
|
|
{
|
Changed the semantics of GIMP_EXTENSION and (to some extent) of
2003-06-19 Michael Natterer <mitch@gimp.org>
Changed the semantics of GIMP_EXTENSION and (to some extent)
of GIMP_PLUGIN:
The old meaning of EXTENSION was "I live in the toolbox" and
PLUGIN meant "I take RUN-MODE,IMAGE,DRAWABLE args (but only if I
am invoked interactively)". This is completely useless, since
living in the toolbox means having "<Toolbox>" in the menu_path
and taking RUN-MODE,IMAGE,DRAWABLE means just that, regardless of
what type of procedure we are.
The new meaning of GIMP_PLUGIN is just "I am an ordinary procedure,
I am invoked, do my job and finish", while GIMP_EXTENSION means
"I will install temporary procedures and I will keep running to
keep them available".
(A GIMP_EXTENSION *must* call gimp_extension_ack() now to tell the
core that it's ready to run, or the core will block waiting for
the message !!!).
* configure.in: bumped version number to 1.3.16.
* libgimpbase/gimpprotocol.h: increased protocol version number so
old extensions will refuse to load.
* app/gui/plug-in-commands.c (plug_in_run_cmd_callback): don't
blindly pass RUN-MODE,IMAGE,DRAWABLE to GIMP_PLUGIN procedures but
look at their parameters and pass them either RUN-MODE, or
RUN-MODE,IMAGE, or RUN-MODE,IMAGE,DRAWABLE.
* app/pdb/procedural_db.c: cleaned up, better error reporting,
replaced an impossible error message by g_return_if_fail()
* app/plug-in/plug-in-message.c (plug_in_handle_proc_install):
better error messages.
* app/plug-in/plug-in-params.c: allocate parameter arrays using
g_new0() so we don't have to worry about uninitialized stuff
later.
* app/plug-in/plug-in-run.c (plug_in_run): wait for
gimp_extension_ack() installation confirmation for ALL extensions,
not just for automatically started ones.
* app/plug-in/plug-ins.c: cleanup.
* libgimp/gimp.[ch]: cleaned up and API-documented massively. Made
all magic values given in the GPConfig message static and added
accessor functions for them. Added gimp_tile_width()/height().
Added new function gimp_extension_enable() which turns on
asynchronous processing of temp_proc run requests without having
to enter an endless gimp_extension_process() loop. Moved all
private functions to the end of the file. Added tons of
g_return_if_fail() all over the place. Call gimp_run_procedure2()
from gimp_run_procedure() instead of duplicating the
code. Indentation, spacing, stuff...
* libgimp/gimptile.[ch]: removed gimp_tile_width()/height().
* libgimp/gimpdrawable.c
* libgimp/gimppixelrgn.c
* libgimp/gimptile.c: use the gimp_tile_width()/height() accessor
functions.
* libgimp/gimp.def: added gimp_extension_enable.
* libgimp/gimpmenu.c: removed evil code which connected to
_readchannel manually and use gimp_extension_enable() for watching
temp_procs.
* plug-ins/helpbrowser/helpbrowser.c: removed the same evil code
here and call gimp_extension_enable(). Call gimp_extension_ack()
to let the core know that the temp_proc is installed.
* plug-ins/script-fu/script-fu.c: made all procedures except the
permanently running "extension_script_fu" ordinary GIMP_PLUGIN
procedures.
* plug-ins/common/curve_bend.c
* plug-ins/common/plugindetails.c
* plug-ins/common/screenshot.c
* plug-ins/common/uniteditor.c
* plug-ins/common/winclipboard.c
* plug-ins/dbbrowser/dbbrowser.c
* plug-ins/gfli/gfli.c
* plug-ins/twain/twain.c
* plug-ins/webbrowser/webbrowser.c
* plug-ins/winsnap/winsnap.c: made them all ordinary GIMP_PLUGIN
procedures and renamed them from "extension_*" to "plug_in_*".
Random cleanups.
* app/widgets/gimphelp.c
* plug-ins/maze/maze_face.c: call "plug_in_web_browser" now.
2003-06-20 01:12:00 +08:00
|
|
|
gimp_debug_flags =
|
|
|
|
g_parse_debug_string (debug_string + 1,
|
|
|
|
gimp_debug_keys,
|
|
|
|
G_N_ELEMENTS (gimp_debug_keys));
|
2003-02-10 04:49:38 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (strcmp (env_string, basename) == 0)
|
|
|
|
{
|
|
|
|
gimp_debug_flags = GIMP_DEBUG_DEFAULT;
|
|
|
|
}
|
2013-02-23 23:10:19 +08:00
|
|
|
|
|
|
|
/* make debug output visible by setting G_MESSAGES_DEBUG */
|
|
|
|
debug_messages = g_getenv ("G_MESSAGES_DEBUG");
|
|
|
|
|
|
|
|
if (debug_messages)
|
|
|
|
{
|
|
|
|
gchar *tmp = g_strconcat (debug_messages, ",LibGimp", NULL);
|
|
|
|
g_setenv ("G_MESSAGES_DEBUG", tmp, TRUE);
|
|
|
|
g_free (tmp);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
g_setenv ("G_MESSAGES_DEBUG", "LibGimp", TRUE);
|
|
|
|
}
|
2003-02-10 04:49:38 +08:00
|
|
|
}
|
|
|
|
|
2001-08-30 01:48:28 +08:00
|
|
|
g_free (basename);
|
2000-05-11 05:21:23 +08:00
|
|
|
|
2018-03-05 14:40:59 +08:00
|
|
|
stack_trace_mode = (GimpStackTraceMode) CLAMP (atoi (argv[ARG_STACK_TRACE_MODE]),
|
2005-12-29 05:24:12 +08:00
|
|
|
GIMP_STACK_TRACE_NEVER,
|
|
|
|
GIMP_STACK_TRACE_ALWAYS);
|
2000-07-31 00:25:19 +08:00
|
|
|
|
1999-10-05 03:26:07 +08:00
|
|
|
#ifndef G_OS_WIN32
|
app/appenv.h New file. Includes <math.h>. Move G_PI, RINT(), ROUND() etc
1999-09-01 Tor Lillqvist <tml@iki.fi>
* app/appenv.h
* libgimp/gimpmath.h: New file. Includes <math.h>. Move G_PI,
RINT(), ROUND() etc from app/appenv.h here, so plug-ins can
use them, too. Remove some commented-out old stuff in appenv.h.
* libgimp/gimp.h: Include gimpmath.h.
* libgimp/gimp.c (gimp_main): Win32: Don't install signal
handlers, we can't do anything useful in the handler ourselves
anyway (it would be nice to print out a backtrace, but that seems
pretty hard to do, even if not impossible). Let Windows inform the
user about the crash. If the plug-in was compiled with MSVC, and
the user also has it, she is offered a chance to start the
debugger automatically anyway.
* app/*several*.c: Include gimpmath.h for G_PI etc. Don't include
<math.h>, as gimpmath.h includes it.
* plug-ins/*/*many*.c: Include config.h. Don't include <math.h>.
Remove all the duplicated definitions of G_PI and rint(). Use
RINT() instead of rint().
* app/app_procs.[ch]: app_exit() takes a gboolean.
* app/batch.c
* app/commands.c
* app/interface.c: Call app_exit() with FALSE or TRUE.
* app/main.c (on_error): Call gimp_fatal_error. (main): Don't
install any signal handler on Win32 here, either.
* app/errors.c (gimp_fatal_error, gimp_terminate): Win32: Format
the message and call MessageBox with it. g_on_error_query doesn't
do anything useful on Win32, and printf'ing a message to stdout or
stderr doesn't do anything, either, in a windowing application.
1999-09-02 04:30:56 +08:00
|
|
|
/* No use catching these on Win32, the user won't get any meaningful
|
|
|
|
* stack trace from glib anyhow. It's better to let Windows inform
|
|
|
|
* about the program error, and offer debugging if the plug-in
|
|
|
|
* has been built with MSVC, and the user has MSVC installed.
|
|
|
|
*/
|
2000-05-11 05:21:23 +08:00
|
|
|
gimp_signal_private (SIGHUP, gimp_plugin_sigfatal_handler, 0);
|
|
|
|
gimp_signal_private (SIGINT, gimp_plugin_sigfatal_handler, 0);
|
|
|
|
gimp_signal_private (SIGQUIT, gimp_plugin_sigfatal_handler, 0);
|
2018-04-04 10:03:42 +08:00
|
|
|
gimp_signal_private (SIGTERM, gimp_plugin_sigfatal_handler, 0);
|
|
|
|
|
|
|
|
gimp_signal_private (SIGABRT, gimp_plugin_sigfatal_handler, 0);
|
2000-05-11 05:21:23 +08:00
|
|
|
gimp_signal_private (SIGBUS, gimp_plugin_sigfatal_handler, 0);
|
|
|
|
gimp_signal_private (SIGSEGV, gimp_plugin_sigfatal_handler, 0);
|
|
|
|
gimp_signal_private (SIGFPE, gimp_plugin_sigfatal_handler, 0);
|
|
|
|
|
|
|
|
/* Ignore SIGPIPE from crashing Gimp */
|
|
|
|
gimp_signal_private (SIGPIPE, SIG_IGN, 0);
|
|
|
|
|
|
|
|
/* Restart syscalls interrupted by SIGCHLD */
|
2000-11-09 05:58:22 +08:00
|
|
|
gimp_signal_private (SIGCHLD, SIG_DFL, SA_RESTART);
|
app/appenv.h New file. Includes <math.h>. Move G_PI, RINT(), ROUND() etc
1999-09-01 Tor Lillqvist <tml@iki.fi>
* app/appenv.h
* libgimp/gimpmath.h: New file. Includes <math.h>. Move G_PI,
RINT(), ROUND() etc from app/appenv.h here, so plug-ins can
use them, too. Remove some commented-out old stuff in appenv.h.
* libgimp/gimp.h: Include gimpmath.h.
* libgimp/gimp.c (gimp_main): Win32: Don't install signal
handlers, we can't do anything useful in the handler ourselves
anyway (it would be nice to print out a backtrace, but that seems
pretty hard to do, even if not impossible). Let Windows inform the
user about the crash. If the plug-in was compiled with MSVC, and
the user also has it, she is offered a chance to start the
debugger automatically anyway.
* app/*several*.c: Include gimpmath.h for G_PI etc. Don't include
<math.h>, as gimpmath.h includes it.
* plug-ins/*/*many*.c: Include config.h. Don't include <math.h>.
Remove all the duplicated definitions of G_PI and rint(). Use
RINT() instead of rint().
* app/app_procs.[ch]: app_exit() takes a gboolean.
* app/batch.c
* app/commands.c
* app/interface.c: Call app_exit() with FALSE or TRUE.
* app/main.c (on_error): Call gimp_fatal_error. (main): Don't
install any signal handler on Win32 here, either.
* app/errors.c (gimp_fatal_error, gimp_terminate): Win32: Format
the message and call MessageBox with it. g_on_error_query doesn't
do anything useful on Win32, and printf'ing a message to stdout or
stderr doesn't do anything, either, in a windowing application.
1999-09-02 04:30:56 +08:00
|
|
|
#endif
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2014-08-12 07:01:12 +08:00
|
|
|
#ifdef G_OS_WIN32
|
2019-07-31 05:48:37 +08:00
|
|
|
_gimp_readchannel = g_io_channel_win32_new_fd (atoi (argv[ARG_READ_FD]));
|
|
|
|
_gimp_writechannel = g_io_channel_win32_new_fd (atoi (argv[ARG_WRITE_FD]));
|
2014-08-12 07:01:12 +08:00
|
|
|
#else
|
2019-07-31 05:48:37 +08:00
|
|
|
_gimp_readchannel = g_io_channel_unix_new (atoi (argv[ARG_READ_FD]));
|
|
|
|
_gimp_writechannel = g_io_channel_unix_new (atoi (argv[ARG_WRITE_FD]));
|
2014-08-12 07:01:12 +08:00
|
|
|
#endif
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2019-07-31 05:48:37 +08:00
|
|
|
g_io_channel_set_encoding (_gimp_readchannel, NULL, NULL);
|
|
|
|
g_io_channel_set_encoding (_gimp_writechannel, NULL, NULL);
|
2001-08-30 01:48:28 +08:00
|
|
|
|
2019-07-31 05:48:37 +08:00
|
|
|
g_io_channel_set_buffered (_gimp_readchannel, FALSE);
|
|
|
|
g_io_channel_set_buffered (_gimp_writechannel, FALSE);
|
2001-08-30 09:09:58 +08:00
|
|
|
|
2019-07-31 05:48:37 +08:00
|
|
|
g_io_channel_set_close_on_unref (_gimp_readchannel, TRUE);
|
|
|
|
g_io_channel_set_close_on_unref (_gimp_writechannel, TRUE);
|
2001-08-30 09:09:58 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
gp_init ();
|
2005-12-13 22:11:56 +08:00
|
|
|
|
|
|
|
gimp_wire_set_writer (gimp_write);
|
|
|
|
gimp_wire_set_flusher (gimp_flush);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
app, libgimp, libgimpbase: big plug-in API refactoring part three
- libgimpbase: change GPParam to transfer all information about the
GValues we use, in the same way done for GPParamDef. GPParam is now
different from GimpParam from libgimp, pointers can't be casted any
longer. The protocol is now completely GimpPDBArgType-free. Remove
gp_params_destroy() from the public API.
- libgimp: add API to convert between an array of GPParams and
GimpValueArray, the latter is now the new official API for dealing
with procedure arguments and return values, GimpParam is cruft (the
wire now talks with GimpPlugIn more directly than with the members
of GimpPlugInInfo, which need additional compat conversions).
- libgimp, app: rename gimpgpparamspecs.[ch] to simply
gimpgpparams.[ch] which is also more accurate because they now
contain GValue functions too. The code that used to live in
app/plug-in/plug-in-params.h is now completely in libgimp.
- app: contains no protocol compat code any longer, the only place
that uses GimpPDBArgType is the PDB query procedure implementation,
which also needs to change.
- app: change some forgotten int32 run-modes to enums.
2019-07-29 07:56:58 +08:00
|
|
|
/* initialize GTypes, they need to be known to g_type_from_name() */
|
|
|
|
{
|
|
|
|
GType init_types[] =
|
|
|
|
{
|
|
|
|
GIMP_TYPE_INT32, GIMP_TYPE_PARAM_INT32,
|
|
|
|
GIMP_TYPE_INT16, GIMP_TYPE_PARAM_INT16,
|
|
|
|
GIMP_TYPE_INT8, GIMP_TYPE_PARAM_INT8,
|
|
|
|
|
|
|
|
GIMP_TYPE_PARAM_STRING,
|
|
|
|
|
|
|
|
GIMP_TYPE_ARRAY, GIMP_TYPE_PARAM_ARRAY,
|
|
|
|
GIMP_TYPE_INT8_ARRAY, GIMP_TYPE_PARAM_INT8_ARRAY,
|
|
|
|
GIMP_TYPE_INT16_ARRAY, GIMP_TYPE_PARAM_INT16_ARRAY,
|
|
|
|
GIMP_TYPE_INT32_ARRAY, GIMP_TYPE_PARAM_INT32_ARRAY,
|
|
|
|
GIMP_TYPE_FLOAT_ARRAY, GIMP_TYPE_PARAM_FLOAT_ARRAY,
|
|
|
|
GIMP_TYPE_STRING_ARRAY, GIMP_TYPE_PARAM_STRING_ARRAY,
|
|
|
|
GIMP_TYPE_RGB_ARRAY, GIMP_TYPE_PARAM_RGB_ARRAY,
|
|
|
|
|
|
|
|
GIMP_TYPE_DISPLAY_ID, GIMP_TYPE_PARAM_DISPLAY_ID,
|
|
|
|
GIMP_TYPE_IMAGE_ID, GIMP_TYPE_PARAM_IMAGE_ID,
|
|
|
|
GIMP_TYPE_ITEM_ID, GIMP_TYPE_PARAM_ITEM_ID,
|
|
|
|
GIMP_TYPE_DRAWABLE_ID, GIMP_TYPE_PARAM_DRAWABLE_ID,
|
|
|
|
GIMP_TYPE_LAYER_ID, GIMP_TYPE_PARAM_LAYER_ID,
|
|
|
|
GIMP_TYPE_CHANNEL_ID, GIMP_TYPE_PARAM_CHANNEL_ID,
|
|
|
|
GIMP_TYPE_LAYER_MASK_ID, GIMP_TYPE_PARAM_LAYER_MASK_ID,
|
|
|
|
GIMP_TYPE_SELECTION_ID, GIMP_TYPE_PARAM_SELECTION_ID,
|
|
|
|
GIMP_TYPE_VECTORS_ID, GIMP_TYPE_PARAM_VECTORS_ID
|
|
|
|
};
|
|
|
|
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
for (i = 0; i < G_N_ELEMENTS (init_types); i++, i++)
|
|
|
|
{
|
|
|
|
GType type = init_types[i];
|
|
|
|
|
|
|
|
if (G_TYPE_IS_CLASSED (type))
|
|
|
|
g_type_class_ref (type);
|
|
|
|
}
|
|
|
|
|
|
|
|
gimp_enums_init ();
|
|
|
|
}
|
2003-03-26 00:38:19 +08:00
|
|
|
|
2003-11-16 06:53:28 +08:00
|
|
|
/* initialize units */
|
|
|
|
{
|
2005-09-10 20:21:37 +08:00
|
|
|
GimpUnitVtable vtable;
|
2003-11-16 06:53:28 +08:00
|
|
|
|
|
|
|
vtable.unit_get_number_of_units = _gimp_unit_cache_get_number_of_units;
|
2004-11-20 04:08:14 +08:00
|
|
|
vtable.unit_get_number_of_built_in_units =
|
|
|
|
_gimp_unit_cache_get_number_of_built_in_units;
|
2003-11-16 06:53:28 +08:00
|
|
|
vtable.unit_new = _gimp_unit_cache_new;
|
|
|
|
vtable.unit_get_deletion_flag = _gimp_unit_cache_get_deletion_flag;
|
|
|
|
vtable.unit_set_deletion_flag = _gimp_unit_cache_set_deletion_flag;
|
|
|
|
vtable.unit_get_factor = _gimp_unit_cache_get_factor;
|
|
|
|
vtable.unit_get_digits = _gimp_unit_cache_get_digits;
|
|
|
|
vtable.unit_get_identifier = _gimp_unit_cache_get_identifier;
|
|
|
|
vtable.unit_get_symbol = _gimp_unit_cache_get_symbol;
|
|
|
|
vtable.unit_get_abbreviation = _gimp_unit_cache_get_abbreviation;
|
|
|
|
vtable.unit_get_singular = _gimp_unit_cache_get_singular;
|
|
|
|
vtable.unit_get_plural = _gimp_unit_cache_get_plural;
|
|
|
|
|
|
|
|
gimp_base_init (&vtable);
|
|
|
|
}
|
|
|
|
|
2019-08-03 02:53:43 +08:00
|
|
|
/* initialize i18n support */
|
2003-03-26 00:38:19 +08:00
|
|
|
setlocale (LC_ALL, "");
|
|
|
|
|
|
|
|
bindtextdomain (GETTEXT_PACKAGE"-libgimp", gimp_locale_directory ());
|
|
|
|
#ifdef HAVE_BIND_TEXTDOMAIN_CODESET
|
|
|
|
bind_textdomain_codeset (GETTEXT_PACKAGE"-libgimp", "UTF-8");
|
|
|
|
#endif
|
|
|
|
|
2019-08-03 02:53:43 +08:00
|
|
|
/* set handler both for the "LibGimp" and "" domains */
|
2015-05-20 17:05:45 +08:00
|
|
|
{
|
|
|
|
const gchar * const log_domains[] =
|
|
|
|
{
|
|
|
|
"LibGimp",
|
|
|
|
"LibGimpBase",
|
|
|
|
"LibGimpColor",
|
|
|
|
"LibGimpConfig",
|
|
|
|
"LibGimpMath",
|
|
|
|
"LibGimpModule",
|
|
|
|
"LibGimpThumb",
|
|
|
|
"LibGimpWidgets"
|
|
|
|
};
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
for (i = 0; i < G_N_ELEMENTS (log_domains); i++)
|
|
|
|
g_log_set_handler (log_domains[i],
|
|
|
|
G_LOG_LEVEL_MESSAGE,
|
|
|
|
gimp_message_func,
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
g_log_set_handler (NULL,
|
|
|
|
G_LOG_LEVEL_MESSAGE,
|
|
|
|
gimp_message_func,
|
|
|
|
NULL);
|
|
|
|
}
|
2000-07-31 01:33:37 +08:00
|
|
|
|
2003-02-10 04:49:38 +08:00
|
|
|
if (gimp_debug_flags & GIMP_DEBUG_FATAL_WARNINGS)
|
|
|
|
{
|
|
|
|
GLogLevelFlags fatal_mask;
|
|
|
|
|
|
|
|
fatal_mask = g_log_set_always_fatal (G_LOG_FATAL_MASK);
|
|
|
|
fatal_mask |= G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL;
|
|
|
|
g_log_set_always_fatal (fatal_mask);
|
2018-04-04 10:33:19 +08:00
|
|
|
|
|
|
|
g_log_set_handler (NULL,
|
|
|
|
G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL |
|
|
|
|
G_LOG_LEVEL_ERROR | G_LOG_FLAG_FATAL,
|
2019-08-03 02:53:43 +08:00
|
|
|
gimp_fatal_func,
|
|
|
|
NULL);
|
2018-04-04 10:33:19 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
g_log_set_handler (NULL,
|
|
|
|
G_LOG_LEVEL_ERROR | G_LOG_FLAG_FATAL,
|
2019-08-03 02:53:43 +08:00
|
|
|
gimp_fatal_func,
|
|
|
|
NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (plug_in_type != G_TYPE_NONE)
|
|
|
|
{
|
|
|
|
PLUG_IN = g_object_new (plug_in_type, NULL);
|
|
|
|
|
|
|
|
g_assert (GIMP_IS_PLUG_IN (PLUG_IN));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
PLUG_IN_INFO = *info;
|
2003-02-10 04:49:38 +08:00
|
|
|
}
|
|
|
|
|
2018-03-05 14:40:59 +08:00
|
|
|
if (strcmp (argv[ARG_MODE], "-query") == 0)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2019-07-26 05:07:24 +08:00
|
|
|
if (PLUG_IN)
|
|
|
|
{
|
app, libgimp, libgimpbase: plug-in and PDB protocol refactoring part two
- Change the wire protocol's GPProcInstall to transmit the entire
information needed for constructing all GParamSpecs we use, don't
use GimpPDBArgType in GPProcInstall but an enum private to the wire
protocol plus the GParamSpec's GType name. Bump the wire protocol
version.
- Add gimpgpparamspecs.[ch] in both app/plug-in/ and libgimp/ which
take care of converting between GPParamDef and GParamSpec. They
share code as far as possible.
- Change pluginrc writing and parsing to re-use GPParamDef and the
utility functions from gimpgpparamspecs.
- Remove gimp_pdb_compat_param_spec() from app/pdb/gimp-pdb-compat.[ch],
the entire core uses proper GParamSpecs from the wire protocol now,
the whole file will follow down the drain once we use a GValue
representation on the wire too.
- In gimp_plug_in_handle_proc_install(), change the "run-mode"
parameter to a GParamSpecEnum(GIMP_TYPE_RUN_MODE) (if it is not
already an enum). and change all places in app/ to treat it as an
enum value.
- plug-ins: fix cml-explorer to register correctly, a typo in
"run-mode" was never noticed until now.
- Add gimpgpcompat.[ch] in libgimp to deal with all the transforms
between old-style wire communication and using GParamSpec and
GValue, it contains some functions that are subject to change or
even removal in the next steps.
- Change the libgimp GimpProcedure and GimpPlugIn in many ways to be
able to actually install procedures the new way.
- plug-ins: change goat-exercise to completely use the new GimpPlugIn
and GimpProcedure API, look here to see how plug-ins will look in
the future, of course subject to change until this is finished.
- Next: changing GPParam to transmit all information about a GValue.
2019-07-27 22:37:55 +08:00
|
|
|
if (GIMP_PLUG_IN_GET_CLASS (PLUG_IN)->init_procedures)
|
2019-07-31 05:48:37 +08:00
|
|
|
gp_has_init_write (_gimp_writechannel, NULL);
|
2019-07-26 05:07:24 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (PLUG_IN_INFO.init_proc)
|
2019-07-31 05:48:37 +08:00
|
|
|
gp_has_init_write (_gimp_writechannel, NULL);
|
2019-07-26 05:07:24 +08:00
|
|
|
}
|
2003-02-10 04:49:38 +08:00
|
|
|
|
|
|
|
if (gimp_debug_flags & GIMP_DEBUG_QUERY)
|
|
|
|
gimp_debug_stop ();
|
|
|
|
|
2019-07-26 05:07:24 +08:00
|
|
|
if (PLUG_IN)
|
|
|
|
{
|
|
|
|
_gimp_plug_in_query (PLUG_IN);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (PLUG_IN_INFO.query_proc)
|
|
|
|
PLUG_IN_INFO.query_proc ();
|
|
|
|
}
|
2003-11-08 01:29:02 +08:00
|
|
|
|
2019-08-03 00:44:34 +08:00
|
|
|
gimp_close ();
|
2004-02-17 22:03:07 +08:00
|
|
|
|
|
|
|
return EXIT_SUCCESS;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2018-03-05 14:40:59 +08:00
|
|
|
if (strcmp (argv[ARG_MODE], "-init") == 0)
|
2002-02-12 10:41:01 +08:00
|
|
|
{
|
2003-02-10 04:49:38 +08:00
|
|
|
if (gimp_debug_flags & GIMP_DEBUG_INIT)
|
|
|
|
gimp_debug_stop ();
|
|
|
|
|
2019-07-26 05:07:24 +08:00
|
|
|
if (PLUG_IN)
|
|
|
|
{
|
|
|
|
_gimp_plug_in_init (PLUG_IN);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (PLUG_IN_INFO.init_proc)
|
|
|
|
PLUG_IN_INFO.init_proc ();
|
|
|
|
}
|
2003-11-08 01:29:02 +08:00
|
|
|
|
2019-08-03 00:44:34 +08:00
|
|
|
gimp_close ();
|
2004-02-17 22:03:07 +08:00
|
|
|
|
|
|
|
return EXIT_SUCCESS;
|
2002-02-12 10:41:01 +08:00
|
|
|
}
|
|
|
|
|
2003-02-10 04:49:38 +08:00
|
|
|
if (gimp_debug_flags & GIMP_DEBUG_RUN)
|
|
|
|
gimp_debug_stop ();
|
|
|
|
else if (gimp_debug_flags & GIMP_DEBUG_PID)
|
Changed the semantics of GIMP_EXTENSION and (to some extent) of
2003-06-19 Michael Natterer <mitch@gimp.org>
Changed the semantics of GIMP_EXTENSION and (to some extent)
of GIMP_PLUGIN:
The old meaning of EXTENSION was "I live in the toolbox" and
PLUGIN meant "I take RUN-MODE,IMAGE,DRAWABLE args (but only if I
am invoked interactively)". This is completely useless, since
living in the toolbox means having "<Toolbox>" in the menu_path
and taking RUN-MODE,IMAGE,DRAWABLE means just that, regardless of
what type of procedure we are.
The new meaning of GIMP_PLUGIN is just "I am an ordinary procedure,
I am invoked, do my job and finish", while GIMP_EXTENSION means
"I will install temporary procedures and I will keep running to
keep them available".
(A GIMP_EXTENSION *must* call gimp_extension_ack() now to tell the
core that it's ready to run, or the core will block waiting for
the message !!!).
* configure.in: bumped version number to 1.3.16.
* libgimpbase/gimpprotocol.h: increased protocol version number so
old extensions will refuse to load.
* app/gui/plug-in-commands.c (plug_in_run_cmd_callback): don't
blindly pass RUN-MODE,IMAGE,DRAWABLE to GIMP_PLUGIN procedures but
look at their parameters and pass them either RUN-MODE, or
RUN-MODE,IMAGE, or RUN-MODE,IMAGE,DRAWABLE.
* app/pdb/procedural_db.c: cleaned up, better error reporting,
replaced an impossible error message by g_return_if_fail()
* app/plug-in/plug-in-message.c (plug_in_handle_proc_install):
better error messages.
* app/plug-in/plug-in-params.c: allocate parameter arrays using
g_new0() so we don't have to worry about uninitialized stuff
later.
* app/plug-in/plug-in-run.c (plug_in_run): wait for
gimp_extension_ack() installation confirmation for ALL extensions,
not just for automatically started ones.
* app/plug-in/plug-ins.c: cleanup.
* libgimp/gimp.[ch]: cleaned up and API-documented massively. Made
all magic values given in the GPConfig message static and added
accessor functions for them. Added gimp_tile_width()/height().
Added new function gimp_extension_enable() which turns on
asynchronous processing of temp_proc run requests without having
to enter an endless gimp_extension_process() loop. Moved all
private functions to the end of the file. Added tons of
g_return_if_fail() all over the place. Call gimp_run_procedure2()
from gimp_run_procedure() instead of duplicating the
code. Indentation, spacing, stuff...
* libgimp/gimptile.[ch]: removed gimp_tile_width()/height().
* libgimp/gimpdrawable.c
* libgimp/gimppixelrgn.c
* libgimp/gimptile.c: use the gimp_tile_width()/height() accessor
functions.
* libgimp/gimp.def: added gimp_extension_enable.
* libgimp/gimpmenu.c: removed evil code which connected to
_readchannel manually and use gimp_extension_enable() for watching
temp_procs.
* plug-ins/helpbrowser/helpbrowser.c: removed the same evil code
here and call gimp_extension_enable(). Call gimp_extension_ack()
to let the core know that the temp_proc is installed.
* plug-ins/script-fu/script-fu.c: made all procedures except the
permanently running "extension_script_fu" ordinary GIMP_PLUGIN
procedures.
* plug-ins/common/curve_bend.c
* plug-ins/common/plugindetails.c
* plug-ins/common/screenshot.c
* plug-ins/common/uniteditor.c
* plug-ins/common/winclipboard.c
* plug-ins/dbbrowser/dbbrowser.c
* plug-ins/gfli/gfli.c
* plug-ins/twain/twain.c
* plug-ins/webbrowser/webbrowser.c
* plug-ins/winsnap/winsnap.c: made them all ordinary GIMP_PLUGIN
procedures and renamed them from "extension_*" to "plug_in_*".
Random cleanups.
* app/widgets/gimphelp.c
* plug-ins/maze/maze_face.c: call "plug_in_web_browser" now.
2003-06-20 01:12:00 +08:00
|
|
|
g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Here I am!");
|
2003-02-10 04:49:38 +08:00
|
|
|
|
2019-07-31 05:48:37 +08:00
|
|
|
g_io_add_watch (_gimp_readchannel,
|
2005-12-29 05:24:12 +08:00
|
|
|
G_IO_ERR | G_IO_HUP,
|
|
|
|
gimp_plugin_io_error_handler,
|
|
|
|
NULL);
|
2000-05-11 05:21:23 +08:00
|
|
|
|
2019-08-02 23:04:24 +08:00
|
|
|
if (PLUG_IN)
|
|
|
|
{
|
|
|
|
_gimp_plug_in_run (PLUG_IN);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
_gimp_loop (PLUG_IN_INFO.run_proc);
|
|
|
|
}
|
2004-02-17 22:03:07 +08:00
|
|
|
|
2019-08-03 00:44:34 +08:00
|
|
|
gimp_close ();
|
|
|
|
|
2004-02-17 22:03:07 +08:00
|
|
|
return EXIT_SUCCESS;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2019-08-03 18:17:38 +08:00
|
|
|
/**
|
|
|
|
* gimp_get_plug_in:
|
|
|
|
*
|
|
|
|
* This function returns the plug-in's #GimpPlugIn instance, which can
|
|
|
|
* exist exactly once per running plug-in program.
|
|
|
|
*
|
|
|
|
* Returns: The plug-in's #GimpPlugIn singleton, or %NULL.
|
|
|
|
*
|
|
|
|
* Since: 3.0
|
|
|
|
**/
|
|
|
|
GimpPlugIn *
|
|
|
|
gimp_get_plug_in (void)
|
|
|
|
{
|
|
|
|
return PLUG_IN;
|
|
|
|
}
|
|
|
|
|
Changed the semantics of GIMP_EXTENSION and (to some extent) of
2003-06-19 Michael Natterer <mitch@gimp.org>
Changed the semantics of GIMP_EXTENSION and (to some extent)
of GIMP_PLUGIN:
The old meaning of EXTENSION was "I live in the toolbox" and
PLUGIN meant "I take RUN-MODE,IMAGE,DRAWABLE args (but only if I
am invoked interactively)". This is completely useless, since
living in the toolbox means having "<Toolbox>" in the menu_path
and taking RUN-MODE,IMAGE,DRAWABLE means just that, regardless of
what type of procedure we are.
The new meaning of GIMP_PLUGIN is just "I am an ordinary procedure,
I am invoked, do my job and finish", while GIMP_EXTENSION means
"I will install temporary procedures and I will keep running to
keep them available".
(A GIMP_EXTENSION *must* call gimp_extension_ack() now to tell the
core that it's ready to run, or the core will block waiting for
the message !!!).
* configure.in: bumped version number to 1.3.16.
* libgimpbase/gimpprotocol.h: increased protocol version number so
old extensions will refuse to load.
* app/gui/plug-in-commands.c (plug_in_run_cmd_callback): don't
blindly pass RUN-MODE,IMAGE,DRAWABLE to GIMP_PLUGIN procedures but
look at their parameters and pass them either RUN-MODE, or
RUN-MODE,IMAGE, or RUN-MODE,IMAGE,DRAWABLE.
* app/pdb/procedural_db.c: cleaned up, better error reporting,
replaced an impossible error message by g_return_if_fail()
* app/plug-in/plug-in-message.c (plug_in_handle_proc_install):
better error messages.
* app/plug-in/plug-in-params.c: allocate parameter arrays using
g_new0() so we don't have to worry about uninitialized stuff
later.
* app/plug-in/plug-in-run.c (plug_in_run): wait for
gimp_extension_ack() installation confirmation for ALL extensions,
not just for automatically started ones.
* app/plug-in/plug-ins.c: cleanup.
* libgimp/gimp.[ch]: cleaned up and API-documented massively. Made
all magic values given in the GPConfig message static and added
accessor functions for them. Added gimp_tile_width()/height().
Added new function gimp_extension_enable() which turns on
asynchronous processing of temp_proc run requests without having
to enter an endless gimp_extension_process() loop. Moved all
private functions to the end of the file. Added tons of
g_return_if_fail() all over the place. Call gimp_run_procedure2()
from gimp_run_procedure() instead of duplicating the
code. Indentation, spacing, stuff...
* libgimp/gimptile.[ch]: removed gimp_tile_width()/height().
* libgimp/gimpdrawable.c
* libgimp/gimppixelrgn.c
* libgimp/gimptile.c: use the gimp_tile_width()/height() accessor
functions.
* libgimp/gimp.def: added gimp_extension_enable.
* libgimp/gimpmenu.c: removed evil code which connected to
_readchannel manually and use gimp_extension_enable() for watching
temp_procs.
* plug-ins/helpbrowser/helpbrowser.c: removed the same evil code
here and call gimp_extension_enable(). Call gimp_extension_ack()
to let the core know that the temp_proc is installed.
* plug-ins/script-fu/script-fu.c: made all procedures except the
permanently running "extension_script_fu" ordinary GIMP_PLUGIN
procedures.
* plug-ins/common/curve_bend.c
* plug-ins/common/plugindetails.c
* plug-ins/common/screenshot.c
* plug-ins/common/uniteditor.c
* plug-ins/common/winclipboard.c
* plug-ins/dbbrowser/dbbrowser.c
* plug-ins/gfli/gfli.c
* plug-ins/twain/twain.c
* plug-ins/webbrowser/webbrowser.c
* plug-ins/winsnap/winsnap.c: made them all ordinary GIMP_PLUGIN
procedures and renamed them from "extension_*" to "plug_in_*".
Random cleanups.
* app/widgets/gimphelp.c
* plug-ins/maze/maze_face.c: call "plug_in_web_browser" now.
2003-06-20 01:12:00 +08:00
|
|
|
/**
|
|
|
|
* gimp_quit:
|
2003-11-08 01:29:02 +08:00
|
|
|
*
|
2007-02-16 19:09:09 +08:00
|
|
|
* Forcefully causes the GIMP library to exit and close down its
|
Changed the semantics of GIMP_EXTENSION and (to some extent) of
2003-06-19 Michael Natterer <mitch@gimp.org>
Changed the semantics of GIMP_EXTENSION and (to some extent)
of GIMP_PLUGIN:
The old meaning of EXTENSION was "I live in the toolbox" and
PLUGIN meant "I take RUN-MODE,IMAGE,DRAWABLE args (but only if I
am invoked interactively)". This is completely useless, since
living in the toolbox means having "<Toolbox>" in the menu_path
and taking RUN-MODE,IMAGE,DRAWABLE means just that, regardless of
what type of procedure we are.
The new meaning of GIMP_PLUGIN is just "I am an ordinary procedure,
I am invoked, do my job and finish", while GIMP_EXTENSION means
"I will install temporary procedures and I will keep running to
keep them available".
(A GIMP_EXTENSION *must* call gimp_extension_ack() now to tell the
core that it's ready to run, or the core will block waiting for
the message !!!).
* configure.in: bumped version number to 1.3.16.
* libgimpbase/gimpprotocol.h: increased protocol version number so
old extensions will refuse to load.
* app/gui/plug-in-commands.c (plug_in_run_cmd_callback): don't
blindly pass RUN-MODE,IMAGE,DRAWABLE to GIMP_PLUGIN procedures but
look at their parameters and pass them either RUN-MODE, or
RUN-MODE,IMAGE, or RUN-MODE,IMAGE,DRAWABLE.
* app/pdb/procedural_db.c: cleaned up, better error reporting,
replaced an impossible error message by g_return_if_fail()
* app/plug-in/plug-in-message.c (plug_in_handle_proc_install):
better error messages.
* app/plug-in/plug-in-params.c: allocate parameter arrays using
g_new0() so we don't have to worry about uninitialized stuff
later.
* app/plug-in/plug-in-run.c (plug_in_run): wait for
gimp_extension_ack() installation confirmation for ALL extensions,
not just for automatically started ones.
* app/plug-in/plug-ins.c: cleanup.
* libgimp/gimp.[ch]: cleaned up and API-documented massively. Made
all magic values given in the GPConfig message static and added
accessor functions for them. Added gimp_tile_width()/height().
Added new function gimp_extension_enable() which turns on
asynchronous processing of temp_proc run requests without having
to enter an endless gimp_extension_process() loop. Moved all
private functions to the end of the file. Added tons of
g_return_if_fail() all over the place. Call gimp_run_procedure2()
from gimp_run_procedure() instead of duplicating the
code. Indentation, spacing, stuff...
* libgimp/gimptile.[ch]: removed gimp_tile_width()/height().
* libgimp/gimpdrawable.c
* libgimp/gimppixelrgn.c
* libgimp/gimptile.c: use the gimp_tile_width()/height() accessor
functions.
* libgimp/gimp.def: added gimp_extension_enable.
* libgimp/gimpmenu.c: removed evil code which connected to
_readchannel manually and use gimp_extension_enable() for watching
temp_procs.
* plug-ins/helpbrowser/helpbrowser.c: removed the same evil code
here and call gimp_extension_enable(). Call gimp_extension_ack()
to let the core know that the temp_proc is installed.
* plug-ins/script-fu/script-fu.c: made all procedures except the
permanently running "extension_script_fu" ordinary GIMP_PLUGIN
procedures.
* plug-ins/common/curve_bend.c
* plug-ins/common/plugindetails.c
* plug-ins/common/screenshot.c
* plug-ins/common/uniteditor.c
* plug-ins/common/winclipboard.c
* plug-ins/dbbrowser/dbbrowser.c
* plug-ins/gfli/gfli.c
* plug-ins/twain/twain.c
* plug-ins/webbrowser/webbrowser.c
* plug-ins/winsnap/winsnap.c: made them all ordinary GIMP_PLUGIN
procedures and renamed them from "extension_*" to "plug_in_*".
Random cleanups.
* app/widgets/gimphelp.c
* plug-ins/maze/maze_face.c: call "plug_in_web_browser" now.
2003-06-20 01:12:00 +08:00
|
|
|
* connection to main gimp application. This function never returns.
|
|
|
|
**/
|
1999-03-13 05:30:44 +08:00
|
|
|
void
|
1999-10-05 03:26:07 +08:00
|
|
|
gimp_quit (void)
|
1999-03-13 05:30:44 +08:00
|
|
|
{
|
2019-08-03 00:44:34 +08:00
|
|
|
gimp_close ();
|
2004-02-17 22:03:07 +08:00
|
|
|
|
2018-04-05 00:04:34 +08:00
|
|
|
#if defined G_OS_WIN32 && defined HAVE_EXCHNDL
|
|
|
|
if (plug_in_backtrace_path)
|
|
|
|
g_free (plug_in_backtrace_path);
|
|
|
|
#endif
|
|
|
|
|
2004-02-17 22:03:07 +08:00
|
|
|
exit (EXIT_SUCCESS);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2019-07-29 18:53:27 +08:00
|
|
|
GimpValueArray *
|
|
|
|
gimp_run_procedure_with_array (const gchar *name,
|
|
|
|
GimpValueArray *arguments)
|
|
|
|
{
|
|
|
|
GPProcRun proc_run;
|
|
|
|
GPProcReturn *proc_return;
|
|
|
|
GimpWireMessage msg;
|
|
|
|
GimpValueArray *return_values;
|
|
|
|
|
|
|
|
g_return_val_if_fail (name != NULL, NULL);
|
|
|
|
g_return_val_if_fail (arguments != NULL, NULL);
|
|
|
|
|
Changed the semantics of GIMP_EXTENSION and (to some extent) of
2003-06-19 Michael Natterer <mitch@gimp.org>
Changed the semantics of GIMP_EXTENSION and (to some extent)
of GIMP_PLUGIN:
The old meaning of EXTENSION was "I live in the toolbox" and
PLUGIN meant "I take RUN-MODE,IMAGE,DRAWABLE args (but only if I
am invoked interactively)". This is completely useless, since
living in the toolbox means having "<Toolbox>" in the menu_path
and taking RUN-MODE,IMAGE,DRAWABLE means just that, regardless of
what type of procedure we are.
The new meaning of GIMP_PLUGIN is just "I am an ordinary procedure,
I am invoked, do my job and finish", while GIMP_EXTENSION means
"I will install temporary procedures and I will keep running to
keep them available".
(A GIMP_EXTENSION *must* call gimp_extension_ack() now to tell the
core that it's ready to run, or the core will block waiting for
the message !!!).
* configure.in: bumped version number to 1.3.16.
* libgimpbase/gimpprotocol.h: increased protocol version number so
old extensions will refuse to load.
* app/gui/plug-in-commands.c (plug_in_run_cmd_callback): don't
blindly pass RUN-MODE,IMAGE,DRAWABLE to GIMP_PLUGIN procedures but
look at their parameters and pass them either RUN-MODE, or
RUN-MODE,IMAGE, or RUN-MODE,IMAGE,DRAWABLE.
* app/pdb/procedural_db.c: cleaned up, better error reporting,
replaced an impossible error message by g_return_if_fail()
* app/plug-in/plug-in-message.c (plug_in_handle_proc_install):
better error messages.
* app/plug-in/plug-in-params.c: allocate parameter arrays using
g_new0() so we don't have to worry about uninitialized stuff
later.
* app/plug-in/plug-in-run.c (plug_in_run): wait for
gimp_extension_ack() installation confirmation for ALL extensions,
not just for automatically started ones.
* app/plug-in/plug-ins.c: cleanup.
* libgimp/gimp.[ch]: cleaned up and API-documented massively. Made
all magic values given in the GPConfig message static and added
accessor functions for them. Added gimp_tile_width()/height().
Added new function gimp_extension_enable() which turns on
asynchronous processing of temp_proc run requests without having
to enter an endless gimp_extension_process() loop. Moved all
private functions to the end of the file. Added tons of
g_return_if_fail() all over the place. Call gimp_run_procedure2()
from gimp_run_procedure() instead of duplicating the
code. Indentation, spacing, stuff...
* libgimp/gimptile.[ch]: removed gimp_tile_width()/height().
* libgimp/gimpdrawable.c
* libgimp/gimppixelrgn.c
* libgimp/gimptile.c: use the gimp_tile_width()/height() accessor
functions.
* libgimp/gimp.def: added gimp_extension_enable.
* libgimp/gimpmenu.c: removed evil code which connected to
_readchannel manually and use gimp_extension_enable() for watching
temp_procs.
* plug-ins/helpbrowser/helpbrowser.c: removed the same evil code
here and call gimp_extension_enable(). Call gimp_extension_ack()
to let the core know that the temp_proc is installed.
* plug-ins/script-fu/script-fu.c: made all procedures except the
permanently running "extension_script_fu" ordinary GIMP_PLUGIN
procedures.
* plug-ins/common/curve_bend.c
* plug-ins/common/plugindetails.c
* plug-ins/common/screenshot.c
* plug-ins/common/uniteditor.c
* plug-ins/common/winclipboard.c
* plug-ins/dbbrowser/dbbrowser.c
* plug-ins/gfli/gfli.c
* plug-ins/twain/twain.c
* plug-ins/webbrowser/webbrowser.c
* plug-ins/winsnap/winsnap.c: made them all ordinary GIMP_PLUGIN
procedures and renamed them from "extension_*" to "plug_in_*".
Random cleanups.
* app/widgets/gimphelp.c
* plug-ins/maze/maze_face.c: call "plug_in_web_browser" now.
2003-06-20 01:12:00 +08:00
|
|
|
proc_run.name = (gchar *) name;
|
app, libgimp, libgimpbase: big plug-in API refactoring part three
- libgimpbase: change GPParam to transfer all information about the
GValues we use, in the same way done for GPParamDef. GPParam is now
different from GimpParam from libgimp, pointers can't be casted any
longer. The protocol is now completely GimpPDBArgType-free. Remove
gp_params_destroy() from the public API.
- libgimp: add API to convert between an array of GPParams and
GimpValueArray, the latter is now the new official API for dealing
with procedure arguments and return values, GimpParam is cruft (the
wire now talks with GimpPlugIn more directly than with the members
of GimpPlugInInfo, which need additional compat conversions).
- libgimp, app: rename gimpgpparamspecs.[ch] to simply
gimpgpparams.[ch] which is also more accurate because they now
contain GValue functions too. The code that used to live in
app/plug-in/plug-in-params.h is now completely in libgimp.
- app: contains no protocol compat code any longer, the only place
that uses GimpPDBArgType is the PDB query procedure implementation,
which also needs to change.
- app: change some forgotten int32 run-modes to enums.
2019-07-29 07:56:58 +08:00
|
|
|
proc_run.nparams = gimp_value_array_length (arguments);
|
|
|
|
proc_run.params = _gimp_value_array_to_gp_params (arguments, FALSE);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2017-05-21 21:13:33 +08:00
|
|
|
gp_lock ();
|
2019-07-31 05:48:37 +08:00
|
|
|
if (! gp_proc_run_write (_gimp_writechannel, &proc_run, NULL))
|
1997-11-25 06:05:25 +08:00
|
|
|
gimp_quit ();
|
|
|
|
|
2019-08-03 18:50:34 +08:00
|
|
|
if (PLUG_IN)
|
|
|
|
_gimp_plug_in_read_expect_msg (PLUG_IN, &msg, GP_PROC_RETURN);
|
|
|
|
else
|
|
|
|
_gimp_read_expect_msg (&msg, GP_PROC_RETURN);
|
2017-05-21 21:13:33 +08:00
|
|
|
gp_unlock ();
|
Changed the semantics of GIMP_EXTENSION and (to some extent) of
2003-06-19 Michael Natterer <mitch@gimp.org>
Changed the semantics of GIMP_EXTENSION and (to some extent)
of GIMP_PLUGIN:
The old meaning of EXTENSION was "I live in the toolbox" and
PLUGIN meant "I take RUN-MODE,IMAGE,DRAWABLE args (but only if I
am invoked interactively)". This is completely useless, since
living in the toolbox means having "<Toolbox>" in the menu_path
and taking RUN-MODE,IMAGE,DRAWABLE means just that, regardless of
what type of procedure we are.
The new meaning of GIMP_PLUGIN is just "I am an ordinary procedure,
I am invoked, do my job and finish", while GIMP_EXTENSION means
"I will install temporary procedures and I will keep running to
keep them available".
(A GIMP_EXTENSION *must* call gimp_extension_ack() now to tell the
core that it's ready to run, or the core will block waiting for
the message !!!).
* configure.in: bumped version number to 1.3.16.
* libgimpbase/gimpprotocol.h: increased protocol version number so
old extensions will refuse to load.
* app/gui/plug-in-commands.c (plug_in_run_cmd_callback): don't
blindly pass RUN-MODE,IMAGE,DRAWABLE to GIMP_PLUGIN procedures but
look at their parameters and pass them either RUN-MODE, or
RUN-MODE,IMAGE, or RUN-MODE,IMAGE,DRAWABLE.
* app/pdb/procedural_db.c: cleaned up, better error reporting,
replaced an impossible error message by g_return_if_fail()
* app/plug-in/plug-in-message.c (plug_in_handle_proc_install):
better error messages.
* app/plug-in/plug-in-params.c: allocate parameter arrays using
g_new0() so we don't have to worry about uninitialized stuff
later.
* app/plug-in/plug-in-run.c (plug_in_run): wait for
gimp_extension_ack() installation confirmation for ALL extensions,
not just for automatically started ones.
* app/plug-in/plug-ins.c: cleanup.
* libgimp/gimp.[ch]: cleaned up and API-documented massively. Made
all magic values given in the GPConfig message static and added
accessor functions for them. Added gimp_tile_width()/height().
Added new function gimp_extension_enable() which turns on
asynchronous processing of temp_proc run requests without having
to enter an endless gimp_extension_process() loop. Moved all
private functions to the end of the file. Added tons of
g_return_if_fail() all over the place. Call gimp_run_procedure2()
from gimp_run_procedure() instead of duplicating the
code. Indentation, spacing, stuff...
* libgimp/gimptile.[ch]: removed gimp_tile_width()/height().
* libgimp/gimpdrawable.c
* libgimp/gimppixelrgn.c
* libgimp/gimptile.c: use the gimp_tile_width()/height() accessor
functions.
* libgimp/gimp.def: added gimp_extension_enable.
* libgimp/gimpmenu.c: removed evil code which connected to
_readchannel manually and use gimp_extension_enable() for watching
temp_procs.
* plug-ins/helpbrowser/helpbrowser.c: removed the same evil code
here and call gimp_extension_enable(). Call gimp_extension_ack()
to let the core know that the temp_proc is installed.
* plug-ins/script-fu/script-fu.c: made all procedures except the
permanently running "extension_script_fu" ordinary GIMP_PLUGIN
procedures.
* plug-ins/common/curve_bend.c
* plug-ins/common/plugindetails.c
* plug-ins/common/screenshot.c
* plug-ins/common/uniteditor.c
* plug-ins/common/winclipboard.c
* plug-ins/dbbrowser/dbbrowser.c
* plug-ins/gfli/gfli.c
* plug-ins/twain/twain.c
* plug-ins/webbrowser/webbrowser.c
* plug-ins/winsnap/winsnap.c: made them all ordinary GIMP_PLUGIN
procedures and renamed them from "extension_*" to "plug_in_*".
Random cleanups.
* app/widgets/gimphelp.c
* plug-ins/maze/maze_face.c: call "plug_in_web_browser" now.
2003-06-20 01:12:00 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
proc_return = msg.data;
|
2005-01-15 20:09:25 +08:00
|
|
|
|
app, libgimp, libgimpbase: big plug-in API refactoring part three
- libgimpbase: change GPParam to transfer all information about the
GValues we use, in the same way done for GPParamDef. GPParam is now
different from GimpParam from libgimp, pointers can't be casted any
longer. The protocol is now completely GimpPDBArgType-free. Remove
gp_params_destroy() from the public API.
- libgimp: add API to convert between an array of GPParams and
GimpValueArray, the latter is now the new official API for dealing
with procedure arguments and return values, GimpParam is cruft (the
wire now talks with GimpPlugIn more directly than with the members
of GimpPlugInInfo, which need additional compat conversions).
- libgimp, app: rename gimpgpparamspecs.[ch] to simply
gimpgpparams.[ch] which is also more accurate because they now
contain GValue functions too. The code that used to live in
app/plug-in/plug-in-params.h is now completely in libgimp.
- app: contains no protocol compat code any longer, the only place
that uses GimpPDBArgType is the PDB query procedure implementation,
which also needs to change.
- app: change some forgotten int32 run-modes to enums.
2019-07-29 07:56:58 +08:00
|
|
|
return_values = _gimp_gp_params_to_value_array (NULL, 0,
|
|
|
|
proc_return->params,
|
|
|
|
proc_return->nparams,
|
|
|
|
TRUE, FALSE);
|
2007-05-22 20:36:10 +08:00
|
|
|
|
2019-07-29 18:53:27 +08:00
|
|
|
gimp_wire_destroy (&msg);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2019-07-29 18:42:47 +08:00
|
|
|
gimp_set_pdb_error (return_values);
|
|
|
|
|
2019-07-29 18:53:27 +08:00
|
|
|
return return_values;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2008-08-17 01:18:13 +08:00
|
|
|
/**
|
|
|
|
* gimp_get_pdb_error:
|
|
|
|
*
|
|
|
|
* Retrieves the error message from the last procedure call.
|
|
|
|
*
|
|
|
|
* If a procedure call fails, then it might pass an error message with
|
|
|
|
* the return values. Plug-ins that are using the libgimp C wrappers
|
2016-06-26 04:54:10 +08:00
|
|
|
* don't access the procedure return values directly. Thus libgimp
|
2008-08-17 01:18:13 +08:00
|
|
|
* stores the error message and makes it available with this
|
2008-08-17 02:20:06 +08:00
|
|
|
* function. The next procedure call unsets the error message again.
|
2008-08-17 01:18:13 +08:00
|
|
|
*
|
|
|
|
* The returned string is owned by libgimp and must not be freed or
|
|
|
|
* modified.
|
|
|
|
*
|
2019-08-03 06:10:14 +08:00
|
|
|
* Returns: the error message
|
2008-08-17 01:18:13 +08:00
|
|
|
*
|
2015-06-01 03:18:09 +08:00
|
|
|
* Since: 2.6
|
2008-08-17 01:18:13 +08:00
|
|
|
**/
|
|
|
|
const gchar *
|
|
|
|
gimp_get_pdb_error (void)
|
|
|
|
{
|
|
|
|
if (pdb_error_message && strlen (pdb_error_message))
|
|
|
|
return pdb_error_message;
|
|
|
|
|
|
|
|
switch (pdb_error_status)
|
|
|
|
{
|
|
|
|
case GIMP_PDB_SUCCESS:
|
2008-08-17 02:20:06 +08:00
|
|
|
/* procedure executed successfully */
|
2008-08-17 01:18:13 +08:00
|
|
|
return _("success");
|
|
|
|
|
|
|
|
case GIMP_PDB_EXECUTION_ERROR:
|
2008-08-17 02:20:06 +08:00
|
|
|
/* procedure execution failed */
|
2008-08-17 01:18:13 +08:00
|
|
|
return _("execution error");
|
|
|
|
|
|
|
|
case GIMP_PDB_CALLING_ERROR:
|
2008-08-17 02:20:06 +08:00
|
|
|
/* procedure called incorrectly */
|
2008-08-17 01:18:13 +08:00
|
|
|
return _("calling error");
|
|
|
|
|
|
|
|
case GIMP_PDB_CANCEL:
|
2008-08-17 02:20:06 +08:00
|
|
|
/* procedure execution cancelled */
|
2008-08-17 01:18:13 +08:00
|
|
|
return _("cancelled");
|
|
|
|
|
|
|
|
default:
|
|
|
|
return "invalid return status";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-01-19 21:15:47 +08:00
|
|
|
/**
|
|
|
|
* gimp_get_pdb_status:
|
|
|
|
*
|
|
|
|
* Retrieves the status from the last procedure call.
|
|
|
|
*
|
2019-08-03 06:10:14 +08:00
|
|
|
* Returns: the #GimpPDBStatusType.
|
2018-01-19 21:15:47 +08:00
|
|
|
*
|
|
|
|
* Since: 2.10
|
|
|
|
**/
|
|
|
|
GimpPDBStatusType
|
|
|
|
gimp_get_pdb_status (void)
|
|
|
|
{
|
|
|
|
return pdb_error_status;
|
|
|
|
}
|
|
|
|
|
Changed the semantics of GIMP_EXTENSION and (to some extent) of
2003-06-19 Michael Natterer <mitch@gimp.org>
Changed the semantics of GIMP_EXTENSION and (to some extent)
of GIMP_PLUGIN:
The old meaning of EXTENSION was "I live in the toolbox" and
PLUGIN meant "I take RUN-MODE,IMAGE,DRAWABLE args (but only if I
am invoked interactively)". This is completely useless, since
living in the toolbox means having "<Toolbox>" in the menu_path
and taking RUN-MODE,IMAGE,DRAWABLE means just that, regardless of
what type of procedure we are.
The new meaning of GIMP_PLUGIN is just "I am an ordinary procedure,
I am invoked, do my job and finish", while GIMP_EXTENSION means
"I will install temporary procedures and I will keep running to
keep them available".
(A GIMP_EXTENSION *must* call gimp_extension_ack() now to tell the
core that it's ready to run, or the core will block waiting for
the message !!!).
* configure.in: bumped version number to 1.3.16.
* libgimpbase/gimpprotocol.h: increased protocol version number so
old extensions will refuse to load.
* app/gui/plug-in-commands.c (plug_in_run_cmd_callback): don't
blindly pass RUN-MODE,IMAGE,DRAWABLE to GIMP_PLUGIN procedures but
look at their parameters and pass them either RUN-MODE, or
RUN-MODE,IMAGE, or RUN-MODE,IMAGE,DRAWABLE.
* app/pdb/procedural_db.c: cleaned up, better error reporting,
replaced an impossible error message by g_return_if_fail()
* app/plug-in/plug-in-message.c (plug_in_handle_proc_install):
better error messages.
* app/plug-in/plug-in-params.c: allocate parameter arrays using
g_new0() so we don't have to worry about uninitialized stuff
later.
* app/plug-in/plug-in-run.c (plug_in_run): wait for
gimp_extension_ack() installation confirmation for ALL extensions,
not just for automatically started ones.
* app/plug-in/plug-ins.c: cleanup.
* libgimp/gimp.[ch]: cleaned up and API-documented massively. Made
all magic values given in the GPConfig message static and added
accessor functions for them. Added gimp_tile_width()/height().
Added new function gimp_extension_enable() which turns on
asynchronous processing of temp_proc run requests without having
to enter an endless gimp_extension_process() loop. Moved all
private functions to the end of the file. Added tons of
g_return_if_fail() all over the place. Call gimp_run_procedure2()
from gimp_run_procedure() instead of duplicating the
code. Indentation, spacing, stuff...
* libgimp/gimptile.[ch]: removed gimp_tile_width()/height().
* libgimp/gimpdrawable.c
* libgimp/gimppixelrgn.c
* libgimp/gimptile.c: use the gimp_tile_width()/height() accessor
functions.
* libgimp/gimp.def: added gimp_extension_enable.
* libgimp/gimpmenu.c: removed evil code which connected to
_readchannel manually and use gimp_extension_enable() for watching
temp_procs.
* plug-ins/helpbrowser/helpbrowser.c: removed the same evil code
here and call gimp_extension_enable(). Call gimp_extension_ack()
to let the core know that the temp_proc is installed.
* plug-ins/script-fu/script-fu.c: made all procedures except the
permanently running "extension_script_fu" ordinary GIMP_PLUGIN
procedures.
* plug-ins/common/curve_bend.c
* plug-ins/common/plugindetails.c
* plug-ins/common/screenshot.c
* plug-ins/common/uniteditor.c
* plug-ins/common/winclipboard.c
* plug-ins/dbbrowser/dbbrowser.c
* plug-ins/gfli/gfli.c
* plug-ins/twain/twain.c
* plug-ins/webbrowser/webbrowser.c
* plug-ins/winsnap/winsnap.c: made them all ordinary GIMP_PLUGIN
procedures and renamed them from "extension_*" to "plug_in_*".
Random cleanups.
* app/widgets/gimphelp.c
* plug-ins/maze/maze_face.c: call "plug_in_web_browser" now.
2003-06-20 01:12:00 +08:00
|
|
|
/**
|
|
|
|
* gimp_tile_width:
|
2003-11-08 01:29:02 +08:00
|
|
|
*
|
2008-03-28 01:49:42 +08:00
|
|
|
* Returns the tile width GIMP is using.
|
|
|
|
*
|
|
|
|
* This is a constant value given at plug-in configuration time.
|
2003-11-08 01:29:02 +08:00
|
|
|
*
|
2019-08-03 06:10:14 +08:00
|
|
|
* Returns: the tile_width
|
Changed the semantics of GIMP_EXTENSION and (to some extent) of
2003-06-19 Michael Natterer <mitch@gimp.org>
Changed the semantics of GIMP_EXTENSION and (to some extent)
of GIMP_PLUGIN:
The old meaning of EXTENSION was "I live in the toolbox" and
PLUGIN meant "I take RUN-MODE,IMAGE,DRAWABLE args (but only if I
am invoked interactively)". This is completely useless, since
living in the toolbox means having "<Toolbox>" in the menu_path
and taking RUN-MODE,IMAGE,DRAWABLE means just that, regardless of
what type of procedure we are.
The new meaning of GIMP_PLUGIN is just "I am an ordinary procedure,
I am invoked, do my job and finish", while GIMP_EXTENSION means
"I will install temporary procedures and I will keep running to
keep them available".
(A GIMP_EXTENSION *must* call gimp_extension_ack() now to tell the
core that it's ready to run, or the core will block waiting for
the message !!!).
* configure.in: bumped version number to 1.3.16.
* libgimpbase/gimpprotocol.h: increased protocol version number so
old extensions will refuse to load.
* app/gui/plug-in-commands.c (plug_in_run_cmd_callback): don't
blindly pass RUN-MODE,IMAGE,DRAWABLE to GIMP_PLUGIN procedures but
look at their parameters and pass them either RUN-MODE, or
RUN-MODE,IMAGE, or RUN-MODE,IMAGE,DRAWABLE.
* app/pdb/procedural_db.c: cleaned up, better error reporting,
replaced an impossible error message by g_return_if_fail()
* app/plug-in/plug-in-message.c (plug_in_handle_proc_install):
better error messages.
* app/plug-in/plug-in-params.c: allocate parameter arrays using
g_new0() so we don't have to worry about uninitialized stuff
later.
* app/plug-in/plug-in-run.c (plug_in_run): wait for
gimp_extension_ack() installation confirmation for ALL extensions,
not just for automatically started ones.
* app/plug-in/plug-ins.c: cleanup.
* libgimp/gimp.[ch]: cleaned up and API-documented massively. Made
all magic values given in the GPConfig message static and added
accessor functions for them. Added gimp_tile_width()/height().
Added new function gimp_extension_enable() which turns on
asynchronous processing of temp_proc run requests without having
to enter an endless gimp_extension_process() loop. Moved all
private functions to the end of the file. Added tons of
g_return_if_fail() all over the place. Call gimp_run_procedure2()
from gimp_run_procedure() instead of duplicating the
code. Indentation, spacing, stuff...
* libgimp/gimptile.[ch]: removed gimp_tile_width()/height().
* libgimp/gimpdrawable.c
* libgimp/gimppixelrgn.c
* libgimp/gimptile.c: use the gimp_tile_width()/height() accessor
functions.
* libgimp/gimp.def: added gimp_extension_enable.
* libgimp/gimpmenu.c: removed evil code which connected to
_readchannel manually and use gimp_extension_enable() for watching
temp_procs.
* plug-ins/helpbrowser/helpbrowser.c: removed the same evil code
here and call gimp_extension_enable(). Call gimp_extension_ack()
to let the core know that the temp_proc is installed.
* plug-ins/script-fu/script-fu.c: made all procedures except the
permanently running "extension_script_fu" ordinary GIMP_PLUGIN
procedures.
* plug-ins/common/curve_bend.c
* plug-ins/common/plugindetails.c
* plug-ins/common/screenshot.c
* plug-ins/common/uniteditor.c
* plug-ins/common/winclipboard.c
* plug-ins/dbbrowser/dbbrowser.c
* plug-ins/gfli/gfli.c
* plug-ins/twain/twain.c
* plug-ins/webbrowser/webbrowser.c
* plug-ins/winsnap/winsnap.c: made them all ordinary GIMP_PLUGIN
procedures and renamed them from "extension_*" to "plug_in_*".
Random cleanups.
* app/widgets/gimphelp.c
* plug-ins/maze/maze_face.c: call "plug_in_web_browser" now.
2003-06-20 01:12:00 +08:00
|
|
|
**/
|
|
|
|
guint
|
|
|
|
gimp_tile_width (void)
|
|
|
|
{
|
|
|
|
return _tile_width;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_tile_height:
|
2003-11-08 01:29:02 +08:00
|
|
|
*
|
2008-03-28 01:49:42 +08:00
|
|
|
* Returns the tile height GIMP is using.
|
|
|
|
*
|
|
|
|
* This is a constant value given at plug-in configuration time.
|
2003-11-08 01:29:02 +08:00
|
|
|
*
|
2019-08-03 06:10:14 +08:00
|
|
|
* Returns: the tile_height
|
Changed the semantics of GIMP_EXTENSION and (to some extent) of
2003-06-19 Michael Natterer <mitch@gimp.org>
Changed the semantics of GIMP_EXTENSION and (to some extent)
of GIMP_PLUGIN:
The old meaning of EXTENSION was "I live in the toolbox" and
PLUGIN meant "I take RUN-MODE,IMAGE,DRAWABLE args (but only if I
am invoked interactively)". This is completely useless, since
living in the toolbox means having "<Toolbox>" in the menu_path
and taking RUN-MODE,IMAGE,DRAWABLE means just that, regardless of
what type of procedure we are.
The new meaning of GIMP_PLUGIN is just "I am an ordinary procedure,
I am invoked, do my job and finish", while GIMP_EXTENSION means
"I will install temporary procedures and I will keep running to
keep them available".
(A GIMP_EXTENSION *must* call gimp_extension_ack() now to tell the
core that it's ready to run, or the core will block waiting for
the message !!!).
* configure.in: bumped version number to 1.3.16.
* libgimpbase/gimpprotocol.h: increased protocol version number so
old extensions will refuse to load.
* app/gui/plug-in-commands.c (plug_in_run_cmd_callback): don't
blindly pass RUN-MODE,IMAGE,DRAWABLE to GIMP_PLUGIN procedures but
look at their parameters and pass them either RUN-MODE, or
RUN-MODE,IMAGE, or RUN-MODE,IMAGE,DRAWABLE.
* app/pdb/procedural_db.c: cleaned up, better error reporting,
replaced an impossible error message by g_return_if_fail()
* app/plug-in/plug-in-message.c (plug_in_handle_proc_install):
better error messages.
* app/plug-in/plug-in-params.c: allocate parameter arrays using
g_new0() so we don't have to worry about uninitialized stuff
later.
* app/plug-in/plug-in-run.c (plug_in_run): wait for
gimp_extension_ack() installation confirmation for ALL extensions,
not just for automatically started ones.
* app/plug-in/plug-ins.c: cleanup.
* libgimp/gimp.[ch]: cleaned up and API-documented massively. Made
all magic values given in the GPConfig message static and added
accessor functions for them. Added gimp_tile_width()/height().
Added new function gimp_extension_enable() which turns on
asynchronous processing of temp_proc run requests without having
to enter an endless gimp_extension_process() loop. Moved all
private functions to the end of the file. Added tons of
g_return_if_fail() all over the place. Call gimp_run_procedure2()
from gimp_run_procedure() instead of duplicating the
code. Indentation, spacing, stuff...
* libgimp/gimptile.[ch]: removed gimp_tile_width()/height().
* libgimp/gimpdrawable.c
* libgimp/gimppixelrgn.c
* libgimp/gimptile.c: use the gimp_tile_width()/height() accessor
functions.
* libgimp/gimp.def: added gimp_extension_enable.
* libgimp/gimpmenu.c: removed evil code which connected to
_readchannel manually and use gimp_extension_enable() for watching
temp_procs.
* plug-ins/helpbrowser/helpbrowser.c: removed the same evil code
here and call gimp_extension_enable(). Call gimp_extension_ack()
to let the core know that the temp_proc is installed.
* plug-ins/script-fu/script-fu.c: made all procedures except the
permanently running "extension_script_fu" ordinary GIMP_PLUGIN
procedures.
* plug-ins/common/curve_bend.c
* plug-ins/common/plugindetails.c
* plug-ins/common/screenshot.c
* plug-ins/common/uniteditor.c
* plug-ins/common/winclipboard.c
* plug-ins/dbbrowser/dbbrowser.c
* plug-ins/gfli/gfli.c
* plug-ins/twain/twain.c
* plug-ins/webbrowser/webbrowser.c
* plug-ins/winsnap/winsnap.c: made them all ordinary GIMP_PLUGIN
procedures and renamed them from "extension_*" to "plug_in_*".
Random cleanups.
* app/widgets/gimphelp.c
* plug-ins/maze/maze_face.c: call "plug_in_web_browser" now.
2003-06-20 01:12:00 +08:00
|
|
|
**/
|
|
|
|
guint
|
|
|
|
gimp_tile_height (void)
|
|
|
|
{
|
|
|
|
return _tile_height;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_shm_ID:
|
2003-11-08 01:29:02 +08:00
|
|
|
*
|
2008-03-28 01:49:42 +08:00
|
|
|
* Returns the shared memory ID used for passing tile data between the
|
|
|
|
* GIMP core and the plug-in.
|
|
|
|
*
|
|
|
|
* This is a constant value given at plug-in configuration time.
|
2003-11-08 01:29:02 +08:00
|
|
|
*
|
2019-08-03 06:10:14 +08:00
|
|
|
* Returns: the shared memory ID
|
Changed the semantics of GIMP_EXTENSION and (to some extent) of
2003-06-19 Michael Natterer <mitch@gimp.org>
Changed the semantics of GIMP_EXTENSION and (to some extent)
of GIMP_PLUGIN:
The old meaning of EXTENSION was "I live in the toolbox" and
PLUGIN meant "I take RUN-MODE,IMAGE,DRAWABLE args (but only if I
am invoked interactively)". This is completely useless, since
living in the toolbox means having "<Toolbox>" in the menu_path
and taking RUN-MODE,IMAGE,DRAWABLE means just that, regardless of
what type of procedure we are.
The new meaning of GIMP_PLUGIN is just "I am an ordinary procedure,
I am invoked, do my job and finish", while GIMP_EXTENSION means
"I will install temporary procedures and I will keep running to
keep them available".
(A GIMP_EXTENSION *must* call gimp_extension_ack() now to tell the
core that it's ready to run, or the core will block waiting for
the message !!!).
* configure.in: bumped version number to 1.3.16.
* libgimpbase/gimpprotocol.h: increased protocol version number so
old extensions will refuse to load.
* app/gui/plug-in-commands.c (plug_in_run_cmd_callback): don't
blindly pass RUN-MODE,IMAGE,DRAWABLE to GIMP_PLUGIN procedures but
look at their parameters and pass them either RUN-MODE, or
RUN-MODE,IMAGE, or RUN-MODE,IMAGE,DRAWABLE.
* app/pdb/procedural_db.c: cleaned up, better error reporting,
replaced an impossible error message by g_return_if_fail()
* app/plug-in/plug-in-message.c (plug_in_handle_proc_install):
better error messages.
* app/plug-in/plug-in-params.c: allocate parameter arrays using
g_new0() so we don't have to worry about uninitialized stuff
later.
* app/plug-in/plug-in-run.c (plug_in_run): wait for
gimp_extension_ack() installation confirmation for ALL extensions,
not just for automatically started ones.
* app/plug-in/plug-ins.c: cleanup.
* libgimp/gimp.[ch]: cleaned up and API-documented massively. Made
all magic values given in the GPConfig message static and added
accessor functions for them. Added gimp_tile_width()/height().
Added new function gimp_extension_enable() which turns on
asynchronous processing of temp_proc run requests without having
to enter an endless gimp_extension_process() loop. Moved all
private functions to the end of the file. Added tons of
g_return_if_fail() all over the place. Call gimp_run_procedure2()
from gimp_run_procedure() instead of duplicating the
code. Indentation, spacing, stuff...
* libgimp/gimptile.[ch]: removed gimp_tile_width()/height().
* libgimp/gimpdrawable.c
* libgimp/gimppixelrgn.c
* libgimp/gimptile.c: use the gimp_tile_width()/height() accessor
functions.
* libgimp/gimp.def: added gimp_extension_enable.
* libgimp/gimpmenu.c: removed evil code which connected to
_readchannel manually and use gimp_extension_enable() for watching
temp_procs.
* plug-ins/helpbrowser/helpbrowser.c: removed the same evil code
here and call gimp_extension_enable(). Call gimp_extension_ack()
to let the core know that the temp_proc is installed.
* plug-ins/script-fu/script-fu.c: made all procedures except the
permanently running "extension_script_fu" ordinary GIMP_PLUGIN
procedures.
* plug-ins/common/curve_bend.c
* plug-ins/common/plugindetails.c
* plug-ins/common/screenshot.c
* plug-ins/common/uniteditor.c
* plug-ins/common/winclipboard.c
* plug-ins/dbbrowser/dbbrowser.c
* plug-ins/gfli/gfli.c
* plug-ins/twain/twain.c
* plug-ins/webbrowser/webbrowser.c
* plug-ins/winsnap/winsnap.c: made them all ordinary GIMP_PLUGIN
procedures and renamed them from "extension_*" to "plug_in_*".
Random cleanups.
* app/widgets/gimphelp.c
* plug-ins/maze/maze_face.c: call "plug_in_web_browser" now.
2003-06-20 01:12:00 +08:00
|
|
|
**/
|
|
|
|
gint
|
|
|
|
gimp_shm_ID (void)
|
|
|
|
{
|
|
|
|
return _shm_ID;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_shm_addr:
|
2003-11-08 01:29:02 +08:00
|
|
|
*
|
Changed the semantics of GIMP_EXTENSION and (to some extent) of
2003-06-19 Michael Natterer <mitch@gimp.org>
Changed the semantics of GIMP_EXTENSION and (to some extent)
of GIMP_PLUGIN:
The old meaning of EXTENSION was "I live in the toolbox" and
PLUGIN meant "I take RUN-MODE,IMAGE,DRAWABLE args (but only if I
am invoked interactively)". This is completely useless, since
living in the toolbox means having "<Toolbox>" in the menu_path
and taking RUN-MODE,IMAGE,DRAWABLE means just that, regardless of
what type of procedure we are.
The new meaning of GIMP_PLUGIN is just "I am an ordinary procedure,
I am invoked, do my job and finish", while GIMP_EXTENSION means
"I will install temporary procedures and I will keep running to
keep them available".
(A GIMP_EXTENSION *must* call gimp_extension_ack() now to tell the
core that it's ready to run, or the core will block waiting for
the message !!!).
* configure.in: bumped version number to 1.3.16.
* libgimpbase/gimpprotocol.h: increased protocol version number so
old extensions will refuse to load.
* app/gui/plug-in-commands.c (plug_in_run_cmd_callback): don't
blindly pass RUN-MODE,IMAGE,DRAWABLE to GIMP_PLUGIN procedures but
look at their parameters and pass them either RUN-MODE, or
RUN-MODE,IMAGE, or RUN-MODE,IMAGE,DRAWABLE.
* app/pdb/procedural_db.c: cleaned up, better error reporting,
replaced an impossible error message by g_return_if_fail()
* app/plug-in/plug-in-message.c (plug_in_handle_proc_install):
better error messages.
* app/plug-in/plug-in-params.c: allocate parameter arrays using
g_new0() so we don't have to worry about uninitialized stuff
later.
* app/plug-in/plug-in-run.c (plug_in_run): wait for
gimp_extension_ack() installation confirmation for ALL extensions,
not just for automatically started ones.
* app/plug-in/plug-ins.c: cleanup.
* libgimp/gimp.[ch]: cleaned up and API-documented massively. Made
all magic values given in the GPConfig message static and added
accessor functions for them. Added gimp_tile_width()/height().
Added new function gimp_extension_enable() which turns on
asynchronous processing of temp_proc run requests without having
to enter an endless gimp_extension_process() loop. Moved all
private functions to the end of the file. Added tons of
g_return_if_fail() all over the place. Call gimp_run_procedure2()
from gimp_run_procedure() instead of duplicating the
code. Indentation, spacing, stuff...
* libgimp/gimptile.[ch]: removed gimp_tile_width()/height().
* libgimp/gimpdrawable.c
* libgimp/gimppixelrgn.c
* libgimp/gimptile.c: use the gimp_tile_width()/height() accessor
functions.
* libgimp/gimp.def: added gimp_extension_enable.
* libgimp/gimpmenu.c: removed evil code which connected to
_readchannel manually and use gimp_extension_enable() for watching
temp_procs.
* plug-ins/helpbrowser/helpbrowser.c: removed the same evil code
here and call gimp_extension_enable(). Call gimp_extension_ack()
to let the core know that the temp_proc is installed.
* plug-ins/script-fu/script-fu.c: made all procedures except the
permanently running "extension_script_fu" ordinary GIMP_PLUGIN
procedures.
* plug-ins/common/curve_bend.c
* plug-ins/common/plugindetails.c
* plug-ins/common/screenshot.c
* plug-ins/common/uniteditor.c
* plug-ins/common/winclipboard.c
* plug-ins/dbbrowser/dbbrowser.c
* plug-ins/gfli/gfli.c
* plug-ins/twain/twain.c
* plug-ins/webbrowser/webbrowser.c
* plug-ins/winsnap/winsnap.c: made them all ordinary GIMP_PLUGIN
procedures and renamed them from "extension_*" to "plug_in_*".
Random cleanups.
* app/widgets/gimphelp.c
* plug-ins/maze/maze_face.c: call "plug_in_web_browser" now.
2003-06-20 01:12:00 +08:00
|
|
|
* Returns the address of the shared memory segment used for passing
|
2008-03-28 01:49:42 +08:00
|
|
|
* tile data between the GIMP core and the plug-in.
|
|
|
|
*
|
|
|
|
* This is a constant value given at plug-in configuration time.
|
2003-11-08 01:29:02 +08:00
|
|
|
*
|
2019-08-03 06:10:14 +08:00
|
|
|
* Returns: the shared memory address
|
Changed the semantics of GIMP_EXTENSION and (to some extent) of
2003-06-19 Michael Natterer <mitch@gimp.org>
Changed the semantics of GIMP_EXTENSION and (to some extent)
of GIMP_PLUGIN:
The old meaning of EXTENSION was "I live in the toolbox" and
PLUGIN meant "I take RUN-MODE,IMAGE,DRAWABLE args (but only if I
am invoked interactively)". This is completely useless, since
living in the toolbox means having "<Toolbox>" in the menu_path
and taking RUN-MODE,IMAGE,DRAWABLE means just that, regardless of
what type of procedure we are.
The new meaning of GIMP_PLUGIN is just "I am an ordinary procedure,
I am invoked, do my job and finish", while GIMP_EXTENSION means
"I will install temporary procedures and I will keep running to
keep them available".
(A GIMP_EXTENSION *must* call gimp_extension_ack() now to tell the
core that it's ready to run, or the core will block waiting for
the message !!!).
* configure.in: bumped version number to 1.3.16.
* libgimpbase/gimpprotocol.h: increased protocol version number so
old extensions will refuse to load.
* app/gui/plug-in-commands.c (plug_in_run_cmd_callback): don't
blindly pass RUN-MODE,IMAGE,DRAWABLE to GIMP_PLUGIN procedures but
look at their parameters and pass them either RUN-MODE, or
RUN-MODE,IMAGE, or RUN-MODE,IMAGE,DRAWABLE.
* app/pdb/procedural_db.c: cleaned up, better error reporting,
replaced an impossible error message by g_return_if_fail()
* app/plug-in/plug-in-message.c (plug_in_handle_proc_install):
better error messages.
* app/plug-in/plug-in-params.c: allocate parameter arrays using
g_new0() so we don't have to worry about uninitialized stuff
later.
* app/plug-in/plug-in-run.c (plug_in_run): wait for
gimp_extension_ack() installation confirmation for ALL extensions,
not just for automatically started ones.
* app/plug-in/plug-ins.c: cleanup.
* libgimp/gimp.[ch]: cleaned up and API-documented massively. Made
all magic values given in the GPConfig message static and added
accessor functions for them. Added gimp_tile_width()/height().
Added new function gimp_extension_enable() which turns on
asynchronous processing of temp_proc run requests without having
to enter an endless gimp_extension_process() loop. Moved all
private functions to the end of the file. Added tons of
g_return_if_fail() all over the place. Call gimp_run_procedure2()
from gimp_run_procedure() instead of duplicating the
code. Indentation, spacing, stuff...
* libgimp/gimptile.[ch]: removed gimp_tile_width()/height().
* libgimp/gimpdrawable.c
* libgimp/gimppixelrgn.c
* libgimp/gimptile.c: use the gimp_tile_width()/height() accessor
functions.
* libgimp/gimp.def: added gimp_extension_enable.
* libgimp/gimpmenu.c: removed evil code which connected to
_readchannel manually and use gimp_extension_enable() for watching
temp_procs.
* plug-ins/helpbrowser/helpbrowser.c: removed the same evil code
here and call gimp_extension_enable(). Call gimp_extension_ack()
to let the core know that the temp_proc is installed.
* plug-ins/script-fu/script-fu.c: made all procedures except the
permanently running "extension_script_fu" ordinary GIMP_PLUGIN
procedures.
* plug-ins/common/curve_bend.c
* plug-ins/common/plugindetails.c
* plug-ins/common/screenshot.c
* plug-ins/common/uniteditor.c
* plug-ins/common/winclipboard.c
* plug-ins/dbbrowser/dbbrowser.c
* plug-ins/gfli/gfli.c
* plug-ins/twain/twain.c
* plug-ins/webbrowser/webbrowser.c
* plug-ins/winsnap/winsnap.c: made them all ordinary GIMP_PLUGIN
procedures and renamed them from "extension_*" to "plug_in_*".
Random cleanups.
* app/widgets/gimphelp.c
* plug-ins/maze/maze_face.c: call "plug_in_web_browser" now.
2003-06-20 01:12:00 +08:00
|
|
|
**/
|
2006-08-16 04:29:01 +08:00
|
|
|
guchar *
|
Changed the semantics of GIMP_EXTENSION and (to some extent) of
2003-06-19 Michael Natterer <mitch@gimp.org>
Changed the semantics of GIMP_EXTENSION and (to some extent)
of GIMP_PLUGIN:
The old meaning of EXTENSION was "I live in the toolbox" and
PLUGIN meant "I take RUN-MODE,IMAGE,DRAWABLE args (but only if I
am invoked interactively)". This is completely useless, since
living in the toolbox means having "<Toolbox>" in the menu_path
and taking RUN-MODE,IMAGE,DRAWABLE means just that, regardless of
what type of procedure we are.
The new meaning of GIMP_PLUGIN is just "I am an ordinary procedure,
I am invoked, do my job and finish", while GIMP_EXTENSION means
"I will install temporary procedures and I will keep running to
keep them available".
(A GIMP_EXTENSION *must* call gimp_extension_ack() now to tell the
core that it's ready to run, or the core will block waiting for
the message !!!).
* configure.in: bumped version number to 1.3.16.
* libgimpbase/gimpprotocol.h: increased protocol version number so
old extensions will refuse to load.
* app/gui/plug-in-commands.c (plug_in_run_cmd_callback): don't
blindly pass RUN-MODE,IMAGE,DRAWABLE to GIMP_PLUGIN procedures but
look at their parameters and pass them either RUN-MODE, or
RUN-MODE,IMAGE, or RUN-MODE,IMAGE,DRAWABLE.
* app/pdb/procedural_db.c: cleaned up, better error reporting,
replaced an impossible error message by g_return_if_fail()
* app/plug-in/plug-in-message.c (plug_in_handle_proc_install):
better error messages.
* app/plug-in/plug-in-params.c: allocate parameter arrays using
g_new0() so we don't have to worry about uninitialized stuff
later.
* app/plug-in/plug-in-run.c (plug_in_run): wait for
gimp_extension_ack() installation confirmation for ALL extensions,
not just for automatically started ones.
* app/plug-in/plug-ins.c: cleanup.
* libgimp/gimp.[ch]: cleaned up and API-documented massively. Made
all magic values given in the GPConfig message static and added
accessor functions for them. Added gimp_tile_width()/height().
Added new function gimp_extension_enable() which turns on
asynchronous processing of temp_proc run requests without having
to enter an endless gimp_extension_process() loop. Moved all
private functions to the end of the file. Added tons of
g_return_if_fail() all over the place. Call gimp_run_procedure2()
from gimp_run_procedure() instead of duplicating the
code. Indentation, spacing, stuff...
* libgimp/gimptile.[ch]: removed gimp_tile_width()/height().
* libgimp/gimpdrawable.c
* libgimp/gimppixelrgn.c
* libgimp/gimptile.c: use the gimp_tile_width()/height() accessor
functions.
* libgimp/gimp.def: added gimp_extension_enable.
* libgimp/gimpmenu.c: removed evil code which connected to
_readchannel manually and use gimp_extension_enable() for watching
temp_procs.
* plug-ins/helpbrowser/helpbrowser.c: removed the same evil code
here and call gimp_extension_enable(). Call gimp_extension_ack()
to let the core know that the temp_proc is installed.
* plug-ins/script-fu/script-fu.c: made all procedures except the
permanently running "extension_script_fu" ordinary GIMP_PLUGIN
procedures.
* plug-ins/common/curve_bend.c
* plug-ins/common/plugindetails.c
* plug-ins/common/screenshot.c
* plug-ins/common/uniteditor.c
* plug-ins/common/winclipboard.c
* plug-ins/dbbrowser/dbbrowser.c
* plug-ins/gfli/gfli.c
* plug-ins/twain/twain.c
* plug-ins/webbrowser/webbrowser.c
* plug-ins/winsnap/winsnap.c: made them all ordinary GIMP_PLUGIN
procedures and renamed them from "extension_*" to "plug_in_*".
Random cleanups.
* app/widgets/gimphelp.c
* plug-ins/maze/maze_face.c: call "plug_in_web_browser" now.
2003-06-20 01:12:00 +08:00
|
|
|
gimp_shm_addr (void)
|
|
|
|
{
|
|
|
|
return _shm_addr;
|
|
|
|
}
|
|
|
|
|
2004-10-05 00:21:52 +08:00
|
|
|
/**
|
|
|
|
* gimp_show_help_button:
|
|
|
|
*
|
|
|
|
* Returns whether or not GimpDialog should automatically add a help
|
|
|
|
* button if help_func and help_id are given.
|
|
|
|
*
|
2008-03-28 01:49:42 +08:00
|
|
|
* This is a constant value given at plug-in configuration time.
|
|
|
|
*
|
2019-08-03 06:10:14 +08:00
|
|
|
* Returns: the show_help_button boolean
|
2004-10-05 00:21:52 +08:00
|
|
|
*
|
2015-06-01 03:18:09 +08:00
|
|
|
* Since: 2.2
|
2004-10-05 00:21:52 +08:00
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_show_help_button (void)
|
|
|
|
{
|
|
|
|
return _show_help_button;
|
|
|
|
}
|
|
|
|
|
2018-06-18 08:19:41 +08:00
|
|
|
/**
|
|
|
|
* gimp_export_color_profile:
|
|
|
|
*
|
|
|
|
* Returns whether file plug-ins should default to exporting the
|
|
|
|
* image's color profile.
|
|
|
|
*
|
2019-08-03 06:10:14 +08:00
|
|
|
* Returns: TRUE if preferences are set to export the color profile.
|
2018-06-18 08:19:41 +08:00
|
|
|
*
|
|
|
|
* Since: 2.10.4
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_export_color_profile (void)
|
|
|
|
{
|
|
|
|
return _export_profile;
|
|
|
|
}
|
|
|
|
|
2018-01-11 12:14:07 +08:00
|
|
|
/**
|
|
|
|
* gimp_export_exif:
|
|
|
|
*
|
|
|
|
* Returns whether file plug-ins should default to exporting Exif
|
2019-08-03 06:04:28 +08:00
|
|
|
* metadata, according preferences (original settings is %FALSE since
|
2018-01-11 12:14:07 +08:00
|
|
|
* metadata can contain sensitive information).
|
|
|
|
*
|
2019-08-03 06:10:14 +08:00
|
|
|
* Returns: TRUE if preferences are set to export Exif.
|
2018-01-11 12:14:07 +08:00
|
|
|
*
|
|
|
|
* Since: 2.10
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_export_exif (void)
|
|
|
|
{
|
|
|
|
return _export_exif;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_export_xmp:
|
|
|
|
*
|
|
|
|
* Returns whether file plug-ins should default to exporting XMP
|
2019-08-03 06:04:28 +08:00
|
|
|
* metadata, according preferences (original settings is %FALSE since
|
2018-01-11 12:14:07 +08:00
|
|
|
* metadata can contain sensitive information).
|
|
|
|
*
|
2019-08-03 06:10:14 +08:00
|
|
|
* Returns: TRUE if preferences are set to export XMP.
|
2018-01-11 12:14:07 +08:00
|
|
|
*
|
|
|
|
* Since: 2.10
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_export_xmp (void)
|
|
|
|
{
|
|
|
|
return _export_xmp;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_export_iptc:
|
|
|
|
*
|
|
|
|
* Returns whether file plug-ins should default to exporting IPTC
|
2019-08-03 06:04:28 +08:00
|
|
|
* metadata, according preferences (original settings is %FALSE since
|
2018-01-11 12:14:07 +08:00
|
|
|
* metadata can contain sensitive information).
|
|
|
|
*
|
2019-08-03 06:10:14 +08:00
|
|
|
* Returns: TRUE if preferences are set to export IPTC.
|
2018-01-11 12:14:07 +08:00
|
|
|
*
|
|
|
|
* Since: 2.10
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_export_iptc (void)
|
|
|
|
{
|
|
|
|
return _export_iptc;
|
|
|
|
}
|
|
|
|
|
2004-09-03 20:19:26 +08:00
|
|
|
/**
|
|
|
|
* gimp_check_size:
|
|
|
|
*
|
|
|
|
* Returns the size of the checkerboard to be used in previews.
|
2008-03-28 01:49:42 +08:00
|
|
|
*
|
2007-02-16 19:09:09 +08:00
|
|
|
* This is a constant value given at plug-in configuration time.
|
2004-09-03 20:19:26 +08:00
|
|
|
*
|
2019-08-03 06:10:14 +08:00
|
|
|
* Returns: the check_size value
|
2004-09-03 20:19:26 +08:00
|
|
|
*
|
2015-06-01 03:18:09 +08:00
|
|
|
* Since: 2.2
|
2004-09-03 20:19:26 +08:00
|
|
|
**/
|
|
|
|
GimpCheckSize
|
|
|
|
gimp_check_size (void)
|
|
|
|
{
|
|
|
|
return _check_size;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_check_type:
|
|
|
|
*
|
|
|
|
* Returns the type of the checkerboard to be used in previews.
|
2008-03-28 01:49:42 +08:00
|
|
|
*
|
2007-02-16 19:09:09 +08:00
|
|
|
* This is a constant value given at plug-in configuration time.
|
2004-09-03 20:19:26 +08:00
|
|
|
*
|
2019-08-03 06:10:14 +08:00
|
|
|
* Returns: the check_type value
|
2004-09-03 20:19:26 +08:00
|
|
|
*
|
2015-06-01 03:18:09 +08:00
|
|
|
* Since: 2.2
|
2004-09-03 20:19:26 +08:00
|
|
|
**/
|
|
|
|
GimpCheckType
|
|
|
|
gimp_check_type (void)
|
|
|
|
{
|
|
|
|
return _check_type;
|
|
|
|
}
|
|
|
|
|
Changed the semantics of GIMP_EXTENSION and (to some extent) of
2003-06-19 Michael Natterer <mitch@gimp.org>
Changed the semantics of GIMP_EXTENSION and (to some extent)
of GIMP_PLUGIN:
The old meaning of EXTENSION was "I live in the toolbox" and
PLUGIN meant "I take RUN-MODE,IMAGE,DRAWABLE args (but only if I
am invoked interactively)". This is completely useless, since
living in the toolbox means having "<Toolbox>" in the menu_path
and taking RUN-MODE,IMAGE,DRAWABLE means just that, regardless of
what type of procedure we are.
The new meaning of GIMP_PLUGIN is just "I am an ordinary procedure,
I am invoked, do my job and finish", while GIMP_EXTENSION means
"I will install temporary procedures and I will keep running to
keep them available".
(A GIMP_EXTENSION *must* call gimp_extension_ack() now to tell the
core that it's ready to run, or the core will block waiting for
the message !!!).
* configure.in: bumped version number to 1.3.16.
* libgimpbase/gimpprotocol.h: increased protocol version number so
old extensions will refuse to load.
* app/gui/plug-in-commands.c (plug_in_run_cmd_callback): don't
blindly pass RUN-MODE,IMAGE,DRAWABLE to GIMP_PLUGIN procedures but
look at their parameters and pass them either RUN-MODE, or
RUN-MODE,IMAGE, or RUN-MODE,IMAGE,DRAWABLE.
* app/pdb/procedural_db.c: cleaned up, better error reporting,
replaced an impossible error message by g_return_if_fail()
* app/plug-in/plug-in-message.c (plug_in_handle_proc_install):
better error messages.
* app/plug-in/plug-in-params.c: allocate parameter arrays using
g_new0() so we don't have to worry about uninitialized stuff
later.
* app/plug-in/plug-in-run.c (plug_in_run): wait for
gimp_extension_ack() installation confirmation for ALL extensions,
not just for automatically started ones.
* app/plug-in/plug-ins.c: cleanup.
* libgimp/gimp.[ch]: cleaned up and API-documented massively. Made
all magic values given in the GPConfig message static and added
accessor functions for them. Added gimp_tile_width()/height().
Added new function gimp_extension_enable() which turns on
asynchronous processing of temp_proc run requests without having
to enter an endless gimp_extension_process() loop. Moved all
private functions to the end of the file. Added tons of
g_return_if_fail() all over the place. Call gimp_run_procedure2()
from gimp_run_procedure() instead of duplicating the
code. Indentation, spacing, stuff...
* libgimp/gimptile.[ch]: removed gimp_tile_width()/height().
* libgimp/gimpdrawable.c
* libgimp/gimppixelrgn.c
* libgimp/gimptile.c: use the gimp_tile_width()/height() accessor
functions.
* libgimp/gimp.def: added gimp_extension_enable.
* libgimp/gimpmenu.c: removed evil code which connected to
_readchannel manually and use gimp_extension_enable() for watching
temp_procs.
* plug-ins/helpbrowser/helpbrowser.c: removed the same evil code
here and call gimp_extension_enable(). Call gimp_extension_ack()
to let the core know that the temp_proc is installed.
* plug-ins/script-fu/script-fu.c: made all procedures except the
permanently running "extension_script_fu" ordinary GIMP_PLUGIN
procedures.
* plug-ins/common/curve_bend.c
* plug-ins/common/plugindetails.c
* plug-ins/common/screenshot.c
* plug-ins/common/uniteditor.c
* plug-ins/common/winclipboard.c
* plug-ins/dbbrowser/dbbrowser.c
* plug-ins/gfli/gfli.c
* plug-ins/twain/twain.c
* plug-ins/webbrowser/webbrowser.c
* plug-ins/winsnap/winsnap.c: made them all ordinary GIMP_PLUGIN
procedures and renamed them from "extension_*" to "plug_in_*".
Random cleanups.
* app/widgets/gimphelp.c
* plug-ins/maze/maze_face.c: call "plug_in_web_browser" now.
2003-06-20 01:12:00 +08:00
|
|
|
/**
|
|
|
|
* gimp_default_display:
|
2003-11-08 01:29:02 +08:00
|
|
|
*
|
Changed the semantics of GIMP_EXTENSION and (to some extent) of
2003-06-19 Michael Natterer <mitch@gimp.org>
Changed the semantics of GIMP_EXTENSION and (to some extent)
of GIMP_PLUGIN:
The old meaning of EXTENSION was "I live in the toolbox" and
PLUGIN meant "I take RUN-MODE,IMAGE,DRAWABLE args (but only if I
am invoked interactively)". This is completely useless, since
living in the toolbox means having "<Toolbox>" in the menu_path
and taking RUN-MODE,IMAGE,DRAWABLE means just that, regardless of
what type of procedure we are.
The new meaning of GIMP_PLUGIN is just "I am an ordinary procedure,
I am invoked, do my job and finish", while GIMP_EXTENSION means
"I will install temporary procedures and I will keep running to
keep them available".
(A GIMP_EXTENSION *must* call gimp_extension_ack() now to tell the
core that it's ready to run, or the core will block waiting for
the message !!!).
* configure.in: bumped version number to 1.3.16.
* libgimpbase/gimpprotocol.h: increased protocol version number so
old extensions will refuse to load.
* app/gui/plug-in-commands.c (plug_in_run_cmd_callback): don't
blindly pass RUN-MODE,IMAGE,DRAWABLE to GIMP_PLUGIN procedures but
look at their parameters and pass them either RUN-MODE, or
RUN-MODE,IMAGE, or RUN-MODE,IMAGE,DRAWABLE.
* app/pdb/procedural_db.c: cleaned up, better error reporting,
replaced an impossible error message by g_return_if_fail()
* app/plug-in/plug-in-message.c (plug_in_handle_proc_install):
better error messages.
* app/plug-in/plug-in-params.c: allocate parameter arrays using
g_new0() so we don't have to worry about uninitialized stuff
later.
* app/plug-in/plug-in-run.c (plug_in_run): wait for
gimp_extension_ack() installation confirmation for ALL extensions,
not just for automatically started ones.
* app/plug-in/plug-ins.c: cleanup.
* libgimp/gimp.[ch]: cleaned up and API-documented massively. Made
all magic values given in the GPConfig message static and added
accessor functions for them. Added gimp_tile_width()/height().
Added new function gimp_extension_enable() which turns on
asynchronous processing of temp_proc run requests without having
to enter an endless gimp_extension_process() loop. Moved all
private functions to the end of the file. Added tons of
g_return_if_fail() all over the place. Call gimp_run_procedure2()
from gimp_run_procedure() instead of duplicating the
code. Indentation, spacing, stuff...
* libgimp/gimptile.[ch]: removed gimp_tile_width()/height().
* libgimp/gimpdrawable.c
* libgimp/gimppixelrgn.c
* libgimp/gimptile.c: use the gimp_tile_width()/height() accessor
functions.
* libgimp/gimp.def: added gimp_extension_enable.
* libgimp/gimpmenu.c: removed evil code which connected to
_readchannel manually and use gimp_extension_enable() for watching
temp_procs.
* plug-ins/helpbrowser/helpbrowser.c: removed the same evil code
here and call gimp_extension_enable(). Call gimp_extension_ack()
to let the core know that the temp_proc is installed.
* plug-ins/script-fu/script-fu.c: made all procedures except the
permanently running "extension_script_fu" ordinary GIMP_PLUGIN
procedures.
* plug-ins/common/curve_bend.c
* plug-ins/common/plugindetails.c
* plug-ins/common/screenshot.c
* plug-ins/common/uniteditor.c
* plug-ins/common/winclipboard.c
* plug-ins/dbbrowser/dbbrowser.c
* plug-ins/gfli/gfli.c
* plug-ins/twain/twain.c
* plug-ins/webbrowser/webbrowser.c
* plug-ins/winsnap/winsnap.c: made them all ordinary GIMP_PLUGIN
procedures and renamed them from "extension_*" to "plug_in_*".
Random cleanups.
* app/widgets/gimphelp.c
* plug-ins/maze/maze_face.c: call "plug_in_web_browser" now.
2003-06-20 01:12:00 +08:00
|
|
|
* Returns the default display ID. This corresponds to the display the
|
2008-03-28 01:49:42 +08:00
|
|
|
* running procedure's menu entry was invoked from.
|
|
|
|
*
|
|
|
|
* This is a constant value given at plug-in configuration time.
|
2003-11-08 01:29:02 +08:00
|
|
|
*
|
2019-08-03 06:10:14 +08:00
|
|
|
* Returns: the default display ID
|
Changed the semantics of GIMP_EXTENSION and (to some extent) of
2003-06-19 Michael Natterer <mitch@gimp.org>
Changed the semantics of GIMP_EXTENSION and (to some extent)
of GIMP_PLUGIN:
The old meaning of EXTENSION was "I live in the toolbox" and
PLUGIN meant "I take RUN-MODE,IMAGE,DRAWABLE args (but only if I
am invoked interactively)". This is completely useless, since
living in the toolbox means having "<Toolbox>" in the menu_path
and taking RUN-MODE,IMAGE,DRAWABLE means just that, regardless of
what type of procedure we are.
The new meaning of GIMP_PLUGIN is just "I am an ordinary procedure,
I am invoked, do my job and finish", while GIMP_EXTENSION means
"I will install temporary procedures and I will keep running to
keep them available".
(A GIMP_EXTENSION *must* call gimp_extension_ack() now to tell the
core that it's ready to run, or the core will block waiting for
the message !!!).
* configure.in: bumped version number to 1.3.16.
* libgimpbase/gimpprotocol.h: increased protocol version number so
old extensions will refuse to load.
* app/gui/plug-in-commands.c (plug_in_run_cmd_callback): don't
blindly pass RUN-MODE,IMAGE,DRAWABLE to GIMP_PLUGIN procedures but
look at their parameters and pass them either RUN-MODE, or
RUN-MODE,IMAGE, or RUN-MODE,IMAGE,DRAWABLE.
* app/pdb/procedural_db.c: cleaned up, better error reporting,
replaced an impossible error message by g_return_if_fail()
* app/plug-in/plug-in-message.c (plug_in_handle_proc_install):
better error messages.
* app/plug-in/plug-in-params.c: allocate parameter arrays using
g_new0() so we don't have to worry about uninitialized stuff
later.
* app/plug-in/plug-in-run.c (plug_in_run): wait for
gimp_extension_ack() installation confirmation for ALL extensions,
not just for automatically started ones.
* app/plug-in/plug-ins.c: cleanup.
* libgimp/gimp.[ch]: cleaned up and API-documented massively. Made
all magic values given in the GPConfig message static and added
accessor functions for them. Added gimp_tile_width()/height().
Added new function gimp_extension_enable() which turns on
asynchronous processing of temp_proc run requests without having
to enter an endless gimp_extension_process() loop. Moved all
private functions to the end of the file. Added tons of
g_return_if_fail() all over the place. Call gimp_run_procedure2()
from gimp_run_procedure() instead of duplicating the
code. Indentation, spacing, stuff...
* libgimp/gimptile.[ch]: removed gimp_tile_width()/height().
* libgimp/gimpdrawable.c
* libgimp/gimppixelrgn.c
* libgimp/gimptile.c: use the gimp_tile_width()/height() accessor
functions.
* libgimp/gimp.def: added gimp_extension_enable.
* libgimp/gimpmenu.c: removed evil code which connected to
_readchannel manually and use gimp_extension_enable() for watching
temp_procs.
* plug-ins/helpbrowser/helpbrowser.c: removed the same evil code
here and call gimp_extension_enable(). Call gimp_extension_ack()
to let the core know that the temp_proc is installed.
* plug-ins/script-fu/script-fu.c: made all procedures except the
permanently running "extension_script_fu" ordinary GIMP_PLUGIN
procedures.
* plug-ins/common/curve_bend.c
* plug-ins/common/plugindetails.c
* plug-ins/common/screenshot.c
* plug-ins/common/uniteditor.c
* plug-ins/common/winclipboard.c
* plug-ins/dbbrowser/dbbrowser.c
* plug-ins/gfli/gfli.c
* plug-ins/twain/twain.c
* plug-ins/webbrowser/webbrowser.c
* plug-ins/winsnap/winsnap.c: made them all ordinary GIMP_PLUGIN
procedures and renamed them from "extension_*" to "plug_in_*".
Random cleanups.
* app/widgets/gimphelp.c
* plug-ins/maze/maze_face.c: call "plug_in_web_browser" now.
2003-06-20 01:12:00 +08:00
|
|
|
**/
|
|
|
|
gint32
|
|
|
|
gimp_default_display (void)
|
1998-09-19 08:40:27 +08:00
|
|
|
{
|
Changed the semantics of GIMP_EXTENSION and (to some extent) of
2003-06-19 Michael Natterer <mitch@gimp.org>
Changed the semantics of GIMP_EXTENSION and (to some extent)
of GIMP_PLUGIN:
The old meaning of EXTENSION was "I live in the toolbox" and
PLUGIN meant "I take RUN-MODE,IMAGE,DRAWABLE args (but only if I
am invoked interactively)". This is completely useless, since
living in the toolbox means having "<Toolbox>" in the menu_path
and taking RUN-MODE,IMAGE,DRAWABLE means just that, regardless of
what type of procedure we are.
The new meaning of GIMP_PLUGIN is just "I am an ordinary procedure,
I am invoked, do my job and finish", while GIMP_EXTENSION means
"I will install temporary procedures and I will keep running to
keep them available".
(A GIMP_EXTENSION *must* call gimp_extension_ack() now to tell the
core that it's ready to run, or the core will block waiting for
the message !!!).
* configure.in: bumped version number to 1.3.16.
* libgimpbase/gimpprotocol.h: increased protocol version number so
old extensions will refuse to load.
* app/gui/plug-in-commands.c (plug_in_run_cmd_callback): don't
blindly pass RUN-MODE,IMAGE,DRAWABLE to GIMP_PLUGIN procedures but
look at their parameters and pass them either RUN-MODE, or
RUN-MODE,IMAGE, or RUN-MODE,IMAGE,DRAWABLE.
* app/pdb/procedural_db.c: cleaned up, better error reporting,
replaced an impossible error message by g_return_if_fail()
* app/plug-in/plug-in-message.c (plug_in_handle_proc_install):
better error messages.
* app/plug-in/plug-in-params.c: allocate parameter arrays using
g_new0() so we don't have to worry about uninitialized stuff
later.
* app/plug-in/plug-in-run.c (plug_in_run): wait for
gimp_extension_ack() installation confirmation for ALL extensions,
not just for automatically started ones.
* app/plug-in/plug-ins.c: cleanup.
* libgimp/gimp.[ch]: cleaned up and API-documented massively. Made
all magic values given in the GPConfig message static and added
accessor functions for them. Added gimp_tile_width()/height().
Added new function gimp_extension_enable() which turns on
asynchronous processing of temp_proc run requests without having
to enter an endless gimp_extension_process() loop. Moved all
private functions to the end of the file. Added tons of
g_return_if_fail() all over the place. Call gimp_run_procedure2()
from gimp_run_procedure() instead of duplicating the
code. Indentation, spacing, stuff...
* libgimp/gimptile.[ch]: removed gimp_tile_width()/height().
* libgimp/gimpdrawable.c
* libgimp/gimppixelrgn.c
* libgimp/gimptile.c: use the gimp_tile_width()/height() accessor
functions.
* libgimp/gimp.def: added gimp_extension_enable.
* libgimp/gimpmenu.c: removed evil code which connected to
_readchannel manually and use gimp_extension_enable() for watching
temp_procs.
* plug-ins/helpbrowser/helpbrowser.c: removed the same evil code
here and call gimp_extension_enable(). Call gimp_extension_ack()
to let the core know that the temp_proc is installed.
* plug-ins/script-fu/script-fu.c: made all procedures except the
permanently running "extension_script_fu" ordinary GIMP_PLUGIN
procedures.
* plug-ins/common/curve_bend.c
* plug-ins/common/plugindetails.c
* plug-ins/common/screenshot.c
* plug-ins/common/uniteditor.c
* plug-ins/common/winclipboard.c
* plug-ins/dbbrowser/dbbrowser.c
* plug-ins/gfli/gfli.c
* plug-ins/twain/twain.c
* plug-ins/webbrowser/webbrowser.c
* plug-ins/winsnap/winsnap.c: made them all ordinary GIMP_PLUGIN
procedures and renamed them from "extension_*" to "plug_in_*".
Random cleanups.
* app/widgets/gimphelp.c
* plug-ins/maze/maze_face.c: call "plug_in_web_browser" now.
2003-06-20 01:12:00 +08:00
|
|
|
return _gdisp_ID;
|
1998-09-19 08:40:27 +08:00
|
|
|
}
|
|
|
|
|
2003-11-08 01:29:02 +08:00
|
|
|
/**
|
|
|
|
* gimp_wm_class:
|
|
|
|
*
|
|
|
|
* Returns the window manager class to be used for plug-in windows.
|
2008-03-28 01:49:42 +08:00
|
|
|
*
|
2007-02-16 19:09:09 +08:00
|
|
|
* This is a constant value given at plug-in configuration time.
|
2003-11-08 01:29:02 +08:00
|
|
|
*
|
2019-08-03 06:10:14 +08:00
|
|
|
* Returns: the window manager class
|
2003-11-08 01:29:02 +08:00
|
|
|
**/
|
|
|
|
const gchar *
|
|
|
|
gimp_wm_class (void)
|
|
|
|
{
|
2008-08-17 01:18:13 +08:00
|
|
|
return _wm_class;
|
2003-11-08 01:29:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_display_name:
|
|
|
|
*
|
|
|
|
* Returns the display to be used for plug-in windows.
|
2008-03-28 00:30:29 +08:00
|
|
|
*
|
2007-02-16 19:09:09 +08:00
|
|
|
* This is a constant value given at plug-in configuration time.
|
2019-08-03 06:04:28 +08:00
|
|
|
* Will return %NULL if GIMP has been started with no GUI, either
|
2014-05-25 00:58:37 +08:00
|
|
|
* via "--no-interface" flag, or a console build.
|
2003-11-08 01:29:02 +08:00
|
|
|
*
|
2019-08-03 06:10:14 +08:00
|
|
|
* Returns: the display name
|
2003-11-08 01:29:02 +08:00
|
|
|
**/
|
|
|
|
const gchar *
|
|
|
|
gimp_display_name (void)
|
|
|
|
{
|
2008-08-17 01:18:13 +08:00
|
|
|
return _display_name;
|
2003-11-08 01:29:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_monitor_number:
|
|
|
|
*
|
|
|
|
* Returns the monitor number to be used for plug-in windows.
|
2008-03-28 01:49:42 +08:00
|
|
|
*
|
2007-02-16 19:09:09 +08:00
|
|
|
* This is a constant value given at plug-in configuration time.
|
2003-11-08 01:29:02 +08:00
|
|
|
*
|
2019-08-03 06:10:14 +08:00
|
|
|
* Returns: the monitor number
|
2003-11-08 01:29:02 +08:00
|
|
|
**/
|
|
|
|
gint
|
|
|
|
gimp_monitor_number (void)
|
|
|
|
{
|
|
|
|
return _monitor_number;
|
|
|
|
}
|
|
|
|
|
2008-03-28 00:30:29 +08:00
|
|
|
/**
|
|
|
|
* gimp_user_time:
|
|
|
|
*
|
|
|
|
* Returns the timestamp of the user interaction that should be set on
|
2008-03-28 01:49:42 +08:00
|
|
|
* the plug-in window. This is handled transparently, plug-in authors
|
|
|
|
* do not have to care about it.
|
|
|
|
*
|
|
|
|
* This is a constant value given at plug-in configuration time.
|
2008-03-28 00:30:29 +08:00
|
|
|
*
|
2019-08-03 06:10:14 +08:00
|
|
|
* Returns: timestamp for plug-in window
|
2008-03-28 01:49:42 +08:00
|
|
|
*
|
2015-06-01 03:18:09 +08:00
|
|
|
* Since: 2.6
|
2008-03-28 00:30:29 +08:00
|
|
|
**/
|
|
|
|
guint32
|
|
|
|
gimp_user_time (void)
|
|
|
|
{
|
|
|
|
return _timestamp;
|
|
|
|
}
|
|
|
|
|
libgimpbase, libgimp, app: pass icon theme dir to plug-ins through config
Pass the current icon theme directory to plug-ins through the
config message, and add a gimp_icon_theme_dir() libgimp function
for retrieving it. Note that we already have a similar
gimp_icon_get_theme_dir() PDB function, which we keep around, since
it can be used to dynamically query for the current icon dir,
unlike the former, and since it returns a dynamically-allocated
string, while the rest of the config-related functions return
statically allocated strings.
Use the new function, instead of gimp_get_icon_theme_dir(), in
gimp_ui_init(). This allows gimp_ui_init() to run without making
any PDB calls. Consequently, this allows us to start plug-ins that
call gimp_ui_init() without entering the main loop in the main app.
We're going to add a plug-in that displays an interactive dialog
while the main app is blocking waiting for an operation to
complete, and we need to be able to start the plug-in without
entering the main loop, to avoid the possibility of arbitrary code
being executed during the wait.
Bump the protocol version.
2018-05-29 23:20:54 +08:00
|
|
|
/**
|
|
|
|
* gimp_get_icon_theme_dir:
|
|
|
|
*
|
|
|
|
* Returns the directory of the current icon theme.
|
|
|
|
*
|
|
|
|
* This is a constant value given at plug-in configuration time.
|
|
|
|
*
|
2019-08-03 06:10:14 +08:00
|
|
|
* Returns: the icon theme directory
|
libgimpbase, libgimp, app: pass icon theme dir to plug-ins through config
Pass the current icon theme directory to plug-ins through the
config message, and add a gimp_icon_theme_dir() libgimp function
for retrieving it. Note that we already have a similar
gimp_icon_get_theme_dir() PDB function, which we keep around, since
it can be used to dynamically query for the current icon dir,
unlike the former, and since it returns a dynamically-allocated
string, while the rest of the config-related functions return
statically allocated strings.
Use the new function, instead of gimp_get_icon_theme_dir(), in
gimp_ui_init(). This allows gimp_ui_init() to run without making
any PDB calls. Consequently, this allows us to start plug-ins that
call gimp_ui_init() without entering the main loop in the main app.
We're going to add a plug-in that displays an interactive dialog
while the main app is blocking waiting for an operation to
complete, and we need to be able to start the plug-in without
entering the main loop, to avoid the possibility of arbitrary code
being executed during the wait.
Bump the protocol version.
2018-05-29 23:20:54 +08:00
|
|
|
*
|
|
|
|
* Since: 2.10.4
|
|
|
|
**/
|
|
|
|
const gchar *
|
|
|
|
gimp_icon_theme_dir (void)
|
|
|
|
{
|
|
|
|
return _icon_theme_dir;
|
|
|
|
}
|
|
|
|
|
Changed the semantics of GIMP_EXTENSION and (to some extent) of
2003-06-19 Michael Natterer <mitch@gimp.org>
Changed the semantics of GIMP_EXTENSION and (to some extent)
of GIMP_PLUGIN:
The old meaning of EXTENSION was "I live in the toolbox" and
PLUGIN meant "I take RUN-MODE,IMAGE,DRAWABLE args (but only if I
am invoked interactively)". This is completely useless, since
living in the toolbox means having "<Toolbox>" in the menu_path
and taking RUN-MODE,IMAGE,DRAWABLE means just that, regardless of
what type of procedure we are.
The new meaning of GIMP_PLUGIN is just "I am an ordinary procedure,
I am invoked, do my job and finish", while GIMP_EXTENSION means
"I will install temporary procedures and I will keep running to
keep them available".
(A GIMP_EXTENSION *must* call gimp_extension_ack() now to tell the
core that it's ready to run, or the core will block waiting for
the message !!!).
* configure.in: bumped version number to 1.3.16.
* libgimpbase/gimpprotocol.h: increased protocol version number so
old extensions will refuse to load.
* app/gui/plug-in-commands.c (plug_in_run_cmd_callback): don't
blindly pass RUN-MODE,IMAGE,DRAWABLE to GIMP_PLUGIN procedures but
look at their parameters and pass them either RUN-MODE, or
RUN-MODE,IMAGE, or RUN-MODE,IMAGE,DRAWABLE.
* app/pdb/procedural_db.c: cleaned up, better error reporting,
replaced an impossible error message by g_return_if_fail()
* app/plug-in/plug-in-message.c (plug_in_handle_proc_install):
better error messages.
* app/plug-in/plug-in-params.c: allocate parameter arrays using
g_new0() so we don't have to worry about uninitialized stuff
later.
* app/plug-in/plug-in-run.c (plug_in_run): wait for
gimp_extension_ack() installation confirmation for ALL extensions,
not just for automatically started ones.
* app/plug-in/plug-ins.c: cleanup.
* libgimp/gimp.[ch]: cleaned up and API-documented massively. Made
all magic values given in the GPConfig message static and added
accessor functions for them. Added gimp_tile_width()/height().
Added new function gimp_extension_enable() which turns on
asynchronous processing of temp_proc run requests without having
to enter an endless gimp_extension_process() loop. Moved all
private functions to the end of the file. Added tons of
g_return_if_fail() all over the place. Call gimp_run_procedure2()
from gimp_run_procedure() instead of duplicating the
code. Indentation, spacing, stuff...
* libgimp/gimptile.[ch]: removed gimp_tile_width()/height().
* libgimp/gimpdrawable.c
* libgimp/gimppixelrgn.c
* libgimp/gimptile.c: use the gimp_tile_width()/height() accessor
functions.
* libgimp/gimp.def: added gimp_extension_enable.
* libgimp/gimpmenu.c: removed evil code which connected to
_readchannel manually and use gimp_extension_enable() for watching
temp_procs.
* plug-ins/helpbrowser/helpbrowser.c: removed the same evil code
here and call gimp_extension_enable(). Call gimp_extension_ack()
to let the core know that the temp_proc is installed.
* plug-ins/script-fu/script-fu.c: made all procedures except the
permanently running "extension_script_fu" ordinary GIMP_PLUGIN
procedures.
* plug-ins/common/curve_bend.c
* plug-ins/common/plugindetails.c
* plug-ins/common/screenshot.c
* plug-ins/common/uniteditor.c
* plug-ins/common/winclipboard.c
* plug-ins/dbbrowser/dbbrowser.c
* plug-ins/gfli/gfli.c
* plug-ins/twain/twain.c
* plug-ins/webbrowser/webbrowser.c
* plug-ins/winsnap/winsnap.c: made them all ordinary GIMP_PLUGIN
procedures and renamed them from "extension_*" to "plug_in_*".
Random cleanups.
* app/widgets/gimphelp.c
* plug-ins/maze/maze_face.c: call "plug_in_web_browser" now.
2003-06-20 01:12:00 +08:00
|
|
|
/**
|
|
|
|
* gimp_get_progname:
|
2003-11-08 01:29:02 +08:00
|
|
|
*
|
2007-02-16 19:09:09 +08:00
|
|
|
* Returns the plug-in's executable name.
|
2003-11-08 01:29:02 +08:00
|
|
|
*
|
2019-08-03 06:10:14 +08:00
|
|
|
* Returns: the executable name
|
Changed the semantics of GIMP_EXTENSION and (to some extent) of
2003-06-19 Michael Natterer <mitch@gimp.org>
Changed the semantics of GIMP_EXTENSION and (to some extent)
of GIMP_PLUGIN:
The old meaning of EXTENSION was "I live in the toolbox" and
PLUGIN meant "I take RUN-MODE,IMAGE,DRAWABLE args (but only if I
am invoked interactively)". This is completely useless, since
living in the toolbox means having "<Toolbox>" in the menu_path
and taking RUN-MODE,IMAGE,DRAWABLE means just that, regardless of
what type of procedure we are.
The new meaning of GIMP_PLUGIN is just "I am an ordinary procedure,
I am invoked, do my job and finish", while GIMP_EXTENSION means
"I will install temporary procedures and I will keep running to
keep them available".
(A GIMP_EXTENSION *must* call gimp_extension_ack() now to tell the
core that it's ready to run, or the core will block waiting for
the message !!!).
* configure.in: bumped version number to 1.3.16.
* libgimpbase/gimpprotocol.h: increased protocol version number so
old extensions will refuse to load.
* app/gui/plug-in-commands.c (plug_in_run_cmd_callback): don't
blindly pass RUN-MODE,IMAGE,DRAWABLE to GIMP_PLUGIN procedures but
look at their parameters and pass them either RUN-MODE, or
RUN-MODE,IMAGE, or RUN-MODE,IMAGE,DRAWABLE.
* app/pdb/procedural_db.c: cleaned up, better error reporting,
replaced an impossible error message by g_return_if_fail()
* app/plug-in/plug-in-message.c (plug_in_handle_proc_install):
better error messages.
* app/plug-in/plug-in-params.c: allocate parameter arrays using
g_new0() so we don't have to worry about uninitialized stuff
later.
* app/plug-in/plug-in-run.c (plug_in_run): wait for
gimp_extension_ack() installation confirmation for ALL extensions,
not just for automatically started ones.
* app/plug-in/plug-ins.c: cleanup.
* libgimp/gimp.[ch]: cleaned up and API-documented massively. Made
all magic values given in the GPConfig message static and added
accessor functions for them. Added gimp_tile_width()/height().
Added new function gimp_extension_enable() which turns on
asynchronous processing of temp_proc run requests without having
to enter an endless gimp_extension_process() loop. Moved all
private functions to the end of the file. Added tons of
g_return_if_fail() all over the place. Call gimp_run_procedure2()
from gimp_run_procedure() instead of duplicating the
code. Indentation, spacing, stuff...
* libgimp/gimptile.[ch]: removed gimp_tile_width()/height().
* libgimp/gimpdrawable.c
* libgimp/gimppixelrgn.c
* libgimp/gimptile.c: use the gimp_tile_width()/height() accessor
functions.
* libgimp/gimp.def: added gimp_extension_enable.
* libgimp/gimpmenu.c: removed evil code which connected to
_readchannel manually and use gimp_extension_enable() for watching
temp_procs.
* plug-ins/helpbrowser/helpbrowser.c: removed the same evil code
here and call gimp_extension_enable(). Call gimp_extension_ack()
to let the core know that the temp_proc is installed.
* plug-ins/script-fu/script-fu.c: made all procedures except the
permanently running "extension_script_fu" ordinary GIMP_PLUGIN
procedures.
* plug-ins/common/curve_bend.c
* plug-ins/common/plugindetails.c
* plug-ins/common/screenshot.c
* plug-ins/common/uniteditor.c
* plug-ins/common/winclipboard.c
* plug-ins/dbbrowser/dbbrowser.c
* plug-ins/gfli/gfli.c
* plug-ins/twain/twain.c
* plug-ins/webbrowser/webbrowser.c
* plug-ins/winsnap/winsnap.c: made them all ordinary GIMP_PLUGIN
procedures and renamed them from "extension_*" to "plug_in_*".
Random cleanups.
* app/widgets/gimphelp.c
* plug-ins/maze/maze_face.c: call "plug_in_web_browser" now.
2003-06-20 01:12:00 +08:00
|
|
|
**/
|
|
|
|
const gchar *
|
|
|
|
gimp_get_progname (void)
|
1998-09-19 08:40:27 +08:00
|
|
|
{
|
Changed the semantics of GIMP_EXTENSION and (to some extent) of
2003-06-19 Michael Natterer <mitch@gimp.org>
Changed the semantics of GIMP_EXTENSION and (to some extent)
of GIMP_PLUGIN:
The old meaning of EXTENSION was "I live in the toolbox" and
PLUGIN meant "I take RUN-MODE,IMAGE,DRAWABLE args (but only if I
am invoked interactively)". This is completely useless, since
living in the toolbox means having "<Toolbox>" in the menu_path
and taking RUN-MODE,IMAGE,DRAWABLE means just that, regardless of
what type of procedure we are.
The new meaning of GIMP_PLUGIN is just "I am an ordinary procedure,
I am invoked, do my job and finish", while GIMP_EXTENSION means
"I will install temporary procedures and I will keep running to
keep them available".
(A GIMP_EXTENSION *must* call gimp_extension_ack() now to tell the
core that it's ready to run, or the core will block waiting for
the message !!!).
* configure.in: bumped version number to 1.3.16.
* libgimpbase/gimpprotocol.h: increased protocol version number so
old extensions will refuse to load.
* app/gui/plug-in-commands.c (plug_in_run_cmd_callback): don't
blindly pass RUN-MODE,IMAGE,DRAWABLE to GIMP_PLUGIN procedures but
look at their parameters and pass them either RUN-MODE, or
RUN-MODE,IMAGE, or RUN-MODE,IMAGE,DRAWABLE.
* app/pdb/procedural_db.c: cleaned up, better error reporting,
replaced an impossible error message by g_return_if_fail()
* app/plug-in/plug-in-message.c (plug_in_handle_proc_install):
better error messages.
* app/plug-in/plug-in-params.c: allocate parameter arrays using
g_new0() so we don't have to worry about uninitialized stuff
later.
* app/plug-in/plug-in-run.c (plug_in_run): wait for
gimp_extension_ack() installation confirmation for ALL extensions,
not just for automatically started ones.
* app/plug-in/plug-ins.c: cleanup.
* libgimp/gimp.[ch]: cleaned up and API-documented massively. Made
all magic values given in the GPConfig message static and added
accessor functions for them. Added gimp_tile_width()/height().
Added new function gimp_extension_enable() which turns on
asynchronous processing of temp_proc run requests without having
to enter an endless gimp_extension_process() loop. Moved all
private functions to the end of the file. Added tons of
g_return_if_fail() all over the place. Call gimp_run_procedure2()
from gimp_run_procedure() instead of duplicating the
code. Indentation, spacing, stuff...
* libgimp/gimptile.[ch]: removed gimp_tile_width()/height().
* libgimp/gimpdrawable.c
* libgimp/gimppixelrgn.c
* libgimp/gimptile.c: use the gimp_tile_width()/height() accessor
functions.
* libgimp/gimp.def: added gimp_extension_enable.
* libgimp/gimpmenu.c: removed evil code which connected to
_readchannel manually and use gimp_extension_enable() for watching
temp_procs.
* plug-ins/helpbrowser/helpbrowser.c: removed the same evil code
here and call gimp_extension_enable(). Call gimp_extension_ack()
to let the core know that the temp_proc is installed.
* plug-ins/script-fu/script-fu.c: made all procedures except the
permanently running "extension_script_fu" ordinary GIMP_PLUGIN
procedures.
* plug-ins/common/curve_bend.c
* plug-ins/common/plugindetails.c
* plug-ins/common/screenshot.c
* plug-ins/common/uniteditor.c
* plug-ins/common/winclipboard.c
* plug-ins/dbbrowser/dbbrowser.c
* plug-ins/gfli/gfli.c
* plug-ins/twain/twain.c
* plug-ins/webbrowser/webbrowser.c
* plug-ins/winsnap/winsnap.c: made them all ordinary GIMP_PLUGIN
procedures and renamed them from "extension_*" to "plug_in_*".
Random cleanups.
* app/widgets/gimphelp.c
* plug-ins/maze/maze_face.c: call "plug_in_web_browser" now.
2003-06-20 01:12:00 +08:00
|
|
|
return progname;
|
|
|
|
}
|
1998-09-19 08:40:27 +08:00
|
|
|
|
Changed the semantics of GIMP_EXTENSION and (to some extent) of
2003-06-19 Michael Natterer <mitch@gimp.org>
Changed the semantics of GIMP_EXTENSION and (to some extent)
of GIMP_PLUGIN:
The old meaning of EXTENSION was "I live in the toolbox" and
PLUGIN meant "I take RUN-MODE,IMAGE,DRAWABLE args (but only if I
am invoked interactively)". This is completely useless, since
living in the toolbox means having "<Toolbox>" in the menu_path
and taking RUN-MODE,IMAGE,DRAWABLE means just that, regardless of
what type of procedure we are.
The new meaning of GIMP_PLUGIN is just "I am an ordinary procedure,
I am invoked, do my job and finish", while GIMP_EXTENSION means
"I will install temporary procedures and I will keep running to
keep them available".
(A GIMP_EXTENSION *must* call gimp_extension_ack() now to tell the
core that it's ready to run, or the core will block waiting for
the message !!!).
* configure.in: bumped version number to 1.3.16.
* libgimpbase/gimpprotocol.h: increased protocol version number so
old extensions will refuse to load.
* app/gui/plug-in-commands.c (plug_in_run_cmd_callback): don't
blindly pass RUN-MODE,IMAGE,DRAWABLE to GIMP_PLUGIN procedures but
look at their parameters and pass them either RUN-MODE, or
RUN-MODE,IMAGE, or RUN-MODE,IMAGE,DRAWABLE.
* app/pdb/procedural_db.c: cleaned up, better error reporting,
replaced an impossible error message by g_return_if_fail()
* app/plug-in/plug-in-message.c (plug_in_handle_proc_install):
better error messages.
* app/plug-in/plug-in-params.c: allocate parameter arrays using
g_new0() so we don't have to worry about uninitialized stuff
later.
* app/plug-in/plug-in-run.c (plug_in_run): wait for
gimp_extension_ack() installation confirmation for ALL extensions,
not just for automatically started ones.
* app/plug-in/plug-ins.c: cleanup.
* libgimp/gimp.[ch]: cleaned up and API-documented massively. Made
all magic values given in the GPConfig message static and added
accessor functions for them. Added gimp_tile_width()/height().
Added new function gimp_extension_enable() which turns on
asynchronous processing of temp_proc run requests without having
to enter an endless gimp_extension_process() loop. Moved all
private functions to the end of the file. Added tons of
g_return_if_fail() all over the place. Call gimp_run_procedure2()
from gimp_run_procedure() instead of duplicating the
code. Indentation, spacing, stuff...
* libgimp/gimptile.[ch]: removed gimp_tile_width()/height().
* libgimp/gimpdrawable.c
* libgimp/gimppixelrgn.c
* libgimp/gimptile.c: use the gimp_tile_width()/height() accessor
functions.
* libgimp/gimp.def: added gimp_extension_enable.
* libgimp/gimpmenu.c: removed evil code which connected to
_readchannel manually and use gimp_extension_enable() for watching
temp_procs.
* plug-ins/helpbrowser/helpbrowser.c: removed the same evil code
here and call gimp_extension_enable(). Call gimp_extension_ack()
to let the core know that the temp_proc is installed.
* plug-ins/script-fu/script-fu.c: made all procedures except the
permanently running "extension_script_fu" ordinary GIMP_PLUGIN
procedures.
* plug-ins/common/curve_bend.c
* plug-ins/common/plugindetails.c
* plug-ins/common/screenshot.c
* plug-ins/common/uniteditor.c
* plug-ins/common/winclipboard.c
* plug-ins/dbbrowser/dbbrowser.c
* plug-ins/gfli/gfli.c
* plug-ins/twain/twain.c
* plug-ins/webbrowser/webbrowser.c
* plug-ins/winsnap/winsnap.c: made them all ordinary GIMP_PLUGIN
procedures and renamed them from "extension_*" to "plug_in_*".
Random cleanups.
* app/widgets/gimphelp.c
* plug-ins/maze/maze_face.c: call "plug_in_web_browser" now.
2003-06-20 01:12:00 +08:00
|
|
|
|
|
|
|
/* private functions */
|
|
|
|
|
2019-08-03 00:44:34 +08:00
|
|
|
static void
|
|
|
|
gimp_close (void)
|
Changed the semantics of GIMP_EXTENSION and (to some extent) of
2003-06-19 Michael Natterer <mitch@gimp.org>
Changed the semantics of GIMP_EXTENSION and (to some extent)
of GIMP_PLUGIN:
The old meaning of EXTENSION was "I live in the toolbox" and
PLUGIN meant "I take RUN-MODE,IMAGE,DRAWABLE args (but only if I
am invoked interactively)". This is completely useless, since
living in the toolbox means having "<Toolbox>" in the menu_path
and taking RUN-MODE,IMAGE,DRAWABLE means just that, regardless of
what type of procedure we are.
The new meaning of GIMP_PLUGIN is just "I am an ordinary procedure,
I am invoked, do my job and finish", while GIMP_EXTENSION means
"I will install temporary procedures and I will keep running to
keep them available".
(A GIMP_EXTENSION *must* call gimp_extension_ack() now to tell the
core that it's ready to run, or the core will block waiting for
the message !!!).
* configure.in: bumped version number to 1.3.16.
* libgimpbase/gimpprotocol.h: increased protocol version number so
old extensions will refuse to load.
* app/gui/plug-in-commands.c (plug_in_run_cmd_callback): don't
blindly pass RUN-MODE,IMAGE,DRAWABLE to GIMP_PLUGIN procedures but
look at their parameters and pass them either RUN-MODE, or
RUN-MODE,IMAGE, or RUN-MODE,IMAGE,DRAWABLE.
* app/pdb/procedural_db.c: cleaned up, better error reporting,
replaced an impossible error message by g_return_if_fail()
* app/plug-in/plug-in-message.c (plug_in_handle_proc_install):
better error messages.
* app/plug-in/plug-in-params.c: allocate parameter arrays using
g_new0() so we don't have to worry about uninitialized stuff
later.
* app/plug-in/plug-in-run.c (plug_in_run): wait for
gimp_extension_ack() installation confirmation for ALL extensions,
not just for automatically started ones.
* app/plug-in/plug-ins.c: cleanup.
* libgimp/gimp.[ch]: cleaned up and API-documented massively. Made
all magic values given in the GPConfig message static and added
accessor functions for them. Added gimp_tile_width()/height().
Added new function gimp_extension_enable() which turns on
asynchronous processing of temp_proc run requests without having
to enter an endless gimp_extension_process() loop. Moved all
private functions to the end of the file. Added tons of
g_return_if_fail() all over the place. Call gimp_run_procedure2()
from gimp_run_procedure() instead of duplicating the
code. Indentation, spacing, stuff...
* libgimp/gimptile.[ch]: removed gimp_tile_width()/height().
* libgimp/gimpdrawable.c
* libgimp/gimppixelrgn.c
* libgimp/gimptile.c: use the gimp_tile_width()/height() accessor
functions.
* libgimp/gimp.def: added gimp_extension_enable.
* libgimp/gimpmenu.c: removed evil code which connected to
_readchannel manually and use gimp_extension_enable() for watching
temp_procs.
* plug-ins/helpbrowser/helpbrowser.c: removed the same evil code
here and call gimp_extension_enable(). Call gimp_extension_ack()
to let the core know that the temp_proc is installed.
* plug-ins/script-fu/script-fu.c: made all procedures except the
permanently running "extension_script_fu" ordinary GIMP_PLUGIN
procedures.
* plug-ins/common/curve_bend.c
* plug-ins/common/plugindetails.c
* plug-ins/common/screenshot.c
* plug-ins/common/uniteditor.c
* plug-ins/common/winclipboard.c
* plug-ins/dbbrowser/dbbrowser.c
* plug-ins/gfli/gfli.c
* plug-ins/twain/twain.c
* plug-ins/webbrowser/webbrowser.c
* plug-ins/winsnap/winsnap.c: made them all ordinary GIMP_PLUGIN
procedures and renamed them from "extension_*" to "plug_in_*".
Random cleanups.
* app/widgets/gimphelp.c
* plug-ins/maze/maze_face.c: call "plug_in_web_browser" now.
2003-06-20 01:12:00 +08:00
|
|
|
{
|
|
|
|
if (gimp_debug_flags & GIMP_DEBUG_QUIT)
|
|
|
|
gimp_debug_stop ();
|
|
|
|
|
2019-07-26 05:07:24 +08:00
|
|
|
if (PLUG_IN)
|
|
|
|
{
|
|
|
|
_gimp_plug_in_quit (PLUG_IN);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (PLUG_IN_INFO.quit_proc)
|
|
|
|
PLUG_IN_INFO.quit_proc ();
|
|
|
|
}
|
Changed the semantics of GIMP_EXTENSION and (to some extent) of
2003-06-19 Michael Natterer <mitch@gimp.org>
Changed the semantics of GIMP_EXTENSION and (to some extent)
of GIMP_PLUGIN:
The old meaning of EXTENSION was "I live in the toolbox" and
PLUGIN meant "I take RUN-MODE,IMAGE,DRAWABLE args (but only if I
am invoked interactively)". This is completely useless, since
living in the toolbox means having "<Toolbox>" in the menu_path
and taking RUN-MODE,IMAGE,DRAWABLE means just that, regardless of
what type of procedure we are.
The new meaning of GIMP_PLUGIN is just "I am an ordinary procedure,
I am invoked, do my job and finish", while GIMP_EXTENSION means
"I will install temporary procedures and I will keep running to
keep them available".
(A GIMP_EXTENSION *must* call gimp_extension_ack() now to tell the
core that it's ready to run, or the core will block waiting for
the message !!!).
* configure.in: bumped version number to 1.3.16.
* libgimpbase/gimpprotocol.h: increased protocol version number so
old extensions will refuse to load.
* app/gui/plug-in-commands.c (plug_in_run_cmd_callback): don't
blindly pass RUN-MODE,IMAGE,DRAWABLE to GIMP_PLUGIN procedures but
look at their parameters and pass them either RUN-MODE, or
RUN-MODE,IMAGE, or RUN-MODE,IMAGE,DRAWABLE.
* app/pdb/procedural_db.c: cleaned up, better error reporting,
replaced an impossible error message by g_return_if_fail()
* app/plug-in/plug-in-message.c (plug_in_handle_proc_install):
better error messages.
* app/plug-in/plug-in-params.c: allocate parameter arrays using
g_new0() so we don't have to worry about uninitialized stuff
later.
* app/plug-in/plug-in-run.c (plug_in_run): wait for
gimp_extension_ack() installation confirmation for ALL extensions,
not just for automatically started ones.
* app/plug-in/plug-ins.c: cleanup.
* libgimp/gimp.[ch]: cleaned up and API-documented massively. Made
all magic values given in the GPConfig message static and added
accessor functions for them. Added gimp_tile_width()/height().
Added new function gimp_extension_enable() which turns on
asynchronous processing of temp_proc run requests without having
to enter an endless gimp_extension_process() loop. Moved all
private functions to the end of the file. Added tons of
g_return_if_fail() all over the place. Call gimp_run_procedure2()
from gimp_run_procedure() instead of duplicating the
code. Indentation, spacing, stuff...
* libgimp/gimptile.[ch]: removed gimp_tile_width()/height().
* libgimp/gimpdrawable.c
* libgimp/gimppixelrgn.c
* libgimp/gimptile.c: use the gimp_tile_width()/height() accessor
functions.
* libgimp/gimp.def: added gimp_extension_enable.
* libgimp/gimpmenu.c: removed evil code which connected to
_readchannel manually and use gimp_extension_enable() for watching
temp_procs.
* plug-ins/helpbrowser/helpbrowser.c: removed the same evil code
here and call gimp_extension_enable(). Call gimp_extension_ack()
to let the core know that the temp_proc is installed.
* plug-ins/script-fu/script-fu.c: made all procedures except the
permanently running "extension_script_fu" ordinary GIMP_PLUGIN
procedures.
* plug-ins/common/curve_bend.c
* plug-ins/common/plugindetails.c
* plug-ins/common/screenshot.c
* plug-ins/common/uniteditor.c
* plug-ins/common/winclipboard.c
* plug-ins/dbbrowser/dbbrowser.c
* plug-ins/gfli/gfli.c
* plug-ins/twain/twain.c
* plug-ins/webbrowser/webbrowser.c
* plug-ins/winsnap/winsnap.c: made them all ordinary GIMP_PLUGIN
procedures and renamed them from "extension_*" to "plug_in_*".
Random cleanups.
* app/widgets/gimphelp.c
* plug-ins/maze/maze_face.c: call "plug_in_web_browser" now.
2003-06-20 01:12:00 +08:00
|
|
|
|
2003-12-27 16:07:15 +08:00
|
|
|
#if defined(USE_SYSV_SHM)
|
|
|
|
|
Changed the semantics of GIMP_EXTENSION and (to some extent) of
2003-06-19 Michael Natterer <mitch@gimp.org>
Changed the semantics of GIMP_EXTENSION and (to some extent)
of GIMP_PLUGIN:
The old meaning of EXTENSION was "I live in the toolbox" and
PLUGIN meant "I take RUN-MODE,IMAGE,DRAWABLE args (but only if I
am invoked interactively)". This is completely useless, since
living in the toolbox means having "<Toolbox>" in the menu_path
and taking RUN-MODE,IMAGE,DRAWABLE means just that, regardless of
what type of procedure we are.
The new meaning of GIMP_PLUGIN is just "I am an ordinary procedure,
I am invoked, do my job and finish", while GIMP_EXTENSION means
"I will install temporary procedures and I will keep running to
keep them available".
(A GIMP_EXTENSION *must* call gimp_extension_ack() now to tell the
core that it's ready to run, or the core will block waiting for
the message !!!).
* configure.in: bumped version number to 1.3.16.
* libgimpbase/gimpprotocol.h: increased protocol version number so
old extensions will refuse to load.
* app/gui/plug-in-commands.c (plug_in_run_cmd_callback): don't
blindly pass RUN-MODE,IMAGE,DRAWABLE to GIMP_PLUGIN procedures but
look at their parameters and pass them either RUN-MODE, or
RUN-MODE,IMAGE, or RUN-MODE,IMAGE,DRAWABLE.
* app/pdb/procedural_db.c: cleaned up, better error reporting,
replaced an impossible error message by g_return_if_fail()
* app/plug-in/plug-in-message.c (plug_in_handle_proc_install):
better error messages.
* app/plug-in/plug-in-params.c: allocate parameter arrays using
g_new0() so we don't have to worry about uninitialized stuff
later.
* app/plug-in/plug-in-run.c (plug_in_run): wait for
gimp_extension_ack() installation confirmation for ALL extensions,
not just for automatically started ones.
* app/plug-in/plug-ins.c: cleanup.
* libgimp/gimp.[ch]: cleaned up and API-documented massively. Made
all magic values given in the GPConfig message static and added
accessor functions for them. Added gimp_tile_width()/height().
Added new function gimp_extension_enable() which turns on
asynchronous processing of temp_proc run requests without having
to enter an endless gimp_extension_process() loop. Moved all
private functions to the end of the file. Added tons of
g_return_if_fail() all over the place. Call gimp_run_procedure2()
from gimp_run_procedure() instead of duplicating the
code. Indentation, spacing, stuff...
* libgimp/gimptile.[ch]: removed gimp_tile_width()/height().
* libgimp/gimpdrawable.c
* libgimp/gimppixelrgn.c
* libgimp/gimptile.c: use the gimp_tile_width()/height() accessor
functions.
* libgimp/gimp.def: added gimp_extension_enable.
* libgimp/gimpmenu.c: removed evil code which connected to
_readchannel manually and use gimp_extension_enable() for watching
temp_procs.
* plug-ins/helpbrowser/helpbrowser.c: removed the same evil code
here and call gimp_extension_enable(). Call gimp_extension_ack()
to let the core know that the temp_proc is installed.
* plug-ins/script-fu/script-fu.c: made all procedures except the
permanently running "extension_script_fu" ordinary GIMP_PLUGIN
procedures.
* plug-ins/common/curve_bend.c
* plug-ins/common/plugindetails.c
* plug-ins/common/screenshot.c
* plug-ins/common/uniteditor.c
* plug-ins/common/winclipboard.c
* plug-ins/dbbrowser/dbbrowser.c
* plug-ins/gfli/gfli.c
* plug-ins/twain/twain.c
* plug-ins/webbrowser/webbrowser.c
* plug-ins/winsnap/winsnap.c: made them all ordinary GIMP_PLUGIN
procedures and renamed them from "extension_*" to "plug_in_*".
Random cleanups.
* app/widgets/gimphelp.c
* plug-ins/maze/maze_face.c: call "plug_in_web_browser" now.
2003-06-20 01:12:00 +08:00
|
|
|
if ((_shm_ID != -1) && _shm_addr)
|
2006-06-21 19:00:51 +08:00
|
|
|
shmdt ((char *) _shm_addr);
|
2003-12-27 16:07:15 +08:00
|
|
|
|
|
|
|
#elif defined(USE_WIN32_SHM)
|
|
|
|
|
|
|
|
if (shm_handle)
|
|
|
|
CloseHandle (shm_handle);
|
|
|
|
|
|
|
|
#elif defined(USE_POSIX_SHM)
|
|
|
|
|
|
|
|
if ((_shm_ID != -1) && (_shm_addr != MAP_FAILED))
|
|
|
|
munmap (_shm_addr, TILE_MAP_SIZE);
|
|
|
|
|
Changed the semantics of GIMP_EXTENSION and (to some extent) of
2003-06-19 Michael Natterer <mitch@gimp.org>
Changed the semantics of GIMP_EXTENSION and (to some extent)
of GIMP_PLUGIN:
The old meaning of EXTENSION was "I live in the toolbox" and
PLUGIN meant "I take RUN-MODE,IMAGE,DRAWABLE args (but only if I
am invoked interactively)". This is completely useless, since
living in the toolbox means having "<Toolbox>" in the menu_path
and taking RUN-MODE,IMAGE,DRAWABLE means just that, regardless of
what type of procedure we are.
The new meaning of GIMP_PLUGIN is just "I am an ordinary procedure,
I am invoked, do my job and finish", while GIMP_EXTENSION means
"I will install temporary procedures and I will keep running to
keep them available".
(A GIMP_EXTENSION *must* call gimp_extension_ack() now to tell the
core that it's ready to run, or the core will block waiting for
the message !!!).
* configure.in: bumped version number to 1.3.16.
* libgimpbase/gimpprotocol.h: increased protocol version number so
old extensions will refuse to load.
* app/gui/plug-in-commands.c (plug_in_run_cmd_callback): don't
blindly pass RUN-MODE,IMAGE,DRAWABLE to GIMP_PLUGIN procedures but
look at their parameters and pass them either RUN-MODE, or
RUN-MODE,IMAGE, or RUN-MODE,IMAGE,DRAWABLE.
* app/pdb/procedural_db.c: cleaned up, better error reporting,
replaced an impossible error message by g_return_if_fail()
* app/plug-in/plug-in-message.c (plug_in_handle_proc_install):
better error messages.
* app/plug-in/plug-in-params.c: allocate parameter arrays using
g_new0() so we don't have to worry about uninitialized stuff
later.
* app/plug-in/plug-in-run.c (plug_in_run): wait for
gimp_extension_ack() installation confirmation for ALL extensions,
not just for automatically started ones.
* app/plug-in/plug-ins.c: cleanup.
* libgimp/gimp.[ch]: cleaned up and API-documented massively. Made
all magic values given in the GPConfig message static and added
accessor functions for them. Added gimp_tile_width()/height().
Added new function gimp_extension_enable() which turns on
asynchronous processing of temp_proc run requests without having
to enter an endless gimp_extension_process() loop. Moved all
private functions to the end of the file. Added tons of
g_return_if_fail() all over the place. Call gimp_run_procedure2()
from gimp_run_procedure() instead of duplicating the
code. Indentation, spacing, stuff...
* libgimp/gimptile.[ch]: removed gimp_tile_width()/height().
* libgimp/gimpdrawable.c
* libgimp/gimppixelrgn.c
* libgimp/gimptile.c: use the gimp_tile_width()/height() accessor
functions.
* libgimp/gimp.def: added gimp_extension_enable.
* libgimp/gimpmenu.c: removed evil code which connected to
_readchannel manually and use gimp_extension_enable() for watching
temp_procs.
* plug-ins/helpbrowser/helpbrowser.c: removed the same evil code
here and call gimp_extension_enable(). Call gimp_extension_ack()
to let the core know that the temp_proc is installed.
* plug-ins/script-fu/script-fu.c: made all procedures except the
permanently running "extension_script_fu" ordinary GIMP_PLUGIN
procedures.
* plug-ins/common/curve_bend.c
* plug-ins/common/plugindetails.c
* plug-ins/common/screenshot.c
* plug-ins/common/uniteditor.c
* plug-ins/common/winclipboard.c
* plug-ins/dbbrowser/dbbrowser.c
* plug-ins/gfli/gfli.c
* plug-ins/twain/twain.c
* plug-ins/webbrowser/webbrowser.c
* plug-ins/winsnap/winsnap.c: made them all ordinary GIMP_PLUGIN
procedures and renamed them from "extension_*" to "plug_in_*".
Random cleanups.
* app/widgets/gimphelp.c
* plug-ins/maze/maze_face.c: call "plug_in_web_browser" now.
2003-06-20 01:12:00 +08:00
|
|
|
#endif
|
|
|
|
|
2019-07-31 05:48:37 +08:00
|
|
|
gp_quit_write (_gimp_writechannel, NULL);
|
Changed the semantics of GIMP_EXTENSION and (to some extent) of
2003-06-19 Michael Natterer <mitch@gimp.org>
Changed the semantics of GIMP_EXTENSION and (to some extent)
of GIMP_PLUGIN:
The old meaning of EXTENSION was "I live in the toolbox" and
PLUGIN meant "I take RUN-MODE,IMAGE,DRAWABLE args (but only if I
am invoked interactively)". This is completely useless, since
living in the toolbox means having "<Toolbox>" in the menu_path
and taking RUN-MODE,IMAGE,DRAWABLE means just that, regardless of
what type of procedure we are.
The new meaning of GIMP_PLUGIN is just "I am an ordinary procedure,
I am invoked, do my job and finish", while GIMP_EXTENSION means
"I will install temporary procedures and I will keep running to
keep them available".
(A GIMP_EXTENSION *must* call gimp_extension_ack() now to tell the
core that it's ready to run, or the core will block waiting for
the message !!!).
* configure.in: bumped version number to 1.3.16.
* libgimpbase/gimpprotocol.h: increased protocol version number so
old extensions will refuse to load.
* app/gui/plug-in-commands.c (plug_in_run_cmd_callback): don't
blindly pass RUN-MODE,IMAGE,DRAWABLE to GIMP_PLUGIN procedures but
look at their parameters and pass them either RUN-MODE, or
RUN-MODE,IMAGE, or RUN-MODE,IMAGE,DRAWABLE.
* app/pdb/procedural_db.c: cleaned up, better error reporting,
replaced an impossible error message by g_return_if_fail()
* app/plug-in/plug-in-message.c (plug_in_handle_proc_install):
better error messages.
* app/plug-in/plug-in-params.c: allocate parameter arrays using
g_new0() so we don't have to worry about uninitialized stuff
later.
* app/plug-in/plug-in-run.c (plug_in_run): wait for
gimp_extension_ack() installation confirmation for ALL extensions,
not just for automatically started ones.
* app/plug-in/plug-ins.c: cleanup.
* libgimp/gimp.[ch]: cleaned up and API-documented massively. Made
all magic values given in the GPConfig message static and added
accessor functions for them. Added gimp_tile_width()/height().
Added new function gimp_extension_enable() which turns on
asynchronous processing of temp_proc run requests without having
to enter an endless gimp_extension_process() loop. Moved all
private functions to the end of the file. Added tons of
g_return_if_fail() all over the place. Call gimp_run_procedure2()
from gimp_run_procedure() instead of duplicating the
code. Indentation, spacing, stuff...
* libgimp/gimptile.[ch]: removed gimp_tile_width()/height().
* libgimp/gimpdrawable.c
* libgimp/gimppixelrgn.c
* libgimp/gimptile.c: use the gimp_tile_width()/height() accessor
functions.
* libgimp/gimp.def: added gimp_extension_enable.
* libgimp/gimpmenu.c: removed evil code which connected to
_readchannel manually and use gimp_extension_enable() for watching
temp_procs.
* plug-ins/helpbrowser/helpbrowser.c: removed the same evil code
here and call gimp_extension_enable(). Call gimp_extension_ack()
to let the core know that the temp_proc is installed.
* plug-ins/script-fu/script-fu.c: made all procedures except the
permanently running "extension_script_fu" ordinary GIMP_PLUGIN
procedures.
* plug-ins/common/curve_bend.c
* plug-ins/common/plugindetails.c
* plug-ins/common/screenshot.c
* plug-ins/common/uniteditor.c
* plug-ins/common/winclipboard.c
* plug-ins/dbbrowser/dbbrowser.c
* plug-ins/gfli/gfli.c
* plug-ins/twain/twain.c
* plug-ins/webbrowser/webbrowser.c
* plug-ins/winsnap/winsnap.c: made them all ordinary GIMP_PLUGIN
procedures and renamed them from "extension_*" to "plug_in_*".
Random cleanups.
* app/widgets/gimphelp.c
* plug-ins/maze/maze_face.c: call "plug_in_web_browser" now.
2003-06-20 01:12:00 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_debug_stop (void)
|
|
|
|
{
|
|
|
|
#ifndef G_OS_WIN32
|
2013-02-23 23:25:58 +08:00
|
|
|
|
Changed the semantics of GIMP_EXTENSION and (to some extent) of
2003-06-19 Michael Natterer <mitch@gimp.org>
Changed the semantics of GIMP_EXTENSION and (to some extent)
of GIMP_PLUGIN:
The old meaning of EXTENSION was "I live in the toolbox" and
PLUGIN meant "I take RUN-MODE,IMAGE,DRAWABLE args (but only if I
am invoked interactively)". This is completely useless, since
living in the toolbox means having "<Toolbox>" in the menu_path
and taking RUN-MODE,IMAGE,DRAWABLE means just that, regardless of
what type of procedure we are.
The new meaning of GIMP_PLUGIN is just "I am an ordinary procedure,
I am invoked, do my job and finish", while GIMP_EXTENSION means
"I will install temporary procedures and I will keep running to
keep them available".
(A GIMP_EXTENSION *must* call gimp_extension_ack() now to tell the
core that it's ready to run, or the core will block waiting for
the message !!!).
* configure.in: bumped version number to 1.3.16.
* libgimpbase/gimpprotocol.h: increased protocol version number so
old extensions will refuse to load.
* app/gui/plug-in-commands.c (plug_in_run_cmd_callback): don't
blindly pass RUN-MODE,IMAGE,DRAWABLE to GIMP_PLUGIN procedures but
look at their parameters and pass them either RUN-MODE, or
RUN-MODE,IMAGE, or RUN-MODE,IMAGE,DRAWABLE.
* app/pdb/procedural_db.c: cleaned up, better error reporting,
replaced an impossible error message by g_return_if_fail()
* app/plug-in/plug-in-message.c (plug_in_handle_proc_install):
better error messages.
* app/plug-in/plug-in-params.c: allocate parameter arrays using
g_new0() so we don't have to worry about uninitialized stuff
later.
* app/plug-in/plug-in-run.c (plug_in_run): wait for
gimp_extension_ack() installation confirmation for ALL extensions,
not just for automatically started ones.
* app/plug-in/plug-ins.c: cleanup.
* libgimp/gimp.[ch]: cleaned up and API-documented massively. Made
all magic values given in the GPConfig message static and added
accessor functions for them. Added gimp_tile_width()/height().
Added new function gimp_extension_enable() which turns on
asynchronous processing of temp_proc run requests without having
to enter an endless gimp_extension_process() loop. Moved all
private functions to the end of the file. Added tons of
g_return_if_fail() all over the place. Call gimp_run_procedure2()
from gimp_run_procedure() instead of duplicating the
code. Indentation, spacing, stuff...
* libgimp/gimptile.[ch]: removed gimp_tile_width()/height().
* libgimp/gimpdrawable.c
* libgimp/gimppixelrgn.c
* libgimp/gimptile.c: use the gimp_tile_width()/height() accessor
functions.
* libgimp/gimp.def: added gimp_extension_enable.
* libgimp/gimpmenu.c: removed evil code which connected to
_readchannel manually and use gimp_extension_enable() for watching
temp_procs.
* plug-ins/helpbrowser/helpbrowser.c: removed the same evil code
here and call gimp_extension_enable(). Call gimp_extension_ack()
to let the core know that the temp_proc is installed.
* plug-ins/script-fu/script-fu.c: made all procedures except the
permanently running "extension_script_fu" ordinary GIMP_PLUGIN
procedures.
* plug-ins/common/curve_bend.c
* plug-ins/common/plugindetails.c
* plug-ins/common/screenshot.c
* plug-ins/common/uniteditor.c
* plug-ins/common/winclipboard.c
* plug-ins/dbbrowser/dbbrowser.c
* plug-ins/gfli/gfli.c
* plug-ins/twain/twain.c
* plug-ins/webbrowser/webbrowser.c
* plug-ins/winsnap/winsnap.c: made them all ordinary GIMP_PLUGIN
procedures and renamed them from "extension_*" to "plug_in_*".
Random cleanups.
* app/widgets/gimphelp.c
* plug-ins/maze/maze_face.c: call "plug_in_web_browser" now.
2003-06-20 01:12:00 +08:00
|
|
|
g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Waiting for debugger...");
|
2003-07-14 02:03:42 +08:00
|
|
|
raise (SIGSTOP);
|
2013-02-23 23:25:58 +08:00
|
|
|
|
Changed the semantics of GIMP_EXTENSION and (to some extent) of
2003-06-19 Michael Natterer <mitch@gimp.org>
Changed the semantics of GIMP_EXTENSION and (to some extent)
of GIMP_PLUGIN:
The old meaning of EXTENSION was "I live in the toolbox" and
PLUGIN meant "I take RUN-MODE,IMAGE,DRAWABLE args (but only if I
am invoked interactively)". This is completely useless, since
living in the toolbox means having "<Toolbox>" in the menu_path
and taking RUN-MODE,IMAGE,DRAWABLE means just that, regardless of
what type of procedure we are.
The new meaning of GIMP_PLUGIN is just "I am an ordinary procedure,
I am invoked, do my job and finish", while GIMP_EXTENSION means
"I will install temporary procedures and I will keep running to
keep them available".
(A GIMP_EXTENSION *must* call gimp_extension_ack() now to tell the
core that it's ready to run, or the core will block waiting for
the message !!!).
* configure.in: bumped version number to 1.3.16.
* libgimpbase/gimpprotocol.h: increased protocol version number so
old extensions will refuse to load.
* app/gui/plug-in-commands.c (plug_in_run_cmd_callback): don't
blindly pass RUN-MODE,IMAGE,DRAWABLE to GIMP_PLUGIN procedures but
look at their parameters and pass them either RUN-MODE, or
RUN-MODE,IMAGE, or RUN-MODE,IMAGE,DRAWABLE.
* app/pdb/procedural_db.c: cleaned up, better error reporting,
replaced an impossible error message by g_return_if_fail()
* app/plug-in/plug-in-message.c (plug_in_handle_proc_install):
better error messages.
* app/plug-in/plug-in-params.c: allocate parameter arrays using
g_new0() so we don't have to worry about uninitialized stuff
later.
* app/plug-in/plug-in-run.c (plug_in_run): wait for
gimp_extension_ack() installation confirmation for ALL extensions,
not just for automatically started ones.
* app/plug-in/plug-ins.c: cleanup.
* libgimp/gimp.[ch]: cleaned up and API-documented massively. Made
all magic values given in the GPConfig message static and added
accessor functions for them. Added gimp_tile_width()/height().
Added new function gimp_extension_enable() which turns on
asynchronous processing of temp_proc run requests without having
to enter an endless gimp_extension_process() loop. Moved all
private functions to the end of the file. Added tons of
g_return_if_fail() all over the place. Call gimp_run_procedure2()
from gimp_run_procedure() instead of duplicating the
code. Indentation, spacing, stuff...
* libgimp/gimptile.[ch]: removed gimp_tile_width()/height().
* libgimp/gimpdrawable.c
* libgimp/gimppixelrgn.c
* libgimp/gimptile.c: use the gimp_tile_width()/height() accessor
functions.
* libgimp/gimp.def: added gimp_extension_enable.
* libgimp/gimpmenu.c: removed evil code which connected to
_readchannel manually and use gimp_extension_enable() for watching
temp_procs.
* plug-ins/helpbrowser/helpbrowser.c: removed the same evil code
here and call gimp_extension_enable(). Call gimp_extension_ack()
to let the core know that the temp_proc is installed.
* plug-ins/script-fu/script-fu.c: made all procedures except the
permanently running "extension_script_fu" ordinary GIMP_PLUGIN
procedures.
* plug-ins/common/curve_bend.c
* plug-ins/common/plugindetails.c
* plug-ins/common/screenshot.c
* plug-ins/common/uniteditor.c
* plug-ins/common/winclipboard.c
* plug-ins/dbbrowser/dbbrowser.c
* plug-ins/gfli/gfli.c
* plug-ins/twain/twain.c
* plug-ins/webbrowser/webbrowser.c
* plug-ins/winsnap/winsnap.c: made them all ordinary GIMP_PLUGIN
procedures and renamed them from "extension_*" to "plug_in_*".
Random cleanups.
* app/widgets/gimphelp.c
* plug-ins/maze/maze_face.c: call "plug_in_web_browser" now.
2003-06-20 01:12:00 +08:00
|
|
|
#else
|
2013-02-23 23:25:58 +08:00
|
|
|
|
|
|
|
HANDLE hThreadSnap = NULL;
|
|
|
|
THREADENTRY32 te32 = { 0 };
|
|
|
|
pid_t opid = getpid ();
|
|
|
|
|
2018-04-04 12:30:36 +08:00
|
|
|
g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG,
|
|
|
|
"Debugging (restart externally): %ld",
|
|
|
|
(long int) opid);
|
2013-02-23 23:25:58 +08:00
|
|
|
|
|
|
|
hThreadSnap = CreateToolhelp32Snapshot (TH32CS_SNAPTHREAD, 0);
|
|
|
|
if (hThreadSnap == INVALID_HANDLE_VALUE)
|
|
|
|
{
|
|
|
|
g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG,
|
|
|
|
"error getting threadsnap - debugging impossible");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
te32.dwSize = sizeof (THREADENTRY32);
|
|
|
|
|
|
|
|
if (Thread32First (hThreadSnap, &te32))
|
|
|
|
{
|
|
|
|
do
|
|
|
|
{
|
|
|
|
if (te32.th32OwnerProcessID == opid)
|
|
|
|
{
|
|
|
|
HANDLE hThread = OpenThread (THREAD_SUSPEND_RESUME, FALSE,
|
|
|
|
te32.th32ThreadID);
|
|
|
|
SuspendThread (hThread);
|
|
|
|
CloseHandle (hThread);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
while (Thread32Next (hThreadSnap, &te32));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "error getting threads");
|
|
|
|
}
|
|
|
|
|
|
|
|
CloseHandle (hThreadSnap);
|
|
|
|
|
Changed the semantics of GIMP_EXTENSION and (to some extent) of
2003-06-19 Michael Natterer <mitch@gimp.org>
Changed the semantics of GIMP_EXTENSION and (to some extent)
of GIMP_PLUGIN:
The old meaning of EXTENSION was "I live in the toolbox" and
PLUGIN meant "I take RUN-MODE,IMAGE,DRAWABLE args (but only if I
am invoked interactively)". This is completely useless, since
living in the toolbox means having "<Toolbox>" in the menu_path
and taking RUN-MODE,IMAGE,DRAWABLE means just that, regardless of
what type of procedure we are.
The new meaning of GIMP_PLUGIN is just "I am an ordinary procedure,
I am invoked, do my job and finish", while GIMP_EXTENSION means
"I will install temporary procedures and I will keep running to
keep them available".
(A GIMP_EXTENSION *must* call gimp_extension_ack() now to tell the
core that it's ready to run, or the core will block waiting for
the message !!!).
* configure.in: bumped version number to 1.3.16.
* libgimpbase/gimpprotocol.h: increased protocol version number so
old extensions will refuse to load.
* app/gui/plug-in-commands.c (plug_in_run_cmd_callback): don't
blindly pass RUN-MODE,IMAGE,DRAWABLE to GIMP_PLUGIN procedures but
look at their parameters and pass them either RUN-MODE, or
RUN-MODE,IMAGE, or RUN-MODE,IMAGE,DRAWABLE.
* app/pdb/procedural_db.c: cleaned up, better error reporting,
replaced an impossible error message by g_return_if_fail()
* app/plug-in/plug-in-message.c (plug_in_handle_proc_install):
better error messages.
* app/plug-in/plug-in-params.c: allocate parameter arrays using
g_new0() so we don't have to worry about uninitialized stuff
later.
* app/plug-in/plug-in-run.c (plug_in_run): wait for
gimp_extension_ack() installation confirmation for ALL extensions,
not just for automatically started ones.
* app/plug-in/plug-ins.c: cleanup.
* libgimp/gimp.[ch]: cleaned up and API-documented massively. Made
all magic values given in the GPConfig message static and added
accessor functions for them. Added gimp_tile_width()/height().
Added new function gimp_extension_enable() which turns on
asynchronous processing of temp_proc run requests without having
to enter an endless gimp_extension_process() loop. Moved all
private functions to the end of the file. Added tons of
g_return_if_fail() all over the place. Call gimp_run_procedure2()
from gimp_run_procedure() instead of duplicating the
code. Indentation, spacing, stuff...
* libgimp/gimptile.[ch]: removed gimp_tile_width()/height().
* libgimp/gimpdrawable.c
* libgimp/gimppixelrgn.c
* libgimp/gimptile.c: use the gimp_tile_width()/height() accessor
functions.
* libgimp/gimp.def: added gimp_extension_enable.
* libgimp/gimpmenu.c: removed evil code which connected to
_readchannel manually and use gimp_extension_enable() for watching
temp_procs.
* plug-ins/helpbrowser/helpbrowser.c: removed the same evil code
here and call gimp_extension_enable(). Call gimp_extension_ack()
to let the core know that the temp_proc is installed.
* plug-ins/script-fu/script-fu.c: made all procedures except the
permanently running "extension_script_fu" ordinary GIMP_PLUGIN
procedures.
* plug-ins/common/curve_bend.c
* plug-ins/common/plugindetails.c
* plug-ins/common/screenshot.c
* plug-ins/common/uniteditor.c
* plug-ins/common/winclipboard.c
* plug-ins/dbbrowser/dbbrowser.c
* plug-ins/gfli/gfli.c
* plug-ins/twain/twain.c
* plug-ins/webbrowser/webbrowser.c
* plug-ins/winsnap/winsnap.c: made them all ordinary GIMP_PLUGIN
procedures and renamed them from "extension_*" to "plug_in_*".
Random cleanups.
* app/widgets/gimphelp.c
* plug-ins/maze/maze_face.c: call "plug_in_web_browser" now.
2003-06-20 01:12:00 +08:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_message_func (const gchar *log_domain,
|
2005-12-29 05:24:12 +08:00
|
|
|
GLogLevelFlags log_level,
|
|
|
|
const gchar *message,
|
|
|
|
gpointer data)
|
Changed the semantics of GIMP_EXTENSION and (to some extent) of
2003-06-19 Michael Natterer <mitch@gimp.org>
Changed the semantics of GIMP_EXTENSION and (to some extent)
of GIMP_PLUGIN:
The old meaning of EXTENSION was "I live in the toolbox" and
PLUGIN meant "I take RUN-MODE,IMAGE,DRAWABLE args (but only if I
am invoked interactively)". This is completely useless, since
living in the toolbox means having "<Toolbox>" in the menu_path
and taking RUN-MODE,IMAGE,DRAWABLE means just that, regardless of
what type of procedure we are.
The new meaning of GIMP_PLUGIN is just "I am an ordinary procedure,
I am invoked, do my job and finish", while GIMP_EXTENSION means
"I will install temporary procedures and I will keep running to
keep them available".
(A GIMP_EXTENSION *must* call gimp_extension_ack() now to tell the
core that it's ready to run, or the core will block waiting for
the message !!!).
* configure.in: bumped version number to 1.3.16.
* libgimpbase/gimpprotocol.h: increased protocol version number so
old extensions will refuse to load.
* app/gui/plug-in-commands.c (plug_in_run_cmd_callback): don't
blindly pass RUN-MODE,IMAGE,DRAWABLE to GIMP_PLUGIN procedures but
look at their parameters and pass them either RUN-MODE, or
RUN-MODE,IMAGE, or RUN-MODE,IMAGE,DRAWABLE.
* app/pdb/procedural_db.c: cleaned up, better error reporting,
replaced an impossible error message by g_return_if_fail()
* app/plug-in/plug-in-message.c (plug_in_handle_proc_install):
better error messages.
* app/plug-in/plug-in-params.c: allocate parameter arrays using
g_new0() so we don't have to worry about uninitialized stuff
later.
* app/plug-in/plug-in-run.c (plug_in_run): wait for
gimp_extension_ack() installation confirmation for ALL extensions,
not just for automatically started ones.
* app/plug-in/plug-ins.c: cleanup.
* libgimp/gimp.[ch]: cleaned up and API-documented massively. Made
all magic values given in the GPConfig message static and added
accessor functions for them. Added gimp_tile_width()/height().
Added new function gimp_extension_enable() which turns on
asynchronous processing of temp_proc run requests without having
to enter an endless gimp_extension_process() loop. Moved all
private functions to the end of the file. Added tons of
g_return_if_fail() all over the place. Call gimp_run_procedure2()
from gimp_run_procedure() instead of duplicating the
code. Indentation, spacing, stuff...
* libgimp/gimptile.[ch]: removed gimp_tile_width()/height().
* libgimp/gimpdrawable.c
* libgimp/gimppixelrgn.c
* libgimp/gimptile.c: use the gimp_tile_width()/height() accessor
functions.
* libgimp/gimp.def: added gimp_extension_enable.
* libgimp/gimpmenu.c: removed evil code which connected to
_readchannel manually and use gimp_extension_enable() for watching
temp_procs.
* plug-ins/helpbrowser/helpbrowser.c: removed the same evil code
here and call gimp_extension_enable(). Call gimp_extension_ack()
to let the core know that the temp_proc is installed.
* plug-ins/script-fu/script-fu.c: made all procedures except the
permanently running "extension_script_fu" ordinary GIMP_PLUGIN
procedures.
* plug-ins/common/curve_bend.c
* plug-ins/common/plugindetails.c
* plug-ins/common/screenshot.c
* plug-ins/common/uniteditor.c
* plug-ins/common/winclipboard.c
* plug-ins/dbbrowser/dbbrowser.c
* plug-ins/gfli/gfli.c
* plug-ins/twain/twain.c
* plug-ins/webbrowser/webbrowser.c
* plug-ins/winsnap/winsnap.c: made them all ordinary GIMP_PLUGIN
procedures and renamed them from "extension_*" to "plug_in_*".
Random cleanups.
* app/widgets/gimphelp.c
* plug-ins/maze/maze_face.c: call "plug_in_web_browser" now.
2003-06-20 01:12:00 +08:00
|
|
|
{
|
2006-06-21 19:00:51 +08:00
|
|
|
gimp_message (message);
|
Changed the semantics of GIMP_EXTENSION and (to some extent) of
2003-06-19 Michael Natterer <mitch@gimp.org>
Changed the semantics of GIMP_EXTENSION and (to some extent)
of GIMP_PLUGIN:
The old meaning of EXTENSION was "I live in the toolbox" and
PLUGIN meant "I take RUN-MODE,IMAGE,DRAWABLE args (but only if I
am invoked interactively)". This is completely useless, since
living in the toolbox means having "<Toolbox>" in the menu_path
and taking RUN-MODE,IMAGE,DRAWABLE means just that, regardless of
what type of procedure we are.
The new meaning of GIMP_PLUGIN is just "I am an ordinary procedure,
I am invoked, do my job and finish", while GIMP_EXTENSION means
"I will install temporary procedures and I will keep running to
keep them available".
(A GIMP_EXTENSION *must* call gimp_extension_ack() now to tell the
core that it's ready to run, or the core will block waiting for
the message !!!).
* configure.in: bumped version number to 1.3.16.
* libgimpbase/gimpprotocol.h: increased protocol version number so
old extensions will refuse to load.
* app/gui/plug-in-commands.c (plug_in_run_cmd_callback): don't
blindly pass RUN-MODE,IMAGE,DRAWABLE to GIMP_PLUGIN procedures but
look at their parameters and pass them either RUN-MODE, or
RUN-MODE,IMAGE, or RUN-MODE,IMAGE,DRAWABLE.
* app/pdb/procedural_db.c: cleaned up, better error reporting,
replaced an impossible error message by g_return_if_fail()
* app/plug-in/plug-in-message.c (plug_in_handle_proc_install):
better error messages.
* app/plug-in/plug-in-params.c: allocate parameter arrays using
g_new0() so we don't have to worry about uninitialized stuff
later.
* app/plug-in/plug-in-run.c (plug_in_run): wait for
gimp_extension_ack() installation confirmation for ALL extensions,
not just for automatically started ones.
* app/plug-in/plug-ins.c: cleanup.
* libgimp/gimp.[ch]: cleaned up and API-documented massively. Made
all magic values given in the GPConfig message static and added
accessor functions for them. Added gimp_tile_width()/height().
Added new function gimp_extension_enable() which turns on
asynchronous processing of temp_proc run requests without having
to enter an endless gimp_extension_process() loop. Moved all
private functions to the end of the file. Added tons of
g_return_if_fail() all over the place. Call gimp_run_procedure2()
from gimp_run_procedure() instead of duplicating the
code. Indentation, spacing, stuff...
* libgimp/gimptile.[ch]: removed gimp_tile_width()/height().
* libgimp/gimpdrawable.c
* libgimp/gimppixelrgn.c
* libgimp/gimptile.c: use the gimp_tile_width()/height() accessor
functions.
* libgimp/gimp.def: added gimp_extension_enable.
* libgimp/gimpmenu.c: removed evil code which connected to
_readchannel manually and use gimp_extension_enable() for watching
temp_procs.
* plug-ins/helpbrowser/helpbrowser.c: removed the same evil code
here and call gimp_extension_enable(). Call gimp_extension_ack()
to let the core know that the temp_proc is installed.
* plug-ins/script-fu/script-fu.c: made all procedures except the
permanently running "extension_script_fu" ordinary GIMP_PLUGIN
procedures.
* plug-ins/common/curve_bend.c
* plug-ins/common/plugindetails.c
* plug-ins/common/screenshot.c
* plug-ins/common/uniteditor.c
* plug-ins/common/winclipboard.c
* plug-ins/dbbrowser/dbbrowser.c
* plug-ins/gfli/gfli.c
* plug-ins/twain/twain.c
* plug-ins/webbrowser/webbrowser.c
* plug-ins/winsnap/winsnap.c: made them all ordinary GIMP_PLUGIN
procedures and renamed them from "extension_*" to "plug_in_*".
Random cleanups.
* app/widgets/gimphelp.c
* plug-ins/maze/maze_face.c: call "plug_in_web_browser" now.
2003-06-20 01:12:00 +08:00
|
|
|
}
|
|
|
|
|
2018-04-04 10:33:19 +08:00
|
|
|
static void
|
|
|
|
gimp_fatal_func (const gchar *log_domain,
|
|
|
|
GLogLevelFlags flags,
|
|
|
|
const gchar *message,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
const gchar *level;
|
|
|
|
|
|
|
|
switch (flags & G_LOG_LEVEL_MASK)
|
|
|
|
{
|
|
|
|
case G_LOG_LEVEL_WARNING:
|
|
|
|
level = "WARNING";
|
|
|
|
break;
|
|
|
|
case G_LOG_LEVEL_CRITICAL:
|
|
|
|
level = "CRITICAL";
|
|
|
|
break;
|
|
|
|
case G_LOG_LEVEL_ERROR:
|
|
|
|
level = "ERROR";
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
level = "FATAL";
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
g_printerr ("%s: %s: %s\n",
|
|
|
|
progname, level, message);
|
|
|
|
|
2018-04-04 10:45:27 +08:00
|
|
|
#ifndef G_OS_WIN32
|
2018-04-04 10:33:19 +08:00
|
|
|
switch (stack_trace_mode)
|
|
|
|
{
|
|
|
|
case GIMP_STACK_TRACE_NEVER:
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GIMP_STACK_TRACE_QUERY:
|
|
|
|
{
|
|
|
|
sigset_t sigset;
|
|
|
|
|
|
|
|
sigemptyset (&sigset);
|
|
|
|
sigprocmask (SIG_SETMASK, &sigset, NULL);
|
|
|
|
gimp_stack_trace_query (progname);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GIMP_STACK_TRACE_ALWAYS:
|
|
|
|
{
|
|
|
|
sigset_t sigset;
|
|
|
|
|
|
|
|
sigemptyset (&sigset);
|
|
|
|
sigprocmask (SIG_SETMASK, &sigset, NULL);
|
|
|
|
gimp_stack_trace_print (progname, stdout, NULL);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2018-04-04 10:45:27 +08:00
|
|
|
#endif
|
2018-04-04 10:33:19 +08:00
|
|
|
|
2018-04-04 10:45:27 +08:00
|
|
|
/* Do not end with gimp_quit().
|
|
|
|
* We want the plug-in to continue its normal crash course, otherwise
|
|
|
|
* we won't get the "Plug-in crashed" error in GIMP.
|
|
|
|
*/
|
2018-04-10 20:16:33 +08:00
|
|
|
exit (EXIT_FAILURE);
|
2018-04-04 10:33:19 +08:00
|
|
|
}
|
|
|
|
|
2018-04-05 00:04:34 +08:00
|
|
|
#ifdef G_OS_WIN32
|
|
|
|
|
|
|
|
#ifdef HAVE_EXCHNDL
|
|
|
|
static LONG WINAPI
|
|
|
|
gimp_plugin_sigfatal_handler (PEXCEPTION_POINTERS pExceptionInfo)
|
|
|
|
{
|
|
|
|
g_printerr ("%s: fatal error\n", progname);
|
|
|
|
|
|
|
|
SetUnhandledExceptionFilter (_prevExceptionFilter);
|
|
|
|
|
|
|
|
/* For simplicity, do not make a difference between QUERY and ALWAYS
|
|
|
|
* on Windows (at least not for now).
|
|
|
|
*/
|
|
|
|
if (stack_trace_mode != GIMP_STACK_TRACE_NEVER &&
|
|
|
|
g_file_test (plug_in_backtrace_path, G_FILE_TEST_IS_REGULAR))
|
|
|
|
{
|
|
|
|
FILE *stream;
|
|
|
|
guchar buffer[256];
|
|
|
|
size_t read_len;
|
|
|
|
|
|
|
|
stream = fopen (plug_in_backtrace_path, "r");
|
|
|
|
do
|
|
|
|
{
|
|
|
|
/* Just read and output directly the file content. */
|
|
|
|
read_len = fread (buffer, 1, sizeof (buffer) - 1, stream);
|
|
|
|
buffer[read_len] = '\0';
|
|
|
|
g_printerr ("%s", buffer);
|
|
|
|
}
|
|
|
|
while (read_len);
|
|
|
|
fclose (stream);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (_prevExceptionFilter && _prevExceptionFilter != gimp_plugin_sigfatal_handler)
|
|
|
|
return _prevExceptionFilter (pExceptionInfo);
|
|
|
|
else
|
|
|
|
return EXCEPTION_CONTINUE_SEARCH;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#else
|
2000-04-22 00:42:11 +08:00
|
|
|
static void
|
2000-05-11 05:21:23 +08:00
|
|
|
gimp_plugin_sigfatal_handler (gint sig_num)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-05-11 05:21:23 +08:00
|
|
|
switch (sig_num)
|
1998-04-11 13:07:52 +08:00
|
|
|
{
|
2000-05-11 05:21:23 +08:00
|
|
|
case SIGHUP:
|
|
|
|
case SIGINT:
|
|
|
|
case SIGQUIT:
|
|
|
|
case SIGTERM:
|
2000-07-16 20:49:04 +08:00
|
|
|
g_printerr ("%s terminated: %s\n", progname, g_strsignal (sig_num));
|
2000-05-11 05:21:23 +08:00
|
|
|
break;
|
|
|
|
|
2018-04-04 10:03:42 +08:00
|
|
|
case SIGABRT:
|
1998-04-11 13:07:52 +08:00
|
|
|
case SIGBUS:
|
|
|
|
case SIGSEGV:
|
|
|
|
case SIGFPE:
|
2000-05-11 05:21:23 +08:00
|
|
|
case SIGPIPE:
|
1998-04-11 13:07:52 +08:00
|
|
|
default:
|
2000-07-16 20:49:04 +08:00
|
|
|
g_printerr ("%s: fatal error: %s\n", progname, g_strsignal (sig_num));
|
|
|
|
switch (stack_trace_mode)
|
2005-12-29 05:24:12 +08:00
|
|
|
{
|
|
|
|
case GIMP_STACK_TRACE_NEVER:
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GIMP_STACK_TRACE_QUERY:
|
|
|
|
{
|
|
|
|
sigset_t sigset;
|
|
|
|
|
|
|
|
sigemptyset (&sigset);
|
|
|
|
sigprocmask (SIG_SETMASK, &sigset, NULL);
|
2018-02-22 19:35:43 +08:00
|
|
|
gimp_stack_trace_query (progname);
|
2005-12-29 05:24:12 +08:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GIMP_STACK_TRACE_ALWAYS:
|
|
|
|
{
|
|
|
|
sigset_t sigset;
|
|
|
|
|
|
|
|
sigemptyset (&sigset);
|
|
|
|
sigprocmask (SIG_SETMASK, &sigset, NULL);
|
2018-02-22 19:35:43 +08:00
|
|
|
gimp_stack_trace_print (progname, stdout, NULL);
|
2005-12-29 05:24:12 +08:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
1998-04-11 13:07:52 +08:00
|
|
|
break;
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2018-04-04 10:45:27 +08:00
|
|
|
/* Do not end with gimp_quit().
|
|
|
|
* We want the plug-in to continue its normal crash course, otherwise
|
|
|
|
* we won't get the "Plug-in crashed" error in GIMP.
|
|
|
|
*/
|
2018-04-10 20:16:33 +08:00
|
|
|
exit (EXIT_FAILURE);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
app/appenv.h New file. Includes <math.h>. Move G_PI, RINT(), ROUND() etc
1999-09-01 Tor Lillqvist <tml@iki.fi>
* app/appenv.h
* libgimp/gimpmath.h: New file. Includes <math.h>. Move G_PI,
RINT(), ROUND() etc from app/appenv.h here, so plug-ins can
use them, too. Remove some commented-out old stuff in appenv.h.
* libgimp/gimp.h: Include gimpmath.h.
* libgimp/gimp.c (gimp_main): Win32: Don't install signal
handlers, we can't do anything useful in the handler ourselves
anyway (it would be nice to print out a backtrace, but that seems
pretty hard to do, even if not impossible). Let Windows inform the
user about the crash. If the plug-in was compiled with MSVC, and
the user also has it, she is offered a chance to start the
debugger automatically anyway.
* app/*several*.c: Include gimpmath.h for G_PI etc. Don't include
<math.h>, as gimpmath.h includes it.
* plug-ins/*/*many*.c: Include config.h. Don't include <math.h>.
Remove all the duplicated definitions of G_PI and rint(). Use
RINT() instead of rint().
* app/app_procs.[ch]: app_exit() takes a gboolean.
* app/batch.c
* app/commands.c
* app/interface.c: Call app_exit() with FALSE or TRUE.
* app/main.c (on_error): Call gimp_fatal_error. (main): Don't
install any signal handler on Win32 here, either.
* app/errors.c (gimp_fatal_error, gimp_terminate): Win32: Format
the message and call MessageBox with it. g_on_error_query doesn't
do anything useful on Win32, and printf'ing a message to stdout or
stderr doesn't do anything, either, in a windowing application.
1999-09-02 04:30:56 +08:00
|
|
|
#endif
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-05-11 05:21:23 +08:00
|
|
|
static gboolean
|
|
|
|
gimp_plugin_io_error_handler (GIOChannel *channel,
|
2005-12-29 05:24:12 +08:00
|
|
|
GIOCondition cond,
|
|
|
|
gpointer data)
|
2000-05-11 05:21:23 +08:00
|
|
|
{
|
2000-07-16 20:49:04 +08:00
|
|
|
g_printerr ("%s: fatal error: GIMP crashed\n", progname);
|
2000-05-11 05:21:23 +08:00
|
|
|
gimp_quit ();
|
2000-05-12 20:39:46 +08:00
|
|
|
|
|
|
|
/* never reached */
|
|
|
|
return TRUE;
|
2000-05-11 05:21:23 +08:00
|
|
|
}
|
|
|
|
|
2000-05-31 14:15:06 +08:00
|
|
|
static gboolean
|
2006-03-12 01:33:36 +08:00
|
|
|
gimp_write (GIOChannel *channel,
|
|
|
|
const guint8 *buf,
|
|
|
|
gulong count,
|
|
|
|
gpointer user_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
gulong bytes;
|
|
|
|
|
|
|
|
while (count > 0)
|
|
|
|
{
|
|
|
|
if ((write_buffer_index + count) >= WRITE_BUFFER_SIZE)
|
2005-12-29 05:24:12 +08:00
|
|
|
{
|
|
|
|
bytes = WRITE_BUFFER_SIZE - write_buffer_index;
|
|
|
|
memcpy (&write_buffer[write_buffer_index], buf, bytes);
|
|
|
|
write_buffer_index += bytes;
|
|
|
|
if (! gimp_wire_flush (channel, NULL))
|
|
|
|
return FALSE;
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
else
|
2005-12-29 05:24:12 +08:00
|
|
|
{
|
|
|
|
bytes = count;
|
|
|
|
memcpy (&write_buffer[write_buffer_index], buf, bytes);
|
|
|
|
write_buffer_index += bytes;
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
buf += bytes;
|
|
|
|
count -= bytes;
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2000-05-31 14:15:06 +08:00
|
|
|
static gboolean
|
2002-05-17 01:41:38 +08:00
|
|
|
gimp_flush (GIOChannel *channel,
|
|
|
|
gpointer user_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2001-08-30 01:48:28 +08:00
|
|
|
GIOStatus status;
|
2001-08-30 09:09:58 +08:00
|
|
|
GError *error = NULL;
|
2001-08-30 01:48:28 +08:00
|
|
|
gsize count;
|
|
|
|
gsize bytes;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
if (write_buffer_index > 0)
|
|
|
|
{
|
|
|
|
count = 0;
|
|
|
|
while (count != write_buffer_index)
|
|
|
|
{
|
2005-12-29 05:24:12 +08:00
|
|
|
do
|
|
|
|
{
|
|
|
|
bytes = 0;
|
|
|
|
status = g_io_channel_write_chars (channel,
|
|
|
|
&write_buffer[count],
|
|
|
|
(write_buffer_index - count),
|
|
|
|
&bytes,
|
|
|
|
&error);
|
|
|
|
}
|
|
|
|
while (status == G_IO_STATUS_AGAIN);
|
|
|
|
|
|
|
|
if (status != G_IO_STATUS_NORMAL)
|
|
|
|
{
|
|
|
|
if (error)
|
|
|
|
{
|
|
|
|
g_warning ("%s: gimp_flush(): error: %s",
|
|
|
|
g_get_prgname (), error->message);
|
|
|
|
g_error_free (error);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
g_warning ("%s: gimp_flush(): error", g_get_prgname ());
|
|
|
|
}
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
count += bytes;
|
|
|
|
}
|
|
|
|
|
|
|
|
write_buffer_index = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2019-08-02 17:06:48 +08:00
|
|
|
void
|
|
|
|
_gimp_config (GPConfig *config)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2018-12-05 02:41:06 +08:00
|
|
|
GFile *file;
|
|
|
|
gchar *path;
|
|
|
|
|
2004-10-05 00:21:52 +08:00
|
|
|
_tile_width = config->tile_width;
|
|
|
|
_tile_height = config->tile_height;
|
|
|
|
_shm_ID = config->shm_ID;
|
|
|
|
_check_size = config->check_size;
|
|
|
|
_check_type = config->check_type;
|
2006-06-01 23:34:58 +08:00
|
|
|
_show_help_button = config->show_help_button ? TRUE : FALSE;
|
2018-06-18 08:19:41 +08:00
|
|
|
_export_profile = config->export_profile ? TRUE : FALSE;
|
2018-01-11 12:14:07 +08:00
|
|
|
_export_exif = config->export_exif ? TRUE : FALSE;
|
|
|
|
_export_xmp = config->export_xmp ? TRUE : FALSE;
|
|
|
|
_export_iptc = config->export_iptc ? TRUE : FALSE;
|
2004-10-05 00:21:52 +08:00
|
|
|
_gdisp_ID = config->gdisp_ID;
|
|
|
|
_wm_class = g_strdup (config->wm_class);
|
|
|
|
_display_name = g_strdup (config->display_name);
|
|
|
|
_monitor_number = config->monitor_number;
|
2008-03-28 00:30:29 +08:00
|
|
|
_timestamp = config->timestamp;
|
libgimpbase, libgimp, app: pass icon theme dir to plug-ins through config
Pass the current icon theme directory to plug-ins through the
config message, and add a gimp_icon_theme_dir() libgimp function
for retrieving it. Note that we already have a similar
gimp_icon_get_theme_dir() PDB function, which we keep around, since
it can be used to dynamically query for the current icon dir,
unlike the former, and since it returns a dynamically-allocated
string, while the rest of the config-related functions return
statically allocated strings.
Use the new function, instead of gimp_get_icon_theme_dir(), in
gimp_ui_init(). This allows gimp_ui_init() to run without making
any PDB calls. Consequently, this allows us to start plug-ins that
call gimp_ui_init() without entering the main loop in the main app.
We're going to add a plug-in that displays an interactive dialog
while the main app is blocking waiting for an operation to
complete, and we need to be able to start the plug-in without
entering the main loop, to avoid the possibility of arbitrary code
being executed during the wait.
Bump the protocol version.
2018-05-29 23:20:54 +08:00
|
|
|
_icon_theme_dir = g_strdup (config->icon_theme_dir);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2004-02-17 22:03:07 +08:00
|
|
|
if (config->app_name)
|
|
|
|
g_set_application_name (config->app_name);
|
|
|
|
|
2006-06-02 19:49:51 +08:00
|
|
|
gimp_cpu_accel_set_use (config->use_cpu_accel);
|
2014-02-26 04:19:25 +08:00
|
|
|
|
2018-12-05 02:41:06 +08:00
|
|
|
file = gimp_file_new_for_config_path (config->swap_path, NULL);
|
|
|
|
path = g_file_get_path (file);
|
|
|
|
|
2014-02-26 04:19:25 +08:00
|
|
|
g_object_set (gegl_config (),
|
2018-11-20 05:13:07 +08:00
|
|
|
"tile-cache-size", config->tile_cache_size,
|
2018-12-05 07:33:59 +08:00
|
|
|
"swap", path,
|
2018-11-20 05:13:07 +08:00
|
|
|
"threads", (gint) config->num_processors,
|
2014-02-26 07:11:41 +08:00
|
|
|
"use-opencl", config->use_opencl,
|
|
|
|
"application-license", "GPL3",
|
2014-02-26 04:19:25 +08:00
|
|
|
NULL);
|
2006-06-02 19:36:16 +08:00
|
|
|
|
2018-12-05 02:41:06 +08:00
|
|
|
g_free (path);
|
|
|
|
g_object_unref (file);
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
if (_shm_ID != -1)
|
|
|
|
{
|
2003-12-27 16:07:15 +08:00
|
|
|
#if defined(USE_SYSV_SHM)
|
|
|
|
|
|
|
|
/* Use SysV shared memory mechanisms for transferring tile data. */
|
|
|
|
|
2004-11-14 10:50:33 +08:00
|
|
|
_shm_addr = (guchar *) shmat (_shm_ID, NULL, 0);
|
2003-12-27 16:07:15 +08:00
|
|
|
|
|
|
|
if (_shm_addr == (guchar *) -1)
|
2005-12-29 05:24:12 +08:00
|
|
|
{
|
2003-12-27 16:07:15 +08:00
|
|
|
g_error ("shmat() failed: %s\n" ERRMSG_SHM_FAILED,
|
|
|
|
g_strerror (errno));
|
|
|
|
}
|
|
|
|
|
|
|
|
#elif defined(USE_WIN32_SHM)
|
|
|
|
|
|
|
|
/* Use Win32 shared memory mechanisms for transferring tile data. */
|
|
|
|
|
2000-03-26 02:49:05 +08:00
|
|
|
gchar fileMapName[128];
|
2000-05-12 20:39:46 +08:00
|
|
|
|
1999-03-07 20:56:03 +08:00
|
|
|
/* From the id, derive the file map name */
|
2000-05-12 20:39:46 +08:00
|
|
|
g_snprintf (fileMapName, sizeof (fileMapName), "GIMP%d.SHM", _shm_ID);
|
1999-03-07 20:56:03 +08:00
|
|
|
|
|
|
|
/* Open the file mapping */
|
|
|
|
shm_handle = OpenFileMapping (FILE_MAP_ALL_ACCESS,
|
2005-12-29 05:24:12 +08:00
|
|
|
0, fileMapName);
|
1999-03-07 20:56:03 +08:00
|
|
|
if (shm_handle)
|
2005-12-29 05:24:12 +08:00
|
|
|
{
|
|
|
|
/* Map the shared memory into our address space for use */
|
|
|
|
_shm_addr = (guchar *) MapViewOfFile (shm_handle,
|
|
|
|
FILE_MAP_ALL_ACCESS,
|
|
|
|
0, 0, TILE_MAP_SIZE);
|
|
|
|
|
|
|
|
/* Verify that we mapped our view */
|
|
|
|
if (!_shm_addr)
|
|
|
|
{
|
2018-04-04 12:30:36 +08:00
|
|
|
g_error ("MapViewOfFile error: %lu... " ERRMSG_SHM_FAILED,
|
2005-12-29 05:24:12 +08:00
|
|
|
GetLastError ());
|
|
|
|
}
|
|
|
|
}
|
1999-03-07 20:56:03 +08:00
|
|
|
else
|
2005-12-29 05:24:12 +08:00
|
|
|
{
|
2018-04-04 12:30:36 +08:00
|
|
|
g_error ("OpenFileMapping error: %lu... " ERRMSG_SHM_FAILED,
|
2005-12-29 05:24:12 +08:00
|
|
|
GetLastError ());
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2003-12-27 16:07:15 +08:00
|
|
|
#elif defined(USE_POSIX_SHM)
|
|
|
|
|
|
|
|
/* Use POSIX shared memory mechanisms for transferring tile data. */
|
|
|
|
|
|
|
|
gchar map_file[32];
|
|
|
|
gint shm_fd;
|
|
|
|
|
|
|
|
/* From the id, derive the file map name */
|
|
|
|
g_snprintf (map_file, sizeof (map_file), "/gimp-shm-%d", _shm_ID);
|
|
|
|
|
|
|
|
/* Open the file mapping */
|
|
|
|
shm_fd = shm_open (map_file, O_RDWR, 0600);
|
|
|
|
|
|
|
|
if (shm_fd != -1)
|
|
|
|
{
|
|
|
|
/* Map the shared memory into our address space for use */
|
|
|
|
_shm_addr = (guchar *) mmap (NULL, TILE_MAP_SIZE,
|
|
|
|
PROT_READ | PROT_WRITE, MAP_SHARED,
|
|
|
|
shm_fd, 0);
|
|
|
|
|
|
|
|
/* Verify that we mapped our view */
|
|
|
|
if (_shm_addr == MAP_FAILED)
|
|
|
|
{
|
|
|
|
g_error ("mmap() failed: %s\n" ERRMSG_SHM_FAILED,
|
|
|
|
g_strerror (errno));
|
|
|
|
}
|
2004-03-25 17:02:28 +08:00
|
|
|
|
|
|
|
close (shm_fd);
|
2003-12-27 16:07:15 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
g_error ("shm_open() failed: %s\n" ERRMSG_SHM_FAILED,
|
|
|
|
g_strerror (errno));
|
|
|
|
}
|
|
|
|
|
1999-03-07 20:56:03 +08:00
|
|
|
#endif
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2008-08-17 01:18:13 +08:00
|
|
|
static void
|
2019-07-29 18:42:47 +08:00
|
|
|
gimp_set_pdb_error (GimpValueArray *return_values)
|
2008-08-17 01:18:13 +08:00
|
|
|
{
|
2019-07-29 18:42:47 +08:00
|
|
|
g_clear_pointer (&pdb_error_message, g_free);
|
|
|
|
pdb_error_status = GIMP_PDB_SUCCESS;
|
2008-08-17 01:18:13 +08:00
|
|
|
|
2019-07-29 18:42:47 +08:00
|
|
|
if (gimp_value_array_length (return_values) > 0)
|
2008-08-17 01:18:13 +08:00
|
|
|
{
|
2019-07-29 18:42:47 +08:00
|
|
|
pdb_error_status =
|
|
|
|
g_value_get_enum (gimp_value_array_index (return_values, 0));
|
2008-08-17 01:18:13 +08:00
|
|
|
|
2019-07-29 18:42:47 +08:00
|
|
|
switch (pdb_error_status)
|
2008-08-17 01:18:13 +08:00
|
|
|
{
|
2019-07-29 18:42:47 +08:00
|
|
|
case GIMP_PDB_SUCCESS:
|
|
|
|
case GIMP_PDB_PASS_THROUGH:
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GIMP_PDB_EXECUTION_ERROR:
|
|
|
|
case GIMP_PDB_CALLING_ERROR:
|
|
|
|
case GIMP_PDB_CANCEL:
|
|
|
|
if (gimp_value_array_length (return_values) > 1)
|
|
|
|
{
|
|
|
|
GValue *value = gimp_value_array_index (return_values, 1);
|
|
|
|
|
|
|
|
if (G_VALUE_HOLDS_STRING (value))
|
|
|
|
pdb_error_message = g_value_dup_string (value);
|
|
|
|
}
|
|
|
|
break;
|
2008-08-17 01:18:13 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|