home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / com / activexcontrol / basectl / card / card.odl < prev    next >
Text File  |  1997-10-05  |  5KB  |  157 lines

  1. //=--------------------------------------------------------------------------=
  2. // Card.ODL
  3. //=--------------------------------------------------------------------------=
  4. // Copyright 1995 - 1997 Microsoft Corporation.  All Rights Reserved.
  5. //
  6. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 
  7. // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 
  8. // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 
  9. // PARTICULAR PURPOSE.
  10. //=--------------------------------------------------------------------------=
  11. //
  12. // ODL file for the control(s) and automation object(s) in this inproc server
  13. //
  14. #include <olectl.h>
  15. #include "dispids.h"
  16.  
  17. // can't include oaidl.h, so this will have to do
  18. //
  19. #define DISPID_NEWENUM -4
  20. //#define VARIANT_BOOL short
  21.  
  22. //=--------------------------------------------------------------------------=
  23. // the libid for this type libray
  24. //
  25. [
  26.     uuid(55707B20-FF82-11cf-BB32-142A04C10000),
  27.     helpstring("ActiveX SDK Card Control Library"),
  28.     lcid(0x0000),
  29.     version(1.0)
  30. ]
  31. library CardObjects {
  32.  
  33.     // standard imports
  34.     //
  35.     importlib("STDOLE2.TLB");
  36.     importlib(STDTYPE_TLB);
  37.  
  38.     typedef enum {
  39.     [helpstring("TopLeft")]       CardTopLeft = 0,
  40.     [helpstring("TopCenter")]       CardTopCenter = 1,
  41.     [helpstring("TopRight")]      CardTopRight = 2,
  42.     [helpstring("CenterLeft")]       CardCenterLeft = 3,
  43.     [helpstring("Center")]       CardCenter = 4,
  44.     [helpstring("CenterRight")]      CardCenterRight = 5,
  45.     [helpstring("BottomLeft")]      CardBottomLeft = 6,
  46.     [helpstring("BottomCenter")]       CardBottomCenter = 7,
  47.     [helpstring("BottomRight")]      CardBottomRight = 8,
  48.     [helpstring("Stretch")]      CardStretch = 9    
  49.     } enumCardAlignment;
  50.  
  51.     typedef enum {
  52.     [helpstring("Ace")]       CardAce = 1,
  53.     [helpstring("Two")]      Card2 = 2,
  54.     [helpstring("Three")]      Card3 = 3,
  55.     [helpstring("Four")]      Card4 = 4,    
  56.     [helpstring("Five")]      Card5 = 5,
  57.     [helpstring("Six")]      Card6 = 6,
  58.     [helpstring("Seven")]      Card7 = 7,
  59.     [helpstring("Eight")]      Card8 = 8,
  60.     [helpstring("Nine")]      Card9 = 9,
  61.     [helpstring("Ten")]      Card10 = 10,
  62.     [helpstring("Jack")]      CardJack = 11,
  63.     [helpstring("Queen")]      CardQueen = 12,
  64.     [helpstring("King")]      CardKing = 13,
  65.     [helpstring("Joker")]      CardJoker = 14
  66.     } enumCardNumber;
  67.  
  68.     typedef enum {
  69.     [helpstring("Invisible")]        CardBlank = 0,
  70.     [helpstring("Clubs")]            CardClub = 1,
  71.     [helpstring("Spades")]            CardSpade = 2,
  72.     [helpstring("Hearts")]            CardHeart = 3,
  73.     [helpstring("Diamonds")]        CardDiamond = 4,
  74.     [helpstring("CardBack Weave1")]        CardBack1 = -1,
  75.     [helpstring("CardBack Weave2")]        CardBack2 = -2,
  76.     [helpstring("CardBack Robot")]        CardBack3 = -3,
  77.     [helpstring("CardBack Roses")]        CardBack4 = -4,
  78.     [helpstring("CardBack BlackVine")]    CardBack5 = -5,
  79.     [helpstring("CardBack BlueVine")]    CardBack6 = -6,
  80.     [helpstring("CardBack Fish1")]        CardBack7 = -7,
  81.     [helpstring("CardBack Fish2")]        CardBack8 = -8,
  82.     [helpstring("CardBack Seashell")]    CardBack9 = -9,
  83.     [helpstring("CardBack Castle")]        CardBack10 = -10,
  84.     [helpstring("CardBack Beach")]        CardBack11 = -11,
  85.     [helpstring("CardBack Hand")]        CardBack12 = -12,
  86.     [helpstring("CardBack Casino")]        CardBack13 = -13
  87.     } enumCardSuite;
  88.     
  89.     // primary dispatch interface for CCard control
  90.     //
  91.     [
  92.     uuid(55707B21-FF82-11cf-BB32-142A04C10000),
  93.                 helpstring("ActiveX SDK Card Control"),
  94.         hidden,
  95.         dual,
  96.         odl
  97.     ]
  98.     interface ICard : IDispatch {
  99.  
  100.         // properties
  101.         //
  102.     [id(DISPID_NUMBER), propget]
  103.             HRESULT Number([out, retval] enumCardNumber *number);
  104.         [id(DISPID_NUMBER), propput]
  105.             HRESULT Number([in] enumCardNumber number);
  106.  
  107.     [id(DISPID_SUITE), propget]
  108.             HRESULT Suite([out, retval] enumCardSuite *suite);
  109.         [id(DISPID_SUITE), propput]
  110.             HRESULT Suite([in] enumCardSuite suite);
  111.  
  112.     [id(DISPID_INVERT), propget]
  113.             HRESULT Invert([out, retval] Boolean *invert);
  114.         [id(DISPID_INVERT), propput]
  115.             HRESULT Invert([in] Boolean invert);
  116.  
  117.     [id(DISPID_CARDALIGNMENT), propget]
  118.             HRESULT CardAlignment([out, retval] enumCardAlignment *cardalignment);
  119.         [id(DISPID_CARDALIGNMENT), propput]
  120.             HRESULT CardAlignment([in] enumCardAlignment cardalignment);
  121.  
  122.         // methods
  123.         //
  124.         [id(DISPID_ABOUTBOX)]
  125.             void AboutBox(void);
  126.     };
  127.  
  128.     // event interface for CCard controls ...
  129.     //
  130.     [
  131.     uuid(55707B22-FF82-11cf-BB32-142A04C10000),
  132.                helpstring("Event interface for ActiveX SDK Card control"),
  133.         hidden
  134.     ]
  135.     dispinterface DCardEvents {
  136.         
  137.     properties:
  138.     methods:
  139.         [id(DISPID_MOUSEMOVE)] void MouseMove(short Button, short Shift, OLE_XPOS_PIXELS x, OLE_YPOS_PIXELS y);
  140.         [id(DISPID_CLICK)] void Click();
  141.         [id(DISPID_DBLCLICK)] void DblClick();
  142.         [id(DISPID_MOUSEDOWN)] void MouseDown(short Button, short Shift, OLE_XPOS_PIXELS x, OLE_YPOS_PIXELS y);
  143.         [id(DISPID_MOUSEUP)] void MouseUp(short Button, short Shift, OLE_XPOS_PIXELS x, OLE_YPOS_PIXELS y);
  144.     };
  145.  
  146.     // coclass for Card controls
  147.     //
  148.     [
  149.     uuid(55707B23-FF82-11cf-BB32-142A04C10000),
  150.                 helpstring("ActiveX SDK Card control")
  151.     ]
  152.     coclass Card {
  153.         [default]         interface ICard;
  154.                 [default, source] dispinterface DCardEvents;
  155.     };
  156. };
  157.