Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
GIMP
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2,772
Issues
2,772
List
Boards
Labels
Service Desk
Milestones
Merge Requests
39
Merge Requests
39
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
External Wiki
External Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
GNOME
GIMP
Commits
80a8d5a7
Commit
80a8d5a7
authored
Feb 27, 2001
by
Nate Summers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Introduced GimpPaintTool and GimpDrawTool
parent
2fd2a4e6
Changes
66
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
66 changed files
with
8599 additions
and
1413 deletions
+8599
-1413
ChangeLog
ChangeLog
+53
-0
app/Makefile.am
app/Makefile.am
+0
-2
app/apptypes.h
app/apptypes.h
+2
-2
app/context_manager.c
app/context_manager.c
+0
-1
app/core/gimpbrush-load.c
app/core/gimpbrush-load.c
+9
-9
app/core/gimpbrush.c
app/core/gimpbrush.c
+9
-9
app/core/gimpbrush.h
app/core/gimpbrush.h
+2
-2
app/core/gimpbrushgenerated-load.c
app/core/gimpbrushgenerated-load.c
+1
-1
app/core/gimpbrushgenerated-save.c
app/core/gimpbrushgenerated-save.c
+1
-1
app/core/gimpbrushgenerated.c
app/core/gimpbrushgenerated.c
+1
-1
app/core/gimpbrushpipe-load.c
app/core/gimpbrushpipe-load.c
+16
-16
app/core/gimpbrushpipe.c
app/core/gimpbrushpipe.c
+16
-16
app/core/gimpcontext.c
app/core/gimpcontext.c
+2
-0
app/core/gimpimage-mask.c
app/core/gimpimage-mask.c
+1
-1
app/core/gimpimage-pick-color.c
app/core/gimpimage-pick-color.c
+194
-185
app/core/gimpimage-undo-push.c
app/core/gimpimage-undo-push.c
+2
-2
app/core/gimpprojection.c
app/core/gimpprojection.c
+0
-1
app/core/gimptoolinfo.c
app/core/gimptoolinfo.c
+2
-2
app/dialogs/info-window.c
app/dialogs/info-window.c
+2
-2
app/display/gimpdisplay.c
app/display/gimpdisplay.c
+0
-1
app/gdisplay.c
app/gdisplay.c
+0
-1
app/gimage_mask.c
app/gimage_mask.c
+1
-1
app/gimpbrush.c
app/gimpbrush.c
+9
-9
app/gimpbrush.h
app/gimpbrush.h
+2
-2
app/gimpbrushgenerated.c
app/gimpbrushgenerated.c
+1
-1
app/gimpbrushpipe.c
app/gimpbrushpipe.c
+16
-16
app/gimpcontext.c
app/gimpcontext.c
+2
-0
app/gui/info-window.c
app/gui/info-window.c
+2
-2
app/info_window.c
app/info_window.c
+2
-2
app/paint/gimppaintbrush.c
app/paint/gimppaintbrush.c
+146
-119
app/paint/gimppaintbrush.h
app/paint/gimppaintbrush.h
+59
-0
app/paint/gimppaintcore.c
app/paint/gimppaintcore.c
+502
-432
app/paint/gimppaintcore.h
app/paint/gimppaintcore.h
+69
-48
app/path_transform.h
app/path_transform.h
+1
-1
app/pdb/tools_cmds.c
app/pdb/tools_cmds.c
+4
-4
app/tools/Makefile.am
app/tools/Makefile.am
+11
-9
app/tools/bezier_selectP.h
app/tools/bezier_selectP.h
+2
-2
app/tools/gimpbrushtool.c
app/tools/gimpbrushtool.c
+2225
-0
app/tools/gimpbrushtool.h
app/tools/gimpbrushtool.h
+219
-0
app/tools/gimpcolorpickertool.c
app/tools/gimpcolorpickertool.c
+886
-0
app/tools/gimpcolorpickertool.h
app/tools/gimpcolorpickertool.h
+68
-0
app/tools/gimpdrawtool.c
app/tools/gimpdrawtool.c
+192
-0
app/tools/gimpdrawtool.h
app/tools/gimpdrawtool.h
+77
-0
app/tools/gimpmeasuretool.c
app/tools/gimpmeasuretool.c
+60
-62
app/tools/gimpmeasuretool.h
app/tools/gimpmeasuretool.h
+1
-3
app/tools/gimpmovetool.c
app/tools/gimpmovetool.c
+0
-1
app/tools/gimppaintbrushtool.c
app/tools/gimppaintbrushtool.c
+801
-0
app/tools/gimppaintbrushtool.h
app/tools/gimppaintbrushtool.h
+59
-0
app/tools/gimppaintoptions-gui.c
app/tools/gimppaintoptions-gui.c
+2
-0
app/tools/gimppainttool.c
app/tools/gimppainttool.c
+2225
-0
app/tools/gimppainttool.h
app/tools/gimppainttool.h
+219
-0
app/tools/gimppainttool_kernels.h
app/tools/gimppainttool_kernels.h
+0
-0
app/tools/gimptool.c
app/tools/gimptool.c
+169
-175
app/tools/gimptool.h
app/tools/gimptool.h
+0
-7
app/tools/gimptoolinfo.c
app/tools/gimptoolinfo.c
+2
-2
app/tools/measure.c
app/tools/measure.c
+60
-62
app/tools/measure.h
app/tools/measure.h
+1
-3
app/tools/move.c
app/tools/move.c
+0
-1
app/tools/paint_options.c
app/tools/paint_options.c
+2
-0
app/tools/tool.c
app/tools/tool.c
+169
-175
app/tools/tool.h
app/tools/tool.h
+0
-7
app/tools/tools.c
app/tools/tools.c
+15
-7
app/tools/transform_core.h
app/tools/transform_core.h
+1
-1
app/undo.c
app/undo.c
+2
-2
libgimp/Makefile.am
libgimp/Makefile.am
+1
-1
tools/pdbgen/Makefile.am
tools/pdbgen/Makefile.am
+1
-1
No files found.
ChangeLog
View file @
80a8d5a7
2001-02-26 Nathan Summers <rock@gimp.org>
app/tools/gimpdrawtool.c
* app/tools/gimpdrawtool.h
* app/tools/gimppainttool.c
* app/tools/gimppainttool.h
* app/tools/gimppainttool_kernels.h: Created GimpDrawTool and
GimpPaintTool, real classes that replace the old DrawCore and
PaintCore
* app/Makefile.am
* app/apptypes.h
* app/context_manager.c
* app/gdisplay.c
* app/gimage_mask.c
* app/gimpbrush.c
* app/gimpbrush.h
* app/gimpbrushgenerated.c
* app/gimpbrushpipe.c
* app/gimpcontext.c
* app/info_window.c
* app/path_transform.h
* app/undo.c
* app/pdb/tools_cmds.c
* app/tools/Makefile.am
* app/tools/bezier_selectP.h
* app/tools/gimptoolinfo.c
* app/tools/measure.c
* app/tools/measure.h
* app/tools/move.c
* app/tools/paint_options.c
* app/tools/tool.c
* app/tools/tool.h
* app/tools/tools.c
* app/tools/transform_core.h
* tools/pdbgen/Makefile.am: changed accordingly
* libgimp/Makefile.am: fixed glitch in build
* app/tools/gimpcolorpickertool.c
* app/tools/gimpcolorpickertool.h
* app/tools/gimppaintbrushtool.c
* app/tools/gimppaintbrushtool.h:new names
* app/draw_core.c
* app/draw_core.h
* app/tools/color_picker.c
* app/tools/color_picker.h
* app/tools/paint_core.c
* app/tools/paint_core.h
* app/tools/paint_core_kernels.h
* app/tools/paintbrush.c
* app/tools/paintbrush.h: removed
2001-02-25 Michael Natterer <mitch@gimp.org>
* app/channel_ops.c
...
...
app/Makefile.am
View file @
80a8d5a7
...
...
@@ -72,8 +72,6 @@ gimp_SOURCES = \
disp_callbacks.h
\
docindex.c
\
docindex.h
\
draw_core.c
\
draw_core.h
\
drawable.c
\
drawable.h
\
errorconsole.c
\
...
...
app/apptypes.h
View file @
80a8d5a7
...
...
@@ -111,7 +111,7 @@ typedef struct _BoundSeg BoundSeg;
typedef
struct
_ColorNotebook
ColorNotebook
;
typedef
struct
_
DrawCore
DrawCore
;
typedef
struct
_
GimpDrawTool
GimpDrawTool
;
typedef
struct
_GDisplay
GDisplay
;
...
...
@@ -133,7 +133,7 @@ typedef gpointer ImageMap;
typedef
struct
_InfoDialog
InfoDialog
;
typedef
struct
_
PaintCore
PaintCore
;
typedef
struct
_
GimpPaintTool
GimpPaintTool
;
typedef
struct
_Path
Path
;
typedef
struct
_PathPoint
PathPoint
;
...
...
app/context_manager.c
View file @
80a8d5a7
...
...
@@ -46,7 +46,6 @@
#include "gimppattern.h"
#include "gimprc.h"
/*
* the list of all images
*/
...
...
app/core/gimpbrush-load.c
View file @
80a8d5a7
...
...
@@ -51,7 +51,7 @@
#include "temp_buf.h"
/* this needs to go away */
#include "tools/
paint_core
.h"
#include "tools/
gimppainttool
.h"
#include "brush_scale.h"
#include "libgimp/gimpintl.h"
...
...
@@ -65,8 +65,8 @@ static TempBuf * gimp_brush_get_new_preview (GimpViewable *viewable,
gint
height
);
static
gchar
*
gimp_brush_get_extension
(
GimpData
*
data
);
static
GimpBrush
*
gimp_brush_select_brush
(
PaintCore
*
paint_core
);
static
gboolean
gimp_brush_want_null_motion
(
PaintCore
*
paint_core
);
static
GimpBrush
*
gimp_brush_select_brush
(
GimpPaintTool
*
paint_tool
);
static
gboolean
gimp_brush_want_null_motion
(
GimpPaintTool
*
paint_tool
);
static
GimpViewableClass
*
parent_class
=
NULL
;
...
...
@@ -108,7 +108,7 @@ gimp_brush_class_init (GimpBrushClass *klass)
data_class
=
(
GimpDataClass
*
)
klass
;
parent_class
=
gtk_type_class
(
GIMP_TYPE_DATA
);
object_class
->
destroy
=
gimp_brush_destroy
;
viewable_class
->
get_new_preview
=
gimp_brush_get_new_preview
;
...
...
@@ -180,7 +180,7 @@ gimp_brush_get_new_preview (GimpViewable *viewable,
gdouble
ratio_x
=
(
gdouble
)
brush_width
/
width
;
gdouble
ratio_y
=
(
gdouble
)
brush_height
/
height
;
brush_width
=
(
gdouble
)
brush_width
/
MAX
(
ratio_x
,
ratio_y
)
+
0
.
5
;
brush_width
=
(
gdouble
)
brush_width
/
MAX
(
ratio_x
,
ratio_y
)
+
0
.
5
;
brush_height
=
(
gdouble
)
brush_height
/
MAX
(
ratio_x
,
ratio_y
)
+
0
.
5
;
mask_buf
=
brush_scale_mask
(
mask_buf
,
brush_width
,
brush_height
);
...
...
@@ -218,7 +218,7 @@ gimp_brush_get_new_preview (GimpViewable *viewable,
bg
=
(
255
-
*
mask
);
*
b
++
=
bg
+
(
*
mask
*
*
pixmap
++
)
/
255
;
*
b
++
=
bg
+
(
*
mask
*
*
pixmap
++
)
/
255
;
*
b
++
=
bg
+
(
*
mask
*
*
pixmap
++
)
/
255
;
*
b
++
=
bg
+
(
*
mask
*
*
pixmap
++
)
/
255
;
mask
++
;
...
...
@@ -305,7 +305,7 @@ gimp_brush_load (const gchar *filename)
g_return_val_if_fail
(
filename
!=
NULL
,
NULL
);
fd
=
open
(
filename
,
O_RDONLY
|
_O_BINARY
);
if
(
fd
==
-
1
)
if
(
fd
==
-
1
)
return
NULL
;
brush
=
gimp_brush_load_brush
(
fd
,
filename
);
...
...
@@ -330,13 +330,13 @@ gimp_brush_load (const gchar *filename)
}
static
GimpBrush
*
gimp_brush_select_brush
(
PaintCore
*
paint_core
)
gimp_brush_select_brush
(
GimpPaintTool
*
paint_core
)
{
return
paint_core
->
brush
;
}
static
gboolean
gimp_brush_want_null_motion
(
PaintCore
*
paint_core
)
gimp_brush_want_null_motion
(
GimpPaintTool
*
paint_core
)
{
return
TRUE
;
}
...
...
app/core/gimpbrush.c
View file @
80a8d5a7
...
...
@@ -51,7 +51,7 @@
#include "temp_buf.h"
/* this needs to go away */
#include "tools/
paint_core
.h"
#include "tools/
gimppainttool
.h"
#include "brush_scale.h"
#include "libgimp/gimpintl.h"
...
...
@@ -65,8 +65,8 @@ static TempBuf * gimp_brush_get_new_preview (GimpViewable *viewable,
gint
height
);
static
gchar
*
gimp_brush_get_extension
(
GimpData
*
data
);
static
GimpBrush
*
gimp_brush_select_brush
(
PaintCore
*
paint_core
);
static
gboolean
gimp_brush_want_null_motion
(
PaintCore
*
paint_core
);
static
GimpBrush
*
gimp_brush_select_brush
(
GimpPaintTool
*
paint_tool
);
static
gboolean
gimp_brush_want_null_motion
(
GimpPaintTool
*
paint_tool
);
static
GimpViewableClass
*
parent_class
=
NULL
;
...
...
@@ -108,7 +108,7 @@ gimp_brush_class_init (GimpBrushClass *klass)
data_class
=
(
GimpDataClass
*
)
klass
;
parent_class
=
gtk_type_class
(
GIMP_TYPE_DATA
);
object_class
->
destroy
=
gimp_brush_destroy
;
viewable_class
->
get_new_preview
=
gimp_brush_get_new_preview
;
...
...
@@ -180,7 +180,7 @@ gimp_brush_get_new_preview (GimpViewable *viewable,
gdouble
ratio_x
=
(
gdouble
)
brush_width
/
width
;
gdouble
ratio_y
=
(
gdouble
)
brush_height
/
height
;
brush_width
=
(
gdouble
)
brush_width
/
MAX
(
ratio_x
,
ratio_y
)
+
0
.
5
;
brush_width
=
(
gdouble
)
brush_width
/
MAX
(
ratio_x
,
ratio_y
)
+
0
.
5
;
brush_height
=
(
gdouble
)
brush_height
/
MAX
(
ratio_x
,
ratio_y
)
+
0
.
5
;
mask_buf
=
brush_scale_mask
(
mask_buf
,
brush_width
,
brush_height
);
...
...
@@ -218,7 +218,7 @@ gimp_brush_get_new_preview (GimpViewable *viewable,
bg
=
(
255
-
*
mask
);
*
b
++
=
bg
+
(
*
mask
*
*
pixmap
++
)
/
255
;
*
b
++
=
bg
+
(
*
mask
*
*
pixmap
++
)
/
255
;
*
b
++
=
bg
+
(
*
mask
*
*
pixmap
++
)
/
255
;
*
b
++
=
bg
+
(
*
mask
*
*
pixmap
++
)
/
255
;
mask
++
;
...
...
@@ -305,7 +305,7 @@ gimp_brush_load (const gchar *filename)
g_return_val_if_fail
(
filename
!=
NULL
,
NULL
);
fd
=
open
(
filename
,
O_RDONLY
|
_O_BINARY
);
if
(
fd
==
-
1
)
if
(
fd
==
-
1
)
return
NULL
;
brush
=
gimp_brush_load_brush
(
fd
,
filename
);
...
...
@@ -330,13 +330,13 @@ gimp_brush_load (const gchar *filename)
}
static
GimpBrush
*
gimp_brush_select_brush
(
PaintCore
*
paint_core
)
gimp_brush_select_brush
(
GimpPaintTool
*
paint_core
)
{
return
paint_core
->
brush
;
}
static
gboolean
gimp_brush_want_null_motion
(
PaintCore
*
paint_core
)
gimp_brush_want_null_motion
(
GimpPaintTool
*
paint_core
)
{
return
TRUE
;
}
...
...
app/core/gimpbrush.h
View file @
80a8d5a7
...
...
@@ -53,8 +53,8 @@ struct _GimpBrushClass
GimpDataClass
parent_class
;
/* FIXME: these are no virtual function pointers but bad hacks: */
GimpBrush
*
(
*
select_brush
)
(
PaintCore
*
paint_core
);
gboolean
(
*
want_null_motion
)
(
PaintCore
*
paint_core
);
GimpBrush
*
(
*
select_brush
)
(
GimpPaintTool
*
paint_tool
);
gboolean
(
*
want_null_motion
)
(
GimpPaintTool
*
paint_tool
);
};
...
...
app/core/gimpbrushgenerated-load.c
View file @
80a8d5a7
...
...
@@ -41,7 +41,7 @@
#include "temp_buf.h"
/* this needs to go away */
#include "tools/
paint_core
.h"
#include "tools/
gimppainttool
.h"
#define OVERSAMPLING 5
...
...
app/core/gimpbrushgenerated-save.c
View file @
80a8d5a7
...
...
@@ -41,7 +41,7 @@
#include "temp_buf.h"
/* this needs to go away */
#include "tools/
paint_core
.h"
#include "tools/
gimppainttool
.h"
#define OVERSAMPLING 5
...
...
app/core/gimpbrushgenerated.c
View file @
80a8d5a7
...
...
@@ -41,7 +41,7 @@
#include "temp_buf.h"
/* this needs to go away */
#include "tools/
paint_core
.h"
#include "tools/
gimppainttool
.h"
#define OVERSAMPLING 5
...
...
app/core/gimpbrushpipe-load.c
View file @
80a8d5a7
...
...
@@ -53,15 +53,15 @@
#include "gimprc.h"
/* this needs to go away */
#include "tools/
paint_core
.h"
#include "tools/
gimppainttool
.h"
#include "libgimp/gimpparasiteio.h"
#include "libgimp/gimpintl.h"
static
GimpBrush
*
gimp_brush_pipe_select_brush
(
PaintCore
*
paint_core
);
static
gboolean
gimp_brush_pipe_want_null_motion
(
PaintCore
*
paint_core
);
static
GimpBrush
*
gimp_brush_pipe_select_brush
(
GimpPaintTool
*
paint_tool
);
static
gboolean
gimp_brush_pipe_want_null_motion
(
GimpPaintTool
*
paint_tool
);
static
void
gimp_brush_pipe_destroy
(
GtkObject
*
object
);
...
...
@@ -69,16 +69,16 @@ static GimpBrushClass *parent_class = NULL;
static
GimpBrush
*
gimp_brush_pipe_select_brush
(
PaintCore
*
paint_core
)
gimp_brush_pipe_select_brush
(
GimpPaintTool
*
paint_tool
)
{
GimpBrushPipe
*
pipe
;
gint
i
,
brushix
,
ix
;
gdouble
angle
;
g_return_val_if_fail
(
paint_
core
!=
NULL
,
NULL
);
g_return_val_if_fail
(
GIMP_IS_BRUSH_PIPE
(
paint_
core
->
brush
),
NULL
);
g_return_val_if_fail
(
paint_
tool
!=
NULL
,
NULL
);
g_return_val_if_fail
(
GIMP_IS_BRUSH_PIPE
(
paint_
tool
->
brush
),
NULL
);
pipe
=
GIMP_BRUSH_PIPE
(
paint_
core
->
brush
);
pipe
=
GIMP_BRUSH_PIPE
(
paint_
tool
->
brush
);
if
(
pipe
->
nbrushes
==
1
)
return
GIMP_BRUSH
(
pipe
->
current
);
...
...
@@ -92,8 +92,8 @@ gimp_brush_pipe_select_brush (PaintCore *paint_core)
ix
=
(
pipe
->
index
[
i
]
+
1
)
%
pipe
->
rank
[
i
];
break
;
case
PIPE_SELECT_ANGULAR
:
angle
=
atan2
(
paint_
core
->
cury
-
paint_core
->
lasty
,
paint_
core
->
curx
-
paint_core
->
lastx
);
angle
=
atan2
(
paint_
tool
->
cury
-
paint_tool
->
lasty
,
paint_
tool
->
curx
-
paint_tool
->
lastx
);
/* Offset angle to be compatible with PSP tubes */
angle
+=
G_PI_2
;
/* Map it to the [0..2*G_PI) interval */
...
...
@@ -108,13 +108,13 @@ gimp_brush_pipe_select_brush (PaintCore *paint_core)
ix
=
rand
()
%
pipe
->
rank
[
i
];
break
;
case
PIPE_SELECT_PRESSURE
:
ix
=
RINT
(
paint_
core
->
curpressure
*
(
pipe
->
rank
[
i
]
-
1
));
ix
=
RINT
(
paint_
tool
->
curpressure
*
(
pipe
->
rank
[
i
]
-
1
));
break
;
case
PIPE_SELECT_TILT_X
:
ix
=
RINT
(
paint_
core
->
curxtilt
/
2
.
0
*
pipe
->
rank
[
i
])
+
pipe
->
rank
[
i
]
/
2
;
ix
=
RINT
(
paint_
tool
->
curxtilt
/
2
.
0
*
pipe
->
rank
[
i
])
+
pipe
->
rank
[
i
]
/
2
;
break
;
case
PIPE_SELECT_TILT_Y
:
ix
=
RINT
(
paint_
core
->
curytilt
/
2
.
0
*
pipe
->
rank
[
i
])
+
pipe
->
rank
[
i
]
/
2
;
ix
=
RINT
(
paint_
tool
->
curytilt
/
2
.
0
*
pipe
->
rank
[
i
])
+
pipe
->
rank
[
i
]
/
2
;
break
;
case
PIPE_SELECT_CONSTANT
:
default:
...
...
@@ -134,15 +134,15 @@ gimp_brush_pipe_select_brush (PaintCore *paint_core)
}
static
gboolean
gimp_brush_pipe_want_null_motion
(
PaintCore
*
paint_core
)
gimp_brush_pipe_want_null_motion
(
GimpPaintTool
*
paint_tool
)
{
GimpBrushPipe
*
pipe
;
gint
i
;
g_return_val_if_fail
(
paint_
core
!=
NULL
,
TRUE
);
g_return_val_if_fail
(
GIMP_IS_BRUSH_PIPE
(
paint_
core
->
brush
),
TRUE
);
g_return_val_if_fail
(
paint_
tool
!=
NULL
,
TRUE
);
g_return_val_if_fail
(
GIMP_IS_BRUSH_PIPE
(
paint_
tool
->
brush
),
TRUE
);
pipe
=
GIMP_BRUSH_PIPE
(
paint_
core
->
brush
);
pipe
=
GIMP_BRUSH_PIPE
(
paint_
tool
->
brush
);
if
(
pipe
->
nbrushes
==
1
)
return
TRUE
;
...
...
app/core/gimpbrushpipe.c
View file @
80a8d5a7
...
...
@@ -53,15 +53,15 @@
#include "gimprc.h"
/* this needs to go away */
#include "tools/
paint_core
.h"
#include "tools/
gimppainttool
.h"
#include "libgimp/gimpparasiteio.h"
#include "libgimp/gimpintl.h"
static
GimpBrush
*
gimp_brush_pipe_select_brush
(
PaintCore
*
paint_core
);
static
gboolean
gimp_brush_pipe_want_null_motion
(
PaintCore
*
paint_core
);
static
GimpBrush
*
gimp_brush_pipe_select_brush
(
GimpPaintTool
*
paint_tool
);
static
gboolean
gimp_brush_pipe_want_null_motion
(
GimpPaintTool
*
paint_tool
);
static
void
gimp_brush_pipe_destroy
(
GtkObject
*
object
);
...
...
@@ -69,16 +69,16 @@ static GimpBrushClass *parent_class = NULL;
static
GimpBrush
*
gimp_brush_pipe_select_brush
(
PaintCore
*
paint_core
)
gimp_brush_pipe_select_brush
(
GimpPaintTool
*
paint_tool
)
{
GimpBrushPipe
*
pipe
;
gint
i
,
brushix
,
ix
;
gdouble
angle
;
g_return_val_if_fail
(
paint_
core
!=
NULL
,
NULL
);
g_return_val_if_fail
(
GIMP_IS_BRUSH_PIPE
(
paint_
core
->
brush
),
NULL
);
g_return_val_if_fail
(
paint_
tool
!=
NULL
,
NULL
);
g_return_val_if_fail
(
GIMP_IS_BRUSH_PIPE
(
paint_
tool
->
brush
),
NULL
);
pipe
=
GIMP_BRUSH_PIPE
(
paint_
core
->
brush
);
pipe
=
GIMP_BRUSH_PIPE
(
paint_
tool
->
brush
);
if
(
pipe
->
nbrushes
==
1
)
return
GIMP_BRUSH
(
pipe
->
current
);
...
...
@@ -92,8 +92,8 @@ gimp_brush_pipe_select_brush (PaintCore *paint_core)
ix
=
(
pipe
->
index
[
i
]
+
1
)
%
pipe
->
rank
[
i
];
break
;
case
PIPE_SELECT_ANGULAR
:
angle
=
atan2
(
paint_
core
->
cury
-
paint_core
->
lasty
,
paint_
core
->
curx
-
paint_core
->
lastx
);
angle
=
atan2
(
paint_
tool
->
cury
-
paint_tool
->
lasty
,
paint_
tool
->
curx
-
paint_tool
->
lastx
);
/* Offset angle to be compatible with PSP tubes */
angle
+=
G_PI_2
;
/* Map it to the [0..2*G_PI) interval */
...
...
@@ -108,13 +108,13 @@ gimp_brush_pipe_select_brush (PaintCore *paint_core)
ix
=
rand
()
%
pipe
->
rank
[
i
];
break
;
case
PIPE_SELECT_PRESSURE
:
ix
=
RINT
(
paint_
core
->
curpressure
*
(
pipe
->
rank
[
i
]
-
1
));
ix
=
RINT
(
paint_
tool
->
curpressure
*
(
pipe
->
rank
[
i
]
-
1
));
break
;
case
PIPE_SELECT_TILT_X
:
ix
=
RINT
(
paint_
core
->
curxtilt
/
2
.
0
*
pipe
->
rank
[
i
])
+
pipe
->
rank
[
i
]
/
2
;
ix
=
RINT
(
paint_
tool
->
curxtilt
/
2
.
0
*
pipe
->
rank
[
i
])
+
pipe
->
rank
[
i
]
/
2
;
break
;
case
PIPE_SELECT_TILT_Y
:
ix
=
RINT
(
paint_
core
->
curytilt
/
2
.
0
*
pipe
->
rank
[
i
])
+
pipe
->
rank
[
i
]
/
2
;
ix
=
RINT
(
paint_
tool
->
curytilt
/
2
.
0
*
pipe
->
rank
[
i
])
+
pipe
->
rank
[
i
]
/
2
;
break
;
case
PIPE_SELECT_CONSTANT
:
default:
...
...
@@ -134,15 +134,15 @@ gimp_brush_pipe_select_brush (PaintCore *paint_core)
}
static
gboolean
gimp_brush_pipe_want_null_motion
(
PaintCore
*
paint_core
)
gimp_brush_pipe_want_null_motion
(
GimpPaintTool
*
paint_tool
)
{
GimpBrushPipe
*
pipe
;
gint
i
;
g_return_val_if_fail
(
paint_
core
!=
NULL
,
TRUE
);
g_return_val_if_fail
(
GIMP_IS_BRUSH_PIPE
(
paint_
core
->
brush
),
TRUE
);
g_return_val_if_fail
(
paint_
tool
!=
NULL
,
TRUE
);
g_return_val_if_fail
(
GIMP_IS_BRUSH_PIPE
(
paint_
tool
->
brush
),
TRUE
);
pipe
=
GIMP_BRUSH_PIPE
(
paint_
core
->
brush
);
pipe
=
GIMP_BRUSH_PIPE
(
paint_
tool
->
brush
);
if
(
pipe
->
nbrushes
==
1
)
return
TRUE
;
...
...
app/core/gimpcontext.c
View file @
80a8d5a7
...
...
@@ -1394,6 +1394,8 @@ gimp_context_real_set_tool (GimpContext *context,
GTK_SIGNAL_FUNC
(
gimp_context_tool_dirty
),
context
);
/* FIXME if (tool_info != standard_tool_info) */
if
(
tool_info
!=
standard_tool_info
)
context
->
tool_name
=
g_strdup
(
GIMP_OBJECT
(
tool_info
)
->
name
);
}
...
...
app/core/gimpimage-mask.c
View file @
80a8d5a7
...
...
@@ -22,7 +22,7 @@
#include "apptypes.h"
#include "tools/
paint_core
.h"
#include "tools/
gimppainttool
.h"
#include "tools/paint_options.h"
#include "tools/tool.h"
#include "tools/tool_manager.h"
...
...
app/
tools/color_picke
r.c
→
app/
core/gimpimage-pick-colo
r.c
View file @
80a8d5a7
This diff is collapsed.
Click to expand it.
app/core/gimpimage-undo-push.c
View file @
80a8d5a7
...
...
@@ -25,7 +25,6 @@
#include "apptypes.h"
#include "draw_core.h"
#include "drawable.h"
#include "floating_sel.h"
#include "gdisplay.h"
...
...
@@ -47,7 +46,8 @@
#include "undo.h"
#include "tools/by_color_select.h"
#include "tools/paint_core.h"
#include "tools/gimpdrawtool.h"
#include "tools/gimppainttool.h"
#include "tools/tool.h"
#include "tools/transform_core.h"
...
...
app/core/gimpprojection.c
View file @
80a8d5a7
...
...
@@ -31,7 +31,6 @@
#include "colormaps.h"
#include "cursorutil.h"
#include "disp_callbacks.h"
#include "draw_core.h"
#include "gdisplay.h"
#include "gdisplay_ops.h"
#include "gimage.h"
...
...
app/core/gimptoolinfo.c
View file @
80a8d5a7
...
...
@@ -26,7 +26,7 @@
#include "temp_buf.h"
/* FIXME: include rect_select.h here */
#include "
color_picker
.h"
#include "
gimpcolorpickertool
.h"
static
void
gimp_tool_info_class_init
(
GimpToolInfoClass
*
klass
);
...
...
@@ -236,7 +236,7 @@ gimp_tool_info_get_standard (void)
if
(
!
standard_tool_info
)
{
standard_tool_info
=
gimp_tool_info_new
(
GIMP_TYPE_COLOR_PICKER
,
gimp_tool_info_new
(
GIMP_TYPE_COLOR_PICKER
_TOOL
,
"gimp:standard_tool"
,
"Standard Tool"
,
"Well something must be broken"
,
...
...
app/dialogs/info-window.c
View file @
80a8d5a7
...
...
@@ -24,7 +24,7 @@
#include "apptypes.h"
#include "tools/
color_picker
.h"
#include "tools/
gimpcolorpickertool
.h"
#include "tools/tool.h"
#include "tools/tool_manager.h"
...
...
@@ -161,7 +161,7 @@ info_window_create_extended (InfoDialog *info_win)
gtk_container_add
(
GTK_CONTAINER
(
frame
),
table
);
gtk_widget_show
(
table
);
preview
=
gimp_preview_new
(
GIMP_VIEWABLE
(
tool_manager_get_info_by_type
(
GIMP_TYPE_COLOR_PICKER
)),
22
,
0
,
FALSE
);
preview
=
gimp_preview_new
(
GIMP_VIEWABLE
(
tool_manager_get_info_by_type
(
GIMP_TYPE_COLOR_PICKER
_TOOL
)),
22
,
0
,
FALSE
);
gtk_table_attach
(
GTK_TABLE
(
table
),
preview
,
0
,
2
,
0
,
1
,
GTK_EXPAND
|
GTK_FILL
,
GTK_EXPAND
|
GTK_FILL
,
2
,
2
);
gtk_widget_show
(
preview
);
...
...
app/display/gimpdisplay.c
View file @
80a8d5a7
...
...
@@ -31,7 +31,6 @@
#include "colormaps.h"
#include "cursorutil.h"
#include "disp_callbacks.h"
#include "draw_core.h"
#include "gdisplay.h"
#include "gdisplay_ops.h"
#include "gimage.h"
...
...
app/gdisplay.c
View file @
80a8d5a7
...
...
@@ -31,7 +31,6 @@
#include "colormaps.h"
#include "cursorutil.h"
#include "disp_callbacks.h"
#include "draw_core.h"
#include "gdisplay.h"
#include "gdisplay_ops.h"
#include "gimage.h"
...
...
app/gimage_mask.c
View file @
80a8d5a7
...
...
@@ -22,7 +22,7 @@
#include "apptypes.h"
#include "tools/
paint_core
.h"
#include "tools/
gimppainttool
.h"
#include "tools/paint_options.h"
#include "tools/tool.h"
#include "tools/tool_manager.h"
...
...
app/gimpbrush.c
View file @
80a8d5a7
...
...
@@ -51,7 +51,7 @@
#include "temp_buf.h"
/* this needs to go away */
#include "tools/
paint_core
.h"
#include "tools/
gimppainttool
.h"
#include "brush_scale.h"
#include "libgimp/gimpintl.h"
...
...
@@ -65,8 +65,8 @@ static TempBuf * gimp_brush_get_new_preview (GimpViewable *viewable,
gint
height
);
static
gchar
*
gimp_brush_get_extension
(
GimpData
*
data
);
static
GimpBrush
*
gimp_brush_select_brush
(
PaintCore
*
paint_core
);
static
gboolean
gimp_brush_want_null_motion
(
PaintCore
*
paint_core
);
static
GimpBrush
*
gimp_brush_select_brush
(
GimpPaintTool
*
paint_tool
);
static
gboolean
gimp_brush_want_null_motion
(
GimpPaintTool
*
paint_tool
);
static
GimpViewableClass
*
parent_class
=
NULL
;
...
...
@@ -108,7 +108,7 @@ gimp_brush_class_init (GimpBrushClass *klass)
data_class
=
(
GimpDataClass
*
)
klass
;
parent_class
=
gtk_type_class
(
GIMP_TYPE_DATA
);
object_class
->
destroy
=
gimp_brush_destroy
;
viewable_class
->
get_new_preview
=
gimp_brush_get_new_preview
;
...
...
@@ -180,7 +180,7 @@ gimp_brush_get_new_preview (GimpViewable *viewable,
gdouble
ratio_x
=
(
gdouble
)
brush_width
/
width
;
gdouble
ratio_y
=
(
gdouble
)
brush_height
/
height
;
brush_width
=
(
gdouble
)
brush_width
/
MAX
(
ratio_x
,
ratio_y
)
+
0
.
5
;
brush_width
=
(
gdouble
)
brush_width
/
MAX
(
ratio_x
,
ratio_y
)
+
0
.
5
;
brush_height
=
(
gdouble
)
brush_height
/
MAX
(
ratio_x
,
ratio_y
)
+
0
.
5
;
mask_buf
=
brush_scale_mask
(
mask_buf
,
brush_width
,
brush_height
);
...
...
@@ -218,7 +218,7 @@ gimp_brush_get_new_preview (GimpViewable *viewable,
bg
=
(
255
-
*
mask
);
*
b
++
=
bg
+
(
*
mask
*
*
pixmap
++
)
/
255
;
*
b
++
=
bg
+
(
*
mask
*
*
pixmap
++
)
/
255
;
*
b
++
=
bg
+
(
*
mask
*
*
pixmap
++
)
/
255
;
*
b
++
=
bg
+
(
*
mask
*
*
pixmap
++
)
/
255
;
mask
++
;
...
...
@@ -305,7 +305,7 @@ gimp_brush_load (const gchar *filename)
g_return_val_if_fail
(
filename
!=
NULL
,
NULL
);