Removed support for pluggable tools:

2003-04-15  Sven Neumann  <sven@gimp.org>

	Removed support for pluggable tools:

	* configure.in: bumped version number to 1.3.15.

	* Makefile.am
	* libgimpproxy
	* libgimptool
	* plug-ins/Makefile.am
	* plug-ins/plugin-helper
	* plug-ins/tools: removed libgimpproxy, libgimptool and plug-ins
	that used it.

	* tools/Makefile.am
	* tools/gimp-mkproxy: removed tool that used to generate
	libgimpproxy.

	* app/core/core-enums.h
	* app/core/gimpchannel.h
	* app/display/display-types.h
	* app/widgets/widgets-enums.h: removed proxy-skip/resume stuff.

	* app/core/gimpobject.c: use gimp marshallers.

	* app/tools/Makefile.am
	* app/tools/gimptool.h
	* app/tools/tools-enums.[ch]: moved these files back from
	libgimptool.

	* app/tools/gimptool.c
	* app/tools/gimptoolcontrol.h: merged back functionality from
	libgimptool.

	* app/Makefile.am
	* app/display/gimpdisplay.c
	* app/display/gimpdisplayshell-callbacks.c
	* app/gui/tools-commands.c
	* app/tools/gimpairbrushtool.c
	* app/tools/gimpbucketfilltool.h
	* app/tools/gimpdrawtool.h
	* app/tools/gimpimagemaptool.h
	* app/tools/gimpinktool.h
	* app/tools/gimptoolmodule.c
	* app/tools/tool_manager.c
	* app/tools/tools-types.h
	* app/tools/tools.c
	* tools/pdbgen/Makefile.am: changed accordingly.
This commit is contained in:
Sven Neumann 2003-04-15 14:20:19 +00:00 committed by Sven Neumann
parent e745778f25
commit 0c399e5c93
71 changed files with 584 additions and 4911 deletions

View File

@ -1,3 +1,52 @@
2003-04-15 Sven Neumann <sven@gimp.org>
Removed support for pluggable tools:
* configure.in: bumped version number to 1.3.15.
* Makefile.am
* libgimpproxy
* libgimptool
* plug-ins/Makefile.am
* plug-ins/plugin-helper
* plug-ins/tools: removed libgimpproxy, libgimptool and plug-ins
that used it.
* tools/Makefile.am
* tools/gimp-mkproxy: removed tool that used to generate
libgimpproxy.
* app/core/core-enums.h
* app/core/gimpchannel.h
* app/display/display-types.h
* app/widgets/widgets-enums.h: removed proxy-skip/resume stuff.
* app/core/gimpobject.c: use gimp marshallers.
* app/tools/Makefile.am
* app/tools/gimptool.h
* app/tools/tools-enums.[ch]: moved these files back from
libgimptool.
* app/tools/gimptool.c
* app/tools/gimptoolcontrol.h: merged back functionality from
libgimptool.
* app/Makefile.am
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/gui/tools-commands.c
* app/tools/gimpairbrushtool.c
* app/tools/gimpbucketfilltool.h
* app/tools/gimpdrawtool.h
* app/tools/gimpimagemaptool.h
* app/tools/gimpinktool.h
* app/tools/gimptoolmodule.c
* app/tools/tool_manager.c
* app/tools/tools-types.h
* app/tools/tools.c
* tools/pdbgen/Makefile.am: changed accordingly.
2003-04-15 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpcontainergridview.[ch]: added a "selected_item"

View File

@ -18,8 +18,6 @@ SUBDIRS = \
libgimpbase \
libgimpmodule \
libgimpwidgets \
libgimpproxy \
libgimptool \
libgimp \
app \
$(GIMP_MODULES) \

View File

@ -115,7 +115,6 @@ gimp_1_3_LDADD = \
$(top_builddir)/libgimpbase/libgimpbase-$(LT_RELEASE).la \
$(top_builddir)/libgimpmodule/libgimpmodule-$(LT_RELEASE).la \
$(top_builddir)/libgimpwidgets/libgimpwidgets-$(LT_RELEASE).la \
$(top_builddir)/libgimptool/libgimptool-$(LT_RELEASE).la \
$(GTK_LIBS) \
$(PANGOFT2_LIBS) \
$(LIBART_LIBS) \

View File

@ -29,7 +29,7 @@
#include "display/gimpdisplay.h"
#include "libgimptool/gimptool.h"
#include "tools/gimptool.h"
#include "tools/tool_manager.h"

View File

@ -16,14 +16,12 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/*< proxy-skip >*/
#ifndef __CORE_ENUMS_H__
#define __CORE_ENUMS_H__
#if 0
This file is parsed by three scripts, enumgen.pl in tools/pdbgen,
gimp-mkenums, and gimp-mkproxy. All enums that are not marked with
This file is parsed by two scripts, enumgen.pl in tools/pdbgen,
and gimp-mkenums. All enums that are not marked with
/*< pdb-skip >*/ are exported to libgimp and the PDB. Enums that are
not marked with /*< skip >*/ are registered with the GType system.
If you want the enum to be skipped by both scripts, you have to use
@ -31,9 +29,6 @@
All enum values that are marked with /*< skip >*/ are skipped for
both targets.
Anything not between proxy-skip and proxy-resume
pairs will be copied into libgimpproxy by gimp-mkproxy.
#endif
@ -84,7 +79,6 @@ typedef enum
GType gimp_channel_ops_get_type (void) G_GNUC_CONST;
/*< proxy-resume >*/
typedef enum
{
GIMP_CHANNEL_OP_ADD, /*< desc="Add to the current selection" >*/
@ -92,7 +86,6 @@ typedef enum
GIMP_CHANNEL_OP_REPLACE, /*< desc="Replace the current selection" >*/
GIMP_CHANNEL_OP_INTERSECT /*< desc="Intersect with the current selection" >*/
} GimpChannelOps;
/*< proxy-skip >*/
#define GIMP_TYPE_CHANNEL_TYPE (gimp_channel_type_get_type ())

View File

@ -16,8 +16,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/*< proxy-skip >*/
#ifndef __CORE_TYPES_H__
#define __CORE_TYPES_H__
@ -47,7 +45,7 @@ typedef enum
/* base objects */
typedef struct _GimpObject GimpObject; /*< proxy-include >*/
typedef struct _GimpObject GimpObject;
typedef struct _Gimp Gimp;
@ -67,8 +65,8 @@ typedef struct _GimpItem GimpItem;
typedef struct _GimpBuffer GimpBuffer;
typedef struct _GimpPaintInfo GimpPaintInfo;
typedef struct _GimpToolInfo GimpToolInfo; /*< proxy-include >*/
typedef struct _GimpToolOptions GimpToolOptions; /*< proxy-include >*/
typedef struct _GimpToolInfo GimpToolInfo;
typedef struct _GimpToolOptions GimpToolOptions;
typedef struct _GimpImagefile GimpImagefile;
typedef struct _GimpDocumentList GimpDocumentList;
@ -78,7 +76,7 @@ typedef struct _GimpTemplate GimpTemplate;
/* drawable objects */
typedef struct _GimpDrawable GimpDrawable; /*< proxy-resume >*/
typedef struct _GimpDrawable GimpDrawable;
typedef struct _GimpChannel GimpChannel;
@ -90,7 +88,7 @@ typedef struct _GimpImage GimpImage;
/* data objects */
typedef struct _GimpData GimpData; /*< proxy-skip >*/
typedef struct _GimpData GimpData;
typedef struct _GimpBrush GimpBrush;
typedef struct _GimpBrushGenerated GimpBrushGenerated;
@ -120,7 +118,7 @@ typedef struct _GimpUndoAccumulator GimpUndoAccumulator;
/* non-object types */
typedef struct _GimpCoords GimpCoords; /*< proxy-include >*/
typedef struct _GimpCoords GimpCoords;
typedef struct _GimpGuide GimpGuide;

View File

@ -19,10 +19,8 @@
#ifndef __GIMP_CHANNEL_H__
#define __GIMP_CHANNEL_H__
#include "gimpdrawable.h"
/*< proxy-skip >*/
/* Half way point where a region is no longer visible in a selection */
#define HALF_WAY 127
@ -38,8 +36,6 @@
typedef struct _GimpChannelClass GimpChannelClass;
/*< proxy-resume >*/
struct _GimpChannel
{
GimpDrawable parent_instance;
@ -60,8 +56,6 @@ struct _GimpChannel
gint x2, y2; /* lower right hand coordinate */
};
/*< proxy-skip >*/
struct _GimpChannelClass
{
GimpDrawableClass parent_class;

View File

@ -19,10 +19,8 @@
#ifndef __GIMP_CHANNEL_H__
#define __GIMP_CHANNEL_H__
#include "gimpdrawable.h"
/*< proxy-skip >*/
/* Half way point where a region is no longer visible in a selection */
#define HALF_WAY 127
@ -38,8 +36,6 @@
typedef struct _GimpChannelClass GimpChannelClass;
/*< proxy-resume >*/
struct _GimpChannel
{
GimpDrawable parent_instance;
@ -60,8 +56,6 @@ struct _GimpChannel
gint x2, y2; /* lower right hand coordinate */
};
/*< proxy-skip >*/
struct _GimpChannelClass
{
GimpDrawableClass parent_class;

View File

@ -26,6 +26,7 @@
#include "core-types.h"
#include "gimpmarshal.h"
#include "gimpobject.h"
@ -101,16 +102,13 @@ gimp_object_class_init (GimpObjectClass *klass)
parent_class = g_type_class_peek_parent (klass);
/* we use the gobject marshaller names directly so libgimpproxy doesn't need
* gimpmarshal.* around. -Yosh
*/
object_signals[DISCONNECT] =
g_signal_new ("disconnect",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GimpObjectClass, disconnect),
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
gimp_marshal_VOID__VOID,
G_TYPE_NONE, 0);
object_signals[NAME_CHANGED] =
@ -119,7 +117,7 @@ gimp_object_class_init (GimpObjectClass *klass)
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GimpObjectClass, name_changed),
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
gimp_marshal_VOID__VOID,
G_TYPE_NONE, 0);
object_class->dispose = gimp_object_dispose;

View File

@ -33,8 +33,7 @@
#include "widgets/gimpitemfactory.h"
#include "libgimptool/gimptool.h"
#include "tools/gimptool.h"
#include "tools/tool_manager.h"
#include "gimpdisplay.h"

View File

@ -16,7 +16,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/*< proxy-skip >*/
#ifndef __DISPLAY_TYPES_H__
#define __DISPLAY_TYPES_H__
@ -26,10 +25,10 @@
#include "display/display-enums.h"
typedef struct _GimpDisplay GimpDisplay; /*< proxy-resume >*/
typedef struct _GimpDisplay GimpDisplay;
typedef struct _GimpDisplayShell GimpDisplayShell;
typedef struct _GimpNavigationView GimpNavigationView; /*< proxy-skip >*/
typedef struct _GimpNavigationView GimpNavigationView;
typedef struct _GimpStatusbar GimpStatusbar;
typedef struct _NavigationDialog NavigationDialog;

View File

@ -33,8 +33,7 @@
#include "widgets/gimpitemfactory.h"
#include "libgimptool/gimptool.h"
#include "tools/gimptool.h"
#include "tools/tool_manager.h"
#include "gimpdisplay.h"

View File

@ -39,9 +39,8 @@
#include "core/gimplayer.h"
#include "core/gimptoolinfo.h"
#include "libgimptool/gimptoolcontrol.h"
#include "tools/gimpmovetool.h"
#include "tools/gimptoolcontrol.h"
#include "tools/tool_manager.h"
#include "widgets/gimpcursor.h"

View File

@ -29,7 +29,7 @@
#include "display/gimpdisplay.h"
#include "libgimptool/gimptool.h"
#include "tools/gimptool.h"
#include "tools/tool_manager.h"

View File

@ -20,7 +20,7 @@
#define __GIMP_INK_TOOL_H__
#include "libgimptool/gimptool.h"
#include "gimptool.h"
#include "gimpinktool-blob.h" /* only used by ink */

View File

@ -2,7 +2,8 @@
noinst_LIBRARIES = libapptools.a
libapptools_a_SOURCES = \
libapptools_a_sources = \
tools-enums.h \
tools-types.h \
tools.c \
tools.h \
@ -115,6 +116,7 @@ libapptools_a_SOURCES = \
gimpthresholdtool.c \
gimpthresholdtool.h \
gimptool.c \
gimptool.h \
gimptoolcontrol.c \
gimptoolcontrol.h \
gimptoolmodule.c \
@ -136,15 +138,37 @@ libapptools_a_SOURCES = \
tool_manager.c \
tool_manager.h
libapptools_a_built_sources = tools-enums.c
libapptools_a_SOURCES = $(libapptools_a_built_sources) $(libapptools_a_sources)
AM_CPPFLAGS = \
-DG_LOG_DOMAIN=\"Gimp-Tools\" \
@GIMP_THREAD_FLAGS@ \
@GIMP_MP_FLAGS@
INCLUDES = \
-I$(top_builddir) \
-I$(top_srcdir) \
-I$(top_builddir)/app \
-I$(top_srcdir)/app \
$(GTK_CFLAGS) \
-I$(includedir)
#
# rules to generate built sources
#
# setup autogeneration dependencies
gen_sources = xgen-tec
CLEANFILES = $(gen_sources)
$(srcdir)/tools-enums.c: $(srcdir)/tools-enums.h $(GIMP_MKENUMS)
$(GIMP_MKENUMS) \
--fhead "#include \"config.h\"\n#include <glib-object.h>\n#include \"core/core-enums.h\"\n#include \"tools-enums.h\"\n#include \"gimp-intl.h\"" \
--fprod "\n/* enumerations from \"@filename@\" */" \
--vhead "\nstatic const GEnumValue @enum_name@_enum_values[] =\n{" \
--vprod " { @VALUENAME@, @valuedesc@, \"@valuenick@\" }," \
--vtail " { 0, NULL, NULL }\n};\n\nGType\n@enum_name@_get_type (void)\n{\n static GType enum_type = 0;\n\n if (!enum_type)\n enum_type = g_enum_register_static (\"@EnumName@\", @enum_name@_enum_values);\n\n return enum_type;\n}\n" \
$(srcdir)/tools-enums.h > xgen-tec \
&& cp xgen-tec $(@F) \
&& rm -f xgen-tec

View File

@ -24,8 +24,6 @@
#include "tools-types.h"
#include "libgimptool/gimptool.h"
#include "core/gimptoolinfo.h"
#include "paint/gimpairbrush.h"

View File

@ -20,7 +20,7 @@
#define __GIMP_BUCKET_FILL_TOOL_H__
#include "libgimptool/gimptool.h"
#include "gimptool.h"
#define GIMP_TYPE_BUCKET_FILL_TOOL (gimp_bucket_fill_tool_get_type ())

View File

@ -20,7 +20,7 @@
#define __GIMP_DRAW_TOOL_H__
#include "libgimptool/gimptool.h"
#include "gimptool.h"
typedef enum

View File

@ -20,7 +20,7 @@
#define __GIMP_IMAGE_MAP_TOOL_H__
#include "libgimptool/gimptool.h"
#include "gimptool.h"
#define GIMP_TYPE_IMAGE_MAP_TOOL (gimp_image_map_tool_get_type ())

View File

