Commit b7d8e6ea authored by jaycox's avatar jaycox
Browse files

Modified Files: ChangeLog app/Makefile.am app/airbrush.c app/app_procs.c


 Modified Files:
 	ChangeLog app/Makefile.am app/airbrush.c app/app_procs.c
 	app/brush_select.c app/brush_select.h app/clone.c
 	app/colormaps.c app/commands.c app/convolve.c app/devices.c
 	app/eraser.c app/gimage_mask.c app/gimpobject.h app/ink.c
 	app/internal_procs.c app/paint_core.c app/paint_core.h
 	app/paintbrush.c app/pencil.c app/preferences_dialog.c
      Minor modifications to support new brush functionality

 Added Files:
 	app/brush_edit.c app/brush_edit.h app/gimpbrush.c
 	app/gimpbrush.h app/gimpbrushgenerated.c
 	app/gimpbrushgenerated.h app/gimpbrushlist.c
 	app/gimpbrushlist.h
      new files to support vector generated brushes and
      reorganization/objectification of the brush class

 Removed Files:
 	app/brushes.c app/brushes.h
    Obsoleted by gimpbrush.? and gimpbrushlist.?

 ----------------------------------------------------------------------
parent 354d7264
Wed Jul 8 21:34:31 PDT 1998 Jay Cox <jaycox@earthlink.net>
* app/brushes.c app/brushes.h: removed files
* app/gimpbrush.c app/gimpbrush.h
* app/gimpbrushlist.c app/gimpbrushlist.h
the New files replace the functionality of brushes.[ch]
and objectify the brushes. The basic structure is in
but signals are not used as much as they should be.
* app/gimpbrushgenerated.c app/gimpbrushgenerated.h
New type of brush that is can be modified on the fly
* brush_edit.c brush_edit.h
new files that implement a gui for the GimpBrushGenerated class.
very basic.
* brush_select.c devices.c ink.c gimpobject.h paint_core.c
brush_select.h brush_edit.h preferences_dialog.c pencil.c
paintbrush.c internal_procs.c gimage_mask.c eraser.c convolve.c
commands.c colormaps.c airbrush.c clone.c app_procs.c
paint_core.h
Minor changes to support above new functionality.
Wed Jul 8 22:36:12 CDT 1998 Larry Ewing <lewing@gimp.org>
* app/color_area.c (color_area_edit): raise the color select when
......@@ -66,6 +90,7 @@ Wed Jul 8 01:35:22 EEST 1998 Lauri Alanko <nether@gimp.org>
* app/app_procs.c (app_exit_finish): Unregister pdb procs _before_
destroying pdb.
>>>>>>> 1.475
Mon Jul 6 20:38:36 1998 Scott Goehring <scott@poverty.bloomington.in.us>
* app/gimage_mask.c (gimage_mask_boundary): fixed crash when you
......
......@@ -32,11 +32,11 @@ gimp_SOURCES = \
boundary.h \
brightness_contrast.c \
brightness_contrast.h \
brush_edit.c \
brush_edit.h \
brush_header.h \
brush_select.c \
brush_select.h \
brushes.c \
brushes.h \
bucket_fill.c \
bucket_fill.h \
buildmenu.c \
......@@ -142,6 +142,12 @@ gimp_SOURCES = \
gimage_mask.h \
gimage_mask_cmds.c \
gimage_mask_cmds.h \
gimpbrush.c \
gimpbrush.h \
gimpbrushgenerated.c \
gimpbrushgenerated.h \
gimpbrushlist.c \
gimpbrushlist.h \
gimprc.c \
gimprc.h \
global_edit.c \
......
......@@ -23,7 +23,7 @@
#include "actionarea.h"
#include "app_procs.h"
#include "brightness_contrast.h"
#include "brushes.h"
#include "gimpbrushlist.h"
#include "by_color_select.h"
#include "channels_dialog.h"
#include "colormaps.h"
......
......@@ -17,7 +17,7 @@
*/
#include <stdlib.h>
#include "appenv.h"
#include "brushes.h"
#include "gimpbrushlist.h"
#include "drawable.h"
#include "errors.h"
#include "gdisplay.h"
......@@ -143,7 +143,7 @@ airbrush_paint_func (PaintCore *paint_core,
GimpDrawable *drawable,
int state)
{
GBrushP brush;
GimpBrushP brush;
if (!drawable)
return NULL;
......@@ -267,8 +267,8 @@ airbrush_motion (PaintCore *paint_core,
/* paste the newly painted area to the image */
paint_core_paste_canvas (paint_core, drawable,
opacity,
(int) (get_brush_opacity () * 255),
get_brush_paint_mode (),
(int) (gimp_brush_get_opacity () * 255),
gimp_brush_get_paint_mode (),
SOFT, CONSTANT);
}
......
......@@ -27,7 +27,7 @@
#include "appenv.h"
#include "app_procs.h"
#include "batch.h"
#include "brushes.h"
#include "gimpbrushlist.h"
#include "color_transfer.h"
#include "curves.h"
#include "devices.h"
......
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* brush_edit module Copyright 1998 Jay Cox <jaycox@earthlink.net>
*
* 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 "appenv.h"
#include "gimpbrushgenerated.h"
#include "brush_edit.h"
static void
update_brush_callback (GtkAdjustment *adjustment,
BrushEditGeneratedWindow *begw)
{
if (begw->brush &&
((begw->radius_data->value
!= gimp_brush_generated_get_radius(begw->brush))
|| (begw->hardness_data->value
!= gimp_brush_generated_get_hardness(begw->brush))
|| (begw->aspect_ratio_data->value
!= gimp_brush_generated_get_aspect_ratio(begw->brush))
|| (begw->angle_data->value
!=gimp_brush_generated_get_angle(begw->brush))))
{
gimp_brush_generated_set_radius (begw->brush,
begw->radius_data->value);
gimp_brush_generated_set_hardness (begw->brush,
begw->hardness_data->value);
gimp_brush_generated_set_aspect_ratio (begw->brush,
begw->aspect_ratio_data->value);
gimp_brush_generated_set_angle (begw->brush,
begw->angle_data->value);
gimp_brush_generated_generate(begw->brush);
}
}
static int
brush_edit_delete_callback (GtkWidget *w,
BrushEditGeneratedWindow *begw)
{
if (GTK_WIDGET_VISIBLE (w))
gtk_widget_hide (w);
return TRUE;
}
void
brush_edit_generated_set_brush(BrushEditGeneratedWindow *begw,
GimpBrush *gbrush)
{
GimpBrushGenerated *brush = 0;
if (!GIMP_IS_BRUSH_GENERATED(gbrush))
return;
brush = GIMP_BRUSH_GENERATED(gbrush);
if (begw)
{
begw->brush = NULL;
gtk_adjustment_set_value(GTK_ADJUSTMENT(begw->radius_data),
gimp_brush_generated_get_radius (brush));
gtk_adjustment_set_value(GTK_ADJUSTMENT(begw->hardness_data),
gimp_brush_generated_get_hardness (brush));
gtk_adjustment_set_value(GTK_ADJUSTMENT(begw->angle_data),
gimp_brush_generated_get_angle (brush));
gtk_adjustment_set_value(GTK_ADJUSTMENT(begw->aspect_ratio_data),
gimp_brush_generated_get_aspect_ratio(brush));
begw->brush = brush;
}
}
BrushEditGeneratedWindow *
brush_edit_generated_new ()
{
BrushEditGeneratedWindow *begw ;
GtkWidget *vbox;
GtkWidget *sbar;
GtkWidget *label;
GtkWidget *slider;
GtkWidget *table;
GtkWidget *button1, *button2;
begw = g_malloc (sizeof (BrushEditGeneratedWindow));
begw->redraw = TRUE;
begw->shell = gtk_dialog_new ();
gtk_window_set_wmclass (GTK_WINDOW (begw->shell), "generatedbrusheditor",
"Gimp");
gtk_window_set_title (GTK_WINDOW (begw->shell), "Brush Editor");
gtk_window_set_policy(GTK_WINDOW(begw->shell), FALSE, TRUE, FALSE);
vbox = gtk_vbox_new (FALSE, 1);
gtk_container_border_width (GTK_CONTAINER (vbox), 2);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (begw->shell)->vbox), vbox,
TRUE, TRUE, 0);
/* handle the wm close signal */
gtk_signal_connect (GTK_OBJECT (begw->shell), "delete_event",
GTK_SIGNAL_FUNC (brush_edit_delete_callback),
begw);
/* Populate the window with some widgets */
/* brush's preview widget w/frame */
begw->frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (begw->frame), GTK_SHADOW_IN);
gtk_box_pack_start (GTK_BOX (vbox), begw->frame, TRUE, TRUE, 0);
begw->preview = gtk_preview_new (GTK_PREVIEW_GRAYSCALE);
gtk_preview_size (GTK_PREVIEW (begw->preview), 100, 100);
gtk_container_add (GTK_CONTAINER (begw->frame), begw->preview);
gtk_widget_show(begw->preview);
gtk_widget_show(begw->frame);
/* table for sliders/labels */
table = gtk_table_new(2, 4, FALSE);
gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
/* brush radius scale */
label = gtk_label_new ("Radius:");
gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_RIGHT);
gtk_table_attach(GTK_TABLE (table), label, 0, 1, 0, 1, 0, 0, 0, 0);
begw->radius_data = GTK_ADJUSTMENT (gtk_adjustment_new (10.0, 0.0, 100.0, 0.1, 1.0, 0.0));
slider = gtk_hscale_new (begw->radius_data);
gtk_table_attach_defaults(GTK_TABLE (table), slider, 1, 2, 0, 1);
gtk_scale_set_value_pos (GTK_SCALE (slider), GTK_POS_TOP);
gtk_range_set_update_policy (GTK_RANGE (slider), GTK_UPDATE_DELAYED);
gtk_signal_connect (GTK_OBJECT (begw->radius_data), "value_changed",
(GtkSignalFunc) update_brush_callback, begw);
gtk_widget_show (label);
gtk_widget_show (slider);
/* brush hardness scale */
label = gtk_label_new ("Hardness:");
gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_RIGHT);
gtk_table_attach(GTK_TABLE (table), label, 0, 1, 1, 2, 0, 0, 0, 0);
begw->hardness_data = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 1.0, 0.01, 0.01, 0.0));
slider = gtk_hscale_new (begw->hardness_data);
gtk_table_attach_defaults(GTK_TABLE (table), slider, 1, 2, 1, 2);
gtk_scale_set_value_pos (GTK_SCALE (slider), GTK_POS_TOP);
gtk_range_set_update_policy (GTK_RANGE (slider), GTK_UPDATE_DELAYED);
gtk_signal_connect (GTK_OBJECT (begw->hardness_data), "value_changed",
(GtkSignalFunc) update_brush_callback, begw);
gtk_widget_show (label);
gtk_widget_show (slider);
/* brush aspect ratio scale */
label = gtk_label_new ("Aspect Ratio:");
gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT);
gtk_table_attach(GTK_TABLE (table), label, 0, 1, 2, 3, 0, 0, 0, 0);
begw->aspect_ratio_data = GTK_ADJUSTMENT (gtk_adjustment_new (1.0, 1.0, 20.0, 0.1, 1.0, 0.0));
slider = gtk_hscale_new (begw->aspect_ratio_data);
gtk_table_attach_defaults(GTK_TABLE (table), slider, 1, 2, 2, 3);
gtk_scale_set_value_pos (GTK_SCALE (slider), GTK_POS_TOP);
gtk_range_set_update_policy (GTK_RANGE (slider), GTK_UPDATE_DELAYED);
gtk_signal_connect (GTK_OBJECT (begw->aspect_ratio_data), "value_changed",
(GtkSignalFunc) update_brush_callback, begw);
gtk_widget_show (label);
gtk_widget_show (slider);
/* brush angle scale */
label = gtk_label_new ("Angle:");
gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT);
gtk_table_attach(GTK_TABLE (table), label, 0, 1, 3, 4, 0, 0, 0, 0);
begw->angle_data = GTK_ADJUSTMENT (gtk_adjustment_new (00.0, 0.0, 180.0, 0.1, 1.0, 0.0));
slider = gtk_hscale_new (begw->angle_data);
gtk_table_attach_defaults(GTK_TABLE (table), slider, 1, 2, 3, 4);
gtk_scale_set_value_pos (GTK_SCALE (slider), GTK_POS_TOP);
gtk_range_set_update_policy (GTK_RANGE (slider), GTK_UPDATE_DELAYED);
gtk_signal_connect (GTK_OBJECT (begw->angle_data), "value_changed",
(GtkSignalFunc) update_brush_callback, begw);
gtk_widget_show (label);
gtk_widget_show (slider);
gtk_table_set_row_spacings(GTK_TABLE (table), 3);
gtk_table_set_col_spacing(GTK_TABLE (table), 0, 3);
gtk_widget_show (table);
gtk_widget_show (vbox);
gtk_widget_show (begw->shell);
return begw;
}
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* brush_edit module Copyright 1998 Jay Cox <jaycox@earthlink.net>
*
* 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 __BRUSH_EDIT_H__
#define __BRUSH_EDIT_H__
#include "gimpbrushgenerated.h"
typedef struct _BrushEditGeneratedWindow
{
GtkWidget *shell;
GtkWidget *frame;
GtkWidget *preview;
GtkWidget *options_box;
GtkAdjustment *radius_data;
GtkAdjustment *hardness_data;
GtkAdjustment *angle_data;
GtkAdjustment *aspect_ratio_data;
int width, height;
int cell_width, cell_height;
int redraw;
/* Brush preview */
GtkWidget *brush_preview;
GimpBrushGenerated *brush;
} BrushEditGeneratedWindow;
void brush_edit_generated_set_brush(BrushEditGeneratedWindow *begw,
GimpBrush *brush);
BrushEditGeneratedWindow *brush_edit_generated_new ();
#endif /* __BRUSH_EDIT_H__ */
......@@ -20,7 +20,12 @@
#include <string.h>
#include "appenv.h"
#include "actionarea.h"
#include "brushes.h"
#include "gimpbrushlist.h"
#include "gimpset.h"
#include "gimpsetP.h" /* FIXME: get rid of this include */
#include "gimpbrushgenerated.h"
#include "brush_edit.h"
#include "brush_select.h"
#include "brush_select.h"
#include "buildmenu.h"
#include "colormaps.h"
......@@ -48,14 +53,18 @@
GDK_ENTER_NOTIFY_MASK
/* local function prototypes */
static void brush_popup_open (BrushSelectP, int, int, GBrushP);
static void brush_popup_open (BrushSelectP, int, int, GimpBrushP);
static void brush_popup_close (BrushSelectP);
static void display_brush (BrushSelectP, GBrushP, int, int);
static void display_brush (BrushSelectP, GimpBrushP, int, int);
static void display_brushes (BrushSelectP);
static void display_setup (BrushSelectP);
static void preview_calc_scrollbar (BrushSelectP);
static void brush_select_show_selected (BrushSelectP, int, int);
static void update_active_brush_field (BrushSelectP);
static gint edit_brush_callback (GtkWidget *w, GdkEvent *e,
gpointer data);
static gint new_brush_callback (GtkWidget *w, GdkEvent *e,
gpointer data);
static void brush_select_close_callback (GtkWidget *, gpointer);
static void brush_select_refresh_callback(GtkWidget *, gpointer);
static void paint_mode_menu_callback (GtkWidget *, gpointer);
......@@ -99,6 +108,7 @@ static ActionAreaItem action_items[] =
static double old_opacity;
static int old_spacing;
static int old_paint_mode;
static BrushEditGeneratedWindow *brush_edit_generated_dialog;
int NUM_BRUSH_COLUMNS=5;
int NUM_BRUSH_ROWS=5;
......@@ -131,7 +141,8 @@ brush_select_new ()
GtkWidget *util_box;
GtkWidget *option_menu;
GtkWidget *slider;
GBrushP active;
GimpBrushP active;
GtkWidget *button1, *button2;
bsp = g_malloc (sizeof (_BrushSelect));
bsp->redraw = TRUE;
......@@ -209,7 +220,7 @@ brush_select_new ()
gtk_widget_show (util_box);
/* Create the paint mode option menu */
old_paint_mode = get_brush_paint_mode ();
old_paint_mode = gimp_brush_get_paint_mode ();
util_box = gtk_hbox_new (FALSE, 2);
gtk_box_pack_start (GTK_BOX (bsp->options_box), util_box, FALSE, FALSE, 0);
......@@ -225,7 +236,7 @@ brush_select_new ()
gtk_option_menu_set_menu (GTK_OPTION_MENU (option_menu), menu);
/* Create the opacity scale widget */
old_opacity = get_brush_opacity ();
old_opacity = gimp_brush_get_opacity ();
util_box = gtk_hbox_new (FALSE, 2);
gtk_box_pack_start (GTK_BOX (bsp->options_box), util_box, FALSE, FALSE, 0);
......@@ -244,7 +255,7 @@ brush_select_new ()
gtk_widget_show (util_box);
/* Create the brush spacing scale widget */
old_spacing = get_brush_spacing ();
old_spacing = gimp_brush_get_spacing ();
util_box = gtk_hbox_new (FALSE, 2);
gtk_box_pack_start (GTK_BOX (bsp->options_box), util_box, FALSE, FALSE, 0);
......@@ -262,6 +273,25 @@ brush_select_new ()
gtk_widget_show (slider);
gtk_widget_show (util_box);
/* Create the edit/new buttons */
util_box = gtk_hbox_new (FALSE, 2);
gtk_box_pack_start (GTK_BOX (bsp->options_box), util_box, FALSE, FALSE, 0);
button1 = gtk_button_new_with_label ("Edit Brush");
gtk_signal_connect (GTK_OBJECT (button1), "clicked",
(GtkSignalFunc) edit_brush_callback,
NULL);
gtk_box_pack_start (GTK_BOX (util_box), button1, TRUE, TRUE, 5);
button2 = gtk_button_new_with_label ("New Brush");
gtk_signal_connect (GTK_OBJECT (button2), "clicked",
(GtkSignalFunc) new_brush_callback,
NULL);
gtk_box_pack_start (GTK_BOX (util_box), button2, TRUE, TRUE, 5);
gtk_widget_show (button1);
gtk_widget_show (button2);
gtk_widget_show (util_box);
/* The action area */
action_items[0].user_data = bsp;
action_items[1].user_data = bsp;
......@@ -322,6 +352,24 @@ brush_select_free (BrushSelectP bsp)
}
}
void
brush_select_brush_changed(BrushSelectP bsp, GimpBrushP brush)
{
/* TODO: be smarter here and only update the part of the preview
* that has changed */
if (bsp)
{
display_brushes(bsp);
gtk_widget_draw (bsp->preview, NULL);
}
}
void
brush_select_brush_dirty_callback(GimpBrushP brush, BrushSelectP bsp)
{
brush_select_brush_changed(bsp, brush);
}
/*
* Local functions
......@@ -330,7 +378,7 @@ static void
brush_popup_open (BrushSelectP bsp,
int x,
int y,
GBrushP brush)
GimpBrushP brush)
{
gint x_org, y_org;
gint scr_w, scr_h;
......@@ -399,9 +447,10 @@ brush_popup_close (BrushSelectP bsp)
if (bsp->brush_popup != NULL)
gtk_widget_hide (bsp->brush_popup);
}
static void
display_brush (BrushSelectP bsp,
GBrushP brush,
GimpBrushP brush,
int col,
int row)
{
......@@ -477,9 +526,10 @@ display_setup (BrushSelectP bsp)
static void
display_brushes (BrushSelectP bsp)
{
GSList * list = brush_list; /* the global brush list */
/* FIXME: use gimp_set_foreach?? */
GSList * list = GIMP_SET(brush_list)->list; /* the global brush list */
int row, col;
GBrushP brush;
GimpBrushP brush;
/* If there are no brushes, insensitize widgets */
if (brush_list == NULL)
......@@ -497,7 +547,7 @@ display_brushes (BrushSelectP bsp)
row = col = 0;
while (list)
{
brush = (GBrushP) list->data;
brush = (GimpBrushP) list->data;
/* Display the brush */
display_brush (bsp, brush, col, row);
......@@ -610,7 +660,8 @@ preview_calc_scrollbar (BrushSelectP bsp)
/* int rowy; */
offs = bsp->scroll_offset;
num_rows = (num_brushes + NUM_BRUSH_COLUMNS - 1) / NUM_BRUSH_COLUMNS;
num_rows = (brush_list->num_brushes + NUM_BRUSH_COLUMNS - 1)
/ NUM_BRUSH_COLUMNS;
max = num_rows * bsp->cell_width;
if (!num_rows) num_rows = 1;
page_size = bsp->preview->allocation.height;
......@@ -640,7 +691,7 @@ brush_select_resize (GtkWidget *widget,
BrushSelectP bsp)
{
NUM_BRUSH_COLUMNS = (gint)((widget->allocation.width - 4) / STD_CELL_WIDTH);
NUM_BRUSH_ROWS = (num_brushes + NUM_BRUSH_COLUMNS - 1) / NUM_BRUSH_COLUMNS;
NUM_BRUSH_ROWS = (brush_list->num_brushes + NUM_BRUSH_COLUMNS - 1) / NUM_BRUSH_COLUMNS;
bsp->width = widget->allocation.width - 4;
bsp->height = widget->allocation.height - 4;
......@@ -663,7 +714,7 @@ brush_select_resize (GtkWidget *widget,
static void
update_active_brush_field (BrushSelectP bsp)
{
GBrushP brush;
GimpBrushP brush;
char buf[32];
brush = get_active_brush ();
......@@ -679,7 +730,7 @@ update_active_brush_field (BrushSelectP bsp)
gtk_label_set (GTK_LABEL (bsp->brush_size), buf);
/* Set brush spacing */
bsp->spacing_data->value = get_brush_spacing ();
bsp->spacing_data->value = gimp_brush_get_spacing ();
gtk_signal_emit_by_name (GTK_OBJECT (bsp->spacing_data), "value_changed");
}
......@@ -690,7 +741,7 @@ brush_select_events (GtkWidget *widget,
BrushSelectP bsp)
{
GdkEventButton *bevent;
GBrushP brush;
GimpBrushP brush;
int row, col, index;
switch (event->type)
......@@ -718,7 +769,10 @@ brush_select_events (GtkWidget *widget,
/* Make this brush the active brush */
select_brush (brush);
if (brush_edit_generated_dialog)
brush_edit_generated_set_brush(brush_edit_generated_dialog,
get_active_brush());
/* Show the brush popup window if the brush is too large */
if (brush->mask->width > bsp->cell_width ||
brush->mask->height > bsp->cell_height)
......@@ -750,6 +804,39 @@ brush_select_events (GtkWidget *widget,
return FALSE;
}
static gint
edit_brush_callback (GtkWidget *w, GdkEvent *e, gpointer data)
{
if (GIMP_IS_BRUSH_GENERATED(get_active_brush()))
{
if (!brush_edit_generated_dialog)
{
/* Create the dialog... */
brush_edit_generated_dialog = brush_edit_generated_new();
brush_edit_generated_set_brush(brush_edit_generated_dialog,
get_active_brush());
}
else
{
/* Popup the dialog */
if (!GTK_WIDGET_VISIBLE (brush_edit_generated_dialog->shell))
gtk_widget_show (brush_edit_generated_dialog->shell);
else
gdk_window_raise(brush_edit_generated_dialog->shell->window);
}
}
else
g_message("We are all out of brush editors today, please try again tomorrow\n");
return TRUE;
}
static gint
new_brush_callback (GtkWidget *w, GdkEvent *e, gpointer data)
{
brush_changed_notify(GIMP_BRUSH(gimp_brush_generated_new(10, .5, 0.0, 1.0)));
return TRUE;
}
static gint
brush_select_delete_callback (GtkWidget *w, GdkEvent *e, gpointer data)
{
......@@ -766,9 +853,9 @@ brush_select_close_callback (GtkWidget *w,