home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1996 December / PCWKCD1296.iso / vjplusb / activex / inetsdk / samples / axscript / spruuids / src / spruuids.odl < prev    next >
Encoding:
Microsoft Object Description Language  |  1996-07-15  |  11.1 KB  |  290 lines

  1. //---------------------------------------------------------------------------
  2. // Spruuids.odl
  3. //---------------------------------------------------------------------------
  4. // Sample OLE Scripting host.
  5. //---------------------------------------------------------------------------
  6. // (C) Copyright 1992-1996 by Microsoft Corporation.  All rights reserved.
  7. //
  8. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 
  9. // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 
  10. // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 
  11. // PARTICULAR PURPOSE.
  12. //---------------------------------------------------------------------------
  13.  
  14. #include "DispIDs.h"
  15.  
  16. // NOTE: These are duplicated from dispatch.h. They need to match.
  17. #define DISPID_VALUE 0
  18.  
  19. [uuid(8703FF61-669C-11cf-A92B-00AA00688A2F), version(1.0)]
  20. library SPRUUIDS
  21.   {
  22.   importlib("stdole32.tlb");
  23.  
  24.   coclass   SpruuidsApp;
  25.   interface ISpruuidsApp;
  26.  
  27.   coclass       Game;
  28.   interface     IGame;
  29.   dispinterface IGameEvents;
  30.  
  31.   coclass       SpriteClass;
  32.   interface     ISpriteClass;
  33.   dispinterface ISpriteClassEvents;
  34.  
  35.   coclass   Sprite;
  36.   interface ISprite;
  37.  
  38.  
  39.   //-----------------------------------------------------------------------
  40.   // The SpruuidsApp Object
  41.   //-----------------------------------------------------------------------
  42.   [uuid(8703FF62-669C-11cf-A92B-00AA00688A2F), odl, dual]
  43.   interface ISpruuidsApp : IDispatch
  44.     {
  45.     // Standard properties for all objects
  46.     [id(1), propget] HRESULT Application([out, retval] ISpruuidsApp** ppRet);
  47.     [id(2), propget] HRESULT Parent(     [out, retval] ISpruuidsApp** ppRet);
  48.  
  49.     // Methods
  50.     [id(10)] HRESULT Quit();
  51.  
  52.     // Properties R/O
  53.     [id(30), propget] HRESULT Game([out, retval] IGame** ppRet);
  54.     }
  55.  
  56.   [uuid(8703FF63-669C-11cf-A92B-00AA00688A2F)]
  57.   coclass SpruuidsApp
  58.     {
  59.     [default] interface ISpruuidsApp;
  60.     };
  61.  
  62.  
  63.   //-----------------------------------------------------------------------
  64.   // The Game Object
  65.   //-----------------------------------------------------------------------
  66.   [uuid(8703FF64-669C-11cf-A92B-00AA00688A2F), odl, dual]
  67.   interface IGame : IDispatch
  68.     {
  69.     // Default (value) property/method
  70.     [id(DISPID_VALUE), propget]    HRESULT Caption([out, retval] BSTR* pbstrReturn);
  71.     [id(DISPID_VALUE), propput]    HRESULT Caption([in] BSTR bstr);
  72.  
  73.     // Standard properties for all objects
  74.     [id(1), propget] HRESULT Application([out, retval] ISpruuidsApp** ppRet);
  75.     [id(2), propget] HRESULT Parent(     [out, retval] ISpruuidsApp** ppRet);
  76.  
  77.     // Methods
  78.     [id(10)] HRESULT StartGame();
  79.     [id(11)] HRESULT EndGame();
  80.     [id(12)] HRESULT RemoveAllSprites();
  81.     [id(13)] HRESULT NextLevel();
  82.     [id(14)] HRESULT Refresh();
  83.     [id(15)] HRESULT AddScore([in] int val);
  84.     [id(16)] HRESULT StdBorderBounce([in] ISprite* pspr, [in] int brd);
  85.     [id(17)] HRESULT StdBorderWrap(  [in] ISprite* pspr, [in] int brd);
  86.     [id(18)] HRESULT StdInitRand(    [in] ISprite* pspr, [in] VARIANT user);
  87.     [id(19)] HRESULT StdInitEdge(    [in] ISprite* pspr, [in] VARIANT user);
  88.  
  89.     // Properties R/W
  90.     [id(20), propget] HRESULT Paused([out, retval] boolean* pRet);
  91.     [id(20), propput] HRESULT Paused([in] boolean val);
  92.  
  93.     [id(21), propget] HRESULT Width([out, retval] int* pRet);
  94.     [id(21), propput] HRESULT Width([in] int val);
  95.  
  96.     [id(22), propget] HRESULT Height([out, retval] int* pRet);
  97.     [id(22), propput] HRESULT Height([in] int val);
  98.  
  99.     [id(23), propget] HRESULT BackColor([out, retval] long* pRet);
  100.     [id(23), propput] HRESULT BackColor([in] long val);
  101.  
  102.     [id(24), propget] HRESULT Score([out, retval] int* pRet);
  103.     [id(24), propput] HRESULT Score([in] int val);
  104.  
  105.     [id(25), propget] HRESULT Level([out, retval] int* pRet);
  106.     [id(25), propput] HRESULT Level([in] int val);
  107.  
  108.     [id(26), propget] HRESULT ShipCount([out, retval] int* pRet);
  109.     [id(26), propput] HRESULT ShipCount([in] int val);
  110.  
  111.     [id(27), propget] HRESULT ScoreFirst1Up([out, retval] int* pRet);
  112.     [id(27), propput] HRESULT ScoreFirst1Up([in] int val);
  113.  
  114.     [id(28), propget] HRESULT ScoreSecond1Up([out, retval] int* pRet);
  115.     [id(28), propput] HRESULT ScoreSecond1Up([in] int val);
  116.  
  117.     [id(29), propget] HRESULT DScoreNext1Up([out, retval] int* pRet);
  118.     [id(29), propput] HRESULT DScoreNext1Up([in] int val);
  119.  
  120.     [id(30), propget] HRESULT ShipsStart([out, retval] int* pRet);
  121.     [id(30), propput] HRESULT ShipsStart([in] int val);
  122.  
  123.     [id(31), propget] HRESULT Tag([out, retval] VARIANT* pRet);
  124.     [id(31), propput] HRESULT Tag([in] VARIANT val);
  125.  
  126.     [id(32), propget] HRESULT StatusText([out, retval] BSTR* pbstrReturn);
  127.     [id(32), propput] HRESULT StatusText([in] BSTR bstr);
  128.     }
  129.  
  130.   [uuid(8703FF65-669C-11cf-A92B-00AA00688A2F)]
  131.   dispinterface IGameEvents
  132.     {
  133.     properties:
  134.     methods: // Events
  135.     [id(DISPID_GameEvents_NewGame)]  void NewGame();
  136.     [id(DISPID_GameEvents_NewLevel)] void NewLevel();
  137.     [id(DISPID_GameEvents_NewShip)]  void NewShip();
  138.     [id(DISPID_GameEvents_Collide)]  void Collide( [in] IDispatch* pspr1, [in] IDispatch* pspr2, [in] long collide);
  139.     [id(DISPID_GameEvents_Tick)]     void Tick();
  140.     [id(DISPID_GameEvents_KeyDown)]  void KeyDown( [in] long vk);
  141.     [id(DISPID_GameEvents_KeyPress)] void KeyPress([in] long ascii);
  142.     [id(DISPID_GameEvents_KeyUp)]    void KeyUp(   [in] long vk);
  143.     [id(DISPID_GameEvents_MouseMove)]void MouseMove([in] long x, [in] long y, [in] long keys, [in] long buttons);
  144.     [id(DISPID_GameEvents_MouseDown)]void MouseDown([in] long x, [in] long y, [in] long keys, [in] long buttons);
  145.     [id(DISPID_GameEvents_MouseUp)]  void MouseOver([in] long x, [in] long y, [in] long keys, [in] long buttons);
  146.     }
  147.  
  148.   [uuid(8703FF66-669C-11cf-A92B-00AA00688A2F)]
  149.   coclass Game
  150.     {
  151.     [default]          interface     IGame;
  152.     [default, source]  dispinterface IGameEvents;
  153.     };
  154.  
  155.  
  156.   //-----------------------------------------------------------------------
  157.   // The SpriteClass Object
  158.   //-----------------------------------------------------------------------
  159.   [uuid(8703FF67-669C-11cf-A92B-00AA00688A2F), odl, dual]
  160.   interface ISpriteClass : IDispatch
  161.     {
  162.     // Standard properties for all objects
  163.     [id(1), propget] HRESULT Application([out, retval] ISpruuidsApp** ppRet);
  164.     [id(2), propget] HRESULT Parent(     [out, retval] IGame** ppRet);
  165.  
  166.     // Methods
  167.     [id(10)] HRESULT CreateSprite([in] int x, [in] int y, [in] VARIANT arg, [out, retval] ISprite** ppRet);
  168.  
  169.     // Properties R/W
  170.     [id(11), propget] HRESULT Tag([out, retval] VARIANT* pRet);
  171.     [id(11), propput] HRESULT Tag([in] VARIANT val);
  172.  
  173.     [id(12), propget] HRESULT Image([out, retval] int* pRet);
  174.     [id(12), propput] HRESULT Image([in] int val);
  175.  
  176.     [id(13), propget] HRESULT Border([out, retval] int* pRet);
  177.     [id(13), propput] HRESULT Border([in] int val);
  178.  
  179.     [id(14), propget] HRESULT Collide([out, retval] int* pRet);
  180.     [id(14), propput] HRESULT Collide([in] int val);
  181.  
  182.     [id(15), propget] HRESULT MaximumVelocity([out, retval] float* pRet);
  183.     [id(15), propput] HRESULT MaximumVelocity([in] float val);
  184.  
  185.     [id(16), propget] HRESULT Friction([out, retval] float* pRet);
  186.     [id(16), propput] HRESULT Friction([in] float val);
  187.  
  188.     [id(17), propget] HRESULT MaximumAcceleration([out, retval] float* pRet);
  189.     [id(17), propput] HRESULT MaximumAcceleration([in] float val);
  190.  
  191.     [id(18), propget] HRESULT AccelerationFriction([out, retval] float* pRet);
  192.     [id(18), propput] HRESULT AccelerationFriction([in] float val);
  193.  
  194.     // Properties R/O
  195.     [id(20), propget] HRESULT SpriteCount([out, retval] int* pRet);
  196.     }
  197.  
  198.   [uuid(8703FF68-669C-11cf-A92B-00AA00688A2F)]
  199.   dispinterface ISpriteClassEvents
  200.     {
  201.     properties:
  202.     methods: // Events
  203.     [id(DISPID_SpriteClassEvents_Init)]     void Init(  [in] IDispatch *sprite, [in] VARIANT arg);
  204.     [id(DISPID_SpriteClassEvents_Tick)]     void Tick(  [in] IDispatch *sprite);
  205.     [id(DISPID_SpriteClassEvents_Border)]   void Border([in] IDispatch *sprite, [in] long border);
  206.     [id(DISPID_SpriteClassEvents_Term)]     void Term(  [in] IDispatch *sprite);
  207.     [id(DISPID_SpriteClassEvents_LastTerm)] void lastTerm(void);
  208.     }
  209.  
  210.   [uuid(8703FF69-669C-11cf-A92B-00AA00688A2F)]
  211.   coclass SpriteClass
  212.     {
  213.     [default]          interface     ISpriteClass;
  214.     [default, source]  dispinterface ISpriteClassEvents;
  215.     };
  216.  
  217.  
  218.   //-----------------------------------------------------------------------
  219.   // The Sprite Object
  220.   //-----------------------------------------------------------------------
  221.   [uuid(8703FF6a-669C-11cf-A92B-00AA00688A2F), odl, dual]
  222.   interface ISprite : IDispatch
  223.     {
  224.     // Standard properties for all objects
  225.     [id(1), propget] HRESULT Application([out, retval] ISpruuidsApp** ppRet);
  226.     [id(2), propget] HRESULT Parent(     [out, retval] ISpriteClass** ppRet);
  227.  
  228.     // Methods
  229.     [id(10)] HRESULT MoveTo([in] float x,  [in] float y);
  230.     [id(11)] HRESULT MoveBy([in] float dx, [in] float dy);
  231.     // flags: 1=X, 2=Y, 4=Pos; 8=Vel; 16=Accel; 128=Remember
  232.     [id(12)] HRESULT MoveAtSprite([in] ISprite *sprite, [in] float scale, [in] float dMax, [in] long flags);
  233.     [id(15)] HRESULT Remove();
  234.     [id(16)] HRESULT Refresh();
  235.     [id(17)] HRESULT IgnoreMove();
  236.  
  237.     // Properties R/W
  238.     [id(20), propget] HRESULT Left([out, retval] float* pRet);
  239.     [id(20), propput] HRESULT Left([in] float val);
  240.  
  241.     [id(21), propget] HRESULT Top([out, retval] float* pRet);
  242.     [id(21), propput] HRESULT Top([in] float val);
  243.  
  244.     [id(22), propget] HRESULT Vx([out, retval] float* pRet);
  245.     [id(22), propput] HRESULT Vx([in] float val);
  246.  
  247.     [id(23), propget] HRESULT Vy([out, retval] float* pRet);
  248.     [id(23), propput] HRESULT Vy([in] float val);
  249.  
  250.     [id(24), propget] HRESULT Ax([out, retval] float* pRet);
  251.     [id(24), propput] HRESULT Ax([in] float val);
  252.  
  253.     [id(25), propget] HRESULT Ay([out, retval] float* pRet);
  254.     [id(25), propput] HRESULT Ay([in] float val);
  255.  
  256.     [id(26), propget] HRESULT FrictionX([out, retval] float* pRet);
  257.     [id(26), propput] HRESULT FrictionX([in] float val);
  258.  
  259.     [id(27), propget] HRESULT FrictionY([out, retval] float* pRet);
  260.     [id(27), propput] HRESULT FrictionY([in] float val);
  261.  
  262.     [id(28), propget] HRESULT Image([out, retval] int* pRet);
  263.     [id(28), propput] HRESULT Image([in] int val);
  264.  
  265.     [id(29), propget] HRESULT TickMove([out, retval] int* pRet);
  266.     [id(29), propput] HRESULT TickMove([in] int val);
  267.  
  268.     [id(30), propget] HRESULT TickEvent([out, retval] int* pRet);
  269.     [id(30), propput] HRESULT TickEvent([in] int val);
  270.  
  271.     [id(31), propget] HRESULT Visible([out, retval] boolean* pRet);
  272.     [id(31), propput] HRESULT Visible([in] boolean val);
  273.  
  274.     [id(32), propget] HRESULT Tag([out, retval] VARIANT* pRet);
  275.     [id(32), propput] HRESULT Tag([in] VARIANT val);
  276.  
  277.     // Properties R/O
  278.     [id(40), propget] HRESULT Width( [out, retval] int* pRet);
  279.     [id(41), propget] HRESULT Height([out, retval] int* pRet);
  280.     }
  281.  
  282.   [uuid(8703FF6b-669C-11cf-A92B-00AA00688A2F)]
  283.   coclass Sprite
  284.     {
  285.     [default] interface ISprite;
  286.     };
  287.   }
  288.  
  289. //--- EOF -------------------------------------------------------------------
  290.