2006-12-10 05:33:38 +08:00
|
|
|
/* GIMP - The GNU Image Manipulation Program
|
2005-06-04 01:05:01 +08:00
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
2009-01-18 06:28:01 +08:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
2005-06-04 01:05:01 +08:00
|
|
|
* it under the terms of the GNU General Public License as published by
|
2009-01-18 06:28:01 +08:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2005-06-04 01:05:01 +08:00
|
|
|
* (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
|
2009-01-18 06:28:01 +08:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2005-06-04 01:05:01 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __GIMP_ALIGN_TOOL_H__
|
|
|
|
#define __GIMP_ALIGN_TOOL_H__
|
|
|
|
|
|
|
|
|
|
|
|
#include "gimpdrawtool.h"
|
|
|
|
|
2007-10-14 16:54:19 +08:00
|
|
|
/* tool function/operation/state/mode */
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
ALIGN_TOOL_IDLE,
|
|
|
|
ALIGN_TOOL_PICK_LAYER,
|
|
|
|
ALIGN_TOOL_ADD_LAYER,
|
|
|
|
ALIGN_TOOL_PICK_GUIDE,
|
|
|
|
ALIGN_TOOL_ADD_GUIDE,
|
|
|
|
ALIGN_TOOL_PICK_PATH,
|
|
|
|
ALIGN_TOOL_ADD_PATH,
|
|
|
|
ALIGN_TOOL_DRAG_BOX
|
|
|
|
} GimpAlignToolFunction;
|
|
|
|
|
2005-06-04 01:05:01 +08:00
|
|
|
|
|
|
|
#define GIMP_TYPE_ALIGN_TOOL (gimp_align_tool_get_type ())
|
|
|
|
#define GIMP_ALIGN_TOOL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_ALIGN_TOOL, GimpAlignTool))
|
|
|
|
#define GIMP_ALIGN_TOOL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_ALIGN_TOOL, GimpAlignToolClass))
|
|
|
|
#define GIMP_IS_ALIGN_TOOL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_ALIGN_TOOL))
|
|
|
|
#define GIMP_IS_ALIGN_TOOL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_ALIGN_TOOL))
|
|
|
|
#define GIMP_ALIGN_TOOL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_ALIGN_TOOL, GimpAlignToolClass))
|
|
|
|
|
2006-06-09 06:15:45 +08:00
|
|
|
#define ALIGN_TOOL_NUM_BUTTONS 12
|
2005-06-04 01:05:01 +08:00
|
|
|
|
|
|
|
typedef struct _GimpAlignTool GimpAlignTool;
|
|
|
|
typedef struct _GimpAlignToolClass GimpAlignToolClass;
|
|
|
|
|
|
|
|
struct _GimpAlignTool
|
|
|
|
{
|
2006-06-10 05:52:45 +08:00
|
|
|
GimpDrawTool parent_instance;
|
2005-06-04 01:05:01 +08:00
|
|
|
|
2006-06-10 05:52:45 +08:00
|
|
|
GtkWidget *controls;
|
|
|
|
GtkWidget *button[ALIGN_TOOL_NUM_BUTTONS];
|
2005-06-04 01:05:01 +08:00
|
|
|
|
2007-10-14 16:54:19 +08:00
|
|
|
GimpAlignToolFunction function;
|
2006-06-10 05:52:45 +08:00
|
|
|
GList *selected_objects;
|
2005-06-04 01:05:01 +08:00
|
|
|
|
2006-06-10 05:52:45 +08:00
|
|
|
GimpAlignmentType align_type;
|
|
|
|
GimpAlignReferenceType align_reference_type;
|
|
|
|
gdouble horz_offset;
|
|
|
|
gdouble vert_offset;
|
2005-06-04 01:05:01 +08:00
|
|
|
|
2006-06-10 05:52:45 +08:00
|
|
|
GtkObject *horz_offset_adjustment;
|
|
|
|
GtkObject *vert_offset_adjustment;
|
2005-06-04 01:05:01 +08:00
|
|
|
|
2006-06-10 05:52:45 +08:00
|
|
|
gint x0, y0, x1, y1; /* rubber-band rectangle */
|
2005-06-04 01:05:01 +08:00
|
|
|
|
2006-06-10 05:52:45 +08:00
|
|
|
gboolean set_reference;
|
2005-06-04 01:05:01 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _GimpAlignToolClass
|
|
|
|
{
|
|
|
|
GimpDrawToolClass parent_class;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
void gimp_align_tool_register (GimpToolRegisterCallback callback,
|
|
|
|
gpointer data);
|
|
|
|
|
|
|
|
GType gimp_align_tool_get_type (void) G_GNUC_CONST;
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* __GIMP_ALIGN_TOOL_H__ */
|