Commit 1a6c4695 authored by alp@webkit.org's avatar alp@webkit.org

2007-12-14 Juan A. Suarez Romero <jasuarez@igalia.com>

        Reviewed by Alp Toker.

        http://bugs.webkit.org/show_bug.cgi?id=16042
        [GTK] Eliminate webkit_init()

        Move webkit initialization to WebView class init.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@28818 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 3db2d3ba
2007-12-14 Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed by Alp Toker.
http://bugs.webkit.org/show_bug.cgi?id=16042
[GTK] Eliminate webkit_init()
Move webkit initialization to WebView class init.
* WebCore.pro:
2007-12-17 Jon Honeycutt <jhoneycutt@apple.com>
Reviewed by Darin.
......
......@@ -953,7 +953,6 @@ gtk-port {
../WebCore/platform/gtk/ClipboardGtk.h \
../WebKit/gtk/WebView/webkit.h \
../WebKit/gtk/WebView/webkitdefines.h \
../WebKit/gtk/WebView/webkitglobal.h \
../WebKit/gtk/WebView/webkitnetworkrequest.h \
../WebKit/gtk/WebView/webkitprivate.h \
../WebKit/gtk/WebView/webkitsettings.h \
......@@ -1029,7 +1028,6 @@ gtk-port {
platform/image-decoders/bmp/BMPImageDecoder.cpp \
platform/image-decoders/ico/ICOImageDecoder.cpp \
platform/image-decoders/xbm/XBMImageDecoder.cpp \
../WebKit/gtk/WebView/webkitglobal.cpp \
../WebKit/gtk/WebView/webkitnetworkrequest.cpp \
../WebKit/gtk/WebView/webkitprivate.cpp \
../WebKit/gtk/WebView/webkitsettings.cpp \
......
2007-12-14 Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed by Alp Toker.
http://bugs.webkit.org/show_bug.cgi?id=16042
[GTK] Eliminate webkit_init()
Move webkit initialization to WebView class init.
* WebView/headers.pri:
* WebView/webkit.h:
* WebView/webkitglobal.cpp: Removed.
* WebView/webkitglobal.h: Removed.
* WebView/webkitprivate.cpp:
(WebKit::webkit_init):
* WebView/webkitprivate.h:
* WebView/webkitwebframe.cpp:
* WebView/webkitwebview.cpp:
2007-12-17 Luca Bruno <lethalman88@gmail.com>
Reviewed by Alp Toker.
......
WEBKIT_API_HEADERS = $$PWD/webkit.h \
$$PWD/webkitdefines.h \
$$PWD/webkitglobal.h \
$$PWD/webkitnetworkrequest.h \
$$PWD/webkitwebframe.h \
$$PWD/webkitwebview.h
......@@ -21,7 +21,6 @@
#define __WEBKIT_H__
#include <webkitdefines.h>
#include <webkitglobal.h>
#include <webkitnetworkrequest.h>
#include <webkitwebframe.h>
#include <webkitwebview.h>
......
/*
* Copyright (C) 2007 Holger Hans Peter Freyther
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#include "config.h"
#include "webkitglobal.h"
#include "Logging.h"
#include "DatabaseTracker.h"
#include <glib.h>
extern "C" {
void webkit_init(void)
{
WebCore::InitializeLoggingChannelsIfNecessary();
WebCore::initializeThreading();
#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().setDatabasePath(databaseDirectory);
g_free(databaseDirectory);
#endif
}
}
/*
* Copyright (C) 2007 Holger Hans Peter Freyther
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef WEBKIT_GLOBAL_H
#define WEBKIT_GLOBAL_H
#include "webkitdefines.h"
G_BEGIN_DECLS
WEBKIT_API void
webkit_init (void);
G_END_DECLS
#endif
......@@ -21,8 +21,10 @@
#include "webkitprivate.h"
#include "ChromeClientGtk.h"
#include "DatabaseTracker.h"
#include "FrameLoader.h"
#include "FrameLoaderClientGtk.h"
#include "Logging.h"
#include "NotImplemented.h"
using namespace WebCore;
......@@ -81,4 +83,23 @@ 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().setDatabasePath(databaseDirectory);
g_free(databaseDirectory);
#endif
}
......@@ -49,6 +49,8 @@ namespace WebKit {
}
extern "C" {
void webkit_init();
#define WEBKIT_WEB_VIEW_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), WEBKIT_TYPE_WEB_VIEW, WebKitWebViewPrivate))
typedef struct _WebKitWebViewPrivate WebKitWebViewPrivate;
struct _WebKitWebViewPrivate {
......@@ -84,7 +86,6 @@ extern "C" {
WebKitWebFrame* webkit_web_frame_init_with_web_view(WebKitWebView*, WebCore::HTMLFrameOwnerElement*);
// TODO: Move these to webkitwebframe.h once these functions are fully
// implemented and their API has been discussed.
......
......@@ -72,6 +72,8 @@ static void webkit_web_frame_finalize(GObject* object)
static void webkit_web_frame_class_init(WebKitWebFrameClass* frameClass)
{
webkit_init();
g_type_class_add_private(frameClass, sizeof(WebKitWebFramePrivate));
/*
......
......@@ -434,6 +434,8 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass)
{
GtkBindingSet* binding_set;
webkit_init();
g_type_class_add_private(webViewClass, sizeof(WebKitWebViewPrivate));
/*
......
2007-12-14 Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed by Alp Toker.
http://bugs.webkit.org/show_bug.cgi?id=16042
[GTK] Eliminate webkit_init()
Moving webkit initialization to WebView class init.
* DumpRenderTree/gtk/DumpRenderTree.cpp:
(main):
* GtkLauncher/main.c:
(main):
2007-12-17 Luca Bruno <lethalman88@gmail.com>
Reviewed by Alp Toker.
......
......@@ -313,7 +313,6 @@ int main(int argc, char* argv[])
}
gtk_init(&argc, &argv);
webkit_init();
GtkWidget* window = gtk_window_new(GTK_WINDOW_POPUP);
GtkContainer* container = GTK_CONTAINER(gtk_fixed_new());
......
......@@ -183,7 +183,6 @@ int
main (int argc, char* argv[])
{
gtk_init (&argc, &argv);
webkit_init ();
GtkWidget* vbox = gtk_vbox_new (FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), create_toolbar (), FALSE, FALSE, 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment