1993-09-04 12:09:32 +02:00
|
|
|
/*
|
|
|
|
* GDI device independent bitmaps
|
|
|
|
*
|
|
|
|
* Copyright 1993 Alexandre Julliard
|
|
|
|
*/
|
|
|
|
|
|
|
|
static char Copyright[] = "Copyright Alexandre Julliard, 1993";
|
|
|
|
|
Release 0.4.10
Mon Nov 22 13:58:56 1993 David Metcalfe <david@prism.demon.co.uk>
* [windows/scroll.c]
Preliminary implementations of ScrollWindow, ScrollDC and
ScrollWindowEx.
Nov 21, 93 martin2@trgcorp.solucorp.qc.ca (Martin Ayotte)
* [controls/listbox.c]
Optimization of redraw during 'Add' or 'Insert'.
* [controls/scroll.c]
Optimization of WM_PAINT during 'thumbtracking'.
* [controls/button.c]
Add of beta implement of 'BS_OWNERDRAW'
* [controls/static.c]
Style 'SS_ICON' new supported.
* [misc/message.c]
Begin of implemantation of MB_XXX styles.
* [loader/resource.c]
Function LoadIcon() : now prepare transparency Bitmap mask.
Function LoadCursor() : now prepare a 'X pixmapcursor'.
New function SetCursor() : not finished.
New function ShowCursor() : not finished.
New function AccessResource() : stub.
* [obj/dib.c]
Function DrawIcon(): deugging phase of icon transparency mask.
* [loader/library.c]
new file for news functions LoadLibrary() & FreeLibrary().
* [sysres.dll]
Resources only 16bits DLL for System Resources, icons, etc...
Sun Nov 14 14:39:06 1993 julliard@di.epfl.ch (Alexandre Julliard)
* [include/dialog.h] [windows/dialog.c]
Simplified dialog template parsing.
Implemented DialogBoxIndirect().
* [windows/win.c]
Fixed bug in CreateWindow() when aborting window creation.
Modified UpdateWindow() to only update visible windows.
Implemented IsWindow().
Nov 14, 93 martin2@trgcorp.solucorp.qc.ca (Martin Ayotte)
* [controls/listbox.c]
Listbox control window : new messages.
* [controls/combo.c]
Combo box control window : new messages.
* [misc/message.c]
Moved stub MessageBox() to this new file.
Implemented of a callback, now MessageBox show a window.
* [loader/resource.c]
New function DestroyIcon()
New function DestroyCursor()
Filled stub LoadIcon()
Filled stub LoadCursor()
Bug fixed in FindResourceByName() : missing lseek().
* [obj/dib.c]
New function DrawIcon()
* [windows/win.c]
New function CloseWindow()
New function OpenIcon()
New function IsIconic()
New Function FindWindow()
Sun Nov 14 08:27:19 1993 Karl Guenter Wuensch (hz225wu@unidui.uni-duisburg.de)
* [loader/selector.c]
Wrote AllocCStoDSAlias() and AllocDStoCSAlias()
Sun Nov 14 08:27:19 1993 Bob Amstadt (bob at amscons)
* [loader/selector.c]
Wrote AllocSelector() and PrestoChangoSelector(). YUK!
Sat Nov 13 13:56:42 1993 Bob Amstadt (bob at amscons)
* [loader/resource.c]
Wrote FindResource(), LoadResource(), LockResource(),
and FreeResource()
* [include/segmem.h] [loader/selector.c] [loader/signal.h]
Changed selector allocation method.
Sun Nov 10 08:27:19 1993 Karl Guenter Wuensch (hz225wu@unidui.uni-duisburg.de)
* [if1632/callback.c if1632/call.S if1632/user.spec]
added Catch (KERNEL.55) and Throw (KERNEL.56)
Nov 7, 93 martin2@trgcorp.solucorp.qc.ca (Martin Ayotte)
* [controls/scroll.c]
Scroll bar control window
Bug resolved : Painting message before scroll visible.
* [controls/listbox.c]
Listbox control window
Destroy cleanup.
* [controls/combo.c]
Combo box control window
Destroy cleanup.
* [controls/button.c]
GetCheck Message now return is state.
* [windows/win.c]
New function IsWindowVisible()
1993-11-24 18:08:56 +01:00
|
|
|
#include <stdio.h>
|
1993-09-04 12:09:32 +02:00
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
#include "gdi.h"
|
Release 0.4.10
Mon Nov 22 13:58:56 1993 David Metcalfe <david@prism.demon.co.uk>
* [windows/scroll.c]
Preliminary implementations of ScrollWindow, ScrollDC and
ScrollWindowEx.
Nov 21, 93 martin2@trgcorp.solucorp.qc.ca (Martin Ayotte)
* [controls/listbox.c]
Optimization of redraw during 'Add' or 'Insert'.
* [controls/scroll.c]
Optimization of WM_PAINT during 'thumbtracking'.
* [controls/button.c]
Add of beta implement of 'BS_OWNERDRAW'
* [controls/static.c]
Style 'SS_ICON' new supported.
* [misc/message.c]
Begin of implemantation of MB_XXX styles.
* [loader/resource.c]
Function LoadIcon() : now prepare transparency Bitmap mask.
Function LoadCursor() : now prepare a 'X pixmapcursor'.
New function SetCursor() : not finished.
New function ShowCursor() : not finished.
New function AccessResource() : stub.
* [obj/dib.c]
Function DrawIcon(): deugging phase of icon transparency mask.
* [loader/library.c]
new file for news functions LoadLibrary() & FreeLibrary().
* [sysres.dll]
Resources only 16bits DLL for System Resources, icons, etc...
Sun Nov 14 14:39:06 1993 julliard@di.epfl.ch (Alexandre Julliard)
* [include/dialog.h] [windows/dialog.c]
Simplified dialog template parsing.
Implemented DialogBoxIndirect().
* [windows/win.c]
Fixed bug in CreateWindow() when aborting window creation.
Modified UpdateWindow() to only update visible windows.
Implemented IsWindow().
Nov 14, 93 martin2@trgcorp.solucorp.qc.ca (Martin Ayotte)
* [controls/listbox.c]
Listbox control window : new messages.
* [controls/combo.c]
Combo box control window : new messages.
* [misc/message.c]
Moved stub MessageBox() to this new file.
Implemented of a callback, now MessageBox show a window.
* [loader/resource.c]
New function DestroyIcon()
New function DestroyCursor()
Filled stub LoadIcon()
Filled stub LoadCursor()
Bug fixed in FindResourceByName() : missing lseek().
* [obj/dib.c]
New function DrawIcon()
* [windows/win.c]
New function CloseWindow()
New function OpenIcon()
New function IsIconic()
New Function FindWindow()
Sun Nov 14 08:27:19 1993 Karl Guenter Wuensch (hz225wu@unidui.uni-duisburg.de)
* [loader/selector.c]
Wrote AllocCStoDSAlias() and AllocDStoCSAlias()
Sun Nov 14 08:27:19 1993 Bob Amstadt (bob at amscons)
* [loader/selector.c]
Wrote AllocSelector() and PrestoChangoSelector(). YUK!
Sat Nov 13 13:56:42 1993 Bob Amstadt (bob at amscons)
* [loader/resource.c]
Wrote FindResource(), LoadResource(), LockResource(),
and FreeResource()
* [include/segmem.h] [loader/selector.c] [loader/signal.h]
Changed selector allocation method.
Sun Nov 10 08:27:19 1993 Karl Guenter Wuensch (hz225wu@unidui.uni-duisburg.de)
* [if1632/callback.c if1632/call.S if1632/user.spec]
added Catch (KERNEL.55) and Throw (KERNEL.56)
Nov 7, 93 martin2@trgcorp.solucorp.qc.ca (Martin Ayotte)
* [controls/scroll.c]
Scroll bar control window
Bug resolved : Painting message before scroll visible.
* [controls/listbox.c]
Listbox control window
Destroy cleanup.
* [controls/combo.c]
Combo box control window
Destroy cleanup.
* [controls/button.c]
GetCheck Message now return is state.
* [windows/win.c]
New function IsWindowVisible()
1993-11-24 18:08:56 +01:00
|
|
|
#include "icon.h"
|
1993-09-04 12:09:32 +02:00
|
|
|
|
|
|
|
|
|
|
|
extern XImage * BITMAP_BmpToImage( BITMAP *, void * );
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* DIB_BitmapInfoSize
|
|
|
|
*
|
|
|
|
* Return the size of the bitmap info structure.
|
|
|
|
*/
|
|
|
|
int DIB_BitmapInfoSize( BITMAPINFO * info, WORD coloruse )
|
|
|
|
{
|
|
|
|
int size = info->bmiHeader.biClrUsed;
|
|
|
|
if (!size && (info->bmiHeader.biBitCount != 24))
|
|
|
|
size = 1 << info->bmiHeader.biBitCount;
|
|
|
|
if (coloruse == DIB_RGB_COLORS)
|
|
|
|
size = info->bmiHeader.biSize + size * sizeof(RGBQUAD);
|
|
|
|
else
|
|
|
|
size = info->bmiHeader.biSize + size * sizeof(WORD);
|
|
|
|
return size;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* DIB_DIBmpToImage
|
|
|
|
*
|
|
|
|
* Create an XImage pointing to the bitmap data.
|
|
|
|
*/
|
|
|
|
XImage * DIB_DIBmpToImage( BITMAPINFOHEADER * bmp, void * bmpData )
|
|
|
|
{
|
|
|
|
XImage * image;
|
|
|
|
int bytesPerLine = (bmp->biWidth * bmp->biBitCount + 31) / 32 * 4;
|
|
|
|
|
Release 0.6
Tue Jan 4 13:01:33 1994 David Metcalfe <david@prism.demon.co.uk>
* [window/caret.c]
Modified code to use system timer.
Jan 9, 94 martin2@trgcorp.solucorp.qc.ca (Martin Ayotte)
* [windows/win.c]
Windows create if required new XLIB MenuBar & CaptionBar.
* [windows/defwnd.c]
WM_CALCSIZE Move & Resize caption, menubar & scrollbars.
(I'm not sure it's the good place for it, but it work...)
* [loader/resource.c]
optimize in FindResourceByNumber, make lseek() if next type ...
* [controls/scroll.c]
scrollbar buttons are now using system resources bitmaps.
* [controls/caption.c] - new file ...
captionbar showing title, close button with SysMenu,
and other buttons using system resources bitmaps.
* [controls/menu.c]
New functions: SetMenuItemBitmaps() with 'glues',
Make new version of LoadMenu() & ParseMenu(),
( put #define USE_POPUPMENU ).
Implementation of MenuBar functions.
* [sysres.dll]
New bitmaps for system such OBM_CLOSE, OBM_MINIMIZE, OBM_UPARROWI.
New SYSMENU menu, it don't work yet ! :-((
Tue Jan 11 05:27:45 1994 julliard@di.epfl.ch (Alexandre Julliard
* [memory/atom.c]
Fixed a bug that could cause atoms to be case-sensitive.
* [misc/rect.c]
Bug fix in SubtractRect().
* [objects/clipping.c]
Bug fix when setting the clip mask to an empty region.
* [windows/dce.c]
Bug fix in ReleaseDC().
* [windows/dialog.c]
Call AdjustWindowRectEx() before creating the dialog window.
Added support for DS_MODALFRAME style.
* [windows/event.c]
Cleaned up event handling and removed old Xt stuff.
Moved double-click handling to windows/message.c
* [windows/focus.c]
Bug fix: only set the X focus when the window is viewable.
* [windows/graphics.c]
Rewritten DrawReliefRect() to use brush instead of pen, and
to use the system colors.
* [windows/message.c]
Implemented WM_NCHITTEST message sending, and non-client
mouse messages.
Cleaned up double-click handling, and removed the Xt code.
* [windows/nonclient.c] (New file)
Implemented AdjustWindowRect().
Implemented WM_NCCALCSIZE, WM_NCHITTEST and WM_NCPAINT handling.
* [windows/painting.c]
Added sending of the WM_NCPAINT message in BeginPaint().
* [windows/sysmetrics.c] [include/sysmetrics.h] (New files)
Implemented system metrics.
* [windows/win.c]
Bug fix in setting the parent and owner in CreateWindow().
Removed the Xt code.
* [windows/winpos.c]
Added sending of the WM_NCPAINT message in SetWindowPos().
Removed the Xt code.
1994-01-12 12:12:51 +01:00
|
|
|
image = XCreateImage( display, DefaultVisualOfScreen( screen ),
|
1993-09-04 12:09:32 +02:00
|
|
|
bmp->biBitCount, ZPixmap, 0, bmpData,
|
|
|
|
bmp->biWidth, bmp->biHeight, 32, bytesPerLine );
|
|
|
|
if (!image) return 0;
|
|
|
|
image->byte_order = MSBFirst;
|
|
|
|
image->bitmap_bit_order = MSBFirst;
|
|
|
|
image->bitmap_unit = 16;
|
|
|
|
_XInitImageFuncPtrs(image);
|
|
|
|
return image;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* SetDIBits (GDI.440)
|
|
|
|
*/
|
|
|
|
int SetDIBits( HDC hdc, HBITMAP hbitmap, WORD startscan, WORD lines,
|
|
|
|
LPSTR bits, BITMAPINFO * info, WORD coloruse )
|
|
|
|
{
|
|
|
|
DC * dc;
|
|
|
|
BITMAPOBJ * bmpObj;
|
|
|
|
BITMAP * bmp;
|
|
|
|
WORD * colorMapping;
|
|
|
|
RGBQUAD * rgbPtr;
|
|
|
|
XImage * bmpImage, * dibImage;
|
|
|
|
int i, x, y, pixel, colors;
|
|
|
|
|
|
|
|
if (!lines) return 0;
|
|
|
|
if (!(dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC ))) return 0;
|
|
|
|
if (!(bmpObj = (BITMAPOBJ *)GDI_GetObjPtr( hbitmap, BITMAP_MAGIC )))
|
|
|
|
return 0;
|
|
|
|
if (!(bmp = (BITMAP *) GlobalLock( bmpObj->hBitmap ))) return 0;
|
|
|
|
|
|
|
|
/* Build the color mapping table */
|
|
|
|
|
|
|
|
if (info->bmiHeader.biBitCount == 24) colorMapping = NULL;
|
|
|
|
else if (coloruse == DIB_RGB_COLORS)
|
|
|
|
{
|
|
|
|
colors = info->bmiHeader.biClrUsed;
|
|
|
|
if (!colors) colors = 1 << info->bmiHeader.biBitCount;
|
|
|
|
if (!(colorMapping = (WORD *)malloc( colors * sizeof(WORD) )))
|
|
|
|
{
|
|
|
|
GlobalUnlock( bmpObj->hBitmap );
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
for (i = 0, rgbPtr = info->bmiColors; i < colors; i++, rgbPtr++)
|
|
|
|
colorMapping[i] = GetNearestPaletteIndex( dc->w.hPalette,
|
|
|
|
RGB(rgbPtr->rgbRed,
|
|
|
|
rgbPtr->rgbGreen,
|
|
|
|
rgbPtr->rgbBlue) );
|
|
|
|
}
|
|
|
|
else colorMapping = (WORD *)info->bmiColors;
|
|
|
|
|
|
|
|
/* Transfer the pixels (very slow...) */
|
|
|
|
|
|
|
|
bmpImage = BITMAP_BmpToImage( bmp, ((char *)bmp) + sizeof(BITMAP) );
|
|
|
|
dibImage = DIB_DIBmpToImage( &info->bmiHeader, bits );
|
|
|
|
|
|
|
|
for (y = 0; y < lines; y++)
|
|
|
|
{
|
|
|
|
for (x = 0; x < info->bmiHeader.biWidth; x++)
|
|
|
|
{
|
|
|
|
pixel = XGetPixel( dibImage, x, y );
|
|
|
|
if (colorMapping) pixel = colorMapping[pixel];
|
|
|
|
else pixel = GetNearestPaletteIndex(dc->w.hPalette,(COLORREF)pixel);
|
|
|
|
XPutPixel( bmpImage, x, bmp->bmHeight - startscan - y - 1, pixel );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bmpImage->data = NULL;
|
|
|
|
dibImage->data = NULL;
|
|
|
|
XDestroyImage( bmpImage );
|
|
|
|
XDestroyImage( dibImage );
|
|
|
|
|
|
|
|
if (colorMapping && (coloruse == DIB_RGB_COLORS)) free(colorMapping);
|
|
|
|
|
|
|
|
GlobalUnlock( bmpObj->hBitmap );
|
|
|
|
return lines;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* GetDIBits (GDI.441)
|
|
|
|
*/
|
|
|
|
int GetDIBits( HDC hdc, HBITMAP hbitmap, WORD startscan, WORD lines,
|
|
|
|
LPSTR bits, BITMAPINFO * info, WORD coloruse )
|
|
|
|
{
|
|
|
|
DC * dc;
|
|
|
|
BITMAPOBJ * bmpObj;
|
|
|
|
BITMAP * bmp;
|
|
|
|
PALETTEENTRY * palEntry;
|
|
|
|
PALETTEOBJ * palette;
|
|
|
|
XImage * bmpImage, * dibImage;
|
|
|
|
int i, x, y;
|
|
|
|
|
|
|
|
if (!lines) return 0;
|
|
|
|
if (!(dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC ))) return 0;
|
|
|
|
if (!(bmpObj = (BITMAPOBJ *)GDI_GetObjPtr( hbitmap, BITMAP_MAGIC )))
|
|
|
|
return 0;
|
|
|
|
if (!(palette = (PALETTEOBJ*)GDI_GetObjPtr( dc->w.hPalette, PALETTE_MAGIC )))
|
|
|
|
return 0;
|
|
|
|
if (!(bmp = (BITMAP *) GlobalLock( bmpObj->hBitmap ))) return 0;
|
|
|
|
|
|
|
|
/* Transfer color info */
|
|
|
|
|
|
|
|
palEntry = palette->logpalette.palPalEntry;
|
|
|
|
for (i = 0; i < info->bmiHeader.biClrUsed; i++, palEntry++)
|
|
|
|
{
|
|
|
|
if (coloruse == DIB_RGB_COLORS)
|
|
|
|
{
|
|
|
|
info->bmiColors[i].rgbRed = palEntry->peRed;
|
|
|
|
info->bmiColors[i].rgbGreen = palEntry->peGreen;
|
|
|
|
info->bmiColors[i].rgbBlue = palEntry->peBlue;
|
|
|
|
info->bmiColors[i].rgbReserved = 0;
|
|
|
|
}
|
|
|
|
else ((WORD *)info->bmiColors)[i] = (WORD)i;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Transfer the pixels (very slow...) */
|
|
|
|
|
|
|
|
if (bits)
|
|
|
|
{
|
|
|
|
bmpImage = BITMAP_BmpToImage( bmp, ((char *)bmp) + sizeof(BITMAP) );
|
|
|
|
dibImage = DIB_DIBmpToImage( &info->bmiHeader, bits );
|
|
|
|
|
|
|
|
for (y = 0; y < lines; y++)
|
|
|
|
{
|
|
|
|
for (x = 0; x < info->bmiHeader.biWidth; x++)
|
|
|
|
{
|
|
|
|
XPutPixel( dibImage, x, y,
|
|
|
|
XGetPixel(bmpImage, x, bmp->bmHeight-startscan-y-1) );
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bmpImage->data = NULL;
|
|
|
|
dibImage->data = NULL;
|
|
|
|
XDestroyImage( bmpImage );
|
|
|
|
XDestroyImage( dibImage );
|
|
|
|
}
|
|
|
|
|
|
|
|
GlobalUnlock( bmpObj->hBitmap );
|
|
|
|
return lines;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* CreateDIBitmap (GDI.442)
|
|
|
|
*/
|
|
|
|
HBITMAP CreateDIBitmap( HDC hdc, BITMAPINFOHEADER * header, DWORD init,
|
|
|
|
LPSTR bits, BITMAPINFO * data, WORD coloruse )
|
|
|
|
{
|
|
|
|
HBITMAP handle;
|
|
|
|
|
|
|
|
handle = CreateCompatibleBitmap( hdc, header->biWidth, header->biHeight );
|
|
|
|
if (!handle) return 0;
|
|
|
|
if (init == CBM_INIT) SetDIBits( hdc, handle, 0, header->biHeight,
|
|
|
|
bits, data, coloruse );
|
|
|
|
return handle;
|
|
|
|
}
|
Release 0.4.10
Mon Nov 22 13:58:56 1993 David Metcalfe <david@prism.demon.co.uk>
* [windows/scroll.c]
Preliminary implementations of ScrollWindow, ScrollDC and
ScrollWindowEx.
Nov 21, 93 martin2@trgcorp.solucorp.qc.ca (Martin Ayotte)
* [controls/listbox.c]
Optimization of redraw during 'Add' or 'Insert'.
* [controls/scroll.c]
Optimization of WM_PAINT during 'thumbtracking'.
* [controls/button.c]
Add of beta implement of 'BS_OWNERDRAW'
* [controls/static.c]
Style 'SS_ICON' new supported.
* [misc/message.c]
Begin of implemantation of MB_XXX styles.
* [loader/resource.c]
Function LoadIcon() : now prepare transparency Bitmap mask.
Function LoadCursor() : now prepare a 'X pixmapcursor'.
New function SetCursor() : not finished.
New function ShowCursor() : not finished.
New function AccessResource() : stub.
* [obj/dib.c]
Function DrawIcon(): deugging phase of icon transparency mask.
* [loader/library.c]
new file for news functions LoadLibrary() & FreeLibrary().
* [sysres.dll]
Resources only 16bits DLL for System Resources, icons, etc...
Sun Nov 14 14:39:06 1993 julliard@di.epfl.ch (Alexandre Julliard)
* [include/dialog.h] [windows/dialog.c]
Simplified dialog template parsing.
Implemented DialogBoxIndirect().
* [windows/win.c]
Fixed bug in CreateWindow() when aborting window creation.
Modified UpdateWindow() to only update visible windows.
Implemented IsWindow().
Nov 14, 93 martin2@trgcorp.solucorp.qc.ca (Martin Ayotte)
* [controls/listbox.c]
Listbox control window : new messages.
* [controls/combo.c]
Combo box control window : new messages.
* [misc/message.c]
Moved stub MessageBox() to this new file.
Implemented of a callback, now MessageBox show a window.
* [loader/resource.c]
New function DestroyIcon()
New function DestroyCursor()
Filled stub LoadIcon()
Filled stub LoadCursor()
Bug fixed in FindResourceByName() : missing lseek().
* [obj/dib.c]
New function DrawIcon()
* [windows/win.c]
New function CloseWindow()
New function OpenIcon()
New function IsIconic()
New Function FindWindow()
Sun Nov 14 08:27:19 1993 Karl Guenter Wuensch (hz225wu@unidui.uni-duisburg.de)
* [loader/selector.c]
Wrote AllocCStoDSAlias() and AllocDStoCSAlias()
Sun Nov 14 08:27:19 1993 Bob Amstadt (bob at amscons)
* [loader/selector.c]
Wrote AllocSelector() and PrestoChangoSelector(). YUK!
Sat Nov 13 13:56:42 1993 Bob Amstadt (bob at amscons)
* [loader/resource.c]
Wrote FindResource(), LoadResource(), LockResource(),
and FreeResource()
* [include/segmem.h] [loader/selector.c] [loader/signal.h]
Changed selector allocation method.
Sun Nov 10 08:27:19 1993 Karl Guenter Wuensch (hz225wu@unidui.uni-duisburg.de)
* [if1632/callback.c if1632/call.S if1632/user.spec]
added Catch (KERNEL.55) and Throw (KERNEL.56)
Nov 7, 93 martin2@trgcorp.solucorp.qc.ca (Martin Ayotte)
* [controls/scroll.c]
Scroll bar control window
Bug resolved : Painting message before scroll visible.
* [controls/listbox.c]
Listbox control window
Destroy cleanup.
* [controls/combo.c]
Combo box control window
Destroy cleanup.
* [controls/button.c]
GetCheck Message now return is state.
* [windows/win.c]
New function IsWindowVisible()
1993-11-24 18:08:56 +01:00
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* DrawIcon (USER.84)
|
|
|
|
*/
|
|
|
|
BOOL DrawIcon(HDC hDC, short x, short y, HICON hIcon)
|
|
|
|
{
|
|
|
|
ICONALLOC *lpico;
|
|
|
|
BITMAP bm;
|
|
|
|
HBITMAP hBitTemp;
|
|
|
|
HDC hMemDC;
|
|
|
|
HDC hMemDC2;
|
|
|
|
#ifdef DEBUG_ICON
|
|
|
|
printf("DrawIcon(%04X, %d, %d, %04X) \n", hDC, x, y, hIcon);
|
|
|
|
#endif
|
|
|
|
if (hIcon == (HICON)NULL) return FALSE;
|
|
|
|
lpico = (ICONALLOC *)GlobalLock(hIcon);
|
|
|
|
GetObject(lpico->hBitmap, sizeof(BITMAP), (LPSTR)&bm);
|
|
|
|
#ifdef DEBUG_ICON
|
|
|
|
printf("DrawIcon / x=%d y=%d\n", x, y);
|
|
|
|
printf("DrawIcon / icon Width=%d\n", (int)lpico->descriptor.Width);
|
|
|
|
printf("DrawIcon / icon Height=%d\n", (int)lpico->descriptor.Height);
|
|
|
|
printf("DrawIcon / icon ColorCount=%d\n", (int)lpico->descriptor.ColorCount);
|
|
|
|
printf("DrawIcon / icon icoDIBSize=%lX\n", (DWORD)lpico->descriptor.icoDIBSize);
|
|
|
|
printf("DrawIcon / icon icoDIBOffset=%lX\n", (DWORD)lpico->descriptor.icoDIBOffset);
|
|
|
|
printf("DrawIcon / bitmap bmWidth=%d bmHeight=%d\n", bm.bmWidth, bm.bmHeight);
|
|
|
|
#endif
|
|
|
|
hMemDC = CreateCompatibleDC(hDC);
|
|
|
|
#ifdef DEBUG_ICON
|
|
|
|
SelectObject(hMemDC, lpico->hBitmap);
|
|
|
|
BitBlt(hDC, x, y, bm.bmWidth, bm.bmHeight, hMemDC, 0, 0, SRCCOPY);
|
|
|
|
SelectObject(hMemDC, lpico->hBitMask);
|
|
|
|
BitBlt(hDC, x, y + bm.bmHeight, bm.bmWidth, bm.bmHeight, hMemDC, 0, 0, SRCCOPY);
|
|
|
|
#else
|
|
|
|
SelectObject(hMemDC, lpico->hBitMask);
|
|
|
|
BitBlt(hDC, x, y, bm.bmWidth, bm.bmHeight, hMemDC, 0, 0, SRCAND);
|
|
|
|
SelectObject(hMemDC, lpico->hBitmap);
|
|
|
|
BitBlt(hDC, x, y, bm.bmWidth, bm.bmHeight, hMemDC, 0, 0, SRCPAINT);
|
|
|
|
#endif
|
|
|
|
DeleteDC(hMemDC);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|