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

OSGWIN32WindowDataFields.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 _OSGWIN32WINDOWDATAFIELDS_H_
00041 #define _OSGWIN32WINDOWDATAFIELDS_H_
00042 #ifdef __sgi
00043 #pragma once
00044 #endif
00045 
00046 
00047 #include <OSGConfig.h>
00048 
00049 // Forget everything if we're not doing a windows compile
00050 #ifdef WIN32
00051 
00052 #include <OSGBaseTypes.h>
00053 #include <OSGFieldDataType.h>
00054 #include <OSGSField.h>
00055 #include <OSGMField.h>
00056 #include <OSGWindowWIN32Def.h>
00057 
00058 #include <windows.h>
00059 
00062 OSG_BEGIN_NAMESPACE
00063 
00064 template <>
00065 struct OSG_WINDOWWIN32LIB_DLLMAPPING FieldDataTraits<HWND> : 
00066     public FieldTraitsRecurseBase<HWND>
00067 {
00068     static DataType             _type;                       
00069 
00070     enum                        { StringConvertable = ToStringConvertable };
00071     enum                        { bHasParent        = 0x00 };
00072 
00073     static DataType &getType (void) { return _type;        }
00074 
00075     static char     *getSName(void) { return "SFHWND"; }
00076     static char     *getMName(void) { return "MFHWND"; }
00077 
00078     static bool      getFromString(      HWND          &,
00079                                    const Char8         *)
00080     {
00081         return true;
00082     }
00083 
00084     static void      putToString  (const      HWND   &,
00085                                          std::string &outStr)
00086     {
00087         outStr.assign("HWND");
00088     }
00089 };
00090 
00091 template <>
00092 struct OSG_WINDOWWIN32LIB_DLLMAPPING FieldDataTraits<HDC> : 
00093     public FieldTraitsRecurseBase<HDC>
00094 {
00095     static DataType             _type;                       
00096 
00097     enum                        { StringConvertable = ToStringConvertable };
00098     enum                        { bHasParent        = 0x00 };
00099 
00100     static DataType &getType (void) { return _type;        }
00101 
00102     static char     *getSName(void) { return "SFHDC"; }
00103     static char     *getMName(void) { return "MFHDC"; }
00104 
00105     static bool      getFromString(      HDC           &,
00106                                    const Char8         *)
00107     {
00108         return true;
00109     }
00110 
00111     static void      putToString  (const      HDC    &,
00112                                          std::string &outStr)
00113     {
00114         outStr.assign("HDC");
00115     }
00116 };
00117 
00118 template <>
00119 struct OSG_WINDOWWIN32LIB_DLLMAPPING FieldDataTraits<HGLRC> : 
00120     public FieldTraitsRecurseBase<HGLRC>
00121 {
00122     static DataType             _type;                       
00123 
00124     enum                        { StringConvertable = ToStringConvertable };
00125     enum                        { bHasParent        = 0x00 };
00126 
00127     static DataType &getType (void) { return _type;        }
00128 
00129     static char     *getSName(void) { return "SFHGLRC"; }
00130     static char     *getMName(void) { return "MFHGLRC"; }
00131 
00132     static bool      getFromString(      HGLRC         &,
00133                                    const Char8         *)
00134     {
00135         return true;
00136     }
00137 
00138     static void      putToString  (const       HGLRC &,
00139                                          std::string &outStr)
00140     {
00141         outStr.assign("HGLRC");
00142     }
00143 };
00144 
00145 template <>
00146 struct OSG_WINDOWWIN32LIB_DLLMAPPING FieldDataTraits<PAINTSTRUCT> : 
00147     public FieldTraitsRecurseBase<PAINTSTRUCT>
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 "SFPAINTSTRUCT"; }
00157     static char     *getMName(void) { return "MFPAINTSTRUCT"; }
00158 
00159     static bool      getFromString(      PAINTSTRUCT   &,
00160                                    const Char8         *)
00161     {
00162         return true;
00163     }
00164 
00165     static void      putToString  (const      PAINTSTRUCT &,
00166                                          std::string      &outStr)
00167     {
00168         outStr.assign("PAINTSTRUCT");
00169     }
00170 };
00171 
00174 
00175 typedef SField<HWND> SFHWND;
00176 
00179 
00180 typedef MField<HWND> MFHWND;
00181 
00184 
00185 typedef SField<HDC> SFHDC;
00186 
00189 
00190 typedef MField<HDC> MFHDC;
00191 
00194 
00195 typedef SField<HGLRC> SFHGLRC;
00196 
00199 
00200 typedef MField<HGLRC> MFHGLRC;
00201 
00204 
00205 typedef SField<PAINTSTRUCT> SFPAINTSTRUCT;
00206 
00209 
00210 #ifndef OSG_MICROSOFT_COMPILER_HACKS
00211 typedef MField<PAINTSTRUCT> MFPAINTSTRUCT;
00212 #endif
00213 
00214 // Instantiations
00215 
00216 #ifndef OSG_COMPILEWIN32WINDOWINST
00217 
00218 OSG_DLLEXPORT_DECL1(SField, HWND,        OSG_WINDOWWIN32LIB_DLLTMPLMAPPING)
00219 OSG_DLLEXPORT_DECL1(SField, HDC,         OSG_WINDOWWIN32LIB_DLLTMPLMAPPING)
00220 OSG_DLLEXPORT_DECL1(SField, HGLRC,       OSG_WINDOWWIN32LIB_DLLTMPLMAPPING)
00221 OSG_DLLEXPORT_DECL1(SField, PAINTSTRUCT, OSG_WINDOWWIN32LIB_DLLTMPLMAPPING)
00222 
00223 OSG_DLLEXPORT_DECL1(MField, HWND,        OSG_WINDOWWIN32LIB_DLLTMPLMAPPING)
00224 OSG_DLLEXPORT_DECL1(MField, HDC,         OSG_WINDOWWIN32LIB_DLLTMPLMAPPING)
00225 OSG_DLLEXPORT_DECL1(MField, HGLRC,       OSG_WINDOWWIN32LIB_DLLTMPLMAPPING)
00226 
00227 #ifndef OSG_MICROSOFT_COMPILER_HACKS
00228 OSG_DLLEXPORT_DECL1(MField, PAINTSTRUCT, OSG_WINDOWWIN32LIB_DLLTMPLMAPPING)
00229 #endif
00230 
00231 #endif
00232 
00233 OSG_END_NAMESPACE
00234 
00235 #define OSGWINDOWWIN32DATAFIELDS_HEADER_CVSID "@(#)$Id: OSGWIN32WindowDataFields.h,v 1.4 2002/02/17 18:43:14 dirk Exp $"
00236 
00237 #endif /* WIN32 */
00238 
00239 #endif /* _OSGWIN32WINDOWDATAFIELDS_H_ */

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