From: <dat...@us...> - 2006-08-20 16:50:19
|
Revision: 16905 Author: datallah Date: 2006-08-20 09:49:37 -0700 (Sun, 20 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16905&view=rev Log Message: ----------- First step of getting wingaim working again. libgaim and gtk are compiling. The protocols aren't compiling yet. There are a number of things that are compiling, but should be cleaned up. Modified Paths: -------------- trunk/gtk/gtkmain.c trunk/gtk/gtknotify.c trunk/gtk/gtkprefs.c trunk/gtk/plugins/docklet/Makefile.mingw trunk/gtk/plugins/docklet/docklet-win32.c trunk/gtk/plugins/ticker/Makefile.mingw trunk/gtk/plugins/win32/transparency/Makefile.mingw trunk/gtk/plugins/win32/winprefs/Makefile.mingw trunk/gtk/plugins/win32/winprefs/winprefs.c trunk/gtk/win32/IdleTracker/Makefile.mingw trunk/gtk/win32/gaimrc.rc trunk/libgaim/core.c trunk/libgaim/plugins/perl/Makefile.mingw trunk/libgaim/plugins/ssl/Makefile.mingw trunk/libgaim/plugins/tcl/Makefile.mingw Added Paths: ----------- trunk/gtk/Makefile.mingw trunk/gtk/plugins/Makefile.mingw trunk/gtk/plugins/win32/ trunk/gtk/win32/gtkwin32dep.c trunk/gtk/win32/gtkwin32dep.h trunk/gtk/win32/win_gaim.c trunk/libgaim/Makefile.mingw trunk/libgaim/plugins/Makefile.mingw trunk/libgaim/win32/ trunk/libgaim/win32/global.mak trunk/libgaim/win32/libc_interface.c trunk/libgaim/win32/libc_interface.h trunk/libgaim/win32/libc_internal.h trunk/libgaim/win32/wgaimerror.h trunk/libgaim/win32/win32dep.c trunk/libgaim/win32/win32dep.h Removed Paths: ------------- trunk/gtk/win32/global.mak trunk/gtk/win32/libc_interface.c trunk/gtk/win32/libc_interface.h trunk/gtk/win32/libc_internal.h trunk/gtk/win32/wgaimerror.h trunk/gtk/win32/win32dep.c trunk/gtk/win32/win32dep.h Property Changed: ---------------- trunk/gtk/ trunk/gtk/plugins/ trunk/gtk/plugins/win32/transparency/ trunk/gtk/plugins/win32/winprefs/ trunk/gtk/win32/IdleTracker/ trunk/libgaim/ trunk/libgaim/plugins/ Property changes on: trunk/gtk ___________________________________________________________________ Name: svn:ignore - Makefile.in .deps Makefile + Makefile.in .deps Makefile *.dll gtkgaim.dll.a *.exe Added: trunk/gtk/Makefile.mingw =================================================================== --- trunk/gtk/Makefile.mingw (rev 0) +++ trunk/gtk/Makefile.mingw 2006-08-20 16:49:37 UTC (rev 16905) @@ -0,0 +1,229 @@ +# +# Makefile.mingw +# +# Description: Makefile for win32 (mingw) version of Gaim +# + +# +# PATHS +# + +GTK_TOP := ../../win32-dev/gtk_2_0 +GAIM_TOP := .. +GTKGAIM_TOP := . +LIBGAIM_TOP := ../libgaim +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 + +## +## VARIABLE DEFINITIONS +## + +EXE_TARGET = gaim + +GTKGAIM_TARGET = gtkgaim + +# Compiler and Linker Options + +CFLAGS = + +DEFINES = + +ifeq ($(MAKECMDGOALS), $(EXE_TARGET)-portable.exe) +DEFINES := $(DEFINES) -DPORTABLE +endif + +WINAPP := -mwindows +# The Debug version of gaim is a console app, always having a console +CONSOLEAPP := -mconsole + +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_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$(GTK_TOP)/include/gtk-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$(GTKSPELL_TOP) \ + -I$(ASPELL_TOP)/include + + + +LIB_PATHS = -L$(GTK_TOP)/lib \ + -L$(LIBGAIM_TOP) \ + -L$(GTKGAIM_TOP) \ + -L$(IDLETRACK_TOP) \ + -L$(ASPELL_TOP)/lib + +# -L$(LIBXML2_DIR)/lib + +## +## SOURCES, OBJECTS +## + +GTKGAIM_C_SRC = \ + gaimstock.c \ + gtkaccount.c \ + gtkblist.c \ + gtkconn.c \ + gtkconv.c \ + gtkcellrendererprogress.c \ + gtkdebug.c \ + gtkdialogs.c \ + gtkdnd-hints.c \ + gtkeventloop.c \ + gtkexpander.c \ + gtkft.c \ + gtkidle.c \ + gtkimhtml.c \ + gtkimhtmltoolbar.c \ + gtklog.c \ + gtkmain.c \ + gtkmenutray.c \ + gtknotify.c \ + gtkplugin.c \ + gtkpluginpref.c \ + gtkpounce.c \ + gtkprefs.c \ + gtkprivacy.c \ + gtkrequest.c \ + gtkroomlist.c \ + gtksavedstatuses.c \ + gtksound.c \ + gtksourceiter.c \ + gtkstatusbox.c \ + gtkthemes.c \ + gtkutils.c \ + gtkwhiteboard.c \ + win32/gtkwin32dep.c \ + win32/untar.c \ + win32/wspell.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 \ + -lgthread-2.0 \ + -lgobject-2.0 \ + -lgmodule-2.0 \ + -lintl \ + -lws2_32 \ + -lwinmm \ + -lz \ + -liberty \ + -lidletrack + +# -lxml2 + +GTKGAIM_LIBS = \ + $(LIBGAIM_LIBS) \ + -lgtk-win32-2.0 \ + -latk-1.0 \ + -lpango-1.0 \ + -lgdk-win32-2.0 \ + -lgdk_pixbuf-2.0 + +EXE_LIBS = + +## +## 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 libgaim_include_path gtkgaim_include_path + +all: $(EXE_TARGET).exe $(GTKGAIM_TARGET).dll + +install: all + cp $(GTKGAIM_TOP)/$(EXE_TARGET).exe $(GTKGAIM_TOP)/$(GTKGAIM_TARGET).dll $(GAIM_INSTALL_DIR) + +$(LIBGAIM_TOP)/libgaim.dll.a: + S(MAKE) -C $(LIBGAIM_TOP) -f Makefile.mingw libgaim.dll.a + +$(IDLETRACK_TOP)/idletrack.dll: + $(MAKE) -C $(IDLETRACK_TOP) -f Makefile.mingw + +# +# BUILD DLL +# +#$(GTKGAIM_TARGET).dll.a $(GTKGAIM_TARGET).dll: INCLUDE_PATHS = $(GTKGAIM_INCLUDE_PATHS) +#Once the UI split has finished for server.c, this will be the correct line +#$(GTKGAIM_TARGET).dll.a $(GTKGAIM_TARGET).dll: $(LIBGAIM_TARGET).dll.a $(GTKGAIM_OBJECTS) +$(GTKGAIM_TARGET).dll.a $(GTKGAIM_TARGET).dll: $(LIBGAIM_TOP)/libgaim.dll.a $(GTKGAIM_OBJECTS) $(IDLETRACK_TOP)/idletrack.dll + $(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) + $(CC) $(LDFLAGS) $(EXE_OBJECTS) $(LIB_PATHS) $(EXE_LIBS) -o $(EXE_TARGET).exe + +$(EXE_TARGET)-portable.exe: clean_exe $(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 + +clean_exe: + rm -rf win_gaim.o Property changes on: trunk/gtk/Makefile.mingw ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Modified: trunk/gtk/gtkmain.c =================================================================== --- trunk/gtk/gtkmain.c 2006-08-20 16:45:57 UTC (rev 16904) +++ trunk/gtk/gtkmain.c 2006-08-20 16:49:37 UTC (rev 16905) @@ -78,7 +78,7 @@ #endif #ifdef _WIN32 -# include "wspell.h" +# include "gtkwin32dep.h" #endif @@ -635,9 +635,6 @@ gaim_debug_set_enabled(debug_enabled); -#ifdef _WIN32 - wgaim_init(hint); -#endif search_path = g_build_filename(gaim_user_dir(), "gtkrc-2.0", NULL); gtk_rc_add_default_file(search_path); @@ -668,11 +665,7 @@ } #ifdef _WIN32 - /** TODO: Move this to a wgaim_gtk_init() if we need such a thing */ - wgaim_gtkspell_init(); - gaim_debug_info("wgaim", "GTK+ :%u.%u.%u\n", - gtk_major_version, gtk_minor_version, gtk_micro_version); - + gtkwgaim_init(hint); #endif gaim_core_set_ui_ops(gaim_gtk_core_get_ui_ops()); @@ -784,7 +777,7 @@ #endif #ifdef _WIN32 - wgaim_cleanup(); + gtkwgaim_cleanup(); #endif return 0; Modified: trunk/gtk/gtknotify.c =================================================================== --- trunk/gtk/gtknotify.c 2006-08-20 16:45:57 UTC (rev 16904) +++ trunk/gtk/gtknotify.c 2006-08-20 16:49:37 UTC (rev 16905) @@ -38,6 +38,10 @@ #include "gtknotify.h" #include "gtkutils.h" +#ifdef _WIN32 +# include "gtkwin32dep.h" +#endif + typedef struct { GaimConnection *gc; @@ -116,7 +120,7 @@ if (id == GTK_RESPONSE_YES) { GtkTreeSelection *selection; - + selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(dialog->treeview)); if (gtk_tree_selection_get_selected(selection, NULL, &iter)) @@ -762,7 +766,7 @@ gaim_notify_searchresults_column_get_title(results, i-1), renderer, "text", i, NULL); } - + /* Setup the button area */ button_area = gtk_hbutton_box_new(); gtk_box_pack_start(GTK_BOX(vbox), button_area, FALSE, FALSE, 0); @@ -1072,7 +1076,7 @@ g_free(command); #else /* !_WIN32 */ - wgaim_notify_uri(uri); + gtkwgaim_notify_uri(uri); #endif /* !_WIN32 */ return NULL; Modified: trunk/gtk/gtkprefs.c =================================================================== --- trunk/gtk/gtkprefs.c 2006-08-20 16:45:57 UTC (rev 16904) +++ trunk/gtk/gtkprefs.c 2006-08-20 16:49:37 UTC (rev 16905) @@ -50,6 +50,10 @@ #include "gtkutils.h" #include "gaimstock.h" +#ifdef _WIN32 +# include "gtkwin32dep.h" +#endif + #define PROXYHOST 0 #define PROXYPORT 1 #define PROXYUSER 2 @@ -494,7 +498,7 @@ g_free(path_escaped); g_free(destdir_escaped); #else - if(!wgaim_gz_untar(path, destdir)) { + if(!gtkwgaim_gz_untar(path, destdir)) { g_free(destdir); return; } Property changes on: trunk/gtk/plugins ___________________________________________________________________ Name: svn:ignore - Makefile.in .deps Makefile + Makefile.in .deps Makefile *.dll Added: trunk/gtk/plugins/Makefile.mingw =================================================================== --- trunk/gtk/plugins/Makefile.mingw (rev 0) +++ trunk/gtk/plugins/Makefile.mingw 2006-08-20 16:49:37 UTC (rev 16905) @@ -0,0 +1,136 @@ +# +# Makefile.mingw +# +# Description: Makefile for win32 (mingw) version of Gaim Plugins +# + +# +# PATHS +# + +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 + +## +## 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 \ + -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/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 + + +LIB_PATHS = -L$(GTK_TOP)/lib \ + -L$(LIBGAIM_TOP) \ + -L$(GTKGAIM_TOP) + + +## +## LIBRARIES +## + +LIBS = -lgtk-win32-2.0 \ + -lglib-2.0 \ + -lgdk-win32-2.0 \ + -lgobject-2.0 \ + -lgmodule-2.0 \ + -lgdk_pixbuf-2.0 \ + -lpango-1.0 \ + -lintl \ + -lws2_32 \ + -lgaim \ + -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 + +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 + +# +# BUILD Plugin +# + +.c.dll: + $(CC) $(CFLAGS) $(DEFINES) $(INCLUDE_PATHS) -o $@.o -c $< + $(CC) -shared $@.o $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -o $@ + +plugins: \ + extplacement.dll \ + gaimrc.dll \ + history.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 Property changes on: trunk/gtk/plugins/Makefile.mingw ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Modified: trunk/gtk/plugins/docklet/Makefile.mingw =================================================================== --- trunk/gtk/plugins/docklet/Makefile.mingw 2006-08-20 16:45:57 UTC (rev 16904) +++ trunk/gtk/plugins/docklet/Makefile.mingw 2006-08-20 16:49:37 UTC (rev 16905) @@ -8,8 +8,10 @@ # PATHS # -GTK_TOP := ../../../win32-dev/gtk_2_0 -GAIM_TOP := ../.. +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 @@ -29,7 +31,7 @@ ## INCLUDE MAKEFILES ## -include $(GAIM_TOP)/src/win32/global.mak +include $(LIBGAIM_TOP)/win32/global.mak ## ## INCLUDE PATHS @@ -43,13 +45,16 @@ -I$(GTK_TOP)/include/atk-1.0 \ -I$(GTK_TOP)/lib/glib-2.0/include \ -I$(GTK_TOP)/lib/gtk-2.0/include \ - -I$(GAIM_TOP)/src \ - -I$(GAIM_TOP)/src/win32 \ + -I$(LIBGAIM_TOP) \ + -I$(LIBGAIM_TOP)/win32 \ + -I$(GTKGAIM_TOP) \ + -I$(GTKGAIM_TOP)/win32 \ -I$(GAIM_TOP) LIB_PATHS = -L$(GTK_TOP)/lib \ - -L$(GAIM_TOP)/src + -L$(LIBGAIM_TOP) \ + -L$(GTKGAIM_TOP) ## @@ -71,11 +76,10 @@ LIBS = -lgtk-win32-2.0 \ -lglib-2.0 \ -lgdk-win32-2.0 \ - -lgmodule-2.0 \ -lgobject-2.0 \ - -lws2_32 \ -lintl \ - -lgaim + -lgaim \ + -lgtkgaim ## @@ -103,14 +107,15 @@ ## BUILD Dependencies ## -$(GAIM_TOP)/src/gaim.lib: - $(MAKE) -C $(GAIM_TOP)/src -f Makefile.mingw gaim.lib +$(GTKGAIM_TOP)/gtkgaim.dll.a: + $(MAKE) -C $(GTKGAIM_TOP) -f Makefile.mingw gtkgaim.dll.a + ## ## BUILD DLL ## -$(TARGET).dll: $(OBJECTS) $(GAIM_TOP)/src/gaim.lib +$(TARGET).dll: $(OBJECTS) $(GTKGAIM_TOP)/gtkgaim.dll.a $(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -o $(TARGET).dll ## Modified: trunk/gtk/plugins/docklet/docklet-win32.c =================================================================== --- trunk/gtk/plugins/docklet/docklet-win32.c 2006-08-20 16:45:57 UTC (rev 16904) +++ trunk/gtk/plugins/docklet/docklet-win32.c 2006-08-20 16:49:37 UTC (rev 16905) @@ -36,6 +36,7 @@ #include "resource.h" #include "MinimizeToTray.h" +#include "gtkwin32dep.h" #include "docklet.h" /* @@ -115,7 +116,7 @@ wcex.lpfnWndProc = (WNDPROC)systray_mainmsg_handler; wcex.cbClsExtra = 0; wcex.cbWndExtra = 0; - wcex.hInstance = wgaim_hinstance(); + wcex.hInstance = gtkwgaim_hinstance(); wcex.hIcon = NULL; wcex.hCursor = NULL, wcex.hbrBackground = NULL; @@ -126,7 +127,7 @@ RegisterClassEx(&wcex); /* Create the window */ - return (CreateWindow(wname, "", 0, 0, 0, 0, 0, GetDesktopWindow(), NULL, wgaim_hinstance(), 0)); + return (CreateWindow(wname, "", 0, 0, 0, 0, 0, GetDesktopWindow(), NULL, gtkwgaim_hinstance(), 0)); } static void systray_init_icon(HWND hWnd, HICON icon) { @@ -212,19 +213,19 @@ * but will scale it back to 4-bits for display. * That is why we use custom 4-bit icons for pre XP Windowses */ if (osinfo.dwMajorVersion == 5 && osinfo.dwMinorVersion > 0) { - sysicon_disconn = (HICON)LoadImage(wgaim_hinstance(), MAKEINTRESOURCE(GAIM_OFFLINE_TRAY_ICON), IMAGE_ICON, 16, 16, 0); - sysicon_conn = (HICON)LoadImage(wgaim_hinstance(), MAKEINTRESOURCE(GAIM_TRAY_ICON), IMAGE_ICON, 16, 16, 0); - sysicon_away = (HICON)LoadImage(wgaim_hinstance(), MAKEINTRESOURCE(GAIM_AWAY_TRAY_ICON), IMAGE_ICON, 16, 16, 0); - sysicon_pend = (HICON)LoadImage(wgaim_hinstance(), MAKEINTRESOURCE(GAIM_PEND_TRAY_ICON), IMAGE_ICON, 16, 16, 0); - sysicon_awypend = (HICON)LoadImage(wgaim_hinstance(), MAKEINTRESOURCE(GAIM_AWAYPEND_TRAY_ICON), IMAGE_ICON, 16, 16, 0); + 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); } else { - sysicon_disconn = (HICON)LoadImage(wgaim_hinstance(), MAKEINTRESOURCE(GAIM_OFFLINE_TRAY_ICON_4BIT), IMAGE_ICON, 16, 16, 0); - sysicon_conn = (HICON)LoadImage(wgaim_hinstance(), MAKEINTRESOURCE(GAIM_TRAY_ICON_4BIT), IMAGE_ICON, 16, 16, 0); - sysicon_away = (HICON)LoadImage(wgaim_hinstance(), MAKEINTRESOURCE(GAIM_AWAY_TRAY_ICON_4BIT), IMAGE_ICON, 16, 16, 0); - sysicon_pend = (HICON)LoadImage(wgaim_hinstance(), MAKEINTRESOURCE(GAIM_PEND_TRAY_ICON_4BIT), IMAGE_ICON, 16, 16, 0); - sysicon_awypend = (HICON)LoadImage(wgaim_hinstance(), MAKEINTRESOURCE(GAIM_AWAYPEND_TRAY_ICON_4BIT), IMAGE_ICON, 16, 16, 0); + 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_blank = (HICON)LoadImage(wgaim_hinstance(), MAKEINTRESOURCE(GAIM_BLANK_TRAY_ICON), IMAGE_ICON, 16, 16, 0); + sysicon_blank = (HICON)LoadImage(gtkwgaim_hinstance(), MAKEINTRESOURCE(GAIM_BLANK_TRAY_ICON), IMAGE_ICON, 16, 16, 0); /* Create icon in systray */ systray_init_icon(systray_hwnd, sysicon_disconn); Modified: trunk/gtk/plugins/ticker/Makefile.mingw =================================================================== --- trunk/gtk/plugins/ticker/Makefile.mingw 2006-08-20 16:45:57 UTC (rev 16904) +++ trunk/gtk/plugins/ticker/Makefile.mingw 2006-08-20 16:49:37 UTC (rev 16905) @@ -8,10 +8,10 @@ # PATHS # -INCLUDE_DIR := . - -GTK_TOP := ../../../win32-dev/gtk_2_0 -GAIM_TOP := ../.. +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 @@ -33,7 +33,7 @@ ## INCLUDE MAKEFILES ## -include $(GAIM_TOP)/src/win32/global.mak +include $(LIBGAIM_TOP)/win32/global.mak ## ## INCLUDE PATHS @@ -47,13 +47,16 @@ -I$(GTK_TOP)/include/atk-1.0 \ -I$(GTK_TOP)/lib/glib-2.0/include \ -I$(GTK_TOP)/lib/gtk-2.0/include \ - -I$(GAIM_TOP)/src \ - -I$(GAIM_TOP)/src/win32 \ + -I$(LIBGAIM_TOP) \ + -I$(LIBGAIM_TOP)/win32 \ + -I$(GTKGAIM_TOP) \ + -I$(GTKGAIM_TOP)/win32 \ -I$(GAIM_TOP) LIB_PATHS = -L$(GTK_TOP)/lib \ - -L$(GAIM_TOP)/src + -L$(LIBGAIM_TOP) \ + -L$(GTKGAIM_TOP) ## @@ -76,9 +79,9 @@ -lgdk-win32-2.0 \ -lgmodule-2.0 \ -lgobject-2.0 \ - -lws2_32 \ -lintl \ - -lgaim + -lgaim \ + -lgtkgaim ## ## RULES @@ -105,14 +108,14 @@ ## BUILD Dependencies ## -$(GAIM_TOP)/src/gaim.lib: - $(MAKE) -C $(GAIM_TOP)/src -f Makefile.mingw gaim.lib +$(GTKGAIM_TOP)/gtkgaim.dll.a: + $(MAKE) -C $(GTKGAIM_TOP) -f Makefile.mingw gtkgaim.dll.a ## ## BUILD DLL ## -$(TARGET).dll: $(OBJECTS) $(GAIM_TOP)/src/gaim.lib +$(TARGET).dll: $(OBJECTS) $(GTKGAIM_TOP)/gtkgaim.dll.a $(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -o $(TARGET).dll ## Copied: trunk/gtk/plugins/win32 (from rev 16858, trunk/plugins/win32) Property changes on: trunk/gtk/plugins/win32/transparency ___________________________________________________________________ Name: svn:ignore - win2ktrans.dll win2ktrans.def + win2ktrans.dll Modified: trunk/gtk/plugins/win32/transparency/Makefile.mingw =================================================================== --- trunk/plugins/win32/transparency/Makefile.mingw 2006-08-19 01:29:53 UTC (rev 16858) +++ trunk/gtk/plugins/win32/transparency/Makefile.mingw 2006-08-20 16:49:37 UTC (rev 16905) @@ -8,8 +8,10 @@ # PATHS # -GTK_TOP := ../../../../win32-dev/gtk_2_0 -GAIM_TOP := ../../.. +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 @@ -23,13 +25,14 @@ CFLAGS = -DEFINES = +# This plugin requires W2K+ API +DEFINES = -D_WIN32_WINNT=0x0500 ## ## INCLUDE MAKEFILES ## -include $(GAIM_TOP)/src/win32/global.mak +include $(LIBGAIM_TOP)/win32/global.mak ## ## INCLUDE PATHS @@ -43,13 +46,16 @@ -I$(GTK_TOP)/include/atk-1.0 \ -I$(GTK_TOP)/lib/glib-2.0/include \ -I$(GTK_TOP)/lib/gtk-2.0/include \ - -I$(GAIM_TOP)/src \ - -I$(GAIM_TOP)/src/win32 \ + -I$(LIBGAIM_TOP) \ + -I$(LIBGAIM_TOP)/win32 \ + -I$(GTKGAIM_TOP) \ + -I$(GTKGAIM_TOP)/win32 \ -I$(GAIM_TOP) LIB_PATHS = -L$(GTK_TOP)/lib \ - -L$(GAIM_TOP)/src + -L$(LIBGAIM_TOP) \ + -L$(GTKGAIM_TOP) ## @@ -71,8 +77,8 @@ -lgdk-win32-2.0 \ -lgmodule-2.0 \ -lgobject-2.0 \ - -lws2_32 \ -lintl \ + -lgtkgaim \ -lgaim @@ -93,7 +99,7 @@ all: $(TARGET).dll -install: +install: all cp $(TARGET).dll $(DLL_INSTALL_DIR) @@ -101,14 +107,14 @@ ## BUILD Dependencies ## -$(GAIM_TOP)/src/gaim.lib: - $(MAKE) -C $(GAIM_TOP)/src -f Makefile.mingw gaim.lib +$(GTKGAIM_TOP)/gtkgaim.dll.a: + $(MAKE) -C $(GTKGAIM_TOP) -f Makefile.mingw gtkgaim.dll.a ## ## BUILD DLL ## -$(TARGET).dll: $(OBJECTS) $(GAIM_TOP)/src/gaim.lib +$(TARGET).dll: $(OBJECTS) $(GTKGAIM_TOP)/gtkgaim.dll.a $(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -o $(TARGET).dll ## Property changes on: trunk/gtk/plugins/win32/winprefs ___________________________________________________________________ Name: svn:ignore - winprefs.dll winprefs.def + winprefs.dll Modified: trunk/gtk/plugins/win32/winprefs/Makefile.mingw =================================================================== --- trunk/plugins/win32/winprefs/Makefile.mingw 2006-08-19 01:29:53 UTC (rev 16858) +++ trunk/gtk/plugins/win32/winprefs/Makefile.mingw 2006-08-20 16:49:37 UTC (rev 16905) @@ -8,8 +8,10 @@ # PATHS # -GTK_TOP := ../../../../win32-dev/gtk_2_0 -GAIM_TOP := ../../.. +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 @@ -29,7 +31,7 @@ ## INCLUDE MAKEFILES ## -include $(GAIM_TOP)/src/win32/global.mak +include $(LIBGAIM_TOP)/win32/global.mak ## ## INCLUDE PATHS @@ -43,13 +45,16 @@ -I$(GTK_TOP)/include/atk-1.0 \ -I$(GTK_TOP)/lib/glib-2.0/include \ -I$(GTK_TOP)/lib/gtk-2.0/include \ - -I$(GAIM_TOP)/src \ - -I$(GAIM_TOP)/src/win32 \ + -I$(LIBGAIM_TOP) \ + -I$(LIBGAIM_TOP)/win32 \ + -I$(GTKGAIM_TOP) \ + -I$(GTKGAIM_TOP)/win32 \ -I$(GAIM_TOP) LIB_PATHS = -L$(GTK_TOP)/lib \ - -L$(GAIM_TOP)/src + -L$(LIBGAIM_TOP) \ + -L$(GTKGAIM_TOP) ## @@ -74,7 +79,8 @@ -lgobject-2.0 \ -lws2_32 \ -lintl \ - -lgaim + -lgaim \ + -lgtkgaim ## @@ -102,14 +108,14 @@ ## BUILD Dependencies ## -$(GAIM_TOP)/src/gaim.lib: - $(MAKE) -C $(GAIM_TOP)/src -f Makefile.mingw gaim.lib +$(GTKGAIM_TOP)/gtkgaim.dll.a: + $(MAKE) -C $(GTKGAIM_TOP) -f Makefile.mingw gtkgaim.dll.a ## ## BUILD DLL ## -$(TARGET).dll: $(OBJECTS) $(GAIM_TOP)/src/gaim.lib +$(TARGET).dll: $(OBJECTS) $(GTKGAIM_TOP)/gtkgaim.dll.a $(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -o $(TARGET).dll ## Modified: trunk/gtk/plugins/win32/winprefs/winprefs.c =================================================================== --- trunk/plugins/win32/winprefs/winprefs.c 2006-08-19 01:29:53 UTC (rev 16858) +++ trunk/gtk/plugins/win32/winprefs/winprefs.c 2006-08-20 16:49:37 UTC (rev 16905) @@ -25,6 +25,8 @@ #include "internal.h" +#include "gtkwin32dep.h" + #include "core.h" #include "debug.h" #include "prefs.h" @@ -237,7 +239,7 @@ char buffer[1024]; DWORD size; - if((size = GetModuleFileName(wgaim_hinstance(), + if((size = GetModuleFileName(gtkwgaim_hinstance(), (LPBYTE) buffer , sizeof(buffer))) == 0) { gaim_debug_error(WINPREFS_PLUGIN_ID, "GetModuleFileName Error. Could not set Gaim autostart.\n"); RegCloseKey(hKey); @@ -558,3 +560,4 @@ } GAIM_INIT_PLUGIN(winprefs, init_plugin, info) + Property changes on: trunk/gtk/win32/IdleTracker ___________________________________________________________________ Name: svn:ignore - idletrack.def idletrack.lib idletrack.dll + idletrack.dll idletrack.dll.a Modified: trunk/gtk/win32/IdleTracker/Makefile.mingw =================================================================== --- trunk/gtk/win32/IdleTracker/Makefile.mingw 2006-08-20 16:45:57 UTC (rev 16904) +++ trunk/gtk/win32/IdleTracker/Makefile.mingw 2006-08-20 16:49:37 UTC (rev 16905) @@ -9,6 +9,7 @@ # GAIM_TOP := ../../.. +LIBGAIM_TOP := $(GAIM_TOP)/libgaim GAIM_INSTALL_DIR := $(GAIM_TOP)/win32-install-dir ## @@ -27,7 +28,7 @@ ## INCLUDE MAKEFILES ## -include $(GAIM_TOP)/src/win32/global.mak +include $(LIBGAIM_TOP)/win32/global.mak ## ## INCLUDE PATHS @@ -77,7 +78,7 @@ ## $(TARGET).dll: $(OBJECTS) - $(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -Wl,--out-implib,$(TARGET).lib -o $(TARGET).dll + $(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -Wl,--out-implib,$(TARGET).dll.a -o $(TARGET).dll ## ## CLEAN RULES @@ -86,5 +87,4 @@ clean: rm -rf *.o rm -rf $(TARGET).dll - rm -rf $(TARGET).lib - rm -rf $(TARGET).def + rm -rf $(TARGET).dll.a Modified: trunk/gtk/win32/gaimrc.rc =================================================================== --- trunk/gtk/win32/gaimrc.rc 2006-08-20 16:45:57 UTC (rev 16904) +++ trunk/gtk/win32/gaimrc.rc 2006-08-20 16:49:37 UTC (rev 16905) @@ -1,14 +1,16 @@ #include "resource.h" -GAIM_ICON ICON "../pixmaps/gaim.ico" -GAIM_TRAY_ICON ICON "../pixmaps/gaim_16.ico" -GAIM_OFFLINE_TRAY_ICON ICON "../pixmaps/gaim_offline_16.ico" -GAIM_AWAY_TRAY_ICON ICON "../pixmaps/gaim_away_16.ico" -GAIM_PEND_TRAY_ICON ICON "../pixmaps/gaim_msgunread_16.ico" -GAIM_AWAYPEND_TRAY_ICON ICON "../pixmaps/gaim_msgpend_16.ico" -GAIM_BLANK_TRAY_ICON ICON "../pixmaps/gaim_blank_4bit_16.ico" -GAIM_TRAY_ICON_4BIT ICON "../pixmaps/gaim_4bit_16.ico" -GAIM_OFFLINE_TRAY_ICON_4BIT ICON "../pixmaps/gaim_offline_4bit_16.ico" -GAIM_AWAY_TRAY_ICON_4BIT ICON "../pixmaps/gaim_away_4bit_16.ico" -GAIM_PEND_TRAY_ICON_4BIT ICON "../pixmaps/gaim_msgunread_4bit_16.ico" -GAIM_AWAYPEND_TRAY_ICON_4BIT ICON "../pixmaps/gaim_msgpend_4bit_16.ico" +#define PIXMAPDIR "pixmaps/" + +GAIM_ICON ICON PIXMAPDIR "gaim.ico" +GAIM_TRAY_ICON ICON PIXMAPDIR "gaim_16.ico" +GAIM_OFFLINE_TRAY_ICON ICON PIXMAPDIR "gaim_offline_16.ico" +GAIM_AWAY_TRAY_ICON ICON PIXMAPDIR "gaim_away_16.ico" +GAIM_PEND_TRAY_ICON ICON PIXMAPDIR "gaim_msgunread_16.ico" +GAIM_AWAYPEND_TRAY_ICON ICON PIXMAPDIR "gaim_msgpend_16.ico" +GAIM_BLANK_TRAY_ICON ICON PIXMAPDIR "gaim_blank_4bit_16.ico" +GAIM_TRAY_ICON_4BIT ICON PIXMAPDIR "gaim_4bit_16.ico" +GAIM_OFFLINE_TRAY_ICON_4BIT ICON PIXMAPDIR "gaim_offline_4bit_16.ico" +GAIM_AWAY_TRAY_ICON_4BIT ICON PIXMAPDIR "gaim_away_4bit_16.ico" +GAIM_PEND_TRAY_ICON_4BIT ICON PIXMAPDIR "gaim_msgunread_4bit_16.ico" +GAIM_AWAYPEND_TRAY_ICON_4BIT ICON PIXMAPDIR "gaim_msgpend_4bit_16.ico" Deleted: trunk/gtk/win32/global.mak =================================================================== --- trunk/gtk/win32/global.mak 2006-08-20 16:45:57 UTC (rev 16904) +++ trunk/gtk/win32/global.mak 2006-08-20 16:49:37 UTC (rev 16905) @@ -1,25 +0,0 @@ -# -# global.mak -# -# This file should be included by all Makefile.mingw files for project -# wide definitions. -# - -CC = gcc.exe - -# Use -g flag when building debug version of Gaim (including plugins). -# Use -fnative-struct instead of -mms-bitfields when using mingw 1.1 -# (gcc 2.95) -CFLAGS += -O2 -Wall -pipe -mno-cygwin -mms-bitfields - -# If not specified, dlls are built with the default base address of 0x10000000. -# When loaded into a process address space a dll will be rebased if its base -# address colides with the base address of an existing dll. To avoid rebasing -# we do the following. Rebasing can slow down the load time of dlls and it -# also renders debug info useless. -DLL_LD_FLAGS += -Wl,--enable-auto-image-base - -VERSION := $(shell cat $(GAIM_TOP)/VERSION) - -DEFINES += -DVERSION=\"$(VERSION)\" \ - -DHAVE_CONFIG_H Added: trunk/gtk/win32/gtkwin32dep.c =================================================================== --- trunk/gtk/win32/gtkwin32dep.c (rev 0) +++ trunk/gtk/win32/gtkwin32dep.c 2006-08-20 16:49:37 UTC (rev 16905) @@ -0,0 +1,202 @@ +/* + * gaim + * + * File: gtkwin32dep.c + * Date: June, 2002 + * Description: Windows dependant code for Gaim + * + * Copyright (C) 2002-2003, Herman Bloggs <her...@ya...> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ +#define _WIN32_IE 0x500 +#include <windows.h> +#include <io.h> +#include <stdlib.h> +#include <stdio.h> +#include <winuser.h> + +#include <glib.h> +#include <glib/gstdio.h> +#include <gtk/gtk.h> + +#include "gaim.h" +#include "debug.h" +#include "notify.h" + +#include "resource.h" +#include "idletrack.h" +#include "zlib.h" +#include "untar.h" + +#include <libintl.h> + +#include "gtkwin32dep.h" + +#include "wspell.h" + +/* + * GLOBALS + */ +HINSTANCE gaimexe_hInstance = 0; +HINSTANCE gtkgaimdll_hInstance = 0; + +/* + * PUBLIC CODE + */ + +HINSTANCE gtkwgaim_hinstance(void) { + return gaimexe_hInstance; +} + +int gtkwgaim_gz_decompress(const char* in, const char* out) { + gzFile fin; + FILE *fout; + char buf[1024]; + int ret; + + if((fin = gzopen(in, "rb"))) { + if(!(fout = g_fopen(out, "wb"))) { + gaim_debug(GAIM_DEBUG_ERROR, "wgaim_gz_decompress", "Error opening file: %s\n", out); + gzclose(fin); + return 0; + } + } + else { + gaim_debug(GAIM_DEBUG_ERROR, "wgaim_gz_decompress", "gzopen failed to open: %s\n", in); + return 0; + } + + while((ret = gzread(fin, buf, 1024))) { + if(fwrite(buf, 1, ret, fout) < ret) { + gaim_debug(GAIM_DEBUG_ERROR, "wgaim_gz_decompress", "Error writing %d bytes to file\n", ret); + gzclose(fin); + fclose(fout); + return 0; + } + } + fclose(fout); + gzclose(fin); + + if(ret < 0) { + gaim_debug(GAIM_DEBUG_ERROR, "wgaim_gz_decompress", "gzread failed while reading: %s\n", in); + return 0; + } + + return 1; +} + +int gtkwgaim_gz_untar(const char* filename, const char* destdir) { + char tmpfile[_MAX_PATH]; + char template[]="wgaimXXXXXX"; + + sprintf(tmpfile, "%s%s%s", g_get_tmp_dir(), G_DIR_SEPARATOR_S, _mktemp(template)); + if(gtkwgaim_gz_decompress(filename, tmpfile)) { + int ret; + if(untar(tmpfile, destdir, UNTAR_FORCE | UNTAR_QUIET)) + ret = 1; + else { + gaim_debug(GAIM_DEBUG_ERROR, "wgaim_gz_untar", "Failure untaring %s\n", tmpfile); + ret = 0; + } + g_unlink(tmpfile); + return ret; + } + else { + gaim_debug(GAIM_DEBUG_ERROR, "wgaim_gz_untar", "Failed to gz decompress %s\n", filename); + return 0; + } +} + +void gtkwgaim_notify_uri(const char *uri) { + + /* We'll allow whatever URI schemes are supported by the + * default http browser. + */ + + if (G_WIN32_HAVE_WIDECHAR_API()) { + SHELLEXECUTEINFOW wsinfo; + wchar_t *w_uri; + + w_uri = g_utf8_to_utf16(uri, -1, NULL, NULL, NULL); + + memset(&wsinfo, 0, sizeof(wsinfo)); + wsinfo.cbSize = sizeof(wsinfo); + wsinfo.fMask = SEE_MASK_CLASSNAME; + wsinfo.lpVerb = L"open"; + wsinfo.lpFile = w_uri; + wsinfo.nShow = SW_SHOWNORMAL; + wsinfo.lpClass = L"http"; + + gaim_debug(GAIM_DEBUG_INFO, "wgaim_notify_uri", "The wide uri is %s\n", uri); + if(!ShellExecuteExW(&wsinfo)) + gaim_debug_error("wgaim", "Error opening URI: %s error: %d\n", + uri, (int) wsinfo.hInstApp); + + g_free(w_uri); + } else { + SHELLEXECUTEINFOA sinfo; + gchar *locale_uri; + + locale_uri = g_locale_from_utf8(uri, -1, NULL, NULL, NULL); + + memset(&sinfo, 0, sizeof(sinfo)); + sinfo.cbSize = sizeof(sinfo); + sinfo.fMask = SEE_MASK_CLASSNAME; + sinfo.lpVerb = "open"; + sinfo.lpFile = locale_uri; + sinfo.nShow = SW_SHOWNORMAL; + sinfo.lpClass = "http"; + + if(!ShellExecuteExA(&sinfo)) + gaim_debug_error("wgaim", "Error opening URI: %s error: %d\n", + uri, (int) sinfo.hInstApp); + + g_free(locale_uri); + } +} + +void gtkwgaim_init(HINSTANCE hint) { + gaim_debug_info("gtkwgaim", "gtkwgaim_init start\n"); + + gaimexe_hInstance = hint; + + /* IdleTracker Initialization */ + if(!wgaim_set_idlehooks()) + gaim_debug(GAIM_DEBUG_ERROR, "gtkwgaim", "Failed to initialize idle tracker\n"); + + wgaim_gtkspell_init(); + gaim_debug_info("gtkwgaim", "GTK+ :%u.%u.%u\n", + gtk_major_version, gtk_minor_version, gtk_micro_version); + + gaim_debug(GAIM_DEBUG_INFO, "gtkwgaim", "gtkwgaim_init end\n"); +} + +/* Windows Cleanup */ + +void gtkwgaim_cleanup(void) { + gaim_debug(GAIM_DEBUG_INFO, "gtkwgaim", "gtkwgaim_cleanup\n"); + + /* Idle tracker cleanup */ + wgaim_remove_idlehooks(); + +} + +/* DLL initializer */ +BOOL WINAPI DllMain( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved ) { + gtkgaimdll_hInstance = hinstDLL; + return TRUE; +} Property changes on: trunk/gtk/win32/gtkwin32dep.c ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Added: trunk/gtk/win32/gtkwin32dep.h =================================================================== --- trunk/gtk/win32/gtkwin32dep.h (rev 0) +++ trunk/gtk/win32/gtkwin32dep.h 2006-08-20 16:49:37 UTC (rev 16905) @@ -0,0 +1,40 @@ +/* + * gaim + * + * File: win32dep.h + * + * Copyright (C) 2002-2003, Herman Bloggs <her...@ya...> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ +#ifndef _GTKWIN32DEP_H_ +#define _GTKWIN32DEP_H_ + +HINSTANCE gtkwgaim_hinstance(void); + +/* Utility */ +int gtkwgaim_gz_decompress(const char* in, const char* out); +int gtkwgaim_gz_untar(const char* filename, const char* destdir); + +/* Misc */ +void gtkwgaim_notify_uri(const char *uri); + +/* init / cleanup */ +void gtkwgaim_init(HINSTANCE); +void gtkwgaim_cleanup(void); + +#endif /* _WIN32DEP_H_ */ + Property changes on: trunk/gtk/win32/gtkwin32dep.h ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + native Deleted: trunk/gtk/win32/libc_interface.c =================================================================== --- trunk/gtk/win32/libc_interface.c 2006-08-20 16:45:57 UTC (rev 16904) +++ trunk/gtk/win32/libc_interface.c 2006-08-20 16:49:37 UTC (rev 16905) @@ -1,990 +0,0 @@ -/* - * gaim - * - * Copyright (C) 2002-2003, Herman Bloggs <her...@ya...> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -#include <winsock2.h> -#include <ws2tcpip.h> -#include <io.h> -#include <stdlib.h> -#include <stdio.h> -#include <errno.h> -#include <sys/timeb.h> -#include <sys/stat.h> -#include <time.h> -#include <glib.h> -#include "debug.h" -#include "libc_internal.h" -#if GLIB_CHECK_VERSION(2,6,0) -# include <glib/gstdio.h> -#else -#define g_remove remove -#define g_rename rename -#define g_stat stat -#endif - -static char errbuf[1024]; - -/* helpers */ -static int wgaim_is_socket( int fd ) { - int optval; - unsigned int optlen = sizeof(int); - - if( (getsockopt(fd, SOL_SOCKET, SO_TYPE, (void*)&optval, &optlen)) == SOCKET_ERROR ) { - int error = WSAGetLastError(); - if( error == WSAENOTSOCK ) - return FALSE; - else { - gaim_debug(GAIM_DEBUG_WARNING, "wgaim", "wgaim_is_socket: getsockopt returned error: %d\n", error); - return FALSE; - } - } - return TRUE; -} - -/* socket.h */ -int wgaim_socket (int namespace, int style, int protocol) { - int ret; - - ret = socket( namespace, style, protocol ); - - if( ret == INVALID_SOCKET ) { - errno = WSAGetLastError(); - return -1; - } - return ret; -} - -int wgaim_connect(int socket, struct sockaddr *addr, u_long length) { - int ret; - - ret = connect( socket, addr, length ); - - if( ret == SOCKET_ERROR ) { - errno = WSAGetLastError(); - if( errno == WSAEWOULDBLOCK ) - errno = WSAEINPROGRESS; - return -1; - } - return 0; -} - -int wgaim_getsockopt(int socket, int level, int optname, void *optval, socklen_t *optlenptr) { - if(getsockopt(socket, level, optname, optval, optlenptr) == SOCKET_ERROR ) { - errno = WSAGetLastError(); - return -1; - } - return 0; -} - -int wgaim_setsockopt(int socket, int level, int optname, const void *optval, socklen_t optlen) { - if(setsockopt(socket, level, optname, optval, optlen) == SOCKET_ERROR ) { - errno = WSAGetLastError(); - return -1; - } - return 0; -} - -int wgaim_getsockname(int socket, struct sockaddr *addr, socklen_t *lenptr) { - if(getsockname(socket, addr, lenptr) == SOCKET_ERROR) { - errno = WSAGetLastError(); - return -1; - } - return 0; -} - -int wgaim_bind(int socket, struct sockaddr *addr, socklen_t length) { - if(bind(socket, addr, length) == SOCKET_ERROR) { - errno = WSAGetLastError(); - return -1; - } - return 0; -} - -int wgaim_listen(int socket, unsigned int n) { - if(listen(socket, n) == SOCKET_ERROR) { - errno = WSAGetLastError(); - return -1; - } - return 0; -} - -int wgaim_sendto(int socket, const void *buf, size_t len, int flags, const struct sockaddr *to, socklen_t tolen) { - int ret; - if ((ret = sendto(socket, buf, len, flags, to, tolen) - ) == SOCKET_ERROR) { - errno = WSAGetLastError(); - return -1; - } - return ret; -} - -/* fcntl.h */ -/* This is not a full implementation of fcntl. Update as needed.. */ -int wgaim_fcntl(int socket, int command, int val) { - switch( command ) { - case F_SETFL: - { - int ret=0; - - switch( val ) { - case O_NONBLOCK: - { - u_long imode=1; - ret = ioctlsocket(socket, FIONBIO, &imode); - break; - } - case 0: - { - u_long imode=0; - ret = ioctlsocket(socket, FIONBIO, &imode); - break; - } - default: - errno = EINVAL; - return -1; - }/*end switch*/ - if( ret == SOCKET_ERROR ) { - errno = WSAGetLastError(); - return -1; - } - return 0; - } - default: - gaim_debug(GAIM_DEBUG_WARNING, "wgaim", "wgaim_fcntl: Unsupported command\n"); - return -1; - }/*end switch*/ -} - -/* sys/ioctl.h */ -int wgaim_ioctl(int fd, int command, void* val) { - switch( command ) { - case FIONBIO: - { - if (ioctlsocket(fd, FIONBIO, (unsigned long *)val) == SOCKET_ERROR) { - errno = WSAGetLastError(); - return -1; - } - return 0; - } - case SIOCGIFCONF: - { - INTERFACE_INFO InterfaceList[20]; - unsigned long nBytesReturned; - if (WSAIoctl(fd, SIO_GET_INTERFACE_LIST, - 0, 0, &InterfaceList, - sizeof(InterfaceList), &nBytesReturned, - 0, 0) == SOCKET_ERROR) { - errno = WSAGetLastError(); - return -1; - } else { - int i; - struct ifconf *ifc = val; - char *tmp = ifc->ifc_buf; - int nNumInterfaces = - nBytesReturned / sizeof(INTERFACE_INFO); - for (i = 0; i < nNumInterfaces; i++) { - INTERFACE_INFO ii = InterfaceList[i]; - struct ifreq *ifr = (struct ifreq *) tmp; - struct sockaddr_in *sa = (struct sockaddr_in *) &ifr->ifr_addr; - - sa->sin_family = ii.iiAddress.AddressIn.sin_family; - sa->sin_port = ii.iiAddress.AddressIn.sin_port; - sa->sin_addr.s_addr = ii.iiAddress.AddressIn.sin_addr.s_addr; - tmp += sizeof(struct ifreq); - - /* Make sure that we can fit in the original buffer */ - if (tmp >= (ifc->ifc_buf + ifc->ifc_len + sizeof(struct ifreq))) { - break; - } - } - /* Replace the length with the actually used length */ - ifc->ifc_len = ifc->ifc_len - (ifc->ifc_buf - tmp); - return 0; - } - } - default: - errno = EINVAL; - return -1; - }/*end switch*/ -} - -/* arpa/inet.h */ -int wgaim_inet_aton(const char *name, struct in_addr *addr) { - if((addr->s_addr = inet_addr(name)) == INADDR_NONE) - return 0; - else - return 1; -} - -/* netdb.h */ -struct hostent* wgaim_gethostbyname(const char *name) { - struct hostent *hp; - - if((hp = gethostbyname(name)) == NULL) { - errno = WSAGetLastError(); - return NULL; - } - return hp; -} - -/* string.h */ -char* wgaim_strerror( int errornum ) { - if( errornum > WSABASEERR ) { - sprintf( errbuf, "Windows socket error #%d", errornum ); - return errbuf; - } - else - return strerror( errornum ); -} - -/* unistd.h */ - -/* - * We need to figure out whether fd is a file or socket handle. - */ -int wgaim_read(int fd, void *buf, unsigned int size) { - int ret; - - if(wgaim_is_socket(fd)) { - if((ret = recv(fd, buf, size, 0)) == SOCKET_ERROR) { - errno = WSAGetLastError(); - if(errno == WSAEWOULDBLOCK) - errno = EAGAIN; - return -1; - } -#if 0 - else if( ret == 0 ) { - /* connection has been gracefully closed */ - errno = WSAENOTCONN; - return -1; - } -#endif - else { - /* success reading socket */ - return ret; - } - } else { - /* fd is not a socket handle.. pass it off to read */ - return read(fd, buf, size); - } -} - -int wgaim_send(int fd, const void *buf, unsigned int size, int flags) { - int ret; - - ret = send(fd, buf, size, flags); - - if (ret == SOCKET_ERROR) { - errno = WSAGetLastError(); - if(errno == WSAEWOULDBLOCK) - errno = EAGAIN; - return -1; - } - return ret; -} - -int wgaim_write(int fd, const void *buf, unsigned int size) { - - if(wgaim_is_socket(fd)) - return wgaim_send(fd, buf, size, 0); - else - return write(fd, buf, size); -} - -int wgaim_recv(int fd, void *buf, size_t len, int flags) { - int ret; - - if((ret = recv(fd, buf, len, flags)) == SOCKET_ERROR) { - errno = WSAGetLastError(); - if(errno == WSAEWOULDBLOCK) - errno = EAGAIN; - return -1; - } else { - return ret; - } -} - -int wgaim_close(int fd) { - int ret; - - if( wgaim_is_socket(fd) ) { - if( (ret = closesocket(fd)) == SOCKET_ERROR ) { - errno = WSAGetLastError(); - return -1; - } - else - return 0; - } - else - return close(fd); -} - -int wgaim_gethostname(char *name, size_t size) { - if(gethostname(name, size) == SOCKET_ERROR) { - errno = WSAGetLastError(); - return -1; - } - return 0; -} - -/* sys/time.h */ - -int wgaim_gettimeofday(struct timeval *p, struct timezone *z) { - int res = 0; - struct _timeb timebuffer; - - if (z != 0) { - _tzset(); - z->tz_minuteswest = _timezone/60; - z->tz_dsttime = _daylight; - } - - if (p != 0) { - _ftime(&timebuffer); - p->tv_sec = timebuffer.time; /* seconds since 1-1-1970 */ - p->tv_usec = timebuffer.millitm*1000; /* microseconds */ - } - - return res; -} - -/* stdio.h */ - -int wgaim_rename (const char *oldname, const char *newname) { - struct stat oldstat, newstat; - - if(g_stat(oldname, &oldstat) == 0) { - /* newname exists */ - if(g_stat(newname, &newstat) == 0) { - /* oldname is a dir */ - if(_S_ISDIR(oldstat.st_mode)) { - if(!_S_ISDIR(newstat.st_mode)) { - return g_rename(oldname, newname); - } - /* newname is a dir */ - else { - /* This is not quite right.. If newname is empty and - is not a sub dir of oldname, newname should be - deleted and oldname should be renamed. - */ - gaim_debug(GAIM_DEBUG_WARNING, "wgaim", "wgaim_rename does not behave here as it should\n"); - return g_rename(oldname, newname); - } - } - /* oldname is not a dir */ - else { - /* newname is a dir */ - if(_S_ISDIR(newstat.st_mode)) { - errno = EISDIR; - return -1; - } - /* newname is not a dir */ - else { - g_remove(newname); - return g_rename(oldname, newname); - } - } - } - /* newname doesn't exist */ - else - return g_rename(oldname, newname); - } - else { - /* oldname doesn't exist */ - errno = ENOENT; - return -1; - } - -} - -/* time.h */ - -struct tm * wgaim_localtime_r (const time_t *time, struct tm *resultp) { - struct tm* tmptm; - - if(!time) - return NULL; - tmptm = localtime(time); - if(resultp && tmptm) - return memcpy(resultp, tmptm, sizeof(struct tm)); - else - return NULL; -} - -/* - * Used by gaim_utf8_strftime() by way of gaim_internal_strftime() - * in src/util.c - * - * Code derived from PostgreSQL src/timezone/pgtz.c: - * http://developer.postgresql.org/cvsweb.cgi/pgsql/src/timezone/pgtz.c - */ - -/* -PostgreSQL Database Management System -(formerly known as Postgres, then as Postgres95) - -Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group - -Portions Copyright (c) 1994, The Regents of the University of California - -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose, without fee, and without a written agreement -is hereby granted, provided that the above copyright notice and this -paragraph and the following two paragraphs appear in all copies. - -IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING -LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS -DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, -INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. - -*/ -static struct -{ - char *wstd; /* Windows name of standard timezone */ - char *wdst; /* Windows name of daylight timezone */ - char *ustd; /* Unix name of standard timezone */ - char *udst; /* Unix name of daylight timezone */ -} win32_tzmap[] = -{ - { - "", "", - "", "", - }, - /* - * This list was built from the contents of the registry at - * "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones" - * on Windows XP Professional SP1 - */ - { - "Afghanistan Standard Time", "Afghanistan Daylight Time", - "AFT", "AFT" - }, - { - "Alaskan Standard Time", "Alaskan Daylight Time", - "AKST", "AKDT" - }, - { - "Arab Standard Time", "Arab Daylight Time", - "AST", "AST" - }, - { - "Arabian Standard Time", "Arabian Daylight Time", - "GST", "GST" - }, - { - "Arabic Standard Time", "Arabic Daylight Time", - "AST", "ADT" - }, - { - "Atlantic Standard Time", "Atlantic Daylight Time", - "AST", "ADT" - }, - { - "AUS Central Standard Time", "AUS Central Daylight Time", - "CST", "CST" - }, - { - "AUS Eastern Standard Time", "AUS Eastern Daylight Time", - "EST", "EST" - }, - { - "Azores Standard Time", "Azores Daylight Time", - "AZOT", "AZOST" - }, - { - "Canada Central Standard Time", "Canada Central Daylight Time", - "CST", "MDT" - }, - { - "Cape Verde Standard Time", "Cape Verde Daylight Time", - "CVT", "CVST" - }, - { - "Caucasus Standard Time", "Caucasus Daylight Time", - "AZT", "AZST" - }, - { - "Cen. Australia Standard Time", "Cen. Australia Daylight Time", - "CST", "CST" - }, - { - "Central America Standard Time", "Central America Daylight Time", - "CST", "CDT" - }, - { - "Central Asia Standard Time", "Central Asia Daylight Time", - "BDT", "BDT" - }, - { - "Central Europe Standard Time", "Central Europe Daylight Time", - "CET", "CEST" - }, - { - "Central European Standard Time", "Central European Daylight Time", - "CET", "CEST" - }, - { - "Central Pacific Standard Time", "Central Pacific Daylight Time", - "NCT", "NCST" - }, - { - "Central Standard Time", "Central Daylight Time", - "CST", "CDT" - }, - { - "China Standard Time", "China Daylight Time", - "HKT", "HKST" - }, - { - "Dateline Standard Time", "Dateline Daylight Time", - "GMT+12", "GMT+12" - }, - { - "E. Africa Standard Time", "E. Africa Daylight Time", - "EAT", "EAT" - }, - { - "E. Australia Standard Time", "E. Australia Daylight Time", - "EST", "EST" - }, - { - "E. Europe Standard Time", "E. Europe Daylight Time", - "EET", "EEST" - }, - { - "E. South America Standard Time", "E. South America Daylight Time", - "BRT", "BRST" - }, - { - "Eastern Standard Time", "Eastern Daylight Time", - "EST", "EDT" - }, - { - "Egypt Standard Time", "Egypt Daylight Time", - "EET", "EEST" - }, - { - "Ekaterinburg Standard Time", "Ekaterinburg Daylight Time", - "YEKT", "YEKST" - }, - { - "Fiji Standard Time", "Fiji Daylight Time", - "FJT", "FJST" - }, - { - "FLE Standard Time", "FLE Daylight Time", - "EET", "EEST" - }, - { - "GMT Standard Time", "GMT Daylight Time", - "GMT", "IST" - }, - { - "Greenland Standard Time", "Greenland Daylight Time", - "WGT", "WGST" - }, - { - "Greenwich Standard Time", "Greenwich Daylight Time", - "WET", "WEST" - }, - { - "GTB Standard Time", "GTB Daylight Time", - "EET", "EEST" - }, - { - "Hawaiian Standard Time", "Hawaiian Daylight Time", - "HST", "HPT" - }, - { - "India Standard Time", "India Daylight Time", - "IST", "IST" - }, - { - "Iran Standard Time", "Iran Daylight Time", - "IRST", "IRDT" - }, - { - "Jerusalem Standard Time", "Jerusalem Daylight Time", - "IST", "IDT" - }, - { - "Korea Standard Time", "Korea Daylight Time", - "KST", "KDT" - }, - { - "Mexico Standard Time", "Mexico Daylight Time", - "CST", "CDT" - }, - { - "Mexico Standard Time", "Mexico Daylight Time", - "BOT", "BOST" - }, - { - "Mid-Atlantic Standard Time", "Mid-Atlantic Daylight Time", - "GST", "GST" - }, - { - "Mountain Standard Time", "Mountain Daylight Time", - "MST", "MDT" - }, - { - "Myanmar Standard Time", "Myanmar Daylight Time", - "MMT", "MMT" - }, - { - "N. Central Asia Standard Time", "N. Central Asia Daylight Time", - "ALMT", "ALMST" - }, - { - "Nepal Standard Time", "Nepal Daylight Time", - "NPT", "NPT" - }, - { - "New Zealand Standard Time", "New Zealand Daylight Time", - "NZST", "NZDT" - }, - { - "Newfoundland Standard Time", "Newfoundland Daylight Time", - "NST", "NDT" - }, - { - "North Asia East Standard Time", "North Asia East Daylight Time", - "IRKT", "IRKST" - }, - { - "North Asia Standard Time", "North Asia Daylight Time", - "KRAT", "KRAST" - }, - { - "Pacific SA Standard Time", "Pacific SA Daylight Time", - "CLT", "CLST" - }, - { - "Pacific Standard Time", "Pacific Daylight Time", - "PST", "PDT" - }, - { - "Romance Standard Time", "Romance Daylight Time", - "CET", "CEST" - }, - { - "Russian Standard Time", "Russian Daylight Time", - "MSK", "MSD" - }, - { - "SA Eastern Standard Time", "SA Eastern Daylight Time", - "ART", "ARST" - }, - { - "SA Pacific Standard Time", "SA Pacific Daylight Time", - "COT", "COST" - }, - { - "SA Western Standard Time", "SA Western Daylight Time", - "VET", "VET" - }, - { - "Samoa Standard Time", "Samoa Daylight Time", - "SST", "NDT" - }, - { - "SE Asia Standard Time", "SE Asia Daylight Time", - "ICT", "ICT" - }, - { - "Malay Peninsula Standard Time", "Malay Peninsula Daylight Time", - "MYT", "MALST" - }, - { - "South Africa Standard Time", "South Africa Daylight Time", - "CAT", "CAT" - }, - { - "Sri Lanka Standard Time", "Sri Lanka Daylight Time", - "LKT", "IST" - }, - { - "Taipei Standard Time", "Taipei Daylight Time", - "CST", "CDT" - }, - { - "Tasmania Standard Time", "Tasmania Daylight Time", - "EST", "EST" - }, - { - "Tokyo Standard Time", "Tokyo Daylight Time", - "JST", "JDT" - }, - { - "Tonga Standard Time", "Tonga Daylight Time", - "TOT", "TOST" - }, - { - "US Eastern Standard Time", "US Eastern Daylight Time", - "EST", "EDT" - }, - { - "US Mountain Standard Time", "US Mountain Daylight Time", - "MST", "MDT" - }, - { - "Vladivostok Standard Time", "Vladivostok Daylight Time", - "VLAT", "VLAST" - }, - { - "W. Australia Standard Time", "W. Australia Daylight Time", - "WST", "WST" - }, - - /* Not mapped in PostgreSQL. - * - * I mapped this based on the following information... -- rlaager - * $ cd /usr/share/zoneinfo/Africa - * $ for i in * ; do echo `TZ=Africa/$i date +"%z %Z"` $i ; done | grep +0100 - * +0100 CET Algiers - * +0100 WAT Bangui - * +0100 WAT Brazzaville - * +0100 CET Ceuta - * +0100 WAT Douala - * +0100 WAT Kinshasa - * +0100 WAT Lagos - * +0100 WAT Libreville - * +0100 WAT Luanda - * +0100 WAT Malabo - * +0100 WAT Ndjamena - * +0100 WAT Niamey - * +0100 WAT Porto-Novo - * +0100 CET Tunis - **/ - { - "W. Central Africa Standard Time", "W. Central Africa Daylight Time", - "WAT", "WAT" - }, - - { - "W. Europe Standard Time", "W. Europe Daylight Time", - "CET", "CEST" - }, - { - "West Asia Standard Time", "West Asia Daylight Time", - "PKT", "PKST" - }, - { - "West Pacific Standard Time", "West Pacific Daylight Time", - "ChST", "ChST" - }, - { - "Yakutsk Standard Time", "Yakutsk Daylight Time", - "YAKT", "YAKST" - }, - { - NULL, NULL, - NULL, NULL - } -}; - -const char * -wgaim_get_timezone_abbreviation(const struct tm *tm) -{ - int i; - char tzname[128]; - char localtzname[256]; - HKEY rootKey; - int idx; - - if (!tm) - { - gaim_debug_warning("wgaim", "could not determine current date/time: localtime failed\n"); - return ""; - } - - if (strftime(tzname, sizeof(tzname) - 1, "%Z", tm) == 0) - { - gaim_debug_error("wgaim", "timezone name is too long for the buffer\n"); - return ""; - } - - for (i = 0; win32_tzmap[i].wstd != NULL; i++) - { - if (strcmp(tzname, win32_tzmap[i].wstd) == 0) - { -#if 0 - gaim_debug_info("wgaim", "TZ \"%s\" matches Windows timezone \"%s\"\n", - win32_tzmap[i].ustd, tzname); -#endif - /* Cache the Result */ - if (i > 0) { - if (win32_tzmap[0].wstd[0] != '\0') - g_free(win32_tzmap[0].wstd); - win32_tzmap[0].wstd = g_strdup(tzname); - win32_tzmap[0].ustd = win32_tzmap[i].ustd; - } - - return win32_tzmap[i].ustd; - } - if (strcmp(tzname, win32_tzmap[i].wdst) == 0) - { -#if 0 - gaim_debug_info("wgaim", "TZ \"%s\" matches Windows timezone \"%s\"\n", - win32_tzmap[i].udst, tzname); -#endif - /* Cache the Result */ - if (i > 0) { - if (win32_tzmap[0].wdst[0] != '\0') - g_free(win32_tzmap[0].wdst); - win32_tzmap[0].wdst = g_strdup(tzname); - win32_tzmap[0].udst = win32_tzmap[i].udst; - } - - return win32_tzmap[i].udst; - } - } - - /* - * Localized Windows versions return localized names for the timezone. - * Scan the registry to find the English name, and then try matching - * against our table again. - */ - memset(localtzname, 0, sizeof(localtzname)); - if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, - "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Time Zones", - 0, - KEY_READ, - &rootKey) != ERROR_SUCCESS) - { - gaim_debug_warning("wgaim", "could not open registry key to identify Windows timezone: %i\n", (int) GetLastError()); - return ""; - } - - for (idx = 0;; idx++) - { - char keyname[256]; - char zonename[256]; - DWORD namesize; - FILETIME lastwrite; - HKEY key; - LONG r; - - memset(keyname, 0, sizeof(keyname)); - namesize = sizeof(keyname); - if ((r = RegEnumKeyEx(rootKey, - idx, - keyname, - &namesize, - NULL, - NULL, - NULL, - &lastwrite)) != ERROR_SUCCESS) - { - if (r == ERROR_NO_MORE_ITEMS) - break; - gaim_debug_warning("wgaim", "could not enumerate registry subkeys to identify Windows timezone: %i\n", (int) r); - break; - } - - if ((r = RegOpenKeyEx(rootKey, keyname, 0, KEY_READ, &key)) != ERROR_SUCCESS) - { - gaim_debug_warning("wgaim", "could not open registry subkey to identify Windows timezone: %i\n", (int) r); - break; - } - - memset(zonename, 0, sizeof(zonename)); - namesize = sizeof(zonename); - if ((r = RegQueryValueEx(key, "Std", NULL, NULL, zonename, &namesize)) != ERROR_SUCCESS) - { - gaim_debug_warning("wgaim", "could not query value for 'std' to identify Windows timezone: %i\n", (int) r); - RegCloseKey(key); - break; - } - if (strcmp(tzname, zonename) == 0) - { - /* Matched zone */ - strcpy(localtzname, keyname); - RegCloseKey(key); - break; - } - memset(zonename, 0, sizeof(zonename)); - namesize = sizeof(zonename); - if ((r = RegQueryValueEx(key, "Dlt", NULL, NULL, zonename, &namesize)) != ERROR_SUCCESS) - { - gaim_debug_warning("wgaim", "could not query value for 'dlt' to identify Windows timezone: %i\n", (int) r); - RegCloseKey(key); - break; - } - if (strcmp(tzname, zonename) == 0) - { - /* Matched DST zone */ - strcpy(localtzname, keyname); - RegCloseKey(key); - break; - } - - RegCloseKey(key); - } - - RegCloseKey(rootKey); - - if (localtzname[0]) - { - /* Found a localized name, so scan for that one too */ - for (i = 0; win32_tzmap[i].wstd != NULL; i++) - { - if (strcmp(localtzname, win32_tzmap[i].wstd) == 0) - { -#if 0 - gaim_debug_info("wgaim", "TZ \"%s\" matches localized Windows timezone \"%s\" (\"%s\")\n", - win32_tzmap[i].ustd, tzname, localtznam... [truncated message content] |