Commit 032c1309 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann
Browse files

app/tools/Makefile.am app/tools/gimptoolgui.[ch] removed unused files.

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

	* app/tools/Makefile.am
	* app/tools/gimptoolgui.[ch]
	* app/tools/gimptoolmodule.[ch]: removed unused files.
parent 0c399e5c
2003-04-15 Sven Neumann <sven@gimp.org>
* app/tools/Makefile.am
* app/tools/gimptoolgui.[ch]
* app/tools/gimptoolmodule.[ch]: removed unused files.
2003-04-15 Sven Neumann <sven@gimp.org>
 
Removed support for pluggable tools:
......@@ -119,8 +119,6 @@ libapptools_a_sources = \
gimptool.h \
gimptoolcontrol.c \
gimptoolcontrol.h \
gimptoolmodule.c \
gimptoolmodule.h \
gimptransformoptions.c \
gimptransformoptions.h \
gimptransformtool.c \
......
This diff is collapsed.
/* The GIMP -- an image manipulation program
* Copyright (C) 1995-2003 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_GUI_H__
#define __GIMP_TOOL_GUI_H__
#include "libgimptool/gimptool.h"
typedef enum
{
GIMP_TOOL_GUI_STATE_INVISIBLE,
GIMP_TOOL_GUI_STATE_VISIBLE
} GimpToolGuiState;
typedef enum
{
GIMP_HANDLE_SQUARE,
GIMP_HANDLE_FILLED_SQUARE,
GIMP_HANDLE_CIRCLE,
GIMP_HANDLE_FILLED_CIRCLE,
GIMP_HANDLE_CROSS
} GimpHandleType;
#define GIMP_TYPE_TOOL_GUI (gimp_tool_gui_get_type ())
#define GIMP_TOOL_GUI(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_TOOL_GUI, GimpToolGui))
#define GIMP_TOOL_GUI_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_TOOL_GUI, GimpToolGuiClass))
#define GIMP_IS_TOOL_GUI(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_TOOL_GUI))
#define GIMP_IS_TOOL_GUI_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_TOOL_GUI))
#define GIMP_TOOL_GUI_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_TOOL_GUI, GimpToolGuiClass))
typedef struct _GimpToolGuiClass GimpToolGuiClass;
struct _GimpToolGui
{
GimpObject parent_instance;
GimpDisplay *gdisp; /* The display we are drawing on (may be
* a different one than tool->gdisp)
*/
GdkWindow *win; /* Window to draw draw operation to */
GdkGC *gc; /* Graphics context for draw functions */
GimpToolGuiState draw_state; /* Current state in the draw process */
gint paused_count; /* count to keep track of multiple pauses */
gint line_width; /* line attributes */
gint line_style; /**/
gint cap_style; /**/
gint join_style; /**/
};
struct _GimpToolGuiClass
{
GimpObjectClass parent_class;
/* virtual functions */
void (* draw) (GimpToolGui *tool_gui);
void (* start) (GimpToolGui *tool,
GimpDisplay *gdisp);
void (* stop) (GimpToolGui *tool);
void (* pause) (GimpToolGui *tool);
void (* resume) (GimpToolGui *tool);
};
GType gimp_tool_gui_get_type (void) G_GNUC_CONST;
void gimp_tool_gui_draw (GimpToolGui *tool_gui);
void gimp_tool_gui_start (GimpToolGui *tool_gui,
GimpDisplay *gdisp);
void gimp_tool_gui_stop (GimpToolGui *tool_gui);
void gimp_tool_gui_pause (GimpToolGui *tool_gui);
void gimp_tool_gui_resume (GimpToolGui *tool_gui);
gdouble gimp_tool_gui_calc_distance (GimpToolGui *tool_gui,
GimpDisplay *gdisp,
gdouble x1,
gdouble y1,
gdouble x2,
gdouble y2);
gboolean gimp_tool_gui_in_radius (GimpToolGui *tool_gui,
GimpDisplay *gdisp,
gdouble x1,
gdouble y1,
gdouble x2,
gdouble y2,
gint radius);
void gimp_tool_gui_draw_line (GimpToolGui *tool_gui,
gdouble x1,
gdouble y1,
gdouble x2,
gdouble y2,
gboolean use_offsets);
void gimp_tool_gui_draw_rectangle (GimpToolGui *tool_gui,
gboolean filled,
gdouble x,
gdouble y,
gdouble width,
gdouble height,
gboolean use_offsets);
void gimp_tool_gui_draw_arc (GimpToolGui *tool_gui,
gboolean filled,
gdouble x,
gdouble y,
gdouble width,
gdouble height,
gint angle1,
gint angle2,
gboolean use_offsets);
void gimp_tool_gui_draw_rectangle_by_anchor (GimpToolGui *tool_gui,
gboolean filled,
gdouble x,
gdouble y,
gint width,
gint height,
GtkAnchorType anchor,
gboolean use_offsets);
void gimp_tool_gui_draw_arc_by_anchor (GimpToolGui *tool_gui,
gboolean filled,
gdouble x,
gdouble y,
gint radius_x,
gint radius_y,
gint angle1,
gint angle2,
GtkAnchorType anchor,
gboolean use_offsets);
void gimp_tool_gui_draw_cross_by_anchor (GimpToolGui *tool_gui,
gdouble x,
gdouble y,
gint width,
gint height,
GtkAnchorType anchor,
gboolean use_offsets);
void gimp_tool_gui_draw_handle (GimpToolGui *tool_gui,
GimpHandleType type,
gdouble x,
gdouble y,
gint width,
gint height,
GtkAnchorType anchor,
gboolean use_offsets);
gboolean gimp_tool_gui_on_handle (GimpToolGui *tool_gui,
GimpDisplay *gdisp,
gdouble x,
gdouble y,
GimpHandleType type,
gdouble handle_x,
gdouble handle_y,
gint width,
gint height,
GtkAnchorType anchor,
gboolean use_offsets);
void gimp_tool_gui_draw_lines (GimpToolGui *tool_gui,
gdouble *points,
gint n_points,
gboolean filled,
gboolean use_offsets);
void gimp_tool_gui_draw_strokes (GimpToolGui *tool_gui,
GimpCoords *points,
gint n_points,
gboolean filled,
gboolean use_offsets);
#endif /* __GIMP_TOOL_GUI_H__ */
/* 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 "tools-types.h"
#include "core/gimp.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;
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)
return FALSE;
if (!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_warning (g_module_error());
g_module_close (module->module);
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 data)
{
GimpToolModule *module;
g_return_val_if_fail (filename != NULL, NULL);
g_return_val_if_fail (callback != NULL, NULL);
g_return_val_if_fail (GIMP_IS_GIMP (data), NULL);
module = GIMP_TOOL_MODULE (g_object_new (GIMP_TYPE_TOOL_MODULE, NULL));
module->filename = g_strdup (filename);
/* FIXME: check for errors! */
gimp_tool_module_load (G_TYPE_MODULE (module));
module->register_tool (callback, data);
gimp_tool_module_unload (G_TYPE_MODULE (module));
return module;
}
/* 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_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) (Gimp *gimp,
GimpToolRegisterCallback callback);
gboolean (* register_type) (GimpToolModule *module);
};
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 register_data);
#endif /* __GIMP_TOOL_MODULE_H__ */
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment