--- a/WinWorkstation.st Thu Aug 31 16:40:45 2017 +0200
+++ b/WinWorkstation.st Thu Aug 31 17:13:00 2017 +0200
@@ -7049,7 +7049,7 @@
GetProcAddress(hUser, "GetMonitorInfo");
}
}
- console_printf("P_GetMonitorInfo: %x\n", P_GetMonitorInfo);
+ DPRINTF(("P_GetMonitorInfo: %x\n", P_GetMonitorInfo));
if ((*P_GetMonitorInfo)(hMonitor, &info))
#else
if (GetMonitorInfo(hMonitor, (MONITORINFO *)(&info)))
@@ -11017,27 +11017,27 @@
with:aGCId
(self
- primDrawBits:imageBits
- bitsPerPixel:bitsPerPixel
- depth:imageDepth
- width:imageExtent x height:imageExtent y
- x:srcOrigin x y:srcOrigin y
- into:ignoredDrawableId
- x:dstOrigin x y:dstOrigin y
- width:imageExtent x height:imageExtent y
- with:aGCId
- parameters:(Array with:nil with:padd with:(maskVector at:1) with:(maskVector at:2) with:(maskVector at:3))
- "/ the params array is ONLY used, because there is a 15-argument limit in st/x !!
- "/ sourceAlphaOrNil := params at:1.
- "/ padd := params at:2.
- "/ redMask := params at:3.
- "/ greenMask := params at:4.
- "/ blueMask := params at:5.
+ primDrawBits:imageBits
+ bitsPerPixel:bitsPerPixel
+ depth:imageDepth
+ width:imageExtent x height:imageExtent y
+ x:srcOrigin x y:srcOrigin y
+ into:ignoredDrawableId
+ x:dstOrigin x y:dstOrigin y
+ width:imageExtent x height:imageExtent y
+ with:aGCId
+ parameters:(Array with:nil with:padd with:(maskVector at:1) with:(maskVector at:2) with:(maskVector at:3))
+ "/ the params array is ONLY used, because there is a 15-argument limit in st/x !!
+ "/ sourceAlphaOrNil := params at:1.
+ "/ padd := params at:2.
+ "/ redMask := params at:3.
+ "/ greenMask := params at:4.
+ "/ blueMask := params at:5.
) ifFalse:[
- "
- also happens, if a segmentation violation occurs in primitive code...
- "
- self primitiveFailed
+ "
+ also happens, if a segmentation violation occurs in primitive code...
+ "
+ self primitiveFailed
].
!
@@ -11143,41 +11143,39 @@
bitmap.bmiHeader.biPlanes = 1;
switch (__intVal(imageDepth)) {
case 16:
- /* notice the default r/g/b (STX order here) */
-#if 1
+ // BI_BITFIELDS is only possible with 16 and 32 bit images
+ // (see msdn.microoft.com/library/cc250415.aspx)
+
+ // notice the default r/g/b (STX order here)
bitmap.bmiHeader.biCompression = BI_BITFIELDS;
bitmap.r = redMask == nil ? 0xf800 : __intVal(redMask);
bitmap.g = greenMask == nil ? 0x07e0 : __intVal(greenMask);
bitmap.b = blueMask == nil ? 0x001f : __intVal(blueMask);
-#endif
break;
case 24:
- /* notice the default b/g/r (WIN32 order here) */
-#if 0
- bitmap.bmiHeader.biCompression = BI_BITFIELDS;
- bitmap.r = redMask == nil ? 0xff0000 : __intVal(redMask);
- bitmap.g = greenMask == nil ? 0x00ff00 : __intVal(greenMask);
- bitmap.b = blueMask == nil ? 0x0000ff : __intVal(blueMask);
-#endif
+ // BI_BITFIELDS is only possible with 16 and 32 bit images
+ // (see msdn.microoft.com/library/cc250415.aspx)
+
+ // notice the default b/g/r (WIN32 order here)
bitmap.bmiHeader.biCompression = BI_RGB;
break;
case 32:
- /* notice the default r/g/b (STX order here) */
- bitmap.bmiHeader.biCompression = BI_RGB;
-#if 1
+ // BI_BITFIELDS is only possible with 16 and 32 bit images
+ // (see msdn.microoft.com/library/cc250415.aspx)
+
+ // notice the default r/g/b (STX order here)
bitmap.bmiHeader.biCompression = BI_BITFIELDS;
bitmap.r = redMask == nil ? 0x0000ff : __intVal(redMask);
bitmap.g = greenMask == nil ? 0x00ff00 : __intVal(greenMask);
bitmap.b = blueMask == nil ? 0xff0000 : __intVal(blueMask);
bitmap.a = 0xff000000;
-#endif
break;
}
if (sourceAlphaOrNil != nil) {
-console_printf("sourceAlphaOrNil = %x\n", sourceAlphaOrNil);
+ DPRINTF(("sourceAlphaOrNil = %x\n", sourceAlphaOrNil));
_sourceAlpha = __intVal(sourceAlphaOrNil);
_doAlphaBlend = 1;
}
@@ -11190,9 +11188,11 @@
bitmap.bmiHeader.biWidth = __intVal(imageWidth);
bitmap.bmiHeader.biHeight = -(__intVal(imageHeight));
bitmap.bmiHeader.biBitCount = __intVal(bitsPerPixel);
- /*console_printf("drawBits depth:%d bitsPerPixel:%d IW%d W:%d H:%d\n",__intVal(imageDepth),bitmap.bmiHeader.biBitCount,bitmap.bmiHeader.biWidth,__intVal(w),bitmap.bmiHeader.biHeight);*/
+ DPRINTF(("drawBits depth:%d bitsPerPixel:%d IW%d W:%d H:%d\n",__intVal(imageDepth),bitmap.bmiHeader.biBitCount,bitmap.bmiHeader.biWidth,__intVal(w),bitmap.bmiHeader.biHeight));
if (! _doAlphaBlend) {
+ // normal draw (no alpha)
+
SetDIBitsToDevice(hDC,
__intVal(dstx), __intVal(dsty),
__intVal(w), __intVal(h),
@@ -11202,6 +11202,8 @@
(BITMAPINFO*)&bitmap,
DIB_RGB_COLORS);
} else {
+ // alpha blending
+
HDC ahdc;
HBITMAP ahbitmap;
void *pvBits;
@@ -11219,8 +11221,9 @@
}
}
if (P_AlphaBlend != 0) {
-console_printf("***********************************\n");
-console_printf("_sourceAlpha = %d\n", _sourceAlpha);
+ DPRINTF(("***********************************\n"));
+ DPRINTF(("_sourceAlpha = %d\n", _sourceAlpha));
+
ahdc = CreateCompatibleDC(hDC);
ahbitmap = CreateCompatibleBitmap(hDC, __intVal(imageWidth), __intVal(imageHeight));
@@ -11373,13 +11376,13 @@
For compatibility we send a focus-event to that topView"
aBoolean ifFalse:[
- activeView == aView ifTrue:[
- activeView := nil.
- ].
- self focusOutView:aView.
+ activeView == aView ifTrue:[
+ activeView := nil.
+ ].
+ self focusOutView:aView.
] ifTrue:[
- activeView := aView.
- self focusInView:aView.
+ activeView := aView.
+ self focusInView:aView.
].
"Created: / 28.4.1999 / 14:51:51 / cg"
@@ -13070,13 +13073,13 @@
if (__isCharacter(keySymCodeOrButtonNr)) {
_keyCodeOrButtonNr = __intVal(__characterVal(keySymCodeOrButtonNr));
-console_printf("code: %d (#%02x)\n", _keyCodeOrButtonNr, _keyCodeOrButtonNr);
+ DPRINTF(("code: %d (#%02x)\n", _keyCodeOrButtonNr, _keyCodeOrButtonNr));
if ((_keyCodeOrButtonNr >= 'a') && (_keyCodeOrButtonNr <= 'z')) {
_keyCodeOrButtonNr -= 0x20;
-console_printf("code: %d (#%02x)\n", _keyCodeOrButtonNr, _keyCodeOrButtonNr);
+ DPRINTF(("code: %d (#%02x)\n", _keyCodeOrButtonNr, _keyCodeOrButtonNr));
} else {
if ((_keyCodeOrButtonNr >= 'A') && (_keyCodeOrButtonNr <= 'Z')) {
-console_printf("code: shifted %d (#%02x)\n", _keyCodeOrButtonNr, _keyCodeOrButtonNr);
+ DPRINTF(("code: shifted %d (#%02x)\n", _keyCodeOrButtonNr, _keyCodeOrButtonNr));
_shifted = 1;
}
}
@@ -13219,16 +13222,16 @@
}
if (_isMouseEvent) {
-console_printf("mouse %08x %d/%d\n", dwFlags | MOUSEEVENTF_ABSOLUTE, _xP, _yP);
+ DPRINTF(("mouse %08x %d/%d\n", dwFlags | MOUSEEVENTF_ABSOLUTE, _xP, _yP));
mouse_event(dwFlags | MOUSEEVENTF_ABSOLUTE, _xP, _yP, 0, NULL);
} else {
if (_shifted) {
-console_printf("shifted keybd #%08x %d (#%02x)\n", dwFlags, _keyCodeOrButtonNr, _keyCodeOrButtonNr);
+ DPRINTF(("shifted keybd #%08x %d (#%02x)\n", dwFlags, _keyCodeOrButtonNr, _keyCodeOrButtonNr));
keybd_event( VK_SHIFT, 0 /* _keyCodeOrButtonNr */, 0, 0);
keybd_event( _keyCodeOrButtonNr, 0 /* _keyCodeOrButtonNr */, dwFlags, 0);
keybd_event( VK_SHIFT, 0 /* _keyCodeOrButtonNr */, KEYEVENTF_KEYUP, 0);
} else {
-console_printf("keybd #%08x %d (#%02x)\n", dwFlags, _keyCodeOrButtonNr, _keyCodeOrButtonNr);
+ DPRINTF(("keybd #%08x %d (#%02x)\n", dwFlags, _keyCodeOrButtonNr, _keyCodeOrButtonNr));
keybd_event( _keyCodeOrButtonNr, 0 /* _keyCodeOrButtonNr */, dwFlags, 0);
}
}
@@ -15919,7 +15922,7 @@
for (idx=0; idx<__arraySize(filterArrayOrNil); idx++) {
OBJ el = __ArrayInstPtr(filterArrayOrNil)->a_element[idx];
-// console_printf("idx = %d\n", idx);
+ // console_printf("idx = %d\n", idx);
if (__isArrayLike(el) && (__arraySize(el) == 2)) {
OBJ descr, filter;
@@ -15928,7 +15931,7 @@
if (__isStringLike(descr) && __isStringLike(filter)) {
char *src = __stringVal(descr);
-// console_printf("descr: %s filter: %s\n", __stringVal(descr), __stringVal(filter));
+ // console_printf("descr: %s filter: %s\n", __stringVal(descr), __stringVal(filter));
// append (incl 0-byte)
while (*src) {