Mon, 20 Jan 2003 09:10:23 +0000
[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!
| 472 | 1 | /* |
| 2 | * gaim | |
| 3 | * | |
| 4 | * Copyright (C) 1998-1999, Mark Spencer <markster@marko.net> | |
| 5 | * | |
| 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. | |
| 10 | * | |
| 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. | |
| 15 | * | |
| 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 | |
| 19 | * | |
| 20 | */ | |
| 21 | ||
|
2417
7751d1269b09
[gaim-migrate @ 2430]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2385
diff
changeset
|
22 | #ifndef _CONVO_H_ |
|
7751d1269b09
[gaim-migrate @ 2430]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2385
diff
changeset
|
23 | #define _CONVO_H_ |
| 472 | 24 | |
| 25 | #include <gtk/gtk.h> | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
3790
diff
changeset
|
26 | #include "conversation.h" |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
3790
diff
changeset
|
27 | #include "gtkconv.h" |
| 472 | 28 | #include "gaim.h" |
| 29 | ||
|
3716
172593593072
[gaim-migrate @ 3849]
Herman Bloggs <herman@bluedigits.com>
parents:
2856
diff
changeset
|
30 | #if 0 |
|
909
83af8c8b993b
[gaim-migrate @ 919]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
907
diff
changeset
|
31 | #include "pixmaps/tmp_send.xpm" |
|
83af8c8b993b
[gaim-migrate @ 919]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
907
diff
changeset
|
32 | #include "pixmaps/gnome_remove.xpm" |
|
83af8c8b993b
[gaim-migrate @ 919]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
907
diff
changeset
|
33 | #include "pixmaps/gnome_add.xpm" |
|
83af8c8b993b
[gaim-migrate @ 919]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
907
diff
changeset
|
34 | #include "pixmaps/cancel.xpm" |
|
83af8c8b993b
[gaim-migrate @ 919]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
907
diff
changeset
|
35 | #include "pixmaps/warn.xpm" |
|
83af8c8b993b
[gaim-migrate @ 919]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
907
diff
changeset
|
36 | #include "pixmaps/tb_search.xpm" |
|
83af8c8b993b
[gaim-migrate @ 919]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
907
diff
changeset
|
37 | #include "pixmaps/block.xpm" |
|
3716
172593593072
[gaim-migrate @ 3849]
Herman Bloggs <herman@bluedigits.com>
parents:
2856
diff
changeset
|
38 | #endif |
| 472 | 39 | |
|
2843
6dd0497437e3
[gaim-migrate @ 2856]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2417
diff
changeset
|
40 | extern GtkWidget *convo_notebook; |
|
6dd0497437e3
[gaim-migrate @ 2856]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2417
diff
changeset
|
41 | extern GtkWidget *chat_notebook; |
|
6dd0497437e3
[gaim-migrate @ 2856]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2417
diff
changeset
|
42 | |
| 472 | 43 | /* we declare all of the global functions for chat and IM windows here, so |
| 44 | * that it's easy to keep them merged. */ | |
| 45 | ||
| 46 | /* chat first */ | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
3790
diff
changeset
|
47 | extern void im_callback(GtkWidget *, struct gaim_conversation *); |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
3790
diff
changeset
|
48 | extern void ignore_callback(GtkWidget *, struct gaim_conversation *); |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
3790
diff
changeset
|
49 | extern void whisper_callback(GtkWidget *, struct gaim_conversation *); |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
3790
diff
changeset
|
50 | extern void invite_callback(GtkWidget *, struct gaim_conversation *); |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
3790
diff
changeset
|
51 | extern void tab_complete(struct gaim_conversation *c); |
| 472 | 52 | |
| 53 | /* now IM */ | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
3790
diff
changeset
|
54 | extern void warn_callback(GtkWidget *, struct gaim_conversation *); |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
3790
diff
changeset
|
55 | extern void block_callback(GtkWidget *, struct gaim_conversation *); |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
3790
diff
changeset
|
56 | extern void add_callback(GtkWidget *, struct gaim_conversation *); |
| 472 | 57 | |
| 58 | /* now both */ | |
|
2379
cffc8ebf1bd4
[gaim-migrate @ 2392]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
960
diff
changeset
|
59 | extern int set_dispstyle (int); |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
3790
diff
changeset
|
60 | extern void info_callback(GtkWidget *, struct gaim_conversation *); |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
3790
diff
changeset
|
61 | extern void do_bold(GtkWidget *, struct gaim_conversation *); |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
3790
diff
changeset
|
62 | extern void do_italic(GtkWidget *, struct gaim_conversation *); |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
3790
diff
changeset
|
63 | extern void do_underline(GtkWidget *, struct gaim_conversation *); |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
3790
diff
changeset
|
64 | extern void do_strike(GtkWidget *, struct gaim_conversation *); |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
3790
diff
changeset
|
65 | extern void do_small(GtkWidget *, struct gaim_conversation *); |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
3790
diff
changeset
|
66 | extern void do_normal(GtkWidget *, struct gaim_conversation *); |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
3790
diff
changeset
|
67 | extern void do_big(GtkWidget *, struct gaim_conversation *); |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
3790
diff
changeset
|
68 | extern void toggle_font(GtkWidget *, struct gaim_conversation *); |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
3790
diff
changeset
|
69 | extern void toggle_color(GtkWidget *, struct gaim_conversation *); |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
3790
diff
changeset
|
70 | extern void toggle_loggle(GtkWidget *, struct gaim_conversation *); |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
3790
diff
changeset
|
71 | extern void insert_smiley(GtkWidget *, struct gaim_conversation *); |
| 472 | 72 | /* sound is handled by set_option */ |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
3790
diff
changeset
|
73 | extern gboolean keypress_callback(GtkWidget *, GdkEventKey *, struct gaim_conversation *); |
| 3790 | 74 | extern gboolean stop_rclick_callback(GtkWidget *, GdkEventButton *, gpointer); |
|
907
3638fe0afd66
[gaim-migrate @ 917]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
608
diff
changeset
|
75 | extern void check_spelling( GtkEditable *, gchar *, gint, gint *, gpointer); |
| 3790 | 76 | extern int entry_key_pressed(GtkTextBuffer *); |
| 472 | 77 | |
|
2843
6dd0497437e3
[gaim-migrate @ 2856]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2417
diff
changeset
|
78 | extern void convo_switch(GtkNotebook *, GtkWidget *, gint, gpointer); |
|
6dd0497437e3
[gaim-migrate @ 2856]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2417
diff
changeset
|
79 | extern gint delete_all_convo(GtkWidget *, GdkEventAny *, gpointer); |
|
6dd0497437e3
[gaim-migrate @ 2856]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2417
diff
changeset
|
80 | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
3790
diff
changeset
|
81 | extern GtkWidget *build_conv_toolbar(struct gaim_conversation *); |
| 472 | 82 | |
|
4359
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
3790
diff
changeset
|
83 | extern void send_callback(GtkWidget *, struct gaim_conversation *); |
|
cf899ee07d1d
[gaim-migrate @ 4625]
Christian Hammond <chipx86@chipx86.com>
parents:
3790
diff
changeset
|
84 | extern int close_callback(GtkWidget *, struct gaim_conversation *); |
| 472 | 85 | |
|
2856
046ed5e89321
[gaim-migrate @ 2869]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2843
diff
changeset
|
86 | extern gboolean meify(char *, int); |
| 472 | 87 | |
|
2417
7751d1269b09
[gaim-migrate @ 2430]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
2385
diff
changeset
|
88 | #endif /* _CONVO_H_ */ |