2006-12-10 05:33:38 +08:00
|
|
|
/* GIMP - The GNU Image Manipulation Program
|
2004-03-09 09:37:56 +08:00
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
|
|
|
* The GIMP Help plug-in
|
2008-05-17 00:56:33 +08:00
|
|
|
* Copyright (C) 1999-2008 Sven Neumann <sven@gimp.org>
|
2004-03-09 09:37:56 +08:00
|
|
|
* Michael Natterer <mitch@gimp.org>
|
|
|
|
* Henrik Brix Andersen <brix@gimp.org>
|
|
|
|
*
|
2009-01-18 06:28:01 +08:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
2004-03-09 09:37:56 +08:00
|
|
|
* it under the terms of the GNU General Public License as published by
|
2009-01-18 06:28:01 +08:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2004-03-09 09:37:56 +08:00
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program 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 General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2018-07-12 05:27:07 +08:00
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2004-03-09 09:37:56 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include <string.h> /* strlen */
|
|
|
|
|
|
|
|
#include <glib.h>
|
|
|
|
|
2019-08-02 17:06:48 +08:00
|
|
|
#define GIMP_DISABLE_COMPAT_CRUFT
|
|
|
|
|
2004-03-09 09:37:56 +08:00
|
|
|
#include "libgimp/gimp.h"
|
|
|
|
|
2006-11-21 05:46:21 +08:00
|
|
|
#include "gimphelp.h"
|
2004-03-09 09:37:56 +08:00
|
|
|
|
2004-03-09 09:45:21 +08:00
|
|
|
#include "libgimp/stdplugins-intl.h"
|
|
|
|
|
2004-03-09 09:37:56 +08:00
|
|
|
|
|
|
|
/* defines */
|
|
|
|
|
2005-08-12 23:46:46 +08:00
|
|
|
#define GIMP_HELP_EXT_PROC "extension-gimp-help"
|
|
|
|
#define GIMP_HELP_TEMP_EXT_PROC "extension-gimp-help-temp"
|
2004-03-09 09:37:56 +08:00
|
|
|
|
|
|
|
|
2019-07-31 03:04:11 +08:00
|
|
|
typedef struct _Help Help;
|
|
|
|
typedef struct _HelpClass HelpClass;
|
|
|
|
|
|
|
|
struct _Help
|
|
|
|
{
|
|
|
|
GimpPlugIn parent_instance;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _HelpClass
|
|
|
|
{
|
|
|
|
GimpPlugInClass parent_class;
|
|
|
|
};
|
|
|
|
|
2004-03-09 09:37:56 +08:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
gchar *procedure;
|
|
|
|
gchar *help_domain;
|
2004-03-18 08:11:03 +08:00
|
|
|
gchar *help_locales;
|
2004-03-09 09:37:56 +08:00
|
|
|
gchar *help_id;
|
|
|
|
} IdleHelp;
|
|
|
|
|
|
|
|
|
|
|
|
/* forward declarations */
|
|
|
|
|
2019-07-31 03:04:11 +08:00
|
|
|
#define HELP_TYPE (help_get_type ())
|
|
|
|
#define HELP (obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), HELP_TYPE, Help))
|
2004-03-09 09:37:56 +08:00
|
|
|
|
2019-07-31 03:04:11 +08:00
|
|
|
GType help_get_type (void) G_GNUC_CONST;
|
2004-03-09 09:37:56 +08:00
|
|
|
|
2019-08-03 01:10:13 +08:00
|
|
|
static GList * help_query_procedures (GimpPlugIn *plug_in);
|
2019-07-31 03:04:11 +08:00
|
|
|
static GimpProcedure * help_create_procedure (GimpPlugIn *plug_in,
|
|
|
|
const gchar *name);
|
2004-03-09 09:37:56 +08:00
|
|
|
|
2019-07-31 03:04:11 +08:00
|
|
|
static GimpValueArray * help_run (GimpProcedure *procedure,
|
2019-08-02 04:45:49 +08:00
|
|
|
const GimpValueArray *args,
|
|
|
|
gpointer run_data);
|
2019-07-31 03:04:11 +08:00
|
|
|
static GimpValueArray * help_temp_run (GimpProcedure *procedure,
|
2019-08-02 04:45:49 +08:00
|
|
|
const GimpValueArray *args,
|
|
|
|
gpointer run_data);
|
2008-06-10 18:25:56 +08:00
|
|
|
|
2019-07-31 03:04:11 +08:00
|
|
|
static void help_temp_proc_install (GimpPlugIn *plug_in);
|
|
|
|
static void help_load (const gchar *procedure,
|
|
|
|
const gchar *help_domain,
|
|
|
|
const gchar *help_locales,
|
|
|
|
const gchar *help_id);
|
|
|
|
static gboolean help_load_idle (gpointer data);
|
|
|
|
|
|
|
|
static GimpHelpProgress * help_load_progress_new (void);
|
2004-03-09 09:37:56 +08:00
|
|
|
|
|
|
|
|
2004-12-06 03:50:37 +08:00
|
|
|
static GMainLoop *main_loop = NULL;
|
|
|
|
|
2019-07-31 03:04:11 +08:00
|
|
|
G_DEFINE_TYPE (Help, help, GIMP_TYPE_PLUG_IN)
|
2004-03-09 09:37:56 +08:00
|
|
|
|
2019-07-31 03:04:11 +08:00
|
|
|
GIMP_MAIN (HELP_TYPE)
|
2004-03-09 09:37:56 +08:00
|
|
|
|
|
|
|
|
|
|
|
static void
|
2019-07-31 03:04:11 +08:00
|
|
|
help_class_init (HelpClass *klass)
|
2004-03-09 09:37:56 +08:00
|
|
|
{
|
2019-07-31 03:04:11 +08:00
|
|
|
GimpPlugInClass *plug_in_class = GIMP_PLUG_IN_CLASS (klass);
|
2004-03-09 09:37:56 +08:00
|
|
|
|
2019-07-31 03:04:11 +08:00
|
|
|
plug_in_class->query_procedures = help_query_procedures;
|
|
|
|
plug_in_class->create_procedure = help_create_procedure;
|
2004-03-09 09:37:56 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2019-07-31 03:04:11 +08:00
|
|
|
help_init (Help *help)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2019-08-03 01:10:13 +08:00
|
|
|
static GList *
|
libgimp, plug-ins: remove n_procedures from (init|query)_procedures().
The way currently implemented plug-ins are, they are already
NULL-terminating the returned arrays. Since a procedure name cannot be
NULL itself by definition, defining the array length by a terminal NULL
is enough. There is no need to also add a n_procedures parameters which
is just one more possible bug source, even more as we were already
expecting the NULL termination by using g_strfreev() to free the memory.
Anyway a length parameter does not bring any advantage since a plug-in
can still "lie" about its array size (just as it can forget to
NULL-terminate it) and when this happens, the plug-in will segfault.
That's it, it's just a plug-in programming error.
Last but not least, some binding seem to have issues with returned array
setting an (out) parameter as the length. In pygobject at least, the
length parameter doesn't disappear and we end up with this ugly
signature:
> In [3]: Gimp.PlugIn.do_query_procedures.__doc__
> Out[3]: 'query_procedures(self) -> list, n_procedures:int'
See bug report pygobject#352.
To avoid this, we should either set both the array and the length as
(out) parameters or just set the returned array as NULL-terminated
(which is the solution I chose).
2019-08-02 19:36:11 +08:00
|
|
|
help_query_procedures (GimpPlugIn *plug_in)
|
2019-07-31 03:04:11 +08:00
|
|
|
{
|
2019-08-03 01:10:13 +08:00
|
|
|
return g_list_append (NULL, g_strdup (GIMP_HELP_EXT_PROC));
|
2019-07-31 03:04:11 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static GimpProcedure *
|
|
|
|
help_create_procedure (GimpPlugIn *plug_in,
|
|
|
|
const gchar *name)
|
|
|
|
{
|
|
|
|
GimpProcedure *procedure = NULL;
|
|
|
|
|
|
|
|
if (! strcmp (name, GIMP_HELP_EXT_PROC))
|
|
|
|
{
|
2019-08-02 04:45:49 +08:00
|
|
|
procedure = gimp_procedure_new (plug_in, name, GIMP_EXTENSION,
|
|
|
|
help_run, NULL, NULL);
|
2019-07-31 03:04:11 +08:00
|
|
|
|
2019-08-02 06:35:17 +08:00
|
|
|
gimp_procedure_set_attribution (procedure,
|
|
|
|
"Sven Neumann <sven@gimp.org>, "
|
|
|
|
"Michael Natterer <mitch@gimp.org>, "
|
|
|
|
"Henrik Brix Andersen <brix@gimp.org>",
|
|
|
|
"Sven Neumann, Michael Natterer & Henrik Brix Andersen",
|
|
|
|
"1999-2008");
|
2019-07-31 03:04:11 +08:00
|
|
|
|
|
|
|
gimp_procedure_add_argument (procedure,
|
2019-08-15 20:04:56 +08:00
|
|
|
g_param_spec_int ("num-domain-names",
|
|
|
|
"Num Domain Names",
|
|
|
|
"Num domain names",
|
|
|
|
0, G_MAXINT, 0,
|
|
|
|
G_PARAM_READWRITE));
|
2019-07-31 03:04:11 +08:00
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
gimp_param_spec_string_array ("domain-names",
|
|
|
|
"Domain Names",
|
|
|
|
"Domain names",
|
|
|
|
G_PARAM_READWRITE));
|
|
|
|
gimp_procedure_add_argument (procedure,
|
2019-08-15 20:04:56 +08:00
|
|
|
g_param_spec_int ("num-domain-uris",
|
|
|
|
"Num Domain URIs",
|
|
|
|
"Num domain URIs",
|
|
|
|
0, G_MAXINT, 0,
|
|
|
|
G_PARAM_READWRITE));
|
2019-07-31 03:04:11 +08:00
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
gimp_param_spec_string_array ("domain-uris",
|
|
|
|
"Domain URIs",
|
|
|
|
"Domain URIs",
|
|
|
|
G_PARAM_READWRITE));
|
|
|
|
}
|
|
|
|
|
|
|
|
return procedure;
|
|
|
|
}
|
|
|
|
|
|
|
|
static GimpValueArray *
|
|
|
|
help_run (GimpProcedure *procedure,
|
2019-08-02 04:45:49 +08:00
|
|
|
const GimpValueArray *args,
|
|
|
|
gpointer run_data)
|
2004-03-09 09:37:56 +08:00
|
|
|
{
|
2006-11-21 05:46:21 +08:00
|
|
|
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
|
2004-03-09 09:37:56 +08:00
|
|
|
|
2004-03-09 09:45:21 +08:00
|
|
|
INIT_I18N ();
|
|
|
|
|
2004-03-09 09:37:56 +08:00
|
|
|
/* make sure all the arguments are there */
|
2019-07-31 03:04:11 +08:00
|
|
|
if (gimp_value_array_length (args) == 4)
|
2004-03-09 09:37:56 +08:00
|
|
|
{
|
2019-07-31 03:04:11 +08:00
|
|
|
if (! gimp_help_init
|
|
|
|
(g_value_get_int (gimp_value_array_index (args, 0)),
|
|
|
|
gimp_value_get_string_array (gimp_value_array_index (args, 1)),
|
|
|
|
g_value_get_int (gimp_value_array_index (args, 2)),
|
|
|
|
gimp_value_get_string_array (gimp_value_array_index (args, 3))))
|
2004-03-09 09:37:56 +08:00
|
|
|
{
|
|
|
|
status = GIMP_PDB_CALLING_ERROR;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
g_printerr ("help: wrong number of arguments in procedure call.\n");
|
|
|
|
|
|
|
|
status = GIMP_PDB_CALLING_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (status == GIMP_PDB_SUCCESS)
|
|
|
|
{
|
2019-07-31 03:21:36 +08:00
|
|
|
GimpPlugIn *plug_in = gimp_procedure_get_plug_in (procedure);
|
|
|
|
|
2004-12-06 03:50:37 +08:00
|
|
|
main_loop = g_main_loop_new (NULL, FALSE);
|
2004-03-09 09:37:56 +08:00
|
|
|
|
2019-07-31 03:21:36 +08:00
|
|
|
help_temp_proc_install (plug_in);
|
2004-03-09 09:37:56 +08:00
|
|
|
|
2019-08-02 05:45:53 +08:00
|
|
|
gimp_procedure_extension_ready (procedure);
|
2019-08-02 17:06:48 +08:00
|
|
|
gimp_plug_in_extension_enable (plug_in);
|
2004-03-09 09:37:56 +08:00
|
|
|
|
2004-12-06 03:50:37 +08:00
|
|
|
g_main_loop_run (main_loop);
|
|
|
|
|
|
|
|
g_main_loop_unref (main_loop);
|
|
|
|
main_loop = NULL;
|
2004-03-18 20:18:12 +08:00
|
|
|
|
2019-07-31 03:21:36 +08:00
|
|
|
gimp_plug_in_remove_temp_procedure (plug_in, GIMP_HELP_TEMP_EXT_PROC);
|
2004-03-09 09:37:56 +08:00
|
|
|
}
|
|
|
|
|
2019-07-31 03:04:11 +08:00
|
|
|
return gimp_procedure_new_return_values (procedure, status, NULL);
|
2004-03-09 09:37:56 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2019-07-31 03:04:11 +08:00
|
|
|
help_temp_proc_install (GimpPlugIn *plug_in)
|
2004-03-09 09:37:56 +08:00
|
|
|
{
|
2019-07-31 03:04:11 +08:00
|
|
|
GimpProcedure *procedure;
|
|
|
|
|
|
|
|
procedure = gimp_procedure_new (plug_in, GIMP_HELP_TEMP_EXT_PROC,
|
2019-08-02 04:45:49 +08:00
|
|
|
GIMP_TEMPORARY, help_temp_run, NULL, NULL);
|
2019-07-31 03:04:11 +08:00
|
|
|
|
2019-08-02 06:35:17 +08:00
|
|
|
gimp_procedure_set_attribution (procedure,
|
|
|
|
"Sven Neumann <sven@gimp.org>, "
|
|
|
|
"Michael Natterer <mitch@gimp.org>"
|
|
|
|
"Henrik Brix Andersen <brix@gimp.org",
|
|
|
|
"Sven Neumann, Michael Natterer & Henrik Brix Andersen",
|
|
|
|
"1999-2008");
|
2019-07-31 03:04:11 +08:00
|
|
|
|
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
g_param_spec_string ("help-proc",
|
|
|
|
"The procedure of the browser to use",
|
|
|
|
"The procedure of the browser to use",
|
|
|
|
NULL,
|
|
|
|
G_PARAM_READWRITE));
|
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
g_param_spec_string ("help-domain",
|
|
|
|
"Help domain to use",
|
|
|
|
"Help domain to use",
|
|
|
|
NULL,
|
|
|
|
G_PARAM_READWRITE));
|
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
g_param_spec_string ("help-locales",
|
|
|
|
"Language to use",
|
|
|
|
"Language to use",
|
|
|
|
NULL,
|
|
|
|
G_PARAM_READWRITE));
|
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
g_param_spec_string ("help-id",
|
|
|
|
"Help ID to open",
|
|
|
|
"Help ID to open",
|
|
|
|
NULL,
|
|
|
|
G_PARAM_READWRITE));
|
|
|
|
|
|
|
|
gimp_plug_in_add_temp_procedure (plug_in, procedure);
|
|
|
|
g_object_unref (procedure);
|
2004-03-09 09:37:56 +08:00
|
|
|
}
|
|
|
|
|
2019-07-31 03:04:11 +08:00
|
|
|
static GimpValueArray *
|
|
|
|
help_temp_run (GimpProcedure *procedure,
|
2019-08-02 04:45:49 +08:00
|
|
|
const GimpValueArray *args,
|
|
|
|
gpointer run_data)
|
2004-03-09 09:37:56 +08:00
|
|
|
{
|
2004-03-18 08:11:03 +08:00
|
|
|
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
|
2019-07-31 03:04:11 +08:00
|
|
|
const gchar *help_proc = NULL;
|
2004-03-18 08:11:03 +08:00
|
|
|
const gchar *help_domain = GIMP_HELP_DEFAULT_DOMAIN;
|
|
|
|
const gchar *help_locales = NULL;
|
|
|
|
const gchar *help_id = GIMP_HELP_DEFAULT_ID;
|
2004-03-09 09:37:56 +08:00
|
|
|
|
|
|
|
/* make sure all the arguments are there */
|
2019-07-31 03:04:11 +08:00
|
|
|
if (gimp_value_array_length (args) == 4)
|
2004-03-09 09:37:56 +08:00
|
|
|
{
|
2019-07-31 03:04:11 +08:00
|
|
|
if (g_value_get_string (gimp_value_array_index (args, 0)))
|
|
|
|
help_proc = g_value_get_string (gimp_value_array_index (args, 0));
|
2004-03-09 09:37:56 +08:00
|
|
|
|
2019-07-31 03:04:11 +08:00
|
|
|
if (g_value_get_string (gimp_value_array_index (args, 1)))
|
|
|
|
help_domain = g_value_get_string (gimp_value_array_index (args, 1));
|
2004-03-09 09:37:56 +08:00
|
|
|
|
2019-07-31 03:04:11 +08:00
|
|
|
if (g_value_get_string (gimp_value_array_index (args, 2)))
|
|
|
|
help_locales = g_value_get_string (gimp_value_array_index (args, 2));
|
2004-03-09 09:37:56 +08:00
|
|
|
|
2019-07-31 03:04:11 +08:00
|
|
|
if (g_value_get_string (gimp_value_array_index (args, 3)))
|
|
|
|
help_id = g_value_get_string (gimp_value_array_index (args, 3));
|
2004-03-09 09:37:56 +08:00
|
|
|
}
|
|
|
|
|
2019-07-31 03:04:11 +08:00
|
|
|
if (! help_proc)
|
2004-03-18 08:11:03 +08:00
|
|
|
status = GIMP_PDB_CALLING_ERROR;
|
|
|
|
|
|
|
|
if (status == GIMP_PDB_SUCCESS)
|
2019-07-31 03:04:11 +08:00
|
|
|
help_load (help_proc, help_domain, help_locales, help_id);
|
|
|
|
|
|
|
|
return gimp_procedure_new_return_values (procedure, status, NULL);
|
2004-03-09 09:37:56 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2019-07-31 03:04:11 +08:00
|
|
|
help_load (const gchar *procedure,
|
2004-03-09 09:37:56 +08:00
|
|
|
const gchar *help_domain,
|
2004-03-18 08:11:03 +08:00
|
|
|
const gchar *help_locales,
|
2004-03-09 09:37:56 +08:00
|
|
|
const gchar *help_id)
|
|
|
|
{
|
2007-05-23 21:59:51 +08:00
|
|
|
IdleHelp *idle_help = g_slice_new (IdleHelp);
|
2004-03-09 09:37:56 +08:00
|
|
|
|
2004-03-18 08:11:03 +08:00
|
|
|
idle_help->procedure = g_strdup (procedure);
|
|
|
|
idle_help->help_domain = g_strdup (help_domain);
|
|
|
|
idle_help->help_locales = g_strdup (help_locales);
|
|
|
|
idle_help->help_id = g_strdup (help_id);
|
2004-03-09 09:37:56 +08:00
|
|
|
|
2019-07-31 03:04:11 +08:00
|
|
|
g_idle_add (help_load_idle, idle_help);
|
2004-03-09 09:37:56 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
2019-07-31 03:04:11 +08:00
|
|
|
help_load_idle (gpointer data)
|
2004-03-09 09:37:56 +08:00
|
|
|
{
|
2006-11-21 05:46:21 +08:00
|
|
|
IdleHelp *idle_help = data;
|
|
|
|
GimpHelpDomain *domain;
|
2004-03-09 09:37:56 +08:00
|
|
|
|
2006-11-21 05:46:21 +08:00
|
|
|
domain = gimp_help_lookup_domain (idle_help->help_domain);
|
2004-03-09 09:37:56 +08:00
|
|
|
|
|
|
|
if (domain)
|
|
|
|
{
|
2008-06-12 01:43:57 +08:00
|
|
|
GimpHelpProgress *progress = NULL;
|
2008-06-10 18:25:56 +08:00
|
|
|
GList *locales;
|
2008-06-12 01:43:57 +08:00
|
|
|
gchar *uri;
|
2008-06-10 18:25:56 +08:00
|
|
|
gboolean fatal_error;
|
2004-03-18 08:11:03 +08:00
|
|
|
|
2008-06-12 01:43:57 +08:00
|
|
|
locales = gimp_help_parse_locales (idle_help->help_locales);
|
|
|
|
|
|
|
|
if (! g_str_has_prefix (domain->help_uri, "file:"))
|
2019-07-31 03:04:11 +08:00
|
|
|
progress = help_load_progress_new ();
|
2008-06-12 01:43:57 +08:00
|
|
|
|
|
|
|
uri = gimp_help_domain_map (domain, locales, idle_help->help_id,
|
|
|
|
progress, NULL, &fatal_error);
|
|
|
|
|
|
|
|
if (progress)
|
|
|
|
gimp_help_progress_free (progress);
|
2004-03-18 08:11:03 +08:00
|
|
|
|
2011-03-08 00:10:18 +08:00
|
|
|
g_list_free_full (locales, (GDestroyNotify) g_free);
|
2004-03-09 09:37:56 +08:00
|
|
|
|
2008-06-12 01:43:57 +08:00
|
|
|
if (uri)
|
2004-03-09 09:37:56 +08:00
|
|
|
{
|
2019-07-31 03:16:07 +08:00
|
|
|
GimpValueArray *return_vals;
|
2004-03-09 09:37:56 +08:00
|
|
|
|
2004-03-18 08:11:03 +08:00
|
|
|
#ifdef GIMP_HELP_DEBUG
|
2004-03-09 09:37:56 +08:00
|
|
|
g_printerr ("help: calling '%s' for '%s'\n",
|
2008-06-12 01:43:57 +08:00
|
|
|
idle_help->procedure, uri);
|
2004-03-18 08:11:03 +08:00
|
|
|
#endif
|
2004-03-09 09:37:56 +08:00
|
|
|
|
2019-08-07 03:44:26 +08:00
|
|
|
return_vals = gimp_pdb_run_procedure (gimp_get_pdb (),
|
|
|
|
idle_help->procedure,
|
|
|
|
G_TYPE_STRING, uri,
|
|
|
|
G_TYPE_NONE);
|
2019-07-31 03:16:07 +08:00
|
|
|
gimp_value_array_unref (return_vals);
|
2004-03-09 09:37:56 +08:00
|
|
|
|
2008-06-12 01:43:57 +08:00
|
|
|
g_free (uri);
|
2004-03-09 09:37:56 +08:00
|
|
|
}
|
2006-11-21 05:46:21 +08:00
|
|
|
else if (fatal_error)
|
|
|
|
{
|
|
|
|
g_main_loop_quit (main_loop);
|
|
|
|
}
|
2004-03-09 09:37:56 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
g_free (idle_help->procedure);
|
|
|
|
g_free (idle_help->help_domain);
|
2004-03-18 08:11:03 +08:00
|
|
|
g_free (idle_help->help_locales);
|
2004-03-09 09:37:56 +08:00
|
|
|
g_free (idle_help->help_id);
|
2007-05-23 21:59:51 +08:00
|
|
|
|
|
|
|
g_slice_free (IdleHelp, idle_help);
|
2004-03-09 09:37:56 +08:00
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
2008-06-10 18:25:56 +08:00
|
|
|
|
|
|
|
static void
|
2019-07-31 03:04:11 +08:00
|
|
|
help_load_progress_start (const gchar *message,
|
2008-06-10 18:25:56 +08:00
|
|
|
gboolean cancelable,
|
|
|
|
gpointer user_data)
|
|
|
|
{
|
|
|
|
gimp_progress_init (message);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2019-07-31 03:04:11 +08:00
|
|
|
help_load_progress_update (gdouble value,
|
2008-06-10 18:25:56 +08:00
|
|
|
gpointer user_data)
|
|
|
|
{
|
|
|
|
gimp_progress_update (value);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2019-07-31 03:04:11 +08:00
|
|
|
help_load_progress_end (gpointer user_data)
|
2008-06-10 18:25:56 +08:00
|
|
|
{
|
|
|
|
gimp_progress_end ();
|
|
|
|
}
|
|
|
|
|
|
|
|
static GimpHelpProgress *
|
2019-07-31 03:04:11 +08:00
|
|
|
help_load_progress_new (void)
|
2008-06-10 18:25:56 +08:00
|
|
|
{
|
|
|
|
static const GimpHelpProgressVTable vtable =
|
|
|
|
{
|
2019-07-31 03:04:11 +08:00
|
|
|
help_load_progress_start,
|
|
|
|
help_load_progress_end,
|
|
|
|
help_load_progress_update
|
2008-06-10 18:25:56 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
return gimp_help_progress_new (&vtable, NULL);
|
|
|
|
}
|