Mercurial > pidgin.yaz
annotate libpurple/plugins/mono/api/PurplePlugin.cs @ 15877:80ee585fb53c
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.
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Sat, 24 Mar 2007 06:24:59 +0000 |
parents | |
children |
rev | line source |
---|---|
15877
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
1 namespace Purple { |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
2 public class PluginInfo { |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
3 private string id; |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
4 private string name; |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
5 private string version; |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
6 private string summary; |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
7 private string description; |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
8 private string author; |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
9 private string homepage; |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
10 |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
11 public PluginInfo(string id, string name, string version, string summary, |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
12 string description, string author, string homepage) |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
13 { |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
14 this.id = id; |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
15 this.name = name; |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
16 this.version = version; |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
17 this.summary = summary; |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
18 this.description = description; |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
19 this.author = author; |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
20 this.homepage = homepage; |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
21 } |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
22 |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
23 public string Id { |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
24 get { return id; } |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
25 } |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
26 |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
27 public string Name { |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
28 get { return name; } |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
29 } |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
30 |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
31 public string Version { |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
32 get { return version; } |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
33 } |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
34 |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
35 public string Summary { |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
36 get { return summary; } |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
37 } |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
38 |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
39 public string Description { |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
40 get { return description; } |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
41 } |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
42 |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
43 public string Author { |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
44 get { return author; } |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
45 } |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
46 |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
47 public string Homepage { |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
48 get { return homepage; } |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
49 } |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
50 } |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
51 |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
52 abstract public class Plugin { |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
53 private PluginInfo info; |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
54 |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
55 public Plugin(PluginInfo info) { |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
56 this.info = info; |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
57 } |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
58 |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
59 public abstract void Load(); |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
60 public abstract void Unload(); |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
61 public abstract void Destroy(); |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
62 |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
63 public PluginInfo Info { |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
64 get { return info; } |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
65 } |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
66 } |
80ee585fb53c
SF Patch #1686400 from Eoin Coffey ("ecoffey")
Richard Laager <rlaager@wiktel.com>
parents:
diff
changeset
|
67 } |