1998-04-03 18:29:25 +08:00
|
|
|
/* 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
|
1998-04-13 13:44:11 +08:00
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
1998-04-03 18:29:25 +08:00
|
|
|
*/
|
2000-12-29 23:22:01 +08:00
|
|
|
|
1999-05-01 05:11:27 +08:00
|
|
|
#include "config.h"
|
|
|
|
|
new ui for the "Layer Offset" dialog.
1999-07-22 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/channel_ops.[ch]: new ui for the "Layer Offset" dialog.
* app/channels_dialog.c
* app/layers_dialog.c: major code cleanup: Folded some callbacks
into common ones, "widget" instead of "w", indentation, ...
* app/commands.c
* app/interface.[ch]
* app/global_edit.c: the query boxes must be shown by the caller
now. There's no need to split up the string for the message box
manually as the Gtk 1.2 label widget handles newlines corectly.
Added the "edge_lock" toggle to the "Shrink Selection" dialog.
Nicer spacings for the query and message boxes.
* app/ink.c: tried to grab the pointer in the blob preview but
failed. Left the code there as a reminder (commented out).
* app/menus.c: reordered <Image>/Select.
I was bored and grep-ed the sources for ancient or deprecated stuff:
* app/about_dialog.[ch]
* app/actionarea.[ch]
* app/app_procs.c
* app/brush_edit.c
* app/brush_select.c
* app/color_select.c
* app/convert.c
* app/devices.c
* app/gdisplay.c
* app/gdisplay_ops.c
* app/histogram_tool.[ch]
* app/info_window.c
* app/install.c
* app/ops_buttons.c
* app/palette.c
* app/palette_select.c
* app/paths_dialog.c
* app/pattern_select.c
* app/resize.c
* app/scale_toolc.c
* app/text_tool.c:
s/container_border_width/container_set_border_width/g,
s/sprintf/g_snprintf/g, replaced some constant string lengths with
strlen(x).
* app/bezier_select.c
* app/blend.c
* app/boundary.c
* app/errors.[ch]
* app/free_select.c
* app/gimpbrushlist.c
* app/gimprc.c
* app/iscissors.c
* app/main.c
* app/patterns.[ch]
* app/text_tool.c: namespace fanaticism: prefixed all gimp error
functions with "gimp_" and formated the messages more uniformly.
* app/gradient.c
* app/gradient_select.c: same stuff as above for the ui
code. There are still some sub-dialogs which need cleanup.
Did some cleanup in most of these files: prototypes, removed tons
of #include's, i18n fixes, s/w/widget/ as above, indentation, ...
1999-07-23 00:21:10 +08:00
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
2001-01-25 06:36:18 +08:00
|
|
|
#include "libgimpwidgets/gimpwidgets.h"
|
|
|
|
|
1998-04-03 18:29:25 +08:00
|
|
|
#include "ops_buttons.h"
|
|
|
|
|
2000-02-04 12:31:18 +08:00
|
|
|
#include "libgimp/gimpintl.h"
|
|
|
|
|
2000-12-29 23:22:01 +08:00
|
|
|
|
2001-05-14 08:29:38 +08:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
OPS_BUTTON_MODIFIER_NONE,
|
|
|
|
OPS_BUTTON_MODIFIER_SHIFT,
|
|
|
|
OPS_BUTTON_MODIFIER_CTRL,
|
|
|
|
OPS_BUTTON_MODIFIER_ALT,
|
|
|
|
OPS_BUTTON_MODIFIER_SHIFT_CTRL,
|
|
|
|
OPS_BUTTON_MODIFIER_LAST
|
|
|
|
} OpsButtonModifier;
|
|
|
|
|
|
|
|
|
|
|
|
static void ops_button_extended_clicked (GtkWidget *widget,
|
|
|
|
guint modifier_state,
|
|
|
|
gpointer data);
|
1999-03-15 08:49:49 +08:00
|
|
|
|
1998-04-03 18:29:25 +08:00
|
|
|
|
1999-07-20 03:46:05 +08:00
|
|
|
GtkWidget *
|
2000-02-26 11:33:57 +08:00
|
|
|
ops_button_box_new (OpsButton *ops_button,
|
1999-07-20 03:46:05 +08:00
|
|
|
OpsButtonType ops_type)
|
1998-04-03 18:29:25 +08:00
|
|
|
{
|
|
|
|
GtkWidget *button;
|
|
|
|
GtkWidget *button_box;
|
2000-02-26 11:33:57 +08:00
|
|
|
GtkWidget *pixmap;
|
1999-10-24 04:30:59 +08:00
|
|
|
GSList *group = NULL;
|
1998-04-03 18:29:25 +08:00
|
|
|
|
1999-10-27 08:09:39 +08:00
|
|
|
button_box = gtk_hbox_new (TRUE, 1);
|
1998-04-03 18:29:25 +08:00
|
|
|
|
1999-03-15 08:49:49 +08:00
|
|
|
while (ops_button->xpm_data)
|
1998-04-03 18:29:25 +08:00
|
|
|
{
|
2000-02-26 11:33:57 +08:00
|
|
|
pixmap = gimp_pixmap_new (ops_button->xpm_data);
|
1999-10-24 04:30:59 +08:00
|
|
|
|
|
|
|
switch (ops_type)
|
1999-03-06 07:50:24 +08:00
|
|
|
{
|
2000-02-26 11:33:57 +08:00
|
|
|
case OPS_BUTTON_NORMAL:
|
2001-05-14 08:29:38 +08:00
|
|
|
button = gimp_button_new ();
|
1999-03-06 07:50:24 +08:00
|
|
|
break;
|
2000-02-26 11:33:57 +08:00
|
|
|
|
|
|
|
case OPS_BUTTON_RADIO:
|
1999-03-06 07:50:24 +08:00
|
|
|
button = gtk_radio_button_new (group);
|
|
|
|
group = gtk_radio_button_group (GTK_RADIO_BUTTON (button));
|
|
|
|
gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (button), FALSE);
|
|
|
|
break;
|
2000-02-26 11:33:57 +08:00
|
|
|
|
|
|
|
default:
|
|
|
|
g_warning ("ops_button_box_new: unknown type %d\n", ops_type);
|
|
|
|
continue;
|
1999-03-06 07:50:24 +08:00
|
|
|
}
|
1998-04-03 18:29:25 +08:00
|
|
|
|
2000-02-26 11:33:57 +08:00
|
|
|
gtk_container_add (GTK_CONTAINER (button), pixmap);
|
|
|
|
|
1999-03-15 08:49:49 +08:00
|
|
|
if (ops_button->ext_callbacks == NULL)
|
|
|
|
{
|
2001-07-29 16:37:43 +08:00
|
|
|
g_signal_connect_swapped (G_OBJECT (button), "clicked",
|
|
|
|
G_CALLBACK (ops_button->callback),
|
|
|
|
NULL);
|
1999-10-30 21:01:15 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2001-07-29 16:37:43 +08:00
|
|
|
g_signal_connect (G_OBJECT (button), "extended_clicked",
|
|
|
|
G_CALLBACK (ops_button_extended_clicked),
|
|
|
|
ops_button);
|
1999-03-15 08:49:49 +08:00
|
|
|
}
|
1998-04-03 18:29:25 +08:00
|
|
|
|
1999-11-03 17:58:46 +08:00
|
|
|
gimp_help_set_help_data (button,
|
|
|
|
gettext (ops_button->tooltip),
|
|
|
|
ops_button->private_tip);
|
1998-04-03 18:29:25 +08:00
|
|
|
|
1999-10-30 21:01:15 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (button_box), button, TRUE, TRUE, 0);
|
1999-03-06 07:50:24 +08:00
|
|
|
|
2000-02-26 11:33:57 +08:00
|
|
|
gtk_widget_show (pixmap);
|
1998-04-03 18:29:25 +08:00
|
|
|
gtk_widget_show (button);
|
|
|
|
|
1999-03-15 08:49:49 +08:00
|
|
|
ops_button->widget = button;
|
1998-04-03 18:29:25 +08:00
|
|
|
|
1999-03-15 08:49:49 +08:00
|
|
|
ops_button++;
|
1998-04-03 18:29:25 +08:00
|
|
|
}
|
|
|
|
|
2000-02-26 11:33:57 +08:00
|
|
|
return button_box;
|
1998-04-04 21:52:06 +08:00
|
|
|
}
|
|
|
|
|
1999-10-30 21:01:15 +08:00
|
|
|
static void
|
2001-05-14 08:29:38 +08:00
|
|
|
ops_button_extended_clicked (GtkWidget *widget,
|
|
|
|
guint modifier_state,
|
|
|
|
gpointer data)
|
1999-03-15 08:49:49 +08:00
|
|
|
{
|
2001-05-14 08:29:38 +08:00
|
|
|
OpsButton *ops_button;
|
|
|
|
OpsButtonModifier modifier;
|
1999-03-15 08:49:49 +08:00
|
|
|
|
2000-02-26 11:33:57 +08:00
|
|
|
g_return_if_fail (data != NULL);
|
|
|
|
ops_button = (OpsButton *) data;
|
1999-03-15 08:49:49 +08:00
|
|
|
|
2001-05-14 08:29:38 +08:00
|
|
|
if (modifier_state & GDK_SHIFT_MASK)
|
1999-06-03 22:55:43 +08:00
|
|
|
{
|
2001-05-14 08:29:38 +08:00
|
|
|
if (modifier_state & GDK_CONTROL_MASK)
|
|
|
|
modifier = OPS_BUTTON_MODIFIER_SHIFT_CTRL;
|
1999-06-03 22:55:43 +08:00
|
|
|
else
|
2001-05-14 08:29:38 +08:00
|
|
|
modifier = OPS_BUTTON_MODIFIER_SHIFT;
|
1999-06-03 22:55:43 +08:00
|
|
|
}
|
2001-05-14 08:29:38 +08:00
|
|
|
else if (modifier_state & GDK_CONTROL_MASK)
|
|
|
|
modifier = OPS_BUTTON_MODIFIER_CTRL;
|
|
|
|
else if (modifier_state & GDK_MOD1_MASK)
|
|
|
|
modifier = OPS_BUTTON_MODIFIER_ALT;
|
1999-03-15 08:49:49 +08:00
|
|
|
else
|
2001-05-14 08:29:38 +08:00
|
|
|
modifier = OPS_BUTTON_MODIFIER_NONE;
|
1999-03-15 08:49:49 +08:00
|
|
|
|
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
2001-07-24 Michael Natterer <mitch@gimp.org>
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
* configure.in: require glib/gtk+ >= 1.3.7, commented out the
gtkxmhtml stuff.
From now on, you will need glib, pango, atk and gtk+ HEAD from CVS
to hack or use GIMP HEAD.
Beware, it crashes randomly :)
* app/core/Makefile.am
* app/core/gimpmarshal.list: new file plus rules to generate
gimpmarshal.[ch] from it.
* app/core/*
* app/tools/*
* app/widgets/*
* libgimpwidgets/*: started to use the glib object system. All
core/ objects are still gtk objects however. All signals are
created using g_signal_new(). There are many gtk+ artefacts left.
Finally, we will _not_ use the gtk_signal_foo() wrappers and
friends any more.
* app/colormaps.c
* app/devices.[ch]
* app/disp_callbacks.c
* app/errorconsole.c
* app/file-save.[ch]
* app/interface.c
* app/module_db.c
* app/nav_window.c
* app/ops_buttons.c
* app/scroll.c
* app/user_install.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brushes-commands.c
* app/gui/color-notebook.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/image-commands.c
* app/gui/info-dialog.[ch]
* app/gui/layer-select.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/offset-dialog.c
* app/gui/palette-editor.c
* app/gui/palettes-commands.c
* app/gui/patterns-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.[ch]
* app/gui/splash.c
* app/gui/tips-dialog.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* libgimpbase/gimpenv.c: tons and tons of changes like "const
gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete
and currently disables), lots of s/gtk_signal/g_signal/,
removal/replacement of deprecated stuff,
s/GtkSignalFunc/GCallback/ and lots of small changes and fixes
while I was on it, zillions of warnings left...
* modules/Makefile.am: disabled the water color selector
temporarily (XInput issues).
* plug-ins/Makefile.am
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl: simply excluded all plug-ins
which did not build (including Script-Fu). They are trivial to
fix.
2001-07-25 05:27:11 +08:00
|
|
|
#ifdef __GNUC__
|
|
|
|
#warning FIXME: remove ops_buttons
|
|
|
|
#endif
|
|
|
|
#if 0
|
2001-05-14 08:29:38 +08:00
|
|
|
if (modifier > OPS_BUTTON_MODIFIER_NONE &&
|
|
|
|
modifier < OPS_BUTTON_MODIFIER_LAST)
|
1999-06-03 22:55:43 +08:00
|
|
|
{
|
2001-05-14 08:29:38 +08:00
|
|
|
if (ops_button->ext_callbacks[modifier - 1] != NULL)
|
|
|
|
(ops_button->ext_callbacks[modifier - 1]) (widget, NULL);
|
1999-06-03 22:55:43 +08:00
|
|
|
else
|
|
|
|
(ops_button->callback) (widget, NULL);
|
|
|
|
}
|
|
|
|
else
|
1999-03-15 08:49:49 +08:00
|
|
|
(ops_button->callback) (widget, NULL);
|
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
2001-07-24 Michael Natterer <mitch@gimp.org>
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
* configure.in: require glib/gtk+ >= 1.3.7, commented out the
gtkxmhtml stuff.
From now on, you will need glib, pango, atk and gtk+ HEAD from CVS
to hack or use GIMP HEAD.
Beware, it crashes randomly :)
* app/core/Makefile.am
* app/core/gimpmarshal.list: new file plus rules to generate
gimpmarshal.[ch] from it.
* app/core/*
* app/tools/*
* app/widgets/*
* libgimpwidgets/*: started to use the glib object system. All
core/ objects are still gtk objects however. All signals are
created using g_signal_new(). There are many gtk+ artefacts left.
Finally, we will _not_ use the gtk_signal_foo() wrappers and
friends any more.
* app/colormaps.c
* app/devices.[ch]
* app/disp_callbacks.c
* app/errorconsole.c
* app/file-save.[ch]
* app/interface.c
* app/module_db.c
* app/nav_window.c
* app/ops_buttons.c
* app/scroll.c
* app/user_install.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brushes-commands.c
* app/gui/color-notebook.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/image-commands.c
* app/gui/info-dialog.[ch]
* app/gui/layer-select.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/offset-dialog.c
* app/gui/palette-editor.c
* app/gui/palettes-commands.c
* app/gui/patterns-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.[ch]
* app/gui/splash.c
* app/gui/tips-dialog.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* libgimpbase/gimpenv.c: tons and tons of changes like "const
gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete
and currently disables), lots of s/gtk_signal/g_signal/,
removal/replacement of deprecated stuff,
s/GtkSignalFunc/GCallback/ and lots of small changes and fixes
while I was on it, zillions of warnings left...
* modules/Makefile.am: disabled the water color selector
temporarily (XInput issues).
* plug-ins/Makefile.am
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl: simply excluded all plug-ins
which did not build (including Script-Fu). They are trivial to
fix.
2001-07-25 05:27:11 +08:00
|
|
|
#endif
|
1999-03-15 08:49:49 +08:00
|
|
|
}
|