2 * Copyright (C) 2007 Holger Hans Peter Freyther
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public License
15 * along with this library; see the file COPYING.LIB. If not, write to
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
22 #include "webkitprivate.h"
23 #include "ChromeClientGtk.h"
24 #include "FrameLoader.h"
25 #include "FrameLoaderClientGtk.h"
27 #include "NotImplemented.h"
28 #include "Pasteboard.h"
29 #include "PasteboardHelperGtk.h"
30 #include "Threading.h"
33 #include "DatabaseTracker.h"
36 using namespace WebCore;
39 void apply(WebKitSettings*, WebCore::Settings*)
44 WebKitSettings* create(WebCore::Settings*)
50 WebKitWebView* getViewFromFrame(WebKitWebFrame* frame)
52 return webkit_web_frame_get_web_view(frame);
55 WebCore::Frame* core(WebKitWebFrame* frame)
60 WebKitWebFramePrivate* frame_data = WEBKIT_WEB_FRAME_GET_PRIVATE(frame);
61 return frame_data ? frame_data->frame : 0;
64 WebKitWebFrame* kit(WebCore::Frame* coreFrame)
69 ASSERT(coreFrame->loader());
70 WebKit::FrameLoaderClient* client = static_cast<WebKit::FrameLoaderClient*>(coreFrame->loader()->client());
71 return client ? client->webFrame() : 0;
74 WebCore::Page* core(WebKitWebView* webView)
79 WebKitWebViewPrivate* webViewData = WEBKIT_WEB_VIEW_GET_PRIVATE(webView);
80 return webViewData ? webViewData->corePage : 0;
83 WebKitWebView* kit(WebCore::Page* corePage)
88 ASSERT(corePage->chrome());
89 WebKit::ChromeClient* client = static_cast<WebKit::ChromeClient*>(corePage->chrome()->client());
90 return client ? client->webView() : 0;
97 static bool isInitialized = false;
100 isInitialized = true;
102 WebCore::initializeThreading();
103 WebCore::InitializeLoggingChannelsIfNecessary();
106 // FIXME: It should be possible for client applications to override this default location
107 gchar* databaseDirectory = g_build_filename(g_get_user_data_dir(), "webkit", "databases", NULL);
108 WebCore::DatabaseTracker::tracker().setDatabasePath(databaseDirectory);
109 g_free(databaseDirectory);
112 Pasteboard::generalPasteboard()->setHelper(new WebKit::PasteboardHelperGtk());