svnno****@sourc*****
svnno****@sourc*****
Thu Feb 21 14:01:16 JST 2008
Revision: 3377 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=kazehakase&view=rev&rev=3377 Author: ikezoe Date: 2008-02-21 14:01:16 +0900 (Thu, 21 Feb 2008) Log Message: ----------- implement some functions. Modified Paths: -------------- kazehakase/trunk/module/embed/webkit-gtk/kz-webkit-gtk.c Modified: kazehakase/trunk/module/embed/webkit-gtk/kz-webkit-gtk.c =================================================================== --- kazehakase/trunk/module/embed/webkit-gtk/kz-webkit-gtk.c 2008-02-21 04:22:41 UTC (rev 3376) +++ kazehakase/trunk/module/embed/webkit-gtk/kz-webkit-gtk.c 2008-02-21 05:01:16 UTC (rev 3377) @@ -34,8 +34,23 @@ static void kz_webkit_gtk_init (KzWebKitGtk *webkit_gtk); static void kz_webkit_gtk_dispose (GObject *object); -static void load_url (KzEmbed *kzembed, - const gchar *url); +static void load_url (KzEmbed *kzembed, + const gchar *url); +static void stop_load (KzEmbed *kzembed); +static void reload (KzEmbed *kzembed, + KzEmbedReloadFlag flags); +static void go_back (KzEmbed *kzembed); +static void go_forward (KzEmbed *kzembed); +static gboolean can_go_back (KzEmbed *kzembed); +static gboolean can_go_forward (KzEmbed *kzembed); +static gboolean can_cut_selection(KzEmbed *kzembed); +static gboolean can_copy_selection (KzEmbed *kzembed); +static gboolean can_paste (KzEmbed *kzembed); +static void cut_selection (KzEmbed *kzembed); +static void copy_selection (KzEmbed *kzembed); +static void paste (KzEmbed *kzembed); +static void select_all (KzEmbed *kzembed); + void kz_webkit_gtk_register_type (GTypeModule *module) { @@ -102,13 +117,13 @@ iface->ensure_title = NULL; iface->get_link_message = NULL; iface->get_progress = NULL; - iface->can_cut_selection = NULL; - iface->can_copy_selection = NULL; - iface->can_paste = NULL; - iface->cut_selection = NULL; - iface->copy_selection = NULL; - iface->paste = NULL; - iface->select_all = NULL; + iface->can_cut_selection = can_cut_selection; + iface->can_copy_selection = can_copy_selection; + iface->can_paste = can_paste; + iface->cut_selection = cut_selection; + iface->copy_selection = copy_selection; + iface->paste = paste; + iface->select_all = select_all; iface->get_selection_string = NULL; iface->find = NULL; iface->incremental_search = NULL; @@ -118,12 +133,12 @@ iface->shistory_copy = NULL; iface->shistory_get_pos = NULL; iface->shistory_get_nth = NULL; - iface->reload = NULL; - iface->stop_load = NULL; - iface->go_back = NULL; - iface->go_forward = NULL; - iface->can_go_back = NULL; - iface->can_go_forward = NULL; + iface->reload = reload; + iface->stop_load = stop_load; + iface->go_back = go_back; + iface->go_forward = go_forward; + iface->can_go_back = can_go_back; + iface->can_go_forward = can_go_forward; iface->can_go_nav_link = NULL; iface->go_nav_link = NULL; iface->append_nav_link = NULL; @@ -220,3 +235,107 @@ webkit_web_view_open(WEBKIT_WEB_VIEW(kzembed), url); } +static void +reload (KzEmbed *kzembed, KzEmbedReloadFlag flags) +{ + g_return_if_fail(KZ_IS_WEBKIT_GTK(kzembed)); + + webkit_web_view_reload(WEBKIT_WEB_VIEW(kzembed)); +} + +static void +stop_load (KzEmbed *kzembed) +{ + g_return_if_fail(KZ_IS_WEBKIT_GTK(kzembed)); + + webkit_web_view_stop_loading(WEBKIT_WEB_VIEW(kzembed)); +} + +static void +go_back (KzEmbed *kzembed) +{ + g_return_if_fail(KZ_IS_WEBKIT_GTK(kzembed)); + + webkit_web_view_go_back(WEBKIT_WEB_VIEW(kzembed)); +} + +static void +go_forward (KzEmbed *kzembed) +{ + g_return_if_fail(KZ_IS_WEBKIT_GTK(kzembed)); + + webkit_web_view_go_forward(WEBKIT_WEB_VIEW(kzembed)); +} + +static gboolean +can_go_back (KzEmbed *kzembed) +{ + g_return_val_if_fail(KZ_IS_WEBKIT_GTK(kzembed), FALSE); + + return webkit_web_view_can_go_back(WEBKIT_WEB_VIEW(kzembed)); +} + +static gboolean +can_go_forward (KzEmbed *kzembed) +{ + g_return_val_if_fail(KZ_IS_WEBKIT_GTK(kzembed), FALSE); + + return webkit_web_view_can_go_forward(WEBKIT_WEB_VIEW(kzembed)); +} + +static gboolean +can_cut_selection (KzEmbed *kzembed) +{ + g_return_val_if_fail(KZ_IS_WEBKIT_GTK(kzembed), FALSE); + + return webkit_web_view_can_cut_clipboard(WEBKIT_WEB_VIEW(kzembed)); +} + +static gboolean +can_copy_selection (KzEmbed *kzembed) +{ + g_return_val_if_fail(KZ_IS_WEBKIT_GTK(kzembed), FALSE); + + return webkit_web_view_can_copy_clipboard(WEBKIT_WEB_VIEW(kzembed)); +} + +static gboolean +can_paste (KzEmbed *kzembed) +{ + g_return_val_if_fail(KZ_IS_WEBKIT_GTK(kzembed), FALSE); + + return webkit_web_view_can_paste_clipboard(WEBKIT_WEB_VIEW(kzembed)); +} + +static void +cut_selection (KzEmbed *kzembed) +{ + g_return_if_fail(KZ_IS_WEBKIT_GTK(kzembed)); + + webkit_web_view_cut_clipboard(WEBKIT_WEB_VIEW(kzembed)); +} + +static void +copy_selection (KzEmbed *kzembed) +{ + g_return_if_fail(KZ_IS_WEBKIT_GTK(kzembed)); + + webkit_web_view_copy_clipboard(WEBKIT_WEB_VIEW(kzembed)); +} + +static void +paste (KzEmbed *kzembed) +{ + g_return_if_fail(KZ_IS_WEBKIT_GTK(kzembed)); + + webkit_web_view_paste_clipboard(WEBKIT_WEB_VIEW(kzembed)); +} + +static void +select_all (KzEmbed *kzembed) +{ + g_return_if_fail(KZ_IS_WEBKIT_GTK(kzembed)); + + webkit_web_view_select_all(WEBKIT_WEB_VIEW(kzembed)); +} +