Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

OSGXWindowDataFields.h

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002  *                                OpenSG                                     *
00003  *                                                                           *
00004  *                                                                           *
00005  *             Copyright (C) 2000-2002 by the OpenSG Forum                   *
00006  *                                                                           *
00007  *                            www.opensg.org                                 *
00008  *                                                                           *
00009  *   contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de          *
00010  *                                                                           *
00011 \*---------------------------------------------------------------------------*/
00012 /*---------------------------------------------------------------------------*\
00013  *                                License                                    *
00014  *                                                                           *
00015  * This library is free software; you can redistribute it and/or modify it   *
00016  * under the terms of the GNU Library General Public License as published    *
00017  * by the Free Software Foundation, version 2.                               *
00018  *                                                                           *
00019  * This library is distributed in the hope that it will be useful, but       *
00020  * WITHOUT ANY WARRANTY; without even the implied warranty of                *
00021  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU         *
00022  * Library General Public License for more details.                          *
00023  *                                                                           *
00024  * You should have received a copy of the GNU Library General Public         *
00025  * License along with this library; if not, write to the Free Software       *
00026  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.                 *
00027  *                                                                           *
00028 \*---------------------------------------------------------------------------*/
00029 /*---------------------------------------------------------------------------*\
00030  *                                Changes                                    *
00031  *                                                                           *
00032  *                                                                           *
00033  *                                                                           *
00034  *                                                                           *
00035  *                                                                           *
00036  *                                                                           *
00037 \*---------------------------------------------------------------------------*/
00038 
00039 
00040 #ifndef _OSGXWINDOWDATAFIELDS_H_
00041 #define _OSGXWINDOWDATAFIELDS_H_
00042 #ifdef __sgi
00043 #pragma once
00044 #endif
00045 
00046 
00047 #include <OSGConfig.h>
00048 
00049 #include <GL/glx.h>
00050 
00051 #include <OSGWindowXDef.h>
00052 
00053 #include <OSGBaseTypes.h>
00054 #include <OSGFieldDataType.h>
00055 
00056 
00057 OSG_BEGIN_NAMESPACE
00058 
00059 
00060 typedef Display *DisplayP;
00061 typedef ::Window X11Window;
00062 
00063 #if !defined(OSG_DO_DOC) || (OSG_DOC_LEVEL >= 3)
00064 
00065 
00068 #if !defined(OSG_DOC_DEV_TRAITS)
00069 
00070 #endif
00071 
00072 template <>
00073 struct OSG_WINDOWXLIB_DLLMAPPING FieldDataTraits<DisplayP> : 
00074     public FieldTraitsRecurseBase<DisplayP>
00075 {
00076     static DataType             _type;                       
00077 
00078     enum                        { StringConvertable = ToStringConvertable };
00079     enum                        { bHasParent        = 0x00                };
00080 
00081     static DataType &getType (void) { return _type;        }
00082 
00083     static char     *getSName(void) { return "SFDisplayP"; }
00084     static char     *getMName(void) { return "MFDisplayP"; }
00085 
00086     static bool      getFromString(      DisplayP      &display,
00087                                    const Char8         *)
00088     {
00089         display=NULL;
00090         return true;
00091     }
00092 
00093     static void      putToString  (const      DisplayP &,
00094                                          std::string   &outStr)
00095     {
00096         outStr.assign("DisplayP");
00097     }
00098 };
00099 
00100 #if !defined(OSG_DOC_DEV_TRAITS)
00101 
00103 #endif
00104 
00107 #if !defined(OSG_DOC_DEV_TRAITS)
00108 
00109 #endif
00110 #if ( !defined(__GNUC__) || !defined(__linux) || ( !defined(__ia64) && !defined(__x86_64) ) ) && (!defined(_MIPS_SZPTR) || _MIPS_SZPTR != 64 )
00111 template <>
00112 struct OSG_WINDOWXLIB_DLLMAPPING FieldDataTraits<X11Window> : 
00113     public FieldTraitsRecurseBase<X11Window>
00114 {
00115     static DataType             _type;                       
00116 
00117     enum                        { StringConvertable = ToStringConvertable };
00118     enum                        { bHasParent        = 0x00 };
00119 
00120     static DataType &getType (void) { return _type;        }
00121 
00122     static char     *getSName(void) { return "SFX11Window"; }
00123     static char     *getMName(void) { return "MFX11Window"; }
00124 
00125     static bool      getFromString(      X11Window     &window,
00126                                    const Char8         *)
00127     {
00128         window=0;
00129         return true;
00130     }
00131 
00132     static void      putToString  (const      X11Window &,
00133                                          std::string    &outStr)
00134     {
00135         outStr.assign("X11Window");
00136     }
00137 };
00138 #endif
00139 
00140 #if !defined(OSG_DOC_DEV_TRAITS)
00141 
00143 #endif
00144 
00145 template <>
00146 struct OSG_WINDOWXLIB_DLLMAPPING FieldDataTraits1<GLXContext> : 
00147     public FieldTraitsRecurseBase1<GLXContext>
00148 {
00149     static DataType             _type;                       
00150 
00151     enum                        { StringConvertable = ToStringConvertable };
00152     enum                        { bHasParent        = 0x00 };
00153 
00154     static DataType &getType (void) { return _type;        }
00155 
00156     static char     *getSName(void) { return "SFGLXContext"; }
00157     static char     *getMName(void) { return "MFGLXContext"; }
00158 
00159     static bool      getFromString(      GLXContext    &context,
00160                                    const Char8         *)
00161     {
00162         context=NULL;
00163         return true;
00164     }
00165 
00166     static void      putToString  (const      GLXContext &,
00167                                          std::string     &outStr)
00168     {
00169         outStr.assign("GLXContext");
00170     }
00171 };
00172 
00173 #if !defined(OSG_DOC_DEV_TRAITS)
00174 
00176 #endif
00177 
00178 #endif // !defined(OSG_DO_DOC) || (OSG_DOC_LEVEL >= 3)
00179 
00180 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_FIELD_TYPEDEFS)
00181 
00185 typedef SField<DisplayP> SFDisplayP;
00186 
00190 typedef MField<DisplayP> MFDisplayP;
00191 
00192 #if (!defined(__GNUC__) || !defined(__linux) || !defined(__ia64)) || (defined(_MIPS_SZPTR) && _MIPS_SZPTR != 64 )
00193 
00197 typedef SField<X11Window> SFX11Window;
00198 
00202 typedef MField<X11Window> MFX11Window;
00203 
00204 #else
00205 
00209 typedef SField<UInt64> SFX11Window;
00210 
00214 typedef MField<UInt64> MFX11Window;
00215 
00216 #endif
00217 
00221 typedef SField<GLXContext, 1> SFGLXContext;
00222 
00226 typedef MField<GLXContext, 1> MFGLXContext;
00227 
00228 #endif
00229 
00230 // Instantiations
00231 
00232 #ifndef OSG_COMPILEWINDOWXINST
00233 OSG_DLLEXPORT_DECL1(SField, DisplayP,      OSG_WINDOWXLIB_DLLTMPLMAPPING)
00234 OSG_DLLEXPORT_DECL1(SField, X11Window,     OSG_WINDOWXLIB_DLLTMPLMAPPING)
00235 OSG_DLLEXPORT_DECL2(SField, GLXContext, 1, OSG_WINDOWXLIB_DLLTMPLMAPPING)
00236 
00237 OSG_DLLEXPORT_DECL1(MField, DisplayP,      OSG_WINDOWXLIB_DLLTMPLMAPPING)
00238 OSG_DLLEXPORT_DECL1(MField, X11Window,     OSG_WINDOWXLIB_DLLTMPLMAPPING)
00239 OSG_DLLEXPORT_DECL2(MField, GLXContext, 1, OSG_WINDOWXLIB_DLLTMPLMAPPING)
00240 #endif
00241 
00242 OSG_END_NAMESPACE
00243 
00244 #define OSGWINDOWXFIELDS_HEADER_CVSID "@(#)$Id: $"
00245 
00246 #endif /* _OSGXWINDOWDATAFIELDS_H_ */
00247 

Generated on Thu Aug 25 04:12:20 2005 for OpenSG by  doxygen 1.4.3