Implement clipboard api in gtk.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@68130 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Steve Lamerton 2011-07-02 14:32:02 +00:00
parent 4681a3ea0d
commit ae26e17b93
3 changed files with 38 additions and 1 deletions

View File

@ -120,7 +120,13 @@ public:
virtual wxWebViewZoom GetZoom();
virtual void SetZoom(wxWebViewZoom);
//Clipboard functions
virtual bool CanCut();
virtual bool CanCopy();
virtual bool CanPaste();
virtual void Cut();
virtual void Copy();
virtual void Paste();
/** FIXME: hack to work around signals being received too early */
bool m_ready;

View File

@ -18,6 +18,7 @@
#include <wx/event.h>
#include <wx/sstream.h>
#include "wx/sharedptr.h"
#include "wx/vector.h"
class WXDLLIMPEXP_WEB wxWebHistoryItem
{

View File

@ -489,6 +489,36 @@ void wxWebViewWebKit::LoadHistoryItem(wxSharedPtr<wxWebHistoryItem> item)
}
}
bool wxWebViewWebKit::CanCut()
{
return webkit_web_view_can_cut_clipboard(WEBKIT_WEB_VIEW(web_view));
}
bool wxWebViewWebKit::CanCopy()
{
return webkit_web_view_can_copy_clipboard(WEBKIT_WEB_VIEW(web_view));
}
bool wxWebViewWebKit::CanPaste()
{
return webkit_web_view_can_paste_clipboard(WEBKIT_WEB_VIEW(web_view));
}
void wxWebViewWebKit::Cut()
{
webkit_web_view_cut_clipboard(WEBKIT_WEB_VIEW(web_view));
}
void wxWebViewWebKit::Copy()
{
webkit_web_view_copy_clipboard(WEBKIT_WEB_VIEW(web_view));
}
void wxWebViewWebKit::Paste()
{
webkit_web_view_paste_clipboard(WEBKIT_WEB_VIEW(web_view));
}
wxString wxWebViewWebKit::GetCurrentURL()
{
// FIXME: check which encoding the web kit control uses instead of