changed GimpHelpFunc typedef: - renamed "const gchar *help_data" to "const

2003-08-23  Michael Natterer  <mitch@gimp.org>

	* libgimpwidgets/gimpwidgetstypes.h: changed GimpHelpFunc typedef:
	- renamed "const gchar *help_data" to "const gchar *help_id".
	- added "gpointer help_data".

	* libgimpwidgets/gimphelpui.[ch]: added "gpointer help_data" to
	gimp_help_connect(). Removed all fiddling with html links and
	treat all help IDs as opaque identifiers.

	* app/core/gimptoolinfo.[ch]: changed "help_data" member to
	"help_id".

	* app/widgets/gimpitemfactory.[ch]: removed the "help_path"
	parameter from gimp_item_factory_new() since we don't fiddle with
	html file paths any more. Simplifies menu item help a lot.
	Renamed "help_data" member of struct GimpItemFactoryEntry to
	"help_id".

	* app/gui/plug-in-menus.c: changed accordingly. 3rd party
	plug-ins' menu item help IDs are now encoded as
	"help_path:help_id".

	* app/gui/file-open-menu.c
	* app/gui/file-save-menu.c: when constructing the <Load> and
	<Save> menus, take the resp. procedures' locale_domain and
	help_path into account. Fixes translation of 3rd party menu items.
	Also do the right thing for load/save procs which are implemented
	as temporary procedures (they are impossible to implement
	currently but it's nice to do the right thing anyway...).

	* app/widgets/gimphelp-ids.h: added GIMP_HELP_MAIN identifier.

	* libgimpwidgets/gimpdialog.[ch]
	* libgimpwidgets/gimpwidgets.[ch]
	* libgimp/gimpui.c
	* app/display/gimpdisplayshell.c
	* app/gui/gui.c
	* app/gui/about-dialog.c
	* app/gui/color-notebook.c
	* app/gui/dialogs-constructors.c
	* app/gui/file-dialog-utils.[ch]
	* app/gui/gradients-commands.c
	* app/gui/help-commands.c
	* app/gui/image-menu.c
	* app/gui/menus.c
	* app/gui/preferences-dialog.c
	* app/gui/tips-dialog.c
	* app/tools/gimpcolorpickertool.c
	* app/tools/gimpcroptool.c
	* app/tools/gimpcurvestool.c
	* app/tools/gimphistogramtool.c
	* app/tools/gimpimagemaptool.c
	* app/tools/gimplevelstool.c
	* app/tools/gimpmeasuretool.c
	* app/tools/gimptransformtool.c
	* app/widgets/gimperrorconsole.c
	* app/widgets/gimphelp.[ch]
	* app/widgets/gimpmenufactory.[ch]
	* app/widgets/gimptexteditor.c
	* app/widgets/gimptoolbox.c
	* app/widgets/gimpviewabledialog.[ch]
	* plug-ins/common/CEL.c
	* plug-ins/common/CML_explorer.c
	* plug-ins/common/gee.c
	* plug-ins/common/gee_zoom.c
	* plug-ins/common/gqbist.c
	* plug-ins/common/spheredesigner.c
	* plug-ins/flame/flame.c
	* plug-ins/fp/fp_gtk.c
	* plug-ins/helpbrowser/helpbrowser.c
	* plug-ins/ifscompose/ifscompose.c
	* plug-ins/imagemap/imap_main.c: changed accordingly. Removed
	trailing whitespace all over the place.
This commit is contained in:
Michael Natterer 2003-08-23 19:35:05 +00:00 committed by Michael Natterer
parent 9a52f49904
commit ba70ce9a10
72 changed files with 898 additions and 839 deletions

View File

@ -1,3 +1,78 @@
2003-08-23 Michael Natterer <mitch@gimp.org>
* libgimpwidgets/gimpwidgetstypes.h: changed GimpHelpFunc typedef:
- renamed "const gchar *help_data" to "const gchar *help_id".
- added "gpointer help_data".
* libgimpwidgets/gimphelpui.[ch]: added "gpointer help_data" to
gimp_help_connect(). Removed all fiddling with html links and
treat all help IDs as opaque identifiers.
* app/core/gimptoolinfo.[ch]: changed "help_data" member to
"help_id".
* app/widgets/gimpitemfactory.[ch]: removed the "help_path"
parameter from gimp_item_factory_new() since we don't fiddle with
html file paths any more. Simplifies menu item help a lot.
Renamed "help_data" member of struct GimpItemFactoryEntry to
"help_id".
* app/gui/plug-in-menus.c: changed accordingly. 3rd party
plug-ins' menu item help IDs are now encoded as
"help_path:help_id".
* app/gui/file-open-menu.c
* app/gui/file-save-menu.c: when constructing the <Load> and
<Save> menus, take the resp. procedures' locale_domain and
help_path into account. Fixes translation of 3rd party menu items.
Also do the right thing for load/save procs which are implemented
as temporary procedures (they are impossible to implement
currently but it's nice to do the right thing anyway...).
* app/widgets/gimphelp-ids.h: added GIMP_HELP_MAIN identifier.
* libgimpwidgets/gimpdialog.[ch]
* libgimpwidgets/gimpwidgets.[ch]
* libgimp/gimpui.c
* app/display/gimpdisplayshell.c
* app/gui/gui.c
* app/gui/about-dialog.c
* app/gui/color-notebook.c
* app/gui/dialogs-constructors.c
* app/gui/file-dialog-utils.[ch]
* app/gui/gradients-commands.c
* app/gui/help-commands.c
* app/gui/image-menu.c
* app/gui/menus.c
* app/gui/preferences-dialog.c
* app/gui/tips-dialog.c
* app/tools/gimpcolorpickertool.c
* app/tools/gimpcroptool.c
* app/tools/gimpcurvestool.c
* app/tools/gimphistogramtool.c
* app/tools/gimpimagemaptool.c
* app/tools/gimplevelstool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimptransformtool.c
* app/widgets/gimperrorconsole.c
* app/widgets/gimphelp.[ch]
* app/widgets/gimpmenufactory.[ch]
* app/widgets/gimptexteditor.c
* app/widgets/gimptoolbox.c
* app/widgets/gimpviewabledialog.[ch]
* plug-ins/common/CEL.c
* plug-ins/common/CML_explorer.c
* plug-ins/common/gee.c
* plug-ins/common/gee_zoom.c
* plug-ins/common/gqbist.c
* plug-ins/common/spheredesigner.c
* plug-ins/flame/flame.c
* plug-ins/fp/fp_gtk.c
* plug-ins/helpbrowser/helpbrowser.c
* plug-ins/ifscompose/ifscompose.c
* plug-ins/imagemap/imap_main.c: changed accordingly. Removed
trailing whitespace all over the place.
2003-06-22 Manish Singh <yosh@gimp.org>
* configure.in: disallow libgimpprint >= 4.3.0, addresses bug #120162.

View File

@ -104,7 +104,7 @@ gradients_save_as_pov_query (GimpContainerEditor *editor)
G_CONNECT_SWAPPED);
gimp_help_connect (GTK_WIDGET (filesel), gimp_standard_help_func,
GIMP_HELP_GRADIENT_SAVE_AS_POV);
GIMP_HELP_GRADIENT_SAVE_AS_POV, NULL);
gtk_widget_show (GTK_WIDGET (filesel));
}

View File

@ -24,10 +24,6 @@
#include "gui-types.h"
#include "core/gimpobject.h"
#include "plug-in/plug-in.h"
#include "help-commands.h"
@ -36,7 +32,7 @@ help_help_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
gimp_standard_help_func (NULL);
gimp_standard_help_func (NULL, NULL);
}
void

View File

@ -104,7 +104,7 @@ gimp_tool_info_init (GimpToolInfo *tool_info)
tool_info->menu_accel = NULL;
tool_info->help_domain = NULL;
tool_info->help_data = NULL;
tool_info->help_id = NULL;
tool_info->in_toolbox = TRUE;
tool_info->tool_options = NULL;
@ -145,10 +145,10 @@ gimp_tool_info_finalize (GObject *object)
g_free (tool_info->help_domain);
tool_info->help_domain = NULL;
}
if (tool_info->help_data)
if (tool_info->help_id)
{
g_free (tool_info->help_data);
tool_info->help_data = NULL;
g_free (tool_info->help_id);
tool_info->help_id = NULL;
}
if (tool_info->tool_options)
@ -185,7 +185,7 @@ gimp_tool_info_new (Gimp *gimp,
const gchar *menu_path,
const gchar *menu_accel,
const gchar *help_domain,
const gchar *help_data,
const gchar *help_id,
const gchar *paint_core_name,
const gchar *stock_id)
{
@ -227,7 +227,7 @@ gimp_tool_info_new (Gimp *gimp,
tool_info->menu_accel = g_strdup (menu_accel);
tool_info->help_domain = g_strdup (help_domain);
tool_info->help_data = g_strdup (help_data);
tool_info->help_id = g_strdup (help_id);
gimp_viewable_set_stock_id (viewable, stock_id);

View File

@ -50,7 +50,7 @@ struct _GimpToolInfo
gchar *menu_accel;
gchar *help_domain;
gchar *help_data;
gchar *help_id;
gboolean in_toolbox;
GimpToolOptions *tool_options;
@ -75,7 +75,7 @@ GimpToolInfo * gimp_tool_info_new (Gimp *gimp,
const gchar *menu_path,
const gchar *menu_accel,
const gchar *help_domain,
const gchar *help_data,
const gchar *help_id,
const gchar *paint_core_name,
const gchar *stock_id);

View File

@ -242,7 +242,7 @@ about_dialog_create (void)
gtk_window_set_resizable (GTK_WINDOW (about_dialog), FALSE);
gimp_help_connect (about_dialog, gimp_standard_help_func,
GIMP_HELP_ABOUT_DIALOG);
GIMP_HELP_ABOUT_DIALOG, NULL);
g_signal_connect (about_dialog, "destroy",
G_CALLBACK (about_dialog_destroy),

View File

@ -95,7 +95,8 @@ static ColorNotebook *
gboolean wants_updates,
gboolean show_alpha);
static void color_notebook_help_func (const gchar *help_data);
static void color_notebook_help_func (const gchar *help_id,
gpointer help_data);
static void color_notebook_ok_callback (GtkWidget *widget,
ColorNotebook *cnp);
@ -322,22 +323,22 @@ color_notebook_new_internal (GimpViewable *viewable,
cnp->shell = gimp_viewable_dialog_new (viewable,
title, wmclass_name,
stock_id, desc,
color_notebook_help_func,
(const gchar *) cnp,
color_notebook_help_func, NULL,
NULL);
gtk_window_set_resizable (GTK_WINDOW (cnp->shell), FALSE);
}
else
{
cnp->shell = gimp_dialog_new (title, wmclass_name,
color_notebook_help_func,
(const gchar *) cnp,
GTK_WIN_POS_NONE,
FALSE, TRUE, TRUE,
NULL);
cnp->shell = gimp_dialog_new (title, wmclass_name,
color_notebook_help_func, NULL,
GTK_WIN_POS_NONE,
FALSE, TRUE, TRUE,
NULL);
}
g_object_set_data (G_OBJECT (cnp->shell), "color-notebook", cnp);
gimp_dialog_create_action_area (GIMP_DIALOG (cnp->shell),
GTK_STOCK_CANCEL,
@ -535,21 +536,19 @@ color_notebook_new_internal (GimpViewable *viewable,
}
static void
color_notebook_help_func (const gchar *data)
color_notebook_help_func (const gchar *help_id,
gpointer help_data)
{
ColorNotebook *cnp;
GimpColorNotebook *notebook;
gchar *help_path;
cnp = (ColorNotebook *) data;
cnp = g_object_get_data (G_OBJECT (help_data), "color-notebook");
notebook = GIMP_COLOR_NOTEBOOK (cnp->notebook);
help_path = g_strconcat ("dialogs/color_selectors/",
GIMP_COLOR_SELECTOR_GET_CLASS (notebook->cur_page)->help_page,
NULL);
gimp_standard_help_func (help_path);
g_free (help_path);
help_id = GIMP_COLOR_SELECTOR_GET_CLASS (notebook->cur_page)->help_page;
gimp_standard_help_func (help_id, NULL);
}
static void

View File

@ -1110,8 +1110,7 @@ dialogs_tool_options_tool_changed (GimpContext *context,
gtk_label_set_text (label, tool_info->blurb);
gimp_help_set_help_data (GTK_WIDGET (label)->parent->parent,
tool_info->help,
tool_info->help_data);
tool_info->help, tool_info->help_id);
}
static GtkWidget *

View File

@ -48,7 +48,7 @@ file_dialog_new (Gimp *gimp,
const gchar *menu_identifier,
const gchar *title,
const gchar *wmclass_name,
const gchar *help_data,
const gchar *help_id,
GCallback ok_callback)
{
GtkWidget *filesel;
@ -61,7 +61,7 @@ file_dialog_new (Gimp *gimp,
g_return_val_if_fail (menu_identifier != NULL, NULL);
g_return_val_if_fail (title != NULL, NULL);
g_return_val_if_fail (wmclass_name != NULL, NULL);
g_return_val_if_fail (help_data != NULL, NULL);
g_return_val_if_fail (help_id != NULL, NULL);
g_return_val_if_fail (ok_callback != NULL, NULL);
filesel = gtk_file_selection_new (title);
@ -73,7 +73,7 @@ file_dialog_new (Gimp *gimp,
gtk_window_set_position (GTK_WINDOW (filesel), GTK_WIN_POS_MOUSE);
gtk_window_set_wmclass (GTK_WINDOW (filesel), wmclass_name, "Gimp");
gimp_help_connect (filesel, gimp_standard_help_func, help_data);
gimp_help_connect (filesel, gimp_standard_help_func, help_id, NULL);
gtk_container_set_border_width (GTK_CONTAINER (fs->button_area), 2);
gtk_container_set_border_width (GTK_CONTAINER (filesel), 2);

View File

@ -27,7 +27,7 @@ GtkWidget * file_dialog_new (Gimp *gimp,
const gchar *menu_identifier,
const gchar *title,
const gchar *wmclass_name,
const gchar *help_data,
const gchar *help_id,
GCallback ok_callback);
void file_dialog_show (GtkWidget *filesel);

View File

@ -464,7 +464,7 @@ prefs_notebook_append_page (Gimp *gimp,
const gchar *notebook_icon,
GtkTreeStore *tree,
const gchar *tree_label,
const gchar *help_data,
const gchar *help_id,
GtkTreeIter *parent,
GtkTreeIter *iter,
gint page_index)
@ -478,7 +478,7 @@ prefs_notebook_append_page (Gimp *gimp,
gtk_notebook_append_page (notebook, event_box, NULL);
gtk_widget_show (event_box);
gimp_help_set_help_data (event_box, NULL, help_data);
gimp_help_set_help_data (event_box, NULL, help_id);
vbox = gtk_vbox_new (FALSE, 6);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 6);
@ -824,21 +824,19 @@ prefs_memsize_entry_add (GObject *config,
}
static void
prefs_help_func (const gchar *help_data)
prefs_help_func (const gchar *help_id,
gpointer help_data)
{
if (prefs_dialog)
{
GtkWidget *notebook;
GtkWidget *event_box;
gint page_num;
GtkWidget *notebook;
GtkWidget *event_box;
gint page_num;
notebook = g_object_get_data (G_OBJECT (prefs_dialog), "notebook");
page_num = gtk_notebook_get_current_page (GTK_NOTEBOOK (notebook));
event_box = gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook), page_num);
notebook = g_object_get_data (G_OBJECT (help_data), "notebook");
page_num = gtk_notebook_get_current_page (GTK_NOTEBOOK (notebook));
event_box = gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook), page_num);
help_data = g_object_get_data (G_OBJECT (event_box), "gimp_help_data");
gimp_standard_help_func (help_data);
}
help_id = g_object_get_data (G_OBJECT (event_box), "gimp-help-id");
gimp_standard_help_func (help_id, NULL);
}
static GtkWidget *

View File

@ -217,9 +217,8 @@ tips_dialog_create (Gimp *gimp)
G_CALLBACK (tips_show_next),
NULL);
/* Connect the "F1" help key */
gimp_help_connect (tips_dialog, gimp_standard_help_func,
GIMP_HELP_TIPS_DIALOG);
GIMP_HELP_TIPS_DIALOG, NULL);
tips_set_labels (current_tip->data);

View File

@ -242,7 +242,7 @@ about_dialog_create (void)
gtk_window_set_resizable (GTK_WINDOW (about_dialog), FALSE);
gimp_help_connect (about_dialog, gimp_standard_help_func,
GIMP_HELP_ABOUT_DIALOG);
GIMP_HELP_ABOUT_DIALOG, NULL);
g_signal_connect (about_dialog, "destroy",
G_CALLBACK (about_dialog_destroy),

View File

@ -95,7 +95,8 @@ static ColorNotebook *
gboolean wants_updates,
gboolean show_alpha);
static void color_notebook_help_func (const gchar *help_data);
static void color_notebook_help_func (const gchar *help_id,
gpointer help_data);
static void color_notebook_ok_callback (GtkWidget *widget,
ColorNotebook *cnp);
@ -322,22 +323,22 @@ color_notebook_new_internal (GimpViewable *viewable,
cnp->shell = gimp_viewable_dialog_new (viewable,
title, wmclass_name,
stock_id, desc,
color_notebook_help_func,
(const gchar *) cnp,
color_notebook_help_func, NULL,
NULL);
gtk_window_set_resizable (GTK_WINDOW (cnp->shell), FALSE);
}
else
{
cnp->shell = gimp_dialog_new (title, wmclass_name,
color_notebook_help_func,
(const gchar *) cnp,
GTK_WIN_POS_NONE,
FALSE, TRUE, TRUE,
NULL);
cnp->shell = gimp_dialog_new (title, wmclass_name,
color_notebook_help_func, NULL,
GTK_WIN_POS_NONE,
FALSE, TRUE, TRUE,
NULL);
}
g_object_set_data (G_OBJECT (cnp->shell), "color-notebook", cnp);
gimp_dialog_create_action_area (GIMP_DIALOG (cnp->shell),
GTK_STOCK_CANCEL,
@ -535,21 +536,19 @@ color_notebook_new_internal (GimpViewable *viewable,
}
static void
color_notebook_help_func (const gchar *data)
color_notebook_help_func (const gchar *help_id,
gpointer help_data)
{
ColorNotebook *cnp;
GimpColorNotebook *notebook;
gchar *help_path;
cnp = (ColorNotebook *) data;
cnp = g_object_get_data (G_OBJECT (help_data), "color-notebook");
notebook = GIMP_COLOR_NOTEBOOK (cnp->notebook);
help_path = g_strconcat ("dialogs/color_selectors/",
GIMP_COLOR_SELECTOR_GET_CLASS (notebook->cur_page)->help_page,
NULL);
gimp_standard_help_func (help_path);
g_free (help_path);
help_id = GIMP_COLOR_SELECTOR_GET_CLASS (notebook->cur_page)->help_page;
gimp_standard_help_func (help_id, NULL);
}
static void

View File

@ -1110,8 +1110,7 @@ dialogs_tool_options_tool_changed (GimpContext *context,
gtk_label_set_text (label, tool_info->blurb);
gimp_help_set_help_data (GTK_WIDGET (label)->parent->parent,
tool_info->help,
tool_info->help_data);
tool_info->help, tool_info->help_id);
}
static GtkWidget *

View File

