Commit 0c399e5c authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

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.
parent e745778f
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"
......@@ -18,8 +18,6 @@ SUBDIRS = \
libgimpbase \
libgimpmodule \
libgimpwidgets \
libgimpproxy \
libgimptool \
libgimp \
app \
$(GIMP_MODULES) \
......
......@@ -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) \
......
......@@ -29,7 +29,7 @@
#include "display/gimpdisplay.h"
#include "libgimptool/gimptool.h"
#include "tools/gimptool.h"
#include "tools/tool_manager.h"
......
......@@ -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 ())
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -33,8 +33,7 @@
#include "widgets/gimpitemfactory.h"
#include "libgimptool/gimptool.h"
#include "tools/gimptool.h"
#include "tools/tool_manager.h"
#include "gimpdisplay.h"
......
......@@ -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;
......
......@@ -33,8 +33,7 @@
#include "widgets/gimpitemfactory.h"
#include "libgimptool/gimptool.h"
#include "tools/gimptool.h"
#include "tools/tool_manager.h"
#include "gimpdisplay.h"
......
......@@ -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"
......
......@@ -29,7 +29,7 @@
#include "display/gimpdisplay.h"
#include "libgimptool/gimptool.h"
#include "tools/gimptool.h"
#include "tools/tool_manager.h"
......
......@@ -20,7 +20,7 @@
#define __GIMP_INK_TOOL_H__
#include "libgimptool/gimptool.h"
#include "gimptool.h"
#include "gimpinktool-blob.h" /* only used by ink */
......
......@@ -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
......@@ -24,8 +24,6 @@
#include "tools-types.h"
#include "libgimptool/gimptool.h"
#include "core/gimptoolinfo.h"
#include "paint/gimpairbrush.h"
......
......@@ -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 ())
......
......@@ -20,7 +20,7 @@
#define __GIMP_DRAW_TOOL_H__
#include "libgimptool/gimptool.h"
#include "gimptool.h"
typedef enum
......
......@@ -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 ())
......
......@@ -20,7 +20,7 @@
#define __GIMP_INK_TOOL_H__
#include "libgimptool/gimptool.h"
#include "gimptool.h"
#include "gimpinktool-blob.h" /* only used by ink */
......
......@@ -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,