* *
* FUNCTIONS : *
* *
- * ReadDIB() - Reads a DIB *
+ * wxReadDIB() - Reads a DIB *
* *
* WriteDIB() - Writes a global handle in CF_DIB format*
* to a file. *
/* Header signatutes for various resources */
#define BFT_ICON 0x4349 /* 'IC' */
#define BFT_BITMAP 0x4d42 /* 'BM' */
-#define BFT_CURSOR 0x5450 /* 'PT' */
+#define BFT_CURSOR 0x5450 /* 'PT(' */
/* macro to determine if resource is a DIB */
#define ISDIB(bft) ((bft) == BFT_BITMAP)
#define PALVERSION 0x300
#define MAXPALETTE 256 /* max. # supported palette entries */
-DWORD PASCAL lread(int fh, VOID FAR *pv, DWORD ul);
-DWORD PASCAL lwrite(int fh, VOID FAR *pv, DWORD ul);
+static DWORD PASCAL lread(int fh, VOID FAR *pv, DWORD ul);
+static DWORD PASCAL lwrite(int fh, VOID FAR *pv, DWORD ul);
-BOOL WriteDIB (LPTSTR szFile,HANDLE hdib);
-WORD PaletteSize (VOID FAR * pv);
-WORD DibNumColors (VOID FAR * pv);
-// HANDLE DibFromBitmap (HBITMAP hbm, DWORD biStyle, WORD biBits, HPALETTE hpal);
-BOOL PASCAL MakeBitmapAndPalette(HDC,HANDLE,HPALETTE *,HBITMAP *);
-HPALETTE MakeDIBPalette(LPBITMAPINFOHEADER);
-BOOL ReadDIB(LPTSTR lpFileName, HBITMAP *bitmap, HPALETTE *palette);
+static BOOL WriteDIB (LPTSTR szFile,HANDLE hdib);
+static WORD PaletteSize (VOID FAR * pv);
+static WORD DibNumColors (VOID FAR * pv);
+// HANDLE DibFromBitmap (HBITMAP hbm, DWORD biStyle, WORD biBits, HPALETTE hpal);
+static BOOL PASCAL MakeBitmapAndPalette(HDC,HANDLE,HPALETTE *,HBITMAP *);
/****************************************************************************
* *
* *
****************************************************************************/
-BOOL WriteDIB(LPTSTR szFile, HANDLE hdib)
+static BOOL WriteDIB(LPTSTR szFile, HANDLE hdib)
{
BITMAPFILEHEADER hdr;
LPBITMAPINFOHEADER lpbi;
* *
****************************************************************************/
-WORD PaletteSize(VOID FAR * pv)
+static WORD PaletteSize(VOID FAR * pv)
{
LPBITMAPINFOHEADER lpbi;
WORD NumColors;
* *
****************************************************************************/
-WORD DibNumColors(VOID FAR *pv)
+static WORD DibNumColors(VOID FAR *pv)
{
int bits;
BITMAPINFOHEADER *lpbi;
****************************************************************************/
#if NOTHING
-HANDLE DibFromBitmap(HBITMAP hbm, DWORD biStyle, WORD biBits, HPALETTE hpal)
+static HANDLE DibFromBitmap(HBITMAP hbm, DWORD biStyle, WORD biBits, HPALETTE hpal)
{
BITMAP bm;
BITMAPINFOHEADER bi;
* *
****************************************************************************/
-DWORD PASCAL lread(int fh, void far *pv, DWORD ul)
+static DWORD PASCAL lread(int fh, void far *pv, DWORD ul)
{
DWORD ulT = ul;
#if defined(WINNT) || defined(__WIN32__) || defined(__WIN32__) || defined(__WXWINE__)
* *
****************************************************************************/
-DWORD PASCAL lwrite(int fh, VOID FAR *pv, DWORD ul)
+static DWORD PASCAL lwrite(int fh, VOID FAR *pv, DWORD ul)
{
DWORD ulT = ul;
#if defined(WINNT) || defined(__WIN32__) || defined(__WIN32__) || defined(__WXWINE__)
* FALSE - otherwise
*
****************************************************************************/
-BOOL ReadDIB(LPTSTR lpFileName, HBITMAP *bitmap, HPALETTE *palette)
+BOOL wxReadDIB(LPTSTR lpFileName, HBITMAP *bitmap, HPALETTE *palette)
{
int fh;
LPBITMAPINFOHEADER lpbi;
fh = OpenFile (wxFNCONV(lpFileName), &of, OF_READ);
if (fh == -1) {
- wsprintf(str,_T("Can't open file '%s'"), lpFileName);
- MessageBox(NULL, str, _T("Error"), MB_ICONSTOP | MB_OK);
+ wsprintf(str,T("Can't open file '%s'"), lpFileName);
+ MessageBox(NULL, str, T("Error"), MB_ICONSTOP | MB_OK);
return (0);
}
* not valid
*
****************************************************************************/
-BOOL PASCAL MakeBitmapAndPalette(HDC hDC, HANDLE hDIB,
+static BOOL PASCAL MakeBitmapAndPalette(HDC hDC, HANDLE hDIB,
HPALETTE * phPal, HBITMAP * phBitmap)
{
LPBITMAPINFOHEADER lpInfo;
lpInfo = (LPBITMAPINFOHEADER) GlobalLock(hDIB);
#endif
- hPalette = MakeDIBPalette(lpInfo);
+ hPalette = wxMakeDIBPalette(lpInfo);
if ( hPalette )
{
// Need to realize palette for converting DIB to bitmap.
/****************************************************************************
* *
- * FUNCTION : MakeDIBPalette(lpInfo) *
+ * FUNCTION : wxMakeDIBPalette(lpInfo) *
* *
* PURPOSE : Given a BITMAPINFOHEADER, create a palette based on
* the color table.
* zero - unable to create palette
* *
****************************************************************************/
-HPALETTE MakeDIBPalette(LPBITMAPINFOHEADER lpInfo)
+HPALETTE wxMakeDIBPalette(LPBITMAPINFOHEADER lpInfo)
{
#ifdef __WXWINE__
return (FALSE);
HBITMAP hBitmap;
HPALETTE hPalette;
- bool success = (ReadDIB(filename, &hBitmap, &hPalette) != 0);
+ bool success = (wxReadDIB(filename, &hBitmap, &hPalette) != 0);
if (!success)
{
//
//---------------------------------------------------------------------
-void InitBitmapInfoHeader (LPBITMAPINFOHEADER lpBmInfoHdr,
+static void InitBitmapInfoHeader (LPBITMAPINFOHEADER lpBmInfoHdr,
DWORD dwWidth,
DWORD dwHeight,
int nBPP)
-LPSTR FindDIBBits (LPSTR lpbi)
+LPSTR wxFindDIBBits (LPSTR lpbi)
{
return (lpbi + *(LPDWORD)lpbi + PaletteSize (lpbi));
}
//
//---------------------------------------------------------------------
-HANDLE BitmapToDIB (HBITMAP hBitmap, HPALETTE hPal)
+HANDLE wxBitmapToDIB (HBITMAP hBitmap, HPALETTE hPal)
{
BITMAP Bitmap;
BITMAPINFOHEADER bmInfoHdr;
#endif
*lpbmInfoHdr = bmInfoHdr;
- lpBits = FindDIBBits ((LPSTR) lpbmInfoHdr);
+ lpBits = wxFindDIBBits ((LPSTR) lpbmInfoHdr);
// Now, we need a DC to hold our bitmap. If the app passed us
if (colourmap)
hPalette = (HPALETTE) colourmap->GetHPALETTE();
- HANDLE dibHandle = BitmapToDIB((HBITMAP) bitmap->GetHBITMAP(), hPalette);
+ HANDLE dibHandle = wxBitmapToDIB((HBITMAP) bitmap->GetHBITMAP(), hPalette);
if (dibHandle)
{
bool success = (WriteDIB(filename, dibHandle) != 0);