aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/mono/ChangeLog9
-rw-r--r--plugins/mono/mono-plugin.c27
-rw-r--r--plugins/mono/org-gnome-evolution-mono.eplug.xml18
3 files changed, 38 insertions, 16 deletions
diff --git a/plugins/mono/ChangeLog b/plugins/mono/ChangeLog
index 0e0b3017c1..e97fd60cbd 100644
--- a/plugins/mono/ChangeLog
+++ b/plugins/mono/ChangeLog
@@ -1,3 +1,12 @@
+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.
+
2007-10-02 Matthew Barnes <mbarnes@redhat.com>
** Fixes part of bug #469657
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);
}
diff --git a/plugins/mono/org-gnome-evolution-mono.eplug.xml b/plugins/mono/org-gnome-evolution-mono.eplug.xml
index 0e0a8b70d5..094ccff722 100644
--- a/plugins/mono/org-gnome-evolution-mono.eplug.xml
+++ b/plugins/mono/org-gnome-evolution-mono.eplug.xml
@@ -1,16 +1,12 @@
<?xml version="1.0"?>
<e-plugin-list>
- <e-plugin
- type="shlib"
- id="org.gnome.evolution.plugin.mono"
- location="@PLUGINDIR@/liborg-gnome-evolution-mono@SOEXT@"
- _name="Mono Loader">
- <_description>A plugin which implements mono plugins.</_description>
- <author name="Michael Zucchi" email="notzed@ximian.com"/>
+ <e-plugin type="shlib" id="org.gnome.evolution.plugin.mono"
+ location="@PLUGINDIR@/liborg-gnome-evolution-mono@SOEXT@" _name="Mono Loader" load_level="1">
- <hook class="org.gnome.evolution.plugin.type:1.0">
- <plugin-type get-type="org_gnome_evolution_mono_get_type"/>
- </hook>
+ <_description>A plugin which implements mono plugins.</_description>
- </e-plugin>
+ <author name="Michael Zucchi" email="notzed@ximian.com"/>
+ <author name="Sankar P" email="psankar@novell.com"/>
+
+ </e-plugin>
</e-plugin-list>