Commit 3c2c1dec authored by alp's avatar alp

2007-10-03 Alp Toker <alp@atoker.com>

        Reviewed by Adam.

        http://bugs.webkit.org/show_bug.cgi?id=14726
        [gtk] API design. Mapping the WebView delegates to signals.

        Change the API namespace of the Gtk+ port from 'WebKitGtk' to 'WebKit'.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@26022 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 94739445
2007-10-03 Alp Toker <alp@atoker.com>
Reviewed by Adam.
http://bugs.webkit.org/show_bug.cgi?id=14726
[gtk] API design. Mapping the WebView delegates to signals.
Change the API namespace of the Gtk+ port from 'WebKitGtk' to 'WebKit'.
* WebCore.pro:
2007-10-03 Alp Toker <alp@atoker.com>
Reviewed by Eric.
......@@ -1544,7 +1544,7 @@ gtk-port {
}
GENMARSHALS = ../WebKit/gtk/Api/webkitgtk-marshal.list
GENMARSHALS_PREFIX = webkit_gtk_marshal
GENMARSHALS_PREFIX = webkit_marshal
#
# integrate glib-genmarshal as additional compiler
......
......@@ -26,32 +26,32 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef WEBKIT_GTK_DEFINES_H
#define WEBKIT_GTK_DEFINES_H
#ifndef WEBKIT_DEFINES_H
#define WEBKIT_DEFINES_H
#include <glib.h>
typedef struct _WebKitGtkFrame WebKitGtkFrame;
typedef struct _WebKitGtkFrameClass WebKitGtkFrameClass;
typedef struct _WebKitFrame WebKitFrame;
typedef struct _WebKitFrameClass WebKitFrameClass;
typedef struct _WebKitGtkFrameData WebKitGtkFrameData;
typedef struct _WebKitGtkNetworkRequest WebKitGtkNetworkRequest;
typedef struct _WebKitFrameData WebKitFrameData;
typedef struct _WebKitNetworkRequest WebKitNetworkRequest;
typedef struct _WebKitGtkPage WebKitGtkPage;
typedef struct _WebKitGtkPageClass WebKitGtkPageClass;
typedef struct _WebKitPage WebKitPage;
typedef struct _WebKitPageClass WebKitPageClass;
#ifdef G_OS_WIN32
#ifdef BUILDING_WEBKIT
#define WEBKIT_GTK_API __declspec(dllexport)
#define WEBKIT_API __declspec(dllexport)
#else
#define WEBKIT_GTK_API __declspec(dllimport)
#define WEBKIT_API __declspec(dllimport)
#endif
#else
#define WEBKIT_GTK_API __attribute__((visibility("default")))
#define WEBKIT_API __attribute__((visibility("default")))
#endif
#ifndef WEBKIT_GTK_API
#define WEBKIT_GTK_API
#ifndef WEBKIT_API
#define WEBKIT_API
#endif
#endif
......@@ -40,7 +40,7 @@ using namespace WebCore;
extern "C" {
extern void webkit_gtk_marshal_VOID__STRING_STRING (GClosure* closure,
extern void webkit_marshal_VOID__STRING_STRING (GClosure* closure,
GValue* return_value,
guint n_param_values,
const GValue* param_values,
......@@ -55,31 +55,31 @@ enum {
LAST_SIGNAL
};
static guint webkit_gtk_frame_signals[LAST_SIGNAL] = { 0, };
static guint webkit_frame_signals[LAST_SIGNAL] = { 0, };
static void webkit_gtk_frame_real_title_changed(WebKitGtkFrame* frame, gchar* title, gchar* location);
static void webkit_frame_real_title_changed(WebKitFrame* frame, gchar* title, gchar* location);
G_DEFINE_TYPE(WebKitGtkFrame, webkit_gtk_frame, G_TYPE_OBJECT)
G_DEFINE_TYPE(WebKitFrame, webkit_frame, G_TYPE_OBJECT)
static void webkit_gtk_frame_finalize(GObject* object)
static void webkit_frame_finalize(GObject* object)
{
WebKitGtkFramePrivate* privateData = WEBKIT_GTK_FRAME_GET_PRIVATE(WEBKIT_GTK_FRAME(object));
WebKitFramePrivate* privateData = WEBKIT_FRAME_GET_PRIVATE(WEBKIT_FRAME(object));
privateData->frame->loader()->cancelAndClear();
g_free(privateData->title);
g_free(privateData->location);
delete privateData->frame;
G_OBJECT_CLASS(webkit_gtk_frame_parent_class)->finalize(object);
G_OBJECT_CLASS(webkit_frame_parent_class)->finalize(object);
}
static void webkit_gtk_frame_class_init(WebKitGtkFrameClass* frameClass)
static void webkit_frame_class_init(WebKitFrameClass* frameClass)
{
g_type_class_add_private(frameClass, sizeof(WebKitGtkFramePrivate));
g_type_class_add_private(frameClass, sizeof(WebKitFramePrivate));
/*
* signals
*/
webkit_gtk_frame_signals[CLEARED] = g_signal_new("cleared",
webkit_frame_signals[CLEARED] = g_signal_new("cleared",
G_TYPE_FROM_CLASS(frameClass),
(GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION),
0,
......@@ -88,7 +88,7 @@ static void webkit_gtk_frame_class_init(WebKitGtkFrameClass* frameClass)
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
webkit_gtk_frame_signals[LOAD_DONE] = g_signal_new("load_done",
webkit_frame_signals[LOAD_DONE] = g_signal_new("load_done",
G_TYPE_FROM_CLASS(frameClass),
(GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION),
0,
......@@ -98,52 +98,52 @@ static void webkit_gtk_frame_class_init(WebKitGtkFrameClass* frameClass)
G_TYPE_NONE, 1,
G_TYPE_BOOLEAN);
webkit_gtk_frame_signals[TITLE_CHANGED] = g_signal_new("title_changed",
webkit_frame_signals[TITLE_CHANGED] = g_signal_new("title_changed",
G_TYPE_FROM_CLASS(frameClass),
(GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION),
G_STRUCT_OFFSET(WebKitGtkFrameClass, title_changed),
G_STRUCT_OFFSET(WebKitFrameClass, title_changed),
NULL,
NULL,
webkit_gtk_marshal_VOID__STRING_STRING,
webkit_marshal_VOID__STRING_STRING,
G_TYPE_NONE, 2,
G_TYPE_STRING, G_TYPE_STRING);
webkit_gtk_frame_signals[HOVERING_OVER_LINK] = g_signal_new("hovering_over_link",
webkit_frame_signals[HOVERING_OVER_LINK] = g_signal_new("hovering_over_link",
G_TYPE_FROM_CLASS(frameClass),
(GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION),
0,
NULL,
NULL,
webkit_gtk_marshal_VOID__STRING_STRING,
webkit_marshal_VOID__STRING_STRING,
G_TYPE_NONE, 2,
G_TYPE_STRING, G_TYPE_STRING);
frameClass->title_changed = webkit_gtk_frame_real_title_changed;
frameClass->title_changed = webkit_frame_real_title_changed;
/*
* implementations of virtual methods
*/
G_OBJECT_CLASS(frameClass)->finalize = webkit_gtk_frame_finalize;
G_OBJECT_CLASS(frameClass)->finalize = webkit_frame_finalize;
}
static void webkit_gtk_frame_real_title_changed(WebKitGtkFrame* frame, gchar* title, gchar* location)
static void webkit_frame_real_title_changed(WebKitFrame* frame, gchar* title, gchar* location)
{
WebKitGtkFramePrivate* frameData = WEBKIT_GTK_FRAME_GET_PRIVATE(frame);
WebKitFramePrivate* frameData = WEBKIT_FRAME_GET_PRIVATE(frame);
g_free(frameData->title);
g_free(frameData->location);
frameData->title = g_strdup(title);
frameData->location = g_strdup(location);
}
static void webkit_gtk_frame_init(WebKitGtkFrame* frame)
static void webkit_frame_init(WebKitFrame* frame)
{
}
GObject* webkit_gtk_frame_new(WebKitGtkPage* page)
GObject* webkit_frame_new(WebKitPage* page)
{
WebKitGtkFrame* frame = WEBKIT_GTK_FRAME(g_object_new(WEBKIT_GTK_TYPE_FRAME, NULL));
WebKitGtkFramePrivate* frameData = WEBKIT_GTK_FRAME_GET_PRIVATE(frame);
WebKitGtkPagePrivate* pageData = WEBKIT_GTK_PAGE_GET_PRIVATE(page);
WebKitFrame* frame = WEBKIT_FRAME(g_object_new(WEBKIT_TYPE_FRAME, NULL));
WebKitFramePrivate* frameData = WEBKIT_FRAME_GET_PRIVATE(frame);
WebKitPagePrivate* pageData = WEBKIT_PAGE_GET_PRIVATE(page);
frameData->client = new WebKit::FrameLoaderClient(frame);
frameData->frame = new Frame(pageData->page, 0, frameData->client);
......@@ -161,11 +161,11 @@ GObject* webkit_gtk_frame_new(WebKitGtkPage* page)
return G_OBJECT(frame);
}
GObject* webkit_gtk_frame_init_with_page(WebKitGtkPage* page, HTMLFrameOwnerElement* element)
GObject* webkit_frame_init_with_page(WebKitPage* page, HTMLFrameOwnerElement* element)
{
WebKitGtkFrame* frame = WEBKIT_GTK_FRAME(g_object_new(WEBKIT_GTK_TYPE_FRAME, NULL));
WebKitGtkFramePrivate* frameData = WEBKIT_GTK_FRAME_GET_PRIVATE(frame);
WebKitGtkPagePrivate* pageData = WEBKIT_GTK_PAGE_GET_PRIVATE(page);
WebKitFrame* frame = WEBKIT_FRAME(g_object_new(WEBKIT_TYPE_FRAME, NULL));
WebKitFramePrivate* frameData = WEBKIT_FRAME_GET_PRIVATE(frame);
WebKitPagePrivate* pageData = WEBKIT_PAGE_GET_PRIVATE(page);
frameData->client = new WebKit::FrameLoaderClient(frame);
frameData->frame = new Frame(pageData->page, element, frameData->client);
......@@ -180,22 +180,22 @@ GObject* webkit_gtk_frame_init_with_page(WebKitGtkPage* page, HTMLFrameOwnerElem
return G_OBJECT(frame);
}
WebKitGtkPage*
webkit_gtk_frame_get_page(WebKitGtkFrame* frame)
WebKitPage*
webkit_frame_get_page(WebKitFrame* frame)
{
WebKitGtkFramePrivate* frameData = WEBKIT_GTK_FRAME_GET_PRIVATE(frame);
WebKitFramePrivate* frameData = WEBKIT_FRAME_GET_PRIVATE(frame);
return frameData->page;
}
gchar* webkit_gtk_frame_get_title(WebKitGtkFrame* frame)
gchar* webkit_frame_get_title(WebKitFrame* frame)
{
WebKitGtkFramePrivate* frameData = WEBKIT_GTK_FRAME_GET_PRIVATE(frame);
WebKitFramePrivate* frameData = WEBKIT_FRAME_GET_PRIVATE(frame);
return frameData->title;
}
gchar* webkit_gtk_frame_get_location(WebKitGtkFrame* frame)
gchar* webkit_frame_get_location(WebKitFrame* frame)
{
WebKitGtkFramePrivate* frameData = WEBKIT_GTK_FRAME_GET_PRIVATE(frame);
WebKitFramePrivate* frameData = WEBKIT_FRAME_GET_PRIVATE(frame);
return frameData->location;
}
......
......@@ -26,8 +26,8 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef WEBKIT_GTK_FRAME_H
#define WEBKIT_GTK_FRAME_H
#ifndef WEBKIT_FRAME_H
#define WEBKIT_FRAME_H
#include <glib-object.h>
#include <gdk/gdk.h>
......@@ -36,68 +36,68 @@
G_BEGIN_DECLS
#define WEBKIT_GTK_TYPE_FRAME (webkit_gtk_frame_get_type())
#define WEBKIT_GTK_FRAME(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_GTK_TYPE_FRAME, WebKitGtkFrame))
#define WEBKIT_GTK_FRAME_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WEBKIT_GTK_TYPE_FRAME, WebKitGtkFrameClass))
#define WEBKIT_GTK_IS_FRAME(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_GTK_TYPE_FRAME))
#define WEBKIT_GTK_IS_FRAME_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WEBKIT_GTK_TYPE_FRAME))
#define WEBKIT_GTK_FRAME_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), WEBKIT_GTK_TYPE_FRAME, WebKitGtkFrameClass))
#define WEBKIT_TYPE_FRAME (webkit_frame_get_type())
#define WEBKIT_FRAME(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_TYPE_FRAME, WebKitFrame))
#define WEBKIT_FRAME_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WEBKIT_TYPE_FRAME, WebKitFrameClass))
#define WEBKIT_IS_FRAME(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_TYPE_FRAME))
#define WEBKIT_IS_FRAME_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WEBKIT_TYPE_FRAME))
#define WEBKIT_FRAME_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), WEBKIT_TYPE_FRAME, WebKitFrameClass))
struct _WebKitGtkFrame {
struct _WebKitFrame {
GObject parent;
};
struct _WebKitGtkFrameClass {
struct _WebKitFrameClass {
GObjectClass parent;
void (*title_changed) (WebKitGtkFrame* frame, gchar* title, gchar* location);
void (*title_changed) (WebKitFrame* frame, gchar* title, gchar* location);
/*
* protected virtual methods
*/
void (*mouse_move_event) (WebKitGtkFrame* frame, GdkEvent* move_event);
void (*mouse_press_event) (WebKitGtkFrame* frame, GdkEvent* press_event);
void (*mouse_release_event) (WebKitGtkFrame* frame, GdkEvent* mouse_release_event);
void (*mouse_double_click_event) (WebKitGtkFrame* frame, GdkEvent* double_click_event);
void (*mouse_wheel_event) (WebKitGtkFrame* frame, GdkEvent* wheel_event);
void (*mouse_move_event) (WebKitFrame* frame, GdkEvent* move_event);
void (*mouse_press_event) (WebKitFrame* frame, GdkEvent* press_event);
void (*mouse_release_event) (WebKitFrame* frame, GdkEvent* mouse_release_event);
void (*mouse_double_click_event) (WebKitFrame* frame, GdkEvent* double_click_event);
void (*mouse_wheel_event) (WebKitFrame* frame, GdkEvent* wheel_event);
};
WEBKIT_GTK_API GType
webkit_gtk_frame_get_type (void);
WEBKIT_API GType
webkit_frame_get_type (void);
WEBKIT_GTK_API GObject*
webkit_gtk_frame_new (WebKitGtkPage *page);
WEBKIT_API GObject*
webkit_frame_new (WebKitPage *page);
WEBKIT_GTK_API WebKitGtkPage*
webkit_gtk_frame_get_page (WebKitGtkFrame* frame);
WEBKIT_API WebKitPage*
webkit_frame_get_page (WebKitFrame* frame);
WEBKIT_GTK_API gchar*
webkit_gtk_frame_get_markup (WebKitGtkFrame* frame);
WEBKIT_API gchar*
webkit_frame_get_markup (WebKitFrame* frame);
WEBKIT_GTK_API gchar*
webkit_gtk_frame_get_inner_text (WebKitGtkFrame* frame);
WEBKIT_API gchar*
webkit_frame_get_inner_text (WebKitFrame* frame);
WEBKIT_GTK_API gchar*
webkit_gtk_frame_get_selected_text (WebKitGtkFrame* frame);
WEBKIT_API gchar*
webkit_frame_get_selected_text (WebKitFrame* frame);
WEBKIT_GTK_API gchar*
webkit_gtk_frame_get_title (WebKitGtkFrame* frame);
WEBKIT_API gchar*
webkit_frame_get_title (WebKitFrame* frame);
WEBKIT_GTK_API gchar*
webkit_gtk_frame_get_location (WebKitGtkFrame* frame);
WEBKIT_API gchar*
webkit_frame_get_location (WebKitFrame* frame);
WEBKIT_GTK_API GSList*
webkit_gtk_frame_get_child_frames (WebKitGtkFrame* frame);
WEBKIT_API GSList*
webkit_frame_get_child_frames (WebKitFrame* frame);
WEBKIT_GTK_API GdkPoint*
webkit_gtk_frame_get_position (WebKitGtkFrame* frame);
WEBKIT_API GdkPoint*
webkit_frame_get_position (WebKitFrame* frame);
WEBKIT_GTK_API GdkRectangle*
webkit_gtk_frame_get_rectangle (WebKitGtkFrame* frame);
WEBKIT_API GdkRectangle*
webkit_frame_get_rectangle (WebKitFrame* frame);
WEBKIT_GTK_API WebKitGtkPage*
webkit_gtk_frame_get_page (WebKitGtkFrame* frame);
WEBKIT_API WebKitPage*
webkit_frame_get_page (WebKitFrame* frame);
G_END_DECLS
......
......@@ -32,7 +32,7 @@
#include "Logging.h"
extern "C" {
void webkit_gtk_init(void)
void webkit_init(void)
{
WebCore::InitializeLoggingChannelsIfNecessary();
}
......
......@@ -26,15 +26,15 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef WEBKIT_GTK_GLOBAL_H
#define WEBKIT_GTK_GLOBAL_H
#ifndef WEBKIT_GLOBAL_H
#define WEBKIT_GLOBAL_H
#include "webkitgtkdefines.h"
G_BEGIN_DECLS
WEBKIT_GTK_API void
webkit_gtk_init (void);
WEBKIT_API void
webkit_init (void);
G_END_DECLS
......
......@@ -26,8 +26,8 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef WEBKIT_GTK_NETWORK_REQUEST_H
#define WEBKIT_GTK_NETWORK_REQUEST_H
#ifndef WEBKIT_NETWORK_REQUEST_H
#define WEBKIT_NETWORK_REQUEST_H
#include <glib-object.h>
......@@ -35,30 +35,30 @@
G_BEGIN_DECLS
#define WEBKIT_GTK_TYPE_NETWORK_REQUEST (webkit_gtk_network_request_get_type())
#define WEBKIT_GTK_NETWORK_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_GTK_TYPE_NETWORK_REQUEST, WebKitGtkNetworkRequest))
#define WEBKIT_GTK_NETWORK_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WEBKIT_GTK_TYPE_NETWORK_REQUEST, WebKitGtkNetworkRequestClass))
#define WEBKIT_GTK_IS_NETWORK_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_GTK_TYPE_NETWORK_REQUEST))
#define WEBKIT_GTK_IS_NETWORK_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WEBKIT_GTK_TYPE_NETWORK_REQUEST))
#define WEBKIT_GTK_NETWORK_REQUEST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), WEBKIT_GTK_TYPE_NETWORK_REQUEST, WebKitGtkNetworkRequestClass))
#define WEBKIT_TYPE_NETWORK_REQUEST (webkit_network_request_get_type())
#define WEBKIT_NETWORK_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_TYPE_NETWORK_REQUEST, WebKitNetworkRequest))
#define WEBKIT_NETWORK_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WEBKIT_TYPE_NETWORK_REQUEST, WebKitNetworkRequestClass))
#define WEBKIT_IS_NETWORK_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_TYPE_NETWORK_REQUEST))
#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 _WebKitGtkNetworkRequest WebKitGtkNetworkRequest;
typedef struct _WebKitGtkNetworkRequestClass WebKitGtkNetworkRequestClass;
typedef struct _WebKitNetworkRequest WebKitNetworkRequest;
typedef struct _WebKitNetworkRequestClass WebKitNetworkRequestClass;
struct _WebKitGtkNetworkRequest {
struct _WebKitNetworkRequest {
GObject parent;
};
struct _WebKitGtkNetworkRequestClass {
struct _WebKitNetworkRequestClass {
GObject parent;
};
WEBKIT_GTK_API GType
webkit_gtk_network_request_get_type (void);
WEBKIT_API GType
webkit_network_request_get_type (void);
WEBKIT_GTK_API GObject*
webkit_gtk_network_request_new (void);
WEBKIT_API GObject*
webkit_network_request_new (void);
G_END_DECLS
......
This diff is collapsed.
......@@ -26,8 +26,8 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef WEBKIT_GTK_PAGE_H
#define WEBKIT_GTK_PAGE_H
#ifndef WEBKIT_PAGE_H
#define WEBKIT_PAGE_H
#include <gtk/gtk.h>
......@@ -36,27 +36,27 @@
G_BEGIN_DECLS
#define WEBKIT_GTK_TYPE_PAGE (webkit_gtk_page_get_type())
#define WEBKIT_GTK_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_GTK_TYPE_PAGE, WebKitGtkPage))
#define WEBKIT_GTK_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WEBKIT_GTK_TYPE_PAGE, WebKitGtkPageClass))
#define WEBKIT_GTK_IS_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_GTK_TYPE_PAGE))
#define WEBKIT_GTK_IS_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WEBKIT_GTK_TYPE_PAGE))
#define WEBKIT_GTK_PAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), WEBKIT_GTK_TYPE_PAGE, WebKitGtkPageClass))
#define WEBKIT_TYPE_PAGE (webkit_page_get_type())
#define WEBKIT_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_TYPE_PAGE, WebKitPage))
#define WEBKIT_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WEBKIT_TYPE_PAGE, WebKitPageClass))
#define WEBKIT_IS_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_TYPE_PAGE))
#define WEBKIT_IS_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WEBKIT_TYPE_PAGE))
#define WEBKIT_PAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), WEBKIT_TYPE_PAGE, WebKitPageClass))
typedef enum {
WEBKIT_GTK_ACCEPT_NAVIGATION_REQUEST,
WEBKIT_GTK_IGNORE_NAVIGATION_REQUEST,
WEBKIT_GTK_DOWNLOAD_NAVIGATION_REQUEST
} WEBKIT_GTK_NAVIGATION_REQUEST_RESPONSE;
WEBKIT_ACCEPT_NAVIGATION_REQUEST,
WEBKIT_IGNORE_NAVIGATION_REQUEST,
WEBKIT_DOWNLOAD_NAVIGATION_REQUEST
} WEBKIT_NAVIGATION_REQUEST_RESPONSE;
struct _WebKitGtkPage {
struct _WebKitPage {
GtkContainer parent;
};
struct _WebKitGtkPageClass {
struct _WebKitPageClass {
GtkContainerClass parent;
/*
......@@ -65,90 +65,90 @@ struct _WebKitGtkPageClass {
* require someone doing a g_signal_stop_emission_by_name
* WebUIDelegate has nothing for create_frame, WebPolicyDelegate as well...
*/
WebKitGtkPage* (*create_page) (WebKitGtkPage* page);
WebKitPage* (*create_page) (WebKitPage* page);
/*
* TODO: FIXME: Create something like WebPolicyDecisionListener_Protocol instead
*/
WEBKIT_GTK_NAVIGATION_REQUEST_RESPONSE (*navigation_requested) (WebKitGtkPage* page, WebKitGtkFrame* frame, WebKitGtkNetworkRequest* request);
WEBKIT_NAVIGATION_REQUEST_RESPONSE (*navigation_requested) (WebKitPage* page, WebKitFrame* frame, WebKitNetworkRequest* request);
/*
* TODO: DISCUSS: Should these be signals as well?
*/
gchar* (*choose_file) (WebKitGtkPage* page, WebKitGtkFrame* frame, const gchar* old_file);
void (*java_script_alert) (WebKitGtkPage* page, WebKitGtkFrame* frame, const gchar* alert_message);
gboolean (*java_script_confirm) (WebKitGtkPage* page, WebKitGtkFrame* frame, const gchar* confirm_message);
gchar* (*java_script_prompt) (WebKitGtkPage* page, WebKitGtkFrame* frame, const gchar* message, const gchar* default_value);
void (*java_script_console_message) (WebKitGtkPage*, const gchar* message, unsigned int line_number, const gchar* source_id);
gchar* (*choose_file) (WebKitPage* page, WebKitFrame* frame, const gchar* old_file);
void (*java_script_alert) (WebKitPage* page, WebKitFrame* frame, const gchar* alert_message);
gboolean (*java_script_confirm) (WebKitPage* page, WebKitFrame* frame, const gchar* confirm_message);
gchar* (*java_script_prompt) (WebKitPage* page, WebKitFrame* frame, const gchar* message, const gchar* default_value);
void (*java_script_console_message) (WebKitPage*, const gchar* message, unsigned int line_number, const gchar* source_id);
/*
* internal
*/
void (*set_scroll_adjustments) (WebKitGtkPage*, GtkAdjustment*, GtkAdjustment*);
void (*set_scroll_adjustments) (WebKitPage*, GtkAdjustment*, GtkAdjustment*);
};
WEBKIT_GTK_API GType
webkit_gtk_page_get_type (void);
WEBKIT_API GType
webkit_page_get_type (void);
WEBKIT_GTK_API GtkWidget*
webkit_gtk_page_new (void);
WEBKIT_API GtkWidget*
webkit_page_new (void);
WEBKIT_GTK_API void
webkit_gtk_page_set_settings (WebKitGtkPage* page, WebKitGtkSettings* settings);
WEBKIT_API void
webkit_page_set_settings (WebKitPage* page, WebKitSettings* settings);
WEBKIT_GTK_API WebKitGtkSettings*
webkit_gtk_page_get_settings (WebKitGtkPage* page);
WEBKIT_API WebKitSettings*
webkit_page_get_settings (WebKitPage* page);
WEBKIT_GTK_API gboolean
webkit_gtk_page_can_cut (WebKitGtkPage* page);
WEBKIT_API gboolean
webkit_page_can_cut (WebKitPage* page);
WEBKIT_GTK_API gboolean
webkit_gtk_page_can_copy (WebKitGtkPage* page);
WEBKIT_API gboolean
webkit_page_can_copy (WebKitPage* page);
WEBKIT_GTK_API gboolean
webkit_gtk_page_can_paste (WebKitGtkPage* page);
WEBKIT_API gboolean
webkit_page_can_paste (WebKitPage* page);
WEBKIT_GTK_API void
webkit_gtk_page_cut (WebKitGtkPage* page);
WEBKIT_API void
webkit_page_cut (WebKitPage* page);
WEBKIT_GTK_API void
webkit_gtk_page_copy (WebKitGtkPage* page);
WEBKIT_API void
webkit_page_copy (WebKitPage* page);
WEBKIT_GTK_API void
webkit_gtk_page_paste (WebKitGtkPage* page);
WEBKIT_API void
webkit_page_paste (WebKitPage* page);
WEBKIT_GTK_API gboolean
webkit_gtk_page_can_go_backward (WebKitGtkPage* page);
WEBKIT_API gboolean
webkit_page_can_go_backward (WebKitPage* page);
WEBKIT_GTK_API gboolean
webkit_gtk_page_can_go_forward (WebKitGtkPage* page);
WEBKIT_API gboolean
webkit_page_can_go_forward (WebKitPage* page);
WEBKIT_GTK_API void
webkit_gtk_page_go_backward (WebKitGtkPage* page);
WEBKIT_API void
webkit_page_go_backward (WebKitPage* page);
WEBKIT_GTK_API void
webkit_gtk_page_go_forward (WebKitGtkPage* page);
WEBKIT_API void
webkit_page_go_forward (WebKitPage* page);
WEBKIT_GTK_API void
webkit_gtk_page_stop_loading (WebKitGtkPage* page);
WEBKIT_API void
webkit_page_stop_loading (WebKitPage* page);
WEBKIT_GTK_API void
webkit_gtk_page_open (WebKitGtkPage* page, const gchar* url);
WEBKIT_API void
webkit_page_open (WebKitPage* page, const gchar* url);
WEBKIT_GTK_API void
webkit_gtk_page_reload (WebKitGtkPage *page);
WEBKIT_API void
webkit_page_reload (WebKitPage *page);
WEBKIT_GTK_API void
webkit_gtk_page_load_string (WebKitGtkPage* page, const gchar* content, const gchar* content_mime_type, const gchar* content_encoding, const gchar* base_url);
WEBKIT_API void
webkit_page_load_string (WebKitPage* page, const gchar* content, const gchar* content_mime_type, const gchar* content_encoding, const gchar* base_url);