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 <hermanator12002@...>
+ *
+ * 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 <hermanator12002@...>
+ *
+ * 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 <hermanator12002@...>
- *
- * 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, localtzname);
-#endif
- /* Cache the Result */
- 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(localtzname, win32_tzmap[i].wdst) == 0)
- {
-#if 0
- gaim_debug_info("wgaim", "TZ \"%s\" matches localized Windows timezone \"%s\" (\"%s\")\n",
- win32_tzmap[i].udst, tzname, localtzname);
-#endif
- /* Cache the Result */
- 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;
- }
- }
- }
-
- gaim_debug_warning("wgaim", "could not find a match for Windows timezone \"%s\"\n", tzname);
- return "";
-}
-
Deleted: trunk/gtk/win32/libc_interface.h
===================================================================
--- trunk/gtk/win32/libc_interface.h 2006-08-20 16:45:57 UTC (rev 16904)
+++ trunk/gtk/win32/libc_interface.h 2006-08-20 16:49:37 UTC (rev 16905)
@@ -1,169 +0,0 @@
-/*
- * gaim
- *
- * File: libc_interface.h
- *
- * Copyright (C) 2002-2003, Herman Bloggs <hermanator12002@...>
- *
- * 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 _LIBC_INTERFACE_H_
-#define _LIBC_INTERFACE_H_
-#include <winsock2.h>
-#include <ws2tcpip.h>
-#include <io.h>
-#include <errno.h>
-#include "libc_internal.h"
-#include <glib.h>
-
-/* sys/socket.h */
-int wgaim_socket(int namespace, int style, int protocol);
-#define socket( namespace, style, protocol ) \
-wgaim_socket( namespace, style, protocol )
-
-int wgaim_connect(int socket, struct sockaddr *addr, u_long length);
-#define connect( socket, addr, length ) \
-wgaim_connect( socket, addr, length )
-
-int wgaim_getsockopt(int socket, int level, int optname, void *optval, socklen_t *optlenptr);
-#define getsockopt( args... ) \
-wgaim_getsockopt( args )
-
-int wgaim_setsockopt(int socket, int level, int optname, const void *optval, socklen_t optlen);
-#define setsockopt( args... ) \
-wgaim_setsockopt( args )
-
-int wgaim_getsockname (int socket, struct sockaddr *addr, socklen_t *lenptr);
-#define getsockname( socket, addr, lenptr ) \
-wgaim_getsockname( socket, addr, lenptr )
-
-int wgaim_bind(int socket, struct sockaddr *addr, socklen_t length);
-#define bind( socket, addr, length ) \
-wgaim_bind( socket, addr, length )
-
-int wgaim_listen(int socket, unsigned int n);
-#define listen( socket, n ) \
-wgaim_listen( socket, n )
-
-int wgaim_sendto(int socket, const void *buf, size_t len, int flags, const struct sockaddr *to, socklen_t tolen);
-#define sendto(socket, buf, len, flags, to, tolen) \
-wgaim_sendto(socket, buf, len, flags, to, tolen)
-
-/* sys/ioctl.h */
-int wgaim_ioctl(int fd, int command, void* opt);
-#define ioctl( fd, command, val ) \
-wgaim_ioctl( fd, command, val )
-
-/* fcntl.h */
-int wgaim_fcntl(int socket, int command, int val);
-#define fcntl( fd, command, val ) \
-wgaim_fcntl( fd, command, val )
-
-#if !GLIB_CHECK_VERSION(2,6,0)
-# define open( args... ) _open( args )
-#endif
-
-/* arpa/inet.h */
-int wgaim_inet_aton(const char *name, struct in_addr *addr);
-#define inet_aton( name, addr ) \
-wgaim_inet_aton( name, addr )
-
-/* netdb.h */
-struct hostent* wgaim_gethostbyname(const char *name);
-#define gethostbyname( name ) \
-wgaim_gethostbyname( name )
-
-/* netinet/in.h */
-#define ntohl( netlong ) \
-(unsigned int)ntohl( netlong )
-
-/* string.h */
-char* wgaim_strerror( int errornum );
-#define hstrerror( herror ) \
-wgaim_strerror( errno )
-#define strerror( errornum ) \
-wgaim_strerror( errornum )
-
-#define bzero( dest, size ) memset( dest, 0, size )
-
-/* unistd.h */
-int wgaim_read(int fd, void *buf, unsigned int size);
-#define read( fd, buf, buflen ) \
-wgaim_read( fd, buf, buflen )
-
-int wgaim_write(int fd, const void *buf, unsigned int size);
-#define write( socket, buf, buflen ) \
-wgaim_write( socket, buf, buflen )
-
-int wgaim_recv(int fd, void *buf, size_t len, int flags);
-#define recv(fd, buf, len, flags) \
-wgaim_recv(fd, buf, len, flags)
-
-int wgaim_send(int fd, const void *buf, unsigned int size, int flags);
-#define send(socket, buf, buflen, flags) \
-wgaim_send(socket, buf, buflen, flags)
-
-int wgaim_close(int fd);
-#define close( fd ) \
-wgaim_close( fd )
-
-#ifndef sleep
-#define sleep(x) Sleep((x)*1000)
-#endif
-
-int wgaim_gethostname(char *name, size_t size);
-#define gethostname( name, size ) \
-wgaim_gethostname( name, size )
-
-/* sys/time.h */
-int wgaim_gettimeofday(struct timeval *p, struct timezone *z);
-#define gettimeofday( timeval, timezone ) \
-wgaim_gettimeofday( timeval, timezone )
-
-/* stdio.h */
-#define snprintf _snprintf
-#define vsnprintf _vsnprintf
-
-int wgaim_rename(const char *oldname, const char *newname);
-#define rename( oldname, newname ) \
-wgaim_rename( oldname, newname )
-
-#if GLIB_CHECK_VERSION(2,6,0)
-#ifdef g_rename
-# undef g_rename
-#endif
-/* This is necessary because we want rename on win32 to be able to overwrite an existing file, it is done in internal.h if GLib < 2.6*/
-#define g_rename(oldname, newname) \
-wgaim_rename(oldname, newname)
-#endif
-
-
-/* sys/stat.h */
-
-#if !GLIB_CHECK_VERSION(2,6,0)
-#define mkdir(a,b) _mkdir((a))
-#endif
-#define fchmod(a,b)
-
-/* time.h */
-struct tm *wgaim_localtime_r(const time_t *time, struct tm *resultp);
-#define localtime_r( time, resultp ) \
-wgaim_localtime_r( time, resultp )
-
-/* helper for gaim_utf8_strftime() by way of gaim_internal_strftime() in src/util.c */
-const char *wgaim_get_timezone_abbreviation(const struct tm *tm);
-
-#endif /* _LIBC_INTERFACE_H_ */
Deleted: trunk/gtk/win32/libc_internal.h
===================================================================
--- trunk/gtk/win32/libc_internal.h 2006-08-20 16:45:57 UTC (rev 16904)
+++ trunk/gtk/win32/libc_internal.h 2006-08-20 16:49:37 UTC (rev 16905)
@@ -1,94 +0,0 @@
-/*
- * gaim
- *
- * File: libc_internal.h
- *
- * Copyright (C) 2002-2003, Herman Bloggs <hermanator12002@...>
- *
- * 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 _LIBC_INTERNAL_
-#define _LIBC_INTERNAL_
-
-/* fcntl.h */
-#define F_SETFL 1
-#define O_NONBLOCK 1
-
-/* ioctl.h */
-#define SIOCGIFCONF 0x8912 /* get iface list */
-
-/* net/if.h */
-struct ifreq
-{
- union
- {
- char ifrn_name[6]; /* Interface name, e.g. "en0". */
- } ifr_ifrn;
-
- union
- {
- struct sockaddr ifru_addr;
-#if 0
- struct sockaddr ifru_dstaddr;
- struct sockaddr ifru_broadaddr;
- struct sockaddr ifru_netmask;
- struct sockaddr ifru_hwaddr;
- short int ifru_flags;
- int ifru_ivalue;
- int ifru_mtu;
-#endif
- char *ifru_data;
- } ifr_ifru;
-};
-# define ifr_name ifr_ifrn.ifrn_name /* interface name */
-# define ifr_addr ifr_ifru.ifru_addr /* address */
-#if 0
-# define ifr_hwaddr ifr_ifru.ifru_hwaddr /* MAC address */
-# define ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of p-p lnk */
-# define ifr_broadaddr ifr_ifru.ifru_broadaddr /* broadcast address */
-# define ifr_netmask ifr_ifru.ifru_netmask /* interface net mask */
-# define ifr_flags ifr_ifru.ifru_flags /* flags */
-# define ifr_metric ifr_ifru.ifru_ivalue /* metric */
-# define ifr_mtu ifr_ifru.ifru_mtu /* mtu */
-#endif
-# define ifr_data ifr_ifru.ifru_data /* for use by interface */
-#if 0
-# define ifr_ifindex ifr_ifru.ifru_ivalue /* interface index */
-# define ifr_bandwidth ifr_ifru.ifru_ivalue /* link bandwidth */
-# define ifr_qlen ifr_ifru.ifru_ivalue /* queue length */
-#endif
-
-
-struct ifconf
-{
- int ifc_len; /* Size of buffer. */
- union
- {
- char *ifcu_buf;
- struct ifreq *ifcu_req;
- } ifc_ifcu;
-};
-# define ifc_buf ifc_ifcu.ifcu_buf /* Buffer address. */
-# define ifc_req ifc_ifcu.ifcu_req /* Array of structures. */
-
-/* sys/time.h */
-struct timezone {
- int tz_minuteswest;
- int tz_dsttime;
-};
-
-
-#endif /* _LIBC_INTERNAL_ */
Deleted: trunk/gtk/win32/wgaimerror.h
===================================================================
--- trunk/gtk/win32/wgaimerror.h 2006-08-20 16:45:57 UTC (rev 16904)
+++ trunk/gtk/win32/wgaimerror.h 2006-08-20 16:49:37 UTC (rev 16905)
@@ -1,58 +0,0 @@
-/*
- * gaim
- *
- * File: wgaimerror.h
- * Date: October 14, 2002
- * Description: Convert Winsock errors to Unix errors
- *
- * Copyright (C) 2002-2003, Herman Bloggs <hermanator12002@...>
- *
- * 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 _WGAIMERROR_H
-#define _WGAIMERROR_H
-
-/* Here we define unix socket errors as windows socket errors */
-
-#define ENETDOWN WSAENETDOWN
-#define EAFNOSUPPORT WSAEAFNOSUPPORT
-#define EINPROGRESS WSAEINPROGRESS
-#define ENOBUFS WSAENOBUFS
-#define EPROTONOSUPPORT WSAEPROTONOSUPPORT
-#define EPROTOTYPE WSAEPROTOTYPE
-#define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT
-
-#define EADDRINUSE WSAEADDRINUSE
-#define EINPROGRESS WSAEINPROGRESS
-#define EALREADY WSAEALREADY
-#define EADDRNOTAVAIL WSAEADDRNOTAVAIL
-#define ECONNREFUSED WSAECONNREFUSED
-#define EISCONN WSAEISCONN
-#define ENETUNREACH WSAENETUNREACH
-#define ENOTSOCK WSAENOTSOCK
-#define ETIMEDOUT WSAETIMEDOUT
-#define EWOULDBLOCK WSAEWOULDBLOCK
-
-#define ENOTCONN WSAENOTCONN
-#define ENETRESET WSAENETRESET
-#define EOPNOTSUPP WSAEOPNOTSUPP
-#define ESHUTDOWN WSAESHUTDOWN
-#define EMSGSIZE WSAEMSGSIZE
-#define ECONNABORTED WSAECONNABORTED
-#define ECONNRESET WSAECONNRESET
-#define EHOSTUNREACH WSAEHOSTUNREACH
-
-#endif /* end _WGAIMERROR_H */
Deleted: trunk/gtk/win32/win32dep.c
===================================================================
--- trunk/gtk/win32/win32dep.c 2006-08-20 16:45:57 UTC (rev 16904)
+++ trunk/gtk/win32/win32dep.c 2006-08-20 16:49:37 UTC (rev 16905)
@@ -1,478 +0,0 @@
-/*
- * gaim
- *
- * File: win32dep.c
- * Date: June, 2002
- * Description: Windows dependant code for Gaim
- *
- * Copyright (C) 2002-2003, Herman Bloggs <hermanator12002@...>
- *
- * 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 "gaim.h"
-#include "debug.h"
-#include "notify.h"
-
-#include "resource.h"
-#include "idletrack.h"
-#include "zlib.h"
-#include "untar.h"
-
-#include <libintl.h>
-
-#include "win32dep.h"
-
-/*
- * DEFINES & MACROS
- */
-#define _(x) gettext(x)
-
-/*
- * DATA STRUCTS
- */
-
-/* For shfolder.dll */
-typedef HRESULT (CALLBACK* LPFNSHGETFOLDERPATHA)(HWND, int, HANDLE, DWORD, LPSTR);
-typedef HRESULT (CALLBACK* LPFNSHGETFOLDERPATHW)(HWND, int, HANDLE, DWORD, LPWSTR);
-
-/*
- * LOCALS
- */
-static char *app_data_dir, *install_dir, *lib_dir, *locale_dir;
-
-/*
- * GLOBALS
- */
-HINSTANCE gaimexe_hInstance = 0;
-HINSTANCE gaimdll_hInstance = 0;
-
-/*
- * PROTOS
- */
-
-FARPROC wgaim_find_and_loadproc(char*, char*);
-char* wgaim_data_dir(void);
-
-/*
- * STATIC CODE
- */
-
-static void wgaim_debug_print(GaimDebugLevel level, const char *category, const char *format, va_list args) {
- char *str = NULL;
- if (args != NULL) {
- str = g_strdup_vprintf(format, args);
- } else {
- str = g_strdup(format);
- }
- printf("%s%s%s", category ? category : "", category ? ": " : "", str);
- g_free(str);
-}
-
-static GaimDebugUiOps ops = {
- wgaim_debug_print
-};
-
-/*
- * PUBLIC CODE
- */
-
-HINSTANCE wgaim_hinstance(void) {
- return gaimexe_hInstance;
-}
-
-/* Escape windows dir separators. This is needed when paths are saved,
- and on being read back have their '\' chars used as an escape char.
- Returns an allocated string which needs to be freed.
-*/
-char* wgaim_escape_dirsep(char* filename) {
- int sepcount = 0;
- char* ret = NULL;
- int cnt = 0;
-
- ret = filename;
- while(*ret) {
- if(*ret == '\\')
- sepcount++;
- ret++;
- }
- ret = g_malloc0(strlen(filename) + sepcount + 1);
- while(*filename) {
- ret[cnt] = *filename;
- if(*filename == '\\')
- ret[++cnt] = '\\';
- filename++;
- cnt++;
- }
- ret[cnt] = '\0';
- return ret;
-}
-
-/* Determine whether the specified dll contains the specified procedure.
- If so, load it (if not already loaded). */
-FARPROC wgaim_find_and_loadproc(char* dllname, char* procedure) {
- HMODULE hmod;
- BOOL did_load = FALSE;
- FARPROC proc = 0;
-
- if(!(hmod = GetModuleHandle(dllname))) {
- gaim_debug(GAIM_DEBUG_WARNING, "wgaim", "%s not already loaded; loading it...\n", dllname);
- if(!(hmod = LoadLibrary(dllname))) {
- gaim_debug(GAIM_DEBUG_ERROR, "wgaim", "Could not load: %s\n", dllname);
- return NULL;
- }
- else
- did_load = TRUE;
- }
-
- if((proc = GetProcAddress(hmod, procedure))) {
- gaim_debug(GAIM_DEBUG_INFO, "wgaim", "This version of %s contains %s\n",
- dllname, procedure);
- return proc;
- }
- else {
- gaim_debug(GAIM_DEBUG_WARNING, "wgaim", "Function %s not found in dll %s\n",
- procedure, dllname);
- if(did_load) {
- /* unload dll */
- FreeLibrary(hmod);
- }
- return NULL;
- }
-}
-
-/* Determine Gaim Paths during Runtime */
-
-/* Get paths to special Windows folders. */
-char *wgaim_get_special_folder(int folder_type) {
- static LPFNSHGETFOLDERPATHA MySHGetFolderPathA = NULL;
- static LPFNSHGETFOLDERPATHW MySHGetFolderPathW = NULL;
- char *retval = NULL;
-
- if (!MySHGetFolderPathW) {
- MySHGetFolderPathW = (LPFNSHGETFOLDERPATHW)
- wgaim_find_and_loadproc("shfolder.dll", "SHGetFolderPathW");
- }
-
- if (MySHGetFolderPathW) {
- wchar_t utf_16_dir[MAX_PATH + 1];
-
- if (SUCCEEDED(MySHGetFolderPathW(NULL, folder_type, NULL,
- SHGFP_TYPE_CURRENT, utf_16_dir))) {
- retval = g_utf16_to_utf8(utf_16_dir, -1, NULL, NULL, NULL);
- }
- }
-
- if (!retval) {
- if (!MySHGetFolderPathA) {
- MySHGetFolderPathA = (LPFNSHGETFOLDERPATHA)
- wgaim_find_and_loadproc("shfolder.dll", "SHGetFolderPathA");
- }
- if (MySHGetFolderPathA) {
- char locale_dir[MAX_PATH + 1];
-
- if (SUCCEEDED(MySHGetFolderPathA(NULL, folder_type, NULL,
- SHGFP_TYPE_CURRENT, locale_dir))) {
- retval = g_locale_to_utf8(locale_dir, -1, NULL, NULL, NULL);
- }
- }
- }
-
- return retval;
-}
-
-char* wgaim_install_dir(void) {
- static gboolean initialized = FALSE;
-
- if (!initialized) {
- char *tmp = NULL;
- if (G_WIN32_HAVE_WIDECHAR_API()) {
- wchar_t winstall_dir[MAXPATHLEN];
- if (GetModuleFileNameW(NULL, winstall_dir,
- MAXPATHLEN) > 0) {
- tmp = g_utf16_to_utf8(winstall_dir, -1,
- NULL, NULL, NULL);
- }
- } else {
- gchar cpinstall_dir[MAXPATHLEN];
- if (GetModuleFileNameA(NULL, cpinstall_dir,
- MAXPATHLEN) > 0) {
- tmp = g_locale_to_utf8(cpinstall_dir,
- -1, NULL, NULL, NULL);
- }
- }
-
- if (tmp == NULL) {
- tmp = g_win32_error_message(GetLastError());
- gaim_debug(GAIM_DEBUG_ERROR, "wgaim",
- "GetModuleFileName error: %s\n", tmp);
- g_free(tmp);
- return NULL;
- } else {
- install_dir = g_path_get_dirname(tmp);
- g_free(tmp);
- initialized = TRUE;
- }
- }
-
- return install_dir;
-}
-
-char* wgaim_lib_dir(void) {
- static gboolean initialized = FALSE;
-
- if (!initialized) {
- char *inst_dir = wgaim_install_dir();
- if (inst_dir != NULL) {
- lib_dir = g_strdup_printf("%s" G_DIR_SEPARATOR_S "plugins", inst_dir);
- initialized = TRUE;
- } else {
- return NULL;
- }
- }
-
- return lib_dir;
-}
-
-char* wgaim_locale_dir(void) {
- static gboolean initialized = FALSE;
-
- if (!initialized) {
- char *inst_dir = wgaim_install_dir();
- if (inst_dir != NULL) {
- locale_dir = g_strdup_printf("%s" G_DIR_SEPARATOR_S "locale", inst_dir);
- initialized = TRUE;
- } else {
- return NULL;
- }
- }
-
- return locale_dir;
-}
-
-char* wgaim_data_dir(void) {
- return app_data_dir;
-}
-
-/* Miscellaneous */
-
-gboolean wgaim_read_reg_string(HKEY key, char* sub_key, char* val_name, LPBYTE data, LPDWORD data_len) {
- HKEY hkey;
- gboolean ret = FALSE;
-
- if(ERROR_SUCCESS == RegOpenKeyEx(key, sub_key, 0, KEY_QUERY_VALUE,
- &hkey)) {
- if(ERROR_SUCCESS == RegQueryValueEx(hkey, val_name, 0, NULL,
- data, data_len))
- ret = TRUE;
- RegCloseKey(key);
- }
- return ret;
-}
-
-int wgaim_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 wgaim_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(wgaim_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 wgaim_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 wgaim_init(HINSTANCE hint) {
- WORD wVersionRequested;
- WSADATA wsaData;
- const char *perlenv;
- char *newenv;
-
- gaim_debug_set_ui_ops(&ops);
- gaim_debug_info("wgaim", "wgaim_init start\n");
-
- gaim_debug_info("wgaim", "Glib:%u.%u.%u\n",
- glib_major_version, glib_minor_version, glib_micro_version);
-
- gaimexe_hInstance = hint;
-
- /* Winsock init */
- wVersionRequested = MAKEWORD(2, 2);
- WSAStartup(wVersionRequested, &wsaData);
-
- /* Confirm that the winsock DLL supports 2.2 */
- /* Note that if the DLL supports versions greater than
- 2.2 in addition to 2.2, it will still return 2.2 in
- wVersion since that is the version we requested. */
- if(LOBYTE(wsaData.wVersion) != 2 || HIBYTE(wsaData.wVersion) != 2) {
- gaim_debug(GAIM_DEBUG_WARNING, "wgaim", "Could not find a usable WinSock DLL. Oh well.\n");
- WSACleanup();
- }
-
- /* Set Environmental Variables */
- /* Tell perl where to find Gaim's perl modules */
- perlenv = g_getenv("PERL5LIB");
- newenv = g_strdup_printf("PERL5LIB=%s%s%s" G_DIR_SEPARATOR_S "perlmod;",
- perlenv ? perlenv : "",
- perlenv ? ";" : "",
- wgaim_install_dir());
- if (putenv(newenv) < 0)
- gaim_debug(GAIM_DEBUG_WARNING, "wgaim", "putenv failed\n");
- g_free(newenv);
-
- /* Set app data dir, used by gaim_home_dir */
- newenv = (char*) g_getenv("GAIMHOME");
- if (newenv) {
- app_data_dir = g_strdup(newenv);
- } else {
- app_data_dir = wgaim_get_special_folder(CSIDL_APPDATA);
- if (!app_data_dir) {
- app_data_dir = g_strdup("C:");
- }
- }
-
- gaim_debug(GAIM_DEBUG_INFO, "wgaim", "Gaim settings dir: %s\n", app_data_dir);
-
- /* IdleTracker Initialization */
- if(!wgaim_set_idlehooks())
- gaim_debug(GAIM_DEBUG_ERROR, "wgaim", "Failed to initialize idle tracker\n");
-
- gaim_debug(GAIM_DEBUG_INFO, "wgaim", "wgaim_init end\n");
-}
-
-/* Windows Cleanup */
-
-void wgaim_cleanup(void) {
- gaim_debug(GAIM_DEBUG_INFO, "wgaim", "wgaim_cleanup\n");
-
- /* winsock cleanup */
- WSACleanup();
-
- /* Idle tracker cleanup */
- wgaim_remove_idlehooks();
-
- g_free(app_data_dir);
-}
-
-/* DLL initializer */
-BOOL WINAPI DllMain( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved ) {
- gaimdll_hInstance = hinstDLL;
- return TRUE;
-}
Deleted: trunk/gtk/win32/win32dep.h
===================================================================
--- trunk/gtk/win32/win32dep.h 2006-08-20 16:45:57 UTC (rev 16904)
+++ trunk/gtk/win32/win32dep.h 2006-08-20 16:49:37 UTC (rev 16905)
@@ -1,75 +0,0 @@
-/*
- * gaim
- *
- * File: win32dep.h
- *
- * Copyright (C) 2002-2003, Herman Bloggs <hermanator12002@...>
- *
- * 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 _WIN32DEP_H_
-#define _WIN32DEP_H_
-#include <shlobj.h>
-#include <winsock2.h>
-#include <process.h>
-#include "wgaimerror.h"
-#include "libc_interface.h"
-
-/*
- * PROTOS
- */
-
-/**
- ** win32dep.c
- **/
-/* Windows helper functions */
-HINSTANCE wgaim_hinstance(void);
-FARPROC wgaim_find_and_loadproc(char*, char*);
-gboolean wgaim_read_reg_string(HKEY key, char* sub_key, char* val_name, LPBYTE data, LPDWORD data_len);
-char* wgaim_escape_dirsep(char*);
-
-/* Determine Gaim paths */
-char* wgaim_get_special_folder(int folder_type); /* needs to be g_free'd */
-char* wgaim_install_dir(void);
-char* wgaim_lib_dir(void);
-char* wgaim_locale_dir(void);
-char* wgaim_data_dir(void);
-
-/* Utility */
-int wgaim_gz_decompress(const char* in, const char* out);
-int wgaim_gz_untar(const char* filename, const char* destdir);
-
-/* Misc */
-void wgaim_notify_uri(const char *uri);
-
-/* init / cleanup */
-void wgaim_init(HINSTANCE);
-void wgaim_cleanup(void);
-
-
-/*
- * MACROS
- */
-
-/*
- * Gaim specific
- */
-#define DATADIR wgaim_install_dir()
-#define LIBDIR wgaim_lib_dir()
-#define LOCALEDIR wgaim_locale_dir()
-
-#endif /* _WIN32DEP_H_ */
-
Added: trunk/gtk/win32/win_gaim.c
===================================================================
--- trunk/gtk/win32/win_gaim.c (rev 0)
+++ trunk/gtk/win32/win_gaim.c 2006-08-20 16:49:37 UTC (rev 16905)
@@ -0,0 +1,544 @@
+/*
+ * win_gaim.c
+ *
+ * Date: June, 2002
+ * Description: Entry point for win32 gaim, and various win32 dependant
+ * routines.
+ *
+ * Gaim is the legal property of its developers, whose names are too numerous
+ * to list here. Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+/* This is for ATTACH_PARENT_PROCESS */
+#ifndef _WIN32_WINNT
+#define _WIN32_WINNT 0x501
+#endif
+#include <windows.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+
+#define WIN32_PROXY_REGKEY "Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings"
+
+typedef int (CALLBACK* LPFNGAIMMAIN)(HINSTANCE, int, char**);
+typedef void (CALLBACK* LPFNSETDLLDIRECTORY)(LPCTSTR);
+typedef BOOL (CALLBACK* LPFNATTACHCONSOLE)(DWORD);
+
+/*
+ * PROTOTYPES
+ */
+static LPFNGAIMMAIN gaim_main = NULL;
+static LPFNSETDLLDIRECTORY MySetDllDirectory = NULL;
+
+
+static BOOL read_reg_string(HKEY key, char* sub_key, char* val_name, LPBYTE data, LPDWORD data_len) {
+ HKEY hkey;
+ BOOL ret = FALSE;
+ LONG retv;
+
+ if (ERROR_SUCCESS == (retv = RegOpenKeyEx(key, sub_key, 0,
+ KEY_QUERY_VALUE, &hkey))) {
+ if (ERROR_SUCCESS == (retv = RegQueryValueEx(hkey, val_name,
+ NULL, NULL, data, data_len)))
+ ret = TRUE;
+ else {
+ TCHAR szBuf[80];
+
+ FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM,
+ NULL, retv, 0,
+ (LPTSTR) &szBuf, sizeof(szBuf), NULL);
+
+ printf("Could not read reg key '%s' subkey '%s' value: '%s'\nError: (%ld) %s\n",
+ ((key == HKEY_LOCAL_MACHINE) ? "HKLM" :
+ (key == HKEY_CURRENT_USER) ? "HKCU" :
+ "???"),
+ sub_key, val_name, retv, szBuf);
+ }
+ RegCloseKey(hkey);
+ }
+ else {
+ TCHAR szBuf[80];
+
+ FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, retv, 0,
+ (LPTSTR) &szBuf, sizeof(szBuf), NULL);
+ printf("Could not open reg subkey: %s\nError: (%ld) %s\n",
+ sub_key, retv, szBuf);
+ }
+
+ return ret;
+}
+
+static void dll_prep() {
+ char path[MAX_PATH + 1];
+ HMODULE hmod;
+ HKEY hkey;
+#ifdef PORTABLE
+ /* We assume that GTK+ is installed under \\path\to\Gaim\..\GTK
+ * First we find \\path\to
+ */
+ if (GetModuleFileName(NULL, path, MAX_PATH) != 0) {
+ char *tmp = path;
+ char *prev = NULL;
+ char *prev2 = NULL;
+
+ while ((tmp = strchr(tmp, '\\'))) {
+ prev2 = prev;
+ prev = tmp;
+ tmp++;
+ }
+
+ if (prev2) {
+ prev2[0] = '\0';
+ }
+ } else {
+ printf("Unable to determine current executable path. \n"
+ "This will prevent the settings dir from being set.\n"
+ "Assuming GTK+ is in the PATH.\n");
+ }
+
+ if (path) {
+ /* Set up the settings dir base to be \\path\to
+ * The actual settings dir will be \\path\to\.gaim */
+ char settingsdir[strlen(path) + strlen("GAIMHOME=") + 1];
+ char aspelldir[strlen(path) + strlen("GAIM_ASPELL_DIR=\\Aspell\\bin") + 1];
+
+ snprintf(settingsdir, sizeof(settingsdir), "GAIMHOME=%s", path);
+ printf("Setting settings dir: %s\n", settingsdir);
+ putenv(settingsdir);
+
+ snprintf(aspelldir, sizeof(aspelldir), "GAIM_ASPELL_DIR=%s\\Aspell\\bin", path);
+ printf(aspelldir);
+ putenv(aspelldir);
+
+ /* set the GTK+ path to be \\path\to\GTK\bin */
+ strcat(path, "\\GTK\\bin");
+ } else
+ return;
+#else /* PORTABLE */
+ char gtkpath[MAX_PATH + 1];
+ DWORD plen;
+
+ plen = sizeof(gtkpath);
+ hkey = HKEY_CURRENT_USER;
+ if (!read_reg_string(hkey, "SOFTWARE\\GTK\\2.0", "Path",
+ (LPBYTE) >kpath, &plen)) {
+ hkey = HKEY_LOCAL_MACHINE;
+ if (!read_reg_string(hkey, "SOFTWARE\\GTK\\2.0", "Path",
+ (LPBYTE) >kpath, &plen)) {
+ printf("GTK+ Path Registry Key not found. "
+ "Assuming GTK+ is in the PATH.\n");
+ return;
+ }
+ }
+
+ /* this value is replaced during a successful RegQueryValueEx() */
+ plen = sizeof(path);
+ /* Determine GTK+ dll path .. */
+ if (!read_reg_string(hkey, "SOFTWARE\\GTK\\2.0", "DllPath",
+ (LPBYTE) &path, &plen)) {
+ strcpy(path, gtkpath);
+ strcat(path, "\\bin");
+ }
+#endif
+ printf("GTK+ path found: %s\n", path);
+
+ if ((hmod = GetModuleHandle("kernel32.dll"))) {
+ MySetDllDirectory = (LPFNSETDLLDIRECTORY) GetProcAddress(
+ hmod, "SetDllDirectoryA");
+ if (!MySetDllDirectory)
+ printf("SetDllDirectory not supported\n");
+ } else
+ printf("Error getting kernel32.dll module handle\n");
+
+ /* For Windows XP SP1+ / Server 2003 we use SetDllDirectory to avoid dll hell */
+ if (MySetDllDirectory) {
+ printf("Using SetDllDirectory\n");
+ MySetDllDirectory(path);
+ }
+
+ /* For the rest, we set the current directory and make sure
+ * SafeDllSearch is set to 0 where needed. */
+ else {
+ OSVERSIONINFO osinfo;
+
+ printf("Setting current directory to GTK+ dll directory\n");
+ SetCurrentDirectory(path);
+ /* For Windows 2000 (SP3+) / WinXP (No SP):
+ * If SafeDllSearchMode is set to 1, Windows system directories are
+ * searched for dlls before the current directory. Therefore we set it
+ * to 0.
+ */
+ osinfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+ GetVersionEx(&osinfo);
+ if ((osinfo.dwMajorVersion == 5 &&
+ osinfo.dwMinorVersion == 0 &&
+ strcmp(osinfo.szCSDVersion, "Service Pack 3") >= 0) ||
+ (osinfo.dwMajorVersion == 5 &&
+ osinfo.dwMinorVersion == 1 &&
+ strcmp(osinfo.szCSDVersion, "") >= 0)
+ ) {
+ DWORD regval = 1;
+ DWORD reglen = sizeof(DWORD);
+
+ printf("Using Win2k (SP3+) / WinXP (No SP)... Checking SafeDllSearch\n");
+ read_reg_string(HKEY_LOCAL_MACHINE,
+ "System\\CurrentControlSet\\Control\\Session Manager",
+ "SafeDllSearchMode",
+ (LPBYTE) ®val,
+ ®len);
+
+ if (regval != 0) {
+ printf("Trying to set SafeDllSearchMode to 0\n");
+ regval = 0;
+ if (RegOpenKeyEx(HKEY_LOCAL_MACHINE,
+ "System\\CurrentControlSet\\Control\\Session Manager",
+ 0, KEY_SET_VALUE, &hkey
+ ) == ERROR_SUCCESS) {
+ if (RegSetValueEx(hkey,
+ "SafeDllSearchMode", 0,
+ REG_DWORD, (LPBYTE) ®val,
+ sizeof(DWORD)
+ ) != ERROR_SUCCESS)
+ printf("Error writing SafeDllSearchMode. Error: %u\n",
+ (UINT) GetLastError());
+ RegCloseKey(hkey);
+ } else
+ printf("Error opening Session Manager key for writing. Error: %u\n",
+ (UINT) GetLastError());
+ } else
+ printf("SafeDllSearchMode is set to 0\n");
+ }/*end else*/
+ }
+}
+
+static char* wgaim_lcid_to_posix(LCID lcid) {
+ char *posix = NULL;
+ int lang_id = PRIMARYLANGID(lcid);
+ int sub_id = SUBLANGID(lcid);
+
+ switch (lang_id) {
+ case LANG_ARABIC: break;
+ case LANG_BULGARIAN: posix = "bg"; break;
+ case LANG_CATALAN: posix = "ca"; break;
+ case LANG_CHINESE:
+ switch (sub_id) {
+ case SUBLANG_CHINESE_SIMPLIFIED:
+ posix = "zh_CN"; break;
+ case SUBLANG_CHINESE_TRADITIONAL:
+ posix = "zh_TW"; break;
+ default:
+ posix = "zh"; break;
+ }
+ break;
+ case LANG_CZECH: posix = "cs"; break;
+ case LANG_DANISH: posix = "da"; break;
+ case LANG_GERMAN: posix = "de"; break;
+ case LANG_GREEK: posix = "el"; break;
+ case LANG_ENGLISH:
+ switch (sub_id) {
+ case SUBLANG_ENGLISH_UK:
+ posix = "en_GB"; break;
+ case SUBLANG_ENGLISH_AUS:
+ posix = "en_AU"; break;
+ case SUBLANG_ENGLISH_CAN:
+ posix = "en_CA"; break;
+ default:
+ posix = "en"; break;
+ }
+ break;
+ case LANG_SPANISH: posix = "es"; break;
+ case LANG_FINNISH: posix = "fi"; break;
+ case LANG_FRENCH: posix = "fr"; break;
+ case LANG_HEBREW: posix = "he"; break;
+ case LANG_HUNGARIAN: posix = "hu"; break;
+ case LANG_ICELANDIC: break;
+ case LANG_ITALIAN: posix = "it"; break;
+ case LANG_JAPANESE: posix = "ja"; break;
+ case LANG_KOREAN: posix = "ko"; break;
+ case LANG_DUTCH: posix = "nl"; break;
+ case LANG_NORWEGIAN:
+ switch (sub_id) {
+ case SUBLANG_NORWEGIAN_BOKMAL:
+ posix = "nb"; break;
+ case SUBLANG_NORWEGIAN_NYNORSK:
+ posix = "nn"; break;
+ }
+ break;
+ case LANG_POLISH: posix = "pl"; break;
+ case LANG_PORTUGUESE:
+ switch (sub_id) {
+ case SUBLANG_PORTUGUESE_BRAZILIAN:
+ posix = "pt_BR"; break;
+ default:
+ posix = "pt"; break;
+ }
+ break;
+ case LANG_ROMANIAN: posix = "ro"; break;
+ case LANG_RUSSIAN: posix = "ru"; break;
+ /* LANG_CROATIAN == LANG_SERBIAN for some reason
+ * We'll need to do something here if we ever get a croatian translation */
+ /* case LANG_CROATIAN: posix = "hr"; break;*/
+ case LANG_SERBIAN:
+ switch (sub_id) {
+ case SUBLANG_SERBIAN_LATIN:
+ posix = "sr@..."; break;
+ case SUBLANG_SERBIAN_CYRILLIC:
+ posix = "sr"; break;
+ }
+ break;
+ case LANG_SLOVAK: posix = "sk"; break;
+ case LANG_ALBANIAN: posix = "sq"; break;
+ case LANG_SWEDISH: posix = "sv"; break;
+ case LANG_THAI: posix = "th"; break;
+ case LANG_TURKISH: posix = "tr"; break;
+ case LANG_URDU: break;
+ case LANG_INDONESIAN: break;
+ case LANG_UKRAINIAN: posix = "uk"; break;
+ case LANG_BELARUSIAN: break;
+ case LANG_SLOVENIAN: posix = "sl"; break;
+ case LANG_ESTONIAN: posix = "et"; break;
+ case LANG_LATVIAN: break;
+ case LANG_LITHUANIAN: posix = "lt"; break;
+ case LANG_FARSI: break;
+ case LANG_VIETNAMESE: posix = "vi"; break;
+ case LANG_ARMENIAN: break;
+ case LANG_AZERI: posix = "az"; break;
+ case LANG_BASQUE: break;
+ case LANG_MACEDONIAN: posix = "mk"; break;
+ case LANG_AFRIKAANS: break;
+ case LANG_GEORGIAN: posix = "ka"; break;
+ case LANG_FAEROESE: break;
+ case LANG_HINDI: posix = "hi"; break;
+ case LANG_MALAY: break;
+ case LANG_KAZAK: break;
+ case LANG_KYRGYZ: break;
+ case LANG_SWAHILI: break;
+ case LANG_UZBEK: break;
+ case LANG_TATAR: break;
+ case LANG_BENGALI: break;
+ case LANG_PUNJABI: posix = "pa"; break;
+ case LANG_GUJARATI: posix = "gu"; break;
+ case LANG_ORIYA: break;
+ case LANG_TAMIL: posix = "ta"; break;
+ case LANG_TELUGU: break;
+ case LANG_KANNADA: break;
+ case LANG_MALAYALAM: break;
+ case LANG_ASSAMESE: break;
+ case LANG_MARATHI: break;
+ case LANG_SANSKRIT: break;
+ case LANG_MONGOLIAN: break;
+ case LANG_GALICIAN: posix = "gl"; break;
+ case LANG_KONKANI: break;
+ case LANG_MANIPURI: break;
+ case LANG_SINDHI: break;
+ case LANG_SYRIAC: break;
+ case LANG_KASHMIRI: break;
+ case LANG_NEPALI: break;
+ case LANG_DIVEHI: break;
+ }
+
+ /* Deal with exceptions */
+ if (posix == NULL) {
+ switch (lcid) {
+ case 2125: posix = "my_MM"; break; /* Myanmar (Burmese) */
+ case 1076: posix = "xh"; break; /* Xhosa */
+ case 9999: posix = "ku"; break; /* Kurdish (from NSIS) */
+ }
+ }
+
+ return posix;
+}
+
+/* Determine and set Gaim locale as follows (in order of priority):
+ - Check GAIMLANG env var
+ - Check NSIS Installer Language reg value
+ - Use default user locale
+*/
+static const char *wgaim_get_locale() {
+ const char *locale = NULL;
+ LCID lcid;
+#ifndef PORTABLE
+ char data[10];
+ DWORD datalen = 10;
+#endif
+
+ /* Check if user set GAIMLANG env var */
+ if ((locale = getenv("GAIMLANG")))
+ return locale;
+
+#ifndef PORTABLE
+ if (read_reg_string(HKEY_CURRENT_USER, "SOFTWARE\\gaim",
+ "Installer Language", (LPBYTE) &data, &datalen)) {
+ if ((locale = wgaim_lcid_to_posix(atoi(data))))
+ return locale;
+ }
+#endif
+
+ lcid = GetUserDefaultLCID();
+ if ((locale = wgaim_lcid_to_posix(lcid)))
+ return locale;
+
+ return "en";
+}
+
+static void wgaim_set_locale() {
+ const char *locale = NULL;
+ char envstr[25];
+
+ locale = wgaim_get_locale();
+
+ snprintf(envstr, 25, "LANG=%s", locale);
+ printf("Setting locale: %s\n", envstr);
+ putenv(envstr);
+}
+
+static BOOL wgaim_set_running() {
+ HANDLE h;
+
+ if ((h = CreateMutex(NULL, FALSE, "gaim_is_running"))) {
+ if (GetLastError() == ERROR_ALREADY_EXISTS) {
+ MessageBox(NULL,
+ "An instance of Gaim is already running",
+ NULL, MB_OK | MB_TOPMOST);
+ return FALSE;
+ }
+ }
+ return TRUE;
+}
+
+static void wgaim_set_proxy() {
+ DWORD regval = 1;
+ DWORD reglen = sizeof(DWORD);
+
+ /* If the proxy server environment variables are already set,
+ * we shouldn't override them */
+ if (getenv("HTTP_PROXY") || getenv("http_proxy") || getenv("HTTPPROXY"))
+ return;
+
+ if (read_reg_string(HKEY_CURRENT_USER, WIN32_PROXY_REGKEY,
+ "ProxyEnable",
+ (LPBYTE) ®val, ®len) && (regval & 1)) {
+ char proxy_server[2048];
+ char *c = NULL;
+ reglen = sizeof(proxy_server);
+
+ if (!read_reg_string(HKEY_CURRENT_USER, WIN32_PROXY_REGKEY,
+ "ProxyServer", (LPBYTE) &proxy_server, ®len))
+ return;
+
+ if ((reglen > strlen("http="))
+ && (c = strstr(proxy_server, "http="))) {
+ char *d;
+ c += strlen("http=");
+ d = strchr(c, ';');
+ if (d) {
+ *d = '\0';
+ }
+ /* c now points the proxy server (and port) */
+ }
+
+ if (c) {
+ const char envstr_prefix[] = "HTTP_PROXY=http://";
+ char envstr[sizeof(envstr_prefix) + strlen(c) + 1];
+ snprintf(envstr, sizeof(envstr), "%s%s",
+ envstr_prefix, c);
+ printf("Setting HTTP Proxy: %s\n", envstr);
+ putenv(envstr);
+ }
+ }
+
+}
+
+#ifdef __GNUC__
+# ifndef _stdcall
+# define _stdcall __attribute__((stdcall))
+# endif
+#endif
+
+int _stdcall
+WinMain (struct HINSTANCE__ *hInstance, struct HINSTANCE__ *hPrevInstance,
+ char *lpszCmdLine, int nCmdShow) {
+ char errbuf[512];
+ char gaimdir[MAX_PATH];
+ HMODULE hmod;
+
+ /* If debug or help or version flag used, create console for output */
+ if (strstr(lpszCmdLine, "-d") || strstr(lpszCmdLine, "-h") || strstr(lpszCmdLine, "-v")) {
+ LPFNATTACHCONSOLE MyAttachConsole = NULL;
+ if ((hmod = GetModuleHandle("kernel32.dll"))) {
+ MyAttachConsole =
+ (LPFNATTACHCONSOLE)
+ GetProcAddress(hmod, "AttachConsole");
+ }
+ if ((MyAttachConsole && MyAttachConsole(ATTACH_PARENT_PROCESS))
+ || AllocConsole())
+ freopen("CONOUT$", "w", stdout);
+ }
+
+ /* Load exception handler if we have it */
+ if (GetModuleFileName(NULL, gaimdir, MAX_PATH) != 0) {
+ char *tmp = gaimdir;
+ char *prev = NULL;
+
+ while ((tmp = strchr(tmp, '\\'))) {
+ prev = tmp;
+ tmp++;
+ }
+
+ if (prev) {
+ prev[0] = '\0';
+ strcat(gaimdir, "\\exchndl.dll");
+ if (LoadLibrary(gaimdir))
+ printf("Loaded exchndl.dll\n");
+ }
+ } else {
+ snprintf(errbuf, 512,
+ "Error getting module filename. Error: %u",
+ (UINT) GetLastError());
+ MessageBox(NULL, errbuf, NULL, MB_OK | MB_TOPMOST);
+ }
+
+#ifndef PORTABLE
+ if (!getenv("GAIM_NO_DLL_CHECK"))
+#endif
+ dll_prep();
+
+ wgaim_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())
+ return 0;
+
+ wgaim_set_proxy();
+
+ /* Now we are ready for Gaim .. */
+ if ((hmod = LoadLibrary("gtkgaim.dll"))) {
+ gaim_main = (LPFNGAIMMAIN) GetProcAddress(hmod, "gaim_main");
+ }
+
+ if (!gaim_main) {
+ snprintf(errbuf, 512, "Error loading gaim.dll. Error: %u",
+ (UINT) GetLastError());
+ MessageBox(NULL, errbuf, NULL, MB_OK | MB_TOPMOST);
+ return 0;
+ }
+
+ return gaim_main (hInstance, __argc, __argv);
+}
Property changes on: trunk/gtk/win32/win_gaim.c
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Property changes on: trunk/libgaim
___________________________________________________________________
Name: svn:ignore
- Makefile.in
.deps
Makefile
dbus-types.h
+ Makefile.in
.deps
Makefile
dbus-types.h
libgaim.dll
libgaim.dll.a
Added: trunk/libgaim/Makefile.mingw
===================================================================
--- trunk/libgaim/Makefile.mingw (rev 0)
+++ trunk/libgaim/Makefile.mingw 2006-08-20 16:49:37 UTC (rev 16905)
@@ -0,0 +1,155 @@
+#
+# Makefile.mingw
+#
+# Description: Makefile for win32 (mingw) version of Gaim
+#
+
+#
+# PATHS
+#
+
+INCLUDE_DIR := .
+GTK_TOP := ../../win32-dev/gtk_2_0
+GAIM_TOP := ..
+GAIM_SRC := .
+GAIM_INSTALL_DIR := $(GAIM_TOP)/win32-install-dir
+LIBXML2_DIR := ../../win32-dev/libxml2
+
+##
+## VARIABLE DEFINITIONS
+##
+
+TARGET = libgaim
+
+# Compiler and Linker Options
+
+CFLAGS =
+
+DEFINES =
+
+##
+## INCLUDE MAKEFILES
+##
+
+include $(GAIM_TOP)/libgaim/win32/global.mak
+
+##
+## INCLUDE PATHS
+##
+
+INCLUDE_PATHS = \
+ -I$(INCLUDE_DIR) \
+ -I$(INCLUDE_DIR)/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
+
+LIB_PATHS = -L$(GTK_TOP)/lib \
+ -L$(GAIM_SRC) \
+ -L$(LIBXML2_DIR)/lib
+
+##
+## SOURCES, OBJECTS
+##
+
+C_SRC = \
+ account.c \
+ accountopt.c \
+ blist.c \
+ buddyicon.c \
+ cipher.c \
+ cmds.c \
+ connection.c \
+ conversation.c \
+ core.c \
+ debug.c \
+ dnsquery.c \
+ dnssrv.c \
+ eventloop.c \
+ ft.c \
+ circbuffer.c \
+ idle.c \
+ imgstore.c \
+ log.c \
+ mime.c \
+ network.c \
+ notify.c \
+ ntlm.c \
+ plugin.c \
+ pluginpref.c \
+ pounce.c \
+ prefs.c \
+ privacy.c \
+ proxy.c \
+ prpl.c \
+ request.c \
+ roomlist.c \
+ savedstatuses.c \
+ server.c \
+ signals.c \
+ sound.c \
+ sslconn.c \
+ status.c \
+ stringref.c \
+ stun.c \
+ upnp.c \
+ util.c \
+ value.c \
+ xmlnode.c \
+ whiteboard.c \
+ win32/libc_interface.c \
+ win32/win32dep.c
+
+
+OBJECTS = $(C_SRC:%.c=%.o)
+
+##
+## LIBRARIES
+##
+
+LIBS = \
+ -lglib-2.0 \
+ -lgthread-2.0 \
+ -lgobject-2.0 \
+ -lgmodule-2.0 \
+ -lintl \
+ -lws2_32 \
+ -liberty \
+ -lxml2
+
+##
+## RULES
+##
+
+# How to make a C file
+%.o: %.c
+ $(CC) $(CFLAGS) $(INCLUDE_PATHS) $(DEFINES) -c $< -o $@
+
+##
+## TARGET DEFINITIONS
+##
+
+.PHONY: all clean include_path
+
+all: $(TARGET).dll
+
+install: all
+ cp $(GAIM_SRC)/$(TARGET).dll $(GAIM_INSTALL_DIR)
+
+#
+# BUILD DLL
+#
+$(TARGET).dll.a $(TARGET).dll:
+$(TARGET).dll.a $(TARGET).dll: $(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 $(TARGET).dll
+ rm -rf $(TARGET).dll.a
Property changes on: trunk/libgaim/Makefile.mingw
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Modified: trunk/libgaim/core.c
@@ Diff output truncated at 100000 characters. @@
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|