diff -rbui owb-trunk.r241-orig/BAL/CMakeConf.txt owb_trunk.r241/BAL/CMakeConf.txt
--- owb-trunk.r241-orig/BAL/CMakeConf.txt	2008-03-25 10:42:08.000000000 +0100
+++ owb_trunk.r241/BAL/CMakeConf.txt	2008-06-04 09:27:20.313356500 +0200
@@ -147,12 +147,15 @@
             SEPARATE_ARGUMENTS(LIBICU_LIBS)
     ENDIF (BUILD_SHARED_LIBS)
 
+    IF ( NOT OWBAL_PLATFORM_WIN32PORT)
     IF (ERROR_CODE EQUAL 0)
-        MESSAGE ("icu found with this parameter for libs : ${LIBICU_LIBS}")
+        MESSAGE ("icu found with this parameter for libs : 
+${LIBICU_LIBS}")
         SET(LIBRARIES_TO_LINK ${LIBRARIES_TO_LINK} ${LIBICU_LIBS})
     ELSE (ERROR_CODE EQUAL 0)
         MESSAGE (FATAL_ERROR "libicu not found, cannot create owb without it, on debian you must install libicu34-dev package")
     ENDIF (ERROR_CODE EQUAL 0)
+    ENDIF(NOT OWBAL_PLATFORM_WIN32PORT)
 
 ENDIF (${WEBKIT_USE_I18N} STREQUAL "ICU")
 
@@ -208,6 +211,7 @@
         OUTPUT_VARIABLE LIBFONTCONFIG_LIBS
         RETURN_VALUE ERROR_CODE)
 
+ IF (NOT OWBAL_PLATFORM_WIN32PORT)
     IF (ERROR_CODE EQUAL 0)
         MESSAGE ("fontconfig found with this parameter for libs : "${LIBFONTCONFIG_LIBS})
         IF (NOT BUILD_SHARED_LIBS)
@@ -218,6 +222,7 @@
     ELSE (ERROR_CODE EQUAL 0)
         MESSAGE (FATAL_ERROR "fontconfig not found, cannot create owb without it")
     ENDIF (ERROR_CODE EQUAL 0)
+   ENDIF(NOT OWBAL_PLATFORM_WIN32PORT)
     
 	FIND_PROGRAM (FREETYPE_CONFIG_EXECUTABLE freetype-config)
 
@@ -228,16 +233,19 @@
     EXEC_PROGRAM ("${FREETYPE_CONFIG_EXECUTABLE} --cflags | sed s/-I// | sed s/\\ .*//g"
         OUTPUT_VARIABLE LIBFREETYPE_CFLAGS
         RETURN_VALUE ERROR_CODE)
+IF (NOT OWBAL_PLATFORM_WIN32PORT)
     IF (ERROR_CODE EQUAL 0)
         MESSAGE ("freetype found with this parameter for cflags : ${LIBFREETYPE_CFLAGS}")
         SET(LIBRARIES_TO_INCLUDE ${LIBRARIES_TO_INCLUDE} ${LIBFREETYPE_CFLAGS})
     ELSE (ERROR_CODE EQUAL 0)
         MESSAGE (FATAL_ERROR "libfreetype not found. Cannot create owb with freetype support without it. On debian you must install libfreetype6-dev package")
     ENDIF (ERROR_CODE EQUAL 0)
+ ENDIF(NOT OWBAL_PLATFORM_WIN32PORT)
 
     EXEC_PROGRAM ("${FREETYPE_CONFIG_EXECUTABLE} --libs | sed s/-[[:upper:]][[:graph:]]*[[:blank:]]//g | sed 's/-l//g' | sed 's/[ ]/;/g'"
         OUTPUT_VARIABLE LIBFREETYPE_LIBS
         RETURN_VALUE ERROR_CODE)
+IF (NOT OWBAL_PLATFORM_WIN32PORT)
     IF (ERROR_CODE EQUAL 0)
         MESSAGE ("freetype found with this parameter for libs : ${LIBFREETYPE_LIBS}")
         IF (NOT BUILD_SHARED_LIBS)
@@ -248,6 +256,7 @@
     ELSE (ERROR_CODE EQUAL 0)
         MESSAGE (FATAL_ERROR "libfreetype not found. Cannot create owb with freetype support without it. On debian you must install libfreetype6-dev package")
     ENDIF (ERROR_CODE EQUAL 0)
+ENDIF(NOT OWBAL_PLATFORM_WIN32PORT)
 ENDIF (${WEBKIT_USE_FONTS} STREQUAL "FREETYPE")
 
 #######################################
@@ -264,6 +273,7 @@
     OUTPUT_VARIABLE LIBCURL_LIBS
     RETURN_VALUE ERROR_CODE)
 
+IF (NOT OWBAL_PLATFORM_WIN32PORT)
 IF (ERROR_CODE EQUAL 0)
     MESSAGE ("curl found with this parameter for libs : ${LIBCURL_LIBS}")
     IF (NOT BUILD_SHARED_LIBS)
@@ -274,6 +284,7 @@
 ELSE (ERROR_CODE EQUAL 0)
     MESSAGE (FATAL_ERROR "libcurl not found, cannot create owb without it, on debian you must install libcurl3-gnutls-dev package")
 ENDIF (ERROR_CODE EQUAL 0)
+ENDIF(NOT OWBAL_PLATFORM_WIN32PORT)
 
 #######################################
 #quick search the libxml2 is available
@@ -291,6 +302,7 @@
         OUTPUT_VARIABLE LIBXML2_LIBS
         RETURN_VALUE ERROR_CODE)
 
+IF (NOT OWBAL_PLATFORM_WIN32PORT)
     IF (ERROR_CODE EQUAL 0)
         MESSAGE ("xml2 found with this parameter for libs : ${LIBXML2_LIBS}")
         IF (NOT BUILD_SHARED_LIBS)
@@ -304,17 +316,21 @@
     ELSE (ERROR_CODE EQUAL 0)
         MESSAGE (FATAL_ERROR "libxml2 not found, cannot create owb without it, on debian you must install libxml2-dev package")
     ENDIF (ERROR_CODE EQUAL 0)
+ENDIF(NOT OWBAL_PLATFORM_WIN32PORT)
 
     EXEC_PROGRAM ("${XML2_CONFIG_EXECUTABLE} --cflags | sed s/-I// | sed s/\\ .*//g"
         OUTPUT_VARIABLE LIBXML2_CFLAGS
         RETURN_VALUE ERROR_CODE)
 
+IF (NOT OWBAL_PLATFORM_WIN32PORT)
     IF (ERROR_CODE EQUAL 0)
-        MESSAGE ("xml2 found with this parameter for cflags : ${LIBXML2_CFLAGS}")
+        MESSAGE ("xml2 found with this parameter for cflags : 
+${LIBXML2_CFLAGS}")
         SET(LIBRARIES_TO_INCLUDE ${LIBRARIES_TO_INCLUDE} ${LIBXML2_CFLAGS})
     ELSE (ERROR_CODE EQUAL 0)
         MESSAGE (FATAL_ERROR "libxml2 not found, cannot create owb without it, on debian you must install libxml2-dev package")
     ENDIF (ERROR_CODE EQUAL 0)
+ENDIF(NOT OWBAL_PLATFORM_WIN32PORT)
 
 ENDIF (${WEBKIT_USE_XML_SUPPORT} STREQUAL "LIBXML")
 
@@ -334,6 +350,7 @@
     OUTPUT_VARIABLE LIBXSLT_LIBS
     RETURN_VALUE ERROR_CODE)
 
+IF (NOT OWBAL_PLATFORM_WIN32PORT)
 IF (ERROR_CODE EQUAL 0)
     MESSAGE ("xslt found with this parameter for libs : ${LIBXSLT_LIBS}")
     IF (NOT BUILD_SHARED_LIBS)
@@ -344,6 +361,7 @@
 ELSE (ERROR_CODE EQUAL 0)
     MESSAGE (FATAL_ERROR "libxslt not found, cannot create owb without it, on debian you must install libxslt1-dev package")
 ENDIF (ERROR_CODE EQUAL 0)
+ENDIF(NOT OWBAL_PLATFORM_WIN32PORT)
 
 ENDIF (${WEBKIT_USE_XSLT_SUPPORT} STREQUAL "LIBXSLT")
 
diff -rbui owb-trunk.r241-orig/BAL/Configuration/BALConfiguration.h owb_trunk.r241/BAL/Configuration/BALConfiguration.h
--- owb-trunk.r241-orig/BAL/Configuration/BALConfiguration.h	2008-03-25 10:42:08.000000000 +0100
+++ owb_trunk.r241/BAL/Configuration/BALConfiguration.h	2008-06-04 09:27:20.321168500 +0200
@@ -46,6 +46,9 @@
 
 // must use log() to enable deactivation during LayoutTests
 #ifdef BAL_LOG
+#ifdef __OWBAL_PLATFORM_WIN32PORT__
+#define __func__ __FUNCTION__
+#endif
   #define BALNotImplemented() if (!getenv("LAYOUT_TEST") && getenv("NOT_IMPLEMENTED")) { printf("%s:%d:%s() Not implemented\n", __FILE__, __LINE__, __func__); }
 #else
   #define BALNotImplemented()
diff -rbui owb-trunk.r241-orig/BAL/Implementations/Events/SDL/BCEventLoopSDL.cpp owb_trunk.r241/BAL/Implementations/Events/SDL/BCEventLoopSDL.cpp
--- owb-trunk.r241-orig/BAL/Implementations/Events/SDL/BCEventLoopSDL.cpp	2008-03-25 10:42:08.000000000 +0100
+++ owb_trunk.r241/BAL/Implementations/Events/SDL/BCEventLoopSDL.cpp	2008-06-04 09:27:20.330933500 +0200
@@ -42,7 +42,9 @@
 #define DEEPSEE_MEMORY_USE 1
 #define DEEPSEE_PROGARGS_USE 1
 #define DEEPSEE_CONSOLE_USE 1
+#ifndef __OWBAL_PLATFORM_WIN32PORT__
 #include DEEPSEE_INCLUDE
+#endif
 
 #include "config.h"
 #include "PlatformString.h"
@@ -58,6 +60,9 @@
 #include <termios.h>
 #endif
 #include "BTLogHelper.h"
+#ifdef __OWBAL_PLATFORM_WIN32PORT__
+#include "ASCIICType.h"
+#endif
 
 // utilities functions for conversion
 static WebCore::String keyIdentifierForSDLKeyCode(SDLKey keyCode);
@@ -119,12 +124,14 @@
     term.c_lflag &= ~(ICANON);
     tcsetattr(0, TCSANOW,&term);
 #endif
-
+#ifndef NO_USE_DEEPSEE
     DS_NEW_CONSOLE(m_console);
     DS_USE_CONSOLE(
         DS_LOGGER_ADD_CMD_TO_CONSOLE(m_console);
         DS_MEMORY_ADD_CMD_TO_CONSOLE(m_console);
     )
+#endif
+   
 
 }
 
@@ -134,7 +141,9 @@
  */
 BC::BCEventLoopSDL::~BCEventLoopSDL()
 {
+#ifndef NO_USE_DEEPSEE
     DS_DELETE_CONSOLE(m_console);
+#endif
     m_event.clear();
     SDL_QuitSubSystem(SDL_INIT_EVENTTHREAD);
     SDL_Quit();
@@ -171,11 +180,10 @@
  */
 bool BC::BCEventLoopSDL::WaitEvent(BIEvent*& aBALEvent)
 {
-    ASSERT(aBALEvent == NULL);
 
+    ASSERT(aBALEvent == NULL);
     if (!m_isInitialized)
         return false;
-
     SDL_Event aSDLEvent;
     if (SDL_PollEvent(&aSDLEvent) != 0)
     {
@@ -191,15 +199,21 @@
             aBALEvent = m_event.first();
             m_event.remove(0);
             return (aBALEvent != NULL);
-        } else {
+        } 
+#ifndef NO_USE_DEEPSEE
+		else {
+
             // give control to console, without blocking
             DS_USE_CONSOLE(
                  if (m_console->loop(false))
                  quit();
             );
+#ifndef __OWBAL_PLATFORM_WIN32PORT__
             usleep(10000);
+#endif
             return false;
         }
+#endif
     }
 #else
     else {
@@ -223,7 +237,9 @@
         m_event.remove(0);
         return (aBALEvent != NULL);
     } else {
+#ifndef __OWBAL_PLATFORM_WIN32PORT__
         usleep(10000);
+#endif
         return false;
     }
 #endif
@@ -857,7 +873,12 @@
         case 127:
             return "U+00007F";
         default:
+			#ifdef __OWBAL_PLATFORM_WIN32PORT__ 
+		   return WebCore::String::format("U+%04X", WTF::toASCIIUpper((unsigned short)keyCode));
+			#else
             return WebCore::String::format("U+%06X", toupper(keyCode));
+			#endif
+
     }
 }
 
diff -rbui owb-trunk.r241-orig/BAL/Implementations/Events/SDL/BCEventLoopSDL.h owb_trunk.r241/BAL/Implementations/Events/SDL/BCEventLoopSDL.h
--- owb-trunk.r241-orig/BAL/Implementations/Events/SDL/BCEventLoopSDL.h	2008-03-25 10:42:08.000000000 +0100
+++ owb_trunk.r241/BAL/Implementations/Events/SDL/BCEventLoopSDL.h	2008-06-04 09:27:20.339722000 +0200
@@ -41,7 +41,9 @@
  */
 
 #define DEEPSEE_CONSOLE_USE 1
+#ifndef NO_USE_DEEPSEE
 #include DEEPSEE_INCLUDE
+#endif
 
 #include "BIEventLoop.h"
 #include <SDL/SDL.h>
@@ -82,7 +84,9 @@
     fd_set          m_fdSet;
 #endif
     BAL::BIEvent* CreateEventFromSDLEvent(const SDL_Event&);
+#ifndef NO_USE_DEEPSEE
     DS_DEFINE_CONSOLE_PTR(m_console);
+#endif
 private:
     bool m_isInitialized;
     Vector<BAL::BIEvent *> m_event;
diff -rbui owb-trunk.r241-orig/BAL/Implementations/Facilities/Generic/BCCookieManager.cpp owb_trunk.r241/BAL/Implementations/Facilities/Generic/BCCookieManager.cpp
--- owb-trunk.r241-orig/BAL/Implementations/Facilities/Generic/BCCookieManager.cpp	2008-03-25 10:42:08.000000000 +0100
+++ owb_trunk.r241/BAL/Implementations/Facilities/Generic/BCCookieManager.cpp	2008-06-04 09:27:20.349487000 +0200
@@ -230,6 +230,7 @@
 
 void BCCookieManager::saveCookiesToFile() 
 {
+#ifndef __OWBAL_PLATFORM_WIN32PORT__
     BAL::BIFile* cookieFile = BAL::createBIFile(filePath);
     int openedFile = cookieFile->open('w');
     
@@ -251,11 +252,14 @@
     }
     
     cookieFile->close();
+
     deleteBIFile(cookieFile);
+#endif
 }
 
 void BCCookieManager::getCookiesFromFile()
 {
+#ifndef __OWBAL_PLATFORM_WIN32PORT__
     char* buffer = NULL;
     BAL::BIFile* cookieFile = BAL::createBIFile(filePath);
     
@@ -315,6 +319,7 @@
 
     delete buffer;
     deleteBIFile(cookieFile);
+#endif
 }
 
 unsigned short BCCookieManager::cookiesCount()
diff -rbui owb-trunk.r241-orig/BAL/Implementations/Facilities/Generic/BTDeviceChannel.cpp owb_trunk.r241/BAL/Implementations/Facilities/Generic/BTDeviceChannel.cpp
--- owb-trunk.r241-orig/BAL/Implementations/Facilities/Generic/BTDeviceChannel.cpp	2007-11-21 18:52:54.000000000 +0100
+++ owb_trunk.r241/BAL/Implementations/Facilities/Generic/BTDeviceChannel.cpp	2008-06-04 09:27:20.357299000 +0200
@@ -40,7 +40,14 @@
 
 #include "BTDeviceChannel.h"
 #include <fcntl.h>
+#ifdef __OWBAL_PLATFORM_WIN32PORT__
+#define STDERR_FILENO 2
+#define STDIN_FILENO 0
+#define STDOUT_FILENO 1
+#include <io.h>
+#else 
 #include <unistd.h>
