~ubuntu-branches/ubuntu/trusty/libpeas/trusty

« back to all changes in this revision

Viewing changes to loaders/seed/peas-extension-seed.c

  • Committer: Package Import Robot
  • Author(s): Michael Biebl
  • Date: 2012-03-31 08:26:42 UTC
  • mfrom: (1.4.3)
  • mto: (12.2.1 experimental)
  • mto: This revision was merged to the branch mainline in revision 34.
  • Revision ID: package-import@ubuntu.com-20120331082642-s6dihi2wggj1qokx
Tags: 1.4.0-1
* New upstream release.
* debian/watch: Track .xz tarballs.
* Bump (Build-)Depends on libglib2.0-dev to (>= 2.31.2).
* debian/libpeas-1.0-0.symbols: Add new symbols and remove 2 internal
  symbols which were dropped upstream.
* Explicitly enable the plugins (vala, python, seed) for more reliable build
  results.
* Use find to remove the compiled python and libtool .la files.
* Bump Standards-Version to 3.9.3.

Show diffs side-by-side

added added

removed removed

Lines of Context:
141
141
      sexten->js_object = NULL;
142
142
      sexten->js_context = NULL;
143
143
    }
 
144
 
 
145
  G_OBJECT_CLASS (peas_extension_seed_parent_class)->dispose (object);
144
146
}
145
147
 
146
148
static gboolean
147
149
peas_extension_seed_call (PeasExtensionWrapper *exten,
 
150
                          GType                 exten_type,
 
151
                          GICallableInfo       *func_info,
148
152
                          const gchar          *method_name,
149
153
                          GIArgument           *args,
150
154
                          GIArgument           *retval)
151
155
{
152
156
  PeasExtensionSeed *sexten = PEAS_EXTENSION_SEED (exten);
153
 
  GType exten_type;
154
157
  SeedValue js_method;
155
 
  GICallableInfo *func_info;
156
158
  gint n_args, i;
157
159
  SeedValue *js_in_args;
158
160
  OutArg *out_args;
166
168
  g_return_val_if_fail (sexten->js_context != NULL, FALSE);
167
169
  g_return_val_if_fail (sexten->js_object != NULL, FALSE);
168
170
 
169
 
  exten_type = peas_extension_wrapper_get_extension_type (exten);
170
 
 
171
171
  /* Fetch the JS method we want to call */
172
172
  js_method = seed_object_get_property (sexten->js_context,
173
173
                                        sexten->js_object,
187
187
      return FALSE;
188
188
    }
189
189
 
190
 
  /* Prepare the arguments */
191
 
  func_info = peas_gi_get_method_info (exten_type, method_name);
192
 
  if (func_info == NULL)
193
 
    return FALSE;
194
 
 
195
190
  n_args = g_callable_info_get_n_args (func_info);
196
191
  g_return_val_if_fail (n_args >= 0, FALSE);
197
192
 
278
273
 
279
274
cleanup:
280
275
 
281
 
  g_base_info_unref ((GIBaseInfo *) func_info);
282
 
 
283
276
  if (exc == NULL)
284
277
    return TRUE;
285
278
 
303
296
}
304
297
 
305
298
GObject *
306
 
peas_extension_seed_new (GType       exten_type,
307
 
                         SeedContext js_context,
308
 
                         SeedObject  js_object)
 
299
peas_extension_seed_new (GType        exten_type,
 
300
                         GType       *interfaces,
 
301
                         SeedContext  js_context,
 
302
                         SeedObject   js_object)
309
303
{
310
304
  PeasExtensionSeed *sexten;
311
305
  GType real_type;
313
307
  g_return_val_if_fail (js_context != NULL, NULL);
314
308
  g_return_val_if_fail (js_object != NULL, NULL);
315
309
 
316
 
  real_type = peas_extension_register_subclass (PEAS_TYPE_EXTENSION_SEED, exten_type);
 
310
  real_type = peas_extension_register_subclass (PEAS_TYPE_EXTENSION_SEED,
 
311
                                                interfaces);
 
312
 
 
313
  /* Already Warned */
 
314
  if (real_type == G_TYPE_INVALID)
 
315
    {
 
316
      g_free (interfaces);
 
317
      return NULL;
 
318
    }
 
319
 
317
320
  sexten = PEAS_EXTENSION_SEED (g_object_new (real_type, NULL));
318
321
 
319
322
  sexten->js_context = js_context;
320
323
  sexten->js_object = js_object;
321
324
  PEAS_EXTENSION_WRAPPER (sexten)->exten_type = exten_type;
 
325
  PEAS_EXTENSION_WRAPPER (sexten)->interfaces = interfaces;
322
326
 
323
327
  seed_context_ref (sexten->js_context);
324
328
  seed_value_protect (sexten->js_context, sexten->js_object);