1
# The GIMP -- an image manipulation program
2
# Copyright (C) 1995 Spencer Kimball and Peter Mattis
4
# This program is free software; you can redistribute it and/or modify
5
# it under the terms of the GNU General Public License as published by
6
# the Free Software Foundation; either version 2 of the License, or
7
# (at your option) any later version.
9
# This program is distributed in the hope that it will be useful,
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
# GNU General Public License for more details.
14
# You should have received a copy of the GNU General Public License
15
# along with this program; if not, write to the Free Software
16
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18
# "Perlized" from C source by Manish Singh <yosh@gimp.org>
21
$author = $copyright = 'Andy Thomas';
27
type => '0 <= float <= 100',
28
desc => 'The initial opacity of the brush' },
30
type => 'int32 <= 1000',
31
desc => 'The initial spacing of the brush (if < 0 then use brush default
33
{ name => 'paint_mode', type => 'enum GimpLayerModeEffects',
34
desc => 'The initial paint mode: { %%desc%% }' }
38
$blurb = 'Invokes the Gimp brush selection.';
40
$help = 'This procedure popups the brush selection dialog.';
45
{ name => 'brush_callback', type => 'string',
46
desc => 'The callback PDB proc to call when brush selection is
48
{ name => 'popup_title', type => 'string',
49
desc => 'Title to give the brush popup window' },
50
{ name => 'initial_brush', type => 'string',
51
desc => 'The name of the brush to set as the first selected',
59
if (gimp->no_interface ||
60
! procedural_db_lookup (gimp, brush_callback) ||
61
! gimp_pdb_dialog_new (gimp, context, gimp->brush_factory->container,
62
popup_title, brush_callback, initial_brush,
63
"opacity", opacity / 100.0,
64
"paint-mode", paint_mode,
73
sub brushes_close_popup {
74
$blurb = 'Popdown the Gimp brush selection.';
76
$help = 'This procedure closes an opened brush selection dialog.';
81
{ name => 'brush_callback', type => 'string',
82
desc => 'The name of the callback registered for this popup' }
88
if (gimp->no_interface ||
89
! procedural_db_lookup (gimp, brush_callback) ||
90
! gimp_pdb_dialog_close (gimp, gimp->brush_factory->container,
98
sub brushes_set_popup {
99
$blurb = 'Sets the current brush selection in a popup.';
106
{ name => 'brush_callback', type => 'string',
107
desc => 'The name of the callback registered for this popup' },
108
{ name => 'brush_name', type => 'string',
109
desc => 'The name of the brush to set as selected' },
116
if (gimp->no_interface ||
117
! procedural_db_lookup (gimp, brush_callback) ||
118
! gimp_pdb_dialog_set (gimp, gimp->brush_factory->container,
119
brush_callback, brush_name,
120
"opacity", opacity / 100.0,
121
"paint-mode", paint_mode,
130
@headers = qw("core/gimp.h" "core/gimpdatafactory.h");
132
@procs = qw(brushes_popup brushes_close_popup brushes_set_popup);
133
%exports = (app => [@procs], lib => [@procs]);