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-03-22 01:47:32 +08:00
|
|
|
#include "config.h"
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
#include <stdlib.h>
|
2000-01-14 20:41:00 +08:00
|
|
|
|
2000-12-17 05:37:03 +08:00
|
|
|
#include <gtk/gtk.h>
|
2000-01-14 20:41:00 +08:00
|
|
|
#include <gdk/gdkkeysyms.h>
|
|
|
|
|
2001-01-25 06:36:18 +08:00
|
|
|
#include "libgimpwidgets/gimpwidgets.h"
|
|
|
|
|
2001-05-10 06:34:59 +08:00
|
|
|
#include "tools-types.h"
|
2000-12-17 05:37:03 +08:00
|
|
|
|
2001-05-15 19:25:25 +08:00
|
|
|
#include "base/pixel-region.h"
|
|
|
|
#include "base/tile-manager.h"
|
|
|
|
|
2001-04-07 23:58:26 +08:00
|
|
|
#include "paint-funcs/paint-funcs.h"
|
|
|
|
|
2001-05-09 10:32:03 +08:00
|
|
|
#include "core/gimpdrawable.h"
|
|
|
|
#include "core/gimpimage.h"
|
|
|
|
#include "core/gimpimage-mask.h"
|
|
|
|
#include "core/gimplayer.h"
|
|
|
|
|
2001-09-26 07:23:09 +08:00
|
|
|
#include "display/gimpdisplay.h"
|
2001-11-01 05:20:09 +08:00
|
|
|
#include "display/gimpdisplayshell.h"
|
2001-01-23 21:01:48 +08:00
|
|
|
|
2001-04-01 01:08:55 +08:00
|
|
|
#include "gimpfliptool.h"
|
|
|
|
#include "tool_manager.h"
|
2000-12-29 23:22:01 +08:00
|
|
|
#include "tool_options.h"
|
1998-01-22 15:02:57 +08:00
|
|
|
|
2001-11-01 05:20:09 +08:00
|
|
|
#include "undo.h"
|
|
|
|
#include "path_transform.h"
|
|
|
|
|
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"
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-04-01 01:08:55 +08:00
|
|
|
/* FIXME: Lame - 1 hacks abound since the code assumes certain values for
|
|
|
|
* the ORIENTATION_FOO constants.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define FLIP_INFO 0
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-04-09 06:25:54 +08:00
|
|
|
typedef struct _FlipOptions FlipOptions;
|
2000-01-05 19:18:38 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
struct _FlipOptions
|
|
|
|
{
|
2001-07-18 04:50:01 +08:00
|
|
|
GimpToolOptions tool_options;
|
1999-04-13 01:55:06 +08:00
|
|
|
|
2000-01-05 19:18:38 +08:00
|
|
|
InternalOrientationType type;
|
|
|
|
InternalOrientationType type_d;
|
|
|
|
GtkWidget *type_w[2];
|
1997-11-25 06:05:25 +08:00
|
|
|
};
|
|
|
|
|
2000-12-31 12:07:42 +08:00
|
|
|
|
|
|
|
/* local function prototypes */
|
|
|
|
|
2001-04-01 01:08:55 +08:00
|
|
|
static void gimp_flip_tool_class_init (GimpFlipToolClass *klass);
|
|
|
|
static void gimp_flip_tool_init (GimpFlipTool *flip_tool);
|
1999-04-09 06:25:54 +08:00
|
|
|
|
2001-04-01 01:08:55 +08:00
|
|
|
static void gimp_flip_tool_modifier_key (GimpTool *tool,
|
2001-11-09 03:14:51 +08:00
|
|
|
GdkModifierType key,
|
|
|
|
gboolean press,
|
|
|
|
GdkModifierType state,
|
|
|
|
GimpDisplay *gdisp);
|
|
|
|
static void gimp_flip_tool_cursor_update (GimpTool *tool,
|
|
|
|
GimpCoords *coords,
|
|
|
|
GdkModifierType state,
|
2001-10-29 19:47:11 +08:00
|
|
|
GimpDisplay *gdisp);
|
2000-12-31 12:07:42 +08:00
|
|
|
|
2001-04-01 01:08:55 +08:00
|
|
|
static TileManager * gimp_flip_tool_transform (GimpTransformTool *tool,
|
2001-10-29 19:47:11 +08:00
|
|
|
GimpDisplay *gdisp,
|
2001-04-01 01:08:55 +08:00
|
|
|
TransformState state);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-04-01 01:08:55 +08:00
|
|
|
static FlipOptions * flip_options_new (void);
|
2001-07-18 04:50:01 +08:00
|
|
|
static void flip_options_reset (GimpToolOptions *tool_options);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
|
2001-04-01 01:08:55 +08:00
|
|
|
static FlipOptions *flip_options = NULL;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-04-01 01:08:55 +08:00
|
|
|
static GimpTransformToolClass *parent_class = NULL;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
|
2001-04-01 01:08:55 +08:00
|
|
|
/* public functions */
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-04-01 01:08:55 +08:00
|
|
|
void
|
2001-07-07 20:17:23 +08:00
|
|
|
gimp_flip_tool_register (Gimp *gimp)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2001-07-07 20:17:23 +08:00
|
|
|
tool_manager_register_tool (gimp,
|
|
|
|
GIMP_TYPE_FLIP_TOOL,
|
2001-04-01 01:08:55 +08:00
|
|
|
FALSE,
|
|
|
|
"gimp:flip_tool",
|
|
|
|
_("Flip Tool"),
|
|
|
|
_("Flip the layer or selection"),
|
|
|
|
N_("/Tools/Transform Tools/Flip"), "<shift>F",
|
|
|
|
NULL, "tools/flip.html",
|
2001-08-06 00:08:19 +08:00
|
|
|
GIMP_STOCK_TOOL_FLIP);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2001-08-14 22:53:55 +08:00
|
|
|
GType
|
2001-04-01 01:08:55 +08:00
|
|
|
gimp_flip_tool_get_type (void)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2001-08-14 22:53:55 +08:00
|
|
|
static GType tool_type = 0;
|
1999-04-27 10:09:03 +08:00
|
|
|
|
2001-04-01 01:08:55 +08:00
|
|
|
if (! tool_type)
|
1999-04-13 01:55:06 +08:00
|
|
|
{
|
2001-08-14 22:53:55 +08:00
|
|
|
static const GTypeInfo tool_info =
|
2001-04-01 01:08:55 +08:00
|
|
|
{
|
|
|
|
sizeof (GimpFlipToolClass),
|
2001-08-14 22:53:55 +08:00
|
|
|
(GBaseInitFunc) NULL,
|
|
|
|
(GBaseFinalizeFunc) NULL,
|
|
|
|
(GClassInitFunc) gimp_flip_tool_class_init,
|
|
|
|
NULL, /* class_finalize */
|
|
|
|
NULL, /* class_data */
|
|
|
|
sizeof (GimpFlipTool),
|
|
|
|
0, /* n_preallocs */
|
|
|
|
(GInstanceInitFunc) gimp_flip_tool_init,
|
2001-04-01 01:08:55 +08:00
|
|
|
};
|
|
|
|
|
2001-08-14 22:53:55 +08:00
|
|
|
tool_type = g_type_register_static (GIMP_TYPE_TRANSFORM_TOOL,
|
|
|
|
"GimpFlipTool",
|
|
|
|
&tool_info, 0);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2001-04-01 01:08:55 +08:00
|
|
|
return tool_type;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
1999-04-19 05:22:41 +08:00
|
|
|
TileManager *
|
1999-08-14 06:33:49 +08:00
|
|
|
flip_tool_flip (GimpImage *gimage,
|
|
|
|
GimpDrawable *drawable,
|
|
|
|
TileManager *orig,
|
2000-03-21 11:19:11 +08:00
|
|
|
gint flip,
|
1999-08-14 06:33:49 +08:00
|
|
|
InternalOrientationType type)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
TileManager *new;
|
2000-01-05 19:18:38 +08:00
|
|
|
PixelRegion srcPR, destPR;
|
2000-12-29 23:22:01 +08:00
|
|
|
gint orig_width;
|
|
|
|
gint orig_height;
|
|
|
|
gint orig_bpp;
|
2001-01-23 21:01:48 +08:00
|
|
|
gint orig_x, orig_y;
|
2000-12-29 23:22:01 +08:00
|
|
|
gint i;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-12-29 23:22:01 +08:00
|
|
|
if (! orig)
|
1997-11-25 06:05:25 +08:00
|
|
|
return NULL;
|
|
|
|
|
2001-01-23 21:01:48 +08:00
|
|
|
orig_width = tile_manager_width (orig);
|
|
|
|
orig_height = tile_manager_height (orig);
|
|
|
|
orig_bpp = tile_manager_bpp (orig);
|
|
|
|
tile_manager_get_offsets (orig, &orig_x, &orig_y);
|
2000-12-29 23:22:01 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
if (flip > 0)
|
|
|
|
{
|
2000-12-29 23:22:01 +08:00
|
|
|
new = tile_manager_new (orig_width, orig_height, orig_bpp);
|
|
|
|
pixel_region_init (&srcPR, orig,
|
|
|
|
0, 0, orig_width, orig_height, FALSE);
|
|
|
|
pixel_region_init (&destPR, new,
|
|
|
|
0, 0, orig_width, orig_height, TRUE);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
copy_region (&srcPR, &destPR);
|
2001-01-23 21:01:48 +08:00
|
|
|
tile_manager_set_offsets (new, orig_x, orig_y);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2000-12-29 23:22:01 +08:00
|
|
|
new = tile_manager_new (orig_width, orig_height, orig_bpp);
|
2001-01-23 21:01:48 +08:00
|
|
|
tile_manager_set_offsets (new, orig_x, orig_y);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-07-29 07:00:08 +08:00
|
|
|
if (type == ORIENTATION_HORIZONTAL)
|
2001-01-23 21:01:48 +08:00
|
|
|
for (i = 0; i < orig_width; i++)
|
1999-04-27 10:09:03 +08:00
|
|
|
{
|
2000-12-29 23:22:01 +08:00
|
|
|
pixel_region_init (&srcPR, orig, i, 0, 1, orig_height, FALSE);
|
2000-01-05 19:18:38 +08:00
|
|
|
pixel_region_init (&destPR, new,
|
2000-12-29 23:22:01 +08:00
|
|
|
(orig_width - i - 1), 0, 1, orig_height, TRUE);
|
1999-04-27 10:09:03 +08:00
|
|
|
copy_region (&srcPR, &destPR);
|
|
|
|
}
|
|
|
|
else
|
2001-01-23 21:01:48 +08:00
|
|
|
for (i = 0; i < orig_height; i++)
|
1999-04-27 10:09:03 +08:00
|
|
|
{
|
2000-12-29 23:22:01 +08:00
|
|
|
pixel_region_init (&srcPR, orig, 0, i, orig_width, 1, FALSE);
|
2000-01-05 19:18:38 +08:00
|
|
|
pixel_region_init (&destPR, new,
|
2000-12-29 23:22:01 +08:00
|
|
|
0, (orig_height - i - 1), orig_width, 1, TRUE);
|
1999-04-27 10:09:03 +08:00
|
|
|
copy_region (&srcPR, &destPR);
|
|
|
|
}
|
1999-10-19 04:55:25 +08:00
|
|
|
|
|
|
|
/* flip locked paths */
|
|
|
|
/* Note that the undo structures etc are setup before we enter this
|
|
|
|
* function.
|
|
|
|
*/
|
2000-01-05 19:18:38 +08:00
|
|
|
if (type == ORIENTATION_HORIZONTAL)
|
2000-02-16 21:52:33 +08:00
|
|
|
path_transform_flip_horz (gimage);
|
1999-10-19 04:55:25 +08:00
|
|
|
else
|
2000-02-16 21:52:33 +08:00
|
|
|
path_transform_flip_vert (gimage);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
return new;
|
|
|
|
}
|
2001-04-01 01:08:55 +08:00
|
|
|
|
|
|
|
|
|
|
|
/* private functions */
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_flip_tool_class_init (GimpFlipToolClass *klass)
|
|
|
|
{
|
|
|
|
GimpToolClass *tool_class;
|
|
|
|
GimpDrawToolClass *draw_class;
|
|
|
|
GimpTransformToolClass *trans_class;
|
|
|
|
|
2001-08-14 22:53:55 +08:00
|
|
|
tool_class = GIMP_TOOL_CLASS (klass);
|
|
|
|
draw_class = GIMP_DRAW_TOOL_CLASS (klass);
|
|
|
|
trans_class = GIMP_TRANSFORM_TOOL_CLASS (klass);
|
2001-04-01 01:08:55 +08:00
|
|
|
|
2001-08-14 22:53:55 +08:00
|
|
|
parent_class = g_type_class_peek_parent (klass);
|
2001-04-01 01:08:55 +08:00
|
|
|
|
|
|
|
tool_class->modifier_key = gimp_flip_tool_modifier_key;
|
2001-11-09 03:14:51 +08:00
|
|
|
tool_class->cursor_update = gimp_flip_tool_cursor_update;
|
2001-04-01 01:08:55 +08:00
|
|
|
|
|
|
|
draw_class->draw = NULL;
|
|
|
|
|
|
|
|
trans_class->transform = gimp_flip_tool_transform;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_flip_tool_init (GimpFlipTool *flip_tool)
|
|
|
|
{
|
|
|
|
GimpTool *tool;
|
|
|
|
GimpTransformTool *tr_tool;
|
|
|
|
|
|
|
|
tool = GIMP_TOOL (flip_tool);
|
|
|
|
tr_tool = GIMP_TRANSFORM_TOOL (flip_tool);
|
|
|
|
|
|
|
|
/* The tool options */
|
|
|
|
if (! flip_options)
|
|
|
|
{
|
|
|
|
flip_options = flip_options_new ();
|
|
|
|
|
|
|
|
tool_manager_register_tool_options (GIMP_TYPE_FLIP_TOOL,
|
2001-07-18 04:50:01 +08:00
|
|
|
(GimpToolOptions *) flip_options);
|
2001-04-01 01:08:55 +08:00
|
|
|
}
|
|
|
|
|
2001-11-09 03:14:51 +08:00
|
|
|
tr_tool->trans_info[FLIP_INFO] = -1.0;
|
|
|
|
|
2001-04-01 01:08:55 +08:00
|
|
|
tool->tool_cursor = GIMP_FLIP_HORIZONTAL_TOOL_CURSOR;
|
|
|
|
tool->toggle_cursor = GIMP_FLIP_VERTICAL_TOOL_CURSOR;
|
|
|
|
|
2001-11-09 03:14:51 +08:00
|
|
|
tool->auto_snap_to = FALSE; /* Don't snap to guides */
|
|
|
|
}
|
2001-04-01 01:08:55 +08:00
|
|
|
|
2001-11-09 03:14:51 +08:00
|
|
|
static void
|
|
|
|
gimp_flip_tool_modifier_key (GimpTool *tool,
|
|
|
|
GdkModifierType key,
|
|
|
|
gboolean press,
|
|
|
|
GdkModifierType state,
|
|
|
|
GimpDisplay *gdisp)
|
|
|
|
{
|
|
|
|
if (key == GDK_CONTROL_MASK)
|
|
|
|
{
|
|
|
|
switch (flip_options->type)
|
|
|
|
{
|
|
|
|
case ORIENTATION_HORIZONTAL:
|
|
|
|
gtk_toggle_button_set_active
|
|
|
|
(GTK_TOGGLE_BUTTON (flip_options->type_w[ORIENTATION_VERTICAL - 1]),
|
|
|
|
TRUE);
|
|
|
|
break;
|
|
|
|
case ORIENTATION_VERTICAL:
|
|
|
|
gtk_toggle_button_set_active
|
|
|
|
(GTK_TOGGLE_BUTTON (flip_options->type_w[ORIENTATION_HORIZONTAL - 1]),
|
|
|
|
TRUE);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2001-04-01 01:08:55 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2001-11-09 03:14:51 +08:00
|
|
|
gimp_flip_tool_cursor_update (GimpTool *tool,
|
|
|
|
GimpCoords *coords,
|
|
|
|
GdkModifierType state,
|
|
|
|
GimpDisplay *gdisp)
|
2001-04-01 01:08:55 +08:00
|
|
|
{
|
2001-11-01 05:20:09 +08:00
|
|
|
GimpDisplayShell *shell;
|
2001-04-01 01:08:55 +08:00
|
|
|
GimpDrawable *drawable;
|
|
|
|
GdkCursorType ctype = GIMP_BAD_CURSOR;
|
|
|
|
GimpToolCursorType tool_cursor = GIMP_FLIP_HORIZONTAL_TOOL_CURSOR;
|
|
|
|
|
2001-11-01 05:20:09 +08:00
|
|
|
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
|
|
|
|
|
2001-04-01 01:08:55 +08:00
|
|
|
if ((drawable = gimp_image_active_drawable (gdisp->gimage)))
|
|
|
|
{
|
|
|
|
gint off_x, off_y;
|
|
|
|
|
|
|
|
gimp_drawable_offsets (drawable, &off_x, &off_y);
|
|
|
|
|
2001-11-09 03:14:51 +08:00
|
|
|
if (coords->x >= off_x &&
|
|
|
|
coords->y >= off_y &&
|
|
|
|
coords->x < (off_x + gimp_drawable_width (drawable)) &&
|
|
|
|
coords->y < (off_y + gimp_drawable_height (drawable)))
|
2001-04-01 01:08:55 +08:00
|
|
|
{
|
|
|
|
/* Is there a selected region? If so, is cursor inside? */
|
|
|
|
if (gimage_mask_is_empty (gdisp->gimage) ||
|
2001-11-09 03:14:51 +08:00
|
|
|
gimage_mask_value (gdisp->gimage, coords->x, coords->y))
|
2001-04-01 01:08:55 +08:00
|
|
|
{
|
|
|
|
if (flip_options->type == ORIENTATION_HORIZONTAL)
|
|
|
|
ctype = GDK_SB_H_DOUBLE_ARROW;
|
|
|
|
else
|
|
|
|
ctype = GDK_SB_V_DOUBLE_ARROW;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (flip_options->type == ORIENTATION_HORIZONTAL)
|
|
|
|
tool_cursor = GIMP_FLIP_HORIZONTAL_TOOL_CURSOR;
|
|
|
|
else
|
|
|
|
tool_cursor = GIMP_FLIP_VERTICAL_TOOL_CURSOR;
|
|
|
|
|
2001-11-01 05:20:09 +08:00
|
|
|
gimp_display_shell_install_tool_cursor (shell,
|
|
|
|
ctype,
|
|
|
|
tool_cursor,
|
|
|
|
GIMP_CURSOR_MODIFIER_NONE);
|
2001-04-01 01:08:55 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static TileManager *
|
|
|
|
gimp_flip_tool_transform (GimpTransformTool *trans_tool,
|
2001-10-29 19:47:11 +08:00
|
|
|
GimpDisplay *gdisp,
|
2001-04-01 01:08:55 +08:00
|
|
|
TransformState state)
|
|
|
|
{
|
|
|
|
GimpTool *tool;
|
|
|
|
|
|
|
|
tool = GIMP_TOOL (trans_tool);
|
|
|
|
|
|
|
|
switch (state)
|
|
|
|
{
|
|
|
|
case TRANSFORM_INIT:
|
|
|
|
transform_info = NULL;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case TRANSFORM_MOTION:
|
|
|
|
break;
|
|
|
|
|
|
|
|
case TRANSFORM_RECALC:
|
|
|
|
break;
|
|
|
|
|
|
|
|
case TRANSFORM_FINISH:
|
|
|
|
return flip_tool_flip (gdisp->gimage,
|
|
|
|
gimp_image_active_drawable (gdisp->gimage),
|
|
|
|
trans_tool->original,
|
|
|
|
(gint) trans_tool->trans_info[FLIP_INFO],
|
|
|
|
flip_options->type);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static FlipOptions *
|
|
|
|
flip_options_new (void)
|
|
|
|
{
|
|
|
|
FlipOptions *options;
|
2001-04-01 04:41:39 +08:00
|
|
|
GtkWidget *vbox;
|
|
|
|
GtkWidget *frame;
|
2001-04-01 01:08:55 +08:00
|
|
|
|
|
|
|
options = g_new0 (FlipOptions, 1);
|
2001-07-18 04:50:01 +08:00
|
|
|
tool_options_init ((GimpToolOptions *) options,
|
2001-04-01 01:08:55 +08:00
|
|
|
flip_options_reset);
|
|
|
|
|
|
|
|
options->type = options->type_d = ORIENTATION_HORIZONTAL;
|
|
|
|
|
|
|
|
/* the main vbox */
|
|
|
|
vbox = options->tool_options.main_vbox;
|
|
|
|
|
|
|
|
/* tool toggle */
|
|
|
|
frame =
|
|
|
|
gimp_radio_group_new2 (TRUE, _("Tool Toggle"),
|
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
2001-07-24 Michael Natterer <mitch@gimp.org>
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
* configure.in: require glib/gtk+ >= 1.3.7, commented out the
gtkxmhtml stuff.
From now on, you will need glib, pango, atk and gtk+ HEAD from CVS
to hack or use GIMP HEAD.
Beware, it crashes randomly :)
* app/core/Makefile.am
* app/core/gimpmarshal.list: new file plus rules to generate
gimpmarshal.[ch] from it.
* app/core/*
* app/tools/*
* app/widgets/*
* libgimpwidgets/*: started to use the glib object system. All
core/ objects are still gtk objects however. All signals are
created using g_signal_new(). There are many gtk+ artefacts left.
Finally, we will _not_ use the gtk_signal_foo() wrappers and
friends any more.
* app/colormaps.c
* app/devices.[ch]
* app/disp_callbacks.c
* app/errorconsole.c
* app/file-save.[ch]
* app/interface.c
* app/module_db.c
* app/nav_window.c
* app/ops_buttons.c
* app/scroll.c
* app/user_install.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brushes-commands.c
* app/gui/color-notebook.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/image-commands.c
* app/gui/info-dialog.[ch]
* app/gui/layer-select.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/offset-dialog.c
* app/gui/palette-editor.c
* app/gui/palettes-commands.c
* app/gui/patterns-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.[ch]
* app/gui/splash.c
* app/gui/tips-dialog.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* libgimpbase/gimpenv.c: tons and tons of changes like "const
gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete
and currently disables), lots of s/gtk_signal/g_signal/,
removal/replacement of deprecated stuff,
s/GtkSignalFunc/GCallback/ and lots of small changes and fixes
while I was on it, zillions of warnings left...
* modules/Makefile.am: disabled the water color selector
temporarily (XInput issues).
* plug-ins/Makefile.am
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl: simply excluded all plug-ins
which did not build (including Script-Fu). They are trivial to
fix.
2001-07-25 05:27:11 +08:00
|
|
|
G_CALLBACK (gimp_radio_button_update),
|
|
|
|
&options->type,
|
|
|
|
(gpointer) options->type,
|
2001-04-01 01:08:55 +08:00
|
|
|
|
|
|
|
_("Horizontal"), (gpointer) ORIENTATION_HORIZONTAL,
|
|
|
|
&options->type_w[0],
|
|
|
|
_("Vertical"), (gpointer) ORIENTATION_VERTICAL,
|
|
|
|
&options->type_w[1],
|
|
|
|
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (frame);
|
|
|
|
|
|
|
|
return options;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2001-07-18 04:50:01 +08:00
|
|
|
flip_options_reset (GimpToolOptions *tool_options)
|
2001-04-01 01:08:55 +08:00
|
|
|
{
|
2001-04-01 04:41:39 +08:00
|
|
|
FlipOptions *options;
|
|
|
|
|
|
|
|
options = (FlipOptions *) tool_options;
|
2001-04-01 01:08:55 +08:00
|
|
|
|
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (options->type_w[options->type_d - 1]), TRUE);
|
|
|
|
}
|