Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1434 lines
34 KiB

  1. //
  2. // DRAWOBJ.CPP
  3. // Drawing objects: point, openpolyline, closepolyline, ellipse
  4. //
  5. // Copyright Microsoft 1998-
  6. //
  7. #include "precomp.h"
  8. #include "NMWbObj.h"
  9. WorkspaceObj* g_pCurrentWorkspace;
  10. WorkspaceObj* g_pConferenceWorkspace;
  11. //
  12. // Created from UI
  13. //
  14. WorkspaceObj::WorkspaceObj ( void )
  15. {
  16. ResetAttrib();
  17. SetOwnerID(g_MyMemberID);
  18. SetType(workspaceCreatePDU_chosen);
  19. //
  20. // Workspace Identifier
  21. //
  22. SetWorkspaceHandle(0);
  23. //
  24. // Application Roster Instance
  25. //
  26. m_appRosterInstance = g_pNMWBOBJ->m_instanceNumber;
  27. //
  28. // Is Wokspace synchronized
  29. //
  30. m_bsynchronized = TRUE;
  31. //
  32. // Does workspace accept keyboard events
  33. //
  34. m_acceptKeyboardEvents = FALSE;
  35. //
  36. // Does workspace accept mouse events
  37. //
  38. m_acceptPointingDeviceEvents = FALSE;
  39. SetViewState(focus_chosen);
  40. SetUpdatesEnabled(!g_pDraw->IsLocked());
  41. //
  42. // Workspace max width and height
  43. //
  44. m_workspaceSize.x = DRAW_WIDTH; // Max width
  45. m_workspaceSize.y = DRAW_HEIGHT; // Max height in Draw.hpp
  46. RECT rect;
  47. rect.top = 0;
  48. rect.left = 0;
  49. rect.right = m_workspaceSize.x;
  50. rect.bottom = m_workspaceSize.y;
  51. SetRect(&rect);
  52. }
  53. //
  54. // Created from Remote
  55. //
  56. WorkspaceObj::WorkspaceObj (WorkspaceCreatePDU * pWorkspaceCreatePDU, BOOL bForcedResend)
  57. {
  58. ResetAttrib();
  59. SetType(workspaceCreatePDU_chosen);
  60. SetUpdatesEnabled(TRUE);
  61. //
  62. // Workspace Identifier
  63. //
  64. SetWorkspaceHandle(GetWorkspaceIdentifier(&pWorkspaceCreatePDU->workspaceIdentifier));
  65. SetThisObjectHandle(GetWorkspaceHandle());
  66. #ifdef _DEBUG
  67. //
  68. // Application Roster Instance
  69. //
  70. m_appRosterInstance = pWorkspaceCreatePDU->appRosterInstance;
  71. TRACE_DEBUG(("m_appRosterInstance = %d", m_appRosterInstance));
  72. //
  73. // Is Wokspace synchronized
  74. //
  75. m_bsynchronized = pWorkspaceCreatePDU->synchronized;
  76. TRACE_DEBUG(("m_bsynchronized = %d", m_bsynchronized));
  77. //
  78. // Does workspace accept keyboard events
  79. //
  80. m_acceptKeyboardEvents = pWorkspaceCreatePDU->acceptKeyboardEvents;
  81. TRACE_DEBUG(("m_acceptKeyboardEvents = %d", m_acceptKeyboardEvents));
  82. //
  83. // Does workspace accept mouse events
  84. //
  85. m_acceptPointingDeviceEvents = pWorkspaceCreatePDU->acceptPointingDeviceEvents;
  86. TRACE_DEBUG(("m_acceptPointingDeviceEvents = %d", m_acceptPointingDeviceEvents));
  87. //
  88. // List of nodes that can access workspace
  89. //
  90. if(pWorkspaceCreatePDU->bit_mask & protectedPlaneAccessList_present)
  91. {
  92. WorkspaceCreatePDU_protectedPlaneAccessList_Element *pNode;
  93. pNode = pWorkspaceCreatePDU->protectedPlaneAccessList;
  94. do
  95. {
  96. BYTE * pByte;
  97. DBG_SAVE_FILE_LINE
  98. pByte = new BYTE[1];
  99. *pByte = (UCHAR)pNode->value;
  100. m_protectedPlaneAccessList.AddTail(pByte);
  101. pNode = pNode->next;
  102. }while (pNode);
  103. }
  104. //
  105. // Workspace max width and height
  106. //
  107. m_workspaceSize.x = pWorkspaceCreatePDU->workspaceSize.width;
  108. m_workspaceSize.y = pWorkspaceCreatePDU->workspaceSize.height;
  109. TRACE_DEBUG(("m_workspaceSize(x,y) = (%d, %d)", m_workspaceSize.x, m_workspaceSize.y));
  110. RECT rect;
  111. rect.top = 0;
  112. rect.left = 0;
  113. rect.right = m_workspaceSize.x;
  114. rect.bottom = m_workspaceSize.y;
  115. SetRect(&rect);
  116. //
  117. // Workspace attributes
  118. //
  119. if(pWorkspaceCreatePDU->bit_mask & workspaceAttributes_present)
  120. {
  121. GetWorkSpaceAttrib(pWorkspaceCreatePDU->workspaceAttributes);
  122. }
  123. //
  124. // Workspace plane parameters
  125. //
  126. GetWorkSpacePlaneParam(pWorkspaceCreatePDU->planeParameters);
  127. //
  128. // Workspace view parameters
  129. //
  130. if(pWorkspaceCreatePDU->bit_mask & viewParameters_present)
  131. {
  132. m_viewHandle = pWorkspaceCreatePDU->viewParameters->value.viewHandle;
  133. TRACE_DEBUG(("View Handle = %d", m_viewHandle));
  134. if(pWorkspaceCreatePDU->viewParameters->value.bit_mask & viewAttributes_present)
  135. {
  136. GetWorkSpaceViewParam(pWorkspaceCreatePDU->viewParameters->value.viewAttributes);
  137. }
  138. }
  139. #endif // 0
  140. //
  141. // Add it to the list of workspaces
  142. //
  143. AddNewWorkspace(this, bForcedResend);
  144. }
  145. WorkspaceObj::~WorkspaceObj( void )
  146. {
  147. RemoveObjectFromResendList(this);
  148. RemoveObjectFromRequestHandleList(this);
  149. //
  150. // Tell other nodes that we are gone
  151. //
  152. if(WasDeletedLocally())
  153. {
  154. OnObjectDelete();
  155. }
  156. //
  157. // Delete all the objects in this workspace
  158. //
  159. T126Obj * pObj;
  160. while ((pObj = (T126Obj *)m_T126ObjectsInWorkspace.RemoveTail()) != NULL)
  161. {
  162. pObj->SetMyWorkspace(NULL);
  163. delete pObj;
  164. g_numberOfObjects--;
  165. }
  166. g_numberOfWorkspaces--;
  167. }
  168. void WorkspaceObj::WorkspaceEditObj ( WorkspaceEditPDU * pWorkspaceEditPDU )
  169. {
  170. //
  171. // Workspace view parameters
  172. //
  173. if(pWorkspaceEditPDU->bit_mask & viewEdits_present)
  174. {
  175. GetWorkSpaceViewEditParam(pWorkspaceEditPDU->viewEdits);
  176. }
  177. if(HasUpatesEnabledStateChanged())
  178. {
  179. if(GetUpdatesEnabled())
  180. {
  181. g_pMain->UnlockDrawingArea();
  182. }
  183. else
  184. {
  185. g_pMain->LockDrawingArea();
  186. }
  187. g_pMain->UpdatePageButtons();
  188. }
  189. if(HasViewStateChanged() &&
  190. pWorkspaceEditPDU->viewEdits &&
  191. pWorkspaceEditPDU->viewEdits->value.action.choice == editView_chosen)
  192. {
  193. if(g_pDraw->IsSynced())
  194. {
  195. g_pMain->GotoPage(this, FALSE);
  196. }
  197. g_pConferenceWorkspace = this;
  198. }
  199. ResetAttrib();
  200. #ifdef _DEBUG
  201. //
  202. // Workspace attributes
  203. //
  204. if(pWorkspaceEditPDU->bit_mask & WorkspaceEditPDU_attributeEdits_present)
  205. {
  206. GetWorkSpaceAttrib((WorkspaceCreatePDU_workspaceAttributes *)pWorkspaceEditPDU->attributeEdits);
  207. }
  208. //
  209. // Workspace plane parameters
  210. //
  211. if(pWorkspaceEditPDU->bit_mask & planeEdits_present)
  212. {
  213. GetWorkSpacePlaneParam((WorkspaceCreatePDU_planeParameters *)pWorkspaceEditPDU->planeEdits);
  214. }
  215. #endif // 0
  216. }
  217. UINT WorkspaceObj::GetWorkspaceIdentifier(WorkspaceIdentifier *workspaceIdentifier)
  218. {
  219. TRACE_DEBUG(("GetWorkspaceIdentifier choice = %d", workspaceIdentifier->choice));
  220. switch(workspaceIdentifier->choice)
  221. {
  222. case(activeWorkspace_chosen):
  223. {
  224. TRACE_MSG(("activeWorkspace = %d", workspaceIdentifier->u.activeWorkspace));
  225. return(workspaceIdentifier->u.activeWorkspace);
  226. break;
  227. }
  228. // case(archiveWorkspace_chosen):
  229. // {
  230. // break;
  231. // }
  232. default:
  233. {
  234. ERROR_OUT(("Invalid workspaceIdentifier choice"));
  235. break;
  236. }
  237. }
  238. return -1;
  239. }
  240. void WorkspaceObj::CreateWorkspaceCreatePDU(WorkspaceCreatePDU * pWorkspaceCreatePDU)
  241. {
  242. pWorkspaceCreatePDU->bit_mask = 0;
  243. //
  244. // Workspace Identifier, we have to ask GCC for an active unique workspace handle
  245. //
  246. pWorkspaceCreatePDU->workspaceIdentifier.choice = activeWorkspace_chosen;
  247. pWorkspaceCreatePDU->workspaceIdentifier.u.activeWorkspace = GetWorkspaceHandle();
  248. //
  249. // Application Roster Instance
  250. //
  251. pWorkspaceCreatePDU->appRosterInstance = (ASN1uint16_t)g_pNMWBOBJ->m_instanceNumber;
  252. //
  253. // Is Wokspace synchronized
  254. //
  255. pWorkspaceCreatePDU->synchronized = (ASN1bool_t)m_bsynchronized;
  256. //
  257. // Does workspace accept keyboard events
  258. //
  259. pWorkspaceCreatePDU->acceptKeyboardEvents = (ASN1bool_t)m_acceptKeyboardEvents;
  260. //
  261. // Does workspace accept mouse events
  262. //
  263. pWorkspaceCreatePDU->acceptPointingDeviceEvents = (ASN1bool_t)m_acceptPointingDeviceEvents;
  264. //
  265. // Workspace max width and height
  266. //
  267. pWorkspaceCreatePDU->workspaceSize.width = (USHORT)m_workspaceSize.x;
  268. pWorkspaceCreatePDU->workspaceSize.height = (USHORT)m_workspaceSize.y;
  269. //
  270. // Workspace plane parameters
  271. //
  272. PWorkspaceCreatePDU_planeParameters planeParameters;
  273. PWorkspaceCreatePDU_planeParameters_Seq_usage usage;
  274. PWorkspaceCreatePDU_planeParameters_Seq_usage pFirstUsage;
  275. //
  276. // Do the plane parameters
  277. //
  278. DBG_SAVE_FILE_LINE
  279. planeParameters = (PWorkspaceCreatePDU_planeParameters)new BYTE[sizeof(WorkspaceCreatePDU_planeParameters)];
  280. pWorkspaceCreatePDU->planeParameters = planeParameters;
  281. planeParameters->value.bit_mask = planeAttributes_present;
  282. planeParameters->value.editable = TRUE;
  283. planeParameters->next = NULL;
  284. DBG_SAVE_FILE_LINE
  285. PWorkspaceCreatePDU_planeParameters_Seq_planeAttributes pPlaneAttrib;
  286. pPlaneAttrib = (PWorkspaceCreatePDU_planeParameters_Seq_planeAttributes) new BYTE[sizeof(WorkspaceCreatePDU_planeParameters_Seq_planeAttributes)];
  287. pPlaneAttrib->value.choice = protection_chosen;
  288. pPlaneAttrib->value.u.protection.protectedplane = FALSE;
  289. pPlaneAttrib->next = NULL;
  290. planeParameters->value.planeAttributes = pPlaneAttrib;
  291. DBG_SAVE_FILE_LINE
  292. usage = (PWorkspaceCreatePDU_planeParameters_Seq_usage) new BYTE[sizeof(WorkspaceCreatePDU_planeParameters_Seq_usage)];
  293. pFirstUsage = usage;
  294. planeParameters->value.usage = usage;
  295. usage->value.choice = image_chosen;
  296. DBG_SAVE_FILE_LINE
  297. usage = (PWorkspaceCreatePDU_planeParameters_Seq_usage) new BYTE[sizeof(WorkspaceCreatePDU_planeParameters_Seq_usage)];
  298. planeParameters->value.usage->next = usage;
  299. usage->value.choice = annotation_chosen;
  300. usage->next = NULL;
  301. //
  302. // Do the plane parameters 2nd time
  303. //
  304. DBG_SAVE_FILE_LINE
  305. planeParameters->next = (PWorkspaceCreatePDU_planeParameters)new BYTE[sizeof(WorkspaceCreatePDU_planeParameters)];
  306. planeParameters = planeParameters->next;
  307. planeParameters->value.bit_mask = planeAttributes_present;
  308. planeParameters->value.editable = TRUE;
  309. planeParameters->value.usage = pFirstUsage;
  310. planeParameters->next = NULL;
  311. planeParameters->value.planeAttributes = pPlaneAttrib;
  312. //
  313. // Do it hte 3rd time
  314. //
  315. planeParameters->next = (PWorkspaceCreatePDU_planeParameters)new BYTE[sizeof(WorkspaceCreatePDU_planeParameters)];
  316. planeParameters = planeParameters->next;
  317. planeParameters->value.bit_mask = planeAttributes_present;
  318. planeParameters->value.editable = TRUE;
  319. planeParameters->value.usage = pFirstUsage;
  320. planeParameters->next = NULL;
  321. planeParameters->value.planeAttributes = pPlaneAttrib;
  322. pWorkspaceCreatePDU->viewParameters = NULL;
  323. }
  324. void WorkspaceObj::CreateWorkspaceDeletePDU(WorkspaceDeletePDU *pWorkspaceDeletePDU)
  325. {
  326. pWorkspaceDeletePDU->bit_mask = 0;
  327. pWorkspaceDeletePDU->workspaceIdentifier.choice = activeWorkspace_chosen;
  328. pWorkspaceDeletePDU->workspaceIdentifier.u.activeWorkspace = GetWorkspaceHandle();
  329. pWorkspaceDeletePDU->reason.choice = userInitiated_chosen;
  330. }
  331. void WorkspaceObj::CreateWorkspaceEditPDU(WorkspaceEditPDU *pWorkspaceEditPDU)
  332. {
  333. pWorkspaceEditPDU->bit_mask = 0;
  334. pWorkspaceEditPDU->workspaceIdentifier.choice = activeWorkspace_chosen;
  335. pWorkspaceEditPDU->workspaceIdentifier.u.activeWorkspace = GetWorkspaceHandle();
  336. PWorkspaceEditPDU_viewEdits_Set_action_editView pEditView = NULL;
  337. pWorkspaceEditPDU->viewEdits = NULL;
  338. if(HasUpatesEnabledStateChanged() || HasViewStateChanged())
  339. {
  340. pWorkspaceEditPDU->bit_mask |= viewEdits_present;
  341. DBG_SAVE_FILE_LINE
  342. pWorkspaceEditPDU->viewEdits = (PWorkspaceEditPDU_viewEdits)new BYTE[sizeof(WorkspaceEditPDU_viewEdits)];
  343. pWorkspaceEditPDU->viewEdits->next = NULL;
  344. pWorkspaceEditPDU->viewEdits->value.viewHandle = m_viewHandle;
  345. pWorkspaceEditPDU->viewEdits->value.action.choice = (ASN1choice_t)m_viewActionChoice;
  346. pWorkspaceEditPDU->viewEdits->value.action.u.editView = NULL;
  347. }
  348. if(HasUpatesEnabledStateChanged())
  349. {
  350. DBG_SAVE_FILE_LINE
  351. pEditView = (PWorkspaceEditPDU_viewEdits_Set_action_editView) new BYTE[sizeof (WorkspaceEditPDU_viewEdits_Set_action_editView)];
  352. pEditView->next = NULL;
  353. pEditView->value.choice = updatesEnabled_chosen;
  354. pEditView->value.u.updatesEnabled = (ASN1bool_t)GetUpdatesEnabled();
  355. pWorkspaceEditPDU->viewEdits->value.action.u.editView = pEditView;
  356. }
  357. if(HasViewStateChanged())
  358. {
  359. DBG_SAVE_FILE_LINE
  360. pEditView = (PWorkspaceEditPDU_viewEdits_Set_action_editView) new BYTE[sizeof (WorkspaceEditPDU_viewEdits_Set_action_editView)];
  361. pEditView->next = pWorkspaceEditPDU->viewEdits->value.action.u.editView;
  362. pEditView->value.choice = WorkspaceViewAttribute_viewState_chosen;
  363. pEditView->value.u.viewState.choice = (ASN1choice_t)GetViewState();
  364. pWorkspaceEditPDU->viewEdits->value.action.u.editView = pEditView;
  365. }
  366. }
  367. void WorkspaceObj::RemoveT126Object(T126Obj *pObj)
  368. {
  369. //
  370. // The contents of the wb just changed
  371. //
  372. g_bContentsChanged = TRUE;
  373. //
  374. // Remove it from the List Of objcets in the workspace
  375. //
  376. WBPOSITION pos = m_T126ObjectsInWorkspace.GetPosition(pObj);
  377. m_T126ObjectsInWorkspace.RemoveAt(pos);
  378. //
  379. // Erase the drawing
  380. //
  381. pObj->DrawRect();
  382. pObj->UnselectDrawingObject();
  383. pObj->UnDraw();
  384. //
  385. // Put the object in the trash, don't delete it locally
  386. // but tell the other nodes to delete it
  387. //
  388. g_numberOfObjects--;
  389. g_pDraw->DeleteSelection();
  390. if(pObj != g_pMain->m_pLocalRemotePointer && pObj->WasDeletedLocally())
  391. {
  392. pObj->SetMyPosition(NULL);
  393. g_pTrash->AddTail( pObj );
  394. pObj->OnObjectDelete();
  395. }
  396. else
  397. {
  398. delete pObj;
  399. }
  400. }
  401. T126Obj* WorkspaceObj::FindObjectInWorkspace(UINT objectHandle)
  402. {
  403. T126Obj* pObj;
  404. WBPOSITION pos;
  405. pos = m_T126ObjectsInWorkspace.GetTailPosition();
  406. while (pos != NULL)
  407. {
  408. pObj = (T126Obj*)m_T126ObjectsInWorkspace.GetPrevious(pos);
  409. if(pObj && pObj->GetThisObjectHandle() == objectHandle)
  410. {
  411. return pObj;
  412. }
  413. }
  414. return NULL;
  415. }
  416. BOOL WorkspaceObj::IsObjectInWorkspace(T126Obj* pObjToFind)
  417. {
  418. T126Obj* pObj;
  419. WBPOSITION pos;
  420. pos = m_T126ObjectsInWorkspace.GetHeadPosition();
  421. while (pos != NULL)
  422. {
  423. pObj = (T126Obj*)m_T126ObjectsInWorkspace.GetNext(pos);
  424. if(pObj == pObjToFind)
  425. {
  426. return TRUE;
  427. }
  428. }
  429. return FALSE;
  430. }
  431. BOOL IsWorkspaceListed(T126Obj * pWorkspaceObj)
  432. {
  433. T126Obj * pObj;
  434. WBPOSITION pos;
  435. pos = g_pListOfWorkspaces->GetHeadPosition();
  436. while (pos != NULL)
  437. {
  438. pObj =(T126Obj *) g_pListOfWorkspaces->GetNext(pos);
  439. if(pObj == pWorkspaceObj)
  440. {
  441. return TRUE;
  442. }
  443. }
  444. return FALSE;
  445. }
  446. //
  447. // Add new workspace
  448. //
  449. void AddNewWorkspace(WorkspaceObj * pWorkspaceObj, BOOL bForcedResend)
  450. {
  451. g_bContentsChanged = TRUE;
  452. //
  453. // Add it to the list of workspace objects
  454. //
  455. if(g_pConferenceWorkspace)
  456. {
  457. WBPOSITION pos = g_pConferenceWorkspace->GetMyPosition();
  458. pWorkspaceObj->SetMyPosition(g_pListOfWorkspaces->AddAt(pWorkspaceObj, pos));
  459. }
  460. else
  461. {
  462. pWorkspaceObj->SetMyPosition(g_pListOfWorkspaces->AddTail(pWorkspaceObj));
  463. g_pConferenceWorkspace = pWorkspaceObj;
  464. g_pCurrentWorkspace = pWorkspaceObj;
  465. if(!g_pDraw->IsSynced())
  466. {
  467. g_pMain->OnSync();
  468. }
  469. }
  470. g_numberOfWorkspaces++;
  471. if(g_pDraw->IsSynced())
  472. {
  473. g_pMain->GotoPage(pWorkspaceObj, bForcedResend);
  474. }
  475. //
  476. // We are not synced but update the page butons anyway
  477. //
  478. else
  479. {
  480. g_pConferenceWorkspace = pWorkspaceObj;
  481. g_pMain->UpdatePageButtons();
  482. }
  483. }
  484. BitmapObj * WorkspaceObj::RectHitRemotePointer(LPRECT hitRect, int penThickness , WBPOSITION pos)
  485. {
  486. if(pos == NULL)
  487. {
  488. pos = m_T126ObjectsInWorkspace.GetTailPosition();
  489. }
  490. else
  491. {
  492. m_T126ObjectsInWorkspace.GetPrevious(pos);
  493. }
  494. T126Obj* pPointer = (T126Obj*)m_T126ObjectsInWorkspace.GetFromPosition(pos);
  495. RECT pointerRect;
  496. RECT intersectRect;
  497. while(pos && pPointer && pPointer->GraphicTool() == TOOLTYPE_REMOTEPOINTER)
  498. {
  499. pPointer->GetRect(&pointerRect);
  500. ::InflateRect(&pointerRect, penThickness , penThickness);
  501. NormalizeRect(&pointerRect);
  502. NormalizeRect(hitRect);
  503. if(IntersectRect(&intersectRect, &pointerRect, hitRect))
  504. {
  505. return (BitmapObj *)pPointer;
  506. }
  507. pPointer = (T126Obj*) m_T126ObjectsInWorkspace.GetPrevious(pos);
  508. }
  509. return NULL;
  510. }
  511. void WorkspaceObj::AddTail(T126Obj * pObj)
  512. {
  513. //
  514. // The contents of the wb just changed
  515. //
  516. g_bContentsChanged = TRUE;
  517. pObj->SetMyWorkspace(this);
  518. T126Obj* pPointer = (T126Obj*)m_T126ObjectsInWorkspace.GetTail();
  519. //
  520. // Add the local remote pointer in the tail position
  521. // and other type of objects before all the remote pointers
  522. //
  523. if(!(pObj->GraphicTool() == TOOLTYPE_REMOTEPOINTER && pObj->IAmTheOwner()) &&
  524. pPointer && pPointer->GraphicTool() == TOOLTYPE_REMOTEPOINTER)
  525. {
  526. WBPOSITION pos = m_T126ObjectsInWorkspace.GetTailPosition();
  527. WBPOSITION insertPos = NULL;
  528. //
  529. // Find the first object that is not a remote pointer
  530. //
  531. while(pPointer->GraphicTool() == TOOLTYPE_REMOTEPOINTER)
  532. {
  533. insertPos = pos;
  534. if(pos == NULL)
  535. {
  536. break;
  537. }
  538. pPointer = (T126Obj*) m_T126ObjectsInWorkspace.GetPrevious(pos);
  539. }
  540. if(insertPos)
  541. {
  542. pObj->SetMyPosition(m_T126ObjectsInWorkspace.AddAt(pObj, insertPos));
  543. }
  544. else
  545. {
  546. pObj->SetMyPosition(m_T126ObjectsInWorkspace.AddHead(pObj));
  547. }
  548. //
  549. // Make sure we repaint the area, if there was a handle it could be under it
  550. //
  551. if(pObj->GraphicTool() == TOOLTYPE_REMOTEPOINTER)
  552. {
  553. ((BitmapObj*)pObj)->CreateSaveBitmap();
  554. }
  555. RECT rect;
  556. pObj->GetBoundsRect(&rect);
  557. g_pDraw->InvalidateSurfaceRect(&rect,TRUE);
  558. }
  559. else
  560. {
  561. pObj->SetMyPosition(m_T126ObjectsInWorkspace.AddTail(pObj));
  562. }
  563. }
  564. WorkspaceObj* RemoveWorkspace(WorkspaceObj * pWorkspaceObj)
  565. {
  566. WorkspaceObj * pWrkspc;
  567. g_bContentsChanged = TRUE;
  568. WBPOSITION pos = pWorkspaceObj->GetMyPosition();
  569. WBPOSITION prevPos = pos;
  570. g_pListOfWorkspaces->GetPrevious(prevPos);
  571. g_pListOfWorkspaces->RemoveAt(pos);
  572. //
  573. // We just removed the first page
  574. //
  575. if(prevPos == NULL)
  576. {
  577. pWrkspc = (WorkspaceObj *)g_pListOfWorkspaces->GetHead();
  578. }
  579. else
  580. {
  581. pWrkspc = (WorkspaceObj *)g_pListOfWorkspaces->GetPrevious(prevPos);
  582. }
  583. //
  584. // The current workspace is pointing to the deleted object
  585. //
  586. if(g_pCurrentWorkspace == pWorkspaceObj)
  587. {
  588. ::InvalidateRect(g_pDraw->m_hwnd, NULL, TRUE);
  589. //
  590. // If we were drawing/selecting or dragging something, finish now
  591. //
  592. g_pDraw->OnLButtonUp(0,0,0);
  593. //
  594. // If we are deleting the current workspace and we have the text editor active
  595. //
  596. if (g_pDraw->TextEditActive())
  597. {
  598. //
  599. // Finish the text
  600. //
  601. g_pDraw->EndTextEntry(FALSE);
  602. }
  603. g_pCurrentWorkspace = NULL;
  604. }
  605. if(g_pConferenceWorkspace == pWorkspaceObj)
  606. {
  607. g_pConferenceWorkspace = NULL;
  608. }
  609. delete pWorkspaceObj;
  610. return pWrkspc;
  611. }
  612. UINT WorkspaceObj::EnumerateObjectsInWorkspace(void)
  613. {
  614. UINT objects = 0;
  615. WBPOSITION pos;
  616. T126Obj* pObj;
  617. pos = GetHeadPosition();
  618. while(pos)
  619. {
  620. pObj = GetNextObject(pos);
  621. if(pObj && pObj->GraphicTool() != TOOLTYPE_REMOTEPOINTER)
  622. {
  623. objects++;
  624. }
  625. }
  626. return objects;
  627. }
  628. void ResendAllObjects(void)
  629. {
  630. //
  631. // Resend all objects
  632. //
  633. WBPOSITION pos;
  634. WBPOSITION posObj;
  635. WorkspaceObj* pWorkspace;
  636. WorkspaceObj* pCurrentWorkspace;
  637. pCurrentWorkspace = g_pCurrentWorkspace;
  638. T126Obj* pObj;
  639. pos = g_pListOfWorkspaces->GetHeadPosition();
  640. while(pos)
  641. {
  642. pWorkspace = (WorkspaceObj*)g_pListOfWorkspaces->GetNext(pos);
  643. if(pWorkspace)
  644. {
  645. pWorkspace->SetAllAttribs();
  646. pWorkspace->SendNewObjectToT126Apps();
  647. posObj = pWorkspace->GetHeadPosition();
  648. while(posObj)
  649. {
  650. pObj = pWorkspace->GetNextObject(posObj);
  651. if(pObj)
  652. {
  653. pObj->ClearSelectionFlags();
  654. pObj->SetAllAttribs();
  655. pObj->SendNewObjectToT126Apps();
  656. //
  657. // Lines need to be saved in various pdus with 256 points in each pdu
  658. //
  659. if(pObj->GraphicTool() == TOOLTYPE_PEN || pObj->GraphicTool() == TOOLTYPE_HIGHLIGHT)
  660. {
  661. int nPoints = ((DrawObj*)pObj)->m_points->GetSize();
  662. int size = MAX_POINT_LIST_VALUES + 1;
  663. if(nPoints > (MAX_POINT_LIST_VALUES + 1))
  664. {
  665. while(size != nPoints)
  666. {
  667. if(nPoints > (size + MAX_POINT_LIST_VALUES + 1))
  668. {
  669. size += MAX_POINT_LIST_VALUES + 1;
  670. }
  671. else
  672. {
  673. size = nPoints;
  674. }
  675. //
  676. // Move to the next 256 points
  677. //
  678. ((DrawObj*)pObj)->m_points->SetSize(size - 1);
  679. //
  680. // Send the next 256 points
  681. //
  682. pObj->ResetAttrib();
  683. ((DrawObj*)pObj)->ChangedPointList();
  684. pObj->OnObjectEdit();
  685. }
  686. ((DrawObj*)pObj)->m_points->SetSize(size);
  687. }
  688. }
  689. }
  690. }
  691. }
  692. }
  693. //
  694. // Syncronize page
  695. //
  696. if(g_pCurrentWorkspace)
  697. {
  698. g_pMain->GotoPage(g_pCurrentWorkspace);
  699. g_pCurrentWorkspace->SetViewState(focus_chosen);
  700. g_pCurrentWorkspace->SetViewActionChoice(editView_chosen);
  701. g_pCurrentWorkspace->OnObjectEdit();
  702. }
  703. }
  704. void RemoveObjectFromRequestHandleList(T126Obj * pObjRequest)
  705. {
  706. T126Obj* pObj;
  707. WBPOSITION pos;
  708. WBPOSITION prevPos;
  709. pos = g_pListOfObjectsThatRequestedHandles->GetHeadPosition();
  710. while (pos != NULL)
  711. {
  712. prevPos = pos;
  713. pObj = (T126Obj*)g_pListOfObjectsThatRequestedHandles->GetNext(pos);
  714. if(pObj == pObjRequest)
  715. {
  716. g_pListOfObjectsThatRequestedHandles->RemoveAt(prevPos);
  717. break;
  718. }
  719. }
  720. }
  721. UINT GetSIPDUObjectHandle(SIPDU * sipdu)
  722. {
  723. UINT ObjectHandle = 0;
  724. switch(sipdu->choice)
  725. {
  726. case bitmapAbortPDU_chosen:
  727. ObjectHandle = sipdu->u.bitmapAbortPDU.bitmapHandle;
  728. break;
  729. case bitmapCheckpointPDU_chosen:
  730. ObjectHandle = sipdu->u.bitmapCheckpointPDU.bitmapHandle;
  731. break;
  732. case bitmapCreatePDU_chosen:
  733. ObjectHandle = sipdu->u.bitmapCreatePDU.bitmapHandle;
  734. break;
  735. case bitmapCreateContinuePDU_chosen:
  736. ObjectHandle = sipdu->u.bitmapCreateContinuePDU.bitmapHandle;
  737. break;
  738. case bitmapDeletePDU_chosen:
  739. ObjectHandle = sipdu->u.bitmapDeletePDU.bitmapHandle;
  740. break;
  741. case bitmapEditPDU_chosen:
  742. ObjectHandle = sipdu->u.bitmapEditPDU.bitmapHandle;
  743. break;
  744. case drawingCreatePDU_chosen:
  745. ObjectHandle = sipdu->u.drawingCreatePDU.drawingHandle;
  746. break;
  747. case drawingDeletePDU_chosen:
  748. ObjectHandle = sipdu->u.drawingDeletePDU.drawingHandle;
  749. break;
  750. case drawingEditPDU_chosen:
  751. ObjectHandle = sipdu->u.drawingEditPDU.drawingHandle;
  752. break;
  753. case siNonStandardPDU_chosen:
  754. ObjectHandle = ((TEXTPDU_HEADER*) sipdu->u.siNonStandardPDU.nonStandardTransaction.data.value)->textHandle;
  755. break;
  756. case workspaceCreatePDU_chosen:
  757. ObjectHandle = WorkspaceObj::GetWorkspaceIdentifier(&sipdu->u.workspaceCreatePDU.workspaceIdentifier);
  758. break;
  759. case workspaceCreateAcknowledgePDU_chosen:
  760. ObjectHandle = WorkspaceObj::GetWorkspaceIdentifier(&sipdu->u.workspaceCreateAcknowledgePDU.workspaceIdentifier);
  761. break;
  762. case workspaceDeletePDU_chosen:
  763. ObjectHandle = WorkspaceObj::GetWorkspaceIdentifier(&sipdu->u.workspaceDeletePDU.workspaceIdentifier);
  764. break;
  765. case workspaceEditPDU_chosen:
  766. ObjectHandle = WorkspaceObj::GetWorkspaceIdentifier(&sipdu->u.workspaceEditPDU.workspaceIdentifier);
  767. break;
  768. case workspacePlaneCopyPDU_chosen:
  769. ObjectHandle = WorkspaceObj::GetWorkspaceIdentifier(&sipdu->u.workspacePlaneCopyPDU.sourceWorkspaceIdentifier);
  770. break;
  771. case workspaceReadyPDU_chosen:
  772. ObjectHandle = WorkspaceObj::GetWorkspaceIdentifier(&sipdu->u.workspaceReadyPDU.workspaceIdentifier);
  773. break;
  774. }
  775. return ObjectHandle;
  776. }
  777. BOOL RemoveObjectFromResendList(T126Obj * pObjRequest)
  778. {
  779. BOOL bRemoved = FALSE;
  780. SIPDU* pPDU;
  781. WBPOSITION pos;
  782. WBPOSITION prevPos;
  783. UINT objectHandle = pObjRequest->GetThisObjectHandle();
  784. pos = g_pRetrySendList->GetHeadPosition();
  785. while (pos != NULL)
  786. {
  787. prevPos = pos;
  788. pPDU = (SIPDU*)g_pRetrySendList->GetNext(pos);
  789. if(GetSIPDUObjectHandle(pPDU) == objectHandle)
  790. {
  791. g_pRetrySendList->RemoveAt(prevPos);
  792. SIPDUCleanUp(pPDU);
  793. bRemoved = TRUE;
  794. }
  795. }
  796. return bRemoved;
  797. }
  798. void RemoveRemotePointer(MEMBER_ID nMemberID)
  799. {
  800. //
  801. // Resend all objects
  802. //
  803. WBPOSITION pos;
  804. WBPOSITION posObj;
  805. WorkspaceObj* pWorkspace;
  806. ULONG ownerID;
  807. T126Obj* pObj;
  808. pos = g_pListOfWorkspaces->GetHeadPosition();
  809. while(pos)
  810. {
  811. pWorkspace = (WorkspaceObj*)g_pListOfWorkspaces->GetNext(pos);
  812. if(pWorkspace)
  813. {
  814. posObj = pWorkspace->GetHeadPosition();
  815. while(posObj)
  816. {
  817. pObj = pWorkspace->GetNextObject(posObj);
  818. if(pObj && pObj->GraphicTool() == TOOLTYPE_REMOTEPOINTER)
  819. {
  820. ownerID = GET_NODE_ID_FROM_MEMBER_ID(pObj->GetOwnerID());
  821. TRACE_DEBUG(("RemoveRemotePointer ownerID=%x member that left =%x " , ownerID, nMemberID));
  822. if(ownerID != g_MyMemberID)
  823. {
  824. if(nMemberID)
  825. {
  826. if(nMemberID == ownerID)
  827. {
  828. pWorkspace->RemoveT126Object(pObj);
  829. }
  830. }
  831. else
  832. {
  833. pWorkspace->RemoveT126Object(pObj);
  834. }
  835. }
  836. }
  837. }
  838. }
  839. }
  840. //
  841. // Syncronize page
  842. //
  843. if(g_pCurrentWorkspace)
  844. {
  845. g_pCurrentWorkspace->SetViewActionChoice(editView_chosen);
  846. g_pCurrentWorkspace->OnObjectEdit();
  847. }
  848. }
  849. BOOL IsThereAnythingInAnyWorkspace(void)
  850. {
  851. WBPOSITION pos;
  852. WBPOSITION posObj;
  853. WorkspaceObj* pWorkspace;
  854. T126Obj* pObj;
  855. pos = g_pListOfWorkspaces->GetHeadPosition();
  856. while(pos)
  857. {
  858. pWorkspace = (WorkspaceObj*)g_pListOfWorkspaces->GetNext(pos);
  859. if(pWorkspace)
  860. {
  861. posObj = pWorkspace->GetHeadPosition();
  862. while(posObj)
  863. {
  864. pObj = pWorkspace->GetNextObject(posObj);
  865. if(pObj)
  866. {
  867. if(pObj->GraphicTool() != TOOLTYPE_REMOTEPOINTER)
  868. {
  869. return TRUE;
  870. }
  871. }
  872. }
  873. }
  874. }
  875. return FALSE;
  876. }
  877. //
  878. // UI Edited the Workspace Object
  879. //
  880. void WorkspaceObj::OnObjectEdit(void)
  881. {
  882. g_bContentsChanged = TRUE;
  883. //
  884. // If we are not synced don't bug the other nodes
  885. //
  886. if(!g_pDraw->IsSynced())
  887. {
  888. return;
  889. }
  890. SIPDU *sipdu = NULL;
  891. DBG_SAVE_FILE_LINE
  892. sipdu = (SIPDU *) new BYTE[sizeof(SIPDU)];
  893. if(!sipdu)
  894. {
  895. TRACE_MSG(("Failed to create sipdu"));
  896. ::PostMessage(g_pMain->m_hwnd, WM_USER_DISPLAY_ERROR, WBFE_RC_WINDOWS, 0);
  897. return;
  898. }
  899. sipdu->choice = workspaceEditPDU_chosen;
  900. CreateWorkspaceEditPDU(&sipdu->u.workspaceEditPDU);
  901. T120Error rc = SendT126PDU(sipdu);
  902. if(rc == T120_NO_ERROR)
  903. {
  904. SIPDUCleanUp(sipdu);
  905. ResetAttrib();
  906. }
  907. }
  908. //
  909. // UI Deleted the Workspace Object
  910. //
  911. void WorkspaceObj::OnObjectDelete(void)
  912. {
  913. SIPDU *sipdu = NULL;
  914. DBG_SAVE_FILE_LINE
  915. sipdu = (SIPDU *) new BYTE[sizeof(SIPDU)];
  916. if(sipdu)
  917. {
  918. sipdu->choice = workspaceDeletePDU_chosen;
  919. CreateWorkspaceDeletePDU(&sipdu->u.workspaceDeletePDU);
  920. T120Error rc = SendT126PDU(sipdu);
  921. if(rc == T120_NO_ERROR)
  922. {
  923. SIPDUCleanUp(sipdu);
  924. }
  925. }
  926. else
  927. {
  928. TRACE_MSG(("Failed to create sipdu"));
  929. ::PostMessage(g_pMain->m_hwnd, WM_USER_DISPLAY_ERROR, WBFE_RC_WINDOWS, 0);
  930. }
  931. }
  932. void WorkspaceObj::GetEncodedCreatePDU(ASN1_BUF *pBuf)
  933. {
  934. SIPDU *sipdu = NULL;
  935. sipdu = (SIPDU *) new BYTE[sizeof(SIPDU)];
  936. if(sipdu)
  937. {
  938. sipdu->choice = workspaceCreatePDU_chosen;
  939. CreateWorkspaceCreatePDU(&sipdu->u.workspaceCreatePDU);
  940. ASN1_BUF encodedPDU;
  941. g_pCoder->Encode(sipdu, pBuf);
  942. delete sipdu->u.workspaceCreatePDU.planeParameters->value.usage;
  943. delete sipdu->u.workspaceCreatePDU.planeParameters;
  944. delete [] sipdu;
  945. }
  946. else
  947. {
  948. TRACE_MSG(("Failed to create sipdu"));
  949. ::PostMessage(g_pMain->m_hwnd, WM_USER_DISPLAY_ERROR, WBFE_RC_WINDOWS, 0);
  950. }
  951. }
  952. void SendWorkspaceRefreshPDU(BOOL bImtheRefresher)
  953. {
  954. SIPDU *sipdu = NULL;
  955. DBG_SAVE_FILE_LINE
  956. sipdu = (SIPDU *) new BYTE[sizeof(SIPDU)];
  957. if(sipdu)
  958. {
  959. sipdu->choice = workspaceRefreshStatusPDU_chosen;
  960. sipdu->u.workspaceRefreshStatusPDU.bit_mask = 0;
  961. sipdu->u.workspaceRefreshStatusPDU.refreshStatus = (ASN1bool_t)bImtheRefresher;
  962. T120Error rc = SendT126PDU(sipdu);
  963. if(rc == T120_NO_ERROR)
  964. {
  965. SIPDUCleanUp(sipdu);
  966. }
  967. }
  968. else
  969. {
  970. TRACE_MSG(("Failed to create sipdu"));
  971. ::PostMessage(g_pMain->m_hwnd, WM_USER_DISPLAY_ERROR, WBFE_RC_WINDOWS, 0);
  972. }
  973. }
  974. //
  975. // UI Created a new Workspace Object
  976. //
  977. void WorkspaceObj::SendNewObjectToT126Apps(void)
  978. {
  979. SIPDU *sipdu = NULL;
  980. DBG_SAVE_FILE_LINE
  981. sipdu = (SIPDU *) new BYTE[sizeof(SIPDU)];
  982. if(sipdu)
  983. {
  984. sipdu->choice = workspaceCreatePDU_chosen;
  985. CreateWorkspaceCreatePDU(&sipdu->u.workspaceCreatePDU);
  986. TRACE_DEBUG(("Sending Workspace >> Workspace handle = %d", sipdu->u.workspaceCreatePDU.workspaceIdentifier.u.activeWorkspace ));
  987. T120Error rc = SendT126PDU(sipdu);
  988. if(rc == T120_NO_ERROR)
  989. {
  990. SIPDUCleanUp(sipdu);
  991. }
  992. SetAllAttribs();
  993. SetViewActionChoice(createNewView_chosen);
  994. SetViewState(focus_chosen);
  995. OnObjectEdit();
  996. }
  997. else
  998. {
  999. TRACE_MSG(("Failed to create sipdu"));
  1000. ::PostMessage(g_pMain->m_hwnd, WM_USER_DISPLAY_ERROR, WBFE_RC_WINDOWS, 0);
  1001. }
  1002. }
  1003. void WorkspaceObj::GetWorkSpaceViewEditParam(PWorkspaceEditPDU_viewEdits pViewEdits)
  1004. {
  1005. m_viewHandle = pViewEdits->value.viewHandle;
  1006. TRACE_DEBUG(("GetWorkSpaceViewEditParam View Handle = %d", m_viewHandle));
  1007. TRACE_DEBUG(("GetWorkSpaceViewEditParam View Choice = %d", pViewEdits->value.action.choice));
  1008. switch(pViewEdits->value.action.choice)
  1009. {
  1010. case(createNewView_chosen):
  1011. {
  1012. GetWorkSpaceViewParam((PWorkspaceCreatePDU_viewParameters_Set_viewAttributes)pViewEdits->value.action.u.createNewView);
  1013. }
  1014. break;
  1015. case(editView_chosen):
  1016. {
  1017. GetWorkSpaceViewParam((PWorkspaceCreatePDU_viewParameters_Set_viewAttributes)pViewEdits->value.action.u.editView);
  1018. }
  1019. break;
  1020. case(deleteView_chosen):
  1021. {
  1022. ;
  1023. }
  1024. break;
  1025. // case(nonStandardAction_chosen):
  1026. // {
  1027. // }
  1028. // break;
  1029. default:
  1030. WARNING_OUT(("Invalid workspace view attribute"));
  1031. break;
  1032. }
  1033. }
  1034. void WorkspaceObj::GetWorkSpaceViewParam(PWorkspaceCreatePDU_viewParameters_Set_viewAttributes pViewAttributes)
  1035. {
  1036. PWorkspaceCreatePDU_viewParameters_Set_viewAttributes attributes;
  1037. attributes = pViewAttributes;
  1038. while(attributes)
  1039. {
  1040. switch(attributes->value.choice)
  1041. {
  1042. case (viewRegion_chosen):
  1043. {
  1044. switch(attributes->value.u.viewRegion.choice)
  1045. {
  1046. case(fullWorkspace_chosen):
  1047. {
  1048. m_viewRegion.top = 0;
  1049. m_viewRegion.left = 0;
  1050. m_viewRegion.bottom = m_workspaceSize.x;
  1051. m_viewRegion.right = m_workspaceSize.y;
  1052. TRACE_DEBUG(("fullWorkspace_chosen View Region = (%d, %d)(%d, %d)",
  1053. m_viewRegion.top,
  1054. m_viewRegion.left,
  1055. m_viewRegion.bottom,
  1056. m_viewRegion.right));
  1057. }
  1058. case(partialWorkspace_chosen):
  1059. {
  1060. m_viewRegion.top = attributes->value.u.viewRegion.u.partialWorkspace.upperLeft.yCoordinate;
  1061. m_viewRegion.left = attributes->value.u.viewRegion.u.partialWorkspace.upperLeft.xCoordinate;
  1062. m_viewRegion.bottom = attributes->value.u.viewRegion.u.partialWorkspace.upperLeft.yCoordinate;
  1063. m_viewRegion.right = attributes->value.u.viewRegion.u.partialWorkspace.upperLeft.xCoordinate;
  1064. TRACE_DEBUG(("partialWorkspace_chosen View Region = (%d, %d)(%d, %d)",
  1065. m_viewRegion.top,
  1066. m_viewRegion.left,
  1067. m_viewRegion.bottom,
  1068. m_viewRegion.right));
  1069. }
  1070. break;
  1071. default:
  1072. ERROR_OUT(("Invalid view region choice"));
  1073. break;
  1074. }
  1075. }
  1076. break;
  1077. case (WorkspaceViewAttribute_viewState_chosen):
  1078. {
  1079. SetViewState(attributes->value.u.viewState.choice);
  1080. TRACE_DEBUG(("View state = %d", attributes->value.u.viewState.choice));
  1081. }
  1082. break;
  1083. case (updatesEnabled_chosen):
  1084. {
  1085. SetUpdatesEnabled(attributes->value.u.updatesEnabled);
  1086. if(!m_bUpdatesEnabled)
  1087. {
  1088. g_pNMWBOBJ->m_LockerID = GetOwnerID();
  1089. }
  1090. TRACE_DEBUG(("Updates enabled = %d", m_bUpdatesEnabled));
  1091. }
  1092. break;
  1093. // case (sourceDisplayIndicator_chosen):
  1094. // {
  1095. // JOSEF what we do with these??????
  1096. // attributes->value.u.sourceDisplayIndicator.displayAspectRatio;
  1097. // attributes->value.u.sourceDisplayIndicator.horizontalSizeRatio;
  1098. // attributes->value.u.sourceDisplayIndicator.horizontalPosition;
  1099. // attributes->value.u.sourceDisplayIndicator.verticalPosition;
  1100. //
  1101. // }
  1102. // break;
  1103. default:
  1104. WARNING_OUT(("Invalid workspace view attribute"));
  1105. break;
  1106. }
  1107. attributes = attributes->next;
  1108. }
  1109. }
  1110. //
  1111. // JOSEF The following is not used but is part of the standard
  1112. // It is removed because we don't need it now
  1113. // We may need to add it for interop in the future
  1114. //
  1115. #ifdef _DEBUG
  1116. void WorkspaceObj::SetBackGroundColor(COLORREF rgb)
  1117. {
  1118. m_backgroundColor.rgbtRed = GetRValue(rgb);
  1119. m_backgroundColor.rgbtGreen = GetGValue(rgb);
  1120. m_backgroundColor.rgbtBlue = GetBValue(rgb);
  1121. }
  1122. void WorkspaceObj::GetWorkSpaceAttrib(PWorkspaceCreatePDU_workspaceAttributes pWorkspaceAttributes)
  1123. {
  1124. PWorkspaceCreatePDU_workspaceAttributes attributes;
  1125. attributes = pWorkspaceAttributes;
  1126. COLORREF rgb;
  1127. while(attributes)
  1128. {
  1129. switch(attributes->value.choice)
  1130. {
  1131. case(backgroundColor_chosen):
  1132. {
  1133. switch(attributes->value.u.backgroundColor.choice)
  1134. {
  1135. // case(workspacePaletteIndex_chosen):
  1136. // {
  1137. // ASN1uint16_t workspacePaletteIndex = ((attributes->value.u.backgroundColor).u).workspacePaletteIndex;
  1138. // break;
  1139. // }
  1140. case(rgbTrueColor_chosen):
  1141. {
  1142. rgb = RGB(attributes->value.u.backgroundColor.u.rgbTrueColor.r,
  1143. attributes->value.u.backgroundColor.u.rgbTrueColor.g,
  1144. attributes->value.u.backgroundColor.u.rgbTrueColor.b);
  1145. SetBackGroundColor(rgb);
  1146. TRACE_DEBUG(("Attribute penColor (r,g,b)=(%d, %d,%d)",
  1147. attributes->value.u.backgroundColor.u.rgbTrueColor.r,
  1148. attributes->value.u.backgroundColor.u.rgbTrueColor.g,
  1149. attributes->value.u.backgroundColor.u.rgbTrueColor.b));
  1150. break;
  1151. }
  1152. case(transparent_chosen):
  1153. {
  1154. SetBackGroundColor(0);
  1155. TRACE_DEBUG(("Backgroundcolor transparent"));
  1156. break;
  1157. }
  1158. default:
  1159. ERROR_OUT(("Invalid backgroundColor choice"));
  1160. break;
  1161. }
  1162. break;
  1163. }
  1164. case(preserve_chosen):
  1165. {
  1166. m_bPreserve = attributes->value.u.preserve;
  1167. TRACE_DEBUG(("m_bPreserve %d", m_bPreserve));
  1168. }
  1169. break;
  1170. }
  1171. attributes = attributes->next;
  1172. }
  1173. }
  1174. void WorkspaceObj::GetWorkSpacePlaneParam(PWorkspaceCreatePDU_planeParameters pPlaneParameters)
  1175. {
  1176. TRACE_DEBUG(("GetWorkSpacePlaneParam NYI"));
  1177. ;
  1178. }
  1179. #endif // 0
  1180. void TogleLockInAllWorkspaces(BOOL bLock, BOOL bResend)
  1181. {
  1182. WorkspaceObj * pWorkspace;
  1183. WBPOSITION pos = g_pListOfWorkspaces->GetHeadPosition();
  1184. while (pos)
  1185. {
  1186. pWorkspace = (WorkspaceObj *) g_pListOfWorkspaces->GetNext(pos);
  1187. pWorkspace->SetUpdatesEnabled(!bLock);
  1188. if(bResend)
  1189. {
  1190. pWorkspace->SetViewActionChoice(editView_chosen);
  1191. pWorkspace->OnObjectEdit();
  1192. }
  1193. }
  1194. }
  1195.