Commit ae743e3f authored by Sven Neumann's avatar Sven Neumann

Cleanups...

Shame on the one who decided it would be good idea to load pixmap brushes
as pipes, it destroys the whole purpose of the GIMP_IS_BRUSH_PIPE macro!!


--Sven & Jtl
parent eba56bd1
Sun Sep 26 05:33:56 MEST 1999 Jens Lautenbacher <jens@tellux.de>
Sven Neumann <sven@gimp.org>
* app/gimpbrushpipe.h: introduced a macro to test for a
gimp_brush_pipe that actually returns FALSE when it hits only a
gimp_brush_pixmap that is no pipe
* app/gimpcontextpreview.c: use the new macro
* app/paintbrush.c: make the compiler happy
Sun Sep 26 04:18:48 MEST 1999 Jens Lautenbacher <jens@tellux.de>
Sven Neumann <sven@gimp.org>
......
......@@ -44,4 +44,9 @@ GimpBrushPipe *gimp_brush_pixmap_load (char *filename);
TempBuf *gimp_brush_pixmap_pixmap (GimpBrushPixmap *);
/* appearantly GIMP_IS_BRUSH_PIPE () returning TRUE is no indication that you really
have a brush_pipe in front of you, so here we introduce a macro that works: */
#define GIMP_IS_REALLY_A_BRUSH_PIPE(obj) (GIMP_IS_BRUSH_PIPE (obj) && GIMP_BRUSH_PIPE (obj)->nbrushes > 1)
#endif /* __GIMPBRUSHPIPE_H__ */
......@@ -44,4 +44,9 @@ GimpBrushPipe *gimp_brush_pixmap_load (char *filename);
TempBuf *gimp_brush_pixmap_pixmap (GimpBrushPixmap *);
/* appearantly GIMP_IS_BRUSH_PIPE () returning TRUE is no indication that you really
have a brush_pipe in front of you, so here we introduce a macro that works: */
#define GIMP_IS_REALLY_A_BRUSH_PIPE(obj) (GIMP_IS_BRUSH_PIPE (obj) && GIMP_BRUSH_PIPE (obj)->nbrushes > 1)
#endif /* __GIMPBRUSHPIPE_H__ */
......@@ -384,7 +384,7 @@ gimp_context_preview_popup_open (GimpContextPreview *gcp,
gcp->popup_width = brush->mask->width;
gcp->popup_height = brush->mask->height;
if (GIMP_IS_BRUSH_PIPE (brush) && GIMP_BRUSH_PIPE (brush)->nbrushes > 1)
if (GIMP_IS_REALLY_A_BRUSH_PIPE (brush))
{
GimpBrushPipe *pipe = GIMP_BRUSH_PIPE (brush);
gint i;
......@@ -463,7 +463,7 @@ gimp_context_preview_popup_open (GimpContextPreview *gcp,
{
case GCP_BRUSH:
gimp_context_preview_draw_brush_popup (gcp);
if (GIMP_IS_BRUSH_PIPE (gcp->data) && (GIMP_BRUSH_PIPE (gcp->data)->nbrushes > 1))
if (GIMP_IS_REALLY_A_BRUSH_PIPE (gcp->data))
{
gcp_pipe_index = 0;
gcp_pipe_timer = gtk_timeout_add (300, (GtkFunction)gimp_context_preview_animate_pipe, gcp);
......@@ -652,7 +652,7 @@ static void draw_brush (GtkPreview *preview,
offset_x = width - indicator_width - 1;
offset_y = height - indicator_height - 1;
for (y = 0; y < indicator_height; y++)
(GIMP_IS_BRUSH_PIPE (brush) && GIMP_BRUSH_PIPE (brush)->nbrushes > 1) ?
(GIMP_IS_REALLY_A_BRUSH_PIPE (brush)) ?
gtk_preview_draw_row (preview, scale_pipe_indicator_bits[y][0],
offset_x, offset_y + y, indicator_width) :
gtk_preview_draw_row (preview, scale_indicator_bits[y][0],
......@@ -661,7 +661,7 @@ static void draw_brush (GtkPreview *preview,
if (GIMP_IS_BRUSH_PIXMAP (brush))
temp_buf_free (pixmap_buf);
}
else if (!is_popup && GIMP_IS_BRUSH_PIPE (brush) && GIMP_BRUSH_PIPE (brush)->nbrushes > 1)
else if (!is_popup && GIMP_IS_REALLY_A_BRUSH_PIPE (brush))
{
offset_x = width - indicator_width - 1;
offset_y = height - indicator_height - 1;
......@@ -717,7 +717,7 @@ gimp_context_preview_animate_pipe (GimpContextPreview *gcp)
GimpBrushPipe *pipe;
GimpBrush *brush;
g_return_val_if_fail (gcp != NULL && GIMP_IS_BRUSH_PIPE (gcp->data), FALSE);
g_return_val_if_fail (gcp != NULL && GIMP_IS_REALLY_A_BRUSH_PIPE (gcp->data), FALSE);
if (gcp_popup != NULL && !GTK_WIDGET_VISIBLE (gcp_popup))
return (FALSE);
......
......@@ -366,7 +366,7 @@ paintbrush_paint_func (PaintCore *paint_core,
double gradient_length;
double unit_factor;
g_return_if_fail (gdisp != NULL);
g_return_val_if_fail (gdisp != NULL, NULL);
#if TIMED_BRUSH
static GTimer *timer = NULL;
......
......@@ -366,7 +366,7 @@ paintbrush_paint_func (PaintCore *paint_core,
double gradient_length;
double unit_factor;
g_return_if_fail (gdisp != NULL);
g_return_val_if_fail (gdisp != NULL, NULL);
#if TIMED_BRUSH
static GTimer *timer = NULL;
......
Markdown is supported
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