+#endif
 
 namespace BALFacilities {
 
@@ -90,7 +97,11 @@
  */
 void BTDeviceChannel::send(const char* message)
 {
+#ifdef __OWBAL_PLATFORM_WIN32PORT__
+    size_t received = 0;
+#else
     ssize_t received = 0;
+#endif
     if (message)
         received = write(m_descriptor, message, strlen(message));
     else
diff -rbui owb-trunk.r241-orig/BAL/Implementations/Facilities/Generic/BTLogManager.cpp owb_trunk.r241/BAL/Implementations/Facilities/Generic/BTLogManager.cpp
--- owb-trunk.r241-orig/BAL/Implementations/Facilities/Generic/BTLogManager.cpp	2007-11-21 18:52:54.000000000 +0100
+++ owb_trunk.r241/BAL/Implementations/Facilities/Generic/BTLogManager.cpp	2008-06-04 09:27:20.367064000 +0200
@@ -42,7 +42,10 @@
 #include "BTLogManager.h"
 #include "BTLogChannel.h"
 #include <stdarg.h>
-
+#ifdef __OWBAL_PLATFORM_WIN32PORT__
+#include <utf16.h>
+#include "BTLogHelper.h"
+#endif
 namespace BALFacilities {
 
 // define what is declared in BTLogHelper.h
@@ -168,7 +171,11 @@
         vfprintf(stderr, message, args);
     } else {
         uint16_t size = strlen(file) + strlen(functionName) + strlen(message);
+		#ifdef __OWBAL_PLATFORM_WIN32PORT__ 
+		char string[400];
+		#else
         char string[size + 256];
+		#endif
         vsnprintf(string, size + 256, message, args);
         for (it = m_channels.begin(); it != m_channels.end(); ++it) {
             formatter = (*it)->getFormatter();
@@ -179,7 +186,11 @@
                 // there is no formatter for this channel so using default one
                 // FIXME: str is 256 long whereas string is size + 256!!!
                 static char str[256];
+				#ifndef __OWBAL_PLATFORM_WIN32PORT__
                 snprintf(str, 256, "(no formatter) %d|%d|%s|%d|%s|%s\n", module, level, file, lineNumber, functionName, string);
+				#else
+				_snprintf(str, 256, "(no formatter) %d|%d|%s|%d|%s|%s\n", module, level, file, lineNumber, functionName, string);
+				#endif
                 (*it)->send(str);
             }
         }
diff -rbui owb-trunk.r241-orig/BAL/Implementations/Facilities/Generic/BTSyslogChannel.cpp owb_trunk.r241/BAL/Implementations/Facilities/Generic/BTSyslogChannel.cpp
--- owb-trunk.r241-orig/BAL/Implementations/Facilities/Generic/BTSyslogChannel.cpp	2007-05-15 21:10:50.000000000 +0200
+++ owb_trunk.r241/BAL/Implementations/Facilities/Generic/BTSyslogChannel.cpp	2008-06-04 09:27:20.373899500 +0200
@@ -39,7 +39,12 @@
  */
 
 #include "BTSyslogChannel.h"
+#ifdef __OWBAL_PLATFORM_WIN32PORT__
+#include <io.h>
+#include <process.h>
+#else
 #include <syslog.h>
+#endif
 
 namespace BALFacilities {
 
diff -rbui owb-trunk.r241-orig/BAL/Implementations/Facilities/Generic/BTTextLogFormatter.cpp owb_trunk.r241/BAL/Implementations/Facilities/Generic/BTTextLogFormatter.cpp
--- owb-trunk.r241-orig/BAL/Implementations/Facilities/Generic/BTTextLogFormatter.cpp	2007-05-15 21:10:50.000000000 +0200
+++ owb_trunk.r241/BAL/Implementations/Facilities/Generic/BTTextLogFormatter.cpp	2008-06-04 09:27:20.383664500 +0200
@@ -41,8 +41,24 @@
 #include "BTLogManager.h"
 #include "BTTextLogFormatter.h"
 #include <time.h>
+#ifdef __OWBAL_PLATFORM_WIN32PORT__
+#include <SystemTime.h>
+int gettimeofday(struct timeval *tp, int nothing){
+	unsigned long Ticks = 0;
+  unsigned long Sec =0;
+  unsigned long Usec = 0;
+  Ticks = timeGetTime();
+
+  Sec = Ticks/1000;
+  Usec = (Ticks - (Sec*1000))*1000;
+  tp->tv_sec = Sec;
+  tp->tv_usec = Usec;
+  (void)nothing;
+  return 0;
+}
+#else
 #include <sys/time.h>
-
+#endif
 namespace BALFacilities {
 
 /**
@@ -66,17 +82,28 @@
         // remove \n
         date[strlen(date) - 1] = '\0';
     }
-
+#ifdef __OWBAL_PLATFORM_WIN32PORT__
+    _snprintf(m_buffer, m_maxLength,
+                "\033[37;7m(%20s) %s .%03ld %20s in "
+                "%s:%d at %s()\033[0m\n",
+                getNameForModule(balModule), date, ms,
+                getNameForLevel(level),
+                filename, lineNumber, functionName);
+#else
     snprintf(m_buffer, m_maxLength,
                 "\033[37;7m(%20s) %s .%03ld %20s in "
                 "%s:%d at %s()\033[0m\n",
                 getNameForModule(balModule), date, ms,
                 getNameForLevel(level),
                 filename, lineNumber, functionName);
+#endif
     int length = strlen(m_buffer);
     if (length == m_maxLength - 1)
-        snprintf(m_buffer + m_maxLength - 11, 11, "TRUNCATED\n");
-
+#ifdef __OWBAL_PLATFORM_WIN32PORT__
+        _snprintf(m_buffer + m_maxLength - 11, 11, "TRUNCATED\n");
+#else
+snprintf(m_buffer + m_maxLength - 11, 11, "TRUNCATED\n");
+#endif
     return m_buffer;
 }
 
diff -rbui owb-trunk.r241-orig/BAL/Implementations/Facilities/SourcesCMakeLists.txt owb_trunk.r241/BAL/Implementations/Facilities/SourcesCMakeLists.txt
--- owb-trunk.r241-orig/BAL/Implementations/Facilities/SourcesCMakeLists.txt	2008-03-25 10:42:08.000000000 +0100
+++ owb_trunk.r241/BAL/Implementations/Facilities/SourcesCMakeLists.txt	2008-06-04 09:27:20.391476500 +0200
@@ -7,7 +7,15 @@
 		BAL/Implementations/Facilities/Generic/BTLogChannel.cpp
 		BAL/Implementations/Facilities/Generic/BTLogFormatter.cpp
 		BAL/Implementations/Facilities/Generic/BTLogManager.cpp
+)
+IF(NOT OWBAL_PLATFORM_WIN32PORT)
+set(facilities_SRC
+		${facilities_SRC}
 		BAL/Implementations/Facilities/Generic/BTSyslogChannel.cpp
+)
+ENDIF(NOT OWBAL_PLATFORM_WIN32PORT)
+set(facilities_SRC
+		${facilities_SRC}
 		BAL/Implementations/Facilities/Generic/BTTextLogFormatter.cpp
 		BAL/Implementations/Facilities/Generic/BTPlugInInfoStore.cpp
         	BAL/Implementations/Facilities/Generic/BTCookie.cpp
@@ -15,15 +23,20 @@
 	)
 ELSE (NOT WEBKIT_USE_NPAPI)
         set(facilities_SRC
-                ${facilities_SRC}
-
-                BAL/Implementations/Facilities/Generic/BCObserverService.cpp
+                ${facilities_SRC}                BAL/Implementations/Facilities/Generic/BCObserverService.cpp
                 BAL/Implementations/Facilities/Generic/BTDeviceChannel.cpp
                 BAL/Implementations/Facilities/Generic/BTLogChannel.cpp
                 BAL/Implementations/Facilities/Generic/BTLogFormatter.cpp
                 BAL/Implementations/Facilities/Generic/BTLogManager.cpp
+)
+IF(NOT OWBAL_PLATFORM_WIN32PORT)
+set(facilities_SRC
+                ${facilities_SRC}                
                 BAL/Implementations/Facilities/Generic/BTSyslogChannel.cpp
-                BAL/Implementations/Facilities/Generic/BTTextLogFormatter.cpp
+)
+ENDIF (NOT OWBAL_PLATFORM_WIN32PORT)
+set(facilities_SRC
+                ${facilities_SRC}                               BAL/Implementations/Facilities/Generic/BTTextLogFormatter.cpp
                 BAL/Implementations/Facilities/Generic/BTCookie.cpp
                 BAL/Implementations/Facilities/Generic/BCCookieManager.cpp
         )
diff -rbui owb-trunk.r241-orig/BAL/Implementations/Fonts/FreeType/BCFontPlatformDataPrivateFreeType.cpp owb_trunk.r241/BAL/Implementations/Fonts/FreeType/BCFontPlatformDataPrivateFreeType.cpp
--- owb-trunk.r241-orig/BAL/Implementations/Fonts/FreeType/BCFontPlatformDataPrivateFreeType.cpp	2008-03-25 10:42:08.000000000 +0100
+++ owb_trunk.r241/BAL/Implementations/Fonts/FreeType/BCFontPlatformDataPrivateFreeType.cpp	2008-06-04 09:27:20.401241500 +0200
@@ -32,7 +32,7 @@
 #include "BTFontPlatformData.h"
 #include "BTLogHelper.h"
 #include "CString.h"
-
+#include <zlib.h>
 IMPLEMENT_CREATE_DELETE(BIFontPlatformDataPrivate, BCFontPlatformDataPrivateFreeType);
 
 using WebCore::CString;
@@ -174,8 +174,8 @@
         m_face = 0;
         return;
     }
-    FT_Set_Pixel_Sizes(m_face, 0, static_cast<uint> (fontDescription.specifiedSize()));
-    DBGML(MODULE_FONTS, LEVEL_INFO, "open font %s with size %d\n", filename, static_cast<uint> (fontDescription.specifiedSize()));
+    FT_Set_Pixel_Sizes(m_face, 0, static_cast<unsigned int> (fontDescription.specifiedSize()));
+    DBGML(MODULE_FONTS, LEVEL_INFO, "open font %s with size %d\n", filename, static_cast<unsigned int>(fontDescription.specifiedSize()));
 }
 
 bool BCFontPlatformDataPrivateFreeType::isFixedPitch()
diff -rbui owb-trunk.r241-orig/BAL/Implementations/Graphics/SDL/BCGraphicsDeviceSDL.cpp owb_trunk.r241/BAL/Implementations/Graphics/SDL/BCGraphicsDeviceSDL.cpp
--- owb-trunk.r241-orig/BAL/Implementations/Graphics/SDL/BCGraphicsDeviceSDL.cpp	2008-03-25 10:42:08.000000000 +0100
+++ owb_trunk.r241/BAL/Implementations/Graphics/SDL/BCGraphicsDeviceSDL.cpp	2008-06-04 09:27:20.410030000 +0200
@@ -57,6 +57,13 @@
 
 IMPLEMENT_GET_DELETE(BIGraphicsDevice, BCGraphicsDeviceSDL);
 
+#ifdef __OWBAL_PLATFORM_WIN32PORT__
+extern "C" int lineRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
+extern "C" int ellipseRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
+extern "C" int rectangleRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
+extern "C" int filledPolygonRGBA(SDL_Surface * dst, const Sint16 * vx, const Sint16 * vy, int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
+extern SDL_Surface *zoomSurface(SDL_Surface * src, double zoomx, double zoomy, int smooth);
+#endif
 #define GET_NATIVE(image) ((static_cast<const BCNativeImage*>(image))->getNativeSDL())
 
 namespace BAL {
@@ -105,7 +112,7 @@
     if (!m_screen) {
         DBGML(MODULE_GRAPHICS, LEVEL_CRITICAL, "SDL_SetVideoMode failed: %s\n", SDL_GetError());
         exit(1);
-    } else
+    }else
         DBGM(MODULE_GRAPHICS, "SDL_SetVideoMode succeeded\n");
 }
 
@@ -119,6 +126,7 @@
 //         SDL_FreeSurface(m_screen);
          m_screen = 0;
      }
+	 DBGM(MODULE_GRAPHICS,"Fin SDL\n");
     SDL_QuitSubSystem(SDL_INIT_VIDEO);
     SDL_Quit();
 }
@@ -281,7 +289,11 @@
     //        |             Note: 0 <= alpha0, alpha1 <= 90
     //        |
 
+#ifdef __OWBAL_PLATFORM_WIN32PORT__
+	double r = (rect.width() - 1) / 2;
+#else
     int r = (rect.width() - 1) / 2;
+#endif
     int xc = rect.x() + r;
     int yc = rect.y() + (rect.height() - 1)/ 2;
     int z0 = startAngle / 90;
@@ -296,7 +308,7 @@
     if (z0 == z1) {
         // Draw in the same zone from angle = z0 * 90 + alpha0 to angle = z0 * 90 + alpha1
         x0 = xalpha0;
-        y0 = sqrt(pow(r, 2) - pow(x0, 2));
+		y0 = sqrt(::pow(r,2) - pow(x0,2));
         for (x1 = xalpha0; x1 >= xalpha1; x1--) {
             y1 = sqrt(pow(r, 2) - pow(x1, 2));
             drawArc(widget, color, z0, xc, yc, x0, y0, x1, y1);
diff -rbui owb-trunk.r241-orig/BAL/Implementations/Graphics/SDL/CursorSDL.cpp owb_trunk.r241/BAL/Implementations/Graphics/SDL/CursorSDL.cpp
--- owb-trunk.r241-orig/BAL/Implementations/Graphics/SDL/CursorSDL.cpp	2008-03-25 10:42:08.000000000 +0100
+++ owb_trunk.r241/BAL/Implementations/Graphics/SDL/CursorSDL.cpp	2008-06-04 09:27:20.417842000 +0200
@@ -67,7 +67,11 @@
 
 Cursor::Cursor(char* xpmCursor[])
 {
+#ifdef __OWBAL_PLATFORM_WIN32PORT__
+    const int width = 16, height = 24;
+#else
     int width = 16, height = 24;
+#endif
     int i, row, col;
     Uint8 data[4 * height];
     Uint8 mask[4 * height];
diff -rbui owb-trunk.r241-orig/BAL/Implementations/ImageDecoders/Generic/PNG/png.c owb_trunk.r241/BAL/Implementations/ImageDecoders/Generic/PNG/png.c
--- owb-trunk.r241-orig/BAL/Implementations/ImageDecoders/Generic/PNG/png.c	2007-05-15 21:10:50.000000000 +0200
+++ owb_trunk.r241/BAL/Implementations/ImageDecoders/Generic/PNG/png.c	2008-06-04 09:27:20.426630500 +0200
@@ -143,13 +143,17 @@
 png_zalloc(voidpf png_ptr, uInt items, uInt size)
 {
    png_voidp ptr;
+#ifdef __OWBAL_PLATFORM_WIN32PORT__
+   png_structp p=(png_structp)png_ptr;
+#else
    png_structp p=png_ptr;
+#endif
    png_uint_32 save_flags=p->flags;
    png_uint_32 num_bytes;
 
    if (items > PNG_UINT_32_MAX/size)
    {
-     png_warning (png_ptr, "Potential overflow in png_zalloc()");
+     png_warning ((png_structp)png_ptr, "Potential overflow in png_zalloc()");
      return (NULL);
    }
    num_bytes = (png_uint_32)items * size;
diff -rbui owb-trunk.r241-orig/BAL/Implementations/ImageDecoders/Generic/PNG/png.h owb_trunk.r241/BAL/Implementations/ImageDecoders/Generic/PNG/png.h
--- owb-trunk.r241-orig/BAL/Implementations/ImageDecoders/Generic/PNG/png.h	2007-05-15 21:10:50.000000000 +0200
+++ owb_trunk.r241/BAL/Implementations/ImageDecoders/Generic/PNG/png.h	2008-06-04 09:27:20.437372000 +0200
@@ -343,8 +343,7 @@
 #ifndef PNG_VERSION_INFO_ONLY
 
 /* include the compression library's header */
-#include "zlib.h"
-
+#include <zlib.h>
 /* include all user configurable info, including optional assembler routines */
 #include "pngconf.h"
 
diff -rbui owb-trunk.r241-orig/BAL/Implementations/Internationalization/ICU/BCInternationalizationICU.cpp owb_trunk.r241/BAL/Implementations/Internationalization/ICU/BCInternationalizationICU.cpp
--- owb-trunk.r241-orig/BAL/Implementations/Internationalization/ICU/BCInternationalizationICU.cpp	2007-11-21 18:52:54.000000000 +0100
+++ owb_trunk.r241/BAL/Implementations/Internationalization/ICU/BCInternationalizationICU.cpp	2008-06-04 09:27:20.446160500 +0200
@@ -28,6 +28,10 @@
 #include "BCInternationalizationICU.h"
 #include "DeprecatedString.h"
 
+#ifdef __OWBAL_PLATFORM_WIN32PORT__
+#include "ctype.h"
+#endif
+
 IMPLEMENT_GET_DELETE(BIInternationalization, BCInternationalizationICU);
 using WebCore::DeprecatedString;
 
@@ -35,7 +39,11 @@
 
 DeprecatedString *BCInternationalizationICU::toAce(const DeprecatedString *s, const unsigned l)
 {
+	#ifdef __OWBAL_PLATFORM_WIN32PORT__
+    UChar buffer[100];
+	#else
     UChar buffer[l];
+	#endif
     UErrorCode error = U_ZERO_ERROR;
     int32_t numCharactersConverted = uidna_IDNToASCII
         (reinterpret_cast<const UChar *>(s->unicode()), s->length(), buffer, l, UIDNA_ALLOW_UNASSIGNED, 0, &error);
diff -rbui owb-trunk.r241-orig/BAL/Implementations/Types/SourcesCMakeLists.txt owb_trunk.r241/BAL/Implementations/Types/SourcesCMakeLists.txt
--- owb-trunk.r241-orig/BAL/Implementations/Types/SourcesCMakeLists.txt	2008-03-25 10:42:08.000000000 +0100
+++ owb_trunk.r241/BAL/Implementations/Types/SourcesCMakeLists.txt	2008-06-04 09:27:20.454949000 +0200
@@ -36,9 +36,18 @@
 	BAL/Implementations/Types/Common/TextEncodingRegistry.cpp
 	BAL/Implementations/Types/Common/TextStream.cpp
 	BAL/Implementations/Types/Common/Timer.cpp
-
-
-	BAL/Implementations/Types/Linux/BCFileLinux.cpp	
+)
+IF(OWBAL_PLATFORM_WIN32PORT)
+ set(types_SRC
+        ${types_SRC}
+		BAL/Implementations/Types/SDL/SharedTimerSDL.cpp
+		WebCore/platform/win/SystemTimeWin.cpp
+	)
+ELSE (OWBAL_PLATFORM_WIN32PORT)
+set(types_SRC
+        ${types_SRC}
+BAL/Implementations/Types/Linux/BCFileLinux.cpp	
     BAL/Implementations/Types/Linux/SharedTimerLinux.cpp
 	BAL/Implementations/Types/Linux/SystemTimeLinux.cpp
 )
+ENDIF(OWBAL_PLATFORM_WIN32PORT)
diff -rbui owb-trunk.r241-orig/BAL/Interfaces/BTDeviceChannel.h owb_trunk.r241/BAL/Interfaces/BTDeviceChannel.h
--- owb-trunk.r241-orig/BAL/Interfaces/BTDeviceChannel.h	2007-05-15 21:10:50.000000000 +0200
+++ owb_trunk.r241/BAL/Interfaces/BTDeviceChannel.h	2008-06-04 09:27:20.463737500 +0200
@@ -76,7 +76,11 @@
 
 private:
     string m_pathName;
+#ifndef __OWBAL_PLATFORM_WIN32PORT__
     ssize_t m_descriptor;
+#else
+	size_t m_descriptor;
+#endif
 };
 
 } // namespace BALFacilities
diff -rbui owb-trunk.r241-orig/BAL/Interfaces/BTLogHelper.h owb_trunk.r241/BAL/Interfaces/BTLogHelper.h
--- owb-trunk.r241-orig/BAL/Interfaces/BTLogHelper.h	2007-11-21 18:52:54.000000000 +0100
+++ owb_trunk.r241/BAL/Interfaces/BTLogHelper.h	2008-06-04 09:27:20.471549500 +0200
@@ -59,14 +59,14 @@
 
 extern BTLogManager logger;
 // FIXME SRO temporary length of variadic args size to 0xff
-
+#ifdef __OWBAL_PLATFORM_WIN32PORT__
+#define __func__ __FUNCTION__
+#endif
 #define DBG(...) BALFacilities::logger.send(MODULE_UNDEFINED, LEVEL_INFO, __FILE__,     __LINE__, __func__, __VA_ARGS__)
+#define DBGM(module, ...) BALFacilities::logger.send(module, LEVEL_INFO,__FILE__, __LINE__, __func__, __VA_ARGS__)
 
-#define DBGM(module, ...) BALFacilities::logger.send(module, LEVEL_INFO, \
-                   __FILE__, __LINE__, __func__, __VA_ARGS__)
+#define DBGML(module, level, ...) BALFacilities::logger.send(module, level,__FILE__, __LINE__, __func__, __VA_ARGS__)
 
-#define DBGML(module, level, ...) BALFacilities::logger.send(module, level,\
-                   __FILE__, __LINE__, __func__, __VA_ARGS__)
 
 } // namespace BALFacilities
 
diff -rbui owb-trunk.r241-orig/BAL/Interfaces/SystemTime.h owb_trunk.r241/BAL/Interfaces/SystemTime.h
--- owb-trunk.r241-orig/BAL/Interfaces/SystemTime.h	2008-06-04 09:28:30.279581500 +0200
+++ owb_trunk.r241/BAL/Interfaces/SystemTime.h	2008-06-04 09:27:20.479361500 +0200
@@ -27,6 +27,14 @@
 #define SystemTime_h
 
 #include "PlatformString.h"
+#ifdef __OWBAL_PLATFORM_WIN32PORT__
+#include <winsock.h>
+int gettimeofday(struct timeval *tp, int nothing);
+struct itimerval{
+	struct timeval it_interval;
+	struct timeval it_value;
+};
+#endif
 
 namespace WebCore {
 
diff -rbui owb-trunk.r241-orig/BAL/Interfaces/graphics/BIWindowManager.h owb_trunk.r241/BAL/Interfaces/graphics/BIWindowManager.h
--- owb-trunk.r241-orig/BAL/Interfaces/graphics/BIWindowManager.h	2007-11-21 18:52:54.000000000 +0100
+++ owb_trunk.r241/BAL/Interfaces/graphics/BIWindowManager.h	2008-06-04 09:27:20.488150000 +0200
@@ -40,6 +40,9 @@
 #ifndef BIWINDOWMANAGER_H
 #define BIWINDOWMANAGER_H
 
+#ifdef __OWBAL_PLATFORM_WIN32PORT__
+#include <utf16.h>
+#endif
 namespace WebCore {
 
     class IntRect;
diff -rbui owb-trunk.r241-orig/BAL/Tests/EventsTests/EventLoopTest.cpp owb_trunk.r241/BAL/Tests/EventsTests/EventLoopTest.cpp
--- owb-trunk.r241-orig/BAL/Tests/EventsTests/EventLoopTest.cpp	2007-11-21 18:52:54.000000000 +0100
+++ owb_trunk.r241/BAL/Tests/EventsTests/EventLoopTest.cpp	2008-06-04 09:27:20.494985500 +0200
@@ -30,6 +30,9 @@
 #include "BALConfiguration.h"
 #include "BIEventLoop.h"
 #include "IntRect.h"
+#ifdef __OWBAL_PLATFORM_WIN32PORT__
+#include <utf16.h>
+#endif
 #include "../TestManager/TestManager.h"
 
 using namespace BAL;
diff -rbui owb-trunk.r241-orig/BAL/Tests/FacilitiesTests/LogManagerTestInteractif.cpp owb_trunk.r241/BAL/Tests/FacilitiesTests/LogManagerTestInteractif.cpp
--- owb-trunk.r241-orig/BAL/Tests/FacilitiesTests/LogManagerTestInteractif.cpp	2007-11-21 18:52:54.000000000 +0100
+++ owb_trunk.r241/BAL/Tests/FacilitiesTests/LogManagerTestInteractif.cpp	2008-06-04 09:27:20.502797500 +0200
@@ -34,7 +34,13 @@
 #include <errno.h>
 #include <iostream>
 #include <iomanip>
+#ifdef __OWBAL_PLATFORM_WIN32PORT__
+#include <io.h>
+#include <process.h>
+#include <stdio.h>
+#else
 #include <termios.h>
+#endif
 #include <errno.h>
 using std::cin;
 using std::cout;
@@ -75,6 +81,7 @@
     {
         // some code to disable echo on console
         // and to enable one only char capture
+#ifndef __OWBAL_PLATFORM_WIN32PORT__
         struct termios *termios_p;
         termios_p = new struct termios;
         tcflag_t lflag;
@@ -116,6 +123,7 @@
 
         // do this at the because of the exit()
         TestManager::AssertTrue(message, 'y' == aChar || 'Y' ==  aChar);
+#endif
     }
     void testLogMacro()
     {
diff -rbui owb-trunk.r241-orig/BAL/Tests/TestManager/TestManager.cpp owb_trunk.r241/BAL/Tests/TestManager/TestManager.cpp
--- owb-trunk.r241-orig/BAL/Tests/TestManager/TestManager.cpp	2007-11-21 18:52:54.000000000 +0100
+++ owb_trunk.r241/BAL/Tests/TestManager/TestManager.cpp	2008-06-04 09:27:20.510609500 +0200
@@ -31,9 +31,11 @@
 /********************************************************/
 #include <stdio.h>
 #include <signal.h>
+#ifndef __OWBAL_PLATFORM_WIN32PORT__
 #include <sys/resource.h>
-#include <time.h>
 #include <unistd.h>
+#endif
+#include <time.h>
 
 #include "TestManager.h"
 
@@ -112,7 +114,9 @@
 		LogMessage("NOT INTERACTIVE MODE: ");
     LogMessage(aQuestionMessage);
 		LogMessage("\nWaiting for 1 second...\n");
+#ifndef __OWBAL_PLATFORM_WIN32PORT__
 		sleep(1);
+#endif
 		LogMessage("Test goes on\n");
 		return 0;
 	}
diff -rbui owb-trunk.r241-orig/BAL/Tests/TestManager/TestManager.h owb_trunk.r241/BAL/Tests/TestManager/TestManager.h
--- owb-trunk.r241-orig/BAL/Tests/TestManager/TestManager.h	2007-11-21 18:52:54.000000000 +0100
+++ owb_trunk.r241/BAL/Tests/TestManager/TestManager.h	2008-06-04 09:27:20.518421500 +0200
@@ -36,7 +36,6 @@
 
 #include <stdio.h>
 #include <signal.h>
-#include <sys/resource.h>
 #include <time.h>
 #include <string>
 using namespace std;
diff -rbui owb-trunk.r241-orig/BAL/Tests/TestManager/TestRunner.cpp owb_trunk.r241/BAL/Tests/TestManager/TestRunner.cpp
--- owb-trunk.r241-orig/BAL/Tests/TestManager/TestRunner.cpp	2007-11-21 18:52:54.000000000 +0100
+++ owb_trunk.r241/BAL/Tests/TestManager/TestRunner.cpp	2008-06-04 09:27:20.525257000 +0200
@@ -28,7 +28,9 @@
 #include <stdio.h>
 #include <signal.h>
 #include <time.h>
+#ifndef __OWBAL_PLATFORM_WIN32PORT__
 #include <sys/resource.h>
+#endif
 #include <string>
 
 #include "TestManager.h"
diff -rbui owb-trunk.r241-orig/BAL/Tests/TestManager/TestRunner.h owb_trunk.r241/BAL/Tests/TestManager/TestRunner.h
--- owb-trunk.r241-orig/BAL/Tests/TestManager/TestRunner.h	2007-05-15 21:10:50.000000000 +0200
+++ owb_trunk.r241/BAL/Tests/TestManager/TestRunner.h	2008-06-04 09:27:20.534045500 +0200
@@ -39,7 +39,6 @@
 /********************************************************/
 #include <stdio.h>
 #include <signal.h>
-#include <sys/resource.h>
 #include <time.h>
 
 #include "TestManager.h"
diff -rbui owb-trunk.r241-orig/BAL/Tests/TypesTests/TimerTest.cpp owb_trunk.r241/BAL/Tests/TypesTests/TimerTest.cpp
--- owb-trunk.r241-orig/BAL/Tests/TypesTests/TimerTest.cpp	2007-11-21 18:52:54.000000000 +0100
+++ owb_trunk.r241/BAL/Tests/TypesTests/TimerTest.cpp	2008-06-04 09:27:20.540881000 +0200
@@ -35,6 +35,7 @@
 #include "TestManager/TestManager.h"
 #include "Timer.h"
 
+
 using BAL::BIEventLoop;
 using BAL::BIEvent;
 
@@ -81,7 +82,9 @@
                 delete event;
                 event = NULL;
             }
+#ifndef __OWBAL_PLATFORM_WIN32PORT__
             sleep(1);
+#endif
             aNbLoop--;
         }
         
