]> git.saurik.com Git - wxWidgets.git/blame - include/wx/msw/curicop.h
applied wxNativeFontInfo patch from Derry Bryson (with minor changes)
[wxWidgets.git] / include / wx / msw / curicop.h
CommitLineData
8fb3a512
JS
1/////////////////////////////////////////////////////////////////////////////
2// Name: curicop.h
3// Purpose: Private routines for cursor/icon handling
4// Author: Various
5// Modified by:
6// Created: 01/02/97
7// RCS-ID: $Id$
8// Copyright: (c) Julian Smart
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_CURICOP_H_
13#define _WX_CURICOP_H_
14
2bda0e17
KB
15// PRIVATE STUFF FOLLOWS UNTIL END
16
17// Header signatures for various resources
18#define BFT_ICON 0x4349 /* 'IC' */
19#define BFT_BITMAP 0x4d42 /* 'BM' */
e90c1d2a 20#define BFT_CURSOR 0x5450 /* 'PT(' */
2bda0e17
KB
21
22// This WIDTHBYTES macro determines the number of BYTES per scan line.
23#define WIDTHBYTES( i) ((i + 31) / 32 * 4)
24#define IS_WIN30_DIB( lpbi) ((*(LPDWORD)( lpbi)) == sizeof( BITMAPINFOHEADER))
25
26WORD DIBNumColors(LPSTR pv);
27WORD PaletteSize(LPSTR lpbi);
28
29
30struct tagCURFILEHEADER { WORD wReserved; // Always 0
31 WORD wResourceType; // 2 = cursor
32 WORD wResourceCount; // Number of icons in the file
33 };
34
35typedef struct tagCURFILEHEADER CURFILEHEADER;
36
37struct tagCURFILERES {
38 BYTE bWidth; // Width of image
39 BYTE bHeight; // Height of image
40 BYTE bColorCount; // Number of colors in image (2, 8, or 16)
41 BYTE bReserved1; // Reserved
42 WORD wXHotspot; // x coordinate of hotspot
43 WORD wYHotspot; // y coordinate of hotspot
44 DWORD dwDIBSize; // Size of DIB for this image
45 DWORD dwDIBOffset; // Offset to DIB for this image
46 };
47
48typedef struct tagCURFILERES CURFILERES;
49
6c00e46f 50HANDLE ReadCur( LPTSTR szFileName, LPPOINT lpptHotSpot, int *W = 0, int *H = 0);
2bda0e17
KB
51HBITMAP ColorDDBToMonoDDB( HBITMAP hbm);
52HCURSOR MakeCursor( HANDLE hDIB, LPPOINT lpptHotSpot, HINSTANCE hInst);
53
54struct tagICONFILEHEADER {
55 WORD wReserved; // Always 0
56 WORD wResourceType; // 1 = icon
57 WORD wResourceCount; // Number of icons in the file
58 };
59
60typedef struct tagICONFILEHEADER ICONFILEHEADER;
61
62struct tagICONFILERES {
63 BYTE bWidth; // Width of image
64 BYTE bHeight; // Height of image
65 BYTE bColorCount; // Number of colors in image (2, 8, or 16)
66 BYTE bReserved1; // Reserved
67 WORD wReserved2;
68 WORD wReserved3;
69 DWORD dwDIBSize; // Size of DIB for this image
70 DWORD dwDIBOffset; // Offset to DIB for this image
71 };
72
73typedef struct tagICONFILERES ICONFILERES;
74
d9a451ce 75HANDLE ReadIcon( wxChar *szFileName, int *W = 0, int *H = 0);
2bda0e17
KB
76HICON MakeIcon( HANDLE hDIB, HINSTANCE hInst);
77
8fb3a512
JS
78#endif
79