Sat, 24 Mar 2007 06:24:59 +0000
SF Patch #1686400 from Eoin Coffey ("ecoffey")
ecoffey described the changes:
1) Small tweaks to the loader to bring it up to speed with new mono
versions and API wrapper changes that grim had made. (was in original
patch, just forgot about it :-P)
2) .NET Plugins are now required to define an Id as part of their info.
3) Modified gaim_probe_plugin to check for existence of info->id and to
make sure it's not empty; Prints an error, stores an error in the plugin
and sets plugin->unloadable = TRUE.
| 15884 | 1 | #ifndef _PURPLE_MONO_LOADER_MONO_HELPER_H_ |
| 2 | #define _PURPLE_MONO_LOADER_MONO_HELPER_H_ | |
| 11660 | 3 | |
| 4 | #include <mono/jit/jit.h> | |
| 5 | #include <mono/metadata/object.h> | |
| 6 | #include <mono/metadata/environment.h> | |
| 7 | #include <mono/metadata/assembly.h> | |
| 8 | #include <mono/metadata/debug-helpers.h> | |
| 9 | #include <mono/metadata/tokentype.h> | |
| 10 | #include "plugin.h" | |
| 11 | #include "value.h" | |
| 12 | #include "debug.h" | |
| 13 | ||
| 14 | typedef struct { | |
| 15884 | 15 | PurplePlugin *plugin; |
|
11980
fe5c2c58508c
[gaim-migrate @ 14273]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
11952
diff
changeset
|
16 | |
| 11660 | 17 | MonoAssembly *assm; |
| 18 | MonoClass *klass; | |
| 19 | MonoObject *obj; | |
|
11980
fe5c2c58508c
[gaim-migrate @ 14273]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
11952
diff
changeset
|
20 | |
| 11660 | 21 | MonoMethod *init; |
| 22 | MonoMethod *load; | |
| 23 | MonoMethod *unload; | |
| 24 | MonoMethod *destroy; | |
|
11980
fe5c2c58508c
[gaim-migrate @ 14273]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
11952
diff
changeset
|
25 | |
|
fe5c2c58508c
[gaim-migrate @ 14273]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
11952
diff
changeset
|
26 | GList *signal_data; |
| 15884 | 27 | } PurpleMonoPlugin; |
| 11660 | 28 | |
|
12323
f52908fb23b0
[gaim-migrate @ 14627]
Richard Laager <rlaager@pidgin.im>
parents:
11996
diff
changeset
|
29 | gboolean ml_init(void); |
|
11980
fe5c2c58508c
[gaim-migrate @ 14273]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
11952
diff
changeset
|
30 | |
|
12323
f52908fb23b0
[gaim-migrate @ 14627]
Richard Laager <rlaager@pidgin.im>
parents:
11996
diff
changeset
|
31 | void ml_uninit(void); |
|
11952
9cefc8360bff
[gaim-migrate @ 14243]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
11660
diff
changeset
|
32 | |
|
11980
fe5c2c58508c
[gaim-migrate @ 14273]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
11952
diff
changeset
|
33 | MonoObject* ml_invoke(MonoMethod *method, void *obj, void **params); |
|
11952
9cefc8360bff
[gaim-migrate @ 14243]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
11660
diff
changeset
|
34 | |
|
11980
fe5c2c58508c
[gaim-migrate @ 14273]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
11952
diff
changeset
|
35 | MonoObject* ml_delegate_invoke(MonoObject *method, void **params); |
| 11660 | 36 | |
|
11980
fe5c2c58508c
[gaim-migrate @ 14273]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
11952
diff
changeset
|
37 | MonoClass* ml_find_plugin_class(MonoImage *image); |
|
fe5c2c58508c
[gaim-migrate @ 14273]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
11952
diff
changeset
|
38 | |
|
fe5c2c58508c
[gaim-migrate @ 14273]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
11952
diff
changeset
|
39 | gchar* ml_get_prop_string(MonoObject *obj, char *field); |
| 11660 | 40 | |
|
11980
fe5c2c58508c
[gaim-migrate @ 14273]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
11952
diff
changeset
|
41 | void ml_set_prop_string(MonoObject *obj, char *field, char *data); |
| 11660 | 42 | |
|
15938
1b037158411e
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
43 | MonoObject* ml_get_info_prop(MonoObject *obj); |
|
1b037158411e
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
44 | |
|
11980
fe5c2c58508c
[gaim-migrate @ 14273]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
11952
diff
changeset
|
45 | gboolean ml_is_api_dll(MonoImage *image); |
| 11660 | 46 | |
|
11980
fe5c2c58508c
[gaim-migrate @ 14273]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
11952
diff
changeset
|
47 | MonoDomain* ml_get_domain(void); |
|
fe5c2c58508c
[gaim-migrate @ 14273]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
11952
diff
changeset
|
48 | |
|
fe5c2c58508c
[gaim-migrate @ 14273]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
11952
diff
changeset
|
49 | void ml_set_domain(MonoDomain *d); |
| 11660 | 50 | |
|
11980
fe5c2c58508c
[gaim-migrate @ 14273]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
11952
diff
changeset
|
51 | void ml_init_internal_calls(void); |
| 11660 | 52 | |
| 15884 | 53 | MonoObject* ml_object_from_purple_type(PurpleType type, gpointer data); |
| 11660 | 54 | |
| 15884 | 55 | MonoObject* ml_object_from_purple_subtype(PurpleSubType type, gpointer data); |
| 11660 | 56 | |
|
11996
858bd928831c
[gaim-migrate @ 14289]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
11980
diff
changeset
|
57 | MonoObject* ml_create_api_object(char *class_name); |
|
858bd928831c
[gaim-migrate @ 14289]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
11980
diff
changeset
|
58 | |
|
11980
fe5c2c58508c
[gaim-migrate @ 14273]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
11952
diff
changeset
|
59 | void ml_set_api_image(MonoImage *image); |
| 11660 | 60 | |
|
12323
f52908fb23b0
[gaim-migrate @ 14627]
Richard Laager <rlaager@pidgin.im>
parents:
11996
diff
changeset
|
61 | MonoImage* ml_get_api_image(void); |
| 11660 | 62 | |
| 63 | /* hash table stuff; probably don't need it anymore */ | |
| 64 | ||
| 15884 | 65 | void ml_add_plugin(PurpleMonoPlugin *plugin); |
| 11660 | 66 | |
| 15884 | 67 | gboolean ml_remove_plugin(PurpleMonoPlugin *plugin); |
| 11660 | 68 | |
| 15884 | 69 | gpointer ml_find_plugin(PurpleMonoPlugin *plugin); |
| 11660 | 70 | |
|
11980
fe5c2c58508c
[gaim-migrate @ 14273]
Eoin Coffey <ecoffey@soc.pidgin.im>
parents:
11952
diff
changeset
|
71 | gpointer ml_find_plugin_by_class(MonoClass *klass); |
| 11660 | 72 | |
|
12323
f52908fb23b0
[gaim-migrate @ 14627]
Richard Laager <rlaager@pidgin.im>
parents:
11996
diff
changeset
|
73 | GHashTable* ml_get_plugin_hash(void); |
| 11660 | 74 | |
| 75 | #endif |