diff -rbui owb-trunk.r241-orig/BAL/Tests/XMLTests/XmlTest.cpp owb_trunk.r241/BAL/Tests/XMLTests/XmlTest.cpp
--- owb-trunk.r241-orig/BAL/Tests/XMLTests/XmlTest.cpp	2007-07-20 16:03:48.000000000 +0200
+++ owb_trunk.r241/BAL/Tests/XMLTests/XmlTest.cpp	2008-06-04 09:27:20.549669500 +0200
@@ -38,6 +38,10 @@
 #include <fcntl.h>
 
 #include "PlatformString.h"
+#ifdef __OWBAL_PLATFORM_WIN32PORT__
+#include <io.h>
+#define size 256
+#endif
 
 using namespace BAL;
 using namespace WebCore;
@@ -96,9 +100,11 @@
         if( fd < 0 )
             return;
         
+#ifndef __OWBAL_PLATFORM_WIN32PORT__
         int size = lseek( fd, 0, SEEK_END );
+#else
         lseek( fd, SEEK_SET, 0 );
-        
+#endif   
         char buf[size];
         
         int readSize = read( fd, buf, size );
diff -rbui owb-trunk.r241-orig/BALGlue/PlatformScrollBarBal.cpp owb_trunk.r241/BALGlue/PlatformScrollBarBal.cpp
--- owb-trunk.r241-orig/BALGlue/PlatformScrollBarBal.cpp	2007-11-21 18:52:54.000000000 +0100
+++ owb_trunk.r241/BALGlue/PlatformScrollBarBal.cpp	2008-06-04 09:27:20.557481500 +0200
@@ -35,10 +35,17 @@
 using namespace BAL;
 
 
+#ifdef __OWBAL_PLATFORM_WIN32PORT__
+PlatformScrollbar::PlatformScrollbar(WebCore::ScrollbarClient* client, WebCore::ScrollbarOrientation orientation,
+									 WebCore::ScrollbarControlSize controlSize)
+    : Scrollbar(client, orientation, controlSize)
+{ 
+#else
 PlatformScrollbar::PlatformScrollbar(ScrollbarClient* client, ScrollbarOrientation orientation,
                                      ScrollbarControlSize controlSize)
     : Scrollbar(client, orientation, controlSize)
 { 
+#endif
     /*
      * assign a sane default width and height to the ScrollBar, otherwise
      * we will end up with a 0 width scrollbar.
diff -rbui owb-trunk.r241-orig/BALGlue/XML/LIBXML/ParseXML.cpp owb_trunk.r241/BALGlue/XML/LIBXML/ParseXML.cpp
--- owb-trunk.r241-orig/BALGlue/XML/LIBXML/ParseXML.cpp	2008-03-25 10:42:08.000000000 +0100
+++ owb_trunk.r241/BALGlue/XML/LIBXML/ParseXML.cpp	2008-06-04 09:27:20.565293500 +0200
@@ -58,6 +58,7 @@
 #include "Comment.h"
 #include "DocumentType.h"
 
+
 using WebCore::Document;
 using WebCore::String;
 using WebCore::DeprecatedPtrList;
diff -rbui owb-trunk.r241-orig/CMakeLists.txt owb_trunk.r241/CMakeLists.txt
--- owb-trunk.r241-orig/CMakeLists.txt	2008-03-25 10:42:08.000000000 +0100
+++ owb_trunk.r241/CMakeLists.txt	2008-06-04 09:27:20.573105500 +0200
@@ -54,6 +54,12 @@
     ADD_DEFINITIONS (-D__OWBAL_PLATFORM_MACPORT__)
 ENDIF (OWBAL_PLATFORM_MACPORT)
 
+# Global switch for OWBAL support for Win32 port
+OPTION (OWBAL_PLATFORM_WIN32PORT "OWBAL support for Win32 port" OFF)
+IF (OWBAL_PLATFORM_WIN32PORT)
+    ADD_DEFINITIONS (-D__OWBAL_PLATFORM_WIN32PORT__)
+ENDIF (OWBAL_PLATFORM_WIN32PORT)
+
 # Global switch for Web UIF support
 OPTION (WEBKIT_USE_WEB_UI "Compile WebKit with Web UI support." OFF)
 IF (WEBKIT_USE_WEB_UI)
@@ -182,7 +188,9 @@
 # Global switch for EXCEPTIONS support
 OPTION (WEBKIT_USE_CC_EXCEPTIONS "Compile WebKit with exceptions support." OFF)
 IF (NOT WEBKIT_USE_CC_EXCEPTIONS)
+	IF (NOT OWBAL_PLATFORM_WIN32PORT)
     ADD_DEFINITIONS (-fno-exceptions)
+	ENDIF (NOT OWBAL_PLATFORM_WIN32PORT)
 ENDIF (NOT WEBKIT_USE_CC_EXCEPTIONS)
 
 # Switch for no stack protection flag
@@ -194,7 +202,10 @@
 # Global switch for RTTI support
 OPTION (WEBKIT_USE_CC_RTTI "Compile WebKit with rtti support." OFF)
 IF (NOT WEBKIT_USE_CC_RTTI)
+    IF (NOT OWBAL_PLATFORM_WIN32PORT)
     SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti")
+    	ADD_DEFINITIONS (-fno-rtti)
+    	ENDIF (NOT OWBAL_PLATFORM_WIN32PORT)
 ENDIF (NOT WEBKIT_USE_CC_RTTI)
 
 # Global switch fo Verbose mode
@@ -205,19 +216,31 @@
 
 # Global switch for DEBUG support
 SET (WEBKIT_DEBUG "DEBUG" CACHE STRING "Compile WebKit with debug support. (DEBUG/DEBUG_GCC3.X/RELEASE)")
-
 IF (${WEBKIT_DEBUG} MATCHES "^DEBUG*")
     ADD_DEFINITIONS (-DENABLE_FTPDIR=1)
+   INCLUDE (CheckCXXCompilerFlag)
+   CHECK_CXX_COMPILER_FLAG ("-Wall -g -Wno-unused-parameter -Wno-unused-variable" GNU_FLAGS)
+	IF (GNU_FLAGS)
     ADD_DEFINITIONS (-W)
     ADD_DEFINITIONS (-Wall)
-    ADD_DEFINITIONS (-DDEBUG_LAYOUTTEST)
     ADD_DEFINITIONS (-g)
-    ADD_DEFINITIONS (-DBAL_LOG)
     ADD_DEFINITIONS (-Wno-unused-parameter)
     ADD_DEFINITIONS (-Wno-unused-variable)
+	ENDIF (GNU_FLAGS)
+	CHECK_CXX_COMPILER_FLAG ("/Zi /W0 /Gm /GR-" MSVC_FLAGS)
+	IF (MSVC_FLAGS)
+		ADD_DEFINITIONS (/Zi)
+   		ADD_DEFINITIONS (/W0)
+   		ADD_DEFINITIONS (/Gm) 	
+		ADD_DEFINITIONS (/GR-)
+	ENDIF (MSVC_FLAGS)
+	ADD_DEFINITIONS (-DDEBUG_LAYOUTTEST)
+   	ADD_DEFINITIONS (-DBAL_LOG)
 ENDIF (${WEBKIT_DEBUG} MATCHES "^DEBUG*")
 IF (${WEBKIT_DEBUG} STREQUAL "DEBUG_GCC3.X")
+	IF( NOT OWBAL_PLATFORM_WIN32PORT)
 	ADD_DEFINITIONS (-funit-at-a-time)
+	ENDIF (NOT OWBAL_PLATFORM_WIN32PORT)
 ENDIF (${WEBKIT_DEBUG} STREQUAL "DEBUG_GCC3.X")
 IF (${WEBKIT_DEBUG} STREQUAL "RELEASE")
 	SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -DNDEBUG")
@@ -257,11 +280,31 @@
 ADD_DEFINITIONS (-D__OWB__)
 ADD_DEFINITIONS (-DUSE_CONSERVATIVE_GC=0)
 ADD_DEFINITIONS (-DD_MULTISCAN_FILES_SUPPORTED)
+IF(OWBAL_PLATFORM_WIN32PORT)
+ADD_DEFINITIONS (-DWIN32)
+ELSE(OWBAL_PLATFORM_WIN32PORT)
 ADD_DEFINITIONS (-DLINUX)
+ENDIF(OWBAL_PLATFORM_WIN32PORT)
+
 IF (NOT OWBAL_PLATFORM_MACPORT)
+	IF (NOT OWBAL_PLATFORM_WIN32PORT)
     ADD_DEFINITIONS (-pthread)
+	ENDIF (NOT OWBAL_PLATFORM_WIN32PORT)
 ENDIF (NOT OWBAL_PLATFORM_MACPORT)
 
+IF (OWBAL_PLATFORM_WIN32PORT)
+	INCLUDE_DIRECTORIES (C:/WinLib/include
+		C:/WinLib/include/SDL
+		C:/WinLib/include/fontconfig
+		C:/WinLib/include/freetype2
+		C:/WinLib/include/libxml
+		C:/WinLib/include/libxslt
+		C:/WinLib/include/unicode
+      	C:/WinLib/lib
+		${types_SRC}JavaScriptCore/os-win32)
+ENDIF (OWBAL_PLATFORM_WIN32PORT)
+
+
 IF (OWBAL_PLATFORM_MACPORT)
     ADD_DEFINITIONS (-I/opt/local/include)
     LINK_DIRECTORIES(/opt/local/lib)
diff -rbui owb-trunk.r241-orig/CMakeLists_deepseeProject.txt owb_trunk.r241/CMakeLists_deepseeProject.txt
--- owb-trunk.r241-orig/CMakeLists_deepseeProject.txt	2008-03-25 10:42:08.000000000 +0100
+++ owb_trunk.r241/CMakeLists_deepseeProject.txt	2008-06-04 09:54:26.863547500 +0200
@@ -14,6 +14,9 @@
 include(${CMAKE_SOURCE_DIR}/CMakeLists_deepsee.txt)
 
 ELSE(DEEPSEE_ENABLE)
+IF(OWBAL_PLATFORM_WIN32PORT)
+	ADD_DEFINITIONS(/DNO_USE_DEEPSEE)
+ENDIF(OWBAL_PLATFORM_WIN32PORT)
     SET(DEEPSEE_FAKED_DEEPSEE.H "FakedDeepsee.h")
     IF (EXISTS ${DEEPSEE_FAKED_DEEPSEE.H})
         #file already exists
diff -rbui owb-trunk.r241-orig/JavaScriptCore/API/JSClassRef.cpp owb_trunk.r241/JavaScriptCore/API/JSClassRef.cpp
--- owb-trunk.r241-orig/JavaScriptCore/API/JSClassRef.cpp	2007-11-21 18:52:54.000000000 +0100
+++ owb_trunk.r241/JavaScriptCore/API/JSClassRef.cpp	2008-06-04 09:27:20.588729500 +0200
@@ -25,7 +25,9 @@
  */
 
 #include <wtf/Platform.h>
+#ifndef __OWBAL_PLATFORM_WIN32PORT__
 #include "APICast.h"
+#endif
 #include "JSCallbackObject.h"
 #include "JSClassRef.h"
 #include "JSObjectRef.h"
diff -rbui owb-trunk.r241-orig/JavaScriptCore/API/JSContextRef.cpp owb_trunk.r241/JavaScriptCore/API/JSContextRef.cpp
--- owb-trunk.r241-orig/JavaScriptCore/API/JSContextRef.cpp	2007-11-21 18:52:54.000000000 +0100
+++ owb_trunk.r241/JavaScriptCore/API/JSContextRef.cpp	2008-06-04 09:27:20.596541500 +0200
@@ -25,9 +25,10 @@
  */
 
 #include <wtf/Platform.h>
+#ifndef __OWBAL_PLATFORM_WIN32PORT__
 #include "APICast.h"
+#endif
 #include "JSContextRef.h"
-
 #include "JSCallbackObject.h"
 #include "JSGlobalObject.h"
 #include "completion.h"
diff -rbui owb-trunk.r241-orig/JavaScriptCore/API/JSObjectRef.cpp owb_trunk.r241/JavaScriptCore/API/JSObjectRef.cpp
--- owb-trunk.r241-orig/JavaScriptCore/API/JSObjectRef.cpp	2007-11-21 18:52:54.000000000 +0100
+++ owb_trunk.r241/JavaScriptCore/API/JSObjectRef.cpp	2008-06-04 09:27:20.604353500 +0200
@@ -25,7 +25,9 @@
  */
 
 #include <wtf/Platform.h>
+#ifndef __OWBAL_PLATFORM_WIN32PORT__
 #include "APICast.h"
+#endif
 #include "JSValueRef.h"
 #include "JSObjectRef.h"
 #include "JSCallbackConstructor.h"
diff -rbui owb-trunk.r241-orig/JavaScriptCore/API/JSStringRef.cpp owb_trunk.r241/JavaScriptCore/API/JSStringRef.cpp
--- owb-trunk.r241-orig/JavaScriptCore/API/JSStringRef.cpp	2007-11-21 18:52:54.000000000 +0100
+++ owb_trunk.r241/JavaScriptCore/API/JSStringRef.cpp	2008-06-04 09:27:20.612165500 +0200
@@ -27,7 +27,15 @@
 #include <wtf/Platform.h>
 #include "JSStringRef.h"
 
+#ifndef __OWBAL_PLATFORM_WIN32PORT__
 #include "APICast.h"
+#else
+#include "JSCallbackObject.h"
+#include "JSValueRef.h"
+#include <kjs/JSGlobalObject.h>
+#include <kjs/protect.h>
+#include <wtf/Assertions.h>
+#endif
 #include <kjs/JSLock.h>
 #include <kjs/JSType.h>
 #include <kjs/internal.h>
@@ -40,7 +48,7 @@
 JSStringRef JSStringCreateWithCharacters(const JSChar* chars, size_t numChars)
 {
     JSLock lock;
-    return toRef(UString(reinterpret_cast<const UChar*>(chars), static_cast<int>(numChars)).rep()->ref());
+    return toRef(UString(reinterpret_cast<const KJS::UChar*>(chars), static_cast<int>(numChars)).rep()->ref());
 }
 
 JSStringRef JSStringCreateWithUTF8CString(const char* string)
diff -rbui owb-trunk.r241-orig/JavaScriptCore/API/JSValueRef.cpp owb_trunk.r241/JavaScriptCore/API/JSValueRef.cpp
--- owb-trunk.r241-orig/JavaScriptCore/API/JSValueRef.cpp	2007-11-21 18:52:54.000000000 +0100
+++ owb_trunk.r241/JavaScriptCore/API/JSValueRef.cpp	2008-06-04 09:27:20.620954000 +0200
@@ -25,7 +25,9 @@
  */
 
 #include <wtf/Platform.h>
+#ifndef __OWBAL_PLATFORM_WIN32PORT__
 #include "APICast.h"
+#endif
 #include "JSCallbackObject.h"
 #include "JSValueRef.h"
 
diff -rbui owb-trunk.r241-orig/JavaScriptCore/bindings/bal/bal_instance.cpp owb_trunk.r241/JavaScriptCore/bindings/bal/bal_instance.cpp
--- owb-trunk.r241-orig/JavaScriptCore/bindings/bal/bal_instance.cpp	2007-11-21 18:52:54.000000000 +0100
+++ owb_trunk.r241/JavaScriptCore/bindings/bal/bal_instance.cpp	2008-06-04 09:27:20.627789500 +0200
@@ -135,7 +135,11 @@
 JSValue* BalInstance::stringValue() const
 {
     char buf[1024];
+#ifdef __OWBAL_PLATFORM_WIN32PORT__ 
+    _snprintf(buf, sizeof(buf), "BalObject %p (%s)", m_object, m_class->name());
+#else
     snprintf(buf, sizeof(buf), "BalObject %p (%s)", m_object, m_class->name());
+#endif
     return jsString(buf);
 }
 
diff -rbui owb-trunk.r241-orig/JavaScriptCore/kjs/config.h owb_trunk.r241/JavaScriptCore/kjs/config.h
--- owb-trunk.r241-orig/JavaScriptCore/kjs/config.h	2008-03-25 10:42:08.000000000 +0100
+++ owb_trunk.r241/JavaScriptCore/kjs/config.h	2008-06-04 09:27:20.643413500 +0200
@@ -20,8 +20,10 @@
  */
 
 #ifdef __OWB__
+#ifndef NO_USE_DEEPSEE
 #include DEEPSEE_INCLUDE
 #endif
+#endif
 
 #include <wtf/Platform.h>
 
diff -rbui owb-trunk.r241-orig/JavaScriptCore/kjs/interpreter.cpp owb_trunk.r241/JavaScriptCore/kjs/interpreter.cpp
--- owb-trunk.r241-orig/JavaScriptCore/kjs/interpreter.cpp	2007-11-21 18:52:54.000000000 +0100
+++ owb_trunk.r241/JavaScriptCore/kjs/interpreter.cpp	2008-06-04 09:27:20.652202000 +0200
@@ -749,7 +749,7 @@
 #elif PLATFORM(QT)
     QDateTime t = QDateTime::currentDateTime();
     return t.toTime_t() * 1000 + t.time().msec();
-#elif PLATFORM(WIN_OS)
+#elif PLATFORM(WIN_OS) || __OWBAL_PLATFORM_WIN32PORT__
     return timeGetTime();
 #else
 #error Platform does not have getCurrentTime function
diff -rbui owb-trunk.r241-orig/JavaScriptCore/pcre/pcre_compile.c owb_trunk.r241/JavaScriptCore/pcre/pcre_compile.c
--- owb-trunk.r241-orig/JavaScriptCore/pcre/pcre_compile.c	2007-11-21 18:52:54.000000000 +0100
+++ owb_trunk.r241/JavaScriptCore/pcre/pcre_compile.c	2008-06-04 09:27:20.662943500 +0200
@@ -58,13 +58,14 @@
 
 /* When DEBUG is defined, we need the pcre_printint() function, which is also
 used by pcretest. DEBUG is not defined when building a production library. */
-
+#ifndef __OWBAL_PLATFORM_WIN32PORT__
 #ifdef DEBUG
-#include "pcre_printint.src"
+#else
+	#include "pcre_printint.src"
+	#endif
 #endif
 
 
-
 /*************************************************
 *      Code parameters and static tables         *
 *************************************************/
@@ -5336,8 +5337,9 @@
   if (isprint(ch)) printf("Req char = %c%s\n", ch, caseless);
     else printf("Req char = \\x%02x%s\n", ch, caseless);
   }
-
+#ifndef __OWBAL_PLATFORM_WIN32PORT__
 pcre_printint(re, stdout);
+#endif
 
 /* This check is done here in the debugging case so that the code that
 was compiled can be seen. */
diff -rbui owb-trunk.r241-orig/JavaScriptCore/wtf/MathExtras.h owb_trunk.r241/JavaScriptCore/wtf/MathExtras.h
--- owb-trunk.r241-orig/JavaScriptCore/wtf/MathExtras.h	2007-11-21 18:52:54.000000000 +0100
+++ owb_trunk.r241/JavaScriptCore/wtf/MathExtras.h	2008-06-04 09:27:20.670755500 +0200
@@ -114,10 +114,13 @@
 inline double wtf_random()
 {
     unsigned u;
+	#ifndef __OWBAL_PLATFORM_WIN32PORT__
     rand_s(&u);
+	#endif
 
     return static_cast<double>(u) / (static_cast<double>(UINT_MAX) + 1.0);
 }
+
 #endif // _CRT_RAND_S
 
 #else
diff -rbui owb-trunk.r241-orig/JavaScriptCore/wtf/PassRefPtr.h owb_trunk.r241/JavaScriptCore/wtf/PassRefPtr.h
--- owb-trunk.r241-orig/JavaScriptCore/wtf/PassRefPtr.h	2007-05-15 21:10:50.000000000 +0200
+++ owb_trunk.r241/JavaScriptCore/wtf/PassRefPtr.h	2008-06-04 09:48:13.370851000 +0200
@@ -42,7 +42,13 @@
         PassRefPtr(const PassRefPtr& o) : m_ptr(o.releaseRef()) {}
         template <typename U> PassRefPtr(const PassRefPtr<U>& o) : m_ptr(o.releaseRef()) { }
 
-        ~PassRefPtr() { if (T* ptr = m_ptr) ptr->deref(); }
+		~PassRefPtr() { 
+			T* ptr = m_ptr;
+#ifndef __OWBAL_PLATFORM_WIN32PORT__
+			if (ptr)
+				ptr->deref();
+#endif
+		}
         
         template <class U> 
         PassRefPtr(const RefPtr<U>& o) : m_ptr(o.get()) { if (T* ptr = m_ptr) ptr->ref(); }
diff -rbui owb-trunk.r241-orig/WebCore/html/HTMLFormElement.cpp owb_trunk.r241/WebCore/html/HTMLFormElement.cpp
--- owb-trunk.r241-orig/WebCore/html/HTMLFormElement.cpp	2007-11-21 18:52:54.000000000 +0100
+++ owb_trunk.r241/WebCore/html/HTMLFormElement.cpp	2008-06-04 09:27:20.695168000 +0200
@@ -225,7 +225,11 @@
 #if PLATFORM(QT)
     return QFileInfo(path).fileName();
 #elif PLATFORM(WIN_OS)
+	#ifdef __OWBAL_PLATFORM_WIN32PORT__
+		return path.substring(path.reverseFind('/') + 1);
+	#else
     return String(PathFindFileName(path.charactersWithNullTermination()));
+	#endif
 #else
     return path.substring(path.reverseFind('/') + 1);
 #endif
diff -rbui owb-trunk.r241-orig/WebCore/loader/FTPDirectoryDocument.cpp owb_trunk.r241/WebCore/loader/FTPDirectoryDocument.cpp
--- owb-trunk.r241-orig/WebCore/loader/FTPDirectoryDocument.cpp	2007-11-21 18:52:54.000000000 +0100
+++ owb_trunk.r241/WebCore/loader/FTPDirectoryDocument.cpp	2008-06-04 09:27:20.705909500 +0200
@@ -233,7 +233,11 @@
 #if PLATFORM(QT) && defined(Q_WS_WIN32)
 #define localtime_r(x, y) localtime_s(y, x)
 #endif
+#ifdef __OWBAL_PLATFORM_WIN32PORT__
+	localtime_s(&now,&now_t);
+#else
     localtime_r(&now_t, &now);
+#endif
     
     // localtime does "year = current year - 1900", compensate for that for readability and comparison purposes
     now.tm_year += 1900;
diff -rbui owb-trunk.r241-orig/WebCore/loader/FTPDirectoryParser.cpp owb_trunk.r241/WebCore/loader/FTPDirectoryParser.cpp
--- owb-trunk.r241-orig/WebCore/loader/FTPDirectoryParser.cpp	2007-11-21 18:52:54.000000000 +0100
+++ owb_trunk.r241/WebCore/loader/FTPDirectoryParser.cpp	2008-06-04 09:27:20.713721500 +0200
@@ -109,7 +109,7 @@
     }
 
     /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
-#if PLATFORM(QT) && defined(Q_WS_WIN32)
+#if PLATFORM(QT) && defined(Q_WS_WIN32) || __OWBAL_PLATFORM_WIN32PORT__
 #define gmtime_r(x, y) gmtime_s(y, x)
 #endif
 
diff -rbui owb-trunk.r241-orig/WebCore/platform/Arena.cpp owb_trunk.r241/WebCore/platform/Arena.cpp
--- owb-trunk.r241-orig/WebCore/platform/Arena.cpp	2007-11-21 18:52:54.000000000 +0100
+++ owb_trunk.r241/WebCore/platform/Arena.cpp	2008-06-04 09:27:20.722510000 +0200
@@ -223,6 +223,7 @@
     if (!a)
         return;
 
+#ifndef __OWBAL_PLATFORM_WIN32PORT__
 #ifdef DEBUG
     do {
         ASSERT(a->base <= a->avail && a->avail <= a->limit);
@@ -231,7 +232,7 @@
     } while ((a = a->next) != 0);
     a = *ap;
 #endif
-
+#endif
     if (freelist_count >= FREELIST_MAX)
         reallyFree = true;
         
diff -rbui owb-trunk.r241-orig/WebCore/platform/SourcesCMakeLists.txt owb_trunk.r241/WebCore/platform/SourcesCMakeLists.txt
--- owb-trunk.r241-orig/WebCore/platform/SourcesCMakeLists.txt	2007-11-21 18:52:54.000000000 +0100
+++ owb_trunk.r241/WebCore/platform/SourcesCMakeLists.txt	2008-06-04 09:46:44.913622000 +0200
@@ -10,3 +10,10 @@
 	WebCore/platform/SegmentedString.cpp
 	WebCore/platform/TextStream.cpp
 )
+IF (OWBAL_PLATFORM_WIN32)
+set(platform_SRC
+        ${platform_SRC}
+	WebCore/platform/StringImpl.cpp
+	
+)
+ENDIF (OWBAL_PLATFORM_WIN32)
\ No newline at end of file
diff -rbui owb-trunk.r241-orig/WebCore/platform/image-decoders/zlib/mozzconf.h owb_trunk.r241/WebCore/platform/image-decoders/zlib/mozzconf.h
--- owb-trunk.r241-orig/WebCore/platform/image-decoders/zlib/mozzconf.h	2007-05-15 21:10:50.000000000 +0200
+++ owb_trunk.r241/WebCore/platform/image-decoders/zlib/mozzconf.h	2008-06-04 09:27:20.738134000 +0200
@@ -49,8 +49,8 @@
 #define zlibVersion MOZ_Z_zlibVersion
 #define deflate MOZ_Z_deflate
 #define deflateEnd MOZ_Z_deflateEnd
