annotate plugins/mono/loader/status-glue.c @ 11980:67fbd2ff4c4e

[gaim-migrate @ 14273] Mono cleanup patch from Eoin Coffey First, I changed mono_loader_ to ml_, since I was getting sick of typing mono_loader_ :-D Moved the mono runtime init and deinit code out of mono.c into ml_init and ml_uninit in mono-helper.c Added api/Status.cs and loader/status-glue.c so the .net api now knows very little (as in the 'id') of statuses. committer: Tailor Script <tailor@pidgin.im>
author Gary Kramlich <grim@reaperworld.com>
date Sat, 05 Nov 2005 02:09:30 +0000
parents
children ecd33ffb0b0a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11980
67fbd2ff4c4e [gaim-migrate @ 14273]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
1 #include "status.h"
67fbd2ff4c4e [gaim-migrate @ 14273]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
2 #include "mono-helper.h"
67fbd2ff4c4e [gaim-migrate @ 14273]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
3
67fbd2ff4c4e [gaim-migrate @ 14273]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
4 MonoObject* gaim_status_build_status_object(void* data)
67fbd2ff4c4e [gaim-migrate @ 14273]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
5 {
67fbd2ff4c4e [gaim-migrate @ 14273]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
6 MonoObject *obj = NULL;
67fbd2ff4c4e [gaim-migrate @ 14273]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
7 MonoClass *klass = NULL;
67fbd2ff4c4e [gaim-migrate @ 14273]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
8
67fbd2ff4c4e [gaim-migrate @ 14273]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
9 GaimStatus *status = (GaimStatus*)data;
67fbd2ff4c4e [gaim-migrate @ 14273]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
10
67fbd2ff4c4e [gaim-migrate @ 14273]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
11 klass = mono_class_from_name(ml_get_api_image(), "Gaim", "Status");
67fbd2ff4c4e [gaim-migrate @ 14273]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
12 if (!klass) {
67fbd2ff4c4e [gaim-migrate @ 14273]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
13 gaim_debug(GAIM_DEBUG_FATAL, "mono", "couldn't build the class!\n");
67fbd2ff4c4e [gaim-migrate @ 14273]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
14 }
67fbd2ff4c4e [gaim-migrate @ 14273]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
15
67fbd2ff4c4e [gaim-migrate @ 14273]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
16 obj = mono_object_new(ml_get_domain(), klass);
67fbd2ff4c4e [gaim-migrate @ 14273]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
17 if (!obj) {
67fbd2ff4c4e [gaim-migrate @ 14273]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
18 gaim_debug(GAIM_DEBUG_FATAL, "mono", "couldn't create the object!\n");
67fbd2ff4c4e [gaim-migrate @ 14273]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
19 }
67fbd2ff4c4e [gaim-migrate @ 14273]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
20
67fbd2ff4c4e [gaim-migrate @ 14273]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
21 mono_runtime_object_init(obj);
67fbd2ff4c4e [gaim-migrate @ 14273]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
22
67fbd2ff4c4e [gaim-migrate @ 14273]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
23 ml_set_prop_string(obj, "Id", (char*)gaim_status_get_id(status));
67fbd2ff4c4e [gaim-migrate @ 14273]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
24
67fbd2ff4c4e [gaim-migrate @ 14273]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
25 return obj;
67fbd2ff4c4e [gaim-migrate @ 14273]
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
26 }