@ -20,7 +20,7 @@
#define __GIMP_INK_TOOL_H__
#include "libgimptool/gimptool.h"
#include "gimptool.h"
#include "gimpinktool-blob.h" /* only used by ink */

View File

@ -29,9 +29,360 @@
#include "display/gimpdisplayshell-cursor.h"
#include "display/gimpstatusbar.h"
#include "libgimptool/gimptool.h"
#include "gimptool.h"
#include "gimptoolcontrol.h"
static void gimp_tool_class_init (GimpToolClass *klass);
static void gimp_tool_init (GimpTool *tool);
static void gimp_tool_finalize (GObject *object);
static void gimp_tool_real_initialize (GimpTool *tool,
GimpDisplay *gdisp);
static void gimp_tool_real_control (GimpTool *tool,
GimpToolAction action,
GimpDisplay *gdisp);
static void gimp_tool_real_button_press (GimpTool *tool,
GimpCoords *coords,
guint32 time,
GdkModifierType state,
GimpDisplay *gdisp);
static void gimp_tool_real_button_release (GimpTool *tool,
GimpCoords *coords,
guint32 time,
GdkModifierType state,
GimpDisplay *gdisp);
static void gimp_tool_real_motion (GimpTool *tool,
GimpCoords *coords,
guint32 time,
GdkModifierType state,
GimpDisplay *gdisp);
static void gimp_tool_real_arrow_key (GimpTool *tool,
GdkEventKey *kevent,
GimpDisplay *gdisp);
static void gimp_tool_real_modifier_key (GimpTool *tool,
GdkModifierType key,
gboolean press,
GdkModifierType state,
GimpDisplay *gdisp);
static void gimp_tool_real_oper_update (GimpTool *tool,
GimpCoords *coords,
GdkModifierType state,
GimpDisplay *gdisp);
static void gimp_tool_real_cursor_update (GimpTool *tool,
GimpCoords *coords,
GdkModifierType state,
GimpDisplay *gdisp);
static GimpObjectClass *parent_class = NULL;
static gint global_tool_ID = 0;
GType
gimp_tool_get_type (void)
{
static GType tool_type = 0;
if (! tool_type)
{
static const GTypeInfo tool_info =
{
sizeof (GimpToolClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gimp_tool_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpTool),
0, /* n_preallocs */
(GInstanceInitFunc) gimp_tool_init,
};
tool_type = g_type_register_static (GIMP_TYPE_OBJECT,
"GimpTool",
&tool_info, 0);
}
return tool_type;
}
static void
gimp_tool_class_init (GimpToolClass *klass)
{
GObjectClass *object_class;
object_class = G_OBJECT_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
object_class->finalize = gimp_tool_finalize;
klass->initialize = gimp_tool_real_initialize;
klass->control = gimp_tool_real_control;
klass->button_press = gimp_tool_real_button_press;
klass->button_release = gimp_tool_real_button_release;
klass->motion = gimp_tool_real_motion;
klass->arrow_key = gimp_tool_real_arrow_key;
klass->modifier_key = gimp_tool_real_modifier_key;
klass->oper_update = gimp_tool_real_oper_update;
klass->cursor_update = gimp_tool_real_cursor_update;
}
static void
gimp_tool_init (GimpTool *tool)
{
tool->ID = global_tool_ID++;
tool->control = GIMP_TOOL_CONTROL (g_object_new (GIMP_TYPE_TOOL_CONTROL,
NULL));
tool->gdisp = NULL;
tool->drawable = NULL;
}
static void
gimp_tool_finalize (GObject *object)
{
GimpTool *tool = GIMP_TOOL (object);
if (tool->control)
{
g_object_unref (tool->control);
tool->control = NULL;
}
G_OBJECT_CLASS (parent_class)->finalize (object);
}
/* standard member functions */
static void
gimp_tool_real_initialize (GimpTool *tool,
GimpDisplay *gdisp)
{
}
static void
gimp_tool_real_control (GimpTool *tool,
GimpToolAction action,
GimpDisplay *gdisp)
{
}
static void
gimp_tool_real_motion (GimpTool *tool,
GimpCoords *coords,
guint32 time,
GdkModifierType state,
GimpDisplay *gdisp)
{
}
static void
gimp_tool_real_arrow_key (GimpTool *tool,
GdkEventKey *kevent,
GimpDisplay *gdisp)
{
}
static void
gimp_tool_real_modifier_key (GimpTool *tool,
GdkModifierType key,
gboolean press,
GdkModifierType state,
GimpDisplay *gdisp)
{
}
static void
gimp_tool_real_oper_update (GimpTool *tool,
GimpCoords *coords,
GdkModifierType state,
GimpDisplay *gdisp)
{
}
static void
gimp_tool_real_cursor_update (GimpTool *tool,
GimpCoords *coords,
GdkModifierType state,
GimpDisplay *gdisp)
{
if (gimp_tool_control_is_toggled (tool->control))
{
gimp_tool_set_cursor (tool, gdisp,
gimp_tool_control_get_toggle_cursor (tool->control),
gimp_tool_control_get_toggle_tool_cursor (tool->control),
gimp_tool_control_get_toggle_cursor_modifier (tool->control));
}
else
{
gimp_tool_set_cursor (tool, gdisp,
gimp_tool_control_get_cursor (tool->control),
gimp_tool_control_get_tool_cursor (tool->control),
gimp_tool_control_get_cursor_modifier (tool->control));
}
}
/* public functions */
void
gimp_tool_initialize (GimpTool *tool,
GimpDisplay *gdisp)
{
g_return_if_fail (GIMP_IS_TOOL (tool));
GIMP_TOOL_GET_CLASS (tool)->initialize (tool, gdisp);
}
void
gimp_tool_control (GimpTool *tool,
GimpToolAction action,
GimpDisplay *gdisp)
{
g_return_if_fail (GIMP_IS_TOOL (tool));
switch (action)
{
case PAUSE:
if (!gimp_tool_control_is_paused (tool->control))
{
GIMP_TOOL_GET_CLASS (tool)->control (tool, action, gdisp);
}
gimp_tool_control_pause (tool->control);
break;
case RESUME:
if (gimp_tool_control_is_paused (tool->control))
{
gimp_tool_control_resume (tool->control);
if (!gimp_tool_control_is_paused (tool->control))
{
GIMP_TOOL_GET_CLASS (tool)->control (tool, action, gdisp);
}
}
else
{
g_warning ("gimp_tool_control(): "
"unable to RESUME tool with tool->paused_count == 0");
}
break;
case HALT:
GIMP_TOOL_GET_CLASS (tool)->control (tool, action, gdisp);
gimp_tool_control_halt (tool->control);
break;
}
}
void
gimp_tool_button_press (GimpTool *tool,
GimpCoords *coords,
guint32 time,
GdkModifierType state,
GimpDisplay *gdisp)
{
g_return_if_fail (GIMP_IS_TOOL (tool));
g_return_if_fail (coords != NULL);
/* FIXME */
/*g_return_if_fail (GIMP_IS_DISPLAY (gdisp));*/
GIMP_TOOL_GET_CLASS (tool)->button_press (tool, coords, time, state, gdisp);
}
void
gimp_tool_button_release (GimpTool *tool,
GimpCoords *coords,
guint32 time,
GdkModifierType state,
GimpDisplay *gdisp)
{
g_return_if_fail (GIMP_IS_TOOL (tool));
g_return_if_fail (coords != NULL);
/* FIXME */
/*g_return_if_fail (GIMP_IS_DISPLAY (gdisp));*/
GIMP_TOOL_GET_CLASS (tool)->button_release (tool, coords, time, state, gdisp);
}
void
gimp_tool_motion (GimpTool *tool,
GimpCoords *coords,
guint32 time,
GdkModifierType state,
GimpDisplay *gdisp)
{
g_return_if_fail (GIMP_IS_TOOL (tool));
g_return_if_fail (coords != NULL);
/* FIXME */
/*g_return_if_fail (GIMP_IS_DISPLAY (gdisp));*/
GIMP_TOOL_GET_CLASS (tool)->motion (tool, coords, time, state, gdisp);
}
void
gimp_tool_arrow_key (GimpTool *tool,
GdkEventKey *kevent,
GimpDisplay *gdisp)
{
g_return_if_fail (GIMP_IS_TOOL (tool));
/* FIXME */
/* g_return_if_fail (GIMP_IS_DISPLAY (gdisp)); */
GIMP_TOOL_GET_CLASS (tool)->arrow_key (tool, kevent, gdisp);
}
void
gimp_tool_modifier_key (GimpTool *tool,
GdkModifierType key,
gboolean press,
GdkModifierType state,
GimpDisplay *gdisp)
{
g_return_if_fail (GIMP_IS_TOOL (tool));
/* FIXME */
/* g_return_if_fail (GIMP_IS_DISPLAY (gdisp)); */
GIMP_TOOL_GET_CLASS (tool)->modifier_key (tool, key, press, state, gdisp);
}
void
gimp_tool_oper_update (GimpTool *tool,
GimpCoords *coords,
GdkModifierType state,
GimpDisplay *gdisp)
{
g_return_if_fail (GIMP_IS_TOOL (tool));
g_return_if_fail (coords != NULL);
/* FIXME*/
/*g_return_if_fail (GIMP_IS_DISPLAY (gdisp));*/
GIMP_TOOL_GET_CLASS (tool)->oper_update (tool, coords, state, gdisp);
}
void
gimp_tool_cursor_update (GimpTool *tool,
GimpCoords *coords,
GdkModifierType state,
GimpDisplay *gdisp)
{
g_return_if_fail (GIMP_IS_TOOL (tool));
g_return_if_fail (coords != NULL);
/* FIXME */
/* g_return_if_fail (GIMP_IS_DISPLAY (gdisp)); */
GIMP_TOOL_GET_CLASS (tool)->cursor_update (tool, coords, state, gdisp);
}
void
gimp_tool_push_status (GimpTool *tool,
const gchar *message)
@ -107,8 +458,8 @@ void
gimp_tool_real_button_press (GimpTool *tool,
GimpCoords *coords,
guint32 time,
GdkModifierType state,
GimpDisplay *gdisp)
GdkModifierType state,
GimpDisplay *gdisp)
{
tool->gdisp = gdisp;
tool->drawable = gimp_image_active_drawable (gdisp->gimage);
@ -120,8 +471,8 @@ void
gimp_tool_real_button_release (GimpTool *tool,
GimpCoords *coords,
guint32 time,
GdkModifierType state,
GimpDisplay *gdisp)
GdkModifierType state,
GimpDisplay *gdisp)
{
gimp_tool_control_halt (tool->control);
}

View File

@ -19,20 +19,10 @@
#ifndef __GIMP_TOOL_H__
#define __GIMP_TOOL_H__
/* EEEEK! */
/* #include "app/widgets/widgets-types.h" */
/* FIXME: what should we do about gimpobject? */
/*#include "gimpobject.h"*/
#include "core/gimpobject.h"
#include "gimptoolcontrol.h"
/* The possibilities for where the cursor lies */
#define ACTIVE_LAYER (1 << 0)
#define SELECTION (1 << 1)
#define NON_ACTIVE_LAYER (1 << 2)
#define GIMP_TYPE_TOOL (gimp_tool_get_type ())
#define GIMP_TOOL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_TOOL, GimpTool))
#define GIMP_TOOL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_TOOL, GimpToolClass))
@ -49,37 +39,12 @@ struct _GimpTool
GimpToolInfo *tool_info;
gint ID; /* unique tool ID */
gint ID; /* unique tool ID */
GimpToolControl *control;
GimpDisplay *gdisp; /* pointer to currently active gdisp */
GimpDrawable *drawable; /* pointer to the tool's current drawable */
/* This will soon go away */
#if 0
GimpToolState state; /* state of tool activity */
gint paused_count; /* paused control count */
gboolean scroll_lock; /* allow scrolling or not */
gboolean auto_snap_to; /* snap to guides automatically */
gboolean preserve; /* Preserve this tool across drawable *
* changes */
gboolean handle_empty_image; /* invoke the tool on images without *
* active drawable */
gboolean perfectmouse; /* tool is affected by gimprc's *
* "prefectmouse" setting */
GdkCursorType cursor;
GimpToolCursorType tool_cursor;
GimpCursorModifier cursor_modifier;
GdkCursorType toggle_cursor;
GimpToolCursorType toggle_tool_cursor;
GimpCursorModifier toggle_cursor_modifier;
gboolean toggled;
#endif
GimpDisplay *gdisp; /* pointer to currently active gdisp */
GimpDrawable *drawable; /* pointer to the tool's current drawable */
};
struct _GimpToolClass

View File

