00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054 #ifndef _OSGWIN32WINDOWBASE_H_
00055 #define _OSGWIN32WINDOWBASE_H_
00056 #ifdef __sgi
00057 #pragma once
00058 #endif
00059
00060
00061 #include <OSGConfig.h>
00062 #include <OSGWindowWIN32Def.h>
00063
00064 #include <OSGBaseTypes.h>
00065 #include <OSGRefPtr.h>
00066 #include <OSGCoredNodePtr.h>
00067
00068 #include <OSGWindow.h>
00069
00070 #include <OSGWIN32WindowDataFields.h>
00071 #include <OSGWIN32WindowDataFields.h>
00072 #include <OSGWIN32WindowDataFields.h>
00073
00074 #include <OSGWIN32WindowFields.h>
00075
00076 OSG_BEGIN_NAMESPACE
00077
00078 class WIN32Window;
00079 class BinaryDataHandler;
00080
00082
00083 class OSG_WINDOWWIN32LIB_DLLMAPPING WIN32WindowBase : public Window
00084 {
00085 private:
00086
00087 typedef Window Inherited;
00088
00089
00090 public:
00091
00092 typedef WIN32WindowPtr Ptr;
00093
00094 enum
00095 {
00096 HwndFieldId = Inherited::NextFieldId,
00097 HdcFieldId = HwndFieldId + 1,
00098 HglrcFieldId = HdcFieldId + 1,
00099 NextFieldId = HglrcFieldId + 1
00100 };
00101
00102 static const OSG::BitVector HwndFieldMask;
00103 static const OSG::BitVector HdcFieldMask;
00104 static const OSG::BitVector HglrcFieldMask;
00105
00106
00107 static const OSG::BitVector MTInfluenceMask;
00108
00109
00113 static FieldContainerType &getClassType (void);
00114 static UInt32 getClassTypeId (void);
00115
00117
00121 virtual FieldContainerType &getType (void);
00122 virtual const FieldContainerType &getType (void) const;
00123
00124 virtual UInt32 getContainerSize(void) const;
00125
00127
00131 SFHWND *getSFHwnd (void);
00132 SFHDC *getSFHdc (void);
00133 SFHGLRC *getSFHglrc (void);
00134
00135 HWND &getHwnd (void);
00136 const HWND &getHwnd (void) const;
00137 HDC &getHdc (void);
00138 const HDC &getHdc (void) const;
00139 HGLRC &getHglrc (void);
00140 const HGLRC &getHglrc (void) const;
00141
00143
00147 void setHwnd ( const HWND &value );
00148 void setHdc ( const HDC &value );
00149 void setHglrc ( const HGLRC &value );
00150
00152
00157
00161 virtual UInt32 getBinSize (const BitVector &whichField);
00162 virtual void copyToBin ( BinaryDataHandler &pMem,
00163 const BitVector &whichField);
00164 virtual void copyFromBin( BinaryDataHandler &pMem,
00165 const BitVector &whichField);
00166
00167
00169
00173 static WIN32WindowPtr create (void);
00174 static WIN32WindowPtr createEmpty (void);
00175
00178
00182 virtual FieldContainerPtr shallowCopy (void) const;
00183
00185
00186 protected:
00187
00188
00192 SFHWND _sfHwnd;
00193 SFHDC _sfHdc;
00194 SFHGLRC _sfHglrc;
00195
00197
00201 WIN32WindowBase(void);
00202 WIN32WindowBase(const WIN32WindowBase &source);
00203
00205
00209 virtual ~WIN32WindowBase(void);
00210
00212
00216 #if !defined(OSG_FIXED_MFIELDSYNC)
00217 void executeSyncImpl( WIN32WindowBase *pOther,
00218 const BitVector &whichField);
00219
00220 virtual void executeSync( FieldContainer &other,
00221 const BitVector &whichField);
00222 #else
00223 void executeSyncImpl( WIN32WindowBase *pOther,
00224 const BitVector &whichField,
00225 const SyncInfo &sInfo );
00226
00227 virtual void executeSync( FieldContainer &other,
00228 const BitVector &whichField,
00229 const SyncInfo &sInfo);
00230
00231 virtual void execBeginEdit (const BitVector &whichField,
00232 UInt32 uiAspect,
00233 UInt32 uiContainerSize);
00234
00235 void execBeginEditImpl (const BitVector &whichField,
00236 UInt32 uiAspect,
00237 UInt32 uiContainerSize);
00238
00239 virtual void onDestroyAspect(UInt32 uiId, UInt32 uiAspect);
00240 #endif
00241
00243
00244 private:
00245
00246 friend class FieldContainer;
00247
00248 static FieldDescription *_desc[];
00249 static FieldContainerType _type;
00250
00251
00252
00253 void operator =(const WIN32WindowBase &source);
00254 };
00255
00256
00257
00258
00259
00260
00261 typedef WIN32WindowBase *WIN32WindowBaseP;
00262
00263 typedef osgIF<WIN32WindowBase::isNodeCore,
00264 CoredNodePtr<WIN32Window>,
00265 FieldContainer::attempt_to_create_CoredNodePtr_on_non_NodeCore_FC
00266 >::_IRet WIN32WindowNodePtr;
00267
00268 typedef RefPtr<WIN32WindowPtr> WIN32WindowRefPtr;
00269
00270 OSG_END_NAMESPACE
00271
00272 #define OSGWIN32WINDOWBASE_HEADER_CVSID "@(#)$Id: FCBaseTemplate_h.h,v 1.38 2005/07/08 06:37:35 vossg Exp $"
00273
00274 #endif