~ubuntu-branches/ubuntu/jaunty/gimp/jaunty-security

« back to all changes in this revision

Viewing changes to tools/pdbgen/pdb/floating_sel.pdb

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2007-05-02 16:33:03 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070502163303-bvzhjzbpw8qglc4y
Tags: 2.3.16-1ubuntu1
* Resynchronized with Debian, remaining Ubuntu changes:
  - debian/rules: i18n magic.
* debian/control.in:
  - Maintainer: Ubuntu Core Developers <ubuntu-devel@lists.ubuntu.com>
* debian/patches/02_help-message.patch,
  debian/patches/03_gimp.desktop.in.in.patch,
  debian/patches/10_dont_show_wizard.patch: updated.
* debian/patches/04_composite-signedness.patch,
  debian/patches/05_add-letter-spacing.patch: dropped, used upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# The GIMP -- an image manipulation program
 
1
# GIMP - The GNU Image Manipulation Program
2
2
# Copyright (C) 1995 Spencer Kimball and Peter Mattis
3
3
 
4
4
# This program is free software; you can redistribute it and/or modify
17
17
 
18
18
# "Perlized" from C source by Manish Singh <yosh@gimp.org>
19
19
 
20
 
sub inargs {
21
 
    @inargs = (
22
 
        { name => 'floating_sel', type => 'layer',
23
 
          desc => 'The floating selection' }
24
 
    );
25
 
}
26
 
 
27
 
sub invoke {
28
 
    my @subname = split /::/, (caller 1)[3];
29
 
    my $cmd = pop @subname;
30
 
    %invoke = (
31
 
        headers => [ qw("core/gimplayer-floating-sel.h") ],
32
 
        code => <<CODE
33
 
{
34
 
  if (gimp_layer_is_floating_sel (floating_sel))
35
 
    $cmd (floating_sel);
36
 
  else
37
 
    success = FALSE;
38
 
}
39
 
CODE
40
 
    );
41
 
}
42
 
 
43
20
sub floating_sel_remove {
44
21
    $blurb = <<'BLURB';
45
22
Remove the specified floating selection from its associated drawable.
51
28
HELP
52
29
 
53
30
    &std_pdb_misc;
54
 
    &inargs;
55
 
    &invoke;
 
31
 
 
32
    @inargs = (
 
33
        { name => 'floating_sel', type => 'layer',
 
34
          desc => 'The floating selection' }
 
35
    );
 
36
 
 
37
    %invoke = (
 
38
        code => <<'CODE'
 
39
{
 
40
  if (gimp_layer_is_floating_sel (floating_sel))
 
41
    floating_sel_remove (floating_sel);
 
42
  else
 
43
    success = FALSE;
 
44
}
 
45
CODE
 
46
    );
56
47
}
57
48
 
58
49
sub floating_sel_anchor {
67
58
HELP
68
59
 
69
60
    &std_pdb_misc;
70
 
    &inargs;
71
 
    &invoke;
 
61
 
 
62
    @inargs = (
 
63
        { name => 'floating_sel', type => 'layer',
 
64
          desc => 'The floating selection' }
 
65
    );
 
66
 
 
67
    %invoke = (
 
68
        code => <<'CODE'
 
69
{
 
70
  if (gimp_layer_is_floating_sel (floating_sel))
 
71
    floating_sel_anchor (floating_sel);
 
72
  else
 
73
    success = FALSE;
 
74
}
 
75
CODE
 
76
    );
72
77
}
73
78
 
74
79
sub floating_sel_to_layer {
85
90
HELP
86
91
 
87
92
    &std_pdb_misc;
88
 
    &inargs;
89
 
    &invoke;
 
93
 
 
94
    @inargs = (
 
95
        { name => 'floating_sel', type => 'layer',
 
96
          desc => 'The floating selection' }
 
97
    );
 
98
 
 
99
    %invoke = (
 
100
        code => <<'CODE'
 
101
{
 
102
  if (gimp_layer_is_floating_sel (floating_sel))
 
103
    floating_sel_to_layer (floating_sel);
 
104
  else
 
105
    success = FALSE;
 
106
}
 
107
CODE
 
108
    );
90
109
}
91
110
 
92
111
sub floating_sel_attach {
108
127
    );
109
128
 
110
129
    %invoke = (
111
 
        headers => [ qw("core/gimplayer-floating-sel.h") ],
112
 
        code => <<CODE
 
130
        code => <<'CODE'
113
131
{
114
 
  success = gimp_item_is_attached (GIMP_ITEM (drawable));
115
 
 
116
 
  if (success)
 
132
  if (gimp_item_is_attached (GIMP_ITEM (drawable)))
117
133
    floating_sel_attach (layer, drawable);
 
134
  else
 
135
    success = FALSE;
118
136
}
119
137
CODE
120
138
    );
122
140
 
123
141
sub floating_sel_rigor {
124
142
    $blurb = 'Rigor the floating selection.';
125
 
 
126
 
    $help = <<'HELP';
127
 
This procedure rigors the floating selection.
128
 
HELP
 
143
    $help  = 'This procedure rigors the floating selection.';
129
144
 
130
145
    &std_pdb_misc;
131
146
 
132
 
    &inargs;
133
 
    push @inargs, { name => 'undo', type => 'boolean', desc => '%%desc%%' };
 
147
    @inargs = (
 
148
        { name => 'floating_sel', type => 'layer',
 
149
          desc => 'The floating selection' },
 
150
        { name => 'undo', type => 'boolean' }
 
151
    );
134
152
 
135
 
    &invoke;
136
 
    $invoke{code} =~ s/\(floating_sel\);/(floating_sel, undo);/;
 
153
    %invoke = (
 
154
        code => <<'CODE'
 
155
{
 
156
  if (gimp_layer_is_floating_sel (floating_sel))
 
157
    floating_sel_rigor (floating_sel, undo);
 
158
  else
 
159
    success = FALSE;
 
160
}
 
161
CODE
 
162
    );
137
163
}
138
164
 
139
165
sub floating_sel_relax {
140
166
    $blurb = 'Relax the floating selection.';
141
 
 
142
 
    $help = <<'HELP';
143
 
This procedure relaxes the floating selection.
144
 
HELP
 
167
    $help  = 'This procedure relaxes the floating selection.';
145
168
 
146
169
    &std_pdb_misc;
147
170
 
148
 
    &inargs;
149
 
    push @inargs, { name => 'undo', type => 'boolean', desc => '%%desc%%' };
150
 
 
151
 
    &invoke;
152
 
    $invoke{code} =~ s/\(floating_sel\);/(floating_sel, undo);/;
153
 
}
 
171
    @inargs = (
 
172
        { name => 'floating_sel', type => 'layer',
 
173
          desc => 'The floating selection' },
 
174
        { name => 'undo', type => 'boolean' }
 
175
    );
 
176
 
 
177
    %invoke = (
 
178
        code => <<'CODE'
 
179
{
 
180
  if (gimp_layer_is_floating_sel (floating_sel))
 
181
    floating_sel_relax (floating_sel, undo);
 
182
  else
 
183
    success = FALSE;
 
184
}
 
185
CODE
 
186
    );
 
187
}
 
188
 
 
189
 
 
190
@headers = qw("core/gimplayer-floating-sel.h");
154
191
 
155
192
@procs = qw(floating_sel_remove floating_sel_anchor floating_sel_to_layer
156
193
            floating_sel_attach floating_sel_rigor floating_sel_relax);
 
194
 
157
195
%exports = (app => [@procs], lib => [@procs]);
158
196
 
159
197
$desc = 'Floating selections';