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 / ipoly5.h < prev    next >
C/C++ Source or Header  |  1995-05-03  |  4KB  |  136 lines

  1. /*
  2.  * IPOLY5.H
  3.  * Polyline Object Chapter 5
  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 _IPOLY5_H_
  18. #define _IPOLY5_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. #undef  INTERFACE
  49. #define INTERFACE IPolylineAdviseSink5
  50.  
  51.  
  52. /*
  53.  * When someone initializes a polyline and is interested in receiving
  54.  * notifications on events, then they provide one of these objects.
  55.  */
  56.  
  57. DECLARE_INTERFACE_(IPolylineAdviseSink5, IUnknown)
  58.     {
  59.     //IUnknown members
  60.     STDMETHOD(QueryInterface) (THIS_ REFIID, PPVOID) PURE;
  61.     STDMETHOD_(ULONG,AddRef)  (THIS) PURE;
  62.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  63.  
  64.     //Advise members.
  65.     STDMETHOD_(void,OnPointChange)     (THIS) PURE;
  66.     STDMETHOD_(void,OnSizeChange)      (THIS) PURE;
  67.     STDMETHOD_(void,OnDataChange)      (THIS) PURE;
  68.     STDMETHOD_(void,OnColorChange)     (THIS) PURE;
  69.     STDMETHOD_(void,OnLineStyleChange) (THIS) PURE;
  70.     };
  71.  
  72. typedef IPolylineAdviseSink5 *PPOLYLINEADVISESINK5;
  73.  
  74.  
  75. #undef  INTERFACE
  76. #define INTERFACE IPolyline5
  77.  
  78. DECLARE_INTERFACE_(IPolyline5, IUnknown)
  79.     {
  80.     //IUnknown members
  81.     STDMETHOD(QueryInterface) (THIS_ REFIID, PPVOID) PURE;
  82.     STDMETHOD_(ULONG,AddRef)  (THIS) PURE;
  83.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  84.  
  85.     //IPolyline members
  86.  
  87.     //File-related members:
  88.     STDMETHOD(ReadFromFile) (THIS_ LPTSTR) PURE;
  89.     STDMETHOD(WriteToFile)  (THIS_ LPTSTR) PURE;
  90.  
  91.     //Data transfer members:
  92.     STDMETHOD(DataSet)      (THIS_ PPOLYLINEDATA, BOOL, BOOL) PURE;
  93.     STDMETHOD(DataGet)      (THIS_ PPOLYLINEDATA) PURE;
  94.     STDMETHOD(DataSetMem)   (THIS_ HGLOBAL, BOOL, BOOL, BOOL) PURE;
  95.     STDMETHOD(DataGetMem)   (THIS_ HGLOBAL *) PURE;
  96.     STDMETHOD(RenderBitmap) (THIS_ HBITMAP *) PURE;
  97.     STDMETHOD(RenderMetafile) (THIS_ HMETAFILE *) PURE;
  98.     STDMETHOD(RenderMetafilePict) (THIS_ HGLOBAL *) PURE;
  99.  
  100.     //Manipulation members:
  101.     STDMETHOD(Init)   (THIS_ HWND, LPRECT, DWORD, UINT) PURE;
  102.     STDMETHOD(New)    (THIS) PURE;
  103.     STDMETHOD(Undo)   (THIS) PURE;
  104.     STDMETHOD(Window) (THIS_ HWND *) PURE;
  105.  
  106.     STDMETHOD(RectGet) (THIS_ LPRECT) PURE;
  107.     STDMETHOD(SizeGet) (THIS_ LPRECT) PURE;
  108.     STDMETHOD(RectSet) (THIS_ LPRECT, BOOL) PURE;
  109.     STDMETHOD(SizeSet) (THIS_ LPRECT, BOOL) PURE;
  110.  
  111.     STDMETHOD(ColorSet) (THIS_ UINT, COLORREF, COLORREF *) PURE;
  112.     STDMETHOD(ColorGet) (THIS_ UINT, COLORREF *) PURE;
  113.  
  114.     STDMETHOD(LineStyleSet) (THIS_ UINT, UINT *) PURE;
  115.     STDMETHOD(LineStyleGet) (THIS_ UINT *) PURE;
  116.     };
  117.  
  118. typedef IPolyline5 *PPOLYLINE5;
  119.  
  120.  
  121. //Error values for data transfer functions
  122. #define POLYLINE_E_INVALIDPOINTER   \
  123.     MAKE_SCODE(SEVERITY_ERROR, FACILITY_ITF, 1)
  124. #define POLYLINE_E_READFAILURE      \
  125.     MAKE_SCODE(SEVERITY_ERROR, FACILITY_ITF, 2)
  126. #define POLYLINE_E_WRITEFAILURE     \
  127.     MAKE_SCODE(SEVERITY_ERROR, FACILITY_ITF, 3)
  128.  
  129.  
  130. //Color indices for color member functions
  131. #define POLYLINECOLOR_BACKGROUND    0
  132. #define POLYLINECOLOR_LINE          1
  133.  
  134.  
  135. #endif //_IPOLY5_H_
  136.