[anjuta-devel] Registering plugin



Hi All,

I'm working on cleaning the code of the project manager and I have several questions:

1. This plugin defines several GObject types, in order to be able to unload it they should be registered using g_type_module_register_type. There is a macros to do it in GLib: G_DEFINE_DYNAMIC_TYPE_EXTENDED with a place to insert custom code. Anjuta provides a specialized version for plugin object defined in libanjuta/anjuta-plugin.h and named ANJUTA_PLUGIN_BEGIN and ANJUTA_PLUGIN_END.

I think the Anjuta way is slightly more readable but it's not the standard way to do it. The instance initialization name is different prefix##_instance_init instead of prefix##_init and the prefix##_class_finalize function is needed too.

Do you think it's useful to rewrite Anjuta's macros to follow Glib way ?


2. These additional types need to be registered and Anjuta supports this only for the plugin type, using the macro ANJUTA_SIMPLE_PLUGIN again in libanjuta/anjuta-plugin.h.

Here I need to create a new macro, but do you think it's better to define two macros with _BEGIN and _END or only one like in GLib ?

Moreover, the name of the already existing Anjuta macros: ANJUTA_SIMPLE_PLUGIN is I think a bit tricky because this macros is used to register the type which is not the same than defining the type done by ANJUTA_PLUGIN_BEGIN and ANJUTA_PLUGIN_END macros.

So I think that it would be better to rename this macro something like ANJUTA_REGISTER_SIMPLE_PLUGIN and have by example ANJUTA_REGISTER_PLUGIN_BEGIN and ANJUTA_REGISTER_PLUGIN_END or ANJUTA_REGISTER_PLUGIN_EXTENDED like in GLib. Again it changes all plugins, including the one outside Anjuta tree, do you think it's useful to do it ?


Regards,

Sébastien



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]