2000-02-26 11:41:06 +08:00
|
|
|
/* LIBGIMP - The GIMP Library
|
2000-01-05 23:47:06 +08:00
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
|
|
|
* gimphelpui.c
|
|
|
|
* Copyright (C) 2000 Michael Natterer <mitch@gimp.org>
|
|
|
|
*
|
|
|
|
* 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
|
2000-02-26 11:41:06 +08:00
|
|
|
* version 2 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
|
2000-01-05 23:47:06 +08:00
|
|
|
* Library 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, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
2000-05-31 07:38:46 +08:00
|
|
|
|
2000-12-29 23:22:01 +08:00
|
|
|
#include "config.h"
|
|
|
|
|
2000-01-05 23:47:06 +08:00
|
|
|
#include <gdk/gdkkeysyms.h>
|
2001-12-29 21:26:29 +08:00
|
|
|
|
2002-09-27 02:43:05 +08:00
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
2001-12-29 21:26:29 +08:00
|
|
|
#ifdef __GNUC__
|
|
|
|
#warning GTK_DISABLE_DEPRECATED
|
|
|
|
#endif
|
|
|
|
#undef GTK_DISABLE_DEPRECATED
|
|
|
|
|
2002-09-27 02:43:05 +08:00
|
|
|
#include <gtk/gtktipsquery.h>
|
2000-01-05 23:47:06 +08:00
|
|
|
|
2001-12-29 21:26:29 +08:00
|
|
|
#define GTK_DISABLE_DEPRECATED
|
|
|
|
|
2001-01-25 06:36:18 +08:00
|
|
|
#include "gimpwidgetstypes.h"
|
2000-12-29 23:22:01 +08:00
|
|
|
|
2000-01-11 23:48:00 +08:00
|
|
|
#include "gimpdialog.h"
|
2000-01-05 23:47:06 +08:00
|
|
|
#include "gimphelpui.h"
|
|
|
|
|
2000-01-07 06:26:10 +08:00
|
|
|
|
2001-08-01 07:28:56 +08:00
|
|
|
typedef enum
|
|
|
|
{
|
2002-09-27 02:43:05 +08:00
|
|
|
GIMP_WIDGET_HELP_TYPE_HELP = 0xff
|
2001-08-01 07:28:56 +08:00
|
|
|
} GimpWidgetHelpType;
|
|
|
|
|
|
|
|
|
2000-01-05 23:47:06 +08:00
|
|
|
/* local function prototypes */
|
2002-09-27 02:43:05 +08:00
|
|
|
|
|
|
|
static const gchar * gimp_help_get_help_data (GtkWidget *widget,
|
|
|
|
GtkWidget **help_widget);
|
|
|
|
static gboolean gimp_help_callback (GtkWidget *widget,
|
|
|
|
GtkWidgetHelpType help_type,
|
|
|
|
GimpHelpFunc help_func);
|
|
|
|
static gboolean gimp_help_tips_query_idle_show_help (gpointer data);
|
|
|
|
static gboolean gimp_help_tips_query_widget_selected (GtkWidget *tips_query,
|
|
|
|
GtkWidget *widget,
|
|
|
|
const gchar *tip_text,
|
|
|
|
const gchar *tip_private,
|
|
|
|
GdkEventButton *event,
|
|
|
|
gpointer func_data);
|
|
|
|
static gboolean gimp_help_tips_query_idle_start (gpointer tips_query);
|
2001-08-01 07:28:56 +08:00
|
|
|
|
2000-01-05 23:47:06 +08:00
|
|
|
|
|
|
|
/* local variables */
|
2002-09-27 02:43:05 +08:00
|
|
|
|
2001-08-01 07:28:56 +08:00
|
|
|
static GtkTooltips *tool_tips = NULL;
|
|
|
|
static GtkWidget *tips_query = NULL;
|
|
|
|
|
2000-01-05 23:47:06 +08:00
|
|
|
|
|
|
|
/* public functions */
|
|
|
|
|
2000-02-26 22:28:08 +08:00
|
|
|
/**
|
|
|
|
* gimp_help_init:
|
|
|
|
*
|
|
|
|
* This function initializes GIMP's help system.
|
|
|
|
*
|
|
|
|
* Currently it only creates a #GtkTooltips object with gtk_tooltips_new()
|
|
|
|
* which will be used by gimp_help_set_help_data().
|
2000-11-18 08:25:42 +08:00
|
|
|
**/
|
2000-01-05 23:47:06 +08:00
|
|
|
void
|
|
|
|
gimp_help_init (void)
|
|
|
|
{
|
|
|
|
tool_tips = gtk_tooltips_new ();
|
2001-11-22 03:42:51 +08:00
|
|
|
|
|
|
|
/* take ownership of the tooltips */
|
2003-01-06 06:07:10 +08:00
|
|
|
g_object_ref (tool_tips);
|
2001-11-22 03:42:51 +08:00
|
|
|
gtk_object_sink (GTK_OBJECT (tool_tips));
|
2000-01-05 23:47:06 +08:00
|
|
|
}
|
|
|
|
|
2000-02-26 22:28:08 +08:00
|
|
|
/**
|
|
|
|
* gimp_help_free:
|
|
|
|
*
|
2000-02-27 20:34:13 +08:00
|
|
|
* This function frees the memory used by the #GtkTooltips created by
|
2000-02-26 22:28:08 +08:00
|
|
|
* gimp_help_init().
|
2000-11-18 08:25:42 +08:00
|
|
|
**/
|
2000-01-05 23:47:06 +08:00
|
|
|
void
|
|
|
|
gimp_help_free (void)
|
|
|
|
{
|
2003-01-06 06:07:10 +08:00
|
|
|
g_object_unref (tool_tips);
|
2001-08-01 07:28:56 +08:00
|
|
|
tool_tips = NULL;
|
|
|
|
|
|
|
|
tips_query->parent = NULL;
|
|
|
|
gtk_widget_destroy (tips_query);
|
|
|
|
tips_query = NULL;
|
2000-01-05 23:47:06 +08:00
|
|
|
}
|
|
|
|
|
2000-02-26 22:28:08 +08:00
|
|
|
/**
|
|
|
|
* gimp_help_enable_tooltips:
|
|
|
|
*
|
|
|
|
* This function calls gtk_tooltips_enable().
|
2000-11-18 08:25:42 +08:00
|
|
|
**/
|
2000-01-05 23:47:06 +08:00
|
|
|
void
|
|
|
|
gimp_help_enable_tooltips (void)
|
|
|
|
{
|
|
|
|
gtk_tooltips_enable (tool_tips);
|
|
|
|
}
|
|
|
|
|
2000-02-26 22:28:08 +08:00
|
|
|
/**
|
|
|
|
* gimp_help_disable_tooltips:
|
|
|
|
*
|
|
|
|
* This function calls gtk_tooltips_disable().
|
2000-11-18 08:25:42 +08:00
|
|
|
**/
|
2000-01-05 23:47:06 +08:00
|
|
|
void
|
|
|
|
gimp_help_disable_tooltips (void)
|
|
|
|
{
|
|
|
|
gtk_tooltips_disable (tool_tips);
|
|
|
|
}
|
|
|
|
|
2000-02-26 22:28:08 +08:00
|
|
|
/**
|
2001-08-01 07:28:56 +08:00
|
|
|
* gimp_help_connect:
|
2000-02-26 22:28:08 +08:00
|
|
|
* @widget: The widget you want to connect the help accelerator for. Will
|
|
|
|
* be a #GtkWindow in most cases.
|
|
|
|
* @help_func: The function which will be called if the user presses "F1".
|
|
|
|
* @help_data: The data pointer which will be passed to @help_func.
|
|
|
|
*
|
2000-02-27 20:34:13 +08:00
|
|
|
* Note that this function is automatically called by all libgimp dialog
|
|
|
|
* constructors. You only have to call it for windows/dialogs you created
|
|
|
|
* "manually".
|
2000-11-18 08:25:42 +08:00
|
|
|
**/
|
2000-01-05 23:47:06 +08:00
|
|
|
void
|
2001-08-01 07:28:56 +08:00
|
|
|
gimp_help_connect (GtkWidget *widget,
|
|
|
|
GimpHelpFunc help_func,
|
|
|
|
const gchar *help_data)
|
2000-01-05 23:47:06 +08:00
|
|
|
{
|
2002-09-27 02:43:05 +08:00
|
|
|
g_return_if_fail (GTK_IS_WIDGET (widget));
|
|
|
|
g_return_if_fail (help_func != NULL);
|
2000-01-05 23:47:06 +08:00
|
|
|
|
2000-11-18 08:25:42 +08:00
|
|
|
/* set up the help signals and tips query widget
|
|
|
|
*/
|
2001-08-01 07:28:56 +08:00
|
|
|
if (! tips_query)
|
2000-01-05 23:47:06 +08:00
|
|
|
{
|
2001-08-01 07:28:56 +08:00
|
|
|
GtkBindingSet *binding_set;
|
|
|
|
|
2002-09-27 02:43:05 +08:00
|
|
|
binding_set =
|
|
|
|
gtk_binding_set_by_class (g_type_class_peek (GTK_TYPE_WIDGET));
|
2001-08-01 07:28:56 +08:00
|
|
|
|
|
|
|
gtk_binding_entry_add_signal (binding_set, GDK_F1, 0,
|
|
|
|
"show_help", 1,
|
|
|
|
GTK_TYPE_WIDGET_HELP_TYPE,
|
|
|
|
GIMP_WIDGET_HELP_TYPE_HELP);
|
|
|
|
gtk_binding_entry_add_signal (binding_set, GDK_KP_F1, 0,
|
|
|
|
"show_help", 1,
|
|
|
|
GTK_TYPE_WIDGET_HELP_TYPE,
|
|
|
|
GIMP_WIDGET_HELP_TYPE_HELP);
|
|
|
|
|
2000-01-05 23:47:06 +08:00
|
|
|
tips_query = gtk_tips_query_new ();
|
|
|
|
|
2003-01-06 06:07:10 +08:00
|
|
|
g_object_set (tips_query,
|
2001-12-29 21:26:29 +08:00
|
|
|
"emit_always", TRUE,
|
|
|
|
NULL);
|
2000-01-05 23:47:06 +08:00
|
|
|
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_connect (tips_query, "widget_selected",
|
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
2001-07-24 Michael Natterer <mitch@gimp.org>
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
* configure.in: require glib/gtk+ >= 1.3.7, commented out the
gtkxmhtml stuff.
From now on, you will need glib, pango, atk and gtk+ HEAD from CVS
to hack or use GIMP HEAD.
Beware, it crashes randomly :)
* app/core/Makefile.am
* app/core/gimpmarshal.list: new file plus rules to generate
gimpmarshal.[ch] from it.
* app/core/*
* app/tools/*
* app/widgets/*
* libgimpwidgets/*: started to use the glib object system. All
core/ objects are still gtk objects however. All signals are
created using g_signal_new(). There are many gtk+ artefacts left.
Finally, we will _not_ use the gtk_signal_foo() wrappers and
friends any more.
* app/colormaps.c
* app/devices.[ch]
* app/disp_callbacks.c
* app/errorconsole.c
* app/file-save.[ch]
* app/interface.c
* app/module_db.c
* app/nav_window.c
* app/ops_buttons.c
* app/scroll.c
* app/user_install.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brushes-commands.c
* app/gui/color-notebook.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/image-commands.c
* app/gui/info-dialog.[ch]
* app/gui/layer-select.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/offset-dialog.c
* app/gui/palette-editor.c
* app/gui/palettes-commands.c
* app/gui/patterns-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.[ch]
* app/gui/splash.c
* app/gui/tips-dialog.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* libgimpbase/gimpenv.c: tons and tons of changes like "const
gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete
and currently disables), lots of s/gtk_signal/g_signal/,
removal/replacement of deprecated stuff,
s/GtkSignalFunc/GCallback/ and lots of small changes and fixes
while I was on it, zillions of warnings left...
* modules/Makefile.am: disabled the water color selector
temporarily (XInput issues).
* plug-ins/Makefile.am
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl: simply excluded all plug-ins
which did not build (including Script-Fu). They are trivial to
fix.
2001-07-25 05:27:11 +08:00
|
|
|
G_CALLBACK (gimp_help_tips_query_widget_selected),
|
|
|
|
NULL);
|
2000-01-05 23:47:06 +08:00
|
|
|
|
|
|
|
/* FIXME: EEEEEEEEEEEEEEEEEEEEK, this is very ugly and forbidden...
|
|
|
|
* does anyone know a way to do this tips query stuff without
|
|
|
|
* having to attach to some parent widget???
|
|
|
|
*/
|
|
|
|
tips_query->parent = widget;
|
|
|
|
gtk_widget_realize (tips_query);
|
2000-01-07 06:26:10 +08:00
|
|
|
}
|
2000-01-05 23:47:06 +08:00
|
|
|
|
|
|
|
gimp_help_set_help_data (widget, NULL, help_data);
|
|
|
|
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_connect (widget, "show_help",
|
2001-07-31 19:33:13 +08:00
|
|
|
G_CALLBACK (gimp_help_callback),
|
2001-08-01 07:28:56 +08:00
|
|
|
help_func);
|
2000-01-05 23:47:06 +08:00
|
|
|
|
|
|
|
gtk_widget_add_events (widget, GDK_BUTTON_PRESS_MASK);
|
|
|
|
}
|
|
|
|
|
2000-02-26 22:28:08 +08:00
|
|
|
/**
|
|
|
|
* gimp_help_set_help_data:
|
|
|
|
* @widget: The #GtkWidget you want to set a @tooltip and/or @help_data for.
|
|
|
|
* @tooltip: The text for this widget's tooltip.
|
|
|
|
* @help_data: The @help_data for the #GtkTipsQuery tooltips inspector.
|
|
|
|
*
|
2000-02-27 20:34:13 +08:00
|
|
|
* The reason why we don't use gtk_tooltips_set_tip() is that it's
|
|
|
|
* impossible to set a @private_tip (aka @help_data) without a visible
|
|
|
|
* @tooltip.
|
|
|
|
*
|
|
|
|
* This function can be called with @tooltip == #NULL. Use this feature
|
|
|
|
* if you want to set a HTML help link for a widget which shouldn't have
|
|
|
|
* a visible tooltip.
|
|
|
|
*
|
|
|
|
* You can e.g. set a @help_data string to a complete HTML page for a
|
|
|
|
* container widget (e.g. a #GtkBox). For the widgets inside the box
|
|
|
|
* you can set HTML anchors which point inside the container widget's
|
|
|
|
* help page by setting @help_data strings starting with "#".
|
|
|
|
*
|
|
|
|
* If the tooltips inspector (Shift + "F1") is invoked and the user
|
|
|
|
* clicks on one of the widgets which only contain a "#" link, the
|
|
|
|
* help system will automatically ascend the widget hierarchy until it
|
|
|
|
* finds another widget with @help_data attached and concatenates both
|
|
|
|
* to a complete help path.
|
2000-11-18 08:25:42 +08:00
|
|
|
**/
|
2000-01-05 23:47:06 +08:00
|
|
|
void
|
2000-01-11 23:48:00 +08:00
|
|
|
gimp_help_set_help_data (GtkWidget *widget,
|
|
|
|
const gchar *tooltip,
|
2000-11-18 08:25:42 +08:00
|
|
|
const gchar *help_data)
|
2000-01-05 23:47:06 +08:00
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_WIDGET (widget));
|
|
|
|
|
|
|
|
if (tooltip)
|
2000-11-18 08:25:42 +08:00
|
|
|
{
|
2002-09-27 02:43:05 +08:00
|
|
|
gtk_tooltips_set_tip (tool_tips, widget, tooltip, help_data);
|
2000-11-18 08:25:42 +08:00
|
|
|
}
|
2000-01-05 23:47:06 +08:00
|
|
|
else if (help_data)
|
2000-11-18 08:25:42 +08:00
|
|
|
{
|
2001-07-31 19:33:13 +08:00
|
|
|
g_object_set_data (G_OBJECT (widget), "gimp_help_data",
|
|
|
|
(gpointer) help_data);
|
2000-11-18 08:25:42 +08:00
|
|
|
}
|
2000-01-05 23:47:06 +08:00
|
|
|
}
|
|
|
|
|
2000-02-26 22:28:08 +08:00
|
|
|
/**
|
|
|
|
* gimp_context_help:
|
|
|
|
*
|
|
|
|
* This function invokes the #GtkTipsQuery tooltips inspector.
|
2000-02-27 20:34:13 +08:00
|
|
|
*
|
|
|
|
* The mouse cursor will turn turn into a question mark and the user can
|
|
|
|
* click on any widget of the application which started the inspector.
|
|
|
|
*
|
|
|
|
* If the widget the user clicked on has a @help_data string attached
|
|
|
|
* (see gimp_help_set_help_data()), the corresponding HTML page will
|
|
|
|
* be displayed. Otherwise the help system will ascend the widget hierarchy
|
|
|
|
* until it finds an attached @help_data string (which should be the
|
|
|
|
* case at least for every window/dialog).
|
2000-11-18 08:25:42 +08:00
|
|
|
**/
|
2000-01-05 23:47:06 +08:00
|
|
|
void
|
|
|
|
gimp_context_help (void)
|
|
|
|
{
|
|
|
|
if (tips_query)
|
2002-09-27 02:43:05 +08:00
|
|
|
gimp_help_callback (NULL, GTK_WIDGET_HELP_WHATS_THIS, NULL);
|
2000-01-05 23:47:06 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-09-27 02:43:05 +08:00
|
|
|
/* private functions */
|
|
|
|
|
|
|
|
static const gchar *
|
|
|
|
gimp_help_get_help_data (GtkWidget *widget,
|
|
|
|
GtkWidget **help_widget)
|
|
|
|
{
|
|
|
|
GtkTooltipsData *tooltips_data;
|
|
|
|
gchar *help_data = NULL;
|
|
|
|
|
|
|
|
for (; widget; widget = widget->parent)
|
|
|
|
{
|
|
|
|
if ((tooltips_data = gtk_tooltips_data_get (widget)) &&
|
|
|
|
tooltips_data->tip_private)
|
|
|
|
{
|
|
|
|
help_data = tooltips_data->tip_private;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
help_data = g_object_get_data (G_OBJECT (widget), "gimp_help_data");
|
|
|
|
}
|
|
|
|
|
|
|
|
if (help_data)
|
|
|
|
{
|
|
|
|
if (help_widget)
|
|
|
|
*help_widget = widget;
|
|
|
|
|
|
|
|
return (const gchar *) help_data;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
2001-08-01 07:28:56 +08:00
|
|
|
gimp_help_callback (GtkWidget *widget,
|
|
|
|
GimpWidgetHelpType help_type,
|
2002-09-27 02:43:05 +08:00
|
|
|
GimpHelpFunc help_func)
|
2000-01-05 23:47:06 +08:00
|
|
|
{
|
2001-08-01 07:28:56 +08:00
|
|
|
switch (help_type)
|
|
|
|
{
|
|
|
|
case GIMP_WIDGET_HELP_TYPE_HELP:
|
2002-09-27 02:43:05 +08:00
|
|
|
if (help_func)
|
|
|
|
{
|
|
|
|
gchar *help_data;
|
2001-08-01 07:28:56 +08:00
|
|
|
|
2002-09-27 02:43:05 +08:00
|
|
|
help_data = g_object_get_data (G_OBJECT (widget), "gimp_help_data");
|
2001-08-01 07:28:56 +08:00
|
|
|
|
2002-09-27 02:43:05 +08:00
|
|
|
(* help_func) (help_data);
|
|
|
|
}
|
|
|
|
return TRUE;
|
2001-08-01 07:28:56 +08:00
|
|
|
|
2002-09-27 02:43:05 +08:00
|
|
|
case GTK_WIDGET_HELP_WHATS_THIS:
|
2001-08-01 07:28:56 +08:00
|
|
|
if (! GTK_TIPS_QUERY (tips_query)->in_query)
|
2002-09-27 02:43:05 +08:00
|
|
|
g_idle_add (gimp_help_tips_query_idle_start, tips_query);
|
|
|
|
return TRUE;
|
2001-08-01 07:28:56 +08:00
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2002-09-27 02:43:05 +08:00
|
|
|
|
|
|
|
return FALSE;
|
2000-01-05 23:47:06 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Do all the actual GtkTipsQuery calls in idle functions and check for
|
|
|
|
* some widget holding a grab before starting the query because strange
|
|
|
|
* things happen if (1) the help browser pops up while the query has
|
|
|
|
* grabbed the pointer or (2) the query grabs the pointer while some
|
|
|
|
* other part of the gimp has grabbed it (e.g. a tool, eek)
|
|
|
|
*/
|
|
|
|
|
2002-09-27 02:43:05 +08:00
|
|
|
static gboolean
|
2000-01-05 23:47:06 +08:00
|
|
|
gimp_help_tips_query_idle_show_help (gpointer data)
|
|
|
|
{
|
2002-09-27 02:43:05 +08:00
|
|
|
GtkWidget *help_widget;
|
|
|
|
const gchar *help_data = NULL;
|
2000-01-05 23:47:06 +08:00
|
|
|
|
2002-09-27 02:43:05 +08:00
|
|
|
help_data = gimp_help_get_help_data (GTK_WIDGET (data), &help_widget);
|
2000-01-05 23:47:06 +08:00
|
|
|
|
2002-09-27 02:43:05 +08:00
|
|
|
if (help_data)
|
2000-01-05 23:47:06 +08:00
|
|
|
{
|
2002-09-27 02:43:05 +08:00
|
|
|
if (help_data[0] == '#')
|
|
|
|
{
|
|
|
|
const gchar *help_index;
|
|
|
|
|
|
|
|
help_index = help_data;
|
|
|
|
help_data = gimp_help_get_help_data (help_widget->parent, NULL);
|
|
|
|
|
|
|
|
if (help_data)
|
|
|
|
{
|
|
|
|
gchar *help_text;
|
|
|
|
|
|
|
|
help_text = g_strconcat (help_data, help_index, NULL);
|
|
|
|
gimp_standard_help_func (help_text);
|
|
|
|
g_free (help_text);
|
|
|
|
}
|
|
|
|
}
|
2000-01-05 23:47:06 +08:00
|
|
|
else
|
2002-09-27 02:43:05 +08:00
|
|
|
{
|
|
|
|
gimp_standard_help_func (help_data);
|
|
|
|
}
|
2000-01-05 23:47:06 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2002-09-27 02:43:05 +08:00
|
|
|
static gboolean
|
2000-01-05 23:47:06 +08:00
|
|
|
gimp_help_tips_query_widget_selected (GtkWidget *tips_query,
|
|
|
|
GtkWidget *widget,
|
|
|
|
const gchar *tip_text,
|
|
|
|
const gchar *tip_private,
|
|
|
|
GdkEventButton *event,
|
|
|
|
gpointer func_data)
|
|
|
|
{
|
|
|
|
if (widget)
|
2002-09-27 02:43:05 +08:00
|
|
|
g_idle_add (gimp_help_tips_query_idle_show_help, widget);
|
2000-01-05 23:47:06 +08:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2002-09-27 02:43:05 +08:00
|
|
|
static gboolean
|
2000-01-05 23:47:06 +08:00
|
|
|
gimp_help_tips_query_idle_start (gpointer tips_query)
|
|
|
|
{
|
|
|
|
if (! gtk_grab_get_current ())
|
|
|
|
gtk_tips_query_start_query (GTK_TIPS_QUERY (tips_query));
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|