@ -30,17 +30,16 @@
#define GIMP_IS_TOOL_CONTROL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_TOOL_CONTROL))
#define GIMP_TOOL_CONTROL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_TOOL_CONTROL, GimpToolControlClass))
typedef struct _GimpToolControlClass GimpToolControlClass;
struct _GimpToolControlClass {
GimpObjectClass parent_class;
};
struct _GimpToolControl {
struct _GimpToolControl
{
GimpObject parent_instance;
GimpToolState state; /* state of tool activity */
gint paused_count; /* paused control count */
GimpToolState state; /* state of tool activity */
gint paused_count; /* paused control count */
gboolean scroll_lock; /* allow scrolling or not */
gboolean auto_snap_to; /* snap to guides automatically */
@ -61,4 +60,70 @@ struct _GimpToolControl {
gboolean toggled;
};
struct _GimpToolControlClass
{
GimpObjectClass parent_class;
};
GType gimp_tool_control_get_type (void) G_GNUC_CONST;
void gimp_tool_control_pause (GimpToolControl *control);
void gimp_tool_control_resume (GimpToolControl *control);
gboolean gimp_tool_control_is_paused (GimpToolControl *control);
void gimp_tool_control_activate (GimpToolControl *control);
void gimp_tool_control_halt (GimpToolControl *control);
gboolean gimp_tool_control_is_active (GimpToolControl *control);
void gimp_tool_control_set_toggle (GimpToolControl *control,
gboolean toggled);
gboolean gimp_tool_control_is_toggled (GimpToolControl *control);
void gimp_tool_control_set_preserve (GimpToolControl *control,
gboolean preserve);
gboolean gimp_tool_control_preserve (GimpToolControl *control);
void gimp_tool_control_set_scroll_lock (GimpToolControl *control,
gboolean scroll_lock);
gboolean gimp_tool_control_scroll_lock (GimpToolControl *control);
void gimp_tool_control_set_motion_mode (GimpToolControl *control,
GimpMotionMode motion_mode);
GimpMotionMode gimp_tool_control_motion_mode (GimpToolControl *control);
void gimp_tool_control_set_handles_empty_image (GimpToolControl *control,
gboolean handle_empty);
gboolean gimp_tool_control_handles_empty_image (GimpToolControl *control);
void gimp_tool_control_set_snap_to (GimpToolControl *control,
gboolean snap_to);
gboolean gimp_tool_control_auto_snap_to (GimpToolControl *control);
GdkCursorType gimp_tool_control_get_cursor (GimpToolControl *control);
void gimp_tool_control_set_cursor (GimpToolControl *control,
GdkCursorType cursor);
GimpToolCursorType gimp_tool_control_get_tool_cursor (GimpToolControl *control);
void gimp_tool_control_set_tool_cursor (GimpToolControl *control,
GimpToolCursorType cursor);
GimpCursorModifier gimp_tool_control_get_cursor_modifier (GimpToolControl *control);
void gimp_tool_control_set_cursor_modifier (GimpToolControl *control,
GimpCursorModifier cmodifier);
GdkCursorType gimp_tool_control_get_toggle_cursor (GimpToolControl *control);
void gimp_tool_control_set_toggle_cursor (GimpToolControl *control,
GdkCursorType cursor);
GimpToolCursorType gimp_tool_control_get_toggle_tool_cursor (GimpToolControl *control);
void gimp_tool_control_set_toggle_tool_cursor (GimpToolControl *control,
GimpToolCursorType cursor);
GimpCursorModifier gimp_tool_control_get_toggle_cursor_modifier (GimpToolControl *control);
void gimp_tool_control_set_toggle_cursor_modifier (GimpToolControl *control,
GimpCursorModifier cmodifier);
#endif /* __GIMP_TOOL_CONTROL_H__ */

View File

@ -21,9 +21,10 @@
#include <gtk/gtk.h>
#include "tools-types.h"
#include "core/gimp.h"
#include "libgimptool/gimptoolmodule.h"
#include "gimptoolmodule.h"
static void gimp_tool_module_class_init (GimpToolModuleClass *klass);

View File

@ -31,8 +31,6 @@
#include "core/gimplist.h"
#include "core/gimptoolinfo.h"
#include "libgimptool/gimptoolcontrol.h"
#include "display/gimpdisplay.h"
#ifdef __GNUC__

View File

@ -3,11 +3,11 @@
#include "config.h"
#include <glib-object.h>
#include "libgimpproxy/gimpproxytypes.h"
#include "gimptoolenums.h"
#include "libgimp/libgimp-intl.h"
#include "core/core-enums.h"
#include "tools-enums.h"
#include "gimp-intl.h"
/* enumerations from "./gimptoolenums.h" */
/* enumerations from "./tools-enums.h" */
static const GEnumValue gimp_crop_type_enum_values[] =
{

View File

@ -19,17 +19,50 @@
#ifndef __TOOLS_TYPES_H__
#define __TOOLS_TYPES_H__
#include "paint/paint-types.h"
#include "display/display-types.h"
#include "libgimptool/gimptooltypes.h"
#include "tools/tools-enums.h"
/* tools */
G_BEGIN_DECLS
typedef struct _GimpTool GimpTool;
typedef struct _GimpToolModule GimpToolModule;
typedef struct _GimpToolControl GimpToolControl;
typedef struct _GimpPaintTool GimpPaintTool;
typedef struct _GimpDrawTool GimpDrawTool;
typedef struct _GimpPathTool GimpPathTool;
typedef struct _GimpTransformTool GimpTransformTool;
typedef struct _GimpBezierSelectPoint GimpBezierSelectPoint;
typedef struct _GimpBezierSelectTool GimpBezierSelectTool;
/* functions */
typedef GtkWidget * (* GimpToolOptionsGUIFunc) (GimpToolOptions *tool_options);
typedef void (* GimpToolRegisterCallback) (GType tool_type,
GType tool_option_type,
GimpToolOptionsGUIFunc options_gui_func,
gboolean tool_context,
const gchar *identifier,
const gchar *blurb,
const gchar *help,
const gchar *menu_path,
const gchar *menu_accel,
const gchar *help_domain,
const gchar *help_data,
const gchar *stock_id,
gpointer register_data);
typedef void (* GimpToolRegisterFunc) (GimpToolRegisterCallback callback,
gpointer register_data);
G_END_DECLS
#endif /* __TOOLS_TYPES_H__ */

View File

@ -24,15 +24,6 @@
#include "tools-types.h"
/*FIXME: remove when proper module loading is in place */
#include "config/gimpcoreconfig.h"
#include "config/gimpconfig-path.h"
#include "core/gimp.h"
/*end remove */
#include "libgimptool/gimptool.h"
#include "libgimptool/gimptoolmodule.h"
#include "tool_manager.h"
#include "gimpairbrushtool.h"
@ -74,13 +65,6 @@
#include "gimptexttool.h"
#include "gimpvectortool.h"
void
cheesey_module_loading_hack (GimpDatafileData *file_data)
{
gimp_tool_module_new (file_data->filename,
tool_manager_register_tool,
file_data->user_data);
}
void
tools_init (Gimp *gimp)
@ -148,22 +132,6 @@ tools_init (Gimp *gimp)
{
register_funcs[i] (tool_manager_register_tool, gimp);
}
#if 0
if (g_module_supported ())
{
gchar *path = gimp_config_path_expand (gimp->config->tool_plug_in_path,
TRUE, NULL);
gimp_datafiles_read_directories (path,
0 /* no flags */,
cheesey_module_loading_hack,
gimp);
g_free (path);
}
#endif
}
void

View File

@ -16,8 +16,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/*< proxy-skip >*/
#ifndef __WIDGETS_ENUMS_H__
#define __WIDGETS_ENUMS_H__
@ -110,7 +108,7 @@ typedef enum /*< skip >*/
GIMP_LAST_CURSOR_ENTRY
} GimpCursorType;
typedef enum /*< skip, proxy-resume >*/
typedef enum /*< skip >*/
{
GIMP_TOOL_CURSOR_NONE,
GIMP_RECT_SELECT_TOOL_CURSOR,
@ -163,7 +161,7 @@ typedef enum /*< skip >*/
GIMP_LAST_CURSOR_MODIFIER_ENTRY
} GimpCursorModifier;
typedef enum /*< skip, proxy-skip >*/
typedef enum /*< skip >*/
{
GIMP_DEVICE_VALUE_MODE = 1 << 0,
GIMP_DEVICE_VALUE_AXES = 1 << 1,
@ -176,4 +174,5 @@ typedef enum /*< skip, proxy-skip >*/
GIMP_DEVICE_VALUE_GRADIENT = 1 << 8
} GimpDeviceValues;
#endif /* __WIDGETS_ENUMS_H__ */

View File

@ -32,7 +32,7 @@ GIMPPRINT_REQUIRED_VERSION=4.2.0
#
GIMP_MAJOR_VERSION=1
GIMP_MINOR_VERSION=3
GIMP_MICRO_VERSION=14
GIMP_MICRO_VERSION=15
GIMP_INTERFACE_AGE=0
GIMP_BINARY_AGE=0
GIMP_VERSION=$GIMP_MAJOR_VERSION.$GIMP_MINOR_VERSION.$GIMP_MICRO_VERSION
@ -1063,10 +1063,6 @@ dnl a tuned version of glib-mkenums
GIMP_MKENUMS="\$(top_srcdir)/tools/gimp-mkenums"
AC_SUBST(GIMP_MKENUMS)
dnl autogenerator for proxy objects
GIMP_MKPROXY="\$(top_srcdir)/tools/gimp-mkproxy"
AC_SUBST(GIMP_MKPROXY)
##########################################
# Default to disable deprecated GTK+ stuff
@ -1085,10 +1081,6 @@ GIMP_MODULES=modules
AC_SUBST(GIMP_PLUGINS)
AC_SUBST(GIMP_MODULES)
dnl These are not built nor included in the tarball for the time being.
dnl plug-ins/plugin-helper/Makefile
dnl plug-ins/tools/common/Makefile
AC_OUTPUT([
tools/Makefile
tools/authorsgen/Makefile
@ -1100,8 +1092,6 @@ libgimpbase/Makefile
libgimpcolor/Makefile
libgimpmath/Makefile
libgimpmodule/Makefile
libgimpproxy/Makefile
libgimptool/Makefile
libgimpwidgets/Makefile
app/Makefile
app/base/Makefile

View File

@ -1,2 +0,0 @@
Makefile
Makefile.in

View File

@ -1,119 +0,0 @@
## Process this file with automake to produce Makefile.in
if PLATFORM_WIN32
no_undefined = -no-undefined
conditional_libgimpbase_la = ../libgimpbase/libgimpbase-1.3.la
endif
if OS_WIN32
gimpproxy_def = gimpproxy.def
libgimpproxy_export_symbols = -export-symbols gimpproxy.def
install-libtool-import-lib:
$(INSTALL) .libs/libgimpproxy-1.3.dll.a $(DESTDIR)$(libdir)
uninstall-libtool-import-lib:
-rm $(DESTDIR)$(libdir)/libgimpproxy-1.3.dll.a
else
install-libtool-import-lib:
uninstall-libtool-import-lib:
endif
if MS_LIB_AVAILABLE
noinst_DATA = gimpproxy-1.3.lib
install-ms-lib:
$(INSTALL) gimpproxy-1.3.lib $(DESTDIR)$(libdir)
uninstall-ms-lib:
-rm $(DESTDIR)$(libdir)/gimpproxy-1.3.lib
gimpproxy-1.3.lib: gimpproxy.def
lib -name:libgimpproxy-1.3-@LT_CURRENT_MINUS_AGE@.dll -def:gimpproxy.def -out:$@
else
install-ms-lib:
uninstall-ms-lib:
endif
libgimpproxyincludedir = $(includedir)/gimp-$(LT_RELEASE)/libgimpproxy
AM_CPPFLAGS = \
-DG_LOG_DOMAIN=\"LibGimpProxy\" \
@GIMP_THREAD_FLAGS@
INCLUDES = \
-I$(top_srcdir) \
$(GTK_CFLAGS) \
-I$(includedir) \
-I$(top_srcdir)/app \
-I$(top_srcdir)/app/core
lib_LTLIBRARIES = libgimpproxy-1.3.la
libgimpproxy_1_3_la_SOURCES = \
gimpproxytypes.h \
gimpobject.h \
gimpobject.c \
gimpchannel.h
libgimpproxyinclude_HEADERS = \
gimpproxytypes.h \
gimpobject.h \
gimpchannel.h
libgimpproxy_1_3_la_LDFLAGS = \
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
$(no_undefined) \
$(libgimpproxy_export_symbols)
libgimpproxy_1_3_la_LIBADD = $(conditional_libgimpbase_la) $(GLIB_LIBS)
libgimpproxy_1_3_la_DEPENDENCIES = $(gimpproxy_def)
#
# rules to generate built sources
#
# setup autogeneration dependancies
gen_sources = xgen-goh xgen-goc xgen-gch xgen-gph
CLEANFILES = $(gen_sources)
$(srcdir)/gimpobject.h: $(top_srcdir)/app/core/gimpobject.h $(GIMP_MKPROXY)
$(GIMP_MKPROXY) \
--fprod "\n/* autogenerated from \"@filename@\" */" \
$(srcdir)/../app/core/gimpobject.h > xgen-goh \
&& cp xgen-goh $(@F) \
&& rm -f xgen-goh
$(srcdir)/gimpobject.c: $(top_srcdir)/app/core/gimpobject.c $(GIMP_MKPROXY)
$(GIMP_MKPROXY) \
--fprod "\n/* autogenerated from \"@filename@\" */" \
$(srcdir)/../app/core/gimpobject.c > xgen-goc \
&& cp xgen-goc $(@F) \
&& rm -f xgen-goc
$(srcdir)/gimpchannel.h: $(top_srcdir)/app/core/gimpchannel.h $(GIMP_MKPROXY)
$(GIMP_MKPROXY) \
--fprod "\n/* autogenerated from \"@filename@\" */" \
$(srcdir)/../app/core/gimpchannel.h > xgen-gch \
&& cp xgen-gch $(@F) \
&& rm -f xgen-gch
$(srcdir)/gimpproxytypes.h: $(top_srcdir)/app/core/core-types.h $(top_srcdir)/app/core/core-enums.h $(top_srcdir)/app/widgets/widgets-enums.h $(top_srcdir)/app/display/display-types.h $(GIMP_MKPROXY)
$(GIMP_MKPROXY) \
--fprod "\n/* autogenerated from \"@filename@\" */" \
--fhead "#ifndef __GIMP_PROXY_TYPES_H__\n#define __GIMP_PROXY_TYPES_H__\n" \
--ftail "\n#endif /* __GIMP_PROXY_TYPES_H__ */\n" \
$(srcdir)/../app/core/core-enums.h \
$(srcdir)/../app/core/core-types.h \
$(srcdir)/../app/widgets/widgets-enums.h \
$(srcdir)/../app/display/display-types.h \
> xgen-gph \
&& cp xgen-gph $(@F) \
&& rm -f xgen-gph
install-data-local: install-ms-lib install-libtool-import-lib
uninstall-local: uninstall-ms-lib uninstall-libtool-import-lib

View File

@ -1,54 +0,0 @@
/* Generated data (by gimp-mkproxy) */
/* autogenerated from "./../app/core/gimpchannel.h" */
/* 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_CHANNEL_H__
#define __GIMP_CHANNEL_H__
#include "gimpdrawable.h"
/*< proxy-resume >*/
struct _GimpChannel
{
GimpDrawable parent_instance;
GimpRGB color; /* Also stored the opacity */
gboolean show_masked; /* Show masked areas--as */
/* opposed to selected areas */
/* Selection mask variables */
gboolean boundary_known; /* is the current boundary valid */
BoundSeg *segs_in; /* outline of selected region */
BoundSeg *segs_out; /* outline of selected region */
gint num_segs_in; /* number of lines in boundary */
gint num_segs_out; /* number of lines in boundary */
gboolean empty; /* is the region empty? */
gboolean bounds_known; /* recalculate the bounds? */
gint x1, y1; /* coordinates for bounding box */
gint x2, y2; /* lower right hand coordinate */
};
/* Generated data ends here */

View File

@ -1,372 +0,0 @@
/* Generated data (by gimp-mkproxy) */
/* autogenerated from "./../app/core/gimpobject.c" */
/* The GIMP -- an image manipulation program
* Copyright (C) 1995-1997 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 <string.h>
#include <glib-object.h>
#include "libgimpbase/gimputils.h"
#include "core-types.h"
#include "gimpobject.h"
enum
{
DISCONNECT,
NAME_CHANGED,
LAST_SIGNAL
};
enum
{
PROP_0,
PROP_NAME
};
static void gimp_object_class_init (GimpObjectClass *klass);
static void gimp_object_init (GimpObject *object);
static void gimp_object_dispose (GObject *object);
static void gimp_object_finalize (GObject *object);
static void gimp_object_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void gimp_object_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
static gsize gimp_object_real_get_memsize (GimpObject *object);
static guint object_signals[LAST_SIGNAL] = { 0 };
static GObjectClass *parent_class = NULL;
GType
gimp_object_get_type (void)
{
static GType object_type = 0;
if (! object_type)
{
static const GTypeInfo object_info =
{
sizeof (GimpObjectClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gimp_object_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpObject),
0, /* n_preallocs */
(GInstanceInitFunc) gimp_object_init,
};
object_type = g_type_register_static (G_TYPE_OBJECT,
"GimpObject",
&object_info, 0);
}
return object_type;
}
static void
gimp_object_class_init (GimpObjectClass *klass)
{
GObjectClass *object_class;
object_class = G_OBJECT_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
/* we use the gobject marshaller names directly so libgimpproxy doesn't need
* gimpmarshal.* around. -Yosh
*/
object_signals[DISCONNECT] =
g_signal_new ("disconnect",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GimpObjectClass, disconnect),
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
object_signals[NAME_CHANGED] =
g_signal_new ("name_changed",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GimpObjectClass, name_changed),
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
object_class->dispose = gimp_object_dispose;
object_class->finalize = gimp_object_finalize;
object_class->set_property = gimp_object_set_property;
object_class->get_property = gimp_object_get_property;
klass->disconnect = NULL;
klass->name_changed = NULL;
klass->get_memsize = gimp_object_real_get_memsize;
g_object_class_install_property (object_class,
PROP_NAME,
g_param_spec_string ("name",
NULL, NULL,
NULL,
G_PARAM_READWRITE));
}
static void
gimp_object_init (GimpObject *object)
{
object->name = NULL;
}
static void
gimp_object_dispose (GObject *object)
{
gboolean disconnected;
disconnected = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (object),
"disconnected"));
if (! disconnected)
{
g_signal_emit (object, object_signals[DISCONNECT], 0);
g_object_set_data (G_OBJECT (object), "disconnected",
GINT_TO_POINTER (TRUE));
}
G_OBJECT_CLASS (parent_class)->dispose (object);
}
static void
gimp_object_finalize (GObject *object)
{
GimpObject *gimp_object;
gimp_object = GIMP_OBJECT (object);
if (gimp_object->name)
{
g_free (gimp_object->name);
gimp_object->name = NULL;
}
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static void
gimp_object_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec)
{
GimpObject *gimp_object;
gimp_object = GIMP_OBJECT (object);
switch (property_id)
{
case PROP_NAME:
gimp_object_set_name (gimp_object, g_value_get_string (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
}
}
static void
gimp_object_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec)
{
GimpObject *gimp_object;
gimp_object = GIMP_OBJECT (object);
switch (property_id)
{
case PROP_NAME:
g_value_set_string (value, gimp_object->name);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
}
}
void
gimp_object_set_name (GimpObject *object,
const gchar *name)
{
g_return_if_fail (GIMP_IS_OBJECT (object));
if ((!object->name && !name) ||
(object->name && name && !strcmp (object->name, name)))
return;
g_free (object->name);
object->name = g_strdup (name);
gimp_object_name_changed (object);
}
/* A safe version of gimp_object_set_name() that takes care
* of newlines and overly long names.
*/
void
gimp_object_set_name_safe (GimpObject *object,
const gchar *name)
{
g_return_if_fail (GIMP_IS_OBJECT (object));
if ((!object->name && !name) ||
(object->name && name && !strcmp (object->name, name)))
return;
g_free (object->name);
object->name = gimp_utf8_strtrim (name, 30);
gimp_object_name_changed (object);
}
const gchar *
gimp_object_get_name (const GimpObject *object)
{
g_return_val_if_fail (GIMP_IS_OBJECT (object), NULL);
return object->name;
}
void
gimp_object_name_changed (GimpObject *object)
{
g_return_if_fail (GIMP_IS_OBJECT (object));
g_signal_emit (object, object_signals[NAME_CHANGED], 0);
}
#define DEBUG_MEMSIZE 1
#ifdef DEBUG_MEMSIZE
gboolean gimp_debug_memsize = FALSE;
#endif
gsize
gimp_object_get_memsize (GimpObject *object)
{
g_return_val_if_fail (GIMP_IS_OBJECT (object), 0);
#ifdef DEBUG_MEMSIZE
if (gimp_debug_memsize)
{
static gint indent_level = 0;
static GList *aggregation_tree = NULL;
static gchar indent_buf[256];
gsize memsize;
gint i;
gint my_indent_level;
gchar *object_size;
indent_level++;
my_indent_level = indent_level;
memsize = GIMP_OBJECT_GET_CLASS (object)->get_memsize (object);
indent_level--;
for (i = 0; i < MIN (my_indent_level * 2, sizeof (indent_buf) - 1); i++)
indent_buf[i] = ' ';
indent_buf[i] = '\0';
/* FIXME: are we going to ever have > 4 GB objects?? */
object_size = g_strdup_printf ("%s%s \"%s\": %u\n",
indent_buf,
g_type_name (G_TYPE_FROM_INSTANCE (object)),
object->name,
(guint) memsize);
aggregation_tree = g_list_prepend (aggregation_tree, object_size);
if (indent_level == 0)
{
g_list_foreach (aggregation_tree, (GFunc) g_print, NULL);
g_list_foreach (aggregation_tree, (GFunc) g_free, NULL);
g_list_free (aggregation_tree);
aggregation_tree = NULL;
}
return memsize;
}
#endif /* DEBUG_MEMSIZE */
return GIMP_OBJECT_GET_CLASS (object)->get_memsize (object);
}
gsize
gimp_g_object_get_memsize (GObject *object)
{
GTypeQuery type_query;
gsize memsize = 0;
g_return_val_if_fail (G_IS_OBJECT (object), 0);
g_type_query (G_TYPE_FROM_INSTANCE (object), &type_query);
memsize += type_query.instance_size;
return memsize;
}
static gsize
gimp_object_real_get_memsize (GimpObject *object)
{
gsize memsize = 0;
if (object->name)
memsize += strlen (object->name) + 1;
return memsize + gimp_g_object_get_memsize ((GObject *) object);
}
/* Generated data ends here */

View File

@ -1,74 +0,0 @@
/* Generated data (by gimp-mkproxy) */
/* autogenerated from "./../app/core/gimpobject.h" */
/* The GIMP -- an image manipulation program
* Copyright (C) 1995-1997 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_OBJECT_H__
#define __GIMP_OBJECT_H__
#define GIMP_TYPE_OBJECT (gimp_object_get_type ())
#define GIMP_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_OBJECT, GimpObject))
#define GIMP_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_OBJECT, GimpObjectClass))
#define GIMP_IS_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_OBJECT))
#define GIMP_IS_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_OBJECT))
#define GIMP_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_OBJECT, GimpObjectClass))
typedef struct _GimpObjectClass GimpObjectClass;
struct _GimpObject
{
GObject parent_instance;
gchar *name;
};
struct _GimpObjectClass
{
GObjectClass parent_class;
/* signals */
void (* disconnect) (GimpObject *object);
void (* name_changed) (GimpObject *object);
/* virtual functions */
gsize (* get_memsize) (GimpObject *object);
};
GType gimp_object_get_type (void) G_GNUC_CONST;
void gimp_object_set_name (GimpObject *object,
const gchar *name);
const gchar * gimp_object_get_name (const GimpObject *object);
void gimp_object_set_name_safe (GimpObject *object,
const gchar *name);
void gimp_object_name_changed (GimpObject *object);
gsize gimp_object_get_memsize (GimpObject *object);
gsize gimp_g_object_get_memsize (GObject *object);
#endif /* __GIMP_OBJECT_H__ */
/* Generated data ends here */

