Commit fafae590 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann
Browse files

configure.in app/Makefile.am moved all tool sources to app/tools

2001-01-22  Sven Neumann  <sven@gimp.org>

        * configure.in
        * app/Makefile.am
        * app/tools/Makefile.am: moved all tool sources to app/tools

        * app/app_procs.c
        * app/brush_select.c
        * app/commands.c
        * app/context_manager.c
        * app/convert.c
        * app/cursorutil.c
        * app/devices.c
        * app/disp_callbacks.c
        * app/edit_selection.c
        * app/gdisplay.c
        * app/gimage.c
        * app/gimage_mask.c
        * app/gimpbrush.c
        * app/gimpbrushgenerated.c
        * app/gimpbrushpipe.c
        * app/gimpdnd.c
        * app/gimprc.c
        * app/global_edit.c
        * app/info_window.c
        * app/interface.c
        * app/menus.c
        * app/path.c
        * app/paths_dialog.c
        * app/paths_dialogP.h
        * app/scale.c
        * app/scroll.c
        * app/undo.c
        * app/pdb/color_cmds.c
        * app/pdb/text_tool_cmds.c
        * app/pdb/tools_cmds.c
        * po/POTFILES.in
        * tools/kernelgen.c
        * tools/pdbgen/Makefile.am
        * tools/pdbgen/enums.pl
        * tools/pdbgen/pdb/color.pdb
        * tools/pdbgen/pdb/text_tool.pdb
        * tools/pdbgen/pdb/tools.pdb: changed accordingly
