]> git.saurik.com Git - wxWidgets.git/commitdiff
Implement clipboard api in gtk.
authorSteve Lamerton <steve.lamerton@gmail.com>
Sat, 2 Jul 2011 14:32:02 +0000 (14:32 +0000)
committerSteve Lamerton <steve.lamerton@gmail.com>
Sat, 2 Jul 2011 14:32:02 +0000 (14:32 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@68130 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/gtk/webview_webkit.h
include/wx/webview.h
src/gtk/webview_webkit.cpp

index 54d5a3f76267cf641ea54b8d2779c9afd582a5d0..69fef706f891ac5d63d13f54f01dd61636673b00 100644 (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;
index b3bb60f223a6c706640487435c3376d0d93501b7..3dadea6a328423e7c89c874a20a3f4e48c2d71d4 100644 (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
 {
index ae1ab1212f155a70931b17b5a8c53c74ec1c556f..3e53beaa259fa059bb4469b2287896513c4ea926 100644 (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