View File

@ -1,6 +0,0 @@
EXPORTS
gimp_object_get_memsize
gimp_object_get_name
gimp_object_get_type
gimp_object_name_changed
gimp_object_set_name

View File

@ -1,172 +0,0 @@
/* Generated data (by gimp-mkproxy) */
#ifndef __GIMP_PROXY_TYPES_H__
#define __GIMP_PROXY_TYPES_H__
/* autogenerated from "./../app/core/core-enums.h" */
/* 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.
*/
/*< proxy-resume >*/
typedef enum
{
GIMP_CHANNEL_OP_ADD, /*< desc="Add to the current selection" >*/
GIMP_CHANNEL_OP_SUBTRACT, /*< desc="Subtract from the current selection" >*/
GIMP_CHANNEL_OP_REPLACE, /*< desc="Replace the current selection" >*/
GIMP_CHANNEL_OP_INTERSECT /*< desc="Intersect with the current selection" >*/
} GimpChannelOps;
/* autogenerated from "./../app/core/core-types.h" */
/* 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.
*/
typedef struct _GimpObject GimpObject; /*< proxy-include >*/
typedef struct _GimpToolInfo GimpToolInfo; /*< proxy-include >*/
typedef struct _GimpToolOptions GimpToolOptions; /*< proxy-include >*/
typedef struct _GimpDrawable GimpDrawable; /*< proxy-resume >*/
typedef struct _GimpChannel GimpChannel;
typedef struct _GimpLayer GimpLayer;
typedef struct _GimpLayerMask GimpLayerMask;
typedef struct _GimpImage GimpImage;
/* data objects */
typedef struct _GimpCoords GimpCoords; /*< proxy-include >*/
/* autogenerated from "./../app/widgets/widgets-enums.h" */
/* 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.
*/
typedef enum /*< skip, proxy-resume >*/
{
GIMP_TOOL_CURSOR_NONE,
GIMP_RECT_SELECT_TOOL_CURSOR,
GIMP_ELLIPSE_SELECT_TOOL_CURSOR,
GIMP_FREE_SELECT_TOOL_CURSOR,
GIMP_FUZZY_SELECT_TOOL_CURSOR,
GIMP_BEZIER_SELECT_TOOL_CURSOR,
GIMP_SCISSORS_TOOL_CURSOR,
GIMP_MOVE_TOOL_CURSOR,
GIMP_ZOOM_TOOL_CURSOR,
GIMP_CROP_TOOL_CURSOR,
GIMP_RESIZE_TOOL_CURSOR,
GIMP_ROTATE_TOOL_CURSOR,
GIMP_SHEAR_TOOL_CURSOR,
GIMP_PERSPECTIVE_TOOL_CURSOR,
GIMP_FLIP_HORIZONTAL_TOOL_CURSOR,
GIMP_FLIP_VERTICAL_TOOL_CURSOR,
GIMP_TEXT_TOOL_CURSOR,
GIMP_COLOR_PICKER_TOOL_CURSOR,
GIMP_BUCKET_FILL_TOOL_CURSOR,
GIMP_BLEND_TOOL_CURSOR,
GIMP_PENCIL_TOOL_CURSOR,
GIMP_PAINTBRUSH_TOOL_CURSOR,
GIMP_AIRBRUSH_TOOL_CURSOR,
GIMP_INK_TOOL_CURSOR,
GIMP_CLONE_TOOL_CURSOR,
GIMP_ERASER_TOOL_CURSOR,
GIMP_SMUDGE_TOOL_CURSOR,
GIMP_BLUR_TOOL_CURSOR,
GIMP_DODGE_TOOL_CURSOR,
GIMP_BURN_TOOL_CURSOR,
GIMP_MEASURE_TOOL_CURSOR,
GIMP_LAST_STOCK_TOOL_CURSOR_ENTRY
} GimpToolCursorType;
typedef enum /*< skip >*/
{
GIMP_CURSOR_MODIFIER_NONE,
GIMP_CURSOR_MODIFIER_PLUS,
GIMP_CURSOR_MODIFIER_MINUS,
GIMP_CURSOR_MODIFIER_INTERSECT,
GIMP_CURSOR_MODIFIER_MOVE,
GIMP_CURSOR_MODIFIER_RESIZE,
GIMP_CURSOR_MODIFIER_CONTROL,
GIMP_CURSOR_MODIFIER_ANCHOR,
GIMP_CURSOR_MODIFIER_FOREGROUND,
GIMP_CURSOR_MODIFIER_BACKGROUND,
GIMP_CURSOR_MODIFIER_PATTERN,
GIMP_CURSOR_MODIFIER_HAND,
GIMP_LAST_CURSOR_MODIFIER_ENTRY
} GimpCursorModifier;
/* autogenerated from "./../app/display/display-types.h" */
/* 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.
*/
typedef struct _GimpDisplay GimpDisplay; /*< proxy-resume >*/
typedef struct _GimpDisplayShell GimpDisplayShell;
#endif /* __GIMP_PROXY_TYPES_H__ */
/* Generated data ends here */

View File

@ -1,2 +0,0 @@
Makefile
Makefile.in

View File

@ -1,98 +0,0 @@
## Process this file with automake to produce Makefile.in
if PLATFORM_WIN32
no_undefined = -no-undefined
endif
if OS_WIN32
gimptool_def = gimptool.def
libgimptool_export_symbols = -export-symbols gimptool.def
install-libtool-import-lib:
$(INSTALL) .libs/libgimptool-1.3.dll.a $(DESTDIR)$(libdir)
uninstall-libtool-import-lib:
-rm $(DESTDIR)$(libdir)/libgimptool-1.3.dll.a
else
install-libtool-import-lib:
uninstall-libtool-import-lib:
endif
if MS_LIB_AVAILABLE
noinst_DATA = gimptool-1.3.lib
install-ms-lib:
$(INSTALL) gimptool-1.3.lib $(DESTDIR)$(libdir)
uninstall-ms-lib:
-rm $(DESTDIR)$(libdir)/gimptool-1.3.lib
gimptool-1.3.lib: gimptool.def
lib -name:libgimptool-1.3-@LT_CURRENT_MINUS_AGE@.dll -def:gimptool.def -out:$@
else
install-ms-lib:
uninstall-ms-lib:
endif
libgimptoolincludedir = $(includedir)/gimp-$(LT_RELEASE)/libgimptool
AM_CPPFLAGS = \
-DG_LOG_DOMAIN=\"LibGimpTool\" \
@GIMP_THREAD_FLAGS@
INCLUDES = \
-I$(top_srcdir) \
$(GTK_CFLAGS) \
$(GMODULE_CFLAGS) \
-I$(includedir)
lib_LTLIBRARIES = libgimptool-1.3.la
libgimptool_1_3_la_SOURCES = \
gimptooltypes.h \
gimptoolenums.h \
gimptoolenums.c \
gimptool.c \
gimptool.h \
gimptoolcontrol.h \
gimptoolmodule.c \
gimptoolmodule.h \
glue.c
libgimptoolinclude_HEADERS = \
gimptool.h \
gimptooltypes.h \
gimptoolenums.h \
gimptoolmodule.h
libgimptool_1_3_la_LDFLAGS = \
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
$(no_undefined) \
$(libgimptool_export_symbols)
libgimptool_1_3_la_LIBADD = $(GLIB_LIBS) $(GMODULE_LIBS)
libgimptool_1_3_la_DEPENDENCIES = $(gimptool_def)
#
# rules to generate built sources
#
# setup autogeneration dependancies
gen_sources = xgen-tec
CLEANFILES = $(gen_sources)
$(srcdir)/gimptoolenums.c: $(srcdir)/gimptoolenums.h $(GIMP_MKENUMS)
$(GIMP_MKENUMS) \
--fhead "#include \"config.h\"\n#include <glib-object.h>\n#include \"libgimpproxy/gimpproxytypes.h\"\n#include \"gimptoolenums.h\"\n#include \"libgimp/libgimp-intl.h\"" \
--fprod "\n/* enumerations from \"@filename@\" */" \
--vhead "\nstatic const GEnumValue @enum_name@_enum_values[] =\n{" \
--vprod " { @VALUENAME@, @valuedesc@, \"@valuenick@\" }," \
--vtail " { 0, NULL, NULL }\n};\n\nGType\n@enum_name@_get_type (void)\n{\n static GType enum_type = 0;\n\n if (!enum_type)\n enum_type = g_enum_register_static (\"@EnumName@\", @enum_name@_enum_values);\n\n return enum_type;\n}\n" \
$(srcdir)/gimptoolenums.h > xgen-tec \
&& cp xgen-tec $(@F) \
&& rm -f xgen-tec
install-data-local: install-ms-lib install-libtool-import-lib
uninstall-local: uninstall-ms-lib uninstall-libtool-import-lib

View File

