Commit a319c455 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

app/widgets/Makefile.am new file defining the available help topics. Work

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

	* app/widgets/Makefile.am
	* app/widgets/gimphelp-ids.h: new file defining the available help
	topics. Work in progress and totally unusable for matching to the
	help system. Stay tuned...

	* app/gui/about-dialog.c
	* app/gui/brushes-menu.c
	* app/gui/buffers-menu.c
	* app/gui/channels-commands.[ch]
	* app/gui/channels-menu.c
	* app/gui/edit-commands.c
	* app/gui/file-commands.c
	* app/gui/file-new-dialog.c
	* app/gui/file-open-dialog.c
	* app/gui/file-save-dialog.c
	* app/gui/gradients-commands.c
	* app/gui/gradients-menu.c
	* app/gui/image-menu.c
	* app/gui/layers-commands.[ch]
	* app/gui/layers-menu.c
	* app/gui/module-browser.c
	* app/gui/offset-dialog.c
	* app/gui/palettes-menu.c
	* app/gui/patterns-menu.c
	* app/gui/resize-dialog.c
	* app/gui/select-commands.c
	* app/gui/templates-menu.c
	* app/gui/tips-dialog.c
	* app/gui/toolbox-menu.c
	* app/gui/vectors-commands.[ch]
	* app/gui/vectors-menu.c: replaced literal HTML file paths by help
	IDs from gimphelp-ids.h. Renamed some menu callbacks to be
	consistent with similar ones. This is just an intermediate commit
	and not finished.

	While browsing all the menus, I noticed that our "x to selection"
	functions are not consistent at all. They should all offer the
	REPLACE,ADD,SUBTRACT,INTERSECT options:

	* app/core/gimpchannel.[ch]: added new function
	gimp_channel_new_from_alpha(). Removed gimp_channel_layer_alpha()
	and gimp_channel_layer_mask().

	* app/core/gimpimage-mask.[ch]: added
	gimp_image_mask_select_alpha() and
	gimp_image_mask_select_component() which offer the full set of
	operation, feather and feather_radius parameters as the other
	selection functions.

	* app/core/gimpimage-mask-select.[ch]: removed
	gimp_image_mask_layer_alpha() and gimp_image_mask_layer_mask().

	* app/gui/channels-commands.c (channels_channel_to_selection): use
	gimp_image_mask_select_component() instead of implementing it
	here.

	* app/gui/image-menu.c
	* app/gui/layers-commands.[ch]: offer the full choice of
	REPLACE,ADD,SUBTRACT,INTERSECT with "Alpha to Selection" and "Mask
	to Selection".

	* tools/pdbgen/pdb/selection.pdb: changed accordingly.

	* app/pdb/selection_cmds.c: regenerated.
