diff src/ui.h @ 4359:5fb47ec9bfe4

[gaim-migrate @ 4625] Wow, okay, where to begin with this one ;) I rewrote the whole conversation backend. It is now core/UI split. Here's how it works.. Every conversation is represented by a gaim_conversation structure. This branches out into gaim_im and gaim_chat structures. Every conversation lives in (well, normally, but it doesn't have to) a gaim_window structure. This is a _CORE_ representation of a window. There can be multiple gaim_window structures around. The gaim_window and gaim_conversation structures have UI-specific operation structures associated with them. At the moment, the only UI is GTK+, and this will be for some time. Don't start thinking you can write a QT UI now. It's just not going to happen. Everything that is done on a conversation is done through the core API. This API does core processing and then calls the UI operations for the rendering and anything else. Now, what does this give the user? - Multiple windows. - Multiple tabs per window. - Draggable tabs. - Send As menu is moved to the menubar. - Menubar for chats. - Some very cool stuff in the future, like replacing, say, IRC chat windows with an X-Chat interface, or whatever. - Later on, customizable window/conversation positioning. For developers: - Fully documented API - Core/UI split - Variable checking and mostly sane handling of incorrect variables. - Logical structure to conversations, both core and UI. - Some very cool stuff in the future, like replacing, say, IRC chat windows with an X-Chat interface, or whatever. - Later on, customizable window/conversation positioning. - Oh yeah, and the beginning of a stock icon system. Now, there are things that aren't there yet. You will see tabs even if you have them turned off. This will be fixed in time. Also, the preferences will change to work with the new structure. I'm starting school in 2 days, so it may not be done immediately, but hopefully in the next week. Enjoy! committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Mon, 20 Jan 2003 09:10:23 +0000
parents 0c68d402f59f
children 8067614e49e4
line wrap: on
line diff
--- a/src/ui.h	Mon Jan 20 07:00:10 2003 +0000
+++ b/src/ui.h	Mon Jan 20 09:10:23 2003 +0000
@@ -29,6 +29,10 @@
 #include <gtk/gtk.h>
 #include <gdk-pixbuf/gdk-pixbuf.h>
 
+#include "gtkconv.h"
+#include "gtkutils.h"
+#include "stock.h"
+
 #define GAIM_DIALOG(x)	x = gtk_window_new(GTK_WINDOW_TOPLEVEL); \
 			gtk_window_set_type_hint(GTK_WINDOW(x), GDK_WINDOW_TYPE_HINT_DIALOG)
 #define GAIM_WINDOW_ICONIFIED(x) (gdk_window_get_state(GTK_WIDGET(x)->window) & GDK_WINDOW_STATE_ICONIFIED)
@@ -94,7 +98,8 @@
 };
 
 /* struct buddy_chat went away and got merged with this. */
