home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 21 / AACD 21.iso / AACD / Programming / amigatalk / intuition / SetupIntuition.st < prev    next >
Encoding:
Text File  |  2001-02-28  |  1.6 KB  |  62 lines

  1. " ------------------------------------------------------------------- "
  2. " Intuition Class is a Singleton class that allows the user to        "
  3. " reference intuition-specific singleton classes in one spot.         "
  4. " ------------------------------------------------------------------- "
  5.  
  6. Class Intuition :Dictionary 
  7. ! uniqueInstance gadgetAttrs gadgetFlags gadgetTypes gadToolsAttrs
  8.   idcmpFlags     screenTags  windowFlags windowTags
  9. !
  10. [
  11.    privateNew ! newInstance !
  12.      newInstance <- super new.
  13.      ^ newInstance
  14. |
  15.    new
  16.      ^ (self privateSetup)
  17. |
  18.    privateSetup
  19.      (uniqueInstance isNil)
  20.        ifTrue: [uniqueInstance <- self privateNew.
  21.                 
  22.                 "Initialize all Intuition Singleton classes:"
  23.                 gadToolsAttrs <- GadToolsAttributes new.
  24.  
  25.                 gadgetAttrs   <- GadgetAttributes   new.
  26.                 gadgetFlags   <- GadgetFlags        new.
  27.                 gadgetTypes   <- GadgetTypes        new.
  28.  
  29.                 screenTags    <- ScreenTags         new.
  30.                 windowTags    <- WindowTags         new.
  31.                 windowFlags   <- WindowFlags        new.
  32.                 idcmpFlags    <- IDCMPFlags         new.
  33.                ].
  34.  
  35.      ^ self "uniqueInstance??"
  36. |
  37.    getGadgetAttr:  key
  38.      ^ gadgetAttrs at: key
  39. |
  40.    getGadToolAttr: key
  41.      ^ gadToolsAttrs at: key
  42. |
  43.    getGadgetFlag:  key
  44.      ^ gadgetFlags at: key
  45. |
  46.    getGadgetType:  key
  47.      ^ gadgetTypes at: key
  48. |
  49.    getScreenTag:   key
  50.      ^ screenTags at: key
  51. |
  52.    getWindowTag:   key
  53.      ^ windowTags at: key
  54. |
  55.    getIDCMPFlag:   key
  56.      ^ idcmpFlags at: key
  57. |
  58.    getWindowFlag:  key
  59.      ^ windowFlags at: key
  60. ]
  61.  
  62.