Mercurial > pidgin.yaz
changeset 15515:75ffc646647f
Win32 de-gaimification of pidgin
author | Daniel Atallah <daniel.atallah@gmail.com> |
---|---|
date | Sat, 03 Feb 2007 18:46:49 +0000 |
parents | 760ef6d78d2d |
children | 3267c1cb5984 b15cc37605c4 |
files | pidgin/gtkconv.c pidgin/gtkft.c pidgin/gtkidle.c pidgin/gtklog.c pidgin/gtkmain.c pidgin/gtknotify.c pidgin/gtkprefs.c pidgin/gtkutils.c pidgin/plugins/win32/winprefs/winprefs.c pidgin/win32/IdleTracker/idletrack.c pidgin/win32/IdleTracker/idletrack.h pidgin/win32/gtkdocklet-win32.c pidgin/win32/gtkwin32dep.c pidgin/win32/gtkwin32dep.h pidgin/win32/winpidgin.c |
diffstat | 15 files changed, 170 insertions(+), 172 deletions(-) [+] |
line wrap: on
line diff
--- a/pidgin/gtkconv.c Sat Feb 03 09:24:33 2007 +0000 +++ b/pidgin/gtkconv.c Sat Feb 03 18:46:49 2007 +0000 @@ -7759,7 +7759,7 @@ #ifdef _WIN32 g_signal_connect(G_OBJECT(win->window), "show", - G_CALLBACK(gtkwgaim_ensure_onscreen), win->window); + G_CALLBACK(winpidgin_ensure_onscreen), win->window); #endif return win;
--- a/pidgin/gtkft.c Sat Feb 03 09:24:33 2007 +0000 +++ b/pidgin/gtkft.c Sat Feb 03 18:46:49 2007 +0000 @@ -881,7 +881,7 @@ #ifdef _WIN32 g_signal_connect(G_OBJECT(dialog->window), "show", - G_CALLBACK(gtkwgaim_ensure_onscreen), dialog->window); + G_CALLBACK(winpidgin_ensure_onscreen), dialog->window); #endif return dialog;
--- a/pidgin/gtkidle.c Sat Feb 03 09:24:33 2007 +0000 +++ b/pidgin/gtkidle.c Sat Feb 03 18:46:49 2007 +0000 @@ -97,7 +97,7 @@ # else # ifdef _WIN32 /* Query Windows */ - return (GetTickCount() - wgaim_get_lastactive()) / 1000; + return (GetTickCount() - winpidgin_get_lastactive()) / 1000; # else /* We're on X11 and not MacOS X with IOKit. */
--- a/pidgin/gtklog.c Sat Feb 03 09:24:33 2007 +0000 +++ b/pidgin/gtklog.c Sat Feb 03 18:46:49 2007 +0000 @@ -169,7 +169,7 @@ #ifdef _WIN32 if (resp == GTK_RESPONSE_HELP) { char *logdir = g_build_filename(gaim_user_dir(), "logs", NULL); - gtkwgaim_shell_execute(logdir, "explore", NULL); + winpidgin_shell_execute(logdir, "explore", NULL); g_free(logdir); return; }
--- a/pidgin/gtkmain.c Sat Feb 03 09:24:33 2007 +0000 +++ b/pidgin/gtkmain.c Sat Feb 03 18:46:49 2007 +0000 @@ -455,7 +455,7 @@ /* FUCKING GET ME A TOWEL! */ #ifdef _WIN32 -int gaim_main(HINSTANCE hint, int argc, char *argv[]) +int pidgin_main(HINSTANCE hint, int argc, char *argv[]) #else int main(int argc, char *argv[]) #endif @@ -688,7 +688,7 @@ } #ifdef _WIN32 - gtkwgaim_init(hint); + winpidgin_init(hint); #endif gaim_core_set_ui_ops(pidgin_core_get_ui_ops()); @@ -737,7 +737,7 @@ if (!strcmp(gaim_account_get_protocol_id(account), "prpl-oscar")) { if (isdigit(*gaim_account_get_username(account))) gaim_account_set_protocol_id(account, "prpl-icq"); - else + else gaim_account_set_protocol_id(account, "prpl-aim"); } } @@ -811,7 +811,7 @@ #endif #ifdef _WIN32 - gtkwgaim_post_init(); + winpidgin_post_init(); #endif gtk_main(); @@ -821,7 +821,7 @@ #endif #ifdef _WIN32 - gtkwgaim_cleanup(); + winpidgin_cleanup(); #endif return 0;
--- a/pidgin/gtknotify.c Sat Feb 03 09:24:33 2007 +0000 +++ b/pidgin/gtknotify.c Sat Feb 03 18:46:49 2007 +0000 @@ -1086,7 +1086,7 @@ g_free(command); #else /* !_WIN32 */ - gtkwgaim_notify_uri(uri); + winpidgin_notify_uri(uri); #endif /* !_WIN32 */ return NULL;
--- a/pidgin/gtkprefs.c Sat Feb 03 09:24:33 2007 +0000 +++ b/pidgin/gtkprefs.c Sat Feb 03 18:46:49 2007 +0000 @@ -491,7 +491,7 @@ g_free(path_escaped); g_free(destdir_escaped); #else - if(!gtkwgaim_gz_untar(path, destdir)) { + if(!winpidgin_gz_untar(path, destdir)) { g_free(destdir); return; }
--- a/pidgin/gtkutils.c Sat Feb 03 09:24:33 2007 +0000 +++ b/pidgin/gtkutils.c Sat Feb 03 18:46:49 2007 +0000 @@ -2889,7 +2889,7 @@ #if GTK_CHECK_VERSION(2,8,0) gtk_window_set_urgency_hint(window, urgent); #elif defined _WIN32 - gtkwgaim_window_flash(window, urgent); + winpidgin_window_flash(window, urgent); #else GdkWindow *gdkwin; XWMHints *hints;
--- a/pidgin/plugins/win32/winprefs/winprefs.c Sat Feb 03 09:24:33 2007 +0000 +++ b/pidgin/plugins/win32/winprefs/winprefs.c Sat Feb 03 18:46:49 2007 +0000 @@ -234,11 +234,11 @@ } static gboolean -gtkwgaim_conv_chat_blink(GaimAccount *account, const char *who, char **message, +winpidgin_conv_chat_blink(GaimAccount *account, const char *who, char **message, GaimConversation *conv, GaimMessageFlags flags, void *data) { if(gaim_prefs_get_bool(PREF_CHAT_BLINK)) - gtkwgaim_conv_blink(conv, flags); + winpidgin_conv_blink(conv, flags); return FALSE; } @@ -263,7 +263,7 @@ plugin, GAIM_CALLBACK(blist_create_cb), NULL); gaim_signal_connect(pidgin_conversations_get_handle(), - "displaying-chat-msg", plugin, GAIM_CALLBACK(gtkwgaim_conv_chat_blink), + "displaying-chat-msg", plugin, GAIM_CALLBACK(winpidgin_conv_chat_blink), NULL); gaim_signal_connect((void*)gaim_get_core(), "quitting", plugin,
--- a/pidgin/win32/IdleTracker/idletrack.c Sat Feb 03 09:24:33 2007 +0000 +++ b/pidgin/win32/IdleTracker/idletrack.c Sat Feb 03 18:46:49 2007 +0000 @@ -99,7 +99,7 @@ } -EXPORT DWORD wgaim_get_lastactive() { +EXPORT DWORD winpidgin_get_lastactive() { DWORD result = 0; /* If we have GetLastInputInfo then use it, otherwise use the hooks*/ @@ -122,7 +122,7 @@ } -EXPORT BOOL wgaim_set_idlehooks() { +EXPORT BOOL winpidgin_set_idlehooks() { /* Is GetLastInputInfo available?*/ g_user32 = LoadLibrary("user32.dll"); if(g_user32) { @@ -159,7 +159,7 @@ } -EXPORT void wgaim_remove_idlehooks() { +EXPORT void winpidgin_remove_idlehooks() { if(g_user32 != NULL) FreeLibrary(g_user32); if(keyHook)
--- a/pidgin/win32/IdleTracker/idletrack.h Sat Feb 03 09:24:33 2007 +0000 +++ b/pidgin/win32/IdleTracker/idletrack.h Sat Feb 03 18:46:49 2007 +0000 @@ -3,6 +3,6 @@ */ #include <windows.h> -DWORD wgaim_get_lastactive(void); -BOOL wgaim_set_idlehooks(void); -void wgaim_remove_idlehooks(void); +DWORD winpidgin_get_lastactive(void); +BOOL winpidgin_set_idlehooks(void); +void winpidgin_remove_idlehooks(void);
--- a/pidgin/win32/gtkdocklet-win32.c Sat Feb 03 09:24:33 2007 +0000 +++ b/pidgin/win32/gtkdocklet-win32.c Sat Feb 03 18:46:49 2007 +0000 @@ -1,11 +1,11 @@ /* - * System tray icon (aka docklet) plugin for Gaim + * System tray icon (aka docklet) plugin for Winpidgin * * Copyright (C) 2002-3 Robert McQueen <robot101@debian.org> * Copyright (C) 2003 Herman Bloggs <hermanator12002@yahoo.com> * Inspired by a similar plugin by: * John (J5) Palmieri <johnp@martianrock.com> - * + * * 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 @@ -15,7 +15,7 @@ * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA @@ -50,8 +50,7 @@ static HICON sysicon_pend = 0; static HICON sysicon_awypend = 0; static HICON sysicon_blank = 0; -static NOTIFYICONDATA wgaim_nid; - +static NOTIFYICONDATA _nicon_data; static LRESULT CALLBACK systray_mainmsg_handler(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { static UINT taskbarRestartMsg; /* static here means value is kept across multiple calls to this func */ @@ -91,7 +90,7 @@ if (msg == taskbarRestartMsg) { /* explorer crashed and left us hanging... This will put the systray icon back in it's place, when it restarts */ - Shell_NotifyIcon(NIM_ADD, &wgaim_nid); + Shell_NotifyIcon(NIM_ADD, &_nicon_data); } break; }/* end switch */ @@ -104,7 +103,7 @@ WNDCLASSEX wcex; LPCTSTR wname; - wname = TEXT("WingaimSystrayWinCls"); + wname = TEXT("WinpidginSystrayWinCls"); wcex.cbSize = sizeof(wcex); @@ -112,7 +111,7 @@ wcex.lpfnWndProc = systray_mainmsg_handler; wcex.cbClsExtra = 0; wcex.cbWndExtra = 0; - wcex.hInstance = gtkwgaim_hinstance(); + wcex.hInstance = winpidgin_hinstance(); wcex.hIcon = NULL; wcex.hCursor = NULL, wcex.hbrBackground = NULL; @@ -123,32 +122,32 @@ RegisterClassEx(&wcex); /* Create the window */ - return (CreateWindow(wname, "", 0, 0, 0, 0, 0, GetDesktopWindow(), NULL, gtkwgaim_hinstance(), 0)); + return (CreateWindow(wname, "", 0, 0, 0, 0, 0, GetDesktopWindow(), NULL, winpidgin_hinstance(), 0)); } static void systray_init_icon(HWND hWnd, HICON icon) { - ZeroMemory(&wgaim_nid, sizeof(wgaim_nid)); - wgaim_nid.cbSize = sizeof(NOTIFYICONDATA); - wgaim_nid.hWnd = hWnd; - wgaim_nid.uID = 0; - wgaim_nid.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP; - wgaim_nid.uCallbackMessage = WM_TRAYMESSAGE; - wgaim_nid.hIcon = icon; - lstrcpy(wgaim_nid.szTip, PIDGIN_NAME); - Shell_NotifyIcon(NIM_ADD, &wgaim_nid); + ZeroMemory(&_nicon_data, sizeof(_nicon_data)); + _nicon_data.cbSize = sizeof(NOTIFYICONDATA); + _nicon_data.hWnd = hWnd; + _nicon_data.uID = 0; + _nicon_data.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP; + _nicon_data.uCallbackMessage = WM_TRAYMESSAGE; + _nicon_data.hIcon = icon; + lstrcpy(_nicon_data.szTip, PIDGIN_NAME); + Shell_NotifyIcon(NIM_ADD, &_nicon_data); pidgin_docklet_embedded(); } static void systray_change_icon(HICON icon) { - wgaim_nid.hIcon = icon; - Shell_NotifyIcon(NIM_MODIFY, &wgaim_nid); + _nicon_data.hIcon = icon; + Shell_NotifyIcon(NIM_MODIFY, &_nicon_data); } static void systray_remove_nid(void) { - Shell_NotifyIcon(NIM_DELETE, &wgaim_nid); + Shell_NotifyIcon(NIM_DELETE, &_nicon_data); } -static void wgaim_tray_update_icon(DockletStatus icon) { +static void winpidgin_tray_update_icon(DockletStatus icon) { switch (icon) { case DOCKLET_STATUS_OFFLINE: systray_change_icon(sysicon_disconn); @@ -170,32 +169,32 @@ } } -static void wgaim_tray_blank_icon() { +static void winpidgin_tray_blank_icon() { systray_change_icon(sysicon_blank); } -static void wgaim_tray_set_tooltip(gchar *tooltip) { +static void winpidgin_tray_set_tooltip(gchar *tooltip) { if (tooltip) { char *locenc = NULL; locenc = g_locale_from_utf8(tooltip, -1, NULL, NULL, NULL); - lstrcpyn(wgaim_nid.szTip, locenc, sizeof(wgaim_nid.szTip) / sizeof(TCHAR)); + lstrcpyn(_nicon_data.szTip, locenc, sizeof(_nicon_data.szTip) / sizeof(TCHAR)); g_free(locenc); } else { - lstrcpy(wgaim_nid.szTip, PIDGIN_NAME); + lstrcpy(_nicon_data.szTip, PIDGIN_NAME); } - Shell_NotifyIcon(NIM_MODIFY, &wgaim_nid); + Shell_NotifyIcon(NIM_MODIFY, &_nicon_data); } -static void wgaim_tray_minimize(PidginBuddyList *gtkblist) { +static void winpidgin_tray_minimize(PidginBuddyList *gtkblist) { MinimizeWndToTray(GDK_WINDOW_HWND(gtkblist->window->window)); } -static void wgaim_tray_maximize(PidginBuddyList *gtkblist) { +static void winpidgin_tray_maximize(PidginBuddyList *gtkblist) { RestoreWndFromTray(GDK_WINDOW_HWND(gtkblist->window->window)); } -static void wgaim_tray_create() { +static void winpidgin_tray_create() { OSVERSIONINFO osinfo; /* dummy window to process systray messages */ systray_hwnd = systray_create_hiddenwin(); @@ -211,48 +210,48 @@ if ((osinfo.dwMajorVersion == 5 && osinfo.dwMinorVersion > 0) || (osinfo.dwMajorVersion >= 6)) { - sysicon_disconn = (HICON)LoadImage(gtkwgaim_hinstance(), MAKEINTRESOURCE(GAIM_OFFLINE_TRAY_ICON), IMAGE_ICON, 16, 16, 0); - sysicon_conn = (HICON)LoadImage(gtkwgaim_hinstance(), MAKEINTRESOURCE(GAIM_TRAY_ICON), IMAGE_ICON, 16, 16, 0); - sysicon_away = (HICON)LoadImage(gtkwgaim_hinstance(), MAKEINTRESOURCE(GAIM_AWAY_TRAY_ICON), IMAGE_ICON, 16, 16, 0); - sysicon_pend = (HICON)LoadImage(gtkwgaim_hinstance(), MAKEINTRESOURCE(GAIM_PEND_TRAY_ICON), IMAGE_ICON, 16, 16, 0); - sysicon_awypend = (HICON)LoadImage(gtkwgaim_hinstance(), MAKEINTRESOURCE(GAIM_AWAYPEND_TRAY_ICON), IMAGE_ICON, 16, 16, 0); + sysicon_disconn = (HICON)LoadImage(winpidgin_hinstance(), MAKEINTRESOURCE(GAIM_OFFLINE_TRAY_ICON), IMAGE_ICON, 16, 16, 0); + sysicon_conn = (HICON)LoadImage(winpidgin_hinstance(), MAKEINTRESOURCE(GAIM_TRAY_ICON), IMAGE_ICON, 16, 16, 0); + sysicon_away = (HICON)LoadImage(winpidgin_hinstance(), MAKEINTRESOURCE(GAIM_AWAY_TRAY_ICON), IMAGE_ICON, 16, 16, 0); + sysicon_pend = (HICON)LoadImage(winpidgin_hinstance(), MAKEINTRESOURCE(GAIM_PEND_TRAY_ICON), IMAGE_ICON, 16, 16, 0); + sysicon_awypend = (HICON)LoadImage(winpidgin_hinstance(), MAKEINTRESOURCE(GAIM_AWAYPEND_TRAY_ICON), IMAGE_ICON, 16, 16, 0); } else { - sysicon_disconn = (HICON)LoadImage(gtkwgaim_hinstance(), MAKEINTRESOURCE(GAIM_OFFLINE_TRAY_ICON_4BIT), IMAGE_ICON, 16, 16, 0); - sysicon_conn = (HICON)LoadImage(gtkwgaim_hinstance(), MAKEINTRESOURCE(GAIM_TRAY_ICON_4BIT), IMAGE_ICON, 16, 16, 0); - sysicon_away = (HICON)LoadImage(gtkwgaim_hinstance(), MAKEINTRESOURCE(GAIM_AWAY_TRAY_ICON_4BIT), IMAGE_ICON, 16, 16, 0); - sysicon_pend = (HICON)LoadImage(gtkwgaim_hinstance(), MAKEINTRESOURCE(GAIM_PEND_TRAY_ICON_4BIT), IMAGE_ICON, 16, 16, 0); - sysicon_awypend = (HICON)LoadImage(gtkwgaim_hinstance(), MAKEINTRESOURCE(GAIM_AWAYPEND_TRAY_ICON_4BIT), IMAGE_ICON, 16, 16, 0); + sysicon_disconn = (HICON)LoadImage(winpidgin_hinstance(), MAKEINTRESOURCE(GAIM_OFFLINE_TRAY_ICON_4BIT), IMAGE_ICON, 16, 16, 0); + sysicon_conn = (HICON)LoadImage(winpidgin_hinstance(), MAKEINTRESOURCE(GAIM_TRAY_ICON_4BIT), IMAGE_ICON, 16, 16, 0); + sysicon_away = (HICON)LoadImage(winpidgin_hinstance(), MAKEINTRESOURCE(GAIM_AWAY_TRAY_ICON_4BIT), IMAGE_ICON, 16, 16, 0); + sysicon_pend = (HICON)LoadImage(winpidgin_hinstance(), MAKEINTRESOURCE(GAIM_PEND_TRAY_ICON_4BIT), IMAGE_ICON, 16, 16, 0); + sysicon_awypend = (HICON)LoadImage(winpidgin_hinstance(), MAKEINTRESOURCE(GAIM_AWAYPEND_TRAY_ICON_4BIT), IMAGE_ICON, 16, 16, 0); } - sysicon_blank = (HICON)LoadImage(gtkwgaim_hinstance(), MAKEINTRESOURCE(GAIM_BLANK_TRAY_ICON), IMAGE_ICON, 16, 16, 0); + sysicon_blank = (HICON)LoadImage(winpidgin_hinstance(), MAKEINTRESOURCE(GAIM_BLANK_TRAY_ICON), IMAGE_ICON, 16, 16, 0); /* Create icon in systray */ systray_init_icon(systray_hwnd, sysicon_disconn); gaim_signal_connect(pidgin_blist_get_handle(), "gtkblist-hiding", - pidgin_docklet_get_handle(), GAIM_CALLBACK(wgaim_tray_minimize), NULL); + pidgin_docklet_get_handle(), GAIM_CALLBACK(winpidgin_tray_minimize), NULL); gaim_signal_connect(pidgin_blist_get_handle(), "gtkblist-unhiding", - pidgin_docklet_get_handle(), GAIM_CALLBACK(wgaim_tray_maximize), NULL); + pidgin_docklet_get_handle(), GAIM_CALLBACK(winpidgin_tray_maximize), NULL); gaim_debug(GAIM_DEBUG_INFO, "docklet", "created\n"); } -static void wgaim_tray_destroy() { +static void winpidgin_tray_destroy() { systray_remove_nid(); DestroyWindow(systray_hwnd); pidgin_docklet_remove(); } -static struct docklet_ui_ops wgaim_tray_ops = +static struct docklet_ui_ops winpidgin_tray_ops = { - wgaim_tray_create, - wgaim_tray_destroy, - wgaim_tray_update_icon, - wgaim_tray_blank_icon, - wgaim_tray_set_tooltip, + winpidgin_tray_create, + winpidgin_tray_destroy, + winpidgin_tray_update_icon, + winpidgin_tray_blank_icon, + winpidgin_tray_set_tooltip, NULL }; /* Used by docklet's plugin load func */ void docklet_ui_init() { - pidgin_docklet_set_ui_ops(&wgaim_tray_ops); + pidgin_docklet_set_ui_ops(&winpidgin_tray_ops); }
--- a/pidgin/win32/gtkwin32dep.c Sat Feb 03 09:24:33 2007 +0000 +++ b/pidgin/win32/gtkwin32dep.c Sat Feb 03 18:46:49 2007 +0000 @@ -1,11 +1,10 @@ -/* - * gaim +/** + * @file gtkwin32dep.c UI Win32 Specific Functionality + * @ingroup win32 * - * File: gtkwin32dep.c - * Date: June, 2002 - * Description: Windows dependant code for Gaim - * - * Copyright (C) 2002-2003, Herman Bloggs <hermanator12002@yahoo.com> + * Pidgin is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * source distribution. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -55,8 +54,8 @@ /* * GLOBALS */ -HINSTANCE gaimexe_hInstance = 0; -HINSTANCE gtkgaimdll_hInstance = 0; +HINSTANCE exe_hInstance = 0; +HINSTANCE dll_hInstance = 0; HWND messagewin_hwnd; static int gtkwin32_handle; @@ -68,11 +67,11 @@ * PUBLIC CODE */ -HINSTANCE gtkwgaim_hinstance(void) { - return gaimexe_hInstance; +HINSTANCE winpidgin_hinstance(void) { + return exe_hInstance; } -int gtkwgaim_gz_decompress(const char* in, const char* out) { +int winpidgin_gz_decompress(const char* in, const char* out) { gzFile fin; FILE *fout; char buf[1024]; @@ -80,13 +79,13 @@ if((fin = gzopen(in, "rb"))) { if(!(fout = g_fopen(out, "wb"))) { - gaim_debug_error("gtkwgaim_gz_decompress", "Error opening file: %s\n", out); + gaim_debug_error("winpidgin_gz_decompress", "Error opening file: %s\n", out); gzclose(fin); return 0; } } else { - gaim_debug_error("gtkwgaim_gz_decompress", "gzopen failed to open: %s\n", in); + gaim_debug_error("winpidgin_gz_decompress", "gzopen failed to open: %s\n", in); return 0; } @@ -102,36 +101,36 @@ gzclose(fin); if(ret < 0) { - gaim_debug_error("gtkwgaim_gz_decompress", "gzread failed while reading: %s\n", in); + gaim_debug_error("winpidgin_gz_decompress", "gzread failed while reading: %s\n", in); return 0; } return 1; } -int gtkwgaim_gz_untar(const char* filename, const char* destdir) { +int winpidgin_gz_untar(const char* filename, const char* destdir) { char tmpfile[_MAX_PATH]; - char template[]="wgaimXXXXXX"; + char template[]="wpidginXXXXXX"; sprintf(tmpfile, "%s%s%s", g_get_tmp_dir(), G_DIR_SEPARATOR_S, _mktemp(template)); - if(gtkwgaim_gz_decompress(filename, tmpfile)) { + if(winpidgin_gz_decompress(filename, tmpfile)) { int ret; if(untar(tmpfile, destdir, UNTAR_FORCE | UNTAR_QUIET)) ret = 1; else { - gaim_debug_error("gtkwgaim_gz_untar", "Failure untarring %s\n", tmpfile); + gaim_debug_error("winpidgin_gz_untar", "Failure untarring %s\n", tmpfile); ret = 0; } g_unlink(tmpfile); return ret; } else { - gaim_debug_error("gtkwgaim_gz_untar", "Failed to gz decompress %s\n", filename); + gaim_debug_error("winpidgin_gz_untar", "Failed to gz decompress %s\n", filename); return 0; } } -void gtkwgaim_shell_execute(const char *target, const char *verb, const char *clazz) { +void winpidgin_shell_execute(const char *target, const char *verb, const char *clazz) { g_return_if_fail(target != NULL); g_return_if_fail(verb != NULL); @@ -155,7 +154,7 @@ } if(!ShellExecuteExW(&wsinfo)) - gaim_debug_error("gtkwgaim", "Error opening URI: %s error: %d\n", + gaim_debug_error("winpidgin", "Error opening URI: %s error: %d\n", target, (int) wsinfo.hInstApp); g_free(w_uri); @@ -178,7 +177,7 @@ } if(!ShellExecuteExA(&sinfo)) - gaim_debug_error("gtkwgaim", "Error opening URI: %s error: %d\n", + gaim_debug_error("winpidgin", "Error opening URI: %s error: %d\n", target, (int) sinfo.hInstApp); g_free(locale_uri); @@ -186,11 +185,11 @@ } -void gtkwgaim_notify_uri(const char *uri) { +void winpidgin_notify_uri(const char *uri) { /* We'll allow whatever URI schemes are supported by the * default http browser. */ - gtkwgaim_shell_execute(uri, "open", "http"); + winpidgin_shell_execute(uri, "open", "http"); } #define WM_FOCUS_REQUEST (WM_APP + 13) @@ -198,7 +197,7 @@ static LRESULT CALLBACK message_window_handler(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { if (msg == WM_FOCUS_REQUEST) { - gaim_debug_info("gtkwgaim", "Got external Buddy List focus request."); + gaim_debug_info("winpidgin", "Got external Buddy List focus request."); gaim_blist_set_visible(TRUE); return TRUE; } @@ -206,19 +205,19 @@ return DefWindowProc(hwnd, msg, wparam, lparam); } -static HWND wgaim_message_window_init(void) { +static HWND winpidgin_message_window_init(void) { HWND win_hwnd; WNDCLASSEX wcx; LPCTSTR wname; - wname = TEXT("WingaimMsgWinCls"); + wname = TEXT("WinpidginMsgWinCls"); wcx.cbSize = sizeof(wcx); wcx.style = 0; wcx.lpfnWndProc = message_window_handler; wcx.cbClsExtra = 0; wcx.cbWndExtra = 0; - wcx.hInstance = gtkwgaim_hinstance(); + wcx.hInstance = winpidgin_hinstance(); wcx.hIcon = NULL; wcx.hCursor = NULL; wcx.hbrBackground = NULL; @@ -229,9 +228,9 @@ RegisterClassEx(&wcx); /* Create the window */ - if(!(win_hwnd = CreateWindow(wname, TEXT("WingaimMsgWin"), 0, 0, 0, 0, 0, - NULL, NULL, gtkwgaim_hinstance(), 0))) { - gaim_debug_error("gtkwgaim", + if(!(win_hwnd = CreateWindow(wname, TEXT("WinpidginMsgWin"), 0, 0, 0, 0, 0, + NULL, NULL, winpidgin_hinstance(), 0))) { + gaim_debug_error("winpidgin", "Unable to create message window.\n"); return NULL; } @@ -241,12 +240,12 @@ static gboolean stop_flashing(GtkWidget *widget, GdkEventFocus *event, gpointer data) { GtkWindow *window = data; - gtkwgaim_window_flash(window, FALSE); + winpidgin_window_flash(window, FALSE); return FALSE; } void -gtkwgaim_window_flash(GtkWindow *window, gboolean flash) { +winpidgin_window_flash(GtkWindow *window, gboolean flash) { GdkWindow * gdkwin; g_return_if_fail(window != NULL); @@ -278,7 +277,7 @@ } void -gtkwgaim_conv_blink(GaimConversation *conv, GaimMessageFlags flags) { +winpidgin_conv_blink(GaimConversation *conv, GaimMessageFlags flags) { PidginWindow *win; GtkWindow *window; @@ -287,99 +286,99 @@ return; if(conv == NULL) { - gaim_debug_info("gtkwgaim", "No conversation found to blink.\n"); + gaim_debug_info("winpidgin", "No conversation found to blink.\n"); return; } win = pidgin_conv_get_window(PIDGIN_CONVERSATION(conv)); if(win == NULL) { - gaim_debug_info("gtkwgaim", "No conversation windows found to blink.\n"); + gaim_debug_info("winpidgin", "No conversation windows found to blink.\n"); return; } window = GTK_WINDOW(win->window); - gtkwgaim_window_flash(window, TRUE); + winpidgin_window_flash(window, TRUE); /* Stop flashing when window receives focus */ g_signal_connect(G_OBJECT(window), "focus-in-event", G_CALLBACK(stop_flashing), window); } static gboolean -gtkwgaim_conv_im_blink(GaimAccount *account, const char *who, char **message, +winpidgin_conv_im_blink(GaimAccount *account, const char *who, char **message, GaimConversation *conv, GaimMessageFlags flags, void *data) { if (gaim_prefs_get_bool("/gaim/gtk/win32/blink_im")) - gtkwgaim_conv_blink(conv, flags); + winpidgin_conv_blink(conv, flags); return FALSE; } -void gtkwgaim_init(HINSTANCE hint) { +void winpidgin_init(HINSTANCE hint) { - gaim_debug_info("gtkwgaim", "gtkwgaim_init start\n"); + gaim_debug_info("winpidgin", "winpidgin_init start\n"); - gaimexe_hInstance = hint; + exe_hInstance = hint; /* IdleTracker Initialization */ - if(!wgaim_set_idlehooks()) - gaim_debug_error("gtkwgaim", "Failed to initialize idle tracker\n"); + if(!winpidgin_set_idlehooks()) + gaim_debug_error("winpidgin", "Failed to initialize idle tracker\n"); wpidginspell_init(); - gaim_debug_info("gtkwgaim", "GTK+ :%u.%u.%u\n", + gaim_debug_info("winpidgin", "GTK+ :%u.%u.%u\n", gtk_major_version, gtk_minor_version, gtk_micro_version); - messagewin_hwnd = wgaim_message_window_init(); + messagewin_hwnd = winpidgin_message_window_init(); MyFlashWindowEx = (LPFNFLASHWINDOWEX) wgaim_find_and_loadproc("user32.dll", "FlashWindowEx"); - gaim_debug_info("gtkwgaim", "gtkwgaim_init end\n"); + gaim_debug_info("winpidgin", "winpidgin_init end\n"); } -void gtkwgaim_post_init(void) { +void winpidgin_post_init(void) { gaim_prefs_add_none("/gaim/gtk/win32"); gaim_prefs_add_bool("/gaim/gtk/win32/blink_im", TRUE); gaim_signal_connect(pidgin_conversations_get_handle(), - "displaying-im-msg", >kwin32_handle, GAIM_CALLBACK(gtkwgaim_conv_im_blink), + "displaying-im-msg", >kwin32_handle, GAIM_CALLBACK(winpidgin_conv_im_blink), NULL); } /* Windows Cleanup */ -void gtkwgaim_cleanup(void) { - gaim_debug_info("gtkwgaim", "gtkwgaim_cleanup\n"); +void winpidgin_cleanup(void) { + gaim_debug_info("winpidgin", "winpidgin_cleanup\n"); if(messagewin_hwnd) DestroyWindow(messagewin_hwnd); /* Idle tracker cleanup */ - wgaim_remove_idlehooks(); + winpidgin_remove_idlehooks(); } /* DLL initializer */ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { - gtkgaimdll_hInstance = hinstDLL; + dll_hInstance = hinstDLL; return TRUE; } -typedef HMONITOR WINAPI gaim_MonitorFromWindow(HWND, DWORD); -typedef BOOL WINAPI gaim_GetMonitorInfo(HMONITOR, LPMONITORINFO); +typedef HMONITOR WINAPI _MonitorFromWindow(HWND, DWORD); +typedef BOOL WINAPI _GetMonitorInfo(HMONITOR, LPMONITORINFO); static gboolean get_WorkingAreaRectForWindow(HWND hwnd, RECT *workingAreaRc) { - static gaim_MonitorFromWindow *the_MonitorFromWindow; - static gaim_GetMonitorInfo *the_GetMonitorInfo; + static _MonitorFromWindow *the_MonitorFromWindow; + static _GetMonitorInfo *the_GetMonitorInfo; static gboolean initialized = FALSE; HMONITOR monitor; MONITORINFO info; if(!initialized) { - the_MonitorFromWindow = (gaim_MonitorFromWindow*) + the_MonitorFromWindow = (_MonitorFromWindow*) wgaim_find_and_loadproc("user32", "MonitorFromWindow"); - the_GetMonitorInfo = (gaim_GetMonitorInfo*) + the_GetMonitorInfo = (_GetMonitorInfo*) wgaim_find_and_loadproc("user32", "GetMonitorInfoA"); initialized = TRUE; } @@ -400,7 +399,7 @@ return TRUE; } -void gtkwgaim_ensure_onscreen(GtkWidget *win) { +void winpidgin_ensure_onscreen(GtkWidget *win) { RECT windowRect, workingAreaRect, intersectionRect; HWND hwnd = GDK_WINDOW_HWND(win->window);
--- a/pidgin/win32/gtkwin32dep.h Sat Feb 03 09:24:33 2007 +0000 +++ b/pidgin/win32/gtkwin32dep.h Sat Feb 03 18:46:49 2007 +0000 @@ -1,9 +1,10 @@ -/* - * gaim +/** + * @file gtkwin32dep.h UI Win32 Specific Functionality + * @ingroup win32 * - * File: win32dep.h - * - * Copyright (C) 2002-2003, Herman Bloggs <hermanator12002@yahoo.com> + * Pidgin is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * source distribution * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,7 +19,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * */ #ifndef _GTKWIN32DEP_H_ #define _GTKWIN32DEP_H_ @@ -26,23 +26,23 @@ #include <gtk/gtk.h> #include "conversation.h" -HINSTANCE gtkwgaim_hinstance(void); +HINSTANCE winpidgin_hinstance(void); /* Utility */ -int gtkwgaim_gz_decompress(const char* in, const char* out); -int gtkwgaim_gz_untar(const char* filename, const char* destdir); +int winpidgin_gz_decompress(const char* in, const char* out); +int winpidgin_gz_untar(const char* filename, const char* destdir); /* Misc */ -void gtkwgaim_notify_uri(const char *uri); -void gtkwgaim_shell_execute(const char *target, const char *verb, const char *clazz); -void gtkwgaim_ensure_onscreen(GtkWidget *win); -void gtkwgaim_conv_blink(GaimConversation *conv, GaimMessageFlags flags); -void gtkwgaim_window_flash(GtkWindow *window, gboolean flash); +void winpidgin_notify_uri(const char *uri); +void winpidgin_shell_execute(const char *target, const char *verb, const char *clazz); +void winpidgin_ensure_onscreen(GtkWidget *win); +void winpidgin_conv_blink(GaimConversation *conv, GaimMessageFlags flags); +void winpidgin_window_flash(GtkWindow *window, gboolean flash); /* init / cleanup */ -void gtkwgaim_init(HINSTANCE); -void gtkwgaim_post_init(void); -void gtkwgaim_cleanup(void); +void winpidgin_init(HINSTANCE); +void winpidgin_post_init(void); +void winpidgin_cleanup(void); #endif /* _WIN32DEP_H_ */
--- a/pidgin/win32/winpidgin.c Sat Feb 03 09:24:33 2007 +0000 +++ b/pidgin/win32/winpidgin.c Sat Feb 03 18:46:49 2007 +0000 @@ -51,14 +51,14 @@ #endif -typedef int (CALLBACK* LPFNGAIMMAIN)(HINSTANCE, int, char**); +typedef int (CALLBACK* LPFNPIDGINMAIN)(HINSTANCE, int, char**); typedef void (CALLBACK* LPFNSETDLLDIRECTORY)(LPCTSTR); typedef BOOL (CALLBACK* LPFNATTACHCONSOLE)(DWORD); /* * PROTOTYPES */ -static LPFNGAIMMAIN gaim_main = NULL; +static LPFNPIDGINMAIN pidgin_main = NULL; static LPFNSETDLLDIRECTORY MySetDllDirectory = NULL; static const char *get_win32_error_message(DWORD err) { @@ -249,7 +249,7 @@ } } -static char* wgaim_lcid_to_posix(LCID lcid) { +static char* winpidgin_lcid_to_posix(LCID lcid) { char *posix = NULL; int lang_id = PRIMARYLANGID(lcid); int sub_id = SUBLANGID(lcid); @@ -395,7 +395,7 @@ - Check NSIS Installer Language reg value - Use default user locale */ -static const char *wgaim_get_locale() { +static const char *winpidgin_get_locale() { const char *locale = NULL; LCID lcid; #ifndef PORTABLE @@ -410,23 +410,23 @@ #ifndef PORTABLE if (read_reg_string(HKEY_CURRENT_USER, "SOFTWARE\\gaim", "Installer Language", (LPBYTE) &data, &datalen)) { - if ((locale = wgaim_lcid_to_posix(atoi(data)))) + if ((locale = winpidgin_lcid_to_posix(atoi(data)))) return locale; } #endif lcid = GetUserDefaultLCID(); - if ((locale = wgaim_lcid_to_posix(lcid))) + if ((locale = winpidgin_lcid_to_posix(lcid))) return locale; return "en"; } -static void wgaim_set_locale() { +static void winpidgin_set_locale() { const char *locale = NULL; char envstr[25]; - locale = wgaim_get_locale(); + locale = winpidgin_get_locale(); snprintf(envstr, 25, "LANG=%s", locale); printf("Setting locale: %s\n", envstr); @@ -435,21 +435,21 @@ #define WM_FOCUS_REQUEST (WM_APP + 13) -static BOOL wgaim_set_running() { +static BOOL winpidgin_set_running() { HANDLE h; - if ((h = CreateMutex(NULL, FALSE, "gaim_is_running"))) { + if ((h = CreateMutex(NULL, FALSE, "pidgin_is_running"))) { if (GetLastError() == ERROR_ALREADY_EXISTS) { HWND msg_win; - if((msg_win = FindWindow(TEXT("WingaimMsgWinCls"), NULL))) + if((msg_win = FindWindow(TEXT("WinpidginMsgWinCls"), NULL))) if(SendMessage(msg_win, WM_FOCUS_REQUEST, (WPARAM) NULL, (LPARAM) NULL)) return FALSE; /* If we get here, the focus request wasn't successful */ MessageBox(NULL, - "An instance of Gaim is already running", + "An instance of Pidgin is already running", NULL, MB_OK | MB_TOPMOST); return FALSE; @@ -469,7 +469,7 @@ WinMain (struct HINSTANCE__ *hInstance, struct HINSTANCE__ *hPrevInstance, char *lpszCmdLine, int nCmdShow) { char errbuf[512]; - char gaimdir[MAX_PATH]; + char pidgindir[MAX_PATH]; HMODULE hmod; /* If debug or help or version flag used, create console for output */ @@ -492,8 +492,8 @@ } /* Load exception handler if we have it */ - if (GetModuleFileName(NULL, gaimdir, MAX_PATH) != 0) { - char *tmp = gaimdir; + if (GetModuleFileName(NULL, pidgindir, MAX_PATH) != 0) { + char *tmp = pidgindir; char *prev = NULL; while ((tmp = strchr(tmp, '\\'))) { @@ -503,8 +503,8 @@ if (prev) { prev[0] = '\0'; - strcat(gaimdir, "\\exchndl.dll"); - if (LoadLibrary(gaimdir)) + strcat(pidgindir, "\\exchndl.dll"); + if (LoadLibrary(pidgindir)) printf("Loaded exchndl.dll\n"); } } else { @@ -522,18 +522,18 @@ #endif dll_prep(); - wgaim_set_locale(); + winpidgin_set_locale(); /* If help or version flag used, do not check Mutex */ if (!strstr(lpszCmdLine, "-h") && !strstr(lpszCmdLine, "-v")) - if (!getenv("GAIM_MULTI_INST") && !wgaim_set_running()) + if (!getenv("GAIM_MULTI_INST") && !winpidgin_set_running()) return 0; /* Now we are ready for Gaim .. */ if ((hmod = LoadLibrary("pidgin.dll"))) { - gaim_main = (LPFNGAIMMAIN) GetProcAddress(hmod, "gaim_main"); + pidgin_main = (LPFNPIDGINMAIN) GetProcAddress(hmod, "pidgin_main"); } - if (!gaim_main) { + if (!pidgin_main) { DWORD dw = GetLastError(); BOOL mod_not_found = (dw == ERROR_MOD_NOT_FOUND || dw == ERROR_DLL_NOT_FOUND); const char *err_msg = get_win32_error_message(dw); @@ -548,5 +548,5 @@ return 0; } - return gaim_main (hInstance, __argc, __argv); + return pidgin_main(hInstance, __argc, __argv); }