mirror of https://github.com/GNOME/gimp.git
Use static GdkPixmaps in the image_window and for the tool icons.
--Sven
This commit is contained in:
parent
3a0da284c8
commit
d517927260
12
ChangeLog
12
ChangeLog
|
@ -1,3 +1,15 @@
|
||||||
|
Tue Feb 8 21:35:10 CET 2000 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
|
* app/devices.c
|
||||||
|
* app/gimpdnd.c
|
||||||
|
* app/interface.c
|
||||||
|
* app/interface.h
|
||||||
|
* app/tools.c
|
||||||
|
* app/tools.h: create the pixmaps in the image_window and in the
|
||||||
|
toolbox static and reuse them everywhere. Added tool pixmaps to
|
||||||
|
the tool_options dialog as an extra goodie. Should help to
|
||||||
|
visualize that these are tools.
|
||||||
|
|
||||||
2000-02-08 Michael Natterer <mitch@gimp.org>
|
2000-02-08 Michael Natterer <mitch@gimp.org>
|
||||||
|
|
||||||
* app/by_color_select.c: show our selection mode cursors (REPLACE,
|
* app/by_color_select.c: show our selection mode cursors (REPLACE,
|
||||||
|
|
|
@ -735,7 +735,6 @@ void
|
||||||
device_status_create (void)
|
device_status_create (void)
|
||||||
{
|
{
|
||||||
DeviceInfo *device_info;
|
DeviceInfo *device_info;
|
||||||
GdkPixmap *pixmap;
|
|
||||||
GtkWidget *label;
|
GtkWidget *label;
|
||||||
GList *list;
|
GList *list;
|
||||||
gint i;
|
gint i;
|
||||||
|
@ -815,9 +814,7 @@ device_status_create (void)
|
||||||
|
|
||||||
deviceD->eventboxes[i] = gtk_event_box_new();
|
deviceD->eventboxes[i] = gtk_event_box_new();
|
||||||
|
|
||||||
pixmap = create_tool_pixmap (deviceD->table, RECT_SELECT);
|
deviceD->tools[i] = gtk_pixmap_new (tool_get_pixmap (RECT_SELECT), NULL);
|
||||||
deviceD->tools[i] = gtk_pixmap_new (pixmap, NULL);
|
|
||||||
gdk_pixmap_unref (pixmap);
|
|
||||||
|
|
||||||
gtk_drag_source_set (deviceD->eventboxes[i],
|
gtk_drag_source_set (deviceD->eventboxes[i],
|
||||||
GDK_BUTTON1_MASK | GDK_BUTTON2_MASK,
|
GDK_BUTTON1_MASK | GDK_BUTTON2_MASK,
|
||||||
|
@ -984,7 +981,6 @@ device_status_update_current (void)
|
||||||
void
|
void
|
||||||
device_status_update (guint32 deviceid)
|
device_status_update (guint32 deviceid)
|
||||||
{
|
{
|
||||||
GdkPixmap *pixmap;
|
|
||||||
GdkDeviceInfo *gdk_info;
|
GdkDeviceInfo *gdk_info;
|
||||||
DeviceInfo *device_info;
|
DeviceInfo *device_info;
|
||||||
guchar buffer[CELL_SIZE*3];
|
guchar buffer[CELL_SIZE*3];
|
||||||
|
@ -1022,10 +1018,9 @@ device_status_update (guint32 deviceid)
|
||||||
{
|
{
|
||||||
gtk_widget_show (deviceD->frames[i]);
|
gtk_widget_show (deviceD->frames[i]);
|
||||||
|
|
||||||
pixmap = create_tool_pixmap (deviceD->table,
|
gtk_pixmap_set (GTK_PIXMAP (deviceD->tools[i]),
|
||||||
gimp_context_get_tool (device_info->context));
|
tool_get_pixmap (gimp_context_get_tool (device_info->context)),
|
||||||
gtk_pixmap_set (GTK_PIXMAP (deviceD->tools[i]), pixmap, NULL);
|
NULL);
|
||||||
gdk_pixmap_unref (pixmap);
|
|
||||||
|
|
||||||
gtk_widget_draw (deviceD->tools[i], NULL);
|
gtk_widget_draw (deviceD->tools[i], NULL);
|
||||||
gtk_widget_show (deviceD->tools[i]);
|
gtk_widget_show (deviceD->tools[i]);
|
||||||
|
|
|
@ -50,6 +50,7 @@
|
||||||
|
|
||||||
#include "libgimp/gimpintl.h"
|
#include "libgimp/gimpintl.h"
|
||||||
|
|
||||||
|
|
||||||
/* local functions */
|
/* local functions */
|
||||||
static void tools_select_update (GtkWidget *widget,
|
static void tools_select_update (GtkWidget *widget,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
|
@ -312,29 +313,32 @@ create_color_area (GtkWidget *parent)
|
||||||
gtk_widget_show (frame);
|
gtk_widget_show (frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
GdkPixmap *
|
/* creates all icons */
|
||||||
create_tool_pixmap (GtkWidget *parent,
|
static void
|
||||||
ToolType type)
|
create_tool_pixmaps (GtkWidget *parent)
|
||||||
{
|
{
|
||||||
/*
|
ToolType type;
|
||||||
* FIXME this really should be dones without using the #defined tool names
|
gint i;
|
||||||
* but it should work this way for now
|
|
||||||
*/
|
|
||||||
if (type == SCALE || type == SHEAR || type == PERSPECTIVE)
|
|
||||||
type = ROTATE;
|
|
||||||
|
|
||||||
if (tool_info[(int) type].icon_data)
|
g_return_if_fail (parent != NULL);
|
||||||
return create_pixmap (parent->window, NULL,
|
|
||||||
tool_info[(int) type].icon_data,
|
|
||||||
22, 22);
|
|
||||||
else
|
|
||||||
return create_pixmap (parent->window, NULL,
|
|
||||||
dialog_bits,
|
|
||||||
22, 22);
|
|
||||||
|
|
||||||
g_return_val_if_fail (FALSE, NULL);
|
for (i = 0; i < num_tools; i++)
|
||||||
|
{
|
||||||
|
type = i;
|
||||||
|
|
||||||
return NULL; /* not reached */
|
if (type == SCALE || type == SHEAR || type == PERSPECTIVE)
|
||||||
|
type = ROTATE;
|
||||||
|
|
||||||
|
if (tool_info[type].icon_data)
|
||||||
|
tool_info[i].icon_pixmap = create_pixmap (parent->window, NULL,
|
||||||
|
tool_info[type].icon_data,
|
||||||
|
22, 22);
|
||||||
|
|
||||||
|
else
|
||||||
|
tool_info[i].icon_pixmap = create_pixmap (parent->window, NULL,
|
||||||
|
dialog_bits,
|
||||||
|
22, 22);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -350,6 +354,8 @@ create_tools (GtkWidget *parent)
|
||||||
wbox = parent;
|
wbox = parent;
|
||||||
|
|
||||||
gtk_widget_realize (gtk_widget_get_toplevel (wbox));
|
gtk_widget_realize (gtk_widget_get_toplevel (wbox));
|
||||||
|
|
||||||
|
create_tool_pixmaps (wbox);
|
||||||
|
|
||||||
group = NULL;
|
group = NULL;
|
||||||
|
|
||||||
|
@ -371,7 +377,7 @@ create_tools (GtkWidget *parent)
|
||||||
gtk_container_set_border_width (GTK_CONTAINER (alignment), 0);
|
gtk_container_set_border_width (GTK_CONTAINER (alignment), 0);
|
||||||
gtk_container_add (GTK_CONTAINER (button), alignment);
|
gtk_container_add (GTK_CONTAINER (button), alignment);
|
||||||
|
|
||||||
pixmap = create_pixmap_widget (wbox->window, tool_info[j].icon_data, 22, 22);
|
pixmap = gtk_pixmap_new (tool_get_pixmap ((ToolType)j), NULL);
|
||||||
gtk_container_add (GTK_CONTAINER (alignment), pixmap);
|
gtk_container_add (GTK_CONTAINER (alignment), pixmap);
|
||||||
|
|
||||||
gtk_signal_connect (GTK_OBJECT (button), "toggled",
|
gtk_signal_connect (GTK_OBJECT (button), "toggled",
|
||||||
|
@ -499,23 +505,6 @@ create_pixmap (GdkWindow *parent,
|
||||||
return pixmap;
|
return pixmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
GtkWidget*
|
|
||||||
create_pixmap_widget (GdkWindow *parent,
|
|
||||||
gchar **data,
|
|
||||||
gint width,
|
|
||||||
gint height)
|
|
||||||
{
|
|
||||||
GtkWidget *widget;
|
|
||||||
GdkPixmap *pixmap;
|
|
||||||
GdkBitmap *mask;
|
|
||||||
|
|
||||||
pixmap = create_pixmap (parent, &mask, data, width, height);
|
|
||||||
widget = gtk_pixmap_new (pixmap, mask);
|
|
||||||
gdk_pixmap_unref (pixmap);
|
|
||||||
gdk_bitmap_unref (mask);
|
|
||||||
|
|
||||||
return (widget);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
create_toolbox (void)
|
create_toolbox (void)
|
||||||
|
@ -623,6 +612,9 @@ toolbox_free (void)
|
||||||
gtk_widget_destroy (toolbox_shell);
|
gtk_widget_destroy (toolbox_shell);
|
||||||
for (i = 0; i < num_tools; i++)
|
for (i = 0; i < num_tools; i++)
|
||||||
{
|
{
|
||||||
|
if (tool_info[i].icon_pixmap)
|
||||||
|
gdk_pixmap_unref (tool_info[i].icon_pixmap);
|
||||||
|
|
||||||
if (!tool_info[i].icon_data)
|
if (!tool_info[i].icon_data)
|
||||||
gtk_object_sink (GTK_OBJECT (tool_info[i].tool_widget));
|
gtk_object_sink (GTK_OBJECT (tool_info[i].tool_widget));
|
||||||
}
|
}
|
||||||
|
@ -645,6 +637,13 @@ create_display_shell (GDisplay* gdisp,
|
||||||
{
|
{
|
||||||
static GtkWidget *image_popup_menu = NULL;
|
static GtkWidget *image_popup_menu = NULL;
|
||||||
static GtkAccelGroup *image_accel_group = NULL;
|
static GtkAccelGroup *image_accel_group = NULL;
|
||||||
|
|
||||||
|
static GdkPixmap *qmasksel_pixmap = NULL;
|
||||||
|
static GdkBitmap *qmasksel_mask = NULL;
|
||||||
|
static GdkPixmap *qmasknosel_pixmap = NULL;
|
||||||
|
static GdkBitmap *qmasknosel_mask = NULL;
|
||||||
|
static GdkPixmap *navbutton_pixmap = NULL;
|
||||||
|
static GdkBitmap *navbutton_mask = NULL;
|
||||||
|
|
||||||
GtkWidget *vbox;
|
GtkWidget *vbox;
|
||||||
GtkWidget *table;
|
GtkWidget *table;
|
||||||
|
@ -851,48 +850,37 @@ create_display_shell (GDisplay* gdisp,
|
||||||
gtk_widget_set_usize (GTK_WIDGET (gdisp->qmaskon), 15, 15);
|
gtk_widget_set_usize (GTK_WIDGET (gdisp->qmaskon), 15, 15);
|
||||||
gtk_widget_set_usize (GTK_WIDGET (gdisp->qmaskoff), 15, 15);
|
gtk_widget_set_usize (GTK_WIDGET (gdisp->qmaskoff), 15, 15);
|
||||||
|
|
||||||
/* Draw pixmaps - note: you must realize the parent prior to doing the
|
/* Create pixmaps - note: you must realize the parent prior to doing the
|
||||||
rest! */
|
rest! */
|
||||||
{
|
if (!qmasksel_pixmap)
|
||||||
GdkPixmap *pxmp;
|
{
|
||||||
GdkBitmap *mask;
|
GtkStyle *style;
|
||||||
GtkStyle *style;
|
|
||||||
|
gtk_widget_realize (gdisp->shell);
|
||||||
|
style = gtk_widget_get_style (gdisp->shell);
|
||||||
|
|
||||||
|
qmasksel_pixmap = gdk_pixmap_create_from_xpm_d (gdisp->shell->window, &qmasksel_mask,
|
||||||
|
&style->bg[GTK_STATE_NORMAL],
|
||||||
|
qmasksel_xpm);
|
||||||
|
qmasknosel_pixmap = gdk_pixmap_create_from_xpm_d (gdisp->shell->window, &qmasknosel_mask,
|
||||||
|
&style->bg[GTK_STATE_NORMAL],
|
||||||
|
qmasknosel_xpm);
|
||||||
|
navbutton_pixmap = gdk_pixmap_create_from_xpm_d (gdisp->shell->window, &navbutton_mask,
|
||||||
|
&style->bg[GTK_STATE_NORMAL],
|
||||||
|
navbutton_xpm);
|
||||||
|
}
|
||||||
|
|
||||||
gtk_widget_realize (gdisp->shell);
|
pixmap = gtk_pixmap_new (qmasksel_pixmap, qmasksel_mask);
|
||||||
style = gtk_widget_get_style (gdisp->shell);
|
gtk_container_add (GTK_CONTAINER (gdisp->qmaskon), pixmap);
|
||||||
|
gtk_widget_show (pixmap);
|
||||||
pxmp = gdk_pixmap_create_from_xpm_d (gdisp->shell->window, &mask,
|
|
||||||
&style->bg[GTK_STATE_NORMAL],
|
|
||||||
qmasksel_xpm);
|
|
||||||
|
|
||||||
pixmap = gtk_pixmap_new (pxmp, mask);
|
pixmap = gtk_pixmap_new (qmasknosel_pixmap, qmasknosel_mask);
|
||||||
gdk_pixmap_unref (pxmp);
|
gtk_container_add (GTK_CONTAINER (gdisp->qmaskoff), pixmap);
|
||||||
gdk_bitmap_unref (mask);
|
gtk_widget_show (pixmap);
|
||||||
|
|
||||||
gtk_container_add (GTK_CONTAINER (gdisp->qmaskon), pixmap);
|
|
||||||
gtk_widget_show (pixmap);
|
|
||||||
|
|
||||||
pxmp = gdk_pixmap_create_from_xpm_d (gdisp->shell->window, &mask,
|
|
||||||
&style->bg[GTK_STATE_NORMAL],
|
|
||||||
qmasknosel_xpm);
|
|
||||||
pixmap = gtk_pixmap_new (pxmp, mask);
|
|
||||||
gdk_pixmap_unref (pxmp);
|
|
||||||
gdk_bitmap_unref (mask);
|
|
||||||
|
|
||||||
gtk_container_add (GTK_CONTAINER (gdisp->qmaskoff), pixmap);
|
pixmap = gtk_pixmap_new (navbutton_pixmap, navbutton_mask);
|
||||||
gtk_widget_show (pixmap);
|
gtk_container_add (GTK_CONTAINER (navhbox), pixmap);
|
||||||
|
gtk_widget_show (pixmap);
|
||||||
/* nav button pixmap */
|
|
||||||
pxmp = gdk_pixmap_create_from_xpm_d (gdisp->shell->window, &mask,
|
|
||||||
&style->bg[GTK_STATE_NORMAL],
|
|
||||||
navbutton_xpm);
|
|
||||||
pixmap = gtk_pixmap_new (pxmp, mask);
|
|
||||||
gdk_pixmap_unref (pxmp);
|
|
||||||
gdk_bitmap_unref (mask);
|
|
||||||
|
|
||||||
gtk_container_add (GTK_CONTAINER (navhbox), pixmap);
|
|
||||||
gtk_widget_show (pixmap);
|
|
||||||
}
|
|
||||||
|
|
||||||
gdisp->canvas = gtk_drawing_area_new ();
|
gdisp->canvas = gtk_drawing_area_new ();
|
||||||
gtk_drawing_area_size (GTK_DRAWING_AREA (gdisp->canvas), n_width, n_height);
|
gtk_drawing_area_size (GTK_DRAWING_AREA (gdisp->canvas), n_width, n_height);
|
||||||
|
|
|
@ -27,9 +27,6 @@ GtkWidget * create_pixmap_widget (GdkWindow *parent,
|
||||||
gint width,
|
gint width,
|
||||||
gint height);
|
gint height);
|
||||||
|
|
||||||
GdkPixmap * create_tool_pixmap (GtkWidget *parent,
|
|
||||||
ToolType type);
|
|
||||||
|
|
||||||
void create_toolbox (void);
|
void create_toolbox (void);
|
||||||
void toolbox_free (void);
|
void toolbox_free (void);
|
||||||
|
|
||||||
|
|
|
@ -50,6 +50,7 @@
|
||||||
|
|
||||||
#include "libgimp/gimpintl.h"
|
#include "libgimp/gimpintl.h"
|
||||||
|
|
||||||
|
|
||||||
/* local functions */
|
/* local functions */
|
||||||
static void tools_select_update (GtkWidget *widget,
|
static void tools_select_update (GtkWidget *widget,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
|
@ -312,29 +313,32 @@ create_color_area (GtkWidget *parent)
|
||||||
gtk_widget_show (frame);
|
gtk_widget_show (frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
GdkPixmap *
|
/* creates all icons */
|
||||||
create_tool_pixmap (GtkWidget *parent,
|
static void
|
||||||
ToolType type)
|
create_tool_pixmaps (GtkWidget *parent)
|
||||||
{
|
{
|
||||||
/*
|
ToolType type;
|
||||||
* FIXME this really should be dones without using the #defined tool names
|
gint i;
|
||||||
* but it should work this way for now
|
|
||||||
*/
|
|
||||||
if (type == SCALE || type == SHEAR || type == PERSPECTIVE)
|
|
||||||
type = ROTATE;
|
|
||||||
|
|
||||||
if (tool_info[(int) type].icon_data)
|
g_return_if_fail (parent != NULL);
|
||||||
return create_pixmap (parent->window, NULL,
|
|
||||||
tool_info[(int) type].icon_data,
|
|
||||||
22, 22);
|
|
||||||
else
|
|
||||||
return create_pixmap (parent->window, NULL,
|
|
||||||
dialog_bits,
|
|
||||||
22, 22);
|
|
||||||
|
|
||||||
g_return_val_if_fail (FALSE, NULL);
|
for (i = 0; i < num_tools; i++)
|
||||||
|
{
|
||||||
|
type = i;
|
||||||
|
|
||||||
return NULL; /* not reached */
|
if (type == SCALE || type == SHEAR || type == PERSPECTIVE)
|
||||||
|
type = ROTATE;
|
||||||
|
|
||||||
|
if (tool_info[type].icon_data)
|
||||||
|
tool_info[i].icon_pixmap = create_pixmap (parent->window, NULL,
|
||||||
|
tool_info[type].icon_data,
|
||||||
|
22, 22);
|
||||||
|
|
||||||
|
else
|
||||||
|
tool_info[i].icon_pixmap = create_pixmap (parent->window, NULL,
|
||||||
|
dialog_bits,
|
||||||
|
22, 22);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -350,6 +354,8 @@ create_tools (GtkWidget *parent)
|
||||||
wbox = parent;
|
wbox = parent;
|
||||||
|
|
||||||
gtk_widget_realize (gtk_widget_get_toplevel (wbox));
|
gtk_widget_realize (gtk_widget_get_toplevel (wbox));
|
||||||
|
|
||||||
|
create_tool_pixmaps (wbox);
|
||||||
|
|
||||||
group = NULL;
|
group = NULL;
|
||||||
|
|
||||||
|
@ -371,7 +377,7 @@ create_tools (GtkWidget *parent)
|
||||||
gtk_container_set_border_width (GTK_CONTAINER (alignment), 0);
|
gtk_container_set_border_width (GTK_CONTAINER (alignment), 0);
|
||||||
gtk_container_add (GTK_CONTAINER (button), alignment);
|
gtk_container_add (GTK_CONTAINER (button), alignment);
|
||||||
|
|
||||||
pixmap = create_pixmap_widget (wbox->window, tool_info[j].icon_data, 22, 22);
|
pixmap = gtk_pixmap_new (tool_get_pixmap ((ToolType)j), NULL);
|
||||||
gtk_container_add (GTK_CONTAINER (alignment), pixmap);
|
gtk_container_add (GTK_CONTAINER (alignment), pixmap);
|
||||||
|
|
||||||
gtk_signal_connect (GTK_OBJECT (button), "toggled",
|
gtk_signal_connect (GTK_OBJECT (button), "toggled",
|
||||||
|
@ -499,23 +505,6 @@ create_pixmap (GdkWindow *parent,
|
||||||
return pixmap;
|
return pixmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
GtkWidget*
|
|
||||||
create_pixmap_widget (GdkWindow *parent,
|
|
||||||
gchar **data,
|
|
||||||
gint width,
|
|
||||||
gint height)
|
|
||||||
{
|
|
||||||
GtkWidget *widget;
|
|
||||||
GdkPixmap *pixmap;
|
|
||||||
GdkBitmap *mask;
|
|
||||||
|
|
||||||
pixmap = create_pixmap (parent, &mask, data, width, height);
|
|
||||||
widget = gtk_pixmap_new (pixmap, mask);
|
|
||||||
gdk_pixmap_unref (pixmap);
|
|
||||||
gdk_bitmap_unref (mask);
|
|
||||||
|
|
||||||
return (widget);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
create_toolbox (void)
|
create_toolbox (void)
|
||||||
|
@ -623,6 +612,9 @@ toolbox_free (void)
|
||||||
gtk_widget_destroy (toolbox_shell);
|
gtk_widget_destroy (toolbox_shell);
|
||||||
for (i = 0; i < num_tools; i++)
|
for (i = 0; i < num_tools; i++)
|
||||||
{
|
{
|
||||||
|
if (tool_info[i].icon_pixmap)
|
||||||
|
gdk_pixmap_unref (tool_info[i].icon_pixmap);
|
||||||
|
|
||||||
if (!tool_info[i].icon_data)
|
if (!tool_info[i].icon_data)
|
||||||
gtk_object_sink (GTK_OBJECT (tool_info[i].tool_widget));
|
gtk_object_sink (GTK_OBJECT (tool_info[i].tool_widget));
|
||||||
}
|
}
|
||||||
|
@ -645,6 +637,13 @@ create_display_shell (GDisplay* gdisp,
|
||||||
{
|
{
|
||||||
static GtkWidget *image_popup_menu = NULL;
|
static GtkWidget *image_popup_menu = NULL;
|
||||||
static GtkAccelGroup *image_accel_group = NULL;
|
static GtkAccelGroup *image_accel_group = NULL;
|
||||||
|
|
||||||
|
static GdkPixmap *qmasksel_pixmap = NULL;
|
||||||
|
static GdkBitmap *qmasksel_mask = NULL;
|
||||||
|
static GdkPixmap *qmasknosel_pixmap = NULL;
|
||||||
|
static GdkBitmap *qmasknosel_mask = NULL;
|
||||||
|
static GdkPixmap *navbutton_pixmap = NULL;
|
||||||
|
static GdkBitmap *navbutton_mask = NULL;
|
||||||
|
|
||||||
GtkWidget *vbox;
|
GtkWidget *vbox;
|
||||||
GtkWidget *table;
|
GtkWidget *table;
|
||||||
|
@ -851,48 +850,37 @@ create_display_shell (GDisplay* gdisp,
|
||||||
gtk_widget_set_usize (GTK_WIDGET (gdisp->qmaskon), 15, 15);
|
gtk_widget_set_usize (GTK_WIDGET (gdisp->qmaskon), 15, 15);
|
||||||
gtk_widget_set_usize (GTK_WIDGET (gdisp->qmaskoff), 15, 15);
|
gtk_widget_set_usize (GTK_WIDGET (gdisp->qmaskoff), 15, 15);
|
||||||
|
|
||||||
/* Draw pixmaps - note: you must realize the parent prior to doing the
|
/* Create pixmaps - note: you must realize the parent prior to doing the
|
||||||
rest! */
|
rest! */
|
||||||
{
|
if (!qmasksel_pixmap)
|
||||||
GdkPixmap *pxmp;
|
{
|
||||||
GdkBitmap *mask;
|
GtkStyle *style;
|
||||||
GtkStyle *style;
|
|
||||||
|
gtk_widget_realize (gdisp->shell);
|
||||||
|
style = gtk_widget_get_style (gdisp->shell);
|
||||||
|
|
||||||
|
qmasksel_pixmap = gdk_pixmap_create_from_xpm_d (gdisp->shell->window, &qmasksel_mask,
|
||||||
|
&style->bg[GTK_STATE_NORMAL],
|
||||||
|
qmasksel_xpm);
|
||||||
|
qmasknosel_pixmap = gdk_pixmap_create_from_xpm_d (gdisp->shell->window, &qmasknosel_mask,
|
||||||
|
&style->bg[GTK_STATE_NORMAL],
|
||||||
|
qmasknosel_xpm);
|
||||||
|
navbutton_pixmap = gdk_pixmap_create_from_xpm_d (gdisp->shell->window, &navbutton_mask,
|
||||||
|
&style->bg[GTK_STATE_NORMAL],
|
||||||
|
navbutton_xpm);
|
||||||
|
}
|
||||||
|
|
||||||
gtk_widget_realize (gdisp->shell);
|
pixmap = gtk_pixmap_new (qmasksel_pixmap, qmasksel_mask);
|
||||||
style = gtk_widget_get_style (gdisp->shell);
|
gtk_container_add (GTK_CONTAINER (gdisp->qmaskon), pixmap);
|
||||||
|
gtk_widget_show (pixmap);
|
||||||
pxmp = gdk_pixmap_create_from_xpm_d (gdisp->shell->window, &mask,
|
|
||||||
&style->bg[GTK_STATE_NORMAL],
|
|
||||||
qmasksel_xpm);
|
|
||||||
|
|
||||||
pixmap = gtk_pixmap_new (pxmp, mask);
|
pixmap = gtk_pixmap_new (qmasknosel_pixmap, qmasknosel_mask);
|
||||||
gdk_pixmap_unref (pxmp);
|
gtk_container_add (GTK_CONTAINER (gdisp->qmaskoff), pixmap);
|
||||||
gdk_bitmap_unref (mask);
|
gtk_widget_show (pixmap);
|
||||||
|
|
||||||
gtk_container_add (GTK_CONTAINER (gdisp->qmaskon), pixmap);
|
|
||||||
gtk_widget_show (pixmap);
|
|
||||||
|
|
||||||
pxmp = gdk_pixmap_create_from_xpm_d (gdisp->shell->window, &mask,
|
|
||||||
&style->bg[GTK_STATE_NORMAL],
|
|
||||||
qmasknosel_xpm);
|
|
||||||
pixmap = gtk_pixmap_new (pxmp, mask);
|
|
||||||
gdk_pixmap_unref (pxmp);
|
|
||||||
gdk_bitmap_unref (mask);
|
|
||||||
|
|
||||||
gtk_container_add (GTK_CONTAINER (gdisp->qmaskoff), pixmap);
|
pixmap = gtk_pixmap_new (navbutton_pixmap, navbutton_mask);
|
||||||
gtk_widget_show (pixmap);
|
gtk_container_add (GTK_CONTAINER (navhbox), pixmap);
|
||||||
|
gtk_widget_show (pixmap);
|
||||||
/* nav button pixmap */
|
|
||||||
pxmp = gdk_pixmap_create_from_xpm_d (gdisp->shell->window, &mask,
|
|
||||||
&style->bg[GTK_STATE_NORMAL],
|
|
||||||
navbutton_xpm);
|
|
||||||
pixmap = gtk_pixmap_new (pxmp, mask);
|
|
||||||
gdk_pixmap_unref (pxmp);
|
|
||||||
gdk_bitmap_unref (mask);
|
|
||||||
|
|
||||||
gtk_container_add (GTK_CONTAINER (navhbox), pixmap);
|
|
||||||
gtk_widget_show (pixmap);
|
|
||||||
}
|
|
||||||
|
|
||||||
gdisp->canvas = gtk_drawing_area_new ();
|
gdisp->canvas = gtk_drawing_area_new ();
|
||||||
gtk_drawing_area_size (GTK_DRAWING_AREA (gdisp->canvas), n_width, n_height);
|
gtk_drawing_area_size (GTK_DRAWING_AREA (gdisp->canvas), n_width, n_height);
|
||||||
|
|
|
@ -27,9 +27,6 @@ GtkWidget * create_pixmap_widget (GdkWindow *parent,
|
||||||
gint width,
|
gint width,
|
||||||
gint height);
|
gint height);
|
||||||
|
|
||||||
GdkPixmap * create_tool_pixmap (GtkWidget *parent,
|
|
||||||
ToolType type);
|
|
||||||
|
|
||||||
void create_toolbox (void);
|
void create_toolbox (void);
|
||||||
void toolbox_free (void);
|
void toolbox_free (void);
|
||||||
|
|
||||||
|
|
|
@ -939,7 +939,6 @@ gimp_dnd_get_tool_icon (GtkWidget *widget,
|
||||||
GtkSignalFunc get_tool_func,
|
GtkSignalFunc get_tool_func,
|
||||||
gpointer get_tool_data)
|
gpointer get_tool_data)
|
||||||
{
|
{
|
||||||
GdkPixmap *tool_pixmap;
|
|
||||||
GtkWidget *tool_icon;
|
GtkWidget *tool_icon;
|
||||||
ToolType tool_type;
|
ToolType tool_type;
|
||||||
|
|
||||||
|
@ -949,11 +948,7 @@ gimp_dnd_get_tool_icon (GtkWidget *widget,
|
||||||
if (((gint) tool_type < 0) || ((gint) tool_type >= num_tools))
|
if (((gint) tool_type < 0) || ((gint) tool_type >= num_tools))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
tool_pixmap = create_tool_pixmap (widget, tool_type);
|
tool_icon = gtk_pixmap_new (tool_get_pixmap (tool_type), NULL);
|
||||||
|
|
||||||
tool_icon = gtk_pixmap_new (tool_pixmap, NULL);
|
|
||||||
|
|
||||||
gdk_pixmap_unref (tool_pixmap);
|
|
||||||
|
|
||||||
return tool_icon;
|
return tool_icon;
|
||||||
}
|
}
|
||||||
|
|
|
@ -735,7 +735,6 @@ void
|
||||||
device_status_create (void)
|
device_status_create (void)
|
||||||
{
|
{
|
||||||
DeviceInfo *device_info;
|
DeviceInfo *device_info;
|
||||||
GdkPixmap *pixmap;
|
|
||||||
GtkWidget *label;
|
GtkWidget *label;
|
||||||
GList *list;
|
GList *list;
|
||||||
gint i;
|
gint i;
|
||||||
|
@ -815,9 +814,7 @@ device_status_create (void)
|
||||||
|
|
||||||
deviceD->eventboxes[i] = gtk_event_box_new();
|
deviceD->eventboxes[i] = gtk_event_box_new();
|
||||||
|
|
||||||
pixmap = create_tool_pixmap (deviceD->table, RECT_SELECT);
|
deviceD->tools[i] = gtk_pixmap_new (tool_get_pixmap (RECT_SELECT), NULL);
|
||||||
deviceD->tools[i] = gtk_pixmap_new (pixmap, NULL);
|
|
||||||
gdk_pixmap_unref (pixmap);
|
|
||||||
|
|
||||||
gtk_drag_source_set (deviceD->eventboxes[i],
|
gtk_drag_source_set (deviceD->eventboxes[i],
|
||||||
GDK_BUTTON1_MASK | GDK_BUTTON2_MASK,
|
GDK_BUTTON1_MASK | GDK_BUTTON2_MASK,
|
||||||
|
@ -984,7 +981,6 @@ device_status_update_current (void)
|
||||||
void
|
void
|
||||||
device_status_update (guint32 deviceid)
|
device_status_update (guint32 deviceid)
|
||||||
{
|
{
|
||||||
GdkPixmap *pixmap;
|
|
||||||
GdkDeviceInfo *gdk_info;
|
GdkDeviceInfo *gdk_info;
|
||||||
DeviceInfo *device_info;
|
DeviceInfo *device_info;
|
||||||
guchar buffer[CELL_SIZE*3];
|
guchar buffer[CELL_SIZE*3];
|
||||||
|
@ -1022,10 +1018,9 @@ device_status_update (guint32 deviceid)
|
||||||
{
|
{
|
||||||
gtk_widget_show (deviceD->frames[i]);
|
gtk_widget_show (deviceD->frames[i]);
|
||||||
|
|
||||||
pixmap = create_tool_pixmap (deviceD->table,
|
gtk_pixmap_set (GTK_PIXMAP (deviceD->tools[i]),
|
||||||
gimp_context_get_tool (device_info->context));
|
tool_get_pixmap (gimp_context_get_tool (device_info->context)),
|
||||||
gtk_pixmap_set (GTK_PIXMAP (deviceD->tools[i]), pixmap, NULL);
|
NULL);
|
||||||
gdk_pixmap_unref (pixmap);
|
|
||||||
|
|
||||||
gtk_widget_draw (deviceD->tools[i], NULL);
|
gtk_widget_draw (deviceD->tools[i], NULL);
|
||||||
gtk_widget_show (deviceD->tools[i]);
|
gtk_widget_show (deviceD->tools[i]);
|
||||||
|
|
|
@ -735,7 +735,6 @@ void
|
||||||
device_status_create (void)
|
device_status_create (void)
|
||||||
{
|
{
|
||||||
DeviceInfo *device_info;
|
DeviceInfo *device_info;
|
||||||
GdkPixmap *pixmap;
|
|
||||||
GtkWidget *label;
|
GtkWidget *label;
|
||||||
GList *list;
|
GList *list;
|
||||||
gint i;
|
gint i;
|
||||||
|
@ -815,9 +814,7 @@ device_status_create (void)
|
||||||
|
|
||||||
deviceD->eventboxes[i] = gtk_event_box_new();
|
deviceD->eventboxes[i] = gtk_event_box_new();
|
||||||
|
|
||||||
pixmap = create_tool_pixmap (deviceD->table, RECT_SELECT);
|
deviceD->tools[i] = gtk_pixmap_new (tool_get_pixmap (RECT_SELECT), NULL);
|
||||||
deviceD->tools[i] = gtk_pixmap_new (pixmap, NULL);
|
|
||||||
gdk_pixmap_unref (pixmap);
|
|
||||||
|
|
||||||
gtk_drag_source_set (deviceD->eventboxes[i],
|
gtk_drag_source_set (deviceD->eventboxes[i],
|
||||||
GDK_BUTTON1_MASK | GDK_BUTTON2_MASK,
|
GDK_BUTTON1_MASK | GDK_BUTTON2_MASK,
|
||||||
|
@ -984,7 +981,6 @@ device_status_update_current (void)
|
||||||
void
|
void
|
||||||
device_status_update (guint32 deviceid)
|
device_status_update (guint32 deviceid)
|
||||||
{
|
{
|
||||||
GdkPixmap *pixmap;
|
|
||||||
GdkDeviceInfo *gdk_info;
|
GdkDeviceInfo *gdk_info;
|
||||||
DeviceInfo *device_info;
|
DeviceInfo *device_info;
|
||||||
guchar buffer[CELL_SIZE*3];
|
guchar buffer[CELL_SIZE*3];
|
||||||
|
@ -1022,10 +1018,9 @@ device_status_update (guint32 deviceid)
|
||||||
{
|
{
|
||||||
gtk_widget_show (deviceD->frames[i]);
|
gtk_widget_show (deviceD->frames[i]);
|
||||||
|
|
||||||
pixmap = create_tool_pixmap (deviceD->table,
|
gtk_pixmap_set (GTK_PIXMAP (deviceD->tools[i]),
|
||||||
gimp_context_get_tool (device_info->context));
|
tool_get_pixmap (gimp_context_get_tool (device_info->context)),
|
||||||
gtk_pixmap_set (GTK_PIXMAP (deviceD->tools[i]), pixmap, NULL);
|
NULL);
|
||||||
gdk_pixmap_unref (pixmap);
|
|
||||||
|
|
||||||
gtk_widget_draw (deviceD->tools[i], NULL);
|
gtk_widget_draw (deviceD->tools[i], NULL);
|
||||||
gtk_widget_show (deviceD->tools[i]);
|
gtk_widget_show (deviceD->tools[i]);
|
||||||
|
|
138
app/interface.c
138
app/interface.c
|
@ -50,6 +50,7 @@
|
||||||
|
|
||||||
#include "libgimp/gimpintl.h"
|
#include "libgimp/gimpintl.h"
|
||||||
|
|
||||||
|
|
||||||
/* local functions */
|
/* local functions */
|
||||||
static void tools_select_update (GtkWidget *widget,
|
static void tools_select_update (GtkWidget *widget,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
|
@ -312,29 +313,32 @@ create_color_area (GtkWidget *parent)
|
||||||
gtk_widget_show (frame);
|
gtk_widget_show (frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
GdkPixmap *
|
/* creates all icons */
|
||||||
create_tool_pixmap (GtkWidget *parent,
|
static void
|
||||||
ToolType type)
|
create_tool_pixmaps (GtkWidget *parent)
|
||||||
{
|
{
|
||||||
/*
|
ToolType type;
|
||||||
* FIXME this really should be dones without using the #defined tool names
|
gint i;
|
||||||
* but it should work this way for now
|
|
||||||
*/
|
|
||||||
if (type == SCALE || type == SHEAR || type == PERSPECTIVE)
|
|
||||||
type = ROTATE;
|
|
||||||
|
|
||||||
if (tool_info[(int) type].icon_data)
|
g_return_if_fail (parent != NULL);
|
||||||
return create_pixmap (parent->window, NULL,
|
|
||||||
tool_info[(int) type].icon_data,
|
|
||||||
22, 22);
|
|
||||||
else
|
|
||||||
return create_pixmap (parent->window, NULL,
|
|
||||||
dialog_bits,
|
|
||||||
22, 22);
|
|
||||||
|
|
||||||
g_return_val_if_fail (FALSE, NULL);
|
for (i = 0; i < num_tools; i++)
|
||||||
|
{
|
||||||
|
type = i;
|
||||||
|
|
||||||
return NULL; /* not reached */
|
if (type == SCALE || type == SHEAR || type == PERSPECTIVE)
|
||||||
|
type = ROTATE;
|
||||||
|
|
||||||
|
if (tool_info[type].icon_data)
|
||||||
|
tool_info[i].icon_pixmap = create_pixmap (parent->window, NULL,
|
||||||
|
tool_info[type].icon_data,
|
||||||
|
22, 22);
|
||||||
|
|
||||||
|
else
|
||||||
|
tool_info[i].icon_pixmap = create_pixmap (parent->window, NULL,
|
||||||
|
dialog_bits,
|
||||||
|
22, 22);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -350,6 +354,8 @@ create_tools (GtkWidget *parent)
|
||||||
wbox = parent;
|
wbox = parent;
|
||||||
|
|
||||||
gtk_widget_realize (gtk_widget_get_toplevel (wbox));
|
gtk_widget_realize (gtk_widget_get_toplevel (wbox));
|
||||||
|
|
||||||
|
create_tool_pixmaps (wbox);
|
||||||
|
|
||||||
group = NULL;
|
group = NULL;
|
||||||
|
|
||||||
|
@ -371,7 +377,7 @@ create_tools (GtkWidget *parent)
|
||||||
gtk_container_set_border_width (GTK_CONTAINER (alignment), 0);
|
gtk_container_set_border_width (GTK_CONTAINER (alignment), 0);
|
||||||
gtk_container_add (GTK_CONTAINER (button), alignment);
|
gtk_container_add (GTK_CONTAINER (button), alignment);
|
||||||
|
|
||||||
pixmap = create_pixmap_widget (wbox->window, tool_info[j].icon_data, 22, 22);
|
pixmap = gtk_pixmap_new (tool_get_pixmap ((ToolType)j), NULL);
|
||||||
gtk_container_add (GTK_CONTAINER (alignment), pixmap);
|
gtk_container_add (GTK_CONTAINER (alignment), pixmap);
|
||||||
|
|
||||||
gtk_signal_connect (GTK_OBJECT (button), "toggled",
|
gtk_signal_connect (GTK_OBJECT (button), "toggled",
|
||||||
|
@ -499,23 +505,6 @@ create_pixmap (GdkWindow *parent,
|
||||||
return pixmap;
|
return pixmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
GtkWidget*
|
|
||||||
create_pixmap_widget (GdkWindow *parent,
|
|
||||||
gchar **data,
|
|
||||||
gint width,
|
|
||||||
gint height)
|
|
||||||
{
|
|
||||||
GtkWidget *widget;
|
|
||||||
GdkPixmap *pixmap;
|
|
||||||
GdkBitmap *mask;
|
|
||||||
|
|
||||||
pixmap = create_pixmap (parent, &mask, data, width, height);
|
|
||||||
widget = gtk_pixmap_new (pixmap, mask);
|
|
||||||
gdk_pixmap_unref (pixmap);
|
|
||||||
gdk_bitmap_unref (mask);
|
|
||||||
|
|
||||||
return (widget);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
create_toolbox (void)
|
create_toolbox (void)
|
||||||
|
@ -623,6 +612,9 @@ toolbox_free (void)
|
||||||
gtk_widget_destroy (toolbox_shell);
|
gtk_widget_destroy (toolbox_shell);
|
||||||
for (i = 0; i < num_tools; i++)
|
for (i = 0; i < num_tools; i++)
|
||||||
{
|
{
|
||||||
|
if (tool_info[i].icon_pixmap)
|
||||||
|
gdk_pixmap_unref (tool_info[i].icon_pixmap);
|
||||||
|
|
||||||
if (!tool_info[i].icon_data)
|
if (!tool_info[i].icon_data)
|
||||||
gtk_object_sink (GTK_OBJECT (tool_info[i].tool_widget));
|
gtk_object_sink (GTK_OBJECT (tool_info[i].tool_widget));
|
||||||
}
|
}
|
||||||
|
@ -645,6 +637,13 @@ create_display_shell (GDisplay* gdisp,
|
||||||
{
|
{
|
||||||
static GtkWidget *image_popup_menu = NULL;
|
static GtkWidget *image_popup_menu = NULL;
|
||||||
static GtkAccelGroup *image_accel_group = NULL;
|
static GtkAccelGroup *image_accel_group = NULL;
|
||||||
|
|
||||||
|
static GdkPixmap *qmasksel_pixmap = NULL;
|
||||||
|
static GdkBitmap *qmasksel_mask = NULL;
|
||||||
|
static GdkPixmap *qmasknosel_pixmap = NULL;
|
||||||
|
static GdkBitmap *qmasknosel_mask = NULL;
|
||||||
|
static GdkPixmap *navbutton_pixmap = NULL;
|
||||||
|
static GdkBitmap *navbutton_mask = NULL;
|
||||||
|
|
||||||
GtkWidget *vbox;
|
GtkWidget *vbox;
|
||||||
GtkWidget *table;
|
GtkWidget *table;
|
||||||
|
@ -851,48 +850,37 @@ create_display_shell (GDisplay* gdisp,
|
||||||
gtk_widget_set_usize (GTK_WIDGET (gdisp->qmaskon), 15, 15);
|
gtk_widget_set_usize (GTK_WIDGET (gdisp->qmaskon), 15, 15);
|
||||||
gtk_widget_set_usize (GTK_WIDGET (gdisp->qmaskoff), 15, 15);
|
gtk_widget_set_usize (GTK_WIDGET (gdisp->qmaskoff), 15, 15);
|
||||||
|
|
||||||
/* Draw pixmaps - note: you must realize the parent prior to doing the
|
/* Create pixmaps - note: you must realize the parent prior to doing the
|
||||||
rest! */
|
rest! */
|
||||||
{
|
if (!qmasksel_pixmap)
|
||||||
GdkPixmap *pxmp;
|
{
|
||||||
GdkBitmap *mask;
|
GtkStyle *style;
|
||||||
GtkStyle *style;
|
|
||||||
|
gtk_widget_realize (gdisp->shell);
|
||||||
|
style = gtk_widget_get_style (gdisp->shell);
|
||||||
|
|
||||||
|
qmasksel_pixmap = gdk_pixmap_create_from_xpm_d (gdisp->shell->window, &qmasksel_mask,
|
||||||
|
&style->bg[GTK_STATE_NORMAL],
|
||||||
|
qmasksel_xpm);
|
||||||
|
qmasknosel_pixmap = gdk_pixmap_create_from_xpm_d (gdisp->shell->window, &qmasknosel_mask,
|
||||||
|
&style->bg[GTK_STATE_NORMAL],
|
||||||
|
qmasknosel_xpm);
|
||||||
|
navbutton_pixmap = gdk_pixmap_create_from_xpm_d (gdisp->shell->window, &navbutton_mask,
|
||||||
|
&style->bg[GTK_STATE_NORMAL],
|
||||||
|
navbutton_xpm);
|
||||||
|
}
|
||||||
|
|
||||||
gtk_widget_realize (gdisp->shell);
|
pixmap = gtk_pixmap_new (qmasksel_pixmap, qmasksel_mask);
|
||||||
style = gtk_widget_get_style (gdisp->shell);
|
gtk_container_add (GTK_CONTAINER (gdisp->qmaskon), pixmap);
|
||||||
|
gtk_widget_show (pixmap);
|
||||||
pxmp = gdk_pixmap_create_from_xpm_d (gdisp->shell->window, &mask,
|
|
||||||
&style->bg[GTK_STATE_NORMAL],
|
|
||||||
qmasksel_xpm);
|
|
||||||
|
|
||||||
pixmap = gtk_pixmap_new (pxmp, mask);
|
pixmap = gtk_pixmap_new (qmasknosel_pixmap, qmasknosel_mask);
|
||||||
gdk_pixmap_unref (pxmp);
|
gtk_container_add (GTK_CONTAINER (gdisp->qmaskoff), pixmap);
|
||||||
gdk_bitmap_unref (mask);
|
gtk_widget_show (pixmap);
|
||||||
|
|
||||||
gtk_container_add (GTK_CONTAINER (gdisp->qmaskon), pixmap);
|
|
||||||
gtk_widget_show (pixmap);
|
|
||||||
|
|
||||||
pxmp = gdk_pixmap_create_from_xpm_d (gdisp->shell->window, &mask,
|
|
||||||
&style->bg[GTK_STATE_NORMAL],
|
|
||||||
qmasknosel_xpm);
|
|
||||||
pixmap = gtk_pixmap_new (pxmp, mask);
|
|
||||||
gdk_pixmap_unref (pxmp);
|
|
||||||
gdk_bitmap_unref (mask);
|
|
||||||
|
|
||||||
gtk_container_add (GTK_CONTAINER (gdisp->qmaskoff), pixmap);
|
pixmap = gtk_pixmap_new (navbutton_pixmap, navbutton_mask);
|
||||||
gtk_widget_show (pixmap);
|
gtk_container_add (GTK_CONTAINER (navhbox), pixmap);
|
||||||
|
gtk_widget_show (pixmap);
|
||||||
/* nav button pixmap */
|
|
||||||
pxmp = gdk_pixmap_create_from_xpm_d (gdisp->shell->window, &mask,
|
|
||||||
&style->bg[GTK_STATE_NORMAL],
|
|
||||||
navbutton_xpm);
|
|
||||||
pixmap = gtk_pixmap_new (pxmp, mask);
|
|
||||||
gdk_pixmap_unref (pxmp);
|
|
||||||
gdk_bitmap_unref (mask);
|
|
||||||
|
|
||||||
gtk_container_add (GTK_CONTAINER (navhbox), pixmap);
|
|
||||||
gtk_widget_show (pixmap);
|
|
||||||
}
|
|
||||||
|
|
||||||
gdisp->canvas = gtk_drawing_area_new ();
|
gdisp->canvas = gtk_drawing_area_new ();
|
||||||
gtk_drawing_area_size (GTK_DRAWING_AREA (gdisp->canvas), n_width, n_height);
|
gtk_drawing_area_size (GTK_DRAWING_AREA (gdisp->canvas), n_width, n_height);
|
||||||
|
|
|
@ -27,9 +27,6 @@ GtkWidget * create_pixmap_widget (GdkWindow *parent,
|
||||||
gint width,
|
gint width,
|
||||||
gint height);
|
gint height);
|
||||||
|
|
||||||
GdkPixmap * create_tool_pixmap (GtkWidget *parent,
|
|
||||||
ToolType type);
|
|
||||||
|
|
||||||
void create_toolbox (void);
|
void create_toolbox (void);
|
||||||
void toolbox_free (void);
|
void toolbox_free (void);
|
||||||
|
|
||||||
|
|
66
app/tools.c
66
app/tools.c
|
@ -43,6 +43,7 @@
|
||||||
#include "fuzzy_select.h"
|
#include "fuzzy_select.h"
|
||||||
#include "histogram_tool.h"
|
#include "histogram_tool.h"
|
||||||
#include "ink.h"
|
#include "ink.h"
|
||||||
|
#include "interface.h"
|
||||||
#include "iscissors.h"
|
#include "iscissors.h"
|
||||||
#include "levels.h"
|
#include "levels.h"
|
||||||
#include "magnify.h"
|
#include "magnify.h"
|
||||||
|
@ -74,6 +75,7 @@ Tool * active_tool = NULL;
|
||||||
static GtkWidget * options_shell = NULL;
|
static GtkWidget * options_shell = NULL;
|
||||||
static GtkWidget * options_vbox = NULL;
|
static GtkWidget * options_vbox = NULL;
|
||||||
static GtkWidget * options_label = NULL;
|
static GtkWidget * options_label = NULL;
|
||||||
|
static GtkWidget * options_pixmap = NULL;
|
||||||
static GtkWidget * options_reset_button = NULL;
|
static GtkWidget * options_reset_button = NULL;
|
||||||
|
|
||||||
static gint global_tool_ID = 0;
|
static gint global_tool_ID = 0;
|
||||||
|
@ -86,6 +88,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Tools/Select Tools/Rect Select"),
|
N_("/Tools/Select Tools/Rect Select"),
|
||||||
"R",
|
"R",
|
||||||
(char **) rect_bits,
|
(char **) rect_bits,
|
||||||
|
NULL,
|
||||||
N_("Select rectangular regions"),
|
N_("Select rectangular regions"),
|
||||||
"tools/rect_select.html",
|
"tools/rect_select.html",
|
||||||
RECT_SELECT,
|
RECT_SELECT,
|
||||||
|
@ -102,6 +105,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Tools/Select Tools/Ellipse Select"),
|
N_("/Tools/Select Tools/Ellipse Select"),
|
||||||
"E",
|
"E",
|
||||||
(char **) circ_bits,
|
(char **) circ_bits,
|
||||||
|
NULL,
|
||||||
N_("Select elliptical regions"),
|
N_("Select elliptical regions"),
|
||||||
"tools/ellipse_select.html",
|
"tools/ellipse_select.html",
|
||||||
ELLIPSE_SELECT,
|
ELLIPSE_SELECT,
|
||||||
|
@ -118,6 +122,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Tools/Select Tools/Free Select"),
|
N_("/Tools/Select Tools/Free Select"),
|
||||||
"F",
|
"F",
|
||||||
(char **) free_bits,
|
(char **) free_bits,
|
||||||
|
NULL,
|
||||||
N_("Select hand-drawn regions"),
|
N_("Select hand-drawn regions"),
|
||||||
"tools/free_select.html",
|
"tools/free_select.html",
|
||||||
FREE_SELECT,
|
FREE_SELECT,
|
||||||
|
@ -134,6 +139,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Tools/Select Tools/Fuzzy Select"),
|
N_("/Tools/Select Tools/Fuzzy Select"),
|
||||||
"Z",
|
"Z",
|
||||||
(char **) fuzzy_bits,
|
(char **) fuzzy_bits,
|
||||||
|
NULL,
|
||||||
N_("Select contiguous regions"),
|
N_("Select contiguous regions"),
|
||||||
"tools/fuzzy_select.html",
|
"tools/fuzzy_select.html",
|
||||||
FUZZY_SELECT,
|
FUZZY_SELECT,
|
||||||
|
@ -150,6 +156,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Tools/Select Tools/Bezier Select"),
|
N_("/Tools/Select Tools/Bezier Select"),
|
||||||
"B",
|
"B",
|
||||||
(char **) bezier_bits,
|
(char **) bezier_bits,
|
||||||
|
NULL,
|
||||||
N_("Select regions using Bezier curves"),
|
N_("Select regions using Bezier curves"),
|
||||||
"tools/bezier_select.html",
|
"tools/bezier_select.html",
|
||||||
BEZIER_SELECT,
|
BEZIER_SELECT,
|
||||||
|
@ -166,6 +173,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Tools/Select Tools/Intelligent Scissors"),
|
N_("/Tools/Select Tools/Intelligent Scissors"),
|
||||||
"I",
|
"I",
|
||||||
(char **) iscissors_bits,
|
(char **) iscissors_bits,
|
||||||
|
NULL,
|
||||||
N_("Select shapes from image"),
|
N_("Select shapes from image"),
|
||||||
"tools/intelligent_scissors.html",
|
"tools/intelligent_scissors.html",
|
||||||
ISCISSORS,
|
ISCISSORS,
|
||||||
|
@ -182,6 +190,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Tools/Transform Tools/Move"),
|
N_("/Tools/Transform Tools/Move"),
|
||||||
"M",
|
"M",
|
||||||
(char **) move_bits,
|
(char **) move_bits,
|
||||||
|
NULL,
|
||||||
N_("Move layers & selections"),
|
N_("Move layers & selections"),
|
||||||
"tools/move.html",
|
"tools/move.html",
|
||||||
MOVE,
|
MOVE,
|
||||||
|
@ -198,6 +207,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Tools/Transform Tools/Magnify"),
|
N_("/Tools/Transform Tools/Magnify"),
|
||||||
"<shift>M",
|
"<shift>M",
|
||||||
(char **) magnify_bits,
|
(char **) magnify_bits,
|
||||||
|
NULL,
|
||||||
N_("Zoom in & out"),
|
N_("Zoom in & out"),
|
||||||
"tools/magnify.html",
|
"tools/magnify.html",
|
||||||
MAGNIFY,
|
MAGNIFY,
|
||||||
|
@ -214,6 +224,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Tools/Transform Tools/Crop & Resize"),
|
N_("/Tools/Transform Tools/Crop & Resize"),
|
||||||
"<shift>C",
|
"<shift>C",
|
||||||
(char **) crop_bits,
|
(char **) crop_bits,
|
||||||
|
NULL,
|
||||||
N_("Crop or resize the image"),
|
N_("Crop or resize the image"),
|
||||||
"tools/crop.html",
|
"tools/crop.html",
|
||||||
CROP,
|
CROP,
|
||||||
|
@ -230,6 +241,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Tools/Transform Tools/Transform"),
|
N_("/Tools/Transform Tools/Transform"),
|
||||||
"<shift>T",
|
"<shift>T",
|
||||||
(char **) scale_bits,
|
(char **) scale_bits,
|
||||||
|
NULL,
|
||||||
N_("Rotation, scaling, shearing, perspective."),
|
N_("Rotation, scaling, shearing, perspective."),
|
||||||
"tools/transform.html",
|
"tools/transform.html",
|
||||||
ROTATE,
|
ROTATE,
|
||||||
|
@ -246,6 +258,7 @@ ToolInfo tool_info[] =
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
|
NULL,
|
||||||
N_("Rotation, scaling, shearing, perspective."),
|
N_("Rotation, scaling, shearing, perspective."),
|
||||||
"tools/transform.html",
|
"tools/transform.html",
|
||||||
SCALE,
|
SCALE,
|
||||||
|
@ -262,6 +275,7 @@ ToolInfo tool_info[] =
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
|
NULL,
|
||||||
N_("Rotation, scaling, shearing, perspective."),
|
N_("Rotation, scaling, shearing, perspective."),
|
||||||
"tools/transform.html",
|
"tools/transform.html",
|
||||||
SHEAR,
|
SHEAR,
|
||||||
|
@ -278,6 +292,7 @@ ToolInfo tool_info[] =
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
|
NULL,
|
||||||
N_("Rotation, scaling, shearing, perspective."),
|
N_("Rotation, scaling, shearing, perspective."),
|
||||||
"tools/transform.html",
|
"tools/transform.html",
|
||||||
PERSPECTIVE,
|
PERSPECTIVE,
|
||||||
|
@ -294,6 +309,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Tools/Transform Tools/Flip"),
|
N_("/Tools/Transform Tools/Flip"),
|
||||||
"<shift>F",
|
"<shift>F",
|
||||||
(char **) flip_bits,
|
(char **) flip_bits,
|
||||||
|
NULL,
|
||||||
N_("Flip the layer or selection"),
|
N_("Flip the layer or selection"),
|
||||||
"tools/flip.html",
|
"tools/flip.html",
|
||||||
FLIP,
|
FLIP,
|
||||||
|
@ -310,6 +326,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Tools/Text"),
|
N_("/Tools/Text"),
|
||||||
"T",
|
"T",
|
||||||
(char **) text_bits,
|
(char **) text_bits,
|
||||||
|
NULL,
|
||||||
N_("Add text to the image"),
|
N_("Add text to the image"),
|
||||||
"tools/text.html",
|
"tools/text.html",
|
||||||
TEXT,
|
TEXT,
|
||||||
|
@ -326,6 +343,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Tools/Color Picker"),
|
N_("/Tools/Color Picker"),
|
||||||
"O",
|
"O",
|
||||||
(char **) colorpicker_bits,
|
(char **) colorpicker_bits,
|
||||||
|
NULL,
|
||||||
N_("Pick colors from the image"),
|
N_("Pick colors from the image"),
|
||||||
"tools/color_picker.html",
|
"tools/color_picker.html",
|
||||||
COLOR_PICKER,
|
COLOR_PICKER,
|
||||||
|
@ -342,6 +360,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Tools/Paint Tools/Bucket Fill"),
|
N_("/Tools/Paint Tools/Bucket Fill"),
|
||||||
"<shift>B",
|
"<shift>B",
|
||||||
(char **) fill_bits,
|
(char **) fill_bits,
|
||||||
|
NULL,
|
||||||
N_("Fill with a color or pattern"),
|
N_("Fill with a color or pattern"),
|
||||||
"tools/bucket_fill.html",
|
"tools/bucket_fill.html",
|
||||||
BUCKET_FILL,
|
BUCKET_FILL,
|
||||||
|
@ -358,6 +377,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Tools/Paint Tools/Blend"),
|
N_("/Tools/Paint Tools/Blend"),
|
||||||
"L",
|
"L",
|
||||||
(char **) gradient_bits,
|
(char **) gradient_bits,
|
||||||
|
NULL,
|
||||||
N_("Fill with a color gradient"),
|
N_("Fill with a color gradient"),
|
||||||
"tools/blend.html",
|
"tools/blend.html",
|
||||||
BLEND,
|
BLEND,
|
||||||
|
@ -374,6 +394,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Tools/Paint Tools/Pencil"),
|
N_("/Tools/Paint Tools/Pencil"),
|
||||||
"<shift>P",
|
"<shift>P",
|
||||||
(char **) pencil_bits,
|
(char **) pencil_bits,
|
||||||
|
NULL,
|
||||||
N_("Draw sharp pencil strokes"),
|
N_("Draw sharp pencil strokes"),
|
||||||
"tools/pencil.html",
|
"tools/pencil.html",
|
||||||
PENCIL,
|
PENCIL,
|
||||||
|
@ -390,6 +411,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Tools/Paint Tools/Paintbrush"),
|
N_("/Tools/Paint Tools/Paintbrush"),
|
||||||
"P",
|
"P",
|
||||||
(char **) paint_bits,
|
(char **) paint_bits,
|
||||||
|
NULL,
|
||||||
N_("Paint fuzzy brush strokes"),
|
N_("Paint fuzzy brush strokes"),
|
||||||
"tools/paintbrush.html",
|
"tools/paintbrush.html",
|
||||||
PAINTBRUSH,
|
PAINTBRUSH,
|
||||||
|
@ -406,6 +428,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Tools/Paint Tools/Eraser"),
|
N_("/Tools/Paint Tools/Eraser"),
|
||||||
"<shift>E",
|
"<shift>E",
|
||||||
(char **) erase_bits,
|
(char **) erase_bits,
|
||||||
|
NULL,
|
||||||
N_("Erase to background or transparency"),
|
N_("Erase to background or transparency"),
|
||||||
"tools/eraser.html",
|
"tools/eraser.html",
|
||||||
ERASER,
|
ERASER,
|
||||||
|
@ -422,6 +445,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Tools/Paint Tools/Airbrush"),
|
N_("/Tools/Paint Tools/Airbrush"),
|
||||||
"A",
|
"A",
|
||||||
(char **) airbrush_bits,
|
(char **) airbrush_bits,
|
||||||
|
NULL,
|
||||||
N_("Airbrush with variable pressure"),
|
N_("Airbrush with variable pressure"),
|
||||||
"tools/airbrush.html",
|
"tools/airbrush.html",
|
||||||
AIRBRUSH,
|
AIRBRUSH,
|
||||||
|
@ -438,6 +462,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Tools/Paint Tools/Clone"),
|
N_("/Tools/Paint Tools/Clone"),
|
||||||
"C",
|
"C",
|
||||||
(char **) clone_bits,
|
(char **) clone_bits,
|
||||||
|
NULL,
|
||||||
N_("Paint using patterns or image regions"),
|
N_("Paint using patterns or image regions"),
|
||||||
"tools/clone.html",
|
"tools/clone.html",
|
||||||
CLONE,
|
CLONE,
|
||||||
|
@ -454,6 +479,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Tools/Paint Tools/Convolve"),
|
N_("/Tools/Paint Tools/Convolve"),
|
||||||
"V",
|
"V",
|
||||||
(char **) blur_bits,
|
(char **) blur_bits,
|
||||||
|
NULL,
|
||||||
N_("Blur or sharpen"),
|
N_("Blur or sharpen"),
|
||||||
"tools/convolve.html",
|
"tools/convolve.html",
|
||||||
CONVOLVE,
|
CONVOLVE,
|
||||||
|
@ -470,6 +496,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Tools/Paint Tools/Ink"),
|
N_("/Tools/Paint Tools/Ink"),
|
||||||
"K",
|
"K",
|
||||||
(char **) ink_bits,
|
(char **) ink_bits,
|
||||||
|
NULL,
|
||||||
N_("Draw in ink"),
|
N_("Draw in ink"),
|
||||||
"tools/ink.html",
|
"tools/ink.html",
|
||||||
INK,
|
INK,
|
||||||
|
@ -486,6 +513,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Tools/Paint Tools/DodgeBurn"),
|
N_("/Tools/Paint Tools/DodgeBurn"),
|
||||||
"<shift>D",
|
"<shift>D",
|
||||||
(char **) dodge_bits,
|
(char **) dodge_bits,
|
||||||
|
NULL,
|
||||||
N_("Dodge or Burn"),
|
N_("Dodge or Burn"),
|
||||||
"tools/dodgeburn.html",
|
"tools/dodgeburn.html",
|
||||||
DODGEBURN,
|
DODGEBURN,
|
||||||
|
@ -502,6 +530,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Tools/Paint Tools/Smudge"),
|
N_("/Tools/Paint Tools/Smudge"),
|
||||||
"<shift>S",
|
"<shift>S",
|
||||||
(char **) smudge_bits,
|
(char **) smudge_bits,
|
||||||
|
NULL,
|
||||||
N_("Smudge"),
|
N_("Smudge"),
|
||||||
"tools/smudge.html",
|
"tools/smudge.html",
|
||||||
SMUDGE,
|
SMUDGE,
|
||||||
|
@ -518,6 +547,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Tools/Paint Tools/XinputAirbrush"),
|
N_("/Tools/Paint Tools/XinputAirbrush"),
|
||||||
"<shift>A",
|
"<shift>A",
|
||||||
(char **) xinput_airbrush_bits,
|
(char **) xinput_airbrush_bits,
|
||||||
|
NULL,
|
||||||
N_("Natural Airbrush"),
|
N_("Natural Airbrush"),
|
||||||
"tools/xinput_airbrush.html",
|
"tools/xinput_airbrush.html",
|
||||||
XINPUT_AIRBRUSH,
|
XINPUT_AIRBRUSH,
|
||||||
|
@ -534,6 +564,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Tools/Measure"),
|
N_("/Tools/Measure"),
|
||||||
"",
|
"",
|
||||||
(char **) measure_bits,
|
(char **) measure_bits,
|
||||||
|
NULL,
|
||||||
N_("Measure distances and angles"),
|
N_("Measure distances and angles"),
|
||||||
"tools/measure.html",
|
"tools/measure.html",
|
||||||
MEASURE,
|
MEASURE,
|
||||||
|
@ -550,6 +581,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Tools/Path"),
|
N_("/Tools/Path"),
|
||||||
"",
|
"",
|
||||||
(char **) path_tool_bits,
|
(char **) path_tool_bits,
|
||||||
|
NULL,
|
||||||
N_("Manipulate paths"),
|
N_("Manipulate paths"),
|
||||||
"tools/path.html",
|
"tools/path.html",
|
||||||
PATH_TOOL,
|
PATH_TOOL,
|
||||||
|
@ -568,6 +600,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Select/By Color..."),
|
N_("/Select/By Color..."),
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
|
NULL,
|
||||||
N_("Select regions by color"),
|
N_("Select regions by color"),
|
||||||
"tools/by_color_select.html",
|
"tools/by_color_select.html",
|
||||||
BY_COLOR_SELECT,
|
BY_COLOR_SELECT,
|
||||||
|
@ -584,6 +617,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Image/Colors/Color Balance..."),
|
N_("/Image/Colors/Color Balance..."),
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
|
NULL,
|
||||||
N_("Adjust color balance"),
|
N_("Adjust color balance"),
|
||||||
"tools/color_balance.html",
|
"tools/color_balance.html",
|
||||||
COLOR_BALANCE,
|
COLOR_BALANCE,
|
||||||
|
@ -600,6 +634,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Image/Colors/Brightness-Contrast..."),
|
N_("/Image/Colors/Brightness-Contrast..."),
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
|
NULL,
|
||||||
N_("Adjust brightness and contrast"),
|
N_("Adjust brightness and contrast"),
|
||||||
"tools/brightness_contrast.html",
|
"tools/brightness_contrast.html",
|
||||||
BRIGHTNESS_CONTRAST,
|
BRIGHTNESS_CONTRAST,
|
||||||
|
@ -616,6 +651,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Image/Colors/Hue-Saturation..."),
|
N_("/Image/Colors/Hue-Saturation..."),
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
|
NULL,
|
||||||
N_("Adjust hue and saturation"),
|
N_("Adjust hue and saturation"),
|
||||||
"tools/hue_saturation.html",
|
"tools/hue_saturation.html",
|
||||||
HUE_SATURATION,
|
HUE_SATURATION,
|
||||||
|
@ -632,6 +668,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Image/Colors/Posterize..."),
|
N_("/Image/Colors/Posterize..."),
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
|
NULL,
|
||||||
N_("Reduce image to a fixed numer of colors"),
|
N_("Reduce image to a fixed numer of colors"),
|
||||||
"tools/posterize.html",
|
"tools/posterize.html",
|
||||||
POSTERIZE,
|
POSTERIZE,
|
||||||
|
@ -648,6 +685,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Image/Colors/Threshold..."),
|
N_("/Image/Colors/Threshold..."),
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
|
NULL,
|
||||||
N_("Reduce image to two colors using a threshold"),
|
N_("Reduce image to two colors using a threshold"),
|
||||||
"tools/threshold.html",
|
"tools/threshold.html",
|
||||||
THRESHOLD,
|
THRESHOLD,
|
||||||
|
@ -664,6 +702,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Image/Colors/Curves..."),
|
N_("/Image/Colors/Curves..."),
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
|
NULL,
|
||||||
N_("Adjust color curves"),
|
N_("Adjust color curves"),
|
||||||
"tools/curves.html",
|
"tools/curves.html",
|
||||||
CURVES,
|
CURVES,
|
||||||
|
@ -680,6 +719,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Image/Colors/Levels..."),
|
N_("/Image/Colors/Levels..."),
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
|
NULL,
|
||||||
N_("Adjust color levels"),
|
N_("Adjust color levels"),
|
||||||
"tools/levels.html",
|
"tools/levels.html",
|
||||||
LEVELS,
|
LEVELS,
|
||||||
|
@ -696,6 +736,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Image/Histogram..."),
|
N_("/Image/Histogram..."),
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
|
NULL,
|
||||||
N_("View image histogram"),
|
N_("View image histogram"),
|
||||||
"tools/histogram.html",
|
"tools/histogram.html",
|
||||||
HISTOGRAM,
|
HISTOGRAM,
|
||||||
|
@ -785,6 +826,7 @@ tools_initialize (ToolType tool_type,
|
||||||
/* don't set gdisp_ptr here! (see commands.c) */
|
/* don't set gdisp_ptr here! (see commands.c) */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
active_tool_control (ToolAction action,
|
active_tool_control (ToolAction action,
|
||||||
void *gdisp_ptr)
|
void *gdisp_ptr)
|
||||||
|
@ -970,6 +1012,9 @@ tools_register (ToolType tool_type,
|
||||||
}
|
}
|
||||||
|
|
||||||
gtk_label_set_text (GTK_LABEL (options_label), tool_options->title);
|
gtk_label_set_text (GTK_LABEL (options_label), tool_options->title);
|
||||||
|
|
||||||
|
gtk_pixmap_set (GTK_PIXMAP (options_pixmap), tool_get_pixmap (tool_type), NULL);
|
||||||
|
gtk_widget_queue_draw (options_pixmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Tool options function */
|
/* Tool options function */
|
||||||
|
@ -978,6 +1023,7 @@ void
|
||||||
tool_options_dialog_new (void)
|
tool_options_dialog_new (void)
|
||||||
{
|
{
|
||||||
GtkWidget *frame;
|
GtkWidget *frame;
|
||||||
|
GtkWidget *hbox;
|
||||||
GtkWidget *vbox;
|
GtkWidget *vbox;
|
||||||
|
|
||||||
/* The shell and main vbox */
|
/* The shell and main vbox */
|
||||||
|
@ -1017,9 +1063,16 @@ tool_options_dialog_new (void)
|
||||||
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
|
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
|
||||||
gtk_widget_show (frame);
|
gtk_widget_show (frame);
|
||||||
|
|
||||||
|
hbox = gtk_hbox_new (FALSE, 4);
|
||||||
|
gtk_container_add (GTK_CONTAINER (frame), hbox);
|
||||||
|
gtk_widget_show (hbox);
|
||||||
|
|
||||||
|
options_pixmap = gtk_pixmap_new (tool_get_pixmap (RECT_SELECT), NULL);
|
||||||
|
gtk_box_pack_start (GTK_BOX (hbox), options_pixmap, FALSE, FALSE, 0);
|
||||||
|
gtk_widget_show (options_pixmap);
|
||||||
|
|
||||||
options_label = gtk_label_new ("");
|
options_label = gtk_label_new ("");
|
||||||
gtk_misc_set_padding (GTK_MISC (options_label), 1, 0);
|
gtk_box_pack_start (GTK_BOX (hbox), options_label, FALSE, FALSE, 1);
|
||||||
gtk_container_add (GTK_CONTAINER (frame), options_label);
|
|
||||||
gtk_widget_show (options_label);
|
gtk_widget_show (options_label);
|
||||||
|
|
||||||
options_vbox = gtk_vbox_new (FALSE, 0);
|
options_vbox = gtk_vbox_new (FALSE, 0);
|
||||||
|
@ -1071,6 +1124,9 @@ tool_options_show (ToolType tool_type)
|
||||||
gtk_label_set_text (GTK_LABEL (options_label),
|
gtk_label_set_text (GTK_LABEL (options_label),
|
||||||
tool_info[tool_type].tool_options->title);
|
tool_info[tool_type].tool_options->title);
|
||||||
|
|
||||||
|
gtk_pixmap_set (GTK_PIXMAP (options_pixmap), tool_get_pixmap (tool_type), NULL);
|
||||||
|
gtk_widget_queue_draw (options_pixmap);
|
||||||
|
|
||||||
if (tool_info[tool_type].tool_options->reset_func)
|
if (tool_info[tool_type].tool_options->reset_func)
|
||||||
gtk_widget_set_sensitive (options_reset_button, TRUE);
|
gtk_widget_set_sensitive (options_reset_button, TRUE);
|
||||||
else
|
else
|
||||||
|
@ -1163,3 +1219,9 @@ tool_active_PDB_string (void)
|
||||||
|
|
||||||
return toolStr;
|
return toolStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GdkPixmap *
|
||||||
|
tool_get_pixmap (ToolType type)
|
||||||
|
{
|
||||||
|
return (tool_info[type].icon_pixmap);
|
||||||
|
}
|
||||||
|
|
22
app/tools.h
22
app/tools.h
|
@ -88,15 +88,16 @@ struct _ToolInfo
|
||||||
{
|
{
|
||||||
ToolOptions *tool_options;
|
ToolOptions *tool_options;
|
||||||
|
|
||||||
gchar *tool_name;
|
gchar *tool_name;
|
||||||
|
|
||||||
gchar *menu_path;
|
gchar *menu_path;
|
||||||
gchar *menu_accel;
|
gchar *menu_accel;
|
||||||
|
|
||||||
gchar **icon_data;
|
gchar **icon_data;
|
||||||
|
GdkPixmap *icon_pixmap;
|
||||||
|
|
||||||
gchar *tool_desc;
|
gchar *tool_desc;
|
||||||
gchar *private_tip;
|
gchar *private_tip;
|
||||||
|
|
||||||
ToolType tool_id;
|
ToolType tool_id;
|
||||||
|
|
||||||
|
@ -104,7 +105,7 @@ struct _ToolInfo
|
||||||
ToolInfoFreeFunc free_func;
|
ToolInfoFreeFunc free_func;
|
||||||
ToolInfoInitFunc init_func;
|
ToolInfoInitFunc init_func;
|
||||||
|
|
||||||
GtkWidget *tool_widget;
|
GtkWidget *tool_widget;
|
||||||
|
|
||||||
GimpContext *tool_context;
|
GimpContext *tool_context;
|
||||||
};
|
};
|
||||||
|
@ -135,4 +136,11 @@ void tool_options_dialog_free (void);
|
||||||
|
|
||||||
gchar * tool_active_PDB_string (void);
|
gchar * tool_active_PDB_string (void);
|
||||||
|
|
||||||
|
/* don't unref this pixmap, it is static! */
|
||||||
|
GdkPixmap * tool_get_pixmap (ToolType tool_type);
|
||||||
|
|
||||||
#endif /* __TOOLS_H__ */
|
#endif /* __TOOLS_H__ */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -43,6 +43,7 @@
|
||||||
#include "fuzzy_select.h"
|
#include "fuzzy_select.h"
|
||||||
#include "histogram_tool.h"
|
#include "histogram_tool.h"
|
||||||
#include "ink.h"
|
#include "ink.h"
|
||||||
|
#include "interface.h"
|
||||||
#include "iscissors.h"
|
#include "iscissors.h"
|
||||||
#include "levels.h"
|
#include "levels.h"
|
||||||
#include "magnify.h"
|
#include "magnify.h"
|
||||||
|
@ -74,6 +75,7 @@ Tool * active_tool = NULL;
|
||||||
static GtkWidget * options_shell = NULL;
|
static GtkWidget * options_shell = NULL;
|
||||||
static GtkWidget * options_vbox = NULL;
|
static GtkWidget * options_vbox = NULL;
|
||||||
static GtkWidget * options_label = NULL;
|
static GtkWidget * options_label = NULL;
|
||||||
|
static GtkWidget * options_pixmap = NULL;
|
||||||
static GtkWidget * options_reset_button = NULL;
|
static GtkWidget * options_reset_button = NULL;
|
||||||
|
|
||||||
static gint global_tool_ID = 0;
|
static gint global_tool_ID = 0;
|
||||||
|
@ -86,6 +88,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Tools/Select Tools/Rect Select"),
|
N_("/Tools/Select Tools/Rect Select"),
|
||||||
"R",
|
"R",
|
||||||
(char **) rect_bits,
|
(char **) rect_bits,
|
||||||
|
NULL,
|
||||||
N_("Select rectangular regions"),
|
N_("Select rectangular regions"),
|
||||||
"tools/rect_select.html",
|
"tools/rect_select.html",
|
||||||
RECT_SELECT,
|
RECT_SELECT,
|
||||||
|
@ -102,6 +105,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Tools/Select Tools/Ellipse Select"),
|
N_("/Tools/Select Tools/Ellipse Select"),
|
||||||
"E",
|
"E",
|
||||||
(char **) circ_bits,
|
(char **) circ_bits,
|
||||||
|
NULL,
|
||||||
N_("Select elliptical regions"),
|
N_("Select elliptical regions"),
|
||||||
"tools/ellipse_select.html",
|
"tools/ellipse_select.html",
|
||||||
ELLIPSE_SELECT,
|
ELLIPSE_SELECT,
|
||||||
|
@ -118,6 +122,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Tools/Select Tools/Free Select"),
|
N_("/Tools/Select Tools/Free Select"),
|
||||||
"F",
|
"F",
|
||||||
(char **) free_bits,
|
(char **) free_bits,
|
||||||
|
NULL,
|
||||||
N_("Select hand-drawn regions"),
|
N_("Select hand-drawn regions"),
|
||||||
"tools/free_select.html",
|
"tools/free_select.html",
|
||||||
FREE_SELECT,
|
FREE_SELECT,
|
||||||
|
@ -134,6 +139,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Tools/Select Tools/Fuzzy Select"),
|
N_("/Tools/Select Tools/Fuzzy Select"),
|
||||||
"Z",
|
"Z",
|
||||||
(char **) fuzzy_bits,
|
(char **) fuzzy_bits,
|
||||||
|
NULL,
|
||||||
N_("Select contiguous regions"),
|
N_("Select contiguous regions"),
|
||||||
"tools/fuzzy_select.html",
|
"tools/fuzzy_select.html",
|
||||||
FUZZY_SELECT,
|
FUZZY_SELECT,
|
||||||
|
@ -150,6 +156,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Tools/Select Tools/Bezier Select"),
|
N_("/Tools/Select Tools/Bezier Select"),
|
||||||
"B",
|
"B",
|
||||||
(char **) bezier_bits,
|
(char **) bezier_bits,
|
||||||
|
NULL,
|
||||||
N_("Select regions using Bezier curves"),
|
N_("Select regions using Bezier curves"),
|
||||||
"tools/bezier_select.html",
|
"tools/bezier_select.html",
|
||||||
BEZIER_SELECT,
|
BEZIER_SELECT,
|
||||||
|
@ -166,6 +173,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Tools/Select Tools/Intelligent Scissors"),
|
N_("/Tools/Select Tools/Intelligent Scissors"),
|
||||||
"I",
|
"I",
|
||||||
(char **) iscissors_bits,
|
(char **) iscissors_bits,
|
||||||
|
NULL,
|
||||||
N_("Select shapes from image"),
|
N_("Select shapes from image"),
|
||||||
"tools/intelligent_scissors.html",
|
"tools/intelligent_scissors.html",
|
||||||
ISCISSORS,
|
ISCISSORS,
|
||||||
|
@ -182,6 +190,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Tools/Transform Tools/Move"),
|
N_("/Tools/Transform Tools/Move"),
|
||||||
"M",
|
"M",
|
||||||
(char **) move_bits,
|
(char **) move_bits,
|
||||||
|
NULL,
|
||||||
N_("Move layers & selections"),
|
N_("Move layers & selections"),
|
||||||
"tools/move.html",
|
"tools/move.html",
|
||||||
MOVE,
|
MOVE,
|
||||||
|
@ -198,6 +207,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Tools/Transform Tools/Magnify"),
|
N_("/Tools/Transform Tools/Magnify"),
|
||||||
"<shift>M",
|
"<shift>M",
|
||||||
(char **) magnify_bits,
|
(char **) magnify_bits,
|
||||||
|
NULL,
|
||||||
N_("Zoom in & out"),
|
N_("Zoom in & out"),
|
||||||
"tools/magnify.html",
|
"tools/magnify.html",
|
||||||
MAGNIFY,
|
MAGNIFY,
|
||||||
|
@ -214,6 +224,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Tools/Transform Tools/Crop & Resize"),
|
N_("/Tools/Transform Tools/Crop & Resize"),
|
||||||
"<shift>C",
|
"<shift>C",
|
||||||
(char **) crop_bits,
|
(char **) crop_bits,
|
||||||
|
NULL,
|
||||||
N_("Crop or resize the image"),
|
N_("Crop or resize the image"),
|
||||||
"tools/crop.html",
|
"tools/crop.html",
|
||||||
CROP,
|
CROP,
|
||||||
|
@ -230,6 +241,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Tools/Transform Tools/Transform"),
|
N_("/Tools/Transform Tools/Transform"),
|
||||||
"<shift>T",
|
"<shift>T",
|
||||||
(char **) scale_bits,
|
(char **) scale_bits,
|
||||||
|
NULL,
|
||||||
N_("Rotation, scaling, shearing, perspective."),
|
N_("Rotation, scaling, shearing, perspective."),
|
||||||
"tools/transform.html",
|
"tools/transform.html",
|
||||||
ROTATE,
|
ROTATE,
|
||||||
|
@ -246,6 +258,7 @@ ToolInfo tool_info[] =
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
|
NULL,
|
||||||
N_("Rotation, scaling, shearing, perspective."),
|
N_("Rotation, scaling, shearing, perspective."),
|
||||||
"tools/transform.html",
|
"tools/transform.html",
|
||||||
SCALE,
|
SCALE,
|
||||||
|
@ -262,6 +275,7 @@ ToolInfo tool_info[] =
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
|
NULL,
|
||||||
N_("Rotation, scaling, shearing, perspective."),
|
N_("Rotation, scaling, shearing, perspective."),
|
||||||
"tools/transform.html",
|
"tools/transform.html",
|
||||||
SHEAR,
|
SHEAR,
|
||||||
|
@ -278,6 +292,7 @@ ToolInfo tool_info[] =
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
|
NULL,
|
||||||
N_("Rotation, scaling, shearing, perspective."),
|
N_("Rotation, scaling, shearing, perspective."),
|
||||||
"tools/transform.html",
|
"tools/transform.html",
|
||||||
PERSPECTIVE,
|
PERSPECTIVE,
|
||||||
|
@ -294,6 +309,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Tools/Transform Tools/Flip"),
|
N_("/Tools/Transform Tools/Flip"),
|
||||||
"<shift>F",
|
"<shift>F",
|
||||||
(char **) flip_bits,
|
(char **) flip_bits,
|
||||||
|
NULL,
|
||||||
N_("Flip the layer or selection"),
|
N_("Flip the layer or selection"),
|
||||||
"tools/flip.html",
|
"tools/flip.html",
|
||||||
FLIP,
|
FLIP,
|
||||||
|
@ -310,6 +326,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Tools/Text"),
|
N_("/Tools/Text"),
|
||||||
"T",
|
"T",
|
||||||
(char **) text_bits,
|
(char **) text_bits,
|
||||||
|
NULL,
|
||||||
N_("Add text to the image"),
|
N_("Add text to the image"),
|
||||||
"tools/text.html",
|
"tools/text.html",
|
||||||
TEXT,
|
TEXT,
|
||||||
|
@ -326,6 +343,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Tools/Color Picker"),
|
N_("/Tools/Color Picker"),
|
||||||
"O",
|
"O",
|
||||||
(char **) colorpicker_bits,
|
(char **) colorpicker_bits,
|
||||||
|
NULL,
|
||||||
N_("Pick colors from the image"),
|
N_("Pick colors from the image"),
|
||||||
"tools/color_picker.html",
|
"tools/color_picker.html",
|
||||||
COLOR_PICKER,
|
COLOR_PICKER,
|
||||||
|
@ -342,6 +360,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Tools/Paint Tools/Bucket Fill"),
|
N_("/Tools/Paint Tools/Bucket Fill"),
|
||||||
"<shift>B",
|
"<shift>B",
|
||||||
(char **) fill_bits,
|
(char **) fill_bits,
|
||||||
|
NULL,
|
||||||
N_("Fill with a color or pattern"),
|
N_("Fill with a color or pattern"),
|
||||||
"tools/bucket_fill.html",
|
"tools/bucket_fill.html",
|
||||||
BUCKET_FILL,
|
BUCKET_FILL,
|
||||||
|
@ -358,6 +377,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Tools/Paint Tools/Blend"),
|
N_("/Tools/Paint Tools/Blend"),
|
||||||
"L",
|
"L",
|
||||||
(char **) gradient_bits,
|
(char **) gradient_bits,
|
||||||
|
NULL,
|
||||||
N_("Fill with a color gradient"),
|
N_("Fill with a color gradient"),
|
||||||
"tools/blend.html",
|
"tools/blend.html",
|
||||||
BLEND,
|
BLEND,
|
||||||
|
@ -374,6 +394,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Tools/Paint Tools/Pencil"),
|
N_("/Tools/Paint Tools/Pencil"),
|
||||||
"<shift>P",
|
"<shift>P",
|
||||||
(char **) pencil_bits,
|
(char **) pencil_bits,
|
||||||
|
NULL,
|
||||||
N_("Draw sharp pencil strokes"),
|
N_("Draw sharp pencil strokes"),
|
||||||
"tools/pencil.html",
|
"tools/pencil.html",
|
||||||
PENCIL,
|
PENCIL,
|
||||||
|
@ -390,6 +411,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Tools/Paint Tools/Paintbrush"),
|
N_("/Tools/Paint Tools/Paintbrush"),
|
||||||
"P",
|
"P",
|
||||||
(char **) paint_bits,
|
(char **) paint_bits,
|
||||||
|
NULL,
|
||||||
N_("Paint fuzzy brush strokes"),
|
N_("Paint fuzzy brush strokes"),
|
||||||
"tools/paintbrush.html",
|
"tools/paintbrush.html",
|
||||||
PAINTBRUSH,
|
PAINTBRUSH,
|
||||||
|
@ -406,6 +428,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Tools/Paint Tools/Eraser"),
|
N_("/Tools/Paint Tools/Eraser"),
|
||||||
"<shift>E",
|
"<shift>E",
|
||||||
(char **) erase_bits,
|
(char **) erase_bits,
|
||||||
|
NULL,
|
||||||
N_("Erase to background or transparency"),
|
N_("Erase to background or transparency"),
|
||||||
"tools/eraser.html",
|
"tools/eraser.html",
|
||||||
ERASER,
|
ERASER,
|
||||||
|
@ -422,6 +445,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Tools/Paint Tools/Airbrush"),
|
N_("/Tools/Paint Tools/Airbrush"),
|
||||||
"A",
|
"A",
|
||||||
(char **) airbrush_bits,
|
(char **) airbrush_bits,
|
||||||
|
NULL,
|
||||||
N_("Airbrush with variable pressure"),
|
N_("Airbrush with variable pressure"),
|
||||||
"tools/airbrush.html",
|
"tools/airbrush.html",
|
||||||
AIRBRUSH,
|
AIRBRUSH,
|
||||||
|
@ -438,6 +462,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Tools/Paint Tools/Clone"),
|
N_("/Tools/Paint Tools/Clone"),
|
||||||
"C",
|
"C",
|
||||||
(char **) clone_bits,
|
(char **) clone_bits,
|
||||||
|
NULL,
|
||||||
N_("Paint using patterns or image regions"),
|
N_("Paint using patterns or image regions"),
|
||||||
"tools/clone.html",
|
"tools/clone.html",
|
||||||
CLONE,
|
CLONE,
|
||||||
|
@ -454,6 +479,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Tools/Paint Tools/Convolve"),
|
N_("/Tools/Paint Tools/Convolve"),
|
||||||
"V",
|
"V",
|
||||||
(char **) blur_bits,
|
(char **) blur_bits,
|
||||||
|
NULL,
|
||||||
N_("Blur or sharpen"),
|
N_("Blur or sharpen"),
|
||||||
"tools/convolve.html",
|
"tools/convolve.html",
|
||||||
CONVOLVE,
|
CONVOLVE,
|
||||||
|
@ -470,6 +496,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Tools/Paint Tools/Ink"),
|
N_("/Tools/Paint Tools/Ink"),
|
||||||
"K",
|
"K",
|
||||||
(char **) ink_bits,
|
(char **) ink_bits,
|
||||||
|
NULL,
|
||||||
N_("Draw in ink"),
|
N_("Draw in ink"),
|
||||||
"tools/ink.html",
|
"tools/ink.html",
|
||||||
INK,
|
INK,
|
||||||
|
@ -486,6 +513,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Tools/Paint Tools/DodgeBurn"),
|
N_("/Tools/Paint Tools/DodgeBurn"),
|
||||||
"<shift>D",
|
"<shift>D",
|
||||||
(char **) dodge_bits,
|
(char **) dodge_bits,
|
||||||
|
NULL,
|
||||||
N_("Dodge or Burn"),
|
N_("Dodge or Burn"),
|
||||||
"tools/dodgeburn.html",
|
"tools/dodgeburn.html",
|
||||||
DODGEBURN,
|
DODGEBURN,
|
||||||
|
@ -502,6 +530,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Tools/Paint Tools/Smudge"),
|
N_("/Tools/Paint Tools/Smudge"),
|
||||||
"<shift>S",
|
"<shift>S",
|
||||||
(char **) smudge_bits,
|
(char **) smudge_bits,
|
||||||
|
NULL,
|
||||||
N_("Smudge"),
|
N_("Smudge"),
|
||||||
"tools/smudge.html",
|
"tools/smudge.html",
|
||||||
SMUDGE,
|
SMUDGE,
|
||||||
|
@ -518,6 +547,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Tools/Paint Tools/XinputAirbrush"),
|
N_("/Tools/Paint Tools/XinputAirbrush"),
|
||||||
"<shift>A",
|
"<shift>A",
|
||||||
(char **) xinput_airbrush_bits,
|
(char **) xinput_airbrush_bits,
|
||||||
|
NULL,
|
||||||
N_("Natural Airbrush"),
|
N_("Natural Airbrush"),
|
||||||
"tools/xinput_airbrush.html",
|
"tools/xinput_airbrush.html",
|
||||||
XINPUT_AIRBRUSH,
|
XINPUT_AIRBRUSH,
|
||||||
|
@ -534,6 +564,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Tools/Measure"),
|
N_("/Tools/Measure"),
|
||||||
"",
|
"",
|
||||||
(char **) measure_bits,
|
(char **) measure_bits,
|
||||||
|
NULL,
|
||||||
N_("Measure distances and angles"),
|
N_("Measure distances and angles"),
|
||||||
"tools/measure.html",
|
"tools/measure.html",
|
||||||
MEASURE,
|
MEASURE,
|
||||||
|
@ -550,6 +581,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Tools/Path"),
|
N_("/Tools/Path"),
|
||||||
"",
|
"",
|
||||||
(char **) path_tool_bits,
|
(char **) path_tool_bits,
|
||||||
|
NULL,
|
||||||
N_("Manipulate paths"),
|
N_("Manipulate paths"),
|
||||||
"tools/path.html",
|
"tools/path.html",
|
||||||
PATH_TOOL,
|
PATH_TOOL,
|
||||||
|
@ -568,6 +600,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Select/By Color..."),
|
N_("/Select/By Color..."),
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
|
NULL,
|
||||||
N_("Select regions by color"),
|
N_("Select regions by color"),
|
||||||
"tools/by_color_select.html",
|
"tools/by_color_select.html",
|
||||||
BY_COLOR_SELECT,
|
BY_COLOR_SELECT,
|
||||||
|
@ -584,6 +617,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Image/Colors/Color Balance..."),
|
N_("/Image/Colors/Color Balance..."),
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
|
NULL,
|
||||||
N_("Adjust color balance"),
|
N_("Adjust color balance"),
|
||||||
"tools/color_balance.html",
|
"tools/color_balance.html",
|
||||||
COLOR_BALANCE,
|
COLOR_BALANCE,
|
||||||
|
@ -600,6 +634,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Image/Colors/Brightness-Contrast..."),
|
N_("/Image/Colors/Brightness-Contrast..."),
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
|
NULL,
|
||||||
N_("Adjust brightness and contrast"),
|
N_("Adjust brightness and contrast"),
|
||||||
"tools/brightness_contrast.html",
|
"tools/brightness_contrast.html",
|
||||||
BRIGHTNESS_CONTRAST,
|
BRIGHTNESS_CONTRAST,
|
||||||
|
@ -616,6 +651,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Image/Colors/Hue-Saturation..."),
|
N_("/Image/Colors/Hue-Saturation..."),
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
|
NULL,
|
||||||
N_("Adjust hue and saturation"),
|
N_("Adjust hue and saturation"),
|
||||||
"tools/hue_saturation.html",
|
"tools/hue_saturation.html",
|
||||||
HUE_SATURATION,
|
HUE_SATURATION,
|
||||||
|
@ -632,6 +668,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Image/Colors/Posterize..."),
|
N_("/Image/Colors/Posterize..."),
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
|
NULL,
|
||||||
N_("Reduce image to a fixed numer of colors"),
|
N_("Reduce image to a fixed numer of colors"),
|
||||||
"tools/posterize.html",
|
"tools/posterize.html",
|
||||||
POSTERIZE,
|
POSTERIZE,
|
||||||
|
@ -648,6 +685,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Image/Colors/Threshold..."),
|
N_("/Image/Colors/Threshold..."),
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
|
NULL,
|
||||||
N_("Reduce image to two colors using a threshold"),
|
N_("Reduce image to two colors using a threshold"),
|
||||||
"tools/threshold.html",
|
"tools/threshold.html",
|
||||||
THRESHOLD,
|
THRESHOLD,
|
||||||
|
@ -664,6 +702,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Image/Colors/Curves..."),
|
N_("/Image/Colors/Curves..."),
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
|
NULL,
|
||||||
N_("Adjust color curves"),
|
N_("Adjust color curves"),
|
||||||
"tools/curves.html",
|
"tools/curves.html",
|
||||||
CURVES,
|
CURVES,
|
||||||
|
@ -680,6 +719,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Image/Colors/Levels..."),
|
N_("/Image/Colors/Levels..."),
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
|
NULL,
|
||||||
N_("Adjust color levels"),
|
N_("Adjust color levels"),
|
||||||
"tools/levels.html",
|
"tools/levels.html",
|
||||||
LEVELS,
|
LEVELS,
|
||||||
|
@ -696,6 +736,7 @@ ToolInfo tool_info[] =
|
||||||
N_("/Image/Histogram..."),
|
N_("/Image/Histogram..."),
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
|
NULL,
|
||||||
N_("View image histogram"),
|
N_("View image histogram"),
|
||||||
"tools/histogram.html",
|
"tools/histogram.html",
|
||||||
HISTOGRAM,
|
HISTOGRAM,
|
||||||
|
@ -785,6 +826,7 @@ tools_initialize (ToolType tool_type,
|
||||||
/* don't set gdisp_ptr here! (see commands.c) */
|
/* don't set gdisp_ptr here! (see commands.c) */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
active_tool_control (ToolAction action,
|
active_tool_control (ToolAction action,
|
||||||
void *gdisp_ptr)
|
void *gdisp_ptr)
|
||||||
|
@ -970,6 +1012,9 @@ tools_register (ToolType tool_type,
|
||||||
}
|
}
|
||||||
|
|
||||||
gtk_label_set_text (GTK_LABEL (options_label), tool_options->title);
|
gtk_label_set_text (GTK_LABEL (options_label), tool_options->title);
|
||||||
|
|
||||||
|
gtk_pixmap_set (GTK_PIXMAP (options_pixmap), tool_get_pixmap (tool_type), NULL);
|
||||||
|
gtk_widget_queue_draw (options_pixmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Tool options function */
|
/* Tool options function */
|
||||||
|
@ -978,6 +1023,7 @@ void
|
||||||
tool_options_dialog_new (void)
|
tool_options_dialog_new (void)
|
||||||
{
|
{
|
||||||
GtkWidget *frame;
|
GtkWidget *frame;
|
||||||
|
GtkWidget *hbox;
|
||||||
GtkWidget *vbox;
|
GtkWidget *vbox;
|
||||||
|
|
||||||
/* The shell and main vbox */
|
/* The shell and main vbox */
|
||||||
|
@ -1017,9 +1063,16 @@ tool_options_dialog_new (void)
|
||||||
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
|
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
|
||||||
gtk_widget_show (frame);
|
gtk_widget_show (frame);
|
||||||
|
|
||||||
|
hbox = gtk_hbox_new (FALSE, 4);
|
||||||
|
gtk_container_add (GTK_CONTAINER (frame), hbox);
|
||||||
|
gtk_widget_show (hbox);
|
||||||
|
|
||||||
|
options_pixmap = gtk_pixmap_new (tool_get_pixmap (RECT_SELECT), NULL);
|
||||||
|
gtk_box_pack_start (GTK_BOX (hbox), options_pixmap, FALSE, FALSE, 0);
|
||||||
|
gtk_widget_show (options_pixmap);
|
||||||
|
|
||||||
options_label = gtk_label_new ("");
|
options_label = gtk_label_new ("");
|
||||||
gtk_misc_set_padding (GTK_MISC (options_label), 1, 0);
|
gtk_box_pack_start (GTK_BOX (hbox), options_label, FALSE, FALSE, 1);
|
||||||
gtk_container_add (GTK_CONTAINER (frame), options_label);
|
|
||||||
gtk_widget_show (options_label);
|
gtk_widget_show (options_label);
|
||||||
|
|
||||||
options_vbox = gtk_vbox_new (FALSE, 0);
|
options_vbox = gtk_vbox_new (FALSE, 0);
|
||||||
|
@ -1071,6 +1124,9 @@ tool_options_show (ToolType tool_type)
|
||||||
gtk_label_set_text (GTK_LABEL (options_label),
|
gtk_label_set_text (GTK_LABEL (options_label),
|
||||||
tool_info[tool_type].tool_options->title);
|
tool_info[tool_type].tool_options->title);
|
||||||
|
|
||||||
|
gtk_pixmap_set (GTK_PIXMAP (options_pixmap), tool_get_pixmap (tool_type), NULL);
|
||||||
|
gtk_widget_queue_draw (options_pixmap);
|
||||||
|
|
||||||
if (tool_info[tool_type].tool_options->reset_func)
|
if (tool_info[tool_type].tool_options->reset_func)
|
||||||
gtk_widget_set_sensitive (options_reset_button, TRUE);
|
gtk_widget_set_sensitive (options_reset_button, TRUE);
|
||||||
else
|
else
|
||||||
|
@ -1163,3 +1219,9 @@ tool_active_PDB_string (void)
|
||||||
|
|
||||||
return toolStr;
|
return toolStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GdkPixmap *
|
||||||
|
tool_get_pixmap (ToolType type)
|
||||||
|
{
|
||||||
|
return (tool_info[type].icon_pixmap);
|
||||||
|
}
|
||||||
|
|
|
@ -88,15 +88,16 @@ struct _ToolInfo
|
||||||
{
|
{
|
||||||
ToolOptions *tool_options;
|
ToolOptions *tool_options;
|
||||||
|
|
||||||
gchar *tool_name;
|
gchar *tool_name;
|
||||||
|
|
||||||
gchar *menu_path;
|
gchar *menu_path;
|
||||||
gchar *menu_accel;
|
gchar *menu_accel;
|
||||||
|
|
||||||
gchar **icon_data;
|
gchar **icon_data;
|
||||||
|
GdkPixmap *icon_pixmap;
|
||||||
|
|
||||||
gchar *tool_desc;
|
gchar *tool_desc;
|
||||||
gchar *private_tip;
|
gchar *private_tip;
|
||||||
|
|
||||||
ToolType tool_id;
|
ToolType tool_id;
|
||||||
|
|
||||||
|
@ -104,7 +105,7 @@ struct _ToolInfo
|
||||||
ToolInfoFreeFunc free_func;
|
ToolInfoFreeFunc free_func;
|
||||||
ToolInfoInitFunc init_func;
|
ToolInfoInitFunc init_func;
|
||||||
|
|
||||||
GtkWidget *tool_widget;
|
GtkWidget *tool_widget;
|
||||||
|
|
||||||
GimpContext *tool_context;
|
GimpContext *tool_context;
|
||||||
};
|
};
|
||||||
|
@ -135,4 +136,11 @@ void tool_options_dialog_free (void);
|
||||||
|
|
||||||
gchar * tool_active_PDB_string (void);
|
gchar * tool_active_PDB_string (void);
|
||||||
|
|
||||||
|
/* don't unref this pixmap, it is static! */
|
||||||
|
GdkPixmap * tool_get_pixmap (ToolType tool_type);
|
||||||
|
|
||||||
#endif /* __TOOLS_H__ */
|
#endif /* __TOOLS_H__ */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -735,7 +735,6 @@ void
|
||||||
device_status_create (void)
|
device_status_create (void)
|
||||||
{
|
{
|
||||||
DeviceInfo *device_info;
|
DeviceInfo *device_info;
|
||||||
GdkPixmap *pixmap;
|
|
||||||
GtkWidget *label;
|
GtkWidget *label;
|
||||||
GList *list;
|
GList *list;
|
||||||
gint i;
|
gint i;
|
||||||
|
@ -815,9 +814,7 @@ device_status_create (void)
|
||||||
|
|
||||||
deviceD->eventboxes[i] = gtk_event_box_new();
|
deviceD->eventboxes[i] = gtk_event_box_new();
|
||||||
|
|
||||||
pixmap = create_tool_pixmap (deviceD->table, RECT_SELECT);
|
deviceD->tools[i] = gtk_pixmap_new (tool_get_pixmap (RECT_SELECT), NULL);
|
||||||
deviceD->tools[i] = gtk_pixmap_new (pixmap, NULL);
|
|
||||||
gdk_pixmap_unref (pixmap);
|
|
||||||
|
|
||||||
gtk_drag_source_set (deviceD->eventboxes[i],
|
gtk_drag_source_set (deviceD->eventboxes[i],
|
||||||
GDK_BUTTON1_MASK | GDK_BUTTON2_MASK,
|
GDK_BUTTON1_MASK | GDK_BUTTON2_MASK,
|
||||||
|
@ -984,7 +981,6 @@ device_status_update_current (void)
|
||||||
void
|
void
|
||||||
device_status_update (guint32 deviceid)
|
device_status_update (guint32 deviceid)
|
||||||
{
|
{
|
||||||
GdkPixmap *pixmap;
|
|
||||||
GdkDeviceInfo *gdk_info;
|
GdkDeviceInfo *gdk_info;
|
||||||
DeviceInfo *device_info;
|
DeviceInfo *device_info;
|
||||||
guchar buffer[CELL_SIZE*3];
|
guchar buffer[CELL_SIZE*3];
|
||||||
|
@ -1022,10 +1018,9 @@ device_status_update (guint32 deviceid)
|
||||||
{
|
{
|
||||||
gtk_widget_show (deviceD->frames[i]);
|
gtk_widget_show (deviceD->frames[i]);
|
||||||
|
|
||||||
pixmap = create_tool_pixmap (deviceD->table,
|
gtk_pixmap_set (GTK_PIXMAP (deviceD->tools[i]),
|
||||||
gimp_context_get_tool (device_info->context));
|
tool_get_pixmap (gimp_context_get_tool (device_info->context)),
|
||||||
gtk_pixmap_set (GTK_PIXMAP (deviceD->tools[i]), pixmap, NULL);
|
NULL);
|
||||||
gdk_pixmap_unref (pixmap);
|
|
||||||
|
|
||||||
gtk_widget_draw (deviceD->tools[i], NULL);
|
gtk_widget_draw (deviceD->tools[i], NULL);
|
||||||
gtk_widget_show (deviceD->tools[i]);
|
gtk_widget_show (deviceD->tools[i]);
|
||||||
|
|
|
@ -735,7 +735,6 @@ void
|
||||||
device_status_create (void)
|
device_status_create (void)
|
||||||
{
|
{
|
||||||
DeviceInfo *device_info;
|
DeviceInfo *device_info;
|
||||||
GdkPixmap *pixmap;
|
|
||||||
GtkWidget *label;
|
GtkWidget *label;
|
||||||
GList *list;
|
GList *list;
|
||||||
gint i;
|
gint i;
|
||||||
|
@ -815,9 +814,7 @@ device_status_create (void)
|
||||||
|
|
||||||
deviceD->eventboxes[i] = gtk_event_box_new();
|
deviceD->eventboxes[i] = gtk_event_box_new();
|
||||||
|
|
||||||
pixmap = create_tool_pixmap (deviceD->table, RECT_SELECT);
|
deviceD->tools[i] = gtk_pixmap_new (tool_get_pixmap (RECT_SELECT), NULL);
|
||||||
deviceD->tools[i] = gtk_pixmap_new (pixmap, NULL);
|
|
||||||
gdk_pixmap_unref (pixmap);
|
|
||||||
|
|
||||||
gtk_drag_source_set (deviceD->eventboxes[i],
|
gtk_drag_source_set (deviceD->eventboxes[i],
|
||||||
GDK_BUTTON1_MASK | GDK_BUTTON2_MASK,
|
GDK_BUTTON1_MASK | GDK_BUTTON2_MASK,
|
||||||
|
@ -984,7 +981,6 @@ device_status_update_current (void)
|
||||||
void
|
void
|
||||||
device_status_update (guint32 deviceid)
|
device_status_update (guint32 deviceid)
|
||||||
{
|
{
|
||||||
GdkPixmap *pixmap;
|
|
||||||
GdkDeviceInfo *gdk_info;
|
GdkDeviceInfo *gdk_info;
|
||||||
DeviceInfo *device_info;
|
DeviceInfo *device_info;
|
||||||
guchar buffer[CELL_SIZE*3];
|
guchar buffer[CELL_SIZE*3];
|
||||||
|
@ -1022,10 +1018,9 @@ device_status_update (guint32 deviceid)
|
||||||
{
|
{
|
||||||
gtk_widget_show (deviceD->frames[i]);
|
gtk_widget_show (deviceD->frames[i]);
|
||||||
|
|
||||||
pixmap = create_tool_pixmap (deviceD->table,
|
gtk_pixmap_set (GTK_PIXMAP (deviceD->tools[i]),
|
||||||
gimp_context_get_tool (device_info->context));
|
tool_get_pixmap (gimp_context_get_tool (device_info->context)),
|
||||||
gtk_pixmap_set (GTK_PIXMAP (deviceD->tools[i]), pixmap, NULL);
|
NULL);
|
||||||
gdk_pixmap_unref (pixmap);
|
|
||||||
|
|
||||||
gtk_widget_draw (deviceD->tools[i], NULL);
|
gtk_widget_draw (deviceD->tools[i], NULL);
|
||||||
gtk_widget_show (deviceD->tools[i]);
|
gtk_widget_show (deviceD->tools[i]);
|
||||||
|
|
|
@ -939,7 +939,6 @@ gimp_dnd_get_tool_icon (GtkWidget *widget,
|
||||||
GtkSignalFunc get_tool_func,
|
GtkSignalFunc get_tool_func,
|
||||||
gpointer get_tool_data)
|
gpointer get_tool_data)
|
||||||
{
|
{
|
||||||
GdkPixmap *tool_pixmap;
|
|
||||||
GtkWidget *tool_icon;
|
GtkWidget *tool_icon;
|
||||||
ToolType tool_type;
|
ToolType tool_type;
|
||||||
|
|
||||||
|
@ -949,11 +948,7 @@ gimp_dnd_get_tool_icon (GtkWidget *widget,
|
||||||
if (((gint) tool_type < 0) || ((gint) tool_type >= num_tools))
|
if (((gint) tool_type < 0) || ((gint) tool_type >= num_tools))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
tool_pixmap = create_tool_pixmap (widget, tool_type);
|
tool_icon = gtk_pixmap_new (tool_get_pixmap (tool_type), NULL);
|
||||||
|
|
||||||
tool_icon = gtk_pixmap_new (tool_pixmap, NULL);
|
|
||||||
|
|
||||||
gdk_pixmap_unref (tool_pixmap);
|
|
||||||
|
|
||||||
return tool_icon;
|
return tool_icon;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue