Mercurial > pidgin
annotate src/win32/libc_interface.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 | c297b9d4f67c |
| children | dcc6c130c6d9 |
| rev | line source |
|---|---|
|
3776
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
1 /* |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
2 * libc_interface.h |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
3 */ |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
4 |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
5 #ifndef _LIBC_INTERFACE_H_ |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
6 #define _LIBC_INTERFACE_H_ |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
7 #include <winsock.h> |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
8 #include <errno.h> |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
9 #include "libc_internal.h" |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
10 |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
11 /* sys/socket.h */ |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
12 extern int wgaim_socket(int namespace, int style, int protocol); |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
13 #define socket( namespace, style, protocol ) \ |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
14 wgaim_socket( ## namespace ##, ## style ##, ## protocol ## ) |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
15 |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
16 extern int wgaim_connect(int socket, struct sockaddr *addr, u_long length); |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
17 #define connect( socket, addr, length ) \ |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
18 wgaim_connect( ## socket ##, ## addr ##, ## length ## ) |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
19 |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
20 extern int wgaim_getsockopt(int socket, int level, int optname, void *optval, unsigned int *optlenptr); |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
21 #define getsockopt( args... ) \ |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
22 wgaim_getsockopt( ## args ) |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
23 |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
24 /* sys/ioctl.h */ |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
25 extern int wgaim_ioctl(int fd, int command, void* opt); |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
26 #define ioctl( fd, command, val ) \ |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
27 wgaim_ioctl( ## fd ##, ## command ##, ## val ## ) |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
28 |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
29 /* fcntl.h */ |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
30 extern int wgaim_fcntl(int socket, int command, int val); |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
31 #define fcntl( fd, command, val ) \ |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
32 wgaim_fcntl( ## fd ##, ## command ##, ## val ## ) |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
33 |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
34 #define open( args... ) _open( ## args ) |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
35 |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
36 /* arpa/inet.h */ |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
37 extern int wgaim_inet_aton(const char *name, struct in_addr *addr); |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
38 #define inet_aton( name, addr ) \ |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
39 wgaim_inet_aton( ## name ##, ## addr ## ) |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
40 |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
41 /* netdb.h */ |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
42 extern struct hostent* wgaim_gethostbyname(const char *name); |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
43 #define gethostbyname( name ) \ |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
44 wgaim_gethostbyname( ## name ## ) |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
45 |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
46 /* string.h */ |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
47 extern char* wgaim_strerror( int errornum ); |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
48 #define hstrerror( herror ) \ |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
49 wgaim_strerror( errno ) |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
50 #define strerror( errornum ) \ |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
51 wgaim_strerror( ## errornum ## ) |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
52 |
|
4193
c297b9d4f67c
[gaim-migrate @ 4424]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3776
diff
changeset
|
53 extern char* wgaim_strsep(char **stringp, const char *delim); |
|
c297b9d4f67c
[gaim-migrate @ 4424]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3776
diff
changeset
|
54 #define strsep( stringp, delim ) \ |
|
c297b9d4f67c
[gaim-migrate @ 4424]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3776
diff
changeset
|
55 wgaim_strsep( ## stringp ##, ## delim ## ) |
|
c297b9d4f67c
[gaim-migrate @ 4424]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
3776
diff
changeset
|
56 |
|
3776
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
57 #define bzero( dest, size ) memset( ## dest ##, 0, ## size ## ) |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
58 |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
59 /* unistd.h */ |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
60 extern int wgaim_read(int fd, void *buf, unsigned int size); |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
61 #define read( fd, buf, buflen ) \ |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
62 wgaim_read( ## fd ##, ## buf ##, ## buflen ## ) |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
63 |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
64 extern int wgaim_write(int fd, const void *buf, unsigned int size); |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
65 #define write( socket, buf, buflen ) \ |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
66 wgaim_write( ## socket ##, ## buf ##, ## buflen ## ) |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
67 |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
68 extern int wgaim_close(int fd); |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
69 #define close( fd ) \ |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
70 wgaim_close( ## fd ## ) |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
71 |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
72 #define sleep(x) Sleep((x)*1000) |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
73 |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
74 /* sys/time.h */ |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
75 extern int wgaim_gettimeofday(struct timeval *p, struct timezone *z); |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
76 #define gettimeofday( timeval, timezone ) \ |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
77 wgaim_gettimeofday( ## timeval ##, ## timezone ## ) |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
78 |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
79 /* stdio.h */ |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
80 #define snprintf _snprintf |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
81 #define vsnprintf _vsnprintf |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
82 |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
83 /* sys/stat.h */ |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
84 #define mkdir(a,b) _mkdir((a)) |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
85 |
|
21d296405cfd
[gaim-migrate @ 3916]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff
changeset
|
86 #endif /* _LIBC_INTERFACE_H_ */ |
