hot.cpp 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728
  1. ////////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright 2016 RWS Inc, All Rights Reserved
  4. //
  5. // This program is free software; you can redistribute it and/or modify
  6. // it under the terms of version 2 of the GNU General Public License as published by
  7. // the Free Software Foundation
  8. //
  9. // This program is distributed in the hope that it will be useful,
  10. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. // GNU General Public License for more details.
  13. //
  14. // You should have received a copy of the GNU General Public License along
  15. // with this program; if not, write to the Free Software Foundation, Inc.,
  16. // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  17. //
  18. ///////////////////////////////////////////////////////////////////////////////
  19. //
  20. // Hot.cpp
  21. //
  22. // History:
  23. // 06/13/96 JMI Started. Tried to maintain compatability with resonably
  24. // useful functionalities of the Win32 specific RHot.
  25. //
  26. // 09/24/96 JMI Changed all BLU_MB?_* macros to RSP_MB?_* macros.
  27. //
  28. // 10/30/96 JMI Changed:
  29. // Old label New Label
  30. // ========= =========
  31. // CHot RHot
  32. // HOTCALL REventCall
  33. // HOTCALL2 REventPosCall
  34. // CList RList
  35. //
  36. // 01/01/97 JMI Added prioritized hotboxes. Defaults to non-prioritized.
  37. // Calling SetPriority(sPriority > RHOT_NO_PRIORITY) causes use of
  38. // prioritization for this RHot.
  39. //
  40. // 01/04/97 JMI Added ability to have parent-child RHot relationships.
  41. // This should simplify things that use this class that
  42. // utilize such relationships.
  43. //
  44. // 01/06/97 JMI Added m_listChildren to keep track of children. I was
  45. // afraid that there needed to be a way to let child hots
  46. // when the parent was destroyed. Now, when a parent is
  47. // destroyed, it goes through all its children doing a
  48. // photChild->SetParent(NULL).
  49. //
  50. // 01/13/97 JMI Added Do() that takes an event. Now the old Do() calls
  51. // this when it finds an event.
  52. //
  53. // 01/15/97 JMI Do(short) was calling Do(short, short, short) with the
  54. // event as the first (instead of the last) parameter.
  55. //
  56. // 01/21/97 JMI The main Do() now returns the priority of the RHot that
  57. // got the event.
  58. //
  59. // 01/22/97 JMI Changed DoEvent() to DoChildren(). Reversed order of
  60. // pos vs. event args.
  61. //
  62. // 01/23/97 JMI Got rid of the whole implied root with the static lists.
  63. // Now each hotbox can service its children via a Do() call.
  64. // More of a typical child-parent relationship. Note that
  65. // this got rid of the Do(short sUseQueue) static that
  66. // dequeued or polled events, but it was getting stale any-
  67. // ways.
  68. //
  69. // 01/26/97 JMI Changed callbacks' first parms to RHot* instead of ULONG.
  70. //
  71. // 03/19/97 JMI Added InputEventCall and made Do(pie) the main RHot
  72. // interface.
  73. // Also, added new constructor overload to handle new call-
  74. // back type.
  75. //
  76. // 03/19/97 JMI Now evaluates capture hotboxes first and stores the
  77. // priority of the highest priority box which can block
  78. // processing of non-capture boxes.
  79. // Also, captured hotboxes were being passed the wrong RHot
  80. // pointer. Fixed.
  81. //
  82. // 03/28/97 JMI Priority of capture hotboxes was not being stored
  83. // properly. Fixed.
  84. //
  85. //////////////////////////////////////////////////////////////////////////////
  86. //
  87. // Offers simple hotbox services based on either the mouse queue or polling.
  88. //
  89. // Intricasies(sp?) regarding priorities:
  90. // - Priority of RHOT_NO_PRIORITY indicates non-prioritized hotbox.
  91. // More than one non-prioritized hotbox can receive a callback
  92. // in response to a single mouse event.
  93. // - Only one prioritized hotbox can receive a callback in
  94. // response to a single mouse event.
  95. // - Any number of non-prioritized and one prioritized hotbox
  96. // can receive a callback in response to a single mouse event.
  97. //
  98. //////////////////////////////////////////////////////////////////////////////
  99. // Blue //////////////////////////////////////////////////////////////////////
  100. #include "Blue.h"
  101. // Green /////////////////////////////////////////////////////////////////////
  102. // If PATHS_IN_INCLUDES macro is defined, we can utilized relative
  103. // paths to a header file. In this case we generally go off of our
  104. // RSPiX root directory. System.h MUST be included before this macro
  105. // is evaluated. System.h is the header that, based on the current
  106. // platform (or more so in this case on the compiler), defines
  107. // PATHS_IN_INCLUDES. Blue.h includes system.h so you can include that
  108. // instead.
  109. #ifdef PATHS_IN_INCLUDES
  110. #include "GREEN/Hot/hot.h"
  111. #else
  112. #include "hot.h"
  113. #endif // PATHS_IN_INCLUDES
  114. //////////////////////////////////////////////////////////////////////////////
  115. // Module specific macros.
  116. //////////////////////////////////////////////////////////////////////////////
  117. //////////////////////////////////////////////////////////////////////////////
  118. // Instanstiate/Initialize class statics.
  119. //////////////////////////////////////////////////////////////////////////////
  120. //////////////////////////////////////////////////////////////////////////////
  121. // Module specific non-member functions.
  122. //////////////////////////////////////////////////////////////////////////////
  123. //////////////////////////////////////////////////////////////////////////////
  124. // Class functions.
  125. //////////////////////////////////////////////////////////////////////////////
  126. //////////////////////////////////////////////////////////////////////////////
  127. //
  128. // Default constructor.
  129. //
  130. //////////////////////////////////////////////////////////////////////////////
  131. RHot::RHot()
  132. {
  133. // Reset all members.
  134. Init();
  135. }
  136. //////////////////////////////////////////////////////////////////////////////
  137. //
  138. // Constructura Especial that sets some intial values.
  139. //
  140. //////////////////////////////////////////////////////////////////////////////
  141. RHot::RHot(
  142. short sX, // X position of new hotbox.
  143. short sY, // Y position of new hotbox.
  144. short sW, // Width of new hotbox.
  145. short sH, // Height of new hotbox.
  146. REventCall fnEventCall /*= NULL*/, // Callback on mouse event.
  147. short sActive /*= FALSE*/, // Initially active, if TRUE.
  148. ULONG ulUser /*= 0*/, // User value.
  149. short sPriority /*= RHOT_NO_PRIORITY*/)// Priority. Default == non-prioritized.
  150. {
  151. // Reset all members.
  152. Init();
  153. m_sX = sX;
  154. m_sY = sY;
  155. m_sW = sW;
  156. m_sH = sH;
  157. m_ulUser = ulUser;
  158. m_ecUser = fnEventCall;
  159. SetPriority(sPriority);
  160. // Set activation status.
  161. SetActive(sActive);
  162. }
  163. //////////////////////////////////////////////////////////////////////////////
  164. //
  165. // Constructura Especial that sets some intial values.
  166. //
  167. //////////////////////////////////////////////////////////////////////////////
  168. RHot::RHot(
  169. short sX, // X position of new hotbox.
  170. short sY, // Y position of new hotbox.
  171. short sW, // Width of new hotbox.
  172. short sH, // Height of new hotbox.
  173. REventPosCall fnEventPosCall, // Callback on mouse event.
  174. short sActive /*= FALSE*/, // Initially active, if TRUE.
  175. ULONG ulUser /*= 0*/, // User value.
  176. short sPriority /*= RHOT_NO_PRIORITY*/)// Priority. Default == non-prioritized.
  177. {
  178. // Reset all members.
  179. Init();
  180. m_sX = sX;
  181. m_sY = sY;
  182. m_sW = sW;
  183. m_sH = sH;
  184. m_epcUser = fnEventPosCall;
  185. m_ulUser = ulUser;
  186. SetPriority(sPriority);
  187. // Set activation status.
  188. SetActive(sActive);
  189. }
  190. //////////////////////////////////////////////////////////////////////////////
  191. //
  192. // Constructura Especial that sets some intial values.
  193. //
  194. //////////////////////////////////////////////////////////////////////////////
  195. RHot::RHot(
  196. short sX, // X position of new hotbox.
  197. short sY, // Y position of new hotbox.
  198. short sW, // Width of new hotbox.
  199. short sH, // Height of new hotbox.
  200. InputEventCall fnInputEventCall, // Callback on mouse event.
  201. short sActive /*= FALSE*/, // Initially active, if TRUE.
  202. ULONG ulUser /*= 0*/, // User value.
  203. short sPriority /*= RHOT_NO_PRIORITY*/)// Priority. Default == non-prioritized.
  204. {
  205. // Reset all members.
  206. Init();
  207. m_sX = sX;
  208. m_sY = sY;
  209. m_sW = sW;
  210. m_sH = sH;
  211. m_iecUser = fnInputEventCall;
  212. m_ulUser = ulUser;
  213. SetPriority(sPriority);
  214. // Set activation status.
  215. SetActive(sActive);
  216. }
  217. //////////////////////////////////////////////////////////////////////////////
  218. //
  219. // Destructor.
  220. //
  221. //////////////////////////////////////////////////////////////////////////////
  222. RHot::~RHot()
  223. {
  224. // Deactivate.
  225. SetActive(FALSE);
  226. // Decapture.
  227. SetCapture(FALSE);
  228. // Release all children.
  229. RHot* phot = m_listChildren.GetHead();
  230. while (phot != NULL)
  231. {
  232. phot->SetParent(NULL);
  233. phot = m_listChildren.GetNext();
  234. }
  235. // Release parent.
  236. SetParent(NULL);
  237. }
  238. //////////////////////////////////////////////////////////////////////////////
  239. // Manipulations.
  240. //////////////////////////////////////////////////////////////////////////////
  241. //////////////////////////////////////////////////////////////////////////////
  242. //
  243. // Activates/Deactivates hotbox. When active, the hotbox
  244. // calls the callback when mouse events occur.
  245. //
  246. //////////////////////////////////////////////////////////////////////////////
  247. void RHot::SetActive( // Returns nothing.
  248. short sActive) // TRUE to activate, FALSE otherwise.
  249. {
  250. if (m_sActive != sActive)
  251. {
  252. if (sActive == TRUE)
  253. {
  254. // If this item has a parent . . .
  255. RHot* photParent = GetParent();
  256. if (photParent != NULL)
  257. {
  258. // Add us into its list.
  259. if (photParent->m_slistActiveChildren.Insert(this, &m_sPriority) == 0)
  260. {
  261. // Success.
  262. m_sActive = TRUE;
  263. }
  264. else
  265. {
  266. TRACE("SetActive(): Failed to insert into list. Delete me; I'm useless.\n");
  267. }
  268. }
  269. else
  270. {
  271. m_sActive = TRUE;
  272. }
  273. }
  274. else
  275. {
  276. // If this item has a parent . . .
  277. RHot* photParent = GetParent();
  278. if (photParent != NULL)
  279. {
  280. // Remove us from list.
  281. if (photParent->m_slistActiveChildren.Remove(this) == 0)
  282. {
  283. // Success.
  284. m_sActive = FALSE;
  285. }
  286. else
  287. {
  288. TRACE("SetActive(): Failed to remove from list.\n");
  289. }
  290. }
  291. else
  292. {
  293. m_sActive = FALSE;
  294. }
  295. }
  296. }
  297. }
  298. //////////////////////////////////////////////////////////////////////////////
  299. //
  300. // Sets the priority of this hotbox.
  301. // If hotbox is already active, it is repositioned in the prioritized
  302. // list so that the new priorty is recognized.
  303. // See CPP comment header in regards to specifics of this value.
  304. //
  305. //////////////////////////////////////////////////////////////////////////////
  306. void RHot::SetPriority( // Returns 0 on success.
  307. short sPriority) // New priority for hotbox. Lower value
  308. // equals higher priority.
  309. // RHOT_NO_PRIORITY(default) indicates non-prioritized.
  310. {
  311. // Change priority.
  312. m_sPriority = sPriority;
  313. // If this hotbox is active . . .
  314. if (m_sActive != FALSE)
  315. {
  316. // If this item has a parent . . .
  317. RHot* photParent = GetParent();
  318. if (photParent != NULL)
  319. {
  320. // Reposition with new priority.
  321. if (photParent->m_slistActiveChildren.Reposition(this) == 0)
  322. {
  323. // Success.
  324. }
  325. else
  326. {
  327. TRACE("SetPriority(): photParent->m_listChildren.Reposition() failed.\n");
  328. }
  329. }
  330. }
  331. }
  332. //////////////////////////////////////////////////////////////////////////////
  333. //
  334. // Sets this hotbox's parent to the specified hotbox.
  335. // This has the effect of having the hotbox scanned relative to the
  336. // parent and only within the area of the parent.
  337. //
  338. //////////////////////////////////////////////////////////////////////////////
  339. void RHot::SetParent( // Returns nothing.
  340. RHot* photParent) // Hotbox to be parent of this hotbox or NULL
  341. // for none.
  342. {
  343. ASSERT(photParent != this);
  344. // Store activation status.
  345. short sActive = IsActive();
  346. // Store capture status.
  347. short sCapture = IsCapturing();
  348. // If active . . .
  349. if (sActive != FALSE)
  350. {
  351. // Deactivate.
  352. SetActive(FALSE);
  353. }
  354. // If capturing . . .
  355. if (sCapture != FALSE)
  356. {
  357. // Decapture.
  358. SetCapture(FALSE);
  359. }
  360. // If there's an existing parent . . .
  361. if (m_photParent != NULL)
  362. {
  363. // Remove from its list of children.
  364. m_photParent->m_listChildren.Remove(this);
  365. }
  366. // Set new parent.
  367. m_photParent = photParent;
  368. // If there's a new parent . . .
  369. if (m_photParent != NULL)
  370. {
  371. // Remove from its list of children.
  372. m_photParent->m_listChildren.AddTail(this);
  373. }
  374. // If active . . .
  375. if (sActive != FALSE)
  376. {
  377. // Activate.
  378. SetActive(TRUE);
  379. }
  380. // If capturing . . .
  381. if (sCapture != FALSE)
  382. {
  383. // Capture.
  384. SetCapture(TRUE);
  385. }
  386. // We should be back in original shape.
  387. ASSERT(sActive == IsActive() );
  388. ASSERT(sCapture == IsCapturing() );
  389. }
  390. //////////////////////////////////////////////////////////////////////////////
  391. //
  392. // Activates/Deactivates capturing for this hotbox.
  393. // When capturing is active, this hotbox always receives
  394. // events. Sort of a cursor event capture mode.
  395. //
  396. //////////////////////////////////////////////////////////////////////////////
  397. void RHot::SetCapture( // Returns nothing.
  398. short sActive) // TRUE to activate, FALSE otherwise.
  399. {
  400. if (m_sCapture != sActive)
  401. {
  402. if (sActive == TRUE)
  403. {
  404. // Add us into list . . .
  405. if (GetCaptureList()->Insert(this) == 0)
  406. {
  407. // Success.
  408. m_sCapture = TRUE;
  409. }
  410. else
  411. {
  412. TRACE("SetCapture(): Failed to insert into list. Delete me; I'm useless.\n");
  413. }
  414. }
  415. else
  416. {
  417. // Remove us from list . . .
  418. if (GetCaptureList()->Remove(this) == 0)
  419. {
  420. // Success.
  421. m_sCapture = FALSE;
  422. }
  423. else
  424. {
  425. TRACE("SetCapture(): Failed to remove from list.\n");
  426. }
  427. }
  428. }
  429. }
  430. //////////////////////////////////////////////////////////////////////////////
  431. // Methods.
  432. //////////////////////////////////////////////////////////////////////////////
  433. //////////////////////////////////////////////////////////////////////////////
  434. //
  435. // Processes a single event for all child hotboxes.
  436. // Non mouse events are ignored.
  437. // It is now up to the callback to check whether the input event
  438. // is used and decide whether to utilize the event.
  439. // Recurses on children.
  440. // This is called by the other Do().
  441. //
  442. //////////////////////////////////////////////////////////////////////////////
  443. short RHot::Do( // Returns priority of item called back or
  444. // RHOT_NO_PRIORITY.
  445. RInputEvent* pie) // In: Most recent user input event.
  446. // Out: Depends on callbacks. Generally,
  447. // pie->sUsed = TRUE, if used.
  448. {
  449. short sPriorityCalled = RHOT_NO_PRIORITY; // Assume no callback.
  450. // Make sure we're dealing with the correct event type . . .
  451. if (pie->type == RInputEvent::Mouse)
  452. {
  453. // If this item is top-level . . .
  454. if (m_photParent == NULL)
  455. {
  456. // Process capture items.
  457. // Notify all hotboxes that are capturing.
  458. // Note that capture items have no priority.
  459. short sChildPosX;
  460. short sChildPosY;
  461. RHot* phot = m_listCapturing.GetHead();
  462. while (phot != NULL)
  463. {
  464. // Notify user via callback(s).
  465. if (phot->m_ecUser != NULL)
  466. {
  467. (*phot->m_ecUser)(phot, pie->sEvent);
  468. }
  469. if (phot->m_epcUser != NULL)
  470. {
  471. sChildPosX = pie->sPosX;
  472. sChildPosY = pie->sPosY;
  473. // Get the child position equivalent.
  474. phot->GetChildPos(&sChildPosX, &sChildPosY);
  475. (*phot->m_epcUser)(phot, pie->sEvent, sChildPosX, sChildPosY);
  476. }
  477. if (phot->m_iecUser != NULL)
  478. {
  479. // Get the child position equivalent.
  480. phot->GetChildPos(&pie->sPosX, &pie->sPosY);
  481. (*phot->m_iecUser)(phot, pie);
  482. // Convert back to parent coords.
  483. phot->GetTopPos(&pie->sPosX, &pie->sPosY);
  484. }
  485. // Store priority.
  486. if (sPriorityCalled == RHOT_NO_PRIORITY)
  487. {
  488. sPriorityCalled = phot->m_sPriority;
  489. }
  490. else
  491. {
  492. sPriorityCalled = MIN(sPriorityCalled, phot->m_sPriority);
  493. }
  494. phot = m_listCapturing.GetNext();
  495. }
  496. }
  497. // Is the event inside this region . . .
  498. if ( pie->sPosX >= m_sX
  499. && pie->sPosY >= m_sY
  500. && pie->sPosX < m_sX + m_sW
  501. && pie->sPosY < m_sY + m_sH)
  502. {
  503. // Get first child.
  504. RHot* photChild = m_slistActiveChildren.GetHead();
  505. // While there are more children and no prioritized callback has occurred.
  506. while (photChild != NULL)
  507. {
  508. ASSERT(photChild != this);
  509. // If this item is non-prioritized or no prioritized callback
  510. // has yet occurred . . .
  511. if (sPriorityCalled == RHOT_NO_PRIORITY || photChild->m_sPriority == RHOT_NO_PRIORITY)
  512. {
  513. // Convert to child coords.
  514. pie->sPosX -= m_sX;
  515. pie->sPosY -= m_sY;
  516. // Process event in child using our coordinate system.
  517. sPriorityCalled = photChild->Do(pie);
  518. // Convert back to parent coords.
  519. pie->sPosX += m_sX;
  520. pie->sPosY += m_sY;
  521. }
  522. // Get next child.
  523. photChild = m_slistActiveChildren.GetNext();
  524. }
  525. // If no prioritized item yet called or this is a non-prioritized item
  526. // and this item is not capturing . . .
  527. if ((sPriorityCalled == RHOT_NO_PRIORITY || m_sPriority == RHOT_NO_PRIORITY)
  528. && m_sCapture == FALSE)
  529. {
  530. // Notify user via callback(s).
  531. if (m_ecUser != NULL)
  532. {
  533. (*m_ecUser)(this, pie->sEvent);
  534. // Store priority.
  535. sPriorityCalled = m_sPriority;
  536. }
  537. if (m_epcUser != NULL)
  538. {
  539. (*m_epcUser)(this, pie->sEvent, pie->sPosX, pie->sPosY);
  540. // Store priority.
  541. sPriorityCalled = m_sPriority;
  542. }
  543. if (m_iecUser != NULL)
  544. {
  545. (*m_iecUser)(this, pie);
  546. // Store priority.
  547. sPriorityCalled = m_sPriority;
  548. }
  549. }
  550. }
  551. }
  552. return sPriorityCalled;
  553. }
  554. //////////////////////////////////////////////////////////////////////////////
  555. // Querries.
  556. //////////////////////////////////////////////////////////////////////////////
  557. //////////////////////////////////////////////////////////////////////////////
  558. //
  559. // Get the child position equivalent coordinates.
  560. //
  561. //////////////////////////////////////////////////////////////////////////////
  562. void RHot::GetChildPos( // Returns nothing.
  563. short* psX, // In: Top-level position.
  564. // Out: Child position.
  565. short* psY) // In: Top-level position.
  566. // Out: Child position.
  567. {
  568. RHot* photParent = m_photParent;
  569. while (photParent != NULL)
  570. {
  571. // Move through parent's coordinate system.
  572. *psX -= photParent->m_sX;
  573. *psY -= photParent->m_sY;
  574. // Get next parent.
  575. photParent = photParent->m_photParent;
  576. }
  577. }
  578. //////////////////////////////////////////////////////////////////////////////
  579. //
  580. // Get the top position equivalent coordinates.
  581. //
  582. //////////////////////////////////////////////////////////////////////////////
  583. void RHot::GetTopPos( // Returns nothing.
  584. short* psX, // In: Child position.
  585. // Out: Top-level position.
  586. short* psY) // In: Child position.
  587. // Out: Top-level position.
  588. {
  589. RHot* photParent = m_photParent;
  590. while (photParent != NULL)
  591. {
  592. // Move through parent's coordinate system.
  593. *psX += photParent->m_sX;
  594. *psY += photParent->m_sY;
  595. // Get next parent.
  596. photParent = photParent->m_photParent;
  597. }
  598. }
  599. //////////////////////////////////////////////////////////////////////////////
  600. // Internal.
  601. //////////////////////////////////////////////////////////////////////////////
  602. //////////////////////////////////////////////////////////////////////////////
  603. //
  604. // Inits all members of this RHot.
  605. // Returns nothing.
  606. //
  607. //////////////////////////////////////////////////////////////////////////////
  608. void RHot::Init(void)
  609. {
  610. // Initially not active.
  611. m_sActive = FALSE;
  612. // Clear callbacks.
  613. m_ecUser = NULL;
  614. m_epcUser = NULL;
  615. m_iecUser = NULL;
  616. // Clear user value.
  617. m_ulUser = 0L;
  618. // Initialize positions.
  619. m_sX = m_sY = m_sW = m_sH = 0;
  620. // Non-prioritized.
  621. m_sPriority = RHOT_NO_PRIORITY;
  622. // Global; no parent.
  623. m_photParent = NULL;
  624. // Not capturing events.
  625. m_sCapture = FALSE;
  626. }
  627. //////////////////////////////////////////////////////////////////////////////
  628. //
  629. // Gets the list appropriate for this hotbox.
  630. //
  631. //////////////////////////////////////////////////////////////////////////////
  632. RHot::ListHots* RHot::GetCaptureList(void) // Returns Capture list
  633. // appropriate for this RHot.
  634. // Cannot fail.
  635. {
  636. // Go to highest level.
  637. RHot* phot = this;
  638. RHot* photParent = GetParent();
  639. while (photParent != NULL)
  640. {
  641. phot = photParent;
  642. photParent = phot->GetParent();
  643. }
  644. // Use this RHot's capture list.
  645. return &(phot->m_listCapturing);
  646. }
  647. //////////////////////////////////////////////////////////////////////////////
  648. // EOF
  649. //////////////////////////////////////////////////////////////////////////////