1999-12-27 20:02:07 +08:00
|
|
|
/* LIBGIMP - The GIMP Library
|
|
|
|
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
|
1998-01-25 18:26:47 +08:00
|
|
|
*
|
2000-05-31 21:24:14 +08:00
|
|
|
* gimp.h
|
|
|
|
*
|
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.
|
1999-12-27 20:02:07 +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
|
1999-12-26 15:54:39 +08:00
|
|
|
* Lesser General Public License for more details.
|
1998-01-25 18:26:47 +08:00
|
|
|
*
|
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/>.
|
1999-12-27 20:02:07 +08:00
|
|
|
*/
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
#ifndef __GIMP_H__
|
|
|
|
#define __GIMP_H__
|
|
|
|
|
2011-04-21 05:58:00 +08:00
|
|
|
#include <cairo.h>
|
2020-05-21 22:02:55 +08:00
|
|
|
#include <glib-object.h>
|
2012-03-22 08:10:43 +08:00
|
|
|
#include <gegl.h>
|
2011-04-21 02:04:35 +08:00
|
|
|
#include <gdk-pixbuf/gdk-pixbuf.h>
|
2023-09-14 01:13:51 +08:00
|
|
|
#include <pango/pango.h>
|
2000-01-26 07:06:12 +08:00
|
|
|
|
2005-06-26 20:53:31 +08:00
|
|
|
#include <libgimpbase/gimpbase.h>
|
2001-01-24 02:49:44 +08:00
|
|
|
#include <libgimpcolor/gimpcolor.h>
|
2005-06-26 20:53:31 +08:00
|
|
|
#include <libgimpconfig/gimpconfig.h>
|
2001-01-24 07:56:18 +08:00
|
|
|
#include <libgimpmath/gimpmath.h>
|
2001-01-24 02:49:44 +08:00
|
|
|
|
2011-04-29 01:59:52 +08:00
|
|
|
#define __GIMP_H_INSIDE__
|
|
|
|
|
2000-05-27 09:30:21 +08:00
|
|
|
#include <libgimp/gimpenums.h>
|
2000-05-31 14:15:06 +08:00
|
|
|
#include <libgimp/gimptypes.h>
|
|
|
|
|
2022-04-16 23:09:21 +08:00
|
|
|
#include <libgimp/gimpbatchprocedure.h>
|
libgimp, pdb: replacing gimp_brush_get_pixels() by gimp_brush_get_buffer()…
… and gimp_brush_get_mask().
gimp_brush_get_pixels() was a bit crappy, returning raw data with only
dimensions and bpp to go with (no color model/space, no bit depth…). So the
assumption is that we work with 8-bit per channel data, possibly with alpha
depending of number of channels as deduced from bpp, and very likely in sRGB
color space. It might be globally ok with many of the brush formats (and
historical brushes) but won't fare well as we improve brush capabilities.
- gimp_brush_get_pixels() is in fact made private.
- The 2 new functions are using this old PDB call _gimp_brush_get_pixels() to
construct buffers. This has some limitations, in particular that it returns
only 8-bit per channel sRGB data, but at least the signature won't change when
we will improve things in the future (so if some day, we pass fancy brushes in
high-bit depth, the method will stay the same).
- This new implementation also allows scaling down the brush (keeping aspect
ratio) which is useful when you need to fit a brush preview into a drawing
widget.
- Current implementation stores the buffers at native size in the libgimp's
GimpBrush object, hence save re-querying the core every time you need an
update. This can be improved as current implementation also means that you
don't get updates if the brush changed. This should handle most common use
cases for now, though.
- Also with this change, I move GimpBrush class implementation into its own
dedicated file.
2023-08-18 22:39:11 +08:00
|
|
|
#include <libgimp/gimpbrush.h>
|
2000-06-02 01:34:56 +08:00
|
|
|
#include <libgimp/gimpchannel.h>
|
2019-08-14 03:36:03 +08:00
|
|
|
#include <libgimp/gimpdisplay.h>
|
2000-05-31 21:24:14 +08:00
|
|
|
#include <libgimp/gimpdrawable.h>
|
2023-08-19 06:44:51 +08:00
|
|
|
#include <libgimp/gimpfont.h>
|
2005-06-26 20:53:31 +08:00
|
|
|
#include <libgimp/gimpgimprc.h>
|
2023-08-19 06:44:51 +08:00
|
|
|
#include <libgimp/gimpgradient.h>
|
2000-06-01 20:20:13 +08:00
|
|
|
#include <libgimp/gimpimage.h>
|
2015-06-05 18:51:46 +08:00
|
|
|
#include <libgimp/gimpimagecolorprofile.h>
|
2020-09-13 19:09:59 +08:00
|
|
|
#include <libgimp/gimpimagemetadata.h>
|
2019-08-18 18:46:07 +08:00
|
|
|
#include <libgimp/gimpimageprocedure.h>
|
2019-08-13 19:59:33 +08:00
|
|
|
#include <libgimp/gimpitem.h>
|
2000-06-01 22:59:22 +08:00
|
|
|
#include <libgimp/gimplayer.h>
|
2019-08-14 03:36:03 +08:00
|
|
|
#include <libgimp/gimplayermask.h>
|
2019-08-11 02:25:37 +08:00
|
|
|
#include <libgimp/gimploadprocedure.h>
|
2023-08-19 06:44:51 +08:00
|
|
|
#include <libgimp/gimppalette.h>
|
2019-07-26 22:08:09 +08:00
|
|
|
#include <libgimp/gimpparamspecs.h>
|
2023-08-19 06:13:36 +08:00
|
|
|
#include <libgimp/gimppattern.h>
|
2019-08-06 18:17:27 +08:00
|
|
|
#include <libgimp/gimppdb.h>
|
2004-05-19 06:54:41 +08:00
|
|
|
#include <libgimp/gimpplugin.h>
|
2019-09-20 18:31:11 +08:00
|
|
|
#include <libgimp/gimpprocedureconfig.h>
|
2019-08-19 15:56:20 +08:00
|
|
|
#include <libgimp/gimpprocedure-params.h>
|
2004-08-30 02:36:30 +08:00
|
|
|
#include <libgimp/gimpprogress.h>
|
2023-05-31 22:12:04 +08:00
|
|
|
#include <libgimp/gimpresource.h>
|
2019-08-11 02:25:37 +08:00
|
|
|
#include <libgimp/gimpsaveprocedure.h>
|
2000-06-01 20:20:13 +08:00
|
|
|
#include <libgimp/gimpselection.h>
|
2022-09-30 22:21:47 +08:00
|
|
|
#include <libgimp/gimptextlayer.h>
|
2019-08-19 20:02:34 +08:00
|
|
|
#include <libgimp/gimpthumbnailprocedure.h>
|
2019-08-14 03:36:03 +08:00
|
|
|
#include <libgimp/gimpvectors.h>
|
2000-05-27 09:30:21 +08:00
|
|
|
|
2022-10-16 03:11:05 +08:00
|
|
|
/* Resources and their widgets. Order important. */
|
|
|
|
#include <libgimp/gimpresourceselect.h>
|
|
|
|
|
2011-03-08 20:42:05 +08:00
|
|
|
#include <libgimp/gimp_pdb_headers.h>
|
2000-05-31 14:15:06 +08:00
|
|
|
|
2011-04-29 01:59:52 +08:00
|
|
|
#undef __GIMP_H_INSIDE__
|
|
|
|
|
1999-10-05 03:26:07 +08:00
|
|
|
#ifdef G_OS_WIN32
|
2006-11-28 19:57:05 +08:00
|
|
|
#include <stdlib.h> /* For __argc and __argv */
|
1999-03-07 20:56:03 +08:00
|
|
|
#endif
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-11-23 07:46:13 +08:00
|
|
|
G_BEGIN_DECLS
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-06-01 05:16:11 +08:00
|
|
|
|
2019-07-26 05:07:24 +08:00
|
|
|
/**
|
|
|
|
* GIMP_MAIN:
|
|
|
|
* @plug_in_type: The #GType of the plug-in's #GimpPlugIn subclass
|
|
|
|
*
|
|
|
|
* A macro that expands to the appropriate main() function for the
|
|
|
|
* platform being compiled for.
|
|
|
|
*
|
|
|
|
* To use this macro, simply place a line that contains just the code
|
|
|
|
*
|
|
|
|
* GIMP_MAIN (MY_TYPE_PLUG_IN)
|
|
|
|
*
|
|
|
|
* at the toplevel of your file. No semicolon should be used.
|
2019-09-09 17:16:39 +08:00
|
|
|
*
|
|
|
|
* Since: 3.0
|
2019-07-26 05:07:24 +08:00
|
|
|
**/
|
|
|
|
|
|
|
|
#ifdef G_OS_WIN32
|
|
|
|
|
|
|
|
/* Define WinMain() because plug-ins are built as GUI applications. Also
|
|
|
|
* define a main() in case some plug-in still is built as a console
|
|
|
|
* application.
|
|
|
|
*/
|
|
|
|
# ifdef __GNUC__
|
|
|
|
# ifndef _stdcall
|
|
|
|
# define _stdcall __attribute__((stdcall))
|
|
|
|
# endif
|
|
|
|
# endif
|
|
|
|
|
|
|
|
# define GIMP_MAIN(plug_in_type) \
|
|
|
|
struct HINSTANCE__; \
|
|
|
|
\
|
|
|
|
int _stdcall \
|
|
|
|
WinMain (struct HINSTANCE__ *hInstance, \
|
|
|
|
struct HINSTANCE__ *hPrevInstance, \
|
|
|
|
char *lpszCmdLine, \
|
|
|
|
int nCmdShow); \
|
|
|
|
\
|
|
|
|
int _stdcall \
|
|
|
|
WinMain (struct HINSTANCE__ *hInstance, \
|
|
|
|
struct HINSTANCE__ *hPrevInstance, \
|
|
|
|
char *lpszCmdLine, \
|
|
|
|
int nCmdShow) \
|
|
|
|
{ \
|
|
|
|
return gimp_main (plug_in_type, \
|
2019-08-08 01:03:04 +08:00
|
|
|
__argc, __argv); \
|
2019-07-26 05:07:24 +08:00
|
|
|
} \
|
|
|
|
\
|
|
|
|
int \
|
|
|
|
main (int argc, char *argv[]) \
|
|
|
|
{ \
|
|
|
|
/* Use __argc and __argv here, too, as they work \
|
|
|
|
* better with mingw-w64. \
|
|
|
|
*/ \
|
|
|
|
return gimp_main (plug_in_type, \
|
|
|
|
__argc, __argv); \
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
# define GIMP_MAIN(plug_in_type) \
|
|
|
|
int \
|
|
|
|
main (int argc, char *argv[]) \
|
|
|
|
{ \
|
|
|
|
return gimp_main (plug_in_type, \
|
|
|
|
argc, argv); \
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
/* The main procedure that must be called with the plug-in's
|
|
|
|
* GimpPlugIn subclass type and the 'argc' and 'argv' that are passed
|
|
|
|
* to "main".
|
1997-11-25 06:05:25 +08:00
|
|
|
*/
|
2019-07-31 04:17:20 +08:00
|
|
|
gint gimp_main (GType plug_in_type,
|
|
|
|
gint argc,
|
|
|
|
gchar *argv[]);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2019-08-03 18:17:38 +08:00
|
|
|
/* Return the GimpPlugIn singleton of this plug-in process
|
|
|
|
*/
|
|
|
|
GimpPlugIn * gimp_get_plug_in (void);
|
|
|
|
|
2019-08-09 18:48:41 +08:00
|
|
|
/* Return the GimpPDB singleton of this plug-in process
|
2019-08-07 00:29:55 +08:00
|
|
|
*/
|
|
|
|
GimpPDB * gimp_get_pdb (void);
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
/* Forcefully causes the gimp library to exit and
|
2019-08-09 18:48:41 +08:00
|
|
|
* close down its connection to main gimp application.
|
1997-11-25 06:05:25 +08:00
|
|
|
*/
|
2019-07-31 04:17:20 +08:00
|
|
|
void gimp_quit (void) G_GNUC_NORETURN;
|
1999-05-17 04:22:33 +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 various constants given by the GIMP core at plug-in config time.
|
|
|
|
*/
|
2019-07-31 04:17:20 +08:00
|
|
|
guint gimp_tile_width (void) G_GNUC_CONST;
|
|
|
|
guint gimp_tile_height (void) G_GNUC_CONST;
|
|
|
|
gboolean gimp_show_help_button (void) G_GNUC_CONST;
|
|
|
|
gboolean gimp_export_color_profile (void) G_GNUC_CONST;
|
2019-10-10 06:45:41 +08:00
|
|
|
gboolean gimp_export_comment (void) G_GNUC_CONST;
|
2019-07-31 04:17:20 +08:00
|
|
|
gboolean gimp_export_exif (void) G_GNUC_CONST;
|
|
|
|
gboolean gimp_export_xmp (void) G_GNUC_CONST;
|
|
|
|
gboolean gimp_export_iptc (void) G_GNUC_CONST;
|
2021-08-26 03:00:45 +08:00
|
|
|
gboolean gimp_export_thumbnail (void) G_GNUC_CONST;
|
2020-12-12 01:24:36 +08:00
|
|
|
gint gimp_get_num_processors (void) G_GNUC_CONST;
|
2019-07-31 04:17:20 +08:00
|
|
|
GimpCheckSize gimp_check_size (void) G_GNUC_CONST;
|
|
|
|
GimpCheckType gimp_check_type (void) G_GNUC_CONST;
|
2023-11-21 04:38:11 +08:00
|
|
|
const GeglColor * gimp_check_custom_color1 (void) G_GNUC_CONST;
|
|
|
|
const GeglColor * gimp_check_custom_color2 (void) G_GNUC_CONST;
|
2019-08-14 04:54:37 +08:00
|
|
|
GimpDisplay * gimp_default_display (void) G_GNUC_CONST;
|
2019-07-31 04:17:20 +08:00
|
|
|
const gchar * gimp_wm_class (void) G_GNUC_CONST;
|
|
|
|
const gchar * gimp_display_name (void) G_GNUC_CONST;
|
|
|
|
gint gimp_monitor_number (void) G_GNUC_CONST;
|
|
|
|
guint32 gimp_user_time (void) G_GNUC_CONST;
|
|
|
|
const gchar * gimp_icon_theme_dir (void) G_GNUC_CONST;
|
|
|
|
|
|
|
|
const gchar * gimp_get_progname (void) G_GNUC_CONST;
|
2006-06-21 19:00:51 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-11-23 07:46:13 +08:00
|
|
|
G_END_DECLS
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
#endif /* __GIMP_H__ */
|