From 69fc983a339a9157fed4af482ce40b705bfd50ea Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Fri, 3 Apr 1998 10:29:25 +0000 Subject: [PATCH] Added buttons to access the menu functions in the Layers&Channels-dialog more directly. They are connected to the menu-item-callback-functions. --Sven --- ChangeLog | 10 ++++ app/Makefile.am | 16 +++++- app/channels_dialog.c | 35 ++++++++++++ app/gui/channels-dialog.c | 35 ++++++++++++ app/gui/layers-dialog.c | 40 +++++++++++++ app/layers_dialog.c | 40 +++++++++++++ app/ops_buttons.c | 112 +++++++++++++++++++++++++++++++++++++ app/ops_buttons.h | 54 ++++++++++++++++++ app/tools/anchor.xpm | 22 ++++++++ app/tools/anchor_is.xpm | 22 ++++++++ app/tools/delete.xpm | 22 ++++++++ app/tools/delete_is.xpm | 22 ++++++++ app/tools/duplicate.xpm | 24 ++++++++ app/tools/duplicate_is.xpm | 23 ++++++++ app/tools/lower.xpm | 24 ++++++++ app/tools/lower_is.xpm | 22 ++++++++ app/tools/new.xpm | 23 ++++++++ app/tools/new_is.xpm | 22 ++++++++ app/tools/raise.xpm | 22 ++++++++ app/tools/raise_is.xpm | 22 ++++++++ 20 files changed, 611 insertions(+), 1 deletion(-) create mode 100644 app/ops_buttons.c create mode 100644 app/ops_buttons.h create mode 100644 app/tools/anchor.xpm create mode 100644 app/tools/anchor_is.xpm create mode 100644 app/tools/delete.xpm create mode 100644 app/tools/delete_is.xpm create mode 100644 app/tools/duplicate.xpm create mode 100644 app/tools/duplicate_is.xpm create mode 100644 app/tools/lower.xpm create mode 100644 app/tools/lower_is.xpm create mode 100644 app/tools/new.xpm create mode 100644 app/tools/new_is.xpm create mode 100644 app/tools/raise.xpm create mode 100644 app/tools/raise_is.xpm diff --git a/ChangeLog b/ChangeLog index e0739ed975..62f462bbdb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +Fri Apr 3 12:22:40 MEST 1998 Sven Neumann + + * app/Makefile.am + * tools/*.xpm + * app/ops_buttons.[c|h] + * app/channels_dialog.c + * app/layers_dialog.c: Added buttons to access the menu functions + in the Layers&Channels-dialog more directly. They are connected to + the menu-item-callback-functions. + Thu Apr 2 04:06:50 EST 1998 Matthew Wilson * app/disp_callbacks.c: Always ungrab the pointer on button release. diff --git a/app/Makefile.am b/app/Makefile.am index 1e30f75cbf..6a32356d58 100644 --- a/app/Makefile.am +++ b/app/Makefile.am @@ -187,6 +187,8 @@ gimp_SOURCES = \ menus.h \ move.c \ move.h \ + ops_buttons.c \ + ops_buttons.h \ palette.c \ palette.h \ paint_core.c \ @@ -266,7 +268,19 @@ EXTRA_DIST = \ tools/eye.xbm \ tools/layer.xbm \ tools/linked.xbm \ - tools/mask.xbm + tools/mask.xbm \ + tools/anchor.xpm \ + tools/anchor_is.xpm \ + tools/delete.xpm \ + tools/delete_is.xpm \ + tools/duplicate.xpm \ + tools/duplicate_is.xpm \ + tools/lower.xpm \ + tools/lower_is.xpm \ + tools/new.xpm \ + tools/new_is.xpm \ + tools/raise.xpm \ + tools/raise_is.xpm CPPFLAGS = \ -DLIBDIR=\""$(gimpplugindir)"\" \ diff --git a/app/channels_dialog.c b/app/channels_dialog.c index 6767ab7fd3..93e1aa85e4 100644 --- a/app/channels_dialog.c +++ b/app/channels_dialog.c @@ -33,12 +33,23 @@ #include "general.h" #include "interface.h" #include "layers_dialogP.h" +#include "ops_buttons.h" #include "paint_funcs.h" #include "palette.h" #include "resize.h" #include "tools/eye.xbm" #include "tools/channel.xbm" +#include "tools/new.xpm" +#include "tools/new_is.xpm" +#include "tools/raise.xpm" +#include "tools/raise_is.xpm" +#include "tools/lower.xpm" +#include "tools/lower_is.xpm" +#include "tools/duplicate.xpm" +#include "tools/duplicate_is.xpm" +#include "tools/delete.xpm" +#include "tools/delete_is.xpm" #include "channel_pvt.h" @@ -160,6 +171,16 @@ static MenuItem channels_ops[] = { NULL, 0, 0, NULL, NULL, NULL, NULL }, }; +/* the ops buttons */ +static OpsButton channels_ops_buttons[] = +{ + { new_xpm, new_is_xpm, channels_dialog_new_channel_callback, "New Channel", NULL, NULL, NULL, NULL, NULL, NULL }, + { raise_xpm, raise_is_xpm, channels_dialog_raise_channel_callback, "Raise Channel", NULL, NULL, NULL, NULL, NULL, NULL }, + { lower_xpm, lower_is_xpm, channels_dialog_lower_channel_callback, "Lower Channel", NULL, NULL, NULL, NULL, NULL, NULL }, + { duplicate_xpm, duplicate_is_xpm, channels_dialog_duplicate_channel_callback, "Duplicate Channel", NULL, NULL, NULL, NULL, NULL, NULL }, + { delete_xpm, delete_is_xpm, channels_dialog_delete_channel_callback, "Delete Channel", NULL, NULL, NULL, NULL, NULL, NULL }, + { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL} +}; /**************************************/ /* Public channels dialog functions */ @@ -170,6 +191,7 @@ channels_dialog_create () { GtkWidget *vbox; GtkWidget *listbox; + GtkWidget *button_box; if (!channelsD) { @@ -209,6 +231,14 @@ channels_dialog_create () gtk_widget_show (channelsD->channel_list); gtk_widget_show (listbox); + + /* The ops buttons */ + + button_box = ops_button_box_new (lc_shell, tool_tips, channels_ops_buttons); + + gtk_box_pack_start (GTK_BOX (vbox), button_box, FALSE, FALSE, 2); + gtk_widget_show (button_box); + /* Set up signals for map/unmap for the accelerators */ gtk_signal_connect (GTK_OBJECT (channelsD->vbox), "map", (GtkSignalFunc) channels_dialog_map_callback, @@ -513,14 +543,19 @@ channels_dialog_set_menu_sensitivity () /* new channel */ gtk_widget_set_sensitive (channels_ops[0].widget, !fs_sensitive); + ops_button_set_sensitive (channels_ops_buttons[0], !fs_sensitive); /* raise channel */ gtk_widget_set_sensitive (channels_ops[1].widget, !fs_sensitive && aux_sensitive); + ops_button_set_sensitive (channels_ops_buttons[1], !fs_sensitive && aux_sensitive); /* lower channel */ gtk_widget_set_sensitive (channels_ops[2].widget, !fs_sensitive && aux_sensitive); + ops_button_set_sensitive (channels_ops_buttons[2], !fs_sensitive && aux_sensitive); /* duplicate channel */ gtk_widget_set_sensitive (channels_ops[3].widget, !fs_sensitive && aux_sensitive); + ops_button_set_sensitive (channels_ops_buttons[3], !fs_sensitive && aux_sensitive); /* delete channel */ gtk_widget_set_sensitive (channels_ops[4].widget, !fs_sensitive && aux_sensitive); + ops_button_set_sensitive (channels_ops_buttons[4], !fs_sensitive && aux_sensitive); /* channel to selection */ gtk_widget_set_sensitive (channels_ops[5].widget, aux_sensitive); } diff --git a/app/gui/channels-dialog.c b/app/gui/channels-dialog.c index 6767ab7fd3..93e1aa85e4 100644 --- a/app/gui/channels-dialog.c +++ b/app/gui/channels-dialog.c @@ -33,12 +33,23 @@ #include "general.h" #include "interface.h" #include "layers_dialogP.h" +#include "ops_buttons.h" #include "paint_funcs.h" #include "palette.h" #include "resize.h" #include "tools/eye.xbm" #include "tools/channel.xbm" +#include "tools/new.xpm" +#include "tools/new_is.xpm" +#include "tools/raise.xpm" +#include "tools/raise_is.xpm" +#include "tools/lower.xpm" +#include "tools/lower_is.xpm" +#include "tools/duplicate.xpm" +#include "tools/duplicate_is.xpm" +#include "tools/delete.xpm" +#include "tools/delete_is.xpm" #include "channel_pvt.h" @@ -160,6 +171,16 @@ static MenuItem channels_ops[] = { NULL, 0, 0, NULL, NULL, NULL, NULL }, }; +/* the ops buttons */ +static OpsButton channels_ops_buttons[] = +{ + { new_xpm, new_is_xpm, channels_dialog_new_channel_callback, "New Channel", NULL, NULL, NULL, NULL, NULL, NULL }, + { raise_xpm, raise_is_xpm, channels_dialog_raise_channel_callback, "Raise Channel", NULL, NULL, NULL, NULL, NULL, NULL }, + { lower_xpm, lower_is_xpm, channels_dialog_lower_channel_callback, "Lower Channel", NULL, NULL, NULL, NULL, NULL, NULL }, + { duplicate_xpm, duplicate_is_xpm, channels_dialog_duplicate_channel_callback, "Duplicate Channel", NULL, NULL, NULL, NULL, NULL, NULL }, + { delete_xpm, delete_is_xpm, channels_dialog_delete_channel_callback, "Delete Channel", NULL, NULL, NULL, NULL, NULL, NULL }, + { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL} +}; /**************************************/ /* Public channels dialog functions */ @@ -170,6 +191,7 @@ channels_dialog_create () { GtkWidget *vbox; GtkWidget *listbox; + GtkWidget *button_box; if (!channelsD) { @@ -209,6 +231,14 @@ channels_dialog_create () gtk_widget_show (channelsD->channel_list); gtk_widget_show (listbox); + + /* The ops buttons */ + + button_box = ops_button_box_new (lc_shell, tool_tips, channels_ops_buttons); + + gtk_box_pack_start (GTK_BOX (vbox), button_box, FALSE, FALSE, 2); + gtk_widget_show (button_box); + /* Set up signals for map/unmap for the accelerators */ gtk_signal_connect (GTK_OBJECT (channelsD->vbox), "map", (GtkSignalFunc) channels_dialog_map_callback, @@ -513,14 +543,19 @@ channels_dialog_set_menu_sensitivity () /* new channel */ gtk_widget_set_sensitive (channels_ops[0].widget, !fs_sensitive); + ops_button_set_sensitive (channels_ops_buttons[0], !fs_sensitive); /* raise channel */ gtk_widget_set_sensitive (channels_ops[1].widget, !fs_sensitive && aux_sensitive); + ops_button_set_sensitive (channels_ops_buttons[1], !fs_sensitive && aux_sensitive); /* lower channel */ gtk_widget_set_sensitive (channels_ops[2].widget, !fs_sensitive && aux_sensitive); + ops_button_set_sensitive (channels_ops_buttons[2], !fs_sensitive && aux_sensitive); /* duplicate channel */ gtk_widget_set_sensitive (channels_ops[3].widget, !fs_sensitive && aux_sensitive); + ops_button_set_sensitive (channels_ops_buttons[3], !fs_sensitive && aux_sensitive); /* delete channel */ gtk_widget_set_sensitive (channels_ops[4].widget, !fs_sensitive && aux_sensitive); + ops_button_set_sensitive (channels_ops_buttons[4], !fs_sensitive && aux_sensitive); /* channel to selection */ gtk_widget_set_sensitive (channels_ops[5].widget, aux_sensitive); } diff --git a/app/gui/layers-dialog.c b/app/gui/layers-dialog.c index ed382b98ae..306dc59ad8 100644 --- a/app/gui/layers-dialog.c +++ b/app/gui/layers-dialog.c @@ -35,6 +35,7 @@ #include "interface.h" #include "layers_dialog.h" #include "layers_dialogP.h" +#include "ops_buttons.h" #include "paint_funcs.h" #include "palette.h" #include "resize.h" @@ -45,6 +46,19 @@ #include "tools/layer.xbm" #include "tools/mask.xbm" +#include "tools/new.xpm" +#include "tools/new_is.xpm" +#include "tools/raise.xpm" +#include "tools/raise_is.xpm" +#include "tools/lower.xpm" +#include "tools/lower_is.xpm" +#include "tools/duplicate.xpm" +#include "tools/duplicate_is.xpm" +#include "tools/delete.xpm" +#include "tools/delete_is.xpm" +#include "tools/anchor.xpm" +#include "tools/anchor_is.xpm" + #include "layer_pvt.h" @@ -254,6 +268,18 @@ static MenuItem option_items[] = { NULL, 0, 0, NULL, NULL, NULL, NULL } }; +/* the ops buttons */ +static OpsButton layers_ops_buttons[] = +{ + { new_xpm, new_is_xpm, layers_dialog_new_layer_callback, "New Layer", NULL, NULL, NULL, NULL, NULL, NULL }, + { raise_xpm, raise_is_xpm, layers_dialog_raise_layer_callback, "Raise Layer", NULL, NULL, NULL, NULL, NULL, NULL }, + { lower_xpm, lower_is_xpm, layers_dialog_lower_layer_callback, "Lower Layer", NULL, NULL, NULL, NULL, NULL, NULL }, + { duplicate_xpm, duplicate_is_xpm, layers_dialog_duplicate_layer_callback, "Duplicate Layer", NULL, NULL, NULL, NULL, NULL, NULL }, + { delete_xpm, delete_is_xpm, layers_dialog_delete_layer_callback, "Delete Layer", NULL, NULL, NULL, NULL, NULL, NULL }, + { anchor_xpm, anchor_is_xpm, layers_dialog_anchor_layer_callback, "Anchor Layer", NULL, NULL, NULL, NULL, NULL, NULL }, + { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL} +}; + /************************************/ /* Public layers dialog functions */ @@ -586,10 +612,12 @@ layers_dialog_create () { GtkWidget *vbox; GtkWidget *util_box; + GtkWidget *button_box; GtkWidget *label; GtkWidget *menu; GtkWidget *slider; GtkWidget *listbox; + if (!layersD) { @@ -675,6 +703,12 @@ layers_dialog_create () gtk_widget_show (layersD->layer_list); gtk_widget_show (listbox); + /* The ops buttons */ + + button_box = ops_button_box_new (lc_shell, tool_tips, layers_ops_buttons); + + gtk_box_pack_start (GTK_BOX (vbox), button_box, FALSE, FALSE, 2); + gtk_widget_show (button_box); /* Set up signals for map/unmap for the accelerators */ gtk_signal_connect (GTK_OBJECT (layersD->vbox), "map", @@ -1127,14 +1161,19 @@ layers_dialog_set_menu_sensitivity () /* new layer */ gtk_widget_set_sensitive (layers_ops[0].widget, gimage); + ops_button_set_sensitive (layers_ops_buttons[0], gimage); /* raise layer */ gtk_widget_set_sensitive (layers_ops[1].widget, fs && ac && gimage && lp); + ops_button_set_sensitive (layers_ops_buttons[1], fs && ac && gimage && lp); /* lower layer */ gtk_widget_set_sensitive (layers_ops[2].widget, fs && ac && gimage && lp); + ops_button_set_sensitive (layers_ops_buttons[2], fs && ac && gimage && lp); /* duplicate layer */ gtk_widget_set_sensitive (layers_ops[3].widget, fs && ac && gimage && lp); + ops_button_set_sensitive (layers_ops_buttons[3], fs && ac && gimage && lp); /* delete layer */ gtk_widget_set_sensitive (layers_ops[4].widget, ac && gimage && lp); + ops_button_set_sensitive (layers_ops_buttons[4], ac && gimage && lp); /* scale layer */ gtk_widget_set_sensitive (layers_ops[5].widget, ac && gimage && lp); /* resize layer */ @@ -1145,6 +1184,7 @@ layers_dialog_set_menu_sensitivity () gtk_widget_set_sensitive (layers_ops[8].widget, fs && ac && gimage && lm && lp); /* anchor layer */ gtk_widget_set_sensitive (layers_ops[9].widget, !fs && ac && gimage && lp); + ops_button_set_sensitive (layers_ops_buttons[5], !fs && ac && gimage && lp); /* merge visible layers */ gtk_widget_set_sensitive (layers_ops[10].widget, fs && ac && gimage && lp); /* flatten image */ diff --git a/app/layers_dialog.c b/app/layers_dialog.c index ed382b98ae..306dc59ad8 100644 --- a/app/layers_dialog.c +++ b/app/layers_dialog.c @@ -35,6 +35,7 @@ #include "interface.h" #include "layers_dialog.h" #include "layers_dialogP.h" +#include "ops_buttons.h" #include "paint_funcs.h" #include "palette.h" #include "resize.h" @@ -45,6 +46,19 @@ #include "tools/layer.xbm" #include "tools/mask.xbm" +#include "tools/new.xpm" +#include "tools/new_is.xpm" +#include "tools/raise.xpm" +#include "tools/raise_is.xpm" +#include "tools/lower.xpm" +#include "tools/lower_is.xpm" +#include "tools/duplicate.xpm" +#include "tools/duplicate_is.xpm" +#include "tools/delete.xpm" +#include "tools/delete_is.xpm" +#include "tools/anchor.xpm" +#include "tools/anchor_is.xpm" + #include "layer_pvt.h" @@ -254,6 +268,18 @@ static MenuItem option_items[] = { NULL, 0, 0, NULL, NULL, NULL, NULL } }; +/* the ops buttons */ +static OpsButton layers_ops_buttons[] = +{ + { new_xpm, new_is_xpm, layers_dialog_new_layer_callback, "New Layer", NULL, NULL, NULL, NULL, NULL, NULL }, + { raise_xpm, raise_is_xpm, layers_dialog_raise_layer_callback, "Raise Layer", NULL, NULL, NULL, NULL, NULL, NULL }, + { lower_xpm, lower_is_xpm, layers_dialog_lower_layer_callback, "Lower Layer", NULL, NULL, NULL, NULL, NULL, NULL }, + { duplicate_xpm, duplicate_is_xpm, layers_dialog_duplicate_layer_callback, "Duplicate Layer", NULL, NULL, NULL, NULL, NULL, NULL }, + { delete_xpm, delete_is_xpm, layers_dialog_delete_layer_callback, "Delete Layer", NULL, NULL, NULL, NULL, NULL, NULL }, + { anchor_xpm, anchor_is_xpm, layers_dialog_anchor_layer_callback, "Anchor Layer", NULL, NULL, NULL, NULL, NULL, NULL }, + { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL} +}; + /************************************/ /* Public layers dialog functions */ @@ -586,10 +612,12 @@ layers_dialog_create () { GtkWidget *vbox; GtkWidget *util_box; + GtkWidget *button_box; GtkWidget *label; GtkWidget *menu; GtkWidget *slider; GtkWidget *listbox; + if (!layersD) { @@ -675,6 +703,12 @@ layers_dialog_create () gtk_widget_show (layersD->layer_list); gtk_widget_show (listbox); + /* The ops buttons */ + + button_box = ops_button_box_new (lc_shell, tool_tips, layers_ops_buttons); + + gtk_box_pack_start (GTK_BOX (vbox), button_box, FALSE, FALSE, 2); + gtk_widget_show (button_box); /* Set up signals for map/unmap for the accelerators */ gtk_signal_connect (GTK_OBJECT (layersD->vbox), "map", @@ -1127,14 +1161,19 @@ layers_dialog_set_menu_sensitivity () /* new layer */ gtk_widget_set_sensitive (layers_ops[0].widget, gimage); + ops_button_set_sensitive (layers_ops_buttons[0], gimage); /* raise layer */ gtk_widget_set_sensitive (layers_ops[1].widget, fs && ac && gimage && lp); + ops_button_set_sensitive (layers_ops_buttons[1], fs && ac && gimage && lp); /* lower layer */ gtk_widget_set_sensitive (layers_ops[2].widget, fs && ac && gimage && lp); + ops_button_set_sensitive (layers_ops_buttons[2], fs && ac && gimage && lp); /* duplicate layer */ gtk_widget_set_sensitive (layers_ops[3].widget, fs && ac && gimage && lp); + ops_button_set_sensitive (layers_ops_buttons[3], fs && ac && gimage && lp); /* delete layer */ gtk_widget_set_sensitive (layers_ops[4].widget, ac && gimage && lp); + ops_button_set_sensitive (layers_ops_buttons[4], ac && gimage && lp); /* scale layer */ gtk_widget_set_sensitive (layers_ops[5].widget, ac && gimage && lp); /* resize layer */ @@ -1145,6 +1184,7 @@ layers_dialog_set_menu_sensitivity () gtk_widget_set_sensitive (layers_ops[8].widget, fs && ac && gimage && lm && lp); /* anchor layer */ gtk_widget_set_sensitive (layers_ops[9].widget, !fs && ac && gimage && lp); + ops_button_set_sensitive (layers_ops_buttons[5], !fs && ac && gimage && lp); /* merge visible layers */ gtk_widget_set_sensitive (layers_ops[10].widget, fs && ac && gimage && lp); /* flatten image */ diff --git a/app/ops_buttons.c b/app/ops_buttons.c new file mode 100644 index 0000000000..c219e53eb9 --- /dev/null +++ b/app/ops_buttons.c @@ -0,0 +1,112 @@ +/* The GIMP -- an image manipulation program + * Copyright (C) 1995 Spencer Kimball and Peter Mattis + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* To do this more elegantly, there should be a GtkWidget pixmap_button, + * probably derived from a simple hbox. It should keep track of the widgets + * sensitivity and draw the related pixmap. This way one could avoid the + * need to have a special function to set sensitivity as you'll find below. + * (sven@gimp.org) + */ + +#include "appenv.h" +#include "gimprc.h" +#include "ops_buttons.h" + + +GtkWidget *ops_button_box_new (GtkWidget *parent, + GtkTooltips *tool_tips, + OpsButton *ops_buttons) + +{ + GtkWidget *button; + GtkWidget *button_box; + GtkWidget *box; + GtkWidget *pixmapwid; + GdkPixmap *pixmap; + GdkBitmap *mask; + GdkPixmap *is_pixmap; + GdkBitmap *is_mask; + GtkStyle *style; + + gtk_widget_realize(parent); + style = gtk_widget_get_style(parent); + + button_box = gtk_hbox_new (FALSE, 1); + + while (ops_buttons->xpm_data) + { + box = gtk_hbox_new (FALSE, 0); + gtk_container_border_width (GTK_CONTAINER (box), 0); + + pixmap = gdk_pixmap_create_from_xpm_d (parent->window, + &mask, + &style->bg[GTK_STATE_NORMAL], + ops_buttons->xpm_data); + is_pixmap = gdk_pixmap_create_from_xpm_d (parent->window, + &is_mask, + &style->bg[GTK_STATE_NORMAL], + ops_buttons->xpm_is_data); + + pixmapwid = gtk_pixmap_new (pixmap, mask); + gtk_box_pack_start (GTK_BOX (box), pixmapwid, TRUE, TRUE, 3); + gtk_widget_show(pixmapwid); + gtk_widget_show(box); + + button = gtk_button_new (); + gtk_container_add (GTK_CONTAINER (button), box); + gtk_signal_connect_object (GTK_OBJECT (button), "clicked", + (GtkSignalFunc) ops_buttons->callback, + GTK_OBJECT (parent)); + + if (tool_tips != NULL) + gtk_tooltips_set_tip (tool_tips, button, ops_buttons->tooltip, NULL); + + gtk_box_pack_start (GTK_BOX(button_box), button, TRUE, TRUE, 0); + gtk_widget_show (button); + + ops_buttons->pixmap = pixmap; + ops_buttons->mask = mask; + ops_buttons->is_pixmap = is_pixmap; + ops_buttons->is_mask = is_mask; + ops_buttons->pixmapwid = pixmapwid; + ops_buttons->widget = button; + + ops_buttons++; + } + return (button_box); +} + +void +ops_button_set_sensitive(OpsButton ops_button, + gint sensitive) +{ + sensitive = (sensitive != FALSE); + if (sensitive == (GTK_WIDGET_SENSITIVE (ops_button.widget) != FALSE)) + return; + + if (sensitive) + gtk_pixmap_set (GTK_PIXMAP(ops_button.pixmapwid), + ops_button.pixmap, + ops_button.mask); + else + gtk_pixmap_set (GTK_PIXMAP(ops_button.pixmapwid), + ops_button.is_pixmap, + ops_button.is_mask); + + gtk_widget_set_sensitive (ops_button.widget, sensitive); +} diff --git a/app/ops_buttons.h b/app/ops_buttons.h new file mode 100644 index 0000000000..59dc8497dd --- /dev/null +++ b/app/ops_buttons.h @@ -0,0 +1,54 @@ +/* The GIMP -- an image manipulation program + * Copyright (C) 1995 Spencer Kimball and Peter Mattis + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef __OPS_BUTTONS_H__ +#define __OPS_BUTTONS_H__ + + +/* Structures */ + +typedef struct _OpsButton OpsButton; + +typedef void (*OpsButtonCallback) (GtkWidget *widget, + gpointer user_data); + +struct _OpsButton +{ + gchar **xpm_data; /* xpm data for the button in sensitive state */ + gchar **xpm_is_data; /* xpm data for the button in insensitive state */ + OpsButtonCallback callback; + char *tooltip; + GdkPixmap *pixmap; + GdkBitmap *mask; + GdkPixmap *is_pixmap; + GdkBitmap *is_mask; + GtkWidget *pixmapwid; /* the pixmap widget */ + GtkWidget *widget; /* the button widget */ +}; + + +/* Function declarations */ + +GtkWidget * ops_button_box_new (GtkWidget *, /* parent widget */ + GtkTooltips *, + OpsButton *); +void ops_button_set_sensitive (OpsButton, gint); + +#endif /* __OPS_BUTTONS_H__ */ + + diff --git a/app/tools/anchor.xpm b/app/tools/anchor.xpm new file mode 100644 index 0000000000..8356b71c27 --- /dev/null +++ b/app/tools/anchor.xpm @@ -0,0 +1,22 @@ +/* XPM */ +static char * anchor_xpm[] = { +"16 16 3 1", +" c None", +". c #000000", +"+ c #7F7F7F", +" ", +" ", +" .. ", +" ...... ", +" ....+ ", +" ..+ ", +" ..+ ", +" ..+ ", +" ..+ ", +" .. ..+ .. ", +" .. ..+ ..+ ", +" ... ..+ ...+ ", +" ..........+ ", +" ........+ ", +" ++..+++ ", +" + "}; diff --git a/app/tools/anchor_is.xpm b/app/tools/anchor_is.xpm new file mode 100644 index 0000000000..b352f5ceb0 --- /dev/null +++ b/app/tools/anchor_is.xpm @@ -0,0 +1,22 @@ +/* XPM */ +static char * anchor_is_xpm[] = { +"16 16 3 1", +" c None", +". c #7F7F7F", +"+ c #FFFFFF", +" ", +" .. ", +" ...... ", +" ....+ ", +" ..+ ", +" ..+ ", +" ..+ ", +" ..+ ", +" .. ..+ .. ", +" .. ..+ ..+ ", +" ... ..+ ...+ ", +" ..........+ ", +" ........+ ", +" ++..+++ ", +" + ", +" "}; diff --git a/app/tools/delete.xpm b/app/tools/delete.xpm new file mode 100644 index 0000000000..5e39d5809f --- /dev/null +++ b/app/tools/delete.xpm @@ -0,0 +1,22 @@ +/* XPM */ +static char * delete_xpm[] = { +"16 16 3 1", +" c None", +". c #000000", +"+ c #7F7F7F", +" ", +" ", +" .+ .+ ", +" ...+ ...+ ", +" ...+ ...+ ", +" ...+ ...+ ", +" ......+ ", +" ....+ ", +" ....+ ", +" ......+ ", +" ...++...+ ", +" ...+ ...+ ", +" ...+ ...+ ", +" .+ .+ ", +" ", +" "}; diff --git a/app/tools/delete_is.xpm b/app/tools/delete_is.xpm new file mode 100644 index 0000000000..00176d542f --- /dev/null +++ b/app/tools/delete_is.xpm @@ -0,0 +1,22 @@ +/* XPM */ +static char * delete_is_xpm[] = { +"16 16 3 1", +" c None", +". c #7F7F7F", +"+ c #FFFFFF", +" ", +" ", +" .+ .+ ", +" ...+ ...+ ", +" ...+ ...+ ", +" ...+ ...+ ", +" ......+ ", +" ....+ ", +" ....+ ", +" ......+ ", +" ...++...+ ", +" ...+ ...+ ", +" ...+ ...+ ", +" .+ .+ ", +" ", +" "}; diff --git a/app/tools/duplicate.xpm b/app/tools/duplicate.xpm new file mode 100644 index 0000000000..465e32b2b5 --- /dev/null +++ b/app/tools/duplicate.xpm @@ -0,0 +1,24 @@ +/* XPM */ +static char * duplicate_xpm[] = { +"17 17 4 1", +" c None", +". c #000000", +"+ c #FFFFFF", +"@ c #7F7F7F", +" ...... ", +" ..++++. ", +" .+.++++.@ ", +" .++.++++.... ", +" .....++++.++.@ ", +" .++++++++.++.@ ", +" .++++++++.++.@ ", +" .++++++++.++.@ ", +" .++++++++.++.@ ", +" .++++++++.++.@ ", +" .++++++++.++.@ ", +" .++++++++.++.@ ", +" ..........++.@ ", +" @@.++++++++.@ ", +" .++++++++.@ ", +" ..........@ ", +" @@@@@@@@@@ "}; diff --git a/app/tools/duplicate_is.xpm b/app/tools/duplicate_is.xpm new file mode 100644 index 0000000000..74cca8495b --- /dev/null +++ b/app/tools/duplicate_is.xpm @@ -0,0 +1,23 @@ +/* XPM */ +static char * duplicate_is_xpm[] = { +"17 17 3 1", +" c None", +". c #7F7F7F", +"+ c #FFFFFF", +" ...... ", +" .. . ", +" . . .+ ", +" . . .... ", +" ..... . .+ ", +" . . .+ ", +" . . .+ ", +" . . .+ ", +" . . .+ ", +" . . .+ ", +" . . .+ ", +" . . .+ ", +" .......... .+ ", +" ++. .+ ", +" . .+ ", +" ..........+ ", +" ++++++++++ "}; diff --git a/app/tools/lower.xpm b/app/tools/lower.xpm new file mode 100644 index 0000000000..c7f69296a8 --- /dev/null +++ b/app/tools/lower.xpm @@ -0,0 +1,24 @@ +/* XPM */ +static char * lower_xpm[] = { +"22 18 3 1", +" c None", +". c #000000", +"+ c #7F7F7F", +" ", +" ", +" ", +" ", +" ", +" ", +" .............. ", +" ............+ ", +" ..........+ ", +" ........+ ", +" ......+ ", +" ....+ ", +" ..+ ", +" + ", +" ", +" ", +" ", +" "}; diff --git a/app/tools/lower_is.xpm b/app/tools/lower_is.xpm new file mode 100644 index 0000000000..100a37d82b --- /dev/null +++ b/app/tools/lower_is.xpm @@ -0,0 +1,22 @@ +/* XPM */ +static char * lower_is_xpm[] = { +"16 16 3 1", +" c None", +". c #7F7F7F", +"+ c #FFFFFF", +" ", +" ", +" ", +" ", +" ", +" ............ ", +" ..........+ ", +" ........+ ", +" ......+ ", +" ....+ ", +" ..+ ", +" + ", +" ", +" ", +" ", +" "}; diff --git a/app/tools/new.xpm b/app/tools/new.xpm new file mode 100644 index 0000000000..0508c11cc4 --- /dev/null +++ b/app/tools/new.xpm @@ -0,0 +1,23 @@ +/* XPM */ +static char * new_xpm[] = { +"16 16 4 1", +" c None", +". c #000000", +"+ c #FFFFFF", +"@ c #7F7F7F", +" ", +" ...... ", +" ..++++.@ ", +" .+.++++.@ ", +" .++.++++.@ ", +" .....++++.@ ", +" .++++++++.@ ", +" .++++++++.@ ", +" .++++++++.@ ", +" .++++++++.@ ", +" .++++++++.@ ", +" .++++++++.@ ", +" .++++++++.@ ", +" ..........@ ", +" @@@@@@@@@@ ", +" "}; diff --git a/app/tools/new_is.xpm b/app/tools/new_is.xpm new file mode 100644 index 0000000000..5f1b185349 --- /dev/null +++ b/app/tools/new_is.xpm @@ -0,0 +1,22 @@ +/* XPM */ +static char * new_is_xpm[] = { +"16 16 3 1", +" c None", +". c #7F7F7F", +"+ c #F7F7F7", +" ", +" ...... ", +" .. .+ ", +" . . .+ ", +" . . .+ ", +" ..... .+ ", +" . .+ ", +" . .+ ", +" . .+ ", +" . .+ ", +" . .+ ", +" . .+ ", +" . .+ ", +" ..........+ ", +" ++++++++++ ", +" "}; diff --git a/app/tools/raise.xpm b/app/tools/raise.xpm new file mode 100644 index 0000000000..230ed471bb --- /dev/null +++ b/app/tools/raise.xpm @@ -0,0 +1,22 @@ +/* XPM */ +static char * raise_xpm[] = { +"16 16 3 1", +" c None", +". c #000000", +"+ c #7F7F7F", +" ", +" ", +" ", +" ", +" ", +" .. ", +" ....+ ", +" ......+ ", +" ........+ ", +" ..........+ ", +" ............+ ", +" ++++++++++++ ", +" ", +" ", +" ", +" "}; diff --git a/app/tools/raise_is.xpm b/app/tools/raise_is.xpm new file mode 100644 index 0000000000..328e6f9657 --- /dev/null +++ b/app/tools/raise_is.xpm @@ -0,0 +1,22 @@ +/* XPM */ +static char * raise_is_xpm[] = { +"16 16 3 1", +" c None", +". c #7F7F7F", +"+ c #FFFFFF", +" ", +" ", +" ", +" ", +" ", +" .. ", +" ....+ ", +" ......+ ", +" ........+ ", +" ..........+ ", +" ............+ ", +" ++++++++++++ ", +" ", +" ", +" ", +" "};