]> git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/curicop.h
Allow headers to be compiled in Objective-C++ mode
[wxWidgets.git] / include / wx / msw / curicop.h
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
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' */
20 #define BFT_CURSOR 0x5450 /* 'PT(' */
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
26 WORD DIBNumColors(LPSTR pv);
27
28 struct tagCURFILEHEADER { WORD wReserved; // Always 0
29 WORD wResourceType; // 2 = cursor
30 WORD wResourceCount; // Number of icons in the file
31 };
32
33 typedef struct tagCURFILEHEADER CURFILEHEADER;
34
35 struct tagCURFILERES {
36 BYTE bWidth; // Width of image
37 BYTE bHeight; // Height of image
38 BYTE bColorCount; // Number of colors in image (2, 8, or 16)
39 BYTE bReserved1; // Reserved
40 WORD wXHotspot; // x coordinate of hotspot
41 WORD wYHotspot; // y coordinate of hotspot
42 DWORD dwDIBSize; // Size of DIB for this image
43 DWORD dwDIBOffset; // Offset to DIB for this image
44 };
45
46 typedef struct tagCURFILERES CURFILERES;
47
48 HANDLE ReadCur( LPTSTR szFileName, LPPOINT lpptHotSpot, int *W = 0, int *H = 0);
49 HCURSOR MakeCursor( HANDLE hDIB, LPPOINT lpptHotSpot, HINSTANCE hInst);
50
51 struct tagICONFILEHEADER {
52 WORD wReserved; // Always 0
53 WORD wResourceType; // 1 = icon
54 WORD wResourceCount; // Number of icons in the file
55 };
56
57 typedef struct tagICONFILEHEADER ICONFILEHEADER;
58
59 struct tagICONFILERES {
60 BYTE bWidth; // Width of image
61 BYTE bHeight; // Height of image
62 BYTE bColorCount; // Number of colors in image (2, 8, or 16)
63 BYTE bReserved1; // Reserved
64 WORD wReserved2;
65 WORD wReserved3;
66 DWORD dwDIBSize; // Size of DIB for this image
67 DWORD dwDIBOffset; // Offset to DIB for this image
68 };
69
70 typedef struct tagICONFILERES ICONFILERES;
71
72 HANDLE ReadIcon( wxChar *szFileName, int *W = 0, int *H = 0);
73 HICON MakeIcon( HANDLE hDIB, HINSTANCE hInst);
74
75 #endif
76