2008-01-22 Christian Dywan <christian@imendio.com>
[WebKit-https.git] / WebKit / gtk / WebView / webkitprivate.cpp
index 55a39a8e37f22db38bad76b4e536236b07312acf..dc2b6f7d6764a23ba96afd2e0d9af76dda9d1390 100644 (file)
 #include "ChromeClientGtk.h"
 #include "FrameLoader.h"
 #include "FrameLoaderClientGtk.h"
+#include "Logging.h"
 #include "NotImplemented.h"
+#include "Pasteboard.h"
+#include "PasteboardHelperGtk.h"
+#include "Threading.h"
+
+#if ENABLE(DATABASE)
+#include "DatabaseTracker.h"
+#endif
 
 using namespace WebCore;
 
 namespace WebKit {
-void apply(WebKitSettings*, WebCore::Settings*)
-{
-    notImplemented();
-}
-
-WebKitSettings* create(WebCore::Settings*)
-{
-    notImplemented();
-    return 0;
-}
-
-WebKitWebFrame* getFrameFromView(WebKitWebView* webView)
-{
-    return webkit_web_view_get_main_frame(webView);
-}
 
 WebKitWebView* getViewFromFrame(WebKitWebFrame* frame)
 {
@@ -84,6 +77,27 @@ WebKitWebView* kit(WebCore::Page* corePage)
 
     ASSERT(corePage->chrome());
     WebKit::ChromeClient* client = static_cast<WebKit::ChromeClient*>(corePage->chrome()->client());
-    return client ? client->webPage() : 0;
+    return client ? client->webView() : 0;
+}
+
 }
+
+void webkit_init()
+{
+    static bool isInitialized = false;
+    if (isInitialized)
+        return;
+    isInitialized = true;
+
+    WebCore::initializeThreading();
+    WebCore::InitializeLoggingChannelsIfNecessary();
+
+#if ENABLE(DATABASE)
+    // FIXME: It should be possible for client applications to override this default location
+    gchar* databaseDirectory = g_build_filename(g_get_user_data_dir(), "webkit", "databases", NULL);
+    WebCore::DatabaseTracker::tracker().setDatabaseDirectoryPath(databaseDirectory);
+    g_free(databaseDirectory);
+#endif
+
+    Pasteboard::generalPasteboard()->setHelper(new WebKit::PasteboardHelperGtk());
 }