/* -*-c++-*- Producer - Copyright (C) 2001-2004  Don Burns
 *
 * This library is open source and may be redistributed and/or modified under
 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
 * (at your option) any later version.  The full license is in LICENSE file
 * included with this distribution, and on the openscenegraph.org website.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * OpenSceneGraph Public License for more details.
 */

#ifndef PRODUCER_TYPES
#define PRODUCER_TYPES 1

#include <Producer/Export>

#ifdef _WIN32_IMPLEMENTATION
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN 1
#endif
    #include <windows.h>
    #include <GL/gl.h>

    namespace Producer {

        typedef HDC      Display;
        typedef HWND     Window;
        typedef HGLRC    GLContext;
        typedef WPARAM   KeySymbol;
        typedef HCURSOR  Cursor;
        typedef PIXELFORMATDESCRIPTOR  VisualInfo;
    
    }
#endif

#ifdef _X11_IMPLEMENTATION

    #include <X11/Xlib.h>  
    #include <X11/Xutil.h>

    #define GLX_GLXEXT_PROTOTYPES  1
    #include <GL/glx.h>

    namespace Producer {

        // Display, Window and Cursor natively defined
        typedef ::Display  Display;
        typedef ::Window   Window;
        typedef ::Cursor   Cursor;
        typedef GLXContext GLContext;
#ifdef GLX_VERSION_1_3
        typedef GLXPbuffer Pbuffer;
#endif
        typedef KeySym    KeySymbol;
        typedef XVisualInfo VisualInfo;

    }

#endif

#ifdef _OSX_CGL_IMPLEMENTATION

    #include <Carbon/Carbon.h>                                                                        
    #include <OpenGL/OpenGL.h>                                                                        
    #include <OpenGL/gl.h>                                                                        
                                                                                                      
    namespace Producer {                                                                              
                                                                                                      
        typedef CGDirectDisplayID  Display;                                                           
        typedef int                Window;                                                            
        typedef CGLContextObj      GLContext;                                                         
        typedef int                KeySymbol;                                                         
        typedef int                Cursor;                                                            
        typedef CGLPixelFormatObj  VisualInfo;                                                        
    }                                                                                                 
#endif                                                                                                

#ifdef _OSX_AGL_IMPLEMENTATION

    #include <Carbon/Carbon.h>                                                                        
    #include <OpenGL/OpenGL.h>                                                                        
    #include <OpenGL/gl.h>                                                                        
    #include <AGL/agl.h>                                                                       
                                                                                                      
    namespace Producer {                                                                              
                                                                                                      
        typedef CGDirectDisplayID  Display;                                                           
        typedef WindowRef          Window;                                                            
        typedef AGLContext         GLContext;                                                         
        typedef int                KeySymbol;                                                         
        typedef int                Cursor;                                                            
        typedef AGLPixelFormat     VisualInfo;                                                        
    }                                                                                                 
#endif                                                                                                
                                                                                                      
#ifdef D2W_DOXYGEN
//Doxygen usage only

    namespace Producer {

        typedef void*  Display;
        typedef void*  Window;
        typedef void*  GLContext;
        typedef long   KeySymbol;
        typedef void*  Cursor;
        typedef void*  VisualInfo;
    }

#endif


namespace Producer {

template <class T> class ref_ptr;
template <class T> class BlockingQueue;

class EventQueue;
class Event;
//typedef BlockingQueue <ref_ptr<Event> > EventQueue;

}

#endif
