~ubuntu-branches/ubuntu/vivid/gimp/vivid

« back to all changes in this revision

Viewing changes to plug-ins/fractal-explorer/fractal-explorer.c

  • Committer: Package Import Robot
  • Author(s): Jordi Mallach
  • Date: 2012-05-08 18:50:03 UTC
  • mto: (1.1.26) (0.5.1 experimental)
  • mto: This revision was merged to the branch mainline in revision 71.
  • Revision ID: package-import@ubuntu.com-20120508185003-tltkvbaysf8d2426
ImportĀ upstreamĀ versionĀ 2.8.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
   GIMP - The GNU Image Manipulation Program
12
12
   Copyright (C) 1995 Spencer Kimball and Peter Mattis
13
13
 
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.
18
18
 
19
19
   This program is distributed in the hope that it will be useful,
22
22
   GNU General Public License for more details.
23
23
 
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., 675 Mass Ave, Cambridge, MA 02139, USA.
 
25
   along with this program.  If not, see <http://www.gnu.org/licenses/>.
27
26
 *********************************************************************/
28
27
 
29
28
/**********************************************************************
83
82
gdouble              ybild;
84
83
gdouble              xdiff;
85
84
gdouble              ydiff;
86
 
gint                 sel_x1;
87
 
gint                 sel_y1;
88
 
gint                 sel_x2;
89
 
gint                 sel_y2;
 
85
gint                 sel_x;
 
86
gint                 sel_y;
90
87
gint                 preview_width;
91
88
gint                 preview_height;
92
89
gdouble             *gg;
202
199
{
203
200
  static const GimpParamDef args[] =
204
201
  {
205
 
    { GIMP_PDB_INT32, "run-mode", "Interactive, non-interactive" },
 
202
    { GIMP_PDB_INT32, "run-mode", "The run mode { RUN-INTERACTIVE (0), RUN-NONINTERACTIVE (1) }" },
206
203
    { GIMP_PDB_IMAGE, "image", "Input image" },
207
204
    { GIMP_PDB_DRAWABLE, "drawable", "Input drawable" },
208
205
    { GIMP_PDB_INT8, "fractaltype", "0: Mandelbrot; "
262
259
     GimpParam       **return_vals)
263
260
{
264
261
  static GimpParam   values[1];
265
 
  gint32             image_ID;
266
262
  GimpRunMode        run_mode;
267
263
  gint               pwidth;
268
264
  gint               pheight;
282
278
 
283
279
  /*  Get the specified drawable  */
284
280
  drawable = gimp_drawable_get (param[2].data.d_drawable);
285
 
  image_ID = param[1].data.d_image;
286
 
 
287
 
  gimp_drawable_mask_bounds (drawable->drawable_id,
288
 
                             &sel_x1, &sel_y1, &sel_x2, &sel_y2);
289
 
 
290
 
  sel_width  = sel_x2 - sel_x1;
291
 
  sel_height = sel_y2 - sel_y1;
 
281
 
 
282
  if (! gimp_drawable_mask_intersect (drawable->drawable_id,
 
283
                                      &sel_x, &sel_y,
 
284
                                      &sel_width, &sel_height))
 
285
    return;
292
286
 
293
287
  /* Calculate preview size */
294
288
  if (sel_width > sel_height)
470
464
      if ((row % 10) == 0)
471
465
        gimp_progress_update ((double) row / (double) (y2 - y1));
472
466
    }
 
467
  gimp_progress_update (1.0);
473
468
 
474
469
  /*  update the processed region  */
475
470
  gimp_drawable_flush (drawable);
908
903
static void
909
904
fractalexplorer_list_free_all (void)
910
905
{
911
 
  g_list_foreach (fractalexplorer_list, (GFunc) fractalexplorer_free, NULL);
912
 
  g_list_free (fractalexplorer_list);
 
906
  g_list_free_full (fractalexplorer_list, (GDestroyNotify) fractalexplorer_free);
913
907
  fractalexplorer_list = NULL;
914
908
}
915
909
 
950
944
      g_message (_("File '%s' is not a FractalExplorer file"),
951
945
                 gimp_filename_to_utf8 (filename));
952
946
      fclose (fp);
 
947
      fractalexplorer_free (fractalexplorer);
953
948
 
954
949
      return NULL;
955
950
    }
959
954
      g_message (_("File '%s' is corrupt.\nLine %d Option section incorrect"),
960
955
                 gimp_filename_to_utf8 (filename), line_no);
961
956
      fclose (fp);
 
957
      fractalexplorer_free (fractalexplorer);
962
958
 
963
959
      return NULL;
964
960
    }
1111
1107
      return;
1112
1108
    }
1113
1109
 
1114
 
  dlg = gimp_dialog_new (_("Rescan for Fractals"), PLUG_IN_BINARY,
 
1110
  dlg = gimp_dialog_new (_("Rescan for Fractals"), PLUG_IN_ROLE,
1115
1111
                         gtk_widget_get_toplevel (view),
1116
1112
                         GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
1117
1113
                         gimp_standard_help_func, PLUG_IN_PROC,
1133
1129
  patheditor = gimp_path_editor_new (_("Add FractalExplorer Path"),
1134
1130
                                     fractalexplorer_path);
1135
1131
  gtk_container_set_border_width (GTK_CONTAINER (patheditor), 12);
1136
 
  gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), patheditor,
1137
 
                      TRUE, TRUE, 0);
 
1132
  gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dlg))),
 
1133
                      patheditor, TRUE, TRUE, 0);
1138
1134
  gtk_widget_show (patheditor);
1139
1135
 
1140
1136
  if (gimp_dialog_run (GIMP_DIALOG (dlg)) == GTK_RESPONSE_OK)