diff options
author | Sankar P <psankar@novell.com> | 2008-03-19 18:13:41 +0800 |
---|---|---|
committer | Sankarasivasubramanian Pasupathilingam <psankar@src.gnome.org> | 2008-03-19 18:13:41 +0800 |
commit | ac5332ac711d4b16ce2bedc5db1202d97482f802 (patch) | |
tree | 4fc64b9866ff6d8458ca022e1d608c8e34916ca7 /plugins/mono/mono-plugin.c | |
parent | d0e8243d1736f6679048006edb9350651a61dcaa (diff) | |
download | gsoc2013-evolution-ac5332ac711d4b16ce2bedc5db1202d97482f802.tar gsoc2013-evolution-ac5332ac711d4b16ce2bedc5db1202d97482f802.tar.gz gsoc2013-evolution-ac5332ac711d4b16ce2bedc5db1202d97482f802.tar.bz2 gsoc2013-evolution-ac5332ac711d4b16ce2bedc5db1202d97482f802.tar.lz gsoc2013-evolution-ac5332ac711d4b16ce2bedc5db1202d97482f802.tar.xz gsoc2013-evolution-ac5332ac711d4b16ce2bedc5db1202d97482f802.tar.zst gsoc2013-evolution-ac5332ac711d4b16ce2bedc5db1202d97482f802.zip |
- Use Plugin load levels. Mono loader should load and register the type
2008-03-19 Sankar P <psankar@novell.com>
* mono-plugin.c: (epm_invoke),
(load_plugin_type_register_function):
* org-gnome-evolution-mono.eplug.xml:
- Use Plugin load levels. Mono loader should load
and register the type "mono", before a plugin
of type "mono" is loaded.
svn path=/trunk/; revision=35218
Diffstat (limited to 'plugins/mono/mono-plugin.c')
-rw-r--r-- | plugins/mono/mono-plugin.c | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/plugins/mono/mono-plugin.c b/plugins/mono/mono-plugin.c index 7a89046f15..e1d7390375 100644 --- a/plugins/mono/mono-plugin.c +++ b/plugins/mono/mono-plugin.c @@ -10,7 +10,7 @@ #include <mono/metadata/assembly.h> #include <mono/jit/jit.h> -#define d(x) +#define d(x) (x) static MonoDomain *domain; @@ -26,6 +26,8 @@ typedef struct _EPluginMonoPrivate { #define epm ((EPluginMono *)ep) +void * load_plugin_type_register_function (void *a, void *b); + static char * get_xml_prop(xmlNodePtr node, const char *id) { @@ -57,6 +59,8 @@ epm_invoke(EPlugin *ep, const char *name, void *data) MonoObject *x = NULL, *res; void **params; + g_print ("\n\a epm_invoke in mono-plugin.c in mono plugin loader is called \n\a"); + /* we need to do this every time since we may be called from any thread for some uses */ mono_thread_attach(domain); @@ -82,13 +86,24 @@ epm_invoke(EPlugin *ep, const char *name, void *data) if (p->klass) { d(printf("looking up method '%s' in class\n", name)); /* class method */ + d = mono_method_desc_new(name, FALSE); - if (d == NULL) { + /*if (d == NULL) { g_warning("Can't create method descriptor for '%s'", name); return NULL; + }*/ + + gpointer iter = NULL; + MonoMethod* mono_method; + + d(printf ("\n\a About to get methods in klass\n\a")); + + while ((mono_method = mono_class_get_methods (p->klass, &iter))) { + g_print ("\n\a Method name is : <%s>\n\a", mono_method_get_name(mono_method)); } - - m = mono_method_desc_search_in_class(d, p->klass); + d(printf ("\n\a Got methods in klass \n\a")); +//mono_class_get_method_from_name + m = mono_class_get_method_from_name (p->klass, name, -1); if (m == NULL) { g_warning("Can't find method callback '%s'", name); return NULL; @@ -181,7 +196,7 @@ epm_init(GObject *o) } void * -org_gnome_evolution_mono_get_type(void *a, void *b) +load_plugin_type_register_function (void *a, void *b) { static GType type = 0; @@ -193,6 +208,8 @@ org_gnome_evolution_mono_get_type(void *a, void *b) epm_parent_class = g_type_class_ref(e_plugin_get_type()); type = g_type_register_static(e_plugin_get_type(), "EPluginMono", &info, 0); + e_plugin_register_type (type); + d(printf("\nType EPluginMono registered from the mono-plugin-loader\n")); domain = mono_jit_init("Evolution"); mono_thread_attach(domain); } |