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

« back to all changes in this revision

Viewing changes to app/plug-in/gimppluginprocframe.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2008-10-06 13:30:41 UTC
  • mto: This revision was merged to the branch mainline in revision 35.
  • Revision ID: james.westby@ubuntu.com-20081006133041-3panbkcanaymfsmp
Tags: upstream-2.6.0
ImportĀ upstreamĀ versionĀ 2.6.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
#include "core/gimpcontext.h"
30
30
#include "core/gimpprogress.h"
31
31
 
 
32
#include "pdb/gimppdberror.h"
 
33
 
32
34
#include "gimpplugin.h"
33
35
#include "gimpplugin-cleanup.h"
34
36
#include "gimpplugin-progress.h"
35
37
#include "gimppluginprocedure.h"
36
38
 
 
39
#include "gimp-intl.h"
 
40
 
37
41
 
38
42
/*  public functions  */
39
43
 
77
81
  proc_frame->progress           = progress ? g_object_ref (progress) : NULL;
78
82
  proc_frame->progress_created   = FALSE;
79
83
  proc_frame->progress_cancel_id = 0;
 
84
  proc_frame->error_handler      = GIMP_PDB_ERROR_HANDLER_INTERNAL;
80
85
 
81
86
  if (progress)
82
87
    gimp_plug_in_progress_attach (progress);
125
130
      proc_frame->main_loop = NULL;
126
131
    }
127
132
 
128
 
  if (proc_frame->cleanups)
 
133
  if (proc_frame->image_cleanups || proc_frame->item_cleanups)
129
134
    gimp_plug_in_cleanup (plug_in, proc_frame);
130
135
}
131
136
 
156
161
}
157
162
 
158
163
GValueArray *
159
 
gimp_plug_in_proc_frame_get_return_vals (GimpPlugInProcFrame *proc_frame)
 
164
gimp_plug_in_proc_frame_get_return_values (GimpPlugInProcFrame *proc_frame)
160
165
{
161
166
  GValueArray *return_vals;
162
167
 
173
178
        {
174
179
          /* Allocate new return values of the correct size. */
175
180
          return_vals = gimp_procedure_get_return_values (proc_frame->procedure,
176
 
                                                          FALSE);
 
181
                                                          TRUE, NULL);
177
182
 
178
183
          /* Copy all of the arguments we can. */
179
184
          memcpy (return_vals->values, proc_frame->return_vals->values,
181
186
 
182
187
          /* Free the old arguments. */
183
188
          g_free (proc_frame->return_vals->values);
184
 
          proc_frame->return_vals->values = 0;
 
189
          proc_frame->return_vals->values = NULL;
185
190
          proc_frame->return_vals->n_values = 0;
186
191
          g_value_array_free (proc_frame->return_vals);
187
192
        }
191
196
    }
192
197
  else
193
198
    {
194
 
      /* Just return a dummy set of values. */
195
 
      return_vals = gimp_procedure_get_return_values (proc_frame->procedure,
196
 
                                                      FALSE);
 
199
      GimpProcedure *procedure = proc_frame->procedure;
 
200
      GError        *error;
 
201
 
 
202
      error = g_error_new (GIMP_PDB_ERROR, GIMP_PDB_INVALID_RETURN_VALUE,
 
203
                           _("Procedure '%s' returned no return values"),
 
204
                           gimp_object_get_name (GIMP_OBJECT (procedure)));
 
205
 
 
206
      return_vals = gimp_procedure_get_return_values (procedure, FALSE,
 
207
                                                      error);
 
208
      g_error_free (error);
197
209
    }
198
210
 
199
211
  return return_vals;