diff --git a/app/main.c b/app/main.c index 6a636a5551..7a408d4733 100644 --- a/app/main.c +++ b/app/main.c @@ -53,6 +53,7 @@ #include #include "libgimpbase/gimpbase.h" +#include "libgimpbase/gimpbase-private.h" #include "pdb/pdb-types.h" diff --git a/libgimp/gimp.c b/libgimp/gimp.c index d718394181..3c28f160ce 100644 --- a/libgimp/gimp.c +++ b/libgimp/gimp.c @@ -152,13 +152,20 @@ static GimpStackTraceMode stack_trace_mode = GIMP_STACK_TRACE_NEVER; * @argv: (array length=argc): the arguments * * 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(). + * [class@Gimp.PlugIn] subclass #GType and the 'argc' and 'argv' that are passed + * to the platform's `main()`. * - * See also: GIMP_MAIN(), #GimpPlugIn. + * For instance, in Python, you will want to end your plug-in with this + * call: + * + * ```py + * Gimp.main(MyPlugIn.__gtype__, sys.argv) + * ``` + * + * For C plug-ins, use instead the [func@Gimp.MAIN] macro * * Returns: an exit status as defined by the C library, - * on success EXIT_SUCCESS. + * on success `EXIT_SUCCESS`. * * Since: 3.0 **/ diff --git a/libgimp/gimp.h b/libgimp/gimp.h index a6968770ef..9b0998b846 100644 --- a/libgimp/gimp.h +++ b/libgimp/gimp.h @@ -89,9 +89,11 @@ G_BEGIN_DECLS * 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 + * To use this macro, simply place a line that contains just the code: * + * ```C * GIMP_MAIN (MY_TYPE_PLUG_IN) + * ``` * * at the toplevel of your file. No semicolon should be used. * diff --git a/libgimpbase/gimpbase-private.h b/libgimpbase/gimpbase-private.h index 7e00e79d9c..4b83b3f1d3 100644 --- a/libgimpbase/gimpbase-private.h +++ b/libgimpbase/gimpbase-private.h @@ -23,6 +23,9 @@ #define __GIMP_BASE_PRIVATE_H__ +#include + + typedef struct _GimpUnitVtable GimpUnitVtable; struct _GimpUnitVtable diff --git a/libgimpbase/gimpenv-private.h b/libgimpbase/gimpenv-private.h new file mode 100644 index 0000000000..1372201c6a --- /dev/null +++ b/libgimpbase/gimpenv-private.h @@ -0,0 +1,35 @@ +/* LIBGIMP - The GIMP Library + * Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball + * + * gimpenv-private.h + * + * This library is free software: you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see + * . + */ + +#ifndef __GIMP_ENV_PRIVATE_H__ +#define __GIMP_ENV_PRIVATE_H__ + +G_BEGIN_DECLS + +/* For information look into the C source or the html documentation */ + + +void gimp_env_init (gboolean plug_in); + + +G_END_DECLS + +#endif /* __GIMP_ENV_PRIVATE_H__ */ + diff --git a/libgimpbase/gimpenv.c b/libgimpbase/gimpenv.c index 7ada34ec4e..13a2a9dabf 100644 --- a/libgimpbase/gimpenv.c +++ b/libgimpbase/gimpenv.c @@ -40,6 +40,7 @@ #define __GIMP_ENV_C__ #include "gimpenv.h" +#include "gimpenv-private.h" #include "gimpversion.h" #include "gimpreloc.h" @@ -99,8 +100,9 @@ const guint gimp_micro_version = GIMP_MICRO_VERSION; * @plug_in: must be %TRUE if this function is called from a plug-in * * You don't need to care about this function. It is being called for - * you automatically (by means of the MAIN() macro that every plug-in - * runs). Calling it again will cause a fatal error. + * you automatically (by means of the [func@Gimp.MAIN] macro that every + * C plug-in runs or directly with [func@Gimp.main] in binding). Calling + * it again will cause a fatal error. * * Since: 2.4 */ diff --git a/libgimpbase/gimpenv.h b/libgimpbase/gimpenv.h index a6a26e7d3c..e2eaad76e9 100644 --- a/libgimpbase/gimpenv.h +++ b/libgimpbase/gimpenv.h @@ -78,10 +78,6 @@ void gimp_path_free (GList *path); gchar * gimp_path_get_user_writable_dir (GList *path) G_GNUC_MALLOC; -/* should be considered private, don't use! */ -void gimp_env_init (gboolean plug_in); - - G_END_DECLS #endif /* __GIMP_ENV_H__ */