evolution r35218 - trunk/plugins/mono



Author: psankar
Date: Wed Mar 19 10:13:41 2008
New Revision: 35218
URL: http://svn.gnome.org/viewvc/evolution?rev=35218&view=rev

Log:
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.




Modified:
   trunk/plugins/mono/ChangeLog
   trunk/plugins/mono/mono-plugin.c
   trunk/plugins/mono/org-gnome-evolution-mono.eplug.xml

Modified: trunk/plugins/mono/mono-plugin.c
==============================================================================
--- trunk/plugins/mono/mono-plugin.c	(original)
+++ trunk/plugins/mono/mono-plugin.c	Wed Mar 19 10:13:41 2008
@@ -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 @@
 
 #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 @@
 	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 @@
 		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 @@
 }
 
 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 @@
 
 		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);
 	}

Modified: trunk/plugins/mono/org-gnome-evolution-mono.eplug.xml
==============================================================================
--- trunk/plugins/mono/org-gnome-evolution-mono.eplug.xml	(original)
+++ trunk/plugins/mono/org-gnome-evolution-mono.eplug.xml	Wed Mar 19 10:13:41 2008
@@ -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>



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