Commit 4396abcf authored by alp@webkit.org's avatar alp@webkit.org

2008-02-04 Christian Dywan <christian@imendio.com>

        Reviewed by Alp Toker.

        http://bugs.webkit.org/show_bug.cgi?id=17065
        [GTK] Use a consistent coding style


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@29985 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent c0604051
2008-02-04 Christian Dywan <christian@imendio.com>
Reviewed by Alp Toker.
http://bugs.webkit.org/show_bug.cgi?id=17065
[GTK] Use a consistent coding style
* WebCoreSupport/EditorClientGtk.cpp:
(WebKit::imContextCommitted):
(WebKit::EditorClient::EditorClient):
(WebKit::EditorClient::~EditorClient):
(WebKit::EditorClient::textFieldDidEndEditing):
* webkit/webkitdefines.h:
* webkit/webkitnetworkrequest.cpp:
(_WebKitNetworkRequestPrivate::webkit_network_request_finalize):
(_WebKitNetworkRequestPrivate::webkit_network_request_class_init):
(_WebKitNetworkRequestPrivate::webkit_network_request_init):
(_WebKitNetworkRequestPrivate::webkit_network_request_new):
(_WebKitNetworkRequestPrivate::webkit_network_request_set_uri):
(_WebKitNetworkRequestPrivate::webkit_network_request_get_uri):
* webkit/webkitnetworkrequest.h:
* webkit/webkitprivate.cpp:
(WebKit::getViewFromFrame):
(WebKit::core):
* webkit/webkitprivate.h:
* webkit/webkitwebbackforwardlist.cpp:
(_WebKitWebBackForwardListPrivate::webkit_web_back_forward_list_new_with_web_view):
* webkit/webkitwebbackforwardlist.h:
* webkit/webkitwebframe.cpp:
* webkit/webkitwebframe.h:
* webkit/webkitwebhistoryitem.cpp:
(_WebKitWebHistoryItemPrivate::webkit_web_history_item_dispose):
(_WebKitWebHistoryItemPrivate::webkit_web_history_item_finalize):
(_WebKitWebHistoryItemPrivate::webkit_web_history_item_new_with_core_item):
(_WebKitWebHistoryItemPrivate::webkit_web_history_item_new):
(_WebKitWebHistoryItemPrivate::webkit_web_history_item_new_with_data):
(_WebKitWebHistoryItemPrivate::webkit_web_history_item_get_title):
(_WebKitWebHistoryItemPrivate::webkit_web_history_item_get_alternate_title):
(_WebKitWebHistoryItemPrivate::webkit_web_history_item_set_alternate_title):
(_WebKitWebHistoryItemPrivate::webkit_web_history_item_get_uri):
(_WebKitWebHistoryItemPrivate::webkit_web_history_item_get_original_uri):
(WebKit::core):
* webkit/webkitwebhistoryitem.h:
* webkit/webkitwebsettings.h:
* webkit/webkitwebview.cpp:
* webkit/webkitwebview.h:
2008-02-04 Alp Toker <alp@atoker.com>
Rubber-stamped by Mark Rowe.
......
......@@ -36,8 +36,7 @@ namespace WebKit {
static void imContextCommitted(GtkIMContext* context, const char* str, EditorClient* client)
{
WebKitWebViewPrivate* webViewData = WEBKIT_WEB_VIEW_GET_PRIVATE(client->m_webView);
Frame* frame = webViewData->corePage->focusController()->focusedOrMainFrame();
Frame* frame = core(client->m_webView)->focusController()->focusedOrMainFrame();
frame->editor()->insertTextWithoutSendingTextEvent(str, false);
}
......@@ -353,14 +352,14 @@ void EditorClient::handleInputMethodKeydown(KeyboardEvent*)
EditorClient::EditorClient(WebKitWebView* webView)
: m_webView(webView)
{
WebKitWebViewPrivate* webViewData = WEBKIT_WEB_VIEW_GET_PRIVATE(m_webView);
g_signal_connect(webViewData->imContext, "commit", G_CALLBACK(imContextCommitted), this);
WebKitWebViewPrivate* priv = m_webView->priv;
g_signal_connect(priv->imContext, "commit", G_CALLBACK(imContextCommitted), this);
}
EditorClient::~EditorClient()
{
WebKitWebViewPrivate* webViewData = WEBKIT_WEB_VIEW_GET_PRIVATE(m_webView);
g_signal_handlers_disconnect_by_func(webViewData->imContext, (gpointer)imContextCommitted, this);
WebKitWebViewPrivate* priv = m_webView->priv;
g_signal_handlers_disconnect_by_func(priv->imContext, (gpointer)imContextCommitted, this);
}
void EditorClient::textFieldDidBeginEditing(Element*)
......@@ -370,11 +369,11 @@ void EditorClient::textFieldDidBeginEditing(Element*)
void EditorClient::textFieldDidEndEditing(Element*)
{
WebKitWebViewPrivate* webViewData = WEBKIT_WEB_VIEW_GET_PRIVATE(m_webView);
WebKitWebViewPrivate* priv = m_webView->priv;
gtk_im_context_focus_out(webViewData->imContext);
gtk_im_context_focus_out(priv->imContext);
#ifdef MAEMO_CHANGES
hildon_gtk_im_context_hide(webViewData->imContext);
hildon_gtk_im_context_hide(priv->imContext);
#endif
}
......
......@@ -35,20 +35,29 @@
#endif
#ifndef WEBKIT_API
#define WEBKIT_API
#define WEBKIT_API
#endif
G_BEGIN_DECLS
typedef struct _WebKitNetworkRequest WebKitNetworkRequest;
typedef struct _WebKitNetworkRequestClass WebKitNetworkRequestClass;
typedef struct _WebKitWebBackForwardList WebKitWebBackForwardList;
typedef struct _WebKitWebBackForwardListClass WebKitWebBackForwardListClass;
typedef struct _WebKitWebHistoryItem WebKitWebHistoryItem;
typedef struct _WebKitWebHistoryItemClass WebKitWebHistoryItemClass;
typedef struct _WebKitWebFrame WebKitWebFrame;
typedef struct _WebKitWebFrameClass WebKitWebFrameClass;
typedef struct _WebKitWebSettings WebKitWebSettings;
typedef struct _WebKitWebSettingsClass WebKitWebSettingsClass;
typedef struct _WebKitWebView WebKitWebView;
typedef struct _WebKitWebViewClass WebKitWebViewClass;
typedef struct _WebKitNetworkRequest WebKitNetworkRequest;
typedef struct _WebKitNetworkRequestClass WebKitNetworkRequestClass;
G_END_DECLS
#endif
......@@ -20,33 +20,38 @@
#include "config.h"
#include "webkitnetworkrequest.h"
#include "webkitprivate.h"
using namespace WebKit;
using namespace WebCore;
extern "C" {
G_DEFINE_TYPE(WebKitNetworkRequest, webkit_network_request, G_TYPE_OBJECT);
struct _WebKitNetworkRequestPrivate {
gchar* uri;
};
#define WEBKIT_NETWORK_REQUEST_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), WEBKIT_TYPE_NETWORK_REQUEST, WebKitNetworkRequestPrivate))
static void webkit_network_request_finalize(GObject* object)
{
WebKitNetworkRequestPrivate* requestPrivate = WEBKIT_NETWORK_REQUEST_GET_PRIVATE(object);
WebKitNetworkRequest* request = WEBKIT_NETWORK_REQUEST(object);
WebKitNetworkRequestPrivate* priv = request->priv;
g_free(requestPrivate->uri);
g_free(priv->uri);
G_OBJECT_CLASS(webkit_network_request_parent_class)->finalize(object);
}
static void webkit_network_request_class_init(WebKitNetworkRequestClass* requestClass)
{
g_type_class_add_private(requestClass, sizeof(WebKitNetworkRequestPrivate));
G_OBJECT_CLASS(requestClass)->finalize = webkit_network_request_finalize;
g_type_class_add_private(requestClass, sizeof(WebKitNetworkRequestPrivate));
}
static void webkit_network_request_init(WebKitNetworkRequest* request)
{
WebKitNetworkRequestPrivate* priv = WEBKIT_NETWORK_REQUEST_GET_PRIVATE(request);
request->priv = priv;
}
WebKitNetworkRequest* webkit_network_request_new(const gchar* uri)
......@@ -54,9 +59,9 @@ WebKitNetworkRequest* webkit_network_request_new(const gchar* uri)
g_return_val_if_fail(uri, NULL);
WebKitNetworkRequest* request = WEBKIT_NETWORK_REQUEST(g_object_new(WEBKIT_TYPE_NETWORK_REQUEST, NULL));
WebKitNetworkRequestPrivate* requestPrivate = WEBKIT_NETWORK_REQUEST_GET_PRIVATE(request);
WebKitNetworkRequestPrivate* priv = request->priv;
requestPrivate->uri = g_strdup(uri);
priv->uri = g_strdup(uri);
return request;
}
......@@ -66,19 +71,18 @@ void webkit_network_request_set_uri(WebKitNetworkRequest* request, const gchar*
g_return_if_fail(WEBKIT_IS_NETWORK_REQUEST(request));
g_return_if_fail(uri);
WebKitNetworkRequestPrivate* requestPrivate = WEBKIT_NETWORK_REQUEST_GET_PRIVATE(request);
WebKitNetworkRequestPrivate* priv = request->priv;
g_free(requestPrivate->uri);
requestPrivate->uri = g_strdup(uri);
g_free(priv->uri);
priv->uri = g_strdup(uri);
}
const gchar* webkit_network_request_get_uri(WebKitNetworkRequest* request)
{
g_return_val_if_fail(WEBKIT_IS_NETWORK_REQUEST(request), NULL);
WebKitNetworkRequestPrivate* requestPrivate = WEBKIT_NETWORK_REQUEST_GET_PRIVATE(request);
return requestPrivate->uri;
WebKitNetworkRequestPrivate* priv = request->priv;
return priv->uri;
}
}
......@@ -33,13 +33,16 @@ G_BEGIN_DECLS
#define WEBKIT_IS_NETWORK_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WEBKIT_TYPE_NETWORK_REQUEST))
#define WEBKIT_NETWORK_REQUEST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), WEBKIT_TYPE_NETWORK_REQUEST, WebKitNetworkRequestClass))
typedef struct _WebKitNetworkRequestPrivate WebKitNetworkRequestPrivate;
struct _WebKitNetworkRequest {
GObject parent;
GObject parent_instance;
WebKitNetworkRequestPrivate* priv;
};
struct _WebKitNetworkRequestClass {
GObjectClass parent;
GObjectClass parent_class;
};
WEBKIT_API GType
......
......@@ -39,7 +39,8 @@ namespace WebKit {
WebKitWebView* getViewFromFrame(WebKitWebFrame* frame)
{
return webkit_web_frame_get_web_view(frame);
WebKitWebFramePrivate* priv = frame->priv;
return priv->webView;
}
WebCore::Frame* core(WebKitWebFrame* frame)
......@@ -47,8 +48,8 @@ WebCore::Frame* core(WebKitWebFrame* frame)
if (!frame)
return 0;
WebKitWebFramePrivate* frame_data = WEBKIT_WEB_FRAME_GET_PRIVATE(frame);
return frame_data ? frame_data->frame : 0;
WebKitWebFramePrivate* priv = frame->priv;
return priv ? priv->coreFrame : 0;
}
WebKitWebFrame* kit(WebCore::Frame* coreFrame)
......@@ -66,8 +67,8 @@ WebCore::Page* core(WebKitWebView* webView)
if (!webView)
return 0;
WebKitWebViewPrivate* webViewData = WEBKIT_WEB_VIEW_GET_PRIVATE(webView);
return webViewData ? webViewData->corePage : 0;
WebKitWebViewPrivate* priv = webView->priv;
return priv ? priv->corePage : 0;
}
WebKitWebView* kit(WebCore::Page* corePage)
......
......@@ -22,8 +22,7 @@
#define WEBKIT_PRIVATE_H
/*
* Internal class. This class knows the shared secret of WebKitWebFrame,
* WebKitNetworkRequest and WebKitWebView.
* This file knows the shared secret of WebKitWebView and WebKitWebFrame.
* They are using WebCore which musn't be exposed to the outer world.
*/
......@@ -90,7 +89,7 @@ extern "C" {
#define WEBKIT_WEB_FRAME_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), WEBKIT_TYPE_WEB_FRAME, WebKitWebFramePrivate))
typedef struct _WebKitWebFramePrivate WebKitWebFramePrivate;
struct _WebKitWebFramePrivate {
WebCore::Frame* frame;
WebCore::Frame* coreFrame;
WebCore::FrameLoaderClient* client;
WebKitWebView* webView;
......@@ -105,15 +104,13 @@ extern "C" {
gchar* uri;
};
/* WebKitWebFrame private function */
WebKitWebFrame* webkit_web_frame_init_with_web_view(WebKitWebView*, WebCore::HTMLFrameOwnerElement*);
WebKitWebFrame*
webkit_web_frame_init_with_web_view(WebKitWebView*, WebCore::HTMLFrameOwnerElement*);
/* WebKitWebHistoryItem private function */
WebKitWebHistoryItem* webkit_web_history_item_new_with_core_item(WebCore::HistoryItem*);
WebKitWebHistoryItem*
webkit_web_history_item_new_with_core_item(WebCore::HistoryItem*);
// TODO: Move these to webkitwebframe.h once these functions are fully
// implemented and their API has been discussed.
// FIXME: Move these to webkitwebframe.h once their API has been discussed.
WEBKIT_API GSList*
webkit_web_frame_get_children (WebKitWebFrame* frame);
......
......@@ -63,12 +63,13 @@ WebKitWebBackForwardList* webkit_web_back_forward_list_new_with_web_view(WebKitW
{
g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), NULL);
WebKitWebViewPrivate* webViewData = WEBKIT_WEB_VIEW_GET_PRIVATE(webView);
WebKitWebBackForwardList* webBackForwardList;
webBackForwardList = WEBKIT_WEB_BACK_FORWARD_LIST(g_object_new(WEBKIT_TYPE_WEB_BACK_FORWARD_LIST, NULL));
webBackForwardList->priv->backForwardList = webViewData->corePage->backForwardList();
webBackForwardList->priv->backForwardList->setEnabled(TRUE);
WebKitWebBackForwardListPrivate* priv = webBackForwardList->priv;
priv->backForwardList = core(webView)->backForwardList();
priv->backForwardList->setEnabled(TRUE);
return webBackForwardList;
}
......
......@@ -35,21 +35,16 @@ G_BEGIN_DECLS
#define WEBKIT_IS_WEB_BACK_FORWARD_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WEBKIT_TYPE_WEB_BACK_FORWARD_LIST))
#define WEBKIT_WEB_BACK_FORWARD_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), WEBKIT_TYPE_WEB_BACK_FORWARD_LIST, WebKitWebBackForwardListClass))
typedef struct _WebKitWebBackForwardListPrivate WebKitWebBackForwardListPrivate;
typedef struct _WebKitWebBackForwardList WebKitWebBackForwardList;
typedef struct _WebKitWebBackForwardListClass WebKitWebBackForwardListClass;
struct _WebKitWebBackForwardList {
GObject parent;
GObject parent_instance;
/*< private >*/
WebKitWebBackForwardListPrivate *priv;
WebKitWebBackForwardListPrivate* priv;
};
struct _WebKitWebBackForwardListClass {
GObjectClass parent;
GObjectClass parent_class;
};
WEBKIT_API GType
......
......@@ -2,6 +2,7 @@
* Copyright (C) 2007 Holger Hans Peter Freyther
* Copyright (C) 2007 Alp Toker <alp@atoker.com>
* Copyright (C) 2007 Apple Inc.
* Copyright (C) 2008 Christian Dywan <christian@imendio.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
......@@ -88,12 +89,14 @@ static void webkit_web_frame_get_property(GObject* object, guint prop_id, GValue
static void webkit_web_frame_finalize(GObject* object)
{
WebKitWebFramePrivate* privateData = WEBKIT_WEB_FRAME_GET_PRIVATE(WEBKIT_WEB_FRAME(object));
privateData->frame->loader()->cancelAndClear();
g_free(privateData->name);
g_free(privateData->title);
g_free(privateData->uri);
delete privateData->frame;
WebKitWebFrame* frame = WEBKIT_WEB_FRAME(object);
WebKitWebFramePrivate* priv = frame->priv;
priv->coreFrame->loader()->cancelAndClear();
g_free(priv->name);
g_free(priv->title);
g_free(priv->uri);
delete priv->coreFrame;
G_OBJECT_CLASS(webkit_web_frame_parent_class)->finalize(object);
}
......@@ -102,8 +105,6 @@ static void webkit_web_frame_class_init(WebKitWebFrameClass* frameClass)
{
webkit_init();
g_type_class_add_private(frameClass, sizeof(WebKitWebFramePrivate));
/*
* signals
*/
......@@ -185,11 +186,16 @@ static void webkit_web_frame_class_init(WebKitWebFrameClass* frameClass)
"The current URI of the contents displayed by the frame",
NULL,
WEBKIT_PARAM_READABLE));
g_type_class_add_private(frameClass, sizeof(WebKitWebFramePrivate));
}
static void webkit_web_frame_init(WebKitWebFrame* frame)
{
WebKitWebFramePrivate* priv = WEBKIT_WEB_FRAME_GET_PRIVATE(frame);
// TODO: Move constructor code here.
frame->priv = priv;
}
/**
......@@ -205,22 +211,19 @@ WebKitWebFrame* webkit_web_frame_new(WebKitWebView* webView)
g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), NULL);
WebKitWebFrame* frame = WEBKIT_WEB_FRAME(g_object_new(WEBKIT_TYPE_WEB_FRAME, NULL));
WebKitWebFramePrivate* frameData = WEBKIT_WEB_FRAME_GET_PRIVATE(frame);
WebKitWebViewPrivate* webViewData = WEBKIT_WEB_VIEW_GET_PRIVATE(webView);
WebKitWebFramePrivate* priv = frame->priv;
WebKitWebViewPrivate* viewPriv = WEBKIT_WEB_VIEW_GET_PRIVATE(webView);
frameData->client = new WebKit::FrameLoaderClient(frame);
frameData->frame = new Frame(webViewData->corePage, 0, frameData->client);
priv->client = new WebKit::FrameLoaderClient(frame);
priv->coreFrame = new Frame(viewPriv->corePage, 0, priv->client);
FrameView* frameView = new FrameView(frameData->frame);
FrameView* frameView = new FrameView(priv->coreFrame);
frameView->setContainingWindow(GTK_CONTAINER(webView));
frameView->setGtkAdjustments(GTK_ADJUSTMENT(gtk_adjustment_new(0.0, 0.0, 0.0, 0.0, 0.0, 0.0)),
GTK_ADJUSTMENT(gtk_adjustment_new(0.0, 0.0, 0.0, 0.0, 0.0, 0.0)));
frameData->frame->setView(frameView);
frameData->frame->init();
frameData->webView = webView;
frameData->name = 0;
frameData->title = 0;
frameData->uri = 0;
priv->coreFrame->setView(frameView);
priv->coreFrame->init();
priv->webView = webView;
return frame;
}
......@@ -228,18 +231,18 @@ WebKitWebFrame* webkit_web_frame_new(WebKitWebView* webView)
WebKitWebFrame* webkit_web_frame_init_with_web_view(WebKitWebView* webView, HTMLFrameOwnerElement* element)
{
WebKitWebFrame* frame = WEBKIT_WEB_FRAME(g_object_new(WEBKIT_TYPE_WEB_FRAME, NULL));
WebKitWebFramePrivate* frameData = WEBKIT_WEB_FRAME_GET_PRIVATE(frame);
WebKitWebViewPrivate* webViewData = WEBKIT_WEB_VIEW_GET_PRIVATE(webView);
WebKitWebFramePrivate* priv = frame->priv;
WebKitWebViewPrivate* viewPriv = WEBKIT_WEB_VIEW_GET_PRIVATE(webView);
frameData->client = new WebKit::FrameLoaderClient(frame);
frameData->frame = new Frame(webViewData->corePage, element, frameData->client);
priv->client = new WebKit::FrameLoaderClient(frame);
priv->coreFrame = new Frame(viewPriv->corePage, element, priv->client);
FrameView* frameView = new FrameView(frameData->frame);
FrameView* frameView = new FrameView(priv->coreFrame);
frameView->setContainingWindow(GTK_CONTAINER(webView));
frameData->frame->setView(frameView);
priv->coreFrame->setView(frameView);
frameView->deref();
frameData->frame->init();
frameData->webView = webView;
priv->coreFrame->init();
priv->webView = webView;
return frame;
}
......@@ -256,8 +259,8 @@ const gchar* webkit_web_frame_get_title(WebKitWebFrame* frame)
{
g_return_val_if_fail(WEBKIT_IS_WEB_FRAME(frame), NULL);
WebKitWebFramePrivate* frameData = WEBKIT_WEB_FRAME_GET_PRIVATE(frame);
return frameData->title;
WebKitWebFramePrivate* priv = frame->priv;
return priv->title;
}
/**
......@@ -272,8 +275,8 @@ const gchar* webkit_web_frame_get_uri(WebKitWebFrame* frame)
{
g_return_val_if_fail(WEBKIT_IS_WEB_FRAME(frame), NULL);
WebKitWebFramePrivate* frameData = WEBKIT_WEB_FRAME_GET_PRIVATE(frame);
return frameData->uri;
WebKitWebFramePrivate* priv = frame->priv;
return priv->uri;
}
/**
......@@ -291,8 +294,8 @@ WebKitWebView* webkit_web_frame_get_web_view(WebKitWebFrame* frame)
{
g_return_val_if_fail(WEBKIT_IS_WEB_FRAME(frame), NULL);
WebKitWebFramePrivate* frameData = WEBKIT_WEB_FRAME_GET_PRIVATE(frame);
return frameData->webView;
WebKitWebFramePrivate* priv = frame->priv;
return priv->webView;
}
/**
......@@ -307,18 +310,17 @@ const gchar* webkit_web_frame_get_name(WebKitWebFrame* frame)
{
g_return_val_if_fail(WEBKIT_IS_WEB_FRAME(frame), NULL);
WebKitWebFramePrivate* frameData = WEBKIT_WEB_FRAME_GET_PRIVATE(frame);
WebKitWebFramePrivate* priv = frame->priv;
if (frameData->name)
return frameData->name;
if (priv->name)
return priv->name;
Frame* coreFrame = core(frame);
g_return_val_if_fail(coreFrame, NULL);
String string = coreFrame->tree()->name();
frameData->name = g_strdup(string.utf8().data());
return frameData->name;
priv->name = g_strdup(string.utf8().data());
return priv->name;
}
/**
......@@ -358,7 +360,7 @@ void webkit_web_frame_load_request(WebKitWebFrame* frame, WebKitNetworkRequest*
Frame* coreFrame = core(frame);
g_return_if_fail(coreFrame);
// TODO: Use the ResourceRequest carried by WebKitNetworkRequest when it gets implemented.
// TODO: Use the ResourceRequest carried by WebKitNetworkRequest when it is implemented.
DeprecatedString string = DeprecatedString::fromUtf8(webkit_network_request_get_uri(request));
coreFrame->loader()->load(ResourceRequest(KURL(string)));
}
......
......@@ -25,6 +25,7 @@
#include <JavaScriptCore/JSBase.h>
#include <webkit/webkitdefines.h>
#include <webkit/webkitnetworkrequest.h>
G_BEGIN_DECLS
......@@ -35,13 +36,16 @@ G_BEGIN_DECLS
#define WEBKIT_IS_WEB_FRAME_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WEBKIT_TYPE_WEB_FRAME))
#define WEBKIT_WEB_FRAME_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), WEBKIT_TYPE_WEB_FRAME, WebKitWebFrameClass))
typedef struct _WebKitWebFramePrivate WebKitWebFramePrivate;
struct _WebKitWebFrame {
GObject parent;
GObject parent_instance;
WebKitWebFramePrivate* priv;
};
struct _WebKitWebFrameClass {
GObjectClass parent;
GObjectClass parent_class;
void (*_webkit_reserved1) (void);
void (*_webkit_reserved2) (void);
......
......@@ -77,11 +77,11 @@ static void webkit_history_item_remove(WebCore::HistoryItem* historyItem)
static void webkit_web_history_item_dispose(GObject* object)
{
WebKitWebHistoryItem* item = WEBKIT_WEB_HISTORY_ITEM(object);
WebKitWebHistoryItem* webHistoryItem = WEBKIT_WEB_HISTORY_ITEM(object);
WebKitWebHistoryItemPrivate* priv = webHistoryItem->priv;
webkit_history_item_remove(item->priv->historyItem);
delete item->priv->historyItem;
webkit_history_item_remove(priv->historyItem);
delete priv->historyItem;
/* destroy table if empty */
GHashTable* table = webkit_history_items();
......@@ -91,15 +91,15 @@ static void webkit_web_history_item_dispose(GObject* object)
G_OBJECT_CLASS(webkit_web_history_item_parent_class)->dispose(object);
}
static void webkit_web_history_item_finalize(GObject* object)
{
WebKitWebHistoryItem* historyItem = WEBKIT_WEB_HISTORY_ITEM(object);
WebKitWebHistoryItem* webHistoryItem = WEBKIT_WEB_HISTORY_ITEM(object);
WebKitWebHistoryItemPrivate* priv = webHistoryItem->priv;
g_free(historyItem->priv->title);
g_free(historyItem->priv->alternateTitle);
g_free(historyItem->priv->uri);
g_free(historyItem->priv->originalUri);
g_free(priv->title);
g_free(priv->alternateTitle);
g_free(priv->uri);
g_free(priv->originalUri);
G_OBJECT_CLASS(webkit_web_history_item_parent_class)->finalize(object);
}
......@@ -123,11 +123,12 @@ static void webkit_web_history_item_init(WebKitWebHistoryItem* webHistoryItem)
WebKitWebHistoryItem* webkit_web_history_item_new_with_core_item(WebCore::HistoryItem* item)
{
WebKitWebHistoryItem* webHistoryItem = kit(item);
WebKitWebHistoryItemPrivate* priv = webHistoryItem->priv;
if (!webHistoryItem) {
webHistoryItem = WEBKIT_WEB_HISTORY_ITEM(g_object_new(WEBKIT_TYPE_WEB_HISTORY_ITEM, NULL));
webHistoryItem->priv->historyItem = item;
webkit_history_item_add(webHistoryItem, webHistoryItem->priv->historyItem);
priv->historyItem = item;
webkit_history_item_add(webHistoryItem, priv->historyItem);
}
return webHistoryItem;
......@@ -144,15 +145,14 @@ WebKitWebHistoryItem* webkit_web_history_item_new_with_core_item(WebCore::Histor
WebKitWebHistoryItem* webkit_web_history_item_new(void)
{
WebKitWebHistoryItem* webHistoryItem = WEBKIT_WEB_HISTORY_ITEM(g_object_new(WEBKIT_TYPE_WEB_HISTORY_ITEM, NULL));
WebKitWebHistoryItemPrivate* priv = webHistoryItem->priv;
webHistoryItem->priv->historyItem = new WebCore::HistoryItem();
webkit_history_item_add(webHistoryItem, webHistoryItem->priv->historyItem);
priv->historyItem = new WebCore::HistoryItem();
webkit_history_item_add(webHistoryItem, priv->historyItem);
return webHistoryItem;
}
/**
* webkit_web_history_item_new_with_data:
* @uri: the uri of the page
......@@ -168,10 +168,10 @@ WebKitWebHistoryItem* webkit_web_history_item_new_with_data(const gchar* uri, co
WebCore::String historyTitle(title);
WebKitWebHistoryItem* webHistoryItem = webkit_web_history_item_new();
WebKitWebHistoryItemPrivate* priv = webHistoryItem->priv;
webHistoryItem->priv->historyItem = new WebCore::HistoryItem(historyUri, historyTitle);
webkit_history_item_add(webHistoryItem, webHistoryItem->priv->historyItem);
priv->historyItem = new WebCore::HistoryItem(historyUri, historyTitle);
webkit_history_item_add(webHistoryItem, priv->historyItem);