[maemo-developers] [pymaemo] How to add PyModule_AddObject to the override file?

From: Andrea Grandi a.grandi at gmail.com
Date: Wed Jul 29 18:04:53 EEST 2009
Hi,

2009/7/29 Anderson Lizardo <anderson.lizardo at openbossa.org>:
> http://www.daa.com.au/pipermail/pygtk/2007-November/014433.html
>
> You can try one of the two approaches described there. Note that I
> can't help much here, I've never done such a thing.

I tried to "play" with the example, adding this to the .override file:

#define MAFW_TYPE_PLUGIN_DESCRIPTOR_PUBLIC (py_foobar_get_type())

gpointer
py_foobar_copy (gpointer foo)
{
  g_warning ("you should not copy foobar");
  return NULL;
}

void
py_foobar_free (gpointer foo)
{
  g_foobar_destroy (foo);
}

GType py_foobar_get_type (void)
{
  static GType type;
  if (G_UNLIKELY (!type))
    type = g_boxed_type_register_static ("PyFoobar",
                                                       py_foobar_copy,
                                                       py_foobar_free);
  return type;
}

and now if I add this to mafw-extras.defs, I don't get any complain by the gcc:

;; -*- scheme -*-
; object definitions ...
(define-object PluginDescriptorPublic
    (in-module "Mafw")
    (parent "GObject")
    (c-name "MafwPluginDescriptorPublic")
    (gtype-id "MAFW_TYPE_PLUGIN_DESCRIPTOR_PUBLIC")
)

All I've to do now is to write a real MAFW_TYPE_PLUGIN_DESCRIPTOR_PUBLIC.

I'll keep you updated if I discover something new ;)

Thanks again!

-- 
Andrea Grandi
email: a.grandi [AT] gmail [DOT] com
website: http://www.andreagrandi.it
PGP Key: http://www.andreagrandi.it/pgp_key.asc
More information about the maemo-developers mailing list