Panda3D

awWebView.cxx

00001 // Filename: awWebView.cxx
00002 // Created by:  rurbino (12Oct09)
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 #include "config_awesomium.h"
00016 #include "awWebView.h"
00017 
00018 TypeHandle AwWebView::_type_handle;
00019 
00020 AwWebView::
00021 AwWebView(Awesomium::WebView * webViewPtr)  {  
00022   _myWebView = webViewPtr;
00023 
00024 }
00025 
00026 AwWebView::
00027 ~AwWebView() {
00028 }
00029 
00030 
00031 void AwWebView::
00032 loadURL2(const string& url, const string& frameName , const string& username , const string& password )
00033 {
00034   _myWebView->loadURL2(url, frameName, username, password);
00035 
00036 }
00037 
00038 void AwWebView::
00039 loadHTML2(const std::string& html, const std::string& frameName )
00040 {
00041   _myWebView->loadHTML2(html, frameName);
00042 }
00043 
00044 
00045 void AwWebView::
00046 loadFile2(const std::string& file, const std::string& frameName )
00047 {
00048   _myWebView->loadFile2(file, frameName);
00049 }
00050 
00051 
00052 void AwWebView::
00053 render(size_t destination, int destRowSpan, int destDepth, AwWebView::Rect * renderedRect) {
00054   if (renderedRect) {
00055     Awesomium::Rect rect(renderedRect->x, renderedRect->y, renderedRect->width, renderedRect->height);
00056     _myWebView->Awesomium::WebView::render( reinterpret_cast<unsigned char *>(destination), destRowSpan, destDepth, &rect);    
00057   }
00058   else
00059   {
00060     AwWebView::render(destination, destRowSpan, destDepth, 0);
00061   }
00062 }
00063 
00064 void AwWebView::
00065 injectMouseDown(AwWebView::MouseButton button) {
00066   awesomium_cat.debug() <<"got mouse down " << button << "\n";
00067   _myWebView->injectMouseDown(static_cast<Awesomium::MouseButton>(button));
00068 }
00069 
00070 
00071 void AwWebView::
00072 injectMouseMove(int x, int y) {
00073   //awesomium_cat.debug() <<"got mouse move " << x << " " << y << "\n";
00074   _myWebView->injectMouseMove(x,y);
00075 }
00076 
 All Classes Functions Variables Enumerations