Commit 04f71318 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

added cmd_callbacks for the toolbox and the preferences dialog.

2001-02-24  Michael Natterer  <mitch@gimp.org>

	* app/commands.[ch]: added cmd_callbacks for the toolbox and
	the preferences dialog.

	* app/context_manager.c: cleanup.

	* app/gimppreview.[ch]: made gimp_preview_render() public.

	* app/gimptoolinfopreview.c
	* app/tools/gimptoolinfo.c: the tool previews look nice now but
	are still ugly implemented (it renders tons of temp_bufs on each
	state change).

	* app/indicator_area.[ch]: pass a context to the constructor.

	* app/menus.c: don't call the toolbox and the prefs dialog
	directly but dispatch via commands.[ch]

	* app/preferences_dialog.[ch]
	* app/toolbox.[ch]: renamed the constructor / raise function, cleanup.

	* app/tools/color_picker.c: tried to get the shortcut working again.

	* app/tools/paint_options.c: the brush dialog's paint options
	are shown/hidden from the context manager now.
parent 3eb62f87
2001-02-24 Michael Natterer <mitch@gimp.org>
* app/commands.[ch]: added cmd_callbacks for the toolbox and
the preferences dialog.
* app/context_manager.c: cleanup.
* app/gimppreview.[ch]: made gimp_preview_render() public.
* app/gimptoolinfopreview.c
* app/tools/gimptoolinfo.c: the tool previews look nice now but
are still ugly implemented (it renders tons of temp_bufs on each
state change).
* app/indicator_area.[ch]: pass a context to the constructor.
* app/menus.c: don't call the toolbox and the prefs dialog
directly but dispatch via commands.[ch]
* app/preferences_dialog.[ch]
* app/toolbox.[ch]: renamed the constructor / raise function, cleanup.
* app/tools/color_picker.c: tried to get the shortcut working again.
* app/tools/paint_options.c: the brush dialog's paint options
are shown/hidden from the context manager now.
2001-02-23 Michael Natterer <mitch@gimp.org>
* app/app_procs.c: removed crap from ancient times when tools
......@@ -20,7 +47,7 @@
untranslated string with a meaningful prefix and name, e.g.
"gimp:color_picker_tool". Renamed "tool_name" and "tool_desc"
to "blurb" and "help", changed the constructor accordingly.
Added gimp_tool_info_get_standards() to make the context work
Added gimp_tool_info_get_standard() to make the context work
with tool refresh.
* app/tools/tool_manager.[ch]
......
......@@ -73,10 +73,12 @@
#include "palette.h"
#include "pattern_select.h"
#include "plug_in.h"
#include "preferences_dialog.h"
#include "resize.h"
#include "scale.h"
#include "selection.h"
#include "tips_dialog.h"
#include "toolbox.h"
#include "undo.h"
#include "undo_history.h"
......@@ -1097,6 +1099,13 @@ layers_resize_to_image_cmd_callback (GtkWidget *widget,
/***** Tools *****/
void
tools_toolbox_raise_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
toolbox_raise ();
}
void
tools_default_colors_cmd_callback (GtkWidget *widget,
gpointer client_data)
......@@ -1141,10 +1150,13 @@ tools_select_cmd_callback (GtkWidget *widget,
gpointer callback_data,
guint callback_action)
{
GtkType tool_type;
GimpToolInfo *tool_info;
GDisplay *gdisp;
tool_info = GIMP_TOOL_INFO (callback_action);
tool_type = callback_action;
tool_info = tool_manager_get_info_by_type (tool_type);
gdisp = gdisplay_active ();
gimp_context_set_tool (gimp_context_get_user (), tool_info);
......@@ -1184,6 +1196,13 @@ filters_repeat_cmd_callback (GtkWidget *widget,
/***** Dialogs ******/
void
dialogs_preferences_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
preferences_dialog_create ();
}
void
dialogs_lc_cmd_callback (GtkWidget *widget,
gpointer client_data)
......
......@@ -46,49 +46,49 @@ void edit_fill_cmd_callback (GtkWidget *widget,
guint callback_action);
void edit_stroke_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_feather_cmd_callback (GtkWidget *, gpointer);
void select_sharpen_cmd_callback (GtkWidget *, gpointer);
void select_shrink_cmd_callback (GtkWidget *, gpointer);
void select_border_cmd_callback (GtkWidget *, gpointer);
void select_grow_cmd_callback (GtkWidget *, gpointer);
void select_save_cmd_callback (GtkWidget *, gpointer);
void view_zoomin_cmd_callback (GtkWidget *, gpointer);
void view_zoomout_cmd_callback (GtkWidget *, gpointer);
void view_zoom_16_1_cmd_callback (GtkWidget *, gpointer);
void view_zoom_8_1_cmd_callback (GtkWidget *, gpointer);
void view_zoom_4_1_cmd_callback (GtkWidget *, gpointer);
void view_zoom_2_1_cmd_callback (GtkWidget *, gpointer);
void view_zoom_1_1_cmd_callback (GtkWidget *, gpointer);
void view_zoom_1_2_cmd_callback (GtkWidget *, gpointer);
void view_zoom_1_4_cmd_callback (GtkWidget *, gpointer);
void view_zoom_1_8_cmd_callback (GtkWidget *, gpointer);
void view_zoom_1_16_cmd_callback (GtkWidget *, gpointer);
void view_dot_for_dot_cmd_callback (GtkWidget *, gpointer);
void view_info_window_cmd_callback (GtkWidget *, gpointer);
void view_nav_window_cmd_callback (GtkWidget *, gpointer);
void view_toggle_selection_cmd_callback (GtkWidget *, gpointer);
void view_toggle_rulers_cmd_callback (GtkWidget *, gpointer);
void view_toggle_statusbar_cmd_callback (GtkWidget *, gpointer);
void view_toggle_guides_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_convert_rgb_cmd_callback (GtkWidget *, gpointer);
void image_convert_grayscale_cmd_callback (GtkWidget *, gpointer);
void image_convert_indexed_cmd_callback (GtkWidget *, gpointer);
void image_desaturate_cmd_callback (GtkWidget *, gpointer);
void image_invert_cmd_callback (GtkWidget *, gpointer);
void image_equalize_cmd_callback (GtkWidget *, gpointer);
void image_offset_cmd_callback (GtkWidget *, gpointer);
void image_resize_cmd_callback (GtkWidget *, gpointer);
void image_scale_cmd_callback (GtkWidget *, gpointer);
void image_duplicate_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_feather_cmd_callback (GtkWidget *, gpointer);
void select_sharpen_cmd_callback (GtkWidget *, gpointer);
void select_shrink_cmd_callback (GtkWidget *, gpointer);
void select_border_cmd_callback (GtkWidget *, gpointer);
void select_grow_cmd_callback (GtkWidget *, gpointer);
void select_save_cmd_callback (GtkWidget *, gpointer);
void view_zoomin_cmd_callback (GtkWidget *, gpointer);
void view_zoomout_cmd_callback (GtkWidget *, gpointer);
void view_zoom_16_1_cmd_callback (GtkWidget *, gpointer);
void view_zoom_8_1_cmd_callback (GtkWidget *, gpointer);
void view_zoom_4_1_cmd_callback (GtkWidget *, gpointer);
void view_zoom_2_1_cmd_callback (GtkWidget *, gpointer);
void view_zoom_1_1_cmd_callback (GtkWidget *, gpointer);
void view_zoom_1_2_cmd_callback (GtkWidget *, gpointer);
void view_zoom_1_4_cmd_callback (GtkWidget *, gpointer);
void view_zoom_1_8_cmd_callback (GtkWidget *, gpointer);
void view_zoom_1_16_cmd_callback (GtkWidget *, gpointer);
void view_dot_for_dot_cmd_callback (GtkWidget *, gpointer);
void view_info_window_cmd_callback (GtkWidget *, gpointer);
void view_nav_window_cmd_callback (GtkWidget *, gpointer);
void view_toggle_selection_cmd_callback (GtkWidget *, gpointer);
void view_toggle_rulers_cmd_callback (GtkWidget *, gpointer);
void view_toggle_statusbar_cmd_callback (GtkWidget *, gpointer);
void view_toggle_guides_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_convert_rgb_cmd_callback (GtkWidget *, gpointer);
void image_convert_grayscale_cmd_callback (GtkWidget *, gpointer);
void image_convert_indexed_cmd_callback (GtkWidget *, gpointer);
void image_desaturate_cmd_callback (GtkWidget *, gpointer);
void image_invert_cmd_callback (GtkWidget *, gpointer);
void image_equalize_cmd_callback (GtkWidget *, gpointer);
void image_offset_cmd_callback (GtkWidget *, gpointer);
void image_resize_cmd_callback (GtkWidget *, gpointer);
void image_scale_cmd_callback (GtkWidget *, gpointer);
void image_duplicate_cmd_callback (GtkWidget *, gpointer);
void layers_previous_cmd_callback (GtkWidget *, gpointer);
void layers_next_cmd_callback (GtkWidget *, gpointer);
......@@ -104,31 +104,33 @@ void layers_add_alpha_channel_cmd_callback (GtkWidget *, gpointer);
void layers_alpha_select_cmd_callback (GtkWidget *, gpointer);
void layers_resize_to_image_cmd_callback (GtkWidget *, gpointer);
void tools_default_colors_cmd_callback (GtkWidget *, gpointer);
void tools_swap_colors_cmd_callback (GtkWidget *, gpointer);
void tools_swap_contexts_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_lc_cmd_callback (GtkWidget *, gpointer);
void dialogs_tool_options_cmd_callback (GtkWidget *, gpointer);
void dialogs_brushes_cmd_callback (GtkWidget *, gpointer);
void dialogs_patterns_cmd_callback (GtkWidget *, gpointer);
void dialogs_gradients_cmd_callback (GtkWidget *, gpointer);
void dialogs_palette_cmd_callback (GtkWidget *, gpointer);
void dialogs_indexed_palette_cmd_callback (GtkWidget *, gpointer);
void dialogs_input_devices_cmd_callback (GtkWidget *, gpointer);
void dialogs_device_status_cmd_callback (GtkWidget *, gpointer);
void dialogs_document_index_cmd_callback (GtkWidget *, gpointer);
void dialogs_error_console_cmd_callback (GtkWidget *, gpointer);
void dialogs_undo_history_cmd_callback (GtkWidget *, gpointer);
void dialogs_module_browser_cmd_callback (GtkWidget *, gpointer);
void tools_toolbox_raise_cmd_callback (GtkWidget *, gpointer);
void tools_default_colors_cmd_callback (GtkWidget *, gpointer);
void tools_swap_colors_cmd_callback (GtkWidget *, gpointer);
void tools_swap_contexts_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_preferences_cmd_callback (GtkWidget *, gpointer);
void dialogs_lc_cmd_callback (GtkWidget *, gpointer);
void dialogs_tool_options_cmd_callback (GtkWidget *, gpointer);
void dialogs_brushes_cmd_callback (GtkWidget *, gpointer);
void dialogs_patterns_cmd_callback (GtkWidget *, gpointer);
void dialogs_gradients_cmd_callback (GtkWidget *, gpointer);
void dialogs_palette_cmd_callback (GtkWidget *, gpointer);
void dialogs_indexed_palette_cmd_callback (GtkWidget *, gpointer);
void dialogs_input_devices_cmd_callback (GtkWidget *, gpointer);
void dialogs_device_status_cmd_callback (GtkWidget *, gpointer);
void dialogs_document_index_cmd_callback (GtkWidget *, gpointer);
void dialogs_error_console_cmd_callback (GtkWidget *, gpointer);
void dialogs_undo_history_cmd_callback (GtkWidget *, gpointer);
void dialogs_module_browser_cmd_callback (GtkWidget *, gpointer);
void dialogs_test_image_container_list_view_cmd_callback (GtkWidget *, gpointer);
void dialogs_test_image_container_grid_view_cmd_callback (GtkWidget *, gpointer);
......
......@@ -73,10 +73,12 @@
#include "palette.h"
#include "pattern_select.h"
#include "plug_in.h"
#include "preferences_dialog.h"
#include "resize.h"
#include "scale.h"
#include "selection.h"
#include "tips_dialog.h"
#include "toolbox.h"
#include "undo.h"
#include "undo_history.h"
......@@ -1097,6 +1099,13 @@ layers_resize_to_image_cmd_callback (GtkWidget *widget,
/***** Tools *****/
void
tools_toolbox_raise_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
toolbox_raise ();
}
void
tools_default_colors_cmd_callback (GtkWidget *widget,
gpointer client_data)
......@@ -1141,10 +1150,13 @@ tools_select_cmd_callback (GtkWidget *widget,
gpointer callback_data,
guint callback_action)
{
GtkType tool_type;
GimpToolInfo *tool_info;
GDisplay *gdisp;
tool_info = GIMP_TOOL_INFO (callback_action);
tool_type = callback_action;
tool_info = tool_manager_get_info_by_type (tool_type);
gdisp = gdisplay_active ();
gimp_context_set_tool (gimp_context_get_user (), tool_info);
......@@ -1184,6 +1196,13 @@ filters_repeat_cmd_callback (GtkWidget *widget,
/***** Dialogs ******/
void
dialogs_preferences_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
preferences_dialog_create ();
}
void
dialogs_lc_cmd_callback (GtkWidget *widget,
gpointer client_data)
......
......@@ -46,49 +46,49 @@ void edit_fill_cmd_callback (GtkWidget *widget,
guint callback_action);
void edit_stroke_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_feather_cmd_callback (GtkWidget *, gpointer);
void select_sharpen_cmd_callback (GtkWidget *, gpointer);
void select_shrink_cmd_callback (GtkWidget *, gpointer);
void select_border_cmd_callback (GtkWidget *, gpointer);
void select_grow_cmd_callback (GtkWidget *, gpointer);
void select_save_cmd_callback (GtkWidget *, gpointer);
void view_zoomin_cmd_callback (GtkWidget *, gpointer);
void view_zoomout_cmd_callback (GtkWidget *, gpointer);
void view_zoom_16_1_cmd_callback (GtkWidget *, gpointer);
void view_zoom_8_1_cmd_callback (GtkWidget *, gpointer);
void view_zoom_4_1_cmd_callback (GtkWidget *, gpointer);
void view_zoom_2_1_cmd_callback (GtkWidget *, gpointer);
void view_zoom_1_1_cmd_callback (GtkWidget *, gpointer);
void view_zoom_1_2_cmd_callback (GtkWidget *, gpointer);
void view_zoom_1_4_cmd_callback (GtkWidget *, gpointer);
void view_zoom_1_8_cmd_callback (GtkWidget *, gpointer);
void view_zoom_1_16_cmd_callback (GtkWidget *, gpointer);
void view_dot_for_dot_cmd_callback (GtkWidget *, gpointer);
void view_info_window_cmd_callback (GtkWidget *, gpointer);
void view_nav_window_cmd_callback (GtkWidget *, gpointer);
void view_toggle_selection_cmd_callback (GtkWidget *, gpointer);
void view_toggle_rulers_cmd_callback (GtkWidget *, gpointer);
void view_toggle_statusbar_cmd_callback (GtkWidget *, gpointer);
void view_toggle_guides_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_convert_rgb_cmd_callback (GtkWidget *, gpointer);
void image_convert_grayscale_cmd_callback (GtkWidget *, gpointer);
void image_convert_indexed_cmd_callback (GtkWidget *, gpointer);
void image_desaturate_cmd_callback (GtkWidget *, gpointer);
void image_invert_cmd_callback (GtkWidget *, gpointer);
void image_equalize_cmd_callback (GtkWidget *, gpointer);
void image_offset_cmd_callback (GtkWidget *, gpointer);
void image_resize_cmd_callback (GtkWidget *, gpointer);
void image_scale_cmd_callback (GtkWidget *, gpointer);
void image_duplicate_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_feather_cmd_callback (GtkWidget *, gpointer);
void select_sharpen_cmd_callback (GtkWidget *, gpointer);
void select_shrink_cmd_callback (GtkWidget *, gpointer);
void select_border_cmd_callback (GtkWidget *, gpointer);
void select_grow_cmd_callback (GtkWidget *, gpointer);
void select_save_cmd_callback (GtkWidget *, gpointer);
void view_zoomin_cmd_callback (GtkWidget *, gpointer);
void view_zoomout_cmd_callback (GtkWidget *, gpointer);
void view_zoom_16_1_cmd_callback (GtkWidget *, gpointer);
void view_zoom_8_1_cmd_callback (GtkWidget *, gpointer);
void view_zoom_4_1_cmd_callback (GtkWidget *, gpointer);
void view_zoom_2_1_cmd_callback (GtkWidget *, gpointer);
void view_zoom_1_1_cmd_callback (GtkWidget *, gpointer);
void view_zoom_1_2_cmd_callback (GtkWidget *, gpointer);
void view_zoom_1_4_cmd_callback (GtkWidget *, gpointer);
void view_zoom_1_8_cmd_callback (GtkWidget *, gpointer);
void view_zoom_1_16_cmd_callback (GtkWidget *, gpointer);
void view_dot_for_dot_cmd_callback (GtkWidget *, gpointer);
void view_info_window_cmd_callback (GtkWidget *, gpointer);
void view_nav_window_cmd_callback (GtkWidget *, gpointer);
void view_toggle_selection_cmd_callback (GtkWidget *, gpointer);
void view_toggle_rulers_cmd_callback (GtkWidget *, gpointer);
void view_toggle_statusbar_cmd_callback (GtkWidget *, gpointer);
void view_toggle_guides_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_convert_rgb_cmd_callback (GtkWidget *, gpointer);
void image_convert_grayscale_cmd_callback (GtkWidget *, gpointer);
void image_convert_indexed_cmd_callback (GtkWidget *, gpointer);
void image_desaturate_cmd_callback (GtkWidget *, gpointer);
void image_invert_cmd_callback (GtkWidget *, gpointer);
void image_equalize_cmd_callback (GtkWidget *, gpointer);
void image_offset_cmd_callback (GtkWidget *, gpointer);
void image_resize_cmd_callback (GtkWidget *, gpointer);
void image_scale_cmd_callback (GtkWidget *, gpointer);
void image_duplicate_cmd_callback (GtkWidget *, gpointer);
void layers_previous_cmd_callback (GtkWidget *, gpointer);
void layers_next_cmd_callback (GtkWidget *, gpointer);
......@@ -104,31 +104,33 @@ void layers_add_alpha_channel_cmd_callback (GtkWidget *, gpointer);
void layers_alpha_select_cmd_callback (GtkWidget *, gpointer);
void layers_resize_to_image_cmd_callback (GtkWidget *, gpointer);
void tools_default_colors_cmd_callback (GtkWidget *, gpointer);
void tools_swap_colors_cmd_callback (GtkWidget *, gpointer);
void tools_swap_contexts_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_lc_cmd_callback (GtkWidget *, gpointer);
void dialogs_tool_options_cmd_callback (GtkWidget *, gpointer);
void dialogs_brushes_cmd_callback (GtkWidget *, gpointer);
void dialogs_patterns_cmd_callback (GtkWidget *, gpointer);
void dialogs_gradients_cmd_callback (GtkWidget *, gpointer);
void dialogs_palette_cmd_callback (GtkWidget *, gpointer);
void dialogs_indexed_palette_cmd_callback (GtkWidget *, gpointer);
void dialogs_input_devices_cmd_callback (GtkWidget *, gpointer);
void dialogs_device_status_cmd_callback (GtkWidget *, gpointer);
void dialogs_document_index_cmd_callback (GtkWidget *, gpointer);
void dialogs_error_console_cmd_callback (GtkWidget *, gpointer);
void dialogs_undo_history_cmd_callback (GtkWidget *, gpointer);
void dialogs_module_browser_cmd_callback (GtkWidget *, gpointer);
void tools_toolbox_raise_cmd_callback (GtkWidget *, gpointer);
void tools_default_colors_cmd_callback (GtkWidget *, gpointer);
void tools_swap_colors_cmd_callback (GtkWidget *, gpointer);
void tools_swap_contexts_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_preferences_cmd_callback (GtkWidget *, gpointer);
void dialogs_lc_cmd_callback (GtkWidget *, gpointer);
void dialogs_tool_options_cmd_callback (GtkWidget *, gpointer);
void dialogs_brushes_cmd_callback (GtkWidget *, gpointer);
void dialogs_patterns_cmd_callback (GtkWidget *, gpointer);
void dialogs_gradients_cmd_callback (GtkWidget *, gpointer);
void dialogs_palette_cmd_callback (GtkWidget *, gpointer);
void dialogs_indexed_palette_cmd_callback (GtkWidget *, gpointer);
void dialogs_input_devices_cmd_callback (GtkWidget *, gpointer);
void dialogs_device_status_cmd_callback (GtkWidget *, gpointer);
void dialogs_document_index_cmd_callback (GtkWidget *, gpointer);
void dialogs_error_console_cmd_callback (GtkWidget *, gpointer);
void dialogs_undo_history_cmd_callback (GtkWidget *, gpointer);
void dialogs_module_browser_cmd_callback (GtkWidget *, gpointer);
void dialogs_test_image_container_list_view_cmd_callback (GtkWidget *, gpointer);
void dialogs_test_image_container_grid_view_cmd_callback (GtkWidget *, gpointer);
......
......@@ -28,6 +28,7 @@
#include "tools/tool_manager.h"
#include "appenv.h"
#include "brush_select.h"
#include "cursorutil.h"
#include "context_manager.h"
#include "gdisplay.h"
......@@ -65,6 +66,7 @@ static GimpContext *global_tool_context = NULL;
#define PAINT_OPTIONS_MASK GIMP_CONTEXT_OPACITY_MASK | \
GIMP_CONTEXT_PAINT_MODE_MASK
static void
context_manager_display_changed (GimpContext *context,
GDisplay *display,
......@@ -97,7 +99,7 @@ context_manager_tool_changed (GimpContext *user_context,
/* explicitly set the current tool */
gimp_context_set_tool (user_context,
tool_manager_get_info_by_type (GTK_OBJECT (active_tool)->klass->type));
tool_manager_get_info_by_tool (active_tool));
gtk_signal_handler_unblock_by_func (GTK_OBJECT (user_context),
context_manager_tool_changed,
......@@ -150,10 +152,10 @@ context_manager_init (void)
static const GimpDataFactoryLoaderEntry brush_loader_entries[] =
{
{ gimp_brush_load, GIMP_BRUSH_FILE_EXTENSION },
{ gimp_brush_load, GIMP_BRUSH_PIXMAP_FILE_EXTENSION },
{ gimp_brush_load, GIMP_BRUSH_FILE_EXTENSION },
{ gimp_brush_load, GIMP_BRUSH_PIXMAP_FILE_EXTENSION },
{ gimp_brush_generated_load, GIMP_BRUSH_GENERATED_FILE_EXTENSION },
{ gimp_brush_pipe_load, GIMP_BRUSH_PIPE_FILE_EXTENSION }
{ gimp_brush_pipe_load, GIMP_BRUSH_PIPE_FILE_EXTENSION }
};
static gint n_brush_loader_entries = (sizeof (brush_loader_entries) /
sizeof (brush_loader_entries[0]));
......@@ -176,7 +178,7 @@ context_manager_init (void)
static const GimpDataFactoryLoaderEntry palette_loader_entries[] =
{
{ gimp_palette_load, GIMP_PALETTE_FILE_EXTENSION },
{ gimp_palette_load, NULL /* legacy loader */ }
{ gimp_palette_load, NULL /* legacy loader */ }
};
static gint n_palette_loader_entries = (sizeof (palette_loader_entries) /
sizeof (palette_loader_entries[0]));
......@@ -300,6 +302,9 @@ context_manager_set_global_paint_options (gboolean global)
paint_options_set_global (global);
/* NULL is the main brush selection */
brush_select_show_paint_options (NULL, global);
tool_info = gimp_context_get_tool (gimp_context_get_user ());
if (global)
......
......@@ -130,6 +130,7 @@ gimp_tool_info_get_new_preview (GimpViewable *viewable,
{
GimpToolInfo *tool_info;
TempBuf *temp_buf;
TempBuf *return_buf;
guchar opaque[4] = { 0, 0, 0, 0 };
gint offset_x = 0;
gint offset_y = 0;
......@@ -155,21 +156,15 @@ gimp_tool_info_get_new_preview (GimpViewable *viewable,
#define TOOL_INFO_WIDTH 22
#define TOOL_INFO_HEIGHT 22
if (width > TOOL_INFO_WIDTH)
offset_x = (width - TOOL_INFO_WIDTH) / 2;
if (height > TOOL_INFO_HEIGHT)
offset_y = (height - TOOL_INFO_HEIGHT) / 2;
temp_buf = temp_buf_new (width, height, 4, 0, 0, opaque);
temp_buf = temp_buf_new (TOOL_INFO_WIDTH, TOOL_INFO_HEIGHT, 4, 0, 0, opaque);
data = temp_buf_data (temp_buf);
p = data + (offset_y * temp_buf->width * temp_buf->bytes);
p = data;
for (r = 0; r < height; r++)
for (r = 0; r < TOOL_INFO_HEIGHT; r++)
{
for (s = 0, cnt = 0; s < width; s++)
for (s = 0, cnt = 0; s < TOOL_INFO_WIDTH; s++)
{
value = tool_info->icon_data[r][s];
......@@ -187,7 +182,17 @@ gimp_tool_info_get_new_preview (GimpViewable *viewable,
}
}
return temp_buf;
if (width > TOOL_INFO_WIDTH)
offset_x = (width - TOOL_INFO_WIDTH) / 2;
if (height > TOOL_INFO_HEIGHT)
offset_y = (height - TOOL_INFO_HEIGHT) / 2;
return_buf = temp_buf_scale (temp_buf, width, height);
temp_buf_free (temp_buf);
return return_buf;
}
GimpToolInfo *
......
......@@ -1343,8 +1343,7 @@ prefs_help_func (const gchar *help_data)
* create the preferences dialog
*/
void
prefs_cmd_callback (GtkWidget *widget,
gpointer client_data)
preferences_dialog_create (void)
{
GtkWidget *ctree;
gchar *titles[1];
......
......@@ -20,8 +20,7 @@
#define __PREFERENCES_DIALOG_H__
void prefs_cmd_callback (GtkWidget *widget,
gpointer data);
void preferences_dialog_create (void);
#endif /* __PREFERENCES_DIALOG_H__ */
......@@ -86,7 +86,6 @@ static gint gimp_preview_enter_notify_event (GtkWidget *widget,
static gint gimp_preview_leave_notify_event (GtkWidget *widget,
GdkEventCrossing *event);
static void gimp_preview_render (GimpPreview *preview);
static void gimp_preview_real_render (GimpPreview *preview);
static void gimp_preview_get_size (GimpPreview *preview,
gint size,
......@@ -482,6 +481,12 @@ gimp_preview_set_viewable (GimpPreview *preview,
}
}
void
gimp_preview_render (GimpPreview *preview)
{
gtk_signal_emit (GTK_OBJECT (preview), preview_signals[RENDER]);
}
static gint
gimp_preview_button_press_event (GtkWidget *widget,
GdkEventButton *bevent)
......@@ -599,12 +604,6 @@ gimp_preview_leave_notify_event (GtkWidget *widget,
return FALSE;
}
static void
gimp_preview_render (GimpPreview *preview)
{
gtk_signal_emit (GTK_OBJECT (preview), preview_signals[RENDER]);
}
static void
gimp_preview_real_render (GimpPreview *preview)
{
......
......@@ -104,6 +104,8 @@ void gimp_preview_set_size_full (GimpPreview *preview,
void gimp_preview_set_viewable (GimpPreview *preview,
GimpViewable *viewable);
void gimp_preview_render (GimpPreview *preview);
/* private */
......
......@@ -33,11 +33,14 @@
/* FIXME: make tool icons nicer */
#define TOOL_INFO_SIZE 22
#define TOOL_INFO_WIDTH 22
#define TOOL_INFO_HEIGHT 22
static void gimp_tool_info_preview_class_init (GimpToolInfoPreviewClass *klass);
static void gimp_tool_info_preview_init (GimpToolInfoPreview *preview);
static void gimp_tool_info_preview_state_changed (GtkWidget *widget,
GtkStateType previous_state);
static void gimp_tool_info_preview_render (GimpPreview *preview);
static GtkWidget * gimp_tool_info_preview_create_popup (GimpPreview *preview);
......@@ -79,13 +82,17 @@ static void
gimp_tool_info_preview_class_init (GimpToolInfoPreviewClass *klass)
{
GtkObjectClass *object_class;
GtkWidgetClass *widget_class;
GimpPreviewClass *preview_class;
object_class = (GtkObjectClass *) klass;
widget_class = (GtkWidgetClass *) klass;
preview_class = (GimpPreviewClass *) klass;
parent_class = gtk_type_class (GIMP_TYPE_PREVIEW);
widget_class->state_changed = gimp_tool_info_preview_state_changed;
preview_class->render = gimp_tool_info_preview_render;
preview_class->create_popup = gimp_tool_info_preview_create_popup;
preview_class->needs_popup = gimp_tool_info_preview_needs_popup;
......@@ -104,19 +111,35 @@ gimp_tool_info_preview_init (GimpToolInfoPreview *tool_info_preview)
NULL);
}
static void
gimp_tool_info_preview_state_changed (GtkWidget *widget,
GtkStateType previous_state)
{
gimp_preview_render (GIMP_PREVIEW (widget));
}
static void
gimp_tool_info_preview_render (GimpPreview *preview)
{
GtkWidget *widget;
GimpToolInfo *tool_info;
TempBuf *temp_buf;
TempBuf *render_buf;
guchar color[3];
gint width;
gint height;
gint tool_info_width;
gint tool_info_height;
gint x, y;
guchar *src;
guchar *dest;
gboolean new_buf = FALSE;
widget = GTK_WIDGET (preview);
tool_info = GIMP_TOOL_INFO (preview->viewable);
tool_info_width = TOOL_INFO_SIZE;
tool_info_height = TOOL_INFO_SIZE;
tool_info_width = TOOL_INFO_WIDTH;
tool_info_height = TOOL_INFO_HEIGHT;
width = preview->width;
height = preview->height;
......@@ -124,22 +147,53 @@ gimp_tool_info_preview_render (GimpPreview *preview)
if (width == tool_info_width &&
height == tool_info_height)
{
/* TODO once tool icons are finished */
temp_buf = gimp_viewable_get_preview (preview->viewable,
width, height);
}
else
{
temp_buf = gimp_viewable_get_new_preview (preview->viewable,
width, height);
new_buf = TRUE;
}