-#define inflate MOZ_Z_inflate
-#define inflateEnd MOZ_Z_inflateEnd
+//#define inflate MOZ_Z_inflate
+//#define inflateEnd MOZ_Z_inflateEnd
 #define deflateSetDictionary MOZ_Z_deflateSetDictionary
 #define deflateCopy MOZ_Z_deflateCopy
 #define deflateReset MOZ_Z_deflateReset
@@ -60,7 +60,7 @@
 #define inflateSetDictionary MOZ_Z_inflateSetDictionary
 #define inflateSync MOZ_Z_inflateSync
 #define inflateCopy MOZ_Z_inflateCopy
-#define inflateReset MOZ_Z_inflateReset
+//#define inflateReset MOZ_Z_inflateReset
 #define inflateBack MOZ_Z_inflateBack
 #define inflateBackEnd MOZ_Z_inflateBackEnd
 #define zlibCompileFlags MOZ_Z_zlibCompileFlags
@@ -88,10 +88,10 @@
 #define gzerror MOZ_Z_gzerror
 #define gzclearerr MOZ_Z_gzclearerr
 #define adler32 MOZ_Z_adler32
-#define crc32 MOZ_Z_crc32
-#define deflateInit_ MOZ_Z_deflateInit_
+//#define crc32 MOZ_Z_crc32
+//#define deflateInit_ MOZ_Z_deflateInit_
 #define deflateInit2_ MOZ_Z_deflateInit2_
-#define inflateInit_ MOZ_Z_inflateInit_
+//#define inflateInit_ MOZ_Z_inflateInit_
 #define inflateInit2_ MOZ_Z_inflateInit2_
 #define inflateBackInit_ MOZ_Z_inflateBackInit_
 #define inflateSyncPoint MOZ_Z_inflateSyncPoint
diff -rbui owb-trunk.r241-orig/WebCore/platform/win/SystemTimeWin.cpp owb_trunk.r241/WebCore/platform/win/SystemTimeWin.cpp
--- owb-trunk.r241-orig/WebCore/platform/win/SystemTimeWin.cpp	2007-05-15 21:10:50.000000000 +0200
+++ owb_trunk.r241/WebCore/platform/win/SystemTimeWin.cpp	2008-06-04 09:27:20.746922500 +0200
@@ -25,7 +25,7 @@
 
 #include "config.h"
 #include "SystemTime.h"
-
+#include "BTLogManager.h"
 #include <windows.h>
 
 namespace WebCore {
@@ -52,5 +52,97 @@
 
     return t.QuadPart * 0.0000001 - 11644473600.0;
 }
+double timeFromString(String dateString)
+{
+    double day, daysTilFirstOfMonth = 0, hours, year, minutes, seconds;
+    String month, cutDate, tmpLeft, tmpRight;
+    double cookieTime = 0;
+    
+    /*
+     * There are several ways to format the date and each web site uses a different one :-/
+     * This fonction tries to analyse the string to obtain the proper format.
+     * When this is done, we extract the values and convert them into a number of seconds since 1/1/1970 0h00m00s
+     */
+    
+    tmpRight = dateString.right(3);
+    if (tmpRight.contains("GMT", false))
+        cutDate = dateString.right(24);
+    else
+        cutDate = dateString.right(20);
+    
+    // we get the numeric values directly
+    
+    tmpLeft = cutDate.left(2);
+    if (tmpLeft.contains(",",false)) {
+        day = cutDate.substring(2,2).toDouble();
+        month = month = cutDate.substring(5,3);
+        year = cutDate.substring(9,2).toDouble();
+        year = year + 2000;
+    }
+    else {
+        day = cutDate.substring(0,2).toDouble();
+        month = cutDate.substring(3,3);
+        year = cutDate.substring(7,4).toDouble();
+    }
+    
+    // GMT time
+    hours = cutDate.substring(12,2).toDouble();
+    if (dateString.endsWith("GMT",false));
+        hours = hours + 2.0; //FIXME : this would only work in france
+        
+    minutes = cutDate.substring(15,4).toDouble();
+    seconds = cutDate.substring(18,4).toDouble();
+    
+    /* 
+     * We need to handle the month
+     * This is the number of days elapsed from the begining of the year to first of the dateString month
+     */
+    if (month == "Jan")
+        daysTilFirstOfMonth = 0;
+    else if (month == "Feb")
+        daysTilFirstOfMonth = 31;
+    else if (month == "Mar")
+        daysTilFirstOfMonth = 59;
+    else if (month == "Apr")
+        daysTilFirstOfMonth = 90;
+    else if (month == "May")
+        daysTilFirstOfMonth = 120;
+    else if (month == "Jun")
+        daysTilFirstOfMonth = 151;
+    else if (month == "Jul")
+        daysTilFirstOfMonth = 181;
+    else if (month == "Aug")
+        daysTilFirstOfMonth = 212;
+    else if (month == "Sep")
+        daysTilFirstOfMonth = 242;
+    else if (month == "Oct")
+        daysTilFirstOfMonth = 273;
+    else if (month == "Nov")
+        daysTilFirstOfMonth = 303;
+    else if (month == "Dec")
+        daysTilFirstOfMonth = 334;
+    
+    // handle the bissextil years
+    if (year/4==int(year/4) && daysTilFirstOfMonth > 31) 
+        daysTilFirstOfMonth++;
+    
+   
+	//DBGML(MODULE_FACILITIES, LEVEL_INFO, "Original : %s\nDATE FROM STRING\nDay = %lf\nMonth = %lf\nYear = %lf\nHours = %lf\nMin = %lf\nSec = %lf\n ",dateString.deprecatedString().ascii(), day, daysTilFirstOfMonth, year, hours, minutes, seconds);
+    
+    // now we can calculate the number of seconds since the January 1970 the 1st at 00:00:00
+    cookieTime = (year - 1970)*(60*60*24*365);
+    cookieTime += daysTilFirstOfMonth * (60*60*24);
+    cookieTime += ((day - 1)+ int((year-1970)/4)) * (60*60*24);
+    cookieTime += hours * (60*60);
+    cookieTime += minutes * 60;
+    cookieTime += seconds;
+    
+    return cookieTime;
+}
+
+float userIdleTime()
+{
+    return 0;
+}
 
 }
diff -rbui owb-trunk.r241-orig/WebKit/OrigynWebBrowser/Api/BCWindowManager.cpp owb_trunk.r241/WebKit/OrigynWebBrowser/Api/BCWindowManager.cpp
--- owb-trunk.r241-orig/WebKit/OrigynWebBrowser/Api/BCWindowManager.cpp	2008-03-25 10:42:08.000000000 +0100
+++ owb_trunk.r241/WebKit/OrigynWebBrowser/Api/BCWindowManager.cpp	2008-06-04 09:27:20.755711000 +0200
@@ -56,7 +56,9 @@
 #include "Page.h"
 #include "Timer.h"
 #include "WindowBal.h"
-
+#ifdef __OWBAL_PLATFORM_WIN32PORT__
+#include "BTLogHelper.h"
+#endif
 
 IMPLEMENT_GET_DELETE(BIWindowManager, BCWindowManager);
 
diff -rbui owb-trunk.r241-orig/WebKit/OrigynWebBrowser/OrigynLauncher/main.cpp owb_trunk.r241/WebKit/OrigynWebBrowser/OrigynLauncher/main.cpp
--- owb-trunk.r241-orig/WebKit/OrigynWebBrowser/OrigynLauncher/main.cpp	2008-03-25 10:42:08.000000000 +0100
+++ owb_trunk.r241/WebKit/OrigynWebBrowser/OrigynLauncher/main.cpp	2008-06-04 09:27:20.762546500 +0200
@@ -67,11 +67,12 @@
 #endif
 
 
+#ifndef NO_USE_DEEPSEE
 /**
  * DeepSee lib init
  */
 DS_INIT_DEEPSEE_FRAMEWORK();
-
+#endif
 
 /**
  * Signal 11 catcher to prevent process from freezing on segfaults.
@@ -130,8 +131,9 @@
 int main(int argc, char *argv[])
 {
     signal(SIGSEGV, &signalCatcher);
+#ifndef NO_USE_DEEPSEE
     DS_SIGNAL_CATCH(SIGSEGV);
-
+#endif
 #ifdef BAL_LOG // logger is not defined in NDEBUG
     // Setup a nice formatter for log
     RefPtr<BALFacilities::BTDeviceChannel> channel = new BALFacilities::BTDeviceChannel();
@@ -227,8 +229,8 @@
     if(::WebCore::cookiesEnabled())
         deleteBICookieJar(getBICookieJar());
 
-
+#ifndef NO_USE_DEEPSEE
     DS_CLEAN_DEEPSEE_FRAMEWORK(); 
-
+#endif
     return 0;
 }
diff -rbui owb-trunk.r241-orig/WebKitTools/Drosera/win/DroseraPrefix.h owb_trunk.r241/WebKitTools/Drosera/win/DroseraPrefix.h
--- owb-trunk.r241-orig/WebKitTools/Drosera/win/DroseraPrefix.h	2007-11-21 18:52:54.000000000 +0100
+++ owb_trunk.r241/WebKitTools/Drosera/win/DroseraPrefix.h	2008-06-04 09:27:20.770358500 +0200
@@ -47,9 +47,9 @@
 #define _WIN32_IE 0x0600    // Change this to the appropriate value to target other versions of IE.
 #endif
 
-#ifndef WIN32_LEAN_AND_MEAN
-#define WIN32_LEAN_AND_MEAN        // Exclude rarely-used stuff from Windows headers
-#endif
+//#ifndef WIN32_LEAN_AND_MEAN
+//#define WIN32_LEAN_AND_MEAN        // Exclude rarely-used stuff from Windows headers
+//#endif
 
 #ifndef WIN32
 #define WIN32 1
Only in owb_trunk.r241/: build
