You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(106) |
Oct
(334) |
Nov
(246) |
Dec
(145) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(42) |
Feb
(53) |
Mar
(232) |
Apr
(109) |
May
(137) |
Jun
(63) |
Jul
(26) |
Aug
(263) |
Sep
(193) |
Oct
(507) |
Nov
(440) |
Dec
(241) |
2003 |
Jan
(567) |
Feb
(195) |
Mar
(504) |
Apr
(481) |
May
(524) |
Jun
(522) |
Jul
(594) |
Aug
(502) |
Sep
(643) |
Oct
(508) |
Nov
(430) |
Dec
(377) |
2004 |
Jan
(361) |
Feb
(251) |
Mar
(219) |
Apr
(499) |
May
(461) |
Jun
(419) |
Jul
(314) |
Aug
(519) |
Sep
(416) |
Oct
(247) |
Nov
(305) |
Dec
(382) |
2005 |
Jan
(267) |
Feb
(282) |
Mar
(327) |
Apr
(338) |
May
(189) |
Jun
(400) |
Jul
(462) |
Aug
(530) |
Sep
(316) |
Oct
(523) |
Nov
(481) |
Dec
(650) |
2006 |
Jan
(536) |
Feb
(361) |
Mar
(287) |
Apr
(146) |
May
(101) |
Jun
(169) |
Jul
(221) |
Aug
(498) |
Sep
(300) |
Oct
(236) |
Nov
(209) |
Dec
(205) |
2007 |
Jan
(30) |
Feb
(23) |
Mar
(26) |
Apr
(15) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Rob F. <rob...@us...> - 2002-10-10 01:24:26
|
Update of /cvsroot/gaim/web/inc In directory usw-pr-cvs1:/tmp/cvs-serv28218/inc Modified Files: html.inc.normal.php Log Message: la la la la la Index: html.inc.normal.php =================================================================== RCS file: /cvsroot/gaim/web/inc/html.inc.normal.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- html.inc.normal.php 1 Oct 2002 02:14:18 -0000 1.2 +++ html.inc.normal.php 10 Oct 2002 01:24:23 -0000 1.3 @@ -120,7 +120,7 @@ <a href="/cvs.php#nightly">Nightlies:</a> <small>[<a href="/gaim-CVS.tar.gz">tarball</a>, <a href="/gaim-CVS.i386.rpm">RPM</a>] <br /> - <a href="http://sourceforge.net/project/showfiles.php?group_id=235">Other Packages</a> </small> <br /> + <a href="http://sourceforge.net/project/showfiles.php?group_id=235">Other Packages (Inc. Win32)</a> </small> <br /> <?php end_font() ?> </td> </tr> |
From: Sean E. <sea...@us...> - 2002-10-09 18:04:11
|
Update of /cvsroot/gaim/web/htdocs/win32 In directory usw-pr-cvs1:/tmp/cvs-serv10892 Modified Files: index.php Log Message: whoops. Index: index.php =================================================================== RCS file: /cvsroot/gaim/web/htdocs/win32/index.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- index.php 9 Oct 2002 18:01:32 -0000 1.2 +++ index.php 9 Oct 2002 18:04:07 -0000 1.3 @@ -24,7 +24,7 @@ the sources to:<br> <code>$ mkdir -p ~/win32-dev/gtk_2_0/zips</code><br><br> -Download the following from the win32 download page at <a href="http://www.gtk.org</a> to the zips directory you just created: +Download the following from the win32 download page at <a href="http://www.gtk.org">http://www.gtk.org</a> to the zips directory you just created: <ul><li>atk-1.0.3-20020821.zip</li> <li>atk-dev-1.0.3-20020821.zip</li> <li>gettext-dev-0.10.40-20020904.zip</li> |
From: Sean E. <sea...@us...> - 2002-10-09 18:01:35
|
Update of /cvsroot/gaim/web/htdocs/win32 In directory usw-pr-cvs1:/tmp/cvs-serv9285 Modified Files: index.php Log Message: ChipX86--fix this up and make it look nice. Index: index.php =================================================================== RCS file: /cvsroot/gaim/web/htdocs/win32/index.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- index.php 26 Sep 2002 10:23:23 -0000 1.1.1.1 +++ index.php 9 Oct 2002 18:01:32 -0000 1.2 @@ -3,9 +3,87 @@ start_html("Gaim - Windows Development"); - start_section("Welcome"); + start_section("Latest Build"); ?> -Come by later this week. +Grab the latest Windows build: <a href="#">here</a> or read below to see how to get Gaim from CVS and build it yourself. +<?php end_section() ?> + +<?php start_section("Build Instructions") ?> +<h3>Set up your build environment</h3> +<ul> +<li>Install <a href="http://cygwin.com">Cygwin</a> Bash shell</li> +<li>Install MinGw v1.1 <a href="http://www.mingw.org">MinGw v1.1</a><br> + Make sure to read the installation instructions. Make sure to set + MinGw's bin directory in your PATH (in .bash_login), before Cygwin's + bin dir (you will be using MinGw's build tools--not cygwin's).</li> +<?php end_section() ?> + +<?php start_section("Install libraries and headers")?> +<h3>GTK+</h3> +Gaim depends on GTK+ 2.0 or greater. First, create a directory to download +the sources to:<br> +<code>$ mkdir -p ~/win32-dev/gtk_2_0/zips</code><br><br> + +Download the following from the win32 download page at <a href="http://www.gtk.org</a> to the zips directory you just created: +<ul><li>atk-1.0.3-20020821.zip</li> + <li>atk-dev-1.0.3-20020821.zip</li> + <li>gettext-dev-0.10.40-20020904.zip</li> + <li>glib-2.0.6-20020802.zip</li> + <li>glib-dev-2.0.6-20020802.zip</li> + <li>gtk+-2.0.6-20020921.zip</li> + <li>gtk+-dev-2.0.6-20020921.zip</li> + <li>libiconv-1.7-w32.bin.zip</li> + <li>libintl-0.10.40-tml-20020904.zip</li> + <li>libjpeg-6b-bin.zip</li> + <li>libpng-1.2.4-1-bin.zip</li> + <li>pango-1.0.4-20020921.zip</li> + <li>pango-dev-1.0.4-20020921.zip</li> + <li>tiff-3.5.7-bin.zip</li> + <li>zlib-1.1.4-bin.zip</li></ul> + +Unzip and install the unzipped libraries:<br> +<code> + $ cd ~/win32-dev/gtk_2_0/zips<br/> + $ unzip -d .. *.zip<br/> + $ cd ..<br/> + $ cp lib/libintl-1.dll ./bin<br/> + $ cd libiconv-1.7-w32.bin<br/> + $ cp iconv.exe ../bin<br/> + $ cp iconv.lib ../lib<br/> + $ cp localcharset.dll ../lib<br/> + $ cp iconv.dll ../lib<br/> + $ cp iconv.dll ../bin<br/> + $ cp iconv.h ../include/<br/> + $ cp libcharset.h ../include/<br/> +</code> + +<h3>Perl 5.6</h3> +Download perl-5.6.1 from <a href="http://www.cpan.org">http://www.cpan.org</a>. You can build perl 5.6 yourself with MS Visual C++, or you can download a win32 binary distribution (SiePerl has been successfully used). In either case make sure to do the following:<br/><br/> +<code>$ mkdir -p ~/win32-dev/perl56</code><br/><br/> +Copy Perl's "CORE" directory to ~/win32-dev/perl56 as well as "perl56.dll" and "perl56.lib". +<?php end_section()?> + +<?php start_section("Install Gaim source from CVS")?> +<h3>Get sources from CVS</h3> +Wait for sources to be in CVS ;) +<?php end_section() ?> + +<?php start_section("Building Gaim") ?> +<code> +$ cd ~/gaim<br/> +$ make -f Makefile.mingw install</code><br/><br/> + +Now just wait and let your compiler do its thing. When finished, Gaim will be in ~/gaim/win32-install-dir<br/><br/> + +If you want to build an .exe self-installer, grab <a href="http://www.nullsoft.com/free/nsis">NSIS</a>--include NSIS in your path and run:<br/><br/> +<code> +$ cd ~/gaim/win32-install-dir<br/> +$ make -f Makefile.mingw installer<br/> +</code> +<?php end_section() ?> + +<?php start_section("Debugging")?> +There is a quite good <b>Just In Time</b> debugger for MinGw: <a href="http://mefriss1.swan.ac.uk/~jfonseca/gnu-win32/software/drmingw/">http://mefriss1.swan.ac.uk/~jfonesca/gnu-win32/software/drmingw/</a> <?php end_section() ?> <?php |
From: Christian H. <ch...@us...> - 2002-10-09 17:29:35
|
Update of /cvsroot/gaim/web/inc In directory usw-pr-cvs1:/tmp/cvs-serv27531 Removed Files: config.inc.php Log Message: La de da. --- config.inc.php DELETED --- |
From: Sean E. <sea...@us...> - 2002-10-09 16:31:38
|
Update of /cvsroot/gaim/gaim/src In directory usw-pr-cvs1:/tmp/cvs-serv26130/src Modified Files: server.c Log Message: buf gix. Index: server.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/server.c,v retrieving revision 1.244 retrieving revision 1.245 diff -u -d -r1.244 -r1.245 --- server.c 8 Oct 2002 22:54:38 -0000 1.244 +++ server.c 9 Oct 2002 16:31:33 -0000 1.245 @@ -128,7 +128,6 @@ debug_printf("Prpl %s is now being used by %d accounts\n", prpl->name, prpl_accounts[prpl->protocol]); if (prpl_accounts[prpl->protocol] == 0) { /* We don't need this protocol anymore */ debug_printf("Throwing out prpl %s\n", prpl->name); - unload_protocol(prpl); g_timeout_add(0,delayed_unload, prpl->plug->handle); prpl->plug->handle = NULL; } |
From: Rob F. <rob...@us...> - 2002-10-09 06:28:58
|
Update of /cvsroot/gaim/gaim/src/protocols/irc In directory usw-pr-cvs1:/tmp/cvs-serv31955 Modified Files: irc.c Log Message: Oh ho ho!!! Index: irc.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/irc/irc.c,v retrieving revision 1.93 retrieving revision 1.94 diff -u -d -r1.93 -r1.94 --- irc.c 9 Oct 2002 06:25:46 -0000 1.93 +++ irc.c 9 Oct 2002 06:28:55 -0000 1.94 @@ -1438,6 +1438,9 @@ if (idata->rxqueue) g_free(idata->rxqueue); + idata->rxqueue = NULL; + idata->rxlen = 0; + /* Kill any existing transfers */ while (idata->file_transfers) { struct irc_file_transfer *ift = (struct irc_file_transfer *)idata->file_transfers->data; @@ -1450,9 +1453,8 @@ idata->file_transfers = idata->file_transfers->next; } + idata->file_transfers = NULL; - idata->rxqueue = NULL; - idata->rxlen = 0; g_free(idata->chantypes); g_free(idata->chanmodes); |
From: Rob F. <rob...@us...> - 2002-10-09 06:25:49
|
Update of /cvsroot/gaim/gaim/src/protocols/irc In directory usw-pr-cvs1:/tmp/cvs-serv30962/irc Modified Files: irc.c Log Message: I forgot this. Index: irc.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/irc/irc.c,v retrieving revision 1.92 retrieving revision 1.93 diff -u -d -r1.92 -r1.93 --- irc.c 9 Oct 2002 06:09:10 -0000 1.92 +++ irc.c 9 Oct 2002 06:25:46 -0000 1.93 @@ -1424,6 +1424,7 @@ static void irc_close(struct gaim_connection *gc) { struct irc_data *idata = (struct irc_data *)gc->proto_data; + gchar buf[IRC_BUF_LEN]; if (idata->str->len > 0) { @@ -1436,6 +1437,20 @@ if (idata->rxqueue) g_free(idata->rxqueue); + + /* Kill any existing transfers */ + while (idata->file_transfers) { + struct irc_file_transfer *ift = (struct irc_file_transfer *)idata->file_transfers->data; + + g_free(ift->sn); + g_free(ift->name); + gaim_input_remove(ift->watcher); + + close(ift->fd); + + idata->file_transfers = idata->file_transfers->next; + } + idata->rxqueue = NULL; idata->rxlen = 0; |
From: Sean E. <sea...@us...> - 2002-10-09 06:17:08
|
Update of /cvsroot/gaim/gaim In directory usw-pr-cvs1:/tmp/cvs-serv28149 Modified Files: ChangeLog Log Message: This is a very significant change. Index: ChangeLog =================================================================== RCS file: /cvsroot/gaim/gaim/ChangeLog,v retrieving revision 1.555 retrieving revision 1.556 diff -u -d -r1.555 -r1.556 --- ChangeLog 9 Oct 2002 06:09:10 -0000 1.555 +++ ChangeLog 9 Oct 2002 06:17:05 -0000 1.556 @@ -76,6 +76,7 @@ Panel Notification Area applet for GNOME 2, or the kicker for KDE 3.1. (Thanks Robert McQueen, Ari Pollak, Patrick Aussems) * Plugins dialog and perl script menu merged into preferences. + * Auto-loading protocol plugins. * use snprintf instead of sprintf (Thanks William T. Mahan). * Non-direct connect typing notification for AIM over oscar (Thanks Mark Doliner) |
From: Rob F. <rob...@us...> - 2002-10-09 06:09:13
|
Update of /cvsroot/gaim/gaim/src/protocols/irc In directory usw-pr-cvs1:/tmp/cvs-serv24943/src/protocols/irc Modified Files: irc.c Log Message: IRC file receive support. This may be a little odd at the moment. It is also a little spammy on the console. I did this so I could make sure things were working until I get a GUI designed for FT stuff. I'll try to do that tomorrow night. Could some people test this and let me know what you think. Index: irc.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/irc/irc.c,v retrieving revision 1.91 retrieving revision 1.92 diff -u -d -r1.91 -r1.92 --- irc.c 8 Oct 2002 05:54:12 -0000 1.91 +++ irc.c 9 Oct 2002 06:09:10 -0000 1.92 @@ -57,6 +57,20 @@ char nick[80]; }; +struct irc_file_transfer { + enum { IFT_SENDFILE_IN, IFT_SENDFILE_OUT } type; + struct file_transfer *xfer; + char *sn; + char *name; + int len; + int watcher; + char ip[12]; + int port; + int fd; + int cur; + struct gaim_connection *gc; +}; + GSList *dcc_chat_list = NULL; struct irc_data { @@ -78,6 +92,7 @@ gboolean in_whois; gboolean in_list; GString *liststr; + GSList *file_transfers; }; struct dcc_chat * @@ -445,6 +460,27 @@ } } +static void irc_file_transfer_do(struct gaim_connection *gc, struct irc_file_transfer *ift) { + struct irc_data *id = (struct irc_data *)gc->proto_data; + + /* Ok, we better be receiving some crap here boyeee */ + if (transfer_in_do(ift->xfer, ift->fd, ift->name, ift->len)) { + gaim_input_remove(ift->watcher); + ift->watcher = 0; + } +} + + +void dcc_recv_callback (gpointer data, gint source, GaimInputCondition condition) { + struct irc_file_transfer *ift = data; + + ift->fd = source; + + printf("WELL, we should be doing something then, should we not?\n"); + + irc_file_transfer_do(ift->gc, ift); +} + void dcc_chat_callback (gpointer data, gint source, GaimInputCondition condition) { struct dcc_chat *chat = data; struct conversation *convo = new_conversation (chat->nick); @@ -1009,6 +1045,8 @@ memcpy(chat, data, sizeof(struct dcc_chat)); /* we have to make a new one * because the old one get's freed by * dcc_chat_cancel. */ + + printf("ONE MORE TIME: %s:%d\n", chat->ip_address, chat->port); proxy_connect(chat->ip_address, chat->port, dcc_chat_callback, chat); } @@ -1055,12 +1093,34 @@ struct dcc_chat * dccchat = g_new0(struct dcc_chat, 1); dccchat->gc = gc; g_snprintf(dccchat->ip_address, sizeof(dccchat->ip_address), chat_args[3]); + printf("DCC CHAT DEBUG CRAP: %s\n", dccchat->ip_address); dccchat->port=atoi(chat_args[4]); g_snprintf(dccchat->nick, sizeof(dccchat->nick), nick); g_snprintf(ask, sizeof(ask), _("%s has requested a DCC chat. " "Would you like to establish the direct connection?"), nick); do_ask_dialog(ask, dccchat, dcc_chat_init, dcc_chat_cancel); } + + + if (!g_strncasecmp(msg, "DCC SEND", 8)) { + struct irc_file_transfer *ift = g_new0(struct irc_file_transfer, 1); + char **send_args = g_strsplit(msg, " ", 6); + send_args[5][strlen(send_args[5])-1] = 0; + + ift->type = IFT_SENDFILE_IN; + ift->sn = g_strdup(nick); + ift->gc = gc; + g_snprintf(ift->ip, sizeof(ift->ip), send_args[3]); + ift->port = atoi(send_args[4]); + ift->len = atoi(send_args[5]); + ift->name = g_strdup(send_args[2]); + ift->cur = 0; + + id->file_transfers = g_slist_append(id->file_transfers, ift); + + ift->xfer = transfer_in_add(gc, nick, ift->name, ift->len, 1, NULL); + } + /* XXX should probably write_to_conv or something here */ } @@ -1895,6 +1955,102 @@ dcc_chat_list = g_slist_append (dcc_chat_list, chat); } +static void irc_ask_send_file(struct gaim_connection *gc, char *destsn) { + struct irc_data *id = (struct irc_data *)gc->proto_data; + struct irc_file_transfer *ift = g_new0(struct irc_file_transfer, 1); + + ift->type = IFT_SENDFILE_OUT; + ift->sn = g_strdup(destsn); + ift->gc = gc; + id->file_transfers = g_slist_append(id->file_transfers, ift); + ift->xfer = transfer_out_add(gc, ift->sn); +} + + +static struct irc_file_transfer *find_ift_by_xfer(struct gaim_connection *gc, + struct file_transfer *xfer) { + + GSList *g = ((struct irc_data *)gc->proto_data)->file_transfers; + struct irc_file_transfer *f = NULL; + + while (g) { + f = (struct irc_file_transfer *)g->data; + if (f->xfer == xfer) + break; + g = g->next; + f = NULL; + } + + return f; +} + +static void irc_file_transfer_data_chunk(struct gaim_connection *gc, struct file_transfer *xfer, const char *data, int len) { + struct irc_data *id = (struct irc_data *)gc->proto_data; + struct irc_file_transfer *ift = find_ift_by_xfer(gc, xfer); + guint32 pos; + + ift->cur += len; + pos = htonl(ift->cur); + write(ift->fd, (char *)&pos, 4); + + printf("Cheap-O Progress Bar (%s) %d of %d: %2.0f\%\n", ift->name, ift->cur, ift->len, ((float)ift->cur/(float)ift->len) * 100); +} + +static void irc_file_transfer_cancel (struct gaim_connection *gc, struct file_transfer *xfer) { + struct irc_data *id = (struct irc_data *)gc->proto_data; + struct irc_file_transfer *ift = find_ift_by_xfer(gc, xfer); + + printf("Our shit got canceled, yo!\n"); + + /* Remove the FT from our list of transfers */ + id->file_transfers = g_slist_remove(id->file_transfers, ift); + + gaim_input_remove(ift->watcher); + + /* Close our FT because we're done */ + close(ift->fd); + + g_free(ift->sn); + g_free(ift->name); + + g_free(ift); +} + +static void irc_file_transfer_done(struct gaim_connection *gc, struct file_transfer *xfer) { + struct irc_data *id = (struct irc_data *)gc->proto_data; + struct irc_file_transfer *ift = find_ift_by_xfer(gc, xfer); + + + printf("Our shit be done, yo.\n"); + + /* Remove the FT from our list of transfers */ + id->file_transfers = g_slist_remove(id->file_transfers, ift); + + gaim_input_remove(ift->watcher); + + /* Close our FT because we're done */ + close(ift->fd); + + g_free(ift->sn); + g_free(ift->name); + + g_free(ift); +} + +static void irc_file_transfer_in(struct gaim_connection *gc, + struct file_transfer *xfer, int offset) { + + struct irc_data *id = (struct irc_data *)gc->proto_data; + struct irc_file_transfer *ift = find_ift_by_xfer(gc, xfer); + struct sockaddr_in addr; + char *ip = (char *)malloc(32); + + ift->xfer = xfer; + printf("You, I should be getting a file or some shit, hehe\n"); + printf("Connecting to: %s %d\n", ift->ip, ift->port); + proxy_connect(ift->ip, ift->port, dcc_recv_callback, ift); +} + static void irc_start_chat(struct gaim_connection *gc, char *who) { struct dcc_chat *chat; int len; @@ -1951,11 +2107,21 @@ pbm->callback = irc_get_info; pbm->gc = gc; m = g_list_append(m, pbm); + pbm = g_new0(struct proto_buddy_menu, 1); pbm->label = _("DCC Chat"); pbm->callback = irc_start_chat; pbm->gc = gc; m = g_list_append(m, pbm); + +/* + pbm = g_new0(struct proto_buddy_menu, 1); + pbm->label = _("DCC Send"); + pbm->callback = irc_ask_send_file; + pbm->gc = gc; + m = g_list_append(m, pbm); +*/ + return m; } @@ -1983,6 +2149,11 @@ ret->buddy_menu = irc_buddy_menu; ret->chat_invite = irc_chat_invite; ret->convo_closed = irc_convo_closed; + ret->file_transfer_out = NULL; /* Implement me */ + ret->file_transfer_in = irc_file_transfer_in; + ret->file_transfer_data_chunk = irc_file_transfer_data_chunk; + ret->file_transfer_done = irc_file_transfer_done; + ret->file_transfer_cancel =irc_file_transfer_cancel; puo = g_new0(struct proto_user_opt, 1); puo->label = g_strdup("Server:"); @@ -1996,7 +2167,7 @@ puo->pos = USEROPT_PORT; ret->user_opts = g_list_append(ret->user_opts, puo); - my_protocol = ret; + my_protocol = ret; } #ifndef STATIC |
From: Rob F. <rob...@us...> - 2002-10-09 06:09:13
|
Update of /cvsroot/gaim/gaim In directory usw-pr-cvs1:/tmp/cvs-serv24943 Modified Files: ChangeLog Log Message: IRC file receive support. This may be a little odd at the moment. It is also a little spammy on the console. I did this so I could make sure things were working until I get a GUI designed for FT stuff. I'll try to do that tomorrow night. Could some people test this and let me know what you think. Index: ChangeLog =================================================================== RCS file: /cvsroot/gaim/gaim/ChangeLog,v retrieving revision 1.554 retrieving revision 1.555 diff -u -d -r1.554 -r1.555 --- ChangeLog 6 Oct 2002 05:01:49 -0000 1.554 +++ ChangeLog 9 Oct 2002 06:09:10 -0000 1.555 @@ -81,6 +81,7 @@ (Thanks Mark Doliner) * Improved typing notification support for Jabber and Yahoo! (Thanks Nathan Walp) + * DCC File Receive support for IRC version 0.59 (06/24/2002): * Hungarian translation added (Thanks, Sutto Zoltan) |
From: Sean E. <sea...@us...> - 2002-10-09 05:59:36
|
Update of /cvsroot/gaim/gaim/src In directory usw-pr-cvs1:/tmp/cvs-serv21820/src Modified Files: gtkimhtml.c Log Message: Thanks Ari Pollak--got rid of the Gtk-Critical warnings in Chips patch Index: gtkimhtml.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/gtkimhtml.c,v retrieving revision 1.122 retrieving revision 1.123 diff -u -d -r1.122 -r1.123 --- gtkimhtml.c 9 Oct 2002 05:47:38 -0000 1.122 +++ gtkimhtml.c 9 Oct 2002 05:59:33 -0000 1.123 @@ -63,7 +63,7 @@ #define POINT_SIZE(x) (_point_sizes [MIN ((x), MAX_FONT_SIZE) - 1]) static gint _point_sizes [] = { 8, 10, 12, 14, 20, 30, 40 }; -#define DEFAULT_PRE_FACE "courier" +#define DEFAULT_PRE_FACE "sans" #define BORDER_SIZE 2 #define TOP_BORDER 10 @@ -691,8 +691,6 @@ gdk_color_free (bg); gdk_color_free (fg); - - gdk_gc_unref (gc); } @@ -2402,16 +2400,16 @@ else width = 0; - metrics = pango_context_get_metrics(imhtml->context, bit->font, NULL); - li = g_new0 (struct line_info, 1); li->x = imhtml->x; li->y = imhtml->y; li->width = width; li->height = imhtml->llheight; - if (text) + if (text) { + metrics = pango_context_get_metrics(imhtml->context, bit->font, NULL); li->ascent = MAX (imhtml->llascent, pango_font_metrics_get_ascent(metrics) / PANGO_SCALE); - else + pango_font_metrics_unref(metrics); + } else li->ascent = 0; li->text = text; li->bit = bit; @@ -2429,8 +2427,6 @@ bit->chunks = g_list_append (bit->chunks, li); imhtml->line = g_list_append (imhtml->line, li); - - pango_font_metrics_unref(metrics); } static void @@ -2480,7 +2476,6 @@ g_return_if_fail (GTK_IS_IMHTML (imhtml)); g_return_if_fail (bit != NULL); - metrics = pango_context_get_metrics(imhtml->context, bit->font, NULL); if ( ((bit->type == TYPE_TEXT) || ((bit->type == TYPE_SMILEY) && !imhtml->smileys) || @@ -2491,6 +2486,7 @@ gboolean seenspace = FALSE; gchar *tmp; + metrics = pango_context_get_metrics(imhtml->context, bit->font, NULL); height = (pango_font_metrics_get_ascent(metrics) + pango_font_metrics_get_descent(metrics)) / PANGO_SCALE; width = string_width (imhtml->context, bit->font, bit->text); @@ -2553,7 +2549,8 @@ } } - g_free (copy); + pango_font_metrics_unref(metrics); + g_free(copy); } else if ((bit->type == TYPE_SMILEY) || (bit->type == TYPE_IMG)) { if (bit->img) { GdkPixbuf *imagepb = bit->img->pb; @@ -2615,7 +2612,6 @@ add_text_renderer (imhtml, bit, NULL); } - pango_font_metrics_unref(metrics); } void @@ -2720,7 +2716,6 @@ if (((bit->type == TYPE_TEXT) || (bit->type == TYPE_SMILEY) || (bit->type == TYPE_COMMENT)) && (bit->font == NULL)) bit->font = pango_font_description_copy (imhtml->default_font); -// bit->font = gdk_font_ref (imhtml->default_font); if (bg != NULL) bit->bg = gdk_color_copy (bg); |
From: Sean E. <sea...@us...> - 2002-10-09 05:47:41
|
Update of /cvsroot/gaim/gaim/src In directory usw-pr-cvs1:/tmp/cvs-serv17575/src Modified Files: gtkimhtml.c Log Message: Somewhat faster Pangonated gtkimhtml by Christian Hammond Index: gtkimhtml.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/gtkimhtml.c,v retrieving revision 1.121 retrieving revision 1.122 diff -u -d -r1.121 -r1.122 --- gtkimhtml.c 8 Oct 2002 23:45:20 -0000 1.121 +++ gtkimhtml.c 9 Oct 2002 05:47:38 -0000 1.122 @@ -449,15 +449,17 @@ text_width(PangoContext *context, PangoFontDescription *desc, const char *text, gint len) { - PangoLayout *layout; + static PangoLayout *layout = NULL; int width; - layout = pango_layout_new(context); + if (layout == NULL) + layout = pango_layout_new(context); + pango_layout_set_font_description(layout, desc); pango_layout_set_text(layout, text, len); pango_layout_get_pixel_size(layout, &width, NULL); - g_object_unref(G_OBJECT(layout)); + /* g_object_unref(G_OBJECT(layout)); */ return width; } |
From: Sean E. <sea...@us...> - 2002-10-09 05:46:05
|
Update of /cvsroot/gaim/gaim/src/protocols/jabber In directory usw-pr-cvs1:/tmp/cvs-serv17169/src/protocols/jabber Modified Files: jabber.c Log Message: Also by faceprint--a Jabber fix. Index: jabber.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/jabber/jabber.c,v retrieving revision 1.66 retrieving revision 1.67 diff -u -d -r1.66 -r1.67 --- jabber.c 6 Oct 2002 05:01:49 -0000 1.66 +++ jabber.c 9 Oct 2002 05:46:02 -0000 1.67 @@ -2190,7 +2190,7 @@ gaim_input_remove(gc->inpa); if(jd) { - g_timeout_add(50, jabber_free, jd); + g_timeout_add(0, jabber_free, jd); if(jd->gjc != NULL) xmlnode_free(jd->gjc->current); } |
From: Sean E. <sea...@us...> - 2002-10-09 05:45:22
|
Update of /cvsroot/gaim/gaim/src In directory usw-pr-cvs1:/tmp/cvs-serv16995/src Modified Files: conversation.c Log Message: Definitely better typing notification by Faceprint. Index: conversation.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/conversation.c,v retrieving revision 1.385 retrieving revision 1.386 diff -u -d -r1.385 -r1.386 --- conversation.c 6 Oct 2002 07:56:14 -0000 1.385 +++ conversation.c 9 Oct 2002 05:45:19 -0000 1.386 @@ -823,6 +823,8 @@ gtk_notebook_next_page(notebook); } +#define SEND_TYPED_TIMEOUT 5000 + gboolean send_typed(gpointer data) { struct conversation *c = (struct conversation*)data; @@ -1079,34 +1081,28 @@ if (c && (!(misc_options & OPT_MISC_STEALTH_TYPING)) && !c->is_chat) { char *txt = gtk_editable_get_chars(GTK_EDITABLE(c->entry), 0, -1); - if (gdk_keyval_to_unicode(event->keyval) && - (strlen(txt) == 0 || (c->type_again != 0 && time(NULL) > c->type_again))) { - int timeout = serv_send_typing(c->gc, c->name, TYPING); - if (timeout) - c->type_again = time(NULL) + timeout; - else - c->type_again = 0; - + if (strlen(txt) == 1 && ((GTK_OLD_EDITABLE(c->entry)->current_pos == 1 && event->keyval == GDK_BackSpace) || + (GTK_OLD_EDITABLE(c->entry)->current_pos == 0 && event->keyval == GDK_Delete))) { if (c && c->type_again_timeout) gtk_timeout_remove(c->type_again_timeout); - /* send TYPED after 5 seconds of not typing */ - c->type_again_timeout = gtk_timeout_add(5000, send_typed, (gpointer)c); + serv_send_typing(c->gc, c->name, NOT_TYPING); + } else if (GTK_OLD_EDITABLE(c->entry)->selection_start_pos == 0 && (GTK_OLD_EDITABLE(c->entry)->selection_end_pos == strlen(txt) && + strlen(txt) > 0 && (event->keyval == GDK_BackSpace || event->keyval == GDK_Delete))) { + if (c && c->type_again_timeout) + gtk_timeout_remove(c->type_again_timeout); + serv_send_typing(c->gc, c->name, NOT_TYPING); } - else if (strlen(txt) == 1) { - if ((GTK_OLD_EDITABLE(c->entry)->current_pos == 1 && event->keyval == GDK_BackSpace) || - (GTK_OLD_EDITABLE(c->entry)->current_pos == 0 && event->keyval == GDK_Delete)) { - if (c && c->type_again_timeout) - gtk_timeout_remove(c->type_again_timeout); - serv_send_typing(c->gc, c->name, NOT_TYPING); - } - } else if (GTK_OLD_EDITABLE(c->entry)->selection_start_pos == 0) { - if (GTK_OLD_EDITABLE(c->entry)->selection_end_pos == strlen(txt) && - strlen(txt) > 0 && - (event->keyval == GDK_BackSpace || event->keyval == GDK_Delete)) { - if (c && c->type_again_timeout) - gtk_timeout_remove(c->type_again_timeout); - serv_send_typing(c->gc, c->name, NOT_TYPING); + else if (gdk_keyval_to_unicode(event->keyval) || event->keyval == GDK_BackSpace || event->keyval == GDK_Delete) { + if (strlen(txt) == 0 || (c->type_again != 0 && time(NULL) > c->type_again)) { + int timeout = serv_send_typing(c->gc, c->name, TYPING); + if (timeout) + c->type_again = time(NULL) + timeout; + else + c->type_again = 0; } + if (c->type_again_timeout) + gtk_timeout_remove(c->type_again_timeout); + c->type_again_timeout = gtk_timeout_add(SEND_TYPED_TIMEOUT, send_typed, (gpointer)c); } g_free(txt); } |
From: Sean E. <sea...@us...> - 2002-10-09 05:44:00
|
Update of /cvsroot/gaim/web/htdocs/sean In directory usw-pr-cvs1:/tmp/cvs-serv16635/htdocs/sean Modified Files: index.php Added Files: gtkimhtml2.diff Log Message: This is for testing. --- NEW FILE: gtkimhtml2.diff --- ? compile ? gtkimhtml2.diff Index: src/conversation.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/conversation.c,v retrieving revision 1.385 diff -u -r1.385 conversation.c --- src/conversation.c 6 Oct 2002 07:56:14 -0000 1.385 +++ src/conversation.c 9 Oct 2002 05:38:26 -0000 @@ -2876,8 +2876,6 @@ text = gtk_imhtml_new(NULL, NULL); c->text = text; gtk_container_add(GTK_CONTAINER(sw), text); - GTK_LAYOUT(text)->hadjustment->step_increment = 10.0; - GTK_LAYOUT(text)->vadjustment->step_increment = 10.0; if (convo_options & OPT_CONVO_SHOW_TIME) gtk_imhtml_show_comments(GTK_IMHTML(text), TRUE); gaim_setup_imhtml(text); Index: src/gtkimhtml.c [...3795 lines suppressed...] }; @@ -103,16 +67,14 @@ } GtkIMHtmlOptions; GtkType gtk_imhtml_get_type (void); -GtkWidget* gtk_imhtml_new (GtkAdjustment *hadj, - GtkAdjustment *vadj); +GtkWidget* gtk_imhtml_new (void *, void *); void gtk_imhtml_set_adjustments (GtkIMHtml *imhtml, GtkAdjustment *hadj, GtkAdjustment *vadj); void gtk_imhtml_set_defaults (GtkIMHtml *imhtml, - GdkFont *font, - //PangoFontDescription *font, + PangoFontDescription *font, GdkColor *fg_color, GdkColor *bg_color); Index: index.php =================================================================== RCS file: /cvsroot/gaim/web/htdocs/sean/index.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- index.php 26 Sep 2002 10:23:23 -0000 1.1.1.1 +++ index.php 9 Oct 2002 05:43:57 -0000 1.2 @@ -3,9 +3,9 @@ start_html("Sean's Page"); - start_section("Sean's Page"); + start_section("Patches"); ?> -Nothing yet. +<a href="gtkimhtml2.diff">gtkimhtml2.diff</a> - Groundwork for a new gtkimhtml widget inhereting from GtkTextView. <?php end_section() ?> <?php |
From: Rob F. <rob...@us...> - 2002-10-09 05:19:47
|
Update of /cvsroot/gaim/gaim/src In directory usw-pr-cvs1:/tmp/cvs-serv9197 Modified Files: ft.c Log Message: bad bad bad Index: ft.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/ft.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ft.c 9 Oct 2002 04:55:57 -0000 1.2 +++ ft.c 9 Oct 2002 05:19:45 -0000 1.3 @@ -452,7 +452,7 @@ static int ft_mkdir_help(char *dir) { int ret; - ret = mkdir(dir, 0777); + ret = mkdir(dir, 0775); if (ret) { char *index = strrchr(dir, G_DIR_SEPARATOR); if (!index) @@ -461,7 +461,7 @@ ret = ft_mkdir_help(dir); *index = G_DIR_SEPARATOR; if (!ret) - ret = mkdir(dir, 0777); + ret = mkdir(dir, 0775); } return ret; |
From: Rob F. <rob...@us...> - 2002-10-09 04:56:00
|
Update of /cvsroot/gaim/gaim/src In directory usw-pr-cvs1:/tmp/cvs-serv544 Modified Files: ft.c Log Message: Thanks much to Wil Mahan :) (thats with one l ;-)) Index: ft.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/ft.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ft.c 9 Oct 2002 04:55:29 -0000 1.1 +++ ft.c 9 Oct 2002 04:55:57 -0000 1.2 @@ -75,8 +75,7 @@ static int ft_choose_file(gpointer a, struct file_transfer *xfer); static void ft_cancel(gpointer w, struct file_transfer *xfer); static void ft_delete(struct file_transfer *xfer); -static void ft_callback(gpointer data, gint source, - GaimInputCondition condition); +static void ft_callback(gpointer data, gint source, GaimInputCondition condition); static void ft_nextfile(struct file_transfer *xfer); static int ft_mkdir(const char *name); static int ft_mkdir_help(char *dir); |
From: Rob F. <rob...@us...> - 2002-10-09 04:55:32
|
Update of /cvsroot/gaim/gaim/src In directory usw-pr-cvs1:/tmp/cvs-serv367 Modified Files: Makefile.am prpl.h Added Files: ft.c Log Message: First draft of the file transfer prpl interface. --- NEW FILE: ft.c --- /* * gaim - file transfer functions * * Copyright (C) 2002, Wil Mahan <wt...@du...> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ifdef HAVE_CONFIG_H #include <config.h> #endif #include <sys/stat.h> #include <unistd.h> #include <errno.h> #include <string.h> #define FT_BUFFER_SIZE (4096) #include <gtk/gtk.h> #include "gaim.h" #include "proxy.h" #include "prpl.h" /* Completely describes a file transfer. Opaque to callers. */ struct file_transfer { enum { FILE_TRANSFER_TYPE_SEND, FILE_TRANSFER_TYPE_RECEIVE } type; enum { FILE_TRANSFER_STATE_ASK, /* waiting for confirmation */ FILE_TRANSFER_STATE_CHOOSEFILE, /* waiting for file dialog */ FILE_TRANSFER_STATE_TRANSFERRING, /* in actual transfer */ FILE_TRANSFER_STATE_INTERRUPTED, /* other user canceled */ FILE_TRANSFER_STATE_CANCELED, /* we canceled */ FILE_TRANSFER_STATE_DONE, /* transfer complete */ FILE_TRANSFER_STATE_CLEANUP /* freeing memory */ } state; char *who; /* file selection dialog */ GtkWidget *w; char **names; int *sizes; char *dir; char *initname; FILE *file; /* connection info */ struct gaim_connection *gc; int fd; int watcher; /* state */ int totfiles; int filesdone; int totsize; int bytessent; int bytesleft; }; static int ft_choose_file(gpointer a, struct file_transfer *xfer); static void ft_cancel(gpointer w, struct file_transfer *xfer); static void ft_delete(struct file_transfer *xfer); static void ft_callback(gpointer data, gint source, GaimInputCondition condition); static void ft_nextfile(struct file_transfer *xfer); static int ft_mkdir(const char *name); static int ft_mkdir_help(char *dir); static struct file_transfer *ft_new(int type, struct gaim_connection *gc, const char *who) { struct file_transfer *xfer = g_new0(struct file_transfer, 1); xfer->type = type; xfer->state = FILE_TRANSFER_STATE_ASK; xfer->gc = gc; xfer->who = g_strdup(who); xfer->filesdone = 0; return xfer; } struct file_transfer *transfer_in_add(struct gaim_connection *gc, const char *who, const char *initname, int totsize, int totfiles, const char *msg) { struct file_transfer *xfer = ft_new(FILE_TRANSFER_TYPE_RECEIVE, gc, who); char *buf; static const char *sizestr[4] = { "bytes", "KB", "MB", "GB" }; float sizemag = (float)totsize; int szindex = 0; xfer->initname = g_strdup(initname); xfer->totsize = totsize; xfer->totfiles = totfiles; xfer->filesdone = 0; /* Ask the user whether he or she accepts the transfer. */ while ((szindex < 4) && (sizemag > 1024)) { sizemag /= 1024; szindex++; } if (xfer->totfiles == 1) buf = g_strdup_printf(_("%s requests that %s accept a file: %s (%.3g %s)"), who, xfer->gc->username, initname, sizemag, sizestr[szindex]); else buf = g_strdup_printf(_("%s requests that %s accept %d files: %s (%.3g %s)"), who, xfer->gc->username, xfer->totfiles, initname, sizemag, sizestr[szindex]); if (msg) { char *newmsg = g_strconcat(buf, ": ", msg, NULL); g_free(buf); buf = newmsg; } do_ask_dialog(buf, xfer, ft_choose_file, ft_cancel); g_free(buf); return xfer; } struct file_transfer *transfer_out_add(struct gaim_connection *gc, const char *who) { struct file_transfer *xfer = ft_new(FILE_TRANSFER_TYPE_SEND, gc, who); ft_choose_file(NULL, xfer); return xfer; } /* We canceled the transfer, either by declining the initial * confirmation dialog or canceling the file dialog. */ static void ft_cancel(gpointer w, struct file_transfer *xfer) { /* Make sure we weren't aborted while waiting for * confirmation from the user. */ if (xfer->state == FILE_TRANSFER_STATE_INTERRUPTED) { xfer->state = FILE_TRANSFER_STATE_CLEANUP; transfer_abort(xfer, NULL); return; } xfer->state = FILE_TRANSFER_STATE_CANCELED; if (xfer->w) { gtk_widget_destroy(xfer->w); xfer->w = NULL; } if (xfer->gc->prpl->file_transfer_cancel) xfer->gc->prpl->file_transfer_cancel(xfer->gc, xfer); ft_delete(xfer); } /* This is called when the other user aborts the transfer, * possibly in the middle of a transfer. */ int transfer_abort(struct file_transfer *xfer, const char *why) { if (xfer->state == FILE_TRANSFER_STATE_INTERRUPTED) { /* If for some reason we have already been * here and are waiting on some event before * cleaning up, but we get another abort request, * we don't need to do anything else. */ return 1; } else if (xfer->state == FILE_TRANSFER_STATE_ASK) { /* Kludge: since there is no way to kill a * do_ask_dialog() window, we just note the * status here and clean up after the user * makes a selection. */ xfer->state = FILE_TRANSFER_STATE_INTERRUPTED; return 1; } else if (xfer->state == FILE_TRANSFER_STATE_TRANSFERRING) { if (xfer->watcher) { gaim_input_remove(xfer->watcher); xfer->watcher = 0; } if (xfer->file) { fclose(xfer->file); xfer->file = NULL; } /* XXX theoretically, there is a race condition here, * because we could be inside ft_callback() when we * free xfer below, with undefined results. Since * we use non-blocking IO, this doesn't seem to be * a problem, but it still makes me nervous--I don't * know how to fix it other than using locks, though. * -- wtm */ } else if (xfer->state == FILE_TRANSFER_STATE_CHOOSEFILE) { /* It's safe to clean up now. Just make sure we * destroy the dialog window first. */ if (xfer->w) { gtk_signal_disconnect_by_func(GTK_OBJECT(xfer->w), GTK_SIGNAL_FUNC(ft_cancel), xfer); gtk_widget_destroy(xfer->w); xfer->w = NULL; } } /* Let the user know that we were aborted, unless we already * finished or the user aborted first. */ /* if ((xfer->state != FILE_TRANSFER_STATE_DONE) && (xfer->state != FILE_TRANSFER_STATE_CANCELED)) { */ if (why) { char *msg; if (xfer->type == FILE_TRANSFER_TYPE_SEND) msg = g_strdup_printf(_("File transfer to %s aborted."), xfer->who); else msg = g_strdup_printf(_("File transfer from %s aborted."), xfer->who); do_error_dialog(msg, why, GAIM_ERROR); g_free(msg); } ft_delete(xfer); return 0; } static void ft_delete(struct file_transfer *xfer) { if (xfer->names) g_strfreev(xfer->names); if (xfer->initname) g_free(xfer->initname); if (xfer->who) g_free(xfer->who); if (xfer->sizes) g_free(xfer->sizes); g_free(xfer); } static void ft_choose_ok(gpointer a, struct file_transfer *xfer) { gboolean exists, is_dir; struct stat st; const char *err = NULL; xfer->names = gtk_file_selection_get_selections(GTK_FILE_SELECTION(xfer->w)); exists = !stat(*xfer->names, &st); is_dir = (exists) ? S_ISDIR(st.st_mode) : 0; if (exists) { if (xfer->type == FILE_TRANSFER_TYPE_RECEIVE) /* XXX overwrite/append/cancel prompt */ err = _("That file already exists; please choose another name."); else { /* (xfer->type == FILE_TRANSFER_TYPE_SEND) */ char **cur; /* First find the total number of files, * so we know how much space to allocate. */ xfer->totfiles = 0; for (cur = xfer->names; *cur; cur++) { xfer->totfiles++; } /* Now get sizes for each file. */ xfer->totsize = st.st_size; xfer->sizes = g_malloc(xfer->totfiles * sizeof(*xfer->sizes)); xfer->sizes[0] = st.st_size; for (cur = xfer->names + 1; *cur; cur++) { exists = !stat(*cur, &st); if (!exists) { err = _("File not found."); break; } xfer->sizes[cur - xfer->names] = st.st_size; xfer->totsize += st.st_size; } } } else { /* doesn't exist */ if (xfer->type == FILE_TRANSFER_TYPE_SEND) err = _("File not found."); else if (xfer->totfiles > 1) { if (!xfer->names[0] || xfer->names[1]) { err = _("You may only choose one new directory."); } else { if (ft_mkdir(*xfer->names)) err = _("Unable to create directory."); else xfer->dir = g_strconcat(xfer->names[0], "/", NULL); } } } if (err) do_error_dialog(err, NULL, GAIM_ERROR); else { /* File name looks valid */ gtk_widget_destroy(xfer->w); xfer->w = NULL; if (xfer->type == FILE_TRANSFER_TYPE_SEND) { char *desc; if (xfer->totfiles == 1) desc = *xfer->names; else /* XXX what else? */ desc = "*"; /* desc = g_path_get_basename(g_path_get_dirname(*xfer->names)); */ xfer->gc->prpl->file_transfer_out(xfer->gc, xfer, desc, xfer->totfiles, xfer->totsize); } else xfer->gc->prpl->file_transfer_in(xfer->gc, xfer, 0); /* XXX */ } } /* Called on outgoing transfers to get information about the * current file. */ int transfer_get_file_info(struct file_transfer *xfer, int *size, char **name) { *size = xfer->sizes[xfer->filesdone]; *name = xfer->names[xfer->filesdone]; return 0; } static int ft_choose_file(gpointer a, struct file_transfer *xfer) { char *curdir = g_get_current_dir(); /* should be freed */ char *initstr; /* If the connection is interrupted while we are waiting * for do_ask_dialog(), then we can't clean up until we * get here, after the user makes a selection. */ if (xfer->state == FILE_TRANSFER_STATE_INTERRUPTED) { xfer->state = FILE_TRANSFER_STATE_CLEANUP; transfer_abort(xfer, NULL); return 1; } xfer->state = FILE_TRANSFER_STATE_CHOOSEFILE; if (xfer->type == FILE_TRANSFER_TYPE_RECEIVE) xfer->w = gtk_file_selection_new(_("Gaim - Save As...")); else /* (xfer->type == FILE_TRANSFER_TYPE_SEND) */ { xfer->w = gtk_file_selection_new(_("Gaim - Open...")); gtk_file_selection_set_select_multiple(GTK_FILE_SELECTION(xfer->w), 1); } if (xfer->initname) { initstr = g_strdup_printf("%s/%s", curdir, xfer->initname); } else initstr = g_strconcat(curdir, "/", NULL); g_free(curdir); gtk_file_selection_set_filename(GTK_FILE_SELECTION(xfer->w), initstr); g_free(initstr); gtk_signal_connect(GTK_OBJECT(xfer->w), "delete_event", GTK_SIGNAL_FUNC(ft_cancel), xfer); gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(xfer->w)->cancel_button), "clicked", GTK_SIGNAL_FUNC(ft_cancel), xfer); gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(xfer->w)->ok_button), "clicked", GTK_SIGNAL_FUNC(ft_choose_ok), xfer); gtk_widget_show(xfer->w); return 0; } static int ft_open_file(struct file_transfer *xfer, const char *filename, int offset) { char *err = NULL; if (xfer->type == FILE_TRANSFER_TYPE_RECEIVE) { xfer->file = fopen(filename, (offset > 0) ? "a" : "w"); if (!xfer->file) err = g_strdup_printf(_("Could not open %s for writing: %s"), filename, g_strerror(errno)); } else /* (xfer->type == FILE_TRANSFER_TYPE_SEND) */ { xfer->file = fopen(filename, "r"); if (!xfer->file) err = g_strdup_printf(_("Could not open %s for reading: %s"), filename, g_strerror(errno)); } if (err) { do_error_dialog(err, NULL, GAIM_ERROR); g_free(err); return -1; } fseek(xfer->file, offset, SEEK_SET); return 0; } /* Takes a full file name, and creates any directories above it * that don't exist already. */ static int ft_mkdir(const char *name) { int ret = 0; struct stat st; mode_t m = umask(0077); char *dir; dir = g_path_get_dirname(name); if (stat(dir, &st)) ret = ft_mkdir_help(dir); g_free(dir); umask(m); return ret; } /* Two functions, one recursive, just to make a directory. Yuck. */ static int ft_mkdir_help(char *dir) { int ret; ret = mkdir(dir, 0777); if (ret) { char *index = strrchr(dir, G_DIR_SEPARATOR); if (!index) return -1; *index = '\0'; ret = ft_mkdir_help(dir); *index = G_DIR_SEPARATOR; if (!ret) ret = mkdir(dir, 0777); } return ret; } int transfer_in_do(struct file_transfer *xfer, int fd, const char *filename, int size) { char *fullname; xfer->state = FILE_TRANSFER_STATE_TRANSFERRING; xfer->fd = fd; xfer->bytesleft = size; /* XXX implement resuming incoming transfers */ #if 0 if (xfer->sizes) xfer->bytesleft -= xfer->sizes[0]; #endif /* Security check */ if (g_strrstr(filename, "..")) { xfer->state = FILE_TRANSFER_STATE_CLEANUP; transfer_abort(xfer, _("Invalid incoming filename component")); return -1; } if (xfer->totfiles > 1) fullname = g_strconcat(xfer->dir, filename, NULL); else /* Careful: filename is the name on the *other* * end; don't use it here. */ fullname = g_strdup(xfer->names[xfer->filesdone]); if (ft_mkdir(fullname)) { xfer->state = FILE_TRANSFER_STATE_CLEANUP; transfer_abort(xfer, _("Invalid incoming filename")); return -1; } if (!ft_open_file(xfer, fullname, 0)) { /* Special case: if we are receiving an empty file, * we would never enter the callback. Just avoid the * callback altogether. */ if (xfer->bytesleft == 0) ft_nextfile(xfer); else xfer->watcher = gaim_input_add(fd, GAIM_INPUT_READ, ft_callback, xfer); } else { /* Error opening file */ xfer->state = FILE_TRANSFER_STATE_CLEANUP; transfer_abort(xfer, NULL); g_free(fullname); return -1; } g_free(fullname); return 0; } int transfer_out_do(struct file_transfer *xfer, int fd, int offset) { xfer->state = FILE_TRANSFER_STATE_TRANSFERRING; xfer->fd = fd; xfer->bytesleft = xfer->sizes[xfer->filesdone] - offset; if (!ft_open_file(xfer, xfer->names[xfer->filesdone], offset)) { /* Special case: see transfer_in_do(). */ if (xfer->bytesleft == 0) ft_nextfile(xfer); else xfer->watcher = gaim_input_add(fd, GAIM_INPUT_WRITE, ft_callback, xfer); } else { /* Error opening file */ xfer->state = FILE_TRANSFER_STATE_CLEANUP; transfer_abort(xfer, NULL); return -1; } return 0; } static void ft_callback(gpointer data, gint source, GaimInputCondition condition) { struct file_transfer *xfer = (struct file_transfer *)data; int rt, i; char buf[FT_BUFFER_SIZE]; if (condition & GAIM_INPUT_READ) { rt = read(xfer->fd, buf, MIN(xfer->bytesleft, FT_BUFFER_SIZE)); /* XXX What if the transfer is interrupted while we * are inside read()? How can this be handled safely? * -- wtm */ if (rt > 0) { xfer->bytesleft -= rt; for (i = 0; i < rt; i++) { fprintf(xfer->file, "%c", buf[i]); } } } else /* (condition & GAIM_INPUT_WRITE) */ { int remain = MIN(xfer->bytesleft, FT_BUFFER_SIZE); for (i = 0; i < remain; i++) fscanf(xfer->file, "%c", &buf[i]); rt = write(xfer->fd, buf, remain); if (rt > 0) xfer->bytesleft -= rt; } if (rt < 0) return; xfer->bytessent += rt; if (xfer->gc->prpl->file_transfer_data_chunk) xfer->gc->prpl->file_transfer_data_chunk(xfer->gc, xfer, buf, rt); if (rt > 0 && xfer->bytesleft == 0) { /* We are done with this file! */ gaim_input_remove(xfer->watcher); xfer->watcher = 0; fclose(xfer->file); xfer->file = 0; ft_nextfile(xfer); } } static void ft_nextfile(struct file_transfer *xfer) { debug_printf("file transfer %d of %d done\n", xfer->filesdone + 1, xfer->totfiles); if (++xfer->filesdone == xfer->totfiles) { char *msg; char *msg2; xfer->gc->prpl->file_transfer_done(xfer->gc, xfer); if (xfer->type == FILE_TRANSFER_TYPE_RECEIVE) msg = g_strdup_printf(_("File transfer from %s to %s completed successfully."), xfer->who, xfer->gc->username); else msg = g_strdup_printf(_("File transfer from %s to %s completed successfully."), xfer->gc->username, xfer->who); xfer->state = FILE_TRANSFER_STATE_DONE; if (xfer->totfiles > 1) msg2 = g_strdup_printf(_("%d files transferred."), xfer->totfiles); else msg2 = NULL; do_error_dialog(msg, msg2, GAIM_INFO); g_free(msg); if (msg2) g_free(msg2); ft_delete(xfer); } else { xfer->gc->prpl->file_transfer_nextfile(xfer->gc, xfer); } } Index: Makefile.am =================================================================== RCS file: /cvsroot/gaim/gaim/src/Makefile.am,v retrieving revision 1.54 retrieving revision 1.55 diff -u -d -r1.54 -r1.55 --- Makefile.am 26 Sep 2002 07:40:06 -0000 1.54 +++ Makefile.am 9 Oct 2002 04:55:29 -0000 1.55 @@ -10,6 +10,7 @@ conversation.c \ core.c \ dialogs.c \ + ft.c \ gaimrc.c \ gtkimhtml.c \ gtkspell.c \ Index: prpl.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/prpl.h,v retrieving revision 1.69 retrieving revision 1.70 diff -u -d -r1.69 -r1.70 --- prpl.h 30 Sep 2002 01:05:15 -0000 1.69 +++ prpl.h 9 Oct 2002 04:55:29 -0000 1.70 @@ -79,6 +79,8 @@ typedef void (*proto_init)(struct prpl *); +struct file_transfer; + struct _prpl_smiley { char *key; char **xpm; @@ -180,6 +182,14 @@ void (* convo_closed) (struct gaim_connection *, char *who); char *(* normalize)(const char *); + + /* transfer files */ + void (* file_transfer_cancel) (struct gaim_connection *, struct file_transfer *); + void (* file_transfer_in) (struct gaim_connection *, struct file_transfer *, int); + void (* file_transfer_out) (struct gaim_connection *, struct file_transfer *, const char *, int, int); + void (* file_transfer_nextfile) (struct gaim_connection *, struct file_transfer *); + void (* file_transfer_data_chunk)(struct gaim_connection *, struct file_transfer *, const char *, int); + void (* file_transfer_done) (struct gaim_connection *, struct file_transfer *); }; extern GSList *protocols; @@ -209,5 +219,19 @@ extern void *get_icon_data(struct gaim_connection *, char *, int *); extern GSList *add_smiley(GSList *, char *, char **, int) ; + +/* file transfer stuff */ +extern struct file_transfer *transfer_in_add(struct gaim_connection *gc, + const char *who, const char *filename, int totsize, + int totfiles, const char *msg); +extern struct file_transfer *transfer_out_add(struct gaim_connection *gc, + const char *who); +extern int transfer_abort(struct file_transfer *xfer, const char *why); +extern int transfer_out_do(struct file_transfer *xfer, int fd, + int offset); +extern int transfer_in_do(struct file_transfer *xfer, int fd, + const char *filename, int size); +int transfer_get_file_info(struct file_transfer *xfer, int *size, + char **name); #endif /* _PRPL_H_ */ |
From: Sean E. <sea...@us...> - 2002-10-08 23:45:23
|
Update of /cvsroot/gaim/gaim/src In directory usw-pr-cvs1:/tmp/cvs-serv5889/src Modified Files: gtkimhtml.c gtkimhtml.h Log Message: Thanks, Chip--this is just temporary--but you get nice Pangonated anti-aliased fonts. Whee! Such fun. Index: gtkimhtml.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/gtkimhtml.c,v retrieving revision 1.120 retrieving revision 1.121 diff -u -d -r1.120 -r1.121 --- gtkimhtml.c 14 Sep 2002 03:17:04 -0000 1.120 +++ gtkimhtml.c 8 Oct 2002 23:45:20 -0000 1.121 @@ -39,6 +39,8 @@ #include <gdk-pixbuf/gdk-pixbuf.h> #include <gdk-pixbuf/gdk-pixbuf-loader.h> +#include <pango/pango.h> + #include "pixmaps/angel.xpm" #include "pixmaps/bigsmile.xpm" #include "pixmaps/burp.xpm" @@ -59,7 +61,7 @@ #define MAX_FONT_SIZE 7 #define POINT_SIZE(x) (_point_sizes [MIN ((x), MAX_FONT_SIZE) - 1]) -static gint _point_sizes [] = { 80, 100, 120, 140, 200, 300, 400 }; +static gint _point_sizes [] = { 8, 10, 12, 14, 20, 30, 40 }; #define DEFAULT_PRE_FACE "courier" @@ -273,7 +275,7 @@ GdkPixmap *pm; GdkBitmap *bm; - GdkFont *font; + PangoFontDescription *font; GdkColor *fore; GdkColor *back; GdkColor *bg; @@ -346,7 +348,7 @@ g_string_free (imhtml->selected_text, TRUE); if (imhtml->default_font) - gdk_font_unref (imhtml->default_font); + pango_font_description_free (imhtml->default_font); if (imhtml->default_fg_color) gdk_color_free (imhtml->default_fg_color); if (imhtml->default_bg_color) @@ -355,7 +357,7 @@ gdk_color_free (imhtml->default_hl_color); if (imhtml->default_hlfg_color) gdk_color_free (imhtml->default_hlfg_color); - + gdk_cursor_destroy (imhtml->hand_cursor); gdk_cursor_destroy (imhtml->arrow_cursor); @@ -409,7 +411,8 @@ gdk_window_set_cursor (widget->window, imhtml->arrow_cursor); - imhtml->default_font = gdk_font_ref (gtk_style_get_font (widget->style)); + imhtml->context = gtk_widget_get_pango_context(widget); + imhtml->default_font = pango_font_description_copy(pango_context_get_font_description(imhtml->context)); gdk_window_set_background (widget->window, &widget->style->base [GTK_STATE_NORMAL]); gdk_window_set_background (GTK_LAYOUT (imhtml)->bin_window, @@ -441,6 +444,66 @@ return FALSE; } +/* This is an expensive function! Don't blame me. I only stole it from eel */ +static gint +text_width(PangoContext *context, PangoFontDescription *desc, + const char *text, gint len) +{ + PangoLayout *layout; + int width; + + layout = pango_layout_new(context); + pango_layout_set_font_description(layout, desc); + pango_layout_set_text(layout, text, len); + pango_layout_get_pixel_size(layout, &width, NULL); + + g_object_unref(G_OBJECT(layout)); + + return width; +} + +static gint +string_width(PangoContext *context, PangoFontDescription *desc, + const char *text) +{ + return text_width(context, desc, text, -1); +} + +static void +set_layout_font(PangoLayout *layout, const char *text, guint len, + PangoFontDescription *desc) +{ + PangoAttribute *attr; + PangoAttrList *list; + + if (len == -1) + len = strlen(text); + + attr = pango_attr_font_desc_new(desc); + + attr->start_index = 0; + attr->end_index = len; + + list = pango_attr_list_new(); + pango_attr_list_insert(list, attr); + + pango_layout_set_attributes(layout, list); + pango_attr_list_unref(list); + + pango_layout_set_indent(layout, 0); + pango_layout_set_justify(layout, FALSE); + pango_layout_set_alignment(layout, PANGO_ALIGN_LEFT); +} + +static gint +get_layout_first_baseline(PangoLayout* layout) +{ + PangoLayoutIter* iter = pango_layout_get_iter(layout); + gint result = pango_layout_iter_get_baseline(iter) / PANGO_SCALE; + pango_layout_iter_free(iter); + return result; +} + static void draw_text (GtkIMHtml *imhtml, struct line_info *line) @@ -451,6 +514,8 @@ GdkWindow *window = GTK_LAYOUT (imhtml)->bin_window; gfloat xoff, yoff; GdkColor *bg, *fg; + PangoLayout *layout; + PangoFontMetrics *metrics; gchar *start = NULL, *end = NULL; if (GTK_LAYOUT (imhtml)->freeze_count) @@ -484,7 +549,7 @@ gdk_color_alloc (cmap, bit->back); gdk_gc_set_foreground (gc, bit->back); gdk_draw_rectangle (window, gc, TRUE, line->x - xoff, line->y - yoff, - gdk_string_width (bit->font, line->text), line->height); + string_width (imhtml->context, bit->font, line->text), line->height); bg = bit->back; } @@ -504,12 +569,12 @@ if (start == NULL) x = 0; else - x = gdk_text_width (bit->font, line->text, start - line->text); + x = text_width (imhtml->context, bit->font, line->text, start - line->text); if (end == NULL) end = strchr(line->text, '\0'); - width = gdk_text_width (bit->font, line->text, end - line->text) - x; + width = text_width (imhtml->context, bit->font, line->text, end - line->text) - x; gdk_gc_set_foreground (gc, imhtml->default_hl_color); @@ -538,56 +603,89 @@ gdk_color_alloc (cmap, fg); gdk_gc_set_foreground (gc, fg); } + + metrics = pango_context_get_metrics(imhtml->context, bit->font, NULL); if (start) { int offset = 0; - gdk_draw_text (window, bit->font, gc, line->x - xoff, - line->y - yoff + line->ascent, line->text, start - line->text); - offset = gdk_text_width(bit->font, line->text, start - line->text); + + layout = gtk_widget_create_pango_layout(GTK_WIDGET(imhtml), NULL); + pango_layout_set_text(layout, line->text, start - line->text); + set_layout_font(layout, line->text, start - line->text, bit->font); + gdk_draw_layout(window, gc, line->x - xoff, + line->y - yoff + line->ascent - + get_layout_first_baseline(layout), layout); + g_object_unref(G_OBJECT(layout)); + + offset = text_width (imhtml->context, bit->font, line->text, start - line->text); if (bit->underline || bit->url) gdk_draw_rectangle (window, gc, TRUE, line->x - xoff, line->y - yoff + line->ascent + 1, offset, 1); if (bit->strike) gdk_draw_rectangle (window, gc, TRUE, line->x - xoff, - line->y - yoff + line->ascent - (bit->font->ascent / 2), + line->y - yoff + line->ascent - + ((pango_font_metrics_get_ascent(metrics) / PANGO_SCALE) / 2), offset, 1); gdk_gc_set_foreground (gc, imhtml->default_hlfg_color); - gdk_draw_text (window, bit->font, gc, line->x - xoff + offset, - line->y - yoff + line->ascent, start, end - start); + + layout = gtk_widget_create_pango_layout(GTK_WIDGET(imhtml), NULL); + pango_layout_set_text(layout, start, end - start); + set_layout_font(layout, start, end - start, bit->font); + gdk_draw_layout(window, gc, line->x - xoff + offset, + line->y - yoff + line->ascent - + get_layout_first_baseline(layout), layout); + g_object_unref(G_OBJECT(layout)); + if (bit->underline || bit->url) gdk_draw_rectangle (window, gc, TRUE, line->x - xoff + offset, line->y - yoff + line->ascent + 1, - gdk_text_width(bit->font, line->text, end - start), 1); + text_width (imhtml->context, bit->font, line->text, end - start), 1); if (bit->strike) gdk_draw_rectangle (window, gc, TRUE, line->x - xoff + offset, - line->y - yoff + line->ascent - (bit->font->ascent / 2), - gdk_text_width(bit->font, line->text, end - start), 1); - offset = gdk_text_width(bit->font, line->text, end - line->text); + line->y - yoff + line->ascent - + ((pango_font_metrics_get_ascent(metrics) / PANGO_SCALE) / 2), + text_width (imhtml->context, bit->font, line->text, end - start), 1); + offset = text_width (imhtml->context, bit->font, line->text, end - line->text); gdk_gc_set_foreground (gc, fg); - gdk_draw_string (window, bit->font, gc, line->x - xoff + offset, - line->y - yoff + line->ascent, end); + + layout = gtk_widget_create_pango_layout(GTK_WIDGET(imhtml), end); + set_layout_font(layout, end, -1, bit->font); + gdk_draw_layout(window, gc, line->x - xoff + offset, + line->y - yoff + line->ascent - + get_layout_first_baseline(layout), layout); + + g_object_unref(G_OBJECT(layout)); + if (bit->underline || bit->url) gdk_draw_rectangle (window, gc, TRUE, line->x - xoff + offset, line->y - yoff + line->ascent + 1, - gdk_string_width(bit->font, end), 1); + string_width (imhtml->context, bit->font, end), 1); if (bit->strike) gdk_draw_rectangle (window, gc, TRUE, line->x - xoff + offset, - line->y - yoff + line->ascent - (bit->font->ascent / 2), - gdk_string_width(bit->font, end), 1); + line->y - yoff + line->ascent - + ((pango_font_metrics_get_ascent(metrics) / PANGO_SCALE) / 2), + string_width (imhtml->context, bit->font, end), 1); } else { - gdk_draw_string (window, bit->font, gc, line->x - xoff, - line->y - yoff + line->ascent, line->text); - + layout = gtk_widget_create_pango_layout(GTK_WIDGET(imhtml), line->text); + set_layout_font(layout, line->text, -1, bit->font); + gdk_draw_layout(window, gc, line->x - xoff, + line->y - yoff + line->ascent - + get_layout_first_baseline(layout), layout); + g_object_unref(G_OBJECT(layout)); + if (bit->underline || bit->url) gdk_draw_rectangle (window, gc, TRUE, line->x - xoff, line->y - yoff + line->ascent + 1, - gdk_string_width (bit->font, line->text), 1); + string_width (imhtml->context, bit->font, line->text), 1); if (bit->strike) gdk_draw_rectangle (window, gc, TRUE, line->x - xoff, - line->y - yoff + line->ascent - (bit->font->ascent / 2), - gdk_string_width (bit->font, line->text), 1); + line->y - yoff + line->ascent - + ((pango_font_metrics_get_ascent(metrics) / PANGO_SCALE) / 2), + string_width (imhtml->context, bit->font, line->text), 1); } + pango_font_metrics_unref(metrics); + gdk_color_free (bg); gdk_color_free (fg); @@ -813,9 +911,6 @@ imhtml->default_bg_color = gdk_color_copy (>K_WIDGET (imhtml)->style->base [GTK_STATE_NORMAL]); imhtml->default_hl_color = gdk_color_copy (>K_WIDGET (imhtml)->style->bg [GTK_STATE_SELECTED]); imhtml->default_hlfg_color=gdk_color_copy (>K_WIDGET (imhtml)->style->fg [GTK_STATE_SELECTED]); - if (imhtml->default_font) - gdk_font_unref (imhtml->default_font); - imhtml->default_font = gdk_font_ref (gtk_style_get_font (widget->style)); gdk_window_set_background (widget->window, &widget->style->base [GTK_STATE_NORMAL]); gdk_window_set_background (GTK_LAYOUT (imhtml)->bin_window, &widget->style->base [GTK_STATE_NORMAL]); @@ -1014,7 +1109,8 @@ } static gchar* -get_position (struct line_info *chunk, +get_position (GtkIMHtml *imhtml, + struct line_info *chunk, gint x, gboolean smileys) { @@ -1043,7 +1139,7 @@ return text; for (pos = text; *pos != '\0'; pos++) { - gint char_width = gdk_text_width (chunk->bit->font, pos, 1); + gint char_width = text_width (imhtml->context, chunk->bit->font, pos, 1); if ((width > total) && (width <= total + char_width)) { if (width < total + (char_width / 2)) return pos; @@ -1188,7 +1284,7 @@ switch (selection) { case 0: if (COORDS_IN_CHUNK (startx, starty)) { - new_pos = get_position (chunk, startx, smileys); + new_pos = get_position (imhtml, chunk, startx, smileys); if (!chunk->selected || (chunk->sel_start != new_pos) || (chunk->sel_end != NULL)) @@ -1206,7 +1302,7 @@ if (COORDS_IN_CHUNK (endx, endy)) { if (got_start) { - new_pos = get_position (chunk, endx, smileys); + new_pos = get_position (imhtml, chunk, endx, smileys); if (chunk->sel_end != new_pos) redraw = TRUE; if (chunk->sel_start > new_pos) { @@ -1220,7 +1316,7 @@ if (mode == 1) chunk_select_words (chunk); } else { - new_pos = get_position (chunk, endx, smileys); + new_pos = get_position (imhtml, chunk, endx, smileys); if ( !chunk->selected || (chunk->sel_start != new_pos) || (chunk->sel_end != NULL)) @@ -1247,7 +1343,7 @@ break; case 1: if (!got_start && COORDS_IN_CHUNK (startx, starty)) { - new_pos = get_position (chunk, startx, smileys); + new_pos = get_position (imhtml, chunk, startx, smileys); if ( !chunk->selected || (chunk->sel_end != new_pos) || (chunk->sel_start != chunk->text)) @@ -1260,7 +1356,7 @@ if (mode == 1) chunk_select_words (chunk); } else if (!got_end && COORDS_IN_CHUNK (endx, endy)) { - new_pos = get_position (chunk, endx, smileys); + new_pos = get_position (imhtml, chunk, endx, smileys); if ( !chunk->selected || (chunk->sel_end != new_pos) || (chunk->sel_start != chunk->text)) @@ -1326,7 +1422,7 @@ gboolean smileys = imhtml->smileys; gboolean redraw = FALSE; - new_pos = get_position (chunk, endx, smileys); + new_pos = get_position (imhtml, chunk, endx, smileys); if ((starty < chunk->y) || ((starty < chunk->y + chunk->height) && (startx < endx))) { if (chunk->sel_end != new_pos) @@ -1988,170 +2084,42 @@ #define ENCDNG 14 static const gchar* -gtk_imhtml_get_font_name (GdkFont *font) +gtk_imhtml_get_font_name (PangoFontDescription *font) { - return gdk_x11_font_get_name(font); + return pango_font_description_get_family(font); } -static GdkFont* +static PangoFontDescription * gtk_imhtml_font_load (GtkIMHtml *imhtml, gchar *name, gboolean bold, gboolean italics, gint fontsize) { - GdkFont *default_font = imhtml->default_font; - const gchar *default_name; - gchar **xnames; - gchar **pos; - gchar *tmp = NULL; - GdkFont *ret_font; - gchar *xname; - gchar **xflds; - gchar **newvals; - gchar **names = NULL; - - char *italicstrings[] = {"i","o","*"}; - int italicsind = 0, nameind = 0; - gboolean usebold = TRUE, usesize = TRUE, useregenc = TRUE; + PangoFontDescription *default_font = imhtml->default_font; + PangoFontDescription *ret_font; - /* if we're not changing anything, use the default. this is the common case */ if (!name && !bold && !italics && !fontsize) - return gdk_font_ref (default_font); + return default_font; +// return pango_font_description_copy(default_font); + + ret_font = pango_font_description_copy(default_font); + + if (name) + pango_font_description_set_family(ret_font, name); - /* base things off of the default font name */ - default_name = gtk_imhtml_get_font_name (default_font); - /* the default font name can actually be several names separated by ','. - * This is a fontset... used in foreign encodings. */ - do { - xnames = g_strsplit (default_name, ",", -1); - for (pos = xnames; pos && *pos; pos++) { - gint i, j; - gchar fs[10]; - gchar *garbage; - xname = *pos; - xname = g_strchomp (xname); - xname = g_strchug (xname); - - xflds = g_strsplit (xname, "-", -1); - - /* figure out if we have a valid name. i wish there were an - * easier way for determining how many values g_strplit gave */ - for (i = 0; xflds [i]; i++); - if (i != 15) { - int tmp; - newvals = g_malloc0 (16 * sizeof (gchar *)); - newvals [0] = ""; - for (tmp = 1; tmp < 15; tmp++) - newvals [tmp] = "*"; - } else - newvals = g_memdup (xflds, 16 * sizeof (xflds)); - - /* we force foundry as "*" because i hate them. i should give a better reason. */ - newvals [FNDRY] = "*"; - - /* if it's "*" then it defaults to (nil) anyway. some fonts don't want (nil) */ - if ((i > ADSTYL) && !xflds [ADSTYL][0]) - newvals [ADSTYL] = "*"; - - /* If the font doesn't work the first time, we try it with - * registry and encoding as "*" */ - if (!useregenc) { - newvals [RGSTRY] = "*"; - newvals [ENCDNG] = "*"; - } - /* right. */ - if (usebold && bold) - newvals [WGHT] = "bold"; - else if (!usebold) - newvals [WGHT] = "*"; - - if (italics) - /* We'll try "i" "o" to get italics and then just use "*" */ - newvals [SLANT] = italicstrings[italicsind]; - - if (usesize && fontsize) { - g_snprintf (fs, sizeof (fs), "%d", POINT_SIZE (fontsize)); - newvals [PTSZ] = fs; - newvals [PXLSZ] = "*"; - } else if (!usesize) { - newvals [PTSZ] = "*"; - newvals [PXLSZ] = "*"; - } - - if (name) { - /* we got passed a name. it might be a list of names. */ - gchar **tmp_nms = g_strsplit (name, ",", -1); - for (j = 0; tmp_nms [j]; j++); - names = g_new0 (char *, j + 2); - for (j = 0; tmp_nms [j]; j++) - names [j] = tmp_nms [j]; - g_free (tmp_nms); - /* Put the default font on the array. */ - if (i > FMLY) { - names [j] = g_strdup (xflds [FMLY]); - } - newvals [FMLY] = names[nameind]; - } else if (i > FMLY) { - /* we didn't get a name. we come here if the gtk font name is valid */ - names = g_new0 (gchar *, 2); - names [0] = g_strdup (xflds [FMLY]); - } else { - /* we got fucked */ - names = g_new0 (gchar *, 2); - names [0] = g_strdup ("*"); - } - if (!tmp) - tmp = g_strjoinv("-", newvals); - else { - /* We have to concat the xlfds in the fontset */ - garbage = tmp; - tmp = g_strconcat(garbage, ",", - g_strjoinv ("-", newvals), NULL); - g_free(garbage); - } - g_free (newvals); - g_strfreev (xflds); - } - g_strfreev (xnames); - - if (default_font->type == GDK_FONT_FONT) - ret_font = gdk_font_load (tmp); - else { - /* For some reason, fontsets must end with a single * as an xlfd */ - ret_font = gdk_fontset_load (tmp); - } - /* If the font didn't load, we change some of the xlfds one by one - * to get the closest we can. */ - if (!ret_font) { - if (useregenc) { - useregenc = FALSE; - } else if (italics && italicsind != 2) { - useregenc = TRUE; - italicsind++; - } else if (bold && usebold) { - useregenc = TRUE; - italicsind=0; - usebold = FALSE; - } else if (usesize) { - useregenc = TRUE; - italicsind = 0; - usebold = TRUE; - usesize = FALSE; - } else if (names && names[nameind++]) { - useregenc = TRUE; - italicsind = 0; - usebold = TRUE; - usesize = TRUE; - } else { - ret_font = gdk_font_ref(default_font); - } - } - g_strfreev (names); - names = NULL; - g_free(tmp); - tmp=NULL; - } while (!ret_font); /* Loop with the new options */ + if (italics) + pango_font_description_set_style(ret_font, PANGO_STYLE_ITALIC); + + if (bold) + pango_font_description_set_weight(ret_font, PANGO_WEIGHT_BOLD); + + if (fontsize) + { + pango_font_description_set_size(ret_font, + POINT_SIZE(fontsize) * PANGO_SCALE); + } + return ret_font; } @@ -2278,7 +2246,7 @@ void gtk_imhtml_set_defaults (GtkIMHtml *imhtml, - GdkFont *font, + PangoFontDescription *font, GdkColor *fg_color, GdkColor *bg_color) { @@ -2287,8 +2255,8 @@ if (font) { if (imhtml->default_font) - gdk_font_unref (imhtml->default_font); - imhtml->default_font = gdk_font_ref (font); + pango_font_description_free(imhtml->default_font); + imhtml->default_font = pango_font_description_copy(font); } if (fg_color) { @@ -2378,7 +2346,7 @@ struct line_info *li; struct clickable *uw; struct im_image *img; - + if (height > imhtml->llheight) { diff = height - imhtml->llheight; @@ -2424,20 +2392,23 @@ { struct line_info *li; struct clickable *uw; + PangoFontMetrics *metrics; gint width; if (text) - width = gdk_string_width (bit->font, text); + width = string_width (imhtml->context, bit->font, text); else width = 0; + metrics = pango_context_get_metrics(imhtml->context, bit->font, NULL); + li = g_new0 (struct line_info, 1); li->x = imhtml->x; li->y = imhtml->y; li->width = width; li->height = imhtml->llheight; if (text) - li->ascent = MAX (imhtml->llascent, bit->font->ascent); + li->ascent = MAX (imhtml->llascent, pango_font_metrics_get_ascent(metrics) / PANGO_SCALE); else li->ascent = 0; li->text = text; @@ -2456,6 +2427,8 @@ bit->chunks = g_list_append (bit->chunks, li); imhtml->line = g_list_append (imhtml->line, li); + + pango_font_metrics_unref(metrics); } static void @@ -2498,12 +2471,15 @@ gtk_imhtml_draw_bit (GtkIMHtml *imhtml, GtkIMHtmlBit *bit) { + PangoFontMetrics *metrics; gint width, height; g_return_if_fail (imhtml != NULL); g_return_if_fail (GTK_IS_IMHTML (imhtml)); g_return_if_fail (bit != NULL); + metrics = pango_context_get_metrics(imhtml->context, bit->font, NULL); + if ( ((bit->type == TYPE_TEXT) || ((bit->type == TYPE_SMILEY) && !imhtml->smileys) || ((bit->type == TYPE_COMMENT) && imhtml->comments)) && @@ -2513,12 +2489,12 @@ gboolean seenspace = FALSE; gchar *tmp; - height = bit->font->ascent + bit->font->descent; - width = gdk_string_width (bit->font, bit->text); + height = (pango_font_metrics_get_ascent(metrics) + pango_font_metrics_get_descent(metrics)) / PANGO_SCALE; + width = string_width (imhtml->context, bit->font, bit->text); if ((imhtml->x != 0) && ((imhtml->x + width) > imhtml->xsize)) { gint remain = imhtml->xsize - imhtml->x; - while (gdk_text_width (bit->font, copy, pos) < remain) { + while (text_width (imhtml->context, bit->font, copy, pos) < remain) { if (copy [pos] == ' ') seenspace = TRUE; pos++; @@ -2528,7 +2504,7 @@ tmp = g_strndup (copy, pos); - backwards_update (imhtml, bit, height, bit->font->ascent); + backwards_update (imhtml, bit, height, pango_font_metrics_get_ascent(metrics) / PANGO_SCALE); add_text_renderer (imhtml, bit, tmp); } else pos = 0; @@ -2536,14 +2512,14 @@ new_line (imhtml); } - backwards_update (imhtml, bit, height, bit->font->ascent); + backwards_update (imhtml, bit, height, pango_font_metrics_get_ascent(metrics) / PANGO_SCALE); while (pos < strlen (bit->text)) { - width = gdk_string_width (bit->font, copy + pos); + width = string_width (imhtml->context, bit->font, copy + pos); if (imhtml->x + width > imhtml->xsize) { gint newpos = 0; gint remain = imhtml->xsize - imhtml->x; - while (gdk_text_width (bit->font, copy + pos, newpos) < remain) { + while (text_width (imhtml->context, bit->font, copy + pos, newpos) < remain) { if (copy [pos + newpos] == ' ') seenspace = TRUE; newpos++; @@ -2558,7 +2534,7 @@ tmp = g_strndup (copy + pos, newpos); pos += newpos; - backwards_update (imhtml, bit, height, bit->font->ascent); + backwards_update (imhtml, bit, height, pango_font_metrics_get_ascent(metrics) / PANGO_SCALE); add_text_renderer (imhtml, bit, tmp); seenspace = FALSE; @@ -2566,7 +2542,7 @@ } else { tmp = g_strdup (copy + pos); - backwards_update (imhtml, bit, height, bit->font->ascent); + backwards_update (imhtml, bit, height, pango_font_metrics_get_ascent(metrics) / PANGO_SCALE); add_text_renderer (imhtml, bit, tmp); pos = strlen (bit->text); @@ -2636,6 +2612,8 @@ new_line (imhtml); add_text_renderer (imhtml, bit, NULL); } + + pango_font_metrics_unref(metrics); } void @@ -2739,7 +2717,8 @@ if (((bit->type == TYPE_TEXT) || (bit->type == TYPE_SMILEY) || (bit->type == TYPE_COMMENT)) && (bit->font == NULL)) - bit->font = gdk_font_ref (imhtml->default_font); + bit->font = pango_font_description_copy (imhtml->default_font); +// bit->font = gdk_font_ref (imhtml->default_font); if (bg != NULL) bit->bg = gdk_color_copy (bg); @@ -3539,7 +3518,8 @@ if (bit->text) g_free (bit->text); if (bit->font) - gdk_font_unref (bit->font); + pango_font_description_free(bit->font); + //gdk_font_unref (bit->font); if (bit->fore) gdk_color_free (bit->fore); if (bit->back) Index: gtkimhtml.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/gtkimhtml.h,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- gtkimhtml.h 29 Aug 2002 01:47:14 -0000 1.17 +++ gtkimhtml.h 8 Oct 2002 23:45:20 -0000 1.18 @@ -45,8 +45,9 @@ struct _GtkIMHtml { GtkLayout layout; - GdkFont *default_font; - // PangoFontDescription *default_font; + PangoContext *context; + PangoFontDescription *default_font; + //GdkFont *default_font; GdkColor *default_fg_color; GdkColor *default_bg_color; GdkColor *default_hl_color; @@ -111,8 +112,7 @@ GtkAdjustment *vadj); void gtk_imhtml_set_defaults (GtkIMHtml *imhtml, - GdkFont *font, - //PangoFontDescription *font, + PangoFontDescription *font, GdkColor *fg_color, GdkColor *bg_color); |
From: Sean E. <sea...@us...> - 2002-10-08 22:54:41
|
Update of /cvsroot/gaim/gaim/src In directory usw-pr-cvs1:/tmp/cvs-serv23426/src Modified Files: server.c Log Message: Yay Faceprint! He's the best! This will fix most prpl-autoload-related segfaults with the exception of signing off Jabber. Nathan's working for a fix on that right now. Index: server.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/server.c,v retrieving revision 1.243 retrieving revision 1.244 diff -u -d -r1.243 -r1.244 --- server.c 8 Oct 2002 21:12:53 -0000 1.243 +++ server.c 8 Oct 2002 22:54:38 -0000 1.244 @@ -94,6 +94,11 @@ } } +static gboolean delayed_unload(void *handle) { + g_module_close(handle); + return FALSE; +} + void serv_close(struct gaim_connection *gc) { struct prpl *prpl; @@ -123,7 +128,8 @@ debug_printf("Prpl %s is now being used by %d accounts\n", prpl->name, prpl_accounts[prpl->protocol]); if (prpl_accounts[prpl->protocol] == 0) { /* We don't need this protocol anymore */ debug_printf("Throwing out prpl %s\n", prpl->name); - g_module_close(prpl->plug->handle); + unload_protocol(prpl); + g_timeout_add(0,delayed_unload, prpl->plug->handle); prpl->plug->handle = NULL; } } |
From: Sean E. <sea...@us...> - 2002-10-08 21:13:00
|
Update of /cvsroot/gaim/gaim/src In directory usw-pr-cvs1:/tmp/cvs-serv22817/src Modified Files: server.c Log Message: a bugfix Index: server.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/server.c,v retrieving revision 1.242 retrieving revision 1.243 diff -u -d -r1.242 -r1.243 --- server.c 6 Oct 2002 19:09:07 -0000 1.242 +++ server.c 8 Oct 2002 21:12:53 -0000 1.243 @@ -44,7 +44,7 @@ { struct prpl *p = find_prpl(user->protocol); - if (user->gc != NULL) + if (user->gc != NULL || p == NULL) return; #ifdef GAIM_PLUGINS @@ -59,7 +59,7 @@ } #endif - if (p && p->login) { + if (p->login) { if (!strlen(user->password) && !(p->options & OPT_PROTO_NO_PASSWORD)) { do_error_dialog(_("Please enter your password"), NULL, GAIM_ERROR); return; |
From: Sean E. <sea...@us...> - 2002-10-08 05:54:21
|
Update of /cvsroot/gaim/gaim/src/protocols/irc In directory usw-pr-cvs1:/tmp/cvs-serv30054/src/protocols/irc Modified Files: irc.c Log Message: I forgot a break; =-O Index: irc.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/irc/irc.c,v retrieving revision 1.90 retrieving revision 1.91 diff -u -d -r1.90 -r1.91 --- irc.c 6 Oct 2002 17:02:43 -0000 1.90 +++ irc.c 8 Oct 2002 05:54:12 -0000 1.91 @@ -903,6 +903,7 @@ break; case 433: do_prompt_dialog(_("That nick is already in use. Please enter a new nick"), gc->displayname, gc, irc_change_nick, NULL); + break; default: if (n > 400 && n < 502) { char errmsg[IRC_BUF_LEN]; |
From: Luke S. <lsc...@us...> - 2002-10-07 20:13:00
|
Update of /cvsroot/gaim/gaim In directory usw-pr-cvs1:/tmp/cvs-serv12856 Modified Files: Tag: gtk1-stable gaim.spec.in Log Message: and fix this tree also Index: gaim.spec.in =================================================================== RCS file: /cvsroot/gaim/gaim/gaim.spec.in,v retrieving revision 1.52.2.6 retrieving revision 1.52.2.7 diff -u -d -r1.52.2.6 -r1.52.2.7 --- gaim.spec.in 6 Oct 2002 19:24:25 -0000 1.52.2.6 +++ gaim.spec.in 7 Oct 2002 20:12:56 -0000 1.52.2.7 @@ -71,7 +71,7 @@ %defattr(-,root,root) %{prefix}/bin/gaim %doc doc/the_penguin.txt doc/CREDITS NEWS COPYING AUTHORS doc/FAQ README ChangeLog plugins/PERL-HOWTO HACKING -%{prefix}/man/man1/gaim.1.gz +%{prefix}/man/man1/gaim.1.* %attr(755,root,root) %{prefix}/lib/gaim/* %{prefix}/share/locale/*/*/* %{prefix}/share/pixmaps/gaim.png @@ -82,7 +82,7 @@ %defattr(-,root,root) %attr(755,root,root) %{prefix}/bin/gaim_applet %doc doc/the_penguin.txt doc/CREDITS NEWS COPYING AUTHORS doc/FAQ README ChangeLog plugins/PERL-HOWTO HACKING -%{prefix}/man/man1/gaim.1.gz +%{prefix}/man/man1/gaim.1.* %{prefix}/lib/gaim/* %{prefix}/share/locale/*/*/* %{prefix}/share/pixmaps/gaim/* |
From: Luke S. <lsc...@us...> - 2002-10-07 20:10:58
|
Update of /cvsroot/gaim/gaim In directory usw-pr-cvs1:/tmp/cvs-serv11785 Modified Files: gaim.spec.in Log Message: fix rpm specs(thanks paco-paco) Index: gaim.spec.in =================================================================== RCS file: /cvsroot/gaim/gaim/gaim.spec.in,v retrieving revision 1.56 retrieving revision 1.57 diff -u -d -r1.56 -r1.57 --- gaim.spec.in 17 Sep 2002 15:34:13 -0000 1.56 +++ gaim.spec.in 7 Oct 2002 20:10:54 -0000 1.57 @@ -50,7 +50,7 @@ %{prefix}/bin/gaim %{prefix}/bin/gaim-remote %doc doc/the_penguin.txt doc/CREDITS NEWS COPYING AUTHORS doc/FAQ README ChangeLog plugins/PERL-HOWTO HACKING -%{prefix}/man/man1/gaim.1.gz +%{prefix}/man/man1/gaim.1.* %attr(755,root,root) %{prefix}/lib/gaim/* %{prefix}/share/locale/*/*/* %{prefix}/share/pixmaps/gaim.png |
From: Christian H. <ch...@us...> - 2002-10-07 17:21:14
|
Update of /cvsroot/gaim/gaim/po In directory usw-pr-cvs1:/tmp/cvs-serv26078 Modified Files: ko.po Log Message: Everyone can be happy again. Index: ko.po =================================================================== RCS file: /cvsroot/gaim/gaim/po/ko.po,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- ko.po 1 Oct 2002 23:22:47 -0000 1.30 +++ ko.po 7 Oct 2002 17:21:10 -0000 1.31 @@ -1085,12 +1085,12 @@ #: src/protocols/oscar/oscar.c:1595 #, c-format msgid "You missed %d message from %s because it was too large." -msgstr "%s°³ÀÇ %s´ÔÀÌ º¸³½ ¸Þ½ÃÁö°¡ ³Ê¹« Ä¿¼ º¸¿©ÁÙ ¼ö ¾ø½À´Ï´Ù." +msgstr "%d°³ÀÇ %s´ÔÀÌ º¸³½ ¸Þ½ÃÁö°¡ ³Ê¹« Ä¿¼ º¸¿©ÁÙ ¼ö ¾ø½À´Ï´Ù." #: src/protocols/oscar/oscar.c:1596 #, c-format msgid "You missed %d messages from %s because they were too large." -msgstr "%s°³ÀÇ %s´ÔÀÌ º¸³½ ¸Þ½ÃÁö°¡ ³Ê¹« Ä¿¼ º¸¿©ÁÙ ¼ö ¾ø½À´Ï´Ù." +msgstr "%d°³ÀÇ %s´ÔÀÌ º¸³½ ¸Þ½ÃÁö°¡ ³Ê¹« Ä¿¼ º¸¿©ÁÙ ¼ö ¾ø½À´Ï´Ù." #: src/protocols/oscar/oscar.c:1605 #, c-format |