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-28 01:27:28 +08:00
|
|
|
#include "config.h"
|
|
|
|
|
2000-12-29 23:22:01 +08:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
|
|
|
#include <gtk/gtk.h>
|
2000-12-17 05:37:03 +08:00
|
|
|
|
|
|
|
#include "apptypes.h"
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
#include "appenv.h"
|
|
|
|
#include "about_dialog.h"
|
|
|
|
#include "app_procs.h"
|
1999-10-27 02:27:27 +08:00
|
|
|
#include "brush_select.h"
|
2001-01-08 07:59:46 +08:00
|
|
|
#include "colormap_dialog.h"
|
1999-01-08 03:53:05 +08:00
|
|
|
#include "color_area.h"
|
1997-11-25 06:05:25 +08:00
|
|
|
#include "commands.h"
|
|
|
|
#include "convert.h"
|
|
|
|
#include "desaturate.h"
|
1998-06-06 11:49:01 +08:00
|
|
|
#include "devices.h"
|
2000-05-05 22:53:38 +08:00
|
|
|
#include "docindex.h"
|
1997-11-25 06:05:25 +08:00
|
|
|
#include "channel_ops.h"
|
|
|
|
#include "drawable.h"
|
|
|
|
#include "equalize.h"
|
1998-08-13 23:25:41 +08:00
|
|
|
#include "errorconsole.h"
|
1997-11-25 06:05:25 +08:00
|
|
|
#include "fileops.h"
|
|
|
|
#include "floating_sel.h"
|
|
|
|
#include "gdisplay_ops.h"
|
|
|
|
#include "gimage_mask.h"
|
2000-12-29 23:22:01 +08:00
|
|
|
#include "gimpcontext.h"
|
1999-09-28 01:58:10 +08:00
|
|
|
#include "gimphelp.h"
|
2000-12-29 23:22:01 +08:00
|
|
|
#include "gimpimage.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 "global_edit.h"
|
1999-10-28 23:05:49 +08:00
|
|
|
#include "gradient_select.h"
|
1997-11-25 06:05:25 +08:00
|
|
|
#include "image_render.h"
|
2000-12-29 23:22:01 +08:00
|
|
|
#include "info_dialog.h"
|
1997-11-25 06:05:25 +08:00
|
|
|
#include "info_window.h"
|
2000-12-29 23:22:01 +08:00
|
|
|
#include "layer.h"
|
1999-08-13 06:21:04 +08:00
|
|
|
#include "nav_window.h"
|
1997-11-25 06:05:25 +08:00
|
|
|
#include "invert.h"
|
1999-06-07 01:26:51 +08:00
|
|
|
#include "lc_dialog.h"
|
1997-11-25 06:05:25 +08:00
|
|
|
#include "layer_select.h"
|
2001-01-02 07:55:45 +08:00
|
|
|
#include "layers_dialogP.h"
|
1999-01-19 08:03:00 +08:00
|
|
|
#include "module_db.h"
|
1997-11-25 06:05:25 +08:00
|
|
|
#include "palette.h"
|
1999-10-27 02:27:27 +08:00
|
|
|
#include "pattern_select.h"
|
1997-11-25 06:05:25 +08:00
|
|
|
#include "plug_in.h"
|
|
|
|
#include "resize.h"
|
|
|
|
#include "scale.h"
|
2000-12-29 23:22:01 +08:00
|
|
|
#include "selection.h"
|
1997-11-25 06:05:25 +08:00
|
|
|
#include "tips_dialog.h"
|
|
|
|
#include "tools.h"
|
|
|
|
#include "undo.h"
|
|
|
|
|
2000-12-25 04:27:04 +08:00
|
|
|
#ifdef DISPLAY_FILTERS
|
|
|
|
#include "gdisplay_color_ui.h"
|
|
|
|
#endif /* DISPLAY_FILTERS */
|
|
|
|
|
2000-12-29 23:22:01 +08:00
|
|
|
#include "libgimp/gimphelpui.h"
|
2000-02-11 05:54:12 +08:00
|
|
|
#include "libgimp/gimpmath.h"
|
2000-12-29 23:22:01 +08:00
|
|
|
|
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
|
|
|
#include "libgimp/gimpintl.h"
|
|
|
|
|
2000-12-29 23:22:01 +08:00
|
|
|
|
1999-06-20 21:53:15 +08:00
|
|
|
#define return_if_no_display(gdisp) \
|
|
|
|
gdisp = gdisplay_active (); \
|
|
|
|
if (!gdisp) return
|
|
|
|
|
1997-12-10 06:09:10 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
/* local functions */
|
2001-01-02 08:46:02 +08:00
|
|
|
static void image_resize_callback (GtkWidget *widget,
|
|
|
|
gpointer data);
|
|
|
|
static void image_scale_callback (GtkWidget *widget,
|
|
|
|
gpointer data);
|
|
|
|
static void gimage_mask_feather_callback (GtkWidget *widget,
|
|
|
|
gdouble size,
|
|
|
|
GimpUnit unit,
|
|
|
|
gpointer data);
|
|
|
|
static void gimage_mask_border_callback (GtkWidget *widget,
|
|
|
|
gdouble size,
|
|
|
|
GimpUnit unit,
|
|
|
|
gpointer data);
|
|
|
|
static void gimage_mask_grow_callback (GtkWidget *widget,
|
|
|
|
gdouble size,
|
|
|
|
GimpUnit unit,
|
|
|
|
gpointer data);
|
|
|
|
static void gimage_mask_shrink_callback (GtkWidget *widget,
|
|
|
|
gdouble size,
|
|
|
|
GimpUnit unit,
|
|
|
|
gpointer data);
|
2001-01-02 07:55:45 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-05-07 07:10:29 +08:00
|
|
|
/* local variables */
|
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 gdouble selection_feather_radius = 5.0;
|
|
|
|
static gint selection_border_radius = 5;
|
|
|
|
static gint selection_grow_pixels = 1;
|
|
|
|
static gint selection_shrink_pixels = 1;
|
|
|
|
static gboolean selection_shrink_edge_lock = FALSE;
|
1998-07-14 08:29:08 +08:00
|
|
|
|
|
|
|
|
1999-11-20 20:12:41 +08:00
|
|
|
/***** File *****/
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
void
|
|
|
|
file_open_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
|
|
|
{
|
|
|
|
file_open_callback (widget, client_data);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
file_save_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
|
|
|
{
|
|
|
|
file_save_callback (widget, client_data);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
file_save_as_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
|
|
|
{
|
|
|
|
file_save_as_callback (widget, client_data);
|
|
|
|
}
|
|
|
|
|
2001-01-02 07:55:45 +08:00
|
|
|
void
|
|
|
|
file_save_a_copy_as_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
|
|
|
{
|
|
|
|
file_save_a_copy_as_callback (widget, client_data);
|
|
|
|
}
|
|
|
|
|
1999-01-12 09:31:49 +08:00
|
|
|
void
|
|
|
|
file_revert_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
|
|
|
{
|
|
|
|
file_revert_callback (widget, client_data);
|
|
|
|
}
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
void
|
|
|
|
file_close_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
|
|
|
{
|
|
|
|
GDisplay *gdisp;
|
1999-06-20 21:53:15 +08:00
|
|
|
return_if_no_display (gdisp);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
gdisplay_close_window (gdisp, FALSE);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
file_quit_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
|
|
|
{
|
app/appenv.h New file. Includes <math.h>. Move G_PI, RINT(), ROUND() etc
1999-09-01 Tor Lillqvist <tml@iki.fi>
* app/appenv.h
* libgimp/gimpmath.h: New file. Includes <math.h>. Move G_PI,
RINT(), ROUND() etc from app/appenv.h here, so plug-ins can
use them, too. Remove some commented-out old stuff in appenv.h.
* libgimp/gimp.h: Include gimpmath.h.
* libgimp/gimp.c (gimp_main): Win32: Don't install signal
handlers, we can't do anything useful in the handler ourselves
anyway (it would be nice to print out a backtrace, but that seems
pretty hard to do, even if not impossible). Let Windows inform the
user about the crash. If the plug-in was compiled with MSVC, and
the user also has it, she is offered a chance to start the
debugger automatically anyway.
* app/*several*.c: Include gimpmath.h for G_PI etc. Don't include
<math.h>, as gimpmath.h includes it.
* plug-ins/*/*many*.c: Include config.h. Don't include <math.h>.
Remove all the duplicated definitions of G_PI and rint(). Use
RINT() instead of rint().
* app/app_procs.[ch]: app_exit() takes a gboolean.
* app/batch.c
* app/commands.c
* app/interface.c: Call app_exit() with FALSE or TRUE.
* app/main.c (on_error): Call gimp_fatal_error. (main): Don't
install any signal handler on Win32 here, either.
* app/errors.c (gimp_fatal_error, gimp_terminate): Win32: Format
the message and call MessageBox with it. g_on_error_query doesn't
do anything useful on Win32, and printf'ing a message to stdout or
stderr doesn't do anything, either, in a windowing application.
1999-09-02 04:30:56 +08:00
|
|
|
app_exit (FALSE);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
1999-11-20 20:12:41 +08:00
|
|
|
/***** Edit *****/
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
void
|
1999-11-20 20:12:41 +08:00
|
|
|
edit_undo_cmd_callback (GtkWidget *widget,
|
1997-11-25 06:05:25 +08:00
|
|
|
gpointer client_data)
|
|
|
|
{
|
2000-02-10 08:00:54 +08:00
|
|
|
GDisplay *gdisp;
|
1999-06-20 21:53:15 +08:00
|
|
|
return_if_no_display (gdisp);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-11-20 20:12:41 +08:00
|
|
|
undo_pop (gdisp->gimage);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1999-11-20 20:12:41 +08:00
|
|
|
edit_redo_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-02-10 08:00:54 +08:00
|
|
|
GDisplay *gdisp;
|
1999-06-20 21:53:15 +08:00
|
|
|
return_if_no_display (gdisp);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-11-20 20:12:41 +08:00
|
|
|
undo_redo (gdisp->gimage);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1999-11-20 20:12:41 +08:00
|
|
|
edit_cut_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-02-10 08:00:54 +08:00
|
|
|
GDisplay *gdisp;
|
1999-06-20 21:53:15 +08:00
|
|
|
return_if_no_display (gdisp);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-11-20 20:12:41 +08:00
|
|
|
global_edit_cut (gdisp);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
1999-07-07 04:43:52 +08:00
|
|
|
void
|
1999-11-20 20:12:41 +08:00
|
|
|
edit_copy_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
1999-07-07 04:43:52 +08:00
|
|
|
{
|
2000-02-10 08:00:54 +08:00
|
|
|
GDisplay *gdisp;
|
1999-07-07 04:43:52 +08:00
|
|
|
return_if_no_display (gdisp);
|
|
|
|
|
1999-11-20 20:12:41 +08:00
|
|
|
global_edit_copy (gdisp);
|
1999-07-07 04:43:52 +08:00
|
|
|
}
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
void
|
1999-11-20 20:12:41 +08:00
|
|
|
edit_paste_cmd_callback (GtkWidget *widget,
|
1997-11-25 06:05:25 +08:00
|
|
|
gpointer client_data)
|
|
|
|
{
|
2000-02-10 08:00:54 +08:00
|
|
|
GDisplay *gdisp;
|
1999-06-20 21:53:15 +08:00
|
|
|
return_if_no_display (gdisp);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-11-20 20:12:41 +08:00
|
|
|
global_edit_paste (gdisp, 0);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1999-11-20 20:12:41 +08:00
|
|
|
edit_paste_into_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-02-10 08:00:54 +08:00
|
|
|
GDisplay *gdisp;
|
1999-06-20 21:53:15 +08:00
|
|
|
return_if_no_display (gdisp);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-11-20 20:12:41 +08:00
|
|
|
global_edit_paste (gdisp, 1);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1999-11-20 20:12:41 +08:00
|
|
|
edit_paste_as_new_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-02-10 08:00:54 +08:00
|
|
|
GDisplay *gdisp;
|
1999-06-20 21:53:15 +08:00
|
|
|
return_if_no_display (gdisp);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-11-20 20:12:41 +08:00
|
|
|
global_edit_paste_as_new (gdisp);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1999-11-20 20:12:41 +08:00
|
|
|
edit_named_cut_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-02-10 08:00:54 +08:00
|
|
|
GDisplay *gdisp;
|
1999-06-20 21:53:15 +08:00
|
|
|
return_if_no_display (gdisp);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-11-20 20:12:41 +08:00
|
|
|
named_edit_cut (gdisp);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1999-11-20 20:12:41 +08:00
|
|
|
edit_named_copy_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-02-10 08:00:54 +08:00
|
|
|
GDisplay *gdisp;
|
1999-06-20 21:53:15 +08:00
|
|
|
return_if_no_display (gdisp);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-11-20 20:12:41 +08:00
|
|
|
named_edit_copy (gdisp);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
Honest, guv, it's not a feature - it's a tightly integrated package of
Mon Sep 20 12:51:30 EDT 1999 Austin Donnelly <austin@gimp.org>
Honest, guv, it's not a feature - it's a tightly integrated
package of undo system cleanups and fixes.
NEW FILES:
* app/undo_history.c: window showing recent undo (and redo) steps
available.
* app/undo_types.h: broken out of undo.h to fix circular includes.
MODIFIED FILES:
* app/Makefile.am: compile undo_history.c
* app/channel.h: use enum for channel undo type, not just magic
numbers.
* app/layer.h: same for layer undos.
* app/commands.c: edit_show_undo_history_cmd_callback() function to
pull up undo history window.
* app/commands.h: prototype for above.
* app/gdisplay.c: make undo / redo menu items sensitive according
to whether they would do anything. Would be easy to change
the text to say what would be undone/redone, but I don't know
the GTK.
* app/gimpimage.c: new signal emitted by gimage:
UNDO_EVENT. gimp_image_undo_event() function to emit it.
* app/gimpimage.h: prototype for above.
* app/gimpimageP.h: pushing_undo_group member is now an undo_type,
not an int. Keep undo history widget here too (if created).
* app/menus.c: add "Edit/Undo history..." to image menu.
* app/undo.c: new types: enums undo_type and undo_state rather than
ints and magic numbers. All undo_pop_* and undo_free_*
functions made static. New static function
undo_type_to_name(). Issue undo event signals on various
important events (eg undo pushed, undo popped etc).
undo_push() now takes a "dirties_image" arg to say whether
image should be dirtied. Layer moves now dirty the image. A
couple of g_return_if_fails () on undo_pop and undo_redo to
assert we're not in the middle of an undo group.
undo_get_{undo,redo}_name() to peek at names of top items on
undo and redo stacks resp. undo_map_over_{undo,redo}_stack()
to run a function for each item or group on stack. Layer and
channel undos use symbolic names rather than 0 or 1. Array
mapping undo types to names.
* app/undo.h: split out undo types to undo_types.h. Prototypes
for functions described above. undo_event_t enum.
undo_history_new() prototype lives here too.
Random other fixes:
* app/gimpdrawable.c
* app/image_render.c: default labels in switches to keep egcs happy.
* app/nav_window.c: some fixes to (sort of) cope with image res !=
screen res. Still needs work to handle non-square pixels
properly.
* app/paths_dialog.c: bad idea to call gimp_image_dirty()
directly. Even though it's currently commented out.
1999-09-21 01:15:20 +08:00
|
|
|
void
|
1999-11-20 20:12:41 +08:00
|
|
|
edit_named_paste_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
Honest, guv, it's not a feature - it's a tightly integrated package of
Mon Sep 20 12:51:30 EDT 1999 Austin Donnelly <austin@gimp.org>
Honest, guv, it's not a feature - it's a tightly integrated
package of undo system cleanups and fixes.
NEW FILES:
* app/undo_history.c: window showing recent undo (and redo) steps
available.
* app/undo_types.h: broken out of undo.h to fix circular includes.
MODIFIED FILES:
* app/Makefile.am: compile undo_history.c
* app/channel.h: use enum for channel undo type, not just magic
numbers.
* app/layer.h: same for layer undos.
* app/commands.c: edit_show_undo_history_cmd_callback() function to
pull up undo history window.
* app/commands.h: prototype for above.
* app/gdisplay.c: make undo / redo menu items sensitive according
to whether they would do anything. Would be easy to change
the text to say what would be undone/redone, but I don't know
the GTK.
* app/gimpimage.c: new signal emitted by gimage:
UNDO_EVENT. gimp_image_undo_event() function to emit it.
* app/gimpimage.h: prototype for above.
* app/gimpimageP.h: pushing_undo_group member is now an undo_type,
not an int. Keep undo history widget here too (if created).
* app/menus.c: add "Edit/Undo history..." to image menu.
* app/undo.c: new types: enums undo_type and undo_state rather than
ints and magic numbers. All undo_pop_* and undo_free_*
functions made static. New static function
undo_type_to_name(). Issue undo event signals on various
important events (eg undo pushed, undo popped etc).
undo_push() now takes a "dirties_image" arg to say whether
image should be dirtied. Layer moves now dirty the image. A
couple of g_return_if_fails () on undo_pop and undo_redo to
assert we're not in the middle of an undo group.
undo_get_{undo,redo}_name() to peek at names of top items on
undo and redo stacks resp. undo_map_over_{undo,redo}_stack()
to run a function for each item or group on stack. Layer and
channel undos use symbolic names rather than 0 or 1. Array
mapping undo types to names.
* app/undo.h: split out undo types to undo_types.h. Prototypes
for functions described above. undo_event_t enum.
undo_history_new() prototype lives here too.
Random other fixes:
* app/gimpdrawable.c
* app/image_render.c: default labels in switches to keep egcs happy.
* app/nav_window.c: some fixes to (sort of) cope with image res !=
screen res. Still needs work to handle non-square pixels
properly.
* app/paths_dialog.c: bad idea to call gimp_image_dirty()
directly. Even though it's currently commented out.
1999-09-21 01:15:20 +08:00
|
|
|
{
|
2000-02-10 08:00:54 +08:00
|
|
|
GDisplay *gdisp;
|
Honest, guv, it's not a feature - it's a tightly integrated package of
Mon Sep 20 12:51:30 EDT 1999 Austin Donnelly <austin@gimp.org>
Honest, guv, it's not a feature - it's a tightly integrated
package of undo system cleanups and fixes.
NEW FILES:
* app/undo_history.c: window showing recent undo (and redo) steps
available.
* app/undo_types.h: broken out of undo.h to fix circular includes.
MODIFIED FILES:
* app/Makefile.am: compile undo_history.c
* app/channel.h: use enum for channel undo type, not just magic
numbers.
* app/layer.h: same for layer undos.
* app/commands.c: edit_show_undo_history_cmd_callback() function to
pull up undo history window.
* app/commands.h: prototype for above.
* app/gdisplay.c: make undo / redo menu items sensitive according
to whether they would do anything. Would be easy to change
the text to say what would be undone/redone, but I don't know
the GTK.
* app/gimpimage.c: new signal emitted by gimage:
UNDO_EVENT. gimp_image_undo_event() function to emit it.
* app/gimpimage.h: prototype for above.
* app/gimpimageP.h: pushing_undo_group member is now an undo_type,
not an int. Keep undo history widget here too (if created).
* app/menus.c: add "Edit/Undo history..." to image menu.
* app/undo.c: new types: enums undo_type and undo_state rather than
ints and magic numbers. All undo_pop_* and undo_free_*
functions made static. New static function
undo_type_to_name(). Issue undo event signals on various
important events (eg undo pushed, undo popped etc).
undo_push() now takes a "dirties_image" arg to say whether
image should be dirtied. Layer moves now dirty the image. A
couple of g_return_if_fails () on undo_pop and undo_redo to
assert we're not in the middle of an undo group.
undo_get_{undo,redo}_name() to peek at names of top items on
undo and redo stacks resp. undo_map_over_{undo,redo}_stack()
to run a function for each item or group on stack. Layer and
channel undos use symbolic names rather than 0 or 1. Array
mapping undo types to names.
* app/undo.h: split out undo types to undo_types.h. Prototypes
for functions described above. undo_event_t enum.
undo_history_new() prototype lives here too.
Random other fixes:
* app/gimpdrawable.c
* app/image_render.c: default labels in switches to keep egcs happy.
* app/nav_window.c: some fixes to (sort of) cope with image res !=
screen res. Still needs work to handle non-square pixels
properly.
* app/paths_dialog.c: bad idea to call gimp_image_dirty()
directly. Even though it's currently commented out.
1999-09-21 01:15:20 +08:00
|
|
|
return_if_no_display (gdisp);
|
|
|
|
|
1999-11-20 20:12:41 +08:00
|
|
|
named_edit_paste (gdisp);
|
Honest, guv, it's not a feature - it's a tightly integrated package of
Mon Sep 20 12:51:30 EDT 1999 Austin Donnelly <austin@gimp.org>
Honest, guv, it's not a feature - it's a tightly integrated
package of undo system cleanups and fixes.
NEW FILES:
* app/undo_history.c: window showing recent undo (and redo) steps
available.
* app/undo_types.h: broken out of undo.h to fix circular includes.
MODIFIED FILES:
* app/Makefile.am: compile undo_history.c
* app/channel.h: use enum for channel undo type, not just magic
numbers.
* app/layer.h: same for layer undos.
* app/commands.c: edit_show_undo_history_cmd_callback() function to
pull up undo history window.
* app/commands.h: prototype for above.
* app/gdisplay.c: make undo / redo menu items sensitive according
to whether they would do anything. Would be easy to change
the text to say what would be undone/redone, but I don't know
the GTK.
* app/gimpimage.c: new signal emitted by gimage:
UNDO_EVENT. gimp_image_undo_event() function to emit it.
* app/gimpimage.h: prototype for above.
* app/gimpimageP.h: pushing_undo_group member is now an undo_type,
not an int. Keep undo history widget here too (if created).
* app/menus.c: add "Edit/Undo history..." to image menu.
* app/undo.c: new types: enums undo_type and undo_state rather than
ints and magic numbers. All undo_pop_* and undo_free_*
functions made static. New static function
undo_type_to_name(). Issue undo event signals on various
important events (eg undo pushed, undo popped etc).
undo_push() now takes a "dirties_image" arg to say whether
image should be dirtied. Layer moves now dirty the image. A
couple of g_return_if_fails () on undo_pop and undo_redo to
assert we're not in the middle of an undo group.
undo_get_{undo,redo}_name() to peek at names of top items on
undo and redo stacks resp. undo_map_over_{undo,redo}_stack()
to run a function for each item or group on stack. Layer and
channel undos use symbolic names rather than 0 or 1. Array
mapping undo types to names.
* app/undo.h: split out undo types to undo_types.h. Prototypes
for functions described above. undo_event_t enum.
undo_history_new() prototype lives here too.
Random other fixes:
* app/gimpdrawable.c
* app/image_render.c: default labels in switches to keep egcs happy.
* app/nav_window.c: some fixes to (sort of) cope with image res !=
screen res. Still needs work to handle non-square pixels
properly.
* app/paths_dialog.c: bad idea to call gimp_image_dirty()
directly. Even though it's currently commented out.
1999-09-21 01:15:20 +08:00
|
|
|
}
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
void
|
1999-11-20 20:12:41 +08:00
|
|
|
edit_clear_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-02-10 08:00:54 +08:00
|
|
|
GDisplay *gdisp;
|
1999-06-20 21:53:15 +08:00
|
|
|
return_if_no_display (gdisp);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-12-29 23:22:01 +08:00
|
|
|
edit_clear (gdisp->gimage, gimp_image_active_drawable (gdisp->gimage));
|
1999-11-20 20:12:41 +08:00
|
|
|
gdisplays_flush ();
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1999-11-20 20:12:41 +08:00
|
|
|
edit_fill_cmd_callback (GtkWidget *widget,
|
2000-03-24 22:54:59 +08:00
|
|
|
gpointer callback_data,
|
|
|
|
guint callback_action)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-03-24 22:54:59 +08:00
|
|
|
GimpFillType fill_type;
|
2000-02-10 08:00:54 +08:00
|
|
|
GDisplay *gdisp;
|
1999-06-20 21:53:15 +08:00
|
|
|
return_if_no_display (gdisp);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-03-24 22:54:59 +08:00
|
|
|
fill_type = (GimpFillType) callback_action;
|
2000-12-29 23:22:01 +08:00
|
|
|
edit_fill (gdisp->gimage, gimp_image_active_drawable (gdisp->gimage),
|
|
|
|
fill_type);
|
1999-11-20 20:12:41 +08:00
|
|
|
gdisplays_flush ();
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1999-11-20 20:12:41 +08:00
|
|
|
edit_stroke_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-02-10 08:00:54 +08:00
|
|
|
GDisplay *gdisp;
|
1999-06-20 21:53:15 +08:00
|
|
|
return_if_no_display (gdisp);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-12-29 23:22:01 +08:00
|
|
|
gimage_mask_stroke (gdisp->gimage, gimp_image_active_drawable (gdisp->gimage));
|
1999-11-20 20:12:41 +08:00
|
|
|
gdisplays_flush ();
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
1999-11-20 20:12:41 +08:00
|
|
|
/***** Select *****/
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
void
|
|
|
|
select_invert_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
|
|
|
{
|
2000-02-10 08:00:54 +08:00
|
|
|
GDisplay *gdisp;
|
1999-06-20 21:53:15 +08:00
|
|
|
return_if_no_display (gdisp);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
gimage_mask_invert (gdisp->gimage);
|
|
|
|
gdisplays_flush ();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
select_all_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
|
|
|
{
|
2000-02-10 08:00:54 +08:00
|
|
|
GDisplay *gdisp;
|
1999-06-20 21:53:15 +08:00
|
|
|
return_if_no_display (gdisp);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
gimage_mask_all (gdisp->gimage);
|
|
|
|
gdisplays_flush ();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
select_none_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
|
|
|
{
|
2000-02-10 08:00:54 +08:00
|
|
|
GDisplay *gdisp;
|
1999-06-20 21:53:15 +08:00
|
|
|
return_if_no_display (gdisp);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
gimage_mask_none (gdisp->gimage);
|
|
|
|
gdisplays_flush ();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
select_float_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
|
|
|
{
|
2000-02-10 08:00:54 +08:00
|
|
|
GDisplay *gdisp;
|
1999-06-20 21:53:15 +08:00
|
|
|
return_if_no_display (gdisp);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-12-29 23:22:01 +08:00
|
|
|
gimage_mask_float (gdisp->gimage, gimp_image_active_drawable (gdisp->gimage),
|
1999-06-20 21:53:15 +08:00
|
|
|
0, 0);
|
1997-11-25 06:05:25 +08:00
|
|
|
gdisplays_flush ();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
select_feather_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
|
|
|
{
|
1999-09-28 01:58:10 +08:00
|
|
|
GtkWidget *qbox;
|
|
|
|
GDisplay *gdisp;
|
|
|
|
|
1999-06-20 21:53:15 +08:00
|
|
|
return_if_no_display (gdisp);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-09-28 01:58:10 +08:00
|
|
|
qbox = gimp_query_size_box (_("Feather Selection"),
|
|
|
|
gimp_standard_help_func,
|
1999-10-03 21:50:19 +08:00
|
|
|
"dialogs/feather_selection.html",
|
2000-02-10 08:00:54 +08:00
|
|
|
_("Feather Selection by:"),
|
1999-09-28 01:58:10 +08:00
|
|
|
selection_feather_radius, 0, 32767, 3,
|
|
|
|
gdisp->gimage->unit,
|
|
|
|
MIN (gdisp->gimage->xresolution,
|
|
|
|
gdisp->gimage->yresolution),
|
|
|
|
gdisp->dot_for_dot,
|
|
|
|
GTK_OBJECT (gdisp->gimage), "destroy",
|
|
|
|
gimage_mask_feather_callback, gdisp->gimage);
|
|
|
|
gtk_widget_show (qbox);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1999-11-20 20:12:41 +08:00
|
|
|
select_sharpen_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-02-10 08:00:54 +08:00
|
|
|
GDisplay *gdisp;
|
1999-06-20 21:53:15 +08:00
|
|
|
return_if_no_display (gdisp);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-11-20 20:12:41 +08:00
|
|
|
gimage_mask_sharpen (gdisp->gimage);
|
|
|
|
gdisplays_flush ();
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
select_shrink_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_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
|
|
|
GtkWidget *edge_lock;
|
|
|
|
GtkWidget *shrink_dialog;
|
|
|
|
|
2000-02-10 08:00:54 +08:00
|
|
|
GDisplay *gdisp;
|
1999-06-20 21:53:15 +08:00
|
|
|
return_if_no_display (gdisp);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-09-28 01:58:10 +08:00
|
|
|
shrink_dialog =
|
|
|
|
gimp_query_size_box (N_("Shrink Selection"),
|
|
|
|
gimp_standard_help_func,
|
1999-10-03 21:50:19 +08:00
|
|
|
"dialogs/shrink_selection.html",
|
2000-02-10 08:00:54 +08:00
|
|
|
_("Shrink Selection by:"),
|
1999-09-28 01:58:10 +08:00
|
|
|
selection_shrink_pixels, 1, 32767, 0,
|
|
|
|
gdisp->gimage->unit,
|
|
|
|
MIN (gdisp->gimage->xresolution,
|
|
|
|
gdisp->gimage->yresolution),
|
|
|
|
gdisp->dot_for_dot,
|
|
|
|
GTK_OBJECT (gdisp->gimage), "destroy",
|
|
|
|
gimage_mask_shrink_callback, gdisp->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
|
|
|
|
|
|
|
edge_lock = gtk_check_button_new_with_label (_("Shrink from image border"));
|
|
|
|
/* eeek */
|
|
|
|
gtk_box_pack_start (GTK_BOX (g_list_nth_data (gtk_container_children (GTK_CONTAINER (GTK_DIALOG (shrink_dialog)->vbox)), 0)), edge_lock,
|
|
|
|
FALSE, FALSE, 0);
|
|
|
|
gtk_object_set_data (GTK_OBJECT (shrink_dialog), "edge_lock_toggle",
|
|
|
|
edge_lock);
|
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (edge_lock),
|
|
|
|
! selection_shrink_edge_lock);
|
|
|
|
gtk_widget_show (edge_lock);
|
|
|
|
|
|
|
|
gtk_widget_show (shrink_dialog);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1999-11-20 20:12:41 +08:00
|
|
|
select_grow_cmd_callback (GtkWidget *widget,
|
1997-11-25 06:05:25 +08:00
|
|
|
gpointer client_data)
|
|
|
|
{
|
1999-11-20 20:12:41 +08:00
|
|
|
GtkWidget *qbox;
|
|
|
|
GDisplay *gdisp;
|
|
|
|
|
1999-06-20 21:53:15 +08:00
|
|
|
return_if_no_display (gdisp);
|
|
|
|
|
1999-11-20 20:12:41 +08:00
|
|
|
qbox = gimp_query_size_box (_("Grow Selection"),
|
|
|
|
gimp_standard_help_func,
|
|
|
|
"dialogs/grow_selection.html",
|
2000-02-10 08:00:54 +08:00
|
|
|
_("Grow Selection by:"),
|
1999-11-20 20:12:41 +08:00
|
|
|
selection_grow_pixels, 1, 32767, 0,
|
|
|
|
gdisp->gimage->unit,
|
|
|
|
MIN (gdisp->gimage->xresolution,
|
|
|
|
gdisp->gimage->yresolution),
|
|
|
|
gdisp->dot_for_dot,
|
|
|
|
GTK_OBJECT (gdisp->gimage), "destroy",
|
|
|
|
gimage_mask_grow_callback, gdisp->gimage);
|
|
|
|
gtk_widget_show (qbox);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
1998-12-06 05:48:37 +08:00
|
|
|
void
|
1999-11-20 20:12:41 +08:00
|
|
|
select_border_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
1998-12-06 05:48:37 +08:00
|
|
|
{
|
1999-11-20 20:12:41 +08:00
|
|
|
GtkWidget *qbox;
|
|
|
|
GDisplay *gdisp;
|
|
|
|
|
1999-06-20 21:53:15 +08:00
|
|
|
return_if_no_display (gdisp);
|
1998-12-06 05:48:37 +08:00
|
|
|
|
1999-11-20 20:12:41 +08:00
|
|
|
qbox = gimp_query_size_box (_("Border Selection"),
|
|
|
|
gimp_standard_help_func,
|
|
|
|
"dialogs/border_selection.html",
|
2000-02-10 08:00:54 +08:00
|
|
|
_("Border Selection by:"),
|
1999-11-20 20:12:41 +08:00
|
|
|
selection_border_radius, 1, 32767, 0,
|
|
|
|
gdisp->gimage->unit,
|
|
|
|
MIN (gdisp->gimage->xresolution,
|
|
|
|
gdisp->gimage->yresolution),
|
|
|
|
gdisp->dot_for_dot,
|
|
|
|
GTK_OBJECT (gdisp->gimage), "destroy",
|
|
|
|
gimage_mask_border_callback, gdisp->gimage);
|
|
|
|
gtk_widget_show (qbox);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
select_save_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
|
|
|
{
|
2000-02-10 08:00:54 +08:00
|
|
|
GDisplay *gdisp;
|
1999-11-20 20:12:41 +08:00
|
|
|
return_if_no_display (gdisp);
|
|
|
|
|
|
|
|
gimage_mask_save (gdisp->gimage);
|
|
|
|
gdisplays_flush ();
|
1998-12-06 05:48:37 +08:00
|
|
|
}
|
|
|
|
|
1999-11-20 20:12:41 +08:00
|
|
|
/***** View *****/
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
void
|
|
|
|
view_zoomin_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
|
|
|
{
|
|
|
|
GDisplay *gdisp;
|
1999-06-20 21:53:15 +08:00
|
|
|
return_if_no_display (gdisp);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
change_scale (gdisp, ZOOMIN);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
view_zoomout_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
|
|
|
{
|
|
|
|
GDisplay *gdisp;
|
1999-06-20 21:53:15 +08:00
|
|
|
return_if_no_display (gdisp);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
change_scale (gdisp, ZOOMOUT);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
view_zoom_val (GtkWidget *widget,
|
|
|
|
gpointer client_data,
|
|
|
|
int val)
|
|
|
|
{
|
|
|
|
GDisplay *gdisp;
|
1999-06-20 21:53:15 +08:00
|
|
|
return_if_no_display (gdisp);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
change_scale (gdisp, val);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1999-11-20 20:12:41 +08:00
|
|
|
view_zoom_16_1_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
view_zoom_val (widget, client_data, 1601);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1999-11-20 20:12:41 +08:00
|
|
|
view_zoom_8_1_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
view_zoom_val (widget, client_data, 801);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1999-11-20 20:12:41 +08:00
|
|
|
view_zoom_4_1_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
view_zoom_val (widget, client_data, 401);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1999-11-20 20:12:41 +08:00
|
|
|
view_zoom_2_1_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
view_zoom_val (widget, client_data, 201);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1999-11-20 20:12:41 +08:00
|
|
|
view_zoom_1_1_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
view_zoom_val (widget, client_data, 101);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1999-11-20 20:12:41 +08:00
|
|
|
view_zoom_1_2_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
view_zoom_val (widget, client_data, 102);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1999-11-20 20:12:41 +08:00
|
|
|
view_zoom_1_4_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
view_zoom_val (widget, client_data, 104);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1999-11-20 20:12:41 +08:00
|
|
|
view_zoom_1_8_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
view_zoom_val (widget, client_data, 108);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1999-11-20 20:12:41 +08:00
|
|
|
view_zoom_1_16_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
view_zoom_val (widget, client_data, 116);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1999-11-20 20:12:41 +08:00
|
|
|
view_dot_for_dot_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
|
|
|
{
|
|
|
|
GDisplay *gdisp;
|
|
|
|
return_if_no_display (gdisp);
|
|
|
|
|
|
|
|
gdisplay_set_dot_for_dot (gdisp, GTK_CHECK_MENU_ITEM (widget)->active);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
view_info_window_cmd_callback (GtkWidget *widget,
|
1997-11-25 06:05:25 +08:00
|
|
|
gpointer client_data)
|
|
|
|
{
|
2000-02-10 08:00:54 +08:00
|
|
|
GDisplay *gdisp;
|
1999-06-20 21:53:15 +08:00
|
|
|
return_if_no_display (gdisp);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-11-30 08:11:08 +08:00
|
|
|
if (!info_window_follows_mouse)
|
|
|
|
{
|
|
|
|
if (! gdisp->window_info_dialog)
|
|
|
|
gdisp->window_info_dialog = info_window_create ((void *) gdisp);
|
|
|
|
info_window_update(gdisp);
|
|
|
|
info_dialog_popup (gdisp->window_info_dialog);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
info_window_follow_auto();
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
}
|
|
|
|
|
1999-08-13 06:21:04 +08:00
|
|
|
void
|
1999-11-20 20:12:41 +08:00
|
|
|
view_nav_window_cmd_callback (GtkWidget *widget,
|
1999-08-13 06:21:04 +08:00
|
|
|
gpointer client_data)
|
|
|
|
{
|
2000-02-10 08:00:54 +08:00
|
|
|
GDisplay *gdisp;
|
1999-08-13 06:21:04 +08:00
|
|
|
return_if_no_display (gdisp);
|
|
|
|
|
1999-11-20 20:12:41 +08:00
|
|
|
if (nav_window_per_display)
|
1999-11-20 08:46:58 +08:00
|
|
|
{
|
|
|
|
if (! gdisp->window_nav_dialog)
|
|
|
|
gdisp->window_nav_dialog = nav_window_create ((void *) gdisp);
|
1999-08-13 06:21:04 +08:00
|
|
|
|
1999-11-20 08:46:58 +08:00
|
|
|
nav_dialog_popup (gdisp->window_nav_dialog);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
1999-11-20 20:12:41 +08:00
|
|
|
nav_window_follow_auto ();
|
1999-11-20 08:46:58 +08:00
|
|
|
}
|
1999-08-13 06:21:04 +08:00
|
|
|
}
|
|
|
|
|
1999-06-22 06:12:07 +08:00
|
|
|
void
|
|
|
|
view_toggle_selection_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
|
|
|
{
|
2000-02-10 08:00:54 +08:00
|
|
|
GDisplay *gdisp;
|
|
|
|
gint new_val;
|
1999-07-03 01:40:10 +08:00
|
|
|
|
1999-06-22 06:12:07 +08:00
|
|
|
return_if_no_display (gdisp);
|
|
|
|
|
1999-07-03 01:40:10 +08:00
|
|
|
new_val = GTK_CHECK_MENU_ITEM (widget)->active;
|
|
|
|
|
|
|
|
/* hidden == TRUE corresponds to the menu toggle being FALSE */
|
|
|
|
if (new_val == gdisp->select->hidden)
|
|
|
|
{
|
|
|
|
selection_hide (gdisp->select, (void *) gdisp);
|
|
|
|
gdisplays_flush ();
|
|
|
|
}
|
1999-06-22 06:12:07 +08:00
|
|
|
}
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
void
|
|
|
|
view_toggle_rulers_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
|
|
|
{
|
2000-02-10 08:00:54 +08:00
|
|
|
GDisplay *gdisp;
|
1999-06-20 21:53:15 +08:00
|
|
|
return_if_no_display (gdisp);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
if (!GTK_CHECK_MENU_ITEM (widget)->active)
|
|
|
|
{
|
|
|
|
if (GTK_WIDGET_VISIBLE (gdisp->origin))
|
|
|
|
{
|
1999-11-20 20:12:41 +08:00
|
|
|
gtk_widget_hide (gdisp->origin);
|
|
|
|
gtk_widget_hide (gdisp->hrule);
|
|
|
|
gtk_widget_hide (gdisp->vrule);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (gdisp->origin->parent));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (!GTK_WIDGET_VISIBLE (gdisp->origin))
|
|
|
|
{
|
1999-11-20 20:12:41 +08:00
|
|
|
gtk_widget_show (gdisp->origin);
|
|
|
|
gtk_widget_show (gdisp->hrule);
|
|
|
|
gtk_widget_show (gdisp->vrule);
|
1999-07-09 08:35:33 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (gdisp->origin->parent));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1999-11-20 20:12:41 +08:00
|
|
|
void
|
|
|
|
view_toggle_statusbar_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
|
|
|
{
|
2000-02-10 08:00:54 +08:00
|
|
|
GDisplay *gdisp;
|
1999-11-20 20:12:41 +08:00
|
|
|
return_if_no_display (gdisp);
|
|
|
|
|
|
|
|
if (!GTK_CHECK_MENU_ITEM (widget)->active)
|
|
|
|
{
|
|
|
|
if (GTK_WIDGET_VISIBLE (gdisp->statusarea))
|
|
|
|
gtk_widget_hide (gdisp->statusarea);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (!GTK_WIDGET_VISIBLE (gdisp->statusarea))
|
|
|
|
gtk_widget_show (gdisp->statusarea);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
void
|
|
|
|
view_toggle_guides_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
|
|
|
{
|
2000-02-10 08:00:54 +08:00
|
|
|
GDisplay *gdisp;
|
|
|
|
gint old_val;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-06-20 21:53:15 +08:00
|
|
|
return_if_no_display (gdisp);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
old_val = gdisp->draw_guides;
|
|
|
|
gdisp->draw_guides = GTK_CHECK_MENU_ITEM (widget)->active;
|
|
|
|
|
|
|
|
if ((old_val != gdisp->draw_guides) && gdisp->gimage->guides)
|
|
|
|
{
|
|
|
|
gdisplay_expose_full (gdisp);
|
|
|
|
gdisplays_flush ();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
view_snap_to_guides_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
|
|
|
{
|
2000-02-10 08:00:54 +08:00
|
|
|
GDisplay *gdisp;
|
1999-06-20 21:53:15 +08:00
|
|
|
return_if_no_display (gdisp);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
gdisp->snap_to_guides = GTK_CHECK_MENU_ITEM (widget)->active;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
view_new_view_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
|
|
|
{
|
|
|
|
GDisplay *gdisp;
|
1999-06-20 21:53:15 +08:00
|
|
|
return_if_no_display (gdisp);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
gdisplay_new_view (gdisp);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
view_shrink_wrap_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
|
|
|
{
|
|
|
|
GDisplay *gdisp;
|
1999-06-20 21:53:15 +08:00
|
|
|
return_if_no_display (gdisp);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-06-20 21:53:15 +08:00
|
|
|
shrink_wrap_display (gdisp);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
1999-11-20 20:12:41 +08:00
|
|
|
/***** Image *****/
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
void
|
1999-11-20 20:12:41 +08:00
|
|
|
image_convert_rgb_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-02-10 08:00:54 +08:00
|
|
|
GDisplay *gdisp;
|
1999-06-20 21:53:15 +08:00
|
|
|
return_if_no_display (gdisp);
|
|
|
|
|
1999-11-20 20:12:41 +08:00
|
|
|
convert_to_rgb (gdisp->gimage);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1999-11-20 20:12:41 +08:00
|
|
|
image_convert_grayscale_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-02-10 08:00:54 +08:00
|
|
|
GDisplay *gdisp;
|
1999-06-20 21:53:15 +08:00
|
|
|
return_if_no_display (gdisp);
|
|
|
|
|
1999-11-20 20:12:41 +08:00
|
|
|
convert_to_grayscale (gdisp->gimage);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1999-11-20 20:12:41 +08:00
|
|
|
image_convert_indexed_cmd_callback (GtkWidget *widget,
|
1999-07-27 10:41:34 +08:00
|
|
|
gpointer client_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-02-10 08:00:54 +08:00
|
|
|
GDisplay *gdisp;
|
1999-06-20 21:53:15 +08:00
|
|
|
return_if_no_display (gdisp);
|
|
|
|
|
1999-11-20 20:12:41 +08:00
|
|
|
convert_to_indexed (gdisp->gimage);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1999-11-20 20:12:41 +08:00
|
|
|
image_desaturate_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-02-10 08:00:54 +08:00
|
|
|
GDisplay *gdisp;
|
1999-06-20 21:53:15 +08:00
|
|
|
return_if_no_display (gdisp);
|
|
|
|
|
1999-11-20 20:12:41 +08:00
|
|
|
image_desaturate (gdisp->gimage);
|
|
|
|
gdisplays_flush ();
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1999-11-20 20:12:41 +08:00
|
|
|
image_invert_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-02-10 08:00:54 +08:00
|
|
|
GDisplay *gdisp;
|
1999-06-20 21:53:15 +08:00
|
|
|
return_if_no_display (gdisp);
|
|
|
|
|
1999-11-20 20:12:41 +08:00
|
|
|
image_invert (gdisp->gimage);
|
|
|
|
gdisplays_flush ();
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1999-11-20 20:12:41 +08:00
|
|
|
image_equalize_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
1999-11-20 20:12:41 +08:00
|
|
|
GDisplay *gdisp;
|
1999-06-20 21:53:15 +08:00
|
|
|
return_if_no_display (gdisp);
|
|
|
|
|
1999-11-20 20:12:41 +08:00
|
|
|
image_equalize (gdisp->gimage);
|
|
|
|
gdisplays_flush ();
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1999-11-20 20:12:41 +08:00
|
|
|
image_offset_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-02-10 08:00:54 +08:00
|
|
|
GDisplay *gdisp;
|
1999-06-20 21:53:15 +08:00
|
|
|
return_if_no_display (gdisp);
|
|
|
|
|
1999-11-20 20:12:41 +08:00
|
|
|
channel_ops_offset (gdisp->gimage);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
image_resize_cmd_callback (GtkWidget *widget,
|
1999-07-27 10:41:34 +08:00
|
|
|
gpointer client_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-02-10 08:00:54 +08:00
|
|
|
GDisplay *gdisp;
|
|
|
|
GimpImage *gimage;
|
|
|
|
ImageResize *image_resize;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-06-20 21:53:15 +08:00
|
|
|
return_if_no_display (gdisp);
|
1999-02-15 05:09:55 +08:00
|
|
|
|
|
|
|
gimage = gdisp->gimage;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* the ImageResize structure */
|
1999-07-27 10:41:34 +08:00
|
|
|
image_resize = g_new (ImageResize, 1);
|
1999-02-15 05:09:55 +08:00
|
|
|
image_resize->gimage = gimage;
|
|
|
|
image_resize->resize = resize_widget_new (ResizeWidget,
|
|
|
|
ResizeImage,
|
|
|
|
GTK_OBJECT (gimage),
|
2000-04-06 10:13:18 +08:00
|
|
|
"destroy",
|
1999-02-15 05:09:55 +08:00
|
|
|
gimage->width,
|
|
|
|
gimage->height,
|
|
|
|
gimage->xresolution,
|
|
|
|
gimage->yresolution,
|
1999-05-02 22:24:54 +08:00
|
|
|
gimage->unit,
|
|
|
|
gdisp->dot_for_dot,
|
1999-02-15 05:09:55 +08:00
|
|
|
image_resize_callback,
|
2000-04-06 10:13:18 +08:00
|
|
|
NULL,
|
1999-02-15 05:09:55 +08:00
|
|
|
image_resize);
|
1999-02-14 09:53:23 +08:00
|
|
|
|
2000-04-06 10:13:18 +08:00
|
|
|
gtk_signal_connect_object (GTK_OBJECT (image_resize->resize->resize_shell),
|
|
|
|
"destroy",
|
|
|
|
GTK_SIGNAL_FUNC (g_free),
|
|
|
|
(GtkObject *) image_resize);
|
|
|
|
|
1999-02-15 05:09:55 +08:00
|
|
|
gtk_widget_show (image_resize->resize->resize_shell);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
image_scale_cmd_callback (GtkWidget *widget,
|
1999-07-27 10:41:34 +08:00
|
|
|
gpointer client_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-02-10 08:00:54 +08:00
|
|
|
GDisplay *gdisp;
|
|
|
|
GimpImage *gimage;
|
|
|
|
ImageResize *image_scale;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-06-20 21:53:15 +08:00
|
|
|
return_if_no_display (gdisp);
|
1999-02-15 05:09:55 +08:00
|
|
|
|
|
|
|
gimage = gdisp->gimage;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* the ImageResize structure */
|
1999-07-27 10:41:34 +08:00
|
|
|
image_scale = g_new (ImageResize, 1);
|
1999-02-15 05:09:55 +08:00
|
|
|
image_scale->gimage = gimage;
|
|
|
|
image_scale->resize = resize_widget_new (ScaleWidget,
|
|
|
|
ResizeImage,
|
|
|
|
GTK_OBJECT (gimage),
|
2000-04-06 10:13:18 +08:00
|
|
|
"destroy",
|
1999-02-15 05:09:55 +08:00
|
|
|
gimage->width,
|
|
|
|
gimage->height,
|
|
|
|
gimage->xresolution,
|
|
|
|
gimage->yresolution,
|
1999-05-02 22:24:54 +08:00
|
|
|
gimage->unit,
|
|
|
|
gdisp->dot_for_dot,
|
1999-02-15 05:09:55 +08:00
|
|
|
image_scale_callback,
|
2000-04-06 10:13:18 +08:00
|
|
|
NULL,
|
1999-02-15 05:09:55 +08:00
|
|
|
image_scale);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-04-06 10:13:18 +08:00
|
|
|
gtk_signal_connect_object (GTK_OBJECT (image_scale->resize->resize_shell),
|
|
|
|
"destroy",
|
|
|
|
GTK_SIGNAL_FUNC (g_free),
|
|
|
|
(GtkObject *) image_scale);
|
|
|
|
|
1999-02-15 05:09:55 +08:00
|
|
|
gtk_widget_show (image_scale->resize->resize_shell);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
1999-11-20 20:12:41 +08:00
|
|
|
void
|
|
|
|
image_duplicate_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
|
|
|
{
|
2000-02-10 08:00:54 +08:00
|
|
|
GDisplay *gdisp;
|
1999-11-20 20:12:41 +08:00
|
|
|
return_if_no_display (gdisp);
|
|
|
|
|
|
|
|
channel_ops_duplicate (gdisp->gimage);
|
|
|
|
}
|
|
|
|
|
|
|
|
/***** Layers *****/
|
|
|
|
|
1999-06-02 04:19:49 +08:00
|
|
|
void
|
|
|
|
layers_previous_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
|
|
|
{
|
2000-02-10 08:00:54 +08:00
|
|
|
GDisplay *gdisp;
|
|
|
|
Layer *new_layer;
|
|
|
|
gint current_layer;
|
1999-06-02 04:19:49 +08:00
|
|
|
|
1999-06-20 21:53:15 +08:00
|
|
|
return_if_no_display (gdisp);
|
1999-06-02 04:19:49 +08:00
|
|
|
|
|
|
|
current_layer =
|
2000-12-29 23:22:01 +08:00
|
|
|
gimp_image_get_layer_index (gdisp->gimage, gdisp->gimage->active_layer);
|
1999-06-02 04:19:49 +08:00
|
|
|
|
2000-12-29 23:22:01 +08:00
|
|
|
new_layer = gimp_image_get_layer_by_index (gdisp->gimage, current_layer - 1);
|
1999-06-02 04:19:49 +08:00
|
|
|
|
|
|
|
if (new_layer)
|
|
|
|
{
|
2000-12-29 23:22:01 +08:00
|
|
|
gimp_image_set_active_layer (gdisp->gimage, new_layer);
|
1999-06-02 04:19:49 +08:00
|
|
|
gdisplays_flush ();
|
2000-12-29 01:31:07 +08:00
|
|
|
layer_select_init (gdisp->gimage, 0, GDK_CURRENT_TIME);
|
1999-06-02 04:19:49 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
layers_next_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
|
|
|
{
|
2000-02-10 08:00:54 +08:00
|
|
|
GDisplay *gdisp;
|
|
|
|
Layer *new_layer;
|
|
|
|
gint current_layer;
|
1999-06-02 04:19:49 +08:00
|
|
|
|
1999-06-20 21:53:15 +08:00
|
|
|
return_if_no_display (gdisp);
|
1999-06-02 04:19:49 +08:00
|
|
|
|
|
|
|
current_layer =
|
2000-12-29 23:22:01 +08:00
|
|
|
gimp_image_get_layer_index (gdisp->gimage, gdisp->gimage->active_layer);
|
1999-06-02 04:19:49 +08:00
|
|
|
|
2000-12-29 23:22:01 +08:00
|
|
|
new_layer = gimp_image_get_layer_by_index (gdisp->gimage, current_layer + 1);
|
1999-06-02 04:19:49 +08:00
|
|
|
|
|
|
|
if (new_layer)
|
|
|
|
{
|
2000-12-29 23:22:01 +08:00
|
|
|
gimp_image_set_active_layer (gdisp->gimage, new_layer);
|
1999-06-02 04:19:49 +08:00
|
|
|
gdisplays_flush ();
|
2000-12-29 01:31:07 +08:00
|
|
|
layer_select_init (gdisp->gimage, 0, GDK_CURRENT_TIME);
|
1999-06-02 04:19:49 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
void
|
|
|
|
layers_raise_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
|
|
|
{
|
2000-02-10 08:00:54 +08:00
|
|
|
GDisplay *gdisp;
|
1999-06-20 21:53:15 +08:00
|
|
|
return_if_no_display (gdisp);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-12-29 23:22:01 +08:00
|
|
|
gimp_image_raise_layer (gdisp->gimage, gdisp->gimage->active_layer);
|
1997-11-25 06:05:25 +08:00
|
|
|
gdisplays_flush ();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
layers_lower_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
|
|
|
{
|
2000-02-10 08:00:54 +08:00
|
|
|
GDisplay *gdisp;
|
1999-06-20 21:53:15 +08:00
|
|
|
return_if_no_display (gdisp);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-12-29 23:22:01 +08:00
|
|
|
gimp_image_lower_layer (gdisp->gimage, gdisp->gimage->active_layer);
|
1997-11-25 06:05:25 +08:00
|
|
|
gdisplays_flush ();
|
|
|
|
}
|
|
|
|
|
1999-06-02 04:19:49 +08:00
|
|
|
void
|
|
|
|
layers_raise_to_top_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
|
|
|
{
|
2000-02-10 08:00:54 +08:00
|
|
|
GDisplay *gdisp;
|
1999-06-20 21:53:15 +08:00
|
|
|
return_if_no_display (gdisp);
|
1999-06-02 04:19:49 +08:00
|
|
|
|
2000-12-29 23:22:01 +08:00
|
|
|
gimp_image_raise_layer_to_top (gdisp->gimage, gdisp->gimage->active_layer);
|
1999-06-02 04:19:49 +08:00
|
|
|
gdisplays_flush ();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
layers_lower_to_bottom_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
|
|
|
{
|
2000-02-10 08:00:54 +08:00
|
|
|
GDisplay *gdisp;
|
1999-06-20 21:53:15 +08:00
|
|
|
return_if_no_display (gdisp);
|
1999-06-02 04:19:49 +08:00
|
|
|
|
2000-12-29 23:22:01 +08:00
|
|
|
gimp_image_lower_layer_to_bottom (gdisp->gimage, gdisp->gimage->active_layer);
|
1999-06-02 04:19:49 +08:00
|
|
|
gdisplays_flush ();
|
|
|
|
}
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
void
|
|
|
|
layers_anchor_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
|
|
|
{
|
2000-02-10 08:00:54 +08:00
|
|
|
GDisplay *gdisp;
|
1999-06-20 21:53:15 +08:00
|
|
|
return_if_no_display (gdisp);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-12-29 23:22:01 +08:00
|
|
|
floating_sel_anchor (gimp_image_get_active_layer (gdisp->gimage));
|
1997-11-25 06:05:25 +08:00
|
|
|
gdisplays_flush ();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
layers_merge_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
|
|
|
{
|
2000-02-10 08:00:54 +08:00
|
|
|
GDisplay *gdisp;
|
1999-06-20 21:53:15 +08:00
|
|
|
return_if_no_display (gdisp);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
layers_dialog_layer_merge_query (gdisp->gimage, TRUE);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
layers_flatten_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
|
|
|
{
|
2000-02-10 08:00:54 +08:00
|
|
|
GDisplay *gdisp;
|
1999-06-20 21:53:15 +08:00
|
|
|
return_if_no_display (gdisp);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-12-29 23:22:01 +08:00
|
|
|
gimp_image_flatten (gdisp->gimage);
|
1997-11-25 06:05:25 +08:00
|
|
|
gdisplays_flush ();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1999-11-20 20:12:41 +08:00
|
|
|
layers_mask_select_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-02-10 08:00:54 +08:00
|
|
|
GDisplay *gdisp;
|
1999-06-20 21:53:15 +08:00
|
|
|
return_if_no_display (gdisp);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-11-20 20:12:41 +08:00
|
|
|
gimage_mask_layer_mask (gdisp->gimage, gdisp->gimage->active_layer);
|
1997-11-25 06:05:25 +08:00
|
|
|
gdisplays_flush ();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1999-11-20 20:12:41 +08:00
|
|
|
layers_add_alpha_channel_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-02-10 08:00:54 +08:00
|
|
|
GDisplay *gdisp;
|
1999-06-20 21:53:15 +08:00
|
|
|
return_if_no_display (gdisp);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-11-20 20:12:41 +08:00
|
|
|
layer_add_alpha ( gdisp->gimage->active_layer);
|
1997-11-25 06:05:25 +08:00
|
|
|
gdisplays_flush ();
|
|
|
|
}
|
|
|
|
|
1998-04-03 19:58:04 +08:00
|
|
|
void
|
1999-11-20 20:12:41 +08:00
|
|
|
layers_alpha_select_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
1998-04-03 19:58:04 +08:00
|
|
|
{
|
2000-02-10 08:00:54 +08:00
|
|
|
GDisplay *gdisp;
|
1999-06-20 21:53:15 +08:00
|
|
|
return_if_no_display (gdisp);
|
1998-04-03 19:58:04 +08:00
|
|
|
|
1999-11-20 20:12:41 +08:00
|
|
|
gimage_mask_layer_alpha (gdisp->gimage, gdisp->gimage->active_layer);
|
1998-04-03 19:58:04 +08:00
|
|
|
gdisplays_flush ();
|
|
|
|
}
|
|
|
|
|
1999-11-27 22:00:26 +08:00
|
|
|
void
|
|
|
|
layers_resize_to_image_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
|
|
|
{
|
|
|
|
GDisplay *gdisp;
|
|
|
|
return_if_no_display (gdisp);
|
|
|
|
|
|
|
|
layer_resize_to_image (gdisp->gimage->active_layer);
|
|
|
|
gdisplays_flush ();
|
|
|
|
}
|
|
|
|
|
1999-11-20 20:12:41 +08:00
|
|
|
/***** Tools *****/
|
|
|
|
|
1998-03-02 03:38:25 +08:00
|
|
|
void
|
|
|
|
tools_default_colors_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
|
|
|
{
|
1999-10-27 02:27:27 +08:00
|
|
|
gimp_context_set_default_colors (gimp_context_get_user ());
|
1998-03-02 03:38:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
tools_swap_colors_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
|
|
|
{
|
1999-10-27 02:27:27 +08:00
|
|
|
gimp_context_swap_colors (gimp_context_get_user ());
|
1998-03-02 03:38:25 +08:00
|
|
|
}
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
void
|
1999-06-20 21:53:15 +08:00
|
|
|
tools_select_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer callback_data,
|
|
|
|
guint callback_action)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-12-31 12:07:42 +08:00
|
|
|
ToolType tool_type;
|
|
|
|
GDisplay *gdisp;
|
1999-06-21 07:29:34 +08:00
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
tool_type = (ToolType) callback_action;
|
2000-12-31 12:07:42 +08:00
|
|
|
gdisp = gdisplay_active ();
|
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
|
|
|
|
gimp_context_set_tool (gimp_context_get_user (), tool_type);
|
1999-06-22 06:12:07 +08:00
|
|
|
|
1999-06-26 19:16:47 +08:00
|
|
|
/* Paranoia */
|
|
|
|
active_tool->drawable = NULL;
|
|
|
|
|
1999-06-22 06:12:07 +08:00
|
|
|
/* Complete the initialisation by doing the same stuff
|
|
|
|
* tools_initialize() does after it did what tools_select() does
|
|
|
|
*/
|
1999-11-20 20:12:41 +08:00
|
|
|
if (tool_info[tool_type].init_func)
|
1998-06-22 04:17:21 +08:00
|
|
|
{
|
1999-11-20 20:12:41 +08:00
|
|
|
(* tool_info[tool_type].init_func) (gdisp);
|
1999-06-26 19:16:47 +08:00
|
|
|
|
2000-12-29 23:22:01 +08:00
|
|
|
active_tool->drawable = gimp_image_active_drawable (gdisp->gimage);
|
1998-06-22 04:17:21 +08:00
|
|
|
}
|
1999-06-26 19:16:47 +08:00
|
|
|
|
2000-12-31 12:07:42 +08:00
|
|
|
/* setting the tool->gdisp here is a HACK to allow the tools'
|
1999-06-26 19:16:47 +08:00
|
|
|
* dialog windows being hidden if the tool was selected from
|
|
|
|
* a tear-off-menu and there was no mouse click in the display
|
|
|
|
* before deleting it
|
|
|
|
*/
|
2000-12-31 12:07:42 +08:00
|
|
|
active_tool->gdisp = gdisp;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
1999-11-20 20:12:41 +08:00
|
|
|
/***** Filters *****/
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
void
|
1999-06-20 21:53:15 +08:00
|
|
|
filters_repeat_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer callback_data,
|
|
|
|
guint callback_action)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
1998-06-07 21:55:36 +08:00
|
|
|
plug_in_repeat (callback_action);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
1999-11-20 20:12:41 +08:00
|
|
|
/***** Dialogs ******/
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
void
|
1999-11-20 20:12:41 +08:00
|
|
|
dialogs_lc_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-02-10 08:00:54 +08:00
|
|
|
GDisplay *gdisp;
|
1999-11-20 20:12:41 +08:00
|
|
|
gdisp = gdisplay_active ();
|
|
|
|
|
|
|
|
lc_dialog_create (gdisp ? gdisp->gimage : NULL);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1999-11-20 20:12:41 +08:00
|
|
|
dialogs_tool_options_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
1999-11-20 20:12:41 +08:00
|
|
|
tool_options_dialog_show ();
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1999-11-20 20:12:41 +08:00
|
|
|
dialogs_brushes_cmd_callback (GtkWidget *widget,
|
1997-11-25 06:05:25 +08:00
|
|
|
gpointer client_data)
|
|
|
|
{
|
1999-11-20 20:12:41 +08:00
|
|
|
brush_dialog_create ();
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1999-11-20 20:12:41 +08:00
|
|
|
dialogs_patterns_cmd_callback (GtkWidget *widget,
|
1999-10-28 23:05:49 +08:00
|
|
|
gpointer client_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
1999-11-20 20:12:41 +08:00
|
|
|
pattern_dialog_create ();
|
1999-06-20 21:53:15 +08:00
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
void
|
1999-11-20 20:12:41 +08:00
|
|
|
dialogs_gradients_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
1999-11-20 20:12:41 +08:00
|
|
|
gradient_dialog_create ();
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-11-20 20:12:41 +08:00
|
|
|
void
|
|
|
|
dialogs_palette_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
|
|
|
{
|
|
|
|
palette_dialog_create ();
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
1999-01-08 03:53:05 +08:00
|
|
|
static void
|
2001-01-08 07:59:46 +08:00
|
|
|
dialogs_indexed_palette_select_callback (GimpColormapDialog *dialog,
|
|
|
|
gpointer data)
|
1999-01-08 03:53:05 +08:00
|
|
|
{
|
2001-01-15 09:48:53 +08:00
|
|
|
GimpImage *image;
|
|
|
|
GimpRGB color;
|
|
|
|
gint index;
|
1999-01-08 03:53:05 +08:00
|
|
|
|
2001-01-15 09:48:53 +08:00
|
|
|
image = gimp_colormap_dialog_image (dialog);
|
|
|
|
index = gimp_colormap_dialog_col_index (dialog);
|
|
|
|
|
|
|
|
gimp_rgba_set_uchar (&color,
|
|
|
|
image->cmap[index * 3],
|
|
|
|
image->cmap[index * 3 + 1],
|
|
|
|
image->cmap[index * 3 + 2],
|
|
|
|
255);
|
1999-06-20 21:53:15 +08:00
|
|
|
|
1999-11-20 20:12:41 +08:00
|
|
|
if (active_color == FOREGROUND)
|
2001-01-15 09:48:53 +08:00
|
|
|
gimp_context_set_foreground (gimp_context_get_user (), &color);
|
1999-11-20 20:12:41 +08:00
|
|
|
else if (active_color == BACKGROUND)
|
2001-01-15 09:48:53 +08:00
|
|
|
gimp_context_set_background (gimp_context_get_user (), &color);
|
1999-01-08 03:53:05 +08:00
|
|
|
}
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
void
|
|
|
|
dialogs_indexed_palette_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
|
|
|
{
|
2001-01-08 07:59:46 +08:00
|
|
|
static GimpColormapDialog *cmap_dlg;
|
1999-06-20 21:53:15 +08:00
|
|
|
|
1999-07-27 10:41:34 +08:00
|
|
|
if (!cmap_dlg)
|
1999-06-20 21:53:15 +08:00
|
|
|
{
|
2001-01-08 07:59:46 +08:00
|
|
|
cmap_dlg = gimp_colormap_dialog_create (image_context);
|
|
|
|
|
|
|
|
gtk_signal_connect
|
|
|
|
(GTK_OBJECT (cmap_dlg), "selected",
|
|
|
|
GTK_SIGNAL_FUNC (dialogs_indexed_palette_select_callback),
|
|
|
|
NULL);
|
1999-06-20 21:53:15 +08:00
|
|
|
}
|
|
|
|
|
2001-01-08 07:59:46 +08:00
|
|
|
if (! GTK_WIDGET_VISIBLE (cmap_dlg))
|
|
|
|
gtk_widget_show (GTK_WIDGET (cmap_dlg));
|
|
|
|
else
|
|
|
|
gdk_window_raise (GTK_WIDGET (cmap_dlg)->window);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
1998-06-06 11:49:01 +08:00
|
|
|
void
|
|
|
|
dialogs_input_devices_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
|
|
|
{
|
1999-10-27 02:27:27 +08:00
|
|
|
input_dialog_create ();
|
1998-06-06 11:49:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
dialogs_device_status_cmd_callback (GtkWidget *widget,
|
1998-08-03 03:05:02 +08:00
|
|
|
gpointer client_data)
|
1998-06-06 11:49:01 +08:00
|
|
|
{
|
1999-10-27 02:27:27 +08:00
|
|
|
device_status_create ();
|
1998-06-06 11:49:01 +08:00
|
|
|
}
|
|
|
|
|
2000-05-05 22:53:38 +08:00
|
|
|
void
|
|
|
|
dialogs_document_index_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
|
|
|
{
|
|
|
|
document_index_create ();
|
|
|
|
}
|
|
|
|
|
1998-08-03 03:05:02 +08:00
|
|
|
void
|
|
|
|
dialogs_error_console_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
|
|
|
{
|
|
|
|
error_console_add (NULL);
|
|
|
|
}
|
|
|
|
|
2000-12-25 04:27:04 +08:00
|
|
|
#ifdef DISPLAY_FILTERS
|
1999-08-31 10:00:34 +08:00
|
|
|
void
|
|
|
|
dialogs_display_filters_cmd_callback (GtkWidget *widget,
|
1999-11-20 20:12:41 +08:00
|
|
|
gpointer client_data)
|
1999-08-31 10:00:34 +08:00
|
|
|
{
|
2000-01-12 05:07:17 +08:00
|
|
|
GDisplay *gdisp;
|
2000-01-03 15:49:19 +08:00
|
|
|
|
|
|
|
gdisp = gdisplay_active ();
|
|
|
|
if (!gdisp)
|
|
|
|
gdisp = color_area_gdisp;
|
|
|
|
|
|
|
|
if (!gdisp->cd_ui)
|
|
|
|
gdisplay_color_ui_new (gdisp);
|
|
|
|
|
|
|
|
if (!GTK_WIDGET_VISIBLE (gdisp->cd_ui))
|
|
|
|
gtk_widget_show (gdisp->cd_ui);
|
|
|
|
else
|
|
|
|
gdk_window_raise (gdisp->cd_ui->window);
|
1999-08-31 10:00:34 +08:00
|
|
|
}
|
2000-12-25 04:27:04 +08:00
|
|
|
#endif /* DISPLAY_FILTERS */
|
1999-08-31 10:00:34 +08:00
|
|
|
|
2000-03-10 03:58:23 +08:00
|
|
|
void
|
|
|
|
dialogs_undo_history_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
|
|
|
{
|
|
|
|
GDisplay *gdisp;
|
|
|
|
GImage *gimage;
|
|
|
|
return_if_no_display (gdisp);
|
|
|
|
|
|
|
|
gimage = gdisp->gimage;
|
|
|
|
|
|
|
|
if (!gimage->undo_history)
|
|
|
|
gimage->undo_history = undo_history_new (gimage);
|
|
|
|
|
|
|
|
if (!GTK_WIDGET_VISIBLE (gimage->undo_history))
|
|
|
|
gtk_widget_show (gimage->undo_history);
|
|
|
|
else
|
|
|
|
gdk_window_raise (gimage->undo_history->window);
|
|
|
|
}
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
void
|
1999-11-20 20:12:41 +08:00
|
|
|
dialogs_module_browser_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-02-10 08:00:54 +08:00
|
|
|
GtkWidget *module_browser;
|
1999-11-20 20:12:41 +08:00
|
|
|
|
2000-02-10 08:00:54 +08:00
|
|
|
module_browser = module_db_browser_new ();
|
|
|
|
gtk_widget_show (module_browser);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
1999-11-20 20:12:41 +08:00
|
|
|
/***** Help *****/
|
|
|
|
|
1999-09-28 01:58:10 +08:00
|
|
|
void
|
1999-11-20 20:12:41 +08:00
|
|
|
help_help_cmd_callback (GtkWidget *widget,
|
1999-09-28 01:58:10 +08:00
|
|
|
gpointer client_data)
|
|
|
|
{
|
These changes enable help support for 3rd party plug-ins which install
2000-05-21 Michael Natterer <mitch@gimp.org>
These changes enable help support for 3rd party plug-ins which
install their help files outside GIMP's main help dir.
Instead of calling gimp_help(), gimp_plugin_help_func() etc.,
all help callbacks now have to call gimp_standard_help_func()
which has different implementations in the app and in libgimp.
There is a new function gimp_plugin_help_register() which can
be called during plug-in query. plug_in.c keeps a list of
executable_name/help_path pairs. Plug-ins have to pass their
exec. name to gimp_help() which uses the list to find the plug-in's
help directory.
* app/gimphelp.[ch]: gimp_help() now takes a help_path parameter.
help_path == NULL means the standard help directory. Various
changes to pass the help_path to the help browser.
* app/gimprc.c: save the plug-in's help_path in the pluginrc file.
* app/menus.c: ugly hack to enable help_paths in the "F1" callback.
* app/plug_in.[ch]: many help_path related changes. Use g_basename()
instead of strrchr(str,G_DIR_SEPARATOR), cosmetic cleanups.
* app/internal_procs.c
* app/gimphelp_cmds.c
* tools/pdbgen/pdb/gimphelp.pdb: new procedure
gimp_plugin_help_register(). gimp_help() takes a second parameter
which is the executable name (not the help_path).
* app/color_notebook.c
* app/commands.c
* app/lc_dialog.c
* app/preferences_dialog.c
* app/tools.c: call gimp_standard_help_func() instead of gimp_help().
* libgimp/gimp.c: new function gimp_get_progname() which returns
the full path of the plug-in's executable.
* libgimp/gimp.h: export the new function,
removed gimp_plugin_help_func(), gimp_help() takes the executable
name as second parameter.
* libgimp/gimpcompat.h: added gimp_plugin_help_func().
* libgimp/gimphelp.c: a wrapper for gimp_plugin_help_register(),
changed the calls to gimp_help.
* libgimp/gimphelpui.[ch]: call gimp_standard_help_func() instead
of gimp_help().
* plug-ins/helpbrowser/helpbrowser.c: now called with an additional
help_path parameter. Various changes to enable
help_path != gimp_standard_help_path.
Unrelated stuff:
* app/batch.h: added missing GPL header.
* app/gimpunit.c: had a LGPL header, merged some fprintf's into
one call.
* app/procedural_db.[ch]: cosmetic: g* types, s/g_malloc/g_new/,
prototypes, indentation.
* app/resize.c: use less packing widgets. didn't find the "offset"
redraw bug :(
2000-05-22 01:41:02 +08:00
|
|
|
gimp_standard_help_func (NULL);
|
1999-09-28 01:58:10 +08:00
|
|
|
}
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
void
|
1999-11-20 20:12:41 +08:00
|
|
|
help_context_help_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
1999-11-20 20:12:41 +08:00
|
|
|
gimp_context_help ();
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
1999-01-19 08:03:00 +08:00
|
|
|
void
|
1999-11-20 20:12:41 +08:00
|
|
|
help_tips_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
1999-01-19 08:03:00 +08:00
|
|
|
{
|
1999-11-20 20:12:41 +08:00
|
|
|
tips_dialog_create ();
|
|
|
|
}
|
1999-01-19 08:03:00 +08:00
|
|
|
|
1999-11-20 20:12:41 +08:00
|
|
|
void
|
|
|
|
help_about_cmd_callback (GtkWidget *widget,
|
|
|
|
gpointer client_data)
|
|
|
|
{
|
2000-06-28 05:38:44 +08:00
|
|
|
about_dialog_create ();
|
1999-01-19 08:03:00 +08:00
|
|
|
}
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-11-20 20:12:41 +08:00
|
|
|
/*****************************/
|
|
|
|
/***** Local functions *****/
|
|
|
|
/*****************************/
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
static void
|
1999-07-27 10:41:34 +08:00
|
|
|
image_resize_callback (GtkWidget *widget,
|
1997-11-25 06:05:25 +08:00
|
|
|
gpointer client_data)
|
|
|
|
{
|
1999-11-20 20:12:41 +08:00
|
|
|
ImageResize *image_resize;
|
|
|
|
GImage *gimage;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
image_resize = (ImageResize *) client_data;
|
1999-02-14 09:53:23 +08:00
|
|
|
|
2000-05-17 01:25:14 +08:00
|
|
|
gtk_widget_set_sensitive (image_resize->resize->resize_shell, FALSE);
|
|
|
|
|
1998-06-30 23:31:32 +08:00
|
|
|
if ((gimage = image_resize->gimage) != NULL)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
if (image_resize->resize->width > 0 &&
|
|
|
|
image_resize->resize->height > 0)
|
|
|
|
{
|
2000-12-29 23:22:01 +08:00
|
|
|
gimp_image_resize (gimage,
|
|
|
|
image_resize->resize->width,
|
|
|
|
image_resize->resize->height,
|
|
|
|
image_resize->resize->offset_x,
|
|
|
|
image_resize->resize->offset_y);
|
1997-11-25 06:05:25 +08:00
|
|
|
gdisplays_flush ();
|
2000-12-15 03:59:13 +08:00
|
|
|
lc_dialog_update_image_list ();
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
1999-07-27 10:41:34 +08:00
|
|
|
g_message (_("Resize Error: Both width and height must be "
|
|
|
|
"greater than zero."));
|
1997-11-25 06:05:25 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-04-06 10:13:18 +08:00
|
|
|
gtk_widget_destroy (image_resize->resize->resize_shell);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1999-07-27 10:41:34 +08:00
|
|
|
image_scale_callback (GtkWidget *widget,
|
1997-11-25 06:05:25 +08:00
|
|
|
gpointer client_data)
|
|
|
|
{
|
2000-02-27 02:46:08 +08:00
|
|
|
ImageResize *image_scale = NULL;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-04-06 10:13:18 +08:00
|
|
|
g_assert ((image_scale = (ImageResize *) client_data) != NULL);
|
|
|
|
g_assert (image_scale->gimage != NULL);
|
|
|
|
|
2000-05-17 01:25:14 +08:00
|
|
|
gtk_widget_set_sensitive (image_scale->resize->resize_shell, FALSE);
|
|
|
|
|
|
|
|
if (resize_check_layer_scaling (image_scale))
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-04-06 10:13:18 +08:00
|
|
|
resize_scale_implement (image_scale);
|
|
|
|
gtk_widget_destroy (image_scale->resize->resize_shell);
|
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
|
|
|
gimage_mask_feather_callback (GtkWidget *widget,
|
2000-02-11 05:54:12 +08:00
|
|
|
gdouble size,
|
|
|
|
GimpUnit unit,
|
|
|
|
gpointer data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-02-11 05:54:12 +08:00
|
|
|
GImage *gimage;
|
|
|
|
gdouble radius_x;
|
|
|
|
gdouble radius_y;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-02-11 05:54:12 +08:00
|
|
|
gimage = GIMP_IMAGE (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
|
|
|
|
2000-02-11 05:54:12 +08:00
|
|
|
selection_feather_radius = size;
|
1999-05-07 07:10:29 +08:00
|
|
|
|
|
|
|
radius_x = radius_y = selection_feather_radius;
|
|
|
|
|
2000-02-08 04:35:13 +08:00
|
|
|
if (unit != GIMP_UNIT_PIXEL)
|
1999-05-07 07:10:29 +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
|
|
|
gdouble factor;
|
1999-05-07 07:10:29 +08:00
|
|
|
|
|
|
|
factor = (MAX (gimage->xresolution, gimage->yresolution) /
|
|
|
|
MIN (gimage->xresolution, gimage->yresolution));
|
|
|
|
|
|
|
|
if (gimage->xresolution == MIN (gimage->xresolution, gimage->yresolution))
|
|
|
|
radius_y *= factor;
|
|
|
|
else
|
|
|
|
radius_x *= factor;
|
|
|
|
}
|
|
|
|
|
|
|
|
gimage_mask_feather (gimage, radius_x, radius_y);
|
1997-11-25 06:05:25 +08:00
|
|
|
gdisplays_flush ();
|
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
gimage_mask_border_callback (GtkWidget *widget,
|
2000-02-11 05:54:12 +08:00
|
|
|
gdouble size,
|
|
|
|
GimpUnit unit,
|
|
|
|
gpointer data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-02-11 05:54:12 +08:00
|
|
|
GImage *gimage;
|
|
|
|
gdouble radius_x;
|
|
|
|
gdouble radius_y;
|
1999-05-07 07:10:29 +08:00
|
|
|
|
2000-02-11 05:54:12 +08:00
|
|
|
gimage = GIMP_IMAGE (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
|
|
|
|
2000-02-11 05:54:12 +08:00
|
|
|
selection_border_radius = ROUND (size);
|
1999-05-07 07:10:29 +08:00
|
|
|
|
1999-09-07 18:58:20 +08:00
|
|
|
radius_x = radius_y = selection_border_radius;
|
1999-05-07 07:10:29 +08:00
|
|
|
|
2000-02-08 04:35:13 +08:00
|
|
|
if (unit != GIMP_UNIT_PIXEL)
|
1999-05-07 07:10:29 +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
|
|
|
gdouble factor;
|
1999-05-07 07:10:29 +08:00
|
|
|
|
|
|
|
factor = (MAX (gimage->xresolution, gimage->yresolution) /
|
|
|
|
MIN (gimage->xresolution, gimage->yresolution));
|
|
|
|
|
|
|
|
if (gimage->xresolution == MIN (gimage->xresolution, gimage->yresolution))
|
|
|
|
radius_y *= factor;
|
|
|
|
else
|
|
|
|
radius_x *= factor;
|
|
|
|
}
|
1999-11-20 20:12:41 +08:00
|
|
|
|
1999-05-07 07:10:29 +08:00
|
|
|
gimage_mask_border (gimage, radius_x, radius_y);
|
1997-11-25 06:05:25 +08:00
|
|
|
gdisplays_flush ();
|
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
gimage_mask_grow_callback (GtkWidget *widget,
|
2000-02-11 05:54:12 +08:00
|
|
|
gdouble size,
|
|
|
|
GimpUnit unit,
|
|
|
|
gpointer data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-02-11 05:54:12 +08:00
|
|
|
GImage *gimage;
|
|
|
|
gdouble radius_x;
|
|
|
|
gdouble radius_y;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-02-11 05:54:12 +08:00
|
|
|
gimage = GIMP_IMAGE (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
|
|
|
|
2000-02-11 05:54:12 +08:00
|
|
|
selection_grow_pixels = ROUND (size);
|
1999-05-07 07:10:29 +08:00
|
|
|
|
|
|
|
radius_x = radius_y = selection_grow_pixels;
|
1999-11-20 20:12:41 +08:00
|
|
|
|
2000-02-08 04:35:13 +08:00
|
|
|
if (unit != GIMP_UNIT_PIXEL)
|
1999-05-07 07:10:29 +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
|
|
|
gdouble factor;
|
1999-05-07 07:10:29 +08:00
|
|
|
|
|
|
|
factor = (MAX (gimage->xresolution, gimage->yresolution) /
|
|
|
|
MIN (gimage->xresolution, gimage->yresolution));
|
|
|
|
|
|
|
|
if (gimage->xresolution == MIN (gimage->xresolution, gimage->yresolution))
|
|
|
|
radius_y *= factor;
|
|
|
|
else
|
|
|
|
radius_x *= factor;
|
|
|
|
}
|
|
|
|
|
|
|
|
gimage_mask_grow (gimage, radius_x, radius_y);
|
1997-11-25 06:05:25 +08:00
|
|
|
gdisplays_flush ();
|
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
gimage_mask_shrink_callback (GtkWidget *widget,
|
2000-02-11 05:54:12 +08:00
|
|
|
gdouble size,
|
|
|
|
GimpUnit unit,
|
|
|
|
gpointer data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2000-02-11 05:54:12 +08:00
|
|
|
GImage *gimage;
|
|
|
|
gint radius_x;
|
|
|
|
gint radius_y;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-02-11 05:54:12 +08:00
|
|
|
gimage = GIMP_IMAGE (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
|
|
|
|
2000-02-11 05:54:12 +08:00
|
|
|
selection_shrink_pixels = ROUND (size);
|
1999-05-07 07:10:29 +08:00
|
|
|
|
|
|
|
radius_x = radius_y = selection_shrink_pixels;
|
|
|
|
|
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
|
|
|
selection_shrink_edge_lock =
|
|
|
|
! GTK_TOGGLE_BUTTON (gtk_object_get_data (GTK_OBJECT (widget),
|
|
|
|
"edge_lock_toggle"))->active;
|
|
|
|
|
2000-02-08 04:35:13 +08:00
|
|
|
if (unit != GIMP_UNIT_PIXEL)
|
1999-05-07 07:10:29 +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
|
|
|
gdouble factor;
|
1999-05-07 07:10:29 +08:00
|
|
|
|
|
|
|
factor = (MAX (gimage->xresolution, gimage->yresolution) /
|
|
|
|
MIN (gimage->xresolution, gimage->yresolution));
|
|
|
|
|
|
|
|
if (gimage->xresolution == MIN (gimage->xresolution, gimage->yresolution))
|
|
|
|
radius_y *= factor;
|
|
|
|
else
|
|
|
|
radius_x *= factor;
|
|
|
|
}
|
|
|
|
|
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
|
|
|
gimage_mask_shrink (gimage, radius_x, radius_y, selection_shrink_edge_lock);
|
1997-11-25 06:05:25 +08:00
|
|
|
gdisplays_flush ();
|
|
|
|
}
|