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 #define OSG_COMPILEXWINDOWINST
00055
00056 #include <stdlib.h>
00057 #include <stdio.h>
00058
00059 #include <OSGConfig.h>
00060
00061 #include "OSGXWindowBase.h"
00062 #include "OSGXWindow.h"
00063
00064
00065 OSG_BEGIN_NAMESPACE
00066
00067 const OSG::BitVector XWindowBase::DisplayFieldMask =
00068 (TypeTraits<BitVector>::One << XWindowBase::DisplayFieldId);
00069
00070 const OSG::BitVector XWindowBase::WindowFieldMask =
00071 (TypeTraits<BitVector>::One << XWindowBase::WindowFieldId);
00072
00073 const OSG::BitVector XWindowBase::ContextFieldMask =
00074 (TypeTraits<BitVector>::One << XWindowBase::ContextFieldId);
00075
00076 const OSG::BitVector XWindowBase::MTInfluenceMask =
00077 (Inherited::MTInfluenceMask) |
00078 (static_cast<BitVector>(0x0) << Inherited::NextFieldId);
00079
00080
00081
00082
00093
00094
00095 FieldDescription *XWindowBase::_desc[] =
00096 {
00097 new FieldDescription(SFDisplayP::getClassType(),
00098 "display",
00099 DisplayFieldId, DisplayFieldMask,
00100 true,
00101 reinterpret_cast<FieldAccessMethod>(&XWindowBase::editSFDisplay)),
00102 new FieldDescription(SFX11Window::getClassType(),
00103 "window",
00104 WindowFieldId, WindowFieldMask,
00105 true,
00106 reinterpret_cast<FieldAccessMethod>(&XWindowBase::editSFWindow)),
00107 new FieldDescription(SFGLXContext::getClassType(),
00108 "context",
00109 ContextFieldId, ContextFieldMask,
00110 true,
00111 reinterpret_cast<FieldAccessMethod>(&XWindowBase::editSFContext))
00112 };
00113
00114
00115 FieldContainerType XWindowBase::_type(
00116 "XWindow",
00117 "Window",
00118 NULL,
00119 reinterpret_cast<PrototypeCreateF>(&XWindowBase::createEmpty),
00120 XWindow::initMethod,
00121 _desc,
00122 sizeof(_desc));
00123
00124
00125
00126
00127
00128 FieldContainerType &XWindowBase::getType(void)
00129 {
00130 return _type;
00131 }
00132
00133 const FieldContainerType &XWindowBase::getType(void) const
00134 {
00135 return _type;
00136 }
00137
00138
00139 FieldContainerPtr XWindowBase::shallowCopy(void) const
00140 {
00141 XWindowPtr returnValue;
00142
00143 newPtr(returnValue, dynamic_cast<const XWindow *>(this));
00144
00145 return returnValue;
00146 }
00147
00148 UInt32 XWindowBase::getContainerSize(void) const
00149 {
00150 return sizeof(XWindow);
00151 }
00152
00153
00154 #if !defined(OSG_FIXED_MFIELDSYNC)
00155 void XWindowBase::executeSync( FieldContainer &other,
00156 const BitVector &whichField)
00157 {
00158 this->executeSyncImpl(static_cast<XWindowBase *>(&other),
00159 whichField);
00160 }
00161 #else
00162 void XWindowBase::executeSync( FieldContainer &other,
00163 const BitVector &whichField, const SyncInfo &sInfo )
00164 {
00165 this->executeSyncImpl((XWindowBase *) &other, whichField, sInfo);
00166 }
00167 void XWindowBase::execBeginEdit(const BitVector &whichField,
00168 UInt32 uiAspect,
00169 UInt32 uiContainerSize)
00170 {
00171 this->execBeginEditImpl(whichField, uiAspect, uiContainerSize);
00172 }
00173
00174 void XWindowBase::onDestroyAspect(UInt32 uiId, UInt32 uiAspect)
00175 {
00176 Inherited::onDestroyAspect(uiId, uiAspect);
00177
00178 }
00179 #endif
00180
00181
00182
00183 #ifdef OSG_WIN32_ICL
00184 #pragma warning (disable : 383)
00185 #endif
00186
00187 XWindowBase::XWindowBase(void) :
00188 _sfDisplay (DisplayP(NULL)),
00189 _sfWindow (),
00190 _sfContext (),
00191 Inherited()
00192 {
00193 }
00194
00195 #ifdef OSG_WIN32_ICL
00196 #pragma warning (default : 383)
00197 #endif
00198
00199 XWindowBase::XWindowBase(const XWindowBase &source) :
00200 _sfDisplay (source._sfDisplay ),
00201 _sfWindow (source._sfWindow ),
00202 _sfContext (source._sfContext ),
00203 Inherited (source)
00204 {
00205 }
00206
00207
00208
00209 XWindowBase::~XWindowBase(void)
00210 {
00211 }
00212
00213
00214
00215 UInt32 XWindowBase::getBinSize(const BitVector &whichField)
00216 {
00217 UInt32 returnValue = Inherited::getBinSize(whichField);
00218
00219 if(FieldBits::NoField != (DisplayFieldMask & whichField))
00220 {
00221 returnValue += _sfDisplay.getBinSize();
00222 }
00223
00224 if(FieldBits::NoField != (WindowFieldMask & whichField))
00225 {
00226 returnValue += _sfWindow.getBinSize();
00227 }
00228
00229 if(FieldBits::NoField != (ContextFieldMask & whichField))
00230 {
00231 returnValue += _sfContext.getBinSize();
00232 }
00233
00234
00235 return returnValue;
00236 }
00237
00238 void XWindowBase::copyToBin( BinaryDataHandler &pMem,
00239 const BitVector &whichField)
00240 {
00241 Inherited::copyToBin(pMem, whichField);
00242
00243 if(FieldBits::NoField != (DisplayFieldMask & whichField))
00244 {
00245 _sfDisplay.copyToBin(pMem);
00246 }
00247
00248 if(FieldBits::NoField != (WindowFieldMask & whichField))
00249 {
00250 _sfWindow.copyToBin(pMem);
00251 }
00252
00253 if(FieldBits::NoField != (ContextFieldMask & whichField))
00254 {
00255 _sfContext.copyToBin(pMem);
00256 }
00257
00258
00259 }
00260
00261 void XWindowBase::copyFromBin( BinaryDataHandler &pMem,
00262 const BitVector &whichField)
00263 {
00264 Inherited::copyFromBin(pMem, whichField);
00265
00266 if(FieldBits::NoField != (DisplayFieldMask & whichField))
00267 {
00268 _sfDisplay.copyFromBin(pMem);
00269 }
00270
00271 if(FieldBits::NoField != (WindowFieldMask & whichField))
00272 {
00273 _sfWindow.copyFromBin(pMem);
00274 }
00275
00276 if(FieldBits::NoField != (ContextFieldMask & whichField))
00277 {
00278 _sfContext.copyFromBin(pMem);
00279 }
00280
00281
00282 }
00283
00284 #if !defined(OSG_FIXED_MFIELDSYNC)
00285 void XWindowBase::executeSyncImpl( XWindowBase *pOther,
00286 const BitVector &whichField)
00287 {
00288
00289 Inherited::executeSyncImpl(pOther, whichField);
00290
00291 if(FieldBits::NoField != (DisplayFieldMask & whichField))
00292 _sfDisplay.syncWith(pOther->_sfDisplay);
00293
00294 if(FieldBits::NoField != (WindowFieldMask & whichField))
00295 _sfWindow.syncWith(pOther->_sfWindow);
00296
00297 if(FieldBits::NoField != (ContextFieldMask & whichField))
00298 _sfContext.syncWith(pOther->_sfContext);
00299
00300
00301 }
00302 #else
00303 void XWindowBase::executeSyncImpl( XWindowBase *pOther,
00304 const BitVector &whichField,
00305 const SyncInfo &sInfo )
00306 {
00307
00308 Inherited::executeSyncImpl(pOther, whichField, sInfo);
00309
00310 if(FieldBits::NoField != (DisplayFieldMask & whichField))
00311 _sfDisplay.syncWith(pOther->_sfDisplay);
00312
00313 if(FieldBits::NoField != (WindowFieldMask & whichField))
00314 _sfWindow.syncWith(pOther->_sfWindow);
00315
00316 if(FieldBits::NoField != (ContextFieldMask & whichField))
00317 _sfContext.syncWith(pOther->_sfContext);
00318
00319
00320
00321 }
00322
00323 void XWindowBase::execBeginEditImpl (const BitVector &whichField,
00324 UInt32 uiAspect,
00325 UInt32 uiContainerSize)
00326 {
00327 Inherited::execBeginEditImpl(whichField, uiAspect, uiContainerSize);
00328
00329 }
00330 #endif
00331
00332
00333
00334 OSG_END_NAMESPACE
00335
00336 #include <OSGSFieldTypeDef.inl>
00337 #include <OSGMFieldTypeDef.inl>
00338
00339 OSG_BEGIN_NAMESPACE
00340
00341 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
00342 DataType FieldDataTraits<XWindowPtr>::_type("XWindowPtr", "WindowPtr");
00343 #endif
00344
00345 OSG_DLLEXPORT_SFIELD_DEF1(XWindowPtr, OSG_WINDOWXLIB_DLLTMPLMAPPING);
00346 OSG_DLLEXPORT_MFIELD_DEF1(XWindowPtr, OSG_WINDOWXLIB_DLLTMPLMAPPING);
00347
00348
00349
00350
00351
00352 #ifdef OSG_SGI_CC
00353 #pragma set woff 1174
00354 #endif
00355
00356 #ifdef OSG_LINUX_ICC
00357 #pragma warning( disable : 177 )
00358 #endif
00359
00360 namespace
00361 {
00362 static Char8 cvsid_cpp [] = "@(#)$Id: FCBaseTemplate_cpp.h,v 1.49 2008/06/09 07:30:44 vossg Exp $";
00363 static Char8 cvsid_hpp [] = OSGXWINDOWBASE_HEADER_CVSID;
00364 static Char8 cvsid_inl [] = OSGXWINDOWBASE_INLINE_CVSID;
00365
00366 static Char8 cvsid_fields_hpp[] = OSGXWINDOWFIELDS_HEADER_CVSID;
00367 }
00368
00369 OSG_END_NAMESPACE
00370