Panda3D
 All Classes Functions Variables Enumerations
WebBrowserTexture.h
1 // Filename: WebBrowserTexture.h
2 // Created by: Bei Yang (03Aug2010)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef WebBrowserTexture_H
16 #define WebBrowserTexture_H
17 
18 #include "pandabase.h"
19 #include "texture.h"
20 #include "awWebView.h"
21 
22 
23 ////////////////////////////////////////////////////////////////////
24 // Class : WebBrowserTexture
25 // Description : A Wrapper class for Awesomium webview. This
26 // implements most of Awesomium's features and
27 // updates on the cull_traverser callback much
28 // much like a movie texture.
29 //
30 // The use of class means that you will have to
31 // follow Awesomium license agreement give below
32 // http://www.khrona.com/products/awesomium/licensing/
33 ////////////////////////////////////////////////////////////////////
34 class EXPCL_PANDAAWESOMIUM WebBrowserTexture : public Texture {
35 protected:
36  AwWebView* _aw_web_view;
37  bool _update_active;
38  bool _flip_texture_active;
39 
40 //Constructors & Destructors ------------
41 private:
43 PUBLISHED:
44  WebBrowserTexture(const string &name, AwWebView* aw_web_view = NULL);
45  virtual ~WebBrowserTexture();
46 
47 
48 //methods --------------
49 protected:
50  bool get_keep_ram_image() const;
51  void do_reload_ram_image();
52 public:
53  virtual bool has_cull_callback() const;
54  virtual bool cull_callback(CullTraverser *trav, const CullTraverserData &data) const;
55 PUBLISHED:
56  void set_web_view(AwWebView* aw_web_view);
57  AwWebView* get_web_view() const;
58  void set_update_active(bool active_flag);
59  bool get_update_active() const;
60  void set_flip_texture_active(bool active_flag);
61  bool get_flip_texture_active() const;
62 
63 //Type handles ----------------
64 public:
65  static TypeHandle get_class_type() {
66  return _type_handle;
67  }
68  static void init_type() {
69  Texture::init_type();
70  register_type(_type_handle, "WebBrowserTexture",
71  Texture::get_class_type());
72  }
73  virtual TypeHandle get_type() const {
74  return get_class_type();
75  }
76  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
77 
78 private:
79  static TypeHandle _type_handle;
80 };
81 #endif
virtual bool has_cull_callback() const
Should be overridden by derived classes to return true if cull_callback() has been defined...
Definition: texture.cxx:2354
Represents a texture object, which is typically a single 2-d image but may also represent a 1-d or 3-...
Definition: texture.h:75
This collects together the pieces of data that are accumulated for each node while walking the scene ...
virtual bool cull_callback(CullTraverser *trav, const CullTraverserData &data) const
If has_cull_callback() returns true, this function will be called during the cull traversal to perfor...
Definition: texture.cxx:2372
virtual bool get_keep_ram_image() const
Returns the flag that indicates whether this Texture is eligible to have its main RAM copy of the tex...
Definition: texture.cxx:957
Thin bindings, wraps a WebView * returned from WebCore.createWebView.
Definition: awWebView.h:29
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85
This object performs a depth-first traversal of the scene graph, with optional view-frustum culling...
Definition: cullTraverser.h:48
A Wrapper class for Awesomium webview.