Sun, 26 Oct 2003 04:51:09 +0000
[gaim-migrate @ 7920]
fix crash on jabber invite
|
5034
077678f7b048
[gaim-migrate @ 5377]
Christian Hammond <chipx86@chipx86.com>
parents:
5032
diff
changeset
|
1 | /** |
|
6179
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
2 | * @file core.h Gaim Core API |
|
5034
077678f7b048
[gaim-migrate @ 5377]
Christian Hammond <chipx86@chipx86.com>
parents:
5032
diff
changeset
|
3 | * @defgroup core Gaim Core |
|
077678f7b048
[gaim-migrate @ 5377]
Christian Hammond <chipx86@chipx86.com>
parents:
5032
diff
changeset
|
4 | * |
| 2417 | 5 | * gaim |
| 6 | * | |
|
6179
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
7 | * Copyright (C) 2003 Christian Hammond <chipx86@gnupdate.org> |
|
6612
aac6af649208
[gaim-migrate @ 7136]
Christian Hammond <chipx86@chipx86.com>
parents:
6314
diff
changeset
|
8 | * |
| 2417 | 9 | * This program is free software; you can redistribute it and/or modify |
| 10 | * it under the terms of the GNU General Public License as published by | |
| 11 | * the Free Software Foundation; either version 2 of the License, or | |
| 12 | * (at your option) any later version. | |
| 13 | * | |
| 14 | * This program is distributed in the hope that it will be useful, | |
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 17 | * GNU General Public License for more details. | |
| 18 | * | |
| 19 | * You should have received a copy of the GNU General Public License | |
| 20 | * along with this program; if not, write to the Free Software | |
| 21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 22 | */ | |
|
6179
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
23 | #ifndef _GAIM_CORE_H_ |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
24 | #define _GAIM_CORE_H_ |
| 2417 | 25 | |
|
6179
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
26 | typedef struct GaimCore GaimCore; |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
27 | |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
28 | typedef struct |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
29 | { |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
30 | void (*ui_prefs_init)(void); |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
31 | void (*debug_ui_init)(void); /* Unfortunate necessity. */ |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
32 | void (*ui_init)(void); |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
33 | void (*quit)(void); |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
34 | |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
35 | } GaimCoreUiOps; |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
36 | |
|
6314
25bba03c42cd
[gaim-migrate @ 6813]
Christian Hammond <chipx86@chipx86.com>
parents:
6182
diff
changeset
|
37 | #ifdef __cplusplus |
|
25bba03c42cd
[gaim-migrate @ 6813]
Christian Hammond <chipx86@chipx86.com>
parents:
6182
diff
changeset
|
38 | extern "C" { |
|
25bba03c42cd
[gaim-migrate @ 6813]
Christian Hammond <chipx86@chipx86.com>
parents:
6182
diff
changeset
|
39 | #endif |
|
25bba03c42cd
[gaim-migrate @ 6813]
Christian Hammond <chipx86@chipx86.com>
parents:
6182
diff
changeset
|
40 | |
|
6179
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
41 | /** |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
42 | * Initializes the core of gaim. |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
43 | * |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
44 | * This will setup preferences for all the core subsystems. |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
45 | * |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
46 | * @param ui The ID of the UI using the core. This should be a |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
47 | * unique ID, registered with the gaim team. |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
48 | * |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
49 | * @return @c TRUE if successful, or @c FALSE otherwise. |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
50 | */ |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
51 | gboolean gaim_core_init(const char *ui); |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
52 | |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
53 | /** |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
54 | * Quits the core of gaim, which, depending on the UI, may quit the |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
55 | * application using the gaim core. |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
56 | */ |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
57 | void gaim_core_quit(void); |
| 2417 | 58 | |
|
6179
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
59 | /** |
|
6612
aac6af649208
[gaim-migrate @ 7136]
Christian Hammond <chipx86@chipx86.com>
parents:
6314
diff
changeset
|
60 | * Returns the version of the core library. |
|
aac6af649208
[gaim-migrate @ 7136]
Christian Hammond <chipx86@chipx86.com>
parents:
6314
diff
changeset
|
61 | * |
|
aac6af649208
[gaim-migrate @ 7136]
Christian Hammond <chipx86@chipx86.com>
parents:
6314
diff
changeset
|
62 | * @return The version of the core library. |
|
aac6af649208
[gaim-migrate @ 7136]
Christian Hammond <chipx86@chipx86.com>
parents:
6314
diff
changeset
|
63 | */ |
|
aac6af649208
[gaim-migrate @ 7136]
Christian Hammond <chipx86@chipx86.com>
parents:
6314
diff
changeset
|
64 | const char *gaim_core_get_version(void); |
|
aac6af649208
[gaim-migrate @ 7136]
Christian Hammond <chipx86@chipx86.com>
parents:
6314
diff
changeset
|
65 | |
|
aac6af649208
[gaim-migrate @ 7136]
Christian Hammond <chipx86@chipx86.com>
parents:
6314
diff
changeset
|
66 | /** |
|
7082
d91bf4612a31
[gaim-migrate @ 7647]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
67 | * Returns whether or not there are any mainloop events pending. |
|
d91bf4612a31
[gaim-migrate @ 7647]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
68 | * |
|
d91bf4612a31
[gaim-migrate @ 7647]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
69 | * @return TRUE if there are mainloop events pending. FALSE otherwise. |
|
d91bf4612a31
[gaim-migrate @ 7647]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
70 | */ |
|
d91bf4612a31
[gaim-migrate @ 7647]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
71 | gboolean gaim_core_mainloop_events_pending(void); |
|
d91bf4612a31
[gaim-migrate @ 7647]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
72 | |
|
d91bf4612a31
[gaim-migrate @ 7647]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
73 | /** |
|
6182
d9f28eca828a
[gaim-migrate @ 6668]
Christian Hammond <chipx86@chipx86.com>
parents:
6179
diff
changeset
|
74 | * Iterates once through the gaim mainloop. |
|
d9f28eca828a
[gaim-migrate @ 6668]
Christian Hammond <chipx86@chipx86.com>
parents:
6179
diff
changeset
|
75 | * |
|
d9f28eca828a
[gaim-migrate @ 6668]
Christian Hammond <chipx86@chipx86.com>
parents:
6179
diff
changeset
|
76 | * This is in actuality a wrapper around glib's mainloop iteration |
|
d9f28eca828a
[gaim-migrate @ 6668]
Christian Hammond <chipx86@chipx86.com>
parents:
6179
diff
changeset
|
77 | * function, but provides a nice, healthy level of abstraction. |
|
d9f28eca828a
[gaim-migrate @ 6668]
Christian Hammond <chipx86@chipx86.com>
parents:
6179
diff
changeset
|
78 | * |
|
d9f28eca828a
[gaim-migrate @ 6668]
Christian Hammond <chipx86@chipx86.com>
parents:
6179
diff
changeset
|
79 | * All UIs not using glib must call this in a timer. |
|
d9f28eca828a
[gaim-migrate @ 6668]
Christian Hammond <chipx86@chipx86.com>
parents:
6179
diff
changeset
|
80 | */ |
|
d9f28eca828a
[gaim-migrate @ 6668]
Christian Hammond <chipx86@chipx86.com>
parents:
6179
diff
changeset
|
81 | void gaim_core_mainloop_iteration(void); |
|
d9f28eca828a
[gaim-migrate @ 6668]
Christian Hammond <chipx86@chipx86.com>
parents:
6179
diff
changeset
|
82 | |
|
d9f28eca828a
[gaim-migrate @ 6668]
Christian Hammond <chipx86@chipx86.com>
parents:
6179
diff
changeset
|
83 | /** |
|
7082
d91bf4612a31
[gaim-migrate @ 7647]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
84 | * Iterates through all remaining events in the mainloop. |
|
d91bf4612a31
[gaim-migrate @ 7647]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
85 | */ |
|
d91bf4612a31
[gaim-migrate @ 7647]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
86 | void gaim_core_mainloop_finish_events(void); |
|
d91bf4612a31
[gaim-migrate @ 7647]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
87 | |
|
d91bf4612a31
[gaim-migrate @ 7647]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
88 | /** |
|
6179
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
89 | * Returns the ID of the UI that is using the core. |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
90 | * |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
91 | * @return The ID of the UI that is currently using the core. |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
92 | */ |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
93 | const char *gaim_core_get_ui(void); |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
94 | |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
95 | /** |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
96 | * Returns a handle to the gaim core. |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
97 | * |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
98 | * This is used for such things as signals. |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
99 | */ |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
100 | GaimCore *gaim_get_core(void); |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
101 | |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
102 | /** |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
103 | * Sets the UI ops for the core. |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
104 | * |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
105 | * @param A UI ops structure for the core. |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
106 | */ |
|
7035
76bca80cd91d
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6612
diff
changeset
|
107 | void gaim_core_set_ui_ops(GaimCoreUiOps *ops); |
|
6179
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
108 | |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
109 | /** |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
110 | * Returns the UI ops for the core. |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
111 | * |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
112 | * @return The core's UI ops structure. |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
113 | */ |
|
7035
76bca80cd91d
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6612
diff
changeset
|
114 | GaimCoreUiOps *gaim_core_get_ui_ops(void); |
|
6179
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
115 | |
|
6314
25bba03c42cd
[gaim-migrate @ 6813]
Christian Hammond <chipx86@chipx86.com>
parents:
6182
diff
changeset
|
116 | #ifdef __cplusplus |
|
25bba03c42cd
[gaim-migrate @ 6813]
Christian Hammond <chipx86@chipx86.com>
parents:
6182
diff
changeset
|
117 | } |
|
25bba03c42cd
[gaim-migrate @ 6813]
Christian Hammond <chipx86@chipx86.com>
parents:
6182
diff
changeset
|
118 | #endif |
|
25bba03c42cd
[gaim-migrate @ 6813]
Christian Hammond <chipx86@chipx86.com>
parents:
6182
diff
changeset
|
119 | |
|
6179
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
120 | #endif /* _GAIM_CORE_H_ */ |
| 5862 | 121 | |
| 122 | /* | |
| 123 | ||
| 124 | /===- | |
| 125 | `//"\\ """"`---.___.-"" | |
| 126 | ______-==| | | \\ _-"` | |
| 127 | __--""" ,-/-==\\ | | `\ ,' | |
| 128 | _-" /' | \\ ___ / / \ / | |
| 129 | .' / | \\ /" "\ /' / \ /' | |
|
6169
d23c0f0228ae
[gaim-migrate @ 6652]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
130 | / ____ / | \`\.__/-"" D O \_/' / \/' |
|
d23c0f0228ae
[gaim-migrate @ 6652]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
131 | /-'" """""---__ | "-/" O G R /' _--"` |
|
6179
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
132 | \_| / R __--_ t ), __--"" |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
133 | '""--_/ T _-"_>--<_\ h '-" \ |
|
4df73df94250
[gaim-migrate @ 6664]
Christian Hammond <chipx86@chipx86.com>
parents:
6169
diff
changeset
|
134 | {\__--_/} / \\__>--<__\ e B \ |
|
6169
d23c0f0228ae
[gaim-migrate @ 6652]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
135 | /' (_/ _-" | |__>--<__| U | |
|
d23c0f0228ae
[gaim-migrate @ 6652]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
136 | | _/) )-" | |__>--<__| R | |
|
d23c0f0228ae
[gaim-migrate @ 6652]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
137 | / /" ,_/ / /__>---<__/ N | |
|
d23c0f0228ae
[gaim-migrate @ 6652]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
138 | o-o _// /-"_>---<__-" I / |
|
d23c0f0228ae
[gaim-migrate @ 6652]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
139 | (^(" /"_>---<__- N _-" |
|
d23c0f0228ae
[gaim-migrate @ 6652]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
140 | ,/| /__>--<__/ A _-" |
|
d23c0f0228ae
[gaim-migrate @ 6652]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
141 | ,//('( |__>--<__| T / .----_ |
| 5862 | 142 | ( ( ')) |__>--<__| | /' _---_"\ |
|
6169
d23c0f0228ae
[gaim-migrate @ 6652]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
143 | `-)) )) ( |__>--<__| O | /' / "\`\ |
|
d23c0f0228ae
[gaim-migrate @ 6652]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
144 | ,/,'//( ( \__>--<__\ R \ /' // || |
| 5862 | 145 | ,( ( ((, )) "-__>--<_"-_ "--____---"' _/'/ /' |
| 146 | `"/ )` ) ,/| "-_">--<_/-__ __-" _/ | |
| 147 | ._-"//( )/ )) ` ""-'_/_/ /"""""""__--" | |
| 148 | ;'( ')/ ,)( """""""""" | |
| 149 | ' ') '( (/ | |
| 150 | ' ' ` | |
| 151 | ||
| 152 | */ |