Commit 919a2980 authored by Martin Nordholts's avatar Martin Nordholts Committed by Martin Nordholts

Added a Polygon Select Tool which is a primitive selection tool based on

2008-01-30  Martin Nordholts  <martinn@svn.gnome.org>

	Added a Polygon Select Tool which is a primitive selection tool
	based on Free Hand Select. Code filtered through David Gowers who
	also made the tool icon. This version of the tool is a for-now
	solution to bug #119646.

	* app/tools/gimppolygonselecttool.[ch]: The new tool.

	* app/tools/gimp-tools.c: Add the tool.

	* app/tools/Makefile.am: Add tool source.

	* app/widgets/gimphelp-ids.h: Add help id for the tool.

	* libgimpwidgets/gimpstock.[ch]: Setup for the new tool icon.

	* menus/image-menu.xml.in: Add action entry for the tool.

	* themes/Default/images/tools/stock-tool-polygon-select-{16,24}.png:
	Tool icon graphics.

	* themes/Default/images/Makefile.am: Add tool icon graphics.

svn path=/trunk/; revision=24753
parent b8ca2856
2008-01-30 Martin Nordholts <martinn@svn.gnome.org>
Added a Polygon Select Tool which is a primitive selection tool
based on Free Hand Select. Code filtered through David Gowers who
also made the tool icon. This version of the tool is a for-now
solution to bug #119646.
* app/tools/gimppolygonselecttool.[ch]: The new tool.
* app/tools/gimp-tools.c: Add the tool.
* app/tools/Makefile.am: Add tool source.
* app/widgets/gimphelp-ids.h: Add help id for the tool.
* libgimpwidgets/gimpstock.[ch]: Setup for the new tool icon.
* menus/image-menu.xml.in: Add action entry for the tool.
* themes/Default/images/tools/stock-tool-polygon-select-{16,24}.png:
Tool icon graphics.
* themes/Default/images/Makefile.am: Add tool icon graphics.
2008-01-30 Michael Natterer <mitch@gimp.org>
* app/tools/gimpimagemaptool.[ch]: add "GObject **config" return
......
......@@ -120,6 +120,8 @@ libapptools_a_sources = \
gimpperspectiveclonetool.h \
gimpperspectivetool.c \
gimpperspectivetool.h \
gimppolygonselecttool.c \
gimppolygonselecttool.h \
gimpposterizetool.c \
gimpposterizetool.h \
gimprectangleselecttool.c \
......
......@@ -69,6 +69,7 @@
#include "gimppenciltool.h"
#include "gimpperspectiveclonetool.h"
#include "gimpperspectivetool.h"
#include "gimppolygonselecttool.h"
#include "gimpposterizetool.h"
#include "gimpthresholdtool.h"
#include "gimprectangleselecttool.h"
......@@ -167,6 +168,7 @@ gimp_tools_init (Gimp *gimp)
gimp_iscissors_tool_register,
gimp_by_color_select_tool_register,
gimp_fuzzy_select_tool_register,
gimp_polygon_select_tool_register,
gimp_free_select_tool_register,
gimp_ellipse_select_tool_register,
gimp_rect_select_tool_register
......
This diff is collapsed.
/* GIMP - The GNU Image Manipulation Program
*
* A polygonal selection tool for GIMP
* Copyright (C) 2007 Martin Nordholts
*
* Based on gimpfreeselecttool.h which is
* 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
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef GIMP_POLYGON_SELECT_TOOL_H
#define GIMP_POLYGON_SELECT_TOOL_H
#include "gimpselectiontool.h"
#define GIMP_TYPE_POLYGON_SELECT_TOOL (gimp_polygon_select_tool_get_type ())
#define GIMP_POLYGON_SELECT_TOOL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_POLYGON_SELECT_TOOL, GimpPolygonSelectTool))
#define GIMP_POLYGON_SELECT_TOOL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_POLYGON_SELECT_TOOL, GimpPolygonSelectToolClass))
#define GIMP_IS_POLYGON_SELECT_TOOL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_POLYGON_SELECT_TOOL))
#define GIMP_IS_POLYGON_SELECT_TOOL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_POLYGON_SELECT_TOOL))
#define GIMP_POLYGON_SELECT_TOOL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_POLYGON_SELECT_TOOL, GimpPolygonSelectToolClass))
typedef struct _GimpPolygonSelectTool GimpPolygonSelectTool;
typedef struct _GimpPolygonSelectToolPrivate GimpPolygonSelectToolPrivate;
typedef struct _GimpPolygonSelectToolClass GimpPolygonSelectToolClass;
struct _GimpPolygonSelectTool
{
GimpSelectionTool parent_instance;
GimpPolygonSelectToolPrivate *priv;
};
struct _GimpPolygonSelectToolClass
{
GimpSelectionToolClass parent_class;
/* virtual function */
void (* select) (GimpPolygonSelectTool *poly_select_tool,
GimpDisplay *display);
};
void gimp_polygon_select_tool_register (GimpToolRegisterCallback callback,
gpointer data);
GType gimp_polygon_select_tool_get_type (void) G_GNUC_CONST;
void gimp_polygon_select_tool_select (GimpPolygonSelectTool *poly_sel,
GimpDisplay *display);
#endif /* GIMP_POLYGON_SELECT_TOOL_H */
......@@ -267,6 +267,7 @@
#define GIMP_HELP_TOOL_PENCIL "gimp-tool-pencil"
#define GIMP_HELP_TOOL_PERSPECTIVE "gimp-tool-perspective"
#define GIMP_HELP_TOOL_PERSPECTIVE_CLONE "gimp-tool-perspective-clone"
#define GIMP_HELP_TOOL_POLYGON_SELECT "gimp-tool-polygon-select"
#define GIMP_HELP_TOOL_POSTERIZE "gimp-tool-posterize"
#define GIMP_HELP_TOOL_RECT_SELECT "gimp-tool-rect-select"
#define GIMP_HELP_TOOL_ROTATE "gimp-tool-rotate"
......
......@@ -313,6 +313,7 @@ static const GtkStockItem gimp_stock_items[] =
{ GIMP_STOCK_TOOL_PENCIL, NULL, 0, 0, LIBGIMP_DOMAIN },
{ GIMP_STOCK_TOOL_PERSPECTIVE, N_("_Transform"), 0, 0, LIBGIMP_DOMAIN },
{ GIMP_STOCK_TOOL_PERSPECTIVE_CLONE, NULL, 0, 0, LIBGIMP_DOMAIN },
{ GIMP_STOCK_TOOL_POLYGON_SELECT, NULL, 0, 0, LIBGIMP_DOMAIN },
{ GIMP_STOCK_TOOL_POSTERIZE, NULL, 0, 0, LIBGIMP_DOMAIN },
{ GIMP_STOCK_TOOL_RECT_SELECT, NULL, 0, 0, LIBGIMP_DOMAIN },
{ GIMP_STOCK_TOOL_ROTATE, N_("_Rotate"), 0, 0, LIBGIMP_DOMAIN },
......@@ -463,6 +464,7 @@ gimp_stock_button_pixbufs[] =
{ GIMP_STOCK_TOOL_PENCIL, stock_tool_pencil_22 },
{ GIMP_STOCK_TOOL_PERSPECTIVE, stock_tool_perspective_22 },
{ GIMP_STOCK_TOOL_PERSPECTIVE_CLONE, stock_tool_perspective_clone_22 },
{ GIMP_STOCK_TOOL_POLYGON_SELECT, stock_tool_polygon_select_22 },
{ GIMP_STOCK_TOOL_POSTERIZE, stock_tool_posterize_22 },
{ GIMP_STOCK_TOOL_RECT_SELECT, stock_tool_rect_select_22 },
{ GIMP_STOCK_TOOL_ROTATE, stock_tool_rotate_22 },
......@@ -624,6 +626,7 @@ gimp_stock_menu_pixbufs[] =
{ GIMP_STOCK_TOOL_PENCIL, stock_tool_pencil_16 },
{ GIMP_STOCK_TOOL_PERSPECTIVE, stock_tool_perspective_16 },
{ GIMP_STOCK_TOOL_PERSPECTIVE_CLONE, stock_tool_perspective_clone_16 },
{ GIMP_STOCK_TOOL_POLYGON_SELECT, stock_tool_polygon_select_16 },
{ GIMP_STOCK_TOOL_POSTERIZE, stock_tool_posterize_16 },
{ GIMP_STOCK_TOOL_RECT_SELECT, stock_tool_rect_select_16 },
{ GIMP_STOCK_TOOL_ROTATE, stock_tool_rotate_16 },
......
......@@ -130,6 +130,7 @@ G_BEGIN_DECLS
#define GIMP_STOCK_TOOL_PENCIL "gimp-tool-pencil"
#define GIMP_STOCK_TOOL_PERSPECTIVE "gimp-tool-perspective"
#define GIMP_STOCK_TOOL_PERSPECTIVE_CLONE "gimp-tool-perspective-clone"
#define GIMP_STOCK_TOOL_POLYGON_SELECT "gimp-tool-polygon-select"
#define GIMP_STOCK_TOOL_POSTERIZE "gimp-tool-posterize"
#define GIMP_STOCK_TOOL_RECT_SELECT "gimp-tool-rect-select"
#define GIMP_STOCK_TOOL_ROTATE "gimp-tool-rotate"
......
......@@ -492,6 +492,7 @@
<menuitem action="tools-rect-select" />
<menuitem action="tools-ellipse-select" />
<menuitem action="tools-free-select" />
<menuitem action="tools-polygon-select" />
<menuitem action="tools-foreground-select" />
<menuitem action="tools-fuzzy-select" />
<menuitem action="tools-by-color-select" />
......
......@@ -315,6 +315,8 @@ STOCK_TOOL_IMAGES = \
tools/stock-tool-perspective-22.png \
tools/stock-tool-perspective-clone-16.png \
tools/stock-tool-perspective-clone-22.png \
tools/stock-tool-polygon-select-16.png \
tools/stock-tool-polygon-select-22.png \
tools/stock-tool-posterize-16.png \
tools/stock-tool-posterize-22.png \
tools/stock-tool-rect-select-16.png \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment