Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add helper include for web browsers.

* eBrowser.h can be included from a .cpp file to provide an interface
  to platform-specific browsers through a factory function.

* eBrowserDef.h can be included in an .h file to define "eBrowser" as the
  actual platform-specific browser class; PreviewDlg for instance makes
  use of platform-specific methods.
  • Loading branch information...
commit a04b2bd800481673fca926085372d74579a741bd 1 parent 81a7e38
@adamv adamv authored
Showing with 59 additions and 0 deletions.
  1. +8 −0 src/e.vcproj
  2. +32 −0 src/eBrowser.h
  3. +19 −0 src/eBrowserDef.h
View
8 src/e.vcproj
@@ -1029,6 +1029,14 @@
Name="Browser"
>
<File
+ RelativePath=".\eBrowser.h"
+ >
+ </File>
+ <File
+ RelativePath=".\eBrowserDef.h"
+ >
+ </File>
+ <File
RelativePath="IEHtmlWin.cpp"
>
</File>
View
32 src/eBrowser.h
@@ -0,0 +1,32 @@
+#ifndef __EBROWSER_H__
+#define __EBROWSER_H__
+
+#include <wx/platform.h>
+
+/*
+ Include the proper browser include for MSW or GTK.
+ #define 'eBrowser' to the platform specific browser class.
+ Provide a "NewBrowser" factory function for creating browser controls.
+*/
+
+#if defined (__WXMSW__)
+#include "IEHtmlWin.h"
+
+inline wxIEHtmlWin* NewBrowser(wxWindow * parent, wxWindowID id,
+ const wxPoint& point = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize)
+{
+ return new wxIEHtmlWin(parent, id, point, size);
+}
+#elif defined (__WXGTK__)
+#include "WebKitHtmlWnd.h"
+
+inline wxBrowser* NewBrowser(wxWindow * parent, wxWindowID id,
+ const wxPoint& point = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize)
+{
+ return new wxBrowser(parent, id, point, size);
+}
+#endif
+
+#endif
View
19 src/eBrowserDef.h
@@ -0,0 +1,19 @@
+#ifndef __EBROWSER_DEF_H__
+#define __EBROWSER_DEF_H__
+
+#include <wx/platform.h>
+
+#if defined (__WXMSW__)
+// #define eBrowser wxIEHtmlWin
+ class wxIEHtmlWin;
+ typedef wxIEHtmlWin eBrowser;
+#elif defined (__WXGTK__)
+// #define eBrowser wxBrowser
+ class wxBrowser;
+ typedef wxBrowser eBrowser;
+#endif
+
+class IHtmlWnd;
+class IHtmlWndBeforeLoadEvent;
+
+#endif
Please sign in to comment.
Something went wrong with that request. Please try again.