Panda3D
|
00001 // Filename: WebBrowserTexture.h 00002 // Created by: Bei Yang (03Aug2010) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 #ifndef WebBrowserTexture_H 00016 #define WebBrowserTexture_H 00017 00018 #include "pandabase.h" 00019 #include "texture.h" 00020 #include "awWebView.h" 00021 00022 00023 //////////////////////////////////////////////////////////////////// 00024 // Class : WebBrowserTexture 00025 // Description : A Wrapper class for Awesomium webview. This 00026 // implements most of Awesomium's features and 00027 // updates on the cull_traverser callback much 00028 // much like a movie texture. 00029 // 00030 // The use of class means that you will have to 00031 // follow Awesomium license agreement give below 00032 // http://www.khrona.com/products/awesomium/licensing/ 00033 //////////////////////////////////////////////////////////////////// 00034 class EXPCL_PANDAAWESOMIUM WebBrowserTexture : public Texture { 00035 protected: 00036 AwWebView* _aw_web_view; 00037 bool _update_active; 00038 bool _flip_texture_active; 00039 00040 //Constructors & Destructors ------------ 00041 private: 00042 WebBrowserTexture(const WebBrowserTexture ©); 00043 PUBLISHED: 00044 WebBrowserTexture(const string &name, AwWebView* aw_web_view = NULL); 00045 virtual ~WebBrowserTexture(); 00046 00047 00048 //methods -------------- 00049 protected: 00050 bool get_keep_ram_image() const; 00051 void do_reload_ram_image(); 00052 public: 00053 virtual bool has_cull_callback() const; 00054 virtual bool cull_callback(CullTraverser *trav, const CullTraverserData &data) const; 00055 PUBLISHED: 00056 void set_web_view(AwWebView* aw_web_view); 00057 AwWebView* get_web_view() const; 00058 void set_update_active(bool active_flag); 00059 bool get_update_active() const; 00060 void set_flip_texture_active(bool active_flag); 00061 bool get_flip_texture_active() const; 00062 00063 //Type handles ---------------- 00064 public: 00065 static TypeHandle get_class_type() { 00066 return _type_handle; 00067 } 00068 static void init_type() { 00069 Texture::init_type(); 00070 register_type(_type_handle, "WebBrowserTexture", 00071 Texture::get_class_type()); 00072 } 00073 virtual TypeHandle get_type() const { 00074 return get_class_type(); 00075 } 00076 virtual TypeHandle force_init_type() {init_type(); return get_class_type();} 00077 00078 private: 00079 static TypeHandle _type_handle; 00080 }; 00081 #endif