@ -1,387 +0,0 @@
/* 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 "libgimpwidgets/gimpwidgets.h"
#include "libgimpproxy/gimpproxytypes.h"
#include "gimptooltypes.h"
/* this is ugly */
/*#include "core/gimpimage.h"
#include "core/gimpmarshal.h"
#include "display/gimpdisplay.h"
#include "display/gimpdisplayshell.h"
#include "display/gimpstatusbar.h" */
#include "gimptool.h"
#include "gimptoolcontrol.h"
static void gimp_tool_class_init (GimpToolClass *klass);
static void gimp_tool_init (GimpTool *tool);
static void gimp_tool_finalize (GObject *object);
static void gimp_tool_real_initialize (GimpTool *tool,
GimpDisplay *gdisp);
static void gimp_tool_real_control (GimpTool *tool,
GimpToolAction action,
GimpDisplay *gdisp);
void gimp_tool_real_button_press (GimpTool *tool,
GimpCoords *coords,
guint32 time,
GdkModifierType state,
GimpDisplay *gdisp);
void gimp_tool_real_button_release (GimpTool *tool,
GimpCoords *coords,
guint32 time,
GdkModifierType state,
GimpDisplay *gdisp);
static void gimp_tool_real_motion (GimpTool *tool,
GimpCoords *coords,
guint32 time,
GdkModifierType state,
GimpDisplay *gdisp);
static void gimp_tool_real_arrow_key (GimpTool *tool,
GdkEventKey *kevent,
GimpDisplay *gdisp);
static void gimp_tool_real_modifier_key (GimpTool *tool,
GdkModifierType key,
gboolean press,
GdkModifierType state,
GimpDisplay *gdisp);
static void gimp_tool_real_oper_update (GimpTool *tool,
GimpCoords *coords,
GdkModifierType state,
GimpDisplay *gdisp);
static void gimp_tool_real_cursor_update (GimpTool *tool,
GimpCoords *coords,
GdkModifierType state,
GimpDisplay *gdisp);
static GimpObjectClass *parent_class = NULL;
static gint global_tool_ID = 0;
GType
gimp_tool_get_type (void)
{
static GType tool_type = 0;
if (! tool_type)
{
static const GTypeInfo tool_info =
{
sizeof (GimpToolClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gimp_tool_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpTool),
0, /* n_preallocs */
(GInstanceInitFunc) gimp_tool_init,
};
tool_type = g_type_register_static (GIMP_TYPE_OBJECT,
"GimpTool",
&tool_info, 0);
}
return tool_type;
}
static void
gimp_tool_class_init (GimpToolClass *klass)
{
GObjectClass *object_class;
object_class = G_OBJECT_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
object_class->finalize = gimp_tool_finalize;
klass->initialize = gimp_tool_real_initialize;
klass->control = gimp_tool_real_control;
klass->button_press = gimp_tool_real_button_press;
klass->button_release = gimp_tool_real_button_release;
klass->motion = gimp_tool_real_motion;
klass->arrow_key = gimp_tool_real_arrow_key;
klass->modifier_key = gimp_tool_real_modifier_key;
klass->oper_update = gimp_tool_real_oper_update;
klass->cursor_update = gimp_tool_real_cursor_update;
}
static void
gimp_tool_init (GimpTool *tool)
{
tool->ID = global_tool_ID++;
tool->control = GIMP_TOOL_CONTROL (g_object_new (GIMP_TYPE_TOOL_CONTROL,
NULL));
tool->gdisp = NULL;
tool->drawable = NULL;
}
static void
gimp_tool_finalize (GObject *object)
{
GimpTool *tool = GIMP_TOOL (object);
if (tool->control)
{
g_object_unref (tool->control);
tool->control = NULL;
}
G_OBJECT_CLASS (parent_class)->finalize (object);
}
void
gimp_tool_initialize (GimpTool *tool,
GimpDisplay *gdisp)
{
g_return_if_fail (GIMP_IS_TOOL (tool));
GIMP_TOOL_GET_CLASS (tool)->initialize (tool, gdisp);
}
void
gimp_tool_control (GimpTool *tool,
GimpToolAction action,
GimpDisplay *gdisp)
{
g_return_if_fail (GIMP_IS_TOOL (tool));
switch (action)
{
case PAUSE:
if (!gimp_tool_control_is_paused (tool->control))
{
GIMP_TOOL_GET_CLASS (tool)->control (tool, action, gdisp);
}
gimp_tool_control_pause (tool->control);
break;
case RESUME:
if (gimp_tool_control_is_paused (tool->control))
{
gimp_tool_control_resume (tool->control);
if (!gimp_tool_control_is_paused (tool->control))
{
GIMP_TOOL_GET_CLASS (tool)->control (tool, action, gdisp);
}
}
else
{
g_warning ("gimp_tool_control(): "
"unable to RESUME tool with tool->paused_count == 0");
}
break;
case HALT:
GIMP_TOOL_GET_CLASS (tool)->control (tool, action, gdisp);
gimp_tool_control_halt (tool->control);
break;
}
}
void
gimp_tool_button_press (GimpTool *tool,
GimpCoords *coords,
guint32 time,
GdkModifierType state,
GimpDisplay *gdisp)
{
g_return_if_fail (GIMP_IS_TOOL (tool));
g_return_if_fail (coords != NULL);
/* FIXME */
/*g_return_if_fail (GIMP_IS_DISPLAY (gdisp));*/
GIMP_TOOL_GET_CLASS (tool)->button_press (tool, coords, time, state, gdisp);
}
void
gimp_tool_button_release (GimpTool *tool,
GimpCoords *coords,
guint32 time,
GdkModifierType state,
GimpDisplay *gdisp)
{
g_return_if_fail (GIMP_IS_TOOL (tool));
g_return_if_fail (coords != NULL);
/* FIXME */
/*g_return_if_fail (GIMP_IS_DISPLAY (gdisp));*/
GIMP_TOOL_GET_CLASS (tool)->button_release (tool, coords, time, state, gdisp);
}
void
gimp_tool_motion (GimpTool *tool,
GimpCoords *coords,
guint32 time,
GdkModifierType state,
GimpDisplay *gdisp)
{
g_return_if_fail (GIMP_IS_TOOL (tool));
g_return_if_fail (coords != NULL);
/* FIXME */
/*g_return_if_fail (GIMP_IS_DISPLAY (gdisp));*/
GIMP_TOOL_GET_CLASS (tool)->motion (tool, coords, time, state, gdisp);
}
void
gimp_tool_arrow_key (GimpTool *tool,
GdkEventKey *kevent,
GimpDisplay *gdisp)
{
g_return_if_fail (GIMP_IS_TOOL (tool));
/* FIXME */
/* g_return_if_fail (GIMP_IS_DISPLAY (gdisp)); */
GIMP_TOOL_GET_CLASS (tool)->arrow_key (tool, kevent, gdisp);
}
void
gimp_tool_modifier_key (GimpTool *tool,
GdkModifierType key,
gboolean press,
GdkModifierType state,
GimpDisplay *gdisp)
{
g_return_if_fail (GIMP_IS_TOOL (tool));
/* FIXME */
/* g_return_if_fail (GIMP_IS_DISPLAY (gdisp)); */
GIMP_TOOL_GET_CLASS (tool)->modifier_key (tool, key, press, state, gdisp);
}
void
gimp_tool_oper_update (GimpTool *tool,
GimpCoords *coords,
GdkModifierType state,
GimpDisplay *gdisp)
{
g_return_if_fail (GIMP_IS_TOOL (tool));
g_return_if_fail (coords != NULL);
/* FIXME*/
/*g_return_if_fail (GIMP_IS_DISPLAY (gdisp));*/
GIMP_TOOL_GET_CLASS (tool)->oper_update (tool, coords, state, gdisp);
}
void
gimp_tool_cursor_update (GimpTool *tool,
GimpCoords *coords,
GdkModifierType state,
GimpDisplay *gdisp)
{
g_return_if_fail (GIMP_IS_TOOL (tool));
g_return_if_fail (coords != NULL);
/* FIXME */
/* g_return_if_fail (GIMP_IS_DISPLAY (gdisp)); */
GIMP_TOOL_GET_CLASS (tool)->cursor_update (tool, coords, state, gdisp);
}
/* standard member functions */
static void
gimp_tool_real_initialize (GimpTool *tool,
GimpDisplay *gdisp)
{
}
static void
gimp_tool_real_control (GimpTool *tool,
GimpToolAction action,
GimpDisplay *gdisp)
{
}
static void
gimp_tool_real_motion (GimpTool *tool,
GimpCoords *coords,
guint32 time,
GdkModifierType state,
GimpDisplay *gdisp)
{
}
static void
gimp_tool_real_arrow_key (GimpTool *tool,
GdkEventKey *kevent,
GimpDisplay *gdisp)
{
}
static void
gimp_tool_real_modifier_key (GimpTool *tool,
GdkModifierType key,
gboolean press,
GdkModifierType state,
GimpDisplay *gdisp)
{
}
static void
gimp_tool_real_oper_update (GimpTool *tool,
GimpCoords *coords,
GdkModifierType state,
GimpDisplay *gdisp)
{
}
static void
gimp_tool_real_cursor_update (GimpTool *tool,
GimpCoords *coords,
GdkModifierType state,
GimpDisplay *gdisp)
{
if (gimp_tool_control_is_toggled (tool->control))
{
gimp_tool_set_cursor (tool, gdisp,
gimp_tool_control_get_toggle_cursor (tool->control),
gimp_tool_control_get_toggle_tool_cursor (tool->control),
gimp_tool_control_get_toggle_cursor_modifier (tool->control));
}
else
{
gimp_tool_set_cursor (tool, gdisp,
gimp_tool_control_get_cursor (tool->control),
gimp_tool_control_get_tool_cursor (tool->control),
gimp_tool_control_get_cursor_modifier (tool->control));
}
}

View File

@ -1,17 +0,0 @@
EXPORTS
gimp_crop_type_get_type
gimp_rect_select_mode_get_type
gimp_tool_arrow_key
gimp_tool_button_press
gimp_tool_button_release
gimp_tool_control
gimp_tool_cursor_update
gimp_tool_get_type
gimp_tool_initialize
gimp_tool_modifier_key
gimp_tool_module_get_type
gimp_tool_module_new
gimp_tool_motion
gimp_tool_oper_update
gimp_tool_set_cursor
gimp_transform_grid_type_get_type

View File

@ -1,93 +0,0 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995-2002 Spencer Kimball, Peter Mattis, and others
*
* 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_TOOL_CONTROL_H__
#define __GIMP_TOOL_CONTROL_H__
#include "app/core/gimpobject.h"
#define GIMP_TYPE_TOOL_CONTROL (gimp_tool_control_get_type ())
#define GIMP_TOOL_CONTROL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_TOOL_CONTROL, GimpToolControl))
#define GIMP_TOOL_CONTROL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_TOOL_CONTROL, GimpToolControlClass))
#define GIMP_IS_TOOL_CONTROL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_TOOL_CONTROL))
#define GIMP_IS_TOOL_CONTROL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_TOOL_CONTROL))
#define GIMP_TOOL_CONTROL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_TOOL_CONTROL, GimpToolControlClass))
GType gimp_tool_control_get_type (void) G_GNUC_CONST;
void gimp_tool_control_pause (GimpToolControl *control);
void gimp_tool_control_resume (GimpToolControl *control);
gboolean gimp_tool_control_is_paused (GimpToolControl *control);
void gimp_tool_control_activate (GimpToolControl *control);
void gimp_tool_control_halt (GimpToolControl *control);
gboolean gimp_tool_control_is_active (GimpToolControl *control);
void gimp_tool_control_set_toggle (GimpToolControl *control,
gboolean toggled);
gboolean gimp_tool_control_is_toggled (GimpToolControl *control);
void gimp_tool_control_set_preserve (GimpToolControl *control,
gboolean preserve);
gboolean gimp_tool_control_preserve (GimpToolControl *control);
void gimp_tool_control_set_scroll_lock (GimpToolControl *control,
gboolean scroll_lock);
gboolean gimp_tool_control_scroll_lock (GimpToolControl *control);
void gimp_tool_control_set_motion_mode (GimpToolControl *control,
GimpMotionMode motion_mode);
GimpMotionMode gimp_tool_control_motion_mode (GimpToolControl *control);
void gimp_tool_control_set_handles_empty_image (GimpToolControl *control,
gboolean handle_empty);
gboolean gimp_tool_control_handles_empty_image (GimpToolControl *control);
void gimp_tool_control_set_snap_to (GimpToolControl *control,
gboolean snap_to);
gboolean gimp_tool_control_auto_snap_to (GimpToolControl *control);
GdkCursorType gimp_tool_control_get_cursor (GimpToolControl *control);
void gimp_tool_control_set_cursor (GimpToolControl *control,
GdkCursorType cursor);
GimpToolCursorType gimp_tool_control_get_tool_cursor (GimpToolControl *control);
void gimp_tool_control_set_tool_cursor (GimpToolControl *control,
GimpToolCursorType cursor);
GimpCursorModifier gimp_tool_control_get_cursor_modifier (GimpToolControl *control);
void gimp_tool_control_set_cursor_modifier (GimpToolControl *control,
GimpCursorModifier cmodifier);
GdkCursorType gimp_tool_control_get_toggle_cursor (GimpToolControl *control);
void gimp_tool_control_set_toggle_cursor (GimpToolControl *control,
GdkCursorType cursor);
GimpToolCursorType gimp_tool_control_get_toggle_tool_cursor (GimpToolControl *control);
void gimp_tool_control_set_toggle_tool_cursor (GimpToolControl *control,
GimpToolCursorType cursor);
GimpCursorModifier gimp_tool_control_get_toggle_cursor_modifier (GimpToolControl *control);
void gimp_tool_control_set_toggle_cursor_modifier (GimpToolControl *control,
GimpCursorModifier cmodifier);
#endif /* __GIMP_TOOL_CONTROL_H__ */

View File

