1999-10-24 19:50:17 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: curicop.h
|
|
|
|
// Purpose: Private routines for cursor/icon handling
|
|
|
|
// Author: Various
|
|
|
|
// Modified by:
|
|
|
|
// Created: 01/02/97
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) Julian Smart
|
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_CURICOP_H_
|
|
|
|
#define _WX_CURICOP_H_
|
|
|
|
|
1998-05-20 14:12:05 +00:00
|
|
|
// PRIVATE STUFF FOLLOWS UNTIL END
|
|
|
|
|
|
|
|
// Header signatures for various resources
|
|
|
|
#define BFT_ICON 0x4349 /* 'IC' */
|
|
|
|
#define BFT_BITMAP 0x4d42 /* 'BM' */
|
1999-10-04 20:15:38 +00:00
|
|
|
#define BFT_CURSOR 0x5450 /* 'PT(' */
|
1998-05-20 14:12:05 +00:00
|
|
|
|
|
|
|
// This WIDTHBYTES macro determines the number of BYTES per scan line.
|
|
|
|
#define WIDTHBYTES( i) ((i + 31) / 32 * 4)
|
|
|
|
#define IS_WIN30_DIB( lpbi) ((*(LPDWORD)( lpbi)) == sizeof( BITMAPINFOHEADER))
|
|
|
|
|
|
|
|
WORD DIBNumColors(LPSTR pv);
|
|
|
|
WORD PaletteSize(LPSTR lpbi);
|
|
|
|
|
|
|
|
|
|
|
|
struct tagCURFILEHEADER { WORD wReserved; // Always 0
|
|
|
|
WORD wResourceType; // 2 = cursor
|
|
|
|
WORD wResourceCount; // Number of icons in the file
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct tagCURFILEHEADER CURFILEHEADER;
|
|
|
|
|
|
|
|
struct tagCURFILERES {
|
|
|
|
BYTE bWidth; // Width of image
|
|
|
|
BYTE bHeight; // Height of image
|
|
|
|
BYTE bColorCount; // Number of colors in image (2, 8, or 16)
|
|
|
|
BYTE bReserved1; // Reserved
|
|
|
|
WORD wXHotspot; // x coordinate of hotspot
|
|
|
|
WORD wYHotspot; // y coordinate of hotspot
|
|
|
|
DWORD dwDIBSize; // Size of DIB for this image
|
|
|
|
DWORD dwDIBOffset; // Offset to DIB for this image
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct tagCURFILERES CURFILERES;
|
|
|
|
|
1999-06-19 08:44:05 +00:00
|
|
|
HANDLE ReadCur( LPTSTR szFileName, LPPOINT lpptHotSpot, int *W = 0, int *H = 0);
|
1998-05-20 14:12:05 +00:00
|
|
|
HBITMAP ColorDDBToMonoDDB( HBITMAP hbm);
|
|
|
|
HCURSOR MakeCursor( HANDLE hDIB, LPPOINT lpptHotSpot, HINSTANCE hInst);
|
|
|
|
|
|
|
|
struct tagICONFILEHEADER {
|
|
|
|
WORD wReserved; // Always 0
|
|
|
|
WORD wResourceType; // 1 = icon
|
|
|
|
WORD wResourceCount; // Number of icons in the file
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct tagICONFILEHEADER ICONFILEHEADER;
|
|
|
|
|
|
|
|
struct tagICONFILERES {
|
|
|
|
BYTE bWidth; // Width of image
|
|
|
|
BYTE bHeight; // Height of image
|
|
|
|
BYTE bColorCount; // Number of colors in image (2, 8, or 16)
|
|
|
|
BYTE bReserved1; // Reserved
|
|
|
|
WORD wReserved2;
|
|
|
|
WORD wReserved3;
|
|
|
|
DWORD dwDIBSize; // Size of DIB for this image
|
|
|
|
DWORD dwDIBOffset; // Offset to DIB for this image
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct tagICONFILERES ICONFILERES;
|
|
|
|
|
1999-06-19 08:12:26 +00:00
|
|
|
HANDLE ReadIcon( wxChar *szFileName, int *W = 0, int *H = 0);
|
1998-05-20 14:12:05 +00:00
|
|
|
HICON MakeIcon( HANDLE hDIB, HINSTANCE hInst);
|
|
|
|
|
1999-10-24 19:50:17 +00:00
|
|
|
#endif
|
|
|
|
|