From a36ff70df43d0ec64e9a3fead6a0a0bf825fe87f Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 18 Nov 2008 17:20:45 +0000 Subject: [PATCH] Removed debug output --- .../osgbrowser/llembeddedbrowserwindow.cpp | 2 - examples/osgbrowser/osgbrowser.cpp | 53 ++++++++++++------- 2 files changed, 35 insertions(+), 20 deletions(-) diff --git a/examples/osgbrowser/llembeddedbrowserwindow.cpp b/examples/osgbrowser/llembeddedbrowserwindow.cpp index 1f4484e6a..ee7019bad 100644 --- a/examples/osgbrowser/llembeddedbrowserwindow.cpp +++ b/examples/osgbrowser/llembeddedbrowserwindow.cpp @@ -1096,8 +1096,6 @@ PRBool LLEmbeddedBrowserWindow::sendMozillaKeyboardEvent( PRUint32 uni_char, PRU keyEvent.refPoint.y = 0; keyEvent.flags = 0; - std::cout<<"Sending key envent "<DispatchEvent( &keyEvent, &status ); if ( NS_FAILED( result ) ) diff --git a/examples/osgbrowser/osgbrowser.cpp b/examples/osgbrowser/osgbrowser.cpp index 70664c4e0..c149d83d3 100644 --- a/examples/osgbrowser/osgbrowser.cpp +++ b/examples/osgbrowser/osgbrowser.cpp @@ -18,6 +18,16 @@ class UBrowserImage; +#ifdef _WINDOWS + #include +#elif defined(__APPLE__) + #include +#else + extern "C" { + #include + } +#endif + ////////////////////////////////////////////////////////////////////////// // // UBrowserManager interface @@ -110,6 +120,7 @@ class UBrowserImage : public osg::Image, public LLEmbeddedBrowserWindowObserver void onPageChanged( const EventType& eventIn ) { // flag that an update is required - page grab happens in idle() so we don't stall + osg::notify(osg::NOTICE) << "Event: onPageChanged " << eventIn.getEventUri() << std::endl; _needsUpdate = true; }; @@ -195,7 +206,7 @@ osg::ref_ptr& UBrowserManager::instance() return s_UBrowserManager; } -#ifdef _WINDOWS +#if defined(_WINDOWS) void* UBrowserManager::getNativeWindowHandle() { if (_nativeWindowHandle) return _nativeWindowHandle; @@ -207,10 +218,28 @@ void* UBrowserManager::getNativeWindowHandle() return _nativeWindowHandle; } +#elif defined(__APPLE__) +void* UBrowserManager::getNativeWindowHandle() +{ + if (_nativeWindowHandle) return _nativeWindowHandle; + + // Create a window just for this purpose. + Rect window_rect = {100, 100, 200, 200}; + + _nativeWindowHandle = (void*) NewCWindow( + NULL, + &window_rect, + "\p", + false, // Create the window invisible. + zoomDocProc, // Window with a grow box and a zoom box + kLastWindowOfClass, // create it behind other windows + false, // no close box + 0); + } + + return _nativeWindowHandle; +} #else - -#include - void* UBrowserManager::getNativeWindowHandle() { if (_nativeWindowHandle) return _nativeWindowHandle; @@ -257,8 +286,6 @@ struct InitOperation : public osg::Operation // append details to agent string LLMozLib::getInstance()->setBrowserAgentId( ubrowserManager->getApplication() ); - - osg::notify(osg::NOTICE)<<"Done init"<s(); int height = image->t(); - osg::notify(osg::NOTICE)<<"Contructing browser window for first time, width = "<getBrowserWindowId(); // send event to LLMozLib @@ -574,8 +597,6 @@ struct KeyEventOperation : public osg::Operation virtual void operator () (osg::Object* object) { - osg::notify(osg::NOTICE)<<"KeyEventOperation "<getBrowserWindowId(); if (_isUnicode) LLMozLib::getInstance()->unicodeInput( id, _key ); else LLMozLib::getInstance()->keyPress( id, _key ); @@ -606,8 +627,6 @@ struct NavigateToOperation : public osg::Operation virtual void operator () (osg::Object* object) { - osg::notify(osg::NOTICE)<<"KeyEventOperation "<getBrowserWindowId(); LLMozLib::getInstance()->navigateTo( id, _url ); } @@ -699,8 +718,6 @@ int main( int argc, char* argv[] ) osg::ArgumentParser arguments(&argc, argv); UBrowserManager::instance()->init(arguments[0]); - - osg::notify(osg::NOTICE)<<"After init"<