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: <de...@us...> - 2006-08-24 20:06:15
|
Revision: 17022 Author: deryni9 Date: 2006-08-24 13:05:56 -0700 (Thu, 24 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=17022&view=rev Log Message: ----------- Add a new notification method, this method keeps the unseen message count in an X property (_GAIM_UNSEEN_COUNT) which allow for some nifty things. Also, some whitespace, etc. nitpicks I noticed while going over this. Modified Paths: -------------- trunk/gtk/plugins/notify.c Modified: trunk/gtk/plugins/notify.c =================================================================== --- trunk/gtk/plugins/notify.c 2006-08-24 19:55:43 UTC (rev 17021) +++ trunk/gtk/plugins/notify.c 2006-08-24 20:05:56 UTC (rev 17022) @@ -105,29 +105,36 @@ #define NOTIFY_PLUGIN_ID "gtk-x11-notify" static GaimPlugin *my_plugin = NULL; +static GdkAtom _Cardinal = GDK_NONE; +static GdkAtom _GaimUnseenCount = GDK_NONE; /* notification set/unset */ static int notify(GaimConversation *conv, gboolean increment); static void notify_win(GaimGtkWindow *gaimwin); static void unnotify(GaimConversation *conv, gboolean reset); -static int unnotify_cb(GtkWidget *widget, gpointer data, GaimConversation *conv); +static int unnotify_cb(GtkWidget *widget, gpointer data, + GaimConversation *conv); /* gtk widget callbacks for prefs panel */ static void type_toggle_cb(GtkWidget *widget, gpointer data); static void method_toggle_cb(GtkWidget *widget, gpointer data); static void notify_toggle_cb(GtkWidget *widget, gpointer data); -static gboolean options_entry_cb(GtkWidget *widget, GdkEventFocus *event, gpointer data); +static gboolean options_entry_cb(GtkWidget *widget, GdkEventFocus *event, + gpointer data); static void apply_method(void); static void apply_notify(void); /* string function */ static void handle_string(GaimGtkWindow *gaimwin); -/* count function */ -static void handle_count(GaimGtkWindow *gaimwin); +/* count_title function */ +static void handle_count_title(GaimGtkWindow *gaimwin); +/* count_xprop function */ +static void handle_count_xprop(GaimGtkWindow *gaimwin); + /* urgent function */ -static void handle_urgent(GaimGtkWindow *gaimwin, gboolean add); +static void handle_urgent(GaimGtkWindow *gaimwin, gboolean set); /* raise function */ static void handle_raise(GaimGtkWindow *gaimwin); @@ -135,10 +142,10 @@ /****************************************/ /* Begin doing stuff below this line... */ /****************************************/ -static int +static guint count_messages(GaimGtkWindow *gaimwin) { - gint count = 0; + guint count = 0; GList *convs = NULL, *l; for (convs = gaimwin->gtkconvs; convs != NULL; convs = convs->next) { @@ -154,9 +161,9 @@ static int notify(GaimConversation *conv, gboolean increment) { - GaimGtkWindow *gaimwin = NULL; gint count; gboolean has_focus; + GaimGtkWindow *gaimwin = NULL; if (conv == NULL) return 0; @@ -197,7 +204,9 @@ return; if (gaim_prefs_get_bool("/plugins/gtk/X11/notify/method_count")) - handle_count(gaimwin); + handle_count_title(gaimwin); + if (gaim_prefs_get_bool("/plugins/gtk/X11/notify/method_count_xprop")) + handle_count_xprop(gaimwin); if (gaim_prefs_get_bool("/plugins/gtk/X11/notify/method_string")) handle_string(gaimwin); if (gaim_prefs_get_bool("/plugins/gtk/X11/notify/method_urgent")) @@ -221,11 +230,15 @@ gaim_conversation_autoset_title(active_conv); if (reset) { - /* Only need to actually remove the urgent hinting here, since removing it - * just to have it readded in re-notify is an unnecessary couple extra RTs - * to the server */ + /* Only need to actually remove the urgent hinting here, since + * removing it just to have it readded in re-notify is an + * unnecessary couple extra RTs to the server */ handle_urgent(gaimwin, FALSE); gaim_conversation_set_data(conv, "notify-message-count", GINT_TO_POINTER(0)); + /* Same logic as for the urgent hint, xprops are also a RT. + * This needs to go here so that it gets the updated message + * count. */ + handle_count_xprop(gaimwin); } return; @@ -242,7 +255,7 @@ static gboolean message_displayed_cb(GaimAccount *account, const char *who, char *message, - GaimConversation *conv, GaimMessageFlags flags) + GaimConversation *conv, GaimMessageFlags flags) { if ((gaim_conversation_get_type(conv) == GAIM_CONV_TYPE_CHAT && gaim_prefs_get_bool("/plugins/gtk/X11/notify/type_chat_nick") && @@ -256,7 +269,8 @@ } static void -im_sent_im(GaimAccount *account, const char *receiver, const char *message) { +im_sent_im(GaimAccount *account, const char *receiver, const char *message) +{ GaimConversation *conv = NULL; if (gaim_prefs_get_bool("/plugins/gtk/X11/notify/notify_send")) { @@ -293,9 +307,9 @@ gtkwin = gtkconv->win; if (gaim_prefs_get_bool("/plugins/gtk/X11/notify/notify_focus")) { - /* TODO should really find a way to make this work no matter where the - * focus is inside the conv window, without having to bind to - * focus-in-event on the g(d|t)kwindow */ + /* TODO should really find a way to make this work no matter + * where the focus is inside the conv window, without having + * to bind to focus-in-event on the g(d|t)kwindow */ /* try setting the signal on the focus-in-event for * gtkwin->notebook->container? */ id = g_signal_connect(G_OBJECT(gtkconv->entry), "focus-in-event", @@ -308,8 +322,8 @@ } if (gaim_prefs_get_bool("/plugins/gtk/X11/notify/notify_click")) { - /* TODO similarly should really find a way to allow for clicking in other - * places of the window */ + /* TODO similarly should really find a way to allow for + * clicking in other places of the window */ id = g_signal_connect(G_OBJECT(gtkconv->entry), "button-press-event", G_CALLBACK(unnotify_cb), conv); entry_ids = g_slist_append(entry_ids, GUINT_TO_POINTER(id)); @@ -362,10 +376,11 @@ static void conv_created(GaimConversation *conv) { - gaim_conversation_set_data(conv, "notify-message-count", GINT_TO_POINTER(0)); + gaim_conversation_set_data(conv, "notify-message-count", + GINT_TO_POINTER(0)); - /* always attach the signals, notify() will take care of conversation type - * checking */ + /* always attach the signals, notify() will take care of conversation + * type checking */ attach_signals(conv); } @@ -484,7 +499,7 @@ } static void -handle_count(GaimGtkWindow *gaimwin) +handle_count_title(GaimGtkWindow *gaimwin) { GtkWindow *window; char newtitle[256]; @@ -500,9 +515,36 @@ } static void -handle_urgent(GaimGtkWindow *win, gboolean add) +handle_count_xprop(GaimGtkWindow *gaimwin) { #ifndef _WIN32 + guint count; + GtkWidget *window; + GdkWindow *gdkwin; + + window = gaimwin->window; + g_return_if_fail(window != NULL); + + if (_GaimUnseenCount == GDK_NONE) { + _GaimUnseenCount = gdk_atom_intern("_GAIM_UNSEEN_COUNT", FALSE); + } + + if (_Cardinal == GDK_NONE) { + _Cardinal = gdk_atom_intern("CARDINAL", FALSE); + } + + count = count_messages(gaimwin); + gdkwin = window->window; + + gdk_property_change(gdkwin, _GaimUnseenCount, _Cardinal, 32, + GDK_PROP_MODE_REPLACE, (guchar *) &count, 1); +#endif +} + +static void +handle_urgent(GaimGtkWindow *win, gboolean set) +{ +#ifndef _WIN32 XWMHints *hints; g_return_if_fail(win != NULL); @@ -514,7 +556,7 @@ if(!hints) hints = XAllocWMHints(); - if (add) + if (set) hints->flags |= XUrgencyHint; else hints->flags &= ~XUrgencyHint; @@ -536,7 +578,8 @@ gboolean on = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); gchar pref[256]; - g_snprintf(pref, sizeof(pref), "/plugins/gtk/X11/notify/%s", (char *)data); + g_snprintf(pref, sizeof(pref), "/plugins/gtk/X11/notify/%s", + (char *)data); gaim_prefs_set_bool(pref, on); } @@ -547,7 +590,8 @@ gboolean on = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); gchar pref[256]; - g_snprintf(pref, sizeof(pref), "/plugins/gtk/X11/notify/%s", (char *)data); + g_snprintf(pref, sizeof(pref), "/plugins/gtk/X11/notify/%s", + (char *)data); gaim_prefs_set_bool(pref, on); @@ -567,7 +611,8 @@ gboolean on = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); gchar pref[256]; - g_snprintf(pref, sizeof(pref), "/plugins/gtk/X11/notify/%s", (char *)data); + g_snprintf(pref, sizeof(pref), "/plugins/gtk/X11/notify/%s", + (char *)data); gaim_prefs_set_bool(pref, on); @@ -581,7 +626,8 @@ return FALSE; if (!strcmp(data, "method_string")) { - gaim_prefs_set_string("/plugins/gtk/X11/notify/title_string", gtk_entry_get_text(GTK_ENTRY(widget))); + gaim_prefs_set_string("/plugins/gtk/X11/notify/title_string", + gtk_entry_get_text(GTK_ENTRY(widget))); } apply_method(); @@ -590,11 +636,13 @@ } static void -apply_method() { +apply_method() +{ GList *convs; GaimGtkWindow *gaimwin = NULL; - for (convs = gaim_get_conversations(); convs != NULL; convs = convs->next) { + for (convs = gaim_get_conversations(); convs != NULL; + convs = convs->next) { GaimConversation *conv = (GaimConversation *)convs->data; /* remove notifications */ @@ -706,6 +754,14 @@ G_CALLBACK(method_toggle_cb), "method_count"); #ifndef _WIN32 + /* Count xprop method button */ + toggle = gtk_check_button_new_with_mnemonic(_("Insert count of new message into _X property")); + gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle), + gaim_prefs_get_bool("/plugins/gtk/X11/notify/method_count_xprop")); + g_signal_connect(G_OBJECT(toggle), "toggled", + G_CALLBACK(method_toggle_cb), "method_count_xprop"); + /* Urgent method button */ toggle = gtk_check_button_new_with_mnemonic(_("Set window manager \"_URGENT\" hint")); gtk_box_pack_start(GTK_BOX(vbox), toggle, FALSE, FALSE, 0); @@ -856,8 +912,8 @@ N_("Provides a variety of ways of notifying you of unread messages."), /** description */ N_("Provides a variety of ways of notifying you of unread messages."), + /**< author */ "Etan Reisner <de...@ed...>\n\t\t\tBrian Tarricone <bj...@co...>", - /**< author */ GAIM_WEBSITE, /**< homepage */ plugin_load, /**< load */ @@ -885,6 +941,7 @@ gaim_prefs_add_string("/plugins/gtk/X11/notify/title_string", "(*)"); gaim_prefs_add_bool("/plugins/gtk/X11/notify/method_urgent", FALSE); gaim_prefs_add_bool("/plugins/gtk/X11/notify/method_count", FALSE); + gaim_prefs_add_bool("/plugins/gtk/X11/notify/method_count_xprop", FALSE); gaim_prefs_add_bool("/plugins/gtk/X11/notify/method_raise", FALSE); gaim_prefs_add_bool("/plugins/gtk/X11/notify/notify_focus", FALSE); gaim_prefs_add_bool("/plugins/gtk/X11/notify/notify_click", FALSE); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-08-24 19:56:03
|
Revision: 17021 Author: sadrul Date: 2006-08-24 12:55:43 -0700 (Thu, 24 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=17021&view=rev Log Message: ----------- Show the accounts dialog only once. Modified Paths: -------------- trunk/console/gntaccount.c Modified: trunk/console/gntaccount.c =================================================================== --- trunk/console/gntaccount.c 2006-08-24 19:41:34 UTC (rev 17020) +++ trunk/console/gntaccount.c 2006-08-24 19:55:43 UTC (rev 17021) @@ -225,7 +225,7 @@ return; prplinfo = GAIM_PLUGIN_PROTOCOL_INFO(plugin); - username = g_strdup(gaim_account_get_username(dialog->account)); + username = dialog->account ? g_strdup(gaim_account_get_username(dialog->account)) : NULL; for (iter = prplinfo->user_splits; iter; iter = iter->next) { @@ -612,6 +612,9 @@ GList *iter; GntWidget *box, *button; + if (accounts.window) + return; + accounts.window = gnt_vbox_new(FALSE); gnt_box_set_toplevel(GNT_BOX(accounts.window), TRUE); gnt_box_set_title(GNT_BOX(accounts.window), _("Accounts")); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-08-24 19:41:54
|
Revision: 17020 Author: sadrul Date: 2006-08-24 12:41:34 -0700 (Thu, 24 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=17020&view=rev Log Message: ----------- Some distros put the ncursesw headers in ncursesw/, some don't. Modified Paths: -------------- trunk/configure.ac trunk/console/libgnt/gntcolors.c trunk/console/libgnt/gntmain.c trunk/console/libgnt/gntwidget.h Modified: trunk/configure.ac =================================================================== --- trunk/configure.ac 2006-08-24 18:33:53 UTC (rev 17019) +++ trunk/configure.ac 2006-08-24 19:41:34 UTC (rev 17020) @@ -807,6 +807,9 @@ if test "x$enable_gnt" = "xyes"; then AC_CHECK_LIB(ncursesw, initscr, [GNT_LIBS="-lncursesw"], [enable_gnt=no]) AC_CHECK_LIB(panelw, update_panels, [GNT_LIBS="$GNT_LIBS -lpanelw"], [enable_gnt=no]) + + # Some distros put the headers in ncursesw/, some don't + AC_CHECK_HEADER(ncursesw/ncurses.h, [AC_DEFINE(HAVE_NCURSESW_INC, 1, [Define if you have the ncursesw headers in ncursesw/])]) else enable_gnt=no fi Modified: trunk/console/libgnt/gntcolors.c =================================================================== --- trunk/console/libgnt/gntcolors.c 2006-08-24 18:33:53 UTC (rev 17019) +++ trunk/console/libgnt/gntcolors.c 2006-08-24 19:41:34 UTC (rev 17020) @@ -1,4 +1,9 @@ +#ifdef HAVE_NCURSESW_INC #include <ncursesw/ncurses.h> +#else +#include <ncurses.h> +#endif + #include "gntcolors.h" #include "gntstyle.h" Modified: trunk/console/libgnt/gntmain.c =================================================================== --- trunk/console/libgnt/gntmain.c 2006-08-24 18:33:53 UTC (rev 17019) +++ trunk/console/libgnt/gntmain.c 2006-08-24 19:41:34 UTC (rev 17020) @@ -1,4 +1,8 @@ +#ifdef HAVE_NCURSESW_INC #include <ncursesw/panel.h> +#else +#include <panel.h> +#endif #include "gnt.h" #include "gntbox.h" @@ -485,9 +489,9 @@ * Mouse support: * - bring a window on top if you click on its taskbar * - click on the top-bar of the active window and drag+drop to move a window + * - click on a window to bring it to focus * wishlist: * - have a little [X] on the windows, and clicking it will close that window. - * - click on a window to bring it to focus * - allow scrolling in tree/textview on wheel-scroll event * - click to activate button or select a row in tree * - all these can be fulfilled by adding a "clicked" event for GntWidget Modified: trunk/console/libgnt/gntwidget.h =================================================================== --- trunk/console/libgnt/gntwidget.h 2006-08-24 18:33:53 UTC (rev 17019) +++ trunk/console/libgnt/gntwidget.h 2006-08-24 19:41:34 UTC (rev 17020) @@ -4,7 +4,11 @@ #include <stdio.h> #include <glib.h> #include <glib-object.h> -#include <ncursesw/curses.h> +#ifdef HAVE_NCURSESW_INC +#include <ncursesw/ncurses.h> +#else +#include <ncurses.h> +#endif #define GNT_TYPE_WIDGET (gnt_widget_get_gtype()) #define GNT_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GNT_TYPE_WIDGET, GntWidget)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fac...@us...> - 2006-08-24 18:34:08
|
Revision: 17019 Author: faceprint Date: 2006-08-24 11:33:53 -0700 (Thu, 24 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=17019&view=rev Log Message: ----------- dbus goodness Modified Paths: -------------- trunk/libgaim/xmlnode.c trunk/libgaim/xmlnode.h Modified: trunk/libgaim/xmlnode.c =================================================================== --- trunk/libgaim/xmlnode.c 2006-08-24 17:37:24 UTC (rev 17018) +++ trunk/libgaim/xmlnode.c 2006-08-24 18:33:53 UTC (rev 17019) @@ -35,6 +35,7 @@ #include <string.h> #include <glib.h> +#include "dbus-maybe.h" #include "util.h" #include "xmlnode.h" @@ -52,6 +53,8 @@ node->name = g_strdup(name); node->type = type; + GAIM_DBUS_REGISTER_POINTER(node, xmlnode); + return node; } @@ -218,6 +221,8 @@ #ifdef HAVE_LIBXML g_free(node->namespace); #endif + + GAIM_DBUS_UNREGISTER_POINTER(node); g_free(node); } Modified: trunk/libgaim/xmlnode.h =================================================================== --- trunk/libgaim/xmlnode.h 2006-08-24 17:37:24 UTC (rev 17018) +++ trunk/libgaim/xmlnode.h 2006-08-24 18:33:53 UTC (rev 17019) @@ -38,7 +38,8 @@ /** * An xmlnode. */ -typedef struct _xmlnode +typedef struct _xmlnode xmlnode; +struct _xmlnode { char *name; /**< The name of the node. */ #ifdef HAVE_LIBXML @@ -51,7 +52,7 @@ struct _xmlnode *child; /**< The child node or @c NULL.*/ struct _xmlnode *lastchild; /**< The last child node or @c NULL.*/ struct _xmlnode *next; /**< The next node or @c NULL. */ -} xmlnode; +}; /** * Creates a new xmlnode. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <de...@us...> - 2006-08-24 17:37:36
|
Revision: 17018 Author: deryni9 Date: 2006-08-24 10:37:24 -0700 (Thu, 24 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=17018&view=rev Log Message: ----------- Revert commit 16946 "Use the gtk conversation unseen_count instead of keeping my own count." since that unseen_count gets reset before I get a chance to remove notifications. It's a bit unfortunate since keeping my own count is annoying. Modified Paths: -------------- trunk/gtk/plugins/notify.c Modified: trunk/gtk/plugins/notify.c =================================================================== --- trunk/gtk/plugins/notify.c 2006-08-24 17:33:24 UTC (rev 17017) +++ trunk/gtk/plugins/notify.c 2006-08-24 17:37:24 UTC (rev 17018) @@ -107,7 +107,7 @@ static GaimPlugin *my_plugin = NULL; /* notification set/unset */ -static int notify(GaimConversation *conv); +static int notify(GaimConversation *conv, gboolean increment); static void notify_win(GaimGtkWindow *gaimwin); static void unnotify(GaimConversation *conv, gboolean reset); static int unnotify_cb(GtkWidget *widget, gpointer data, GaimConversation *conv); @@ -135,26 +135,28 @@ /****************************************/ /* Begin doing stuff below this line... */ /****************************************/ -static guint +static int count_messages(GaimGtkWindow *gaimwin) { - guint count = 0; - GList *gtkconvs = NULL; + gint count = 0; + GList *convs = NULL, *l; - for (gtkconvs = gaimwin->gtkconvs; gtkconvs != NULL; - gtkconvs = gtkconvs->next) { - GaimGtkConversation *gtkconv = gtkconvs->data; - count += gtkconv->unseen_count; + for (convs = gaimwin->gtkconvs; convs != NULL; convs = convs->next) { + GaimGtkConversation *conv = convs->data; + for (l = conv->convs; l != NULL; l = l->next) { + count += GPOINTER_TO_INT(gaim_conversation_get_data(l->data, "notify-message-count")); + } } return count; } static int -notify(GaimConversation *conv) +notify(GaimConversation *conv, gboolean increment) { + GaimGtkWindow *gaimwin = NULL; + gint count; gboolean has_focus; - GaimGtkWindow *gaimwin = NULL; if (conv == NULL) return 0; @@ -176,6 +178,12 @@ if (gaim_prefs_get_bool("/plugins/gtk/X11/notify/type_focused") || !has_focus) { + if (increment) { + count = GPOINTER_TO_INT(gaim_conversation_get_data(conv, "notify-message-count")); + count++; + gaim_conversation_set_data(conv, "notify-message-count", GINT_TO_POINTER(count)); + } + notify_win(gaimwin); } @@ -217,6 +225,7 @@ * just to have it readded in re-notify is an unnecessary couple extra RTs * to the server */ handle_urgent(gaimwin, FALSE); + gaim_conversation_set_data(conv, "notify-message-count", GINT_TO_POINTER(0)); } return; @@ -225,11 +234,7 @@ static int unnotify_cb(GtkWidget *widget, gpointer data, GaimConversation *conv) { - GaimGtkConversation *gtkconv = NULL; - - gtkconv = GAIM_GTK_CONVERSATION(conv); - - if (gtkconv->unseen_count > 0) + if (GPOINTER_TO_INT(gaim_conversation_get_data(conv, "notify-message-count")) != 0) unnotify(conv, TRUE); return 0; @@ -245,7 +250,7 @@ return FALSE; if ((flags & GAIM_MESSAGE_RECV) && !(flags & GAIM_MESSAGE_DELAYED)) - notify(conv); + notify(conv, TRUE); return FALSE; } @@ -348,6 +353,8 @@ g_signal_handler_disconnect(gtkconv->entry, GPOINTER_TO_INT(l->data)); g_slist_free(ids); + gaim_conversation_set_data(conv, "notify-message-count", GINT_TO_POINTER(0)); + gaim_conversation_set_data(conv, "notify-imhtml-signals", NULL); gaim_conversation_set_data(conv, "notify-entry-signals", NULL); } @@ -355,6 +362,8 @@ static void conv_created(GaimConversation *conv) { + gaim_conversation_set_data(conv, "notify-message-count", GINT_TO_POINTER(0)); + /* always attach the signals, notify() will take care of conversation type * checking */ attach_signals(conv); @@ -371,7 +380,7 @@ * If the conversation was switched, then make sure we re-notify * because Gaim will have overwritten our custom window title. */ - notify(conv); + notify(conv, FALSE); #if 0 printf("conv_switched - %p - %p\n", old_conv, new_conv); @@ -397,6 +406,7 @@ gaimwin = GAIM_GTK_CONVERSATION(conv)->win; handle_urgent(gaimwin, FALSE); + gaim_conversation_set_data(conv, "notify-message-count", GINT_TO_POINTER(0)); return; @@ -582,21 +592,18 @@ static void apply_method() { GList *convs; + GaimGtkWindow *gaimwin = NULL; for (convs = gaim_get_conversations(); convs != NULL; convs = convs->next) { - GaimConversation *conv = NULL; - GaimGtkConversation *gtkconv = NULL; + GaimConversation *conv = (GaimConversation *)convs->data; - conv = (GaimConversation *) convs->data; - gtkconv = GAIM_GTK_CONVERSATION(conv); - /* remove notifications */ unnotify(conv, FALSE); - if (gtkconv->unseen_count > 0) { + gaimwin = GAIM_GTK_CONVERSATION(conv)->win; + if (GPOINTER_TO_INT(gaim_conversation_get_data(conv, "notify-message-count")) != 0) /* reattach appropriate notifications */ - notify(conv); - } + notify(conv, FALSE); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fac...@us...> - 2006-08-24 17:33:28
|
Revision: 17017 Author: faceprint Date: 2006-08-24 10:33:24 -0700 (Thu, 24 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=17017&view=rev Log Message: ----------- fix xmlnode_from_str for libxml2 Modified Paths: -------------- trunk/libgaim/xmlnode.c Modified: trunk/libgaim/xmlnode.c =================================================================== --- trunk/libgaim/xmlnode.c 2006-08-24 17:01:05 UTC (rev 17016) +++ trunk/libgaim/xmlnode.c 2006-08-24 17:33:24 UTC (rev 17017) @@ -570,7 +570,7 @@ xpd = g_new0(struct _xmlnode_parser_data, 1); #ifdef HAVE_LIBXML - if (xmlSAXUserParseMemory(&xmlnode_parser_libxml, xpd, str, size) < 0) { + if (xmlSAXUserParseMemory(&xmlnode_parser_libxml, xpd, str, real_size) < 0) { while(xpd->current && xpd->current->parent) xpd->current = xpd->current->parent; if(xpd->current) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fac...@us...> - 2006-08-24 17:01:40
|
Revision: 17016 Author: faceprint Date: 2006-08-24 10:01:05 -0700 (Thu, 24 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=17016&view=rev Log Message: ----------- this ought to fix debian bug 384463 Modified Paths: -------------- trunk/libgaim/util.c Modified: trunk/libgaim/util.c =================================================================== --- trunk/libgaim/util.c 2006-08-24 16:38:30 UTC (rev 17015) +++ trunk/libgaim/util.c 2006-08-24 17:01:05 UTC (rev 17016) @@ -1853,7 +1853,7 @@ t++; } } - } else if (!g_ascii_strncasecmp(c, "ftp://", 6)) { + } else if (!g_ascii_strncasecmp(c, "ftp://", 6) || !g_ascii_strncasecmp(c, "sftp://", 7)) { t = c; while (1) { if (badchar(*t) || badentity(t)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <may...@us...> - 2006-08-24 16:38:44
|
Revision: 17015 Author: mayuan2006 Date: 2006-08-24 09:38:30 -0700 (Thu, 24 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=17015&view=rev Log Message: ----------- delete oim integration ok committed by MaYuan<may...@gm...> Modified Paths: -------------- branches/soc-2006-msnp13/src/protocols/msn/README branches/soc-2006-msnp13/src/protocols/msn/notification.c branches/soc-2006-msnp13/src/protocols/msn/oim.c branches/soc-2006-msnp13/src/protocols/msn/oim.h branches/soc-2006-msnp13/src/protocols/msn/soap.c branches/soc-2006-msnp13/src/protocols/msn/soap.h Modified: branches/soc-2006-msnp13/src/protocols/msn/README =================================================================== --- branches/soc-2006-msnp13/src/protocols/msn/README 2006-08-24 14:21:43 UTC (rev 17014) +++ branches/soc-2006-msnp13/src/protocols/msn/README 2006-08-24 16:38:30 UTC (rev 17015) @@ -2,29 +2,31 @@ by Ma Yuan<may...@gm...> 1. Introduction +------------- MSNP14 Protocol, proposed by Windows Live Messenger, is new, and there is no available implementation except the official one on Windows Platform. It has introduced many new features attractable to many users, such as: * Offline Instant Message -You can send the offline Message to the offline User, + You can send the offline Message to the offline User, The message will be posted to that user the next time when he is online. - * Communicate with Yahoo User +* Communicate with Yahoo User U can chat with the Yahoo User in MSN, That's Fantastic! Till now , you can send text/Nudge to Yahoo User. - * Windows Live ID authentition +* Windows Live ID authentition WLM use the Window Live ID Authentication process,Known as Passport 3.0, The procedure is totally different to the previous Passport 2.0 - * Video/Audio Conversation - U can communicate with other's via Video/Audio. +* Video/Audio Conversation + U can communicate with other's via Video/Audio. (Though very interesting, not implemented in this version) 2.New Features Added +----------------- -till Now, This project has implemented the following Feature: +Till now, This project has implemented the following Feature: * Windows Live ID authentication. * Offline Instant Message @@ -33,9 +35,11 @@ * Communicate with Yahoo User Can send/receive Message/Nudge to Yahoo User. -3. Changes to made to fit MSNP14 Protocol +*. Changes to made to fit MSNP14 Protocol -4. Reference +3. Reference +------------- + The very useful sites of MSN Protocol: MSNpiki site: reverse engineer of MSN Protocol.up to dated. Modified: branches/soc-2006-msnp13/src/protocols/msn/notification.c =================================================================== --- branches/soc-2006-msnp13/src/protocols/msn/notification.c 2006-08-24 14:21:43 UTC (rev 17014) +++ branches/soc-2006-msnp13/src/protocols/msn/notification.c 2006-08-24 16:38:30 UTC (rev 17015) @@ -1612,7 +1612,13 @@ // msn_add_group(session,"hello"); } +/*offline Message Notification*/ static void +delete_oim_msg(MsnCmdProc *cmdproc, MsnMessage *msg) +{ +} + +static void email_msg(MsnCmdProc *cmdproc, MsnMessage *msg) { MsnSession *session; @@ -1852,7 +1858,11 @@ msn_table_add_msg_type(cbs_table, "text/x-msmsgsemailnotification", email_msg); + /*delete an offline Message notification*/ msn_table_add_msg_type(cbs_table, + "text/x-msmsgsactivemailnotification", + delete_oim_msg); + msn_table_add_msg_type(cbs_table, "application/x-msmsgssystemmessage", system_msg); } Modified: branches/soc-2006-msnp13/src/protocols/msn/oim.c =================================================================== --- branches/soc-2006-msnp13/src/protocols/msn/oim.c 2006-08-24 14:21:43 UTC (rev 17014) +++ branches/soc-2006-msnp13/src/protocols/msn/oim.c 2006-08-24 16:38:30 UTC (rev 17015) @@ -149,7 +149,55 @@ /**************************************** * OIM delete SOAP request * **************************************/ +static void +msn_oim_delete_read_cb(gpointer data, GaimSslConnection *gsc, + GaimInputCondition cond) +{ + MsnSoapConn * soapconn = data; + MsnOim * oim = soapconn->session->oim; + gaim_debug_info("MaYuan","OIM delete read buffer:{%s}\n",soapconn->body); + + msn_soap_free_read_buf(soapconn); + /*get next single Offline Message*/ + msn_soap_post(soapconn,NULL,msn_oim_retrieve_connect_init); +} + +static void +msn_oim_delete_written_cb(gpointer data, gint source, GaimInputCondition cond) +{ + MsnSoapConn * soapconn = data; + + soapconn->read_cb = msn_oim_delete_read_cb; +} + +/*Post to get the Offline Instant Message*/ +static void +msn_oim_post_delete_msg(MsnOim *oim,const char *msgid) +{ + MsnSoapReq *soap_request; + const char *soap_body,*t,*p; + + g_return_if_fail(oim != NULL); + g_return_if_fail(msgid != NULL); + + gaim_debug_info("MaYuan","Delete single OIM Message {%s}\n",msgid); + t = oim->session->passport_info.t; + p = oim->session->passport_info.p; + + soap_body = g_strdup_printf(MSN_OIM_DEL_TEMPLATE, + t, + p, + msgid + ); + soap_request = msn_soap_request_new(MSN_OIM_RETRIEVE_HOST, + MSN_OIM_RETRIEVE_URL,MSN_OIM_DEL_SOAP_ACTION, + soap_body, + msn_oim_delete_read_cb, + msn_oim_delete_written_cb); + msn_soap_post(oim->retrieveconn,soap_request,msn_oim_retrieve_connect_init); +} + /**************************************** * OIM get SOAP request * **************************************/ @@ -162,6 +210,7 @@ session = soapconn->session; g_return_if_fail(session != NULL); + msn_soap_clean_unhandled_request(soapconn); // msn_session_set_error(session, MSN_ERROR_SERV_DOWN, _("Unable to connect to OIM server")); } @@ -184,6 +233,7 @@ gaim_debug_info("MaYuan","oim get SOAP Server connected!\n"); } +/*Post the Offline Instant Message to User Conversation*/ void msn_oim_report_to_user(MsnOim *oim,char *msg_str) { @@ -194,6 +244,7 @@ char *start,*end; int has_nick = 0; char *passport_str,*passport; + char *msg_id; message = msn_message_new(MSN_MSG_UNKNOWN); @@ -225,24 +276,37 @@ gaim_debug_info("MaYuan","oim Date:{%s},passport{%s}\n",date,passport); msn_session_report_user(oim->session,passport,decode_msg,GAIM_MESSAGE_SYSTEM); + + /*Now get the oim message ID from the oim_list. + * and append to read list to prepare for deleting the Offline Message when sign out + */ + if(oim->oim_list != NULL){ + msg_id = oim->oim_list->data; + msn_oim_post_delete_msg(oim,msg_id); + oim->oim_list = g_list_remove(oim->oim_list, oim->oim_list->data); + } + g_free(passport); } +/* Parse the XML data, + * prepare to report the OIM to user + */ void -msn_oim_process(MsnOim *oim,char *oim_msg) +msn_oim_get_process(MsnOim *oim,char *oim_msg) { xmlnode *oimNode,*bodyNode,*responseNode,*msgNode; char *msg_data,*msg_str; oimNode = xmlnode_from_str(oim_msg, strlen(oim_msg)); bodyNode = xmlnode_get_child(oimNode,"Body"); -// gaim_debug_misc("xml","body{%p},name:%s\n",bodyNode,bodyNode->name); responseNode = xmlnode_get_child(bodyNode,"GetMessageResponse"); msgNode = xmlnode_get_child(responseNode,"GetMessageResult"); msg_data = xmlnode_get_data(msgNode); msg_str = g_strdup(msg_data); gaim_debug_info("OIM","msg:{%s}\n",msg_str); msn_oim_report_to_user(oim,msg_str); + g_free(msg_str); } @@ -256,10 +320,10 @@ gaim_debug_info("MaYuan","OIM get read buffer:{%s}\n",soapconn->body); /*we need to process the read message!*/ - msn_oim_process(oim,soapconn->body); + msn_oim_get_process(oim,soapconn->body); msn_soap_free_read_buf(soapconn); + /*get next single Offline Message*/ -// oim->oim_list = g_list_remove(oim->oim_list, oim->oim_list->data); msn_soap_post(soapconn,NULL,msn_oim_retrieve_connect_init); } @@ -272,7 +336,9 @@ // msn_soap_read_cb(data,source,cond); } -/*parse the oim XML data*/ +/* parse the oim XML data + * and post it to the soap server to get the Offline Message + * */ void msn_parse_oim_msg(MsnOim *oim,const char *xmlmsg) { @@ -291,13 +357,15 @@ nNode = xmlnode_get_child(mNode,"N"); nickname = xmlnode_get_data(nNode); gaim_debug_info("MaYuan","E:{%s},I:{%s},rTime:{%s}\n",passport,msgid,rTime); -// msn_session_report_user(oim->session,passport,"hello"); + oim->oim_list = g_list_append(oim->oim_list,msgid); msn_oim_post_single_get_msg(oim,msgid); } } -static void msn_oim_post_single_get_msg(MsnOim *oim,const char *msgid) +/*Post to get the Offline Instant Message*/ +static void +msn_oim_post_single_get_msg(MsnOim *oim,const char *msgid) { MsnSoapReq *soap_request; const char *soap_body,*t,*p; @@ -329,6 +397,7 @@ msn_oim_get_error_cb); } +/*Msn OIM Send Server Connect Init Function*/ void msn_oim_send_connect_init(MsnSoapConn *sendconn) { gaim_debug_info("MaYuan","msn oim send connect init...\n"); Modified: branches/soc-2006-msnp13/src/protocols/msn/oim.h =================================================================== --- branches/soc-2006-msnp13/src/protocols/msn/oim.h 2006-08-24 14:21:43 UTC (rev 17014) +++ branches/soc-2006-msnp13/src/protocols/msn/oim.h 2006-08-24 16:38:30 UTC (rev 17015) @@ -25,10 +25,10 @@ #ifndef _MSN_OIM_H_ #define _MSN_OIM_H_ +/*OIM Retrieve SOAP Template*/ #define MSN_OIM_RETRIEVE_HOST "rsi.hotmail.com" #define MSN_OIM_RETRIEVE_URL "/rsi/rsi.asmx" #define MSN_OIM_GET_SOAP_ACTION "http://www.hotmail.msn.com/ws/2004/09/oim/rsi/GetMessage" -#define MSN_OIM_DEL_SOAP_ACTION "http://www.hotmail.msn.com/ws/2004/09/oim/rsi/DeleteMessages" #define MSN_OIM_GET_TEMPLATE "<?xml version=\"1.0\" encoding=\"utf-8\"?>"\ "<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">"\ @@ -46,6 +46,9 @@ "</soap:Body>"\ "</soap:Envelope>" +/*OIM Delete SOAP Template*/ +#define MSN_OIM_DEL_SOAP_ACTION "http://www.hotmail.msn.com/ws/2004/09/oim/rsi/DeleteMessages" + #define MSN_OIM_DEL_TEMPLATE "<?xml version=\"1.0\" encoding=\"utf-8\"?>"\ "<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">"\ "<soap:Header>"\ @@ -63,6 +66,7 @@ "</soap:Body>"\ "</soap:Envelope>" +/*OIM Send SOAP Template*/ #define MSN_OIM_SEND_HOST "ows.messenger.msn.com" #define MSN_OIM_SEND_URL "/OimWS/oim.asmx" #define MSN_OIM_SEND_SOAP_ACTION "http://messenger.msn.com/ws/2004/09/oim/Store" Modified: branches/soc-2006-msnp13/src/protocols/msn/soap.c =================================================================== --- branches/soc-2006-msnp13/src/protocols/msn/soap.c 2006-08-24 14:21:43 UTC (rev 17014) +++ branches/soc-2006-msnp13/src/protocols/msn/soap.c 2006-08-24 16:38:30 UTC (rev 17015) @@ -141,12 +141,23 @@ msn_soap_set_process_step(soapconn,MSN_SOAP_UNCONNECTED); } +/*clean the unhandled SOAP request*/ +void +msn_soap_clean_unhandled_request(MsnSoapConn *soapconn) +{ + MsnSoapReq *request; + + g_return_if_fail(soapconn != NULL); + + while ((request = g_queue_pop_head(soapconn->soap_queue)) != NULL){ + msn_soap_request_free(request); + } +} + /*destroy the soap connection*/ void msn_soap_destroy(MsnSoapConn *soapconn) { - MsnSoapReq *request; - if(soapconn->login_host) g_free(soapconn->login_host); @@ -168,9 +179,8 @@ msn_soap_close(soapconn); /*process the unhandled soap request*/ - while ((request = g_queue_pop_head(soapconn->soap_queue)) != NULL){ - msn_soap_request_free(request); - } + msn_soap_clean_unhandled_request(soapconn); + g_queue_free(soapconn->soap_queue); g_free(soapconn); } @@ -551,7 +561,7 @@ "Content-Type:text/xml; charset=utf-8\r\n" "Cookie: MSPAuth=%s\r\n" "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)\r\n" - "Accept: text/*\r\n" + "Accept: */*\r\n" "Host: %s\r\n" "Content-Length: %d\r\n" "Connection: Keep-Alive\r\n" Modified: branches/soc-2006-msnp13/src/protocols/msn/soap.h =================================================================== --- branches/soc-2006-msnp13/src/protocols/msn/soap.h 2006-08-24 14:21:43 UTC (rev 17014) +++ branches/soc-2006-msnp13/src/protocols/msn/soap.h 2006-08-24 16:38:30 UTC (rev 17015) @@ -133,6 +133,9 @@ void msn_soap_connect_cb(gpointer data, GaimSslConnection *gsc, GaimInputCondition cond); void msn_soap_read_cb(gpointer data, gint source, GaimInputCondition cond); +/*clean the unhandled request*/ +void msn_soap_clean_unhandled_request(MsnSoapConn *soapconn); + /*check if the soap connection is connected*/ int msn_soap_connected(MsnSoapConn *soapconn); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <may...@us...> - 2006-08-24 14:21:53
|
Revision: 17014 Author: mayuan2006 Date: 2006-08-24 07:21:43 -0700 (Thu, 24 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=17014&view=rev Log Message: ----------- add Change the PSM string Currently read from Gaim Status Line Thanks for Chris's Code committed by Ma Yuan<may...@gm...> Modified Paths: -------------- branches/soc-2006-msnp13/src/protocols/msn/state.c Modified: branches/soc-2006-msnp13/src/protocols/msn/state.c =================================================================== --- branches/soc-2006-msnp13/src/protocols/msn/state.c 2006-08-24 08:08:14 UTC (rev 17013) +++ branches/soc-2006-msnp13/src/protocols/msn/state.c 2006-08-24 14:21:43 UTC (rev 17014) @@ -108,19 +108,32 @@ return psm; } +/* set the MSN's PSM info,Currently Read from the status Line + * Thanks for Cris Code + */ void msn_set_psm(MsnSession *session) { + GaimAccount *account = session->account; + GaimPresence *presence; + GaimStatus *status; MsnCmdProc *cmdproc; MsnTransaction *trans; - char *payload; + char *payload,*statusline; + g_return_if_fail(session != NULL); + g_return_if_fail(session->notification != NULL); + cmdproc = session->notification->cmdproc; /*prepare PSM info*/ if(session->psm){ g_free(session->psm); } - session ->psm = g_strdup(msn_build_psm("Hello",NULL,NULL)); + /*Get the PSM string from Gaim's Status Line*/ + presence = gaim_account_get_presence(account); + status = gaim_presence_get_active_status(presence); + statusline = gaim_status_get_attr_string(status, "message"); + session ->psm = g_strdup(msn_build_psm(statusline,NULL,NULL)); payload = session->psm; gaim_debug_info("MaYuan","UUX{%s}\n",payload); @@ -166,6 +179,7 @@ g_free(msnobj_str); } + msn_set_psm(session); } const char * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2006-08-24 08:08:19
|
Revision: 17013 Author: markhuetsch Date: 2006-08-24 01:08:14 -0700 (Thu, 24 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=17013&view=rev Log Message: ----------- Don't crash when we try to use a not-yet-functional chat feature. Modified Paths: -------------- trunk/libgaim/protocols/qq/qq.c Modified: trunk/libgaim/protocols/qq/qq.c =================================================================== --- trunk/libgaim/protocols/qq/qq.c 2006-08-24 08:04:46 UTC (rev 17012) +++ trunk/libgaim/protocols/qq/qq.c 2006-08-24 08:08:14 UTC (rev 17013) @@ -965,7 +965,7 @@ _qq_tooltip_text, /* tooltip_text */ _qq_away_states, /* away_states */ NULL, /* blist_node_menu */ - qq_chat_info, /* chat_info */ + NULL, /* chat_info */ NULL, /* chat_info_defaults */ _qq_login, /* login */ _qq_close, /* close */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2006-08-24 08:04:51
|
Revision: 17012 Author: markhuetsch Date: 2006-08-24 01:04:46 -0700 (Thu, 24 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=17012&view=rev Log Message: ----------- Removed the prefix before user IDs, it was giving the Adium folks a hard time. Modified Paths: -------------- trunk/libgaim/protocols/qq/buddy_opt.c trunk/libgaim/protocols/qq/group_find.c trunk/libgaim/protocols/qq/qq.c trunk/libgaim/protocols/qq/utils.c trunk/libgaim/protocols/qq/utils.h Modified: trunk/libgaim/protocols/qq/buddy_opt.c =================================================================== --- trunk/libgaim/protocols/qq/buddy_opt.c 2006-08-24 07:00:34 UTC (rev 17011) +++ trunk/libgaim/protocols/qq/buddy_opt.c 2006-08-24 08:04:46 UTC (rev 17012) @@ -511,7 +511,7 @@ gaim_blist_remove_buddy(b); gaim_notify_error(gc, NULL, _("QQid Error"), - _("Invalid QQid, to add buddy 1234567, \nyou should input qq-1234567")); + _("Invalid QQid")); } } Modified: trunk/libgaim/protocols/qq/group_find.c =================================================================== --- trunk/libgaim/protocols/qq/group_find.c 2006-08-24 07:00:34 UTC (rev 17011) +++ trunk/libgaim/protocols/qq/group_find.c 2006-08-24 08:04:46 UTC (rev 17012) @@ -38,10 +38,13 @@ g_return_val_if_fail(gc != NULL && who != NULL, NULL); + /* TODO checkbox for this in UI */ /* if it starts with QQ_NAME_PREFIX, we think it is valid name already * otherwise we think it is nickname and try to find the matching gaim_name */ + /* if (gaim_str_has_prefix(who, QQ_NAME_PREFIX) && gaim_name_to_uid(who) > 0) return (gchar *) who; + */ group = qq_group_find_by_channel(gc, channel); g_return_val_if_fail(group != NULL, NULL); Modified: trunk/libgaim/protocols/qq/qq.c =================================================================== --- trunk/libgaim/protocols/qq/qq.c 2006-08-24 07:00:34 UTC (rev 17011) +++ trunk/libgaim/protocols/qq/qq.c 2006-08-24 08:04:46 UTC (rev 17012) @@ -374,7 +374,7 @@ if (uid <= 0) { gaim_debug(GAIM_DEBUG_ERROR, "QQ", "Not valid QQid: %s\n", who); - gaim_notify_error(gc, NULL, _("Invalid name, please input in qq-xxxxxxxx format"), NULL); + gaim_notify_error(gc, NULL, _("Invalid name"), NULL); return; } Modified: trunk/libgaim/protocols/qq/utils.c =================================================================== --- trunk/libgaim/protocols/qq/utils.c 2006-08-24 07:00:34 UTC (rev 17011) +++ trunk/libgaim/protocols/qq/utils.c 2006-08-24 08:04:46 UTC (rev 17012) @@ -36,7 +36,7 @@ #include "util.h" #include "utils.h" -#define QQ_NAME_FORMAT "qq-%d" +#define QQ_NAME_FORMAT "%d" gchar *get_name_by_index_str(gchar **array, const gchar *index_str, gint amount) { @@ -164,22 +164,24 @@ return g_strdup_printf("qq_%d", set); } -/* convert a QQ UID to a unique name of GAIM +/* convert a QQ UID to a unique name of Gaim * the return needs to be freed */ gchar *uid_to_gaim_name(guint32 uid) { return g_strdup_printf(QQ_NAME_FORMAT, uid); } -/* convert GAIM name to original QQ UID */ +/* convert Gaim name to original QQ UID */ guint32 gaim_name_to_uid(const gchar *const name) { - gchar *p; + guint32 ret; + g_return_val_if_fail(name != NULL, 0); - g_return_val_if_fail(gaim_str_has_prefix(name, QQ_NAME_PREFIX), 0); - - p = g_strrstr(name, QQ_NAME_PREFIX); - return (p == NULL) ? 0 : strtol(p + strlen(QQ_NAME_PREFIX), NULL, 10); + ret = strtol(name, NULL, 10); + if (errno == ERANGE) + return 0; + else + return ret; } /* try to dump the data as GBK */ Modified: trunk/libgaim/protocols/qq/utils.h =================================================================== --- trunk/libgaim/protocols/qq/utils.h 2006-08-24 07:00:34 UTC (rev 17011) +++ trunk/libgaim/protocols/qq/utils.h 2006-08-24 08:04:46 UTC (rev 17012) @@ -26,8 +26,6 @@ #include <stdio.h> #include <glib.h> -#define QQ_NAME_PREFIX "qq-" - gchar *get_name_by_index_str(gchar **array, const gchar *index_str, gint amount); gchar *get_index_str_by_name(gchar **array, const gchar *name, gint amount); gint qq_string_to_dec_value(const gchar *str); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2006-08-24 07:00:42
|
Revision: 17011 Author: markhuetsch Date: 2006-08-24 00:00:34 -0700 (Thu, 24 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=17011&view=rev Log Message: ----------- Use GaimPresence to keep track of our status instead of qd->status. Also allow invisible logins. Modified Paths: -------------- trunk/libgaim/protocols/qq/buddy_status.c trunk/libgaim/protocols/qq/buddy_status.h trunk/libgaim/protocols/qq/keep_alive.c trunk/libgaim/protocols/qq/login_logout.c trunk/libgaim/protocols/qq/login_logout.h trunk/libgaim/protocols/qq/qq.c trunk/libgaim/protocols/qq/qq.h Modified: trunk/libgaim/protocols/qq/buddy_status.c =================================================================== --- trunk/libgaim/protocols/qq/buddy_status.c 2006-08-24 02:35:15 UTC (rev 17010) +++ trunk/libgaim/protocols/qq/buddy_status.c 2006-08-24 07:00:34 UTC (rev 17011) @@ -35,16 +35,8 @@ #include "qq_proxy.h" #define QQ_MISC_STATUS_HAVING_VIIDEO 0x00000001 - -#define QQ_ICON_SUFFIX_DEFAULT QQ_ICON_SUFFIX_OFFLINE #define QQ_CHANGE_ONLINE_STATUS_REPLY_OK 0x30 /* ASCII value of "0" */ -enum { - QQ_ICON_SUFFIX_NORMAL = 1, - QQ_ICON_SUFFIX_OFFLINE = 2, - QQ_ICON_SUFFIX_AWAY = 3, -}; - void qq_buddy_status_dump_unclear(qq_buddy_status *s) { GString *dump; @@ -120,22 +112,25 @@ return FALSE; } -/* The QQ client seems to use a separate icon for each - * face/status combo, but we only use one and let Gaim - * handle the rest. We need to use this function to report - * the correct icon file back to the server. */ -gint get_icon_offset_from_self_status(guint8 status) -{ - switch (status) { - case QQ_SELF_STATUS_AVAILABLE: + /* Help calculate the correct icon index to tell the server. */ +gint get_icon_offset(GaimConnection *gc) +{ + GaimAccount *account; + GaimPresence *presence; + + g_return_val_if_fail(gc != NULL && gc->proto_data != NULL, 2); + + account = gaim_connection_get_account(gc); + presence = gaim_account_get_presence(account); + + if (gaim_presence_is_status_primitive_active(presence, GAIM_STATUS_INVISIBLE)) { + return 2; + } else if (gaim_presence_is_status_primitive_active(presence, GAIM_STATUS_AWAY) + || gaim_presence_is_status_primitive_active(presence, GAIM_STATUS_EXTENDED_AWAY) + || gaim_presence_is_status_primitive_active(presence, GAIM_STATUS_UNAVAILABLE)) { + return 1; + } else { return 0; - case QQ_SELF_STATUS_AWAY: - case QQ_SELF_STATUS_CUSTOM: - return 1; - case QQ_SELF_STATUS_INVISIBLE: - return 2; - default: - return 2; } } @@ -146,26 +141,25 @@ guint8 *raw_data, *cursor, away_cmd; guint32 misc_status; gboolean fake_video; + GaimAccount *account; + GaimPresence *presence; g_return_if_fail(gc != NULL && gc->proto_data != NULL); + account = gaim_connection_get_account(gc); + presence = gaim_account_get_presence(account); + qd = (qq_data *) gc->proto_data; if (!qd->logged_in) return; - switch (qd->status) { - case QQ_SELF_STATUS_AVAILABLE: - away_cmd = QQ_BUDDY_ONLINE_NORMAL; - break; - case QQ_SELF_STATUS_INVISIBLE: + if (gaim_presence_is_status_primitive_active(presence, GAIM_STATUS_INVISIBLE)) { away_cmd = QQ_BUDDY_ONLINE_INVISIBLE; - break; - case QQ_SELF_STATUS_AWAY: - case QQ_SELF_STATUS_IDLE: - case QQ_SELF_STATUS_CUSTOM: + } else if (gaim_presence_is_status_primitive_active(presence, GAIM_STATUS_AWAY) + || gaim_presence_is_status_primitive_active(presence, GAIM_STATUS_EXTENDED_AWAY) + || gaim_presence_is_status_primitive_active(presence, GAIM_STATUS_UNAVAILABLE)) { away_cmd = QQ_BUDDY_ONLINE_AWAY; - break; - default: + } else { away_cmd = QQ_BUDDY_ONLINE_NORMAL; } @@ -191,6 +185,9 @@ qq_data *qd; gint len; guint8 *data, *cursor, reply; + GaimBuddy *b; + qq_buddy *q_bud; + gchar *name; g_return_if_fail(gc != NULL && gc->proto_data != NULL); g_return_if_fail(buf != NULL && buf_len != 0); @@ -204,11 +201,17 @@ read_packet_b(data, &cursor, len, &reply); if (reply != QQ_CHANGE_ONLINE_STATUS_REPLY_OK) { gaim_debug(GAIM_DEBUG_WARNING, "QQ", "Change status fail\n"); - } else + } else { gaim_debug(GAIM_DEBUG_INFO, "QQ", "Change status OK\n"); - } else + name = uid_to_gaim_name(qd->uid); + b = gaim_find_buddy(gc->account, name); + g_free(name); + q_bud = (b == NULL) ? NULL : (qq_buddy *) b->proto_data; + qq_update_buddy_contact(gc, q_bud); + } + } else { gaim_debug(GAIM_DEBUG_ERROR, "QQ", "Error decrypt chg status reply\n"); - + } } /* it is a server message indicating that one of my buddies has changed its status */ @@ -236,11 +239,13 @@ bytes = 0; /* 000-030: qq_buddy_status */ bytes += qq_buddy_status_read(data, &cursor, len, s); - /* 031-034: my uid */ + /* 031-034: my uid */ + /* This has a value of 0 when we've changed our status to + * QQ_BUDDY_ONLINE_INVISIBLE */ bytes += read_packet_dw(data, &cursor, len, &my_uid); - if (my_uid == 0 || bytes != 35) { - gaim_debug(GAIM_DEBUG_ERROR, "QQ", "my_uid == 0 || bytes(%d) != 35\n", bytes); + if (bytes != 35) { + gaim_debug(GAIM_DEBUG_ERROR, "QQ", "bytes(%d) != 35\n", bytes); g_free(s->ip); g_free(s->unknown_key); g_free(s); @@ -263,7 +268,7 @@ qq_update_buddy_contact(gc, q_bud); } else { gaim_debug(GAIM_DEBUG_ERROR, "QQ", - "got information of unknown buddy by gfhuang %d\n", s->uid); + "got information of unknown buddy %d\n", s->uid); } g_free(s->ip); Modified: trunk/libgaim/protocols/qq/buddy_status.h =================================================================== --- trunk/libgaim/protocols/qq/buddy_status.h 2006-08-24 02:35:15 UTC (rev 17010) +++ trunk/libgaim/protocols/qq/buddy_status.h 2006-08-24 07:00:34 UTC (rev 17011) @@ -47,19 +47,11 @@ QQ_BUDDY_ONLINE_INVISIBLE = 0x28 }; -enum { - QQ_SELF_STATUS_AVAILABLE = 0x11, - QQ_SELF_STATUS_AWAY = 0x12, - QQ_SELF_STATUS_INVISIBLE = 0x13, - QQ_SELF_STATUS_CUSTOM = 0x14, - QQ_SELF_STATUS_IDLE = 0x15 -}; - void qq_buddy_status_dump_unclear(qq_buddy_status *s); gboolean is_online(guint8 status); gint qq_buddy_status_read(guint8 *data, guint8 **cursor, gint len, qq_buddy_status *s); -gint get_icon_offset_from_self_status(guint8 status); +gint get_icon_offset(GaimConnection *gc); void qq_send_packet_change_status(GaimConnection *gc); Modified: trunk/libgaim/protocols/qq/keep_alive.c =================================================================== --- trunk/libgaim/protocols/qq/keep_alive.c 2006-08-24 02:35:15 UTC (rev 17010) +++ trunk/libgaim/protocols/qq/keep_alive.c 2006-08-24 07:00:34 UTC (rev 17011) @@ -160,13 +160,13 @@ break; default: status_id = "invisible"; - gaim_debug(GAIM_DEBUG_ERROR, "QQ", "unknown status by gfhuang: %x\n", q_bud->status); + gaim_debug(GAIM_DEBUG_ERROR, "QQ", "unknown status: %x\n", q_bud->status); break; } gaim_debug(GAIM_DEBUG_INFO, "QQ", "set buddy %d to %s\n", q_bud->uid, status_id); gaim_prpl_got_user_status(gc->account, name, status_id, NULL); } else { - gaim_debug(GAIM_DEBUG_ERROR, "QQ", "unknown buddy by gfhuang: %d\n", q_bud->uid); + gaim_debug(GAIM_DEBUG_ERROR, "QQ", "unknown buddy: %d\n", q_bud->uid); } gaim_debug(GAIM_DEBUG_INFO, "QQ", "qq_update_buddy_contact, client=%04x\n", q_bud->client_version); Modified: trunk/libgaim/protocols/qq/login_logout.c =================================================================== --- trunk/libgaim/protocols/qq/login_logout.c 2006-08-24 02:35:15 UTC (rev 17010) +++ trunk/libgaim/protocols/qq/login_logout.c 2006-08-24 07:00:34 UTC (rev 17011) @@ -231,11 +231,10 @@ /* Now goes on updating my icon/nickname, not showing info_window */ qd->modifying_face = FALSE; qq_send_packet_get_info(gc, qd->uid, FALSE); - /* change my status manually, even server may broadcast my online */ - qd->status = (qd->login_mode == QQ_LOGIN_MODE_HIDDEN) ? QQ_SELF_STATUS_INVISIBLE : QQ_SELF_STATUS_AVAILABLE; + qq_send_packet_change_status(gc); - /* now refresh buddy list */ + /* now refresh buddy list */ /* changed by gfhuang, using With Qun version, error, not working still */ qq_send_packet_get_buddies_list(gc, QQ_FRIENDS_LIST_POSITION_START); /* qq_send_packet_get_all_list_with_group(gc, QQ_FRIENDS_LIST_POSITION_START); */ Modified: trunk/libgaim/protocols/qq/login_logout.h =================================================================== --- trunk/libgaim/protocols/qq/login_logout.h 2006-08-24 02:35:15 UTC (rev 17010) +++ trunk/libgaim/protocols/qq/login_logout.h 2006-08-24 07:00:34 UTC (rev 17011) @@ -27,6 +27,7 @@ #include "connection.h" #define QQ_LOGIN_MODE_NORMAL 0x0a +#define QQ_LOGIN_MODE_AWAY 0x1e #define QQ_LOGIN_MODE_HIDDEN 0x28 void qq_send_packet_request_login_token(GaimConnection *gc); Modified: trunk/libgaim/protocols/qq/qq.c =================================================================== --- trunk/libgaim/protocols/qq/qq.c 2006-08-24 02:35:15 UTC (rev 17010) +++ trunk/libgaim/protocols/qq/qq.c 2006-08-24 07:00:34 UTC (rev 17011) @@ -94,7 +94,7 @@ qq_data *qd; GaimConnection *gc; GaimPresence *presence; - gboolean login_hidden, use_tcp; + gboolean use_tcp; g_return_if_fail(account != NULL); @@ -111,16 +111,16 @@ qq_port = gaim_account_get_string(account, "port", NULL); use_tcp = gaim_account_get_bool(account, "use_tcp", FALSE); presence = gaim_account_get_presence(account); - login_hidden = gaim_presence_is_status_primitive_active(presence, GAIM_STATUS_INVISIBLE); qd->use_tcp = use_tcp; - if (login_hidden) { + if(gaim_presence_is_status_primitive_active(presence, GAIM_STATUS_INVISIBLE)) { qd->login_mode = QQ_LOGIN_MODE_HIDDEN; - gaim_debug(GAIM_DEBUG_INFO, "QQ", "Login in hidden mode\n"); + } else if(gaim_presence_is_status_primitive_active(presence, GAIM_STATUS_AWAY) + || gaim_presence_is_status_primitive_active(presence, GAIM_STATUS_EXTENDED_AWAY)) { + qd->login_mode = QQ_LOGIN_MODE_AWAY; } else { qd->login_mode = QQ_LOGIN_MODE_NORMAL; - gaim_debug(GAIM_DEBUG_INFO, "QQ", "Login in normal mode\n"); } if (qq_server == NULL || strlen(qq_server) == 0) @@ -258,7 +258,7 @@ emblems[0] = "offline"; } else { /* TODO the wireless icon is a bit too big to look good with QQ faces */ - if (q_bud->status == QQ_BUDDY_ONLINE_AWAY || q_bud->status == QQ_SELF_STATUS_AWAY) + if (q_bud->status == QQ_BUDDY_ONLINE_AWAY) emblems[i++] = "away"; if (q_bud->comm_flag & QQ_COMM_FLAG_QQ_MEMBER) emblems[i++] = "qq_member"; @@ -306,24 +306,7 @@ static void _qq_set_away(GaimAccount *account, GaimStatus *status) { GaimConnection *gc = gaim_account_get_connection(account); - const char *state = gaim_status_get_id(status); - qq_data *qd; - - - g_return_if_fail(gc != NULL && gc->proto_data != NULL); - - qd = (qq_data *) gc->proto_data; - - if(0 == strcmp(state, "available")) - qd->status = QQ_SELF_STATUS_AVAILABLE; - else if (0 == strcmp(state, "away")) - qd->status = QQ_SELF_STATUS_AWAY; - else if (0 == strcmp(state, "invisible")) - qd->status = QQ_SELF_STATUS_INVISIBLE; - else - qd->status = QQ_SELF_STATUS_AVAILABLE; - qq_send_packet_change_status(gc); } @@ -420,7 +403,7 @@ qd = (qq_data *) gc->proto_data; field = gaim_request_fields_get_field(fields, "face_num"); - suffix = get_icon_offset_from_self_status(qd->status); + suffix = get_icon_offset(gc); qd->my_icon = gaim_request_field_choice_get_value(field) * 3 + suffix; qd->modifying_face = TRUE; qq_send_packet_get_info(gc, qd->uid, FALSE); Modified: trunk/libgaim/protocols/qq/qq.h =================================================================== --- trunk/libgaim/protocols/qq/qq.h 2006-08-24 02:35:15 UTC (rev 17010) +++ trunk/libgaim/protocols/qq/qq.h 2006-08-24 07:00:34 UTC (rev 17011) @@ -64,7 +64,6 @@ guint16 send_seq; /* send sequence number */ guint8 login_mode; /* online of invisible */ - guint8 status; gboolean logged_in; /* used by qq-add_buddy */ gboolean use_tcp; /* network in tcp or udp */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-08-24 02:35:20
|
Revision: 17010 Author: sadrul Date: 2006-08-23 19:35:15 -0700 (Wed, 23 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=17010&view=rev Log Message: ----------- This should allow mouse-events to work for everyone. Also, you can click on any window to bring it to focus. Modified Paths: -------------- trunk/console/libgnt/gntmain.c Modified: trunk/console/libgnt/gntmain.c =================================================================== --- trunk/console/libgnt/gntmain.c 2006-08-24 01:13:57 UTC (rev 17009) +++ trunk/console/libgnt/gntmain.c 2006-08-24 02:35:15 UTC (rev 17010) @@ -24,6 +24,7 @@ static int lock_focus_list; static GList *focus_list; +static GList *ordered; static int X_MIN; static int X_MAX; @@ -64,6 +65,14 @@ static gboolean refresh_screen(); +static GList * +g_list_bring_to_front(GList *list, gpointer data) +{ + list = g_list_remove(list, data); + list = g_list_prepend(list, data); + return list; +} + static gboolean update_screen(gpointer null) { @@ -78,17 +87,16 @@ if (lock_focus_list) return; - if (g_list_find(g_list_first(focus_list), widget)) + if (g_list_find(focus_list, widget)) return; - if (focus_list) - w = focus_list->data; + if (ordered) + w = ordered->data; - /* XXX: ew */ - focus_list = g_list_first(focus_list); focus_list = g_list_append(focus_list, widget); - focus_list = g_list_find(focus_list, w ? w : widget); + ordered = g_list_append(ordered, widget); + gnt_widget_set_focus(widget, TRUE); if (w) gnt_widget_set_focus(w, FALSE); @@ -97,8 +105,7 @@ void gnt_screen_remove_widget(GntWidget *widget) { - int pos = g_list_index(g_list_first(focus_list), widget); - GList *next; + int pos = g_list_index(focus_list, widget); if (lock_focus_list) return; @@ -106,15 +113,12 @@ if (pos == -1) return; - focus_list = g_list_first(focus_list); focus_list = g_list_remove(focus_list, widget); - next = g_list_nth(focus_list, pos - 1); - if (next) - focus_list = next; + ordered = g_list_remove(ordered, widget); - if (focus_list) + if (ordered) { - bring_on_top(focus_list->data); + bring_on_top(ordered->data); } draw_taskbar(FALSE); } @@ -124,14 +128,11 @@ { GntNode *node = g_hash_table_lookup(nodes, widget); - g_return_if_fail(focus_list->data == widget); - if (!node) return; - gnt_widget_set_focus(focus_list->data, TRUE); - gnt_widget_draw(focus_list->data); - + gnt_widget_set_focus(widget, TRUE); + gnt_widget_draw(widget); top_panel(node->panel); if (window_list.window) @@ -151,7 +152,7 @@ if (window_list.window == NULL) return; - if (wid == focus_list->data) + if (wid == ordered->data) flag |= GNT_TEXT_FLAG_DIM; else if (GNT_WIDGET_IS_FLAG_SET(wid, GNT_WIDGET_URGENT)) flag |= GNT_TEXT_FLAG_BOLD; @@ -179,17 +180,17 @@ wbkgdset(taskbar, '\0' | COLOR_PAIR(GNT_COLOR_NORMAL)); werase(taskbar); - n = g_list_length(g_list_first(focus_list)); + n = g_list_length(focus_list); if (n) width = getmaxx(stdscr) / n; - for (i = 0, iter = g_list_first(focus_list); iter; iter = iter->next, i++) + for (i = 0, iter = focus_list; iter; iter = iter->next, i++) { GntWidget *w = iter->data; int color; const char *title; - if (w == focus_list->data) + if (w == ordered->data) { /* This is the current window in focus */ color = GNT_COLOR_TITLE; @@ -218,31 +219,28 @@ static void switch_window(int direction) { - GntWidget *w = NULL; - if (focus_list) - w = focus_list->data; + GntWidget *w = NULL, *wid = NULL; + int pos; - if (direction == 1) - { - if (focus_list && focus_list->next) - focus_list = focus_list->next; - else - focus_list = g_list_first(focus_list); - } - else if (direction == -1) - { - if (focus_list && focus_list->prev) - focus_list = focus_list->prev; - else - focus_list = g_list_last(focus_list); - } - - if (focus_list) - { - bring_on_top(focus_list->data); - } + if (!ordered || !ordered->next) + return; - if (w && (!focus_list || w != focus_list->data)) + w = ordered->data; + pos = g_list_index(focus_list, w); + pos += direction; + + if (pos < 0) + wid = g_list_last(focus_list)->data; + else if (pos >= g_list_length(focus_list)) + wid = focus_list->data; + else if (pos >= 0) + wid = g_list_nth_data(focus_list, pos); + + ordered = g_list_bring_to_front(ordered, wid); + + bring_on_top(ordered->data); + + if (w != wid) { gnt_widget_set_focus(w, FALSE); } @@ -254,16 +252,18 @@ GntWidget *w = NULL; GList *l; - if (focus_list) - w = focus_list->data; + if (!ordered) + return; + + w = ordered->data; - if ((l = g_list_nth(g_list_first(focus_list), n)) != NULL) + if ((l = g_list_nth(focus_list, n)) != NULL) { - focus_list = l; - bring_on_top(focus_list->data); + ordered = g_list_bring_to_front(ordered, l->data); + bring_on_top(ordered->data); } - if (w && (!focus_list || w != focus_list->data)) + if (l && w != l->data) { gnt_widget_set_focus(w, FALSE); } @@ -275,13 +275,14 @@ GntWidget *widget = gnt_tree_get_selection_data(GNT_TREE(tree)); GntWidget *old = NULL; - if (focus_list) - old = focus_list->data; + if (!ordered || !widget) + return; - focus_list = g_list_find(g_list_first(focus_list), widget); + old = ordered->data; + ordered = g_list_bring_to_front(ordered, widget); bring_on_top(widget); - if (old && (!focus_list || old != focus_list->data)) + if (old != widget) { gnt_widget_set_focus(old, FALSE); } @@ -303,7 +304,7 @@ tree = window_list.tree = gnt_tree_new(); - for (iter = g_list_first(focus_list); iter; iter = iter->next) + for (iter = focus_list; iter; iter = iter->next) { GntBox *box = GNT_BOX(iter->data); @@ -312,7 +313,7 @@ update_window_in_list(GNT_WIDGET(box)); } - gnt_tree_set_selected(GNT_TREE(tree), focus_list->data); + gnt_tree_set_selected(GNT_TREE(tree), ordered->data); gnt_box_add_widget(GNT_BOX(win), tree); gnt_tree_set_col_width(GNT_TREE(tree), 0, getmaxx(stdscr) / 3); @@ -329,7 +330,7 @@ static void shift_window(GntWidget *widget, int dir) { - GList *all = g_list_first(focus_list); + GList *all = focus_list; GList *list = g_list_find(all, widget); int length, pos; if (!list) @@ -349,8 +350,7 @@ all = g_list_insert(all, widget, pos); all = g_list_delete_link(all, list); - if (focus_list == list) - focus_list = g_list_find(all, widget); + focus_list = all; draw_taskbar(FALSE); } @@ -522,14 +522,26 @@ if (strncmp(buffer, "[M ", 3) == 0) { /* left button down */ - /* If you clicked on the top-bar of the active window, then you can move it by dragging it */ - if (focus_list) { - GntWidget *wid = focus_list->data; - if (x >= wid->priv.x && x < wid->priv.x + wid->priv.width && - y == wid->priv.y) { - offset = x - wid->priv.x; - remember = wid; - button = MOUSE_LEFT; + /* Bring the window you clicked on to front */ + /* If you click on the topbar, then you can drag to move the window */ + GList *iter; + for (iter = ordered; iter; iter = iter->next) { + GntWidget *wid = iter->data; + if (x >= wid->priv.x && x < wid->priv.x + wid->priv.width) { + if (y >= wid->priv.y && y < wid->priv.y + wid->priv.height) { + if (iter != ordered) { + GntWidget *w = ordered->data; + ordered = g_list_bring_to_front(ordered, iter->data); + bring_on_top(ordered->data); + gnt_widget_set_focus(w, FALSE); + } + if (y == wid->priv.y) { + offset = x - wid->priv.x; + remember = wid; + button = MOUSE_LEFT; + } + break; + } } } } else if (strncmp(buffer, "[M\"", 3) == 0) { @@ -543,7 +555,7 @@ } else if (strncmp(buffer, "[M#", 3) == 0) { /* button up */ if (button == MOUSE_NONE && y == getmaxy(stdscr) - 1) { - int n = g_list_length(g_list_first(focus_list)); + int n = g_list_length(focus_list); if (n) { int width = getmaxx(stdscr) / n; switch_window_n(x / width); @@ -599,9 +611,9 @@ if (mode == GNT_KP_MODE_NORMAL) { - if (focus_list) + if (ordered) { - ret = gnt_widget_key_pressed(focus_list->data, buffer); + ret = gnt_widget_key_pressed(ordered->data, buffer); } if (!ret) @@ -614,9 +626,9 @@ else if (strcmp(buffer + 1, "c") == 0) { /* Alt + c was pressed. I am going to use it to close a window. */ - if (focus_list) + if (ordered) { - gnt_widget_destroy(focus_list->data); + gnt_widget_destroy(ordered->data); } } else if (strcmp(buffer + 1, "q") == 0) @@ -653,11 +665,11 @@ else if (strcmp(buffer + 1, ",") == 0 && focus_list) { /* Re-order the list of windows */ - shift_window(focus_list->data, -1); + shift_window(ordered->data, -1); } else if (strcmp(buffer + 1, ".") == 0 && focus_list) { - shift_window(focus_list->data, 1); + shift_window(ordered->data, 1); } else if (strcmp(buffer + 1, "l") == 0) { @@ -681,7 +693,7 @@ { gboolean changed = FALSE; int x, y, w, h; - GntWidget *widget = GNT_WIDGET(focus_list->data); + GntWidget *widget = GNT_WIDGET(ordered->data); gnt_widget_get_position(widget, &x, &y); gnt_widget_get_size(widget, &w, &h); @@ -755,7 +767,7 @@ mode = GNT_KP_MODE_NORMAL; else if (buffer[0] == 27) { - GntWidget *widget = focus_list->data; + GntWidget *widget = ordered->data; gboolean changed = FALSE; int width, height; @@ -885,9 +897,9 @@ wbkgdset(stdscr, '\0' | COLOR_PAIR(GNT_COLOR_NORMAL)); refresh(); -#ifdef NCURSES_BUTTON_PRESSEDaa +#ifdef ALL_MOUSE_EVENTS if ((mouse_enabled = gnt_style_get_bool(GNT_STYLE_MOUSE, FALSE))) - mousemask(NCURSES_BUTTON_PRESSED | NCURSES_BUTTON_RELEASED | REPORT_MOUSE_POSITION, NULL); + mousemask(ALL_MOUSE_EVENTS | REPORT_MOUSE_POSITION, NULL); #endif wbkgdset(stdscr, '\0' | COLOR_PAIR(GNT_COLOR_NORMAL)); @@ -1014,7 +1026,7 @@ if (widget == window_list.window) return TRUE; - if (focus_list && focus_list->data == widget) + if (ordered && ordered->data == widget) { if (GNT_IS_BOX(widget) && (GNT_BOX(widget)->active == w || widget == w)) @@ -1029,7 +1041,7 @@ while (widget->parent) widget = widget->parent; - if (focus_list && focus_list->data == widget) + if (ordered && ordered->data == widget) return; GNT_WIDGET_SET_FLAGS(widget, GNT_WIDGET_URGENT); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ma...@us...> - 2006-08-24 01:14:01
|
Revision: 17009 Author: marv_sf Date: 2006-08-23 18:13:57 -0700 (Wed, 23 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=17009&view=rev Log Message: ----------- don't crash when we're set idle but not logged in. Modified Paths: -------------- trunk/libgaim/protocols/yahoo/yahoo.c Modified: trunk/libgaim/protocols/yahoo/yahoo.c =================================================================== --- trunk/libgaim/protocols/yahoo/yahoo.c 2006-08-23 21:34:43 UTC (rev 17008) +++ trunk/libgaim/protocols/yahoo/yahoo.c 2006-08-24 01:13:57 UTC (rev 17009) @@ -3349,6 +3349,9 @@ char *msg = NULL, *msg2 = NULL; GaimStatus *status = NULL; + if (!yd) + return; + if (idle && yd->current_status != YAHOO_STATUS_CUSTOM) yd->current_status = YAHOO_STATUS_IDLE; else if (!idle && yd->current_status == YAHOO_STATUS_IDLE) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dat...@us...> - 2006-08-23 21:35:32
|
Revision: 17008 Author: datallah Date: 2006-08-23 14:34:43 -0700 (Wed, 23 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=17008&view=rev Log Message: ----------- Lee Roach revamped the win32 makefiles. This makes me happy, they were in dire need of some loving. This makes life a great deal easier for anyone who wants to build out-of-tree plugins. Modified Paths: -------------- trunk/Makefile.mingw trunk/gtk/Makefile.mingw trunk/gtk/pixmaps/Makefile.mingw trunk/gtk/pixmaps/smileys/Makefile.mingw trunk/gtk/pixmaps/smileys/default/Makefile.mingw trunk/gtk/pixmaps/smileys/none/Makefile.mingw trunk/gtk/pixmaps/status/Makefile.mingw trunk/gtk/pixmaps/status/default/Makefile.mingw trunk/gtk/plugins/Makefile.mingw trunk/gtk/plugins/docklet/Makefile.mingw trunk/gtk/plugins/ticker/Makefile.mingw trunk/gtk/plugins/win32/transparency/Makefile.mingw trunk/gtk/plugins/win32/winprefs/Makefile.mingw trunk/gtk/win32/IdleTracker/Makefile.mingw trunk/libgaim/Makefile.mingw trunk/libgaim/plugins/Makefile.mingw trunk/libgaim/plugins/perl/Makefile.mingw trunk/libgaim/plugins/perl/common/Makefile.mingw trunk/libgaim/plugins/perl/common/module.h trunk/libgaim/plugins/ssl/Makefile.mingw trunk/libgaim/plugins/tcl/Makefile.mingw trunk/libgaim/protocols/Makefile.mingw trunk/libgaim/protocols/bonjour/Makefile.mingw trunk/libgaim/protocols/gg/Makefile.mingw trunk/libgaim/protocols/irc/Makefile.mingw trunk/libgaim/protocols/jabber/Makefile.mingw trunk/libgaim/protocols/msn/Makefile.mingw trunk/libgaim/protocols/novell/Makefile.mingw trunk/libgaim/protocols/oscar/Makefile.mingw trunk/libgaim/protocols/qq/Makefile.mingw trunk/libgaim/protocols/sametime/Makefile.mingw trunk/libgaim/protocols/silc/Makefile.mingw trunk/libgaim/protocols/simple/Makefile.mingw trunk/libgaim/protocols/toc/Makefile.mingw trunk/libgaim/protocols/yahoo/Makefile.mingw trunk/libgaim/protocols/zephyr/Makefile.mingw trunk/libgaim/win32/global.mak trunk/po/Makefile.mingw Added Paths: ----------- trunk/gtk/sounds/Makefile.mingw trunk/libgaim/win32/rules.mak trunk/libgaim/win32/targets.mak Modified: trunk/Makefile.mingw =================================================================== --- trunk/Makefile.mingw 2006-08-23 18:50:46 UTC (rev 17007) +++ trunk/Makefile.mingw 2006-08-23 21:34:43 UTC (rev 17008) @@ -5,44 +5,37 @@ # Description: Top Makefile for win32 (mingw) port of Gaim # -LIBGAIM_TOP = ./libgaim -GTKGAIM_TOP = ./gtk -GAIM_SOUNDS = ./sounds -GAIM_INSTALL_DIR = ./win32-install-dir -PO = ./po +GAIM_TOP := . +include $(GAIM_TOP)/libgaim/win32/global.mak -MAKENSIS := makensis.exe +all: $(GAIM_CONFIG_H) + $(MAKE) -C $(GAIM_LIB_TOP) -f $(GAIM_WIN32_MAKEFILE) + $(MAKE) -C $(GAIM_GTK_TOP) -f $(GAIM_WIN32_MAKEFILE) + $(MAKE) -C $(GAIM_PO_TOP) -f $(GAIM_WIN32_MAKEFILE) -VERSION := $(shell cat ./VERSION) +install: all $(GAIM_INSTALL_DIR) + $(MAKE) -C $(GAIM_LIB_TOP) -f $(GAIM_WIN32_MAKEFILE) install + $(MAKE) -C $(GAIM_GTK_TOP) -f $(GAIM_WIN32_MAKEFILE) install + $(MAKE) -C $(GAIM_PO_TOP) -f $(GAIM_WIN32_MAKEFILE) install +installer: install + $(MAKENSIS) /V3 /DGAIM_VERSION="$(GAIM_VERSION)" /DWITH_GTK gaim-installer.nsi -all: - cp config.h.mingw config.h - $(MAKE) -C $(LIBGAIM_TOP) -f Makefile.mingw - $(MAKE) -C $(GTKGAIM_TOP) -f Makefile.mingw +installer_nogtk: install + $(MAKENSIS) /V3 /DGAIM_VERSION="$(GAIM_VERSION)" gaim-installer.nsi -install: all - mkdir -p $(GAIM_INSTALL_DIR)/plugins - mkdir -p $(GAIM_INSTALL_DIR)/sounds/gaim - $(MAKE) -C $(PO) -f Makefile.mingw install - $(MAKE) -C $(LIBGAIM_TOP) -f Makefile.mingw install - $(MAKE) -C $(GTKGAIM_TOP) -f Makefile.mingw install +installer_debug: install + $(MAKENSIS) /V3 /DGAIM_VERSION="$(GAIM_VERSION)" /DDEBUG gaim-installer.nsi -installer: - $(MAKENSIS) /DGAIM_VERSION="$(VERSION)" /DWITH_GTK gaim-installer.nsi - -installer_nogtk: - $(MAKENSIS) /DGAIM_VERSION="$(VERSION)" gaim-installer.nsi - -installer_debug: - $(MAKENSIS) /DGAIM_VERSION="$(VERSION)" /DDEBUG gaim-installer.nsi - installers: installer installer_nogtk - clean: - $(MAKE) -C $(PO) -f Makefile.mingw clean - $(MAKE) -C $(LIBGAIM_TOP) -f Makefile.mingw clean - $(MAKE) -C $(GTKGAIM_TOP) -f Makefile.mingw clean - rm -rf config.h $(GAIM_INSTALL_DIR) + $(MAKE) -C $(GAIM_PO_TOP) -f $(GAIM_WIN32_MAKEFILE) clean + $(MAKE) -C $(GAIM_GTK_TOP) -f $(GAIM_WIN32_MAKEFILE) clean + $(MAKE) -C $(GAIM_LIB_TOP) -f $(GAIM_WIN32_MAKEFILE) clean + rm -rf $(GAIM_CONFIG_H) rm -rf gaim*.exe + rm -rf $(GAIM_INSTALL_PERLMOD_DIR) $(GAIM_INSTALL_PIXMAPS_DIR) $(GAIM_INSTALL_PLUGINS_DIR) + rm -rf $(GAIM_INSTALL_PO_DIR) $(GAIM_INSTALL_SOUNDS_DIR) $(GAIM_INSTALL_DIR) + +include $(GAIM_COMMON_TARGETS) Modified: trunk/gtk/Makefile.mingw =================================================================== --- trunk/gtk/Makefile.mingw 2006-08-23 18:50:46 UTC (rev 17007) +++ trunk/gtk/Makefile.mingw 2006-08-23 21:34:43 UTC (rev 17008) @@ -4,46 +4,17 @@ # Description: Makefile for win32 (mingw) version of Gaim # -# -# PATHS -# +GAIM_TOP := .. +include $(GAIM_TOP)/libgaim/win32/global.mak -GTK_TOP := ../../win32-dev/gtk_2_0 -GAIM_TOP := .. -GTKGAIM_TOP := . -LIBGAIM_TOP := $(GAIM_TOP)/libgaim -PLUGINS_TOP := $(GTKGAIM_TOP)/plugins -PIXMAPS_TOP := $(GTKGAIM_TOP)/pixmaps -SOUNDS_TOP := $(GTKGAIM_TOP)/sounds -ASPELL_TOP := ../../win32-dev/aspell-dev-0-50-3-3 -GTKSPELL_TOP := ../../win32-dev/gtkspell-2.0.6 -IDLETRACK_TOP := $(GTKGAIM_TOP)/win32/IdleTracker -GAIM_INSTALL_DIR := $(GAIM_TOP)/win32-install-dir -#LIBXML2_DIR := ../../win32-dev/libxml2 +NEEDED_DLLS = $(GTKSPELL_TOP)/gtkspell/libgtkspell.dll -NEEDED_DLLS = $(GTKSPELL_TOP)/gtkspell/libgtkspell.dll \ - $(IDLETRACK_TOP)/idletrack.dll - -SOUNDS = $(SOUNDS_TOP)/alert.wav \ - $(SOUNDS_TOP)/login.wav \ - $(SOUNDS_TOP)/logout.wav \ - $(SOUNDS_TOP)/receive.wav \ - $(SOUNDS_TOP)/send.wav - ## ## VARIABLE DEFINITIONS ## - EXE_TARGET = gaim - GTKGAIM_TARGET = gtkgaim -# Compiler and Linker Options - -CFLAGS = - -DEFINES = - ifeq ($(MAKECMDGOALS), $(EXE_TARGET)-portable.exe) DEFINES := $(DEFINES) -DPORTABLE endif @@ -54,33 +25,22 @@ LDFLAGS := $(WINAPP) -WINDRES := windres - ## -## INCLUDE MAKEFILES -## - -include $(LIBGAIM_TOP)/win32/global.mak - -## ## INCLUDE PATHS ## - LIBGAIM_INCLUDE_PATHS = \ - -I$(LIBGAIM_TOP) \ - -I$(LIBGAIM_TOP)/win32 \ + -I$(GAIM_LIB_TOP) \ + -I$(GAIM_LIB_TOP)/win32 \ -I$(GAIM_TOP) \ -I$(GTK_TOP)/include \ -I$(GTK_TOP)/include/glib-2.0 \ -I$(GTK_TOP)/lib/glib-2.0/include -# -I$(LIBXML2_DIR)/include - INCLUDE_PATHS = \ $(LIBGAIM_INCLUDE_PATHS) \ - -I$(IDLETRACK_TOP) \ - -I$(GTKGAIM_TOP) \ - -I$(GTKGAIM_TOP)/win32 \ + -I$(GAIM_GTK_IDLETRACK_TOP) \ + -I$(GAIM_GTK_TOP) \ + -I$(GAIM_GTK_TOP)/win32 \ -I$(GTK_TOP)/include/gtk-2.0 \ -I$(GTK_TOP)/include/pango-1.0 \ -I$(GTK_TOP)/include/atk-1.0 \ @@ -88,20 +48,15 @@ -I$(GTKSPELL_TOP) \ -I$(ASPELL_TOP)/include - - LIB_PATHS = -L$(GTK_TOP)/lib \ - -L$(LIBGAIM_TOP) \ - -L$(GTKGAIM_TOP) \ - -L$(IDLETRACK_TOP) \ + -L$(GAIM_LIB_TOP) \ + -L$(GAIM_GTK_TOP) \ + -L$(GAIM_GTK_IDLETRACK_TOP) \ -L$(ASPELL_TOP)/lib -# -L$(LIBXML2_DIR)/lib - ## ## SOURCES, OBJECTS ## - GTKGAIM_C_SRC = \ gaimstock.c \ gtkaccount.c \ @@ -140,18 +95,14 @@ win32/untar.c \ win32/wspell.c -RC_SRC = win32/gaimrc.rc - -EXE_C_SRC = win32/win_gaim.c - +RC_SRC = win32/gaimrc.rc +EXE_C_SRC = win32/win_gaim.c GTKGAIM_OBJECTS = $(GTKGAIM_C_SRC:%.c=%.o) - EXE_OBJECTS = $(EXE_C_SRC:%.c=%.o) $(RC_SRC:%.rc=%.o) ## ## LIBRARIES ## - LIBGAIM_LIBS = \ -lgaim \ -lglib-2.0 \ @@ -165,8 +116,6 @@ -liberty \ -lidletrack -# -lxml2 - GTKGAIM_LIBS = \ $(LIBGAIM_LIBS) \ -lgtk-win32-2.0 \ @@ -175,70 +124,49 @@ -lgdk-win32-2.0 \ -lgdk_pixbuf-2.0 -EXE_LIBS = +include $(GAIM_COMMON_RULES) ## -## RULES -## - -# How to make a C file -%.o: %.c - $(CC) $(CFLAGS) $(INCLUDE_PATHS) $(DEFINES) -c $< -o $@ - -# How to make an RC file -%.o: %.rc - $(WINDRES) -i $< -o $@ - -## ## TARGET DEFINITIONS ## - .PHONY: all clean all: $(EXE_TARGET).exe $(GTKGAIM_TARGET).dll - $(MAKE) -C $(PLUGINS_TOP) -f Makefile.mingw + $(MAKE) -C $(GAIM_GTK_PLUGINS_TOP) -f $(GAIM_WIN32_MAKEFILE) -install: all - $(MAKE) -C $(PLUGINS_TOP) -f Makefile.mingw install - $(MAKE) -C $(PIXMAPS_TOP) -f Makefile.mingw install - cp $(GTKGAIM_TOP)/$(EXE_TARGET).exe $(GTKGAIM_TOP)/$(GTKGAIM_TARGET).dll $(GAIM_INSTALL_DIR) +install: all $(GAIM_INSTALL_DIR) + $(MAKE) -C $(GAIM_GTK_PLUGINS_TOP) -f $(GAIM_WIN32_MAKEFILE) install + $(MAKE) -C $(GAIM_GTK_PIXMAPS_TOP) -f $(GAIM_WIN32_MAKEFILE) install + $(MAKE) -C $(GAIM_GTK_SOUNDS_TOP) -f $(GAIM_WIN32_MAKEFILE) install + $(MAKE) -C $(GAIM_GTK_IDLETRACK_TOP) -f $(GAIM_WIN32_MAKEFILE) install + cp $(EXE_TARGET).exe $(GTKGAIM_TARGET).dll $(GAIM_INSTALL_DIR) cp $(NEEDED_DLLS) $(GAIM_INSTALL_DIR) - cp $(SOUNDS) $(GAIM_INSTALL_DIR)/sounds/gaim -$(LIBGAIM_TOP)/libgaim.dll.a: - S(MAKE) -C $(LIBGAIM_TOP) -f Makefile.mingw libgaim.dll.a +$(GTKGAIM_OBJECTS): $(GAIM_CONFIG_H) -$(IDLETRACK_TOP)/idletrack.dll: - $(MAKE) -C $(IDLETRACK_TOP) -f Makefile.mingw - -# -# BUILD DLL -# -$(GTKGAIM_TARGET).dll.a $(GTKGAIM_TARGET).dll: $(LIBGAIM_TOP)/libgaim.dll.a $(GTKGAIM_OBJECTS) $(IDLETRACK_TOP)/idletrack.dll +$(GTKGAIM_TARGET).dll $(GTKGAIM_TARGET).dll.a: $(GAIM_LIBGAIM_DLL).a $(GAIM_IDLETRACK_DLL).a $(GTKGAIM_OBJECTS) $(CC) -shared $(LIBGAIM_OBJECTS) $(GTKGAIM_OBJECTS) $(LIB_PATHS) $(GTKGAIM_LIBS) $(DLL_LD_FLAGS) -Wl,--out-implib,$(GTKGAIM_TARGET).dll.a -o $(GTKGAIM_TARGET).dll -# -# BUILD EXE -# - -$(EXE_TARGET).exe: $(GTKGAIM_TARGET).dll $(EXE_OBJECTS) +$(EXE_TARGET).exe: $(GAIM_CONFIG_H) $(GAIM_GTKGAIM_DLL).a $(GAIM_IDLETRACK_DLL).a $(EXE_OBJECTS) $(CC) $(LDFLAGS) $(EXE_OBJECTS) $(LIB_PATHS) $(EXE_LIBS) -o $(EXE_TARGET).exe -$(EXE_TARGET)-portable.exe: clean_exe $(EXE_OBJECTS) +$(EXE_TARGET)-portable.exe: clean_exe $(GAIM_CONFIG_H) $(GAIM_GTKGAIM_DLL).a $(GAIM_IDLETRACK_DLL).a $(EXE_OBJECTS) $(CC) $(LDFLAGS) $(EXE_OBJECTS) $(LIB_PATHS) $(EXE_LIBS) -o $(EXE_TARGET)-portable.exe rm win_gaim.o ## ## CLEAN RULES ## - clean: - $(MAKE) -C $(IDLETRACK_TOP) -f Makefile.mingw clean - rm -rf *.o ./win32/*.o - rm -rf $(GTKGAIM_TARGET).dll - rm -rf $(GTKGAIM_TARGET).dll.a - rm -rf $(EXE_TARGET).exe - $(MAKE) -C $(PLUGINS_TOP) -f Makefile.mingw clean + $(MAKE) -C $(GAIM_GTK_IDLETRACK_TOP) -f $(GAIM_WIN32_MAKEFILE) clean + $(MAKE) -C $(GAIM_GTK_PLUGINS_TOP) -f $(GAIM_WIN32_MAKEFILE) clean + rm -rf $(GTKGAIM_OBJECTS) $(EXE_OBJECTS) + rm $(GTKGAIM_TARGET).dll + rm $(GTKGAIM_TARGET).dll.a + rm $(EXE_TARGET).exe + rm $(EXE_TARGET)-portable.exe clean_exe: - rm -rf win_gaim.o + rm win_gaim.o + +include $(GAIM_COMMON_TARGETS) Modified: trunk/gtk/pixmaps/Makefile.mingw =================================================================== --- trunk/gtk/pixmaps/Makefile.mingw 2006-08-23 18:50:46 UTC (rev 17007) +++ trunk/gtk/pixmaps/Makefile.mingw 2006-08-23 21:34:43 UTC (rev 17008) @@ -5,9 +5,9 @@ # GAIM_TOP := ../.. +include $(GAIM_TOP)/libgaim/win32/global.mak -datadir = $(GAIM_TOP)/win32-install-dir - +datadir = $(GAIM_INSTALL_DIR) include ./Makefile.am install: Modified: trunk/gtk/pixmaps/smileys/Makefile.mingw =================================================================== --- trunk/gtk/pixmaps/smileys/Makefile.mingw 2006-08-23 18:50:46 UTC (rev 17007) +++ trunk/gtk/pixmaps/smileys/Makefile.mingw 2006-08-23 21:34:43 UTC (rev 17008) @@ -4,10 +4,6 @@ # Description: Makefile for win32 (mingw) version of Gaim pixmaps # -GAIM_TOP = ../../.. - -INSTALL_DIR = $(GAIM_TOP)/win32-install-dir/pixmaps/gaim/smileys - include ./Makefile.am install: Modified: trunk/gtk/pixmaps/smileys/default/Makefile.mingw =================================================================== --- trunk/gtk/pixmaps/smileys/default/Makefile.mingw 2006-08-23 18:50:46 UTC (rev 17007) +++ trunk/gtk/pixmaps/smileys/default/Makefile.mingw 2006-08-23 21:34:43 UTC (rev 17008) @@ -4,9 +4,10 @@ # Description: Makefile for win32 (mingw) version of Gaim pixmaps # -GAIM_TOP = ../../../.. +GAIM_TOP := ../../../.. +include $(GAIM_TOP)/libgaim/win32/global.mak -datadir = $(GAIM_TOP)/win32-install-dir +datadir = $(GAIM_INSTALL_DIR) include ./Makefile.am install: Modified: trunk/gtk/pixmaps/smileys/none/Makefile.mingw =================================================================== --- trunk/gtk/pixmaps/smileys/none/Makefile.mingw 2006-08-23 18:50:46 UTC (rev 17007) +++ trunk/gtk/pixmaps/smileys/none/Makefile.mingw 2006-08-23 21:34:43 UTC (rev 17008) @@ -4,9 +4,10 @@ # Description: Makefile for win32 (mingw) version of Gaim pixmaps # -GAIM_TOP = ../../../.. +GAIM_TOP := ../../../.. +include $(GAIM_TOP)/libgaim/win32/global.mak -datadir = $(GAIM_TOP)/win32-install-dir +datadir = $(GAIM_INSTALL_DIR) include ./Makefile.am install: Modified: trunk/gtk/pixmaps/status/Makefile.mingw =================================================================== --- trunk/gtk/pixmaps/status/Makefile.mingw 2006-08-23 18:50:46 UTC (rev 17007) +++ trunk/gtk/pixmaps/status/Makefile.mingw 2006-08-23 21:34:43 UTC (rev 17008) @@ -4,10 +4,6 @@ # Description: Makefile for win32 (mingw) version of Gaim pixmaps # -GAIM_TOP = ../../.. - -INSTALL_DIR = $(GAIM_TOP)/win32-install-dir/pixmaps/gaim/status - include ./Makefile.am install: Modified: trunk/gtk/pixmaps/status/default/Makefile.mingw =================================================================== --- trunk/gtk/pixmaps/status/default/Makefile.mingw 2006-08-23 18:50:46 UTC (rev 17007) +++ trunk/gtk/pixmaps/status/default/Makefile.mingw 2006-08-23 21:34:43 UTC (rev 17008) @@ -5,8 +5,9 @@ # GAIM_TOP = ../../../.. +include $(GAIM_TOP)/libgaim/win32/global.mak -datadir = $(GAIM_TOP)/win32-install-dir +datadir = $(GAIM_INSTALL_DIR) include ./Makefile.am install: Modified: trunk/gtk/plugins/Makefile.mingw =================================================================== --- trunk/gtk/plugins/Makefile.mingw 2006-08-23 18:50:46 UTC (rev 17007) +++ trunk/gtk/plugins/Makefile.mingw 2006-08-23 21:34:43 UTC (rev 17008) @@ -4,46 +4,20 @@ # Description: Makefile for win32 (mingw) version of Gaim Plugins # -# -# PATHS -# +GAIM_TOP := ../.. +include $(GAIM_TOP)/libgaim/win32/global.mak -GAIM_PLUGINS := . -GAIM_TOP := ../.. -GTKGAIM_TOP := .. -LIBGAIM_TOP := $(GAIM_TOP)/libgaim -GTK_TOP := ../../../win32-dev/gtk_2_0 -#OSCAR_ROOT := ../src/protocols/oscar -GAIM_INSTALL_DIR := $(GAIM_TOP)/win32-install-dir -TICKER := ./ticker -TRANSPARENCY := ./win32/transparency -WINPREFS := ./win32/winprefs -#PERL_PLUGIN_LOADER := ./perl -DOCKLET := ./docklet +DOCKLET_PLUGIN := $(GAIM_GTK_PLUGINS_TOP)/docklet +TICKER_PLUGIN := $(GAIM_GTK_PLUGINS_TOP)/ticker +TRANSPARENCY_PLUGIN := $(GAIM_GTK_PLUGINS_TOP)/win32/transparency +WINPREFS_PLUGIN := $(GAIM_GTK_PLUGINS_TOP)/win32/winprefs -## -## VARIABLE DEFINITIONS -## - -# Compiler Options - -CFLAGS = - -DEFINES = - .SUFFIXES: .SUFFIXES: .c .dll ## -## INCLUDE MAKEFILES -## - -include $(LIBGAIM_TOP)/win32/global.mak - -## ## INCLUDE PATHS ## - INCLUDE_PATHS += \ -I$(GTK_TOP)/include \ -I$(GTK_TOP)/include/gtk-2.0 \ @@ -53,21 +27,18 @@ -I$(GTK_TOP)/lib/glib-2.0/include \ -I$(GTK_TOP)/lib/gtk-2.0/include \ -I$(GAIM_TOP) \ - -I$(LIBGAIM_TOP) \ - -I$(LIBGAIM_TOP)/win32 \ - -I$(GTKGAIM_TOP) \ - -I$(GTKGAIM_TOP)/win32 + -I$(GAIM_LIB_TOP) \ + -I$(GAIM_LIB_TOP)/win32 \ + -I$(GAIM_GTK_TOP) \ + -I$(GAIM_GTK_TOP)/win32 - LIB_PATHS = -L$(GTK_TOP)/lib \ - -L$(LIBGAIM_TOP) \ - -L$(GTKGAIM_TOP) + -L$(GAIM_LIB_TOP) \ + -L$(GAIM_GTK_TOP) - ## ## LIBRARIES ## - LIBS = -lgtk-win32-2.0 \ -lglib-2.0 \ -lgdk-win32-2.0 \ @@ -81,32 +52,23 @@ -lgtkgaim ## -## RULES -## - -## ## TARGET DEFINITIONS ## - .PHONY: all clean all: plugins - $(MAKE) -C $(TICKER) -f Makefile.mingw - $(MAKE) -C $(WINPREFS) -f Makefile.mingw - $(MAKE) -C $(TRANSPARENCY) -f Makefile.mingw - $(MAKE) -C $(DOCKLET) -f Makefile.mingw + $(MAKE) -C $(DOCKLET_PLUGIN) -f $(GAIM_WIN32_MAKEFILE) + $(MAKE) -C $(TICKER_PLUGIN) -f $(GAIM_WIN32_MAKEFILE) + $(MAKE) -C $(TRANSPARENCY_PLUGIN) -f $(GAIM_WIN32_MAKEFILE) + $(MAKE) -C $(WINPREFS_PLUGIN) -f $(GAIM_WIN32_MAKEFILE) -install: - cp $(GAIM_PLUGINS)/*.dll $(GAIM_INSTALL_DIR)/plugins - $(MAKE) -C $(TICKER) -f Makefile.mingw install - $(MAKE) -C $(WINPREFS) -f Makefile.mingw install - $(MAKE) -C $(TRANSPARENCY) -f Makefile.mingw install - $(MAKE) -C $(DOCKLET) -f Makefile.mingw install +install: $(GAIM_INSTALL_PLUGINS_DIR) + $(MAKE) -C $(DOCKLET_PLUGIN) -f $(GAIM_WIN32_MAKEFILE) install + $(MAKE) -C $(TICKER_PLUGIN) -f $(GAIM_WIN32_MAKEFILE) install + $(MAKE) -C $(TRANSPARENCY_PLUGIN) -f $(GAIM_WIN32_MAKEFILE) install + $(MAKE) -C $(WINPREFS_PLUGIN) -f $(GAIM_WIN32_MAKEFILE) install + cp $(GAIM_GTK_PLUGINS_TOP)/*.dll $(GAIM_INSTALL_PLUGINS_DIR) -# -# BUILD Plugin -# - .c.dll: $(CC) $(CFLAGS) $(DEFINES) $(INCLUDE_PATHS) -o $@.o -c $< $(CC) -shared $@.o $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -o $@ @@ -115,22 +77,22 @@ extplacement.dll \ gaimrc.dll \ history.dll \ - iconaway.dll \ + iconaway.dll \ notify.dll \ relnot.dll \ spellchk.dll \ timestamp_format.dll \ timestamp.dll - ## ## CLEAN RULES ## - clean: - rm -rf *.o - rm -rf *.dll - $(MAKE) -C $(TICKER) -f Makefile.mingw clean - $(MAKE) -C $(TRANSPARENCY) -f Makefile.mingw clean - $(MAKE) -C $(WINPREFS) -f Makefile.mingw clean - $(MAKE) -C $(DOCKLET) -f Makefile.mingw clean + rm -rf $(GAIM_GTK_PLUGINS_TOP)/*.o + rm -rf $(GAIM_GTK_PLUGINS_TOP)/*.dll + $(MAKE) -C $(DOCKLET_PLUGIN) -f $(GAIM_WIN32_MAKEFILE) clean + $(MAKE) -C $(TICKER_PLUGIN) -f $(GAIM_WIN32_MAKEFILE) clean + $(MAKE) -C $(TRANSPARENCY_PLUGIN) -f $(GAIM_WIN32_MAKEFILE) clean + $(MAKE) -C $(WINPREFS_PLUGIN) -f $(GAIM_WIN32_MAKEFILE) clean + +include $(GAIM_COMMON_TARGETS) Modified: trunk/gtk/plugins/docklet/Makefile.mingw =================================================================== --- trunk/gtk/plugins/docklet/Makefile.mingw 2006-08-23 18:50:46 UTC (rev 17007) +++ trunk/gtk/plugins/docklet/Makefile.mingw 2006-08-23 21:34:43 UTC (rev 17008) @@ -4,39 +4,14 @@ # Description: Makefile for docklet plugin. # -# -# PATHS -# +GAIM_TOP := ../../.. +include $(GAIM_TOP)/libgaim/win32/global.mak -GTK_TOP := ../../../../win32-dev/gtk_2_0 -GAIM_TOP := ../../.. -LIBGAIM_TOP := $(GAIM_TOP)/libgaim -GTKGAIM_TOP := $(GAIM_TOP)/gtk -GAIM_INSTALL_DIR := $(GAIM_TOP)/win32-install-dir -DLL_INSTALL_DIR := $(GAIM_INSTALL_DIR)/plugins - -## -## VARIABLE DEFINITIONS -## - TARGET = docklet -# Compiler Options - -CFLAGS = - -DEFINES = - ## -## INCLUDE MAKEFILES -## - -include $(LIBGAIM_TOP)/win32/global.mak - -## ## INCLUDE PATHS ## - INCLUDE_PATHS += -I. \ -I$(GTK_TOP)/include \ -I$(GTK_TOP)/include/gtk-2.0 \ @@ -45,34 +20,28 @@ -I$(GTK_TOP)/include/atk-1.0 \ -I$(GTK_TOP)/lib/glib-2.0/include \ -I$(GTK_TOP)/lib/gtk-2.0/include \ - -I$(LIBGAIM_TOP) \ - -I$(LIBGAIM_TOP)/win32 \ - -I$(GTKGAIM_TOP) \ - -I$(GTKGAIM_TOP)/win32 \ + -I$(GAIM_LIB_TOP) \ + -I$(GAIM_LIB_TOP)/win32 \ + -I$(GAIM_GTK_TOP) \ + -I$(GAIM_GTK_TOP)/win32 \ -I$(GAIM_TOP) - LIB_PATHS = -L$(GTK_TOP)/lib \ - -L$(LIBGAIM_TOP) \ - -L$(GTKGAIM_TOP) + -L$(GAIM_LIB_TOP) \ + -L$(GAIM_GTK_TOP) - ## ## SOURCES, OBJECTS ## - C_SRC = docklet.c \ docklet-win32.c \ MinimizeToTray.c - OBJECTS = $(C_SRC:%.c=%.o) - ## ## LIBRARIES ## - LIBS = -lgtk-win32-2.0 \ -lglib-2.0 \ -lgdk-win32-2.0 \ @@ -81,47 +50,28 @@ -lgaim \ -lgtkgaim +include $(GAIM_COMMON_RULES) ## -## RULES -## - -# How to make a C file - -%.o: %.c - $(CC) $(CFLAGS) $(DEFINES) $(INCLUDE_PATHS) -o $@ -c $< - -## ## TARGET DEFINITIONS ## - .PHONY: all clean all: $(TARGET).dll -install: all - cp $(TARGET).dll $(DLL_INSTALL_DIR) +install: all $(GAIM_INSTALL_PLUGINS_DIR) + cp $(TARGET).dll $(GAIM_INSTALL_PLUGINS_DIR) +$(OBJECTS): $(GAIM_CONFIG_H) -## -## BUILD Dependencies -## - -$(GTKGAIM_TOP)/gtkgaim.dll.a: - $(MAKE) -C $(GTKGAIM_TOP) -f Makefile.mingw gtkgaim.dll.a - - -## -## BUILD DLL -## - -$(TARGET).dll: $(OBJECTS) $(GTKGAIM_TOP)/gtkgaim.dll.a +$(TARGET).dll: $(GAIM_LIBGAIM_DLL).a $(GAIM_GTKGAIM_DLL).a $(OBJECTS) $(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -o $(TARGET).dll ## ## CLEAN RULES ## - clean: - rm -rf *.o + rm -rf $(OBJECTS) rm -rf $(TARGET).dll + +include $(GAIM_COMMON_TARGETS) Modified: trunk/gtk/plugins/ticker/Makefile.mingw =================================================================== --- trunk/gtk/plugins/ticker/Makefile.mingw 2006-08-23 18:50:46 UTC (rev 17007) +++ trunk/gtk/plugins/ticker/Makefile.mingw 2006-08-23 21:34:43 UTC (rev 17008) @@ -4,42 +4,15 @@ # Description: Makefile for ticker plugin. # -# -# PATHS -# +GAIM_TOP := ../../.. +include $(GAIM_TOP)/libgaim/win32/global.mak -GTK_TOP := ../../../../win32-dev/gtk_2_0 -GAIM_TOP := ../../.. -GTKGAIM_TOP := $(GAIM_TOP)/gtk -LIBGAIM_TOP := $(GAIM_TOP)/libgaim -TICKER_ROOT := . -GAIM_INSTALL_DIR := $(GAIM_TOP)/win32-install-dir -DLL_INSTALL_DIR := $(GAIM_INSTALL_DIR)/plugins - -## -## VARIABLE DEFINITIONS -## - TARGET = ticker -# Compiler Options - -CFLAGS = - -DEFINES = - - ## -## INCLUDE MAKEFILES -## - -include $(LIBGAIM_TOP)/win32/global.mak - -## ## INCLUDE PATHS ## - -INCLUDE_PATHS += -I$(TICKER_ROOT) \ +INCLUDE_PATHS += -I. \ -I$(GTK_TOP)/include \ -I$(GTK_TOP)/include/gtk-2.0 \ -I$(GTK_TOP)/include/glib-2.0 \ @@ -47,33 +20,27 @@ -I$(GTK_TOP)/include/atk-1.0 \ -I$(GTK_TOP)/lib/glib-2.0/include \ -I$(GTK_TOP)/lib/gtk-2.0/include \ - -I$(LIBGAIM_TOP) \ - -I$(LIBGAIM_TOP)/win32 \ - -I$(GTKGAIM_TOP) \ - -I$(GTKGAIM_TOP)/win32 \ + -I$(GAIM_LIB_TOP) \ + -I$(GAIM_LIB_TOP)/win32 \ + -I$(GAIM_GTK_TOP) \ + -I$(GAIM_GTK_TOP)/win32 \ -I$(GAIM_TOP) - LIB_PATHS = -L$(GTK_TOP)/lib \ - -L$(LIBGAIM_TOP) \ - -L$(GTKGAIM_TOP) + -L$(GAIM_LIB_TOP) \ + -L$(GAIM_GTK_TOP) - ## ## SOURCES, OBJECTS ## - C_SRC = ticker.c \ gtkticker.c - OBJECTS = $(C_SRC:%.c=%.o) - ## ## LIBRARIES ## - LIBS = -lgtk-win32-2.0 \ -lglib-2.0 \ -lgdk-win32-2.0 \ @@ -83,45 +50,28 @@ -lgaim \ -lgtkgaim -## -## RULES -## +include $(GAIM_COMMON_RULES) -# How to make a C file - -%.o: %.c - $(CC) $(CFLAGS) $(DEFINES) $(INCLUDE_PATHS) -o $@ -c $< - ## ## TARGET DEFINITIONS ## - .PHONY: all clean all: $(TARGET).dll -install: - cp $(TICKER_ROOT)/$(TARGET).dll $(DLL_INSTALL_DIR) +install: $(GAIM_INSTALL_PLUGINS_DIR) + cp $(TARGET).dll $(GAIM_INSTALL_PLUGINS_DIR) +$(OBJECTS): $(GAIM_CONFIG_H) -## -## BUILD Dependencies -## - -$(GTKGAIM_TOP)/gtkgaim.dll.a: - $(MAKE) -C $(GTKGAIM_TOP) -f Makefile.mingw gtkgaim.dll.a - -## -## BUILD DLL -## - -$(TARGET).dll: $(OBJECTS) $(GTKGAIM_TOP)/gtkgaim.dll.a +$(TARGET).dll: $(GAIM_LIBGAIM_DLL).a $(GAIM_GTKGAIM_DLL).a $(OBJECTS) $(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -o $(TARGET).dll ## ## CLEAN RULES ## - clean: - rm -rf *.o + rm -rf $(OBJECTS) rm -rf $(TARGET).dll + +include $(GAIM_COMMON_TARGETS) Modified: trunk/gtk/plugins/win32/transparency/Makefile.mingw =================================================================== --- trunk/gtk/plugins/win32/transparency/Makefile.mingw 2006-08-23 18:50:46 UTC (rev 17007) +++ trunk/gtk/plugins/win32/transparency/Makefile.mingw 2006-08-23 21:34:43 UTC (rev 17008) @@ -4,40 +4,15 @@ # Description: Makefile for win32trans plugin. # -# -# PATHS -# +GAIM_TOP := ../../../.. +include $(GAIM_TOP)/libgaim/win32/global.mak -GTK_TOP := ../../../../../win32-dev/gtk_2_0 -GAIM_TOP := ../../../.. -LIBGAIM_TOP := ../../../../libgaim -GTKGAIM_TOP := ../../../../gtk -GAIM_INSTALL_DIR := $(GAIM_TOP)/win32-install-dir -DLL_INSTALL_DIR := $(GAIM_INSTALL_DIR)/plugins - -## -## VARIABLE DEFINITIONS -## - TARGET = win2ktrans +DEFINES += -D_WIN32_WINNT=0x0500 -# Compiler Options - -CFLAGS = - -# This plugin requires W2K+ API -DEFINES = -D_WIN32_WINNT=0x0500 - ## -## INCLUDE MAKEFILES -## - -include $(LIBGAIM_TOP)/win32/global.mak - -## ## INCLUDE PATHS ## - INCLUDE_PATHS += -I. \ -I$(GTK_TOP)/include \ -I$(GTK_TOP)/include/gtk-2.0 \ @@ -46,32 +21,26 @@ -I$(GTK_TOP)/include/atk-1.0 \ -I$(GTK_TOP)/lib/glib-2.0/include \ -I$(GTK_TOP)/lib/gtk-2.0/include \ - -I$(LIBGAIM_TOP) \ - -I$(LIBGAIM_TOP)/win32 \ - -I$(GTKGAIM_TOP) \ - -I$(GTKGAIM_TOP)/win32 \ + -I$(GAIM_LIB_TOP) \ + -I$(GAIM_LIB_TOP)/win32 \ + -I$(GAIM_GTK_TOP) \ + -I$(GAIM_GTK_TOP)/win32 \ -I$(GAIM_TOP) - LIB_PATHS = -L$(GTK_TOP)/lib \ - -L$(LIBGAIM_TOP) \ - -L$(GTKGAIM_TOP) + -L$(GAIM_LIB_TOP) \ + -L$(GAIM_GTK_TOP) - ## ## SOURCES, OBJECTS ## - C_SRC = win2ktrans.c - OBJECTS = $(C_SRC:%.c=%.o) - ## ## LIBRARIES ## - LIBS = -lgtk-win32-2.0 \ -lglib-2.0 \ -lgdk-win32-2.0 \ @@ -81,46 +50,26 @@ -lgtkgaim \ -lgaim +include $(GAIM_COMMON_RULES) ## -## RULES -## - -# How to make a C file - -%.o: %.c - $(CC) $(CFLAGS) $(DEFINES) $(INCLUDE_PATHS) -o $@ -c $< - -## ## TARGET DEFINITIONS ## - .PHONY: all clean all: $(TARGET).dll -install: all - cp $(TARGET).dll $(DLL_INSTALL_DIR) +install: all $(GAIM_INSTALL_PLUGINS_DIR) + cp $(TARGET).dll $(GAIM_INSTALL_PLUGINS_DIR) - -## -## BUILD Dependencies -## - -$(GTKGAIM_TOP)/gtkgaim.dll.a: - $(MAKE) -C $(GTKGAIM_TOP) -f Makefile.mingw gtkgaim.dll.a - -## -## BUILD DLL -## - -$(TARGET).dll: $(OBJECTS) $(GTKGAIM_TOP)/gtkgaim.dll.a +$(TARGET).dll: $(GAIM_LIBGAIM_DLL).a $(GAIM_GTKGAIM_DLL).a $(OBJECTS) $(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -o $(TARGET).dll ## ## CLEAN RULES ## - clean: - rm -rf *.o + rm -rf $(OBJECTS) rm -rf $(TARGET).dll + +include $(GAIM_COMMON_TARGETS) Modified: trunk/gtk/plugins/win32/winprefs/Makefile.mingw =================================================================== --- trunk/gtk/plugins/win32/winprefs/Makefile.mingw 2006-08-23 18:50:46 UTC (rev 17007) +++ trunk/gtk/plugins/win32/winprefs/Makefile.mingw 2006-08-23 21:34:43 UTC (rev 17008) @@ -4,39 +4,15 @@ # Description: Makefile for winprefs plugin. # -# -# PATHS -# +GAIM_TOP := ../../../.. +include $(GAIM_TOP)/libgaim/win32/global.mak -GTK_TOP := ../../../../../win32-dev/gtk_2_0 -GAIM_TOP := ../../../.. -LIBGAIM_TOP := $(GAIM_TOP)/libgaim -GTKGAIM_TOP := $(GAIM_TOP)/gtk -GAIM_INSTALL_DIR := $(GAIM_TOP)/win32-install-dir -DLL_INSTALL_DIR := $(GAIM_INSTALL_DIR)/plugins - -## -## VARIABLE DEFINITIONS -## - TARGET = winprefs +DEFINES += -DWINVER=0x500 -# Compiler Options - -CFLAGS = - -DEFINES = -DWINVER=0x500 - ## -## INCLUDE MAKEFILES -## - -include $(LIBGAIM_TOP)/win32/global.mak - -## ## INCLUDE PATHS ## - INCLUDE_PATHS += -I. \ -I$(GTK_TOP)/include \ -I$(GTK_TOP)/include/gtk-2.0 \ @@ -45,33 +21,27 @@ -I$(GTK_TOP)/include/atk-1.0 \ -I$(GTK_TOP)/lib/glib-2.0/include \ -I$(GTK_TOP)/lib/gtk-2.0/include \ - -I$(LIBGAIM_TOP) \ - -I$(LIBGAIM_TOP)/win32 \ - -I$(GTKGAIM_TOP) \ - -I$(GTKGAIM_TOP)/win32 \ + -I$(GAIM_LIB_TOP) \ + -I$(GAIM_LIB_TOP)/win32 \ + -I$(GAIM_GTK_TOP) \ + -I$(GAIM_GTK_TOP)/win32 \ -I$(GAIM_TOP) - LIB_PATHS = -L$(GTK_TOP)/lib \ - -L$(LIBGAIM_TOP) \ - -L$(GTKGAIM_TOP) + -L$(GAIM_LIB_TOP) \ + -L$(GAIM_GTK_TOP) - ## ## SOURCES, OBJECTS ## - C_SRC = winprefs.c \ gtkappbar.c - OBJECTS = $(C_SRC:%.c=%.o) - ## ## LIBRARIES ## - LIBS = -lgtk-win32-2.0 \ -lglib-2.0 \ -lgdk-win32-2.0 \ @@ -82,46 +52,29 @@ -lgaim \ -lgtkgaim +include $(GAIM_COMMON_RULES) ## -## RULES -## - -# How to make a C file - -%.o: %.c - $(CC) $(CFLAGS) $(DEFINES) $(INCLUDE_PATHS) -o $@ -c $< - -## ## TARGET DEFINITIONS ## - .PHONY: all clean all: $(TARGET).dll -install: $(TARGET).dll - cp $(TARGET).dll $(DLL_INSTALL_DIR) +install: $(TARGET).dll $(GAIM_INSTALL_PLUGINS_DIR) + cp $(TARGET).dll $(GAIM_INSTALL_PLUGINS_DIR) - ## -## BUILD Dependencies -## - -$(GTKGAIM_TOP)/gtkgaim.dll.a: - $(MAKE) -C $(GTKGAIM_TOP) -f Makefile.mingw gtkgaim.dll.a - -## ## BUILD DLL ## - -$(TARGET).dll: $(OBJECTS) $(GTKGAIM_TOP)/gtkgaim.dll.a +$(TARGET).dll: $(GAIM_LIBGAIM_DLL).a $(GAIM_GTKGAIM_DLL).a $(OBJECTS) $(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -o $(TARGET).dll ## ## CLEAN RULES ## - clean: - rm -rf *.o + rm -rf $(OBJECTS) rm -rf $(TARGET).dll + +include $(GAIM_COMMON_TARGETS) Added: trunk/gtk/sounds/Makefile.mingw =================================================================== --- trunk/gtk/sounds/Makefile.mingw (rev 0) +++ trunk/gtk/sounds/Makefile.mingw 2006-08-23 21:34:43 UTC (rev 17008) @@ -0,0 +1,14 @@ +# +# Makefile.mingw +# +# Description: Makefile for win32 (mingw) version of Gaim +# + +GAIM_TOP := ../.. +include $(GAIM_TOP)/libgaim/win32/global.mak +include $(GAIM_GTK_SOUNDS_TOP)/Makefile.am + +install: $(GAIM_INSTALL_SOUNDS_DIR) + cp $(EXTRA_DIST) $(GAIM_INSTALL_SOUNDS_DIR) + +include $(GAIM_COMMON_TARGETS) Property changes on: trunk/gtk/sounds/Makefile.mingw ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Modified: trunk/gtk/win32/IdleTracker/Makefile.mingw =================================================================== --- trunk/gtk/win32/IdleTracker/Makefile.mingw 2006-08-23 18:50:46 UTC (rev 17007) +++ trunk/gtk/win32/IdleTracker/Makefile.mingw 2006-08-23 21:34:43 UTC (rev 17008) @@ -4,65 +4,22 @@ # Description: Makefile for idletrack # -# -# PATHS -# +GAIM_TOP := ../../.. +include $(GAIM_TOP)/libgaim/win32/global.mak -GAIM_TOP := ../../.. -LIBGAIM_TOP := $(GAIM_TOP)/libgaim -GAIM_INSTALL_DIR := $(GAIM_TOP)/win32-install-dir - -## -## VARIABLE DEFINITIONS -## - TARGET = idletrack -# Compiler Options - -CFLAGS = - -DEFINES = - ## -## INCLUDE MAKEFILES -## - -include $(LIBGAIM_TOP)/win32/global.mak - -## -## INCLUDE PATHS -## - -INCLUDE_PATHS += - -LIB_PATHS = - -## ## SOURCES, OBJECTS ## -C_SRC = idletrack.c +C_SRC = idletrack.c OBJECTS = $(C_SRC:%.c=%.o) +include $(GAIM_COMMON_RULES) ## -## LIBRARIES -## - -LIBS = - -## -## RULES -## - -# How to make a C file - -%.o: %.c - $(CC) $(CFLAGS) $(DEFINES) $(INCLUDE_PATHS) -o $@ -c $< - -## ## TARGET DEFINITIONS ## @@ -70,14 +27,14 @@ all: $(TARGET).dll -install: +install: $(GAIM_INSTALL_DIR) + cp $(TARGET).dll $(GAIM_INSTALL_DIR) - ## ## BUILD DLL ## -$(TARGET).dll: $(OBJECTS) +$(TARGET).dll $(TARGET).dll.a: $(OBJECTS) $(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -Wl,--out-implib,$(TARGET).dll.a -o $(TARGET).dll ## @@ -85,6 +42,8 @@ ## clean: - rm -rf *.o + rm -rf $(OBJECTS) rm -rf $(TARGET).dll rm -rf $(TARGET).dll.a + +include $(GAIM_COMMON_TARGETS) Modified: trunk/libgaim/Makefile.mingw =================================================================== --- trunk/libgaim/Makefile.mingw 2006-08-23 18:50:46 UTC (rev 17007) +++ trunk/libgaim/Makefile.mingw 2006-08-23 21:34:43 UTC (rev 17008) @@ -1,63 +1,33 @@ # # Makefile.mingw # -# Description: Makefile for win32 (mingw) version of Gaim +# Description: Makefile for win32 (mingw) version of libGaim # -# -# PATHS -# +GAIM_TOP := .. +include $(GAIM_TOP)/libgaim/win32/global.mak -GTK_TOP := ../../win32-dev/gtk_2_0 -GAIM_TOP := .. -LIBGAIM_TOP := . -PLUGINS_TOP := $(LIBGAIM_TOP)/plugins -PROTOCOLS_TOP := $(LIBGAIM_TOP)/protocols -GAIM_INSTALL_DIR := $(GAIM_TOP)/win32-install-dir -LIBXML2_DIR := ../../win32-dev/libxml2 - -NEEDED_DLLS = $(LIBXML2_DIR)/bin/libxml2.dll - - -## -## VARIABLE DEFINITIONS -## - TARGET = libgaim +NEEDED_DLLS = $(LIBXML2_TOP)/bin/libxml2.dll -# Compiler and Linker Options - -CFLAGS = - -DEFINES = - ## -## INCLUDE MAKEFILES -## - -include $(LIBGAIM_TOP)/win32/global.mak - -## ## INCLUDE PATHS ## - INCLUDE_PATHS = \ - -I$(LIBGAIM_TOP) \ - -I$(LIBGAIM_TOP)/win32 \ + -I$(GAIM_LIB_TOP) \ + -I$(GAIM_LIB_TOP)/win32 \ -I$(GAIM_TOP) \ -I$(GTK_TOP)/include \ -I$(GTK_TOP)/include/glib-2.0 \ -I$(GTK_TOP)/lib/glib-2.0/include \ - -I$(LIBXML2_DIR)/include + -I$(LIBXML2_TOP)/include LIB_PATHS = -L$(GTK_TOP)/lib \ - -L$(LIBGAIM_TOP) \ - -L$(LIBXML2_DIR)/lib + -L$(LIBXML2_TOP)/lib ## ## SOURCES, OBJECTS ## - C_SRC = \ account.c \ accountopt.c \ @@ -106,13 +76,11 @@ win32/libc_interface.c \ win32/win32dep.c - OBJECTS = $(C_SRC:%.c=%.o) ## ## LIBRARIES ## - LIBS = \ -lglib-2.0 \ -lgthread-2.0 \ @@ -123,44 +91,36 @@ -liberty \ -lxml2 -## -## RULES -## +include $(GAIM_COMMON_RULES) -# How to make a C file -%.o: %.c - $(CC) $(CFLAGS) $(INCLUDE_PATHS) $(DEFINES) -c $< -o $@ - ## ## TARGET DEFINITIONS ## +.PHONY: all clean -.PHONY: all clean include_path - all: $(TARGET).dll - $(MAKE) -C $(PROTOCOLS_TOP) -f Makefile.mingw - $(MAKE) -C $(PLUGINS_TOP) -f Makefile.mingw + $(MAKE) -C $(GAIM_PROTOS_TOP) -f $(GAIM_WIN32_MAKEFILE) + $(MAKE) -C $(GAIM_LIB_PLUGINS_TOP) -f $(GAIM_WIN32_MAKEFILE) -install: all - $(MAKE) -C $(PROTOCOLS_TOP) -f Makefile.mingw install - $(MAKE) -C $(PLUGINS_TOP) -f Makefile.mingw install - cp $(LIBGAIM_TOP)/$(TARGET).dll $(GAIM_INSTALL_DIR) +install: all $(GAIM_INSTALL_DIR) + $(MAKE) -C $(GAIM_PROTOS_TOP) -f $(GAIM_WIN32_MAKEFILE) install + $(MAKE) -C $(GAIM_LIB_PLUGINS_TOP) -f $(GAIM_WIN32_MAKEFILE) install + cp $(TARGET).dll $(GAIM_INSTALL_DIR) cp $(NEEDED_DLLS) $(GAIM_INSTALL_DIR) -# -# BUILD DLL -# -$(TARGET).dll.a $(TARGET).dll: -$(TARGET).dll.a $(TARGET).dll: $(OBJECTS) +$(OBJECTS): $(GAIM_CONFIG_H) + +$(TARGET).dll $(TARGET).dll.a: $(OBJECTS) $(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -Wl,--out-implib,$(TARGET).dll.a -o $(TARGET).dll ## ## CLEAN RULES ## - clean: - rm -rf *.o ./win32/*.o + rm -rf $(OBJECTS) rm -rf $(TARGET).dll rm -rf $(TARGET).dll.a - $(MAKE) -C $(PROTOCOLS_TOP) -f Makefile.mingw clean - $(MAKE) -C $(PLUGINS_TOP) -f Makefile.mingw clean + $(MAKE) -C $(GAIM_PROTOS_TOP) -f $(GAIM_WIN32_MAKEFILE) clean + $(MAKE) -C $(GAIM_LIB_PLUGINS_TOP) -f $(GAIM_WIN32_MAKEFILE) clean + +include $(GAIM_COMMON_TARGETS) Modified: trunk/libgaim/plugins/Makefile.mingw =================================================================== --- trunk/libgaim/plugins/Makefile.mingw 2006-08-23 18:50:46 UTC (rev 17007) +++ trunk/libgaim/plugins/Makefile.mingw 2006-08-23 21:34:43 UTC (rev 17008) @@ -4,59 +4,33 @@ # Description: Makefile for win32 (mingw) version of Gaim Plugins # -# -# PATHS -# +GAIM_TOP := ../.. +include $(GAIM_TOP)/libgaim/win32/global.mak -GAIM_PLUGINS := . -GAIM_TOP := ../.. -LIBGAIM_TOP := .. -GTK_TOP := ../../../win32-dev/gtk_2_0 -GAIM_INSTALL_DIR := $(GAIM_TOP)/win32-install-dir -PERL_PLUGIN_LOADER := ./perl -TCL_PLUGIN_LOADER := ./tcl -SSL := ./ssl +PERL_PLUGIN := ./perl +TCL_PLUGIN := ./tcl +SSL_PLUGIN := ./ssl -## -## VARIABLE DEFINITIONS -## - -# Compiler Options - -CFLAGS = - -DEFINES = - .SUFFIXES: .SUFFIXES: .c .dll ## -## INCLUDE MAKEFILES -## - -include $(LIBGAIM_TOP)/win32/global.mak - -## ## INCLUDE PATHS ## - INCLUDE_PATHS += \ -I$(GTK_TOP)/include \ -I$(GTK_TOP)/include/glib-2.0 \ -I$(GTK_TOP)/lib/glib-2.0/include \ -I$(GAIM_TOP) \ - -I$(LIBGAIM_TOP) \ - -I$(LIBGAIM_TOP)/win32 + -I$(GAIM_LIB_TOP) \ + -I$(GAIM_LIB_TOP)/win32 - LIB_PATHS = -L$(GTK_TOP)/lib \ - -L$(LIBGAIM_TOP) + -L$(GAIM_LIB_TOP) - ## ## LIBRARIES ## - LIBS = \ -lglib-2.0 \ -lgobject-2.0 \ @@ -66,30 +40,21 @@ -lgaim ## -## RULES -## - -## ## TARGET DEFINITIONS ## - .PHONY: all clean -all: plugins -# $(MAKE) -C $(PERL_PLUGIN_LOADER) -f Makefile.mingw - $(MAKE) -C $(TCL_PLUGIN_LOADER) -f Makefile.mingw - $(MAKE) -C $(SSL) -f Makefile.mingw +all: $(GAIM_LIBGAIM_DLL).a plugins +# $(MAKE) -C $(PERL_PLUGIN) -f $(GAIM_WIN32_MAKEFILE) + $(MAKE) -C $(TCL_PLUGIN) -f $(GAIM_WIN32_MAKEFILE) + $(MAKE) -C $(SSL_PLUGIN) -f $(GAIM_WIN32_MAKEFILE) -install: - cp $(GAIM_PLUGINS)/*.dll $(GAIM_INSTALL_DIR)/plugins -# $(MAKE) -C $(PERL_PLUGIN_LOADER) -f Makefile.mingw install - $(MAKE) -C $(TCL_PLUGIN_LOADER) -f Makefile.mingw install - $(MAKE) -C $(SSL) -f Makefile.mingw install +install: all $(GAIM_INSTALL_PLUGINS_DIR) +# $(MAKE) -C $(PERL_PLUGIN) -f $(GAIM_WIN32_MAKEFILE) install + $(MAKE) -C $(TCL_PLUGIN) -f $(GAIM_WIN32_MAKEFILE) install + $(MAKE) -C $(SSL_PLUGIN) -f $(GAIM_WIN32_MAKEFILE) install + cp $(GAIM_LIB_PLUGINS_TOP)/*.dll $(GAIM_INSTALL_PLUGINS_DIR) -# -# BUILD Plugin -# - .c.dll: $(CC) $(CFLAGS) $(DEFINES) $(INCLUDE_PATHS) -o $@.o -c $< $(CC) -shared $@.o $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -o $@ @@ -100,14 +65,14 @@ psychic.dll \ statenotify.dll - ## ## CLEAN RULES ## - clean: - rm -rf *.o - rm -rf *.dll - $(MAKE) -C $(PERL_PLUGIN_LOADER) -f Makefile.mingw clean - $(MAKE) -C $(TCL_PLUGIN_LOADER) -f Makefile.mingw clean - $(MAKE) -C $(SSL) -f Makefile.mingw clean + rm -rf $(GAIM_LIB_PLUGINS_TOP)/*.o + rm -rf $(GAIM_LIB_PLUGINS_TOP)/*.dll + $(MAKE) -C $(PERL_PLUGIN) -f $(GAIM_WIN32_MAKEFILE) clean + $(MAKE) -C $(TCL_PLUGIN) -f $(GAIM_WIN32_MAKEFILE) clean + $(MAKE) -C $(SSL_PLUGIN) -f $(GAIM_WIN32_MAKEFILE) clean + +include $(GAIM_COMMON_TARGETS) Modified: trunk/libgaim/plugins/perl/Makefile.mingw =================================================================== --- trunk/libgaim/plugins/perl/Makefile.mingw 2006-08-23 18:50:46 UTC (rev 17007) +++ trunk/libgaim/plugins/perl/Makefile.mingw 2006-08-23 21:34:43 UTC (rev 17008) @@ -4,78 +4,49 @@ # Description: Makefile for perl plugin loader plugin. # -# -# PATHS -# +GAIM_TOP := ../../.. +include $(GAIM_TOP)/libgaim/win32/global.mak -GTK_TOP := ../../../../win32-dev/gtk_2_0 -GAIM_TOP := ../../.. -LIBGAIM_TOP := ../.. -PERL_LIB_DIR := ../../../../win32-dev/perl58 -PERL_INCLUDE := $(PERL_LIB_DIR)/CORE -GAIM_INSTALL_DIR := $(GAIM_TOP)/win32-install-dir -DLL_INSTALL_DIR := $(GAIM_INSTALL_DIR)/plugins - -## -## VARIABLE DEFINITIONS -## - TARGET = perl -CC := gcc.exe - -# Compiler Options - -CFLAGS = - -DEFINES = - -## -## INCLUDE MAKEFILES -## - -include $(LIBGAIM_TOP)/win32/global.mak - # Perl headers with /* /* */ type comments.. Turn off warnings. CFLAGS += -Wno-comment ## ## INCLUDE PATHS ## - INCLUDE_PATHS += -I. \ -I$(GAIM_TOP) \ - -I$(LIBGAIM_TOP) \ - -I$(LIBGAIM_TOP)/win32 \ + -I$(GAIM_LIB_TOP) \ + -I$(GAIM_LIB_TOP)/win32 \ + -I$(GAIM_GTK_TOP) \ + -I$(GAIM_GTK_TOP)/win32 \ -I$(GTK_TOP)/include \ + -I$(GTK_TOP)/include/gtk-2.0 \ -I$(GTK_TOP)/include/glib-2.0 \ + -I$(GTK_TOP)/include/pango-1.0 \ + -I$(GTK_TOP)/include/atk-1.0 \ + -I$(GTK_TOP)/lib/gtk-2.0/include \ -I$(GTK_TOP)/lib/glib-2.0/include \ - -I$(PERL_INCLUDE) + -I$(PERL_LIB_TOP)/CORE - - - LIB_PATHS = -L$(GTK_TOP)/lib \ - -L$(GAIM_TOP)/src \ - -L$(PERL_LIB_DIR) + -L$(GAIM_LIB_TOP) \ + -L$(GAIM_GTK_TOP) \ + -L$(PERL_LIB_TOP) - ## ## SOURCES, OBJECTS ## - C_SRC = perl.c \ perl-common.c \ perl-handlers.c - OBJECTS = $(C_SRC:%.c=%.o) - ## ## LIBRARIES ## - LIBS = \ -lglib-2.0 \ -lgmodule-2.0 \ @@ -83,51 +54,37 @@ -lws2_32 \ -lintl \ -lgaim \ + -lgtkgaim \ -lperl58 +include $(GAIM_COMMON_RULES) ## -## RULES -## - -# How to make a C file - -%.o: %.c - $(CC) $(CFLAGS) $(DEFINES) $(INCLUDE_PATHS) -o $@ -c $< - -## ## TARGET DEFINITIONS ## - .PHONY: all clean all: $(TARGET).dll - $(MAKE) -C ./common -f Makefile.mingw + $(MAKE) -C ./common -f $(GAIM_WIN32_MAKEFILE) -install: - cp $(TARGET).dll $(DLL_INSTALL_DIR) - $(MAKE) -C ./common -f Makefile.mingw install +install: all $(GAIM_INSTALL_PLUGINS_DIR) + cp $(TARGET).dll $(GAIM_INSTALL_PLUGINS_DIR) + $(MAKE) -C ./common -f $(GAIM_WIN32_MAKEFILE) install -## -## BUILD Dependencies -## +$(OBJECTS): $(GAIM_CONFIG_H) -$(GAIM_TOP)/src/libgaim.dll.a: - $(MAKE) -C $(GAIM_TOP)/src -f Makefile.mingw libgaim.dll.a - ## ## BUILD DLL ## - -$(TARGET).dll: $(OBJECTS) $(GAIM_TOP)/src/libgaim.dll.a +$(TARGET).dll: $(GAIM_LIBGAIM_DLL).a $(GAIM_GTKGAIM_DLL).a $(OBJECTS) $(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -Wl,--export-all-symbols -o $(TARGET).dll - ## ## CLEAN RULES ## - clean: - rm -rf *.o + rm -rf $(OBJECTS) rm -rf $(TARGET).dll $(TARGET).lib - $(MAKE) -C ./common -f Makefile.mingw clean + $(MAKE) -C ./common -f $(GAIM_WIN32_MAKEFILE) clean + +include $(GAIM_COMMON_TARGETS) Modified: trunk/libgaim/plugins/perl/common/Makefile.mingw =================================================================== --- trunk/libgaim/plugins/perl/common/Makefile.mingw 2006-08-23 18:50:46 UTC (rev 17007) +++ trunk/libgaim/plugins/perl/common/Makefile.mingw 2006-08-23 21:34:43 UTC (rev 17008) @@ -4,32 +4,23 @@ # Description: Makefile for Gaim perl module. # +GAIM_TOP := ../../../.. +include $(GAIM_TOP)/libgaim/win32/global.mak + TARGET = Gaim AUTOSPLIT = lib/auto/Gaim/autosplit.ix - -## -## TOOLS -## - -CC := gcc -PERL := /cygdrive/c/perl/bin/perl - -## -## PATHS -## - EXTUTILS := C:/perl/lib/ExtUtils -GAIM_TOP := ../../.. -GTK_TOP := ../../../../win32-dev/gtk_2_0 -PERL_TOP := ../../../../win32-dev/perl58 PERL_PLUGIN_TOP := .. -GAIM_INSTALL_DIR := $(GAIM_TOP)/win32-install-dir -PERLMOD_INSTALL_DIR := $(GAIM_INSTALL_DIR)/perlmod +CFLAGS += -Wno-comment +## +## INCLUDE PATHS +## INCLUDE_PATHS = -I. \ -I$(GAIM_TOP) \ - -I$(GAIM_TOP)/src \ + -I$(GAIM_LIB_TOP) \ + -I$(GAIM_GTK_TOP) \ -I$(GTK_TOP)/include \ -I$(GTK_TOP)/include/gtk-2.0 \ -I$(GTK_TOP)/include/glib-2.0 \ @@ -37,18 +28,17 @@ -I$(GTK_TOP)/include/atk-1.0 \ -I$(GTK_TOP)/lib/gtk-2.0/include \ -I$(GTK_TOP)/lib/glib-2.0/include \ - -I$(PERL_TOP)/CORE + -I$(PERL_LIB_TOP)/CORE -LIB_PATHS = -L$(PERL_TOP) \ +LIB_PATHS = -L$(PERL_LIB_TOP) \ -L$(PERL_PLUGIN_TOP) \ - -L$(GAIM_TOP)/src \ + -L$(GAIM_LIB_TOP) \ + -L$(GAIM_GTK_TOP) \ -L$(GTK_TOP)/lib - ## ## SOURCES, OBJECTS ## - XS_FILES = Account.xs \ AccountOpts.xs \ BuddyIcon.xs \ @@ -83,60 +73,50 @@ Util.xs \ XMLNode.xs \ -FALLBACKS = const-c.inc const-xs.inc - +FALLBACKS = const-c.inc const-xs.inc C_FILES = $(XS_FILES:%.xs=%.c) - OBJECTS = $(C_FILES:%.c=%.o) ## ## LIBRARIES ## - LIBS = -lperl58 \ -lperl \ -lgaim \ + -lgtkgaim \ -lglib-2.0 -## -## RULES -## +include $(GAIM_COMMON_RULES) -# How to make a C file -%.o: %.c - $(CC) $(CFLAGS) $(INCLUDE_PATHS) $(DEFINES) -c $< -o $@ - -# How to make a XS file -%.c: %.xs - $(PERL) $(EXTUTILS)/xsubpp -typemap $(EXTUTILS)/typemap -typemap typemap $< > $@ - %.inc: cp fallback/$@ ./ ## ## TARGETS ## - .PHONY: all clean all: $(TARGET).dll $(AUTOSPLIT) -install: - rm -rf $(PERLMOD_INSTALL_DIR) - cp -R lib $(PERLMOD_INSTALL_DIR) - cp $(TARGET).dll $(PERLMOD_INSTALL_DIR) - +install: all + rm -rf $(GAIM_INSTALL_PERLMOD_DIR) + cp -R lib $(GAIM_INSTALL_PERLMOD_DIR) + cp $(TARGET).dll $(GAIM_INSTALL_PERLMOD_DIR) + +$(C_FILES): $(GAIM_CONFIG_H) + $(AUTOSPLIT): Gaim.pm mkdir -p ./lib/auto cp Gaim.pm ./lib $(PERL) -MAutoSplit -e 'autosplit("lib/Gaim.pm")' -$(TARGET).dll: $(FALLBACKS) $(OBJECTS) +$(TARGET).dll: $(GAIM_LIBGAIM_DLL).a $(GAIM_GTKGAIM_DLL).a $(FALLBACKS) $(OBJECTS) $(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) -o $(TARGET).dll ## ## CLEAN ## - clean: rm -rf *.o $(TARGET).dll $(FALLBACKS) lib + +include $(GAIM_COMMON_TARGETS) Modified: trunk/libgaim/plugins/perl/common/module.h =================================================================== --- trunk/libgaim/plugins/perl/common/module.h 2006-08-23 18:50:46 UTC (rev 17007) +++ trunk/libgaim/plugins/perl/common/module.h 2006-08-23 21:34:43 UTC (rev 17008) @@ -53,7 +53,7 @@ #include "status.h" #include "stringref.h" /* Ewww. perl has it's own util.h which is in the include path :( */ -#include "src/util.h" +#include "libgaim/util.h" #include "value.h" #include "xmlnode.h" Modified: trunk/libgaim/plugins/ssl/Makefile.mingw =================================================================== --- trunk/libgaim/plugins/ssl/Makefile.mingw 2006-08-23 18:50:46 UTC (rev 17007) +++ trunk/libgaim/plugins/ssl/Makefile.mingw 2006-08-23 21:34:43 UTC (rev 17008) @@ -4,82 +4,52 @@ # Description: Makefile for ssl plugin. # -# -# PATHS -# +GAIM_TOP := ../../.. +include $(GAIM_TOP)/libgaim/win32/global.mak -GTK_TOP := ../../../../win32-dev/gtk_2_0 -GAIM_TOP := ../../.. -LIBGAIM_TOP := ../.. -GAIM_INSTALL_DIR := $(GAIM_TOP)/win32-install-dir -DLL_INSTALL_DIR := $(GAIM_INSTALL_DIR)/plugins -NSS_DIR := ../../../../win32-dev/nss-3.9 -NSPR_DIR := ../../../../win32-dev/nspr-4.4.1 - ## ## VARIABLE DEFINITIONS ## - TARGET = ssl TARGET_NSS = ssl-nss -NEEDED_DLLS = $(NSS_DIR)/lib/nss3.dll \ - $(NSS_DIR)/lib/nssckbi.dll \ - $(NSS_DIR)/lib/softokn3.dll \ - $(NSS_DIR)/lib/ssl3.dll \ - $(NSPR_DIR)/lib/nspr4.dll \ - $(NSPR_DIR)/lib/plc4.dll \ - $(NSPR_DIR)/lib/plds4.dll +NEEDED_DLLS = $(NSS_TOP)/lib/nss3.dll \ + $(NSS_TOP)/lib/nssckbi.dll \ + $(NSS_TOP)/lib/softokn3.dll \ + $(NSS_TOP)/lib/ssl3.dll \ + $(NSPR_TOP)/lib/nspr4.dll \ + $(NSPR_TOP)/lib/plc4.dll \ + $(NSPR_TOP)/lib/plds4.dll -# Compiler Options - -CFLAGS = - -DEFINES = - ## -## INCLUDE MAKEFILES -## - -include $(LIBGAIM_TOP)/win32/global.mak - -## ## INCLUDE PATHS ## - INCLUDE_PATHS += -I. \ -I$(GTK_TOP)/include \ -I$(GTK_TOP)/include/glib-2.0 \ -I$(GTK_TOP)/lib/glib-2.0/include \ - -I$(LIBGAIM_TOP) \ - -I$(LIBGAIM_TOP)/win32 \ + -I$(GAIM_LIB_TOP) \ + -I$(GAIM_LIB_TOP)/win32 \ -I$(GAIM_TOP) \ - -I$(NSS_DIR)/include \ - -I$(NSPR_DIR)/include + -I$(NSS_TOP)/include \ + -I$(NSPR_TOP)/include LIB_PATHS = -L$(GTK_TOP)/lib \ - -L$(LIBGAIM_TOP) \ - -L$(NSS_DIR)/lib \ - -L$(NSPR_DIR)/lib + -L$(GAIM_LIB_TOP) \ + -L$(NSS_TOP)/lib \ + -L$(NSPR_TOP)/lib ## ## SOURCES, OBJECTS ## - C_SRC = ssl.c - C_SRC_NSS = ssl-nss.c - - OBJECTS = $(C_SRC:%.c=%.o) - OBJECTS_NSS = $(C_SRC_NSS:%.c=%.o) - ## ## LIBRARIES ## - LIBS = \ -lglib-2.0 \ -lws2_32 \ @@ -89,51 +59,36 @@ -lnspr4 \ -lssl3 +include $(GAIM_COMMON_RULES) ## -## RULES -## - -# How to make a C file - -%.o: %.c - $(CC) $(CFLAGS) $(DEFINES) $(INCLUDE_PATHS) -o $@ -c $< - -## ## TARGET DEFINITIONS ## - .PHONY: all clean all: $(TARGET).dll $(TARGET_NSS).dll -install: - cp $(TARGET).dll $(DLL_INSTALL_DIR) - cp $(TARGET_NSS).dll $(DLL_INSTALL_DIR) +install: all $(GAIM_INSTALL_PLUGINS_DIR) $(GAIM_INSTALL_DIR) + cp $(TARGET).dll $(GAIM_INSTALL_PLUGINS_DIR) + cp $(TARGET_NSS).dll $(GAIM_INSTALL_PLUGINS_DIR) cp $(NEEDED_DLLS) $(GAIM_INSTALL_DIR) -## -## BUILD Dependencies -## +$(OBJECTS) $(OBJECTS_NSS): $(GAIM_CONFIG_H) -$(LIBGAIM_TOP)/libgaim.dll.a: - $(MAKE) -C $(LIBGAIM_TOP) -f Makefile.mingw libgaim.dll.a - ## ## BUILD DLL ## - -$(TARGET).dll: $(OBJECTS) $(LIBGAIM_TOP)/libgaim.dll.a +$(TARGET).dll: $(GAIM_LIBGAIM_DLL).a $(OBJECTS) $(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -o $(TARGET).dll -$(TARGET_NSS).dll: $(OBJECTS_NSS) $(LIBGAIM_TOP)/libgaim.dll.a +$(TARGET_NSS).dll: $(GAIM_LIBGAIM_DLL) $(OBJECTS_NSS) $(CC) -shared $(OBJECTS_NSS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -o $(TARGET_NSS).dll ## ## CLEAN RULES ## - clean: - rm -rf *.o - rm -rf $(TARGET).dll - rm -rf $(TARGET_NSS).dll + rm -rf $(OBJECTS) $(OBJECTS_NSS) + rm -rf $(TARGET).dll $(TARGET_NSS).dll + +include $(GAIM_COMMON_TARGETS) Modified: trunk/libgaim/plugins/tcl/Makefile.mingw =================================================================== --- trunk/libgaim/plugins/tcl/Makefile.mingw 2006-08-23 18:50:46 UTC (rev 17007) +++ trunk/libgaim/plugins/tcl/Makefile.mingw 2006-08-23 21:34:43 UTC (rev 17008) @@ -4,59 +4,32 @@ # Description: Makefile for tcl plugin loader plugin. # -# -# PATHS -# +GAIM_TOP := ../../.. +include $(GAIM_TOP)/libgaim/win32/global.mak -GTK_TOP := ../../../../win32-dev/gtk_2_0 -GAIM_TOP := ../../.. -LIBGAIM_TOP := ../.. -TCL_LIB_DIR := ../../../../win32-dev/tcl-8.4.5 -TCL_INC_DIR := $(TCL_LIB_DIR)/include -GAIM_INSTALL_DIR := $(GAIM_TOP)/win32-install-dir -DLL_INSTALL_DIR := $(GAIM_INSTALL_DIR)/plugins - -## -## VARIABLE DEFINITIONS -## - TARGET = tcl +TCL_INC_DIR := $(TCL_LIB_TOP)/include +DEFINES += -DHAVE_TK -DUSE_TCL_STUBS -DUSE_TK_STUBS -# Compiler Options - -CFLAGS = - -DEFINES = -DHAVE_TK -DUSE_TCL_STUBS -DUSE_TK_STUBS - ## -## INCLUDE MAKEFILES -## - -include $(LIBGAIM_TOP)/win32/global.mak - -## ## INCLUDE PATHS ## - INCLUDE_PATHS += -I. \ -I$(GAIM_TOP) \ - -I$(LIBGAIM_TOP) \ - -I$(LIBGAIM_TOP)/win32 \ + -I$(GAIM_LIB_TOP) \ + -I$(GAIM_LIB_TOP)/win32 \ -I$(GTK_TOP)/include \ -I$(GTK_TOP)/include/glib-2.0 \ -I$(GTK_TOP)/lib/glib-2.0/include \ -I$(TCL_INC_DIR) +LIB_PATHS += -L$(GTK_TOP)/lib \ + -L$(GAIM_LIB_TOP) \ + -L$(TCL_LIB_TOP) -LIB_PATHS = -L$(GTK_TOP)/lib \ - -L$(LIBGAIM_TOP) \ - -L$(TCL_LIB_DIR) - - ## ## SOURCES, OBJECTS ## - C_SRC = tcl.c \ tcl_cmd.c \ tcl_cmds.c \ @@ -64,14 +37,11 @@ tcl_ref.c \ tcl_signals.c - OBJECTS = $(C_SRC:%.c=%.o) - ## ## LIBRARIES ## - LIBS = \ -lglib-2.0 \ -lws2_32 \ @@ -80,46 +50,28 @@ -ltclstub84 \ -ltkstub84 +include $(GAIM_COMMON_RULES) ## -## RULES -## - -# How to make a C file - -%.o: %.c - $(CC) $(CFLAGS) $(DEFINES) $(INCLUDE_PATHS) -o $@ -c $< - -## ## TARGET DEFINITIONS ## - .PHONY: all clean all: $(TARGET).dll -install: $(TARGET).dll - cp $(TARGET).dll $(DLL_INSTALL_DIR) +install: all $(GAIM_INSTALL_PLUGINS_DIR) + cp $(TARGET).dll $(GAIM_INSTALL_PLUGINS_DIR) -## -## BUILD Dependencies -## +$(OBJECTS): $(GAIM_CONFIG_H) -$(LIBGAIM_TOP)/libgaim.dll.a: - $(MAKE) -C $(LIBGAIM_TOP) -f Makefile.mingw libgaim.dll.a - -## -## BUILD DLL -## - -$(TARGET).dll: $(OBJECTS) $(LIBGAIM_TOP)/libgaim.dll.a +$(TARGET).dll: $(GAIM_LIBGAIM_DLL).a $(OBJECTS) $(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -o $(TARGET).dll - ## ## CLEAN RULES ## - clean: - rm -rf *.o + rm -rf $(OBJECTS) rm -rf $(TARGET).dll + +include $(GAIM_COMMON_TARGETS) Modified: trunk/libgaim/protocols/Makefile.mingw =================================================================== --- trunk/libgaim/protocols/Makefile.mingw 2006-08-23 18:50:46 UTC (rev 17007) +++ trunk/libgaim/protocols/Makefile.mingw 2006-08-23 21:34:43 UTC (rev 17008) @@ -5,74 +5,70 @@ # Description: Top Makefile for win32 (mingw) port of Gaim # -GAIM_TOP = ../.. -LIBGAIM_TOP = ../ -GAIM_PROTOS = . -GAIM_INSTALL_DIR = $(GAIM_TOP)/win32-install-dir +GAIM_TOP := ../.. +include $(GAIM_TOP)/libgaim/win32/global.mak -OSCAR = $(GAIM_PROTOS)/oscar -YAHOO = $(GAIM_PROTOS)/yahoo -MSN = $(GAIM_PROTOS)/msn -TOC = $(GAIM_PROTOS)/toc -IRC = $(GAIM_PROTOS)/irc -JABBER = $(GAIM_PROTOS)/jabber -GG = $(GAIM_PROTOS)/gg -NOVELL = $(GAIM_PROTOS)/novell -SILC = $(GAIM_PROTOS)/silc -SIMPLE = $(GAIM_PROTOS)/simple -SAMETIME = $(GAIM_PROTOS)/sametime +GG = $(GAIM_PROTOS_TOP)/gg +IRC = $(GAIM_PROTOS_TOP)/irc +JABBER = $(GAIM_PROTOS_TOP)/jabber +MSN = $(GAIM_PROTOS_TOP)/msn +NOVELL = $(GAIM_PROTOS_TOP)/novell +OSCAR = $(GAIM_PROTOS_TOP)/oscar +SAMETIME = $(GAIM_PROTOS_TOP)/sametime +SILC = $(GAIM_PROTOS_TOP)/silc +SIMPLE = $(GAIM_PROTOS_TOP)/simple +TOC = $(GAIM_PROTOS_TOP)/toc +YAHOO = $(GAIM_PROTOS_TOP)/yahoo ## ## Don't forget to change STATIC_PROTO_INIT, in config.h.mingw if you ## change the status of a protocol (static/plugin) ## -OSCAR_TYPE = PLUGIN -YAHOO_TYPE = PLUGIN -MSN_TYPE = PLUGIN -TOC_TYPE = PLUGIN +GG_TYPE = PLUGIN IRC_TYPE = PLUGIN JABBER_TYPE = PLUGIN -GG_TYPE = PLUGIN +MSN_TYPE = PLUGIN NOVELL_TYPE = PLUGIN +OSCAR_TYPE = PLUGIN +SAMETIME_TYPE = PLUGIN SILC_TYPE = PLUGIN SIMPLE_TYPE = PLUGIN -SAMETIME_TYPE = PLUGIN +TOC_TYPE = PLUGIN +YAHOO_TYPE = PLUGIN all: - $(MAKE) TYPE='$(OSCAR_TYPE)' -C $(OSCAR) -f Makefile.mingw - $(MAKE) TYPE='$(YAHOO_TYPE)' -C $(YAHOO) -f Makefile.mingw - $(MAKE) TYPE='$(MSN_TYPE)' -C $(MSN) -f Makefile.mingw - $(MAKE) TYPE='$(IRC_TYPE)' -C $(IRC) -f Makefile.mingw - $(MAKE) TYPE='$(JABBER_TYPE)' -C $(JABBER) -f Makefile.mingw - $(MAKE) TYPE='$(GG_TYPE)' -C $(GG) -f Makefile.mingw - $(MAKE) TYPE='$(NOVELL_TYPE)' -C $(NOVELL) -f Makefile.mingw - $(MAKE) TYPE='$(SILC_TYPE)' -C $(SILC) -f Makefile.mingw - $(MAKE) TYPE='$(SIMPLE_TYPE)' -C $(SIMPLE) -f Makefile.mingw - $(MAKE) TYPE='$(SAMETIME_TYPE)' -C $(SAMETIME) -f Makefile.mingw + $(MAKE) TYPE='$(GG_TYPE)' -C $(GG) -f $(GAIM_WIN32_MAKEFILE) + $(MAKE) TYPE='$(IRC_TYPE)' -C $(IRC) -f $(GAIM_WIN32_MAKEFILE) + $(MAKE) TYPE='$(JABBER_TYPE)' -C $(JABBER) -f $(GAIM_WIN32_MAKEFILE) + $(MAKE) TYPE='$(MSN_TYPE)' -C $(MSN) -f $(GAIM_WIN32_MAKEFILE) + $(MAKE) TYPE='$(NOVELL_TYPE)' -C $(NOVELL) -f $(GAIM_WIN32_MAKEFILE) + $(MAKE) TYPE='$(OSCAR_TYPE)' -C $(OSCAR) -f $(GAIM_WIN32_MAKEFILE) + $(MAKE) TYPE='$(SAMETIME_TYPE)' -C $(SAMETIME) -f $(GAIM_WIN32_MAKEFILE) + $(MAKE) TYPE='$(SILC_TYPE)' -C $(SILC) -f $(GAIM_WIN32_MAKEFILE) + $(MAKE) TYPE='$(SIMPLE_TYPE)' -C $(SIMPLE) -f $(GAIM_WIN32_MAKEFILE) + $(MAKE) TYPE='$(YAHOO_TYPE)' -C $(YAHOO) -f $(GAIM_WIN32_MAKEFILE) - install: all - mkdir -p $(GAIM_INSTALL_DIR)/plugins - $(MAKE) TYPE='$(OSCAR_TYPE)' -C $(OSCAR) -f Makefile.mingw install - $(MAKE) TYPE='$(YAHOO_TYPE)' -C $(YAHOO) -f Makefile.mingw install - $(MAKE) TYPE='$(MSN_TYPE)' -C $(MSN) -f Makefile.mingw install - $(MAKE) TYPE='$(IRC_TYPE)' -C $(IRC) -f Makefile.mingw install - $(MAKE) TYPE='$(JABBER_TYPE)' -C $(JABBER) -f Makefile.mingw install - $(MAKE) TYPE='$(GG_TYPE)' -C $(GG) -f Makefile.mingw install - $(MAKE) TYPE='$(NOVELL_TYPE)' -C $(NOVELL) -f Makefile.mingw install - $(MAKE) TYPE='$(SILC_TYPE)' -C $(SILC) -f Makefile.mingw install - $(MAKE) TYPE='$(SIMPLE_TYPE)' -C $(SIMPLE) -f Makefile.mingw install - $(MAKE) TYPE='$(SAMETIME_TYPE)' -C $(SAMETIME) -f Makefile.mingw install + $(MAKE) TYPE='$(GG_TYPE)' -C $(GG) -f $(GAIM_WIN32_MAKEFILE) install + $(MAKE) TYPE='$(IRC_TYPE)' -C $(IRC) -f $(GAIM_WIN32_MAKEFILE) install + $(MAKE) TYPE='$(JABBER_TYPE)' -C $(JABBER) -f $(GAIM_WIN32_MAKEFILE) install + $(MAKE) TYPE='$(MSN_TYPE)' -C $(MSN) -f $(GAIM_WIN32_MAKEFILE) install + $(MAKE) TYPE='$(NOVELL_TYPE)' -C $(NOVELL) -f $(GAIM_WIN32_MAKEFILE) install + $(MAKE) TYPE='$(OSCAR_TYPE)' -C $(OSCAR) -f $(GAIM_WIN32_MAKEFILE) install + $(MAKE) TYPE='$(SAMETIME_TYPE)' -C $(SAMETIME) -f $(GAIM_WIN32_MAKEFILE) install + $(MAKE) TYPE='$(SILC_TYPE)' -C $(SILC) -f $(GAIM_WIN32_MAKEFILE) install + $(MAKE) TYPE='$(SIMPLE_TYPE)' -C $(SIMPLE) -f $(GAIM_WIN32_MAKEFILE) install + $(MAKE) TYPE='$(YAHOO_TYPE)' -C $(YAHOO) -f $(GAIM_WIN32_MAKEFILE) install clean: - $(MAKE) -C $(OSCAR) -f Makefile.mingw clean - $(MAKE) -C $(YAHOO) -f Makefile.mingw clean - $(MAKE) -C $(MSN) -f Makefile.mingw clean - $(MAKE) -C $(IRC) -f Makefile.mingw clean - $(MAKE) -C $(JABBER) -f Makefile.mingw clean - $(MAKE) -C $(GG) -f Makefile.mingw clean - $(MAKE) -C $(NOVELL) -f Makefile.mingw clean - $(MAKE) -C $(SILC) -f Makefile.mingw clean - $(MAKE) -C $(SIMPLE) -f Makefile.mingw clean - $(MAKE) -C $(SAMETIME) -f Makefile.mingw clean + $(MAKE) TYPE='$(GG_TYPE)' -C $(GG) -f $(GAIM_WIN32_MAKEFILE) clean + $(MAKE) TYPE='$(IRC_TYPE)' -C $(IRC) -f $(GAIM_WIN32_MAKEFILE) clean + $(MAKE) TYPE='$(JABBER_TYPE)' -C $(JABBER) -f $(GAIM_WIN32_MAKEFILE) clean + $(MAKE) TYPE='$(MSN_TYPE)' -C $(MSN) -f $(GAIM_WIN32_MAKEFILE) clean + $(MAKE) TYPE='$(NOVELL_TYPE)' -C $(NOVELL) -f $(GAIM_WIN32_MAKEFILE) clean + $(MAKE) TYPE='$(OSCAR_TYPE)' -C $(OSCAR) -f $(GAIM_WIN32_MAKEFILE) clean + $(MAKE) TYPE='$(SAMETIME_TYPE)' -C $(SAMETIME) -f $(GAIM_WIN32_MAKEFILE) clean + $(MAKE) TYPE='$(SILC_TYPE)' -C $(SILC) -f $(GAIM_WIN32_MAKEFILE) clean + $(MAKE) TYPE='$(SIMPLE_TYPE)' -C $(SIMPLE) -f $(GAIM_WIN32_MAKEFILE) clean + $(MAKE) TYPE='$(YAHOO_TYPE)' -C $(YAHOO) -f $(GAIM_WIN32_MAKEFILE) clean Modified: trunk/libgaim/protocols/bonjour/Makefile.mingw =================================================================== --- trunk/libgaim/protocols/bonjour/Makefile.mingw 2006-08-23 18:50:46 UTC (rev 17007) +++ trunk/libgaim/protocols/bonjour/Makefile.mingw 2006-08-23 21:34:43 UTC (rev 17008) @@ -4,84 +4,51 @@ # Description: Makefile for win32 (mingw) version of libbonjour # -# -# PATHS -# +GAIM_TOP := ../../.. +include $(GAIM_TOP)/libgaim/win32/global.mak -GTK_TOP := ../../../../win32-dev/gtk_2_0 -GAIM_TOP := ../../.. -LIBGAIM_TOP := ../.. -BONJOUR_ROOT := . -GAIM_INSTALL_DIR := $(GAIM_TOP)/win32-install-dir -HOWL_DIR := $(GAIM_TOP)/../win32-dev/howl-1.0.0 - -## -## VARIABLE DEFINITIONS -## - TARGET = libbonjour +NEEDED_DLLS = $(HOWL_TOP)/bin/libhowl-1.dll -NEEDED_DLLS = $(HOWL_DIR)/bin/libhowl-1.dll - -# Compiler Options - -CFLAGS = - -DEFINES = - # Static or Plugin... ifeq ($(TYPE),STATIC) DEFINES += -DSTATIC DLL_INSTALL_DIR = $(GAIM_INSTALL_DIR) else ifeq ($(TYPE),PLUGIN) - DLL_INSTALL_DIR = $(GAIM_INSTALL_DIR)/plugins + DLL_INSTALL_DIR = $(GAIM_INSTALL_PLUGINS_DIR) endif endif - ## -## INCLUDE MAKEFILES -## - -include $(LIBGAIM_TOP)/win32/global.mak - -## ## INCLUDE PATHS ## - INCLUDE_PATHS += -I$(BONJOUR_ROOT) \ -I$(GTK_TOP)/include \ -I$(GTK_TOP)/include/glib-2.0 \ -I$(GTK_TOP)/lib/glib-2.0/include \ - -I$(HOWL_DIR)/include \ - -I$(LIBGAIM_TOP) \ - -I$(LIBGAIM_TOP)/win32 \ + -I$(HOWL_TOP)/include \ + -I$(GAIM_LIB_TOP) \ + -I$(GAIM_LIB_TOP)/win32 \ -I$(GAIM_TOP) - LIB_PATHS = -L$(GTK_TOP)/lib \ - -L$(HOWL_DIR)/lib \ - -L$(LIBGAIM_TOP) + -L$(HOWL_TOP)/lib \ + -L$(GAIM_LIB_TOP) - ## ## SOURCES, OBJECTS ## - C_SRC = bonjour.c \ buddy.c \ dns_sd.c \ jabber.c - OBJECTS = $(C_SRC:%.c=%.o) - ## ## LIBRARIES ## - LIBS = \ -lglib-2.0 \ -lws2_32 \ @@ -89,41 +56,22 @@ -lhowl \ -lgaim +include $(GAIM_COMMON_RULES) ## -## RULES -## - -# How to make a C file - -%.o: %.c - $(CC) $(CFLAGS) $(DEFINES) $(INCLUDE_PATHS) -o $@ -c $< - -## ## TARGET DEFINITIONS ## - .PHONY: all clean all: $(TARGET).dll -install: - cp $(BONJOUR_ROOT)/$(TARGET).dll $(DLL_INSTALL_DIR) +install: all $(DLL_INSTALL_DIR) + cp $(TARGET).dll $(DLL_INSTALL_DIR) cp $(NEEDED_DLLS) $(GAIM_INSTALL_DIR) +$(OBJECTS): $(GAIM_CONFIG_H) -## -## BUILD Dependencies -## - -$(LIBGAIM_TOP)/libgaim.dll.a: - $(MAKE) -C $(LIBGAIM_TOP) -f Makefile.mingw libgaim.dll.a - -## -## BUILD DLL -## - -$(TARGET).dll: $(OBJECTS) $(LIBGAIM_TOP)/libgaim.dll.a +$(TARGET).dll: $(GAIM_LIBGAIM_DLL).a $(OBJECTS) $(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -o $(TARGET).dll ## @@ -131,5 +79,7 @@ ## clean: - rm -rf *.o + rm -rf $(OBJECTS) rm -rf $(TARGET).dll + +include $(GAIM_COMMON_TARGETS) Modified: trunk/libgaim/protocols/gg/Makefile.mingw =================================================================== --- trunk/libgaim/protocols/gg/Makefile.mingw 2006-08-23 18:50:46 UTC (rev 17007) +++ trunk/libgaim/protocols/gg/Makefile.mingw 2006-08-23 21:34:43 UTC (rev 17008) @@ -4,67 +4,40 @@ # Description: Makefile for win32 (mingw) version of libgg # -# -# PATHS -# +GAIM_TOP := ../../.. +include $(GAIM_TOP)/libgaim/win32/global.mak -GTK_TOP := ../../../../win32-dev/gtk_2_0 -GAIM_TOP := ../../.. -LIBGAIM_TOP := ../.. -GG_ROOT := . -GAIM_INSTALL_DIR := $(GAIM_TOP)/win32-install-dir - -## -## VARIABLE DEFINITIONS -## - TARGET = libgg +CFLAGS += -include win32dep.h -# Compiler Options - -CFLAGS = -include win32dep.h - -DEFINES = - # Static or Plugin... ifeq ($(TYPE),STATIC) DEFINES += -DSTATIC DLL_INSTALL_DIR = $(GAIM_INSTALL_DIR) else ifeq ($(TYPE),PLUGIN) - DLL_INSTALL_DIR = $(GAIM_INSTALL_DIR)/plugins + DLL_INSTALL_DIR = $(GAIM_INSTALL_PLUGINS_DIR) endif endif - ## -## INCLUDE MAKEFILES -## - -include $(LIBGAIM_TOP)/win32/global.mak - -## ## INCLUDE PATHS ## - -INCLUDE_PATHS += -I$(GG_ROOT) \ - -I$(GG_ROOT)/lib \ +INCLUDE_PATHS += -I. \ + -I./lib \ -I$(GTK_TOP)/include \ -I$(GTK_TOP)/include/glib-2.0 \ -I$(GTK_TOP)/lib/glib-2.0/include \ - -I$(LIBGAIM_TOP) \ - -I$(LIBGAIM_TOP)/win32 \ + -I$(GAIM_LIB_TOP) \ + -I$(GAIM_LIB_TOP)/win32 \ -I$(GAIM_TOP) - LIB_PATHS = -L$(GTK_TOP)/lib \ - -L$(LIBGAIM_TOP) \ + -L$(GAIM_LIB_TOP) \ - ## ## SOURCES, OBJECTS ## - C_SRC = \ lib/common.c \ lib/events.c \ @@ -81,11 +54,9 @@ OBJECTS = $(C_SRC:%.c=%.o) - ## ## LIBRARIES ## - LIBS = \ -lglib-2.0 \ -... [truncated message content] |
From: <sa...@us...> - 2006-08-23 18:50:53
|
Revision: 17007 Author: sadrul Date: 2006-08-23 11:50:46 -0700 (Wed, 23 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=17007&view=rev Log Message: ----------- This is a temporary change, allowing people with slightly older versions of ncurses to build. I plan to evetually add mouse support for older versions. Modified Paths: -------------- trunk/console/libgnt/gntmain.c Modified: trunk/console/libgnt/gntmain.c =================================================================== --- trunk/console/libgnt/gntmain.c 2006-08-23 17:01:31 UTC (rev 17006) +++ trunk/console/libgnt/gntmain.c 2006-08-23 18:50:46 UTC (rev 17007) @@ -560,7 +560,7 @@ offset = 0; } else return FALSE; - return TRUE; + return FALSE; /* XXX: this should be TRUE */ } static gboolean @@ -885,8 +885,10 @@ wbkgdset(stdscr, '\0' | COLOR_PAIR(GNT_COLOR_NORMAL)); refresh(); +#ifdef NCURSES_BUTTON_PRESSEDaa if ((mouse_enabled = gnt_style_get_bool(GNT_STYLE_MOUSE, FALSE))) - mousemask(NCURSES_BUTTON_PRESSED | NCURSES_BUTTON_RELEASED , NULL); + mousemask(NCURSES_BUTTON_PRESSED | NCURSES_BUTTON_RELEASED | REPORT_MOUSE_POSITION, NULL); +#endif wbkgdset(stdscr, '\0' | COLOR_PAIR(GNT_COLOR_NORMAL)); werase(stdscr); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <may...@us...> - 2006-08-23 17:01:45
|
Revision: 17006 Author: mayuan2006 Date: 2006-08-23 10:01:31 -0700 (Wed, 23 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=17006&view=rev Log Message: ----------- fix msg send bug tested ok on windows committed by MaYuan<may...@gm...> Modified Paths: -------------- branches/soc-2006-msnp13/src/protocols/msn/msg.c branches/soc-2006-msnp13/src/protocols/msn/notification.c Modified: branches/soc-2006-msnp13/src/protocols/msn/msg.c =================================================================== --- branches/soc-2006-msnp13/src/protocols/msn/msg.c 2006-08-23 16:36:58 UTC (rev 17005) +++ branches/soc-2006-msnp13/src/protocols/msn/msg.c 2006-08-23 17:01:31 UTC (rev 17006) @@ -468,16 +468,14 @@ } else { - if (body != NULL) - { + if (body != NULL){ memcpy(n, body, body_len); n += body_len; -// n = '\0'; + *n = '\0'; } } - if (ret_size != NULL) - { + if (ret_size != NULL){ *ret_size = n - base; if (*ret_size > 1664) Modified: branches/soc-2006-msnp13/src/protocols/msn/notification.c =================================================================== --- branches/soc-2006-msnp13/src/protocols/msn/notification.c 2006-08-23 16:36:58 UTC (rev 17005) +++ branches/soc-2006-msnp13/src/protocols/msn/notification.c 2006-08-23 17:01:31 UTC (rev 17006) @@ -419,7 +419,7 @@ gaim_debug_info("MaYuan","send UUM,payload{%s},strlen:%d,len:%d\n", payload,strlen(payload),payload_len); type = msg->type; - trans = msn_transaction_new(cmdproc, "UUM","%s 32 %d %d",msg->remote_user,type,strlen(payload)); + trans = msn_transaction_new(cmdproc, "UUM","%s 32 %d %d",msg->remote_user,type,payload_len); msn_transaction_set_payload(trans, payload, strlen(payload)); msn_cmdproc_send_trans(cmdproc, trans); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fac...@us...> - 2006-08-23 16:37:17
|
Revision: 17005 Author: faceprint Date: 2006-08-23 09:36:58 -0700 (Wed, 23 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=17005&view=rev Log Message: ----------- a prpl's set_idle function can be called before the login function this is because the signing-on signal is emitted, and there's a callback to check idle and update all the prpls attached to that signal this meant that if you were idle, and got disconnected from jabber, upon attempting to reconnect, you'd segfault I've changed how jabber handles idle updates to work around this. someone may want to audit the other prpls, to make sure their set_idle callbacks (if any) don't assume the connection is up Modified Paths: -------------- trunk/libgaim/protocols/jabber/iq.c trunk/libgaim/protocols/jabber/jabber.c trunk/libgaim/protocols/jabber/jabber.h Modified: trunk/libgaim/protocols/jabber/iq.c =================================================================== --- trunk/libgaim/protocols/jabber/iq.c 2006-08-23 16:25:54 UTC (rev 17004) +++ trunk/libgaim/protocols/jabber/iq.c 2006-08-23 16:36:58 UTC (rev 17005) @@ -145,7 +145,7 @@ const char *from; const char *id; xmlnode *query; - char *idle_time; + GaimPresence *gpresence; type = xmlnode_get_attrib(packet, "type"); from = xmlnode_get_attrib(packet, "from"); @@ -158,10 +158,19 @@ query = xmlnode_get_child(iq->node, "query"); - idle_time = g_strdup_printf("%ld", js->idle ? time(NULL) - js->idle : 0); - xmlnode_set_attrib(query, "seconds", idle_time); - g_free(idle_time); + gpresence = gaim_account_get_presence(js->gc->account); + if(gaim_presence_is_idle(gpresence)) { + time_t idle_time = gaim_presence_get_idle_time(gpresence); + char *idle_str; + + idle_str = g_strdup_printf("%ld", time(NULL) - idle_time); + xmlnode_set_attrib(query, "seconds", idle_str); + g_free(idle_str); + } else { + xmlnode_set_attrib(query, "seconds", "0"); + } + jabber_iq_send(iq); } } Modified: trunk/libgaim/protocols/jabber/jabber.c =================================================================== --- trunk/libgaim/protocols/jabber/jabber.c 2006-08-23 16:25:54 UTC (rev 17004) +++ trunk/libgaim/protocols/jabber/jabber.c 2006-08-23 16:36:58 UTC (rev 17005) @@ -1040,13 +1040,14 @@ return g_strdup_printf("gaim%x", js->next_id++); } - +/* static void jabber_idle_set(GaimConnection *gc, int idle) { JabberStream *js = gc->proto_data; js->idle = idle ? time(NULL) - idle : idle; } +*/ static const char *jabber_list_icon(GaimAccount *a, GaimBuddy *b) { @@ -1847,7 +1848,7 @@ jabber_send_typing, /* send_typing */ jabber_buddy_get_info, /* get_info */ jabber_presence_send, /* set_away */ - jabber_idle_set, /* set_idle */ + NULL, /* set_idle */ NULL, /* change_passwd */ jabber_roster_add_buddy, /* add_buddy */ NULL, /* add_buddies */ Modified: trunk/libgaim/protocols/jabber/jabber.h =================================================================== --- trunk/libgaim/protocols/jabber/jabber.h 2006-08-23 16:25:54 UTC (rev 17004) +++ trunk/libgaim/protocols/jabber/jabber.h 2006-08-23 16:36:58 UTC (rev 17005) @@ -111,8 +111,6 @@ GList *oob_file_transfers; GList *file_transfers; - time_t idle; - JabberID *user; GaimConnection *gc; GaimSslConnection *gsc; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <may...@us...> - 2006-08-23 16:26:15
|
Revision: 17004 Author: mayuan2006 Date: 2006-08-23 09:25:54 -0700 (Wed, 23 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=17004&view=rev Log Message: ----------- fix the windows bug of psm committed by MaYuan<may...@gm...> Modified Paths: -------------- branches/soc-2006-msnp13/src/protocols/msn/notification.c branches/soc-2006-msnp13/src/protocols/msn/state.c Modified: branches/soc-2006-msnp13/src/protocols/msn/notification.c =================================================================== --- branches/soc-2006-msnp13/src/protocols/msn/notification.c 2006-08-23 15:07:17 UTC (rev 17003) +++ branches/soc-2006-msnp13/src/protocols/msn/notification.c 2006-08-23 16:25:54 UTC (rev 17004) @@ -1406,9 +1406,6 @@ GaimAccount *account; GaimConnection *gc; MsnUser *user; - MsnObject *msnobj; - int clientid; - int wlmclient; const char *passport, *psm_str; /*get the payload content*/ @@ -1422,7 +1419,6 @@ user = msn_userlist_find_user(session->userlist, passport); psm_str = msn_get_psm(cmd->payload,len); - gaim_debug_info("Ma Yuan","got psm {%s}\n", psm_str); msn_user_set_statusline(user, psm_str); msn_user_update(user); Modified: branches/soc-2006-msnp13/src/protocols/msn/state.c =================================================================== --- branches/soc-2006-msnp13/src/protocols/msn/state.c 2006-08-23 15:07:17 UTC (rev 17003) +++ branches/soc-2006-msnp13/src/protocols/msn/state.c 2006-08-23 16:25:54 UTC (rev 17004) @@ -86,20 +86,20 @@ { xmlnode *payloadNode, *psmNode; char *psm_str,*psm; - + + gaim_debug_info("Ma Yuan","msn get PSM\n"); payloadNode = xmlnode_from_str(xml_str, len); if (!payloadNode){ gaim_debug_error("MaYuan","PSM XML parse Error!\n"); return NULL; } psmNode = xmlnode_get_child(payloadNode, "PSM"); - if (!psmNode){ + if (psmNode == NULL){ gaim_debug_info("Ma Yuan","No PSM status Node"); g_free(payloadNode); return NULL; } psm_str = xmlnode_get_data(psmNode); - gaim_debug_info("Ma Yuan","got PSM {%s}\n", psm_str); psm = g_strdup(psm_str); g_free(psmNode); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <may...@us...> - 2006-08-23 15:07:34
|
Revision: 17003 Author: mayuan2006 Date: 2006-08-23 08:07:17 -0700 (Wed, 23 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=17003&view=rev Log Message: ----------- add the PSM processing need to store the PSM info to XML. Thanks for Chris <ukd...@ya...> 's code! committed by MaYuan<may...@gm...> Modified Paths: -------------- branches/soc-2006-msnp13/src/protocols/msn/msn.c branches/soc-2006-msnp13/src/protocols/msn/notification.c branches/soc-2006-msnp13/src/protocols/msn/servconn.c branches/soc-2006-msnp13/src/protocols/msn/state.c branches/soc-2006-msnp13/src/protocols/msn/state.h branches/soc-2006-msnp13/src/protocols/msn/user.c branches/soc-2006-msnp13/src/protocols/msn/user.h Modified: branches/soc-2006-msnp13/src/protocols/msn/msn.c =================================================================== --- branches/soc-2006-msnp13/src/protocols/msn/msn.c 2006-08-23 14:49:40 UTC (rev 17002) +++ branches/soc-2006-msnp13/src/protocols/msn/msn.c 2006-08-23 15:07:17 UTC (rev 17003) @@ -517,20 +517,47 @@ *ne = emblems[3]; } +/* + * Set the User status text + * Add the PSM String Using "Name - PSM String" format + */ static char * msn_status_text(GaimBuddy *buddy) { GaimPresence *presence; GaimStatus *status; + char *msg, *psm_str, *tmp2, *text, *name; presence = gaim_buddy_get_presence(buddy); status = gaim_presence_get_active_status(presence); - if (!gaim_presence_is_available(presence) && !gaim_presence_is_idle(presence)) - { - return g_strdup(gaim_status_get_name(status)); + msg = gaim_status_get_attr_string(status, "message"); + if (!gaim_presence_is_available(presence) && !gaim_presence_is_idle(presence)){ + name = gaim_status_get_name(status); + }else{ + name = NULL; } + if (msg != NULL) { + tmp2 = gaim_markup_strip_html(msg); + if (name){ + psm_str = g_strdup_printf("%s - %s", name, tmp2); + g_free(tmp2); + }else{ + psm_str = tmp2; + } + text = g_markup_escape_text(psm_str, -1); + g_free(psm_str); + return text; + } else { + if (!gaim_presence_is_available(presence) && !gaim_presence_is_idle(presence)){ + psm_str = g_strdup(gaim_status_get_name(status)); + text = g_markup_escape_text(psm_str, -1); + g_free(psm_str); + return text; + } + } + return NULL; } @@ -574,29 +601,42 @@ { GaimStatusType *status; GList *types = NULL; - +#if 0 status = gaim_status_type_new_full(GAIM_STATUS_AVAILABLE, NULL, NULL, FALSE, TRUE, FALSE); +#endif + status = gaim_status_type_new_with_attrs( + GAIM_STATUS_AVAILABLE, NULL, NULL, TRUE, TRUE, FALSE, + "message", _("Message"), gaim_value_new(GAIM_TYPE_STRING), + NULL); types = g_list_append(types, status); - status = gaim_status_type_new_full(GAIM_STATUS_AWAY, - NULL, NULL, FALSE, TRUE, FALSE); + status = gaim_status_type_new_with_attrs( + GAIM_STATUS_AWAY, NULL, NULL, TRUE, TRUE, FALSE, + "message", _("Message"), gaim_value_new(GAIM_TYPE_STRING), + NULL); types = g_list_append(types, status); - status = gaim_status_type_new_full(GAIM_STATUS_AWAY, - "brb", _("Be Right Back"), FALSE, TRUE, FALSE); + status = gaim_status_type_new_with_attrs( + GAIM_STATUS_AWAY, "brb", _("Be Right Back"), TRUE, TRUE, FALSE, + "message", _("Message"), gaim_value_new(GAIM_TYPE_STRING), + NULL); types = g_list_append(types, status); - status = gaim_status_type_new_full(GAIM_STATUS_UNAVAILABLE, - "busy", _("Busy"), FALSE, TRUE, FALSE); + status = gaim_status_type_new_with_attrs( + GAIM_STATUS_AWAY, "busy", _("Busy"), TRUE, TRUE, FALSE, + "message", _("Message"), gaim_value_new(GAIM_TYPE_STRING), + NULL); types = g_list_append(types, status); - - status = gaim_status_type_new_full(GAIM_STATUS_UNAVAILABLE, - "phone", _("On the Phone"), FALSE, TRUE, FALSE); + status = gaim_status_type_new_with_attrs( + GAIM_STATUS_AWAY, "phone", _("On the Phone"), TRUE, TRUE, FALSE, + "message", _("Message"), gaim_value_new(GAIM_TYPE_STRING), + NULL); types = g_list_append(types, status); - - status = gaim_status_type_new_full(GAIM_STATUS_AWAY, - "lunch", _("Out to Lunch"), FALSE, TRUE, FALSE); + status = gaim_status_type_new_with_attrs( + GAIM_STATUS_AWAY, "lunch", _("Out to Lunch"), TRUE, TRUE, FALSE, + "message", _("Message"), gaim_value_new(GAIM_TYPE_STRING), + NULL); types = g_list_append(types, status); status = gaim_status_type_new_full(GAIM_STATUS_INVISIBLE, Modified: branches/soc-2006-msnp13/src/protocols/msn/notification.c =================================================================== --- branches/soc-2006-msnp13/src/protocols/msn/notification.c 2006-08-23 14:49:40 UTC (rev 17002) +++ branches/soc-2006-msnp13/src/protocols/msn/notification.c 2006-08-23 15:07:17 UTC (rev 17003) @@ -1393,12 +1393,40 @@ /*get the payload content*/ } +/* + * Get the UBX's PSM info + * Post it to the User status + * Thanks for Chris <ukd...@ya...>'s code + */ static void ubx_cmd_post(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload, size_t len) { + MsnSession *session; + GaimAccount *account; + GaimConnection *gc; + MsnUser *user; + MsnObject *msnobj; + int clientid; + int wlmclient; + const char *passport, *psm_str; + /*get the payload content*/ - gaim_debug_info("MaYuan","ubx{%s}\n",cmd->payload); + gaim_debug_info("MaYuan","UBX {%s} payload{%s}\n",cmd->params[0], cmd->payload); + + session = cmdproc->session; + account = session->account; + gc = gaim_account_get_connection(account); + + passport = cmd->params[0]; + user = msn_userlist_find_user(session->userlist, passport); + + psm_str = msn_get_psm(cmd->payload,len); + gaim_debug_info("Ma Yuan","got psm {%s}\n", psm_str); + msn_user_set_statusline(user, psm_str); + msn_user_update(user); + + g_free(psm_str); } static void Modified: branches/soc-2006-msnp13/src/protocols/msn/servconn.c =================================================================== --- branches/soc-2006-msnp13/src/protocols/msn/servconn.c 2006-08-23 14:49:40 UTC (rev 17002) +++ branches/soc-2006-msnp13/src/protocols/msn/servconn.c 2006-08-23 15:07:17 UTC (rev 17003) @@ -235,13 +235,12 @@ r = gaim_proxy_connect(session->account, host, port, connect_cb, servconn); - if (r == 0) - { + if (r == 0){ servconn->processing = TRUE; return TRUE; - } - else + }else{ return FALSE; + } } void Modified: branches/soc-2006-msnp13/src/protocols/msn/state.c =================================================================== --- branches/soc-2006-msnp13/src/protocols/msn/state.c 2006-08-23 14:49:40 UTC (rev 17002) +++ branches/soc-2006-msnp13/src/protocols/msn/state.c 2006-08-23 15:07:17 UTC (rev 17003) @@ -80,6 +80,34 @@ return result; } +/*get the PSM info from the XML string*/ +const char * +msn_get_psm(char *xml_str,gsize len) +{ + xmlnode *payloadNode, *psmNode; + char *psm_str,*psm; + + payloadNode = xmlnode_from_str(xml_str, len); + if (!payloadNode){ + gaim_debug_error("MaYuan","PSM XML parse Error!\n"); + return NULL; + } + psmNode = xmlnode_get_child(payloadNode, "PSM"); + if (!psmNode){ + gaim_debug_info("Ma Yuan","No PSM status Node"); + g_free(payloadNode); + return NULL; + } + psm_str = xmlnode_get_data(psmNode); + gaim_debug_info("Ma Yuan","got PSM {%s}\n", psm_str); + psm = g_strdup(psm_str); + + g_free(psmNode); + g_free(payloadNode); + + return psm; +} + void msn_set_psm(MsnSession *session) { Modified: branches/soc-2006-msnp13/src/protocols/msn/state.h =================================================================== --- branches/soc-2006-msnp13/src/protocols/msn/state.h 2006-08-23 14:49:40 UTC (rev 17002) +++ branches/soc-2006-msnp13/src/protocols/msn/state.h 2006-08-23 15:07:17 UTC (rev 17003) @@ -61,6 +61,9 @@ void msn_set_psm(MsnSession *session); +/*get the PSM info from the XML string*/ +const char * msn_get_psm(char *xml_str,gsize len); + MsnAwayType msn_state_from_account(GaimAccount *account); #endif /* _MSN_STATE_H_ */ Modified: branches/soc-2006-msnp13/src/protocols/msn/user.c =================================================================== --- branches/soc-2006-msnp13/src/protocols/msn/user.c 2006-08-23 14:49:40 UTC (rev 17002) +++ branches/soc-2006-msnp13/src/protocols/msn/user.c 2006-08-23 15:07:17 UTC (rev 17003) @@ -84,13 +84,19 @@ account = user->userlist->session->account; - if (user->status != NULL) + if (user->statusline != NULL) { + char *status = g_strdup_printf("%s - %s", user->status, user->statusline); + gaim_prpl_got_user_status(account, user->passport, user->status, "message", user->statusline, NULL); + } + else if (user->status != NULL) { gaim_prpl_got_user_status(account, user->passport, user->status, NULL); + } - if (user->idle) + if (user->idle){ gaim_prpl_got_user_idle(account, user->passport, TRUE, -1); - else + }else{ gaim_prpl_got_user_idle(account, user->passport, FALSE, 0); + } } void @@ -138,6 +144,15 @@ } void +msn_user_set_statusline(MsnUser *user, const char *statusline) +{ + g_return_if_fail(user != NULL); + + g_free(user->statusline); + user->statusline = g_strdup(statusline); +} + +void msn_user_set_store_name(MsnUser *user, const char *name) { g_return_if_fail(user != NULL); Modified: branches/soc-2006-msnp13/src/protocols/msn/user.h =================================================================== --- branches/soc-2006-msnp13/src/protocols/msn/user.h 2006-08-23 14:49:40 UTC (rev 17002) +++ branches/soc-2006-msnp13/src/protocols/msn/user.h 2006-08-23 15:07:17 UTC (rev 17003) @@ -48,6 +48,8 @@ char * uid; /*< User Id */ const char *status; /**< The state of the user. */ + const char *statusline; /**< The state of the user. */ + gboolean idle; /**< The idle state of the user. */ struct @@ -105,6 +107,14 @@ */ void msn_user_update(MsnUser *user); + /** + * Sets the new statusline of user. + * + * @param user The user. + * @param state The statusline string. + */ +void msn_user_set_statusline(MsnUser *user, const char *statusline); + /** * Sets the new state of user. * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dat...@us...> - 2006-08-23 14:49:50
|
Revision: 17002 Author: datallah Date: 2006-08-23 07:49:40 -0700 (Wed, 23 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=17002&view=rev Log Message: ----------- Fix the win32 method. I also changed the callback to be triggered asynchronously in the error case and had to add some supporting stuff. Modified Paths: -------------- trunk/libgaim/dnssrv.c Modified: trunk/libgaim/dnssrv.c =================================================================== --- trunk/libgaim/dnssrv.c 2006-08-23 13:46:51 UTC (rev 17001) +++ trunk/libgaim/dnssrv.c 2006-08-23 14:49:40 UTC (rev 17002) @@ -60,9 +60,8 @@ struct _GaimSrvQueryData { GaimSrvCallback cb; gpointer extradata; -#ifndef _WIN32 guint handle; -#else +#ifdef _WIN32 GThread *resolver; char *query; char *error_message; @@ -208,28 +207,34 @@ int size = 0; GaimSrvQueryData *query_data = data; - if (query_data->error_message != NULL) { + if(query_data->error_message != NULL) gaim_debug_error("dnssrv", query_data->error_message); - } else { - GaimSrvResponse *srvres_tmp; + else { + GaimSrvResponse *srvres_tmp = NULL; GSList *lst = query_data->results; size = g_slist_length(query_data->results); - srvres_tmp = srvres = g_new0(GaimSrvResponse, size); + if(query_data->cb) + srvres_tmp = srvres = g_new0(GaimSrvResponse, size); while (lst) { - memcpy(srvres_tmp++, lst->data, sizeof(GaimSrvResponse)); + if(query_data->cb) + memcpy(srvres_tmp++, lst->data, sizeof(GaimSrvResponse)); g_free(lst->data); lst = g_slist_remove(lst, lst->data); } - query_data->results = lst; + query_data->results = NULL; } gaim_debug_info("dnssrv", "found %d SRV entries\n", size); - query_data->cb(srvres, size, query_data->extradata); + if(query_data->cb) + query_data->cb(srvres, size, query_data->extradata); + query_data->resolver = NULL; + query_data->handle = 0; + gaim_srv_cancel(query_data); return FALSE; @@ -276,6 +281,7 @@ } /* back to main thread */ + /* Note: this should *not* be attached to query_data->handle - it will cause leakage */ g_idle_add(res_main_thread_cb, query_data); g_thread_exit(NULL); @@ -297,10 +303,10 @@ static gboolean initialized = FALSE; #endif -#ifndef _WIN32 query = g_strdup_printf("_%s._%s.%s", protocol, transport, domain); gaim_debug_info("dnssrv","querying SRV record for %s\n", query); +#ifndef _WIN32 if(pipe(in) || pipe(out)) { gaim_debug_error("dnssrv", "Could not create pipe\n"); g_free(query); @@ -346,25 +352,32 @@ initialized = TRUE; } - if (!MyDnsQuery_UTF8 || !MyDnsRecordListFree) { - gaim_debug_error("dnssrv", "System missing DNS API (Requires W2K+)\n"); - g_free(query); - cb(NULL, 0, extradata); - return NULL; - } - query_data = g_new0(GaimSrvQueryData, 1); query_data->cb = cb; query_data->query = query; query_data->extradata = extradata; + if (!MyDnsQuery_UTF8 || !MyDnsRecordListFree) { + query_data->error_message = g_strdup_printf("System missing DNS API (Requires W2K+)\n"); + + /* Asynchronously call the callback since stuff may not expect + * the callback to be called before this returns */ + query_data->handle = g_idle_add(res_main_thread_cb, query_data); + + return query_data; + } + query_data->resolver = g_thread_create(res_thread, query_data, FALSE, &err); if (query_data->resolver == NULL) { query_data->error_message = g_strdup_printf("SRV thread create failure: %s\n", err ? err->message : ""); g_error_free(err); - res_main_thread_cb(query_data); - return NULL; + + /* Asynchronously call the callback since stuff may not expect + * the callback to be called before this returns */ + query_data->handle = g_idle_add(res_main_thread_cb, query_data); + + return query_data; } return query_data; @@ -374,10 +387,9 @@ void gaim_srv_cancel(GaimSrvQueryData *query_data) { -#ifndef _WIN32 if (query_data->handle > 0) gaim_input_remove(query_data->handle); -#else +#ifdef _WIN32 if (query_data->resolver != NULL) { /* @@ -385,7 +397,7 @@ * just set the callback to NULL and let the DNS lookup * finish. */ - query_data->callback = NULL; + query_data->cb = NULL; return; } g_free(query_data->query); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-08-23 12:29:34
|
Revision: 17000 Author: sadrul Date: 2006-08-23 05:29:08 -0700 (Wed, 23 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=17000&view=rev Log Message: ----------- Add support for mouse. Currently you can: - click on the taskbar to bring a window on top - click on the topmost line of the *active* window and drag+drop to move the window. This is disabled by default. You can enable it by setting "mouse = 1" in ~/.gntrc. If you enable mouse support, then do shift+click to get the usual behaviours (eg. shift+middleclick to paste etc.) Modified Paths: -------------- trunk/console/libgnt/gntmain.c trunk/console/libgnt/gntstyle.c trunk/console/libgnt/gntstyle.h trunk/console/libgnt/test/keys.c Modified: trunk/console/libgnt/gntmain.c =================================================================== --- trunk/console/libgnt/gntmain.c 2006-08-23 10:48:21 UTC (rev 16999) +++ trunk/console/libgnt/gntmain.c 2006-08-23 12:29:08 UTC (rev 17000) @@ -31,6 +31,7 @@ static int Y_MAX; static gboolean ascii_only; +static gboolean mouse_enabled; static GMainLoop *loop; static struct @@ -480,7 +481,89 @@ gnt_screen_resize_widget(widget, nw, nh); } +/** + * Mouse support: + * - bring a window on top if you click on its taskbar + * - click on the top-bar of the active window and drag+drop to move a window + * wishlist: + * - have a little [X] on the windows, and clicking it will close that window. + * - click on a window to bring it to focus + * - allow scrolling in tree/textview on wheel-scroll event + * - click to activate button or select a row in tree + * - all these can be fulfilled by adding a "clicked" event for GntWidget + * which will send the (x,y) to the widget. (look at "key_pressed" for hints) + */ static gboolean +detect_mouse_action(const char *buffer) +{ + int x, y; + static enum { + MOUSE_NONE, + MOUSE_LEFT, + MOUSE_RIGHT, + MOUSE_MIDDLE + } button = MOUSE_NONE; + static GntWidget *remember = NULL; + static int offset = 0; + + if (buffer[0] != 27) + return FALSE; + + buffer++; + if (strlen(buffer) < 5) + return FALSE; + + x = buffer[3]; + y = buffer[4]; + if (x < 0) x += 256; + if (y < 0) y += 256; + x -= 33; + y -= 33; + + if (strncmp(buffer, "[M ", 3) == 0) { + /* left button down */ + /* If you clicked on the top-bar of the active window, then you can move it by dragging it */ + if (focus_list) { + GntWidget *wid = focus_list->data; + if (x >= wid->priv.x && x < wid->priv.x + wid->priv.width && + y == wid->priv.y) { + offset = x - wid->priv.x; + remember = wid; + button = MOUSE_LEFT; + } + } + } else if (strncmp(buffer, "[M\"", 3) == 0) { + /* right button down */ + } else if (strncmp(buffer, "[M!", 3) == 0) { + /* middle button down */ + } else if (strncmp(buffer, "[M`", 3) == 0) { + /* wheel up*/ + } else if (strncmp(buffer, "[Ma", 3) == 0) { + /* wheel down */ + } else if (strncmp(buffer, "[M#", 3) == 0) { + /* button up */ + if (button == MOUSE_NONE && y == getmaxy(stdscr) - 1) { + int n = g_list_length(g_list_first(focus_list)); + if (n) { + int width = getmaxx(stdscr) / n; + switch_window_n(x / width); + } + } else if (button == MOUSE_LEFT && remember) { + x -= offset; + if (x < 0) x = 0; + if (y < 0) y = 0; + gnt_screen_move_widget(remember, x, y); + refresh_node(remember, NULL, NULL); + } + button = MOUSE_NONE; + remember = NULL; + offset = 0; + } else + return FALSE; + return TRUE; +} + +static gboolean io_invoke(GIOChannel *source, GIOCondition cond, gpointer null) { char buffer[256]; @@ -511,6 +594,9 @@ gnt_keys_refine(buffer); + if (mouse_enabled && detect_mouse_action(buffer)) + return TRUE; + if (mode == GNT_KP_MODE_NORMAL) { if (focus_list) @@ -798,9 +884,10 @@ wbkgdset(stdscr, '\0' | COLOR_PAIR(GNT_COLOR_NORMAL)); refresh(); -#if 0 - mousemask(NCURSES_BUTTON_PRESSED | NCURSES_BUTTON_RELEASED | REPORT_MOUSE_POSITION, NULL); -#endif + + if ((mouse_enabled = gnt_style_get_bool(GNT_STYLE_MOUSE, FALSE))) + mousemask(NCURSES_BUTTON_PRESSED | NCURSES_BUTTON_RELEASED , NULL); + wbkgdset(stdscr, '\0' | COLOR_PAIR(GNT_COLOR_NORMAL)); werase(stdscr); wrefresh(stdscr); Modified: trunk/console/libgnt/gntstyle.c =================================================================== --- trunk/console/libgnt/gntstyle.c 2006-08-23 10:48:21 UTC (rev 16999) +++ trunk/console/libgnt/gntstyle.c 2006-08-23 12:29:08 UTC (rev 17000) @@ -142,6 +142,7 @@ GntStyle en; } styles[] = {{"shadow", GNT_STYLE_SHADOW}, {"customcolor", GNT_STYLE_COLOR}, + {"mouse", GNT_STYLE_MOUSE}, {NULL, 0}}; if (error) Modified: trunk/console/libgnt/gntstyle.h =================================================================== --- trunk/console/libgnt/gntstyle.h 2006-08-23 10:48:21 UTC (rev 16999) +++ trunk/console/libgnt/gntstyle.h 2006-08-23 12:29:08 UTC (rev 17000) @@ -4,6 +4,7 @@ { GNT_STYLE_SHADOW = 0, GNT_STYLE_COLOR = 1, + GNT_STYLE_MOUSE = 2, GNT_STYLES } GntStyle; Modified: trunk/console/libgnt/test/keys.c =================================================================== --- trunk/console/libgnt/test/keys.c 2006-08-23 10:48:21 UTC (rev 16999) +++ trunk/console/libgnt/test/keys.c 2006-08-23 12:29:08 UTC (rev 17000) @@ -10,7 +10,25 @@ gnt_entry_set_text(entry, s); g_free(s); if (text[0] == 27) - return FALSE; + { + if (strncmp(text + 1, "[M ", 3) == 0) + { + int x = (unsigned)text[4]; + int y = (unsigned)text[5]; + if (x < 0) x += 256; + if (y < 0) y += 256; + x -= 33; + y -= 33; + s = g_strdup_printf("ldown %d %d", x, y); + gnt_entry_set_text(entry, s); + g_free(s); + } + else if (strncmp(text + 1, "[M#", 3) == 0) + gnt_entry_set_text(entry, "up"); + else + return FALSE; + return TRUE; + } else return TRUE; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-08-23 10:48:30
|
Revision: 16999 Author: sadrul Date: 2006-08-23 03:48:21 -0700 (Wed, 23 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16999&view=rev Log Message: ----------- guard against possible crashes. Modified Paths: -------------- trunk/console/libgnt/gntentry.c Modified: trunk/console/libgnt/gntentry.c =================================================================== --- trunk/console/libgnt/gntentry.c 2006-08-23 08:02:05 UTC (rev 16998) +++ trunk/console/libgnt/gntentry.c 2006-08-23 10:48:21 UTC (rev 16999) @@ -19,7 +19,7 @@ get_onscreen_width(const char *start, const char *end) { wchar_t wch; - size_t size; + int size; int width = 0; while (start < end) { @@ -351,7 +351,7 @@ { char *s = get_beginning_of_word(entry); char *iter = text; - while (toupper(*s) == toupper(*iter)) + while (*iter && toupper(*s) == toupper(*iter)) { *s++ = *iter++; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-08-23 08:02:42
|
Revision: 16998 Author: thekingant Date: 2006-08-23 01:02:05 -0700 (Wed, 23 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16998&view=rev Log Message: ----------- Make gaim_srv_resolve cancelable. Please test and let me know of any problems. I was unable to test the WIN32 method for this, since it actually uses Windows stuff. Modified Paths: -------------- trunk/libgaim/dnssrv.c trunk/libgaim/dnssrv.h trunk/libgaim/protocols/jabber/jabber.c trunk/libgaim/protocols/jabber/jabber.h trunk/libgaim/protocols/simple/simple.c trunk/libgaim/protocols/simple/simple.h Modified: trunk/libgaim/dnssrv.c =================================================================== --- trunk/libgaim/dnssrv.c 2006-08-23 07:14:19 UTC (rev 16997) +++ trunk/libgaim/dnssrv.c 2006-08-23 08:02:05 UTC (rev 16998) @@ -57,19 +57,22 @@ DNS_FREE_TYPE FreeType) = NULL; #endif -struct resdata { - GaimSRVCallback cb; +struct _GaimSrvQueryData { + GaimSrvCallback cb; gpointer extradata; #ifndef _WIN32 guint handle; #else + GThread *resolver; char *query; - char *errmsg; + char *error_message; GSList *results; #endif }; -static gint responsecompare(gconstpointer ar, gconstpointer br) { +static gint +responsecompare(gconstpointer ar, gconstpointer br) +{ GaimSrvResponse *a = (GaimSrvResponse*)ar; GaimSrvResponse *b = (GaimSrvResponse*)br; @@ -84,8 +87,12 @@ return -1; return 1; } + #ifndef _WIN32 -static void resolve(int in, int out) { + +static void +resolve(int in, int out) +{ GList *ret = NULL; GaimSrvResponse *srvres; queryans answer; @@ -98,15 +105,14 @@ guint16 type, dlen, pref, weight, port; gchar query[256]; - if(read(in, query, 256) <= 0) { + if (read(in, query, 256) <= 0) _exit(0); - } + size = res_query( query, C_IN, T_SRV, (u_char*)&answer, sizeof( answer)); qdcount = ntohs(answer.hdr.qdcount); ancount = ntohs(answer.hdr.ancount); - cp = (guchar*)&answer + sizeof(HEADER); end = (guchar*)&answer + size; @@ -155,58 +161,60 @@ cp += dlen; } } -end: size = g_list_length(ret); + +end: + size = g_list_length(ret); write(out, &size, sizeof(int)); - while(g_list_first(ret)) { - write(out, g_list_first(ret)->data, sizeof(GaimSrvResponse)); - g_free(g_list_first(ret)->data); - ret = g_list_remove(ret, g_list_first(ret)->data); + while (ret != NULL) + { + write(out, ret->data, sizeof(GaimSrvResponse)); + g_free(ret->data); + ret = g_list_remove(ret, ret->data); } - /* Should the resolver be reused? - * There is most likely only 1 SRV queries per prpl... - */ _exit(0); } -static void resolved(gpointer data, gint source, GaimInputCondition cond) { +static void +resolved(gpointer data, gint source, GaimInputCondition cond) +{ int size; - struct resdata *rdata = (struct resdata*)data; + GaimSrvQueryData *query_data = (GaimSrvQueryData*)data; GaimSrvResponse *res; GaimSrvResponse *tmp; int i; - GaimSRVCallback cb = rdata->cb; + GaimSrvCallback cb = query_data->cb; read(source, &size, sizeof(int)); - gaim_debug_info("srv","found %d SRV entries\n", size); + gaim_debug_info("dnssrv","found %d SRV entries\n", size); tmp = res = g_new0(GaimSrvResponse, size); - i = size; - while(i) { + for (i = 0; i < size; i++) { read(source, tmp++, sizeof(GaimSrvResponse)); - i--; } - cb(res, size, rdata->extradata); - gaim_input_remove(rdata->handle); - g_free(rdata); + + cb(res, size, query_data->extradata); + + gaim_srv_cancel(query_data); } #else /* _WIN32 */ /** The Jabber Server code was inspiration for parts of this. */ -static gboolean res_main_thread_cb(gpointer data) { +static gboolean +res_main_thread_cb(gpointer data) +{ GaimSrvResponse *srvres = NULL; int size = 0; - struct resdata *rdata = data; + GaimSrvQueryData *query_data = data; - if (rdata->errmsg != NULL) { - gaim_debug_error("srv", rdata->errmsg); - g_free(rdata->errmsg); + if (query_data->error_message != NULL) { + gaim_debug_error("dnssrv", query_data->error_message); } else { GaimSrvResponse *srvres_tmp; - GSList *lst = rdata->results; + GSList *lst = query_data->results; - size = g_slist_length(rdata->results); + size = g_slist_length(query_data->results); srvres_tmp = srvres = g_new0(GaimSrvResponse, size); while (lst) { @@ -215,29 +223,30 @@ lst = g_slist_remove(lst, lst->data); } - rdata->results = lst; + query_data->results = lst; } - gaim_debug_info("srv", "found %d SRV entries\n", size); + gaim_debug_info("dnssrv", "found %d SRV entries\n", size); - rdata->cb(srvres, size, rdata->extradata); + query_data->cb(srvres, size, query_data->extradata); - g_free(rdata->query); - g_free(rdata); + gaim_srv_cancel(query_data); return FALSE; } -static gpointer res_thread(gpointer data) { +static gpointer +res_thread(gpointer data) +{ PDNS_RECORD dr = NULL; int type = DNS_TYPE_SRV; DNS_STATUS ds; - struct resdata *rdata = data; + GaimSrvQueryData *query_data = data; - ds = MyDnsQuery_UTF8(rdata->query, type, DNS_QUERY_STANDARD, NULL, &dr, NULL); + ds = MyDnsQuery_UTF8(query_data->query, type, DNS_QUERY_STANDARD, NULL, &dr, NULL); if (ds != ERROR_SUCCESS) { gchar *msg = g_win32_error_message(ds); - rdata->errmsg = g_strdup_printf("Couldn't look up SRV record. %s (%lu).\n", msg, ds); + query_data->error_message = g_strdup_printf("Couldn't look up SRV record. %s (%lu).\n", msg, ds); g_free(msg); } else { PDNS_RECORD dr_tmp; @@ -247,7 +256,7 @@ for (dr_tmp = dr; dr_tmp != NULL; dr_tmp = dr_tmp->pNext) { /* Discard any incorrect entries. I'm not sure if this is necessary */ - if (dr_tmp->wType != type || strcmp(dr_tmp->pName, rdata->query) != 0) { + if (dr_tmp->wType != type || strcmp(dr_tmp->pName, query_data->query) != 0) { continue; } @@ -263,11 +272,11 @@ } MyDnsRecordListFree(dr, DnsFreeRecordList); - rdata->results = lst; + query_data->results = lst; } /* back to main thread */ - g_idle_add(res_main_thread_cb, rdata); + g_idle_add(res_main_thread_cb, query_data); g_thread_exit(NULL); return NULL; @@ -275,36 +284,41 @@ #endif -/* - * TODO: It would be really good if this returned some sort of handle - * that we could use to cancel the DNS query. As it is now, - * each callback has to check to make sure gc is still valid. - * And that is ugly. - */ -void gaim_srv_resolve(const char *protocol, const char *transport, const char *domain, GaimSRVCallback cb, gpointer extradata) { - char *query = g_strdup_printf("_%s._%s.%s",protocol, transport, domain); - struct resdata *rdata; +GaimSrvQueryData * +gaim_srv_resolve(const char *protocol, const char *transport, const char *domain, GaimSrvCallback cb, gpointer extradata) +{ + char *query; + GaimSrvQueryData *query_data; #ifndef _WIN32 int in[2], out[2]; int pid; - gaim_debug_info("srv","querying SRV record for %s\n", query); +#else + GError* err = NULL; + static gboolean initialized = FALSE; +#endif + +#ifndef _WIN32 + query = g_strdup_printf("_%s._%s.%s", protocol, transport, domain); + gaim_debug_info("dnssrv","querying SRV record for %s\n", query); + if(pipe(in) || pipe(out)) { - gaim_debug_error("srv", "Could not create pipe\n"); + gaim_debug_error("dnssrv", "Could not create pipe\n"); g_free(query); cb(NULL, 0, extradata); - return; + return NULL; } pid = fork(); - - if(pid == -1) { - gaim_debug_error("srv","Could not create process!\n"); + if (pid == -1) { + gaim_debug_error("dnssrv", "Could not create process!\n"); cb(NULL, 0, extradata); g_free(query); - return; + return NULL; } + /* Child */ - if( pid == 0 ) { + if (pid == 0) + { close(out[0]); close(in[1]); resolve(in[0], out[1]); @@ -313,22 +327,18 @@ close(out[1]); close(in[0]); - if(write(in[1], query, strlen(query)+1)<0) { - gaim_debug_error("srv", "Could not write to SRV resolver\n"); - } - rdata = g_new0(struct resdata,1); - rdata->cb = cb; - rdata->extradata = extradata; - rdata->handle = gaim_input_add(out[0], GAIM_INPUT_READ, resolved, rdata); + if (write(in[1], query, strlen(query)+1) < 0) + gaim_debug_error("dnssrv", "Could not write to SRV resolver\n"); + query_data = g_new0(GaimSrvQueryData, 1); + query_data->cb = cb; + query_data->extradata = extradata; + query_data->handle = gaim_input_add(out[0], GAIM_INPUT_READ, resolved, query_data); + g_free(query); + + return query_data; #else - GError* err = NULL; - - static gboolean initialized = FALSE; - - gaim_debug_info("srv","querying SRV record for %s\n", query); - if (!initialized) { MyDnsQuery_UTF8 = (void*) wgaim_find_and_loadproc("dnsapi.dll", "DnsQuery_UTF8"); MyDnsRecordListFree = (void*) wgaim_find_and_loadproc( @@ -337,22 +347,49 @@ } if (!MyDnsQuery_UTF8 || !MyDnsRecordListFree) { - gaim_debug_error("srv", "System missing DNS API (Requires W2K+)\n"); + gaim_debug_error("dnssrv", "System missing DNS API (Requires W2K+)\n"); g_free(query); cb(NULL, 0, extradata); - return; + return NULL; } - rdata = g_new0(struct resdata, 1); - rdata->cb = cb; - rdata->query = query; - rdata->extradata = extradata; + query_data = g_new0(GaimSrvQueryData, 1); + query_data->cb = cb; + query_data->query = query; + query_data->extradata = extradata; - if (!g_thread_create(res_thread, rdata, FALSE, &err)) { - rdata->errmsg = g_strdup_printf("SRV thread create failure: %s\n", err ? err->message : ""); + query_data->resolver = g_thread_create(res_thread, query_data, FALSE, &err); + if (query_data->resolver == NULL) + { + query_data->error_message = g_strdup_printf("SRV thread create failure: %s\n", err ? err->message : ""); g_error_free(err); - res_main_thread_cb(rdata); + res_main_thread_cb(query_data); + return NULL; } + + return query_data; #endif } +void +gaim_srv_cancel(GaimSrvQueryData *query_data) +{ +#ifndef _WIN32 + if (query_data->handle > 0) + gaim_input_remove(query_data->handle); +#else + if (query_data->resolver != NULL) + { + /* + * It's not really possible to kill a thread. So instead we + * just set the callback to NULL and let the DNS lookup + * finish. + */ + query_data->callback = NULL; + return; + } + g_free(query_data->query); + g_free(query_data->error_message); +#endif + g_free(query_data); +} Modified: trunk/libgaim/dnssrv.h =================================================================== --- trunk/libgaim/dnssrv.h 2006-08-23 07:14:19 UTC (rev 16997) +++ trunk/libgaim/dnssrv.h 2006-08-23 08:02:05 UTC (rev 16998) @@ -1,10 +1,10 @@ /** * @file dnssrv.h - * + * * gaim * * Copyright (C) 2005, Thomas Butter <bu...@un...> - * + *i * 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 @@ -24,6 +24,7 @@ #define _GAIM_DNSSRV_H typedef struct _GaimSrvResponse GaimSrvResponse; +typedef struct _GaimSrvQueryData GaimSrvQueryData; struct _GaimSrvResponse { char hostname[256]; @@ -32,17 +33,24 @@ int pref; }; -typedef void (*GaimSRVCallback)(GaimSrvResponse *resp, int results, gpointer data); +typedef void (*GaimSrvCallback)(GaimSrvResponse *resp, int results, gpointer data); /** * Queries an SRV record. * * @param protocol Name of the protocol (e.g. "sip") * @param transport Name of the transport ("tcp" or "udp") - * @param domain Domainname to query (e.g. "blubb.com") + * @param domain Domain name to query (e.g. "blubb.com") * @param cb A callback which will be called with the results * @param extradata Extra data to be passed to the callback */ -void gaim_srv_resolve(const char *protocol, const char *transport, const char *domain, GaimSRVCallback cb, gpointer extradata); +GaimSrvQueryData *gaim_srv_resolve(const char *protocol, const char *transport, const char *domain, GaimSrvCallback cb, gpointer extradata); +/** + * Cancel an SRV DNS query. + * + * @param query_data The request to cancel. + */ +void gaim_srv_cancel(GaimSrvQueryData *query_data); + #endif /* _GAIM_DNSSRV_H */ Modified: trunk/libgaim/protocols/jabber/jabber.c =================================================================== --- trunk/libgaim/protocols/jabber/jabber.c 2006-08-23 07:14:19 UTC (rev 16997) +++ trunk/libgaim/protocols/jabber/jabber.c 2006-08-23 08:02:05 UTC (rev 16998) @@ -486,19 +486,11 @@ static void srv_resolved_cb(GaimSrvResponse *resp, int results, gpointer data) { - GaimConnection *gc; JabberStream *js; - gc = data; - if (!GAIM_CONNECTION_IS_VALID(gc)) - { - /* This connection has been closed */ - g_free(resp); - return; - } + js = data; + js->srv_query_data = NULL; - js = (JabberStream*)gc->proto_data; - if(results) { jabber_login_connect(js, resp->hostname, resp->port); g_free(resp); @@ -577,7 +569,8 @@ if(connect_server[0]) { jabber_login_connect(js, connect_server, gaim_account_get_int(account, "port", 5222)); } else { - gaim_srv_resolve("xmpp-client", "tcp", js->user->domain, srv_resolved_cb, gc); + js->srv_query_data = gaim_srv_resolve("xmpp-client", + "tcp", js->user->domain, srv_resolved_cb, js); } } } @@ -936,6 +929,9 @@ if (!gc->disconnect_timeout) jabber_send_raw(js, "</stream:stream>", -1); + if (js->srv_query_data) + gaim_srv_cancel(js->srv_query_data); + if (js->connect_data) gaim_proxy_connect_cancel(js->connect_data); Modified: trunk/libgaim/protocols/jabber/jabber.h =================================================================== --- trunk/libgaim/protocols/jabber/jabber.h 2006-08-23 07:14:19 UTC (rev 16997) +++ trunk/libgaim/protocols/jabber/jabber.h 2006-08-23 08:02:05 UTC (rev 16998) @@ -28,6 +28,7 @@ #include <glib.h> #include "circbuffer.h" #include "connection.h" +#include "dnssrv.h" #include "roomlist.h" #include "sslconn.h" @@ -67,6 +68,7 @@ { int fd; + GaimSrvQueryData *srv_query_data; GaimProxyConnectData *connect_data; #ifdef HAVE_LIBXML Modified: trunk/libgaim/protocols/simple/simple.c =================================================================== --- trunk/libgaim/protocols/simple/simple.c 2006-08-23 07:14:19 UTC (rev 16997) +++ trunk/libgaim/protocols/simple/simple.c 2006-08-23 08:02:05 UTC (rev 16998) @@ -1584,20 +1584,13 @@ } static void srvresolved(GaimSrvResponse *resp, int results, gpointer data) { - GaimConnection *gc; struct simple_account_data *sip; gchar *hostname; int port; - gc = data; - if (!GAIM_CONNECTION_IS_VALID(gc)) - { - /* This connection has been closed */ - g_free(resp); - return; - } + sip = data; + sip->srv_query_data = NULL; - sip = gc->proto_data; port = gaim_account_get_int(sip->account, "port", 0); /* find the host to connect to */ @@ -1682,12 +1675,8 @@ hosttoconnect = g_strdup(gaim_account_get_string(account, "proxy", sip->servername)); } - /* TCP case */ - if(!sip->udp) { - gaim_srv_resolve("sip", "tcp", hosttoconnect, srvresolved, gc); - } else { /* UDP */ - gaim_srv_resolve("sip", "udp", hosttoconnect, srvresolved, gc); - } + sip->srv_query_data = gaim_srv_resolve("sip", + sip->udp ? "udp" : "tcp", hosttoconnect, srvresolved, sip); g_free(hosttoconnect); } @@ -1703,6 +1692,9 @@ if (sip->query_data != NULL) gaim_dnsquery_destroy(sip->query_data); + if (sip->srv_query_data != NULL) + gaim_srv_cancel(sip->srv_query_data); + if (sip->listen_data != NULL) gaim_network_listen_cancel(sip->listen_data); Modified: trunk/libgaim/protocols/simple/simple.h =================================================================== --- trunk/libgaim/protocols/simple/simple.h 2006-08-23 07:14:19 UTC (rev 16997) +++ trunk/libgaim/protocols/simple/simple.h 2006-08-23 08:02:05 UTC (rev 16998) @@ -29,6 +29,7 @@ #include "cipher.h" #include "circbuffer.h" #include "dnsquery.h" +#include "dnssrv.h" #include "network.h" #include "proxy.h" #include "prpl.h" @@ -73,6 +74,7 @@ gchar *username; gchar *password; GaimDnsQueryData *query_data; + GaimSrvQueryData *srv_query_data; GaimNetworkListenData *listen_data; int fd; int cseq; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2006-08-23 07:14:23
|
Revision: 16997 Author: sadrul Date: 2006-08-23 00:14:19 -0700 (Wed, 23 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16997&view=rev Log Message: ----------- Double-width characters should work well in GntEntry's now. If it really works correctly, I can make necessary changes in textview and other places, so let me know. Modified Paths: -------------- trunk/console/libgnt/gntentry.c Modified: trunk/console/libgnt/gntentry.c =================================================================== --- trunk/console/libgnt/gntentry.c 2006-08-23 05:16:40 UTC (rev 16996) +++ trunk/console/libgnt/gntentry.c 2006-08-23 07:14:19 UTC (rev 16997) @@ -1,5 +1,7 @@ #include <ctype.h> +#include <stdlib.h> #include <string.h> +#include <wchar.h> #include "gntbox.h" #include "gntentry.h" @@ -13,6 +15,25 @@ static GntWidgetClass *parent_class = NULL; static guint signals[SIGS] = { 0 }; +static int +get_onscreen_width(const char *start, const char *end) +{ + wchar_t wch; + size_t size; + int width = 0; + + while (start < end) { + if ((size = mbtowc(&wch, start, end - start)) > 0) { + start += size; + width += wcwidth(wch); + } else { + ++width; + ++start; + } + } + return width; +} + static void destroy_suggest(GntEntry *entry) { @@ -51,7 +72,7 @@ char *s = get_beginning_of_word(entry); suggest = g_strndup(s, entry->cursor - s); if (entry->scroll < s) - offset = g_utf8_pointer_to_offset(entry->scroll, s); + offset = get_onscreen_width(entry->scroll, s); } else suggest = g_strdup(entry->start); @@ -118,14 +139,14 @@ g_utf8_pointer_to_offset(entry->scroll, entry->end)); } else - mvwprintw(widget->window, 0, 0, entry->scroll); + mvwprintw(widget->window, 0, 0, "%s", entry->scroll); - stop = g_utf8_pointer_to_offset(entry->scroll, entry->end); + stop = get_onscreen_width(entry->scroll, entry->end); if (stop < widget->priv.width) - mvwhline(widget->window, 0, stop, ENTRY_CHAR, widget->priv.width - stop); + whline(widget->window, ENTRY_CHAR, widget->priv.width - stop); if (focus) - mvwchgat(widget->window, 0, g_utf8_pointer_to_offset(entry->scroll, entry->cursor), + mvwchgat(widget->window, 0, get_onscreen_width(entry->scroll, entry->cursor), 1, A_REVERSE, COLOR_PAIR(GNT_COLOR_TEXT_NORMAL), NULL); DEBUG; @@ -173,7 +194,7 @@ if (entry->cursor >= entry->end) return; entry->cursor = g_utf8_find_next_char(entry->cursor, NULL); - if (g_utf8_pointer_to_offset(entry->scroll, entry->cursor) >= GNT_WIDGET(entry)->priv.width) + while (get_onscreen_width(entry->scroll, entry->cursor) >= GNT_WIDGET(entry)->priv.width) entry->scroll = g_utf8_find_next_char(entry->scroll, NULL); entry_redraw(GNT_WIDGET(entry)); } @@ -228,7 +249,7 @@ { entry->cursor = entry->end; /* This should be better than this */ - while (g_utf8_pointer_to_offset(entry->scroll, entry->cursor) >= GNT_WIDGET(entry)->priv.width) + while (get_onscreen_width(entry->scroll, entry->cursor) >= GNT_WIDGET(entry)->priv.width) entry->scroll = g_utf8_find_next_char(entry->scroll, NULL); entry_redraw(GNT_WIDGET(entry)); } @@ -389,7 +410,7 @@ str++; } - while (g_utf8_pointer_to_offset(entry->scroll, entry->cursor) >= widget->priv.width) + while (get_onscreen_width(entry->scroll, entry->cursor) >= widget->priv.width) entry->scroll = g_utf8_find_next_char(entry->scroll, NULL); if (entry->ddown) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |