Commit bbc13c51 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer
Browse files

removed gimp_help_init() and gimp_help_free(). Added _gimp_help_init()

2003-01-07  Michael Natterer  <mitch@gimp.org>

	* libgimpwidgets/gimphelpui.[ch]: removed gimp_help_init() and
	gimp_help_free(). Added _gimp_help_init() instead.

	* libgimpwidgets/gimpwidgets.def: changed accordingly.

	* libgimpwidgets/gimpwidgets.c (gimp_widgets_init): call
	_gimp_help_init() so it doesn't need to be done in all plug-ins
	manually.

	* libgimp/gimpcompat.h: added gimp_help_init() and gimp_help_free()
	here as COMPAT_CRUFT.

	* app/gui/gui.c
	* plug-ins/FractalExplorer/Dialogs.c
	* plug-ins/Lighting/lighting_ui.c
	* plug-ins/MapObject/mapobject_ui.c
	* plug-ins/common/AlienMap.c
	* plug-ins/common/AlienMap2.c
	* plug-ins/common/CML_explorer.c
	* plug-ins/common/blur.c
	* plug-ins/common/curve_bend.c
	* plug-ins/common/gtm.c
	* plug-ins/common/illusion.c
	* plug-ins/common/jigsaw.c
	* plug-ins/common/plasma.c
	* plug-ins/common/polar.c
	* plug-ins/common/ps.c
	* plug-ins/common/randomize.c
	* plug-ins/common/sinus.c
	* plug-ins/common/snoise.c
	* plug-ins/common/sparkle.c
	* plug-ins/common/uniteditor.c
	* plug-ins/common/warp.c
	* plug-ins/common/wind.c
	* plug-ins/gap/gap_arr_dialog.c
	* plug-ins/gap/gap_mov_dialog.c
	* plug-ins/gap/gap_navigator_dialog.c
	* plug-ins/gdyntext/gdyntext_ui.c
	* plug-ins/gfig/gfig.c
	* plug-ins/gflare/gflare.c
	* plug-ins/gimpressionist/gimpressionist.c
	* plug-ins/maze/maze_face.c
	* plug-ins/print/gimp_main_window.c
	* plug-ins/sel2path/sel2path.c: removed the calls to
	gimp_help_init() and gimp_help_free().

	Fixed bug #81017:

	* libgimpbase/gimpprotocol.[ch]: added "guint8 show_tool_tips"
	to the GPConfig message. Increased the protocol version number.

	* app/plug-in/plug-in.c: pass the value of gui_config->show_tool_tips.

	* libgimp/gimp.[ch]: added gimp_show_tool_tips() to get the value
	which was passed in the GPConfig message.

	* libgimp/gimpui.c (gimp_ui_init): disable the tooltips
	if show_tool_tips is FALSE.

	* plug-ins/MapObject/mapobject_main.[ch]
	* plug-ins/MapObject/mapobject_ui.c
	* plug-ins/common/jigsaw.c
	* plug-ins/gap/gap_navigator_dialog.c
	* plug-ins/gfig/gfig.c: removed all plug-in specific GUI for
	enabling/disabling tooltips.
parent 3a36d127
2003-01-07 Michael Natterer <mitch@gimp.org>
* libgimpwidgets/gimphelpui.[ch]: removed gimp_help_init() and
gimp_help_free(). Added _gimp_help_init() instead.
* libgimpwidgets/gimpwidgets.def: changed accordingly.
* libgimpwidgets/gimpwidgets.c (gimp_widgets_init): call
_gimp_help_init() so it doesn't need to be done in all plug-ins
manually.
* libgimp/gimpcompat.h: added gimp_help_init() and gimp_help_free()
here as COMPAT_CRUFT.
* app/gui/gui.c
* plug-ins/FractalExplorer/Dialogs.c
* plug-ins/Lighting/lighting_ui.c
* plug-ins/MapObject/mapobject_ui.c
* plug-ins/common/AlienMap.c
* plug-ins/common/AlienMap2.c
* plug-ins/common/CML_explorer.c
* plug-ins/common/blur.c
* plug-ins/common/curve_bend.c
* plug-ins/common/gtm.c
* plug-ins/common/illusion.c
* plug-ins/common/jigsaw.c
* plug-ins/common/plasma.c
* plug-ins/common/polar.c
* plug-ins/common/ps.c
* plug-ins/common/randomize.c
* plug-ins/common/sinus.c
* plug-ins/common/snoise.c
* plug-ins/common/sparkle.c
* plug-ins/common/uniteditor.c
* plug-ins/common/warp.c
* plug-ins/common/wind.c
* plug-ins/gap/gap_arr_dialog.c
* plug-ins/gap/gap_mov_dialog.c
* plug-ins/gap/gap_navigator_dialog.c
* plug-ins/gdyntext/gdyntext_ui.c
* plug-ins/gfig/gfig.c
* plug-ins/gflare/gflare.c
* plug-ins/gimpressionist/gimpressionist.c
* plug-ins/maze/maze_face.c
* plug-ins/print/gimp_main_window.c
* plug-ins/sel2path/sel2path.c: removed the calls to
gimp_help_init() and gimp_help_free().
Fixed bug #81017:
* libgimpbase/gimpprotocol.[ch]: added "guint8 show_tool_tips"
to the GPConfig message. Increased the protocol version number.
* app/plug-in/plug-in.c: pass the value of gui_config->show_tool_tips.
* libgimp/gimp.[ch]: added gimp_show_tool_tips() to get the value
which was passed in the GPConfig message.
* libgimp/gimpui.c (gimp_ui_init): disable the tooltips
if show_tool_tips is FALSE.
* plug-ins/MapObject/mapobject_main.[ch]
* plug-ins/MapObject/mapobject_ui.c
* plug-ins/common/jigsaw.c
* plug-ins/gap/gap_navigator_dialog.c
* plug-ins/gfig/gfig.c: removed all plug-in specific GUI for
enabling/disabling tooltips.
2003-01-07 Sven Neumann <sven@gimp.org>
 
* plug_ins/common/Makefile.am
......
......@@ -198,9 +198,6 @@ gui_themes_init (Gimp *gimp)
g_free (gtkrc);
/* tooltips */
gimp_help_init ();
if (! config->show_tool_tips)
gimp_help_disable_tooltips ();
......@@ -559,8 +556,6 @@ gui_exit_finish_callback (Gimp *gimp,
dialogs_exit (gimp);
gimp_devices_exit (gimp);
gimp_help_free ();
g_signal_handlers_disconnect_by_func (gimp->config,
gui_show_tooltips_notify,
gimp);
......
......@@ -84,6 +84,7 @@
#include "config/gimpcoreconfig.h"
#include "config/gimpconfig-path.h"
#include "config/gimpguiconfig.h"
#include "core/gimp.h"
#include "core/gimpcontext.h"
......@@ -820,15 +821,15 @@ plug_in_run (Gimp *gimp,
plug_in_push (plug_in);
config.version = GP_VERSION;
config.tile_width = TILE_WIDTH;
config.tile_height = TILE_HEIGHT;
config.shm_ID = shm_ID;
config.gamma = gimp->config->gamma_val;
config.install_cmap = gimp->config->install_cmap;
config.unused = 0;
config.min_colors = CLAMP (gimp->config->min_colors, 27, 256);
config.gdisp_ID = gdisp_ID;
config.version = GP_VERSION;
config.tile_width = TILE_WIDTH;
config.tile_height = TILE_HEIGHT;
config.shm_ID = shm_ID;
config.gamma = gimp->config->gamma_val;
config.install_cmap = gimp->config->install_cmap;
config.show_tool_tips = GIMP_GUI_CONFIG (gimp->config)->show_tool_tips;
config.min_colors = CLAMP (gimp->config->min_colors, 27, 256);
config.gdisp_ID = gdisp_ID;
proc_run.name = proc_rec->name;
proc_run.nparams = argc;
......
......@@ -84,6 +84,7 @@
#include "config/gimpcoreconfig.h"
#include "config/gimpconfig-path.h"
#include "config/gimpguiconfig.h"
#include "core/gimp.h"
#include "core/gimpcontext.h"
......@@ -820,15 +821,15 @@ plug_in_run (Gimp *gimp,
plug_in_push (plug_in);
config.version = GP_VERSION;
config.tile_width = TILE_WIDTH;
config.tile_height = TILE_HEIGHT;
config.shm_ID = shm_ID;
config.gamma = gimp->config->gamma_val;
config.install_cmap = gimp->config->install_cmap;
config.unused = 0;
config.min_colors = CLAMP (gimp->config->min_colors, 27, 256);
config.gdisp_ID = gdisp_ID;
config.version = GP_VERSION;
config.tile_width = TILE_WIDTH;
config.tile_height = TILE_HEIGHT;
config.shm_ID = shm_ID;
config.gamma = gimp->config->gamma_val;
config.install_cmap = gimp->config->install_cmap;
config.show_tool_tips = GIMP_GUI_CONFIG (gimp->config)->show_tool_tips;
config.min_colors = CLAMP (gimp->config->min_colors, 27, 256);
config.gdisp_ID = gdisp_ID;
proc_run.name = proc_rec->name;
proc_run.nparams = argc;
......
......@@ -84,6 +84,7 @@
#include "config/gimpcoreconfig.h"
#include "config/gimpconfig-path.h"
#include "config/gimpguiconfig.h"
#include "core/gimp.h"
#include "core/gimpcontext.h"
......@@ -820,15 +821,15 @@ plug_in_run (Gimp *gimp,
plug_in_push (plug_in);
config.version = GP_VERSION;
config.tile_width = TILE_WIDTH;
config.tile_height = TILE_HEIGHT;
config.shm_ID = shm_ID;
config.gamma = gimp->config->gamma_val;
config.install_cmap = gimp->config->install_cmap;
config.unused = 0;
config.min_colors = CLAMP (gimp->config->min_colors, 27, 256);
config.gdisp_ID = gdisp_ID;
config.version = GP_VERSION;
config.tile_width = TILE_WIDTH;
config.tile_height = TILE_HEIGHT;
config.shm_ID = shm_ID;
config.gamma = gimp->config->gamma_val;
config.install_cmap = gimp->config->install_cmap;
config.show_tool_tips = GIMP_GUI_CONFIG (gimp->config)->show_tool_tips;
config.min_colors = CLAMP (gimp->config->min_colors, 27, 256);
config.gdisp_ID = gdisp_ID;
proc_run.name = proc_rec->name;
proc_run.nparams = argc;
......
......@@ -84,6 +84,7 @@
#include "config/gimpcoreconfig.h"
#include "config/gimpconfig-path.h"
#include "config/gimpguiconfig.h"
#include "core/gimp.h"
#include "core/gimpcontext.h"
......@@ -820,15 +821,15 @@ plug_in_run (Gimp *gimp,
plug_in_push (plug_in);
config.version = GP_VERSION;
config.tile_width = TILE_WIDTH;
config.tile_height = TILE_HEIGHT;
config.shm_ID = shm_ID;
config.gamma = gimp->config->gamma_val;
config.install_cmap = gimp->config->install_cmap;
config.unused = 0;
config.min_colors = CLAMP (gimp->config->min_colors, 27, 256);
config.gdisp_ID = gdisp_ID;
config.version = GP_VERSION;
config.tile_width = TILE_WIDTH;
config.tile_height = TILE_HEIGHT;
config.shm_ID = shm_ID;
config.gamma = gimp->config->gamma_val;
config.install_cmap = gimp->config->install_cmap;
config.show_tool_tips = GIMP_GUI_CONFIG (gimp->config)->show_tool_tips;
config.min_colors = CLAMP (gimp->config->min_colors, 27, 256);
config.gdisp_ID = gdisp_ID;
proc_run.name = proc_rec->name;
proc_run.nparams = argc;
......
......@@ -84,6 +84,7 @@
#include "config/gimpcoreconfig.h"
#include "config/gimpconfig-path.h"
#include "config/gimpguiconfig.h"
#include "core/gimp.h"
#include "core/gimpcontext.h"
......@@ -820,15 +821,15 @@ plug_in_run (Gimp *gimp,
plug_in_push (plug_in);
config.version = GP_VERSION;
config.tile_width = TILE_WIDTH;
config.tile_height = TILE_HEIGHT;
config.shm_ID = shm_ID;
config.gamma = gimp->config->gamma_val;
config.install_cmap = gimp->config->install_cmap;
config.unused = 0;
config.min_colors = CLAMP (gimp->config->min_colors, 27, 256);
config.gdisp_ID = gdisp_ID;
config.version = GP_VERSION;
config.tile_width = TILE_WIDTH;
config.tile_height = TILE_HEIGHT;
config.shm_ID = shm_ID;
config.gamma = gimp->config->gamma_val;
config.install_cmap = gimp->config->install_cmap;
config.show_tool_tips = GIMP_GUI_CONFIG (gimp->config)->show_tool_tips;
config.min_colors = CLAMP (gimp->config->min_colors, 27, 256);
config.gdisp_ID = gdisp_ID;
proc_run.name = proc_rec->name;
proc_run.nparams = argc;
......
......@@ -84,6 +84,7 @@
#include "config/gimpcoreconfig.h"
#include "config/gimpconfig-path.h"
#include "config/gimpguiconfig.h"
#include "core/gimp.h"
#include "core/gimpcontext.h"
......@@ -820,15 +821,15 @@ plug_in_run (Gimp *gimp,
plug_in_push (plug_in);
config.version = GP_VERSION;
config.tile_width = TILE_WIDTH;
config.tile_height = TILE_HEIGHT;
config.shm_ID = shm_ID;
config.gamma = gimp->config->gamma_val;
config.install_cmap = gimp->config->install_cmap;
config.unused = 0;
config.min_colors = CLAMP (gimp->config->min_colors, 27, 256);
config.gdisp_ID = gdisp_ID;
config.version = GP_VERSION;
config.tile_width = TILE_WIDTH;
config.tile_height = TILE_HEIGHT;
config.shm_ID = shm_ID;
config.gamma = gimp->config->gamma_val;
config.install_cmap = gimp->config->install_cmap;
config.show_tool_tips = GIMP_GUI_CONFIG (gimp->config)->show_tool_tips;
config.min_colors = CLAMP (gimp->config->min_colors, 27, 256);
config.gdisp_ID = gdisp_ID;
proc_run.name = proc_rec->name;
proc_run.nparams = argc;
......
......@@ -84,6 +84,7 @@
#include "config/gimpcoreconfig.h"
#include "config/gimpconfig-path.h"
#include "config/gimpguiconfig.h"
#include "core/gimp.h"
#include "core/gimpcontext.h"
......@@ -820,15 +821,15 @@ plug_in_run (Gimp *gimp,
plug_in_push (plug_in);
config.version = GP_VERSION;
config.tile_width = TILE_WIDTH;
config.tile_height = TILE_HEIGHT;
config.shm_ID = shm_ID;
config.gamma = gimp->config->gamma_val;
config.install_cmap = gimp->config->install_cmap;
config.unused = 0;
config.min_colors = CLAMP (gimp->config->min_colors, 27, 256);
config.gdisp_ID = gdisp_ID;
config.version = GP_VERSION;
config.tile_width = TILE_WIDTH;
config.tile_height = TILE_HEIGHT;
config.shm_ID = shm_ID;
config.gamma = gimp->config->gamma_val;
config.install_cmap = gimp->config->install_cmap;
config.show_tool_tips = GIMP_GUI_CONFIG (gimp->config)->show_tool_tips;
config.min_colors = CLAMP (gimp->config->min_colors, 27, 256);
config.gdisp_ID = gdisp_ID;
proc_run.name = proc_rec->name;
proc_run.nparams = argc;
......
......@@ -84,6 +84,7 @@
#include "config/gimpcoreconfig.h"
#include "config/gimpconfig-path.h"
#include "config/gimpguiconfig.h"
#include "core/gimp.h"
#include "core/gimpcontext.h"
......@@ -820,15 +821,15 @@ plug_in_run (Gimp *gimp,
plug_in_push (plug_in);
config.version = GP_VERSION;
config.tile_width = TILE_WIDTH;
config.tile_height = TILE_HEIGHT;
config.shm_ID = shm_ID;
config.gamma = gimp->config->gamma_val;
config.install_cmap = gimp->config->install_cmap;
config.unused = 0;
config.min_colors = CLAMP (gimp->config->min_colors, 27, 256);
config.gdisp_ID = gdisp_ID;
config.version = GP_VERSION;
config.tile_width = TILE_WIDTH;
config.tile_height = TILE_HEIGHT;
config.shm_ID = shm_ID;
config.gamma = gimp->config->gamma_val;
config.install_cmap = gimp->config->install_cmap;
config.show_tool_tips = GIMP_GUI_CONFIG (gimp->config)->show_tool_tips;
config.min_colors = CLAMP (gimp->config->min_colors, 27, 256);
config.gdisp_ID = gdisp_ID;
proc_run.name = proc_rec->name;
proc_run.nparams = argc;
......
......@@ -84,6 +84,7 @@
#include "config/gimpcoreconfig.h"
#include "config/gimpconfig-path.h"
#include "config/gimpguiconfig.h"
#include "core/gimp.h"
#include "core/gimpcontext.h"
......@@ -820,15 +821,15 @@ plug_in_run (Gimp *gimp,
plug_in_push (plug_in);
config.version = GP_VERSION;
config.tile_width = TILE_WIDTH;
config.tile_height = TILE_HEIGHT;
config.shm_ID = shm_ID;
config.gamma = gimp->config->gamma_val;
config.install_cmap = gimp->config->install_cmap;
config.unused = 0;
config.min_colors = CLAMP (gimp->config->min_colors, 27, 256);
config.gdisp_ID = gdisp_ID;
config.version = GP_VERSION;
config.tile_width = TILE_WIDTH;
config.tile_height = TILE_HEIGHT;
config.shm_ID = shm_ID;
config.gamma = gimp->config->gamma_val;
config.install_cmap = gimp->config->install_cmap;
config.show_tool_tips = GIMP_GUI_CONFIG (gimp->config)->show_tool_tips;
config.min_colors = CLAMP (gimp->config->min_colors, 27, 256);
config.gdisp_ID = gdisp_ID;
proc_run.name = proc_rec->name;
proc_run.nparams = argc;
......
......@@ -139,6 +139,7 @@ static HANDLE shm_handle;
static gdouble _gamma_val;
static gboolean _install_cmap;
static gboolean _show_tool_tips;
static gint _min_colors;
static gint _gdisp_ID = -1;
......@@ -755,6 +756,12 @@ gimp_min_colors (void)
return _min_colors;
}
gboolean
gimp_show_tool_tips (void)
{
return _show_tool_tips;
}
static void
gimp_process_message (WireMessage *msg)
{
......@@ -1126,6 +1133,7 @@ gimp_config (GPConfig *config)
_shm_ID = config->shm_ID;
_gamma_val = config->gamma;
_install_cmap = config->install_cmap;
_show_tool_tips = config->show_tool_tips;
_min_colors = config->min_colors;
_gdisp_ID = config->gdisp_ID;
......
......@@ -305,6 +305,7 @@ void gimp_destroy_paramdefs (GimpParamDef *paramdefs,
gdouble gimp_gamma (void);
gboolean gimp_install_cmap (void);
gint gimp_min_colors (void);
gboolean gimp_show_tool_tips (void);
gchar * gimp_get_progname (void);
......
......@@ -43,6 +43,9 @@ G_BEGIN_DECLS
#define gimp_gradients_get_active gimp_gradients_get_gradient
#define gimp_gradients_set_active gimp_gradients_set_gradient
#define gimp_help_init() ((void) 0)
#define gimp_help_free() ((void) 0)
enum
{
......
......@@ -80,5 +80,8 @@ gimp_ui_init (const gchar *prog_name,
gimp_widgets_init ();
if (! gimp_show_tool_tips ())
gimp_help_disable_tooltips ();
initialized = TRUE;
}
......@@ -465,7 +465,7 @@ _gp_config_read (GIOChannel *channel,
goto cleanup;
if (! wire_read_int8 (channel, (guint8*) &config->install_cmap, 1, user_data))
goto cleanup;
if (! wire_read_int8 (channel, (guint8*) &config->unused, 1, user_data))
if (! wire_read_int8 (channel, (guint8*) &config->show_tool_tips, 1, user_data))
goto cleanup;
if (! wire_read_int32 (channel, (guint32*) &config->min_colors, 1, user_data))
goto cleanup;
......@@ -499,7 +499,7 @@ _gp_config_write (GIOChannel *channel,
return;
if (! wire_write_int8 (channel, (guint8*) &config->install_cmap, 1, user_data))
return;
if (! wire_write_int8 (channel, (guint8*) &config->unused, 1, user_data))
if (! wire_write_int8 (channel, (guint8*) &config->show_tool_tips, 1, user_data))
return;
if (! wire_write_int32 (channel, (guint32*) &config->min_colors, 1, user_data))
return;
......
......@@ -27,7 +27,7 @@ G_BEGIN_DECLS
/* Increment every time the protocol changes
*/
#define GP_VERSION 0x000C
#define GP_VERSION 0x000D
enum
......@@ -68,7 +68,7 @@ struct _GPConfig
gint32 shm_ID;
gdouble gamma;
gint8 install_cmap;
gint8 unused; /* used to be use_xshm */
gint8 show_tool_tips;
gint32 min_colors;
gint32 gdisp_ID;
};
......
......@@ -73,15 +73,17 @@ static GtkWidget *tips_query = NULL;
/* public functions */
/**
* gimp_help_init:
* _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().
*
* Nota that this function is called automatically by gimp_widgets_init().
**/
void
gimp_help_init (void)
_gimp_help_init (void)
{
tool_tips = gtk_tooltips_new ();
......@@ -90,23 +92,6 @@ gimp_help_init (void)
gtk_object_sink (GTK_OBJECT (tool_tips));
}
/**
* gimp_help_free:
*
* This function frees the memory used by the #GtkTooltips created by
* gimp_help_init().
**/
void
gimp_help_free (void)
{
g_object_unref (tool_tips);
tool_tips = NULL;
tips_query->parent = NULL;
gtk_widget_destroy (tips_query);
tips_query = NULL;
}
/**
* gimp_help_enable_tooltips:
*
......
......@@ -28,8 +28,7 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
void gimp_help_init (void);
void gimp_help_free (void);
void _gimp_help_init (void);
void gimp_help_enable_tooltips (void);
void gimp_help_disable_tooltips (void);
......
......@@ -71,6 +71,8 @@ gimp_widgets_init (void)
g_list_foreach (icon_list, (GFunc) g_object_unref, NULL);
g_list_free (icon_list);
_gimp_help_init ();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment