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
|
|
|
|
|
2022-12-27 05:22:37 +08:00
|
|
|
#include <glib.h>
|
2022-12-29 00:42:22 +08:00
|
|
|
#include <glib/gstdio.h>
|
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
|
|
|
|
|
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
|
|
|
|
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
|
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>
|
|
|
|
|
2019-08-03 23:11:30 +08:00
|
|
|
#include "gimp.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
|
|
|
|
2019-08-05 05:26:31 +08:00
|
|
|
#include "gimp-debug.h"
|
2019-07-31 05:48:37 +08:00
|
|
|
#include "gimp-private.h"
|
2019-08-05 00:54:00 +08:00
|
|
|
#include "gimp-shm.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-08-07 00:29:55 +08:00
|
|
|
#include "gimppdb-private.h"
|
2019-07-26 05:07:24 +08:00
|
|
|
#include "gimpplugin-private.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
|
|
|
|
2019-08-07 05:06:15 +08:00
|
|
|
static void gimp_close (void);
|
|
|
|
|
|
|
|
|
2018-04-05 00:04:34 +08:00
|
|
|
#ifdef G_OS_WIN32
|
2019-08-07 05:06:15 +08:00
|
|
|
|
2018-04-05 00:04:34 +08:00
|
|
|
#ifdef HAVE_EXCHNDL
|
|
|
|
static LONG WINAPI gimp_plugin_sigfatal_handler (PEXCEPTION_POINTERS pExceptionInfo);
|
2000-03-26 02:49:05 +08:00
|
|
|
|
2018-04-05 00:04:34 +08:00
|
|
|
static LPTOP_LEVEL_EXCEPTION_FILTER _prevExceptionFilter = NULL;
|
|
|
|
static gchar *plug_in_backtrace_path = NULL;
|
|
|
|
#endif
|
|
|
|
|
2019-08-07 05:06:15 +08:00
|
|
|
#else /* ! G_OS_WIN32 */
|
|
|
|
|
|
|
|
static void gimp_plugin_sigfatal_handler (gint sig_num);
|
|
|
|
|
|
|
|
#endif /* G_OS_WIN32 */
|
|
|
|
|
|
|
|
|
2019-10-10 06:45:41 +08:00
|
|
|
static GimpPlugIn *PLUG_IN = NULL;
|
|
|
|
static GimpPDB *PDB = NULL;
|
|
|
|
|
|
|
|
static gint _tile_width = -1;
|
|
|
|
static gint _tile_height = -1;
|
|
|
|
static gboolean _show_help_button = TRUE;
|
|
|
|
static gboolean _export_color_profile = FALSE;
|
|
|
|
static gboolean _export_comment = FALSE;
|
|
|
|
static gboolean _export_exif = FALSE;
|
|
|
|
static gboolean _export_xmp = FALSE;
|
|
|
|
static gboolean _export_iptc = FALSE;
|
2021-08-26 03:00:45 +08:00
|
|
|
static gboolean _export_thumbnail = TRUE;
|
2020-12-12 01:24:36 +08:00
|
|
|
static gint32 _num_processors = 1;
|
2019-10-10 06:45:41 +08:00
|
|
|
static GimpCheckSize _check_size = GIMP_CHECK_SIZE_MEDIUM_CHECKS;
|
|
|
|
static GimpCheckType _check_type = GIMP_CHECK_TYPE_GRAY_CHECKS;
|
2023-11-21 04:38:11 +08:00
|
|
|
static GeglColor *_check_custom_color1 = NULL;
|
|
|
|
static GeglColor *_check_custom_color2 = NULL;
|
2019-10-10 06:45:41 +08:00
|
|
|
static gint _default_display_id = -1;
|
|
|
|
static gchar *_wm_class = NULL;
|
|
|
|
static gchar *_display_name = NULL;
|
|
|
|
static gint _monitor_number = 0;
|
|
|
|
static guint32 _timestamp = 0;
|
|
|
|
static gchar *_icon_theme_dir = NULL;
|
|
|
|
static const gchar *progname = NULL;
|
|
|
|
|
|
|
|
static GimpStackTraceMode stack_trace_mode = GIMP_STACK_TRACE_NEVER;
|
2019-08-07 05:06:15 +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
|
|
|
/**
|
|
|
|
* 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
|
|
|
|
*
|
2019-09-10 17:17:12 +08:00
|
|
|
* The main plug-in function that must be called with the plug-in's
|
|
|
|
* #GimpPlugIn subclass #GType and the 'argc' and 'argv' that are passed
|
|
|
|
* to the platform's main().
|
2019-07-26 05:07:24 +08:00
|
|
|
*
|
2019-09-10 17:17:12 +08:00
|
|
|
* See also: GIMP_MAIN(), #GimpPlugIn.
|
2019-09-09 17:16:39 +08:00
|
|
|
*
|
2019-07-26 05:07:24 +08:00
|
|
|
* Returns: an exit status as defined by the C library,
|
|
|
|
* on success EXIT_SUCCESS.
|
2019-09-09 17:16:39 +08:00
|
|
|
*
|
|
|
|
* Since: 3.0
|
2019-07-26 05:07:24 +08:00
|
|
|
**/
|
|
|
|
gint
|
|
|
|
gimp_main (GType plug_in_type,
|
|
|
|
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
|
|
|
|
};
|
|
|
|
|
2019-08-07 04:21:50 +08:00
|
|
|
GIOChannel *read_channel;
|
|
|
|
GIOChannel *write_channel;
|
|
|
|
gchar *basename;
|
|
|
|
gint protocol_version;
|
2001-08-30 01:48:28 +08:00
|
|
|
|
1999-10-05 03:26:07 +08:00
|
|
|
#ifdef G_OS_WIN32
|
2019-08-07 05:06:15 +08:00
|
|
|
|
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 */
|
2022-12-30 23:46:19 +08:00
|
|
|
SetDllDirectoryW (L"");
|
2015-04-13 02:47:06 +08:00
|
|
|
|
|
|
|
/* On Windows, set DLL search path to $INSTALLDIR/bin so that GEGL
|
2019-09-04 05:55:49 +08:00
|
|
|
* file operations can find their respective file library DLLs (such
|
|
|
|
* as jasper, etc.) without needing to set external PATH.
|
|
|
|
*/
|
2015-04-13 02:47:06 +08:00
|
|
|
{
|
|
|
|
const gchar *install_dir;
|
|
|
|
gchar *bin_dir;
|
|
|
|
LPWSTR w_bin_dir;
|
|
|
|
|
|
|
|
w_bin_dir = NULL;
|
|
|
|
install_dir = gimp_installation_directory ();
|
|
|
|
bin_dir = g_build_filename (install_dir, "bin", NULL);
|
|
|
|
|
2022-12-31 18:09:49 +08:00
|
|
|
w_bin_dir = g_utf8_to_utf16 (bin_dir, -1, NULL, NULL, NULL);
|
2015-04-13 02:47:06 +08:00
|
|
|
if (w_bin_dir)
|
2022-12-31 18:09:49 +08:00
|
|
|
{
|
|
|
|
SetDllDirectoryW (w_bin_dir);
|
|
|
|
g_free (w_bin_dir);
|
|
|
|
}
|
|
|
|
|
2015-04-13 02:47:06 +08:00
|
|
|
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. */
|
|
|
|
{
|
2023-01-03 01:16:45 +08:00
|
|
|
time_t t;
|
|
|
|
gchar *filename;
|
|
|
|
gchar *dir;
|
|
|
|
wchar_t *plug_in_backtrace_path_utf16;
|
2015-08-31 21:26:51 +08:00
|
|
|
|
|
|
|
/* This has to be the non-roaming directory (i.e., the local
|
2019-09-04 05:55:49 +08:00
|
|
|
* directory) as backtraces correspond to the binaries on this
|
|
|
|
* system.
|
|
|
|
*/
|
2015-08-31 21:26:51 +08:00
|
|
|
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 ();
|
2023-01-03 01:16:45 +08:00
|
|
|
|
|
|
|
plug_in_backtrace_path_utf16 = g_utf8_to_utf16 (plug_in_backtrace_path,
|
|
|
|
-1, NULL, NULL, NULL);
|
|
|
|
if (plug_in_backtrace_path_utf16)
|
|
|
|
{
|
|
|
|
ExcHndlSetLogFileNameW (plug_in_backtrace_path_utf16);
|
|
|
|
g_free (plug_in_backtrace_path_utf16);
|
|
|
|
}
|
2015-08-31 21:26:51 +08:00
|
|
|
}
|
2019-08-07 05:06:15 +08:00
|
|
|
#endif /* HAVE_EXCHNDL */
|
2015-08-31 21:26:51 +08:00
|
|
|
|
2010-09-03 02:28:29 +08:00
|
|
|
#ifndef _WIN64
|
|
|
|
{
|
|
|
|
typedef BOOL (WINAPI *t_SetProcessDEPPolicy) (DWORD dwFlags);
|
|
|
|
t_SetProcessDEPPolicy p_SetProcessDEPPolicy;
|
|
|
|
|
2022-12-30 23:42:02 +08:00
|
|
|
p_SetProcessDEPPolicy = GetProcAddress (GetModuleHandleW (L"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);
|
|
|
|
}
|
2019-08-07 05:06:15 +08:00
|
|
|
#endif /* _WIN64 */
|
2010-09-03 02:28:29 +08:00
|
|
|
|
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;
|
|
|
|
|
2022-12-30 23:42:02 +08:00
|
|
|
p_SetCurrentProcessExplicitAppUserModelID = (t_SetCurrentProcessExplicitAppUserModelID) GetProcAddress (GetModuleHandleW (L"shell32.dll"),
|
2018-04-04 12:30:36 +08:00
|
|
|
"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
|
|
|
}
|
2019-08-07 05:06:15 +08:00
|
|
|
|
|
|
|
#endif /* G_OS_WIN32 */
|
1999-03-07 20:56:03 +08:00
|
|
|
|
2019-09-04 05:55:49 +08:00
|
|
|
g_assert (plug_in_type != G_TYPE_NONE);
|
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
|
|
|
}
|
|
|
|
|
2019-08-05 05:26:31 +08:00
|
|
|
_gimp_debug_init (basename);
|
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
|
2019-08-07 05:06:15 +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
|
|
|
/* 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);
|
2019-08-07 05:06:15 +08:00
|
|
|
|
|
|
|
#endif /* ! G_OS_WIN32 */
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2014-08-12 07:01:12 +08:00
|
|
|
#ifdef G_OS_WIN32
|
2019-08-07 05:54:34 +08:00
|
|
|
read_channel = g_io_channel_win32_new_fd (atoi (argv[ARG_READ_FD]));
|
2019-08-07 04:21:50 +08:00
|
|
|
write_channel = g_io_channel_win32_new_fd (atoi (argv[ARG_WRITE_FD]));
|
2014-08-12 07:01:12 +08:00
|
|
|
#else
|
2019-08-07 04:21:50 +08:00
|
|
|
read_channel = g_io_channel_unix_new (atoi (argv[ARG_READ_FD]));
|
|
|
|
write_channel = 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-08-07 04:21:50 +08:00
|
|
|
g_io_channel_set_encoding (read_channel, NULL, NULL);
|
|
|
|
g_io_channel_set_encoding (write_channel, NULL, NULL);
|
2001-08-30 09:09:58 +08:00
|
|
|
|
2019-08-07 04:21:50 +08:00
|
|
|
g_io_channel_set_buffered (read_channel, FALSE);
|
|
|
|
g_io_channel_set_buffered (write_channel, FALSE);
|
2005-12-13 22:11:56 +08:00
|
|
|
|
2019-08-07 04:21:50 +08:00
|
|
|
g_io_channel_set_close_on_unref (read_channel, TRUE);
|
|
|
|
g_io_channel_set_close_on_unref (write_channel, TRUE);
|
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[] =
|
|
|
|
{
|
2019-08-15 20:04:56 +08:00
|
|
|
G_TYPE_INT, G_TYPE_PARAM_INT,
|
2019-08-15 19:34:11 +08:00
|
|
|
G_TYPE_UCHAR, G_TYPE_PARAM_UCHAR,
|
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
|
|
|
|
2019-08-19 18:54:52 +08:00
|
|
|
G_TYPE_STRING, G_TYPE_PARAM_STRING,
|
2020-12-24 04:15:43 +08:00
|
|
|
G_TYPE_STRV, G_TYPE_PARAM_BOXED,
|
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
|
|
|
|
2023-05-24 05:37:46 +08:00
|
|
|
G_TYPE_BYTES, G_TYPE_PARAM_BOXED,
|
|
|
|
|
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
|
|
|
GIMP_TYPE_ARRAY, GIMP_TYPE_PARAM_ARRAY,
|
|
|
|
GIMP_TYPE_INT32_ARRAY, GIMP_TYPE_PARAM_INT32_ARRAY,
|
|
|
|
GIMP_TYPE_FLOAT_ARRAY, GIMP_TYPE_PARAM_FLOAT_ARRAY,
|
2019-09-26 02:47:25 +08:00
|
|
|
GIMP_TYPE_OBJECT_ARRAY, GIMP_TYPE_PARAM_OBJECT_ARRAY,
|
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
|
|
|
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_DISPLAY, GIMP_TYPE_PARAM_DISPLAY,
|
|
|
|
GIMP_TYPE_IMAGE, GIMP_TYPE_PARAM_IMAGE,
|
|
|
|
GIMP_TYPE_ITEM, GIMP_TYPE_PARAM_ITEM,
|
|
|
|
GIMP_TYPE_DRAWABLE, GIMP_TYPE_PARAM_DRAWABLE,
|
|
|
|
GIMP_TYPE_LAYER, GIMP_TYPE_PARAM_LAYER,
|
2023-08-26 06:12:31 +08:00
|
|
|
GIMP_TYPE_TEXT_LAYER, GIMP_TYPE_PARAM_TEXT_LAYER,
|
2024-07-08 04:17:44 +08:00
|
|
|
GIMP_TYPE_GROUP_LAYER, GIMP_TYPE_PARAM_GROUP_LAYER,
|
2019-08-29 17:25:35 +08:00
|
|
|
GIMP_TYPE_CHANNEL, GIMP_TYPE_PARAM_CHANNEL,
|
|
|
|
GIMP_TYPE_LAYER_MASK, GIMP_TYPE_PARAM_LAYER_MASK,
|
|
|
|
GIMP_TYPE_SELECTION, GIMP_TYPE_PARAM_SELECTION,
|
2024-07-12 14:16:25 +08:00
|
|
|
GIMP_TYPE_PATH, GIMP_TYPE_PARAM_PATH,
|
2022-09-06 07:28:35 +08:00
|
|
|
|
|
|
|
GIMP_TYPE_BRUSH, GIMP_TYPE_PARAM_BRUSH,
|
|
|
|
GIMP_TYPE_FONT, GIMP_TYPE_PARAM_FONT,
|
|
|
|
GIMP_TYPE_GRADIENT, GIMP_TYPE_PARAM_GRADIENT,
|
|
|
|
GIMP_TYPE_PALETTE, GIMP_TYPE_PARAM_PALETTE,
|
2024-08-06 18:45:19 +08:00
|
|
|
GIMP_TYPE_PATTERN, GIMP_TYPE_PARAM_PATTERN,
|
|
|
|
|
|
|
|
GIMP_TYPE_UNIT, GIMP_TYPE_PARAM_UNIT
|
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
|
|
|
};
|
|
|
|
|
|
|
|
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 */
|
|
|
|
{
|
Issue #8900 and #9923: reimplementing GimpUnit as a proper class.
This fixes all our GObject Introspection issues with GimpUnit which was
both an enum and an int-derived type of user-defined units *completing*
the enum values. GIR clearly didn't like this!
Now GimpUnit is a proper class and units are unique objects, allowing to
compare them with an identity test (i.e. `unit == gimp_unit_pixel ()`
tells us if unit is the pixel unit or not), which makes it easy to use,
just like with int, yet adding also methods, making for nicer
introspected API.
As an aside, this also fixes #10738, by having all the built-in units
retrievable even if libgimpbase had not been properly initialized with
gimp_base_init().
I haven't checked in details how GIR works to introspect, but it looks
like it loads the library to inspect and runs functions, hence
triggering some CRITICALS because virtual methods (supposed to be
initialized with gimp_base_init() run by libgimp) are not set. This new
code won't trigger any critical because the vtable method are now not
necessary, at least for all built-in units.
Note that GimpUnit is still in libgimpbase. It could have been moved to
libgimp in order to avoid any virtual method table (since we need to
keep core and libgimp side's units in sync, PDB is required), but too
many libgimpwidgets widgets were already using GimpUnit. And technically
most of GimpUnit logic doesn't require PDB (only the creation/sync
part). This is one of the reasons why user-created GimpUnit list is
handled and stored differently from other types of objects.
Globally this simplifies the code a lot too and we don't need separate
implementations of various utils for core and libgimp, which means less
prone to errors.
2024-07-26 02:55:21 +08:00
|
|
|
GimpUnitVtable vtable = { 0 };
|
|
|
|
|
|
|
|
vtable.get_deletion_flag = _gimp_unit_get_deletion_flag;
|
|
|
|
vtable.set_deletion_flag = _gimp_unit_set_deletion_flag;
|
|
|
|
vtable.get_data = _gimp_unit_get_data;
|
2003-11-16 06:53:28 +08:00
|
|
|
|
|
|
|
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, "");
|
|
|
|
|
2023-01-11 22:42:31 +08:00
|
|
|
gimp_bind_text_domain (GETTEXT_PACKAGE"-libgimp", gimp_locale_directory ());
|
2003-03-26 00:38:19 +08:00
|
|
|
#ifdef HAVE_BIND_TEXTDOMAIN_CODESET
|
|
|
|
bind_textdomain_codeset (GETTEXT_PACKAGE"-libgimp", "UTF-8");
|
|
|
|
#endif
|
|
|
|
|
2020-11-22 03:08:36 +08:00
|
|
|
_gimp_debug_configure (stack_trace_mode);
|
2019-08-03 02:53:43 +08:00
|
|
|
|
2019-09-04 05:55:49 +08:00
|
|
|
PLUG_IN = g_object_new (plug_in_type,
|
2023-10-15 22:34:11 +08:00
|
|
|
"program-name", progname,
|
2019-09-04 05:55:49 +08:00
|
|
|
"read-channel", read_channel,
|
|
|
|
"write-channel", write_channel,
|
|
|
|
NULL);
|
2019-08-03 02:53:43 +08:00
|
|
|
|
2019-09-04 05:55:49 +08:00
|
|
|
g_assert (GIMP_IS_PLUG_IN (PLUG_IN));
|
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
|
|
|
{
|
2020-11-22 03:08:36 +08:00
|
|
|
if (_gimp_get_debug_flags () & GIMP_DEBUG_QUERY)
|
2019-08-05 05:26:31 +08:00
|
|
|
_gimp_debug_stop ();
|
2003-02-10 04:49:38 +08:00
|
|
|
|
2019-09-04 05:55:49 +08:00
|
|
|
_gimp_plug_in_query (PLUG_IN);
|
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
|
|
|
{
|
2020-11-22 03:08:36 +08:00
|
|
|
if (_gimp_get_debug_flags () & GIMP_DEBUG_INIT)
|
2019-08-05 05:26:31 +08:00
|
|
|
_gimp_debug_stop ();
|
2003-02-10 04:49:38 +08:00
|
|
|
|
2019-09-04 05:55:49 +08:00
|
|
|
_gimp_plug_in_init (PLUG_IN);
|
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
|
|
|
}
|
|
|
|
|
2020-11-22 03:08:36 +08:00
|
|
|
if (_gimp_get_debug_flags () & GIMP_DEBUG_RUN)
|
2019-08-05 05:26:31 +08:00
|
|
|
_gimp_debug_stop ();
|
2020-11-22 03:08:36 +08:00
|
|
|
else if (_gimp_get_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-09-04 05:55:49 +08:00
|
|
|
_gimp_plug_in_run (PLUG_IN);
|
2004-02-17 22:03:07 +08:00
|
|
|
|
2019-08-03 00:44:34 +08:00
|
|
|
gimp_close ();
|
2023-02-22 20:28:07 +08:00
|
|
|
g_io_channel_unref (read_channel);
|
|
|
|
g_io_channel_unref (write_channel);
|
2023-11-21 04:38:11 +08:00
|
|
|
g_clear_object (&_check_custom_color1);
|
|
|
|
g_clear_object (&_check_custom_color2);
|
2019-08-03 00:44:34 +08:00
|
|
|
|
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:
|
|
|
|
*
|
2019-09-10 17:17:12 +08:00
|
|
|
* This function returns the plug-in's #GimpPlugIn instance, which is
|
|
|
|
* a a singleton that can exist exactly once per running plug-in.
|
2019-08-03 18:17:38 +08:00
|
|
|
*
|
2019-09-09 17:16:39 +08:00
|
|
|
* Returns: (transfer none) (nullable): The plug-in's #GimpPlugIn singleton.
|
2019-08-03 18:17:38 +08:00
|
|
|
*
|
|
|
|
* Since: 3.0
|
|
|
|
**/
|
|
|
|
GimpPlugIn *
|
|
|
|
gimp_get_plug_in (void)
|
|
|
|
{
|
|
|
|
return PLUG_IN;
|
|
|
|
}
|
|
|
|
|
2019-08-07 00:29:55 +08:00
|
|
|
/**
|
|
|
|
* gimp_get_pdb:
|
|
|
|
*
|
2019-09-10 17:17:12 +08:00
|
|
|
* This function returns the plug-in's #GimpPDB instance, which is a
|
|
|
|
* singleton that can exist exactly once per running plug-in.
|
2019-08-07 00:29:55 +08:00
|
|
|
*
|
2019-09-09 17:16:39 +08:00
|
|
|
* Returns: (transfer none) (nullable): The plug-in's #GimpPDB singleton.
|
2019-08-07 00:29:55 +08:00
|
|
|
*
|
|
|
|
* Since: 3.0
|
|
|
|
**/
|
|
|
|
GimpPDB *
|
|
|
|
gimp_get_pdb (void)
|
|
|
|
{
|
|
|
|
if (! PDB)
|
2019-09-04 05:55:49 +08:00
|
|
|
PDB = _gimp_pdb_new (PLUG_IN);
|
2019-08-07 00:29:55 +08:00
|
|
|
|
|
|
|
return PDB;
|
|
|
|
}
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
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)
|
|
|
|
{
|
2019-10-10 06:45:41 +08:00
|
|
|
return _export_color_profile;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_export_comment:
|
|
|
|
*
|
|
|
|
* Returns whether file plug-ins should default to exporting the
|
|
|
|
* image's comment.
|
|
|
|
*
|
|
|
|
* Returns: TRUE if preferences are set to export the comment.
|
|
|
|
*
|
|
|
|
* Since: 3.0
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_export_comment (void)
|
|
|
|
{
|
|
|
|
return _export_comment;
|
2018-06-18 08:19:41 +08:00
|
|
|
}
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2021-08-26 03:00:45 +08:00
|
|
|
/**
|
|
|
|
* gimp_export_thumbnail:
|
|
|
|
*
|
|
|
|
* Returns whether file plug-ins should default to exporting the
|
|
|
|
* image's comment.
|
|
|
|
*
|
|
|
|
* Returns: TRUE if preferences are set to export the thumbnail.
|
|
|
|
*
|
|
|
|
* Since: 3.0
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gimp_export_thumbnail (void)
|
|
|
|
{
|
|
|
|
return _export_thumbnail;
|
|
|
|
}
|
|
|
|
|
2020-12-12 01:24:36 +08:00
|
|
|
/**
|
|
|
|
* gimp_get_num_processors:
|
|
|
|
*
|
|
|
|
* Returns the number of threads set explicitly by the user in the
|
|
|
|
* preferences. This information can be used by plug-ins wishing to
|
|
|
|
* follow user settings for multi-threaded implementations.
|
|
|
|
*
|
2021-02-24 19:33:03 +08:00
|
|
|
* Returns: the preferred number of threads to use.
|
2020-12-12 01:24:36 +08:00
|
|
|
*
|
|
|
|
* Since: 3.0
|
|
|
|
**/
|
|
|
|
gint32
|
|
|
|
gimp_get_num_processors (void)
|
|
|
|
{
|
|
|
|
return _num_processors;
|
|
|
|
}
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2020-05-25 04:26:50 +08:00
|
|
|
/**
|
|
|
|
* gimp_check_custom_color1:
|
|
|
|
*
|
|
|
|
* Returns the first checkerboard custom color that can
|
|
|
|
* be used in previews.
|
|
|
|
*
|
|
|
|
* This is a constant value given at plug-in configuration time.
|
|
|
|
*
|
|
|
|
* Return value: the _check_custom_color1 value
|
app, libgimp, libgimpbase, libgimpwidgets: better checkboard colors API.
- Some coding style fixes (alignment, etc.).
- Adding missing "Since: 3.0" annotations. We are still wondering
whether this should go in 2.10, in which case, it would become
"Since: 2.10.32" annotations. See discussion in !274.
- Changing gimp_checks_get_colors() signature: merge the 4 color
arguments into 2 (inout) arguments which seems a bit nicer in C,
whereas binding handles such arguments correctly. The other
alternative would have been to at least change the order to have out
arguments in the end.
I also hesitated to get another API in libgimp, which would have been
config-aware (just returning the 2 check colors, depending on user-set
Preferences), then having GimpPreviewArea handling 2 colors (without a
GimpCheckType input). But actually, doing this, we'd remove the nice
menu popup where one could choose a generic check type (not everyone
wants to play with specific non-gray colors) in Gimp*Preview widgets.
So in the end, I left this whole thing as-is.
Instead I document the function with code sample to initialize
properly the GimpPreviewArea (since libgimpwidgets/ are independent
with no knowledge of the core config) in order to respect user
preferences.
- Hide the color properties in gimp_preview_area_menu_new() because
anyway gimp_preview_area_menu_new() does not support GimpRGB
properties right now (so all we get are warnings). It's still possible
to select custom colors on GimpPreviewArea, simply we are stuck at the
ones set in Preferences globally for now (unless a plug-in creates
custom GUI to set these).
Fixed Conflicts from !274:
libgimp/gimp.h
libgimpwidgets/gimppreviewarea.c
2022-05-14 01:00:07 +08:00
|
|
|
*
|
|
|
|
* Since: 3.0
|
2020-05-25 04:26:50 +08:00
|
|
|
**/
|
2023-11-21 04:38:11 +08:00
|
|
|
const GeglColor *
|
2020-05-25 04:26:50 +08:00
|
|
|
gimp_check_custom_color1 (void)
|
|
|
|
{
|
2023-11-21 04:38:11 +08:00
|
|
|
return (const GeglColor *) _check_custom_color1;
|
2020-05-25 04:26:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_check_custom_color2:
|
|
|
|
*
|
|
|
|
* Returns the second checkerboard custom color that can
|
|
|
|
* be used in previews.
|
|
|
|
*
|
|
|
|
* This is a constant value given at plug-in configuration time.
|
|
|
|
*
|
|
|
|
* Return value: the _check_custom_color2 value
|
app, libgimp, libgimpbase, libgimpwidgets: better checkboard colors API.
- Some coding style fixes (alignment, etc.).
- Adding missing "Since: 3.0" annotations. We are still wondering
whether this should go in 2.10, in which case, it would become
"Since: 2.10.32" annotations. See discussion in !274.
- Changing gimp_checks_get_colors() signature: merge the 4 color
arguments into 2 (inout) arguments which seems a bit nicer in C,
whereas binding handles such arguments correctly. The other
alternative would have been to at least change the order to have out
arguments in the end.
I also hesitated to get another API in libgimp, which would have been
config-aware (just returning the 2 check colors, depending on user-set
Preferences), then having GimpPreviewArea handling 2 colors (without a
GimpCheckType input). But actually, doing this, we'd remove the nice
menu popup where one could choose a generic check type (not everyone
wants to play with specific non-gray colors) in Gimp*Preview widgets.
So in the end, I left this whole thing as-is.
Instead I document the function with code sample to initialize
properly the GimpPreviewArea (since libgimpwidgets/ are independent
with no knowledge of the core config) in order to respect user
preferences.
- Hide the color properties in gimp_preview_area_menu_new() because
anyway gimp_preview_area_menu_new() does not support GimpRGB
properties right now (so all we get are warnings). It's still possible
to select custom colors on GimpPreviewArea, simply we are stuck at the
ones set in Preferences globally for now (unless a plug-in creates
custom GUI to set these).
Fixed Conflicts from !274:
libgimp/gimp.h
libgimpwidgets/gimppreviewarea.c
2022-05-14 01:00:07 +08:00
|
|
|
*
|
|
|
|
* Since: 3.0
|
2020-05-25 04:26:50 +08:00
|
|
|
**/
|
2023-11-21 04:38:11 +08:00
|
|
|
const GeglColor *
|
2020-05-25 04:26:50 +08:00
|
|
|
gimp_check_custom_color2 (void)
|
|
|
|
{
|
2023-11-21 04:38:11 +08:00
|
|
|
return (const GeglColor *) _check_custom_color2;
|
2020-05-25 04:26:50 +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
|
|
|
/**
|
|
|
|
* 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-15 16:14:38 +08:00
|
|
|
* Returns: (transfer none): the default display ID
|
|
|
|
* The object belongs to libgimp and you should not free 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
|
|
|
**/
|
2019-08-14 04:54:37 +08:00
|
|
|
GimpDisplay *
|
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 (void)
|
1998-09-19 08:40:27 +08:00
|
|
|
{
|
2019-10-10 06:45:41 +08:00
|
|
|
return gimp_display_get_by_id (_default_display_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
|
|
|
/**
|
2020-10-26 19:35:17 +08:00
|
|
|
* gimp_icon_theme_dir:
|
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
|
|
|
*
|
|
|
|
* 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
|
|
|
{
|
2020-11-22 03:08:36 +08:00
|
|
|
if (_gimp_get_debug_flags () & GIMP_DEBUG_QUIT)
|
2019-08-05 05:26:31 +08:00
|
|
|
_gimp_debug_stop ();
|
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
|
|
|
|
Issue #8900 and #9923: reimplementing GimpUnit as a proper class.
This fixes all our GObject Introspection issues with GimpUnit which was
both an enum and an int-derived type of user-defined units *completing*
the enum values. GIR clearly didn't like this!
Now GimpUnit is a proper class and units are unique objects, allowing to
compare them with an identity test (i.e. `unit == gimp_unit_pixel ()`
tells us if unit is the pixel unit or not), which makes it easy to use,
just like with int, yet adding also methods, making for nicer
introspected API.
As an aside, this also fixes #10738, by having all the built-in units
retrievable even if libgimpbase had not been properly initialized with
gimp_base_init().
I haven't checked in details how GIR works to introspect, but it looks
like it loads the library to inspect and runs functions, hence
triggering some CRITICALS because virtual methods (supposed to be
initialized with gimp_base_init() run by libgimp) are not set. This new
code won't trigger any critical because the vtable method are now not
necessary, at least for all built-in units.
Note that GimpUnit is still in libgimpbase. It could have been moved to
libgimp in order to avoid any virtual method table (since we need to
keep core and libgimp side's units in sync, PDB is required), but too
many libgimpwidgets widgets were already using GimpUnit. And technically
most of GimpUnit logic doesn't require PDB (only the creation/sync
part). This is one of the reasons why user-created GimpUnit list is
handled and stored differently from other types of objects.
Globally this simplifies the code a lot too and we don't need separate
implementations of various utils for core and libgimp, which means less
prone to errors.
2024-07-26 02:55:21 +08:00
|
|
|
gimp_base_exit ();
|
|
|
|
|
2019-09-04 05:55:49 +08:00
|
|
|
_gimp_plug_in_quit (PLUG_IN);
|
2019-09-05 18:22:04 +08:00
|
|
|
|
2019-09-09 17:16:39 +08:00
|
|
|
if (PDB)
|
|
|
|
g_object_run_dispose (G_OBJECT (PDB));
|
2019-09-05 18:22:04 +08:00
|
|
|
g_clear_object (&PDB);
|
2019-09-09 17:16:39 +08:00
|
|
|
|
|
|
|
g_object_run_dispose (G_OBJECT (PLUG_IN));
|
2019-09-05 18:22:04 +08:00
|
|
|
g_clear_object (&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
|
|
|
}
|
|
|
|
|
|
|
|
|
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)
|
|
|
|
{
|
2020-11-22 03:08:36 +08:00
|
|
|
g_printerr ("Plugin signal handler: %s: fatal error\n", progname);
|
2018-04-05 00:04:34 +08:00
|
|
|
|
|
|
|
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;
|
|
|
|
|
2022-12-29 00:42:22 +08:00
|
|
|
stream = g_fopen (plug_in_backtrace_path, "r");
|
2018-04-05 00:04:34 +08:00
|
|
|
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;
|
|
|
|
}
|
2019-08-07 05:06:15 +08:00
|
|
|
#endif /* HAVE_EXCHNDL */
|
|
|
|
|
|
|
|
#else /* ! G_OS_WIN32 */
|
2018-04-05 00:04:34 +08:00
|
|
|
|
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
|
|
|
}
|
2019-08-07 05:06:15 +08:00
|
|
|
|
|
|
|
#endif /* G_OS_WIN32 */
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2019-08-02 17:06:48 +08:00
|
|
|
void
|
|
|
|
_gimp_config (GPConfig *config)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2023-11-21 04:38:11 +08:00
|
|
|
GFile *file;
|
|
|
|
gchar *path;
|
|
|
|
gsize bpp;
|
|
|
|
const guint8 *pixel;
|
|
|
|
const guint8 *icc;
|
|
|
|
gsize icc_length;
|
|
|
|
const Babl *format = NULL;
|
|
|
|
const Babl *space = NULL;
|
2018-12-05 02:41:06 +08:00
|
|
|
|
2019-10-10 06:45:41 +08:00
|
|
|
_tile_width = config->tile_width;
|
|
|
|
_tile_height = config->tile_height;
|
|
|
|
_check_size = config->check_size;
|
|
|
|
_check_type = config->check_type;
|
2023-11-21 04:38:11 +08:00
|
|
|
|
2019-10-10 06:45:41 +08:00
|
|
|
_show_help_button = config->show_help_button ? TRUE : FALSE;
|
|
|
|
_export_color_profile = config->export_color_profile ? TRUE : FALSE;
|
|
|
|
_export_exif = config->export_exif ? TRUE : FALSE;
|
|
|
|
_export_xmp = config->export_xmp ? TRUE : FALSE;
|
|
|
|
_export_iptc = config->export_iptc ? TRUE : FALSE;
|
2020-11-14 06:54:40 +08:00
|
|
|
_export_comment = config->export_comment;
|
2020-12-12 01:24:36 +08:00
|
|
|
_num_processors = config->num_processors;
|
2019-10-10 06:45:41 +08:00
|
|
|
_default_display_id = config->default_display_id;
|
|
|
|
_wm_class = g_strdup (config->wm_class);
|
|
|
|
_display_name = g_strdup (config->display_name);
|
|
|
|
_monitor_number = config->monitor_number;
|
|
|
|
_timestamp = config->timestamp;
|
|
|
|
_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,
|
2019-09-22 22:48:16 +08:00
|
|
|
"swap-compression", config->swap_compression,
|
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
|
|
|
|
2023-11-21 04:38:11 +08:00
|
|
|
/* XXX Running gegl_init() before gegl_config() is not appreciated by
|
|
|
|
* GEGL and generates a bunch of CRITICALs.
|
|
|
|
*/
|
|
|
|
babl_init ();
|
|
|
|
|
|
|
|
g_clear_object (&_check_custom_color1);
|
|
|
|
_check_custom_color1 = gegl_color_new (NULL);
|
|
|
|
pixel = g_bytes_get_data (config->check_custom_color1, &bpp);
|
|
|
|
icc = g_bytes_get_data (config->check_custom_icc1, &icc_length);
|
|
|
|
space = babl_space_from_icc ((const char *) icc, (int) icc_length,
|
|
|
|
BABL_ICC_INTENT_RELATIVE_COLORIMETRIC,
|
|
|
|
NULL);
|
|
|
|
format = babl_format_with_space (config->check_custom_encoding1, space);
|
|
|
|
if (bpp != babl_format_get_bytes_per_pixel (format))
|
|
|
|
{
|
2024-03-14 09:41:31 +08:00
|
|
|
g_warning ("%s: checker board color 1's format expects %d bpp but %" G_GSIZE_FORMAT " bytes were passed.",
|
2023-11-21 04:38:11 +08:00
|
|
|
G_STRFUNC, babl_format_get_bytes_per_pixel (format), bpp);
|
2024-03-18 00:19:25 +08:00
|
|
|
gegl_color_set_pixel (_check_custom_color1, babl_format ("R'G'B'A double"), GIMP_CHECKS_CUSTOM_COLOR1);
|
2023-11-21 04:38:11 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gegl_color_set_pixel (_check_custom_color1, format, pixel);
|
|
|
|
}
|
|
|
|
|
|
|
|
g_clear_object (&_check_custom_color2);
|
|
|
|
_check_custom_color2 = gegl_color_new (NULL);
|
|
|
|
pixel = g_bytes_get_data (config->check_custom_color2, &bpp);
|
|
|
|
icc = g_bytes_get_data (config->check_custom_icc2, &icc_length);
|
|
|
|
space = babl_space_from_icc ((const char *) icc, (int) icc_length,
|
|
|
|
BABL_ICC_INTENT_RELATIVE_COLORIMETRIC,
|
|
|
|
NULL);
|
|
|
|
format = babl_format_with_space (config->check_custom_encoding2, space);
|
|
|
|
if (bpp != babl_format_get_bytes_per_pixel (format))
|
|
|
|
{
|
2024-03-14 09:41:31 +08:00
|
|
|
g_warning ("%s: checker board color 2's format expects %d bpp but %" G_GSIZE_FORMAT " bytes were passed.",
|
2023-11-21 04:38:11 +08:00
|
|
|
G_STRFUNC, babl_format_get_bytes_per_pixel (format), bpp);
|
2024-03-18 00:19:25 +08:00
|
|
|
gegl_color_set_pixel (_check_custom_color2, babl_format ("R'G'B'A double"), GIMP_CHECKS_CUSTOM_COLOR2);
|
2023-11-21 04:38:11 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gegl_color_set_pixel (_check_custom_color2, format, pixel);
|
|
|
|
}
|
|
|
|
|
2018-12-05 02:41:06 +08:00
|
|
|
g_free (path);
|
|
|
|
g_object_unref (file);
|
|
|
|
|
2019-08-24 04:23:23 +08:00
|
|
|
_gimp_shm_open (config->shm_id);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|