added GIMP_UNDO_FOREGROUND_SELECT.

2005-08-03  Sven Neumann  <sven@gimp.org>

	* app/core/core-enums.[ch]: added GIMP_UNDO_FOREGROUND_SELECT.

	* app/tools/Makefile.am
	* app/tools/gimpforegroundselecttool-undo.[ch]: added stubs for
	undo in the new foreground selection tool.

	* tools/pdbgen/pdb/procedural_db.pdb: include gimpbase.h for
	gimp_canonicalize_identifier().

	* app/pdb/procedural_db_cmds.c: regenerated.

	* app/file/file-utils.c: fixed signedness warning.
This commit is contained in:
Sven Neumann 2005-08-03 01:54:27 +00:00 committed by Sven Neumann
parent a451850ad7
commit 94bef475d2
10 changed files with 162 additions and 5 deletions

View File

@ -1,3 +1,18 @@
2005-08-03 Sven Neumann <sven@gimp.org>
* app/core/core-enums.[ch]: added GIMP_UNDO_FOREGROUND_SELECT.
* app/tools/Makefile.am
* app/tools/gimpforegroundselecttool-undo.[ch]: added stubs for
undo in the new foreground selection tool.
* tools/pdbgen/pdb/procedural_db.pdb: include gimpbase.h for
gimp_canonicalize_identifier().
* app/pdb/procedural_db_cmds.c: regenerated.
* app/file/file-utils.c: fixed signedness warning.
2005-08-03 Sven Neumann <sven@gimp.org>
* libgimpmath/gimpmd5.c

View File

@ -793,6 +793,7 @@ gimp_undo_type_get_type (void)
{ GIMP_UNDO_TRANSFORM, "GIMP_UNDO_TRANSFORM", "transform" },
{ GIMP_UNDO_PAINT, "GIMP_UNDO_PAINT", "paint" },
{ GIMP_UNDO_INK, "GIMP_UNDO_INK", "ink" },
{ GIMP_UNDO_FOREGROUND_SELECT, "GIMP_UNDO_FOREGROUND_SELECT", "foreground-select" },
{ GIMP_UNDO_PARASITE_ATTACH, "GIMP_UNDO_PARASITE_ATTACH", "parasite-attach" },
{ GIMP_UNDO_PARASITE_REMOVE, "GIMP_UNDO_PARASITE_REMOVE", "parasite-remove" },
{ GIMP_UNDO_CANT, "GIMP_UNDO_CANT", "cant" },
@ -879,6 +880,7 @@ gimp_undo_type_get_type (void)
{ GIMP_UNDO_TRANSFORM, N_("Transform"), NULL },
{ GIMP_UNDO_PAINT, N_("Paint"), NULL },
{ GIMP_UNDO_INK, N_("Ink"), NULL },
{ GIMP_UNDO_FOREGROUND_SELECT, "GIMP_UNDO_FOREGROUND_SELECT", NULL },
{ GIMP_UNDO_PARASITE_ATTACH, N_("Attach parasite"), NULL },
{ GIMP_UNDO_PARASITE_REMOVE, N_("Remove parasite"), NULL },
{ GIMP_UNDO_CANT, N_("EEK: can't undo"), NULL },

View File

@ -422,6 +422,7 @@ typedef enum /*< pdb-skip >*/
GIMP_UNDO_TRANSFORM, /*< desc="Transform" >*/
GIMP_UNDO_PAINT, /*< desc="Paint" >*/
GIMP_UNDO_INK, /*< desc="Ink" >*/
GIMP_UNDO_FOREGROUND_SELECT, /*< desc="Select foreground >*/
GIMP_UNDO_PARASITE_ATTACH, /*< desc="Attach parasite" >*/
GIMP_UNDO_PARASITE_REMOVE, /*< desc="Remove parasite" >*/

View File

