11
11
* E-mail: bless@ai-lab.fh-furtwangen.de
12
12
* WWW: www.ai-lab.fh-furtwangen.de/~bless
14
* This program is free software; you can redistribute it and/or modify
14
* This program is free software: you can redistribute it and/or modify
15
15
* it under the terms of the GNU General Public License as published by
16
* the Free Software Foundation; either version 2 of the License, or
16
* the Free Software Foundation; either version 3 of the License, or
17
17
* (at your option) any later version.
19
19
* This program is distributed in the hope that it will be useful,
22
22
* GNU General Public License for more details.
24
24
* You should have received a copy of the GNU General Public License
25
* along with this program; if not, write to the Free Software
26
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25
* along with this program. If not, see <http://www.gnu.org/licenses/>.
143
143
static const GimpParamDef args[] =
145
{ GIMP_PDB_INT32, "run-mode", "Interactive, non-interactive" },
146
{ GIMP_PDB_IMAGE, "image", "Input image" },
147
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" },
148
{ GIMP_PDB_FLOAT, "circle", "Circle depth in %" },
149
{ GIMP_PDB_FLOAT, "angle", "Offset angle" },
150
{ GIMP_PDB_INT32, "backwards", "Map backwards?" },
151
{ GIMP_PDB_INT32, "inverse", "Map from top?" },
152
{ GIMP_PDB_INT32, "polrec", "Polar to rectangular?" }
145
{ GIMP_PDB_INT32, "run-mode", "The run mode { RUN-INTERACTIVE (0), RUN-NONINTERACTIVE (1) }" },
146
{ GIMP_PDB_IMAGE, "image", "Input image" },
147
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" },
148
{ GIMP_PDB_FLOAT, "circle", "Circle depth in %" },
149
{ GIMP_PDB_FLOAT, "angle", "Offset angle" },
150
{ GIMP_PDB_INT32, "backwards", "Map backwards { TRUE, FALSE }" },
151
{ GIMP_PDB_INT32, "inverse", "Map from top { TRUE, FALSE }" },
152
{ GIMP_PDB_INT32, "polrec", "Polar to rectangular { TRUE, FALSE }" }
155
155
gimp_install_procedure (PLUG_IN_PROC,
203
203
img_height = gimp_drawable_height (drawable->drawable_id);
204
204
img_has_alpha = gimp_drawable_has_alpha (drawable->drawable_id);
206
gimp_drawable_mask_bounds (drawable->drawable_id,
207
&sel_x1, &sel_y1, &sel_x2, &sel_y2);
206
if (! gimp_drawable_mask_intersect (drawable->drawable_id,
207
&sel_x1, &sel_y1, &sel_width, &sel_height))
209
210
/* Calculate scaling parameters */
211
sel_width = sel_x2 - sel_x1;
212
sel_height = sel_y2 - sel_y1;
212
sel_x2 = sel_x1 + sel_width;
213
sel_y2 = sel_y1 + sel_height;
214
215
cen_x = (double) (sel_x1 + sel_x2 - 1) / 2.0;
215
216
cen_y = (double) (sel_y1 + sel_y2 - 1) / 2.0;
590
589
gimp_ui_init (PLUG_IN_BINARY, TRUE);
592
dialog = gimp_dialog_new (_("Polar Coordinates"), PLUG_IN_BINARY,
591
dialog = gimp_dialog_new (_("Polar Coordinates"), PLUG_IN_ROLE,
594
593
gimp_standard_help_func, PLUG_IN_PROC,
606
605
gimp_window_set_transient (GTK_WINDOW (dialog));
608
main_vbox = gtk_vbox_new (FALSE, 12);
607
main_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
609
608
gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12);
610
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), main_vbox);
609
gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))),
610
main_vbox, TRUE, TRUE, 0);
611
611
gtk_widget_show (main_vbox);
654
654
/* togglebuttons for backwards, top, polar->rectangular */
655
hbox = gtk_hbox_new (TRUE, 6);
655
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
656
gtk_box_set_homogeneous (GTK_BOX (hbox), TRUE);
656
657
gtk_box_pack_start (GTK_BOX (main_vbox), hbox, FALSE, FALSE, 0);
658
659
toggle = gtk_check_button_new_with_mnemonic (_("_Map backwards"));