-struct conversation {
+#if 0
+struct gaim_conversation {
 	struct gaim_connection *gc;
 
 	/* stuff used for both IM and chat */
@@ -187,6 +192,7 @@
 
 	GtkWidget *tab_label;
 };
+#endif
 
 struct log_conversation {
 	char name[80];
@@ -300,12 +306,16 @@
 extern int docklet_count;
 
 /* Globals in buddy_chat.c */
+#if 0
 extern GList *chats;	/* list of all chats (only use for tabbing!) */
 extern GtkWidget *all_chats;
 extern GtkWidget *joinchat;
+#endif
 
 /* Globals in conversation.c */
+#if 0
 extern GtkWidget *all_convos;
+#endif
 
 /* Globals in dialog.c */
 extern char fontface[128];
@@ -385,51 +395,44 @@
 extern void docklet_remove();
 extern void docklet_toggle();
 extern GtkWidget *gaim_new_item(GtkWidget *, const char *);
+extern void update_idle_times();
+extern void build_imchat_box(gboolean);
 
 /* Functions in buddy_chat.c */
-extern void join_chat();
-extern void chat_write(struct conversation *, char *, int, char *, time_t);
-extern void delete_chat(struct conversation *);
-extern void build_imchat_box(gboolean);
+#if 0
+extern void chat_write(struct gaim_conversation *, char *, int, char *, time_t);
+extern void delete_chat(struct gaim_conversation *);
 extern void update_chat_button_pix();
 extern void update_im_button_pix();
 extern void update_chat_tabs();
 extern void update_im_tabs();
-extern void update_idle_times();
 extern void do_join_chat();
+#endif
 
 /* Functions in conversation.c */
-extern void gaim_setup_imhtml(GtkWidget *);
-extern void update_convo_add_button(struct conversation *);
-extern void raise_convo_tab(struct conversation *);
-extern void set_convo_title(struct conversation *);
-extern void show_conv(struct conversation *);
-void set_convo_name(struct conversation *c, const char *nname);
-extern struct conversation *new_conversation(char *);
-extern void delete_conversation(struct conversation *);
-extern void surround(struct conversation *, char *, char *);
+#if 0
+extern void update_convo_add_button(struct gaim_conversation *);
+extern void raise_convo_tab(struct gaim_conversation *);
+extern void set_convo_title(struct gaim_conversation *);
+extern void show_conv(struct gaim_conversation *);
+void set_convo_name(struct gaim_conversation *c, const char *nname);
+extern struct gaim_conversation *new_conversation(char *);
+extern void delete_conversation(struct gaim_conversation *);
+extern void surround(struct gaim_conversation *, char *, char *);
 extern int is_logging(char *);
 extern void set_state_lock(int);
-extern void remove_tags(struct conversation *, char *);
+extern void remove_tags(struct gaim_conversation *, char *);
 extern void update_transparency();
 extern void update_font_buttons();
-extern void toggle_sensitive(GtkWidget *widget, GtkWidget *to_toggle);
-extern void do_bold(GtkWidget *, struct conversation *);
-extern void do_italic(GtkWidget *, struct conversation *);
-extern void do_underline(GtkWidget *, struct conversation *);
-extern void do_strike(GtkWidget *, struct conversation *);
-extern void do_small(GtkWidget *, struct conversation *);
-extern void do_normal(GtkWidget *, struct conversation *);
-extern void do_big(GtkWidget *, struct conversation *);
-extern void set_font_face(char *, struct conversation *);
+extern void set_font_face(char *, struct gaim_conversation *);
 extern void redo_convo_menus();
 extern void convo_menu_remove(struct gaim_connection *);
 extern void remove_icon_data(struct gaim_connection *);
 extern void got_new_icon(struct gaim_connection *, char *);
 extern void toggle_spellchk();
-extern void set_convo_gc(struct conversation *, struct gaim_connection *);
-extern void update_buttons_by_protocol(struct conversation *);
-extern void toggle_fg_color(GtkWidget *, struct conversation *);
+extern void set_convo_gc(struct gaim_conversation *, struct gaim_connection *);
+extern void update_buttons_by_protocol(struct gaim_conversation *);
+extern void toggle_fg_color(GtkWidget *, struct gaim_conversation *);
 extern void toggle_smileys();
 extern void toggle_timestamps();
 extern void update_pixmaps();
@@ -440,10 +443,10 @@
 extern void update_convo_font();
 extern void set_hide_icons();
 extern void set_convo_titles();
-extern void update_progress(struct conversation *, float);
-extern void update_convo_status(struct conversation *);
-extern gboolean reset_typing(gpointer);
+extern void update_progress(struct gaim_conversation *, float);
+extern void update_convo_status(struct gaim_conversation *);
 extern void set_anim();
+#endif
 
 /* Functions in dialogs.c */
 extern void alias_dialog_bud(struct buddy *);
@@ -460,22 +463,22 @@
 extern void conv_show_log(GtkWidget *, gpointer);
 extern void chat_show_log(GtkWidget *, gpointer);
 extern void show_log(char *);
-extern void show_log_dialog(struct conversation *);
-extern void show_fgcolor_dialog(struct conversation *c, GtkWidget *color);
-extern void show_bgcolor_dialog(struct conversation *c, GtkWidget *color);
-extern void cancel_fgcolor(GtkWidget *widget, struct conversation *c);
-extern void cancel_bgcolor(GtkWidget *widget, struct conversation *c);
+extern void show_log_dialog(struct gaim_conversation *);
+extern void show_fgcolor_dialog(struct gaim_conversation *c, GtkWidget *color);
+extern void show_bgcolor_dialog(struct gaim_conversation *c, GtkWidget *color);
+extern void cancel_fgcolor(GtkWidget *widget, struct gaim_conversation *c);
+extern void cancel_bgcolor(GtkWidget *widget, struct gaim_conversation *c);
 extern void create_away_mess(GtkWidget *, void *);
 extern void show_ee_dialog(int);
-extern void show_insert_link(GtkWidget *,struct conversation *);
-extern void show_smiley_dialog(struct conversation *, GtkWidget *);
-extern void close_smiley_dialog(GtkWidget *widget, struct conversation *c);
+extern void show_insert_link(GtkWidget *,struct gaim_conversation *);
+extern void show_smiley_dialog(struct gaim_conversation *, GtkWidget *);
+extern void close_smiley_dialog(GtkWidget *widget, struct gaim_conversation *c);
 extern void set_smiley_array(GtkWidget *widget, int smiley_type);
-extern void insert_smiley_text(GtkWidget *widget, struct conversation *c);
-extern void cancel_log(GtkWidget *, struct conversation *);
-extern void cancel_link(GtkWidget *, struct conversation *);
-extern void show_font_dialog(struct conversation *c, GtkWidget *font);
-extern void cancel_font(GtkWidget *widget, struct conversation *c);
+extern void insert_smiley_text(GtkWidget *widget, struct gaim_conversation *c);
+extern void cancel_log(GtkWidget *, struct gaim_conversation *);
+extern void cancel_link(GtkWidget *, struct gaim_conversation *);
+extern void show_font_dialog(struct gaim_conversation *c, GtkWidget *font);
+extern void cancel_font(GtkWidget *widget, struct gaim_conversation *c);
 extern void apply_font(GtkWidget *widget, GtkFontSelection *fontsel);
 extern void set_color_selection(GtkWidget *selection, GdkColor color);
 extern void show_rename_group(GtkWidget *, struct group *);
@@ -484,7 +487,7 @@
 extern GtkWidget *picture_button(GtkWidget *, char *, char **);
 extern GtkWidget *picture_button2(GtkWidget *, char *, char **, short);
 extern GtkWidget *gaim_pixbuf_button(char *, char *, GaimButtonStyle);
-extern GtkWidget *gaim_pixbuf_button_from_stock(char *, char *, GaimButtonStyle);
+extern GtkWidget *gaim_pixbuf_button_from_stock(const char *, const char *, GaimButtonStyle);
 extern GtkWidget *gaim_pixbuf_toolbar_button_from_stock(char *);
 extern GtkWidget *gaim_pixbuf_toolbar_button_from_file(char *);
 extern int file_is_dir(const char *, GtkWidget *);
@@ -493,6 +496,7 @@
 extern void build_allow_list();
 extern void build_block_list();
 extern void destroy_fontsel(GtkWidget *w, gpointer d);
+extern void join_chat();
 
 /* Functions in multi.c */
 extern void account_editor(GtkWidget *, GtkWidget *);