@ -491,7 +491,7 @@ file_check_single_magic (const gchar *offset,
const gchar *num_operator_ptr;
gchar num_operator;
gchar num_test;
guchar mem_testval[256];
gchar mem_testval[256];
/* Check offset */
if (sscanf (offset, "%ld", &offs) != 1) return (0);
@ -606,7 +606,7 @@ file_check_single_magic (const gchar *offset,
if (offs + numbytes <= headsize) /* We have it in memory ? */
{
found = (memcmp (mem_testval, file_head+offs, numbytes) == 0);
found = (memcmp (mem_testval, file_head + offs, numbytes) == 0);
}
else /* Read it from file */
{
@ -615,7 +615,7 @@ file_check_single_magic (const gchar *offset,
for (k = 0; found && (k < numbytes); k++)
{
c = getc (ifp);
found = (c != EOF) && (c == (int)mem_testval[k]);
found = (c != EOF) && (c == (int) mem_testval[k]);
}
}
}

View File

@ -23,6 +23,8 @@
#include <glib-object.h>
#include "libgimpbase/gimpbase.h"
#include "pdb-types.h"
#include "procedural_db.h"

View File

@ -72,6 +72,8 @@ libapptools_a_sources = \
gimpforegroundselectoptions.h \
gimpforegroundselecttool.c \
gimpforegroundselecttool.h \
gimpforegroundselecttool-undo.c \
gimpforegroundselecttool-undo.h \
gimpfuzzyselecttool.c \
gimpfuzzyselecttool.h \
gimphistogramoptions.c \

View File

@ -0,0 +1,107 @@
/* 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
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <gtk/gtk.h>
#include "tools-types.h"
#include "base/tile-manager.h"
#include "core/gimpimage-undo.h"
#include "core/gimpimage.h"
#include "core/gimpundo.h"
#include "gimptoolcontrol.h"
#include "gimpforegroundselecttool.h"
#include "gimpforegroundselecttool-undo.h"
#include "tool_manager.h"
typedef struct
{
gint tool_ID;
} FgSelectUndo;
static gboolean undo_pop_foreground_select (GimpUndo *undo,
GimpUndoMode undo_mode,
GimpUndoAccumulator *accum);
static void undo_free_foreground_select (GimpUndo *undo,
GimpUndoMode undo_mode);
gboolean
gimp_foreground_select_tool_push_undo (GimpImage *gimage,
const gchar *undo_desc,
gint tool_ID)
{
GimpUndo *new;
if ((new = gimp_image_undo_push (gimage, GIMP_TYPE_UNDO,
sizeof (FgSelectUndo),
sizeof (FgSelectUndo),
GIMP_UNDO_FOREGROUND_SELECT, undo_desc,
FALSE,
undo_pop_foreground_select,
undo_free_foreground_select,
NULL)))
{
FgSelectUndo *undo = new->data;
undo->tool_ID = tool_ID;
return TRUE;
}
return FALSE;
}
static gboolean
undo_pop_foreground_select (GimpUndo *undo,
GimpUndoMode undo_mode,
GimpUndoAccumulator *accum)
{
GimpTool *active_tool;
active_tool = tool_manager_get_active (undo->gimage->gimp);
if (GIMP_IS_FOREGROUND_SELECT_TOOL (active_tool))
{
FgSelectUndo *fg_undo = undo->data;
/* only pop if the active tool is the tool that pushed this undo */
if (fg_undo->tool_ID == active_tool->ID)
{
}
}
return TRUE;
}
static void
undo_free_foreground_select (GimpUndo *undo,
GimpUndoMode undo_mode)
{
FgSelectUndo *fg_undo = undo->data;
g_free (fg_undo);
}

View File

@ -0,0 +1,28 @@
/* 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
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __GIMP_FOREGROUND_SELECT_TOOL_UNDO_H__
#define __GIMP_FOREGROUND_SELECT_TOOL_UNDO_H__
gboolean gimp_foreground_select_tool_push_undo (GimpImage *gimage,
const gchar *undo_desc,
gint tool_ID);
#endif /* __GIMP_FOREGROUND_SELECT_TOOL_UNDO_H__ */

View File

@ -32,13 +32,13 @@ VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
datadir = @datadir@
datarootdir = @datarootdir@
libdir = @libdir@
localedir = $(libdir)/locale
gnulocaledir = $(datadir)/locale
gettextsrcdir = $(datadir)/glib-2.0/gettext/po
subdir = po
install_sh = @install_sh@
mkdir_p = @mkdir_p@
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
INSTALL = @INSTALL@

View File

@ -388,7 +388,7 @@ CODE
);
}
@headers = qw("core/gimp.h" "procedural-db-query.h");
@headers = qw("libgimpbase/gimpbase.h" "core/gimp.h" "procedural-db-query.h");
@procs = qw(procedural_db_temp_name procedural_db_dump
procedural_db_query procedural_db_proc_info