Commit 0302ed0a authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

app/brush_select.[ch] app/gradient.c app/gradient_select.[ch]

1999-11-03  Michael Natterer  <mitch@gimp.org>

	* app/brush_select.[ch]
	* app/gradient.c
	* app/gradient_select.[ch]
	* app/interface.[ch]
	* app/palette.c
	* app/pattern_select.[ch]: allow dragging a brush/pattern/... from
	the selections with mouse2 without changing the active element in
	the dialog.

	* app/channels_dialog.c
	* app/color_area.c
	* app/color_panel.c
	* app/color_select.c
	* app/colormap_dialog.i.c
	* app/devices.c
	* app/gimpcontextpreview.[ch]
	* app/gimphelp.[ch]
	* app/gimpui.[ch]
	* app/indicator_area.c
	* app/interface.[ch]
	* app/layers_dialog.c
	* app/lc_dialog.c
	* app/ops_buttons.[ch]
	* app/paths_dialog.c
	* app/preferences_dialog.c
	* app/tools.[ch]: wrapped gtk_tooltips_set_tip() with
	gimp_help_set_help_data() and moved it to gimphelp.[ch].

	This should (hopefully) be the final state of the help system. The
	New function allows a "private tip" to be set without a visible
	tooltip. This way the tooltips inspector (shift+F1) can search for
	help data in the parent containers of the clicked widget. E.g. the
	ops buttons in the layers dialog have private tips like
	"#new_layer" which gets composed with the help data of the layers
	dialog notebook page resulting in a complete help path.

	Allow mouse2 for all dnd operations. Mouse1 still works like before.
