1 | /* $Id: iPictureIcon.cpp,v 1.1 1999-11-23 20:45:24 davidr Exp $ */
|
---|
2 | /*
|
---|
3 | * OLE Picture Icon Strategy object
|
---|
4 | *
|
---|
5 | * 20/11/99 - New Code
|
---|
6 | *
|
---|
7 | * Copyright 1999 David J. Raison
|
---|
8 | *
|
---|
9 | * Project Odin Software License can be found in LICENSE.TXT
|
---|
10 | *
|
---|
11 | */
|
---|
12 |
|
---|
13 | #include "oleaut32.h"
|
---|
14 | #include "olectl.h"
|
---|
15 | #include "ipicture.h"
|
---|
16 |
|
---|
17 | // ----------------------------------------------------------------------
|
---|
18 | // Icon Picture
|
---|
19 | // ----------------------------------------------------------------------
|
---|
20 | IPictureIcon::IPictureIcon(IPictureImpl * a_pPicture, HICON hicon)
|
---|
21 | : IPictureStrat(a_pPicture)
|
---|
22 | {
|
---|
23 | pPicture->u.icon.hicon = hicon;
|
---|
24 | }
|
---|
25 |
|
---|
26 | IPictureIcon::~IPictureIcon()
|
---|
27 | {
|
---|
28 | if (pPicture->fOwn)
|
---|
29 | {
|
---|
30 | // Free icon...
|
---|
31 | DestroyIcon(pPicture->u.icon.hicon);
|
---|
32 | }
|
---|
33 | }
|
---|
34 |
|
---|
35 | HRESULT IPictureIcon::get_Handle(OLE_HANDLE * pHandle)
|
---|
36 | {
|
---|
37 | *pHandle = pPicture->u.icon.hicon;
|
---|
38 | return S_OK;
|
---|
39 | }
|
---|
40 |
|
---|
41 | HRESULT IPictureIcon::get_hPal(OLE_HANDLE * phPal)
|
---|
42 | {
|
---|
43 | *phPal = 0;
|
---|
44 | return S_OK;
|
---|
45 | }
|
---|
46 |
|
---|
47 | HRESULT IPictureIcon::get_Type(SHORT * pType)
|
---|
48 | {
|
---|
49 | *pType = PICTYPE_ICON;
|
---|
50 | return S_OK;
|
---|
51 | }
|
---|
52 |
|
---|
53 | HRESULT IPictureIcon::get_Width(OLE_XSIZE_HIMETRIC * pWidth)
|
---|
54 | {
|
---|
55 | // FIXME - Read from system constants...
|
---|
56 | *pWidth = 32;
|
---|
57 |
|
---|
58 | return S_OK;
|
---|
59 | }
|
---|
60 |
|
---|
61 | HRESULT IPictureIcon::get_Height(OLE_YSIZE_HIMETRIC * pHeight)
|
---|
62 | {
|
---|
63 | // FIXME - Read from system constants...
|
---|
64 | *pHeight = 32;
|
---|
65 |
|
---|
66 | return S_OK;
|
---|
67 | }
|
---|
68 |
|
---|
69 | HRESULT IPictureIcon::Render(HDC hdc, LONG x, LONG y, LONG cx, LONG cy,
|
---|
70 | OLE_XPOS_HIMETRIC xSrc, OLE_YPOS_HIMETRIC ySrc,
|
---|
71 | OLE_XSIZE_HIMETRIC cxSrc, OLE_YSIZE_HIMETRIC cySrc,
|
---|
72 | LPCRECT pRcWBounds)
|
---|
73 | {
|
---|
74 | return E_FAIL;
|
---|
75 | }
|
---|
76 |
|
---|
77 | HRESULT IPictureIcon::set_hPal(OLE_HANDLE hPal)
|
---|
78 | {
|
---|
79 | return E_FAIL;
|
---|
80 | }
|
---|
81 |
|
---|
82 | HRESULT IPictureIcon::SaveAsFile(LPSTREAM pStream, BOOL fSaveMemCopy, LONG * pCbSize)
|
---|
83 | {
|
---|
84 | return E_FAIL;
|
---|
85 | }
|
---|
86 |
|
---|
87 | HRESULT IPictureIcon::get_Attributes(DWORD * pDwAttr)
|
---|
88 | {
|
---|
89 | *pDwAttr = PICTURE_TRANSPARENT;
|
---|
90 | return S_OK;
|
---|
91 | }
|
---|