Convert NOTIFY to OSG_NOTIFY to avoid problems with polution of users apps with the NOTIFY macro
This commit is contained in:
@@ -44,12 +44,12 @@ bool checkEGLError(const char* str)
|
||||
EGLint err = eglGetError();
|
||||
if (err != EGL_SUCCESS)
|
||||
{
|
||||
NOTIFY(osg::WARN)<<"Warning: "<<str<<" EGL error "<<std::hex<<err<<std::dec<<std::endl;
|
||||
OSG_NOTIFY(osg::WARN)<<"Warning: "<<str<<" EGL error "<<std::hex<<err<<std::dec<<std::endl;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// NOTIFY(osg::WARN)<<"EGL reports no errors: "<<str<<std::endl;
|
||||
// OSG_NOTIFY(osg::WARN)<<"EGL reports no errors: "<<str<<std::endl;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -299,7 +299,7 @@ bool GraphicsWindowX11::createVisualInfo()
|
||||
int depth = DefaultDepth( _display, _traits->screenNum );
|
||||
if (XMatchVisualInfo( _display, _traits->screenNum, depth, TrueColor, _visualInfo )==0)
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"GraphicsWindowX11::createVisualInfo() failed."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"GraphicsWindowX11::createVisualInfo() failed."<<std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -371,7 +371,7 @@ bool GraphicsWindowX11::checkAndSendEventFullScreenIfNeeded(Display* display, in
|
||||
{
|
||||
osg::GraphicsContext::WindowingSystemInterface *wsi = osg::GraphicsContext::getWindowingSystemInterface();
|
||||
if (wsi == NULL) {
|
||||
NOTIFY(osg::NOTICE) << "Error, no WindowSystemInterface available, cannot toggle window fullscreen." << std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE) << "Error, no WindowSystemInterface available, cannot toggle window fullscreen." << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -446,7 +446,7 @@ bool GraphicsWindowX11::setWindowDecorationImplementation(bool flag)
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"Error: GraphicsWindowX11::setBorder(" << flag << ") - couldn't change decorations." << std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Error: GraphicsWindowX11::setBorder(" << flag << ") - couldn't change decorations." << std::endl;
|
||||
result = false;
|
||||
}
|
||||
|
||||
@@ -635,7 +635,7 @@ void GraphicsWindowX11::init()
|
||||
|
||||
if (!_display)
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"Error: Unable to open display \"" << XDisplayName(_traits->displayName().c_str()) << "\"."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Error: Unable to open display \"" << XDisplayName(_traits->displayName().c_str()) << "\"."<<std::endl;
|
||||
_valid = false;
|
||||
return;
|
||||
}
|
||||
@@ -647,7 +647,7 @@ void GraphicsWindowX11::init()
|
||||
EGLint eglMajorVersion, eglMinorVersion;
|
||||
if (!eglInitialize(_eglDisplay, &eglMajorVersion, &eglMinorVersion))
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"GraphicsWindowX11::init() - eglInitialize() failed."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"GraphicsWindowX11::init() - eglInitialize() failed."<<std::endl;
|
||||
|
||||
XCloseDisplay( _display );
|
||||
_display = 0;
|
||||
@@ -655,14 +655,14 @@ void GraphicsWindowX11::init()
|
||||
return;
|
||||
}
|
||||
|
||||
NOTIFY(osg::NOTICE)<<"GraphicsWindowX11::init() - eglInitialize() succeded eglMajorVersion="<<eglMajorVersion<<" iMinorVersion="<<eglMinorVersion<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"GraphicsWindowX11::init() - eglInitialize() succeded eglMajorVersion="<<eglMajorVersion<<" iMinorVersion="<<eglMinorVersion<<std::endl;
|
||||
|
||||
#else
|
||||
// Query for GLX extension
|
||||
int errorBase, eventBase;
|
||||
if( glXQueryExtension( _display, &errorBase, &eventBase) == False )
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"Error: " << XDisplayName(_traits->displayName().c_str()) <<" has no GLX extension." << std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Error: " << XDisplayName(_traits->displayName().c_str()) <<" has no GLX extension." << std::endl;
|
||||
|
||||
XCloseDisplay( _display );
|
||||
_display = 0;
|
||||
@@ -671,7 +671,7 @@ void GraphicsWindowX11::init()
|
||||
}
|
||||
#endif
|
||||
|
||||
// NOTIFY(osg::NOTICE)<<"GLX extension, errorBase="<<errorBase<<" eventBase="<<eventBase<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"GLX extension, errorBase="<<errorBase<<" eventBase="<<eventBase<<std::endl;
|
||||
|
||||
if (!createVisualInfo())
|
||||
{
|
||||
@@ -681,11 +681,11 @@ void GraphicsWindowX11::init()
|
||||
_traits->alpha /= 2;
|
||||
_traits->depth /= 2;
|
||||
|
||||
NOTIFY(osg::INFO)<<"Relaxing traits"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Relaxing traits"<<std::endl;
|
||||
|
||||
if (!createVisualInfo())
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"Error: Not able to create requested visual." << std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Error: Not able to create requested visual." << std::endl;
|
||||
XCloseDisplay( _display );
|
||||
_display = 0;
|
||||
_valid = false;
|
||||
@@ -708,7 +708,7 @@ void GraphicsWindowX11::init()
|
||||
return;
|
||||
}
|
||||
|
||||
NOTIFY(osg::NOTICE)<<"GraphicsWindowX11::init() - window created ="<<_valid<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"GraphicsWindowX11::init() - window created ="<<_valid<<std::endl;
|
||||
|
||||
EGLConfig eglConfig = 0;
|
||||
|
||||
@@ -732,7 +732,7 @@ void GraphicsWindowX11::init()
|
||||
int numConfigs;
|
||||
if (!eglChooseConfig(_eglDisplay, configAttribs, &eglConfig, 1, &numConfigs) || (numConfigs != 1))
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"GraphicsWindowX11::init() - eglChooseConfig() failed."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"GraphicsWindowX11::init() - eglChooseConfig() failed."<<std::endl;
|
||||
XCloseDisplay( _display );
|
||||
_valid = false;
|
||||
_display = 0;
|
||||
@@ -744,7 +744,7 @@ void GraphicsWindowX11::init()
|
||||
_eglSurface = eglCreateWindowSurface(_eglDisplay, eglConfig, (EGLNativeWindowType)_window, NULL);
|
||||
if (_eglSurface == EGL_NO_SURFACE)
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"GraphicsWindowX11::init() - eglCreateWindowSurface(..) failed."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"GraphicsWindowX11::init() - eglCreateWindowSurface(..) failed."<<std::endl;
|
||||
XCloseDisplay( _display );
|
||||
_valid = false;
|
||||
_display = 0;
|
||||
@@ -764,7 +764,7 @@ void GraphicsWindowX11::init()
|
||||
_context = eglCreateContext(_eglDisplay, eglConfig, sharedContext, contextAttribs);
|
||||
if (_context == EGL_NO_CONTEXT)
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"GraphicsWindowX11::init() - eglCreateContext(..) failed."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"GraphicsWindowX11::init() - eglCreateContext(..) failed."<<std::endl;
|
||||
XCloseDisplay( _display );
|
||||
_valid = false;
|
||||
_display = 0;
|
||||
@@ -781,7 +781,7 @@ void GraphicsWindowX11::init()
|
||||
|
||||
if (!_context)
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"Error: Unable to create OpenGL graphics context."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Error: Unable to create OpenGL graphics context."<<std::endl;
|
||||
XCloseDisplay( _display );
|
||||
_display = 0;
|
||||
_valid = false;
|
||||
@@ -828,7 +828,7 @@ bool GraphicsWindowX11::createWindow()
|
||||
swatt.override_redirect = true;
|
||||
mask |= CWOverrideRedirect;
|
||||
|
||||
NOTIFY(osg::INFO)<<"Setting override redirect"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Setting override redirect"<<std::endl;
|
||||
}
|
||||
|
||||
_window = XCreateWindow( _display, _parent,
|
||||
@@ -840,7 +840,7 @@ bool GraphicsWindowX11::createWindow()
|
||||
|
||||
if (!_window)
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"Error: Unable to create Window."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Error: Unable to create Window."<<std::endl;
|
||||
_context = 0;
|
||||
return false;
|
||||
}
|
||||
@@ -885,7 +885,7 @@ bool GraphicsWindowX11::createWindow()
|
||||
resized( watt.x, watt.y, watt.width, watt.height );
|
||||
}
|
||||
|
||||
//NOTIFY(osg::NOTICE)<<"After sync apply.x = "<<watt.x<<" watt.y="<<watt.y<<" width="<<watt.width<<" height="<<watt.height<<std::endl;
|
||||
//OSG_NOTIFY(osg::NOTICE)<<"After sync apply.x = "<<watt.x<<" watt.y="<<watt.y<<" width="<<watt.width<<" height="<<watt.height<<std::endl;
|
||||
|
||||
|
||||
XSelectInput( _eventDisplay, _window, ExposureMask | StructureNotifyMask |
|
||||
@@ -904,20 +904,20 @@ bool GraphicsWindowX11::setWindow(Window window)
|
||||
{
|
||||
if (_initialized)
|
||||
{
|
||||
NOTIFY(osg::NOTICE) << "GraphicsWindowX11::setWindow() - Window already created; it cannot be changed";
|
||||
OSG_NOTIFY(osg::NOTICE) << "GraphicsWindowX11::setWindow() - Window already created; it cannot be changed";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (window==0)
|
||||
{
|
||||
NOTIFY(osg::NOTICE) << "GraphicsWindowX11::setWindow() - Invalid window handle passed ";
|
||||
OSG_NOTIFY(osg::NOTICE) << "GraphicsWindowX11::setWindow() - Invalid window handle passed ";
|
||||
return false;
|
||||
}
|
||||
|
||||
_window = window;
|
||||
if (_window==0)
|
||||
{
|
||||
NOTIFY(osg::NOTICE) << "GraphicsWindowX11::setWindow() - Unable to retrieve native window handle";
|
||||
OSG_NOTIFY(osg::NOTICE) << "GraphicsWindowX11::setWindow() - Unable to retrieve native window handle";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -947,7 +947,7 @@ bool GraphicsWindowX11::realizeImplementation()
|
||||
{
|
||||
if (_realized)
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"GraphicsWindowX11::realizeImplementation() Already realized"<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"GraphicsWindowX11::realizeImplementation() Already realized"<<std::endl;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -969,7 +969,7 @@ bool GraphicsWindowX11::makeCurrentImplementation()
|
||||
{
|
||||
if (!_realized)
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"Warning: GraphicsWindow not realized, cannot do makeCurrent."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Warning: GraphicsWindow not realized, cannot do makeCurrent."<<std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -986,7 +986,7 @@ bool GraphicsWindowX11::releaseContextImplementation()
|
||||
{
|
||||
if (!_realized)
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"Warning: GraphicsWindow not realized, cannot do release context."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Warning: GraphicsWindow not realized, cannot do release context."<<std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1002,7 +1002,7 @@ bool GraphicsWindowX11::releaseContextImplementation()
|
||||
|
||||
void GraphicsWindowX11::closeImplementation()
|
||||
{
|
||||
// NOTIFY(osg::NOTICE)<<"Closing GraphicsWindowX11"<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"Closing GraphicsWindowX11"<<std::endl;
|
||||
|
||||
if (_eventDisplay)
|
||||
{
|
||||
@@ -1060,7 +1060,7 @@ void GraphicsWindowX11::swapBuffersImplementation()
|
||||
{
|
||||
if (!_realized) return;
|
||||
|
||||
// NOTIFY(osg::NOTICE)<<"swapBuffersImplementation "<<this<<" "<<OpenThreads::Thread::CurrentThread()<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"swapBuffersImplementation "<<this<<" "<<OpenThreads::Thread::CurrentThread()<<std::endl;
|
||||
|
||||
#ifdef OSG_USE_EGL
|
||||
eglSwapBuffers( _eglDisplay, _eglSurface );
|
||||
@@ -1081,7 +1081,7 @@ void GraphicsWindowX11::swapBuffersImplementation()
|
||||
{
|
||||
if (static_cast<Atom>(ev.xclient.data.l[0]) == _deleteWindow)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"DeleteWindow event received"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"DeleteWindow event received"<<std::endl;
|
||||
getEventQueue()->closeWindow();
|
||||
}
|
||||
}
|
||||
@@ -1100,7 +1100,7 @@ void GraphicsWindowX11::checkEvents()
|
||||
double resizeTime = eventTime;
|
||||
_timeOfLastCheckEvents = getEventQueue()->getTime();
|
||||
|
||||
// NOTIFY(osg::NOTICE)<<"GraphicsWindowX11::checkEvents() : getEventQueue()->getCurrentEventState()->getGraphicsContext()="<<getEventQueue()->getCurrentEventState()->getGraphicsContext()<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"GraphicsWindowX11::checkEvents() : getEventQueue()->getCurrentEventState()->getGraphicsContext()="<<getEventQueue()->getCurrentEventState()->getGraphicsContext()<<std::endl;
|
||||
|
||||
int windowX = _traits->x;
|
||||
int windowY = _traits->y;
|
||||
@@ -1111,7 +1111,7 @@ void GraphicsWindowX11::checkEvents()
|
||||
|
||||
Time firstEventTime = 0;
|
||||
|
||||
// NOTIFY(osg::NOTICE)<<"Check events"<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"Check events"<<std::endl;
|
||||
while( XPending(display) )
|
||||
{
|
||||
XEvent ev;
|
||||
@@ -1121,36 +1121,36 @@ void GraphicsWindowX11::checkEvents()
|
||||
{
|
||||
case ClientMessage:
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"ClientMessage event received"<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"ClientMessage event received"<<std::endl;
|
||||
if (static_cast<Atom>(ev.xclient.data.l[0]) == _deleteWindow)
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"DeleteWindow event received"<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"DeleteWindow event received"<<std::endl;
|
||||
// FIXME only do if _ownsWindow ?
|
||||
destroyWindowRequested = true;
|
||||
getEventQueue()->closeWindow(eventTime);
|
||||
}
|
||||
}
|
||||
case Expose :
|
||||
NOTIFY(osg::INFO)<<"Expose x="<<ev.xexpose.x<<" y="<<ev.xexpose.y<<" width="<<ev.xexpose.width<<", height="<<ev.xexpose.height<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Expose x="<<ev.xexpose.x<<" y="<<ev.xexpose.y<<" width="<<ev.xexpose.width<<", height="<<ev.xexpose.height<<std::endl;
|
||||
break;
|
||||
|
||||
case GravityNotify :
|
||||
NOTIFY(osg::INFO)<<"GravityNotify event received"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"GravityNotify event received"<<std::endl;
|
||||
break;
|
||||
|
||||
case ReparentNotify:
|
||||
NOTIFY(osg::INFO)<<"ReparentNotify event received"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"ReparentNotify event received"<<std::endl;
|
||||
break;
|
||||
|
||||
case DestroyNotify :
|
||||
NOTIFY(osg::NOTICE)<<"DestroyNotify event received"<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"DestroyNotify event received"<<std::endl;
|
||||
_realized = false;
|
||||
_valid = false;
|
||||
break;
|
||||
|
||||
case ConfigureNotify :
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"ConfigureNotify x="<<ev.xconfigure.x<<" y="<<ev.xconfigure.y<<" width="<<ev.xconfigure.width<<", height="<<ev.xconfigure.height<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"ConfigureNotify x="<<ev.xconfigure.x<<" y="<<ev.xconfigure.y<<" width="<<ev.xconfigure.width<<", height="<<ev.xconfigure.height<<std::endl;
|
||||
|
||||
if (windowX != ev.xconfigure.x ||
|
||||
windowX != ev.xconfigure.y ||
|
||||
@@ -1170,13 +1170,13 @@ void GraphicsWindowX11::checkEvents()
|
||||
|
||||
case MapNotify :
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"MapNotify"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"MapNotify"<<std::endl;
|
||||
XWindowAttributes watt;
|
||||
do
|
||||
XGetWindowAttributes(display, _window, &watt );
|
||||
while( watt.map_state != IsViewable );
|
||||
|
||||
NOTIFY(osg::INFO)<<"MapNotify x="<<watt.x<<" y="<<watt.y<<" width="<<watt.width<<", height="<<watt.height<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"MapNotify x="<<watt.x<<" y="<<watt.y<<" width="<<watt.width<<", height="<<watt.height<<std::endl;
|
||||
|
||||
if (windowWidth != watt.width || windowHeight != watt.height)
|
||||
{
|
||||
@@ -1190,14 +1190,14 @@ void GraphicsWindowX11::checkEvents()
|
||||
}
|
||||
|
||||
case FocusIn :
|
||||
NOTIFY(osg::INFO)<<"FocusIn event received"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"FocusIn event received"<<std::endl;
|
||||
flushKeyEvents();
|
||||
break;
|
||||
|
||||
case UnmapNotify :
|
||||
case FocusOut :
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"FocusOut/UnmapNotify event received"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"FocusOut/UnmapNotify event received"<<std::endl;
|
||||
if (ev.type == FocusOut && ev.xfocus.mode != NotifyNormal) break;
|
||||
|
||||
char modMap[32];
|
||||
@@ -1220,14 +1220,14 @@ void GraphicsWindowX11::checkEvents()
|
||||
}
|
||||
|
||||
case EnterNotify :
|
||||
NOTIFY(osg::INFO)<<"EnterNotify event received"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"EnterNotify event received"<<std::endl;
|
||||
_modifierState = ev.xcrossing.state;
|
||||
syncLocks();
|
||||
break;
|
||||
|
||||
case KeymapNotify :
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"KeymapNotify event received"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"KeymapNotify event received"<<std::endl;
|
||||
|
||||
// KeymapNotify is guaranteed to directly follow either a FocusIn or
|
||||
// an EnterNotify event. We are only interested in the FocusIn case.
|
||||
@@ -1270,7 +1270,7 @@ void GraphicsWindowX11::checkEvents()
|
||||
}
|
||||
|
||||
case MappingNotify :
|
||||
NOTIFY(osg::INFO)<<"MappingNotify event received"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"MappingNotify event received"<<std::endl;
|
||||
if (ev.xmapping.request == MappingModifier) rescanModifierMapping();
|
||||
break;
|
||||
|
||||
@@ -1330,7 +1330,7 @@ void GraphicsWindowX11::checkEvents()
|
||||
transformMouseXY(mx, my);
|
||||
getEventQueue()->mouseMotion(mx, my, eventTime);
|
||||
|
||||
// NOTIFY(osg::NOTICE)<<"MotionNotify wx="<<wx<<" wy="<<wy<<" mx="<<mx<<" my="<<my<<std::endl;
|
||||
// OSG_NOTIFY(osg::NOTICE)<<"MotionNotify wx="<<wx<<" wy="<<wy<<" mx="<<mx<<" my="<<my<<std::endl;
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -1430,7 +1430,7 @@ void GraphicsWindowX11::checkEvents()
|
||||
}
|
||||
|
||||
default:
|
||||
NOTIFY(osg::NOTICE)<<"Other event "<<ev.type<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Other event "<<ev.type<<std::endl;
|
||||
break;
|
||||
|
||||
}
|
||||
@@ -1643,30 +1643,30 @@ typedef int (*X11ErrorHandler)(Display*, XErrorEvent*);
|
||||
|
||||
int X11ErrorHandling(Display* display, XErrorEvent* event)
|
||||
{
|
||||
NOTIFY(osg::NOTICE)<<"Got an X11ErrorHandling call display="<<display<<" event="<<event<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE)<<"Got an X11ErrorHandling call display="<<display<<" event="<<event<<std::endl;
|
||||
|
||||
char buffer[256];
|
||||
XGetErrorText( display, event->error_code, buffer, 256);
|
||||
|
||||
NOTIFY(osg::NOTICE) << buffer << std::endl;
|
||||
NOTIFY(osg::NOTICE) << "Major opcode: " << (int)event->request_code << std::endl;
|
||||
NOTIFY(osg::NOTICE) << "Minor opcode: " << (int)event->minor_code << std::endl;
|
||||
NOTIFY(osg::NOTICE) << "Error code: " << (int)event->error_code << std::endl;
|
||||
NOTIFY(osg::NOTICE) << "Request serial: " << event->serial << std::endl;
|
||||
NOTIFY(osg::NOTICE) << "Current serial: " << NextRequest( display ) - 1 << std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE) << buffer << std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE) << "Major opcode: " << (int)event->request_code << std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE) << "Minor opcode: " << (int)event->minor_code << std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE) << "Error code: " << (int)event->error_code << std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE) << "Request serial: " << event->serial << std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE) << "Current serial: " << NextRequest( display ) - 1 << std::endl;
|
||||
|
||||
switch( event->error_code )
|
||||
{
|
||||
case BadValue:
|
||||
NOTIFY(osg::NOTICE) << " Value: " << event->resourceid << std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE) << " Value: " << event->resourceid << std::endl;
|
||||
break;
|
||||
|
||||
case BadAtom:
|
||||
NOTIFY(osg::NOTICE) << " AtomID: " << event->resourceid << std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE) << " AtomID: " << event->resourceid << std::endl;
|
||||
break;
|
||||
|
||||
default:
|
||||
NOTIFY(osg::NOTICE) << " ResourceID: " << event->resourceid << std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE) << " ResourceID: " << event->resourceid << std::endl;
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
@@ -1682,7 +1682,7 @@ class X11WindowingSystemInterface : public osg::GraphicsContext::WindowingSystem
|
||||
// responsibility of the user.
|
||||
bool _setScreen(const osg::GraphicsContext::ScreenIdentifier& si, unsigned int width, unsigned int height, unsigned int colorDepth, double rate) {
|
||||
if (colorDepth>0)
|
||||
NOTIFY(osg::NOTICE) << "X11WindowingSystemInterface::_setScreen() is not fully implemented (missing depth)."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE) << "X11WindowingSystemInterface::_setScreen() is not fully implemented (missing depth)."<<std::endl;
|
||||
|
||||
Display* display = XOpenDisplay(si.displayName().c_str());
|
||||
|
||||
@@ -1692,7 +1692,7 @@ class X11WindowingSystemInterface : public osg::GraphicsContext::WindowingSystem
|
||||
|
||||
if(!sc)
|
||||
{
|
||||
NOTIFY(osg::NOTICE) << "Unable to create XRRScreenConfiguration on display \"" << XDisplayName(si.displayName().c_str()) << "\"."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE) << "Unable to create XRRScreenConfiguration on display \"" << XDisplayName(si.displayName().c_str()) << "\"."<<std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1734,11 +1734,11 @@ class X11WindowingSystemInterface : public osg::GraphicsContext::WindowingSystem
|
||||
|
||||
if(rate > 0.0f && !rateFound)
|
||||
{
|
||||
NOTIFY(osg::NOTICE) << "Unable to find valid refresh rate " << rate << " on display \"" << XDisplayName(si.displayName().c_str()) << "\"."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE) << "Unable to find valid refresh rate " << rate << " on display \"" << XDisplayName(si.displayName().c_str()) << "\"."<<std::endl;
|
||||
}
|
||||
else if(XRRSetScreenConfigAndRate(display, sc, DefaultRootWindow(display), i, currentRot, static_cast<short>(rate), CurrentTime) != RRSetConfigSuccess)
|
||||
{
|
||||
NOTIFY(osg::NOTICE) << "Unable to set resolution to " << width << "x" << height << " on display \"" << XDisplayName(si.displayName().c_str()) << "\"."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE) << "Unable to set resolution to " << width << "x" << height << " on display \"" << XDisplayName(si.displayName().c_str()) << "\"."<<std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1754,7 +1754,7 @@ class X11WindowingSystemInterface : public osg::GraphicsContext::WindowingSystem
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(osg::NOTICE) << "Unable to open display \"" << XDisplayName(si.displayName().c_str()) << "\"."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE) << "Unable to open display \"" << XDisplayName(si.displayName().c_str()) << "\"."<<std::endl;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1767,7 +1767,7 @@ protected:
|
||||
public:
|
||||
X11WindowingSystemInterface()
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"X11WindowingSystemInterface()"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"X11WindowingSystemInterface()"<<std::endl;
|
||||
|
||||
|
||||
// Install an X11 error handler, if the application has not already done so.
|
||||
@@ -1781,13 +1781,13 @@ public:
|
||||
if ( currentHandler == defHandler )
|
||||
{
|
||||
// No application error handler, use ours.
|
||||
// NOTIFY(osg::INFO)<<"Set osgViewer X11 error handler"<<std::endl;
|
||||
// OSG_NOTIFY(osg::INFO)<<"Set osgViewer X11 error handler"<<std::endl;
|
||||
_errorHandlerSet = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Application error handler exists, leave it set.
|
||||
// NOTIFY(osg::INFO)<<"Existing application X11 error handler set"<<std::endl;
|
||||
// OSG_NOTIFY(osg::INFO)<<"Existing application X11 error handler set"<<std::endl;
|
||||
_errorHandlerSet = 0;
|
||||
XSetErrorHandler(currentHandler);
|
||||
}
|
||||
@@ -1795,12 +1795,12 @@ public:
|
||||
#if 0
|
||||
if (XInitThreads() == 0)
|
||||
{
|
||||
NOTIFY(osg::NOTICE) << "Error: XInitThreads() failed. Aborting." << std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE) << "Error: XInitThreads() failed. Aborting." << std::endl;
|
||||
exit(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(osg::INFO) << "X11WindowingSystemInterface, xInitThreads() multi-threaded X support initialized.\n";
|
||||
OSG_NOTIFY(osg::INFO) << "X11WindowingSystemInterface, xInitThreads() multi-threaded X support initialized.\n";
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1816,7 +1816,7 @@ public:
|
||||
osg::Referenced::getDeleteHandler()->flushAll();
|
||||
}
|
||||
|
||||
//NOTIFY(osg::NOTICE)<<"~X11WindowingSystemInterface()"<<std::endl;
|
||||
//OSG_NOTIFY(osg::NOTICE)<<"~X11WindowingSystemInterface()"<<std::endl;
|
||||
|
||||
// Unset our X11 error handler, providing the application has not replaced it.
|
||||
|
||||
@@ -1825,12 +1825,12 @@ public:
|
||||
X11ErrorHandler currentHandler = XSetErrorHandler(NULL);
|
||||
if ( currentHandler == X11ErrorHandling )
|
||||
{
|
||||
// NOTIFY(osg::INFO)<<"osgViewer X11 error handler removed"<<std::endl;
|
||||
// OSG_NOTIFY(osg::INFO)<<"osgViewer X11 error handler removed"<<std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Not our error handler, leave it set.
|
||||
// NOTIFY(osg::INFO)<<"Application X11 error handler left"<<std::endl;
|
||||
// OSG_NOTIFY(osg::INFO)<<"Application X11 error handler left"<<std::endl;
|
||||
XSetErrorHandler(currentHandler);
|
||||
}
|
||||
}
|
||||
@@ -1848,7 +1848,7 @@ public:
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(osg::NOTICE) << "A Unable to open display \"" << XDisplayName(si.displayName().c_str()) << "\""<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE) << "A Unable to open display \"" << XDisplayName(si.displayName().c_str()) << "\""<<std::endl;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -1883,7 +1883,7 @@ public:
|
||||
}
|
||||
else
|
||||
{
|
||||
NOTIFY(osg::NOTICE) << "Unable to open display \"" << XDisplayName(si.displayName().c_str()) << "\"."<<std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE) << "Unable to open display \"" << XDisplayName(si.displayName().c_str()) << "\"."<<std::endl;
|
||||
resolution.width = 0;
|
||||
resolution.height = 0;
|
||||
resolution.colorDepth = 0;
|
||||
@@ -1896,7 +1896,7 @@ public:
|
||||
#ifdef OSGVIEWER_USE_XRANDR
|
||||
_setScreen(si, resolution.width, resolution.height, resolution.colorDepth, resolution.refreshRate);
|
||||
#else
|
||||
NOTIFY(osg::NOTICE) << "You must build osgViewer with Xrandr 1.2 or higher for setScreenSettings support!" << std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE) << "You must build osgViewer with Xrandr 1.2 or higher for setScreenSettings support!" << std::endl;
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
@@ -1919,7 +1919,7 @@ public:
|
||||
{
|
||||
for(int i=0; i<nsizes; ++i)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"Screen size "<<screenSizes[i].width<<" "<<screenSizes[i].height<<" "<<screenSizes[i].mwidth<<" "<<screenSizes[i].mheight<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"Screen size "<<screenSizes[i].width<<" "<<screenSizes[i].height<<" "<<screenSizes[i].mwidth<<" "<<screenSizes[i].mheight<<std::endl;
|
||||
|
||||
int nrates;
|
||||
short * rates = XRRRates (display, si.screenNum, i, &nrates);
|
||||
@@ -1927,7 +1927,7 @@ public:
|
||||
{
|
||||
for(int j=0; j<nrates; ++j)
|
||||
{
|
||||
NOTIFY(osg::INFO)<<" rates "<<rates[j]<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<" rates "<<rates[j]<<std::endl;
|
||||
|
||||
resolutionList.push_back(osg::GraphicsContext::ScreenSettings(
|
||||
screenSizes[i].width,
|
||||
@@ -1954,7 +1954,7 @@ public:
|
||||
|
||||
if (resolutionList.empty())
|
||||
{
|
||||
NOTIFY(osg::NOTICE) << "X11WindowingSystemInterface::enumerateScreenSettings() not supported." << std::endl;
|
||||
OSG_NOTIFY(osg::NOTICE) << "X11WindowingSystemInterface::enumerateScreenSettings() not supported." << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1986,13 +1986,13 @@ struct RegisterWindowingSystemInterfaceProxy
|
||||
{
|
||||
RegisterWindowingSystemInterfaceProxy()
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"RegisterWindowingSystemInterfaceProxy()"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"RegisterWindowingSystemInterfaceProxy()"<<std::endl;
|
||||
osg::GraphicsContext::setWindowingSystemInterface(new X11WindowingSystemInterface);
|
||||
}
|
||||
|
||||
~RegisterWindowingSystemInterfaceProxy()
|
||||
{
|
||||
NOTIFY(osg::INFO)<<"~RegisterWindowingSystemInterfaceProxy()"<<std::endl;
|
||||
OSG_NOTIFY(osg::INFO)<<"~RegisterWindowingSystemInterfaceProxy()"<<std::endl;
|
||||
|
||||
if (osg::Referenced::getDeleteHandler())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user