home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / com / inole2 / inc / ipoly10.h < prev    next >
C/C++ Source or Header  |  1995-05-03  |  4KB  |  137 lines

  1. /*
  2.  * IPOLY10.H
  3.  * Polyline Object Chapter 10
  4.  *
  5.  * Definition of an IPolyline interface for a Polyline object.
  6.  * This custom interface and is only supported from DLL-based
  7.  * objects.
  8.  *
  9.  * Copyright (c)1993-1995 Microsoft Corporation, All Rights Reserved
  10.  *
  11.  * Kraig Brockschmidt, Microsoft
  12.  * Internet  :  kraigb@microsoft.com
  13.  * Compuserve:  >INTERNET:kraigb@microsoft.com
  14.  */
  15.  
  16.  
  17. #ifndef _IPOLY10_H_
  18. #define _IPOLY10_H_
  19.  
  20.  
  21. //Versioning.
  22. #define VERSIONMAJOR                2
  23. #define VERSIONMINOR                0
  24. #define VERSIONCURRENT              0x00020000
  25.  
  26. #define CPOLYLINEPOINTS             20
  27.  
  28. //Version 2.0 Polyline Structure
  29. typedef struct tagPOLYLINEDATA
  30.     {
  31.     WORD        wVerMaj;                //Major version number
  32.     WORD        wVerMin;                //Minor version number
  33.     WORD        cPoints;                //Number of points
  34.     short       fReserved;              //Previously fDrawEntire
  35.     RECTS       rc;                     //Rectangle of figure
  36.     POINTS      rgpt[CPOLYLINEPOINTS];  //Points on 0-32767 grid
  37.  
  38.     //Version 2.0 additions
  39.     COLORREF    rgbBackground;          //Background color
  40.     COLORREF    rgbLine;                //Line color
  41.     short       iLineStyle;             //Line style
  42.     } POLYLINEDATA, *PPOLYLINEDATA;
  43.  
  44. #define CBPOLYLINEDATA   sizeof(POLYLINEDATA)
  45.  
  46.  
  47. /*
  48.  * !!Addition:  Clipboard format shared with using applications
  49.  * This name matches those in the stringtable of all Cosmo and CoCosmo
  50.  * versions.  All data is interchangable.
  51.  */
  52. #define SZPOLYLINECLIPFORMAT        TEXT("Polyline Figure")
  53.  
  54.  
  55. #ifndef OMIT_POLYLINESINK
  56.  
  57. #undef  INTERFACE
  58. #define INTERFACE IPolylineAdviseSink10
  59.  
  60.  
  61. /*
  62.  * When someone initializes a polyline and is interested in receiving
  63.  * notifications on events, then they provide one of these objects.
  64.  */
  65.  
  66. DECLARE_INTERFACE_(IPolylineAdviseSink10, IUnknown)
  67.     {
  68.     //IUnknown members
  69.     STDMETHOD(QueryInterface) (THIS_ REFIID, PPVOID) PURE;
  70.     STDMETHOD_(ULONG,AddRef)  (THIS) PURE;
  71.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  72.  
  73.     //Advise members.
  74.     STDMETHOD_(void,OnPointChange)     (THIS) PURE;
  75.     STDMETHOD_(void,OnSizeChange)      (THIS) PURE;
  76.     STDMETHOD_(void,OnColorChange)     (THIS) PURE;
  77.     STDMETHOD_(void,OnLineStyleChange) (THIS) PURE;
  78.     //OnDataChange replaced with IAdviseSink
  79.     };
  80.  
  81. typedef IPolylineAdviseSink10 *PPOLYLINEADVISESINK;
  82.  
  83. #endif //OMIT_POLYLINESINK
  84.  
  85.  
  86. #undef  INTERFACE
  87. #define INTERFACE IPolyline10
  88.  
  89. DECLARE_INTERFACE_(IPolyline10, IUnknown)
  90.     {
  91.     //IUnknown members
  92.     STDMETHOD(QueryInterface) (THIS_ REFIID, PPVOID) PURE;
  93.     STDMETHOD_(ULONG,AddRef)  (THIS) PURE;
  94.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  95.  
  96.     //IPolyline members
  97.  
  98.     //File-related members use IPersistStorage, IPersistStreamInit
  99.     //Data transfer members use IDataObject
  100.  
  101.     //Manipulation members:
  102.     STDMETHOD(Init)   (THIS_ HWND, LPRECT, DWORD, UINT) PURE;
  103.     STDMETHOD(New)    (THIS) PURE;
  104.     STDMETHOD(Undo)   (THIS) PURE;
  105.     STDMETHOD(Window) (THIS_ HWND *) PURE;
  106.  
  107.     STDMETHOD(RectGet) (THIS_ LPRECT) PURE;
  108.     STDMETHOD(SizeGet) (THIS_ LPRECT) PURE;
  109.     STDMETHOD(RectSet) (THIS_ LPRECT, BOOL) PURE;
  110.     STDMETHOD(SizeSet) (THIS_ LPRECT, BOOL) PURE;
  111.  
  112.     STDMETHOD(ColorSet) (THIS_ UINT, COLORREF, COLORREF *) PURE;
  113.     STDMETHOD(ColorGet) (THIS_ UINT, COLORREF *) PURE;
  114.  
  115.     STDMETHOD(LineStyleSet) (THIS_ UINT, UINT *) PURE;
  116.     STDMETHOD(LineStyleGet) (THIS_ UINT *) PURE;
  117.     };
  118.  
  119. typedef IPolyline10 *PPOLYLINE;
  120.  
  121.  
  122. //Error values for data transfer functions
  123. #define POLYLINE_E_INVALIDPOINTER   \
  124.     MAKE_SCODE(SEVERITY_ERROR, FACILITY_ITF, 1)
  125. #define POLYLINE_E_READFAILURE      \
  126.     MAKE_SCODE(SEVERITY_ERROR, FACILITY_ITF, 2)
  127. #define POLYLINE_E_WRITEFAILURE     \
  128.     MAKE_SCODE(SEVERITY_ERROR, FACILITY_ITF, 3)
  129.  
  130.  
  131. //Color indices for color member functions
  132. #define POLYLINECOLOR_BACKGROUND    0
  133. #define POLYLINECOLOR_LINE          1
  134.  
  135.  
  136. #endif //_IPOLY10_H_
  137.