parent cf845be8
2003-08-21 Michael Natterer <mitch@gimp.org>
* app/widgets/Makefile.am
* app/widgets/gimphelp-ids.h: new file defining the available help
topics. Work in progress and totally unusable for matching to the
help system. Stay tuned...
* app/gui/about-dialog.c
* app/gui/brushes-menu.c
* app/gui/buffers-menu.c
* app/gui/channels-commands.[ch]
* app/gui/channels-menu.c
* app/gui/edit-commands.c
* app/gui/file-commands.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.c
* app/gui/file-save-dialog.c
* app/gui/gradients-commands.c
* app/gui/gradients-menu.c
* app/gui/image-menu.c
* app/gui/layers-commands.[ch]
* app/gui/layers-menu.c
* app/gui/module-browser.c
* app/gui/offset-dialog.c
* app/gui/palettes-menu.c
* app/gui/patterns-menu.c
* app/gui/resize-dialog.c
* app/gui/select-commands.c
* app/gui/templates-menu.c
* app/gui/tips-dialog.c
* app/gui/toolbox-menu.c
* app/gui/vectors-commands.[ch]
* app/gui/vectors-menu.c: replaced literal HTML file paths by help
IDs from gimphelp-ids.h. Renamed some menu callbacks to be
consistent with similar ones. This is just an intermediate commit
and not finished.
While browsing all the menus, I noticed that our "x to selection"
functions are not consistent at all. They should all offer the
REPLACE,ADD,SUBTRACT,INTERSECT options:
* app/core/gimpchannel.[ch]: added new function
gimp_channel_new_from_alpha(). Removed gimp_channel_layer_alpha()
and gimp_channel_layer_mask().
* app/core/gimpimage-mask.[ch]: added
gimp_image_mask_select_alpha() and
gimp_image_mask_select_component() which offer the full set of
operation, feather and feather_radius parameters as the other
selection functions.
* app/core/gimpimage-mask-select.[ch]: removed
gimp_image_mask_layer_alpha() and gimp_image_mask_layer_mask().
* app/gui/channels-commands.c (channels_channel_to_selection): use
gimp_image_mask_select_component() instead of implementing it
here.
* app/gui/image-menu.c
* app/gui/layers-commands.[ch]: offer the full choice of
REPLACE,ADD,SUBTRACT,INTERSECT with "Alpha to Selection" and "Mask
to Selection".
* tools/pdbgen/pdb/selection.pdb: changed accordingly.
* app/pdb/selection_cmds.c: regenerated.
2003-08-21 Sven Neumann <sven@gimp.org> 2003-08-21 Sven Neumann <sven@gimp.org>
* themes/Default/images/Makefile.am * themes/Default/images/Makefile.am
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include "widgets/gimpcolorpanel.h" #include "widgets/gimpcolorpanel.h"
#include "widgets/gimpcomponenteditor.h" #include "widgets/gimpcomponenteditor.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpitemtreeview.h" #include "widgets/gimpitemtreeview.h"
#include "widgets/gimpviewabledialog.h" #include "widgets/gimpviewabledialog.h"
...@@ -80,8 +81,8 @@ static void channels_color_changed (GimpColorButton *button, ...@@ -80,8 +81,8 @@ static void channels_color_changed (GimpColorButton *button,
/* public functions */ /* public functions */
void void
channels_new_channel_cmd_callback (GtkWidget *widget, channels_new_cmd_callback (GtkWidget *widget,
gpointer data) gpointer data)
{ {
GimpImage *gimage; GimpImage *gimage;
return_if_no_image (gimage, data); return_if_no_image (gimage, data);
...@@ -90,8 +91,8 @@ channels_new_channel_cmd_callback (GtkWidget *widget, ...@@ -90,8 +91,8 @@ channels_new_channel_cmd_callback (GtkWidget *widget,
} }
void void
channels_raise_channel_cmd_callback (GtkWidget *widget, channels_raise_cmd_callback (GtkWidget *widget,
gpointer data) gpointer data)
{ {
GimpImage *gimage; GimpImage *gimage;
GimpChannel *active_channel; GimpChannel *active_channel;
...@@ -102,8 +103,8 @@ channels_raise_channel_cmd_callback (GtkWidget *widget, ...@@ -102,8 +103,8 @@ channels_raise_channel_cmd_callback (GtkWidget *widget,
} }
void void
channels_lower_channel_cmd_callback (GtkWidget *widget, channels_lower_cmd_callback (GtkWidget *widget,
gpointer data) gpointer data)
{ {
GimpImage *gimage; GimpImage *gimage;
GimpChannel *active_channel; GimpChannel *active_channel;
...@@ -114,8 +115,8 @@ channels_lower_channel_cmd_callback (GtkWidget *widget, ...@@ -114,8 +115,8 @@ channels_lower_channel_cmd_callback (GtkWidget *widget,
} }
void void
channels_duplicate_channel_cmd_callback (GtkWidget *widget, channels_duplicate_cmd_callback (GtkWidget *widget,
gpointer data) gpointer data)
{ {
GimpImage *gimage; GimpImage *gimage;
GimpChannel *new_channel; GimpChannel *new_channel;
...@@ -143,6 +144,11 @@ channels_duplicate_channel_cmd_callback (GtkWidget *widget, ...@@ -143,6 +144,11 @@ channels_duplicate_channel_cmd_callback (GtkWidget *widget,
new_channel = gimp_channel_new_from_component (gimage, component, new_channel = gimp_channel_new_from_component (gimage, component,
name, &color); name, &color);
/* copied components are invisible by default so subsequent copies
* of components don't affect each other
*/
gimp_drawable_set_visible (GIMP_DRAWABLE (new_channel), FALSE, FALSE);
g_free (name); g_free (name);
} }
else else
...@@ -161,8 +167,8 @@ channels_duplicate_channel_cmd_callback (GtkWidget *widget, ...@@ -161,8 +167,8 @@ channels_duplicate_channel_cmd_callback (GtkWidget *widget,
} }
void void
channels_delete_channel_cmd_callback (GtkWidget *widget, channels_delete_cmd_callback (GtkWidget *widget,
gpointer data) gpointer data)
{ {
GimpImage *gimage; GimpImage *gimage;
GimpChannel *active_channel; GimpChannel *active_channel;
...@@ -173,75 +179,66 @@ channels_delete_channel_cmd_callback (GtkWidget *widget, ...@@ -173,75 +179,66 @@ channels_delete_channel_cmd_callback (GtkWidget *widget,
} }
static void static void
channels_channel_to_sel (GtkWidget *widget, channels_channel_to_selection (GtkWidget *widget,
gpointer data, gpointer data,
GimpChannelOps op) GimpChannelOps op)
{ {
GimpImage *gimage; GimpImage *gimage;
GimpChannel *channel;
if (GIMP_IS_COMPONENT_EDITOR (data)) if (GIMP_IS_COMPONENT_EDITOR (data))
{ {
GimpRGB color;
GimpChannelType component; GimpChannelType component;
return_if_no_image (gimage, data); return_if_no_image (gimage, data);
gimp_rgba_set (&color, 0, 0, 0, 1);
component = GIMP_COMPONENT_EDITOR (data)->clicked_component; component = GIMP_COMPONENT_EDITOR (data)->clicked_component;
channel = gimp_channel_new_from_component (gimage, component, gimp_image_mask_select_component (gimage, component,
"Component Copy", op, FALSE, 0.0, 0.0);
&color);
} }
else else
{ {
GimpChannel *channel;
return_if_no_channel (gimage, channel, data); return_if_no_channel (gimage, channel, data);
gimp_image_mask_select_channel (gimage, _("Channel to Selection"),
channel, 0, 0,
op, FALSE, 0.0, 0.0);
} }
gimp_image_mask_select_channel (gimage,
_("Channel to Selection"),
channel,
0, 0,
op,
FALSE, 0, 0);
gimp_image_flush (gimage); gimp_image_flush (gimage);
if (GIMP_IS_COMPONENT_EDITOR (data))
g_object_unref (channel);
} }
void void
channels_channel_to_sel_cmd_callback (GtkWidget *widget, channels_selection_replace_cmd_callback (GtkWidget *widget,
gpointer data) gpointer data)
{ {
channels_channel_to_sel (widget, data, GIMP_CHANNEL_OP_REPLACE); channels_channel_to_selection (widget, data, GIMP_CHANNEL_OP_REPLACE);
} }
void void
channels_add_channel_to_sel_cmd_callback (GtkWidget *widget, channels_selection_add_cmd_callback (GtkWidget *widget,
gpointer data) gpointer data)
{ {
channels_channel_to_sel (widget, data, GIMP_CHANNEL_OP_ADD); channels_channel_to_selection (widget, data, GIMP_CHANNEL_OP_ADD);
} }
void void
channels_sub_channel_from_sel_cmd_callback (GtkWidget *widget, channels_selection_sub_cmd_callback (GtkWidget *widget,
gpointer data) gpointer data)
{ {
channels_channel_to_sel (widget, data, GIMP_CHANNEL_OP_SUBTRACT); channels_channel_to_selection (widget, data, GIMP_CHANNEL_OP_SUBTRACT);
} }
void void
channels_intersect_channel_with_sel_cmd_callback (GtkWidget *widget, channels_selection_intersect_cmd_callback (GtkWidget *widget,
gpointer data) gpointer data)
{ {
channels_channel_to_sel (widget, data, GIMP_CHANNEL_OP_INTERSECT); channels_channel_to_selection (widget, data, GIMP_CHANNEL_OP_INTERSECT);
} }
void void
channels_edit_channel_attributes_cmd_callback (GtkWidget *widget, channels_edit_attributes_cmd_callback (GtkWidget *widget,
gpointer data) gpointer data)
{ {
GimpImage *gimage; GimpImage *gimage;
GimpChannel *active_channel; GimpChannel *active_channel;
...@@ -372,7 +369,7 @@ channels_new_channel_query (GimpImage *gimage, ...@@ -372,7 +369,7 @@ channels_new_channel_query (GimpImage *gimage,
GIMP_STOCK_CHANNEL, GIMP_STOCK_CHANNEL,
_("New Channel Options"), _("New Channel Options"),
gimp_standard_help_func, gimp_standard_help_func,
"dialogs/channels/new_channel.html", GIMP_HELP_CHANNEL_NEW,
GTK_STOCK_CANCEL, gtk_widget_destroy, GTK_STOCK_CANCEL, gtk_widget_destroy,
NULL, 1, NULL, FALSE, TRUE, NULL, 1, NULL, FALSE, TRUE,
...@@ -532,7 +529,7 @@ channels_edit_channel_query (GimpChannel *channel) ...@@ -532,7 +529,7 @@ channels_edit_channel_query (GimpChannel *channel)
GIMP_STOCK_EDIT, GIMP_STOCK_EDIT,
_("Edit Channel Attributes"), _("Edit Channel Attributes"),
gimp_standard_help_func, gimp_standard_help_func,
"dialogs/channels/edit_channel_attributes.html", GIMP_HELP_CHANNEL_EDIT,
GTK_STOCK_CANCEL, gtk_widget_destroy, GTK_STOCK_CANCEL, gtk_widget_destroy,
NULL, 1, NULL, FALSE, TRUE, NULL, 1, NULL, FALSE, TRUE,
......
...@@ -20,31 +20,31 @@ ...@@ -20,31 +20,31 @@
#define __CHANNELS_COMMANDS_H__ #define __CHANNELS_COMMANDS_H__
void channels_new_channel_cmd_callback (GtkWidget *widget, void channels_new_cmd_callback (GtkWidget *widget,
gpointer data); gpointer data);
void channels_raise_channel_cmd_callback (GtkWidget *widget, void channels_raise_cmd_callback (GtkWidget *widget,
gpointer data); gpointer data);
void channels_lower_channel_cmd_callback (GtkWidget *widget, void channels_lower_cmd_callback (GtkWidget *widget,
gpointer data); gpointer data);
void channels_duplicate_channel_cmd_callback (GtkWidget *widget, void channels_duplicate_cmd_callback (GtkWidget *widget,
gpointer data); gpointer data);
void channels_delete_channel_cmd_callback (GtkWidget *widget, void channels_delete_cmd_callback (GtkWidget *widget,
gpointer data); gpointer data);
void channels_channel_to_sel_cmd_callback (GtkWidget *widget, void channels_selection_replace_cmd_callback (GtkWidget *widget,
gpointer data); gpointer data);
void channels_add_channel_to_sel_cmd_callback (GtkWidget *widget, void channels_selection_add_cmd_callback (GtkWidget *widget,
gpointer data); gpointer data);
void channels_sub_channel_from_sel_cmd_callback (GtkWidget *widget, void channels_selection_sub_cmd_callback (GtkWidget *widget,
gpointer data); gpointer data);
void channels_intersect_channel_with_sel_cmd_callback (GtkWidget *widget, void channels_selection_intersect_cmd_callback (GtkWidget *widget,
gpointer data); gpointer data);
void channels_edit_channel_attributes_cmd_callback (GtkWidget *widget, void channels_edit_attributes_cmd_callback (GtkWidget *widget,
gpointer data); gpointer data);
void channels_new_channel_query (GimpImage *gimage, void channels_new_channel_query (GimpImage *gimage,
GimpChannel *template, GimpChannel *template,
gboolean interactive); gboolean interactive);
void channels_edit_channel_query (GimpChannel *channel); void channels_edit_channel_query (GimpChannel *channel);
#endif /* __CHANNELS_COMMANDS_H__ */ #endif /* __CHANNELS_COMMANDS_H__ */
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
#include "display/gimpdisplay.h" #include "display/gimpdisplay.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpdialogfactory.h" #include "widgets/gimpdialogfactory.h"
#include "dialogs.h" #include "dialogs.h"
...@@ -192,7 +193,7 @@ edit_named_cut_cmd_callback (GtkWidget *widget, ...@@ -192,7 +193,7 @@ edit_named_cut_cmd_callback (GtkWidget *widget,
qbox = gimp_query_string_box (_("Cut Named"), qbox = gimp_query_string_box (_("Cut Named"),
gimp_standard_help_func, gimp_standard_help_func,
"dialogs/cut_named.html", GIMP_HELP_BUFFER_CUT,
_("Enter a name for this buffer"), _("Enter a name for this buffer"),
NULL, NULL,
G_OBJECT (gdisp->gimage), "disconnect", G_OBJECT (gdisp->gimage), "disconnect",
...@@ -210,7 +211,7 @@ edit_named_copy_cmd_callback (GtkWidget *widget, ...@@ -210,7 +211,7 @@ edit_named_copy_cmd_callback (GtkWidget *widget,
qbox = gimp_query_string_box (_("Copy Named"), qbox = gimp_query_string_box (_("Copy Named"),
gimp_standard_help_func, gimp_standard_help_func,
"dialogs/copy_named.html", GIMP_HELP_BUFFER_COPY,
_("Enter a name for this buffer"), _("Enter a name for this buffer"),
NULL, NULL,
G_OBJECT (gimage), "disconnect", G_OBJECT (gimage), "disconnect",
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#include "file/file-save.h" #include "file/file-save.h"
#include "file/file-utils.h" #include "file/file-utils.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpdialogfactory.h" #include "widgets/gimpdialogfactory.h"
#include "display/gimpdisplay.h" #include "display/gimpdisplay.h"
...@@ -288,7 +289,7 @@ file_save_template_cmd_callback (GtkWidget *widget, ...@@ -288,7 +289,7 @@ file_save_template_cmd_callback (GtkWidget *widget,
qbox = gimp_query_string_box (_("Create New Template"), qbox = gimp_query_string_box (_("Create New Template"),
gimp_standard_help_func, gimp_standard_help_func,
"dialogs/new_template.html", GIMP_HELP_FILE_SAVE_AS_TEMPLATE,
_("Enter a name for this template"), _("Enter a name for this template"),
NULL, NULL,
G_OBJECT (gdisp->gimage), "disconnect", G_OBJECT (gdisp->gimage), "disconnect",
...@@ -336,7 +337,7 @@ file_revert_cmd_callback (GtkWidget *widget, ...@@ -336,7 +337,7 @@ file_revert_cmd_callback (GtkWidget *widget,
query_box = gimp_query_boolean_box (_("Revert Image"), query_box = gimp_query_boolean_box (_("Revert Image"),
gimp_standard_help_func, gimp_standard_help_func,
"file/revert.html", GIMP_HELP_FILE_REVERT,
GIMP_STOCK_QUESTION, GIMP_STOCK_QUESTION,
text, text,
GTK_STOCK_YES, GTK_STOCK_NO, GTK_STOCK_YES, GTK_STOCK_NO,
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include "widgets/gimpcontainereditor.h" #include "widgets/gimpcontainereditor.h"
#include "widgets/gimpcontainerview.h" #include "widgets/gimpcontainerview.h"
#include "widgets/gimphelp-ids.h"
#include "gradients-commands.h" #include "gradients-commands.h"
...@@ -102,9 +103,8 @@ gradients_save_as_pov_query (GimpContainerEditor *editor) ...@@ -102,9 +103,8 @@ gradients_save_as_pov_query (GimpContainerEditor *editor)
gradient, gradient,
G_CONNECT_SWAPPED); G_CONNECT_SWAPPED);
/* Connect the "F1" help key */
gimp_help_connect (GTK_WIDGET (filesel), gimp_standard_help_func, gimp_help_connect (GTK_WIDGET (filesel), gimp_standard_help_func,
"dialogs/save_as_povray.html"); GIMP_HELP_GRADIENT_SAVE_AS_POV);
gtk_widget_show (GTK_WIDGET (filesel)); gtk_widget_show (GTK_WIDGET (filesel));
} }
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include "core/gimpcontext.h" #include "core/gimpcontext.h"
#include "core/gimpimage.h" #include "core/gimpimage.h"
#include "core/gimpimage-mask.h" #include "core/gimpimage-mask.h"
#include "core/gimpimage-mask-select.h"
#include "core/gimpimage-merge.h" #include "core/gimpimage-merge.h"
#include "core/gimpimage-undo.h" #include "core/gimpimage-undo.h"
#include "core/gimplayer.h" #include "core/gimplayer.h"
...@@ -42,6 +43,7 @@ ...@@ -42,6 +43,7 @@
#include "pdb/procedural_db.h" #include "pdb/procedural_db.h"
#include "widgets/gimpenummenu.h" #include "widgets/gimpenummenu.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpitemtreeview.h" #include "widgets/gimpitemtreeview.h"
#include "widgets/gimpviewabledialog.h" #include "widgets/gimpviewabledialog.h"
...@@ -365,8 +367,8 @@ layers_crop_cmd_callback (GtkWidget *widget, ...@@ -365,8 +367,8 @@ layers_crop_cmd_callback (GtkWidget *widget,
} }
void void
layers_add_layer_mask_cmd_callback (GtkWidget *widget, layers_mask_add_cmd_callback (GtkWidget *widget,
gpointer data) gpointer data)
{ {
GimpImage *gimage; GimpImage *gimage;
GimpLayer *active_layer; GimpLayer *active_layer;
...@@ -376,8 +378,8 @@ layers_add_layer_mask_cmd_callback (GtkWidget *widget, ...@@ -376,8 +378,8 @@ layers_add_layer_mask_cmd_callback (GtkWidget *widget,
} }
void void
layers_apply_layer_mask_cmd_callback (GtkWidget *widget, layers_mask_apply_cmd_callback (GtkWidget *widget,
gpointer data) gpointer data)
{ {
GimpImage *gimage; GimpImage *gimage;
GimpLayer *active_layer; GimpLayer *active_layer;
...@@ -391,8 +393,8 @@ layers_apply_layer_mask_cmd_callback (GtkWidget *widget, ...@@ -391,8 +393,8 @@ layers_apply_layer_mask_cmd_callback (GtkWidget *widget,
} }
void void
layers_delete_layer_mask_cmd_callback (GtkWidget *widget, layers_mask_delete_cmd_callback (GtkWidget *widget,
gpointer data) gpointer data)
{ {
GimpImage *gimage; GimpImage *gimage;
GimpLayer *active_layer; GimpLayer *active_layer;
...@@ -405,36 +407,64 @@ layers_delete_layer_mask_cmd_callback (GtkWidget *widget, ...@@ -405,36 +407,64 @@ layers_delete_layer_mask_cmd_callback (GtkWidget *widget,
} }
} }
void static void
layers_mask_select_cmd_callback (GtkWidget *widget, layers_mask_to_selection (GtkWidget *widget,
gpointer data) gpointer data,
GimpChannelOps op)
{ {
GimpImage *gimage; GimpImage *gimage;
GimpLayer *active_layer; GimpLayer *active_layer;
GimpLayerMask *mask;
return_if_no_layer (gimage, active_layer, data); return_if_no_layer (gimage, active_layer, data);
if (gimp_layer_get_mask (active_layer)) mask = gimp_layer_get_mask (active_layer);
if (mask)
{ {
gimp_image_mask_layer_mask (gimage, active_layer); gint off_x, off_y;
gimp_item_offsets (GIMP_ITEM (mask), &off_x, &off_y);
gimp_image_mask_select_channel (gimage,
_("Layer Mask to Selection"),
GIMP_CHANNEL (mask),
off_x, off_y,
op, FALSE, 0.0, 0.0);