parent 47b036fa
2001-01-22 Sven Neumann <sven@gimp.org>
* configure.in
* app/Makefile.am
* app/tools/Makefile.am: moved all tool sources to app/tools
* app/app_procs.c
* app/brush_select.c
* app/commands.c
* app/context_manager.c
* app/convert.c
* app/cursorutil.c
* app/devices.c
* app/disp_callbacks.c
* app/edit_selection.c
* app/gdisplay.c
* app/gimage.c
* app/gimage_mask.c
* app/gimpbrush.c
* app/gimpbrushgenerated.c
* app/gimpbrushpipe.c
* app/gimpdnd.c
* app/gimprc.c
* app/global_edit.c
* app/info_window.c
* app/interface.c
* app/menus.c
* app/path.c
* app/paths_dialog.c
* app/paths_dialogP.h
* app/scale.c
* app/scroll.c
* app/undo.c
* app/pdb/color_cmds.c
* app/pdb/text_tool_cmds.c
* app/pdb/tools_cmds.c
* po/POTFILES.in
* tools/kernelgen.c
* tools/pdbgen/Makefile.am
* tools/pdbgen/enums.pl
* tools/pdbgen/pdb/color.pdb
* tools/pdbgen/pdb/text_tool.pdb
* tools/pdbgen/pdb/tools.pdb: changed accordingly
2001-01-22 Daniel Egger <egger@suse.de>
* libgimp/gimpcolor.c: #include "gimppalette_pdb.h"
......
......@@ -49,7 +49,7 @@
</contact>
</entry>
<entry size="big" difficulty="medium" status="0%" target="1.4">
<entry size="big" difficulty="medium" status="10%" target="1.4">
<title>Code reorganization</title>
<description>
<p>
......@@ -63,7 +63,7 @@
</contact>
</entry>
<entry size="medium" difficulty="medium" status="20%" target="1.4">
<entry size="medium" difficulty="medium" status="40%" target="1.4">
<title>Unify color data types</title>
<description>
<p>
......
## Process this file with automake to produce Makefile.in
SUBDIRS = pdb
SUBDIRS = pdb tools
scriptdata =
......@@ -15,8 +15,6 @@ bin_PROGRAMS = gimp
gimp_SOURCES = \
about_dialog.c \
about_dialog.h \
airbrush.c \
airbrush.h \
app_procs.c \
app_procs.h \
appenums.h \
......@@ -27,17 +25,8 @@ gimp_SOURCES = \
authors.h \
batch.c \
batch.h \
bezier_select.c \
bezier_select.h \
bezier_selectP.h \
blend.c \
blend.h \
blob.c \
blob.h \
boundary.c \
boundary.h \
brightness_contrast.c \
brightness_contrast.h \
brush_edit.c \
brush_edit.h \
brush_header.h \
......@@ -45,28 +34,18 @@ gimp_SOURCES = \
brush_scale.h \
brush_select.c \
brush_select.h \
bucket_fill.c \
bucket_fill.h \
by_color_select.c \
by_color_select.h \
channel.c \
channel.h \
channels_dialog.c \
channels_dialog.h \
channel_ops.c \
channel_ops.h \
clone.c \
clone.h \
color_area.c \
color_area.h \
color_balance.c \
color_balance.h \
color_notebook.c \
color_notebook.h \
color_panel.c \
color_panel.h \
color_picker.c \
color_picker.h \
color_select.c \
color_select.h \
color_transfer.c \
......@@ -81,14 +60,8 @@ gimp_SOURCES = \
context_manager.h \
convert.c \
convert.h \
convolve.c \
convolve.h \
crop.c \
crop.h \
cursorutil.c \
cursorutil.h \
curves.c \
curves.h \
datafiles.c \
datafiles.h \
desaturate.c \
......@@ -102,8 +75,6 @@ gimp_SOURCES = \
disp_callbacks.h \
docindex.c \
docindex.h \
dodgeburn.c \
dodgeburn.h \
draw_core.c \
draw_core.h \
drawable.c \
......@@ -111,10 +82,6 @@ gimp_SOURCES = \
drawable_pvt.h \
edit_selection.c \
edit_selection.h \
ellipse_select.c \
ellipse_select.h \
eraser.c \
eraser.h \
errorconsole.c \
errorconsole.h \
errors.c \
......@@ -124,17 +91,11 @@ gimp_SOURCES = \
fileops.c \
fileops.h \
fileopsP.h \
flip_tool.c \
flip_tool.h \
floating_sel.c \
floating_sel.h \
file_new_dialog.c \
file_new_dialog.h \
free_select.c \
free_select.h \
fsdither.h \
fuzzy_select.c \
fuzzy_select.h \
gdisplay.c \
gdisplay.h \
gdisplay_ops.c \
......@@ -208,10 +169,6 @@ gimp_SOURCES = \
gximage.h \
histogramwidget.c \
histogramwidget.h \
histogram_tool.c \
histogram_tool.h \
hue_saturation.c \
hue_saturation.h \
image_map.c \
image_map.h \
image_new.c \
......@@ -224,14 +181,10 @@ gimp_SOURCES = \
info_dialog.h \
info_window.c \
info_window.h \
ink.c \
ink.h \
interface.c \
interface.h \
invert.c \
invert.h \
iscissors.c \
iscissors.h \
layer.c \
layer.h \
layer_select.c \
......@@ -242,22 +195,14 @@ gimp_SOURCES = \
lc_dialog.c \
lc_dialog.h \
lc_dialogP.h \
levels.c \
levels.h \
lut_funcs.c \
lut_funcs.h \
magnify.c \
magnify.h \
main.c \
marching_ants.h \
measure.c \
measure.h \
menus.c \
menus.h \
module_db.c \
module_db.h \
move.c \
move.h \
nav_window.c \
nav_window.h \
ops_buttons.c \
......@@ -269,14 +214,8 @@ gimp_SOURCES = \
palette_select.c \
palette_select.h \
paletteP.h \
paint_core.c \
paint_core.h \
paint_core_kernels.h \
paint_funcs.c \
paint_funcs.h \
paint_options.h \
paintbrush.c \
paintbrush.h \
parasitelist.c \
parasitelist.h \
path.c \
......@@ -291,10 +230,6 @@ gimp_SOURCES = \
pattern_select.h \
patterns.c \
patterns.h \
pencil.c \
pencil.h \
perspective_tool.c \
perspective_tool.h \
pixel_processor.c \
pixel_processor.h \
pixel_region.c \
......@@ -303,25 +238,16 @@ gimp_SOURCES = \
pixmaps2.h \
plug_in.c \
plug_in.h \
posterize.c \
posterize.h \
preferences_dialog.c \
preferences_dialog.h \
qmask.c \
qmask.h \
rect_select.c \
rect_select.h \
rect_selectP.h \
resolution_calibrate.c \
resolution_calibrate.h \
resize.c \
resize.h \
rotate_tool.c \
rotate_tool.h \
scale.c \
scale.h \
scale_tool.c \
scale_tool.h \
scan_convert.c \
scan_convert.h \
scroll.c \
......@@ -331,16 +257,8 @@ gimp_SOURCES = \
selection_options.h \
session.h \
session.c \
shear_tool.c \
shear_tool.h \
smudge.c \
smudge.h \
temp_buf.c \
temp_buf.h \
text_tool.c \
text_tool.h \
threshold.c \
threshold.h \
tile.c \
tile.h \
tile_pvt.h \
......@@ -353,14 +271,6 @@ gimp_SOURCES = \
tile_swap.h \
tips_dialog.c \
tips_dialog.h \
tool_options.c \
tool_options.h \
tools.c \
tools.h \
transform_core.c \
transform_core.h \
transform_tool.c \
transform_tool.h \
undo.c \
undo.h \
undo_history.c \
......@@ -400,6 +310,7 @@ INCLUDES = \
gimp_LDADD = \
pdb/libapppdb.la \
tools/libapptools.la \
$(top_builddir)/libgimp/libgimpi.a \
$(GTK_LIBS) \
$(GIMP_THREAD_LIBS) \
......
......@@ -68,13 +68,14 @@
#include "scale.h"
#include "selection.h"
#include "tips_dialog.h"
#include "tools.h"
#include "undo.h"
#ifdef DISPLAY_FILTERS
#include "gdisplay_color_ui.h"
#endif /* DISPLAY_FILTERS */
#include "tools/tools.h"
#include "libgimp/gimphelpui.h"
#include "libgimp/gimpmath.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.
*/
#include "config.h"
#include <gtk/gtk.h>
#include "apptypes.h"
#include "appenv.h"
#include "airbrush.h"
#include "drawable.h"
#include "gdisplay.h"
#include "gradient.h"
#include "gimpimage.h"
#include "gimpbrush.h"
#include "gimpcontext.h"
#include "gimpui.h"
#include "paint_funcs.h"
#include "paint_core.h"
#include "paint_options.h"
#include "selection.h"
#include "temp_buf.h"
#include "tools.h"
#include "libgimp/gimpintl.h"
/* The maximum amount of pressure that can be exerted */
#define MAX_PRESSURE 0.075
/* Default pressure setting */
#define AIRBRUSH_PRESSURE_DEFAULT 10.0
#define AIRBRUSH_INCREMENTAL_DEFAULT FALSE
#define OFF 0
#define ON 1
/* the airbrush structures */
typedef struct _AirbrushTimeout AirbrushTimeout;
struct _AirbrushTimeout
{
PaintCore *paint_core;
GimpDrawable *drawable;
};
typedef struct _AirbrushOptions AirbrushOptions;
struct _AirbrushOptions
{
PaintOptions paint_options;
gdouble rate;
gdouble rate_d;
GtkObject *rate_w;
gdouble pressure;
gdouble pressure_d;
GtkObject *pressure_w;
};
/* local function prototypes */
static gpointer airbrush_paint_func (PaintCore *paint_core,
GimpDrawable *drawable,
PaintState state);
static gpointer airbrush_non_gui_paint_func (PaintCore *paint_core,
GimpDrawable *drawable,
PaintState state);
/* the airbrush tool options */
static AirbrushOptions *airbrush_options = NULL;
/* local variables */
static gint timer; /* timer for successive paint applications */
static gint timer_state = OFF; /* state of airbrush tool */
static AirbrushTimeout airbrush_timeout;
static gdouble non_gui_pressure;
static gboolean non_gui_incremental;
/* forward function declarations */
static void airbrush_motion (PaintCore *, GimpDrawable *,
PaintPressureOptions *,
gdouble, PaintApplicationMode);
static gint airbrush_time_out (gpointer);
/* functions */
static void
airbrush_options_reset (void)
{
AirbrushOptions *options = airbrush_options;
paint_options_reset ((PaintOptions *) options);
gtk_adjustment_set_value (GTK_ADJUSTMENT (options->rate_w),
options->rate_d);
gtk_adjustment_set_value (GTK_ADJUSTMENT (options->pressure_w),
options->pressure_d);
}
static AirbrushOptions *
airbrush_options_new (void)
{
AirbrushOptions *options;
GtkWidget *vbox;
GtkWidget *table;
GtkWidget *scale;
/* the new airbrush tool options structure */
options = g_new (AirbrushOptions, 1);
paint_options_init ((PaintOptions *) options,
AIRBRUSH,
airbrush_options_reset);
options->rate = options->rate_d = 80.0;
options->pressure = options->pressure_d = AIRBRUSH_PRESSURE_DEFAULT;
/* the main vbox */
vbox = ((ToolOptions *) options)->main_vbox;
/* the rate scale */
table = gtk_table_new (2, 2, FALSE);
gtk_table_set_col_spacing (GTK_TABLE (table), 0, 4);
gtk_table_set_row_spacings (GTK_TABLE (table), 1);
gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
options->rate_w =
gtk_adjustment_new (options->rate_d, 0.0, 150.0, 1.0, 1.0, 0.0);
scale = gtk_hscale_new (GTK_ADJUSTMENT (options->rate_w));
gtk_scale_set_value_pos (GTK_SCALE (scale), GTK_POS_TOP);
gtk_range_set_update_policy (GTK_RANGE (scale), GTK_UPDATE_DELAYED);
gtk_signal_connect (GTK_OBJECT (options->rate_w), "value_changed",
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
&options->rate);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
_("Rate:"), 1.0, 1.0,
scale, 1, FALSE);
/* the pressure scale */
options->pressure_w =
gtk_adjustment_new (options->pressure_d, 0.0, 100.0, 1.0, 1.0, 0.0);
scale = gtk_hscale_new (GTK_ADJUSTMENT (options->pressure_w));
gtk_scale_set_value_pos (GTK_SCALE (scale), GTK_POS_TOP);
gtk_range_set_update_policy (GTK_RANGE (scale), GTK_UPDATE_DELAYED);
gtk_signal_connect (GTK_OBJECT (options->pressure_w), "value_changed",
GTK_SIGNAL_FUNC (gimp_double_adjustment_update),
&options->pressure);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
_("Pressure:"), 1.0, 1.0,
scale, 1, FALSE);
gtk_widget_show (table);
return options;
}
Tool *
tools_new_airbrush (void)
{
Tool * tool;
PaintCore * private;
/* The tool options */
if (! airbrush_options)
{
airbrush_options = airbrush_options_new ();
tools_register (AIRBRUSH, (ToolOptions *) airbrush_options);
}
tool = paint_core_new (AIRBRUSH);
private = (PaintCore *) tool->private;
private->paint_func = airbrush_paint_func;
private->pick_colors = TRUE;
private->flags |= TOOL_CAN_HANDLE_CHANGING_BRUSH;
return tool;
}
static gpointer
airbrush_paint_func (PaintCore *paint_core,
GimpDrawable *drawable,
PaintState state)
{
GimpBrush *brush;
gdouble rate;
if (!drawable)
return NULL;
brush = gimp_context_get_brush (NULL);
switch (state)
{
case INIT_PAINT :
/* timer_state = OFF; */
if (timer_state == ON)
{
g_warning ("killing stray timer, please report to lewing@gimp.org");
gtk_timeout_remove (timer);
}
timer_state = OFF;
break;
case MOTION_PAINT :
if (timer_state == ON)
gtk_timeout_remove (timer);
timer_state = OFF;
airbrush_motion (paint_core, drawable,
airbrush_options->paint_options.pressure_options,
airbrush_options->pressure,
airbrush_options->paint_options.incremental ?
INCREMENTAL : CONSTANT);
if (airbrush_options->rate != 0.0)
{
airbrush_timeout.paint_core = paint_core;
airbrush_timeout.drawable = drawable;
rate = airbrush_options->paint_options.pressure_options->rate ?
(10000 / (airbrush_options->rate * 2.0 * paint_core->curpressure)) :
(10000 / airbrush_options->rate);
timer = gtk_timeout_add (rate, airbrush_time_out, NULL);
timer_state = ON;
}
break;
case FINISH_PAINT :
if (timer_state == ON)
gtk_timeout_remove (timer);
timer_state = OFF;
break;
default :
break;
}
return NULL;
}
void
tools_free_airbrush (Tool *tool)
{
if (timer_state == ON)
gtk_timeout_remove (timer);
timer_state = OFF;
paint_core_free (tool);
}
static gint
airbrush_time_out (gpointer client_data)
{
/* service the timer */
airbrush_motion (airbrush_timeout.paint_core,
airbrush_timeout.drawable,
airbrush_options->paint_options.pressure_options,
airbrush_options->pressure,
airbrush_options->paint_options.incremental ?
INCREMENTAL : CONSTANT);
gdisplays_flush ();
/* restart the timer */
if (airbrush_options->rate != 0.0)
{
if (airbrush_options->paint_options.pressure_options->rate)
{
/* set a new timer */
timer = gtk_timeout_add ((10000 / (airbrush_options->rate * 2.0 * airbrush_timeout.paint_core->curpressure)),
airbrush_time_out, NULL);
return FALSE;