@ -48,7 +48,7 @@ file_dialog_new (Gimp *gimp,
const gchar *menu_identifier,
const gchar *title,
const gchar *wmclass_name,
const gchar *help_data,
const gchar *help_id,
GCallback ok_callback)
{
GtkWidget *filesel;
@ -61,7 +61,7 @@ file_dialog_new (Gimp *gimp,
g_return_val_if_fail (menu_identifier != NULL, NULL);
g_return_val_if_fail (title != NULL, NULL);
g_return_val_if_fail (wmclass_name != NULL, NULL);
g_return_val_if_fail (help_data != NULL, NULL);
g_return_val_if_fail (help_id != NULL, NULL);
g_return_val_if_fail (ok_callback != NULL, NULL);
filesel = gtk_file_selection_new (title);
@ -73,7 +73,7 @@ file_dialog_new (Gimp *gimp,
gtk_window_set_position (GTK_WINDOW (filesel), GTK_WIN_POS_MOUSE);
gtk_window_set_wmclass (GTK_WINDOW (filesel), wmclass_name, "Gimp");
gimp_help_connect (filesel, gimp_standard_help_func, help_data);
gimp_help_connect (filesel, gimp_standard_help_func, help_id, NULL);
gtk_container_set_border_width (GTK_CONTAINER (fs->button_area), 2);
gtk_container_set_border_width (GTK_CONTAINER (filesel), 2);

View File

@ -27,7 +27,7 @@ GtkWidget * file_dialog_new (Gimp *gimp,
const gchar *menu_identifier,
const gchar *title,
const gchar *wmclass_name,
const gchar *help_data,
const gchar *help_id,
GCallback ok_callback);
void file_dialog_show (GtkWidget *filesel);

View File

@ -29,6 +29,7 @@
#include "core/gimp.h"
#include "plug-in/plug-in-proc.h"
#include "plug-in/plug-ins.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpitemfactory.h"
@ -56,31 +57,48 @@ gint n_file_open_menu_entries = G_N_ELEMENTS (file_open_menu_entries);
void
file_open_menu_setup (GimpItemFactory *factory)
{
GimpItemFactoryEntry entry;
PlugInProcDef *file_proc;
GSList *list;
GSList *list;
for (list = factory->gimp->load_procs; list; list = g_slist_next (list))
{
gchar *basename;
gchar *lowercase_basename;
gchar *help_page;
PlugInProcDef *file_proc;
const gchar *progname;
const gchar *locale_domain;
const gchar *help_path;
GimpItemFactoryEntry entry;
gchar *help_id;
gchar *help_page;
file_proc = (PlugInProcDef *) list->data;
basename = g_path_get_basename (file_proc->prog);
progname = plug_in_proc_def_get_progname (file_proc);
lowercase_basename = g_ascii_strdown (basename, -1);
locale_domain = plug_ins_locale_domain (factory->gimp,
progname, NULL);
help_path = plug_ins_help_path (factory->gimp,
progname);
g_free (basename);
#ifdef __GNUC__
#warning FIXME: fix plug-in menu item help
#endif
{
gchar *basename;
gchar *lowercase_basename;
/* NOT g_build_filename() because this is a relative URI */
help_page = g_strconcat ("filters/",
lowercase_basename,
".html",
NULL);
basename = g_path_get_basename (file_proc->prog);
lowercase_basename = g_ascii_strdown (basename, -1);
g_free (lowercase_basename);
help_id = g_strconcat (lowercase_basename, ".html", NULL);
g_free (lowercase_basename);
}
if (help_path)
help_page = g_strconcat (help_path, ":", help_id, NULL);
else
help_page = g_strconcat ("filters/", help_id, NULL);
g_free (help_id);
entry.entry.path = strstr (file_proc->menu_path, "/");
entry.entry.accelerator = NULL;
@ -88,12 +106,12 @@ file_open_menu_setup (GimpItemFactory *factory)
entry.entry.callback_action = 0;
entry.entry.item_type = NULL;
entry.quark_string = NULL;
entry.help_page = help_page;
entry.help_id = help_page;
entry.description = NULL;
gimp_item_factory_create_item (factory,
&entry,
NULL,
locale_domain,
file_proc, 2,
TRUE, FALSE);

View File

@ -30,6 +30,7 @@
#include "core/gimpdrawable.h"
#include "plug-in/plug-in-proc.h"
#include "plug-in/plug-ins.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpitemfactory.h"
@ -57,31 +58,48 @@ gint n_file_save_menu_entries = G_N_ELEMENTS (file_save_menu_entries);
void
file_save_menu_setup (GimpItemFactory *factory)
{
GimpItemFactoryEntry entry;
PlugInProcDef *file_proc;
GSList *list;
GSList *list;
for (list = factory->gimp->save_procs; list; list = g_slist_next (list))
{
gchar *basename;
gchar *lowercase_basename;
gchar *help_page;
PlugInProcDef *file_proc;
const gchar *progname;
const gchar *locale_domain;
const gchar *help_path;
GimpItemFactoryEntry entry;
gchar *help_id;
gchar *help_page;
file_proc = (PlugInProcDef *) list->data;
basename = g_path_get_basename (file_proc->prog);
progname = plug_in_proc_def_get_progname (file_proc);
lowercase_basename = g_ascii_strdown (basename, -1);
locale_domain = plug_ins_locale_domain (factory->gimp,
progname, NULL);
help_path = plug_ins_help_path (factory->gimp,
progname);
g_free (basename);
#ifdef __GNUC__
#warning FIXME: fix plug-in menu item help
#endif
{
gchar *basename;
gchar *lowercase_basename;
/* NOT g_build_filename() because this is a relative URI */
help_page = g_strconcat ("filters/",
lowercase_basename,
".html",
NULL);
basename = g_path_get_basename (file_proc->prog);
lowercase_basename = g_ascii_strdown (basename, -1);
g_free (lowercase_basename);
help_id = g_strconcat (lowercase_basename, ".html", NULL);
g_free (lowercase_basename);
}
if (help_path)
help_page = g_strconcat (help_path, ":", help_id, NULL);
else
help_page = g_strconcat ("filters/", help_id, NULL);
g_free (help_id);
entry.entry.path = strstr (file_proc->menu_path, "/");
entry.entry.accelerator = NULL;
@ -89,12 +107,12 @@ file_save_menu_setup (GimpItemFactory *factory)
entry.entry.callback_action = 0;
entry.entry.item_type = NULL;
entry.quark_string = NULL;
entry.help_page = help_page;
entry.help_id = help_page;
entry.description = NULL;
gimp_item_factory_create_item (factory,
&entry,
NULL,
locale_domain,
file_proc, 2,
TRUE, FALSE);

View File

@ -104,7 +104,7 @@ gradients_save_as_pov_query (GimpContainerEditor *editor)
G_CONNECT_SWAPPED);
gimp_help_connect (GTK_WIDGET (filesel), gimp_standard_help_func,
GIMP_HELP_GRADIENT_SAVE_AS_POV);
GIMP_HELP_GRADIENT_SAVE_AS_POV, NULL);
gtk_widget_show (GTK_WIDGET (filesel));
}

View File

@ -66,7 +66,8 @@
/* local function prototypes */
static void gui_help_func (const gchar *help_data);
static void gui_help_func (const gchar *help_id,
gpointer help_data);
static gboolean gui_get_background_func (GimpRGB *color);
static gboolean gui_get_foreground_func (GimpRGB *color);
@ -367,9 +368,10 @@ gui_post_init (Gimp *gimp)
/* private functions */
static void
gui_help_func (const gchar *help_data)
gui_help_func (const gchar *help_id,
gpointer help_data)
{
gimp_help (the_gimp, NULL, help_data);
gimp_help (the_gimp, NULL, help_id);
}
static gboolean

View File

@ -24,10 +24,6 @@
#include "gui-types.h"
#include "core/gimpobject.h"
#include "plug-in/plug-in.h"
#include "help-commands.h"
@ -36,7 +32,7 @@ help_help_cmd_callback (GtkWidget *widget,
gpointer data,
guint action)
{
gimp_standard_help_func (NULL);
gimp_standard_help_func (NULL, NULL);
}
void

View File

@ -1116,7 +1116,7 @@ image_menu_setup (GimpItemFactory *factory)
const gchar *stock_id;
const gchar *identifier;
stock_id = gimp_viewable_get_stock_id (GIMP_VIEWABLE (tool_info));
stock_id = gimp_viewable_get_stock_id (GIMP_VIEWABLE (tool_info));
identifier = gimp_object_get_name (GIMP_OBJECT (tool_info));
entry.entry.path = tool_info->menu_path;
@ -1126,7 +1126,7 @@ image_menu_setup (GimpItemFactory *factory)
entry.entry.item_type = "<StockItem>";
entry.entry.extra_data = stock_id;
entry.quark_string = identifier;
entry.help_page = tool_info->help_data;
entry.help_id = tool_info->help_id;
entry.description = NULL;
gimp_item_factory_create_item (factory,

View File

@ -107,129 +107,108 @@ menus_init (Gimp *gimp)
global_menu_factory = gimp_menu_factory_new (gimp);
gimp_menu_factory_menu_register (global_menu_factory,
"<Toolbox>", "toolbox",
gimp_menu_factory_menu_register (global_menu_factory, "<Toolbox>",
toolbox_menu_setup, NULL, FALSE,
n_toolbox_menu_entries,
toolbox_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory,
"<Image>", "image",
gimp_menu_factory_menu_register (global_menu_factory, "<Image>",
image_menu_setup, image_menu_update, FALSE,
n_image_menu_entries,
image_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory,
"<Load>", "open",
gimp_menu_factory_menu_register (global_menu_factory, "<Load>",
file_open_menu_setup, NULL, FALSE,
n_file_open_menu_entries,
file_open_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory,
"<Save>", "save",
gimp_menu_factory_menu_register (global_menu_factory, "<Save>",
file_save_menu_setup,
file_save_menu_update, FALSE,
n_file_save_menu_entries,
file_save_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory,
"<Layers>", "layers",
gimp_menu_factory_menu_register (global_menu_factory, "<Layers>",
NULL, layers_menu_update, TRUE,
n_layers_menu_entries,
layers_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory,
"<Channels>", "channels",
gimp_menu_factory_menu_register (global_menu_factory, "<Channels>",
NULL, channels_menu_update, TRUE,
n_channels_menu_entries,
channels_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory,
"<Vectors>", "vectors",
gimp_menu_factory_menu_register (global_menu_factory, "<Vectors>",
NULL, vectors_menu_update, TRUE,
n_vectors_menu_entries,
vectors_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory,
"<Dialogs>", "dialogs",
gimp_menu_factory_menu_register (global_menu_factory, "<Dialogs>",
NULL, dialogs_menu_update, TRUE,
n_dialogs_menu_entries,
dialogs_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory,
"<Brushes>", "brushes",
gimp_menu_factory_menu_register (global_menu_factory, "<Brushes>",
NULL, brushes_menu_update, TRUE,
n_brushes_menu_entries,
brushes_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory,
"<Patterns>", "patterns",
gimp_menu_factory_menu_register (global_menu_factory, "<Patterns>",
NULL, patterns_menu_update, TRUE,
n_patterns_menu_entries,
patterns_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory,
"<Gradients>", "gradients",
gimp_menu_factory_menu_register (global_menu_factory, "<Gradients>",
NULL, gradients_menu_update, TRUE,
n_gradients_menu_entries,
gradients_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory,
"<Palettes>", "palettes",
gimp_menu_factory_menu_register (global_menu_factory, "<Palettes>",
NULL, palettes_menu_update, TRUE,
n_palettes_menu_entries,
palettes_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory,
"<Buffers>", "buffers",
gimp_menu_factory_menu_register (global_menu_factory, "<Buffers>",
NULL, buffers_menu_update, TRUE,
n_buffers_menu_entries,
buffers_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory,
"<Documents>", "documents",
gimp_menu_factory_menu_register (global_menu_factory, "<Documents>",
NULL, documents_menu_update, TRUE,
n_documents_menu_entries,
documents_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory,
"<Templates>", "templates",
gimp_menu_factory_menu_register (global_menu_factory, "<Templates>",
NULL, templates_menu_update, TRUE,
n_templates_menu_entries,
templates_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory,
"<Images>", "images",
gimp_menu_factory_menu_register (global_menu_factory, "<Images>",
NULL, images_menu_update, TRUE,
n_images_menu_entries,
images_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory,
"<GradientEditor>", "gradient_editor",
gimp_menu_factory_menu_register (global_menu_factory, "<GradientEditor>",
NULL, gradient_editor_menu_update, TRUE,
n_gradient_editor_menu_entries,
gradient_editor_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory,
"<PaletteEditor>", "palette_editor",
gimp_menu_factory_menu_register (global_menu_factory, "<PaletteEditor>",
NULL, palette_editor_menu_update, TRUE,
n_palette_editor_menu_entries,
palette_editor_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory,
"<ColormapEditor>", "colormap_editor",
gimp_menu_factory_menu_register (global_menu_factory, "<ColormapEditor>",
NULL, colormap_editor_menu_update, TRUE,
n_colormap_editor_menu_entries,
colormap_editor_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory,
"<QMask>", "qmask",
gimp_menu_factory_menu_register (global_menu_factory, "<QMask>",
NULL, qmask_menu_update, TRUE,
n_qmask_menu_entries,
qmask_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory,
"<ErrorConsole>", "error_console",
gimp_menu_factory_menu_register (global_menu_factory, "<ErrorConsole>",
NULL, error_console_menu_update, TRUE,
n_error_console_menu_entries,
error_console_menu_entries);
@ -312,7 +291,7 @@ menus_last_opened_add (GimpItemFactory *item_factory,
last_opened_entries[i].entry.item_type = "<StockItem>";
last_opened_entries[i].entry.extra_data = GTK_STOCK_OPEN;
last_opened_entries[i].quark_string = NULL;
last_opened_entries[i].help_page = GIMP_HELP_FILE_OPEN_RECENT;
last_opened_entries[i].help_id = GIMP_HELP_FILE_OPEN_RECENT;
last_opened_entries[i].description = NULL;
}

View File

@ -48,7 +48,7 @@ typedef struct _PlugInMenuEntry PlugInMenuEntry;
struct _PlugInMenuEntry
{
PlugInProcDef *proc_def;
const gchar *domain;
const gchar *locale_domain;
const gchar *help_path;
};
@ -149,17 +149,17 @@ plug_in_menus_create (GimpItemFactory *item_factory,
menu_entry = g_new0 (PlugInMenuEntry, 1);
menu_entry->proc_def = proc_def;
menu_entry->domain = locale_domain;
menu_entry->help_path = help_path;
menu_entry->proc_def = proc_def;
menu_entry->locale_domain = locale_domain;
menu_entry->help_path = help_path;
g_tree_insert (menu_entries,
g_tree_insert (menu_entries,
dgettext (locale_domain, proc_def->menu_path),
menu_entry);
}
}
g_tree_foreach (menu_entries,
g_tree_foreach (menu_entries,
(GTraverseFunc) plug_in_menu_tree_traverse_func,
item_factory);
g_tree_destroy (menu_entries);
@ -172,36 +172,33 @@ plug_in_menus_create_entry (GimpItemFactory *item_factory,
const gchar *help_path)
{
GimpItemFactoryEntry entry;
gchar *help_id;
gchar *help_page;
gchar *basename;
gchar *lowercase_page;
g_return_if_fail (item_factory == NULL ||
GIMP_IS_ITEM_FACTORY (item_factory));
basename = g_path_get_basename (proc_def->prog);
#ifdef __GNUC__
#warning FIXME: fix plug-in menu item help
#endif
{
gchar *basename;
gchar *lowercase_basename;
basename = g_path_get_basename (proc_def->prog);
lowercase_basename = g_ascii_strdown (basename, -1);
help_id = g_strconcat (lowercase_basename, ".html", NULL);
g_free (lowercase_basename);
}
if (help_path)
{
help_page = g_strconcat (help_path,
"@", /* HACK: locale subdir */
basename,
".html",
NULL);
}
help_page = g_strconcat (help_path, ":", help_id, NULL);
else
{
help_page = g_strconcat ("filters/", /* _not_ G_DIR_SEPARATOR_S */
basename,
".html",
NULL);
}
help_page = g_strconcat ("filters/", help_id, NULL);
g_free (basename);
lowercase_page = g_ascii_strdown (help_page, -1);
g_free (help_page);
g_free (help_id);
entry.entry.path = strstr (proc_def->menu_path, "/");
entry.entry.accelerator = proc_def->accelerator;
@ -209,7 +206,7 @@ plug_in_menus_create_entry (GimpItemFactory *item_factory,
entry.entry.callback_action = 0;
entry.entry.item_type = NULL;
entry.quark_string = NULL;
entry.help_page = lowercase_page;
entry.help_id = help_page;
entry.description = NULL;
if (item_factory)
@ -246,7 +243,7 @@ plug_in_menus_create_entry (GimpItemFactory *item_factory,
}
}
g_free (lowercase_page);
g_free (help_page);
}
void
@ -413,7 +410,7 @@ plug_in_menu_tree_traverse_func (gpointer foo,
{
plug_in_menus_create_entry (item_factory,
menu_entry->proc_def,
menu_entry->domain,
menu_entry->locale_domain,
menu_entry->help_path);
return FALSE;

View File

@ -464,7 +464,7 @@ prefs_notebook_append_page (Gimp *gimp,
const gchar *notebook_icon,
GtkTreeStore *tree,
const gchar *tree_label,
const gchar *help_data,
const gchar *help_id,
GtkTreeIter *parent,
GtkTreeIter *iter,
gint page_index)
@ -478,7 +478,7 @@ prefs_notebook_append_page (Gimp *gimp,
gtk_notebook_append_page (notebook, event_box, NULL);
gtk_widget_show (event_box);
gimp_help_set_help_data (event_box, NULL, help_data);
gimp_help_set_help_data (event_box, NULL, help_id);
vbox = gtk_vbox_new (FALSE, 6);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 6);
@ -824,21 +824,19 @@ prefs_memsize_entry_add (GObject *config,
}
static void
prefs_help_func (const gchar *help_data)
prefs_help_func (const gchar *help_id,
gpointer help_data)
{
if (prefs_dialog)
{
GtkWidget *notebook;
GtkWidget *event_box;
gint page_num;
GtkWidget *notebook;
GtkWidget *event_box;
gint page_num;
notebook = g_object_get_data (G_OBJECT (prefs_dialog), "notebook");
page_num = gtk_notebook_get_current_page (GTK_NOTEBOOK (notebook));
event_box = gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook), page_num);
notebook = g_object_get_data (G_OBJECT (help_data), "notebook");
page_num = gtk_notebook_get_current_page (GTK_NOTEBOOK (notebook));
event_box = gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook), page_num);
help_data = g_object_get_data (G_OBJECT (event_box), "gimp_help_data");
gimp_standard_help_func (help_data);
}
help_id = g_object_get_data (G_OBJECT (event_box), "gimp-help-id");
gimp_standard_help_func (help_id, NULL);
}
static GtkWidget *

View File

@ -217,9 +217,8 @@ tips_dialog_create (Gimp *gimp)
G_CALLBACK (tips_show_next),
NULL);
/* Connect the "F1" help key */
gimp_help_connect (tips_dialog, gimp_standard_help_func,
GIMP_HELP_TIPS_DIALOG);
GIMP_HELP_TIPS_DIALOG, NULL);
tips_set_labels (current_tip->data);

View File

@ -29,6 +29,7 @@
#include "core/gimp.h"
#include "plug-in/plug-in-proc.h"
#include "plug-in/plug-ins.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpitemfactory.h"
@ -56,31 +57,48 @@ gint n_file_open_menu_entries = G_N_ELEMENTS (file_open_menu_entries);
void
file_open_menu_setup (GimpItemFactory *factory)
{
GimpItemFactoryEntry entry;
PlugInProcDef *file_proc;
GSList *list;
GSList *list;
for (list = factory->gimp->load_procs; list; list = g_slist_next (list))
{
gchar *basename;
gchar *lowercase_basename;
gchar *help_page;
PlugInProcDef *file_proc;
const gchar *progname;
const gchar *locale_domain;
const gchar *help_path;
GimpItemFactoryEntry entry;
gchar *help_id;
gchar *help_page;
file_proc = (PlugInProcDef *) list->data;
basename = g_path_get_basename (file_proc->prog);
progname = plug_in_proc_def_get_progname (file_proc);
lowercase_basename = g_ascii_strdown (basename, -1);
locale_domain = plug_ins_locale_domain (factory->gimp,
progname, NULL);
help_path = plug_ins_help_path (factory->gimp,
progname);
g_free (basename);
#ifdef __GNUC__
#warning FIXME: fix plug-in menu item help
#endif
{
gchar *basename;
gchar *lowercase_basename;
/* NOT g_build_filename() because this is a relative URI */
help_page = g_strconcat ("filters/",
lowercase_basename,
".html",
NULL);
basename = g_path_get_basename (file_proc->prog);
lowercase_basename = g_ascii_strdown (basename, -1);
g_free (lowercase_basename);
help_id = g_strconcat (lowercase_basename, ".html", NULL);
g_free (lowercase_basename);
}
if (help_path)
help_page = g_strconcat (help_path, ":", help_id, NULL);
else
help_page = g_strconcat ("filters/", help_id, NULL);
g_free (help_id);
entry.entry.path = strstr (file_proc->menu_path, "/");
entry.entry.accelerator = NULL;
@ -88,12 +106,12 @@ file_open_menu_setup (GimpItemFactory *factory)
entry.entry.callback_action = 0;
entry.entry.item_type = NULL;
entry.quark_string = NULL;
entry.help_page = help_page;
entry.help_id = help_page;
entry.description = NULL;
gimp_item_factory_create_item (factory,
&entry,
NULL,
locale_domain,
file_proc, 2,
TRUE, FALSE);

View File

@ -30,6 +30,7 @@
#include "core/gimpdrawable.h"
#include "plug-in/plug-in-proc.h"
#include "plug-in/plug-ins.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpitemfactory.h"
@ -57,31 +58,48 @@ gint n_file_save_menu_entries = G_N_ELEMENTS (file_save_menu_entries);
void
file_save_menu_setup (GimpItemFactory *factory)
{
GimpItemFactoryEntry entry;
PlugInProcDef *file_proc;
GSList *list;
GSList *list;
for (list = factory->gimp->save_procs; list; list = g_slist_next (list))
{
gchar *basename;
gchar *lowercase_basename;
gchar *help_page;
PlugInProcDef *file_proc;
const gchar *progname;
const gchar *locale_domain;
const gchar *help_path;
GimpItemFactoryEntry entry;
gchar *help_id;
gchar *help_page;
file_proc = (PlugInProcDef *) list->data;
basename = g_path_get_basename (file_proc->prog);
progname = plug_in_proc_def_get_progname (file_proc);
lowercase_basename = g_ascii_strdown (basename, -1);
locale_domain = plug_ins_locale_domain (factory->gimp,
progname, NULL);
help_path = plug_ins_help_path (factory->gimp,
progname);
g_free (basename);
#ifdef __GNUC__
#warning FIXME: fix plug-in menu item help
#endif
{
gchar *basename;
gchar *lowercase_basename;
/* NOT g_build_filename() because this is a relative URI */
help_page = g_strconcat ("filters/",
lowercase_basename,
".html",
NULL);
basename = g_path_get_basename (file_proc->prog);
lowercase_basename = g_ascii_strdown (basename, -1);
g_free (lowercase_basename);
help_id = g_strconcat (lowercase_basename, ".html", NULL);
g_free (lowercase_basename);
}
if (help_path)
help_page = g_strconcat (help_path, ":", help_id, NULL);
else
help_page = g_strconcat ("filters/", help_id, NULL);
g_free (help_id);
entry.entry.path = strstr (file_proc->menu_path, "/");
entry.entry.accelerator = NULL;
@ -89,12 +107,12 @@ file_save_menu_setup (GimpItemFactory *factory)
entry.entry.callback_action = 0;
entry.entry.item_type = NULL;
entry.quark_string = NULL;
entry.help_page = help_page;
entry.help_id = help_page;
entry.description = NULL;
gimp_item_factory_create_item (factory,
&entry,
NULL,
locale_domain,
file_proc, 2,
TRUE, FALSE);

View File

@ -1116,7 +1116,7 @@ image_menu_setup (GimpItemFactory *factory)
const gchar *stock_id;
const gchar *identifier;
stock_id = gimp_viewable_get_stock_id (GIMP_VIEWABLE (tool_info));
stock_id = gimp_viewable_get_stock_id (GIMP_VIEWABLE (tool_info));
identifier = gimp_object_get_name (GIMP_OBJECT (tool_info));
entry.entry.path = tool_info->menu_path;
@ -1126,7 +1126,7 @@ image_menu_setup (GimpItemFactory *factory)
entry.entry.item_type = "<StockItem>";
entry.entry.extra_data = stock_id;
entry.quark_string = identifier;
entry.help_page = tool_info->help_data;
entry.help_id = tool_info->help_id;
entry.description = NULL;
gimp_item_factory_create_item (factory,

View File

@ -107,129 +107,108 @@ menus_init (Gimp *gimp)
global_menu_factory = gimp_menu_factory_new (gimp);
gimp_menu_factory_menu_register (global_menu_factory,
"<Toolbox>", "toolbox",
gimp_menu_factory_menu_register (global_menu_factory, "<Toolbox>",
toolbox_menu_setup, NULL, FALSE,
n_toolbox_menu_entries,
toolbox_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory,
"<Image>", "image",
gimp_menu_factory_menu_register (global_menu_factory, "<Image>",
image_menu_setup, image_menu_update, FALSE,
n_image_menu_entries,
image_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory,
"<Load>", "open",
gimp_menu_factory_menu_register (global_menu_factory, "<Load>",
file_open_menu_setup, NULL, FALSE,
n_file_open_menu_entries,
file_open_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory,
"<Save>", "save",
gimp_menu_factory_menu_register (global_menu_factory, "<Save>",
file_save_menu_setup,
file_save_menu_update, FALSE,
n_file_save_menu_entries,
file_save_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory,
"<Layers>", "layers",
gimp_menu_factory_menu_register (global_menu_factory, "<Layers>",
NULL, layers_menu_update, TRUE,
n_layers_menu_entries,
layers_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory,
"<Channels>", "channels",
gimp_menu_factory_menu_register (global_menu_factory, "<Channels>",
NULL, channels_menu_update, TRUE,
n_channels_menu_entries,
channels_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory,
"<Vectors>", "vectors",
gimp_menu_factory_menu_register (global_menu_factory, "<Vectors>",
NULL, vectors_menu_update, TRUE,
n_vectors_menu_entries,
vectors_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory,
"<Dialogs>", "dialogs",
gimp_menu_factory_menu_register (global_menu_factory, "<Dialogs>",
NULL, dialogs_menu_update, TRUE,
n_dialogs_menu_entries,
dialogs_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory,
"<Brushes>", "brushes",
gimp_menu_factory_menu_register (global_menu_factory, "<Brushes>",
NULL, brushes_menu_update, TRUE,
n_brushes_menu_entries,
brushes_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory,
"<Patterns>", "patterns",
gimp_menu_factory_menu_register (global_menu_factory, "<Patterns>",
NULL, patterns_menu_update, TRUE,
n_patterns_menu_entries,
patterns_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory,
"<Gradients>", "gradients",
gimp_menu_factory_menu_register (global_menu_factory, "<Gradients>",
NULL, gradients_menu_update, TRUE,
n_gradients_menu_entries,
gradients_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory,
"<Palettes>", "palettes",
gimp_menu_factory_menu_register (global_menu_factory, "<Palettes>",
NULL, palettes_menu_update, TRUE,
n_palettes_menu_entries,
palettes_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory,
"<Buffers>", "buffers",
gimp_menu_factory_menu_register (global_menu_factory, "<Buffers>",
NULL, buffers_menu_update, TRUE,
n_buffers_menu_entries,
buffers_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory,
"<Documents>", "documents",
gimp_menu_factory_menu_register (global_menu_factory, "<Documents>",
NULL, documents_menu_update, TRUE,
n_documents_menu_entries,
documents_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory,
"<Templates>", "templates",
gimp_menu_factory_menu_register (global_menu_factory, "<Templates>",
NULL, templates_menu_update, TRUE,
n_templates_menu_entries,
templates_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory,
"<Images>", "images",
gimp_menu_factory_menu_register (global_menu_factory, "<Images>",
NULL, images_menu_update, TRUE,
n_images_menu_entries,
images_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory,
"<GradientEditor>", "gradient_editor",
gimp_menu_factory_menu_register (global_menu_factory, "<GradientEditor>",
NULL, gradient_editor_menu_update, TRUE,
n_gradient_editor_menu_entries,
gradient_editor_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory,
"<PaletteEditor>", "palette_editor",
gimp_menu_factory_menu_register (global_menu_factory, "<PaletteEditor>",
NULL, palette_editor_menu_update, TRUE,
n_palette_editor_menu_entries,
palette_editor_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory,
"<ColormapEditor>", "colormap_editor",
gimp_menu_factory_menu_register (global_menu_factory, "<ColormapEditor>",
NULL, colormap_editor_menu_update, TRUE,
n_colormap_editor_menu_entries,
colormap_editor_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory,
"<QMask>", "qmask",
gimp_menu_factory_menu_register (global_menu_factory, "<QMask>",
NULL, qmask_menu_update, TRUE,
n_qmask_menu_entries,
qmask_menu_entries);
gimp_menu_factory_menu_register (global_menu_factory,
"<ErrorConsole>", "error_console",
gimp_menu_factory_menu_register (global_menu_factory, "<ErrorConsole>",
NULL, error_console_menu_update, TRUE,
n_error_console_menu_entries,
error_console_menu_entries);
@ -312,7 +291,7 @@ menus_last_opened_add (GimpItemFactory *item_factory,
last_opened_entries[i].entry.item_type = "<StockItem>";
last_opened_entries[i].entry.extra_data = GTK_STOCK_OPEN;
last_opened_entries[i].quark_string = NULL;
last_opened_entries[i].help_page = GIMP_HELP_FILE_OPEN_RECENT;
last_opened_entries[i].help_id = GIMP_HELP_FILE_OPEN_RECENT;
last_opened_entries[i].description = NULL;
}

View File

@ -48,7 +48,7 @@ typedef struct _PlugInMenuEntry PlugInMenuEntry;
struct _PlugInMenuEntry
{
PlugInProcDef *proc_def;
const gchar *domain;
const gchar *locale_domain;
const gchar *help_path;
};
@ -149,17 +149,17 @@ plug_in_menus_create (GimpItemFactory *item_factory,
menu_entry = g_new0 (PlugInMenuEntry, 1);
menu_entry->proc_def = proc_def;
menu_entry->domain = locale_domain;
menu_entry->help_path = help_path;
menu_entry->proc_def = proc_def;
menu_entry->locale_domain = locale_domain;
menu_entry->help_path = help_path;
g_tree_insert (menu_entries,
g_tree_insert (menu_entries,
dgettext (locale_domain, proc_def->menu_path),
menu_entry);
}
}
g_tree_foreach (menu_entries,
g_tree_foreach (menu_entries,
(GTraverseFunc) plug_in_menu_tree_traverse_func,
item_factory);
g_tree_destroy (menu_entries);
@ -172,36 +172,33 @@ plug_in_menus_create_entry (GimpItemFactory *item_factory,
const gchar *help_path)
{
GimpItemFactoryEntry entry;
gchar *help_id;
gchar *help_page;
gchar *basename;
gchar *lowercase_page;
g_return_if_fail (item_factory == NULL ||
GIMP_IS_ITEM_FACTORY (item_factory));
basename = g_path_get_basename (proc_def->prog);
#ifdef __GNUC__
#warning FIXME: fix plug-in menu item help
#endif
{
gchar *basename;
gchar *lowercase_basename;
basename = g_path_get_basename (proc_def->prog);
lowercase_basename = g_ascii_strdown (basename, -1);
help_id = g_strconcat (lowercase_basename, ".html", NULL);
g_free (lowercase_basename);
}
if (help_path)
{
help_page = g_strconcat (help_path,
"@", /* HACK: locale subdir */
basename,
".html",
NULL);
}
help_page = g_strconcat (help_path, ":", help_id, NULL);
else
{
help_page = g_strconcat ("filters/", /* _not_ G_DIR_SEPARATOR_S */
basename,
".html",
NULL);
}
help_page = g_strconcat ("filters/", help_id, NULL);
g_free (basename);
lowercase_page = g_ascii_strdown (help_page, -1);
g_free (help_page);
g_free (help_id);
entry.entry.path = strstr (proc_def->menu_path, "/");
entry.entry.accelerator = proc_def->accelerator;
@ -209,7 +206,7 @@ plug_in_menus_create_entry (GimpItemFactory *item_factory,
entry.entry.callback_action = 0;
entry.entry.item_type = NULL;
entry.quark_string = NULL;
entry.help_page = lowercase_page;
entry.help_id = help_page;
entry.description = NULL;
if (item_factory)
@ -246,7 +243,7 @@ plug_in_menus_create_entry (GimpItemFactory *item_factory,
}
}
g_free (lowercase_page);
g_free (help_page);
}
void
@ -413,7 +410,7 @@ plug_in_menu_tree_traverse_func (gpointer foo,
{
plug_in_menus_create_entry (item_factory,
menu_entry->proc_def,
menu_entry->domain,
menu_entry->locale_domain,
menu_entry->help_path);
return FALSE;

View File

@ -263,7 +263,7 @@ gimp_color_picker_tool_info_create (GimpTool *tool)
GIMP_STOCK_TOOL_COLOR_PICKER,
_("Color Picker Information"),
gimp_standard_help_func,
tool->tool_info->help_data);
tool->tool_info->help_id);
gimp_dialog_create_action_area (GIMP_DIALOG (info_dialog->shell),

View File

@ -988,7 +988,7 @@ crop_info_create (GimpCropTool *crop)
stock_id,
_("Crop & Resize Information"),
gimp_standard_help_func,
tool->tool_info->help_data);
tool->tool_info->help_id);
gimp_dialog_create_action_area (GIMP_DIALOG (crop->crop_info->shell),

View File

@ -1273,7 +1273,7 @@ file_dialog_create (GimpCurvesTool *c_tool)
g_free (temp);
gimp_help_connect (c_tool->file_dialog, gimp_standard_help_func,
GIMP_TOOL (c_tool)->tool_info->help_data);
GIMP_TOOL (c_tool)->tool_info->help_id, NULL);
}
static void

View File

@ -349,7 +349,7 @@ histogram_tool_dialog_new (GimpToolInfo *tool_info)
GIMP_OBJECT (tool_info)->name,
stock_id,
_("View Image Histogram"),
gimp_standard_help_func, tool_info->help_data,
gimp_standard_help_func, tool_info->help_id,
GTK_STOCK_CLOSE, histogram_tool_close_callback,
htd, NULL, NULL, TRUE, TRUE,

View File

@ -223,7 +223,7 @@ gimp_image_map_tool_initialize (GimpTool *tool,
stock_id,
image_map_tool->shell_desc,
gimp_standard_help_func,
tool_info->help_data,
tool_info->help_id,
GIMP_STOCK_RESET,
gimp_image_map_tool_reset_clicked,

View File

@ -1471,7 +1471,7 @@ file_dialog_create (GimpLevelsTool *l_tool)
g_free (temp);
gimp_help_connect (l_tool->file_dialog, gimp_standard_help_func,
GIMP_TOOL (l_tool)->tool_info->help_data);
GIMP_TOOL (l_tool)->tool_info->help_id, NULL);
}
static void

View File

@ -386,7 +386,7 @@ gimp_measure_tool_button_press (GimpTool *tool,
stock_id,
_("Measure Distances and Angles"),
gimp_standard_help_func,
tool->tool_info->help_data);
tool->tool_info->help_id);
info_dialog_add_label (measure_tool_info, _("Distance:"), distance_buf);
info_dialog_add_label (measure_tool_info, _("Angle:"), angle_buf);

View File

@ -1239,7 +1239,7 @@ gimp_transform_tool_dialog (GimpTransformTool *tr_tool)
GIMP_OBJECT (tool_info)->name,
stock_id,
tr_tool->shell_desc,
gimp_standard_help_func, tool_info->help_data);
gimp_standard_help_func, tool_info->help_id);
gimp_dialog_create_action_area (GIMP_DIALOG (tr_tool->info_dialog->shell),

View File

@ -95,7 +95,8 @@ static ColorNotebook *
gboolean wants_updates,
gboolean show_alpha);
static void color_notebook_help_func (const gchar *help_data);
static void color_notebook_help_func (const gchar *help_id,
gpointer help_data);
static void color_notebook_ok_callback (GtkWidget *widget,
ColorNotebook *cnp);
@ -322,22 +323,22 @@ color_notebook_new_internal (GimpViewable *viewable,
cnp->shell = gimp_viewable_dialog_new (viewable,
title, wmclass_name,
stock_id, desc,
color_notebook_help_func,
(const gchar *) cnp,
color_notebook_help_func, NULL,
NULL);
gtk_window_set_resizable (GTK_WINDOW (cnp->shell), FALSE);
}
else
{
cnp->shell = gimp_dialog_new (title, wmclass_name,
color_notebook_help_func,
(const gchar *) cnp,
GTK_WIN_POS_NONE,
FALSE, TRUE, TRUE,
NULL);
cnp->shell = gimp_dialog_new (title, wmclass_name,
color_notebook_help_func, NULL,
GTK_WIN_POS_NONE,
FALSE, TRUE, TRUE,
NULL);
}
g_object_set_data (G_OBJECT (cnp->shell), "color-notebook", cnp);
gimp_dialog_create_action_area (GIMP_DIALOG (cnp->shell),
GTK_STOCK_CANCEL,
@ -535,21 +536,19 @@ color_notebook_new_internal (GimpViewable *viewable,
}
static void
color_notebook_help_func (const gchar *data)
color_notebook_help_func (const gchar *help_id,
gpointer help_data)
{
ColorNotebook *cnp;
GimpColorNotebook *notebook;
gchar *help_path;
cnp = (ColorNotebook *) data;
cnp = g_object_get_data (G_OBJECT (help_data), "color-notebook");
notebook = GIMP_COLOR_NOTEBOOK (cnp->notebook);
help_path = g_strconcat ("dialogs/color_selectors/",
GIMP_COLOR_SELECTOR_GET_CLASS (notebook->cur_page)->help_page,
NULL);
gimp_standard_help_func (help_path);
g_free (help_path);
help_id = GIMP_COLOR_SELECTOR_GET_CLASS (notebook->cur_page)->help_page;
gimp_standard_help_func (help_id, NULL);
}
static void

View File

@ -370,7 +370,7 @@ gimp_error_console_save_ext_clicked (GtkWidget *button,
console);
gimp_help_connect (GTK_WIDGET (filesel), gimp_standard_help_func,
GIMP_HELP_ERROR_DIALOG);
GIMP_HELP_ERROR_DIALOG, NULL);
gtk_widget_show (GTK_WIDGET (filesel));
}

View File

@ -23,6 +23,8 @@
#define __GIMP_HELP_IDS_H__
#define GIMP_HELP_MAIN "index.html"
#define GIMP_HELP_FILE_NEW "dialogs/file_new.html"
#define GIMP_HELP_FILE_NEW_CONFIRM "dialogs/file_new.html#confirm_dialog"
#define GIMP_HELP_FILE_OPEN "dialogs/file_open.html"

View File

@ -43,6 +43,7 @@
#include "plug-in/plug-in-run.h"
#include "gimphelp.h"
#include "gimphelp-ids.h"
#include "gimp-intl.h"
@ -58,7 +59,7 @@ struct _GimpIdleHelp
Gimp *gimp;
gchar *help_path;
gchar *help_locale;
gchar *help_data;
gchar *help_id;
};
@ -68,11 +69,11 @@ static gint gimp_idle_help (gpointer data);
static gboolean gimp_help_internal (Gimp *gimp,
const gchar *help_path,
const gchar *current_locale,
const gchar *help_data);
const gchar *help_id);
static void gimp_help_netscape (Gimp *gimp,
const gchar *help_path,
const gchar *current_locale,
const gchar *help_data);
const gchar *help_id);
/* public functions */
@ -80,7 +81,7 @@ static void gimp_help_netscape (Gimp *gimp,
void
gimp_help (Gimp *gimp,
const gchar *help_path,
const gchar *help_data)
const gchar *help_id)
{
g_return_if_fail (GIMP_IS_GIMP (gimp));
@ -97,8 +98,8 @@ gimp_help (Gimp *gimp,
idle_help->help_locale = g_strdup ("C");
if (help_data && strlen (help_data))
idle_help->help_data = g_strdup (help_data);
if (help_id && strlen (help_id))
idle_help->help_id = g_strdup (help_id);
g_idle_add (gimp_idle_help, idle_help);
}
@ -123,10 +124,10 @@ gimp_idle_help (gpointer data)
else
g_print ("Help Path: NULL\n");
if (idle_help->help_data)
g_print ("Help Page: %s\n", idle_help->help_data);
if (idle_help->help_id)
g_print ("Help ID: %s\n", idle_help->help_id);
else
g_print ("Help Page: NULL\n");
g_print ("Help ID: NULL\n");
g_print ("\n");
#endif /* DEBUG_HELP */
@ -137,14 +138,14 @@ gimp_idle_help (gpointer data)
if (gimp_help_internal (idle_help->gimp,
idle_help->help_path,
idle_help->help_locale,
idle_help->help_data))
idle_help->help_id))
break;
case GIMP_HELP_BROWSER_NETSCAPE:
gimp_help_netscape (idle_help->gimp,
idle_help->help_path,
idle_help->help_locale,
idle_help->help_data);
idle_help->help_id);
break;
default:
@ -153,7 +154,7 @@ gimp_idle_help (gpointer data)
g_free (idle_help->help_path);
g_free (idle_help->help_locale);
g_free (idle_help->help_data);
g_free (idle_help->help_id);
g_free (idle_help);
return FALSE;
@ -178,7 +179,7 @@ static gboolean
gimp_help_internal (Gimp *gimp,
const gchar *help_path,
const gchar *current_locale,
const gchar *help_data)
const gchar *help_id)
{
ProcRecord *proc_rec;
@ -228,7 +229,7 @@ gimp_help_internal (Gimp *gimp,
args[2].arg_type = GIMP_PDB_STRING;
args[2].value.pdb_pointer = (gpointer) current_locale;
args[3].arg_type = GIMP_PDB_STRING;
args[3].value.pdb_pointer = (gpointer) help_data;
args[3].value.pdb_pointer = (gpointer) help_id;
plug_in_run (gimp, proc_rec, args, 4, FALSE, TRUE, -1);
@ -245,7 +246,7 @@ gimp_help_internal (Gimp *gimp,
&nreturn_vals,
GIMP_PDB_STRING, help_path,
GIMP_PDB_STRING, current_locale,
GIMP_PDB_STRING, help_data,
GIMP_PDB_STRING, help_id,
GIMP_PDB_END);
procedural_db_destroy_args (return_vals, nreturn_vals);
@ -260,18 +261,18 @@ static void
gimp_help_netscape (Gimp *gimp,
const gchar *help_path,
const gchar *current_locale,
const gchar *help_data)
const gchar *help_id)
{
Argument *return_vals;
gint nreturn_vals;
gchar *url;
if (!help_data)
help_data = "introduction.html";
if (! help_id)
help_id = GIMP_HELP_MAIN;
if (help_data[0] == '/') /* _not_ g_path_is_absolute() */
if (help_id[0] == '/') /* _not_ g_path_is_absolute() */
{
url = g_strconcat ("file:", help_data, NULL);
url = g_strconcat ("file:", help_id, NULL);
}
else
{
@ -281,7 +282,7 @@ gimp_help_netscape (Gimp *gimp,
gimp_data_directory (),
"/help/",
current_locale, "/",
help_data,
help_id,
NULL);
}
else
@ -289,7 +290,7 @@ gimp_help_netscape (Gimp *gimp,
url = g_strconcat ("file:",
help_path, "/",
current_locale, "/",
help_data,
help_id,
NULL);
}
}

View File

@ -29,7 +29,7 @@
*/
void gimp_help (Gimp *gimp,
const gchar *help_path,
const gchar *help_data);
const gchar *help_id);
#endif /* __GIMP_HELP_H__ */

View File

@ -156,7 +156,6 @@ GimpItemFactory *
gimp_item_factory_new (Gimp *gimp,
GType container_type,
const gchar *factory_path,
const gchar *help_path,
GimpItemFactoryUpdateFunc update_func,
gboolean update_on_popup,
guint n_entries,
@ -170,7 +169,6 @@ gimp_item_factory_new (Gimp *gimp,
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
g_return_val_if_fail (factory_path != NULL, NULL);
g_return_val_if_fail (help_path != NULL, NULL);
g_return_val_if_fail (factory_path[0] == '<', NULL);
g_return_val_if_fail (factory_path[strlen (factory_path) - 1] == '>', NULL);
@ -200,11 +198,6 @@ gimp_item_factory_new (Gimp *gimp,
g_strdup (factory_path),
list);
/* this will go away <mitch> */
g_object_set_data_full (G_OBJECT (factory), "help_path",
g_strdup (help_path),
(GDestroyNotify) g_free);
gimp_item_factory_create_items (factory,
n_entries,
entries,
@ -326,14 +319,14 @@ gimp_item_factory_create_item (GimpItemFactory *item_factory,
G_CALLBACK (gimp_item_factory_item_realize),
item_factory);
if (entry->help_page)
if (entry->help_id)
{
if (static_entry)
g_object_set_data (G_OBJECT (menu_item), "help_page",
(gpointer) entry->help_page);
g_object_set_data (G_OBJECT (menu_item), "gimp-help-id",
(gpointer) entry->help_id);
else
g_object_set_data_full (G_OBJECT (menu_item), "help_page",
g_strdup (entry->help_page),
g_object_set_data_full (G_OBJECT (menu_item), "gimp-help-id",
g_strdup (entry->help_id),
g_free);
}
}
@ -811,7 +804,7 @@ gimp_item_factory_create_branches (GimpItemFactory *factory,
};
branch_entry.entry.path = tearoff_path->str;
g_object_set_data (G_OBJECT (factory), "complete", entry->entry.path);
gimp_item_factory_create_item (factory,
@ -881,9 +874,7 @@ gimp_item_factory_item_key_press (GtkWidget *widget,
GimpItemFactory *item_factory)
{
GtkWidget *active_menu_item;
gchar *factory_help_path = NULL;
gchar *help_path = NULL;
gchar *help_page = NULL;
gchar *help_id = NULL;
active_menu_item = GTK_MENU_SHELL (widget)->active_menu_item;
@ -891,10 +882,10 @@ gimp_item_factory_item_key_press (GtkWidget *widget,
*/
if (active_menu_item)
{
help_page = g_object_get_data (G_OBJECT (active_menu_item), "help_page");
help_id = g_object_get_data (G_OBJECT (active_menu_item), "gimp-help-id");
if (help_page && ! *help_page)
help_page = NULL;
if (help_id && ! strlen (help_id))
help_id = NULL;
}
/* For any valid accelerator key except F1, continue with the
@ -903,55 +894,49 @@ gimp_item_factory_item_key_press (GtkWidget *widget,
*/
if (kevent->keyval != GDK_F1)
{
if (help_page &&
if (help_id &&
gtk_accelerator_valid (kevent->keyval, 0) &&
(strcmp (help_page, GIMP_HELP_HELP) == 0 ||
strcmp (help_page, GIMP_HELP_HELP_CONTEXT) == 0))
(strcmp (help_id, GIMP_HELP_HELP) == 0 ||
strcmp (help_id, GIMP_HELP_HELP_CONTEXT) == 0))
{
return TRUE;
}
else
{
return FALSE;
}
return FALSE;
}
/* ...finally, if F1 was pressed over any menu, show it's help page... */
factory_help_path = g_object_get_data (G_OBJECT (item_factory), "help_path");
if (! help_id)
help_id = GIMP_HELP_MAIN;
if (! help_page)
help_page = "index.html";
{
gchar *help_path = NULL;
gchar *help_string = NULL;
gchar *path_separator;
if (factory_help_path && help_page)
{
gchar *help_string;
gchar *at;
help_id = g_strdup (help_id);
help_page = g_strdup (help_page);
path_separator = strchr (help_id, ':');
at = strchr (help_page, '@'); /* HACK: locale subdir */
if (path_separator)
{
*path_separator = '\0';
if (at)
{
*at = '\0';
help_path = g_strdup (help_page);
help_string = g_strdup (at + 1);
}
else
{
help_string = g_strdup_printf ("%s/%s", factory_help_path, help_page);
}
help_path = g_strdup (help_id);
help_string = g_strdup (path_separator + 1);
}
else
{
help_string = g_strdup (help_id);
}
gimp_help (item_factory->gimp, help_path, help_string);
gimp_help (item_factory->gimp, help_path, help_string);
g_free (help_string);
g_free (help_page);
}
else
{
gimp_standard_help_func (NULL);
}
g_free (help_path);
g_free (help_string);
g_free (help_id);
}
return TRUE;
}
@ -984,8 +969,8 @@ gimp_item_factory_translate_func (const gchar *path,
if (complete)
{
/* This is a branch, use the complete path for translation,
* then strip off entries from the end until it matches.
/* This is a branch, use the complete path for translation,
* then strip off entries from the end until it matches.
*/
complete = g_strconcat (item_factory->path, complete, NULL);
translation = g_strdup (dgettext (domain, complete));
@ -1010,7 +995,7 @@ gimp_item_factory_translate_func (const gchar *path,
translation = dgettext (domain, menupath);
}
/*
/*
* Work around a bug in GTK+ prior to 1.2.7 (similar workaround below)
*/
if (strncmp (item_factory->path, translation,
@ -1034,8 +1019,8 @@ gimp_item_factory_translate_func (const gchar *path,
if (complete)
{
/* This is a branch, use the complete path for translation,
* then strip off entries from the end until it matches.
/* This is a branch, use the complete path for translation,
* then strip off entries from the end until it matches.
*/
complete = g_strdup (complete);
translation = g_strdup (gettext (complete));

View File

@ -28,7 +28,7 @@ struct _GimpItemFactoryEntry
const gchar *quark_string;
const gchar *help_page;
const gchar *help_id;
const gchar *description;
};
@ -65,7 +65,6 @@ GType gimp_item_factory_get_type (void) G_GNUC_CONST;
GimpItemFactory * gimp_item_factory_new (Gimp *gimp,
GType container_type,
const gchar *factory_path,
const gchar *help_path,
GimpItemFactoryUpdateFunc update_func,
gboolean update_on_popup,
guint n_entries,

View File

@ -106,7 +106,6 @@ gimp_menu_factory_finalize (GObject *object)
entry = (GimpMenuFactoryEntry *) list->data;
g_free (entry->identifier);
g_free (entry->help_path);
g_free (entry);
}
@ -133,7 +132,6 @@ gimp_menu_factory_new (Gimp *gimp)
void
gimp_menu_factory_menu_register (GimpMenuFactory *factory,
const gchar *identifier,
const gchar *help_path,
GimpItemFactorySetupFunc setup_func,
GimpItemFactoryUpdateFunc update_func,
gboolean update_on_popup,
@ -144,14 +142,12 @@ gimp_menu_factory_menu_register (GimpMenuFactory *factory,
g_return_if_fail (GIMP_IS_MENU_FACTORY (factory));
g_return_if_fail (identifier != NULL);
g_return_if_fail (help_path != NULL);
g_return_if_fail (n_entries > 0);
g_return_if_fail (entries != NULL);
entry = g_new0 (GimpMenuFactoryEntry, 1);
entry->identifier = g_strdup (identifier);
entry->help_path = g_strdup (help_path);
entry->setup_func = setup_func;
entry->update_func = update_func;
entry->update_on_popup = update_on_popup ? TRUE : FALSE;
@ -184,7 +180,6 @@ gimp_menu_factory_menu_new (GimpMenuFactory *factory,
item_factory = gimp_item_factory_new (factory->gimp,
container_type,
entry->identifier,
entry->help_path,
entry->update_func,
entry->update_on_popup,
entry->n_entries,

View File

@ -31,7 +31,6 @@ typedef struct _GimpMenuFactoryEntry GimpMenuFactoryEntry;
struct _GimpMenuFactoryEntry
{
gchar *identifier;
gchar *help_path;
GimpItemFactorySetupFunc setup_func;
GimpItemFactoryUpdateFunc update_func;
gboolean update_on_popup;
@ -70,7 +69,6 @@ GimpMenuFactory * gimp_menu_factory_new (Gimp *gimp);
void gimp_menu_factory_menu_register (GimpMenuFactory *factory,
const gchar *identifier,
const gchar *help_path,
GimpItemFactorySetupFunc setup_func,
GimpItemFactoryUpdateFunc update_func,
gboolean update_on_popup,

View File

@ -172,8 +172,8 @@ gimp_text_editor_new (const gchar *title,
NULL);
gtk_window_set_wmclass (GTK_WINDOW (editor), "text_editor", "Gimp");
gimp_help_connect (GTK_WIDGET (editor),
gimp_standard_help_func, "dialogs/text_editor.html");
gimp_help_connect (GTK_WIDGET (editor), gimp_standard_help_func,
"dialogs/text_editor.html", NULL);
gimp_dialog_create_action_area (GIMP_DIALOG (editor),
GTK_STOCK_CLOSE, gtk_widget_destroy,

View File

@ -190,7 +190,7 @@ gimp_toolbox_init (GimpToolbox *toolbox)
GTK_ITEM_FACTORY (toolbox_factory)->accel_group);
gimp_help_connect (GTK_WIDGET (toolbox), gimp_standard_help_func,
GIMP_HELP_TOOLBOX);
GIMP_HELP_TOOLBOX, NULL);
toolbox->wbox = gtk_hwrap_box_new (FALSE);
gtk_wrap_box_set_justify (GTK_WRAP_BOX (toolbox->wbox), GTK_JUSTIFY_TOP);
@ -595,9 +595,7 @@ gimp_toolbox_button_accel_changed (GtkAccelGroup *accel_group,
tooltip = g_strdup (tool_info->help);
}
gimp_help_set_help_data (tool_button,
tooltip,
tool_info->help_data);
gimp_help_set_help_data (tool_button, tooltip, tool_info->help_id);
g_free (tooltip);
}

View File

@ -158,7 +158,7 @@ gimp_viewable_dialog_new (GimpViewable *viewable,
const gchar *stock_id,
const gchar *desc,
GimpHelpFunc help_func,
const gchar *help_data,
const gchar *help_id,
/* specify action area buttons
* as va_list:
@ -189,16 +189,15 @@ gimp_viewable_dialog_new (GimpViewable *viewable,
gtk_window_set_wmclass (GTK_WINDOW (dialog), wmclass_name, "Gimp");
if (help_func)
gimp_help_connect (GTK_WIDGET (dialog), help_func, help_data);
gimp_help_connect (GTK_WIDGET (dialog), help_func, help_id, dialog);
va_start (args, help_data);
va_start (args, help_id);
gimp_dialog_create_action_areav (GIMP_DIALOG (dialog), args);
va_end (args);
gtk_image_set_from_stock (GTK_IMAGE (dialog->icon), stock_id,
GTK_ICON_SIZE_LARGE_TOOLBAR);
attrs = pango_attr_list_new ();
attr = pango_attr_scale_new (PANGO_SCALE_LARGE);

View File

@ -61,7 +61,7 @@ GtkWidget * gimp_viewable_dialog_new (GimpViewable *viewable,
const gchar *stock_id,
const gchar *desc,
GimpHelpFunc help_func,
const gchar *help_data,
const gchar *help_id,
/* specify action area buttons
* as va_list:

View File

@ -28,7 +28,8 @@
/* local function prototypes */
static void gimp_ui_help_func (const gchar *help_data);
static void gimp_ui_help_func (const gchar *help_id,
gpointer help_data);
/* public functions */
@ -115,7 +116,8 @@ gimp_ui_init (const gchar *prog_name,
/* private functions */
static void
gimp_ui_help_func (const gchar *help_data)
gimp_ui_help_func (const gchar *help_id,
gpointer help_data)
{
gimp_help (gimp_get_progname (), (gchar *) help_data);
gimp_help (gimp_get_progname (), help_id);
}

View File

@ -136,7 +136,7 @@ gimp_dialog_close (GtkDialog *dialog)
* gtk_window_set_wmclass(). The @wmclass_class will be
* automatically set to "Gimp".
* @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.
* @help_id: The help_id which will be passed to @help_func.
* @position: The dialog's initial position which will be set with
* gtk_window_set_position().
* @allow_shrink: The dialog's @allow_shrink flag, ...
@ -158,7 +158,7 @@ GtkWidget *
gimp_dialog_new (const gchar *title,
const gchar *wmclass_name,
GimpHelpFunc help_func,
const gchar *help_data,
const gchar *help_id,
GtkWindowPosition position,
gint allow_shrink,
gint allow_grow,
@ -184,7 +184,7 @@ gimp_dialog_new (const gchar *title,
dialog = gimp_dialog_newv (title,
wmclass_name,
help_func,
help_data,
help_id,
position,
allow_shrink,
allow_grow,
@ -204,7 +204,7 @@ gimp_dialog_new (const gchar *title,
* gtk_window_set_wmclass(). The @wmclass_class will be
* automatically set to "Gimp".
* @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.
* @help_id: The help_id which will be passed to @help_func.
* @position: The dialog's initial position which will be set with
* gtk_window_set_position().
* @allow_shrink: The dialog's @allow_shrink flag, ...
@ -226,7 +226,7 @@ GtkWidget *
gimp_dialog_newv (const gchar *title,
const gchar *wmclass_name,
GimpHelpFunc help_func,
const gchar *help_data,
const gchar *help_id,
GtkWindowPosition position,
gint allow_shrink,
gint allow_grow,
@ -256,7 +256,7 @@ gimp_dialog_newv (const gchar *title,
/* connect the "F1" help key */
if (help_func)
gimp_help_connect (dialog, help_func, help_data);
gimp_help_connect (dialog, help_func, help_id, dialog);
return dialog;
}

View File

@ -56,7 +56,7 @@ GType gimp_dialog_get_type (void) G_GNUC_CONST;
GtkWidget * gimp_dialog_new (const gchar *title,
const gchar *wmclass_name,
GimpHelpFunc help_func,
const gchar *help_data,
const gchar *help_id,
GtkWindowPosition position,
gint allow_shrink,
gint allow_grow,
@ -78,7 +78,7 @@ GtkWidget * gimp_dialog_new (const gchar *title,
GtkWidget * gimp_dialog_newv (const gchar *title,
const gchar *wmclass_name,
GimpHelpFunc help_func,
const gchar *help_data,
const gchar *help_id,
GtkWindowPosition position,
gint allow_shrink,
gint allow_grow,

View File

@ -8,10 +8,10 @@
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* 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
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
@ -22,9 +22,8 @@
#include "config.h"
#include <gdk/gdkkeysyms.h>
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
#ifdef __GNUC__
#warning GTK_DISABLE_DEPRECATED
@ -51,7 +50,8 @@ typedef enum
/* local function prototypes */
static const gchar * gimp_help_get_help_data (GtkWidget *widget,
GtkWidget **help_widget);
GtkWidget **help_widget,
gpointer *ret_data);
static gboolean gimp_help_callback (GtkWidget *widget,
GtkWidgetHelpType help_type,
GimpHelpFunc help_func);
@ -122,7 +122,8 @@ gimp_help_disable_tooltips (void)
}
void
gimp_standard_help_func (const gchar *help_data)
gimp_standard_help_func (const gchar *help_id,
gpointer data)
{
if (! _gimp_standard_help_func)
{
@ -131,7 +132,7 @@ gimp_standard_help_func (const gchar *help_data)
return;
}
(* _gimp_standard_help_func) (help_data);
(* _gimp_standard_help_func) (help_id, data);
}
/**
@ -139,7 +140,8 @@ gimp_standard_help_func (const gchar *help_data)
* @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.
* @help_id: The help_id which will be passed to @help_func.
* @help_data: The help_data pointer which will be passed to @help_func.
*
* Note that this function is automatically called by all libgimp dialog
* constructors. You only have to call it for windows/dialogs you created
@ -148,7 +150,8 @@ gimp_standard_help_func (const gchar *help_data)
void
gimp_help_connect (GtkWidget *widget,
GimpHelpFunc help_func,
const gchar *help_data)
const gchar *help_id,
gpointer help_data)
{
g_return_if_fail (GTK_IS_WIDGET (widget));
g_return_if_fail (help_func != NULL);
@ -189,7 +192,9 @@ gimp_help_connect (GtkWidget *widget,
gtk_widget_realize (tips_query);
}
gimp_help_set_help_data (widget, NULL, help_data);
gimp_help_set_help_data (widget, NULL, help_id);
g_object_set_data (G_OBJECT (widget), "gimp-help-data", help_data);
g_signal_connect (widget, "show_help",
G_CALLBACK (gimp_help_callback),
@ -200,45 +205,29 @@ gimp_help_connect (GtkWidget *widget,
/**
* gimp_help_set_help_data:
* @widget: The #GtkWidget you want to set a @tooltip and/or @help_data for.
* @widget: The #GtkWidget you want to set a @tooltip and/or @help_data for.
* @tooltip: The text for this widget's tooltip (or %NULL).
* @help_data: The @help_data for the #GtkTipsQuery tooltips inspector.
* @help_id: The @help_id for the #GtkTipsQuery tooltips inspector.
*
* 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
* impossible to set a @private_tip (aka @help_id) without a visible
* @tooltip.
*
* This function can be called with %NULL for @tooltip. Use this feature
* if you want to set a HTML help link for a widget which shouldn't have
* if you want to set a 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.
**/
void
gimp_help_set_help_data (GtkWidget *widget,
const gchar *tooltip,
const gchar *help_data)
const gchar *help_id)
{
g_return_if_fail (GTK_IS_WIDGET (widget));
if (tooltip)
{
gtk_tooltips_set_tip (tool_tips, widget, tooltip, help_data);
}
else if (help_data)
{
g_object_set_data (G_OBJECT (widget), "gimp_help_data",
(gpointer) help_data);
}
gtk_tooltips_set_tip (tool_tips, widget, tooltip, help_id);
else
g_object_set_data (G_OBJECT (widget), "gimp-help-id", (gpointer) help_id);
}
/**
@ -249,10 +238,10 @@ gimp_help_set_help_data (GtkWidget *widget,
* 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
* If the widget the user clicked on has a @help_id string attached
* (see gimp_help_set_help_data()), the corresponding help 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
* until it finds an attached @help_id string (which should be the
* case at least for every window/dialog).
**/
void
@ -267,29 +256,36 @@ gimp_context_help (void)
static const gchar *
gimp_help_get_help_data (GtkWidget *widget,
GtkWidget **help_widget)
GtkWidget **help_widget,
gpointer *ret_data)
{
GtkTooltipsData *tooltips_data;
gchar *help_data = NULL;
gchar *help_id = NULL;
gpointer 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;
help_id = tooltips_data->tip_private;
}
else
{
help_data = g_object_get_data (G_OBJECT (widget), "gimp_help_data");
help_id = g_object_get_data (G_OBJECT (widget), "gimp-help-id");
}
if (help_data)
help_data = g_object_get_data (G_OBJECT (widget), "gimp-help-data");
if (help_id)
{
if (help_widget)
*help_widget = widget;
return (const gchar *) help_data;
if (ret_data)
*ret_data = help_data;
return (const gchar *) help_id;
}
}
@ -306,11 +302,23 @@ gimp_help_callback (GtkWidget *widget,
case GIMP_WIDGET_HELP_TYPE_HELP:
if (help_func)
{
gchar *help_data;
GtkTooltipsData *tooltips_data;
gchar *help_id = NULL;
gpointer help_data = NULL;
help_data = g_object_get_data (G_OBJECT (widget), "gimp_help_data");
if ((tooltips_data = gtk_tooltips_data_get (widget)) &&
tooltips_data->tip_private)
{
help_id = tooltips_data->tip_private;
}
else
{
help_id = g_object_get_data (G_OBJECT (widget), "gimp-help-id");
}
(* help_func) (help_data);
help_data = g_object_get_data (G_OBJECT (widget), "gimp-help-data");
(* help_func) (help_id, help_data);
}
return TRUE;
@ -337,33 +345,14 @@ static gboolean
gimp_help_tips_query_idle_show_help (gpointer data)
{
GtkWidget *help_widget;
const gchar *help_data = NULL;
const gchar *help_id = NULL;
gpointer help_data = NULL;
help_data = gimp_help_get_help_data (GTK_WIDGET (data), &help_widget);
help_id = gimp_help_get_help_data (GTK_WIDGET (data), &help_widget,
&help_data);
if (help_data)
{
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);
}
}
else
{
gimp_standard_help_func (help_data);
}
}
if (help_id)
gimp_standard_help_func (help_id, help_data);
return FALSE;
}

View File

@ -35,17 +35,19 @@ void gimp_help_disable_tooltips (void);
/* the standard gimp help function
*/
void gimp_standard_help_func (const gchar *help_data);
void gimp_standard_help_func (const gchar *help_id,
gpointer help_data);
/* connect the help callback of a window */
void gimp_help_connect (GtkWidget *widget,
GimpHelpFunc help_func,
const gchar *help_data);
const gchar *help_id,
gpointer help_data);
/* set help data for non-window widgets */
void gimp_help_set_help_data (GtkWidget *widget,
const gchar *tooltip,
const gchar *help_data);
const gchar *help_id);
/* activate the context help inspector */
void gimp_context_help (void);

View File

@ -658,7 +658,7 @@ gimp_scale_entry_new_internal (gboolean color_scale,
gdouble unconstrained_lower,
gdouble unconstrained_upper,
const gchar *tooltip,
const gchar *help_data)
const gchar *help_id)
{
GtkWidget *label;
GtkWidget *scale;
@ -749,10 +749,10 @@ gimp_scale_entry_new_internal (gboolean color_scale,
GTK_SHRINK, GTK_SHRINK, 0, 0);
gtk_widget_show (spinbutton);
if (tooltip || help_data)
if (tooltip || help_id)
{
gimp_help_set_help_data (scale, tooltip, help_data);
gimp_help_set_help_data (spinbutton, tooltip, help_data);
gimp_help_set_help_data (scale, tooltip, help_id);
gimp_help_set_help_data (spinbutton, tooltip, help_id);
}
g_object_set_data (G_OBJECT (return_adj), "label", label);
@ -784,7 +784,7 @@ gimp_scale_entry_new_internal (gboolean color_scale,
* @unconstrained_upper: The spinbutton's upper boundary
* if @constrain == %FALSE.
* @tooltip: A tooltip message for the scale and the spinbutton.
* @help_data: The widgets' help_data (see gimp_help_set_help_data()).
* @help_id: The widgets' help_id (see gimp_help_set_help_data()).
*
* This function creates a #GtkLabel, a #GtkHScale and a #GtkSpinButton and
* attaches them to a 3-column #GtkTable.
@ -808,7 +808,7 @@ gimp_scale_entry_new (GtkTable *table,
gdouble unconstrained_lower,
gdouble unconstrained_upper,
const gchar *tooltip,
const gchar *help_data)
const gchar *help_id)
{
return gimp_scale_entry_new_internal (FALSE,
table, column, row,
@ -819,7 +819,7 @@ gimp_scale_entry_new (GtkTable *table,
constrain,
unconstrained_lower,
unconstrained_upper,
tooltip, help_data);
tooltip, help_id);
}
/**
@ -838,7 +838,7 @@ gimp_scale_entry_new (GtkTable *table,
* @page_increment: The page increment.
* @digits: The number of decimal digits.
* @tooltip: A tooltip message for the scale and the spinbutton.
* @help_data: The widgets' help_data (see gimp_help_set_help_data()).
* @help_id: The widgets' help_id (see gimp_help_set_help_data()).
*
* This function creates a #GtkLabel, a #GimpColorScale and a
* #GtkSpinButton and attaches them to a 3-column #GtkTable.
@ -859,7 +859,7 @@ gimp_color_scale_entry_new (GtkTable *table,
gdouble page_increment,
guint digits,
const gchar *tooltip,
const gchar *help_data)
const gchar *help_id)
{
return gimp_scale_entry_new_internal (TRUE,
table, column, row,
@ -868,7 +868,7 @@ gimp_color_scale_entry_new (GtkTable *table,
step_increment, page_increment,
digits,
TRUE, 0.0, 0.0,
tooltip, help_data);
tooltip, help_id);
}
/**

View File

@ -168,7 +168,7 @@ GtkObject * gimp_scale_entry_new (GtkTable *table,
gdouble unconstrained_lower,
gdouble unconstrained_upper,
const gchar *tooltip,
const gchar *help_data);
const gchar *help_id);
GtkObject * gimp_color_scale_entry_new (GtkTable *table,
gint column,
@ -183,7 +183,7 @@ GtkObject * gimp_color_scale_entry_new (GtkTable *table,
gdouble page_increment,
guint digits,
const gchar *tooltip,
const gchar *help_data);
const gchar *help_id);
void gimp_scale_entry_set_sensitive (GtkObject *adjustment,
gboolean sensitive);

View File

@ -76,7 +76,8 @@ typedef struct _GimpSizeEntry GimpSizeEntry;
typedef struct _GimpUnitMenu GimpUnitMenu;
typedef void (* GimpHelpFunc) (const gchar *help_data);
typedef void (* GimpHelpFunc) (const gchar *help_id,
gpointer data);
G_END_DECLS

View File

@ -618,7 +618,7 @@ palette_dialog (const gchar *title)
NULL);
gimp_help_connect (dialog, gimp_standard_help_func,
"filters/cel.html");
"filters/cel.html", NULL);
gtk_widget_show (dialog);

View File

@ -620,16 +620,16 @@ CML_main_function (gint preview_p)
mem_chank2 = (guchar *) g_malloc (mem_chank2_size);
}
dest_buffer = mem_chank2;
if (! preview_p)
gimp_pixel_rgn_init (&dest_rgn, drawable, x1, y1,
width_by_pixel, height_by_pixel,
TRUE, TRUE);
gimp_pixel_rgn_init (&src_rgn, drawable, x1, y1,
width_by_pixel, height_by_pixel,
FALSE, FALSE);
gr = g_rand_new ();
if (VALS.initial_value == CML_INITIAL_RANDOM_FROM_SEED)
g_rand_set_seed (gr, VALS.seed);
@ -770,7 +770,7 @@ CML_main_function (gint preview_p)
if (height_by_pixel < dy + keep_height)
keep_height = height_by_pixel - dy;
if ((VALS.hue.function == CML_KEEP_VALUES) ||
(VALS.sat.function == CML_KEEP_VALUES) ||
(VALS.val.function == CML_KEEP_VALUES))
@ -802,7 +802,7 @@ CML_main_function (gint preview_p)
{
int rgbi[3];
int i;
for (i = 0; i < src_bpp; i++)
rgbi[i] = src_buffer[offset_y * src_bpl
+ (dx * VALS.scale + offset_x) * src_bpp + i];
@ -959,7 +959,7 @@ CML_next_value (gdouble *vec,
case MULTIPLY_GRADIENT:
{
gdouble tmp;
tmp = power;
power = param->power;
self_diff = self_mod_rate * LOGISTICS (vec[pos]);
@ -1435,7 +1435,7 @@ CML_explorer_dialog (void)
gtk_container_add (GTK_CONTAINER (frame), table);
gtk_widget_show (table);
optionmenu = gimp_option_menu_new2 (FALSE,
optionmenu = gimp_option_menu_new2 (FALSE,
G_CALLBACK (gimp_menu_item_update),
&copy_source, (gpointer) copy_source,
@ -1451,7 +1451,7 @@ CML_explorer_dialog (void)
_("Source Channel:"), 1.0, 0.5,
optionmenu, 1, TRUE);
optionmenu = gimp_option_menu_new2 (FALSE,
optionmenu = gimp_option_menu_new2 (FALSE,
G_CALLBACK (gimp_menu_item_update),
&copy_destination,
(gpointer) copy_destination,
@ -1488,7 +1488,7 @@ CML_explorer_dialog (void)
gtk_container_add (GTK_CONTAINER (frame), table);
gtk_widget_show (table);
optionmenu = gimp_option_menu_new2 (FALSE,
optionmenu = gimp_option_menu_new2 (FALSE,
G_CALLBACK (gimp_menu_item_update),
&selective_load_source,
(gpointer) selective_load_source,
@ -1507,7 +1507,7 @@ CML_explorer_dialog (void)
_("Source Channel in File:"), 1.0, 0.5,
optionmenu, 1, TRUE);
optionmenu = gimp_option_menu_new2 (FALSE,
optionmenu = gimp_option_menu_new2 (FALSE,
G_CALLBACK (gimp_menu_item_update),
&selective_load_destination,
(gpointer) selective_load_destination,
@ -2086,7 +2086,7 @@ CML_save_to_file_callback (GtkWidget *widget,
{
filesel = gtk_file_selection_new (_("Save Parameters to"));
gtk_window_set_position (GTK_WINDOW (filesel), GTK_WIN_POS_MOUSE);
g_signal_connect (GTK_FILE_SELECTION (filesel)->ok_button,
"clicked",
G_CALLBACK (CML_execute_save_to_file),
@ -2102,7 +2102,7 @@ CML_save_to_file_callback (GtkWidget *widget,
filesel);
gimp_help_connect (filesel, gimp_standard_help_func,
"filters/cml_explorer.html");
"filters/cml_explorer.html", NULL);
}
if (strlen (VALS.last_file_name) > 0)
@ -2299,25 +2299,25 @@ CML_load_from_file_callback (GtkWidget *widget,
"clicked",
G_CALLBACK (CML_execute_load_from_file),
filesel);
g_signal_connect_swapped(G_OBJECT(filesel), "delete_event",
G_CALLBACK (gtk_widget_hide),
filesel);
g_signal_connect_swapped (GTK_FILE_SELECTION (filesel)->cancel_button,
"clicked",
G_CALLBACK (gtk_widget_hide),
filesel);
gimp_help_connect (filesel, gimp_standard_help_func,
"filters/cml_explorer.html");
"filters/cml_explorer.html", NULL);
}
if ((selective_load_source == 0) || (selective_load_destination == 0))
gtk_window_set_title (GTK_WINDOW (filesel), _("Load Parameters from"));
else
gtk_window_set_title (GTK_WINDOW (filesel), _("Selective Load from"));
if (strlen (VALS.last_file_name) > 0)
gtk_file_selection_set_filename (GTK_FILE_SELECTION (filesel),
VALS.last_file_name);
@ -2455,7 +2455,7 @@ CML_load_parameter_file (const gchar *filename,
if (flag)
{
gint dummy;
if (fgets (line, CML_LINE_SIZE - 1, file) == NULL) /* skip a line */
dummy = 1;
else

View File

@ -110,7 +110,7 @@ query (void)
static void
run (const gchar *name,
gint n_params,
const GimpParam *param,
const GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals)
{
@ -130,7 +130,7 @@ run (const gchar *name,
{
status = GIMP_PDB_CALLING_ERROR;
}
if (status == GIMP_PDB_SUCCESS)
{
image_id = param[1].data.d_image;
@ -166,7 +166,6 @@ build_dialog (void)
GtkWidget *vbox;
GtkWidget *hbox;
GtkWidget *hbox2;
GtkTooltips *tooltips;
gimp_ui_init ("gee", TRUE);
@ -178,7 +177,8 @@ build_dialog (void)
G_CALLBACK (window_delete_callback),
NULL);
gimp_help_connect (dlg, gimp_standard_help_func, "filters/geeslime.html");
gimp_help_connect (dlg, gimp_standard_help_func,
"filters/geeslime.html", NULL);
/* Action area - 'close' button only. */
@ -193,14 +193,13 @@ build_dialog (void)
G_CALLBACK (window_close_callback),
dlg);
tooltips = gtk_tooltips_new ();
gtk_tooltips_set_tip (GTK_TOOLTIPS (tooltips), button,
_("A less-obsolete creation of Adam D. Moss / adam@gimp.org / adam@foxbox.org / 1998-2000"),
NULL);
gtk_tooltips_enable (tooltips);
gimp_help_set_help_data (button,
_("A less-obsolete creation of Adam D. Moss / "
"adam@gimp.org / adam@foxbox.org / 1998-2000"),
NULL);
/* The 'fun' half of the dialog */
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_ETCHED_IN);
@ -252,7 +251,7 @@ build_dialog (void)
(GSourceFunc) iteration_callback,
NULL,
NULL);
g_signal_connect (eventbox, "button_release_event",
G_CALLBACK (toggle_feedbacktype),
NULL);
@ -271,7 +270,7 @@ gen_llut(void)
for (i=0; i<256; i++)
{
/* k = i + RINT (((double)LIGHT) * pow(((double)i / 255.0), 0.5));
/* k = i + RINT (((double)LIGHT) * pow(((double)i / 255.0), 0.5));
k = i + ((LIGHT*i)/255); */
k = i + ((LIGHT*( /* (255*255)- */ i*i))/(255*255));
#if 0
@ -284,7 +283,7 @@ gen_llut(void)
}
static void
static void
do_fun (void)
{
imagetype = gimp_image_base_type(image_id);
@ -344,7 +343,7 @@ bumpbob(int x, int y, int size)
}
memset(&bump[x+(y+(size/2))*IWIDTH], 255, size);
*/
for (o=0; o<size; o++)
{
int p;
@ -364,7 +363,7 @@ bumpbob(int x, int y, int size)
/* Adam's sillier algorithm. */
static void
static void
iterate (void)
{
static guint frame = 0;
@ -407,7 +406,7 @@ iterate (void)
/* this setup obsolete, tranformation is constant */
/*if ((cx+bx) == 0)
cx++;
if ((cy+by) == 0)
by++;
@ -423,13 +422,13 @@ iterate (void)
*/
/* A little sub-pixel jitter to liven things up. */
basesx = (g_rand_int_range (gr, 0, 29<<19)/bycxmcybx) +
basesx = (g_rand_int_range (gr, 0, 29<<19)/bycxmcybx) +
((-128-((128*256)/(cx+bx)))<<11);
basesy = (g_rand_int_range (gr, 0, 29<<19)/bycxmcybx) + ((-128-((128*256)/(cy+by)))<<11);
basebump = srcbump;
#if 0
/* identity only */
j = IHEIGHT;
@ -451,7 +450,7 @@ iterate (void)
{
unsigned int tx;
unsigned int ty;
ty = (basesy+=cx2);
tx = (basesx-=bx2);
@ -480,7 +479,7 @@ iterate (void)
)
);
basebump++;
tx += by2;
ty -= cy2;
@ -569,7 +568,7 @@ iterate (void)
destbump = (frame&1) ? bump2 : bump1;
{
gint rxp, ryp, posx, posy;
GdkModifierType mask;
GdkModifierType mask;
gint size, i;
gdk_window_get_pointer (eventbox->window, &rxp, &ryp, &mask);
@ -579,10 +578,10 @@ iterate (void)
size = g_rand_int_range (gr, 1, BOBSIZE);
posx = rxp + BOBSPREAD/2 -
RINT(sqrt(g_rand_double_range (gr, 0, BOBSPREAD)) *
RINT(sqrt(g_rand_double_range (gr, 0, BOBSPREAD)) *
g_rand_int_range (gr, 0, BOBSPREAD));
posy = ryp + BOBSPREAD/2 -
RINT(sqrt(g_rand_double_range (gr, 0, BOBSPREAD)) *
RINT(sqrt(g_rand_double_range (gr, 0, BOBSPREAD)) *
g_rand_int_range (gr, 0, BOBSPREAD));
if (! ((posx>IWIDTH-size) ||
@ -604,9 +603,9 @@ render_frame (void)
if (frame==0)
{
gint i, bytes;
bytes = IWIDTH*IHEIGHT*4;
for (i=0;i<bytes;i++)
{
disp[i] = env[i];
@ -617,7 +616,7 @@ render_frame (void)
iterate();
show();
frame++;
}

View File

@ -146,7 +146,7 @@ query (void)
static void
run (const gchar *name,
gint n_params,
const GimpParam *param,
const GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals)
{
@ -155,7 +155,7 @@ run (const gchar *name,
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
gr = g_rand_new();
*nreturn_vals = 1;
*return_vals = values;
@ -168,7 +168,7 @@ run (const gchar *name,
{
status = GIMP_PDB_CALLING_ERROR;
}
if (status == GIMP_PDB_SUCCESS)
{
image_id = param[1].data.d_image;
@ -196,7 +196,6 @@ build_dialog (void)
GtkWidget *vbox;
GtkWidget *hbox;
GtkWidget *hbox2;
GtkTooltips *tooltips;
gimp_ui_init ("gee_zoom", TRUE);
@ -209,7 +208,8 @@ build_dialog (void)
G_CALLBACK (window_delete_callback),
NULL);
gimp_help_connect (dlg, gimp_standard_help_func, "filters/gee.html");
gimp_help_connect (dlg, gimp_standard_help_func,
"filters/gee.html", NULL);
/* Action area - 'close' button only. */
@ -224,14 +224,13 @@ build_dialog (void)
G_CALLBACK (window_close_callback),
dlg);
tooltips = gtk_tooltips_new ();
gtk_tooltips_set_tip (GTK_TOOLTIPS (tooltips), button,
_("An obsolete creation of Adam D. Moss / adam@gimp.org / adam@foxbox.org / 1998-2000"),
NULL);
gtk_tooltips_enable (tooltips);
gimp_help_set_help_data (button,
_("An obsolete creation of Adam D. Moss / "
"adam@gimp.org / adam@foxbox.org / 1998-2000"),
NULL);
/* The 'fun' half of the dialog */
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_ETCHED_IN);
@ -287,19 +286,19 @@ build_dialog (void)
gtk_widget_show (frame);
gtk_widget_show (dlg);
idle_tag = g_idle_add_full (G_PRIORITY_LOW,
(GSourceFunc) iteration_callback,
NULL,
NULL);
g_signal_connect (eventbox, "button_release_event",
G_CALLBACK (toggle_feedbacktype),
NULL);
}
static void
static void
init_lut (void)
{
gint i;
@ -313,7 +312,7 @@ init_lut (void)
}
static void
static void
do_fun (void)
{
imagetype = gimp_image_base_type(image_id);
@ -328,7 +327,7 @@ do_fun (void)
build_dialog ();
init_lut();
render_frame();
show_frame();
@ -340,7 +339,7 @@ do_fun (void)
/* Rendering Functions */
/* Adam's silly algorithm. */
static void
static void
domap1 (unsigned char *src, unsigned char *dest,
int bx, int by, int cx, int cy)
{
@ -367,9 +366,9 @@ domap1 (unsigned char *src, unsigned char *dest,
bycxmcybx = 1;
/* A little sub-pixel jitter to liven things up. */
basesx = ((g_rand_int_range (gr, 0, 29<<19)/bycxmcybx)) +
basesx = ((g_rand_int_range (gr, 0, 29<<19)/bycxmcybx)) +
((-128-((128*256)/(cx+bx)))<<11);
basesy = ((g_rand_int_range (gr, 0, 29<<19)/bycxmcybx)) +
basesy = ((g_rand_int_range (gr, 0, 29<<19)/bycxmcybx)) +
((-128-((128*256)/(cy+by)))<<11);
bx2 = ((bx)<<19)/bycxmcybx;
@ -416,7 +415,7 @@ domap1 (unsigned char *src, unsigned char *dest,
}
/* 3bypp variant */
static void
static void
domap3(unsigned char *src, unsigned char *dest,
int bx, int by, int cx, int cy)
{
@ -443,9 +442,9 @@ domap3(unsigned char *src, unsigned char *dest,
bycxmcybx = 1;
/* A little sub-pixel jitter to liven things up. */
basesx = ((g_rand_int_range (gr, 0, 29<<19)/bycxmcybx)) +
basesx = ((g_rand_int_range (gr, 0, 29<<19)/bycxmcybx)) +
((-128-((128*256)/(cx+bx)))<<11);
basesy = ((g_rand_int_range (gr, 0, 29<<19)/bycxmcybx)) +
basesy = ((g_rand_int_range (gr, 0, 29<<19)/bycxmcybx)) +
((-128-((128*256)/(cy+by)))<<11);
bx2 = ((bx)<<19)/bycxmcybx;
@ -457,8 +456,8 @@ domap3(unsigned char *src, unsigned char *dest,
{
unsigned int sx;
unsigned int sy;
unsigned int dx;
unsigned int dx;
sy = (basesy+=cx2);
sx = (basesx-=bx2);
@ -467,13 +466,13 @@ domap3(unsigned char *src, unsigned char *dest,
sx += wigglelut[(((basesy)>>11)+grrr) & LUTSIZEMASK];
sy += wigglelut[(((basesx)>>11)+(grrr/3)) & LUTSIZEMASK];
}
dx = 256;
do
{
unsigned char* addr;
addr = src + 3*
(
(
@ -486,11 +485,11 @@ domap3(unsigned char *src, unsigned char *dest,
))<<8)))
)
);
*dest++ = *(addr);
*dest++ = *(addr+1);
*dest++ = *(addr+2);
sx += by2;
sy -= cy2;
}
@ -601,7 +600,7 @@ render_frame (void)
((seedwords[i] >> 1) & 0x7f7f7f7f) +
(prevwords[i] & seedwords[i] & 0x01010101); */
}
}
}
}
}
else /* GRAYSCALE */
@ -662,7 +661,7 @@ render_frame (void)
((seedwords[i] >> 1) & 0x7f7f7f7f) +
(prevwords[i] & seedwords[i] & 0x01010101); */
}
}
}
}
}
@ -877,7 +876,7 @@ toggle_feedbacktype (GtkWidget *widget,
if (bevent->state & (GDK_SHIFT_MASK | GDK_CONTROL_MASK | GDK_MOD1_MASK))
{
wiggleamp = bevent->x/5;
wiggly = TRUE;
init_lut();

View File

@ -3,10 +3,10 @@
* This program is based on an algorithm / article by
* Jörn Loviscach.
*
* It appeared in c't 10/95, page 326 and is called
* It appeared in c't 10/95, page 326 and is called
* "Ausgewürfelt - Moderne Kunst algorithmisch erzeugen"
* (~modern art created with algorithms).
*
*
* It generates one main formula (the middle button) and 8 variations of it.
* If you select a variation it becomes the new main formula. If you
* press "OK" the main formula will be applied to the image.
@ -16,7 +16,7 @@
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* 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.
@ -33,16 +33,16 @@
* 1.2 now handles RGB*
* 1.5 fixed a small bug
* 1.6 fixed a bug that was added by v1.5 :-(
* 1.7 added patch from Art Haas to make it compile with HP-UX, a small
* 1.7 added patch from Art Haas to make it compile with HP-UX, a small
* clean-up
* 1.8 Dscho added transform file load/save, bug-fixes
* 1.8 Dscho added transform file load/save, bug-fixes
* 1.9 rewrote renderloop.
* 1.9a fixed a bug.
* 1.9b fixed MAIN()
* 1.10 added optimizer
* 1.11 uses tile iterator, antialiasing thanks to Simon Thum, compiles
* 1.11 uses tile iterator, antialiasing thanks to Simon Thum, compiles
* outside GIMP-tree
* 1.12 small fix to behave more like the original, button to control
* 1.12 small fix to behave more like the original, button to control
* antialaising, remeber last used filename, bugfixes+cleanups
*/
@ -174,22 +174,22 @@ modify_info (ExpInfo *o_info,
switch (g_rand_int_range (gr, 0, 4))
{
case 0:
n_info->transformSequence[g_rand_int_range (gr, 0, MAX_TRANSFORMS)] =
n_info->transformSequence[g_rand_int_range (gr, 0, MAX_TRANSFORMS)] =
g_rand_int_range (gr, 0, NUM_TRANSFORMS);
break;
case 1:
n_info->source[g_rand_int_range (gr, 0, MAX_TRANSFORMS)] =
n_info->source[g_rand_int_range (gr, 0, MAX_TRANSFORMS)] =
g_rand_int_range (gr, 0, NUM_REGISTERS);
break;
case 2:
n_info->control[g_rand_int_range (gr, 0, MAX_TRANSFORMS)] =
n_info->control[g_rand_int_range (gr, 0, MAX_TRANSFORMS)] =
g_rand_int_range (gr, 0, NUM_REGISTERS);
break;
case 3:
n_info->dest[g_rand_int_range (gr, 0, MAX_TRANSFORMS)] =
n_info->dest[g_rand_int_range (gr, 0, MAX_TRANSFORMS)] =
g_rand_int_range (gr, 0, NUM_REGISTERS);
break;
}
@ -304,9 +304,9 @@ qbist (ExpInfo *info,
{
gfloat scalarProd;
scalarProd = (reg[sr][0] * reg[cr][0]) +
scalarProd = (reg[sr][0] * reg[cr][0]) +
(reg[sr][1] * reg[cr][1]) + (reg[sr][2] * reg[cr][2]);
reg[dr][0] = scalarProd * reg[sr][0];
reg[dr][1] = scalarProd * reg[sr][1];
reg[dr][2] = scalarProd * reg[sr][2];
@ -394,7 +394,7 @@ qbist (ExpInfo *info,
{
if (i < 3)
{
buffer[i] = (guchar) (((gfloat) accum[i] /
buffer[i] = (guchar) (((gfloat) accum[i] /
(gfloat) (oversampling * oversampling)) + 0.5);
}
else
@ -527,40 +527,40 @@ run (const gchar *name,
gimp_tile_cache_ntiles ((drawable->width + gimp_tile_width () - 1) /
gimp_tile_width ());
gimp_pixel_rgn_init (&imagePR, drawable,
gimp_pixel_rgn_init (&imagePR, drawable,
0, 0, img_width, img_height, TRUE, TRUE);
optimize (&qbist_info.info);
gimp_progress_init (_("Qbist ..."));
for (pr = gimp_pixel_rgns_register (1, &imagePR);
pr != NULL;
for (pr = gimp_pixel_rgns_register (1, &imagePR);
pr != NULL;
pr = gimp_pixel_rgns_process (pr))
{
gint row;
for (row = 0; row < imagePR.h; row++)
{
qbist (&qbist_info.info,
imagePR.data + row * imagePR.rowstride,
imagePR.x,
imagePR.y + row,
imagePR.w,
sel_x2 - sel_x1,
sel_y2 - sel_y1,
imagePR.bpp,
qbist (&qbist_info.info,
imagePR.data + row * imagePR.rowstride,
imagePR.x,
imagePR.y + row,
imagePR.w,
sel_x2 - sel_x1,
sel_y2 - sel_y1,
imagePR.bpp,
qbist_info.oversampling);
}
gimp_progress_update ((gfloat) (imagePR.y - sel_y1) /
gimp_progress_update ((gfloat) (imagePR.y - sel_y1) /
(gfloat) (sel_y2 - sel_y1));
}
gimp_drawable_flush (drawable);
gimp_drawable_merge_shadow (drawable->drawable_id, TRUE);
gimp_drawable_update (drawable->drawable_id,
sel_x1, sel_y1,
gimp_drawable_update (drawable->drawable_id,
sel_x1, sel_y1,
(sel_x2 - sel_x1), (sel_y2 - sel_y1));
gimp_displays_flush ();
@ -638,7 +638,7 @@ get_be16 (guint8 *buf)
}
static void
set_be16 (guint8 *buf,
set_be16 (guint8 *buf,
guint16 val)
{
buf[0] = val >> 8;
@ -665,7 +665,7 @@ load_data (gchar *name)
fclose (f);
for (i = 0; i < MAX_TRANSFORMS; i++)
info[0].transformSequence[i] =
info[0].transformSequence[i] =
get_be16 (buf + i * 2 + MAX_TRANSFORMS * 2 * 0);
for (i = 0; i < MAX_TRANSFORMS; i++)
@ -694,7 +694,7 @@ save_data (gchar *name)
}
for (i = 0; i < MAX_TRANSFORMS; i++)
set_be16 (buf + i * 2 + MAX_TRANSFORMS * 2 * 0,
set_be16 (buf + i * 2 + MAX_TRANSFORMS * 2 * 0,
info[0].transformSequence[i]);
for (i = 0; i < MAX_TRANSFORMS; i++)
@ -716,7 +716,8 @@ static void
file_selection_save (GtkWidget *widget,
GtkWidget *file_select)
{
strcpy (qbist_info.path, gtk_file_selection_get_filename (GTK_FILE_SELECTION (file_select)));
strcpy (qbist_info.path,
gtk_file_selection_get_filename (GTK_FILE_SELECTION (file_select)));
save_data (qbist_info.path);
gtk_widget_destroy (file_select);
@ -726,7 +727,7 @@ static void
file_selection_load (GtkWidget *widget,
GtkWidget *file_select)
{
strcpy (qbist_info.path,
strcpy (qbist_info.path,
gtk_file_selection_get_filename (GTK_FILE_SELECTION (file_select)));
load_data (qbist_info.path);
gtk_widget_destroy (file_select);
@ -743,7 +744,7 @@ dialog_load (GtkWidget *widget,
file_select = gtk_file_selection_new (_("Load QBE file..."));
gimp_help_connect (file_select, gimp_standard_help_func,
"filters/gqbist.html");
"filters/gqbist.html", NULL);
gtk_file_selection_set_filename (GTK_FILE_SELECTION (file_select),
qbist_info.path);
@ -770,9 +771,9 @@ dialog_save (GtkWidget *widget,
gtk_file_selection_new (_("Save (middle transform) as QBE file..."));
gimp_help_connect (file_select, gimp_standard_help_func,
"filters/gqbist.html");
"filters/gqbist.html", NULL);
gtk_file_selection_set_filename (GTK_FILE_SELECTION (file_select),
gtk_file_selection_set_filename (GTK_FILE_SELECTION (file_select),
qbist_info.path);
g_signal_connect (GTK_FILE_SELECTION (file_select)->ok_button,
@ -791,7 +792,7 @@ static void
dialog_toggle_antialaising (GtkWidget *widget,
gpointer data)
{
qbist_info.oversampling =
qbist_info.oversampling =
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)) ? 4 : 1;
}
@ -841,7 +842,7 @@ dialog_create (void)
for (i = 0; i < 9; i++)
{
button = gtk_button_new ();
gtk_table_attach (GTK_TABLE (table),
gtk_table_attach (GTK_TABLE (table),
button, i % 3, (i % 3) + 1, i / 3, (i / 3) + 1,
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
gtk_widget_show (button);
@ -857,7 +858,7 @@ dialog_create (void)
}
button = gtk_check_button_new_with_mnemonic (_("_Antialiasing"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
qbist_info.oversampling > 1);
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
gtk_widget_show (button);

View File

@ -301,7 +301,7 @@ static void drawcolor2 (GtkWidget *widget);
static void render (void);
static void realrender (GimpDrawable *drawable);
static void fileselect (gint);
static gint traceray (ray * r, GimpVector4 * col, gint level,
static gint traceray (ray * r, GimpVector4 * col, gint level,
gdouble imp);
static gdouble turbulence (gdouble *point, gdouble lofreq, gdouble hifreq);
@ -1274,7 +1274,7 @@ objnormal (GimpVector4 *res, common *obj, GimpVector4 *p)
}
}
/*
/*
Quality:
0 = Color only
1 = Textures
@ -2172,7 +2172,7 @@ fileselect (gint action)
windows[action]);
gimp_help_connect (windows[action], gimp_standard_help_func,
"filters/spheredesigner.html");
"filters/spheredesigner.html", NULL);
}
gtk_widget_show (windows[action]);
}
@ -2188,7 +2188,7 @@ initworld (void)
s.a.x = s.a.y = s.a.z = 0.0;
s.r = 4.0;
/* not: world.obj[0] = s;
/* not: world.obj[0] = s;
* s is a sphere so error C2115: '=' : incompatible types
*/
memcpy (&world.obj[0], &s, sizeof (s));
@ -2467,10 +2467,10 @@ makewindow (void)
GIMP_STOCK_RESET,
sphere_reset, NULL, NULL, NULL, FALSE, FALSE,
GTK_STOCK_CANCEL,
sphere_cancel, NULL, NULL, NULL, FALSE, TRUE,
GTK_STOCK_OK,
sphere_ok, NULL, NULL, NULL, TRUE, FALSE,
@ -2980,7 +2980,7 @@ render (void)
#if CONTINOUS_UPDATE
drawit ();
while (gtk_events_pending ())
gtk_main_iteration ();
#endif

View File

@ -487,7 +487,8 @@ make_file_dlg (void)
G_CALLBACK (file_cancel_callback),
file_dlg);
gimp_help_connect (file_dlg, gimp_standard_help_func, "filters/flame.html");
gimp_help_connect (file_dlg, gimp_standard_help_func,
"filters/flame.html", NULL);
}
static void

View File

@ -85,10 +85,10 @@ GtkWidget *
fp_create_bna (void)
{
GtkWidget *frame, *blabel, *alabel, *bframe, *aframe, *table;
Create_A_Preview (&origPreview, &bframe, reduced->width, reduced->height);
Create_A_Preview (&curPreview, &aframe, reduced->width, reduced->height);
frame = gtk_frame_new (_("Before and After"));
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_ETCHED_IN);
@ -107,7 +107,7 @@ fp_create_bna (void)
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
gtk_container_add (GTK_CONTAINER (frame), table);
gtk_table_attach (GTK_TABLE (table), blabel, 0, 1, 0, 1,
0, GTK_EXPAND | GTK_FILL, 0, 0);
@ -181,7 +181,7 @@ fp_create_circle_palette (void)
Create_A_Table_Entry (&yVbox, yFrame, hue_yellow);
Create_A_Table_Entry (&mVbox, mFrame, hue_magenta);
Create_A_Table_Entry (&centerVbox, centerFrame, current_val);
gtk_table_attach (GTK_TABLE (table), rVbox, 8, 11 ,4 , 7,
GTK_EXPAND , GTK_EXPAND, 0 ,0);
gtk_table_attach (GTK_TABLE (table), gVbox, 2, 5, 0, 3,
@ -199,7 +199,8 @@ fp_create_circle_palette (void)
win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gimp_help_connect (win, gimp_standard_help_func, "filters/fp.html");
gimp_help_connect (win, gimp_standard_help_func,
"filters/fp.html", NULL);
gtk_window_set_title (GTK_WINDOW (win), _("Hue Variations"));
gtk_container_add (GTK_CONTAINER (win), frame);
@ -231,14 +232,14 @@ fp_create_rough (void)
g_signal_connect (data, "value_changed",
G_CALLBACK (fp_scale_update),
&Current.Rough);
&Current.Rough);
vbox = gtk_vbox_new (FALSE, 2);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 4);
gtk_widget_show (vbox);
gtk_box_pack_start (GTK_BOX (vbox), scale, FALSE, FALSE, 0);
gtk_container_add (GTK_CONTAINER( frame), vbox);
return frame;
}
@ -250,23 +251,23 @@ fp_create_range (void)
frame = gtk_frame_new (_("Affected Range"));
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_ETCHED_IN);
gtk_widget_show (frame);
vbox = gtk_vbox_new (FALSE, 2);
gtk_container_add (GTK_CONTAINER (frame), vbox);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 4);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 4);
gtk_widget_show (vbox);
group = Button_In_A_Box (vbox, group, _("Sha_dows"),
group = Button_In_A_Box (vbox, group, _("Sha_dows"),
GTK_SIGNAL_FUNC (fp_change_current_range),
ShMidHi + SHADOWS,
Current.Range == SHADOWS);
group = Button_In_A_Box (vbox, group, _("_Midtones"),
group = Button_In_A_Box (vbox, group, _("_Midtones"),
GTK_SIGNAL_FUNC (fp_change_current_range),
ShMidHi + MIDTONES,
Current.Range == MIDTONES);
group = Button_In_A_Box (vbox, group, _("H_ighlights"),
group = Button_In_A_Box (vbox, group, _("H_ighlights"),
GTK_SIGNAL_FUNC (fp_change_current_range),
ShMidHi + HIGHLIGHTS,
Current.Range == HIGHLIGHTS);
@ -281,12 +282,12 @@ fp_create_control (void)
frame = gtk_frame_new (_("Windows"));
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_ETCHED_IN);
gtk_widget_show (frame);
box = gtk_vbox_new (FALSE, 2);
gtk_container_add (GTK_CONTAINER (frame), box);
gtk_container_set_border_width (GTK_CONTAINER (box), 4);
gtk_container_set_border_width (GTK_CONTAINER (box), 4);
gtk_widget_show (box);
Frames_Check_Button_In_A_Box (box, _("_Hue"),
@ -304,7 +305,7 @@ fp_create_control (void)
Frames_Check_Button_In_A_Box (box, _("A_dvanced"),
GTK_SIGNAL_FUNC (fp_show_hide_frame),
AW.window,
FALSE);
FALSE);
return frame;
}
@ -322,7 +323,7 @@ fp_create_lnd (void)
reduced->width, reduced->height);
Create_A_Preview (&darkerPreview, &darkerFrame,
reduced->width, reduced->height);
Create_A_Table_Entry (&lighterVbox, lighterFrame, val_lighter);
Create_A_Table_Entry (&middleVbox, middleFrame, current_val);
Create_A_Table_Entry (&darkerVbox, darkerFrame, val_darker);
@ -336,7 +337,7 @@ fp_create_lnd (void)
gtk_table_set_col_spacings (GTK_TABLE (table), 2);
gtk_widget_show (table);
gtk_table_attach (GTK_TABLE (table), lighterVbox, 0, 3, 0, 1,
GTK_EXPAND , GTK_EXPAND, 0, 0);
gtk_table_attach (GTK_TABLE (table), middleVbox, 4, 7, 0, 1,
@ -347,7 +348,8 @@ fp_create_lnd (void)
win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gimp_help_connect (win, gimp_standard_help_func, "filters/fp.html");
gimp_help_connect (win, gimp_standard_help_func,
"filters/fp.html", NULL);
gtk_window_set_title (GTK_WINDOW (win), _("Value Variations"));
gtk_container_add (GTK_CONTAINER (win), frame);
@ -355,7 +357,7 @@ fp_create_lnd (void)
g_signal_connect (win, "delete_event",
G_CALLBACK (sub_dialog_destroy),
NULL);
return win;
}
@ -365,14 +367,14 @@ fp_create_msnls (void)
GtkWidget *frame, *table, *lessFrame, *middleFrame, *moreFrame;
GtkWidget *lessVbox, *middleVbox, *moreVbox;
GtkWidget *win;
Create_A_Preview (&minusSatPreview, &lessFrame,
reduced->width, reduced->height);
Create_A_Preview (&SatPreview, &middleFrame,
reduced->width, reduced->height);
Create_A_Preview (&plusSatPreview, &moreFrame,
reduced->width, reduced->height);
Create_A_Table_Entry (&moreVbox, moreFrame, sat_more);
Create_A_Table_Entry (&middleVbox, middleFrame, current_val);
Create_A_Table_Entry (&lessVbox, lessFrame, sat_less);
@ -396,7 +398,8 @@ fp_create_msnls (void)
win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gimp_help_connect (win, gimp_standard_help_func, "filters/fp.html");
gimp_help_connect (win, gimp_standard_help_func,
"filters/fp.html", NULL);
gtk_window_set_title (GTK_WINDOW (win), _("Saturation Variations"));
gtk_container_add (GTK_CONTAINER (win), frame);
@ -420,18 +423,18 @@ fp_create_pixels_select_by (void)
vbox = gtk_vbox_new (FALSE, 2);
gtk_container_add (GTK_CONTAINER (frame), vbox);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 4);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 4);
gtk_widget_show (vbox);
group = Button_In_A_Box (vbox, group, _("H_ue"),
group = Button_In_A_Box (vbox, group, _("H_ue"),
GTK_SIGNAL_FUNC (fp_change_current_pixels_by),
HueSatVal + 0,
Current.ValueBy == BY_HUE);
group = Button_In_A_Box (vbox,group, _("Satu_ration"),
group = Button_In_A_Box (vbox,group, _("Satu_ration"),
GTK_SIGNAL_FUNC (fp_change_current_pixels_by),
HueSatVal + 1,
Current.ValueBy == BY_SAT);
group = Button_In_A_Box (vbox,group, _("V_alue"),
group = Button_In_A_Box (vbox,group, _("V_alue"),
GTK_SIGNAL_FUNC (fp_change_current_pixels_by),
HueSatVal + 2,
Current.ValueBy == BY_VAL);
@ -449,7 +452,7 @@ fp_create_show (void)
vbox = gtk_vbox_new (FALSE, 2);
gtk_container_add (GTK_CONTAINER (frame), vbox);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 4);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 4);
gtk_widget_show (vbox);
group = Button_In_A_Box (vbox, group, _("_Entire Image"),
@ -462,7 +465,7 @@ fp_create_show (void)
&Current.SlctnOnly,
TRUE);
group = Button_In_A_Box (vbox, group, _("Selec_tion In Context"),
group = Button_In_A_Box (vbox, group, _("Selec_tion In Context"),
GTK_SIGNAL_FUNC (fp_selection_in_context),
&Current.SlctnOnly,
FALSE);
@ -482,7 +485,7 @@ fp_create_frame_select (void)
box = gtk_hbox_new (FALSE, 8);
gtk_container_add (GTK_CONTAINER (frame), box);
gtk_container_set_border_width (GTK_CONTAINER (box),4);
gtk_container_set_border_width (GTK_CONTAINER (box),4);
gtk_widget_show (box);
Check_Button_In_A_Box (box, _("CirclePalette"),
@ -656,7 +659,7 @@ fp_entire_image (GtkWidget *button,
return;
Current.SlctnOnly = 0;
fp_redraw_all_windows ();
}
}
void
fp_selection_only (GtkWidget *button,
@ -685,7 +688,7 @@ fp_selection_in_context (GtkWidget *button,
}
void
fp_show_hide_frame (GtkWidget *button,
fp_show_hide_frame (GtkWidget *button,
GtkWidget *frame)
{
gint prev = Current.VisibleFrames;
@ -699,7 +702,7 @@ fp_show_hide_frame (GtkWidget *button,
{
gtk_widget_show (frame);
if (frame==fpFrames.palette)
if (frame==fpFrames.palette)
Current.VisibleFrames |= HUE;
else if (frame==fpFrames.satur)
Current.VisibleFrames |= SATURATION;
@ -708,14 +711,14 @@ fp_show_hide_frame (GtkWidget *button,
refreshPreviews (Current.VisibleFrames & ~prev);
}
}
}
else
{
if (GTK_WIDGET_VISIBLE (frame))
{
gtk_widget_hide (frame);
if (frame==fpFrames.palette)
if (frame==fpFrames.palette)
Current.VisibleFrames &= ~HUE;
else if (frame==fpFrames.satur)
Current.VisibleFrames &= ~SATURATION;
@ -746,12 +749,12 @@ Adjust_Preview_Sizes (gint width,
gtk_preview_size (GTK_PREVIEW (plusSatPreview), width, height);
}
void
void
selectionMade (GtkWidget *widget,
gpointer data)
{
Current.Touched[Current.ValueBy] = 1;
if (data == (gpointer) hue_red) {
Update_Current_FP (HUE, RED);
} else if (data == (gpointer) hue_green) {
@ -840,11 +843,11 @@ fp_change_current_range (GtkAdjustment *button,
{
static FP_Intensity prevValue=MIDTONES;
static int notFirstTime=0;
if (!(notFirstTime++)) return;
if (!GTK_TOGGLE_BUTTON (button)->active) return;
if (*Intensity == prevValue) return;
Current.Range = *Intensity;
refreshPreviews (Current.VisibleFrames);
if (AW.window != NULL && GTK_WIDGET_VISIBLE (AW.window))
@ -858,7 +861,7 @@ fp_change_current_pixels_by (GtkWidget *button,
{
gint prevValue = VALUE;
static gint notFirstTime = 0;
if (!(notFirstTime++))
return;
@ -867,7 +870,7 @@ fp_change_current_pixels_by (GtkWidget *button,
if (*valueBy == prevValue)
return;
Current.ValueBy = *valueBy;
refreshPreviews (Current.VisibleFrames);
if (AW.window != NULL &&
@ -880,13 +883,13 @@ fp_change_current_pixels_by (GtkWidget *button,
void
fp_advanced_call (void)
{
if (AW.window!=NULL)
{
if (AW.window!=NULL)
if (GTK_WIDGET_VISIBLE (AW.window))
gtk_widget_hide (AW.window);
else
else
gtk_widget_show (AW.window);
else
else
fp_advanced_dialog ();
}
@ -933,7 +936,7 @@ fp_dialog (void)
NULL);
/********************************************************************/
fp_advanced_dialog ();
fpFrames.bna = bna = fp_create_bna();
@ -947,7 +950,7 @@ fp_dialog (void)
control = fp_create_control();
/********************************************************************/
/******************** PUT EVRYTHING TOGETHER ******************/
table = gtk_table_new (4, 2, FALSE);
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
gtk_table_set_row_spacings (GTK_TABLE (table), 4);
@ -970,7 +973,7 @@ fp_dialog (void)
gtk_table_attach (GTK_TABLE (table), pixelsBy, 0, 1, 3, 4,
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), table, TRUE, TRUE, 0);
gtk_widget_show (table);
gtk_widget_show (dlg);
@ -979,7 +982,7 @@ fp_dialog (void)
gtk_main ();
gdk_flush ();
return FPint.run;
}
@ -993,7 +996,7 @@ fp_advanced_ok (void)
gtk_widget_hide (AW.window);
}
void
void
As_You_Drag (GtkWidget *button)
{
static gboolean notFirstTime = FALSE;
@ -1046,7 +1049,7 @@ fp_advanced_dialog (void)
AW.window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gimp_help_connect (AW.window, gimp_standard_help_func,
"filters/fp.html");
"filters/fp.html", NULL);
gtk_window_set_title (GTK_WINDOW (AW.window),
_("Advanced Filter Pack Options"));
@ -1069,7 +1072,7 @@ fp_advanced_dialog (void)
gtk_container_set_border_width (GTK_CONTAINER (table), 4);
gtk_container_add (GTK_CONTAINER (frame), table);
gtk_widget_show (table);
graphFrame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (graphFrame), GTK_SHADOW_IN);
gtk_container_set_border_width (GTK_CONTAINER (graphFrame),0);
@ -1116,7 +1119,7 @@ fp_advanced_dialog (void)
}
/************************************************************/
AW.aliasingGraph = gtk_drawing_area_new ();
gtk_widget_set_size_request (AW.aliasingGraph,
2 * MARGIN + 256,
@ -1154,12 +1157,12 @@ fp_advanced_dialog (void)
gtk_box_pack_start (GTK_BOX (mainvbox), optionsFrame, TRUE, TRUE, 0);
vbox = gtk_vbox_new (FALSE, 4);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 4);
gtk_container_add (GTK_CONTAINER (optionsFrame), vbox);
gtk_widget_show (vbox);
Check_Button_In_A_Box (vbox, _("Preview as You Drag"),
GTK_SIGNAL_FUNC (As_You_Drag),
NULL, TRUE);
@ -1167,10 +1170,10 @@ fp_advanced_dialog (void)
frame = gtk_frame_new (_("Preview Size"));
gtk_widget_show (frame);
smoothnessData = gtk_adjustment_new (Current.PreviewSize,
50, MAX_PREVIEW_SIZE,
smoothnessData = gtk_adjustment_new (Current.PreviewSize,
50, MAX_PREVIEW_SIZE,
5, 5, 0.0);
Current.previewSizeScale = scale =
gtk_hscale_new (GTK_ADJUSTMENT (smoothnessData));
gtk_container_add (GTK_CONTAINER (frame),scale);
@ -1182,7 +1185,7 @@ fp_advanced_dialog (void)
g_signal_connect (smoothnessData, "value_changed",
G_CALLBACK (preview_size_scale_update),
&Current.PreviewSize);
&Current.PreviewSize);
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
}

View File

@ -24,7 +24,7 @@
#include "config.h"
#include <string.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
@ -119,8 +119,8 @@ static void request_url (HtmlDocument *doc,
const gchar *url,
HtmlStream *stream,
gpointer data);
static gboolean io_handler (GIOChannel *io,
GIOCondition condition,
static gboolean io_handler (GIOChannel *io,
GIOCondition condition,
gpointer data);
@ -140,7 +140,7 @@ has_case_prefix (const gchar *haystack, const gchar *needle)
n++;
h++;
}
return (*n == '\0');
}
@ -197,7 +197,7 @@ button_callback (GtkWidget *widget,
update_toolbar ();
}
static void
static void
entry_changed_callback (GtkWidget *widget,
gpointer data)
{
@ -316,7 +316,7 @@ title_changed (HtmlDocument *doc,
if (!new_title)
new_title = (_("<Untitled>"));
title = g_strstrip (g_strdup (new_title));
history_add (current_ref, title);
@ -347,7 +347,7 @@ load_remote_page (const gchar *ref)
}
static void
load_page (const gchar *ref,
load_page (const gchar *ref,
gboolean add_to_queue)
{
HtmlDocument *doc = HTML_VIEW (html)->document;
@ -385,7 +385,7 @@ load_page (const gchar *ref,
html_document_open_stream (doc, "text/html");
gtk_adjustment_set_value (gtk_layout_get_vadjustment (GTK_LAYOUT (html)),
0);
request_url (doc, abs, doc->current_stream, NULL);
}
@ -395,9 +395,9 @@ load_page (const gchar *ref,
g_free (current_ref);
current_ref = new_ref;
if (add_to_queue)
if (add_to_queue)
queue_add (queue, new_ref);
update_toolbar ();
}
@ -463,7 +463,7 @@ request_url (HtmlDocument *doc,
"been written or your installation is not complete. Ensure "
"that your installation is complete before reporting this "
"error as a bug."));
html_document_write_stream (doc, msg, strlen (msg));
g_free (msg);
@ -476,7 +476,7 @@ request_url (HtmlDocument *doc,
g_io_channel_set_close_on_unref (io, TRUE);
g_io_channel_set_encoding (io, NULL, NULL);
g_io_add_watch (io, G_IO_IN | G_IO_ERR | G_IO_HUP | G_IO_NVAL,
g_io_add_watch (io, G_IO_IN | G_IO_ERR | G_IO_HUP | G_IO_NVAL,
io_handler, stream);
}
@ -488,7 +488,7 @@ request_url (HtmlDocument *doc,
static gboolean
io_handler (GIOChannel *io,
GIOCondition condition,
GIOCondition condition,
gpointer data)
{
HtmlStream *stream;
@ -497,7 +497,7 @@ io_handler (GIOChannel *io,
stream = (HtmlStream *) data;
if (condition & G_IO_IN)
if (condition & G_IO_IN)
{
if (g_io_channel_read_chars (io, buffer, sizeof (buffer),
&bytes, NULL) != G_IO_STATUS_ERROR
@ -513,7 +513,7 @@ io_handler (GIOChannel *io,
return FALSE;
}
if (condition & G_IO_HUP)
if (condition & G_IO_HUP)
{
while (g_io_channel_read_chars (io, buffer, sizeof (buffer),
&bytes, NULL) != G_IO_STATUS_ERROR
@ -524,7 +524,7 @@ io_handler (GIOChannel *io,
}
}
if (condition & (G_IO_ERR | G_IO_HUP | G_IO_NVAL))
if (condition & (G_IO_ERR | G_IO_HUP | G_IO_NVAL))
{
html_stream_close (stream);
g_io_channel_unref (io);
@ -544,7 +544,7 @@ drag_begin (GtkWidget *widget,
}
static void
drag_data_get (GtkWidget *widget,
drag_data_get (GtkWidget *widget,
GdkDragContext *context,
GtkSelectionData *selection_data,
guint info,
@ -556,8 +556,8 @@ drag_data_get (GtkWidget *widget,
gtk_selection_data_set (selection_data,
selection_data->target,
8,
current_ref,
8,
current_ref,
strlen (current_ref));
}
@ -587,13 +587,15 @@ open_browser_dialog (const gchar *help_path,
/* the dialog window */
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
g_signal_connect (window, "destroy",
G_CALLBACK (close_callback),
NULL);
gtk_window_set_wmclass (GTK_WINDOW (window), "helpbrowser", "Gimp");
gtk_window_set_title (GTK_WINDOW (window), _("GIMP Help Browser"));
gimp_help_connect (window, gimp_standard_help_func, "dialogs/help.html");
g_signal_connect (window, "destroy",
G_CALLBACK (close_callback),
NULL);
gimp_help_connect (window, gimp_standard_help_func,
"dialogs/help.html", NULL);
vbox = gtk_vbox_new (FALSE, 2);
gtk_container_add (GTK_CONTAINER (window), vbox);
@ -647,7 +649,7 @@ open_browser_dialog (const gchar *help_path,
gtk_drag_source_set (GTK_WIDGET (drag_source),
GDK_BUTTON1_MASK,
help_dnd_target_table,
G_N_ELEMENTS (help_dnd_target_table),
G_N_ELEMENTS (help_dnd_target_table),
GDK_ACTION_MOVE | GDK_ACTION_COPY);
g_signal_connect (drag_source, "drag_begin",
G_CALLBACK (drag_begin),
@ -655,7 +657,7 @@ open_browser_dialog (const gchar *help_path,
g_signal_connect (drag_source, "drag_data_get",
G_CALLBACK (drag_data_get),
NULL);
image = gtk_image_new_from_stock (GTK_STOCK_JUMP_TO, GTK_ICON_SIZE_BUTTON);
gtk_container_add (GTK_CONTAINER (drag_source), image);
gtk_widget_show (image);
@ -664,12 +666,12 @@ open_browser_dialog (const gchar *help_path,
combo = gtk_combo_new ();
gtk_widget_set_size_request (GTK_WIDGET (combo), 360, -1);
gtk_combo_set_use_arrows (GTK_COMBO (combo), TRUE);
g_object_set (GTK_COMBO (combo)->entry, "editable", FALSE, NULL);
g_object_set (GTK_COMBO (combo)->entry, "editable", FALSE, NULL);
gtk_box_pack_start (GTK_BOX (hbox), combo, TRUE, TRUE, 0);
gtk_widget_show (combo);
g_signal_connect (GTK_COMBO (combo)->entry, "changed",
G_CALLBACK (entry_changed_callback),
G_CALLBACK (entry_changed_callback),
combo);
@ -679,10 +681,10 @@ open_browser_dialog (const gchar *help_path,
gtk_widget_set_size_request (GTK_WIDGET (html), -1, 240);
scroll =
scroll =
gtk_scrolled_window_new (gtk_layout_get_hadjustment (GTK_LAYOUT (html)),
gtk_layout_get_vadjustment (GTK_LAYOUT (html)));
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scroll),
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
gtk_box_pack_start (GTK_BOX (vbox), scroll, TRUE, TRUE, 0);
@ -690,7 +692,7 @@ open_browser_dialog (const gchar *help_path,
gtk_container_add (GTK_CONTAINER (scroll), html);
gtk_widget_show (html);
html_view_set_document (HTML_VIEW (html), html_document_new ());
g_signal_connect (HTML_VIEW (html)->document, "title_changed",
@ -890,7 +892,7 @@ run (const gchar *name,
help_path = g_strdup (gimp_help_root);
locale = g_strdup ("C");
help_file = g_strdup ("introduction.html");
/* Make sure all the arguments are there! */
if (nparams == 4)
{

View File

@ -242,14 +242,14 @@ static void undo (void);
static void redo (void);
static void recompute_center (gboolean save_undo);
static void recompute_center_cb (GtkWidget *widget,
static void recompute_center_cb (GtkWidget *widget,
gpointer data);
static void ifs_compose (GimpDrawable *drawable);
static ColorMap *color_map_create (gchar *name,
GimpRGB *orig_color,
GimpRGB *data,
GimpRGB *data,
gboolean fixed_point);
static void color_map_color_changed_cb (GtkWidget *widget,
ColorMap *color_map);
@ -260,9 +260,9 @@ static void simple_color_toggled (GtkWidget *widget, gpointer data);
static void simple_color_set_sensitive (void);
static void val_changed_update (void);
static ValuePair *value_pair_create (gpointer data,
gdouble lower,
gdouble lower,
gdouble upper,
gboolean create_scale,
gboolean create_scale,
ValuePairType type);
static void value_pair_update (ValuePair *value_pair);
static void value_pair_entry_callback (GtkWidget *w,
@ -396,7 +396,7 @@ run (const gchar *name,
*nreturn_vals = 1;
*return_vals = values;
INIT_I18N ();
INIT_I18N ();
image_id = param[1].data.d_image;
active_drawable = gimp_drawable_get (param[2].data.d_drawable);
@ -420,7 +420,7 @@ run (const gchar *name,
if (!found_parasite)
{
gint length;
length = gimp_get_data_size (IFSCOMPOSE_DATA);
if (length)
{
@ -449,7 +449,7 @@ run (const gchar *name,
/* Possibly retrieve data */
{
gint length;
length = gimp_get_data_size (IFSCOMPOSE_DATA);
if (length)
{
@ -584,7 +584,7 @@ ifs_compose_trans_page (void)
GTK_FILL, GTK_FILL, 0, 0);
gtk_widget_show (label);
ifsD->scale_pair = value_pair_create (&ifsD->current_vals.scale, 0.0, 1.0,
ifsD->scale_pair = value_pair_create (&ifsD->current_vals.scale, 0.0, 1.0,
FALSE, VALUE_PAIR_DOUBLE);
gtk_table_attach (GTK_TABLE (table), ifsD->scale_pair->entry, 3, 4, 0, 1,
GTK_FILL, GTK_FILL, 0, 0);
@ -1134,7 +1134,7 @@ ifs_compose_dialog (GimpDrawable *drawable)
gtk_main ();
g_object_unref (ifsDesign->op_menu);
if (dlg)
gtk_widget_destroy (dlg);
@ -1365,15 +1365,15 @@ ifs_compose (GimpDrawable *drawable)
num_bands = ceil((gdouble)(width*height*SQR(ifsvals.subdivide)*5)
/ (1024 * ifsvals.max_memory));
band_height = (height + num_bands - 1) / num_bands;
band_height = (height + num_bands - 1) / num_bands;
if (band_height > height)
band_height = height;
mask = g_new (guchar, width * band_height * SQR (ifsvals.subdivide));
data = g_new (guchar, width * band_height * SQR (ifsvals.subdivide) * 3);
nhits = g_new (guchar, width * band_height * SQR (ifsvals.subdivide));
gimp_palette_get_background (&color);
gimp_rgb_get_uchar (&color, &rc, &gc, &bc);
@ -1391,7 +1391,7 @@ ifs_compose (GimpDrawable *drawable)
gpointer pr;
buffer = g_strdup_printf (_("Rendering IFS (%d/%d)..."),
buffer = g_strdup_printf (_("Rendering IFS (%d/%d)..."),
band_no+1, num_bands);
gimp_progress_init (buffer);
g_free (buffer);
@ -1409,8 +1409,8 @@ ifs_compose (GimpDrawable *drawable)
/* transfer the image to the drawable */
buffer = g_strdup_printf (_("Copying IFS to image (%d/%d)..."),
buffer = g_strdup_printf (_("Copying IFS to image (%d/%d)..."),
band_no+1, num_bands);
gimp_progress_init (buffer);
g_free (buffer);
@ -1909,7 +1909,7 @@ undo_update (gint el)
{
AffElement *elem;
/* initialize */
elem = NULL;
if (!undo_ring[(undo_start + undo_cur) % UNDO_LEVELS].elements[el])
@ -2062,8 +2062,8 @@ color_map_create (gchar *name,
gtk_box_pack_start (GTK_BOX (color_map->hbox), frame, FALSE, FALSE, 0);
gtk_widget_show (frame);
color_map->orig_preview =
gimp_color_area_new (fixed_point ? data : orig_color,
color_map->orig_preview =
gimp_color_area_new (fixed_point ? data : orig_color,
GIMP_COLOR_AREA_FLAT, 0);
gtk_drag_dest_unset (color_map->orig_preview);
gtk_widget_set_size_request (color_map->orig_preview,
@ -2076,11 +2076,11 @@ color_map_create (gchar *name,
gtk_widget_show (arrow);
color_map->button = gimp_color_button_new (name,
COLOR_SAMPLE_SIZE,
COLOR_SAMPLE_SIZE,
data,
COLOR_SAMPLE_SIZE,
data,
GIMP_COLOR_AREA_FLAT);
gtk_box_pack_start (GTK_BOX (color_map->hbox), color_map->button,
gtk_box_pack_start (GTK_BOX (color_map->hbox), color_map->button,
FALSE, FALSE, 0);
gtk_widget_show (color_map->button);
@ -2104,7 +2104,7 @@ color_map_color_changed_cb (GtkWidget *widget,
undo_begin ();
undo_update (ifsD->current_element);
elements[ifsD->current_element]->v = ifsD->current_vals;
elements[ifsD->current_element]->v.theta *= G_PI/180.0;
aff_element_compute_color_trans (elements[ifsD->current_element]);
@ -2122,7 +2122,7 @@ color_map_update (ColorMap *color_map)
color_map->color);
if (color_map->fixed_point)
gimp_color_area_set_color (GIMP_COLOR_AREA (color_map->orig_preview),
gimp_color_area_set_color (GIMP_COLOR_AREA (color_map->orig_preview),
color_map->color);
}
@ -2326,7 +2326,7 @@ value_pair_destroy_callback (GtkWidget *widget,
g_object_unref (value_pair->scale);
g_object_unref (value_pair->adjustment);
}
static void
design_op_callback (GtkWidget *widget,
gpointer data)
@ -2696,12 +2696,12 @@ ifsfile_load (GtkWidget *widget,
undo_begin ();
for (i = 0; i < ifsvals.num_elements; i++)
undo_update (i);
ifsfile_replace_ifsvals (&new_ifsvals, new_elements);
if (ifsD->auto_preview)
ifs_compose_preview ();
gtk_widget_hide (file_select);
design_area_redraw ();
}
@ -2736,10 +2736,10 @@ ifs_compose_save_callback (GtkWidget *widget,
if (!file_select)
{
file_select = gtk_file_selection_new (_("Save as IFS file"));
gimp_help_connect (file_select, gimp_standard_help_func,
"filters/ifscompose.html");
"filters/ifscompose.html", NULL);
g_signal_connect (GTK_FILE_SELECTION (file_select)->ok_button, "clicked",
G_CALLBACK (ifsfile_save),
file_select);
@ -2761,9 +2761,9 @@ ifs_compose_load_callback (GtkWidget *widget,
if (!file_select)
{
file_select = gtk_file_selection_new (_("Load IFS file"));
gimp_help_connect (file_select, gimp_standard_help_func,
"filters/ifscompose.html");
"filters/ifscompose.html", NULL);
g_signal_connect (GTK_FILE_SELECTION (file_select)->ok_button, "clicked",
G_CALLBACK (ifsfile_load),

View File

@ -118,7 +118,7 @@ static void query()
};
static GimpParamDef *return_vals = NULL;
static int nreturn_vals = 0;
gimp_install_procedure("plug_in_imagemap",
"Creates a clickable imagemap.",
"",
@ -148,7 +148,7 @@ run (const gchar *name,
*nreturn_vals = 1;
*return_vals = values;
/* Get the specified drawable */
drawable = gimp_drawable_get(param[2].data.d_drawable);
_drawable = drawable;
@ -159,18 +159,18 @@ run (const gchar *name,
_map_info.color = gimp_drawable_is_rgb(drawable->drawable_id);
run_mode = (GimpRunMode) param[0].data.d_int32;
if (run_mode == GIMP_RUN_INTERACTIVE) {
if (!dialog(drawable)) {
/* The dialog was closed, or something similarly evil happened. */
status = GIMP_PDB_EXECUTION_ERROR;
}
}
if (status == GIMP_PDB_SUCCESS) {
gimp_drawable_detach(drawable);
}
values[0].type = GIMP_PDB_STATUS;
values[0].data.d_status = status;
}
@ -204,19 +204,19 @@ init_preferences(void)
colors->normal_fg.red = 0;
colors->normal_fg.green = 0xFFFF;
colors->normal_fg.blue = 0;
colors->normal_bg.red = 0;
colors->normal_bg.green = 0;
colors->normal_bg.blue = 0xFFFF;
colors->selected_fg.red = 0xFFFF;
colors->selected_fg.green = 0;
colors->selected_fg.blue = 0;
colors->selected_bg.red = 0;
colors->selected_bg.green = 0;
colors->selected_bg.blue = 0xFFFF;
preferences_load(&_preferences);
gdk_colormap_alloc_color(colormap, &colors->normal_fg, FALSE, TRUE);
@ -229,10 +229,10 @@ init_preferences(void)
gdk_gc_set_line_attributes(_preferences.normal_gc, 1, GDK_LINE_DOUBLE_DASH,
GDK_CAP_BUTT, GDK_JOIN_BEVEL);
gdk_gc_set_line_attributes(_preferences.selected_gc, 1,
GDK_LINE_DOUBLE_DASH, GDK_CAP_BUTT,
gdk_gc_set_line_attributes(_preferences.selected_gc, 1,
GDK_LINE_DOUBLE_DASH, GDK_CAP_BUTT,
GDK_JOIN_BEVEL);
gdk_gc_set_foreground(_preferences.normal_gc, &colors->normal_fg);
gdk_gc_set_background(_preferences.normal_gc, &colors->normal_bg);
gdk_gc_set_foreground(_preferences.selected_gc, &colors->selected_fg);
@ -254,13 +254,13 @@ get_image_height(void)
return _image_height;
}
void
void
set_busy_cursor(void)
{
preview_set_cursor(_preview, GDK_WATCH);
}
void
void
remove_busy_cursor(void)
{
gdk_window_set_cursor(_dlg->window, NULL);
@ -373,7 +373,7 @@ preview_thaw(void)
}
}
void
void
redraw_preview(void)
{
if (_preview_redraw_blocked)
@ -416,12 +416,12 @@ set_arrow_func(void)
}
static gboolean
fuzzy_select_on_button_press(GtkWidget *widget, GdkEventButton *event,
fuzzy_select_on_button_press(GtkWidget *widget, GdkEventButton *event,
gpointer data)
{
if (event->button == 1) {
gdouble rx = get_real_coord((gint) event->x);
gdouble ry = get_real_coord((gint) event->y);
gdouble ry = get_real_coord((gint) event->y);
gint32 image_ID = gimp_drawable_image(_drawable->drawable_id);
gint32 channel_ID;
@ -439,7 +439,7 @@ fuzzy_select_on_button_press(GtkWidget *widget, GdkEventButton *event,
&nreturn_vals,
GIMP_PDB_INT32, TRUE,
GIMP_PDB_IMAGE, 0,
GIMP_PDB_DRAWABLE,
GIMP_PDB_DRAWABLE,
_drawable->drawable_id,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS) {
@ -449,18 +449,18 @@ fuzzy_select_on_button_press(GtkWidget *widget, GdkEventButton *event,
Polygon_t *polygon = ObjectToPolygon(object);
gint x0, y0;
gdouble grad0;
add_shape(object);
x0 = gimp_path_get_point_at_dist(image_ID, 0.0, &y0, &grad0);
polygon_append_point(polygon, x0, y0);
for (distance = 1.0;; distance += 1.0) {
gint x1, y1 = -1;
gdouble grad1;
x1 = gimp_path_get_point_at_dist(image_ID, distance, &y1,
x1 = gimp_path_get_point_at_dist(image_ID, distance, &y1,
&grad1);
if (y1 == -1)
break;
@ -471,7 +471,7 @@ fuzzy_select_on_button_press(GtkWidget *widget, GdkEventButton *event,
diff = (grad1 - grad0) / grad0;
else
diff = grad1;
if (fabs(diff) > 0.1) {
polygon_append_point(polygon, x1, y1);
grad0 = grad1;
@ -503,8 +503,8 @@ set_fuzzy_select_func(void)
_cursor = GDK_TOP_LEFT_ARROW; /* Fix me! */
}
static void
set_object_func(gboolean (*func)(GtkWidget*, GdkEventButton*,
static void
set_object_func(gboolean (*func)(GtkWidget*, GdkEventButton*,
gpointer), gpointer param)
{
_button_press_func = func;
@ -580,7 +580,7 @@ static void
main_set_title(const char *filename)
{
char *title, *p;
g_strreplace(&_filename, filename);
p = (filename) ? g_path_get_basename(filename) : _("<Untitled>");
title = g_strdup_printf("%s - ImageMap 2.0", p);
@ -590,10 +590,10 @@ main_set_title(const char *filename)
g_free(title);
}
void
void
main_set_dimension(gint width, gint height)
{
statusbar_set_dimension(_statusbar, width / _zoom_factor,
statusbar_set_dimension(_statusbar, width / _zoom_factor,
height / _zoom_factor);
}
@ -616,7 +616,7 @@ hide_url(void)
statusbar_clear_status(_statusbar);
}
void
void
select_shape(GtkWidget *widget, GdkEventButton *event)
{
Object_t *obj;
@ -703,7 +703,7 @@ menu_zoom_out(void)
popup_set_zoom_sensitivity(factor);
}
void
void
draw_shapes(GtkWidget *preview)
{
if (!_preview_redraw_blocked)
@ -822,7 +822,7 @@ save(void)
static void
write_cern_comment(gpointer param, OutputFunc_t output)
{
output(param, "rect (4096,4096) (4096,4096) imap:#$");
output(param, "rect (4096,4096) (4096,4096) imap:#$");
}
static void
@ -846,7 +846,7 @@ save_as_cern(gpointer param, OutputFunc_t output)
output(param, "AUTHOR:%s\n", _map_info.author);
write_cern_comment(param, output);
output(param, "FORMAT:cern\n");
description = g_strdup(_map_info.description);
next_token = description;
for (p = strtok (next_token, "\n"); p; p = strtok(NULL, "\n")) {
@ -865,24 +865,24 @@ save_as_csim(gpointer param, OutputFunc_t output)
{
char *p;
gchar *description;
output(param, "<img src=\"%s\" width=\"%d\" height=\"%d\" border=\"0\" "
"usemap=\"#%s\" />\n\n", _map_info.image_name,
_image_width, _image_height, _map_info.title);
output(param, "<map name=\"%s\">\n", _map_info.title);
output(param,
output(param,
"<!-- #$-:Image Map file created by GIMP Imagemap Plugin -->\n");
output(param, "<!-- #$-:GIMP Imagemap Plugin by Maurits Rijk -->\n");
output(param,
output(param,
"<!-- #$-:Please do not edit lines starting with \"#$\" -->\n");
output(param, "<!-- #$VERSION:2.0 -->\n");
output(param, "<!-- #$AUTHOR:%s -->\n", _map_info.author);
description = g_strdup(_map_info.description);
for (p = strtok(description, "\n"); p; p = strtok(NULL, "\n"))
output(param, "<!-- #$DESCRIPTION:%s -->\n", p);
g_free(description);
object_list_write_csim(_shapes, param, output);
if (*_map_info.default_url)
output(param, "<area shape=\"default\" href=\"%s\" />\n",
@ -903,7 +903,7 @@ save_as_ncsa(gpointer param, OutputFunc_t output)
output(param, "#$TITLE:%s\n", _map_info.title);
output(param, "#$AUTHOR:%s\n", _map_info.author);
output(param, "#$FORMAT:ncsa\n");
description = g_strdup(_map_info.description);
for (p = strtok(description, "\n"); p; p = strtok(NULL, "\n"))
output(param, "#$DESCRIPTION:%s\n", p);
@ -914,7 +914,7 @@ save_as_ncsa(gpointer param, OutputFunc_t output)
object_list_write_ncsa(_shapes, param, output);
}
static void
static void
save_to_file(gpointer param, const char* format, ...)
{
va_list ap;
@ -1024,7 +1024,7 @@ load(const gchar *filename)
check_if_changed(really_load, (gpointer) tmp_filename);
}
static void
static void
toggle_area_list(void)
{
selection_toggle_visibility(_selection);
@ -1128,7 +1128,7 @@ key_timeout_cb(gpointer data)
return FALSE;
}
static gboolean
static gboolean
key_press_cb(GtkWidget *widget, GdkEventKey *event)
{
gboolean handled = FALSE;
@ -1171,7 +1171,7 @@ key_press_cb(GtkWidget *widget, GdkEventKey *event)
return handled;
}
static gboolean
static gboolean
key_release_cb(GtkWidget *widget, GdkEventKey *event)
{
_keyval = event->keyval;
@ -1415,14 +1415,15 @@ dialog(GimpDrawable *drawable)
gtk_window_set_resizable(GTK_WINDOW(dlg), TRUE);
main_set_title(NULL);
gimp_help_connect (dlg, gimp_standard_help_func, "filters/imagemap.html");
gimp_help_connect (dlg, gimp_standard_help_func,
"filters/imagemap.html", NULL);
gtk_window_set_position(GTK_WINDOW(dlg), GTK_WIN_POS_MOUSE);
g_signal_connect(dlg, "delete_event",
g_signal_connect(dlg, "delete_event",
G_CALLBACK(close_callback), NULL);
g_signal_connect(dlg, "key_press_event",
g_signal_connect(dlg, "key_press_event",
G_CALLBACK(key_press_cb), NULL);
g_signal_connect(dlg, "key_release_event",
g_signal_connect(dlg, "key_release_event",
G_CALLBACK(key_release_cb), NULL);
main_vbox = gtk_vbox_new(FALSE, 1);
@ -1533,6 +1534,6 @@ dialog(GimpDrawable *drawable)
gtk_main();
gdk_flush();
return run_flag;
}