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-08-19 03:38:35
|
Revision: 16870 Author: sadrul Date: 2006-08-18 20:38:23 -0700 (Fri, 18 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16870&view=rev Log Message: ----------- Do the right thing: remove the compile warnings. Modified Paths: -------------- trunk/console/gntaccount.h trunk/console/gntblist.c trunk/console/gntblist.h trunk/console/gntconn.h trunk/console/gntconv.h trunk/console/gntdebug.h trunk/console/gntgaim.c trunk/console/gntgaim.h trunk/console/gntnotify.c trunk/console/gntnotify.h trunk/console/gntplugin.h trunk/console/gntprefs.c trunk/console/gntprefs.h trunk/console/gntrequest.c trunk/console/gntrequest.h trunk/console/gntstatus.h trunk/console/gntui.h trunk/console/libgnt/gntwidget.h Modified: trunk/console/gntaccount.h =================================================================== --- trunk/console/gntaccount.h 2006-08-19 02:57:06 UTC (rev 16869) +++ trunk/console/gntaccount.h 2006-08-19 03:38:23 UTC (rev 16870) @@ -1,10 +1,14 @@ +#ifndef _GNT_ACCOUNT_H +#define _GNT_ACCOUNT_H + #include "account.h" -GaimAccountUiOps *gg_accounts_get_ui_ops(); +GaimAccountUiOps *gg_accounts_get_ui_ops(void); -void gg_accounts_init(); +void gg_accounts_init(void); -void gg_accounts_uninit(); +void gg_accounts_uninit(void); -void gg_accounts_show_all(); +void gg_accounts_show_all(void); +#endif Modified: trunk/console/gntblist.c =================================================================== --- trunk/console/gntblist.c 2006-08-19 02:57:06 UTC (rev 16869) +++ trunk/console/gntblist.c 2006-08-19 03:38:23 UTC (rev 16870) @@ -672,8 +672,8 @@ static void gg_blist_remove_node_cb(GaimBlistNode *node, GaimBlistNode *null) { - char *primary, *sec = NULL; - const char *name; + char *primary; + const char *name, *sec = NULL; if (GAIM_BLIST_NODE_IS_BUDDY(node)) name = gaim_buddy_get_name((GaimBuddy*)node); Modified: trunk/console/gntblist.h =================================================================== --- trunk/console/gntblist.h 2006-08-19 02:57:06 UTC (rev 16869) +++ trunk/console/gntblist.h 2006-08-19 03:38:23 UTC (rev 16870) @@ -1,12 +1,15 @@ +#ifndef _GNT_BLIST_H +#define _GNT_BLIST_H + #include "blist.h" -GaimBlistUiOps * gg_blist_get_ui_ops(); +GaimBlistUiOps * gg_blist_get_ui_ops(void); -void gg_blist_init(); +void gg_blist_init(void); -void gg_blist_uninit(); +void gg_blist_uninit(void); -void gg_blist_show(); +void gg_blist_show(void); void gg_blist_get_position(int *x, int *y); @@ -16,3 +19,4 @@ void gg_blist_set_size(int width, int height); +#endif Modified: trunk/console/gntconn.h =================================================================== --- trunk/console/gntconn.h 2006-08-19 02:57:06 UTC (rev 16869) +++ trunk/console/gntconn.h 2006-08-19 03:38:23 UTC (rev 16870) @@ -1,8 +1,12 @@ +#ifndef _GNT_CONN_H +#define _GNT_CONN_H + #include "connection.h" -GaimConnectionUiOps *gg_connections_get_ui_ops(); +GaimConnectionUiOps *gg_connections_get_ui_ops(void); -void gg_connections_init(); +void gg_connections_init(void); -void gg_connections_uninit(); +void gg_connections_uninit(void); +#endif Modified: trunk/console/gntconv.h =================================================================== --- trunk/console/gntconv.h 2006-08-19 02:57:06 UTC (rev 16869) +++ trunk/console/gntconv.h 2006-08-19 03:38:23 UTC (rev 16870) @@ -1,7 +1,12 @@ +#ifndef _GNT_CONV_H +#define _GNT_CONV_H + #include "conversation.h" -GaimConversationUiOps *gg_conv_get_ui_ops(); +GaimConversationUiOps *gg_conv_get_ui_ops(void); -void gg_conversation_init(); +void gg_conversation_init(void); -void gg_conversation_uninit(); +void gg_conversation_uninit(void); + +#endif Modified: trunk/console/gntdebug.h =================================================================== --- trunk/console/gntdebug.h 2006-08-19 02:57:06 UTC (rev 16869) +++ trunk/console/gntdebug.h 2006-08-19 03:38:23 UTC (rev 16870) @@ -1,9 +1,14 @@ +#ifndef _GNT_DEBUG_H +#define _GNT_DEBUG_H + #include "debug.h" -GaimDebugUiOps *gg_debug_get_ui_ops(); +GaimDebugUiOps *gg_debug_get_ui_ops(void); -void gg_debug_init(); +void gg_debug_init(void); -void gg_debug_uninit(); +void gg_debug_uninit(void); -void gg_debug_window_show(); +void gg_debug_window_show(void); + +#endif Modified: trunk/console/gntgaim.c =================================================================== --- trunk/console/gntgaim.c 2006-08-19 02:57:06 UTC (rev 16869) +++ trunk/console/gntgaim.c 2006-08-19 03:38:23 UTC (rev 16870) @@ -129,7 +129,7 @@ (guint (*)(guint))g_source_remove }; -GaimEventLoopUiOps * +static GaimEventLoopUiOps * gnt_eventloop_get_ui_ops(void) { return &eventloop_ops; Modified: trunk/console/gntgaim.h =================================================================== --- trunk/console/gntgaim.h 2006-08-19 02:57:06 UTC (rev 16869) +++ trunk/console/gntgaim.h 2006-08-19 03:38:23 UTC (rev 16870) @@ -1,6 +1,6 @@ #include <glib.h> -#include <libintl.h> +#include "libgaim/internal.h" + #define GAIM_GNT_UI "gnt-gaim" -#define _(x) x Modified: trunk/console/gntnotify.c =================================================================== --- trunk/console/gntnotify.c 2006-08-19 02:57:06 UTC (rev 16869) +++ trunk/console/gntnotify.c 2006-08-19 03:38:23 UTC (rev 16870) @@ -293,6 +293,8 @@ case GAIM_NOTIFY_BUTTON_INVITE: text = _("Invite"); break; + default: + text = _("(none)"); } button = gnt_button_new(text); Modified: trunk/console/gntnotify.h =================================================================== --- trunk/console/gntnotify.h 2006-08-19 02:57:06 UTC (rev 16869) +++ trunk/console/gntnotify.h 2006-08-19 03:38:23 UTC (rev 16870) @@ -1,8 +1,13 @@ +#ifndef _GNT_NOTIFY_H +#define _GNT_NOTIFY_H + #include "notify.h" -GaimNotifyUiOps *gg_notify_get_ui_ops(); +GaimNotifyUiOps *gg_notify_get_ui_ops(void); -void gg_notify_init(); +void gg_notify_init(void); -void gg_notify_uninit(); +void gg_notify_uninit(void); +#endif + Modified: trunk/console/gntplugin.h =================================================================== --- trunk/console/gntplugin.h 2006-08-19 02:57:06 UTC (rev 16869) +++ trunk/console/gntplugin.h 2006-08-19 03:38:23 UTC (rev 16870) @@ -1,3 +1,6 @@ +#ifndef _GNT_PLUGIN_H +#define _GNT_PLUGIN_H + #include <gnt.h> #include <plugin.h> @@ -16,7 +19,8 @@ #define GAIM_GNT_PLUGIN_UI_INFO(plugin) \ (GGPluginFrame)((plugin)->info->ui_info) -void gg_plugins_show_all(); +void gg_plugins_show_all(void); -void gg_plugins_save_loaded(); +void gg_plugins_save_loaded(void); +#endif Modified: trunk/console/gntprefs.c =================================================================== --- trunk/console/gntprefs.c 2006-08-19 02:57:06 UTC (rev 16869) +++ trunk/console/gntprefs.c 2006-08-19 03:38:23 UTC (rev 16870) @@ -46,15 +46,15 @@ switch (prefs->type) { case GAIM_PREF_BOOLEAN: - field = gaim_request_field_bool_new(prefs->pref, prefs->label, + field = gaim_request_field_bool_new(prefs->pref, _(prefs->label), gaim_prefs_get_bool(prefs->pref)); break; case GAIM_PREF_INT: - field = gaim_request_field_int_new(prefs->pref, prefs->label, + field = gaim_request_field_int_new(prefs->pref, _(prefs->label), gaim_prefs_get_int(prefs->pref)); break; case GAIM_PREF_STRING: - field = gaim_request_field_string_new(prefs->pref, prefs->label, + field = gaim_request_field_string_new(prefs->pref, _(prefs->label), gaim_prefs_get_string(prefs->pref), FALSE); break; default: @@ -64,7 +64,7 @@ else { GList *list = prefs->lv(), *iter; - field = gaim_request_field_list_new(prefs->pref, prefs->label); + field = gaim_request_field_list_new(prefs->pref, _(prefs->label)); for (iter = list; iter; iter = iter->next) { gboolean select = FALSE; @@ -98,23 +98,23 @@ static Prefs blist[] = { - {GAIM_PREF_BOOLEAN, "/gaim/gnt/blist/idletime", _("Show Idle Time"), NULL}, + {GAIM_PREF_BOOLEAN, "/gaim/gnt/blist/idletime", N_("Show Idle Time"), NULL}, {GAIM_PREF_NONE, NULL, NULL, NULL} }; static Prefs convs[] = { - {GAIM_PREF_BOOLEAN, "/gaim/gnt/conversations/timestamps", _("Show Timestamps"), NULL}, - {GAIM_PREF_BOOLEAN, "/gaim/gnt/conversations/notify_typing", _("Notify buddies when you are typing"), NULL}, + {GAIM_PREF_BOOLEAN, "/gaim/gnt/conversations/timestamps", N_("Show Timestamps"), NULL}, + {GAIM_PREF_BOOLEAN, "/gaim/gnt/conversations/notify_typing", N_("Notify buddies when you are typing"), NULL}, {GAIM_PREF_NONE, NULL, NULL, NULL} }; static Prefs logging[] = { - {GAIM_PREF_STRING, "/core/logging/format", _("Log format"), get_log_options}, - {GAIM_PREF_BOOLEAN, "/core/logging/log_ims", _("Log IMs"), NULL}, - {GAIM_PREF_BOOLEAN, "/core/logging/log_chats", _("Log chats"), NULL}, - {GAIM_PREF_BOOLEAN, "/core/logging/log_system", _("Log status change events"), NULL}, + {GAIM_PREF_STRING, "/core/logging/format", N_("Log format"), get_log_options}, + {GAIM_PREF_BOOLEAN, "/core/logging/log_ims", N_("Log IMs"), NULL}, + {GAIM_PREF_BOOLEAN, "/core/logging/log_chats", N_("Log chats"), NULL}, + {GAIM_PREF_BOOLEAN, "/core/logging/log_system", N_("Log status change events"), NULL}, {GAIM_PREF_NONE, NULL, NULL, NULL}, }; Modified: trunk/console/gntprefs.h =================================================================== --- trunk/console/gntprefs.h 2006-08-19 02:57:06 UTC (rev 16869) +++ trunk/console/gntprefs.h 2006-08-19 03:38:23 UTC (rev 16870) @@ -1,4 +1,8 @@ -void gg_prefs_init(); +#ifndef _GNT_PREFS_H +#define _GNT_PREFS_H -void gg_prefs_show_all(); +void gg_prefs_init(void); +void gg_prefs_show_all(void); + +#endif Modified: trunk/console/gntrequest.c =================================================================== --- trunk/console/gntrequest.c 2006-08-19 02:57:06 UTC (rev 16869) +++ trunk/console/gntrequest.c 2006-08-19 03:38:23 UTC (rev 16870) @@ -247,7 +247,8 @@ else if (type == GAIM_REQUEST_FIELD_CHOICE) { GntWidget *combo = field->ui_data;; - int id = GPOINTER_TO_INT(gnt_combo_box_get_selected_data(GNT_COMBO_BOX(combo))); + int id; + id = GPOINTER_TO_INT(gnt_combo_box_get_selected_data(GNT_COMBO_BOX(combo))); gaim_request_field_choice_set_value(field, id); } else if (type == GAIM_REQUEST_FIELD_LIST) Modified: trunk/console/gntrequest.h =================================================================== --- trunk/console/gntrequest.h 2006-08-19 02:57:06 UTC (rev 16869) +++ trunk/console/gntrequest.h 2006-08-19 03:38:23 UTC (rev 16870) @@ -1,8 +1,12 @@ +#ifndef _GNT_REQUEST_H +#define _GNT_REQUEST_H + #include "request.h" -GaimRequestUiOps *gg_request_get_ui_ops(); +GaimRequestUiOps *gg_request_get_ui_ops(void); -void gg_request_init(); +void gg_request_init(void); -void gg_request_uninit(); +void gg_request_uninit(void); +#endif Modified: trunk/console/gntstatus.h =================================================================== --- trunk/console/gntstatus.h 2006-08-19 02:57:06 UTC (rev 16869) +++ trunk/console/gntstatus.h 2006-08-19 03:38:23 UTC (rev 16870) @@ -1,7 +1,11 @@ +#ifndef _GNT_STATUS_H +#define _GNT_STATUS_H + #include <status.h> #include <savedstatuses.h> -void gg_savedstatus_show_all(); +void gg_savedstatus_show_all(void); void gg_savedstatus_edit(GaimSavedStatus *saved); +#endif Modified: trunk/console/gntui.h =================================================================== --- trunk/console/gntui.h 2006-08-19 02:57:06 UTC (rev 16869) +++ trunk/console/gntui.h 2006-08-19 03:38:23 UTC (rev 16870) @@ -1,3 +1,8 @@ +#ifndef _GNT_UI_H +#define _GNT_UI_H + #include "gnt.h" -void init_gnt_ui(); +void init_gnt_ui(void); + +#endif Modified: trunk/console/libgnt/gntwidget.h =================================================================== --- trunk/console/libgnt/gntwidget.h 2006-08-19 02:57:06 UTC (rev 16869) +++ trunk/console/libgnt/gntwidget.h 2006-08-19 03:38:23 UTC (rev 16870) @@ -23,8 +23,6 @@ typedef struct _GnWidgetPriv GntWidgetPriv; typedef struct _GnWidgetClass GntWidgetClass; -#define N_(X) X - typedef enum _GnWidgetFlags { GNT_WIDGET_DESTROYING = 1 << 0, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aar...@us...> - 2006-08-19 02:57:10
|
Revision: 16869 Author: aaronsheldon Date: 2006-08-18 19:57:06 -0700 (Fri, 18 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16869&view=rev Log Message: ----------- Re-re-commits r16854, with a few extra useless lines removed. Modified Paths: -------------- trunk/gtk/gaimstock.c trunk/gtk/gaimstock.h Modified: trunk/gtk/gaimstock.c =================================================================== --- trunk/gtk/gaimstock.c 2006-08-19 02:39:56 UTC (rev 16868) +++ trunk/gtk/gaimstock.c 2006-08-19 02:57:06 UTC (rev 16869) @@ -93,7 +93,6 @@ { GAIM_STOCK_INVITE, NULL, GTK_STOCK_JUMP_TO }, { GAIM_STOCK_LINK, "buttons", "insert-link-small.png" }, { GAIM_STOCK_LOG, NULL, GTK_STOCK_DND_MULTIPLE }, - { GAIM_STOCK_LOGO, "gaim", "logo.png" }, { GAIM_STOCK_MODIFY, NULL, GTK_STOCK_PREFERENCES }, #if GTK_CHECK_VERSION(2,6,0) { GAIM_STOCK_PAUSE, NULL, GTK_STOCK_MEDIA_PAUSE }, @@ -174,42 +173,6 @@ return filename; } -static void -gaim_gtk_stock_versionize(GdkPixbuf **original, GtkWidget *widget) { - GdkPixmap *pixmap; - GtkStyle *style; - PangoContext *context; - PangoLayout *layout; - gchar *markup; - gint width, height; - gint lwidth = 0, lheight = 0; - - style = gtk_widget_get_style(widget); - - gdk_pixbuf_render_pixmap_and_mask(*original, &pixmap, NULL, 255); - width = gdk_pixbuf_get_width(*original); - height = gdk_pixbuf_get_height(*original); - g_object_unref(G_OBJECT(*original)); - - context = gtk_widget_get_pango_context(widget); - layout = pango_layout_new(context); - - markup = g_strdup_printf("<span foreground=\"#FFFFFF\" size=\"larger\">%s</span>", VERSION); - pango_layout_set_font_description(layout, style->font_desc); - pango_layout_set_markup(layout, markup, strlen(markup)); - g_free(markup); - - pango_layout_get_pixel_size(layout, &lwidth, &lheight); - gdk_draw_layout(GDK_DRAWABLE(pixmap), style->bg_gc[GTK_STATE_NORMAL], - width - (lwidth + 3), height - (lheight + 1), layout); - g_object_unref(G_OBJECT(layout)); - - *original = gdk_pixbuf_get_from_drawable(NULL, pixmap, NULL, - 0, 0, 0, 0, - width, height); - g_object_unref(G_OBJECT(pixmap)); -} - void gaim_gtk_stock_init(void) { @@ -255,9 +218,6 @@ g_free(filename); - if (!strcmp(stock_icons[i].name, GAIM_STOCK_LOGO)) - gaim_gtk_stock_versionize(&pixbuf, win); - iconset = gtk_icon_set_new_from_pixbuf(pixbuf); g_object_unref(G_OBJECT(pixbuf)); @@ -271,7 +231,6 @@ gtk_widget_destroy(win); /* register custom icon sizes */ - gtk_icon_size_register(GAIM_ICON_SIZE_LOGO, 330, 90); gtk_icon_size_register(GAIM_ICON_SIZE_DIALOG_COOL, 40, 60); gtk_icon_size_register(GAIM_ICON_SIZE_STATUS, 30, 30); gtk_icon_size_register(GAIM_ICON_SIZE_STATUS_TWO_LINE, 30, 30); Modified: trunk/gtk/gaimstock.h =================================================================== --- trunk/gtk/gaimstock.h 2006-08-19 02:39:56 UTC (rev 16868) +++ trunk/gtk/gaimstock.h 2006-08-19 02:57:06 UTC (rev 16869) @@ -69,7 +69,6 @@ #define GAIM_STOCK_INVITE "gaim-invite" #define GAIM_STOCK_LINK "gaim-link" #define GAIM_STOCK_LOG "gaim-log" -#define GAIM_STOCK_LOGO "gaim-logo" #define GAIM_STOCK_MODIFY "gaim-modify" #define GAIM_STOCK_OPEN_MAIL "gaim-stock-open-mail" #define GAIM_STOCK_PAUSE "gaim-pause" @@ -105,7 +104,6 @@ * For using icons that aren't one of the default GTK_ICON_SIZEs */ #define GAIM_ICON_SIZE_DIALOG_COOL "gaim-icon-size-dialog-cool" -#define GAIM_ICON_SIZE_LOGO "gaim-icon-size-logo" #define GAIM_ICON_SIZE_STATUS "gaim-icon-size-status" #define GAIM_ICON_SIZE_STATUS_TWO_LINE "gaim-icon-size-status-two-line" #define GAIM_ICON_SIZE_STATUS_SMALL "gaim-icon-size-status-small" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-08-19 02:40:02
|
Revision: 16868 Author: sadrul Date: 2006-08-18 19:39:56 -0700 (Fri, 18 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16868&view=rev Log Message: ----------- This should compile now. Modified Paths: -------------- trunk/gtk/gaimstock.h trunk/gtk/gtkaccount.c trunk/gtk/gtkdialogs.c Removed Paths: ------------- trunk/gtk/gtkstock.c trunk/gtk/gtkstock.h Modified: trunk/gtk/gaimstock.h =================================================================== --- trunk/gtk/gaimstock.h 2006-08-19 02:32:55 UTC (rev 16867) +++ trunk/gtk/gaimstock.h 2006-08-19 02:39:56 UTC (rev 16868) @@ -22,6 +22,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include <gtk/gtkstock.h> + #ifndef _GAIM_STOCK_H_ #define _GAIM_STOCK_H_ Modified: trunk/gtk/gtkaccount.c =================================================================== --- trunk/gtk/gtkaccount.c 2006-08-19 02:32:55 UTC (rev 16867) +++ trunk/gtk/gtkaccount.c 2006-08-19 02:39:56 UTC (rev 16868) @@ -44,7 +44,7 @@ #include "gtkdialogs.h" #include "gtkutils.h" #include "gtkstatusbox.h" -#include "gtkstock.h" +#include "gaimstock.h" enum { Modified: trunk/gtk/gtkdialogs.c =================================================================== --- trunk/gtk/gtkdialogs.c 2006-08-19 02:32:55 UTC (rev 16867) +++ trunk/gtk/gtkdialogs.c 2006-08-19 02:39:56 UTC (rev 16868) @@ -37,7 +37,7 @@ #include "gtkimhtmltoolbar.h" #include "gtklog.h" #include "gtkutils.h" -#include "gtkstock.h" +#include "gaimstock.h" static GList *dialogwindows = NULL; Deleted: trunk/gtk/gtkstock.c =================================================================== --- trunk/gtk/gtkstock.c 2006-08-19 02:32:55 UTC (rev 16867) +++ trunk/gtk/gtkstock.c 2006-08-19 02:39:56 UTC (rev 16868) @@ -1,245 +0,0 @@ -/** - * @file gtkstock.c GTK+ Stock resources - * @ingroup gtkui - * - * gaim - * - * Gaim is the legal property of its developers, whose names are too numerous - * to list here. Please refer to the COPYRIGHT file distributed with this - * source distribution. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -#include "internal.h" -#include "gtkgaim.h" - -#include "gtkstock.h" - -static struct StockIcon -{ - const char *name; - const char *dir; - const char *filename; - -} const stock_icons[] = -{ - { GAIM_STOCK_ABOUT, "buttons", "about_menu.png" }, - { GAIM_STOCK_ACCOUNTS, "buttons", "accounts.png" }, - { GAIM_STOCK_ACTION, NULL, GTK_STOCK_EXECUTE }, -#if GTK_CHECK_VERSION(2,6,0) - { GAIM_STOCK_ALIAS, NULL, GTK_STOCK_EDIT }, -#else - { GAIM_STOCK_ALIAS, "buttons", "edit.png" }, -#endif - { GAIM_STOCK_BGCOLOR, "buttons", "change-bgcolor-small.png" }, - { GAIM_STOCK_BLOCK, NULL, GTK_STOCK_STOP }, - { GAIM_STOCK_CHAT, NULL, GTK_STOCK_JUMP_TO }, - { GAIM_STOCK_CLEAR, NULL, GTK_STOCK_CLEAR }, - { GAIM_STOCK_CLOSE_TABS, NULL, GTK_STOCK_CLOSE }, -#if GTK_CHECK_VERSION(2,6,0) - { GAIM_STOCK_CONNECT, NULL, GTK_STOCK_CONNECT }, -#else - { GAIM_STOCK_CONNECT, "icons", "stock_connect_16.png" }, -#endif - { GAIM_STOCK_DEBUG, NULL, GTK_STOCK_PROPERTIES }, - { GAIM_STOCK_DOWNLOAD, NULL, GTK_STOCK_GO_DOWN }, - { GAIM_STOCK_DIALOG_AUTH, "dialogs", "gaim_auth.png" }, - { GAIM_STOCK_DIALOG_COOL, "dialogs", "gaim_cool.png" }, - { GAIM_STOCK_DIALOG_ERROR, "dialogs", "gaim_error.png" }, - { GAIM_STOCK_DIALOG_INFO, "dialogs", "gaim_info.png" }, - { GAIM_STOCK_DIALOG_QUESTION, "dialogs", "gaim_question.png" }, - { GAIM_STOCK_DIALOG_WARNING, "dialogs", "gaim_warning.png" }, -#if GTK_CHECK_VERSION(2,6,0) - { GAIM_STOCK_DISCONNECT, NULL, GTK_STOCK_DISCONNECT }, -#else - { GAIM_STOCK_DISCONNECT, "icons", "stock_disconnect_16.png" }, -#endif - { GAIM_STOCK_FGCOLOR, "buttons", "change-fgcolor-small.png" }, -#if GTK_CHECK_VERSION(2,6,0) - { GAIM_STOCK_EDIT, NULL, GTK_STOCK_EDIT }, -#else - { GAIM_STOCK_EDIT, "buttons", "edit.png" }, -#endif - { GAIM_STOCK_FILE_CANCELED, NULL, GTK_STOCK_CANCEL }, - { GAIM_STOCK_FILE_DONE, NULL, GTK_STOCK_APPLY }, - { GAIM_STOCK_FILE_TRANSFER, NULL, GTK_STOCK_REVERT_TO_SAVED }, - { GAIM_STOCK_ICON_AWAY, "icons", "away.png" }, - { GAIM_STOCK_ICON_AWAY_MSG, "icons", "msgpend.png" }, - { GAIM_STOCK_ICON_CONNECT, "icons", "connect.png" }, - { GAIM_STOCK_ICON_OFFLINE, "icons", "offline.png" }, - { GAIM_STOCK_ICON_ONLINE, "icons", "online.png" }, - { GAIM_STOCK_ICON_ONLINE_MSG, "icons", "msgunread.png" }, - { GAIM_STOCK_IGNORE, NULL, GTK_STOCK_DIALOG_ERROR }, - { GAIM_STOCK_IM, "buttons", "send-im.png" }, - { GAIM_STOCK_IMAGE, "buttons", "insert-image-small.png" }, -#if GTK_CHECK_VERSION(2,8,0) - { GAIM_STOCK_INFO, NULL, GTK_STOCK_INFO }, -#else - { GAIM_STOCK_INFO, "buttons", "info.png" }, -#endif - { GAIM_STOCK_INVITE, NULL, GTK_STOCK_JUMP_TO }, - { GAIM_STOCK_LINK, "buttons", "insert-link-small.png" }, - { GAIM_STOCK_LOG, NULL, GTK_STOCK_DND_MULTIPLE }, - { GAIM_STOCK_MODIFY, NULL, GTK_STOCK_PREFERENCES }, -#if GTK_CHECK_VERSION(2,6,0) - { GAIM_STOCK_PAUSE, NULL, GTK_STOCK_MEDIA_PAUSE }, -#else - { GAIM_STOCK_PAUSE, "buttons", "pause.png" }, -#endif - { GAIM_STOCK_PENDING, "buttons", "send-im.png" }, -#if GTK_CHECK_VERSION(2,6,0) - { GAIM_STOCK_PLUGIN, NULL, GTK_STOCK_DISCONNECT }, -#else - { GAIM_STOCK_PLUGIN, "icons", "stock_disconnect_16.png" }, -#endif - { GAIM_STOCK_POUNCE, NULL, GTK_STOCK_REDO }, - { GAIM_STOCK_OPEN_MAIL, NULL, GTK_STOCK_JUMP_TO }, - { GAIM_STOCK_SEND, "buttons", "send-im.png" }, - { GAIM_STOCK_SIGN_ON, NULL, GTK_STOCK_EXECUTE }, - { GAIM_STOCK_SIGN_OFF, NULL, GTK_STOCK_CLOSE }, - { GAIM_STOCK_SMILEY, "buttons", "insert-smiley-small.png" }, - { GAIM_STOCK_TEXT_BIGGER, "buttons", "text_bigger.png" }, - { GAIM_STOCK_TEXT_NORMAL, "buttons", "text_normal.png" }, - { GAIM_STOCK_TEXT_SMALLER, "buttons", "text_smaller.png" }, - { GAIM_STOCK_TYPED, "gaim", "typed.png" }, - { GAIM_STOCK_TYPING, "gaim", "typing.png" }, - { GAIM_STOCK_VOICE_CHAT, "gaim", "phone.png" }, - { GAIM_STOCK_STATUS_ONLINE, "gaim", "status-online.png" }, - { GAIM_STOCK_STATUS_OFFLINE, "gaim", "status-offline.png" }, - { GAIM_STOCK_STATUS_AWAY, "gaim", "status-away.png" }, - { GAIM_STOCK_STATUS_INVISIBLE,"gaim", "status-invisible.png" }, - { GAIM_STOCK_STATUS_TYPING0, "gaim", "status-typing0.png" }, - { GAIM_STOCK_STATUS_TYPING1, "gaim", "status-typing1.png" }, - { GAIM_STOCK_STATUS_TYPING2, "gaim", "status-typing2.png" }, - { GAIM_STOCK_STATUS_TYPING3, "gaim", "status-typing3.png" }, - { GAIM_STOCK_STATUS_CONNECT0, "gaim", "status-connect0.png" }, - { GAIM_STOCK_STATUS_CONNECT1, "gaim", "status-connect1.png" }, - { GAIM_STOCK_STATUS_CONNECT2, "gaim", "status-connect2.png" }, - { GAIM_STOCK_STATUS_CONNECT3, "gaim", "status-connect3.png" }, - { GAIM_STOCK_UPLOAD, NULL, GTK_STOCK_GO_UP } -}; - -static const GtkStockItem stock_items[] = -{ - { GAIM_STOCK_ALIAS, N_("_Alias"), 0, 0, NULL }, - { GAIM_STOCK_CHAT, N_("_Join"), 0, 0, NULL }, - { GAIM_STOCK_CLOSE_TABS, N_("Close _tabs"), 0, 0, NULL }, - { GAIM_STOCK_IM, N_("I_M"), 0, 0, NULL }, - { GAIM_STOCK_INFO, N_("_Get Info"), 0, 0, NULL }, - { GAIM_STOCK_INVITE, N_("_Invite"), 0, 0, NULL }, - { GAIM_STOCK_MODIFY, N_("_Modify"), 0, 0, NULL }, - { GAIM_STOCK_OPEN_MAIL, N_("_Open Mail"), 0, 0, NULL }, - { GAIM_STOCK_PAUSE, N_("_Pause"), 0, 0, NULL }, -}; - -static gchar * -find_file(const char *dir, const char *base) -{ - char *filename; - - if (base == NULL) - return NULL; - - if (!strcmp(dir, "gaim")) - filename = g_build_filename(DATADIR, "pixmaps", "gaim", base, NULL); - else - { - filename = g_build_filename(DATADIR, "pixmaps", "gaim", dir, - base, NULL); - } - - if (!g_file_test(filename, G_FILE_TEST_EXISTS)) - { - g_critical("Unable to load stock pixmap %s\n", base); - - g_free(filename); - - return NULL; - } - - return filename; -} - -void -gaim_gtk_stock_init(void) -{ - static gboolean stock_initted = FALSE; - GtkIconFactory *icon_factory; - size_t i; - GtkWidget *win; - - if (stock_initted) - return; - - stock_initted = TRUE; - - /* Setup the icon factory. */ - icon_factory = gtk_icon_factory_new(); - - gtk_icon_factory_add_default(icon_factory); - - /* Er, yeah, a hack, but it works. :) */ - win = gtk_window_new(GTK_WINDOW_TOPLEVEL); - gtk_widget_realize(win); - - for (i = 0; i < G_N_ELEMENTS(stock_icons); i++) - { - GdkPixbuf *pixbuf; - GtkIconSet *iconset; - gchar *filename; - - if (stock_icons[i].dir == NULL) - { - /* GTK+ Stock icon */ - iconset = gtk_style_lookup_icon_set(gtk_widget_get_style(win), - stock_icons[i].filename); - } - else - { - filename = find_file(stock_icons[i].dir, stock_icons[i].filename); - - if (filename == NULL) - continue; - - pixbuf = gdk_pixbuf_new_from_file(filename, NULL); - - g_free(filename); - - iconset = gtk_icon_set_new_from_pixbuf(pixbuf); - - g_object_unref(G_OBJECT(pixbuf)); - } - - gtk_icon_factory_add(icon_factory, stock_icons[i].name, iconset); - - gtk_icon_set_unref(iconset); - } - - gtk_widget_destroy(win); - - /* register custom icon sizes */ - gtk_icon_size_register(GAIM_ICON_SIZE_LOGO, 330, 90); - gtk_icon_size_register(GAIM_ICON_SIZE_DIALOG_COOL, 40, 60); - gtk_icon_size_register(GAIM_ICON_SIZE_STATUS, 30, 30); - gtk_icon_size_register(GAIM_ICON_SIZE_STATUS_TWO_LINE, 30, 30); - gtk_icon_size_register(GAIM_ICON_SIZE_STATUS_SMALL, 16, 16); - gtk_icon_size_register(GAIM_ICON_SIZE_STATUS_SMALL_TWO_LINE, 24, 24); - - g_object_unref(G_OBJECT(icon_factory)); - - /* Register the stock items. */ - gtk_stock_add_static(stock_items, G_N_ELEMENTS(stock_items)); -} Deleted: trunk/gtk/gtkstock.h =================================================================== --- trunk/gtk/gtkstock.h 2006-08-19 02:32:55 UTC (rev 16867) +++ trunk/gtk/gtkstock.h 2006-08-19 02:39:56 UTC (rev 16868) @@ -1,116 +0,0 @@ -/** - * @file gtkstock.h GTK+ Stock resources - * @ingroup gtkui - * - * gaim - * - * Gaim is the legal property of its developers, whose names are too numerous - * to list here. Please refer to the COPYRIGHT file distributed with this - * source distribution. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#ifndef _GAIM_STOCK_H_ -#define _GAIM_STOCK_H_ - -/**************************************************************************/ -/** @name Stock images */ -/**************************************************************************/ -/*@{*/ -#define GAIM_STOCK_ABOUT "gaim-about" -#define GAIM_STOCK_ACCOUNTS "gaim-accounts" -#define GAIM_STOCK_ACTION "gaim-action" -#define GAIM_STOCK_ALIAS "gaim-alias" -#define GAIM_STOCK_AWAY "gaim-away" -#define GAIM_STOCK_BGCOLOR "gaim-bgcolor" -#define GAIM_STOCK_BLOCK "gaim-block" -#define GAIM_STOCK_CHAT "gaim-chat" -#define GAIM_STOCK_CLEAR "gaim-clear" -#define GAIM_STOCK_CLOSE_TABS "gaim-close-tab" -#define GAIM_STOCK_CONNECT "gaim-connect" -#define GAIM_STOCK_DEBUG "gaim-debug" -#define GAIM_STOCK_DIALOG_AUTH "gaim-dialog-auth" -#define GAIM_STOCK_DIALOG_COOL "gaim-dialog-cool" -#define GAIM_STOCK_DIALOG_ERROR "gaim-dialog-error" -#define GAIM_STOCK_DIALOG_INFO "gaim-dialog-info" -#define GAIM_STOCK_DIALOG_QUESTION "gaim-dialog-question" -#define GAIM_STOCK_DIALOG_WARNING "gaim-dialog-warning" -#define GAIM_STOCK_DISCONNECT "gaim-disconnect" -#define GAIM_STOCK_DOWNLOAD "gaim-download" -#define GAIM_STOCK_EDIT "gaim-edit" -#define GAIM_STOCK_FGCOLOR "gaim-fgcolor" -#define GAIM_STOCK_FILE_CANCELED "gaim-file-canceled" -#define GAIM_STOCK_FILE_DONE "gaim-file-done" -#define GAIM_STOCK_FILE_TRANSFER "gaim-file-transfer" -#define GAIM_STOCK_ICON_AWAY "gaim-icon-away" -#define GAIM_STOCK_ICON_AWAY_MSG "gaim-icon-away-msg" -#define GAIM_STOCK_ICON_CONNECT "gaim-icon-away-connect" -#define GAIM_STOCK_ICON_OFFLINE "gaim-icon-offline" -#define GAIM_STOCK_ICON_ONLINE "gaim-icon-online" -#define GAIM_STOCK_ICON_ONLINE_MSG "gaim-icon-online-msg" -#define GAIM_STOCK_IGNORE "gaim-ignore" -#define GAIM_STOCK_IM "gaim-im" -#define GAIM_STOCK_IMAGE "gaim-image" -#define GAIM_STOCK_INFO "gaim-info" -#define GAIM_STOCK_INVITE "gaim-invite" -#define GAIM_STOCK_LINK "gaim-link" -#define GAIM_STOCK_LOG "gaim-log" -#define GAIM_STOCK_MODIFY "gaim-modify" -#define GAIM_STOCK_OPEN_MAIL "gaim-stock-open-mail" -#define GAIM_STOCK_PAUSE "gaim-pause" -#define GAIM_STOCK_PENDING "gaim-pending" -#define GAIM_STOCK_PLUGIN "gaim-plugin" -#define GAIM_STOCK_POUNCE "gaim-pounce" -#define GAIM_STOCK_SEND "gaim-send" -#define GAIM_STOCK_SIGN_OFF "gaim-sign-off" -#define GAIM_STOCK_SIGN_ON "gaim-sign-on" -#define GAIM_STOCK_SMILEY "gaim-smiley" -#define GAIM_STOCK_STATUS_ONLINE "gaim-status-online" -#define GAIM_STOCK_STATUS_AWAY "gaim-status-away" -#define GAIM_STOCK_STATUS_INVISIBLE "gaim-status-invisible" -#define GAIM_STOCK_STATUS_OFFLINE "gaim-status-offline" -#define GAIM_STOCK_STATUS_TYPING0 "gaim-status-typing0" -#define GAIM_STOCK_STATUS_TYPING1 "gaim-status-typing1" -#define GAIM_STOCK_STATUS_TYPING2 "gaim-status-typing2" -#define GAIM_STOCK_STATUS_TYPING3 "gaim-status-typing3" -#define GAIM_STOCK_STATUS_CONNECT0 "gaim-status-connect0" -#define GAIM_STOCK_STATUS_CONNECT1 "gaim-status-connect1" -#define GAIM_STOCK_STATUS_CONNECT2 "gaim-status-connect2" -#define GAIM_STOCK_STATUS_CONNECT3 "gaim-status-connect3" -#define GAIM_STOCK_TEXT_BIGGER "gaim-text-bigger" -#define GAIM_STOCK_TEXT_NORMAL "gaim-text-normal" -#define GAIM_STOCK_TEXT_SMALLER "gaim-text-smaller" -#define GAIM_STOCK_TYPED "gaim-typed" -#define GAIM_STOCK_TYPING "gaim-typing" -#define GAIM_STOCK_UPLOAD "gaim-upload" -#define GAIM_STOCK_VOICE_CHAT "gaim-voice-chat" -/*@}*/ - -/** - * For using icons that aren't one of the default GTK_ICON_SIZEs - */ -#define GAIM_ICON_SIZE_DIALOG_COOL "gaim-icon-size-dialog-cool" -#define GAIM_ICON_SIZE_LOGO "gaim-icon-size-logo" -#define GAIM_ICON_SIZE_STATUS "gaim-icon-size-status" -#define GAIM_ICON_SIZE_STATUS_TWO_LINE "gaim-icon-size-status-two-line" -#define GAIM_ICON_SIZE_STATUS_SMALL "gaim-icon-size-status-small" -#define GAIM_ICON_SIZE_STATUS_SMALL_TWO_LINE "gaim-icon-size-status-small-two-line" - -/** - * Sets up the gaim stock repository. - */ -void gaim_gtk_stock_init(void); - -#endif /* _GAIM_STOCK_H_ */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2006-08-19 02:33:03
|
Revision: 16867 Author: markhuetsch Date: 2006-08-18 19:32:55 -0700 (Fri, 18 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16867&view=rev Log Message: ----------- Revamped the QQ proxy code. Fixed an infinite loop that was occurring if we hit qq_input_pending() with an unexpected value of cond. Rewrote part of qq_proxy.c so that we use Gaim's non-blocking dns lookups. Quieted some warnings created by new code in proxy.c and passed appropriate error messages to _qq_got_login(). Added some extra error handling to qq_proxy_write(). I was beginning to do major clean-up on this this code when I realized that once that clean-up is done, I will have duplicated a very large amount of code from proxy.c. Therefore, I am submitting this working code now and will later submit a patch to gaim-devel that will add support for UDP proxying in proxy.c, thus eliminating the need for such code in the individual prpls. Modified Paths: -------------- trunk/libgaim/protocols/qq/qq.c trunk/libgaim/protocols/qq/qq.h trunk/libgaim/protocols/qq/qq_proxy.c trunk/libgaim/protocols/qq/qq_proxy.h trunk/libgaim/protocols/qq/recv_core.c trunk/libgaim/protocols/qq/send_core.c trunk/libgaim/protocols/qq/udp_proxy_s5.c Modified: trunk/libgaim/protocols/qq/qq.c =================================================================== --- trunk/libgaim/protocols/qq/qq.c 2006-08-19 02:26:57 UTC (rev 16866) +++ trunk/libgaim/protocols/qq/qq.c 2006-08-19 02:32:55 UTC (rev 16867) @@ -64,25 +64,26 @@ #define QQ_UDP_PORT "8000" const gchar *udp_server_list[] = { - "sz.tencent.com", /* 61.144.238.145 */ - "sz2.tencent.com", /* 61.144.238.146 */ - "sz3.tencent.com", /* 202.104.129.251 */ - "sz4.tencent.com", /* 202.104.129.254 */ - "sz5.tencent.com", /* 61.141.194.203 */ - "sz6.tencent.com", /* 202.104.129.252 */ - "sz7.tencent.com", /* 202.104.129.253 */ - "202.96.170.64", - "64.144.238.155", - "202.104.129.254" + "sz.tencent.com", + "sz2.tencent.com", + "sz3.tencent.com", + "sz4.tencent.com", + "sz5.tencent.com", + "sz6.tencent.com", + "sz7.tencent.com", + "sz8.tencent.com", + "sz9.tencent.com" }; const gint udp_server_amount = (sizeof(udp_server_list) / sizeof(udp_server_list[0])); const gchar *tcp_server_list[] = { - "tcpconn.tencent.com", /* 218.17.209.23 */ - "tcpconn2.tencent.com", /* 218.18.95.153 */ - "tcpconn3.tencent.com", /* 218.17.209.23 */ - "tcpconn4.tencent.com" /* 218.18.95.153 */ + "tcpconn.tencent.com", + "tcpconn2.tencent.com", + "tcpconn3.tencent.com", + "tcpconn4.tencent.com", + "tcpconn5.tencent.com", + "tcpconn6.tencent.com" }; const gint tcp_server_amount = (sizeof(tcp_server_list) / sizeof(tcp_server_list[0])); @@ -102,6 +103,7 @@ gc->flags |= GAIM_CONNECTION_HTML | GAIM_CONNECTION_NO_BGCOLOR | GAIM_CONNECTION_AUTO_RESP; qd = g_new0(qq_data, 1); + qd->gc = gc; gc->proto_data = qd; qq_server = gaim_account_get_string(account, "server", NULL); @@ -122,13 +124,14 @@ if (qq_server == NULL || strlen(qq_server) == 0) qq_server = use_tcp ? - tcp_server_list[random() % tcp_server_amount] : udp_server_list[random() % udp_server_amount]; + tcp_server_list[random() % tcp_server_amount] : + udp_server_list[random() % udp_server_amount]; if (qq_port == NULL || strtol(qq_port, NULL, 10) == 0) qq_port = use_tcp ? QQ_TCP_QUERY_PORT : QQ_UDP_PORT; gaim_connection_update_progress(gc, _("Connecting"), 0, QQ_CONNECT_STEPS); - + if (qq_connect(account, qq_server, strtol(qq_port, NULL, 10), use_tcp, FALSE) < 0) gaim_connection_error(gc, _("Unable to connect.")); } Modified: trunk/libgaim/protocols/qq/qq.h =================================================================== --- trunk/libgaim/protocols/qq/qq.h 2006-08-19 02:26:57 UTC (rev 16866) +++ trunk/libgaim/protocols/qq/qq.h 2006-08-19 02:32:55 UTC (rev 16867) @@ -67,7 +67,9 @@ gboolean logged_in; /* used by qq-add_buddy */ gboolean use_tcp; /* network in tcp or udp */ - GaimProxyType proxy_type; /* proxy type */ + GaimProxyType proxy_type; + GaimConnection *gc; + GaimXfer *xfer; /* file transfer handler */ struct sockaddr_in dest_sin; Modified: trunk/libgaim/protocols/qq/qq_proxy.c =================================================================== --- trunk/libgaim/protocols/qq/qq_proxy.c 2006-08-19 02:26:57 UTC (rev 16866) +++ trunk/libgaim/protocols/qq/qq_proxy.c 2006-08-19 02:32:55 UTC (rev 16867) @@ -43,11 +43,11 @@ #include "udp_proxy_s5.h" #include "utils.h" -/* These functions are used only in development phase - * +/* These functions are used only in development phase */ +/* static void _qq_show_socket(gchar *desc, gint fd) { struct sockaddr_in sin; - gint len = sizeof(sin); + socklen_t len = sizeof(sin); getsockname(fd, (struct sockaddr *)&sin, &len); gaim_debug(GAIM_DEBUG_INFO, desc, "%s:%d\n", inet_ntoa(sin.sin_addr), ntohs(sin.sin_port)); @@ -88,22 +88,24 @@ return g_memdup(pwkey_tmp, QQ_KEY_LENGTH); } -gint _qq_fill_host(struct sockaddr_in *addr, const gchar *host, guint16 port) +static gboolean _qq_fill_host(GSList *hosts, struct sockaddr_in *addr, gint *addr_size) { - if (!inet_aton(host, &(addr->sin_addr))) { - struct hostent *hp; - if (!(hp = gethostbyname(host))) { - return -1; - } - memset(addr, 0, sizeof(struct sockaddr_in)); - memcpy(&(addr->sin_addr.s_addr), hp->h_addr, hp->h_length); - addr->sin_family = hp->h_addrtype; - } else { - addr->sin_family = AF_INET; + if (!hosts || !hosts->data) + return FALSE; + + *addr_size = GPOINTER_TO_INT(hosts->data); + + hosts = g_slist_remove(hosts, hosts->data); + memcpy(addr, hosts->data, *addr_size); + g_free(hosts->data); + hosts = g_slist_remove(hosts, hosts->data); + while(hosts) { + hosts = g_slist_remove(hosts, hosts->data); + g_free(hosts->data); + hosts = g_slist_remove(hosts, hosts->data); } - addr->sin_port = htons(port); - return 0; + return TRUE; } /* set up any finalizing start-up stuff */ @@ -136,12 +138,16 @@ g_return_if_fail(gc != NULL && gc->proto_data != NULL); if (source < 0) { /* socket returns -1 */ - gaim_connection_error(gc, _("Unable to connect.")); + gaim_connection_error(gc, error_message); return; } qd = (qq_data *) gc->proto_data; + /* + _qq_show_socket("Got login socket", source); + */ + /* QQ use random seq, to minimize duplicated packets */ srandom(time(NULL)); qd->send_seq = random() & 0x0000ffff; @@ -201,6 +207,54 @@ qq_buddies_list_free(gc->account, qd); } +static void no_one_calls(gpointer data, gint source, GaimInputCondition cond) +{ + struct PHB *phb = data; + socklen_t len; + int error=0, ret; + + gaim_debug_info("proxy", "Connected.\n"); + + len = sizeof(error); + + /* + * getsockopt after a non-blocking connect returns -1 if something is + * really messed up (bad descriptor, usually). Otherwise, it returns 0 and + * error holds what connect would have returned if it blocked until now. + * Thus, error == 0 is success, error == EINPROGRESS means "try again", + * and anything else is a real error. + * + * (error == EINPROGRESS can happen after a select because the kernel can + * be overly optimistic sometimes. select is just a hint that you might be + * able to do something.) + */ + ret = getsockopt(source, SOL_SOCKET, SO_ERROR, &error, &len); + if (ret == 0 && error == EINPROGRESS) + return; /* we'll be called again later */ + if (ret < 0 || error != 0) { + if(ret!=0) + error = errno; + close(source); + gaim_input_remove(phb->inpa); + + gaim_debug_error("proxy", "getsockopt SO_ERROR check: %s\n", strerror(error)); + + phb->func(phb->data, -1, _("Unable to connect")); + return; + } + + gaim_input_remove(phb->inpa); + + if (phb->account == NULL || gaim_account_get_connection(phb->account) != NULL) { + + phb->func(phb->data, source, NULL); + } + + g_free(phb->host); + g_free(phb); +} + +/* returns -1 if fails, otherwise returns the file handle */ static gint _qq_proxy_none(struct PHB *phb, struct sockaddr *addr, socklen_t addrlen) { gint fd = -1; @@ -209,7 +263,8 @@ fd = socket(PF_INET, SOCK_DGRAM, 0); if (fd < 0) { - gaim_debug(GAIM_DEBUG_ERROR, "QQ Redirect", "Unable to create socket: %s\n", strerror(errno)); + gaim_debug(GAIM_DEBUG_ERROR, "QQ Redirect", + "Unable to create socket: %s\n", strerror(errno)); return -1; } @@ -238,8 +293,9 @@ */ if ((errno == EINPROGRESS) || (errno == EINTR)) { gaim_debug(GAIM_DEBUG_WARNING, "QQ", "Connect in asynchronous mode.\n"); + phb->inpa = gaim_input_add(fd, GAIM_INPUT_WRITE, no_one_calls, phb); } else { - gaim_debug(GAIM_DEBUG_ERROR, "QQ", "Faiil connection: %d\n", strerror(errno)); + gaim_debug(GAIM_DEBUG_ERROR, "QQ", "Connection failed: %d\n", strerror(errno)); close(fd); return -1; } /* if errno */ @@ -252,20 +308,80 @@ return fd; } -/* returns the socket handler, or -1 if there is any error */ +static void _qq_proxy_resolved(GSList *hosts, gpointer data, const char *error_message) +{ + struct PHB *phb = (struct PHB *) data; + struct sockaddr_in addr; + gint addr_size, ret = -1; + + if(_qq_fill_host(hosts, &addr, &addr_size)) + ret = qq_proxy_socks5(phb, (struct sockaddr *) &addr, addr_size); + + if (ret < 0) { + phb->func(phb->data, -1, _("Unable to connect")); + g_free(phb->host); + g_free(phb); + } +} + +static void _qq_server_resolved(GSList *hosts, gpointer data, const char *error_message) +{ + struct PHB *phb = (struct PHB *) data; + GaimConnection *gc = (GaimConnection *) phb->data; + qq_data *qd = (qq_data *) gc->proto_data; + struct sockaddr_in addr; + gint addr_size, ret = -1; + + if(_qq_fill_host(hosts, &addr, &addr_size)) { + switch (gaim_proxy_info_get_type(phb->gpi)) { + case GAIM_PROXY_NONE: + ret = _qq_proxy_none(phb, (struct sockaddr *) &addr, addr_size); + break; + case GAIM_PROXY_SOCKS5: + ret = 0; + if (gaim_proxy_info_get_host(phb->gpi) == NULL || + gaim_proxy_info_get_port(phb->gpi) == 0) { + gaim_debug(GAIM_DEBUG_ERROR, "QQ", + "Use of socks5 proxy selected but host or port info doesn't exist.\n"); + ret = -1; + } else { + /* as the destination is always QQ server during the session, + * we can set dest_sin here, instead of _qq_s5_canread_again */ + memcpy(&qd->dest_sin, &addr, addr_size); + if (gaim_dnsquery_a(gaim_proxy_info_get_host(phb->gpi), + gaim_proxy_info_get_port(phb->gpi), + _qq_proxy_resolved, phb) == NULL) + ret = -1; + } + break; + default: + gaim_debug(GAIM_DEBUG_WARNING, "QQ", + "Proxy type %i is unsupported, not using a proxy.\n", + gaim_proxy_info_get_type(phb->gpi)); + ret = _qq_proxy_none(phb, (struct sockaddr *) &addr, addr_size); + } + } + + if (ret < 0) { + phb->func(gc, -1, _("Unable to connect")); + g_free(phb->host); + g_free(phb); + } +} + +/* returns -1 if dns lookup fails, otherwise returns 0 */ static gint _qq_udp_proxy_connect(GaimAccount *account, - const gchar *server, - guint16 port, void callback(gpointer, gint, const gchar *error_message), GaimConnection *gc) + const gchar *server, guint16 port, + void callback(gpointer, gint, const gchar *error_message), + GaimConnection *gc) { - struct sockaddr_in sin; + GaimProxyInfo *info; struct PHB *phb; - GaimProxyInfo *info; - qq_data *qd; + qq_data *qd = (qq_data *) gc->proto_data; - g_return_val_if_fail(gc != NULL && gc->proto_data != NULL, -1); - qd = (qq_data *) gc->proto_data; + g_return_val_if_fail(gc != NULL && qd != NULL, -1); - info = gaim_account_get_proxy_info(account); + info = gaim_proxy_get_setup(account); phb = g_new0(struct PHB, 1); phb->host = g_strdup(server); @@ -274,41 +390,24 @@ phb->gpi = info; phb->func = callback; phb->data = gc; + qd->proxy_type = gaim_proxy_info_get_type(phb->gpi); - if (_qq_fill_host(&sin, server, port) < 0) { - gaim_debug(GAIM_DEBUG_ERROR, "QQ", - "gethostbyname(\"%s\", %d) failed: %s\n", server, port, hstrerror(h_errno)); + gaim_debug(GAIM_DEBUG_INFO, "QQ", "Choosing proxy type %d\n", + gaim_proxy_info_get_type(phb->gpi)); + + if (gaim_dnsquery_a(server, port, _qq_server_resolved, phb) == NULL) { + phb->func(gc, -1, _("Unable to connect")); + g_free(phb->host); + g_free(phb); return -1; + } else { + return 0; } - - if (info == NULL) { - qd->proxy_type = GAIM_PROXY_NONE; - return _qq_proxy_none(phb, (struct sockaddr *) &sin, sizeof(sin)); - } - - qd->proxy_type = info->type; - gaim_debug(GAIM_DEBUG_INFO, "QQ", "Choosing proxy type %d\n", info->type); - - switch (info->type) { - case GAIM_PROXY_NONE: - return _qq_proxy_none(phb, (struct sockaddr *) &sin, sizeof(sin)); - case GAIM_PROXY_SOCKS5: - /* as the destination is always QQ server during the session, - * we can set dest_sin here, instead of _qq_s5_canread_again */ - _qq_fill_host(&qd->dest_sin, phb->host, phb->port); - _qq_fill_host(&sin, phb->gpi->host, phb->gpi->port); - return qq_proxy_socks5(phb, (struct sockaddr *) &sin, sizeof(sin)); - default: - return _qq_proxy_none(phb, (struct sockaddr *) &sin, sizeof(sin)); - } - - return -1; } /* QQ connection via UDP/TCP. - * I use GAIM proxy function to provide TCP proxy support, - * and qq_udp_proxy.c to add UDP proxy support (thanks henry) - * return the socket handle, -1 means fail */ + * I use Gaim proxy function to provide TCP proxy support, + * and qq_udp_proxy.c to add UDP proxy support (thanks henry) */ static gint _proxy_connect_full (GaimAccount *account, const gchar *host, guint16 port, GaimProxyConnectFunction func, gpointer data, gboolean use_tcp) { @@ -320,18 +419,16 @@ qd->server_ip = g_strdup(host); qd->server_port = port; - if (use_tcp) - /* TCP mode */ + if(use_tcp) return (gaim_proxy_connect(account, host, port, func, data) == NULL); else - /* UDP mode */ return _qq_udp_proxy_connect(account, host, port, func, data); } /* establish a generic QQ connection - * TCP/UDP, and direct/redirected - * return the socket handler, or -1 if there is any error */ -gint qq_connect(GaimAccount *account, const gchar *host, guint16 port, gboolean use_tcp, gboolean is_redirect) + * TCP/UDP, and direct/redirected */ +gint qq_connect(GaimAccount *account, const gchar *host, guint16 port, + gboolean use_tcp, gboolean is_redirect) { GaimConnection *gc; @@ -385,10 +482,19 @@ g_memmove(buf + 4, &(qd->dest_sin.sin_addr.s_addr), 4); g_memmove(buf + 8, &(qd->dest_sin.sin_port), 2); g_memmove(buf + 10, data, len); + errno = 0; ret = send(qd->fd, buf, len + 10, 0); } else { + errno = 0; ret = send(qd->fd, data, len, 0); } + if (ret == -1) { + gaim_connection_error(qd->gc, _("Socket send error")); + return ret; + } else if (errno == ECONNREFUSED) { + gaim_connection_error(qd->gc, _("Connection refused")); + return ret; + } return ret; } Modified: trunk/libgaim/protocols/qq/qq_proxy.h =================================================================== --- trunk/libgaim/protocols/qq/qq_proxy.h 2006-08-19 02:26:57 UTC (rev 16866) +++ trunk/libgaim/protocols/qq/qq_proxy.h 2006-08-19 02:32:55 UTC (rev 16867) @@ -25,7 +25,9 @@ #define _QQ_PROXY_H #include <glib.h> +#include "dnsquery.h" #include "proxy.h" + #include "qq.h" #define QQ_CONNECT_STEPS 2 /* steps in connection */ @@ -48,8 +50,6 @@ gint qq_connect(GaimAccount *account, const gchar *host, guint16 port, gboolean use_tcp, gboolean is_redirect); void qq_disconnect(GaimConnection *gc); -gint _qq_fill_host(struct sockaddr_in *addr, const gchar *host, guint16 port); - void _qq_show_packet(const gchar *desc, const guint8 *buf, gint len); #endif Modified: trunk/libgaim/protocols/qq/recv_core.c =================================================================== --- trunk/libgaim/protocols/qq/recv_core.c 2006-08-19 02:26:57 UTC (rev 16866) +++ trunk/libgaim/protocols/qq/recv_core.c 2006-08-19 02:32:55 UTC (rev 16867) @@ -296,7 +296,10 @@ gint len; gc = (GaimConnection *) data; - g_return_if_fail(gc != NULL && gc->proto_data != NULL && cond == GAIM_INPUT_READ); + if(gc == NULL || gc->proto_data == NULL || cond != GAIM_INPUT_READ) { + gaim_connection_error(gc, _("Socket error")); + return; + } qd = (qq_data *) gc->proto_data; buf = g_newa(guint8, MAX_PACKET_SIZE); Modified: trunk/libgaim/protocols/qq/send_core.c =================================================================== --- trunk/libgaim/protocols/qq/send_core.c 2006-08-19 02:26:57 UTC (rev 16866) +++ trunk/libgaim/protocols/qq/send_core.c 2006-08-19 02:32:55 UTC (rev 16867) @@ -73,7 +73,7 @@ /* for those need ack and resend no ack feed back from server * return number of bytes written to the socket, * return -1 if there is any error */ -gint _qq_send_packet(GaimConnection * gc, guint8 *buf, gint len, guint16 cmd) +gint _qq_send_packet(GaimConnection *gc, guint8 *buf, gint len, guint16 cmd) { qq_data *qd; qq_sendpacket *p; Modified: trunk/libgaim/protocols/qq/udp_proxy_s5.c =================================================================== --- trunk/libgaim/protocols/qq/udp_proxy_s5.c 2006-08-19 02:26:57 UTC (rev 16866) +++ trunk/libgaim/protocols/qq/udp_proxy_s5.c 2006-08-19 02:32:55 UTC (rev 16867) @@ -25,15 +25,13 @@ #include "udp_proxy_s5.h" -extern gint /* defined in qq_proxy.c */ - _qq_fill_host(struct sockaddr_in *addr, const gchar * host, guint16 port); - static void _qq_s5_canread_again(gpointer data, gint source, GaimInputCondition cond) { unsigned char buf[512]; struct PHB *phb = data; struct sockaddr_in sin; int len, error; + socklen_t errlen; gaim_input_remove(phb->inpa); gaim_debug(GAIM_DEBUG_INFO, "socks5 proxy", "Able to read again.\n"); @@ -61,7 +59,7 @@ if (phb->account == NULL || gaim_account_get_connection(phb->account) != NULL) { - phb->func(phb->data, -1, NULL); + phb->func(phb->data, -1, _("Unable to connect")); } g_free(phb->host); @@ -84,8 +82,8 @@ error = ETIMEDOUT; gaim_debug(GAIM_DEBUG_INFO, "QQ", "Connect didn't block\n"); - len = sizeof(error); - if (getsockopt(phb->udpsock, SOL_SOCKET, SO_ERROR, &error, &len) < 0) { + errlen = sizeof(error); + if (getsockopt(phb->udpsock, SOL_SOCKET, SO_ERROR, &error, &errlen) < 0) { gaim_debug(GAIM_DEBUG_ERROR, "QQ", "getsockopt failed.\n"); close(phb->udpsock); return; @@ -105,7 +103,8 @@ unsigned char buf[512]; struct PHB *phb = data; struct sockaddr_in sin, ctlsin; - int port, ctllen; + int port; + socklen_t ctllen; gaim_debug(GAIM_DEBUG_INFO, "s5_sendconnect", "remote host is %s:%d\n", phb->host, phb->port); @@ -137,7 +136,9 @@ port = ntohs(ctlsin.sin_port) + 1; while (1) { - _qq_fill_host(&sin, "0.0.0.0", port); + inet_aton("0.0.0.0", &(sin.sin_addr)); + sin.sin_family = AF_INET; + sin.sin_port = htons(port); if (bind(phb->udpsock, (struct sockaddr *) &sin, sizeof(sin)) < 0) { port++; if (port > 65500) { @@ -158,7 +159,7 @@ gaim_debug(GAIM_DEBUG_INFO, "s5_sendconnect", "packet too small\n"); if (phb->account == NULL || gaim_account_get_connection(phb->account) != NULL) { - phb->func(phb->data, -1, NULL); + phb->func(phb->data, -1, _("Unable to connect")); } g_free(phb->host); @@ -182,7 +183,7 @@ if (phb->account == NULL || gaim_account_get_connection(phb->account) != NULL) { - phb->func(phb->data, -1, NULL); + phb->func(phb->data, -1, _("Unable to connect")); } g_free(phb->host); @@ -195,7 +196,7 @@ if (phb->account == NULL || gaim_account_get_connection(phb->account) != NULL) { - phb->func(phb->data, -1, NULL); + phb->func(phb->data, -1, _("Unable to connect")); } g_free(phb->host); @@ -238,7 +239,7 @@ if (phb->account == NULL || gaim_account_get_connection(phb->account) != NULL) { - phb->func(phb->data, -1, NULL); + phb->func(phb->data, -1, _("Unable to connect")); } g_free(phb->host); @@ -263,7 +264,7 @@ if (phb->account == NULL || gaim_account_get_connection(phb->account) != NULL) { - phb->func(phb->data, -1, NULL); + phb->func(phb->data, -1, _("Unable to connect")); } g_free(phb->host); @@ -297,7 +298,7 @@ close(source); if (phb->account == NULL || gaim_account_get_connection(phb->account) != NULL) { - phb->func(phb->data, -1, NULL); + phb->func(phb->data, -1, _("Unable to connect")); } g_free(phb->host); @@ -327,7 +328,7 @@ if (phb->account == NULL || gaim_account_get_connection(phb->account) != NULL) { - phb->func(phb->data, -1, NULL); + phb->func(phb->data, -1, _("Unable to connect")); } g_free(phb->host); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-08-19 02:27:07
|
Revision: 16866 Author: sadrul Date: 2006-08-18 19:26:57 -0700 (Fri, 18 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16866&view=rev Log Message: ----------- Add dnsquery.c|h Modified Paths: -------------- trunk/libgaim/Makefile.am Modified: trunk/libgaim/Makefile.am =================================================================== --- trunk/libgaim/Makefile.am 2006-08-19 01:57:47 UTC (rev 16865) +++ trunk/libgaim/Makefile.am 2006-08-19 02:26:57 UTC (rev 16866) @@ -96,6 +96,7 @@ savedstatuses.c \ server.c \ signals.c \ + dnsquery.c \ dnssrv.c\ status.c \ stringref.c \ @@ -143,6 +144,7 @@ savedstatuses.h \ server.h \ signals.h \ + dnsquery.h \ dnssrv.h \ status.h \ stringref.h \ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ev...@us...> - 2006-08-19 01:58:24
|
Revision: 16865 Author: evands Date: 2006-08-18 18:57:47 -0700 (Fri, 18 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16865&view=rev Log Message: ----------- Fixed Zephyr compilation Modified Paths: -------------- trunk/libgaim/protocols/zephyr/zephyr.c Modified: trunk/libgaim/protocols/zephyr/zephyr.c =================================================================== --- trunk/libgaim/protocols/zephyr/zephyr.c 2006-08-19 01:53:46 UTC (rev 16864) +++ trunk/libgaim/protocols/zephyr/zephyr.c 2006-08-19 01:57:47 UTC (rev 16865) @@ -27,7 +27,7 @@ */ /* XXX eww */ -#include "core/internal.h" +#include "libgaim/internal.h" #include "accountopt.h" #include "debug.h" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ev...@us...> - 2006-08-19 01:53:52
|
Revision: 16864 Author: evands Date: 2006-08-18 18:53:46 -0700 (Fri, 18 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16864&view=rev Log Message: ----------- It'd sure be nice if you could set a repository-global svn:ignore serverside... Property Changed: ---------------- trunk/libgaim/ trunk/libgaim/plugins/ Property changes on: trunk/libgaim ___________________________________________________________________ Name: svn:ignore + Makefile.in .deps Makefile dbus-types.h Property changes on: trunk/libgaim/plugins ___________________________________________________________________ Name: svn:ignore + Makefile.in Makefile .libs .deps This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ev...@us...> - 2006-08-19 01:50:27
|
Revision: 16863 Author: evands Date: 2006-08-18 18:50:10 -0700 (Fri, 18 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16863&view=rev Log Message: ----------- Renamed 'core' to 'libgaim' Modified Paths: -------------- trunk/Makefile.am trunk/configure.ac trunk/console/Makefile.am trunk/gtk/Makefile.am trunk/gtk/plugins/Makefile.am trunk/gtk/plugins/crazychat/Makefile.am trunk/gtk/plugins/docklet/Makefile.am trunk/gtk/plugins/gestures/Makefile.am trunk/gtk/plugins/gevolution/Makefile.am trunk/gtk/plugins/musicmessaging/Makefile.am trunk/gtk/plugins/ticker/Makefile.am trunk/libgaim/plugins/Makefile.am trunk/libgaim/plugins/mono/loader/Makefile.am trunk/libgaim/plugins/perl/Makefile.am trunk/libgaim/plugins/ssl/Makefile.am trunk/libgaim/plugins/tcl/Makefile.am trunk/libgaim/protocols/bonjour/Makefile.am trunk/libgaim/protocols/gg/Makefile.am trunk/libgaim/protocols/irc/Makefile.am trunk/libgaim/protocols/jabber/Makefile.am trunk/libgaim/protocols/msn/Makefile.am trunk/libgaim/protocols/novell/Makefile.am trunk/libgaim/protocols/oscar/Makefile.am trunk/libgaim/protocols/qq/Makefile.am trunk/libgaim/protocols/sametime/Makefile.am trunk/libgaim/protocols/silc/Makefile.am trunk/libgaim/protocols/simple/Makefile.am trunk/libgaim/protocols/toc/Makefile.am trunk/libgaim/protocols/yahoo/Makefile.am trunk/libgaim/protocols/zephyr/Makefile.am Added Paths: ----------- trunk/libgaim/ Removed Paths: ------------- trunk/core/ trunk/src/ Modified: trunk/Makefile.am =================================================================== --- trunk/Makefile.am 2006-08-19 01:37:26 UTC (rev 16862) +++ trunk/Makefile.am 2006-08-19 01:50:10 UTC (rev 16863) @@ -56,7 +56,7 @@ GNT_DIR=console endif -SUBDIRS = core doc $(GNT_DIR) $(GTK_DIR) m4macros po +SUBDIRS = libgaim doc $(GNT_DIR) $(GTK_DIR) m4macros po docs: Doxyfile if HAVE_DOXYGEN Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2006-08-19 01:37:26 UTC (rev 16862) +++ trunk/configure.ac 2006-08-19 01:50:10 UTC (rev 16863) @@ -1821,30 +1821,30 @@ gtk/plugins/musicmessaging/Makefile gtk/sounds/Makefile gtk/plugins/ticker/Makefile - core/plugins/Makefile - core/plugins/mono/Makefile - core/plugins/mono/api/Makefile - core/plugins/mono/loader/Makefile - core/plugins/perl/Makefile - core/plugins/perl/common/Makefile.PL - core/plugins/ssl/Makefile - core/plugins/tcl/Makefile - core/Makefile - core/protocols/Makefile - core/protocols/bonjour/Makefile - core/protocols/gg/Makefile - core/protocols/irc/Makefile - core/protocols/jabber/Makefile - core/protocols/msn/Makefile - core/protocols/novell/Makefile - core/protocols/oscar/Makefile - core/protocols/qq/Makefile - core/protocols/sametime/Makefile - core/protocols/silc/Makefile - core/protocols/simple/Makefile - core/protocols/toc/Makefile - core/protocols/yahoo/Makefile - core/protocols/zephyr/Makefile + libgaim/plugins/Makefile + libgaim/plugins/mono/Makefile + libgaim/plugins/mono/api/Makefile + libgaim/plugins/mono/loader/Makefile + libgaim/plugins/perl/Makefile + libgaim/plugins/perl/common/Makefile.PL + libgaim/plugins/ssl/Makefile + libgaim/plugins/tcl/Makefile + libgaim/Makefile + libgaim/protocols/Makefile + libgaim/protocols/bonjour/Makefile + libgaim/protocols/gg/Makefile + libgaim/protocols/irc/Makefile + libgaim/protocols/jabber/Makefile + libgaim/protocols/msn/Makefile + libgaim/protocols/novell/Makefile + libgaim/protocols/oscar/Makefile + libgaim/protocols/qq/Makefile + libgaim/protocols/sametime/Makefile + libgaim/protocols/silc/Makefile + libgaim/protocols/simple/Makefile + libgaim/protocols/toc/Makefile + libgaim/protocols/yahoo/Makefile + libgaim/protocols/zephyr/Makefile console/Makefile console/plugins/Makefile po/Makefile.in Modified: trunk/console/Makefile.am =================================================================== --- trunk/console/Makefile.am 2006-08-19 01:37:26 UTC (rev 16862) +++ trunk/console/Makefile.am 2006-08-19 01:50:10 UTC (rev 16863) @@ -47,7 +47,7 @@ $(GLIB_LIBS) \ $(LIBXML_LIBS) \ -L./libgnt/ -lgnt \ - -L$(top_srcdir)/core -lgaim + -L$(top_srcdir)/libgaim -lgaim AM_CPPFLAGS = \ -DSTANDALONE \ @@ -56,7 +56,7 @@ -DLIBDIR=\"$(libdir)/gaim/\" \ -DLOCALEDIR=\"$(datadir)/locale\" \ -DSYSCONFDIR=\"$(sysconfdir)\" \ - -I$(top_srcdir)/core/ \ + -I$(top_srcdir)/libgaim/ \ -I ./libgnt/ \ $(GSTREAMER_CFLAGS) \ $(DEBUG_CFLAGS) \ Modified: trunk/gtk/Makefile.am =================================================================== --- trunk/gtk/Makefile.am 2006-08-19 01:37:26 UTC (rev 16862) +++ trunk/gtk/Makefile.am 2006-08-19 01:50:10 UTC (rev 16863) @@ -163,7 +163,7 @@ $(STARTUP_NOTIFICATION_LIBS) \ $(LIBXML_LIBS) \ $(GTK_LIBS) \ - -L$(top_srcdir)/core -lgaim + -L$(top_srcdir)/libgaim -lgaim AM_CPPFLAGS = \ -DBR_PTHREADS=0 \ @@ -171,7 +171,7 @@ -DLIBDIR=\"$(libdir)/gaim/\" \ -DLOCALEDIR=\"$(datadir)/locale\" \ -DSYSCONFDIR=\"$(sysconfdir)\" \ - -I$(top_srcdir)/core/ \ + -I$(top_srcdir)/libgaim/ \ $(GSTREAMER_CFLAGS) \ $(DEBUG_CFLAGS) \ $(GTK_CFLAGS) \ Modified: trunk/gtk/plugins/Makefile.am =================================================================== --- trunk/gtk/plugins/Makefile.am 2006-08-19 01:37:26 UTC (rev 16862) +++ trunk/gtk/plugins/Makefile.am 2006-08-19 01:50:10 UTC (rev 16863) @@ -67,7 +67,7 @@ -DDATADIR=\"$(datadir)\" \ -DVERSION=\"$(VERSION)\" \ -I$(top_builddir)/src \ - -I$(top_srcdir)/core \ + -I$(top_srcdir)/libgaim \ -I$(top_srcdir)/gtk \ $(DEBUG_CFLAGS) \ $(GTK_CFLAGS) \ Modified: trunk/gtk/plugins/crazychat/Makefile.am =================================================================== --- trunk/gtk/plugins/crazychat/Makefile.am 2006-08-19 01:37:26 UTC (rev 16862) +++ trunk/gtk/plugins/crazychat/Makefile.am 2006-08-19 01:50:10 UTC (rev 16863) @@ -32,7 +32,7 @@ #-I$(top_srcdir)/include AM_CPPFLAGS = -DGAIM_PLUGINS \ - -I$(top_srcdir)/core \ + -I$(top_srcdir)/libgaim \ -I$(top_srcdir)/gtk \ $(GTK_CFLAGS) \ $(GTKGLEXT_CFLAGS) \ Modified: trunk/gtk/plugins/docklet/Makefile.am =================================================================== --- trunk/gtk/plugins/docklet/Makefile.am 2006-08-19 01:37:26 UTC (rev 16862) +++ trunk/gtk/plugins/docklet/Makefile.am 2006-08-19 01:50:10 UTC (rev 16863) @@ -24,7 +24,7 @@ AM_CPPFLAGS = \ -DDATADIR=\"$(datadir)\" \ -DVERSION=\"$(VERSION)\" \ - -I$(top_srcdir)/core \ + -I$(top_srcdir)/libgaim \ -I$(top_srcdir)/gtk \ $(DEBUG_CFLAGS) \ $(X_CFLAGS) \ Modified: trunk/gtk/plugins/gestures/Makefile.am =================================================================== --- trunk/gtk/plugins/gestures/Makefile.am 2006-08-19 01:37:26 UTC (rev 16862) +++ trunk/gtk/plugins/gestures/Makefile.am 2006-08-19 01:50:10 UTC (rev 16863) @@ -18,7 +18,7 @@ AM_CPPFLAGS = \ -DDATADIR=\"$(datadir)\" \ -DVERSION=\"$(VERSION)\" \ - -I$(top_srcdir)/core \ + -I$(top_srcdir)/libgaim \ -I$(top_srcdir)/gtk \ $(DEBUG_CFLAGS) \ $(GTK_CFLAGS) Modified: trunk/gtk/plugins/gevolution/Makefile.am =================================================================== --- trunk/gtk/plugins/gevolution/Makefile.am 2006-08-19 01:37:26 UTC (rev 16862) +++ trunk/gtk/plugins/gevolution/Makefile.am 2006-08-19 01:50:10 UTC (rev 16863) @@ -25,7 +25,7 @@ AM_CPPFLAGS = \ -DDATADIR=\"$(datadir)\" \ -DVERSION=\"$(VERSION)\" \ - -I$(top_srcdir)/core \ + -I$(top_srcdir)/libgaim \ -I$(top_srcdir)/gtk \ $(EVOLUTION_ADDRESSBOOK_CFLAGS) \ $(DEBUG_CFLAGS) \ Modified: trunk/gtk/plugins/musicmessaging/Makefile.am =================================================================== --- trunk/gtk/plugins/musicmessaging/Makefile.am 2006-08-19 01:37:26 UTC (rev 16862) +++ trunk/gtk/plugins/musicmessaging/Makefile.am 2006-08-19 01:50:10 UTC (rev 16863) @@ -22,14 +22,14 @@ .PHONY: always -$(top_builddir)/core/dbus-types.h: always +$(top_builddir)/libgaim/dbus-types.h: always cd $(@D) && $(MAKE) $(AM_MAKEFLAGS) $(@F) -music-messaging-bindings.c: $(top_srcdir)/core/dbus-analyze-functions.py $(musicmessaging_la_SOURCES) +music-messaging-bindings.c: $(top_srcdir)/libgaim/dbus-analyze-functions.py $(musicmessaging_la_SOURCES) cat $(srcdir)/$(musicmessaging_la_SOURCES) | \ - $(PYTHON) $(top_srcdir)/core/dbus-analyze-functions.py --export-only > $@ + $(PYTHON) $(top_srcdir)/libgaim/dbus-analyze-functions.py --export-only > $@ -$(musicmessaging_la_OBJECTS) musicmessaging.so: music-messaging-bindings.c $(top_builddir)/core/dbus-types.h +$(musicmessaging_la_OBJECTS) musicmessaging.so: music-messaging-bindings.c $(top_builddir)/libgaim/dbus-types.h endif endif @@ -37,8 +37,8 @@ AM_CPPFLAGS = \ -DDATADIR=\"$(datadir)\" \ -DVERSION=\"$(VERSION)\" \ - -I$(top_builddir)/core \ - -I$(top_srcdir)/core \ + -I$(top_builddir)/libgaim \ + -I$(top_srcdir)/libgaim \ -I$(top_srcdir)/gtk \ $(DEBUG_CFLAGS) \ $(GTK_CFLAGS) \ Modified: trunk/gtk/plugins/ticker/Makefile.am =================================================================== --- trunk/gtk/plugins/ticker/Makefile.am 2006-08-19 01:37:26 UTC (rev 16862) +++ trunk/gtk/plugins/ticker/Makefile.am 2006-08-19 01:50:10 UTC (rev 16863) @@ -19,7 +19,7 @@ AM_CPPFLAGS = \ -DDATADIR=\"$(datadir)\" \ -DVERSION=\"$(VERSION)\" \ - -I$(top_srcdir)/core \ + -I$(top_srcdir)/libgaim \ -I$(top_srcdir)/gtk \ $(DEBUG_CFLAGS) \ $(GTK_CFLAGS) Copied: trunk/libgaim (from rev 16862, trunk/core) Modified: trunk/libgaim/plugins/Makefile.am =================================================================== --- trunk/core/plugins/Makefile.am 2006-08-19 01:37:26 UTC (rev 16862) +++ trunk/libgaim/plugins/Makefile.am 2006-08-19 01:50:10 UTC (rev 16863) @@ -53,14 +53,14 @@ .PHONY: always -$(top_builddir)/core/dbus-types.h: always +$(top_builddir)/libgaim/dbus-types.h: always cd $(@D) && $(MAKE) $(AM_MAKEFLAGS) $(@F) -dbus-example-bindings.c: $(top_srcdir)/core/dbus-analyze-functions.py $(dbus_example_la_SOURCES) +dbus-example-bindings.c: $(top_srcdir)/libgaim/dbus-analyze-functions.py $(dbus_example_la_SOURCES) cat $(srcdir)/$(dbus_example_la_SOURCES) | \ - $(PYTHON) $(top_srcdir)/core/dbus-analyze-functions.py --export-only > $@ + $(PYTHON) $(top_srcdir)/libgaim/dbus-analyze-functions.py --export-only > $@ -$(dbus_example_la_OBJECTS) dbus-example.so: dbus-example-bindings.c $(top_builddir)/core/dbus-types.h +$(dbus_example_la_OBJECTS) dbus-example.so: dbus-example-bindings.c $(top_builddir)/libgaim/dbus-types.h endif # ENABLE_DBUS @@ -82,8 +82,8 @@ AM_CPPFLAGS = \ -DDATADIR=\"$(datadir)\" \ -DVERSION=\"$(VERSION)\" \ - -I$(top_builddir)/core \ - -I$(top_srcdir)/core \ + -I$(top_builddir)/libgaim \ + -I$(top_srcdir)/libgaim \ $(DEBUG_CFLAGS) \ $(GLIB_CFLAGS) \ $(PLUGIN_CFLAGS) \ Modified: trunk/libgaim/plugins/mono/loader/Makefile.am =================================================================== --- trunk/core/plugins/mono/loader/Makefile.am 2006-08-19 01:37:26 UTC (rev 16862) +++ trunk/libgaim/plugins/mono/loader/Makefile.am 2006-08-19 01:50:10 UTC (rev 16863) @@ -19,7 +19,7 @@ AM_CPPFLAGS = \ -DVERSION=\"$(VERSION)\" \ -I$(top_srcdir) \ - -I$(top_srcdir)/core \ + -I$(top_srcdir)/libgaim \ $(DEBUG_CFLAGS) \ $(PLUGIN_CFLAGS) \ $(MONO_CFLAGS) Modified: trunk/libgaim/plugins/perl/Makefile.am =================================================================== --- trunk/core/plugins/perl/Makefile.am 2006-08-19 01:37:26 UTC (rev 16862) +++ trunk/libgaim/plugins/perl/Makefile.am 2006-08-19 01:50:10 UTC (rev 16863) @@ -157,7 +157,7 @@ AM_CPPFLAGS = \ -DVERSION=\"$(VERSION)\" \ -I$(top_srcdir) \ - -I$(top_srcdir)/core \ + -I$(top_srcdir)/libgaim \ -I$(top_srcdir)/gtk \ # FIXME $(DEBUG_CFLAGS) \ $(GTK_CFLAGS) \ Modified: trunk/libgaim/plugins/ssl/Makefile.am =================================================================== --- trunk/core/plugins/ssl/Makefile.am 2006-08-19 01:37:26 UTC (rev 16862) +++ trunk/libgaim/plugins/ssl/Makefile.am 2006-08-19 01:50:10 UTC (rev 16863) @@ -26,7 +26,7 @@ AM_CPPFLAGS = \ -DDATADIR=\"$(datadir)\" \ -DLIBDIR=\"$(libdir)/gaim/\" \ - -I$(top_srcdir)/core \ + -I$(top_srcdir)/libgaim \ $(DEBUG_CFLAGS) \ $(GLIB_CFLAGS) \ $(PLUGIN_CFLAGS) \ Modified: trunk/libgaim/plugins/tcl/Makefile.am =================================================================== --- trunk/core/plugins/tcl/Makefile.am 2006-08-19 01:37:26 UTC (rev 16862) +++ trunk/libgaim/plugins/tcl/Makefile.am 2006-08-19 01:50:10 UTC (rev 16863) @@ -12,7 +12,7 @@ AM_CPPFLAGS = \ -DVERSION=\"$(VERSION)\" \ -I$(top_srcdir) \ - -I$(top_srcdir)/core \ + -I$(top_srcdir)/libgaim \ $(DEBUG_CFLAGS) \ $(GLIB_CFLAGS) \ $(PLUGIN_CFLAGS) \ Modified: trunk/libgaim/protocols/bonjour/Makefile.am =================================================================== --- trunk/core/protocols/bonjour/Makefile.am 2006-08-19 01:37:26 UTC (rev 16862) +++ trunk/libgaim/protocols/bonjour/Makefile.am 2006-08-19 01:50:10 UTC (rev 16863) @@ -35,7 +35,7 @@ AM_CPPFLAGS = \ - -I$(top_srcdir)/core \ + -I$(top_srcdir)/libgaim \ $(GLIB_CFLAGS) \ $(DEBUG_CFLAGS) \ $(HOWL_CFLAGS) Modified: trunk/libgaim/protocols/gg/Makefile.am =================================================================== --- trunk/core/protocols/gg/Makefile.am 2006-08-19 01:37:26 UTC (rev 16862) +++ trunk/libgaim/protocols/gg/Makefile.am 2006-08-19 01:50:10 UTC (rev 16863) @@ -53,7 +53,7 @@ endif AM_CPPFLAGS = \ - -I$(top_srcdir)/core \ + -I$(top_srcdir)/libgaim \ $(GLIB_CFLAGS) \ $(DEBUG_CFLAGS) Modified: trunk/libgaim/protocols/irc/Makefile.am =================================================================== --- trunk/core/protocols/irc/Makefile.am 2006-08-19 01:37:26 UTC (rev 16862) +++ trunk/libgaim/protocols/irc/Makefile.am 2006-08-19 01:50:10 UTC (rev 16863) @@ -28,6 +28,6 @@ endif AM_CPPFLAGS = \ - -I$(top_srcdir)/core \ + -I$(top_srcdir)/libgaim \ $(GLIB_CFLAGS) \ $(DEBUG_CFLAGS) Modified: trunk/libgaim/protocols/jabber/Makefile.am =================================================================== --- trunk/core/protocols/jabber/Makefile.am 2006-08-19 01:37:26 UTC (rev 16862) +++ trunk/libgaim/protocols/jabber/Makefile.am 2006-08-19 01:50:10 UTC (rev 16863) @@ -58,7 +58,7 @@ endif AM_CPPFLAGS = \ - -I$(top_srcdir)/core \ + -I$(top_srcdir)/libgaim \ $(DEBUG_CFLAGS) \ $(GLIB_CFLAGS) \ $(LIBXML_CFLAGS) Modified: trunk/libgaim/protocols/msn/Makefile.am =================================================================== --- trunk/core/protocols/msn/Makefile.am 2006-08-19 01:37:26 UTC (rev 16862) +++ trunk/libgaim/protocols/msn/Makefile.am 2006-08-19 01:50:10 UTC (rev 16863) @@ -83,6 +83,6 @@ endif AM_CPPFLAGS = \ - -I$(top_srcdir)/core \ + -I$(top_srcdir)/libgaim \ $(GLIB_CFLAGS) \ $(DEBUG_CFLAGS) Modified: trunk/libgaim/protocols/novell/Makefile.am =================================================================== --- trunk/core/protocols/novell/Makefile.am 2006-08-19 01:37:26 UTC (rev 16862) +++ trunk/libgaim/protocols/novell/Makefile.am 2006-08-19 01:50:10 UTC (rev 16863) @@ -50,6 +50,6 @@ endif AM_CPPFLAGS = \ - -I$(top_srcdir)/core \ + -I$(top_srcdir)/libgaim \ $(DEBUG_CFLAGS) \ $(GLIB_CFLAGS) Modified: trunk/libgaim/protocols/oscar/Makefile.am =================================================================== --- trunk/core/protocols/oscar/Makefile.am 2006-08-19 01:37:26 UTC (rev 16862) +++ trunk/libgaim/protocols/oscar/Makefile.am 2006-08-19 01:50:10 UTC (rev 16863) @@ -64,6 +64,6 @@ endif AM_CPPFLAGS = \ - -I$(top_srcdir)/core \ + -I$(top_srcdir)/libgaim \ $(GLIB_CFLAGS) \ $(DEBUG_CFLAGS) Modified: trunk/libgaim/protocols/qq/Makefile.am =================================================================== --- trunk/core/protocols/qq/Makefile.am 2006-08-19 01:37:26 UTC (rev 16862) +++ trunk/libgaim/protocols/qq/Makefile.am 2006-08-19 01:50:10 UTC (rev 16863) @@ -91,7 +91,7 @@ endif AM_CPPFLAGS = \ - -I$(top_srcdir)/core \ + -I$(top_srcdir)/libgaim \ -DVERSION=\"$(VERSION)\" \ $(DEBUG_CFLAGS) \ $(GLIB_CFLAGS) \ Modified: trunk/libgaim/protocols/sametime/Makefile.am =================================================================== --- trunk/core/protocols/sametime/Makefile.am 2006-08-19 01:37:26 UTC (rev 16862) +++ trunk/libgaim/protocols/sametime/Makefile.am 2006-08-19 01:50:10 UTC (rev 16863) @@ -34,7 +34,7 @@ AM_CFLAGS = \ $(GLIB_CFLAGS) $(MEANWHILE_CFLAGS) \ $(DEBUG_CFLAGS) \ - -I$(top_srcdir)/core + -I$(top_srcdir)/libgaim AM_CPPFLAGS = \ Modified: trunk/libgaim/protocols/silc/Makefile.am =================================================================== --- trunk/core/protocols/silc/Makefile.am 2006-08-19 01:37:26 UTC (rev 16862) +++ trunk/libgaim/protocols/silc/Makefile.am 2006-08-19 01:50:10 UTC (rev 16863) @@ -30,6 +30,6 @@ endif AM_CPPFLAGS = \ - -I$(top_srcdir)/core \ + -I$(top_srcdir)/libgaim \ $(GLIB_CFLAGS) \ $(DEBUG_CFLAGS) Modified: trunk/libgaim/protocols/simple/Makefile.am =================================================================== --- trunk/core/protocols/simple/Makefile.am 2006-08-19 01:37:26 UTC (rev 16862) +++ trunk/libgaim/protocols/simple/Makefile.am 2006-08-19 01:50:10 UTC (rev 16863) @@ -29,6 +29,6 @@ endif AM_CPPFLAGS = \ - -I$(top_srcdir)/core \ + -I$(top_srcdir)/libgaim \ $(GLIB_CFLAGS) \ $(DEBUG_CFLAGS) Modified: trunk/libgaim/protocols/toc/Makefile.am =================================================================== --- trunk/core/protocols/toc/Makefile.am 2006-08-19 01:37:26 UTC (rev 16862) +++ trunk/libgaim/protocols/toc/Makefile.am 2006-08-19 01:50:10 UTC (rev 16863) @@ -26,6 +26,6 @@ endif AM_CPPFLAGS = \ - -I$(top_srcdir)/core \ + -I$(top_srcdir)/libgaim \ $(GLIB_CFLAGS) \ $(DEBUG_CFLAGS) Modified: trunk/libgaim/protocols/yahoo/Makefile.am =================================================================== --- trunk/core/protocols/yahoo/Makefile.am 2006-08-19 01:37:26 UTC (rev 16862) +++ trunk/libgaim/protocols/yahoo/Makefile.am 2006-08-19 01:50:10 UTC (rev 16863) @@ -47,6 +47,6 @@ endif AM_CPPFLAGS = \ - -I$(top_srcdir)/core \ + -I$(top_srcdir)/libgaim \ $(GLIB_CFLAGS) \ $(DEBUG_CFLAGS) Modified: trunk/libgaim/protocols/zephyr/Makefile.am =================================================================== --- trunk/core/protocols/zephyr/Makefile.am 2006-08-19 01:37:26 UTC (rev 16862) +++ trunk/libgaim/protocols/zephyr/Makefile.am 2006-08-19 01:50:10 UTC (rev 16863) @@ -101,8 +101,8 @@ AM_CPPFLAGS = \ -I$(top_srcdir) \ - -I$(top_srcdir)/core \ - -I$(top_srcdir)/core/protocols \ + -I$(top_srcdir)/libgaim \ + -I$(top_srcdir)/libgaim/protocols \ -DCONFDIR=\"$(confdir)\" \ $(GLIB_CFLAGS) \ $(KRB4_CFLAGS) \ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ev...@us...> - 2006-08-19 01:37:34
|
Revision: 16862 Author: evands Date: 2006-08-18 18:37:26 -0700 (Fri, 18 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16862&view=rev Log Message: ----------- Some more svn:ignore fixes Property Changed: ---------------- trunk/console/ trunk/console/libgnt/ trunk/console/plugins/ Property changes on: trunk/console ___________________________________________________________________ Name: svn:ignore + Makefile.in gmon.out .libs .deps Makefile .error Property changes on: trunk/console/libgnt ___________________________________________________________________ Name: svn:ignore + Makefile.in .deps .libs Property changes on: trunk/console/plugins ___________________________________________________________________ Name: svn:ignore + Makefile.in .deps Makefile This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ev...@us...> - 2006-08-19 01:35:58
|
Revision: 16861 Author: evands Date: 2006-08-18 18:35:50 -0700 (Fri, 18 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16861&view=rev Log Message: ----------- Last of my local tree's changes for the restructuring Modified Paths: -------------- trunk/gaim.pc.in Added Paths: ----------- trunk/doc/ChangeLog trunk/doc/ChangeLog.API trunk/doc/HOWTO Removed Paths: ------------- trunk/sounds/ Copied: trunk/doc/ChangeLog (from rev 16838, trunk/plugins/ChangeLog) =================================================================== --- trunk/doc/ChangeLog (rev 0) +++ trunk/doc/ChangeLog 2006-08-19 01:35:50 UTC (rev 16861) @@ -0,0 +1,161 @@ +version 0.11.0pre5: + The build process for plugins has changed slightly. Everything still + works more or less the same from a user point of view, that is, 'make + file.so' will still turn file.c into a plugin. The build now uses + libtool in an attempt to increase portability. By using libtool the + act of compiling and linking has been divided into two steps (to be + precise it always was two but we only called gcc once; now we call + libtool twice). PLUGIN_CFLAGS has also been added. Any -D switches you + were passing in PLUGIN_LIBS should be passed in PLUGIN_CFLAGS now. + +version 0.11.0pre1: + Gaim is now multi-connection based. This represents a significant + change. Most of the code was modified, though most of the modifications + were small (referencing an int as part of a struct as opposed to as a + global int). Plugins need to be modified to match the new function + declarations and such. + + Gaim now uses GModule from the GLib library for plugins. This brings + a few changes. gaim_plugin_init is now passed a GModule *, which it + should use for all of its callbacks. gaim_plugin_init now returns + char * instead of int instead of void. If gaim_plugin_init returns + NULL then gaim assumes everything was OK and proceeds. Otherwise, it + displays the error message and unloads your plugin. There is no more + gaim_plugin_error (at least, that gaim itself will use. You may wish + to simply return gaim_plugin_error() in gaim_plugin_init). + + Because gaim now uses GModule, plugins are opened with RTLD_GLOBAL. I + had previously wanted to avoid this, but there are simply too many + benefits gained from using GModule to reject it for this reason. This + means that plugins can now call each other's functions. Beware, this + has good and bad implications. If you call a function, it will look + first in your plugin, and then in gaim's global symbol table, including + other plugins. + + The new system allows for protocol plugins. New protocols (including + Yahoo, MSN, IRC, ICQ, etc) can be loaded dynamically. However, most + of these plugins are going to be controlled by the gaim maintainers. + If you have interest in writing a protocol plugin, please talk to one + of us before you start. + + That's about all that I'm going to talk about. My SN is EWarmenhoven + if you have any questions (like what the hell struct gaim_connection is + and what its relation to struct aim_user is). + +version 0.10.0: + Rather than have a separate CFLAGS and LDFLAGS for the plugins than + for gaim, and doing all kinds of crazy things to work around the + problems that creates, the plugins now have the same CFLAGS and LIBS. + The plugins also have PLUGIN_LIBS which can be passed at make time. + This makes things like #ifdef USE_APPLET and #ifdef USE_PERL much more + reliable. (#include "config.h" in order to get all the #defines) + + The internals of gaim plugin events got modified slightly. It should + have no effect on existing plugins or the way plugins are made. The + change was to make my life easier adding perl. It should also make + adding new plugin events even easier than before (though I doubt that + any more will ever be added). Also, events are printed to the debug + window. + + event_buddy_away was being triggered every blist_update for every away + buddy. This got fixed, but now when you sign on, event_buddy_away may + be called before event_buddy_signon. Not that it should matter much. + + Just after I finish saying that no more events will be added, I go and + add one. Go figure. Anyway, it's event_new_conversation. Enough people + asked me to add it, and I found it useful enough, that I finally did + add it. It gets passed a char *, the name of the person who the + conversation is with. This gets triggered when a new conversation + window is created, in case you couldn't figure it out on your own. + + event_blist_update wasn't being called if you weren't reporting idle + time or if you were idle. This got fixed. + +version 0.9.20: + It's 3 am the night before finals, it's obviously a good time to hack + gaim. + + This became quite long, and if you don't want to read it all, here's + the important stuff summed up: + - 9 new events (see SIGNALS file for more details) + - int gaim_plugin_init(void *) (no longer returns void, see error.c) + - void gaim_plugin_unload(void *) (to allow plugin to remove itself) + - can only load 1 instance of the same plugin + - PLUGIN_LIBS for extra libraries for plugin + + The first thing to note is that there are about 9 new events plugins + can attach to, most of them dealing with chat, since I know that was a + big thing that was missing. Please note that I was nice and decided to + tack these extra events onto the end of the enum, which means that + plugins do not have to be recompiled in order for them to still work. + + The big change is that gaim_plugin_init no longer returns void, but + int. If it returns 0+, gaim interprets this as there being no error, + and continues with loading as normal. (This should be backwards- + compatible: returning 0/1 is the equivalent of returning void.) If it + returns a number less than 0, there was an error loading detected by + the plugin. At that point, gaim will try to clean things up by removing + any callbacks that have been added by the plugin. It will then try to + call the plugin's gaim_plugin_error function, if there is one. The + function should take an int (the int returned by gaim_plugin_init) and + return a char*. If the char* is not NULL, it is displayed by gaim as an + error message. The plugin is then unloaded and closed and life goes + back to normal. If any of that was confusing, it was confusing to me, + too. I added a plugin, error.c, which should help clear things up. + + Another big thing to note is that plugins can unload themselves. A good + example of why this is useful is a ticker plugin. If the user closes + the ticker window, they obviously want the plugin to be unloaded. Gaim + has no way of knowing that; therefore, the plugin must tell gaim that + it is to be unloaded. To have a plugin unload itself, simply call + gaim_plugin_unload(void *) (the void* is the handle passed to + gaim_plugin_init). Because you are explicitly asking to be removed, + gaim assumes that you have done any cleanup already, and so does not + call gaim_plugin_remove. Rather, it simply removes your callbacks and + unloads the plugin. (There is some trickery to this. Think about it: + your plugin calls the function, your plugin is unloaded, and execution + returns to your plugin, which no longer exists. This would cause a + segfault if it behaved exactly as described. Instead, the plugin is + removed from the list of plugins, and removed 5 seconds later. By then + the plugin should be effectively gone, though still in memory.) + + In previous versions of gaim, you could load multiple copies of the + same plugin. This is no longer the case. The reason for this was that + there were not two instances of the plugin in memory; rather, one copy + and two structures representing the same plugin. Then, the callbacks + would be called twice (since the plugin would most likely act the same + across multiple instances), and when one was unloaded, all callbacks + for both instances would be removed. Rather than deal with two copies + of the same plugin, it is easier and cleaner to only handle one. + + Sometimes it's necessary to link a plugin with libraries other than the + ones needed for GTK. Before, it was necessary to modify the Makefile to + do so (which was usually messy since it's generated by GNU automake). + Now, you can simply set the environment variable PLUGIN_LIBS to be the + extra libraries you want to link in. For example, to link plugin.c with + the math library, you can run the command + PLUGIN_LIBS=-lm make plugin.so + To link with multiple plugins, make sure to indicate spaces, e.g. + PLUGIN_LIBS='-lm -lcrypt' make encrypt.so + + There is a new event, event_quit, which signifies that gaim has exited + correctly (i.e. didn't segfault). Also, after this event is called, all + plugins are removed, and their gaim_plugin_remove function is called. + This behavior is different from previous versions; however, it is the + proper way of doing things, and should have no effect on current + plugins. The reason event_quit exists despite plugins being removed at + quit is because a plugin can be removed without gaim quitting. They are + distinctly separate events. + + The new events mean that some versions of gaim have certain events, + others don't. The thing I find fascinating though is that even if a + plugin is compiled for a later version, it will still be backwards- + compatible, even if it makes use of the newer events. The reason why + is the names of the events are stored as integers, and those integers + will never match an event in a prior version. This means you don't + have to worry about which version the person is using, only which + version the person is compiling against. For simplicity's sake, please + assume people are compiling against the latest version. For + practicality's sake, VERSION is #define'd to be the version you're + compiling against, starting with 0.9.20. Prior versions do not have + this defined in the standard plugin Makefile. Property changes on: trunk/doc/ChangeLog ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Copied: trunk/doc/ChangeLog.API (from rev 16838, trunk/plugins/ChangeLog.API) =================================================================== --- trunk/doc/ChangeLog.API (rev 0) +++ trunk/doc/ChangeLog.API 2006-08-19 01:35:50 UTC (rev 16861) @@ -0,0 +1,612 @@ +Gaim: The Pimpin' Penguin IM Client that's good for the soul! + +version 2.0.0: + Changed: + * All the status stuff. Yay! + * gaim_prefs_connect_callback(), added handle parameter + * gtk_imhtml_toolbar now descends from GtkHBox making it easier to add your + own widgets to it + * gaim_find_conversation_with_account, added a "type" parameter + * gaim_gtk_prefs_labeled_spin_button, the "key" parameter is now a + const char* instead of just a char* + * gaim_gtk_prefs_labeled_entry, the "key" parameter is now a const char* + instead of just a char* + * the add_buddy perl sub. The sub now takes the account as the first + argument, and buddy and group as the second and third. It also adds + the buddy to the server-side buddy list of the given account. + * gaim_connection_new, gaim_account_connect and gaim_account_register no + longer return a GaimConnection + * keep_alive in GaimConnection is renamed to keepalive + * gaim_mkstemp, added a second argument, a boolean, of whether or not the + file is binary + * gaim_log_logger_new, rewritten + * gaim_conv_window_remove_conversation()'s last argument to be a + GaimConversation. + * A new blocked icon: pixmaps/status/default/blocked.png + * In pixmaps/status/default: extendedaway.png renamed to extended_away.png + * In pixmaps/status/default: na.png renamed to unavailable.png + * gtk_imhtml_toggle_bold(): No longer returns a value + * gtk_imhtml_toggle_italic(): No longer returns a value + * gtk_imhtml_toggle_underline(): No longer returns a value + * gtk_imhtml_toggle_strike(): No longer returns a value + * gtk_imhtml_scroll_to_end(): Added the smooth paramter + * gaim_log_new(), added conv parameter + * gaim_buddy_icon_new(), leaves a reference which the caller owns. Use + gaim_buddy_icon_unref() immediately if you don't want a reference (the + old behavior). + * GAIM_CONV_UNKNOWN to GAIM_CONV_TYPE_UNKNOWN. + * GAIM_CONV_IM to GAIM_CONV_TYPE_IM. + * GAIM_CONV_CHAT to GAIM_CONV_TYPE_CHAT. + * GAIM_CONV_MISC to GAIM_CONV_TYPE_MISC. + * GAIM_CONV_ANY to GAIM_CONV_TYPE_ANY. + * GaimConversationUiOps.write_conv, Replaced const char *who with + const char *name, const char *alias + * gaim_conv_chat_add_users(), added extra_msgs and new_arrivals (pass NULL + and FALSE respectively, to get the same behavior as before) + * chat_add_users in GaimConversationUiOps, added cbuddies and + new_arrivals and removed buddies. + * chat_rename_user in GaimConversationUiOps, added new_alias + * gaim_conv_chat_cb_new(), added alias. (pass NULL to get the same + behavior as before). + * GaimConversation.log became GList * GaimConversation.logs, so that a + conversation can have multiple logs at once + * gaim_conv_chat_add_user, added extra_msgs + * gaim_notify_userinfo, removed primary and secondary parameters + * GaimNotifyUiOps.notify_userinfo: removed title, primary, and + secondary parameters + * Idle timers are now added and removed in gtkidle.c in response + to the signed-on and signed-off signals + * GaimXfer->ops.read, GaimXfer->ops.write, gaim_xfer_set_read_fnc(), + gaim_xfer_set_write_fnc(), gaim_xfer_read(), gaim_xfer_write(): + Changed ssize_t to gssize + * serv_got_im, serv_got_chat_in, serv_send_im and serv_chat_send all use + GaimMessageFlags instead of GaimConvImFlags / GaimConvChatFlags + * All core<->prpl message passing now uses html. This was previously true + for receiving messages, it's now also true for sending them. prpls that + don't support html need to gaim_unescape_html() the message. + * Notify API: GCallback -> GaimNotifyCloseCallback, + void *user_data -> gpointer user_data + * gaim_notify_searchresults_get_rows_count, + gaim_notify_searchresults_get_columns_count: return type now guint + * gaim_account_notify_added: No longer checks if there is a + GaimBuddy for the added user, that's left up to the prpls. See the + documentation for this function and gaim_account_request_add. + * gaim_accounts_reorder: new_index is now a gint instead of a size_t + * displaying-message signals: displaying-[im|chat]-msg and + displayed-[im|chat]-msg signals are emitted for all messages + (ie, for received messages, sent messages, system messages, error + messages etc.), and the signals now have + gaim_gtk_conversations_get_handle() for their handle. + * GAIM_NOTIFY_BUTTON_ADD_BUDDY to GAIM_NOTIFY_BUTTON_ADD + * conversation-switched: This signal has been moved from conversation to + the UI and the signal-handlers only receive the + conversation that has been switched to. + * GaimPluginProtocolInfo: Added offline_message + * GaimPluginProtocolInfo: Added whiteboard_prpl_ops + * GaimPluginProtocolInfo: Added media_prpl_ops + * GaimPluginProtocolInfo: Added "str" argument to tooltip_text, changed + the return type to void + * GaimPluginProtocolInfo: Added "full" argument to tooltip_text + * gaim_pounce_new(): Added option argument for pounce options + * gaim_network_listen() and gaim_network_listen_range(): Added + socket_type parameter to allow creation of UDP listening. Modified + to be asynchronous with a Callback to allow for UPnP operation. + * GaimPrefCallback: val is now a gconstpointer instead of a gpointer + * gtk_imhtml_get_current_format(): the arguments are now set to TRUE or + FALSE. Previously they were set to TRUE or left alone. Also, you + may now pass NULL if you're not interested in a specific formatting. + * Smiley Themes: Backslashes must be backslash-escaped. + * Plugins: Depedencies are now honored when unloading plugins. + * gaim_markup_extract_info_field(): Added format_cb parameter. + * gaim_str_to_time(): Added support for parsing the MM/DD/YYYY format. + * gaim_plugin_action_new(): label is now const char * + * gaim_plugin_pref_new_with_name(): name is now const char * + * gaim_plugin_pref_new_with_label(): label is now const char * + * gaim_plugin_pref_new_with_name_and_label(): name and label are + now const char * + * gaim_plugin_pref_set_name(): name is now const char * + * gaim_plugin_pref_get_name(): return type is now const char * + * gaim_plugin_pref_set_label(): label is now const char * + * gaim_plugin_pref_get_label(): return type is now const char * + * gaim_plugin_pref_add_choice(): label is now const char * + * struct proto_chat_entry: label is now const char * + * struct proto_chat_entry: identifier is now const char * + * All network activity has been updated to use non-blocking sockets. + This means that plugins must be updated to expect such a socket from + gaim_proxy_connect() and gaim_network_listen*(). + * gaim_proxy_connect(): changed to return NULL on error and a pointer + to a GaimProxyConnectInfo object which can be used to cancel + connection attempts using gaim_proxy_connect_cancel(). + * gaim_gtk_create_imhtml(): Added sw_ret() parameter + * gaim_account_get_log(): Added create parameter + * GAIM_CMD_P_VERYHIGH is now GAIM_CMD_P_VERY_HIGH + + Removed: + * gaim_gtk_sound_{get,set}_mute() (replaced by the /gaim/gtk/sound/mute + preference) + * gaim_escape_html(const char *html) (use g_markup_escape_text(html, -1) + instead) + * gaim_accounts_sync, account changes are now scheduled to be saved + automatically + * gaim_connection_connect + * gaim_connection_disconnect + * gaim_connection_register + * gaim_accounts_auto_login + * gaim_find_conversation, use gaim_find_conversation_with_account instead + * serv_login + * serv_close + * serv_finish_login + * gaim_chat_get_display_name + * gaim_conversation_set_history, gaim_conversation_get_history, and + GaimConversation->history. Use gtk_imhtml_get_markup instead. + * serv_rename_group + * set_gaim_user_dir to gaim_util_set_user_dir + * create_prpl_icon to gaim_gtk_create_prpl_icon + * Window flashing support in the core: gaim_conv_window_flash, and flash UI + operation for conversations. Use signal "received-im-msg" or similar. + * All warning stuff from the core. + * gaim_gtkconv_get_dest_tab_at_xy(), instead use gaim_gtkconv_get_tab_at_xy() + * chat_add_user from GaimConversationUiOps: only chat_add_users is used + * chat_remove_user from GaimConversationUiOps: only chat_remove_users is used + * uc from the GaimBuddy struct + * gaim_sound_get_handle() + * gaim_debug_vargs() + * serv_add_buddy(); use gaim_account_add_buddy() instead + * serv_add_buddies(); use gaim_account_add_buddies() instead + * serv_remove_buddy(); use gaim_account_remove_buddy() instead + * serv_remove_buddies(); use gaim_account_remove_buddies() instead + * serv_change_passwd(); use gaim_account_change_password() instead + * serv_touch_idle(): use gaim_gtk_check_idle() instead + * GaimGtkImPane->a_virgin + * gaim_str_strip_cr(); use gaim_str_strip_char(str, '\r') instead + * gaim_find_buddys_group renamed to gaim_buddy_get_group + * gaim_gtkpounce_menu_build() + * gaim_gtkpounce_dialog_show() + * GaimGtkBuddyList->bpmenu + * GaimConvImFlags and GaimConvChatFlags; use GaimMessageFlags instead + * cb and user_data from the ops in GaimNotifyUiOps: This is now handled + by the notify API in the core. + * GaimConversationUiOps.updated: use the conversation-updated signal + * GAIM_SUBTYPE_CONV_WINDOW: windows are now only represented in the UI, + so GAIM_TYPE_BOXED is used for the signal types + * gaim_gtk_privacy_is_showable(): We do fallback privacy in the core + now, so this would always be TRUE now. + * GaimBlistNodeAction: See GaimMenuAction + * gaim_blist_node_action_new(); use gaim_menu_action_new() instead + * gaim_date() + * gaim_date_full(): See gaim_date_format_full() + * gaim_strftime(): See gaim_utf8_strftime() + * GAIM_MESSAGE_COLORIZE + * user_data from gaim_notify_searchresults_new_rows and from + notify_searchresults in GaimNotifyUiOps. + * gaim_conversation_get_send_history(), and send_history from + GaimConversation + * Removed ui_ops from GaimBuddyList. Use gaim_blist_get_ui_ops() instead + + Added: + * gaim_prefs_disconnect_by_handle() + * a password field to GaimConnection, which only persists for the + session (when "remember password" is false, account->password is + NEVER set) Use gaim_connection_get_password(GaimConnection *gc) + * gaim_log_common_writer, gaim_log_common_lister, gaim_log_common_sizer, + and gaim_log_get_log_dir to allow log formats that use standard Gaim + log directory to use Gaim's built-in code for these purposes. + * GaimLogCommonLoggerData struct for a basic logger_data struct to be + used with "common" logger functions. + * gaim_gtk_blist_node_is_contact_expanded, returns TRUE if the given + blist node is a buddy inside an expanded contact, or is itself an + expanded contact + * GaimLogSet struct, get_log_sets function to GaimLogLogger, + gaim_log_get_log_sets, gaim_log_set_compare + * gaim_privacy_check(), to check if a given user is allowed to send + messages to the specified account + * gtk_imhtml_clear_formatting() + * gtk_imhtml_delete to clear out part of a imhtml buffer + * gtk_imhtml_get_protocol_name() + * gaim_buddy_icons_get_full_path(), to get the full path of a buddy + icon setting + * CHAT_USERS_ALIAS_COLUMN, CHAT_USERS_COLOR_COLUMN, + CHAT_USERS_BUDDY_COLUMN to the list of columns for the chat + user list + * gaim_account_add_buddy() + * gaim_account_add_buddies() + * gaim_account_remove_buddy() + * gaim_account_remove_buddies() + * gaim_account_change_password() + * gaim_account_supports_offline_message() + * gaim_conversation_close_logs(), to force a conversation's log(s) to + be closed. New logs will be opened as necessary. + * gaim_plugin_get_id() + * gaim_plugin_get_name() + * gaim_plugin_get_version() + * gaim_plugin_get_summary() + * gaim_plugin_get_description() + * gaim_plugin_get_author() + * gaim_plugin_get_homepage() + * gaim_gtkconv_switch_active_conversation(GaimConversation *) + * gaim_str_strip_char() to strip a given character from + a given string + * gaim_util_chrreplace() to replace a given character with a + different character + * gaim_gtk_blist_toggle_visibility() to intelligently toggle the + visiblity of the buddy list + * gaim_gtk_blist_visibility_manager_add() to indicate the addition of a + visibility manager - see the docs for more information + * gaim_gtk_blist_visibility_manager_remove() to indicate the removal of + a visibility manager - see the docs for more information + * gaim_gtk_conversations_find_unseen_list() to get a list of conversations + with an "unseen" state >= to the specified state and other criteria + * gaim_gtk_conversations_fill_menu() fill a menu from list of conversations + * gaim_gtk_create_prpl_icon() + * gaim_gtk_create_prpl_icon_with_status() + * gaim_gtk_pounces_manager_show() + * gaim_gtk_pounces_manager_hide() + * gaim_gtk_pounce_editor_show() + * GAIM_POUNCE_MESSAGE_RECEIVED + * GaimPounceOption + * gaim_pounce_set_options() + * gaim_pounce_set_options() + * GAIM_STOCK_CONNECT, GAIM_STOCK_DISCONNECT + * GAIM_STOCK_PLUGIN + * gaim_account_request_add: Notifies the user that they were added to + someone's buddy list, and offers them the choice + of adding that person to their buddy list. + * gaim_blist_alias_contact() + * gaim_cipher_http_digest_calculate_session_key() + * gaim_cipher_http_digest_calculate_response() + * gaim_notify_searchresults_labeled() + * GAIM_NOTIFY_BUTTON_LABELED, GAIM_NOTIFY_BUTTON_INFO, + GAIM_NOTIFY_BUTTON_IM, GAIM_NOTIFY_BUTTON_JOIN, + GAIM_NOTIFY_BUTTON_INVITE + * stock buttons GAIM_STOCK_IM, GAIM_STOCK_INFO + * gaim_conversation_present() + * GaimConversationUiOps->present(GaimConversation *) + * GaimPlugin.unloadable + * gaim_plugin_is_unloadable() + * GAIM_PLUGIN_PREF_STRING_FORMAT + * gaim_plugin_pref_get_format_type() + * gaim_plugin_pref_set_format_type() + * GaimStringFormatType + * gaim_log_get_handle() + * gaim_log_uninit() + * GAIM_SUBTYPE_LOG + * gaim_marshal_POINTER__POINTER_POINTER + * gaim_utf8_ncr_encode() + * gaim_gtk_log_init() + * gaim_gtk_log_get_handle() + * gaim_gtk_log_uninit() + * gaim_url_fetch_request() + * GaimMenuAction + * gaim_menu_action_new() + * gaim_menu_action_free() + * GaimInfoFieldFormatCallback + * gaim_utf8_strftime() + * gaim_date_format_short() + * gaim_date_format_long() + * gaim_date_format_full() + * gaim_time_format() + * gaim_plugin_action_free() + * GaimRequestType: Added GAIM_REQUEST_FOLDER + * GaimRequestUiOps: Added request_folder + * gaim_request_folder() + * gaim_gtk_setup_screenname_autocomplete() + * gaim_gtk_set_cursor() + * gaim_gtk_clear_cursor() + * GAIM_MESSAGE_ACTIVE_ONLY + * gaim_proxy_get_setup() + * GaimNotifySearchResultsCallback: Added user_data. + * gaim_notify_searchresults: Added user_data. + + Signals - Changed: (See the Doxygen docs for details on all signals.) + * Signal propagation now stops after a handler returns a non-NULL value. + This value is now returned. Previously, all registered handlers were + called and the value from the last handler was used. + * "buddy-typing" and "buddy-typing-stopped": replaced the GaimConversation* + with GaimAccount*, const char *name. Also, the signal is now emitted + regardless of whether a conversation exists and regardless of whether + the user is on the buddy list. + * "chat-buddy-joined": added the new_arrival argument + * "chat-invited" handlers can now return a value to control what happens + to the invite (accept, reject, prompt the user). + * "chat-left": Emitted *after* setting chat->left to TRUE. + * "drawing-tooltip": the second argument is now a GString* instead of + a char** + * "drawing-tooltip": added the "full" argument + * "received-im-msg" and "received-chat-msg" to match, both now pass a + conversation pointer and flags + * "receiving-im-msg" and "receving-chat-msg" to match, both now pass a + conversation pointer and a pointer to the flags. + * "writing-im-msg", "wrote-im-msg", "writing-chat-msg", "wrote-chat-msg": + Now emitted from a difference place in the message handling code. + The arguments also changed. + * "displaying-im-msg", "displayed-im-msg", "displaying-chat-msg", + "displayed-chat-msg": Added "who" argument, which changes the order + of the existing arguments. + + Signals - Added: (See the Doxygen docs for details on all signals.) + * "account-disabled" + * "account-status-changed" + * "account-alias-changed" + * "cipher-added" + * "cipher-removed" + * "conversation-dragging" + * "dbus-method-called" + * "dbus-introspect" + * "file-recv-accept" + * "file-recv-start" + * "file-recv-cancel" + * "file-recv-complete" + * "file-recv-request" + * "file-send-accept" + * "file-send-start" + * "file-send-cancel" + * "file-send-complete" + * "buddy-added" + * "buddy-removed" + * "blist-node-aliased" + * "buddy-status-changed" + * "buddy-idle-changed": A buddy's idle status changed. + * "buddy-icon-changed" + * "displaying-userinfo" + * "gtkblist-hiding" + * "gtkblist-unhiding" + * "log-displaying" + * "savedstatus-changed" + + Signals - Removed: + * "account-away": replaced by account-status-changed + * "account-warned" + * "buddy-away": replaced by buddy-status-changed + * "buddy-back": replaced by buddy-status-changed + * "buddy-idle": replaced by buddy-idle-changed + * "buddy-unidle": replaced by buddy-idle-changed + * "buddy-icon-cached": replaced by buddy-icon-changed + * "conversation-drag-end": replaced by conversation-dragging + * "conversation-switching" + +version 1.5.0 (8/11/2005): + * Added: gaim_xfer_conversation_write + Writes a messages to a conversation window with the use + of the associated file transfer. + +version 1.4.0 (7/7/2005): + * Added: gaim_buddy_icon_uncache() + Deletes a cached buddy icon for a specified buddy + * Added: gaim_buddy_icon_get_type + Attempts to determine the type of a given buddy icon. + * Added: buddy-icon-cached signal + Emitted when a new buddy icon is cached. + +version 1.3.1 (6/9/2005): + * No changes + +version 1.3.0 (5/10/2005): + * Added: gaim_blist_schedule_save() + This should be used instead of gaim_blist_sync when you + want the blist.xml file to be written to disk. There + should not be many occasions when you want to do this, + as the functions in the blist API that modify the buddy + list will normally call it for you. + * Added: OPT_PROTO_NO_NORMALIZE_CONV + Tells the conversation API to not normalize screen names + in conversations. This is used by the Jabber PRPL. + +version 1.2.1 (4/3/2005): + * No changes + +version 1.2.0 (3/17/2005): + * You can use gaim_signal_connect_priority() and + gaim_signal_connect_priority_vargs() to connect to + Gaim signals with a given priority (Will Gorman) + * Added: gaim_conversation_set_features + gaim_conversation_get_features + These allow plugins (notable prpls) to change the + formatting capabilities of an existing conversation. + This comes with a new "features" field in + GaimConversation (Christopher O'Brien) + * Added: GAIM_CONNECTION_NO_IMAGES to GaimConectionFlags + (Christopher O'Brien) + * Added: GAIM_CBFLAGS_TYPING to GaimConvChatBuddyFlags + (Christopher O'Brien) + * Added: gaim_account_request_add which takes the same arguments as + * gaim_account_notify_added but always asks the user if they want to add + * the buddy to the buddy list + * Added: An accompanying request_add GaimAccountUiOp + +version 1.1.4 (2/24/2005): + * No changes + +version 1.1.3 (2/17/2005): + * No changes + +version 1.1.2 (1/20/2005): + * No changes + +version 1.1.1 (12/28/2004): + * No changes + +version 1.1.0 (12/02/2004): + * Added: gaim_utf8_salvage + * Added: binary relocation support in prefix.h + WARNING: If your plugin uses anything inside the + #ifdef ENABLE_BINRELOC from prefix.h, it won't be + loadable on a copy of Gaim compiled without binreloc + support. In particular, watch out for the autoconf-like + macros, and accidently including them through internal.h, + which you probably shouldn't be including anyway. + +version 1.0.0 (09/17/2004): + * Added: get_chat_name to the GaimPluginProtocolInfo struct + * Changed: gaim_blist_update_buddy_presence(), presence changed to + type gboolean + * Changed: the versioning scheme, and all the plugin structs + +version 0.82 (08/26/2004): + Gaim API: + * Removed: gaim_gtk_get_dispstyle(), gaim_gtk_change_text() + * Removed: multi.h + * Renamed: ui.h to gtkdialogs.h + * Renamed: gtkinternal.h to gtkgaim.h + * Renamed: show_info_dialog to gaim_gtkdialogs_info + * Renamed: show_log_dialog to gaim_gtkdialogs_log + * Renamed: show_warn_dialog to gaim_gtkdialogs_warn + * Renamed: show_im_dialog to gaim_gtkdialogs_im + * Renamed: gaim_gtkdialogs_new_im to gaim_gtkdialogs_im_with_user + * Renamed: destroy_all_dialogs to gaim_gtkdialogs_destroy_all + * Renamed: alias_dialog_bud to gaim_gtkdialogs_alias_buddy + * Renamed: alias_dialog_contact to gaim_gtkdialogs_alias_contact + * Renamed: alias_dialog_blist_chat to gaim_gtkdialogs_alias_chat + * Renamed: show_confirm_del to gaim_gtkdialogs_remove_buddy + * Renamed: show_confirm_del_group to gaim_gtkdialogs_remove_group + * Renamed: show_confirm_del_blist_chat to gaim_gtkdialogs_remove_chat + * Renamed: show_confirm_del_contact to gaim_gtkdialogs_remove_contact + * Renamed: show_about to gaim_gtkdialogs_about + * Added: gaim_notify_userinfo() and the associated notify_userinfo() UI op + (someone who knows just why we have this can edit here) + + Buddy List API: + * Changed: gaim_blist_request_add_chat(), added name parameter + * Added: gaim_contact_on_account() + * Added: flags parameter to the GaimBlistNode struct + + Conversation API: + * Added: gaim_gtkconv_button_new() + + Protocol Plugin API: v7 + * Added: chat_info_defaults to the GaimPluginProtocolInfo struct + + Signals: + * Added: conversation-updated for any update to the data associated + with the conversation (topic, icon, adding to buddy list, etc.) + + Conversation API: + * Changed: gaim_conv_chat_add_user() (added new_arrival parameter) + +version 0.81 (08/05/2004): + Commands API: + * Most functions now have a void *data argument. + + Blist API: + * Added: gaim_buddy_get_contact_alias + * Renamed: gaim_get_buddy_alias to gaim_buddy_get_alias + * Renamed: gaim_get_buddy_alias_only to gaim_buddy_get_alias_only + + Conversation API: + * Changed: gaim_conv_chat_add_user(), added flags parameter + * Changed: gaim_conv_chat_add_users(), added GList of flags parameter + * Changed: gaim_conv_chat_get_users(), now returns a GList of + GaimConvChatBuddy's + * Changed: gaim_conv_chat_set_users() now expects a GList of + GaimConvChatBuddy's + * Added: gaim_conv_chat_set_user_flags() + * Added: gaim_conv_chat_get_user_flags() + * Added: gaim_conv_chat_find_user() + * Added: gaim_conv_chat_cb_new() + * Added: gaim_conv_chat_cb_find() + * Added: gaim_conv_chat_cb_destroy() + * Added: gaim_conv_chat_cb_get_name() + + Conversation UI ops: + * Added: chat_update_user() + + Signals: + * Changed: chat-buddy-joining & chat-buddy-joined now include the user's flags + * Changed: chat-buddy-joining & chat-buddy-leaving are now booleans, return + TRUE if you don't want the join/leave to be displayed in the UI. + * Added: chat-buddy-flags for when user's flags change + gaim_marshal_VOID__POINTER_POINTER_POINTER_UINT_UINT (required for the new + chat-buddy-flags signal) + * Added: account-modified for when account settings have been changed. + +version 0.80 (07/15/2004): + Gaim API: + * Removed: PRPL numbers : gaim_account_set_protocol(), + gaim_account_get_protocol(), gaim_accounts_find_with_prpl_num, + gaim_prpl_num_to_id(), gaim_prpl_id_to_num(), GaimProtocol + + Protocol Plugin API: v6 + * Added: can_receive_file & send_file to the GaimPluginProtocolInfo struct + + Signals: + * Changed "chat-invited" to also include the components hash table so + plugins can use serv_join_chat when the signal is emitted. + * Added "chat-topic-changed" signal plugins know when a topic is changed. + +version 0.79 (06/24/2004): + Gaim API: + * gaim_url_parse() now takes two additional parameters, which are used + for returning the username and password from the URL, if they exist. + * Added: has_focus UI op to GaimConversationUiOps and + GaimConvWindowUiOps. + * Added: gaim_conversation_has_focus() and gaim_conv_window_has_focus(). + * Removed: gaim_blist_save() + + Protocol Plugin API: v5 + * Changed: add_buddy, add_buddies, remove_buddy, remove_buddies, + rename_group and remove_group to take GaimBuddy's and + GaimGroup's consistently. + * Removed: OPT_PROTO_BUDDY_ICON (replaced by icon_spec) + * Added: icon_spec to the GaimPluginProtocolInfo struct + +version 0.78 (05/30/2004): + Plugin API: v4 + * Added: actions - for plugins to add to the new Plugin Actions menu + + Loader Plugin API: v2 (no changes) + + Protocol Plugin API: v4 + * Removed: set_dir, get_dir and dir_search (not used, AIM-centric) + * Removed: actions (replaced by generic plugin actions) + + Perl Plugin API: v2 (no changes) + TCL Plugin API: (no changes) + + Signals: + * Added: "blist-node-extended-menu" for extending Buddy, Chat and + Group right-click menus + * Added: "drawing-tooltip" for plugins to allow plugins to change text + appearing in tooltips + * Added: "gtkblist-created" + * Added: "receiving-im-msg" and "receiving-chat-msg" (these behave + exactly like received-*-msg used to) + * Added: "buddy-idle-updated" signal, for when the idle time changes. + * Changed: "received-im-msg" and "received-chat-msg" no longer pass + pointers to who, message and flags, and are now void. + * Removed: "drawing-menu" - it was UI sepecific and + "blist-node-extended-menu" is superior + +version 0.77 (04/22/2004): + Loader & Protocol Plugins independantly versioned + Plugin loading now checks versioning on plugins (Standard, Loader & + Protocol) + new GAIM_{PLUGIN,PRPL,LOADER}_API_VERSION constants + + Plugin API: v3 + * Added: prefs_info for UI independant plugin prefs + + Loader Plugin API: v2 + * Added: api_version at top of GaimPluginLoaderInfo struct + + Protocol Plugin API: v2 + * Added: api_version at top of GaimPluginProtocolInfo struct + * Added: chat_menu for protocol specific extensions to the chat menu + * Removed: get_away "Nada used it. Pink elephants on parade." + * Removed: protocol_prefs (replaced by generic plugin prefs_info) + + Perl Plugin API: v2 (no changes) + TCL API: (no changes) + + Signals: + * Added: "conversation-drag-ended" + +version 0.76 (04/01/2004): + Plugin API: v2 + Perl Plugin API: v2 + Loader Plugin API: (not versioned) + Protocol Plugin API: (not versioned) + * Added: protocol_prefs for protocol specific preferences + * Added: reject_chat so protocols can act on chat invite rejection + + TCL Plugin API: (not versioned) + * Changes to plugin registration to show descriptions + Property changes on: trunk/doc/ChangeLog.API ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Copied: trunk/doc/HOWTO (from rev 16838, trunk/plugins/HOWTO) =================================================================== --- trunk/doc/HOWTO (rev 0) +++ trunk/doc/HOWTO 2006-08-19 01:35:50 UTC (rev 16861) @@ -0,0 +1,83 @@ +Everything in this file should be considered old and potentially out of +date. For more reliable information, install doxygen and graphiz dot, +then run +make docs +in the gaim source tree. This will produce html docs in gaim/docs/html +that will provide an api reference and in the related pages section, +information on perl and c plugins. + + +Ok, this howto is going to be really short and sweet and to the point. + +First off, before you do anything else, in all of the files for your plugin, +put the lines + +#define GAIM_PLUGINS +#include "gaim.h" + +I mean this. Without this, all kinds of things will not work correctly. If you +really want to know exactly what this does, read ../src/gaim.h and learn. But +if you don't want to do that, just know that it's important. + +Now that you've put that there, make sure gaim.h is in your include path. + +Ok, now you're ready to write the plugin. + +The only function that is required is gaim_plugin_init(GModule *). This gets +called as soon as it gets loaded (sort of - man dlopen for more details). If +your function never returns, it will crash gaim! If your plugin uses up all +the memory in the system, it will crash gaim! Once your plugin gets loaded, +it effectively becomes a part of gaim, and anything that goes wrong will look +like it is a problem with gaim itself. I write bugfree code! :) Therefore, it +is your problem, not mine. (I'm usually nice and willing to help you with your +problems though.) + +The GModule* that gets passed to gaim_plugin_init is the handle for the plugin. +DO NOT CHANGE THIS POINTER! Bad things will happen. You've been warned. It's +needed for connecting to signals and things. It's a good idea to remember it +somehow. + +gaim_plugin_init should return a char*. If the char* returned is not NULL, it +is interpreted as an error, and used as an error message. See the ChangeLog +file in this directory for more details. + +You can basically do anything you want in the plugin. You can make function +calls, change public widgets, display new widgets, things like that. But the +really neat thing is you can do things at events. For example, when one of +your buddies signs on, you can instantly send them a message. You can modify +the incoming and outgoing text. You can do all kinds of crazy things. Whatever +you want. Check out SIGNALS for more information. + +Plugins can share globals with gaim, but will not share with other plugins. +This is so if you have a global variable GtkWidget *window in your plugin and +J. Random Hacker also has the same name on a global variable, you won't be +constantly overwriting each others' variables. Unfortunately, this also means +that plugins will have difficulty working together. But then again, that's +what shared memory is for. + +Plugins can be configured. This makes it so they don't have to be recompiled +in order to change things internal to them, and it's also just a cool feature +to have :). It's optional; to allow your plugin to be configured, add a +function called gaim_plugin_config(). The advised course of action is to have +it pop up a dialog window; but it's your plugin. + +When your plugin gets unloaded, gaim will try to call gaim_plugin_remove(). It +doesn't have to be there, but it's nice if, say, you create a window, and when +the plugin gets unloaded, it removes the window. Also, all the callbacks you +have attached to gaim signals will be removed. + +Plugins can also unload themselves. To do this, call gaim_plugin_unload(GModule *) +(the GModule* is the handle passed to gaim_plugin_init). When your plugin gets +unloaded, gaim will remove all of your callbacks. It will not call your +gaim_plugin_remove function, however, since it will assume you have already +done the necessary cleanup. + +Compilation of the plugins is fairly straight-forward; there is a Makefile in +this directory that has a rule for making the .so file from a .c file. No +modification of the Makefile should be necessary, unless if you simply want +to type 'make' to have it made; otherwise, 'make filename.so' will take +filename.c and make the .so plugin from it. If you need to link in with extra +libraries, you can set the environment variable PLUGIN_LIBS to be the libraries +you want to link with. + +There are a few examples in this directory. Enjoy. Property changes on: trunk/doc/HOWTO ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Modified: trunk/gaim.pc.in =================================================================== --- trunk/gaim.pc.in 2006-08-19 01:34:52 UTC (rev 16860) +++ trunk/gaim.pc.in 2006-08-19 01:35:50 UTC (rev 16861) @@ -10,4 +10,4 @@ Version: @VERSION@ Requires: glib-2.0 Cflags: -I${includedir}/gaim - +Libs: -L${libdir} -lgaim This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ev...@us...> - 2006-08-19 01:34:59
|
Revision: 16860 Author: evands Date: 2006-08-18 18:34:52 -0700 (Fri, 18 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16860&view=rev Log Message: ----------- Restored [16854] by aaronsheldon: Generates the image for the about dialog on demand instead of making it a stock image which remains in memory forever. Also, restored svn:ignore properties Modified Paths: -------------- trunk/gtk/gtkdialogs.c trunk/gtk/gtkstock.h Added Paths: ----------- trunk/gtk/gtkstock.c Property Changed: ---------------- trunk/gtk/ trunk/gtk/plugins/ trunk/gtk/plugins/docklet/ Property changes on: trunk/gtk ___________________________________________________________________ Name: svn:ignore + Makefile.in .deps Makefile Modified: trunk/gtk/gtkdialogs.c =================================================================== --- trunk/gtk/gtkdialogs.c 2006-08-19 01:31:21 UTC (rev 16859) +++ trunk/gtk/gtkdialogs.c 2006-08-19 01:34:52 UTC (rev 16860) @@ -37,7 +37,7 @@ #include "gtkimhtmltoolbar.h" #include "gtklog.h" #include "gtkutils.h" -#include "gaimstock.h" +#include "gtkstock.h" static GList *dialogwindows = NULL; @@ -223,6 +223,44 @@ about = NULL; } +/* This function puts the version number onto the pixmap we use in the 'about' + * screen in Gaim. */ +static void +gaim_gtk_logo_versionize(GdkPixbuf **original, GtkWidget *widget) { + GdkPixmap *pixmap; + GtkStyle *style; + PangoContext *context; + PangoLayout *layout; + gchar *markup; + gint width, height; + gint lwidth = 0, lheight = 0; + + style = gtk_widget_get_style(widget); + + gdk_pixbuf_render_pixmap_and_mask(*original, &pixmap, NULL, 255); + width = gdk_pixbuf_get_width(*original); + height = gdk_pixbuf_get_height(*original); + g_object_unref(G_OBJECT(*original)); + + context = gtk_widget_get_pango_context(widget); + layout = pango_layout_new(context); + + markup = g_strdup_printf("<span foreground=\"#FFFFFF\" size=\"larger\">%s</span>", VERSION); + pango_layout_set_font_description(layout, style->font_desc); + pango_layout_set_markup(layout, markup, strlen(markup)); + g_free(markup); + + pango_layout_get_pixel_size(layout, &lwidth, &lheight); + gdk_draw_layout(GDK_DRAWABLE(pixmap), style->bg_gc[GTK_STATE_NORMAL], + width - (lwidth + 3), height - (lheight + 1), layout); + g_object_unref(G_OBJECT(layout)); + + *original = gdk_pixbuf_get_from_drawable(NULL, pixmap, NULL, + 0, 0, 0, 0, + width, height); + g_object_unref(G_OBJECT(pixmap)); +} + void gaim_gtkdialogs_about() { GtkWidget *hbox; @@ -236,6 +274,8 @@ GString *str; int i; AtkObject *obj; + char* filename; + GdkPixbuf *pixbuf; if (about != NULL) { gtk_window_present(GTK_WINDOW(about)); @@ -256,7 +296,17 @@ vbox = gtk_vbox_new(FALSE, GAIM_HIG_BORDER); gtk_container_add(GTK_CONTAINER(hbox), vbox); - logo = gtk_image_new_from_stock(GAIM_STOCK_LOGO, gtk_icon_size_from_name(GAIM_ICON_SIZE_LOGO)); + /* Generate a logo with a version number */ + logo = gtk_window_new(GTK_WINDOW_TOPLEVEL); + gtk_widget_realize(logo); + filename = g_build_filename(DATADIR, "pixmaps", "gaim", "logo.png", NULL); + pixbuf = gdk_pixbuf_new_from_file(filename, NULL); + g_free(filename); + gaim_gtk_logo_versionize(&pixbuf, logo); + gtk_widget_destroy(logo); + logo = gtk_image_new_from_pixbuf(pixbuf); + gdk_pixbuf_unref(pixbuf); + /* Insert the logo */ obj = gtk_widget_get_accessible(logo); atk_object_set_description(obj, "Gaim " VERSION); gtk_box_pack_start(GTK_BOX(vbox), logo, FALSE, FALSE, 0); Added: trunk/gtk/gtkstock.c =================================================================== --- trunk/gtk/gtkstock.c (rev 0) +++ trunk/gtk/gtkstock.c 2006-08-19 01:34:52 UTC (rev 16860) @@ -0,0 +1,245 @@ +/** + * @file gtkstock.c GTK+ Stock resources + * @ingroup gtkui + * + * gaim + * + * Gaim is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * source distribution. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ +#include "internal.h" +#include "gtkgaim.h" + +#include "gtkstock.h" + +static struct StockIcon +{ + const char *name; + const char *dir; + const char *filename; + +} const stock_icons[] = +{ + { GAIM_STOCK_ABOUT, "buttons", "about_menu.png" }, + { GAIM_STOCK_ACCOUNTS, "buttons", "accounts.png" }, + { GAIM_STOCK_ACTION, NULL, GTK_STOCK_EXECUTE }, +#if GTK_CHECK_VERSION(2,6,0) + { GAIM_STOCK_ALIAS, NULL, GTK_STOCK_EDIT }, +#else + { GAIM_STOCK_ALIAS, "buttons", "edit.png" }, +#endif + { GAIM_STOCK_BGCOLOR, "buttons", "change-bgcolor-small.png" }, + { GAIM_STOCK_BLOCK, NULL, GTK_STOCK_STOP }, + { GAIM_STOCK_CHAT, NULL, GTK_STOCK_JUMP_TO }, + { GAIM_STOCK_CLEAR, NULL, GTK_STOCK_CLEAR }, + { GAIM_STOCK_CLOSE_TABS, NULL, GTK_STOCK_CLOSE }, +#if GTK_CHECK_VERSION(2,6,0) + { GAIM_STOCK_CONNECT, NULL, GTK_STOCK_CONNECT }, +#else + { GAIM_STOCK_CONNECT, "icons", "stock_connect_16.png" }, +#endif + { GAIM_STOCK_DEBUG, NULL, GTK_STOCK_PROPERTIES }, + { GAIM_STOCK_DOWNLOAD, NULL, GTK_STOCK_GO_DOWN }, + { GAIM_STOCK_DIALOG_AUTH, "dialogs", "gaim_auth.png" }, + { GAIM_STOCK_DIALOG_COOL, "dialogs", "gaim_cool.png" }, + { GAIM_STOCK_DIALOG_ERROR, "dialogs", "gaim_error.png" }, + { GAIM_STOCK_DIALOG_INFO, "dialogs", "gaim_info.png" }, + { GAIM_STOCK_DIALOG_QUESTION, "dialogs", "gaim_question.png" }, + { GAIM_STOCK_DIALOG_WARNING, "dialogs", "gaim_warning.png" }, +#if GTK_CHECK_VERSION(2,6,0) + { GAIM_STOCK_DISCONNECT, NULL, GTK_STOCK_DISCONNECT }, +#else + { GAIM_STOCK_DISCONNECT, "icons", "stock_disconnect_16.png" }, +#endif + { GAIM_STOCK_FGCOLOR, "buttons", "change-fgcolor-small.png" }, +#if GTK_CHECK_VERSION(2,6,0) + { GAIM_STOCK_EDIT, NULL, GTK_STOCK_EDIT }, +#else + { GAIM_STOCK_EDIT, "buttons", "edit.png" }, +#endif + { GAIM_STOCK_FILE_CANCELED, NULL, GTK_STOCK_CANCEL }, + { GAIM_STOCK_FILE_DONE, NULL, GTK_STOCK_APPLY }, + { GAIM_STOCK_FILE_TRANSFER, NULL, GTK_STOCK_REVERT_TO_SAVED }, + { GAIM_STOCK_ICON_AWAY, "icons", "away.png" }, + { GAIM_STOCK_ICON_AWAY_MSG, "icons", "msgpend.png" }, + { GAIM_STOCK_ICON_CONNECT, "icons", "connect.png" }, + { GAIM_STOCK_ICON_OFFLINE, "icons", "offline.png" }, + { GAIM_STOCK_ICON_ONLINE, "icons", "online.png" }, + { GAIM_STOCK_ICON_ONLINE_MSG, "icons", "msgunread.png" }, + { GAIM_STOCK_IGNORE, NULL, GTK_STOCK_DIALOG_ERROR }, + { GAIM_STOCK_IM, "buttons", "send-im.png" }, + { GAIM_STOCK_IMAGE, "buttons", "insert-image-small.png" }, +#if GTK_CHECK_VERSION(2,8,0) + { GAIM_STOCK_INFO, NULL, GTK_STOCK_INFO }, +#else + { GAIM_STOCK_INFO, "buttons", "info.png" }, +#endif + { GAIM_STOCK_INVITE, NULL, GTK_STOCK_JUMP_TO }, + { GAIM_STOCK_LINK, "buttons", "insert-link-small.png" }, + { GAIM_STOCK_LOG, NULL, GTK_STOCK_DND_MULTIPLE }, + { GAIM_STOCK_MODIFY, NULL, GTK_STOCK_PREFERENCES }, +#if GTK_CHECK_VERSION(2,6,0) + { GAIM_STOCK_PAUSE, NULL, GTK_STOCK_MEDIA_PAUSE }, +#else + { GAIM_STOCK_PAUSE, "buttons", "pause.png" }, +#endif + { GAIM_STOCK_PENDING, "buttons", "send-im.png" }, +#if GTK_CHECK_VERSION(2,6,0) + { GAIM_STOCK_PLUGIN, NULL, GTK_STOCK_DISCONNECT }, +#else + { GAIM_STOCK_PLUGIN, "icons", "stock_disconnect_16.png" }, +#endif + { GAIM_STOCK_POUNCE, NULL, GTK_STOCK_REDO }, + { GAIM_STOCK_OPEN_MAIL, NULL, GTK_STOCK_JUMP_TO }, + { GAIM_STOCK_SEND, "buttons", "send-im.png" }, + { GAIM_STOCK_SIGN_ON, NULL, GTK_STOCK_EXECUTE }, + { GAIM_STOCK_SIGN_OFF, NULL, GTK_STOCK_CLOSE }, + { GAIM_STOCK_SMILEY, "buttons", "insert-smiley-small.png" }, + { GAIM_STOCK_TEXT_BIGGER, "buttons", "text_bigger.png" }, + { GAIM_STOCK_TEXT_NORMAL, "buttons", "text_normal.png" }, + { GAIM_STOCK_TEXT_SMALLER, "buttons", "text_smaller.png" }, + { GAIM_STOCK_TYPED, "gaim", "typed.png" }, + { GAIM_STOCK_TYPING, "gaim", "typing.png" }, + { GAIM_STOCK_VOICE_CHAT, "gaim", "phone.png" }, + { GAIM_STOCK_STATUS_ONLINE, "gaim", "status-online.png" }, + { GAIM_STOCK_STATUS_OFFLINE, "gaim", "status-offline.png" }, + { GAIM_STOCK_STATUS_AWAY, "gaim", "status-away.png" }, + { GAIM_STOCK_STATUS_INVISIBLE,"gaim", "status-invisible.png" }, + { GAIM_STOCK_STATUS_TYPING0, "gaim", "status-typing0.png" }, + { GAIM_STOCK_STATUS_TYPING1, "gaim", "status-typing1.png" }, + { GAIM_STOCK_STATUS_TYPING2, "gaim", "status-typing2.png" }, + { GAIM_STOCK_STATUS_TYPING3, "gaim", "status-typing3.png" }, + { GAIM_STOCK_STATUS_CONNECT0, "gaim", "status-connect0.png" }, + { GAIM_STOCK_STATUS_CONNECT1, "gaim", "status-connect1.png" }, + { GAIM_STOCK_STATUS_CONNECT2, "gaim", "status-connect2.png" }, + { GAIM_STOCK_STATUS_CONNECT3, "gaim", "status-connect3.png" }, + { GAIM_STOCK_UPLOAD, NULL, GTK_STOCK_GO_UP } +}; + +static const GtkStockItem stock_items[] = +{ + { GAIM_STOCK_ALIAS, N_("_Alias"), 0, 0, NULL }, + { GAIM_STOCK_CHAT, N_("_Join"), 0, 0, NULL }, + { GAIM_STOCK_CLOSE_TABS, N_("Close _tabs"), 0, 0, NULL }, + { GAIM_STOCK_IM, N_("I_M"), 0, 0, NULL }, + { GAIM_STOCK_INFO, N_("_Get Info"), 0, 0, NULL }, + { GAIM_STOCK_INVITE, N_("_Invite"), 0, 0, NULL }, + { GAIM_STOCK_MODIFY, N_("_Modify"), 0, 0, NULL }, + { GAIM_STOCK_OPEN_MAIL, N_("_Open Mail"), 0, 0, NULL }, + { GAIM_STOCK_PAUSE, N_("_Pause"), 0, 0, NULL }, +}; + +static gchar * +find_file(const char *dir, const char *base) +{ + char *filename; + + if (base == NULL) + return NULL; + + if (!strcmp(dir, "gaim")) + filename = g_build_filename(DATADIR, "pixmaps", "gaim", base, NULL); + else + { + filename = g_build_filename(DATADIR, "pixmaps", "gaim", dir, + base, NULL); + } + + if (!g_file_test(filename, G_FILE_TEST_EXISTS)) + { + g_critical("Unable to load stock pixmap %s\n", base); + + g_free(filename); + + return NULL; + } + + return filename; +} + +void +gaim_gtk_stock_init(void) +{ + static gboolean stock_initted = FALSE; + GtkIconFactory *icon_factory; + size_t i; + GtkWidget *win; + + if (stock_initted) + return; + + stock_initted = TRUE; + + /* Setup the icon factory. */ + icon_factory = gtk_icon_factory_new(); + + gtk_icon_factory_add_default(icon_factory); + + /* Er, yeah, a hack, but it works. :) */ + win = gtk_window_new(GTK_WINDOW_TOPLEVEL); + gtk_widget_realize(win); + + for (i = 0; i < G_N_ELEMENTS(stock_icons); i++) + { + GdkPixbuf *pixbuf; + GtkIconSet *iconset; + gchar *filename; + + if (stock_icons[i].dir == NULL) + { + /* GTK+ Stock icon */ + iconset = gtk_style_lookup_icon_set(gtk_widget_get_style(win), + stock_icons[i].filename); + } + else + { + filename = find_file(stock_icons[i].dir, stock_icons[i].filename); + + if (filename == NULL) + continue; + + pixbuf = gdk_pixbuf_new_from_file(filename, NULL); + + g_free(filename); + + iconset = gtk_icon_set_new_from_pixbuf(pixbuf); + + g_object_unref(G_OBJECT(pixbuf)); + } + + gtk_icon_factory_add(icon_factory, stock_icons[i].name, iconset); + + gtk_icon_set_unref(iconset); + } + + gtk_widget_destroy(win); + + /* register custom icon sizes */ + gtk_icon_size_register(GAIM_ICON_SIZE_LOGO, 330, 90); + gtk_icon_size_register(GAIM_ICON_SIZE_DIALOG_COOL, 40, 60); + gtk_icon_size_register(GAIM_ICON_SIZE_STATUS, 30, 30); + gtk_icon_size_register(GAIM_ICON_SIZE_STATUS_TWO_LINE, 30, 30); + gtk_icon_size_register(GAIM_ICON_SIZE_STATUS_SMALL, 16, 16); + gtk_icon_size_register(GAIM_ICON_SIZE_STATUS_SMALL_TWO_LINE, 24, 24); + + g_object_unref(G_OBJECT(icon_factory)); + + /* Register the stock items. */ + gtk_stock_add_static(stock_items, G_N_ELEMENTS(stock_items)); +} Property changes on: trunk/gtk/gtkstock.c ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Modified: trunk/gtk/gtkstock.h =================================================================== --- trunk/gtk/gtkstock.h 2006-08-19 01:31:21 UTC (rev 16859) +++ trunk/gtk/gtkstock.h 2006-08-19 01:34:52 UTC (rev 16860) @@ -67,7 +67,6 @@ #define GAIM_STOCK_INVITE "gaim-invite" #define GAIM_STOCK_LINK "gaim-link" #define GAIM_STOCK_LOG "gaim-log" -#define GAIM_STOCK_LOGO "gaim-logo" #define GAIM_STOCK_MODIFY "gaim-modify" #define GAIM_STOCK_OPEN_MAIL "gaim-stock-open-mail" #define GAIM_STOCK_PAUSE "gaim-pause" Property changes on: trunk/gtk/plugins ___________________________________________________________________ Name: svn:ignore + Makefile.in .deps Makefile Property changes on: trunk/gtk/plugins/docklet ___________________________________________________________________ Name: svn:ignore - .deps .libs Makefile Makefile.in *.dll *.la *.lo + .deps .libs Makefile Makefile.in *.dll *.la *.lo *.loT This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ev...@us...> - 2006-08-19 01:31:30
|
Revision: 16859 Author: evands Date: 2006-08-18 18:31:21 -0700 (Fri, 18 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16859&view=rev Log Message: ----------- ** Part 5 of a 4 part commit ** Restructured the tree and the build files for the core/UI split. libgaim is now built as a library against which gtkgaim and gntgaim link and can be built separately from them by configuring with them disable d (--disable-gtkgaim and --disable-gntgaim). Each of the three source trees (gtk, console, and core) has its own plugins folder. This works nicely on my system; hopefully it won't cause too much chaos for others. If you have local changes, an easy way to merge them to the new layout should be along the lines of svn diff -r version_before_move > myChanges.diff patch -p1 < myChanges.diff where svn diff is done from the gaim checkout root but patch is done from gtk or core (or both). This changeset combines work by Sadrul Chowdhury, Gary Kramlich (grim), and me. Known issues: * On my system, at least, something's not quite right with the gtkgaim build process; it imports gtkgaim.h (as can be seen by adding a #warning) but <gtk/gtk.h> doesn't seem to be used. The GTK_STOCK_XXX defines claim to be undeclared. I was going to make this work before committing, but I strongly suspect someone with more autotools experience will be able to fix it easily whereas I've already glared at it for an hour. * The gnt console UI depends on libgnt, which is not yet automatically built. Either autogen.sh && make && make install libgnt (in console/libgnt) or configure with --disable-gnt for now. * The Windows build process has not been touched yet so still needs updating. * There's an stray "rm: core: is a directory" warning after autogen.sh is compl te. I'm not sure where that's coming from. Modified Paths: -------------- trunk/plugins/Makefile.am Removed Paths: ------------- trunk/pixmaps/ trunk/plugins/ChangeLog trunk/plugins/ChangeLog.API trunk/plugins/HOWTO trunk/plugins/ciphertest.c trunk/plugins/codeinline.c trunk/plugins/contact_priority.c trunk/plugins/crazychat/ trunk/plugins/dbus-buddyicons-example.py trunk/plugins/dbus-example.c trunk/plugins/docklet/ trunk/plugins/extplacement.c trunk/plugins/filectl.c trunk/plugins/fortuneprofile.pl trunk/plugins/gaim.pl trunk/plugins/gaiminc.c trunk/plugins/gaimrc.c trunk/plugins/gestures/ trunk/plugins/gevolution/ trunk/plugins/gtk-signals-test.c trunk/plugins/history.c trunk/plugins/iconaway.c trunk/plugins/idle.c trunk/plugins/ipc-test-client.c trunk/plugins/ipc-test-server.c trunk/plugins/log_reader.c trunk/plugins/mailchk.c trunk/plugins/mono/ trunk/plugins/musicmessaging/ trunk/plugins/notify.c trunk/plugins/perl/ trunk/plugins/pluginpref_example.c trunk/plugins/psychic.c trunk/plugins/raw.c trunk/plugins/relnot.c trunk/plugins/signals-test.c trunk/plugins/simple.c trunk/plugins/spellchk.c trunk/plugins/ssl/ trunk/plugins/statenotify.c trunk/plugins/tcl/ trunk/plugins/test.pl trunk/plugins/ticker/ trunk/plugins/timestamp.c trunk/plugins/timestamp_format.c trunk/plugins/win32/ Deleted: trunk/plugins/ChangeLog =================================================================== --- trunk/plugins/ChangeLog 2006-08-19 01:29:53 UTC (rev 16858) +++ trunk/plugins/ChangeLog 2006-08-19 01:31:21 UTC (rev 16859) @@ -1,161 +0,0 @@ -version 0.11.0pre5: - The build process for plugins has changed slightly. Everything still - works more or less the same from a user point of view, that is, 'make - file.so' will still turn file.c into a plugin. The build now uses - libtool in an attempt to increase portability. By using libtool the - act of compiling and linking has been divided into two steps (to be - precise it always was two but we only called gcc once; now we call - libtool twice). PLUGIN_CFLAGS has also been added. Any -D switches you - were passing in PLUGIN_LIBS should be passed in PLUGIN_CFLAGS now. - -version 0.11.0pre1: - Gaim is now multi-connection based. This represents a significant - change. Most of the code was modified, though most of the modifications - were small (referencing an int as part of a struct as opposed to as a - global int). Plugins need to be modified to match the new function - declarations and such. - - Gaim now uses GModule from the GLib library for plugins. This brings - a few changes. gaim_plugin_init is now passed a GModule *, which it - should use for all of its callbacks. gaim_plugin_init now returns - char * instead of int instead of void. If gaim_plugin_init returns - NULL then gaim assumes everything was OK and proceeds. Otherwise, it - displays the error message and unloads your plugin. There is no more - gaim_plugin_error (at least, that gaim itself will use. You may wish - to simply return gaim_plugin_error() in gaim_plugin_init). - - Because gaim now uses GModule, plugins are opened with RTLD_GLOBAL. I - had previously wanted to avoid this, but there are simply too many - benefits gained from using GModule to reject it for this reason. This - means that plugins can now call each other's functions. Beware, this - has good and bad implications. If you call a function, it will look - first in your plugin, and then in gaim's global symbol table, including - other plugins. - - The new system allows for protocol plugins. New protocols (including - Yahoo, MSN, IRC, ICQ, etc) can be loaded dynamically. However, most - of these plugins are going to be controlled by the gaim maintainers. - If you have interest in writing a protocol plugin, please talk to one - of us before you start. - - That's about all that I'm going to talk about. My SN is EWarmenhoven - if you have any questions (like what the hell struct gaim_connection is - and what its relation to struct aim_user is). - -version 0.10.0: - Rather than have a separate CFLAGS and LDFLAGS for the plugins than - for gaim, and doing all kinds of crazy things to work around the - problems that creates, the plugins now have the same CFLAGS and LIBS. - The plugins also have PLUGIN_LIBS which can be passed at make time. - This makes things like #ifdef USE_APPLET and #ifdef USE_PERL much more - reliable. (#include "config.h" in order to get all the #defines) - - The internals of gaim plugin events got modified slightly. It should - have no effect on existing plugins or the way plugins are made. The - change was to make my life easier adding perl. It should also make - adding new plugin events even easier than before (though I doubt that - any more will ever be added). Also, events are printed to the debug - window. - - event_buddy_away was being triggered every blist_update for every away - buddy. This got fixed, but now when you sign on, event_buddy_away may - be called before event_buddy_signon. Not that it should matter much. - - Just after I finish saying that no more events will be added, I go and - add one. Go figure. Anyway, it's event_new_conversation. Enough people - asked me to add it, and I found it useful enough, that I finally did - add it. It gets passed a char *, the name of the person who the - conversation is with. This gets triggered when a new conversation - window is created, in case you couldn't figure it out on your own. - - event_blist_update wasn't being called if you weren't reporting idle - time or if you were idle. This got fixed. - -version 0.9.20: - It's 3 am the night before finals, it's obviously a good time to hack - gaim. - - This became quite long, and if you don't want to read it all, here's - the important stuff summed up: - - 9 new events (see SIGNALS file for more details) - - int gaim_plugin_init(void *) (no longer returns void, see error.c) - - void gaim_plugin_unload(void *) (to allow plugin to remove itself) - - can only load 1 instance of the same plugin - - PLUGIN_LIBS for extra libraries for plugin - - The first thing to note is that there are about 9 new events plugins - can attach to, most of them dealing with chat, since I know that was a - big thing that was missing. Please note that I was nice and decided to - tack these extra events onto the end of the enum, which means that - plugins do not have to be recompiled in order for them to still work. - - The big change is that gaim_plugin_init no longer returns void, but - int. If it returns 0+, gaim interprets this as there being no error, - and continues with loading as normal. (This should be backwards- - compatible: returning 0/1 is the equivalent of returning void.) If it - returns a number less than 0, there was an error loading detected by - the plugin. At that point, gaim will try to clean things up by removing - any callbacks that have been added by the plugin. It will then try to - call the plugin's gaim_plugin_error function, if there is one. The - function should take an int (the int returned by gaim_plugin_init) and - return a char*. If the char* is not NULL, it is displayed by gaim as an - error message. The plugin is then unloaded and closed and life goes - back to normal. If any of that was confusing, it was confusing to me, - too. I added a plugin, error.c, which should help clear things up. - - Another big thing to note is that plugins can unload themselves. A good - example of why this is useful is a ticker plugin. If the user closes - the ticker window, they obviously want the plugin to be unloaded. Gaim - has no way of knowing that; therefore, the plugin must tell gaim that - it is to be unloaded. To have a plugin unload itself, simply call - gaim_plugin_unload(void *) (the void* is the handle passed to - gaim_plugin_init). Because you are explicitly asking to be removed, - gaim assumes that you have done any cleanup already, and so does not - call gaim_plugin_remove. Rather, it simply removes your callbacks and - unloads the plugin. (There is some trickery to this. Think about it: - your plugin calls the function, your plugin is unloaded, and execution - returns to your plugin, which no longer exists. This would cause a - segfault if it behaved exactly as described. Instead, the plugin is - removed from the list of plugins, and removed 5 seconds later. By then - the plugin should be effectively gone, though still in memory.) - - In previous versions of gaim, you could load multiple copies of the - same plugin. This is no longer the case. The reason for this was that - there were not two instances of the plugin in memory; rather, one copy - and two structures representing the same plugin. Then, the callbacks - would be called twice (since the plugin would most likely act the same - across multiple instances), and when one was unloaded, all callbacks - for both instances would be removed. Rather than deal with two copies - of the same plugin, it is easier and cleaner to only handle one. - - Sometimes it's necessary to link a plugin with libraries other than the - ones needed for GTK. Before, it was necessary to modify the Makefile to - do so (which was usually messy since it's generated by GNU automake). - Now, you can simply set the environment variable PLUGIN_LIBS to be the - extra libraries you want to link in. For example, to link plugin.c with - the math library, you can run the command - PLUGIN_LIBS=-lm make plugin.so - To link with multiple plugins, make sure to indicate spaces, e.g. - PLUGIN_LIBS='-lm -lcrypt' make encrypt.so - - There is a new event, event_quit, which signifies that gaim has exited - correctly (i.e. didn't segfault). Also, after this event is called, all - plugins are removed, and their gaim_plugin_remove function is called. - This behavior is different from previous versions; however, it is the - proper way of doing things, and should have no effect on current - plugins. The reason event_quit exists despite plugins being removed at - quit is because a plugin can be removed without gaim quitting. They are - distinctly separate events. - - The new events mean that some versions of gaim have certain events, - others don't. The thing I find fascinating though is that even if a - plugin is compiled for a later version, it will still be backwards- - compatible, even if it makes use of the newer events. The reason why - is the names of the events are stored as integers, and those integers - will never match an event in a prior version. This means you don't - have to worry about which version the person is using, only which - version the person is compiling against. For simplicity's sake, please - assume people are compiling against the latest version. For - practicality's sake, VERSION is #define'd to be the version you're - compiling against, starting with 0.9.20. Prior versions do not have - this defined in the standard plugin Makefile. Deleted: trunk/plugins/ChangeLog.API =================================================================== --- trunk/plugins/ChangeLog.API 2006-08-19 01:29:53 UTC (rev 16858) +++ trunk/plugins/ChangeLog.API 2006-08-19 01:31:21 UTC (rev 16859) @@ -1,612 +0,0 @@ -Gaim: The Pimpin' Penguin IM Client that's good for the soul! - -version 2.0.0: - Changed: - * All the status stuff. Yay! - * gaim_prefs_connect_callback(), added handle parameter - * gtk_imhtml_toolbar now descends from GtkHBox making it easier to add your - own widgets to it - * gaim_find_conversation_with_account, added a "type" parameter - * gaim_gtk_prefs_labeled_spin_button, the "key" parameter is now a - const char* instead of just a char* - * gaim_gtk_prefs_labeled_entry, the "key" parameter is now a const char* - instead of just a char* - * the add_buddy perl sub. The sub now takes the account as the first - argument, and buddy and group as the second and third. It also adds - the buddy to the server-side buddy list of the given account. - * gaim_connection_new, gaim_account_connect and gaim_account_register no - longer return a GaimConnection - * keep_alive in GaimConnection is renamed to keepalive - * gaim_mkstemp, added a second argument, a boolean, of whether or not the - file is binary - * gaim_log_logger_new, rewritten - * gaim_conv_window_remove_conversation()'s last argument to be a - GaimConversation. - * A new blocked icon: pixmaps/status/default/blocked.png - * In pixmaps/status/default: extendedaway.png renamed to extended_away.png - * In pixmaps/status/default: na.png renamed to unavailable.png - * gtk_imhtml_toggle_bold(): No longer returns a value - * gtk_imhtml_toggle_italic(): No longer returns a value - * gtk_imhtml_toggle_underline(): No longer returns a value - * gtk_imhtml_toggle_strike(): No longer returns a value - * gtk_imhtml_scroll_to_end(): Added the smooth paramter - * gaim_log_new(), added conv parameter - * gaim_buddy_icon_new(), leaves a reference which the caller owns. Use - gaim_buddy_icon_unref() immediately if you don't want a reference (the - old behavior). - * GAIM_CONV_UNKNOWN to GAIM_CONV_TYPE_UNKNOWN. - * GAIM_CONV_IM to GAIM_CONV_TYPE_IM. - * GAIM_CONV_CHAT to GAIM_CONV_TYPE_CHAT. - * GAIM_CONV_MISC to GAIM_CONV_TYPE_MISC. - * GAIM_CONV_ANY to GAIM_CONV_TYPE_ANY. - * GaimConversationUiOps.write_conv, Replaced const char *who with - const char *name, const char *alias - * gaim_conv_chat_add_users(), added extra_msgs and new_arrivals (pass NULL - and FALSE respectively, to get the same behavior as before) - * chat_add_users in GaimConversationUiOps, added cbuddies and - new_arrivals and removed buddies. - * chat_rename_user in GaimConversationUiOps, added new_alias - * gaim_conv_chat_cb_new(), added alias. (pass NULL to get the same - behavior as before). - * GaimConversation.log became GList * GaimConversation.logs, so that a - conversation can have multiple logs at once - * gaim_conv_chat_add_user, added extra_msgs - * gaim_notify_userinfo, removed primary and secondary parameters - * GaimNotifyUiOps.notify_userinfo: removed title, primary, and - secondary parameters - * Idle timers are now added and removed in gtkidle.c in response - to the signed-on and signed-off signals - * GaimXfer->ops.read, GaimXfer->ops.write, gaim_xfer_set_read_fnc(), - gaim_xfer_set_write_fnc(), gaim_xfer_read(), gaim_xfer_write(): - Changed ssize_t to gssize - * serv_got_im, serv_got_chat_in, serv_send_im and serv_chat_send all use - GaimMessageFlags instead of GaimConvImFlags / GaimConvChatFlags - * All core<->prpl message passing now uses html. This was previously true - for receiving messages, it's now also true for sending them. prpls that - don't support html need to gaim_unescape_html() the message. - * Notify API: GCallback -> GaimNotifyCloseCallback, - void *user_data -> gpointer user_data - * gaim_notify_searchresults_get_rows_count, - gaim_notify_searchresults_get_columns_count: return type now guint - * gaim_account_notify_added: No longer checks if there is a - GaimBuddy for the added user, that's left up to the prpls. See the - documentation for this function and gaim_account_request_add. - * gaim_accounts_reorder: new_index is now a gint instead of a size_t - * displaying-message signals: displaying-[im|chat]-msg and - displayed-[im|chat]-msg signals are emitted for all messages - (ie, for received messages, sent messages, system messages, error - messages etc.), and the signals now have - gaim_gtk_conversations_get_handle() for their handle. - * GAIM_NOTIFY_BUTTON_ADD_BUDDY to GAIM_NOTIFY_BUTTON_ADD - * conversation-switched: This signal has been moved from conversation to - the UI and the signal-handlers only receive the - conversation that has been switched to. - * GaimPluginProtocolInfo: Added offline_message - * GaimPluginProtocolInfo: Added whiteboard_prpl_ops - * GaimPluginProtocolInfo: Added media_prpl_ops - * GaimPluginProtocolInfo: Added "str" argument to tooltip_text, changed - the return type to void - * GaimPluginProtocolInfo: Added "full" argument to tooltip_text - * gaim_pounce_new(): Added option argument for pounce options - * gaim_network_listen() and gaim_network_listen_range(): Added - socket_type parameter to allow creation of UDP listening. Modified - to be asynchronous with a Callback to allow for UPnP operation. - * GaimPrefCallback: val is now a gconstpointer instead of a gpointer - * gtk_imhtml_get_current_format(): the arguments are now set to TRUE or - FALSE. Previously they were set to TRUE or left alone. Also, you - may now pass NULL if you're not interested in a specific formatting. - * Smiley Themes: Backslashes must be backslash-escaped. - * Plugins: Depedencies are now honored when unloading plugins. - * gaim_markup_extract_info_field(): Added format_cb parameter. - * gaim_str_to_time(): Added support for parsing the MM/DD/YYYY format. - * gaim_plugin_action_new(): label is now const char * - * gaim_plugin_pref_new_with_name(): name is now const char * - * gaim_plugin_pref_new_with_label(): label is now const char * - * gaim_plugin_pref_new_with_name_and_label(): name and label are - now const char * - * gaim_plugin_pref_set_name(): name is now const char * - * gaim_plugin_pref_get_name(): return type is now const char * - * gaim_plugin_pref_set_label(): label is now const char * - * gaim_plugin_pref_get_label(): return type is now const char * - * gaim_plugin_pref_add_choice(): label is now const char * - * struct proto_chat_entry: label is now const char * - * struct proto_chat_entry: identifier is now const char * - * All network activity has been updated to use non-blocking sockets. - This means that plugins must be updated to expect such a socket from - gaim_proxy_connect() and gaim_network_listen*(). - * gaim_proxy_connect(): changed to return NULL on error and a pointer - to a GaimProxyConnectInfo object which can be used to cancel - connection attempts using gaim_proxy_connect_cancel(). - * gaim_gtk_create_imhtml(): Added sw_ret() parameter - * gaim_account_get_log(): Added create parameter - * GAIM_CMD_P_VERYHIGH is now GAIM_CMD_P_VERY_HIGH - - Removed: - * gaim_gtk_sound_{get,set}_mute() (replaced by the /gaim/gtk/sound/mute - preference) - * gaim_escape_html(const char *html) (use g_markup_escape_text(html, -1) - instead) - * gaim_accounts_sync, account changes are now scheduled to be saved - automatically - * gaim_connection_connect - * gaim_connection_disconnect - * gaim_connection_register - * gaim_accounts_auto_login - * gaim_find_conversation, use gaim_find_conversation_with_account instead - * serv_login - * serv_close - * serv_finish_login - * gaim_chat_get_display_name - * gaim_conversation_set_history, gaim_conversation_get_history, and - GaimConversation->history. Use gtk_imhtml_get_markup instead. - * serv_rename_group - * set_gaim_user_dir to gaim_util_set_user_dir - * create_prpl_icon to gaim_gtk_create_prpl_icon - * Window flashing support in the core: gaim_conv_window_flash, and flash UI - operation for conversations. Use signal "received-im-msg" or similar. - * All warning stuff from the core. - * gaim_gtkconv_get_dest_tab_at_xy(), instead use gaim_gtkconv_get_tab_at_xy() - * chat_add_user from GaimConversationUiOps: only chat_add_users is used - * chat_remove_user from GaimConversationUiOps: only chat_remove_users is used - * uc from the GaimBuddy struct - * gaim_sound_get_handle() - * gaim_debug_vargs() - * serv_add_buddy(); use gaim_account_add_buddy() instead - * serv_add_buddies(); use gaim_account_add_buddies() instead - * serv_remove_buddy(); use gaim_account_remove_buddy() instead - * serv_remove_buddies(); use gaim_account_remove_buddies() instead - * serv_change_passwd(); use gaim_account_change_password() instead - * serv_touch_idle(): use gaim_gtk_check_idle() instead - * GaimGtkImPane->a_virgin - * gaim_str_strip_cr(); use gaim_str_strip_char(str, '\r') instead - * gaim_find_buddys_group renamed to gaim_buddy_get_group - * gaim_gtkpounce_menu_build() - * gaim_gtkpounce_dialog_show() - * GaimGtkBuddyList->bpmenu - * GaimConvImFlags and GaimConvChatFlags; use GaimMessageFlags instead - * cb and user_data from the ops in GaimNotifyUiOps: This is now handled - by the notify API in the core. - * GaimConversationUiOps.updated: use the conversation-updated signal - * GAIM_SUBTYPE_CONV_WINDOW: windows are now only represented in the UI, - so GAIM_TYPE_BOXED is used for the signal types - * gaim_gtk_privacy_is_showable(): We do fallback privacy in the core - now, so this would always be TRUE now. - * GaimBlistNodeAction: See GaimMenuAction - * gaim_blist_node_action_new(); use gaim_menu_action_new() instead - * gaim_date() - * gaim_date_full(): See gaim_date_format_full() - * gaim_strftime(): See gaim_utf8_strftime() - * GAIM_MESSAGE_COLORIZE - * user_data from gaim_notify_searchresults_new_rows and from - notify_searchresults in GaimNotifyUiOps. - * gaim_conversation_get_send_history(), and send_history from - GaimConversation - * Removed ui_ops from GaimBuddyList. Use gaim_blist_get_ui_ops() instead - - Added: - * gaim_prefs_disconnect_by_handle() - * a password field to GaimConnection, which only persists for the - session (when "remember password" is false, account->password is - NEVER set) Use gaim_connection_get_password(GaimConnection *gc) - * gaim_log_common_writer, gaim_log_common_lister, gaim_log_common_sizer, - and gaim_log_get_log_dir to allow log formats that use standard Gaim - log directory to use Gaim's built-in code for these purposes. - * GaimLogCommonLoggerData struct for a basic logger_data struct to be - used with "common" logger functions. - * gaim_gtk_blist_node_is_contact_expanded, returns TRUE if the given - blist node is a buddy inside an expanded contact, or is itself an - expanded contact - * GaimLogSet struct, get_log_sets function to GaimLogLogger, - gaim_log_get_log_sets, gaim_log_set_compare - * gaim_privacy_check(), to check if a given user is allowed to send - messages to the specified account - * gtk_imhtml_clear_formatting() - * gtk_imhtml_delete to clear out part of a imhtml buffer - * gtk_imhtml_get_protocol_name() - * gaim_buddy_icons_get_full_path(), to get the full path of a buddy - icon setting - * CHAT_USERS_ALIAS_COLUMN, CHAT_USERS_COLOR_COLUMN, - CHAT_USERS_BUDDY_COLUMN to the list of columns for the chat - user list - * gaim_account_add_buddy() - * gaim_account_add_buddies() - * gaim_account_remove_buddy() - * gaim_account_remove_buddies() - * gaim_account_change_password() - * gaim_account_supports_offline_message() - * gaim_conversation_close_logs(), to force a conversation's log(s) to - be closed. New logs will be opened as necessary. - * gaim_plugin_get_id() - * gaim_plugin_get_name() - * gaim_plugin_get_version() - * gaim_plugin_get_summary() - * gaim_plugin_get_description() - * gaim_plugin_get_author() - * gaim_plugin_get_homepage() - * gaim_gtkconv_switch_active_conversation(GaimConversation *) - * gaim_str_strip_char() to strip a given character from - a given string - * gaim_util_chrreplace() to replace a given character with a - different character - * gaim_gtk_blist_toggle_visibility() to intelligently toggle the - visiblity of the buddy list - * gaim_gtk_blist_visibility_manager_add() to indicate the addition of a - visibility manager - see the docs for more information - * gaim_gtk_blist_visibility_manager_remove() to indicate the removal of - a visibility manager - see the docs for more information - * gaim_gtk_conversations_find_unseen_list() to get a list of conversations - with an "unseen" state >= to the specified state and other criteria - * gaim_gtk_conversations_fill_menu() fill a menu from list of conversations - * gaim_gtk_create_prpl_icon() - * gaim_gtk_create_prpl_icon_with_status() - * gaim_gtk_pounces_manager_show() - * gaim_gtk_pounces_manager_hide() - * gaim_gtk_pounce_editor_show() - * GAIM_POUNCE_MESSAGE_RECEIVED - * GaimPounceOption - * gaim_pounce_set_options() - * gaim_pounce_set_options() - * GAIM_STOCK_CONNECT, GAIM_STOCK_DISCONNECT - * GAIM_STOCK_PLUGIN - * gaim_account_request_add: Notifies the user that they were added to - someone's buddy list, and offers them the choice - of adding that person to their buddy list. - * gaim_blist_alias_contact() - * gaim_cipher_http_digest_calculate_session_key() - * gaim_cipher_http_digest_calculate_response() - * gaim_notify_searchresults_labeled() - * GAIM_NOTIFY_BUTTON_LABELED, GAIM_NOTIFY_BUTTON_INFO, - GAIM_NOTIFY_BUTTON_IM, GAIM_NOTIFY_BUTTON_JOIN, - GAIM_NOTIFY_BUTTON_INVITE - * stock buttons GAIM_STOCK_IM, GAIM_STOCK_INFO - * gaim_conversation_present() - * GaimConversationUiOps->present(GaimConversation *) - * GaimPlugin.unloadable - * gaim_plugin_is_unloadable() - * GAIM_PLUGIN_PREF_STRING_FORMAT - * gaim_plugin_pref_get_format_type() - * gaim_plugin_pref_set_format_type() - * GaimStringFormatType - * gaim_log_get_handle() - * gaim_log_uninit() - * GAIM_SUBTYPE_LOG - * gaim_marshal_POINTER__POINTER_POINTER - * gaim_utf8_ncr_encode() - * gaim_gtk_log_init() - * gaim_gtk_log_get_handle() - * gaim_gtk_log_uninit() - * gaim_url_fetch_request() - * GaimMenuAction - * gaim_menu_action_new() - * gaim_menu_action_free() - * GaimInfoFieldFormatCallback - * gaim_utf8_strftime() - * gaim_date_format_short() - * gaim_date_format_long() - * gaim_date_format_full() - * gaim_time_format() - * gaim_plugin_action_free() - * GaimRequestType: Added GAIM_REQUEST_FOLDER - * GaimRequestUiOps: Added request_folder - * gaim_request_folder() - * gaim_gtk_setup_screenname_autocomplete() - * gaim_gtk_set_cursor() - * gaim_gtk_clear_cursor() - * GAIM_MESSAGE_ACTIVE_ONLY - * gaim_proxy_get_setup() - * GaimNotifySearchResultsCallback: Added user_data. - * gaim_notify_searchresults: Added user_data. - - Signals - Changed: (See the Doxygen docs for details on all signals.) - * Signal propagation now stops after a handler returns a non-NULL value. - This value is now returned. Previously, all registered handlers were - called and the value from the last handler was used. - * "buddy-typing" and "buddy-typing-stopped": replaced the GaimConversation* - with GaimAccount*, const char *name. Also, the signal is now emitted - regardless of whether a conversation exists and regardless of whether - the user is on the buddy list. - * "chat-buddy-joined": added the new_arrival argument - * "chat-invited" handlers can now return a value to control what happens - to the invite (accept, reject, prompt the user). - * "chat-left": Emitted *after* setting chat->left to TRUE. - * "drawing-tooltip": the second argument is now a GString* instead of - a char** - * "drawing-tooltip": added the "full" argument - * "received-im-msg" and "received-chat-msg" to match, both now pass a - conversation pointer and flags - * "receiving-im-msg" and "receving-chat-msg" to match, both now pass a - conversation pointer and a pointer to the flags. - * "writing-im-msg", "wrote-im-msg", "writing-chat-msg", "wrote-chat-msg": - Now emitted from a difference place in the message handling code. - The arguments also changed. - * "displaying-im-msg", "displayed-im-msg", "displaying-chat-msg", - "displayed-chat-msg": Added "who" argument, which changes the order - of the existing arguments. - - Signals - Added: (See the Doxygen docs for details on all signals.) - * "account-disabled" - * "account-status-changed" - * "account-alias-changed" - * "cipher-added" - * "cipher-removed" - * "conversation-dragging" - * "dbus-method-called" - * "dbus-introspect" - * "file-recv-accept" - * "file-recv-start" - * "file-recv-cancel" - * "file-recv-complete" - * "file-recv-request" - * "file-send-accept" - * "file-send-start" - * "file-send-cancel" - * "file-send-complete" - * "buddy-added" - * "buddy-removed" - * "blist-node-aliased" - * "buddy-status-changed" - * "buddy-idle-changed": A buddy's idle status changed. - * "buddy-icon-changed" - * "displaying-userinfo" - * "gtkblist-hiding" - * "gtkblist-unhiding" - * "log-displaying" - * "savedstatus-changed" - - Signals - Removed: - * "account-away": replaced by account-status-changed - * "account-warned" - * "buddy-away": replaced by buddy-status-changed - * "buddy-back": replaced by buddy-status-changed - * "buddy-idle": replaced by buddy-idle-changed - * "buddy-unidle": replaced by buddy-idle-changed - * "buddy-icon-cached": replaced by buddy-icon-changed - * "conversation-drag-end": replaced by conversation-dragging - * "conversation-switching" - -version 1.5.0 (8/11/2005): - * Added: gaim_xfer_conversation_write - Writes a messages to a conversation window with the use - of the associated file transfer. - -version 1.4.0 (7/7/2005): - * Added: gaim_buddy_icon_uncache() - Deletes a cached buddy icon for a specified buddy - * Added: gaim_buddy_icon_get_type - Attempts to determine the type of a given buddy icon. - * Added: buddy-icon-cached signal - Emitted when a new buddy icon is cached. - -version 1.3.1 (6/9/2005): - * No changes - -version 1.3.0 (5/10/2005): - * Added: gaim_blist_schedule_save() - This should be used instead of gaim_blist_sync when you - want the blist.xml file to be written to disk. There - should not be many occasions when you want to do this, - as the functions in the blist API that modify the buddy - list will normally call it for you. - * Added: OPT_PROTO_NO_NORMALIZE_CONV - Tells the conversation API to not normalize screen names - in conversations. This is used by the Jabber PRPL. - -version 1.2.1 (4/3/2005): - * No changes - -version 1.2.0 (3/17/2005): - * You can use gaim_signal_connect_priority() and - gaim_signal_connect_priority_vargs() to connect to - Gaim signals with a given priority (Will Gorman) - * Added: gaim_conversation_set_features - gaim_conversation_get_features - These allow plugins (notable prpls) to change the - formatting capabilities of an existing conversation. - This comes with a new "features" field in - GaimConversation (Christopher O'Brien) - * Added: GAIM_CONNECTION_NO_IMAGES to GaimConectionFlags - (Christopher O'Brien) - * Added: GAIM_CBFLAGS_TYPING to GaimConvChatBuddyFlags - (Christopher O'Brien) - * Added: gaim_account_request_add which takes the same arguments as - * gaim_account_notify_added but always asks the user if they want to add - * the buddy to the buddy list - * Added: An accompanying request_add GaimAccountUiOp - -version 1.1.4 (2/24/2005): - * No changes - -version 1.1.3 (2/17/2005): - * No changes - -version 1.1.2 (1/20/2005): - * No changes - -version 1.1.1 (12/28/2004): - * No changes - -version 1.1.0 (12/02/2004): - * Added: gaim_utf8_salvage - * Added: binary relocation support in prefix.h - WARNING: If your plugin uses anything inside the - #ifdef ENABLE_BINRELOC from prefix.h, it won't be - loadable on a copy of Gaim compiled without binreloc - support. In particular, watch out for the autoconf-like - macros, and accidently including them through internal.h, - which you probably shouldn't be including anyway. - -version 1.0.0 (09/17/2004): - * Added: get_chat_name to the GaimPluginProtocolInfo struct - * Changed: gaim_blist_update_buddy_presence(), presence changed to - type gboolean - * Changed: the versioning scheme, and all the plugin structs - -version 0.82 (08/26/2004): - Gaim API: - * Removed: gaim_gtk_get_dispstyle(), gaim_gtk_change_text() - * Removed: multi.h - * Renamed: ui.h to gtkdialogs.h - * Renamed: gtkinternal.h to gtkgaim.h - * Renamed: show_info_dialog to gaim_gtkdialogs_info - * Renamed: show_log_dialog to gaim_gtkdialogs_log - * Renamed: show_warn_dialog to gaim_gtkdialogs_warn - * Renamed: show_im_dialog to gaim_gtkdialogs_im - * Renamed: gaim_gtkdialogs_new_im to gaim_gtkdialogs_im_with_user - * Renamed: destroy_all_dialogs to gaim_gtkdialogs_destroy_all - * Renamed: alias_dialog_bud to gaim_gtkdialogs_alias_buddy - * Renamed: alias_dialog_contact to gaim_gtkdialogs_alias_contact - * Renamed: alias_dialog_blist_chat to gaim_gtkdialogs_alias_chat - * Renamed: show_confirm_del to gaim_gtkdialogs_remove_buddy - * Renamed: show_confirm_del_group to gaim_gtkdialogs_remove_group - * Renamed: show_confirm_del_blist_chat to gaim_gtkdialogs_remove_chat - * Renamed: show_confirm_del_contact to gaim_gtkdialogs_remove_contact - * Renamed: show_about to gaim_gtkdialogs_about - * Added: gaim_notify_userinfo() and the associated notify_userinfo() UI op - (someone who knows just why we have this can edit here) - - Buddy List API: - * Changed: gaim_blist_request_add_chat(), added name parameter - * Added: gaim_contact_on_account() - * Added: flags parameter to the GaimBlistNode struct - - Conversation API: - * Added: gaim_gtkconv_button_new() - - Protocol Plugin API: v7 - * Added: chat_info_defaults to the GaimPluginProtocolInfo struct - - Signals: - * Added: conversation-updated for any update to the data associated - with the conversation (topic, icon, adding to buddy list, etc.) - - Conversation API: - * Changed: gaim_conv_chat_add_user() (added new_arrival parameter) - -version 0.81 (08/05/2004): - Commands API: - * Most functions now have a void *data argument. - - Blist API: - * Added: gaim_buddy_get_contact_alias - * Renamed: gaim_get_buddy_alias to gaim_buddy_get_alias - * Renamed: gaim_get_buddy_alias_only to gaim_buddy_get_alias_only - - Conversation API: - * Changed: gaim_conv_chat_add_user(), added flags parameter - * Changed: gaim_conv_chat_add_users(), added GList of flags parameter - * Changed: gaim_conv_chat_get_users(), now returns a GList of - GaimConvChatBuddy's - * Changed: gaim_conv_chat_set_users() now expects a GList of - GaimConvChatBuddy's - * Added: gaim_conv_chat_set_user_flags() - * Added: gaim_conv_chat_get_user_flags() - * Added: gaim_conv_chat_find_user() - * Added: gaim_conv_chat_cb_new() - * Added: gaim_conv_chat_cb_find() - * Added: gaim_conv_chat_cb_destroy() - * Added: gaim_conv_chat_cb_get_name() - - Conversation UI ops: - * Added: chat_update_user() - - Signals: - * Changed: chat-buddy-joining & chat-buddy-joined now include the user's flags - * Changed: chat-buddy-joining & chat-buddy-leaving are now booleans, return - TRUE if you don't want the join/leave to be displayed in the UI. - * Added: chat-buddy-flags for when user's flags change - gaim_marshal_VOID__POINTER_POINTER_POINTER_UINT_UINT (required for the new - chat-buddy-flags signal) - * Added: account-modified for when account settings have been changed. - -version 0.80 (07/15/2004): - Gaim API: - * Removed: PRPL numbers : gaim_account_set_protocol(), - gaim_account_get_protocol(), gaim_accounts_find_with_prpl_num, - gaim_prpl_num_to_id(), gaim_prpl_id_to_num(), GaimProtocol - - Protocol Plugin API: v6 - * Added: can_receive_file & send_file to the GaimPluginProtocolInfo struct - - Signals: - * Changed "chat-invited" to also include the components hash table so - plugins can use serv_join_chat when the signal is emitted. - * Added "chat-topic-changed" signal plugins know when a topic is changed. - -version 0.79 (06/24/2004): - Gaim API: - * gaim_url_parse() now takes two additional parameters, which are used - for returning the username and password from the URL, if they exist. - * Added: has_focus UI op to GaimConversationUiOps and - GaimConvWindowUiOps. - * Added: gaim_conversation_has_focus() and gaim_conv_window_has_focus(). - * Removed: gaim_blist_save() - - Protocol Plugin API: v5 - * Changed: add_buddy, add_buddies, remove_buddy, remove_buddies, - rename_group and remove_group to take GaimBuddy's and - GaimGroup's consistently. - * Removed: OPT_PROTO_BUDDY_ICON (replaced by icon_spec) - * Added: icon_spec to the GaimPluginProtocolInfo struct - -version 0.78 (05/30/2004): - Plugin API: v4 - * Added: actions - for plugins to add to the new Plugin Actions menu - - Loader Plugin API: v2 (no changes) - - Protocol Plugin API: v4 - * Removed: set_dir, get_dir and dir_search (not used, AIM-centric) - * Removed: actions (replaced by generic plugin actions) - - Perl Plugin API: v2 (no changes) - TCL Plugin API: (no changes) - - Signals: - * Added: "blist-node-extended-menu" for extending Buddy, Chat and - Group right-click menus - * Added: "drawing-tooltip" for plugins to allow plugins to change text - appearing in tooltips - * Added: "gtkblist-created" - * Added: "receiving-im-msg" and "receiving-chat-msg" (these behave - exactly like received-*-msg used to) - * Added: "buddy-idle-updated" signal, for when the idle time changes. - * Changed: "received-im-msg" and "received-chat-msg" no longer pass - pointers to who, message and flags, and are now void. - * Removed: "drawing-menu" - it was UI sepecific and - "blist-node-extended-menu" is superior - -version 0.77 (04/22/2004): - Loader & Protocol Plugins independantly versioned - Plugin loading now checks versioning on plugins (Standard, Loader & - Protocol) - new GAIM_{PLUGIN,PRPL,LOADER}_API_VERSION constants - - Plugin API: v3 - * Added: prefs_info for UI independant plugin prefs - - Loader Plugin API: v2 - * Added: api_version at top of GaimPluginLoaderInfo struct - - Protocol Plugin API: v2 - * Added: api_version at top of GaimPluginProtocolInfo struct - * Added: chat_menu for protocol specific extensions to the chat menu - * Removed: get_away "Nada used it. Pink elephants on parade." - * Removed: protocol_prefs (replaced by generic plugin prefs_info) - - Perl Plugin API: v2 (no changes) - TCL API: (no changes) - - Signals: - * Added: "conversation-drag-ended" - -version 0.76 (04/01/2004): - Plugin API: v2 - Perl Plugin API: v2 - Loader Plugin API: (not versioned) - Protocol Plugin API: (not versioned) - * Added: protocol_prefs for protocol specific preferences - * Added: reject_chat so protocols can act on chat invite rejection - - TCL Plugin API: (not versioned) - * Changes to plugin registration to show descriptions - Deleted: trunk/plugins/HOWTO =================================================================== --- trunk/plugins/HOWTO 2006-08-19 01:29:53 UTC (rev 16858) +++ trunk/plugins/HOWTO 2006-08-19 01:31:21 UTC (rev 16859) @@ -1,83 +0,0 @@ -Everything in this file should be considered old and potentially out of -date. For more reliable information, install doxygen and graphiz dot, -then run -make docs -in the gaim source tree. This will produce html docs in gaim/docs/html -that will provide an api reference and in the related pages section, -information on perl and c plugins. - - -Ok, this howto is going to be really short and sweet and to the point. - -First off, before you do anything else, in all of the files for your plugin, -put the lines - -#define GAIM_PLUGINS -#include "gaim.h" - -I mean this. Without this, all kinds of things will not work correctly. If you -really want to know exactly what this does, read ../src/gaim.h and learn. But -if you don't want to do that, just know that it's important. - -Now that you've put that there, make sure gaim.h is in your include path. - -Ok, now you're ready to write the plugin. - -The only function that is required is gaim_plugin_init(GModule *). This gets -called as soon as it gets loaded (sort of - man dlopen for more details). If -your function never returns, it will crash gaim! If your plugin uses up all -the memory in the system, it will crash gaim! Once your plugin gets loaded, -it effectively becomes a part of gaim, and anything that goes wrong will look -like it is a problem with gaim itself. I write bugfree code! :) Therefore, it -is your problem, not mine. (I'm usually nice and willing to help you with your -problems though.) - -The GModule* that gets passed to gaim_plugin_init is the handle for the plugin. -DO NOT CHANGE THIS POINTER! Bad things will happen. You've been warned. It's -needed for connecting to signals and things. It's a good idea to remember it -somehow. - -gaim_plugin_init should return a char*. If the char* returned is not NULL, it -is interpreted as an error, and used as an error message. See the ChangeLog -file in this directory for more details. - -You can basically do anything you want in the plugin. You can make function -calls, change public widgets, display new widgets, things like that. But the -really neat thing is you can do things at events. For example, when one of -your buddies signs on, you can instantly send them a message. You can modify -the incoming and outgoing text. You can do all kinds of crazy things. Whatever -you want. Check out SIGNALS for more information. - -Plugins can share globals with gaim, but will not share with other plugins. -This is so if you have a global variable GtkWidget *window in your plugin and -J. Random Hacker also has the same name on a global variable, you won't be -constantly overwriting each others' variables. Unfortunately, this also means -that plugins will have difficulty working together. But then again, that's -what shared memory is for. - -Plugins can be configured. This makes it so they don't have to be recompiled -in order to change things internal to them, and it's also just a cool feature -to have :). It's optional; to allow your plugin to be configured, add a -function called gaim_plugin_config(). The advised course of action is to have -it pop up a dialog window; but it's your plugin. - -When your plugin gets unloaded, gaim will try to call gaim_plugin_remove(). It -doesn't have to be there, but it's nice if, say, you create a window, and when -the plugin gets unloaded, it removes the window. Also, all the callbacks you -have attached to gaim signals will be removed. - -Plugins can also unload themselves. To do this, call gaim_plugin_unload(GModule *) -(the GModule* is the handle passed to gaim_plugin_init). When your plugin gets -unloaded, gaim will remove all of your callbacks. It will not call your -gaim_plugin_remove function, however, since it will assume you have already -done the necessary cleanup. - -Compilation of the plugins is fairly straight-forward; there is a Makefile in -this directory that has a rule for making the .so file from a .c file. No -modification of the Makefile should be necessary, unless if you simply want -to type 'make' to have it made; otherwise, 'make filename.so' will take -filename.c and make the .so plugin from it. If you need to link in with extra -libraries, you can set the environment variable PLUGIN_LIBS to be the libraries -you want to link with. - -There are a few examples in this directory. Enjoy. Modified: trunk/plugins/Makefile.am =================================================================== --- trunk/plugins/Makefile.am 2006-08-19 01:29:53 UTC (rev 16858) +++ trunk/plugins/Makefile.am 2006-08-19 01:31:21 UTC (rev 16859) @@ -1,13 +1,18 @@ -DIST_SUBDIRS = docklet gevolution gestures mono musicmessaging perl ssl tcl ticker - +if ENABLE_GTK + if BUILD_GEVOLUTION GEVOLUTION_DIR = gevolution -endif +endif # GEvolution if USE_PERL PERL_DIR = perl -endif +endif # Perl +gtk_dirs = docklet $(GEVOLUTION_DIR) gestures musicmessaging $(PERL_DIR) ticker +endif # GTK + +DIST_SUBDIRS = mono ssl tcl $(gtk_dirs) + if USE_TCL TCL_DIR = tcl endif @@ -15,74 +20,78 @@ if ENABLE_DBUS DBUS_LTLIB = dbus-example.la +if ENABLE_GTK # Only use music messaging if dbus is enabled MUSICMESSAGING_DIR = musicmessaging endif +endif if USE_MONO MONO_DIR = mono endif SUBDIRS = \ - docklet \ - $(GEVOLUTION_DIR) \ - gestures \ $(MONO_DIR) \ - $(MUSICMESSAGING_DIR) \ - $(PERL_DIR) \ ssl \ $(TCL_DIR) \ - ticker + $(gtk_dirs) plugindir = $(libdir)/gaim -extplacement_la_LDFLAGS = -module -avoid-version $(GLIB_LIBS) -gaimrc_la_LDFLAGS = -module -avoid-version $(GTK_LIBS) -history_la_LDFLAGS = -module -avoid-version $(GTK_LIBS) -iconaway_la_LDFLAGS = -module -avoid-version $(GTK_LIBS) idle_la_LDFLAGS = -module -avoid-version $(GLIB_LIBS) -notify_la_LDFLAGS = -module -avoid-version $(GTK_LIBS) psychic_la_LDFLAGS = -module -avoid-version $(GLIB_LIBS) relnot_la_LDFLAGS = -module -avoid-version $(GLIB_LIBS) -spellchk_la_LDFLAGS = -module -avoid-version $(GTK_LIBS) statenotify_la_LDFLAGS = -module -avoid-version $(GLIB_LIBS) -timestamp_la_LDFLAGS = -module -avoid-version $(GTK_LIBS) -timestamp_format_la_LDFLAGS = -module -avoid-version $(GTK_LIBS) # this can't be in a conditional otherwise automake 1.4 yells dbus_example_la_LDFLAGS = -module -avoid-version $(GLIB_LIBS) $(DBUS_LIBS) if PLUGINS -plugin_LTLIBRARIES = \ +if ENABLE_GTK +gtk_plugins = \ extplacement.la \ gaimrc.la \ history.la \ iconaway.la \ - idle.la \ notify.la \ - psychic.la \ - relnot.la \ spellchk.la \ - statenotify.la \ timestamp.la \ - timestamp_format.la \ - $(DBUS_LTLIB) - - + timestamp_format.la + extplacement_la_SOURCES = extplacement.c gaimrc_la_SOURCES = gaimrc.c history_la_SOURCES = history.c iconaway_la_SOURCES = iconaway.c -idle_la_SOURCES = idle.c notify_la_SOURCES = notify.c -psychic_la_SOURCES = psychic.c -relnot_la_SOURCES = relnot.c spellchk_la_SOURCES = spellchk.c -statenotify_la_SOURCES = statenotify.c timestamp_la_SOURCES = timestamp.c timestamp_format_la_SOURCES = timestamp_format.c +extplacement_la_LDFLAGS = -module -avoid-version $(GLIB_LIBS) +gaimrc_la_LDFLAGS = -module -avoid-version $(GTK_LIBS) +history_la_LDFLAGS = -module -avoid-version $(GTK_LIBS) +iconaway_la_LDFLAGS = -module -avoid-version $(GTK_LIBS) +notify_la_LDFLAGS = -module -avoid-version $(GTK_LIBS) +spellchk_la_LDFLAGS = -module -avoid-version $(GTK_LIBS) +timestamp_la_LDFLAGS = -module -avoid-version $(GTK_LIBS) +timestamp_format_la_LDFLAGS = -module -avoid-version $(GTK_LIBS) + +endif # ENABLE_GTK + +plugin_LTLIBRARIES = \ + idle.la \ + psychic.la \ + relnot.la \ + statenotify.la \ + $(gtk_plugins) \ + $(DBUS_LTLIB) + +idle_la_SOURCES = idle.c +psychic_la_SOURCES = psychic.c +relnot_la_SOURCES = relnot.c +statenotify_la_SOURCES = statenotify.c + if ENABLE_DBUS CLEANFILES = dbus-example-bindings.c Deleted: trunk/plugins/ciphertest.c =================================================================== --- trunk/plugins/ciphertest.c 2006-08-19 01:29:53 UTC (rev 16858) +++ trunk/plugins/ciphertest.c 2006-08-19 01:31:21 UTC (rev 16859) @@ -1,287 +0,0 @@ -/* - * A plugin to test the ciphers that ship with gaim - * - * Copyright (C) 2004, Gary Kramlich <amc...@us...> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#ifndef GAIM_PLUGINS -#define GAIM_PLUGINS -#endif - -#include "internal.h" - -#include <glib.h> -#include <string.h> - -#include "cipher.h" -#include "debug.h" -#include "plugin.h" -#include "version.h" - -struct test { - const gchar *question; - const gchar *answer; -}; - -/************************************************************************** - * MD5 Stuff - **************************************************************************/ -struct test md5_tests[8] = { - { "", "d41d8cd98f00b204e9800998ecf8427e"}, - { "a", "0cc175b9c0f1b6a831c399e269772661"}, - { "abc", "900150983cd24fb0d6963f7d28e17f72"}, - { "message digest", "f96b697d7cb7938d525a2f31aaf161d0"}, - { "abcdefghijklmnopqrstuvwxyz", "c3fcd3d76192e4007dfb496cca67e13b"}, - { "ABCDEFGHIJKLMNOPQRSTUVWXYZ" - "abcdefghijklmnopqrstuvwxyz" - "0123456789", "d174ab98d277d9f5a5611c2c9f419d9f"}, - {"123456789012345678901234567" - "890123456789012345678901234" - "56789012345678901234567890", "57edf4a22be3c955ac49da2e2107b67a"}, - { NULL, NULL } -}; - -static void -cipher_test_md5() { - GaimCipher *cipher; - GaimCipherContext *context; - gchar digest[33]; - gboolean ret; - gint i = 0; - - cipher = gaim_ciphers_find_cipher("md5"); - if(!cipher) { - gaim_debug_info("cipher-test", - "could not find md5 cipher, not testing\n"); - return; - } - - gaim_debug_info("cipher-test", "Running md5 tests\n"); - - context = gaim_cipher_context_new(cipher, NULL); - - while(md5_tests[i].answer) { - gaim_debug_info("cipher-test", "Test %02d:\n", i); - gaim_debug_info("cipher-test", "Testing '%s'\n", md5_tests[i].question); - - gaim_cipher_context_append(context, (guchar *)md5_tests[i].question, - strlen(md5_tests[i].question)); - - ret = gaim_cipher_context_digest_to_str(context, sizeof(digest), - digest, NULL); - - if(!ret) { - gaim_debug_info("cipher-test", "failed\n"); - } else { - gaim_debug_info("cipher-test", "\tGot: %s\n", digest); - gaim_debug_info("cipher-test", "\tWanted: %s\n", - md5_tests[i].answer); - } - - gaim_cipher_context_reset(context, NULL); - i++; - } - - gaim_cipher_context_destroy(context); - - gaim_debug_info("cipher-test", "md5 tests completed\n\n"); -} - -/************************************************************************** - * SHA-1 stuff - **************************************************************************/ -struct test sha1_tests[5] = { - {"a", "86f7e437faa5a7fce15d1ddcb9eaeaea377667b8"}, - {"abc", "a9993e364706816aba3e25717850c26c9cd0d89d"} , - {"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", "84983e441c3bd26ebaae4aa1f95129e5e54670f1"} , - {NULL, "34aa973cd4c4daa4f61eeb2bdbad27316534016f"}, - {NULL, NULL} -}; - -static void -cipher_test_sha1() { - GaimCipher *cipher; - GaimCipherContext *context; - gchar digest[41]; - gint i = 0; - gboolean ret; - - cipher = gaim_ciphers_find_cipher("sha1"); - if(!cipher) { - gaim_debug_info("cipher-test", - "could not find sha1 cipher, not testing\n"); - return; - } - - gaim_debug_info("cipher-test", "Running sha1 tests\n"); - - context = gaim_cipher_context_new(cipher, NULL); - - while(sha1_tests[i].answer) { - gaim_debug_info("cipher-test", "Test %02d:\n", i); - gaim_debug_info("cipher-test", "Testing '%s'\n", - (sha1_tests[i].question != NULL) ? - sha1_tests[i].question : "'a'x1000, 1000 times"); - - if(sha1_tests[i].question) { - gaim_cipher_context_append(context, (guchar *)sha1_tests[i].question, - strlen(sha1_tests[i].question)); - } else { - gint j; - guchar buff[1000]; - - memset(buff, 'a', 1000); - - for(j = 0; j < 1000; j++) - gaim_cipher_context_append(context, buff, 1000); - } - - ret = gaim_cipher_context_digest_to_str(context, sizeof(digest), - digest, NULL); - - if(!ret) { - gaim_debug_info("cipher-test", "failed\n"); - } else { - gaim_debug_info("cipher-test", "\tGot: %s\n", digest); - gaim_debug_info("cipher-test", "\tWanted: %s\n", - sha1_tests[i].answer); - } - - gaim_cipher_context_reset(context, NULL); - i++; - } - - gaim_cipher_context_destroy(context); - - gaim_debug_info("cipher-test", "sha1 tests completed\n\n"); -} - -static void -cipher_test_digest() -{ - const gchar *nonce = "dcd98b7102dd2f0e8b11d0f600bfb0c093"; - const gchar *client_nonce = "0a4f113b"; - const gchar *username = "Mufasa"; - const gchar *realm = "tes...@ho..."; - const gchar *password = "Circle Of Life"; - const gchar *algorithm = "md5"; - const gchar *nonce_count = "00000001"; - const gchar *method = "GET"; - const gchar *qop = "auth"; - const gchar *digest_uri = "/dir/index.html"; - const gchar *entity = NULL; - - gchar *session_key; - - gaim_debug_info("cipher-test", "Running HTTP Digest tests\n"); - - session_key = gaim_cipher_http_digest_calculate_session_key( - algorithm, username, realm, password, - nonce, client_nonce); - - if (session_key == NULL) - { - gaim_debug_info("cipher-test", - "gaim_cipher_http_digest_calculate_session_key failed.\n"); - } - else - { - gchar *response; - - gaim_debug_info("cipher-test", "\tsession_key: Got: %s\n", session_key); - gaim_debug_info("cipher-test", "\tsession_key: Wanted: %s\n", "939e7578ed9e3c518a452acee763bce9"); - - response = gaim_cipher_http_digest_calculate_response( - algorithm, method, digest_uri, qop, entity, - nonce, nonce_count, client_nonce, session_key); - - g_free(session_key); - - if (response == NULL) - { - gaim_debug_info("cipher-test", - "gaim_cipher_http_digest_calculate_session_key failed.\n"); - } - else - { - gaim_debug_info("cipher-test", "\tresponse: Got: %s\n", response); - gaim_debug_info("cipher-test", "\tresponse: Wanted: %s\n", "6629fae49393a05397450978507c4ef1"); - g_free(response); - } - } - - gaim_debug_info("cipher-test", "HTTP Digest tests completed\n\n"); -} - -/************************************************************************** - * Plugin stuff - **************************************************************************/ -static gboolean -plugin_load(GaimPlugin *plugin) { - cipher_test_md5(); - cipher_test_sha1(); - cipher_test_digest(); - - return TRUE; -} - -static gboolean -plugin_unload(GaimPlugin *plugin) { - return TRUE; -} - -static GaimPluginInfo info = -{ - GAIM_PLUGIN_MAGIC, - GAIM_MAJOR_VERSION, - GAIM_MINOR_VERSION, - GAIM_PLUGIN_STANDARD, /**< type */ - NULL, /**< ui_requirement */ - 0, /**< flags */ - NULL, /**< dependencies */ - GAIM_PRIORITY_DEFAULT, /**< priority */ - - "core-cipher-test", /**< id */ - N_("Cipher Test"), /**< name */ - VERSION, /**< version */ - /** summary */ - N_("Tests the ciphers that ship with gaim."), - /** description */ - N_("Tests the ciphers that ship with gaim."), - "Gary Kramlich <amc...@us...>", /**< author */ - GAIM_WEBSITE, /**< homepage */ - - plugin_load, /**< load */ - plugin_unload, /**< unload */ - NULL, /**< destroy */ - - NULL, /**< ui_info */ - NULL, /**< extra_info */ - NULL, - NULL -}; - -static void -init_plugin(GaimPlugin *plugin) { -} - -GAIM_INIT_PLUGIN(cipher_test, init_plugin, info) Deleted: trunk/plugins/codeinline.c =================================================================== --- trunk/plugins/codeinline.c 2006-08-19 01:29:53 UTC (rev 16858) +++ trunk/plugins/codeinline.c 2006-08-19 01:31:21 UTC (rev 16859) @@ -1,93 +0,0 @@ -/* - * gaim - * - * Gaim is the legal property of its developers, whose names are too numerous - * to list here. Please refer to the COPYRIGHT file distributed with this - * source distribution. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "internal.h" -#include "plugin.h" -#include "notify.h" -#include "util.h" -#include "version.h" -#include "gtkutils.h" -#include "gtkimhtml.h" - -GaimPlugin *plugin_handle = NULL; - -static gboolean outgoing_msg_cb(GaimAccount *account, const char *who, char **message, - GaimConversation *conv, GaimMessageFlags flags, gpointer null) -{ - char *m; - char **ms = g_strsplit(*message, "<u>", -1); - m = g_strjoinv("<font face=\"monospace\" color=\"#00b025\">", ms); - g_strfreev(ms); - - ms = g_strsplit(m, "</u>", -1); - g_free(m); - m = g_strjoinv("</font>", ms); - g_free(*message); - *message = m; - return FALSE; -} - -static gboolean -plugin_load(GaimPlugin *plugin) -{ - void *handle = gaim_conversations_get_handle(); - plugin_handle = plugin; - gaim_signal_connect(handle, "writing-im-msg", plugin, - GAIM_CALLBACK(outgoing_msg_cb), NULL); - - return TRUE; -} - - -static GaimPluginInfo info = -{ - GAIM_PLUGIN_MAGIC, - GAIM_MAJOR_VERSION, - GAIM_MINOR_VERSION, - GAIM_PLUGIN_STANDARD, - NULL, - 0, - NULL, - GAIM_PRIORITY_DEFAULT, - "codeinline", - "Code Inline", - "1.0", - "Formats text as code", - "Changes the formatting of any outgoing text such that " - "anything underlined will be received green and monospace.", - "Sean Egan <sea...@gm...>", - "http://gaim.sourceforge.net", - plugin_load, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL -}; - - static void - init_plugin(GaimPlugin *plugin) - { - } - -GAIM_INIT_PLUGIN(urlcatcher, init_plugin, info) Deleted: trunk/plugins/contact_priority.c =================================================================== --- trunk/plugins/contact_priority.c 2006-08-19 01:29:53 UTC (rev 16858) +++ trunk/plugins/contact_priority.c 2006-08-19 01:31:21 UTC (rev 16859) @@ -1,205 +0,0 @@ -/* - * Contact priority settings plugin. - * - * Copyright (C) 2003 Etan Reisner, <de...@us...>. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General ... [truncated message content] |
From: <ev...@us...> - 2006-08-19 01:30:35
|
Revision: 16858 Author: evands Date: 2006-08-18 18:29:53 -0700 (Fri, 18 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16858&view=rev Log Message: ----------- ** Part 4 of a 4 part commit ** Restructured the tree and the build files for the core/UI split. libgaim is now built as a library against which gtkgaim and gntgaim link and can be built separately from them by configuring with them disable d (--disable-gtkgaim and --disable-gntgaim). Each of the three source trees (gtk, console, and core) has its own plugins folder. This works nicely on my system; hopefully it won't cause too much chaos for others. If you have local changes, an easy way to merge them to the new layout should be along the lines of svn diff -r version_before_move > myChanges.diff patch -p1 < myChanges.diff where svn diff is done from the gaim checkout root but patch is done from gtk or core (or both). This changeset combines work by Sadrul Chowdhury, Gary Kramlich (grim), and me. Known issues: * On my system, at least, something's not quite right with the gtkgaim build process; it imports gtkgaim.h (as can be seen by adding a #warning) but <gtk/gtk.h> doesn't seem to be used. The GTK_STOCK_XXX defines claim to be undeclared. I was going to make this work before committing, but I strongly suspect someone with more autotools experience will be able to fix it easily whereas I've already glared at it for an hour. * The gnt console UI depends on libgnt, which is not yet automatically built. Either autogen.sh && make && make install libgnt (in console/libgnt) or configure with --disable-gnt for now. * The Windows build process has not been touched yet so still needs updating. * There's an stray "rm: core: is a directory" warning after autogen.sh is compl te. I'm not sure where that's coming from. Modified Paths: -------------- trunk/Makefile.am trunk/configure.ac Added Paths: ----------- trunk/gtk/win32/ Removed Paths: ------------- trunk/src/account.c trunk/src/account.h trunk/src/accountopt.c trunk/src/accountopt.h trunk/src/blist.c trunk/src/blist.h trunk/src/buddyicon.c trunk/src/buddyicon.h trunk/src/cipher.c trunk/src/cipher.h trunk/src/circbuffer.c trunk/src/circbuffer.h trunk/src/cmds.c trunk/src/cmds.h trunk/src/connection.c trunk/src/connection.h trunk/src/conversation.c trunk/src/conversation.h trunk/src/core.c trunk/src/core.h trunk/src/dbus-analyze-functions.py trunk/src/dbus-analyze-types.py trunk/src/dbus-bindings.h trunk/src/dbus-define-api.h trunk/src/dbus-gaim.h trunk/src/dbus-gaim.service trunk/src/dbus-maybe.h trunk/src/dbus-server.c trunk/src/dbus-server.h trunk/src/dbus-useful.c trunk/src/dbus-useful.h trunk/src/debug.c trunk/src/debug.h trunk/src/desktopitem.c trunk/src/desktopitem.h trunk/src/dnsquery.c trunk/src/dnsquery.h trunk/src/dnssrv.c trunk/src/dnssrv.h trunk/src/eventloop.c trunk/src/eventloop.h trunk/src/ft.c trunk/src/ft.h trunk/src/gaim-client-example.c trunk/src/gaim-client.c trunk/src/gaim-client.h trunk/src/gaim-notifications-example trunk/src/gaim-remote trunk/src/gaim-send trunk/src/gaim-send-async trunk/src/gaim.h trunk/src/getopt.c trunk/src/getopt.h trunk/src/getopt1.c trunk/src/gtkaccount.c trunk/src/gtkaccount.h trunk/src/gtkblist.c trunk/src/gtkblist.h trunk/src/gtkcelllayout.c trunk/src/gtkcelllayout.h trunk/src/gtkcellrendererprogress.c trunk/src/gtkcellrendererprogress.h trunk/src/gtkcellview.c trunk/src/gtkcellview.h trunk/src/gtkcellviewmenuitem.c trunk/src/gtkcellviewmenuitem.h trunk/src/gtkcombobox.c trunk/src/gtkcombobox.h trunk/src/gtkconn.c trunk/src/gtkconn.h trunk/src/gtkconv.c trunk/src/gtkconv.h trunk/src/gtkconvwin.h trunk/src/gtkdebug.c trunk/src/gtkdebug.h trunk/src/gtkdialogs.c trunk/src/gtkdialogs.h trunk/src/gtkdnd-hints.c trunk/src/gtkdnd-hints.h trunk/src/gtkeventloop.c trunk/src/gtkeventloop.h trunk/src/gtkexpander.c trunk/src/gtkexpander.h trunk/src/gtkft.c trunk/src/gtkft.h trunk/src/gtkgaim.h trunk/src/gtkidle.c trunk/src/gtkidle.h trunk/src/gtkimhtml.c trunk/src/gtkimhtml.h trunk/src/gtkimhtmltoolbar.c trunk/src/gtkimhtmltoolbar.h trunk/src/gtklog.c trunk/src/gtklog.h trunk/src/gtkmain.c trunk/src/gtkmenutray.c trunk/src/gtkmenutray.h trunk/src/gtknickcolors.h trunk/src/gtknotify.c trunk/src/gtknotify.h trunk/src/gtkplugin.c trunk/src/gtkplugin.h trunk/src/gtkpluginpref.c trunk/src/gtkpluginpref.h trunk/src/gtkpounce.c trunk/src/gtkpounce.h trunk/src/gtkprefs.c trunk/src/gtkprefs.h trunk/src/gtkprivacy.c trunk/src/gtkprivacy.h trunk/src/gtkrequest.c trunk/src/gtkrequest.h trunk/src/gtkroomlist.c trunk/src/gtkroomlist.h trunk/src/gtksavedstatuses.c trunk/src/gtksavedstatuses.h trunk/src/gtksession.c trunk/src/gtksession.h trunk/src/gtksound.c trunk/src/gtksound.h trunk/src/gtksourceiter.c trunk/src/gtksourceiter.h trunk/src/gtkstatusbox.c trunk/src/gtkstatusbox.h trunk/src/gtkstock.c trunk/src/gtkstock.h trunk/src/gtkthemes.c trunk/src/gtkthemes.h trunk/src/gtkutils.c trunk/src/gtkutils.h trunk/src/gtkwhiteboard.c trunk/src/gtkwhiteboard.h trunk/src/idle.c trunk/src/idle.h trunk/src/imgstore.c trunk/src/imgstore.h trunk/src/internal.h trunk/src/log.c trunk/src/log.h trunk/src/mime.c trunk/src/mime.h trunk/src/network.c trunk/src/network.h trunk/src/notify.c trunk/src/notify.h trunk/src/ntlm.c trunk/src/ntlm.h trunk/src/plugin.c trunk/src/plugin.h trunk/src/pluginpref.c trunk/src/pluginpref.h trunk/src/pounce.c trunk/src/pounce.h trunk/src/prefix.c trunk/src/prefix.h trunk/src/prefs.c trunk/src/prefs.h trunk/src/privacy.c trunk/src/privacy.h trunk/src/protocols/ trunk/src/proxy.c trunk/src/proxy.h trunk/src/prpl.c trunk/src/prpl.h trunk/src/request.c trunk/src/request.h trunk/src/roomlist.c trunk/src/roomlist.h trunk/src/savedstatuses.c trunk/src/savedstatuses.h trunk/src/server.c trunk/src/server.h trunk/src/signals.c trunk/src/signals.h trunk/src/sound.c trunk/src/sound.h trunk/src/sslconn.c trunk/src/sslconn.h trunk/src/status.c trunk/src/status.h trunk/src/stringref.c trunk/src/stringref.h trunk/src/stun.c trunk/src/stun.h trunk/src/upnp.c trunk/src/upnp.h trunk/src/util.c trunk/src/util.h trunk/src/value.c trunk/src/value.h trunk/src/version.h trunk/src/whiteboard.c trunk/src/whiteboard.h trunk/src/win32/ trunk/src/win_gaim.c trunk/src/xmlnode.c trunk/src/xmlnode.h Modified: trunk/Makefile.am =================================================================== --- trunk/Makefile.am 2006-08-19 01:19:33 UTC (rev 16857) +++ trunk/Makefile.am 2006-08-19 01:29:53 UTC (rev 16858) @@ -48,8 +48,16 @@ apps_DATA = $(apps_in_files:.desktop.in=.desktop) @INTLTOOL_DESKTOP_RULE@ -SUBDIRS = doc m4macros pixmaps plugins po sounds src +if ENABLE_GTK +GTK_DIR=gtk +endif +if ENABLE_GNT +GNT_DIR=console +endif + +SUBDIRS = core doc $(GNT_DIR) $(GTK_DIR) m4macros po + docs: Doxyfile if HAVE_DOXYGEN @echo "Running doxygen..." Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2006-08-19 01:19:33 UTC (rev 16857) +++ trunk/configure.ac 2006-08-19 01:29:53 UTC (rev 16858) @@ -527,6 +527,8 @@ AC_ARG_WITH(tkconfig, [ --with-tkconfig=DIR directory containing tkConfig.sh]) AC_ARG_ENABLE(gtkspell, [ --disable-gtkspell compile without GtkSpell automatic spell checking],,enable_gtkspell=yes) AC_ARG_ENABLE(debug, [ --enable-debug compile with debugging support],,enable_debug=no) +AC_ARG_ENABLE(gtkgaim, [ --disable-gtkgaim compile without GtkGaim client],,enable_gtk=yes) +AC_ARG_ENABLE(gntgaim, [ --disable-gntgaim compile without GntGaim console client],,enable_gnt=yes) AC_ARG_ENABLE(fatal-asserts, [ --enable-fatal-asserts make assertions fatal (useful for debugging)],,enable_fatal_asserts=no) dnl We know Gaim won't compile with deprecated APIs disabled. dnl We have no desire to support two different versions of the @@ -633,19 +635,37 @@ fi AC_SUBST(CFLAGS) -AM_PATH_GLIB_2_0(2.0.0,,AC_MSG_ERROR([ +PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.0.0 gobject-2.0 gmodule-2.0 gthread-2.0], + [ + AC_SUBST(GLIB_CFLAGS) + AC_SUBST(GLIB_LIBS) + ], + [ + AC_MSG_ERROR([ *** GLib 2.0 is required to build Gaim; please make sure you have the GLib *** development headers installed. The latest version of GLib is -*** always available at http://www.gtk.org/.]),gthread) -AM_PATH_GTK_2_0(2.0.0,,AC_MSG_ERROR([ -*** GTK+ 2.0 is required to build Gaim; please make sure you have the GTK+ -*** development headers installed. The latest version of GTK+ is -*** always available at http://www.gtk.org/.])) +*** always available at http://www.gtk.org/.]) + ]) AC_PATH_PROG(gaimpath, gaim) -AC_SUBST(GTK_CFLAGS) -AC_SUBST(GLIB_CFLAGS) +if test "$enable_gtk" = yes ; then + PKG_CHECK_MODULES(GTK, [gtk+-2.0 >= 2.0.0], + [ + AC_SUBST(GTK_CFLAGS) + AC_SUBST(GTK_LIBS) + ], + [ + AC_MSG_ERROR([ +*** GTK+ 2.0 is required to build Gaim. please make sure you have the GTK+ +*** development headers installed. The latest version of GTK+ is +*** always available at http://www.gtk.org/. +*** +*** If you wish to build just gntgaim or libgaim, +*** configure with --disable-gtkgaim]) + ]) +fi + AC_PATH_XTRA # We can't assume that $x_libraries will be set, because autoconf does not # set it in the case when the X libraries are in a standard place. @@ -784,6 +804,33 @@ AM_CONDITIONAL(ENABLE_DBUS, test "x$enable_dbus" = "xyes") dnl ####################################################################### +dnl # GNT Gaim +dnl ####################################################################### +AM_CONDITIONAL(ENABLE_GNT, test "x$enable_gnt" = "xyes") + +dnl ####################################################################### +dnl # Look for startup-notification, evolution integration, X-libraries, +dnl # XScreenSaver, X session management, GtkSpell only if GTK+ was found +dnl ####################################################################### + +if test "x$enable_gtk" = "xyes"; then + +AC_PATH_XTRA +# We can't assume that $x_libraries will be set, because autoconf does not +# set it in the case when the X libraries are in a standard place. +# Ditto for $x_includes +if test X"$x_libraries" = X"" || test X"$x_libraries" = XNONE; then + x_libpath_add= +else + x_libpath_add="-L$x_libraries" +fi +if test X"$x_includes" = X"" || test X"$x_includes" = XNONE; then + x_incpath_add= +else + x_incpath_add="-I$x_includes" +fi + +dnl ####################################################################### dnl # Check for startup notification dnl ####################################################################### AC_ARG_ENABLE(startup-notification, [AC_HELP_STRING([--disable-startup-notification], [compile without startup notification support])], , enable_startup_notification=yes) @@ -803,7 +850,6 @@ AC_SUBST(STARTUP_NOTIFICATION_LIBS) fi - dnl ####################################################################### dnl # Check for stuff needed by the evolution integration plugin. dnl ####################################################################### @@ -834,8 +880,6 @@ AC_SUBST(EVOLUTION_ADDRESSBOOK_LIBS) fi -AM_CONDITIONAL(BUILD_GEVOLUTION, test "x$build_gevo" = "xyes") - dnl ####################################################################### dnl # Check for XScreenSaver dnl ####################################################################### @@ -889,7 +933,6 @@ AC_DEFINE(USE_SM, 1, [Define if we're using X Session Management.]) fi - AC_DEFUN([GC_TM_GMTOFF], [AC_REQUIRE([AC_STRUCT_TM])dnl AC_CACHE_CHECK([for tm_gmtoff in struct tm], ac_cv_struct_tm_gmtoff, @@ -901,6 +944,30 @@ fi ]) +dnl Thanks, Evan. +if test "$enable_gtkspell" = yes ; then + PKG_CHECK_MODULES(GTKSPELL, gtkspell-2.0 >= 2.0.2, [], [ + AC_MSG_RESULT(no) + enable_gtkspell=no + ]) + if test "$enable_gtkspell" = "yes" ; then + AC_SUBST(GTKSPELL_CFLAGS) + AC_SUBST(GTKSPELL_LIBS) + AC_DEFINE(USE_GTKSPELL,,[do we have gtkspell?]) + fi +fi +else # GTK + enable_gevolution=no + enable_sm=no + enable_xss=no + enable_startup_notification=no + enable_gtkspell=no +fi # GTK + +AM_CONDITIONAL(ENABLE_GTK, test "x$enable_gtk" = "xyes") + +AM_CONDITIONAL(BUILD_GEVOLUTION, test "x$build_gevo" = "xyes") + GC_TM_GMTOFF dnl ####################################################################### @@ -943,6 +1010,7 @@ AC_SUBST(MONO_LIBS) AM_CONDITIONAL(USE_MONO, test x"$enable_mono" = x"yes") +if test "x$enable_gtk" = "xyes"; then # This is for now, since perl still requires GTK+ dnl ####################################################################### dnl # Check for Perl support dnl ####################################################################### @@ -950,6 +1018,10 @@ enable_perl=no fi +else # GTK + enable_perl=no +fi # GTK + if test "$enable_perl" = yes ; then AC_PATH_PROG(perlpath, perl) AC_MSG_CHECKING(for Perl compile flags) @@ -1566,19 +1638,6 @@ AM_CONDITIONAL(USE_TK, false) fi -dnl Thanks, Evan. -if test "$enable_gtkspell" = yes ; then - PKG_CHECK_MODULES(GTKSPELL, gtkspell-2.0 >= 2.0.2, [], [ - AC_MSG_RESULT(no) - enable_gtkspell=no - ]) - if test "$enable_gtkspell" = "yes" ; then - AC_SUBST(GTKSPELL_CFLAGS) - AC_SUBST(GTKSPELL_LIBS) - AC_DEFINE(USE_GTKSPELL,,[do we have gtkspell?]) - fi -fi - if test "$ac_cv_cygwin" = yes ; then LDADD="$LDADD -static" AC_DEFINE(DEBUG, 1, [Define if debugging is enabled.]) @@ -1748,43 +1807,47 @@ doc/gaim.1 doc/gntgaim.1 m4macros/Makefile - pixmaps/Makefile - pixmaps/smileys/Makefile - pixmaps/smileys/default/Makefile - pixmaps/smileys/none/Makefile - pixmaps/status/Makefile - pixmaps/status/default/Makefile - plugins/Makefile - plugins/docklet/Makefile - plugins/gevolution/Makefile - plugins/gestures/Makefile - plugins/mono/Makefile - plugins/mono/api/Makefile - plugins/mono/loader/Makefile - plugins/musicmessaging/Makefile - plugins/perl/Makefile - plugins/perl/common/Makefile.PL - plugins/ssl/Makefile - plugins/tcl/Makefile - plugins/ticker/Makefile + gtk/Makefile + gtk/pixmaps/Makefile + gtk/pixmaps/smileys/Makefile + gtk/pixmaps/smileys/default/Makefile + gtk/pixmaps/smileys/none/Makefile + gtk/pixmaps/status/Makefile + gtk/pixmaps/status/default/Makefile + gtk/plugins/Makefile + gtk/plugins/docklet/Makefile + gtk/plugins/gevolution/Makefile + gtk/plugins/gestures/Makefile + gtk/plugins/musicmessaging/Makefile + gtk/sounds/Makefile + gtk/plugins/ticker/Makefile + core/plugins/Makefile + core/plugins/mono/Makefile + core/plugins/mono/api/Makefile + core/plugins/mono/loader/Makefile + core/plugins/perl/Makefile + core/plugins/perl/common/Makefile.PL + core/plugins/ssl/Makefile + core/plugins/tcl/Makefile + core/Makefile + core/protocols/Makefile + core/protocols/bonjour/Makefile + core/protocols/gg/Makefile + core/protocols/irc/Makefile + core/protocols/jabber/Makefile + core/protocols/msn/Makefile + core/protocols/novell/Makefile + core/protocols/oscar/Makefile + core/protocols/qq/Makefile + core/protocols/sametime/Makefile + core/protocols/silc/Makefile + core/protocols/simple/Makefile + core/protocols/toc/Makefile + core/protocols/yahoo/Makefile + core/protocols/zephyr/Makefile + console/Makefile + console/plugins/Makefile po/Makefile.in - sounds/Makefile - src/Makefile - src/protocols/Makefile - src/protocols/bonjour/Makefile - src/protocols/gg/Makefile - src/protocols/irc/Makefile - src/protocols/jabber/Makefile - src/protocols/msn/Makefile - src/protocols/novell/Makefile - src/protocols/oscar/Makefile - src/protocols/qq/Makefile - src/protocols/sametime/Makefile - src/protocols/silc/Makefile - src/protocols/simple/Makefile - src/protocols/toc/Makefile - src/protocols/yahoo/Makefile - src/protocols/zephyr/Makefile gaim.pc gaim.spec ]) @@ -1797,7 +1860,12 @@ echo Protocols to link statically.. : $STATIC_PRPLS echo Protocols to build dynamically : $DYNAMIC_PRPLS echo -echo UI Library.................... : GTK+ 2.x +if test "x$enable_gtk" = "xyes" ; then +echo GTK UI Library................ : GTK+ 2.x +else +echo GTK UI Library................ : None +fi +echo Build with GNT Console UI..... : $enable_gnt echo SSL Library/Libraries......... : $msg_ssl echo echo Build with GStreamer support.. : $enable_gst @@ -1808,7 +1876,7 @@ echo Build with Tk support......... : $enable_tk echo Build with GtkSpell support... : $enable_gtkspell echo Build with DBUS support....... : $enable_dbus -if test x$enable_dbus = xyes ; then +if test "x$enable_dbus" = "xyes" ; then eval echo DBUS servies directory........ : $DBUS_SERVICES_DIR fi echo Build with Cyrus SASL support. : $enable_cyrus_sasl Copied: trunk/gtk/win32 (from rev 16857, trunk/src/win32) Deleted: trunk/src/account.c =================================================================== --- trunk/src/account.c 2006-08-19 01:19:33 UTC (rev 16857) +++ trunk/src/account.c 2006-08-19 01:29:53 UTC (rev 16858) @@ -1,2364 +0,0 @@ -/** - * @file account.c Account API - * @ingroup core - * - * gaim - * - * Gaim is the legal property of its developers, whose names are too numerous - * to list here. Please refer to the COPYRIGHT file distributed with this - * source distribution. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#include "internal.h" -#include "account.h" -#include "core.h" -#include "dbus-maybe.h" -#include "debug.h" -#include "notify.h" -#include "pounce.h" -#include "prefs.h" -#include "privacy.h" -#include "prpl.h" -#include "request.h" -#include "server.h" -#include "signals.h" -#include "status.h" -#include "util.h" -#include "xmlnode.h" - -/* TODO: Should use GaimValue instead of this? What about "ui"? */ -typedef struct -{ - GaimPrefType type; - - char *ui; - - union - { - int integer; - char *string; - gboolean bool; - - } value; - -} GaimAccountSetting; - - -static GaimAccountUiOps *account_ui_ops = NULL; - -static GList *accounts = NULL; -static guint save_timer = 0; -static gboolean accounts_loaded = FALSE; - - -/********************************************************************* - * Writing to disk * - *********************************************************************/ - -static void -setting_to_xmlnode(gpointer key, gpointer value, gpointer user_data) -{ - const char *name; - GaimAccountSetting *setting; - xmlnode *node, *child; - char buf[20]; - - name = (const char *)key; - setting = (GaimAccountSetting *)value; - node = (xmlnode *)user_data; - - child = xmlnode_new_child(node, "setting"); - xmlnode_set_attrib(child, "name", name); - - if (setting->type == GAIM_PREF_INT) { - xmlnode_set_attrib(child, "type", "int"); - snprintf(buf, sizeof(buf), "%d", setting->value.integer); - xmlnode_insert_data(child, buf, -1); - } - else if (setting->type == GAIM_PREF_STRING && setting->value.string != NULL) { - xmlnode_set_attrib(child, "type", "string"); - xmlnode_insert_data(child, setting->value.string, -1); - } - else if (setting->type == GAIM_PREF_BOOLEAN) { - xmlnode_set_attrib(child, "type", "bool"); - snprintf(buf, sizeof(buf), "%d", setting->value.bool); - xmlnode_insert_data(child, buf, -1); - } -} - -static void -ui_setting_to_xmlnode(gpointer key, gpointer value, gpointer user_data) -{ - const char *ui; - GHashTable *table; - xmlnode *node, *child; - - ui = (const char *)key; - table = (GHashTable *)value; - node = (xmlnode *)user_data; - - if (g_hash_table_size(table) > 0) - { - child = xmlnode_new_child(node, "settings"); - xmlnode_set_attrib(child, "ui", ui); - g_hash_table_foreach(table, setting_to_xmlnode, child); - } -} - -static xmlnode * -status_attr_to_xmlnode(const GaimStatus *status, const GaimStatusType *type, const GaimStatusAttr *attr) -{ - xmlnode *node; - const char *id; - char *value = NULL; - GaimStatusAttr *default_attr; - GaimValue *default_value; - GaimType attr_type; - GaimValue *attr_value; - - id = gaim_status_attr_get_id(attr); - g_return_val_if_fail(id, NULL); - - attr_value = gaim_status_get_attr_value(status, id); - g_return_val_if_fail(attr_value, NULL); - attr_type = gaim_value_get_type(attr_value); - - /* - * If attr_value is a different type than it should be - * then don't write it to the file. - */ - default_attr = gaim_status_type_get_attr(type, id); - default_value = gaim_status_attr_get_value(default_attr); - if (attr_type != gaim_value_get_type(default_value)) - return NULL; - - /* - * If attr_value is the same as the default for this status - * then there is no need to write it to the file. - */ - if (attr_type == GAIM_TYPE_STRING) - { - const char *string_value = gaim_value_get_string(attr_value); - const char *default_string_value = gaim_value_get_string(default_value); - if (((string_value == NULL) && (default_string_value == NULL)) || - ((string_value != NULL) && (default_string_value != NULL) && - !strcmp(string_value, default_string_value))) - return NULL; - value = g_strdup(gaim_value_get_string(attr_value)); - } - else if (attr_type == GAIM_TYPE_INT) - { - int int_value = gaim_value_get_int(attr_value); - if (int_value == gaim_value_get_int(default_value)) - return NULL; - value = g_strdup_printf("%d", int_value); - } - else if (attr_type == GAIM_TYPE_BOOLEAN) - { - gboolean boolean_value = gaim_value_get_boolean(attr_value); - if (boolean_value == gaim_value_get_boolean(default_value)) - return NULL; - value = g_strdup(boolean_value ? - "true" : "false"); - } - else - { - return NULL; - } - - g_return_val_if_fail(value, NULL); - - node = xmlnode_new("attribute"); - - xmlnode_set_attrib(node, "id", id); - xmlnode_set_attrib(node, "value", value); - - g_free(value); - - return node; -} - -static xmlnode * -status_attrs_to_xmlnode(const GaimStatus *status) -{ - GaimStatusType *type = gaim_status_get_type(status); - xmlnode *node, *child; - const GList *attrs, *attr; - - node = xmlnode_new("attributes"); - - attrs = gaim_status_type_get_attrs(type); - for (attr = attrs; attr != NULL; attr = attr->next) - { - child = status_attr_to_xmlnode(status, type, (const GaimStatusAttr *)attr->data); - if (child) - xmlnode_insert_child(node, child); - } - - return node; -} - -static xmlnode * -status_to_xmlnode(const GaimStatus *status) -{ - xmlnode *node, *child; - - node = xmlnode_new("status"); - xmlnode_set_attrib(node, "type", gaim_status_get_id(status)); - if (gaim_status_get_name(status) != NULL) - xmlnode_set_attrib(node, "name", gaim_status_get_name(status)); - xmlnode_set_attrib(node, "active", gaim_status_is_active(status) ? "true" : "false"); - - child = status_attrs_to_xmlnode(status); - xmlnode_insert_child(node, child); - - return node; -} - -static xmlnode * -statuses_to_xmlnode(const GaimPresence *presence) -{ - xmlnode *node, *child; - const GList *statuses, *status; - - node = xmlnode_new("statuses"); - - statuses = gaim_presence_get_statuses(presence); - for (status = statuses; status != NULL; status = status->next) - { - child = status_to_xmlnode((GaimStatus *)status->data); - xmlnode_insert_child(node, child); - } - - return node; -} - -static xmlnode * -proxy_settings_to_xmlnode(GaimProxyInfo *proxy_info) -{ - xmlnode *node, *child; - GaimProxyType proxy_type; - const char *value; - int int_value; - char buf[20]; - - proxy_type = gaim_proxy_info_get_type(proxy_info); - - node = xmlnode_new("proxy"); - - child = xmlnode_new_child(node, "type"); - xmlnode_insert_data(child, - (proxy_type == GAIM_PROXY_USE_GLOBAL ? "global" : - proxy_type == GAIM_PROXY_NONE ? "none" : - proxy_type == GAIM_PROXY_HTTP ? "http" : - proxy_type == GAIM_PROXY_SOCKS4 ? "socks4" : - proxy_type == GAIM_PROXY_SOCKS5 ? "socks5" : - proxy_type == GAIM_PROXY_USE_ENVVAR ? "envvar" : "unknown"), -1); - - if (proxy_type != GAIM_PROXY_USE_GLOBAL && - proxy_type != GAIM_PROXY_NONE && - proxy_type != GAIM_PROXY_USE_ENVVAR) - { - if ((value = gaim_proxy_info_get_host(proxy_info)) != NULL) - { - child = xmlnode_new_child(node, "host"); - xmlnode_insert_data(child, value, -1); - } - - if ((int_value = gaim_proxy_info_get_port(proxy_info)) != 0) - { - snprintf(buf, sizeof(buf), "%d", int_value); - child = xmlnode_new_child(node, "port"); - xmlnode_insert_data(child, buf, -1); - } - - if ((value = gaim_proxy_info_get_username(proxy_info)) != NULL) - { - child = xmlnode_new_child(node, "username"); - xmlnode_insert_data(child, value, -1); - } - - if ((value = gaim_proxy_info_get_password(proxy_info)) != NULL) - { - child = xmlnode_new_child(node, "password"); - xmlnode_insert_data(child, value, -1); - } - } - - return node; -} - -static xmlnode * -account_to_xmlnode(GaimAccount *account) -{ - xmlnode *node, *child; - const char *tmp; - GaimPresence *presence; - GaimProxyInfo *proxy_info; - - node = xmlnode_new("account"); - - child = xmlnode_new_child(node, "protocol"); - xmlnode_insert_data(child, gaim_account_get_protocol_id(account), -1); - - child = xmlnode_new_child(node, "name"); - xmlnode_insert_data(child, gaim_account_get_username(account), -1); - - if (gaim_account_get_remember_password(account) && - ((tmp = gaim_account_get_password(account)) != NULL)) - { - child = xmlnode_new_child(node, "password"); - xmlnode_insert_data(child, tmp, -1); - } - - if ((tmp = gaim_account_get_alias(account)) != NULL) - { - child = xmlnode_new_child(node, "alias"); - xmlnode_insert_data(child, tmp, -1); - } - - if ((presence = gaim_account_get_presence(account)) != NULL) - { - child = statuses_to_xmlnode(presence); - xmlnode_insert_child(node, child); - } - - if ((tmp = gaim_account_get_user_info(account)) != NULL) - { - /* TODO: Do we need to call gaim_str_strip_char(tmp, '\r') here? */ - child = xmlnode_new_child(node, "userinfo"); - xmlnode_insert_data(child, tmp, -1); - } - - if ((tmp = gaim_account_get_buddy_icon(account)) != NULL) - { - child = xmlnode_new_child(node, "buddyicon"); - xmlnode_insert_data(child, tmp, -1); - } - - if (g_hash_table_size(account->settings) > 0) - { - child = xmlnode_new_child(node, "settings"); - g_hash_table_foreach(account->settings, setting_to_xmlnode, child); - } - - if (g_hash_table_size(account->ui_settings) > 0) - { - g_hash_table_foreach(account->ui_settings, ui_setting_to_xmlnode, node); - } - - if ((proxy_info = gaim_account_get_proxy_info(account)) != NULL) - { - child = proxy_settings_to_xmlnode(proxy_info); - xmlnode_insert_child(node, child); - } - - return node; -} - -static xmlnode * -accounts_to_xmlnode(void) -{ - xmlnode *node, *child; - GList *cur; - - node = xmlnode_new("account"); - xmlnode_set_attrib(node, "version", "1.0"); - - for (cur = gaim_accounts_get_all(); cur != NULL; cur = cur->next) - { - child = account_to_xmlnode(cur->data); - xmlnode_insert_child(node, child); - } - - return node; -} - -static void -sync_accounts(void) -{ - xmlnode *node; - char *data; - - if (!accounts_loaded) - { - gaim_debug_error("account", "Attempted to save accounts before " - "they were read!\n"); - return; - } - - node = accounts_to_xmlnode(); - data = xmlnode_to_formatted_str(node, NULL); - gaim_util_write_data_to_file("accounts.xml", data, -1); - g_free(data); - xmlnode_free(node); -} - -static gboolean -save_cb(gpointer data) -{ - sync_accounts(); - save_timer = 0; - return FALSE; -} - -static void -schedule_accounts_save() -{ - if (save_timer == 0) - save_timer = gaim_timeout_add(5000, save_cb, NULL); -} - - -/********************************************************************* - * Reading from disk * - *********************************************************************/ - -static void -parse_settings(xmlnode *node, GaimAccount *account) -{ - const char *ui; - xmlnode *child; - - /* Get the UI string, if these are UI settings */ - ui = xmlnode_get_attrib(node, "ui"); - - /* Read settings, one by one */ - for (child = xmlnode_get_child(node, "setting"); child != NULL; - child = xmlnode_get_next_twin(child)) - { - const char *name, *str_type; - GaimPrefType type; - char *data; - - name = xmlnode_get_attrib(child, "name"); - if (name == NULL) - /* Ignore this setting */ - continue; - - str_type = xmlnode_get_attrib(child, "type"); - if (str_type == NULL) - /* Ignore this setting */ - continue; - - if (!strcmp(str_type, "string")) - type = GAIM_PREF_STRING; - else if (!strcmp(str_type, "int")) - type = GAIM_PREF_INT; - else if (!strcmp(str_type, "bool")) - type = GAIM_PREF_BOOLEAN; - else - /* Ignore this setting */ - continue; - - data = xmlnode_get_data(child); - if (data == NULL) - /* Ignore this setting */ - continue; - - if (ui == NULL) - { - if (type == GAIM_PREF_STRING) - gaim_account_set_string(account, name, data); - else if (type == GAIM_PREF_INT) - gaim_account_set_int(account, name, atoi(data)); - else if (type == GAIM_PREF_BOOLEAN) - gaim_account_set_bool(account, name, - (*data == '0' ? FALSE : TRUE)); - } else { - if (type == GAIM_PREF_STRING) - gaim_account_set_ui_string(account, ui, name, data); - else if (type == GAIM_PREF_INT) - gaim_account_set_ui_int(account, ui, name, atoi(data)); - else if (type == GAIM_PREF_BOOLEAN) - gaim_account_set_ui_bool(account, ui, name, - (*data == '0' ? FALSE : TRUE)); - } - - g_free(data); - } -} - -static GList * -parse_status_attrs(xmlnode *node, GaimStatus *status) -{ - GList *list = NULL; - xmlnode *child; - GaimValue *attr_value; - - for (child = xmlnode_get_child(node, "attribute"); child != NULL; - child = xmlnode_get_next_twin(child)) - { - const char *id = xmlnode_get_attrib(child, "id"); - const char *value = xmlnode_get_attrib(child, "value"); - - if (!id || !*id || !value || !*value) - continue; - - attr_value = gaim_status_get_attr_value(status, id); - if (!attr_value) - continue; - - list = g_list_append(list, (char *)id); - - switch (gaim_value_get_type(attr_value)) - { - case GAIM_TYPE_STRING: - list = g_list_append(list, (char *)value); - break; - case GAIM_TYPE_INT: - case GAIM_TYPE_BOOLEAN: - { - int v; - if (sscanf(value, "%d", &v) == 1) - list = g_list_append(list, GINT_TO_POINTER(v)); - else - list = g_list_remove(list, id); - break; - } - default: - break; - } - } - - return list; -} - -static void -parse_status(xmlnode *node, GaimAccount *account) -{ - gboolean active = FALSE; - const char *data; - const char *type; - xmlnode *child; - GList *attrs = NULL; - - /* Get the active/inactive state */ - data = xmlnode_get_attrib(node, "active"); - if (data == NULL) - return; - if (strcasecmp(data, "true") == 0) - active = TRUE; - else if (strcasecmp(data, "false") == 0) - active = FALSE; - else - return; - - /* Get the type of the status */ - type = xmlnode_get_attrib(node, "type"); - if (type == NULL) - return; - - /* Read attributes into a GList */ - child = xmlnode_get_child(node, "attributes"); - if (child != NULL) - { - attrs = parse_status_attrs(child, - gaim_account_get_status(account, type)); - } - - gaim_account_set_status_list(account, type, active, attrs); - - g_list_free(attrs); -} - -static void -parse_statuses(xmlnode *node, GaimAccount *account) -{ - xmlnode *child; - - for (child = xmlnode_get_child(node, "status"); child != NULL; - child = xmlnode_get_next_twin(child)) - { - parse_status(child, account); - } -} - -static void -parse_proxy_info(xmlnode *node, GaimAccount *account) -{ - GaimProxyInfo *proxy_info; - xmlnode *child; - char *data; - - proxy_info = gaim_proxy_info_new(); - - /* Use the global proxy settings, by default */ - gaim_proxy_info_set_type(proxy_info, GAIM_PROXY_USE_GLOBAL); - - /* Read proxy type */ - child = xmlnode_get_child(node, "type"); - if ((child != NULL) && ((data = xmlnode_get_data(child)) != NULL)) - { - if (!strcmp(data, "global")) - gaim_proxy_info_set_type(proxy_info, GAIM_PROXY_USE_GLOBAL); - else if (!strcmp(data, "none")) - gaim_proxy_info_set_type(proxy_info, GAIM_PROXY_NONE); - else if (!strcmp(data, "http")) - gaim_proxy_info_set_type(proxy_info, GAIM_PROXY_HTTP); - else if (!strcmp(data, "socks4")) - gaim_proxy_info_set_type(proxy_info, GAIM_PROXY_SOCKS4); - else if (!strcmp(data, "socks5")) - gaim_proxy_info_set_type(proxy_info, GAIM_PROXY_SOCKS5); - else if (!strcmp(data, "envvar")) - gaim_proxy_info_set_type(proxy_info, GAIM_PROXY_USE_ENVVAR); - else - { - gaim_debug_error("account", "Invalid proxy type found when " - "loading account information for %s\n", - gaim_account_get_username(account)); - } - g_free(data); - } - - /* Read proxy host */ - child = xmlnode_get_child(node, "host"); - if ((child != NULL) && ((data = xmlnode_get_data(child)) != NULL)) - { - gaim_proxy_info_set_host(proxy_info, data); - g_free(data); - } - - /* Read proxy port */ - child = xmlnode_get_child(node, "port"); - if ((child != NULL) && ((data = xmlnode_get_data(child)) != NULL)) - { - gaim_proxy_info_set_port(proxy_info, atoi(data)); - g_free(data); - } - - /* Read proxy username */ - child = xmlnode_get_child(node, "username"); - if ((child != NULL) && ((data = xmlnode_get_data(child)) != NULL)) - { - gaim_proxy_info_set_username(proxy_info, data); - g_free(data); - } - - /* Read proxy password */ - child = xmlnode_get_child(node, "password"); - if ((child != NULL) && ((data = xmlnode_get_data(child)) != NULL)) - { - gaim_proxy_info_set_password(proxy_info, data); - g_free(data); - } - - /* If there are no values set then proxy_infourn NULL */ - if ((gaim_proxy_info_get_type(proxy_info) == GAIM_PROXY_USE_GLOBAL) && - (gaim_proxy_info_get_host(proxy_info) == NULL) && - (gaim_proxy_info_get_port(proxy_info) == 0) && - (gaim_proxy_info_get_username(proxy_info) == NULL) && - (gaim_proxy_info_get_password(proxy_info) == NULL)) - { - gaim_proxy_info_destroy(proxy_info); - return; - } - - gaim_account_set_proxy_info(account, proxy_info); -} - -static GaimAccount * -parse_account(xmlnode *node) -{ - GaimAccount *ret; - xmlnode *child; - char *protocol_id = NULL; - char *name = NULL; - char *data; - - child = xmlnode_get_child(node, "protocol"); - if (child != NULL) - protocol_id = xmlnode_get_data(child); - - child = xmlnode_get_child(node, "name"); - if (child != NULL) - name = xmlnode_get_data(child); - if (name == NULL) - { - /* Do we really need to do this? */ - child = xmlnode_get_child(node, "username"); - if (child != NULL) - name = xmlnode_get_data(child); - } - - if ((protocol_id == NULL) || (name == NULL)) - { - g_free(protocol_id); - g_free(name); - return NULL; - } - - ret = gaim_account_new(name, protocol_id); - g_free(name); - g_free(protocol_id); - - /* Read the password */ - child = xmlnode_get_child(node, "password"); - if ((child != NULL) && ((data = xmlnode_get_data(child)) != NULL)) - { - gaim_account_set_remember_password(ret, TRUE); - gaim_account_set_password(ret, data); - g_free(data); - } - - /* Read the alias */ - child = xmlnode_get_child(node, "alias"); - if ((child != NULL) && ((data = xmlnode_get_data(child)) != NULL)) - { - if (*data != '\0') - gaim_account_set_alias(ret, data); - g_free(data); - } - - /* Read the statuses */ - child = xmlnode_get_child(node, "statuses"); - if (child != NULL) - { - parse_statuses(child, ret); - } - - /* Read the userinfo */ - child = xmlnode_get_child(node, "userinfo"); - if ((child != NULL) && ((data = xmlnode_get_data(child)) != NULL)) - { - gaim_account_set_user_info(ret, data); - g_free(data); - } - - /* Read the buddyicon */ - child = xmlnode_get_child(node, "buddyicon"); - if ((child != NULL) && ((data = xmlnode_get_data(child)) != NULL)) - { - gaim_account_set_buddy_icon(ret, data); - g_free(data); - } - - /* Read settings (both core and UI) */ - for (child = xmlnode_get_child(node, "settings"); child != NULL; - child = xmlnode_get_next_twin(child)) - { - parse_settings(child, ret); - } - - /* Read proxy */ - child = xmlnode_get_child(node, "proxy"); - if (child != NULL) - { - parse_proxy_info(child, ret); - } - - return ret; -} - -static void -load_accounts(void) -{ - xmlnode *node, *child; - - accounts_loaded = TRUE; - - node = gaim_util_read_xml_from_file("accounts.xml", _("accounts")); - - if (node == NULL) - return; - - for (child = xmlnode_get_child(node, "account"); child != NULL; - child = xmlnode_get_next_twin(child)) - { - GaimAccount *new_acct; - new_acct = parse_account(child); - gaim_accounts_add(new_acct); - } - - xmlnode_free(node); -} - - -static void -delete_setting(void *data) -{ - GaimAccountSetting *setting = (GaimAccountSetting *)data; - - g_free(setting->ui); - - if (setting->type == GAIM_PREF_STRING) - g_free(setting->value.string); - - g_free(setting); -} - -GaimAccount * -gaim_account_new(const char *username, const char *protocol_id) -{ - GaimAccount *account = NULL; - GaimPlugin *prpl = NULL; - GaimPluginProtocolInfo *prpl_info = NULL; - GaimStatusType *status_type; - - g_return_val_if_fail(username != NULL, NULL); - g_return_val_if_fail(protocol_id != NULL, NULL); - - account = gaim_accounts_find(username, protocol_id); - - if (account != NULL) - return account; - - account = g_new0(GaimAccount, 1); - GAIM_DBUS_REGISTER_POINTER(account, GaimAccount); - - gaim_account_set_username(account, username); - - gaim_account_set_protocol_id(account, protocol_id); - - account->settings = g_hash_table_new_full(g_str_hash, g_str_equal, - g_free, delete_setting); - account->ui_settings = g_hash_table_new_full(g_str_hash, g_str_equal, - g_free, (GDestroyNotify)g_hash_table_destroy); - account->system_log = NULL; - /* 0 is not a valid privacy setting */ - account->perm_deny = GAIM_PRIVACY_ALLOW_ALL; - - account->presence = gaim_presence_new_for_account(account); - - prpl = gaim_find_prpl(protocol_id); - - if (prpl == NULL) - return account; - - prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(prpl); - if (prpl_info != NULL && prpl_info->status_types != NULL) - gaim_account_set_status_types(account, prpl_info->status_types(account)); - - status_type = gaim_account_get_status_type_with_primitive(account, GAIM_STATUS_AVAILABLE); - if (status_type != NULL) - gaim_presence_set_status_active(account->presence, - gaim_status_type_get_id(status_type), - TRUE); - else - gaim_presence_set_status_active(account->presence, - "offline", - TRUE); - - return account; -} - -void -gaim_account_destroy(GaimAccount *account) -{ - GList *l; - - g_return_if_fail(account != NULL); - - gaim_debug_info("account", "Destroying account %p\n", account); - - for (l = gaim_get_conversations(); l != NULL; l = l->next) - { - GaimConversation *conv = (GaimConversation *)l->data; - - if (gaim_conversation_get_account(conv) == account) - gaim_conversation_set_account(conv, NULL); - } - - g_free(account->username); - g_free(account->alias); - g_free(account->password); - g_free(account->user_info); - g_free(account->protocol_id); - - g_hash_table_destroy(account->settings); - g_hash_table_destroy(account->ui_settings); - - gaim_account_set_status_types(account, NULL); - - gaim_presence_destroy(account->presence); - - if(account->system_log) - gaim_log_free(account->system_log); - - GAIM_DBUS_UNREGISTER_POINTER(account); - g_free(account); -} - -void -gaim_account_register(GaimAccount *account) -{ - g_return_if_fail(account != NULL); - - gaim_debug_info("account", "Registering account %s\n", - gaim_account_get_username(account)); - - gaim_connection_new(account, TRUE, NULL); -} - -static void -request_password_ok_cb(GaimAccount *account, GaimRequestFields *fields) -{ - const char *entry; - gboolean remember; - - entry = gaim_request_fields_get_string(fields, "password"); - remember = gaim_request_fields_get_bool(fields, "remember"); - - if (!entry || !*entry) - { - gaim_notify_error(account, NULL, _("Password is required to sign on."), NULL); - return; - } - - if(remember) - gaim_account_set_remember_password(account, TRUE); - - gaim_account_set_password(account, entry); - - gaim_connection_new(account, FALSE, entry); -} - -static void -request_password(GaimAccount *account) -{ - gchar *primary; - const gchar *username; - GaimRequestFieldGroup *group; - GaimRequestField *field; - GaimRequestFields *fields; - - /* Close any previous password request windows */ - gaim_request_close_with_handle(account); - - username = gaim_account_get_username(account); - primary = g_strdup_printf(_("Enter password for %s (%s)"), username, - gaim_account_get_protocol_name(account)); - - fields = gaim_request_fields_new(); - group = gaim_request_field_group_new(NULL); - gaim_request_fields_add_group(fields, group); - - field = gaim_request_field_string_new("password", _("Enter Password"), NULL, FALSE); - gaim_request_field_string_set_masked(field, TRUE); - gaim_request_field_set_required(field, TRUE); - gaim_request_field_group_add_field(group, field); - - field = gaim_request_field_bool_new("remember", _("Save password"), FALSE); - gaim_request_field_group_add_field(group, field); - - gaim_request_fields(account, - NULL, - primary, - NULL, - fields, - _("OK"), G_CALLBACK(request_password_ok_cb), - _("Cancel"), NULL, - account); - g_free(primary); -} - -void -gaim_account_connect(GaimAccount *account) -{ - GaimPlugin *prpl; - GaimPluginProtocolInfo *prpl_info; - const char *password; - - g_return_if_fail(account != NULL); - - gaim_debug_info("account", "Connecting to account %s\n", - gaim_account_get_username(account)); - - if (!gaim_account_get_enabled(account, gaim_core_get_ui())) - return; - - prpl = gaim_find_prpl(gaim_account_get_protocol_id(account)); - if (prpl == NULL) - { - gchar *message; - - message = g_strdup_printf(_("Missing protocol plugin for %s"), - gaim_account_get_username(account)); - gaim_notify_error(account, _("Connection Error"), message, NULL); - g_free(message); - return; - } - - prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(prpl); - password = gaim_account_get_password(account); - if ((password == NULL) && - !(prpl_info->options & OPT_PROTO_NO_PASSWORD) && - !(prpl_info->options & OPT_PROTO_PASSWORD_OPTIONAL)) - request_password(account); - else - gaim_connection_new(account, FALSE, password); -} - -void -gaim_account_disconnect(GaimAccount *account) -{ - GaimConnection *gc; - - g_return_if_fail(account != NULL); - g_return_if_fail(!gaim_account_is_disconnected(account)); - - gaim_debug_info("account", "Disconnecting account %p\n", account); - - account->disconnecting = TRUE; - - gc = gaim_account_get_connection(account); - gaim_connection_destroy(gc); - if (!gaim_account_get_remember_password(account)) - gaim_account_set_password(account, NULL); - gaim_account_set_connection(account, NULL); - - account->disconnecting = FALSE; -} - -void -gaim_account_notify_added(GaimAccount *account, const char *remote_user, - const char *id, const char *alias, - const char *message) -{ - GaimAccountUiOps *ui_ops; - - g_return_if_fail(account != NULL); - g_return_if_fail(remote_user != NULL); - - ui_ops = gaim_accounts_get_ui_ops(); - - if (ui_ops != NULL && ui_ops->notify_added != NULL) - ui_ops->notify_added(account, remote_user, id, alias, message); -} - -void -gaim_account_request_add(GaimAccount *account, const char *remote_user, - const char *id, const char *alias, - const char *message) -{ - GaimAccountUiOps *ui_ops; - - g_return_if_fail(account != NULL); - g_return_if_fail(remote_user != NULL); - - ui_ops = gaim_accounts_get_ui_ops(); - - if (ui_ops != NULL && ui_ops->request_add != NULL) - ui_ops->request_add(account, remote_user, id, alias, message); -} - -static void -change_password_cb(GaimAccount *account, GaimRequestFields *fields) -{ - const char *orig_pass, *new_pass_1, *new_pass_2; - - orig_pass = gaim_request_fields_get_string(fields, "password"); - new_pass_1 = gaim_request_fields_get_string(fields, "new_password_1"); - new_pass_2 = gaim_request_fields_get_string(fields, "new_password_2"); - - if (g_utf8_collate(new_pass_1, new_pass_2)) - { - gaim_notify_error(account, NULL, - _("New passwords do not match."), NULL); - - return; - } - - if (orig_pass == NULL || new_pass_1 == NULL || new_pass_2 == NULL || - *orig_pass == '\0' || *new_pass_1 == '\0' || *new_pass_2 == '\0') - { - gaim_notify_error(account, NULL, - _("Fill out all fields completely."), NULL); - return; - } - - gaim_account_change_password(account, orig_pass, new_pass_1); -} - -void -gaim_account_request_change_password(GaimAccount *account) -{ - GaimRequestFields *fields; - GaimRequestFieldGroup *group; - GaimRequestField *field; - char primary[256]; - - g_return_if_fail(account != NULL); - g_return_if_fail(gaim_account_is_connected(account)); - - fields = gaim_request_fields_new(); - - group = gaim_request_field_group_new(NULL); - gaim_request_fields_add_group(fields, group); - - field = gaim_request_field_string_new("password", _("Original password"), - NULL, FALSE); - gaim_request_field_string_set_masked(field, TRUE); - gaim_request_field_set_required(field, TRUE); - gaim_request_field_group_add_field(group, field); - - field = gaim_request_field_string_new("new_password_1", - _("New password"), - NULL, FALSE); - gaim_request_field_string_set_masked(field, TRUE); - gaim_request_field_set_required(field, TRUE); - gaim_request_field_group_add_field(group, field); - - field = gaim_request_field_string_new("new_password_2", - _("New password (again)"), - NULL, FALSE); - gaim_request_field_string_set_masked(field, TRUE); - gaim_request_field_set_required(field, TRUE); - gaim_request_field_group_add_field(group, field); - - g_snprintf(primary, sizeof(primary), _("Change password for %s"), - gaim_account_get_username(account)); - - /* I'm sticking this somewhere in the code: bologna */ - - gaim_request_fields(gaim_account_get_connection(account), - NULL, - primary, - _("Please enter your current password and your " - "new password."), - fields, - _("OK"), G_CALLBACK(change_password_cb), - _("Cancel"), NULL, - account); -} - -static void -set_user_info_cb(GaimAccount *account, const char *user_info) -{ - GaimConnection *gc; - - gaim_account_set_user_info(account, user_info); - - gc = gaim_account_get_connection(account); - - if (gc != NULL) - serv_set_info(gc, user_info); -} - -void -gaim_account_request_change_user_info(GaimAccount *account) -{ - GaimConnection *gc; - char primary[256]; - - g_return_if_fail(account != NULL); - g_return_if_fail(gaim_account_is_connected(account)); - - gc = gaim_account_get_connection(account); - - g_snprintf(primary, sizeof(primary), - _("Change user information for %s"), - gaim_account_get_username(account)); - - gaim_request_input(gc, _("Set User Info"), primary, NULL, - gaim_account_get_user_info(account), - TRUE, FALSE, ((gc != NULL) && - (gc->flags & GAIM_CONNECTION_HTML) ? "html" : NULL), - _("Save"), G_CALLBACK(set_user_info_cb), - _("Cancel"), NULL, account); -} - -void -gaim_account_set_username(GaimAccount *account, const char *username) -{ - g_return_if_fail(account != NULL); - - g_free(account->username); - account->username = g_strdup(username); - - schedule_accounts_save(); -} - -void -gaim_account_set_password(GaimAccount *account, const char *password) -{ - g_return_if_fail(account != NULL); - - g_free(account->password); - account->password = g_strdup(password); - - schedule_accounts_save(); -} - -void -gaim_account_set_alias(GaimAccount *account, const char *alias) -{ - g_return_if_fail(account != NULL); - - /* - * Do nothing if alias and account->alias are both NULL. Or if - * they're the exact same string. - */ - if (alias == account->alias) - return; - - if ((!alias && account->alias) || (alias && !account->alias) || - g_utf8_collate(account->alias, alias)) - { - char *old = account->alias; - - account->alias = g_strdup(alias); - gaim_signal_emit(gaim_accounts_get_handle(), "account-alias-changed", - account, old); - g_free(old); - - schedule_accounts_save(); - } -} - -void -gaim_account_set_user_info(GaimAccount *account, const char *user_info) -{ - g_return_if_fail(account != NULL); - - g_free(account->user_info); - account->user_info = g_strdup(user_info); - - schedule_accounts_save(); -} - -void -gaim_account_set_buddy_icon(GaimAccount *account, const char *icon) -{ - g_return_if_fail(account != NULL); - - /* Delete an existing icon from the cache. */ - if (account->buddy_icon != NULL && (icon == NULL || strcmp(account->buddy_icon, icon))) - { - const char *dirname = gaim_buddy_icons_get_cache_dir(); - struct stat st; - - if (g_stat(account->buddy_icon, &st) == 0) - { - /* The file exists. This is a full path. */ - - /* XXX: This is a hack so we only delete the file if it's - * in the cache dir. Otherwise, people who upgrade (who - * may have buddy icon filenames set outside of the cache - * dir) could lose files. */ - if (!strncmp(dirname, account->buddy_icon, strlen(dirname))) - g_unlink(account->buddy_icon); - } - else - { - char *filename = g_build_filename(dirname, account->buddy_icon, NULL); - g_unlink(filename); - g_free(filename); - } - } - - g_free(account->buddy_icon); - account->buddy_icon = g_strdup(icon); - if (gaim_account_is_connected(account)) - { - char *filename = gaim_buddy_icons_get_full_path(icon); - serv_set_buddyicon(gaim_account_get_connection(account), filename); - g_free(filename); - } - - schedule_accounts_save(); -} - -void -gaim_account_set_protocol_id(GaimAccount *account, const char *protocol_id) -{ - g_return_if_fail(account != NULL); - g_return_if_fail(protocol_id != NULL); - - g_free(account->protocol_id); - account->protocol_id = g_strdup(protocol_id); - - schedule_accounts_save(); -} - -void -gaim_account_set_connection(GaimAccount *account, GaimConnection *gc) -{ - g_return_if_fail(account != NULL); - - account->gc = gc; -} - -void -gaim_account_set_remember_password(GaimAccount *account, gboolean value) -{ - g_return_if_fail(account != NULL); - - account->remember_pass = value; - - schedule_accounts_save(); -} - -void -gaim_account_set_check_mail(GaimAccount *account, gboolean value) -{ - g_return_if_fail(account != NULL); - - gaim_account_set_bool(account, "check-mail", value); -} - -void -gaim_account_set_enabled(GaimAccount *account, const char *ui, - gboolean value) -{ - GaimConnection *gc; - gboolean was_enabled = FALSE; - - g_return_if_fail(account != NULL); - g_return_if_fail(ui != NULL); - - was_enabled = gaim_account_get_enabled(account, ui); - - gaim_account_set_ui_bool(account, ui, "auto-login", value); - gc = gaim_account_get_connection(account); - - if(was_enabled && !value) - gaim_signal_emit(gaim_accounts_get_handle(), "account-disabled", account); - else if(!was_enabled && value) - gaim_signal_emit(gaim_accounts_get_handle(), "account-enabled", account); - - if ((gc != NULL) && (gc->wants_to_die == TRUE)) - return; - - if (value && gaim_presence_is_online(account->presence)) - gaim_account_connect(account); - else if (!value && !gaim_account_is_disconnected(account)) - gaim_account_disconnect(account); -} - -void -gaim_account_set_proxy_info(GaimAccount *account, GaimProxyInfo *info) -{ - g_return_if_fail(account != NULL); - - if (account->proxy_info != NULL) - gaim_proxy_info_destroy(account->proxy_info); - - account->proxy_info = info; - - schedule_accounts_save(); -} - -void -gaim_account_set_status_types(GaimAccount *account, GList *status_types) -{ - g_return_if_fail(account != NULL); - - /* Old with the old... */ - if (account->status_types != NULL) - { - g_list_foreach(account->status_types, (GFunc)gaim_status_type_destroy, NULL); - g_list_free(account->status_types); - } - - /* In with the new... */ - account->status_types = status_types; -} - -void -gaim_account_set_status(GaimAccount *account, const char *status_id, - gboolean active, ...) -{ - va_list args; - - va_start(args, active); - gaim_account_set_status_vargs(account, status_id, active, args); - va_end(args); -} - -void -gaim_account_set_status_vargs(GaimAccount *account, const char *status_id, - gboolean active, va_list args) -{ - GList *attrs = NULL; - const gchar *id; - gpointer data; - - if (args != NULL) - { - while ((id = va_arg(args, const char *)) != NULL) - { - attrs = g_list_append(attrs, (char *)id); - data = va_arg(args, void *); - attrs = g_list_append(attrs, data); - } - } - gaim_account_set_status_list(account, status_id, active, attrs); - g_list_free(attrs); -} - -void -gaim_account_set_status_list(GaimAccount *account, const char *status_id, - gboolean active, GList *attrs) -{ - GaimStatus *status; - - g_return_if_fail(account != NULL); - g_return_if_fail(status_id != NULL); - - status = gaim_account_get_status(account, status_id); - if (status == NULL) - { - gaim_debug_error("account", - "Invalid status ID %s for account %s (%s)\n", - status_id, gaim_account_get_username(account), - gaim_account_get_protocol_id(account)); - return; - } - - if (active || gaim_status_is_independent(status)) - gaim_status_set_active_with_attrs_list(status, active, attrs); - - /* - * Our current statuses are saved to accounts.xml (so that when we - * reconnect, we go back to the previous status). - */ - schedule_accounts_save(); -} - -void -gaim_account_clear_settings(GaimAccount *account) -{ - g_return_if_fail(account != NULL); - - g_hash_table_destroy(account->settings); - - account->settings = g_hash_table_new_full(g_str_hash, g_str_equal, - g_free, delete_setting); -} - -void -gaim_account_set_int(GaimAccount *account, const char *name, int value) -{ - GaimAccountSetting *setting; - - g_return_if_fail(account != NULL); - g_return_if_fail(name != NULL); - - setting = g_new0(GaimAccountSetting, 1); - - setting->type = GAIM_PREF_INT; - setting->value.integer = value; - - g_hash_table_insert(account->settings, g_strdup(name), setting); - - schedule_accounts_save(); -} - -void -gaim_account_set_string(GaimAccount *account, const char *name, - const char *value) -{ - GaimAccountSetting *setting; - - g_return_if_fail(account != NULL); - g_return_if_fail(name != NULL); - - setting = g_new0(GaimAccountSetting, 1); - - setting->type = GAIM_PREF_STRING; - setting->value.string = g_strdup(value); - - g_hash_table_insert(account->settings, g_strdup(name), setting); - - schedule_accounts_save(); -} - -void -gaim_account_set_bool(GaimAccount *account, const char *name, gboolean value) -{ - GaimAccountSetting *setting; - - g_return_if_fail(account != NULL); - g_return_if_fail(name != NULL); - - setting = g_new0(GaimAccountSetting, 1); - - setting->type = GAIM_PREF_BOOLEAN; - setting->value.bool = value; - - g_hash_table_insert(account->settings, g_strdup(name), setting); - - schedule_accounts_save(); -} - -static GHashTable * -get_ui_settings_table(GaimAccount *account, const char *ui) -{ - GHashTable *table; - - table = g_hash_table_lookup(account->ui_settings, ui); - - if (table == NULL) { - table = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, - delete_setting); - g_hash_table_insert(account->ui_settings, g_strdup(ui), table); - } - - return table; -} - -void -gaim_account_set_ui_int(GaimAccount *account, const char *ui, - const char *name, int value) -{ - GaimAccountSetting *setting; - GHashTable *table; - - g_return_if_fail(account != NULL); - g_return_if_fail(ui != NULL); - g_return_if_fail(name != NULL); - - setting = g_new0(GaimAccountSetting, 1); - - setting->type = GAIM_PREF_INT; - setting->ui = g_strdup(ui); - setting->value.integer = value; - - table = get_ui_settings_table(account, ui); - - g_hash_table_insert(table, g_strdup(name), setting); - - schedule_accounts_save(); -} - -void -gaim_account_set_ui_string(GaimAccount *account, const char *ui, - const char *name, const char *value) -{ - GaimAccountSetting *setting; - GHashTable *table; - - g_return_if_fail(account != NULL); - g_return_if_fail(ui != NULL); - g_return_if_fail(name != NULL); - - setting = g_new0(GaimAccountSetting, 1); - - setting->type = GAIM_PREF_STRING; - setting->ui = g_strdup(ui); - setting->value.string = g_strdup(value); - - table = get_ui_settings_table(account, ui); - - g_hash_table_insert(table, g_strdup(name), setting); - - schedule_accounts_save(); -} - -void -gaim_account_set_ui_bool(GaimAccount *account, const char *ui, - const char *name, gboolean value) -{ - GaimAccountSetting *setting; - GHashTable *table; - - g_return_if_fail(account != NULL); - g_return_if_fail(ui != NULL); - g_return_if_fail(name != NULL); - - setting = g_new0(GaimAccountSetting, 1); - - setting->type = GAIM_PREF_BOOLEAN; - setting->ui = g_strdup(ui); - setting->value.bool = value; - - table = get_ui_settings_table(account, ui); - - g_hash_table_insert(table, g_strdup(name), setting); - - schedule_accounts_save(); -} - -static GaimConnectionState -gaim_account_get_state(const GaimAccount *account) -{ - GaimConnection *gc; - - g_return_val_if_fail(account != NULL, GAIM_DISCONNECTED); - - gc = gaim_account_get_connection(account); - if (!gc) - return GAIM_DISCONNECTED; - - return gaim_connection_get_state(gc); -} - -gboolean -gaim_account_is_connected(const GaimAccount *account) -{ - return (gaim_account_get_state(account) == GAIM_CONNECTED); -} - -gboolean -gaim_account_is_connecting(const GaimAccount *account) -{ - return (gaim_account_get_state(account) == GAIM_CONNECTING); -} - -gboolean -gaim_account_is_disconnected(const GaimAccount *account) -{ - return (gaim_account_get_state(account) == GAIM_DISCONNECTED); -} - -const char * -gaim_account_get_username(const GaimAccount *account) -{ - g_return_val_if_fail(account != NULL, NULL); - - return account->username; -} - -const char * -gaim_account_get_password(const GaimAccount *account) -{ - g_return_val_if_fail(account != NULL, NULL); - - return account->password; -} - -const char * -gaim_account_get_alias(const GaimAccount *account) -{ - g_return_val_if_fail(account != NULL, NULL); - - return account->alias; -} - -const char * -gaim_account_get_user_info(const GaimAccount *account) -{ - g_return_val_if_fail(account != NULL, NULL); - - return account->user_info; -} - -const char * -gaim_account_get_buddy_icon(const GaimAccount *account) -{ - g_return_val_if_fail(account != NULL, NULL); - - return account->buddy_icon; -} - -const char * -gaim_account_get_protocol_id(const GaimAccount *account) -{ - g_return_val_if_fail(accoun... [truncated message content] |
From: <ev...@us...> - 2006-08-19 01:19:42
|
Revision: 16857 Author: evands Date: 2006-08-18 18:19:33 -0700 (Fri, 18 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16857&view=rev Log Message: ----------- ** Part 2 of a 4 part commit ** Restructured the tree and the build files for the core/UI split. libgaim is now built as a library against which gtkgaim and gntgaim link and can be built separately from them by configuring with them disable d (--disable-gtkgaim and --disable-gntgaim). Each of the three source trees (gtk, console, and core) has its own plugins folder. This works nicely on my system; hopefully it won't cause too much chaos for others. If you have local changes, an easy way to merge them to the new layout should be along the lines of svn diff -r version_before_move > myChanges.diff patch -p1 < myChanges.diff where svn diff is done from the gaim checkout root but patch is done from gtk or core (or both). This changeset combines work by Sadrul Chowdhury, Gary Kramlich (grim), and me. Known issues: * On my system, at least, something's not quite right with the gtkgaim build process; it imports gtkgaim.h (as can be seen by adding a #warning) but <gtk/gtk.h> doesn't seem to be used. The GTK_STOCK_XXX defines claim to be undeclared. I was going to make this work before committing, but I strongly suspect someone with more autotools experience will be able to fix it easily whereas I've already glared at it for an hour. * The gnt console UI depends on libgnt, which is not yet automatically built. Either autogen.sh && make && make install libgnt (in console/libgnt) or configure with --disable-gnt for now. * The Windows build process has not been touched yet so still needs updating. * There's an stray "rm: core: is a directory" warning after autogen.sh is compl te. I'm not sure where that's coming from. Modified Paths: -------------- trunk/console/gntconv.c trunk/console/gntgaim.c Added Paths: ----------- trunk/console/Makefile.am trunk/console/getopt.c trunk/console/getopt.h trunk/console/getopt1.c Removed Paths: ------------- trunk/console/Makefile Property Changed: ---------------- trunk/console/gntnotify.c trunk/console/gntnotify.h Deleted: trunk/console/Makefile =================================================================== --- trunk/console/Makefile 2006-08-19 01:13:25 UTC (rev 16856) +++ trunk/console/Makefile 2006-08-19 01:19:33 UTC (rev 16857) @@ -1,59 +0,0 @@ -VERSION=gntgaim-0.0.0dev -CC=gcc -CFLAGS=`pkg-config --cflags gaim gobject-2.0 gnt` -g -Wall -DVERSION=\"$(VERSION)\" -DSTANDALONE -LDFLAGS=`pkg-config --libs gaim gobject-2.0 libxml-2.0 gnt` -pg -lgaim - -GG_SOURCES = \ - gntaccount.c \ - gntblist.c \ - gntconn.c \ - gntconv.c \ - gntdebug.c \ - gntnotify.c \ - gntplugin.c \ - gntprefs.c \ - gntrequest.c \ - gntstatus.c \ - gntui.c - -GG_HEADERS = \ - gntaccount.h \ - gntblist.h \ - gntconn.h \ - gntconv.h \ - gntdebug.h \ - gntnotify.h \ - gntprefs.h \ - gntplugin.h \ - gntrequest.h \ - gntstatus.h \ - gntui.h - -GG_OBJECTS = \ - gntaccount.o \ - gntblist.o \ - gntconn.o \ - gntconv.o \ - gntdebug.o \ - gntnotify.o \ - gntplugin.o \ - gntprefs.o \ - gntrequest.o \ - gntstatus.o \ - gntui.o - -all: gntgaim - -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) -gntnotify.o: gntnotify.c $(GG_HEADERS) -gntui.o: gntui.c $(GG_HEADERS) - -clean: - rm -f *.o - rm -f gntgaim - Added: trunk/console/Makefile.am =================================================================== --- trunk/console/Makefile.am (rev 0) +++ trunk/console/Makefile.am 2006-08-19 01:19:33 UTC (rev 16857) @@ -0,0 +1,65 @@ +#libgnt currently needs to have autogen run for there to be a Makefile... +# SUBDIRS = libgnt + +bin_PROGRAMS = gntgaim + +gntgaim_SOURCES = \ + gntaccount.c \ + gntblist.c \ + gntconn.c \ + gntconv.c \ + gntdebug.c \ + gntgaim.c \ + gntnotify.c \ + gntplugin.c \ + gntprefs.c \ + gntrequest.c \ + gntstatus.c \ + gntui.c + +gntgaim_headers = \ + gntaccount.h \ + gntblist.h \ + gntconn.h \ + gntconv.h \ + gntdebug.h \ + gntnotify.h \ + gntplugin.c \ + gntprefs.h \ + gntrequest.h \ + gntstatus.h \ + gntui.h + +gntgaimincludedir=$(includedir)/gaim/gnt +gntgaiminclude_HEADERS = \ + $(gntgaim_headers) + +gntgaim_DEPENDENCIES = @LIBOBJS@ $(STATIC_LINK_LIBS) $(MS_LIBS) +gntgaim_LDFLAGS = -export-dynamic +gntgaim_LDADD = \ + @LIBOBJS@ \ + $(DBUS_LIBS) \ + $(GSTREAMER_LIBS) \ + $(STATIC_LINK_LIBS) \ + $(XSS_LIBS) \ + $(SM_LIBS) \ + $(INTLLIBS) \ + $(GLIB_LIBS) \ + $(LIBXML_LIBS) \ + -L./libgnt/ -lgnt \ + -L$(top_srcdir)/core -lgaim + +AM_CPPFLAGS = \ + -DSTANDALONE \ + -DBR_PTHREADS=0 \ + -DDATADIR=\"$(datadir)\" \ + -DLIBDIR=\"$(libdir)/gaim/\" \ + -DLOCALEDIR=\"$(datadir)/locale\" \ + -DSYSCONFDIR=\"$(sysconfdir)\" \ + -I$(top_srcdir)/core/ \ + -I ./libgnt/ \ + $(GSTREAMER_CFLAGS) \ + $(DEBUG_CFLAGS) \ + $(GLIB_CFLAGS) \ + $(DBUS_CFLAGS) \ + $(LIBXML_CFLAGS) Property changes on: trunk/console/Makefile.am ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Copied: trunk/console/getopt.c (from rev 16843, trunk/src/getopt.c) =================================================================== --- trunk/console/getopt.c (rev 0) +++ trunk/console/getopt.c 2006-08-19 01:19:33 UTC (rev 16857) @@ -0,0 +1,737 @@ +/* Getopt for GNU. + NOTE: getopt is now part of the C library, so if you don't know what + "Keep this file name-space clean" means, talk to ro...@gn... + before changing it! + + Gaim is the legal property of its developers, whose names are too numerous + to list here. Please refer to the COPYRIGHT file distributed with this + source distribution. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + +/* NOTE!!! AIX requires this to be the first thing in the file. + Do not put ANYTHING before it! */ +#if !defined (__GNUC__) && defined (_AIX) + #pragma alloca +#endif + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +/* Alver says we need this for IRIX. */ +#if HAVE_STRING_H +#include "string.h" +#endif + +#ifdef __GNUC__ +#define alloca __builtin_alloca +#else /* not __GNUC__ */ +#if defined (HAVE_ALLOCA_H) || (defined(sparc) && (defined(sun) || (!defined(USG) && !defined(SVR4) && !defined(__svr4__)))) +#include <alloca.h> +#else +#ifndef _AIX +char *alloca (); +#endif +#endif /* alloca.h */ +#endif /* not __GNUC__ */ + +#if !__STDC__ && !defined(const) && IN_GCC +#define const +#endif + +/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>. */ +#ifndef _NO_PROTO +#define _NO_PROTO +#endif + +#include <stdio.h> + +/* Comment out all this code if we are using the GNU C Library, and are not + actually compiling the library itself. This code is part of the GNU C + Library, but also included in many other GNU distributions. Compiling + and linking in this code is a waste when using the GNU C library + (especially if it is a shared library). Rather than having every GNU + program understand `configure --with-gnu-libc' and omit the object files, + it is simpler to just do this in the source for each such file. */ + +#if defined (_LIBC) || !defined (__GNU_LIBRARY__) + + +/* This needs to come after some library #include + to get __GNU_LIBRARY__ defined. */ +#ifdef __GNU_LIBRARY__ +#undef alloca +/* Don't include stdlib.h for non-GNU C libraries because some of them + contain conflicting prototypes for getopt. */ +#include <stdlib.h> +#else /* Not GNU C library. */ +#define __alloca alloca +#endif /* GNU C library. */ + +/* If GETOPT_COMPAT is defined, `+' as well as `--' can introduce a + long-named option. Because this is not POSIX.2 compliant, it is + being phased out. */ +/* #define GETOPT_COMPAT */ + +/* This version of `getopt' appears to the caller like standard Unix `getopt' + but it behaves differently for the user, since it allows the user + to intersperse the options with the other arguments. + + As `getopt' works, it permutes the elements of ARGV so that, + when it is done, all the options precede everything else. Thus + all application programs are extended to handle flexible argument order. + + Setting the environment variable POSIXLY_CORRECT disables permutation. + Then the behavior is completely standard. + + GNU application programs can use a third alternative mode in which + they can distinguish the relative order of options and other arguments. */ + +#include "getopt.h" + +/* For communication from `getopt' to the caller. + When `getopt' finds an option that takes an argument, + the argument value is returned here. + Also, when `ordering' is RETURN_IN_ORDER, + each non-option ARGV-element is returned here. */ + +char *optarg = 0; + +/* Index in ARGV of the next element to be scanned. + This is used for communication to and from the caller + and for communication between successive calls to `getopt'. + + On entry to `getopt', zero means this is the first call; initialize. + + When `getopt' returns EOF, this is the index of the first of the + non-option elements that the caller should itself scan. + + Otherwise, `optind' communicates from one call to the next + how much of ARGV has been scanned so far. */ + +/* XXX 1003.2 says this must be 1 before any call. */ +int optind = 0; + +/* The next char to be scanned in the option-element + in which the last option character we returned was found. + This allows us to pick up the scan where we left off. + + If this is zero, or a null string, it means resume the scan + by advancing to the next ARGV-element. */ + +static char *nextchar; + +/* Callers store zero here to inhibit the error message + for unrecognized options. */ + +int opterr = 1; + +/* Set to an option character which was unrecognized. + This must be initialized on some systems to avoid linking in the + system's own getopt implementation. */ + +int optopt = '?'; + +/* Describe how to deal with options that follow non-option ARGV-elements. + + If the caller did not specify anything, + the default is REQUIRE_ORDER if the environment variable + POSIXLY_CORRECT is defined, PERMUTE otherwise. + + REQUIRE_ORDER means don't recognize them as options; + stop option processing when the first non-option is seen. + This is what Unix does. + This mode of operation is selected by either setting the environment + variable POSIXLY_CORRECT, or using `+' as the first character + of the list of option characters. + + PERMUTE is the default. We permute the contents of ARGV as we scan, + so that eventually all the non-options are at the end. This allows options + to be given in any order, even with programs that were not written to + expect this. + + RETURN_IN_ORDER is an option available to programs that were written + to expect options and other ARGV-elements in any order and that care about + the ordering of the two. We describe each non-option ARGV-element + as if it were the argument of an option with character code 1. + Using `-' as the first character of the list of option characters + selects this mode of operation. + + The special argument `--' forces an end of option-scanning regardless + of the value of `ordering'. In the case of RETURN_IN_ORDER, only + `--' can cause `getopt' to return EOF with `optind' != ARGC. */ + +static enum +{ + REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER +} ordering; + +#ifdef __GNU_LIBRARY__ +/* We want to avoid inclusion of string.h with non-GNU libraries + because there are many ways it can cause trouble. + On some systems, it contains special magic macros that don't work + in GCC. */ +#include <string.h> +#define my_index strchr +#define my_bcopy(src, dst, n) memcpy ((dst), (src), (n)) +#else + +/* Avoid depending on library functions or files + whose names are inconsistent. */ + +char *getenv (); + +static char * +my_index (str, chr) + const char *str; + int chr; +{ + while (*str) + { + if (*str == chr) + return (char *) str; + str++; + } + return 0; +} + +static void +my_bcopy (from, to, size) + const char *from; + char *to; + int size; +{ + int i; + for (i = 0; i < size; i++) + to[i] = from[i]; +} +#endif /* GNU C library. */ + +/* Handle permutation of arguments. */ + +/* Describe the part of ARGV that contains non-options that have + been skipped. `first_nonopt' is the index in ARGV of the first of them; + `last_nonopt' is the index after the last of them. */ + +static int first_nonopt; +static int last_nonopt; + +/* Exchange two adjacent subsequences of ARGV. + One subsequence is elements [first_nonopt,last_nonopt) + which contains all the non-options that have been skipped so far. + The other is elements [last_nonopt,optind), which contains all + the options processed since those non-options were skipped. + + `first_nonopt' and `last_nonopt' are relocated so that they describe + the new indices of the non-options in ARGV after they are moved. */ + +static void +exchange (argv) + char **argv; +{ + int nonopts_size = (last_nonopt - first_nonopt) * sizeof (char *); + char **temp = (char **) __alloca (nonopts_size); + + /* Interchange the two blocks of data in ARGV. */ + + my_bcopy ((char *) &argv[first_nonopt], (char *) temp, nonopts_size); + my_bcopy ((char *) &argv[last_nonopt], (char *) &argv[first_nonopt], + (optind - last_nonopt) * sizeof (char *)); + my_bcopy ((char *) temp, + (char *) &argv[first_nonopt + optind - last_nonopt], + nonopts_size); + + /* Update records for the slots the non-options now occupy. */ + + first_nonopt += (optind - last_nonopt); + last_nonopt = optind; +} + +/* Scan elements of ARGV (whose length is ARGC) for option characters + given in OPTSTRING. + + If an element of ARGV starts with '-', and is not exactly "-" or "--", + then it is an option element. The characters of this element + (aside from the initial '-') are option characters. If `getopt' + is called repeatedly, it returns successively each of the option characters + from each of the option elements. + + If `getopt' finds another option character, it returns that character, + updating `optind' and `nextchar' so that the next call to `getopt' can + resume the scan with the following option character or ARGV-element. + + If there are no more option characters, `getopt' returns `EOF'. + Then `optind' is the index in ARGV of the first ARGV-element + that is not an option. (The ARGV-elements have been permuted + so that those that are not options now come last.) + + OPTSTRING is a string containing the legitimate option characters. + If an option character is seen that is not listed in OPTSTRING, + return '?' after printing an error message. If you set `opterr' to + zero, the error message is suppressed but we still return '?'. + + If a char in OPTSTRING is followed by a colon, that means it wants an arg, + so the following text in the same ARGV-element, or the text of the following + ARGV-element, is returned in `optarg'. Two colons mean an option that + wants an optional arg; if there is text in the current ARGV-element, + it is returned in `optarg', otherwise `optarg' is set to zero. + + If OPTSTRING starts with `-' or `+', it requests different methods of + handling the non-option ARGV-elements. + See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. + + Long-named options begin with `--' instead of `-'. + Their names may be abbreviated as long as the abbreviation is unique + or is an exact match for some defined option. If they have an + argument, it follows the option name in the same ARGV-element, separated + from the option name by a `=', or else the in next ARGV-element. + When `getopt' finds a long-named option, it returns 0 if that option's + `flag' field is nonzero, the value of the option's `val' field + if the `flag' field is zero. + + The elements of ARGV aren't really const, because we permute them. + But we pretend they're const in the prototype to be compatible + with other systems. + + LONGOPTS is a vector of `struct option' terminated by an + element containing a name which is zero. + + LONGIND returns the index in LONGOPT of the long-named option found. + It is only valid when a long-named option has been found by the most + recent call. + + If LONG_ONLY is nonzero, '-' as well as '--' can introduce + long-named options. */ + +int +_getopt_internal (argc, argv, optstring, longopts, longind, long_only) + int argc; + char *const *argv; + const char *optstring; + const struct option *longopts; + int *longind; + int long_only; +{ + int option_index; + + optarg = 0; + + /* Initialize the internal data when the first call is made. + Start processing options with ARGV-element 1 (since ARGV-element 0 + is the program name); the sequence of previously skipped + non-option ARGV-elements is empty. */ + + if (optind == 0) + { + first_nonopt = last_nonopt = optind = 1; + + nextchar = NULL; + + /* Determine how to handle the ordering of options and nonoptions. */ + + if (optstring[0] == '-') + { + ordering = RETURN_IN_ORDER; + ++optstring; + } + else if (optstring[0] == '+') + { + ordering = REQUIRE_ORDER; + ++optstring; + } + else if (getenv ("POSIXLY_CORRECT") != NULL) + ordering = REQUIRE_ORDER; + else + ordering = PERMUTE; + } + + if (nextchar == NULL || *nextchar == '\0') + { + if (ordering == PERMUTE) + { + /* If we have just processed some options following some non-options, + exchange them so that the options come first. */ + + if (first_nonopt != last_nonopt && last_nonopt != optind) + exchange ((char **) argv); + else if (last_nonopt != optind) + first_nonopt = optind; + + /* Now skip any additional non-options + and extend the range of non-options previously skipped. */ + + while (optind < argc + && (argv[optind][0] != '-' || argv[optind][1] == '\0') +#ifdef GETOPT_COMPAT + && (longopts == NULL + || argv[optind][0] != '+' || argv[optind][1] == '\0') +#endif /* GETOPT_COMPAT */ + ) + optind++; + last_nonopt = optind; + } + + /* Special ARGV-element `--' means premature end of options. + Skip it like a null option, + then exchange with previous non-options as if it were an option, + then skip everything else like a non-option. */ + + if (optind != argc && !strcmp (argv[optind], "--")) + { + optind++; + + if (first_nonopt != last_nonopt && last_nonopt != optind) + exchange ((char **) argv); + else if (first_nonopt == last_nonopt) + first_nonopt = optind; + last_nonopt = argc; + + optind = argc; + } + + /* If we have done all the ARGV-elements, stop the scan + and back over any non-options that we skipped and permuted. */ + + if (optind == argc) + { + /* Set the next-arg-index to point at the non-options + that we previously skipped, so the caller will digest them. */ + if (first_nonopt != last_nonopt) + optind = first_nonopt; + return EOF; + } + + /* If we have come to a non-option and did not permute it, + either stop the scan or describe it to the caller and pass it by. */ + + if ((argv[optind][0] != '-' || argv[optind][1] == '\0') +#ifdef GETOPT_COMPAT + && (longopts == NULL + || argv[optind][0] != '+' || argv[optind][1] == '\0') +#endif /* GETOPT_COMPAT */ + ) + { + if (ordering == REQUIRE_ORDER) + return EOF; + optarg = argv[optind++]; + return 1; + } + + /* We have found another option-ARGV-element. + Start decoding its characters. */ + + nextchar = (argv[optind] + 1 + + (longopts != NULL && argv[optind][1] == '-')); + } + + if (longopts != NULL + && ((argv[optind][0] == '-' + && (argv[optind][1] == '-' || long_only)) +#ifdef GETOPT_COMPAT + || argv[optind][0] == '+' +#endif /* GETOPT_COMPAT */ + )) + { + const struct option *p; + char *s = nextchar; + int exact = 0; + int ambig = 0; + const struct option *pfound = NULL; + int indfound; + + while (*s && *s != '=') + s++; + + /* Test all options for either exact match or abbreviated matches. */ + for (p = longopts, option_index = 0; p->name; + p++, option_index++) + if (!strncmp (p->name, nextchar, s - nextchar)) + { + if (s - nextchar == strlen (p->name)) + { + /* Exact match found. */ + pfound = p; + indfound = option_index; + exact = 1; + break; + } + else if (pfound == NULL) + { + /* First nonexact match found. */ + pfound = p; + indfound = option_index; + } + else + /* Second nonexact match found. */ + ambig = 1; + } + + if (ambig && !exact) + { + if (opterr) + fprintf (stderr, "%s: option `%s' is ambiguous\n", + argv[0], argv[optind]); + nextchar += strlen (nextchar); + optind++; + return '?'; + } + + if (pfound != NULL) + { + option_index = indfound; + optind++; + if (*s) + { + /* Don't test has_arg with >, because some C compilers don't + allow it to be used on enums. */ + if (pfound->has_arg) + optarg = s + 1; + else + { + if (opterr) + { + if (argv[optind - 1][1] == '-') + /* --option */ + fprintf (stderr, + "%s: option `--%s' doesn't allow an argument\n", + argv[0], pfound->name); + else + /* +option or -option */ + fprintf (stderr, + "%s: option `%c%s' doesn't allow an argument\n", + argv[0], argv[optind - 1][0], pfound->name); + } + nextchar += strlen (nextchar); + return '?'; + } + } + else if (pfound->has_arg == 1) + { + if (optind < argc) + optarg = argv[optind++]; + else + { + if (opterr) + fprintf (stderr, "%s: option `%s' requires an argument\n", + argv[0], argv[optind - 1]); + nextchar += strlen (nextchar); + return optstring[0] == ':' ? ':' : '?'; + } + } + nextchar += strlen (nextchar); + if (longind != NULL) + *longind = option_index; + if (pfound->flag) + { + *(pfound->flag) = pfound->val; + return 0; + } + return pfound->val; + } + /* Can't find it as a long option. If this is not getopt_long_only, + or the option starts with '--' or is not a valid short + option, then it's an error. + Otherwise interpret it as a short option. */ + if (!long_only || argv[optind][1] == '-' +#ifdef GETOPT_COMPAT + || argv[optind][0] == '+' +#endif /* GETOPT_COMPAT */ + || my_index (optstring, *nextchar) == NULL) + { + if (opterr) + { + if (argv[optind][1] == '-') + /* --option */ + fprintf (stderr, "%s: unrecognized option `--%s'\n", + argv[0], nextchar); + else + /* +option or -option */ + fprintf (stderr, "%s: unrecognized option `%c%s'\n", + argv[0], argv[optind][0], nextchar); + } + nextchar = (char *) ""; + optind++; + return '?'; + } + } + + /* Look at and handle the next option-character. */ + + { + char c = *nextchar++; + char *temp = my_index (optstring, c); + + /* Increment `optind' when we start to process its last character. */ + if (*nextchar == '\0') + ++optind; + + if (temp == NULL || c == ':') + { + if (opterr) + { +#if 0 + if (c < 040 || c >= 0177) + fprintf (stderr, "%s: unrecognized option, character code 0%o\n", + argv[0], c); + else + fprintf (stderr, "%s: unrecognized option `-%c'\n", argv[0], c); +#else + /* 1003.2 specifies the format of this message. */ + fprintf (stderr, "%s: illegal option -- %c\n", argv[0], c); +#endif + } + optopt = c; + return '?'; + } + if (temp[1] == ':') + { + if (temp[2] == ':') + { + /* This is an option that accepts an argument optionally. */ + if (*nextchar != '\0') + { + optarg = nextchar; + optind++; + } + else + optarg = 0; + nextchar = NULL; + } + else + { + /* This is an option that requires an argument. */ + if (*nextchar != '\0') + { + optarg = nextchar; + /* If we end this ARGV-element by taking the rest as an arg, + we must advance to the next element now. */ + optind++; + } + else if (optind == argc) + { + if (opterr) + { +#if 0 + fprintf (stderr, "%s: option `-%c' requires an argument\n", + argv[0], c); +#else + /* 1003.2 specifies the format of this message. */ + fprintf (stderr, "%s: option requires an argument -- %c\n", + argv[0], c); +#endif + } + optopt = c; + if (optstring[0] == ':') + c = ':'; + else + c = '?'; + } + else + /* We already incremented `optind' once; + increment it again when taking next ARGV-elt as argument. */ + optarg = argv[optind++]; + nextchar = NULL; + } + } + return c; + } +} + +int +getopt (argc, argv, optstring) + int argc; + char *const *argv; + const char *optstring; +{ + return _getopt_internal (argc, argv, optstring, + (const struct option *) 0, + (int *) 0, + 0); +} + +#endif /* _LIBC or not __GNU_LIBRARY__. */ + +#ifdef TEST + +/* Compile with -DTEST to make an executable for use in testing + the above definition of `getopt'. */ + +int +main (argc, argv) + int argc; + char **argv; +{ + int c; + int digit_optind = 0; + + while (1) + { + int this_option_optind = optind ? optind : 1; + + c = getopt (argc, argv, "abc:d:0123456789"); + if (c == EOF) + break; + + switch (c) + { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + if (digit_optind != 0 && digit_optind != this_option_optind) + printf ("digits occur in two different argv-elements.\n"); + digit_optind = this_option_optind; + printf ("option %c\n", c); + break; + + case 'a': + printf ("option a\n"); + break; + + case 'b': + printf ("option b\n"); + break; + + case 'c': + printf ("option c with value `%s'\n", optarg); + break; + + case '?': + break; + + default: + printf ("?? getopt returned character code 0%o ??\n", c); + } + } + + if (optind < argc) + { + printf ("non-option ARGV-elements: "); + while (optind < argc) + printf ("%s ", argv[optind++]); + printf ("\n"); + } + + exit (0); +} + +#endif /* TEST */ Property changes on: trunk/console/getopt.c ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Copied: trunk/console/getopt.h (from rev 16843, trunk/src/getopt.h) =================================================================== --- trunk/console/getopt.h (rev 0) +++ trunk/console/getopt.h 2006-08-19 01:19:33 UTC (rev 16857) @@ -0,0 +1,136 @@ +/* Declarations for getopt. + + NOTE: getopt is now part of the C library, so if you don't know what + "Keep this file name-space clean" means, talk to ro...@gn... + before changing it! + + Gaim is the legal property of its developers, whose names are too numerous + to list here. Please refer to the COPYRIGHT file distributed with this + source distribution. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + +#ifndef _GETOPT_H +#define _GETOPT_H 1 + +#ifdef __cplusplus +extern "C" { +#endif + +/* For communication from `getopt' to the caller. + When `getopt' finds an option that takes an argument, + the argument value is returned here. + Also, when `ordering' is RETURN_IN_ORDER, + each non-option ARGV-element is returned here. */ + +extern char *optarg; + +/* Index in ARGV of the next element to be scanned. + This is used for communication to and from the caller + and for communication between successive calls to `getopt'. + + On entry to `getopt', zero means this is the first call; initialize. + + When `getopt' returns EOF, this is the index of the first of the + non-option elements that the caller should itself scan. + + Otherwise, `optind' communicates from one call to the next + how much of ARGV has been scanned so far. */ + +extern int optind; + +/* Callers store zero here to inhibit the error message `getopt' prints + for unrecognized options. */ + +extern int opterr; + +/* Set to an option character which was unrecognized. */ + +extern int optopt; + +/* Describe the long-named options requested by the application. + The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector + of `struct option' terminated by an element containing a name which is + zero. + + The field `has_arg' is: + no_argument (or 0) if the option does not take an argument, + required_argument (or 1) if the option requires an argument, + optional_argument (or 2) if the option takes an optional argument. + + If the field `flag' is not NULL, it points to a variable that is set + to the value given in the field `val' when the option is found, but + left unchanged if the option is not found. + + To have a long-named option do something other than set an `int' to + a compiled-in constant, such as set a value from `optarg', set the + option's `flag' field to zero and its `val' field to a nonzero + value (the equivalent single-letter option character, if there is + one). For long options that have a zero `flag' field, `getopt' + returns the contents of the `val' field. */ + +struct option +{ +#if __STDC__ + const char *name; +#else + char *name; +#endif + /* has_arg can't be an enum because some compilers complain about + type mismatches in all the code that assumes it is an int. */ + int has_arg; + int *flag; + int val; +}; + +/* Names for the values of the `has_arg' field of `struct option'. */ + +#define no_argument 0 +#define required_argument 1 +#define optional_argument 2 + +#if __STDC__ +#if defined(__GNU_LIBRARY__) +/* Many other libraries have conflicting prototypes for getopt, with + differences in the consts, in stdlib.h. To avoid compilation + errors, only prototype getopt for the GNU C library. */ +extern int getopt (int argc, char *const *argv, const char *shortopts); +#else /* not __GNU_LIBRARY__ */ +extern int getopt (); +#endif /* not __GNU_LIBRARY__ */ +extern int getopt_long (int argc, char *const *argv, const char *shortopts, + const struct option *longopts, int *longind); +extern int getopt_long_only (int argc, char *const *argv, + const char *shortopts, + const struct option *longopts, int *longind); + +/* Internal only. Users should not call this directly. */ +extern int _getopt_internal (int argc, char *const *argv, + const char *shortopts, + const struct option *longopts, int *longind, + int long_only); +#else /* not __STDC__ */ +extern int getopt (); +extern int getopt_long (); +extern int getopt_long_only (); + +extern int _getopt_internal (); +#endif /* not __STDC__ */ + +#ifdef __cplusplus +} +#endif + +#endif /* _GETOPT_H */ Property changes on: trunk/console/getopt.h ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Copied: trunk/console/getopt1.c (from rev 16843, trunk/src/getopt1.c) =================================================================== --- trunk/console/getopt1.c (rev 0) +++ trunk/console/getopt1.c 2006-08-19 01:19:33 UTC (rev 16857) @@ -0,0 +1,177 @@ +/* getopt_long and getopt_long_only entry points for GNU getopt. + Gaim is the legal property of its developers, whose names are too numerous + to list here. Please refer to the COPYRIGHT file distributed with this + source distribution. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "getopt.h" + +#if !__STDC__ && !defined(const) && IN_GCC +#define const +#endif + +#include <stdio.h> + +/* Comment out all this code if we are using the GNU C Library, and are not + actually compiling the library itself. This code is part of the GNU C + Library, but also included in many other GNU distributions. Compiling + and linking in this code is a waste when using the GNU C library + (especially if it is a shared library). Rather than having every GNU + program understand `configure --with-gnu-libc' and omit the object files, + it is simpler to just do this in the source for each such file. */ + +#if defined (_LIBC) || !defined (__GNU_LIBRARY__) + + +/* This needs to come after some library #include + to get __GNU_LIBRARY__ defined. */ +#ifdef __GNU_LIBRARY__ +#include <stdlib.h> +#else +char *getenv (); +#endif + +#ifndef NULL +#define NULL 0 +#endif + +int +getopt_long (argc, argv, options, long_options, opt_index) + int argc; + char *const *argv; + const char *options; + const struct option *long_options; + int *opt_index; +{ + return _getopt_internal (argc, argv, options, long_options, opt_index, 0); +} + +/* Like getopt_long, but '-' as well as '--' can indicate a long option. + If an option that starts with '-' (not '--') doesn't match a long option, + but does match a short option, it is parsed as a short option + instead. */ + +int +getopt_long_only (argc, argv, options, long_options, opt_index) + int argc; + char *const *argv; + const char *options; + const struct option *long_options; + int *opt_index; +{ + return _getopt_internal (argc, argv, options, long_options, opt_index, 1); +} + + +#endif /* _LIBC or not __GNU_LIBRARY__. */ + +#ifdef TEST + +#include <stdio.h> + +int +main (argc, argv) + int argc; + char **argv; +{ + int c; + int digit_optind = 0; + + while (1) + { + int this_option_optind = optind ? optind : 1; + int option_index = 0; + static struct option long_options[] = + { + {"add", 1, 0, 0}, + {"append", 0, 0, 0}, + {"delete", 1, 0, 0}, + {"verbose", 0, 0, 0}, + {"create", 0, 0, 0}, + {"file", 1, 0, 0}, + {0, 0, 0, 0} + }; + + c = getopt_long (argc, argv, "abc:d:0123456789", + long_options, &option_index); + if (c == EOF) + break; + + switch (c) + { + case 0: + printf ("option %s", long_options[option_index].name); + if (optarg) + printf (" with arg %s", optarg); + printf ("\n"); + break; + + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + if (digit_optind != 0 && digit_optind != this_option_optind) + printf ("digits occur in two different argv-elements.\n"); + digit_optind = this_option_optind; + printf ("option %c\n", c); + break; + + case 'a': + printf ("option a\n"); + break; + + case 'b': + printf ("option b\n"); + break; + + case 'c': + printf ("option c with value `%s'\n", optarg); + break; + + case 'd': + printf ("option d with value `%s'\n", optarg); + break; + + case '?': + break; + + default: + printf ("?? getopt returned character code 0%o ??\n", c); + } + } + + if (optind < argc) + { + printf ("non-option ARGV-elements: "); + while (optind < argc) + printf ("%s ", argv[optind++]); + printf ("\n"); + } + + exit (0); +} + +#endif /* TEST */ Property changes on: trunk/console/getopt1.c ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Modified: trunk/console/gntconv.c =================================================================== --- trunk/console/gntconv.c 2006-08-19 01:13:25 UTC (rev 16856) +++ trunk/console/gntconv.c 2006-08-19 01:19:33 UTC (rev 16857) @@ -20,6 +20,8 @@ #define PREF_ROOT "/gaim/gnt/conversations" +#include "config.h" + GHashTable *ggconvs; typedef struct _GGConv GGConv; Modified: trunk/console/gntgaim.c =================================================================== --- trunk/console/gntgaim.c 2006-08-19 01:13:25 UTC (rev 16856) +++ trunk/console/gntgaim.c 2006-08-19 01:19:33 UTC (rev 16857) @@ -23,6 +23,8 @@ #define _GNU_SOURCE #include <getopt.h> +#include "config.h" + static void debug_init() { Property changes on: trunk/console/gntnotify.c ___________________________________________________________________ Name: svn:mime-type - text/plan + text/plain Property changes on: trunk/console/gntnotify.h ___________________________________________________________________ Name: svn:mime-type - text/plan + text/plain This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ev...@us...> - 2006-08-19 01:17:39
|
Revision: 16856 Author: evands Date: 2006-08-18 18:13:25 -0700 (Fri, 18 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16856&view=rev Log Message: ----------- ** Part 2 of a 4 part commit ** Restructured the tree and the build files for the core/UI split. libgaim is now built as a library against which gtkgaim and gntgaim link and can be built separately from them by configuring with them disable d (--disable-gtkgaim and --disable-gntgaim). Each of the three source trees (gtk, console, and core) has its own plugins folder. This works nicely on my system; hopefully it won't cause too much chaos for others. If you have local changes, an easy way to merge them to the new layout should be along the lines of svn diff -r version_before_move > myChanges.diff patch -p1 < myChanges.diff where svn diff is done from the gaim checkout root but patch is done from gtk or core (or both). This changeset combines work by Sadrul Chowdhury, Gary Kramlich (grim), and me. Known issues: * On my system, at least, something's not quite right with the gtkgaim build process; it imports gtkgaim.h (as can be seen by adding a #warning) but <gtk/gtk.h> doesn't seem to be used. The GTK_STOCK_XXX defi nes claim to be undeclared. I was going to make this work before committing, but I strongly suspect someone with more autotools experience will be able to fix it easily whereas I've already glared at it for a n hour. * The gnt console UI depends on libgnt, which is not yet automatically built. Either autogen.sh && make && make install libgnt (in console/libgnt) or configure with --disable-gnt for now. * The Windows build process has not been touched yet so still needs updating. * There's an stray "rm: core: is a directory" warning after autogen.sh is compl te. I'm not sure where that's coming from. Modified Paths: -------------- trunk/core/plugins/mono/loader/Makefile.am trunk/core/protocols/bonjour/Makefile.am trunk/core/protocols/gg/Makefile.am trunk/core/protocols/irc/Makefile.am trunk/core/protocols/jabber/Makefile.am trunk/core/protocols/msn/Makefile.am trunk/core/protocols/novell/Makefile.am trunk/core/protocols/oscar/Makefile.am trunk/core/protocols/qq/Makefile.am trunk/core/protocols/sametime/Makefile.am trunk/core/protocols/silc/Makefile.am trunk/core/protocols/simple/Makefile.am trunk/core/protocols/toc/Makefile.am trunk/core/protocols/yahoo/Makefile.am trunk/core/protocols/zephyr/Makefile.am trunk/core/protocols/zephyr/zephyr.c trunk/core/protocols/zephyr/zephyr.h Added Paths: ----------- trunk/core/ trunk/core/Makefile.am trunk/core/account.c trunk/core/account.h trunk/core/accountopt.c trunk/core/accountopt.h trunk/core/blist.c trunk/core/blist.h trunk/core/buddyicon.c trunk/core/buddyicon.h trunk/core/cipher.c trunk/core/cipher.h trunk/core/circbuffer.c trunk/core/circbuffer.h trunk/core/cmds.c trunk/core/cmds.h trunk/core/connection.c trunk/core/connection.h trunk/core/conversation.c trunk/core/conversation.h trunk/core/core.c trunk/core/core.h trunk/core/dbus-analyze-functions.py trunk/core/dbus-analyze-types.py trunk/core/dbus-bindings.h trunk/core/dbus-define-api.h trunk/core/dbus-gaim.h trunk/core/dbus-gaim.service trunk/core/dbus-maybe.h trunk/core/dbus-server.c trunk/core/dbus-server.h trunk/core/dbus-useful.c trunk/core/dbus-useful.h trunk/core/debug.c trunk/core/debug.h trunk/core/desktopitem.c trunk/core/desktopitem.h trunk/core/dnsquery.c trunk/core/dnsquery.h trunk/core/dnssrv.c trunk/core/dnssrv.h trunk/core/eventloop.c trunk/core/eventloop.h trunk/core/ft.c trunk/core/ft.h trunk/core/gaim-client-example.c trunk/core/gaim-client.c trunk/core/gaim-client.h trunk/core/gaim-notifications-example trunk/core/gaim-remote trunk/core/gaim-send trunk/core/gaim-send-async trunk/core/gaim.h trunk/core/getopt.c trunk/core/getopt.h trunk/core/getopt1.c trunk/core/idle.c trunk/core/idle.h trunk/core/imgstore.c trunk/core/imgstore.h trunk/core/internal.h trunk/core/log.c trunk/core/log.h trunk/core/mime.c trunk/core/mime.h trunk/core/network.c trunk/core/network.h trunk/core/notify.c trunk/core/notify.h trunk/core/ntlm.c trunk/core/ntlm.h trunk/core/plugin.c trunk/core/plugin.h trunk/core/pluginpref.c trunk/core/pluginpref.h trunk/core/plugins/ trunk/core/plugins/Makefile.am trunk/core/plugins/ciphertest.c trunk/core/plugins/codeinline.c trunk/core/plugins/dbus-buddyicons-example.py trunk/core/plugins/dbus-example.c trunk/core/plugins/filectl.c trunk/core/plugins/fortuneprofile.pl trunk/core/plugins/gaim.pl trunk/core/plugins/idle.c trunk/core/plugins/ipc-test-client.c trunk/core/plugins/ipc-test-server.c trunk/core/plugins/mono/ trunk/core/plugins/mono/BooPlugin.boo trunk/core/plugins/mono/GetBuddyBack.cs trunk/core/plugins/mono/MPlugin.cs trunk/core/plugins/mono/Makefile.am trunk/core/plugins/mono/api/ trunk/core/plugins/mono/loader/ trunk/core/plugins/perl/ trunk/core/plugins/perl/Makefile.am trunk/core/plugins/perl/Makefile.mingw trunk/core/plugins/perl/common/ trunk/core/plugins/perl/libgaimperl.c trunk/core/plugins/perl/perl-common.c trunk/core/plugins/perl/perl-common.h trunk/core/plugins/perl/perl-handlers.c trunk/core/plugins/perl/perl-handlers.h trunk/core/plugins/perl/perl.c trunk/core/plugins/perl/scripts/ trunk/core/plugins/pluginpref_example.c trunk/core/plugins/psychic.c trunk/core/plugins/signals-test.c trunk/core/plugins/simple.c trunk/core/plugins/ssl/ trunk/core/plugins/ssl/Makefile.am trunk/core/plugins/ssl/Makefile.mingw trunk/core/plugins/ssl/ssl-gnutls.c trunk/core/plugins/ssl/ssl-nss.c trunk/core/plugins/ssl/ssl.c trunk/core/plugins/statenotify.c trunk/core/plugins/tcl/ trunk/core/plugins/tcl/Makefile.am trunk/core/plugins/tcl/Makefile.mingw trunk/core/plugins/tcl/signal-test.tcl trunk/core/plugins/tcl/tcl.c trunk/core/plugins/tcl/tcl_cmd.c trunk/core/plugins/tcl/tcl_cmds.c trunk/core/plugins/tcl/tcl_gaim.h trunk/core/plugins/tcl/tcl_glib.c trunk/core/plugins/tcl/tcl_glib.h trunk/core/plugins/tcl/tcl_ref.c trunk/core/plugins/tcl/tcl_signals.c trunk/core/plugins/test.pl trunk/core/pounce.c trunk/core/pounce.h trunk/core/prefix.c trunk/core/prefix.h trunk/core/prefs.c trunk/core/prefs.h trunk/core/privacy.c trunk/core/privacy.h trunk/core/protocols/ trunk/core/protocols/Makefile.am trunk/core/protocols/bonjour/ trunk/core/protocols/gg/ trunk/core/protocols/irc/ trunk/core/protocols/jabber/ trunk/core/protocols/msn/ trunk/core/protocols/novell/ trunk/core/protocols/oscar/ trunk/core/protocols/qq/ trunk/core/protocols/sametime/ trunk/core/protocols/silc/ trunk/core/protocols/simple/ trunk/core/protocols/toc/ trunk/core/protocols/yahoo/ trunk/core/protocols/zephyr/ trunk/core/proxy.c trunk/core/proxy.h trunk/core/prpl.c trunk/core/prpl.h trunk/core/request.c trunk/core/request.h trunk/core/roomlist.c trunk/core/roomlist.h trunk/core/savedstatuses.c trunk/core/savedstatuses.h trunk/core/server.c trunk/core/server.h trunk/core/signals.c trunk/core/signals.h trunk/core/sound.c trunk/core/sound.h trunk/core/sslconn.c trunk/core/sslconn.h trunk/core/status.c trunk/core/status.h trunk/core/stringref.c trunk/core/stringref.h trunk/core/stun.c trunk/core/stun.h trunk/core/upnp.c trunk/core/upnp.h trunk/core/util.c trunk/core/util.h trunk/core/value.c trunk/core/value.h trunk/core/version.h trunk/core/whiteboard.c trunk/core/whiteboard.h trunk/core/xmlnode.c trunk/core/xmlnode.h Removed Paths: ------------- trunk/core/plugins/mono/BooPlugin.boo trunk/core/plugins/mono/GetBuddyBack.cs trunk/core/plugins/mono/MPlugin.cs trunk/core/plugins/mono/Makefile.am trunk/core/plugins/mono/api/ trunk/core/plugins/mono/loader/ trunk/core/plugins/perl/Makefile.am trunk/core/plugins/perl/Makefile.mingw trunk/core/plugins/perl/common/ trunk/core/plugins/perl/libgaimperl.c trunk/core/plugins/perl/perl-common.c trunk/core/plugins/perl/perl-common.h trunk/core/plugins/perl/perl-handlers.c trunk/core/plugins/perl/perl-handlers.h trunk/core/plugins/perl/perl.c trunk/core/plugins/perl/scripts/ trunk/core/plugins/ssl/Makefile.am trunk/core/plugins/ssl/Makefile.mingw trunk/core/plugins/ssl/ssl-gnutls.c trunk/core/plugins/ssl/ssl-nss.c trunk/core/plugins/ssl/ssl.c trunk/core/plugins/tcl/Makefile.am trunk/core/plugins/tcl/Makefile.mingw trunk/core/plugins/tcl/signal-test.tcl trunk/core/plugins/tcl/tcl.c trunk/core/plugins/tcl/tcl_cmd.c trunk/core/plugins/tcl/tcl_cmds.c trunk/core/plugins/tcl/tcl_gaim.h trunk/core/plugins/tcl/tcl_glib.c trunk/core/plugins/tcl/tcl_glib.h trunk/core/plugins/tcl/tcl_ref.c trunk/core/plugins/tcl/tcl_signals.c trunk/core/protocols/Makefile.am trunk/core/protocols/bonjour/ trunk/core/protocols/gg/ trunk/core/protocols/irc/ trunk/core/protocols/jabber/ trunk/core/protocols/msn/ trunk/core/protocols/novell/ trunk/core/protocols/oscar/ trunk/core/protocols/qq/ trunk/core/protocols/sametime/ trunk/core/protocols/silc/ trunk/core/protocols/simple/ trunk/core/protocols/toc/ trunk/core/protocols/yahoo/ trunk/core/protocols/zephyr/ Property Changed: ---------------- trunk/core/plugins/mono/api/Buddy.cs trunk/core/plugins/mono/api/BuddyList.cs trunk/core/plugins/mono/api/Debug.cs trunk/core/plugins/mono/api/Event.cs trunk/core/plugins/mono/api/GaimPlugin.cs trunk/core/plugins/mono/api/Makefile.am trunk/core/plugins/mono/api/Signal.cs trunk/core/plugins/mono/api/Status.cs trunk/core/plugins/mono/loader/Makefile.am trunk/core/plugins/mono/loader/blist-glue.c trunk/core/plugins/mono/loader/debug-glue.c trunk/core/plugins/mono/loader/mono-glue.h trunk/core/plugins/mono/loader/mono-helper.c trunk/core/plugins/mono/loader/mono-helper.h trunk/core/plugins/mono/loader/mono.c trunk/core/plugins/mono/loader/signal-glue.c trunk/core/plugins/mono/loader/status-glue.c trunk/core/plugins/perl/common/Makefile.mingw trunk/core/plugins/perl/common/module.h trunk/core/plugins/perl/scripts/account.pl trunk/core/plugins/perl/scripts/buddy_list.pl trunk/core/plugins/perl/scripts/conversation.pl trunk/core/plugins/perl/scripts/count_down.pl trunk/core/plugins/perl/scripts/gtk_frame_test.pl trunk/core/plugins/perl/scripts/plugin_action.pl trunk/core/plugins/perl/scripts/plugin_pref.pl trunk/core/plugins/perl/scripts/request.pl trunk/core/protocols/bonjour/Makefile.am trunk/core/protocols/bonjour/Makefile.mingw trunk/core/protocols/bonjour/bonjour.c trunk/core/protocols/bonjour/bonjour.h trunk/core/protocols/bonjour/buddy.c trunk/core/protocols/bonjour/buddy.h trunk/core/protocols/bonjour/dns_sd.c trunk/core/protocols/bonjour/dns_sd.h trunk/core/protocols/bonjour/jabber.c trunk/core/protocols/bonjour/jabber.h trunk/core/protocols/gg/Makefile.am trunk/core/protocols/gg/Makefile.mingw trunk/core/protocols/gg/buddylist.c trunk/core/protocols/gg/buddylist.h trunk/core/protocols/gg/confer.c trunk/core/protocols/gg/confer.h trunk/core/protocols/gg/gg.c trunk/core/protocols/gg/gg.h trunk/core/protocols/gg/lib/common.c trunk/core/protocols/gg/lib/compat.h trunk/core/protocols/gg/lib/dcc.c trunk/core/protocols/gg/lib/events.c trunk/core/protocols/gg/lib/http.c trunk/core/protocols/gg/lib/libgadu-config.h trunk/core/protocols/gg/lib/libgadu.c trunk/core/protocols/gg/lib/libgadu.h trunk/core/protocols/gg/lib/obsolete.c trunk/core/protocols/gg/lib/pubdir.c trunk/core/protocols/gg/lib/pubdir50.c trunk/core/protocols/gg/search.c trunk/core/protocols/gg/search.h trunk/core/protocols/irc/Makefile.am trunk/core/protocols/irc/Makefile.mingw trunk/core/protocols/irc/cmds.c trunk/core/protocols/irc/dcc_send.c trunk/core/protocols/irc/irc.c trunk/core/protocols/irc/irc.h trunk/core/protocols/irc/msgs.c trunk/core/protocols/irc/parse.c trunk/core/protocols/jabber/Makefile.am trunk/core/protocols/jabber/Makefile.mingw trunk/core/protocols/jabber/auth.c trunk/core/protocols/jabber/auth.h trunk/core/protocols/jabber/buddy.c trunk/core/protocols/jabber/buddy.h trunk/core/protocols/jabber/chat.c trunk/core/protocols/jabber/chat.h trunk/core/protocols/jabber/disco.c trunk/core/protocols/jabber/disco.h trunk/core/protocols/jabber/iq.c trunk/core/protocols/jabber/iq.h trunk/core/protocols/jabber/jabber.c trunk/core/protocols/jabber/jabber.h trunk/core/protocols/jabber/jutil.c trunk/core/protocols/jabber/jutil.h trunk/core/protocols/jabber/message.c trunk/core/protocols/jabber/message.h trunk/core/protocols/jabber/oob.c trunk/core/protocols/jabber/oob.h trunk/core/protocols/jabber/parser.c trunk/core/protocols/jabber/parser.h trunk/core/protocols/jabber/presence.c trunk/core/protocols/jabber/presence.h trunk/core/protocols/jabber/roster.c trunk/core/protocols/jabber/roster.h trunk/core/protocols/jabber/si.c trunk/core/protocols/jabber/si.h trunk/core/protocols/jabber/win32/posix.uname.c trunk/core/protocols/jabber/win32/utsname.h trunk/core/protocols/jabber/xdata.c trunk/core/protocols/jabber/xdata.h trunk/core/protocols/msn/Makefile.am trunk/core/protocols/msn/Makefile.mingw trunk/core/protocols/msn/cmdproc.c trunk/core/protocols/msn/cmdproc.h trunk/core/protocols/msn/command.c trunk/core/protocols/msn/command.h trunk/core/protocols/msn/dialog.c trunk/core/protocols/msn/dialog.h trunk/core/protocols/msn/directconn.c trunk/core/protocols/msn/directconn.h trunk/core/protocols/msn/error.c trunk/core/protocols/msn/error.h trunk/core/protocols/msn/group.c trunk/core/protocols/msn/group.h trunk/core/protocols/msn/history.c trunk/core/protocols/msn/history.h trunk/core/protocols/msn/httpconn.c trunk/core/protocols/msn/httpconn.h trunk/core/protocols/msn/msg.c trunk/core/protocols/msn/msg.h trunk/core/protocols/msn/msn.c trunk/core/protocols/msn/msn.h trunk/core/protocols/msn/nexus.c trunk/core/protocols/msn/nexus.h trunk/core/protocols/msn/notification.c trunk/core/protocols/msn/notification.h trunk/core/protocols/msn/object.c trunk/core/protocols/msn/object.h trunk/core/protocols/msn/page.c trunk/core/protocols/msn/page.h trunk/core/protocols/msn/servconn.c trunk/core/protocols/msn/servconn.h trunk/core/protocols/msn/session.c trunk/core/protocols/msn/session.h trunk/core/protocols/msn/slp.c trunk/core/protocols/msn/slp.h trunk/core/protocols/msn/slpcall.c trunk/core/protocols/msn/slpcall.h trunk/core/protocols/msn/slplink.c trunk/core/protocols/msn/slplink.h trunk/core/protocols/msn/slpmsg.c trunk/core/protocols/msn/slpmsg.h trunk/core/protocols/msn/slpsession.c trunk/core/protocols/msn/slpsession.h trunk/core/protocols/msn/state.c trunk/core/protocols/msn/state.h trunk/core/protocols/msn/switchboard.c trunk/core/protocols/msn/switchboard.h trunk/core/protocols/msn/sync.c trunk/core/protocols/msn/sync.h trunk/core/protocols/msn/table.c trunk/core/protocols/msn/table.h trunk/core/protocols/msn/transaction.c trunk/core/protocols/msn/transaction.h trunk/core/protocols/msn/user.c trunk/core/protocols/msn/user.h trunk/core/protocols/msn/userlist.c trunk/core/protocols/msn/userlist.h trunk/core/protocols/novell/Makefile.am trunk/core/protocols/novell/Makefile.mingw trunk/core/protocols/novell/nmconference.c trunk/core/protocols/novell/nmconference.h trunk/core/protocols/novell/nmconn.c trunk/core/protocols/novell/nmconn.h trunk/core/protocols/novell/nmcontact.c trunk/core/protocols/novell/nmcontact.h trunk/core/protocols/novell/nmevent.c trunk/core/protocols/novell/nmevent.h trunk/core/protocols/novell/nmfield.c trunk/core/protocols/novell/nmfield.h trunk/core/protocols/novell/nmmessage.c trunk/core/protocols/novell/nmmessage.h trunk/core/protocols/novell/nmrequest.c trunk/core/protocols/novell/nmrequest.h trunk/core/protocols/novell/nmrtf.c trunk/core/protocols/novell/nmrtf.h trunk/core/protocols/novell/nmuser.c trunk/core/protocols/novell/nmuser.h trunk/core/protocols/novell/nmuserrecord.c trunk/core/protocols/novell/nmuserrecord.h trunk/core/protocols/novell/novell.c trunk/core/protocols/oscar/Makefile.am trunk/core/protocols/oscar/Makefile.mingw trunk/core/protocols/oscar/bstream.c trunk/core/protocols/oscar/family_admin.c trunk/core/protocols/oscar/family_advert.c trunk/core/protocols/oscar/family_alert.c trunk/core/protocols/oscar/family_auth.c trunk/core/protocols/oscar/family_bart.c trunk/core/protocols/oscar/family_bos.c trunk/core/protocols/oscar/family_buddy.c trunk/core/protocols/oscar/family_chat.c trunk/core/protocols/oscar/family_chatnav.c trunk/core/protocols/oscar/family_feedbag.c trunk/core/protocols/oscar/family_icbm.c trunk/core/protocols/oscar/family_icq.c trunk/core/protocols/oscar/family_invite.c trunk/core/protocols/oscar/family_locate.c trunk/core/protocols/oscar/family_odir.c trunk/core/protocols/oscar/family_oservice.c trunk/core/protocols/oscar/family_popup.c trunk/core/protocols/oscar/family_stats.c trunk/core/protocols/oscar/family_translate.c trunk/core/protocols/oscar/family_userlookup.c trunk/core/protocols/oscar/flap_connection.c trunk/core/protocols/oscar/misc.c trunk/core/protocols/oscar/msgcookie.c trunk/core/protocols/oscar/odc.c trunk/core/protocols/oscar/oft.c trunk/core/protocols/oscar/oscar.c trunk/core/protocols/oscar/oscar.h trunk/core/protocols/oscar/oscar_data.c trunk/core/protocols/oscar/peer.c trunk/core/protocols/oscar/peer.h trunk/core/protocols/oscar/peer_proxy.c trunk/core/protocols/oscar/rxhandlers.c trunk/core/protocols/oscar/snac.c trunk/core/protocols/oscar/snactypes.h trunk/core/protocols/oscar/tlv.c trunk/core/protocols/oscar/util.c trunk/core/protocols/sametime/Makefile.am trunk/core/protocols/sametime/Makefile.mingw trunk/core/protocols/sametime/sametime.c trunk/core/protocols/sametime/sametime.h trunk/core/protocols/silc/Makefile.am trunk/core/protocols/silc/Makefile.mingw trunk/core/protocols/silc/buddy.c trunk/core/protocols/silc/chat.c trunk/core/protocols/silc/ft.c trunk/core/protocols/silc/ops.c trunk/core/protocols/silc/pk.c trunk/core/protocols/silc/silc.c trunk/core/protocols/silc/silcgaim.h trunk/core/protocols/silc/util.c trunk/core/protocols/silc/wb.c trunk/core/protocols/silc/wb.h trunk/core/protocols/simple/Makefile.am trunk/core/protocols/simple/Makefile.mingw trunk/core/protocols/simple/simple.c trunk/core/protocols/simple/simple.h trunk/core/protocols/simple/sipmsg.c trunk/core/protocols/simple/sipmsg.h trunk/core/protocols/toc/Makefile.am trunk/core/protocols/toc/Makefile.mingw trunk/core/protocols/toc/toc.c trunk/core/protocols/yahoo/Makefile.am trunk/core/protocols/yahoo/Makefile.mingw trunk/core/protocols/yahoo/util.c trunk/core/protocols/yahoo/yahoo.c trunk/core/protocols/yahoo/yahoo.h trunk/core/protocols/yahoo/yahoo_auth.c trunk/core/protocols/yahoo/yahoo_auth.h trunk/core/protocols/yahoo/yahoo_crypt.c trunk/core/protocols/yahoo/yahoo_crypt.h trunk/core/protocols/yahoo/yahoo_doodle.c trunk/core/protocols/yahoo/yahoo_doodle.h trunk/core/protocols/yahoo/yahoo_filexfer.c trunk/core/protocols/yahoo/yahoo_filexfer.h trunk/core/protocols/yahoo/yahoo_friend.c trunk/core/protocols/yahoo/yahoo_friend.h trunk/core/protocols/yahoo/yahoo_packet.c trunk/core/protocols/yahoo/yahoo_packet.h trunk/core/protocols/yahoo/yahoo_picture.c trunk/core/protocols/yahoo/yahoo_picture.h trunk/core/protocols/yahoo/yahoo_profile.c trunk/core/protocols/yahoo/yahoochat.c trunk/core/protocols/yahoo/yahoochat.h trunk/core/protocols/yahoo/ycht.c trunk/core/protocols/yahoo/ycht.h trunk/core/protocols/zephyr/Makefile.am trunk/core/protocols/zephyr/Makefile.mingw trunk/core/protocols/zephyr/ZAsyncLocate.c trunk/core/protocols/zephyr/ZCkAuth.c trunk/core/protocols/zephyr/ZCkIfNot.c trunk/core/protocols/zephyr/ZClosePort.c trunk/core/protocols/zephyr/ZCmpUID.c trunk/core/protocols/zephyr/ZCmpUIDP.c trunk/core/protocols/zephyr/ZFlsLocs.c trunk/core/protocols/zephyr/ZFlsSubs.c trunk/core/protocols/zephyr/ZFmtAuth.c trunk/core/protocols/zephyr/ZFmtList.c trunk/core/protocols/zephyr/ZFmtNotice.c trunk/core/protocols/zephyr/ZFmtRaw.c trunk/core/protocols/zephyr/ZFmtRawLst.c trunk/core/protocols/zephyr/ZFmtSmRLst.c trunk/core/protocols/zephyr/ZFmtSmRaw.c trunk/core/protocols/zephyr/ZFreeNot.c trunk/core/protocols/zephyr/ZGetLocs.c trunk/core/protocols/zephyr/ZGetSender.c trunk/core/protocols/zephyr/ZGetSubs.c trunk/core/protocols/zephyr/ZGetWGPort.c trunk/core/protocols/zephyr/ZIfNotice.c trunk/core/protocols/zephyr/ZInit.c trunk/core/protocols/zephyr/ZLocations.c trunk/core/protocols/zephyr/ZMakeAscii.c trunk/core/protocols/zephyr/ZMkAuth.c trunk/core/protocols/zephyr/ZNewLocU.c trunk/core/protocols/zephyr/ZOpenPort.c trunk/core/protocols/zephyr/ZParseNot.c trunk/core/protocols/zephyr/ZPeekIfNot.c trunk/core/protocols/zephyr/ZPeekNot.c trunk/core/protocols/zephyr/ZPeekPkt.c trunk/core/protocols/zephyr/ZPending.c trunk/core/protocols/zephyr/ZReadAscii.c trunk/core/protocols/zephyr/ZRecvNot.c trunk/core/protocols/zephyr/ZRecvPkt.c trunk/core/protocols/zephyr/ZRetSubs.c trunk/core/protocols/zephyr/ZSendList.c trunk/core/protocols/zephyr/ZSendNot.c trunk/core/protocols/zephyr/ZSendPkt.c trunk/core/protocols/zephyr/ZSendRLst.c trunk/core/protocols/zephyr/ZSendRaw.c trunk/core/protocols/zephyr/ZSetDest.c trunk/core/protocols/zephyr/ZSetFD.c trunk/core/protocols/zephyr/ZSetSrv.c trunk/core/protocols/zephyr/ZSubs.c trunk/core/protocols/zephyr/ZVariables.c trunk/core/protocols/zephyr/ZWait4Not.c trunk/core/protocols/zephyr/ZhmStat.c trunk/core/protocols/zephyr/Zinternal.c trunk/core/protocols/zephyr/com_err.h trunk/core/protocols/zephyr/error_message.c trunk/core/protocols/zephyr/error_table.h trunk/core/protocols/zephyr/et_name.c trunk/core/protocols/zephyr/init_et.c trunk/core/protocols/zephyr/internal.h trunk/core/protocols/zephyr/mit-copyright.h trunk/core/protocols/zephyr/mit-sipb-copyright.h trunk/core/protocols/zephyr/sysdep.h trunk/core/protocols/zephyr/zephyr.c trunk/core/protocols/zephyr/zephyr.h trunk/core/protocols/zephyr/zephyr_err.c trunk/core/protocols/zephyr/zephyr_err.h Added: trunk/core/Makefile.am =================================================================== --- trunk/core/Makefile.am (rev 0) +++ trunk/core/Makefile.am 2006-08-19 01:13:25 UTC (rev 16856) @@ -0,0 +1,274 @@ +EXTRA_DIST = \ + dbus-analyze-functions.py \ + dbus-analyze-types.py \ + gaim-notifications-example \ + gaim-remote \ + gaim-send \ + gaim-send-async \ + Makefile.mingw \ + win_gaim.c \ + win32/IdleTracker/Makefile.mingw \ + win32/IdleTracker/idletrack.c \ + win32/IdleTracker/idletrack.h \ + win32/gaimrc.rc \ + win32/global.mak \ + win32/libc_interface.c \ + win32/libc_interface.h \ + win32/libc_internal.h \ + win32/resource.h \ + win32/untar.c \ + win32/untar.h \ + win32/wgaimerror.h \ + win32/win32dep.c \ + win32/win32dep.h \ + win32/wspell.c \ + win32/wspell.h \ + win32/nsis/gaim-header.bmp \ + win32/nsis/gaim-intro.bmp \ + win32/nsis/gaim-plugin.nsh \ + win32/nsis/langmacros.nsh \ + win32/nsis/translations/albanian.nsh \ + win32/nsis/translations/bulgarian.nsh \ + win32/nsis/translations/catalan.nsh \ + win32/nsis/translations/czech.nsh \ + win32/nsis/translations/danish.nsh \ + win32/nsis/translations/dutch.nsh \ + win32/nsis/translations/english.nsh \ + win32/nsis/translations/finnish.nsh \ + win32/nsis/translations/french.nsh \ + win32/nsis/translations/german.nsh \ + win32/nsis/translations/hebrew.nsh \ + win32/nsis/translations/hungarian.nsh \ + win32/nsis/translations/italian.nsh \ + win32/nsis/translations/japanese.nsh \ + win32/nsis/translations/korean.nsh \ + win32/nsis/translations/kurdish.nsh \ + win32/nsis/translations/lithuanian.nsh \ + win32/nsis/translations/norwegian.nsh \ + win32/nsis/translations/polish.nsh \ + win32/nsis/translations/portuguese.nsh \ + win32/nsis/translations/portuguese-br.nsh \ + win32/nsis/translations/romanian.nsh \ + win32/nsis/translations/russian.nsh \ + win32/nsis/translations/serbian-latin.nsh \ + win32/nsis/translations/simp-chinese.nsh \ + win32/nsis/translations/slovak.nsh \ + win32/nsis/translations/slovenian.nsh \ + win32/nsis/translations/spanish.nsh \ + win32/nsis/translations/swedish.nsh \ + win32/nsis/translations/trad-chinese.nsh \ + win32/nsis/translations/vietnamese.nsh + +SUBDIRS = plugins protocols + +gaim_coresources = \ + account.c \ + accountopt.c \ + blist.c \ + buddyicon.c \ + cipher.c \ + circbuffer.c \ + cmds.c \ + connection.c \ + conversation.c \ + core.c \ + debug.c \ + desktopitem.c \ + eventloop.c \ + ft.c \ + idle.c \ + imgstore.c \ + log.c \ + mime.c \ + network.c \ + ntlm.c \ + notify.c \ + plugin.c \ + pluginpref.c \ + pounce.c \ + prefix.c \ + prefs.c \ + privacy.c \ + proxy.c \ + prpl.c \ + request.c \ + roomlist.c \ + savedstatuses.c \ + server.c \ + signals.c \ + dnssrv.c\ + status.c \ + stringref.c \ + stun.c \ + sound.c \ + sslconn.c \ + upnp.c \ + util.c \ + value.c \ + xmlnode.c \ + whiteboard.c + +gaim_coreheaders = \ + account.h \ + accountopt.h \ + blist.h \ + buddyicon.h \ + cipher.h \ + circbuffer.h \ + cmds.h \ + connection.h \ + conversation.h \ + core.h \ + dbus-maybe.h \ + debug.h \ + desktopitem.h \ + eventloop.h \ + ft.h \ + idle.h \ + imgstore.h \ + log.h \ + mime.h \ + network.h \ + notify.h \ + ntlm.h \ + plugin.h \ + pluginpref.h \ + pounce.h \ + prefs.h \ + privacy.h \ + proxy.h \ + prpl.h \ + request.h \ + roomlist.h \ + savedstatuses.h \ + server.h \ + signals.h \ + dnssrv.h \ + status.h \ + stringref.h \ + stun.h \ + sound.h \ + sslconn.h \ + upnp.h \ + util.h \ + value.h \ + version.h \ + xmlnode.h \ + whiteboard.h + +if ENABLE_DBUS + +CLEANFILES = \ + dbus-bindings.c \ + dbus-client-binding.c \ + dbus-client-binding.h \ + dbus-types.c \ + dbus-types.h \ + gaim-client-bindings.c \ + gaim-client-bindings.h \ + gaim.service + +# gaim dbus server + +dbus_sources = dbus-server.c dbus-useful.c +dbus_headers = dbus-bindings.h dbus-gaim.h dbus-server.h dbus-useful.h dbus-define-api.h + +dbus_exported = dbus-useful.h dbus-define-api.h account.h blist.h buddyicon.h connection.h conversation.h core.h log.h roomlist.h savedstatuses.h status.h server.h + +gaim_build_coreheaders = $(addprefix $(srcdir)/, $(gaim_coreheaders)) +dbus_build_exported = $(addprefix $(srcdir)/, $(dbus_exported)) + +dbus-types.c: dbus-analyze-types.py $(gaim_coreheaders) + cat $(gaim_build_coreheaders) | $(PYTHON) $(srcdir)/dbus-analyze-types.py --pattern=GAIM_DBUS_DEFINE_TYPE\(%s\) > $@ + +dbus-types.h: dbus-analyze-types.py $(dbus_coreheaders) + cat $(gaim_build_coreheaders) | $(PYTHON) $(srcdir)/dbus-analyze-types.py --pattern=GAIM_DBUS_DECLARE_TYPE\(%s\) > $@ + +dbus-bindings.c: dbus-analyze-functions.py $(dbus_exported) + cat $(dbus_build_exported) | $(PYTHON) $(srcdir)/dbus-analyze-functions.py > $@ + +dbus-server.$(OBJEXT): dbus-bindings.c dbus-types.c dbus-types.h +dbus-server.lo: dbus-bindings.c dbus-types.c dbus-types.h +$(libgaim_la_OBJECTS): dbus-types.h + +# libgaim-client + +libgaim_client_lib = libgaim-client.la + +libgaim_client_la_SOURCES = gaim-client.c gaim-client.h + +libgaim_client_la_LIBADD = $(DBUS_LIBS) + +gaim-client-bindings.c: dbus-analyze-functions.py $(dbus_exported) + cat $(dbus_build_exported) | $(PYTHON) $(srcdir)/dbus-analyze-functions.py --client > $@ + +gaim-client-bindings.h: dbus-analyze-types.py dbus-analyze-functions.py $(gaim_coreheaders) $(dbus_exported) + cat $(gaim_build_coreheaders) | $(PYTHON) $(srcdir)/dbus-analyze-types.py --keyword=enum --verbatim > $@ + cat $(dbus_build_exported) | $(PYTHON) $(srcdir)/dbus-analyze-functions.py --client --headers >> $@ + +$(libgaim_client_la_OBJECTS): gaim-client-bindings.h gaim-client-bindings.c + +# gaim-client-example + +gaim_client_example_SOURCES = gaim-client-example.c + +gaim_client_example_DEPENDENCIES = @LIBOBJS@ libgaim-client.la + +gaim_client_example_LDADD = \ + @LIBOBJS@ \ + libgaim-client.la \ + $(GLIB_LIBS) \ + $(DBUS_LIBS) + +bin_PROGRAMS = gaim-client-example + +gaim-client-example.$(OBJEXT): gaim-client-bindings.h + +# scripts + +bin_SCRIPTS = gaim-remote gaim-send gaim-send-async + +exampledir = $(datadir)/doc/@PACKAGE@/examples +example_DATA = gaim-notifications-example + +endif + +lib_LTLIBRARIES = libgaim.la $(libgaim_client_lib) + +libgaim_la_SOURCES = \ + $(gaim_coresources) \ + $(dbus_sources) + +noinst_HEADERS= \ + internal.h \ + prefix.h + +libgaimincludedir=$(includedir)/gaim +libgaiminclude_HEADERS = \ + $(gaim_coreheaders) \ + $(dbus_headers) + +libgaim_la_DEPENDENCIES = @LIBOBJS@ $(STATIC_LINK_LIBS) $(MS_LIBS) +libgaim_la_LDFLAGS = -export-dynamic +libgaim_la_LIBADD = \ + @LIBOBJS@ \ + $(DBUS_LIBS) \ + $(GLIB_LIBS) \ + $(GMODULE_LIBS) \ + $(GOBJECT_LIBS) \ + $(GSTREAMER_LIBS) \ + $(STATIC_LINK_LIBS) \ + $(INTLLIBS) \ + -lm + +AM_CPPFLAGS = \ + -DBR_PTHREADS=0 \ + -DDATADIR=\"$(datadir)\" \ + -DLIBDIR=\"$(libdir)/gaim/\" \ + -DLOCALEDIR=\"$(datadir)/locale\" \ + -DSYSCONFDIR=\"$(sysconfdir)\" \ + -I$(top_srcdir)/plugins \ + $(GSTREAMER_CFLAGS) \ + $(DEBUG_CFLAGS) \ + $(DBUS_CFLAGS) \ + $(LIBXML_CFLAGS) Property changes on: trunk/core/Makefile.am ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Copied: trunk/core/account.c (from rev 16843, trunk/src/account.c) =================================================================== --- trunk/core/account.c (rev 0) +++ trunk/core/account.c 2006-08-19 01:13:25 UTC (rev 16856) @@ -0,0 +1,2364 @@ +/** + * @file account.c Account API + * @ingroup core + * + * gaim + * + * Gaim is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * source distribution. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include "internal.h" +#include "account.h" +#include "core.h" +#include "dbus-maybe.h" +#include "debug.h" +#include "notify.h" +#include "pounce.h" +#include "prefs.h" +#include "privacy.h" +#include "prpl.h" +#include "request.h" +#include "server.h" +#include "signals.h" +#include "status.h" +#include "util.h" +#include "xmlnode.h" + +/* TODO: Should use GaimValue instead of this? What about "ui"? */ +typedef struct +{ + GaimPrefType type; + + char *ui; + + union + { + int integer; + char *string; + gboolean bool; + + } value; + +} GaimAccountSetting; + + +static GaimAccountUiOps *account_ui_ops = NULL; + +static GList *accounts = NULL; +static guint save_timer = 0; +static gboolean accounts_loaded = FALSE; + + +/********************************************************************* + * Writing to disk * + *********************************************************************/ + +static void +setting_to_xmlnode(gpointer key, gpointer value, gpointer user_data) +{ + const char *name; + GaimAccountSetting *setting; + xmlnode *node, *child; + char buf[20]; + + name = (const char *)key; + setting = (GaimAccountSetting *)value; + node = (xmlnode *)user_data; + + child = xmlnode_new_child(node, "setting"); + xmlnode_set_attrib(child, "name", name); + + if (setting->type == GAIM_PREF_INT) { + xmlnode_set_attrib(child, "type", "int"); + snprintf(buf, sizeof(buf), "%d", setting->value.integer); + xmlnode_insert_data(child, buf, -1); + } + else if (setting->type == GAIM_PREF_STRING && setting->value.string != NULL) { + xmlnode_set_attrib(child, "type", "string"); + xmlnode_insert_data(child, setting->value.string, -1); + } + else if (setting->type == GAIM_PREF_BOOLEAN) { + xmlnode_set_attrib(child, "type", "bool"); + snprintf(buf, sizeof(buf), "%d", setting->value.bool); + xmlnode_insert_data(child, buf, -1); + } +} + +static void +ui_setting_to_xmlnode(gpointer key, gpointer value, gpointer user_data) +{ + const char *ui; + GHashTable *table; + xmlnode *node, *child; + + ui = (const char *)key; + table = (GHashTable *)value; + node = (xmlnode *)user_data; + + if (g_hash_table_size(table) > 0) + { + child = xmlnode_new_child(node, "settings"); + xmlnode_set_attrib(child, "ui", ui); + g_hash_table_foreach(table, setting_to_xmlnode, child); + } +} + +static xmlnode * +status_attr_to_xmlnode(const GaimStatus *status, const GaimStatusType *type, const GaimStatusAttr *attr) +{ + xmlnode *node; + const char *id; + char *value = NULL; + GaimStatusAttr *default_attr; + GaimValue *default_value; + GaimType attr_type; + GaimValue *attr_value; + + id = gaim_status_attr_get_id(attr); + g_return_val_if_fail(id, NULL); + + attr_value = gaim_status_get_attr_value(status, id); + g_return_val_if_fail(attr_value, NULL); + attr_type = gaim_value_get_type(attr_value); + + /* + * If attr_value is a different type than it should be + * then don't write it to the file. + */ + default_attr = gaim_status_type_get_attr(type, id); + default_value = gaim_status_attr_get_value(default_attr); + if (attr_type != gaim_value_get_type(default_value)) + return NULL; + + /* + * If attr_value is the same as the default for this status + * then there is no need to write it to the file. + */ + if (attr_type == GAIM_TYPE_STRING) + { + const char *string_value = gaim_value_get_string(attr_value); + const char *default_string_value = gaim_value_get_string(default_value); + if (((string_value == NULL) && (default_string_value == NULL)) || + ((string_value != NULL) && (default_string_value != NULL) && + !strcmp(string_value, default_string_value))) + return NULL; + value = g_strdup(gaim_value_get_string(attr_value)); + } + else if (attr_type == GAIM_TYPE_INT) + { + int int_value = gaim_value_get_int(attr_value); + if (int_value == gaim_value_get_int(default_value)) + return NULL; + value = g_strdup_printf("%d", int_value); + } + else if (attr_type == GAIM_TYPE_BOOLEAN) + { + gboolean boolean_value = gaim_value_get_boolean(attr_value); + if (boolean_value == gaim_value_get_boolean(default_value)) + return NULL; + value = g_strdup(boolean_value ? + "true" : "false"); + } + else + { + return NULL; + } + + g_return_val_if_fail(value, NULL); + + node = xmlnode_new("attribute"); + + xmlnode_set_attrib(node, "id", id); + xmlnode_set_attrib(node, "value", value); + + g_free(value); + + return node; +} + +static xmlnode * +status_attrs_to_xmlnode(const GaimStatus *status) +{ + GaimStatusType *type = gaim_status_get_type(status); + xmlnode *node, *child; + const GList *attrs, *attr; + + node = xmlnode_new("attributes"); + + attrs = gaim_status_type_get_attrs(type); + for (attr = attrs; attr != NULL; attr = attr->next) + { + child = status_attr_to_xmlnode(status, type, (const GaimStatusAttr *)attr->data); + if (child) + xmlnode_insert_child(node, child); + } + + return node; +} + +static xmlnode * +status_to_xmlnode(const GaimStatus *status) +{ + xmlnode *node, *child; + + node = xmlnode_new("status"); + xmlnode_set_attrib(node, "type", gaim_status_get_id(status)); + if (gaim_status_get_name(status) != NULL) + xmlnode_set_attrib(node, "name", gaim_status_get_name(status)); + xmlnode_set_attrib(node, "active", gaim_status_is_active(status) ? "true" : "false"); + + child = status_attrs_to_xmlnode(status); + xmlnode_insert_child(node, child); + + return node; +} + +static xmlnode * +statuses_to_xmlnode(const GaimPresence *presence) +{ + xmlnode *node, *child; + const GList *statuses, *status; + + node = xmlnode_new("statuses"); + + statuses = gaim_presence_get_statuses(presence); + for (status = statuses; status != NULL; status = status->next) + { + child = status_to_xmlnode((GaimStatus *)status->data); + xmlnode_insert_child(node, child); + } + + return node; +} + +static xmlnode * +proxy_settings_to_xmlnode(GaimProxyInfo *proxy_info) +{ + xmlnode *node, *child; + GaimProxyType proxy_type; + const char *value; + int int_value; + char buf[20]; + + proxy_type = gaim_proxy_info_get_type(proxy_info); + + node = xmlnode_new("proxy"); + + child = xmlnode_new_child(node, "type"); + xmlnode_insert_data(child, + (proxy_type == GAIM_PROXY_USE_GLOBAL ? "global" : + proxy_type == GAIM_PROXY_NONE ? "none" : + proxy_type == GAIM_PROXY_HTTP ? "http" : + proxy_type == GAIM_PROXY_SOCKS4 ? "socks4" : + proxy_type == GAIM_PROXY_SOCKS5 ? "socks5" : + proxy_type == GAIM_PROXY_USE_ENVVAR ? "envvar" : "unknown"), -1); + + if (proxy_type != GAIM_PROXY_USE_GLOBAL && + proxy_type != GAIM_PROXY_NONE && + proxy_type != GAIM_PROXY_USE_ENVVAR) + { + if ((value = gaim_proxy_info_get_host(proxy_info)) != NULL) + { + child = xmlnode_new_child(node, "host"); + xmlnode_insert_data(child, value, -1); + } + + if ((int_value = gaim_proxy_info_get_port(proxy_info)) != 0) + { + snprintf(buf, sizeof(buf), "%d", int_value); + child = xmlnode_new_child(node, "port"); + xmlnode_insert_data(child, buf, -1); + } + + if ((value = gaim_proxy_info_get_username(proxy_info)) != NULL) + { + child = xmlnode_new_child(node, "username"); + xmlnode_insert_data(child, value, -1); + } + + if ((value = gaim_proxy_info_get_password(proxy_info)) != NULL) + { + child = xmlnode_new_child(node, "password"); + xmlnode_insert_data(child, value, -1); + } + } + + return node; +} + +static xmlnode * +account_to_xmlnode(GaimAccount *account) +{ + xmlnode *node, *child; + const char *tmp; + GaimPresence *presence; + GaimProxyInfo *proxy_info; + + node = xmlnode_new("account"); + + child = xmlnode_new_child(node, "protocol"); + xmlnode_insert_data(child, gaim_account_get_protocol_id(account), -1); + + child = xmlnode_new_child(node, "name"); + xmlnode_insert_data(child, gaim_account_get_username(account), -1); + + if (gaim_account_get_remember_password(account) && + ((tmp = gaim_account_get_password(account)) != NULL)) + { + child = xmlnode_new_child(node, "password"); + xmlnode_insert_data(child, tmp, -1); + } + + if ((tmp = gaim_account_get_alias(account)) != NULL) + { + child = xmlnode_new_child(node, "alias"); + xmlnode_insert_data(child, tmp, -1); + } + + if ((presence = gaim_account_get_presence(account)) != NULL) + { + child = statuses_to_xmlnode(presence); + xmlnode_insert_child(node, child); + } + + if ((tmp = gaim_account_get_user_info(account)) != NULL) + { + /* TODO: Do we need to call gaim_str_strip_char(tmp, '\r') here? */ + child = xmlnode_new_child(node, "userinfo"); + xmlnode_insert_data(child, tmp, -1); + } + + if ((tmp = gaim_account_get_buddy_icon(account)) != NULL) + { + child = xmlnode_new_child(node, "buddyicon"); + xmlnode_insert_data(child, tmp, -1); + } + + if (g_hash_table_size(account->settings) > 0) + { + child = xmlnode_new_child(node, "settings"); + g_hash_table_foreach(account->settings, setting_to_xmlnode, child); + } + + if (g_hash_table_size(account->ui_settings) > 0) + { + g_hash_table_foreach(account->ui_settings, ui_setting_to_xmlnode, node); + } + + if ((proxy_info = gaim_account_get_proxy_info(account)) != NULL) + { + child = proxy_settings_to_xmlnode(proxy_info); + xmlnode_insert_child(node, child); + } + + return node; +} + +static xmlnode * +accounts_to_xmlnode(void) +{ + xmlnode *node, *child; + GList *cur; + + node = xmlnode_new("account"); + xmlnode_set_attrib(node, "version", "1.0"); + + for (cur = gaim_accounts_get_all(); cur != NULL; cur = cur->next) + { + child = account_to_xmlnode(cur->data); + xmlnode_insert_child(node, child); + } + + return node; +} + +static void +sync_accounts(void) +{ + xmlnode *node; + char *data; + + if (!accounts_loaded) + { + gaim_debug_error("account", "Attempted to save accounts before " + "they were read!\n"); + return; + } + + node = accounts_to_xmlnode(); + data = xmlnode_to_formatted_str(node, NULL); + gaim_util_write_data_to_file("accounts.xml", data, -1); + g_free(data); + xmlnode_free(node); +} + +static gboolean +save_cb(gpointer data) +{ + sync_accounts(); + save_timer = 0; + return FALSE; +} + +static void +schedule_accounts_save() +{ + if (save_timer == 0) + save_timer = gaim_timeout_add(5000, save_cb, NULL); +} + + +/********************************************************************* + * Reading from disk * + *********************************************************************/ + +static void +parse_settings(xmlnode *node, GaimAccount *account) +{ + const char *ui; + xmlnode *child; + + /* Get the UI string, if these are UI settings */ + ui = xmlnode_get_attrib(node, "ui"); + + /* Read settings, one by one */ + for (child = xmlnode_get_child(node, "setting"); child != NULL; + child = xmlnode_get_next_twin(child)) + { + const char *name, *str_type; + GaimPrefType type; + char *data; + + name = xmlnode_get_attrib(child, "name"); + if (name == NULL) + /* Ignore this setting */ + continue; + + str_type = xmlnode_get_attrib(child, "type"); + if (str_type == NULL) + /* Ignore this setting */ + continue; + + if (!strcmp(str_type, "string")) + type = GAIM_PREF_STRING; + else if (!strcmp(str_type, "int")) + type = GAIM_PREF_INT; + else if (!strcmp(str_type, "bool")) + type = GAIM_PREF_BOOLEAN; + else + /* Ignore this setting */ + continue; + + data = xmlnode_get_data(child); + if (data == NULL) + /* Ignore this setting */ + continue; + + if (ui == NULL) + { + if (type == GAIM_PREF_STRING) + gaim_account_set_string(account, name, data); + else if (type == GAIM_PREF_INT) + gaim_account_set_int(account, name, atoi(data)); + else if (type == GAIM_PREF_BOOLEAN) + gaim_account_set_bool(account, name, + (*data == '0' ? FALSE : TRUE)); + } else { + if (type == GAIM_PREF_STRING) + gaim_account_set_ui_string(account, ui, name, data); + else if (type == GAIM_PREF_INT) + gaim_account_set_ui_int(account, ui, name, atoi(data)); + else if (type == GAIM_PREF_BOOLEAN) + gaim_account_set_ui_bool(account, ui, name, + (*data == '0' ? FALSE : TRUE)); + } + + g_free(data); + } +} + +static GList * +parse_status_attrs(xmlnode *node, GaimStatus *status) +{ + GList *list = NULL; + xmlnode *child; + GaimValue *attr_value; + + for (child = xmlnode_get_child(node, "attribute"); child != NULL; + child = xmlnode_get_next_twin(child)) + { + const char *id = xmlnode_get_attrib(child, "id"); + const char *value = xmlnode_get_attrib(child, "value"); + + if (!id || !*id || !value || !*value) + continue; + + attr_value = gaim_status_get_attr_value(status, id); + if (!attr_value) + continue; + + list = g_list_append(list, (char *)id); + + switch (gaim_value_get_type(attr_value)) + { + case GAIM_TYPE_STRING: + list = g_list_append(list, (char *)value); + break; + case GAIM_TYPE_INT: + case GAIM_TYPE_BOOLEAN: + { + int v; + if (sscanf(value, "%d", &v) == 1) + list = g_list_append(list, GINT_TO_POINTER(v)); + else + list = g_list_remove(list, id); + break; + } + default: + break; + } + } + + return list; +} + +static void +parse_status(xmlnode *node, GaimAccount *account) +{ + gboolean active = FALSE; + const char *data; + const char *type; + xmlnode *child; + GList *attrs = NULL; + + /* Get the active/inactive state */ + data = xmlnode_get_attrib(node, "active"); + if (data == NULL) + return; + if (strcasecmp(data, "true") == 0) + active = TRUE; + else if (strcasecmp(data, "false") == 0) + active = FALSE; + else + return; + + /* Get the type of the status */ + type = xmlnode_get_attrib(node, "type"); + if (type == NULL) + return; + + /* Read attributes into a GList */ + child = xmlnode_get_child(node, "attributes"); + if (child != NULL) + { + attrs = parse_status_attrs(child, + gaim_account_get_status(account, type)); + } + + gaim_account_set_status_list(account, type, active, attrs); + + g_list_free(attrs); +} + +static void +parse_statuses(xmlnode *node, GaimAccount *account) +{ + xmlnode *child; + + for (child = xmlnode_get_child(node, "status"); child != NULL; + child = xmlnode_get_next_twin(child)) + { + parse_status(child, account); + } +} + +static void +parse_proxy_info(xmlnode *node, GaimAccount *account) +{ + GaimProxyInfo *proxy_info; + xmlnode *child; + char *data; + + proxy_info = gaim_proxy_info_new(); + + /* Use the global proxy settings, by default */ + gaim_proxy_info_set_type(proxy_info, GAIM_PROXY_USE_GLOBAL); + + /* Read proxy type */ + child = xmlnode_get_child(node, "type"); + if ((child != NULL) && ((data = xmlnode_get_data(child)) != NULL)) + { + if (!strcmp(data, "global")) + gaim_proxy_info_set_type(proxy_info, GAIM_PROXY_USE_GLOBAL); + else if (!strcmp(data, "none")) + gaim_proxy_info_set_type(proxy_info, GAIM_PROXY_NONE); + else if (!strcmp(data, "http")) + gaim_proxy_info_set_type(proxy_info, GAIM_PROXY_HTTP); + else if (!strcmp(data, "socks4")) + gaim_proxy_info_set_type(proxy_info, GAIM_PROXY_SOCKS4); + else if (!strcmp(data, "socks5")) + gaim_proxy_info_set_type(proxy_info, GAIM_PROXY_SOCKS5); + else if (!strcmp(data, "envvar")) + gaim_proxy_info_set_type(proxy_info, GAIM_PROXY_USE_ENVVAR); + else + { + gaim_debug_error("account", "Invalid proxy type found when " + "loading account information for %s\n", + gaim_account_get_username(account)); + } + g_free(data); + } + + /* Read proxy host */ + child = xmlnode_get_child(node, "host"); + if ((child != NULL) && ((data = xmlnode_get_data(child)) != NULL)) + { + gaim_proxy_info_set_host(proxy_info, data); + g_free(data); + } + + /* Read proxy port */ + child = xmlnode_get_child(node, "port"); + if ((child != NULL) && ((data = xmlnode_get_data(child)) != NULL)) + { + gaim_proxy_info_set_port(proxy_info, atoi(data)); + g_free(data); + } + + /* Read proxy username */ + child = xmlnode_get_child(node, "username"); + if ((child != NULL) && ((data = xmlnode_get_data(child)) != NULL)) + { + gaim_proxy_info_set_username(proxy_info, data); + g_free(data); + } + + /* Read proxy password */ + child = xmlnode_get_child(node, "password"); + if ((child != NULL) && ((data = xmlnode_get_data(child)) != NULL)) + { + gaim_proxy_info_set_password(proxy_info, data); + g_free(data); + } + + /* If there are no values set then proxy_infourn NULL */ + if ((gaim_proxy_info_get_type(proxy_info) == GAIM_PROXY_USE_GLOBAL) && + (gaim_proxy_info_get_host(proxy_info) == NULL) && + (gaim_proxy_info_get_port(proxy_info) == 0) && + (gaim_proxy_info_get_username(proxy_info) == NULL) && + (gaim_proxy_info_get_password(proxy_info) == NULL)) + { + gaim_proxy_info_destroy(proxy_info); + return; + } + + gaim_account_set_proxy_info(account, proxy_info); +} + +static GaimAccount * +parse_account(xmlnode *node) +{ + GaimAccount *ret; + xmlnode *child; + char *protocol_id = NULL; + char *name = NULL; + char *data; + + child = xmlnode_get_child(node, "protocol"); + if (child != NULL) + protocol_id = xmlnode_get_data(child); + + child = xmlnode_get_child(node, "name"); + if (child != NULL) + name = xmlnode_get_data(child); + if (name == NULL) + { + /* Do we really need to do this? */ + child = xmlnode_get_child(node, "username"); + if (child != NULL) + name = xmlnode_get_data(child); + } + + if ((protocol_id == NULL) || (name == NULL)) + { + g_free(protocol_id); + g_free(name); + return NULL; + } + + ret = gaim_account_new(name, protocol_id); + g_free(name); + g_free(protocol_id); + + /* Read the password */ + child = xmlnode_get_child(node, "password"); + if ((child != NULL) && ((data = xmlnode_get_data(child)) != NULL)) + { + gaim_account_set_remember_password(ret, TRUE); + gaim_account_set_password(ret, data); + g_free(data); + } + + /* Read the alias */ + child = xmlnode_get_child(node, "alias"); + if ((child != NULL) && ((data = xmlnode_get_data(child)) != NULL)) + { + if (*data != '\0') + gaim_account_set_alias(ret, data); + g_free(data); + } + + /* Read the statuses */ + child = xmlnode_get_child(node, "statuses"); + if (child != NULL) + { + parse_statuses(child, ret); + } + + /* Read the userinfo */ + child = xmlnode_get_child(node, "userinfo"); + if ((child != NULL) && ((data = xmlnode_get_data(child)) != NULL)) + { + gaim_account_set_user_info(ret, data); + g_free(data); + } + + /* Read the buddyicon */ + child = xmlnode_get_child(node, "buddyicon"); + if ((child != NULL) && ((data = xmlnode_get_data(child)) != NULL)) + { + gaim_account_set_buddy_icon(ret, data); + g_free(data); + } + + /* Read settings (both core and UI) */ + for (child = xmlnode_get_child(node, "settings"); child != NULL; + child = xmlnode_get_next_twin(child)) + { + parse_settings(child, ret); + } + + /* Read proxy */ + child = xmlnode_get_child(node, "proxy"); + if (child != NULL) + { + parse_proxy_info(child, ret); + } + + return ret; +} + +static void +load_accounts(void) +{ + xmlnode *node, *child; + + accounts_loaded = TRUE; + + node = gaim_util_read_xml_from_file("accounts.xml", _("accounts")); + + if (node == NULL) + return; + + for (child = xmlnode_get_child(node, "account"); child != NULL; + child = xmlnode_get_next_twin(child)) + { + GaimAccount *new_acct; + new_acct = parse_account(child); + gaim_accounts_add(new_acct); + } + + xmlnode_free(node); +} + + +static void +delete_setting(void *data) +{ + GaimAccountSetting *setting = (GaimAccountSetting *)data; + + g_free(setting->ui); + + if (setting->type == GAIM_PREF_STRING) + g_free(setting->value.string); + + g_free(setting); +} + +GaimAccount * +gaim_account_new(const char *username, const char *protocol_id) +{ + GaimAccount *account = NULL; + GaimPlugin *prpl = NULL; + GaimPluginProtocolInfo *prpl_info = NULL; + GaimStatusType *status_type; + + g_return_val_if_fail(username != NULL, NULL); + g_return_val_if_fail(protocol_id != NULL, NULL); + + account = gaim_accounts_find(username, protocol_id); + + if (account != NULL) + return account; + + account = g_new0(GaimAccount, 1); + GAIM_DBUS_REGISTER_POINTER(account, GaimAccount); + + gaim_account_set_username(account, username); + + gaim_account_set_protocol_id(account, protocol_id); + + account->settings = g_hash_table_new_full(g_str_hash, g_str_equal, + g_free, delete_setting); + account->ui_settings = g_hash_table_new_full(g_str_hash, g_str_equal, + g_free, (GDestroyNotify)g_hash_table_destroy); + account->system_log = NULL; + /* 0 is not a valid privacy setting */ + account->perm_deny = GAIM_PRIVACY_ALLOW_ALL; + + account->presence = gaim_presence_new_for_account(account); + + prpl = gaim_find_prpl(protocol_id); + + if (prpl == NULL) + return account; + + prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(prpl); + if (prpl_info != NULL && prpl_info->status_types != NULL) + gaim_account_set_status_types(account, prpl_info->status_types(account)); + + status_type = gaim_account_get_status_type_with_primitive(account, GAIM_STATUS_AVAILABLE); + if (status_type != NULL) + gaim_presence_set_status_active(account->presence, + gaim_status_type_get_id(status_type), + TRUE); + else + gaim_presence_set_status_active(account->presence, + "offline", + TRUE); + + return account; +} + +void +gaim_account_destroy(GaimAccount *account) +{ + GList *l; + + g_return_if_fail(account != NULL); + + gaim_debug_info("account", "Destroying account %p\n", account); + + for (l = gaim_get_conversations(); l != NULL; l = l->next) + { + GaimConversation *conv = (GaimConversation *)l->data; + + if (gaim_conversation_get_account(conv) == account) + gaim_conversation_set_account(conv, NULL); + } + + g_free(account->username); + g_free(account->alias); + g_free(account->password); + g_free(account->user_info); + g_free(account->protocol_id); + + g_hash_table_destroy(account->settings); + g_hash_table_destroy(account->ui_settings); + + gaim_account_set_status_types(account, NULL); + + gaim_presence_destroy(account->presence); + + if(account->system_log) + gaim_log_free(account->system_log); + + GAIM_DBUS_UNREGISTER_POINTER(account); + g_free(account); +} + +void +gaim_account_register(GaimAccount *account) +{ + g_return_if_fail(account != NULL); + + gaim_debug_info("account", "Registering account %s\n", + gaim_account_get_username(account)); + + gaim_connection_new(account, TRUE, NULL); +} + +static void +request_password_ok_cb(GaimAccount *account, GaimRequestFields *fields) +{ + const char *entry; + gboolean remember; + + entry = gaim_request_fields_get_string(fields, "password"); + remember = gaim_request_fields_get_bool(fields, "remember"); + + if (!entry || !*entry) + { + gaim_notify_error(account, NULL, _("Password is required to sign on."), NULL); + return; + } + + if(remember) + gaim_account_set_remember_password(account, TRUE); + + gaim_account_set_password(account, entry); + + gaim_connection_new(account, FALSE, entry); +} + +static void +request_password(GaimAccount *account) +{ + gchar *primary; + const gchar *username; + GaimRequestFieldGroup *group; + GaimRequestField *field; + GaimRequestFields *fields; + + /* Close any previous password request windows */ + gaim_request_close_with_handle(account); + + username = gaim_account_get_username(account); + primary = g_strdup_printf(_("Enter password for %s (%s)"), username, + gaim_account_get_protocol_name(account)); + + fields = gaim_request_fields_new(); + group = gaim_request_field_group_new(NULL); + gaim_request_fields_add_group(fields, group); + + field = gaim_request_field_string_new("password", _("Enter Password"), NULL, FALSE); + gaim_request_field_string_set_masked(field, TRUE); + gaim_request_field_set_required(field, TRUE); + gaim_request_field_group_add_field(group, field); + + field = gaim_request_field_bool_new("remember", _("Save password"), FALSE); + gaim_request_field_group_add_field(group, field); + + gaim_request_fields(account, + NULL, + primary, + NULL, + fields, + _("OK"), G_CALLBACK(request_password_ok_cb), + _("Cancel"), NULL, + account); + g_free(primary); +} + +void +gaim_account_connect(GaimAccount *account) +{ + GaimPlugin *prpl; + GaimPluginProtocolInfo *prpl_info; + const char *password; + + g_return_if_fail(account != NULL); + + gaim_debug_info("account", "Connecting to account %s\n", + gaim_account_get_username(account)); + + if (!gaim_account_get_enabled(account, gaim_core_get_ui())) + return; + + prpl = gaim_find_prpl(gaim_account_get_protocol_id(account)); + if (prpl == NULL) + { + gchar *message; + + message = g_strdup_printf(_("Missing protocol plugin for %s"), + gaim_account_get_username(account)); + gaim_notify_error(account, _("Connection Error"), message, NULL); + g_free(message); + return; + } + + prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(prpl); + password = gaim_account_get_password(account); + if ((password == NULL) && + !(prpl_info->options & OPT_PROTO_NO_PASSWORD) && + !(prpl_info->options & OPT_PROTO_PASSWORD_OPTIONAL)) + request_password(account); + else + gaim_connection_new(account, FALSE, password); +} + +void +gaim_account_disconnect(GaimAccount *account) +{ + GaimConnection *gc; + + g_return_if_fail(account != NULL); + g_return_if_fail(!gaim_account_is_disconnected(account)); + + gaim_debug_info("account", "Disconnecting account %p\n", account); + + account->disconnecting = TRUE; + + gc = gaim_account_get_connection(account); + gaim_connection_destroy(gc); + if (!gaim_account_get_remember_password(account)) + gaim_account_set_password(account, NULL); + gaim_account_set_connection(account, NULL); + + account->disconnecting = FALSE; +} + +void +gaim_account_notify_added(GaimAccount *account, const char *remote_user, + const char *id, const char *alias, + const char *message) +{ + GaimAccountUiOps *ui_ops; + + g_return_if_fail(account != NULL); + g_return_if_fail(remote_user != NULL); + + ui_ops = gaim_accounts_get_ui_ops(); + + if (ui_ops != NULL && ui_ops->notify_added != NULL) + ui_ops->notify_added(account, remote_user, id, alias, message); +} + +void +gaim_account_request_add(GaimAccount *account, const char *remote_user, + const char *id, const char *alias, + const char *message) +{ + GaimAccountUiOps *ui_ops; + + g_return_if_fail(account != NULL); + g_return_if_fail(remote_user != NULL); + + ui_ops = gaim_accounts_get_ui_ops(); + + if (ui_ops != NULL && ui_ops->request_add != NULL) + ui_ops->request_add(account, remote_user, id, alias, message); +} + +static void +change_password_cb(GaimAccount *account, GaimRequestFields *fields) +{ + const char *orig_pass, *new_pass_1, *new_pass_2; + + orig_pass = gaim_request_fields_get_string(fields, "password"); + new_pass_1 = gaim_request_fields_get_string(fields, "new_password_1"); + new_pass_2 = gaim_request_fields_get_string(fields, "new_password_2"); + + if (g_utf8_collate(new_pass_1, new_pass_2)) + { + gaim_notify_error(account, NULL, + _("New passwords do not match."), NULL); + + return; + } + + if (orig_pass == NULL || new_pass_1 == NULL || new_pass_2 == NULL || + *orig_pass == '\0' || *new_pass_1 == '\0' || *new_pass_2 == '\0') + { + gaim_notify_error(account, NULL, + _("Fill out all fields completely."), NULL); + return; + } + + gaim_account_change_password(account, orig_pass, new_pass_1); +} + +void +gaim_account_request_change_password(GaimAccount *account) +{ + GaimRequestFields *fields; + GaimRequestFieldGroup *group; + GaimRequestField *field; + char primary[256]; + + g_return_if_fail(account != NULL); + g_return_if_fail(gaim_account_is_connected(account)); + + fields = gaim_request_fields_new(); + + group = gaim_request_field_group_new(NULL); + gaim_request_fields_add_group(fields, group); + + field = gaim_request_field_string_new("password", _("Original password"), + NULL, FALSE); + gaim_request_field_string_set_masked(field, TRUE); + gaim_request_field_set_required(field, TRUE); + gaim_request_field_group_add_field(group, field); + + field = gaim_request_field_string_new("new_password_1", + _("New password"), + NULL, FALSE); + gaim_request_field_string_set_masked(field, TRUE); + gaim_request_field_set_required(field, TRUE); + gaim_... [truncated message content] |
From: <ev...@us...> - 2006-08-19 00:56:03
|
Revision: 16855 Author: evands Date: 2006-08-18 17:52:24 -0700 (Fri, 18 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16855&view=rev Log Message: ----------- ** Part 1 of a 4 part commit ** Restructured the tree and the build files for the core/UI split. libgaim is now built as a library against which gtkgaim and gntgaim link and can be built separately from them by configuring with them disable d (--disable-gtkgaim and --disable-gntgaim). Each of the three source trees (gtk, console, and core) has its own plugins folder. This works nicely on my system; hopefully it won't cause too much chaos for others. If you have local changes, an easy way to merge them to the new layout should be along the lines of svn diff -r version_before_move > myChanges.diff patch -p1 < myChanges.diff where svn diff is done from the gaim checkout root but patch is done from gtk or core (or both). This changeset combines work by Sadrul Chowdhury, Gary Kramlich (grim), and me. Known issues: * On my system, at least, something's not quite right with the gtkgaim build process; it imports gtkgaim.h (as can be seen by adding a #warning) but <gtk/gtk.h> doesn't seem to be used. The GTK_STOCK_XXX defi nes claim to be undeclared. I was going to make this work before committing, but I strongly suspect someone with more autotools experience will be able to fix it easily whereas I've already glared at it for a n hour. * The gnt console UI depends on libgnt, which is not yet automatically built. Either autogen.sh && make && make install libgnt (in console/libgnt) or configure with --disable-gnt for now. * The Windows build process has not been touched yet so still needs updating. * There's an stray "rm: core: is a directory" warning after autogen.sh is compl te. I'm not sure where that's coming from. Added Paths: ----------- trunk/gtk/ trunk/gtk/Makefile.am trunk/gtk/gaimcombobox.c trunk/gtk/gaimcombobox.h trunk/gtk/gaimstock.c trunk/gtk/gaimstock.h trunk/gtk/getopt.c trunk/gtk/getopt.h trunk/gtk/getopt1.c trunk/gtk/gtkaccount.c trunk/gtk/gtkaccount.h trunk/gtk/gtkblist.c trunk/gtk/gtkblist.h trunk/gtk/gtkcelllayout.c trunk/gtk/gtkcelllayout.h trunk/gtk/gtkcellrendererprogress.c trunk/gtk/gtkcellrendererprogress.h trunk/gtk/gtkcellview.c trunk/gtk/gtkcellview.h trunk/gtk/gtkcellviewmenuitem.c trunk/gtk/gtkcellviewmenuitem.h trunk/gtk/gtkconn.c trunk/gtk/gtkconn.h trunk/gtk/gtkconv.c trunk/gtk/gtkconv.h trunk/gtk/gtkconvwin.h trunk/gtk/gtkdebug.c trunk/gtk/gtkdebug.h trunk/gtk/gtkdialogs.c trunk/gtk/gtkdialogs.h trunk/gtk/gtkdnd-hints.c trunk/gtk/gtkdnd-hints.h trunk/gtk/gtkeventloop.c trunk/gtk/gtkeventloop.h trunk/gtk/gtkexpander.c trunk/gtk/gtkexpander.h trunk/gtk/gtkft.c trunk/gtk/gtkft.h trunk/gtk/gtkgaim.h trunk/gtk/gtkidle.c trunk/gtk/gtkidle.h trunk/gtk/gtkimhtml.c trunk/gtk/gtkimhtml.h trunk/gtk/gtkimhtmltoolbar.c trunk/gtk/gtkimhtmltoolbar.h trunk/gtk/gtklog.c trunk/gtk/gtklog.h trunk/gtk/gtkmain.c trunk/gtk/gtkmenutray.c trunk/gtk/gtkmenutray.h trunk/gtk/gtknickcolors.h trunk/gtk/gtknotify.c trunk/gtk/gtknotify.h trunk/gtk/gtkplugin.c trunk/gtk/gtkplugin.h trunk/gtk/gtkpluginpref.c trunk/gtk/gtkpluginpref.h trunk/gtk/gtkpounce.c trunk/gtk/gtkpounce.h trunk/gtk/gtkprefs.c trunk/gtk/gtkprefs.h trunk/gtk/gtkprivacy.c trunk/gtk/gtkprivacy.h trunk/gtk/gtkrequest.c trunk/gtk/gtkrequest.h trunk/gtk/gtkroomlist.c trunk/gtk/gtkroomlist.h trunk/gtk/gtksavedstatuses.c trunk/gtk/gtksavedstatuses.h trunk/gtk/gtksession.c trunk/gtk/gtksession.h trunk/gtk/gtksound.c trunk/gtk/gtksound.h trunk/gtk/gtksourceiter.c trunk/gtk/gtksourceiter.h trunk/gtk/gtkstatusbox.c trunk/gtk/gtkstatusbox.h trunk/gtk/gtkstock.h trunk/gtk/gtkthemes.c trunk/gtk/gtkthemes.h trunk/gtk/gtkutils.c trunk/gtk/gtkutils.h trunk/gtk/gtkwhiteboard.c trunk/gtk/gtkwhiteboard.h trunk/gtk/pixmaps/ trunk/gtk/pixmaps/Makefile.am trunk/gtk/pixmaps/Makefile.mingw trunk/gtk/pixmaps/about_menu.png trunk/gtk/pixmaps/accounts.png trunk/gtk/pixmaps/away.png trunk/gtk/pixmaps/change-bgcolor-small.png trunk/gtk/pixmaps/change-fgcolor-small.png trunk/gtk/pixmaps/connect.png trunk/gtk/pixmaps/edit.png trunk/gtk/pixmaps/gaim-install.ico trunk/gtk/pixmaps/gaim.ico trunk/gtk/pixmaps/gaim.png trunk/gtk/pixmaps/gaim.svg trunk/gtk/pixmaps/gaim_16.ico trunk/gtk/pixmaps/gaim_4bit_16.ico trunk/gtk/pixmaps/gaim_auth.png trunk/gtk/pixmaps/gaim_away.ico trunk/gtk/pixmaps/gaim_away_16.ico trunk/gtk/pixmaps/gaim_away_4bit_16.ico trunk/gtk/pixmaps/gaim_blank_4bit_16.ico trunk/gtk/pixmaps/gaim_cool.png trunk/gtk/pixmaps/gaim_error.png trunk/gtk/pixmaps/gaim_info.png trunk/gtk/pixmaps/gaim_msgpend_16.ico trunk/gtk/pixmaps/gaim_msgpend_4bit_16.ico trunk/gtk/pixmaps/gaim_msgunread_16.ico trunk/gtk/pixmaps/gaim_msgunread_4bit_16.ico trunk/gtk/pixmaps/gaim_offline.ico trunk/gtk/pixmaps/gaim_offline_16.ico trunk/gtk/pixmaps/gaim_offline_4bit_16.ico trunk/gtk/pixmaps/gaim_question.png trunk/gtk/pixmaps/gaim_warning.png trunk/gtk/pixmaps/info.png trunk/gtk/pixmaps/insert-image-small.png trunk/gtk/pixmaps/insert-link-small.png trunk/gtk/pixmaps/insert-smiley-small.png trunk/gtk/pixmaps/logo.png trunk/gtk/pixmaps/msgpend.png trunk/gtk/pixmaps/msgunread.png trunk/gtk/pixmaps/offline.png trunk/gtk/pixmaps/online.png trunk/gtk/pixmaps/pause.png trunk/gtk/pixmaps/phone.png trunk/gtk/pixmaps/send-im.png trunk/gtk/pixmaps/smileys/ trunk/gtk/pixmaps/status/ trunk/gtk/pixmaps/status-away.png trunk/gtk/pixmaps/status-connect0.png trunk/gtk/pixmaps/status-connect1.png trunk/gtk/pixmaps/status-connect2.png trunk/gtk/pixmaps/status-connect3.png trunk/gtk/pixmaps/status-invisible.png trunk/gtk/pixmaps/status-offline.png trunk/gtk/pixmaps/status-online.png trunk/gtk/pixmaps/status-typing0.png trunk/gtk/pixmaps/status-typing1.png trunk/gtk/pixmaps/status-typing2.png trunk/gtk/pixmaps/status-typing3.png trunk/gtk/pixmaps/stock_connect_16.png trunk/gtk/pixmaps/stock_disconnect_16.png trunk/gtk/pixmaps/tb_drag_arrow_down.xpm trunk/gtk/pixmaps/tb_drag_arrow_left.xpm trunk/gtk/pixmaps/tb_drag_arrow_right.xpm trunk/gtk/pixmaps/tb_drag_arrow_up.xpm trunk/gtk/pixmaps/text_bigger.png trunk/gtk/pixmaps/text_normal.png trunk/gtk/pixmaps/text_smaller.png trunk/gtk/pixmaps/typed.png trunk/gtk/pixmaps/typing.png trunk/gtk/plugins/ trunk/gtk/plugins/Makefile.am trunk/gtk/plugins/contact_priority.c trunk/gtk/plugins/crazychat/ trunk/gtk/plugins/crazychat/Makefile.am trunk/gtk/plugins/crazychat/QTUtilities.c trunk/gtk/plugins/crazychat/QTUtilities.h trunk/gtk/plugins/crazychat/Utilities.c trunk/gtk/plugins/crazychat/Utilities.h trunk/gtk/plugins/crazychat/camdata.c trunk/gtk/plugins/crazychat/camdata.h trunk/gtk/plugins/crazychat/camproc.c trunk/gtk/plugins/crazychat/camproc.h trunk/gtk/plugins/crazychat/cc_features.c trunk/gtk/plugins/crazychat/cc_gaim_plugin.c trunk/gtk/plugins/crazychat/cc_gtk_gl.c trunk/gtk/plugins/crazychat/cc_gtk_gl.h trunk/gtk/plugins/crazychat/cc_interface.h trunk/gtk/plugins/crazychat/cc_network.c trunk/gtk/plugins/crazychat/cc_network.h trunk/gtk/plugins/crazychat/cc_output.c trunk/gtk/plugins/crazychat/configure.ac trunk/gtk/plugins/crazychat/crazychat.c trunk/gtk/plugins/crazychat/crazychat.h trunk/gtk/plugins/crazychat/dog_lids.c trunk/gtk/plugins/crazychat/dog_lids.h trunk/gtk/plugins/crazychat/doggy.c trunk/gtk/plugins/crazychat/doggy.h trunk/gtk/plugins/crazychat/draw.c trunk/gtk/plugins/crazychat/eye.c trunk/gtk/plugins/crazychat/eye.h trunk/gtk/plugins/crazychat/eyes.c trunk/gtk/plugins/crazychat/eyes.h trunk/gtk/plugins/crazychat/face.c trunk/gtk/plugins/crazychat/face.h trunk/gtk/plugins/crazychat/filter.c trunk/gtk/plugins/crazychat/filter.h trunk/gtk/plugins/crazychat/glm.c trunk/gtk/plugins/crazychat/glm.h trunk/gtk/plugins/crazychat/lids.c trunk/gtk/plugins/crazychat/lids.h trunk/gtk/plugins/crazychat/main.c trunk/gtk/plugins/crazychat/mat_struct.h trunk/gtk/plugins/crazychat/models.c trunk/gtk/plugins/crazychat/models.h trunk/gtk/plugins/crazychat/sharky.c trunk/gtk/plugins/crazychat/sharky.h trunk/gtk/plugins/crazychat/test.h trunk/gtk/plugins/crazychat/util.h trunk/gtk/plugins/docklet/ trunk/gtk/plugins/docklet/Makefile.am trunk/gtk/plugins/docklet/Makefile.mingw trunk/gtk/plugins/docklet/MinimizeToTray.c trunk/gtk/plugins/docklet/MinimizeToTray.h trunk/gtk/plugins/docklet/docklet-win32.c trunk/gtk/plugins/docklet/docklet-x11.c trunk/gtk/plugins/docklet/docklet.c trunk/gtk/plugins/docklet/docklet.h trunk/gtk/plugins/docklet/eggtrayicon.c trunk/gtk/plugins/docklet/eggtrayicon.h trunk/gtk/plugins/extplacement.c trunk/gtk/plugins/gaiminc.c trunk/gtk/plugins/gaimrc.c trunk/gtk/plugins/gestures/ trunk/gtk/plugins/gestures/Makefile.am trunk/gtk/plugins/gestures/gestures.c trunk/gtk/plugins/gestures/gstroke-internal.h trunk/gtk/plugins/gestures/gstroke.h trunk/gtk/plugins/gestures/stroke-draw.c trunk/gtk/plugins/gestures/stroke.c trunk/gtk/plugins/gevolution/ trunk/gtk/plugins/gevolution/Makefile.am trunk/gtk/plugins/gevolution/add_buddy_dialog.c trunk/gtk/plugins/gevolution/assoc-buddy.c trunk/gtk/plugins/gevolution/eds-utils.c trunk/gtk/plugins/gevolution/gevo-util.c trunk/gtk/plugins/gevolution/gevolution.c trunk/gtk/plugins/gevolution/gevolution.h trunk/gtk/plugins/gevolution/new_person_dialog.c trunk/gtk/plugins/gtk-signals-test.c trunk/gtk/plugins/history.c trunk/gtk/plugins/iconaway.c trunk/gtk/plugins/log_reader.c trunk/gtk/plugins/mailchk.c trunk/gtk/plugins/musicmessaging/ trunk/gtk/plugins/musicmessaging/Makefile.am trunk/gtk/plugins/musicmessaging/music.png trunk/gtk/plugins/musicmessaging/musicmessaging.c trunk/gtk/plugins/notify.c trunk/gtk/plugins/raw.c trunk/gtk/plugins/relnot.c trunk/gtk/plugins/spellchk.c trunk/gtk/plugins/ticker/ trunk/gtk/plugins/ticker/Makefile.am trunk/gtk/plugins/ticker/Makefile.mingw trunk/gtk/plugins/ticker/gtkticker.c trunk/gtk/plugins/ticker/gtkticker.h trunk/gtk/plugins/ticker/ticker.c trunk/gtk/plugins/timestamp.c trunk/gtk/plugins/timestamp_format.c trunk/gtk/sounds/ trunk/gtk/sounds/Makefile.am trunk/gtk/sounds/alert.wav trunk/gtk/sounds/login.wav trunk/gtk/sounds/logout.wav trunk/gtk/sounds/receive.wav trunk/gtk/sounds/send.wav Removed Paths: ------------- trunk/gtk/pixmaps/Makefile.am trunk/gtk/pixmaps/Makefile.mingw trunk/gtk/pixmaps/about_menu.png trunk/gtk/pixmaps/accounts.png trunk/gtk/pixmaps/away.png trunk/gtk/pixmaps/change-bgcolor-small.png trunk/gtk/pixmaps/change-fgcolor-small.png trunk/gtk/pixmaps/connect.png trunk/gtk/pixmaps/edit.png trunk/gtk/pixmaps/gaim-install.ico trunk/gtk/pixmaps/gaim.ico trunk/gtk/pixmaps/gaim.png trunk/gtk/pixmaps/gaim.svg trunk/gtk/pixmaps/gaim_16.ico trunk/gtk/pixmaps/gaim_4bit_16.ico trunk/gtk/pixmaps/gaim_auth.png trunk/gtk/pixmaps/gaim_away.ico trunk/gtk/pixmaps/gaim_away_16.ico trunk/gtk/pixmaps/gaim_away_4bit_16.ico trunk/gtk/pixmaps/gaim_blank_4bit_16.ico trunk/gtk/pixmaps/gaim_cool.png trunk/gtk/pixmaps/gaim_error.png trunk/gtk/pixmaps/gaim_info.png trunk/gtk/pixmaps/gaim_msgpend_16.ico trunk/gtk/pixmaps/gaim_msgpend_4bit_16.ico trunk/gtk/pixmaps/gaim_msgunread_16.ico trunk/gtk/pixmaps/gaim_msgunread_4bit_16.ico trunk/gtk/pixmaps/gaim_offline.ico trunk/gtk/pixmaps/gaim_offline_16.ico trunk/gtk/pixmaps/gaim_offline_4bit_16.ico trunk/gtk/pixmaps/gaim_question.png trunk/gtk/pixmaps/gaim_warning.png trunk/gtk/pixmaps/info.png trunk/gtk/pixmaps/insert-image-small.png trunk/gtk/pixmaps/insert-link-small.png trunk/gtk/pixmaps/insert-smiley-small.png trunk/gtk/pixmaps/logo.png trunk/gtk/pixmaps/msgpend.png trunk/gtk/pixmaps/msgunread.png trunk/gtk/pixmaps/offline.png trunk/gtk/pixmaps/online.png trunk/gtk/pixmaps/pause.png trunk/gtk/pixmaps/phone.png trunk/gtk/pixmaps/send-im.png trunk/gtk/pixmaps/smileys/ trunk/gtk/pixmaps/status/ trunk/gtk/pixmaps/status-away.png trunk/gtk/pixmaps/status-connect0.png trunk/gtk/pixmaps/status-connect1.png trunk/gtk/pixmaps/status-connect2.png trunk/gtk/pixmaps/status-connect3.png trunk/gtk/pixmaps/status-invisible.png trunk/gtk/pixmaps/status-offline.png trunk/gtk/pixmaps/status-online.png trunk/gtk/pixmaps/status-typing0.png trunk/gtk/pixmaps/status-typing1.png trunk/gtk/pixmaps/status-typing2.png trunk/gtk/pixmaps/status-typing3.png trunk/gtk/pixmaps/stock_connect_16.png trunk/gtk/pixmaps/stock_disconnect_16.png trunk/gtk/pixmaps/tb_drag_arrow_down.xpm trunk/gtk/pixmaps/tb_drag_arrow_left.xpm trunk/gtk/pixmaps/tb_drag_arrow_right.xpm trunk/gtk/pixmaps/tb_drag_arrow_up.xpm trunk/gtk/pixmaps/text_bigger.png trunk/gtk/pixmaps/text_normal.png trunk/gtk/pixmaps/text_smaller.png trunk/gtk/pixmaps/typed.png trunk/gtk/pixmaps/typing.png trunk/gtk/plugins/crazychat/Makefile.am trunk/gtk/plugins/crazychat/QTUtilities.c trunk/gtk/plugins/crazychat/QTUtilities.h trunk/gtk/plugins/crazychat/Utilities.c trunk/gtk/plugins/crazychat/Utilities.h trunk/gtk/plugins/crazychat/camdata.c trunk/gtk/plugins/crazychat/camdata.h trunk/gtk/plugins/crazychat/camproc.c trunk/gtk/plugins/crazychat/camproc.h trunk/gtk/plugins/crazychat/cc_features.c trunk/gtk/plugins/crazychat/cc_gaim_plugin.c trunk/gtk/plugins/crazychat/cc_gtk_gl.c trunk/gtk/plugins/crazychat/cc_gtk_gl.h trunk/gtk/plugins/crazychat/cc_interface.h trunk/gtk/plugins/crazychat/cc_network.c trunk/gtk/plugins/crazychat/cc_network.h trunk/gtk/plugins/crazychat/cc_output.c trunk/gtk/plugins/crazychat/configure.ac trunk/gtk/plugins/crazychat/crazychat.c trunk/gtk/plugins/crazychat/crazychat.h trunk/gtk/plugins/crazychat/dog_lids.c trunk/gtk/plugins/crazychat/dog_lids.h trunk/gtk/plugins/crazychat/doggy.c trunk/gtk/plugins/crazychat/doggy.h trunk/gtk/plugins/crazychat/draw.c trunk/gtk/plugins/crazychat/eye.c trunk/gtk/plugins/crazychat/eye.h trunk/gtk/plugins/crazychat/eyes.c trunk/gtk/plugins/crazychat/eyes.h trunk/gtk/plugins/crazychat/face.c trunk/gtk/plugins/crazychat/face.h trunk/gtk/plugins/crazychat/filter.c trunk/gtk/plugins/crazychat/filter.h trunk/gtk/plugins/crazychat/glm.c trunk/gtk/plugins/crazychat/glm.h trunk/gtk/plugins/crazychat/lids.c trunk/gtk/plugins/crazychat/lids.h trunk/gtk/plugins/crazychat/main.c trunk/gtk/plugins/crazychat/mat_struct.h trunk/gtk/plugins/crazychat/models.c trunk/gtk/plugins/crazychat/models.h trunk/gtk/plugins/crazychat/sharky.c trunk/gtk/plugins/crazychat/sharky.h trunk/gtk/plugins/crazychat/test.h trunk/gtk/plugins/crazychat/util.h trunk/gtk/plugins/docklet/Makefile.am trunk/gtk/plugins/docklet/Makefile.mingw trunk/gtk/plugins/docklet/MinimizeToTray.c trunk/gtk/plugins/docklet/MinimizeToTray.h trunk/gtk/plugins/docklet/docklet-win32.c trunk/gtk/plugins/docklet/docklet-x11.c trunk/gtk/plugins/docklet/docklet.c trunk/gtk/plugins/docklet/docklet.h trunk/gtk/plugins/docklet/eggtrayicon.c trunk/gtk/plugins/docklet/eggtrayicon.h trunk/gtk/plugins/gestures/Makefile.am trunk/gtk/plugins/gestures/gestures.c trunk/gtk/plugins/gestures/gstroke-internal.h trunk/gtk/plugins/gestures/gstroke.h trunk/gtk/plugins/gestures/stroke-draw.c trunk/gtk/plugins/gestures/stroke.c trunk/gtk/plugins/gevolution/Makefile.am trunk/gtk/plugins/gevolution/add_buddy_dialog.c trunk/gtk/plugins/gevolution/assoc-buddy.c trunk/gtk/plugins/gevolution/eds-utils.c trunk/gtk/plugins/gevolution/gevo-util.c trunk/gtk/plugins/gevolution/gevolution.c trunk/gtk/plugins/gevolution/gevolution.h trunk/gtk/plugins/gevolution/new_person_dialog.c trunk/gtk/plugins/musicmessaging/Makefile.am trunk/gtk/plugins/musicmessaging/music.png trunk/gtk/plugins/musicmessaging/musicmessaging.c trunk/gtk/plugins/ticker/Makefile.am trunk/gtk/plugins/ticker/Makefile.mingw trunk/gtk/plugins/ticker/gtkticker.c trunk/gtk/plugins/ticker/gtkticker.h trunk/gtk/plugins/ticker/ticker.c trunk/gtk/sounds/Makefile.am trunk/gtk/sounds/alert.wav trunk/gtk/sounds/login.wav trunk/gtk/sounds/logout.wav trunk/gtk/sounds/receive.wav trunk/gtk/sounds/send.wav Property Changed: ---------------- trunk/gtk/pixmaps/smileys/Makefile.am trunk/gtk/pixmaps/smileys/Makefile.mingw trunk/gtk/pixmaps/status/Makefile.am trunk/gtk/pixmaps/status/Makefile.mingw Added: trunk/gtk/Makefile.am =================================================================== --- trunk/gtk/Makefile.am (rev 0) +++ trunk/gtk/Makefile.am 2006-08-19 00:52:24 UTC (rev 16855) @@ -0,0 +1,181 @@ +EXTRA_DIST = \ + getopt.c \ + getopt.h \ + getopt1.c \ + Makefile.mingw \ + win_gaim.c \ + win32/IdleTracker/Makefile.mingw \ + win32/IdleTracker/idletrack.c \ + win32/IdleTracker/idletrack.h \ + win32/gaimrc.rc \ + win32/global.mak \ + win32/libc_interface.c \ + win32/libc_interface.h \ + win32/libc_internal.h \ + win32/resource.h \ + win32/untar.c \ + win32/untar.h \ + win32/wgaimerror.h \ + win32/win32dep.c \ + win32/win32dep.h \ + win32/wspell.c \ + win32/wspell.h \ + win32/nsis/gaim-header.bmp \ + win32/nsis/gaim-intro.bmp \ + win32/nsis/gaim-plugin.nsh \ + win32/nsis/langmacros.nsh \ + win32/nsis/translations/albanian.nsh \ + win32/nsis/translations/bulgarian.nsh \ + win32/nsis/translations/catalan.nsh \ + win32/nsis/translations/czech.nsh \ + win32/nsis/translations/danish.nsh \ + win32/nsis/translations/dutch.nsh \ + win32/nsis/translations/english.nsh \ + win32/nsis/translations/finnish.nsh \ + win32/nsis/translations/french.nsh \ + win32/nsis/translations/german.nsh \ + win32/nsis/translations/hebrew.nsh \ + win32/nsis/translations/hungarian.nsh \ + win32/nsis/translations/italian.nsh \ + win32/nsis/translations/japanese.nsh \ + win32/nsis/translations/korean.nsh \ + win32/nsis/translations/kurdish.nsh \ + win32/nsis/translations/lithuanian.nsh \ + win32/nsis/translations/norwegian.nsh \ + win32/nsis/translations/polish.nsh \ + win32/nsis/translations/portuguese.nsh \ + win32/nsis/translations/portuguese-br.nsh \ + win32/nsis/translations/romanian.nsh \ + win32/nsis/translations/russian.nsh \ + win32/nsis/translations/serbian-latin.nsh \ + win32/nsis/translations/simp-chinese.nsh \ + win32/nsis/translations/slovak.nsh \ + win32/nsis/translations/slovenian.nsh \ + win32/nsis/translations/spanish.nsh \ + win32/nsis/translations/swedish.nsh \ + win32/nsis/translations/trad-chinese.nsh \ + win32/nsis/translations/vietnamese.nsh + +SUBDIRS = pixmaps plugins sounds + +bin_PROGRAMS = gaim + +gaim_SOURCES = \ + gtkaccount.c \ + gtkblist.c \ + gtkcelllayout.c \ + gtkcellrendererprogress.c \ + gtkcellview.c \ + gtkcellviewmenuitem.c \ + gaimcombobox.c \ + gtkconn.c \ + gtkconv.c \ + gtkdebug.c \ + gtkdialogs.c \ + gtkdnd-hints.c \ + gtkeventloop.c \ + gtkexpander.c \ + gtkft.c \ + gtkidle.c \ + gtkimhtml.c \ + gtkimhtmltoolbar.c \ + gtklog.c \ + gtkmain.c \ + gtkmenutray.c \ + gtknotify.c \ + gtkplugin.c \ + gtkpluginpref.c \ + gtkprefs.c \ + gtkprivacy.c \ + gtkpounce.c \ + gtkrequest.c \ + gtkroomlist.c \ + gtksavedstatuses.c \ + gtksession.c \ + gtksound.c \ + gtksourceiter.c \ + gtkstatusbox.c \ + gaimstock.c \ + gtkthemes.c \ + gtkutils.c \ + gtkwhiteboard.c + +gaim_headers = \ + gtkaccount.h \ + gtkblist.h \ + gtkcelllayout.h \ + gtkcellrendererprogress.h \ + gtkcellview.h \ + gtkcellviewmenuitem.h \ + gtkcellview.h \ + gtkcellviewmenuitem.h \ + gaimcombobox.h \ + gtkconn.h \ + gtkconv.h \ + gtkconvwin.h \ + gtkdebug.h \ + gtkdialogs.h \ + gtkdnd-hints.h \ + gtkeventloop.h \ + gtkexpander.h \ + gtkft.h \ + gtkgaim.h \ + gtkidle.h \ + gtkimhtml.h \ + gtkimhtmltoolbar.h \ + gtklog.h \ + gtkmenutray.h \ + gtknickcolors.h \ + gtknotify.h \ + gtkplugin.h \ + gtkpluginpref.h \ + gtkprefs.h \ + gtkprivacy.h \ + gtkpounce.h \ + gtkrequest.h \ + gtkroomlist.h \ + gtksavedstatuses.h \ + gtksession.h \ + gtksound.h \ + gtksourceiter.h \ + gtkstatusbox.h \ + gaimstock.h \ + gtkthemes.h \ + gtkutils.h \ + gtkwhiteboard.h + +gaimincludedir=$(includedir)/gaim +gaiminclude_HEADERS = \ + $(gaim_headers) + + +gaim_DEPENDENCIES = @LIBOBJS@ $(STATIC_LINK_LIBS) $(MS_LIBS) +gaim_LDFLAGS = -export-dynamic +gaim_LDADD = \ + @LIBOBJS@ \ + $(DBUS_LIBS) \ + $(GSTREAMER_LIBS) \ + $(STATIC_LINK_LIBS) \ + $(XSS_LIBS) \ + $(SM_LIBS) \ + $(INTLLIBS) \ + $(GTKSPELL_LIBS) \ + $(STARTUP_NOTIFICATION_LIBS) \ + $(LIBXML_LIBS) \ + $(GTK_LIBS) \ + -L$(top_srcdir)/core -lgaim + +AM_CPPFLAGS = \ + -DBR_PTHREADS=0 \ + -DDATADIR=\"$(datadir)\" \ + -DLIBDIR=\"$(libdir)/gaim/\" \ + -DLOCALEDIR=\"$(datadir)/locale\" \ + -DSYSCONFDIR=\"$(sysconfdir)\" \ + -I$(top_srcdir)/core/ \ + $(GSTREAMER_CFLAGS) \ + $(DEBUG_CFLAGS) \ + $(GTK_CFLAGS) \ + $(DBUS_CFLAGS) \ + $(GTKSPELL_CFLAGS) \ + $(STARTUP_NOTIFICATION_CFLAGS) \ + $(LIBXML_CFLAGS) Property changes on: trunk/gtk/Makefile.am ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Copied: trunk/gtk/gaimcombobox.c (from rev 16843, trunk/src/gtkcombobox.c) =================================================================== --- trunk/gtk/gaimcombobox.c (rev 0) +++ trunk/gtk/gaimcombobox.c 2006-08-19 00:52:24 UTC (rev 16855) @@ -0,0 +1,3733 @@ +/* gaimcombobox.c + * Copyright (C) 2002, 2003 Kristian Rietveld <kr...@gt...> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* +#include <config.h> +*/ +#include <gtk/gtkversion.h> +#if !GTK_CHECK_VERSION(2,4,0) +#include "gaimcombobox.h" + +#include <gtk/gtkarrow.h> +#include <gtk/gtkbindings.h> +#include "gtkcelllayout.h" +#include <gtk/gtkcellrenderertext.h> +#include "gtkcellview.h" +#include "gtkcellviewmenuitem.h" +#include <gtk/gtkeventbox.h> +#include <gtk/gtkframe.h> +#include <gtk/gtkhbox.h> +#include <gtk/gtkliststore.h> +#include <gtk/gtkmain.h> +#include <gtk/gtkmenu.h> +#include <gtk/gtktogglebutton.h> +#include <gtk/gtktreeselection.h> +/* +#include <gtk/gtktreeprivate.h> +*/ +#include <gtk/gtkvseparator.h> +#include <gtk/gtkwindow.h> +#include <gtk/gtkversion.h> + +#include <gdk/gdkkeysyms.h> + +#include <gobject/gvaluecollector.h> + +#include <string.h> +#include <stdarg.h> + +#define P_(x) (x) + +/* WELCOME, to THE house of evil code */ + +typedef struct _ComboCellInfo ComboCellInfo; +struct _ComboCellInfo +{ + GtkCellRenderer *cell; + GSList *attributes; + + GtkCellLayoutDataFunc func; + gpointer func_data; + GDestroyNotify destroy; + + guint expand : 1; + guint pack : 1; +}; + +struct _GtkComboBoxPrivate +{ + GtkTreeModel *model; + + gint col_column; + gint row_column; + + gint wrap_width; + + gint active_item; + + GtkWidget *tree_view; + GtkTreeViewColumn *column; + + GtkWidget *cell_view; + GtkWidget *cell_view_frame; + + GtkWidget *button; + GtkWidget *box; + GtkWidget *arrow; + GtkWidget *separator; + + GtkWidget *popup_widget; + GtkWidget *popup_window; + GtkWidget *popup_frame; + + guint inserted_id; + guint deleted_id; + guint reordered_id; + guint changed_id; + + gint width; + GSList *cells; + + guint popup_in_progress : 1; + guint destroying : 1; +}; + +/* While debugging this evil code, I have learned that + * there are actually 4 modes to this widget, which can + * be characterized as follows + * + * 1) menu mode, no child added + * + * tree_view -> NULL + * cell_view -> GtkCellView, regular child + * cell_view_frame -> NULL + * button -> GtkToggleButton set_parent to combo + * box -> child of button + * arrow -> child of box + * separator -> child of box + * popup_widget -> GtkMenu + * popup_window -> NULL + * popup_frame -> NULL + * + * 2) menu mode, child added + * + * tree_view -> NULL + * cell_view -> NULL + * cell_view_frame -> NULL + * button -> GtkToggleButton set_parent to combo + * box -> NULL + * arrow -> GtkArrow, child of button + * separator -> NULL + * popup_widget -> GtkMenu + * popup_window -> NULL + * popup_frame -> NULL + * + * 3) list mode, no child added + * + * tree_view -> GtkTreeView, child of popup_frame + * cell_view -> GtkCellView, regular child + * cell_view_frame -> GtkFrame, set parent to combo + * button -> GtkToggleButton, set_parent to combo + * box -> NULL + * arrow -> GtkArrow, child of button + * separator -> NULL + * popup_widget -> tree_view + * popup_window -> GtkWindow + * popup_frame -> GtkFrame, child of popup_window + * + * 4) list mode, child added + * + * tree_view -> GtkTreeView, child of popup_frame + * cell_view -> NULL + * cell_view_frame -> NULL + * button -> GtkToggleButton, set_parent to combo + * box -> NULL + * arrow -> GtkArrow, child of button + * separator -> NULL + * popup_widget -> tree_view + * popup_window -> GtkWindow + * popup_frame -> GtkFrame, child of popup_window + * + */ + +enum { + CHANGED, + LAST_SIGNAL +}; + +enum { + PROP_0, + PROP_MODEL, + PROP_WRAP_WIDTH, + PROP_ROW_SPAN_COLUMN, + PROP_COLUMN_SPAN_COLUMN, + PROP_ACTIVE +}; + +static GtkBinClass *parent_class = NULL; +static guint combo_box_signals[LAST_SIGNAL] = {0,}; + +#define BONUS_PADDING 4 + + +/* common */ +static void gtk_combo_box_class_init (GtkComboBoxClass *klass); +static void gtk_combo_box_cell_layout_init (GtkCellLayoutIface *iface); +static void gtk_combo_box_init (GtkComboBox *combo_box); +static void gtk_combo_box_finalize (GObject *object); +static void gtk_combo_box_destroy (GtkObject *object); + +static void gtk_combo_box_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *spec); +static void gtk_combo_box_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *spec); + +static void gtk_combo_box_state_changed (GtkWidget *widget, + GtkStateType previous); +static void gtk_combo_box_style_set (GtkWidget *widget, + GtkStyle *previous); +static void gtk_combo_box_button_toggled (GtkWidget *widget, + gpointer data); +static void gtk_combo_box_add (GtkContainer *container, + GtkWidget *widget); +static void gtk_combo_box_remove (GtkContainer *container, + GtkWidget *widget); + +static ComboCellInfo *gtk_combo_box_get_cell_info (GtkComboBox *combo_box, + GtkCellRenderer *cell); + +static void gtk_combo_box_menu_show (GtkWidget *menu, + gpointer user_data); +static void gtk_combo_box_menu_hide (GtkWidget *menu, + gpointer user_data); + +static void gtk_combo_box_set_popup_widget (GtkComboBox *combo_box, + GtkWidget *popup); +#if GTK_CHECK_VERSION(2,2,0) +static void gtk_combo_box_menu_position_below (GtkMenu *menu, + gint *x, + gint *y, + gint *push_in, + gpointer user_data); +static void gtk_combo_box_menu_position_over (GtkMenu *menu, + gint *x, + gint *y, + gint *push_in, + gpointer user_data); +static void gtk_combo_box_menu_position (GtkMenu *menu, + gint *x, + gint *y, + gint *push_in, + gpointer user_data); +#endif + +static gint gtk_combo_box_calc_requested_width (GtkComboBox *combo_box, + GtkTreePath *path); +static void gtk_combo_box_remeasure (GtkComboBox *combo_box); + +static void gtk_combo_box_unset_model (GtkComboBox *combo_box); + +static void gtk_combo_box_size_request (GtkWidget *widget, + GtkRequisition *requisition); +static void gtk_combo_box_size_allocate (GtkWidget *widget, + GtkAllocation *allocation); +static void gtk_combo_box_forall (GtkContainer *container, + gboolean include_internals, + GtkCallback callback, + gpointer callback_data); +static gboolean gtk_combo_box_expose_event (GtkWidget *widget, + GdkEventExpose *event); +static gboolean gtk_combo_box_scroll_event (GtkWidget *widget, + GdkEventScroll *event); +static void gtk_combo_box_set_active_internal (GtkComboBox *combo_box, + gint index); +static gboolean gtk_combo_box_key_press (GtkWidget *widget, + GdkEventKey *event, + gpointer data); + +/* listening to the model */ +static void gtk_combo_box_model_row_inserted (GtkTreeModel *model, + GtkTreePath *path, + GtkTreeIter *iter, + gpointer user_data); +static void gtk_combo_box_model_row_deleted (GtkTreeModel *model, + GtkTreePath *path, + gpointer user_data); +static void gtk_combo_box_model_rows_reordered (GtkTreeModel *model, + GtkTreePath *path, + GtkTreeIter *iter, + gint *new_order, + gpointer user_data); +static void gtk_combo_box_model_row_changed (GtkTreeModel *model, + GtkTreePath *path, + GtkTreeIter *iter, + gpointer data); + +/* list */ +static void gtk_combo_box_list_position (GtkComboBox *combo_box, + gint *x, + gint *y, + gint *width, + gint *height); + +static void gtk_combo_box_list_setup (GtkComboBox *combo_box); +static void gtk_combo_box_list_destroy (GtkComboBox *combo_box); + +static void gtk_combo_box_list_remove_grabs (GtkComboBox *combo_box); + +static gboolean gtk_combo_box_list_button_released (GtkWidget *widget, + GdkEventButton *event, + gpointer data); +static gboolean gtk_combo_box_list_key_press (GtkWidget *widget, + GdkEventKey *event, + gpointer data); +static gboolean gtk_combo_box_list_button_pressed (GtkWidget *widget, + GdkEventButton *event, + gpointer data); + +static void gtk_combo_box_list_row_changed (GtkTreeModel *model, + GtkTreePath *path, + GtkTreeIter *iter, + gpointer data); + +/* menu */ +static void gtk_combo_box_menu_setup (GtkComboBox *combo_box, + gboolean add_children); +static void gtk_combo_box_menu_fill (GtkComboBox *combo_box); +static void gtk_combo_box_menu_destroy (GtkComboBox *combo_box); + +static void gtk_combo_box_item_get_size (GtkComboBox *combo_box, + gint index, + gint *cols, + gint *rows); +static void gtk_combo_box_relayout_item (GtkComboBox *combo_box, + gint index); +static void gtk_combo_box_relayout (GtkComboBox *combo_box); + +static gboolean gtk_combo_box_menu_button_press (GtkWidget *widget, + GdkEventButton *event, + gpointer user_data); +static void gtk_combo_box_menu_item_activate (GtkWidget *item, + gpointer user_data); +static void gtk_combo_box_menu_row_inserted (GtkTreeModel *model, + GtkTreePath *path, + GtkTreeIter *iter, + gpointer user_data); +static void gtk_combo_box_menu_row_deleted (GtkTreeModel *model, + GtkTreePath *path, + gpointer user_data); +static void gtk_combo_box_menu_rows_reordered (GtkTreeModel *model, + GtkTreePath *path, + GtkTreeIter *iter, + gint *new_order, + gpointer user_data); +static void gtk_combo_box_menu_row_changed (GtkTreeModel *model, + GtkTreePath *path, + GtkTreeIter *iter, + gpointer data); +static gboolean gtk_combo_box_menu_key_press (GtkWidget *widget, + GdkEventKey *event, + gpointer data); + +/* cell layout */ +static void gtk_combo_box_cell_layout_pack_start (GtkCellLayout *layout, + GtkCellRenderer *cell, + gboolean expand); +static void gtk_combo_box_cell_layout_pack_end (GtkCellLayout *layout, + GtkCellRenderer *cell, + gboolean expand); +static void gtk_combo_box_cell_layout_clear (GtkCellLayout *layout); +static void gtk_combo_box_cell_layout_add_attribute (GtkCellLayout *layout, + GtkCellRenderer *cell, + const gchar *attribute, + gint column); +static void gtk_combo_box_cell_layout_set_cell_data_func (GtkCellLayout *layout, + GtkCellRenderer *cell, + GtkCellLayoutDataFunc func, + gpointer func_data, + GDestroyNotify destroy); +static void gtk_combo_box_cell_layout_clear_attributes (GtkCellLayout *layout, + GtkCellRenderer *cell); +static void gtk_combo_box_cell_layout_reorder (GtkCellLayout *layout, + GtkCellRenderer *cell, + gint position); +static gboolean gtk_combo_box_mnemonic_activate (GtkWidget *widget, + gboolean group_cycling); + +static void cell_view_sync_cells (GtkComboBox *combo_box, + GtkCellView *cell_view); + +#if !GTK_CHECK_VERSION(2,4,0) +static void gtk_menu_attach (GtkMenu *menu, + GtkWidget *child, + guint left_attach, + guint right_attach, + guint top_attach, + guint bottom_attach); +#endif + +GType +gtk_combo_box_get_type (void) +{ + static GType combo_box_type = 0; + + if (!combo_box_type) + { + static const GTypeInfo combo_box_info = + { + sizeof (GtkComboBoxClass), + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc) gtk_combo_box_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (GtkComboBox), + 0, + (GInstanceInitFunc) gtk_combo_box_init + }; + + static const GInterfaceInfo cell_layout_info = + { + (GInterfaceInitFunc) gtk_combo_box_cell_layout_init, + NULL, + NULL + }; + + combo_box_type = g_type_register_static (GTK_TYPE_BIN, + "GaimGtkComboBox", + &combo_box_info, + 0); + + g_type_add_interface_static (combo_box_type, + GTK_TYPE_CELL_LAYOUT, + &cell_layout_info); + } + + return combo_box_type; +} + +/* common */ +static void +gtk_combo_box_class_init (GtkComboBoxClass *klass) +{ + GObjectClass *object_class; + GtkBindingSet *binding_set; + GtkObjectClass *gtk_object_class; + GtkContainerClass *container_class; + GtkWidgetClass *widget_class; + + binding_set = gtk_binding_set_by_class (klass); + + container_class = (GtkContainerClass *)klass; + container_class->forall = gtk_combo_box_forall; + container_class->add = gtk_combo_box_add; + container_class->remove = gtk_combo_box_remove; + + widget_class = (GtkWidgetClass *)klass; + widget_class->size_allocate = gtk_combo_box_size_allocate; + widget_class->size_request = gtk_combo_box_size_request; + widget_class->expose_event = gtk_combo_box_expose_event; + widget_class->scroll_event = gtk_combo_box_scroll_event; + widget_class->mnemonic_activate = gtk_combo_box_mnemonic_activate; + widget_class->style_set = gtk_combo_box_style_set; + widget_class->state_changed = gtk_combo_box_state_changed; + + gtk_object_class = (GtkObjectClass *)klass; + gtk_object_class->destroy = gtk_combo_box_destroy; + + object_class = (GObjectClass *)klass; + object_class->finalize = gtk_combo_box_finalize; + object_class->set_property = gtk_combo_box_set_property; + object_class->get_property = gtk_combo_box_get_property; + + parent_class = g_type_class_peek_parent (klass); + + /* signals */ + combo_box_signals[CHANGED] = + g_signal_new ("changed", + G_OBJECT_CLASS_TYPE (klass), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GtkComboBoxClass, changed), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + /* properties */ + g_object_class_install_property (object_class, + PROP_MODEL, + g_param_spec_object ("model", + P_("ComboBox model"), + P_("The model for the combo box"), + GTK_TYPE_TREE_MODEL, + G_PARAM_READWRITE)); + + g_object_class_install_property (object_class, + PROP_WRAP_WIDTH, + g_param_spec_int ("wrap_width", + P_("Wrap width"), + P_("Wrap width for layouting the items in a grid"), + 0, + G_MAXINT, + 0, + G_PARAM_READWRITE)); + + g_object_class_install_property (object_class, + PROP_ROW_SPAN_COLUMN, + g_param_spec_int ("row_span_column", + P_("Row span column"), + P_("TreeModel column containing the row span values"), + 0, + G_MAXINT, + 0, + G_PARAM_READWRITE)); + + g_object_class_install_property (object_class, + PROP_COLUMN_SPAN_COLUMN, + g_param_spec_int ("column_span_column", + P_("Column span column"), + + P_("TreeModel column containing the column span values"), + 0, + G_MAXINT, + 0, + G_PARAM_READWRITE)); + + g_object_class_install_property (object_class, + PROP_ACTIVE, + g_param_spec_int ("active", + P_("Active item"), + P_("The item which is currently active"), + -1, + G_MAXINT, + -1, + G_PARAM_READWRITE)); + + gtk_widget_class_install_style_property (widget_class, + g_param_spec_boolean ("appears-as-list", + P_("Appears as list"), + P_("Whether combobox dropdowns should look like lists rather than menus"), + FALSE, + G_PARAM_READABLE)); +} + +static void +gtk_combo_box_cell_layout_init (GtkCellLayoutIface *iface) +{ + iface->pack_start = gtk_combo_box_cell_layout_pack_start; + iface->pack_end = gtk_combo_box_cell_layout_pack_end; + iface->clear = gtk_combo_box_cell_layout_clear; + iface->add_attribute = gtk_combo_box_cell_layout_add_attribute; + iface->set_cell_data_func = gtk_combo_box_cell_layout_set_cell_data_func; + iface->clear_attributes = gtk_combo_box_cell_layout_clear_attributes; + iface->reorder = gtk_combo_box_cell_layout_reorder; +} + +static void +gtk_combo_box_init (GtkComboBox *combo_box) +{ + combo_box->priv = g_new0(GtkComboBoxPrivate,1); + + combo_box->priv->cell_view = gtk_cell_view_new (); + gtk_widget_set_parent (combo_box->priv->cell_view, GTK_WIDGET (combo_box)); + GTK_BIN (combo_box)->child = combo_box->priv->cell_view; + gtk_widget_show (combo_box->priv->cell_view); + + combo_box->priv->width = 0; + combo_box->priv->wrap_width = 0; + + combo_box->priv->active_item = -1; + combo_box->priv->col_column = -1; + combo_box->priv->row_column = -1; +} + +static void +gtk_combo_box_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + GtkComboBox *combo_box = GTK_COMBO_BOX (object); + + switch (prop_id) + { + case PROP_MODEL: + gtk_combo_box_set_model (combo_box, g_value_get_object (value)); + break; + + case PROP_WRAP_WIDTH: + gtk_combo_box_set_wrap_width (combo_box, g_value_get_int (value)); + break; + + case PROP_ROW_SPAN_COLUMN: + gtk_combo_box_set_row_span_column (combo_box, g_value_get_int (value)); + break; + + case PROP_COLUMN_SPAN_COLUMN: + gtk_combo_box_set_column_span_column (combo_box, g_value_get_int (value)); + break; + + case PROP_ACTIVE: + gtk_combo_box_set_active (combo_box, g_value_get_int (value)); + break; + + default: + break; + } +} + +static void +gtk_combo_box_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + GtkComboBox *combo_box = GTK_COMBO_BOX (object); + + switch (prop_id) + { + case PROP_MODEL: + g_value_set_object (value, combo_box->priv->model); + break; + + case PROP_WRAP_WIDTH: + g_value_set_int (value, combo_box->priv->wrap_width); + break; + + case PROP_ROW_SPAN_COLUMN: + g_value_set_int (value, combo_box->priv->row_column); + break; + + case PROP_COLUMN_SPAN_COLUMN: + g_value_set_int (value, combo_box->priv->col_column); + break; + + case PROP_ACTIVE: + g_value_set_int (value, gtk_combo_box_get_active (combo_box)); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +gtk_combo_box_state_changed (GtkWidget *widget, + GtkStateType previous) +{ + GtkComboBox *combo_box = GTK_COMBO_BOX (widget); + + if (GTK_WIDGET_REALIZED (widget)) + { + if (combo_box->priv->tree_view && combo_box->priv->cell_view) + gtk_cell_view_set_background_color (GTK_CELL_VIEW (combo_box->priv->cell_view), + &widget->style->base[GTK_WIDGET_STATE (widget)]); + } + + gtk_widget_queue_draw (widget); +} + +static void +gtk_combo_box_check_appearance (GtkComboBox *combo_box) +{ + gboolean appears_as_list; + + /* if wrap_width > 0, then we are in grid-mode and forced to use + * unix style + */ + if (combo_box->priv->wrap_width) + appears_as_list = FALSE; + else + gtk_widget_style_get (GTK_WIDGET (combo_box), + "appears-as-list", &appears_as_list, + NULL); + + if (appears_as_list) + { + /* Destroy all the menu mode widgets, if they exist. */ + if (GTK_IS_MENU (combo_box->priv->popup_widget)) + gtk_combo_box_menu_destroy (combo_box); + + /* Create the list mode widgets, if they don't already exist. */ + if (!GTK_IS_TREE_VIEW (combo_box->priv->tree_view)) + gtk_combo_box_list_setup (combo_box); + } + else + { + /* Destroy all the list mode widgets, if they exist. */ + if (GTK_IS_TREE_VIEW (combo_box->priv->tree_view)) + gtk_combo_box_list_destroy (combo_box); + + /* Create the menu mode widgets, if they don't already exist. */ + if (!GTK_IS_MENU (combo_box->priv->popup_widget)) + gtk_combo_box_menu_setup (combo_box, TRUE); + } +} + +static void +gtk_combo_box_style_set (GtkWidget *widget, + GtkStyle *previous) +{ + GtkComboBox *combo_box = GTK_COMBO_BOX (widget); + + gtk_combo_box_check_appearance (combo_box); + + if (combo_box->priv->tree_view && combo_box->priv->cell_view) + gtk_cell_view_set_background_color (GTK_CELL_VIEW (combo_box->priv->cell_view), + &widget->style->base[GTK_WIDGET_STATE (widget)]); +} + +static void +gtk_combo_box_button_toggled (GtkWidget *widget, + gpointer data) +{ + GtkComboBox *combo_box = GTK_COMBO_BOX (data); + + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget))) + { + if (!combo_box->priv->popup_in_progress) + gtk_combo_box_popup (combo_box); + } + else + gtk_combo_box_popdown (combo_box); +} + +static void +gtk_combo_box_add (GtkContainer *container, + GtkWidget *widget) +{ + GtkComboBox *combo_box = GTK_COMBO_BOX (container); + + if (combo_box->priv->cell_view && combo_box->priv->cell_view->parent) + { + gtk_widget_unparent (combo_box->priv->cell_view); + GTK_BIN (container)->child = NULL; + gtk_widget_queue_resize (GTK_WIDGET (container)); + } + + gtk_widget_set_parent (widget, GTK_WIDGET (container)); + GTK_BIN (container)->child = widget; + + if (combo_box->priv->cell_view && + widget != combo_box->priv->cell_view) + { + /* since the cell_view was unparented, it's gone now */ + combo_box->priv->cell_view = NULL; + + if (!combo_box->priv->tree_view && combo_box->priv->separator) + { + gtk_container_remove (GTK_CONTAINER (combo_box->priv->separator->parent), + combo_box->priv->separator); + combo_box->priv->separator = NULL; + + gtk_widget_queue_resize (GTK_WIDGET (container)); + } + else if (combo_box->priv->cell_view_frame) + { + gtk_widget_unparent (combo_box->priv->cell_view_frame); + combo_box->priv->cell_view_frame = NULL; + } + } +} + +static void +gtk_combo_box_remove (GtkContainer *container, + GtkWidget *widget) +{ + GtkComboBox *combo_box = GTK_COMBO_BOX (container); + gboolean appears_as_list; + + gtk_widget_unparent (widget); + GTK_BIN (container)->child = NULL; + + if (combo_box->priv->destroying) + return; + + gtk_widget_queue_resize (GTK_WIDGET (container)); + + if (!combo_box->priv->tree_view) + appears_as_list = FALSE; + else + appears_as_list = TRUE; + + if (appears_as_list) + gtk_combo_box_list_destroy (combo_box); + else if (GTK_IS_MENU (combo_box->priv->popup_widget)) + { + gtk_combo_box_menu_destroy (combo_box); + gtk_menu_detach (GTK_MENU (combo_box->priv->popup_widget)); + combo_box->priv->popup_widget = NULL; + } + + if (!combo_box->priv->cell_view) + { + combo_box->priv->cell_view = gtk_cell_view_new (); + gtk_widget_set_parent (combo_box->priv->cell_view, GTK_WIDGET (container)); + GTK_BIN (container)->child = combo_box->priv->cell_view; + + gtk_widget_show (combo_box->priv->cell_view); + gtk_cell_view_set_model (GTK_CELL_VIEW (combo_box->priv->cell_view), + combo_box->priv->model); + cell_view_sync_cells (combo_box, GTK_CELL_VIEW (combo_box->priv->cell_view)); + } + + + if (appears_as_list) + gtk_combo_box_list_setup (combo_box); + else + gtk_combo_box_menu_setup (combo_box, TRUE); + + gtk_combo_box_set_active_internal (combo_box, combo_box->priv->active_item); +} + +static ComboCellInfo * +gtk_combo_box_get_cell_info (GtkComboBox *combo_box, + GtkCellRenderer *cell) +{ + GSList *i; + + for (i = combo_box->priv->cells; i; i = i->next) + { + ComboCellInfo *info = (ComboCellInfo *)i->data; + + if (info && info->cell == cell) + return info; + } + + return NULL; +} + +static void +gtk_combo_box_menu_show (GtkWidget *menu, + gpointer user_data) +{ + GtkComboBox *combo_box = GTK_COMBO_BOX (user_data); + + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (combo_box->priv->button), + TRUE); + combo_box->priv->popup_in_progress = FALSE; +} + +static void +gtk_combo_box_menu_hide (GtkWidget *menu, + gpointer user_data) +{ + GtkComboBox *combo_box = GTK_COMBO_BOX (user_data); + + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (combo_box->priv->button), + FALSE); +} + +static void +gtk_combo_box_detacher (GtkWidget *widget, + GtkMenu *menu) +{ + GtkComboBox *combo_box; + + g_return_if_fail (GTK_IS_COMBO_BOX (widget)); + + combo_box = GTK_COMBO_BOX (widget); + g_return_if_fail (combo_box->priv->popup_widget == (GtkWidget*) menu); + + g_signal_handlers_disconnect_by_func (menu, + gtk_combo_box_menu_show, + combo_box); + g_signal_handlers_disconnect_by_func (menu, + gtk_combo_box_menu_hide, + combo_box); + + combo_box->priv->popup_widget = NULL; +} + +static void +gtk_combo_box_set_popup_widget (GtkComboBox *combo_box, + GtkWidget *popup) +{ + if (GTK_IS_MENU (combo_box->priv->popup_widget)) + { + gtk_menu_detach (GTK_MENU (combo_box->priv->popup_widget)); + combo_box->priv->popup_widget = NULL; + } + else if (combo_box->priv->popup_widget) + { + gtk_container_remove (GTK_CONTAINER (combo_box->priv->popup_frame), + combo_box->priv->popup_widget); + g_object_unref (G_OBJECT (combo_box->priv->popup_widget)); + combo_box->priv->popup_widget = NULL; + } + + if (GTK_IS_MENU (popup)) + { + if (combo_box->priv->popup_window) + { + gtk_widget_destroy (combo_box->priv->popup_window); + combo_box->priv->popup_window = NULL; + combo_box->priv->popup_frame = NULL; + } + + combo_box->priv->popup_widget = popup; + + g_signal_connect (popup, "show", + G_CALLBACK (gtk_combo_box_menu_show), combo_box); + g_signal_connect (popup, "hide", + G_CALLBACK (gtk_combo_box_menu_hide), combo_box); + + gtk_menu_attach_to_widget (GTK_MENU (popup), + GTK_WIDGET (combo_box), + gtk_combo_box_detacher); + } + else + { + if (!combo_box->priv->popup_window) + { + combo_box->priv->popup_window = gtk_window_new (GTK_WINDOW_POPUP); + gtk_window_set_resizable (GTK_WINDOW (combo_box->priv->popup_window), FALSE); +#if GTK_CHECK_VERSION(2,2,0) + gtk_window_set_screen (GTK_WINDOW (combo_box->priv->popup_window), + gtk_widget_get_screen (GTK_WIDGET (combo_box))); +#endif + + combo_box->priv->popup_frame = gtk_frame_new (NULL); + gtk_frame_set_shadow_type (GTK_FRAME (combo_box->priv->popup_frame), + GTK_SHADOW_ETCHED_IN); + gtk_container_add (GTK_CONTAINER (combo_box->priv->popup_window), + combo_box->priv->popup_frame); + + gtk_widget_show (combo_box->priv->popup_frame); + } + + gtk_container_add (GTK_CONTAINER (combo_box->priv->popup_frame), + popup); + gtk_widget_show (popup); + g_object_ref (G_OBJECT (popup)); + combo_box->priv->popup_widget = popup; + } +} + +#if GTK_CHECK_VERSION(2,2,0) +static void +gtk_combo_box_menu_position_below (GtkMenu *menu, + gint *x, + gint *y, + gint *push_in, + gpointer user_data) +{ + GtkComboBox *combo_box = GTK_COMBO_BOX (user_data); + gint sx, sy; + GtkWidget *child; + GtkRequisition req; + GdkScreen *screen; + gint monitor_num; + GdkRectangle monitor; + + /* FIXME: is using the size request here broken? */ + child = GTK_BIN (combo_box)->child; + + gdk_window_get_origin (child->window, &sx, &sy); + + if (GTK_WIDGET_NO_WINDOW (child)) + { + sx += child->allocation.x; + sy += child->allocation.y; + } + + gtk_widget_size_request (GTK_WIDGET (menu), &req); + + if (gtk_widget_get_direction (GTK_WIDGET (combo_box)) == GTK_TEXT_DIR_LTR) + *x = sx; + else + *x = sx + child->allocation.width - req.width; + *y = sy; + + screen = gtk_widget_get_screen (GTK_WIDGET (combo_box)); + monitor_num = gdk_screen_get_monitor_at_window (screen, + GTK_WIDGET (combo_box)->window); + gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor); + + if (*x < monitor.x) + *x = monitor.x; + else if (*x + req.width > monitor.x + monitor.width) + *x = monitor.x + monitor.width - req.width; + + if (monitor.y + monitor.height - *y - child->allocation.height >= req.height) + *y += child->allocation.height; + else if (*y - monitor.y >= req.height) + *y -= req.height; + else if (monitor.y + monitor.height - *y - child->allocation.height > *y - monitor.y) + *y += child->allocation.height; + else + *y -= req.height; + + *push_in = FALSE; +} + +static void +gtk_combo_box_menu_position_over (GtkMenu *menu, + gint *x, + gint *y, + gboolean *push_in, + gpointer user_data) +{ + GtkComboBox *combo_box; + GtkWidget *active; + GtkWidget *child; + GtkWidget *widget; + GtkRequisition requisition; + GList *children; + gint screen_width; + gint menu_xpos; + gint menu_ypos; + gint menu_width; + + g_return_if_fail (GTK_IS_COMBO_BOX (user_data)); + + combo_box = GTK_COMBO_BOX (user_data); + widget = GTK_WIDGET (combo_box); + + gtk_widget_get_child_requisition (GTK_WIDGET (menu), &requisition); + menu_width = requisition.width; + + active = gtk_menu_get_active (GTK_MENU (combo_box->priv->popup_widget)); + gdk_window_get_origin (widget->window, &menu_xpos, &menu_ypos); + + menu_xpos += widget->allocation.x; + menu_ypos += widget->allocation.y + widget->allocation.height / 2 - 2; + + if (active != NULL) + { + gtk_widget_get_child_requisition (active, &requisition); + menu_ypos -= requisition.height / 2; + } + + children = GTK_MENU_SHELL (combo_... [truncated message content] |
From: <aar...@us...> - 2006-08-19 00:24:17
|
Revision: 16854 Author: aaronsheldon Date: 2006-08-18 17:24:14 -0700 (Fri, 18 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16854&view=rev Log Message: ----------- Generates the image for the about dialog on demand instead of making it a stock image which remains in memory forever. Modified Paths: -------------- trunk/src/gtkdialogs.c trunk/src/gtkstock.c trunk/src/gtkstock.h Modified: trunk/src/gtkdialogs.c =================================================================== --- trunk/src/gtkdialogs.c 2006-08-19 00:07:40 UTC (rev 16853) +++ trunk/src/gtkdialogs.c 2006-08-19 00:24:14 UTC (rev 16854) @@ -223,6 +223,44 @@ about = NULL; } +/* This function puts the version number onto the pixmap we use in the 'about' + * screen in Gaim. */ +static void +gaim_gtk_logo_versionize(GdkPixbuf **original, GtkWidget *widget) { + GdkPixmap *pixmap; + GtkStyle *style; + PangoContext *context; + PangoLayout *layout; + gchar *markup; + gint width, height; + gint lwidth = 0, lheight = 0; + + style = gtk_widget_get_style(widget); + + gdk_pixbuf_render_pixmap_and_mask(*original, &pixmap, NULL, 255); + width = gdk_pixbuf_get_width(*original); + height = gdk_pixbuf_get_height(*original); + g_object_unref(G_OBJECT(*original)); + + context = gtk_widget_get_pango_context(widget); + layout = pango_layout_new(context); + + markup = g_strdup_printf("<span foreground=\"#FFFFFF\" size=\"larger\">%s</span>", VERSION); + pango_layout_set_font_description(layout, style->font_desc); + pango_layout_set_markup(layout, markup, strlen(markup)); + g_free(markup); + + pango_layout_get_pixel_size(layout, &lwidth, &lheight); + gdk_draw_layout(GDK_DRAWABLE(pixmap), style->bg_gc[GTK_STATE_NORMAL], + width - (lwidth + 3), height - (lheight + 1), layout); + g_object_unref(G_OBJECT(layout)); + + *original = gdk_pixbuf_get_from_drawable(NULL, pixmap, NULL, + 0, 0, 0, 0, + width, height); + g_object_unref(G_OBJECT(pixmap)); +} + void gaim_gtkdialogs_about() { GtkWidget *hbox; @@ -236,6 +274,8 @@ GString *str; int i; AtkObject *obj; + char* filename; + GdkPixbuf *pixbuf; if (about != NULL) { gtk_window_present(GTK_WINDOW(about)); @@ -256,7 +296,17 @@ vbox = gtk_vbox_new(FALSE, GAIM_HIG_BORDER); gtk_container_add(GTK_CONTAINER(hbox), vbox); - logo = gtk_image_new_from_stock(GAIM_STOCK_LOGO, gtk_icon_size_from_name(GAIM_ICON_SIZE_LOGO)); + /* Generate a logo with a version number */ + logo = gtk_window_new(GTK_WINDOW_TOPLEVEL); + gtk_widget_realize(logo); + filename = g_build_filename(DATADIR, "pixmaps", "gaim", "logo.png", NULL); + pixbuf = gdk_pixbuf_new_from_file(filename, NULL); + g_free(filename); + gaim_gtk_logo_versionize(&pixbuf, logo); + gtk_widget_destroy(logo); + logo = gtk_image_new_from_pixbuf(pixbuf); + gdk_pixbuf_unref(pixbuf); + /* Insert the logo */ obj = gtk_widget_get_accessible(logo); atk_object_set_description(obj, "Gaim " VERSION); gtk_box_pack_start(GTK_BOX(vbox), logo, FALSE, FALSE, 0); Modified: trunk/src/gtkstock.c =================================================================== --- trunk/src/gtkstock.c 2006-08-19 00:07:40 UTC (rev 16853) +++ trunk/src/gtkstock.c 2006-08-19 00:24:14 UTC (rev 16854) @@ -93,7 +93,6 @@ { GAIM_STOCK_INVITE, NULL, GTK_STOCK_JUMP_TO }, { GAIM_STOCK_LINK, "buttons", "insert-link-small.png" }, { GAIM_STOCK_LOG, NULL, GTK_STOCK_DND_MULTIPLE }, - { GAIM_STOCK_LOGO, "gaim", "logo.png" }, { GAIM_STOCK_MODIFY, NULL, GTK_STOCK_PREFERENCES }, #if GTK_CHECK_VERSION(2,6,0) { GAIM_STOCK_PAUSE, NULL, GTK_STOCK_MEDIA_PAUSE }, @@ -174,42 +173,6 @@ return filename; } -static void -gaim_gtk_stock_versionize(GdkPixbuf **original, GtkWidget *widget) { - GdkPixmap *pixmap; - GtkStyle *style; - PangoContext *context; - PangoLayout *layout; - gchar *markup; - gint width, height; - gint lwidth = 0, lheight = 0; - - style = gtk_widget_get_style(widget); - - gdk_pixbuf_render_pixmap_and_mask(*original, &pixmap, NULL, 255); - width = gdk_pixbuf_get_width(*original); - height = gdk_pixbuf_get_height(*original); - g_object_unref(G_OBJECT(*original)); - - context = gtk_widget_get_pango_context(widget); - layout = pango_layout_new(context); - - markup = g_strdup_printf("<span foreground=\"#FFFFFF\" size=\"larger\">%s</span>", VERSION); - pango_layout_set_font_description(layout, style->font_desc); - pango_layout_set_markup(layout, markup, strlen(markup)); - g_free(markup); - - pango_layout_get_pixel_size(layout, &lwidth, &lheight); - gdk_draw_layout(GDK_DRAWABLE(pixmap), style->bg_gc[GTK_STATE_NORMAL], - width - (lwidth + 3), height - (lheight + 1), layout); - g_object_unref(G_OBJECT(layout)); - - *original = gdk_pixbuf_get_from_drawable(NULL, pixmap, NULL, - 0, 0, 0, 0, - width, height); - g_object_unref(G_OBJECT(pixmap)); -} - void gaim_gtk_stock_init(void) { @@ -255,9 +218,6 @@ g_free(filename); - if (!strcmp(stock_icons[i].name, GAIM_STOCK_LOGO)) - gaim_gtk_stock_versionize(&pixbuf, win); - iconset = gtk_icon_set_new_from_pixbuf(pixbuf); g_object_unref(G_OBJECT(pixbuf)); Modified: trunk/src/gtkstock.h =================================================================== --- trunk/src/gtkstock.h 2006-08-19 00:07:40 UTC (rev 16853) +++ trunk/src/gtkstock.h 2006-08-19 00:24:14 UTC (rev 16854) @@ -67,7 +67,6 @@ #define GAIM_STOCK_INVITE "gaim-invite" #define GAIM_STOCK_LINK "gaim-link" #define GAIM_STOCK_LOG "gaim-log" -#define GAIM_STOCK_LOGO "gaim-logo" #define GAIM_STOCK_MODIFY "gaim-modify" #define GAIM_STOCK_OPEN_MAIL "gaim-stock-open-mail" #define GAIM_STOCK_PAUSE "gaim-pause" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-08-19 00:07:44
|
Revision: 16853 Author: sadrul Date: 2006-08-18 17:07:40 -0700 (Fri, 18 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16853&view=rev Log Message: ----------- Have substatuses for custom statuses. This is probably the last dialog/feature before the end of SoC. I plan to add stuff for roomlists later (next week), and possibly start on replacing pluginpref with request. Modified Paths: -------------- trunk/console/gntstatus.c Modified: trunk/console/gntstatus.c =================================================================== --- trunk/console/gntstatus.c 2006-08-18 22:59:12 UTC (rev 16852) +++ trunk/console/gntstatus.c 2006-08-19 00:07:40 UTC (rev 16853) @@ -4,6 +4,7 @@ #include <gntcombobox.h> #include <gntentry.h> #include <gntlabel.h> +#include <gntline.h> #include <gnttree.h> #include <notify.h> @@ -25,9 +26,20 @@ GntWidget *title; GntWidget *type; GntWidget *message; - /* XXX: Stuff needed for per-account statuses */ + GntWidget *tree; + GHashTable *hash; /* list of windows for substatuses */ } EditStatus; +typedef struct +{ + GntWidget *window; + GntWidget *type; + GntWidget *message; + + EditStatus *parent; + GaimAccount *account; +} EditSubStatus; + static GList *edits; /* List of opened edit-status dialogs */ static void @@ -171,10 +183,17 @@ } static void +destroy_substatus_win(GaimAccount *account, EditSubStatus *sub, gpointer null) +{ + gnt_widget_destroy(sub->window); /* the "destroy" callback will remove entry from the hashtable */ +} + +static void update_edit_list(GntWidget *widget, EditStatus *edit) { edits = g_list_remove(edits, edit); gaim_notify_close_with_handle(edit); + g_hash_table_foreach(edit->hash, (GHFunc)destroy_substatus_win, NULL); g_free(edit); } @@ -236,12 +255,154 @@ gnt_widget_destroy(edit->window); } +static void +add_substatus(EditStatus *edit, GaimAccount *account) +{ + char *name; + const char *type = NULL, *message = NULL; + GaimSavedStatusSub *sub = NULL; + + if (!edit || !edit->tree) + return; + + if (edit->saved) + sub = gaim_savedstatus_get_substatus(edit->saved, account); + + if (sub) + { + type = gaim_status_type_get_name(gaim_savedstatus_substatus_get_type(sub)); + message = gaim_savedstatus_substatus_get_message(sub); + } + + name = g_strdup_printf("%s (%s)", gaim_account_get_username(account), + gaim_account_get_protocol_name(account)); + gnt_tree_add_choice(GNT_TREE(edit->tree), account, + gnt_tree_create_row(GNT_TREE(edit->tree), name, type, message), NULL, NULL); + + if (sub) + gnt_tree_set_choice(GNT_TREE(edit->tree), account, TRUE); + g_free(name); +} + +static void +substatus_window_destroy_cb(GntWidget *window, EditSubStatus *sub) +{ + g_hash_table_remove(sub->parent->hash, sub->account); + g_free(sub); +} + +static void +save_substatus_cb(GntWidget *widget, EditSubStatus *sub) +{ + GaimSavedStatus *saved = sub->parent->saved; + GaimAccount *account = sub->account; + const char *message; + GaimStatusType *type; + + type = gnt_combo_box_get_selected_data(GNT_COMBO_BOX(sub->type)); + message = gnt_entry_get_text(GNT_ENTRY(sub->message)); + + gaim_savedstatus_set_substatus(saved, account, type, message); + + gnt_tree_set_choice(GNT_TREE(sub->parent->tree), account, TRUE); + gnt_tree_change_text(GNT_TREE(sub->parent->tree), account, 1, + gaim_status_type_get_name(type)); + gnt_tree_change_text(GNT_TREE(sub->parent->tree), account, 2, message); + + gnt_widget_destroy(sub->window); +} + +static gboolean +popup_substatus(GntTree *tree, const char *key, EditStatus *edit) +{ + if (key[0] == ' ' && key[1] == 0) + { + EditSubStatus *sub; + GntWidget *window, *combo, *entry, *box, *button, *l; + GaimSavedStatusSub *substatus = NULL; + const GList *iter; + char *name; + GaimAccount *account = gnt_tree_get_selection_data(tree); + + if (gnt_tree_get_choice(tree, account)) + { + /* There was a savedstatus for this account. Now remove it. */ + gaim_savedstatus_unset_substatus(edit->saved, account); + gnt_tree_change_text(tree, account, 1, NULL); + gnt_tree_change_text(tree, account, 2, NULL); + return FALSE; + } + + if (g_hash_table_lookup(edit->hash, account)) + return TRUE; + + if (edit->saved) + substatus = gaim_savedstatus_get_substatus(edit->saved, account); + + sub = g_new0(EditSubStatus, 1); + sub->parent = edit; + sub->account = account; + + sub->window = window = gnt_vbox_new(FALSE); + gnt_box_set_toplevel(GNT_BOX(window), TRUE); + gnt_box_set_title(GNT_BOX(window), _("Substatus")); /* XXX: a better title */ + + box = gnt_hbox_new(FALSE); + gnt_box_add_widget(GNT_BOX(box), gnt_label_new(_("Account:"))); + name = g_strdup_printf("%s (%s)", gaim_account_get_username(account), + gaim_account_get_protocol_name(account)); + gnt_box_add_widget(GNT_BOX(box), gnt_label_new(name)); + g_free(name); + gnt_box_add_widget(GNT_BOX(window), box); + + box = gnt_hbox_new(FALSE); + gnt_box_add_widget(GNT_BOX(box), (l = gnt_label_new(_("Status:")))); + gnt_widget_set_size(l, 0, 1); /* I don't like having to do this */ + sub->type = combo = gnt_combo_box_new(); + gnt_box_add_widget(GNT_BOX(box), combo); + gnt_box_add_widget(GNT_BOX(window), box); + + for (iter = gaim_account_get_status_types(account); iter; iter = iter->next) + { + GaimStatusType *type = iter->data; + if (!gaim_status_type_is_user_settable(type)) + continue; + gnt_combo_box_add_data(GNT_COMBO_BOX(combo), type, gaim_status_type_get_name(type)); + } + + box = gnt_hbox_new(FALSE); + gnt_box_add_widget(GNT_BOX(box), gnt_label_new(_("Message:"))); + sub->message = entry = gnt_entry_new(substatus ? gaim_savedstatus_substatus_get_message(substatus) : NULL); + gnt_box_add_widget(GNT_BOX(box), entry); + gnt_box_add_widget(GNT_BOX(window), box); + + box = gnt_hbox_new(FALSE); + button = gnt_button_new(_("Cancel")); + g_signal_connect_swapped(G_OBJECT(button), "activate", G_CALLBACK(gnt_widget_destroy), window); + gnt_box_add_widget(GNT_BOX(box), button); + button = gnt_button_new(_("Save")); + g_signal_connect(G_OBJECT(button), "activate", G_CALLBACK(save_substatus_cb), sub); + gnt_box_add_widget(GNT_BOX(box), button); + gnt_box_add_widget(GNT_BOX(window), box); + + gnt_widget_show(window); + + g_hash_table_insert(edit->hash, account, sub); + + g_signal_connect(G_OBJECT(window), "destroy", G_CALLBACK(substatus_window_destroy_cb), sub); + + return TRUE; + } + return FALSE; +} + void gg_savedstatus_edit(GaimSavedStatus *saved) { EditStatus *edit; - GntWidget *window, *box, *button, *entry, *combo, *label; + GntWidget *window, *box, *button, *entry, *combo, *label, *tree; GaimStatusPrimitive prims[] = {GAIM_STATUS_AVAILABLE, GAIM_STATUS_AWAY, GAIM_STATUS_INVISIBLE, GAIM_STATUS_OFFLINE, GAIM_STATUS_UNSET}, current; + GList *iter; int i; if (saved) @@ -268,6 +429,7 @@ /* Title */ box = gnt_hbox_new(FALSE); + gnt_box_set_alignment(GNT_BOX(box), GNT_ALIGN_LEFT); gnt_box_add_widget(GNT_BOX(window), box); gnt_box_add_widget(GNT_BOX(box), gnt_label_new(_("Title"))); @@ -297,8 +459,27 @@ gnt_box_add_widget(GNT_BOX(box), gnt_label_new(_("Message"))); edit->message = entry = gnt_entry_new(saved ? gaim_savedstatus_get_message(saved) : NULL); - gnt_box_add_widget(GNT_BOX(box), entry); + gnt_box_add_widget(GNT_BOX(window), entry); + gnt_box_add_widget(GNT_BOX(window), gnt_hline_new()); + gnt_box_add_widget(GNT_BOX(window), gnt_label_new(_("Use different status for following accounts"))); + + edit->hash = g_hash_table_new(g_direct_hash, g_direct_equal); + edit->tree = tree = gnt_tree_new_with_columns(3); + gnt_box_add_widget(GNT_BOX(window), tree); + gnt_tree_set_show_title(GNT_TREE(tree), TRUE); + gnt_tree_set_column_titles(GNT_TREE(tree), _("Account"), _("Status"), _("Message")); + gnt_tree_set_col_width(GNT_TREE(tree), 0, 30); + gnt_tree_set_col_width(GNT_TREE(tree), 1, 10); + gnt_tree_set_col_width(GNT_TREE(tree), 2, 30); + + for (iter = gaim_accounts_get_all(); iter; iter = iter->next) + { + add_substatus(edit, iter->data); + } + + g_signal_connect(G_OBJECT(tree), "key_pressed", G_CALLBACK(popup_substatus), edit); + /* The buttons */ box = gnt_hbox_new(FALSE); gnt_box_add_widget(GNT_BOX(window), box); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dat...@us...> - 2006-08-18 22:59:17
|
Revision: 16852 Author: datallah Date: 2006-08-18 15:59:12 -0700 (Fri, 18 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16852&view=rev Log Message: ----------- Our very own Nathan Walp wrote this patch to allow people to make their chat windows do the flashy-flashy thing. Modified Paths: -------------- trunk/plugins/win32/winprefs/winprefs.c Modified: trunk/plugins/win32/winprefs/winprefs.c =================================================================== --- trunk/plugins/win32/winprefs/winprefs.c 2006-08-18 22:51:18 UTC (rev 16851) +++ trunk/plugins/win32/winprefs/winprefs.c 2006-08-18 22:59:12 UTC (rev 16852) @@ -52,6 +52,7 @@ static const char *PREF_DBLIST_SIDE = "/plugins/gtk/win32/winprefs/dblist_side"; static const char *PREF_BLIST_ON_TOP = "/plugins/gtk/win32/winprefs/blist_on_top"; static const char *PREF_IM_BLINK = "/plugins/gtk/win32/winprefs/im_blink"; +static const char *PREF_CHAT_BLINK = "/plugins/gtk/win32/winprefs/chat_blink"; /* Deprecated */ static const char *PREF_DBLIST_ON_TOP = "/plugins/gtk/win32/winprefs/dblist_on_top"; @@ -317,8 +318,7 @@ /* FlashWindowEx is only supported by Win98+ and WinNT5+. If it's not supported we do it our own way */ static gboolean -wgaim_conv_im_blink(GaimAccount *account, const char *who, char **message, - GaimConversation *conv, int flags, void *data) +wgaim_conv_blink(GaimConversation *conv, int flags) { GaimGtkWindow *win; GtkWidget *window; @@ -327,9 +327,6 @@ if(flags & GAIM_MESSAGE_SEND || flags & GAIM_MESSAGE_SYSTEM) return FALSE; - if(!gaim_prefs_get_bool(PREF_IM_BLINK)) - return FALSE; - if(conv == NULL) { gaim_debug_info("winprefs", "gar!\n"); return FALSE; @@ -368,7 +365,28 @@ return FALSE; } +static gboolean +wgaim_conv_im_blink(GaimAccount *account, const char *who, char **message, + GaimConversation *conv, int flags, void *data) +{ + if(!gaim_prefs_get_bool(PREF_IM_BLINK)) + return FALSE; + return wgaim_conv_blink(conv, flags); + +} + +static gboolean +wgaim_conv_chat_blink(GaimAccount *account, const char *who, char **message, + GaimConversation *conv, int flags, void *data) +{ + if(!gaim_prefs_get_bool(PREF_CHAT_BLINK)) + return FALSE; + + return wgaim_conv_blink(conv, flags); +} + + /* * EXPORTED FUNCTIONS */ @@ -394,6 +412,10 @@ "displaying-im-msg", plugin, GAIM_CALLBACK(wgaim_conv_im_blink), NULL); + gaim_signal_connect(gaim_gtk_conversations_get_handle(), + "displaying-chat-msg", plugin, GAIM_CALLBACK(wgaim_conv_chat_blink), + NULL); + gaim_signal_connect((void*)gaim_get_core(), "quitting", plugin, GAIM_CALLBACK(gaim_quit_cb), NULL); @@ -467,8 +489,10 @@ /* Conversations */ vbox = gaim_gtk_make_frame(ret, _("Conversations")); - gaim_gtk_prefs_checkbox(_("_Flash window when messages are received"), + gaim_gtk_prefs_checkbox(_("_Flash window when IMs are received"), PREF_IM_BLINK, vbox); + gaim_gtk_prefs_checkbox(_("_Flash window when chat messages are received"), + PREF_CHAT_BLINK, vbox); gtk_widget_show_all(ret); return ret; @@ -517,6 +541,7 @@ gaim_prefs_add_int(PREF_DBLIST_HEIGHT, 0); gaim_prefs_add_int(PREF_DBLIST_SIDE, 0); gaim_prefs_add_bool(PREF_IM_BLINK, TRUE); + gaim_prefs_add_bool(PREF_CHAT_BLINK, FALSE); /* Convert old preferences */ if(gaim_prefs_exists(PREF_DBLIST_ON_TOP)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dat...@us...> - 2006-08-18 22:51:44
|
Revision: 16851 Author: datallah Date: 2006-08-18 15:51:18 -0700 (Fri, 18 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16851&view=rev Log Message: ----------- Fix cygwin packages list. Modified Paths: -------------- web/htdocs/win32/build.php Modified: web/htdocs/win32/build.php =================================================================== --- web/htdocs/win32/build.php 2006-08-18 22:41:44 UTC (rev 16850) +++ web/htdocs/win32/build.php 2006-08-18 22:51:18 UTC (rev 16851) @@ -12,7 +12,7 @@ <ol> <li> <p> -Install the <a href="http://cygwin.com">Cygwin</a> Bash shell. Make sure to select Unix file mode during setup. Also make sure you install bzip2, coreutils, cvs, grep, gzip, make, patch, sed, awk, tar, unzip, and wget (several of these are selected by default). +Install the <a href="http://cygwin.com">Cygwin</a> Bash shell. Make sure to select Unix file mode during setup. Also make sure you install bash, bzip2, coreutils, gawk, grep, gzip, make, patch, sed, subversion, tar, unzip, and wget (several of these are selected by default). </p> </li> <li> @@ -29,7 +29,7 @@ <h3>The manual way</h3> <ol> -<li>Install the <a href="http://cygwin.com">Cygwin</a> Bash shell. Make sure to select Unix file mode during setup. Also make sure you install bzip2, coreutils, cvs, grep, gzip, make, patch, sed, awk, tar, unzip, and wget (several of these are selected by default).</li> +<li>Install the <a href="http://cygwin.com">Cygwin</a> Bash shell. Make sure to select Unix file mode during setup. Also make sure you install bash, bzip2, coreutils, gawk, grep, gzip, make, patch, sed, subversion, tar, unzip, and wget (several of these are selected by default).</li> <li> <p> Install <a href="http://www.mingw.org">MinGW v3.1 or higher</a>.<br/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dat...@us...> - 2006-08-18 22:41:50
|
Revision: 16850 Author: datallah Date: 2006-08-18 15:41:44 -0700 (Fri, 18 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16850&view=rev Log Message: ----------- ... and also actually load the icon Modified Paths: -------------- trunk/src/gtkaccount.c Modified: trunk/src/gtkaccount.c =================================================================== --- trunk/src/gtkaccount.c 2006-08-18 22:26:09 UTC (rev 16849) +++ trunk/src/gtkaccount.c 2006-08-18 22:41:44 UTC (rev 16850) @@ -194,7 +194,7 @@ char *filename = gaim_buddy_icons_get_full_path(dialog->icon_path); GdkPixbuf *pixbuf = NULL; if (filename) - gdk_pixbuf_new_from_file(filename, NULL); + pixbuf = gdk_pixbuf_new_from_file(filename, NULL); if (pixbuf && dialog->prpl_info && (dialog->prpl_info->icon_spec.scale_rules & GAIM_ICON_SCALE_DISPLAY)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dat...@us...> - 2006-08-18 22:26:15
|
Revision: 16849 Author: datallah Date: 2006-08-18 15:26:09 -0700 (Fri, 18 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16849&view=rev Log Message: ----------- Fix assert editing an account w/o a buddy icon specified. Modified Paths: -------------- trunk/src/gtkaccount.c Modified: trunk/src/gtkaccount.c =================================================================== --- trunk/src/gtkaccount.c 2006-08-18 20:11:51 UTC (rev 16848) +++ trunk/src/gtkaccount.c 2006-08-18 22:26:09 UTC (rev 16849) @@ -192,7 +192,9 @@ set_dialog_icon(AccountPrefsDialog *dialog) { char *filename = gaim_buddy_icons_get_full_path(dialog->icon_path); - GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file(filename, NULL); + GdkPixbuf *pixbuf = NULL; + if (filename) + gdk_pixbuf_new_from_file(filename, NULL); if (pixbuf && dialog->prpl_info && (dialog->prpl_info->icon_spec.scale_rules & GAIM_ICON_SCALE_DISPLAY)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ev...@us...> - 2006-08-18 20:12:20
|
Revision: 16848 Author: evands Date: 2006-08-18 13:11:51 -0700 (Fri, 18 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16848&view=rev Log Message: ----------- music messaging depends on dbus; it should not attempt to build unless ENABLE_DBUS is true Modified Paths: -------------- trunk/plugins/musicmessaging/Makefile.am Modified: trunk/plugins/musicmessaging/Makefile.am =================================================================== --- trunk/plugins/musicmessaging/Makefile.am 2006-08-18 20:09:19 UTC (rev 16847) +++ trunk/plugins/musicmessaging/Makefile.am 2006-08-18 20:11:51 UTC (rev 16848) @@ -6,6 +6,7 @@ musicmessaging_la_LDFLAGS = -module -avoid-version $(GTK_LIBS) $(DBUS_LIBS) if PLUGINS +if ENABLE_DBUS musicmessagingpixdir = $(datadir)/pixmaps/gaim/buttons musicmessagingpix_DATA = music.png @@ -30,9 +31,8 @@ $(musicmessaging_la_OBJECTS) musicmessaging.so: music-messaging-bindings.c $(top_builddir)/src/dbus-types.h - - endif +endif AM_CPPFLAGS = \ -DDATADIR=\"$(datadir)\" \ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nos...@us...> - 2006-08-18 20:11:11
|
Revision: 16847 Author: nosnilmot Date: 2006-08-18 13:09:19 -0700 (Fri, 18 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16847&view=rev Log Message: ----------- Bump the beta # in the rpm spec file Modified Paths: -------------- branches/v2_0_0beta3_1/gaim/gaim.spec.in Modified: branches/v2_0_0beta3_1/gaim/gaim.spec.in =================================================================== --- branches/v2_0_0beta3_1/gaim/gaim.spec.in 2006-08-18 20:06:45 UTC (rev 16846) +++ branches/v2_0_0beta3_1/gaim/gaim.spec.in 2006-08-18 20:09:19 UTC (rev 16847) @@ -6,7 +6,7 @@ # When not doing betas comment this out # NOTE: %defines in spec files are evaluated in comments so the correct # way to comment it out is to replace the % with # -%define beta 3 +%define beta 3.1 %if 0%{?beta} %define gaimver %(echo "@VERSION@"|sed -e 's/cvs//; s/beta.*//') This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nos...@us...> - 2006-08-18 20:07:38
|
Revision: 16846 Author: nosnilmot Date: 2006-08-18 13:06:45 -0700 (Fri, 18 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16846&view=rev Log Message: ----------- Fixes for the MSN http method: Revision 16017: "Leak fix." Part of revision 16115: "CID 179" Revision 16414: "First stab at trying to fix the MSN http connect method. It still doesn't work, and I'm not sure why, but it gets a lot farther in the signon process now. For those unfamiliar with the issue, the MSN http connect method stopped working after all the non-blocking I/O changes. The http connect method is apparently used by lots of people behind silly firewalls and stuff, and therefore we really shouldn't release Gaim 2.0.0 without it working, because people will complain. The two main problems were 1. The outgoing message queue was removed in favor of buffering all data to one large buffer. This sounds good in theory... but apparently each message sent to and from the server has a "SessionID" in the HTTP header. Every message we send should use the same SessionID as the last packet we received from the server. So basically you can't put two messages into the outgoing buffer at the same time because you don't have the correct SessionID to use for the second message. You have to wait until you get the reply from the server. 2. There were some strange buffer problems with using the wrong variable when trying to combine the header+body into one buffer before sending the message. I also fixed a small memleak or two, added some comments, and tried to clean up the code a little." Revision 16416: "Stu pointed out two of my classic blunders! (Nineteen penguin points to the first person to figure out what movie I'm alluding to.) The MSN http connect method works now." ViewCVS Links: ------------- http://svn.sourceforge.net/gaim/?rev=16017&view=rev http://svn.sourceforge.net/gaim/?rev=16115&view=rev http://svn.sourceforge.net/gaim/?rev=16414&view=rev http://svn.sourceforge.net/gaim/?rev=16416&view=rev Modified Paths: -------------- branches/v2_0_0beta3_1/gaim/src/protocols/msn/httpconn.c branches/v2_0_0beta3_1/gaim/src/protocols/msn/httpconn.h branches/v2_0_0beta3_1/gaim/src/protocols/msn/msn.c Modified: branches/v2_0_0beta3_1/gaim/src/protocols/msn/httpconn.c =================================================================== --- branches/v2_0_0beta3_1/gaim/src/protocols/msn/httpconn.c 2006-08-18 19:58:04 UTC (rev 16845) +++ branches/v2_0_0beta3_1/gaim/src/protocols/msn/httpconn.c 2006-08-18 20:06:45 UTC (rev 16846) @@ -25,316 +25,242 @@ #include "debug.h" #include "httpconn.h" -static void read_cb(gpointer data, gint source, GaimInputCondition cond); -gboolean msn_httpconn_parse_data(MsnHttpConn *httpconn, const char *buf, - size_t size, char **ret_buf, size_t *ret_size, - gboolean *error); - -MsnHttpConn * -msn_httpconn_new(MsnServConn *servconn) +typedef struct { MsnHttpConn *httpconn; + char *body; + size_t body_len; +} MsnHttpQueueData; - g_return_val_if_fail(servconn != NULL, NULL); - - httpconn = g_new0(MsnHttpConn, 1); - - gaim_debug_info("msn", "new httpconn (%p)\n", httpconn); - - /* TODO: Remove this */ - httpconn->session = servconn->session; - - httpconn->servconn = servconn; - - httpconn->tx_buf = gaim_circ_buffer_new(MSN_BUF_LEN); - httpconn->tx_handler = 0; - - return httpconn; -} - -void -msn_httpconn_destroy(MsnHttpConn *httpconn) +static void +msn_httpconn_process_queue(MsnHttpConn *httpconn) { - g_return_if_fail(httpconn != NULL); + httpconn->waiting_response = FALSE; - gaim_debug_info("msn", "destroy httpconn (%p)\n", httpconn); + if (httpconn->queue != NULL) + { + MsnHttpQueueData *queue_data; - if (httpconn->connected) - msn_httpconn_disconnect(httpconn); + queue_data = (MsnHttpQueueData *)httpconn->queue->data; - g_free(httpconn->full_session_id); + httpconn->queue = g_list_remove(httpconn->queue, queue_data); - g_free(httpconn->session_id); + msn_httpconn_write(queue_data->httpconn, + queue_data->body, + queue_data->body_len); - g_free(httpconn->host); - - gaim_circ_buffer_destroy(httpconn->tx_buf); - if (httpconn->tx_handler > 0) - gaim_input_remove(httpconn->tx_handler); - - g_free(httpconn); + g_free(queue_data->body); + g_free(queue_data); + } } -static char * -msn_httpconn_proxy_auth(MsnHttpConn *httpconn) +static gboolean +msn_httpconn_parse_data(MsnHttpConn *httpconn, const char *buf, + size_t size, char **ret_buf, size_t *ret_size, + gboolean *error) { - GaimAccount *account; - GaimProxyInfo *gpi; - const char *username, *password; - char *auth = NULL; + const char *s, *c; + char *header, *body; + const char *body_start; + char *tmp; + size_t body_len = 0; + gboolean wasted = FALSE; - account = httpconn->session->account; + g_return_val_if_fail(httpconn != NULL, FALSE); + g_return_val_if_fail(buf != NULL, FALSE); + g_return_val_if_fail(size > 0, FALSE); + g_return_val_if_fail(ret_buf != NULL, FALSE); + g_return_val_if_fail(ret_size != NULL, FALSE); + g_return_val_if_fail(error != NULL, FALSE); - if (gaim_account_get_proxy_info(account) == NULL) - gpi = gaim_global_proxy_get_info(); - else - gpi = gaim_account_get_proxy_info(account); +#if 0 + gaim_debug_info("msn", "HTTP: parsing data {%s}\n", buf); +#endif - if (gpi == NULL || !(gaim_proxy_info_get_type(gpi) == GAIM_PROXY_HTTP || - gaim_proxy_info_get_type(gpi) == GAIM_PROXY_USE_ENVVAR)) - return NULL; + /* Healthy defaults. */ + body = NULL; - username = gaim_proxy_info_get_username(gpi); - password = gaim_proxy_info_get_password(gpi); + *ret_buf = NULL; + *ret_size = 0; + *error = FALSE; - if (username != NULL) { - char *tmp; - auth = g_strdup_printf("%s:%s", username, password ? password : ""); - tmp = gaim_base64_encode((const guchar *)auth, strlen(auth)); - g_free(auth); - auth = g_strdup_printf("Proxy-Authorization: Basic %s\r\n", tmp); - g_free(tmp); - } + /* First, some tests to see if we have a full block of stuff. */ + if (((strncmp(buf, "HTTP/1.1 200 OK\r\n", 17) != 0) && + (strncmp(buf, "HTTP/1.1 100 Continue\r\n", 23) != 0)) && + ((strncmp(buf, "HTTP/1.0 200 OK\r\n", 17) != 0) && + (strncmp(buf, "HTTP/1.0 100 Continue\r\n", 23) != 0))) + { + *error = TRUE; - return auth; -} - -static void -httpconn_write_cb(gpointer data, gint source, GaimInputCondition cond) -{ - MsnHttpConn *httpconn = data; - int ret, writelen; - - if (httpconn->waiting_response) - return; - - writelen = gaim_circ_buffer_get_max_read(httpconn->tx_buf); - - if (writelen == 0) { - httpconn->waiting_response = TRUE; - gaim_input_remove(httpconn->tx_handler); - httpconn->tx_handler = 0; - return; + return FALSE; } - ret = write(httpconn->fd, httpconn->tx_buf->outptr, writelen); + if (strncmp(buf, "HTTP/1.1 100 Continue\r\n", 23) == 0) + { + if ((s = strstr(buf, "\r\n\r\n")) == NULL) + return FALSE; - if (ret < 0 && errno == EAGAIN) - return; - else if (ret <= 0) { - msn_servconn_got_error(httpconn->servconn, - MSN_SERVCONN_ERROR_WRITE); - return; - } + s += 4; - gaim_circ_buffer_mark_read(httpconn->tx_buf, ret); + if (*s == '\0') + { + *ret_buf = g_strdup(""); + *ret_size = 0; - if (ret == writelen) - httpconn_write_cb(data, source, cond); -} + msn_httpconn_process_queue(httpconn); -static ssize_t -write_raw(MsnHttpConn *httpconn, const char *data, size_t data_len) -{ - ssize_t res; /* result of the write operation */ + return TRUE; + } -#ifdef MSN_DEBUG_HTTP - gaim_debug_misc("msn", "Writing HTTP (header): {%s}\n", header); -#endif - - - if (httpconn->tx_handler == 0 && !httpconn->waiting_response) - res = write(httpconn->fd, data, data_len); - else - { - res = -1; - errno = EAGAIN; + buf = s; + size -= (s - buf); } - if (res <= 0 && errno != EAGAIN) - { - msn_servconn_got_error(httpconn->servconn, - MSN_SERVCONN_ERROR_WRITE); - return -1; - } else if (res < 0 || res < data_len) { - if (res < 0) - res = 0; - if (httpconn->tx_handler == 0 && httpconn->fd) - httpconn->tx_handler = gaim_input_add(httpconn->fd, - GAIM_INPUT_WRITE, httpconn_write_cb, httpconn); - gaim_circ_buffer_append(httpconn->tx_buf, data + res, - data_len - res); - } + if ((s = strstr(buf, "\r\n\r\n")) == NULL) + /* Need to wait for the full HTTP header to arrive */ + return FALSE; - return res; -} + s += 4; /* Skip \r\n */ + header = g_strndup(buf, s - buf); + body_start = s; + body_len = size - (body_start - buf); -static void -msn_httpconn_poll(MsnHttpConn *httpconn) -{ - char *header; - char *auth; - int r; - - g_return_if_fail(httpconn != NULL); - - if (httpconn->waiting_response || - httpconn->tx_handler > 0) + if ((s = gaim_strcasestr(header, "Content-Length: ")) != NULL) { - return; - } + int tmp_len; - /* It is OK if this is buffered because it will only be buffered if - nothing else is in the buffer */ + s += strlen("Content-Length: "); - auth = msn_httpconn_proxy_auth(httpconn); + if ((c = strchr(s, '\r')) == NULL) + { + g_free(header); - header = g_strdup_printf( - "POST http://%s/gateway/gateway.dll?Action=poll&SessionID=%s HTTP/1.1\r\n" - "Accept: */*\r\n" - "Accept-Language: en-us\r\n" - "User-Agent: MSMSGS\r\n" - "Host: %s\r\n" - "Proxy-Connection: Keep-Alive\r\n" - "%s" /* Proxy auth */ - "Connection: Keep-Alive\r\n" - "Pragma: no-cache\r\n" - "Content-Type: application/x-msn-messenger\r\n" - "Content-Length: 0\r\n\r\n", - httpconn->host, - httpconn->full_session_id, - httpconn->host, - auth ? auth : ""); + return FALSE; + } - g_free(auth); + tmp = g_strndup(s, c - s); + tmp_len = atoi(tmp); + g_free(tmp); - r = write_raw(httpconn, header, strlen(header)); + if (body_len != tmp_len) + { + /* Need to wait for the full packet to arrive */ - g_free(header); + g_free(header); - if (r >= 0) - { - httpconn->waiting_response = TRUE; - httpconn->dirty = FALSE; +#if 0 + gaim_debug_warning("msn", + "body length (%d) != content length (%d)\n", + body_len, tmp_len); +#endif + + return FALSE; + } } -} -static gboolean -do_poll(gpointer data) -{ - MsnHttpConn *httpconn; + body = g_malloc0(body_len + 1); + memcpy(body, body_start, body_len); - httpconn = data; - - g_return_val_if_fail(httpconn != NULL, TRUE); - -#if 0 - gaim_debug_info("msn", "polling from %s\n", httpconn->session_id); +#ifdef MSN_DEBUG_HTTP + gaim_debug_misc("msn", "Incoming HTTP buffer (header): {%s\r\n}\n", + header); #endif - if ((httpconn->host == NULL) || (httpconn->full_session_id == NULL)) + /* Now we should be able to process the data. */ + if ((s = gaim_strcasestr(header, "X-MSN-Messenger: ")) != NULL) { - gaim_debug_warning("msn", "Attempted HTTP poll before session is established\n"); - return TRUE; - } + char *full_session_id, *gw_ip, *session_action; + char *t, *session_id; + char **elems, **cur, **tokens; - if (httpconn->dirty) - msn_httpconn_poll(httpconn); + full_session_id = gw_ip = session_action = NULL; - return TRUE; -} + s += strlen("X-MSN-Messenger: "); -static void -connect_cb(gpointer data, gint source, GaimInputCondition cond) -{ - MsnHttpConn *httpconn = data; + if ((c = strchr(s, '\r')) == NULL) + { + msn_session_set_error(httpconn->session, + MSN_ERROR_HTTP_MALFORMED, NULL); + gaim_debug_error("msn", "Malformed X-MSN-Messenger field.\n{%s}", + buf); - httpconn->fd = source; + g_free(body); + return FALSE; + } - if (source > 0) - { - httpconn->inpa = gaim_input_add(httpconn->fd, GAIM_INPUT_READ, - read_cb, data); + tmp = g_strndup(s, c - s); - httpconn->timer = gaim_timeout_add(2000, do_poll, httpconn); + elems = g_strsplit(tmp, "; ", 0); - httpconn->waiting_response = FALSE; - if (httpconn->tx_handler > 0) - gaim_input_remove(httpconn->tx_handler); + for (cur = elems; *cur != NULL; cur++) + { + tokens = g_strsplit(*cur, "=", 2); - httpconn->tx_handler = gaim_input_add(source, - GAIM_INPUT_WRITE, httpconn_write_cb, httpconn); + if (strcmp(tokens[0], "SessionID") == 0) + full_session_id = tokens[1]; + else if (strcmp(tokens[0], "GW-IP") == 0) + gw_ip = tokens[1]; + else if (strcmp(tokens[0], "Session") == 0) + session_action = tokens[1]; + else + g_free(tokens[1]); - httpconn_write_cb(httpconn, source, GAIM_INPUT_WRITE); - } - else - { - gaim_debug_error("msn", "HTTP: Connection error\n"); - msn_servconn_got_error(httpconn->servconn, MSN_SERVCONN_ERROR_CONNECT); - } -} + g_free(tokens[0]); + /* Don't free each of the tokens, only the array. */ + g_free(tokens); + } -gboolean -msn_httpconn_connect(MsnHttpConn *httpconn, const char *host, int port) -{ - int r; + g_strfreev(elems); - g_return_val_if_fail(httpconn != NULL, FALSE); - g_return_val_if_fail(host != NULL, FALSE); - g_return_val_if_fail(port > 0, FALSE); + g_free(tmp); - if (httpconn->connected) - msn_httpconn_disconnect(httpconn); + if ((session_action != NULL) && (strcmp(session_action, "close") == 0)) + wasted = TRUE; - r = gaim_proxy_connect(httpconn->session->account, - "gateway.messenger.hotmail.com", 80, connect_cb, httpconn); + g_free(session_action); - if (r == 0) - { - httpconn->waiting_response = TRUE; - httpconn->connected = TRUE; - } + t = strchr(full_session_id, '.'); + session_id = g_strndup(full_session_id, t - full_session_id); - return httpconn->connected; -} + if (!wasted) + { + g_free(httpconn->full_session_id); + httpconn->full_session_id = full_session_id; -void -msn_httpconn_disconnect(MsnHttpConn *httpconn) -{ - g_return_if_fail(httpconn != NULL); + g_free(httpconn->session_id); + httpconn->session_id = session_id; - if (!httpconn->connected) - return; + g_free(httpconn->host); + httpconn->host = gw_ip; + } + else + { + MsnServConn *servconn; - if (httpconn->timer) - gaim_timeout_remove(httpconn->timer); + /* It's going to die. */ + /* poor thing */ - httpconn->timer = 0; + servconn = httpconn->servconn; - if (httpconn->inpa > 0) - { - gaim_input_remove(httpconn->inpa); - httpconn->inpa = 0; + /* I'll be honest, I don't fully understand all this, but this + * causes crashes, Stu. */ + /* if (servconn != NULL) + servconn->wasted = TRUE; */ + + g_free(full_session_id); + g_free(session_id); + g_free(gw_ip); + } } - close(httpconn->fd); + g_free(header); - httpconn->rx_buf = NULL; - httpconn->rx_len = 0; + *ret_buf = body; + *ret_size = body_len; - httpconn->connected = FALSE; + msn_httpconn_process_queue(httpconn); - /* msn_servconn_disconnect(httpconn->servconn); */ + return TRUE; } static void @@ -348,7 +274,7 @@ int len, cur_len; char *result_msg = NULL; size_t result_len = 0; - gboolean error; + gboolean error = FALSE; httpconn = data; servconn = NULL; @@ -375,7 +301,7 @@ if (!msn_httpconn_parse_data(httpconn, httpconn->rx_buf, httpconn->rx_len, &result_msg, &result_len, &error)) { - /* We must wait for more input, or something went wrong */ + /* Either we must wait for more input, or something went wrong */ if (error) msn_servconn_got_error(httpconn->servconn, MSN_SERVCONN_ERROR_READ); @@ -394,8 +320,7 @@ return; } - if (httpconn->rx_buf != NULL) - g_free(httpconn->rx_buf); + g_free(httpconn->rx_buf); httpconn->rx_buf = NULL; httpconn->rx_len = 0; @@ -472,15 +397,169 @@ g_free(old_rx_buf); } +static void +httpconn_write_cb(gpointer data, gint source, GaimInputCondition cond) +{ + MsnHttpConn *httpconn; + int ret, writelen; + + httpconn = data; + writelen = gaim_circ_buffer_get_max_read(httpconn->tx_buf); + + if (writelen == 0) + { + gaim_input_remove(httpconn->tx_handler); + httpconn->tx_handler = 0; + return; + } + + ret = write(httpconn->fd, httpconn->tx_buf->outptr, writelen); + if (ret <= 0) + { + if ((errno == EAGAIN) || (errno == EWOULDBLOCK)) + /* No worries */ + return; + + /* Error! */ + msn_servconn_got_error(httpconn->servconn, MSN_SERVCONN_ERROR_WRITE); + return; + } + + gaim_circ_buffer_mark_read(httpconn->tx_buf, ret); + + /* TODO: I don't think these 2 lines are needed. Remove them? */ + if (ret == writelen) + httpconn_write_cb(data, source, cond); +} + +static gboolean +write_raw(MsnHttpConn *httpconn, const char *data, size_t data_len) +{ + ssize_t res; /* result of the write operation */ + + if (httpconn->tx_handler == 0) + res = write(httpconn->fd, data, data_len); + else + { + res = -1; + errno = EAGAIN; + } + + if ((res <= 0) && ((errno != EAGAIN) && (errno != EWOULDBLOCK))) + { + msn_servconn_got_error(httpconn->servconn, MSN_SERVCONN_ERROR_WRITE); + return FALSE; + } + + if (res < 0 || res < data_len) + { + if (res < 0) + res = 0; + if (httpconn->tx_handler == 0 && httpconn->fd) + httpconn->tx_handler = gaim_input_add(httpconn->fd, + GAIM_INPUT_WRITE, httpconn_write_cb, httpconn); + gaim_circ_buffer_append(httpconn->tx_buf, data + res, + data_len - res); + } + + return TRUE; +} + +static char * +msn_httpconn_proxy_auth(MsnHttpConn *httpconn) +{ + GaimAccount *account; + GaimProxyInfo *gpi; + const char *username, *password; + char *auth = NULL; + + account = httpconn->session->account; + + if (gaim_account_get_proxy_info(account) == NULL) + gpi = gaim_global_proxy_get_info(); + else + gpi = gaim_account_get_proxy_info(account); + + if (gpi == NULL || !(gaim_proxy_info_get_type(gpi) == GAIM_PROXY_HTTP || + gaim_proxy_info_get_type(gpi) == GAIM_PROXY_USE_ENVVAR)) + return NULL; + + username = gaim_proxy_info_get_username(gpi); + password = gaim_proxy_info_get_password(gpi); + + if (username != NULL) { + char *tmp; + auth = g_strdup_printf("%s:%s", username, password ? password : ""); + tmp = gaim_base64_encode((const guchar *)auth, strlen(auth)); + g_free(auth); + auth = g_strdup_printf("Proxy-Authorization: Basic %s\r\n", tmp); + g_free(tmp); + } + + return auth; +} + +static gboolean +msn_httpconn_poll(gpointer data) +{ + MsnHttpConn *httpconn; + char *header; + char *auth; + + httpconn = data; + + g_return_val_if_fail(httpconn != NULL, FALSE); + + if ((httpconn->host == NULL) || (httpconn->full_session_id == NULL)) + { + /* There's no need to poll if the session is not fully established */ + return TRUE; + } + + if (httpconn->waiting_response) + { + /* There's no need to poll if we're already waiting for a response */ + return TRUE; + } + + auth = msn_httpconn_proxy_auth(httpconn); + + header = g_strdup_printf( + "POST http://%s/gateway/gateway.dll?Action=poll&SessionID=%s HTTP/1.1\r\n" + "Accept: */*\r\n" + "Accept-Language: en-us\r\n" + "User-Agent: MSMSGS\r\n" + "Host: %s\r\n" + "Proxy-Connection: Keep-Alive\r\n" + "%s" /* Proxy auth */ + "Connection: Keep-Alive\r\n" + "Pragma: no-cache\r\n" + "Content-Type: application/x-msn-messenger\r\n" + "Content-Length: 0\r\n\r\n", + httpconn->host, + httpconn->full_session_id, + httpconn->host, + auth ? auth : ""); + + g_free(auth); + + if (write_raw(httpconn, header, strlen(header))) + httpconn->waiting_response = TRUE; + + g_free(header); + + return TRUE; +} + ssize_t -msn_httpconn_write(MsnHttpConn *httpconn, const char *body, size_t size) +msn_httpconn_write(MsnHttpConn *httpconn, const char *body, size_t body_len) { char *params; char *data; + int header_len; char *auth; const char *server_types[] = { "NS", "SB" }; const char *server_type; - ssize_t r; /* result of the write operation */ char *host; MsnServConn *servconn; @@ -488,10 +567,23 @@ g_return_val_if_fail(httpconn != NULL, 0); g_return_val_if_fail(body != NULL, 0); - g_return_val_if_fail(size > 0, 0); + g_return_val_if_fail(body_len > 0, 0); servconn = httpconn->servconn; + if (httpconn->waiting_response) + { + MsnHttpQueueData *queue_data = g_new0(MsnHttpQueueData, 1); + + queue_data->httpconn = httpconn; + queue_data->body = g_memdup(body, body_len); + queue_data->body_len = body_len; + + httpconn->queue = g_list_append(httpconn->queue, queue_data); + + return body_len; + } + server_type = server_types[servconn->type]; if (httpconn->virgin) @@ -532,251 +624,158 @@ "Connection: Keep-Alive\r\n" "Pragma: no-cache\r\n" "Content-Type: application/x-msn-messenger\r\n" - "Content-Length: %d\r\n\r\n" - "%s", + "Content-Length: %d\r\n\r\n", host, params, host, auth ? auth : "", - (int) size, - body ? body : ""); + (int) body_len); - g_free(params); g_free(auth); - r = write_raw(httpconn, data, strlen(data)); + header_len = strlen(data); + data = g_realloc(data, header_len + body_len); + memcpy(data + header_len, body, body_len); - g_free(data); - - if (r >= 0) - { + if (write_raw(httpconn, data, header_len + body_len)) httpconn->waiting_response = TRUE; - httpconn->dirty = FALSE; - } - return r; + g_free(data); + + return body_len; } -gboolean -msn_httpconn_parse_data(MsnHttpConn *httpconn, const char *buf, - size_t size, char **ret_buf, size_t *ret_size, - gboolean *error) +MsnHttpConn * +msn_httpconn_new(MsnServConn *servconn) { - GaimConnection *gc; - const char *s, *c; - char *header, *body; - const char *body_start; - char *tmp; - size_t body_len = 0; - gboolean wasted = FALSE; + MsnHttpConn *httpconn; - g_return_val_if_fail(httpconn != NULL, FALSE); - g_return_val_if_fail(buf != NULL, FALSE); - g_return_val_if_fail(size > 0, FALSE); - g_return_val_if_fail(ret_buf != NULL, FALSE); - g_return_val_if_fail(ret_size != NULL, FALSE); - g_return_val_if_fail(error != NULL, FALSE); + g_return_val_if_fail(servconn != NULL, NULL); -#if 0 - gaim_debug_info("msn", "HTTP: parsing data {%s}\n", buf); -#endif + httpconn = g_new0(MsnHttpConn, 1); - httpconn->waiting_response = FALSE; + gaim_debug_info("msn", "new httpconn (%p)\n", httpconn); - gc = gaim_account_get_connection(httpconn->session->account); + /* TODO: Remove this */ + httpconn->session = servconn->session; - /* Healthy defaults. */ - body = NULL; + httpconn->servconn = servconn; - *ret_buf = NULL; - *ret_size = 0; - *error = FALSE; + httpconn->tx_buf = gaim_circ_buffer_new(MSN_BUF_LEN); + httpconn->tx_handler = 0; - /* First, some tests to see if we have a full block of stuff. */ - if (((strncmp(buf, "HTTP/1.1 200 OK\r\n", 17) != 0) && - (strncmp(buf, "HTTP/1.1 100 Continue\r\n", 23) != 0)) && - ((strncmp(buf, "HTTP/1.0 200 OK\r\n", 17) != 0) && - (strncmp(buf, "HTTP/1.0 100 Continue\r\n", 23) != 0))) - { - *error = TRUE; + return httpconn; +} - return FALSE; - } +void +msn_httpconn_destroy(MsnHttpConn *httpconn) +{ + g_return_if_fail(httpconn != NULL); - if (strncmp(buf, "HTTP/1.1 100 Continue\r\n", 23) == 0) - { - if ((s = strstr(buf, "\r\n\r\n")) == NULL) - return FALSE; + gaim_debug_info("msn", "destroy httpconn (%p)\n", httpconn); - s += 4; + if (httpconn->connected) + msn_httpconn_disconnect(httpconn); - if (*s == '\0') - { - *ret_buf = g_strdup(""); - *ret_size = 0; + g_free(httpconn->full_session_id); - if (httpconn->tx_handler > 0) - httpconn_write_cb(httpconn, httpconn->fd, - GAIM_INPUT_WRITE); - else - httpconn->dirty = TRUE; + g_free(httpconn->session_id); - return TRUE; - } + g_free(httpconn->host); - buf = s; - size -= (s - buf); - } + gaim_circ_buffer_destroy(httpconn->tx_buf); + if (httpconn->tx_handler > 0) + gaim_input_remove(httpconn->tx_handler); - if ((s = strstr(buf, "\r\n\r\n")) == NULL) - return FALSE; + g_free(httpconn); +} - s += 4; /* Skip \r\n */ - header = g_strndup(buf, s - buf); - body_start = s; - body_len = size - (body_start - buf); +static void +connect_cb(gpointer data, gint source, GaimInputCondition cond) +{ + MsnHttpConn *httpconn = data; - if ((s = gaim_strcasestr(header, "Content-Length: ")) != NULL) + /* + TODO: Need to do this in case the account is disabled while connecting + if (!g_list_find(gaim_connections_get_all(), gc)) { - int tmp_len; + if (source >= 0) + close(source); + destroy_new_conn_data(new_conn_data); + return; + } + */ - s += strlen("Content-Length: "); + httpconn->fd = source; - if ((c = strchr(s, '\r')) == NULL) - { - g_free(header); + if (source >= 0) + { + httpconn->inpa = gaim_input_add(httpconn->fd, GAIM_INPUT_READ, + read_cb, data); - return FALSE; - } + httpconn->timer = gaim_timeout_add(2000, msn_httpconn_poll, httpconn); - tmp = g_strndup(s, c - s); - tmp_len = atoi(tmp); - g_free(tmp); - - if (body_len != tmp_len) - { - g_free(header); - -#if 0 - gaim_debug_warning("msn", - "body length (%d) != content length (%d)\n", - body_len, tmp_len); -#endif - - return FALSE; - } + msn_httpconn_process_queue(httpconn); } - - body = g_malloc0(body_len + 1); - memcpy(body, body_start, body_len); - -#ifdef MSN_DEBUG_HTTP - gaim_debug_misc("msn", "Incoming HTTP buffer (header): {%s\r\n}\n", - header); -#endif - - /* Now we should be able to process the data. */ - if ((s = gaim_strcasestr(header, "X-MSN-Messenger: ")) != NULL) + else { - char *full_session_id, *gw_ip, *session_action; - char *t, *session_id; - char **elems, **cur, **tokens; + gaim_debug_error("msn", "HTTP: Connection error\n"); + msn_servconn_got_error(httpconn->servconn, MSN_SERVCONN_ERROR_CONNECT); + } +} - full_session_id = gw_ip = session_action = NULL; +gboolean +msn_httpconn_connect(MsnHttpConn *httpconn, const char *host, int port) +{ + int r; - s += strlen("X-MSN-Messenger: "); + g_return_val_if_fail(httpconn != NULL, FALSE); + g_return_val_if_fail(host != NULL, FALSE); + g_return_val_if_fail(port > 0, FALSE); - if ((c = strchr(s, '\r')) == NULL) - { - msn_session_set_error(httpconn->session, - MSN_ERROR_HTTP_MALFORMED, NULL); - gaim_debug_error("msn", "Malformed X-MSN-Messenger field.\n{%s}", - buf); + if (httpconn->connected) + msn_httpconn_disconnect(httpconn); - g_free(body); - return FALSE; - } + r = gaim_proxy_connect(httpconn->session->account, + "gateway.messenger.hotmail.com", 80, connect_cb, httpconn); - tmp = g_strndup(s, c - s); + if (r == 0) + { + httpconn->waiting_response = TRUE; + httpconn->connected = TRUE; + } - elems = g_strsplit(tmp, "; ", 0); + return httpconn->connected; +} - for (cur = elems; *cur != NULL; cur++) - { - tokens = g_strsplit(*cur, "=", 2); +void +msn_httpconn_disconnect(MsnHttpConn *httpconn) +{ + g_return_if_fail(httpconn != NULL); - if (strcmp(tokens[0], "SessionID") == 0) - full_session_id = tokens[1]; - else if (strcmp(tokens[0], "GW-IP") == 0) - gw_ip = tokens[1]; - else if (strcmp(tokens[0], "Session") == 0) - session_action = tokens[1]; + if (!httpconn->connected) + return; - g_free(tokens[0]); - /* Don't free each of the tokens, only the array. */ - g_free(tokens); - } + if (httpconn->timer) + gaim_timeout_remove(httpconn->timer); - g_strfreev(elems); + httpconn->timer = 0; - g_free(tmp); - - if ((session_action != NULL) && (strcmp(session_action, "close") == 0)) - wasted = TRUE; - - g_free(session_action); - - t = strchr(full_session_id, '.'); - session_id = g_strndup(full_session_id, t - full_session_id); - - if (!wasted) - { - if (httpconn->full_session_id != NULL) - g_free(httpconn->full_session_id); - - httpconn->full_session_id = full_session_id; - - if (httpconn->session_id != NULL) - g_free(httpconn->session_id); - - httpconn->session_id = session_id; - - if (httpconn->host != NULL) - g_free(httpconn->host); - - httpconn->host = gw_ip; - } - else - { - MsnServConn *servconn; - - /* It's going to die. */ - /* poor thing */ - - servconn = httpconn->servconn; - - /* I'll be honest, I don't fully understand all this, but this - * causes crashes, Stu. */ - /* if (servconn != NULL) - servconn->wasted = TRUE; */ - - g_free(full_session_id); - g_free(session_id); - g_free(gw_ip); - } + if (httpconn->inpa > 0) + { + gaim_input_remove(httpconn->inpa); + httpconn->inpa = 0; } - g_free(header); + close(httpconn->fd); - *ret_buf = body; - *ret_size = body_len; + g_free(httpconn->rx_buf); + httpconn->rx_buf = NULL; + httpconn->rx_len = 0; - if (httpconn->tx_handler > 0) - httpconn_write_cb(httpconn, httpconn->fd, GAIM_INPUT_WRITE); - else - httpconn->dirty = TRUE; + httpconn->connected = FALSE; - return TRUE; + /* msn_servconn_disconnect(httpconn->servconn); */ } Modified: branches/v2_0_0beta3_1/gaim/src/protocols/msn/httpconn.h =================================================================== --- branches/v2_0_0beta3_1/gaim/src/protocols/msn/httpconn.h 2006-08-18 19:58:04 UTC (rev 16845) +++ branches/v2_0_0beta3_1/gaim/src/protocols/msn/httpconn.h 2006-08-18 20:06:45 UTC (rev 16846) @@ -44,13 +44,13 @@ gboolean waiting_response; /**< The flag that states if we are waiting a response from the server. */ - gboolean dirty; /**< The flag that states if we should poll. */ gboolean connected; /**< The flag that states if the connection is on. */ gboolean virgin; /**< The flag that states if this connection should specify the host (not gateway) to connect to. */ char *host; /**< The HTTP gateway host. */ + GList *queue; /**< The queue of data chunks to write. */ int fd; /**< The connection's file descriptor. */ guint inpa; /**< The connection's input handler. */ @@ -83,11 +83,11 @@ * * @param servconn The server connection. * @param data The data to write. - * @param size The size of the data to write. + * @param data_len The size of the data to write. * * @return The number of bytes written. */ -ssize_t msn_httpconn_write(MsnHttpConn *httpconn, const char *data, size_t size); +ssize_t msn_httpconn_write(MsnHttpConn *httpconn, const char *data, size_t data_len); /** * Connects the HTTP connection object to a host. Modified: branches/v2_0_0beta3_1/gaim/src/protocols/msn/msn.c =================================================================== --- branches/v2_0_0beta3_1/gaim/src/protocols/msn/msn.c 2006-08-18 19:58:04 UTC (rev 16845) +++ branches/v2_0_0beta3_1/gaim/src/protocols/msn/msn.c 2006-08-18 20:06:45 UTC (rev 16846) @@ -733,8 +733,7 @@ return; } - if (gaim_account_get_bool(account, "http_method", FALSE)) - http_method = TRUE; + http_method = gaim_account_get_bool(account, "http_method", FALSE); host = gaim_account_get_string(account, "server", MSN_SERVER); port = gaim_account_get_int(account, "port", MSN_PORT); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |