00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef AWWEBCORE_H
00015 #define AWWEBCORE_H
00016
00017 #include "pandabase.h"
00018 #include "typedReferenceCount.h"
00019 #include "luse.h"
00020
00021 #include "awesomium_includes.h"
00022
00023 class AwWebView;
00024
00025
00026
00027
00028 class EXPCL_PANDAAWESOMIUM AwWebCore : public TypedReferenceCount, public Awesomium::WebCore {
00029 PUBLISHED:
00030
00031
00032
00033 enum LogLevel
00034 {
00035 LOG_NONE ,
00036 LOG_NORMAL ,
00037 LOG_VERBOSE
00038 };
00039
00040
00041
00042
00043 enum PixelFormat
00044 {
00045 PF_BGRA,
00046 PF_RGBA
00047 };
00048
00049 AwWebCore(LogLevel level = LOG_NORMAL, bool enablePlugins = true, PixelFormat pixelFormat = PF_BGRA);
00050
00051 virtual ~AwWebCore();
00052
00053 static Awesomium::WebCore& Get();
00054
00055 static Awesomium::WebCore* GetPointer();
00056
00057 INLINE void setBaseDirectory(const std::string& baseDirectory);
00058
00059 AwWebView * createWebView(int width, int height, bool isTransparent = false, bool enableAsyncRendering = false, int maxAsyncRenderPerSec = 70);
00060
00061 INLINE void setCustomResponsePage(int statusCode, const std::string& filePath);
00062
00063 INLINE void update();
00064
00065 INLINE const std::string& getBaseDirectory() const;
00066
00067 AwWebCore::PixelFormat getPixelFormat() const;
00068
00069 INLINE bool arePluginsEnabled() const;
00070
00071 INLINE void pause();
00072
00073 INLINE void resume();
00074
00075 public:
00076 static TypeHandle get_class_type() {
00077 return _type_handle;
00078 }
00079 static void init_type() {
00080 TypedReferenceCount::init_type();
00081 register_type(_type_handle, "AwWebCore",
00082 TypedReferenceCount::get_class_type());
00083 }
00084 virtual TypeHandle get_type() const {
00085 return get_class_type();
00086 }
00087 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00088
00089 private:
00090 static TypeHandle _type_handle;
00091 };
00092
00093 #include "awWebCore.I"
00094
00095 #endif