Panda3D
 All Classes Functions Variables Enumerations
awWebView.cxx
1 // Filename: awWebView.cxx
2 // Created by: rurbino (12Oct09)
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 #include "config_awesomium.h"
16 #include "awWebView.h"
17 
18 TypeHandle AwWebView::_type_handle;
19 
20 AwWebView::
21 AwWebView(Awesomium::WebView * webViewPtr) {
22  _myWebView = webViewPtr;
23 
24 }
25 
26 AwWebView::
27 ~AwWebView() {
28 }
29 
30 
31 void AwWebView::
32 loadURL2(const string& url, const string& frameName , const string& username , const string& password )
33 {
34  _myWebView->loadURL2(url, frameName, username, password);
35 
36 }
37 
38 void AwWebView::
39 loadHTML2(const std::string& html, const std::string& frameName )
40 {
41  _myWebView->loadHTML2(html, frameName);
42 }
43 
44 
45 void AwWebView::
46 loadFile2(const std::string& file, const std::string& frameName )
47 {
48  _myWebView->loadFile2(file, frameName);
49 }
50 
51 
52 void AwWebView::
53 render(size_t destination, int destRowSpan, int destDepth, AwWebView::Rect * renderedRect) {
54  if (renderedRect) {
55  Awesomium::Rect rect(renderedRect->x, renderedRect->y, renderedRect->width, renderedRect->height);
56  _myWebView->Awesomium::WebView::render( reinterpret_cast<unsigned char *>(destination), destRowSpan, destDepth, &rect);
57  }
58  else
59  {
60  AwWebView::render(destination, destRowSpan, destDepth, 0);
61  }
62 }
63 
64 void AwWebView::
65 injectMouseDown(AwWebView::MouseButton button) {
66  awesomium_cat.debug() <<"got mouse down " << button << "\n";
67  _myWebView->injectMouseDown(static_cast<Awesomium::MouseButton>(button));
68 }
69 
70 
71 void AwWebView::
72 injectMouseMove(int x, int y) {
73  //awesomium_cat.debug() <<"got mouse move " << x << " " << y << "\n";
74  _myWebView->injectMouseMove(x,y);
75 }
76 
MouseButton
Mouse button enumerations, used with WebView::injectMouseDown and WebView::injectMouseUp.
Definition: awWebView.h:36
A simple rectangle class, used with WebView::render.
Definition: awWebView.h:45
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85