@ -1,172 +0,0 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995-2002 Spencer Kimball, Peter Mattis and others
*
* 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 "libgimpproxy/gimpproxytypes.h"
#include "gimptooltypes.h"
#include "gimptoolmodule.h"
static void gimp_tool_module_class_init (GimpToolModuleClass *klass);
static void gimp_tool_module_init (GimpToolModule *tool);
static gboolean gimp_tool_module_load (GTypeModule *gmodule);
static void gimp_tool_module_unload (GTypeModule *gmodule);
static GTypeModuleClass *parent_class = NULL;
GType
gimp_tool_module_get_type (void)
{
static GType tool_module_type = 0;
if (! tool_module_type)
{
static const GTypeInfo tool_module_info =
{
sizeof (GimpToolModuleClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gimp_tool_module_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpToolModule),
0, /* n_preallocs */
(GInstanceInitFunc) gimp_tool_module_init,
};
tool_module_type = g_type_register_static (G_TYPE_TYPE_MODULE,
"GimpToolModule",
&tool_module_info, 0);
}
return tool_module_type;
}
static void
gimp_tool_module_class_init (GimpToolModuleClass *klass)
{
GTypeModuleClass *module_class = G_TYPE_MODULE_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
module_class->load = gimp_tool_module_load;
module_class->unload = gimp_tool_module_unload;
}
static void
gimp_tool_module_init (GimpToolModule *module)
{
module->module = NULL;
module->filename = NULL;
module->register_tool = NULL;
}
static gboolean
gimp_tool_module_load (GTypeModule *gmodule)
{
GimpToolModule *module;
guint version;
g_return_val_if_fail (G_IS_TYPE_MODULE (gmodule), FALSE);
g_return_val_if_fail (g_module_supported (), FALSE);
module = GIMP_TOOL_MODULE (gmodule);
g_return_val_if_fail (module->filename != NULL, FALSE);
module->module = g_module_open (module->filename, G_MODULE_BIND_LAZY);
if (!module->module ||
!g_module_symbol (module->module, "gimp_tool_module_register_tool",
(gpointer *) &module->register_tool) ||
!g_module_symbol (module->module, "gimp_tool_module_register_type",
(gpointer *) &module->register_type) ||
!g_module_symbol (module->module, "gimp_tool_module_get_abi_version",
(gpointer *) &module->abi_version))
{
g_warning (g_module_error());
if(module->module)
g_module_close (module->module);
return FALSE;
}
version = module->abi_version();
if (version != GIMP_TOOL_MODULE_ABI_VERSION)
{
if (version > GIMP_TOOL_MODULE_ABI_VERSION)
g_warning ("Cannot load tool plug-in %s. It is for a newer version of GIMP.", module->filename);
else
g_warning ("Cannot load tool plug-in %s. It is for an older version of GIMP.", module->filename);
return FALSE;
}
return module->register_type (module);
}
static void
gimp_tool_module_unload (GTypeModule *gmodule)
{
GimpToolModule *module;
g_return_if_fail (G_IS_TYPE_MODULE (gmodule));
g_return_if_fail (g_module_supported ());
module = GIMP_TOOL_MODULE (gmodule);
g_return_if_fail (module->module != NULL);
g_module_close (module->module); /* FIXME: error handling */
module->module = NULL;
}
GimpToolModule *
gimp_tool_module_new (const gchar *filename,
GimpToolRegisterCallback callback,
gpointer register_data)
{
GimpToolModule *module;
g_return_val_if_fail (filename != NULL, NULL);
g_return_val_if_fail (callback != NULL, NULL);
module = GIMP_TOOL_MODULE (g_object_new (GIMP_TYPE_TOOL_MODULE, NULL));
module->filename = g_strdup (filename); /* FIXME: memory leak; free on delete */
if (gimp_tool_module_load (G_TYPE_MODULE (module)))
{
module->register_tool (callback, register_data);
gimp_tool_module_unload (G_TYPE_MODULE (module));
return module;
}
else
return NULL;
}

View File

@ -1,67 +0,0 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995-2002 Spencer Kimball, Peter Mattis and others
*
* 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_TOOL_MODULE_H__
#define __GIMP_TOOL_MODULE_H__
#include <gmodule.h>
#define GIMP_TOOL_MODULE_ABI_VERSION 0x1
#define GIMP_TYPE_TOOL_MODULE (gimp_tool_module_get_type ())
#define GIMP_TOOL_MODULE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_TOOL_MODULE, GimpToolModule))
#define GIMP_TOOL_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_TOOL_MODULE, GimpToolModuleClass))
#define GIMP_IS_TOOL_MODULE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_TOOL_MODULE))
#define GIMP_IS_TOOL_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_TOOL_MODULE))
#define GIMP_TOOL_MODULE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_TOOL_MODULE, GimpToolModuleClass))
typedef struct _GimpToolModuleClass GimpToolModuleClass;
struct _GimpToolModule
{
GTypeModule parent_instance;
GModule *module;
gchar *filename;
void (* register_tool) (GimpToolRegisterCallback callback,
gpointer register_data);
gboolean (* register_type) (GimpToolModule *module);
guint (* abi_version) (void);
};
struct _GimpToolModuleClass
{
GTypeModuleClass parent_class;
};
GType gimp_tool_module_get_type (void) G_GNUC_CONST;
GimpToolModule * gimp_tool_module_new (const gchar *filename,
GimpToolRegisterCallback callback,
gpointer data);
#endif /* __GIMP_TOOL_MODULE_H__ */

View File

@ -1,64 +0,0 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995-2002 Spencer Kimball, Peter Mattis, and others
*
* 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_TOOL_TYPES_H__
#define __GIMP_TOOL_TYPES_H__
#include "gimptoolenums.h"
G_BEGIN_DECLS
/* tools */
typedef struct _GimpTool GimpTool;
typedef struct _GimpToolModule GimpToolModule;
typedef struct _GimpToolControl GimpToolControl;
typedef struct _GimpPaintTool GimpPaintTool;
typedef struct _GimpDrawTool GimpDrawTool;
typedef struct _GimpPathTool GimpPathTool;
typedef struct _GimpTransformTool GimpTransformTool;
/* functions */
typedef GtkWidget * (* GimpToolOptionsGUIFunc) (GimpToolOptions *tool_options);
typedef void (* GimpToolRegisterCallback) (GType tool_type,
GType tool_option_type,
GimpToolOptionsGUIFunc options_gui_func,
gboolean tool_context,
const gchar *identifier,
const gchar *blurb,
const gchar *help,
const gchar *menu_path,
const gchar *menu_accel,
const gchar *help_domain,
const gchar *help_data,
const gchar *stock_id,
gpointer register_data);
typedef void (* GimpToolRegisterFunc) (GimpToolRegisterCallback callback,
gpointer register_data);
G_END_DECLS
#endif /* __GIMP_TOOLS_TYPES_H__ */

View File

