Mon, 17 Nov 2003 22:55:41 +0000
[gaim-migrate @ 8160]
false alarm, win32 isn't as dumb as it looks
|
1506
332172a38b21
[gaim-migrate @ 1516]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1047
diff
changeset
|
1 | version 0.11.0pre5: |
|
332172a38b21
[gaim-migrate @ 1516]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1047
diff
changeset
|
2 | The build process for plugins has changed slightly. Everything still |
|
332172a38b21
[gaim-migrate @ 1516]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1047
diff
changeset
|
3 | works more or less the same from a user point of view, that is, 'make |
|
332172a38b21
[gaim-migrate @ 1516]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1047
diff
changeset
|
4 | file.so' will still turn file.c into a plugin. The build now uses |
|
332172a38b21
[gaim-migrate @ 1516]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1047
diff
changeset
|
5 | libtool in an attempt to increase portability. By using libtool the |
|
332172a38b21
[gaim-migrate @ 1516]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1047
diff
changeset
|
6 | act of compiling and linking has been divided into two steps (to be |
|
332172a38b21
[gaim-migrate @ 1516]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1047
diff
changeset
|
7 | precise it always was two but we only called gcc once; now we call |
|
332172a38b21
[gaim-migrate @ 1516]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1047
diff
changeset
|
8 | libtool twice). PLUGIN_CFLAGS has also been added. Any -D switches you |
|
332172a38b21
[gaim-migrate @ 1516]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1047
diff
changeset
|
9 | were passing in PLUGIN_LIBS should be passed in PLUGIN_CFLAGS now. |
|
332172a38b21
[gaim-migrate @ 1516]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1047
diff
changeset
|
10 | |
|
332172a38b21
[gaim-migrate @ 1516]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1047
diff
changeset
|
11 | version 0.11.0pre1: |
|
1000
66436e94d53f
[gaim-migrate @ 1010]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
834
diff
changeset
|
12 | Gaim is now multi-connection based. This represents a significant |
|
66436e94d53f
[gaim-migrate @ 1010]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
834
diff
changeset
|
13 | change. Most of the code was modified, though most of the modifications |
|
66436e94d53f
[gaim-migrate @ 1010]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
834
diff
changeset
|
14 | were small (referencing an int as part of a struct as opposed to as a |
|
1047
783f8520d9a0
[gaim-migrate @ 1057]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1038
diff
changeset
|
15 | global int). Plugins need to be modified to match the new function |
|
783f8520d9a0
[gaim-migrate @ 1057]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1038
diff
changeset
|
16 | declarations and such. |
|
1000
66436e94d53f
[gaim-migrate @ 1010]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
834
diff
changeset
|
17 | |
|
1047
783f8520d9a0
[gaim-migrate @ 1057]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1038
diff
changeset
|
18 | Gaim now uses GModule from the GLib library for plugins. This brings |
|
783f8520d9a0
[gaim-migrate @ 1057]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1038
diff
changeset
|
19 | a few changes. gaim_plugin_init is now passed a GModule *, which it |
|
783f8520d9a0
[gaim-migrate @ 1057]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1038
diff
changeset
|
20 | should use for all of its callbacks. gaim_plugin_init now returns |
|
783f8520d9a0
[gaim-migrate @ 1057]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1038
diff
changeset
|
21 | char * instead of int instead of void. If gaim_plugin_init returns |
|
783f8520d9a0
[gaim-migrate @ 1057]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1038
diff
changeset
|
22 | NULL then gaim assumes everything was OK and proceeds. Otherwise, it |
|
783f8520d9a0
[gaim-migrate @ 1057]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1038
diff
changeset
|
23 | displays the error message and unloads your plugin. There is no more |
|
783f8520d9a0
[gaim-migrate @ 1057]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1038
diff
changeset
|
24 | gaim_plugin_error (at least, that gaim itself will use. You may wish |
|
783f8520d9a0
[gaim-migrate @ 1057]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1038
diff
changeset
|
25 | to simply return gaim_plugin_error() in gaim_plugin_init). |
|
783f8520d9a0
[gaim-migrate @ 1057]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1038
diff
changeset
|
26 | |
|
783f8520d9a0
[gaim-migrate @ 1057]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1038
diff
changeset
|
27 | Because gaim now uses GModule, plugins are opened with RTLD_GLOBAL. I |
|
783f8520d9a0
[gaim-migrate @ 1057]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1038
diff
changeset
|
28 | had previously wanted to avoid this, but there are simply too many |
|
783f8520d9a0
[gaim-migrate @ 1057]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1038
diff
changeset
|
29 | benefits gained from using GModule to reject it for this reason. This |
|
783f8520d9a0
[gaim-migrate @ 1057]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1038
diff
changeset
|
30 | means that plugins can now call each other's functions. Beware, this |
|
783f8520d9a0
[gaim-migrate @ 1057]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1038
diff
changeset
|
31 | has good and bad implications. If you call a function, it will look |
|
783f8520d9a0
[gaim-migrate @ 1057]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1038
diff
changeset
|
32 | first in your plugin, and then in gaim's global symbol table, including |
|
783f8520d9a0
[gaim-migrate @ 1057]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
1038
diff
changeset
|
33 | other plugins. |
|
1000
66436e94d53f
[gaim-migrate @ 1010]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
834
diff
changeset
|
34 | |
|
66436e94d53f
[gaim-migrate @ 1010]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
834
diff
changeset
|
35 | The new system allows for protocol plugins. New protocols (including |
|
66436e94d53f
[gaim-migrate @ 1010]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
834
diff
changeset
|
36 | Yahoo, MSN, IRC, ICQ, etc) can be loaded dynamically. However, most |
|
66436e94d53f
[gaim-migrate @ 1010]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
834
diff
changeset
|
37 | of these plugins are going to be controlled by the gaim maintainers. |
|
66436e94d53f
[gaim-migrate @ 1010]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
834
diff
changeset
|
38 | If you have interest in writing a protocol plugin, please talk to one |
|
66436e94d53f
[gaim-migrate @ 1010]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
834
diff
changeset
|
39 | of us before you start. |
|
66436e94d53f
[gaim-migrate @ 1010]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
834
diff
changeset
|
40 | |
|
2142
2e75e7a4423e
[gaim-migrate @ 2152]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2130
diff
changeset
|
41 | That's about all that I'm going to talk about. My SN is EWarmenhoven |
|
1000
66436e94d53f
[gaim-migrate @ 1010]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
834
diff
changeset
|
42 | if you have any questions (like what the hell struct gaim_connection is |
|
66436e94d53f
[gaim-migrate @ 1010]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
834
diff
changeset
|
43 | and what its relation to struct aim_user is). |
|
66436e94d53f
[gaim-migrate @ 1010]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
834
diff
changeset
|
44 | |
|
591
809e18bb0862
[gaim-migrate @ 601]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
445
diff
changeset
|
45 | version 0.10.0: |
|
809e18bb0862
[gaim-migrate @ 601]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
445
diff
changeset
|
46 | Rather than have a separate CFLAGS and LDFLAGS for the plugins than |
|
809e18bb0862
[gaim-migrate @ 601]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
445
diff
changeset
|
47 | for gaim, and doing all kinds of crazy things to work around the |
|
809e18bb0862
[gaim-migrate @ 601]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
445
diff
changeset
|
48 | problems that creates, the plugins now have the same CFLAGS and LIBS. |
|
809e18bb0862
[gaim-migrate @ 601]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
445
diff
changeset
|
49 | The plugins also have PLUGIN_LIBS which can be passed at make time. |
|
809e18bb0862
[gaim-migrate @ 601]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
445
diff
changeset
|
50 | This makes things like #ifdef USE_APPLET and #ifdef USE_PERL much more |
|
775
8950e039f4cf
[gaim-migrate @ 785]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
591
diff
changeset
|
51 | reliable. (#include "config.h" in order to get all the #defines) |
|
591
809e18bb0862
[gaim-migrate @ 601]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
445
diff
changeset
|
52 | |
|
780
0513afaaf062
[gaim-migrate @ 790]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
775
diff
changeset
|
53 | The internals of gaim plugin events got modified slightly. It should |
|
0513afaaf062
[gaim-migrate @ 790]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
775
diff
changeset
|
54 | have no effect on existing plugins or the way plugins are made. The |
|
0513afaaf062
[gaim-migrate @ 790]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
775
diff
changeset
|
55 | change was to make my life easier adding perl. It should also make |
|
0513afaaf062
[gaim-migrate @ 790]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
775
diff
changeset
|
56 | adding new plugin events even easier than before (though I doubt that |
|
834
11fe3931b832
[gaim-migrate @ 844]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
808
diff
changeset
|
57 | any more will ever be added). Also, events are printed to the debug |
|
11fe3931b832
[gaim-migrate @ 844]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
808
diff
changeset
|
58 | window. |
|
780
0513afaaf062
[gaim-migrate @ 790]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
775
diff
changeset
|
59 | |
|
0513afaaf062
[gaim-migrate @ 790]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
775
diff
changeset
|
60 | event_buddy_away was being triggered every blist_update for every away |
|
0513afaaf062
[gaim-migrate @ 790]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
775
diff
changeset
|
61 | buddy. This got fixed, but now when you sign on, event_buddy_away may |
|
0513afaaf062
[gaim-migrate @ 790]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
775
diff
changeset
|
62 | be called before event_buddy_signon. Not that it should matter much. |
|
0513afaaf062
[gaim-migrate @ 790]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
775
diff
changeset
|
63 | |
|
808
d628a65dc058
[gaim-migrate @ 818]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
780
diff
changeset
|
64 | Just after I finish saying that no more events will be added, I go and |
|
d628a65dc058
[gaim-migrate @ 818]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
780
diff
changeset
|
65 | add one. Go figure. Anyway, it's event_new_conversation. Enough people |
|
d628a65dc058
[gaim-migrate @ 818]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
780
diff
changeset
|
66 | asked me to add it, and I found it useful enough, that I finally did |
|
d628a65dc058
[gaim-migrate @ 818]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
780
diff
changeset
|
67 | add it. It gets passed a char *, the name of the person who the |
|
d628a65dc058
[gaim-migrate @ 818]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
780
diff
changeset
|
68 | conversation is with. This gets triggered when a new conversation |
|
d628a65dc058
[gaim-migrate @ 818]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
780
diff
changeset
|
69 | window is created, in case you couldn't figure it out on your own. |
|
d628a65dc058
[gaim-migrate @ 818]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
780
diff
changeset
|
70 | |
|
834
11fe3931b832
[gaim-migrate @ 844]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
808
diff
changeset
|
71 | event_blist_update wasn't being called if you weren't reporting idle |
|
11fe3931b832
[gaim-migrate @ 844]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
808
diff
changeset
|
72 | time or if you were idle. This got fixed. |
|
11fe3931b832
[gaim-migrate @ 844]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
808
diff
changeset
|
73 | |
| 391 | 74 | version 0.9.20: |
| 75 | It's 3 am the night before finals, it's obviously a good time to hack | |
| 76 | gaim. | |
| 77 | ||
|
425
bc3f0933ce54
[gaim-migrate @ 435]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
404
diff
changeset
|
78 | This became quite long, and if you don't want to read it all, here's |
|
bc3f0933ce54
[gaim-migrate @ 435]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
404
diff
changeset
|
79 | the important stuff summed up: |
|
bc3f0933ce54
[gaim-migrate @ 435]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
404
diff
changeset
|
80 | - 9 new events (see SIGNALS file for more details) |
|
bc3f0933ce54
[gaim-migrate @ 435]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
404
diff
changeset
|
81 | - int gaim_plugin_init(void *) (no longer returns void, see error.c) |
|
bc3f0933ce54
[gaim-migrate @ 435]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
404
diff
changeset
|
82 | - void gaim_plugin_unload(void *) (to allow plugin to remove itself) |
|
bc3f0933ce54
[gaim-migrate @ 435]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
404
diff
changeset
|
83 | - can only load 1 instance of the same plugin |
|
445
f7ef3b61a842
[gaim-migrate @ 455]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
425
diff
changeset
|
84 | - PLUGIN_LIBS for extra libraries for plugin |
|
425
bc3f0933ce54
[gaim-migrate @ 435]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
404
diff
changeset
|
85 | |
| 391 | 86 | The first thing to note is that there are about 9 new events plugins |
| 87 | can attach to, most of them dealing with chat, since I know that was a | |
| 88 | big thing that was missing. Please note that I was nice and decided to | |
| 89 | tack these extra events onto the end of the enum, which means that | |
| 90 | plugins do not have to be recompiled in order for them to still work. | |
| 91 | ||
|
425
bc3f0933ce54
[gaim-migrate @ 435]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
404
diff
changeset
|
92 | The big change is that gaim_plugin_init no longer returns void, but |
|
bc3f0933ce54
[gaim-migrate @ 435]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
404
diff
changeset
|
93 | int. If it returns 0+, gaim interprets this as there being no error, |
|
bc3f0933ce54
[gaim-migrate @ 435]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
404
diff
changeset
|
94 | and continues with loading as normal. (This should be backwards- |
|
398
c426f81e75ce
[gaim-migrate @ 408]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
394
diff
changeset
|
95 | compatible: returning 0/1 is the equivalent of returning void.) If it |
|
c426f81e75ce
[gaim-migrate @ 408]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
394
diff
changeset
|
96 | returns a number less than 0, there was an error loading detected by |
|
394
1f5ad5c7ab1b
[gaim-migrate @ 404]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
392
diff
changeset
|
97 | the plugin. At that point, gaim will try to clean things up by removing |
|
1f5ad5c7ab1b
[gaim-migrate @ 404]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
392
diff
changeset
|
98 | any callbacks that have been added by the plugin. It will then try to |
|
1f5ad5c7ab1b
[gaim-migrate @ 404]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
392
diff
changeset
|
99 | call the plugin's gaim_plugin_error function, if there is one. The |
|
1f5ad5c7ab1b
[gaim-migrate @ 404]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
392
diff
changeset
|
100 | function should take an int (the int returned by gaim_plugin_init) and |
|
1f5ad5c7ab1b
[gaim-migrate @ 404]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
392
diff
changeset
|
101 | return a char*. If the char* is not NULL, it is displayed by gaim as an |
|
1f5ad5c7ab1b
[gaim-migrate @ 404]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
392
diff
changeset
|
102 | error message. The plugin is then unloaded and closed and life goes |
|
1f5ad5c7ab1b
[gaim-migrate @ 404]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
392
diff
changeset
|
103 | back to normal. If any of that was confusing, it was confusing to me, |
|
1f5ad5c7ab1b
[gaim-migrate @ 404]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
392
diff
changeset
|
104 | too. I added a plugin, error.c, which should help clear things up. |
|
392
d3edc6236c3f
[gaim-migrate @ 402]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
391
diff
changeset
|
105 | |
|
425
bc3f0933ce54
[gaim-migrate @ 435]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
404
diff
changeset
|
106 | Another big thing to note is that plugins can unload themselves. A good |
|
bc3f0933ce54
[gaim-migrate @ 435]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
404
diff
changeset
|
107 | example of why this is useful is a ticker plugin. If the user closes |
|
bc3f0933ce54
[gaim-migrate @ 435]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
404
diff
changeset
|
108 | the ticker window, they obviously want the plugin to be unloaded. Gaim |
|
bc3f0933ce54
[gaim-migrate @ 435]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
404
diff
changeset
|
109 | has no way of knowing that; therefore, the plugin must tell gaim that |
|
bc3f0933ce54
[gaim-migrate @ 435]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
404
diff
changeset
|
110 | it is to be unloaded. To have a plugin unload itself, simply call |
|
bc3f0933ce54
[gaim-migrate @ 435]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
404
diff
changeset
|
111 | gaim_plugin_unload(void *) (the void* is the handle passed to |
|
bc3f0933ce54
[gaim-migrate @ 435]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
404
diff
changeset
|
112 | gaim_plugin_init). Because you are explicitly asking to be removed, |
|
bc3f0933ce54
[gaim-migrate @ 435]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
404
diff
changeset
|
113 | gaim assumes that you have done any cleanup already, and so does not |
|
bc3f0933ce54
[gaim-migrate @ 435]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
404
diff
changeset
|
114 | call gaim_plugin_remove. Rather, it simply removes your callbacks and |
|
bc3f0933ce54
[gaim-migrate @ 435]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
404
diff
changeset
|
115 | unloads the plugin. (There is some trickery to this. Think about it: |
|
bc3f0933ce54
[gaim-migrate @ 435]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
404
diff
changeset
|
116 | your plugin calls the function, your plugin is unloaded, and execution |
|
bc3f0933ce54
[gaim-migrate @ 435]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
404
diff
changeset
|
117 | returns to your plugin, which no longer exists. This would cause a |
|
bc3f0933ce54
[gaim-migrate @ 435]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
404
diff
changeset
|
118 | segfault if it behaved exactly as described. Instead, the plugin is |
|
bc3f0933ce54
[gaim-migrate @ 435]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
404
diff
changeset
|
119 | removed from the list of plugins, and removed 5 seconds later. By then |
|
bc3f0933ce54
[gaim-migrate @ 435]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
404
diff
changeset
|
120 | the plugin should be effectively gone, though still in memory.) |
|
bc3f0933ce54
[gaim-migrate @ 435]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
404
diff
changeset
|
121 | |
|
bc3f0933ce54
[gaim-migrate @ 435]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
404
diff
changeset
|
122 | In previous versions of gaim, you could load multiple copies of the |
|
bc3f0933ce54
[gaim-migrate @ 435]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
404
diff
changeset
|
123 | same plugin. This is no longer the case. The reason for this was that |
|
bc3f0933ce54
[gaim-migrate @ 435]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
404
diff
changeset
|
124 | there were not two instances of the plugin in memory; rather, one copy |
|
bc3f0933ce54
[gaim-migrate @ 435]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
404
diff
changeset
|
125 | and two structures representing the same plugin. Then, the callbacks |
|
bc3f0933ce54
[gaim-migrate @ 435]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
404
diff
changeset
|
126 | would be called twice (since the plugin would most likely act the same |
|
bc3f0933ce54
[gaim-migrate @ 435]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
404
diff
changeset
|
127 | across multiple instances), and when one was unloaded, all callbacks |
|
bc3f0933ce54
[gaim-migrate @ 435]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
404
diff
changeset
|
128 | for both instances would be removed. Rather than deal with two copies |
|
bc3f0933ce54
[gaim-migrate @ 435]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
404
diff
changeset
|
129 | of the same plugin, it is easier and cleaner to only handle one. |
|
bc3f0933ce54
[gaim-migrate @ 435]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
404
diff
changeset
|
130 | |
|
445
f7ef3b61a842
[gaim-migrate @ 455]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
425
diff
changeset
|
131 | Sometimes it's necessary to link a plugin with libraries other than the |
|
f7ef3b61a842
[gaim-migrate @ 455]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
425
diff
changeset
|
132 | ones needed for GTK. Before, it was necessary to modify the Makefile to |
|
f7ef3b61a842
[gaim-migrate @ 455]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
425
diff
changeset
|
133 | do so (which was usually messy since it's generated by GNU automake). |
|
f7ef3b61a842
[gaim-migrate @ 455]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
425
diff
changeset
|
134 | Now, you can simply set the environment variable PLUGIN_LIBS to be the |
|
f7ef3b61a842
[gaim-migrate @ 455]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
425
diff
changeset
|
135 | extra libraries you want to link in. For example, to link plugin.c with |
|
f7ef3b61a842
[gaim-migrate @ 455]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
425
diff
changeset
|
136 | the math library, you can run the command |
|
f7ef3b61a842
[gaim-migrate @ 455]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
425
diff
changeset
|
137 | PLUGIN_LIBS=-lm make plugin.so |
|
f7ef3b61a842
[gaim-migrate @ 455]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
425
diff
changeset
|
138 | To link with multiple plugins, make sure to indicate spaces, e.g. |
|
f7ef3b61a842
[gaim-migrate @ 455]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
425
diff
changeset
|
139 | PLUGIN_LIBS='-lm -lcrypt' make encrypt.so |
|
f7ef3b61a842
[gaim-migrate @ 455]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
425
diff
changeset
|
140 | |
|
392
d3edc6236c3f
[gaim-migrate @ 402]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
391
diff
changeset
|
141 | There is a new event, event_quit, which signifies that gaim has exited |
|
d3edc6236c3f
[gaim-migrate @ 402]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
391
diff
changeset
|
142 | correctly (i.e. didn't segfault). Also, after this event is called, all |
|
404
0881630e6d25
[gaim-migrate @ 414]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
398
diff
changeset
|
143 | plugins are removed, and their gaim_plugin_remove function is called. |
|
392
d3edc6236c3f
[gaim-migrate @ 402]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
391
diff
changeset
|
144 | This behavior is different from previous versions; however, it is the |
|
d3edc6236c3f
[gaim-migrate @ 402]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
391
diff
changeset
|
145 | proper way of doing things, and should have no effect on current |
|
d3edc6236c3f
[gaim-migrate @ 402]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
391
diff
changeset
|
146 | plugins. The reason event_quit exists despite plugins being removed at |
|
d3edc6236c3f
[gaim-migrate @ 402]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
391
diff
changeset
|
147 | quit is because a plugin can be removed without gaim quitting. They are |
|
d3edc6236c3f
[gaim-migrate @ 402]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
391
diff
changeset
|
148 | distinctly separate events. |
|
d3edc6236c3f
[gaim-migrate @ 402]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
391
diff
changeset
|
149 | |
|
d3edc6236c3f
[gaim-migrate @ 402]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
391
diff
changeset
|
150 | The new events mean that some versions of gaim have certain events, |
|
d3edc6236c3f
[gaim-migrate @ 402]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
391
diff
changeset
|
151 | others don't. The thing I find fascinating though is that even if a |
|
d3edc6236c3f
[gaim-migrate @ 402]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
391
diff
changeset
|
152 | plugin is compiled for a later version, it will still be backwards- |
|
d3edc6236c3f
[gaim-migrate @ 402]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
391
diff
changeset
|
153 | compatible, even if it makes use of the newer events. The reason why |
|
d3edc6236c3f
[gaim-migrate @ 402]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
391
diff
changeset
|
154 | is the names of the events are stored as integers, and those integers |
|
d3edc6236c3f
[gaim-migrate @ 402]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
391
diff
changeset
|
155 | will never match an event in a prior version. This means you don't |
|
d3edc6236c3f
[gaim-migrate @ 402]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
391
diff
changeset
|
156 | have to worry about which version the person is using, only which |
|
d3edc6236c3f
[gaim-migrate @ 402]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
391
diff
changeset
|
157 | version the person is compiling against. For simplicity's sake, please |
|
d3edc6236c3f
[gaim-migrate @ 402]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
391
diff
changeset
|
158 | assume people are compiling against the latest version. For |
|
d3edc6236c3f
[gaim-migrate @ 402]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
391
diff
changeset
|
159 | practicality's sake, VERSION is #define'd to be the version you're |
|
d3edc6236c3f
[gaim-migrate @ 402]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
391
diff
changeset
|
160 | compiling against, starting with 0.9.20. Prior versions do not have |
|
d3edc6236c3f
[gaim-migrate @ 402]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
391
diff
changeset
|
161 | this defined in the standard plugin Makefile. |