added a GimpHelpFunc parameter to _gimp_help_init(). Implement
2003-05-25 Michael Natterer <mitch@gimp.org> * libgimpwidgets/gimphelpui.[ch]: added a GimpHelpFunc parameter to _gimp_help_init(). Implement gimp_standard_help_func() here and use the function pointer passed to _gimp_help_init(). * libgimpwidgets/gimpwidgets-private.[ch]: removed standard_help_func from GimpWidgetsVTable. Require it as paramater to gimp_widgets_init() and pass it to _gimp_help_init(). * libgimpwidgets/gimpunitmenu.c: use gimp_standard_help_func directly again. * app/libgimp_glue.[ch]: removed gimp_standard_help_func(). * libgimp/Makefile.am * libgimp/gimphelp.c: removed this file (containing gimp_standard_help_func()). * app/gui/gui.c: added private gimp_help_func() and pass it to gimp_widgets_init(). * libgimp/gimpui.c: added private gimp_ui_help_func() and pass it to gimp_widgets_init().
This commit is contained in:
committed by
Michael Natterer
parent
7860f1c776
commit
253ed7092b
@ -39,7 +39,6 @@
|
||||
|
||||
#include "gimpdialog.h"
|
||||
#include "gimphelpui.h"
|
||||
#include "gimpwidgets-private.h"
|
||||
|
||||
|
||||
typedef enum
|
||||
@ -67,8 +66,9 @@ static gboolean gimp_help_tips_query_idle_start (gpointer tips_query
|
||||
|
||||
/* local variables */
|
||||
|
||||
static GtkTooltips *tool_tips = NULL;
|
||||
static GtkWidget *tips_query = NULL;
|
||||
static GimpHelpFunc the_help_func = NULL;
|
||||
static GtkTooltips *tool_tips = NULL;
|
||||
static GtkWidget *tips_query = NULL;
|
||||
|
||||
|
||||
/* public functions */
|
||||
@ -84,8 +84,15 @@ static GtkWidget *tips_query = NULL;
|
||||
* Nota that this function is called automatically by gimp_widgets_init().
|
||||
**/
|
||||
void
|
||||
_gimp_help_init (void)
|
||||
_gimp_help_init (GimpHelpFunc standard_help_func)
|
||||
{
|
||||
g_return_if_fail (standard_help_func != NULL);
|
||||
|
||||
if (the_help_func)
|
||||
g_error ("_gimp_help_init() must only be called once!");
|
||||
|
||||
the_help_func = standard_help_func;
|
||||
|
||||
tool_tips = gtk_tooltips_new ();
|
||||
|
||||
/* take ownership of the tooltips */
|
||||
@ -115,6 +122,19 @@ gimp_help_disable_tooltips (void)
|
||||
gtk_tooltips_disable (tool_tips);
|
||||
}
|
||||
|
||||
void
|
||||
gimp_standard_help_func (const gchar *help_data)
|
||||
{
|
||||
if (! the_help_func)
|
||||
{
|
||||
g_warning ("gimp_standard_help_func(): you must call _gimp_help_init() "
|
||||
"before using the help system");
|
||||
return;
|
||||
}
|
||||
|
||||
(* the_help_func) (help_data);
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_help_connect:
|
||||
* @widget: The widget you want to connect the help accelerator for. Will
|
||||
@ -336,13 +356,13 @@ gimp_help_tips_query_idle_show_help (gpointer data)
|
||||
gchar *help_text;
|
||||
|
||||
help_text = g_strconcat (help_data, help_index, NULL);
|
||||
_gimp_eek.standard_help_func (help_text);
|
||||
gimp_standard_help_func (help_text);
|
||||
g_free (help_text);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_gimp_eek.standard_help_func (help_data);
|
||||
gimp_standard_help_func (help_data);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user