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: <sa...@us...> - 2006-07-01 23:21:18
|
Revision: 16393 Author: sadrul Date: 2006-07-01 16:21:12 -0700 (Sat, 01 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16393&view=rev Log Message: ----------- This isn't necessary. Modified Paths: -------------- trunk/console/libgnt/configure.ac Modified: trunk/console/libgnt/configure.ac =================================================================== --- trunk/console/libgnt/configure.ac 2006-07-01 22:36:21 UTC (rev 16392) +++ trunk/console/libgnt/configure.ac 2006-07-01 23:21:12 UTC (rev 16393) @@ -229,17 +229,6 @@ ]) -PKG_CHECK_MODULES(GAIM, [gaim], - [ - AC_SUBST(GAIM_CFLAGS) - AC_SUBST(GAIM_LIBS) - ], - [ - AC_MSG_ERROR([ -*** Need to have libgaim dude.]) - ]) - - AC_MSG_CHECKING(for me pot o' gold) AC_MSG_RESULT(no) AC_CHECK_FUNCS(gethostid lrand48) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-07-01 22:36:24
|
Revision: 16392 Author: thekingant Date: 2006-07-01 15:36:21 -0700 (Sat, 01 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16392&view=rev Log Message: ----------- Backport SVN revision #16390 and 16391 from HEAD to v2_0_0 Original commit message: A small part of sf patch #1490646, from Jonty Wareing & Jono Cole "Fix & Enhance the Bonjour prpl" "Several instances of "magic strings" have been replaced with proper XML parsing code in the Bonjour prpl, allowing it to communicate with other Gaim clients (a misplaced space in one of the strings prevented this), and every other Bonjour chat client we can find. A fair amount of completely redundant code was also stripped, which in combination with the proper XML parsing allows the client to be far more flexible about Jabber errors in other clients." ViewCVS Links: ------------- http://svn.sourceforge.net/gaim/?rev=16390&view=rev Modified Paths: -------------- branches/v2_0_0/COPYRIGHT branches/v2_0_0/src/protocols/bonjour/jabber.c branches/v2_0_0/src/protocols/bonjour/jabber.h Modified: branches/v2_0_0/COPYRIGHT =================================================================== --- branches/v2_0_0/COPYRIGHT 2006-07-01 22:33:33 UTC (rev 16391) +++ branches/v2_0_0/COPYRIGHT 2006-07-01 22:36:21 UTC (rev 16392) @@ -59,6 +59,7 @@ Eoin Coffey Jason Cohen Todd Cohen +Jono Cole Nathan Conrad Felipe Contreras Alex Converse @@ -302,6 +303,7 @@ Wan Hing Wah Philip Walford Nathan Walp +Jonty Wareing Eric Warmenhoven Adam J. Warrington Andrew Wellington Modified: branches/v2_0_0/src/protocols/bonjour/jabber.c =================================================================== --- branches/v2_0_0/src/protocols/bonjour/jabber.c 2006-07-01 22:33:33 UTC (rev 16391) +++ branches/v2_0_0/src/protocols/bonjour/jabber.c 2006-07-01 22:36:21 UTC (rev 16392) @@ -309,6 +309,7 @@ char *closed_conv_message; BonjourBuddy *bb = (BonjourBuddy*)gb->proto_data; gboolean closed_conversation = FALSE; + xmlnode *message_node = NULL; /* Read the data from the socket */ if ((message_length = _read_data(socket, &message)) == -1) { @@ -325,34 +326,39 @@ } } - /* Check if the start of the doctype has been received, if not check that the current */ - /* data is the doctype */ - if (!(bb->conversation->start_step_one)) - { - if (g_str_has_prefix(message, DOCTYPE_DECLARATION)) - { - bb->conversation->start_step_one = TRUE; - } - } + /* Parse the message into an XMLnode for analysis */ + message_node = xmlnode_from_str(message, strlen(message)); /* Check if the start of the stream has been received, if not check that the current */ /* data is the start of the stream */ - if (!(bb->conversation->start_step_two)) + if (!(bb->conversation->stream_started)) { - if (g_str_has_suffix(message, STREAM_START)) { - bb->conversation->start_step_two = TRUE; - - /* If we haven't done it yet, we have to sent the start of the stream to the other buddy */ - if (!(bb->conversation->stream_started)) { - if (send(bb->conversation->socket, DOCTYPE, strlen(DOCTYPE), 0) == -1) { - gaim_debug_error("bonjour", "Unable to start a conversation with %s\n", bb->name); - } + /* Check if this is the start of the stream */ + if ((message_node != NULL) && + g_ascii_strcasecmp(xmlnode_get_attrib(message_node, "xmlns"), "jabber:client") && + (xmlnode_get_attrib(message_node,"xmlns:stream") != NULL)) + { + bb->conversation->stream_started = TRUE; + } + else + { + /* TODO: This needs to be nonblocking! */ + if (send(bb->conversation->socket, DOCTYPE, strlen(DOCTYPE), 0) == -1) + { + gaim_debug_error("bonjour", "Unable to start a conversation with %s\n", bb->name); } + else + { + bb->conversation->stream_started = TRUE; + } } - return; } - /* Check that this is not the end of the conversation */ + /* + * Check that this is not the end of the conversation. This is + * using a magic string, but xmlnode won't play nice when just + * parsing an end tag + */ if (g_str_has_prefix(message, STREAM_END) || (closed_conversation == TRUE)) { /* Close the socket, clear the watcher and free memory */ if (bb->conversation != NULL) { @@ -372,6 +378,8 @@ /* Parse the message to get the data and send to the ui */ _jabber_parse_and_write_message_to_ui(message, account->gc, gb); } + + xmlnode_free(message_node); } static void @@ -419,8 +427,6 @@ { bb->conversation = g_new(BonjourJabberConversation, 1); bb->conversation->socket = client_socket; - bb->conversation->start_step_one = FALSE; - bb->conversation->start_step_two = FALSE; bb->conversation->stream_started = FALSE; bb->conversation->buddy_name = g_strdup(gb->name); bb->conversation->message_id = 1; @@ -553,12 +559,10 @@ { bb->conversation = g_new(BonjourJabberConversation, 1); bb->conversation->socket = _connect_to_buddy(gb); - bb->conversation->start_step_one = FALSE; - bb->conversation->start_step_two = FALSE; bb->conversation->stream_started = FALSE; bb->conversation->buddy_name = g_strdup(gb->name); bb->conversation->watcher_id = gaim_input_add(bb->conversation->socket, - GAIM_INPUT_READ, _client_socket_handler, gb); + GAIM_INPUT_READ, _client_socket_handler, gb); } /* Check if the stream for the conversation has been started */ Modified: branches/v2_0_0/src/protocols/bonjour/jabber.h =================================================================== --- branches/v2_0_0/src/protocols/bonjour/jabber.h 2006-07-01 22:33:33 UTC (rev 16391) +++ branches/v2_0_0/src/protocols/bonjour/jabber.h 2006-07-01 22:36:21 UTC (rev 16392) @@ -28,11 +28,8 @@ #include "account.h" -#define DOCTYPE_DECLARATION "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>" -#define STREAM_START "<stream:stream xmlns=\"jabber:client\" xmlns:stream=\"http://etherx.jabber.org/streams\">" -#define CONVERSATION_START "<?xml version=\"1.0\" encoding=\"UTF-8\" ?><stream:stream xmlns=\"jabber:client\" xmlns:stream=\"http://etherx.jabber.org/streams\">" #define STREAM_END "</stream:stream>" -#define DOCTYPE "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<stream:stream xmlns=\"jabber:client\" xmlns:stream=\"http://etherx.jabber.org/streams\" >" +#define DOCTYPE "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<stream:stream xmlns=\"jabber:client\" xmlns:stream=\"http://etherx.jabber.org/streams\">" typedef struct _BonjourJabber { @@ -47,8 +44,6 @@ gint socket; gint watcher_id; gchar* buddy_name; - gboolean start_step_one; - gboolean start_step_two; gboolean stream_started; gint message_id; } BonjourJabberConversation; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-07-01 22:33:35
|
Revision: 16391 Author: thekingant Date: 2006-07-01 15:33:33 -0700 (Sat, 01 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16391&view=rev Log Message: ----------- Credit for some Bonjour improvements Modified Paths: -------------- trunk/COPYRIGHT Modified: trunk/COPYRIGHT =================================================================== --- trunk/COPYRIGHT 2006-07-01 22:32:20 UTC (rev 16390) +++ trunk/COPYRIGHT 2006-07-01 22:33:33 UTC (rev 16391) @@ -59,6 +59,7 @@ Eoin Coffey Jason Cohen Todd Cohen +Jono Cole Nathan Conrad Felipe Contreras Alex Converse @@ -302,6 +303,7 @@ Wan Hing Wah Philip Walford Nathan Walp +Jonty Wareing Eric Warmenhoven Adam J. Warrington Andrew Wellington This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-07-01 22:32:24
|
Revision: 16390 Author: thekingant Date: 2006-07-01 15:32:20 -0700 (Sat, 01 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16390&view=rev Log Message: ----------- A small part of sf patch #1490646, from Jonty Wareing & Jono Cole "Fix & Enhance the Bonjour prpl" "Several instances of "magic strings" have been replaced with proper XML parsing code in the Bonjour prpl, allowing it to communicate with other Gaim clients (a misplaced space in one of the strings prevented this), and every other Bonjour chat client we can find. A fair amount of completely redundant code was also stripped, which in combination with the proper XML parsing allows the client to be far more flexible about Jabber errors in other clients." Modified Paths: -------------- trunk/src/protocols/bonjour/jabber.c trunk/src/protocols/bonjour/jabber.h Modified: trunk/src/protocols/bonjour/jabber.c =================================================================== --- trunk/src/protocols/bonjour/jabber.c 2006-07-01 18:39:33 UTC (rev 16389) +++ trunk/src/protocols/bonjour/jabber.c 2006-07-01 22:32:20 UTC (rev 16390) @@ -309,6 +309,7 @@ char *closed_conv_message; BonjourBuddy *bb = (BonjourBuddy*)gb->proto_data; gboolean closed_conversation = FALSE; + xmlnode *message_node = NULL; /* Read the data from the socket */ if ((message_length = _read_data(socket, &message)) == -1) { @@ -325,34 +326,39 @@ } } - /* Check if the start of the doctype has been received, if not check that the current */ - /* data is the doctype */ - if (!(bb->conversation->start_step_one)) - { - if (g_str_has_prefix(message, DOCTYPE_DECLARATION)) - { - bb->conversation->start_step_one = TRUE; - } - } + /* Parse the message into an XMLnode for analysis */ + message_node = xmlnode_from_str(message, strlen(message)); /* Check if the start of the stream has been received, if not check that the current */ /* data is the start of the stream */ - if (!(bb->conversation->start_step_two)) + if (!(bb->conversation->stream_started)) { - if (g_str_has_suffix(message, STREAM_START)) { - bb->conversation->start_step_two = TRUE; - - /* If we haven't done it yet, we have to sent the start of the stream to the other buddy */ - if (!(bb->conversation->stream_started)) { - if (send(bb->conversation->socket, DOCTYPE, strlen(DOCTYPE), 0) == -1) { - gaim_debug_error("bonjour", "Unable to start a conversation with %s\n", bb->name); - } + /* Check if this is the start of the stream */ + if ((message_node != NULL) && + g_ascii_strcasecmp(xmlnode_get_attrib(message_node, "xmlns"), "jabber:client") && + (xmlnode_get_attrib(message_node,"xmlns:stream") != NULL)) + { + bb->conversation->stream_started = TRUE; + } + else + { + /* TODO: This needs to be nonblocking! */ + if (send(bb->conversation->socket, DOCTYPE, strlen(DOCTYPE), 0) == -1) + { + gaim_debug_error("bonjour", "Unable to start a conversation with %s\n", bb->name); } + else + { + bb->conversation->stream_started = TRUE; + } } - return; } - /* Check that this is not the end of the conversation */ + /* + * Check that this is not the end of the conversation. This is + * using a magic string, but xmlnode won't play nice when just + * parsing an end tag + */ if (g_str_has_prefix(message, STREAM_END) || (closed_conversation == TRUE)) { /* Close the socket, clear the watcher and free memory */ if (bb->conversation != NULL) { @@ -372,6 +378,8 @@ /* Parse the message to get the data and send to the ui */ _jabber_parse_and_write_message_to_ui(message, account->gc, gb); } + + xmlnode_free(message_node); } static void @@ -419,8 +427,6 @@ { bb->conversation = g_new(BonjourJabberConversation, 1); bb->conversation->socket = client_socket; - bb->conversation->start_step_one = FALSE; - bb->conversation->start_step_two = FALSE; bb->conversation->stream_started = FALSE; bb->conversation->buddy_name = g_strdup(gb->name); bb->conversation->message_id = 1; @@ -553,12 +559,10 @@ { bb->conversation = g_new(BonjourJabberConversation, 1); bb->conversation->socket = _connect_to_buddy(gb); - bb->conversation->start_step_one = FALSE; - bb->conversation->start_step_two = FALSE; bb->conversation->stream_started = FALSE; bb->conversation->buddy_name = g_strdup(gb->name); bb->conversation->watcher_id = gaim_input_add(bb->conversation->socket, - GAIM_INPUT_READ, _client_socket_handler, gb); + GAIM_INPUT_READ, _client_socket_handler, gb); } /* Check if the stream for the conversation has been started */ Modified: trunk/src/protocols/bonjour/jabber.h =================================================================== --- trunk/src/protocols/bonjour/jabber.h 2006-07-01 18:39:33 UTC (rev 16389) +++ trunk/src/protocols/bonjour/jabber.h 2006-07-01 22:32:20 UTC (rev 16390) @@ -28,11 +28,8 @@ #include "account.h" -#define DOCTYPE_DECLARATION "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>" -#define STREAM_START "<stream:stream xmlns=\"jabber:client\" xmlns:stream=\"http://etherx.jabber.org/streams\">" -#define CONVERSATION_START "<?xml version=\"1.0\" encoding=\"UTF-8\" ?><stream:stream xmlns=\"jabber:client\" xmlns:stream=\"http://etherx.jabber.org/streams\">" #define STREAM_END "</stream:stream>" -#define DOCTYPE "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<stream:stream xmlns=\"jabber:client\" xmlns:stream=\"http://etherx.jabber.org/streams\" >" +#define DOCTYPE "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<stream:stream xmlns=\"jabber:client\" xmlns:stream=\"http://etherx.jabber.org/streams\">" typedef struct _BonjourJabber { @@ -47,8 +44,6 @@ gint socket; gint watcher_id; gchar* buddy_name; - gboolean start_step_one; - gboolean start_step_two; gboolean stream_started; gint message_id; } BonjourJabberConversation; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-07-01 18:39:37
|
Revision: 16389 Author: thekingant Date: 2006-07-01 11:39:33 -0700 (Sat, 01 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16389&view=rev Log Message: ----------- Backport SVN revision #16388 from HEAD to v2_0_0 Original commit message: When moving a buddy on AIM, remove the buddy from the server list before adding it to the new group (it used to be the other way around). The downside of this is that, if you're moving an ICQ buddy who requires authorization, you'll have to rerequest authorization. The upside of this is that it actually works, and moving an ICQ buddy won't inadvertently delete them from your list. ViewCVS Links: ------------- http://svn.sourceforge.net/gaim/?rev=16388&view=rev Modified Paths: -------------- branches/v2_0_0/src/protocols/oscar/family_feedbag.c branches/v2_0_0/src/protocols/oscar/oscar.h Modified: branches/v2_0_0/src/protocols/oscar/family_feedbag.c =================================================================== --- branches/v2_0_0/src/protocols/oscar/family_feedbag.c 2006-07-01 18:39:13 UTC (rev 16388) +++ branches/v2_0_0/src/protocols/oscar/family_feedbag.c 2006-07-01 18:39:33 UTC (rev 16389) @@ -456,14 +456,14 @@ * @param sn The name of the buddy. * @return 1 if you are waiting for authorization; 0 if you are not */ -int aim_ssi_waitingforauth(struct aim_ssi_item *list, const char *gn, const char *sn) +gboolean aim_ssi_waitingforauth(struct aim_ssi_item *list, const char *gn, const char *sn) { struct aim_ssi_item *cur = aim_ssi_itemlist_finditem(list, gn, sn, AIM_SSI_TYPE_BUDDY); if (cur) { if (aim_tlv_gettlv(cur->data, 0x0066, 1)) - return 1; + return TRUE; } - return 0; + return FALSE; } /** @@ -945,10 +945,17 @@ */ int aim_ssi_movebuddy(OscarData *od, const char *oldgn, const char *newgn, const char *sn) { - char *alias = aim_ssi_getalias(od->ssi.local, oldgn, sn); - aim_ssi_addbuddy(od, sn, newgn, alias, NULL, NULL, aim_ssi_waitingforauth(od->ssi.local, oldgn, sn)); + char *alias; + gboolean waitingforauth; + + alias = aim_ssi_getalias(od->ssi.local, oldgn, sn); + waitingforauth = aim_ssi_waitingforauth(od->ssi.local, oldgn, sn); + aim_ssi_delbuddy(od, sn, oldgn); + aim_ssi_addbuddy(od, sn, newgn, alias, NULL, NULL, waitingforauth); + free(alias); + return 0; } Modified: branches/v2_0_0/src/protocols/oscar/oscar.h =================================================================== --- branches/v2_0_0/src/protocols/oscar/oscar.h 2006-07-01 18:39:13 UTC (rev 16388) +++ branches/v2_0_0/src/protocols/oscar/oscar.h 2006-07-01 18:39:33 UTC (rev 16389) @@ -1144,7 +1144,7 @@ guint32 aim_ssi_getpresence(struct aim_ssi_item *list); char *aim_ssi_getalias(struct aim_ssi_item *list, const char *gn, const char *sn); char *aim_ssi_getcomment(struct aim_ssi_item *list, const char *gn, const char *sn); -int aim_ssi_waitingforauth(struct aim_ssi_item *list, const char *gn, const char *sn); +gboolean aim_ssi_waitingforauth(struct aim_ssi_item *list, const char *gn, const char *sn); /* Client functions for changing SSI data */ int aim_ssi_addbuddy(OscarData *od, const char *name, const char *group, const char *alias, const char *comment, const char *smsnum, int needauth); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-07-01 18:39:15
|
Revision: 16388 Author: thekingant Date: 2006-07-01 11:39:13 -0700 (Sat, 01 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16388&view=rev Log Message: ----------- When moving a buddy on AIM, remove the buddy from the server list before adding it to the new group (it used to be the other way around). The downside of this is that, if you're moving an ICQ buddy who requires authorization, you'll have to rerequest authorization. The upside of this is that it actually works, and moving an ICQ buddy won't inadvertently delete them from your list. Modified Paths: -------------- trunk/src/protocols/oscar/family_feedbag.c trunk/src/protocols/oscar/oscar.h Modified: trunk/src/protocols/oscar/family_feedbag.c =================================================================== --- trunk/src/protocols/oscar/family_feedbag.c 2006-07-01 18:06:36 UTC (rev 16387) +++ trunk/src/protocols/oscar/family_feedbag.c 2006-07-01 18:39:13 UTC (rev 16388) @@ -456,14 +456,14 @@ * @param sn The name of the buddy. * @return 1 if you are waiting for authorization; 0 if you are not */ -int aim_ssi_waitingforauth(struct aim_ssi_item *list, const char *gn, const char *sn) +gboolean aim_ssi_waitingforauth(struct aim_ssi_item *list, const char *gn, const char *sn) { struct aim_ssi_item *cur = aim_ssi_itemlist_finditem(list, gn, sn, AIM_SSI_TYPE_BUDDY); if (cur) { if (aim_tlv_gettlv(cur->data, 0x0066, 1)) - return 1; + return TRUE; } - return 0; + return FALSE; } /** @@ -945,10 +945,17 @@ */ int aim_ssi_movebuddy(OscarData *od, const char *oldgn, const char *newgn, const char *sn) { - char *alias = aim_ssi_getalias(od->ssi.local, oldgn, sn); - aim_ssi_addbuddy(od, sn, newgn, alias, NULL, NULL, aim_ssi_waitingforauth(od->ssi.local, oldgn, sn)); + char *alias; + gboolean waitingforauth; + + alias = aim_ssi_getalias(od->ssi.local, oldgn, sn); + waitingforauth = aim_ssi_waitingforauth(od->ssi.local, oldgn, sn); + aim_ssi_delbuddy(od, sn, oldgn); + aim_ssi_addbuddy(od, sn, newgn, alias, NULL, NULL, waitingforauth); + free(alias); + return 0; } Modified: trunk/src/protocols/oscar/oscar.h =================================================================== --- trunk/src/protocols/oscar/oscar.h 2006-07-01 18:06:36 UTC (rev 16387) +++ trunk/src/protocols/oscar/oscar.h 2006-07-01 18:39:13 UTC (rev 16388) @@ -1144,7 +1144,7 @@ guint32 aim_ssi_getpresence(struct aim_ssi_item *list); char *aim_ssi_getalias(struct aim_ssi_item *list, const char *gn, const char *sn); char *aim_ssi_getcomment(struct aim_ssi_item *list, const char *gn, const char *sn); -int aim_ssi_waitingforauth(struct aim_ssi_item *list, const char *gn, const char *sn); +gboolean aim_ssi_waitingforauth(struct aim_ssi_item *list, const char *gn, const char *sn); /* Client functions for changing SSI data */ int aim_ssi_addbuddy(OscarData *od, const char *name, const char *group, const char *alias, const char *comment, const char *smsnum, int needauth); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-07-01 18:06:40
|
Revision: 16387 Author: thekingant Date: 2006-07-01 11:06:36 -0700 (Sat, 01 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16387&view=rev Log Message: ----------- Backport SVN revision #16386 from HEAD to v2_0_0 Original commit message: sf patch #1497232, from Jono Cole, "Segfault in bonjour when another protocol is logged in" "The Bonjour protocol plugin was causing Gaim to segfault on receiving a message when other protocols were logged in. This is dependant on the active buddies in the buddy list and has been noticed the most when msn is used." ViewCVS Links: ------------- http://svn.sourceforge.net/gaim/?rev=16386&view=rev Modified Paths: -------------- branches/v2_0_0/src/protocols/bonjour/jabber.c Modified: branches/v2_0_0/src/protocols/bonjour/jabber.c =================================================================== --- branches/v2_0_0/src/protocols/bonjour/jabber.c 2006-07-01 18:04:55 UTC (rev 16386) +++ branches/v2_0_0/src/protocols/bonjour/jabber.c 2006-07-01 18:06:36 UTC (rev 16387) @@ -221,18 +221,29 @@ struct _check_buddy_by_address_t { char *address; GaimBuddy **gb; + BonjourJabber *bj; }; static void _check_buddy_by_address(gpointer key, gpointer value, gpointer data) { GaimBuddy *gb = (GaimBuddy*)value; - BonjourBuddy *bb = (BonjourBuddy*)gb->proto_data; - struct _check_buddy_by_address_t *d = (struct _check_buddy_by_address_t *)data; + BonjourBuddy *bb; + struct _check_buddy_by_address_t *cbba; - if (bb != NULL) { - if (g_strcasecmp(bb->ip, (char*)d->address) == 0) - *(d->gb) = gb; + gb = value; + cbba = data; + + /* + * If the current GaimBuddy's data is not null and the GaimBuddy's account + * is the same as the account requesting the check then continue to determine + * whether the buddies IP matches the target IP. + */ + if (cbba->bj->account == gb->account) + { + bb = gb->proto_data; + if ((bb != NULL) && (g_strcasecmp(bb->ip, cbba->address) == 0)) + *(cbba->gb) = gb; } } @@ -371,6 +382,7 @@ socklen_t sin_size = sizeof(struct sockaddr); int client_socket; BonjourBuddy *bb = NULL; + BonjourJabber *bj = data; char *address_text = NULL; GaimBuddyList *bl = gaim_get_blist(); struct _check_buddy_by_address_t *cbba; @@ -386,11 +398,12 @@ } fcntl(client_socket, F_SETFL, O_NONBLOCK); - /* Look for the buddy that has open the conversation and fill information */ + /* Look for the buddy that has opened the conversation and fill information */ address_text = inet_ntoa(their_addr.sin_addr); cbba = g_new0(struct _check_buddy_by_address_t, 1); cbba->address = address_text; cbba->gb = &gb; + cbba->bj = bj; g_hash_table_foreach(bl->buddies, _check_buddy_by_address, cbba); g_free(cbba); if (gb == NULL) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-07-01 18:05:02
|
Revision: 16386 Author: thekingant Date: 2006-07-01 11:04:55 -0700 (Sat, 01 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16386&view=rev Log Message: ----------- sf patch #1497232, from Jono Cole, "Segfault in bonjour when another protocol is logged in" "The Bonjour protocol plugin was causing Gaim to segfault on receiving a message when other protocols were logged in. This is dependant on the active buddies in the buddy list and has been noticed the most when msn is used." Modified Paths: -------------- trunk/src/protocols/bonjour/jabber.c Modified: trunk/src/protocols/bonjour/jabber.c =================================================================== --- trunk/src/protocols/bonjour/jabber.c 2006-07-01 15:33:43 UTC (rev 16385) +++ trunk/src/protocols/bonjour/jabber.c 2006-07-01 18:04:55 UTC (rev 16386) @@ -221,18 +221,29 @@ struct _check_buddy_by_address_t { char *address; GaimBuddy **gb; + BonjourJabber *bj; }; static void _check_buddy_by_address(gpointer key, gpointer value, gpointer data) { GaimBuddy *gb = (GaimBuddy*)value; - BonjourBuddy *bb = (BonjourBuddy*)gb->proto_data; - struct _check_buddy_by_address_t *d = (struct _check_buddy_by_address_t *)data; + BonjourBuddy *bb; + struct _check_buddy_by_address_t *cbba; - if (bb != NULL) { - if (g_strcasecmp(bb->ip, (char*)d->address) == 0) - *(d->gb) = gb; + gb = value; + cbba = data; + + /* + * If the current GaimBuddy's data is not null and the GaimBuddy's account + * is the same as the account requesting the check then continue to determine + * whether the buddies IP matches the target IP. + */ + if (cbba->bj->account == gb->account) + { + bb = gb->proto_data; + if ((bb != NULL) && (g_strcasecmp(bb->ip, cbba->address) == 0)) + *(cbba->gb) = gb; } } @@ -371,6 +382,7 @@ socklen_t sin_size = sizeof(struct sockaddr); int client_socket; BonjourBuddy *bb = NULL; + BonjourJabber *bj = data; char *address_text = NULL; GaimBuddyList *bl = gaim_get_blist(); struct _check_buddy_by_address_t *cbba; @@ -386,11 +398,12 @@ } fcntl(client_socket, F_SETFL, O_NONBLOCK); - /* Look for the buddy that has open the conversation and fill information */ + /* Look for the buddy that has opened the conversation and fill information */ address_text = inet_ntoa(their_addr.sin_addr); cbba = g_new0(struct _check_buddy_by_address_t, 1); cbba->address = address_text; cbba->gb = &gb; + cbba->bj = bj; g_hash_table_foreach(bl->buddies, _check_buddy_by_address, cbba); g_free(cbba); if (gb == NULL) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nos...@us...> - 2006-07-01 17:29:51
|
Revision: 16385 Author: nosnilmot Date: 2006-07-01 08:33:43 -0700 (Sat, 01 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16385&view=rev Log Message: ----------- Backport SVN revision #16384 from HEAD to v2_0_0 Original commit message: Workaround for silc toolkit "bug" that prevents empty unix account real names from connecting. ViewCVS Links: ------------- http://svn.sourceforge.net/gaim/?rev=16384&view=rev Modified Paths: -------------- branches/v2_0_0/src/protocols/silc/silc.c Modified: branches/v2_0_0/src/protocols/silc/silc.c =================================================================== --- branches/v2_0_0/src/protocols/silc/silc.c 2006-07-01 15:20:58 UTC (rev 16384) +++ branches/v2_0_0/src/protocols/silc/silc.c 2006-07-01 15:33:43 UTC (rev 16385) @@ -268,6 +268,7 @@ GaimConnection *gc; char pkd[256], prd[256]; const char *cipher, *hmac; + char *realname; int i; gc = account->gc; @@ -298,11 +299,16 @@ client->username = silc_get_username(); gaim_account_set_username(account, client->username); } + realname = silc_get_real_name(); if (gaim_account_get_user_info(account)) { client->realname = strdup(gaim_account_get_user_info(account)); + free(realname); + } else if ((silc_get_real_name() != NULL) && (*realname != '\0')) { + client->realname = realname; + gaim_account_set_user_info(account, client->realname); } else { - client->realname = silc_get_real_name(); - gaim_account_set_user_info(account, client->realname); + free(realname); + client->realname = strdup(_("Gaim User")); } client->hostname = silc_net_localhost(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nos...@us...> - 2006-07-01 17:29:51
|
Revision: 16384 Author: nosnilmot Date: 2006-07-01 08:20:58 -0700 (Sat, 01 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16384&view=rev Log Message: ----------- Workaround for silc toolkit "bug" that prevents empty unix account real names from connecting. Modified Paths: -------------- trunk/src/protocols/silc/silc.c Modified: trunk/src/protocols/silc/silc.c =================================================================== --- trunk/src/protocols/silc/silc.c 2006-07-01 06:18:11 UTC (rev 16383) +++ trunk/src/protocols/silc/silc.c 2006-07-01 15:20:58 UTC (rev 16384) @@ -268,6 +268,7 @@ GaimConnection *gc; char pkd[256], prd[256]; const char *cipher, *hmac; + char *realname; int i; gc = account->gc; @@ -298,11 +299,16 @@ client->username = silc_get_username(); gaim_account_set_username(account, client->username); } + realname = silc_get_real_name(); if (gaim_account_get_user_info(account)) { client->realname = strdup(gaim_account_get_user_info(account)); + free(realname); + } else if ((silc_get_real_name() != NULL) && (*realname != '\0')) { + client->realname = realname; + gaim_account_set_user_info(account, client->realname); } else { - client->realname = silc_get_real_name(); - gaim_account_set_user_info(account, client->realname); + free(realname); + client->realname = strdup(_("Gaim User")); } client->hostname = silc_net_localhost(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2006-07-01 06:18:19
|
Revision: 16383 Author: markhuetsch Date: 2006-06-30 23:18:11 -0700 (Fri, 30 Jun 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16383&view=rev Log Message: ----------- Added a missing definition for LOCALEDIR Modified Paths: -------------- trunk/src/protocols/qq/Makefile.am Modified: trunk/src/protocols/qq/Makefile.am =================================================================== --- trunk/src/protocols/qq/Makefile.am 2006-07-01 04:24:31 UTC (rev 16382) +++ trunk/src/protocols/qq/Makefile.am 2006-07-01 06:18:11 UTC (rev 16383) @@ -101,6 +101,7 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/src \ -DDATADIR=\"${datadir}\" \ + -DLOCALEDIR=\"${datadir}/locale\" \ -DVERSION=\"$(VERSION)\" \ $(DEBUG_CFLAGS) \ $(GTK_CFLAGS) \ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-07-01 04:24:42
|
Revision: 16382 Author: sadrul Date: 2006-06-30 21:24:31 -0700 (Fri, 30 Jun 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16382&view=rev Log Message: ----------- I have added a sort of a taskbar, useful in showing the active windows. I have also readjusted the blue color a little bit, since this is the one I am using in a few places right now. And also getting rid of some code-duplication. Modified Paths: -------------- trunk/console/gntblist.c trunk/console/gntconv.c trunk/console/libgnt/gnt.h trunk/console/libgnt/gntcolors.c trunk/console/libgnt/gntmain.c trunk/console/libgnt/gntwidget.h Modified: trunk/console/gntblist.c =================================================================== --- trunk/console/gntblist.c 2006-07-01 00:56:05 UTC (rev 16381) +++ trunk/console/gntblist.c 2006-07-01 04:24:31 UTC (rev 16382) @@ -219,6 +219,7 @@ get_display_name(node), group, NULL); } +#if 0 static void buddy_signed_on(GaimBuddy *buddy, GGBlist *ggblist) { @@ -230,6 +231,7 @@ { node_remove(gaim_get_blist(), (GaimBlistNode*)buddy); } +#endif GaimBlistUiOps *gg_blist_get_ui_ops() { @@ -259,7 +261,6 @@ static void draw_tooltip(GGBlist *ggblist) { - return; GaimBlistNode *node; int x, y, top, width; GString *str; @@ -410,7 +411,7 @@ ggblist->tree = gnt_tree_new(); GNT_WIDGET_SET_FLAGS(ggblist->tree, GNT_WIDGET_NO_BORDER); - gnt_widget_set_size(ggblist->tree, 25, getmaxy(stdscr) - 2); + gnt_widget_set_size(ggblist->tree, 25, getmaxy(stdscr) - 3); gnt_box_add_widget(GNT_BOX(ggblist->window), ggblist->tree); gnt_widget_show(ggblist->window); Modified: trunk/console/gntconv.c =================================================================== --- trunk/console/gntconv.c 2006-07-01 00:56:05 UTC (rev 16381) +++ trunk/console/gntconv.c 2006-07-01 04:24:31 UTC (rev 16382) @@ -101,7 +101,7 @@ ggc->conv = conv; type = gaim_conversation_get_type(conv); - title = g_strdup_printf(_("Conversation: %s"), gaim_conversation_get_name(conv)); + title = g_strdup_printf(_("%s"), gaim_conversation_get_name(conv)); ggc->window = gnt_box_new(FALSE, TRUE); gnt_box_set_title(GNT_BOX(ggc->window), title); gnt_box_set_toplevel(GNT_BOX(ggc->window), TRUE); @@ -133,38 +133,52 @@ } static void -gg_write_chat(GaimConversation *conv, const char *who, const char *message, +gg_write_common(GaimConversation *conv, const char *who, const char *message, GaimMessageFlags flags, time_t mtime) { GGConv *ggconv = g_hash_table_lookup(ggconvs, conv); - char *name, *strip; + char *strip; + GntTextViewFlags fl = 0; g_return_if_fail(ggconv != NULL); - name = g_strdup_printf("%s: ", who); - strip = gaim_markup_strip_html(message); + if (who && *who && (flags & (GAIM_MESSAGE_SEND | GAIM_MESSAGE_RECV))) + { + char * name = g_strdup_printf("%s: ", who); + gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(ggconv->tv), + name, GNT_TEXT_FLAG_BOLD); + g_free(name); + } + else + fl = GNT_TEXT_FLAG_DIM; + if (flags & GAIM_MESSAGE_ERROR) + fl |= GNT_TEXT_FLAG_BOLD; + if (flags & GAIM_MESSAGE_NICK) + fl |= GNT_TEXT_FLAG_UNDERLINE; + + strip = gaim_markup_strip_html(message); gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(ggconv->tv), - name, GNT_TEXT_FLAG_BOLD); - gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(ggconv->tv), - strip, (flags & GAIM_MESSAGE_NICK) ? GNT_TEXT_FLAG_UNDERLINE : 0); + strip, fl); gnt_text_view_next_line(GNT_TEXT_VIEW(ggconv->tv)); gnt_text_view_scroll(GNT_TEXT_VIEW(ggconv->tv), 0); - g_free(name); g_free(strip); + + gnt_widget_set_urgent(ggconv->tv); } static void -gg_write_im(GaimConversation *conv, const char *who, const char *message, +gg_write_chat(GaimConversation *conv, const char *who, const char *message, GaimMessageFlags flags, time_t mtime) { - GGConv *ggconv = g_hash_table_lookup(ggconvs, conv); - char *strip; - char *name; + gg_write_common(conv, who, message, flags, mtime); +} - g_return_if_fail(ggconv != NULL); - +static void +gg_write_im(GaimConversation *conv, const char *who, const char *message, + GaimMessageFlags flags, time_t mtime) +{ if (flags & GAIM_MESSAGE_SEND) { who = gaim_connection_get_display_name(conv->account->gc); @@ -176,57 +190,22 @@ else if (flags & GAIM_MESSAGE_RECV) who = gaim_conversation_get_name(conv); - name = g_strdup_printf("%s: ", who); - - gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(ggconv->tv), - name, GNT_TEXT_FLAG_BOLD); - gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(ggconv->tv), - (strip = gaim_markup_strip_html(message)), 0); - gnt_text_view_next_line(GNT_TEXT_VIEW(ggconv->tv)); - gnt_text_view_scroll(GNT_TEXT_VIEW(ggconv->tv), 0); - - g_free(strip); - g_free(name); + gg_write_common(conv, who, message, flags, mtime); } static void gg_write_conv(GaimConversation *conv, const char *who, const char *alias, const char *message, GaimMessageFlags flags, time_t mtime) { - GGConv *ggconv = g_hash_table_lookup(ggconvs, conv); - char *strip; - GntTextViewFlags fl = 0; - - g_return_if_fail(ggconv != NULL); - - strip = gaim_markup_strip_html(message); - - if (flags & (GAIM_MESSAGE_SEND | GAIM_MESSAGE_RECV)) - { - char *name; - if (alias && *alias) - name = g_strdup_printf("%s: ", alias); - else if (who && *who) - name = g_strdup_printf("%s: ", who); - else - name = g_strdup(""); - - gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(ggconv->tv), - name, GNT_TEXT_FLAG_BOLD); - g_free(name); - } + const char *name; + if (alias && *alias) + name = alias; + else if (who && *who) + name = who; else - fl = GNT_TEXT_FLAG_DIM; + name = NULL; - if (flags & GAIM_MESSAGE_ERROR) - fl |= GNT_TEXT_FLAG_BOLD; - - gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(ggconv->tv), - strip, fl); - gnt_text_view_next_line(GNT_TEXT_VIEW(ggconv->tv)); - gnt_text_view_scroll(GNT_TEXT_VIEW(ggconv->tv), 0); - - g_free(strip); + gg_write_common(conv, name, message, flags, mtime); } static void Modified: trunk/console/libgnt/gnt.h =================================================================== --- trunk/console/libgnt/gnt.h 2006-07-01 00:56:05 UTC (rev 16381) +++ trunk/console/libgnt/gnt.h 2006-07-01 04:24:31 UTC (rev 16382) @@ -16,3 +16,5 @@ void gnt_screen_take_focus(GntWidget *widget); gboolean gnt_widget_has_focus(GntWidget *widget); + +void gnt_widget_set_urgent(GntWidget *widget); Modified: trunk/console/libgnt/gntcolors.c =================================================================== --- trunk/console/libgnt/gntcolors.c 2006-07-01 00:56:05 UTC (rev 16381) +++ trunk/console/libgnt/gntcolors.c 2006-07-01 04:24:31 UTC (rev 16382) @@ -9,7 +9,7 @@ init_color(GNT_COLOR_BLACK, 0, 0, 0); init_color(GNT_COLOR_RED, 1000, 0, 0); init_color(GNT_COLOR_GREEN, 0, 1000, 0); - init_color(GNT_COLOR_BLUE, 0, 0, 1000); + init_color(GNT_COLOR_BLUE, 250, 250, 700); init_color(GNT_COLOR_WHITE, 1000, 1000, 1000); init_color(GNT_COLOR_GRAY, 699, 699, 699); init_color(GNT_COLOR_DARK_GRAY, 256, 256, 256); @@ -18,8 +18,10 @@ init_pair(GNT_COLOR_NORMAL, GNT_COLOR_BLACK, GNT_COLOR_WHITE); init_pair(GNT_COLOR_HIGHLIGHT, GNT_COLOR_WHITE, GNT_COLOR_BLUE); init_pair(GNT_COLOR_SHADOW, GNT_COLOR_BLACK, GNT_COLOR_DARK_GRAY); - init_pair(GNT_COLOR_TITLE, GNT_COLOR_WHITE, GNT_COLOR_DARK_GRAY); - init_pair(GNT_COLOR_TITLE_D, GNT_COLOR_BLACK, GNT_COLOR_GRAY); + + init_pair(GNT_COLOR_TITLE, GNT_COLOR_WHITE, GNT_COLOR_BLUE); + init_pair(GNT_COLOR_TITLE_D, GNT_COLOR_WHITE, GNT_COLOR_GRAY); + init_pair(GNT_COLOR_TEXT_NORMAL, GNT_COLOR_WHITE, GNT_COLOR_BLUE); init_pair(GNT_COLOR_HIGHLIGHT_D, GNT_COLOR_BLACK, GNT_COLOR_GRAY); init_pair(GNT_COLOR_DISABLED, GNT_COLOR_GRAY, GNT_COLOR_WHITE); Modified: trunk/console/libgnt/gntmain.c =================================================================== --- trunk/console/libgnt/gntmain.c 2006-07-01 00:56:05 UTC (rev 16381) +++ trunk/console/libgnt/gntmain.c 2006-07-01 04:24:31 UTC (rev 16382) @@ -23,6 +23,7 @@ static GHashTable *nodes; static void free_node(gpointer data); +static void draw_taskbar(); void gnt_screen_take_focus(GntWidget *widget) { @@ -33,6 +34,7 @@ gnt_widget_set_focus(widget, TRUE); if (w) gnt_widget_set_focus(w, FALSE); + draw_taskbar(); } void gnt_screen_remove_widget(GntWidget *widget) @@ -43,6 +45,7 @@ gnt_widget_set_focus(focus_list->data, TRUE); gnt_widget_draw(focus_list->data); } + draw_taskbar(); } static void @@ -66,6 +69,53 @@ } } +static void +draw_taskbar() +{ + static WINDOW *taskbar = NULL; + GList *iter; + int n, width; + int i; + + if (taskbar == NULL) + { + taskbar = newwin(1, getmaxx(stdscr), getmaxy(stdscr) - 1, 0); + } + + werase(taskbar); + + n = g_list_length(g_list_first(focus_list)); + if (n) + width = getmaxx(stdscr) / n; + + for (i = 0, iter = g_list_first(focus_list); iter; iter = iter->next, i++) + { + GntWidget *w = iter->data; + int color; + + if (w == focus_list->data) + { + /* This is the current window in focus */ + color = GNT_COLOR_TITLE; + GNT_WIDGET_UNSET_FLAGS(w, GNT_WIDGET_URGENT); + } + else if (GNT_WIDGET_IS_FLAG_SET(w, GNT_WIDGET_URGENT)) + { + /* This is a window with the URGENT hint set */ + color = GNT_COLOR_TITLE_D; + } + else + { + color = GNT_COLOR_NORMAL; + } + wbkgdset(taskbar, '\0' | COLOR_PAIR(color)); + mvwhline(taskbar, 0, width * i, ' ' | COLOR_PAIR(color), width); + mvwprintw(taskbar, 0, width * i, "%s", GNT_BOX(w)->title); + } + + wrefresh(taskbar); +} + static gboolean io_invoke(GIOChannel *source, GIOCondition cond, gpointer null) { @@ -135,6 +185,8 @@ gnt_widget_set_focus(w, FALSE); } } + + draw_taskbar(); refresh(); return TRUE; @@ -345,3 +397,15 @@ return FALSE; } +void gnt_widget_set_urgent(GntWidget *widget) +{ + while (widget->parent) + widget = widget->parent; + + if (focus_list && focus_list->data == widget) + return; + + GNT_WIDGET_SET_FLAGS(widget, GNT_WIDGET_URGENT); + draw_taskbar(); +} + Modified: trunk/console/libgnt/gntwidget.h =================================================================== --- trunk/console/libgnt/gntwidget.h 2006-07-01 00:56:05 UTC (rev 16381) +++ trunk/console/libgnt/gntwidget.h 2006-07-01 04:24:31 UTC (rev 16382) @@ -35,7 +35,8 @@ GNT_WIDGET_NO_BORDER = 1 << 3, GNT_WIDGET_NO_SHADOW = 1 << 4, GNT_WIDGET_HAS_FOCUS = 1 << 5, - GNT_WIDGET_DRAWING = 1 << 6 + GNT_WIDGET_DRAWING = 1 << 6, + GNT_WIDGET_URGENT = 1 << 7 } GntWidgetFlags; /* XXX: I'll have to ask grim what he's using this for in guifications. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-07-01 00:56:24
|
Revision: 16381 Author: sadrul Date: 2006-06-30 17:56:05 -0700 (Fri, 30 Jun 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16381&view=rev Log Message: ----------- Changes in GntTextView. Things go somewhat 'smooth' when run inside valgrind. Otherwise, it's kind of flaky. I don't mind a single bit if someone gave me a hint :) Modified Paths: -------------- trunk/console/gntblist.c trunk/console/gntconv.c trunk/console/gntgaim.c trunk/console/libgnt/gnt.h trunk/console/libgnt/gntbox.c trunk/console/libgnt/gntbox.h trunk/console/libgnt/gntcolors.c trunk/console/libgnt/gntcolors.h trunk/console/libgnt/gntentry.c trunk/console/libgnt/gntkeys.h trunk/console/libgnt/gntmain.c trunk/console/libgnt/gnttextview.c trunk/console/libgnt/gnttextview.h trunk/console/libgnt/gnttree.c trunk/console/libgnt/gntwidget.c trunk/console/libgnt/test/multiwin.c trunk/console/libgnt/test/tv.c Modified: trunk/console/gntblist.c =================================================================== --- trunk/console/gntblist.c 2006-06-30 16:23:56 UTC (rev 16380) +++ trunk/console/gntblist.c 2006-07-01 00:56:05 UTC (rev 16381) @@ -6,6 +6,7 @@ #include "gntgaim.h" #include "gntbox.h" +#include "gntlabel.h" #include "gnttree.h" #include "gntblist.h" @@ -238,12 +239,27 @@ static void selection_activate(GntWidget *widget, GGBlist *ggblist) { - gnt_widget_set_focus(widget, FALSE); + GntTree *tree = GNT_TREE(ggblist->tree); + GaimBlistNode *node = gnt_tree_get_selection_data(tree); + + if (GAIM_BLIST_NODE_IS_BUDDY(node)) + { + GaimBuddy *buddy = (GaimBuddy *)node; + gaim_conversation_new(GAIM_CONV_TYPE_IM, + gaim_buddy_get_account(buddy), + gaim_buddy_get_name(buddy)); + } + else if (GAIM_BLIST_NODE_IS_CHAT(node)) + { + GaimChat *chat = (GaimChat*)node; + serv_join_chat(chat->account->gc, chat->components); + } } static void draw_tooltip(GGBlist *ggblist) { + return; GaimBlistNode *node; int x, y, top, width; GString *str; @@ -251,12 +267,15 @@ GaimPluginProtocolInfo *prpl_info; GaimAccount *account; GntTree *tree; - GntWidget *widget, *box, *label; + GntWidget *widget, *box; char *title = NULL; widget = ggblist->tree; tree = GNT_TREE(widget); + if (!gnt_widget_has_focus(ggblist->tree)) + return; + if (ggblist->tooltip) { /* XXX: Once we can properly redraw on expose events, this can be removed at the end @@ -332,7 +351,7 @@ GNT_WIDGET_SET_FLAGS(box, GNT_WIDGET_NO_SHADOW); gnt_box_set_title(GNT_BOX(box), title); - gnt_box_add_widget(GNT_BOX(box), GNT_WIDGET(gnt_label_new(str->str))); + gnt_box_add_widget(GNT_BOX(box), gnt_label_new(str->str)); gnt_widget_set_position(box, x, y); gnt_widget_draw(box); @@ -365,25 +384,7 @@ return TRUE; } } - else if (text[0] == '\r' && text[1] == '\0') - { - GntTree *tree = GNT_TREE(ggblist->tree); - GaimBlistNode *node = gnt_tree_get_selection_data(tree); - if (GAIM_BLIST_NODE_IS_BUDDY(node)) - { - GaimBuddy *buddy = (GaimBuddy *)node; - gaim_conversation_new(GAIM_CONV_TYPE_IM, - gaim_buddy_get_account(buddy), - gaim_buddy_get_name(buddy)); - } - else if (GAIM_BLIST_NODE_IS_CHAT(node)) - { - GaimChat *chat = (GaimChat*)node; - serv_join_chat(chat->account->gc, chat->components); - } - } - return FALSE; } Modified: trunk/console/gntconv.c =================================================================== --- trunk/console/gntconv.c 2006-06-30 16:23:56 UTC (rev 16380) +++ trunk/console/gntconv.c 2006-07-01 00:56:05 UTC (rev 16381) @@ -1,3 +1,4 @@ +#include <string.h> #include <util.h> #include "gntgaim.h" @@ -59,6 +60,20 @@ gnt_entry_clear(GNT_ENTRY(ggconv->entry)); return TRUE; } + else if (key[0] == 27) + { + if (strcmp(key+1, GNT_KEY_DOWN) == 0) + gnt_text_view_scroll(GNT_TEXT_VIEW(ggconv->tv), 1); + else if (strcmp(key+1, GNT_KEY_UP) == 0) + gnt_text_view_scroll(GNT_TEXT_VIEW(ggconv->tv), -1); + else if (strcmp(key+1, GNT_KEY_PGDOWN) == 0) + gnt_text_view_scroll(GNT_TEXT_VIEW(ggconv->tv), ggconv->tv->priv.height - 2); + else if (strcmp(key+1, GNT_KEY_PGUP) == 0) + gnt_text_view_scroll(GNT_TEXT_VIEW(ggconv->tv), -(ggconv->tv->priv.height - 2)); + else + return FALSE; + return TRUE; + } return FALSE; } @@ -90,7 +105,7 @@ ggc->window = gnt_box_new(FALSE, TRUE); gnt_box_set_title(GNT_BOX(ggc->window), title); gnt_box_set_toplevel(GNT_BOX(ggc->window), TRUE); - gnt_widget_set_name(ggc->window, "conversation-window"); + gnt_widget_set_name(ggc->window, title); ggc->tv = gnt_text_view_new(); gnt_box_add_widget(GNT_BOX(ggc->window), ggc->tv); @@ -180,6 +195,7 @@ { GGConv *ggconv = g_hash_table_lookup(ggconvs, conv); char *strip; + GntTextViewFlags fl = 0; g_return_if_fail(ggconv != NULL); @@ -199,8 +215,14 @@ name, GNT_TEXT_FLAG_BOLD); g_free(name); } + else + fl = GNT_TEXT_FLAG_DIM; + + if (flags & GAIM_MESSAGE_ERROR) + fl |= GNT_TEXT_FLAG_BOLD; + gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(ggconv->tv), - strip, 0); + strip, fl); gnt_text_view_next_line(GNT_TEXT_VIEW(ggconv->tv)); gnt_text_view_scroll(GNT_TEXT_VIEW(ggconv->tv), 0); Modified: trunk/console/gntgaim.c =================================================================== --- trunk/console/gntgaim.c 2006-06-30 16:23:56 UTC (rev 16380) +++ trunk/console/gntgaim.c 2006-07-01 00:56:05 UTC (rev 16381) @@ -16,6 +16,7 @@ #include "whiteboard.h" #include "gntgaim.h" +#include "gntui.h" /* Anything IO-related is directly copied from gtkgaim's source tree */ Modified: trunk/console/libgnt/gnt.h =================================================================== --- trunk/console/libgnt/gnt.h 2006-06-30 16:23:56 UTC (rev 16380) +++ trunk/console/libgnt/gnt.h 2006-07-01 00:56:05 UTC (rev 16381) @@ -14,3 +14,5 @@ void gnt_screen_update(GntWidget *widget); void gnt_screen_take_focus(GntWidget *widget); + +gboolean gnt_widget_has_focus(GntWidget *widget); Modified: trunk/console/libgnt/gntbox.c =================================================================== --- trunk/console/libgnt/gntbox.c 2006-06-30 16:23:56 UTC (rev 16380) +++ trunk/console/libgnt/gntbox.c 2006-07-01 00:56:05 UTC (rev 16381) @@ -10,6 +10,8 @@ static GntWidgetClass *parent_class = NULL; static guint signals[SIGS] = { 0 }; +static GntWidget * find_focusable_widget(GntBox *box); + static void gnt_box_draw(GntWidget *widget) { @@ -34,7 +36,11 @@ /* XXX: Position of the title might be configurable */ pos = (widget->priv.width - pos) / 2; } - wbkgdset(widget->window, '\0' | COLOR_PAIR(GNT_COLOR_TITLE)); + + if (gnt_widget_has_focus(widget)) + wbkgdset(widget->window, '\0' | COLOR_PAIR(GNT_COLOR_TITLE)); + else + wbkgdset(widget->window, '\0' | COLOR_PAIR(GNT_COLOR_TITLE_D)); mvwprintw(widget->window, 0, pos, title); g_free(title); } @@ -139,23 +145,88 @@ gnt_box_map(GntWidget *widget) { if (widget->priv.width == 0 || widget->priv.height == 0) + { gnt_widget_size_request(widget); + find_focusable_widget(GNT_BOX(widget)); + } DEBUG; } +static GntWidget * +find_next_focus(GntBox *box) +{ + GntWidget *w = box->active; + GList *iter; + + while (w && !(iter = g_list_find(box->list, w))) + w = w->parent; + + if (!w) + box->active = NULL; + else if (iter) + { + GntWidget *next = NULL; + + do + { + next = find_next_focus(iter->data); + box->active = next; + iter = iter->next; + } while (!next && iter); + } + + if (box->active == NULL && GNT_WIDGET(box)->parent == NULL) + { + box->active = find_focusable_widget(box); + } + + if (box->active) + GNT_WIDGET_SET_FLAGS(box->active, GNT_WIDGET_HAS_FOCUS); + + return box->active; +} + /* Ensures that the current widget can take focus */ -static void -ensure_active(GntBox *box) +static GntWidget * +find_focusable_widget(GntBox *box) { int investigated = 0; int total; + GntWidget *w = NULL; + GList *iter; - if (box->active == NULL) - box->active = box->list; + for (iter = box->list; iter; iter = iter->next) + { + w = iter->data; + if (GNT_IS_BOX(w)) + { + w = find_focusable_widget(GNT_BOX(w)); + if (w) + break; + } + else if (GNT_WIDGET_IS_FLAG_SET(w, GNT_WIDGET_CAN_TAKE_FOCUS)) + break; + } + if (iter) + box->active = w; + else + box->active = NULL; + + if (box->active) + GNT_WIDGET_SET_FLAGS(box->active, GNT_WIDGET_HAS_FOCUS); + + return box->active; + +#if 0 + if (box->active == NULL && box->list) + box->active = box->list->data; + else + w = box->active; + total = g_list_length(box->list); - while (box->active && !GNT_WIDGET_IS_FLAG_SET(box->active->data, GNT_WIDGET_CAN_TAKE_FOCUS)) + while (box->active && !GNT_WIDGET_IS_FLAG_SET(box->active, GNT_WIDGET_CAN_TAKE_FOCUS)) { box->active = box->active->next; investigated++; @@ -171,6 +242,12 @@ investigated++; } } + + if (box->active) + gnt_widget_set_focus(box->active->data, TRUE); + if (w && w != box->active->data) + gnt_widget_set_focus(w, FALSE); +#endif } static gboolean @@ -178,15 +255,15 @@ { GntBox *box = GNT_BOX(widget); - ensure_active(box); - if (box->active == NULL) + if (box->active == NULL && !find_focusable_widget(box)) return FALSE; - if (gnt_widget_key_pressed(box->active->data, text)) + if (gnt_widget_key_pressed(box->active, text)) return TRUE; if (text[0] == 27) { +#if 0 GList *now = NULL; if (strcmp(text+1, GNT_KEY_LEFT) == 0) { @@ -209,6 +286,7 @@ return TRUE; } +#endif } return FALSE; @@ -237,8 +315,9 @@ return NULL; } +#if 0 static void -gnt_box_lost_focus(GntWidget *widget) +gnt_box_set_focus(GntWidget *widget, gboolean set) { GntWidget *p = widget; @@ -247,10 +326,32 @@ p = find_focused_widget(GNT_BOX(p)); if (p) - gnt_widget_set_focus(p, FALSE); + gnt_widget_set_focus(p, set); + gnt_widget_draw(widget); } static void +gnt_box_lost_focus(GntWidget *widget) +{ + gnt_box_set_focus(widget, FALSE); +} + +static void +gnt_box_gained_focus(GntWidget *widget) +{ + GntWidget *p; + + while (widget->parent) + widget = widget->parent; + + p = find_focused_widget(GNT_BOX(widget)); + GNT_BOX(widget)->active = g_list_find(GNT_BOX(widget)->list, p); + if (p) + gnt_widget_draw(p); +} +#endif + +static void gnt_box_destroy(GntWidget *w) { GntBox *box = GNT_BOX(w); @@ -286,7 +387,11 @@ parent_class->size_request = gnt_box_size_request; parent_class->set_position = gnt_box_set_position; parent_class->key_pressed = gnt_box_key_pressed; +#if 0 + /* We are going to need this when there are multiple focusble widgets in a box */ parent_class->lost_focus = gnt_box_lost_focus; + parent_class->gained_focus = gnt_box_gained_focus; +#endif DEBUG; } Modified: trunk/console/libgnt/gntbox.h =================================================================== --- trunk/console/libgnt/gntbox.h 2006-06-30 16:23:56 UTC (rev 16380) +++ trunk/console/libgnt/gntbox.h 2006-07-01 00:56:05 UTC (rev 16381) @@ -22,7 +22,7 @@ gboolean homogeneous; GList *list; /* List of widgets */ - GList *active; + GntWidget *active; int pad; /* Number of spaces to use between widgets */ char *title; Modified: trunk/console/libgnt/gntcolors.c =================================================================== --- trunk/console/libgnt/gntcolors.c 2006-06-30 16:23:56 UTC (rev 16380) +++ trunk/console/libgnt/gntcolors.c 2006-07-01 00:56:05 UTC (rev 16381) @@ -11,16 +11,18 @@ init_color(GNT_COLOR_GREEN, 0, 1000, 0); init_color(GNT_COLOR_BLUE, 0, 0, 1000); init_color(GNT_COLOR_WHITE, 1000, 1000, 1000); - init_color(GNT_COLOR_GRAY, 799, 799, 799); + init_color(GNT_COLOR_GRAY, 699, 699, 699); init_color(GNT_COLOR_DARK_GRAY, 256, 256, 256); /* Now some init_pair()s */ init_pair(GNT_COLOR_NORMAL, GNT_COLOR_BLACK, GNT_COLOR_WHITE); - init_pair(GNT_COLOR_HIGHLIGHT, GNT_COLOR_BLUE, GNT_COLOR_GRAY); + init_pair(GNT_COLOR_HIGHLIGHT, GNT_COLOR_WHITE, GNT_COLOR_BLUE); init_pair(GNT_COLOR_SHADOW, GNT_COLOR_BLACK, GNT_COLOR_DARK_GRAY); init_pair(GNT_COLOR_TITLE, GNT_COLOR_WHITE, GNT_COLOR_DARK_GRAY); - init_pair(GNT_COLOR_TEXT_NORMAL, GNT_COLOR_BLACK, GNT_COLOR_GRAY); + init_pair(GNT_COLOR_TITLE_D, GNT_COLOR_BLACK, GNT_COLOR_GRAY); + init_pair(GNT_COLOR_TEXT_NORMAL, GNT_COLOR_WHITE, GNT_COLOR_BLUE); init_pair(GNT_COLOR_HIGHLIGHT_D, GNT_COLOR_BLACK, GNT_COLOR_GRAY); + init_pair(GNT_COLOR_DISABLED, GNT_COLOR_GRAY, GNT_COLOR_WHITE); } else { @@ -30,6 +32,7 @@ init_pair(GNT_COLOR_TITLE, COLOR_WHITE, COLOR_BLACK); init_pair(GNT_COLOR_TEXT_NORMAL, COLOR_BLACK, COLOR_WHITE); init_pair(GNT_COLOR_HIGHLIGHT_D, COLOR_CYAN, COLOR_BLACK); + init_pair(GNT_COLOR_DISABLED, COLOR_YELLOW, COLOR_WHITE); } } Modified: trunk/console/libgnt/gntcolors.h =================================================================== --- trunk/console/libgnt/gntcolors.h 2006-06-30 16:23:56 UTC (rev 16380) +++ trunk/console/libgnt/gntcolors.h 2006-07-01 00:56:05 UTC (rev 16381) @@ -13,6 +13,7 @@ GNT_COLOR_MNEMONIC_D, GNT_COLOR_SHADOW, GNT_COLOR_TITLE, + GNT_COLOR_TITLE_D, GNT_COLORS } GntColorType; Modified: trunk/console/libgnt/gntentry.c =================================================================== --- trunk/console/libgnt/gntentry.c 2006-06-30 16:23:56 UTC (rev 16380) +++ trunk/console/libgnt/gntentry.c 2006-07-01 00:56:05 UTC (rev 16381) @@ -17,7 +17,10 @@ GntEntry *entry = GNT_ENTRY(widget); int stop; - wbkgdset(widget->window, '\0' | COLOR_PAIR(GNT_COLOR_TEXT_NORMAL)); + if (gnt_widget_has_focus(widget)) + wbkgdset(widget->window, '\0' | COLOR_PAIR(GNT_COLOR_TEXT_NORMAL)); + else + wbkgdset(widget->window, '\0' | COLOR_PAIR(GNT_COLOR_HIGHLIGHT_D)); mvwprintw(widget->window, 0, 0, entry->scroll); stop = entry->end - entry->scroll; Modified: trunk/console/libgnt/gntkeys.h =================================================================== --- trunk/console/libgnt/gntkeys.h 2006-06-30 16:23:56 UTC (rev 16380) +++ trunk/console/libgnt/gntkeys.h 2006-07-01 00:56:05 UTC (rev 16381) @@ -9,6 +9,9 @@ #define GNT_KEY_UP "[A" #define GNT_KEY_DOWN "[B" +#define GNT_KEY_PGUP "[5~" +#define GNT_KEY_PGDOWN "[6~" + #define GNT_KEY_ENTER "\r" #define GNT_KEY_BACKSPACE "\177" Modified: trunk/console/libgnt/gntmain.c =================================================================== --- trunk/console/libgnt/gntmain.c 2006-06-30 16:23:56 UTC (rev 16380) +++ trunk/console/libgnt/gntmain.c 2006-07-01 00:56:05 UTC (rev 16381) @@ -13,22 +13,59 @@ static int max_x; static int max_y; +typedef struct +{ + GntWidget *me; + GList *below; /* List of widgets below me */ + GList *above; /* List of widgets above me */ +} GntNode; + static GHashTable *nodes; static void free_node(gpointer data); void gnt_screen_take_focus(GntWidget *widget) { + GntWidget *w = NULL; + if (focus_list) + w = focus_list->data; focus_list = g_list_prepend(focus_list, widget); + gnt_widget_set_focus(widget, TRUE); + if (w) + gnt_widget_set_focus(w, FALSE); } void gnt_screen_remove_widget(GntWidget *widget) { focus_list = g_list_remove(focus_list, widget); if (focus_list) + { + gnt_widget_set_focus(focus_list->data, TRUE); gnt_widget_draw(focus_list->data); + } } +static void +bring_on_top(GntWidget *widget) +{ + GntNode *node = g_hash_table_lookup(nodes, widget); + GList *iter; + + if (!node) + return; + + for (iter = node->above; iter;) + { + GntNode *n = iter->data; + iter = iter->next; + n->below = g_list_remove(n->below, node); + n->above = g_list_prepend(n->above, node); + + node->above = g_list_remove(node->above, n); + node->below = g_list_prepend(node->below, n); + } +} + static gboolean io_invoke(GIOChannel *source, GIOCondition cond, gpointer null) { @@ -79,15 +116,23 @@ else if (strcmp(buffer + 1, "n") == 0) { /* Alt + n to go to the next window */ + GntWidget *w = NULL; + if (focus_list) + w = focus_list->data; + if (focus_list && focus_list->next) focus_list = focus_list->next; else focus_list = g_list_first(focus_list); if (focus_list) { - /* XXX: Need a way to bring it on top */ + gnt_widget_set_focus(focus_list->data, TRUE); + bring_on_top(focus_list->data); gnt_widget_draw(focus_list->data); } + + if (w && w != focus_list->data) + gnt_widget_set_focus(w, FALSE); } } refresh(); @@ -134,13 +179,6 @@ * Stuff for 'window management' * *********************************/ -typedef struct -{ - GntWidget *me; - GList *below; /* List of widgets below me */ - GList *above; /* List of widgets above me */ -} GntNode; - static void free_node(gpointer data) { @@ -284,3 +322,26 @@ delwin(win); } +gboolean gnt_widget_has_focus(GntWidget *widget) +{ + GntWidget *w; + if (!widget) + return FALSE; + + w = widget; + + while (widget->parent) + { + fprintf(stderr, "%p %p\n", widget, widget->parent); + widget = widget->parent; + } + fprintf(stderr, "%p %p\n", widget, widget->parent); + + if (focus_list && focus_list->data == widget && + (!GNT_WIDGET_IS_FLAG_SET(w, GNT_WIDGET_CAN_TAKE_FOCUS) || + GNT_WIDGET_IS_FLAG_SET(w, GNT_WIDGET_HAS_FOCUS))) + return TRUE; + + return FALSE; +} + Modified: trunk/console/libgnt/gnttextview.c =================================================================== --- trunk/console/libgnt/gnttextview.c 2006-06-30 16:23:56 UTC (rev 16380) +++ trunk/console/libgnt/gnttextview.c 2006-07-01 00:56:05 UTC (rev 16381) @@ -5,6 +5,18 @@ SIGS = 1, }; +typedef struct +{ + GntTextViewFlags flags; + char *text; +} GntTextSegment; + +typedef struct +{ + GList *segments; /* A list of GntTextSegments */ + int length; /* The current length of the line so far */ +} GntTextLine; + static GntWidgetClass *parent_class = NULL; static guint signals[SIGS] = { 0 }; @@ -12,9 +24,27 @@ gnt_text_view_draw(GntWidget *widget) { GntTextView *view = GNT_TEXT_VIEW(widget); + int i = 0; + GList *lines; - copywin(view->scroll, widget->window, view->pos, 0, 0, 0, - widget->priv.height - 1, widget->priv.width - 1, FALSE); + werase(widget->window); + + for (i = 0, lines = view->list; i < widget->priv.height && lines; i++, lines = lines->next) + { + GList *iter; + GntTextLine *line = lines->data; + + wmove(widget->window, widget->priv.height - 1 - i, 0); + + for (iter = line->segments; iter; iter = iter->next) + { + GntTextSegment *seg = iter->data; + wattrset(widget->window, seg->flags); + wprintw(widget->window, "%s", seg->text); + if (!iter->next) + whline(widget->window, ' ' | seg->flags, widget->priv.width - line->length - 1); + } + } DEBUG; } @@ -43,8 +73,28 @@ } static void +free_text_segment(gpointer data, gpointer null) +{ + GntTextSegment *seg = data; + g_free(seg->text); + g_free(seg); +} + +static void +free_text_line(gpointer data, gpointer null) +{ + GntTextLine *line = data; + g_list_foreach(line->segments, free_text_segment, NULL); + g_list_free(line->segments); + g_free(line); +} + +static void gnt_text_view_destroy(GntWidget *widget) { + GntTextView *view = GNT_TEXT_VIEW(widget); + g_list_foreach(view->list, free_text_line, NULL); + g_list_free(view->list); } static void @@ -100,14 +150,12 @@ { GntWidget *widget = g_object_new(GNT_TYPE_TEXTVIEW, NULL); GntTextView *view = GNT_TEXT_VIEW(widget); + GntTextLine *line = g_new0(GntTextLine, 1); - view->scroll = newwin(255, widget->priv.width, widget->priv.y, widget->priv.x); - scrollok(view->scroll, TRUE); - wsetscrreg(view->scroll, 0, 254); - wbkgd(view->scroll, COLOR_PAIR(GNT_COLOR_NORMAL)); - werase(view->scroll); GNT_WIDGET_SET_FLAGS(widget, GNT_WIDGET_NO_BORDER); + view->list = g_list_append(view->list, line); + return widget; } @@ -117,6 +165,7 @@ int fl = 0; char **split; int i; + GList *list = view->list; if (text == NULL || *text == '\0') return; @@ -128,48 +177,80 @@ if (flags & GNT_TEXT_FLAG_BLINK) fl |= A_BLINK; - wattrset(view->scroll, fl | COLOR_PAIR(GNT_COLOR_NORMAL)); + if (flags & GNT_TEXT_FLAG_DIM) + fl |= (A_DIM | COLOR_PAIR(GNT_COLOR_DISABLED)); + else if (flags & GNT_TEXT_FLAG_HIGHLIGHT) + fl |= (A_DIM | COLOR_PAIR(GNT_COLOR_HIGHLIGHT)); + else + fl |= COLOR_PAIR(GNT_COLOR_NORMAL); + view->list = g_list_first(view->list); + split = g_strsplit(text, "\n", 0); - for (i = 0; split[i + 1]; i++) + for (i = 0; split[i]; i++) { - /* XXX: Do something if the strlen of split[i] is big - * enough to cause the text to wrap. */ - wprintw(view->scroll, "%s\n", split[i]); - view->lines++; + GntTextLine *line = view->list->data; + int len = g_utf8_strlen(split[i], -1); + char *iter = split[i]; + int prev = 0; + + while (iter && *iter) + { + GntTextSegment *seg = g_new0(GntTextSegment, 1); + seg->flags = fl; + seg->text = g_new0(char, len); /* XXX: MUST be improved */ + g_utf8_strncpy(seg->text, iter, widget->priv.width - line->length - 1); + line->segments = g_list_append(line->segments, seg); + + prev = g_utf8_strlen(seg->text, -1); + line->length += prev; + iter = g_utf8_offset_to_pointer(iter, prev); + if (line->length >= widget->priv.width - 1 && *iter) + { + line = g_new0(GntTextLine, 1); + view->list = g_list_prepend(g_list_first(view->list), line); + } + /*len -= prev;*/ + } } - wprintw(view->scroll, "%s", split[i]); + g_strfreev(split); + view->list = list; gnt_widget_draw(widget); } void gnt_text_view_scroll(GntTextView *view, int scroll) { - GntWidget *widget = GNT_WIDGET(view); - int height; - if (scroll == 0) { - view->pos = view->lines - widget->priv.height + 1; + view->list = g_list_first(view->list); } - else + else if (scroll > 0) { - view->pos += scroll; + GList *list = g_list_nth_prev(view->list, scroll); + if (list == NULL) + list = g_list_first(view->list); + view->list = list; } - - if (view->pos + (height = widget->priv.height) > view->lines) - view->pos = view->lines - height + 1; - - if (view->pos < 0) - view->pos = 0; - + else if (scroll < 0) + { + GList *list = g_list_nth(view->list, -scroll); + if (list == NULL) + list = g_list_last(view->list); + view->list = list; + } + gnt_widget_draw(GNT_WIDGET(view)); } void gnt_text_view_next_line(GntTextView *view) { - wclrtoeol(view->scroll); - gnt_text_view_append_text_with_flags(view, "\n", 0); + GntTextLine *line = g_new0(GntTextLine, 1); + GList *list = view->list; + + view->list = g_list_prepend(g_list_first(view->list), line); + view->list = list; + gnt_widget_draw(GNT_WIDGET(view)); } Modified: trunk/console/libgnt/gnttextview.h =================================================================== --- trunk/console/libgnt/gnttextview.h 2006-06-30 16:23:56 UTC (rev 16380) +++ trunk/console/libgnt/gnttextview.h 2006-07-01 00:56:05 UTC (rev 16381) @@ -25,9 +25,7 @@ { GntWidget parent; - WINDOW *scroll; /* XXX: For now, let's do with this. */ - int pos; /* Scroll position. */ - int lines; /* No. of lines of text. */ + GList *list; /* List of GntTextLine */ }; typedef enum @@ -35,6 +33,8 @@ GNT_TEXT_FLAG_BOLD = 1 << 0, GNT_TEXT_FLAG_UNDERLINE = 1 << 1, GNT_TEXT_FLAG_BLINK = 1 << 2, + GNT_TEXT_FLAG_DIM = 1 << 3, + GNT_TEXT_FLAG_HIGHLIGHT = 1 << 4, } GntTextViewFlags; struct _GnTextViewClass Modified: trunk/console/libgnt/gnttree.c =================================================================== --- trunk/console/libgnt/gnttree.c 2006-06-30 16:23:56 UTC (rev 16380) +++ trunk/console/libgnt/gnttree.c 2006-07-01 00:56:05 UTC (rev 16381) @@ -203,7 +203,7 @@ if (row == tree->current) { - if (GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_HAS_FOCUS)) + if (gnt_widget_has_focus(widget)) wbkgdset(widget->window, '\0' | COLOR_PAIR(GNT_COLOR_HIGHLIGHT)); else wbkgdset(widget->window, '\0' | COLOR_PAIR(GNT_COLOR_HIGHLIGHT_D)); /* XXX: This, somehow, doesn't work */ @@ -230,9 +230,6 @@ { GntTree *tree = GNT_TREE(widget); - scrollok(widget->window, TRUE); - wsetscrreg(widget->window, 0, widget->priv.height - 1); - redraw_tree(tree); DEBUG; Modified: trunk/console/libgnt/gntwidget.c =================================================================== --- trunk/console/libgnt/gntwidget.c 2006-06-30 16:23:56 UTC (rev 16380) +++ trunk/console/libgnt/gntwidget.c 2006-07-01 00:56:05 UTC (rev 16381) @@ -369,7 +369,6 @@ if (set && !GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_HAS_FOCUS)) { - g_signal_emit(widget->parent, signals[SIG_LOST_FOCUS], 0); GNT_WIDGET_SET_FLAGS(widget, GNT_WIDGET_HAS_FOCUS); g_signal_emit(widget, signals[SIG_GIVE_FOCUS], 0); } Modified: trunk/console/libgnt/test/multiwin.c =================================================================== --- trunk/console/libgnt/test/multiwin.c 2006-06-30 16:23:56 UTC (rev 16380) +++ trunk/console/libgnt/test/multiwin.c 2006-07-01 00:56:05 UTC (rev 16381) @@ -37,6 +37,7 @@ gnt_box_set_title(GNT_BOX(box2), "On top"); gnt_box_add_widget(GNT_BOX(box2), GNT_WIDGET(gnt_label_new("asdasd"))); + gnt_box_add_widget(GNT_BOX(box2), gnt_entry_new(NULL)); gnt_widget_show(hbox); gnt_widget_set_position(box2, 5, 5); Modified: trunk/console/libgnt/test/tv.c =================================================================== --- trunk/console/libgnt/test/tv.c 2006-06-30 16:23:56 UTC (rev 16380) +++ trunk/console/libgnt/test/tv.c 2006-07-01 00:56:05 UTC (rev 16381) @@ -11,10 +11,10 @@ { if (key[0] == '\r' && key[1] == 0) { - gnt_text_view_next_line(GNT_TEXT_VIEW(view)); gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(view), gnt_entry_get_text(GNT_ENTRY(w)), - GNT_TEXT_FLAG_BOLD); + GNT_TEXT_FLAG_HIGHLIGHT); + gnt_text_view_next_line(GNT_TEXT_VIEW(view)); gnt_entry_clear(GNT_ENTRY(w)); gnt_text_view_scroll(GNT_TEXT_VIEW(view), 0); @@ -54,8 +54,8 @@ view = gnt_text_view_new(); gnt_widget_set_name(view, "view"); - gnt_widget_set_size(view, getmaxx(stdscr) - 3, 15); - gnt_widget_set_size(entry, getmaxx(stdscr) - 3, 1); + gnt_widget_set_size(view, 20, 15); + gnt_widget_set_size(entry, 20, 1); gnt_box_add_widget(GNT_BOX(hbox), view); gnt_box_add_widget(GNT_BOX(hbox), entry); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rl...@us...> - 2006-06-30 16:24:05
|
Revision: 16380 Author: rlaager Date: 2006-06-30 09:23:56 -0700 (Fri, 30 Jun 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16380&view=rev Log Message: ----------- Merge SVN revision #16379 from v2_0_0 to trunk Original commit message (by LSchiere): iwkse in #gaim brought it to my attention that the example code in the C Plugin Howto won't compile. It won't compile because GAIM_WEBSITE is defined in internal.h, which we don't want plugin authors including, and which isn't included in the sample code. I decided it would be a good thing if the example code compiled, so I changed it. ViewCVS Links: ------------- http://svn.sourceforge.net/gaim/?rev=16379&view=rev Modified Paths: -------------- trunk/doc/C-HOWTO.dox Modified: trunk/doc/C-HOWTO.dox =================================================================== --- trunk/doc/C-HOWTO.dox 2006-06-30 14:13:35 UTC (rev 16379) +++ trunk/doc/C-HOWTO.dox 2006-06-30 16:23:56 UTC (rev 16380) @@ -67,7 +67,7 @@ "Hello World Plugin", "Hello World Plugin", NULL, - GAIM_WEBSITE, + "http://www.helloworld.tld", plugin_load, NULL, @@ -197,7 +197,7 @@ NULL, /* This is where you can put your name and email address. (You are the author right?) */ - GAIM_WEBSITE, /* This is the website for the plugin. This + "http://www.helloworld.tld", /* This is the website for the plugin. This is helpful if users find bugs in your plugin so they can help to bring them to your attention. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lsc...@us...> - 2006-06-30 14:13:47
|
Revision: 16379 Author: lschiere Date: 2006-06-30 07:13:35 -0700 (Fri, 30 Jun 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16379&view=rev Log Message: ----------- iwkse in #gaim brought it to my attention that the example code in the C Plugin Howto won't compile. It won't compile because GAIM_WEBSITE is defined in internal.h, which we don't want plugin authors including, and which isn't included in the sample code. I decided it would be a good thing if the example code compiled, so I changed it. Modified Paths: -------------- branches/v2_0_0/doc/C-HOWTO.dox Modified: branches/v2_0_0/doc/C-HOWTO.dox =================================================================== --- branches/v2_0_0/doc/C-HOWTO.dox 2006-06-30 06:58:38 UTC (rev 16378) +++ branches/v2_0_0/doc/C-HOWTO.dox 2006-06-30 14:13:35 UTC (rev 16379) @@ -67,7 +67,7 @@ "Hello World Plugin", "Hello World Plugin", NULL, - GAIM_WEBSITE, + "http://www.helloworld.tld", plugin_load, NULL, @@ -197,7 +197,7 @@ NULL, /* This is where you can put your name and email address. (You are the author right?) */ - GAIM_WEBSITE, /* This is the website for the plugin. This + "http://www.helloworld.tld", /* This is the website for the plugin. This is helpful if users find bugs in your plugin so they can help to bring them to your attention. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-06-30 06:58:40
|
Revision: 16378 Author: thekingant Date: 2006-06-29 23:58:38 -0700 (Thu, 29 Jun 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16378&view=rev Log Message: ----------- Backport SVN revision #16377 from HEAD to v2_0_0 Original commit message: Fix a crash bug pointed out by Alexander Sashnov: There is another segfault (on today SVN trunk version). Steps for reproduce: 1. Create jabber account with incorrect params, check it for connect on start up; 2. run Gaim again. It will not connect and see error message in bottom of users list; 3. Open 'accounts' dialog and deselect this account..... segfault :-) ViewCVS Links: ------------- http://svn.sourceforge.net/gaim/?rev=16377&view=rev Modified Paths: -------------- branches/v2_0_0/src/dnssrv.c branches/v2_0_0/src/protocols/jabber/jabber.c Modified: branches/v2_0_0/src/dnssrv.c =================================================================== --- branches/v2_0_0/src/dnssrv.c 2006-06-30 06:58:17 UTC (rev 16377) +++ branches/v2_0_0/src/dnssrv.c 2006-06-30 06:58:38 UTC (rev 16378) @@ -275,6 +275,12 @@ #endif +/* + * TODO: It would be really good if this returned some sort of handle + * that we could use to cancel the DNS query. As it is now, + * each callback has to check to make sure gc is still valid. + * And that is ugly. + */ void gaim_srv_resolve(const char *protocol, const char *transport, const char *domain, GaimSRVCallback cb, gpointer extradata) { char *query = g_strdup_printf("_%s._%s.%s",protocol, transport, domain); struct resdata *rdata; Modified: branches/v2_0_0/src/protocols/jabber/jabber.c =================================================================== --- branches/v2_0_0/src/protocols/jabber/jabber.c 2006-06-30 06:58:17 UTC (rev 16377) +++ branches/v2_0_0/src/protocols/jabber/jabber.c 2006-06-30 06:58:38 UTC (rev 16378) @@ -481,8 +481,19 @@ static void srv_resolved_cb(GaimSrvResponse *resp, int results, gpointer data) { - JabberStream *js = (JabberStream*)data; + GaimConnection *gc; + JabberStream *js; + gc = data; + if (!g_list_find(gaim_connections_get_all(), gc)) + { + /* This connection has been closed */ + g_free(resp); + return; + } + + js = (JabberStream*)gc->proto_data; + if(results) { jabber_login_connect(js, resp->hostname, resp->port); g_free(resp); @@ -561,7 +572,7 @@ if(connect_server[0]) { jabber_login_connect(js, connect_server, gaim_account_get_int(account, "port", 5222)); } else { - gaim_srv_resolve("xmpp-client", "tcp", js->user->domain, srv_resolved_cb, js); + gaim_srv_resolve("xmpp-client", "tcp", js->user->domain, srv_resolved_cb, gc); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-06-30 06:58:21
|
Revision: 16377 Author: thekingant Date: 2006-06-29 23:58:17 -0700 (Thu, 29 Jun 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16377&view=rev Log Message: ----------- Fix a crash bug pointed out by Alexander Sashnov: There is another segfault (on today SVN trunk version). Steps for reproduce: 1. Create jabber account with incorrect params, check it for connect on start up; 2. run Gaim again. It will not connect and see error message in bottom of users list; 3. Open 'accounts' dialog and deselect this account..... segfault :-) Modified Paths: -------------- trunk/src/dnssrv.c trunk/src/protocols/jabber/jabber.c Modified: trunk/src/dnssrv.c =================================================================== --- trunk/src/dnssrv.c 2006-06-30 03:57:22 UTC (rev 16376) +++ trunk/src/dnssrv.c 2006-06-30 06:58:17 UTC (rev 16377) @@ -275,6 +275,12 @@ #endif +/* + * TODO: It would be really good if this returned some sort of handle + * that we could use to cancel the DNS query. As it is now, + * each callback has to check to make sure gc is still valid. + * And that is ugly. + */ void gaim_srv_resolve(const char *protocol, const char *transport, const char *domain, GaimSRVCallback cb, gpointer extradata) { char *query = g_strdup_printf("_%s._%s.%s",protocol, transport, domain); struct resdata *rdata; Modified: trunk/src/protocols/jabber/jabber.c =================================================================== --- trunk/src/protocols/jabber/jabber.c 2006-06-30 03:57:22 UTC (rev 16376) +++ trunk/src/protocols/jabber/jabber.c 2006-06-30 06:58:17 UTC (rev 16377) @@ -481,8 +481,19 @@ static void srv_resolved_cb(GaimSrvResponse *resp, int results, gpointer data) { - JabberStream *js = (JabberStream*)data; + GaimConnection *gc; + JabberStream *js; + gc = data; + if (!g_list_find(gaim_connections_get_all(), gc)) + { + /* This connection has been closed */ + g_free(resp); + return; + } + + js = (JabberStream*)gc->proto_data; + if(results) { jabber_login_connect(js, resp->hostname, resp->port); g_free(resp); @@ -561,7 +572,7 @@ if(connect_server[0]) { jabber_login_connect(js, connect_server, gaim_account_get_int(account, "port", 5222)); } else { - gaim_srv_resolve("xmpp-client", "tcp", js->user->domain, srv_resolved_cb, js); + gaim_srv_resolve("xmpp-client", "tcp", js->user->domain, srv_resolved_cb, gc); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-06-30 03:57:36
|
Revision: 16376 Author: sadrul Date: 2006-06-29 20:57:22 -0700 (Thu, 29 Jun 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16376&view=rev Log Message: ----------- I may have done it (window-redrawing thing) right this time. Modified Paths: -------------- trunk/console/libgnt/gntmain.c Modified: trunk/console/libgnt/gntmain.c =================================================================== --- trunk/console/libgnt/gntmain.c 2006-06-29 21:02:54 UTC (rev 16375) +++ trunk/console/libgnt/gntmain.c 2006-06-30 03:57:22 UTC (rev 16376) @@ -219,12 +219,12 @@ top = MAX(widget->priv.y, w->priv.y) - w->priv.y; bottom = MIN(widget->priv.y + widget->priv.height, w->priv.y + w->priv.height) - w->priv.y; - + copywin(w->window, win, top, left, - w->priv.y + top, - w->priv.x + left, - w->priv.y + bottom - top - 1, - w->priv.x + right - left - 1, FALSE); + w->priv.y - widget->priv.y + top, + w->priv.x - widget->priv.x + left, + w->priv.y - widget->priv.y + bottom - 1, + w->priv.x - widget->priv.x + right - 1, FALSE); n->above = g_list_remove(n->above, node); } @@ -273,10 +273,10 @@ bottom = MIN(widget->priv.y + widget->priv.height, w->priv.y + w->priv.height) - w->priv.y; copywin(w->window, win, top, left, - w->priv.y + top, - w->priv.x + left, - w->priv.y + bottom - top - 1, - w->priv.x + right - left - 1, FALSE); + w->priv.y - widget->priv.y + top, + w->priv.x - widget->priv.x + left, + w->priv.y - widget->priv.y + bottom - 1, + w->priv.x - widget->priv.x + right - 1, FALSE); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-06-29 21:03:03
|
Revision: 16375 Author: sadrul Date: 2006-06-29 14:02:54 -0700 (Thu, 29 Jun 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16375&view=rev Log Message: ----------- Update the makefile in console/ to reflect the previous changes in libgnt/ Modified Paths: -------------- trunk/console/Makefile Modified: trunk/console/Makefile =================================================================== --- trunk/console/Makefile 2006-06-29 18:16:07 UTC (rev 16374) +++ trunk/console/Makefile 2006-06-29 21:02:54 UTC (rev 16375) @@ -1,6 +1,6 @@ CC=gcc -CFLAGS=`pkg-config --cflags gaim gobject-2.0` -g -I./libgnt/ -Wall -LDFLAGS=`pkg-config --libs gaim gobject-2.0 libxml-2.0` -lncursesw -L./libgnt/ -lgnt -pg +CFLAGS=`pkg-config --cflags gaim gobject-2.0 gnt` -g -Wall +LDFLAGS=`pkg-config --libs gaim gobject-2.0 libxml-2.0 gnt` -pg GG_SOURCES = \ gntblist.c \ @@ -17,9 +17,7 @@ gntconv.o \ gntui.o -all: - cd libgnt && make - make gntgaim +all: gntgaim gntgaim: gntgaim.o $(GG_OBJECTS) $(CC) -o gntgaim gntgaim.o $(GG_OBJECTS) $(LDFLAGS) @@ -29,7 +27,6 @@ gntui.o: gntui.c $(GG_HEADERS) clean: - cd libgnt && make clean rm -f *.o rm -f gntgaim This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-06-29 18:16:24
|
Revision: 16374 Author: sadrul Date: 2006-06-29 11:16:07 -0700 (Thu, 29 Jun 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16374&view=rev Log Message: ----------- Add some autotool thingies. These work for me, I can almost swear. Added Paths: ----------- trunk/console/libgnt/AUTHORS trunk/console/libgnt/COPYING trunk/console/libgnt/ChangeLog trunk/console/libgnt/INSTALL trunk/console/libgnt/Makefile.am trunk/console/libgnt/NEWS trunk/console/libgnt/README trunk/console/libgnt/autogen.sh trunk/console/libgnt/configure.ac trunk/console/libgnt/gnt.pc.in Removed Paths: ------------- trunk/console/libgnt/Makefile Added: trunk/console/libgnt/AUTHORS =================================================================== Property changes on: trunk/console/libgnt/AUTHORS ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Added: trunk/console/libgnt/COPYING =================================================================== --- trunk/console/libgnt/COPYING (rev 0) +++ trunk/console/libgnt/COPYING 2006-06-29 18:16:07 UTC (rev 16374) @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + 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 + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + <signature of Ty Coon>, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. Property changes on: trunk/console/libgnt/COPYING ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Added: trunk/console/libgnt/ChangeLog =================================================================== Property changes on: trunk/console/libgnt/ChangeLog ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Added: trunk/console/libgnt/INSTALL =================================================================== --- trunk/console/libgnt/INSTALL (rev 0) +++ trunk/console/libgnt/INSTALL 2006-06-29 18:16:07 UTC (rev 16374) @@ -0,0 +1,229 @@ +Copyright 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software +Foundation, Inc. + + This file is free documentation; the Free Software Foundation gives +unlimited permission to copy, distribute and modify it. + +Basic Installation +================== + + These are generic installation instructions. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, and a +file `config.log' containing compiler output (useful mainly for +debugging `configure'). + + It can also use an optional file (typically called `config.cache' +and enabled with `--cache-file=config.cache' or simply `-C') that saves +the results of its tests to speed up reconfiguring. (Caching is +disabled by default to prevent problems with accidental use of stale +cache files.) + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If you are using the cache, and at +some point `config.cache' contains results you don't want to keep, you +may remove or edit it. + + The file `configure.ac' (or `configure.in') is used to create +`configure' by a program called `autoconf'. You only need +`configure.ac' if you want to change it or regenerate `configure' using +a newer version of `autoconf'. + +The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. If you're + using `csh' on an old version of System V, you might need to type + `sh ./configure' instead to prevent `csh' from trying to execute + `configure' itself. + + Running `configure' takes awhile. While running, it prints some + messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package. + + 4. Type `make install' to install the programs and any data files and + documentation. + + 5. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. Run `./configure --help' +for details on some of the pertinent environment variables. + + You can give `configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here +is an example: + + ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix + + *Note Defining Variables::, for more details. + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you must use a version of `make' that +supports the `VPATH' variable, such as GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. + + If you have to use a `make' that does not support the `VPATH' +variable, you have to compile the package for one architecture at a +time in the source code directory. After you have installed the +package for one architecture, use `make distclean' before reconfiguring +for another architecture. + +Installation Names +================== + + By default, `make install' will install the package's files in +`/usr/local/bin', `/usr/local/man', etc. You can specify an +installation prefix other than `/usr/local' by giving `configure' the +option `--prefix=PATH'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +give `configure' the option `--exec-prefix=PATH', the package will use +PATH as the prefix for installing programs and libraries. +Documentation and other data files will still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=PATH' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + +Optional Features +================= + + Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + +Specifying the System Type +========================== + + There may be some features `configure' cannot figure out +automatically, but needs to determine by the type of machine the package +will run on. Usually, assuming the package is built to be run on the +_same_ architectures, `configure' can figure that out, but if it prints +a message saying it cannot guess the machine type, give it the +`--build=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name which has the form: + + CPU-COMPANY-SYSTEM + +where SYSTEM can have one of these forms: + + OS KERNEL-OS + + See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the machine type. + + If you are _building_ compiler tools for cross-compiling, you should +use the `--target=TYPE' option to select the type of system they will +produce code for. + + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the +"host" platform (i.e., that on which the generated programs will +eventually be run) with `--host=TYPE'. + +Sharing Defaults +================ + + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Defining Variables +================== + + Variables not defined in a site shell script can be set in the +environment passed to `configure'. However, some packages may run +configure again during the build, and the customized values of these +variables may be lost. In order to avoid this problem, you should set +them in the `configure' command line, using `VAR=value'. For example: + + ./configure CC=/usr/local2/bin/gcc + +will cause the specified gcc to be used as the C compiler (unless it is +overridden in the site shell script). + +`configure' Invocation +====================== + + `configure' recognizes the following options to control how it +operates. + +`--help' +`-h' + Print a summary of the options to `configure', and exit. + +`--version' +`-V' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`--cache-file=FILE' + Enable the cache: use and save the results of the tests in FILE, + traditionally `config.cache'. FILE defaults to `/dev/null' to + disable caching. + +`--config-cache' +`-C' + Alias for `--cache-file=config.cache'. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`configure' also accepts some other, not widely useful, options. Run +`configure --help' for more details. + Property changes on: trunk/console/libgnt/INSTALL ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Deleted: trunk/console/libgnt/Makefile =================================================================== --- trunk/console/libgnt/Makefile 2006-06-29 08:14:51 UTC (rev 16373) +++ trunk/console/libgnt/Makefile 2006-06-29 18:16:07 UTC (rev 16374) @@ -1,63 +0,0 @@ -CC=gcc -CFLAGS=`pkg-config --cflags gobject-2.0` -g -Wall -LDFLAGS=`pkg-config --libs gobject-2.0` -lncursesw -pg - -HEADERS = \ - gntwidget.h \ - gntbox.h \ - gntbutton.h \ - gntcolors.h \ - gntentry.h \ - gntlabel.h \ - gnttextview.h \ - gnttree.h \ - gntutils.h \ - gnt.h - -SOURCES = \ - gntwidget.c \ - gntbox.c \ - gntbutton.c \ - gntcolors.c \ - gntentry.c \ - gntlabel.c \ - gnttextview.c \ - gnttree.c \ - gntutils.c \ - gntmain.c - -OBJECTS = \ - gntwidget.o \ - gntbox.o \ - gntbutton.o \ - gntcolors.o \ - gntentry.o \ - gntlabel.o \ - gnttextview.o \ - gnttree.o \ - gntutils.o \ - gntmain.o - -all: libgnt - -test2: $(OBJECTS) -key: $(OBJECTS) - -gntwidget.o: gntwidget.c $(HEADERS) -gntbox.o: gntbox.c $(HEADERS) -gntbutton.o: gntbutton.c $(HEADERS) -gntcolors.o: gntcolors.c $(HEADERS) -gntentry.o: gntentry.c $(HEADERS) -gntlabel.o: gntlabel.c $(HEADERS) -gnttextview.o: gnttextview.c $(HEADERS) -gnttree.o: gnttree.c $(HEADERS) -gntutils.o: gntutils.c $(HEADERS) -gntmain.o: gntmain.c $(HEADERS) - -libgnt: $(OBJECTS) - $(CC) --shared -o libgnt.so $(OBJECTS) $(LDFLAGS) - -clean: - rm -f *.o - rm -f libgnt.so - Added: trunk/console/libgnt/Makefile.am =================================================================== --- trunk/console/libgnt/Makefile.am (rev 0) +++ trunk/console/libgnt/Makefile.am 2006-06-29 18:16:07 UTC (rev 16374) @@ -0,0 +1,43 @@ +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = gnt.pc + +lib_LTLIBRARIES = libgnt.la + +libgnt_la_SOURCES = \ + gntwidget.c \ + gntbox.c \ + gntbutton.c \ + gntcolors.c \ + gntentry.c \ + gntlabel.c \ + gnttextview.c \ + gnttree.c \ + gntutils.c \ + gntmain.c + +libgnt_la_headers = \ + gntwidget.h \ + gntbox.h \ + gntbutton.h \ + gntcolors.h \ + gntentry.h \ + gntkeys.h \ + gntlabel.h \ + gnttextview.h \ + gnttree.h \ + gntutils.h \ + gnt.h + +libgnt_laincludedir=$(includedir)/gnt +libgnt_lainclude_HEADERS = \ + $(libgnt_la_headers) + +libgnt_la_DEPENDENCIES = @LIBOBJS@ $(STATIC_LINK_LIBS) $(MS_LIBS) +libgnt_la_LDFLAGS = -export-dynamic +libgnt_la_LIBADD = \ + $(GLIB_LIBS) \ + $(STATIC_LINK_LIBS) \ + -lncursesw + +AM_CPPFLAGS = \ + $(GLIB_CFLAGS) Property changes on: trunk/console/libgnt/Makefile.am ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Added: trunk/console/libgnt/NEWS =================================================================== Property changes on: trunk/console/libgnt/NEWS ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Added: trunk/console/libgnt/README =================================================================== Property changes on: trunk/console/libgnt/README ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Added: trunk/console/libgnt/autogen.sh =================================================================== --- trunk/console/libgnt/autogen.sh (rev 0) +++ trunk/console/libgnt/autogen.sh 2006-06-29 18:16:07 UTC (rev 16374) @@ -0,0 +1,48 @@ +#!/bin/sh + +(libtoolize --version) < /dev/null > /dev/null 2>&1 || { + echo; + echo "You must have libtool installed to compile LibGNT"; + echo; + exit; +} + +(automake --version) < /dev/null > /dev/null 2>&1 || { + echo; + echo "You must have automake installed to compile LibGNT"; + echo; + exit; +} + +(autoconf --version) < /dev/null > /dev/null 2>&1 || { + echo; + echo "You must have autoconf installed to compile LibGNT"; + echo; + exit; +} + +echo "Generating configuration files for LibGNT, please wait...." +echo; + +echo "Running libtoolize, please ignore non-fatal messages...." +echo n | libtoolize --copy --force || exit; + +# Add other directories to this list if people continue to experience +# brokennesses ... Obviously the real answer is for them to fix it +# themselves, but for Luke's sake we have this. +for dir in "/usr/local/share/aclocal" \ + "/opt/gnome-1.4/share/aclocal" +do + if test -d $dir ; then + ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I $dir" + fi +done + +libtoolize -c -f --automake +aclocal $ACLOCAL_FLAGS || exit; +autoheader || exit; +automake --add-missing --copy; +autoconf || exit; +automake || exit; +./configure $@ + Property changes on: trunk/console/libgnt/autogen.sh ___________________________________________________________________ Name: svn:executable + * Name: svn:mime-type + text/plain Name: svn:eol-style + native Added: trunk/console/libgnt/configure.ac =================================================================== --- trunk/console/libgnt/configure.ac (rev 0) +++ trunk/console/libgnt/configure.ac 2006-06-29 18:16:07 UTC (rev 16374) @@ -0,0 +1,257 @@ +dnl Process this file with autoconf to produce a configure script. +AC_INIT([libgnt], [0.0.0dev], [gai...@li...]) +AC_CANONICAL_SYSTEM +AM_CONFIG_HEADER(config.h) +AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) + +AC_PREREQ([2.50]) + +AC_PATH_PROG(sedpath, sed) + +dnl Storing configure arguments +AC_DEFINE_UNQUOTED(CONFIG_ARGS, "$ac_configure_args", [configure arguments]) + +dnl Checks for programs. +AC_PROG_CC +AC_DISABLE_STATIC +AM_PROG_LIBTOOL +LIBTOOL="$LIBTOOL --silent" +AC_PROG_INSTALL + +dnl we don't use autobreak on cygwin!! +dnl AC_CYGWIN + +dnl Checks for header files. +AC_HEADER_STDC +AC_HEADER_SYS_WAIT +AC_CHECK_HEADERS(arpa/nameser_compat.h fcntl.h sys/time.h unistd.h locale.h signal.h stdint.h regex.h) + +dnl Checks for typedefs, structures, and compiler characteristics. +AC_C_CONST +AC_STRUCT_TM + +AC_C_BIGENDIAN + +dnl Checks for library functions. +AC_TYPE_SIGNAL +AC_FUNC_STRFTIME +AC_CHECK_FUNCS(strdup strstr atexit setlocale) + +dnl Check for inet_aton +AC_CHECK_FUNC(inet_aton, , [AC_CHECK_LIB(resolv, inet_aton, , + [AC_ERROR(inet_aton not found)])]) +AC_CHECK_LIB(resolv, __res_query) +AC_CHECK_LIB(nsl, gethostent) +AC_CHECK_FUNC(socket, , + [AC_CHECK_LIB(socket, socket, , [AC_ERROR([socket not found])])]) +dnl If all goes well, by this point the previous two checks will have +dnl pulled in -lsocket and -lnsl if we need them. +AC_CHECK_FUNC(getaddrinfo, [AC_DEFINE([HAVE_GETADDRINFO], [1], + [Define to 1 if you have the getaddrinfo function.])], + [AC_CHECK_LIB(socket, getaddrinfo, + [AC_DEFINE([HAVE_GETADDRINFO]) LIBS="-lsocket -lsnl $LIBS"], , , -lnsl)]) + +dnl Check for socklen_t (in Unix98) +AC_MSG_CHECKING(for socklen_t) +AC_TRY_COMPILE([ + #include <sys/types.h> + #include <sys/socket.h> + socklen_t x; +], [], +[ + AC_MSG_RESULT(yes) +], [ + AC_TRY_COMPILE([ + #include <sys/types.h> + #include <sys/socket.h> + int accept(int, struct sockaddr *, size_t *); + ], [], [ + AC_MSG_RESULT(size_t) + AC_DEFINE(socklen_t, size_t, [socklen_t size]) + ], [ + AC_MSG_RESULT(int) + AC_DEFINE(socklen_t, int, [socklen_t size]) + ]) +]) + +dnl to prevent the g_stat()/g_unlink() crash, +dnl (09:50:07) Robot101: LSchiere2: it's easy. +LC_SYS_LARGEFILE somewhere in configure.ac +AC_SYS_LARGEFILE + +dnl FreeBSD doesn't have libdl, dlopen is provided by libc +AC_CHECK_FUNC(dlopen, LIBDL="", [AC_CHECK_LIB(dl, dlopen, LIBDL="-ldl")]) + +AC_MSG_CHECKING(for the %z format string in strftime()) +AC_TRY_RUN([ +#ifdef HAVE_SYS_TIME_H +#include <sys/time.h> +#endif +#include <time.h> +#include <stdio.h> + +int main() +{ + char buf[6]; + time_t t = time(NULL); + + if (strftime(buf, sizeof(buf), "%z", localtime(&t)) != 5) + return 1; + + fprintf(stderr, "strftime(\"%%z\") yields: \"%s\"\n", buf); + + return !((buf[0] == '-' || buf[0] == '+') && + (buf[1] >= '0' && buf[1] <= '9') && + (buf[2] >= '0' && buf[2] <= '9') && + (buf[3] >= '0' && buf[3] <= '9') && + (buf[4] >= '0' && buf[4] <= '9') + ); +} +], +[ + AC_MSG_RESULT(yes) + AC_DEFINE([HAVE_STRFTIME_Z_FORMAT], [1], + [Define to 1 if you have a strftime() that supports the %z format string.]) +], +[ + AC_MSG_RESULT(no) +], +[ + # Fallback for Cross Compiling... + # This will enable the compatibility code. + AC_MSG_RESULT(no) +] +) + + +AC_CHECK_HEADER(sys/utsname.h) +AC_CHECK_FUNC(uname) + +if test "x$enable_debug" = "xyes" ; then + AC_DEFINE(DEBUG, 1, [Define if debugging is enabled.]) + enable_fatal_asserts="yes" +fi + +if test "x$enable_fatal_asserts" = "xyes" ; then + AC_DEFINE(GAIM_FATAL_ASSERTS, 1, [Define to make assertions fatal (useful for debugging).]) +fi + +if test "x$enable_deprecated" = "xno"; then + DEBUG_CFLAGS="$DEBUG_CFLAGS -DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED" +fi + +if test "x$GCC" = "xyes"; then + dnl We enable -Wall later. + dnl If it's set after the warning CFLAGS in the compiler invocation, it counteracts the -Wno... flags. + dnl This leads to warnings we don't want. + CFLAGS=`echo $CFLAGS |$sedpath 's/-Wall//'` + + dnl ENABLE WARNINGS SUPPORTED BY THE VERSION OF GCC IN USE + dnl + dnl Future Possibilities + dnl + dnl Consider adding -Wbad-function-cast. + dnl This leads to spurious warnings using GPOINTER_TO_INT(), et al. directly on a function call. + dnl We'd need an intermediate variable. + dnl + dnl Consider adding -Wfloat-equal. + dnl This leads to warnings with Perl. + dnl Perhaps we could write ugly configure magic and pass -Wno-float-equal down to that subdirectory. + dnl On the other hand, it's probably actually broken, so maybe the Perl folks should fix that? + dnl + dnl Consider removing -Wno-sign-compare (from the -Wextra set) and fixing all those cases. + dnl This is likely non-trivial. + dnl + for newflag in \ + "-Waggregate-return" \ + "-Wcast-align" \ + "-Wdeclaration-after-statement" \ + "-Werror-implicit-function-declaration" \ + "-Wextra -Wno-sign-compare -Wno-unused-parameter" \ + "-Winit-self" \ + "-Wmissing-declarations" \ + "-Wmissing-prototypes" \ + "-Wnested-externs" \ + "-Wpointer-arith" \ + "-Wundef" \ + ; do + orig_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $newflag" + AC_MSG_CHECKING(for $newflag option to gcc) + AC_TRY_COMPILE([], [ + int main() {return 0;} + ], [ + AC_MSG_RESULT(yes) + CFLAGS="$orig_CFLAGS" + DEBUG_CFLAGS="$DEBUG_CFLAGS $newflag" + ], [ + AC_MSG_RESULT(no) + CFLAGS="$orig_CFLAGS" + ]) + done + + if test "x$enable_fortify" = "xyes"; then + AC_MSG_CHECKING(for FORTIFY_SOURCE support) + AC_TRY_COMPILE([#include <features.h>], [ + int main() { + #if !(__GNUC_PREREQ (4, 1) \ + || (defined __GNUC_RH_RELEASE__ && __GNUC_PREREQ (4, 0)) \ + || (defined __GNUC_RH_RELEASE__ && __GNUC_PREREQ (3, 4) \ + && __GNUC_MINOR__ == 4 \ + && (__GNUC_PATCHLEVEL__ > 2 \ + || (__GNUC_PATCHLEVEL__ == 2 && __GNUC_RH_RELEASE__ >= 8)))) + #error No FORTIFY_SOURCE support + #endif + return 0; + } + ], [ + AC_MSG_RESULT(yes) + DEBUG_CFLAGS="$DEBUG_CFLAGS -D_FORTIFY_SOURCE=2" + ], [ + AC_MSG_RESULT(no) + ]) + fi + + DEBUG_CFLAGS="-Wall $DEBUG_CFLAGS" + CFLAGS="-g $CFLAGS" +fi +AC_SUBST(CFLAGS) + +PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.0.0 gobject-2.0 gmodule-2.0], + [ + AC_SUBST(GLIB_CFLAGS) + AC_SUBST(GLIB_LIBS) + ], + [ + AC_MSG_ERROR([ +*** GLib 2.0 is required to build Gaim; please make sure you have the GLib +*** development headers installed. The latest version of GLib is +*** always available at http://www.gtk.org/.]) + ]) + + +PKG_CHECK_MODULES(GAIM, [gaim], + [ + AC_SUBST(GAIM_CFLAGS) + AC_SUBST(GAIM_LIBS) + ], + [ + AC_MSG_ERROR([ +*** Need to have libgaim dude.]) + ]) + + +AC_MSG_CHECKING(for me pot o' gold) +AC_MSG_RESULT(no) +AC_CHECK_FUNCS(gethostid lrand48) +AC_CHECK_FUNCS(memcpy memmove random strchr strerror vprintf) +AC_CHECK_HEADERS(malloc.h paths.h sgtty.h stdarg.h sys/cdefs.h) +AC_CHECK_HEADERS(sys/file.h sys/filio.h sys/ioctl.h sys/msgbuf.h) +AC_CHECK_HEADERS(sys/select.h sys/uio.h sys/utsname.h sys/wait.h) +AC_CHECK_HEADERS(termios.h) +#AC_VAR_TIMEZONE_EXTERNALS + + +AC_OUTPUT([Makefile + gnt.pc + ]) + Property changes on: trunk/console/libgnt/configure.ac ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Added: trunk/console/libgnt/gnt.pc.in =================================================================== --- trunk/console/libgnt/gnt.pc.in (rev 0) +++ trunk/console/libgnt/gnt.pc.in 2006-06-29 18:16:07 UTC (rev 16374) @@ -0,0 +1,13 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ +datadir=@datadir@ +sysconfdir=@sysconfdir@ + +Name: LibGNT +Description: Gaim Ncurses Toolkit is a collection of curses-widgets. +Version: @VERSION@ +Requires: glib-2.0 +Cflags: -I${includedir}/gnt +Libs: -L${libdir} -lgnt -lncursesw Property changes on: trunk/console/libgnt/gnt.pc.in ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-06-29 08:14:59
|
Revision: 16373 Author: thekingant Date: 2006-06-29 01:14:51 -0700 (Thu, 29 Jun 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16373&view=rev Log Message: ----------- Backport SVN revision #16372 from HEAD to v2_0_0 Original commit message: Some comments changes, and: 1. Don't buddy icons in Jabber 2. When clearing your buddy icon in oscar, do it the same way that WinAIM does it ViewCVS Links: ------------- http://svn.sourceforge.net/gaim/?rev=16372&view=rev Modified Paths: -------------- branches/v2_0_0/src/blist.h branches/v2_0_0/src/protocols/jabber/presence.c branches/v2_0_0/src/protocols/oscar/family_feedbag.c branches/v2_0_0/src/protocols/oscar/family_oservice.c branches/v2_0_0/src/protocols/oscar/oscar.h Modified: branches/v2_0_0/src/blist.h =================================================================== --- branches/v2_0_0/src/blist.h 2006-06-29 08:14:29 UTC (rev 16372) +++ branches/v2_0_0/src/blist.h 2006-06-29 08:14:51 UTC (rev 16373) @@ -288,6 +288,7 @@ /** * Sets the server-sent alias of a buddy in the buddy list. + * PRPLs should call serv_got_alias() instead of this. * * @param buddy The buddy whose alias will be changed. * @param alias The buddy's "official" alias. Modified: branches/v2_0_0/src/protocols/jabber/presence.c =================================================================== --- branches/v2_0_0/src/protocols/jabber/presence.c 2006-06-29 08:14:29 UTC (rev 16372) +++ branches/v2_0_0/src/protocols/jabber/presence.c 2006-06-29 08:14:51 UTC (rev 16373) @@ -256,13 +256,14 @@ char hash[41], *p; int i; - gaim_cipher_digest_region("sha1", (guchar *)data, size, + gaim_cipher_digest_region("sha1", data, size, sizeof(hashval), hashval, NULL); p = hash; for(i=0; i<20; i++, p+=2) snprintf(p, 3, "%02x", hashval[i]); gaim_blist_node_set_string((GaimBlistNode*)b, "avatar_hash", hash); } + g_free(data); g_free(text); } } Modified: branches/v2_0_0/src/protocols/oscar/family_feedbag.c =================================================================== --- branches/v2_0_0/src/protocols/oscar/family_feedbag.c 2006-06-29 08:14:29 UTC (rev 16372) +++ branches/v2_0_0/src/protocols/oscar/family_feedbag.c 2006-06-29 08:14:51 UTC (rev 16373) @@ -1089,7 +1089,7 @@ * @param iconcsumlen Length of the MD5 checksum given above. Should be 0x10 bytes. * @return Return 0 if no errors, otherwise return the error number. */ -int aim_ssi_seticon(OscarData *od, guint8 *iconsum, guint16 iconsumlen) +int aim_ssi_seticon(OscarData *od, const guint8 *iconsum, guint16 iconsumlen) { struct aim_ssi_item *tmp; guint8 *csumdata; @@ -1099,13 +1099,12 @@ /* Find the ICONINFO item, or add it if it does not exist */ if (!(tmp = aim_ssi_itemlist_finditem(od->ssi.local, NULL, "1", AIM_SSI_TYPE_ICONINFO))) { - tmp = aim_ssi_itemlist_add(&od->ssi.local, "1", 0x0000, 0x51F4, AIM_SSI_TYPE_ICONINFO, NULL); + tmp = aim_ssi_itemlist_add(&od->ssi.local, "1", 0x0000, 0xFFFF, AIM_SSI_TYPE_ICONINFO, NULL); } /* Need to add the 0x00d5 TLV to the TLV chain */ csumdata = (guint8 *)malloc((iconsumlen+2)*sizeof(guint8)); - csumdata[0] = 0x00; - csumdata[1] = 0x10; + aimutil_put16(&csumdata[0], iconsumlen); memcpy(&csumdata[2], iconsum, iconsumlen); aim_tlvlist_replace_raw(&tmp->data, 0x00d5, (iconsumlen+2) * sizeof(guint8), csumdata); free(csumdata); @@ -1122,23 +1121,17 @@ * Remove a reference to a server stored buddy icon. This will make your * icon stop showing up to other people. * - * @param od The oscar odion. + * Really this function just sets the icon to a dummy value. It's weird... + * but I think the dummy value basically means "I don't have an icon!" + * + * @param od The oscar session. * @return Return 0 if no errors, otherwise return the error number. */ int aim_ssi_delicon(OscarData *od) { - struct aim_ssi_item *tmp; + const guint8 csumdata[] = {0x02, 0x01, 0xd2, 0x04, 0x72}; - if (!od) - return -EINVAL; - - /* Find the ICONINFO item and delete it if it exists*/ - if ((tmp = aim_ssi_itemlist_finditem(od->ssi.local, NULL, "1", AIM_SSI_TYPE_ICONINFO))) - aim_ssi_itemlist_del(&od->ssi.local, tmp); - - /* Sync our local list with the server list */ - aim_ssi_sync(od); - return 0; + return aim_ssi_seticon(od, csumdata, 5); } /** Modified: branches/v2_0_0/src/protocols/oscar/family_oservice.c =================================================================== --- branches/v2_0_0/src/protocols/oscar/family_oservice.c 2006-06-29 08:14:29 UTC (rev 16372) +++ branches/v2_0_0/src/protocols/oscar/family_oservice.c 2006-06-29 08:14:51 UTC (rev 16373) @@ -1064,6 +1064,11 @@ flags = byte_stream_get8(bs); length = byte_stream_get8(bs); + /* + * A flag of 0x01 could mean "this is the checksum we have for you" + * A flag of 0x40 could mean "I don't have your icon, upload it" + */ + if ((userfunc = aim_callhandler(od, snac->family, snac->subtype))) { switch (type) { case 0x0000: Modified: branches/v2_0_0/src/protocols/oscar/oscar.h =================================================================== --- branches/v2_0_0/src/protocols/oscar/oscar.h 2006-06-29 08:14:29 UTC (rev 16372) +++ branches/v2_0_0/src/protocols/oscar/oscar.h 2006-06-29 08:14:51 UTC (rev 16373) @@ -1161,7 +1161,7 @@ int aim_ssi_deletelist(OscarData *od); int aim_ssi_setpermdeny(OscarData *od, guint8 permdeny, guint32 vismask); int aim_ssi_setpresence(OscarData *od, guint32 presence); -int aim_ssi_seticon(OscarData *od, guint8 *iconsum, guint16 iconsumlen); +int aim_ssi_seticon(OscarData *od, const guint8 *iconsum, guint16 iconsumlen); int aim_ssi_delicon(OscarData *od); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-06-29 08:14:32
|
Revision: 16372 Author: thekingant Date: 2006-06-29 01:14:29 -0700 (Thu, 29 Jun 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16372&view=rev Log Message: ----------- Some comments changes, and: 1. Don't buddy icons in Jabber 2. When clearing your buddy icon in oscar, do it the same way that WinAIM does it Modified Paths: -------------- trunk/src/blist.h trunk/src/protocols/jabber/presence.c trunk/src/protocols/oscar/family_feedbag.c trunk/src/protocols/oscar/family_oservice.c trunk/src/protocols/oscar/oscar.h Modified: trunk/src/blist.h =================================================================== --- trunk/src/blist.h 2006-06-28 22:03:16 UTC (rev 16371) +++ trunk/src/blist.h 2006-06-29 08:14:29 UTC (rev 16372) @@ -286,6 +286,7 @@ /** * Sets the server-sent alias of a buddy in the buddy list. + * PRPLs should call serv_got_alias() instead of this. * * @param buddy The buddy whose alias will be changed. * @param alias The buddy's "official" alias. Modified: trunk/src/protocols/jabber/presence.c =================================================================== --- trunk/src/protocols/jabber/presence.c 2006-06-28 22:03:16 UTC (rev 16371) +++ trunk/src/protocols/jabber/presence.c 2006-06-29 08:14:29 UTC (rev 16372) @@ -256,13 +256,14 @@ char hash[41], *p; int i; - gaim_cipher_digest_region("sha1", (guchar *)data, size, + gaim_cipher_digest_region("sha1", data, size, sizeof(hashval), hashval, NULL); p = hash; for(i=0; i<20; i++, p+=2) snprintf(p, 3, "%02x", hashval[i]); gaim_blist_node_set_string((GaimBlistNode*)b, "avatar_hash", hash); } + g_free(data); g_free(text); } } Modified: trunk/src/protocols/oscar/family_feedbag.c =================================================================== --- trunk/src/protocols/oscar/family_feedbag.c 2006-06-28 22:03:16 UTC (rev 16371) +++ trunk/src/protocols/oscar/family_feedbag.c 2006-06-29 08:14:29 UTC (rev 16372) @@ -1089,7 +1089,7 @@ * @param iconcsumlen Length of the MD5 checksum given above. Should be 0x10 bytes. * @return Return 0 if no errors, otherwise return the error number. */ -int aim_ssi_seticon(OscarData *od, guint8 *iconsum, guint16 iconsumlen) +int aim_ssi_seticon(OscarData *od, const guint8 *iconsum, guint16 iconsumlen) { struct aim_ssi_item *tmp; guint8 *csumdata; @@ -1099,13 +1099,12 @@ /* Find the ICONINFO item, or add it if it does not exist */ if (!(tmp = aim_ssi_itemlist_finditem(od->ssi.local, NULL, "1", AIM_SSI_TYPE_ICONINFO))) { - tmp = aim_ssi_itemlist_add(&od->ssi.local, "1", 0x0000, 0x51F4, AIM_SSI_TYPE_ICONINFO, NULL); + tmp = aim_ssi_itemlist_add(&od->ssi.local, "1", 0x0000, 0xFFFF, AIM_SSI_TYPE_ICONINFO, NULL); } /* Need to add the 0x00d5 TLV to the TLV chain */ csumdata = (guint8 *)malloc((iconsumlen+2)*sizeof(guint8)); - csumdata[0] = 0x00; - csumdata[1] = 0x10; + aimutil_put16(&csumdata[0], iconsumlen); memcpy(&csumdata[2], iconsum, iconsumlen); aim_tlvlist_replace_raw(&tmp->data, 0x00d5, (iconsumlen+2) * sizeof(guint8), csumdata); free(csumdata); @@ -1122,23 +1121,17 @@ * Remove a reference to a server stored buddy icon. This will make your * icon stop showing up to other people. * - * @param od The oscar odion. + * Really this function just sets the icon to a dummy value. It's weird... + * but I think the dummy value basically means "I don't have an icon!" + * + * @param od The oscar session. * @return Return 0 if no errors, otherwise return the error number. */ int aim_ssi_delicon(OscarData *od) { - struct aim_ssi_item *tmp; + const guint8 csumdata[] = {0x02, 0x01, 0xd2, 0x04, 0x72}; - if (!od) - return -EINVAL; - - /* Find the ICONINFO item and delete it if it exists*/ - if ((tmp = aim_ssi_itemlist_finditem(od->ssi.local, NULL, "1", AIM_SSI_TYPE_ICONINFO))) - aim_ssi_itemlist_del(&od->ssi.local, tmp); - - /* Sync our local list with the server list */ - aim_ssi_sync(od); - return 0; + return aim_ssi_seticon(od, csumdata, 5); } /** Modified: trunk/src/protocols/oscar/family_oservice.c =================================================================== --- trunk/src/protocols/oscar/family_oservice.c 2006-06-28 22:03:16 UTC (rev 16371) +++ trunk/src/protocols/oscar/family_oservice.c 2006-06-29 08:14:29 UTC (rev 16372) @@ -1064,6 +1064,11 @@ flags = byte_stream_get8(bs); length = byte_stream_get8(bs); + /* + * A flag of 0x01 could mean "this is the checksum we have for you" + * A flag of 0x40 could mean "I don't have your icon, upload it" + */ + if ((userfunc = aim_callhandler(od, snac->family, snac->subtype))) { switch (type) { case 0x0000: Modified: trunk/src/protocols/oscar/oscar.h =================================================================== --- trunk/src/protocols/oscar/oscar.h 2006-06-28 22:03:16 UTC (rev 16371) +++ trunk/src/protocols/oscar/oscar.h 2006-06-29 08:14:29 UTC (rev 16372) @@ -1161,7 +1161,7 @@ int aim_ssi_deletelist(OscarData *od); int aim_ssi_setpermdeny(OscarData *od, guint8 permdeny, guint32 vismask); int aim_ssi_setpresence(OscarData *od, guint32 presence); -int aim_ssi_seticon(OscarData *od, guint8 *iconsum, guint16 iconsumlen); +int aim_ssi_seticon(OscarData *od, const guint8 *iconsum, guint16 iconsumlen); int aim_ssi_delicon(OscarData *od); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aar...@us...> - 2006-06-28 22:03:27
|
Revision: 16371 Author: aaronsheldon Date: 2006-06-28 15:03:16 -0700 (Wed, 28 Jun 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16371&view=rev Log Message: ----------- Creating a new branch for chat Added Paths: ----------- branches/soc-2006-chat-speed/ Copied: branches/soc-2006-chat-speed (from rev 16370, trunk) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aar...@us...> - 2006-06-28 19:42:26
|
Revision: 16370 Author: aaronsheldon Date: 2006-06-28 12:42:20 -0700 (Wed, 28 Jun 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16370&view=rev Log Message: ----------- Merging r16220 through 16367 from blist-efficiency branch into trunk. Modified Paths: -------------- trunk/src/blist.c trunk/src/gtkblist.c Modified: trunk/src/blist.c =================================================================== --- trunk/src/blist.c 2006-06-28 19:12:38 UTC (rev 16369) +++ trunk/src/blist.c 2006-06-28 19:42:20 UTC (rev 16370) @@ -732,13 +732,15 @@ GaimBlistNode *gaim_blist_node_next(GaimBlistNode *node, gboolean offline) { GaimBlistNode *ret = node; - + + if (offline) + return get_next_node(ret, TRUE); do { ret = get_next_node(ret, TRUE); - } while (ret && !offline && GAIM_BLIST_NODE_IS_BUDDY(ret) && + } while (ret && GAIM_BLIST_NODE_IS_BUDDY(ret) && !gaim_account_is_connected(gaim_buddy_get_account((GaimBuddy *)ret))); - + return ret; } Modified: trunk/src/gtkblist.c =================================================================== --- trunk/src/gtkblist.c 2006-06-28 19:12:38 UTC (rev 16369) +++ trunk/src/gtkblist.c 2006-06-28 19:42:20 UTC (rev 16370) @@ -118,9 +118,11 @@ #endif static GaimGtkBuddyList *gtkblist = NULL; +static gboolean gaim_gtk_blist_refresh_timer(GaimBuddyList *list); static void gaim_gtk_blist_update_buddy(GaimBuddyList *list, GaimBlistNode *node); static void gaim_gtk_blist_selection_changed(GtkTreeSelection *selection, gpointer data); static void gaim_gtk_blist_update(GaimBuddyList *list, GaimBlistNode *node); +static void gaim_gtk_blist_update_contact(GaimBuddyList *list, GaimBlistNode *node); static char *gaim_get_tooltip_text(GaimBlistNode *node, gboolean full); static const char *item_factory_translate_func (const char *path, gpointer func_data); static gboolean get_iter_from_node(GaimBlistNode *node, GtkTreeIter *iter); @@ -159,8 +161,10 @@ { if (event->state == GDK_VISIBILITY_FULLY_OBSCURED) gtk_blist_obscured = TRUE; - else - gtk_blist_obscured = FALSE; + else if (gtk_blist_obscured) { + gtk_blist_obscured = FALSE; + gaim_gtk_blist_refresh_timer(gaim_get_blist()); + } /* continue to handle event normally */ return FALSE; @@ -171,8 +175,10 @@ if(event->changed_mask & GDK_WINDOW_STATE_WITHDRAWN) { if(event->new_window_state & GDK_WINDOW_STATE_WITHDRAWN) gaim_prefs_set_bool("/gaim/gtk/blist/list_visible", FALSE); - else + else { gaim_prefs_set_bool("/gaim/gtk/blist/list_visible", TRUE); + gaim_gtk_blist_refresh_timer(gaim_get_blist()); + } } if(event->changed_mask & GDK_WINDOW_STATE_MAXIMIZED) { @@ -181,7 +187,13 @@ else gaim_prefs_set_bool("/gaim/gtk/blist/list_maximized", FALSE); } - + + /* Refresh gtkblist if un-iconifying */ + if (event->changed_mask & GDK_WINDOW_STATE_ICONIFIED){ + if (!(event->new_window_state & GDK_WINDOW_STATE_ICONIFIED)) + gaim_gtk_blist_refresh_timer(gaim_get_blist()); + } + return FALSE; } @@ -877,8 +889,7 @@ gtk_main_iteration(); gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW(gtkblist->treeview), path, NULL, FALSE, 0, 0); - - gaim_gtk_blist_update(NULL, node); + gaim_gtk_blist_update_contact(NULL, node->child); gtk_tree_path_free(path); } @@ -2869,7 +2880,7 @@ struct _gaim_gtk_blist_node *gtkcontactnode = NULL; char *idletime = NULL, *statustext = NULL; time_t t; - /* XXX Clean up this crap */ + /* XXX Good luck cleaning up this crap */ contact = (GaimContact*)((GaimBlistNode*)b)->parent; if(contact) @@ -2881,11 +2892,6 @@ name = gaim_buddy_get_alias(b); esc = g_markup_escape_text(name, strlen(name)); - prpl = gaim_find_prpl(gaim_account_get_protocol_id(b->account)); - - if (prpl != NULL) - prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(prpl); - presence = gaim_buddy_get_presence(b); if (!gaim_prefs_get_bool("/gaim/gtk/blist/show_buddy_icons")) @@ -2901,6 +2907,11 @@ return esc; } + prpl = gaim_find_prpl(gaim_account_get_protocol_id(b->account)); + + if (prpl != NULL) + prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(prpl); + if (prpl_info && prpl_info->status_text && b->account->gc) { char *tmp = prpl_info->status_text(b); const char *end; @@ -2951,67 +2962,69 @@ #endif } - if (gaim_prefs_get_bool("/gaim/gtk/blist/show_idle_time") && - gaim_presence_is_idle(presence)) - { - time_t idle_secs = gaim_presence_get_idle_time(presence); + if(!gaim_presence_is_online(presence) && !statustext) + statustext = g_strdup(_("Offline")); + else if (!statustext) + text = g_strdup(esc); + + if (gaim_presence_is_idle(presence)) { + if (gaim_prefs_get_bool("/gaim/gtk/blist/show_idle_time")) { + time_t idle_secs = gaim_presence_get_idle_time(presence); - if (idle_secs > 0) { - int ihrs, imin; + if (idle_secs > 0) { + int ihrs, imin; - time(&t); - ihrs = (t - idle_secs) / 3600; - imin = ((t - idle_secs) / 60) % 60; + time(&t); + ihrs = (t - idle_secs) / 3600; + imin = ((t - idle_secs) / 60) % 60; - if (ihrs) - idletime = g_strdup_printf(_("Idle %dh %02dm"), ihrs, imin); + if (ihrs) + idletime = g_strdup_printf(_("Idle %dh %02dm"), ihrs, imin); + else + idletime = g_strdup_printf(_("Idle %dm"), imin); + } else - idletime = g_strdup_printf(_("Idle %dm"), imin); + idletime = g_strdup(_("Idle")); + + if (!selected) + text = g_strdup_printf("<span color='%s'>%s</span>\n" + "<span color='%s' size='smaller'>%s%s%s</span>", + dim_grey(), esc, dim_grey(), + idletime != NULL ? idletime : "", + (idletime != NULL && statustext != NULL) ? " - " : "", + statustext != NULL ? statustext : ""); } - else - idletime = g_strdup(_("Idle")); + else if (!selected && !statustext) /* We handle selected text later */ + text = g_strdup_printf("<span color='%s'>%s</span>", dim_grey(), esc); + else if (!selected && !text) + text = g_strdup_printf("<span color='%s'>%s</span>\n" + "<span color='%s' size='smaller'>%s%s%s</span>", + dim_grey(), esc, dim_grey(), + idletime != NULL ? idletime : "", + (idletime != NULL && statustext != NULL) ? " - " : "", + statustext != NULL ? statustext : ""); } - if(!gaim_presence_is_online(presence) && !statustext) - statustext = g_strdup(_("Offline")); - - if (statustext == NULL && idletime == NULL) + /* Not idle and not selected */ + else if (!selected && !text) { - if (!selected && gaim_presence_is_idle(presence)) - text = g_strdup_printf("<span color='%s'>%s</span>", dim_grey(), esc); - else - text = g_strdup(esc); + text = g_strdup_printf("%s\n" + "<span color='%s' size='smaller'>%s%s%s</span>", + esc, dim_grey(), + idletime != NULL ? idletime : "", + (idletime != NULL && statustext != NULL) ? " - " : "", + statustext != NULL ? statustext : ""); } - else if (!selected) - { - if (gaim_presence_is_idle(presence)) - { - text = g_strdup_printf("<span color='%s'>%s</span>\n" - "<span color='%s' size='smaller'>%s%s%s</span>", - dim_grey(), esc, dim_grey(), - idletime != NULL ? idletime : "", - (idletime != NULL && statustext != NULL) ? " - " : "", - statustext != NULL ? statustext : ""); - } - else - { - text = g_strdup_printf("%s\n" - "<span color='%s' size='smaller'>%s%s%s</span>", - esc, dim_grey(), - idletime != NULL ? idletime : "", - (idletime != NULL && statustext != NULL) ? " - " : "", - statustext != NULL ? statustext : ""); - } - } - else + + /* It is selected. */ + if ((selected && !text) || (selected && idletime)) text = g_strdup_printf("%s\n" - "<span size='smaller'>%s%s%s</span>", - esc, - idletime != NULL ? idletime : "", - (idletime != NULL && statustext != NULL) ? " - " : "", - statustext != NULL ? statustext : ""); + "<span size='smaller'>%s%s%s</span>", + esc, + idletime != NULL ? idletime : "", + (idletime != NULL && statustext != NULL) ? " - " : "", + statustext != NULL ? statustext : ""); - g_free(idletime); g_free(statustext); g_free(esc); @@ -3057,6 +3070,9 @@ { GaimBlistNode *gnode, *cnode; + if (gtk_blist_obscured || !GTK_WIDGET_VISIBLE(gtkblist->window)) + return TRUE; + for(gnode = list->root; gnode; gnode = gnode->next) { if(!GAIM_BLIST_NODE_IS_GROUP(gnode)) continue; @@ -3068,7 +3084,7 @@ if (buddy && gaim_presence_is_idle(gaim_buddy_get_presence(buddy))) - gaim_gtk_blist_update(list, cnode); + gaim_gtk_blist_update_contact(list, (GaimBlistNode*)buddy); } } } @@ -3908,7 +3924,7 @@ while (node) { - if (!GAIM_BLIST_NODE_IS_GROUP(node) && remove) + if (remove && !GAIM_BLIST_NODE_IS_GROUP(node)) gaim_gtk_blist_hide_node(list, node); gaim_gtk_blist_update(list, node); @@ -4081,16 +4097,26 @@ return TRUE; } +/*This version of gaim_gtk_blist_update_group can take the original buddy +or a group, but has much better algorithmic performance with a pre-known buddy*/ static void gaim_gtk_blist_update_group(GaimBuddyList *list, GaimBlistNode *node) { GaimGroup *group; int count; gboolean show = FALSE; + GaimBlistNode* gnode; - g_return_if_fail(GAIM_BLIST_NODE_IS_GROUP(node)); - group = (GaimGroup*)node; + if (GAIM_BLIST_NODE_IS_GROUP(node)) + gnode = node; + else if (GAIM_BLIST_NODE_IS_BUDDY(node)) /* maybe OR'ed with IS_CHAT? */ + gnode = node->parent->parent; + else if (GAIM_BLIST_NODE_IS_CONTACT(node)) + gnode = node->parent; + g_return_if_fail(GAIM_BLIST_NODE_IS_GROUP(gnode)); + group = (GaimGroup*)gnode; + if(gaim_prefs_get_bool("/gaim/gtk/blist/show_offline_buddies")) count = gaim_blist_get_group_size(group, FALSE); else @@ -4098,25 +4124,15 @@ if (count > 0 || gaim_prefs_get_bool("/gaim/gtk/blist/show_empty_groups")) show = TRUE; - else { - GaimBlistNode *n; - n = node->child; - while (n && !GAIM_BLIST_NODE_IS_GROUP(n)) { - if (GAIM_BLIST_NODE_IS_BUDDY(n)) { - if (buddy_is_displayable((GaimBuddy*)n)) { - show = TRUE; - break; - } - } - n = gaim_blist_node_next(n, FALSE); - } - } + else if (GAIM_BLIST_NODE_IS_BUDDY(node)){ /* Or chat? */ + if (buddy_is_displayable((GaimBuddy*)node)) + show = TRUE;} if (show) { char *mark, *esc; GtkTreeIter iter; - if(!insert_node(list, node, &iter)) + if(!insert_node(list, gnode, &iter)) return; esc = g_markup_escape_text(group->name, -1); @@ -4129,11 +4145,11 @@ STATUS_ICON_COLUMN, NULL, STATUS_ICON_VISIBLE_COLUMN, FALSE, NAME_COLUMN, mark, - NODE_COLUMN, node, + NODE_COLUMN, gnode, -1); g_free(mark); } else { - gaim_gtk_blist_hide_node(list, node); + gaim_gtk_blist_hide_node(list, gnode); } } @@ -4155,7 +4171,8 @@ mark = gaim_gtk_blist_get_name_markup(buddy, selected); if (gaim_prefs_get_bool("/gaim/gtk/blist/show_idle_time") && - gaim_presence_is_idle(presence)) + gaim_presence_is_idle(presence) && + !gaim_prefs_get_bool("/gaim/gtk/blist/show_buddy_icons")) { time_t idle_secs = gaim_presence_get_idle_time(presence); @@ -4166,7 +4183,6 @@ time(&t); ihrs = (t - idle_secs) / 3600; imin = ((t - idle_secs) / 60) % 60; - idle = g_strdup_printf("%d:%02d", ihrs, imin); } } @@ -4197,35 +4213,45 @@ g_object_unref(avatar); } - +/* This is a variation on the original gtk_blist_update_contact. Here we + can know in advance which buddy has changed so we can just update that */ static void gaim_gtk_blist_update_contact(GaimBuddyList *list, GaimBlistNode *node) { + GaimBlistNode *cnode; GaimContact *contact; GaimBuddy *buddy; struct _gaim_gtk_blist_node *gtknode; - g_return_if_fail(GAIM_BLIST_NODE_IS_CONTACT(node)); + if (GAIM_BLIST_NODE_IS_BUDDY(node)) + cnode = node->parent; + else + cnode = node; + + g_return_if_fail(GAIM_BLIST_NODE_IS_CONTACT(cnode)); /* First things first, update the group */ - gaim_gtk_blist_update_group(list, node->parent); + if (GAIM_BLIST_NODE_IS_BUDDY(node)) + gaim_gtk_blist_update_group(list, node); + else + gaim_gtk_blist_update_group(list, cnode->parent); - contact = (GaimContact*)node; + contact = (GaimContact*)cnode; buddy = gaim_contact_get_priority_buddy(contact); - + if (buddy_is_displayable(buddy)) { GtkTreeIter iter; - if(!insert_node(list, node, &iter)) + if(!insert_node(list, cnode, &iter)) return; - gtknode = (struct _gaim_gtk_blist_node *)node->ui_data; + gtknode = (struct _gaim_gtk_blist_node *)cnode->ui_data; if(gtknode->contact_expanded) { GdkPixbuf *status; char *mark; - status = gaim_gtk_blist_get_status_icon(node, + status = gaim_gtk_blist_get_status_icon(cnode, (gaim_prefs_get_bool("/gaim/gtk/blist/show_buddy_icons") ? GAIM_STATUS_ICON_LARGE : GAIM_STATUS_ICON_SMALL)); @@ -4242,29 +4268,29 @@ if(status) g_object_unref(status); } else { - buddy_node(buddy, &iter, node); + buddy_node(buddy, &iter, cnode); } } else { - gaim_gtk_blist_hide_node(list, node); + gaim_gtk_blist_hide_node(list, cnode); } } + + static void gaim_gtk_blist_update_buddy(GaimBuddyList *list, GaimBlistNode *node) { - GaimContact *contact; GaimBuddy *buddy; struct _gaim_gtk_blist_node *gtkparentnode; g_return_if_fail(GAIM_BLIST_NODE_IS_BUDDY(node)); + if (node->parent == NULL) + return; + buddy = (GaimBuddy*)node; - contact = (GaimContact*)node->parent; - - if (contact == NULL) - return; - + /* First things first, update the contact */ - gaim_gtk_blist_update_contact(list, node->parent); + gaim_gtk_blist_update_contact(list, node); gtkparentnode = (struct _gaim_gtk_blist_node *)node->parent->ui_data; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-06-28 19:25:40
|
Revision: 16368 Author: sadrul Date: 2006-06-28 11:50:33 -0700 (Wed, 28 Jun 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16368&view=rev Log Message: ----------- Minor tweaks to Makefile and some other things. Modified Paths: -------------- trunk/console/Makefile trunk/console/gntconv.c trunk/console/gntui.c trunk/console/libgnt/Makefile trunk/console/libgnt/test/Makefile Modified: trunk/console/Makefile =================================================================== --- trunk/console/Makefile 2006-06-28 17:28:06 UTC (rev 16367) +++ trunk/console/Makefile 2006-06-28 18:50:33 UTC (rev 16368) @@ -1,4 +1,5 @@ -CFLAGS=`pkg-config --cflags gaim gobject-2.0` -g -I./libgnt/ +CC=gcc +CFLAGS=`pkg-config --cflags gaim gobject-2.0` -g -I./libgnt/ -Wall LDFLAGS=`pkg-config --libs gaim gobject-2.0 libxml-2.0` -lncursesw -L./libgnt/ -lgnt -pg GG_SOURCES = \ Modified: trunk/console/gntconv.c =================================================================== --- trunk/console/gntconv.c 2006-06-28 17:28:06 UTC (rev 16367) +++ trunk/console/gntconv.c 2006-06-28 18:50:33 UTC (rev 16368) @@ -180,27 +180,31 @@ { GGConv *ggconv = g_hash_table_lookup(ggconvs, conv); char *strip; - char *name; g_return_if_fail(ggconv != NULL); strip = gaim_markup_strip_html(message); - if (alias && *alias) - name = g_strdup_printf("%s: ", alias); - else if (who && *who) - name = g_strdup_printf("%s: ", who); - else - name = g_strdup(""); + if (flags & (GAIM_MESSAGE_SEND | GAIM_MESSAGE_RECV)) + { + char *name; + if (alias && *alias) + name = g_strdup_printf("%s: ", alias); + else if (who && *who) + name = g_strdup_printf("%s: ", who); + else + name = g_strdup(""); + + gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(ggconv->tv), + name, GNT_TEXT_FLAG_BOLD); + g_free(name); + } gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(ggconv->tv), - name, GNT_TEXT_FLAG_BOLD); - gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(ggconv->tv), strip, 0); gnt_text_view_next_line(GNT_TEXT_VIEW(ggconv->tv)); gnt_text_view_scroll(GNT_TEXT_VIEW(ggconv->tv), 0); g_free(strip); - g_free(name); } static void Modified: trunk/console/gntui.c =================================================================== --- trunk/console/gntui.c 2006-06-28 17:28:06 UTC (rev 16367) +++ trunk/console/gntui.c 2006-06-28 18:50:33 UTC (rev 16368) @@ -1,4 +1,6 @@ #include "gntui.h" +#include "gntblist.h" +#include "gntconv.h" void init_gnt_ui() { Modified: trunk/console/libgnt/Makefile =================================================================== --- trunk/console/libgnt/Makefile 2006-06-28 17:28:06 UTC (rev 16367) +++ trunk/console/libgnt/Makefile 2006-06-28 18:50:33 UTC (rev 16368) @@ -1,4 +1,5 @@ -CFLAGS=`pkg-config --cflags gobject-2.0` -g +CC=gcc +CFLAGS=`pkg-config --cflags gobject-2.0` -g -Wall LDFLAGS=`pkg-config --libs gobject-2.0` -lncursesw -pg HEADERS = \ Modified: trunk/console/libgnt/test/Makefile =================================================================== --- trunk/console/libgnt/test/Makefile 2006-06-28 17:28:06 UTC (rev 16367) +++ trunk/console/libgnt/test/Makefile 2006-06-28 18:50:33 UTC (rev 16368) @@ -1,3 +1,4 @@ +CC=gcc CFLAGS=`pkg-config --cflags gobject-2.0` -g -I../ LDFLAGS=`pkg-config --libs gobject-2.0` -lncursesw -pg -lgnt -L../ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |