namespace cleanups.

1999-06-21  Michael Natterer  <mitschel@cs.tu-berlin.de>

	* app/context_manager.c: namespace cleanups.

	* app/commands.[ch]
	* app/menus.c: moved the "Toggle Selection" menu entry to "View",
	sprinkled some separators and made the layers/channels/paths popup
	menus consistent with Tigert's last ops buttons change.

	* app/fileops.c
	* app/plug_in.c: check for gdisplay_active() returning NULL in
	some more places.

	* app/[all tool related files]:

	- Turned the ToolAction and ToolState #define's into typedef'ed
	  enums, so the compiler can do some more sanity checking.
	- Removed one more unused global variable "active_tool_layer".
	- Removed some #include's from tools.c.
	- Standardized the individual tools' structure names.
	- Moved showing/hiding the tool options to separate functions.
	- Stuff...

	* app/commands.c
	* app/disp_callbacks.c
	* app/gdisplay.c
	* app/tools.c: fixed the segfaults which happened when the image
	of one of the tools which have dialogs (levels/posterize/...) was
	deleted. My approach was to do stricter sanity checking and to set
	some gdisplay pointers correctly where appropriate, so I can't
	tell exactly where the bug was.
	The curves tool now(??) updates on every _second_ display change
	only, which is really obscure.
	Finding/changing the display to operate on should definitely be
	done by connecting to the user context's "display_changed"
	signal.

	* app/gimpset.c: emit the "remove" signal _after_ removing the
	pointer from the set. If this was not a bug but a feature, please
	let me know, we'll need two signals then.
This commit is contained in:
Michael Natterer 1999-06-21 22:12:07 +00:00 committed by Michael Natterer
parent b8bb67bdfa
commit f1b5e1ae47
145 changed files with 3260 additions and 2963 deletions

View File

@ -1,3 +1,44 @@
1999-06-21 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/context_manager.c: namespace cleanups.
* app/commands.[ch]
* app/menus.c: moved the "Toggle Selection" menu entry to "View",
sprinkled some separators and made the layers/channels/paths popup
menus consistent with Tigert's last ops buttons change.
* app/fileops.c
* app/plug_in.c: check for gdisplay_active() returning NULL in
some more places.
* app/[all tool related files]:
- Turned the ToolAction and ToolState #define's into typedef'ed
enums, so the compiler can do some more sanity checking.
- Removed one more unused global variable "active_tool_layer".
- Removed some #include's from tools.c.
- Standardized the individual tools' structure names.
- Moved showing/hiding the tool options to separate functions.
- Stuff...
* app/commands.c
* app/disp_callbacks.c
* app/gdisplay.c
* app/tools.c: fixed the segfaults which happened when the image
of one of the tools which have dialogs (levels/posterize/...) was
deleted. My approach was to do stricter sanity checking and to set
some gdisplay pointers correctly where appropriate, so I can't
tell exactly where the bug was.
The curves tool now(??) updates on every _second_ display change
only, which is really obscure.
Finding/changing the display to operate on should definitely be
done by connecting to the user context's "display_changed"
signal.
* app/gimpset.c: emit the "remove" signal _after_ removing the
pointer from the set. If this was not a bug but a feature, please
let me know, we'll need two signals then.
Mon Jun 21 12:51:15 PDT 1999 Manish Singh <yosh@gimp.org>
* app/Makefile.am: cosmetic change
@ -21,7 +62,7 @@ Mon Jun 21 12:51:15 PDT 1999 Manish Singh <yosh@gimp.org>
order so that the Delete button (trashcan) is always the rightmost
button. Good for consistency. I hope nothing blows up because of
this :)
1999-06-21 Tuomas Kuosmanen <tigert@gimp.org>
* app/layers_dialog.c: Changed the order of the layer ops buttons

View File

@ -74,8 +74,8 @@
typedef struct
{
Resize * resize;
GimpImage* gimage;
Resize *resize;
GimpImage *gimage;
} ImageResize;
/* external functions */
@ -131,7 +131,6 @@ file_close_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay *gdisp;
return_if_no_display (gdisp);
gdisplay_close_window (gdisp, FALSE);
@ -149,7 +148,6 @@ edit_cut_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
global_edit_cut (gdisp);
@ -160,7 +158,6 @@ edit_copy_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
global_edit_copy (gdisp);
@ -171,7 +168,6 @@ edit_paste_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
global_edit_paste (gdisp, 0);
@ -182,7 +178,6 @@ edit_paste_into_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
global_edit_paste (gdisp, 1);
@ -193,7 +188,6 @@ edit_clear_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
edit_clear (gdisp->gimage, gimage_active_drawable (gdisp->gimage));
@ -205,7 +199,6 @@ edit_fill_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
edit_fill (gdisp->gimage, gimage_active_drawable (gdisp->gimage));
@ -217,7 +210,6 @@ edit_stroke_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
gimage_mask_stroke (gdisp->gimage, gimage_active_drawable (gdisp->gimage));
@ -229,7 +221,6 @@ edit_undo_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
undo_pop (gdisp->gimage);
@ -240,7 +231,6 @@ edit_redo_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
undo_redo (gdisp->gimage);
@ -251,7 +241,6 @@ edit_named_cut_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
named_edit_cut (gdisp);
@ -262,7 +251,6 @@ edit_named_copy_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
named_edit_copy (gdisp);
@ -273,30 +261,16 @@ edit_named_paste_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
named_edit_paste (gdisp);
}
void
select_toggle_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
selection_hide (gdisp->select, (void *) gdisp);
gdisplays_flush ();
}
void
select_invert_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
gimage_mask_invert (gdisp->gimage);
@ -308,7 +282,6 @@ select_all_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
gimage_mask_all (gdisp->gimage);
@ -320,7 +293,6 @@ select_none_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
gimage_mask_none (gdisp->gimage);
@ -332,7 +304,6 @@ select_float_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
gimage_mask_float (gdisp->gimage, gimage_active_drawable (gdisp->gimage),
@ -345,7 +316,6 @@ select_sharpen_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
gimage_mask_sharpen (gdisp->gimage);
@ -357,7 +327,6 @@ select_border_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
query_size_box (N_("Border Selection"),
@ -376,7 +345,6 @@ select_feather_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
query_size_box (N_("Feather Selection"),
@ -395,7 +363,6 @@ select_grow_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
query_size_box (N_("Grow Selection"),
@ -414,7 +381,6 @@ select_shrink_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
query_size_box (N_("Shrink Selection"),
@ -433,7 +399,6 @@ select_save_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
gimage_mask_save (gdisp->gimage);
@ -445,7 +410,6 @@ view_dot_for_dot_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay *gdisp;
return_if_no_display (gdisp);
gdisplay_set_dot_for_dot (gdisp, GTK_CHECK_MENU_ITEM (widget)->active);
@ -456,7 +420,6 @@ view_zoomin_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay *gdisp;
return_if_no_display (gdisp);
change_scale (gdisp, ZOOMIN);
@ -467,7 +430,6 @@ view_zoomout_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay *gdisp;
return_if_no_display (gdisp);
change_scale (gdisp, ZOOMOUT);
@ -479,7 +441,6 @@ view_zoom_val (GtkWidget *widget,
int val)
{
GDisplay *gdisp;
return_if_no_display (gdisp);
change_scale (gdisp, val);
@ -553,7 +514,6 @@ view_window_info_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
if (! gdisp->window_info_dialog)
@ -562,12 +522,22 @@ view_window_info_cmd_callback (GtkWidget *widget,
info_dialog_popup (gdisp->window_info_dialog);
}
void
view_toggle_selection_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
selection_hide (gdisp->select, (void *) gdisp);
gdisplays_flush ();
}
void
view_toggle_rulers_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
/* This routine use promiscuous knowledge of gtk internals
@ -632,7 +602,6 @@ view_snap_to_guides_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
gdisp->snap_to_guides = GTK_CHECK_MENU_ITEM (widget)->active;
@ -643,7 +612,6 @@ view_toggle_statusbar_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
if (!GTK_CHECK_MENU_ITEM (widget)->active)
@ -663,7 +631,6 @@ view_new_view_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay *gdisp;
return_if_no_display (gdisp);
gdisplay_new_view (gdisp);
@ -674,7 +641,6 @@ view_shrink_wrap_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay *gdisp;
return_if_no_display (gdisp);
shrink_wrap_display (gdisp);
@ -685,7 +651,6 @@ image_equalize_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
image_equalize ((void *) gdisp->gimage);
@ -697,7 +662,6 @@ image_invert_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
image_invert ((void *) gdisp->gimage);
@ -709,7 +673,6 @@ image_desaturate_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
image_desaturate ((void *) gdisp->gimage);
@ -721,7 +684,6 @@ channel_ops_duplicate_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
channel_ops_duplicate ((void *) gdisp->gimage);
@ -732,7 +694,6 @@ channel_ops_offset_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
channel_ops_offset ((void *) gdisp->gimage);
@ -743,7 +704,6 @@ image_convert_rgb_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
convert_to_rgb ((void *) gdisp->gimage);
@ -754,7 +714,6 @@ image_convert_grayscale_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
convert_to_grayscale ((void *) gdisp->gimage);
@ -765,7 +724,6 @@ image_convert_indexed_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
convert_to_indexed ((void *) gdisp->gimage);
@ -892,7 +850,6 @@ layers_raise_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
gimage_raise_layer (gdisp->gimage, gdisp->gimage->active_layer);
@ -904,7 +861,6 @@ layers_lower_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
gimage_lower_layer (gdisp->gimage, gdisp->gimage->active_layer);
@ -916,7 +872,6 @@ layers_raise_to_top_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
gimage_raise_layer_to_top (gdisp->gimage, gdisp->gimage->active_layer);
@ -928,7 +883,6 @@ layers_lower_to_bottom_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
gimage_lower_layer_to_bottom (gdisp->gimage, gdisp->gimage->active_layer);
@ -940,7 +894,6 @@ layers_anchor_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
floating_sel_anchor (gimage_get_active_layer (gdisp->gimage));
@ -952,7 +905,6 @@ layers_merge_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
layers_dialog_layer_merge_query (gdisp->gimage, TRUE);
@ -963,7 +915,6 @@ layers_flatten_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
gimage_flatten (gdisp->gimage);
@ -975,7 +926,6 @@ layers_alpha_select_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
gimage_mask_layer_alpha (gdisp->gimage, gdisp->gimage->active_layer);
@ -987,7 +937,6 @@ layers_mask_select_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
gimage_mask_layer_mask (gdisp->gimage, gdisp->gimage->active_layer);
@ -999,7 +948,6 @@ layers_add_alpha_channel_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
layer_add_alpha ( gdisp->gimage->active_layer);
@ -1026,25 +974,22 @@ tools_select_cmd_callback (GtkWidget *widget,
guint callback_action)
{
GDisplay * gdisp;
gdisp = gdisplay_active ();
if (!tool_info[callback_action].init_func)
{
/* Activate the approriate widget */
gtk_widget_activate (tool_info[callback_action].tool_widget);
}
else
{
/* if the tool_info has an init_func */
gtk_widget_activate (tool_info[callback_action].tool_widget);
if (gdisp)
(* tool_info[callback_action].init_func) (gdisp);
}
/* Activate the approriate widget.
* Implicitly calls tools_select()
*/
gtk_widget_activate (tool_info[callback_action].tool_widget);
if (gdisp)
active_tool->drawable = gimage_active_drawable (gdisp->gimage);
/* Complete the initialisation by doing the same stuff
* tools_initialize() does after it did what tools_select() does
*/
if (tool_info[callback_action].init_func && gdisp)
{
(* tool_info[callback_action].init_func) (gdisp);
active_tool->gdisp_ptr = gdisp;
active_tool->drawable = gimage_active_drawable (gdisp->gimage);
}
}
void
@ -1088,13 +1033,9 @@ dialogs_lc_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
gdisp = gdisplay_active ();
if (gdisp == NULL)
lc_dialog_create (NULL);
else
lc_dialog_create (gdisp->gimage);
lc_dialog_create (gdisp ? gdisp->gimage : NULL);
}
static void

View File

@ -1,104 +1,112 @@
#ifndef __COMMANDS_H__
#define __COMMANDS_H__
#include "gtk/gtk.h"
void file_new_cmd_callback (GtkWidget *widget,
gpointer callback_data,
guint callback_action);
void file_open_cmd_callback (GtkWidget *, gpointer);
void file_save_cmd_callback (GtkWidget *, gpointer);
void file_new_cmd_callback (GtkWidget *widget,
gpointer callback_data,
guint callback_action);
void file_open_cmd_callback (GtkWidget *, gpointer);
void file_save_cmd_callback (GtkWidget *, gpointer);
void file_save_as_cmd_callback (GtkWidget *, gpointer);
void file_revert_cmd_callback (GtkWidget *, gpointer);
void file_pref_cmd_callback (GtkWidget *, gpointer);
void file_close_cmd_callback (GtkWidget *, gpointer);
void file_quit_cmd_callback (GtkWidget *, gpointer);
void edit_cut_cmd_callback (GtkWidget *, gpointer);
void edit_copy_cmd_callback (GtkWidget *, gpointer);
void edit_paste_cmd_callback (GtkWidget *, gpointer);
void edit_paste_into_cmd_callback (GtkWidget *, gpointer);
void edit_clear_cmd_callback (GtkWidget *, gpointer);
void edit_fill_cmd_callback (GtkWidget *, gpointer);
void edit_stroke_cmd_callback (GtkWidget *, gpointer);
void edit_undo_cmd_callback (GtkWidget *, gpointer);
void edit_redo_cmd_callback (GtkWidget *, gpointer);
void edit_named_cut_cmd_callback (GtkWidget *, gpointer);
void edit_named_copy_cmd_callback (GtkWidget *, gpointer);
void file_revert_cmd_callback (GtkWidget *, gpointer);
void file_pref_cmd_callback (GtkWidget *, gpointer);
void file_close_cmd_callback (GtkWidget *, gpointer);
void file_quit_cmd_callback (GtkWidget *, gpointer);
void edit_cut_cmd_callback (GtkWidget *, gpointer);
void edit_copy_cmd_callback (GtkWidget *, gpointer);
void edit_paste_cmd_callback (GtkWidget *, gpointer);
void edit_paste_into_cmd_callback (GtkWidget *, gpointer);
void edit_clear_cmd_callback (GtkWidget *, gpointer);
void edit_fill_cmd_callback (GtkWidget *, gpointer);
void edit_stroke_cmd_callback (GtkWidget *, gpointer);
void edit_undo_cmd_callback (GtkWidget *, gpointer);
void edit_redo_cmd_callback (GtkWidget *, gpointer);
void edit_named_cut_cmd_callback (GtkWidget *, gpointer);
void edit_named_copy_cmd_callback (GtkWidget *, gpointer);
void edit_named_paste_cmd_callback (GtkWidget *, gpointer);
void select_toggle_cmd_callback (GtkWidget *, gpointer);
void select_invert_cmd_callback (GtkWidget *, gpointer);
void select_all_cmd_callback (GtkWidget *, gpointer);
void select_none_cmd_callback (GtkWidget *, gpointer);
void select_float_cmd_callback (GtkWidget *, gpointer);
void select_sharpen_cmd_callback (GtkWidget *, gpointer);
void select_border_cmd_callback (GtkWidget *, gpointer);
void select_feather_cmd_callback (GtkWidget *, gpointer);
void select_grow_cmd_callback (GtkWidget *, gpointer);
void select_shrink_cmd_callback (GtkWidget *, gpointer);
void select_invert_cmd_callback (GtkWidget *, gpointer);
void select_all_cmd_callback (GtkWidget *, gpointer);
void select_none_cmd_callback (GtkWidget *, gpointer);
void select_float_cmd_callback (GtkWidget *, gpointer);
void select_sharpen_cmd_callback (GtkWidget *, gpointer);
void select_border_cmd_callback (GtkWidget *, gpointer);
void select_feather_cmd_callback (GtkWidget *, gpointer);
void select_grow_cmd_callback (GtkWidget *, gpointer);
void select_shrink_cmd_callback (GtkWidget *, gpointer);
void select_by_color_cmd_callback (GtkWidget *, gpointer);
void select_save_cmd_callback (GtkWidget *, gpointer);
void view_dot_for_dot_callback (GtkWidget *, gpointer);
void view_zoomin_cmd_callback (GtkWidget *, gpointer);
void view_zoomout_cmd_callback (GtkWidget *, gpointer);
void view_zoom_16_1_callback (GtkWidget *, gpointer);
void view_zoom_8_1_callback (GtkWidget *, gpointer);
void view_zoom_4_1_callback (GtkWidget *, gpointer);
void view_zoom_2_1_callback (GtkWidget *, gpointer);
void view_zoom_1_1_callback (GtkWidget *, gpointer);
void view_zoom_1_2_callback (GtkWidget *, gpointer);
void view_zoom_1_4_callback (GtkWidget *, gpointer);
void view_zoom_1_8_callback (GtkWidget *, gpointer);
void view_zoom_1_16_callback (GtkWidget *, gpointer);
void view_window_info_cmd_callback (GtkWidget *, gpointer);
void view_toggle_rulers_cmd_callback (GtkWidget *, gpointer);
void view_toggle_guides_cmd_callback (GtkWidget *, gpointer);
void select_save_cmd_callback (GtkWidget *, gpointer);
void view_dot_for_dot_callback (GtkWidget *, gpointer);
void view_zoomin_cmd_callback (GtkWidget *, gpointer);
void view_zoomout_cmd_callback (GtkWidget *, gpointer);
void view_zoom_16_1_callback (GtkWidget *, gpointer);
void view_zoom_8_1_callback (GtkWidget *, gpointer);
void view_zoom_4_1_callback (GtkWidget *, gpointer);
void view_zoom_2_1_callback (GtkWidget *, gpointer);
void view_zoom_1_1_callback (GtkWidget *, gpointer);
void view_zoom_1_2_callback (GtkWidget *, gpointer);
void view_zoom_1_4_callback (GtkWidget *, gpointer);
void view_zoom_1_8_callback (GtkWidget *, gpointer);
void view_zoom_1_16_callback (GtkWidget *, gpointer);
void view_window_info_cmd_callback (GtkWidget *, gpointer);
void view_toggle_selection_cmd_callback (GtkWidget *, gpointer);
void view_toggle_rulers_cmd_callback (GtkWidget *, gpointer);
void view_toggle_guides_cmd_callback (GtkWidget *, gpointer);
void view_toggle_statusbar_cmd_callback (GtkWidget *, gpointer);
void view_snap_to_guides_cmd_callback (GtkWidget *, gpointer);
void view_new_view_cmd_callback (GtkWidget *, gpointer);
void view_shrink_wrap_cmd_callback (GtkWidget *, gpointer);
void image_equalize_cmd_callback (GtkWidget *, gpointer);
void image_invert_cmd_callback (GtkWidget *, gpointer);
void image_desaturate_cmd_callback (GtkWidget *, gpointer);
void image_convert_rgb_cmd_callback (GtkWidget *, gpointer);
void view_snap_to_guides_cmd_callback (GtkWidget *, gpointer);
void view_new_view_cmd_callback (GtkWidget *, gpointer);
void view_shrink_wrap_cmd_callback (GtkWidget *, gpointer);
void image_equalize_cmd_callback (GtkWidget *, gpointer);
void image_invert_cmd_callback (GtkWidget *, gpointer);
void image_desaturate_cmd_callback (GtkWidget *, gpointer);
void image_convert_rgb_cmd_callback (GtkWidget *, gpointer);
void image_convert_grayscale_cmd_callback (GtkWidget *, gpointer);
void image_convert_indexed_cmd_callback (GtkWidget *, gpointer);
void image_resize_cmd_callback (GtkWidget *, gpointer);
void image_scale_cmd_callback (GtkWidget *, gpointer);
void image_convert_indexed_cmd_callback (GtkWidget *, gpointer);
void image_resize_cmd_callback (GtkWidget *, gpointer);
void image_scale_cmd_callback (GtkWidget *, gpointer);
void channel_ops_duplicate_cmd_callback (GtkWidget *, gpointer);
void channel_ops_offset_cmd_callback (GtkWidget *, gpointer);
void layers_previous_cmd_callback (GtkWidget *, gpointer);
void layers_next_cmd_callback (GtkWidget *, gpointer);
void layers_raise_cmd_callback (GtkWidget *, gpointer);
void layers_lower_cmd_callback (GtkWidget *, gpointer);
void layers_raise_to_top_cmd_callback (GtkWidget *, gpointer);
void layers_lower_to_bottom_cmd_callback (GtkWidget *, gpointer);
void layers_anchor_cmd_callback (GtkWidget *, gpointer);
void layers_merge_cmd_callback (GtkWidget *, gpointer);
void layers_flatten_cmd_callback (GtkWidget *, gpointer);
void layers_alpha_select_cmd_callback (GtkWidget *, gpointer);
void layers_mask_select_cmd_callback (GtkWidget *, gpointer);
void channel_ops_offset_cmd_callback (GtkWidget *, gpointer);
void layers_previous_cmd_callback (GtkWidget *, gpointer);
void layers_next_cmd_callback (GtkWidget *, gpointer);
void layers_raise_cmd_callback (GtkWidget *, gpointer);
void layers_lower_cmd_callback (GtkWidget *, gpointer);
void layers_raise_to_top_cmd_callback (GtkWidget *, gpointer);
void layers_lower_to_bottom_cmd_callback (GtkWidget *, gpointer);
void layers_anchor_cmd_callback (GtkWidget *, gpointer);
void layers_merge_cmd_callback (GtkWidget *, gpointer);
void layers_flatten_cmd_callback (GtkWidget *, gpointer);
void layers_alpha_select_cmd_callback (GtkWidget *, gpointer);
void layers_mask_select_cmd_callback (GtkWidget *, gpointer);
void layers_add_alpha_channel_cmd_callback (GtkWidget *, gpointer);
void tools_default_colors_cmd_callback (GtkWidget *, gpointer);
void tools_swap_colors_cmd_callback (GtkWidget *, gpointer);
void tools_select_cmd_callback (GtkWidget *widget,
gpointer callback_data,
guint callback_action);
void filters_repeat_cmd_callback (GtkWidget *widget,
gpointer callback_data,
guint callback_action);
void dialogs_brushes_cmd_callback (GtkWidget *, gpointer);
void dialogs_patterns_cmd_callback (GtkWidget *, gpointer);
void dialogs_palette_cmd_callback (GtkWidget *, gpointer);
void tools_swap_colors_cmd_callback (GtkWidget *, gpointer);
void tools_select_cmd_callback (GtkWidget *widget,
gpointer callback_data,
guint callback_action);
void filters_repeat_cmd_callback (GtkWidget *widget,
gpointer callback_data,
guint callback_action);
void dialogs_brushes_cmd_callback (GtkWidget *, gpointer);
void dialogs_patterns_cmd_callback (GtkWidget *, gpointer);
void dialogs_palette_cmd_callback (GtkWidget *, gpointer);
void dialogs_gradient_editor_cmd_callback (GtkWidget *, gpointer);
void dialogs_lc_cmd_callback (GtkWidget *, gpointer);
void dialogs_lc_cmd_callback (GtkWidget *, gpointer);
void dialogs_indexed_palette_cmd_callback (GtkWidget *, gpointer);
void dialogs_tools_options_cmd_callback (GtkWidget *, gpointer);
void dialogs_input_devices_cmd_callback (GtkWidget *, gpointer);
void dialogs_device_status_cmd_callback (GtkWidget *, gpointer);
void dialogs_error_console_cmd_callback (GtkWidget *, gpointer);
void about_dialog_cmd_callback (GtkWidget *, gpointer);
void tips_dialog_cmd_callback (GtkWidget *, gpointer);
void dialogs_module_browser_cmd_callback (GtkWidget *, gpointer);
void dialogs_tools_options_cmd_callback (GtkWidget *, gpointer);
void dialogs_input_devices_cmd_callback (GtkWidget *, gpointer);
void dialogs_device_status_cmd_callback (GtkWidget *, gpointer);
void dialogs_error_console_cmd_callback (GtkWidget *, gpointer);
void dialogs_module_browser_cmd_callback (GtkWidget *, gpointer);
void about_dialog_cmd_callback (GtkWidget *, gpointer);
void tips_dialog_cmd_callback (GtkWidget *, gpointer);
#endif /* __COMMANDS_H__ */

View File

@ -1218,6 +1218,7 @@ plug_in_repeat (int with_interface)
if (last_plug_in)
{
gdisplay = gdisplay_active ();
if (!gdisplay) return;
/* construct the procedures arguments */
args = g_new (Argument, 3);
@ -2286,6 +2287,7 @@ plug_in_callback (GtkWidget *widget,
/* get the active gdisplay */
gdisplay = gdisplay_active ();
if (!gdisplay) return;
proc_rec = (ProcRecord*) client_data;

View File

@ -57,29 +57,32 @@ static ColorBalanceDialog *color_balance_dialog = NULL;
/* color balance action functions */
static void color_balance_button_press (Tool *, GdkEventButton *, gpointer);
static void color_balance_button_release (Tool *, GdkEventButton *, gpointer);
static void color_balance_motion (Tool *, GdkEventMotion *, gpointer);
static void color_balance_cursor_update (Tool *, GdkEventMotion *, gpointer);
static void color_balance_control (Tool *, int, gpointer);
static void color_balance_control (Tool *, ToolAction, gpointer);
static ColorBalanceDialog * color_balance_new_dialog (void);
static void color_balance_update (ColorBalanceDialog *, int);
static void color_balance_preview (ColorBalanceDialog *);
static void color_balance_ok_callback (GtkWidget *, gpointer);
static void color_balance_cancel_callback (GtkWidget *, gpointer);
static gint color_balance_delete_callback (GtkWidget *, GdkEvent *, gpointer);
static void color_balance_shadows_callback (GtkWidget *, gpointer);
static void color_balance_midtones_callback (GtkWidget *, gpointer);
static void color_balance_highlights_callback (GtkWidget *, gpointer);
static void color_balance_preserve_update (GtkWidget *, gpointer);
static void color_balance_preview_update (GtkWidget *, gpointer);
static void color_balance_cr_scale_update (GtkAdjustment *, gpointer);
static void color_balance_mg_scale_update (GtkAdjustment *, gpointer);
static void color_balance_yb_scale_update (GtkAdjustment *, gpointer);
static void color_balance_cr_text_update (GtkWidget *, gpointer);
static void color_balance_mg_text_update (GtkWidget *, gpointer);
static void color_balance_yb_text_update (GtkWidget *, gpointer);
static ColorBalanceDialog * color_balance_new_dialog (void);
static void color_balance_update (ColorBalanceDialog *, int);
static void color_balance_preview (ColorBalanceDialog *);
static void color_balance_ok_callback (GtkWidget *, gpointer);
static void color_balance_cancel_callback (GtkWidget *, gpointer);
static gint color_balance_delete_callback (GtkWidget *, GdkEvent *,
gpointer);
static void color_balance_shadows_callback (GtkWidget *, gpointer);
static void color_balance_midtones_callback (GtkWidget *, gpointer);
static void color_balance_highlights_callback (GtkWidget *, gpointer);
static void color_balance_preserve_update (GtkWidget *, gpointer);
static void color_balance_preview_update (GtkWidget *, gpointer);
static void color_balance_cr_scale_update (GtkAdjustment *, gpointer);
static void color_balance_mg_scale_update (GtkAdjustment *, gpointer);
static void color_balance_yb_scale_update (GtkAdjustment *, gpointer);
static void color_balance_cr_text_update (GtkWidget *, gpointer);
static void color_balance_mg_text_update (GtkWidget *, gpointer);
static void color_balance_yb_text_update (GtkWidget *, gpointer);
/* color balance machinery */
@ -183,9 +186,9 @@ color_balance_cursor_update (Tool *tool,
}
static void
color_balance_control (Tool *tool,
int action,
gpointer gdisp_ptr)
color_balance_control (Tool *tool,
ToolAction action,
gpointer gdisp_ptr)
{
ColorBalance * color_bal;
@ -193,11 +196,13 @@ color_balance_control (Tool *tool,
switch (action)
{
case PAUSE :
case PAUSE:
break;
case RESUME :
case RESUME:
break;
case HALT :
case HALT:
if (color_balance_dialog)
{
active_tool->preserve = TRUE;
@ -207,6 +212,9 @@ color_balance_control (Tool *tool,
color_balance_cancel_callback (NULL, (gpointer) color_balance_dialog);
}
break;
default:
break;
}
}

View File

@ -91,32 +91,33 @@ static CRMatrix CR_basis =
/* curves action functions */
static void curves_button_press (Tool *, GdkEventButton *, gpointer);
static void curves_button_release (Tool *, GdkEventButton *, gpointer);
static void curves_motion (Tool *, GdkEventMotion *, gpointer);
static void curves_cursor_update (Tool *, GdkEventMotion *, gpointer);
static void curves_control (Tool *, int, gpointer);
static void curves_control (Tool *, ToolAction, gpointer);
static CurvesDialog * curves_new_dialog (void);
static void curves_update (CurvesDialog *, int);
static void curves_plot_curve (CurvesDialog *, int, int, int, int);
static void curves_preview (CurvesDialog *);
static void curves_value_callback (GtkWidget *, gpointer);
static void curves_red_callback (GtkWidget *, gpointer);
static void curves_green_callback (GtkWidget *, gpointer);
static void curves_blue_callback (GtkWidget *, gpointer);
static void curves_alpha_callback (GtkWidget *, gpointer);
static void curves_smooth_callback (GtkWidget *, gpointer);
static void curves_free_callback (GtkWidget *, gpointer);
static void curves_reset_callback (GtkWidget *, gpointer);
static void curves_ok_callback (GtkWidget *, gpointer);
static void curves_cancel_callback (GtkWidget *, gpointer);
static gint curves_delete_callback (GtkWidget *, GdkEvent *, gpointer);
static void curves_preview_update (GtkWidget *, gpointer);
static gint curves_xrange_events (GtkWidget *, GdkEvent *, CurvesDialog *);
static gint curves_yrange_events (GtkWidget *, GdkEvent *, CurvesDialog *);
static gint curves_graph_events (GtkWidget *, GdkEvent *, CurvesDialog *);
static void curves_CR_compose (CRMatrix, CRMatrix, CRMatrix);
static CurvesDialog * curves_new_dialog (void);
static void curves_update (CurvesDialog *, int);
static void curves_plot_curve (CurvesDialog *, int, int, int, int);
static void curves_preview (CurvesDialog *);
static void curves_value_callback (GtkWidget *, gpointer);
static void curves_red_callback (GtkWidget *, gpointer);
static void curves_green_callback (GtkWidget *, gpointer);
static void curves_blue_callback (GtkWidget *, gpointer);
static void curves_alpha_callback (GtkWidget *, gpointer);
static void curves_smooth_callback (GtkWidget *, gpointer);
static void curves_free_callback (GtkWidget *, gpointer);
static void curves_reset_callback (GtkWidget *, gpointer);
static void curves_ok_callback (GtkWidget *, gpointer);
static void curves_cancel_callback (GtkWidget *, gpointer);
static gint curves_delete_callback (GtkWidget *, GdkEvent *, gpointer);
static void curves_preview_update (GtkWidget *, gpointer);
static gint curves_xrange_events (GtkWidget *, GdkEvent *, CurvesDialog *);
static gint curves_yrange_events (GtkWidget *, GdkEvent *, CurvesDialog *);
static gint curves_graph_events (GtkWidget *, GdkEvent *, CurvesDialog *);
static void curves_CR_compose (CRMatrix, CRMatrix, CRMatrix);
/* curves machinery */
@ -174,7 +175,7 @@ curves_button_press (Tool *tool,
gdisp = gdisp_ptr;
drawable = gimage_active_drawable (gdisp->gimage);
if(drawable != tool->drawable)
if (drawable != tool->drawable)
{
active_tool->preserve = TRUE;
image_map_abort (curves_dialog->image_map);
@ -186,15 +187,14 @@ curves_button_press (Tool *tool,
if(tool)
tool->state = ACTIVE;
}
static void
curves_colour_update(Tool *tool,
GDisplay *gdisp,
GimpDrawable *drawable,
gint x,
gint y)
curves_colour_update (Tool *tool,
GDisplay *gdisp,
GimpDrawable *drawable,
gint x,
gint y)
{
unsigned char *color;
int offx, offy;
@ -334,9 +334,9 @@ curves_cursor_update (Tool *tool,
}
static void
curves_control (Tool *tool,
int action,
gpointer gdisp_ptr)
curves_control (Tool *tool,
ToolAction action,
gpointer gdisp_ptr)
{
Curves * _curves;
@ -346,8 +346,10 @@ curves_control (Tool *tool,
{
case PAUSE :
break;
case RESUME :
break;
case HALT :
if (curves_dialog)
{
@ -358,6 +360,9 @@ curves_control (Tool *tool,
curves_cancel_callback (NULL, (gpointer) curves_dialog);
}
break;
default:
break;
}
}
@ -386,7 +391,8 @@ tools_new_curves ()
tool->button_press_func = curves_button_press;
tool->button_release_func = curves_button_release;
tool->motion_func = curves_motion;
tool->arrow_keys_func = standard_arrow_keys_func; tool->modifier_key_func = standard_modifier_key_func;
tool->arrow_keys_func = standard_arrow_keys_func;
tool->modifier_key_func = standard_modifier_key_func;
tool->cursor_update_func = curves_cursor_update;
tool->control_func = curves_control;
tool->preserve = TRUE;

View File

@ -83,14 +83,17 @@ static void hue_saturation_button_press (Tool *, GdkEventButton *, gpointer)
static void hue_saturation_button_release (Tool *, GdkEventButton *, gpointer);
static void hue_saturation_motion (Tool *, GdkEventMotion *, gpointer);
static void hue_saturation_cursor_update (Tool *, GdkEventMotion *, gpointer);
static void hue_saturation_control (Tool *, int, gpointer);
static void hue_saturation_control (Tool *, ToolAction, gpointer);
static HueSaturationDialog * hue_saturation_new_dialog (void);
static void hue_saturation_update (HueSaturationDialog *, int);
static HueSaturationDialog * hue_saturation_new_dialog (void);
static void hue_saturation_update (HueSaturationDialog *,
int);
static void hue_saturation_preview (HueSaturationDialog *);
static void hue_saturation_ok_callback (GtkWidget *, gpointer);
static void hue_saturation_cancel_callback (GtkWidget *, gpointer);
static gint hue_saturation_delete_callback (GtkWidget *, GdkEvent *, gpointer);
static gint hue_saturation_delete_callback (GtkWidget *, GdkEvent *,
gpointer);
static void hue_saturation_master_callback (GtkWidget *, gpointer);
static void hue_saturation_R_callback (GtkWidget *, gpointer);
static void hue_saturation_Y_callback (GtkWidget *, gpointer);
@ -105,7 +108,8 @@ static void hue_saturation_saturation_scale_update (GtkAdjustment *, gpointer)
static void hue_saturation_hue_text_update (GtkWidget *, gpointer);
static void hue_saturation_lightness_text_update (GtkWidget *, gpointer);
static void hue_saturation_saturation_text_update (GtkWidget *, gpointer);
static gint hue_saturation_hue_partition_events (GtkWidget *, GdkEvent *, HueSaturationDialog *);
static gint hue_saturation_hue_partition_events (GtkWidget *, GdkEvent *,
HueSaturationDialog *);
/* hue saturation machinery */
@ -262,9 +266,9 @@ hue_saturation_cursor_update (Tool *tool,
}
static void
hue_saturation_control (Tool *tool,
int action,
gpointer gdisp_ptr)
hue_saturation_control (Tool *tool,
ToolAction action,
gpointer gdisp_ptr)
{
HueSaturation * color_bal;
@ -272,11 +276,13 @@ hue_saturation_control (Tool *tool,
switch (action)
{
case PAUSE :
case PAUSE:
break;
case RESUME :
case RESUME:
break;
case HALT :
case HALT:
if (hue_saturation_dialog)
{
active_tool->preserve = TRUE;
@ -286,6 +292,9 @@ hue_saturation_control (Tool *tool,
hue_saturation_cancel_callback (NULL, (gpointer) hue_saturation_dialog);
}
break;
default:
break;
}
}
@ -314,7 +323,8 @@ tools_new_hue_saturation ()
tool->button_press_func = hue_saturation_button_press;
tool->button_release_func = hue_saturation_button_release;
tool->motion_func = hue_saturation_motion;
tool->arrow_keys_func = standard_arrow_keys_func; tool->modifier_key_func = standard_modifier_key_func;
tool->arrow_keys_func = standard_arrow_keys_func;
tool->modifier_key_func = standard_modifier_key_func;
tool->cursor_update_func = hue_saturation_cursor_update;
tool->control_func = hue_saturation_control;
tool->preserve = FALSE;

View File

@ -28,8 +28,8 @@
#include "libgimp/gimpintl.h"
#define TEXT_WIDTH 45
#define HISTOGRAM_WIDTH 256
#define TEXT_WIDTH 45
#define HISTOGRAM_WIDTH 256
#define HISTOGRAM_HEIGHT 150
/* the threshold structures */
@ -53,21 +53,20 @@ static void threshold_button_press (Tool *, GdkEventButton *, gpointer);
static void threshold_button_release (Tool *, GdkEventButton *, gpointer);
static void threshold_motion (Tool *, GdkEventMotion *, gpointer);
static void threshold_cursor_update (Tool *, GdkEventMotion *, gpointer);
static void threshold_control (Tool *, int, gpointer);
static void threshold_control (Tool *, ToolAction, gpointer);
static ThresholdDialog * threshold_new_dialog (void);
static void threshold_preview (ThresholdDialog *);
static void threshold_ok_callback (GtkWidget *, gpointer);
static void threshold_cancel_callback (GtkWidget *, gpointer);
static gint threshold_delete_callback (GtkWidget *, GdkEvent *,
gpointer);
static void threshold_preview_update (GtkWidget *, gpointer);
static void threshold_low_threshold_text_update (GtkWidget *, gpointer);
static void threshold_high_threshold_text_update (GtkWidget *, gpointer);
static ThresholdDialog * threshold_new_dialog (void);
static void threshold_preview (ThresholdDialog *);
static void threshold_ok_callback (GtkWidget *, gpointer);
static void threshold_cancel_callback (GtkWidget *, gpointer);
static gint threshold_delete_callback (GtkWidget *, GdkEvent *, gpointer);
static void threshold_preview_update (GtkWidget *, gpointer);
static void threshold_low_threshold_text_update (GtkWidget *, gpointer);
static void threshold_high_threshold_text_update (GtkWidget *, gpointer);
static void threshold (PixelRegion *, PixelRegion *, void *);
static void threshold_histogram_range (HistogramWidget *, int, int,
void*);
static void threshold (PixelRegion *, PixelRegion *, void *);
static void threshold_histogram_range (HistogramWidget *, int, int, void *);
/* threshold machinery */
@ -195,9 +194,9 @@ threshold_cursor_update (Tool *tool,
}
static void
threshold_control (Tool *tool,
int action,
gpointer gdisp_ptr)
threshold_control (Tool *tool,
ToolAction action,
gpointer gdisp_ptr)
{
Threshold * thresh;
@ -205,11 +204,13 @@ threshold_control (Tool *tool,
switch (action)
{
case PAUSE :
case PAUSE:
break;
case RESUME :
case RESUME:
break;
case HALT :
case HALT:
if (threshold_dialog)
{
active_tool->preserve = TRUE;
@ -219,6 +220,9 @@ threshold_control (Tool *tool,
threshold_cancel_callback (NULL, (gpointer) threshold_dialog);
}
break;
default:
break;
}
}
@ -250,12 +254,15 @@ tools_new_threshold ()
tool->scroll_lock = 1; /* Disallow scrolling */
tool->auto_snap_to = TRUE;
tool->private = (void *) private;
tool->button_press_func = threshold_button_press;
tool->button_release_func = threshold_button_release;
tool->motion_func = threshold_motion;
tool->arrow_keys_func = standard_arrow_keys_func; tool->modifier_key_func = standard_modifier_key_func;
tool->arrow_keys_func = standard_arrow_keys_func;
tool->modifier_key_func = standard_modifier_key_func;
tool->cursor_update_func = threshold_cursor_update;
tool->control_func = threshold_control;
tool->preserve = FALSE;
return tool;

View File

@ -160,11 +160,10 @@ static int ModeEdit = EXTEND_NEW;
/* local function prototypes */
static void bezier_select_button_press (Tool *, GdkEventButton *, gpointer);
static void bezier_select_button_release (Tool *, GdkEventButton *, gpointer);
static void bezier_select_motion (Tool *, GdkEventMotion *, gpointer);
static void bezier_select_control (Tool *, int, gpointer);
static void bezier_select_control (Tool *, ToolAction, gpointer);
static void bezier_select_cursor_update (Tool *, GdkEventMotion *, gpointer);
static void bezier_select_draw (Tool *);
@ -230,7 +229,8 @@ tools_new_bezier_select ()
tool->button_press_func = bezier_select_button_press;
tool->button_release_func = bezier_select_button_release;
tool->motion_func = bezier_select_motion;
tool->arrow_keys_func = standard_arrow_keys_func; tool->modifier_key_func = standard_modifier_key_func;
tool->arrow_keys_func = standard_arrow_keys_func;
tool->modifier_key_func = standard_modifier_key_func;
tool->cursor_update_func = bezier_select_cursor_update;
tool->control_func = bezier_select_control;
tool->preserve = FALSE;
@ -1607,9 +1607,9 @@ bezier_select_cursor_update (Tool *tool,
}
static void
bezier_select_control (Tool *tool,
int action,
gpointer gdisp_ptr)
bezier_select_control (Tool *tool,
ToolAction action,
gpointer gdisp_ptr)
{
BezierSelect * bezier_sel;
@ -1620,13 +1620,16 @@ bezier_select_control (Tool *tool,
case PAUSE :
draw_core_pause (bezier_sel->core, tool);
break;
case RESUME :
draw_core_resume (bezier_sel->core, tool);
break;
case HALT :
draw_core_stop (bezier_sel->core, tool);
bezier_select_reset (bezier_sel);
break;
default:
break;
}
@ -2467,7 +2470,7 @@ bezier_paste_bezierselect_to_current(GDisplay *gdisp,BezierSelect *bsel)
gtk_widget_activate (tool_info[BEZIER_SELECT].tool_widget);
tools_select(BEZIER_SELECT);
active_tool->paused_count = 0;
active_tool->gdisp_ptr = gdisp;;
active_tool->gdisp_ptr = gdisp;
active_tool->drawable = gimage_active_drawable (gdisp->gimage);
tool = active_tool;

View File

@ -45,16 +45,16 @@
#include "tile.h"
/* target size */
#define TARGET_HEIGHT 15
#define TARGET_WIDTH 15
#define TARGET_HEIGHT 15
#define TARGET_WIDTH 15
#define SQR(x) ((x) * (x))
#ifndef M_PI
#define M_PI 3.14159265358979323846
#define M_PI 3.14159265358979323846
#endif /* M_PI */
#define STATUSBAR_SIZE 128
#define STATUSBAR_SIZE 128
/* the blend structures */
@ -63,14 +63,14 @@ typedef double (*RepeatFunc)(double);
typedef struct _BlendTool BlendTool;
struct _BlendTool
{
DrawCore * core; /* Core select object */
DrawCore * core; /* Core select object */
int startx; /* starting x coord */
int starty; /* starting y coord */
int startx; /* starting x coord */
int starty; /* starting y coord */
int endx; /* ending x coord */
int endy; /* ending y coord */
guint context_id; /* for the statusbar */
int endx; /* ending x coord */
int endy; /* ending y coord */
guint context_id; /* for the statusbar */
};
typedef struct _BlendOptions BlendOptions;
@ -107,7 +107,8 @@ struct _BlendOptions
GtkObject *threshold_w;
};
typedef struct {
typedef struct
{
double offset;
double sx, sy;
BlendMode blend_mode;
@ -118,7 +119,8 @@ typedef struct {
RepeatFunc repeat_func;
} RenderBlendData;
typedef struct {
typedef struct
{
PixelRegion *PR;
unsigned char *row_data;
int bytes;
@ -143,15 +145,16 @@ static PixelRegion distR =
/* local function prototypes */
static void gradient_type_callback (GtkWidget *, gpointer);
static void blend_mode_callback (GtkWidget *, gpointer);
static void repeat_type_callback (GtkWidget *, gpointer);
static void blend_button_press (Tool *, GdkEventButton *, gpointer);
static void blend_button_release (Tool *, GdkEventButton *, gpointer);
static void blend_motion (Tool *, GdkEventMotion *, gpointer);
static void blend_cursor_update (Tool *, GdkEventMotion *, gpointer);
static void blend_control (Tool *, int, gpointer);
static void blend_button_press (Tool *, GdkEventButton *, gpointer);
static void blend_button_release (Tool *, GdkEventButton *, gpointer);
static void blend_motion (Tool *, GdkEventMotion *, gpointer);
static void blend_cursor_update (Tool *, GdkEventMotion *, gpointer);
static void blend_control (Tool *, ToolAction, gpointer);
static double gradient_calc_conical_sym_factor (double dist, double *axis, double offset,
double x, double y);
@ -717,9 +720,9 @@ blend_draw (Tool *tool)
}
static void
blend_control (Tool *tool,
int action,
gpointer gdisp_ptr)
blend_control (Tool *tool,
ToolAction action,
gpointer gdisp_ptr)
{
BlendTool * blend_tool;
@ -727,15 +730,20 @@ blend_control (Tool *tool,
switch (action)
{
case PAUSE :
case PAUSE:
draw_core_pause (blend_tool->core, tool);
break;
case RESUME :
case RESUME:
draw_core_resume (blend_tool->core, tool);
break;
case HALT :
case HALT:
draw_core_stop (blend_tool->core, tool);
break;
default:
break;
}
}

View File

@ -86,7 +86,7 @@ static void brightness_contrast_button_press (Tool *, GdkEventButton *, gpoi
static void brightness_contrast_button_release (Tool *, GdkEventButton *, gpointer);
static void brightness_contrast_motion (Tool *, GdkEventMotion *, gpointer);
static void brightness_contrast_cursor_update (Tool *, GdkEventMotion *, gpointer);
static void brightness_contrast_control (Tool *, int, gpointer);
static void brightness_contrast_control (Tool *, ToolAction, gpointer);
static BrightnessContrastDialog * brightness_contrast_new_dialog (void);
static void brightness_contrast_update (BrightnessContrastDialog *, int);
@ -140,17 +140,19 @@ brightness_contrast_cursor_update (Tool *tool,
}
static void
brightness_contrast_control (Tool *tool,
int action,
gpointer gdisp_ptr)
brightness_contrast_control (Tool *tool,
ToolAction action,
gpointer gdisp_ptr)
{
switch (action)
{
case PAUSE :
case PAUSE:
break;
case RESUME :
case RESUME:
break;
case HALT :
case HALT:
if (brightness_contrast_dialog)
{
active_tool->preserve = TRUE;
@ -160,6 +162,9 @@ brightness_contrast_control (Tool *tool,
brightness_contrast_cancel_callback (NULL, (gpointer) brightness_contrast_dialog);
}
break;
default:
break;
}
}
@ -189,7 +194,8 @@ tools_new_brightness_contrast ()
tool->button_press_func = brightness_contrast_button_press;
tool->button_release_func = brightness_contrast_button_release;
tool->motion_func = brightness_contrast_motion;
tool->arrow_keys_func = standard_arrow_keys_func; tool->modifier_key_func = standard_modifier_key_func;
tool->arrow_keys_func = standard_arrow_keys_func;
tool->modifier_key_func = standard_modifier_key_func;
tool->cursor_update_func = brightness_contrast_cursor_update;
tool->control_func = brightness_contrast_control;
tool->preserve = FALSE;
@ -583,5 +589,3 @@ brightness_contrast_contrast_text_update (GtkWidget *w,
brightness_contrast_preview (bcd);
}
}

View File

@ -42,8 +42,8 @@
typedef struct _BucketTool BucketTool;
struct _BucketTool
{
int target_x; /* starting x coord */
int target_y; /* starting y coord */
int target_x; /* starting x coord */
int target_y; /* starting y coord */
};
typedef struct _BucketOptions BucketOptions;
@ -70,15 +70,16 @@ static BucketOptions *bucket_options = NULL;
/* local function prototypes */
static void bucket_fill_button_press (Tool *, GdkEventButton *, gpointer);
static void bucket_fill_button_release (Tool *, GdkEventButton *, gpointer);
static void bucket_fill_motion (Tool *, GdkEventMotion *, gpointer);
static void bucket_fill_cursor_update (Tool *, GdkEventMotion *, gpointer);
static void bucket_fill_control (Tool *, int, gpointer);
static void bucket_fill_control (Tool *, ToolAction, gpointer);
static void bucket_fill_region (BucketFillMode, PixelRegion *, PixelRegion *,
unsigned char *, TempBuf *,
int, int, int);
static void bucket_fill_region (BucketFillMode, PixelRegion *,
PixelRegion *, unsigned char *,
TempBuf *, int, int, int);
static void bucket_fill_line_color (unsigned char *, unsigned char *,
unsigned char *, int, int, int);
static void bucket_fill_line_pattern (unsigned char *, unsigned char *,
@ -317,13 +318,12 @@ bucket_fill_modifier_key_func (Tool *tool,
}
static void
bucket_fill_control (Tool *tool,
int action,
gpointer gdisp_ptr)
bucket_fill_control (Tool *tool,
ToolAction action,
gpointer gdisp_ptr)
{
}
void
bucket_fill (GimpImage *gimage,
GimpDrawable *drawable,
@ -588,7 +588,6 @@ bucket_fill_region (BucketFillMode fill_mode,
/* Global bucket fill functions */
/*********************************/
Tool *
tools_new_bucket_fill (void)
{
@ -626,7 +625,6 @@ tools_new_bucket_fill (void)
return tool;
}
void
tools_free_bucket_fill (Tool *tool)
{

View File

@ -27,6 +27,7 @@
#include "general.h"
#include "gimage_mask.h"
#include "gimprc.h"
#include "gimpset.h"
#include "gdisplay.h"
#include "selection_options.h"
@ -46,8 +47,8 @@
typedef struct _ByColorSelect ByColorSelect;
struct _ByColorSelect
{
int x, y; /* Point from which to execute seed fill */
int operation; /* add, subtract, normal color selection */
int x, y; /* Point from which to execute seed fill */
int operation; /* add, subtract, normal color selection */
};
typedef struct _ByColorDialog ByColorDialog;
@ -57,9 +58,9 @@ struct _ByColorDialog
GtkWidget *preview;
GtkWidget *gimage_name;
int threshold; /* threshold value for color select */
int operation; /* Add, Subtract, Replace */
GImage *gimage; /* gimage which is currently under examination */
int threshold; /* threshold value for color select */
int operation; /* Add, Subtract, Replace */
GImage *gimage; /* gimage which is currently under examination */
};
@ -71,26 +72,31 @@ static ByColorDialog * by_color_dialog = NULL;
/* by_color select action functions */
static void by_color_select_button_press (Tool *, GdkEventButton *, gpointer);
static void by_color_select_button_release (Tool *, GdkEventButton *, gpointer);
static void by_color_select_motion (Tool *, GdkEventMotion *, gpointer);
static void by_color_select_cursor_update (Tool *, GdkEventMotion *, gpointer);
static void by_color_select_control (Tool *, int, gpointer);
static ByColorDialog * by_color_select_new_dialog (void);
static void by_color_select_render (ByColorDialog *, GImage *);
static void by_color_select_draw (ByColorDialog *, GImage *);
static gint by_color_select_preview_events (GtkWidget *, GdkEventButton *, ByColorDialog *);
static void by_color_select_type_callback (GtkWidget *, gpointer);
static void by_color_select_reset_callback (GtkWidget *, gpointer);
static void by_color_select_close_callback (GtkWidget *, gpointer);
static gint by_color_select_delete_callback (GtkWidget *, GdkEvent *, gpointer);
static void by_color_select_fuzzy_update (GtkAdjustment *, gpointer);
static void by_color_select_preview_button_press (ByColorDialog *, GdkEventButton *);
static void by_color_select_button_press (Tool *, GdkEventButton *, gpointer);
static void by_color_select_button_release (Tool *, GdkEventButton *, gpointer);
static void by_color_select_motion (Tool *, GdkEventMotion *, gpointer);
static void by_color_select_cursor_update (Tool *, GdkEventMotion *, gpointer);
static void by_color_select_control (Tool *, ToolAction, gpointer);
static ByColorDialog * by_color_select_new_dialog (void);
static void by_color_select_render (ByColorDialog *, GImage *);
static void by_color_select_draw (ByColorDialog *, GImage *);
static gint by_color_select_preview_events (GtkWidget *, GdkEventButton *,
ByColorDialog *);
static void by_color_select_type_callback (GtkWidget *, gpointer);
static void by_color_select_reset_callback (GtkWidget *, gpointer);
static void by_color_select_close_callback (GtkWidget *, gpointer);
static gint by_color_select_delete_callback (GtkWidget *, GdkEvent *,
gpointer);
static void by_color_select_fuzzy_update (GtkAdjustment *, gpointer);
static void by_color_select_preview_button_press (ByColorDialog *,
GdkEventButton *);
static int is_pixel_sufficiently_different (unsigned char *, unsigned char *, int, int, int, int);
static Channel * by_color_select_color (GImage *, GimpDrawable *, unsigned char *, int, int, int);
/* by_color selection machinery */
static int
@ -418,9 +424,9 @@ by_color_select_cursor_update (Tool *tool,
}
static void
by_color_select_control (Tool *tool,
int action,
gpointer gdisp_ptr)
by_color_select_control (Tool *tool,
ToolAction action,
gpointer gdisp_ptr)
{
ByColorSelect * by_color_sel;
@ -430,17 +436,23 @@ by_color_select_control (Tool *tool,
{
case PAUSE :
break;
case RESUME :
break;
case HALT :
if (by_color_dialog)
{
if (by_color_dialog->gimage)
if (by_color_dialog->gimage &&
gimp_set_have (image_context, by_color_dialog->gimage))
by_color_dialog->gimage->by_color_select = FALSE;
by_color_dialog->gimage = NULL;
by_color_select_close_callback (NULL, (gpointer) by_color_dialog);
}
break;
default:
break;
}
}
@ -483,7 +495,8 @@ tools_new_by_color_select ()
tool->button_press_func = by_color_select_button_press;
tool->button_release_func = by_color_select_button_release;
tool->motion_func = by_color_select_motion;
tool->arrow_keys_func = standard_arrow_keys_func; tool->modifier_key_func = standard_modifier_key_func;
tool->arrow_keys_func = standard_arrow_keys_func;
tool->modifier_key_func = standard_modifier_key_func;
tool->cursor_update_func = by_color_select_cursor_update;
tool->control_func = by_color_select_control;
tool->gdisp_ptr = NULL;

View File

@ -82,12 +82,15 @@ static CloneType non_gui_type;
/* forward function declarations */
static void clone_draw (Tool *);
static void clone_motion (PaintCore *, GimpDrawable *, GimpDrawable *, CloneType, int, int);
static void clone_line_image (GImage *, GImage *, GimpDrawable *, GimpDrawable *, unsigned char *,
unsigned char *, int, int, int, int);
static void clone_line_pattern (GImage *, GimpDrawable *, GPatternP, unsigned char *,
int, int, int, int);
static void clone_draw (Tool *);
static void clone_motion (PaintCore *, GimpDrawable *, GimpDrawable *,
CloneType, int, int);
static void clone_line_image (GImage *, GImage *, GimpDrawable *,
GimpDrawable *, unsigned char *,
unsigned char *, int, int, int, int);
static void clone_line_pattern (GImage *, GimpDrawable *, GPatternP,
unsigned char *, int, int, int, int);
/* functions */
@ -127,19 +130,22 @@ clone_options_new (void)
GtkWidget *radio_frame;
GtkWidget *radio_box;
GtkWidget *radio_button;
int i;
int i;
char *button_names[2] =
static gchar *source_names[] =
{
N_("Image Source"),
N_("Pattern Source")
};
char *align_names[3] =
static gint n_source_names = sizeof (source_names) / sizeof (source_names[0]);
static gchar *align_names[] =
{
N_("Non Aligned"),
N_("Aligned"),
N_("Registered")
};
static gint n_align_names = sizeof (align_names) / sizeof (align_names[0]);
/* the new clone tool options structure */
options = (CloneOptions *) g_malloc (sizeof (CloneOptions));
@ -161,10 +167,10 @@ clone_options_new (void)
gtk_container_add (GTK_CONTAINER (radio_frame), radio_box);
/* the radio buttons */
for (i = 0; i < 2; i++)
for (i = 0; i < n_source_names; i++)
{
radio_button = gtk_radio_button_new_with_label (group,
gettext(button_names[i]));
gettext(source_names[i]));
group = gtk_radio_button_group (GTK_RADIO_BUTTON (radio_button));
gtk_signal_connect (GTK_OBJECT (radio_button), "toggled",
(GtkSignalFunc) clone_type_callback,
@ -187,7 +193,7 @@ clone_options_new (void)
/* the radio buttons */
group = NULL;
for (i = 0; i < 3; i++)
for (i = 0; i < n_align_names; i++)
{
radio_button = gtk_radio_button_new_with_label (group, align_names[i]);
group = gtk_radio_button_group (GTK_RADIO_BUTTON (radio_button));
@ -206,14 +212,14 @@ clone_options_new (void)
}
static void
clone_src_drawable_destroyed_cb(GimpDrawable *drawable,
GimpDrawable **src_drawable)
clone_src_drawable_destroyed_cb (GimpDrawable *drawable,
GimpDrawable **src_drawable)
{
if (drawable == *src_drawable)
{
*src_drawable = NULL;
the_src_gdisp = NULL;
}
{
*src_drawable = NULL;
the_src_gdisp = NULL;
}
}
static void
@ -235,9 +241,9 @@ clone_set_src_drawable(GimpDrawable *drawable)
void *
clone_paint_func (PaintCore *paint_core,
clone_paint_func (PaintCore *paint_core,
GimpDrawable *drawable,
int state)
int state)
{
GDisplay * gdisp;
GDisplay * src_gdisp;
@ -345,10 +351,9 @@ clone_paint_func (PaintCore *paint_core,
}
void
clone_cursor_update (tool, mevent, gdisp_ptr)
Tool *tool;
GdkEventMotion *mevent;
gpointer gdisp_ptr;
clone_cursor_update (Tool *tool,
GdkEventMotion *mevent,
gpointer gdisp_ptr)
{
GDisplay *gdisp;
Layer *layer;
@ -435,12 +440,12 @@ clone_draw (Tool *tool)
}
static void
clone_motion (PaintCore *paint_core,
clone_motion (PaintCore *paint_core,
GimpDrawable *drawable,
GimpDrawable *src_drawable,
CloneType type,
int offset_x,
int offset_y)
CloneType type,
int offset_x,
int offset_y)
{
GImage *gimage;
GImage *src_gimage = NULL;

View File

@ -57,29 +57,32 @@ static ColorBalanceDialog *color_balance_dialog = NULL;
/* color balance action functions */
static void color_balance_button_press (Tool *, GdkEventButton *, gpointer);
static void color_balance_button_release (Tool *, GdkEventButton *, gpointer);
static void color_balance_motion (Tool *, GdkEventMotion *, gpointer);
static void color_balance_cursor_update (Tool *, GdkEventMotion *, gpointer);
static void color_balance_control (Tool *, int, gpointer);
static void color_balance_control (Tool *, ToolAction, gpointer);
static ColorBalanceDialog * color_balance_new_dialog (void);
static void color_balance_update (ColorBalanceDialog *, int);
static void color_balance_preview (ColorBalanceDialog *);
static void color_balance_ok_callback (GtkWidget *, gpointer);
static void color_balance_cancel_callback (GtkWidget *, gpointer);
static gint color_balance_delete_callback (GtkWidget *, GdkEvent *, gpointer);
static void color_balance_shadows_callback (GtkWidget *, gpointer);
static void color_balance_midtones_callback (GtkWidget *, gpointer);
static void color_balance_highlights_callback (GtkWidget *, gpointer);
static void color_balance_preserve_update (GtkWidget *, gpointer);
static void color_balance_preview_update (GtkWidget *, gpointer);
static void color_balance_cr_scale_update (GtkAdjustment *, gpointer);
static void color_balance_mg_scale_update (GtkAdjustment *, gpointer);
static void color_balance_yb_scale_update (GtkAdjustment *, gpointer);
static void color_balance_cr_text_update (GtkWidget *, gpointer);
static void color_balance_mg_text_update (GtkWidget *, gpointer);
static void color_balance_yb_text_update (GtkWidget *, gpointer);
static ColorBalanceDialog * color_balance_new_dialog (void);
static void color_balance_update (ColorBalanceDialog *, int);
static void color_balance_preview (ColorBalanceDialog *);
static void color_balance_ok_callback (GtkWidget *, gpointer);
static void color_balance_cancel_callback (GtkWidget *, gpointer);
static gint color_balance_delete_callback (GtkWidget *, GdkEvent *,
gpointer);
static void color_balance_shadows_callback (GtkWidget *, gpointer);
static void color_balance_midtones_callback (GtkWidget *, gpointer);
static void color_balance_highlights_callback (GtkWidget *, gpointer);
static void color_balance_preserve_update (GtkWidget *, gpointer);
static void color_balance_preview_update (GtkWidget *, gpointer);
static void color_balance_cr_scale_update (GtkAdjustment *, gpointer);
static void color_balance_mg_scale_update (GtkAdjustment *, gpointer);
static void color_balance_yb_scale_update (GtkAdjustment *, gpointer);
static void color_balance_cr_text_update (GtkWidget *, gpointer);
static void color_balance_mg_text_update (GtkWidget *, gpointer);
static void color_balance_yb_text_update (GtkWidget *, gpointer);
/* color balance machinery */
@ -183,9 +186,9 @@ color_balance_cursor_update (Tool *tool,
}
static void
color_balance_control (Tool *tool,
int action,
gpointer gdisp_ptr)
color_balance_control (Tool *tool,
ToolAction action,
gpointer gdisp_ptr)
{
ColorBalance * color_bal;
@ -193,11 +196,13 @@ color_balance_control (Tool *tool,
switch (action)
{
case PAUSE :
case PAUSE:
break;
case RESUME :
case RESUME:
break;
case HALT :
case HALT:
if (color_balance_dialog)
{
active_tool->preserve = TRUE;
@ -207,6 +212,9 @@ color_balance_control (Tool *tool,
color_balance_cancel_callback (NULL, (gpointer) color_balance_dialog);
}
break;
default:
break;
}
}

View File

@ -68,7 +68,7 @@ struct _ColourPickerTool
static ColorPickerOptions * color_picker_options = NULL;
/* the color value */
int col_value[5] = { 0, 0, 0, 0, 0 };
int col_value[5] = { 0, 0, 0, 0, 0 };
/* the color picker dialog */
static GimpDrawable * active_drawable;
@ -85,14 +85,15 @@ static char hex_buf [MAX_INFO_BUF];
/* local function prototypes */
static void color_picker_button_press (Tool *, GdkEventButton *, gpointer);
static void color_picker_button_release (Tool *, GdkEventButton *, gpointer);
static void color_picker_motion (Tool *, GdkEventMotion *, gpointer);
static void color_picker_cursor_update (Tool *, GdkEventMotion *, gpointer);
static void color_picker_control (Tool *, int, void *);
static void color_picker_info_window_close_callback (GtkWidget *, gpointer);
static void color_picker_info_update (Tool *, int);
static void color_picker_button_press (Tool *, GdkEventButton *, gpointer);
static void color_picker_button_release (Tool *, GdkEventButton *, gpointer);
static void color_picker_motion (Tool *, GdkEventMotion *, gpointer);
static void color_picker_cursor_update (Tool *, GdkEventMotion *, gpointer);
static void color_picker_control (Tool *, ToolAction, gpointer);
static void color_picker_info_window_close_callback (GtkWidget *, gpointer);
static void color_picker_info_update (Tool *, int);
/* functions */
@ -124,7 +125,7 @@ color_picker_options_new (void)
/* the new color picker tool options structure */
options = (ColorPickerOptions *) g_malloc (sizeof (ColorPickerOptions));
tool_options_init ((ToolOptions *) options,
N_("Color Picker Options"),
_("Color Picker Options"),
color_picker_options_reset);
options->sample_merged = options->sample_merged_d = FALSE;
options->sample_average = options->sample_average_d = FALSE;
@ -378,9 +379,9 @@ color_picker_cursor_update (Tool *tool,
}
static void
color_picker_control (Tool *tool,
int action,
gpointer gdisp_ptr)
color_picker_control (Tool *tool,
ToolAction action,
gpointer gdisp_ptr)
{
ColourPickerTool * cp_tool;
@ -391,12 +392,17 @@ color_picker_control (Tool *tool,
case PAUSE :
draw_core_pause (cp_tool->core, tool);
break;
case RESUME :
draw_core_resume (cp_tool->core, tool);
break;
case HALT :
draw_core_stop (cp_tool->core, tool);
break;
default:
break;
}
}
@ -620,10 +626,12 @@ tools_new_color_picker ()
tool->scroll_lock = 0; /* Allow scrolling */
tool->auto_snap_to = TRUE;
tool->private = private;
tool->button_press_func = color_picker_button_press;
tool->button_release_func = color_picker_button_release;
tool->motion_func = color_picker_motion;
tool->arrow_keys_func = standard_arrow_keys_func; tool->modifier_key_func = standard_modifier_key_func;
tool->arrow_keys_func = standard_arrow_keys_func;
tool->modifier_key_func = standard_modifier_key_func;
tool->cursor_update_func = color_picker_cursor_update;
tool->control_func = color_picker_control;
tool->preserve = TRUE;
@ -649,12 +657,12 @@ tools_free_color_picker (Tool *tool)
color_picker_info = NULL;
}
g_free(cp_tool);
g_free (cp_tool);
}
static void
color_picker_info_window_close_callback (GtkWidget *w,
gpointer client_data)
color_picker_info_window_close_callback (GtkWidget *widget,
gpointer client_data)
{
info_dialog_popdown ((InfoDialog *) client_data);
}

View File

@ -74,8 +74,8 @@
typedef struct
{
Resize * resize;
GimpImage* gimage;
Resize *resize;
GimpImage *gimage;
} ImageResize;
/* external functions */
@ -131,7 +131,6 @@ file_close_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay *gdisp;
return_if_no_display (gdisp);
gdisplay_close_window (gdisp, FALSE);
@ -149,7 +148,6 @@ edit_cut_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
global_edit_cut (gdisp);
@ -160,7 +158,6 @@ edit_copy_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
global_edit_copy (gdisp);
@ -171,7 +168,6 @@ edit_paste_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
global_edit_paste (gdisp, 0);
@ -182,7 +178,6 @@ edit_paste_into_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
global_edit_paste (gdisp, 1);
@ -193,7 +188,6 @@ edit_clear_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
edit_clear (gdisp->gimage, gimage_active_drawable (gdisp->gimage));
@ -205,7 +199,6 @@ edit_fill_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
edit_fill (gdisp->gimage, gimage_active_drawable (gdisp->gimage));
@ -217,7 +210,6 @@ edit_stroke_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
gimage_mask_stroke (gdisp->gimage, gimage_active_drawable (gdisp->gimage));
@ -229,7 +221,6 @@ edit_undo_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
undo_pop (gdisp->gimage);
@ -240,7 +231,6 @@ edit_redo_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
undo_redo (gdisp->gimage);
@ -251,7 +241,6 @@ edit_named_cut_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
named_edit_cut (gdisp);
@ -262,7 +251,6 @@ edit_named_copy_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
named_edit_copy (gdisp);
@ -273,30 +261,16 @@ edit_named_paste_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
named_edit_paste (gdisp);
}
void
select_toggle_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
selection_hide (gdisp->select, (void *) gdisp);
gdisplays_flush ();
}
void
select_invert_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
gimage_mask_invert (gdisp->gimage);
@ -308,7 +282,6 @@ select_all_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
gimage_mask_all (gdisp->gimage);
@ -320,7 +293,6 @@ select_none_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
gimage_mask_none (gdisp->gimage);
@ -332,7 +304,6 @@ select_float_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
gimage_mask_float (gdisp->gimage, gimage_active_drawable (gdisp->gimage),
@ -345,7 +316,6 @@ select_sharpen_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
gimage_mask_sharpen (gdisp->gimage);
@ -357,7 +327,6 @@ select_border_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
query_size_box (N_("Border Selection"),
@ -376,7 +345,6 @@ select_feather_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
query_size_box (N_("Feather Selection"),
@ -395,7 +363,6 @@ select_grow_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
query_size_box (N_("Grow Selection"),
@ -414,7 +381,6 @@ select_shrink_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
query_size_box (N_("Shrink Selection"),
@ -433,7 +399,6 @@ select_save_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
gimage_mask_save (gdisp->gimage);
@ -445,7 +410,6 @@ view_dot_for_dot_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay *gdisp;
return_if_no_display (gdisp);
gdisplay_set_dot_for_dot (gdisp, GTK_CHECK_MENU_ITEM (widget)->active);
@ -456,7 +420,6 @@ view_zoomin_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay *gdisp;
return_if_no_display (gdisp);
change_scale (gdisp, ZOOMIN);
@ -467,7 +430,6 @@ view_zoomout_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay *gdisp;
return_if_no_display (gdisp);
change_scale (gdisp, ZOOMOUT);
@ -479,7 +441,6 @@ view_zoom_val (GtkWidget *widget,
int val)
{
GDisplay *gdisp;
return_if_no_display (gdisp);
change_scale (gdisp, val);
@ -553,7 +514,6 @@ view_window_info_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
if (! gdisp->window_info_dialog)
@ -562,12 +522,22 @@ view_window_info_cmd_callback (GtkWidget *widget,
info_dialog_popup (gdisp->window_info_dialog);
}
void
view_toggle_selection_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
selection_hide (gdisp->select, (void *) gdisp);
gdisplays_flush ();
}
void
view_toggle_rulers_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
/* This routine use promiscuous knowledge of gtk internals
@ -632,7 +602,6 @@ view_snap_to_guides_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
gdisp->snap_to_guides = GTK_CHECK_MENU_ITEM (widget)->active;
@ -643,7 +612,6 @@ view_toggle_statusbar_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
if (!GTK_CHECK_MENU_ITEM (widget)->active)
@ -663,7 +631,6 @@ view_new_view_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay *gdisp;
return_if_no_display (gdisp);
gdisplay_new_view (gdisp);
@ -674,7 +641,6 @@ view_shrink_wrap_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay *gdisp;
return_if_no_display (gdisp);
shrink_wrap_display (gdisp);
@ -685,7 +651,6 @@ image_equalize_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
image_equalize ((void *) gdisp->gimage);
@ -697,7 +662,6 @@ image_invert_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
image_invert ((void *) gdisp->gimage);
@ -709,7 +673,6 @@ image_desaturate_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
image_desaturate ((void *) gdisp->gimage);
@ -721,7 +684,6 @@ channel_ops_duplicate_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
channel_ops_duplicate ((void *) gdisp->gimage);
@ -732,7 +694,6 @@ channel_ops_offset_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
channel_ops_offset ((void *) gdisp->gimage);
@ -743,7 +704,6 @@ image_convert_rgb_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
convert_to_rgb ((void *) gdisp->gimage);
@ -754,7 +714,6 @@ image_convert_grayscale_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
convert_to_grayscale ((void *) gdisp->gimage);
@ -765,7 +724,6 @@ image_convert_indexed_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
convert_to_indexed ((void *) gdisp->gimage);
@ -892,7 +850,6 @@ layers_raise_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
gimage_raise_layer (gdisp->gimage, gdisp->gimage->active_layer);
@ -904,7 +861,6 @@ layers_lower_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
gimage_lower_layer (gdisp->gimage, gdisp->gimage->active_layer);
@ -916,7 +872,6 @@ layers_raise_to_top_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
gimage_raise_layer_to_top (gdisp->gimage, gdisp->gimage->active_layer);
@ -928,7 +883,6 @@ layers_lower_to_bottom_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
gimage_lower_layer_to_bottom (gdisp->gimage, gdisp->gimage->active_layer);
@ -940,7 +894,6 @@ layers_anchor_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
floating_sel_anchor (gimage_get_active_layer (gdisp->gimage));
@ -952,7 +905,6 @@ layers_merge_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
layers_dialog_layer_merge_query (gdisp->gimage, TRUE);
@ -963,7 +915,6 @@ layers_flatten_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
gimage_flatten (gdisp->gimage);
@ -975,7 +926,6 @@ layers_alpha_select_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
gimage_mask_layer_alpha (gdisp->gimage, gdisp->gimage->active_layer);
@ -987,7 +937,6 @@ layers_mask_select_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
gimage_mask_layer_mask (gdisp->gimage, gdisp->gimage->active_layer);
@ -999,7 +948,6 @@ layers_add_alpha_channel_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
layer_add_alpha ( gdisp->gimage->active_layer);
@ -1026,25 +974,22 @@ tools_select_cmd_callback (GtkWidget *widget,
guint callback_action)
{
GDisplay * gdisp;
gdisp = gdisplay_active ();
if (!tool_info[callback_action].init_func)
{
/* Activate the approriate widget */
gtk_widget_activate (tool_info[callback_action].tool_widget);
}
else
{
/* if the tool_info has an init_func */
gtk_widget_activate (tool_info[callback_action].tool_widget);
if (gdisp)
(* tool_info[callback_action].init_func) (gdisp);
}
/* Activate the approriate widget.
* Implicitly calls tools_select()
*/
gtk_widget_activate (tool_info[callback_action].tool_widget);
if (gdisp)
active_tool->drawable = gimage_active_drawable (gdisp->gimage);
/* Complete the initialisation by doing the same stuff
* tools_initialize() does after it did what tools_select() does
*/
if (tool_info[callback_action].init_func && gdisp)
{
(* tool_info[callback_action].init_func) (gdisp);
active_tool->gdisp_ptr = gdisp;
active_tool->drawable = gimage_active_drawable (gdisp->gimage);
}
}
void
@ -1088,13 +1033,9 @@ dialogs_lc_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
gdisp = gdisplay_active ();
if (gdisp == NULL)
lc_dialog_create (NULL);
else
lc_dialog_create (gdisp->gimage);
lc_dialog_create (gdisp ? gdisp->gimage : NULL);
}
static void

View File

@ -1,104 +1,112 @@
#ifndef __COMMANDS_H__
#define __COMMANDS_H__
#include "gtk/gtk.h"
void file_new_cmd_callback (GtkWidget *widget,
gpointer callback_data,
guint callback_action);
void file_open_cmd_callback (GtkWidget *, gpointer);
void file_save_cmd_callback (GtkWidget *, gpointer);
void file_new_cmd_callback (GtkWidget *widget,
gpointer callback_data,
guint callback_action);
void file_open_cmd_callback (GtkWidget *, gpointer);
void file_save_cmd_callback (GtkWidget *, gpointer);
void file_save_as_cmd_callback (GtkWidget *, gpointer);
void file_revert_cmd_callback (GtkWidget *, gpointer);
void file_pref_cmd_callback (GtkWidget *, gpointer);
void file_close_cmd_callback (GtkWidget *, gpointer);
void file_quit_cmd_callback (GtkWidget *, gpointer);
void edit_cut_cmd_callback (GtkWidget *, gpointer);
void edit_copy_cmd_callback (GtkWidget *, gpointer);
void edit_paste_cmd_callback (GtkWidget *, gpointer);
void edit_paste_into_cmd_callback (GtkWidget *, gpointer);
void edit_clear_cmd_callback (GtkWidget *, gpointer);
void edit_fill_cmd_callback (GtkWidget *, gpointer);
void edit_stroke_cmd_callback (GtkWidget *, gpointer);
void edit_undo_cmd_callback (GtkWidget *, gpointer);
void edit_redo_cmd_callback (GtkWidget *, gpointer);
void edit_named_cut_cmd_callback (GtkWidget *, gpointer);
void edit_named_copy_cmd_callback (GtkWidget *, gpointer);
void file_revert_cmd_callback (GtkWidget *, gpointer);
void file_pref_cmd_callback (GtkWidget *, gpointer);
void file_close_cmd_callback (GtkWidget *, gpointer);
void file_quit_cmd_callback (GtkWidget *, gpointer);
void edit_cut_cmd_callback (GtkWidget *, gpointer);
void edit_copy_cmd_callback (GtkWidget *, gpointer);
void edit_paste_cmd_callback (GtkWidget *, gpointer);
void edit_paste_into_cmd_callback (GtkWidget *, gpointer);
void edit_clear_cmd_callback (GtkWidget *, gpointer);
void edit_fill_cmd_callback (GtkWidget *, gpointer);
void edit_stroke_cmd_callback (GtkWidget *, gpointer);
void edit_undo_cmd_callback (GtkWidget *, gpointer);
void edit_redo_cmd_callback (GtkWidget *, gpointer);
void edit_named_cut_cmd_callback (GtkWidget *, gpointer);
void edit_named_copy_cmd_callback (GtkWidget *, gpointer);
void edit_named_paste_cmd_callback (GtkWidget *, gpointer);
void select_toggle_cmd_callback (GtkWidget *, gpointer);
void select_invert_cmd_callback (GtkWidget *, gpointer);
void select_all_cmd_callback (GtkWidget *, gpointer);
void select_none_cmd_callback (GtkWidget *, gpointer);
void select_float_cmd_callback (GtkWidget *, gpointer);
void select_sharpen_cmd_callback (GtkWidget *, gpointer);
void select_border_cmd_callback (GtkWidget *, gpointer);
void select_feather_cmd_callback (GtkWidget *, gpointer);
void select_grow_cmd_callback (GtkWidget *, gpointer);
void select_shrink_cmd_callback (GtkWidget *, gpointer);
void select_invert_cmd_callback (GtkWidget *, gpointer);
void select_all_cmd_callback (GtkWidget *, gpointer);
void select_none_cmd_callback (GtkWidget *, gpointer);
void select_float_cmd_callback (GtkWidget *, gpointer);
void select_sharpen_cmd_callback (GtkWidget *, gpointer);
void select_border_cmd_callback (GtkWidget *, gpointer);
void select_feather_cmd_callback (GtkWidget *, gpointer);
void select_grow_cmd_callback (GtkWidget *, gpointer);
void select_shrink_cmd_callback (GtkWidget *, gpointer);
void select_by_color_cmd_callback (GtkWidget *, gpointer);
void select_save_cmd_callback (GtkWidget *, gpointer);
void view_dot_for_dot_callback (GtkWidget *, gpointer);
void view_zoomin_cmd_callback (GtkWidget *, gpointer);
void view_zoomout_cmd_callback (GtkWidget *, gpointer);
void view_zoom_16_1_callback (GtkWidget *, gpointer);
void view_zoom_8_1_callback (GtkWidget *, gpointer);
void view_zoom_4_1_callback (GtkWidget *, gpointer);
void view_zoom_2_1_callback (GtkWidget *, gpointer);
void view_zoom_1_1_callback (GtkWidget *, gpointer);
void view_zoom_1_2_callback (GtkWidget *, gpointer);
void view_zoom_1_4_callback (GtkWidget *, gpointer);
void view_zoom_1_8_callback (GtkWidget *, gpointer);
void view_zoom_1_16_callback (GtkWidget *, gpointer);
void view_window_info_cmd_callback (GtkWidget *, gpointer);
void view_toggle_rulers_cmd_callback (GtkWidget *, gpointer);
void view_toggle_guides_cmd_callback (GtkWidget *, gpointer);
void select_save_cmd_callback (GtkWidget *, gpointer);
void view_dot_for_dot_callback (GtkWidget *, gpointer);
void view_zoomin_cmd_callback (GtkWidget *, gpointer);
void view_zoomout_cmd_callback (GtkWidget *, gpointer);
void view_zoom_16_1_callback (GtkWidget *, gpointer);
void view_zoom_8_1_callback (GtkWidget *, gpointer);
void view_zoom_4_1_callback (GtkWidget *, gpointer);
void view_zoom_2_1_callback (GtkWidget *, gpointer);
void view_zoom_1_1_callback (GtkWidget *, gpointer);
void view_zoom_1_2_callback (GtkWidget *, gpointer);
void view_zoom_1_4_callback (GtkWidget *, gpointer);
void view_zoom_1_8_callback (GtkWidget *, gpointer);
void view_zoom_1_16_callback (GtkWidget *, gpointer);
void view_window_info_cmd_callback (GtkWidget *, gpointer);
void view_toggle_selection_cmd_callback (GtkWidget *, gpointer);
void view_toggle_rulers_cmd_callback (GtkWidget *, gpointer);
void view_toggle_guides_cmd_callback (GtkWidget *, gpointer);
void view_toggle_statusbar_cmd_callback (GtkWidget *, gpointer);
void view_snap_to_guides_cmd_callback (GtkWidget *, gpointer);
void view_new_view_cmd_callback (GtkWidget *, gpointer);
void view_shrink_wrap_cmd_callback (GtkWidget *, gpointer);
void image_equalize_cmd_callback (GtkWidget *, gpointer);
void image_invert_cmd_callback (GtkWidget *, gpointer);
void image_desaturate_cmd_callback (GtkWidget *, gpointer);
void image_convert_rgb_cmd_callback (GtkWidget *, gpointer);
void view_snap_to_guides_cmd_callback (GtkWidget *, gpointer);
void view_new_view_cmd_callback (GtkWidget *, gpointer);
void view_shrink_wrap_cmd_callback (GtkWidget *, gpointer);
void image_equalize_cmd_callback (GtkWidget *, gpointer);
void image_invert_cmd_callback (GtkWidget *, gpointer);
void image_desaturate_cmd_callback (GtkWidget *, gpointer);
void image_convert_rgb_cmd_callback (GtkWidget *, gpointer);
void image_convert_grayscale_cmd_callback (GtkWidget *, gpointer);
void image_convert_indexed_cmd_callback (GtkWidget *, gpointer);
void image_resize_cmd_callback (GtkWidget *, gpointer);
void image_scale_cmd_callback (GtkWidget *, gpointer);
void image_convert_indexed_cmd_callback (GtkWidget *, gpointer);
void image_resize_cmd_callback (GtkWidget *, gpointer);
void image_scale_cmd_callback (GtkWidget *, gpointer);
void channel_ops_duplicate_cmd_callback (GtkWidget *, gpointer);
void channel_ops_offset_cmd_callback (GtkWidget *, gpointer);
void layers_previous_cmd_callback (GtkWidget *, gpointer);
void layers_next_cmd_callback (GtkWidget *, gpointer);
void layers_raise_cmd_callback (GtkWidget *, gpointer);
void layers_lower_cmd_callback (GtkWidget *, gpointer);
void layers_raise_to_top_cmd_callback (GtkWidget *, gpointer);
void layers_lower_to_bottom_cmd_callback (GtkWidget *, gpointer);
void layers_anchor_cmd_callback (GtkWidget *, gpointer);
void layers_merge_cmd_callback (GtkWidget *, gpointer);
void layers_flatten_cmd_callback (GtkWidget *, gpointer);
void layers_alpha_select_cmd_callback (GtkWidget *, gpointer);
void layers_mask_select_cmd_callback (GtkWidget *, gpointer);
void channel_ops_offset_cmd_callback (GtkWidget *, gpointer);
void layers_previous_cmd_callback (GtkWidget *, gpointer);
void layers_next_cmd_callback (GtkWidget *, gpointer);
void layers_raise_cmd_callback (GtkWidget *, gpointer);
void layers_lower_cmd_callback (GtkWidget *, gpointer);
void layers_raise_to_top_cmd_callback (GtkWidget *, gpointer);
void layers_lower_to_bottom_cmd_callback (GtkWidget *, gpointer);
void layers_anchor_cmd_callback (GtkWidget *, gpointer);
void layers_merge_cmd_callback (GtkWidget *, gpointer);
void layers_flatten_cmd_callback (GtkWidget *, gpointer);
void layers_alpha_select_cmd_callback (GtkWidget *, gpointer);
void layers_mask_select_cmd_callback (GtkWidget *, gpointer);
void layers_add_alpha_channel_cmd_callback (GtkWidget *, gpointer);
void tools_default_colors_cmd_callback (GtkWidget *, gpointer);
void tools_swap_colors_cmd_callback (GtkWidget *, gpointer);
void tools_select_cmd_callback (GtkWidget *widget,
gpointer callback_data,
guint callback_action);
void filters_repeat_cmd_callback (GtkWidget *widget,
gpointer callback_data,
guint callback_action);
void dialogs_brushes_cmd_callback (GtkWidget *, gpointer);
void dialogs_patterns_cmd_callback (GtkWidget *, gpointer);
void dialogs_palette_cmd_callback (GtkWidget *, gpointer);
void tools_swap_colors_cmd_callback (GtkWidget *, gpointer);
void tools_select_cmd_callback (GtkWidget *widget,
gpointer callback_data,
guint callback_action);
void filters_repeat_cmd_callback (GtkWidget *widget,
gpointer callback_data,
guint callback_action);
void dialogs_brushes_cmd_callback (GtkWidget *, gpointer);
void dialogs_patterns_cmd_callback (GtkWidget *, gpointer);
void dialogs_palette_cmd_callback (GtkWidget *, gpointer);
void dialogs_gradient_editor_cmd_callback (GtkWidget *, gpointer);
void dialogs_lc_cmd_callback (GtkWidget *, gpointer);
void dialogs_lc_cmd_callback (GtkWidget *, gpointer);
void dialogs_indexed_palette_cmd_callback (GtkWidget *, gpointer);
void dialogs_tools_options_cmd_callback (GtkWidget *, gpointer);
void dialogs_input_devices_cmd_callback (GtkWidget *, gpointer);
void dialogs_device_status_cmd_callback (GtkWidget *, gpointer);
void dialogs_error_console_cmd_callback (GtkWidget *, gpointer);
void about_dialog_cmd_callback (GtkWidget *, gpointer);
void tips_dialog_cmd_callback (GtkWidget *, gpointer);
void dialogs_module_browser_cmd_callback (GtkWidget *, gpointer);
void dialogs_tools_options_cmd_callback (GtkWidget *, gpointer);
void dialogs_input_devices_cmd_callback (GtkWidget *, gpointer);
void dialogs_device_status_cmd_callback (GtkWidget *, gpointer);
void dialogs_error_console_cmd_callback (GtkWidget *, gpointer);
void dialogs_module_browser_cmd_callback (GtkWidget *, gpointer);
void about_dialog_cmd_callback (GtkWidget *, gpointer);
void tips_dialog_cmd_callback (GtkWidget *, gpointer);
#endif /* __COMMANDS_H__ */

View File

@ -22,9 +22,9 @@
#include "gdisplay.h"
static void
user_context_display_changed (GimpContext *context,
GDisplay *display,
gpointer data)
context_manager_display_changed (GimpContext *context,
GDisplay *display,
gpointer data)
{
gdisplay_set_menu_sensitivity (display);
}
@ -33,9 +33,9 @@ user_context_display_changed (GimpContext *context,
* the image from appearing without notifying us
*/
static void
image_context_image_removed (GimpSet *set,
GimpImage *gimage,
GimpContext *user_context)
context_manager_image_removed (GimpSet *set,
GimpImage *gimage,
GimpContext *user_context)
{
if (gimp_context_get_image (user_context) == gimage)
gimp_context_set_image (user_context, NULL);
@ -63,10 +63,10 @@ context_manager_init (void)
gimp_context_set_current (context);
gtk_signal_connect (GTK_OBJECT (context), "display_changed",
GTK_SIGNAL_FUNC (user_context_display_changed),
GTK_SIGNAL_FUNC (context_manager_display_changed),
NULL);
gtk_signal_connect (GTK_OBJECT (image_context), "remove",
GTK_SIGNAL_FUNC (image_context_image_removed),
GTK_SIGNAL_FUNC (context_manager_image_removed),
context);
}

View File

@ -45,16 +45,16 @@
#include "tile.h"
/* target size */
#define TARGET_HEIGHT 15
#define TARGET_WIDTH 15
#define TARGET_HEIGHT 15
#define TARGET_WIDTH 15
#define SQR(x) ((x) * (x))
#ifndef M_PI
#define M_PI 3.14159265358979323846
#define M_PI 3.14159265358979323846
#endif /* M_PI */
#define STATUSBAR_SIZE 128
#define STATUSBAR_SIZE 128
/* the blend structures */
@ -63,14 +63,14 @@ typedef double (*RepeatFunc)(double);
typedef struct _BlendTool BlendTool;
struct _BlendTool
{
DrawCore * core; /* Core select object */
DrawCore * core; /* Core select object */
int startx; /* starting x coord */
int starty; /* starting y coord */
int startx; /* starting x coord */
int starty; /* starting y coord */
int endx; /* ending x coord */
int endy; /* ending y coord */
guint context_id; /* for the statusbar */
int endx; /* ending x coord */
int endy; /* ending y coord */
guint context_id; /* for the statusbar */
};
typedef struct _BlendOptions BlendOptions;
@ -107,7 +107,8 @@ struct _BlendOptions
GtkObject *threshold_w;
};
typedef struct {
typedef struct
{
double offset;
double sx, sy;
BlendMode blend_mode;
@ -118,7 +119,8 @@ typedef struct {
RepeatFunc repeat_func;
} RenderBlendData;
typedef struct {
typedef struct
{
PixelRegion *PR;
unsigned char *row_data;
int bytes;
@ -143,15 +145,16 @@ static PixelRegion distR =
/* local function prototypes */
static void gradient_type_callback (GtkWidget *, gpointer);
static void blend_mode_callback (GtkWidget *, gpointer);
static void repeat_type_callback (GtkWidget *, gpointer);
static void blend_button_press (Tool *, GdkEventButton *, gpointer);
static void blend_button_release (Tool *, GdkEventButton *, gpointer);
static void blend_motion (Tool *, GdkEventMotion *, gpointer);
static void blend_cursor_update (Tool *, GdkEventMotion *, gpointer);
static void blend_control (Tool *, int, gpointer);
static void blend_button_press (Tool *, GdkEventButton *, gpointer);
static void blend_button_release (Tool *, GdkEventButton *, gpointer);
static void blend_motion (Tool *, GdkEventMotion *, gpointer);
static void blend_cursor_update (Tool *, GdkEventMotion *, gpointer);
static void blend_control (Tool *, ToolAction, gpointer);
static double gradient_calc_conical_sym_factor (double dist, double *axis, double offset,
double x, double y);
@ -717,9 +720,9 @@ blend_draw (Tool *tool)
}
static void
blend_control (Tool *tool,
int action,
gpointer gdisp_ptr)
blend_control (Tool *tool,
ToolAction action,
gpointer gdisp_ptr)
{
BlendTool * blend_tool;
@ -727,15 +730,20 @@ blend_control (Tool *tool,
switch (action)
{
case PAUSE :
case PAUSE:
draw_core_pause (blend_tool->core, tool);
break;
case RESUME :
case RESUME:
draw_core_resume (blend_tool->core, tool);
break;
case HALT :
case HALT:
draw_core_stop (blend_tool->core, tool);
break;
default:
break;
}
}

View File

@ -291,15 +291,17 @@ gdisplay_delete (GDisplay *gdisp)
/* stop any active tool */
active_tool_control (HALT, (void *) gdisp);
/* clear out the pointer to this gdisp from the active tool */
/* clear out the pointer to this gdisp from the active tool */
if (active_tool && active_tool->gdisp_ptr)
{
tool_gdisp = active_tool->gdisp_ptr;
if (active_tool && active_tool->gdisp_ptr) {
tool_gdisp = active_tool->gdisp_ptr;
if (gdisp == tool_gdisp) {
active_tool->drawable = NULL;
active_tool->gdisp_ptr = NULL;
if (gdisp == tool_gdisp)
{
active_tool->drawable = NULL;
active_tool->gdisp_ptr = NULL;
}
}
}
/* free the selection structure */
selection_free (gdisp->select);
@ -1609,6 +1611,9 @@ gdisplay_set_menu_sensitivity (GDisplay *gdisp)
if (!gdisp)
{
SET_SENSITIVE ("/Image", FALSE);
SET_SENSITIVE ("/Image/Colors", FALSE);
SET_SENSITIVE ("/Image/Channel Ops", FALSE);
SET_SENSITIVE ("/Image/Alpha", FALSE);
}
else
{
@ -1616,6 +1621,9 @@ gdisplay_set_menu_sensitivity (GDisplay *gdisp)
SET_SENSITIVE ("/Image/RGB", (base_type != RGB));
SET_SENSITIVE ("/Image/Grayscale", (base_type != GRAY));
SET_SENSITIVE ("/Image/Indexed", (base_type != INDEXED));
SET_SENSITIVE ("/Image/Histogram", lp);
SET_SENSITIVE ("/Image/Colors", lp);
SET_SENSITIVE ("/Image/Colors/Threshold", (base_type != INDEXED));
SET_SENSITIVE ("/Image/Colors/Posterize" , (base_type != INDEXED));
SET_SENSITIVE ("/Image/Colors/Equalize", (base_type != INDEXED));
@ -1627,11 +1635,12 @@ gdisplay_set_menu_sensitivity (GDisplay *gdisp)
SET_SENSITIVE ("/Image/Colors/Curves", (base_type != INDEXED));
SET_SENSITIVE ("/Image/Colors/Levels", (base_type != INDEXED));
SET_SENSITIVE ("/Image/Colors/Desaturate", (base_type == RGB));
SET_SENSITIVE ("/Image/Alpha", TRUE);
SET_SENSITIVE ("/Image/Alpha/Add Alpha Channel",
!fs && !aux && lp && !lm && !alpha);
SET_SENSITIVE ("/Image/Colors", lp);
SET_SENSITIVE ("/Image/Channel Ops/Offset", lp);
SET_SENSITIVE ("/Image/Histogram", lp);
}
if (!gdisp)

View File

@ -52,24 +52,24 @@
typedef struct _Crop Crop;
struct _Crop
{
DrawCore * core; /* Core select object */
DrawCore * core; /* Core select object */
int startx; /* starting x coord */
int starty; /* starting y coord */
int startx; /* starting x coord */
int starty; /* starting y coord */
int lastx; /* previous x coord */
int lasty; /* previous y coord */
int lastx; /* previous x coord */
int lasty; /* previous y coord */
int x1, y1; /* upper left hand coordinate */
int x2, y2; /* lower right hand coords */
int x1, y1; /* upper left hand coordinate */
int x2, y2; /* lower right hand coords */
int srw, srh; /* width and height of corners */
int srw, srh; /* width and height of corners */
int tx1, ty1; /* transformed coords */
int tx2, ty2; /* */
int tx1, ty1; /* transformed coords */
int tx2, ty2; /* */
int function; /* moving or resizing */
guint context_id; /* for the statusbar */
int function; /* moving or resizing */
guint context_id; /* for the statusbar */
};
typedef struct _CropOptions CropOptions;
@ -109,9 +109,9 @@ static void crop_button_press (Tool *, GdkEventButton *, gpointer);
static void crop_button_release (Tool *, GdkEventButton *, gpointer);
static void crop_motion (Tool *, GdkEventMotion *, gpointer);
static void crop_cursor_update (Tool *, GdkEventMotion *, gpointer);
static void crop_control (Tool *, int, gpointer);
static void crop_arrow_keys_func (Tool *, GdkEventKey *, gpointer);
static void crop_modifier_key_func (Tool *, GdkEventKey *, gpointer);
static void crop_control (Tool *, ToolAction, gpointer);
static void crop_arrow_keys_func (Tool *, GdkEventKey *, gpointer);
static void crop_modifier_key_func (Tool *, GdkEventKey *, gpointer);
/* Crop helper functions */
static void crop_recalc (Tool *, Crop *);
@ -172,7 +172,7 @@ crop_options_new (void)
/* the new crop tool options structure */
options = (CropOptions *) g_malloc (sizeof (CropOptions));
tool_options_init ((ToolOptions *) options,
N_("Crop & Resize Options"),
_("Crop & Resize Options"),
crop_options_reset);
options->layer_only = options->layer_only_d = FALSE;
options->allow_enlarge = options->allow_enlarge_d = FALSE;
@ -661,9 +661,9 @@ crop_modifier_key_func (Tool *tool,
}
static void
crop_control (Tool *tool,
int action,
gpointer gdisp_ptr)
crop_control (Tool *tool,
ToolAction action,
gpointer gdisp_ptr)
{
Crop * crop;
@ -674,14 +674,19 @@ crop_control (Tool *tool,
case PAUSE :
draw_core_pause (crop->core, tool);
break;
case RESUME :
crop_recalc (tool, crop);
draw_core_resume (crop->core, tool);
break;
case HALT :
draw_core_stop (crop->core, tool);
info_dialog_popdown (crop_info);
break;
default:
break;
}
}
@ -1343,11 +1348,11 @@ crop_automatic_callback (GtkWidget *w,
static AutoCropType
crop_guess_bgcolor (GtkObject *get_color_obj,
GetColorFunc get_color_func,
int width,
int height,
int bytes,
int has_alpha,
guchar *color)
int width,
int height,
int bytes,
int has_alpha,
guchar *color)
{
guchar *tl = NULL;
guchar *tr = NULL;
@ -1411,7 +1416,7 @@ crop_guess_bgcolor (GtkObject *get_color_obj,
static int
crop_colors_equal (guchar *col1,
guchar *col2,
int bytes)
int bytes)
{
int equal = TRUE;
int b;
@ -1429,7 +1434,7 @@ crop_colors_equal (guchar *col1,
static int
crop_colors_alpha (guchar *dummy,
guchar *col,
int bytes)
int bytes)
{
if (col[bytes-1] == 0)
return TRUE;

View File

@ -91,32 +91,33 @@ static CRMatrix CR_basis =
/* curves action functions */
static void curves_button_press (Tool *, GdkEventButton *, gpointer);
static void curves_button_release (Tool *, GdkEventButton *, gpointer);
static void curves_motion (Tool *, GdkEventMotion *, gpointer);
static void curves_cursor_update (Tool *, GdkEventMotion *, gpointer);
static void curves_control (Tool *, int, gpointer);
static void curves_control (Tool *, ToolAction, gpointer);
static CurvesDialog * curves_new_dialog (void);
static void curves_update (CurvesDialog *, int);
static void curves_plot_curve (CurvesDialog *, int, int, int, int);
static void curves_preview (CurvesDialog *);
static void curves_value_callback (GtkWidget *, gpointer);
static void curves_red_callback (GtkWidget *, gpointer);
static void curves_green_callback (GtkWidget *, gpointer);
static void curves_blue_callback (GtkWidget *, gpointer);
static void curves_alpha_callback (GtkWidget *, gpointer);
static void curves_smooth_callback (GtkWidget *, gpointer);
static void curves_free_callback (GtkWidget *, gpointer);
static void curves_reset_callback (GtkWidget *, gpointer);
static void curves_ok_callback (GtkWidget *, gpointer);
static void curves_cancel_callback (GtkWidget *, gpointer);
static gint curves_delete_callback (GtkWidget *, GdkEvent *, gpointer);
static void curves_preview_update (GtkWidget *, gpointer);
static gint curves_xrange_events (GtkWidget *, GdkEvent *, CurvesDialog *);
static gint curves_yrange_events (GtkWidget *, GdkEvent *, CurvesDialog *);
static gint curves_graph_events (GtkWidget *, GdkEvent *, CurvesDialog *);
static void curves_CR_compose (CRMatrix, CRMatrix, CRMatrix);
static CurvesDialog * curves_new_dialog (void);
static void curves_update (CurvesDialog *, int);
static void curves_plot_curve (CurvesDialog *, int, int, int, int);
static void curves_preview (CurvesDialog *);
static void curves_value_callback (GtkWidget *, gpointer);
static void curves_red_callback (GtkWidget *, gpointer);
static void curves_green_callback (GtkWidget *, gpointer);
static void curves_blue_callback (GtkWidget *, gpointer);
static void curves_alpha_callback (GtkWidget *, gpointer);
static void curves_smooth_callback (GtkWidget *, gpointer);
static void curves_free_callback (GtkWidget *, gpointer);
static void curves_reset_callback (GtkWidget *, gpointer);
static void curves_ok_callback (GtkWidget *, gpointer);
static void curves_cancel_callback (GtkWidget *, gpointer);
static gint curves_delete_callback (GtkWidget *, GdkEvent *, gpointer);
static void curves_preview_update (GtkWidget *, gpointer);
static gint curves_xrange_events (GtkWidget *, GdkEvent *, CurvesDialog *);
static gint curves_yrange_events (GtkWidget *, GdkEvent *, CurvesDialog *);
static gint curves_graph_events (GtkWidget *, GdkEvent *, CurvesDialog *);
static void curves_CR_compose (CRMatrix, CRMatrix, CRMatrix);
/* curves machinery */
@ -174,7 +175,7 @@ curves_button_press (Tool *tool,
gdisp = gdisp_ptr;
drawable = gimage_active_drawable (gdisp->gimage);
if(drawable != tool->drawable)
if (drawable != tool->drawable)
{
active_tool->preserve = TRUE;
image_map_abort (curves_dialog->image_map);
@ -186,15 +187,14 @@ curves_button_press (Tool *tool,
if(tool)
tool->state = ACTIVE;
}
static void
curves_colour_update(Tool *tool,
GDisplay *gdisp,
GimpDrawable *drawable,
gint x,
gint y)
curves_colour_update (Tool *tool,
GDisplay *gdisp,
GimpDrawable *drawable,
gint x,
gint y)
{
unsigned char *color;
int offx, offy;
@ -334,9 +334,9 @@ curves_cursor_update (Tool *tool,
}
static void
curves_control (Tool *tool,
int action,
gpointer gdisp_ptr)
curves_control (Tool *tool,
ToolAction action,
gpointer gdisp_ptr)
{
Curves * _curves;
@ -346,8 +346,10 @@ curves_control (Tool *tool,
{
case PAUSE :
break;
case RESUME :
break;
case HALT :
if (curves_dialog)
{
@ -358,6 +360,9 @@ curves_control (Tool *tool,
curves_cancel_callback (NULL, (gpointer) curves_dialog);
}
break;
default:
break;
}
}
@ -386,7 +391,8 @@ tools_new_curves ()
tool->button_press_func = curves_button_press;
tool->button_release_func = curves_button_release;
tool->motion_func = curves_motion;
tool->arrow_keys_func = standard_arrow_keys_func; tool->modifier_key_func = standard_modifier_key_func;
tool->arrow_keys_func = standard_arrow_keys_func;
tool->modifier_key_func = standard_modifier_key_func;
tool->cursor_update_func = curves_cursor_update;
tool->control_func = curves_control;
tool->preserve = TRUE;

View File

@ -158,8 +158,7 @@ gdisplay_canvas_events (GtkWidget *canvas,
gdisp->disp_width = gdisp->canvas->allocation.width;
gdisp->disp_height = gdisp->canvas->allocation.height;
/* create GC for scrolling */
/* create GC for scrolling */
gdisp->scroll_gc = gdk_gc_new (gdisp->canvas->window);
gdk_gc_set_exposures (gdisp->scroll_gc, TRUE);
@ -175,11 +174,10 @@ gdisplay_canvas_events (GtkWidget *canvas,
setup_scale (gdisp);
}
/* Find out what device the event occurred upon */
/* Find out what device the event occurred upon */
if (devices_check_change (event))
gdisplay_check_device_cursor (gdisp);
switch (event->type)
{
case GDK_EXPOSE:
@ -238,36 +236,34 @@ gdisplay_canvas_events (GtkWidget *canvas,
if (active_tool && ((active_tool->type == MOVE) ||
!gimage_is_empty (gdisp->gimage)))
{
if (active_tool->auto_snap_to)
{
gdisplay_snap_point (gdisp, bevent->x, bevent->y, &tx, &ty);
bevent->x = tx;
bevent->y = ty;
update_cursor = TRUE;
}
/* reset the current tool if we're changing gdisplays */
/*
if (active_tool->gdisp_ptr) {
tool_gdisp = active_tool->gdisp_ptr;
if (tool_gdisp != gdisp) {
tools_initialize (active_tool->type, gdisp);
active_tool->drawable = gimage_active_drawable(gdisp->gimage);
}
} else
*/
/* reset the current tool if we're changing drawables */
if (active_tool->drawable) {
if (((gimage_active_drawable(gdisp->gimage)) !=
active_tool->drawable) &&
!active_tool->preserve)
tools_initialize (active_tool->type, gdisp);
} else
active_tool->drawable = gimage_active_drawable(gdisp->gimage);
(* active_tool->button_press_func) (active_tool, bevent, gdisp);
}
{
if (active_tool->auto_snap_to)
{
gdisplay_snap_point (gdisp, bevent->x, bevent->y, &tx, &ty);
bevent->x = tx;
bevent->y = ty;
update_cursor = TRUE;
}
/* reset the current tool if ... */
if (/* it has no display */
! active_tool->gdisp_ptr ||
/* or no drawable */
! active_tool->drawable ||
/* or a drawable different from it's current one... */
((gimage_active_drawable (gdisp->gimage) !=
active_tool->drawable) &&
/* ...and doesn't want to preserve it */
! active_tool->preserve))
{
tools_initialize (active_tool->type, gdisp);
}
(* active_tool->button_press_func) (active_tool, bevent, gdisp);
}
break;
case 2:

View File

@ -158,8 +158,7 @@ gdisplay_canvas_events (GtkWidget *canvas,
gdisp->disp_width = gdisp->canvas->allocation.width;
gdisp->disp_height = gdisp->canvas->allocation.height;
/* create GC for scrolling */
/* create GC for scrolling */
gdisp->scroll_gc = gdk_gc_new (gdisp->canvas->window);
gdk_gc_set_exposures (gdisp->scroll_gc, TRUE);
@ -175,11 +174,10 @@ gdisplay_canvas_events (GtkWidget *canvas,
setup_scale (gdisp);
}
/* Find out what device the event occurred upon */
/* Find out what device the event occurred upon */
if (devices_check_change (event))
gdisplay_check_device_cursor (gdisp);
switch (event->type)
{
case GDK_EXPOSE:
@ -238,36 +236,34 @@ gdisplay_canvas_events (GtkWidget *canvas,
if (active_tool && ((active_tool->type == MOVE) ||
!gimage_is_empty (gdisp->gimage)))
{
if (active_tool->auto_snap_to)
{
gdisplay_snap_point (gdisp, bevent->x, bevent->y, &tx, &ty);
bevent->x = tx;
bevent->y = ty;
update_cursor = TRUE;
}
/* reset the current tool if we're changing gdisplays */
/*
if (active_tool->gdisp_ptr) {
tool_gdisp = active_tool->gdisp_ptr;
if (tool_gdisp != gdisp) {
tools_initialize (active_tool->type, gdisp);
active_tool->drawable = gimage_active_drawable(gdisp->gimage);
}
} else
*/
/* reset the current tool if we're changing drawables */
if (active_tool->drawable) {
if (((gimage_active_drawable(gdisp->gimage)) !=
active_tool->drawable) &&
!active_tool->preserve)
tools_initialize (active_tool->type, gdisp);
} else
active_tool->drawable = gimage_active_drawable(gdisp->gimage);
(* active_tool->button_press_func) (active_tool, bevent, gdisp);
}
{
if (active_tool->auto_snap_to)
{
gdisplay_snap_point (gdisp, bevent->x, bevent->y, &tx, &ty);
bevent->x = tx;
bevent->y = ty;
update_cursor = TRUE;
}
/* reset the current tool if ... */
if (/* it has no display */
! active_tool->gdisp_ptr ||
/* or no drawable */
! active_tool->drawable ||
/* or a drawable different from it's current one... */
((gimage_active_drawable (gdisp->gimage) !=
active_tool->drawable) &&
/* ...and doesn't want to preserve it */
! active_tool->preserve))
{
tools_initialize (active_tool->type, gdisp);
}
(* active_tool->button_press_func) (active_tool, bevent, gdisp);
}
break;
case 2:

View File

@ -291,15 +291,17 @@ gdisplay_delete (GDisplay *gdisp)
/* stop any active tool */
active_tool_control (HALT, (void *) gdisp);
/* clear out the pointer to this gdisp from the active tool */
/* clear out the pointer to this gdisp from the active tool */
if (active_tool && active_tool->gdisp_ptr)
{
tool_gdisp = active_tool->gdisp_ptr;
if (active_tool && active_tool->gdisp_ptr) {
tool_gdisp = active_tool->gdisp_ptr;
if (gdisp == tool_gdisp) {
active_tool->drawable = NULL;
active_tool->gdisp_ptr = NULL;
if (gdisp == tool_gdisp)
{
active_tool->drawable = NULL;
active_tool->gdisp_ptr = NULL;
}
}
}
/* free the selection structure */
selection_free (gdisp->select);
@ -1609,6 +1611,9 @@ gdisplay_set_menu_sensitivity (GDisplay *gdisp)
if (!gdisp)
{
SET_SENSITIVE ("/Image", FALSE);
SET_SENSITIVE ("/Image/Colors", FALSE);
SET_SENSITIVE ("/Image/Channel Ops", FALSE);
SET_SENSITIVE ("/Image/Alpha", FALSE);
}
else
{
@ -1616,6 +1621,9 @@ gdisplay_set_menu_sensitivity (GDisplay *gdisp)
SET_SENSITIVE ("/Image/RGB", (base_type != RGB));
SET_SENSITIVE ("/Image/Grayscale", (base_type != GRAY));
SET_SENSITIVE ("/Image/Indexed", (base_type != INDEXED));
SET_SENSITIVE ("/Image/Histogram", lp);
SET_SENSITIVE ("/Image/Colors", lp);
SET_SENSITIVE ("/Image/Colors/Threshold", (base_type != INDEXED));
SET_SENSITIVE ("/Image/Colors/Posterize" , (base_type != INDEXED));
SET_SENSITIVE ("/Image/Colors/Equalize", (base_type != INDEXED));
@ -1627,11 +1635,12 @@ gdisplay_set_menu_sensitivity (GDisplay *gdisp)
SET_SENSITIVE ("/Image/Colors/Curves", (base_type != INDEXED));
SET_SENSITIVE ("/Image/Colors/Levels", (base_type != INDEXED));
SET_SENSITIVE ("/Image/Colors/Desaturate", (base_type == RGB));
SET_SENSITIVE ("/Image/Alpha", TRUE);
SET_SENSITIVE ("/Image/Alpha/Add Alpha Channel",
!fs && !aux && lp && !lm && !alpha);
SET_SENSITIVE ("/Image/Colors", lp);
SET_SENSITIVE ("/Image/Channel Ops/Offset", lp);
SET_SENSITIVE ("/Image/Histogram", lp);
}
if (!gdisp)

View File

@ -158,8 +158,7 @@ gdisplay_canvas_events (GtkWidget *canvas,
gdisp->disp_width = gdisp->canvas->allocation.width;
gdisp->disp_height = gdisp->canvas->allocation.height;
/* create GC for scrolling */
/* create GC for scrolling */
gdisp->scroll_gc = gdk_gc_new (gdisp->canvas->window);
gdk_gc_set_exposures (gdisp->scroll_gc, TRUE);
@ -175,11 +174,10 @@ gdisplay_canvas_events (GtkWidget *canvas,
setup_scale (gdisp);
}
/* Find out what device the event occurred upon */
/* Find out what device the event occurred upon */
if (devices_check_change (event))
gdisplay_check_device_cursor (gdisp);
switch (event->type)
{
case GDK_EXPOSE:
@ -238,36 +236,34 @@ gdisplay_canvas_events (GtkWidget *canvas,
if (active_tool && ((active_tool->type == MOVE) ||
!gimage_is_empty (gdisp->gimage)))
{
if (active_tool->auto_snap_to)
{
gdisplay_snap_point (gdisp, bevent->x, bevent->y, &tx, &ty);
bevent->x = tx;
bevent->y = ty;
update_cursor = TRUE;
}
/* reset the current tool if we're changing gdisplays */
/*
if (active_tool->gdisp_ptr) {
tool_gdisp = active_tool->gdisp_ptr;
if (tool_gdisp != gdisp) {
tools_initialize (active_tool->type, gdisp);
active_tool->drawable = gimage_active_drawable(gdisp->gimage);
}
} else
*/
/* reset the current tool if we're changing drawables */
if (active_tool->drawable) {
if (((gimage_active_drawable(gdisp->gimage)) !=
active_tool->drawable) &&
!active_tool->preserve)
tools_initialize (active_tool->type, gdisp);
} else
active_tool->drawable = gimage_active_drawable(gdisp->gimage);
(* active_tool->button_press_func) (active_tool, bevent, gdisp);
}
{
if (active_tool->auto_snap_to)
{
gdisplay_snap_point (gdisp, bevent->x, bevent->y, &tx, &ty);
bevent->x = tx;
bevent->y = ty;
update_cursor = TRUE;
}
/* reset the current tool if ... */
if (/* it has no display */
! active_tool->gdisp_ptr ||
/* or no drawable */
! active_tool->drawable ||
/* or a drawable different from it's current one... */
((gimage_active_drawable (gdisp->gimage) !=
active_tool->drawable) &&
/* ...and doesn't want to preserve it */
! active_tool->preserve))
{
tools_initialize (active_tool->type, gdisp);
}
(* active_tool->button_press_func) (active_tool, bevent, gdisp);
}
break;
case 2:

View File

@ -35,9 +35,8 @@
#define ARROW_VELOCITY 25
#define STATUSBAR_SIZE 128
typedef struct _edit_selection EditSelection;
struct _edit_selection
typedef struct _EditSelection EditSelection;
struct _EditSelection
{
int origx, origy; /* last x and y coords */
int cumlx, cumly; /* cumulative changes to x and yed */
@ -626,22 +625,27 @@ edit_selection_draw (Tool *tool)
void
edit_selection_control (Tool *tool,
int action,
gpointer gdisp_ptr)
edit_selection_control (Tool *tool,
ToolAction action,
gpointer gdisp_ptr)
{
switch (action)
{
case PAUSE :
draw_core_pause (edit_select.core, tool);
break;
case RESUME :
draw_core_resume (edit_select.core, tool);
break;
case HALT :
draw_core_stop (edit_select.core, tool);
draw_core_free (edit_select.core);
break;
default:
break;
}
}

View File

@ -31,12 +31,12 @@ typedef enum
/* action functions */
void edit_selection_button_release (Tool *, GdkEventButton *, gpointer);
void edit_selection_motion (Tool *, GdkEventMotion *, gpointer);
void edit_selection_control (Tool *, int, gpointer);
void edit_selection_control (Tool *, ToolAction, gpointer);
void edit_selection_cursor_update (Tool *, GdkEventMotion *, gpointer);
void edit_selection_draw (Tool *);
void edit_sel_arrow_keys_func (Tool *, GdkEventKey *, gpointer);
void edit_sel_arrow_keys_func (Tool *, GdkEventKey *, gpointer);
void init_edit_selection (Tool *, gpointer, GdkEventButton *, EditType);
void init_edit_selection (Tool *, gpointer, GdkEventButton *,
EditType);
#endif /* __EDIT_SELECTION_H__ */

View File

@ -1559,7 +1559,7 @@ file_dialog_hide (GtkWidget *filesel)
menus_set_sensitive_locale ("<Toolbox>", N_("/File/Open"), TRUE);
menus_set_sensitive_locale ("<Image>", N_("/File/Open"), TRUE);
if (gdisplay_active())
if (gdisplay_active ())
{
menus_set_sensitive_locale ("<Image>", N_("/File/Save"), TRUE);
menus_set_sensitive_locale ("<Image>", N_("/File/Save as"), TRUE);

View File

@ -36,14 +36,13 @@
/* the free selection structures */
typedef struct _free_select FreeSelect;
struct _free_select
typedef struct _FreeSelect FreeSelect;
struct _FreeSelect
{
DrawCore * core; /* Core select object */
DrawCore * core; /* Core select object */
int op; /* selection operation (ADD, SUB, etc) */
int num_pts; /* Number of points in the polygon */
int op; /* selection operation (ADD, SUB, etc) */
int num_pts; /* Number of points in the polygon */
};
struct _FreeSelectPoint
@ -403,7 +402,9 @@ free_select_motion (Tool *tool, GdkEventMotion *mevent, gpointer gdisp_ptr)
}
static void
free_select_control (Tool *tool, int action, gpointer gdisp_ptr)
free_select_control (Tool *tool,
ToolAction action,
gpointer gdisp_ptr)
{
FreeSelect * free_sel;
@ -414,12 +415,17 @@ free_select_control (Tool *tool, int action, gpointer gdisp_ptr)
case PAUSE :
draw_core_pause (free_sel->core, tool);
break;
case RESUME :
draw_core_resume (free_sel->core, tool);
break;
case HALT :
draw_core_stop (free_sel->core, tool);
break;
default:
break;
}
}

View File

@ -34,29 +34,29 @@
/* the fuzzy selection structures */
typedef struct _fuzzy_select FuzzySelect;
struct _fuzzy_select
typedef struct _FuzzySelect FuzzySelect;
struct _FuzzySelect
{
DrawCore * core; /* Core select object */
DrawCore * core; /* Core select object */
int op; /* selection operation (ADD, SUB, etc) */
int op; /* selection operation (ADD, SUB, etc) */
int x, y; /* Point from which to execute seed fill */
int last_x; /* */
int last_y; /* variables to keep track of sensitivity */
int threshold; /* threshold value for soft seed fill */
int x, y; /* Point from which to execute seed fill */
int last_x; /* */
int last_y; /* variables to keep track of sensitivity */
int threshold; /* threshold value for soft seed fill */
};
/* the fuzzy selection tool options */
static SelectionOptions *fuzzy_options = NULL;
static SelectionOptions * fuzzy_options = NULL;
/* XSegments which make up the fuzzy selection boundary */
static GdkSegment *segs = NULL;
static int num_segs = 0;
static GdkSegment * segs = NULL;
static int num_segs = 0;
Channel *fuzzy_mask = NULL;
Channel * fuzzy_mask = NULL;
/* fuzzy select action functions */
@ -64,7 +64,7 @@ static void fuzzy_select_button_press (Tool *, GdkEventButton *, gpointer);
static void fuzzy_select_button_release (Tool *, GdkEventButton *, gpointer);
static void fuzzy_select_motion (Tool *, GdkEventMotion *, gpointer);
static void fuzzy_select_draw (Tool *);
static void fuzzy_select_control (Tool *, int, gpointer);
static void fuzzy_select_control (Tool *, ToolAction, gpointer);
/* fuzzy select action functions */
static GdkSegment * fuzzy_select_calculate (Tool *, void *, int *);
@ -511,7 +511,9 @@ fuzzy_select_draw (Tool *tool)
}
static void
fuzzy_select_control (Tool *tool, int action, gpointer gdisp_ptr)
fuzzy_select_control (Tool *tool,
ToolAction action,
gpointer gdisp_ptr)
{
FuzzySelect * fuzzy_sel;
@ -522,12 +524,17 @@ fuzzy_select_control (Tool *tool, int action, gpointer gdisp_ptr)
case PAUSE :
draw_core_pause (fuzzy_sel->core, tool);
break;
case RESUME :
draw_core_resume (fuzzy_sel->core, tool);
break;
case HALT :
draw_core_stop (fuzzy_sel->core, tool);
break;
default:
break;
}
}
@ -565,7 +572,8 @@ tools_new_fuzzy_select (void)
tool->button_press_func = fuzzy_select_button_press;
tool->button_release_func = fuzzy_select_button_release;
tool->motion_func = fuzzy_select_motion;
tool->arrow_keys_func = standard_arrow_keys_func; tool->modifier_key_func = standard_modifier_key_func;
tool->arrow_keys_func = standard_arrow_keys_func;
tool->modifier_key_func = standard_modifier_key_func;
tool->cursor_update_func = rect_select_cursor_update;
tool->control_func = fuzzy_select_control;

View File

@ -291,15 +291,17 @@ gdisplay_delete (GDisplay *gdisp)
/* stop any active tool */
active_tool_control (HALT, (void *) gdisp);
/* clear out the pointer to this gdisp from the active tool */
/* clear out the pointer to this gdisp from the active tool */
if (active_tool && active_tool->gdisp_ptr)
{
tool_gdisp = active_tool->gdisp_ptr;
if (active_tool && active_tool->gdisp_ptr) {
tool_gdisp = active_tool->gdisp_ptr;
if (gdisp == tool_gdisp) {
active_tool->drawable = NULL;
active_tool->gdisp_ptr = NULL;
if (gdisp == tool_gdisp)
{
active_tool->drawable = NULL;
active_tool->gdisp_ptr = NULL;
}
}
}
/* free the selection structure */
selection_free (gdisp->select);
@ -1609,6 +1611,9 @@ gdisplay_set_menu_sensitivity (GDisplay *gdisp)
if (!gdisp)
{
SET_SENSITIVE ("/Image", FALSE);
SET_SENSITIVE ("/Image/Colors", FALSE);
SET_SENSITIVE ("/Image/Channel Ops", FALSE);
SET_SENSITIVE ("/Image/Alpha", FALSE);
}
else
{
@ -1616,6 +1621,9 @@ gdisplay_set_menu_sensitivity (GDisplay *gdisp)
SET_SENSITIVE ("/Image/RGB", (base_type != RGB));
SET_SENSITIVE ("/Image/Grayscale", (base_type != GRAY));
SET_SENSITIVE ("/Image/Indexed", (base_type != INDEXED));
SET_SENSITIVE ("/Image/Histogram", lp);
SET_SENSITIVE ("/Image/Colors", lp);
SET_SENSITIVE ("/Image/Colors/Threshold", (base_type != INDEXED));
SET_SENSITIVE ("/Image/Colors/Posterize" , (base_type != INDEXED));
SET_SENSITIVE ("/Image/Colors/Equalize", (base_type != INDEXED));
@ -1627,11 +1635,12 @@ gdisplay_set_menu_sensitivity (GDisplay *gdisp)
SET_SENSITIVE ("/Image/Colors/Curves", (base_type != INDEXED));
SET_SENSITIVE ("/Image/Colors/Levels", (base_type != INDEXED));
SET_SENSITIVE ("/Image/Colors/Desaturate", (base_type == RGB));
SET_SENSITIVE ("/Image/Alpha", TRUE);
SET_SENSITIVE ("/Image/Alpha/Add Alpha Channel",
!fs && !aux && lp && !lm && !alpha);
SET_SENSITIVE ("/Image/Colors", lp);
SET_SENSITIVE ("/Image/Channel Ops/Offset", lp);
SET_SENSITIVE ("/Image/Histogram", lp);
}
if (!gdisp)

View File

@ -249,6 +249,7 @@ gimp_set_add (GimpSet *set,
return FALSE;
set->list = g_slist_prepend (set->list, gimp_set_node_new (set, val));
gtk_signal_emit (GTK_OBJECT (set), gimp_set_signals[ADD], val);
return TRUE;
@ -265,11 +266,11 @@ gimp_set_remove (GimpSet *set,
node = gimp_set_find_node (set, val);
g_return_val_if_fail (node, FALSE);
gtk_signal_emit (GTK_OBJECT (set), gimp_set_signals[REMOVE], val);
gimp_set_node_free (set, node);
set->list = g_slist_remove (set->list, node);
gtk_signal_emit (GTK_OBJECT (set), gimp_set_signals[REMOVE], val);
return TRUE;
}

View File

@ -74,8 +74,8 @@
typedef struct
{
Resize * resize;
GimpImage* gimage;
Resize *resize;
GimpImage *gimage;
} ImageResize;
/* external functions */
@ -131,7 +131,6 @@ file_close_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay *gdisp;
return_if_no_display (gdisp);
gdisplay_close_window (gdisp, FALSE);
@ -149,7 +148,6 @@ edit_cut_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
global_edit_cut (gdisp);
@ -160,7 +158,6 @@ edit_copy_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
global_edit_copy (gdisp);
@ -171,7 +168,6 @@ edit_paste_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
global_edit_paste (gdisp, 0);
@ -182,7 +178,6 @@ edit_paste_into_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
global_edit_paste (gdisp, 1);
@ -193,7 +188,6 @@ edit_clear_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
edit_clear (gdisp->gimage, gimage_active_drawable (gdisp->gimage));
@ -205,7 +199,6 @@ edit_fill_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
edit_fill (gdisp->gimage, gimage_active_drawable (gdisp->gimage));
@ -217,7 +210,6 @@ edit_stroke_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
gimage_mask_stroke (gdisp->gimage, gimage_active_drawable (gdisp->gimage));
@ -229,7 +221,6 @@ edit_undo_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
undo_pop (gdisp->gimage);
@ -240,7 +231,6 @@ edit_redo_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
undo_redo (gdisp->gimage);
@ -251,7 +241,6 @@ edit_named_cut_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
named_edit_cut (gdisp);
@ -262,7 +251,6 @@ edit_named_copy_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
named_edit_copy (gdisp);
@ -273,30 +261,16 @@ edit_named_paste_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
named_edit_paste (gdisp);
}
void
select_toggle_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
selection_hide (gdisp->select, (void *) gdisp);
gdisplays_flush ();
}
void
select_invert_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
gimage_mask_invert (gdisp->gimage);
@ -308,7 +282,6 @@ select_all_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
gimage_mask_all (gdisp->gimage);
@ -320,7 +293,6 @@ select_none_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
gimage_mask_none (gdisp->gimage);
@ -332,7 +304,6 @@ select_float_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
gimage_mask_float (gdisp->gimage, gimage_active_drawable (gdisp->gimage),
@ -345,7 +316,6 @@ select_sharpen_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
gimage_mask_sharpen (gdisp->gimage);
@ -357,7 +327,6 @@ select_border_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
query_size_box (N_("Border Selection"),
@ -376,7 +345,6 @@ select_feather_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
query_size_box (N_("Feather Selection"),
@ -395,7 +363,6 @@ select_grow_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
query_size_box (N_("Grow Selection"),
@ -414,7 +381,6 @@ select_shrink_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
query_size_box (N_("Shrink Selection"),
@ -433,7 +399,6 @@ select_save_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
gimage_mask_save (gdisp->gimage);
@ -445,7 +410,6 @@ view_dot_for_dot_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay *gdisp;
return_if_no_display (gdisp);
gdisplay_set_dot_for_dot (gdisp, GTK_CHECK_MENU_ITEM (widget)->active);
@ -456,7 +420,6 @@ view_zoomin_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay *gdisp;
return_if_no_display (gdisp);
change_scale (gdisp, ZOOMIN);
@ -467,7 +430,6 @@ view_zoomout_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay *gdisp;
return_if_no_display (gdisp);
change_scale (gdisp, ZOOMOUT);
@ -479,7 +441,6 @@ view_zoom_val (GtkWidget *widget,
int val)
{
GDisplay *gdisp;
return_if_no_display (gdisp);
change_scale (gdisp, val);
@ -553,7 +514,6 @@ view_window_info_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
if (! gdisp->window_info_dialog)
@ -562,12 +522,22 @@ view_window_info_cmd_callback (GtkWidget *widget,
info_dialog_popup (gdisp->window_info_dialog);
}
void
view_toggle_selection_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
selection_hide (gdisp->select, (void *) gdisp);
gdisplays_flush ();
}
void
view_toggle_rulers_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
/* This routine use promiscuous knowledge of gtk internals
@ -632,7 +602,6 @@ view_snap_to_guides_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
gdisp->snap_to_guides = GTK_CHECK_MENU_ITEM (widget)->active;
@ -643,7 +612,6 @@ view_toggle_statusbar_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
if (!GTK_CHECK_MENU_ITEM (widget)->active)
@ -663,7 +631,6 @@ view_new_view_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay *gdisp;
return_if_no_display (gdisp);
gdisplay_new_view (gdisp);
@ -674,7 +641,6 @@ view_shrink_wrap_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay *gdisp;
return_if_no_display (gdisp);
shrink_wrap_display (gdisp);
@ -685,7 +651,6 @@ image_equalize_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
image_equalize ((void *) gdisp->gimage);
@ -697,7 +662,6 @@ image_invert_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
image_invert ((void *) gdisp->gimage);
@ -709,7 +673,6 @@ image_desaturate_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
image_desaturate ((void *) gdisp->gimage);
@ -721,7 +684,6 @@ channel_ops_duplicate_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
channel_ops_duplicate ((void *) gdisp->gimage);
@ -732,7 +694,6 @@ channel_ops_offset_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
channel_ops_offset ((void *) gdisp->gimage);
@ -743,7 +704,6 @@ image_convert_rgb_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
convert_to_rgb ((void *) gdisp->gimage);
@ -754,7 +714,6 @@ image_convert_grayscale_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
convert_to_grayscale ((void *) gdisp->gimage);
@ -765,7 +724,6 @@ image_convert_indexed_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
convert_to_indexed ((void *) gdisp->gimage);
@ -892,7 +850,6 @@ layers_raise_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
gimage_raise_layer (gdisp->gimage, gdisp->gimage->active_layer);
@ -904,7 +861,6 @@ layers_lower_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
gimage_lower_layer (gdisp->gimage, gdisp->gimage->active_layer);
@ -916,7 +872,6 @@ layers_raise_to_top_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
gimage_raise_layer_to_top (gdisp->gimage, gdisp->gimage->active_layer);
@ -928,7 +883,6 @@ layers_lower_to_bottom_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
gimage_lower_layer_to_bottom (gdisp->gimage, gdisp->gimage->active_layer);
@ -940,7 +894,6 @@ layers_anchor_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
floating_sel_anchor (gimage_get_active_layer (gdisp->gimage));
@ -952,7 +905,6 @@ layers_merge_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
layers_dialog_layer_merge_query (gdisp->gimage, TRUE);
@ -963,7 +915,6 @@ layers_flatten_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
gimage_flatten (gdisp->gimage);
@ -975,7 +926,6 @@ layers_alpha_select_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
gimage_mask_layer_alpha (gdisp->gimage, gdisp->gimage->active_layer);
@ -987,7 +937,6 @@ layers_mask_select_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
gimage_mask_layer_mask (gdisp->gimage, gdisp->gimage->active_layer);
@ -999,7 +948,6 @@ layers_add_alpha_channel_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
layer_add_alpha ( gdisp->gimage->active_layer);
@ -1026,25 +974,22 @@ tools_select_cmd_callback (GtkWidget *widget,
guint callback_action)
{
GDisplay * gdisp;
gdisp = gdisplay_active ();
if (!tool_info[callback_action].init_func)
{
/* Activate the approriate widget */
gtk_widget_activate (tool_info[callback_action].tool_widget);
}
else
{
/* if the tool_info has an init_func */
gtk_widget_activate (tool_info[callback_action].tool_widget);
if (gdisp)
(* tool_info[callback_action].init_func) (gdisp);
}
/* Activate the approriate widget.
* Implicitly calls tools_select()
*/
gtk_widget_activate (tool_info[callback_action].tool_widget);
if (gdisp)
active_tool->drawable = gimage_active_drawable (gdisp->gimage);
/* Complete the initialisation by doing the same stuff
* tools_initialize() does after it did what tools_select() does
*/
if (tool_info[callback_action].init_func && gdisp)
{
(* tool_info[callback_action].init_func) (gdisp);
active_tool->gdisp_ptr = gdisp;
active_tool->drawable = gimage_active_drawable (gdisp->gimage);
}
}
void
@ -1088,13 +1033,9 @@ dialogs_lc_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
gdisp = gdisplay_active ();
if (gdisp == NULL)
lc_dialog_create (NULL);
else
lc_dialog_create (gdisp->gimage);
lc_dialog_create (gdisp ? gdisp->gimage : NULL);
}
static void

View File

@ -1,104 +1,112 @@
#ifndef __COMMANDS_H__
#define __COMMANDS_H__
#include "gtk/gtk.h"
void file_new_cmd_callback (GtkWidget *widget,
gpointer callback_data,
guint callback_action);
void file_open_cmd_callback (GtkWidget *, gpointer);
void file_save_cmd_callback (GtkWidget *, gpointer);
void file_new_cmd_callback (GtkWidget *widget,
gpointer callback_data,
guint callback_action);
void file_open_cmd_callback (GtkWidget *, gpointer);
void file_save_cmd_callback (GtkWidget *, gpointer);
void file_save_as_cmd_callback (GtkWidget *, gpointer);
void file_revert_cmd_callback (GtkWidget *, gpointer);
void file_pref_cmd_callback (GtkWidget *, gpointer);
void file_close_cmd_callback (GtkWidget *, gpointer);
void file_quit_cmd_callback (GtkWidget *, gpointer);
void edit_cut_cmd_callback (GtkWidget *, gpointer);
void edit_copy_cmd_callback (GtkWidget *, gpointer);
void edit_paste_cmd_callback (GtkWidget *, gpointer);
void edit_paste_into_cmd_callback (GtkWidget *, gpointer);
void edit_clear_cmd_callback (GtkWidget *, gpointer);
void edit_fill_cmd_callback (GtkWidget *, gpointer);
void edit_stroke_cmd_callback (GtkWidget *, gpointer);
void edit_undo_cmd_callback (GtkWidget *, gpointer);
void edit_redo_cmd_callback (GtkWidget *, gpointer);
void edit_named_cut_cmd_callback (GtkWidget *, gpointer);
void edit_named_copy_cmd_callback (GtkWidget *, gpointer);
void file_revert_cmd_callback (GtkWidget *, gpointer);
void file_pref_cmd_callback (GtkWidget *, gpointer);
void file_close_cmd_callback (GtkWidget *, gpointer);
void file_quit_cmd_callback (GtkWidget *, gpointer);
void edit_cut_cmd_callback (GtkWidget *, gpointer);
void edit_copy_cmd_callback (GtkWidget *, gpointer);
void edit_paste_cmd_callback (GtkWidget *, gpointer);
void edit_paste_into_cmd_callback (GtkWidget *, gpointer);
void edit_clear_cmd_callback (GtkWidget *, gpointer);
void edit_fill_cmd_callback (GtkWidget *, gpointer);
void edit_stroke_cmd_callback (GtkWidget *, gpointer);
void edit_undo_cmd_callback (GtkWidget *, gpointer);
void edit_redo_cmd_callback (GtkWidget *, gpointer);
void edit_named_cut_cmd_callback (GtkWidget *, gpointer);
void edit_named_copy_cmd_callback (GtkWidget *, gpointer);
void edit_named_paste_cmd_callback (GtkWidget *, gpointer);
void select_toggle_cmd_callback (GtkWidget *, gpointer);
void select_invert_cmd_callback (GtkWidget *, gpointer);
void select_all_cmd_callback (GtkWidget *, gpointer);
void select_none_cmd_callback (GtkWidget *, gpointer);
void select_float_cmd_callback (GtkWidget *, gpointer);
void select_sharpen_cmd_callback (GtkWidget *, gpointer);
void select_border_cmd_callback (GtkWidget *, gpointer);
void select_feather_cmd_callback (GtkWidget *, gpointer);
void select_grow_cmd_callback (GtkWidget *, gpointer);
void select_shrink_cmd_callback (GtkWidget *, gpointer);
void select_invert_cmd_callback (GtkWidget *, gpointer);
void select_all_cmd_callback (GtkWidget *, gpointer);
void select_none_cmd_callback (GtkWidget *, gpointer);
void select_float_cmd_callback (GtkWidget *, gpointer);
void select_sharpen_cmd_callback (GtkWidget *, gpointer);
void select_border_cmd_callback (GtkWidget *, gpointer);
void select_feather_cmd_callback (GtkWidget *, gpointer);
void select_grow_cmd_callback (GtkWidget *, gpointer);
void select_shrink_cmd_callback (GtkWidget *, gpointer);
void select_by_color_cmd_callback (GtkWidget *, gpointer);
void select_save_cmd_callback (GtkWidget *, gpointer);
void view_dot_for_dot_callback (GtkWidget *, gpointer);
void view_zoomin_cmd_callback (GtkWidget *, gpointer);
void view_zoomout_cmd_callback (GtkWidget *, gpointer);
void view_zoom_16_1_callback (GtkWidget *, gpointer);
void view_zoom_8_1_callback (GtkWidget *, gpointer);
void view_zoom_4_1_callback (GtkWidget *, gpointer);
void view_zoom_2_1_callback (GtkWidget *, gpointer);
void view_zoom_1_1_callback (GtkWidget *, gpointer);
void view_zoom_1_2_callback (GtkWidget *, gpointer);
void view_zoom_1_4_callback (GtkWidget *, gpointer);
void view_zoom_1_8_callback (GtkWidget *, gpointer);
void view_zoom_1_16_callback (GtkWidget *, gpointer);
void view_window_info_cmd_callback (GtkWidget *, gpointer);
void view_toggle_rulers_cmd_callback (GtkWidget *, gpointer);
void view_toggle_guides_cmd_callback (GtkWidget *, gpointer);
void select_save_cmd_callback (GtkWidget *, gpointer);
void view_dot_for_dot_callback (GtkWidget *, gpointer);
void view_zoomin_cmd_callback (GtkWidget *, gpointer);
void view_zoomout_cmd_callback (GtkWidget *, gpointer);
void view_zoom_16_1_callback (GtkWidget *, gpointer);
void view_zoom_8_1_callback (GtkWidget *, gpointer);
void view_zoom_4_1_callback (GtkWidget *, gpointer);
void view_zoom_2_1_callback (GtkWidget *, gpointer);
void view_zoom_1_1_callback (GtkWidget *, gpointer);
void view_zoom_1_2_callback (GtkWidget *, gpointer);
void view_zoom_1_4_callback (GtkWidget *, gpointer);
void view_zoom_1_8_callback (GtkWidget *, gpointer);
void view_zoom_1_16_callback (GtkWidget *, gpointer);
void view_window_info_cmd_callback (GtkWidget *, gpointer);
void view_toggle_selection_cmd_callback (GtkWidget *, gpointer);
void view_toggle_rulers_cmd_callback (GtkWidget *, gpointer);
void view_toggle_guides_cmd_callback (GtkWidget *, gpointer);
void view_toggle_statusbar_cmd_callback (GtkWidget *, gpointer);
void view_snap_to_guides_cmd_callback (GtkWidget *, gpointer);
void view_new_view_cmd_callback (GtkWidget *, gpointer);
void view_shrink_wrap_cmd_callback (GtkWidget *, gpointer);
void image_equalize_cmd_callback (GtkWidget *, gpointer);
void image_invert_cmd_callback (GtkWidget *, gpointer);
void image_desaturate_cmd_callback (GtkWidget *, gpointer);
void image_convert_rgb_cmd_callback (GtkWidget *, gpointer);
void view_snap_to_guides_cmd_callback (GtkWidget *, gpointer);
void view_new_view_cmd_callback (GtkWidget *, gpointer);
void view_shrink_wrap_cmd_callback (GtkWidget *, gpointer);
void image_equalize_cmd_callback (GtkWidget *, gpointer);
void image_invert_cmd_callback (GtkWidget *, gpointer);
void image_desaturate_cmd_callback (GtkWidget *, gpointer);
void image_convert_rgb_cmd_callback (GtkWidget *, gpointer);
void image_convert_grayscale_cmd_callback (GtkWidget *, gpointer);
void image_convert_indexed_cmd_callback (GtkWidget *, gpointer);
void image_resize_cmd_callback (GtkWidget *, gpointer);
void image_scale_cmd_callback (GtkWidget *, gpointer);
void image_convert_indexed_cmd_callback (GtkWidget *, gpointer);
void image_resize_cmd_callback (GtkWidget *, gpointer);
void image_scale_cmd_callback (GtkWidget *, gpointer);
void channel_ops_duplicate_cmd_callback (GtkWidget *, gpointer);
void channel_ops_offset_cmd_callback (GtkWidget *, gpointer);
void layers_previous_cmd_callback (GtkWidget *, gpointer);
void layers_next_cmd_callback (GtkWidget *, gpointer);
void layers_raise_cmd_callback (GtkWidget *, gpointer);
void layers_lower_cmd_callback (GtkWidget *, gpointer);
void layers_raise_to_top_cmd_callback (GtkWidget *, gpointer);
void layers_lower_to_bottom_cmd_callback (GtkWidget *, gpointer);
void layers_anchor_cmd_callback (GtkWidget *, gpointer);
void layers_merge_cmd_callback (GtkWidget *, gpointer);
void layers_flatten_cmd_callback (GtkWidget *, gpointer);
void layers_alpha_select_cmd_callback (GtkWidget *, gpointer);
void layers_mask_select_cmd_callback (GtkWidget *, gpointer);
void channel_ops_offset_cmd_callback (GtkWidget *, gpointer);
void layers_previous_cmd_callback (GtkWidget *, gpointer);
void layers_next_cmd_callback (GtkWidget *, gpointer);
void layers_raise_cmd_callback (GtkWidget *, gpointer);
void layers_lower_cmd_callback (GtkWidget *, gpointer);
void layers_raise_to_top_cmd_callback (GtkWidget *, gpointer);
void layers_lower_to_bottom_cmd_callback (GtkWidget *, gpointer);
void layers_anchor_cmd_callback (GtkWidget *, gpointer);
void layers_merge_cmd_callback (GtkWidget *, gpointer);
void layers_flatten_cmd_callback (GtkWidget *, gpointer);
void layers_alpha_select_cmd_callback (GtkWidget *, gpointer);
void layers_mask_select_cmd_callback (GtkWidget *, gpointer);
void layers_add_alpha_channel_cmd_callback (GtkWidget *, gpointer);
void tools_default_colors_cmd_callback (GtkWidget *, gpointer);
void tools_swap_colors_cmd_callback (GtkWidget *, gpointer);
void tools_select_cmd_callback (GtkWidget *widget,
gpointer callback_data,
guint callback_action);
void filters_repeat_cmd_callback (GtkWidget *widget,
gpointer callback_data,
guint callback_action);
void dialogs_brushes_cmd_callback (GtkWidget *, gpointer);
void dialogs_patterns_cmd_callback (GtkWidget *, gpointer);
void dialogs_palette_cmd_callback (GtkWidget *, gpointer);
void tools_swap_colors_cmd_callback (GtkWidget *, gpointer);
void tools_select_cmd_callback (GtkWidget *widget,
gpointer callback_data,
guint callback_action);
void filters_repeat_cmd_callback (GtkWidget *widget,
gpointer callback_data,
guint callback_action);
void dialogs_brushes_cmd_callback (GtkWidget *, gpointer);
void dialogs_patterns_cmd_callback (GtkWidget *, gpointer);
void dialogs_palette_cmd_callback (GtkWidget *, gpointer);
void dialogs_gradient_editor_cmd_callback (GtkWidget *, gpointer);
void dialogs_lc_cmd_callback (GtkWidget *, gpointer);
void dialogs_lc_cmd_callback (GtkWidget *, gpointer);
void dialogs_indexed_palette_cmd_callback (GtkWidget *, gpointer);
void dialogs_tools_options_cmd_callback (GtkWidget *, gpointer);
void dialogs_input_devices_cmd_callback (GtkWidget *, gpointer);
void dialogs_device_status_cmd_callback (GtkWidget *, gpointer);
void dialogs_error_console_cmd_callback (GtkWidget *, gpointer);
void about_dialog_cmd_callback (GtkWidget *, gpointer);
void tips_dialog_cmd_callback (GtkWidget *, gpointer);
void dialogs_module_browser_cmd_callback (GtkWidget *, gpointer);
void dialogs_tools_options_cmd_callback (GtkWidget *, gpointer);
void dialogs_input_devices_cmd_callback (GtkWidget *, gpointer);
void dialogs_device_status_cmd_callback (GtkWidget *, gpointer);
void dialogs_error_console_cmd_callback (GtkWidget *, gpointer);
void dialogs_module_browser_cmd_callback (GtkWidget *, gpointer);
void about_dialog_cmd_callback (GtkWidget *, gpointer);
void tips_dialog_cmd_callback (GtkWidget *, gpointer);
#endif /* __COMMANDS_H__ */

View File

@ -74,8 +74,8 @@
typedef struct
{
Resize * resize;
GimpImage* gimage;
Resize *resize;
GimpImage *gimage;
} ImageResize;
/* external functions */
@ -131,7 +131,6 @@ file_close_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay *gdisp;
return_if_no_display (gdisp);
gdisplay_close_window (gdisp, FALSE);
@ -149,7 +148,6 @@ edit_cut_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
global_edit_cut (gdisp);
@ -160,7 +158,6 @@ edit_copy_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
global_edit_copy (gdisp);
@ -171,7 +168,6 @@ edit_paste_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
global_edit_paste (gdisp, 0);
@ -182,7 +178,6 @@ edit_paste_into_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
global_edit_paste (gdisp, 1);
@ -193,7 +188,6 @@ edit_clear_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
edit_clear (gdisp->gimage, gimage_active_drawable (gdisp->gimage));
@ -205,7 +199,6 @@ edit_fill_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
edit_fill (gdisp->gimage, gimage_active_drawable (gdisp->gimage));
@ -217,7 +210,6 @@ edit_stroke_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
gimage_mask_stroke (gdisp->gimage, gimage_active_drawable (gdisp->gimage));
@ -229,7 +221,6 @@ edit_undo_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
undo_pop (gdisp->gimage);
@ -240,7 +231,6 @@ edit_redo_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
undo_redo (gdisp->gimage);
@ -251,7 +241,6 @@ edit_named_cut_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
named_edit_cut (gdisp);
@ -262,7 +251,6 @@ edit_named_copy_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
named_edit_copy (gdisp);
@ -273,30 +261,16 @@ edit_named_paste_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
named_edit_paste (gdisp);
}
void
select_toggle_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
selection_hide (gdisp->select, (void *) gdisp);
gdisplays_flush ();
}
void
select_invert_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
gimage_mask_invert (gdisp->gimage);
@ -308,7 +282,6 @@ select_all_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
gimage_mask_all (gdisp->gimage);
@ -320,7 +293,6 @@ select_none_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
gimage_mask_none (gdisp->gimage);
@ -332,7 +304,6 @@ select_float_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
gimage_mask_float (gdisp->gimage, gimage_active_drawable (gdisp->gimage),
@ -345,7 +316,6 @@ select_sharpen_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
gimage_mask_sharpen (gdisp->gimage);
@ -357,7 +327,6 @@ select_border_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
query_size_box (N_("Border Selection"),
@ -376,7 +345,6 @@ select_feather_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
query_size_box (N_("Feather Selection"),
@ -395,7 +363,6 @@ select_grow_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
query_size_box (N_("Grow Selection"),
@ -414,7 +381,6 @@ select_shrink_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
query_size_box (N_("Shrink Selection"),
@ -433,7 +399,6 @@ select_save_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
gimage_mask_save (gdisp->gimage);
@ -445,7 +410,6 @@ view_dot_for_dot_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay *gdisp;
return_if_no_display (gdisp);
gdisplay_set_dot_for_dot (gdisp, GTK_CHECK_MENU_ITEM (widget)->active);
@ -456,7 +420,6 @@ view_zoomin_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay *gdisp;
return_if_no_display (gdisp);
change_scale (gdisp, ZOOMIN);
@ -467,7 +430,6 @@ view_zoomout_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay *gdisp;
return_if_no_display (gdisp);
change_scale (gdisp, ZOOMOUT);
@ -479,7 +441,6 @@ view_zoom_val (GtkWidget *widget,
int val)
{
GDisplay *gdisp;
return_if_no_display (gdisp);
change_scale (gdisp, val);
@ -553,7 +514,6 @@ view_window_info_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
if (! gdisp->window_info_dialog)
@ -562,12 +522,22 @@ view_window_info_cmd_callback (GtkWidget *widget,
info_dialog_popup (gdisp->window_info_dialog);
}
void
view_toggle_selection_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
selection_hide (gdisp->select, (void *) gdisp);
gdisplays_flush ();
}
void
view_toggle_rulers_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
/* This routine use promiscuous knowledge of gtk internals
@ -632,7 +602,6 @@ view_snap_to_guides_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
gdisp->snap_to_guides = GTK_CHECK_MENU_ITEM (widget)->active;
@ -643,7 +612,6 @@ view_toggle_statusbar_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
if (!GTK_CHECK_MENU_ITEM (widget)->active)
@ -663,7 +631,6 @@ view_new_view_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay *gdisp;
return_if_no_display (gdisp);
gdisplay_new_view (gdisp);
@ -674,7 +641,6 @@ view_shrink_wrap_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay *gdisp;
return_if_no_display (gdisp);
shrink_wrap_display (gdisp);
@ -685,7 +651,6 @@ image_equalize_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
image_equalize ((void *) gdisp->gimage);
@ -697,7 +662,6 @@ image_invert_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
image_invert ((void *) gdisp->gimage);
@ -709,7 +673,6 @@ image_desaturate_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
image_desaturate ((void *) gdisp->gimage);
@ -721,7 +684,6 @@ channel_ops_duplicate_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
channel_ops_duplicate ((void *) gdisp->gimage);
@ -732,7 +694,6 @@ channel_ops_offset_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
channel_ops_offset ((void *) gdisp->gimage);
@ -743,7 +704,6 @@ image_convert_rgb_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
convert_to_rgb ((void *) gdisp->gimage);
@ -754,7 +714,6 @@ image_convert_grayscale_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
convert_to_grayscale ((void *) gdisp->gimage);
@ -765,7 +724,6 @@ image_convert_indexed_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
convert_to_indexed ((void *) gdisp->gimage);
@ -892,7 +850,6 @@ layers_raise_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
gimage_raise_layer (gdisp->gimage, gdisp->gimage->active_layer);
@ -904,7 +861,6 @@ layers_lower_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
gimage_lower_layer (gdisp->gimage, gdisp->gimage->active_layer);
@ -916,7 +872,6 @@ layers_raise_to_top_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
gimage_raise_layer_to_top (gdisp->gimage, gdisp->gimage->active_layer);
@ -928,7 +883,6 @@ layers_lower_to_bottom_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
gimage_lower_layer_to_bottom (gdisp->gimage, gdisp->gimage->active_layer);
@ -940,7 +894,6 @@ layers_anchor_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
floating_sel_anchor (gimage_get_active_layer (gdisp->gimage));
@ -952,7 +905,6 @@ layers_merge_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
layers_dialog_layer_merge_query (gdisp->gimage, TRUE);
@ -963,7 +915,6 @@ layers_flatten_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
gimage_flatten (gdisp->gimage);
@ -975,7 +926,6 @@ layers_alpha_select_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
gimage_mask_layer_alpha (gdisp->gimage, gdisp->gimage->active_layer);
@ -987,7 +937,6 @@ layers_mask_select_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
gimage_mask_layer_mask (gdisp->gimage, gdisp->gimage->active_layer);
@ -999,7 +948,6 @@ layers_add_alpha_channel_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
return_if_no_display (gdisp);
layer_add_alpha ( gdisp->gimage->active_layer);
@ -1026,25 +974,22 @@ tools_select_cmd_callback (GtkWidget *widget,
guint callback_action)
{
GDisplay * gdisp;
gdisp = gdisplay_active ();
if (!tool_info[callback_action].init_func)
{
/* Activate the approriate widget */
gtk_widget_activate (tool_info[callback_action].tool_widget);
}
else
{
/* if the tool_info has an init_func */
gtk_widget_activate (tool_info[callback_action].tool_widget);
if (gdisp)
(* tool_info[callback_action].init_func) (gdisp);
}
/* Activate the approriate widget.
* Implicitly calls tools_select()
*/
gtk_widget_activate (tool_info[callback_action].tool_widget);
if (gdisp)
active_tool->drawable = gimage_active_drawable (gdisp->gimage);
/* Complete the initialisation by doing the same stuff
* tools_initialize() does after it did what tools_select() does
*/
if (tool_info[callback_action].init_func && gdisp)
{
(* tool_info[callback_action].init_func) (gdisp);
active_tool->gdisp_ptr = gdisp;
active_tool->drawable = gimage_active_drawable (gdisp->gimage);
}
}
void
@ -1088,13 +1033,9 @@ dialogs_lc_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
GDisplay * gdisp;
gdisp = gdisplay_active ();
if (gdisp == NULL)
lc_dialog_create (NULL);
else
lc_dialog_create (gdisp->gimage);
lc_dialog_create (gdisp ? gdisp->gimage : NULL);
}
static void

View File

@ -1,104 +1,112 @@
#ifndef __COMMANDS_H__
#define __COMMANDS_H__
#include "gtk/gtk.h"
void file_new_cmd_callback (GtkWidget *widget,
gpointer callback_data,
guint callback_action);
void file_open_cmd_callback (GtkWidget *, gpointer);
void file_save_cmd_callback (GtkWidget *, gpointer);
void file_new_cmd_callback (GtkWidget *widget,
gpointer callback_data,
guint callback_action);
void file_open_cmd_callback (GtkWidget *, gpointer);
void file_save_cmd_callback (GtkWidget *, gpointer);
void file_save_as_cmd_callback (GtkWidget *, gpointer);
void file_revert_cmd_callback (GtkWidget *, gpointer);
void file_pref_cmd_callback (GtkWidget *, gpointer);
void file_close_cmd_callback (GtkWidget *, gpointer);
void file_quit_cmd_callback (GtkWidget *, gpointer);
void edit_cut_cmd_callback (GtkWidget *, gpointer);
void edit_copy_cmd_callback (GtkWidget *, gpointer);
void edit_paste_cmd_callback (GtkWidget *, gpointer);
void edit_paste_into_cmd_callback (GtkWidget *, gpointer);
void edit_clear_cmd_callback (GtkWidget *, gpointer);
void edit_fill_cmd_callback (GtkWidget *, gpointer);
void edit_stroke_cmd_callback (GtkWidget *, gpointer);
void edit_undo_cmd_callback (GtkWidget *, gpointer);
void edit_redo_cmd_callback (GtkWidget *, gpointer);
void edit_named_cut_cmd_callback (GtkWidget *, gpointer);
void edit_named_copy_cmd_callback (GtkWidget *, gpointer);
void file_revert_cmd_callback (GtkWidget *, gpointer);
void file_pref_cmd_callback (GtkWidget *, gpointer);
void file_close_cmd_callback (GtkWidget *, gpointer);
void file_quit_cmd_callback (GtkWidget *, gpointer);
void edit_cut_cmd_callback (GtkWidget *, gpointer);
void edit_copy_cmd_callback (GtkWidget *, gpointer);
void edit_paste_cmd_callback (GtkWidget *, gpointer);
void edit_paste_into_cmd_callback (GtkWidget *, gpointer);
void edit_clear_cmd_callback (GtkWidget *, gpointer);
void edit_fill_cmd_callback (GtkWidget *, gpointer);
void edit_stroke_cmd_callback (GtkWidget *, gpointer);
void edit_undo_cmd_callback (GtkWidget *, gpointer);
void edit_redo_cmd_callback (GtkWidget *, gpointer);
void edit_named_cut_cmd_callback (GtkWidget *, gpointer);
void edit_named_copy_cmd_callback (GtkWidget *, gpointer);
void edit_named_paste_cmd_callback (GtkWidget *, gpointer);
void select_toggle_cmd_callback (GtkWidget *, gpointer);
void select_invert_cmd_callback (GtkWidget *, gpointer);
void select_all_cmd_callback (GtkWidget *, gpointer);
void select_none_cmd_callback (GtkWidget *, gpointer);
void select_float_cmd_callback (GtkWidget *, gpointer);
void select_sharpen_cmd_callback (GtkWidget *, gpointer);
void select_border_cmd_callback (GtkWidget *, gpointer);
void select_feather_cmd_callback (GtkWidget *, gpointer);
void select_grow_cmd_callback (GtkWidget *, gpointer);
void select_shrink_cmd_callback (GtkWidget *, gpointer);
void select_invert_cmd_callback (GtkWidget *, gpointer);
void select_all_cmd_callback (GtkWidget *, gpointer);
void select_none_cmd_callback (GtkWidget *, gpointer);
void select_float_cmd_callback (GtkWidget *, gpointer);
void select_sharpen_cmd_callback (GtkWidget *, gpointer);
void select_border_cmd_callback (GtkWidget *, gpointer);
void select_feather_cmd_callback (GtkWidget *, gpointer);
void select_grow_cmd_callback (GtkWidget *, gpointer);
void select_shrink_cmd_callback (GtkWidget *, gpointer);
void select_by_color_cmd_callback (GtkWidget *, gpointer);
void select_save_cmd_callback (GtkWidget *, gpointer);
void view_dot_for_dot_callback (GtkWidget *, gpointer);
void view_zoomin_cmd_callback (GtkWidget *, gpointer);
void view_zoomout_cmd_callback (GtkWidget *, gpointer);
void view_zoom_16_1_callback (GtkWidget *, gpointer);
void view_zoom_8_1_callback (GtkWidget *, gpointer);
void view_zoom_4_1_callback (GtkWidget *, gpointer);
void view_zoom_2_1_callback (GtkWidget *, gpointer);
void view_zoom_1_1_callback (GtkWidget *, gpointer);
void view_zoom_1_2_callback (GtkWidget *, gpointer);
void view_zoom_1_4_callback (GtkWidget *, gpointer);
void view_zoom_1_8_callback (GtkWidget *, gpointer);
void view_zoom_1_16_callback (GtkWidget *, gpointer);
void view_window_info_cmd_callback (GtkWidget *, gpointer);
void view_toggle_rulers_cmd_callback (GtkWidget *, gpointer);
void view_toggle_guides_cmd_callback (GtkWidget *, gpointer);
void select_save_cmd_callback (GtkWidget *, gpointer);
void view_dot_for_dot_callback (GtkWidget *, gpointer);
void view_zoomin_cmd_callback (GtkWidget *, gpointer);
void view_zoomout_cmd_callback (GtkWidget *, gpointer);
void view_zoom_16_1_callback (GtkWidget *, gpointer);
void view_zoom_8_1_callback (GtkWidget *, gpointer);
void view_zoom_4_1_callback (GtkWidget *, gpointer);
void view_zoom_2_1_callback (GtkWidget *, gpointer);
void view_zoom_1_1_callback (GtkWidget *, gpointer);
void view_zoom_1_2_callback (GtkWidget *, gpointer);
void view_zoom_1_4_callback (GtkWidget *, gpointer);
void view_zoom_1_8_callback (GtkWidget *, gpointer);
void view_zoom_1_16_callback (GtkWidget *, gpointer);
void view_window_info_cmd_callback (GtkWidget *, gpointer);
void view_toggle_selection_cmd_callback (GtkWidget *, gpointer);
void view_toggle_rulers_cmd_callback (GtkWidget *, gpointer);
void view_toggle_guides_cmd_callback (GtkWidget *, gpointer);
void view_toggle_statusbar_cmd_callback (GtkWidget *, gpointer);
void view_snap_to_guides_cmd_callback (GtkWidget *, gpointer);
void view_new_view_cmd_callback (GtkWidget *, gpointer);
void view_shrink_wrap_cmd_callback (GtkWidget *, gpointer);
void image_equalize_cmd_callback (GtkWidget *, gpointer);
void image_invert_cmd_callback (GtkWidget *, gpointer);
void image_desaturate_cmd_callback (GtkWidget *, gpointer);
void image_convert_rgb_cmd_callback (GtkWidget *, gpointer);
void view_snap_to_guides_cmd_callback (GtkWidget *, gpointer);
void view_new_view_cmd_callback (GtkWidget *, gpointer);
void view_shrink_wrap_cmd_callback (GtkWidget *, gpointer);
void image_equalize_cmd_callback (GtkWidget *, gpointer);
void image_invert_cmd_callback (GtkWidget *, gpointer);
void image_desaturate_cmd_callback (GtkWidget *, gpointer);
void image_convert_rgb_cmd_callback (GtkWidget *, gpointer);
void image_convert_grayscale_cmd_callback (GtkWidget *, gpointer);
void image_convert_indexed_cmd_callback (GtkWidget *, gpointer);
void image_resize_cmd_callback (GtkWidget *, gpointer);
void image_scale_cmd_callback (GtkWidget *, gpointer);
void image_convert_indexed_cmd_callback (GtkWidget *, gpointer);
void image_resize_cmd_callback (GtkWidget *, gpointer);
void image_scale_cmd_callback (GtkWidget *, gpointer);
void channel_ops_duplicate_cmd_callback (GtkWidget *, gpointer);
void channel_ops_offset_cmd_callback (GtkWidget *, gpointer);
void layers_previous_cmd_callback (GtkWidget *, gpointer);
void layers_next_cmd_callback (GtkWidget *, gpointer);
void layers_raise_cmd_callback (GtkWidget *, gpointer);
void layers_lower_cmd_callback (GtkWidget *, gpointer);
void layers_raise_to_top_cmd_callback (GtkWidget *, gpointer);
void layers_lower_to_bottom_cmd_callback (GtkWidget *, gpointer);
void layers_anchor_cmd_callback (GtkWidget *, gpointer);
void layers_merge_cmd_callback (GtkWidget *, gpointer);
void layers_flatten_cmd_callback (GtkWidget *, gpointer);
void layers_alpha_select_cmd_callback (GtkWidget *, gpointer);
void layers_mask_select_cmd_callback (GtkWidget *, gpointer);
void channel_ops_offset_cmd_callback (GtkWidget *, gpointer);
void layers_previous_cmd_callback (GtkWidget *, gpointer);
void layers_next_cmd_callback (GtkWidget *, gpointer);
void layers_raise_cmd_callback (GtkWidget *, gpointer);
void layers_lower_cmd_callback (GtkWidget *, gpointer);
void layers_raise_to_top_cmd_callback (GtkWidget *, gpointer);
void layers_lower_to_bottom_cmd_callback (GtkWidget *, gpointer);
void layers_anchor_cmd_callback (GtkWidget *, gpointer);
void layers_merge_cmd_callback (GtkWidget *, gpointer);
void layers_flatten_cmd_callback (GtkWidget *, gpointer);
void layers_alpha_select_cmd_callback (GtkWidget *, gpointer);
void layers_mask_select_cmd_callback (GtkWidget *, gpointer);
void layers_add_alpha_channel_cmd_callback (GtkWidget *, gpointer);
void tools_default_colors_cmd_callback (GtkWidget *, gpointer);
void tools_swap_colors_cmd_callback (GtkWidget *, gpointer);
void tools_select_cmd_callback (GtkWidget *widget,
gpointer callback_data,
guint callback_action);
void filters_repeat_cmd_callback (GtkWidget *widget,
gpointer callback_data,
guint callback_action);
void dialogs_brushes_cmd_callback (GtkWidget *, gpointer);
void dialogs_patterns_cmd_callback (GtkWidget *, gpointer);
void dialogs_palette_cmd_callback (GtkWidget *, gpointer);
void tools_swap_colors_cmd_callback (GtkWidget *, gpointer);
void tools_select_cmd_callback (GtkWidget *widget,
gpointer callback_data,
guint callback_action);
void filters_repeat_cmd_callback (GtkWidget *widget,
gpointer callback_data,
guint callback_action);
void dialogs_brushes_cmd_callback (GtkWidget *, gpointer);
void dialogs_patterns_cmd_callback (GtkWidget *, gpointer);
void dialogs_palette_cmd_callback (GtkWidget *, gpointer);
void dialogs_gradient_editor_cmd_callback (GtkWidget *, gpointer);
void dialogs_lc_cmd_callback (GtkWidget *, gpointer);
void dialogs_lc_cmd_callback (GtkWidget *, gpointer);
void dialogs_indexed_palette_cmd_callback (GtkWidget *, gpointer);
void dialogs_tools_options_cmd_callback (GtkWidget *, gpointer);
void dialogs_input_devices_cmd_callback (GtkWidget *, gpointer);
void dialogs_device_status_cmd_callback (GtkWidget *, gpointer);
void dialogs_error_console_cmd_callback (GtkWidget *, gpointer);
void about_dialog_cmd_callback (GtkWidget *, gpointer);
void tips_dialog_cmd_callback (GtkWidget *, gpointer);
void dialogs_module_browser_cmd_callback (GtkWidget *, gpointer);
void dialogs_tools_options_cmd_callback (GtkWidget *, gpointer);
void dialogs_input_devices_cmd_callback (GtkWidget *, gpointer);
void dialogs_device_status_cmd_callback (GtkWidget *, gpointer);
void dialogs_error_console_cmd_callback (GtkWidget *, gpointer);
void dialogs_module_browser_cmd_callback (GtkWidget *, gpointer);
void about_dialog_cmd_callback (GtkWidget *, gpointer);
void tips_dialog_cmd_callback (GtkWidget *, gpointer);
#endif /* __COMMANDS_H__ */

View File

@ -53,12 +53,13 @@ static GSList *last_opened_raw_filenames = NULL;
static GtkItemFactoryEntry toolbox_entries[] =
{
{ N_("/File/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/File/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/File/New"), "<control>N", file_new_cmd_callback, 0 },
{ N_("/File/Open"), "<control>O", file_open_cmd_callback, 0 },
{ N_("/File/About..."), NULL, about_dialog_cmd_callback, 0 },
{ N_("/File/Preferences..."), NULL, file_pref_cmd_callback, 0 },
{ N_("/File/Tip of the day"), NULL, tips_dialog_cmd_callback, 0 },
{ N_("/File/Dialogs/Brushes..."), "<control><shift>B", dialogs_brushes_cmd_callback, 0 },
{ N_("/File/Dialogs/Patterns..."), "<control><shift>P", dialogs_patterns_cmd_callback, 0 },
{ N_("/File/Dialogs/Palette..."), "<control>P", dialogs_palette_cmd_callback, 0 },
@ -69,7 +70,8 @@ static GtkItemFactoryEntry toolbox_entries[] =
{ N_("/File/Dialogs/Device Status..."), NULL, dialogs_device_status_cmd_callback, 0 },
{ N_("/File/Dialogs/Document Index..."), NULL, raise_idea_callback, 0 },
{ N_("/File/Dialogs/Error Console..."), NULL, dialogs_error_console_cmd_callback, 0 },
{ N_("/Xtns/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Xtns/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Xtns/Module Browser"), NULL, dialogs_module_browser_cmd_callback, 0 },
{ N_("/File/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/File/---"), NULL, NULL, 0, "<Separator>" }
@ -82,8 +84,8 @@ static GtkItemFactoryEntry toolbox_end = { N_("/File/Quit"), "<control>Q", file_
static GtkItemFactoryEntry image_entries[] =
{
{ N_("/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/File/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/File/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/File/New"), "<control>N", file_new_cmd_callback, 1 },
{ N_("/File/Open"), "<control>O", file_open_cmd_callback, 0 },
{ N_("/File/Save"), "<control>S", file_save_cmd_callback, 0 },
@ -91,12 +93,12 @@ static GtkItemFactoryEntry image_entries[] =
{ N_("/File/Revert"), NULL, file_revert_cmd_callback, 0 },
{ N_("/File/Preferences..."), NULL, file_pref_cmd_callback, 0 },
{ N_("/File/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/File/Close"), "<control>W", file_close_cmd_callback, 0 },
{ N_("/File/Quit"), "<control>Q", file_quit_cmd_callback, 0 },
{ N_("/File/---moved"), NULL, NULL, 0, "<Separator>" },
{ N_("/Edit/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Edit/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Edit/Cut"), "<control>X", edit_cut_cmd_callback, 0 },
{ N_("/Edit/Copy"), "<control>C", edit_copy_cmd_callback, 0 },
{ N_("/Edit/Paste"), "<control>V", edit_paste_cmd_callback, 0 },
@ -112,8 +114,7 @@ static GtkItemFactoryEntry image_entries[] =
{ N_("/Edit/Paste Named"), "<control><shift>V", edit_named_paste_cmd_callback, 0 },
{ N_("/Edit/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/Select/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Select/Toggle"), "<control>T", select_toggle_cmd_callback, 0 },
{ N_("/Select/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Select/Invert"), "<control>I", select_invert_cmd_callback, 0 },
{ N_("/Select/All"), "<control>A", select_all_cmd_callback, 0 },
{ N_("/Select/None"), "<control><shift>A", select_none_cmd_callback, 0 },
@ -125,7 +126,7 @@ static GtkItemFactoryEntry image_entries[] =
{ N_("/Select/Shrink"), NULL, select_shrink_cmd_callback, 0 },
{ N_("/Select/Save To Channel"), NULL, select_save_cmd_callback, 0 },
{ N_("/View/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/View/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/View/Zoom In"), "equal", view_zoomin_cmd_callback, 0 },
{ N_("/View/Zoom Out"), "minus", view_zoomout_cmd_callback, 0 },
{ N_("/View/Zoom/16:1"), NULL, view_zoom_16_1_callback, 0 },
@ -139,24 +140,28 @@ static GtkItemFactoryEntry image_entries[] =
{ N_("/View/Zoom/1:16"), NULL, view_zoom_1_16_callback, 0 },
{ N_("/View/Dot for dot"), NULL, view_dot_for_dot_callback, 0, "<ToggleItem>"},
{ N_("/View/Window Info..."), "<control><shift>I", view_window_info_cmd_callback, 0 },
{ N_("/View/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/View/Toggle Selection"), "<control>T", view_toggle_selection_cmd_callback, 0 },
{ N_("/View/Toggle Rulers"), "<control><shift>R", view_toggle_rulers_cmd_callback, 0, "<ToggleItem>" },
{ N_("/View/Toggle Statusbar"), "<control><shift>S", view_toggle_statusbar_cmd_callback, 0, "<ToggleItem>" },
{ N_("/View/Toggle Guides"), "<control><shift>T", view_toggle_guides_cmd_callback, 0, "<ToggleItem>" },
{ N_("/View/Snap To Guides"), NULL, view_snap_to_guides_cmd_callback, 0, "<ToggleItem>" },
{ N_("/View/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/View/New View"), NULL, view_new_view_cmd_callback, 0 },
{ N_("/View/Shrink Wrap"), "<control>E", view_shrink_wrap_cmd_callback, 0 },
{ N_("/Image/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Image/Colors/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Image/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Image/Colors/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Image/Colors/Equalize"), NULL, image_equalize_cmd_callback, 0 },
{ N_("/Image/Colors/Invert"), NULL, image_invert_cmd_callback, 0 },
{ N_("/Image/Colors/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/Image/Colors/Desaturate"), NULL, image_desaturate_cmd_callback, 0 },
{ N_("/Image/Channel Ops/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Image/Channel Ops/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Image/Channel Ops/Duplicate"), "<control>D", channel_ops_duplicate_cmd_callback, 0 },
{ N_("/Image/Channel Ops/Offset"), "<control><shift>O", channel_ops_offset_cmd_callback, 0 },
{ N_("/Image/Alpha/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Image/Alpha/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Image/Alpha/Add Alpha Channel"), NULL, layers_add_alpha_channel_cmd_callback, 0 },
{ N_("/Image/---"), NULL, NULL, 0, "<Separator>" },
@ -167,10 +172,10 @@ static GtkItemFactoryEntry image_entries[] =
{ N_("/Image/Resize"), NULL, image_resize_cmd_callback, 0 },
{ N_("/Image/Scale"), NULL, image_scale_cmd_callback, 0 },
{ N_("/Image/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/Layers/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Layers/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Layers/Layers & Channels..."), "<control>L", dialogs_lc_cmd_callback, 0 },
{ N_("/Layers/Stack/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Layers/Stack/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Layers/Stack/Previous Layer"), "Prior", layers_previous_cmd_callback, 0 },
{ N_("/Layers/Stack/Next Layer"), "Next", layers_next_cmd_callback, 0 },
{ N_("/Layers/Stack/Raise Layer"), "<shift>Prior", layers_raise_cmd_callback, 0 },
@ -186,52 +191,23 @@ static GtkItemFactoryEntry image_entries[] =
{ N_("/Layers/Add Alpha Channel"), NULL, layers_add_alpha_channel_cmd_callback, 0 },
{ N_("/Layers/---"), NULL, NULL, 0, "<Separator>" },
/* these are built on the fly */
/*
{ N_("/Tools/Ellipse Select"), "E", tools_select_cmd_callback, ELLIPSE_SELECT },
{ N_("/Tools/Free Select"), "F", tools_select_cmd_callback, FREE_SELECT },
{ N_("/Tools/Fuzzy Select"), "Z", tools_select_cmd_callback, FUZZY_SELECT },
{ N_("/Tools/Bezier Select"), "B", tools_select_cmd_callback, BEZIER_SELECT },
{ N_("/Tools/Intelligent Scissors"), "I", tools_select_cmd_callback, ISCISSORS },
{ N_("/Tools/Move"), "M", tools_select_cmd_callback, MOVE },
{ N_("/Tools/Magnify"), "<shift>M", tools_select_cmd_callback, MAGNIFY },
{ N_("/Tools/Crop"), "<shift>C", tools_select_cmd_callback, CROP },
{ N_("/Tools/Transform"), "<shift>T", tools_select_cmd_callback, ROTATE },
{ N_("/Tools/Flip"), "<shift>F", tools_select_cmd_callback, FLIP },
{ N_("/Tools/Text"), "T", tools_select_cmd_callback, TEXT },
{ N_("/Tools/Color Picker"), "O", tools_select_cmd_callback, COLOR_PICKER },
{ N_("/Tools/Bucket Fill"), "<shift>B", tools_select_cmd_callback, BUCKET_FILL },
{ N_("/Tools/Blend"), "L", tools_select_cmd_callback, BLEND },
{ N_("/Tools/Paintbrush"), "P", tools_select_cmd_callback, PAINTBRUSH },
{ N_("/Tools/Pencil"), "<shift>P", tools_select_cmd_callback, PENCIL },
{ N_("/Tools/Eraser"), "<shift>E", tools_select_cmd_callback, ERASER },
{ N_("/Tools/Airbrush"), "A", tools_select_cmd_callback, AIRBRUSH },
{ N_("/Tools/Clone"), "C", tools_select_cmd_callback, CLONE },
{ N_("/Tools/Convolve"), "V", tools_select_cmd_callback, CONVOLVE },
{ N_("/Tools/Ink"), "K", tools_select_cmd_callback, INK },
{ N_("/Tools/Default Colors"), "D", tools_default_colors_cmd_callback, 0 },
{ N_("/Tools/Toolbox"), NULL, toolbox_raise_callback, 0 },
{ N_("/Tools/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/Tools/Default Colors"), "D", tools_default_colors_cmd_callback, 0 },
{ N_("/Tools/Swap Colors"), "X", tools_swap_colors_cmd_callback, 0 },
*/
{ N_("/Tools/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Tools/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Tools/Toolbox"), NULL, toolbox_raise_callback, 0 },
{ N_("/Tools/Default Colors"), "D", tools_default_colors_cmd_callback, 0 },
{ N_("/Tools/Swap Colors"), "X", tools_swap_colors_cmd_callback, 0 },
{ N_("/Tools/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/Filters/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
/* the tool entries themselves are built on the fly */
{ N_("/Filters/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Filters/Repeat last"), "<alt>F", filters_repeat_cmd_callback, 0x0 },
{ N_("/Filters/Re-show last"), "<alt><shift>F", filters_repeat_cmd_callback, 0x1 },
{ N_("/Filters/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/Script-Fu/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Script-Fu/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Script-Fu/"), NULL, NULL, 0 },
{ N_("/Dialogs/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Dialogs/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Dialogs/Brushes..."), "<control><shift>B", dialogs_brushes_cmd_callback, 0 },
{ N_("/Dialogs/Patterns..."), "<control><shift>P", dialogs_patterns_cmd_callback, 0 },
{ N_("/Dialogs/Palette..."), "<control>P", dialogs_palette_cmd_callback, 0 },
@ -271,8 +247,8 @@ static GtkItemFactoryEntry layers_entries[] =
{ N_("/Stack/Layer to Top"), "<control>Prior", layers_dialog_raise_layer_to_top_callback, 0 },
{ N_("/Stack/Layer to Bottom"), "<control>Next", layers_dialog_lower_layer_to_bottom_callback, 0 },
{ N_("/Duplicate Layer"), "<control>C", layers_dialog_duplicate_layer_callback, 0 },
{ N_("/Delete Layer"), "<control>X", layers_dialog_delete_layer_callback, 0 },
{ N_("/Anchor Layer"), "<control>H", layers_dialog_anchor_layer_callback, 0 },
{ N_("/Delete Layer"), "<control>X", layers_dialog_delete_layer_callback, 0 },
{ "/---", NULL, NULL, 0, "<Separator>" },
{ N_("/Scale Layer"), "<control>S", layers_dialog_scale_layer_callback, 0 },
{ N_("/Resize Layer"), "<control>R", layers_dialog_resize_layer_callback, 0 },
@ -296,12 +272,13 @@ static GtkItemFactoryEntry channels_entries[] =
{ N_("/Raise Channel"), "<control>F", channels_dialog_raise_channel_callback, 0 },
{ N_("/Lower Channel"), "<control>B", channels_dialog_lower_channel_callback, 0 },
{ N_("/Duplicate Channel"), "<control>C", channels_dialog_duplicate_channel_callback, 0 },
{ N_("/Delete Channel"), "<control>X", channels_dialog_delete_channel_callback, 0 },
{ "/---", NULL, NULL, 0, "<Separator>" },
{ N_("/Channel to Selection"), "<control>S", channels_dialog_channel_to_sel_callback, 0 },
{ N_("/Add to Selection"), NULL, channels_dialog_add_channel_to_sel_callback, 0 },
{ N_("/Subtract From Selection"), NULL, channels_dialog_sub_channel_from_sel_callback, 0 },
{ N_("/Intersect With Selection"), NULL, channels_dialog_sub_channel_from_sel_callback, 0 }
{ N_("/Intersect With Selection"), NULL, channels_dialog_sub_channel_from_sel_callback, 0 },
{ "/---", NULL, NULL, 0, "<Separator>" },
{ N_("/Delete Channel"), "<control>X", channels_dialog_delete_channel_callback, 0 }
};
static guint n_channels_entries = sizeof (channels_entries) / sizeof (channels_entries[0]);
static GtkItemFactory *channels_factory = NULL;
@ -310,9 +287,9 @@ static GtkItemFactoryEntry paths_entries[] =
{
{ N_("/New Path"), "<control>N", paths_dialog_new_path_callback, 0 },
{ N_("/Duplicate Path"), "<control>U", paths_dialog_dup_path_callback, 0 },
{ N_("/Delete Path"), "<control>X", paths_dialog_delete_path_callback, 0 },
{ N_("/Path to Selection"), "<control>S", paths_dialog_path_to_sel_callback, 0 },
{ N_("/Stroke Path"), "<control>T", paths_dialog_stroke_path_callback, 0 },
{ N_("/Delete Path"), "<control>X", paths_dialog_delete_path_callback, 0 },
{ "/---", NULL, NULL, 0, "<Separator>" },
{ N_("/Copy Path"), "<control>C", paths_dialog_copy_path_callback, 0 },
{ N_("/Paste Path"), "<control>V", paths_dialog_paste_path_callback, 0 },
@ -489,7 +466,7 @@ menus_tools_create (ToolInfo *tool_info)
entry.callback = tools_select_cmd_callback;
entry.callback_action = tool_info->tool_id;
entry.item_type = NULL;
gtk_item_factory_create_item (image_factory,
&entry,
(gpointer) tool_info,
@ -511,12 +488,12 @@ menus_set_sensitive (gchar *path,
if (ifactory)
{
widget = gtk_item_factory_get_widget (ifactory, path);
gtk_widget_set_sensitive (widget, sensitive);
}
if (!ifactory || !widget)
g_warning ("Unable to set sensitivity for menu which doesn't exist:\n%s", path);
}
}
/* The following function will enhance our localesystem because
we don't need to have our menuentries twice in our catalog */
@ -598,7 +575,6 @@ menus_quit (void)
gtk_object_unref (GTK_OBJECT (channels_factory));
gtk_object_unref (GTK_OBJECT (paths_factory));
}
}
void
@ -618,11 +594,11 @@ menus_last_opened_cmd_callback (GtkWidget *widget,
void
menus_last_opened_update_labels (void)
{
GSList *filename_slist;
GString *entry_filename, *path;
GtkWidget *widget;
gint i;
guint num_entries;
GSList *filename_slist;
GString *entry_filename, *path;
GtkWidget *widget;
gint i;
guint num_entries;
entry_filename = g_string_new ("");
path = g_string_new ("");
@ -651,20 +627,20 @@ menus_last_opened_update_labels (void)
void
menus_last_opened_add (gchar *filename)
{
GString *raw_filename;
GSList *item;
GtkWidget *widget;
guint num_entries;
GString *raw_filename;
GSList *item;
GtkWidget *widget;
guint num_entries;
/* ignore the add if we've already got the filename on the list */
item = last_opened_raw_filenames;
while (item)
{
{
raw_filename = item->data;
if (!strcmp (raw_filename->str, filename))
return;
return;
item = g_slist_next (item);
}
}
num_entries = g_slist_length (last_opened_raw_filenames);
@ -824,7 +800,7 @@ menus_init (void)
{
/* FIXME this need to use access functions to check a flag */
if (tool_info[i].menu_path)
menus_tools_create (tool_info+i);
menus_tools_create (tool_info + i);
}
filename = gimp_personal_rc_file ("menurc");

View File

@ -1218,6 +1218,7 @@ plug_in_repeat (int with_interface)
if (last_plug_in)
{
gdisplay = gdisplay_active ();
if (!gdisplay) return;
/* construct the procedures arguments */
args = g_new (Argument, 3);
@ -2286,6 +2287,7 @@ plug_in_callback (GtkWidget *widget,
/* get the active gdisplay */
gdisplay = gdisplay_active ();
if (!gdisplay) return;
proc_rec = (ProcRecord*) client_data;

View File

@ -1218,6 +1218,7 @@ plug_in_repeat (int with_interface)
if (last_plug_in)
{
gdisplay = gdisplay_active ();
if (!gdisplay) return;
/* construct the procedures arguments */
args = g_new (Argument, 3);
@ -2286,6 +2287,7 @@ plug_in_callback (GtkWidget *widget,
/* get the active gdisplay */
gdisplay = gdisplay_active ();
if (!gdisplay) return;
proc_rec = (ProcRecord*) client_data;

View File

@ -43,10 +43,10 @@ struct _HistogramTool
/* the histogram tool options */
static ToolOptions *histogram_tool_options = NULL;
static ToolOptions * histogram_tool_options = NULL;
/* the histogram tool dialog */
static HistogramToolDialog *histogram_tool_dialog = NULL;
static HistogramToolDialog * histogram_tool_dialog = NULL;
/* histogram_tool action functions */
@ -54,17 +54,18 @@ static void histogram_tool_button_press (Tool *, GdkEventButton *, gpointer)
static void histogram_tool_button_release (Tool *, GdkEventButton *, gpointer);
static void histogram_tool_motion (Tool *, GdkEventMotion *, gpointer);
static void histogram_tool_cursor_update (Tool *, GdkEventMotion *, gpointer);
static void histogram_tool_control (Tool *, int, gpointer);
static void histogram_tool_control (Tool *, ToolAction, gpointer);
static HistogramToolDialog * histogram_tool_new_dialog (void);
static void histogram_tool_close_callback (GtkWidget *, gpointer);
static gint histogram_tool_delete_callback (GtkWidget *, GdkEvent *, gpointer);
static void histogram_tool_value_callback (GtkWidget *, gpointer);
static void histogram_tool_red_callback (GtkWidget *, gpointer);
static void histogram_tool_green_callback (GtkWidget *, gpointer);
static void histogram_tool_blue_callback (GtkWidget *, gpointer);
static HistogramToolDialog * histogram_tool_new_dialog (void);
static void histogram_tool_dialog_update (HistogramToolDialog *, int, int);
static void histogram_tool_close_callback (GtkWidget *, gpointer);
static gint histogram_tool_delete_callback (GtkWidget *, GdkEvent *, gpointer);
static void histogram_tool_value_callback (GtkWidget *, gpointer);
static void histogram_tool_red_callback (GtkWidget *, gpointer);
static void histogram_tool_green_callback (GtkWidget *, gpointer);
static void histogram_tool_blue_callback (GtkWidget *, gpointer);
static void histogram_tool_dialog_update (HistogramToolDialog *, int, int);
/* histogram_tool machinery */
@ -179,20 +180,25 @@ histogram_tool_cursor_update (Tool *tool,
}
static void
histogram_tool_control (Tool *tool,
int action,
gpointer gdisp_ptr)
histogram_tool_control (Tool *tool,
ToolAction action,
gpointer gdisp_ptr)
{
switch (action)
{
case PAUSE :
case PAUSE:
break;
case RESUME :
case RESUME:
break;
case HALT :
case HALT:
if (histogram_tool_dialog)
histogram_tool_close_callback (NULL, (gpointer) histogram_tool_dialog);
break;
default:
break;
}
}
@ -221,7 +227,8 @@ tools_new_histogram_tool ()
tool->button_press_func = histogram_tool_button_press;
tool->button_release_func = histogram_tool_button_release;
tool->motion_func = histogram_tool_motion;
tool->arrow_keys_func = standard_arrow_keys_func; tool->modifier_key_func = standard_modifier_key_func;
tool->arrow_keys_func = standard_arrow_keys_func;
tool->modifier_key_func = standard_modifier_key_func;
tool->cursor_update_func = histogram_tool_cursor_update;
tool->control_func = histogram_tool_control;
tool->preserve = FALSE;

View File

@ -83,14 +83,17 @@ static void hue_saturation_button_press (Tool *, GdkEventButton *, gpointer)
static void hue_saturation_button_release (Tool *, GdkEventButton *, gpointer);
static void hue_saturation_motion (Tool *, GdkEventMotion *, gpointer);
static void hue_saturation_cursor_update (Tool *, GdkEventMotion *, gpointer);
static void hue_saturation_control (Tool *, int, gpointer);
static void hue_saturation_control (Tool *, ToolAction, gpointer);
static HueSaturationDialog * hue_saturation_new_dialog (void);
static void hue_saturation_update (HueSaturationDialog *, int);
static HueSaturationDialog * hue_saturation_new_dialog (void);
static void hue_saturation_update (HueSaturationDialog *,
int);
static void hue_saturation_preview (HueSaturationDialog *);
static void hue_saturation_ok_callback (GtkWidget *, gpointer);
static void hue_saturation_cancel_callback (GtkWidget *, gpointer);
static gint hue_saturation_delete_callback (GtkWidget *, GdkEvent *, gpointer);
static gint hue_saturation_delete_callback (GtkWidget *, GdkEvent *,
gpointer);
static void hue_saturation_master_callback (GtkWidget *, gpointer);
static void hue_saturation_R_callback (GtkWidget *, gpointer);
static void hue_saturation_Y_callback (GtkWidget *, gpointer);
@ -105,7 +108,8 @@ static void hue_saturation_saturation_scale_update (GtkAdjustment *, gpointer)
static void hue_saturation_hue_text_update (GtkWidget *, gpointer);
static void hue_saturation_lightness_text_update (GtkWidget *, gpointer);
static void hue_saturation_saturation_text_update (GtkWidget *, gpointer);
static gint hue_saturation_hue_partition_events (GtkWidget *, GdkEvent *, HueSaturationDialog *);
static gint hue_saturation_hue_partition_events (GtkWidget *, GdkEvent *,
HueSaturationDialog *);
/* hue saturation machinery */
@ -262,9 +266,9 @@ hue_saturation_cursor_update (Tool *tool,
}
static void
hue_saturation_control (Tool *tool,
int action,
gpointer gdisp_ptr)
hue_saturation_control (Tool *tool,
ToolAction action,
gpointer gdisp_ptr)
{
HueSaturation * color_bal;
@ -272,11 +276,13 @@ hue_saturation_control (Tool *tool,
switch (action)
{
case PAUSE :
case PAUSE:
break;
case RESUME :
case RESUME:
break;
case HALT :
case HALT:
if (hue_saturation_dialog)
{
active_tool->preserve = TRUE;
@ -286,6 +292,9 @@ hue_saturation_control (Tool *tool,
hue_saturation_cancel_callback (NULL, (gpointer) hue_saturation_dialog);
}
break;
default:
break;
}
}
@ -314,7 +323,8 @@ tools_new_hue_saturation ()
tool->button_press_func = hue_saturation_button_press;
tool->button_release_func = hue_saturation_button_release;
tool->motion_func = hue_saturation_motion;
tool->arrow_keys_func = standard_arrow_keys_func; tool->modifier_key_func = standard_modifier_key_func;
tool->arrow_keys_func = standard_arrow_keys_func;
tool->modifier_key_func = standard_modifier_key_func;
tool->cursor_update_func = hue_saturation_cursor_update;
tool->control_func = hue_saturation_control;
tool->preserve = FALSE;

View File

@ -51,23 +51,25 @@ typedef Blob *(*BlobFunc) (double, double, double, double, double, double);
typedef struct _InkTool InkTool;
struct _InkTool
{
DrawCore * core; /* Core select object */
DrawCore * core; /* Core select object */
Blob * last_blob; /* blob for last cursor position */
Blob * last_blob; /* blob for last cursor position */
int x1, y1; /* image space coordinate */
int x2, y2; /* image space coords */
int x1, y1; /* image space coordinate */
int x2, y2; /* image space coords */
gdouble dt_buffer[DIST_SMOOTHER_BUFFER]; /* circular distance history buffer */
gint dt_index;
/* circular distance history buffer */
gdouble dt_buffer[DIST_SMOOTHER_BUFFER];
gint dt_index;
guint32 ts_buffer[TIME_SMOOTHER_BUFFER]; /* circular timing history buffer */
gint ts_index;
/* circular timing history buffer */
guint32 ts_buffer[TIME_SMOOTHER_BUFFER];
gint ts_index;
gdouble last_time; /* previous time of a motion event */
gdouble lastx, lasty; /* previous position of a motion event */
gdouble last_time; /* previous time of a motion event */
gdouble lastx, lasty; /* previous position of a motion event */
gboolean init_velocity;
gboolean init_velocity;
};
typedef struct _BrushWidget BrushWidget;
@ -133,11 +135,11 @@ static TempBuf * canvas_buf = NULL;
/* local function prototypes */
static void ink_button_press (Tool *, GdkEventButton *, gpointer);
static void ink_button_release (Tool *, GdkEventButton *, gpointer);
static void ink_motion (Tool *, GdkEventMotion *, gpointer);
static void ink_cursor_update (Tool *, GdkEventMotion *, gpointer);
static void ink_control (Tool *, int, gpointer);
static void ink_button_press (Tool *, GdkEventButton *, gpointer);
static void ink_button_release (Tool *, GdkEventButton *, gpointer);
static void ink_motion (Tool *, GdkEventMotion *, gpointer);
static void ink_cursor_update (Tool *, GdkEventMotion *, gpointer);
static void ink_control (Tool *, ToolAction, gpointer);
static void time_smoother_add (InkTool* ink_tool, guint32 value);
static gdouble time_smoother_result (InkTool* ink_tool);
@ -164,7 +166,7 @@ static void paint_blob (GdkDrawable *drawable,
GdkGC *gc,
Blob *blob);
/* Rendering functions */
/* Rendering functions */
static void ink_set_paint_area (InkTool *ink_tool,
GimpDrawable *drawable,
Blob *blob);
@ -186,7 +188,7 @@ static void ink_set_canvas_tiles(int x,
int w,
int h);
/* Brush pseudo-widget callbacks */
/* Brush pseudo-widget callbacks */
static void brush_widget_active_rect (BrushWidget *brush_widget,
GtkWidget *w,
GdkRectangle *rect);
@ -1067,9 +1069,9 @@ ink_cursor_update (Tool *tool,
}
static void
ink_control (Tool *tool,
int action,
gpointer gdisp_ptr)
ink_control (Tool *tool,
ToolAction action,
gpointer gdisp_ptr)
{
GDisplay *gdisp;
GimpDrawable *drawable;
@ -1081,15 +1083,20 @@ ink_control (Tool *tool,
switch (action)
{
case PAUSE :
case PAUSE:
draw_core_pause (ink_tool->core, tool);
break;
case RESUME :
case RESUME:
draw_core_resume (ink_tool->core, tool);
break;
case HALT :
case HALT:
ink_cleanup ();
break;
default:
break;
}
}
@ -1562,7 +1569,8 @@ tools_new_ink (void)
tool->button_press_func = ink_button_press;
tool->button_release_func = ink_button_release;
tool->motion_func = ink_motion;
tool->arrow_keys_func = standard_arrow_keys_func; tool->modifier_key_func = standard_modifier_key_func;
tool->arrow_keys_func = standard_arrow_keys_func;
tool->modifier_key_func = standard_modifier_key_func;
tool->cursor_update_func = ink_cursor_update;
tool->control_func = ink_control;

View File

@ -51,8 +51,8 @@
/* the intelligent scissors structures */
typedef struct _kink Kink;
struct _kink
typedef struct _Kink Kink;
struct _Kink
{
int x, y; /* coordinates */
int is_a_kink; /* is this a kink? */
@ -60,8 +60,8 @@ struct _kink
double kinkiness; /* kinkiness measure */
};
typedef struct _point Point;
struct _point
typedef struct _Point Point;
struct _Point
{
int x, y; /* coordinates */
int dir; /* direction */
@ -71,8 +71,8 @@ struct _point
double normal[2]; /* normal vector to kink */
};
typedef struct _iscissors Iscissors;
struct _iscissors
typedef struct _Iscissors Iscissors;
struct _Iscissors
{
DrawCore * core; /* Core select object */
int x, y; /* upper left hand coordinate */
@ -199,7 +199,7 @@ static void selection_to_bezier (GtkWidget* , gpointer);
static void iscissors_button_press (Tool *, GdkEventButton *, gpointer);
static void iscissors_button_release (Tool *, GdkEventButton *, gpointer);
static void iscissors_motion (Tool *, GdkEventMotion *, gpointer);
static void iscissors_control (Tool *, int, gpointer);
static void iscissors_control (Tool *, ToolAction, gpointer);
static void iscissors_reset (Iscissors *);
static void iscissors_draw (Tool *);
static void iscissors_draw_CR (GDisplay *, Iscissors *,
@ -436,7 +436,8 @@ tools_new_iscissors ()
tool->button_press_func = iscissors_button_press;
tool->button_release_func = iscissors_button_release;
tool->motion_func = iscissors_motion;
tool->arrow_keys_func = standard_arrow_keys_func; tool->modifier_key_func = standard_modifier_key_func;
tool->arrow_keys_func = standard_arrow_keys_func;
tool->modifier_key_func = standard_modifier_key_func;
tool->cursor_update_func = rect_select_cursor_update;
tool->control_func = iscissors_control;
tool->auto_snap_to = 0;
@ -865,9 +866,9 @@ iscissors_draw_CR (GDisplay *gdisp,
}
static void
iscissors_control (Tool *tool,
int action,
gpointer gdisp_ptr)
iscissors_control (Tool *tool,
ToolAction action,
gpointer gdisp_ptr)
{
Iscissors * iscissors;
@ -875,16 +876,21 @@ iscissors_control (Tool *tool,
switch (action)
{
case PAUSE :
case PAUSE:
draw_core_pause (iscissors->core, tool);
break;
case RESUME :
case RESUME:
draw_core_resume (iscissors->core, tool);
break;
case HALT :
case HALT:
draw_core_stop (iscissors->core, tool);
iscissors_reset (iscissors);
break;
default:
break;
}
}

View File

@ -121,7 +121,7 @@ static void levels_button_press (Tool *, GdkEventButton *, gpointer);
static void levels_button_release (Tool *, GdkEventButton *, gpointer);
static void levels_motion (Tool *, GdkEventMotion *, gpointer);
static void levels_cursor_update (Tool *, GdkEventMotion *, gpointer);
static void levels_control (Tool *, int, gpointer);
static void levels_control (Tool *, ToolAction, gpointer);
static LevelsDialog * levels_new_dialog (void);
static void levels_calculate_transfers (LevelsDialog *);
@ -200,9 +200,9 @@ levels_cursor_update (Tool *tool,
}
static void
levels_control (Tool *tool,
int action,
gpointer gdisp_ptr)
levels_control (Tool *tool,
ToolAction action,
gpointer gdisp_ptr)
{
Levels * _levels;
@ -210,11 +210,13 @@ levels_control (Tool *tool,
switch (action)
{
case PAUSE :
case PAUSE:
break;
case RESUME :
case RESUME:
break;
case HALT :
case HALT:
if (levels_dialog)
{
active_tool->preserve = TRUE;
@ -224,6 +226,9 @@ levels_control (Tool *tool,
levels_cancel_callback (NULL, (gpointer) levels_dialog);
}
break;
default:
break;
}
}
@ -252,7 +257,8 @@ tools_new_levels ()
tool->button_press_func = levels_button_press;
tool->button_release_func = levels_button_release;
tool->motion_func = levels_motion;
tool->arrow_keys_func = standard_arrow_keys_func; tool->modifier_key_func = standard_modifier_key_func;
tool->arrow_keys_func = standard_arrow_keys_func;
tool->modifier_key_func = standard_modifier_key_func;
tool->cursor_update_func = levels_cursor_update;
tool->control_func = levels_control;
tool->preserve = FALSE;
@ -1313,5 +1319,3 @@ levels_output_da_events (GtkWidget *widget,
return FALSE;
}

View File

@ -28,13 +28,13 @@
#include "libgimp/gimpintl.h"
/* types of magnify operations */
#define ZOOMIN 0
#define ZOOMOUT 1
#define ZOOMIN 0
#define ZOOMOUT 1
/* the magnify structures */
typedef struct _magnify Magnify;
struct _magnify
typedef struct _Magnify Magnify;
struct _Magnify
{
DrawCore * core; /* Core select object */
@ -59,16 +59,16 @@ struct _MagnifyOptions
static MagnifyOptions *magnify_options = NULL;
/* magnify utility functions */
static void zoom_in (int *, int *, int);
static void zoom_out (int *, int *, int);
/* magnify action functions */
static void magnify_button_press (Tool *, GdkEventButton *, gpointer);
static void magnify_button_release (Tool *, GdkEventButton *, gpointer);
static void magnify_motion (Tool *, GdkEventMotion *, gpointer);
static void magnify_cursor_update (Tool *, GdkEventMotion *, gpointer);
static void magnify_control (Tool *, int, gpointer);
static void magnify_control (Tool *, ToolAction, gpointer);
/* magnify utility functions */
static void zoom_in (int *, int *, int);
static void zoom_out (int *, int *, int);
/* magnify tool options functions */
@ -92,7 +92,7 @@ magnify_options_new (void)
/* the new magnify tool options structure */
options = (MagnifyOptions *) g_malloc (sizeof (MagnifyOptions));
tool_options_init ((ToolOptions *) options,
N_("Magnify Options"),
_("Magnify Options"),
magnify_options_reset);
options->allow_resize_d = allow_resize_windows;
@ -318,9 +318,9 @@ magnify_draw (Tool *tool)
static void
magnify_control (Tool *tool,
int action,
gpointer gdisp_ptr)
magnify_control (Tool *tool,
ToolAction action,
gpointer gdisp_ptr)
{
Magnify * magnify;
@ -328,15 +328,20 @@ magnify_control (Tool *tool,
switch (action)
{
case PAUSE :
case PAUSE:
draw_core_pause (magnify->core, tool);
break;
case RESUME :
case RESUME:
draw_core_resume (magnify->core, tool);
break;
case HALT :
case HALT:
draw_core_stop (magnify->core, tool);
break;
default:
break;
}
}
@ -370,7 +375,8 @@ tools_new_magnify (void)
tool->button_press_func = magnify_button_press;
tool->button_release_func = magnify_button_release;
tool->motion_func = magnify_motion;
tool->arrow_keys_func = standard_arrow_keys_func; tool->modifier_key_func = standard_modifier_key_func;
tool->arrow_keys_func = standard_arrow_keys_func;
tool->modifier_key_func = standard_modifier_key_func;
tool->cursor_update_func = magnify_cursor_update;
tool->control_func = magnify_control;

View File

@ -53,12 +53,13 @@ static GSList *last_opened_raw_filenames = NULL;
static GtkItemFactoryEntry toolbox_entries[] =
{
{ N_("/File/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/File/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/File/New"), "<control>N", file_new_cmd_callback, 0 },
{ N_("/File/Open"), "<control>O", file_open_cmd_callback, 0 },
{ N_("/File/About..."), NULL, about_dialog_cmd_callback, 0 },
{ N_("/File/Preferences..."), NULL, file_pref_cmd_callback, 0 },
{ N_("/File/Tip of the day"), NULL, tips_dialog_cmd_callback, 0 },
{ N_("/File/Dialogs/Brushes..."), "<control><shift>B", dialogs_brushes_cmd_callback, 0 },
{ N_("/File/Dialogs/Patterns..."), "<control><shift>P", dialogs_patterns_cmd_callback, 0 },
{ N_("/File/Dialogs/Palette..."), "<control>P", dialogs_palette_cmd_callback, 0 },
@ -69,7 +70,8 @@ static GtkItemFactoryEntry toolbox_entries[] =
{ N_("/File/Dialogs/Device Status..."), NULL, dialogs_device_status_cmd_callback, 0 },
{ N_("/File/Dialogs/Document Index..."), NULL, raise_idea_callback, 0 },
{ N_("/File/Dialogs/Error Console..."), NULL, dialogs_error_console_cmd_callback, 0 },
{ N_("/Xtns/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Xtns/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Xtns/Module Browser"), NULL, dialogs_module_browser_cmd_callback, 0 },
{ N_("/File/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/File/---"), NULL, NULL, 0, "<Separator>" }
@ -82,8 +84,8 @@ static GtkItemFactoryEntry toolbox_end = { N_("/File/Quit"), "<control>Q", file_
static GtkItemFactoryEntry image_entries[] =
{
{ N_("/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/File/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/File/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/File/New"), "<control>N", file_new_cmd_callback, 1 },
{ N_("/File/Open"), "<control>O", file_open_cmd_callback, 0 },
{ N_("/File/Save"), "<control>S", file_save_cmd_callback, 0 },
@ -91,12 +93,12 @@ static GtkItemFactoryEntry image_entries[] =
{ N_("/File/Revert"), NULL, file_revert_cmd_callback, 0 },
{ N_("/File/Preferences..."), NULL, file_pref_cmd_callback, 0 },
{ N_("/File/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/File/Close"), "<control>W", file_close_cmd_callback, 0 },
{ N_("/File/Quit"), "<control>Q", file_quit_cmd_callback, 0 },
{ N_("/File/---moved"), NULL, NULL, 0, "<Separator>" },
{ N_("/Edit/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Edit/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Edit/Cut"), "<control>X", edit_cut_cmd_callback, 0 },
{ N_("/Edit/Copy"), "<control>C", edit_copy_cmd_callback, 0 },
{ N_("/Edit/Paste"), "<control>V", edit_paste_cmd_callback, 0 },
@ -112,8 +114,7 @@ static GtkItemFactoryEntry image_entries[] =
{ N_("/Edit/Paste Named"), "<control><shift>V", edit_named_paste_cmd_callback, 0 },
{ N_("/Edit/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/Select/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Select/Toggle"), "<control>T", select_toggle_cmd_callback, 0 },
{ N_("/Select/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Select/Invert"), "<control>I", select_invert_cmd_callback, 0 },
{ N_("/Select/All"), "<control>A", select_all_cmd_callback, 0 },
{ N_("/Select/None"), "<control><shift>A", select_none_cmd_callback, 0 },
@ -125,7 +126,7 @@ static GtkItemFactoryEntry image_entries[] =
{ N_("/Select/Shrink"), NULL, select_shrink_cmd_callback, 0 },
{ N_("/Select/Save To Channel"), NULL, select_save_cmd_callback, 0 },
{ N_("/View/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/View/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/View/Zoom In"), "equal", view_zoomin_cmd_callback, 0 },
{ N_("/View/Zoom Out"), "minus", view_zoomout_cmd_callback, 0 },
{ N_("/View/Zoom/16:1"), NULL, view_zoom_16_1_callback, 0 },
@ -139,24 +140,28 @@ static GtkItemFactoryEntry image_entries[] =
{ N_("/View/Zoom/1:16"), NULL, view_zoom_1_16_callback, 0 },
{ N_("/View/Dot for dot"), NULL, view_dot_for_dot_callback, 0, "<ToggleItem>"},
{ N_("/View/Window Info..."), "<control><shift>I", view_window_info_cmd_callback, 0 },
{ N_("/View/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/View/Toggle Selection"), "<control>T", view_toggle_selection_cmd_callback, 0 },
{ N_("/View/Toggle Rulers"), "<control><shift>R", view_toggle_rulers_cmd_callback, 0, "<ToggleItem>" },
{ N_("/View/Toggle Statusbar"), "<control><shift>S", view_toggle_statusbar_cmd_callback, 0, "<ToggleItem>" },
{ N_("/View/Toggle Guides"), "<control><shift>T", view_toggle_guides_cmd_callback, 0, "<ToggleItem>" },
{ N_("/View/Snap To Guides"), NULL, view_snap_to_guides_cmd_callback, 0, "<ToggleItem>" },
{ N_("/View/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/View/New View"), NULL, view_new_view_cmd_callback, 0 },
{ N_("/View/Shrink Wrap"), "<control>E", view_shrink_wrap_cmd_callback, 0 },
{ N_("/Image/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Image/Colors/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Image/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Image/Colors/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Image/Colors/Equalize"), NULL, image_equalize_cmd_callback, 0 },
{ N_("/Image/Colors/Invert"), NULL, image_invert_cmd_callback, 0 },
{ N_("/Image/Colors/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/Image/Colors/Desaturate"), NULL, image_desaturate_cmd_callback, 0 },
{ N_("/Image/Channel Ops/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Image/Channel Ops/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Image/Channel Ops/Duplicate"), "<control>D", channel_ops_duplicate_cmd_callback, 0 },
{ N_("/Image/Channel Ops/Offset"), "<control><shift>O", channel_ops_offset_cmd_callback, 0 },
{ N_("/Image/Alpha/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Image/Alpha/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Image/Alpha/Add Alpha Channel"), NULL, layers_add_alpha_channel_cmd_callback, 0 },
{ N_("/Image/---"), NULL, NULL, 0, "<Separator>" },
@ -167,10 +172,10 @@ static GtkItemFactoryEntry image_entries[] =
{ N_("/Image/Resize"), NULL, image_resize_cmd_callback, 0 },
{ N_("/Image/Scale"), NULL, image_scale_cmd_callback, 0 },
{ N_("/Image/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/Layers/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Layers/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Layers/Layers & Channels..."), "<control>L", dialogs_lc_cmd_callback, 0 },
{ N_("/Layers/Stack/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Layers/Stack/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Layers/Stack/Previous Layer"), "Prior", layers_previous_cmd_callback, 0 },
{ N_("/Layers/Stack/Next Layer"), "Next", layers_next_cmd_callback, 0 },
{ N_("/Layers/Stack/Raise Layer"), "<shift>Prior", layers_raise_cmd_callback, 0 },
@ -186,52 +191,23 @@ static GtkItemFactoryEntry image_entries[] =
{ N_("/Layers/Add Alpha Channel"), NULL, layers_add_alpha_channel_cmd_callback, 0 },
{ N_("/Layers/---"), NULL, NULL, 0, "<Separator>" },
/* these are built on the fly */
/*
{ N_("/Tools/Ellipse Select"), "E", tools_select_cmd_callback, ELLIPSE_SELECT },
{ N_("/Tools/Free Select"), "F", tools_select_cmd_callback, FREE_SELECT },
{ N_("/Tools/Fuzzy Select"), "Z", tools_select_cmd_callback, FUZZY_SELECT },
{ N_("/Tools/Bezier Select"), "B", tools_select_cmd_callback, BEZIER_SELECT },
{ N_("/Tools/Intelligent Scissors"), "I", tools_select_cmd_callback, ISCISSORS },
{ N_("/Tools/Move"), "M", tools_select_cmd_callback, MOVE },
{ N_("/Tools/Magnify"), "<shift>M", tools_select_cmd_callback, MAGNIFY },
{ N_("/Tools/Crop"), "<shift>C", tools_select_cmd_callback, CROP },
{ N_("/Tools/Transform"), "<shift>T", tools_select_cmd_callback, ROTATE },
{ N_("/Tools/Flip"), "<shift>F", tools_select_cmd_callback, FLIP },
{ N_("/Tools/Text"), "T", tools_select_cmd_callback, TEXT },
{ N_("/Tools/Color Picker"), "O", tools_select_cmd_callback, COLOR_PICKER },
{ N_("/Tools/Bucket Fill"), "<shift>B", tools_select_cmd_callback, BUCKET_FILL },
{ N_("/Tools/Blend"), "L", tools_select_cmd_callback, BLEND },
{ N_("/Tools/Paintbrush"), "P", tools_select_cmd_callback, PAINTBRUSH },
{ N_("/Tools/Pencil"), "<shift>P", tools_select_cmd_callback, PENCIL },
{ N_("/Tools/Eraser"), "<shift>E", tools_select_cmd_callback, ERASER },
{ N_("/Tools/Airbrush"), "A", tools_select_cmd_callback, AIRBRUSH },
{ N_("/Tools/Clone"), "C", tools_select_cmd_callback, CLONE },
{ N_("/Tools/Convolve"), "V", tools_select_cmd_callback, CONVOLVE },
{ N_("/Tools/Ink"), "K", tools_select_cmd_callback, INK },
{ N_("/Tools/Default Colors"), "D", tools_default_colors_cmd_callback, 0 },
{ N_("/Tools/Toolbox"), NULL, toolbox_raise_callback, 0 },
{ N_("/Tools/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/Tools/Default Colors"), "D", tools_default_colors_cmd_callback, 0 },
{ N_("/Tools/Swap Colors"), "X", tools_swap_colors_cmd_callback, 0 },
*/
{ N_("/Tools/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Tools/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Tools/Toolbox"), NULL, toolbox_raise_callback, 0 },
{ N_("/Tools/Default Colors"), "D", tools_default_colors_cmd_callback, 0 },
{ N_("/Tools/Swap Colors"), "X", tools_swap_colors_cmd_callback, 0 },
{ N_("/Tools/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/Filters/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
/* the tool entries themselves are built on the fly */
{ N_("/Filters/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Filters/Repeat last"), "<alt>F", filters_repeat_cmd_callback, 0x0 },
{ N_("/Filters/Re-show last"), "<alt><shift>F", filters_repeat_cmd_callback, 0x1 },
{ N_("/Filters/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/Script-Fu/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Script-Fu/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Script-Fu/"), NULL, NULL, 0 },
{ N_("/Dialogs/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Dialogs/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Dialogs/Brushes..."), "<control><shift>B", dialogs_brushes_cmd_callback, 0 },
{ N_("/Dialogs/Patterns..."), "<control><shift>P", dialogs_patterns_cmd_callback, 0 },
{ N_("/Dialogs/Palette..."), "<control>P", dialogs_palette_cmd_callback, 0 },
@ -271,8 +247,8 @@ static GtkItemFactoryEntry layers_entries[] =
{ N_("/Stack/Layer to Top"), "<control>Prior", layers_dialog_raise_layer_to_top_callback, 0 },
{ N_("/Stack/Layer to Bottom"), "<control>Next", layers_dialog_lower_layer_to_bottom_callback, 0 },
{ N_("/Duplicate Layer"), "<control>C", layers_dialog_duplicate_layer_callback, 0 },
{ N_("/Delete Layer"), "<control>X", layers_dialog_delete_layer_callback, 0 },
{ N_("/Anchor Layer"), "<control>H", layers_dialog_anchor_layer_callback, 0 },
{ N_("/Delete Layer"), "<control>X", layers_dialog_delete_layer_callback, 0 },
{ "/---", NULL, NULL, 0, "<Separator>" },
{ N_("/Scale Layer"), "<control>S", layers_dialog_scale_layer_callback, 0 },
{ N_("/Resize Layer"), "<control>R", layers_dialog_resize_layer_callback, 0 },
@ -296,12 +272,13 @@ static GtkItemFactoryEntry channels_entries[] =
{ N_("/Raise Channel"), "<control>F", channels_dialog_raise_channel_callback, 0 },
{ N_("/Lower Channel"), "<control>B", channels_dialog_lower_channel_callback, 0 },
{ N_("/Duplicate Channel"), "<control>C", channels_dialog_duplicate_channel_callback, 0 },
{ N_("/Delete Channel"), "<control>X", channels_dialog_delete_channel_callback, 0 },
{ "/---", NULL, NULL, 0, "<Separator>" },
{ N_("/Channel to Selection"), "<control>S", channels_dialog_channel_to_sel_callback, 0 },
{ N_("/Add to Selection"), NULL, channels_dialog_add_channel_to_sel_callback, 0 },
{ N_("/Subtract From Selection"), NULL, channels_dialog_sub_channel_from_sel_callback, 0 },
{ N_("/Intersect With Selection"), NULL, channels_dialog_sub_channel_from_sel_callback, 0 }
{ N_("/Intersect With Selection"), NULL, channels_dialog_sub_channel_from_sel_callback, 0 },
{ "/---", NULL, NULL, 0, "<Separator>" },
{ N_("/Delete Channel"), "<control>X", channels_dialog_delete_channel_callback, 0 }
};
static guint n_channels_entries = sizeof (channels_entries) / sizeof (channels_entries[0]);
static GtkItemFactory *channels_factory = NULL;
@ -310,9 +287,9 @@ static GtkItemFactoryEntry paths_entries[] =
{
{ N_("/New Path"), "<control>N", paths_dialog_new_path_callback, 0 },
{ N_("/Duplicate Path"), "<control>U", paths_dialog_dup_path_callback, 0 },
{ N_("/Delete Path"), "<control>X", paths_dialog_delete_path_callback, 0 },
{ N_("/Path to Selection"), "<control>S", paths_dialog_path_to_sel_callback, 0 },
{ N_("/Stroke Path"), "<control>T", paths_dialog_stroke_path_callback, 0 },
{ N_("/Delete Path"), "<control>X", paths_dialog_delete_path_callback, 0 },
{ "/---", NULL, NULL, 0, "<Separator>" },
{ N_("/Copy Path"), "<control>C", paths_dialog_copy_path_callback, 0 },
{ N_("/Paste Path"), "<control>V", paths_dialog_paste_path_callback, 0 },
@ -489,7 +466,7 @@ menus_tools_create (ToolInfo *tool_info)
entry.callback = tools_select_cmd_callback;
entry.callback_action = tool_info->tool_id;
entry.item_type = NULL;
gtk_item_factory_create_item (image_factory,
&entry,
(gpointer) tool_info,
@ -511,12 +488,12 @@ menus_set_sensitive (gchar *path,
if (ifactory)
{
widget = gtk_item_factory_get_widget (ifactory, path);
gtk_widget_set_sensitive (widget, sensitive);
}
if (!ifactory || !widget)
g_warning ("Unable to set sensitivity for menu which doesn't exist:\n%s", path);
}
}
/* The following function will enhance our localesystem because
we don't need to have our menuentries twice in our catalog */
@ -598,7 +575,6 @@ menus_quit (void)
gtk_object_unref (GTK_OBJECT (channels_factory));
gtk_object_unref (GTK_OBJECT (paths_factory));
}
}
void
@ -618,11 +594,11 @@ menus_last_opened_cmd_callback (GtkWidget *widget,
void
menus_last_opened_update_labels (void)
{
GSList *filename_slist;
GString *entry_filename, *path;
GtkWidget *widget;
gint i;
guint num_entries;
GSList *filename_slist;
GString *entry_filename, *path;
GtkWidget *widget;
gint i;
guint num_entries;
entry_filename = g_string_new ("");
path = g_string_new ("");
@ -651,20 +627,20 @@ menus_last_opened_update_labels (void)
void
menus_last_opened_add (gchar *filename)
{
GString *raw_filename;
GSList *item;
GtkWidget *widget;
guint num_entries;
GString *raw_filename;
GSList *item;
GtkWidget *widget;
guint num_entries;
/* ignore the add if we've already got the filename on the list */
item = last_opened_raw_filenames;
while (item)
{
{
raw_filename = item->data;
if (!strcmp (raw_filename->str, filename))
return;
return;
item = g_slist_next (item);
}
}
num_entries = g_slist_length (last_opened_raw_filenames);
@ -824,7 +800,7 @@ menus_init (void)
{
/* FIXME this need to use access functions to check a flag */
if (tool_info[i].menu_path)
menus_tools_create (tool_info+i);
menus_tools_create (tool_info + i);
}
filename = gimp_personal_rc_file ("menurc");

View File

@ -53,12 +53,13 @@ static GSList *last_opened_raw_filenames = NULL;
static GtkItemFactoryEntry toolbox_entries[] =
{
{ N_("/File/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/File/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/File/New"), "<control>N", file_new_cmd_callback, 0 },
{ N_("/File/Open"), "<control>O", file_open_cmd_callback, 0 },
{ N_("/File/About..."), NULL, about_dialog_cmd_callback, 0 },
{ N_("/File/Preferences..."), NULL, file_pref_cmd_callback, 0 },
{ N_("/File/Tip of the day"), NULL, tips_dialog_cmd_callback, 0 },
{ N_("/File/Dialogs/Brushes..."), "<control><shift>B", dialogs_brushes_cmd_callback, 0 },
{ N_("/File/Dialogs/Patterns..."), "<control><shift>P", dialogs_patterns_cmd_callback, 0 },
{ N_("/File/Dialogs/Palette..."), "<control>P", dialogs_palette_cmd_callback, 0 },
@ -69,7 +70,8 @@ static GtkItemFactoryEntry toolbox_entries[] =
{ N_("/File/Dialogs/Device Status..."), NULL, dialogs_device_status_cmd_callback, 0 },
{ N_("/File/Dialogs/Document Index..."), NULL, raise_idea_callback, 0 },
{ N_("/File/Dialogs/Error Console..."), NULL, dialogs_error_console_cmd_callback, 0 },
{ N_("/Xtns/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Xtns/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Xtns/Module Browser"), NULL, dialogs_module_browser_cmd_callback, 0 },
{ N_("/File/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/File/---"), NULL, NULL, 0, "<Separator>" }
@ -82,8 +84,8 @@ static GtkItemFactoryEntry toolbox_end = { N_("/File/Quit"), "<control>Q", file_
static GtkItemFactoryEntry image_entries[] =
{
{ N_("/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/File/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/File/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/File/New"), "<control>N", file_new_cmd_callback, 1 },
{ N_("/File/Open"), "<control>O", file_open_cmd_callback, 0 },
{ N_("/File/Save"), "<control>S", file_save_cmd_callback, 0 },
@ -91,12 +93,12 @@ static GtkItemFactoryEntry image_entries[] =
{ N_("/File/Revert"), NULL, file_revert_cmd_callback, 0 },
{ N_("/File/Preferences..."), NULL, file_pref_cmd_callback, 0 },
{ N_("/File/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/File/Close"), "<control>W", file_close_cmd_callback, 0 },
{ N_("/File/Quit"), "<control>Q", file_quit_cmd_callback, 0 },
{ N_("/File/---moved"), NULL, NULL, 0, "<Separator>" },
{ N_("/Edit/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Edit/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Edit/Cut"), "<control>X", edit_cut_cmd_callback, 0 },
{ N_("/Edit/Copy"), "<control>C", edit_copy_cmd_callback, 0 },
{ N_("/Edit/Paste"), "<control>V", edit_paste_cmd_callback, 0 },
@ -112,8 +114,7 @@ static GtkItemFactoryEntry image_entries[] =
{ N_("/Edit/Paste Named"), "<control><shift>V", edit_named_paste_cmd_callback, 0 },
{ N_("/Edit/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/Select/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Select/Toggle"), "<control>T", select_toggle_cmd_callback, 0 },
{ N_("/Select/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Select/Invert"), "<control>I", select_invert_cmd_callback, 0 },
{ N_("/Select/All"), "<control>A", select_all_cmd_callback, 0 },
{ N_("/Select/None"), "<control><shift>A", select_none_cmd_callback, 0 },
@ -125,7 +126,7 @@ static GtkItemFactoryEntry image_entries[] =
{ N_("/Select/Shrink"), NULL, select_shrink_cmd_callback, 0 },
{ N_("/Select/Save To Channel"), NULL, select_save_cmd_callback, 0 },
{ N_("/View/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/View/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/View/Zoom In"), "equal", view_zoomin_cmd_callback, 0 },
{ N_("/View/Zoom Out"), "minus", view_zoomout_cmd_callback, 0 },
{ N_("/View/Zoom/16:1"), NULL, view_zoom_16_1_callback, 0 },
@ -139,24 +140,28 @@ static GtkItemFactoryEntry image_entries[] =
{ N_("/View/Zoom/1:16"), NULL, view_zoom_1_16_callback, 0 },
{ N_("/View/Dot for dot"), NULL, view_dot_for_dot_callback, 0, "<ToggleItem>"},
{ N_("/View/Window Info..."), "<control><shift>I", view_window_info_cmd_callback, 0 },
{ N_("/View/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/View/Toggle Selection"), "<control>T", view_toggle_selection_cmd_callback, 0 },
{ N_("/View/Toggle Rulers"), "<control><shift>R", view_toggle_rulers_cmd_callback, 0, "<ToggleItem>" },
{ N_("/View/Toggle Statusbar"), "<control><shift>S", view_toggle_statusbar_cmd_callback, 0, "<ToggleItem>" },
{ N_("/View/Toggle Guides"), "<control><shift>T", view_toggle_guides_cmd_callback, 0, "<ToggleItem>" },
{ N_("/View/Snap To Guides"), NULL, view_snap_to_guides_cmd_callback, 0, "<ToggleItem>" },
{ N_("/View/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/View/New View"), NULL, view_new_view_cmd_callback, 0 },
{ N_("/View/Shrink Wrap"), "<control>E", view_shrink_wrap_cmd_callback, 0 },
{ N_("/Image/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Image/Colors/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Image/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Image/Colors/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Image/Colors/Equalize"), NULL, image_equalize_cmd_callback, 0 },
{ N_("/Image/Colors/Invert"), NULL, image_invert_cmd_callback, 0 },
{ N_("/Image/Colors/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/Image/Colors/Desaturate"), NULL, image_desaturate_cmd_callback, 0 },
{ N_("/Image/Channel Ops/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Image/Channel Ops/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Image/Channel Ops/Duplicate"), "<control>D", channel_ops_duplicate_cmd_callback, 0 },
{ N_("/Image/Channel Ops/Offset"), "<control><shift>O", channel_ops_offset_cmd_callback, 0 },
{ N_("/Image/Alpha/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Image/Alpha/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Image/Alpha/Add Alpha Channel"), NULL, layers_add_alpha_channel_cmd_callback, 0 },
{ N_("/Image/---"), NULL, NULL, 0, "<Separator>" },
@ -167,10 +172,10 @@ static GtkItemFactoryEntry image_entries[] =
{ N_("/Image/Resize"), NULL, image_resize_cmd_callback, 0 },
{ N_("/Image/Scale"), NULL, image_scale_cmd_callback, 0 },
{ N_("/Image/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/Layers/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Layers/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Layers/Layers & Channels..."), "<control>L", dialogs_lc_cmd_callback, 0 },
{ N_("/Layers/Stack/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Layers/Stack/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Layers/Stack/Previous Layer"), "Prior", layers_previous_cmd_callback, 0 },
{ N_("/Layers/Stack/Next Layer"), "Next", layers_next_cmd_callback, 0 },
{ N_("/Layers/Stack/Raise Layer"), "<shift>Prior", layers_raise_cmd_callback, 0 },
@ -186,52 +191,23 @@ static GtkItemFactoryEntry image_entries[] =
{ N_("/Layers/Add Alpha Channel"), NULL, layers_add_alpha_channel_cmd_callback, 0 },
{ N_("/Layers/---"), NULL, NULL, 0, "<Separator>" },
/* these are built on the fly */
/*
{ N_("/Tools/Ellipse Select"), "E", tools_select_cmd_callback, ELLIPSE_SELECT },
{ N_("/Tools/Free Select"), "F", tools_select_cmd_callback, FREE_SELECT },
{ N_("/Tools/Fuzzy Select"), "Z", tools_select_cmd_callback, FUZZY_SELECT },
{ N_("/Tools/Bezier Select"), "B", tools_select_cmd_callback, BEZIER_SELECT },
{ N_("/Tools/Intelligent Scissors"), "I", tools_select_cmd_callback, ISCISSORS },
{ N_("/Tools/Move"), "M", tools_select_cmd_callback, MOVE },
{ N_("/Tools/Magnify"), "<shift>M", tools_select_cmd_callback, MAGNIFY },
{ N_("/Tools/Crop"), "<shift>C", tools_select_cmd_callback, CROP },
{ N_("/Tools/Transform"), "<shift>T", tools_select_cmd_callback, ROTATE },
{ N_("/Tools/Flip"), "<shift>F", tools_select_cmd_callback, FLIP },
{ N_("/Tools/Text"), "T", tools_select_cmd_callback, TEXT },
{ N_("/Tools/Color Picker"), "O", tools_select_cmd_callback, COLOR_PICKER },
{ N_("/Tools/Bucket Fill"), "<shift>B", tools_select_cmd_callback, BUCKET_FILL },
{ N_("/Tools/Blend"), "L", tools_select_cmd_callback, BLEND },
{ N_("/Tools/Paintbrush"), "P", tools_select_cmd_callback, PAINTBRUSH },
{ N_("/Tools/Pencil"), "<shift>P", tools_select_cmd_callback, PENCIL },
{ N_("/Tools/Eraser"), "<shift>E", tools_select_cmd_callback, ERASER },
{ N_("/Tools/Airbrush"), "A", tools_select_cmd_callback, AIRBRUSH },
{ N_("/Tools/Clone"), "C", tools_select_cmd_callback, CLONE },
{ N_("/Tools/Convolve"), "V", tools_select_cmd_callback, CONVOLVE },
{ N_("/Tools/Ink"), "K", tools_select_cmd_callback, INK },
{ N_("/Tools/Default Colors"), "D", tools_default_colors_cmd_callback, 0 },
{ N_("/Tools/Toolbox"), NULL, toolbox_raise_callback, 0 },
{ N_("/Tools/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/Tools/Default Colors"), "D", tools_default_colors_cmd_callback, 0 },
{ N_("/Tools/Swap Colors"), "X", tools_swap_colors_cmd_callback, 0 },
*/
{ N_("/Tools/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Tools/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Tools/Toolbox"), NULL, toolbox_raise_callback, 0 },
{ N_("/Tools/Default Colors"), "D", tools_default_colors_cmd_callback, 0 },
{ N_("/Tools/Swap Colors"), "X", tools_swap_colors_cmd_callback, 0 },
{ N_("/Tools/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/Filters/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
/* the tool entries themselves are built on the fly */
{ N_("/Filters/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Filters/Repeat last"), "<alt>F", filters_repeat_cmd_callback, 0x0 },
{ N_("/Filters/Re-show last"), "<alt><shift>F", filters_repeat_cmd_callback, 0x1 },
{ N_("/Filters/---"), NULL, NULL, 0, "<Separator>" },
{ N_("/Script-Fu/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Script-Fu/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Script-Fu/"), NULL, NULL, 0 },
{ N_("/Dialogs/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Dialogs/tearoff1"), NULL, NULL, 0, "<Tearoff>" },
{ N_("/Dialogs/Brushes..."), "<control><shift>B", dialogs_brushes_cmd_callback, 0 },
{ N_("/Dialogs/Patterns..."), "<control><shift>P", dialogs_patterns_cmd_callback, 0 },
{ N_("/Dialogs/Palette..."), "<control>P", dialogs_palette_cmd_callback, 0 },
@ -271,8 +247,8 @@ static GtkItemFactoryEntry layers_entries[] =
{ N_("/Stack/Layer to Top"), "<control>Prior", layers_dialog_raise_layer_to_top_callback, 0 },
{ N_("/Stack/Layer to Bottom"), "<control>Next", layers_dialog_lower_layer_to_bottom_callback, 0 },
{ N_("/Duplicate Layer"), "<control>C", layers_dialog_duplicate_layer_callback, 0 },
{ N_("/Delete Layer"), "<control>X", layers_dialog_delete_layer_callback, 0 },
{ N_("/Anchor Layer"), "<control>H", layers_dialog_anchor_layer_callback, 0 },
{ N_("/Delete Layer"), "<control>X", layers_dialog_delete_layer_callback, 0 },
{ "/---", NULL, NULL, 0, "<Separator>" },
{ N_("/Scale Layer"), "<control>S", layers_dialog_scale_layer_callback, 0 },
{ N_("/Resize Layer"), "<control>R", layers_dialog_resize_layer_callback, 0 },
@ -296,12 +272,13 @@ static GtkItemFactoryEntry channels_entries[] =
{ N_("/Raise Channel"), "<control>F", channels_dialog_raise_channel_callback, 0 },
{ N_("/Lower Channel"), "<control>B", channels_dialog_lower_channel_callback, 0 },
{ N_("/Duplicate Channel"), "<control>C", channels_dialog_duplicate_channel_callback, 0 },
{ N_("/Delete Channel"), "<control>X", channels_dialog_delete_channel_callback, 0 },
{ "/---", NULL, NULL, 0, "<Separator>" },
{ N_("/Channel to Selection"), "<control>S", channels_dialog_channel_to_sel_callback, 0 },
{ N_("/Add to Selection"), NULL, channels_dialog_add_channel_to_sel_callback, 0 },
{ N_("/Subtract From Selection"), NULL, channels_dialog_sub_channel_from_sel_callback, 0 },
{ N_("/Intersect With Selection"), NULL, channels_dialog_sub_channel_from_sel_callback, 0 }
{ N_("/Intersect With Selection"), NULL, channels_dialog_sub_channel_from_sel_callback, 0 },
{ "/---", NULL, NULL, 0, "<Separator>" },
{ N_("/Delete Channel"), "<control>X", channels_dialog_delete_channel_callback, 0 }
};
static guint n_channels_entries = sizeof (channels_entries) / sizeof (channels_entries[0]);
static GtkItemFactory *channels_factory = NULL;
@ -310,9 +287,9 @@ static GtkItemFactoryEntry paths_entries[] =
{
{ N_("/New Path"), "<control>N", paths_dialog_new_path_callback, 0 },
{ N_("/Duplicate Path"), "<control>U", paths_dialog_dup_path_callback, 0 },
{ N_("/Delete Path"), "<control>X", paths_dialog_delete_path_callback, 0 },
{ N_("/Path to Selection"), "<control>S", paths_dialog_path_to_sel_callback, 0 },
{ N_("/Stroke Path"), "<control>T", paths_dialog_stroke_path_callback, 0 },
{ N_("/Delete Path"), "<control>X", paths_dialog_delete_path_callback, 0 },
{ "/---", NULL, NULL, 0, "<Separator>" },
{ N_("/Copy Path"), "<control>C", paths_dialog_copy_path_callback, 0 },
{ N_("/Paste Path"), "<control>V", paths_dialog_paste_path_callback, 0 },
@ -489,7 +466,7 @@ menus_tools_create (ToolInfo *tool_info)
entry.callback = tools_select_cmd_callback;
entry.callback_action = tool_info->tool_id;
entry.item_type = NULL;
gtk_item_factory_create_item (image_factory,
&entry,
(gpointer) tool_info,
@ -511,12 +488,12 @@ menus_set_sensitive (gchar *path,
if (ifactory)
{
widget = gtk_item_factory_get_widget (ifactory, path);
gtk_widget_set_sensitive (widget, sensitive);
}
if (!ifactory || !widget)
g_warning ("Unable to set sensitivity for menu which doesn't exist:\n%s", path);
}
}
/* The following function will enhance our localesystem because
we don't need to have our menuentries twice in our catalog */
@ -598,7 +575,6 @@ menus_quit (void)
gtk_object_unref (GTK_OBJECT (channels_factory));
gtk_object_unref (GTK_OBJECT (paths_factory));
}
}
void
@ -618,11 +594,11 @@ menus_last_opened_cmd_callback (GtkWidget *widget,
void
menus_last_opened_update_labels (void)
{
GSList *filename_slist;
GString *entry_filename, *path;
GtkWidget *widget;
gint i;
guint num_entries;
GSList *filename_slist;
GString *entry_filename, *path;
GtkWidget *widget;
gint i;
guint num_entries;
entry_filename = g_string_new ("");
path = g_string_new ("");
@ -651,20 +627,20 @@ menus_last_opened_update_labels (void)
void
menus_last_opened_add (gchar *filename)
{
GString *raw_filename;
GSList *item;
GtkWidget *widget;
guint num_entries;
GString *raw_filename;
GSList *item;
GtkWidget *widget;
guint num_entries;
/* ignore the add if we've already got the filename on the list */
item = last_opened_raw_filenames;
while (item)
{
{
raw_filename = item->data;
if (!strcmp (raw_filename->str, filename))
return;
return;
item = g_slist_next (item);
}
}
num_entries = g_slist_length (last_opened_raw_filenames);
@ -824,7 +800,7 @@ menus_init (void)
{
/* FIXME this need to use access functions to check a flag */
if (tool_info[i].menu_path)
menus_tools_create (tool_info+i);
menus_tools_create (tool_info + i);
}
filename = gimp_personal_rc_file ("menurc");

View File

@ -1218,6 +1218,7 @@ plug_in_repeat (int with_interface)
if (last_plug_in)
{
gdisplay = gdisplay_active ();
if (!gdisplay) return;
/* construct the procedures arguments */
args = g_new (Argument, 3);
@ -2286,6 +2287,7 @@ plug_in_callback (GtkWidget *widget,
/* get the active gdisplay */
gdisplay = gdisplay_active ();
if (!gdisplay) return;
proc_rec = (ProcRecord*) client_data;

View File

@ -48,12 +48,12 @@ static GdkGC *move_gc = NULL;
/* move tool action functions */
static void move_tool_button_press (Tool *, GdkEventButton *, gpointer);
static void move_tool_button_release (Tool *, GdkEventButton *, gpointer);
static void move_tool_motion (Tool *, GdkEventMotion *, gpointer);
static void move_tool_cursor_update (Tool *, GdkEventMotion *, gpointer);
static void move_tool_control (Tool *, int, gpointer);
static void move_tool_control (Tool *, ToolAction, gpointer);
static void move_create_gc (GDisplay *);
@ -347,9 +347,9 @@ move_tool_cursor_update (Tool *tool,
static void
move_tool_control (Tool *tool,
int action,
gpointer gdisp_ptr)
move_tool_control (Tool *tool,
ToolAction action,
gpointer gdisp_ptr)
{
MoveTool *move;
@ -357,13 +357,18 @@ move_tool_control (Tool *tool,
switch (action)
{
case PAUSE :
case PAUSE:
break;
case RESUME :
case RESUME:
if (move->guide)
gdisplay_draw_guide (gdisp_ptr, move->guide, TRUE);
break;
case HALT :
case HALT:
break;
default:
break;
}
}

View File

@ -82,12 +82,15 @@ static CloneType non_gui_type;
/* forward function declarations */
static void clone_draw (Tool *);
static void clone_motion (PaintCore *, GimpDrawable *, GimpDrawable *, CloneType, int, int);
static void clone_line_image (GImage *, GImage *, GimpDrawable *, GimpDrawable *, unsigned char *,
unsigned char *, int, int, int, int);
static void clone_line_pattern (GImage *, GimpDrawable *, GPatternP, unsigned char *,
int, int, int, int);
static void clone_draw (Tool *);
static void clone_motion (PaintCore *, GimpDrawable *, GimpDrawable *,
CloneType, int, int);
static void clone_line_image (GImage *, GImage *, GimpDrawable *,
GimpDrawable *, unsigned char *,
unsigned char *, int, int, int, int);
static void clone_line_pattern (GImage *, GimpDrawable *, GPatternP,
unsigned char *, int, int, int, int);
/* functions */
@ -127,19 +130,22 @@ clone_options_new (void)
GtkWidget *radio_frame;
GtkWidget *radio_box;
GtkWidget *radio_button;
int i;
int i;
char *button_names[2] =
static gchar *source_names[] =
{
N_("Image Source"),
N_("Pattern Source")
};
char *align_names[3] =
static gint n_source_names = sizeof (source_names) / sizeof (source_names[0]);
static gchar *align_names[] =
{
N_("Non Aligned"),
N_("Aligned"),
N_("Registered")
};
static gint n_align_names = sizeof (align_names) / sizeof (align_names[0]);
/* the new clone tool options structure */
options = (CloneOptions *) g_malloc (sizeof (CloneOptions));
@ -161,10 +167,10 @@ clone_options_new (void)
gtk_container_add (GTK_CONTAINER (radio_frame), radio_box);
/* the radio buttons */
for (i = 0; i < 2; i++)
for (i = 0; i < n_source_names; i++)
{
radio_button = gtk_radio_button_new_with_label (group,
gettext(button_names[i]));
gettext(source_names[i]));
group = gtk_radio_button_group (GTK_RADIO_BUTTON (radio_button));
gtk_signal_connect (GTK_OBJECT (radio_button), "toggled",
(GtkSignalFunc) clone_type_callback,
@ -187,7 +193,7 @@ clone_options_new (void)
/* the radio buttons */
group = NULL;
for (i = 0; i < 3; i++)
for (i = 0; i < n_align_names; i++)
{
radio_button = gtk_radio_button_new_with_label (group, align_names[i]);
group = gtk_radio_button_group (GTK_RADIO_BUTTON (radio_button));
@ -206,14 +212,14 @@ clone_options_new (void)
}
static void
clone_src_drawable_destroyed_cb(GimpDrawable *drawable,
GimpDrawable **src_drawable)
clone_src_drawable_destroyed_cb (GimpDrawable *drawable,
GimpDrawable **src_drawable)
{
if (drawable == *src_drawable)
{
*src_drawable = NULL;
the_src_gdisp = NULL;
}
{
*src_drawable = NULL;
the_src_gdisp = NULL;
}
}
static void
@ -235,9 +241,9 @@ clone_set_src_drawable(GimpDrawable *drawable)
void *
clone_paint_func (PaintCore *paint_core,
clone_paint_func (PaintCore *paint_core,
GimpDrawable *drawable,
int state)
int state)
{
GDisplay * gdisp;
GDisplay * src_gdisp;
@ -345,10 +351,9 @@ clone_paint_func (PaintCore *paint_core,
}
void
clone_cursor_update (tool, mevent, gdisp_ptr)
Tool *tool;
GdkEventMotion *mevent;
gpointer gdisp_ptr;
clone_cursor_update (Tool *tool,
GdkEventMotion *mevent,
gpointer gdisp_ptr)
{
GDisplay *gdisp;
Layer *layer;
@ -435,12 +440,12 @@ clone_draw (Tool *tool)
}
static void
clone_motion (PaintCore *paint_core,
clone_motion (PaintCore *paint_core,
GimpDrawable *drawable,
GimpDrawable *src_drawable,
CloneType type,
int offset_x,
int offset_y)
CloneType type,
int offset_x,
int offset_y)
{
GImage *gimage;
GImage *src_gimage = NULL;

View File

@ -51,23 +51,25 @@ typedef Blob *(*BlobFunc) (double, double, double, double, double, double);
typedef struct _InkTool InkTool;
struct _InkTool
{
DrawCore * core; /* Core select object */
DrawCore * core; /* Core select object */
Blob * last_blob; /* blob for last cursor position */
Blob * last_blob; /* blob for last cursor position */
int x1, y1; /* image space coordinate */
int x2, y2; /* image space coords */
int x1, y1; /* image space coordinate */
int x2, y2; /* image space coords */
gdouble dt_buffer[DIST_SMOOTHER_BUFFER]; /* circular distance history buffer */
gint dt_index;
/* circular distance history buffer */
gdouble dt_buffer[DIST_SMOOTHER_BUFFER];
gint dt_index;
guint32 ts_buffer[TIME_SMOOTHER_BUFFER]; /* circular timing history buffer */
gint ts_index;
/* circular timing history buffer */
guint32 ts_buffer[TIME_SMOOTHER_BUFFER];
gint ts_index;
gdouble last_time; /* previous time of a motion event */
gdouble lastx, lasty; /* previous position of a motion event */
gdouble last_time; /* previous time of a motion event */
gdouble lastx, lasty; /* previous position of a motion event */
gboolean init_velocity;
gboolean init_velocity;
};
typedef struct _BrushWidget BrushWidget;
@ -133,11 +135,11 @@ static TempBuf * canvas_buf = NULL;
/* local function prototypes */
static void ink_button_press (Tool *, GdkEventButton *, gpointer);
static void ink_button_release (Tool *, GdkEventButton *, gpointer);
static void ink_motion (Tool *, GdkEventMotion *, gpointer);
static void ink_cursor_update (Tool *, GdkEventMotion *, gpointer);
static void ink_control (Tool *, int, gpointer);
static void ink_button_press (Tool *, GdkEventButton *, gpointer);
static void ink_button_release (Tool *, GdkEventButton *, gpointer);
static void ink_motion (Tool *, GdkEventMotion *, gpointer);
static void ink_cursor_update (Tool *, GdkEventMotion *, gpointer);
static void ink_control (Tool *, ToolAction, gpointer);
static void time_smoother_add (InkTool* ink_tool, guint32 value);
static gdouble time_smoother_result (InkTool* ink_tool);
@ -164,7 +166,7 @@ static void paint_blob (GdkDrawable *drawable,
GdkGC *gc,
Blob *blob);
/* Rendering functions */
/* Rendering functions */
static void ink_set_paint_area (InkTool *ink_tool,
GimpDrawable *drawable,
Blob *blob);
@ -186,7 +188,7 @@ static void ink_set_canvas_tiles(int x,
int w,
int h);
/* Brush pseudo-widget callbacks */
/* Brush pseudo-widget callbacks */
static void brush_widget_active_rect (BrushWidget *brush_widget,
GtkWidget *w,
GdkRectangle *rect);
@ -1067,9 +1069,9 @@ ink_cursor_update (Tool *tool,
}
static void
ink_control (Tool *tool,
int action,
gpointer gdisp_ptr)
ink_control (Tool *tool,
ToolAction action,
gpointer gdisp_ptr)
{
GDisplay *gdisp;
GimpDrawable *drawable;
@ -1081,15 +1083,20 @@ ink_control (Tool *tool,
switch (action)
{
case PAUSE :
case PAUSE:
draw_core_pause (ink_tool->core, tool);
break;
case RESUME :
case RESUME:
draw_core_resume (ink_tool->core, tool);
break;
case HALT :
case HALT:
ink_cleanup ();
break;
default:
break;
}
}
@ -1562,7 +1569,8 @@ tools_new_ink (void)
tool->button_press_func = ink_button_press;
tool->button_release_func = ink_button_release;
tool->motion_func = ink_motion;
tool->arrow_keys_func = standard_arrow_keys_func; tool->modifier_key_func = standard_modifier_key_func;
tool->arrow_keys_func = standard_arrow_keys_func;
tool->modifier_key_func = standard_modifier_key_func;
tool->cursor_update_func = ink_cursor_update;
tool->control_func = ink_control;

View File

@ -82,12 +82,15 @@ static CloneType non_gui_type;
/* forward function declarations */
static void clone_draw (Tool *);
static void clone_motion (PaintCore *, GimpDrawable *, GimpDrawable *, CloneType, int, int);
static void clone_line_image (GImage *, GImage *, GimpDrawable *, GimpDrawable *, unsigned char *,
unsigned char *, int, int, int, int);
static void clone_line_pattern (GImage *, GimpDrawable *, GPatternP, unsigned char *,
int, int, int, int);
static void clone_draw (Tool *);
static void clone_motion (PaintCore *, GimpDrawable *, GimpDrawable *,
CloneType, int, int);
static void clone_line_image (GImage *, GImage *, GimpDrawable *,
GimpDrawable *, unsigned char *,
unsigned char *, int, int, int, int);
static void clone_line_pattern (GImage *, GimpDrawable *, GPatternP,
unsigned char *, int, int, int, int);
/* functions */
@ -127,19 +130,22 @@ clone_options_new (void)
GtkWidget *radio_frame;
GtkWidget *radio_box;
GtkWidget *radio_button;
int i;
int i;
char *button_names[2] =
static gchar *source_names[] =
{
N_("Image Source"),
N_("Pattern Source")
};
char *align_names[3] =
static gint n_source_names = sizeof (source_names) / sizeof (source_names[0]);
static gchar *align_names[] =
{
N_("Non Aligned"),
N_("Aligned"),
N_("Registered")
};
static gint n_align_names = sizeof (align_names) / sizeof (align_names[0]);
/* the new clone tool options structure */
options = (CloneOptions *) g_malloc (sizeof (CloneOptions));
@ -161,10 +167,10 @@ clone_options_new (void)
gtk_container_add (GTK_CONTAINER (radio_frame), radio_box);
/* the radio buttons */
for (i = 0; i < 2; i++)
for (i = 0; i < n_source_names; i++)
{
radio_button = gtk_radio_button_new_with_label (group,
gettext(button_names[i]));
gettext(source_names[i]));
group = gtk_radio_button_group (GTK_RADIO_BUTTON (radio_button));
gtk_signal_connect (GTK_OBJECT (radio_button), "toggled",
(GtkSignalFunc) clone_type_callback,
@ -187,7 +193,7 @@ clone_options_new (void)
/* the radio buttons */
group = NULL;
for (i = 0; i < 3; i++)
for (i = 0; i < n_align_names; i++)
{
radio_button = gtk_radio_button_new_with_label (group, align_names[i]);
group = gtk_radio_button_group (GTK_RADIO_BUTTON (radio_button));
@ -206,14 +212,14 @@ clone_options_new (void)
}
static void
clone_src_drawable_destroyed_cb(GimpDrawable *drawable,
GimpDrawable **src_drawable)
clone_src_drawable_destroyed_cb (GimpDrawable *drawable,
GimpDrawable **src_drawable)
{
if (drawable == *src_drawable)
{
*src_drawable = NULL;
the_src_gdisp = NULL;
}
{
*src_drawable = NULL;
the_src_gdisp = NULL;
}
}
static void
@ -235,9 +241,9 @@ clone_set_src_drawable(GimpDrawable *drawable)
void *
clone_paint_func (PaintCore *paint_core,
clone_paint_func (PaintCore *paint_core,
GimpDrawable *drawable,
int state)
int state)
{
GDisplay * gdisp;
GDisplay * src_gdisp;
@ -345,10 +351,9 @@ clone_paint_func (PaintCore *paint_core,
}
void
clone_cursor_update (tool, mevent, gdisp_ptr)
Tool *tool;
GdkEventMotion *mevent;
gpointer gdisp_ptr;
clone_cursor_update (Tool *tool,
GdkEventMotion *mevent,
gpointer gdisp_ptr)
{
GDisplay *gdisp;
Layer *layer;
@ -435,12 +440,12 @@ clone_draw (Tool *tool)
}
static void
clone_motion (PaintCore *paint_core,
clone_motion (PaintCore *paint_core,
GimpDrawable *drawable,
GimpDrawable *src_drawable,
CloneType type,
int offset_x,
int offset_y)
CloneType type,
int offset_x,
int offset_y)
{
GImage *gimage;
GImage *src_gimage = NULL;

View File

@ -40,8 +40,8 @@
#include "tile.h" /* ick. */
/* target size */
#define TARGET_HEIGHT 15
#define TARGET_WIDTH 15
#define TARGET_HEIGHT 15
#define TARGET_WIDTH 15
#define SQR(x) ((x) * (x))
#define EPSILON 0.00001
@ -51,16 +51,18 @@ PaintCore non_gui_paint_core;
/* local function prototypes */
static MaskBuf * paint_core_subsample_mask (MaskBuf *, double, double);
static MaskBuf * paint_core_pressurize_mask (MaskBuf *, double, double, double);
static MaskBuf * paint_core_pressurize_mask (MaskBuf *, double, double, double);
static MaskBuf * paint_core_solidify_mask (MaskBuf *);
static MaskBuf * paint_core_get_brush_mask (PaintCore *, int);
static void paint_core_paste (PaintCore *, MaskBuf *, GimpDrawable *, int, int, int, int);
static void paint_core_replace (PaintCore *, MaskBuf *, GimpDrawable *, int, int, int);
static void paint_core_paste (PaintCore *, MaskBuf *,
GimpDrawable *, int, int, int, int);
static void paint_core_replace (PaintCore *, MaskBuf *,
GimpDrawable *, int, int, int);
static void paint_to_canvas_tiles (PaintCore *, MaskBuf *, int);
static void paint_to_canvas_buf (PaintCore *, MaskBuf *, int);
static void set_undo_tiles (GimpDrawable *, int, int, int, int);
static void set_canvas_tiles (int, int, int, int);
static int paint_core_invalidate_cache(GimpBrush *brush, gpointer *blah);
static int paint_core_invalidate_cache (GimpBrush *brush, gpointer *blah);
/***********************************************************************/
@ -434,9 +436,9 @@ paint_core_cursor_update (Tool *tool,
}
void
paint_core_control (Tool *tool,
int action,
gpointer gdisp_ptr)
paint_core_control (Tool *tool,
ToolAction action,
gpointer gdisp_ptr)
{
PaintCore * paint_core;
GDisplay *gdisp;
@ -448,19 +450,23 @@ paint_core_control (Tool *tool,
switch (action)
{
case PAUSE :
case PAUSE:
break;
case RESUME :
case RESUME:
break;
case HALT :
case HALT:
(* paint_core->paint_func) (paint_core, drawable, FINISH_PAINT);
draw_core_stop (paint_core->core, tool);
paint_core_cleanup ();
break;
default:
break;
}
}
void
paint_core_draw (Tool *tool)
{
@ -1522,6 +1528,3 @@ free_paint_buffers ()
temp_buf_free (canvas_buf);
canvas_buf = NULL;
}

View File

@ -110,11 +110,11 @@ struct _paint_undo
};
/* paint tool action functions */
void paint_core_button_press (Tool *, GdkEventButton *, gpointer);
void paint_core_button_release (Tool *, GdkEventButton *, gpointer);
void paint_core_motion (Tool *, GdkEventMotion *, gpointer);
void paint_core_cursor_update (Tool *, GdkEventMotion *, gpointer);
void paint_core_control (Tool *, int, gpointer);
void paint_core_button_press (Tool *, GdkEventButton *, gpointer);
void paint_core_button_release (Tool *, GdkEventButton *, gpointer);
void paint_core_motion (Tool *, GdkEventMotion *, gpointer);
void paint_core_cursor_update (Tool *, GdkEventMotion *, gpointer);
void paint_core_control (Tool *, ToolAction, gpointer);
/* paint tool functions */
void paint_core_no_draw (Tool *);

View File

@ -66,17 +66,18 @@ struct _PaintbrushOptions
};
/* the paint brush tool options */
static PaintbrushOptions *paintbrush_options = NULL;
static PaintbrushOptions * paintbrush_options = NULL;
/* local variables */
static double non_gui_fade_out;
static double non_gui_gradient_length;
static int non_gui_gradient_type;
static double non_gui_incremental;
static double non_gui_fade_out;
static double non_gui_gradient_length;
static int non_gui_gradient_type;
static double non_gui_incremental;
/* forward function declarations */
static void paintbrush_motion (PaintCore *, GimpDrawable *, double, double, gboolean, int);
static void paintbrush_motion (PaintCore *, GimpDrawable *,
double, double, gboolean, int);
/* functions */

View File

@ -1218,6 +1218,7 @@ plug_in_repeat (int with_interface)
if (last_plug_in)
{
gdisplay = gdisplay_active ();
if (!gdisplay) return;
/* construct the procedures arguments */
args = g_new (Argument, 3);
@ -2286,6 +2287,7 @@ plug_in_callback (GtkWidget *widget,
/* get the active gdisplay */
gdisplay = gdisplay_active ();
if (!gdisplay) return;
proc_rec = (ProcRecord*) client_data;

View File

@ -1218,6 +1218,7 @@ plug_in_repeat (int with_interface)
if (last_plug_in)
{
gdisplay = gdisplay_active ();
if (!gdisplay) return;
/* construct the procedures arguments */
args = g_new (Argument, 3);
@ -2286,6 +2287,7 @@ plug_in_callback (GtkWidget *widget,
/* get the active gdisplay */
gdisplay = gdisplay_active ();
if (!gdisplay) return;
proc_rec = (ProcRecord*) client_data;

View File

@ -1218,6 +1218,7 @@ plug_in_repeat (int with_interface)
if (last_plug_in)
{
gdisplay = gdisplay_active ();
if (!gdisplay) return;
/* construct the procedures arguments */
args = g_new (Argument, 3);
@ -2286,6 +2287,7 @@ plug_in_callback (GtkWidget *widget,
/* get the active gdisplay */
gdisplay = gdisplay_active ();
if (!gdisplay) return;
proc_rec = (ProcRecord*) client_data;

View File

@ -1218,6 +1218,7 @@ plug_in_repeat (int with_interface)
if (last_plug_in)
{
gdisplay = gdisplay_active ();
if (!gdisplay) return;
/* construct the procedures arguments */
args = g_new (Argument, 3);
@ -2286,6 +2287,7 @@ plug_in_callback (GtkWidget *widget,
/* get the active gdisplay */
gdisplay = gdisplay_active ();
if (!gdisplay) return;
proc_rec = (ProcRecord*) client_data;

View File

@ -1218,6 +1218,7 @@ plug_in_repeat (int with_interface)
if (last_plug_in)
{
gdisplay = gdisplay_active ();
if (!gdisplay) return;
/* construct the procedures arguments */
args = g_new (Argument, 3);
@ -2286,6 +2287,7 @@ plug_in_callback (GtkWidget *widget,
/* get the active gdisplay */
gdisplay = gdisplay_active ();
if (!gdisplay) return;
proc_rec = (ProcRecord*) client_data;

View File

@ -1218,6 +1218,7 @@ plug_in_repeat (int with_interface)
if (last_plug_in)
{
gdisplay = gdisplay_active ();
if (!gdisplay) return;
/* construct the procedures arguments */
args = g_new (Argument, 3);
@ -2286,6 +2287,7 @@ plug_in_callback (GtkWidget *widget,
/* get the active gdisplay */
gdisplay = gdisplay_active ();
if (!gdisplay) return;
proc_rec = (ProcRecord*) client_data;

View File

@ -1218,6 +1218,7 @@ plug_in_repeat (int with_interface)
if (last_plug_in)
{
gdisplay = gdisplay_active ();
if (!gdisplay) return;
/* construct the procedures arguments */
args = g_new (Argument, 3);
@ -2286,6 +2287,7 @@ plug_in_callback (GtkWidget *widget,
/* get the active gdisplay */
gdisplay = gdisplay_active ();
if (!gdisplay) return;
proc_rec = (ProcRecord*) client_data;

View File

@ -1218,6 +1218,7 @@ plug_in_repeat (int with_interface)
if (last_plug_in)
{
gdisplay = gdisplay_active ();
if (!gdisplay) return;
/* construct the procedures arguments */
args = g_new (Argument, 3);
@ -2286,6 +2287,7 @@ plug_in_callback (GtkWidget *widget,
/* get the active gdisplay */
gdisplay = gdisplay_active ();
if (!gdisplay) return;
proc_rec = (ProcRecord*) client_data;

View File

@ -1218,6 +1218,7 @@ plug_in_repeat (int with_interface)
if (last_plug_in)
{
gdisplay = gdisplay_active ();
if (!gdisplay) return;
/* construct the procedures arguments */
args = g_new (Argument, 3);
@ -2286,6 +2287,7 @@ plug_in_callback (GtkWidget *widget,
/* get the active gdisplay */
gdisplay = gdisplay_active ();
if (!gdisplay) return;
proc_rec = (ProcRecord*) client_data;

View File

@ -1218,6 +1218,7 @@ plug_in_repeat (int with_interface)
if (last_plug_in)
{
gdisplay = gdisplay_active ();
if (!gdisplay) return;
/* construct the procedures arguments */
args = g_new (Argument, 3);
@ -2286,6 +2287,7 @@ plug_in_callback (GtkWidget *widget,
/* get the active gdisplay */
gdisplay = gdisplay_active ();
if (!gdisplay) return;
proc_rec = (ProcRecord*) client_data;

View File

@ -1218,6 +1218,7 @@ plug_in_repeat (int with_interface)
if (last_plug_in)
{
gdisplay = gdisplay_active ();
if (!gdisplay) return;
/* construct the procedures arguments */
args = g_new (Argument, 3);
@ -2286,6 +2287,7 @@ plug_in_callback (GtkWidget *widget,
/* get the active gdisplay */
gdisplay = gdisplay_active ();
if (!gdisplay) return;
proc_rec = (ProcRecord*) client_data;

View File

@ -1218,6 +1218,7 @@ plug_in_repeat (int with_interface)
if (last_plug_in)
{
gdisplay = gdisplay_active ();
if (!gdisplay) return;
/* construct the procedures arguments */
args = g_new (Argument, 3);
@ -2286,6 +2287,7 @@ plug_in_callback (GtkWidget *widget,
/* get the active gdisplay */
gdisplay = gdisplay_active ();
if (!gdisplay) return;
proc_rec = (ProcRecord*) client_data;

View File

@ -1218,6 +1218,7 @@ plug_in_repeat (int with_interface)
if (last_plug_in)
{
gdisplay = gdisplay_active ();
if (!gdisplay) return;
/* construct the procedures arguments */
args = g_new (Argument, 3);
@ -2286,6 +2287,7 @@ plug_in_callback (GtkWidget *widget,
/* get the active gdisplay */
gdisplay = gdisplay_active ();
if (!gdisplay) return;
proc_rec = (ProcRecord*) client_data;

View File

@ -1218,6 +1218,7 @@ plug_in_repeat (int with_interface)
if (last_plug_in)
{
gdisplay = gdisplay_active ();
if (!gdisplay) return;
/* construct the procedures arguments */
args = g_new (Argument, 3);
@ -2286,6 +2287,7 @@ plug_in_callback (GtkWidget *widget,
/* get the active gdisplay */
gdisplay = gdisplay_active ();
if (!gdisplay) return;
proc_rec = (ProcRecord*) client_data;

View File

@ -1218,6 +1218,7 @@ plug_in_repeat (int with_interface)
if (last_plug_in)
{
gdisplay = gdisplay_active ();
if (!gdisplay) return;
/* construct the procedures arguments */
args = g_new (Argument, 3);
@ -2286,6 +2287,7 @@ plug_in_callback (GtkWidget *widget,
/* get the active gdisplay */
gdisplay = gdisplay_active ();
if (!gdisplay) return;
proc_rec = (ProcRecord*) client_data;

View File

@ -1218,6 +1218,7 @@ plug_in_repeat (int with_interface)
if (last_plug_in)
{
gdisplay = gdisplay_active ();
if (!gdisplay) return;
/* construct the procedures arguments */
args = g_new (Argument, 3);
@ -2286,6 +2287,7 @@ plug_in_callback (GtkWidget *widget,
/* get the active gdisplay */
gdisplay = gdisplay_active ();
if (!gdisplay) return;
proc_rec = (ProcRecord*) client_data;

View File

@ -51,16 +51,16 @@ struct _Posterize
typedef struct _PosterizeDialog PosterizeDialog;
struct _PosterizeDialog
{
GtkWidget *shell;
GtkWidget *levels_text;
GtkWidget *shell;
GtkWidget *levels_text;
GimpDrawable *drawable;
ImageMap image_map;
int levels;
ImageMap image_map;
int levels;
gint preview;
gint preview;
GimpLut *lut;
GimpLut *lut;
};
@ -76,15 +76,16 @@ static void posterize_button_press (Tool *, GdkEventButton *, gpointer);
static void posterize_button_release (Tool *, GdkEventButton *, gpointer);
static void posterize_motion (Tool *, GdkEventMotion *, gpointer);
static void posterize_cursor_update (Tool *, GdkEventMotion *, gpointer);
static void posterize_control (Tool *, int, gpointer);
static void posterize_control (Tool *, ToolAction, gpointer);
static PosterizeDialog * posterize_new_dialog (void);
static void posterize_preview (PosterizeDialog *);
static void posterize_ok_callback (GtkWidget *, gpointer);
static void posterize_cancel_callback (GtkWidget *, gpointer);
static void posterize_preview_update (GtkWidget *, gpointer);
static void posterize_levels_text_update (GtkWidget *, gpointer);
static gint posterize_delete_callback (GtkWidget *, GdkEvent *, gpointer);
static PosterizeDialog * posterize_new_dialog (void);
static void posterize_preview (PosterizeDialog *);
static void posterize_ok_callback (GtkWidget *, gpointer);
static void posterize_cancel_callback (GtkWidget *, gpointer);
static void posterize_preview_update (GtkWidget *, gpointer);
static void posterize_levels_text_update (GtkWidget *, gpointer);
static gint posterize_delete_callback (GtkWidget *, GdkEvent *, gpointer);
/* posterize select action functions */
@ -126,9 +127,9 @@ posterize_cursor_update (Tool *tool,
}
static void
posterize_control (Tool *tool,
int action,
gpointer gdisp_ptr)
posterize_control (Tool *tool,
ToolAction action,
gpointer gdisp_ptr)
{
Posterize * post;
@ -136,11 +137,13 @@ posterize_control (Tool *tool,
switch (action)
{
case PAUSE :
case PAUSE:
break;
case RESUME :
case RESUME:
break;
case HALT :
case HALT:
if (posterize_dialog)
{
active_tool->preserve = TRUE;
@ -150,6 +153,9 @@ posterize_control (Tool *tool,
posterize_cancel_callback (NULL, (gpointer) posterize_dialog);
}
break;
default:
break;
}
}
@ -185,9 +191,11 @@ tools_new_posterize ()
tool->button_press_func = posterize_button_press;
tool->button_release_func = posterize_button_release;
tool->motion_func = posterize_motion;
tool->arrow_keys_func = standard_arrow_keys_func; tool->modifier_key_func = standard_modifier_key_func;
tool->arrow_keys_func = standard_arrow_keys_func;
tool->modifier_key_func = standard_modifier_key_func;
tool->cursor_update_func = posterize_cursor_update;
tool->control_func = posterize_control;
tool->preserve = FALSE;
tool->gdisp_ptr = NULL;
tool->drawable = NULL;

View File

@ -511,9 +511,9 @@ rect_select_cursor_update (Tool *tool,
}
void
rect_select_control (Tool *tool,
int action,
gpointer gdisp_ptr)
rect_select_control (Tool *tool,
ToolAction action,
gpointer gdisp_ptr)
{
RectSelect * rect_sel;
@ -524,12 +524,17 @@ rect_select_control (Tool *tool,
case PAUSE :
draw_core_pause (rect_sel->core, tool);
break;
case RESUME :
draw_core_resume (rect_sel->core, tool);
break;
case HALT :
draw_core_stop (rect_sel->core, tool);
break;
default:
break;
}
}
@ -574,6 +579,7 @@ tools_new_rect_select ()
tool->modifier_key_func = standard_modifier_key_func;
tool->cursor_update_func = rect_select_cursor_update;
tool->control_func = rect_select_control;
tool->preserve = TRUE;
return tool;

View File

@ -33,19 +33,18 @@ typedef enum
} SelectOps;
/* rect select action functions */
void rect_select_button_press (Tool *, GdkEventButton *, gpointer);
void rect_select_button_release (Tool *, GdkEventButton *, gpointer);
void rect_select_motion (Tool *, GdkEventMotion *, gpointer);
void rect_select_cursor_update (Tool *, GdkEventMotion *, gpointer);
void rect_select_control (Tool *, int, gpointer);
void rect_select_button_press (Tool *, GdkEventButton *, gpointer);
void rect_select_button_release (Tool *, GdkEventButton *, gpointer);
void rect_select_motion (Tool *, GdkEventMotion *, gpointer);
void rect_select_cursor_update (Tool *, GdkEventMotion *, gpointer);
void rect_select_control (Tool *, ToolAction, gpointer);
/* rect select functions */
void rect_select_draw (Tool *);
void rect_select (GimpImage *, int, int, int, int, int, int,
double);
void rect_select_draw (Tool *);
void rect_select (GimpImage *, int, int, int, int, int, int,
double);
Tool * tools_new_rect_select (void);
void tools_free_rect_select (Tool *);
Tool * tools_new_rect_select (void);
void tools_free_rect_select (Tool *);
#endif /* __RECT_SELECT_H__ */

View File

@ -3,9 +3,9 @@
#include "draw_core.h"
typedef struct _rect_select RectSelect, EllipseSelect;
typedef struct _RectSelect RectSelect, EllipseSelect;
struct _rect_select
struct _RectSelect
{
DrawCore * core; /* Core select object */

View File

@ -106,24 +106,24 @@ static TextTool *the_text_tool = NULL;
static GtkWidget *text_tool_shell = NULL;
static void text_button_press (Tool *, GdkEventButton *, gpointer);
static void text_button_release (Tool *, GdkEventButton *, gpointer);
static void text_motion (Tool *, GdkEventMotion *, gpointer);
static void text_cursor_update (Tool *, GdkEventMotion *, gpointer);
static void text_control (Tool *, int, gpointer);
static void text_button_press (Tool *, GdkEventButton *, gpointer);
static void text_button_release (Tool *, GdkEventButton *, gpointer);
static void text_motion (Tool *, GdkEventMotion *, gpointer);
static void text_cursor_update (Tool *, GdkEventMotion *, gpointer);
static void text_control (Tool *, ToolAction, gpointer);
static void text_create_dialog (void);
static void text_ok_callback (GtkWidget *, gpointer);
static void text_cancel_callback (GtkWidget *, gpointer);
static gint text_delete_callback (GtkWidget *, GdkEvent *, gpointer);
static void text_create_dialog (void);
static void text_ok_callback (GtkWidget *, gpointer);
static void text_cancel_callback (GtkWidget *, gpointer);
static gint text_delete_callback (GtkWidget *, GdkEvent *, gpointer);
static void text_init_render (TextTool *);
static void text_gdk_image_to_region (GdkImage *, int, PixelRegion *);
static void text_size_multiply (char **fontname, int);
static void text_set_resolution (char **fontname, double, double);
static void text_init_render (TextTool *);
static void text_gdk_image_to_region (GdkImage *, int, PixelRegion *);
static void text_size_multiply (char **fontname, int);
static void text_set_resolution (char **fontname, double, double);
Layer * text_render (GImage *, GimpDrawable *,
int, int, char *, char *, int, int);
Layer * text_render (GImage *, GimpDrawable *,
int, int, char *, char *, int, int);
/* functions */
@ -258,6 +258,7 @@ tools_new_text ()
tool->modifier_key_func = standard_modifier_key_func;
tool->cursor_update_func = text_cursor_update;
tool->control_func = text_control;
tool->preserve = TRUE;
return tool;
@ -384,20 +385,25 @@ text_cursor_update (Tool *tool,
}
static void
text_control (Tool *tool,
int action,
gpointer gdisp_ptr)
text_control (Tool *tool,
ToolAction action,
gpointer gdisp_ptr)
{
switch (action)
{
case PAUSE :
case PAUSE:
break;
case RESUME :
case RESUME:
break;
case HALT :
case HALT:
if (text_tool_shell && GTK_WIDGET_VISIBLE (text_tool_shell))
gtk_widget_hide (text_tool_shell);
break;
default:
break;
}
}

View File

@ -28,8 +28,8 @@
#include "libgimp/gimpintl.h"
#define TEXT_WIDTH 45
#define HISTOGRAM_WIDTH 256
#define TEXT_WIDTH 45
#define HISTOGRAM_WIDTH 256
#define HISTOGRAM_HEIGHT 150
/* the threshold structures */
@ -53,21 +53,20 @@ static void threshold_button_press (Tool *, GdkEventButton *, gpointer);
static void threshold_button_release (Tool *, GdkEventButton *, gpointer);
static void threshold_motion (Tool *, GdkEventMotion *, gpointer);
static void threshold_cursor_update (Tool *, GdkEventMotion *, gpointer);
static void threshold_control (Tool *, int, gpointer);
static void threshold_control (Tool *, ToolAction, gpointer);
static ThresholdDialog * threshold_new_dialog (void);
static void threshold_preview (ThresholdDialog *);
static void threshold_ok_callback (GtkWidget *, gpointer);
static void threshold_cancel_callback (GtkWidget *, gpointer);
static gint threshold_delete_callback (GtkWidget *, GdkEvent *,
gpointer);
static void threshold_preview_update (GtkWidget *, gpointer);
static void threshold_low_threshold_text_update (GtkWidget *, gpointer);
static void threshold_high_threshold_text_update (GtkWidget *, gpointer);
static ThresholdDialog * threshold_new_dialog (void);
static void threshold_preview (ThresholdDialog *);
static void threshold_ok_callback (GtkWidget *, gpointer);
static void threshold_cancel_callback (GtkWidget *, gpointer);
static gint threshold_delete_callback (GtkWidget *, GdkEvent *, gpointer);
static void threshold_preview_update (GtkWidget *, gpointer);
static void threshold_low_threshold_text_update (GtkWidget *, gpointer);
static void threshold_high_threshold_text_update (GtkWidget *, gpointer);
static void threshold (PixelRegion *, PixelRegion *, void *);
static void threshold_histogram_range (HistogramWidget *, int, int,
void*);
static void threshold (PixelRegion *, PixelRegion *, void *);
static void threshold_histogram_range (HistogramWidget *, int, int, void *);
/* threshold machinery */
@ -195,9 +194,9 @@ threshold_cursor_update (Tool *tool,
}
static void
threshold_control (Tool *tool,
int action,
gpointer gdisp_ptr)
threshold_control (Tool *tool,
ToolAction action,
gpointer gdisp_ptr)
{
Threshold * thresh;
@ -205,11 +204,13 @@ threshold_control (Tool *tool,
switch (action)
{
case PAUSE :
case PAUSE:
break;
case RESUME :
case RESUME:
break;
case HALT :
case HALT:
if (threshold_dialog)
{
active_tool->preserve = TRUE;
@ -219,6 +220,9 @@ threshold_control (Tool *tool,
threshold_cancel_callback (NULL, (gpointer) threshold_dialog);
}
break;
default:
break;
}
}
@ -250,12 +254,15 @@ tools_new_threshold ()
tool->scroll_lock = 1; /* Disallow scrolling */
tool->auto_snap_to = TRUE;
tool->private = (void *) private;
tool->button_press_func = threshold_button_press;
tool->button_release_func = threshold_button_release;
tool->motion_func = threshold_motion;
tool->arrow_keys_func = standard_arrow_keys_func; tool->modifier_key_func = standard_modifier_key_func;
tool->arrow_keys_func = standard_arrow_keys_func;
tool->modifier_key_func = standard_modifier_key_func;
tool->cursor_update_func = threshold_cursor_update;
tool->control_func = threshold_control;
tool->preserve = FALSE;
return tool;

View File

@ -29,7 +29,6 @@
#include "color_picker.h"
#include "convolve.h"
#include "crop.h"
#include "cursorutil.h"
#include "curves.h"
#include "devices.h"
#include "eraser.h"
@ -39,10 +38,8 @@
#include "flip_tool.h"
#include "free_select.h"
#include "fuzzy_select.h"
#include "gimprc.h"
#include "histogram_tool.h"
#include "ink.h"
#include "interface.h"
#include "iscissors.h"
#include "levels.h"
#include "magnify.h"
@ -63,19 +60,16 @@
#include "pixmaps2.h"
/* Global Data */
Tool * active_tool = NULL;
Layer * active_tool_layer = NULL;
/* Local Data */
/* Global Data */
Tool * active_tool = NULL;
/* Local Data */
static GtkWidget *options_shell = NULL;
static GtkWidget *options_vbox = NULL;
static GtkWidget *options_label = NULL;
static GtkWidget *options_reset_button = NULL;
static int global_tool_ID = 0;
static int global_tool_ID = 0;
ToolInfo tool_info[] =
{
@ -595,10 +589,11 @@ gint num_tools = sizeof (tool_info) / sizeof (ToolInfo);
/* Local function declarations */
static void tools_options_reset_callback (GtkWidget *, gpointer);
static void tools_options_close_callback (GtkWidget *, gpointer);
static gint tools_options_delete_callback (GtkWidget *, GdkEvent *, gpointer);
static void tools_options_show (ToolType);
static void tools_options_hide (ToolType);
static void tools_options_reset_callback (GtkWidget *, gpointer);
static void tools_options_close_callback (GtkWidget *, gpointer);
static gint tools_options_delete_callback (GtkWidget *, GdkEvent *, gpointer);
/* Function definitions */
@ -609,17 +604,14 @@ active_tool_free (void)
if (!active_tool)
return;
if (tool_info[(int) active_tool->type].tool_options)
gtk_widget_hide (tool_info[(int) active_tool->type].tool_options->main_vbox);
tools_options_hide (active_tool->type);
(* tool_info[(int) active_tool->type].free_func) (active_tool);
g_free (active_tool);
active_tool = NULL;
active_tool_layer = NULL;
}
void
tools_select (ToolType type)
{
@ -628,22 +620,9 @@ tools_select (ToolType type)
active_tool = (* tool_info[(int) type].new_func) ();
/* Show the options and the title label of the active tool
*/
if (tool_info[(int) active_tool->type].tool_options->main_vbox)
gtk_widget_show (tool_info[(int) active_tool->type].tool_options->main_vbox);
tools_options_show (active_tool->type);
if (tool_info[(int) active_tool->type].tool_options->title)
gtk_label_set_text (GTK_LABEL (options_label),
_(tool_info[(int) active_tool->type].tool_options->title));
if (tool_info[(int) active_tool->type].tool_options->reset_func)
gtk_widget_set_sensitive (options_reset_button, TRUE);
else
gtk_widget_set_sensitive (options_reset_button, FALSE);
/* Set the paused count variable to 0
*/
/* Set the paused count variable to 0 */
active_tool->paused_count = 0;
active_tool->gdisp_ptr = NULL;
active_tool->drawable = NULL;
@ -654,56 +633,46 @@ tools_select (ToolType type)
}
void
tools_initialize (ToolType type, GDisplay *gdisp)
tools_initialize (ToolType type,
GDisplay *gdisp)
{
/* If you're wondering... only these dialog type tools have init functions */
if (active_tool)
active_tool_free ();
/* If you're wondering... only these dialog type tools have init functions */
if (tool_info[(int) type].init_func)
{
if (gdisp)
{
active_tool = (* tool_info[(int) type].new_func) ();
(* tool_info[(int) type].init_func) (gdisp);
}
}
else
{
active_tool = tools_new_rect_select ();
}
}
else
active_tool = (* tool_info[(int) type].new_func) ();
/* Show the options and the title label of the active tool
*/
if (tool_info[(int) active_tool->type].tool_options)
gtk_widget_show (tool_info[(int) active_tool->type].tool_options->main_vbox);
if (tool_info[(int) active_tool->type].tool_options->title)
gtk_label_set_text (GTK_LABEL (options_label),
_(tool_info[(int) active_tool->type].tool_options->title));
if (tool_info[(int) active_tool->type].tool_options->reset_func)
gtk_widget_set_sensitive (options_reset_button, TRUE);
else
gtk_widget_set_sensitive (options_reset_button, FALSE);
{
active_tool = (* tool_info[(int) type].new_func) ();
}
tools_options_show (active_tool->type);
/* Set the paused count variable to 0 */
active_tool->paused_count = 0;
active_tool->gdisp_ptr = gdisp;
active_tool->drawable = NULL;
active_tool->ID = global_tool_ID++;
/* Set the paused count variable to 0
*/
if (gdisp)
active_tool->drawable = gimage_active_drawable (gdisp->gimage);
else
active_tool->drawable = NULL;
active_tool->gdisp_ptr = NULL;
active_tool->ID = global_tool_ID++;
}
void
tools_options_dialog_new ()
{
GtkWidget *frame;
/* GtkWidget *frame2; */
GtkWidget *vbox;
ActionAreaItem action_items[2] =
@ -726,17 +695,11 @@ tools_options_dialog_new ()
/* The outer frame */
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); /* _OUT */
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (options_shell)->vbox), frame);
gtk_widget_show (frame);
/*
frame2 = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame2), GTK_SHADOW_IN);
gtk_container_add (GTK_CONTAINER (frame), frame2);
gtk_widget_show (frame2);
*/
/* The vbox containing the title frame and the options vbox */
vbox = gtk_vbox_new (FALSE, 0);
gtk_container_add (GTK_CONTAINER (frame), vbox);
gtk_widget_show (vbox);
@ -791,7 +754,6 @@ tools_options_dialog_show ()
}
}
void
tools_options_dialog_free ()
{
@ -799,7 +761,6 @@ tools_options_dialog_free ()
gtk_widget_destroy (options_shell);
}
void
tools_register (ToolType tool_type,
ToolOptions *tool_options)
@ -821,10 +782,9 @@ tools_register (ToolType tool_type,
gtk_label_set_text (GTK_LABEL (options_label), _(tool_options->title));
}
void
active_tool_control (int action,
void *gdisp_ptr)
active_tool_control (ToolAction action,
void *gdisp_ptr)
{
if (active_tool)
{
@ -842,8 +802,8 @@ active_tool_control (int action,
}
}
active_tool->paused_count++;
break;
case RESUME :
active_tool->paused_count--;
if (active_tool->state == PAUSED)
@ -855,18 +815,25 @@ active_tool_control (int action,
}
}
break;
case HALT :
active_tool->state = INACTIVE;
(* active_tool->control_func) (active_tool, action, gdisp_ptr);
break;
case DESTROY :
active_tool_free();
active_tool_free ();
gtk_widget_hide (options_shell);
break;
default:
break;
}
}
else if (action == HALT)
active_tool->state = INACTIVE;
{
active_tool->state = INACTIVE;
}
}
}
@ -884,6 +851,31 @@ standard_modifier_key_func (Tool *tool,
{
}
/* tool options function */
static void
tools_options_show (ToolType tooltype)
{
if (tool_info[tooltype].tool_options->main_vbox)
gtk_widget_show (tool_info[tooltype].tool_options->main_vbox);
if (tool_info[tooltype].tool_options->title)
gtk_label_set_text (GTK_LABEL (options_label),
_(tool_info[tooltype].tool_options->title));
if (tool_info[tooltype].tool_options->reset_func)
gtk_widget_set_sensitive (options_reset_button, TRUE);
else
gtk_widget_set_sensitive (options_reset_button, FALSE);
}
static void
tools_options_hide (ToolType tooltype)
{
if (tool_info[tooltype].tool_options)
gtk_widget_hide (tool_info[tooltype].tool_options->main_vbox);
}
static gint
tools_options_delete_callback (GtkWidget *w,
GdkEvent *e,

View File

@ -27,41 +27,35 @@
#include <gtk/gtk.h>
/* The possible states for tools */
#define INACTIVE 0
#define ACTIVE 1
#define PAUSED 2
/* Tool control actions */
#define PAUSE 0
#define RESUME 1
#define HALT 2
#define CURSOR_UPDATE 3
#define DESTROY 4
#define RECREATE 5
typedef enum
{
INACTIVE,
ACTIVE,
PAUSED
} ToolState;
/* The possibilities for where the cursor lies */
#define ACTIVE_LAYER (1 << 0)
#define SELECTION (1 << 1)
#define NON_ACTIVE_LAYER (1 << 2)
#define ACTIVE_LAYER (1 << 0)
#define SELECTION (1 << 1)
#define NON_ACTIVE_LAYER (1 << 2)
/* The types of tools... */
struct _tool
struct _Tool
{
/* Data */
ToolType type; /* Tool type */
int state; /* state of tool activity */
int paused_count; /* paused control count */
int scroll_lock; /* allow scrolling or not */
int auto_snap_to; /* should the mouse snap to guides automatically */
void * private; /* Tool-specific information */
void * gdisp_ptr; /* pointer to currently active gdisp */
void * drawable; /* pointer to the drawable that was
active when the tool was created */
int ID; /* unique tool ID */
ToolType type; /* Tool type */
ToolState state; /* state of tool activity */
int paused_count; /* paused control count */
int scroll_lock; /* allow scrolling or not */
int auto_snap_to; /* should the mouse snap to guides automatically */
void * private; /* Tool-specific information */
void * gdisp_ptr; /* pointer to currently active gdisp */
void * drawable; /* pointer to the drawable that was
active when the tool was created */
int ID; /* unique tool ID */
int preserve; /* Preserve this tool through the current image changes */
int preserve; /* Preserve this tool through the current
image changes */
/* Action functions */
ButtonPressFunc button_press_func;
@ -73,7 +67,6 @@ struct _tool
ToolCtlFunc control_func;
};
struct _ToolInfo
{
ToolOptions *tool_options;
@ -99,26 +92,24 @@ struct _ToolInfo
GtkWidget *tool_widget;
};
/* Global Data Structure */
extern Tool * active_tool;
extern Layer * active_tool_layer;
extern ToolInfo tool_info[];
/* Function declarations */
void tools_select (ToolType tool_type);
void tools_initialize (ToolType tool_type,
GDisplay *gdisplay);
void tools_select (ToolType);
void tools_initialize (ToolType, GDisplay *);
void tools_options_dialog_new (void);
void tools_options_dialog_show (void);
void tools_options_dialog_free (void);
void tools_options_dialog_new (void);
void tools_options_dialog_show (void);
void tools_options_dialog_free (void);
void tools_register (ToolType tool_type,
ToolOptions *tool_options);
void active_tool_control (int, void *);
void tools_register (ToolType tool_type,
ToolOptions *tool_options);
void active_tool_control (ToolAction action,
void *gdisp_ptr);
/* Standard member functions */
void standard_arrow_keys_func (Tool *, GdkEventKey *, gpointer);

View File

@ -160,11 +160,10 @@ static int ModeEdit = EXTEND_NEW;
/* local function prototypes */
static void bezier_select_button_press (Tool *, GdkEventButton *, gpointer);
static void bezier_select_button_release (Tool *, GdkEventButton *, gpointer);
static void bezier_select_motion (Tool *, GdkEventMotion *, gpointer);
static void bezier_select_control (Tool *, int, gpointer);
static void bezier_select_control (Tool *, ToolAction, gpointer);
static void bezier_select_cursor_update (Tool *, GdkEventMotion *, gpointer);
static void bezier_select_draw (Tool *);
@ -230,7 +229,8 @@ tools_new_bezier_select ()
tool->button_press_func = bezier_select_button_press;
tool->button_release_func = bezier_select_button_release;
tool->motion_func = bezier_select_motion;
tool->arrow_keys_func = standard_arrow_keys_func; tool->modifier_key_func = standard_modifier_key_func;
tool->arrow_keys_func = standard_arrow_keys_func;
tool->modifier_key_func = standard_modifier_key_func;
tool->cursor_update_func = bezier_select_cursor_update;
tool->control_func = bezier_select_control;
tool->preserve = FALSE;
@ -1607,9 +1607,9 @@ bezier_select_cursor_update (Tool *tool,
}
static void
bezier_select_control (Tool *tool,
int action,
gpointer gdisp_ptr)
bezier_select_control (Tool *tool,
ToolAction action,
gpointer gdisp_ptr)
{
BezierSelect * bezier_sel;
@ -1620,13 +1620,16 @@ bezier_select_control (Tool *tool,
case PAUSE :
draw_core_pause (bezier_sel->core, tool);
break;
case RESUME :
draw_core_resume (bezier_sel->core, tool);
break;
case HALT :
draw_core_stop (bezier_sel->core, tool);
bezier_select_reset (bezier_sel);
break;
default:
break;
}
@ -2467,7 +2470,7 @@ bezier_paste_bezierselect_to_current(GDisplay *gdisp,BezierSelect *bsel)
gtk_widget_activate (tool_info[BEZIER_SELECT].tool_widget);
tools_select(BEZIER_SELECT);
active_tool->paused_count = 0;
active_tool->gdisp_ptr = gdisp;;
active_tool->gdisp_ptr = gdisp;
active_tool->drawable = gimage_active_drawable (gdisp->gimage);
tool = active_tool;

View File

@ -45,16 +45,16 @@
#include "tile.h"
/* target size */
#define TARGET_HEIGHT 15
#define TARGET_WIDTH 15
#define TARGET_HEIGHT 15
#define TARGET_WIDTH 15
#define SQR(x) ((x) * (x))
#ifndef M_PI
#define M_PI 3.14159265358979323846
#define M_PI 3.14159265358979323846
#endif /* M_PI */
#define STATUSBAR_SIZE 128
#define STATUSBAR_SIZE 128
/* the blend structures */
@ -63,14 +63,14 @@ typedef double (*RepeatFunc)(double);
typedef struct _BlendTool BlendTool;
struct _BlendTool
{
DrawCore * core; /* Core select object */
DrawCore * core; /* Core select object */
int startx; /* starting x coord */
int starty; /* starting y coord */
int startx; /* starting x coord */
int starty; /* starting y coord */
int endx; /* ending x coord */
int endy; /* ending y coord */
guint context_id; /* for the statusbar */
int endx; /* ending x coord */
int endy; /* ending y coord */
guint context_id; /* for the statusbar */
};
typedef struct _BlendOptions BlendOptions;
@ -107,7 +107,8 @@ struct _BlendOptions
GtkObject *threshold_w;
};
typedef struct {
typedef struct
{
double offset;
double sx, sy;
BlendMode blend_mode;
@ -118,7 +119,8 @@ typedef struct {
RepeatFunc repeat_func;
} RenderBlendData;
typedef struct {
typedef struct
{
PixelRegion *PR;
unsigned char *row_data;
int bytes;
@ -143,15 +145,16 @@ static PixelRegion distR =
/* local function prototypes */
static void gradient_type_callback (GtkWidget *, gpointer);
static void blend_mode_callback (GtkWidget *, gpointer);
static void repeat_type_callback (GtkWidget *, gpointer);
static void blend_button_press (Tool *, GdkEventButton *, gpointer);
static void blend_button_release (Tool *, GdkEventButton *, gpointer);
static void blend_motion (Tool *, GdkEventMotion *, gpointer);
static void blend_cursor_update (Tool *, GdkEventMotion *, gpointer);
static void blend_control (Tool *, int, gpointer);
static void blend_button_press (Tool *, GdkEventButton *, gpointer);
static void blend_button_release (Tool *, GdkEventButton *, gpointer);
static void blend_motion (Tool *, GdkEventMotion *, gpointer);
static void blend_cursor_update (Tool *, GdkEventMotion *, gpointer);
static void blend_control (Tool *, ToolAction, gpointer);
static double gradient_calc_conical_sym_factor (double dist, double *axis, double offset,
double x, double y);
@ -717,9 +720,9 @@ blend_draw (Tool *tool)
}
static void
blend_control (Tool *tool,
int action,
gpointer gdisp_ptr)
blend_control (Tool *tool,
ToolAction action,
gpointer gdisp_ptr)
{
BlendTool * blend_tool;
@ -727,15 +730,20 @@ blend_control (Tool *tool,
switch (action)
{
case PAUSE :
case PAUSE:
draw_core_pause (blend_tool->core, tool);
break;
case RESUME :
case RESUME:
draw_core_resume (blend_tool->core, tool);
break;
case HALT :
case HALT:
draw_core_stop (blend_tool->core, tool);
break;
default:
break;
}
}

View File

@ -86,7 +86,7 @@ static void brightness_contrast_button_press (Tool *, GdkEventButton *, gpoi
static void brightness_contrast_button_release (Tool *, GdkEventButton *, gpointer);
static void brightness_contrast_motion (Tool *, GdkEventMotion *, gpointer);
static void brightness_contrast_cursor_update (Tool *, GdkEventMotion *, gpointer);
static void brightness_contrast_control (Tool *, int, gpointer);
static void brightness_contrast_control (Tool *, ToolAction, gpointer);
static BrightnessContrastDialog * brightness_contrast_new_dialog (void);
static void brightness_contrast_update (BrightnessContrastDialog *, int);
@ -140,17 +140,19 @@ brightness_contrast_cursor_update (Tool *tool,
}
static void
brightness_contrast_control (Tool *tool,
int action,
gpointer gdisp_ptr)
brightness_contrast_control (Tool *tool,
ToolAction action,
gpointer gdisp_ptr)
{
switch (action)
{
case PAUSE :
case PAUSE:
break;
case RESUME :
case RESUME:
break;
case HALT :
case HALT:
if (brightness_contrast_dialog)
{
active_tool->preserve = TRUE;
@ -160,6 +162,9 @@ brightness_contrast_control (Tool *tool,
brightness_contrast_cancel_callback (NULL, (gpointer) brightness_contrast_dialog);
}
break;
default:
break;
}
}
@ -189,7 +194,8 @@ tools_new_brightness_contrast ()
tool->button_press_func = brightness_contrast_button_press;
tool->button_release_func = brightness_contrast_button_release;
tool->motion_func = brightness_contrast_motion;
tool->arrow_keys_func = standard_arrow_keys_func; tool->modifier_key_func = standard_modifier_key_func;
tool->arrow_keys_func = standard_arrow_keys_func;
tool->modifier_key_func = standard_modifier_key_func;
tool->cursor_update_func = brightness_contrast_cursor_update;
tool->control_func = brightness_contrast_control;
tool->preserve = FALSE;
@ -583,5 +589,3 @@ brightness_contrast_contrast_text_update (GtkWidget *w,
brightness_contrast_preview (bcd);
}
}

View File

@ -42,8 +42,8 @@
typedef struct _BucketTool BucketTool;
struct _BucketTool
{
int target_x; /* starting x coord */
int target_y; /* starting y coord */
int target_x; /* starting x coord */
int target_y; /* starting y coord */
};
typedef struct _BucketOptions BucketOptions;
@ -70,15 +70,16 @@ static BucketOptions *bucket_options = NULL;
/* local function prototypes */
static void bucket_fill_button_press (Tool *, GdkEventButton *, gpointer);
static void bucket_fill_button_release (Tool *, GdkEventButton *, gpointer);
static void bucket_fill_motion (Tool *, GdkEventMotion *, gpointer);
static void bucket_fill_cursor_update (Tool *, GdkEventMotion *, gpointer);
static void bucket_fill_control (Tool *, int, gpointer);
static void bucket_fill_control (Tool *, ToolAction, gpointer);
static void bucket_fill_region (BucketFillMode, PixelRegion *, PixelRegion *,
unsigned char *, TempBuf *,
int, int, int);
static void bucket_fill_region (BucketFillMode, PixelRegion *,
PixelRegion *, unsigned char *,
TempBuf *, int, int, int);
static void bucket_fill_line_color (unsigned char *, unsigned char *,
unsigned char *, int, int, int);
static void bucket_fill_line_pattern (unsigned char *, unsigned char *,
@ -317,13 +318,12 @@ bucket_fill_modifier_key_func (Tool *tool,
}
static void
bucket_fill_control (Tool *tool,
int action,
gpointer gdisp_ptr)
bucket_fill_control (Tool *tool,
ToolAction action,
gpointer gdisp_ptr)
{
}
void
bucket_fill (GimpImage *gimage,
GimpDrawable *drawable,
@ -588,7 +588,6 @@ bucket_fill_region (BucketFillMode fill_mode,
/* Global bucket fill functions */
/*********************************/
Tool *
tools_new_bucket_fill (void)
{
@ -626,7 +625,6 @@ tools_new_bucket_fill (void)
return tool;
}
void
tools_free_bucket_fill (Tool *tool)
{

View File

@ -27,6 +27,7 @@
#include "general.h"
#include "gimage_mask.h"
#include "gimprc.h"
#include "gimpset.h"
#include "gdisplay.h"
#include "selection_options.h"
@ -46,8 +47,8 @@
typedef struct _ByColorSelect ByColorSelect;
struct _ByColorSelect
{
int x, y; /* Point from which to execute seed fill */
int operation; /* add, subtract, normal color selection */
int x, y; /* Point from which to execute seed fill */
int operation; /* add, subtract, normal color selection */
};
typedef struct _ByColorDialog ByColorDialog;
@ -57,9 +58,9 @@ struct _ByColorDialog
GtkWidget *preview;
GtkWidget *gimage_name;
int threshold; /* threshold value for color select */
int operation; /* Add, Subtract, Replace */
GImage *gimage; /* gimage which is currently under examination */
int threshold; /* threshold value for color select */
int operation; /* Add, Subtract, Replace */
GImage *gimage; /* gimage which is currently under examination */
};
@ -71,26 +72,31 @@ static ByColorDialog * by_color_dialog = NULL;
/* by_color select action functions */
static void by_color_select_button_press (Tool *, GdkEventButton *, gpointer);
static void by_color_select_button_release (Tool *, GdkEventButton *, gpointer);
static void by_color_select_motion (Tool *, GdkEventMotion *, gpointer);
static void by_color_select_cursor_update (Tool *, GdkEventMotion *, gpointer);
static void by_color_select_control (Tool *, int, gpointer);
static ByColorDialog * by_color_select_new_dialog (void);
static void by_color_select_render (ByColorDialog *, GImage *);
static void by_color_select_draw (ByColorDialog *, GImage *);
static gint by_color_select_preview_events (GtkWidget *, GdkEventButton *, ByColorDialog *);
static void by_color_select_type_callback (GtkWidget *, gpointer);
static void by_color_select_reset_callback (GtkWidget *, gpointer);
static void by_color_select_close_callback (GtkWidget *, gpointer);
static gint by_color_select_delete_callback (GtkWidget *, GdkEvent *, gpointer);
static void by_color_select_fuzzy_update (GtkAdjustment *, gpointer);
static void by_color_select_preview_button_press (ByColorDialog *, GdkEventButton *);
static void by_color_select_button_press (Tool *, GdkEventButton *, gpointer);
static void by_color_select_button_release (Tool *, GdkEventButton *, gpointer);
static void by_color_select_motion (Tool *, GdkEventMotion *, gpointer);
static void by_color_select_cursor_update (Tool *, GdkEventMotion *, gpointer);
static void by_color_select_control (Tool *, ToolAction, gpointer);
static ByColorDialog * by_color_select_new_dialog (void);
static void by_color_select_render (ByColorDialog *, GImage *);
static void by_color_select_draw (ByColorDialog *, GImage *);
static gint by_color_select_preview_events (GtkWidget *, GdkEventButton *,
ByColorDialog *);
static void by_color_select_type_callback (GtkWidget *, gpointer);
static void by_color_select_reset_callback (GtkWidget *, gpointer);
static void by_color_select_close_callback (GtkWidget *, gpointer);
static gint by_color_select_delete_callback (GtkWidget *, GdkEvent *,
gpointer);
static void by_color_select_fuzzy_update (GtkAdjustment *, gpointer);
static void by_color_select_preview_button_press (ByColorDialog *,
GdkEventButton *);
static int is_pixel_sufficiently_different (unsigned char *, unsigned char *, int, int, int, int);
static Channel * by_color_select_color (GImage *, GimpDrawable *, unsigned char *, int, int, int);
/* by_color selection machinery */
static int
@ -418,9 +424,9 @@ by_color_select_cursor_update (Tool *tool,
}
static void
by_color_select_control (Tool *tool,
int action,
gpointer gdisp_ptr)
by_color_select_control (Tool *tool,
ToolAction action,
gpointer gdisp_ptr)
{
ByColorSelect * by_color_sel;
@ -430,17 +436,23 @@ by_color_select_control (Tool *tool,
{
case PAUSE :
break;
case RESUME :
break;
case HALT :
if (by_color_dialog)
{
if (by_color_dialog->gimage)
if (by_color_dialog->gimage &&
gimp_set_have (image_context, by_color_dialog->gimage))
by_color_dialog->gimage->by_color_select = FALSE;
by_color_dialog->gimage = NULL;
by_color_select_close_callback (NULL, (gpointer) by_color_dialog);
}
break;
default:
break;
}
}
@ -483,7 +495,8 @@ tools_new_by_color_select ()
tool->button_press_func = by_color_select_button_press;
tool->button_release_func = by_color_select_button_release;
tool->motion_func = by_color_select_motion;
tool->arrow_keys_func = standard_arrow_keys_func; tool->modifier_key_func = standard_modifier_key_func;
tool->arrow_keys_func = standard_arrow_keys_func;
tool->modifier_key_func = standard_modifier_key_func;
tool->cursor_update_func = by_color_select_cursor_update;
tool->control_func = by_color_select_control;
tool->gdisp_ptr = NULL;

View File

@ -82,12 +82,15 @@ static CloneType non_gui_type;
/* forward function declarations */
static void clone_draw (Tool *);
static void clone_motion (PaintCore *, GimpDrawable *, GimpDrawable *, CloneType, int, int);
static void clone_line_image (GImage *, GImage *, GimpDrawable *, GimpDrawable *, unsigned char *,
unsigned char *, int, int, int, int);
static void clone_line_pattern (GImage *, GimpDrawable *, GPatternP, unsigned char *,
int, int, int, int);
static void clone_draw (Tool *);
static void clone_motion (PaintCore *, GimpDrawable *, GimpDrawable *,
CloneType, int, int);
static void clone_line_image (GImage *, GImage *, GimpDrawable *,
GimpDrawable *, unsigned char *,
unsigned char *, int, int, int, int);
static void clone_line_pattern (GImage *, GimpDrawable *, GPatternP,
unsigned char *, int, int, int, int);
/* functions */
@ -127,19 +130,22 @@ clone_options_new (void)
GtkWidget *radio_frame;
GtkWidget *radio_box;
GtkWidget *radio_button;
int i;
int i;
char *button_names[2] =
static gchar *source_names[] =
{
N_("Image Source"),
N_("Pattern Source")
};
char *align_names[3] =
static gint n_source_names = sizeof (source_names) / sizeof (source_names[0]);
static gchar *align_names[] =
{
N_("Non Aligned"),
N_("Aligned"),
N_("Registered")
};
static gint n_align_names = sizeof (align_names) / sizeof (align_names[0]);
/* the new clone tool options structure */
options = (CloneOptions *) g_malloc (sizeof (CloneOptions));
@ -161,10 +167,10 @@ clone_options_new (void)
gtk_container_add (GTK_CONTAINER (radio_frame), radio_box);
/* the radio buttons */
for (i = 0; i < 2; i++)
for (i = 0; i < n_source_names; i++)
{
radio_button = gtk_radio_button_new_with_label (group,
gettext(button_names[i]));
gettext(source_names[i]));
group = gtk_radio_button_group (GTK_RADIO_BUTTON (radio_button));
gtk_signal_connect (GTK_OBJECT (radio_button), "toggled",
(GtkSignalFunc) clone_type_callback,
@ -187,7 +193,7 @@ clone_options_new (void)
/* the radio buttons */
group = NULL;
for (i = 0; i < 3; i++)
for (i = 0; i < n_align_names; i++)
{
radio_button = gtk_radio_button_new_with_label (group, align_names[i]);
group = gtk_radio_button_group (GTK_RADIO_BUTTON (radio_button));
@ -206,14 +212,14 @@ clone_options_new (void)
}
static void
clone_src_drawable_destroyed_cb(GimpDrawable *drawable,
GimpDrawable **src_drawable)
clone_src_drawable_destroyed_cb (GimpDrawable *drawable,
GimpDrawable **src_drawable)
{
if (drawable == *src_drawable)
{
*src_drawable = NULL;
the_src_gdisp = NULL;
}
{
*src_drawable = NULL;
the_src_gdisp = NULL;
}
}
static void
@ -235,9 +241,9 @@ clone_set_src_drawable(GimpDrawable *drawable)
void *
clone_paint_func (PaintCore *paint_core,
clone_paint_func (PaintCore *paint_core,
GimpDrawable *drawable,
int state)
int state)
{
GDisplay * gdisp;
GDisplay * src_gdisp;
@ -345,10 +351,9 @@ clone_paint_func (PaintCore *paint_core,
}
void
clone_cursor_update (tool, mevent, gdisp_ptr)
Tool *tool;
GdkEventMotion *mevent;
gpointer gdisp_ptr;
clone_cursor_update (Tool *tool,
GdkEventMotion *mevent,
gpointer gdisp_ptr)
{
GDisplay *gdisp;
Layer *layer;
@ -435,12 +440,12 @@ clone_draw (Tool *tool)
}
static void
clone_motion (PaintCore *paint_core,
clone_motion (PaintCore *paint_core,
GimpDrawable *drawable,
GimpDrawable *src_drawable,
CloneType type,
int offset_x,
int offset_y)
CloneType type,
int offset_x,
int offset_y)
{
GImage *gimage;
GImage *src_gimage = NULL;

View File

@ -57,29 +57,32 @@ static ColorBalanceDialog *color_balance_dialog = NULL;
/* color balance action functions */
static void color_balance_button_press (Tool *, GdkEventButton *, gpointer);
static void color_balance_button_release (Tool *, GdkEventButton *, gpointer);
static void color_balance_motion (Tool *, GdkEventMotion *, gpointer);
static void color_balance_cursor_update (Tool *, GdkEventMotion *, gpointer);
static void color_balance_control (Tool *, int, gpointer);
static void color_balance_control (Tool *, ToolAction, gpointer);
static ColorBalanceDialog * color_balance_new_dialog (void);
static void color_balance_update (ColorBalanceDialog *, int);
static void color_balance_preview (ColorBalanceDialog *);
static void color_balance_ok_callback (GtkWidget *, gpointer);
static void color_balance_cancel_callback (GtkWidget *, gpointer);
static gint color_balance_delete_callback (GtkWidget *, GdkEvent *, gpointer);
static void color_balance_shadows_callback (GtkWidget *, gpointer);
static void color_balance_midtones_callback (GtkWidget *, gpointer);
static void color_balance_highlights_callback (GtkWidget *, gpointer);
static void color_balance_preserve_update (GtkWidget *, gpointer);
static void color_balance_preview_update (GtkWidget *, gpointer);
static void color_balance_cr_scale_update (GtkAdjustment *, gpointer);
static void color_balance_mg_scale_update (GtkAdjustment *, gpointer);
static void color_balance_yb_scale_update (GtkAdjustment *, gpointer);
static void color_balance_cr_text_update (GtkWidget *, gpointer);
static void color_balance_mg_text_update (GtkWidget *, gpointer);
static void color_balance_yb_text_update (GtkWidget *, gpointer);
static ColorBalanceDialog * color_balance_new_dialog (void);
static void color_balance_update (ColorBalanceDialog *, int);
static void color_balance_preview (ColorBalanceDialog *);
static void color_balance_ok_callback (GtkWidget *, gpointer);
static void color_balance_cancel_callback (GtkWidget *, gpointer);
static gint color_balance_delete_callback (GtkWidget *, GdkEvent *,
gpointer);
static void color_balance_shadows_callback (GtkWidget *, gpointer);
static void color_balance_midtones_callback (GtkWidget *, gpointer);
static void color_balance_highlights_callback (GtkWidget *, gpointer);
static void color_balance_preserve_update (GtkWidget *, gpointer);
static void color_balance_preview_update (GtkWidget *, gpointer);
static void color_balance_cr_scale_update (GtkAdjustment *, gpointer);
static void color_balance_mg_scale_update (GtkAdjustment *, gpointer);
static void color_balance_yb_scale_update (GtkAdjustment *, gpointer);
static void color_balance_cr_text_update (GtkWidget *, gpointer);
static void color_balance_mg_text_update (GtkWidget *, gpointer);
static void color_balance_yb_text_update (GtkWidget *, gpointer);
/* color balance machinery */
@ -183,9 +186,9 @@ color_balance_cursor_update (Tool *tool,
}
static void
color_balance_control (Tool *tool,
int action,
gpointer gdisp_ptr)
color_balance_control (Tool *tool,
ToolAction action,
gpointer gdisp_ptr)
{
ColorBalance * color_bal;
@ -193,11 +196,13 @@ color_balance_control (Tool *tool,
switch (action)
{
case PAUSE :
case PAUSE:
break;
case RESUME :
case RESUME:
break;
case HALT :
case HALT:
if (color_balance_dialog)
{
active_tool->preserve = TRUE;
@ -207,6 +212,9 @@ color_balance_control (Tool *tool,
color_balance_cancel_callback (NULL, (gpointer) color_balance_dialog);
}
break;
default:
break;
}
}

View File

@ -68,7 +68,7 @@ struct _ColourPickerTool
static ColorPickerOptions * color_picker_options = NULL;
/* the color value */
int col_value[5] = { 0, 0, 0, 0, 0 };
int col_value[5] = { 0, 0, 0, 0, 0 };
/* the color picker dialog */
static GimpDrawable * active_drawable;
@ -85,14 +85,15 @@ static char hex_buf [MAX_INFO_BUF];
/* local function prototypes */
static void color_picker_button_press (Tool *, GdkEventButton *, gpointer);
static void color_picker_button_release (Tool *, GdkEventButton *, gpointer);
static void color_picker_motion (Tool *, GdkEventMotion *, gpointer);
static void color_picker_cursor_update (Tool *, GdkEventMotion *, gpointer);
static void color_picker_control (Tool *, int, void *);
static void color_picker_info_window_close_callback (GtkWidget *, gpointer);
static void color_picker_info_update (Tool *, int);
static void color_picker_button_press (Tool *, GdkEventButton *, gpointer);
static void color_picker_button_release (Tool *, GdkEventButton *, gpointer);
static void color_picker_motion (Tool *, GdkEventMotion *, gpointer);
static void color_picker_cursor_update (Tool *, GdkEventMotion *, gpointer);
static void color_picker_control (Tool *, ToolAction, gpointer);
static void color_picker_info_window_close_callback (GtkWidget *, gpointer);
static void color_picker_info_update (Tool *, int);
/* functions */
@ -124,7 +125,7 @@ color_picker_options_new (void)
/* the new color picker tool options structure */
options = (ColorPickerOptions *) g_malloc (sizeof (ColorPickerOptions));
tool_options_init ((ToolOptions *) options,
N_("Color Picker Options"),
_("Color Picker Options"),
color_picker_options_reset);
options->sample_merged = options->sample_merged_d = FALSE;
options->sample_average = options->sample_average_d = FALSE;
@ -378,9 +379,9 @@ color_picker_cursor_update (Tool *tool,
}
static void
color_picker_control (Tool *tool,
int action,
gpointer gdisp_ptr)
color_picker_control (Tool *tool,
ToolAction action,
gpointer gdisp_ptr)
{
ColourPickerTool * cp_tool;
@ -391,12 +392,17 @@ color_picker_control (Tool *tool,
case PAUSE :
draw_core_pause (cp_tool->core, tool);
break;
case RESUME :
draw_core_resume (cp_tool->core, tool);
break;
case HALT :
draw_core_stop (cp_tool->core, tool);
break;
default:
break;
}
}
@ -620,10 +626,12 @@ tools_new_color_picker ()
tool->scroll_lock = 0; /* Allow scrolling */
tool->auto_snap_to = TRUE;
tool->private = private;
tool->button_press_func = color_picker_button_press;
tool->button_release_func = color_picker_button_release;
tool->motion_func = color_picker_motion;
tool->arrow_keys_func = standard_arrow_keys_func; tool->modifier_key_func = standard_modifier_key_func;
tool->arrow_keys_func = standard_arrow_keys_func;
tool->modifier_key_func = standard_modifier_key_func;
tool->cursor_update_func = color_picker_cursor_update;
tool->control_func = color_picker_control;
tool->preserve = TRUE;
@ -649,12 +657,12 @@ tools_free_color_picker (Tool *tool)
color_picker_info = NULL;
}
g_free(cp_tool);
g_free (cp_tool);
}
static void
color_picker_info_window_close_callback (GtkWidget *w,
gpointer client_data)
color_picker_info_window_close_callback (GtkWidget *widget,
gpointer client_data)
{
info_dialog_popdown ((InfoDialog *) client_data);
}

View File

@ -52,24 +52,24 @@
typedef struct _Crop Crop;
struct _Crop
{
DrawCore * core; /* Core select object */
DrawCore * core; /* Core select object */
int startx; /* starting x coord */
int starty; /* starting y coord */
int startx; /* starting x coord */
int starty; /* starting y coord */
int lastx; /* previous x coord */
int lasty; /* previous y coord */
int lastx; /* previous x coord */
int lasty; /* previous y coord */
int x1, y1; /* upper left hand coordinate */
int x2, y2; /* lower right hand coords */
int x1, y1; /* upper left hand coordinate */
int x2, y2; /* lower right hand coords */
int srw, srh; /* width and height of corners */
int srw, srh; /* width and height of corners */
int tx1, ty1; /* transformed coords */
int tx2, ty2; /* */
int tx1, ty1; /* transformed coords */
int tx2, ty2; /* */
int function; /* moving or resizing */
guint context_id; /* for the statusbar */
int function; /* moving or resizing */
guint context_id; /* for the statusbar */
};
typedef struct _CropOptions CropOptions;
@ -109,9 +109,9 @@ static void crop_button_press (Tool *, GdkEventButton *, gpointer);
static void crop_button_release (Tool *, GdkEventButton *, gpointer);
static void crop_motion (Tool *, GdkEventMotion *, gpointer);
static void crop_cursor_update (Tool *, GdkEventMotion *, gpointer);
static void crop_control (Tool *, int, gpointer);
static void crop_arrow_keys_func (Tool *, GdkEventKey *, gpointer);
static void crop_modifier_key_func (Tool *, GdkEventKey *, gpointer);
static void crop_control (Tool *, ToolAction, gpointer);
static void crop_arrow_keys_func (Tool *, GdkEventKey *, gpointer);
static void crop_modifier_key_func (Tool *, GdkEventKey *, gpointer);
/* Crop helper functions */
static void crop_recalc (Tool *, Crop *);
@ -172,7 +172,7 @@ crop_options_new (void)
/* the new crop tool options structure */
options = (CropOptions *) g_malloc (sizeof (CropOptions));
tool_options_init ((ToolOptions *) options,
N_("Crop & Resize Options"),
_("Crop & Resize Options"),
crop_options_reset);
options->layer_only = options->layer_only_d = FALSE;
options->allow_enlarge = options->allow_enlarge_d = FALSE;
@ -661,9 +661,9 @@ crop_modifier_key_func (Tool *tool,
}
static void
crop_control (Tool *tool,
int action,
gpointer gdisp_ptr)
crop_control (Tool *tool,
ToolAction action,
gpointer gdisp_ptr)
{
Crop * crop;
@ -674,14 +674,19 @@ crop_control (Tool *tool,
case PAUSE :
draw_core_pause (crop->core, tool);
break;
case RESUME :
crop_recalc (tool, crop);
draw_core_resume (crop->core, tool);
break;
case HALT :
draw_core_stop (crop->core, tool);
info_dialog_popdown (crop_info);
break;
default:
break;
}
}
@ -1343,11 +1348,11 @@ crop_automatic_callback (GtkWidget *w,
static AutoCropType
crop_guess_bgcolor (GtkObject *get_color_obj,
GetColorFunc get_color_func,
int width,
int height,
int bytes,
int has_alpha,
guchar *color)
int width,
int height,
int bytes,
int has_alpha,
guchar *color)
{
guchar *tl = NULL;
guchar *tr = NULL;
@ -1411,7 +1416,7 @@ crop_guess_bgcolor (GtkObject *get_color_obj,
static int
crop_colors_equal (guchar *col1,
guchar *col2,
int bytes)
int bytes)
{
int equal = TRUE;
int b;
@ -1429,7 +1434,7 @@ crop_colors_equal (guchar *col1,
static int
crop_colors_alpha (guchar *dummy,
guchar *col,
int bytes)
int bytes)
{
if (col[bytes-1] == 0)
return TRUE;

View File

@ -91,32 +91,33 @@ static CRMatrix CR_basis =
/* curves action functions */
static void curves_button_press (Tool *, GdkEventButton *, gpointer);
static void curves_button_release (Tool *, GdkEventButton *, gpointer);
static void curves_motion (Tool *, GdkEventMotion *, gpointer);
static void curves_cursor_update (Tool *, GdkEventMotion *, gpointer);
static void curves_control (Tool *, int, gpointer);
static void curves_control (Tool *, ToolAction, gpointer);
static CurvesDialog * curves_new_dialog (void);
static void curves_update (CurvesDialog *, int);
static void curves_plot_curve (CurvesDialog *, int, int, int, int);
static void curves_preview (CurvesDialog *);
static void curves_value_callback (GtkWidget *, gpointer);
static void curves_red_callback (GtkWidget *, gpointer);
static void curves_green_callback (GtkWidget *, gpointer);
static void curves_blue_callback (GtkWidget *, gpointer);
static void curves_alpha_callback (GtkWidget *, gpointer);
static void curves_smooth_callback (GtkWidget *, gpointer);
static void curves_free_callback (GtkWidget *, gpointer);
static void curves_reset_callback (GtkWidget *, gpointer);
static void curves_ok_callback (GtkWidget *, gpointer);
static void curves_cancel_callback (GtkWidget *, gpointer);
static gint curves_delete_callback (GtkWidget *, GdkEvent *, gpointer);
static void curves_preview_update (GtkWidget *, gpointer);
static gint curves_xrange_events (GtkWidget *, GdkEvent *, CurvesDialog *);
static gint curves_yrange_events (GtkWidget *, GdkEvent *, CurvesDialog *);
static gint curves_graph_events (GtkWidget *, GdkEvent *, CurvesDialog *);
static void curves_CR_compose (CRMatrix, CRMatrix, CRMatrix);
static CurvesDialog * curves_new_dialog (void);
static void curves_update (CurvesDialog *, int);
static void curves_plot_curve (CurvesDialog *, int, int, int, int);
static void curves_preview (CurvesDialog *);
static void curves_value_callback (GtkWidget *, gpointer);
static void curves_red_callback (GtkWidget *, gpointer);
static void curves_green_callback (GtkWidget *, gpointer);
static void curves_blue_callback (GtkWidget *, gpointer);
static void curves_alpha_callback (GtkWidget *, gpointer);
static void curves_smooth_callback (GtkWidget *, gpointer);
static void curves_free_callback (GtkWidget *, gpointer);
static void curves_reset_callback (GtkWidget *, gpointer);
static void curves_ok_callback (GtkWidget *, gpointer);
static void curves_cancel_callback (GtkWidget *, gpointer);
static gint curves_delete_callback (GtkWidget *, GdkEvent *, gpointer);
static void curves_preview_update (GtkWidget *, gpointer);
static gint curves_xrange_events (GtkWidget *, GdkEvent *, CurvesDialog *);
static gint curves_yrange_events (GtkWidget *, GdkEvent *, CurvesDialog *);
static gint curves_graph_events (GtkWidget *, GdkEvent *, CurvesDialog *);
static void curves_CR_compose (CRMatrix, CRMatrix, CRMatrix);
/* curves machinery */
@ -174,7 +175,7 @@ curves_button_press (Tool *tool,
gdisp = gdisp_ptr;
drawable = gimage_active_drawable (gdisp->gimage);
if(drawable != tool->drawable)
if (drawable != tool->drawable)
{
active_tool->preserve = TRUE;
image_map_abort (curves_dialog->image_map);
@ -186,15 +187,14 @@ curves_button_press (Tool *tool,
if(tool)
tool->state = ACTIVE;
}
static void
curves_colour_update(Tool *tool,
GDisplay *gdisp,
GimpDrawable *drawable,
gint x,
gint y)
curves_colour_update (Tool *tool,
GDisplay *gdisp,
GimpDrawable *drawable,
gint x,
gint y)
{
unsigned char *color;
int offx, offy;
@ -334,9 +334,9 @@ curves_cursor_update (Tool *tool,
}
static void
curves_control (Tool *tool,
int action,
gpointer gdisp_ptr)
curves_control (Tool *tool,
ToolAction action,
gpointer gdisp_ptr)
{
Curves * _curves;
@ -346,8 +346,10 @@ curves_control (Tool *tool,
{
case PAUSE :
break;
case RESUME :
break;
case HALT :
if (curves_dialog)
{
@ -358,6 +360,9 @@ curves_control (Tool *tool,
curves_cancel_callback (NULL, (gpointer) curves_dialog);
}
break;
default:
break;
}
}
@ -386,7 +391,8 @@ tools_new_curves ()
tool->button_press_func = curves_button_press;
tool->button_release_func = curves_button_release;
tool->motion_func = curves_motion;
tool->arrow_keys_func = standard_arrow_keys_func; tool->modifier_key_func = standard_modifier_key_func;
tool->arrow_keys_func = standard_arrow_keys_func;
tool->modifier_key_func = standard_modifier_key_func;
tool->cursor_update_func = curves_cursor_update;
tool->control_func = curves_control;
tool->preserve = TRUE;

View File

@ -35,9 +35,8 @@
#define ARROW_VELOCITY 25
#define STATUSBAR_SIZE 128
typedef struct _edit_selection EditSelection;
struct _edit_selection
typedef struct _EditSelection EditSelection;
struct _EditSelection
{
int origx, origy; /* last x and y coords */
int cumlx, cumly; /* cumulative changes to x and yed */
@ -626,22 +625,27 @@ edit_selection_draw (Tool *tool)
void
edit_selection_control (Tool *tool,
int action,
gpointer gdisp_ptr)
edit_selection_control (Tool *tool,
ToolAction action,
gpointer gdisp_ptr)
{
switch (action)
{
case PAUSE :
draw_core_pause (edit_select.core, tool);
break;
case RESUME :
draw_core_resume (edit_select.core, tool);
break;
case HALT :
draw_core_stop (edit_select.core, tool);
draw_core_free (edit_select.core);
break;
default:
break;
}
}

View File

@ -31,12 +31,12 @@ typedef enum
/* action functions */
void edit_selection_button_release (Tool *, GdkEventButton *, gpointer);
void edit_selection_motion (Tool *, GdkEventMotion *, gpointer);
void edit_selection_control (Tool *, int, gpointer);
void edit_selection_control (Tool *, ToolAction, gpointer);
void edit_selection_cursor_update (Tool *, GdkEventMotion *, gpointer);
void edit_selection_draw (Tool *);
void edit_sel_arrow_keys_func (Tool *, GdkEventKey *, gpointer);
void edit_sel_arrow_keys_func (Tool *, GdkEventKey *, gpointer);
void init_edit_selection (Tool *, gpointer, GdkEventButton *, EditType);
void init_edit_selection (Tool *, gpointer, GdkEventButton *,
EditType);
#endif /* __EDIT_SELECTION_H__ */

View File

@ -36,14 +36,13 @@
/* the free selection structures */
typedef struct _free_select FreeSelect;
struct _free_select
typedef struct _FreeSelect FreeSelect;
struct _FreeSelect
{
DrawCore * core; /* Core select object */
DrawCore * core; /* Core select object */
int op; /* selection operation (ADD, SUB, etc) */
int num_pts; /* Number of points in the polygon */
int op; /* selection operation (ADD, SUB, etc) */
int num_pts; /* Number of points in the polygon */
};
struct _FreeSelectPoint
@ -403,7 +402,9 @@ free_select_motion (Tool *tool, GdkEventMotion *mevent, gpointer gdisp_ptr)
}
static void
free_select_control (Tool *tool, int action, gpointer gdisp_ptr)
free_select_control (Tool *tool,
ToolAction action,
gpointer gdisp_ptr)
{
FreeSelect * free_sel;
@ -414,12 +415,17 @@ free_select_control (Tool *tool, int action, gpointer gdisp_ptr)
case PAUSE :
draw_core_pause (free_sel->core, tool);
break;
case RESUME :
draw_core_resume (free_sel->core, tool);
break;
case HALT :
draw_core_stop (free_sel->core, tool);
break;
default:
break;
}
}

View File

@ -34,29 +34,29 @@
/* the fuzzy selection structures */
typedef struct _fuzzy_select FuzzySelect;
struct _fuzzy_select
typedef struct _FuzzySelect FuzzySelect;
struct _FuzzySelect
{
DrawCore * core; /* Core select object */
DrawCore * core; /* Core select object */
int op; /* selection operation (ADD, SUB, etc) */
int op; /* selection operation (ADD, SUB, etc) */
int x, y; /* Point from which to execute seed fill */
int last_x; /* */
int last_y; /* variables to keep track of sensitivity */
int threshold; /* threshold value for soft seed fill */
int x, y; /* Point from which to execute seed fill */
int last_x; /* */
int last_y; /* variables to keep track of sensitivity */
int threshold; /* threshold value for soft seed fill */
};
/* the fuzzy selection tool options */
static SelectionOptions *fuzzy_options = NULL;
static SelectionOptions * fuzzy_options = NULL;
/* XSegments which make up the fuzzy selection boundary */
static GdkSegment *segs = NULL;
static int num_segs = 0;
static GdkSegment * segs = NULL;
static int num_segs = 0;
Channel *fuzzy_mask = NULL;
Channel * fuzzy_mask = NULL;
/* fuzzy select action functions */
@ -64,7 +64,7 @@ static void fuzzy_select_button_press (Tool *, GdkEventButton *, gpointer);
static void fuzzy_select_button_release (Tool *, GdkEventButton *, gpointer);
static void fuzzy_select_motion (Tool *, GdkEventMotion *, gpointer);
static void fuzzy_select_draw (Tool *);
static void fuzzy_select_control (Tool *, int, gpointer);
static void fuzzy_select_control (Tool *, ToolAction, gpointer);
/* fuzzy select action functions */
static GdkSegment * fuzzy_select_calculate (Tool *, void *, int *);
@ -511,7 +511,9 @@ fuzzy_select_draw (Tool *tool)
}
static void
fuzzy_select_control (Tool *tool, int action, gpointer gdisp_ptr)
fuzzy_select_control (Tool *tool,
ToolAction action,
gpointer gdisp_ptr)
{
FuzzySelect * fuzzy_sel;
@ -522,12 +524,17 @@ fuzzy_select_control (Tool *tool, int action, gpointer gdisp_ptr)
case PAUSE :
draw_core_pause (fuzzy_sel->core, tool);
break;
case RESUME :
draw_core_resume (fuzzy_sel->core, tool);
break;
case HALT :
draw_core_stop (fuzzy_sel->core, tool);
break;
default:
break;
}
}
@ -565,7 +572,8 @@ tools_new_fuzzy_select (void)
tool->button_press_func = fuzzy_select_button_press;
tool->button_release_func = fuzzy_select_button_release;
tool->motion_func = fuzzy_select_motion;
tool->arrow_keys_func = standard_arrow_keys_func; tool->modifier_key_func = standard_modifier_key_func;
tool->arrow_keys_func = standard_arrow_keys_func;
tool->modifier_key_func = standard_modifier_key_func;
tool->cursor_update_func = rect_select_cursor_update;
tool->control_func = fuzzy_select_control;

View File

@ -45,16 +45,16 @@
#include "tile.h"
/* target size */
#define TARGET_HEIGHT 15
#define TARGET_WIDTH 15
#define TARGET_HEIGHT 15
#define TARGET_WIDTH 15
#define SQR(x) ((x) * (x))
#ifndef M_PI
#define M_PI 3.14159265358979323846
#define M_PI 3.14159265358979323846
#endif /* M_PI */
#define STATUSBAR_SIZE 128
#define STATUSBAR_SIZE 128
/* the blend structures */
@ -63,14 +63,14 @@ typedef double (*RepeatFunc)(double);
typedef struct _BlendTool BlendTool;
struct _BlendTool
{
DrawCore * core; /* Core select object */
DrawCore * core; /* Core select object */
int startx; /* starting x coord */
int starty; /* starting y coord */
int startx; /* starting x coord */
int starty; /* starting y coord */
int endx; /* ending x coord */
int endy; /* ending y coord */
guint context_id; /* for the statusbar */
int endx; /* ending x coord */
int endy; /* ending y coord */
guint context_id; /* for the statusbar */
};
typedef struct _BlendOptions BlendOptions;
@ -107,7 +107,8 @@ struct _BlendOptions
GtkObject *threshold_w;
};
typedef struct {
typedef struct
{
double offset;
double sx, sy;
BlendMode blend_mode;
@ -118,7 +119,8 @@ typedef struct {
RepeatFunc repeat_func;
} RenderBlendData;
typedef struct {
typedef struct
{
PixelRegion *PR;
unsigned char *row_data;
int bytes;
@ -143,15 +145,16 @@ static PixelRegion distR =
/* local function prototypes */
static void gradient_type_callback (GtkWidget *, gpointer);
static void blend_mode_callback (GtkWidget *, gpointer);
static void repeat_type_callback (GtkWidget *, gpointer);
static void blend_button_press (Tool *, GdkEventButton *, gpointer);
static void blend_button_release (Tool *, GdkEventButton *, gpointer);
static void blend_motion (Tool *, GdkEventMotion *, gpointer);
static void blend_cursor_update (Tool *, GdkEventMotion *, gpointer);
static void blend_control (Tool *, int, gpointer);
static void blend_button_press (Tool *, GdkEventButton *, gpointer);
static void blend_button_release (Tool *, GdkEventButton *, gpointer);
static void blend_motion (Tool *, GdkEventMotion *, gpointer);
static void blend_cursor_update (Tool *, GdkEventMotion *, gpointer);
static void blend_control (Tool *, ToolAction, gpointer);
static double gradient_calc_conical_sym_factor (double dist, double *axis, double offset,
double x, double y);
@ -717,9 +720,9 @@ blend_draw (Tool *tool)
}
static void
blend_control (Tool *tool,
int action,
gpointer gdisp_ptr)
blend_control (Tool *tool,
ToolAction action,
gpointer gdisp_ptr)
{
BlendTool * blend_tool;
@ -727,15 +730,20 @@ blend_control (Tool *tool,
switch (action)
{
case PAUSE :
case PAUSE:
draw_core_pause (blend_tool->core, tool);
break;
case RESUME :
case RESUME:
draw_core_resume (blend_tool->core, tool);
break;
case HALT :
case HALT:
draw_core_stop (blend_tool->core, tool);
break;
default:
break;
}
}

View File

@ -86,7 +86,7 @@ static void brightness_contrast_button_press (Tool *, GdkEventButton *, gpoi
static void brightness_contrast_button_release (Tool *, GdkEventButton *, gpointer);
static void brightness_contrast_motion (Tool *, GdkEventMotion *, gpointer);
static void brightness_contrast_cursor_update (Tool *, GdkEventMotion *, gpointer);
static void brightness_contrast_control (Tool *, int, gpointer);
static void brightness_contrast_control (Tool *, ToolAction, gpointer);
static BrightnessContrastDialog * brightness_contrast_new_dialog (void);
static void brightness_contrast_update (BrightnessContrastDialog *, int);
@ -140,17 +140,19 @@ brightness_contrast_cursor_update (Tool *tool,
}
static void
brightness_contrast_control (Tool *tool,
int action,
gpointer gdisp_ptr)
brightness_contrast_control (Tool *tool,
ToolAction action,
gpointer gdisp_ptr)
{
switch (action)
{
case PAUSE :
case PAUSE:
break;
case RESUME :
case RESUME:
break;
case HALT :
case HALT:
if (brightness_contrast_dialog)
{
active_tool->preserve = TRUE;
@ -160,6 +162,9 @@ brightness_contrast_control (Tool *tool,
brightness_contrast_cancel_callback (NULL, (gpointer) brightness_contrast_dialog);
}
break;
default:
break;
}
}
@ -189,7 +194,8 @@ tools_new_brightness_contrast ()
tool->button_press_func = brightness_contrast_button_press;
tool->button_release_func = brightness_contrast_button_release;
tool->motion_func = brightness_contrast_motion;
tool->arrow_keys_func = standard_arrow_keys_func; tool->modifier_key_func = standard_modifier_key_func;
tool->arrow_keys_func = standard_arrow_keys_func;
tool->modifier_key_func = standard_modifier_key_func;
tool->cursor_update_func = brightness_contrast_cursor_update;
tool->control_func = brightness_contrast_control;
tool->preserve = FALSE;
@ -583,5 +589,3 @@ brightness_contrast_contrast_text_update (GtkWidget *w,
brightness_contrast_preview (bcd);
}
}

View File

@ -42,8 +42,8 @@
typedef struct _BucketTool BucketTool;
struct _BucketTool
{
int target_x; /* starting x coord */
int target_y; /* starting y coord */
int target_x; /* starting x coord */
int target_y; /* starting y coord */
};
typedef struct _BucketOptions BucketOptions;
@ -70,15 +70,16 @@ static BucketOptions *bucket_options = NULL;
/* local function prototypes */
static void bucket_fill_button_press (Tool *, GdkEventButton *, gpointer);
static void bucket_fill_button_release (Tool *, GdkEventButton *, gpointer);
static void bucket_fill_motion (Tool *, GdkEventMotion *, gpointer);
static void bucket_fill_cursor_update (Tool *, GdkEventMotion *, gpointer);
static void bucket_fill_control (Tool *, int, gpointer);
static void bucket_fill_control (Tool *, ToolAction, gpointer);
static void bucket_fill_region (BucketFillMode, PixelRegion *, PixelRegion *,
unsigned char *, TempBuf *,
int, int, int);
static void bucket_fill_region (BucketFillMode, PixelRegion *,
PixelRegion *, unsigned char *,
TempBuf *, int, int, int);
static void bucket_fill_line_color (unsigned char *, unsigned char *,
unsigned char *, int, int, int);
static void bucket_fill_line_pattern (unsigned char *, unsigned char *,
@ -317,13 +318,12 @@ bucket_fill_modifier_key_func (Tool *tool,
}
static void
bucket_fill_control (Tool *tool,
int action,
gpointer gdisp_ptr)
bucket_fill_control (Tool *tool,
ToolAction action,
gpointer gdisp_ptr)
{
}
void
bucket_fill (GimpImage *gimage,
GimpDrawable *drawable,
@ -588,7 +588,6 @@ bucket_fill_region (BucketFillMode fill_mode,
/* Global bucket fill functions */
/*********************************/
Tool *
tools_new_bucket_fill (void)
{
@ -626,7 +625,6 @@ tools_new_bucket_fill (void)
return tool;
}
void
tools_free_bucket_fill (Tool *tool)
{

View File

@ -27,6 +27,7 @@
#include "general.h"
#include "gimage_mask.h"
#include "gimprc.h"
#include "gimpset.h"
#include "gdisplay.h"
#include "selection_options.h"
@ -46,8 +47,8 @@
typedef struct _ByColorSelect ByColorSelect;
struct _ByColorSelect
{
int x, y; /* Point from which to execute seed fill */
int operation; /* add, subtract, normal color selection */
int x, y; /* Point from which to execute seed fill */
int operation; /* add, subtract, normal color selection */
};
typedef struct _ByColorDialog ByColorDialog;
@ -57,9 +58,9 @@ struct _ByColorDialog
GtkWidget *preview;
GtkWidget *gimage_name;
int threshold; /* threshold value for color select */
int operation; /* Add, Subtract, Replace */
GImage *gimage; /* gimage which is currently under examination */
int threshold; /* threshold value for color select */
int operation; /* Add, Subtract, Replace */
GImage *gimage; /* gimage which is currently under examination */
};
@ -71,26 +72,31 @@ static ByColorDialog * by_color_dialog = NULL;
/* by_color select action functions */
static void by_color_select_button_press (Tool *, GdkEventButton *, gpointer);
static void by_color_select_button_release (Tool *, GdkEventButton *, gpointer);
static void by_color_select_motion (Tool *, GdkEventMotion *, gpointer);
static void by_color_select_cursor_update (Tool *, GdkEventMotion *, gpointer);
static void by_color_select_control (Tool *, int, gpointer);
static ByColorDialog * by_color_select_new_dialog (void);
static void by_color_select_render (ByColorDialog *, GImage *);
static void by_color_select_draw (ByColorDialog *, GImage *);
static gint by_color_select_preview_events (GtkWidget *, GdkEventButton *, ByColorDialog *);
static void by_color_select_type_callback (GtkWidget *, gpointer);
static void by_color_select_reset_callback (GtkWidget *, gpointer);
static void by_color_select_close_callback (GtkWidget *, gpointer);
static gint by_color_select_delete_callback (GtkWidget *, GdkEvent *, gpointer);
static void by_color_select_fuzzy_update (GtkAdjustment *, gpointer);
static void by_color_select_preview_button_press (ByColorDialog *, GdkEventButton *);
static void by_color_select_button_press (Tool *, GdkEventButton *, gpointer);
static void by_color_select_button_release (Tool *, GdkEventButton *, gpointer);
static void by_color_select_motion (Tool *, GdkEventMotion *, gpointer);
static void by_color_select_cursor_update (Tool *, GdkEventMotion *, gpointer);
static void by_color_select_control (Tool *, ToolAction, gpointer);
static ByColorDialog * by_color_select_new_dialog (void);
static void by_color_select_render (ByColorDialog *, GImage *);
static void by_color_select_draw (ByColorDialog *, GImage *);
static gint by_color_select_preview_events (GtkWidget *, GdkEventButton *,
ByColorDialog *);
static void by_color_select_type_callback (GtkWidget *, gpointer);
static void by_color_select_reset_callback (GtkWidget *, gpointer);
static void by_color_select_close_callback (GtkWidget *, gpointer);
static gint by_color_select_delete_callback (GtkWidget *, GdkEvent *,
gpointer);
static void by_color_select_fuzzy_update (GtkAdjustment *, gpointer);
static void by_color_select_preview_button_press (ByColorDialog *,
GdkEventButton *);
static int is_pixel_sufficiently_different (unsigned char *, unsigned char *, int, int, int, int);
static Channel * by_color_select_color (GImage *, GimpDrawable *, unsigned char *, int, int, int);
/* by_color selection machinery */
static int
@ -418,9 +424,9 @@ by_color_select_cursor_update (Tool *tool,
}
static void
by_color_select_control (Tool *tool,
int action,
gpointer gdisp_ptr)
by_color_select_control (Tool *tool,
ToolAction action,
gpointer gdisp_ptr)
{
ByColorSelect * by_color_sel;
@ -430,17 +436,23 @@ by_color_select_control (Tool *tool,
{
case PAUSE :
break;
case RESUME :
break;
case HALT :
if (by_color_dialog)
{
if (by_color_dialog->gimage)
if (by_color_dialog->gimage &&
gimp_set_have (image_context, by_color_dialog->gimage))
by_color_dialog->gimage->by_color_select = FALSE;
by_color_dialog->gimage = NULL;
by_color_select_close_callback (NULL, (gpointer) by_color_dialog);
}
break;
default:
break;
}
}
@ -483,7 +495,8 @@ tools_new_by_color_select ()
tool->button_press_func = by_color_select_button_press;
tool->button_release_func = by_color_select_button_release;
tool->motion_func = by_color_select_motion;
tool->arrow_keys_func = standard_arrow_keys_func; tool->modifier_key_func = standard_modifier_key_func;
tool->arrow_keys_func = standard_arrow_keys_func;
tool->modifier_key_func = standard_modifier_key_func;
tool->cursor_update_func = by_color_select_cursor_update;
tool->control_func = by_color_select_control;
tool->gdisp_ptr = NULL;

View File

@ -82,12 +82,15 @@ static CloneType non_gui_type;
/* forward function declarations */
static void clone_draw (Tool *);
static void clone_motion (PaintCore *, GimpDrawable *, GimpDrawable *, CloneType, int, int);
static void clone_line_image (GImage *, GImage *, GimpDrawable *, GimpDrawable *, unsigned char *,
unsigned char *, int, int, int, int);
static void clone_line_pattern (GImage *, GimpDrawable *, GPatternP, unsigned char *,
int, int, int, int);
static void clone_draw (Tool *);
static void clone_motion (PaintCore *, GimpDrawable *, GimpDrawable *,
CloneType, int, int);
static void clone_line_image (GImage *, GImage *, GimpDrawable *,
GimpDrawable *, unsigned char *,
unsigned char *, int, int, int, int);
static void clone_line_pattern (GImage *, GimpDrawable *, GPatternP,
unsigned char *, int, int, int, int);
/* functions */
@ -127,19 +130,22 @@ clone_options_new (void)
GtkWidget *radio_frame;
GtkWidget *radio_box;
GtkWidget *radio_button;
int i;
int i;
char *button_names[2] =
static gchar *source_names[] =
{
N_("Image Source"),
N_("Pattern Source")
};
char *align_names[3] =
static gint n_source_names = sizeof (source_names) / sizeof (source_names[0]);
static gchar *align_names[] =
{
N_("Non Aligned"),
N_("Aligned"),
N_("Registered")
};
static gint n_align_names = sizeof (align_names) / sizeof (align_names[0]);
/* the new clone tool options structure */
options = (CloneOptions *) g_malloc (sizeof (CloneOptions));
@ -161,10 +167,10 @@ clone_options_new (void)
gtk_container_add (GTK_CONTAINER (radio_frame), radio_box);
/* the radio buttons */
for (i = 0; i < 2; i++)
for (i = 0; i < n_source_names; i++)
{
radio_button = gtk_radio_button_new_with_label (group,
gettext(button_names[i]));
gettext(source_names[i]));
group = gtk_radio_button_group (GTK_RADIO_BUTTON (radio_button));
gtk_signal_connect (GTK_OBJECT (radio_button), "toggled",
(GtkSignalFunc) clone_type_callback,
@ -187,7 +193,7 @@ clone_options_new (void)
/* the radio buttons */
group = NULL;
for (i = 0; i < 3; i++)
for (i = 0; i < n_align_names; i++)
{
radio_button = gtk_radio_button_new_with_label (group, align_names[i]);
group = gtk_radio_button_group (GTK_RADIO_BUTTON (radio_button));
@ -206,14 +212,14 @@ clone_options_new (void)
}
static void
clone_src_drawable_destroyed_cb(GimpDrawable *drawable,
GimpDrawable **src_drawable)
clone_src_drawable_destroyed_cb (GimpDrawable *drawable,
GimpDrawable **src_drawable)
{
if (drawable == *src_drawable)
{
*src_drawable = NULL;
the_src_gdisp = NULL;
}
{
*src_drawable = NULL;
the_src_gdisp = NULL;
}
}
static void
@ -235,9 +241,9 @@ clone_set_src_drawable(GimpDrawable *drawable)
void *
clone_paint_func (PaintCore *paint_core,
clone_paint_func (PaintCore *paint_core,
GimpDrawable *drawable,
int state)
int state)
{
GDisplay * gdisp;
GDisplay * src_gdisp;
@ -345,10 +351,9 @@ clone_paint_func (PaintCore *paint_core,
}
void
clone_cursor_update (tool, mevent, gdisp_ptr)
Tool *tool;
GdkEventMotion *mevent;
gpointer gdisp_ptr;
clone_cursor_update (Tool *tool,
GdkEventMotion *mevent,
gpointer gdisp_ptr)
{
GDisplay *gdisp;
Layer *layer;
@ -435,12 +440,12 @@ clone_draw (Tool *tool)
}
static void
clone_motion (PaintCore *paint_core,
clone_motion (PaintCore *paint_core,
GimpDrawable *drawable,
GimpDrawable *src_drawable,
CloneType type,
int offset_x,
int offset_y)
CloneType type,
int offset_x,
int offset_y)
{
GImage *gimage;
GImage *src_gimage = NULL;

Some files were not shown because too many files have changed in this diff Show More