1997-11-25 06:05: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.
|
1997-11-25 06:05:25 +08:00
|
|
|
*/
|
2000-12-17 05:37:03 +08:00
|
|
|
|
2000-04-03 23:40:30 +08:00
|
|
|
#include "config.h"
|
|
|
|
|
2000-12-17 05:37:03 +08:00
|
|
|
#include <gtk/gtk.h>
|
2000-04-03 23:40:30 +08:00
|
|
|
#include <gdk/gdkkeysyms.h>
|
|
|
|
|
2001-01-24 02:49:44 +08:00
|
|
|
#include "libgimpcolor/gimpcolor.h"
|
2001-01-24 07:56:18 +08:00
|
|
|
#include "libgimpmath/gimpmath.h"
|
2001-01-24 02:49:44 +08:00
|
|
|
|
2000-12-17 05:37:03 +08:00
|
|
|
#include "apptypes.h"
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
#include "appenv.h"
|
2000-12-29 23:22:01 +08:00
|
|
|
#include "channel.h"
|
1997-11-25 06:05:25 +08:00
|
|
|
#include "channels_dialog.h"
|
|
|
|
#include "color_panel.h"
|
|
|
|
#include "drawable.h"
|
|
|
|
#include "gdisplay.h"
|
|
|
|
#include "gimage.h"
|
|
|
|
#include "gimage_mask.h"
|
1999-08-21 03:59:06 +08:00
|
|
|
#include "gimpdnd.h"
|
Jens Lautenbacher <jtl@gimp.org>
2000-12-18 Sven Neumann <sven@gimp.org>
Jens Lautenbacher <jtl@gimp.org>
* app/Makefile.am
* app/gimpbrushlistP.h
* app/gimpbrushpipeP.h
* app/gimpobjectP.h: removed these three files
* app/parasitelistP.h
* app/channels_dialog.c
* app/docindex.c
* app/gimpdrawable.c
* app/gimpdrawableP.h
* app/gimpimage.c
* app/gimpimageP.h
* app/gimplist.[ch]
* app/gimpobject.c
* app/gimpobject.h
* app/gimpsetP.h: changed according to header removal
* app/airbrush.c
* app/brush_select.[ch]
* app/brushes_cmds.c
* app/gimpbrush.[ch]
* app/gimpbrushgenerated.[ch]
* app/gimpbrushlist.[ch]
* app/gimpbrushpipe.[ch]
* app/gimpcontextpreview.c
* app/paint_core.c
* app/paintbrush.c
* app/pencil.c
* tools/pdbgen/pdb/brushes.pdb: Big Brushes Cleanup.
The GimpBrush* object hierarchy and the file formats were broken by
"design". This made it overly difficult to read and write pixmap
brushes and brush pipes, leading to the situation that The GIMP was
not able to read it's very own file formats. Since the GimpBrush
format did support arbitrary color depths, the introduction of a
file format for pixmap brushes was unnecessary.
The GimpBrushPixmap object is dead. GimpBrush has an additional
pixmap temp_buf and handles pixmap brushes transparently. The file
format of pixmap brushes is not any longer a grayscale brush plus
a pattern, but a simple brush with RGBA data. The old brushes can
still be loaded, but the .gpb format is deprecated.
GimpBrushPipe derives from GimpBrush. The fileformat is still a text
header, followed by a number of brushes, but those brushes are stored
in the new GimpBrush format (no pattern anymore). The pipe does not
care about the depth of the contained GimpBrushes, so we get
grayscale BrushPipes for free. Since the brush loader still loads the
old format, old .gih files can also still be loaded.
Since the brushes in the GimpBrushPipe do not any longer contain a
pointer to the pipe object, we do only temporarily switch brushes
in the paint_core routines. This is not very elegant, but the best
we can do without a major redesign.
* app/patterns.[ch]: changed the loader to work with a filedescriptor
instead of a filehandle to make it work with the new brush loading
code.
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl
* plug-ins/common/gih.c: new plug-in that saves GIH files in the
new format (loader will follow soon)
* plug-ins/common/gpb.c: removed since Pixmap Brushes are no longer
supported as a special file format.
* plug-ins/common/gbr.c: load and save brushes in the new brush format
which allows RGBA brushes too.
* plug-ins/common/pat.c: load and save grayscale patterns too
2000-12-18 23:14:08 +08:00
|
|
|
#include "gimppreviewcache.h"
|
1997-11-25 06:05:25 +08:00
|
|
|
#include "gimprc.h"
|
1999-09-28 01:58:10 +08:00
|
|
|
#include "gimpui.h"
|
1997-11-25 06:05:25 +08:00
|
|
|
#include "layers_dialogP.h"
|
1999-06-07 01:26:51 +08:00
|
|
|
#include "lc_dialogP.h"
|
|
|
|
#include "menus.h"
|
1998-04-03 18:29:25 +08:00
|
|
|
#include "ops_buttons.h"
|
1997-11-25 06:05:25 +08:00
|
|
|
#include "paint_funcs.h"
|
1999-08-21 03:59:06 +08:00
|
|
|
#include "undo.h"
|
|
|
|
|
2000-12-29 23:22:01 +08:00
|
|
|
#include "libgimp/gimphelpui.h"
|
2000-04-28 01:27:28 +08:00
|
|
|
|
1999-08-21 03:59:06 +08:00
|
|
|
#include "libgimp/gimpintl.h"
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-03-13 06:43:12 +08:00
|
|
|
#include "pixmaps/eye.xbm"
|
|
|
|
#include "pixmaps/channel.xbm"
|
|
|
|
#include "pixmaps/new.xpm"
|
|
|
|
#include "pixmaps/raise.xpm"
|
|
|
|
#include "pixmaps/lower.xpm"
|
|
|
|
#include "pixmaps/duplicate.xpm"
|
|
|
|
#include "pixmaps/delete.xpm"
|
1999-03-14 02:55:04 +08:00
|
|
|
#include "pixmaps/toselection.xpm"
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-12-29 23:22:01 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
#define COMPONENT_BASE_ID 0x10000000
|
|
|
|
|
|
|
|
typedef struct _ChannelsDialog ChannelsDialog;
|
|
|
|
|
1999-06-07 01:26:51 +08:00
|
|
|
struct _ChannelsDialog
|
|
|
|
{
|
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
|
|
|
GtkWidget *vbox;
|
|
|
|
GtkWidget *channel_list;
|
1999-10-25 04:16:48 +08:00
|
|
|
GtkWidget *scrolled_win;
|
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
|
|
|
GtkWidget *preview;
|
|
|
|
GtkWidget *ops_menu;
|
1998-06-07 21:55:36 +08:00
|
|
|
GtkAccelGroup *accel_group;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* state information */
|
2000-04-03 23:40:30 +08:00
|
|
|
GimpImage *gimage;
|
|
|
|
gint image_width, image_height;
|
|
|
|
gint gimage_width, gimage_height;
|
|
|
|
gdouble ratio;
|
|
|
|
|
|
|
|
gint num_components;
|
|
|
|
gint base_type;
|
|
|
|
ChannelType components[3];
|
|
|
|
|
|
|
|
Channel *active_channel;
|
|
|
|
Layer *floating_sel;
|
|
|
|
GSList *channel_widgets;
|
1997-11-25 06:05:25 +08:00
|
|
|
};
|
|
|
|
|
1999-06-07 01:26:51 +08:00
|
|
|
typedef struct _ChannelWidget ChannelWidget;
|
|
|
|
|
|
|
|
struct _ChannelWidget
|
|
|
|
{
|
|
|
|
GtkWidget *eye_widget;
|
|
|
|
GtkWidget *clip_widget;
|
|
|
|
GtkWidget *channel_preview;
|
|
|
|
GtkWidget *list_item;
|
|
|
|
GtkWidget *label;
|
|
|
|
|
2000-04-03 23:40:30 +08:00
|
|
|
GdkPixmap *channel_pixmap;
|
|
|
|
|
|
|
|
/* state information */
|
|
|
|
GimpImage *gimage;
|
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
|
|
|
Channel *channel;
|
2000-04-03 23:40:30 +08:00
|
|
|
gint width, height;
|
|
|
|
|
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
|
|
|
ChannelType type;
|
|
|
|
gint ID;
|
|
|
|
gboolean visited;
|
1999-08-21 03:59:06 +08:00
|
|
|
|
|
|
|
GimpDropType drop_type;
|
1999-06-07 01:26:51 +08:00
|
|
|
};
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
/* channels dialog widget routines */
|
1999-06-07 01:26:51 +08:00
|
|
|
static void channels_dialog_preview_extents (void);
|
1997-11-25 06:05:25 +08:00
|
|
|
static void channels_dialog_set_menu_sensitivity (void);
|
2000-02-10 08:00:54 +08:00
|
|
|
static void channels_dialog_set_channel (ChannelWidget *cw);
|
|
|
|
static void channels_dialog_unset_channel (ChannelWidget *cw);
|
|
|
|
static void channels_dialog_position_channel (Channel *channel,
|
|
|
|
gint position);
|
|
|
|
static void channels_dialog_add_channel (Channel *channel);
|
|
|
|
static void channels_dialog_remove_channel (ChannelWidget *cw);
|
1999-08-21 03:59:06 +08:00
|
|
|
|
2000-02-10 08:00:54 +08:00
|
|
|
static gint channel_list_events (GtkWidget *widget,
|
|
|
|
GdkEvent *event);
|
1999-06-07 01:26:51 +08:00
|
|
|
|
|
|
|
/* for (un)installing the menu accelarators */
|
2000-02-10 08:00:54 +08:00
|
|
|
static void channels_dialog_map_callback (GtkWidget *widget,
|
|
|
|
gpointer data);
|
|
|
|
static void channels_dialog_unmap_callback (GtkWidget *widget,
|
|
|
|
gpointer data);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-08-21 03:59:06 +08:00
|
|
|
/* ops buttons dnd callbacks */
|
2000-02-10 08:00:54 +08:00
|
|
|
static gboolean channels_dialog_drag_new_channel_callback
|
|
|
|
(GtkWidget *widget,
|
|
|
|
GdkDragContext *context,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
guint time);
|
|
|
|
static gboolean channels_dialog_drag_duplicate_channel_callback
|
|
|
|
(GtkWidget *widget,
|
|
|
|
GdkDragContext *context,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
guint time);
|
|
|
|
static gboolean channels_dialog_drag_channel_to_sel_callback
|
|
|
|
(GtkWidget *widget,
|
|
|
|
GdkDragContext *context,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
guint time);
|
|
|
|
static gboolean channels_dialog_drag_delete_channel_callback
|
|
|
|
(GtkWidget *widget,
|
|
|
|
GdkDragContext *context,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
guint time);
|
1999-08-21 03:59:06 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
/* channel widget function prototypes */
|
2000-02-10 08:00:54 +08:00
|
|
|
static ChannelWidget * channel_widget_get_ID (Channel *channel);
|
2000-04-03 23:40:30 +08:00
|
|
|
static ChannelWidget * channel_widget_create (GimpImage *gimage,
|
2000-02-10 08:00:54 +08:00
|
|
|
Channel *channel,
|
|
|
|
ChannelType channel_type);
|
|
|
|
|
|
|
|
static gboolean channel_widget_drag_motion_callback
|
|
|
|
(GtkWidget *widget,
|
|
|
|
GdkDragContext *context,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
guint time);
|
|
|
|
static gboolean channel_widget_drag_drop_callback(GtkWidget *widget,
|
|
|
|
GdkDragContext *context,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
guint time);
|
|
|
|
static void channel_widget_drag_begin_callback (GtkWidget *widget,
|
|
|
|
GdkDragContext *context);
|
|
|
|
static void channel_widget_drag_leave_callback (GtkWidget *widget,
|
|
|
|
GdkDragContext *context,
|
|
|
|
guint time);
|
|
|
|
static void channel_widget_drag_indicator_callback
|
|
|
|
(GtkWidget *widget,
|
|
|
|
gpointer data);
|
|
|
|
|
|
|
|
static void channel_widget_drop_color (GtkWidget *widget,
|
2001-01-20 23:37:26 +08:00
|
|
|
const GimpRGB *color,
|
2000-02-10 08:00:54 +08:00
|
|
|
gpointer data);
|
|
|
|
static void channel_widget_draw_drop_indicator (ChannelWidget *cw,
|
|
|
|
GimpDropType drop_type);
|
|
|
|
static void channel_widget_delete (ChannelWidget *cw);
|
|
|
|
static void channel_widget_select_update (GtkWidget *widget,
|
|
|
|
gpointer data);
|
|
|
|
static gint channel_widget_button_events (GtkWidget *widget,
|
2000-04-03 23:40:30 +08:00
|
|
|
GdkEvent *event,
|
|
|
|
gpointer data);
|
2000-02-10 08:00:54 +08:00
|
|
|
static gint channel_widget_preview_events (GtkWidget *widget,
|
2000-04-03 23:40:30 +08:00
|
|
|
GdkEvent *event,
|
|
|
|
gpointer data);
|
2000-02-10 08:00:54 +08:00
|
|
|
static void channel_widget_preview_redraw (ChannelWidget *cw);
|
|
|
|
static void channel_widget_no_preview_redraw (ChannelWidget *cw);
|
|
|
|
static void channel_widget_eye_redraw (ChannelWidget *cw);
|
|
|
|
static void channel_widget_exclusive_visible (ChannelWidget *cw);
|
|
|
|
static void channel_widget_channel_flush (GtkWidget *widget,
|
|
|
|
gpointer data);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-01-15 14:24:24 +08:00
|
|
|
static void channels_dialog_opacity_update (GtkAdjustment *adjustment,
|
|
|
|
gpointer data);
|
|
|
|
static void channels_dialog_color_changed (GimpColorButton *button,
|
|
|
|
gpointer data);
|
2001-01-15 12:37:01 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
/* assorted query dialogs */
|
2000-04-03 23:40:30 +08:00
|
|
|
static void channels_dialog_new_channel_query (GimpImage *gimage);
|
|
|
|
static void channels_dialog_edit_channel_query (ChannelWidget *cw);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-08-21 03:59:06 +08:00
|
|
|
/****************/
|
|
|
|
/* Local data */
|
|
|
|
/****************/
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
static ChannelsDialog *channelsD = NULL;
|
|
|
|
|
1999-06-07 01:26:51 +08:00
|
|
|
static GdkPixmap *eye_pixmap[] = { NULL, NULL, NULL };
|
|
|
|
static GdkPixmap *channel_pixmap[] = { NULL, NULL, NULL };
|
1997-11-25 06:05:25 +08:00
|
|
|
|
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
|
|
|
static gint suspend_gimage_notify = 0;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-06-07 01:26:51 +08:00
|
|
|
/* the ops buttons */
|
1999-11-03 17:58:46 +08:00
|
|
|
static GtkSignalFunc to_selection_ext_callbacks[] =
|
1999-06-03 22:55:43 +08:00
|
|
|
{
|
|
|
|
channels_dialog_add_channel_to_sel_callback, /* SHIFT */
|
|
|
|
channels_dialog_sub_channel_from_sel_callback, /* CTRL */
|
|
|
|
channels_dialog_intersect_channel_with_sel_callback, /* MOD1 */
|
|
|
|
channels_dialog_intersect_channel_with_sel_callback, /* SHIFT + CTRL */
|
|
|
|
};
|
1999-03-15 08:49:49 +08:00
|
|
|
|
1998-04-03 18:29:25 +08:00
|
|
|
static OpsButton channels_ops_buttons[] =
|
|
|
|
{
|
1999-06-07 01:26:51 +08:00
|
|
|
{ new_xpm, channels_dialog_new_channel_callback, NULL,
|
1999-10-30 21:01:15 +08:00
|
|
|
N_("New Channel"),
|
|
|
|
"channels/dialogs/new_channel.html",
|
|
|
|
NULL, 0 },
|
1999-06-07 01:26:51 +08:00
|
|
|
{ raise_xpm, channels_dialog_raise_channel_callback, NULL,
|
1999-10-30 21:01:15 +08:00
|
|
|
N_("Raise Channel"),
|
|
|
|
"channels/raise_channel.html",
|
|
|
|
NULL, 0 },
|
1999-06-07 01:26:51 +08:00
|
|
|
{ lower_xpm, channels_dialog_lower_channel_callback, NULL,
|
1999-10-30 21:01:15 +08:00
|
|
|
N_("Lower Channel"),
|
|
|
|
"channels/lower_channel.html",
|
|
|
|
NULL, 0 },
|
1999-06-07 01:26:51 +08:00
|
|
|
{ duplicate_xpm, channels_dialog_duplicate_channel_callback, NULL,
|
1999-10-30 21:01:15 +08:00
|
|
|
N_("Duplicate Channel"),
|
|
|
|
"channels/duplicate_channel.html",
|
|
|
|
NULL, 0 },
|
1999-08-21 03:59:06 +08:00
|
|
|
{ toselection_xpm, channels_dialog_channel_to_sel_callback,
|
|
|
|
to_selection_ext_callbacks,
|
1999-06-07 01:26:51 +08:00
|
|
|
N_("Channel to Selection \n"
|
|
|
|
"<Shift> Add "
|
|
|
|
"<Ctrl> Subtract "
|
1999-10-30 21:01:15 +08:00
|
|
|
"<Shift><Ctrl> Intersect"),
|
|
|
|
"channels/channel_to_selection.html",
|
|
|
|
NULL, 0 },
|
1999-06-21 13:46:32 +08:00
|
|
|
{ delete_xpm, channels_dialog_delete_channel_callback, NULL,
|
1999-10-30 21:01:15 +08:00
|
|
|
N_("Delete Channel"),
|
|
|
|
"channels/delete_channel.html",
|
|
|
|
NULL, 0 },
|
|
|
|
{ NULL, NULL, NULL, NULL, NULL, NULL, 0 }
|
1998-04-03 18:29:25 +08:00
|
|
|
};
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-08-21 03:59:06 +08:00
|
|
|
/* dnd structures */
|
1999-08-23 22:19:26 +08:00
|
|
|
static GtkTargetEntry channel_color_target_table[] =
|
|
|
|
{
|
|
|
|
GIMP_TARGET_CHANNEL,
|
|
|
|
GIMP_TARGET_COLOR
|
|
|
|
};
|
|
|
|
static guint n_channel_color_targets = (sizeof (channel_color_target_table) /
|
|
|
|
sizeof (channel_color_target_table[0]));
|
|
|
|
|
1999-08-21 03:59:06 +08:00
|
|
|
static GtkTargetEntry channel_target_table[] =
|
|
|
|
{
|
|
|
|
GIMP_TARGET_CHANNEL
|
|
|
|
};
|
|
|
|
static guint n_channel_targets = (sizeof (channel_target_table) /
|
|
|
|
sizeof (channel_target_table[0]));
|
|
|
|
|
|
|
|
static GtkTargetEntry component_target_table[] =
|
|
|
|
{
|
|
|
|
GIMP_TARGET_COMPONENT
|
|
|
|
};
|
|
|
|
static guint n_component_targets = (sizeof (component_target_table) /
|
|
|
|
sizeof (component_target_table[0]));
|
|
|
|
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
/**************************************/
|
|
|
|
/* Public channels dialog functions */
|
|
|
|
/**************************************/
|
|
|
|
|
|
|
|
GtkWidget *
|
1999-10-30 21:01:15 +08:00
|
|
|
channels_dialog_create (void)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
GtkWidget *vbox;
|
1998-04-03 18:29:25 +08:00
|
|
|
GtkWidget *button_box;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-08-21 03:59:06 +08:00
|
|
|
if (channelsD)
|
|
|
|
return channelsD->vbox;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-08-21 03:59:06 +08:00
|
|
|
channelsD = g_new (ChannelsDialog, 1);
|
|
|
|
channelsD->preview = NULL;
|
|
|
|
channelsD->gimage = NULL;
|
|
|
|
channelsD->active_channel = NULL;
|
|
|
|
channelsD->floating_sel = NULL;
|
|
|
|
channelsD->channel_widgets = NULL;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-08-21 03:59:06 +08:00
|
|
|
if (preview_size)
|
|
|
|
{
|
|
|
|
channelsD->preview = gtk_preview_new (GTK_PREVIEW_GRAYSCALE);
|
|
|
|
gtk_preview_size (GTK_PREVIEW (channelsD->preview),
|
|
|
|
preview_size, preview_size);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
1999-08-21 03:59:06 +08:00
|
|
|
/* The main vbox */
|
1999-11-03 17:58:46 +08:00
|
|
|
channelsD->vbox = gtk_event_box_new ();
|
|
|
|
|
|
|
|
gimp_help_set_help_data (channelsD->vbox, NULL,
|
|
|
|
"dialogs/channels/channels.html");
|
|
|
|
|
|
|
|
vbox = gtk_vbox_new (FALSE, 1);
|
1999-08-21 03:59:06 +08:00
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (vbox), 2);
|
1999-11-03 17:58:46 +08:00
|
|
|
gtk_container_add (GTK_CONTAINER (channelsD->vbox), vbox);
|
1999-08-21 03:59:06 +08:00
|
|
|
|
1999-10-25 04:16:48 +08:00
|
|
|
/* The channels commands pulldown menu */
|
1999-08-21 03:59:06 +08:00
|
|
|
menus_get_channels_menu (&channelsD->ops_menu, &channelsD->accel_group);
|
|
|
|
|
|
|
|
/* The channels listbox */
|
1999-10-25 04:16:48 +08:00
|
|
|
channelsD->scrolled_win = gtk_scrolled_window_new (NULL, NULL);
|
|
|
|
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (channelsD->scrolled_win),
|
1999-10-24 04:30:59 +08:00
|
|
|
GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);
|
1999-10-25 04:16:48 +08:00
|
|
|
gtk_widget_set_usize (channelsD->scrolled_win, LIST_WIDTH, LIST_HEIGHT);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), channelsD->scrolled_win, TRUE, TRUE, 2);
|
1999-08-21 03:59:06 +08:00
|
|
|
|
|
|
|
channelsD->channel_list = gtk_list_new ();
|
1999-10-25 04:16:48 +08:00
|
|
|
gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (channelsD->scrolled_win),
|
1999-08-21 03:59:06 +08:00
|
|
|
channelsD->channel_list);
|
|
|
|
gtk_list_set_selection_mode (GTK_LIST (channelsD->channel_list),
|
|
|
|
GTK_SELECTION_MULTIPLE);
|
|
|
|
gtk_signal_connect (GTK_OBJECT (channelsD->channel_list), "event",
|
|
|
|
(GtkSignalFunc) channel_list_events,
|
|
|
|
channelsD);
|
|
|
|
gtk_container_set_focus_vadjustment (GTK_CONTAINER (channelsD->channel_list),
|
1999-10-25 04:16:48 +08:00
|
|
|
gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (channelsD->scrolled_win)));
|
|
|
|
GTK_WIDGET_UNSET_FLAGS (GTK_SCROLLED_WINDOW (channelsD->scrolled_win)->vscrollbar,
|
1999-08-21 03:59:06 +08:00
|
|
|
GTK_CAN_FOCUS);
|
|
|
|
|
|
|
|
gtk_widget_show (channelsD->channel_list);
|
1999-10-25 04:16:48 +08:00
|
|
|
gtk_widget_show (channelsD->scrolled_win);
|
1999-08-21 03:59:06 +08:00
|
|
|
|
|
|
|
/* The ops buttons */
|
2000-02-26 11:33:57 +08:00
|
|
|
button_box = ops_button_box_new (channels_ops_buttons, OPS_BUTTON_NORMAL);
|
1999-08-21 03:59:06 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), button_box, FALSE, FALSE, 2);
|
|
|
|
gtk_widget_show (button_box);
|
|
|
|
|
|
|
|
/* Drop to new */
|
|
|
|
gtk_drag_dest_set (channels_ops_buttons[0].widget,
|
|
|
|
GTK_DEST_DEFAULT_ALL,
|
|
|
|
channel_target_table, n_channel_targets,
|
|
|
|
GDK_ACTION_COPY);
|
|
|
|
gtk_signal_connect (GTK_OBJECT (channels_ops_buttons[0].widget), "drag_drop",
|
|
|
|
GTK_SIGNAL_FUNC (channels_dialog_drag_new_channel_callback),
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
/* Drop to duplicate */
|
|
|
|
gtk_drag_dest_set (channels_ops_buttons[3].widget,
|
|
|
|
GTK_DEST_DEFAULT_ALL,
|
|
|
|
channel_target_table, n_channel_targets,
|
|
|
|
GDK_ACTION_COPY);
|
|
|
|
gtk_signal_connect (GTK_OBJECT (channels_ops_buttons[3].widget), "drag_drop",
|
|
|
|
GTK_SIGNAL_FUNC (channels_dialog_drag_duplicate_channel_callback),
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
/* Drop to channel to selection */
|
|
|
|
gtk_drag_dest_set (channels_ops_buttons[4].widget,
|
|
|
|
GTK_DEST_DEFAULT_ALL,
|
|
|
|
channel_target_table, n_channel_targets,
|
|
|
|
GDK_ACTION_COPY);
|
|
|
|
gtk_signal_connect (GTK_OBJECT (channels_ops_buttons[4].widget), "drag_drop",
|
|
|
|
GTK_SIGNAL_FUNC (channels_dialog_drag_channel_to_sel_callback),
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
/* Drop to trahcan */
|
|
|
|
gtk_drag_dest_set (channels_ops_buttons[5].widget,
|
|
|
|
GTK_DEST_DEFAULT_ALL,
|
|
|
|
channel_target_table, n_channel_targets,
|
|
|
|
GDK_ACTION_COPY);
|
|
|
|
gtk_signal_connect (GTK_OBJECT (channels_ops_buttons[5].widget), "drag_drop",
|
|
|
|
GTK_SIGNAL_FUNC (channels_dialog_drag_delete_channel_callback),
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
/* Set up signals for map/unmap for the accelerators */
|
|
|
|
gtk_signal_connect (GTK_OBJECT (channelsD->vbox), "map",
|
|
|
|
(GtkSignalFunc) channels_dialog_map_callback,
|
|
|
|
NULL);
|
|
|
|
gtk_signal_connect (GTK_OBJECT (channelsD->vbox), "unmap",
|
|
|
|
(GtkSignalFunc) channels_dialog_unmap_callback,
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
gtk_widget_show (vbox);
|
1999-11-03 17:58:46 +08:00
|
|
|
gtk_widget_show (channelsD->vbox);
|
1999-08-21 03:59:06 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
return channelsD->vbox;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1999-10-30 21:01:15 +08:00
|
|
|
channels_dialog_free (void)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
1999-06-07 01:26:51 +08:00
|
|
|
ChannelWidget *cw;
|
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
|
|
|
GSList *list;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
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
|
|
|
if (!channelsD)
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
|
|
|
|
1999-06-07 01:26:51 +08:00
|
|
|
suspend_gimage_notify++;
|
|
|
|
/* Free all elements in the channels listbox */
|
|
|
|
gtk_list_clear_items (GTK_LIST (channelsD->channel_list), 0, -1);
|
|
|
|
suspend_gimage_notify--;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
list = channelsD->channel_widgets;
|
|
|
|
while (list)
|
|
|
|
{
|
|
|
|
cw = (ChannelWidget *) list->data;
|
1998-01-29 16:03:27 +08:00
|
|
|
list = g_slist_next (list);
|
1999-06-07 01:26:51 +08:00
|
|
|
channel_widget_delete (cw);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
1999-06-07 01:26:51 +08:00
|
|
|
channelsD->channel_widgets = NULL;
|
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
|
|
|
channelsD->active_channel = NULL;
|
|
|
|
channelsD->floating_sel = NULL;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-06-07 01:26:51 +08:00
|
|
|
if (channelsD->preview)
|
|
|
|
gtk_object_sink (GTK_OBJECT (channelsD->preview));
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-06-07 01:26:51 +08:00
|
|
|
g_free (channelsD);
|
|
|
|
channelsD = NULL;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1998-06-29 08:24:44 +08:00
|
|
|
channels_dialog_update (GimpImage* gimage)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-04-03 23:40:30 +08:00
|
|
|
Channel *channel;
|
1997-11-25 06:05:25 +08:00
|
|
|
ChannelWidget *cw;
|
2000-04-03 23:40:30 +08:00
|
|
|
GSList *list;
|
|
|
|
GList *item_list;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
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
|
|
|
if (!channelsD || channelsD->gimage == gimage)
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
|
|
|
|
1999-06-07 01:26:51 +08:00
|
|
|
channelsD->gimage = gimage;
|
1998-10-06 04:22:52 +08:00
|
|
|
|
1997-11-27 03:30:17 +08:00
|
|
|
suspend_gimage_notify++;
|
1997-11-25 06:05:25 +08:00
|
|
|
/* Free all elements in the channels listbox */
|
|
|
|
gtk_list_clear_items (GTK_LIST (channelsD->channel_list), 0, -1);
|
1997-11-27 03:30:17 +08:00
|
|
|
suspend_gimage_notify--;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
list = channelsD->channel_widgets;
|
|
|
|
while (list)
|
|
|
|
{
|
|
|
|
cw = (ChannelWidget *) list->data;
|
1998-01-29 16:03:27 +08:00
|
|
|
list = g_slist_next (list);
|
1997-11-25 06:05:25 +08:00
|
|
|
channel_widget_delete (cw);
|
|
|
|
}
|
|
|
|
channelsD->channel_widgets = NULL;
|
|
|
|
|
|
|
|
/* Find the preview extents */
|
|
|
|
channels_dialog_preview_extents ();
|
|
|
|
|
1998-01-22 15:02:57 +08:00
|
|
|
channelsD->active_channel = NULL;
|
|
|
|
channelsD->floating_sel = NULL;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* The image components */
|
|
|
|
item_list = NULL;
|
2000-04-03 23:40:30 +08:00
|
|
|
switch ((channelsD->base_type = gimp_image_base_type (gimage)))
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
case RGB:
|
1999-08-21 03:59:06 +08:00
|
|
|
cw = channel_widget_create (gimage, NULL, RED_CHANNEL);
|
1998-01-29 16:03:27 +08:00
|
|
|
channelsD->channel_widgets = g_slist_append (channelsD->channel_widgets, cw);
|
1997-11-25 06:05:25 +08:00
|
|
|
item_list = g_list_append (item_list, cw->list_item);
|
1999-04-27 12:57:59 +08:00
|
|
|
channelsD->components[0] = RED_CHANNEL;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-08-21 03:59:06 +08:00
|
|
|
cw = channel_widget_create (gimage, NULL, GREEN_CHANNEL);
|
1998-01-29 16:03:27 +08:00
|
|
|
channelsD->channel_widgets = g_slist_append (channelsD->channel_widgets, cw);
|
1997-11-25 06:05:25 +08:00
|
|
|
item_list = g_list_append (item_list, cw->list_item);
|
1999-04-27 12:57:59 +08:00
|
|
|
channelsD->components[1] = GREEN_CHANNEL;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-08-21 03:59:06 +08:00
|
|
|
cw = channel_widget_create (gimage, NULL, BLUE_CHANNEL);
|
1998-01-29 16:03:27 +08:00
|
|
|
channelsD->channel_widgets = g_slist_append (channelsD->channel_widgets, cw);
|
1997-11-25 06:05:25 +08:00
|
|
|
item_list = g_list_append (item_list, cw->list_item);
|
1999-04-27 12:57:59 +08:00
|
|
|
channelsD->components[2] = BLUE_CHANNEL;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
channelsD->num_components = 3;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GRAY:
|
1999-08-21 03:59:06 +08:00
|
|
|
cw = channel_widget_create (gimage, NULL, GRAY_CHANNEL);
|
1998-01-29 16:03:27 +08:00
|
|
|
channelsD->channel_widgets = g_slist_append (channelsD->channel_widgets, cw);
|
1997-11-25 06:05:25 +08:00
|
|
|
item_list = g_list_append (item_list, cw->list_item);
|
1999-04-27 12:57:59 +08:00
|
|
|
channelsD->components[0] = GRAY_CHANNEL;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
channelsD->num_components = 1;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case INDEXED:
|
1999-08-21 03:59:06 +08:00
|
|
|
cw = channel_widget_create (gimage, NULL, INDEXED_CHANNEL);
|
1998-01-29 16:03:27 +08:00
|
|
|
channelsD->channel_widgets = g_slist_append (channelsD->channel_widgets, cw);
|
1997-11-25 06:05:25 +08:00
|
|
|
item_list = g_list_append (item_list, cw->list_item);
|
1999-04-27 12:57:59 +08:00
|
|
|
channelsD->components[0] = INDEXED_CHANNEL;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
channelsD->num_components = 1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* The auxillary image channels */
|
1999-08-21 03:59:06 +08:00
|
|
|
for (list = gimage->channels; list; list = g_slist_next (list))
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
/* create a channel list item */
|
|
|
|
channel = (Channel *) list->data;
|
1999-08-21 03:59:06 +08:00
|
|
|
cw = channel_widget_create (gimage, channel, AUXILLARY_CHANNEL);
|
1998-01-29 16:03:27 +08:00
|
|
|
channelsD->channel_widgets = g_slist_append (channelsD->channel_widgets, cw);
|
1997-11-25 06:05:25 +08:00
|
|
|
item_list = g_list_append (item_list, cw->list_item);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* get the index of the active channel */
|
|
|
|
if (item_list)
|
|
|
|
gtk_list_insert_items (GTK_LIST (channelsD->channel_list), item_list, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1999-10-30 21:01:15 +08:00
|
|
|
channels_dialog_flush (void)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-04-03 23:40:30 +08:00
|
|
|
GimpImage *gimage;
|
|
|
|
Channel *channel;
|
1997-11-25 06:05:25 +08:00
|
|
|
ChannelWidget *cw;
|
2000-04-03 23:40:30 +08:00
|
|
|
GSList *list;
|
|
|
|
gint pos;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
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
|
|
|
if (!channelsD || !(gimage = channelsD->gimage))
|
1999-06-07 01:26:51 +08:00
|
|
|
return;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-06-07 01:26:51 +08:00
|
|
|
/* Check if the gimage extents have changed */
|
|
|
|
if ((gimage->width != channelsD->gimage_width) ||
|
|
|
|
(gimage->height != channelsD->gimage_height) ||
|
2000-04-03 23:40:30 +08:00
|
|
|
(gimp_image_base_type (gimage) != channelsD->base_type))
|
1999-06-07 01:26:51 +08:00
|
|
|
{
|
|
|
|
channelsD->gimage = NULL;
|
|
|
|
channels_dialog_update (gimage);
|
|
|
|
}
|
2000-04-03 23:40:30 +08:00
|
|
|
else
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-04-03 23:40:30 +08:00
|
|
|
/* Set all current channel widgets to visited = FALSE */
|
|
|
|
for (list = channelsD->channel_widgets; list; list = g_slist_next (list))
|
|
|
|
{
|
|
|
|
cw = (ChannelWidget *) list->data;
|
|
|
|
cw->visited = FALSE;
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-04-03 23:40:30 +08:00
|
|
|
/* Add any missing channels */
|
|
|
|
for (list = gimage->channels; list; list = g_slist_next (list))
|
|
|
|
{
|
|
|
|
channel = (Channel *) list->data;
|
|
|
|
cw = channel_widget_get_ID (channel);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-04-03 23:40:30 +08:00
|
|
|
/* If the channel isn't in the channel widget list, add it */
|
|
|
|
if (cw == NULL)
|
|
|
|
{
|
|
|
|
/* sets visited = TRUE */
|
|
|
|
channels_dialog_add_channel (channel);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
cw->visited = TRUE;
|
1999-08-21 03:59:06 +08:00
|
|
|
}
|
1999-06-07 01:26:51 +08:00
|
|
|
|
2000-04-03 23:40:30 +08:00
|
|
|
/* Remove any extraneous auxillary channels */
|
|
|
|
list = channelsD->channel_widgets;
|
|
|
|
while (list)
|
1999-08-21 03:59:06 +08:00
|
|
|
{
|
2000-04-03 23:40:30 +08:00
|
|
|
cw = (ChannelWidget *) list->data;
|
|
|
|
list = g_slist_next (list);
|
|
|
|
if (cw->visited == FALSE && cw->type == AUXILLARY_CHANNEL)
|
|
|
|
{
|
|
|
|
/* will only be true for auxillary channels */
|
|
|
|
channels_dialog_remove_channel (cw);
|
|
|
|
}
|
1999-08-21 03:59:06 +08:00
|
|
|
}
|
1999-06-07 01:26:51 +08:00
|
|
|
|
2000-04-03 23:40:30 +08:00
|
|
|
/* Switch positions of items if necessary */
|
|
|
|
pos = 0;
|
|
|
|
for (list = gimage->channels; list; list = g_slist_next (list))
|
|
|
|
{
|
|
|
|
channel = (Channel *) list->data;
|
|
|
|
channels_dialog_position_channel (channel, pos++);
|
|
|
|
}
|
1999-06-07 01:26:51 +08:00
|
|
|
|
2000-04-03 23:40:30 +08:00
|
|
|
/* Set the active channel */
|
|
|
|
if (channelsD->active_channel != gimage->active_channel)
|
|
|
|
channelsD->active_channel = gimage->active_channel;
|
1999-06-07 01:26:51 +08:00
|
|
|
|
2000-04-03 23:40:30 +08:00
|
|
|
/* set the menus if floating sel status has changed */
|
|
|
|
if (channelsD->floating_sel != gimage->floating_sel)
|
|
|
|
channelsD->floating_sel = gimage->floating_sel;
|
1999-06-07 01:26:51 +08:00
|
|
|
|
2000-04-03 23:40:30 +08:00
|
|
|
channels_dialog_set_menu_sensitivity ();
|
1999-06-07 01:26:51 +08:00
|
|
|
|
2000-04-03 23:40:30 +08:00
|
|
|
gtk_container_foreach (GTK_CONTAINER (channelsD->channel_list),
|
|
|
|
channel_widget_channel_flush, NULL);
|
|
|
|
}
|
1999-06-07 01:26:51 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1999-10-30 21:01:15 +08:00
|
|
|
channels_dialog_clear (void)
|
1999-06-07 01:26:51 +08:00
|
|
|
{
|
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
|
|
|
if (!channelsD)
|
1999-06-07 01:26:51 +08:00
|
|
|
return;
|
|
|
|
|
|
|
|
suspend_gimage_notify++;
|
|
|
|
gtk_list_clear_items (GTK_LIST (channelsD->channel_list), 0, -1);
|
|
|
|
suspend_gimage_notify--;
|
|
|
|
|
|
|
|
channelsD->gimage = NULL;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1999-10-30 21:01:15 +08:00
|
|
|
channels_dialog_preview_extents (void)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-04-03 23:40:30 +08:00
|
|
|
GimpImage *gimage;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
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
|
|
|
g_return_if_fail (channelsD);
|
1998-10-06 04:22:52 +08:00
|
|
|
if (! (gimage = channelsD->gimage))
|
|
|
|
return;
|
|
|
|
|
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
|
|
|
channelsD->gimage_width = gimage->width;
|
1997-11-25 06:05:25 +08:00
|
|
|
channelsD->gimage_height = gimage->height;
|
|
|
|
|
|
|
|
/* Get the image width and height variables, based on the gimage */
|
|
|
|
if (gimage->width > gimage->height)
|
2000-12-15 23:54:17 +08:00
|
|
|
channelsD->ratio = (gdouble) preview_size / (gdouble) gimage->width;
|
|
|
|
else
|
|
|
|
channelsD->ratio = (gdouble) preview_size / (gdouble) gimage->height;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
if (preview_size)
|
|
|
|
{
|
2000-12-15 23:54:17 +08:00
|
|
|
channelsD->image_width = RINT (channelsD->ratio * gimage->width);
|
|
|
|
channelsD->image_height = RINT (channelsD->ratio * gimage->height);
|
|
|
|
|
1999-08-21 03:59:06 +08:00
|
|
|
if (channelsD->image_width < 1) channelsD->image_width = 1;
|
1997-12-08 08:24:32 +08:00
|
|
|
if (channelsD->image_height < 1) channelsD->image_height = 1;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
1999-08-21 03:59:06 +08:00
|
|
|
channelsD->image_width = channel_width;
|
1997-11-25 06:05:25 +08:00
|
|
|
channelsD->image_height = channel_height;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1999-10-30 21:01:15 +08:00
|
|
|
channels_dialog_set_menu_sensitivity (void)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
ChannelWidget *cw;
|
1999-06-07 01:26:51 +08:00
|
|
|
gint fs_sens;
|
|
|
|
gint aux_sens;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1998-01-22 15:02:57 +08:00
|
|
|
cw = channel_widget_get_ID (channelsD->active_channel);
|
1999-06-07 01:26:51 +08:00
|
|
|
fs_sens = (channelsD->floating_sel != NULL);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
if (cw)
|
1999-06-07 01:26:51 +08:00
|
|
|
aux_sens = (cw->type == AUXILLARY_CHANNEL);
|
1997-11-25 06:05:25 +08:00
|
|
|
else
|
1999-06-07 01:26:51 +08:00
|
|
|
aux_sens = FALSE;
|
|
|
|
|
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
|
|
|
#define SET_SENSITIVE(menu,condition) \
|
1999-11-24 03:11:29 +08:00
|
|
|
menus_set_sensitive ("<Channels>/" menu, (condition) != 0)
|
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
|
|
|
#define SET_OPS_SENSITIVE(button,condition) \
|
|
|
|
gtk_widget_set_sensitive (channels_ops_buttons[(button)].widget, \
|
|
|
|
(condition) != 0)
|
1999-06-07 01:26:51 +08:00
|
|
|
|
1999-11-24 03:11:29 +08:00
|
|
|
SET_SENSITIVE ("New Channel...", !fs_sens);
|
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
|
|
|
SET_OPS_SENSITIVE (0, !fs_sens);
|
1999-06-07 01:26:51 +08:00
|
|
|
|
1999-11-24 03:11:29 +08:00
|
|
|
SET_SENSITIVE ("Raise Channel", !fs_sens && aux_sens);
|
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
|
|
|
SET_OPS_SENSITIVE (1, !fs_sens && aux_sens);
|
1999-06-07 01:26:51 +08:00
|
|
|
|
1999-11-24 03:11:29 +08:00
|
|
|
SET_SENSITIVE ("Lower Channel", !fs_sens && aux_sens);
|
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
|
|
|
SET_OPS_SENSITIVE (2, !fs_sens && aux_sens);
|
1999-06-07 01:26:51 +08:00
|
|
|
|
1999-11-24 03:11:29 +08:00
|
|
|
SET_SENSITIVE ("Duplicate Channel", !fs_sens && aux_sens);
|
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
|
|
|
SET_OPS_SENSITIVE (3, !fs_sens && aux_sens);
|
1999-06-21 13:46:32 +08:00
|
|
|
|
1999-11-24 03:11:29 +08:00
|
|
|
SET_SENSITIVE ("Channel to Selection", aux_sens);
|
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
|
|
|
SET_OPS_SENSITIVE (4, aux_sens);
|
1999-06-07 01:26:51 +08:00
|
|
|
|
1999-11-24 03:11:29 +08:00
|
|
|
SET_SENSITIVE ("Add to Selection", aux_sens);
|
1999-12-14 22:10:34 +08:00
|
|
|
SET_SENSITIVE ("Subtract from Selection", aux_sens);
|
|
|
|
SET_SENSITIVE ("Intersect with Selection", aux_sens);
|
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
|
|
|
|
1999-11-24 03:11:29 +08:00
|
|
|
SET_SENSITIVE ("Delete Channel", !fs_sens && aux_sens);
|
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
|
|
|
SET_OPS_SENSITIVE (5, !fs_sens && aux_sens);
|
|
|
|
|
2000-02-01 06:59:22 +08:00
|
|
|
SET_SENSITIVE ("Edit Channel Attributes...", !fs_sens && aux_sens);
|
|
|
|
|
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
|
|
|
#undef SET_OPS_SENSITIVE
|
|
|
|
#undef SET_SENSITIVE
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2000-04-03 20:39:14 +08:00
|
|
|
static gint
|
|
|
|
channels_dialog_idle_set_channel_focus (gpointer data)
|
|
|
|
{
|
|
|
|
gtk_widget_grab_focus (GTK_WIDGET (data));
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
1998-03-19 06:35:31 +08:00
|
|
|
static void
|
1998-01-22 15:02:57 +08:00
|
|
|
channels_dialog_set_channel (ChannelWidget *channel_widget)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
GtkStateType state;
|
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
|
|
|
gint index;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
if (!channelsD || !channel_widget)
|
|
|
|
return;
|
|
|
|
|
|
|
|
/* Make sure the gimage is not notified of this change */
|
|
|
|
suspend_gimage_notify++;
|
|
|
|
|
|
|
|
/* get the list item data */
|
|
|
|
state = channel_widget->list_item->state;
|
|
|
|
|
1999-04-27 12:57:59 +08:00
|
|
|
if (channel_widget->type == AUXILLARY_CHANNEL)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
/* turn on the specified auxillary channel */
|
2000-04-03 23:40:30 +08:00
|
|
|
index = gimp_image_get_channel_index (channel_widget->gimage,
|
|
|
|
channel_widget->channel);
|
1997-11-25 06:05:25 +08:00
|
|
|
if ((index >= 0) && (state != GTK_STATE_SELECTED))
|
|
|
|
{
|
1999-10-16 17:50:55 +08:00
|
|
|
gtk_object_set_user_data (GTK_OBJECT (channel_widget->list_item),
|
|
|
|
NULL);
|
|
|
|
gtk_list_select_item (GTK_LIST (channelsD->channel_list),
|
|
|
|
index + channelsD->num_components);
|
2000-04-03 20:39:14 +08:00
|
|
|
/* let dnd finish it's work before setting the focus */
|
|
|
|
gtk_idle_add ((GtkFunction) channels_dialog_idle_set_channel_focus,
|
|
|
|
channel_widget->list_item);
|
1999-10-16 17:50:55 +08:00
|
|
|
gtk_object_set_user_data (GTK_OBJECT (channel_widget->list_item),
|
|
|
|
channel_widget);
|
2000-04-03 20:39:14 +08:00
|
|
|
/* channels_dialog_scroll_index (index + channelsD->num_components); */
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
1998-10-06 04:22:52 +08:00
|
|
|
}
|
|
|
|
else
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
if (state != GTK_STATE_SELECTED)
|
|
|
|
{
|
1999-10-16 17:50:55 +08:00
|
|
|
gtk_object_set_user_data (GTK_OBJECT (channel_widget->list_item),
|
|
|
|
NULL);
|
1997-11-25 06:05:25 +08:00
|
|
|
switch (channel_widget->type)
|
|
|
|
{
|
2000-04-03 23:40:30 +08:00
|
|
|
case RED_CHANNEL:
|
|
|
|
case GRAY_CHANNEL:
|
|
|
|
case INDEXED_CHANNEL:
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_list_select_item (GTK_LIST (channelsD->channel_list), 0);
|
|
|
|
break;
|
1999-04-27 12:57:59 +08:00
|
|
|
case GREEN_CHANNEL:
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_list_select_item (GTK_LIST (channelsD->channel_list), 1);
|
|
|
|
break;
|
1999-04-27 12:57:59 +08:00
|
|
|
case BLUE_CHANNEL:
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_list_select_item (GTK_LIST (channelsD->channel_list), 2);
|
|
|
|
break;
|
1999-04-27 12:57:59 +08:00
|
|
|
case AUXILLARY_CHANNEL:
|
1999-09-23 19:49:16 +08:00
|
|
|
g_error ("error in %s at %d: this shouldn't happen.",
|
1998-01-22 15:02:57 +08:00
|
|
|
__FILE__, __LINE__);
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
|
|
|
}
|
1999-08-21 03:59:06 +08:00
|
|
|
|
1999-10-16 17:50:55 +08:00
|
|
|
gtk_object_set_user_data (GTK_OBJECT (channel_widget->list_item),
|
|
|
|
channel_widget);
|
2000-04-03 23:40:30 +08:00
|
|
|
/* channels_dialog_scroll_index (0); */
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
suspend_gimage_notify--;
|
|
|
|
}
|
|
|
|
|
1998-03-19 06:35:31 +08:00
|
|
|
static void
|
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
|
|
|
channels_dialog_unset_channel (ChannelWidget *channel_widget)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
GtkStateType state;
|
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
|
|
|
gint index;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
if (!channelsD || !channel_widget)
|
|
|
|
return;
|
|
|
|
|
|
|
|
/* Make sure the gimage is not notified of this change */
|
|
|
|
suspend_gimage_notify++;
|
|
|
|
|
|
|
|
/* get the list item data */
|
|
|
|
state = channel_widget->list_item->state;
|
|
|
|
|
1999-04-27 12:57:59 +08:00
|
|
|
if (channel_widget->type == AUXILLARY_CHANNEL)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
/* turn off the specified auxillary channel */
|
2000-04-03 23:40:30 +08:00
|
|
|
index = gimp_image_get_channel_index (channel_widget->gimage,
|
|
|
|
channel_widget->channel);
|
1997-11-25 06:05:25 +08:00
|
|
|
if ((index >= 0) && (state == GTK_STATE_SELECTED))
|
|
|
|
{
|
1999-10-16 17:50:55 +08:00
|
|
|
gtk_object_set_user_data (GTK_OBJECT (channel_widget->list_item),
|
|
|
|
NULL);
|
|
|
|
gtk_list_unselect_item (GTK_LIST (channelsD->channel_list),
|
|
|
|
index + channelsD->num_components);
|
|
|
|
gtk_object_set_user_data (GTK_OBJECT (channel_widget->list_item),
|
|
|
|
channel_widget);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
}
|
1998-01-22 15:02:57 +08:00
|
|
|
else
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
1998-01-22 15:02:57 +08:00
|
|
|
if (state == GTK_STATE_SELECTED)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
1999-10-16 17:50:55 +08:00
|
|
|
gtk_object_set_user_data (GTK_OBJECT (channel_widget->list_item),
|
|
|
|
NULL);
|
1997-11-25 06:05:25 +08:00
|
|
|
switch (channel_widget->type)
|
|
|
|
{
|
2000-04-03 23:40:30 +08:00
|
|
|
case RED_CHANNEL:
|
|
|
|
case GRAY_CHANNEL:
|
|
|
|
case INDEXED_CHANNEL:
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_list_unselect_item (GTK_LIST (channelsD->channel_list), 0);
|
|
|
|
break;
|
1999-04-27 12:57:59 +08:00
|
|
|
case GREEN_CHANNEL:
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_list_unselect_item (GTK_LIST (channelsD->channel_list), 1);
|
|
|
|
break;
|
1999-04-27 12:57:59 +08:00
|
|
|
case BLUE_CHANNEL:
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_list_unselect_item (GTK_LIST (channelsD->channel_list), 2);
|
|
|
|
break;
|
1999-04-27 12:57:59 +08:00
|
|
|
case AUXILLARY_CHANNEL:
|
1999-09-23 19:49:16 +08:00
|
|
|
g_error ("error in %s at %d: this shouldn't happen.",
|
1998-01-22 15:02:57 +08:00
|
|
|
__FILE__, __LINE__);
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
|
|
|
}
|
1999-08-21 03:59:06 +08:00
|
|
|
|
1999-10-16 17:50:55 +08:00
|
|
|
gtk_object_set_user_data (GTK_OBJECT (channel_widget->list_item),
|
|
|
|
channel_widget);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
}
|
1998-10-06 04:22:52 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
suspend_gimage_notify--;
|
|
|
|
}
|
|
|
|
|
1998-03-19 06:35:31 +08:00
|
|
|
static void
|
1999-08-21 03:59:06 +08:00
|
|
|
channels_dialog_position_channel (Channel *channel,
|
|
|
|
gint new_index)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
1999-08-21 03:59:06 +08:00
|
|
|
ChannelWidget *channel_widget;
|
1997-11-25 06:05:25 +08:00
|
|
|
GList *list = NULL;
|
|
|
|
|
1999-08-21 03:59:06 +08:00
|
|
|
channel_widget = channel_widget_get_ID (channel);
|
1997-11-25 06:05:25 +08:00
|
|
|
if (!channelsD || !channel_widget)
|
|
|
|
return;
|
|
|
|
|
1999-10-16 17:50:55 +08:00
|
|
|
if ((new_index + channelsD->num_components) ==
|
|
|
|
g_slist_index (channelsD->channel_widgets, channel_widget))
|
1999-08-21 03:59:06 +08:00
|
|
|
return;
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
/* Make sure the gimage is not notified of this change */
|
|
|
|
suspend_gimage_notify++;
|
|
|
|
|
|
|
|
/* Remove the channel from the dialog */
|
|
|
|
list = g_list_append (list, channel_widget->list_item);
|
|
|
|
gtk_list_remove_items (GTK_LIST (channelsD->channel_list), list);
|
1999-08-21 03:59:06 +08:00
|
|
|
channelsD->channel_widgets = g_slist_remove (channelsD->channel_widgets,
|
|
|
|
channel_widget);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* Add it back at the proper index */
|
1999-08-21 03:59:06 +08:00
|
|
|
gtk_list_insert_items (GTK_LIST (channelsD->channel_list), list,
|
|
|
|
new_index + channelsD->num_components);
|
|
|
|
channelsD->channel_widgets =
|
|
|
|
g_slist_insert (channelsD->channel_widgets, channel_widget,
|
|
|
|
new_index + channelsD->num_components);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-04-03 23:40:30 +08:00
|
|
|
/* channels_dialog_scroll_index (new_index > 0 ? */
|
|
|
|
/* new_index + channelsD->num_components + 1 : */
|
|
|
|
/* channelsD->num_components); */
|
1999-10-25 04:16:48 +08:00
|
|
|
|
1999-08-21 03:59:06 +08:00
|
|
|
suspend_gimage_notify--;
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1998-03-19 06:35:31 +08:00
|
|
|
static void
|
1998-01-22 15:02:57 +08:00
|
|
|
channels_dialog_add_channel (Channel *channel)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
ChannelWidget *channel_widget;
|
2000-04-03 23:40:30 +08:00
|
|
|
GimpImage *gimage;
|
|
|
|
GList *item_list;
|
|
|
|
gint position;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
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
|
|
|
if (!channelsD || !channel || !(gimage = channelsD->gimage))
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
|
|
|
|
|
|
|
item_list = NULL;
|
|
|
|
|
1999-08-21 03:59:06 +08:00
|
|
|
channel_widget = channel_widget_create (gimage, channel, AUXILLARY_CHANNEL);
|
1997-11-25 06:05:25 +08:00
|
|
|
item_list = g_list_append (item_list, channel_widget->list_item);
|
|
|
|
|
2000-04-03 23:40:30 +08:00
|
|
|
position = gimp_image_get_channel_index (gimage, channel);
|
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
|
|
|
channelsD->channel_widgets =
|
|
|
|
g_slist_insert (channelsD->channel_widgets, channel_widget,
|
|
|
|
position + channelsD->num_components);
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_list_insert_items (GTK_LIST (channelsD->channel_list), item_list,
|
|
|
|
position + channelsD->num_components);
|
|
|
|
}
|
|
|
|
|
1998-03-19 06:35:31 +08:00
|
|
|
static void
|
1998-01-22 15:02:57 +08:00
|
|
|
channels_dialog_remove_channel (ChannelWidget *channel_widget)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
GList *list = NULL;
|
|
|
|
|
|
|
|
if (!channelsD || !channel_widget)
|
|
|
|
return;
|
|
|
|
|
|
|
|
/* Make sure the gimage is not notified of this change */
|
|
|
|
suspend_gimage_notify++;
|
|
|
|
|
|
|
|
/* Remove the requested channel from the dialog */
|
|
|
|
list = g_list_append (list, channel_widget->list_item);
|
|
|
|
gtk_list_remove_items (GTK_LIST (channelsD->channel_list), list);
|
|
|
|
|
|
|
|
/* Delete the channel_widget */
|
|
|
|
channel_widget_delete (channel_widget);
|
1998-03-14 01:46:40 +08:00
|
|
|
|
|
|
|
suspend_gimage_notify--;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
channel_list_events (GtkWidget *widget,
|
|
|
|
GdkEvent *event)
|
|
|
|
{
|
1999-08-23 22:19:26 +08:00
|
|
|
ChannelWidget *channel_widget;
|
1997-11-25 06:05:25 +08:00
|
|
|
GdkEventButton *bevent;
|
1999-08-21 03:59:06 +08:00
|
|
|
GtkWidget *event_widget;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
event_widget = gtk_get_event_widget (event);
|
|
|
|
|
|
|
|
if (GTK_IS_LIST_ITEM (event_widget))
|
|
|
|
{
|
1999-08-21 03:59:06 +08:00
|
|
|
channel_widget =
|
|
|
|
(ChannelWidget *) gtk_object_get_user_data (GTK_OBJECT (event_widget));
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
switch (event->type)
|
|
|
|
{
|
|
|
|
case GDK_BUTTON_PRESS:
|
|
|
|
bevent = (GdkEventButton *) event;
|
1999-11-20 20:12:41 +08:00
|
|
|
if (bevent->button == 3)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
1999-06-07 01:26:51 +08:00
|
|
|
gtk_menu_popup (GTK_MENU (channelsD->ops_menu),
|
|
|
|
NULL, NULL, NULL, NULL,
|
|
|
|
bevent->button, bevent->time);
|
1997-11-25 06:05:25 +08:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2000-04-03 23:40:30 +08:00
|
|
|
case GDK_2BUTTON_PRESS:
|
|
|
|
if (channel_widget->type == AUXILLARY_CHANNEL)
|
|
|
|
channels_dialog_edit_channel_query (channel_widget);
|
|
|
|
return TRUE;
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*******************************/
|
|
|
|
/* channels dialog callbacks */
|
|
|
|
/*******************************/
|
|
|
|
|
|
|
|
static void
|
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
|
|
|
channels_dialog_map_callback (GtkWidget *widget,
|
1999-08-21 03:59:06 +08:00
|
|
|
gpointer data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
1999-06-07 01:26:51 +08:00
|
|
|
if (! channelsD)
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
|
|
|
|
1999-06-07 01:26:51 +08:00
|
|
|
gtk_window_add_accel_group (GTK_WINDOW (lc_dialog->shell),
|
1998-06-07 21:55:36 +08:00
|
|
|
channelsD->accel_group);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
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
|
|
|
channels_dialog_unmap_callback (GtkWidget *widget,
|
1999-08-21 03:59:06 +08:00
|
|
|
gpointer data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
1999-06-07 01:26:51 +08:00
|
|
|
if (! channelsD)
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
|
|
|
|
1999-06-07 01:26:51 +08:00
|
|
|
gtk_window_remove_accel_group (GTK_WINDOW (lc_dialog->shell),
|
1998-06-07 21:55:36 +08:00
|
|
|
channelsD->accel_group);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2000-04-03 23:40:30 +08:00
|
|
|
/***********************************/
|
|
|
|
/* callbacks exported to menus.c */
|
|
|
|
/***********************************/
|
|
|
|
|
1999-06-07 01:26:51 +08:00
|
|
|
void
|
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
|
|
|
channels_dialog_new_channel_callback (GtkWidget *widget,
|
1999-08-21 03:59:06 +08:00
|
|
|
gpointer data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
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
|
|
|
if (!channelsD || channelsD->gimage == NULL)
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
|
|
|
|
1998-06-29 08:24:44 +08:00
|
|
|
channels_dialog_new_channel_query (channelsD->gimage);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
1999-06-07 01:26:51 +08:00
|
|
|
void
|
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
|
|
|
channels_dialog_raise_channel_callback (GtkWidget *widget,
|
1999-08-21 03:59:06 +08:00
|
|
|
gpointer data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-04-03 23:40:30 +08:00
|
|
|
GimpImage *gimage;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
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
|
|
|
if (!channelsD || !(gimage = channelsD->gimage))
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
|
|
|
|
1998-01-22 15:02:57 +08:00
|
|
|
if (gimage->active_channel != NULL)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-04-03 23:40:30 +08:00
|
|
|
gimp_image_raise_channel (gimage, gimage->active_channel);
|
1997-11-25 06:05:25 +08:00
|
|
|
gdisplays_flush ();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1999-06-07 01:26:51 +08:00
|
|
|
void
|
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
|
|
|
channels_dialog_lower_channel_callback (GtkWidget *widget,
|
1999-08-21 03:59:06 +08:00
|
|
|
gpointer data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-04-03 23:40:30 +08:00
|
|
|
GimpImage *gimage;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
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
|
|
|
if (!channelsD || !(gimage = channelsD->gimage))
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
|
|
|
|
1998-01-22 15:02:57 +08:00
|
|
|
if (gimage->active_channel != NULL)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-04-03 23:40:30 +08:00
|
|
|
gimp_image_lower_channel (gimage, gimage->active_channel);
|
1997-11-25 06:05:25 +08:00
|
|
|
gdisplays_flush ();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1999-06-07 01:26:51 +08:00
|
|
|
void
|
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
|
|
|
channels_dialog_duplicate_channel_callback (GtkWidget *widget,
|
1999-08-21 03:59:06 +08:00
|
|
|
gpointer data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-04-03 23:40:30 +08:00
|
|
|
GimpImage *gimage;
|
1997-11-25 06:05:25 +08:00
|
|
|
Channel *active_channel;
|
|
|
|
Channel *new_channel;
|
|
|
|
|
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
|
|
|
if (!channelsD || !(gimage = channelsD->gimage))
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
|
|
|
|
2000-04-03 23:40:30 +08:00
|
|
|
if ((active_channel = gimp_image_get_active_channel (gimage)))
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
new_channel = channel_copy (active_channel);
|
2000-04-03 23:40:30 +08:00
|
|
|
gimp_image_add_channel (gimage, new_channel, -1);
|
1997-11-25 06:05:25 +08:00
|
|
|
gdisplays_flush ();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1999-06-07 01:26:51 +08:00
|
|
|
void
|
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
|
|
|
channels_dialog_delete_channel_callback (GtkWidget *widget,
|
1999-08-21 03:59:06 +08:00
|
|
|
gpointer data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-04-03 23:40:30 +08:00
|
|
|
GimpImage *gimage;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
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
|
|
|
if (!channelsD || !(gimage = channelsD->gimage))
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
|
|
|
|
1998-01-22 15:02:57 +08:00
|
|
|
if (gimage->active_channel != NULL)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-04-03 23:40:30 +08:00
|
|
|
gimp_image_remove_channel (gimage, gimage->active_channel);
|
1997-11-25 06:05:25 +08:00
|
|
|
gdisplays_flush ();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1999-06-07 01:26:51 +08:00
|
|
|
void
|
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
|
|
|
channels_dialog_channel_to_sel_callback (GtkWidget *widget,
|
1999-08-21 03:59:06 +08:00
|
|
|
gpointer data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-04-03 23:40:30 +08:00
|
|
|
GimpImage *gimage;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
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
|
|
|
if (!channelsD || !(gimage = channelsD->gimage))
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
|
|
|
|
1998-01-22 15:02:57 +08:00
|
|
|
if (gimage->active_channel != NULL)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
gimage_mask_load (gimage, gimage->active_channel);
|
|
|
|
gdisplays_flush ();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1999-06-07 01:26:51 +08:00
|
|
|
void
|
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
|
|
|
channels_dialog_add_channel_to_sel_callback (GtkWidget *widget,
|
1999-08-21 03:59:06 +08:00
|
|
|
gpointer data)
|
1999-03-14 02:55:04 +08:00
|
|
|
{
|
2000-04-03 23:40:30 +08:00
|
|
|
GimpImage *gimage;
|
1999-03-14 02:55:04 +08:00
|
|
|
Channel *active_channel;
|
|
|
|
Channel *new_channel;
|
|
|
|
|
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
|
|
|
if (!channelsD || !(gimage = channelsD->gimage))
|
1999-03-14 02:55:04 +08:00
|
|
|
return;
|
|
|
|
|
2000-04-03 23:40:30 +08:00
|
|
|
if ((active_channel = gimp_image_get_active_channel (gimage)))
|
1999-03-14 02:55:04 +08:00
|
|
|
{
|
2000-04-03 23:40:30 +08:00
|
|
|
new_channel = channel_copy (gimp_image_get_mask (gimage));
|
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
|
|
|
channel_combine_mask (new_channel,
|
|
|
|
active_channel,
|
2000-12-29 23:22:01 +08:00
|
|
|
CHANNEL_OP_ADD,
|
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
|
|
|
0, 0); /* off x/y */
|
1999-03-14 02:55:04 +08:00
|
|
|
gimage_mask_load (gimage, new_channel);
|
|
|
|
channel_delete (new_channel);
|
|
|
|
gdisplays_flush ();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1999-06-07 01:26:51 +08:00
|
|
|
void
|
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
|
|
|
channels_dialog_sub_channel_from_sel_callback (GtkWidget *widget,
|
1999-08-21 03:59:06 +08:00
|
|
|
gpointer data)
|
1999-03-14 02:55:04 +08:00
|
|
|
{
|
2000-04-03 23:40:30 +08:00
|
|
|
GimpImage *gimage;
|
1999-03-14 02:55:04 +08:00
|
|
|
Channel *active_channel;
|
|
|
|
Channel *new_channel;
|
|
|
|
|
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
|
|
|
if (!channelsD || !(gimage = channelsD->gimage))
|
1999-03-14 02:55:04 +08:00
|
|
|
return;
|
|
|
|
|
2000-04-03 23:40:30 +08:00
|
|
|
if ((active_channel = gimp_image_get_active_channel (gimage)))
|
1999-03-14 02:55:04 +08:00
|
|
|
{
|
2000-04-03 23:40:30 +08:00
|
|
|
new_channel = channel_copy (gimp_image_get_mask (gimage));
|
1999-03-14 02:55:04 +08:00
|
|
|
channel_combine_mask (new_channel,
|
|
|
|
active_channel,
|
2000-12-29 23:22:01 +08:00
|
|
|
CHANNEL_OP_SUB,
|
1999-03-14 02:55:04 +08:00
|
|
|
0, 0); /* off x/y */
|
|
|
|
gimage_mask_load (gimage, new_channel);
|
|
|
|
channel_delete (new_channel);
|
|
|
|
gdisplays_flush ();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1999-06-07 01:26:51 +08:00
|
|
|
void
|
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
|
|
|
channels_dialog_intersect_channel_with_sel_callback (GtkWidget *widget,
|
1999-08-21 03:59:06 +08:00
|
|
|
gpointer data)
|
1999-06-03 22:55:43 +08:00
|
|
|
{
|
2000-04-03 23:40:30 +08:00
|
|
|
GimpImage *gimage;
|
1999-06-03 22:55:43 +08:00
|
|
|
Channel *active_channel;
|
|
|
|
Channel *new_channel;
|
|
|
|
|
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
|
|
|
if (!channelsD || !(gimage = channelsD->gimage))
|
1999-06-03 22:55:43 +08:00
|
|
|
return;
|
|
|
|
|
2000-04-03 23:40:30 +08:00
|
|
|
if ((active_channel = gimp_image_get_active_channel (gimage)))
|
1999-06-03 22:55:43 +08:00
|
|
|
{
|
2000-04-03 23:40:30 +08:00
|
|
|
new_channel = channel_copy (gimp_image_get_mask (gimage));
|
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
|
|
|
channel_combine_mask (new_channel,
|
|
|
|
active_channel,
|
2000-12-29 23:22:01 +08:00
|
|
|
CHANNEL_OP_INTERSECT,
|
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
|
|
|
0, 0); /* off x/y */
|
1999-06-03 22:55:43 +08:00
|
|
|
gimage_mask_load (gimage, new_channel);
|
|
|
|
channel_delete (new_channel);
|
|
|
|
gdisplays_flush ();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-02-01 06:59:22 +08:00
|
|
|
void
|
|
|
|
channels_dialog_edit_channel_attributes_callback (GtkWidget *widget,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
if (channelsD && channelsD->active_channel)
|
|
|
|
{
|
|
|
|
ChannelWidget *channel_widget;
|
|
|
|
|
|
|
|
channel_widget = channel_widget_get_ID (channelsD->active_channel);
|
|
|
|
|
|
|
|
channels_dialog_edit_channel_query (channel_widget);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1999-08-21 03:59:06 +08:00
|
|
|
/*******************************/
|
|
|
|
/* ops buttons dnd callbacks */
|
|
|
|
/*******************************/
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
channels_dialog_drag_new_channel_callback (GtkWidget *widget,
|
|
|
|
GdkDragContext *context,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
guint time)
|
|
|
|
{
|
1999-08-22 19:45:31 +08:00
|
|
|
GtkWidget *src_widget;
|
1999-08-21 03:59:06 +08:00
|
|
|
gboolean return_val = FALSE;
|
|
|
|
|
|
|
|
if ((src_widget = gtk_drag_get_source_widget (context)))
|
|
|
|
{
|
1999-08-22 19:45:31 +08:00
|
|
|
ChannelWidget *src;
|
|
|
|
|
1999-08-21 03:59:06 +08:00
|
|
|
src
|
|
|
|
= (ChannelWidget *) gtk_object_get_user_data (GTK_OBJECT (src_widget));
|
|
|
|
|
|
|
|
if (src &&
|
|
|
|
src->channel == channelsD->active_channel)
|
|
|
|
{
|
2000-04-03 23:40:30 +08:00
|
|
|
Channel *channel;
|
|
|
|
GimpImage *gimage;
|
|
|
|
gint width, height;
|
|
|
|
gint off_x, off_y;
|
1999-08-21 03:59:06 +08:00
|
|
|
|
|
|
|
gimage = channelsD->gimage;
|
|
|
|
|
|
|
|
width = gimp_drawable_width (GIMP_DRAWABLE (src->channel));
|
|
|
|
height = gimp_drawable_height (GIMP_DRAWABLE (src->channel));
|
|
|
|
gimp_drawable_offsets (GIMP_DRAWABLE (src->channel), &off_x, &off_y);
|
|
|
|
|
|
|
|
/* Start a group undo */
|
|
|
|
undo_push_group_start (gimage, EDIT_PASTE_UNDO);
|
|
|
|
|
|
|
|
channel = channel_new (gimage, width, height,
|
|
|
|
_("Empty Channel Copy"),
|
2001-01-15 12:37:01 +08:00
|
|
|
&src->channel->color);
|
1999-08-21 03:59:06 +08:00
|
|
|
if (channel)
|
|
|
|
{
|
|
|
|
drawable_fill (GIMP_DRAWABLE (channel), TRANSPARENT_FILL);
|
|
|
|
channel_translate (channel, off_x, off_y);
|
2000-04-03 23:40:30 +08:00
|
|
|
gimp_image_add_channel (gimage, channel, -1);
|
1999-08-21 03:59:06 +08:00
|
|
|
|
|
|
|
/* End the group undo */
|
|
|
|
undo_push_group_end (gimage);
|
|
|
|
|
|
|
|
gdisplays_flush ();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
1999-09-23 19:49:16 +08:00
|
|
|
g_message ("channels_dialog_drop_new_channel_callback():\n"
|
1999-10-16 17:50:55 +08:00
|
|
|
"could not allocate new channel");
|
1999-08-21 03:59:06 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
return_val = TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
gtk_drag_finish (context, return_val, FALSE, time);
|
|
|
|
|
|
|
|
return return_val;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
channels_dialog_drag_duplicate_channel_callback (GtkWidget *widget,
|
|
|
|
GdkDragContext *context,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
guint time)
|
|
|
|
{
|
1999-08-22 19:45:31 +08:00
|
|
|
GtkWidget *src_widget;
|
1999-08-21 03:59:06 +08:00
|
|
|
gboolean return_val = FALSE;
|
|
|
|
|
|
|
|
if ((src_widget = gtk_drag_get_source_widget (context)))
|
|
|
|
{
|
1999-08-22 19:45:31 +08:00
|
|
|
ChannelWidget *src;
|
|
|
|
|
1999-08-21 03:59:06 +08:00
|
|
|
src
|
|
|
|
= (ChannelWidget *) gtk_object_get_user_data (GTK_OBJECT (src_widget));
|
|
|
|
|
|
|
|
if (src &&
|
|
|
|
src->channel == channelsD->active_channel)
|
|
|
|
{
|
|
|
|
channels_dialog_duplicate_channel_callback (widget, NULL);
|
|
|
|
|
|
|
|
return_val = TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
gtk_drag_finish (context, return_val, FALSE, time);
|
|
|
|
|
|
|
|
return return_val;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
channels_dialog_drag_channel_to_sel_callback (GtkWidget *widget,
|
|
|
|
GdkDragContext *context,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
guint time)
|
|
|
|
{
|
1999-08-22 19:45:31 +08:00
|
|
|
GtkWidget *src_widget;
|
1999-08-21 03:59:06 +08:00
|
|
|
gboolean return_val = FALSE;
|
|
|
|
|
|
|
|
if ((src_widget = gtk_drag_get_source_widget (context)))
|
|
|
|
{
|
1999-08-22 19:45:31 +08:00
|
|
|
ChannelWidget *src;
|
|
|
|
|
1999-08-21 03:59:06 +08:00
|
|
|
src
|
|
|
|
= (ChannelWidget *) gtk_object_get_user_data (GTK_OBJECT (src_widget));
|
|
|
|
|
|
|
|
if (src &&
|
|
|
|
src->channel == channelsD->active_channel)
|
|
|
|
{
|
|
|
|
channels_dialog_channel_to_sel_callback (widget, NULL);
|
|
|
|
|
|
|
|
return_val = TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
gtk_drag_finish (context, return_val, FALSE, time);
|
|
|
|
|
|
|
|
return return_val;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
channels_dialog_drag_delete_channel_callback (GtkWidget *widget,
|
|
|
|
GdkDragContext *context,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
guint time)
|
|
|
|
{
|
1999-08-22 19:45:31 +08:00
|
|
|
GtkWidget *src_widget;
|
1999-08-21 03:59:06 +08:00
|
|
|
gboolean return_val = FALSE;
|
|
|
|
|
|
|
|
if ((src_widget = gtk_drag_get_source_widget (context)))
|
|
|
|
{
|
1999-08-22 19:45:31 +08:00
|
|
|
ChannelWidget *src;
|
|
|
|
|
1999-08-21 03:59:06 +08:00
|
|
|
src
|
|
|
|
= (ChannelWidget *) gtk_object_get_user_data (GTK_OBJECT (src_widget));
|
|
|
|
|
|
|
|
if (src &&
|
|
|
|
src->channel == channelsD->active_channel)
|
|
|
|
{
|
|
|
|
channels_dialog_delete_channel_callback (widget, NULL);
|
|
|
|
|
|
|
|
return_val = TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
gtk_drag_finish (context, return_val, FALSE, time);
|
|
|
|
|
|
|
|
return return_val;
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************/
|
1997-11-25 06:05:25 +08:00
|
|
|
/* channel widget functions */
|
1999-08-21 03:59:06 +08:00
|
|
|
/******************************/
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
static ChannelWidget *
|
1998-01-22 15:02:57 +08:00
|
|
|
channel_widget_get_ID (Channel *channel)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
ChannelWidget *lw;
|
1998-01-29 16:03:27 +08:00
|
|
|
GSList *list;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
if (!channelsD)
|
|
|
|
return NULL;
|
|
|
|
|
2000-04-03 23:40:30 +08:00
|
|
|
for (list = channelsD->channel_widgets; list; list = g_slist_next (list))
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
lw = (ChannelWidget *) list->data;
|
2000-04-03 23:40:30 +08:00
|
|
|
|
1998-01-22 15:02:57 +08:00
|
|
|
if (lw->channel == channel)
|
1997-11-25 06:05:25 +08:00
|
|
|
return lw;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ChannelWidget *
|
2000-04-03 23:40:30 +08:00
|
|
|
channel_widget_create (GimpImage *gimage,
|
1997-11-25 06:05:25 +08:00
|
|
|
Channel *channel,
|
|
|
|
ChannelType type)
|
|
|
|
{
|
|
|
|
ChannelWidget *channel_widget;
|
|
|
|
GtkWidget *list_item;
|
|
|
|
GtkWidget *hbox;
|
|
|
|
GtkWidget *vbox;
|
|
|
|
GtkWidget *alignment;
|
|
|
|
|
|
|
|
list_item = gtk_list_item_new ();
|
|
|
|
|
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
|
|
|
/* Create the channel widget and add it to the list */
|
|
|
|
channel_widget = g_new (ChannelWidget, 1);
|
|
|
|
channel_widget->gimage = gimage;
|
|
|
|
channel_widget->channel = channel;
|
1997-11-25 06:05:25 +08:00
|
|
|
channel_widget->channel_preview = NULL;
|
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
|
|
|
channel_widget->channel_pixmap = NULL;
|
|
|
|
channel_widget->type = type;
|
|
|
|
channel_widget->ID = ((type == AUXILLARY_CHANNEL) ?
|
1999-08-23 22:19:26 +08:00
|
|
|
GIMP_DRAWABLE (channel)->ID :
|
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
|
|
|
(COMPONENT_BASE_ID + type));
|
|
|
|
channel_widget->list_item = list_item;
|
|
|
|
channel_widget->width = -1;
|
|
|
|
channel_widget->height = -1;
|
|
|
|
channel_widget->visited = TRUE;
|
1999-08-21 03:59:06 +08:00
|
|
|
channel_widget->drop_type = GIMP_DROP_NONE;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* Need to let the list item know about the channel_widget */
|
|
|
|
gtk_object_set_user_data (GTK_OBJECT (list_item), channel_widget);
|
|
|
|
|
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
|
|
|
/* Set up the list item observer */
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_signal_connect (GTK_OBJECT (list_item), "select",
|
2000-04-03 23:40:30 +08:00
|
|
|
GTK_SIGNAL_FUNC (channel_widget_select_update),
|
1997-11-25 06:05:25 +08:00
|
|
|
channel_widget);
|
|
|
|
gtk_signal_connect (GTK_OBJECT (list_item), "deselect",
|
2000-04-03 23:40:30 +08:00
|
|
|
GTK_SIGNAL_FUNC (channel_widget_select_update),
|
1997-11-25 06:05:25 +08:00
|
|
|
channel_widget);
|
|
|
|
|
|
|
|
vbox = gtk_vbox_new (FALSE, 1);
|
|
|
|
gtk_container_add (GTK_CONTAINER (list_item), vbox);
|
|
|
|
|
|
|
|
hbox = gtk_hbox_new (FALSE, 1);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 1);
|
|
|
|
|
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
|
|
|
/* Create the visibility toggle button */
|
1997-11-25 06:05:25 +08:00
|
|
|
alignment = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), alignment, FALSE, TRUE, 2);
|
|
|
|
channel_widget->eye_widget = gtk_drawing_area_new ();
|
1999-08-21 03:59:06 +08:00
|
|
|
gtk_drawing_area_size (GTK_DRAWING_AREA (channel_widget->eye_widget),
|
|
|
|
eye_width, eye_height);
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_widget_set_events (channel_widget->eye_widget, BUTTON_EVENT_MASK);
|
|
|
|
gtk_signal_connect (GTK_OBJECT (channel_widget->eye_widget), "event",
|
2000-04-03 23:40:30 +08:00
|
|
|
GTK_SIGNAL_FUNC (channel_widget_button_events),
|
1997-11-25 06:05:25 +08:00
|
|
|
channel_widget);
|
1999-10-16 17:50:55 +08:00
|
|
|
gtk_object_set_user_data (GTK_OBJECT (channel_widget->eye_widget),
|
|
|
|
channel_widget);
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_container_add (GTK_CONTAINER (alignment), channel_widget->eye_widget);
|
|
|
|
gtk_widget_show (channel_widget->eye_widget);
|
|
|
|
gtk_widget_show (alignment);
|
|
|
|
|
2000-04-03 23:40:30 +08:00
|
|
|
/* The channel preview */
|
1997-11-25 06:05:25 +08:00
|
|
|
alignment = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), alignment, FALSE, FALSE, 2);
|
|
|
|
gtk_widget_show (alignment);
|
|
|
|
|
|
|
|
channel_widget->channel_preview = gtk_drawing_area_new ();
|
|
|
|
gtk_drawing_area_size (GTK_DRAWING_AREA (channel_widget->channel_preview),
|
|
|
|
channelsD->image_width, channelsD->image_height);
|
|
|
|
gtk_widget_set_events (channel_widget->channel_preview, PREVIEW_EVENT_MASK);
|
|
|
|
gtk_signal_connect (GTK_OBJECT (channel_widget->channel_preview), "event",
|
2000-04-03 23:40:30 +08:00
|
|
|
GTK_SIGNAL_FUNC (channel_widget_preview_events),
|
1997-11-25 06:05:25 +08:00
|
|
|
channel_widget);
|
1999-10-16 17:50:55 +08:00
|
|
|
gtk_object_set_user_data (GTK_OBJECT (channel_widget->channel_preview),
|
|
|
|
channel_widget);
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_container_add (GTK_CONTAINER (alignment), channel_widget->channel_preview);
|
|
|
|
gtk_widget_show (channel_widget->channel_preview);
|
|
|
|
|
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
|
|
|
/* The channel name label */
|
1997-11-25 06:05:25 +08:00
|
|
|
switch (channel_widget->type)
|
|
|
|
{
|
1999-04-27 12:57:59 +08:00
|
|
|
case RED_CHANNEL:
|
|
|
|
channel_widget->label = gtk_label_new (_("Red"));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GREEN_CHANNEL:
|
|
|
|
channel_widget->label = gtk_label_new (_("Green"));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BLUE_CHANNEL:
|
|
|
|
channel_widget->label = gtk_label_new (_("Blue"));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GRAY_CHANNEL:
|
|
|
|
channel_widget->label = gtk_label_new (_("Gray"));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case INDEXED_CHANNEL:
|
|
|
|
channel_widget->label = gtk_label_new (_("Indexed"));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case AUXILLARY_CHANNEL:
|
2000-12-29 00:19:55 +08:00
|
|
|
channel_widget->label =
|
2001-01-10 11:13:03 +08:00
|
|
|
gtk_label_new (gimp_object_get_name (GIMP_OBJECT (channel)));
|
1999-04-27 12:57:59 +08:00
|
|
|
break;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), channel_widget->label, FALSE, FALSE, 2);
|
|
|
|
gtk_widget_show (channel_widget->label);
|
|
|
|
|
1999-08-21 03:59:06 +08:00
|
|
|
if (channel_widget->type == AUXILLARY_CHANNEL)
|
|
|
|
{
|
|
|
|
/* dnd destination */
|
|
|
|
gtk_drag_dest_set (list_item,
|
|
|
|
GTK_DEST_DEFAULT_ALL,
|
1999-08-23 22:19:26 +08:00
|
|
|
channel_color_target_table, n_channel_color_targets,
|
|
|
|
GDK_ACTION_MOVE | GDK_ACTION_COPY);
|
|
|
|
gimp_dnd_color_dest_set (list_item,
|
1999-08-24 08:36:57 +08:00
|
|
|
channel_widget_drop_color,
|
1999-08-23 22:19:26 +08:00
|
|
|
(gpointer) channel_widget);
|
1999-08-21 03:59:06 +08:00
|
|
|
|
|
|
|
gtk_signal_connect (GTK_OBJECT (list_item), "drag_leave",
|
|
|
|
GTK_SIGNAL_FUNC (channel_widget_drag_leave_callback),
|
|
|
|
NULL);
|
|
|
|
gtk_signal_connect (GTK_OBJECT (list_item), "drag_motion",
|
|
|
|
GTK_SIGNAL_FUNC (channel_widget_drag_motion_callback),
|
|
|
|
NULL);
|
|
|
|
gtk_signal_connect (GTK_OBJECT (list_item), "drag_drop",
|
|
|
|
GTK_SIGNAL_FUNC (channel_widget_drag_drop_callback),
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
/* re-paint the drop indicator after drawing the widget */
|
|
|
|
gtk_signal_connect_after (GTK_OBJECT (list_item), "draw",
|
|
|
|
GTK_SIGNAL_FUNC (channel_widget_drag_indicator_callback),
|
|
|
|
channel_widget);
|
|
|
|
|
|
|
|
/* dnd source */
|
|
|
|
gtk_drag_source_set (list_item,
|
1999-11-03 17:58:46 +08:00
|
|
|
GDK_BUTTON1_MASK | GDK_BUTTON2_MASK,
|
1999-08-21 03:59:06 +08:00
|
|
|
channel_target_table, n_channel_targets,
|
|
|
|
GDK_ACTION_MOVE | GDK_ACTION_COPY);
|
|
|
|
|
|
|
|
gtk_signal_connect (GTK_OBJECT (list_item), "drag_begin",
|
|
|
|
GTK_SIGNAL_FUNC (channel_widget_drag_begin_callback),
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
gtk_object_set_data (GTK_OBJECT (list_item), "gimp_channel",
|
|
|
|
(gpointer) channel);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* dnd source */
|
|
|
|
gtk_drag_source_set (list_item,
|
1999-11-03 17:58:46 +08:00
|
|
|
GDK_BUTTON1_MASK | GDK_BUTTON2_MASK,
|
1999-08-21 03:59:06 +08:00
|
|
|
component_target_table, n_component_targets,
|
|
|
|
GDK_ACTION_MOVE | GDK_ACTION_COPY);
|
|
|
|
|
|
|
|
gtk_object_set_data (GTK_OBJECT (list_item), "gimp_component",
|
|
|
|
(gpointer) gimage);
|
|
|
|
gtk_object_set_data (GTK_OBJECT (list_item), "gimp_component_type",
|
|
|
|
(gpointer) channel_widget->type);
|
|
|
|
}
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_widget_show (hbox);
|
|
|
|
gtk_widget_show (vbox);
|
|
|
|
gtk_widget_show (list_item);
|
|
|
|
|
1998-05-01 21:18:28 +08:00
|
|
|
gtk_widget_ref (channel_widget->list_item);
|
1998-03-14 01:46:40 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
return channel_widget;
|
|
|
|
}
|
|
|
|
|
1999-08-21 03:59:06 +08:00
|
|
|
static gboolean
|
|
|
|
channel_widget_drag_motion_callback (GtkWidget *widget,
|
|
|
|
GdkDragContext *context,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
guint time)
|
|
|
|
{
|
|
|
|
ChannelWidget *dest;
|
|
|
|
gint dest_index;
|
|
|
|
GtkWidget *src_widget;
|
2000-02-14 06:26:41 +08:00
|
|
|
ChannelWidget *src = NULL;
|
1999-08-21 03:59:06 +08:00
|
|
|
gint src_index;
|
|
|
|
gint difference;
|
|
|
|
|
|
|
|
GimpDropType drop_type = GIMP_DROP_NONE;
|
|
|
|
GdkDragAction drag_action = GDK_ACTION_DEFAULT;
|
|
|
|
gboolean return_val = FALSE;
|
|
|
|
|
|
|
|
dest = (ChannelWidget *) gtk_object_get_user_data (GTK_OBJECT (widget));
|
|
|
|
|
2000-02-14 06:26:41 +08:00
|
|
|
if (dest)
|
1999-08-21 03:59:06 +08:00
|
|
|
{
|
2000-02-14 06:26:41 +08:00
|
|
|
src_widget = gtk_drag_get_source_widget (context);
|
1999-08-21 03:59:06 +08:00
|
|
|
|
2000-02-14 06:26:41 +08:00
|
|
|
if (src_widget)
|
|
|
|
{
|
|
|
|
src = (ChannelWidget *)
|
|
|
|
gtk_object_get_user_data (GTK_OBJECT (src_widget));
|
1999-08-21 03:59:06 +08:00
|
|
|
|
2000-02-14 06:26:41 +08:00
|
|
|
if (src &&
|
|
|
|
src->channel == channelsD->active_channel)
|
|
|
|
{
|
2000-04-03 23:40:30 +08:00
|
|
|
src_index = gimp_image_get_channel_index (channelsD->gimage,
|
|
|
|
src->channel);
|
|
|
|
dest_index = gimp_image_get_channel_index (channelsD->gimage,
|
|
|
|
dest->channel);
|
2000-02-14 06:26:41 +08:00
|
|
|
|
|
|
|
difference = dest_index - src_index;
|
|
|
|
|
|
|
|
drop_type = ((y < widget->allocation.height / 2) ?
|
|
|
|
GIMP_DROP_ABOVE : GIMP_DROP_BELOW);
|
|
|
|
|
|
|
|
if (difference < 0 &&
|
|
|
|
drop_type == GIMP_DROP_BELOW)
|
|
|
|
{
|
|
|
|
dest_index++;
|
|
|
|
}
|
|
|
|
else if (difference > 0 &&
|
|
|
|
drop_type == GIMP_DROP_ABOVE)
|
|
|
|
{
|
|
|
|
dest_index--;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (src_index != dest_index)
|
|
|
|
{
|
|
|
|
drag_action = GDK_ACTION_MOVE;
|
|
|
|
return_val = TRUE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
drop_type = GIMP_DROP_NONE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
1999-08-21 03:59:06 +08:00
|
|
|
|
2000-02-14 06:26:41 +08:00
|
|
|
if (!src)
|
1999-08-23 22:19:26 +08:00
|
|
|
{
|
|
|
|
drag_action = GDK_ACTION_COPY;
|
|
|
|
return_val = TRUE;
|
|
|
|
drop_type = GIMP_DROP_NONE;
|
|
|
|
}
|
1999-08-21 03:59:06 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
gdk_drag_status (context, drag_action, time);
|
|
|
|
|
2000-04-03 20:39:14 +08:00
|
|
|
if (dest && drop_type != dest->drop_type)
|
1999-08-21 03:59:06 +08:00
|
|
|
{
|
|
|
|
channel_widget_draw_drop_indicator (dest, dest->drop_type);
|
|
|
|
channel_widget_draw_drop_indicator (dest, drop_type);
|
|
|
|
dest->drop_type = drop_type;
|
|
|
|
}
|
|
|
|
|
|
|
|
return return_val;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
channel_widget_drag_begin_callback (GtkWidget *widget,
|
|
|
|
GdkDragContext *context)
|
|
|
|
{
|
|
|
|
ChannelWidget *channel_widget;
|
|
|
|
|
|
|
|
channel_widget =
|
|
|
|
(ChannelWidget *) gtk_object_get_user_data (GTK_OBJECT (widget));
|
|
|
|
|
|
|
|
gimp_dnd_set_drawable_preview_icon (widget, context,
|
2000-04-03 09:11:03 +08:00
|
|
|
GIMP_DRAWABLE (channel_widget->channel));
|
1999-08-21 03:59:06 +08:00
|
|
|
}
|
|
|
|
|
2000-04-03 20:39:14 +08:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
GimpImage *gimage;
|
|
|
|
Channel *channel;
|
|
|
|
gint dest_index;
|
|
|
|
} ChannelDrop;
|
|
|
|
|
|
|
|
static gint
|
|
|
|
channel_widget_idle_drop_channel (gpointer data)
|
|
|
|
{
|
|
|
|
ChannelDrop *cd;
|
|
|
|
|
|
|
|
cd = (ChannelDrop *) data;
|
|
|
|
|
|
|
|
gimp_image_position_channel (cd->gimage, cd->channel, cd->dest_index);
|
|
|
|
gdisplays_flush ();
|
|
|
|
|
|
|
|
g_free (cd);
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
1999-08-21 03:59:06 +08:00
|
|
|
static gboolean
|
|
|
|
channel_widget_drag_drop_callback (GtkWidget *widget,
|
|
|
|
GdkDragContext *context,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
guint time)
|
|
|
|
{
|
|
|
|
ChannelWidget *dest;
|
|
|
|
gint dest_index;
|
|
|
|
GtkWidget *src_widget;
|
|
|
|
ChannelWidget *src;
|
|
|
|
gint src_index;
|
|
|
|
gint difference;
|
|
|
|
|
2000-02-13 22:23:47 +08:00
|
|
|
GimpDropType drop_type = GIMP_DROP_NONE;
|
|
|
|
gboolean return_val = FALSE;
|
1999-08-21 03:59:06 +08:00
|
|
|
|
|
|
|
dest = (ChannelWidget *) gtk_object_get_user_data (GTK_OBJECT (widget));
|
|
|
|
|
|
|
|
if (dest &&
|
|
|
|
(src_widget = gtk_drag_get_source_widget (context)))
|
|
|
|
{
|
2000-02-13 22:23:47 +08:00
|
|
|
src = (ChannelWidget *) gtk_object_get_user_data (GTK_OBJECT (src_widget));
|
1999-08-21 03:59:06 +08:00
|
|
|
|
|
|
|
if (src &&
|
|
|
|
src->channel == channelsD->active_channel)
|
|
|
|
{
|
2000-04-03 23:40:30 +08:00
|
|
|
src_index = gimp_image_get_channel_index (channelsD->gimage,
|
|
|
|
src->channel);
|
|
|
|
dest_index = gimp_image_get_channel_index (channelsD->gimage,
|
|
|
|
dest->channel);
|
1999-08-21 03:59:06 +08:00
|
|
|
|
|
|
|
difference = dest_index - src_index;
|
|
|
|
|
|
|
|
drop_type = ((y < widget->allocation.height / 2) ?
|
|
|
|
GIMP_DROP_ABOVE : GIMP_DROP_BELOW);
|
|
|
|
|
|
|
|
if (difference < 0 &&
|
|
|
|
drop_type == GIMP_DROP_BELOW)
|
|
|
|
{
|
|
|
|
dest_index++;
|
|
|
|
}
|
|
|
|
else if (difference > 0 &&
|
|
|
|
drop_type == GIMP_DROP_ABOVE)
|
|
|
|
{
|
|
|
|
dest_index--;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (src_index != dest_index)
|
|
|
|
{
|
2000-04-03 20:39:14 +08:00
|
|
|
ChannelDrop *cd;
|
|
|
|
|
|
|
|
cd = g_new (ChannelDrop, 1);
|
|
|
|
cd->gimage = channelsD->gimage;
|
|
|
|
cd->channel = src->channel;
|
|
|
|
cd->dest_index = dest_index;
|
1999-08-21 03:59:06 +08:00
|
|
|
|
2000-04-03 20:39:14 +08:00
|
|
|
/* let dnd finish it's work before changing the widget tree */
|
|
|
|
gtk_idle_add ((GtkFunction) channel_widget_idle_drop_channel, cd);
|
1999-08-21 03:59:06 +08:00
|
|
|
return_val = TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-04-03 20:39:14 +08:00
|
|
|
if (dest)
|
|
|
|
{
|
|
|
|
if (!return_val)
|
|
|
|
channel_widget_draw_drop_indicator (dest, dest->drop_type);
|
|
|
|
|
|
|
|
dest->drop_type = GIMP_DROP_NONE;
|
|
|
|
}
|
1999-08-21 03:59:06 +08:00
|
|
|
|
|
|
|
gtk_drag_finish (context, return_val, FALSE, time);
|
|
|
|
|
|
|
|
return return_val;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
channel_widget_drag_leave_callback (GtkWidget *widget,
|
|
|
|
GdkDragContext *context,
|
|
|
|
guint time)
|
|
|
|
{
|
|
|
|
ChannelWidget *channel_widget;
|
|
|
|
|
|
|
|
channel_widget =
|
|
|
|
(ChannelWidget *) gtk_object_get_user_data (GTK_OBJECT (widget));
|
|
|
|
|
|
|
|
channel_widget->drop_type = GIMP_DROP_NONE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
channel_widget_drag_indicator_callback (GtkWidget *widget,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
ChannelWidget *channel_widget;
|
|
|
|
|
|
|
|
channel_widget =
|
|
|
|
(ChannelWidget *) gtk_object_get_user_data (GTK_OBJECT (widget));
|
|
|
|
|
|
|
|
channel_widget_draw_drop_indicator (channel_widget, channel_widget->drop_type);
|
|
|
|
}
|
|
|
|
|
1999-08-23 22:19:26 +08:00
|
|
|
static void
|
2001-01-20 23:37:26 +08:00
|
|
|
channel_widget_drop_color (GtkWidget *widget,
|
|
|
|
const GimpRGB *color,
|
|
|
|
gpointer data)
|
1999-08-23 22:19:26 +08:00
|
|
|
{
|
2001-01-15 09:48:53 +08:00
|
|
|
ChannelWidget *channel_widget;
|
|
|
|
Channel *channel;
|
|
|
|
|
|
|
|
channel_widget = (ChannelWidget *) data;
|
|
|
|
channel = channel_widget->channel;
|
|
|
|
|
2001-01-15 12:37:01 +08:00
|
|
|
if (gimp_rgba_distance (color, &channel->color) > 0.0001)
|
1999-08-23 22:19:26 +08:00
|
|
|
{
|
2001-01-15 12:37:01 +08:00
|
|
|
channel->color = *color;
|
1999-08-23 22:19:26 +08:00
|
|
|
|
|
|
|
drawable_update (GIMP_DRAWABLE (channel), 0, 0,
|
|
|
|
GIMP_DRAWABLE (channel)->width,
|
|
|
|
GIMP_DRAWABLE (channel)->height);
|
|
|
|
gdisplays_flush ();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1999-08-21 03:59:06 +08:00
|
|
|
static void
|
|
|
|
channel_widget_draw_drop_indicator (ChannelWidget *channel_widget,
|
|
|
|
GimpDropType drop_type)
|
|
|
|
{
|
|
|
|
static GdkGC *gc = NULL;
|
2001-01-08 05:07:14 +08:00
|
|
|
gint y = 0;
|
1999-08-21 03:59:06 +08:00
|
|
|
|
|
|
|
if (!gc)
|
|
|
|
{
|
|
|
|
GdkColor fg, bg;
|
|
|
|
|
|
|
|
gc = gdk_gc_new (channel_widget->list_item->window);
|
|
|
|
|
|
|
|
fg.pixel = 0xFFFFFFFF;
|
|
|
|
bg.pixel = 0x00000000;
|
|
|
|
|
|
|
|
gdk_gc_set_function (gc, GDK_INVERT);
|
|
|
|
gdk_gc_set_foreground (gc, &fg);
|
|
|
|
gdk_gc_set_background (gc, &bg);
|
|
|
|
gdk_gc_set_line_attributes (gc, 5, GDK_LINE_SOLID,
|
|
|
|
GDK_CAP_BUTT, GDK_JOIN_MITER);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (drop_type != GIMP_DROP_NONE)
|
|
|
|
{
|
|
|
|
y = ((drop_type == GIMP_DROP_ABOVE) ?
|
|
|
|
3 : channel_widget->list_item->allocation.height - 4);
|
|
|
|
|
|
|
|
gdk_draw_line (channel_widget->list_item->window, gc,
|
|
|
|
2, y, channel_widget->list_item->allocation.width - 3, y);
|
|
|
|
}
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
static void
|
|
|
|
channel_widget_delete (ChannelWidget *channel_widget)
|
|
|
|
{
|
|
|
|
if (channel_widget->channel_pixmap)
|
1997-12-18 14:30:11 +08:00
|
|
|
gdk_pixmap_unref (channel_widget->channel_pixmap);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* Remove the channel widget from the list */
|
1999-10-16 17:50:55 +08:00
|
|
|
channelsD->channel_widgets = g_slist_remove (channelsD->channel_widgets,
|
|
|
|
channel_widget);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1998-05-01 21:18:28 +08:00
|
|
|
/* Release the widget */
|
1998-03-14 01:46:40 +08:00
|
|
|
gtk_widget_unref (channel_widget->list_item);
|
1997-11-25 06:05:25 +08:00
|
|
|
g_free (channel_widget);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
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
|
|
|
channel_widget_select_update (GtkWidget *widget,
|
1997-11-25 06:05:25 +08:00
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
ChannelWidget *channel_widget;
|
|
|
|
|
|
|
|
if ((channel_widget = (ChannelWidget *) data) == NULL)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (suspend_gimage_notify == 0)
|
|
|
|
{
|
1999-04-27 12:57:59 +08:00
|
|
|
if (channel_widget->type == AUXILLARY_CHANNEL)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
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
|
|
|
if (widget->state == GTK_STATE_SELECTED)
|
1997-11-25 06:05:25 +08:00
|
|
|
/* set the gimage's active channel to be this channel */
|
2000-04-03 23:40:30 +08:00
|
|
|
gimp_image_set_active_channel (channel_widget->gimage,
|
|
|
|
channel_widget->channel);
|
1997-11-25 06:05:25 +08:00
|
|
|
else
|
|
|
|
/* unset the gimage's active channel */
|
2000-04-03 23:40:30 +08:00
|
|
|
gimp_image_unset_active_channel (channel_widget->gimage);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
gdisplays_flush ();
|
|
|
|
}
|
1999-04-27 12:57:59 +08:00
|
|
|
else if (channel_widget->type != AUXILLARY_CHANNEL)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
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
|
|
|
if (widget->state == GTK_STATE_SELECTED)
|
2000-04-03 23:40:30 +08:00
|
|
|
gimp_image_set_component_active (channel_widget->gimage,
|
|
|
|
channel_widget->type, TRUE);
|
1997-11-25 06:05:25 +08:00
|
|
|
else
|
2000-04-03 23:40:30 +08:00
|
|
|
gimp_image_set_component_active (channel_widget->gimage,
|
|
|
|
channel_widget->type, FALSE);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
channel_widget_button_events (GtkWidget *widget,
|
2000-04-03 23:40:30 +08:00
|
|
|
GdkEvent *event,
|
|
|
|
gpointer data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
1999-08-23 22:19:26 +08:00
|
|
|
ChannelWidget *channel_widget;
|
|
|
|
GtkWidget *event_widget;
|
1998-04-30 14:09:55 +08:00
|
|
|
GdkEventButton *bevent;
|
2001-01-08 05:07:14 +08:00
|
|
|
gint return_val;
|
|
|
|
gint visible;
|
|
|
|
gint width, height;
|
1999-08-23 22:19:26 +08:00
|
|
|
|
2001-01-08 05:07:14 +08:00
|
|
|
static gboolean button_down = FALSE;
|
1999-08-23 22:19:26 +08:00
|
|
|
static GtkWidget *click_widget = NULL;
|
2001-01-08 05:07:14 +08:00
|
|
|
static gint old_state;
|
|
|
|
static gint exclusive;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-04-03 23:40:30 +08:00
|
|
|
channel_widget =
|
|
|
|
(ChannelWidget *) gtk_object_get_user_data (GTK_OBJECT (widget));
|
|
|
|
return_val = FALSE;
|
1999-08-21 03:59:06 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
switch (channel_widget->type)
|
|
|
|
{
|
1999-04-27 12:57:59 +08:00
|
|
|
case AUXILLARY_CHANNEL:
|
1999-08-21 03:59:06 +08:00
|
|
|
visible = GIMP_DRAWABLE (channel_widget->channel)->visible;
|
|
|
|
width = GIMP_DRAWABLE (channel_widget->channel)->width;
|
|
|
|
height = GIMP_DRAWABLE (channel_widget->channel)->height;
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
|
|
|
default:
|
2000-04-03 23:40:30 +08:00
|
|
|
visible = gimp_image_get_component_visible (channel_widget->gimage,
|
|
|
|
channel_widget->type);
|
1999-08-21 03:59:06 +08:00
|
|
|
width = channel_widget->gimage->width;
|
|
|
|
height = channel_widget->gimage->height;
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (event->type)
|
|
|
|
{
|
|
|
|
case GDK_EXPOSE:
|
|
|
|
if (widget == channel_widget->eye_widget)
|
|
|
|
channel_widget_eye_redraw (channel_widget);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GDK_BUTTON_PRESS:
|
|
|
|
return_val = TRUE;
|
1998-04-30 14:09:55 +08:00
|
|
|
bevent = (GdkEventButton *) event;
|
|
|
|
|
1999-06-07 01:26:51 +08:00
|
|
|
if (bevent->button == 3)
|
|
|
|
{
|
|
|
|
gtk_menu_popup (GTK_MENU (channelsD->ops_menu),
|
|
|
|
NULL, NULL, NULL, NULL,
|
|
|
|
3, bevent->time);
|
|
|
|
return TRUE;
|
|
|
|
}
|
1998-04-30 14:09:55 +08:00
|
|
|
|
1999-08-23 22:19:26 +08:00
|
|
|
button_down = TRUE;
|
1997-11-25 06:05:25 +08:00
|
|
|
click_widget = widget;
|
|
|
|
gtk_grab_add (click_widget);
|
|
|
|
|
|
|
|
if (widget == channel_widget->eye_widget)
|
|
|
|
{
|
|
|
|
old_state = visible;
|
|
|
|
|
|
|
|
/* If this was a shift-click, make all/none visible */
|
|
|
|
if (event->button.state & GDK_SHIFT_MASK)
|
|
|
|
{
|
|
|
|
exclusive = TRUE;
|
|
|
|
channel_widget_exclusive_visible (channel_widget);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
exclusive = FALSE;
|
1999-04-27 12:57:59 +08:00
|
|
|
if (channel_widget->type == AUXILLARY_CHANNEL)
|
1999-08-23 22:19:26 +08:00
|
|
|
GIMP_DRAWABLE (channel_widget->channel)->visible = !visible;
|
1997-11-25 06:05:25 +08:00
|
|
|
else
|
2000-04-03 23:40:30 +08:00
|
|
|
gimp_image_set_component_visible (channel_widget->gimage,
|
|
|
|
channel_widget->type,
|
|
|
|
!visible);
|
1997-11-25 06:05:25 +08:00
|
|
|
channel_widget_eye_redraw (channel_widget);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GDK_BUTTON_RELEASE:
|
|
|
|
return_val = TRUE;
|
|
|
|
|
1999-08-23 22:19:26 +08:00
|
|
|
button_down = FALSE;
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_grab_remove (click_widget);
|
|
|
|
|
|
|
|
if (widget == channel_widget->eye_widget)
|
|
|
|
{
|
|
|
|
if (exclusive)
|
|
|
|
{
|
1998-06-29 08:24:44 +08:00
|
|
|
gdisplays_update_area (channel_widget->gimage, 0, 0, width, height);
|
1997-11-25 06:05:25 +08:00
|
|
|
gdisplays_flush ();
|
|
|
|
}
|
|
|
|
else if (old_state != visible)
|
|
|
|
{
|
1998-06-29 08:24:44 +08:00
|
|
|
gdisplays_update_area (channel_widget->gimage, 0, 0, width, height);
|
1997-11-25 06:05:25 +08:00
|
|
|
gdisplays_flush ();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GDK_LEAVE_NOTIFY:
|
|
|
|
event_widget = gtk_get_event_widget (event);
|
|
|
|
|
|
|
|
if (button_down && (event_widget == click_widget))
|
|
|
|
{
|
2000-02-13 22:23:47 +08:00
|
|
|
/* the user moved the cursor out of the widget before
|
|
|
|
releasing the button -> cancel the button_press */
|
|
|
|
button_down = FALSE;
|
2001-01-08 05:07:14 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
if (widget == channel_widget->eye_widget)
|
|
|
|
{
|
|
|
|
if (exclusive)
|
|
|
|
{
|
|
|
|
channel_widget_exclusive_visible (channel_widget);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
1999-04-27 12:57:59 +08:00
|
|
|
if (channel_widget->type == AUXILLARY_CHANNEL)
|
1999-08-23 22:19:26 +08:00
|
|
|
GIMP_DRAWABLE (channel_widget->channel)->visible = !visible;
|
1997-11-25 06:05:25 +08:00
|
|
|
else
|
2000-04-03 23:40:30 +08:00
|
|
|
gimp_image_set_component_visible (channel_widget->gimage,
|
|
|
|
channel_widget->type,
|
|
|
|
!visible);
|
1997-11-25 06:05:25 +08:00
|
|
|
channel_widget_eye_redraw (channel_widget);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return return_val;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
channel_widget_preview_events (GtkWidget *widget,
|
2000-04-03 23:40:30 +08:00
|
|
|
GdkEvent *event,
|
|
|
|
gpointer data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
1999-08-23 22:19:26 +08:00
|
|
|
ChannelWidget *channel_widget;
|
1997-11-25 06:05:25 +08:00
|
|
|
GdkEventExpose *eevent;
|
1998-04-30 14:09:55 +08:00
|
|
|
GdkEventButton *bevent;
|
2001-01-08 05:07:14 +08:00
|
|
|
gboolean valid;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-04-03 23:40:30 +08:00
|
|
|
valid = FALSE;
|
|
|
|
|
|
|
|
channel_widget =
|
|
|
|
(ChannelWidget *) gtk_object_get_user_data (GTK_OBJECT (widget));
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
switch (event->type)
|
|
|
|
{
|
1998-04-30 14:09:55 +08:00
|
|
|
case GDK_BUTTON_PRESS:
|
|
|
|
bevent = (GdkEventButton *) event;
|
|
|
|
|
1999-06-07 01:26:51 +08:00
|
|
|
if (bevent->button == 3)
|
|
|
|
{
|
|
|
|
gtk_menu_popup (GTK_MENU (channelsD->ops_menu),
|
|
|
|
NULL, NULL, NULL, NULL,
|
|
|
|
3, bevent->time);
|
|
|
|
return TRUE;
|
|
|
|
}
|
1998-04-30 14:09:55 +08:00
|
|
|
break;
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
case GDK_EXPOSE:
|
|
|
|
if (!preview_size)
|
|
|
|
channel_widget_no_preview_redraw (channel_widget);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
switch (channel_widget->type)
|
|
|
|
{
|
1999-04-27 12:57:59 +08:00
|
|
|
case AUXILLARY_CHANNEL:
|
1999-08-23 22:19:26 +08:00
|
|
|
valid = GIMP_DRAWABLE (channel_widget->channel)->preview_valid;
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
|
|
|
default:
|
2000-04-03 23:40:30 +08:00
|
|
|
valid = gimp_image_preview_valid (channel_widget->gimage,
|
|
|
|
channel_widget->type);
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!valid || !channel_widget->channel_pixmap)
|
|
|
|
{
|
|
|
|
channel_widget_preview_redraw (channel_widget);
|
|
|
|
|
|
|
|
gdk_draw_pixmap (widget->window,
|
|
|
|
widget->style->black_gc,
|
|
|
|
channel_widget->channel_pixmap,
|
|
|
|
0, 0, 0, 0,
|
|
|
|
channelsD->image_width,
|
|
|
|
channelsD->image_height);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
eevent = (GdkEventExpose *) event;
|
|
|
|
|
|
|
|
gdk_draw_pixmap (widget->window,
|
|
|
|
widget->style->black_gc,
|
|
|
|
channel_widget->channel_pixmap,
|
|
|
|
eevent->area.x, eevent->area.y,
|
|
|
|
eevent->area.x, eevent->area.y,
|
|
|
|
eevent->area.width, eevent->area.height);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
channel_widget_preview_redraw (ChannelWidget *channel_widget)
|
|
|
|
{
|
2000-04-03 23:40:30 +08:00
|
|
|
TempBuf *preview_buf;
|
2001-01-08 05:07:14 +08:00
|
|
|
gint width, height;
|
|
|
|
gint channel;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* allocate the channel widget pixmap */
|
|
|
|
if (! channel_widget->channel_pixmap)
|
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
|
|
|
channel_widget->channel_pixmap =
|
|
|
|
gdk_pixmap_new (channel_widget->channel_preview->window,
|
|
|
|
channelsD->image_width,
|
|
|
|
channelsD->image_height,
|
|
|
|
-1);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* determine width and height */
|
|
|
|
switch (channel_widget->type)
|
|
|
|
{
|
1999-04-27 12:57:59 +08:00
|
|
|
case AUXILLARY_CHANNEL:
|
2000-04-03 23:40:30 +08:00
|
|
|
width = GIMP_DRAWABLE (channel_widget->channel)->width;
|
1999-08-23 22:19:26 +08:00
|
|
|
height = GIMP_DRAWABLE (channel_widget->channel)->height;
|
2000-12-15 23:54:17 +08:00
|
|
|
channel_widget->width = RINT (channelsD->ratio * width);
|
|
|
|
channel_widget->height = RINT (channelsD->ratio * height);
|
|
|
|
|
|
|
|
if (channelsD->ratio > 1.0) /* Preview is scaling up! */
|
|
|
|
{
|
|
|
|
preview_buf = channel_preview (channel_widget->channel,
|
|
|
|
channelsD->gimage_width,
|
|
|
|
channelsD->gimage_height);
|
|
|
|
preview_buf = gimp_preview_scale (preview_buf,
|
|
|
|
channel_widget->width,
|
|
|
|
channel_widget->height);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
preview_buf = channel_preview (channel_widget->channel,
|
|
|
|
channel_widget->width,
|
|
|
|
channel_widget->height);
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
2000-12-15 23:54:17 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
default:
|
2000-12-15 23:54:17 +08:00
|
|
|
width = channel_widget->gimage->width;
|
1997-11-25 06:05:25 +08:00
|
|
|
height = channel_widget->gimage->height;
|
2000-12-15 23:54:17 +08:00
|
|
|
channel_widget->width = RINT (channelsD->ratio * width);
|
|
|
|
channel_widget->height = RINT (channelsD->ratio * height);
|
|
|
|
|
|
|
|
if (channelsD->ratio > 1.0) /* Preview is scaling up! */
|
|
|
|
{
|
|
|
|
preview_buf = gimp_image_composite_preview (channel_widget->gimage,
|
|
|
|
channel_widget->type,
|
|
|
|
width,
|
|
|
|
height);
|
|
|
|
preview_buf = gimp_preview_scale (preview_buf,
|
|
|
|
channel_widget->width,
|
|
|
|
channel_widget->height);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
preview_buf = gimp_image_composite_preview (channel_widget->gimage,
|
|
|
|
channel_widget->type,
|
|
|
|
channel_widget->width,
|
|
|
|
channel_widget->height);
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (channel_widget->type)
|
|
|
|
{
|
1999-04-27 12:57:59 +08:00
|
|
|
case RED_CHANNEL: channel = RED_PIX; break;
|
|
|
|
case GREEN_CHANNEL: channel = GREEN_PIX; break;
|
|
|
|
case BLUE_CHANNEL: channel = BLUE_PIX; break;
|
|
|
|
case GRAY_CHANNEL: channel = GRAY_PIX; break;
|
|
|
|
case INDEXED_CHANNEL: channel = INDEXED_PIX; break;
|
|
|
|
case AUXILLARY_CHANNEL: channel = -1; break;
|
|
|
|
default: channel = -1; break;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
render_preview (preview_buf,
|
|
|
|
channelsD->preview,
|
|
|
|
channelsD->image_width,
|
|
|
|
channelsD->image_height,
|
|
|
|
channel);
|
|
|
|
|
|
|
|
gtk_preview_put (GTK_PREVIEW (channelsD->preview),
|
|
|
|
channel_widget->channel_pixmap,
|
|
|
|
channel_widget->channel_preview->style->black_gc,
|
2000-12-15 23:54:17 +08:00
|
|
|
0, 0, 0, 0,
|
|
|
|
channelsD->image_width, channelsD->image_height);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* make sure the image has been transfered completely to the pixmap before
|
|
|
|
* we use it again...
|
|
|
|
*/
|
|
|
|
gdk_flush ();
|
2000-12-15 23:54:17 +08:00
|
|
|
|
|
|
|
if (channelsD->ratio > 1.0)
|
|
|
|
temp_buf_free (preview_buf);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
channel_widget_no_preview_redraw (ChannelWidget *channel_widget)
|
|
|
|
{
|
2001-01-08 05:07:14 +08:00
|
|
|
GdkPixmap *pixmap;
|
|
|
|
GdkPixmap **pixmap_normal;
|
|
|
|
GdkPixmap **pixmap_selected;
|
|
|
|
GdkPixmap **pixmap_insensitive;
|
|
|
|
GdkColor *color;
|
|
|
|
GtkWidget *widget;
|
|
|
|
GtkStateType state;
|
|
|
|
gchar *bits;
|
|
|
|
gint width, height;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
state = channel_widget->list_item->state;
|
|
|
|
|
2000-04-03 23:40:30 +08:00
|
|
|
pixmap_normal = &channel_pixmap[NORMAL];
|
|
|
|
pixmap_selected = &channel_pixmap[SELECTED];
|
1997-11-25 06:05:25 +08:00
|
|
|
pixmap_insensitive = &channel_pixmap[INSENSITIVE];
|
2000-04-03 23:40:30 +08:00
|
|
|
widget = channel_widget->channel_preview;
|
|
|
|
bits = (gchar *) channel_bits;
|
|
|
|
width = channel_width;
|
|
|
|
height = channel_height;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
if (GTK_WIDGET_IS_SENSITIVE (channel_widget->list_item))
|
|
|
|
{
|
|
|
|
if (state == GTK_STATE_SELECTED)
|
|
|
|
color = &widget->style->bg[GTK_STATE_SELECTED];
|
|
|
|
else
|
|
|
|
color = &widget->style->white;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
color = &widget->style->bg[GTK_STATE_INSENSITIVE];
|
|
|
|
|
|
|
|
gdk_window_set_background (widget->window, color);
|
|
|
|
|
|
|
|
if (!*pixmap_normal)
|
|
|
|
{
|
|
|
|
*pixmap_normal =
|
|
|
|
gdk_pixmap_create_from_data (widget->window,
|
|
|
|
bits, width, height, -1,
|
|
|
|
&widget->style->fg[GTK_STATE_SELECTED],
|
|
|
|
&widget->style->bg[GTK_STATE_SELECTED]);
|
|
|
|
*pixmap_selected =
|
|
|
|
gdk_pixmap_create_from_data (widget->window,
|
|
|
|
bits, width, height, -1,
|
|
|
|
&widget->style->fg[GTK_STATE_NORMAL],
|
|
|
|
&widget->style->white);
|
|
|
|
*pixmap_insensitive =
|
|
|
|
gdk_pixmap_create_from_data (widget->window,
|
|
|
|
bits, width, height, -1,
|
|
|
|
&widget->style->fg[GTK_STATE_INSENSITIVE],
|
|
|
|
&widget->style->bg[GTK_STATE_INSENSITIVE]);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (GTK_WIDGET_IS_SENSITIVE (channel_widget->list_item))
|
|
|
|
{
|
|
|
|
if (state == GTK_STATE_SELECTED)
|
|
|
|
pixmap = *pixmap_selected;
|
|
|
|
else
|
|
|
|
pixmap = *pixmap_normal;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
pixmap = *pixmap_insensitive;
|
|
|
|
|
|
|
|
gdk_draw_pixmap (widget->window,
|
|
|
|
widget->style->black_gc,
|
|
|
|
pixmap, 0, 0, 0, 0, width, height);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
channel_widget_eye_redraw (ChannelWidget *channel_widget)
|
|
|
|
{
|
2001-01-08 05:07:14 +08:00
|
|
|
GdkPixmap *pixmap;
|
|
|
|
GdkColor *color;
|
|
|
|
GtkStateType state;
|
|
|
|
gboolean visible;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
state = channel_widget->list_item->state;
|
|
|
|
|
|
|
|
if (GTK_WIDGET_IS_SENSITIVE (channel_widget->list_item))
|
|
|
|
{
|
|
|
|
if (state == GTK_STATE_SELECTED)
|
|
|
|
color = &channel_widget->eye_widget->style->bg[GTK_STATE_SELECTED];
|
|
|
|
else
|
|
|
|
color = &channel_widget->eye_widget->style->white;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
color = &channel_widget->eye_widget->style->bg[GTK_STATE_INSENSITIVE];
|
|
|
|
|
|
|
|
gdk_window_set_background (channel_widget->eye_widget->window, color);
|
|
|
|
|
|
|
|
switch (channel_widget->type)
|
|
|
|
{
|
1999-04-27 12:57:59 +08:00
|
|
|
case AUXILLARY_CHANNEL:
|
1999-08-23 22:19:26 +08:00
|
|
|
visible = GIMP_DRAWABLE (channel_widget->channel)->visible;
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
|
|
|
default:
|
2000-04-03 23:40:30 +08:00
|
|
|
visible = gimp_image_get_component_visible (channel_widget->gimage,
|
|
|
|
channel_widget->type);
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (visible)
|
|
|
|
{
|
|
|
|
if (!eye_pixmap[NORMAL])
|
|
|
|
{
|
|
|
|
eye_pixmap[NORMAL] =
|
|
|
|
gdk_pixmap_create_from_data (channel_widget->eye_widget->window,
|
|
|
|
(gchar*) eye_bits, eye_width, eye_height, -1,
|
|
|
|
&channel_widget->eye_widget->style->fg[GTK_STATE_NORMAL],
|
|
|
|
&channel_widget->eye_widget->style->white);
|
|
|
|
eye_pixmap[SELECTED] =
|
|
|
|
gdk_pixmap_create_from_data (channel_widget->eye_widget->window,
|
|
|
|
(gchar*) eye_bits, eye_width, eye_height, -1,
|
|
|
|
&channel_widget->eye_widget->style->fg[GTK_STATE_SELECTED],
|
|
|
|
&channel_widget->eye_widget->style->bg[GTK_STATE_SELECTED]);
|
|
|
|
eye_pixmap[INSENSITIVE] =
|
|
|
|
gdk_pixmap_create_from_data (channel_widget->eye_widget->window,
|
|
|
|
(gchar*) eye_bits, eye_width, eye_height, -1,
|
|
|
|
&channel_widget->eye_widget->style->fg[GTK_STATE_INSENSITIVE],
|
|
|
|
&channel_widget->eye_widget->style->bg[GTK_STATE_INSENSITIVE]);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (GTK_WIDGET_IS_SENSITIVE (channel_widget->list_item))
|
|
|
|
{
|
|
|
|
if (state == GTK_STATE_SELECTED)
|
|
|
|
pixmap = eye_pixmap[SELECTED];
|
|
|
|
else
|
|
|
|
pixmap = eye_pixmap[NORMAL];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
pixmap = eye_pixmap[INSENSITIVE];
|
|
|
|
|
|
|
|
gdk_draw_pixmap (channel_widget->eye_widget->window,
|
|
|
|
channel_widget->eye_widget->style->black_gc,
|
|
|
|
pixmap, 0, 0, 0, 0, eye_width, eye_height);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gdk_window_clear (channel_widget->eye_widget->window);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
channel_widget_exclusive_visible (ChannelWidget *channel_widget)
|
|
|
|
{
|
2000-04-03 23:40:30 +08:00
|
|
|
GSList *list;
|
1997-11-25 06:05:25 +08:00
|
|
|
ChannelWidget *cw;
|
2000-04-03 23:40:30 +08:00
|
|
|
gboolean visible = FALSE;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
if (!channelsD)
|
|
|
|
return;
|
|
|
|
|
|
|
|
/* First determine if _any_ other channel widgets are set to visible */
|
2000-04-03 23:40:30 +08:00
|
|
|
for (list = channelsD->channel_widgets; list; list = g_slist_next (list))
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
cw = (ChannelWidget *) list->data;
|
2000-04-03 23:40:30 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
if (cw != channel_widget)
|
|
|
|
{
|
|
|
|
switch (cw->type)
|
|
|
|
{
|
1999-04-27 12:57:59 +08:00
|
|
|
case AUXILLARY_CHANNEL:
|
1999-08-23 22:19:26 +08:00
|
|
|
visible |= GIMP_DRAWABLE (cw->channel)->visible;
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
|
|
|
default:
|
2000-04-03 23:40:30 +08:00
|
|
|
visible |= gimp_image_get_component_visible (cw->gimage, cw->type);
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Now, toggle the visibility for all channels except the specified one */
|
2000-04-03 23:40:30 +08:00
|
|
|
for (list = channelsD->channel_widgets; list; list = g_slist_next (list))
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
cw = (ChannelWidget *) list->data;
|
2000-04-03 23:40:30 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
if (cw != channel_widget)
|
|
|
|
switch (cw->type)
|
|
|
|
{
|
1999-04-27 12:57:59 +08:00
|
|
|
case AUXILLARY_CHANNEL:
|
1999-08-23 22:19:26 +08:00
|
|
|
GIMP_DRAWABLE (cw->channel)->visible = !visible;
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
|
|
|
default:
|
2000-04-03 23:40:30 +08:00
|
|
|
gimp_image_set_component_visible (cw->gimage, cw->type, !visible);
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
switch (cw->type)
|
|
|
|
{
|
1999-04-27 12:57:59 +08:00
|
|
|
case AUXILLARY_CHANNEL:
|
1999-08-23 22:19:26 +08:00
|
|
|
GIMP_DRAWABLE (cw->channel)->visible = TRUE;
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
|
|
|
default:
|
2000-04-03 23:40:30 +08:00
|
|
|
gimp_image_set_component_visible (cw->gimage, cw->type, TRUE);
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
channel_widget_eye_redraw (cw);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
channel_widget_channel_flush (GtkWidget *widget,
|
1999-08-21 03:59:06 +08:00
|
|
|
gpointer data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
ChannelWidget *channel_widget;
|
2000-04-03 23:40:30 +08:00
|
|
|
gboolean update_preview = FALSE;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-04-03 23:40:30 +08:00
|
|
|
channel_widget =
|
|
|
|
(ChannelWidget *) gtk_object_get_user_data (GTK_OBJECT (widget));
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-04-03 23:40:30 +08:00
|
|
|
/* Set sensitivity */
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* If there is a floating selection... */
|
1998-01-22 15:02:57 +08:00
|
|
|
if (channelsD->floating_sel != NULL)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
/* to insensitive if this is an auxillary channel */
|
1999-04-27 12:57:59 +08:00
|
|
|
if (channel_widget->type == AUXILLARY_CHANNEL)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
if (GTK_WIDGET_IS_SENSITIVE (channel_widget->list_item))
|
|
|
|
gtk_widget_set_sensitive (channel_widget->list_item, FALSE);
|
|
|
|
}
|
|
|
|
/* to sensitive otherwise */
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (! GTK_WIDGET_IS_SENSITIVE (channel_widget->list_item))
|
|
|
|
gtk_widget_set_sensitive (channel_widget->list_item, TRUE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2000-04-03 20:39:14 +08:00
|
|
|
/* to insensitive if there is an active channel,
|
|
|
|
* and this is a component channel
|
|
|
|
*/
|
|
|
|
if (channel_widget->type != AUXILLARY_CHANNEL &&
|
|
|
|
channelsD->active_channel != NULL)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
if (GTK_WIDGET_IS_SENSITIVE (channel_widget->list_item))
|
|
|
|
gtk_widget_set_sensitive (channel_widget->list_item, FALSE);
|
|
|
|
}
|
|
|
|
/* to sensitive otherwise */
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (! GTK_WIDGET_IS_SENSITIVE (channel_widget->list_item))
|
|
|
|
gtk_widget_set_sensitive (channel_widget->list_item, TRUE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-04-03 23:40:30 +08:00
|
|
|
/* Set selection */
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* If this is an auxillary channel */
|
1999-04-27 12:57:59 +08:00
|
|
|
if (channel_widget->type == AUXILLARY_CHANNEL)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
/* select if this is the active channel */
|
1998-01-22 15:02:57 +08:00
|
|
|
if (channelsD->active_channel == (channel_widget->channel))
|
1998-10-06 04:22:52 +08:00
|
|
|
channels_dialog_set_channel (channel_widget);
|
1997-11-25 06:05:25 +08:00
|
|
|
/* unselect if this is not the active channel */
|
|
|
|
else
|
1998-01-22 15:02:57 +08:00
|
|
|
channels_dialog_unset_channel (channel_widget);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* If the component is active, select. otherwise, deselect */
|
2000-04-03 23:40:30 +08:00
|
|
|
if (gimp_image_get_component_active (channel_widget->gimage,
|
|
|
|
channel_widget->type))
|
1998-01-22 15:02:57 +08:00
|
|
|
channels_dialog_set_channel (channel_widget);
|
1997-11-25 06:05:25 +08:00
|
|
|
else
|
1998-01-22 15:02:57 +08:00
|
|
|
channels_dialog_unset_channel (channel_widget);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
switch (channel_widget->type)
|
|
|
|
{
|
1999-04-27 12:57:59 +08:00
|
|
|
case AUXILLARY_CHANNEL:
|
1999-08-23 22:19:26 +08:00
|
|
|
update_preview = !GIMP_DRAWABLE (channel_widget->channel)->preview_valid;
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
|
|
|
default:
|
2000-04-03 23:40:30 +08:00
|
|
|
update_preview = !gimp_image_preview_valid (channel_widget->gimage,
|
|
|
|
channel_widget->type);
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (update_preview)
|
1999-11-05 22:39:04 +08:00
|
|
|
gtk_widget_queue_draw (channel_widget->channel_preview);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2001-01-15 12:37:01 +08:00
|
|
|
static void
|
|
|
|
channels_dialog_opacity_update (GtkAdjustment *adjustment,
|
|
|
|
gpointer data)
|
|
|
|
{
|
2001-01-15 14:24:24 +08:00
|
|
|
GimpRGB color;
|
2001-01-15 12:37:01 +08:00
|
|
|
|
2001-01-15 14:24:24 +08:00
|
|
|
gimp_color_button_get_color (GIMP_COLOR_BUTTON (data), &color);
|
|
|
|
gimp_rgb_set_alpha (&color, adjustment->value / 100.0);
|
|
|
|
gimp_color_button_set_color (GIMP_COLOR_BUTTON (data), &color);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
channels_dialog_color_changed (GimpColorButton *button,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
GtkAdjustment *adj = GTK_ADJUSTMENT (data);
|
|
|
|
GimpRGB color;
|
2001-01-15 12:37:01 +08:00
|
|
|
|
2001-01-15 14:24:24 +08:00
|
|
|
gimp_color_button_get_color (button, &color);
|
|
|
|
gtk_adjustment_set_value (adj, color.a * 100.0);
|
2001-01-15 12:37:01 +08:00
|
|
|
}
|
|
|
|
|
1999-08-21 03:59:06 +08:00
|
|
|
/**********************************/
|
|
|
|
/* The new channel query dialog */
|
|
|
|
/**********************************/
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
typedef struct _NewChannelOptions NewChannelOptions;
|
|
|
|
|
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
|
|
|
struct _NewChannelOptions
|
|
|
|
{
|
1999-08-21 03:59:06 +08:00
|
|
|
GtkWidget *query_box;
|
|
|
|
GtkWidget *name_entry;
|
2001-01-15 14:24:24 +08:00
|
|
|
GtkWidget *color_panel;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-01-15 12:37:01 +08:00
|
|
|
GimpImage *gimage;
|
1997-11-25 06:05:25 +08:00
|
|
|
};
|
|
|
|
|
2001-01-15 09:48:53 +08:00
|
|
|
static gchar *channel_name = NULL;
|
2001-01-15 12:37:01 +08:00
|
|
|
static GimpRGB channel_color = { 0.0, 0.0, 0.0, 0.5 };
|
2001-01-15 09:48:53 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
static void
|
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
|
|
|
new_channel_query_ok_callback (GtkWidget *widget,
|
1999-08-21 03:59:06 +08:00
|
|
|
gpointer data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
NewChannelOptions *options;
|
2001-01-08 05:07:14 +08:00
|
|
|
Channel *new_channel;
|
|
|
|
GimpImage *gimage;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-08-21 03:59:06 +08:00
|
|
|
options = (NewChannelOptions *) data;
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
if (channel_name)
|
|
|
|
g_free (channel_name);
|
|
|
|
channel_name = g_strdup (gtk_entry_get_text (GTK_ENTRY (options->name_entry)));
|
|
|
|
|
1998-06-29 08:24:44 +08:00
|
|
|
if ((gimage = options->gimage))
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2001-01-15 14:24:24 +08:00
|
|
|
gimp_color_button_get_color (GIMP_COLOR_BUTTON (options->color_panel),
|
|
|
|
&channel_color);
|
1998-06-29 08:24:44 +08:00
|
|
|
new_channel = channel_new (gimage, gimage->width, gimage->height,
|
1999-08-23 22:19:26 +08:00
|
|
|
channel_name,
|
2001-01-15 14:24:24 +08:00
|
|
|
&channel_color);
|
2001-01-15 12:37:01 +08:00
|
|
|
|
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
|
|
|
drawable_fill (GIMP_DRAWABLE (new_channel), TRANSPARENT_FILL);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-04-03 23:40:30 +08:00
|
|
|
gimp_image_add_channel (gimage, new_channel, -1);
|
1997-11-25 06:05:25 +08:00
|
|
|
gdisplays_flush ();
|
|
|
|
}
|
|
|
|
|
|
|
|
gtk_widget_destroy (options->query_box);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1998-06-29 08:24:44 +08:00
|
|
|
channels_dialog_new_channel_query (GimpImage* gimage)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
NewChannelOptions *options;
|
2001-01-15 12:37:01 +08:00
|
|
|
GtkWidget *hbox;
|
|
|
|
GtkWidget *vbox;
|
|
|
|
GtkWidget *table;
|
|
|
|
GtkWidget *label;
|
|
|
|
GtkWidget *opacity_scale;
|
|
|
|
GtkObject *opacity_scale_data;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* the new options structure */
|
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
|
|
|
options = g_new (NewChannelOptions, 1);
|
1999-08-21 03:59:06 +08:00
|
|
|
options->gimage = gimage;
|
2001-01-21 21:41:07 +08:00
|
|
|
options->color_panel = gimp_color_panel_new (_("New Channel Color"),
|
|
|
|
&channel_color,
|
2001-01-15 14:24:24 +08:00
|
|
|
GIMP_COLOR_AREA_LARGE_CHECKS,
|
|
|
|
48, 64);
|
|
|
|
|
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
|
|
|
/* The dialog */
|
1999-09-28 01:58:10 +08:00
|
|
|
options->query_box =
|
|
|
|
gimp_dialog_new (_("New Channel Options"), "new_channel_options",
|
|
|
|
gimp_standard_help_func,
|
1999-10-04 16:40:33 +08:00
|
|
|
"dialogs/channels/new_channel.html",
|
1999-09-28 01:58:10 +08:00
|
|
|
GTK_WIN_POS_MOUSE,
|
|
|
|
FALSE, TRUE, FALSE,
|
|
|
|
|
|
|
|
_("OK"), new_channel_query_ok_callback,
|
2000-01-07 00:40:17 +08:00
|
|
|
options, NULL, NULL, TRUE, FALSE,
|
2000-04-03 23:40:30 +08:00
|
|
|
_("Cancel"), gtk_widget_destroy,
|
|
|
|
NULL, 1, NULL, FALSE, TRUE,
|
1999-09-28 01:58:10 +08:00
|
|
|
|
|
|
|
NULL);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-04-03 23:40:30 +08:00
|
|
|
gtk_signal_connect_object (GTK_OBJECT (options->query_box), "destroy",
|
|
|
|
GTK_SIGNAL_FUNC (g_free),
|
|
|
|
(GtkObject *) options);
|
|
|
|
|
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
|
|
|
/* The main hbox */
|
|
|
|
hbox = gtk_hbox_new (FALSE, 2);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (hbox), 4);
|
|
|
|
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (options->query_box)->vbox),
|
|
|
|
hbox);
|
|
|
|
|
|
|
|
/* The vbox */
|
|
|
|
vbox = gtk_vbox_new (FALSE, 2);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* The table */
|
|
|
|
table = gtk_table_new (2, 3, FALSE);
|
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
|
|
|
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
|
2001-01-16 22:47:09 +08:00
|
|
|
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
|
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
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
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
|
|
|
/* The name entry hbox, label and entry */
|
|
|
|
label = gtk_label_new (_("Channel name:"));
|
|
|
|
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1,
|
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
|
|
|
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_widget_show (label);
|
|
|
|
|
|
|
|
options->name_entry = gtk_entry_new ();
|
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
|
|
|
gtk_widget_set_usize (options->name_entry, 150, 0);
|
|
|
|
gtk_table_attach_defaults (GTK_TABLE (table), options->name_entry,
|
|
|
|
1, 2, 0, 1);
|
|
|
|
gtk_entry_set_text (GTK_ENTRY (options->name_entry),
|
|
|
|
(channel_name ? channel_name : _("New Channel")));
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_widget_show (options->name_entry);
|
|
|
|
|
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
|
|
|
/* The opacity scale */
|
|
|
|
label = gtk_label_new (_("Fill Opacity:"));
|
|
|
|
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 1.0);
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2,
|
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
|
|
|
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_widget_show (label);
|
|
|
|
|
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
|
|
|
opacity_scale_data =
|
2001-01-15 14:24:24 +08:00
|
|
|
gtk_adjustment_new (channel_color.a * 100.0, 0.0, 100.0, 1.0, 1.0, 0.0);
|
1997-11-25 06:05:25 +08:00
|
|
|
opacity_scale = gtk_hscale_new (GTK_ADJUSTMENT (opacity_scale_data));
|
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
|
|
|
gtk_table_attach_defaults (GTK_TABLE (table), opacity_scale, 1, 2, 1, 2);
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_scale_set_value_pos (GTK_SCALE (opacity_scale), GTK_POS_TOP);
|
|
|
|
gtk_signal_connect (GTK_OBJECT (opacity_scale_data), "value_changed",
|
2001-01-15 12:37:01 +08:00
|
|
|
GTK_SIGNAL_FUNC (channels_dialog_opacity_update),
|
2001-01-15 14:24:24 +08:00
|
|
|
options->color_panel);
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_widget_show (opacity_scale);
|
|
|
|
|
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
|
|
|
/* The color panel */
|
2001-01-15 14:24:24 +08:00
|
|
|
gtk_signal_connect (GTK_OBJECT (options->color_panel), "color_changed",
|
|
|
|
channels_dialog_color_changed,
|
|
|
|
opacity_scale_data);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), options->color_panel,
|
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
|
|
|
TRUE, TRUE, 0);
|
2001-01-15 14:24:24 +08:00
|
|
|
gtk_widget_show (options->color_panel);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
gtk_widget_show (table);
|
|
|
|
gtk_widget_show (vbox);
|
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
|
|
|
gtk_widget_show (hbox);
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_widget_show (options->query_box);
|
|
|
|
}
|
|
|
|
|
1999-08-21 03:59:06 +08:00
|
|
|
/****************************************/
|
|
|
|
/* The edit channel attributes dialog */
|
|
|
|
/****************************************/
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
typedef struct _EditChannelOptions EditChannelOptions;
|
|
|
|
|
1999-06-07 01:26:51 +08:00
|
|
|
struct _EditChannelOptions
|
|
|
|
{
|
2001-01-15 12:37:01 +08:00
|
|
|
GtkWidget *query_box;
|
|
|
|
GtkWidget *name_entry;
|
2001-01-15 14:24:24 +08:00
|
|
|
GtkWidget *color_panel;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
ChannelWidget *channel_widget;
|
1999-06-07 01:26:51 +08:00
|
|
|
GimpImage *gimage;
|
1997-11-25 06:05:25 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
static void
|
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
|
|
|
edit_channel_query_ok_callback (GtkWidget *widget,
|
1999-08-21 03:59:06 +08:00
|
|
|
gpointer data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
EditChannelOptions *options;
|
2001-01-15 09:48:53 +08:00
|
|
|
Channel *channel;
|
2001-01-15 14:24:24 +08:00
|
|
|
GimpRGB color;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-08-21 03:59:06 +08:00
|
|
|
options = (EditChannelOptions *) data;
|
1997-11-25 06:05:25 +08:00
|
|
|
channel = options->channel_widget->channel;
|
|
|
|
|
1999-06-07 01:26:51 +08:00
|
|
|
if (options->gimage)
|
|
|
|
{
|
|
|
|
/* Set the new channel name */
|
2001-01-10 11:13:03 +08:00
|
|
|
gimp_object_set_name (GIMP_OBJECT (channel),
|
|
|
|
gtk_entry_get_text (GTK_ENTRY (options->name_entry)));
|
1999-06-07 01:26:51 +08:00
|
|
|
gtk_label_set_text (GTK_LABEL (options->channel_widget->label),
|
2001-01-10 11:13:03 +08:00
|
|
|
gimp_object_get_name (GIMP_OBJECT (channel)));
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-01-15 14:24:24 +08:00
|
|
|
gimp_color_button_get_color (GIMP_COLOR_BUTTON (options->color_panel),
|
|
|
|
&color);
|
2001-01-15 09:48:53 +08:00
|
|
|
|
2001-01-15 14:24:24 +08:00
|
|
|
if (gimp_rgba_distance (&color, &channel->color) > 0.0001)
|
2001-01-15 09:48:53 +08:00
|
|
|
{
|
2001-01-15 14:24:24 +08:00
|
|
|
channel->color = color;
|
1999-08-23 22:19:26 +08:00
|
|
|
drawable_update (GIMP_DRAWABLE (channel), 0, 0,
|
|
|
|
GIMP_DRAWABLE (channel)->width,
|
|
|
|
GIMP_DRAWABLE (channel)->height);
|
1999-06-07 01:26:51 +08:00
|
|
|
gdisplays_flush ();
|
|
|
|
}
|
|
|
|
}
|
1998-10-06 04:22:52 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_widget_destroy (options->query_box);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
channels_dialog_edit_channel_query (ChannelWidget *channel_widget)
|
|
|
|
{
|
|
|
|
EditChannelOptions *options;
|
2001-01-15 12:37:01 +08:00
|
|
|
GtkWidget *hbox;
|
|
|
|
GtkWidget *vbox;
|
|
|
|
GtkWidget *table;
|
|
|
|
GtkWidget *label;
|
|
|
|
GtkWidget *opacity_scale;
|
|
|
|
GtkObject *opacity_scale_data;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* the new options structure */
|
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
|
|
|
options = g_new (EditChannelOptions, 1);
|
1997-11-25 06:05:25 +08:00
|
|
|
options->channel_widget = channel_widget;
|
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
|
|
|
options->gimage = channel_widget->gimage;
|
2001-01-08 05:07:14 +08:00
|
|
|
|
2001-01-15 14:24:24 +08:00
|
|
|
channel_color = channel_widget->channel->color;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-01-21 21:41:07 +08:00
|
|
|
options->color_panel = gimp_color_panel_new (_("Edit Channel Color"),
|
|
|
|
&channel_color,
|
2001-01-15 14:24:24 +08:00
|
|
|
GIMP_COLOR_AREA_LARGE_CHECKS,
|
|
|
|
48, 64);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
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
|
|
|
/* The dialog */
|
1999-09-28 01:58:10 +08:00
|
|
|
options->query_box =
|
|
|
|
gimp_dialog_new (_("Edit Channel Attributes"), "edit_channel_attributes",
|
|
|
|
gimp_standard_help_func,
|
configure.in Updated Gimp-Help. See help/ChangeLog for details.
2000-12-15 Michael Natterer <mitch@gimp.org>
* configure.in
* help/*: Updated Gimp-Help. See help/ChangeLog for details.
* app/channels_dialog.c
* app/gdisplay.c
* app/gradient.c
* app/layers_dialog.c
* app/menus.c
* app/paths_dialog.c
* app/preferences_dialog.c
* app/resize.c: fixed menu paths.
* plug-ins/helpbrowser/helpbrowser.c: load a special
"undocumented_filter.html" page if a filter was not found.
Adapted to the new help structure.
2000-12-15 Michael Natterer <mitch@gimp.org>
* makedummyhelpfile.sh
* makeindex.sh: removed.
* images/*: added some images.
* help/*: Updated to the latest version of the gimp-help CVS module.
This Version instoduces a bunch of new toplevel HTML files for
general topics, an autogenerated index, TOC, glossary,
an "image" directory on the "C" level, peace, love, and stuff...
Thanks to all help writers: Prof, Bex, Piers, ...
2000-12-15 11:47:24 +08:00
|
|
|
"dialogs/channels/edit_channel_attributes.html",
|
1999-09-28 01:58:10 +08:00
|
|
|
GTK_WIN_POS_MOUSE,
|
|
|
|
FALSE, TRUE, FALSE,
|
|
|
|
|
|
|
|
_("OK"), edit_channel_query_ok_callback,
|
2000-01-07 00:40:17 +08:00
|
|
|
options, NULL, NULL, TRUE, FALSE,
|
2000-04-03 23:40:30 +08:00
|
|
|
_("Cancel"), gtk_widget_destroy,
|
|
|
|
NULL, 1, NULL, FALSE, TRUE,
|
1999-09-28 01:58:10 +08:00
|
|
|
|
|
|
|
NULL);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-04-03 23:40:30 +08:00
|
|
|
gtk_signal_connect_object (GTK_OBJECT (options->query_box), "destroy",
|
|
|
|
GTK_SIGNAL_FUNC (g_free),
|
|
|
|
(GtkObject *) options);
|
|
|
|
|
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
|
|
|
/* The main hbox */
|
|
|
|
hbox = gtk_hbox_new (FALSE, 2);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (hbox), 4);
|
|
|
|
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (options->query_box)->vbox),
|
|
|
|
hbox);
|
|
|
|
|
|
|
|
/* The vbox */
|
|
|
|
vbox = gtk_vbox_new (FALSE, 2);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* The table */
|
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
|
|
|
table = gtk_table_new (2, 3, FALSE);
|
|
|
|
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
|
2001-01-16 22:47:09 +08:00
|
|
|
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
|
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
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
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
|
|
|
/* The name entry */
|
Lots of ii8n stuff here and some additions to the de.po. Applied
Wed Oct 14 17:46:15 EDT 1998 Adrian Likins <adrian@gimp.org>
* app/*, po/de.po, de/POTFILES.in, libgimp/gimpintl.h:
Lots of ii8n stuff here and some additions to the de.po.
Applied gimp-egger-981005-1 ,gimp-egger-981006-1,
gimp-egger-981007-1, gimp-egger-981008-1,
gimp-egger-981009-1.patch, gimp-egger-981010-1.patch
* plug-in/guillotine/guillotine.c: added the coordinates
of the split images from the original image to the title.
ie foo.jpg (0,0) for the image in the topleft.
* plug-in/script-fu/scripts/neon-logo.scm,
perspective-shadow.scm, predator.scm,rendermap.scm,
ripply-anim.scm, select_to_image.scm,swirltile.scm,
xach-effect.scm: updated scripts to use new script-fu stuff
wooo boy! a big un!
in testing this, it looks like some of the po files are busted.
but the code stuff seems okay.
-adrian
1998-10-15 07:23:52 +08:00
|
|
|
label = gtk_label_new (_("Channel name:"));
|
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
|
|
|
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
|
|
|
|
gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1,
|
|
|
|
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_widget_show (label);
|
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
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
options->name_entry = gtk_entry_new ();
|
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
|
|
|
gtk_widget_set_usize (options->name_entry, 150, 0);
|
|
|
|
gtk_table_attach_defaults (GTK_TABLE (table), options->name_entry,
|
|
|
|
1, 2, 0, 1);
|
2000-12-29 00:19:55 +08:00
|
|
|
gtk_entry_set_text
|
|
|
|
(GTK_ENTRY (options->name_entry),
|
2001-01-10 11:13:03 +08:00
|
|
|
gimp_object_get_name (GIMP_OBJECT (channel_widget->channel)));
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_widget_show (options->name_entry);
|
|
|
|
|
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
|
|
|
/* The opacity scale */
|
|
|
|
label = gtk_label_new (_("Fill Opacity:"));
|
|
|
|
gtk_misc_set_alignment (GTK_MISC (label), 1.0, 1.0);
|
|
|
|
gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2,
|
|
|
|
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_widget_show (label);
|
|
|
|
|
1999-06-07 01:26:51 +08:00
|
|
|
opacity_scale_data =
|
2001-01-15 14:24:24 +08:00
|
|
|
gtk_adjustment_new (channel_color.a * 100.0, 0.0, 100.0, 1.0, 1.0, 0.0);
|
1997-11-25 06:05:25 +08:00
|
|
|
opacity_scale = gtk_hscale_new (GTK_ADJUSTMENT (opacity_scale_data));
|
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
|
|
|
gtk_table_attach_defaults (GTK_TABLE (table), opacity_scale, 1, 2, 1, 2);
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_scale_set_value_pos (GTK_SCALE (opacity_scale), GTK_POS_TOP);
|
|
|
|
gtk_signal_connect (GTK_OBJECT (opacity_scale_data), "value_changed",
|
2001-01-15 12:37:01 +08:00
|
|
|
GTK_SIGNAL_FUNC (channels_dialog_opacity_update),
|
2001-01-15 14:24:24 +08:00
|
|
|
options->color_panel);
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_widget_show (opacity_scale);
|
|
|
|
|
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
|
|
|
/* The color panel */
|
2001-01-15 14:24:24 +08:00
|
|
|
gtk_signal_connect (GTK_OBJECT (options->color_panel), "color_changed",
|
|
|
|
channels_dialog_color_changed,
|
|
|
|
opacity_scale_data);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), options->color_panel,
|
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
|
|
|
TRUE, TRUE, 0);
|
2001-01-15 14:24:24 +08:00
|
|
|
gtk_widget_show (options->color_panel);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
gtk_widget_show (table);
|
|
|
|
gtk_widget_show (vbox);
|
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
|
|
|
gtk_widget_show (hbox);
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_widget_show (options->query_box);
|
|
|
|
}
|