4 * Copyright (C) 1998-1999, Mark Spencer <markster@marko.net>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30 #include <gdk-pixbuf/gdk-pixbuf.h>
40 #define GAIM_DIALOG(x) x = gtk_window_new(GTK_WINDOW_TOPLEVEL); \
41 gtk_window_set_type_hint(GTK_WINDOW(x), GDK_WINDOW_TYPE_HINT_DIALOG)
42 #define GAIM_WINDOW_ICONIFIED(x) (gdk_window_get_state(GTK_WIDGET(x)->window) & GDK_WINDOW_STATE_ICONIFIED)
44 #define DEFAULT_FONT_FACE "Helvetica"
46 #define BROWSER_NETSCAPE 0
47 #define BROWSER_KONQ 1
48 #define BROWSER_MANUAL 2
49 /*#define BROWSER_INTERNAL 3*/
50 #define BROWSER_GNOME 4
51 #define BROWSER_OPERA 5
52 #define BROWSER_GALEON 6
53 #define BROWSER_MOZILLA 7
56 #define FACE_BIGSMILE 1
58 #define FACE_CROSSEDLIPS 3
60 #define FACE_EMBARRASSED 5
62 #define FACE_MONEYMOUTH 7
66 #define FACE_SMILE8 11
68 #define FACE_TONGUE 13
75 #define GAIM_WARNING 2
79 GAIM_BUTTON_HORIZONTAL
,
89 /* XXX CUI: save_pos and window_size are used by gaimrc.c which is core.
90 * Need to figure out options saving. Same goes for several global variables as well. */
104 struct log_conversation
{
107 struct log_conversation
*next
;
110 /* XXX CUI: away messages aren't really anything more than char* but we need two char*'s
111 * for the UI so that people can name their away messages when they save them. So these
112 * are really a UI function and struct away_message should be removed from the core. */
113 struct away_message
{
120 /* this is used for queuing messages received while away. This is really a UI function
121 * which is why the struct is here. */
123 struct queued_message
{
127 struct gaim_account
*account
;
132 struct smiley_theme
{
139 struct smiley_list
*list
;
147 /* Globals in aim.c */
148 extern GList
*log_conversations
; /* this should be moved to conversations.c */
149 extern GSList
*away_messages
; /* this should be moved to away.c */
150 extern GtkWidget
*mainwindow
;
151 extern int docklet_count
;
153 /* Globals in away.c */
154 extern struct away_message
*awaymessage
;
155 extern struct away_message
*default_away
;
156 extern int auto_away
;
157 extern GtkWidget
*awaymenu
;
158 extern GtkWidget
*awayqueue
;
159 extern GtkListStore
*awayqueuestore
;
161 /* Globals in dialog.c */
162 extern char fontface
[128];
163 extern char fontxfld
[256];
165 extern GdkColor bgcolor
;
166 extern GdkColor fgcolor
;
167 extern int smiley_array
[FACE_TOTAL
];
168 extern GtkWidget
*fgcseld
;
169 extern GtkWidget
*bgcseld
;
171 /* Globals in pounce.c */
172 extern GtkWidget
*bpmenu
;
174 /* Globals in prefs.c */
175 extern GtkWidget
*prefs
;
176 extern struct debug_window
*dw
;
177 extern GtkWidget
*fontseld
;
179 /* Globals in prpl.c */
180 extern GtkWidget
*protomenu
;
182 /* Globals in session.c */
183 extern gboolean session_managed
;
185 /* Globals in themes.c */
186 extern struct smiley_theme
*current_smiley_theme
;
187 extern GSList
*smiley_themes
;
190 /* Functions in about.c */
191 extern void show_about(GtkWidget
*, void *);
192 extern void gaim_help(GtkWidget
*, void *);
194 /* Functions in aim.c */
195 extern void show_login();
196 extern void gaim_setup(struct gaim_connection
*gc
);
198 /* Functions in away.c */
199 extern void rem_away_mess(GtkWidget
*, struct away_message
*);
200 extern void do_away_message(GtkWidget
*, struct away_message
*);
201 extern void do_away_menu();
202 extern void away_list_unclicked(GtkWidget
*, struct away_message
*);
203 extern void away_list_clicked(GtkWidget
*, struct away_message
*);
204 extern void toggle_away_queue();
205 extern void purge_away_queue(GSList
**);
207 /* Functions in browser.c */
208 extern void open_url(GtkWidget
*, char *);
209 extern void add_bookmark(GtkWidget
*, char *);
211 /* Functions in buddy.c */
212 extern void handle_group_rename(struct group
*, char *);
213 extern void handle_buddy_rename(struct buddy
*, char *);
214 extern void destroy_buddy();
215 extern void update_button_pix();
216 extern void toggle_show_empty_groups();
217 extern void update_all_buddies();
218 extern void update_num_groups(void);
219 extern void show_buddy_list();
220 extern void signoff_all();
221 extern void do_im_back();
222 extern void set_buddy(struct gaim_connection
*, struct buddy
*);
223 extern void build_edit_tree();
224 extern void do_bp_menu();
225 extern void ui_add_buddy(struct gaim_connection
*, struct group
*, struct buddy
*);
226 extern void ui_remove_buddy(struct buddy
*);
227 extern void ui_add_group(struct group
*);
228 extern void ui_remove_group(struct group
*);
229 extern void toggle_buddy_pixmaps();
230 extern void gaim_separator(GtkWidget
*);
231 extern void redo_buddy_list(); /* you really shouldn't call this function */
232 extern void set_blist_tab();
233 extern void hide_buddy_list();
234 extern void unhide_buddy_list();
235 extern void docklet_add();
236 extern void docklet_remove();
237 extern void docklet_toggle();
238 extern GtkWidget
*gaim_new_item(GtkWidget
*, const char *);
239 extern void update_idle_times();
240 extern void build_imchat_box(gboolean
);
241 extern void show_xfer_dialog();
243 /* Functions in dialogs.c */
244 extern void alias_dialog_bud(struct buddy
*);
245 extern void show_warn_dialog(struct gaim_connection
*, char *);
246 extern void show_im_dialog();
247 extern void show_info_dialog();
248 extern void show_add_buddy(struct gaim_connection
*, char *, char *, char *);
249 extern void show_add_group(struct gaim_connection
*);
250 extern void show_add_perm(struct gaim_connection
*, char *, gboolean
);
251 extern void destroy_all_dialogs();
252 extern void show_import_dialog();
253 extern void show_export_dialog();
254 extern void show_new_bp(char *, struct gaim_connection
*, int, int, struct buddy_pounce
*);
255 extern void conv_show_log(GtkWidget
*, gpointer
);
256 extern void chat_show_log(GtkWidget
*, gpointer
);
257 extern void show_log(char *);
258 extern void show_log_dialog(struct gaim_conversation
*);
259 extern void show_fgcolor_dialog(struct gaim_conversation
*c
, GtkWidget
*color
);
260 extern void show_bgcolor_dialog(struct gaim_conversation
*c
, GtkWidget
*color
);
261 extern void cancel_fgcolor(GtkWidget
*widget
, struct gaim_conversation
*c
);
262 extern void cancel_bgcolor(GtkWidget
*widget
, struct gaim_conversation
*c
);
263 extern void create_away_mess(GtkWidget
*, void *);
264 extern void show_ee_dialog(int);
265 extern void show_insert_link(GtkWidget
*,struct gaim_conversation
*);
266 extern void show_smiley_dialog(struct gaim_conversation
*, GtkWidget
*);
267 extern void close_smiley_dialog(GtkWidget
*widget
, struct gaim_conversation
*c
);
268 extern void set_smiley_array(GtkWidget
*widget
, int smiley_type
);
269 extern void insert_smiley_text(GtkWidget
*widget
, struct gaim_conversation
*c
);
270 extern void cancel_log(GtkWidget
*, struct gaim_conversation
*);
271 extern void cancel_link(GtkWidget
*, struct gaim_conversation
*);
272 extern void show_font_dialog(struct gaim_conversation
*c
, GtkWidget
*font
);
273 extern void cancel_font(GtkWidget
*widget
, struct gaim_conversation
*c
);
274 extern void apply_font(GtkWidget
*widget
, GtkFontSelection
*fontsel
);
275 extern void set_color_selection(GtkWidget
*selection
, GdkColor color
);
276 extern void show_rename_group(GtkWidget
*, struct group
*);
277 extern void show_rename_buddy(GtkWidget
*, struct buddy
*);
278 extern void load_perl_script();
279 extern GtkWidget
*picture_button(GtkWidget
*, char *, char **);
280 extern GtkWidget
*picture_button2(GtkWidget
*, char *, char **, short);
281 extern GtkWidget
*gaim_pixbuf_button(char *, char *, GaimButtonStyle
);
282 extern GtkWidget
*gaim_pixbuf_button_from_stock(const char *, const char *, GaimButtonStyle
);
283 extern GtkWidget
*gaim_pixbuf_toolbar_button_from_stock(char *);
284 extern GtkWidget
*gaim_pixbuf_toolbar_button_from_file(char *);
285 extern int file_is_dir(const char *, GtkWidget
*);
286 extern void update_privacy_connections();
287 extern void show_privacy_options();
288 extern void build_allow_list();
289 extern void build_block_list();
290 extern void destroy_fontsel(GtkWidget
*w
, gpointer d
);
291 extern void join_chat();
293 /* Functions in multi.c */
294 extern void account_editor(GtkWidget
*, GtkWidget
*);
296 /* Functions in plugins.c */
298 extern void show_plugins(GtkWidget
*, gpointer
);
299 extern void update_show_plugins(); /* this is a hack and will be removed */
302 /* Functions in prefs.c */
303 extern void set_option(GtkWidget
*, int *);
304 extern void show_prefs();
305 extern void show_debug();
306 extern void toggle_debug();
307 extern void update_color(GtkWidget
*, GtkWidget
*);
308 extern void set_default_away(GtkWidget
*, gpointer
);
309 extern void default_away_menu_init(GtkWidget
*);
310 extern void build_allow_list();
311 extern void build_block_list();
312 extern GtkWidget
*make_frame(GtkWidget
*, char *);
313 extern GtkListStore
*prefs_away_store
;
314 extern GtkWidget
*prefs_away_menu
;
315 extern GtkWidget
*pref_fg_picture
;
316 extern GtkWidget
*pref_bg_picture
;
317 extern void apply_font_dlg(GtkWidget
*, GtkWidget
*);
318 extern void apply_color_dlg(GtkWidget
*, gpointer
);
319 extern void destroy_colorsel(GtkWidget
*, gpointer
);
321 /* Functions in prpl.c */
322 extern void register_dialog();
324 /* Functions in server.c */
325 /* server.c is in desperate need need of a split */
326 extern int find_queue_total_by_name(char *);
328 /* Functions in session.c */
329 extern void session_init(gchar
*, gchar
*);
330 extern void session_end();
332 /* Functions in themes.c */
333 extern void smiley_themeize(GtkWidget
*);
334 extern void smiley_theme_probe();
335 extern void load_smiley_theme(const char *file
, gboolean load
);
336 extern GSList
*get_proto_smileys(int protocol
);
338 /* Fucnctions in util.c */
339 extern GtkWidget
*gaim_pixmap(char *, char *);
340 extern GdkPixbuf
*gaim_pixbuf(char *, char *);
341 extern GtkWidget
*gaim_new_item(GtkWidget
*menu
, const char *str
);
342 extern GtkWidget
*gaim_new_item_with_pixmap(GtkWidget
*, const char *, char **, GtkSignalFunc
, gpointer
, guint
, guint
, char *);
343 extern GtkWidget
*gaim_new_item_from_stock(GtkWidget
*, const char *, const char *, GtkSignalFunc
, gpointer
, guint
, guint
, char *);
344 extern GtkWidget
*gaim_new_item_from_pixbuf(GtkWidget
*, const char *, char *, GtkSignalFunc
, gpointer
, guint
, guint
, char *);