@ -1,121 +0,0 @@
/* libgimptool/glue.c
* Copyright (C) 2002 Tor Lillqvist <tml@iki.fi>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/*
* Used in the libgimptool shared library for dynamic linking at
* run-time against the main executable libgimptool is used by (either
* gimp itself or tool-safe-mode, as far as I understand).
*
* Idea based upon libgimpwidgets/libgimp-glue.c.
*
* gimp_object_get_type
* gimp_tool_control_get_cursor
* gimp_tool_control_get_cursor_modifier
* gimp_tool_control_get_toggle_cursor
* gimp_tool_control_get_toggle_cursor_modifier
* gimp_tool_control_get_toggle_tool_cursor
* gimp_tool_control_get_tool_cursor
* gimp_tool_control_get_type
* gimp_tool_control_halt
* gimp_tool_control_is_paused
* gimp_tool_control_is_toggled
* gimp_tool_control_pause
* gimp_tool_control_resume
* gimp_tool_real_button_press
* gimp_tool_real_button_release
* gimp_tool_set_cursor
*/
#include "config.h"
#include <glib.h>
#ifdef G_OS_WIN32 /* Bypass whole file otherwise */
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
#include "libgimpproxy/gimpproxytypes.h"
#include "gimptooltypes.h"
#include <windows.h>
typedef int voidish;
static FARPROC
dynamic_resolve (const gchar* name)
{
FARPROC fn = NULL;
fn = GetProcAddress (GetModuleHandle (NULL), name);
if (!fn)
g_error ("GetProcAddress of %s failed!", name);
return fn;
}
#define ENTRY(type, name, parlist, arglist) \
type \
name parlist \
{ \
typedef type (*p_##name) parlist; \
static gboolean beenhere = FALSE; \
static p_##name fn; \
if (!beenhere) \
beenhere = TRUE, fn = (p_##name) dynamic_resolve (#name); \
return (fn) arglist; \
}
ENTRY (GType, gimp_object_get_type, (void), ());
ENTRY (GdkCursorType, gimp_tool_control_get_cursor, (GimpToolControl *control), (control));
ENTRY (GimpCursorModifier, gimp_tool_control_get_cursor_modifier, (GimpToolControl *control), (control));
ENTRY (GdkCursorType, gimp_tool_control_get_toggle_cursor, (GimpToolControl *control), (control));
ENTRY (GimpCursorModifier, gimp_tool_control_get_toggle_cursor_modifier, (GimpToolControl *control), (control));
ENTRY (GimpToolCursorType, gimp_tool_control_get_toggle_tool_cursor, (GimpToolControl *control), (control));
ENTRY (GimpToolCursorType, gimp_tool_control_get_tool_cursor, (GimpToolControl *control), (control));
ENTRY (GType, gimp_tool_control_get_type, (void), ());
ENTRY (voidish, gimp_tool_control_halt, (GimpToolControl *control), (control));
ENTRY (gboolean, gimp_tool_control_is_paused, (GimpToolControl *control), (control));
ENTRY (gboolean, gimp_tool_control_is_toggled, (GimpToolControl *control), (control));
ENTRY (voidish, gimp_tool_control_pause, (GimpToolControl *control), (control));
ENTRY (voidish, gimp_tool_control_resume, (GimpToolControl *control), (control));
ENTRY (voidish, gimp_tool_real_button_press, \
(GimpTool *tool, \
GimpCoords *coords, \
guint32 time, \
GdkModifierType state, \
GimpDisplay *gdisp), \
(tool, coords, time, state, gdisp));
ENTRY (voidish, gimp_tool_real_button_release, \
(GimpTool *tool, \
GimpCoords *coords, \
guint32 time, \
GdkModifierType state, \
GimpDisplay *gdisp), \
(tool, coords, time, state, gdisp));
ENTRY (voidish, gimp_tool_set_cursor, \
(GimpTool *tool, \
GimpDisplay *gdisp, \
GdkCursorType cursor, \
GimpToolCursorType tool_cursor, \
GimpCursorModifier modifier), \
(tool, gdisp, cursor, tool_cursor, modifier));
#endif /* G_OS_WIN32 */

View File

@ -1,46 +0,0 @@
TOP = ..\..
PRJ_TOP = ..
PACKAGE = gimptool
PKG_VER = 1.3
!INCLUDE $(TOP)\glib\build\win32\make.msc
DEFINES = -DG_LOG_DOMAIN=\"LibGimpTool\"
INCLUDES = \
-FImsvc_recommended_pragmas.h \
-I.. \
$(GLIB_CFLAGS) $(GTK2_CFLAGS) \
PKG_LINK = \
$(GLIB_LIBS) $(GTK2_LIBS) \
..\libgimpbase\gimpbase-$(PKG_VER).lib
OBJECTS = \
gimptool.obj \
gimptoolenums.obj \
gimptoolmodule.obj \
all : \
$(PRJ_TOP)\config.h \
$(PACKAGE).lib \
!IFDEF DLLGIMP
$(PACKAGE)-$(PKG_VER).dll
!ENDIF
$(PRJ_TOP)\config.h: $(PRJ_TOP)\config.h.win32
copy $(PRJ_TOP)\config.h.win32 $(PRJ_TOP)\config.h
RESOURCE = $(PACKAGE).res
$(PACKAGE).lib : $(OBJECTS)
lib /out:$(PACKAGE).lib $(OBJECTS)
$(PACKAGE)-$(PKG_VER).dll : $(OBJECTS) $(PACKAGE).def
$(CC) $(CFLAGS) -LD -Fe$(PACKAGE)-$(PKG_VER).dll $(OBJECTS) $(PKG_LINK) user32.lib advapi32.lib wsock32.lib $(LDFLAGS) /def:$(PACKAGE).def
$(PACKAGE).exe : $(OBJECTS) $(PACKAGE).def $(PACKAGE).res
$(CC) $(CFLAGS) -Fe$(PACKAGE).exe $(PACKAGE).res $(OBJECTS) $(PKG_LINK) \
user32.lib advapi32.lib shell32.lib wsock32.lib winspool.lib $(LDFLAGS) /def:$(PACKAGE).def
.c.obj :
$(CC) $(CFLAGS) -GD -c $(PKG_CFLAGS) $<

View File

@ -53,5 +53,4 @@ SUBDIRS = \
sel2path \
$(WEBBROWSER) \
$(XJT) \
common \
tools
common

View File

@ -1,6 +0,0 @@
Makefile.in
Makefile
.deps
_libs
.libs
plugin-helper

View File

@ -1,22 +0,0 @@
## Process this file with automake to produce Makefile.in
libexecdir = $(gimpplugindir)/plug-ins
libexec_PROGRAMS = plugin-helper
plugin_helper_SOURCES = \
plugin-helper.c
INCLUDES = \
-I$(top_srcdir) \
$(GTK_CFLAGS) \
-I$(includedir)
LDADD = \
$(top_builddir)/libgimp/libgimpui-$(LT_RELEASE).la \
$(top_builddir)/libgimpwidgets/libgimpwidgets-$(LT_RELEASE).la \
$(top_builddir)/libgimp/libgimp-$(LT_RELEASE).la \
$(top_builddir)/libgimpcolor/libgimpcolor-$(LT_RELEASE).la \
$(top_builddir)/libgimpbase/libgimpbase-$(LT_RELEASE).la \
$(GTK_LIBS) \
$(INTLLIBS)

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +0,0 @@
Makefile.in
Makefile
tool-safe-mode

View File

@ -1,34 +0,0 @@
## Process this file with automake to produce Makefile.in
##SUBDIRS = common
libexecdir = $(gimpplugindir)/plug-ins
libexec_PROGRAMS = tool-safe-mode
tool_safe_mode_SOURCES = \
tool-safe-mode.c \
tool-safe-mode.h \
tool-safe-mode-plug-in.c \
tool-safe-mode-plug-in.h \
gimptool.c \
gimptoolcontrol.c \
gimptoolcontrol.h
INCLUDES = \
-I$(top_srcdir) \
-I$(top_srcdir)/app \
-I$(top_srcdir)/app/core \
$(GTK_CFLAGS) \
-I$(includedir)
LDADD = \
$(top_builddir)/libgimp/libgimpui-$(LT_RELEASE).la \
$(top_builddir)/libgimpwidgets/libgimpwidgets-$(LT_RELEASE).la \
$(top_builddir)/libgimp/libgimp-$(LT_RELEASE).la \
$(top_builddir)/libgimpcolor/libgimpcolor-$(LT_RELEASE).la \
$(top_builddir)/libgimpproxy/libgimpproxy-$(LT_RELEASE).la \
$(top_builddir)/libgimptool/libgimptool-$(LT_RELEASE).la \
$(top_builddir)/libgimpbase/libgimpbase-$(LT_RELEASE).la \
$(GTK_LIBS) \
$(INTLLIBS)

View File

@ -1,2 +0,0 @@
Makefile.in
Makefile

View File

@ -1,30 +0,0 @@
libexecdir = $(gimpplugindir)/tool-plug-ins
INCLUDES = \
-I$(top_srcdir) \
-I$(top_srcdir)/app/ \
-I$(top_srcdir)/app/tools \
$(GTK_CFLAGS) \
-I$(includedir)
libexec_LTLIBRARIES = libgimpbrushselecttool.la
###BEGIN EVIL KLUDGE
install-exec-hook:
list='$(libexec_LTLIBRARIES)'; for p in $$list; do \
rm -f $(DESTDIR)$(libexecdir)/$$p; \
rm -f `echo $(DESTDIR)$(libexecdir)/$$p | sed -e "s/\\.la/.a/"`; \
done
###END EVIL KLUDGE
libgimpbrushselecttool_la_SOURCES = \
gimpbrushselecttool.c \
gimpbrushselecttool.h
libgimpbrushselecttool_la_LDFLAGS = -avoid-version -module
libgimpbrushselecttool_la_LIBADD = $(GTK_LIBS)

View File

@ -1,346 +0,0 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995-2002 Spencer Kimball, Peter Mattis, and others
*
* Brush selection tool by Nathan Summers
*
* 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 <stdlib.h>
#include <string.h>
#include <gmodule.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
#include "libgimpmath/gimpmath.h"
#include "tools-types.h"
#include "core/gimpchannel.h"
#include "core/gimpimage.h"
#include "core/gimpimage-mask.h"
#include "core/gimpimage-mask-select.h"
#include "core/gimplayer-floating-sel.h"
#include "core/gimptoolinfo.h"
#include "display/gimpdisplay.h"
#include "display/gimpdisplay-foreach.h"
#include "gimpeditselectiontool.h"
#include "gimpbrushselecttool.h"
#include "selection_options.h"
#include "libgimp/gimpintl.h"
#define DEFAULT_MAX_INC 1024
static void gimp_brush_select_tool_class_init (GimpBrushSelectToolClass *klass);
static void gimp_brush_select_tool_init (GimpBrushSelectTool *brush_select);
static void gimp_brush_select_tool_finalize (GObject *object);
static void gimp_brush_select_tool_button_press (GimpTool *tool,
GimpCoords *coords,
guint32 time,
GdkModifierType state,
GimpDisplay *gdisp);
static void gimp_brush_select_tool_button_release (GimpTool *tool,
GimpCoords *coords,
guint32 time,
GdkModifierType state,
GimpDisplay *gdisp);
static void gimp_brush_select_tool_motion (GimpTool *tool,
GimpCoords *coords,
guint32 time,
GdkModifierType state,
GimpDisplay *gdisp);
static void gimp_brush_select_tool_draw (GimpDrawTool *draw_tool);
static void gimp_brush_select_tool_add_point (GimpBrushSelectTool *free_sel,
gdouble x,
gdouble y);
static GimpSelectionToolClass *parent_class = NULL;
GType gimp_type_brush_select_tool;
/* public functions */
G_MODULE_EXPORT gboolean
gimp_tool_module_register_type (GTypeModule *module)
{
g_message("registering brush selection tool type.\n");
gimp_brush_select_tool_get_type(module);
return 1;
}
G_MODULE_EXPORT void
gimp_tool_module_register_tool (Gimp *gimp,
GimpToolRegisterCallback callback)
{
g_message("registering brush selection tool info.\n");
(* callback) (gimp,
GIMP_TYPE_BRUSH_SELECT_TOOL,
selection_options_new,
FALSE,
"gimp-brush-select-tool-module",
_("Brush Select"),
_("Select hand-painted regions"),
_("/Tools/Selection Tools/Brush Select"), "B",
NULL, "tools/brush_select.html",
/* danger will robinson! */
GIMP_STOCK_TOOL_FREE_SELECT);
}
GType
gimp_brush_select_tool_get_type (GTypeModule *module)
{
static const GTypeInfo tool_info =
{
sizeof (GimpBrushSelectToolClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gimp_brush_select_tool_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpBrushSelectTool),
0, /* n_preallocs */
(GInstanceInitFunc) gimp_brush_select_tool_init,
};
gimp_type_brush_select_tool = g_type_module_register_type (module,
GIMP_TYPE_SELECTION_TOOL,
"GimpBrushSelectTool",
&tool_info, 0);
return gimp_type_brush_select_tool;
}
/* private functions */
static void
gimp_brush_select_tool_class_init (GimpBrushSelectToolClass *klass)
{
GObjectClass *object_class;
GimpToolClass *tool_class;
GimpDrawToolClass *draw_tool_class;
object_class = G_OBJECT_CLASS (klass);
tool_class = GIMP_TOOL_CLASS (klass);
draw_tool_class = GIMP_DRAW_TOOL_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
object_class->finalize = gimp_brush_select_tool_finalize;
tool_class->button_press = gimp_brush_select_tool_button_press;
tool_class->button_release = gimp_brush_select_tool_button_release;
tool_class->motion = gimp_brush_select_tool_motion;
draw_tool_class->draw = gimp_brush_select_tool_draw;
}
static void
gimp_brush_select_tool_init (GimpBrushSelectTool *brush_select)
{
GimpTool *tool;
GimpSelectionTool *select_tool;
tool = GIMP_TOOL (brush_select);
select_tool = GIMP_SELECTION_TOOL (brush_select);
tool->tool_cursor = GIMP_FREE_SELECT_TOOL_CURSOR;
tool->scroll_lock = TRUE; /* Do not allow scrolling */
brush_select->points = NULL;
brush_select->num_points = 0;
brush_select->max_segs = 0;
}
static void
gimp_brush_select_tool_finalize (GObject *object)
{
GimpBrushSelectTool *free_sel;
free_sel = GIMP_BRUSH_SELECT_TOOL (object);
if (free_sel->points)
{
g_free (free_sel->points);
free_sel->points = NULL;
}
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static void
gimp_brush_select_tool_button_press (GimpTool *tool,
GimpCoords *coords,
guint32 time,
GdkModifierType state,
GimpDisplay *gdisp)
{
GimpBrushSelectTool *free_sel;
free_sel = GIMP_BRUSH_SELECT_TOOL (tool);
tool->state = ACTIVE;
tool->gdisp = gdisp;
switch (GIMP_SELECTION_TOOL (tool)->op)
{
case SELECTION_MOVE_MASK:
init_edit_selection (tool, gdisp, coords, EDIT_MASK_TRANSLATE);
return;
case SELECTION_MOVE:
init_edit_selection (tool, gdisp, coords, EDIT_MASK_TO_LAYER_TRANSLATE);
return;
default:
break;
}
free_sel->num_points = 0;
gimp_brush_select_tool_add_point (free_sel, coords->x, coords->y);
gimp_draw_tool_start (GIMP_DRAW_TOOL (tool), gdisp);
}
static void
gimp_brush_select_tool_button_release (GimpTool *tool,
GimpCoords *coords,
guint32 time,
GdkModifierType state,
GimpDisplay *gdisp)
{
GimpBrushSelectTool *free_sel;
SelectionOptions *sel_options;
free_sel = GIMP_BRUSH_SELECT_TOOL (tool);
sel_options = (SelectionOptions *) tool->tool_info->tool_options;
gimp_draw_tool_stop (GIMP_DRAW_TOOL (tool));
tool->state = INACTIVE;
/* First take care of the case where the user "cancels" the action */
if (! (state & GDK_BUTTON3_MASK))
{
if (free_sel->num_points == 1)
{
/* If there is a floating selection, anchor it */
if (gimp_image_floating_sel (gdisp->gimage))
floating_sel_anchor (gimp_image_floating_sel (gdisp->gimage));
/* Otherwise, clear the selection mask */
else
gimp_image_mask_clear (gdisp->gimage);
gdisplays_flush ();
return;
}
gimp_image_mask_select_polygon (gdisp->gimage,
free_sel->num_points,
free_sel->points,
GIMP_SELECTION_TOOL (tool)->op,
sel_options->antialias,
sel_options->feather,
sel_options->feather_radius,
sel_options->feather_radius);
gdisplays_flush ();
}
}
static void
gimp_brush_select_tool_motion (GimpTool *tool,
GimpCoords *coords,
guint32 time,
GdkModifierType state,
GimpDisplay *gdisp)
{
GimpBrushSelectTool *free_sel;
GimpSelectionTool *sel_tool;
free_sel = GIMP_BRUSH_SELECT_TOOL (tool);
sel_tool = GIMP_SELECTION_TOOL (tool);
if (tool->state != ACTIVE)
return;
if (sel_tool->op == SELECTION_ANCHOR)
{
sel_tool->op = SELECTION_REPLACE;
gimp_tool_cursor_update (tool, coords, state, gdisp);
}
gimp_brush_select_tool_add_point (free_sel, coords->x, coords->y);
gimp_draw_tool_draw_line (GIMP_DRAW_TOOL (tool),
free_sel->points[free_sel->num_points - 2].x,
free_sel->points[free_sel->num_points - 2].y,
free_sel->points[free_sel->num_points - 1].x,
free_sel->points[free_sel->num_points - 1].y,
FALSE);
}
static void
gimp_brush_select_tool_draw (GimpDrawTool *draw_tool)
{
GimpBrushSelectTool *free_sel;
gint i;
free_sel = GIMP_BRUSH_SELECT_TOOL (draw_tool);
for (i = 1; i < free_sel->num_points; i++)
{
gimp_draw_tool_draw_line (draw_tool,
free_sel->points[i - 1].x,
free_sel->points[i - 1].y,
free_sel->points[i].x,
free_sel->points[i].y,
FALSE);
}
}
static void
gimp_brush_select_tool_add_point (GimpBrushSelectTool *free_sel,
gdouble x,
gdouble y)
{
if (free_sel->num_points >= free_sel->max_segs)
{
free_sel->max_segs += DEFAULT_MAX_INC;
free_sel->points = g_realloc (free_sel->points,
sizeof (GimpVector2) * free_sel->max_segs);
}
free_sel->points[free_sel->num_points].x = x;
free_sel->points[free_sel->num_points].y = y;
free_sel->num_points++;
}

View File

@ -1,67 +0,0 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995-2002 Spencer Kimball, Peter Mattis, and others
*
* Brush selection tool by Nathan Summers
*
* 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_BRUSH_SELECT_TOOL_H__
#define __GIMP_BRUSH_SELECT_TOOL_H__
#include "gimpselectiontool.h"
/* GTypeModules use a static variable instead of a function call
to get the GType. See http://www.gtk.org/~otaylor/gtk/2.0/theme-engines.html
for the rationale. */
extern GType gimp_type_brush_select_tool;
#define GIMP_TYPE_BRUSH_SELECT_TOOL gimp_type_brush_select_tool
#define GIMP_BRUSH_SELECT_TOOL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_BRUSH_SELECT_TOOL, GimpBrushSelectTool))
#define GIMP_BRUSH_SELECT_TOOL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_BRUSH_SELECT_TOOL, GimpBrushSelectToolClass))
#define GIMP_IS_BRUSH_SELECT_TOOL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_BRUSH_SELECT_TOOL))
#define GIMP_IS_BRUSH_SELECT_TOOL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_BRUSH_SELECT_TOOL))
#define GIMP_BRUSH_SELECT_TOOL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_BRUSH_SELECT_TOOL, GimpBrushSelectToolClass))
typedef struct _GimpBrushSelectTool GimpBrushSelectTool;
typedef struct _GimpBrushSelectToolClass GimpBrushSelectToolClass;
struct _GimpBrushSelectTool
{
GimpSelectionTool parent_instance;
GimpVector2 *points;
gint num_points;
gint max_segs;
};
struct _GimpBrushSelectToolClass
{
GimpSelectionToolClass parent_class;
};
void gimp_brush_select_tool_register (Gimp *gimp,
GimpToolRegisterCallback callback);
GType gimp_brush_select_tool_get_type (GTypeModule *module);
#endif /* __GIMP_BRUSH_SELECT_TOOL_H__ */

View File

@ -1,133 +0,0 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995-2002 Spencer Kimball, Peter Mattis and others
*
* 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 "libgimpproxy/gimpproxytypes.h"
#include "libgimptool/gimptooltypes.h"
#include "libgimptool/gimptool.h"
void
gimp_tool_push_status (GimpTool *tool,
const gchar *message)
{
#if 0
GimpStatusbar *statusbar;
g_return_if_fail (GIMP_IS_TOOL (tool));
g_return_if_fail (GIMP_IS_DISPLAY (tool->gdisp));
g_return_if_fail (message != NULL);
statusbar =
GIMP_STATUSBAR (GIMP_DISPLAY_SHELL (tool->gdisp->shell)->statusbar);
gimp_statusbar_push (statusbar,
G_OBJECT_TYPE_NAME (tool),
message);
#endif
}
void
gimp_tool_push_status_coords (GimpTool *tool,
const gchar *title,
gdouble x,
const gchar *separator,
gdouble y)
{
#if 0
GimpStatusbar *statusbar;
g_return_if_fail (GIMP_IS_TOOL (tool));
g_return_if_fail (GIMP_IS_DISPLAY (tool->gdisp));
g_return_if_fail (title != NULL);
g_return_if_fail (separator != NULL);
statusbar =
GIMP_STATUSBAR (GIMP_DISPLAY_SHELL (tool->gdisp->shell)->statusbar);
gimp_statusbar_push_coords (statusbar,
G_OBJECT_TYPE_NAME (tool),
title, x, separator, y);
#endif
}
void
gimp_tool_pop_status (GimpTool *tool)
{
#if 0
GimpStatusbar *statusbar;
g_return_if_fail (GIMP_IS_TOOL (tool));
g_return_if_fail (GIMP_IS_DISPLAY (tool->gdisp));
statusbar =
GIMP_STATUSBAR (GIMP_DISPLAY_SHELL (tool->gdisp->shell)->statusbar);
gimp_statusbar_pop (statusbar,
G_OBJECT_TYPE_NAME (tool));
#endif
}
void
gimp_tool_set_cursor (GimpTool *tool,
GimpDisplay *gdisp,
GdkCursorType cursor,
GimpToolCursorType tool_cursor,
GimpCursorModifier modifier)
{
#if 0
g_return_if_fail (GIMP_IS_TOOL (tool));
g_return_if_fail (GIMP_IS_DISPLAY (gdisp));
gimp_display_shell_set_cursor (GIMP_DISPLAY_SHELL (gdisp->shell),
cursor,
tool_cursor,
modifier);
#endif
}
void
gimp_tool_real_button_press (GimpTool *tool,
GimpCoords *coords,
guint32 time,
GdkModifierType state,
GimpDisplay *gdisp)
{
#if 0
tool->gdisp = gdisp;
tool->drawable = gimp_image_active_drawable (gdisp->gimage);
tool->state = ACTIVE;
#endif
}
void
gimp_tool_real_button_release (GimpTool *tool,
GimpCoords *coords,
guint32 time,
GdkModifierType state,
GimpDisplay *gdisp)
{
#if 0
tool->state = INACTIVE;
#endif
}

View File

@ -1,161 +0,0 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995-2002 Spencer Kimball, Peter Mattis and others
*
* 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 <gtk/gtk.h>
#include "config.h"
#include "core-types.h"
#include "widgets/widgets-types.h"
#include "libgimptool/gimptooltypes.h"
#include "gimptoolcontrol.h"
static void gimp_tool_control_class_init (GimpToolControlClass *klass);
static void gimp_tool_control_init (GimpToolControl *tool);
static GimpObjectClass *parent_class = NULL;
GType
gimp_tool_control_get_type (void)
{
static GType tool_control_type = 0;
if (! tool_control_type)
{
static const GTypeInfo tool_control_info =
{
sizeof (GimpToolControlClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gimp_tool_control_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpToolControl),
0, /* n_preallocs */
(GInstanceInitFunc) gimp_tool_control_init,
};
tool_control_type = g_type_register_static (GIMP_TYPE_OBJECT,
"GimpToolControl",
&tool_control_info, 0);
}
return tool_control_type;
}
static void
gimp_tool_control_class_init (GimpToolControlClass *klass)
{
parent_class = g_type_class_peek_parent (klass);
}
static void
gimp_tool_control_init (GimpToolControl *control)
{
#if 0
control->state = INACTIVE;
control->paused_count = 0;
control->toggled = FALSE;
#endif
}
GimpToolControl *
gimp_tool_control_new (gboolean scroll_lock,
gboolean auto_snap_to,
gboolean preserve,
gboolean handle_empty_image,
gboolean perfectmouse,
/* are all these necessary? */
GdkCursorType cursor,
GimpToolCursorType tool_cursor,
GimpCursorModifier cursor_modifier,
GdkCursorType toggle_cursor,
GimpToolCursorType toggle_tool_cursor,
GimpCursorModifier toggle_cursor_modifier)
{
GimpToolControl *control;
control = GIMP_TOOL_CONTROL (g_object_new (GIMP_TYPE_TOOL_CONTROL, NULL));
#if 0
control->scroll_lock = scroll_lock;
control->auto_snap_to = auto_snap_to;
control->preserve = preserve;
control->handle_empty_image = handle_empty_image;
control->perfectmouse = perfectmouse;
control->cursor = cursor;
control->tool_cursor = tool_cursor;
control->cursor_modifier = cursor_modifier;
control->toggle_cursor = toggle_cursor;
control->toggle_tool_cursor = toggle_tool_cursor;
control->toggle_cursor_modifier = toggle_cursor_modifier;
#endif
return control;
}
void gimp_tool_control_pause (GimpToolControl *control)
{
g_return_if_fail(GIMP_IS_TOOL_CONTROL(control));
/* control->state = PAUSED ? */
#if 0
control->paused_count++;
#endif
}
void gimp_tool_control_resume (GimpToolControl *control)
{
g_return_if_fail(GIMP_IS_TOOL_CONTROL(control));
#if 0
control->paused_count--;
#endif
}
gboolean gimp_tool_control_is_paused (GimpToolControl *control)
{
#if 0
g_return_val_if_fail(GIMP_IS_TOOL_CONTROL(control), FALSE);
return control->paused_count > 0;
#else
return 0;
#endif
}
void gimp_tool_control_halt (GimpToolControl *control)
{
g_return_if_fail(GIMP_IS_TOOL_CONTROL(control));
#if 0
control->state = INACTIVE;
control->paused_count = 0;
#endif
}
GdkCursorType gimp_tool_control_get_toggle_cursor (GimpToolControl *control) {return 0;}
GdkCursorType gimp_tool_control_get_tool_cursor (GimpToolControl *control){return 0;}
GimpCursorModifier gimp_tool_control_get_cursor_modifier(GimpToolControl *control){return 0;}
GimpCursorModifier gimp_tool_control_get_toggle_cursor_modifier(GimpToolControl *control){return 0;}
gboolean gimp_tool_control_is_toggled (GimpToolControl *control){return 0;}
GimpToolCursorType gimp_tool_control_get_toggle_tool_cursor(GimpToolControl *control) {return 0;}
GimpToolCursorType gimp_tool_control_get_cursor(GimpToolControl *control){return 0;}

View File

@ -1,66 +0,0 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995-2002 Spencer Kimball, Peter Mattis and others
*
* 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_TOOL_CONTROL_H__
#define __GIMP_TOOL_CONTROL_H__
#include "libgimptool/gimptooltypes.h"
#include "gimpobject.h"
#define GIMP_TYPE_TOOL_CONTROL (gimp_tool_control_get_type ())
#define GIMP_TOOL_CONTROL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_TOOL_CONTROL, GimpToolControl))
#define GIMP_TOOL_CONTROL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_TOOL_CONTROL, GimpToolControlClass))
#define GIMP_IS_TOOL_CONTROL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_TOOL_CONTROL))
#define GIMP_IS_TOOL_CONTROL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_TOOL_CONTROL))
#define GIMP_TOOL_CONTROL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_TOOL_CONTROL, GimpToolControlClass))
typedef struct _GimpToolControlClass GimpToolControlClass;
struct _GimpToolControlClass {
GimpObjectClass parent_class;
};
struct _GimpToolControl {
GimpObject parent_instance;
#if 0
/* eventually, we might want to cache this stuff on the plug-in side */
GimpToolState state; /* state of tool activity */
gint paused_count; /* paused control count */
gboolean scroll_lock; /* allow scrolling or not */
gboolean auto_snap_to; /* snap to guides automatically */
gboolean preserve; /* Preserve this tool across drawable *
* changes */
gboolean handle_empty_image; /* invoke the tool on images without *
* active drawable */
gboolean perfectmouse; /* tool is affected by gimprc's *
* "prefectmouse" setting */
GdkCursorType cursor;
GimpToolCursorType tool_cursor;
GimpCursorModifier cursor_modifier;
GdkCursorType toggle_cursor;
GimpToolCursorType toggle_tool_cursor;
GimpCursorModifier toggle_cursor_modifier;
gboolean toggled;
#endif
};
#endif /* __GIMP_TOOL_CONTROL_H__ */

View File

@ -1,68 +0,0 @@
/* The GIMP -- an image manipulation program
*
* tool-safe-mode -- support plug-in for dynamically loaded tool modules
* Copyright (C) 2000 Nathan Summers
*
* 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 <string.h>
#include <gtk/gtk.h>
#include <libgimp/gimp.h>
#include "tool-safe-mode.h"
#include "libgimp/stdplugins-intl.h"
static void
safe_mode_init (void)
{
gchar *tool_plug_in_path;
gchar *freeme;
g_type_init ();
freeme = tool_plug_in_path = gimp_gimprc_query ("tool-plug-in-path");
/* FIXME: why does it return the string with quotes around it?
* gflare-path does not
*
* It's a bug that will be fixed with the death of app/gimprc.c
* --mitch
*/
tool_plug_in_path++;
tool_plug_in_path[strlen(tool_plug_in_path)-1] = 0;
tool_safe_mode_init (tool_plug_in_path);
g_free (freeme);
}
GimpPlugInInfo PLUG_IN_INFO =
{
safe_mode_init, /* init_proc */
NULL, /* query_proc */
NULL, /* quit_proc */
NULL, /* run_proc */
};
MAIN ()

View File

@ -1,38 +0,0 @@
/* Plugin-helper.h
* Copyright (C) 2000 Nathan Summers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __PLUGIN_HELPER_H__
#define __PLUGIN_HELPER_H__
extern void plugin_module_install_procedure (gchar * name,
gchar * blurb,
gchar * help,
gchar * author,
gchar * copyright,
gchar * date,
gchar * menu_path,
gchar * image_types,
gint nparams,
gint nreturn_vals,
GimpParamDef * params,
GimpParamDef * return_vals,
GimpRunProc run_proc);
#endif /* __PLUGIN_HELPER_H__ */

View File

@ -1,132 +0,0 @@
/* The GIMP -- an image manipulation program
*
* tool-safe-mode -- support plug-in for dynamically loaded tool modules
* Copyright (C) 2000 Nathan Summers
*
* 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 <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <gtk/gtk.h>
#include "libgimpbase/gimpbase.h"
#include "libgimpproxy/gimpproxytypes.h"
#include "libgimptool/gimptooltypes.h"
#include "libgimptool/gimptoolmodule.h"
#include "libgimp/stdplugins-intl.h"
static void
safe_mode_register_tool ()
{
}
/* much code borrowed from gimp_datafiles_read_directories --
* why isn't that function available in libgimp? It would be
* better than the ad-hoc stuff in gimpressionist, gflare, etc.
*/
void
tool_safe_mode_init (const gchar *tool_plug_in_path)
{
#ifdef VERBOSE
g_message ("tool-safe-mode init called");
#endif
if (g_module_supported () && tool_plug_in_path)
{
GList *path;
GList *list;
gchar *filename;
gint err;
GDir *dir;
const gchar *dir_ent;
struct stat filestat;
#ifdef __EMX__
/*
* Change drive so opendir works.
*/
if (tool_plug_in_path[1] == ':')
{
_chdrive (tool_plug_in_path[0]);
}
#endif
#ifdef VERBOSE
g_message ("tool_plug_in_path: %s", tool_plug_in_path);
#endif
path = gimp_path_parse (tool_plug_in_path, 16, TRUE, NULL);
for (list = path; list; list = g_list_next (list))
{
#ifdef VERBOSE
g_message ("reading datafiles directory '%s'", (gchar *) list->data);
#endif
dir = g_dir_open ((gchar *) list->data, 0, NULL);
if (!dir)
{
g_message ("error reading datafiles directory '%s'",
(gchar *) list->data);
}
else
{
while ((dir_ent = g_dir_read_name (dir)))
{
filename = g_build_filename ((gchar *) list->data,
dir_ent, NULL);
/* Check the file and see that it is not a sub-directory */
err = stat (filename, &filestat);
if (! err && !S_ISDIR (filestat.st_mode))
{
g_message ("loading tool %s\n", filename);
gimp_tool_module_new (filename,
safe_mode_register_tool,
NULL);
}
g_free (filename);
}
g_dir_close (dir);
}
}
gimp_path_free (path);
}
#ifdef VERBOSE
g_message ("tool-safe-mode init done");
#endif
}

View File

@ -1,27 +0,0 @@
/* Plugin-helper.h
* Copyright (C) 2000 Nathan Summers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __TOOL_SAVE_MODE_H__
#define __TOOL_SAVE_MODE_H__
void tool_safe_mode_init (const gchar *tool_plug_in_path);
#endif /* __TOOL_SAFE_MODE_H__ */

View File

@ -1,3 +1,7 @@
2003-04-15 Sven Neumann <sven@gimp.org>
* POTFILES.in: updated.
2003-04-14 Sven Neumann <sven@gimp.org>
* de.po: Updated german translation.

View File

@ -179,6 +179,7 @@ app/text/gimptext-compat.c
app/text/gimptext.c
app/text/gimptextlayer.c
app/tools/tools-enums.c
app/tools/gimpairbrushtool.c
app/tools/gimpbezierselecttool.c
app/tools/gimpblendoptions.c
@ -286,5 +287,3 @@ app/xcf/xcf-seek.c
app/xcf/xcf.c
data/misc/gimp.desktop.in.in
libgimptool/gimptoolenums.c

View File

@ -35,7 +35,6 @@ INCLUDES = \
EXTRA_DIST = \
gimp-mkenums \
gimp-mkproxy \
gimppath2svg.py \
rmshm

View File

@ -1,155 +0,0 @@
#!/usr/bin/perl -w
# This is gimp-mkproxy, a perl script based on glib-mkenums.
# It makes proxy objects for libgimptool.
# gimp-mkproxy
my $in_skip = 0;
my $first_line = 1;
my $include;
sub parse_trigraph {
my $opts = shift;
my @opts;
for $opt (split /\s*,\s*/, $opts) {
$opt =~ s/^\s*//;
$opt =~ s/\s*$//;
my ($key,$val) = $opt =~ /([\w-]+)(?:=(.+))?/;
defined $val or $val = 1;
push @opts, $key, $val;
}
@opts;
}
sub version {
print STDERR "gimp-mkproxy based on gimp-mkenums based on glib-mkenums version glib-2.0\n";
print STDERR "gimp-mkproxy comes with ABSOLUTELY NO WARRANTY.\n";
print STDERR "You may redistribute copies of gimp-mkenums under the terms\n";
print STDERR "of the GNU General Public License which can be found in the\n";
print STDERR "GIMP source package.";
exit 0;
}
sub usage {
print STDERR "Usage: gimp-mkproxy [options] [files...]\n";
print STDERR " --fhead <text> output file header\n";
print STDERR " --fprod <text> per input file production\n";
print STDERR " --ftail <text> output file trailer\n";
print STDERR " --comments <text> comment structure\n";
print STDERR " -h, --help show this help message\n";
print STDERR " -v, --version print version informations\n";
print STDERR "Production text substitutions:\n";
print STDERR " \@filename\@ name of current input file\n";
exit 0;
}
# production variables:
my $fhead = ""; # output file header
my $fprod = ""; # per input file production
my $ftail = ""; # output file trailer
# other options
my $comment_tmpl = "/* \@comment\@ */";
if (!defined $ARGV[0]) {
usage;
}
while ($_ = $ARGV[0], /^-/) {
shift;
last if /^--$/;
if (/^--fhead$/) { $fhead = $fhead . shift }
elsif (/^--fprod$/) { $fprod = $fprod . shift }
elsif (/^--ftail$/) { $ftail = $ftail . shift }
elsif (/^--comments$/) { $comment_tmpl = shift }
elsif (/^--help$/ || /^-h$/) { usage; }
elsif (/^--version$/ || /^-v$/) { version; }
else { usage; }
}
# put auto-generation comment
{
my $comment = $comment_tmpl;
$comment =~ s/\@comment\@/Generated data (by gimp-mkproxy)/;
print "\n" . $comment . "\n\n";
}
if (length($fhead)) {
my $prod = $fhead;
$prod =~ s/\@filename\@/$ARGV/g;
$prod =~ s/\\a/\a/g; $prod =~ s/\\b/\b/g; $prod =~ s/\\t/\t/g; $prod =~ s/\\n/\n/g;
$prod =~ s/\\f/\f/g; $prod =~ s/\\r/\r/g;
print "$prod\n";
}
while (<>) {
$include=0;
if (m@/\*<
(([^*]|\*(?!/))*)
>\s*\*/
@x) {
my %options=parse_trigraph ($1);
defined $options{'proxy-skip'} and $in_skip = 1;
defined $options{'proxy-resume'} and $in_skip = 0;
defined $options{'proxy-include'} and $include = 1;
if ($options{'proxy-subst'}) {
$_ = $options{'proxy-subst'} . "\n";
$include = 1;
}
}
# read lines until we have no open comments
while (m@/\*([^*]|\*(?!/))*$@) {
my $new;
defined ($new = <>) || die "Unmatched comment in $ARGV";
$_ .= $new;
}
# Spit out the output
if (!$in_skip || $include) {
if ($first_line) {
$first_line = 0;
if (length($fprod)) {
my $prod = $fprod;
$prod =~ s/\@filename\@/$ARGV/g;
$prod =~ s/\\a/\a/g; $prod =~ s/\\b/\b/g; $prod =~ s/\\t/\t/g; $prod =~ s/\\n/\n/g;
$prod =~ s/\\f/\f/g; $prod =~ s/\\r/\r/g;
print "$prod\n";
}
}
print;
}
if (eof) {
close (ARGV); # reset line numbering
$first_line = 1; # Flag to print filename at next line
$in_skip = 0;
}
}
if (length($ftail)) {
my $prod = $ftail;
$prod =~ s/\@filename\@/$ARGV/g;
$prod =~ s/\\a/\a/g; $prod =~ s/\\b/\b/g; $prod =~ s/\\t/\t/g; $prod =~ s/\\n/\n/g;
$prod =~ s/\\f/\f/g; $prod =~ s/\\r/\r/g;
print "$prod\n";
}
# put auto-generation comment
{
my $comment = $comment_tmpl;
$comment =~ s/\@comment\@/Generated data ends here/;
print "\n" . $comment . "\n\n";
}

View File

@ -56,13 +56,13 @@ EXTRA_DIST = \
enum_headers = \
../../libgimpbase/gimpbasetypes.h \
../../libgimptool/gimptoolenums.h \
../../app/paint-funcs/paint-funcs-types.h \
../../app/base/base-enums.h \
../../app/core/core-enums.h \
../../app/core/core-types.h \
../../app/paint/paint-enums.h \
../../app/plug-in/plug-in-types.h
../../app/plug-in/plug-in-types.h \
../../app/tools/tools-enums.h
pdb_scripts = \
pdbgen.pl \