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-09 04:45:07
|
Revision: 16470 Author: sadrul Date: 2006-07-08 21:44:58 -0700 (Sat, 08 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16470&view=rev Log Message: ----------- Add an alignment option in a GntBox to align the widgets in it. Modified Paths: -------------- trunk/console/libgnt/gntbox.c trunk/console/libgnt/gntbox.h trunk/console/libgnt/test/combo.c Modified: trunk/console/libgnt/gntbox.c =================================================================== --- trunk/console/libgnt/gntbox.c 2006-07-09 01:23:12 UTC (rev 16469) +++ trunk/console/libgnt/gntbox.c 2006-07-09 04:44:58 UTC (rev 16470) @@ -372,6 +372,10 @@ box->pad = 1; gnt_widget_set_take_focus(widget, TRUE); GNT_WIDGET_SET_FLAGS(widget, GNT_WIDGET_NO_BORDER | GNT_WIDGET_NO_SHADOW); + if (vert) + box->alignment = GNT_ALIGN_LEFT; + else + box->alignment = GNT_ALIGN_MID; return widget; } @@ -431,18 +435,42 @@ { GntWidget *w = GNT_WIDGET(iter->data); int height, width; + int x, y; if (GNT_IS_BOX(w)) gnt_box_sync_children(GNT_BOX(w)); gnt_widget_get_size(w, &width, &height); + x = w->priv.x - widget->priv.x; + y = w->priv.y - widget->priv.y; + + if (box->vertical) + { + if (box->alignment == GNT_ALIGN_RIGHT) + x += widget->priv.width - width; + else if (box->alignment == GNT_ALIGN_MID) + x += (widget->priv.width - width)/2; + if (x + width > widget->priv.width - 1) + x -= x + width - (widget->priv.width - 1); + } + else + { + if (box->alignment == GNT_ALIGN_BOTTOM) + y += widget->priv.height - height; + else if (box->alignment == GNT_ALIGN_MID) + y += (widget->priv.height - height)/2; + if (y + height > widget->priv.height - 1) + y -= y + height - (widget->priv.height - 1); + } + copywin(w->window, widget->window, 0, 0, - w->priv.y - widget->priv.y, - w->priv.x - widget->priv.x, - w->priv.y - widget->priv.y + height - 1, - w->priv.x - widget->priv.x + width - 1, - FALSE); + y, x, y + height - 1, x + width - 1, FALSE); } } +void gnt_box_set_alignment(GntBox *box, GntAlignment alignment) +{ + box->alignment = alignment; +} + Modified: trunk/console/libgnt/gntbox.h =================================================================== --- trunk/console/libgnt/gntbox.h 2006-07-09 01:23:12 UTC (rev 16469) +++ trunk/console/libgnt/gntbox.h 2006-07-09 04:44:58 UTC (rev 16470) @@ -14,6 +14,19 @@ typedef struct _GnBox GntBox; typedef struct _GnBoxClass GntBoxClass; +typedef enum +{ + /* These for vertical boxes */ + GNT_ALIGN_LEFT, + GNT_ALIGN_RIGHT, + + GNT_ALIGN_MID, + + /* These for horizontal boxes */ + GNT_ALIGN_TOP, + GNT_ALIGN_BOTTOM +} GntAlignment; + struct _GnBox { GntWidget parent; @@ -24,6 +37,7 @@ GntWidget *active; int pad; /* Number of spaces to use between widgets */ + GntAlignment alignment; /* How are the widgets going to be aligned? */ char *title; GList *focus; /* List of widgets to cycle focus (only valid for parent boxes) */ @@ -60,6 +74,8 @@ void gnt_box_sync_children(GntBox *box); +void gnt_box_set_alignment(GntBox *box, GntAlignment alignment); + G_END_DECLS #endif /* GNT_BOX_H */ Modified: trunk/console/libgnt/test/combo.c =================================================================== --- trunk/console/libgnt/test/combo.c 2006-07-09 01:23:12 UTC (rev 16469) +++ trunk/console/libgnt/test/combo.c 2006-07-09 04:44:58 UTC (rev 16470) @@ -1,19 +1,29 @@ #include <gnt.h> #include <gntbox.h> +#include <gntbutton.h> #include <gntcombobox.h> #include <gntlabel.h> int main() { GntWidget *box, *combo, *button; + GntWidget *hbox; gnt_init(); - box = gnt_box_new(FALSE, FALSE); + box = gnt_box_new(FALSE, TRUE); + gnt_widget_set_name(box, "box"); + gnt_box_set_alignment(GNT_BOX(box), GNT_ALIGN_MID); + gnt_box_set_pad(GNT_BOX(box), 0); gnt_box_set_toplevel(GNT_BOX(box), TRUE); gnt_box_set_title(GNT_BOX(box), "Checkbox"); + hbox = gnt_box_new(FALSE, FALSE); + gnt_box_set_pad(GNT_BOX(hbox), 0); + gnt_box_set_alignment(GNT_BOX(hbox), GNT_ALIGN_MID); + gnt_widget_set_name(hbox, "upper"); + combo = gnt_combo_box_new(); gnt_combo_box_add_data(GNT_COMBO_BOX(combo), "1", "1"); gnt_combo_box_add_data(GNT_COMBO_BOX(combo), "2", "2"); @@ -22,12 +32,20 @@ gnt_combo_box_add_data(GNT_COMBO_BOX(combo), "5", "5"); gnt_combo_box_add_data(GNT_COMBO_BOX(combo), "6", "6"); - gnt_box_add_widget(GNT_BOX(box), gnt_label_new("Select")); - gnt_box_add_widget(GNT_BOX(box), combo); + gnt_box_add_widget(GNT_BOX(hbox), gnt_label_new("Select")); + gnt_box_add_widget(GNT_BOX(hbox), combo); + gnt_box_add_widget(GNT_BOX(box), hbox); + + hbox = gnt_box_new(TRUE, FALSE); + gnt_box_set_alignment(GNT_BOX(hbox), GNT_ALIGN_MID); + gnt_widget_set_name(hbox, "lower"); + button = gnt_button_new("OK"); - gnt_box_add_widget(GNT_BOX(box), button); + gnt_box_add_widget(GNT_BOX(hbox), button); + gnt_box_add_widget(GNT_BOX(box), hbox); + gnt_widget_show(box); gnt_main(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-07-09 01:23:15
|
Revision: 16469 Author: sadrul Date: 2006-07-08 18:23:12 -0700 (Sat, 08 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16469&view=rev Log Message: ----------- I have not implemented the /-commands for the conversations. For now, disable sending any message starting with a '/'. Modified Paths: -------------- trunk/console/gntconv.c Modified: trunk/console/gntconv.c =================================================================== --- trunk/console/gntconv.c 2006-07-09 01:07:00 UTC (rev 16468) +++ trunk/console/gntconv.c 2006-07-09 01:23:12 UTC (rev 16469) @@ -47,17 +47,29 @@ if (key[0] == '\r' && key[1] == 0) { const char *text = gnt_entry_get_text(GNT_ENTRY(ggconv->entry)); - switch (gaim_conversation_get_type(ggconv->conv)) + if (*text == '/') { - case GAIM_CONV_TYPE_IM: - gaim_conv_im_send_with_flags(GAIM_CONV_IM(ggconv->conv), text, GAIM_MESSAGE_SEND); - break; - case GAIM_CONV_TYPE_CHAT: - gaim_conv_chat_send(GAIM_CONV_CHAT(ggconv->conv), text); - break; - default: - g_return_val_if_reached(FALSE); + /* XXX: Need to check for /-commands here */ + gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(ggconv->tv), + _("Commands are not supported yet. Message was NOT sent."), + GNT_TEXT_FLAG_DIM | GNT_TEXT_FLAG_UNDERLINE); + gnt_text_view_next_line(GNT_TEXT_VIEW(ggconv->tv)); + gnt_text_view_scroll(GNT_TEXT_VIEW(ggconv->tv), 0); } + else + { + switch (gaim_conversation_get_type(ggconv->conv)) + { + case GAIM_CONV_TYPE_IM: + gaim_conv_im_send_with_flags(GAIM_CONV_IM(ggconv->conv), text, GAIM_MESSAGE_SEND); + break; + case GAIM_CONV_TYPE_CHAT: + gaim_conv_chat_send(GAIM_CONV_CHAT(ggconv->conv), text); + break; + default: + g_return_val_if_reached(FALSE); + } + } gnt_entry_clear(GNT_ENTRY(ggconv->entry)); return TRUE; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-07-09 01:07:04
|
Revision: 16468 Author: sadrul Date: 2006-07-08 18:07:00 -0700 (Sat, 08 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16468&view=rev Log Message: ----------- This isn't necessary. Modified Paths: -------------- trunk/console/libgnt/gnttree.c Modified: trunk/console/libgnt/gnttree.c =================================================================== --- trunk/console/libgnt/gnttree.c 2006-07-09 00:54:31 UTC (rev 16467) +++ trunk/console/libgnt/gnttree.c 2006-07-09 01:07:00 UTC (rev 16468) @@ -209,12 +209,6 @@ char *s = g_utf8_offset_to_pointer(str, widget->priv.width - 1 - pos); *s = '\0'; } - else - { - while (wr < widget->priv.width - 1 - pos) - str[wr++] = ' '; - str[wr] = 0; - } if (flags & GNT_TEXT_FLAG_BOLD) attr |= A_BOLD; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-07-09 00:54:41
|
Revision: 16467 Author: sadrul Date: 2006-07-08 17:54:31 -0700 (Sat, 08 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16467&view=rev Log Message: ----------- Minor enhancements for the combobox. Modified Paths: -------------- trunk/console/libgnt/gntcombobox.c trunk/console/libgnt/gnttree.c trunk/console/libgnt/test/combo.c Modified: trunk/console/libgnt/gntcombobox.c =================================================================== --- trunk/console/libgnt/gntcombobox.c 2006-07-08 23:58:20 UTC (rev 16466) +++ trunk/console/libgnt/gntcombobox.c 2006-07-09 00:54:31 UTC (rev 16467) @@ -33,6 +33,7 @@ GntComboBox *box = GNT_COMBO_BOX(widget); const char *text = NULL; GntColorType type; + int len; if (box->dropdown) { @@ -43,14 +44,28 @@ if (text == NULL) text = ""; + text = g_strdup(text); + if (gnt_widget_has_focus(widget)) type = GNT_COLOR_HIGHLIGHT; else type = GNT_COLOR_NORMAL; wbkgdset(widget->window, '\0' | COLOR_PAIR(type)); + + if ((len = g_utf8_strlen(text, -1)) > widget->priv.width - 4) + { + char *s = g_utf8_offset_to_pointer(text, widget->priv.width - 4); + *s = '\0'; + len = widget->priv.width - 4; + } + mvwprintw(widget->window, 1, 1, text); + whline(widget->window, '\0' | COLOR_PAIR(type), widget->priv.width - 4 - len); + mvwaddch(widget->window, 1, widget->priv.width - 3, ACS_VLINE | COLOR_PAIR(GNT_COLOR_NORMAL)); + mvwaddch(widget->window, 1, widget->priv.width - 2, ACS_DARROW | COLOR_PAIR(GNT_COLOR_NORMAL)); + g_free(text); DEBUG; } @@ -164,6 +179,7 @@ box = gnt_box_new(FALSE, FALSE); GNT_WIDGET_SET_FLAGS(box, GNT_WIDGET_NO_SHADOW | GNT_WIDGET_NO_BORDER); + gnt_box_set_pad(GNT_BOX(box), 0); gnt_box_add_widget(GNT_BOX(box), combo->dropdown); DEBUG; Modified: trunk/console/libgnt/gnttree.c =================================================================== --- trunk/console/libgnt/gnttree.c 2006-07-08 23:58:20 UTC (rev 16466) +++ trunk/console/libgnt/gnttree.c 2006-07-09 00:54:31 UTC (rev 16467) @@ -201,11 +201,13 @@ g_snprintf(format, sizeof(format) - 1, "[%c] ", row->isselected ? 'X' : ' '); } - /* XXX: Need a utf8 version of snprintf */ - if ((wr = g_snprintf(str, widget->priv.width, "%s%s", format, row->text)) >= widget->priv.width) + g_snprintf(str, sizeof(str) - 1, "%s%s", format, row->text); + + if ((wr = g_utf8_strlen(str, -1)) >= widget->priv.width - 1 - pos) { /* XXX: ellipsize */ - str[widget->priv.width - 1 - pos] = 0; + char *s = g_utf8_offset_to_pointer(str, widget->priv.width - 1 - pos); + *s = '\0'; } else { Modified: trunk/console/libgnt/test/combo.c =================================================================== --- trunk/console/libgnt/test/combo.c 2006-07-08 23:58:20 UTC (rev 16466) +++ trunk/console/libgnt/test/combo.c 2006-07-09 00:54:31 UTC (rev 16467) @@ -17,7 +17,7 @@ combo = gnt_combo_box_new(); gnt_combo_box_add_data(GNT_COMBO_BOX(combo), "1", "1"); gnt_combo_box_add_data(GNT_COMBO_BOX(combo), "2", "2"); - gnt_combo_box_add_data(GNT_COMBO_BOX(combo), "3", "3"); + gnt_combo_box_add_data(GNT_COMBO_BOX(combo), "3", "3abcdefghijklmnopqrstuvwxyz"); gnt_combo_box_add_data(GNT_COMBO_BOX(combo), "4", "4"); gnt_combo_box_add_data(GNT_COMBO_BOX(combo), "5", "5"); gnt_combo_box_add_data(GNT_COMBO_BOX(combo), "6", "6"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-07-08 23:58:34
|
Revision: 16466 Author: sadrul Date: 2006-07-08 16:58:20 -0700 (Sat, 08 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16466&view=rev Log Message: ----------- New widget GntComboBox. I have addde a test file as an example as well. Rename gntutils.* to gntmarshal.* I am going to have some util-functions in gntutils.* later. Modified Paths: -------------- trunk/console/libgnt/Makefile.am trunk/console/libgnt/gnttree.c trunk/console/libgnt/gnttree.h trunk/console/libgnt/gntwidget.c trunk/console/libgnt/test/Makefile Added Paths: ----------- trunk/console/libgnt/gntcombobox.c trunk/console/libgnt/gntcombobox.h trunk/console/libgnt/gntmarshal.c trunk/console/libgnt/gntmarshal.h trunk/console/libgnt/test/combo.c Removed Paths: ------------- trunk/console/libgnt/gntutils.c trunk/console/libgnt/gntutils.h Modified: trunk/console/libgnt/Makefile.am =================================================================== --- trunk/console/libgnt/Makefile.am 2006-07-08 22:43:22 UTC (rev 16465) +++ trunk/console/libgnt/Makefile.am 2006-07-08 23:58:20 UTC (rev 16466) @@ -8,11 +8,12 @@ gntbox.c \ gntbutton.c \ gntcolors.c \ + gntcombobox.c \ gntentry.c \ gntlabel.c \ + gntmarshal.c \ gnttextview.c \ gnttree.c \ - gntutils.c \ gntmain.c libgnt_la_headers = \ @@ -20,12 +21,13 @@ gntbox.h \ gntbutton.h \ gntcolors.h \ + gntcombobox.h \ gntentry.h \ gntkeys.h \ gntlabel.h \ + gntmarshal.h \ gnttextview.h \ gnttree.h \ - gntutils.h \ gnt.h libgnt_laincludedir=$(includedir)/gnt Added: trunk/console/libgnt/gntcombobox.c =================================================================== --- trunk/console/libgnt/gntcombobox.c (rev 0) +++ trunk/console/libgnt/gntcombobox.c 2006-07-08 23:58:20 UTC (rev 16466) @@ -0,0 +1,220 @@ +#include "gntbox.h" +#include "gntcombobox.h" +#include "gnttree.h" +#include "gntmarshal.h" + +#include <string.h> + +enum +{ + SIG_SELECTION_CHANGED, + SIGS, +}; + +static GntWidgetClass *parent_class = NULL; +static guint signals[SIGS] = { 0 }; +static void (*widget_lost_focus)(GntWidget *widget); + +static void +set_selection(GntComboBox *box, gpointer key) +{ + if (box->selected != key) + { + gpointer old = box->selected; + box->selected = key; + g_signal_emit(box, signals[SIG_SELECTION_CHANGED], 0, old, key); + gnt_widget_draw(GNT_WIDGET(box)); + } +} + +static void +gnt_combo_box_draw(GntWidget *widget) +{ + GntComboBox *box = GNT_COMBO_BOX(widget); + const char *text = NULL; + GntColorType type; + + if (box->dropdown) + { + text = gnt_tree_get_selection_text(GNT_TREE(box->dropdown)); + box->selected = gnt_tree_get_selection_data(GNT_TREE(box->dropdown)); + } + + if (text == NULL) + text = ""; + + if (gnt_widget_has_focus(widget)) + type = GNT_COLOR_HIGHLIGHT; + else + type = GNT_COLOR_NORMAL; + + wbkgdset(widget->window, '\0' | COLOR_PAIR(type)); + mvwprintw(widget->window, 1, 1, text); + + DEBUG; +} + +static void +gnt_combo_box_size_request(GntWidget *widget) +{ + widget->priv.height = 3; /* For now, a combobox will have border */ + widget->priv.width = 15; +} + +static void +gnt_combo_box_map(GntWidget *widget) +{ + if (widget->priv.width == 0 || widget->priv.height == 0) + gnt_widget_size_request(widget); + DEBUG; +} + +static gboolean +gnt_combo_box_key_pressed(GntWidget *widget, const char *text) +{ + GntComboBox *box = GNT_COMBO_BOX(widget); + if (GNT_WIDGET_IS_FLAG_SET(box->dropdown->parent, GNT_WIDGET_MAPPED)) + { + if (text[1] == 0) + { + switch (text[0]) + { + case '\r': + case '\t': + /* XXX: Get the selction */ + set_selection(box, gnt_tree_get_selection_data(GNT_TREE(box->dropdown))); + case 27: + gnt_widget_hide(box->dropdown->parent); + return TRUE; + break; + } + } + if (gnt_widget_key_pressed(box->dropdown, text)) + return TRUE; + } + else + { + if (text[0] == 27) + { + if (strcmp(text + 1, GNT_KEY_UP) == 0 || + strcmp(text + 1, GNT_KEY_DOWN) == 0) + { + gnt_widget_set_size(box->dropdown, widget->priv.width, 9); + gnt_widget_set_position(box->dropdown->parent, + widget->priv.x, widget->priv.y + widget->priv.height - 1); + gnt_widget_draw(box->dropdown->parent); + return TRUE; + } + } + } + + return FALSE; +} + +static void +gnt_combo_box_destroy(GntWidget *widget) +{ + gnt_widget_destroy(GNT_COMBO_BOX(widget)->dropdown->parent); +} + +static void +gnt_combo_box_lost_focus(GntWidget *widget) +{ + GntComboBox *combo = GNT_COMBO_BOX(widget); + if (GNT_WIDGET_IS_FLAG_SET(combo->dropdown->parent, GNT_WIDGET_MAPPED)) + gnt_widget_hide(GNT_COMBO_BOX(widget)->dropdown->parent); + widget_lost_focus(widget); +} + +static void +gnt_combo_box_class_init(GntComboBoxClass *klass) +{ + parent_class = GNT_WIDGET_CLASS(klass); + + parent_class->destroy = gnt_combo_box_destroy; + parent_class->draw = gnt_combo_box_draw; + parent_class->map = gnt_combo_box_map; + parent_class->size_request = gnt_combo_box_size_request; + parent_class->key_pressed = gnt_combo_box_key_pressed; + + widget_lost_focus = parent_class->lost_focus; + parent_class->lost_focus = gnt_combo_box_lost_focus; + + signals[SIG_SELECTION_CHANGED] = + g_signal_new("selection-changed", + G_TYPE_FROM_CLASS(klass), + G_SIGNAL_RUN_LAST, + 0, + NULL, NULL, + gnt_closure_marshal_VOID__POINTER_POINTER, + G_TYPE_NONE, 2, G_TYPE_POINTER, G_TYPE_POINTER); + + DEBUG; +} + +static void +gnt_combo_box_init(GTypeInstance *instance, gpointer class) +{ + GntWidget *box; + GntComboBox *combo = GNT_COMBO_BOX(instance); + + GNT_WIDGET_SET_FLAGS(GNT_WIDGET(instance), + GNT_WIDGET_GROW_X | GNT_WIDGET_CAN_TAKE_FOCUS | GNT_WIDGET_NO_SHADOW); + combo->dropdown = gnt_tree_new(); + + box = gnt_box_new(FALSE, FALSE); + GNT_WIDGET_SET_FLAGS(box, GNT_WIDGET_NO_SHADOW | GNT_WIDGET_NO_BORDER); + gnt_box_add_widget(GNT_BOX(box), combo->dropdown); + + DEBUG; +} + +/****************************************************************************** + * GntComboBox API + *****************************************************************************/ +GType +gnt_combo_box_get_gtype(void) +{ + static GType type = 0; + + if(type == 0) + { + static const GTypeInfo info = { + sizeof(GntComboBoxClass), + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc)gnt_combo_box_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof(GntComboBox), + 0, /* n_preallocs */ + gnt_combo_box_init, /* instance_init */ + }; + + type = g_type_register_static(GNT_TYPE_WIDGET, + "GntComboBox", + &info, 0); + } + + return type; +} + +GntWidget *gnt_combo_box_new() +{ + GntWidget *widget = g_object_new(GNT_TYPE_COMBO_BOX, NULL); + + return widget; +} + +void gnt_combo_box_add_data(GntComboBox *box, gpointer key, const char *text) +{ + gnt_tree_add_row_after(GNT_TREE(box->dropdown), key, text, NULL, NULL); + if (box->selected == NULL) + set_selection(box, key); +} + +gpointer gnt_combo_box_get_selected_data(GntComboBox *box) +{ + return box->selected; +} + Property changes on: trunk/console/libgnt/gntcombobox.c ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Added: trunk/console/libgnt/gntcombobox.h =================================================================== --- trunk/console/libgnt/gntcombobox.h (rev 0) +++ trunk/console/libgnt/gntcombobox.h 2006-07-08 23:58:20 UTC (rev 16466) @@ -0,0 +1,55 @@ +#ifndef GNT_COMBO_BOX_H +#define GNT_COMBO_BOX_H + +#include "gnt.h" +#include "gntcolors.h" +#include "gntkeys.h" +#include "gntwidget.h" + +#define GNT_TYPE_COMBO_BOX (gnt_combo_box_get_gtype()) +#define GNT_COMBO_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GNT_TYPE_COMBO_BOX, GntComboBox)) +#define GNT_COMBO_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GNT_TYPE_COMBO_BOX, GntComboBoxClass)) +#define GNT_IS_COMBO_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GNT_TYPE_COMBO_BOX)) +#define GNT_IS_COMBO_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GNT_TYPE_COMBO_BOX)) +#define GNT_COMBO_BOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GNT_TYPE_COMBO_BOX, GntComboBoxClass)) + +#define GNT_COMBO_BOX_FLAGS(obj) (GNT_COMBO_BOX(obj)->priv.flags) +#define GNT_COMBO_BOX_SET_FLAGS(obj, flags) (GNT_COMBO_BOX_FLAGS(obj) |= flags) +#define GNT_COMBO_BOX_UNSET_FLAGS(obj, flags) (GNT_COMBO_BOX_FLAGS(obj) &= ~(flags)) + +typedef struct _GnComboBox GntComboBox; +typedef struct _GnComboBoxPriv GntComboBoxPriv; +typedef struct _GnComboBoxClass GntComboBoxClass; + +struct _GnComboBox +{ + GntWidget parent; + + GntWidget *dropdown; /* This is a GntTree */ + + void *selected; /* Currently selected key */ +}; + +struct _GnComboBoxClass +{ + GntWidgetClass parent; + + void (*gnt_reserved1)(void); + void (*gnt_reserved2)(void); + void (*gnt_reserved3)(void); + void (*gnt_reserved4)(void); +}; + +G_BEGIN_DECLS + +GType gnt_combo_box_get_gtype(void); + +GntWidget *gnt_combo_box_new(); + +void gnt_combo_box_add_data(GntComboBox *box, gpointer key, const char *text); + +gpointer gnt_combo_box_get_selected_data(GntComboBox *box); + +G_END_DECLS + +#endif /* GNT_COMBO_BOX_H */ Property changes on: trunk/console/libgnt/gntcombobox.h ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Copied: trunk/console/libgnt/gntmarshal.c (from rev 16457, trunk/console/libgnt/gntutils.c) =================================================================== --- trunk/console/libgnt/gntmarshal.c (rev 0) +++ trunk/console/libgnt/gntmarshal.c 2006-07-08 23:58:20 UTC (rev 16466) @@ -0,0 +1,168 @@ +#include "gntmarshal.h" + +void gnt_closure_marshal_BOOLEAN__STRING(GClosure *closure, + GValue *ret_value, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint, + gpointer marshal_data) +{ + typedef gboolean (*func) (gpointer data1, const char *arg1, gpointer data2); + register func callback; + register GCClosure *cc = (GCClosure*)closure; + register gpointer data1, data2; + gboolean ret; + + g_return_if_fail(ret_value != NULL); + g_return_if_fail(n_param_values == 2); + + if (G_CCLOSURE_SWAP_DATA(closure)) + { + data1 = closure->data; + data2 = g_value_peek_pointer(param_values + 0); + } + else + { + data1 = g_value_peek_pointer(param_values + 0); + data2 = closure->data; + } + + callback = (func) (marshal_data ? marshal_data : cc->callback); + ret = callback(data1, g_value_get_string(param_values + 1) , data2); + g_value_set_boolean(ret_value, ret); +} + +void gnt_closure_marshal_VOID__INT_INT_INT_INT(GClosure *closure, + GValue *ret_value, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint, + gpointer marshal_data) +{ + typedef void (*func) (gpointer data1, int, int, int, int, gpointer data2); + register func callback; + register GCClosure *cc = (GCClosure*)closure; + register gpointer data1, data2; + + g_return_if_fail(n_param_values == 5); + + if (G_CCLOSURE_SWAP_DATA(closure)) + { + data1 = closure->data; + data2 = g_value_peek_pointer(param_values + 0); + } + else + { + data1 = g_value_peek_pointer(param_values + 0); + data2 = closure->data; + } + + callback = (func) (marshal_data ? marshal_data : cc->callback); + callback(data1, + g_value_get_int(param_values + 1) , + g_value_get_int(param_values + 2) , + g_value_get_int(param_values + 3) , + g_value_get_int(param_values + 4) , + data2); +} + +void gnt_closure_marshal_VOID__INT_INT(GClosure *closure, + GValue *ret_value, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint, + gpointer marshal_data) +{ + typedef void (*func) (gpointer data1, int, int, gpointer data2); + register func callback; + register GCClosure *cc = (GCClosure*)closure; + register gpointer data1, data2; + + g_return_if_fail(n_param_values == 3); + + if (G_CCLOSURE_SWAP_DATA(closure)) + { + data1 = closure->data; + data2 = g_value_peek_pointer(param_values + 0); + } + else + { + data1 = g_value_peek_pointer(param_values + 0); + data2 = closure->data; + } + + callback = (func) (marshal_data ? marshal_data : cc->callback); + callback(data1, + g_value_get_int(param_values + 1) , + g_value_get_int(param_values + 2) , + data2); +} + +void gnt_closure_marshal_VOID__POINTER_POINTER(GClosure *closure, + GValue *ret_value, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint, + gpointer marshal_data) +{ + typedef void (*func) (gpointer data1, gpointer, gpointer, gpointer data2); + register func callback; + register GCClosure *cc = (GCClosure*)closure; + register gpointer data1, data2; + + g_return_if_fail(n_param_values == 3); + + if (G_CCLOSURE_SWAP_DATA(closure)) + { + data1 = closure->data; + data2 = g_value_peek_pointer(param_values + 0); + } + else + { + data1 = g_value_peek_pointer(param_values + 0); + data2 = closure->data; + } + + callback = (func) (marshal_data ? marshal_data : cc->callback); + callback(data1, + g_value_get_pointer(param_values + 1) , + g_value_get_pointer(param_values + 2) , + data2); +} + +void gnt_closure_marshal_BOOLEAN__INT_INT(GClosure *closure, + GValue *ret_value, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint, + gpointer marshal_data) +{ + typedef gboolean (*func) (gpointer data1, int, int, gpointer data2); + register func callback; + register GCClosure *cc = (GCClosure*)closure; + register gpointer data1, data2; + gboolean ret; + + g_return_if_fail(ret_value != NULL); + g_return_if_fail(n_param_values == 3); + + if (G_CCLOSURE_SWAP_DATA(closure)) + { + data1 = closure->data; + data2 = g_value_peek_pointer(param_values + 0); + } + else + { + data1 = g_value_peek_pointer(param_values + 0); + data2 = closure->data; + } + + callback = (func) (marshal_data ? marshal_data : cc->callback); + ret = callback(data1, + g_value_get_int(param_values + 1) , + g_value_get_int(param_values + 2) , + data2); + g_value_set_boolean(ret_value, ret); +} + + Copied: trunk/console/libgnt/gntmarshal.h (from rev 16457, trunk/console/libgnt/gntutils.h) =================================================================== --- trunk/console/libgnt/gntmarshal.h (rev 0) +++ trunk/console/libgnt/gntmarshal.h 2006-07-08 23:58:20 UTC (rev 16466) @@ -0,0 +1,37 @@ +#include "gntwidget.h" + +void gnt_closure_marshal_BOOLEAN__STRING(GClosure *closure, + GValue *ret_value, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint, + gpointer marshal_data); + +void gnt_closure_marshal_VOID__INT_INT_INT_INT(GClosure *closure, + GValue *ret_value, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint, + gpointer marshal_data); + +void gnt_closure_marshal_VOID__INT_INT(GClosure *closure, + GValue *ret_value, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint, + gpointer marshal_data); + +void gnt_closure_marshal_VOID__POINTER_POINTER(GClosure *closure, + GValue *ret_value, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint, + gpointer marshal_data); + +void gnt_closure_marshal_BOOLEAN__INT_INT(GClosure *closure, + GValue *ret_value, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint, + gpointer marshal_data); + Modified: trunk/console/libgnt/gnttree.c =================================================================== --- trunk/console/libgnt/gnttree.c 2006-07-08 22:43:22 UTC (rev 16465) +++ trunk/console/libgnt/gnttree.c 2006-07-08 23:58:20 UTC (rev 16466) @@ -1,5 +1,5 @@ #include "gnttree.h" -#include "gntutils.h" +#include "gntmarshal.h" #include <string.h> @@ -592,6 +592,13 @@ return NULL; } +const char *gnt_tree_get_selection_text(GntTree *tree) +{ + if (tree->current) + return tree->current->text; + return NULL; +} + /* XXX: Should this also remove all the children of the row being removed? */ void gnt_tree_remove(GntTree *tree, gpointer key) { @@ -707,6 +714,6 @@ return; row->flags = flags; - redraw_tree(tree); /* XXX: Is shouldn't be necessary to redraw the whole darned tree */ + redraw_tree(tree); /* XXX: It shouldn't be necessary to redraw the whole darned tree */ } Modified: trunk/console/libgnt/gnttree.h =================================================================== --- trunk/console/libgnt/gnttree.h 2006-07-08 22:43:22 UTC (rev 16465) +++ trunk/console/libgnt/gnttree.h 2006-07-08 23:58:20 UTC (rev 16466) @@ -67,6 +67,8 @@ gpointer gnt_tree_get_selection_data(GntTree *tree); +const char *gnt_tree_get_selection_text(GntTree *tree); + void gnt_tree_remove(GntTree *tree, gpointer key); /* Returns the visible line number of the selected row */ Deleted: trunk/console/libgnt/gntutils.c =================================================================== --- trunk/console/libgnt/gntutils.c 2006-07-08 22:43:22 UTC (rev 16465) +++ trunk/console/libgnt/gntutils.c 2006-07-08 23:58:20 UTC (rev 16466) @@ -1,168 +0,0 @@ -#include "gntutils.h" - -void gnt_closure_marshal_BOOLEAN__STRING(GClosure *closure, - GValue *ret_value, - guint n_param_values, - const GValue *param_values, - gpointer invocation_hint, - gpointer marshal_data) -{ - typedef gboolean (*func) (gpointer data1, const char *arg1, gpointer data2); - register func callback; - register GCClosure *cc = (GCClosure*)closure; - register gpointer data1, data2; - gboolean ret; - - g_return_if_fail(ret_value != NULL); - g_return_if_fail(n_param_values == 2); - - if (G_CCLOSURE_SWAP_DATA(closure)) - { - data1 = closure->data; - data2 = g_value_peek_pointer(param_values + 0); - } - else - { - data1 = g_value_peek_pointer(param_values + 0); - data2 = closure->data; - } - - callback = (func) (marshal_data ? marshal_data : cc->callback); - ret = callback(data1, g_value_get_string(param_values + 1) , data2); - g_value_set_boolean(ret_value, ret); -} - -void gnt_closure_marshal_VOID__INT_INT_INT_INT(GClosure *closure, - GValue *ret_value, - guint n_param_values, - const GValue *param_values, - gpointer invocation_hint, - gpointer marshal_data) -{ - typedef void (*func) (gpointer data1, int, int, int, int, gpointer data2); - register func callback; - register GCClosure *cc = (GCClosure*)closure; - register gpointer data1, data2; - - g_return_if_fail(n_param_values == 5); - - if (G_CCLOSURE_SWAP_DATA(closure)) - { - data1 = closure->data; - data2 = g_value_peek_pointer(param_values + 0); - } - else - { - data1 = g_value_peek_pointer(param_values + 0); - data2 = closure->data; - } - - callback = (func) (marshal_data ? marshal_data : cc->callback); - callback(data1, - g_value_get_int(param_values + 1) , - g_value_get_int(param_values + 2) , - g_value_get_int(param_values + 3) , - g_value_get_int(param_values + 4) , - data2); -} - -void gnt_closure_marshal_VOID__INT_INT(GClosure *closure, - GValue *ret_value, - guint n_param_values, - const GValue *param_values, - gpointer invocation_hint, - gpointer marshal_data) -{ - typedef void (*func) (gpointer data1, int, int, gpointer data2); - register func callback; - register GCClosure *cc = (GCClosure*)closure; - register gpointer data1, data2; - - g_return_if_fail(n_param_values == 3); - - if (G_CCLOSURE_SWAP_DATA(closure)) - { - data1 = closure->data; - data2 = g_value_peek_pointer(param_values + 0); - } - else - { - data1 = g_value_peek_pointer(param_values + 0); - data2 = closure->data; - } - - callback = (func) (marshal_data ? marshal_data : cc->callback); - callback(data1, - g_value_get_int(param_values + 1) , - g_value_get_int(param_values + 2) , - data2); -} - -void gnt_closure_marshal_VOID__POINTER_POINTER(GClosure *closure, - GValue *ret_value, - guint n_param_values, - const GValue *param_values, - gpointer invocation_hint, - gpointer marshal_data) -{ - typedef void (*func) (gpointer data1, gpointer, gpointer, gpointer data2); - register func callback; - register GCClosure *cc = (GCClosure*)closure; - register gpointer data1, data2; - - g_return_if_fail(n_param_values == 3); - - if (G_CCLOSURE_SWAP_DATA(closure)) - { - data1 = closure->data; - data2 = g_value_peek_pointer(param_values + 0); - } - else - { - data1 = g_value_peek_pointer(param_values + 0); - data2 = closure->data; - } - - callback = (func) (marshal_data ? marshal_data : cc->callback); - callback(data1, - g_value_get_pointer(param_values + 1) , - g_value_get_pointer(param_values + 2) , - data2); -} - -void gnt_closure_marshal_BOOLEAN__INT_INT(GClosure *closure, - GValue *ret_value, - guint n_param_values, - const GValue *param_values, - gpointer invocation_hint, - gpointer marshal_data) -{ - typedef gboolean (*func) (gpointer data1, int, int, gpointer data2); - register func callback; - register GCClosure *cc = (GCClosure*)closure; - register gpointer data1, data2; - gboolean ret; - - g_return_if_fail(ret_value != NULL); - g_return_if_fail(n_param_values == 3); - - if (G_CCLOSURE_SWAP_DATA(closure)) - { - data1 = closure->data; - data2 = g_value_peek_pointer(param_values + 0); - } - else - { - data1 = g_value_peek_pointer(param_values + 0); - data2 = closure->data; - } - - callback = (func) (marshal_data ? marshal_data : cc->callback); - ret = callback(data1, - g_value_get_int(param_values + 1) , - g_value_get_int(param_values + 2) , - data2); - g_value_set_boolean(ret_value, ret); -} - - Deleted: trunk/console/libgnt/gntutils.h =================================================================== --- trunk/console/libgnt/gntutils.h 2006-07-08 22:43:22 UTC (rev 16465) +++ trunk/console/libgnt/gntutils.h 2006-07-08 23:58:20 UTC (rev 16466) @@ -1,37 +0,0 @@ -#include "gntwidget.h" - -void gnt_closure_marshal_BOOLEAN__STRING(GClosure *closure, - GValue *ret_value, - guint n_param_values, - const GValue *param_values, - gpointer invocation_hint, - gpointer marshal_data); - -void gnt_closure_marshal_VOID__INT_INT_INT_INT(GClosure *closure, - GValue *ret_value, - guint n_param_values, - const GValue *param_values, - gpointer invocation_hint, - gpointer marshal_data); - -void gnt_closure_marshal_VOID__INT_INT(GClosure *closure, - GValue *ret_value, - guint n_param_values, - const GValue *param_values, - gpointer invocation_hint, - gpointer marshal_data); - -void gnt_closure_marshal_VOID__POINTER_POINTER(GClosure *closure, - GValue *ret_value, - guint n_param_values, - const GValue *param_values, - gpointer invocation_hint, - gpointer marshal_data); - -void gnt_closure_marshal_BOOLEAN__INT_INT(GClosure *closure, - GValue *ret_value, - guint n_param_values, - const GValue *param_values, - gpointer invocation_hint, - gpointer marshal_data); - Modified: trunk/console/libgnt/gntwidget.c =================================================================== --- trunk/console/libgnt/gntwidget.c 2006-07-08 22:43:22 UTC (rev 16465) +++ trunk/console/libgnt/gntwidget.c 2006-07-08 23:58:20 UTC (rev 16466) @@ -1,7 +1,7 @@ /* Stuff brutally ripped from Gflib */ #include "gntwidget.h" -#include "gntutils.h" +#include "gntmarshal.h" #include "gnt.h" #define MIN_SIZE 5 Modified: trunk/console/libgnt/test/Makefile =================================================================== --- trunk/console/libgnt/test/Makefile 2006-07-08 22:43:22 UTC (rev 16465) +++ trunk/console/libgnt/test/Makefile 2006-07-08 23:58:20 UTC (rev 16466) @@ -2,7 +2,7 @@ CFLAGS=`pkg-config --cflags gobject-2.0` -g -I../ LDFLAGS=`pkg-config --libs gobject-2.0` -pg -lgnt -L../ -EXAMPLES=focus tv multiwin +EXAMPLES=combo focus tv multiwin all: make examples Added: trunk/console/libgnt/test/combo.c =================================================================== --- trunk/console/libgnt/test/combo.c (rev 0) +++ trunk/console/libgnt/test/combo.c 2006-07-08 23:58:20 UTC (rev 16466) @@ -0,0 +1,39 @@ +#include <gnt.h> +#include <gntbox.h> +#include <gntcombobox.h> +#include <gntlabel.h> + +int main() +{ + GntWidget *box, *combo, *button; + + gnt_init(); + + box = gnt_box_new(FALSE, FALSE); + + gnt_box_set_toplevel(GNT_BOX(box), TRUE); + gnt_box_set_title(GNT_BOX(box), "Checkbox"); + + combo = gnt_combo_box_new(); + gnt_combo_box_add_data(GNT_COMBO_BOX(combo), "1", "1"); + gnt_combo_box_add_data(GNT_COMBO_BOX(combo), "2", "2"); + gnt_combo_box_add_data(GNT_COMBO_BOX(combo), "3", "3"); + gnt_combo_box_add_data(GNT_COMBO_BOX(combo), "4", "4"); + gnt_combo_box_add_data(GNT_COMBO_BOX(combo), "5", "5"); + gnt_combo_box_add_data(GNT_COMBO_BOX(combo), "6", "6"); + + gnt_box_add_widget(GNT_BOX(box), gnt_label_new("Select")); + gnt_box_add_widget(GNT_BOX(box), combo); + + button = gnt_button_new("OK"); + gnt_box_add_widget(GNT_BOX(box), button); + + gnt_widget_show(box); + + gnt_main(); + + gnt_quit(); + + return 0; +} + Property changes on: trunk/console/libgnt/test/combo.c ___________________________________________________________________ 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: <ro...@us...> - 2006-07-08 22:43:58
|
Revision: 16465 Author: roast Date: 2006-07-08 15:43:22 -0700 (Sat, 08 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16465&view=rev Log Message: ----------- merged with svn trunk. 16395:16464. Modified Paths: -------------- branches/soc-2006-file-loggers/console/Makefile branches/soc-2006-file-loggers/console/gntblist.c branches/soc-2006-file-loggers/console/gntblist.h branches/soc-2006-file-loggers/console/gntconv.c branches/soc-2006-file-loggers/console/gntconv.h branches/soc-2006-file-loggers/console/gntgaim.c branches/soc-2006-file-loggers/console/gntui.c branches/soc-2006-file-loggers/console/libgnt/Makefile.am branches/soc-2006-file-loggers/console/libgnt/configure.ac branches/soc-2006-file-loggers/console/libgnt/gnt.h branches/soc-2006-file-loggers/console/libgnt/gntbox.c branches/soc-2006-file-loggers/console/libgnt/gntbox.h branches/soc-2006-file-loggers/console/libgnt/gntbutton.c branches/soc-2006-file-loggers/console/libgnt/gntcolors.c branches/soc-2006-file-loggers/console/libgnt/gntentry.c branches/soc-2006-file-loggers/console/libgnt/gntlabel.c branches/soc-2006-file-loggers/console/libgnt/gntmain.c branches/soc-2006-file-loggers/console/libgnt/gnttextview.c branches/soc-2006-file-loggers/console/libgnt/gnttextview.h branches/soc-2006-file-loggers/console/libgnt/gnttree.c branches/soc-2006-file-loggers/console/libgnt/gnttree.h branches/soc-2006-file-loggers/console/libgnt/gntutils.c branches/soc-2006-file-loggers/console/libgnt/gntutils.h branches/soc-2006-file-loggers/console/libgnt/gntwidget.c branches/soc-2006-file-loggers/console/libgnt/gntwidget.h branches/soc-2006-file-loggers/console/libgnt/test/Makefile branches/soc-2006-file-loggers/console/libgnt/test/focus.c branches/soc-2006-file-loggers/console/libgnt/test/multiwin.c branches/soc-2006-file-loggers/console/libgnt/test/tv.c branches/soc-2006-file-loggers/gaim.spec.in branches/soc-2006-file-loggers/plugins/ssl/ssl-gnutls.c branches/soc-2006-file-loggers/src/connection.c branches/soc-2006-file-loggers/src/connection.h branches/soc-2006-file-loggers/src/conversation.c branches/soc-2006-file-loggers/src/debug.c branches/soc-2006-file-loggers/src/debug.h branches/soc-2006-file-loggers/src/gtkblist.c branches/soc-2006-file-loggers/src/gtkdebug.c branches/soc-2006-file-loggers/src/gtkprefs.c branches/soc-2006-file-loggers/src/protocols/bonjour/bonjour.c branches/soc-2006-file-loggers/src/protocols/bonjour/bonjour.h branches/soc-2006-file-loggers/src/protocols/bonjour/buddy.c branches/soc-2006-file-loggers/src/protocols/bonjour/dns_sd.c branches/soc-2006-file-loggers/src/protocols/bonjour/dns_sd.h branches/soc-2006-file-loggers/src/protocols/bonjour/jabber.c branches/soc-2006-file-loggers/src/protocols/bonjour/jabber.h branches/soc-2006-file-loggers/src/protocols/gg/lib/libgadu.c branches/soc-2006-file-loggers/src/protocols/irc/cmds.c branches/soc-2006-file-loggers/src/protocols/jabber/roster.c branches/soc-2006-file-loggers/src/protocols/msn/httpconn.c branches/soc-2006-file-loggers/src/protocols/msn/httpconn.h branches/soc-2006-file-loggers/src/protocols/msn/msn.c branches/soc-2006-file-loggers/src/protocols/oscar/oscar.c branches/soc-2006-file-loggers/src/proxy.c branches/soc-2006-file-loggers/src/server.c branches/soc-2006-file-loggers/src/util.c Added Paths: ----------- branches/soc-2006-file-loggers/console/gntaccount.c branches/soc-2006-file-loggers/console/gntaccount.h Property Changed: ---------------- branches/soc-2006-file-loggers/src/protocols/qq/ Modified: branches/soc-2006-file-loggers/console/Makefile =================================================================== --- branches/soc-2006-file-loggers/console/Makefile 2006-07-08 22:08:51 UTC (rev 16464) +++ branches/soc-2006-file-loggers/console/Makefile 2006-07-08 22:43:22 UTC (rev 16465) @@ -1,18 +1,22 @@ +VERSION=gntgaim-0.0.0dev CC=gcc -CFLAGS=`pkg-config --cflags gaim gobject-2.0 gnt` -g -Wall +CFLAGS=`pkg-config --cflags gaim gobject-2.0 gnt` -g -Wall -DVERSION=\"$(VERSION)\" LDFLAGS=`pkg-config --libs gaim gobject-2.0 libxml-2.0 gnt` -pg GG_SOURCES = \ + gntaccount.c \ gntblist.c \ gntconv.c \ gntui.c GG_HEADERS = \ + gntaccount.h \ gntblist.h \ gntconv.h \ gntui.h GG_OBJECTS = \ + gntaccount.o \ gntblist.o \ gntconv.o \ gntui.o @@ -21,6 +25,7 @@ gntgaim: gntgaim.o $(GG_OBJECTS) $(CC) -o gntgaim gntgaim.o $(GG_OBJECTS) $(LDFLAGS) +gntaccount.o: gntaccount.c $(GG_HEADERS) gntblist.o: gntblist.c $(GG_HEADERS) gntconv.o: gntconv.c $(GG_HEADERS) gntgaim.o: gntgaim.c gntgaim.h $(GG_HEADERS) Copied: branches/soc-2006-file-loggers/console/gntaccount.c (from rev 16464, trunk/console/gntaccount.c) =================================================================== --- branches/soc-2006-file-loggers/console/gntaccount.c (rev 0) +++ branches/soc-2006-file-loggers/console/gntaccount.c 2006-07-08 22:43:22 UTC (rev 16465) @@ -0,0 +1,181 @@ +#include <gnt.h> +#include <gntbox.h> +#include <gntbutton.h> +#include <gntlabel.h> +#include <gnttree.h> + +#include <connection.h> +#include <notify.h> +#include <request.h> + +#include "gntaccount.h" +#include "gntgaim.h" + +typedef struct +{ + GntWidget *window; + GntWidget *tree; +} GGAccountList; + +static GGAccountList accounts; + +static void +account_toggled(GntWidget *widget, void *key, gpointer null) +{ + GaimAccount *account = key; + + gaim_account_set_enabled(account, GAIM_GNT_UI, gnt_tree_get_choice(GNT_TREE(widget), key)); +} + +void gg_accounts_init() +{ + GList *iter; + GntWidget *box, *button; + + accounts.window = gnt_box_new(TRUE, TRUE); + gnt_box_set_toplevel(GNT_BOX(accounts.window), TRUE); + gnt_box_set_title(GNT_BOX(accounts.window), _("Accounts")); + gnt_box_set_pad(GNT_BOX(accounts.window), 0); + gnt_widget_set_name(accounts.window, "accounts"); + + gnt_box_add_widget(GNT_BOX(accounts.window), + gnt_label_new(_("You can enable/disable accounts from the following list."))); + + accounts.tree = gnt_tree_new(); + GNT_WIDGET_SET_FLAGS(accounts.tree, GNT_WIDGET_NO_BORDER); + + for (iter = gaim_accounts_get_all(); iter; iter = iter->next) + { + GaimAccount *account = iter->data; + char *str = g_strdup_printf("%s (%s)", + gaim_account_get_username(account), gaim_account_get_protocol_id(account)); + + gnt_tree_add_choice(GNT_TREE(accounts.tree), account, + str, NULL, NULL); + gnt_tree_set_choice(GNT_TREE(accounts.tree), account, + gaim_account_get_enabled(account, GAIM_GNT_UI)); + g_free(str); + } + + g_signal_connect(G_OBJECT(accounts.tree), "toggled", G_CALLBACK(account_toggled), NULL); + + gnt_widget_set_size(accounts.tree, 40, 10); + gnt_box_add_widget(GNT_BOX(accounts.window), accounts.tree); + + box = gnt_box_new(FALSE, FALSE); + + button = gnt_button_new(_("Add")); + gnt_box_add_widget(GNT_BOX(box), button); + + button = gnt_button_new(_("Modify")); + gnt_box_add_widget(GNT_BOX(box), button); + + button = gnt_button_new(_("Delete")); + gnt_box_add_widget(GNT_BOX(box), button); + + gnt_box_add_widget(GNT_BOX(accounts.window), box); + + gnt_widget_show(accounts.window); +} + +void gg_accounts_uninit() +{ + gnt_widget_destroy(accounts.window); +} + +#if 0 +/* The following uiops stuff are copied from gtkaccount.c */ +/* Need to do some work on notify- and request-ui before this works */ +typedef struct +{ + GaimAccount *account; + char *username; + char *alias; +} AddUserData; + +static char * +make_info(GaimAccount *account, GaimConnection *gc, const char *remote_user, + const char *id, const char *alias, const char *msg) +{ + if (msg != NULL && *msg == '\0') + msg = NULL; + + return g_strdup_printf(_("%s%s%s%s has made %s his or her buddy%s%s"), + remote_user, + (alias != NULL ? " (" : ""), + (alias != NULL ? alias : ""), + (alias != NULL ? ")" : ""), + (id != NULL + ? id + : (gaim_connection_get_display_name(gc) != NULL + ? gaim_connection_get_display_name(gc) + : gaim_account_get_username(account))), + (msg != NULL ? ": " : "."), + (msg != NULL ? msg : "")); +} + +static void +notify_added(GaimAccount *account, const char *remote_user, + const char *id, const char *alias, + const char *msg) +{ + char *buffer; + GaimConnection *gc; + + gc = gaim_account_get_connection(account); + + buffer = make_info(account, gc, remote_user, id, alias, msg); + + gaim_notify_info(NULL, NULL, buffer, NULL); + + g_free(buffer); +} + +static void +request_add(GaimAccount *account, const char *remote_user, + const char *id, const char *alias, + const char *msg) +{ + char *buffer; + GaimConnection *gc; + AddUserData *data; + + gc = gaim_account_get_connection(account); + + data = g_new0(AddUserData, 1); + data->account = account; + data->username = g_strdup(remote_user); + data->alias = (alias != NULL ? g_strdup(alias) : NULL); + + buffer = make_info(account, gc, remote_user, id, alias, msg); +#if 0 + gaim_request_action(NULL, NULL, _("Add buddy to your list?"), + buffer, GAIM_DEFAULT_ACTION_NONE, data, 2, + _("Add"), G_CALLBACK(add_user_cb), + _("Cancel"), G_CALLBACK(free_add_user_data)); +#endif + g_free(buffer); +} + +static GaimAccountUiOps ui_ops = +{ + .notify_added = notify_added, + .status_changed = NULL, + .request_add = request_add +}; +#else + +static GaimAccountUiOps ui_ops = +{ + .notify_added = NULL, + .status_changed = NULL, + .request_add = NULL +}; + +#endif + +GaimAccountUiOps *gg_accounts_get_ui_ops() +{ + return &ui_ops; +} + Copied: branches/soc-2006-file-loggers/console/gntaccount.h (from rev 16464, trunk/console/gntaccount.h) =================================================================== --- branches/soc-2006-file-loggers/console/gntaccount.h (rev 0) +++ branches/soc-2006-file-loggers/console/gntaccount.h 2006-07-08 22:43:22 UTC (rev 16465) @@ -0,0 +1,7 @@ +#include "account.h" + +GaimAccountUiOps *gg_accounts_get_ui_ops(); + +void gg_accounts_init(); + +void gg_accounts_uninit(); Modified: branches/soc-2006-file-loggers/console/gntblist.c =================================================================== --- branches/soc-2006-file-loggers/console/gntblist.c 2006-07-08 22:08:51 UTC (rev 16464) +++ branches/soc-2006-file-loggers/console/gntblist.c 2006-07-08 22:43:22 UTC (rev 16465) @@ -141,7 +141,7 @@ GaimStatusPrimitive prim; GaimPresence *presence; GaimStatus *now; - + gboolean ascii = gnt_ascii_only(); presence = gaim_buddy_get_presence(buddy); now = gaim_presence_get_active_status(presence); @@ -150,29 +150,15 @@ switch(prim) { -#if 1 case GAIM_STATUS_OFFLINE: - strncpy(status, "x", sizeof(status) - 1); + strncpy(status, ascii ? "x" : "⊗", sizeof(status) - 1); break; case GAIM_STATUS_AVAILABLE: - strncpy(status, "o", sizeof(status) - 1); + strncpy(status, ascii ? "o" : "◯", sizeof(status) - 1); break; default: - strncpy(status, ".", sizeof(status) - 1); + strncpy(status, ascii ? "." : "⊖", sizeof(status) - 1); break; -#else - /* XXX: Let's use these some time */ - case GAIM_STATUS_OFFLINE: - strncpy(status, "⊗", sizeof(status) - 1); - break; - case GAIM_STATUS_AVAILABLE: - /* XXX: Detect idleness */ - strncpy(status, "◯", sizeof(status) - 1); - break; - default: - strncpy(status, "⊖", sizeof(status) - 1); - break; -#endif } name = gaim_buddy_get_alias(buddy); } @@ -217,6 +203,10 @@ node->ui_data = gnt_tree_add_row_after(GNT_TREE(ggblist->tree), buddy, get_display_name(node), group, NULL); + if (gaim_presence_is_idle(gaim_buddy_get_presence(buddy))) + gnt_tree_set_row_flags(GNT_TREE(ggblist->tree), buddy, GNT_TEXT_FLAG_DIM); + else + gnt_tree_set_row_flags(GNT_TREE(ggblist->tree), buddy, 0); } #if 0 @@ -355,6 +345,7 @@ gnt_box_add_widget(GNT_BOX(box), gnt_label_new(str->str)); gnt_widget_set_position(box, x, y); + GNT_WIDGET_UNSET_FLAGS(box, GNT_WIDGET_CAN_TAKE_FOCUS); gnt_widget_draw(box); g_free(title); @@ -371,7 +362,6 @@ draw_tooltip(ggblist); } - static gboolean key_pressed(GntWidget *widget, const char *text, GGBlist *ggblist) { @@ -390,13 +380,30 @@ } static void -buddy_status_changed(GaimBuddy *buddy, GaimStatus *old, GaimStatus *now, GGBlist *ggblist) +update_buddy_display(GaimBuddy *buddy, GGBlist *ggblist) { gnt_tree_change_text(GNT_TREE(ggblist->tree), buddy, get_display_name((GaimBlistNode*)buddy)); if (ggblist->tnode == (GaimBlistNode*)buddy) draw_tooltip(ggblist); + + if (gaim_presence_is_idle(gaim_buddy_get_presence(buddy))) + gnt_tree_set_row_flags(GNT_TREE(ggblist->tree), buddy, GNT_TEXT_FLAG_DIM); + else + gnt_tree_set_row_flags(GNT_TREE(ggblist->tree), buddy, 0); } +static void +buddy_status_changed(GaimBuddy *buddy, GaimStatus *old, GaimStatus *now, GGBlist *ggblist) +{ + update_buddy_display(buddy, ggblist); +} + +static void +buddy_idle_changed(GaimBuddy *buddy, int old, int new, GGBlist *ggblist) +{ + update_buddy_display(buddy, ggblist); +} + void gg_blist_init() { ggblist = g_new0(GGBlist, 1); @@ -411,13 +418,15 @@ ggblist->tree = gnt_tree_new(); GNT_WIDGET_SET_FLAGS(ggblist->tree, GNT_WIDGET_NO_BORDER); - gnt_widget_set_size(ggblist->tree, 25, getmaxy(stdscr) - 3); + gnt_widget_set_size(ggblist->tree, 25, getmaxy(stdscr) - 4); gnt_box_add_widget(GNT_BOX(ggblist->window), ggblist->tree); gnt_widget_show(ggblist->window); gaim_signal_connect(gaim_blist_get_handle(), "buddy-status-changed", gg_blist_get_handle(), GAIM_CALLBACK(buddy_status_changed), ggblist); + gaim_signal_connect(gaim_blist_get_handle(), "buddy-idle-changed", gg_blist_get_handle(), + GAIM_CALLBACK(buddy_idle_changed), ggblist); #if 0 gaim_signal_connect(gaim_blist_get_handle(), "buddy-signed-on", gg_blist_get_handle(), @@ -438,5 +447,36 @@ g_signal_connect(G_OBJECT(ggblist->tree), "selection_changed", G_CALLBACK(selection_changed), ggblist); g_signal_connect(G_OBJECT(ggblist->tree), "key_pressed", G_CALLBACK(key_pressed), ggblist); g_signal_connect(G_OBJECT(ggblist->tree), "activate", G_CALLBACK(selection_activate), ggblist); + g_signal_connect_data(G_OBJECT(ggblist->tree), "gained-focus", G_CALLBACK(draw_tooltip), + ggblist, 0, G_CONNECT_AFTER | G_CONNECT_SWAPPED); + g_signal_connect_data(G_OBJECT(ggblist->tree), "lost-focus", G_CALLBACK(remove_tooltip), + ggblist, 0, G_CONNECT_AFTER | G_CONNECT_SWAPPED); } +void gg_blist_uninit() +{ + gnt_widget_destroy(ggblist->window); + g_free(ggblist); + ggblist = NULL; +} + +void gg_blist_get_position(int *x, int *y) +{ + gnt_widget_get_position(ggblist->window, x, y); +} + +void gg_blist_set_position(int x, int y) +{ + gnt_widget_set_position(ggblist->window, x, y); +} + +void gg_blist_get_size(int *width, int *height) +{ + gnt_widget_get_size(ggblist->window, width, height); +} + +void gg_blist_set_size(int width, int height) +{ + gnt_widget_set_size(ggblist->window, width, height); +} + Modified: branches/soc-2006-file-loggers/console/gntblist.h =================================================================== --- branches/soc-2006-file-loggers/console/gntblist.h 2006-07-08 22:08:51 UTC (rev 16464) +++ branches/soc-2006-file-loggers/console/gntblist.h 2006-07-08 22:43:22 UTC (rev 16465) @@ -3,3 +3,14 @@ GaimBlistUiOps * gg_blist_get_ui_ops(); void gg_blist_init(); + +void gg_blist_uninit(); + +void gg_blist_get_position(int *x, int *y); + +void gg_blist_set_position(int x, int y); + +void gg_blist_get_size(int *width, int *height); + +void gg_blist_set_size(int width, int height); + Modified: branches/soc-2006-file-loggers/console/gntconv.c =================================================================== --- branches/soc-2006-file-loggers/console/gntconv.c 2006-07-08 22:08:51 UTC (rev 16464) +++ branches/soc-2006-file-loggers/console/gntconv.c 2006-07-08 22:43:22 UTC (rev 16465) @@ -2,6 +2,7 @@ #include <util.h> #include "gntgaim.h" +#include "gntblist.h" #include "gntconv.h" #include "gnt.h" @@ -91,10 +92,14 @@ GGConv *ggc = g_hash_table_lookup(ggconvs, conv); char *title; GaimConversationType type; + int x, width; if (ggc) return; + gg_blist_get_position(&x, NULL); + gg_blist_get_size(&width, NULL); + ggc = g_new0(GGConv, 1); g_hash_table_insert(ggconvs, conv, ggc); @@ -102,25 +107,28 @@ type = gaim_conversation_get_type(conv); title = g_strdup_printf(_("%s"), gaim_conversation_get_name(conv)); - ggc->window = gnt_box_new(FALSE, TRUE); + ggc->window = gnt_box_new(TRUE, TRUE); gnt_box_set_title(GNT_BOX(ggc->window), title); gnt_box_set_toplevel(GNT_BOX(ggc->window), TRUE); + gnt_box_set_pad(GNT_BOX(ggc->window), 0); gnt_widget_set_name(ggc->window, title); ggc->tv = gnt_text_view_new(); gnt_box_add_widget(GNT_BOX(ggc->window), ggc->tv); gnt_widget_set_name(ggc->tv, "conversation-window-textview"); - gnt_widget_set_size(ggc->tv, getmaxx(stdscr) - 40, getmaxy(stdscr) - 15); + gnt_widget_set_size(ggc->tv, getmaxx(stdscr) - 3 - x - width, getmaxy(stdscr) - 5); ggc->entry = gnt_entry_new(NULL); gnt_box_add_widget(GNT_BOX(ggc->window), ggc->entry); gnt_widget_set_name(ggc->entry, "conversation-window-entry"); - gnt_widget_set_size(ggc->entry, getmaxx(stdscr) - 40, 1); g_signal_connect(G_OBJECT(ggc->entry), "key_pressed", G_CALLBACK(entry_key_pressed), ggc); g_signal_connect(G_OBJECT(ggc->window), "destroy", G_CALLBACK(closing_window), ggc); - gnt_widget_set_position(ggc->window, 32, 0); + /* XXX: I am assuming the buddylist is on the leftmost corner. + * That may not always be correct, since the windows can be moved. + * It might be an option to remember the position of conv. windows. */ + gnt_widget_set_position(ggc->window, x + width, 0); gnt_widget_show(ggc->window); g_free(title); @@ -138,7 +146,7 @@ { GGConv *ggconv = g_hash_table_lookup(ggconvs, conv); char *strip; - GntTextViewFlags fl = 0; + GntTextFormatFlags fl = 0; g_return_if_fail(ggconv != NULL); @@ -165,7 +173,8 @@ g_free(strip); - gnt_widget_set_urgent(ggconv->tv); + if (flags & (GAIM_MESSAGE_RECV | GAIM_MESSAGE_NICK | GAIM_MESSAGE_ERROR)) + gnt_widget_set_urgent(ggconv->tv); } static void @@ -261,3 +270,9 @@ ggconvs = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, destroy_ggconv); } +void gg_conversation_uninit() +{ + g_hash_table_destroy(ggconvs); + ggconvs = NULL; +} + Modified: branches/soc-2006-file-loggers/console/gntconv.h =================================================================== --- branches/soc-2006-file-loggers/console/gntconv.h 2006-07-08 22:08:51 UTC (rev 16464) +++ branches/soc-2006-file-loggers/console/gntconv.h 2006-07-08 22:43:22 UTC (rev 16465) @@ -3,3 +3,5 @@ GaimConversationUiOps *gg_conv_get_ui_ops(); void gg_conversation_init(); + +void gg_conversation_uninit(); Modified: branches/soc-2006-file-loggers/console/gntgaim.c =================================================================== --- branches/soc-2006-file-loggers/console/gntgaim.c 2006-07-08 22:08:51 UTC (rev 16464) +++ branches/soc-2006-file-loggers/console/gntgaim.c 2006-07-08 22:43:22 UTC (rev 16465) @@ -18,6 +18,9 @@ #include "gntgaim.h" #include "gntui.h" +#define _GNU_SOURCE +#include <getopt.h> + /* Anything IO-related is directly copied from gtkgaim's source tree */ static GaimCoreUiOps core_ops = @@ -103,12 +106,6 @@ closure->result = g_io_add_watch_full(channel, G_PRIORITY_DEFAULT, cond, gaim_gtk_io_invoke, closure, gaim_gtk_io_destroy); -#if 0 - gaim_debug(GAIM_DEBUG_MISC, "gtk_eventloop", - "CLOSURE: adding input watcher %d for fd %d\n", - closure->result, fd); -#endif - g_io_channel_unref(channel); return closure->result; } @@ -129,25 +126,124 @@ /* This is mostly copied from gtkgaim's source tree */ static void -init_libgaim() +show_usage(const char *name, gboolean terse) { + char *text; + + if (terse) { + text = g_strdup_printf(_("Gaim %s. Try `%s -h' for more information.\n"), VERSION, name); + } else { + text = g_strdup_printf(_("Gaim %s\n" + "Usage: %s [OPTION]...\n\n" + " -c, --config=DIR use DIR for config files\n" + " -d, --debug print debugging messages to stdout\n" + " -h, --help display this help and exit\n" + " -n, --nologin don't automatically login\n" + " -v, --version display the current version and exit\n"), VERSION, name); + } + + gaim_print_utf8_to_console(stdout, text); + g_free(text); +} + +static int +init_libgaim(int argc, char **argv) +{ char *path; + int opt; + gboolean opt_help = FALSE; + gboolean opt_nologin = FALSE; + gboolean opt_version = FALSE; + char *opt_config_dir_arg = NULL; + char *opt_session_arg = NULL; + gboolean debug_enabled = FALSE; - gaim_debug_set_enabled(FALSE); + struct option long_options[] = { + {"config", required_argument, NULL, 'c'}, + {"debug", no_argument, NULL, 'd'}, + {"help", no_argument, NULL, 'h'}, + {"nologin", no_argument, NULL, 'n'}, + {"session", required_argument, NULL, 's'}, + {"version", no_argument, NULL, 'v'}, + {0, 0, 0, 0} + }; + /* scan command-line options */ + opterr = 1; + while ((opt = getopt_long(argc, argv, +#ifndef _WIN32 + "c:dhn::s:v", +#else + "c:dhn::v", +#endif + long_options, NULL)) != -1) { + switch (opt) { + case 'c': /* config dir */ + g_free(opt_config_dir_arg); + opt_config_dir_arg = g_strdup(optarg); + break; + case 'd': /* debug */ + debug_enabled = TRUE; + break; + case 'h': /* help */ + opt_help = TRUE; + break; + case 'n': /* no autologin */ + opt_nologin = TRUE; + break; + case 's': /* use existing session ID */ + g_free(opt_session_arg); + opt_session_arg = g_strdup(optarg); + break; + case 'v': /* version */ + opt_version = TRUE; + break; + case '?': /* show terse help */ + default: + show_usage(argv[0], TRUE); + return 0; + break; + } + } + + /* show help message */ + if (opt_help) { + show_usage(argv[0], FALSE); + return 0; + } + /* show version message */ + if (opt_version) { + printf("Gaim %s\n", VERSION); + return 0; + } + + /* set a user-specified config directory */ + if (opt_config_dir_arg != NULL) { + gaim_util_set_user_dir(opt_config_dir_arg); + } + + /* + * We're done piddling around with command line arguments. + * Fire up this baby. + */ + + /* Because we don't want debug-messages to show up and corrup the display */ + gaim_debug_set_enabled(debug_enabled); + gaim_core_set_ui_ops(gnt_core_get_ui_ops()); gaim_eventloop_set_ui_ops(gnt_eventloop_get_ui_ops()); - gaim_util_set_user_dir("/tmp/tmp/"); /* XXX: */ - path = g_build_filename(gaim_user_dir(), "plugins", NULL); gaim_plugins_add_search_path(path); g_free(path); + gaim_plugins_add_search_path("/usr/local/lib/gaim"); /* XXX: */ if (!gaim_core_init(GAIM_GNT_UI)) { - fprintf(stderr, "OOPSSS!!\n"); + fprintf(stderr, + "Initialization of the Gaim core failed. Dumping core.\n" + "Please report this!\n"); abort(); } @@ -160,11 +256,36 @@ gaim_prefs_update_old(); /* load plugins we had when we quit */ - gaim_plugins_load_saved("/gaim/gtk/plugins/loaded"); + gaim_plugins_load_saved("/gaim/gnt/plugins/loaded"); /* TODO: Move pounces loading into gaim_pounces_init() */ gaim_pounces_load(); + if (opt_nologin) + { + /* Set all accounts to "offline" */ + GaimSavedStatus *saved_status; + + /* If we've used this type+message before, lookup the transient status */ + saved_status = gaim_savedstatus_find_transient_by_type_and_message( + GAIM_STATUS_OFFLINE, NULL); + + /* If this type+message is unique then create a new transient saved status */ + if (saved_status == NULL) + saved_status = gaim_savedstatus_new(NULL, GAIM_STATUS_OFFLINE); + + /* Set the status for each account */ + gaim_savedstatus_activate(saved_status); + } + else + { + /* Everything is good to go--sign on already */ + if (!gaim_prefs_get_bool("/core/savedstatus/startup_current_status")) + gaim_savedstatus_activate(gaim_savedstatus_get_startup()); + gaim_accounts_restore_current_statuses(); + } + + return 1; } int main(int argc, char **argv) @@ -173,12 +294,10 @@ freopen(".error", "w", stderr); /* Initialize the libgaim stuff */ - init_libgaim(); + if (!init_libgaim(argc, argv)) + return 0; - /* Enable the accounts and restore the status */ - gaim_accounts_restore_current_statuses(); - - /* Initialize the UI */ + /* Initialize and run the UI */ init_gnt_ui(); gaim_core_quit(); Modified: branches/soc-2006-file-loggers/console/gntui.c =================================================================== --- branches/soc-2006-file-loggers/console/gntui.c 2006-07-08 22:08:51 UTC (rev 16464) +++ branches/soc-2006-file-loggers/console/gntui.c 2006-07-08 22:43:22 UTC (rev 16465) @@ -1,4 +1,6 @@ #include "gntui.h" + +#include "gntaccount.h" #include "gntblist.h" #include "gntconv.h" @@ -6,9 +8,9 @@ { gnt_init(); - wbkgdset(stdscr, '\0' | COLOR_PAIR(GNT_COLOR_NORMAL)); - werase(stdscr); - wrefresh(stdscr); + /* Accounts */ + gg_accounts_init(); + gaim_accounts_set_ui_ops(gg_accounts_get_ui_ops()); /* Initialize the buddy list */ gg_blist_init(); @@ -19,5 +21,16 @@ gaim_conversations_set_ui_ops(gg_conv_get_ui_ops()); gnt_main(); + + gaim_accounts_set_ui_ops(NULL); + gg_accounts_uninit(); + + gaim_blist_set_ui_ops(NULL); + gg_blist_uninit(); + + gaim_conversations_set_ui_ops(NULL); + gg_conversation_uninit(); + + gnt_quit(); } Modified: branches/soc-2006-file-loggers/console/libgnt/Makefile.am =================================================================== --- branches/soc-2006-file-loggers/console/libgnt/Makefile.am 2006-07-08 22:08:51 UTC (rev 16464) +++ branches/soc-2006-file-loggers/console/libgnt/Makefile.am 2006-07-08 22:43:22 UTC (rev 16465) @@ -37,7 +37,8 @@ libgnt_la_LIBADD = \ $(GLIB_LIBS) \ $(STATIC_LINK_LIBS) \ - -lncursesw + -lncursesw -lpanelw AM_CPPFLAGS = \ - $(GLIB_CFLAGS) + $(GLIB_CFLAGS) \ + -Wall Modified: branches/soc-2006-file-loggers/console/libgnt/configure.ac =================================================================== --- branches/soc-2006-file-loggers/console/libgnt/configure.ac 2006-07-08 22:08:51 UTC (rev 16464) +++ branches/soc-2006-file-loggers/console/libgnt/configure.ac 2006-07-08 22:43:22 UTC (rev 16465) @@ -239,6 +239,8 @@ AC_CHECK_HEADERS(termios.h) #AC_VAR_TIMEZONE_EXTERNALS +AC_CHECK_LIB(ncursesw, initscr, , [AC_MSG_ERROR([ +*** You need ncursesw. ])]) AC_OUTPUT([Makefile gnt.pc Modified: branches/soc-2006-file-loggers/console/libgnt/gnt.h =================================================================== --- branches/soc-2006-file-loggers/console/libgnt/gnt.h 2006-07-08 22:08:51 UTC (rev 16464) +++ branches/soc-2006-file-loggers/console/libgnt/gnt.h 2006-07-08 22:43:22 UTC (rev 16465) @@ -7,6 +7,8 @@ void gnt_main(); +gboolean gnt_ascii_only(); + void gnt_screen_occupy(GntWidget *widget); void gnt_screen_release(GntWidget *widget); @@ -18,3 +20,6 @@ gboolean gnt_widget_has_focus(GntWidget *widget); void gnt_widget_set_urgent(GntWidget *widget); + +void gnt_quit(); + Modified: branches/soc-2006-file-loggers/console/libgnt/gntbox.c =================================================================== --- branches/soc-2006-file-loggers/console/libgnt/gntbox.c 2006-07-08 22:08:51 UTC (rev 16464) +++ branches/soc-2006-file-loggers/console/libgnt/gntbox.c 2006-07-08 22:43:22 UTC (rev 16465) @@ -13,10 +13,25 @@ static GntWidget * find_focusable_widget(GntBox *box); static void +add_to_focus(gpointer value, gpointer data) +{ + GntBox *box = GNT_BOX(data); + GntWidget *w = GNT_WIDGET(value); + + if (GNT_IS_BOX(w)) + g_list_foreach(GNT_BOX(w)->list, add_to_focus, box); + else if (GNT_WIDGET_IS_FLAG_SET(w, GNT_WIDGET_CAN_TAKE_FOCUS)) + box->focus = g_list_append(box->focus, w); +} + +static void gnt_box_draw(GntWidget *widget) { GntBox *box = GNT_BOX(widget); + if (box->focus == NULL && widget->parent == NULL) + g_list_foreach(box->list, add_to_focus, box); + g_list_foreach(box->list, (GFunc)gnt_widget_draw, NULL); gnt_box_sync_children(box); @@ -24,24 +39,29 @@ if (box->title) { gchar *title = g_strdup(box->title); - int pos = g_utf8_strlen(title, -1); + int pos = g_utf8_strlen(title, -1), right; - if (pos >= widget->priv.width - 2) + if (pos >= widget->priv.width - 4) { - g_utf8_strncpy(title, box->title, widget->priv.width - 2); - pos = 1; + g_utf8_strncpy(title, box->title, widget->priv.width - 4); + pos = 2; + right = pos + g_utf8_strlen(title, -1); } else { /* XXX: Position of the title might be configurable */ + right = pos; pos = (widget->priv.width - pos) / 2; + right += pos; } 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)); + mvwaddch(widget->window, 0, pos-1, ACS_RTEE | COLOR_PAIR(GNT_COLOR_NORMAL)); mvwprintw(widget->window, 0, pos, title); + mvwaddch(widget->window, 0, right, ACS_LTEE | COLOR_PAIR(GNT_COLOR_NORMAL)); g_free(title); } @@ -152,102 +172,17 @@ 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 GntWidget * find_focusable_widget(GntBox *box) { - int investigated = 0; - int total; - GntWidget *w = NULL; - GList *iter; + if (box->focus == NULL && GNT_WIDGET(box)->parent == NULL) + g_list_foreach(box->list, add_to_focus, box); - 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 (box->active == NULL && box->focus) + box->active = box->focus->data; - 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, GNT_WIDGET_CAN_TAKE_FOCUS)) - { - box->active = box->active->next; - investigated++; - } - - /* Rotate if necessary */ - if (!box->active && investigated < total) - { - box->active = box->list; - while (investigated < total && !GNT_WIDGET_IS_FLAG_SET(box->active->data, GNT_WIDGET_CAN_TAKE_FOCUS)) - { - box->active = box->active->next; - 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 @@ -263,93 +198,60 @@ if (text[0] == 27) { -#if 0 - GList *now = NULL; + GntWidget *now = box->active; if (strcmp(text+1, GNT_KEY_LEFT) == 0) { - now = box->active->prev; - if (now == NULL) - now = g_list_last(box->list); + GList *iter = g_list_find(box->focus, box->active); + if ((!iter || !iter->prev) && box->focus) + { + box->active = box->focus->data; + } + else + { + box->active = iter->prev->data; + } } else if (strcmp(text+1, GNT_KEY_RIGHT) == 0) { - now = box->active->next; - if (now == NULL) - now = box->list; + GList *iter = g_list_find(box->focus, box->active); + if (iter && iter->next) + { + box->active = iter->next->data; + } + else if (box->focus) + { + box->active = box->focus->data; + } } if (now && now != box->active) { - gnt_widget_set_focus(box->active->data, FALSE); - box->active = now; - gnt_widget_set_focus(box->active->data, TRUE); - + gnt_widget_set_focus(now, FALSE); + gnt_widget_set_focus(box->active, TRUE); return TRUE; } -#endif } return FALSE; } -static GntWidget *find_focused_widget(GntBox *box) -{ - GList *iter; - - for (iter = box->list; iter; iter = iter->next) - { - GntWidget *w = iter->data; - - if (GNT_IS_BOX(w)) - { - if ((w = find_focused_widget(GNT_BOX(w))) != NULL) - return w; - } - else - { - if (GNT_WIDGET_IS_FLAG_SET(w, GNT_WIDGET_CAN_TAKE_FOCUS) && - GNT_WIDGET_IS_FLAG_SET(w, GNT_WIDGET_HAS_FOCUS)) - return w; - } - } - return NULL; -} - -#if 0 static void -gnt_box_set_focus(GntWidget *widget, gboolean set) +gnt_box_lost_focus(GntWidget *widget) { - GntWidget *p = widget; - - while (p->parent) - p = p->parent; - - p = find_focused_widget(GNT_BOX(p)); - if (p) - gnt_widget_set_focus(p, set); + GntWidget *w = GNT_BOX(widget)->active; + if (w) + gnt_widget_set_focus(w, FALSE); 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); + GntWidget *w = GNT_BOX(widget)->active; + if (w) + gnt_widget_set_focus(w, TRUE); + gnt_widget_draw(widget); } -#endif static void gnt_box_destroy(GntWidget *w) @@ -376,6 +278,33 @@ delwin(win); } +static gboolean +gnt_box_confirm_size(GntWidget *widget, int width, int height) +{ + GList *iter; + GntBox *box = GNT_BOX(widget); + int wchange, hchange; + + wchange = widget->priv.width - width; + hchange = widget->priv.height - height; + + /* XXX: Right now, I am trying to just apply all the changes to + * just one widget. It should be possible to distribute the + * changes to all the widgets in the box. */ + for (iter = box->list; iter; iter = iter->next) + { + GntWidget *wid = iter->data; + int w, h; + + gnt_widget_get_size(wid, &w, &h); + + if (gnt_widget_set_size(wid, w - wchange, h - hchange)) + return TRUE; + } + + return FALSE; +} + static void gnt_box_class_init(GntBoxClass *klass) { @@ -387,11 +316,9 @@ 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 + parent_class->confirm_size = gnt_box_confirm_size; DEBUG; } @@ -399,6 +326,9 @@ static void gnt_box_init(GTypeInstance *instance, gpointer class) { + /* Initially make both the height and width resizable. + * Update the flags as necessary when widgets are added to it. */ + GNT_WIDGET_SET_FLAGS(GNT_WIDGET(instance), GNT_WIDGET_GROW_X | GNT_WIDGET_GROW_Y); DEBUG; } @@ -450,6 +380,17 @@ { b->list = g_list_append(b->list, widget); widget->parent = GNT_WIDGET(b); + + if (b->vertical) + { + if (!GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_GROW_X)) + GNT_WIDGET_UNSET_FLAGS(GNT_WIDGET(b), GNT_WIDGET_GROW_X); + } + else + { + if (!GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_GROW_Y)) + GNT_WIDGET_UNSET_FLAGS(GNT_WIDGET(b), GNT_WIDGET_GROW_Y); + } } void gnt_box_set_title(GntBox *b, const char *title) @@ -468,9 +409,15 @@ { GntWidget *widget = GNT_WIDGET(box); if (set) + { GNT_WIDGET_UNSET_FLAGS(widget, GNT_WIDGET_NO_BORDER | GNT_WIDGET_NO_SHADOW); + GNT_WIDGET_SET_FLAGS(widget, GNT_WIDGET_CAN_TAKE_FOCUS); + } else + { GNT_WIDGET_SET_FLAGS(widget, GNT_WIDGET_NO_BORDER | GNT_WIDGET_NO_SHADOW); + GNT_WIDGET_UNSET_FLAGS(widget, GNT_WIDGET_CAN_TAKE_FOCUS); + } } void gnt_box_sync_children(GntBox *box) @@ -483,11 +430,18 @@ for (iter = box->list; iter; iter = iter->next) { GntWidget *w = GNT_WIDGET(iter->data); + int height, width; + + if (GNT_IS_BOX(w)) + gnt_box_sync_children(GNT_BOX(w)); + + gnt_widget_get_size(w, &width, &height); + copywin(w->window, widget->window, 0, 0, w->priv.y - widget->priv.y, w->priv.x - widget->priv.x, - w->priv.y - widget->priv.y + w->priv.height - 1, - w->priv.x - widget->priv.x + w->priv.width - 1, + w->priv.y - widget->priv.y + height - 1, + w->priv.x - widget->priv.x + width - 1, FALSE); } } Modified: branches/soc-2006-file-loggers/console/libgnt/gntbox.h =================================================================== --- branches/soc-2006-file-loggers/console/libgnt/gntbox.h 2006-07-08 22:08:51 UTC (rev 16464) +++ branches/soc-2006-file-loggers/console/libgnt/gntbox.h 2006-07-08 22:43:22 UTC (rev 16465) @@ -26,6 +26,7 @@ int pad; /* Number of spaces to use between widgets */ char *title; + GList *focus; /* List of widgets to cycle focus (only valid for parent boxes) */ void (*gnt_reserved1)(void); void (*gnt_reserved2)(void); Modified: branches/soc-2006-file-loggers/console/libgnt/gntbutton.c =================================================================== --- branches/soc-2006-file-loggers/console/libgnt/gntbutton.c 2006-07-08 22:08:51 UTC (rev 16464) +++ branches/soc-2006-file-loggers/console/libgnt/gntbutton.c 2006-07-08 22:43:22 UTC (rev 16465) @@ -16,10 +16,11 @@ GntButton *button = GNT_BUTTON(widget); GntColorType type; - if (GNT_WIDGET_FLAGS(widget) & GNT_WIDGET_HAS_FOCUS) + if (gnt_widget_has_focus(widget)) type = GNT_COLOR_HIGHLIGHT; else type = GNT_COLOR_NORMAL; + wbkgdset(widget->window, '\0' | COLOR_PAIR(type)); mvwprintw(widget->window, 1, 1, button->priv->text); @@ -70,6 +71,8 @@ { GntButton *button = GNT_BUTTON(instance); button->priv = g_new0(GntButtonPriv, 1); + + GNT_WIDGET_SET_FLAGS(GNT_WIDGET(button), GNT_WIDGET_GROW_X); /* Can be resized sideways */ DEBUG; } Modified: branches/soc-2006-file-loggers/console/libgnt/gntcolors.c =================================================================== --- branches/soc-2006-file-loggers/console/libgnt/gntcolors.c 2006-07-08 22:08:51 UTC (rev 16464) +++ branches/soc-2006-file-loggers/console/libgnt/gntcolors.c 2006-07-08 22:43:22 UTC (rev 16465) @@ -29,10 +29,11 @@ else { init_pair(GNT_COLOR_NORMAL, COLOR_BLACK, COLOR_WHITE); - init_pair(GNT_COLOR_HIGHLIGHT, COLOR_YELLOW, COLOR_BLACK); + init_pair(GNT_COLOR_HIGHLIGHT, COLOR_WHITE, COLOR_BLUE); init_pair(GNT_COLOR_SHADOW, COLOR_BLACK, COLOR_BLACK); - init_pair(GNT_COLOR_TITLE, COLOR_WHITE, COLOR_BLACK); - init_pair(GNT_COLOR_TEXT_NORMAL, COLOR_BLACK, COLOR_WHITE); + init_pair(GNT_COLOR_TITLE, COLOR_WHITE, COLOR_BLUE); + init_pair(GNT_COLOR_TITLE_D, COLOR_WHITE, COLOR_BLACK); + init_pair(GNT_COLOR_TEXT_NORMAL, COLOR_WHITE, COLOR_BLUE); init_pair(GNT_COLOR_HIGHLIGHT_D, COLOR_CYAN, COLOR_BLACK); init_pair(GNT_COLOR_DISABLED, COLOR_YELLOW, COLOR_WHITE); } Modified: branches/soc-2006-file-loggers/console/libgnt/gntentry.c =================================================================== --- branches/soc-2006-file-loggers/console/libgnt/gntentry.c 2006-07-08 22:08:51 UTC (rev 16464) +++ branches/soc-2006-file-loggers/console/libgnt/gntentry.c 2006-07-08 22:43:22 UTC (rev 16465) @@ -173,6 +173,7 @@ GNT_WIDGET_SET_FLAGS(GNT_WIDGET(entry), GNT_WIDGET_NO_BORDER | GNT_WIDGET_NO_SHADOW | GNT_WIDGET_CAN_TAKE_FOCUS); + GNT_WIDGET_SET_FLAGS(GNT_WIDGET(entry), GNT_WIDGET_GROW_X); DEBUG; } Modified: branches/soc-2006-file-loggers/console/libgnt/gntlabel.c =================================================================== --- branches/soc-2006-file-loggers/console/libgnt/gntlabel.c 2006-07-08 22:08:51 UTC (rev 16464) +++ branches/soc-2006-file-loggers/console/libgnt/gntlabel.c 2006-07-08 22:43:22 UTC (rev 16465) @@ -70,6 +70,7 @@ static void gnt_label_init(GTypeInstance *instance, gpointer class) { + GNT_WIDGET_SET_FLAGS(GNT_WIDGET(instance), GNT_WIDGET_GROW_X | GNT_WIDGET_GROW_Y); DEBUG; } Modified: branches/soc-2006-file-loggers/console/libgnt/gntmain.c =================================================================== --- branches/soc-2006-file-loggers/console/libgnt/gntmain.c 2006-07-08 22:08:51 UTC (rev 16464) +++ branches/soc-2006-file-loggers/console/libgnt/gntmain.c 2006-07-08 22:43:22 UTC (rev 16465) @@ -1,3 +1,5 @@ +#include <panel.h> + #include "gnt.h" #include "gntbox.h" #include "gntkeys.h" @@ -2,2 +4,3 @@ #include "gntcolors.h" +#include "gnttree.h" @@ -9,28 +12,60 @@ #include <unistd.h> #include <string.h> +static int lock_focus_list; static GList *focus_list; -static int max_x; -static int max_y; +static int X_MIN; +static int X_MAX; +static int Y_MIN; +static int Y_MAX; + +static gboolean ascii_only; + +static GMainLoop *loop; +static struct +{ + GntWidget *window; + GntWidget *tree; +} window_list; + typedef struct { GntWidget *me; - GList *below; /* List of widgets below me */ - GList *above; /* List of widgets above me */ + + PANEL *panel; } GntNode; +typedef enum +{ + GNT_KP_MODE_NORMAL, + GNT_KP_MODE_RESIZE, + GNT_KP_MODE_MOVE, + GNT_KP_MODE_MENU, + GNT_KP_MODE_WINDOW_LIST +} GntKeyPressMode; + static GHashTable *nodes; static void free_node(gpointer data); static void draw_taskbar(); +static void bring_on_top(GntWidget *widget); void gnt_screen_take_focus(GntWidget *widget) { GntWidget *w = NULL; + + if (lock_focus_list) + return; + if (focus_list) w = focus_list->data; - focus_list = g_list_prepend(focus_list, widget); + + /* XXX: ew */ + focus_list = g_list_first(focus_list); + focus_list = g_list_append(focus_list, widget); + focus_list = g_list_find(focus_list, widget); + gnt_widget_set_focus(widget, TRUE); if (w) gnt_widget_set_focus(w, FALSE); @@ -39,11 +74,24 @@ void gnt_screen_remove_widget(GntWidget *widget) { + int pos = g_list_index(g_list_first(focus_list), widget); + GList *next; + + if (lock_focus_list) + return; + + if (pos == -1) + return; + + focus_list = g_list_first(focus_list); focus_list = g_list_remove(focus_list, widget); + next = g_list_nth(focus_list, pos - 1); + if (next) + focus_list = next; + if (focus_list) { - gnt_widget_set_focus(focus_list->data, TRUE); - gnt_widget_draw(focus_list->data); + bring_on_top(focus_list->data); } draw_taskbar(); } @@ -52,29 +100,49 @@ bring_on_top(GntWidget *widget) { GntNode *node = g_hash_table_lookup(nodes, widget); - GList *iter; + g_return_if_fail(focus_list->data == widget); + if (!node) return; - for (iter = node->above; iter;) + gnt_widget_set_focus(focus_list->data, TRUE); + gnt_widget_draw(focus_list->data); + + top_panel(node->panel); + + if (window_list.window) { - 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); + GntNode *nd = g_hash_table_lookup(nodes, window_list.window); + top_panel(nd->panel); } + update_panels(); + doupdate(); + draw_taskbar(); } static void +update_window_in_list(GntWidget *wid) +{ + GntTextFormatFlags flag = 0; + + if (window_list.window == NULL) + return; + + if (wid == focus_list->data) + flag |= GNT_TEXT_FLAG_DIM; + else if (GNT_WIDGET_IS_FLAG_SET(wid, GNT_WIDGET_URGENT)) + flag |= GNT_TEXT_FLAG_BOLD; + + gnt_tree_set_row_flags(GNT_TREE(window_list.tree), wid, flag); +} + +static void draw_taskbar() { static WINDOW *taskbar = NULL; GList *iter; - int n, width; + int n, width = 0; int i; if (taskbar == NULL) @@ -82,6 +150,7 @@ taskbar = newwin(1, getmaxx(stdscr), getmaxy(stdscr) - 1, 0); } + wbkgdset(taskbar, '\0' | COLOR_PAIR(GNT_COLOR_NORMAL)); werase(taskbar); n = g_list_length(g_list_first(focus_list)); @@ -111,15 +180,106 @@ 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); + + update_window_in_list(w); } wrefresh(taskbar); } +static void +switch_window(int direction) +{ + GntWidget *w = NULL; + if (focus_list) + w = focus_list->data; + + if (direction == 1) + { + if (focus_list && focus_list->next) + focus_list = focus_list->next; + else + focus_list = g_list_first(focus_list); + } + else if (direction == -1) + { + if (focus_list && focus_list->prev) + focus_list = focus_list->prev; + else + focus_list = g_list_last(focus_list); + } + + if (focus_list) + { + bring_on_top(focus_list->data); + } + + if (w && (!focus_list || w != focus_list->data)) + { + gnt_widget_set_focus(w, FALSE); + } +} + +static void +window_list_activate(GntTree *tree, gpointer null) +{ + GntWidget *widget = gnt_tree_get_selection_data(GNT_TREE(tree)); + GntWidget *old = NULL; + + if (focus_list) + old = focus_list->data; + + focus_list = g_list_find(g_list_first(focus_list), widget); + bring_on_top(widget); + + if (old && (!focus_list || old != focus_list->data)) + { + gnt_widget_set_focus(old, FALSE); + } +} + +static void +show_window_list() +{ + GntWidget *tree, *win; + GList *iter; + + if (window_list.window) + return; + + win = window_list.window = gnt_box_new(FALSE, FALSE); + gnt_box_set_toplevel(GNT_BOX(win), TRUE); + gnt_box_set_title(GNT_BOX(win), "Window List"); + gnt_box_set_pad(GNT_BOX(win), 0); + + tree = window_list.tree = gnt_tree_new(); + + for (iter = g_list_first(focus_list); iter; iter = iter->next) + { + GntBox *box = GNT_BOX(iter->data); + + gnt_tree_add_row_after(GNT_TREE(tree), box, box->title, NULL, NULL); + update_window_in_list(GNT_WIDGET(box)); + } + + gnt_box_add_widget(GNT_BOX(win), tree); + + gnt_widget_set_size(tree, getmaxx(stdscr) / 3, getmaxy(stdscr) / 2); + gnt_widget_set_position(win, getmaxx(stdscr) / 3, getmaxy(stdscr) / 4); + + lock_focus_list = 1; + gnt_widget_show(win); + lock_focus_list = 0; + + g_signal_connect(G_OBJECT(tree), "activate", G_CALLBACK(window_list_activate), NULL); +} + static gboolean io_invoke(GIOChannel *source, GIOCondition cond, gpointer null) { char buffer[256]; + gboolean ret = FALSE; + static GntKeyPressMode mode = GNT_KP_MODE_NORMAL; int rd = read(0, buffer, sizeof(buffer) - 1); if (rd < 0) @@ -137,56 +297,197 @@ buffer[rd] = 0; - if (focus_list) + if (mode == GNT_KP_MODE_NORMAL) { - gboolean ret = FALSE; - ret = gnt_widget_key_pressed(focus_list->data, buffer); + if (focus_list) + { + ret = gnt_widget_key_pressed(focus_list->data, buffer); + } + + if (!ret) + { + if (buffer[0] == 27) + { + /* Some special key has been pressed */ + if (strcmp(buffer+1, GNT_KEY_POPUP) == 0) + {} + else if (strcmp(buffer + 1, "c") == 0) + { + /* Alt + c was pressed. I am going to use it to close a window. */ + if (focus_list) + { + gnt_widget_destroy(focus_list->data); + } + } + else if (strcmp(buffer + 1, "q") == 0) + { + /* I am going to use Alt + q to quit. */ + g_main_loop_quit(loop); + } + else if (strcmp(buffer + 1, "n") == 0) + { + /* Alt + n to go to the next window */ + switch_window(1); + } + else if (strcmp(buffer + 1, "p") == 0) + { + /* Alt + p to go to the previous window */ + switch_window(-1); + } + else if (strcmp(buffer + 1, "m") == 0 && focus_list) + { + /* Move a window */ + mode = GNT_KP_MODE_MOVE; + } + else if (strcmp(buffer + 1, "w") == 0 && focus_list) + { + /* Window list */ + mode = GNT_KP_MODE_WINDOW_LIST; + show_window_list(); + } + else if (strcmp(buffer + 1, "r") == 0 && focus_list) + { + /* Resize window */ + mode = GNT_KP_MODE_RESIZE; + } + } + } } - - if (buffer[0] == 27) + else if (mode == GNT_KP_MODE_MOVE && focus_list) { - /* Some special key has been pressed */ - if (strcmp(buffer+1, GNT_KEY_POPUP) == 0) - {} - else if (strcmp(buffer + 1, "c") == 0) + if (buffer[0] == 27) { - /* Alt + c was pressed. I am going to use it to close a window. */ - if (focus_list) + gboolean changed = FALSE; + int x, y, w, h; + GntWidget *widget = GNT_WIDGET(focus_list->data); + + gnt_widget_get_position(widget, &x, &y); + gnt_widget_get_size(widget, &w, &h); + + if (strcmp(buffer + 1, GNT_KEY_LEFT) == 0) { - gnt_widget_destroy(focus_list->data); - gnt_screen_remove_widget(focus_list->data); + if (x > X_MIN) + { + x--; + changed = TRUE; + } } + else if (strcmp(buffer + 1, GNT_KEY_RIGHT) == 0) + { + if (x + w < X_MAX) + { + x++; + changed = TRUE; + } + } + else if (strcmp(buffer + 1, GNT_KEY_UP) == 0) + { + if (y > Y_MIN) + { + y--; + changed = TRUE; + } + } + else if (strcmp(buffer + 1, GNT_KEY_DOWN) == 0) + { + if (y + h < Y_MAX) + { + y++; + changed = TRUE; + } + } + else if (buffer[1] == 0) + { + mode = GNT_KP_MODE_NORMAL; + changed = TRUE; + } + + if (changed) + { + GntNode *node = g_hash_table_lookup(nodes, widget); + gnt_widget_set_position(widget, x, y); + move_panel(node->panel, y, x); + update_panels(); + doupdate(); + } } - else if (strcmp(buffer + 1, "q") == 0) + else if (*buffer == '\r') { - /* I am going to use Alt + q to quit. */ - endwin(); - exit(1); + mode = GNT_KP_MODE_NORMAL; } - else if (strcmp(buffer + 1, "n") == 0) + } + else if (mode == GNT_KP_MODE_WINDOW_LIST && window_list.window) + { + gnt_widget_key_pressed(window_list.window, buffer); + + if (buffer[0] == '\r' || (buffer[0] == 27 && buffer[1] == 0)) { - /* Alt + n to go to the next window */ - GntWidget *w = NULL; - if (focus_list) - w = focus_list->data; + mode = GNT_KP_MODE_NORMAL; + lock_focus_list = 1; + gnt_widget_destroy(window_list.window); + window_list.window = NULL; + window_list.tree = NULL; + lock_focus_list = 0; + } + } + else if (mode == GNT_KP_MODE_RESIZE) + { + if (buffer[0] == '\r' || (buffer[0] == 27 && buffer[1] == 0)) + mode = GNT_KP_MODE_NORMAL; + else if (buffer[0] == 27) + { + GntWidget *widget = focus_list->data; + gboolean changed = FALSE; + int width, height; - if (focus_list && focus_list->next) - focus_list = focus_list->next; - else - focus_list = g_list_first(focus_list); - if (focus_list) + gnt_widget_get_size(widget, &width, &height); + + if (strcmp(buffer + 1, GNT_KEY_DOWN) == 0) { - gnt_widget_set_focus(focus_list->data, TRUE); - bring_on_top(focus_list->data); - gnt_widget_draw(focus_list->data); + if (widget->priv.y + height < Y_MAX) + { + height++; + changed = TRUE; + } } + else if (strcmp(buffer + 1, GNT_KEY_UP) == 0) + { + height--; + changed = TRUE; + } + else if (strcmp(buffer + 1, GNT_KEY_LEFT) == 0) + { + width--; + changed = TRUE; + } + else if (strcmp(buffer + 1, GNT_KEY_RIGHT) == 0) + { + if (widget->priv.x + width < X_MAX) + { + width++; + changed = TRUE; + } + } - if (w && w != focus_list->data) - gnt_widget_set_focus(w, FALSE); + if (changed) + { + GntNode *node = g_hash_table_lookup(nodes, widget); + int x, y; + + gnt_widget_get_position(widget, &x, &y); + + hide_panel(node->panel); + gnt_widget_set_size(widget, width, height); + gnt_widget_set_position(widget, x, y); + gnt_widget_draw(widget); + replace_panel(node->panel, widget->window); + show_panel(node->panel); + update_panels(); + doupdate(); + } } } - draw_taskbar(); refresh(); return TRUE; @@ -203,28 +504,41 @@ int result = g_io_add_watch(channel, (G_IO_IN | G_IO_HUP | G_IO_ERR), io_invoke, NULL); + const char *locale = setlocale(LC_ALL, ""); - setlocale(LC_ALL, ""); + if (locale && (strstr(locale, "UTF") || strstr(locale, "utf"))) + ascii_only = FALSE; + else + ascii_only = TRUE; + initscr(); start_color(); gnt_init_colors(); - max_x = getmaxx(stdscr); - max_y = getmaxy(stdscr); + X_MIN = 0; + Y_MIN = 0; + X_MAX = getmaxx(stdscr); + Y_MAX = getmaxy(stdscr) - 1; nodes = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, free_node); wbkgdset(stdscr, '\0' | COLOR_PAIR(GNT_COLOR_NORMAL)); noecho(); refresh(); +#if MAYBE_SOMEDAY mousemask(ALL_MOUSE_EVENTS | REPORT_MOUSE_POSITION, NULL); +#endif + wbkgdset(stdscr, '\0' | COLOR_PAIR(GNT_COLOR_NORMAL)); + werase(stdscr); + wrefresh(stdscr); + g_type_init(); } void gnt_main() { - GMainLoop *loop = g_main_new(FALSE); - g_main_run(loop); + loop = g_main_loop_new(NULL, FALSE); + g_main_loop_run(loop); } /********************************* @@ -235,45 +549,17 @@ free_node(gpointer data) { GntNode *node = data; - g_list_free(node->below); - g_list_free(node->above); + hide_panel(node->panel); + del_panel(node->panel); g_free(node); } -static void -check_intersection(gpointer key, gpointer value, gpointer data) -{ - GntNode *n = value; - GntNode *nu = data; - - if (value == NULL) - return; - if (n->me == nu->me) - return; - - if (n->me->priv.x + n->me->priv.width < nu->me->priv.x) - return; - if (nu->me->priv.x + nu->me->priv.width < n->me->priv.x) - return; - - if (n->me->priv.y + n->me->priv.height < nu->me->priv.y) - return; - if (nu->me->priv.y + nu->me->priv.height < n->me->priv.y) - return; - - n->above = g_list_prepend(n->above, nu); - nu->below = g_list_prepend(nu->below, n); -} - void gnt_screen_occupy(GntWidget *widget) { GntNode *node; - if (widget->parent) - { - while (widget->parent) - widget = widget->parent; - } + while (widget->parent) + widget = widget->parent; if (g_hash_table_lookup(nodes, widget)) return; /* XXX: perhaps _update instead? */ @@ -281,97 +567,64 @@ node = g_new0(GntNode, 1); node->me = widget; - g_hash_table_foreach(nodes, check_intersection, node); g_hash_table_replace(nodes, widget, node); + + if (window_list.window) + { + if ((GNT_IS_BOX(widget) && GNT_BOX(widget)->title) && window_list.window != widget + && GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_CAN_TAKE_FOCUS)) + { + gnt_tree_add_row_after(GNT_TREE(window_list.tree), widget, + GNT_BOX(widget)->title, NULL, NULL); + update_window_in_list(widget); + } + } + + update_panels(); + doupdate(); } void gnt_screen_release(GntWidget *widget) { - WINDOW *win; - GList *iter; - GntNode *node = g_hash_table_lookup(nodes, widget); + GntNode *node; + + gnt_screen_remove_widget(widget); + node = g_hash_table_lookup(nodes, widget); + if (node == NULL) /* Yay! Nothing to do. */ return; - win = dupwin(widget->window); - werase(win); + g_hash_table_remove(nodes, widget); - /* XXX: This is not going to work. - * It will be necessary to build a topology and go from there. */ - for (iter = node->below; iter; iter = iter->next) + if (window_list.window) { - GntNode *n = iter->data; - GntWidget *w = n->me; - int left, right, top, bottom; - - left = MAX(widget->priv.x, w->priv.x) - w->priv.x; - right = MIN(widget->priv.x + widget->priv.width, w->priv.x + w->priv.width) - w->priv.x; - - 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 - 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); + gnt_tree_remove(GNT_TREE(window_list.tree), widget); } - for (iter = node->above; iter; iter = iter->next) - { - GntNode *n = iter->data; - n->below = g_list_remove(n->below, node); - } - - wrefresh(win); - delwin(win); - - g_hash_table_remove(nodes, widget); + update_panels(); + doupdate(); } void gnt_screen_update(GntWidget *widget) { - GList *iter; - WINDOW *win; GntNode *node; - if (widget->parent) - { - while (widget->parent) - widget = widget->parent; - } + while (widget->parent) + widget = widget->parent; gnt_box_sync_children(GNT_BOX(widget)); node = g_hash_table_lookup(nodes, widget); + if (node && !node->panel) + node->panel = new_panel(node->me->window); - win = dupwin(widget->window); - - if (node && node->above) + if (window_list.window) { - /* XXX: Same here: need to build a topology first. */ - for (iter = node->above; iter; iter = iter->next) - { - GntNode *n = iter->data; - GntWidget *w = n->me; - int left, right, top, bottom; - - left = MAX(widget->priv.x, w->priv.x) - w->priv.x; - right = MIN(widget->priv.x + widget->priv.width, w->priv.x + w->priv.width) - w->priv.x; - - 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 - 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); - } + GntNode *nd = g_hash_table_lookup(nodes, window_list.window); + top_panel(nd->panel); } - wrefresh(win); - delwin(win); + update_panels(); + doupdate(); } gboolean gnt_widget_has_focus(GntWidget *widget) @@ -383,17 +636,18 @@ 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))) + if (widget == window_list.window) return TRUE; + if (focus_list && focus_list->data == widget) + { + if (GNT_IS_BOX(widget) && + (GNT_BOX(widget)->active == w || widget == w)) + return TRUE; + } + return FALSE; } @@ -409,3 +663,13 @@ draw_taskbar(); } +void gnt_quit() +{ + endwin(); +} + +gboolean gnt_ascii_only() +{ + return ascii_only; +} + Modified: branches/soc-2006-file-loggers/console/libgnt/gnttextview.c =================================================================== --- branches/soc-2006-file-loggers/console/libgnt/gnttextview.c 2006-07-08 22:08:51 UTC (rev 16464) +++ branches/soc-2006-file-loggers/console/libgnt/gnttextview.c 2006-07-08 22:43:22 UTC (rev 16465) @@ -7,7 +7,7 @@ typedef struct { - GntTextViewFlags flags; + GntTextFormatFlags flags; char *text; } GntTextSegment; @@ -113,6 +113,9 @@ static void gnt_text_view_init(GTypeInstance *instance, gpointer class) { + /* XXX: For now, resizing the width is not permitted. This is because + * of the way I am handling wrapped lines. */ + GNT_WIDGET_SET_FLAGS(GNT_WIDGET(instance), GNT_WIDGET_GROW_Y); DEBUG; } @@ -152,14 +155,14 @@ GntTextView *view = GNT_TEXT_VIEW(widget); GntTextLine *line = g_new0(GntTextLine, 1); - GNT_WIDGET_SET_FLAGS(widget, GNT_WIDGET_NO_BORDER); + GNT_WIDGET_SET_FLAGS(widget, GNT_WIDGET_NO_BORDER | GNT_WIDGET_NO_SHADOW); view->list = g_list_append(view->list, line); return widget; } -void gnt_text_view_append_text_with_flags(GntTextView *view, const char *text, GntTextViewFlags flags) +void gnt_text_view_append_text_with_flags(GntTextView *view, const char *text, GntTextFormatFlags flags) { GntWidget *widget = GNT_WIDGET(view); int fl = 0; @@ -198,7 +201,7 @@ { GntTextSegment *seg = g_new0(GntTextSegment, 1); seg->flags = fl; - seg->text = g_new0(char, len); /* XXX: MUST be improved */ + seg->text = g_new0(char, len + 1); /* XXX: MUST be improved */ g_utf8_strncpy(seg->text, iter, widget->priv.width - line->length - 1); line->segments = g_list_append(line->segments, seg); Modified: branches/soc-2006-file-loggers/console/libgnt/gnttextview.h ======================... [truncated message content] |
From: <ro...@us...> - 2006-07-08 22:08:56
|
Revision: 16464 Author: roast Date: 2006-07-08 15:08:51 -0700 (Sat, 08 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16464&view=rev Log Message: ----------- removed FILE* from log.h/_GaimLogCommonLoggerData, and added dox comments Modified Paths: -------------- branches/soc-2006-file-loggers/src/log.h Modified: branches/soc-2006-file-loggers/src/log.h =================================================================== --- branches/soc-2006-file-loggers/src/log.h 2006-07-08 21:03:40 UTC (rev 16463) +++ branches/soc-2006-file-loggers/src/log.h 2006-07-08 22:08:51 UTC (rev 16464) @@ -136,10 +136,9 @@ * as a pointer to something else for additional data. */ struct _GaimLogCommonLoggerData { - char *path; - FILE *file; - GIOChannel *channel; - void *extra_data; + char *path; /**< The full path to the GaimLog */ + GIOChannel *channel; /**< The GIOChannel to the log, if open */ + void *extra_data; /**< An extra data field to store associated GaimLogLogger data */ }; /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <amc...@us...> - 2006-07-08 21:03:44
|
Revision: 16463 Author: amc_grim Date: 2006-07-08 14:03:40 -0700 (Sat, 08 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16463&view=rev Log Message: ----------- this is screwing up my libgaim splitting script.. Property Changed: ---------------- trunk/src/protocols/qq/ Property changes on: trunk/src/protocols/qq ___________________________________________________________________ Name: svn:ignore - Makefile.in Makefile .deps .libs + Makefile.in Makefile .deps .libs *.la *.lo This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-07-08 19:07:09
|
Revision: 16462 Author: sadrul Date: 2006-07-08 12:06:59 -0700 (Sat, 08 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16462&view=rev Log Message: ----------- Mark urgent-hinted windows in the window-list. Make the default size of some of the windows smaller. Modified Paths: -------------- trunk/console/gntaccount.c trunk/console/libgnt/gntmain.c trunk/console/libgnt/gnttree.c Modified: trunk/console/gntaccount.c =================================================================== --- trunk/console/gntaccount.c 2006-07-08 15:38:45 UTC (rev 16461) +++ trunk/console/gntaccount.c 2006-07-08 19:06:59 UTC (rev 16462) @@ -35,6 +35,7 @@ accounts.window = gnt_box_new(TRUE, TRUE); gnt_box_set_toplevel(GNT_BOX(accounts.window), TRUE); gnt_box_set_title(GNT_BOX(accounts.window), _("Accounts")); + gnt_box_set_pad(GNT_BOX(accounts.window), 0); gnt_widget_set_name(accounts.window, "accounts"); gnt_box_add_widget(GNT_BOX(accounts.window), @@ -58,7 +59,7 @@ g_signal_connect(G_OBJECT(accounts.tree), "toggled", G_CALLBACK(account_toggled), NULL); - gnt_widget_set_size(accounts.tree, 40, 15); + gnt_widget_set_size(accounts.tree, 40, 10); gnt_box_add_widget(GNT_BOX(accounts.window), accounts.tree); box = gnt_box_new(FALSE, FALSE); Modified: trunk/console/libgnt/gntmain.c =================================================================== --- trunk/console/libgnt/gntmain.c 2006-07-08 15:38:45 UTC (rev 16461) +++ trunk/console/libgnt/gntmain.c 2006-07-08 19:06:59 UTC (rev 16462) @@ -118,9 +118,26 @@ } update_panels(); doupdate(); + draw_taskbar(); } static void +update_window_in_list(GntWidget *wid) +{ + GntTextFormatFlags flag = 0; + + if (window_list.window == NULL) + return; + + if (wid == focus_list->data) + flag |= GNT_TEXT_FLAG_DIM; + else if (GNT_WIDGET_IS_FLAG_SET(wid, GNT_WIDGET_URGENT)) + flag |= GNT_TEXT_FLAG_BOLD; + + gnt_tree_set_row_flags(GNT_TREE(window_list.tree), wid, flag); +} + +static void draw_taskbar() { static WINDOW *taskbar = NULL; @@ -163,6 +180,8 @@ 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); + + update_window_in_list(w); } wrefresh(taskbar); @@ -240,6 +259,7 @@ GntBox *box = GNT_BOX(iter->data); gnt_tree_add_row_after(GNT_TREE(tree), box, box->title, NULL, NULL); + update_window_in_list(GNT_WIDGET(box)); } gnt_box_add_widget(GNT_BOX(win), tree); @@ -468,7 +488,6 @@ } } - draw_taskbar(); refresh(); return TRUE; @@ -554,8 +573,11 @@ { if ((GNT_IS_BOX(widget) && GNT_BOX(widget)->title) && window_list.window != widget && GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_CAN_TAKE_FOCUS)) + { gnt_tree_add_row_after(GNT_TREE(window_list.tree), widget, GNT_BOX(widget)->title, NULL, NULL); + update_window_in_list(widget); + } } update_panels(); Modified: trunk/console/libgnt/gnttree.c =================================================================== --- trunk/console/libgnt/gnttree.c 2006-07-08 15:38:45 UTC (rev 16461) +++ trunk/console/libgnt/gnttree.c 2006-07-08 19:06:59 UTC (rev 16462) @@ -201,6 +201,7 @@ g_snprintf(format, sizeof(format) - 1, "[%c] ", row->isselected ? 'X' : ' '); } + /* XXX: Need a utf8 version of snprintf */ if ((wr = g_snprintf(str, widget->priv.width, "%s%s", format, row->text)) >= widget->priv.width) { /* XXX: ellipsize */ @@ -702,10 +703,10 @@ void gnt_tree_set_row_flags(GntTree *tree, void *key, GntTextFormatFlags flags) { GntTreeRow *row = g_hash_table_lookup(tree->hash, key); - if (!row) + if (!row || row->flags == flags) return; row->flags = flags; - redraw_tree(tree); + redraw_tree(tree); /* XXX: Is shouldn't be necessary to redraw the whole darned tree */ } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ev...@us...> - 2006-07-08 15:38:49
|
Revision: 16461 Author: evands Date: 2006-07-08 08:38:45 -0700 (Sat, 08 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16461&view=rev Log Message: ----------- Autoreply messages are no longer sent in response to autoreply messages Modified Paths: -------------- trunk/src/server.c Modified: trunk/src/server.c =================================================================== --- trunk/src/server.c 2006-07-08 07:27:16 UTC (rev 16460) +++ trunk/src/server.c 2006-07-08 15:38:45 UTC (rev 16461) @@ -557,13 +557,21 @@ lar = get_last_auto_response(gc, name); if ((now - lar->sent) >= SECS_BEFORE_RESENDING_AUTORESPONSE) { + /* + * We don't want to send an autoresponse in response to the other user's + * autoresponse. We do, however, not want to then send one in response to the + * _next_ message, so we still set lar->sent to now. + */ lar->sent = now; + + if (!(flags & GAIM_MESSAGE_AUTO_RESP)) + { + serv_send_im(gc, name, away_msg, GAIM_MESSAGE_AUTO_RESP); - serv_send_im(gc, name, away_msg, GAIM_MESSAGE_AUTO_RESP); - - gaim_conv_im_write(GAIM_CONV_IM(cnv), NULL, away_msg, - GAIM_MESSAGE_SEND | GAIM_MESSAGE_AUTO_RESP, - mtime); + gaim_conv_im_write(GAIM_CONV_IM(cnv), NULL, away_msg, + GAIM_MESSAGE_SEND | GAIM_MESSAGE_AUTO_RESP, + mtime); + } } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-07-08 07:27:20
|
Revision: 16460 Author: thekingant Date: 2006-07-08 00:27:16 -0700 (Sat, 08 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16460&view=rev Log Message: ----------- Backport SVN revision #16459 from HEAD to v2_0_0 Original commit message: Two changes here: 1. When auto-linkifying a URL, if \r\n immediately follows the address, don't include the \r as a part of the URL. 2. When replacing \n with <br> in a given string, if the string contained any \r's then the end of the string would have a number of unintialized characters at the end equal to the number of \r's that were removed. ViewCVS Links: ------------- http://svn.sourceforge.net/gaim/?rev=16459&view=rev Modified Paths: -------------- branches/v2_0_0/src/util.c Modified: branches/v2_0_0/src/util.c =================================================================== --- branches/v2_0_0/src/util.c 2006-07-08 07:26:57 UTC (rev 16459) +++ branches/v2_0_0/src/util.c 2006-07-08 07:27:16 UTC (rev 16460) @@ -1744,6 +1744,7 @@ case ',': case '\0': case '\n': + case '\r': case '<': case '>': case '"': @@ -2682,12 +2683,16 @@ g_return_val_if_fail(src != NULL, NULL); - /* New length is (length of src) + (number of \n's * 3) + 1 */ + /* New length is (length of src) + (number of \n's * 3) - (number of \r's) + 1 */ + destsize = 0; for (i = 0, j = 0; src[i] != '\0'; i++) + { if (src[i] == '\n') - j++; + destsize += 4; + else if (src[i] != '\r') + destsize++; + } - destsize = i + (j * 3) + 1; dest = g_malloc(destsize); /* Copy stuff, ignoring \r's, because they are dumb */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-07-08 07:27:01
|
Revision: 16459 Author: thekingant Date: 2006-07-08 00:26:57 -0700 (Sat, 08 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16459&view=rev Log Message: ----------- Two changes here: 1. When auto-linkifying a URL, if \r\n immediately follows the address, don't include the \r as a part of the URL. 2. When replacing \n with <br> in a given string, if the string contained any \r's then the end of the string would have a number of unintialized characters at the end equal to the number of \r's that were removed. Modified Paths: -------------- trunk/src/util.c Modified: trunk/src/util.c =================================================================== --- trunk/src/util.c 2006-07-08 07:13:29 UTC (rev 16458) +++ trunk/src/util.c 2006-07-08 07:26:57 UTC (rev 16459) @@ -1744,6 +1744,7 @@ case ',': case '\0': case '\n': + case '\r': case '<': case '>': case '"': @@ -2682,12 +2683,16 @@ g_return_val_if_fail(src != NULL, NULL); - /* New length is (length of src) + (number of \n's * 3) + 1 */ + /* New length is (length of src) + (number of \n's * 3) - (number of \r's) + 1 */ + destsize = 0; for (i = 0, j = 0; src[i] != '\0'; i++) + { if (src[i] == '\n') - j++; + destsize += 4; + else if (src[i] != '\r') + destsize++; + } - destsize = i + (j * 3) + 1; dest = g_malloc(destsize); /* Copy stuff, ignoring \r's, because they are dumb */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-07-08 07:13:37
|
Revision: 16458 Author: sadrul Date: 2006-07-08 00:13:29 -0700 (Sat, 08 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16458&view=rev Log Message: ----------- Add text-attributes for rows in a GntTree. Use this feature to dim idle buddies in the buddylist. Modified Paths: -------------- trunk/console/gntblist.c trunk/console/gntconv.c trunk/console/libgnt/gntbox.c trunk/console/libgnt/gnttextview.c trunk/console/libgnt/gnttextview.h trunk/console/libgnt/gnttree.c trunk/console/libgnt/gnttree.h trunk/console/libgnt/test/multiwin.c Modified: trunk/console/gntblist.c =================================================================== --- trunk/console/gntblist.c 2006-07-08 02:11:11 UTC (rev 16457) +++ trunk/console/gntblist.c 2006-07-08 07:13:29 UTC (rev 16458) @@ -203,6 +203,10 @@ node->ui_data = gnt_tree_add_row_after(GNT_TREE(ggblist->tree), buddy, get_display_name(node), group, NULL); + if (gaim_presence_is_idle(gaim_buddy_get_presence(buddy))) + gnt_tree_set_row_flags(GNT_TREE(ggblist->tree), buddy, GNT_TEXT_FLAG_DIM); + else + gnt_tree_set_row_flags(GNT_TREE(ggblist->tree), buddy, 0); } #if 0 @@ -358,7 +362,6 @@ draw_tooltip(ggblist); } - static gboolean key_pressed(GntWidget *widget, const char *text, GGBlist *ggblist) { @@ -377,13 +380,30 @@ } static void -buddy_status_changed(GaimBuddy *buddy, GaimStatus *old, GaimStatus *now, GGBlist *ggblist) +update_buddy_display(GaimBuddy *buddy, GGBlist *ggblist) { gnt_tree_change_text(GNT_TREE(ggblist->tree), buddy, get_display_name((GaimBlistNode*)buddy)); if (ggblist->tnode == (GaimBlistNode*)buddy) draw_tooltip(ggblist); + + if (gaim_presence_is_idle(gaim_buddy_get_presence(buddy))) + gnt_tree_set_row_flags(GNT_TREE(ggblist->tree), buddy, GNT_TEXT_FLAG_DIM); + else + gnt_tree_set_row_flags(GNT_TREE(ggblist->tree), buddy, 0); } +static void +buddy_status_changed(GaimBuddy *buddy, GaimStatus *old, GaimStatus *now, GGBlist *ggblist) +{ + update_buddy_display(buddy, ggblist); +} + +static void +buddy_idle_changed(GaimBuddy *buddy, int old, int new, GGBlist *ggblist) +{ + update_buddy_display(buddy, ggblist); +} + void gg_blist_init() { ggblist = g_new0(GGBlist, 1); @@ -405,6 +425,8 @@ gaim_signal_connect(gaim_blist_get_handle(), "buddy-status-changed", gg_blist_get_handle(), GAIM_CALLBACK(buddy_status_changed), ggblist); + gaim_signal_connect(gaim_blist_get_handle(), "buddy-idle-changed", gg_blist_get_handle(), + GAIM_CALLBACK(buddy_idle_changed), ggblist); #if 0 gaim_signal_connect(gaim_blist_get_handle(), "buddy-signed-on", gg_blist_get_handle(), Modified: trunk/console/gntconv.c =================================================================== --- trunk/console/gntconv.c 2006-07-08 02:11:11 UTC (rev 16457) +++ trunk/console/gntconv.c 2006-07-08 07:13:29 UTC (rev 16458) @@ -146,7 +146,7 @@ { GGConv *ggconv = g_hash_table_lookup(ggconvs, conv); char *strip; - GntTextViewFlags fl = 0; + GntTextFormatFlags fl = 0; g_return_if_fail(ggconv != NULL); Modified: trunk/console/libgnt/gntbox.c =================================================================== --- trunk/console/libgnt/gntbox.c 2006-07-08 02:11:11 UTC (rev 16457) +++ trunk/console/libgnt/gntbox.c 2006-07-08 07:13:29 UTC (rev 16458) @@ -284,7 +284,6 @@ GList *iter; GntBox *box = GNT_BOX(widget); int wchange, hchange; - int wc = 0, hc = 0; wchange = widget->priv.width - width; hchange = widget->priv.height - height; Modified: trunk/console/libgnt/gnttextview.c =================================================================== --- trunk/console/libgnt/gnttextview.c 2006-07-08 02:11:11 UTC (rev 16457) +++ trunk/console/libgnt/gnttextview.c 2006-07-08 07:13:29 UTC (rev 16458) @@ -7,7 +7,7 @@ typedef struct { - GntTextViewFlags flags; + GntTextFormatFlags flags; char *text; } GntTextSegment; @@ -162,7 +162,7 @@ return widget; } -void gnt_text_view_append_text_with_flags(GntTextView *view, const char *text, GntTextViewFlags flags) +void gnt_text_view_append_text_with_flags(GntTextView *view, const char *text, GntTextFormatFlags flags) { GntWidget *widget = GNT_WIDGET(view); int fl = 0; Modified: trunk/console/libgnt/gnttextview.h =================================================================== --- trunk/console/libgnt/gnttextview.h 2006-07-08 02:11:11 UTC (rev 16457) +++ trunk/console/libgnt/gnttextview.h 2006-07-08 07:13:29 UTC (rev 16458) @@ -35,7 +35,7 @@ GNT_TEXT_FLAG_BLINK = 1 << 2, GNT_TEXT_FLAG_DIM = 1 << 3, GNT_TEXT_FLAG_HIGHLIGHT = 1 << 4, -} GntTextViewFlags; +} GntTextFormatFlags; struct _GnTextViewClass { @@ -58,7 +58,7 @@ /* scroll > 0 means scroll up, < 0 means scroll down, == 0 means scroll to the end */ void gnt_text_view_scroll(GntTextView *view, int scroll); -void gnt_text_view_append_text_with_flags(GntTextView *view, const char *text, GntTextViewFlags flags); +void gnt_text_view_append_text_with_flags(GntTextView *view, const char *text, GntTextFormatFlags flags); /* Move the cursor to the beginning of the next line and resets text-attributes. * It first completes the current line with the current text-attributes. */ Modified: trunk/console/libgnt/gnttree.c =================================================================== --- trunk/console/libgnt/gnttree.c 2006-07-08 02:11:11 UTC (rev 16457) +++ trunk/console/libgnt/gnttree.c 2006-07-08 07:13:29 UTC (rev 16458) @@ -25,6 +25,7 @@ gboolean choice; /* Is this a choice-box? If choice is true, then child will be NULL */ gboolean isselected; + GntTextFormatFlags flags; GntTreeRow *parent; GntTreeRow *child; @@ -180,6 +181,9 @@ int wr; char format[16] = ""; + GntTextFormatFlags flags = row->flags; + int attr = 0; + deep = TRUE; if (row->parent == NULL && row->child) @@ -208,25 +212,38 @@ str[wr++] = ' '; str[wr] = 0; } - + + if (flags & GNT_TEXT_FLAG_BOLD) + attr |= A_BOLD; + if (flags & GNT_TEXT_FLAG_UNDERLINE) + attr |= A_UNDERLINE; + if (flags & GNT_TEXT_FLAG_BLINK) + attr |= A_BLINK; + if (row == tree->current) { if (gnt_widget_has_focus(widget)) - wbkgdset(widget->window, '\0' | COLOR_PAIR(GNT_COLOR_HIGHLIGHT)); + attr |= COLOR_PAIR(GNT_COLOR_HIGHLIGHT); else - wbkgdset(widget->window, '\0' | COLOR_PAIR(GNT_COLOR_HIGHLIGHT_D)); - mvwprintw(widget->window, start, pos, str); - whline(widget->window, ' ', widget->priv.width - pos * 2 - g_utf8_strlen(str, -1)); - wbkgdset(widget->window, '\0' | COLOR_PAIR(GNT_COLOR_NORMAL)); + attr |= COLOR_PAIR(GNT_COLOR_HIGHLIGHT_D); } else { - mvwprintw(widget->window, start, pos, str); - whline(widget->window, ' ', widget->priv.width - pos * 2 - g_utf8_strlen(str, -1)); + if (flags & GNT_TEXT_FLAG_DIM) + attr |= (A_DIM | COLOR_PAIR(GNT_COLOR_DISABLED)); + else if (flags & GNT_TEXT_FLAG_HIGHLIGHT) + attr |= (A_DIM | COLOR_PAIR(GNT_COLOR_HIGHLIGHT)); + else + attr |= COLOR_PAIR(GNT_COLOR_NORMAL); } + + wbkgdset(widget->window, '\0' | attr); + mvwprintw(widget->window, start, pos, str); + whline(widget->window, ' ', widget->priv.width - pos * 2 - g_utf8_strlen(str, -1)); tree->bottom = row; } + wbkgdset(widget->window, '\0' | COLOR_PAIR(GNT_COLOR_NORMAL)); while (start < widget->priv.height - pos) { mvwhline(widget->window, start, pos, ' ', @@ -682,3 +699,13 @@ return row->isselected; } +void gnt_tree_set_row_flags(GntTree *tree, void *key, GntTextFormatFlags flags) +{ + GntTreeRow *row = g_hash_table_lookup(tree->hash, key); + if (!row) + return; + + row->flags = flags; + redraw_tree(tree); +} + Modified: trunk/console/libgnt/gnttree.h =================================================================== --- trunk/console/libgnt/gnttree.h 2006-07-08 02:11:11 UTC (rev 16457) +++ trunk/console/libgnt/gnttree.h 2006-07-08 07:13:29 UTC (rev 16458) @@ -5,6 +5,7 @@ #include "gnt.h" #include "gntcolors.h" #include "gntkeys.h" +#include "gnttextview.h" #define GNT_TYPE_TREE (gnt_tree_get_gtype()) #define GNT_TREE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GNT_TYPE_TREE, GntTree)) @@ -79,6 +80,8 @@ gboolean gnt_tree_get_choice(GntTree *tree, void *key); +void gnt_tree_set_row_flags(GntTree *tree, void *key, GntTextFormatFlags flags); + G_END_DECLS #endif /* GNT_TREE_H */ Modified: trunk/console/libgnt/test/multiwin.c =================================================================== --- trunk/console/libgnt/test/multiwin.c 2006-07-08 02:11:11 UTC (rev 16457) +++ trunk/console/libgnt/test/multiwin.c 2006-07-08 07:13:29 UTC (rev 16458) @@ -58,6 +58,8 @@ gnt_tree_add_row_after(GNT_TREE(tree), "6", "6", "4", NULL); + gnt_tree_set_row_flags(GNT_TREE(tree), "e", GNT_TEXT_FLAG_DIM); + g_timeout_add(5000, show, box2); gnt_main(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-07-08 02:11:20
|
Revision: 16457 Author: sadrul Date: 2006-07-07 19:11:11 -0700 (Fri, 07 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16457&view=rev Log Message: ----------- Enable resizing (Alt+r, then the arrow keys, then enter/escape to end). It 'works', but needs fine-tuning. But I am going to put it off for a later date. Some other minor decoration tweaks. Modified Paths: -------------- trunk/console/libgnt/gntbox.c trunk/console/libgnt/gntbutton.c trunk/console/libgnt/gntentry.c trunk/console/libgnt/gntlabel.c trunk/console/libgnt/gntmain.c trunk/console/libgnt/gnttextview.c trunk/console/libgnt/gnttree.c trunk/console/libgnt/gntutils.c trunk/console/libgnt/gntutils.h trunk/console/libgnt/gntwidget.c trunk/console/libgnt/gntwidget.h Modified: trunk/console/libgnt/gntbox.c =================================================================== --- trunk/console/libgnt/gntbox.c 2006-07-07 21:57:15 UTC (rev 16456) +++ trunk/console/libgnt/gntbox.c 2006-07-08 02:11:11 UTC (rev 16457) @@ -39,24 +39,29 @@ if (box->title) { gchar *title = g_strdup(box->title); - int pos = g_utf8_strlen(title, -1); + int pos = g_utf8_strlen(title, -1), right; - if (pos >= widget->priv.width - 2) + if (pos >= widget->priv.width - 4) { - g_utf8_strncpy(title, box->title, widget->priv.width - 2); - pos = 1; + g_utf8_strncpy(title, box->title, widget->priv.width - 4); + pos = 2; + right = pos + g_utf8_strlen(title, -1); } else { /* XXX: Position of the title might be configurable */ + right = pos; pos = (widget->priv.width - pos) / 2; + right += pos; } 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)); + mvwaddch(widget->window, 0, pos-1, ACS_RTEE | COLOR_PAIR(GNT_COLOR_NORMAL)); mvwprintw(widget->window, 0, pos, title); + mvwaddch(widget->window, 0, right, ACS_LTEE | COLOR_PAIR(GNT_COLOR_NORMAL)); g_free(title); } @@ -273,6 +278,34 @@ delwin(win); } +static gboolean +gnt_box_confirm_size(GntWidget *widget, int width, int height) +{ + GList *iter; + GntBox *box = GNT_BOX(widget); + int wchange, hchange; + int wc = 0, hc = 0; + + wchange = widget->priv.width - width; + hchange = widget->priv.height - height; + + /* XXX: Right now, I am trying to just apply all the changes to + * just one widget. It should be possible to distribute the + * changes to all the widgets in the box. */ + for (iter = box->list; iter; iter = iter->next) + { + GntWidget *wid = iter->data; + int w, h; + + gnt_widget_get_size(wid, &w, &h); + + if (gnt_widget_set_size(wid, w - wchange, h - hchange)) + return TRUE; + } + + return FALSE; +} + static void gnt_box_class_init(GntBoxClass *klass) { @@ -286,6 +319,7 @@ parent_class->key_pressed = gnt_box_key_pressed; parent_class->lost_focus = gnt_box_lost_focus; parent_class->gained_focus = gnt_box_gained_focus; + parent_class->confirm_size = gnt_box_confirm_size; DEBUG; } @@ -293,6 +327,9 @@ static void gnt_box_init(GTypeInstance *instance, gpointer class) { + /* Initially make both the height and width resizable. + * Update the flags as necessary when widgets are added to it. */ + GNT_WIDGET_SET_FLAGS(GNT_WIDGET(instance), GNT_WIDGET_GROW_X | GNT_WIDGET_GROW_Y); DEBUG; } @@ -344,6 +381,17 @@ { b->list = g_list_append(b->list, widget); widget->parent = GNT_WIDGET(b); + + if (b->vertical) + { + if (!GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_GROW_X)) + GNT_WIDGET_UNSET_FLAGS(GNT_WIDGET(b), GNT_WIDGET_GROW_X); + } + else + { + if (!GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_GROW_Y)) + GNT_WIDGET_UNSET_FLAGS(GNT_WIDGET(b), GNT_WIDGET_GROW_Y); + } } void gnt_box_set_title(GntBox *b, const char *title) Modified: trunk/console/libgnt/gntbutton.c =================================================================== --- trunk/console/libgnt/gntbutton.c 2006-07-07 21:57:15 UTC (rev 16456) +++ trunk/console/libgnt/gntbutton.c 2006-07-08 02:11:11 UTC (rev 16457) @@ -71,6 +71,8 @@ { GntButton *button = GNT_BUTTON(instance); button->priv = g_new0(GntButtonPriv, 1); + + GNT_WIDGET_SET_FLAGS(GNT_WIDGET(button), GNT_WIDGET_GROW_X); /* Can be resized sideways */ DEBUG; } Modified: trunk/console/libgnt/gntentry.c =================================================================== --- trunk/console/libgnt/gntentry.c 2006-07-07 21:57:15 UTC (rev 16456) +++ trunk/console/libgnt/gntentry.c 2006-07-08 02:11:11 UTC (rev 16457) @@ -173,6 +173,7 @@ GNT_WIDGET_SET_FLAGS(GNT_WIDGET(entry), GNT_WIDGET_NO_BORDER | GNT_WIDGET_NO_SHADOW | GNT_WIDGET_CAN_TAKE_FOCUS); + GNT_WIDGET_SET_FLAGS(GNT_WIDGET(entry), GNT_WIDGET_GROW_X); DEBUG; } Modified: trunk/console/libgnt/gntlabel.c =================================================================== --- trunk/console/libgnt/gntlabel.c 2006-07-07 21:57:15 UTC (rev 16456) +++ trunk/console/libgnt/gntlabel.c 2006-07-08 02:11:11 UTC (rev 16457) @@ -70,6 +70,7 @@ static void gnt_label_init(GTypeInstance *instance, gpointer class) { + GNT_WIDGET_SET_FLAGS(GNT_WIDGET(instance), GNT_WIDGET_GROW_X | GNT_WIDGET_GROW_Y); DEBUG; } Modified: trunk/console/libgnt/gntmain.c =================================================================== --- trunk/console/libgnt/gntmain.c 2006-07-07 21:57:15 UTC (rev 16456) +++ trunk/console/libgnt/gntmain.c 2006-07-08 02:11:11 UTC (rev 16457) @@ -325,6 +325,11 @@ mode = GNT_KP_MODE_WINDOW_LIST; show_window_list(); } + else if (strcmp(buffer + 1, "r") == 0 && focus_list) + { + /* Resize window */ + mode = GNT_KP_MODE_RESIZE; + } } } } @@ -405,7 +410,64 @@ lock_focus_list = 0; } } + else if (mode == GNT_KP_MODE_RESIZE) + { + if (buffer[0] == '\r' || (buffer[0] == 27 && buffer[1] == 0)) + mode = GNT_KP_MODE_NORMAL; + else if (buffer[0] == 27) + { + GntWidget *widget = focus_list->data; + gboolean changed = FALSE; + int width, height; + gnt_widget_get_size(widget, &width, &height); + + if (strcmp(buffer + 1, GNT_KEY_DOWN) == 0) + { + if (widget->priv.y + height < Y_MAX) + { + height++; + changed = TRUE; + } + } + else if (strcmp(buffer + 1, GNT_KEY_UP) == 0) + { + height--; + changed = TRUE; + } + else if (strcmp(buffer + 1, GNT_KEY_LEFT) == 0) + { + width--; + changed = TRUE; + } + else if (strcmp(buffer + 1, GNT_KEY_RIGHT) == 0) + { + if (widget->priv.x + width < X_MAX) + { + width++; + changed = TRUE; + } + } + + if (changed) + { + GntNode *node = g_hash_table_lookup(nodes, widget); + int x, y; + + gnt_widget_get_position(widget, &x, &y); + + hide_panel(node->panel); + gnt_widget_set_size(widget, width, height); + gnt_widget_set_position(widget, x, y); + gnt_widget_draw(widget); + replace_panel(node->panel, widget->window); + show_panel(node->panel); + update_panels(); + doupdate(); + } + } + } + draw_taskbar(); refresh(); @@ -477,11 +539,8 @@ { GntNode *node; - if (widget->parent) - { - while (widget->parent) - widget = widget->parent; - } + while (widget->parent) + widget = widget->parent; if (g_hash_table_lookup(nodes, widget)) return; /* XXX: perhaps _update instead? */ @@ -528,11 +587,8 @@ { GntNode *node; - if (widget->parent) - { - while (widget->parent) - widget = widget->parent; - } + while (widget->parent) + widget = widget->parent; gnt_box_sync_children(GNT_BOX(widget)); node = g_hash_table_lookup(nodes, widget); @@ -555,16 +611,14 @@ if (!widget) return FALSE; - if (widget == window_list.window) - return TRUE; - w = widget; while (widget->parent) - { widget = widget->parent; - } + if (widget == window_list.window) + return TRUE; + if (focus_list && focus_list->data == widget) { if (GNT_IS_BOX(widget) && Modified: trunk/console/libgnt/gnttextview.c =================================================================== --- trunk/console/libgnt/gnttextview.c 2006-07-07 21:57:15 UTC (rev 16456) +++ trunk/console/libgnt/gnttextview.c 2006-07-08 02:11:11 UTC (rev 16457) @@ -113,6 +113,9 @@ static void gnt_text_view_init(GTypeInstance *instance, gpointer class) { + /* XXX: For now, resizing the width is not permitted. This is because + * of the way I am handling wrapped lines. */ + GNT_WIDGET_SET_FLAGS(GNT_WIDGET(instance), GNT_WIDGET_GROW_Y); DEBUG; } Modified: trunk/console/libgnt/gnttree.c =================================================================== --- trunk/console/libgnt/gnttree.c 2006-07-07 21:57:15 UTC (rev 16456) +++ trunk/console/libgnt/gnttree.c 2006-07-08 02:11:11 UTC (rev 16457) @@ -385,6 +385,7 @@ static void gnt_tree_init(GTypeInstance *instance, gpointer class) { + GNT_WIDGET_SET_FLAGS(GNT_WIDGET(instance), GNT_WIDGET_GROW_X | GNT_WIDGET_GROW_Y); DEBUG; } Modified: trunk/console/libgnt/gntutils.c =================================================================== --- trunk/console/libgnt/gntutils.c 2006-07-07 21:57:15 UTC (rev 16456) +++ trunk/console/libgnt/gntutils.c 2006-07-08 02:11:11 UTC (rev 16457) @@ -130,3 +130,39 @@ data2); } +void gnt_closure_marshal_BOOLEAN__INT_INT(GClosure *closure, + GValue *ret_value, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint, + gpointer marshal_data) +{ + typedef gboolean (*func) (gpointer data1, int, int, gpointer data2); + register func callback; + register GCClosure *cc = (GCClosure*)closure; + register gpointer data1, data2; + gboolean ret; + + g_return_if_fail(ret_value != NULL); + g_return_if_fail(n_param_values == 3); + + if (G_CCLOSURE_SWAP_DATA(closure)) + { + data1 = closure->data; + data2 = g_value_peek_pointer(param_values + 0); + } + else + { + data1 = g_value_peek_pointer(param_values + 0); + data2 = closure->data; + } + + callback = (func) (marshal_data ? marshal_data : cc->callback); + ret = callback(data1, + g_value_get_int(param_values + 1) , + g_value_get_int(param_values + 2) , + data2); + g_value_set_boolean(ret_value, ret); +} + + Modified: trunk/console/libgnt/gntutils.h =================================================================== --- trunk/console/libgnt/gntutils.h 2006-07-07 21:57:15 UTC (rev 16456) +++ trunk/console/libgnt/gntutils.h 2006-07-08 02:11:11 UTC (rev 16457) @@ -28,3 +28,10 @@ gpointer invocation_hint, gpointer marshal_data); +void gnt_closure_marshal_BOOLEAN__INT_INT(GClosure *closure, + GValue *ret_value, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint, + gpointer marshal_data); + Modified: trunk/console/libgnt/gntwidget.c =================================================================== --- trunk/console/libgnt/gntwidget.c 2006-07-07 21:57:15 UTC (rev 16456) +++ trunk/console/libgnt/gntwidget.c 2006-07-08 02:11:11 UTC (rev 16457) @@ -4,6 +4,8 @@ #include "gntutils.h" #include "gnt.h" +#define MIN_SIZE 5 + enum { SIG_DESTROY, @@ -15,6 +17,7 @@ SIG_ACTIVATE, SIG_EXPOSE, SIG_SIZE_REQUEST, + SIG_CONFIRM_SIZE, SIG_POSITION, SIGS }; @@ -22,6 +25,8 @@ static GObjectClass *parent_class = NULL; static guint signals[SIGS] = { 0 }; +static void init_widget(GntWidget *widget); + static void gnt_widget_init(GTypeInstance *instance, gpointer class) { @@ -63,6 +68,18 @@ gnt_widget_draw(widget); } +static gboolean +gnt_widget_dummy_confirm_size(GntWidget *widget, int width, int height) +{ + if (width < MIN_SIZE || height < MIN_SIZE) + return FALSE; + if (widget->priv.width != width && !GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_GROW_X)) + return FALSE; + if (widget->priv.height != height && !GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_GROW_Y)) + return FALSE; + return TRUE; +} + static void gnt_widget_class_init(GntWidgetClass *klass) { @@ -79,6 +96,7 @@ klass->map = gnt_widget_map; klass->lost_focus = gnt_widget_focus_change; klass->gained_focus = gnt_widget_focus_change; + klass->confirm_size = gnt_widget_dummy_confirm_size; klass->key_pressed = NULL; klass->activate = NULL; @@ -155,6 +173,14 @@ NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); + signals[SIG_CONFIRM_SIZE] = + g_signal_new("confirm_size", + G_TYPE_FROM_CLASS(klass), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET(GntWidgetClass, confirm_size), + NULL, NULL, + gnt_closure_marshal_BOOLEAN__INT_INT, + G_TYPE_BOOLEAN, 2, G_TYPE_INT, G_TYPE_INT); signals[SIG_KEY_PRESSED] = g_signal_new("key_pressed", G_TYPE_FROM_CLASS(klass), @@ -270,23 +296,8 @@ widget->window = newwin(widget->priv.height + shadow, widget->priv.width + shadow, widget->priv.y, widget->priv.x); - wbkgd(widget->window, COLOR_PAIR(GNT_COLOR_NORMAL)); - if (!(GNT_WIDGET_FLAGS(widget) & GNT_WIDGET_NO_BORDER)) - { - WINDOW *tmp = derwin(widget->window, widget->priv.height, widget->priv.width, 0, 0); - box(tmp, 0, 0); - delwin(tmp); - } - else - werase(widget->window); - - if (shadow) - { - wbkgdset(widget->window, '\0' | COLOR_PAIR(GNT_COLOR_SHADOW)); - mvwvline(widget->window, 1, widget->priv.width, ' ', widget->priv.height); - mvwhline(widget->window, widget->priv.height, 1, ' ', widget->priv.width); - } + init_widget(widget); } g_signal_emit(widget, signals[SIG_DRAW], 0); @@ -362,12 +373,65 @@ } -void +static void +init_widget(GntWidget *widget) +{ + gboolean shadow = TRUE; + + if (GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_NO_SHADOW)) + shadow = FALSE; + + wbkgd(widget->window, COLOR_PAIR(GNT_COLOR_NORMAL)); + werase(widget->window); + + if (!(GNT_WIDGET_FLAGS(widget) & GNT_WIDGET_NO_BORDER)) + { + WINDOW *tmp = derwin(widget->window, widget->priv.height, widget->priv.width, 0, 0); + box(tmp, 0, 0); + delwin(tmp); + } + + if (shadow) + { + wbkgdset(widget->window, '\0' | COLOR_PAIR(GNT_COLOR_SHADOW)); + mvwvline(widget->window, 1, widget->priv.width, ' ', widget->priv.height); + mvwhline(widget->window, widget->priv.height, 1, ' ', widget->priv.width); + } +} + +gboolean gnt_widget_set_size(GntWidget *widget, int width, int height) { - widget->priv.width = width; - widget->priv.height = height; - GNT_WIDGET_SET_FLAGS(widget, GNT_WIDGET_MAPPED); + gboolean ret = TRUE; + + if (GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_MAPPED)) + { + if (!GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_NO_SHADOW)) + { + width--; + height--; + } + g_signal_emit(widget, signals[SIG_CONFIRM_SIZE], 0, width, height, &ret); + } + + if (ret) + { + gboolean shadow = TRUE; + + if (GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_NO_SHADOW)) + shadow = FALSE; + + widget->priv.width = width; + widget->priv.height = height; + if (widget->window) + wresize(widget->window, height + shadow, width + shadow); + if (GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_MAPPED)) + init_widget(widget); + else + GNT_WIDGET_SET_FLAGS(widget, GNT_WIDGET_MAPPED); + } + + return ret; } gboolean Modified: trunk/console/libgnt/gntwidget.h =================================================================== --- trunk/console/libgnt/gntwidget.h 2006-07-07 21:57:15 UTC (rev 16456) +++ trunk/console/libgnt/gntwidget.h 2006-07-08 02:11:11 UTC (rev 16457) @@ -36,7 +36,9 @@ GNT_WIDGET_NO_SHADOW = 1 << 4, GNT_WIDGET_HAS_FOCUS = 1 << 5, GNT_WIDGET_DRAWING = 1 << 6, - GNT_WIDGET_URGENT = 1 << 7 + GNT_WIDGET_URGENT = 1 << 7, + GNT_WIDGET_GROW_X = 1 << 8, + GNT_WIDGET_GROW_Y = 1 << 9, } GntWidgetFlags; /* XXX: I'll have to ask grim what he's using this for in guifications. */ @@ -81,6 +83,7 @@ void (*lost_focus)(GntWidget *widget); void (*size_request)(GntWidget *widget); + gboolean (*confirm_size)(GntWidget *widget, int x, int y); void (*set_position)(GntWidget *widget, int x, int y); gboolean (*key_pressed)(GntWidget *widget, const char *key); void (*activate)(GntWidget *widget); @@ -104,7 +107,7 @@ void gnt_widget_set_position(GntWidget *widget, int x, int y); void gnt_widget_size_request(GntWidget *widget); void gnt_widget_get_size(GntWidget *widget, int *width, int *height); -void gnt_widget_set_size(GntWidget *widget, int width, int height); +gboolean gnt_widget_set_size(GntWidget *widget, int width, int height); gboolean gnt_widget_key_pressed(GntWidget *widget, const char *keys); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ebl...@us...> - 2006-07-07 21:57:19
|
Revision: 16456 Author: eblanton Date: 2006-07-07 14:57:15 -0700 (Fri, 07 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16456&view=rev Log Message: ----------- Suppress "Connect would have blocked", because it just confuses people Modified Paths: -------------- trunk/src/proxy.c Modified: trunk/src/proxy.c =================================================================== --- trunk/src/proxy.c 2006-07-07 07:18:08 UTC (rev 16455) +++ trunk/src/proxy.c 2006-07-07 21:57:15 UTC (rev 16456) @@ -1021,8 +1021,9 @@ if (connect(fd, (struct sockaddr *)addr, addrlen) < 0) { if ((errno == EINPROGRESS) || (errno == EINTR)) { - gaim_debug_warning("proxy", - "Connect would have blocked.\n"); + /* This just confuses people. */ + /* gaim_debug_warning("proxy", + "Connect would have blocked.\n"); */ phb->inpa = gaim_input_add(fd, GAIM_INPUT_WRITE, no_one_calls, phb); } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-07-07 07:18:12
|
Revision: 16455 Author: thekingant Date: 2006-07-07 00:18:08 -0700 (Fri, 07 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16455&view=rev Log Message: ----------- Oh man, I totally struck the hell out with all these changes. Switch the unordered list to a table to match the rest of the web page. Modified Paths: -------------- web/htdocs/summerofcode/index.php Modified: web/htdocs/summerofcode/index.php =================================================================== --- web/htdocs/summerofcode/index.php 2006-07-07 07:12:11 UTC (rev 16454) +++ web/htdocs/summerofcode/index.php 2006-07-07 07:18:08 UTC (rev 16455) @@ -30,23 +30,31 @@ <p>Last year Gaim was a very popular mentoring organization, and we had a very difficult time narrowing the candidates down to only fifteen. Many (very many) candidates chose to apply for one of our suggestions, which is fine, but keep in mind that when you apply for one of our suggestions you're competing yourself against hundreds of others for the same idea. When you propose your own idea, you're competing your <i>idea</i> against just a handful of other ideas, as well as highlighting your creativity.</p> <h1 id="accepted">Accepted Summer of Code Projects</h1> -<ul> -<li><b>QQ Support</b> - Tim Ringenbach is mentoring Mark Huetsch on this project to bring QQ support to Gaim. QQ is an extremely popular IM network in China, but doesn't have much of a foothold in the rest of the world.</li> +<table> +<tr><td class="highlight">QQ Support</td></tr> +<tr><td><p>Tim Ringenbach is mentoring Mark Huetsch on this project to bring QQ support to Gaim. QQ is an extremely popular IM network in China, but doesn't have much of a foothold in the rest of the world.</p></td></tr> -<li><b>MSN Protocol Update</b> - Sean Egan is mentoring Ma Yuan on this project to give our MSN code a facelift. We hope these changes will pave the way for lots of little MSN features that people have been requesting, including status messages.</li> +<tr><td class="highlight">MSN Protocol Update</td></tr> +<tr><td><p>Sean Egan is mentoring Ma Yuan on this project to give our MSN code a facelift. We hope these changes will pave the way for lots of little MSN features that people have been requesting, including status messages.</p></td></tr> -<li><b>Certificate Management</b> - Sean Egan is mentoring Gary Sivek for this project.</li> +<tr><td class="highlight">Certificate Management</td></tr> +<tr><td><p>Sean Egan is mentoring Gary Sivek for this project.</p></td></tr> -<li><b>Revamped Logging and Reporting</b> - Richard Laager is mentoring Bill Reading for this project. Bill is working on modifying the logging functionality to provide for better searching, higher performance, and is also working on implementing a logging plugin that stores logs in a SQL database.</li> +<tr><td class="highlight">Revamped Logging and Reporting</td></tr> +<tr><td><p>Richard Laager is mentoring Bill Reading for this project. Bill is working on modifying the logging functionality to provide for better searching, higher performance, and is also working on implementing a logging plugin that stores logs in a SQL database.</p></td></tr> -<li><b>General Performance Enhancement</b> - Ethan Blanton is mentoring Aaron Sheldon for this project. Aaron is profiling Gaim and making small code changes that fine-tune portions of Gaim's codebase to speed-up some of our more CPU intensive tasks.</li> +<tr><td class="highlight">General Performance Enhancement</td></tr> +<tr><td><p>Ethan Blanton is mentoring Aaron Sheldon for this project. Aaron is profiling Gaim and making small code changes that fine-tune portions of Gaim's codebase to speed-up some of our more CPU intensive tasks.</p></td></tr> -<li><b>Improved Logging</b> - Richard Laager is mentoring Brian Chu for this project. Brian is working on improving logging interoperability with other IM clients. Specifically, this involves collaborating on the design of a unified XML logging format and implementation of an XML logger in Gaim as well as working on a plugin to read the logs from other clients.</li> +<tr><td class="highlight">Improved Logging</td></tr> +<tr><td><p>Richard Laager is mentoring Brian Chu for this project. Brian is working on improving logging interoperability with other IM clients. Specifically, this involves collaborating on the design of a unified XML logging format and implementation of an XML logger in Gaim as well as working on a plugin to read the logs from other clients.</p></td></tr> -<li><b>Console-based Gaim using Curses</b> - Evan Schoenberg is mentoring Sadrul Habib Chowdhury for this project. This project consists of taking all the non-GTK parts of Gaim, bundling them into a library, then writing a console-based frontend that utilizes that library to connect to the IM networks in the same way that our current GTK frontend connects.</li> +<tr><td class="highlight">Console-based Gaim using Curses</td></tr> +<tr><td><p>Evan Schoenberg is mentoring Sadrul Habib Chowdhury for this project. This project consists of taking all the non-GTK parts of Gaim, bundling them into a library, then writing a console-based frontend that utilizes that library to connect to the IM networks in the same way that our current GTK frontend connects.</p></td></tr> -<li><b>Contact Availability Prediction</b> - Mark Doliner is mentoring Geoffrey Foster for this project. Geoffrey is working on a plugin that attempts to predict when your buddies will be online based on their past usage habits.</li> -</ul> +<tr><td class="highlight">Contact Availability Prediction</td></tr> +<tr><td><p>Mark Doliner is mentoring Geoffrey Foster for this project. Geoffrey is working on a plugin that attempts to predict when your buddies will be online based on their past usage habits.</p></td></tr> +</table> <h1 id="available">Summer of Code Project Suggestions</h1> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-07-07 07:12:17
|
Revision: 16454 Author: thekingant Date: 2006-07-07 00:12:11 -0700 (Fri, 07 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16454&view=rev Log Message: ----------- I think I like this better. Sorry for the commit email bombardment. Modified Paths: -------------- web/htdocs/summerofcode/index.php Modified: web/htdocs/summerofcode/index.php =================================================================== --- web/htdocs/summerofcode/index.php 2006-07-07 07:09:00 UTC (rev 16453) +++ web/htdocs/summerofcode/index.php 2006-07-07 07:12:11 UTC (rev 16454) @@ -17,7 +17,7 @@ <h2 class="news">Halfway Through the Summer</h2> <div class="newsdate">July 6th, 2006 - 11:58PM PDT</div> -<p>Dig it: Google has awarded us with <a href="#accepted">8 rockin' summer of code slots</a>, and we've hand-picked 8 rockin' summer of code students. Keep in mind that these are all still in progress, and while we have high hopes for all of them, it is possible some of these projects will not be completed.</p> +<p>Dig it: Google has awarded us with 8 rockin' summer of code slots, and we've hand-picked 8 rockin' summer of code students. Keep in mind that these are all still in progress, and while we have high hopes for all of them, it is possible some of these projects will not be completed. Scroll down a for the full project list, or <a href="#accepted">click here</a>.</p> <h2 class="news">Summer of Code Begins</h2> <div class="newsdate">May 1, 2006 - 11:16AM PDT</div> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-07-07 07:09:02
|
Revision: 16453 Author: thekingant Date: 2006-07-07 00:09:00 -0700 (Fri, 07 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16453&view=rev Log Message: ----------- ForlornPenguin pointed out that we have an "Accepted Projects" heading with no content, so I moved the list of projects down there. Cheeky monkey. Modified Paths: -------------- web/htdocs/summerofcode/index.php Modified: web/htdocs/summerofcode/index.php =================================================================== --- web/htdocs/summerofcode/index.php 2006-07-07 07:00:54 UTC (rev 16452) +++ web/htdocs/summerofcode/index.php 2006-07-07 07:09:00 UTC (rev 16453) @@ -17,8 +17,19 @@ <h2 class="news">Halfway Through the Summer</h2> <div class="newsdate">July 6th, 2006 - 11:58PM PDT</div> -<p>Dig it: Google has awarded us with 8 rockin' summer of code slots, and we've hand-picked 8 rockin' summer of code students. Keep in mind that these are all still in progress, and while we have high hopes for all of them, it is possible some of these projects will not be completed.</p> +<p>Dig it: Google has awarded us with <a href="#accepted">8 rockin' summer of code slots</a>, and we've hand-picked 8 rockin' summer of code students. Keep in mind that these are all still in progress, and while we have high hopes for all of them, it is possible some of these projects will not be completed.</p> +<h2 class="news">Summer of Code Begins</h2> +<div class="newsdate">May 1, 2006 - 11:16AM PDT</div> +<p>We are now accepting applications for Google's 2006 <a href='http://code.google.com/soc/'>Summer of Code</a> program. Look at the <a href='#available'>suggestions</a> below, or (even better), come up with your own idea, and consider applying! To apply, visit Google's <a href="http://code.google.com/soc/student_step1.html">Student Signup</a> webpage.</p> +<br /> + +<h1 id="intro">Introduction</h1> +<p>Gaim is proud to participate in the Google <a href="http://code.google.com/summerofcode.html">Summer of Code</a>. This summer Google is sponsoring students to work on free software projects under the mentorship of experienced free software developers. The Gaim developers are glad to volunteer to mentor some students and introduce them to the world of open-source development.</p> + +<p>Last year Gaim was a very popular mentoring organization, and we had a very difficult time narrowing the candidates down to only fifteen. Many (very many) candidates chose to apply for one of our suggestions, which is fine, but keep in mind that when you apply for one of our suggestions you're competing yourself against hundreds of others for the same idea. When you propose your own idea, you're competing your <i>idea</i> against just a handful of other ideas, as well as highlighting your creativity.</p> + +<h1 id="accepted">Accepted Summer of Code Projects</h1> <ul> <li><b>QQ Support</b> - Tim Ringenbach is mentoring Mark Huetsch on this project to bring QQ support to Gaim. QQ is an extremely popular IM network in China, but doesn't have much of a foothold in the rest of the world.</li> @@ -37,20 +48,7 @@ <li><b>Contact Availability Prediction</b> - Mark Doliner is mentoring Geoffrey Foster for this project. Geoffrey is working on a plugin that attempts to predict when your buddies will be online based on their past usage habits.</li> </ul> -<h2 class="news">Summer of Code Begins</h2> -<div class="newsdate">May 1, 2006 - 11:16AM PDT</div> -<p>We are now accepting applications for Google's 2006 <a href='http://code.google.com/soc/'>Summer of Code</a> program. Look at the <a href='#available'>suggestions</a> below, or (even better), come up with your own idea, and consider applying! To apply, visit Google's <a href="http://code.google.com/soc/student_step1.html">Student Signup</a> webpage.</p> -<br /> -<h1 id="intro">Introduction</h1> -<p>Gaim is proud to participate in the Google <a href="http://code.google.com/summerofcode.html">Summer of Code</a>. This summer Google is sponsoring students to work on free software projects under the mentorship of experienced free software developers. The Gaim developers are glad to volunteer to mentor some students and introduce them to the world of open-source development.</p> - -<p>Last year Gaim was a very popular mentoring organization, and we had a very difficult time narrowing the candidates down to only fifteen. Many (very many) candidates chose to apply for one of our suggestions, which is fine, but keep in mind that when you apply for one of our suggestions you're competing yourself against hundreds of others for the same idea. When you propose your own idea, you're competing your <i>idea</i> against just a handful of other ideas, as well as highlighting your creativity.</p> - -<h1 id="accepted">Accepted Summer of Code Projects</h1> -<p><i>No projects have yet been accepted.</i></p> - - <h1 id="available">Summer of Code Project Suggestions</h1> <p>Here are some of the suggestions proposed by Gaim developers for this year's Summer of Code.</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rl...@us...> - 2006-07-07 07:00:59
|
Revision: 16452 Author: rlaager Date: 2006-07-07 00:00:54 -0700 (Fri, 07 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16452&view=rev Log Message: ----------- Add a bit more specificity to Brian's project. Modified Paths: -------------- web/htdocs/summerofcode/index.php Modified: web/htdocs/summerofcode/index.php =================================================================== --- web/htdocs/summerofcode/index.php 2006-07-07 06:58:16 UTC (rev 16451) +++ web/htdocs/summerofcode/index.php 2006-07-07 07:00:54 UTC (rev 16452) @@ -30,7 +30,7 @@ <li><b>General Performance Enhancement</b> - Ethan Blanton is mentoring Aaron Sheldon for this project. Aaron is profiling Gaim and making small code changes that fine-tune portions of Gaim's codebase to speed-up some of our more CPU intensive tasks.</li> -<li><b>Improved Logging</b> - Richard Laager is mentoring Brian Chu for this project. Brian is working on improving logging interoperability with other IM clients.</li> +<li><b>Improved Logging</b> - Richard Laager is mentoring Brian Chu for this project. Brian is working on improving logging interoperability with other IM clients. Specifically, this involves collaborating on the design of a unified XML logging format and implementation of an XML logger in Gaim as well as working on a plugin to read the logs from other clients.</li> <li><b>Console-based Gaim using Curses</b> - Evan Schoenberg is mentoring Sadrul Habib Chowdhury for this project. This project consists of taking all the non-GTK parts of Gaim, bundling them into a library, then writing a console-based frontend that utilizes that library to connect to the IM networks in the same way that our current GTK frontend connects.</li> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rl...@us...> - 2006-07-07 06:58:24
|
Revision: 16451 Author: rlaager Date: 2006-07-06 23:58:16 -0700 (Thu, 06 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16451&view=rev Log Message: ----------- Document the logging projects. Modified Paths: -------------- web/htdocs/summerofcode/index.php Modified: web/htdocs/summerofcode/index.php =================================================================== --- web/htdocs/summerofcode/index.php 2006-07-07 06:52:51 UTC (rev 16450) +++ web/htdocs/summerofcode/index.php 2006-07-07 06:58:16 UTC (rev 16451) @@ -26,11 +26,11 @@ <li><b>Certificate Management</b> - Sean Egan is mentoring Gary Sivek for this project.</li> -<li><b>Revamped Logging and Reporting</b> - Richard Laager is mentoring William Reading for this project.</li> +<li><b>Revamped Logging and Reporting</b> - Richard Laager is mentoring Bill Reading for this project. Bill is working on modifying the logging functionality to provide for better searching, higher performance, and is also working on implementing a logging plugin that stores logs in a SQL database.</li> <li><b>General Performance Enhancement</b> - Ethan Blanton is mentoring Aaron Sheldon for this project. Aaron is profiling Gaim and making small code changes that fine-tune portions of Gaim's codebase to speed-up some of our more CPU intensive tasks.</li> -<li><b>Improved Logging</b> - Richard Laager is mentoring Brian Chu for this project.</li> +<li><b>Improved Logging</b> - Richard Laager is mentoring Brian Chu for this project. Brian is working on improving logging interoperability with other IM clients.</li> <li><b>Console-based Gaim using Curses</b> - Evan Schoenberg is mentoring Sadrul Habib Chowdhury for this project. This project consists of taking all the non-GTK parts of Gaim, bundling them into a library, then writing a console-based frontend that utilizes that library to connect to the IM networks in the same way that our current GTK frontend connects.</li> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-07-07 06:53:00
|
Revision: 16450 Author: thekingant Date: 2006-07-06 23:52:51 -0700 (Thu, 06 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16450&view=rev Log Message: ----------- Minor changes Modified Paths: -------------- web/htdocs/summerofcode/index.php Modified: web/htdocs/summerofcode/index.php =================================================================== --- web/htdocs/summerofcode/index.php 2006-07-07 06:48:57 UTC (rev 16449) +++ web/htdocs/summerofcode/index.php 2006-07-07 06:52:51 UTC (rev 16450) @@ -17,7 +17,7 @@ <h2 class="news">Halfway Through the Summer</h2> <div class="newsdate">July 6th, 2006 - 11:58PM PDT</div> -<p>Dig it: Google has awarded us with 8 rockin' summer of code slots, and we've hand-picked 8 rockin' summer of code students. Keep in mind that these are <i>projects</i> and are not completed</p> +<p>Dig it: Google has awarded us with 8 rockin' summer of code slots, and we've hand-picked 8 rockin' summer of code students. Keep in mind that these are all still in progress, and while we have high hopes for all of them, it is possible some of these projects will not be completed.</p> <ul> <li><b>QQ Support</b> - Tim Ringenbach is mentoring Mark Huetsch on this project to bring QQ support to Gaim. QQ is an extremely popular IM network in China, but doesn't have much of a foothold in the rest of the world.</li> @@ -34,7 +34,7 @@ <li><b>Console-based Gaim using Curses</b> - Evan Schoenberg is mentoring Sadrul Habib Chowdhury for this project. This project consists of taking all the non-GTK parts of Gaim, bundling them into a library, then writing a console-based frontend that utilizes that library to connect to the IM networks in the same way that our current GTK frontend connects.</li> -<li><b>Contact Availability Prediction</b> - Mark Doliner is mentoring Geoffrey Foster for this project. Geoffrey is working on a plugin that attempts to predict when your buddies will be online, based on their past usage habits.</li> +<li><b>Contact Availability Prediction</b> - Mark Doliner is mentoring Geoffrey Foster for this project. Geoffrey is working on a plugin that attempts to predict when your buddies will be online based on their past usage habits.</li> </ul> <h2 class="news">Summer of Code Begins</h2> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-07-07 06:49:00
|
Revision: 16449 Author: thekingant Date: 2006-07-06 23:48:57 -0700 (Thu, 06 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16449&view=rev Log Message: ----------- Updated our summer of code 2006 page and made a news post. Any Gaim devs with commit access are welcome to update any of this as you see fit. Modified Paths: -------------- web/htdocs/gary/bugs.xml web/htdocs/news.txt web/htdocs/summerofcode/index.php Modified: web/htdocs/gary/bugs.xml =================================================================== --- web/htdocs/gary/bugs.xml 2006-07-06 18:02:17 UTC (rev 16448) +++ web/htdocs/gary/bugs.xml 2006-07-07 06:48:57 UTC (rev 16449) @@ -93,8 +93,9 @@ <priority>normal</priority> <foundby>grim</foundby> <foundon>march 24</foundon> - <fixedby></fixedby> - <fixedon></fixedon> + <fixedby>Casey Harkins</fixedby> + <fixedon>13 November 2005</fixedon> + <patch>http://svn.sourceforge.net/viewcvs.cgi/gaim/trunk/src/gtkaccount.c?r1=14280&r2=14365&view=patch</patch> </bug> <bug> <number>10</number> @@ -131,8 +132,9 @@ <priority>normal</priority> <foundby>grim</foundby> <foundon>march 25</foundon> - <fixedby></fixedby> - <fixedon></fixedon> + <fixedby>Mike Stoddard</fixedby> + <fixedon>25 November 2005</fixedon> + <patch>http://svn.sourceforge.net/viewcvs.cgi/gaim/trunk/src/protocols/novell/novell.c?r1=14518&r2=14524&view=patch</patch> </bug> <bug> <number>14</number> @@ -242,8 +244,8 @@ <priority>normal</priority> <foundby>grim</foundby> <foundon>may 26</foundon> - <fixedby></fixedby> - <fixedon></fixedon> + <fixedby>unknown</fixedby> + <fixedon>unknown</fixedon> </bug> <bug> <number>25</number> @@ -260,8 +262,8 @@ <priority>normal</priority> <foundby>rlaager</foundby> <foundon>june 12</foundon> - <fixedby></fixedby> - <fixedon></fixedon> + <fixedby>unknown</fixedby> + <fixedon>unknown</fixedon> </bug> <bug> <number>27</number> @@ -305,8 +307,8 @@ <priority>normal</priority> <foundby>grim or bleeter</foundby> <foundon>A while ago</foundon> - <fixedby></fixedby> - <fixedon></fixedon> + <fixedby>This isn't a bug. User's aren't supposed to change their privacy setting. It's changed automatically when the user toggles their invisible state.</fixedby> + <fixedon>n/a</fixedon> </bug> <bug> <number>32</number> Modified: web/htdocs/news.txt =================================================================== --- web/htdocs/news.txt 2006-07-06 18:02:17 UTC (rev 16448) +++ web/htdocs/news.txt 2006-07-07 06:48:57 UTC (rev 16449) @@ -1,6 +1,10 @@ +Summer of Code Update +July 6th, 2006 - 11:58PM PDT +Sorry it's been so long since we last posted some news. Apparently we're busy people ...or maybe we're just lazy. Anyhoo, we've been alotted 8 summer of code projects this year. See our <a href="summerofcode/">Summer of Code</a> web page for more detailed info. +# Summer of Code 2006 May 1st, 2006 - 2:41PM PDT -Google is now accepting applications for its 2006 <a href='http://code.google.com/soc'>Summer of Code</a>. Gaim is a mentor again this summer, so take a look at some our suggested <a href='http://gaim.sf.net/summerofcode'>projects</a>, and consider applying today! +Google is now accepting applications for its 2006 <a href='http://code.google.com/soc'>Summer of Code</a>. Gaim is a mentor again this summer, so take a look at some our suggested <a href='summerofcode/'>projects</a>, and consider applying today! # Beta 3: What goes up must fall down? March 29th, 2006 - 1:27PM EST Modified: web/htdocs/summerofcode/index.php =================================================================== --- web/htdocs/summerofcode/index.php 2006-07-06 18:02:17 UTC (rev 16448) +++ web/htdocs/summerofcode/index.php 2006-07-07 06:48:57 UTC (rev 16449) @@ -15,6 +15,28 @@ <h1 id="news">News</h1> +<h2 class="news">Halfway Through the Summer</h2> +<div class="newsdate">July 6th, 2006 - 11:58PM PDT</div> +<p>Dig it: Google has awarded us with 8 rockin' summer of code slots, and we've hand-picked 8 rockin' summer of code students. Keep in mind that these are <i>projects</i> and are not completed</p> + +<ul> +<li><b>QQ Support</b> - Tim Ringenbach is mentoring Mark Huetsch on this project to bring QQ support to Gaim. QQ is an extremely popular IM network in China, but doesn't have much of a foothold in the rest of the world.</li> + +<li><b>MSN Protocol Update</b> - Sean Egan is mentoring Ma Yuan on this project to give our MSN code a facelift. We hope these changes will pave the way for lots of little MSN features that people have been requesting, including status messages.</li> + +<li><b>Certificate Management</b> - Sean Egan is mentoring Gary Sivek for this project.</li> + +<li><b>Revamped Logging and Reporting</b> - Richard Laager is mentoring William Reading for this project.</li> + +<li><b>General Performance Enhancement</b> - Ethan Blanton is mentoring Aaron Sheldon for this project. Aaron is profiling Gaim and making small code changes that fine-tune portions of Gaim's codebase to speed-up some of our more CPU intensive tasks.</li> + +<li><b>Improved Logging</b> - Richard Laager is mentoring Brian Chu for this project.</li> + +<li><b>Console-based Gaim using Curses</b> - Evan Schoenberg is mentoring Sadrul Habib Chowdhury for this project. This project consists of taking all the non-GTK parts of Gaim, bundling them into a library, then writing a console-based frontend that utilizes that library to connect to the IM networks in the same way that our current GTK frontend connects.</li> + +<li><b>Contact Availability Prediction</b> - Mark Doliner is mentoring Geoffrey Foster for this project. Geoffrey is working on a plugin that attempts to predict when your buddies will be online, based on their past usage habits.</li> +</ul> + <h2 class="news">Summer of Code Begins</h2> <div class="newsdate">May 1, 2006 - 11:16AM PDT</div> <p>We are now accepting applications for Google's 2006 <a href='http://code.google.com/soc/'>Summer of Code</a> program. Look at the <a href='#available'>suggestions</a> below, or (even better), come up with your own idea, and consider applying! To apply, visit Google's <a href="http://code.google.com/soc/student_step1.html">Student Signup</a> webpage.</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sea...@us...> - 2006-07-06 18:02:19
|
Revision: 16448 Author: seanegan Date: 2006-07-06 11:02:17 -0700 (Thu, 06 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16448&view=rev Log Message: ----------- unitialized variable Modified Paths: -------------- trunk/console/gntgaim.c Modified: trunk/console/gntgaim.c =================================================================== --- trunk/console/gntgaim.c 2006-07-06 17:54:46 UTC (rev 16447) +++ trunk/console/gntgaim.c 2006-07-06 18:02:17 UTC (rev 16448) @@ -156,7 +156,7 @@ gboolean opt_version = FALSE; char *opt_config_dir_arg = NULL; char *opt_session_arg = NULL; - gboolean debug_enabled; + gboolean debug_enabled = FALSE; struct option long_options[] = { {"config", required_argument, NULL, 'c'}, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-07-06 17:55:00
|
Revision: 16447 Author: sadrul Date: 2006-07-06 10:54:46 -0700 (Thu, 06 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16447&view=rev Log Message: ----------- Pseudo-shadow effect for the windows and buttons. Uses non-ASCII emblems for buddies in the buddy-list if locale is set to UTF. Modified Paths: -------------- trunk/console/gntblist.c trunk/console/gntconv.c trunk/console/gntgaim.c trunk/console/libgnt/Makefile.am trunk/console/libgnt/gnt.h trunk/console/libgnt/gntbox.c trunk/console/libgnt/gntmain.c trunk/console/libgnt/gnttextview.c trunk/console/libgnt/gnttree.c trunk/console/libgnt/gntwidget.c trunk/console/libgnt/gntwidget.h trunk/console/libgnt/test/multiwin.c Modified: trunk/console/gntblist.c =================================================================== --- trunk/console/gntblist.c 2006-07-06 09:22:18 UTC (rev 16446) +++ trunk/console/gntblist.c 2006-07-06 17:54:46 UTC (rev 16447) @@ -141,7 +141,7 @@ GaimStatusPrimitive prim; GaimPresence *presence; GaimStatus *now; - + gboolean ascii = gnt_ascii_only(); presence = gaim_buddy_get_presence(buddy); now = gaim_presence_get_active_status(presence); @@ -150,29 +150,15 @@ switch(prim) { -#if 1 case GAIM_STATUS_OFFLINE: - strncpy(status, "x", sizeof(status) - 1); + strncpy(status, ascii ? "x" : "⊗", sizeof(status) - 1); break; case GAIM_STATUS_AVAILABLE: - strncpy(status, "o", sizeof(status) - 1); + strncpy(status, ascii ? "o" : "◯", sizeof(status) - 1); break; default: - strncpy(status, ".", sizeof(status) - 1); + strncpy(status, ascii ? "." : "⊖", sizeof(status) - 1); break; -#else - /* XXX: Let's use these some time */ - case GAIM_STATUS_OFFLINE: - strncpy(status, "⊗", sizeof(status) - 1); - break; - case GAIM_STATUS_AVAILABLE: - /* XXX: Detect idleness */ - strncpy(status, "◯", sizeof(status) - 1); - break; - default: - strncpy(status, "⊖", sizeof(status) - 1); - break; -#endif } name = gaim_buddy_get_alias(buddy); } @@ -412,7 +398,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) - 3); + gnt_widget_set_size(ggblist->tree, 25, getmaxy(stdscr) - 4); 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-06 09:22:18 UTC (rev 16446) +++ trunk/console/gntconv.c 2006-07-06 17:54:46 UTC (rev 16447) @@ -116,7 +116,7 @@ ggc->tv = gnt_text_view_new(); gnt_box_add_widget(GNT_BOX(ggc->window), ggc->tv); gnt_widget_set_name(ggc->tv, "conversation-window-textview"); - gnt_widget_set_size(ggc->tv, getmaxx(stdscr) - 2 - x - width, getmaxy(stdscr) - 4); + gnt_widget_set_size(ggc->tv, getmaxx(stdscr) - 3 - x - width, getmaxy(stdscr) - 5); ggc->entry = gnt_entry_new(NULL); gnt_box_add_widget(GNT_BOX(ggc->window), ggc->entry); Modified: trunk/console/gntgaim.c =================================================================== --- trunk/console/gntgaim.c 2006-07-06 09:22:18 UTC (rev 16446) +++ trunk/console/gntgaim.c 2006-07-06 17:54:46 UTC (rev 16447) @@ -228,7 +228,7 @@ */ /* Because we don't want debug-messages to show up and corrup the display */ - gaim_debug_set_enabled(FALSE); + gaim_debug_set_enabled(debug_enabled); gaim_core_set_ui_ops(gnt_core_get_ui_ops()); gaim_eventloop_set_ui_ops(gnt_eventloop_get_ui_ops()); Modified: trunk/console/libgnt/Makefile.am =================================================================== --- trunk/console/libgnt/Makefile.am 2006-07-06 09:22:18 UTC (rev 16446) +++ trunk/console/libgnt/Makefile.am 2006-07-06 17:54:46 UTC (rev 16447) @@ -40,4 +40,5 @@ -lncursesw -lpanelw AM_CPPFLAGS = \ - $(GLIB_CFLAGS) + $(GLIB_CFLAGS) \ + -Wall Modified: trunk/console/libgnt/gnt.h =================================================================== --- trunk/console/libgnt/gnt.h 2006-07-06 09:22:18 UTC (rev 16446) +++ trunk/console/libgnt/gnt.h 2006-07-06 17:54:46 UTC (rev 16447) @@ -7,6 +7,8 @@ void gnt_main(); +gboolean gnt_ascii_only(); + void gnt_screen_occupy(GntWidget *widget); void gnt_screen_release(GntWidget *widget); Modified: trunk/console/libgnt/gntbox.c =================================================================== --- trunk/console/libgnt/gntbox.c 2006-07-06 09:22:18 UTC (rev 16446) +++ trunk/console/libgnt/gntbox.c 2006-07-06 17:54:46 UTC (rev 16447) @@ -383,15 +383,18 @@ for (iter = box->list; iter; iter = iter->next) { GntWidget *w = GNT_WIDGET(iter->data); + int height, width; if (GNT_IS_BOX(w)) gnt_box_sync_children(GNT_BOX(w)); + gnt_widget_get_size(w, &width, &height); + copywin(w->window, widget->window, 0, 0, w->priv.y - widget->priv.y, w->priv.x - widget->priv.x, - w->priv.y - widget->priv.y + w->priv.height - 1, - w->priv.x - widget->priv.x + w->priv.width - 1, + w->priv.y - widget->priv.y + height - 1, + w->priv.x - widget->priv.x + width - 1, FALSE); } } Modified: trunk/console/libgnt/gntmain.c =================================================================== --- trunk/console/libgnt/gntmain.c 2006-07-06 09:22:18 UTC (rev 16446) +++ trunk/console/libgnt/gntmain.c 2006-07-06 17:54:46 UTC (rev 16447) @@ -20,6 +20,8 @@ static int Y_MIN; static int Y_MAX; +static gboolean ascii_only; + static GMainLoop *loop; static struct { @@ -314,10 +316,12 @@ } else if (strcmp(buffer + 1, "m") == 0 && focus_list) { + /* Move a window */ mode = GNT_KP_MODE_MOVE; } else if (strcmp(buffer + 1, "w") == 0 && focus_list) { + /* Window list */ mode = GNT_KP_MODE_WINDOW_LIST; show_window_list(); } @@ -375,11 +379,11 @@ if (changed) { - lock_focus_list = 1; - gnt_widget_hide(widget); + GntNode *node = g_hash_table_lookup(nodes, widget); gnt_widget_set_position(widget, x, y); - gnt_widget_show(widget); - lock_focus_list = 0; + move_panel(node->panel, y, x); + update_panels(); + doupdate(); } } else if (*buffer == '\r') @@ -419,8 +423,13 @@ int result = g_io_add_watch(channel, (G_IO_IN | G_IO_HUP | G_IO_ERR), io_invoke, NULL); + const char *locale = setlocale(LC_ALL, ""); - setlocale(LC_ALL, ""); + if (locale && (strstr(locale, "UTF") || strstr(locale, "utf"))) + ascii_only = FALSE; + else + ascii_only = TRUE; + initscr(); start_color(); gnt_init_colors(); @@ -459,6 +468,7 @@ free_node(gpointer data) { GntNode *node = data; + hide_panel(node->panel); del_panel(node->panel); g_free(node); } @@ -582,3 +592,8 @@ endwin(); } +gboolean gnt_ascii_only() +{ + return ascii_only; +} + Modified: trunk/console/libgnt/gnttextview.c =================================================================== --- trunk/console/libgnt/gnttextview.c 2006-07-06 09:22:18 UTC (rev 16446) +++ trunk/console/libgnt/gnttextview.c 2006-07-06 17:54:46 UTC (rev 16447) @@ -152,7 +152,7 @@ GntTextView *view = GNT_TEXT_VIEW(widget); GntTextLine *line = g_new0(GntTextLine, 1); - GNT_WIDGET_SET_FLAGS(widget, GNT_WIDGET_NO_BORDER); + GNT_WIDGET_SET_FLAGS(widget, GNT_WIDGET_NO_BORDER | GNT_WIDGET_NO_SHADOW); view->list = g_list_append(view->list, line); @@ -198,7 +198,7 @@ { GntTextSegment *seg = g_new0(GntTextSegment, 1); seg->flags = fl; - seg->text = g_new0(char, len); /* XXX: MUST be improved */ + seg->text = g_new0(char, len + 1); /* XXX: MUST be improved */ g_utf8_strncpy(seg->text, iter, widget->priv.width - line->length - 1); line->segments = g_list_append(line->segments, seg); Modified: trunk/console/libgnt/gnttree.c =================================================================== --- trunk/console/libgnt/gnttree.c 2006-07-06 09:22:18 UTC (rev 16446) +++ trunk/console/libgnt/gnttree.c 2006-07-06 17:54:46 UTC (rev 16447) @@ -216,10 +216,14 @@ else wbkgdset(widget->window, '\0' | COLOR_PAIR(GNT_COLOR_HIGHLIGHT_D)); mvwprintw(widget->window, start, pos, str); + whline(widget->window, ' ', widget->priv.width - pos * 2 - g_utf8_strlen(str, -1)); wbkgdset(widget->window, '\0' | COLOR_PAIR(GNT_COLOR_NORMAL)); } else + { mvwprintw(widget->window, start, pos, str); + whline(widget->window, ' ', widget->priv.width - pos * 2 - g_utf8_strlen(str, -1)); + } tree->bottom = row; } @@ -505,7 +509,7 @@ } else { - int position; + int position = 0; if (bigbro) { @@ -671,7 +675,7 @@ GntTreeRow *row = g_hash_table_lookup(tree->hash, key); if (!row) - return; + return FALSE; g_return_val_if_fail(row->choice, FALSE); return row->isselected; Modified: trunk/console/libgnt/gntwidget.c =================================================================== --- trunk/console/libgnt/gntwidget.c 2006-07-06 09:22:18 UTC (rev 16446) +++ trunk/console/libgnt/gntwidget.c 2006-07-06 17:54:46 UTC (rev 16447) @@ -263,34 +263,32 @@ if (widget->window == NULL) { - /* XXX: It may be necessary to make sure the size hasn't changed */ - widget->window = newwin(widget->priv.height, widget->priv.width, + gboolean shadow = TRUE; + + if (GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_NO_SHADOW)) + shadow = FALSE; + + widget->window = newwin(widget->priv.height + shadow, widget->priv.width + shadow, widget->priv.y, widget->priv.x); wbkgd(widget->window, COLOR_PAIR(GNT_COLOR_NORMAL)); if (!(GNT_WIDGET_FLAGS(widget) & GNT_WIDGET_NO_BORDER)) - box(widget->window, 0, 0); + { + WINDOW *tmp = derwin(widget->window, widget->priv.height, widget->priv.width, 0, 0); + box(tmp, 0, 0); + delwin(tmp); + } else werase(widget->window); - } -#if 0 - /* XXX: No shadow for now :( */ - if (!(GNT_WIDGET_FLAGS(widget) & GNT_WIDGET_NO_SHADOW)) - { - widget->back = newwin(widget->priv.height, widget->priv.width, - widget->priv.y + 1, widget->priv.x + 1); - wbkgd(widget->back, COLOR_PAIR(GNT_COLOR_SHADOW)); - werase(widget->back); - - mvwchgat(widget->back, 0, 0, widget->priv.height, - A_REVERSE | A_BLINK, 0, 0); - touchline(widget->back, 0, widget->priv.height); - wrefresh(widget->back); + if (shadow) + { + wbkgdset(widget->window, '\0' | COLOR_PAIR(GNT_COLOR_SHADOW)); + mvwvline(widget->window, 1, widget->priv.width, ' ', widget->priv.height); + mvwhline(widget->window, widget->priv.height, 1, ' ', widget->priv.width); + } } - wrefresh(widget->window); -#endif g_signal_emit(widget, signals[SIG_DRAW], 0); gnt_widget_queue_update(widget); GNT_WIDGET_UNSET_FLAGS(widget, GNT_WIDGET_DRAWING); @@ -316,6 +314,11 @@ gnt_widget_hide(GntWidget *widget) { wbkgdset(widget->window, '\0' | COLOR_PAIR(GNT_COLOR_NORMAL)); +#if 1 + /* XXX: I have no clue why, but this seems to be necessary. */ + if (!GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_NO_SHADOW)) + mvwvline(widget->window, 1, widget->priv.width, ' ', widget->priv.height); +#endif gnt_screen_release(widget); GNT_WIDGET_UNSET_FLAGS(widget, GNT_WIDGET_MAPPED); } @@ -327,10 +330,6 @@ wid->priv.x = x; wid->priv.y = y; - /* XXX: I am supposed to move_panel ... but that seems to crash */ - if (wid->window) - mvwin(wid->window, y, x); - g_signal_emit(wid, signals[SIG_POSITION], 0, x, y); } @@ -352,10 +351,15 @@ void gnt_widget_get_size(GntWidget *wid, int *width, int *height) { + gboolean shadow = TRUE; + if (GNT_WIDGET_IS_FLAG_SET(wid, GNT_WIDGET_NO_SHADOW)) + shadow = FALSE; + if (width) - *width = wid->priv.width; + *width = wid->priv.width + shadow; if (height) - *height = wid->priv.height; + *height = wid->priv.height + shadow; + } void Modified: trunk/console/libgnt/gntwidget.h =================================================================== --- trunk/console/libgnt/gntwidget.h 2006-07-06 09:22:18 UTC (rev 16446) +++ trunk/console/libgnt/gntwidget.h 2006-07-06 17:54:46 UTC (rev 16447) @@ -61,7 +61,6 @@ GntWidgetPriv priv; WINDOW *window; - WINDOW *back; void (*gnt_reserved1)(void); void (*gnt_reserved2)(void); Modified: trunk/console/libgnt/test/multiwin.c =================================================================== --- trunk/console/libgnt/test/multiwin.c 2006-07-06 09:22:18 UTC (rev 16446) +++ trunk/console/libgnt/test/multiwin.c 2006-07-06 17:54:46 UTC (rev 16447) @@ -8,7 +8,6 @@ gboolean show(GntWidget *w) { - gnt_widget_destroy(w); return FALSE; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-07-06 09:22:20
|
Revision: 16446 Author: thekingant Date: 2006-07-06 02:22:18 -0700 (Thu, 06 Jul 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16446&view=rev Log Message: ----------- Backport SVN revision #16445 from HEAD to v2_0_0 Original commit message: Fix a crash bug on some systems (mostly amd64) caused by using a va_list twice. My bad! Thanks to Kevin Stange and Vincent Ho for noticing this and suggesting the cause. Vincent's IRC handle reminds me of a Harvey Danger song. ViewCVS Links: ------------- http://svn.sourceforge.net/gaim/?rev=16445&view=rev Modified Paths: -------------- branches/v2_0_0/src/debug.c branches/v2_0_0/src/debug.h branches/v2_0_0/src/gtkdebug.c Modified: branches/v2_0_0/src/debug.c =================================================================== --- branches/v2_0_0/src/debug.c 2006-07-06 09:21:57 UTC (rev 16445) +++ branches/v2_0_0/src/debug.c 2006-07-06 09:22:18 UTC (rev 16446) @@ -46,15 +46,21 @@ const char *format, va_list args) { GaimDebugUiOps *ops; + char *arg_s = NULL; g_return_if_fail(level != GAIM_DEBUG_ALL); g_return_if_fail(format != NULL); + ops = gaim_debug_get_ui_ops(); + + if (!debug_enabled && ((ops == NULL) || (ops->print == NULL))) + return; + + arg_s = g_strdup_vprintf(format, args); + if (debug_enabled) { - gchar *arg_s, *ts_s; + gchar *ts_s; - arg_s = g_strdup_vprintf(format, args); - if ((category != NULL) && (gaim_prefs_exists("/core/debug/timestamps")) && (gaim_prefs_get_bool("/core/debug/timestamps"))) { @@ -72,14 +78,13 @@ else g_print("%s%s: %s", ts_s, category, arg_s); - g_free(arg_s); g_free(ts_s); } - ops = gaim_debug_get_ui_ops(); + if (ops != NULL && ops->print != NULL) + ops->print(level, category, arg_s); - if (ops != NULL && ops->print != NULL) - ops->print(level, category, format, args); + g_free(arg_s); } void Modified: branches/v2_0_0/src/debug.h =================================================================== --- branches/v2_0_0/src/debug.h 2006-07-06 09:21:57 UTC (rev 16445) +++ branches/v2_0_0/src/debug.h 2006-07-06 09:22:18 UTC (rev 16446) @@ -48,7 +48,7 @@ typedef struct { void (*print)(GaimDebugLevel level, const char *category, - const char *format, va_list args); + const char *arg_s); } GaimDebugUiOps; #ifdef __cplusplus Modified: branches/v2_0_0/src/gtkdebug.c =================================================================== --- branches/v2_0_0/src/gtkdebug.c 2006-07-06 09:21:57 UTC (rev 16445) +++ branches/v2_0_0/src/gtkdebug.c 2006-07-06 09:22:18 UTC (rev 16446) @@ -931,13 +931,13 @@ static void gaim_gtk_debug_print(GaimDebugLevel level, const char *category, - const char *format, va_list args) + const char *arg_s) { #ifdef HAVE_REGEX_H GtkTreeIter iter; #endif /* HAVE_REGEX_H */ gboolean timestamps; - gchar *arg_s, *ts_s; + gchar *ts_s; gchar *esc_s, *cat_s, *tmp, *s; if (!gaim_prefs_get_bool("/gaim/gtk/debug/enabled") || @@ -948,8 +948,6 @@ timestamps = gaim_prefs_get_bool("/core/debug/timestamps"); - arg_s = g_strdup_vprintf(format, args); - /* * For some reason we only print the timestamp if category is * not NULL. Why the hell do we do that? --Mark @@ -971,8 +969,6 @@ esc_s = g_markup_escape_text(arg_s, -1); - g_free(arg_s); - s = g_strdup_printf("<font color=\"%s\">%s%s%s</font>", debug_fg_colors[level], ts_s, cat_s, esc_s); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |