#include "wx/setup.h"
-#if wxUSE_WEBVIEW_WEBKIT && defined(__WXGTK__)
+#if wxUSE_WEBVIEW && wxUSE_WEBVIEW_WEBKIT && defined(__WXGTK__)
-#include "webkit/webkit.h"
#include "wx/sharedptr.h"
#include "wx/webview.h"
+typedef struct _WebKitWebView WebKitWebView;
+
//-----------------------------------------------------------------------------
// wxWebViewWebKit
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_WEBVIEW wxWebViewWebKit : public wxWebView
{
public:
- wxWebViewWebKit() { Init(); }
+ wxWebViewWebKit() { }
wxWebViewWebKit(wxWindow *parent,
wxWindowID id = wxID_ANY,
const wxSize& size = wxDefaultSize, long style = 0,
const wxString& name = wxWebViewNameStr)
{
- Init();
-
Create(parent, id, url, pos, size, style, name);
}
const wxSize& size = wxDefaultSize, long style = 0,
const wxString& name = wxWebViewNameStr);
+ virtual ~wxWebViewWebKit();
+
virtual bool Enable( bool enable = true );
// implementation
virtual wxString GetCurrentTitle() const;
virtual wxString GetPageSource() const;
virtual wxString GetPageText() const;
- //We do not want to hide the other overloads
- using wxWebView::SetPage;
- virtual void SetPage(const wxString& html, const wxString& baseUrl);
virtual void Print();
virtual bool IsBusy() const;
virtual void Undo();
virtual void Redo();
+ //Find function
+ virtual long Find(const wxString& text, int flags = wxWEB_VIEW_FIND_DEFAULT);
+
//Editing functions
virtual void SetEditable(bool enable = true);
virtual bool IsEditable() const;
virtual void ClearSelection();
virtual void RunScript(const wxString& javascript);
-
+
//Virtual Filesystem Support
virtual void RegisterHandler(wxSharedPtr<wxWebViewHandler> handler);
virtual wxVector<wxSharedPtr<wxWebViewHandler> > GetHandlers() { return m_handlerList; }
- /** FIXME: hack to work around signals being received too early */
- bool m_ready;
-
+ virtual void* GetNativeBackend() const { return m_web_view; }
/** TODO: check if this can be made private
* The native control has a getter to check for busy state, but except in
bool m_guard;
protected:
+ virtual void DoSetPage(const wxString& html, const wxString& baseUrl);
virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const;
void SetWebkitZoom(float level);
float GetWebkitZoom() const;
+ //Find helper function
+ void FindClear();
+
// focus event handler: calls GTKUpdateBitmap()
void GTKOnFocus(wxFocusEvent& event);
- GtkWidget *web_view;
- gint m_historyLimit;
+ WebKitWebView *m_web_view;
+ int m_historyLimit;
wxVector<wxSharedPtr<wxWebViewHandler> > m_handlerList;
+ //variables used for Find()
+ int m_findFlags;
+ wxString m_findText;
+ int m_findPosition;
+ int m_findCount;
+
wxDECLARE_DYNAMIC_CLASS(wxWebViewWebKit);
};
-#endif // wxUSE_WEBVIEW_WEBKIT && defined(__WXGTK__)
+#endif // wxUSE_WEBVIEW && wxUSE_WEBVIEW_WEBKIT && defined(__WXGTK__)
#endif