parent 46c8110f
1999-11-03 Michael Natterer <mitch@gimp.org>
* app/brush_select.[ch]
* app/gradient.c
* app/gradient_select.[ch]
* app/interface.[ch]
* app/palette.c
* app/pattern_select.[ch]: allow dragging a brush/pattern/... from
the selections with mouse2 without changing the active element in
the dialog.
* app/channels_dialog.c
* app/color_area.c
* app/color_panel.c
* app/color_select.c
* app/colormap_dialog.i.c
* app/devices.c
* app/gimpcontextpreview.[ch]
* app/gimphelp.[ch]
* app/gimpui.[ch]
* app/indicator_area.c
* app/interface.[ch]
* app/layers_dialog.c
* app/lc_dialog.c
* app/ops_buttons.[ch]
* app/paths_dialog.c
* app/preferences_dialog.c
* app/tools.[ch]: wrapped gtk_tooltips_set_tip() with
gimp_help_set_help_data() and moved it to gimphelp.[ch].
This should (hopefully) be the final state of the help system. The
New function allows a "private tip" to be set without a visible
tooltip. This way the tooltips inspector (shift+F1) can search for
help data in the parent containers of the clicked widget. E.g. the
ops buttons in the layers dialog have private tips like
"#new_layer" which gets composed with the help data of the layers
dialog notebook page resulting in a complete help path.
Allow mouse2 for all dnd operations. Mouse1 still works like before.
Tue Nov 2 17:36:21 PST 1999 Manish Singh <yosh@gimp.org>
* pixmaps/question.xpm: fake one from alt's screenshot since he
......
......@@ -68,6 +68,8 @@
static void brush_change_callbacks (BrushSelect *bsp,
gboolean closing);
static GimpBrush * brush_select_drag_brush (GtkWidget *widget,
gpointer data);
static void brush_select_drop_brush (GtkWidget *widget,
GimpBrush *brush,
gpointer data);
......@@ -252,6 +254,7 @@ brush_select_new (gchar *title,
bsp = g_new (BrushSelect, 1);
bsp->callback_name = NULL;
bsp->dnd_brush = NULL;
bsp->brush_popup = NULL;
bsp->popup_timeout_tag = 0;
bsp->popup_anim_timeout_tag = 0;
......@@ -371,6 +374,12 @@ brush_select_new (gchar *title,
bsp);
/* dnd stuff */
gtk_drag_source_set (bsp->preview,
GDK_BUTTON2_MASK,
preview_target_table, preview_n_targets,
GDK_ACTION_COPY);
gimp_dnd_brush_source_set (bsp->preview, brush_select_drag_brush, bsp);
gtk_drag_dest_set (bsp->preview,
GTK_DEST_DEFAULT_ALL,
preview_target_table, preview_n_targets,
......@@ -736,6 +745,17 @@ brushes_check_dialogs (void)
* Local functions
*/
static GimpBrush *
brush_select_drag_brush (GtkWidget *widget,
gpointer data)
{
BrushSelect *bsp;
bsp = (BrushSelect *) data;
return bsp->dnd_brush;
}
static void
brush_select_drop_brush (GtkWidget *widget,
GimpBrush *brush,
......@@ -1502,14 +1522,21 @@ brush_select_events (GtkWidget *widget,
case GDK_BUTTON_PRESS:
bevent = (GdkEventButton *) event;
col = bevent->x / bsp->cell_width;
row = (bevent->y + bsp->scroll_offset) / bsp->cell_height;
index = row * bsp->NUM_BRUSH_COLUMNS + col;
brush = gimp_brush_list_get_brush_by_index (brush_list, index);
if (brush)
bsp->dnd_brush = brush;
else
bsp->dnd_brush = gimp_context_get_brush (bsp->context);
if (bevent->button == 1)
{
col = bevent->x / bsp->cell_width;
row = (bevent->y + bsp->scroll_offset) / bsp->cell_height;
index = row * bsp->NUM_BRUSH_COLUMNS + col;
/* Get the brush and display the popup brush preview */
if ((brush = gimp_brush_list_get_brush_by_index (brush_list, index)))
if (brush)
{
gdk_pointer_grab (bsp->preview->window, FALSE,
(GDK_POINTER_MOTION_HINT_MASK |
......
......@@ -62,6 +62,8 @@ struct _BrushSelect
GimpContext *context;
gint spacing_value;
GimpBrush *dnd_brush;
/* Some variables to keep the GUI consistent */
gint cell_width;
gint cell_height;
......
......@@ -28,7 +28,6 @@
#include "gimpdnd.h"
#include "gimprc.h"
#include "gimpui.h"
#include "interface.h"
#include "layers_dialogP.h"
#include "lc_dialogP.h"
#include "menus.h"
......@@ -174,7 +173,7 @@ static GdkPixmap *channel_pixmap[] = { NULL, NULL, NULL };
static gint suspend_gimage_notify = 0;
/* the ops buttons */
static OpsButtonCallback to_selection_ext_callbacks[] =
static GtkSignalFunc to_selection_ext_callbacks[] =
{
channels_dialog_add_channel_to_sel_callback, /* SHIFT */
channels_dialog_sub_channel_from_sel_callback, /* CTRL */
......@@ -268,8 +267,14 @@ channels_dialog_create (void)
}
/* The main vbox */
channelsD->vbox = vbox = gtk_vbox_new (FALSE, 1);
channelsD->vbox = gtk_event_box_new ();
gimp_help_set_help_data (channelsD->vbox, NULL,
"dialogs/channels/channels.html");
vbox = gtk_vbox_new (FALSE, 1);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 2);
gtk_container_add (GTK_CONTAINER (channelsD->vbox), vbox);
/* The channels commands pulldown menu */
menus_get_channels_menu (&channelsD->ops_menu, &channelsD->accel_group);
......@@ -298,8 +303,8 @@ channels_dialog_create (void)
gtk_widget_show (channelsD->scrolled_win);
/* The ops buttons */
button_box = ops_button_box_new (lc_dialog->shell, tool_tips,
channels_ops_buttons, OPS_BUTTON_NORMAL);
button_box = ops_button_box_new (lc_dialog->shell, channels_ops_buttons,
OPS_BUTTON_NORMAL);
gtk_box_pack_start (GTK_BOX (vbox), button_box, FALSE, FALSE, 2);
gtk_widget_show (button_box);
......@@ -348,6 +353,7 @@ channels_dialog_create (void)
NULL);
gtk_widget_show (vbox);
gtk_widget_show (channelsD->vbox);
return channelsD->vbox;
}
......@@ -1432,7 +1438,7 @@ channel_widget_create (GImage *gimage,
/* dnd source */
gtk_drag_source_set (list_item,
GDK_BUTTON1_MASK,
GDK_BUTTON1_MASK | GDK_BUTTON2_MASK,
channel_target_table, n_channel_targets,
GDK_ACTION_MOVE | GDK_ACTION_COPY);
......@@ -1447,7 +1453,7 @@ channel_widget_create (GImage *gimage,
{
/* dnd source */
gtk_drag_source_set (list_item,
GDK_BUTTON1_MASK,
GDK_BUTTON1_MASK | GDK_BUTTON2_MASK,
component_target_table, n_component_targets,
GDK_ACTION_MOVE | GDK_ACTION_COPY);
......
......@@ -402,7 +402,7 @@ color_area_create (gint width,
/* dnd stuff */
gtk_drag_source_set (color_area,
GDK_BUTTON1_MASK | GDK_BUTTON3_MASK,
GDK_BUTTON1_MASK | GDK_BUTTON2_MASK,
color_area_target_table, n_color_area_targets,
GDK_ACTION_COPY | GDK_ACTION_MOVE);
gimp_dnd_color_source_set (color_area, color_area_drag_color, NULL);
......
......@@ -102,7 +102,7 @@ color_panel_new (guchar *initial,
/* dnd stuff */
gtk_drag_source_set (private->drawing_area,
GDK_BUTTON1_MASK | GDK_BUTTON3_MASK,
GDK_BUTTON1_MASK | GDK_BUTTON2_MASK,
color_panel_target_table, n_color_panel_targets,
GDK_ACTION_COPY | GDK_ACTION_MOVE);
gimp_dnd_color_source_set (private->drawing_area,
......
......@@ -338,7 +338,7 @@ color_select_widget_new (ColorSelect *csp,
/* dnd stuff */
gtk_drag_source_set (csp->new_color,
GDK_BUTTON1_MASK | GDK_BUTTON3_MASK,
GDK_BUTTON1_MASK | GDK_BUTTON2_MASK,
color_select_target_table, n_color_select_targets,
GDK_ACTION_COPY | GDK_ACTION_MOVE);
gimp_dnd_color_source_set (csp->new_color, color_select_drag_new_color, csp);
......@@ -365,7 +365,7 @@ color_select_widget_new (ColorSelect *csp,
/* dnd stuff */
gtk_drag_source_set (csp->orig_color,
GDK_BUTTON1_MASK | GDK_BUTTON3_MASK,
GDK_BUTTON1_MASK | GDK_BUTTON2_MASK,
color_select_target_table, n_color_select_targets,
GDK_ACTION_COPY | GDK_ACTION_MOVE);
gimp_dnd_color_source_set (csp->orig_color, color_select_drag_old_color, csp);
......
......@@ -243,7 +243,7 @@ ipal_create (GimpSet* context)
/* dnd stuff */
gtk_drag_source_set (GTK_WIDGET(ipal->palette),
GDK_BUTTON1_MASK | GDK_BUTTON3_MASK,
GDK_BUTTON1_MASK | GDK_BUTTON2_MASK,
color_palette_target_table, n_color_palette_targets,
GDK_ACTION_COPY | GDK_ACTION_MOVE);
gimp_dnd_color_source_set (GTK_WIDGET (ipal->palette),
......
......@@ -21,19 +21,19 @@
#include <stdio.h>
#include "appenv.h"
#include "devices.h"
#include "dialog_handler.h"
#include "gimpcontextpreview.h"
#include "gimpdnd.h"
#include "devices.h"
#include "interface.h"
#include "gimpbrushlist.h"
#include "gimpcontext.h"
#include "gimprc.h"
#include "gimpui.h"
#include "gradient.h"
#include "gradient_header.h"
#include "interface.h"
#include "session.h"
#include "tools.h"
#include "dialog_handler.h"
#include "libgimp/gimpintl.h"
#include "libgimp/gimpenv.h"
......@@ -798,7 +798,7 @@ device_status_create (void)
gtk_pixmap_new (create_tool_pixmap (deviceD->table, RECT_SELECT),
NULL);
gtk_drag_source_set (deviceD->eventboxes[i],
GDK_BUTTON1_MASK,
GDK_BUTTON1_MASK | GDK_BUTTON2_MASK,
tool_target_table, n_tool_targets,
GDK_ACTION_COPY);
gimp_dnd_tool_source_set (deviceD->eventboxes[i],
......@@ -826,7 +826,7 @@ device_status_create (void)
gtk_preview_size (GTK_PREVIEW (deviceD->colors[i]),
CELL_SIZE, CELL_SIZE);
gtk_drag_source_set (deviceD->colors[i],
GDK_BUTTON1_MASK,
GDK_BUTTON1_MASK | GDK_BUTTON2_MASK,
color_area_target_table, n_color_area_targets,
GDK_ACTION_COPY);
gimp_dnd_color_source_set (deviceD->colors[i],
......@@ -849,7 +849,7 @@ device_status_create (void)
deviceD->brushes[i] =
gimp_context_preview_new (GCP_BRUSH,
CELL_SIZE, CELL_SIZE,
FALSE, TRUE, TRUE,
FALSE, TRUE,
GTK_SIGNAL_FUNC (device_status_drop_brush),
GUINT_TO_POINTER (device_info->device));
gtk_table_attach (GTK_TABLE(deviceD->table), deviceD->brushes[i],
......@@ -861,7 +861,7 @@ device_status_create (void)
deviceD->patterns[i] =
gimp_context_preview_new (GCP_PATTERN,
CELL_SIZE, CELL_SIZE,
FALSE, TRUE, TRUE,
FALSE, TRUE,
GTK_SIGNAL_FUNC (device_status_drop_pattern),
GUINT_TO_POINTER (device_info->device));
gtk_table_attach (GTK_TABLE(deviceD->table), deviceD->patterns[i],
......@@ -873,7 +873,7 @@ device_status_create (void)
deviceD->gradients[i] =
gimp_context_preview_new (GCP_GRADIENT,
CELL_SIZE * 2, CELL_SIZE,
FALSE, TRUE, TRUE,
FALSE, TRUE,
GTK_SIGNAL_FUNC (device_status_drop_gradient),
GUINT_TO_POINTER (device_info->device));
gtk_table_attach (GTK_TABLE(deviceD->table), deviceD->gradients[i],
......@@ -1009,9 +1009,9 @@ device_status_update (guint32 deviceid)
gtk_widget_show (deviceD->tools[i]);
gtk_widget_show (deviceD->eventboxes[i]);
gtk_tooltips_set_tip (tool_tips,deviceD->eventboxes[i],
tool_info[(int) gimp_context_get_tool (device_info->context)].tool_desc,
NULL);
gimp_help_set_help_data (deviceD->eventboxes[i],
tool_info[(gint) gimp_context_get_tool (device_info->context)].tool_desc,
tool_info[(gint) gimp_context_get_tool (device_info->context)].private_tip);
for (j = 0; j < CELL_SIZE * 3; j += 3)
{
......@@ -1033,7 +1033,7 @@ device_status_update (guint32 deviceid)
buffer[j+1],
buffer[j+2]);
gtk_tooltips_set_tip (tool_tips, deviceD->colors[i], ttbuf, NULL);
gimp_help_set_help_data (deviceD->colors[i], ttbuf, NULL);
if (gimp_context_get_brush (device_info->context))
{
......
......@@ -25,7 +25,6 @@
#include "gimprc.h"
#include "gimpui.h"
#include "image_render.h"
#include "interface.h"
#include "lc_dialog.h"
#include "layer_select.h"
#include "session.h"
......@@ -279,9 +278,9 @@ file_prefs_ok_callback (GtkWidget *widget,
prefs_dlg = NULL;
if (show_tool_tips)
gtk_tooltips_enable (tool_tips);
gimp_help_enable_tooltips ();
else
gtk_tooltips_disable (tool_tips);
gimp_help_disable_tooltips ();
/* This needs modification to notify the user of which simply cannot be
* changed on the fly. Currently it ignores these options if only OK is
......
......@@ -90,6 +90,8 @@ static gboolean toolbox_drag_drop (GtkWidget *,
gint,
gint,
guint);
static ToolType toolbox_drag_tool (GtkWidget *,
gpointer);
static void toolbox_drop_tool (GtkWidget *,
ToolType,
gpointer);
......@@ -111,11 +113,8 @@ static int pixmap_colors[8][3] =
#define ROWS 8
#define MARGIN 2
/* global variables */
GtkTooltips * tool_tips;
/* local variables */
static GdkColor colors[12];
static GdkColor colors[11];
static GtkWidget * toolbox_shell = NULL;
static GtkTargetEntry toolbox_target_table[] =
......@@ -131,6 +130,13 @@ static GtkTargetEntry toolbox_target_table[] =
static guint toolbox_n_targets = (sizeof (toolbox_target_table) /
sizeof (toolbox_target_table[0]));
static GtkTargetEntry tool_target_table[] =
{
GIMP_TARGET_TOOL
};
static guint tool_n_targets = (sizeof (tool_target_table) /
sizeof (tool_target_table[0]));
static GtkTargetEntry display_target_table[] =
{
GIMP_TARGET_LAYER,
......@@ -237,12 +243,6 @@ allocate_colors (GtkWidget *parent)
colors[10] = parent->style->bg[GTK_STATE_PRELIGHT];
gdk_color_alloc (colormap, &colors[10]);
/* postit yellow (khaki) as background for tooltips */
colors[11].red = 61669;
colors[11].green = 59113;
colors[11].blue = 35979;
gdk_color_alloc (colormap, &colors[11]);
}
static void
......@@ -263,6 +263,8 @@ create_indicator_area (GtkWidget *parent)
gtk_container_set_border_width (GTK_CONTAINER (alignment), 3);
gtk_container_add (GTK_CONTAINER (frame), alignment);
gimp_help_set_help_data (alignment, NULL, "#indicator_area");
ind_area = indicator_area_create ();
gtk_container_add (GTK_CONTAINER (alignment), ind_area);
gtk_widget_show (ind_area);
......@@ -295,13 +297,15 @@ create_color_area (GtkWidget *parent)
gtk_container_set_border_width (GTK_CONTAINER (alignment), 3);
gtk_container_add (GTK_CONTAINER (frame), alignment);
gimp_help_set_help_data (alignment, NULL, "#color_area");
col_area = color_area_create (54, 42, default_pixmap, swap_pixmap);
gtk_container_add (GTK_CONTAINER (alignment), col_area);
gtk_tooltips_set_tip (tool_tips, col_area,
_("Foreground & background colors. The black "
"and white squares reset colors. The arrows swap colors. Double "
"click to select a color from a colorrequester."),
NULL);
gimp_help_set_help_data
(col_area,
_("Foreground & background colors. The black "
"and white squares reset colors. The arrows swap colors. Double "
"click to select a color from a colorrequester."), NULL);
gtk_widget_show (col_area);
gtk_widget_show (alignment);
gtk_widget_show (frame);
......@@ -381,9 +385,17 @@ create_tools (GtkWidget *parent)
GTK_SIGNAL_FUNC (tools_button_press),
(gpointer) tool_info[j].tool_id);
gtk_tooltips_set_tip (tool_tips, button,
gettext(tool_info[j].tool_desc),
tool_info[j].private_tip);
/* dnd stuff */
gtk_drag_source_set (tool_info[j].tool_widget,
GDK_BUTTON2_MASK,
tool_target_table, tool_n_targets,
GDK_ACTION_COPY);
gimp_dnd_tool_source_set (tool_info[j].tool_widget,
toolbox_drag_tool, (gpointer) j);
gimp_help_set_help_data (button,
gettext(tool_info[j].tool_desc),
tool_info[j].private_tip);
gtk_widget_show (pixmap);
gtk_widget_show (alignment);
......@@ -563,12 +575,9 @@ create_toolbox (void)
allocate_colors (main_vbox);
/* tooltips */
tool_tips = gtk_tooltips_new ();
gtk_tooltips_set_colors (tool_tips,
&colors[11],
&main_vbox->style->fg[GTK_STATE_NORMAL]);
gimp_help_init ();
if (!show_tool_tips)
gtk_tooltips_disable (tool_tips);
gimp_help_disable_tooltips ();
/* Build the menu bar with menus */
menus_get_toolbox_menubar (&menubar, &table);
......@@ -592,7 +601,7 @@ create_toolbox (void)
create_tools (wbox);
create_color_area (wbox);
if (show_indicators && (!no_data) )
create_indicator_area (wbox);
create_indicator_area (wbox);
gtk_widget_show (window);
toolbox_set_drag_dest (window);
......@@ -612,8 +621,7 @@ toolbox_free (void)
if (!tool_info[i].icon_data)
gtk_object_sink (GTK_OBJECT (tool_info[i].tool_widget));
}
gtk_object_destroy (GTK_OBJECT (tool_tips));
gtk_object_unref (GTK_OBJECT (tool_tips));
gimp_help_free ();
}
void
......@@ -645,20 +653,20 @@ create_display_shell (GDisplay* gdisp,
GSList *group = NULL;
int n_width, n_height;
int s_width, s_height;
int scalesrc, scaledest;
int contextid;
gint n_width, n_height;
gint s_width, s_height;
gint scalesrc, scaledest;
gint contextid;
{
/* adjust the initial scale -- so that window fits on screen */
s_width = gdk_screen_width ();
s_width = gdk_screen_width ();
s_height = gdk_screen_height ();
scalesrc = gdisp->scale & 0x00ff;
scaledest = gdisp->scale >> 8;
n_width = (width * scaledest) / scalesrc;
n_width = (width * scaledest) / scalesrc;
n_height = (height * scaledest) / scalesrc;
/* Limit to the size of the screen... */
......@@ -688,7 +696,12 @@ create_display_shell (GDisplay* gdisp,
gtk_window_set_wmclass (GTK_WINDOW (gdisp->shell), "image_window", "Gimp");
gtk_window_set_policy (GTK_WINDOW (gdisp->shell), TRUE, TRUE, TRUE);
gtk_object_set_user_data (GTK_OBJECT (gdisp->shell), (gpointer) gdisp);
gtk_widget_set_events (gdisp->shell, GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK);
gtk_widget_set_events (gdisp->shell,
GDK_POINTER_MOTION_MASK |
GDK_POINTER_MOTION_HINT_MASK |
GDK_BUTTON_PRESS_MASK |
GDK_KEY_PRESS_MASK |
GDK_KEY_RELEASE_MASK);
gtk_signal_connect (GTK_OBJECT (gdisp->shell), "delete_event",
GTK_SIGNAL_FUNC (gdisplay_delete),
gdisp);
......@@ -734,11 +747,17 @@ create_display_shell (GDisplay* gdisp,
table_lower = gtk_table_new (1,4,FALSE);
gtk_table_set_col_spacing (GTK_TABLE (table_lower), 0, 1);
/* gtk_table_set_row_spacing (GTK_TABLE (table_lower), 0, 1); */
/* gtk_table_set_row_spacing (GTK_TABLE (table_lower), 0, 1); */
/* hbox for statusbar area */
evbox = gtk_event_box_new ();
gtk_box_pack_start (GTK_BOX (vbox), evbox, FALSE, TRUE, 0);
gtk_widget_show (evbox);
gimp_help_set_help_data (evbox, NULL, "#status_area");
/* hbox for statusbar area */
gdisp->statusarea = gtk_hbox_new (FALSE, 2);
gtk_box_pack_start (GTK_BOX (vbox), gdisp->statusarea, FALSE, TRUE, 0);
gtk_container_add (GTK_CONTAINER (evbox), gdisp->statusarea);
/* scrollbars, rulers, canvas, menu popup button */
gdisp->origin = gtk_button_new ();
......@@ -749,6 +768,8 @@ create_display_shell (GDisplay* gdisp,
GTK_SIGNAL_FUNC (gdisplay_origin_button_press),
gdisp);
gimp_help_set_help_data (gdisp->origin, NULL, "#origin_button");
arrow = gtk_arrow_new (GTK_ARROW_RIGHT, GTK_SHADOW_OUT);
gtk_container_set_border_width (GTK_CONTAINER (gdisp->origin), 0);
gtk_container_add (GTK_CONTAINER (gdisp->origin), arrow);
......@@ -763,6 +784,8 @@ create_display_shell (GDisplay* gdisp,
GTK_SIGNAL_FUNC (gdisplay_hruler_button_press),
gdisp);
gimp_help_set_help_data (gdisp->hrule, NULL, "#ruler");
gdisp->vrule = gtk_vruler_new ();
gtk_widget_set_events (GTK_WIDGET (gdisp->vrule),
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK);
......@@ -773,16 +796,20 @@ create_display_shell (GDisplay* gdisp,
GTK_SIGNAL_FUNC (gdisplay_vruler_button_press),
gdisp);
gimp_help_set_help_data (gdisp->vrule, NULL, "#ruler");
/* The nav window button */
evbox = gtk_event_box_new();
gtk_widget_show(evbox);
navhbox = gtk_hbox_new (FALSE,0);
gtk_container_add(GTK_CONTAINER(evbox),navhbox);
evbox = gtk_event_box_new ();
gtk_widget_show (evbox);
navhbox = gtk_hbox_new (FALSE, 0);
gtk_container_add (GTK_CONTAINER (evbox), navhbox);
GTK_WIDGET_UNSET_FLAGS (evbox, GTK_CAN_FOCUS);
gtk_signal_connect (GTK_OBJECT (evbox), "button_press_event",
GTK_SIGNAL_FUNC (nav_popup_click_handler),
gdisp);
gimp_help_set_help_data (evbox, NULL, "#nav_window_button");
gdisp->hsb = gtk_hscrollbar_new (gdisp->hsbdata);
GTK_WIDGET_UNSET_FLAGS (gdisp->hsb, GTK_CAN_FOCUS);
gdisp->vsb = gtk_vscrollbar_new (gdisp->vsbdata);
......@@ -799,6 +826,8 @@ create_display_shell (GDisplay* gdisp,
GTK_SIGNAL_FUNC (qmask_click_handler),
gdisp);
gimp_help_set_help_data (gdisp->qmaskoff, NULL, "#qmask_off_button");
gdisp->qmaskon = gtk_radio_button_new (group);
group = gtk_radio_button_group (GTK_RADIO_BUTTON (gdisp->qmaskon));
gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (gdisp->qmaskon), FALSE);
......@@ -809,6 +838,8 @@ create_display_shell (GDisplay* gdisp,
GTK_SIGNAL_FUNC (qmask_click_handler),
gdisp);
gimp_help_set_help_data (gdisp->qmaskon, NULL, "#qmask_on_button");
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gdisp->qmaskoff), TRUE);
gtk_widget_set_usize (GTK_WIDGET (gdisp->qmaskon), 15, 15);
gtk_widget_set_usize (GTK_WIDGET (gdisp->qmaskoff), 15, 15);
......@@ -918,19 +949,22 @@ create_display_shell (GDisplay* gdisp,
gtk_widget_set_usize (gdisp->statusbar, 1, -1);
gtk_container_set_resize_mode (GTK_CONTAINER (gdisp->statusbar),
GTK_RESIZE_QUEUE);
gtk_box_pack_start (GTK_BOX (gdisp->statusarea), gdisp->statusbar, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (gdisp->statusarea), gdisp->statusbar,
TRUE, TRUE, 0);
contextid = gtk_statusbar_get_context_id (GTK_STATUSBAR (gdisp->statusbar),
"title");
gtk_statusbar_push (GTK_STATUSBAR (gdisp->statusbar),
contextid,
title);
gdisp->progressbar = gtk_progress_bar_new();
gdisp->progressbar = gtk_progress_bar_new ();
gtk_widget_set_usize (gdisp->progressbar, 80, -1);
gtk_box_pack_start (GTK_BOX (gdisp->statusarea), gdisp->progressbar, FALSE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (gdisp->statusarea), gdisp->progressbar,
FALSE, TRUE, 0);
gdisp->cancelbutton = gtk_button_new_with_label(_("Cancel"));
gtk_box_pack_start (GTK_BOX (gdisp->statusarea), gdisp->cancelbutton, FALSE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (gdisp->statusarea), gdisp->cancelbutton,
FALSE, TRUE, 0);
gtk_widget_set_sensitive (gdisp->cancelbutton, FALSE);
/* the popup menu */
......@@ -1177,6 +1211,13 @@ toolbox_drag_drop (GtkWidget *widget,
return return_val;
}
static ToolType
toolbox_drag_tool (GtkWidget *widget,
gpointer data)
{
return (ToolType) data;
}
static void
toolbox_drop_tool (GtkWidget *widget,
ToolType tool,
......
......@@ -21,29 +21,25 @@
#include "toolsF.h"
#include "gdisplayF.h"
/* externed variables */
extern GtkWidget * tool_widgets[];
extern GtkTooltips * tool_tips;
/* function declarations */
GtkWidget * create_pixmap_widget (GdkWindow *parent,
gchar **data,
gint width,
gint height);
GtkWidget * create_pixmap_widget (GdkWindow *parent,
gchar **data,
gint width,
gint height);
GdkPixmap * create_tool_pixmap (GtkWidget *parent,
ToolType type);
GdkPixmap * create_tool_pixmap (GtkWidget *parent,
ToolType type);
void create_toolbox (void);
void toolbox_free (void);
void create_toolbox (void);
void toolbox_free (void);
void toolbox_raise_callback (GtkWidget *widget,
gpointer client_data);
void toolbox_raise_callback (GtkWidget *widget,
gpointer data);
void create_display_shell (GDisplay *gdisp,
gint width,
gint height,
gchar *title,
gint type);
void create_display_shell (GDisplay *gdisp,
gint width,
gint height,
gchar *title,
gint type);
#endif /* __INTERFACE_H__ */
......@@ -90,6 +90,8 @@ static gboolean toolbox_drag_drop (GtkWidget *,
gint,
gint,
guint);
static ToolType toolbox_drag_tool (GtkWidget *,
gpointer);
static void toolbox_drop_tool (GtkWidget *,
ToolType,
gpointer);
......@@ -111,11 +113,8 @@ static int pixmap_colors[8][3] =
#define ROWS 8
#define MARGIN 2
/* global variables */
GtkTooltips * tool_tips;
/* local variables */
static GdkColor colors[12];
static GdkColor colors[11];
static GtkWidget * toolbox_shell = NULL;
static GtkTargetEntry toolbox_target_table[] =
......@@ -131,6 +130,13 @@ static GtkTargetEntry toolbox_target_table[] =
static guint toolbox_n_targets = (sizeof (toolbox_target_table) /
sizeof (toolbox_target_table[0]));
static GtkTargetEntry tool_target_table[] =