Mercurial > pidgin.yaz
annotate src/core.h @ 8261:7b57c3bd9db6
[gaim-migrate @ 8984]
In the great words of my colleague Tim: "Oops"
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Sun, 15 Feb 2004 08:51:32 +0000 |
parents | fa6395637e2c |
children | f24172f53650 |
rev | line source |
---|---|
5034
4691c5936c01
[gaim-migrate @ 5377]
Christian Hammond <chipx86@chipx86.com>
parents:
5032
diff
changeset
|
1 /** |
6179
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
2 * @file core.h Gaim Core API |
5034
4691c5936c01
[gaim-migrate @ 5377]
Christian Hammond <chipx86@chipx86.com>
parents:
5032
diff
changeset
|
3 * @defgroup core Gaim Core |
4691c5936c01
[gaim-migrate @ 5377]
Christian Hammond <chipx86@chipx86.com>
parents:
5032
diff
changeset
|
4 * |
2417 | 5 * gaim |
6 * | |
8046 | 7 * Gaim is the legal property of its developers, whose names are too numerous |
8 * to list here. Please refer to the COPYRIGHT file distributed with this | |
9 * source distribution. | |
6612
0f78db521e70
[gaim-migrate @ 7136]
Christian Hammond <chipx86@chipx86.com>
parents:
6314
diff
changeset
|
10 * |
2417 | 11 * This program is free software; you can redistribute it and/or modify |
12 * it under the terms of the GNU General Public License as published by | |
13 * the Free Software Foundation; either version 2 of the License, or | |
14 * (at your option) any later version. | |
15 * | |
16 * This program is distributed in the hope that it will be useful, | |
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 * GNU General Public License for more details. | |
20 * | |
21 * You should have received a copy of the GNU General Public License | |
22 * along with this program; if not, write to the Free Software | |
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
24 */ | |
6179
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
25 #ifndef _GAIM_CORE_H_ |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
26 #define _GAIM_CORE_H_ |
2417 | 27 |
6179
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
28 typedef struct GaimCore GaimCore; |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
29 |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
30 typedef struct |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
31 { |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
32 void (*ui_prefs_init)(void); |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
33 void (*debug_ui_init)(void); /* Unfortunate necessity. */ |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
34 void (*ui_init)(void); |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
35 void (*quit)(void); |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
36 |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
37 } GaimCoreUiOps; |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
38 |
6314
2d3c3a0cb7b1
[gaim-migrate @ 6813]
Christian Hammond <chipx86@chipx86.com>
parents:
6182
diff
changeset
|
39 #ifdef __cplusplus |
2d3c3a0cb7b1
[gaim-migrate @ 6813]
Christian Hammond <chipx86@chipx86.com>
parents:
6182
diff
changeset
|
40 extern "C" { |
2d3c3a0cb7b1
[gaim-migrate @ 6813]
Christian Hammond <chipx86@chipx86.com>
parents:
6182
diff
changeset
|
41 #endif |
2d3c3a0cb7b1
[gaim-migrate @ 6813]
Christian Hammond <chipx86@chipx86.com>
parents:
6182
diff
changeset
|
42 |
6179
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
43 /** |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
44 * Initializes the core of gaim. |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
45 * |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
46 * This will setup preferences for all the core subsystems. |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
47 * |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
48 * @param ui The ID of the UI using the core. This should be a |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
49 * unique ID, registered with the gaim team. |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
50 * |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
51 * @return @c TRUE if successful, or @c FALSE otherwise. |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
52 */ |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
53 gboolean gaim_core_init(const char *ui); |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
54 |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
55 /** |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
56 * Quits the core of gaim, which, depending on the UI, may quit the |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
57 * application using the gaim core. |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
58 */ |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
59 void gaim_core_quit(void); |
2417 | 60 |
6179
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
61 /** |
7646 | 62 * Calls gaim_core_quit(). This can be used as the function |
63 * passed to g_timeout_add() when you want to shutdown Gaim | |
64 * in a specified amount of time. When shutting down Gaim | |
65 * from a plugin, you must use this with a timeout value of 0: | |
66 * g_timeout_add(0, gaim_core_quitcb, NULL); | |
67 * This is ensures that code from your plugin is not being | |
68 * executed when gaim_core_quit() is called. Otherwise you | |
69 * would get a core dump after gaim_core_quit() executes and | |
70 * control returns to your plugin because gaim_core_quit() frees | |
71 * all plugins. | |
72 */ | |
73 gboolean gaim_core_quit_cb(gpointer unused); | |
74 | |
75 /** | |
6612
0f78db521e70
[gaim-migrate @ 7136]
Christian Hammond <chipx86@chipx86.com>
parents:
6314
diff
changeset
|
76 * Returns the version of the core library. |
0f78db521e70
[gaim-migrate @ 7136]
Christian Hammond <chipx86@chipx86.com>
parents:
6314
diff
changeset
|
77 * |
0f78db521e70
[gaim-migrate @ 7136]
Christian Hammond <chipx86@chipx86.com>
parents:
6314
diff
changeset
|
78 * @return The version of the core library. |
0f78db521e70
[gaim-migrate @ 7136]
Christian Hammond <chipx86@chipx86.com>
parents:
6314
diff
changeset
|
79 */ |
0f78db521e70
[gaim-migrate @ 7136]
Christian Hammond <chipx86@chipx86.com>
parents:
6314
diff
changeset
|
80 const char *gaim_core_get_version(void); |
0f78db521e70
[gaim-migrate @ 7136]
Christian Hammond <chipx86@chipx86.com>
parents:
6314
diff
changeset
|
81 |
0f78db521e70
[gaim-migrate @ 7136]
Christian Hammond <chipx86@chipx86.com>
parents:
6314
diff
changeset
|
82 /** |
7082
25a616f16b6c
[gaim-migrate @ 7647]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
83 * Returns whether or not there are any mainloop events pending. |
25a616f16b6c
[gaim-migrate @ 7647]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
84 * |
25a616f16b6c
[gaim-migrate @ 7647]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
85 * @return TRUE if there are mainloop events pending. FALSE otherwise. |
25a616f16b6c
[gaim-migrate @ 7647]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
86 */ |
25a616f16b6c
[gaim-migrate @ 7647]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
87 gboolean gaim_core_mainloop_events_pending(void); |
25a616f16b6c
[gaim-migrate @ 7647]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
88 |
25a616f16b6c
[gaim-migrate @ 7647]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
89 /** |
6182
0342af6a8b36
[gaim-migrate @ 6668]
Christian Hammond <chipx86@chipx86.com>
parents:
6179
diff
changeset
|
90 * Iterates once through the gaim mainloop. |
0342af6a8b36
[gaim-migrate @ 6668]
Christian Hammond <chipx86@chipx86.com>
parents:
6179
diff
changeset
|
91 * |
0342af6a8b36
[gaim-migrate @ 6668]
Christian Hammond <chipx86@chipx86.com>
parents:
6179
diff
changeset
|
92 * This is in actuality a wrapper around glib's mainloop iteration |
0342af6a8b36
[gaim-migrate @ 6668]
Christian Hammond <chipx86@chipx86.com>
parents:
6179
diff
changeset
|
93 * function, but provides a nice, healthy level of abstraction. |
0342af6a8b36
[gaim-migrate @ 6668]
Christian Hammond <chipx86@chipx86.com>
parents:
6179
diff
changeset
|
94 * |
0342af6a8b36
[gaim-migrate @ 6668]
Christian Hammond <chipx86@chipx86.com>
parents:
6179
diff
changeset
|
95 * All UIs not using glib must call this in a timer. |
0342af6a8b36
[gaim-migrate @ 6668]
Christian Hammond <chipx86@chipx86.com>
parents:
6179
diff
changeset
|
96 */ |
0342af6a8b36
[gaim-migrate @ 6668]
Christian Hammond <chipx86@chipx86.com>
parents:
6179
diff
changeset
|
97 void gaim_core_mainloop_iteration(void); |
0342af6a8b36
[gaim-migrate @ 6668]
Christian Hammond <chipx86@chipx86.com>
parents:
6179
diff
changeset
|
98 |
0342af6a8b36
[gaim-migrate @ 6668]
Christian Hammond <chipx86@chipx86.com>
parents:
6179
diff
changeset
|
99 /** |
7082
25a616f16b6c
[gaim-migrate @ 7647]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
100 * Iterates through all remaining events in the mainloop. |
25a616f16b6c
[gaim-migrate @ 7647]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
101 */ |
25a616f16b6c
[gaim-migrate @ 7647]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
102 void gaim_core_mainloop_finish_events(void); |
25a616f16b6c
[gaim-migrate @ 7647]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
103 |
25a616f16b6c
[gaim-migrate @ 7647]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
104 /** |
6179
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
105 * Returns the ID of the UI that is using the core. |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
106 * |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
107 * @return The ID of the UI that is currently using the core. |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
108 */ |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
109 const char *gaim_core_get_ui(void); |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
110 |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
111 /** |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
112 * Returns a handle to the gaim core. |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
113 * |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
114 * This is used for such things as signals. |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
115 */ |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
116 GaimCore *gaim_get_core(void); |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
117 |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
118 /** |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
119 * Sets the UI ops for the core. |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
120 * |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
121 * @param A UI ops structure for the core. |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
122 */ |
7035
feb3d21a7794
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6612
diff
changeset
|
123 void gaim_core_set_ui_ops(GaimCoreUiOps *ops); |
6179
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
124 |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
125 /** |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
126 * Returns the UI ops for the core. |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
127 * |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
128 * @return The core's UI ops structure. |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
129 */ |
7035
feb3d21a7794
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6612
diff
changeset
|
130 GaimCoreUiOps *gaim_core_get_ui_ops(void); |
6179
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
131 |
6314
2d3c3a0cb7b1
[gaim-migrate @ 6813]
Christian Hammond <chipx86@chipx86.com>
parents:
6182
diff
changeset
|
132 #ifdef __cplusplus |
2d3c3a0cb7b1
[gaim-migrate @ 6813]
Christian Hammond <chipx86@chipx86.com>
parents:
6182
diff
changeset
|
133 } |
2d3c3a0cb7b1
[gaim-migrate @ 6813]
Christian Hammond <chipx86@chipx86.com>
parents:
6182
diff
changeset
|
134 #endif |
2d3c3a0cb7b1
[gaim-migrate @ 6813]
Christian Hammond <chipx86@chipx86.com>
parents:
6182
diff
changeset
|
135 |
6179
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
136 #endif /* _GAIM_CORE_H_ */ |
5862 | 137 |
138 /* | |
139 | |
140 /===- | |
141 `//"\\ """"`---.___.-"" | |
142 ______-==| | | \\ _-"` | |
143 __--""" ,-/-==\\ | | `\ ,' | |
144 _-" /' | \\ ___ / / \ / | |
145 .' / | \\ /" "\ /' / \ /' | |
6169
0a210d84d9d7
[gaim-migrate @ 6652]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
146 / ____ / | \`\.__/-"" D O \_/' / \/' |
0a210d84d9d7
[gaim-migrate @ 6652]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
147 /-'" """""---__ | "-/" O G R /' _--"` |
6179
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
148 \_| / R __--_ t ), __--"" |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
149 '""--_/ T _-"_>--<_\ h '-" \ |
16e384bb7fbf
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
150 {\__--_/} / \\__>--<__\ e B \ |
6169
0a210d84d9d7
[gaim-migrate @ 6652]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
151 /' (_/ _-" | |__>--<__| U | |
0a210d84d9d7
[gaim-migrate @ 6652]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
152 | _/) )-" | |__>--<__| R | |
0a210d84d9d7
[gaim-migrate @ 6652]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
153 / /" ,_/ / /__>---<__/ N | |
0a210d84d9d7
[gaim-migrate @ 6652]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
154 o-o _// /-"_>---<__-" I / |
0a210d84d9d7
[gaim-migrate @ 6652]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
155 (^(" /"_>---<__- N _-" |
0a210d84d9d7
[gaim-migrate @ 6652]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
156 ,/| /__>--<__/ A _-" |
0a210d84d9d7
[gaim-migrate @ 6652]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
157 ,//('( |__>--<__| T / .----_ |
5862 | 158 ( ( ')) |__>--<__| | /' _---_"\ |
6169
0a210d84d9d7
[gaim-migrate @ 6652]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
159 `-)) )) ( |__>--<__| O | /' / "\`\ |
0a210d84d9d7
[gaim-migrate @ 6652]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
160 ,/,'//( ( \__>--<__\ R \ /' // || |
5862 | 161 ,( ( ((, )) "-__>--<_"-_ "--____---"' _/'/ /' |
162 `"/ )` ) ,/| "-_">--<_/-__ __-" _/ | |
163 ._-"//( )/ )) ` ""-'_/_/ /"""""""__--" | |
164 ;'( ')/ ,)( """""""""" | |
165 ' ') '( (/ | |
166 ' ' ` | |
167 | |
168 */ |