2008-01-22 Christian Dywan <christian@imendio.com>
[WebKit-https.git] / WebKit / gtk / WebView / webkitprivate.cpp
index 0bc2b18dbf094fe8aaaa61a013a36d8c9f0c913c..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)
 {
@@ -86,4 +79,25 @@ WebKitWebView* kit(WebCore::Page* corePage)
     WebKit::ChromeClient* client = static_cast<WebKit::ChromeClient*>(corePage->chrome()->client());
     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());
 }