home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc / OpenDoc Development / Debugging Support / OpenDoc™ Source Code / UI / FocusItr.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-08-28  |  3.4 KB  |  147 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        FocusItr.cpp
  3.  
  4.     Contains:    xxx put contents here xxx
  5.  
  6.     Owned by:    xxx put writers here xxx
  7.  
  8.     Copyright:    © 1994 - 1995 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     Change History (most recent first):
  11.  
  12.          <7>      8/3/95    RR        #1257260: Collapse B classes. Remove
  13.                                     somInit methods. Don't call IsInitialized
  14.                                     or SubclassResponsibility
  15.          <6>     6/22/95    RR        Call InitObject
  16.          <5>     5/26/95    RR        #1251403: Multithreading naming support
  17.          <4>     5/25/95    jpa        List.h --> LinkList.h [1253324]
  18.          <3>      4/7/95    RR        #1216618 Added SOM_TRY etc.
  19.          <2>     2/22/95    RR        #1209427 Changed private api between
  20.                                     iterator and iteratee
  21.          <1>     9/26/94    RR        first checked in
  22.  
  23.     To Do:
  24.     In Progress:
  25. */
  26.  
  27.  
  28. /*
  29.  *  This file was generated by the SOM Compiler.
  30.  *  Generated using: 
  31.  *      SOM Emitter emitxtm.dll: somc/smmain.c
  32.  */
  33.  
  34. #define ODFocusSetIterator_Class_Source
  35. #define VARIABLE_MACROS
  36. #include <FocusItr.xih>
  37.  
  38. #ifndef SOM_ODFocusSet_xh
  39. #include "FocusSet.xh"
  40. #endif
  41.  
  42. #ifndef SOM_Module_OpenDoc_Foci_defined
  43. #include "Foci.xh"    // For kODNULLFocus. 
  44. #endif
  45.  
  46. #ifndef _ARBUTILS_
  47. #include "ArbUtils.h"
  48. #endif
  49.  
  50. #ifndef _LINKLIST_
  51. #include <LinkList.h>
  52. #endif
  53.  
  54. #ifndef _EXCEPT_
  55. #include "Except.h"
  56. #endif
  57.  
  58. #pragma segment ODFocusSet
  59.  
  60. SOM_Scope ODTypeToken  SOMLINK ODFocusSetIteratorFirst(ODFocusSetIterator *somSelf, Environment *ev)
  61. {
  62.     ODFocusSetIteratorData *somThis = ODFocusSetIteratorGetData(somSelf);
  63.     ODFocusSetIteratorMethodDebug("ODFocusSetIterator","ODFocusSetIteratorFirst");
  64.  
  65.     ODTypeToken focus = kODNullFocus;
  66.     
  67.     SOM_TRY
  68.  
  69.         focus = _fFocusSet->First(ev, _fIteratorID);
  70.     
  71.     SOM_CATCH_ALL
  72.     SOM_ENDTRY
  73.     
  74.     return focus;
  75. }
  76.  
  77. SOM_Scope ODTypeToken  SOMLINK ODFocusSetIteratorNext(ODFocusSetIterator *somSelf, Environment *ev)
  78. {
  79.     ODFocusSetIteratorData *somThis = ODFocusSetIteratorGetData(somSelf);
  80.     ODFocusSetIteratorMethodDebug("ODFocusSetIterator","ODFocusSetIteratorNext");
  81.  
  82.     ODTypeToken focus = kODNullFocus;
  83.     
  84.     SOM_TRY
  85.  
  86.         focus = _fFocusSet->Next(ev, _fIteratorID);
  87.     
  88.     SOM_CATCH_ALL
  89.     SOM_ENDTRY
  90.  
  91.     return focus;
  92. }
  93.  
  94. SOM_Scope ODBoolean  SOMLINK ODFocusSetIteratorIsNotComplete(ODFocusSetIterator *somSelf, Environment *ev)
  95. {
  96.     ODFocusSetIteratorData *somThis = ODFocusSetIteratorGetData(somSelf);
  97.     ODFocusSetIteratorMethodDebug("ODFocusSetIterator","ODFocusSetIteratorIsNotComplete");
  98.  
  99.     ODBoolean isNotComplete = kODFalse;
  100.     
  101.     SOM_TRY
  102.  
  103.         isNotComplete = _fFocusSet->IsNotComplete(ev, _fIteratorID);
  104.     
  105.     SOM_CATCH_ALL
  106.     SOM_ENDTRY
  107.  
  108.     return isNotComplete;
  109. }
  110.  
  111. SOM_Scope void  SOMLINK ODFocusSetIteratorInitFocusSetIterator(ODFocusSetIterator *somSelf, Environment *ev,
  112.         ODFocusSet* focusSet)
  113. {
  114.     ODFocusSetIteratorData *somThis = ODFocusSetIteratorGetData(somSelf);
  115.     ODFocusSetIteratorMethodDebug("ODFocusSetIterator","ODFocusSetIteratorInitFocusSetIterator");
  116.  
  117.     _fFocusSet = focusSet;
  118.  
  119.     SOM_TRY
  120.     
  121.         /* Moved from somInit. SOM itself sets fields to zero
  122.         _fFocusSet = kODNULL;
  123.         _fIteratorID = 0;
  124.         */
  125.         
  126.         somSelf->InitObject(ev);
  127.     
  128.         if (_fFocusSet)
  129.             _fIteratorID = _fFocusSet->AddIterator(ev, somSelf);
  130.  
  131.     SOM_CATCH_ALL
  132.     SOM_ENDTRY
  133. }
  134.  
  135.  
  136. SOM_Scope void  SOMLINK ODFocusSetIteratorsomUninit(ODFocusSetIterator *somSelf)
  137. {
  138.     ODFocusSetIteratorData *somThis = ODFocusSetIteratorGetData(somSelf);
  139.     ODFocusSetIteratorMethodDebug("ODFocusSetIterator","ODFocusSetIteratorsomUninit");
  140.  
  141.  
  142.     _fFocusSet->RemoveIterator(somGetGlobalEnvironment(), _fIteratorID);
  143.     _fIteratorID = 0;
  144.     _fFocusSet = kODNULL;
  145.     parent_somUninit(somSelf);
  146. }
  147.