--- a/WinWorkstation.st Sun Aug 08 14:46:58 2010 +0200
+++ b/WinWorkstation.st Tue Aug 24 13:59:28 2010 +0200
@@ -1034,55 +1034,55 @@
#ifdef DEBUGMASK
static void
printMask(int mask) {
- if (mask & KeyPressMask) console_printf("KeyPressMask\n");
- if (mask & KeyReleaseMask) console_printf("KeyReleaseMask\n");
- if (mask & ButtonPressMask) console_printf("ButtonPressMask\n");
- if (mask & ButtonReleaseMask) console_printf("ButtonReleaseMask\n");
- if (mask & ButtonMotionMask) console_printf("ButtonMotionMask\n");
- if (mask & PointerMotionMask) console_printf("PointerMotionMask\n");
- if (mask & ExposureMask) console_printf("ExposureMask\n");
- if (mask & FocusChangeMask) console_printf("FocusChangeMask\n");
- if (mask & EnterWindowMask) console_printf("EnterWindowMask\n");
- if (mask & LeaveWindowMask) console_printf("LeaveWindowMask\n");
- if (mask & KeymapStateMask) console_printf("KeymapStateMask\n");
- if (mask & VisibilityChangeMask)console_printf("VisibilityChangeMask\n");
- if (mask & StructureNotifyMask) console_printf("StructureNotifyMask\n");
- if (mask & ResizeRedirectMask) console_printf("ResizeRedirectMask\n");
- if (mask & PropertyChangeMask) console_printf("PropertyChangeMask\n");
- if (mask & ColormapChangeMask) console_printf("ColormapChangeMask\n");
+ if (mask & KeyPressMask) console_printf("KeyPressMask\n");
+ if (mask & KeyReleaseMask) console_printf("KeyReleaseMask\n");
+ if (mask & ButtonPressMask) console_printf("ButtonPressMask\n");
+ if (mask & ButtonReleaseMask) console_printf("ButtonReleaseMask\n");
+ if (mask & ButtonMotionMask) console_printf("ButtonMotionMask\n");
+ if (mask & PointerMotionMask) console_printf("PointerMotionMask\n");
+ if (mask & ExposureMask) console_printf("ExposureMask\n");
+ if (mask & FocusChangeMask) console_printf("FocusChangeMask\n");
+ if (mask & EnterWindowMask) console_printf("EnterWindowMask\n");
+ if (mask & LeaveWindowMask) console_printf("LeaveWindowMask\n");
+ if (mask & KeymapStateMask) console_printf("KeymapStateMask\n");
+ if (mask & VisibilityChangeMask)console_printf("VisibilityChangeMask\n");
+ if (mask & StructureNotifyMask) console_printf("StructureNotifyMask\n");
+ if (mask & ResizeRedirectMask) console_printf("ResizeRedirectMask\n");
+ if (mask & PropertyChangeMask) console_printf("PropertyChangeMask\n");
+ if (mask & ColormapChangeMask) console_printf("ColormapChangeMask\n");
}
#endif
static int
st2RGB(int color, struct gcData *gcData)
{
- int ir,ig,ib;
-
- if (gcData) {
- if (gcData->bitmapColorBitCount == 1) {
- if (color)
- return WhitePixel;
- else
- return BlackPixel;
- }
- }
+ int ir,ig,ib;
+
+ if (gcData) {
+ if (gcData->bitmapColorBitCount == 1) {
+ if (color)
+ return WhitePixel;
+ else
+ return BlackPixel;
+ }
+ }
#ifdef ALWAYSTRUECOLOR
- return (color & 0xffffff);
-#else
- if (__depth < 15) {
- return 0;
- } else {
- if ((__depth == 16) || (__depth == 15)) {
- ib = (color & 0x1f) << 3;
- ig = ((color >> 5) & 0x3f) << 2;
- ir = ((color >> 11) & 0x1f) << 3;
- ir |= 7;
- ig |= 3;
- ib |= 7;
- return RGB(ir,ig,ib);
- }
- return (color & 0xffffff);
- }
+ return (color & 0xffffff);
+#else
+ if (__depth < 15) {
+ return 0;
+ } else {
+ if ((__depth == 16) || (__depth == 15)) {
+ ib = (color & 0x1f) << 3;
+ ig = ((color >> 5) & 0x3f) << 2;
+ ir = ((color >> 11) & 0x1f) << 3;
+ ir |= 7;
+ ig |= 3;
+ ib |= 7;
+ return RGB(ir,ig,ib);
+ }
+ return (color & 0xffffff);
+ }
#endif
}
@@ -1090,34 +1090,34 @@
RGB2st(r, g, b)
int r, g, b;
{
- int ir,ig,ib,id;
+ int ir,ig,ib,id;
#ifdef ALWAYSTRUECOLOR
- ir = (r >> 8) & 0xff;
- ig = (g >> 8) & 0xff;
- ib = (b >> 8) & 0xff;
-
- id = RGB( ir, ig, ib);
-#else
- if (__depth < 15) {
- id = 0;
- } else {
- if ((__depth == 16) || (__depth == 15)) {
- ir = (r >> 11) & 0x1f;
- ig = (g >> 10) & 0x3f;
- ib = (b >> 11) & 0x1f;
-
- id = ( ir << 11 ) | ( ig << 5 ) | ib;
- } else {
- ir = (r >> 8) & 0xff;
- ig = (g >> 8) & 0xff;
- ib = (b >> 8) & 0xff;
-
- id = RGB( ir, ig, ib);
- }
- }
-#endif
- return id;
+ ir = (r >> 8) & 0xff;
+ ig = (g >> 8) & 0xff;
+ ib = (b >> 8) & 0xff;
+
+ id = RGB( ir, ig, ib);
+#else
+ if (__depth < 15) {
+ id = 0;
+ } else {
+ if ((__depth == 16) || (__depth == 15)) {
+ ir = (r >> 11) & 0x1f;
+ ig = (g >> 10) & 0x3f;
+ ib = (b >> 11) & 0x1f;
+
+ id = ( ir << 11 ) | ( ig << 5 ) | ib;
+ } else {
+ ir = (r >> 8) & 0xff;
+ ig = (g >> 8) & 0xff;
+ ib = (b >> 8) & 0xff;
+
+ id = RGB( ir, ig, ib);
+ }
+ }
+#endif
+ return id;
}
#if 0
@@ -1128,13 +1128,13 @@
GetTopParent(hWnd)
HWND hwnd;
{
- HWND lastParent = hWnd;
- HWND nextParent;
-
- while (nextParent = GetParent(lastParent)) {
- lastParent = nextParent;
- }
- return lastParent;
+ HWND lastParent = hWnd;
+ HWND nextParent;
+
+ while (nextParent = GetParent(lastParent)) {
+ lastParent = nextParent;
+ }
+ return lastParent;
}
#endif
@@ -1147,7 +1147,7 @@
int r = DeleteObject(o);
if (r == 0)
- console_fprintf(stderr, "WinWorkstation [warning]: ERROR in DeleteObject %x [%d]\n", o, lineNr);
+ console_fprintf(stderr, "WinWorkstation [warning]: ERROR in DeleteObject %x [%d]\n", o, lineNr);
return r;
}
@@ -1161,8 +1161,8 @@
{
#ifdef CACHE_LAST_TMP_FONT
if (f == __tmpDC_hfont) {
- SelectObject(__tmpDC, __tmpDC_prev_hfont);
- __tmpDC_hfont = NULL;
+ SelectObject(__tmpDC, __tmpDC_prev_hfont);
+ __tmpDC_hfont = NULL;
}
#endif
_DeleteObject(f, lineNr);
@@ -1176,11 +1176,11 @@
if ((br != __whiteBrush)
&& (br != __blackBrush)) {
- r = DeleteObject(br);
-
- if (r == 0)
- console_fprintf(stderr, "WinWorkstation [warning]: ERROR in DeleteBrush %x [%d]\n", br, lineNr);
- return r;
+ r = DeleteObject(br);
+
+ if (r == 0)
+ console_fprintf(stderr, "WinWorkstation [warning]: ERROR in DeleteBrush %x [%d]\n", br, lineNr);
+ return r;
}
return 1;
}
@@ -1193,11 +1193,11 @@
if ((p != __whitePen)
&& (p != __blackPen)) {
- r = DeleteObject(p);
-
- if (r == 0)
- console_fprintf(stderr, "WinWorkstation [warning]: ERROR in DeletePen %x [%d]\n", p, lineNr);
- return r;
+ r = DeleteObject(p);
+
+ if (r == 0)
+ console_fprintf(stderr, "WinWorkstation [warning]: ERROR in DeletePen %x [%d]\n", p, lineNr);
+ return r;
}
return 1;
}
@@ -1212,17 +1212,17 @@
if ((p == __whitePen)
|| (p == __blackPen)) {
- return 1; /* not deleted, but OK */
+ return 1; /* not deleted, but OK */
}
for (i=0; i<NUM_PEN_CACHED;i++) {
- if (__penCache[i].pen == p) {
- return 1; /* not deleted, but OK */
- }
+ if (__penCache[i].pen == p) {
+ return 1; /* not deleted, but OK */
+ }
}
r = DeleteObject(p);
if (r == 0)
- console_fprintf(stderr, "WinWorkstation [warning]: ERROR in DeletePen2 %x [%d]\n", p, lineNr);
+ console_fprintf(stderr, "WinWorkstation [warning]: ERROR in DeletePen2 %x [%d]\n", p, lineNr);
return r;
}
@@ -1239,18 +1239,18 @@
int i, r;
for (i=0; i<NUM_BRUSH_CACHED;i++) {
- if (__brushCache[i].brush == br) {
- return 1; /* not deleted, but OK */
- }
+ if (__brushCache[i].brush == br) {
+ return 1; /* not deleted, but OK */
+ }
}
if ((br == __whiteBrush)
|| (br == __blackBrush)) {
- return 1; /* not deleted, but OK */
+ return 1; /* not deleted, but OK */
}
r = DeleteObject(br);
if (r == 0)
- console_fprintf(stderr, "WinWorkstation [warning]: ERROR in DeleteBrush2 %x [%d]\n", br, lineNr);
+ console_fprintf(stderr, "WinWorkstation [warning]: ERROR in DeleteBrush2 %x [%d]\n", br, lineNr);
return r;
}
@@ -1259,20 +1259,20 @@
#endif /* CACHE_BRUSH */
static struct gcData *
-newGcData(void)
+newGcData(void)
{
struct gcData *gcData;
if (gcDataFreeList) {
- gcData = gcDataFreeList;
- gcDataFreeList = gcData->u.__nextFree;
- gcDataNumFree--;
+ gcData = gcDataFreeList;
+ gcDataFreeList = gcData->u.__nextFree;
+ gcDataNumFree--;
} else {
- gcData = (struct gcData *) malloc(sizeof(struct gcData));
- if (! gcData) {
- console_fprintf(stderr, "WinWorkstat [warning]: failed to allocate gcData\n");
- return 0;
- }
+ gcData = (struct gcData *) malloc(sizeof(struct gcData));
+ if (! gcData) {
+ console_fprintf(stderr, "WinWorkstat [warning]: failed to allocate gcData\n");
+ return 0;
+ }
}
memset(gcData, 0, sizeof(struct gcData));
@@ -1293,18 +1293,18 @@
freeGcData(struct gcData *gcData)
{
if (gcDataNumFree < NUM_FREE_GC) {
- gcData->u.__nextFree = gcDataFreeList;
- gcDataFreeList = gcData;
- gcDataNumFree++;
+ gcData->u.__nextFree = gcDataFreeList;
+ gcDataFreeList = gcData;
+ gcDataNumFree++;
} else {
- free(gcData);
+ free(gcData);
}
}
#ifdef CACHE_LAST_DC
# define FLUSH_CACHED_DC(__gcData__) \
if (lastGcData == __gcData__) { \
- _releaseDC(lastGcData); \
+ _releaseDC(lastGcData); \
}
#else
# define FLUSH_CACHED_DC(x) /* */
@@ -1313,12 +1313,12 @@
#ifdef CACHE_LAST_PEN
# define FLUSH_CACHED_PEN(__gcData__) \
if (__gcData__->hPen) { \
- if (__gcData__->save_hPen) { \
- SelectObject(__gcData__->_hDC, __gcData__->save_hPen); \
- __gcData__->save_hPen = 0; \
- } \
- _DeletePenIfNotInCache(__gcData__->hPen, __LINE__); \
- __gcData__->hPen = 0; \
+ if (__gcData__->save_hPen) { \
+ SelectObject(__gcData__->_hDC, __gcData__->save_hPen); \
+ __gcData__->save_hPen = 0; \
+ } \
+ _DeletePenIfNotInCache(__gcData__->hPen, __LINE__); \
+ __gcData__->hPen = 0; \
}
#else
# define FLUSH_CACHED_PEN(x) /* */
@@ -1327,12 +1327,12 @@
#ifdef CACHE_LAST_BRUSH
# define FLUSH_CACHED_BRUSH(__gcData__) \
if (__gcData__->hBrush) { \
- if (__gcData__->save_hBrush) { \
- SelectObject(__gcData__->_hDC, __gcData__->save_hBrush); \
- __gcData__->save_hBrush = 0; \
- } \
- _DeleteBrushIfNotInCache(__gcData__->hBrush, __LINE__); \
- __gcData__->hBrush = 0; \
+ if (__gcData__->save_hBrush) { \
+ SelectObject(__gcData__->_hDC, __gcData__->save_hBrush); \
+ __gcData__->save_hBrush = 0; \
+ } \
+ _DeleteBrushIfNotInCache(__gcData__->hBrush, __LINE__); \
+ __gcData__->hBrush = 0; \
}
#else
# define FLUSH_CACHED_BRUSH(x) /* */
@@ -1344,55 +1344,55 @@
HDC hDC = gcData->_hDC;
if (gcData->doNotCacheOrRelease ) {
- return;
+ return;
}
if (gcData->save_hPen) {
- SelectObject(hDC, gcData->save_hPen);
- gcData->save_hPen = 0;
+ SelectObject(hDC, gcData->save_hPen);
+ gcData->save_hPen = 0;
}
if (gcData->save_hBrush) {
- SelectObject(hDC, gcData->save_hBrush);
- gcData->save_hBrush = 0;
+ SelectObject(hDC, gcData->save_hBrush);
+ gcData->save_hBrush = 0;
}
if (gcData->save_hFont) {
- SelectObject(hDC, gcData->save_hFont);
- gcData->save_hFont = 0;
+ SelectObject(hDC, gcData->save_hFont);
+ gcData->save_hFont = 0;
}
if (gcData->hWnd) {
- if (hDC) {
- ReleaseDC(gcData->hWnd, hDC);
+ if (hDC) {
+ ReleaseDC(gcData->hWnd, hDC);
#ifdef CACHE_LAST_WM_PAINT_DC
- if (hDC == last_wm_paint_dc) {
- last_wm_paint_dc = last_wm_paint_win = 0;
+ if (hDC == last_wm_paint_dc) {
+ last_wm_paint_dc = last_wm_paint_win = 0;
# ifdef DEBUG_DC_REUSE
- console_fprintf(stderr, "WinWorkstation [info]: Oops - releasing bg_paint-dc\n");
+ console_fprintf(stderr, "WinWorkstation [info]: Oops - releasing bg_paint-dc\n");
# endif
- }
-#endif
- }
+ }
+#endif
+ }
} else if (gcData->hBitmap) {
- SelectObject(hDC, gcData->save_hBitmap);
- DeleteDC(hDC);
+ SelectObject(hDC, gcData->save_hBitmap);
+ DeleteDC(hDC);
}
gcData->_hDC = 0;
#ifdef CACHE_LAST_DC
if (lastGcData == gcData) {
- lastGcData = 0;
+ lastGcData = 0;
}
#endif
#ifdef CACHE_LAST_PEN
if (gcData->hPen) {
- _DeletePenIfNotInCache(gcData->hPen, __LINE__);
- gcData->hPen = 0;
+ _DeletePenIfNotInCache(gcData->hPen, __LINE__);
+ gcData->hPen = 0;
}
#endif
#ifdef CACHE_LAST_BRUSH
if (gcData->hBrush) {
- _DeleteBrushIfNotInCache(gcData->hBrush, __LINE__);
- gcData->hBrush = 0;
+ _DeleteBrushIfNotInCache(gcData->hBrush, __LINE__);
+ gcData->hBrush = 0;
}
#endif
}
@@ -1404,82 +1404,82 @@
int currThreadId;
if (gcData->doNotCacheOrRelease ) {
- return gcData->_hDC;
+ return gcData->_hDC;
}
#ifdef CACHE_LAST_DC
currThreadId = GetCurrentThreadId();
if (lastGcData) {
- if ((lastGcData == gcData)
- && (lastGcHWIN == gcData->hWnd)
- && (lastGcHBITMAP == gcData->hBitmap)
- && (lastGcOwnerThreadID == currThreadId)
- && gcData->_hDC
- ) {
+ if ((lastGcData == gcData)
+ && (lastGcHWIN == gcData->hWnd)
+ && (lastGcHBITMAP == gcData->hBitmap)
+ && (lastGcOwnerThreadID == currThreadId)
+ && gcData->_hDC
+ ) {
# ifdef CACHE_LAST_WM_PAINT_DC /* DDD */
- if (last_wm_paint_dc == gcData->_hDC) {
+ if (last_wm_paint_dc == gcData->_hDC) {
# ifdef DEBUG_DC_REUSE
- console_fprintf(stderr, "WinWorkstation [info]: Oops wm_paint_dc reuse [%d]\n", __LINE__);
+ console_fprintf(stderr, "WinWorkstation [info]: Oops wm_paint_dc reuse [%d]\n", __LINE__);
# endif
- last_wm_paint_dc = last_wm_paint_win = 0;
- }
+ last_wm_paint_dc = last_wm_paint_win = 0;
+ }
# endif
- return gcData->_hDC;
- }
-
- _releaseDC(lastGcData);
- lastGcData = 0;
+ return gcData->_hDC;
+ }
+
+ _releaseDC(lastGcData);
+ lastGcData = 0;
}
#endif
hDC = 0;
if (gcData->hWnd != 0) {
- if (gcData->hWnd == __rootWin) {
- hDC = gcData->_hDC = GetDCEx(gcData->hWnd, 0, DCX_WINDOW);
- } else if (gcData->clipByChildren) {
- //gcData->_hDC = GetDCEx(gcData->hWnd, 0, DCX_CLIPCHILDREN);
- hDC = gcData->_hDC = GetDC(gcData->hWnd);
- } else {
- hDC = gcData->_hDC = GetDCEx(gcData->hWnd, 0, DCX_PARENTCLIP);
- }
+ if (gcData->hWnd == __rootWin) {
+ hDC = gcData->_hDC = GetDCEx(gcData->hWnd, 0, DCX_WINDOW);
+ } else if (gcData->clipByChildren) {
+ //gcData->_hDC = GetDCEx(gcData->hWnd, 0, DCX_CLIPCHILDREN);
+ hDC = gcData->_hDC = GetDC(gcData->hWnd);
+ } else {
+ hDC = gcData->_hDC = GetDCEx(gcData->hWnd, 0, DCX_PARENTCLIP);
+ }
} else if (gcData->hBitmap) {
- hDC = gcData->_hDC = CreateCompatibleDC(__tmpDC);
- gcData->save_hBitmap = SelectObject(gcData->_hDC,gcData->hBitmap);
+ hDC = gcData->_hDC = CreateCompatibleDC(__tmpDC);
+ gcData->save_hBitmap = SelectObject(gcData->_hDC,gcData->hBitmap);
}
gcData->bkMode = BK_UNDEF;
if (hDC) {
- SetTextColor(hDC, gcData->fgColor);
- SetBkColor(hDC, gcData->bgColor);
-
- if (gcData->rop2)
- SetROP2(hDC, gcData->rop2);
-
- if (gcData->clipping) {
- HRGN region = CreateRectRgn( gcData->clipX, gcData->clipY,
- gcData->clipX + gcData->clipW,
- gcData->clipY + gcData->clipH);
- if (region == NULL ) {
- console_fprintf(stderr, "WinWorkstat [warning]: clipping region creation failed\n");
- } else {
- if (SelectClipRgn(hDC, region) == ERROR ) {
- DPRINTF(("WinWorkstat [warning]: select clipping region failed\n" ));
- }
- _DeleteObject(region, __LINE__);
- }
- } else {
- SelectClipRgn(hDC, NULL);
- }
-
- if (gcData->hFont) {
- HFONT prevFont;
-
- prevFont = SelectObject(hDC, gcData->hFont);
- if (! gcData->save_hFont) {
- gcData->save_hFont = prevFont;
- }
- }
+ SetTextColor(hDC, gcData->fgColor);
+ SetBkColor(hDC, gcData->bgColor);
+
+ if (gcData->rop2)
+ SetROP2(hDC, gcData->rop2);
+
+ if (gcData->clipping) {
+ HRGN region = CreateRectRgn( gcData->clipX, gcData->clipY,
+ gcData->clipX + gcData->clipW,
+ gcData->clipY + gcData->clipH);
+ if (region == NULL ) {
+ console_fprintf(stderr, "WinWorkstat [warning]: clipping region creation failed\n");
+ } else {
+ if (SelectClipRgn(hDC, region) == ERROR ) {
+ DPRINTF(("WinWorkstat [warning]: select clipping region failed\n" ));
+ }
+ _DeleteObject(region, __LINE__);
+ }
+ } else {
+ SelectClipRgn(hDC, NULL);
+ }
+
+ if (gcData->hFont) {
+ HFONT prevFont;
+
+ prevFont = SelectObject(hDC, gcData->hFont);
+ if (! gcData->save_hFont) {
+ gcData->save_hFont = prevFont;
+ }
+ }
}
#ifdef CACHE_LAST_DC
@@ -1493,9 +1493,9 @@
# ifdef CACHE_LAST_WM_PAINT_DC /* DDD */
if (last_wm_paint_dc == hDC) {
# ifdef DEBUG_DC_REUSE
- console_fprintf(stderr, "WinWorkstation [info]: Oops wm_paint_dc reuse [%d]\n", __LINE__);
+ console_fprintf(stderr, "WinWorkstation [info]: Oops wm_paint_dc reuse [%d]\n", __LINE__);
# endif
- last_wm_paint_dc = last_wm_paint_win = 0;
+ last_wm_paint_dc = last_wm_paint_win = 0;
}
# endif
#endif
@@ -1511,62 +1511,62 @@
#ifdef CACHE_LAST_BRUSH
if (hBrush = gcData->hBrush) {
- if (! gcData->save_hBrush) {
- gcData->save_hBrush = SelectObject(gcData->_hDC, hBrush);
- }
- return hBrush;
+ if (! gcData->save_hBrush) {
+ gcData->save_hBrush = SelectObject(gcData->_hDC, hBrush);
+ }
+ return hBrush;
}
#endif
if (gcData->hMask) {
- hBrush = CreatePatternBrush(gcData->hMask);
- SetBrushOrgEx(hDC, gcData->maskOrgX, gcData->maskOrgY, 0);
- RESPRINTF(("CreatePatternBrush %x\n",gcData->hMask));
+ hBrush = CreatePatternBrush(gcData->hMask);
+ SetBrushOrgEx(hDC, gcData->maskOrgX, gcData->maskOrgY, 0);
+ RESPRINTF(("CreatePatternBrush %x\n",gcData->hMask));
} else {
- if (gcData->fgColor == BlackPixel) {
- hBrush = __blackBrush;
- } else if (gcData->fgColor == WhitePixel) {
- hBrush = __whiteBrush;
- } else {
+ if (gcData->fgColor == BlackPixel) {
+ hBrush = __blackBrush;
+ } else if (gcData->fgColor == WhitePixel) {
+ hBrush = __whiteBrush;
+ } else {
#ifdef CACHE_BRUSH
- {
- int i;
-
- for (i=0; i<NUM_BRUSH_CACHED; i++) {
- if (__brushCache[i].clr == gcData->fgColor) {
- hBrush = __brushCache[i].brush;
- /*
- * move it up in the cache
- */
- if (i > 0) {
- HBRUSH t = __brushCache[i-1].brush;
- int c = __brushCache[i-1].clr;
-
- __brushCache[i-1].brush = hBrush;
- __brushCache[i-1].clr = gcData->fgColor;
- __brushCache[i].brush = t;
- __brushCache[i].clr = c;
- }
+ {
+ int i;
+
+ for (i=0; i<NUM_BRUSH_CACHED; i++) {
+ if (__brushCache[i].clr == gcData->fgColor) {
+ hBrush = __brushCache[i].brush;
+ /*
+ * move it up in the cache
+ */
+ if (i > 0) {
+ HBRUSH t = __brushCache[i-1].brush;
+ int c = __brushCache[i-1].clr;
+
+ __brushCache[i-1].brush = hBrush;
+ __brushCache[i-1].clr = gcData->fgColor;
+ __brushCache[i].brush = t;
+ __brushCache[i].clr = c;
+ }
# ifdef CACHE_LAST_BRUSH
- prevBrush = SelectObject(gcData->_hDC, hBrush);
- if (! gcData->save_hBrush) {
- gcData->save_hBrush = prevBrush;
- }
- gcData->hBrush = hBrush;
+ prevBrush = SelectObject(gcData->_hDC, hBrush);
+ if (! gcData->save_hBrush) {
+ gcData->save_hBrush = prevBrush;
+ }
+ gcData->hBrush = hBrush;
# endif
- return hBrush;
- }
- }
- }
+ return hBrush;
+ }
+ }
+ }
#endif /* BRUSH_CACHE */
- hBrush = CreateSolidBrush(gcData->fgColor);
- RESPRINTF(("CreateSolidBrush %x\n",gcData->fgColor));
- }
+ hBrush = CreateSolidBrush(gcData->fgColor);
+ RESPRINTF(("CreateSolidBrush %x\n",gcData->fgColor));
+ }
}
gcData->hBrush = hBrush;
prevBrush = SelectObject(gcData->_hDC, hBrush);
if (! gcData->save_hBrush) {
- gcData->save_hBrush = prevBrush;
+ gcData->save_hBrush = prevBrush;
}
return hBrush;
}
@@ -1581,8 +1581,8 @@
hBrush = gcData->hBrush;
if (gcData->save_hBrush) {
- SelectObject(hDC, gcData->save_hBrush);
- gcData->save_hBrush = NULL;
+ SelectObject(hDC, gcData->save_hBrush);
+ gcData->save_hBrush = NULL;
}
_DeleteBrushIfNotInCache(hBrush, __LINE__);
gcData->hBrush = 0;
@@ -1599,69 +1599,69 @@
#ifdef CACHE_LAST_PEN
if (hPen = gcData->hPen) {
- if (! gcData->save_hPen) {
- gcData->save_hPen = SelectObject(gcData->_hDC, hPen);
- }
- return hPen;
+ if (! gcData->save_hPen) {
+ gcData->save_hPen = SelectObject(gcData->_hDC, hPen);
+ }
+ return hPen;
}
#endif
if (((gcData->lStyle & PS_STYLE_MASK) == PS_SOLID)
&& (gcData->hMask == 0)
&& (gcData->lineWidth <= 1)) {
- if (gcData->fgColor == BlackPixel) {
- gcData->hPen = hPen = __blackPen;
- prevPen = SelectObject(hDC, hPen);
- if (! gcData->save_hPen) {
- gcData->save_hPen = prevPen;
- }
- return hPen;
- }
- if (gcData->fgColor == WhitePixel) {
- gcData->hPen = hPen = __whitePen;
- prevPen = SelectObject(hDC, hPen);
- if (! gcData->save_hPen) {
- gcData->save_hPen = prevPen;
- }
- return hPen;
- }
+ if (gcData->fgColor == BlackPixel) {
+ gcData->hPen = hPen = __blackPen;
+ prevPen = SelectObject(hDC, hPen);
+ if (! gcData->save_hPen) {
+ gcData->save_hPen = prevPen;
+ }
+ return hPen;
+ }
+ if (gcData->fgColor == WhitePixel) {
+ gcData->hPen = hPen = __whitePen;
+ prevPen = SelectObject(hDC, hPen);
+ if (! gcData->save_hPen) {
+ gcData->save_hPen = prevPen;
+ }
+ return hPen;
+ }
#ifdef CACHE_PEN
- {
- int i;
-
- for (i=0; i<NUM_PEN_CACHED; i++) {
- if (__penCache[i].clr == gcData->fgColor) {
- hPen = __penCache[i].pen;
- /*
- * move it up in the cache
- */
- if (i > 0) {
- HPEN t = __penCache[i-1].pen;
- int c = __penCache[i-1].clr;
-
- __penCache[i-1].pen = hPen;
- __penCache[i-1].clr = gcData->fgColor;
- __penCache[i].pen = t;
- __penCache[i].clr = c;
- }
-
- gcData->hPen = hPen;
- prevPen = SelectObject(hDC, hPen);
- if (! gcData->save_hPen) {
- gcData->save_hPen = prevPen;
- }
- return hPen;
- }
- }
- }
+ {
+ int i;
+
+ for (i=0; i<NUM_PEN_CACHED; i++) {
+ if (__penCache[i].clr == gcData->fgColor) {
+ hPen = __penCache[i].pen;
+ /*
+ * move it up in the cache
+ */
+ if (i > 0) {
+ HPEN t = __penCache[i-1].pen;
+ int c = __penCache[i-1].clr;
+
+ __penCache[i-1].pen = hPen;
+ __penCache[i-1].clr = gcData->fgColor;
+ __penCache[i].pen = t;
+ __penCache[i].clr = c;
+ }
+
+ gcData->hPen = hPen;
+ prevPen = SelectObject(hDC, hPen);
+ if (! gcData->save_hPen) {
+ gcData->save_hPen = prevPen;
+ }
+ return hPen;
+ }
+ }
+ }
#endif /* PEN_CACHE */
}
hPen = (HPEN) 0;
lw = gcData->lineWidth;
if (lw == 0) {
- lw = 1;
+ lw = 1;
}
/*
@@ -1669,41 +1669,41 @@
* and also non-solid lines with any lineWidth.
*/
if (gcData->hMask) {
- Brush.lbStyle = BS_PATTERN;
- Brush.lbHatch = (DWORD)gcData->hMask;
- Brush.lbColor = gcData->fgColor;
+ Brush.lbStyle = BS_PATTERN;
+ Brush.lbHatch = (DWORD)gcData->hMask;
+ Brush.lbColor = gcData->fgColor;
} else {
- hPen = CreatePen((gcData->lStyle & PS_STYLE_MASK), lw, gcData->fgColor);
-
- RESPRINTF(("CreatePen %x %d(%d) %x %x\n",
- gcData->lStyle,
- lw, gcData->lineWidth,
- gcData->fgColor, gcData->hMask));
-
- SetBkMode(hDC, TRANSPARENT);
- gcData->bkMode = BK_TRANSPARENT;
-
- if (! hPen) {
- hPen = ExtCreatePen(PS_GEOMETRIC | gcData->lStyle,
- lw, /* gcData->lineWidth, */
- &Brush,
- 0, 0);
-
- RESPRINTF(("ExtCreatePen1 %x %d(%d) %x %x\n",
- gcData->lStyle,
- lw, gcData->lineWidth,
- gcData->fgColor, gcData->hMask));
-
- if (gcData->hMask) {
- SetBrushOrgEx(hDC, gcData->maskOrgX, gcData->maskOrgY, 0);
- }
- }
+ hPen = CreatePen((gcData->lStyle & PS_STYLE_MASK), lw, gcData->fgColor);
+
+ RESPRINTF(("CreatePen %x %d(%d) %x %x\n",
+ gcData->lStyle,
+ lw, gcData->lineWidth,
+ gcData->fgColor, gcData->hMask));
+
+ SetBkMode(hDC, TRANSPARENT);
+ gcData->bkMode = BK_TRANSPARENT;
+
+ if (! hPen) {
+ hPen = ExtCreatePen(PS_GEOMETRIC | gcData->lStyle,
+ lw, /* gcData->lineWidth, */
+ &Brush,
+ 0, 0);
+
+ RESPRINTF(("ExtCreatePen1 %x %d(%d) %x %x\n",
+ gcData->lStyle,
+ lw, gcData->lineWidth,
+ gcData->fgColor, gcData->hMask));
+
+ if (gcData->hMask) {
+ SetBrushOrgEx(hDC, gcData->maskOrgX, gcData->maskOrgY, 0);
+ }
+ }
}
gcData->hPen = hPen;
prevPen = SelectObject(hDC, hPen);
if (! gcData->save_hPen) {
- gcData->save_hPen = prevPen;
+ gcData->save_hPen = prevPen;
}
#ifdef CACHE_PEN
@@ -1713,28 +1713,28 @@
if (((gcData->lStyle & PS_STYLE_MASK) == PS_SOLID)
&& (gcData->hMask == 0)
&& (gcData->lineWidth <= 1)) {
- int i;
-
- /*
- * search for an empty slot
- */
- for (i=0; i<NUM_PEN_CACHED; i++) {
- if (__penCache[i].pen == 0) {
- __penCache[i].clr = gcData->fgColor;
- __penCache[i].pen = hPen;
- break;
- }
- }
- if (i == NUM_PEN_CACHED) {
- /*
- * replace last in penCache
- */
- HPEN t = __penCache[NUM_PEN_CACHED - 1].pen;
-
- __penCache[NUM_PEN_CACHED - 1].pen = hPen;
- __penCache[NUM_PEN_CACHED - 1].clr = gcData->fgColor;
- _DeletePen(t, __LINE__);
- }
+ int i;
+
+ /*
+ * search for an empty slot
+ */
+ for (i=0; i<NUM_PEN_CACHED; i++) {
+ if (__penCache[i].pen == 0) {
+ __penCache[i].clr = gcData->fgColor;
+ __penCache[i].pen = hPen;
+ break;
+ }
+ }
+ if (i == NUM_PEN_CACHED) {
+ /*
+ * replace last in penCache
+ */
+ HPEN t = __penCache[NUM_PEN_CACHED - 1].pen;
+
+ __penCache[NUM_PEN_CACHED - 1].pen = hPen;
+ __penCache[NUM_PEN_CACHED - 1].clr = gcData->fgColor;
+ _DeletePen(t, __LINE__);
+ }
}
#endif
@@ -1750,8 +1750,8 @@
HPEN hPen;
if (gcData->save_hPen) {
- SelectObject(hDC, gcData->save_hPen);
- gcData->save_hPen = NULL;
+ SelectObject(hDC, gcData->save_hPen);
+ gcData->save_hPen = NULL;
}
hPen = gcData->hPen;
_DeletePenIfNotInCache(hPen, __LINE__);
@@ -1769,36 +1769,36 @@
#ifdef LOCK_DEBUG
lockCountEvents++;
if (lockCountEvents != 1) {
- console_fprintf(stderr, "WinWorkstation [warning]: lockCountEvents (%d) != 1 in lock\n", lockCountEvents);
- lockCountEvents = 1;
+ console_fprintf(stderr, "WinWorkstation [warning]: lockCountEvents (%d) != 1 in lock\n", lockCountEvents);
+ lockCountEvents = 1;
}
#endif
switch (dwWaitResult) {
- case WAIT_OBJECT_0:
- hEventsMutexOwner = whoIsLocking;
- return (TRUE);
-
- case WAIT_ABANDONED:
- console_fprintf(stderr, "WinWorkstation [warning]: lockEvent abandoned (was owned by %s)\n",
- (hEventsMutexOwner ? hEventsMutexOwner : "NONE"));
- hEventsMutexOwner = whoIsLocking;
- return (TRUE);
-
- case WAIT_TIMEOUT:
- console_fprintf(stderr, "WinWorkstation [warning]: lockEvent timeout (owned by %s)\n",
- (hEventsMutexOwner ? hEventsMutexOwner : "NONE") );
- break;
-
- default:
- {
- unsigned errCode = GetLastError();
-
- console_fprintf(stderr, "WinWorkstation [error]: lockEvent error (owned by %s) rslt=0x%x err=0x%x\n",
- (hEventsMutexOwner ? hEventsMutexOwner : "NONE"),
- dwWaitResult, errCode );
- }
- break;
+ case WAIT_OBJECT_0:
+ hEventsMutexOwner = whoIsLocking;
+ return (TRUE);
+
+ case WAIT_ABANDONED:
+ console_fprintf(stderr, "WinWorkstation [warning]: lockEvent abandoned (was owned by %s)\n",
+ (hEventsMutexOwner ? hEventsMutexOwner : "NONE"));
+ hEventsMutexOwner = whoIsLocking;
+ return (TRUE);
+
+ case WAIT_TIMEOUT:
+ console_fprintf(stderr, "WinWorkstation [warning]: lockEvent timeout (owned by %s)\n",
+ (hEventsMutexOwner ? hEventsMutexOwner : "NONE") );
+ break;
+
+ default:
+ {
+ unsigned errCode = GetLastError();
+
+ console_fprintf(stderr, "WinWorkstation [error]: lockEvent error (owned by %s) rslt=0x%x err=0x%x\n",
+ (hEventsMutexOwner ? hEventsMutexOwner : "NONE"),
+ dwWaitResult, errCode );
+ }
+ break;
}
return (FALSE);
}
@@ -1808,8 +1808,8 @@
#ifdef LOCK_DEBUG
lockCountEvents--;
if (lockCountEvents != 0) {
- console_fprintf(stderr, "WinWorkstation [warning]: lockCountEvents (%d) != 0 in unlock\n", lockCountEvents);
- lockCountEvents = 0;
+ console_fprintf(stderr, "WinWorkstation [warning]: lockCountEvents (%d) != 0 in unlock\n", lockCountEvents);
+ lockCountEvents = 0;
}
#endif
if (! ReleaseMutex(hEventsMutex)) {
@@ -1829,11 +1829,11 @@
bulk = (struct queuedEvent *) malloc(EV_CHUNK_SZ);
if (bulk == 0) {
- console_fprintf(stderr, "WinWorkstation [warning]: no memory for dispatchqueue\n");
- return 0;
+ console_fprintf(stderr, "WinWorkstation [warning]: no memory for dispatchqueue\n");
+ return 0;
}
for (i=1; i<EV_CHUNK_CNT; i++) {
- bulk[i-1].ev_next = &(bulk[i]);
+ bulk[i-1].ev_next = &(bulk[i]);
}
bulk[EV_CHUNK_CNT-1].ev_next = (struct queuedEvent *)0;
eventFreeList = bulk;
@@ -1855,25 +1855,25 @@
/* get an event struct
*/
while (! eventFreeList) {
- if (repeatCount++ >= 5) {
- /* throw away sorry */
- console_fprintf(stderr, "WinWorkstation [error]: event throw away (memory problem)\n");
- return;
- }
- console_fprintf(stderr, "WinWorkstation [warning]: wait for event memory (%d)\n", repeatCount);
- WaitForSingleObject( hNeverTriggered, 100L );
+ if (repeatCount++ >= 5) {
+ /* throw away sorry */
+ console_fprintf(stderr, "WinWorkstation [error]: event throw away (memory problem)\n");
+ return;
+ }
+ console_fprintf(stderr, "WinWorkstation [warning]: wait for event memory (%d)\n", repeatCount);
+ WaitForSingleObject( hNeverTriggered, 100L );
}
if (! lockEvents("enqEvent")) {
- console_fprintf(stderr, "WinWorkstation [error]: event throw away (lock problem)\n");
- return;
+ console_fprintf(stderr, "WinWorkstation [error]: event throw away (lock problem)\n");
+ return;
}
ev = eventFreeList;
if (! ev) {
- console_fprintf(stderr, "WinWorkstation [error]: event throw away (memory problem)\n");
- unlockEvents();
- return;
+ console_fprintf(stderr, "WinWorkstation [error]: event throw away (memory problem)\n");
+ unlockEvents();
+ return;
}
eventFreeList = ev->ev_next;
ev->ev_flag = flag;
@@ -1889,16 +1889,16 @@
ev->ev_next = (struct queuedEvent *) 0;
if (eventQueueTail) {
- eventQueueTail->ev_next = ev;
+ eventQueueTail->ev_next = ev;
} else {
- eventQueueHead = ev;
+ eventQueueHead = ev;
}
eventQueueTail = ev;
unlockEvents();
if (eventQueueHead == ev) {
- SetEvent(hInputEvent);
+ SetEvent(hInputEvent);
}
#if 0
@@ -1913,104 +1913,104 @@
char * freeArg2 = NULL;
if (mask != ~0) {
- PRINTF(("deqEvent mask:%x\n",mask));
+ PRINTF(("deqEvent mask:%x\n",mask));
}
if (hWnd) {
- PRINTF(("deqEvent hWnd:%x\n",hWnd));
+ PRINTF(("deqEvent hWnd:%x\n",hWnd));
}
again:
if (! eventQueueHead)
- return (0);
+ return (0);
if (! lockEvents("deqEvent")) {
- return (0);
+ return (0);
}
TH_DPRINTF(("TDEQ\n"));
ev = eventQueueHead;
if (! ev) {
- unlockEvents();
- return (0);
+ unlockEvents();
+ return (0);
}
eventQueueHead = ev->ev_next;
if (! eventQueueHead) {
- eventQueueTail = (struct queuedEvent *) 0;
+ eventQueueTail = (struct queuedEvent *) 0;
}
if (ev->count != -1) {
- static int anyGoodEventReceived = 1;
-
- if (eventempfcount != ev->count) {
- if (anyGoodEventReceived) {
- console_fprintf(stderr, "WinWorkstation [warning]: lost event (eventcount error %d <-> %d)\n",
- eventempfcount, ev->count);
- }
- eventempfcount = ev->count;
- anyGoodEventReceived = 0;
- } else {
- anyGoodEventReceived = 1;
- }
- eventempfcount++;
+ static int anyGoodEventReceived = 1;
+
+ if (eventempfcount != ev->count) {
+ if (anyGoodEventReceived) {
+ console_fprintf(stderr, "WinWorkstation [warning]: lost event (eventcount error %d <-> %d)\n",
+ eventempfcount, ev->count);
+ }
+ eventempfcount = ev->count;
+ anyGoodEventReceived = 0;
+ } else {
+ anyGoodEventReceived = 1;
+ }
+ eventempfcount++;
}
if (ev->ev_message == WM_DESTROY) {
- /*
- * arg2 is the localInfoPtr
- * (which is already cleared in the wind-structure)
- * it must be freed by the stx-process ('cause it was malloc'd by it)
- */
- if (ev->ev_arg2) {
- freeArg2 = (char *) ev->ev_arg2;
- ev->ev_arg2 = 0;
- }
+ /*
+ * arg2 is the localInfoPtr
+ * (which is already cleared in the wind-structure)
+ * it must be freed by the stx-process ('cause it was malloc'd by it)
+ */
+ if (ev->ev_arg2) {
+ freeArg2 = (char *) ev->ev_arg2;
+ ev->ev_arg2 = 0;
+ }
#ifdef TOPWINDOWCLASS
FALSCH: nochmals in QUEUE -> (ev_arg2 != 0) arg2 freed !!!
- if (ev->ev_arg1) {
- if (UnregisterClass((char*)ev->ev_arg1,(HANDLE) __getHInstance())) {
- /*console_printf("UnregisterClass %s ok.\n",(char*)ev->ev_arg1);*/
-
- } else {
- /* noch einmal in die queue
- */
- if (ev->ev_arg2++ < 100) {
- ev->ev_next = (struct queuedEvent *)0;
- ev->count = eventsendcount++;
-
- if (eventQueueTail) {
- eventQueueTail->ev_next = ev;
- } else {
- eventQueueHead = ev;
- }
- eventQueueTail = ev;
- unlockEvents();
-
- if (freeArg2) {
- free (freeArg2);
- freeArg2 = NULL;
- }
-
- if (ev->ev_arg2 > 98) {
- console_fprintf(stderr, "WinWorkstation [info]: UnregisterClass %s failed. Wait 1 sec.\n",(char*)ev->ev_arg1);
- sleep(1);
- } else {
- sleep(0);
- }
- goto again;
- }
- /* fail evtl. später ändern und in st verzögert aufrufen
- */
- console_fprintf(stderr, "WinWorkstation [info]: UnregisterClass %s failed.\n",(char*)ev->ev_arg1);
- }
- free((char*)ev->ev_arg1);
- ev->ev_arg1 = 0;
- }
+ if (ev->ev_arg1) {
+ if (UnregisterClass((char*)ev->ev_arg1,(HANDLE) __getHInstance())) {
+ /*console_printf("UnregisterClass %s ok.\n",(char*)ev->ev_arg1);*/
+
+ } else {
+ /* noch einmal in die queue
+ */
+ if (ev->ev_arg2++ < 100) {
+ ev->ev_next = (struct queuedEvent *)0;
+ ev->count = eventsendcount++;
+
+ if (eventQueueTail) {
+ eventQueueTail->ev_next = ev;
+ } else {
+ eventQueueHead = ev;
+ }
+ eventQueueTail = ev;
+ unlockEvents();
+
+ if (freeArg2) {
+ free (freeArg2);
+ freeArg2 = NULL;
+ }
+
+ if (ev->ev_arg2 > 98) {
+ console_fprintf(stderr, "WinWorkstation [info]: UnregisterClass %s failed. Wait 1 sec.\n",(char*)ev->ev_arg1);
+ sleep(1);
+ } else {
+ sleep(0);
+ }
+ goto again;
+ }
+ /* fail evtl. später ändern und in st verzögert aufrufen
+ */
+ console_fprintf(stderr, "WinWorkstation [info]: UnregisterClass %s failed.\n",(char*)ev->ev_arg1);
+ }
+ free((char*)ev->ev_arg1);
+ ev->ev_arg1 = 0;
+ }
#endif
}
@@ -2021,7 +2021,7 @@
unlockEvents();
if (freeArg2) {
- free (freeArg2);
+ free (freeArg2);
}
return (1);
}
@@ -2029,122 +2029,122 @@
static void
__clearRectangles(HWND hWnd, int numRects, RECT *pRect)
{
- HDC dc;
- HBRUSH br;
- int bgClr;
- int isPrivateBrush = 0;
+ HDC dc;
+ HBRUSH br;
+ int bgClr;
+ int isPrivateBrush = 0;
# ifdef CACHE_LAST_WM_PAINT_DC
- AQUIRE_PAINT_MUTEX;
-
- if (last_wm_paint_dc && (last_wm_paint_win == hWnd)) {
- dc = last_wm_paint_dc;
- } else {
- if (last_wm_paint_dc) {
+ AQUIRE_PAINT_MUTEX;
+
+ if (last_wm_paint_dc && (last_wm_paint_win == hWnd)) {
+ dc = last_wm_paint_dc;
+ } else {
+ if (last_wm_paint_dc) {
# ifdef CACHE_LAST_DC
- if (lastGcData && (lastGcData->_hDC == last_wm_paint_dc)) {
+ if (lastGcData && (lastGcData->_hDC == last_wm_paint_dc)) {
# ifdef DEBUG_DC_REUSE
- console_fprintf(stderr, "WinWorkstation [info]: Oops - release lastGcData [%d]\n", __LINE__);
+ console_fprintf(stderr, "WinWorkstation [info]: Oops - release lastGcData [%d]\n", __LINE__);
# endif
- _releaseDC(lastGcData);
- } else {
- ReleaseDC(last_wm_paint_win, last_wm_paint_dc);
- }
+ _releaseDC(lastGcData);
+ } else {
+ ReleaseDC(last_wm_paint_win, last_wm_paint_dc);
+ }
# else
- ReleaseDC(last_wm_paint_win, last_wm_paint_dc);
+ ReleaseDC(last_wm_paint_win, last_wm_paint_dc);
# endif /* CACHE_LAST_DC */
- }
- dc = GetDC(hWnd);
- last_wm_paint_dc = dc;
- last_wm_paint_win = hWnd;
- }
+ }
+ dc = GetDC(hWnd);
+ last_wm_paint_dc = dc;
+ last_wm_paint_win = hWnd;
+ }
# else
- dc = (HDC)GetDC(hWnd);
+ dc = (HDC)GetDC(hWnd);
# endif /* CACHE_LAST_WM_PAINT_DC */
# ifdef CACHE_LAST_DC
- if (lastGcData && (lastGcData->_hDC == dc)) {
+ if (lastGcData && (lastGcData->_hDC == dc)) {
# ifdef DEBUG_DC_REUSE
- console_fprintf(stderr, "WinWorkstation [info]: Oops wm_paint_dc reuse [%d]\n", __LINE__);
+ console_fprintf(stderr, "WinWorkstation [info]: Oops wm_paint_dc reuse [%d]\n", __LINE__);
# endif
- if ((lastGcData->rop2 != R2_COPYPEN)
- || (lastGcData->bitbltrop2 != BITBLT_COPY)) {
- console_fprintf(stderr, "WinWorkstation [info]: Oops wm_paint_dc not in Copy mode\n");
- }
- lastGcData = 0;
- }
+ if ((lastGcData->rop2 != R2_COPYPEN)
+ || (lastGcData->bitbltrop2 != BITBLT_COPY)) {
+ console_fprintf(stderr, "WinWorkstation [info]: Oops wm_paint_dc not in Copy mode\n");
+ }
+ lastGcData = 0;
+ }
# endif
- br = GetWindow_viewBgBrush(hWnd);
- if (! br) {
- bgClr = GetWindow_viewBgColor(hWnd);
+ br = GetWindow_viewBgBrush(hWnd);
+ if (! br) {
+ bgClr = GetWindow_viewBgColor(hWnd);
# ifdef CACHE_LAST_WM_PAINT_BRUSH
- if (last_wm_paint_brush
- && (last_wm_paint_brush_clr == bgClr)) {
- br = last_wm_paint_brush;
- } else {
- if (bgClr == WhitePixel) {
- br = __whiteBrush;
- } else if (bgClr == BlackPixel) {
- br = __blackBrush;
- } else {
- if (last_wm_paint_brush) {
- _DeleteBrush(last_wm_paint_brush, __LINE__);
- }
- last_wm_paint_brush = br = CreateSolidBrush(bgClr);
- last_wm_paint_brush_clr = bgClr;
- isPrivateBrush = 1;
- }
- }
+ if (last_wm_paint_brush
+ && (last_wm_paint_brush_clr == bgClr)) {
+ br = last_wm_paint_brush;
+ } else {
+ if (bgClr == WhitePixel) {
+ br = __whiteBrush;
+ } else if (bgClr == BlackPixel) {
+ br = __blackBrush;
+ } else {
+ if (last_wm_paint_brush) {
+ _DeleteBrush(last_wm_paint_brush, __LINE__);
+ }
+ last_wm_paint_brush = br = CreateSolidBrush(bgClr);
+ last_wm_paint_brush_clr = bgClr;
+ isPrivateBrush = 1;
+ }
+ }
# else
- br = CreateSolidBrush(bgClr);
- isPrivateBrush = 1;
+ br = CreateSolidBrush(bgClr);
+ isPrivateBrush = 1;
# endif
- }
-
- if (! br) {
- console_fprintf(stderr, "WinWorkstation [info]: no brush\n");
- }
-
- if (br) {
- int i;
-
- SelectClipRgn(dc, NULL);
-
- for (i=0; i<numRects; i++) {
- /*
- * always clear - even if not interested in exposes
- */
- FillRect(dc, &(pRect[i]), br);
- }
- }
+ }
+
+ if (! br) {
+ console_fprintf(stderr, "WinWorkstation [info]: no brush\n");
+ }
+
+ if (br) {
+ int i;
+
+ SelectClipRgn(dc, NULL);
+
+ for (i=0; i<numRects; i++) {
+ /*
+ * always clear - even if not interested in exposes
+ */
+ FillRect(dc, &(pRect[i]), br);
+ }
+ }
# ifndef CACHE_LAST_WM_PAINT_BRUSH
- if (isPrivateBrush) {
- _DeleteBrush(br, __LINE__);
- }
+ if (isPrivateBrush) {
+ _DeleteBrush(br, __LINE__);
+ }
# endif
# ifndef CACHE_LAST_WM_PAINT_DC
- ReleaseDC(hWnd, dc);
+ ReleaseDC(hWnd, dc);
# endif
# if defined(CACHE_LAST_WM_PAINT_DC)
- RELEASE_PAINT_MUTEX
+ RELEASE_PAINT_MUTEX
# endif
}
static void
__clearWindow(HWND hWnd, int x, int y, int w, int h)
{
- RECT rect;
-
- rect.left = x;
- rect.top = y;
- rect.right = x + w;
- rect.bottom = y + h;
- __clearRectangles(hWnd, 1, &rect);
+ RECT rect;
+
+ rect.left = x;
+ rect.top = y;
+ rect.right = x + w;
+ rect.bottom = y + h;
+ __clearRectangles(hWnd, 1, &rect);
}
@@ -2159,128 +2159,128 @@
static int
__generateExposes(HWND hWnd, HRGN hRgnInOrNull, int msgType, int doClear)
{
- RECT updRect;
- HRGN updRgn = 0;
- int numRects, ret, n, i;
- int wantExpose;
- RECT *pRect;
- union {
- RGNDATA rgnData;
- char bytes[512];
- } data;
-
- wantExpose = 0;
-
- if( msgType >= 0 )
- wantExpose = (GetWindow_eventMask(hWnd) & ExposureMask);
-
- if (hRgnInOrNull) {
- updRgn = hRgnInOrNull;
- } else {
- PAINTSTRUCT ps;
-
- /*
- * fetch the update region, even if ExposureMask is empty.
- */
- updRgn = CreateRectRgn(0, 0, 0, 0);
- ret = GetUpdateRgn(hWnd, updRgn, FALSE);
+ RECT updRect;
+ HRGN updRgn = 0;
+ int numRects, ret, n, i;
+ int wantExpose;
+ RECT *pRect;
+ union {
+ RGNDATA rgnData;
+ char bytes[512];
+ } data;
+
+ wantExpose = 0;
+
+ if( msgType >= 0 )
+ wantExpose = (GetWindow_eventMask(hWnd) & ExposureMask);
+
+ if (hRgnInOrNull) {
+ updRgn = hRgnInOrNull;
+ } else {
+ PAINTSTRUCT ps;
+
+ /*
+ * fetch the update region, even if ExposureMask is empty.
+ */
+ updRgn = CreateRectRgn(0, 0, 0, 0);
+ ret = GetUpdateRgn(hWnd, updRgn, FALSE);
#if 0
- BeginPaint(hWnd, &ps);
- /* store the rectangle required for image bit reversal */
- /* updateRect = ps.rcPaint; */
- EndPaint(hWnd, &ps);
-#endif
- switch (ret) {
- case ERROR:
- console_fprintf(stderr, "WinWorkstation [info]: errregion\n");
- return -1;
- case NULLREGION:
- DDPRINTF(("nullregion\n"));
- _DeleteObject(updRgn, __LINE__);
- return 0;
- case SIMPLEREGION:
- case COMPLEXREGION:
- break;
- }
- }
- n = GetRegionData(updRgn, sizeof(data), &(data.rgnData));
-
- /*
- * the MS-doc states: n==1
- * but this is not true
- */
- if ((n >= sizeof(RGNDATA))
- && (n <= sizeof(data))
- && (data.rgnData.rdh.iType == RDH_RECTANGLES)) {
- /* ok, got the region */
- numRects = data.rgnData.rdh.nCount;
- pRect = (RECT *)(data.rgnData.Buffer);
- DDPRINTF(("region numRects=%d\n", numRects));
- } else {
- /* a big region ... */
- GetRgnBox(updRgn, &updRect);
- numRects = 1;
- pRect = &updRect;
- DPRINTF(("very complex region (need:%d have:%d) bounds=%d,%d -> %d,%d\n",
- n, sizeof(data),
- updRect.left, updRect.top,
- updRect.right, updRect.bottom));
- if (((updRect.right - updRect.left) <= 0)
- || ((updRect.bottom - updRect.top) <= 0)) {
- numRects = 0;
- }
- }
-
- if (numRects) {
- if (doClear) {
- __clearRectangles(hWnd, numRects, pRect);
- }
+ BeginPaint(hWnd, &ps);
+ /* store the rectangle required for image bit reversal */
+ /* updateRect = ps.rcPaint; */
+ EndPaint(hWnd, &ps);
+#endif
+ switch (ret) {
+ case ERROR:
+ console_fprintf(stderr, "WinWorkstation [info]: errregion\n");
+ return -1;
+ case NULLREGION:
+ DDPRINTF(("nullregion\n"));
+ _DeleteObject(updRgn, __LINE__);
+ return 0;
+ case SIMPLEREGION:
+ case COMPLEXREGION:
+ break;
+ }
+ }
+ n = GetRegionData(updRgn, sizeof(data), &(data.rgnData));
+
+ /*
+ * the MS-doc states: n==1
+ * but this is not true
+ */
+ if ((n >= sizeof(RGNDATA))
+ && (n <= sizeof(data))
+ && (data.rgnData.rdh.iType == RDH_RECTANGLES)) {
+ /* ok, got the region */
+ numRects = data.rgnData.rdh.nCount;
+ pRect = (RECT *)(data.rgnData.Buffer);
+ DDPRINTF(("region numRects=%d\n", numRects));
+ } else {
+ /* a big region ... */
+ GetRgnBox(updRgn, &updRect);
+ numRects = 1;
+ pRect = &updRect;
+ DPRINTF(("very complex region (need:%d have:%d) bounds=%d,%d -> %d,%d\n",
+ n, sizeof(data),
+ updRect.left, updRect.top,
+ updRect.right, updRect.bottom));
+ if (((updRect.right - updRect.left) <= 0)
+ || ((updRect.bottom - updRect.top) <= 0)) {
+ numRects = 0;
+ }
+ }
+
+ if (numRects) {
+ if (doClear) {
+ __clearRectangles(hWnd, numRects, pRect);
+ }
#ifndef PRE_21_NOV
- for (i=0; i < numRects; i++) {
- ValidateRect( hWnd, &pRect[i] );
- }
+ for (i=0; i < numRects; i++) {
+ ValidateRect( hWnd, &pRect[i] );
+ }
#endif
#ifdef DEBUG_COLORIZE_WM_PAINT_RECTS1
- {
- HDC hDC;
- HBRUSH hBrush;
-
- hBrush = CreateSolidBrush(BlackPixel);
- hDC = GetWindowDC(hWnd);
- SelectClipRgn(hDC, NULL);
- for (i=0; i<numRects; i++) {
- FillRect(hDC, &(pRect[i]), hBrush);
- }
- _DeleteBrush(hBrush, __LINE__);
- ReleaseDC(hWnd, hDC);
- }
-#endif
-
- if (wantExpose) {
- for (i=0; i<numRects; i++) {
- int final = 0;
-
- if ((msgType == __WM_GEXPOSE)
- && (i == (numRects - 1))) {
- final = 1;
- }
- enqEvent(ExposureMask, hWnd, msgType, final,
- pRect[i].left, pRect[i].top,
- pRect[i].right - pRect[i].left,
- pRect[i].bottom - pRect[i].top,
- EV_NOTIME);
- }
- }
- }
-
- if (updRgn && (updRgn != hRgnInOrNull)) {
- _DeleteObject(updRgn, __LINE__);
- }
-
- return numRects;
+ {
+ HDC hDC;
+ HBRUSH hBrush;
+
+ hBrush = CreateSolidBrush(BlackPixel);
+ hDC = GetWindowDC(hWnd);
+ SelectClipRgn(hDC, NULL);
+ for (i=0; i<numRects; i++) {
+ FillRect(hDC, &(pRect[i]), hBrush);
+ }
+ _DeleteBrush(hBrush, __LINE__);
+ ReleaseDC(hWnd, hDC);
+ }
+#endif
+
+ if (wantExpose) {
+ for (i=0; i<numRects; i++) {
+ int final = 0;
+
+ if ((msgType == __WM_GEXPOSE)
+ && (i == (numRects - 1))) {
+ final = 1;
+ }
+ enqEvent(ExposureMask, hWnd, msgType, final,
+ pRect[i].left, pRect[i].top,
+ pRect[i].right - pRect[i].left,
+ pRect[i].bottom - pRect[i].top,
+ EV_NOTIME);
+ }
+ }
+ }
+
+ if (updRgn && (updRgn != hRgnInOrNull)) {
+ _DeleteObject(updRgn, __LINE__);
+ }
+
+ return numRects;
}
#ifdef THIS_DOES_NOT_AVOID_DOUBLE_REPAINTS
@@ -2288,14 +2288,14 @@
BOOL CALLBACK
recursiveExposeGenerator(HWND hChild, LPARAM param)
{
- __generateExposes(hChild, NULL, param, 0);
- return TRUE;
+ __generateExposes(hChild, NULL, param, 0);
+ return TRUE;
}
static void
__generateRecursiveExposes(HWND hWnd, int msgType)
{
- EnumChildWindows(hWnd, recursiveExposeGenerator, msgType);
+ EnumChildWindows(hWnd, recursiveExposeGenerator, msgType);
}
#endif /* sigh */
@@ -2307,27 +2307,27 @@
int modifiers = 0;
if (GetKeyState(VK_SHIFT) & 0x8000)
- modifiers |= ShiftMask;
+ modifiers |= ShiftMask;
if (GetKeyState(VK_CONTROL) & 0x8000)
- modifiers |= ControlMask;
+ modifiers |= ControlMask;
#if 0
if (GetKeyState(VK_RMENU) & 0x8000)
- modifiers |= RightAltMask;
+ modifiers |= RightAltMask;
if (GetKeyState(VK_LMENU) & 0x8000)
- modifiers |= LeftAltMask;
+ modifiers |= LeftAltMask;
#else
if (GetKeyState(VK_MENU) & 0x8000)
- modifiers |= LeftAltMask;
+ modifiers |= LeftAltMask;
#endif
if (GetKeyState(VK_LBUTTON) & 0x8000)
- modifiers |= Button1Mask;
+ modifiers |= Button1Mask;
if (GetKeyState(VK_MBUTTON) & 0x8000)
- modifiers |= Button2Mask;
+ modifiers |= Button2Mask;
if (GetKeyState(VK_RBUTTON) & 0x8000)
- modifiers |= Button3Mask;
+ modifiers |= Button3Mask;
if ((modifiers & AnyButtonMask) == 0) {
- __eatingMouseEvents = 0;
+ __eatingMouseEvents = 0;
}
return modifiers;
}
@@ -2341,9 +2341,9 @@
# define MustHandleButtonEvent()\
(((__currentCapture == CAPTURE_NONE) \
&& ( (GetKeyState(VK_LBUTTON) & 0x8000) \
- || (GetKeyState(VK_MBUTTON) & 0x8000) \
- || (GetKeyState(VK_RBUTTON) & 0x8000) \
- ) \
+ || (GetKeyState(VK_MBUTTON) & 0x8000) \
+ || (GetKeyState(VK_RBUTTON) & 0x8000) \
+ ) \
) ? 0 : 1)
#else
@@ -2367,109 +2367,109 @@
int gravity;
if (lI = GETLOCALWINDOWINFOPTR(hChild)) {
- if ((gravity = lI->viewGravity) != GRAVITY_NONE) {
- RECT oldChildRct, oldChildWinRct;
- RECT newChildRct;
- int deltaW, deltaH;
- int anyChange = 0;
-
- /*
- * get its current bounds ...
- */
- GetClientRect(hChild, &oldChildRct);
- deltaW = iP->newW - iP->currW;
- deltaH = iP->newH - iP->currH;
-
- GetWindowRect(hChild, &oldChildWinRct);
- oldChildRct.left = oldChildWinRct.left - iP->parentWinX;
- oldChildRct.top = oldChildWinRct.top - iP->parentWinY;
-
- newChildRct = oldChildRct;
- switch (gravity) {
+ if ((gravity = lI->viewGravity) != GRAVITY_NONE) {
+ RECT oldChildRct, oldChildWinRct;
+ RECT newChildRct;
+ int deltaW, deltaH;
+ int anyChange = 0;
+
+ /*
+ * get its current bounds ...
+ */
+ GetClientRect(hChild, &oldChildRct);
+ deltaW = iP->newW - iP->currW;
+ deltaH = iP->newH - iP->currH;
+
+ GetWindowRect(hChild, &oldChildWinRct);
+ oldChildRct.left = oldChildWinRct.left - iP->parentWinX;
+ oldChildRct.top = oldChildWinRct.top - iP->parentWinY;
+
+ newChildRct = oldChildRct;
+ switch (gravity) {
#if 0
- case GRAVITY_N:
- console_fprintf(stderr, "WinWorkstation [info]: Child %x: North gravity\n", hChild);
- /*
- * shift to the bottom, for a constant
- * distance from the bottom edge;
- */
- newChildRct.bottom += deltaH;
- anyChange = 1;
- break;
-
- case GRAVITY_W:
- console_fprintf(stderr, "WinWorkstation [info]: Child %x: West gravity\n", hChild);
- /*
- * shift to the right, for a constant
- * distance from the right edge;
- */
- newChildRct.right += deltaW;
- anyChange = 1;
- break;
-#endif
- case GRAVITY_S:
- console_fprintf(stderr, "WinWorkstation [info]: Child %x: South gravity\n", hChild);
- /*
- * shift to the bottom, for a constant
- * distance from the bottom edge;
- */
- newChildRct.top += deltaH;
- newChildRct.bottom += deltaH;
- anyChange = 1;
- break;
-
- case GRAVITY_E:
- console_fprintf(stderr, "WinWorkstation [info]: Child %x: East gravity\n", hChild);
- /*
- * shift to the right, for a constant
- * distance from the right edge;
- */
- newChildRct.right += deltaW;
- newChildRct.left += deltaW;
- anyChange = 1;
- break;
-
- case GRAVITY_SE:
- console_fprintf(stderr, "WinWorkstation [info]: Child %x: SouthEast gravity\n", hChild);
- /*
- * shift to the bottom-right, for a constant
- * distance from the bottom-right edge;
- */
- newChildRct.right += deltaW;
- newChildRct.left += deltaW;
- newChildRct.top += deltaH;
- newChildRct.bottom += deltaH;
- anyChange = 1;
- break;
-
- default:
- DPRINTF(("Child %x: other gravity\n", hChild));
- break;
- }
-
- if (anyChange) {
- if ((newChildRct.left < 0)
- || (newChildRct.top < 0)
- || (newChildRct.right >= iP->newW)
- || (newChildRct.bottom >= iP->newH)) {
- console_fprintf(stderr, "WinWorkstation [info]: dont move child to: %d/%d -> %d/%d\n",
- newChildRct.left, newChildRct.top,
- newChildRct.right, newChildRct.bottom);
- } else {
- console_fprintf(stderr, "WinWorkstation [info]: move child from %d/%d->%d/%d to: %d/%d->%d/%d\n",
- oldChildRct.left, oldChildRct.top,
- oldChildRct.right, oldChildRct.bottom,
- newChildRct.left, newChildRct.top,
- newChildRct.right, newChildRct.bottom);
-
- SetWindowPos(hChild, (HWND)0,
- newChildRct.left, newChildRct.top,
- 0, 0,
- /* SWP_NOSENDCHANGING | */
- SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOZORDER | SWP_NOOWNERZORDER);
- }
- }
- }
+ case GRAVITY_N:
+ console_fprintf(stderr, "WinWorkstation [info]: Child %x: North gravity\n", hChild);
+ /*
+ * shift to the bottom, for a constant
+ * distance from the bottom edge;
+ */
+ newChildRct.bottom += deltaH;
+ anyChange = 1;
+ break;
+
+ case GRAVITY_W:
+ console_fprintf(stderr, "WinWorkstation [info]: Child %x: West gravity\n", hChild);
+ /*
+ * shift to the right, for a constant
+ * distance from the right edge;
+ */
+ newChildRct.right += deltaW;
+ anyChange = 1;
+ break;
+#endif
+ case GRAVITY_S:
+ console_fprintf(stderr, "WinWorkstation [info]: Child %x: South gravity\n", hChild);
+ /*
+ * shift to the bottom, for a constant
+ * distance from the bottom edge;
+ */
+ newChildRct.top += deltaH;
+ newChildRct.bottom += deltaH;
+ anyChange = 1;
+ break;
+
+ case GRAVITY_E:
+ console_fprintf(stderr, "WinWorkstation [info]: Child %x: East gravity\n", hChild);
+ /*
+ * shift to the right, for a constant
+ * distance from the right edge;
+ */
+ newChildRct.right += deltaW;
+ newChildRct.left += deltaW;
+ anyChange = 1;
+ break;
+
+ case GRAVITY_SE:
+ console_fprintf(stderr, "WinWorkstation [info]: Child %x: SouthEast gravity\n", hChild);
+ /*
+ * shift to the bottom-right, for a constant
+ * distance from the bottom-right edge;
+ */
+ newChildRct.right += deltaW;
+ newChildRct.left += deltaW;
+ newChildRct.top += deltaH;
+ newChildRct.bottom += deltaH;
+ anyChange = 1;
+ break;
+
+ default:
+ DPRINTF(("Child %x: other gravity\n", hChild));
+ break;
+ }
+
+ if (anyChange) {
+ if ((newChildRct.left < 0)
+ || (newChildRct.top < 0)
+ || (newChildRct.right >= iP->newW)
+ || (newChildRct.bottom >= iP->newH)) {
+ console_fprintf(stderr, "WinWorkstation [info]: dont move child to: %d/%d -> %d/%d\n",
+ newChildRct.left, newChildRct.top,
+ newChildRct.right, newChildRct.bottom);
+ } else {
+ console_fprintf(stderr, "WinWorkstation [info]: move child from %d/%d->%d/%d to: %d/%d->%d/%d\n",
+ oldChildRct.left, oldChildRct.top,
+ oldChildRct.right, oldChildRct.bottom,
+ newChildRct.left, newChildRct.top,
+ newChildRct.right, newChildRct.bottom);
+
+ SetWindowPos(hChild, (HWND)0,
+ newChildRct.left, newChildRct.top,
+ 0, 0,
+ /* SWP_NOSENDCHANGING | */
+ SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOZORDER | SWP_NOOWNERZORDER);
+ }
+ }
+ }
}
return TRUE;
}
@@ -2482,19 +2482,19 @@
wchar_t *wcp = out;
while ((nMax > 1) && cp && *cp) {
- *wcp++ = *cp++;
- nMax--;
+ *wcp++ = *cp++;
+ nMax--;
}
*wcp = 0;
}
static int
winEventProcessing(
- HWND hWnd, /* window handle */
- UINT message, /* type of message */
- UINT wParam, /* additional information */
- LONG lParam, /* additional information */
- int *pDefault
+ HWND hWnd, /* window handle */
+ UINT message, /* type of message */
+ UINT wParam, /* additional information */
+ LONG lParam, /* additional information */
+ int *pDefault
) {
int curButton;
int x, y, w, h;
@@ -2507,1922 +2507,1926 @@
evTime = lastMSGTime;
lastMSGTime = 0;
if (evTime == 0) {
- lastMSGTime = GetTickCount();
+ lastMSGTime = GetTickCount();
}
/*
EVENT_PRINTF(("winEvent hWin=0x%x message=0x%x wP=0x%x lP=0x%x\n",
- hWnd, message, wParam, lParam));
+ hWnd, message, wParam, lParam));
*/
if (hWnd) {
- if (message != WM_MOUSEMOVE) {
- lastMotionWnd = 0;
- }
-
- isNative = (GetWindow_flag(hWnd) & LI_NATIVEWIN);
- if (isNative) {
- NDPRINTF(("event %d (0x%x) for nativeWindow\n", message, message));
- }
+ if (message != WM_MOUSEMOVE) {
+ lastMotionWnd = 0;
+ }
+
+ isNative = (GetWindow_flag(hWnd) & LI_NATIVEWIN);
+ if (isNative) {
+ NDPRINTF(("event %d (0x%x) for nativeWindow\n", message, message));
+ }
}
/*
* messages which are enqueued to be handled by the view thread
*/
switch (message) {
- case WM_THREAD_CREATEWINDOW:
- EVENT_PRINTF(("*WM_THREAD_CREATEWINDOW\n"));
-
- {
- createWindowInfo *cwi = (createWindowInfo *)(lParam);
-
- if ((cwi->sequenceNr == wParam)
- && (cwi->sequenceNr != INVALIDATED_CWI)) {
- cwi->sequenceNr = INVALIDATED_CWI;
- cwi->infoWasRead = 1;
- if (cwi->newWinHandle == NULL) {
- HANDLE ev;
- HANDLE hwnd;
-
- cwi->newWinHandle = hwnd = CreateWindowExW(
- cwi->winStyleBitsEx,
- cwi->className,
- cwi->windowName,
- cwi->winStyleBits,
- cwi->x, cwi->y,
- cwi->dx, cwi->dy,
- cwi->parentHandle,
- NULL, /* menu */
- (HANDLE) __getHInstance(),
- cwi->localWindowInfo
- );
-
- if (hwnd == NULL) {
- cwi->errCode = GetLastError();
- console_fprintf(stderr, "WinWorkstation [info]: CreateWindow failed: %d (0x%x) [%d]\n",
- cwi->errCode, cwi->errCode, __LINE__);
- } else {
- SETLOCALWINDOWINFOPTR(hwnd, cwi->localWindowInfo);
+ case WM_THREAD_CREATEWINDOW:
+ EVENT_PRINTF(("*WM_THREAD_CREATEWINDOW\n"));
+
+ {
+ createWindowInfo *cwi = (createWindowInfo *)(lParam);
+
+ if ((cwi->sequenceNr == wParam)
+ && (cwi->sequenceNr != INVALIDATED_CWI)) {
+ cwi->sequenceNr = INVALIDATED_CWI;
+ cwi->infoWasRead = 1;
+ if (cwi->newWinHandle == NULL) {
+ HANDLE ev;
+ HANDLE hwnd;
+
+ cwi->newWinHandle = hwnd = CreateWindowExW(
+ cwi->winStyleBitsEx,
+ cwi->className,
+ cwi->windowName,
+ cwi->winStyleBits,
+ cwi->x, cwi->y,
+ cwi->dx, cwi->dy,
+ cwi->parentHandle,
+ NULL, /* menu */
+ (HANDLE) __getHInstance(),
+ cwi->localWindowInfo
+ );
+
+ if (hwnd == NULL) {
+ cwi->errCode = GetLastError();
+ console_fprintf(stderr, "WinWorkstation [info]: CreateWindow failed: %d (0x%x) [%d]\n",
+ cwi->errCode, cwi->errCode, __LINE__);
+ } else {
+ SETLOCALWINDOWINFOPTR(hwnd, cwi->localWindowInfo);
#ifdef DEBUG /* PARANOIA */
- if (GETLOCALWINDOWINFOPTR(hwnd) != cwi->localWindowInfo) {
- console_fprintf(stderr, "lI-Error\n");
- }
-#endif
- SetWindowPos(hWnd, HWND_TOP, 0, 0, 0, 0,
- /* SWP_NOOWNERZORDER |*/
- SWP_NOSENDCHANGING | SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
- }
-
- ev = cwi->hCreateEvent;
- if (ev) {
- SetEvent(ev);
- }
- }
- } else {
- DPRINTF(("obsolete createWindow message %x ignored\n", cwi->sequenceNr));
- }
- }
- *pDefault = 0;
- return 0;
-
- case WM_THREAD_DESTROYWINDOW:
- {
- HBRUSH br;
-
- br = GetWindow_viewBgBrush(hWnd);
- if (br) {
- SetWindow_viewBgBrush(hWnd, 0);
- _DeleteBrushIfNotInCache(br, __LINE__);
- }
- }
+ if (GETLOCALWINDOWINFOPTR(hwnd) != cwi->localWindowInfo) {
+ console_fprintf(stderr, "lI-Error\n");
+ }
+#endif
+ SetWindowPos(hWnd, HWND_TOP, 0, 0, 0, 0,
+ /* SWP_NOOWNERZORDER |*/
+ SWP_NOSENDCHANGING | SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
+ }
+
+ ev = cwi->hCreateEvent;
+ if (ev) {
+ SetEvent(ev);
+ }
+ }
+ } else {
+ DPRINTF(("obsolete createWindow message %x ignored\n", cwi->sequenceNr));
+ }
+ }
+ *pDefault = 0;
+ return 0;
+
+ case WM_THREAD_DESTROYWINDOW:
+ {
+ HBRUSH br;
+
+ br = GetWindow_viewBgBrush(hWnd);
+ if (br) {
+ SetWindow_viewBgBrush(hWnd, 0);
+ _DeleteBrushIfNotInCache(br, __LINE__);
+ }
+ }
#ifdef CACHE_LAST_DC
- if (lastGcData && (lastGcHWIN == hWnd)) {
- _releaseDC(lastGcData);
- }
+ if (lastGcData && (lastGcHWIN == hWnd)) {
+ _releaseDC(lastGcData);
+ }
#endif
#ifdef CACHE_LAST_WM_PAINT_DC
- if (last_wm_paint_dc && (last_wm_paint_win == hWnd)) {
- ReleaseDC(hWnd, last_wm_paint_dc);
- last_wm_paint_win = last_wm_paint_dc = 0;
- }
-#endif
- if (! DestroyWindow(hWnd)) {
- DPRINTF(("DestroyWindow ERROR\n"));
- } else {
+ if (last_wm_paint_dc && (last_wm_paint_win == hWnd)) {
+ ReleaseDC(hWnd, last_wm_paint_dc);
+ last_wm_paint_win = last_wm_paint_dc = 0;
+ }
+#endif
+ if (! DestroyWindow(hWnd)) {
+ DPRINTF(("DestroyWindow ERROR\n"));
+ } else {
#ifdef COUNT_RESOURCES
- __cnt_createWindows--;
- RESPRINTF(("DestroyWindow -> %d\n", __cnt_createWindows));
-#endif
- }
- *pDefault = 0;
- return 0;
-
- case WM_CREATE:
- {
+ __cnt_createWindows--;
+ RESPRINTF(("DestroyWindow -> %d\n", __cnt_createWindows));
+#endif
+ }
+ *pDefault = 0;
+ return 0;
+
+ case WM_CREATE:
+ {
#ifdef SETLOCALINFO_IN_CREATE /* no longer */
- localWindowInfo *lI;
-
- CREATESTRUCT *lpcs = (LPCREATESTRUCT) lParam; // structure with creation data
-
- lI = lpcs->lpCreateParams;
- EVENT_PRINTF(("WM_CREATE lI=%x\n", lI));
-
- SETLOCALWINDOWINFOPTR(hWnd, lI);
+ localWindowInfo *lI;
+
+ CREATESTRUCT *lpcs = (LPCREATESTRUCT) lParam; // structure with creation data
+
+ lI = lpcs->lpCreateParams;
+ EVENT_PRINTF(("WM_CREATE lI=%x\n", lI));
+
+ SETLOCALWINDOWINFOPTR(hWnd, lI);
# ifdef SUPERDEBUG
- if (GETLOCALWINDOWINFOPTR(hWnd) != lpcs->lpCreateParams) {
- PRINTF(("SETLOCALWINDOWINFOPTR ERROR\n"));
- }
+ if (GETLOCALWINDOWINFOPTR(hWnd) != lpcs->lpCreateParams) {
+ PRINTF(("SETLOCALWINDOWINFOPTR ERROR\n"));
+ }
# endif /* SUPERDEBUG */
#endif
- *pDefault = 0;
+ *pDefault = 0;
#ifdef COUNT_RESOURCES
- __cnt_createWindows++;
- RESPRINTF(("CreateWindows %d\n",__cnt_createWindows));
-#endif
- }
- break;
-
- case WM_CLOSE:
- EVENT_PRINTF(("WM_CLOSE\n"));
- if (! destroyWin) {
- // (flag, hWnd, message, wParam, arg1, arg2, arg3, arg4, evTime)
- enqEvent(0, hWnd, WM_CLOSE, wParam, 0, 0, 0, 0, EV_NOTIME);
- } else {
- destroyWin = 0;
- {
- HBRUSH br;
-
- br = GetWindow_viewBgBrush(hWnd);
- if (br) {
- SetWindow_viewBgBrush(hWnd, 0);
- _DeleteBrushIfNotInCache(br, __LINE__);
- }
- }
+ __cnt_createWindows++;
+ RESPRINTF(("CreateWindows %d\n",__cnt_createWindows));
+#endif
+ }
+ break;
+
+ case WM_CLOSE:
+ EVENT_PRINTF(("WM_CLOSE\n"));
+ if (! destroyWin) {
+ // (flag, hWnd, message, wParam, arg1, arg2, arg3, arg4, evTime)
+ enqEvent(0, hWnd, WM_CLOSE, wParam, 0, 0, 0, 0, EV_NOTIME);
+ } else {
+ destroyWin = 0;
+ {
+ HBRUSH br;
+
+ br = GetWindow_viewBgBrush(hWnd);
+ if (br) {
+ SetWindow_viewBgBrush(hWnd, 0);
+ _DeleteBrushIfNotInCache(br, __LINE__);
+ }
+ }
#ifdef CACHE_LAST_DC
- if (lastGcData && (lastGcHWIN == hWnd)) {
- _releaseDC(lastGcData);
- }
+ if (lastGcData && (lastGcHWIN == hWnd)) {
+ _releaseDC(lastGcData);
+ }
#endif
#ifdef CACHE_LAST_WM_PAINT_DC
- if (last_wm_paint_dc && (last_wm_paint_win == hWnd)) {
- ReleaseDC(hWnd, last_wm_paint_dc);
- last_wm_paint_win = last_wm_paint_dc = 0;
- }
-#endif
- if (! DestroyWindow(hWnd)) {
- DPRINTF(("DestroyWindow ERROR\n"));
- } else {
+ if (last_wm_paint_dc && (last_wm_paint_win == hWnd)) {
+ ReleaseDC(hWnd, last_wm_paint_dc);
+ last_wm_paint_win = last_wm_paint_dc = 0;
+ }
+#endif
+ if (! DestroyWindow(hWnd)) {
+ DPRINTF(("DestroyWindow ERROR\n"));
+ } else {
#ifdef COUNT_RESOURCES
- __cnt_createWindows--;
- RESPRINTF(("DestroyWindow -> %d\n", __cnt_createWindows));
-#endif
- }
- }
- *pDefault = 0;
- return 0;
- break;
-
- case WM_DESTROY:
- {
- char *n = 0;
- localWindowInfo *lI;
-
- lI = GETLOCALWINDOWINFOPTR(hWnd);
- EVENT_PRINTF(("WM_DESTROY %x li=%x\n", hWnd, lI));
+ __cnt_createWindows--;
+ RESPRINTF(("DestroyWindow -> %d\n", __cnt_createWindows));
+#endif
+ }
+ }
+ *pDefault = 0;
+ return 0;
+ break;
+
+ case WM_DESTROY:
+ {
+ char *n = 0;
+ localWindowInfo *lI;
+
+ lI = GETLOCALWINDOWINFOPTR(hWnd);
+ EVENT_PRINTF(("WM_DESTROY %x li=%x\n", hWnd, lI));
#ifdef TOPWINDOWCLASS
- if (lI) {
- if (lI->flag & LI_TOPWIN) {
- n = (char*) malloc(200);
- GetClassName(hWnd,n,200);
- }
- /* freeing now done in other thread */
- }
-#endif
- SETLOCALWINDOWINFOPTR(hWnd, 0);
+ if (lI) {
+ if (lI->flag & LI_TOPWIN) {
+ n = (char*) malloc(200);
+ GetClassName(hWnd,n,200);
+ }
+ /* freeing now done in other thread */
+ }
+#endif
+ SETLOCALWINDOWINFOPTR(hWnd, 0);
#ifdef FREE_LI_IN_STX_PROCESS
- enqEvent(0, hWnd, WM_DESTROY, wParam, (int)n, (int)lI, 0, 0, EV_NOTIME);
-#else
- if (lI) {
- free(lI);
- }
- enqEvent(0, hWnd, WM_DESTROY, wParam, (int)n, 0, 0, 0, EV_NOTIME);
-#endif
- *pDefault = 0;
- return 0;
- }
- break;
-
- case WM_GETMINMAXINFO:
+ enqEvent(0, hWnd, WM_DESTROY, wParam, (int)n, (int)lI, 0, 0, EV_NOTIME);
+#else
+ if (lI) {
+ free(lI);
+ }
+ enqEvent(0, hWnd, WM_DESTROY, wParam, (int)n, 0, 0, 0, EV_NOTIME);
+#endif
+ *pDefault = 0;
+ return 0;
+ }
+ break;
+
+ case WM_GETMINMAXINFO:
#ifndef PRE_13_APR_04_POSCHANGED_IN_EXITSIZEMOVE
- if (inMove) {
- *pDefault = 0;
- return 0;
- }
-#endif
-
- {
- int minW, maxW;
- localWindowInfo *lI;
- LPMINMAXINFO lpmmi;
-
- lpmmi = (LPMINMAXINFO) lParam;
-
- EVENT_PRINTF2(("WM_GETMINMAXINFO handle=%x got min: %d/%d\n",
- hWnd,
- lpmmi->ptMinTrackSize.x,
- lpmmi->ptMinTrackSize.y));
-
- lI = GETLOCALWINDOWINFOPTR(hWnd);
- if (lI && (lI->minWidth) && (lI->maxWidth)) {
- lpmmi->ptMaxSize.x = lI->maxWidth;
- lpmmi->ptMaxSize.y = lI->maxHeight;
- lpmmi->ptMaxTrackSize.x = lI->maxWidth;
- lpmmi->ptMaxTrackSize.y = lI->maxHeight;
- lpmmi->ptMinTrackSize.x = lI->minWidth;
- lpmmi->ptMinTrackSize.y = lI->minHeight;
-
- EVENT_PRINTF3(("WM_GETMINMAXINFO handle=%x return min: %d/%d max: %d/%d\n",
- hWnd,
- lI->minWidth, lI->minHeight,
- lI->maxWidth, lI->maxHeight));
- }
- *pDefault = 0;
- }
- break;
-
- case WM_SETCURSOR:
- {
- HCURSOR curs;
- int hitCode;
-
- hitCode = LOWORD(lParam);
- if (hitCode != HTCLIENT) {
- /*
- * not in client area ...
- */
- return 0;
- }
- DDPRINTF(("WM_SETCURSOR\n"));
- curs = GetWindow_Cursor(hWnd);
- if (curs) {
- SetCursor(curs);
- *pDefault = 0;
- return 1;
- }
- }
- return 0;
-
- case WM_WINDOWPOSCHANGED:
+ if (inMove) {
+ *pDefault = 0;
+ return 0;
+ }
+#endif
+
+ {
+ int minW, maxW;
+ localWindowInfo *lI;
+ LPMINMAXINFO lpmmi;
+
+ lpmmi = (LPMINMAXINFO) lParam;
+
+ EVENT_PRINTF2(("WM_GETMINMAXINFO handle=%x got min: %d/%d\n",
+ hWnd,
+ lpmmi->ptMinTrackSize.x,
+ lpmmi->ptMinTrackSize.y));
+
+ lI = GETLOCALWINDOWINFOPTR(hWnd);
+ if (lI && (lI->minWidth) && (lI->maxWidth)) {
+ lpmmi->ptMaxSize.x = lI->maxWidth;
+ lpmmi->ptMaxSize.y = lI->maxHeight;
+ lpmmi->ptMaxTrackSize.x = lI->maxWidth;
+ lpmmi->ptMaxTrackSize.y = lI->maxHeight;
+ lpmmi->ptMinTrackSize.x = lI->minWidth;
+ lpmmi->ptMinTrackSize.y = lI->minHeight;
+
+ EVENT_PRINTF3(("WM_GETMINMAXINFO handle=%x return min: %d/%d max: %d/%d\n",
+ hWnd,
+ lI->minWidth, lI->minHeight,
+ lI->maxWidth, lI->maxHeight));
+ }
+ *pDefault = 0;
+ }
+ break;
+
+ case WM_SETCURSOR:
+ {
+ HCURSOR curs;
+ int hitCode;
+
+ hitCode = LOWORD(lParam);
+ if (hitCode != HTCLIENT) {
+ /*
+ * not in client area ...
+ */
+ return 0;
+ }
+ DDPRINTF(("WM_SETCURSOR\n"));
+ curs = GetWindow_Cursor(hWnd);
+ if (curs) {
+ SetCursor(curs);
+ *pDefault = 0;
+ return 1;
+ }
+ }
+ return 0;
+
+ case WM_WINDOWPOSCHANGED:
#ifndef PRE_13_APR_04_POSCHANGED_IN_EXITSIZEMOVE
- if (inMove) {
- *pDefault = 0;
- return 0;
- }
-#endif
- if (hWnd == __rootWinSpezial) {
- /* can this happen ? */
- *pDefault = 1;
- return 0;
- }
-
- if (! inMove && (__currentCapture == CAPTURE_NONE)) {
- POINT p;
- HWND hWndChild,hWndTemp;
-
- p.x = evRootX;
- p.y = evRootY;
- ScreenToClient(hWnd, &p);
- hWndChild = hWnd; //hWndChild = ChildWindowFromPoint(hWnd,p);
- do {
- hWndTemp = hWndChild;
- hWndChild = ChildWindowFromPointEx(hWndTemp,p,CWP_SKIPINVISIBLE|CWP_SKIPDISABLED|CWP_SKIPTRANSPARENT);
- } while ((hWndChild) && (hWndChild != hWndTemp));
-
- if (hWndChild /*&& (hWndChild != hWnd)*/) {
- if (hWndChild != __currentPointerView) {
- int modifiers = getModifiers();
-
- if (__currentPointerView) {
- if (inSizeMove) {
- if (needDelayedMouseLeaveWindow == NULL) {
- needDelayedMouseLeaveWindow = __currentPointerView;
- }
- } else {
- if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask) {
- enqEvent(LeaveWindowMask, __currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, modifiers, EV_NOTIME);
- SetWindow_mouseXY(__currentPointerView, -9999, -9999);
- }
- }
- __currentPointerView = 0;
- }
- if (inSizeMove) {
- needDelayedMouseEnterWindow = hWndChild;
- delayedMouseEnterX = evRootX;
- delayedMouseEnterY = evRootY;
- } else {
- if (GetWindow_eventMask(hWndChild) & EnterWindowMask) {
- enqEvent(EnterWindowMask, hWndChild, __WM_MOUSEENTER, 0, evRootX, evRootY, 0, modifiers, EV_NOTIME);
- SetWindow_mouseXY(hWndChild, evRootX, evRootY);
- }
- // SetFocus(hWndChild);
- }
- __currentPointerView = hWndChild;
- }
- }
- }
-
- /*
- * ignore child window messages ...
- */
- if (GetParent(hWnd) != NULL) {
- break;
- }
-
- {
- WINDOWPOS *wp = (WINDOWPOS *)lParam;
- RECT rct, dRect;
- int x, y, w, h;
- int dW, dH;
+ if (inMove) {
+ *pDefault = 0;
+ return 0;
+ }
+#endif
+ if (hWnd == __rootWinSpezial) {
+ /* can this happen ? */
+ *pDefault = 1;
+ return 0;
+ }
+
+ if (! inMove && (__currentCapture == CAPTURE_NONE)) {
+ POINT p;
+ HWND hWndChild,hWndTemp;
+
+ p.x = evRootX;
+ p.y = evRootY;
+ ScreenToClient(hWnd, &p);
+ hWndChild = hWnd; //hWndChild = ChildWindowFromPoint(hWnd,p);
+ do {
+ hWndTemp = hWndChild;
+ hWndChild = ChildWindowFromPointEx(hWndTemp,p,CWP_SKIPINVISIBLE|CWP_SKIPDISABLED|CWP_SKIPTRANSPARENT);
+ } while ((hWndChild) && (hWndChild != hWndTemp));
+
+ if (hWndChild /*&& (hWndChild != hWnd)*/) {
+ if (hWndChild != __currentPointerView) {
+ int modifiers = getModifiers();
+
+ if (__currentPointerView) {
+ if (inSizeMove) {
+ if (needDelayedMouseLeaveWindow == NULL) {
+ needDelayedMouseLeaveWindow = __currentPointerView;
+ }
+ } else {
+ if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask) {
+ enqEvent(LeaveWindowMask, __currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, modifiers, EV_NOTIME);
+ SetWindow_mouseXY(__currentPointerView, -9999, -9999);
+ }
+ }
+ __currentPointerView = 0;
+ }
+ if (inSizeMove) {
+ needDelayedMouseEnterWindow = hWndChild;
+ delayedMouseEnterX = evRootX;
+ delayedMouseEnterY = evRootY;
+ } else {
+ if (GetWindow_eventMask(hWndChild) & EnterWindowMask) {
+ enqEvent(EnterWindowMask, hWndChild, __WM_MOUSEENTER, 0, evRootX, evRootY, 0, modifiers, EV_NOTIME);
+ SetWindow_mouseXY(hWndChild, evRootX, evRootY);
+ }
+ // SetFocus(hWndChild);
+ }
+ __currentPointerView = hWndChild;
+ }
+ }
+ }
+
+ /*
+ * ignore child window messages ...
+ */
+ if (GetParent(hWnd) != NULL) {
+ break;
+ }
+
+ {
+ WINDOWPOS *wp = (WINDOWPOS *)lParam;
+ RECT rct, dRect;
+ int x, y, w, h;
+ int dW, dH;
#if 0
- dRect.left = 0;
- dRect.top = 0;
- dRect.right = 100;
- dRect.bottom = 100;
- winStyleBits = GetWindowLong(hWnd, GWL_STYLE);
- winExStyleBits = GetWindowLong(hWnd, GWL_EXSTYLE);
- AdjustWindowRectEx(&dRect, winStyleBits, 0, winExStyleBits);
- dW = dRect.right - dRect.left;
- dH = dRect.bottom - dRect.top;
-#endif
- GetClientRect(hWnd, &rct);
-
- x = rct.left;
- y = rct.top;
- w = rct.right - rct.left;
- h = rct.bottom - rct.top;
-
- if (__debug__) {
- EVENT_PRINTF(("WM_WINDOWPOSCHANGED ["));
-
- if (wp->flags & SWP_NOSIZE) {
- EVENT_PRINTF(("NOSIZE "));
- }
- if (wp->flags & SWP_NOMOVE) {
- EVENT_PRINTF(("NOMOVE "));
- }
- if (wp->flags & SWP_NOZORDER) {
- EVENT_PRINTF(("NOZORDER "));
- }
- if (wp->flags & SWP_NOREDRAW) {
- EVENT_PRINTF(("NOREDRAW "));
- }
- if (wp->flags & SWP_NOACTIVATE) {
- EVENT_PRINTF(("NOACTIVATE "));
- }
- if (wp->flags & SWP_FRAMECHANGED) {
- EVENT_PRINTF(("FRAMECHANGED "));
- }
- if (wp->flags & SWP_NOCOPYBITS) {
- EVENT_PRINTF(("NOCOPYBITS "));
- }
- if (wp->flags & SWP_NOOWNERZORDER) {
- EVENT_PRINTF(("NOOWNERZORDER "));
- }
- if (wp->flags & SWP_NOSENDCHANGING) {
- EVENT_PRINTF(("NOSENDCHANGING "));
- }
- if (wp->flags & SWP_DEFERERASE) {
- EVENT_PRINTF(("DEFERERASE "));
- }
- if (wp->flags & SWP_ASYNCWINDOWPOS) {
- EVENT_PRINTF(("ASYNCWINDOWPOS "));
- }
- if (wp->flags & SWP_HIDEWINDOW) {
- EVENT_PRINTF(("HIDEWINDOW "));
- }
- if (wp->flags & SWP_SHOWWINDOW) {
- EVENT_PRINTF(("SHOWWINDOW "));
- }
-
- EVENT_PRINTF(("] %d/%d %d/%d flags:%d (0x%x) ->",
- wp->x, wp->y, wp->cx, wp->cy, wp->flags, wp->flags));
- EVENT_PRINTF((" client rect now: %d/%d %d/%d\n",x, y, w, h));
-
- } /* __debug__ */
-
- if ((w == 0) && (h == 0)) {
- EVENT_PRINTF(("w,h = 0.\n"));
- if (! GetWindow_iconified(hWnd)) {
- EVENT_PRINTF(("iconified.\n"));
- SetWindow_iconified(hWnd, 1);
- DPRINTF(("WM_WINDOWPOSCHANGED to iconified (flags:0x%x)\n", wp->flags));
- enqEvent(0, hWnd, __WM_ICONIFIED, 1, 0, 0, 0, 0, EV_NOTIME);
- }
- } else {
- if (GetWindow_iconified(hWnd)) {
- EVENT_PRINTF(("deiconified.\n"));
- SetWindow_iconified(hWnd, 0);
- DPRINTF(("WM_WINDOWPOSCHANGED to deiconified (flags:0x%x)\n", wp->flags));
- enqEvent(0, hWnd, __WM_ICONIFIED, 0, 0, 0, 0, 0, EV_NOTIME);
- }
- if (!(wp->flags & SWP_NOSIZE)
- || !(wp->flags & SWP_NOMOVE)) {
- EVENT_PRINTF(("enq event %x: %d, %d, %d, %d\n", hWnd, x, y, w, h));
+ dRect.left = 0;
+ dRect.top = 0;
+ dRect.right = 100;
+ dRect.bottom = 100;
+ winStyleBits = GetWindowLong(hWnd, GWL_STYLE);
+ winExStyleBits = GetWindowLong(hWnd, GWL_EXSTYLE);
+ AdjustWindowRectEx(&dRect, winStyleBits, 0, winExStyleBits);
+ dW = dRect.right - dRect.left;
+ dH = dRect.bottom - dRect.top;
+#endif
+ GetClientRect(hWnd, &rct);
+
+ x = rct.left;
+ y = rct.top;
+ w = rct.right - rct.left;
+ h = rct.bottom - rct.top;
+
+ if (__debug__) {
+ EVENT_PRINTF(("WM_WINDOWPOSCHANGED ["));
+
+ if (wp->flags & SWP_NOSIZE) {
+ EVENT_PRINTF(("NOSIZE "));
+ }
+ if (wp->flags & SWP_NOMOVE) {
+ EVENT_PRINTF(("NOMOVE "));
+ }
+ if (wp->flags & SWP_NOZORDER) {
+ EVENT_PRINTF(("NOZORDER "));
+ }
+ if (wp->flags & SWP_NOREDRAW) {
+ EVENT_PRINTF(("NOREDRAW "));
+ }
+ if (wp->flags & SWP_NOACTIVATE) {
+ EVENT_PRINTF(("NOACTIVATE "));
+ }
+ if (wp->flags & SWP_FRAMECHANGED) {
+ EVENT_PRINTF(("FRAMECHANGED "));
+ }
+ if (wp->flags & SWP_NOCOPYBITS) {
+ EVENT_PRINTF(("NOCOPYBITS "));
+ }
+ if (wp->flags & SWP_NOOWNERZORDER) {
+ EVENT_PRINTF(("NOOWNERZORDER "));
+ }
+ if (wp->flags & SWP_NOSENDCHANGING) {
+ EVENT_PRINTF(("NOSENDCHANGING "));
+ }
+ if (wp->flags & SWP_DEFERERASE) {
+ EVENT_PRINTF(("DEFERERASE "));
+ }
+ if (wp->flags & SWP_ASYNCWINDOWPOS) {
+ EVENT_PRINTF(("ASYNCWINDOWPOS "));
+ }
+ if (wp->flags & SWP_HIDEWINDOW) {
+ EVENT_PRINTF(("HIDEWINDOW "));
+ }
+ if (wp->flags & SWP_SHOWWINDOW) {
+ EVENT_PRINTF(("SHOWWINDOW "));
+ }
+
+ EVENT_PRINTF(("] %d/%d %d/%d flags:%d (0x%x) ->",
+ wp->x, wp->y, wp->cx, wp->cy, wp->flags, wp->flags));
+ EVENT_PRINTF((" client rect now: %d/%d %d/%d\n",x, y, w, h));
+
+ } /* __debug__ */
+
+ if ((w == 0) && (h == 0)) {
+ EVENT_PRINTF(("w,h = 0.\n"));
+ if (! GetWindow_iconified(hWnd)) {
+ EVENT_PRINTF(("iconified.\n"));
+ SetWindow_iconified(hWnd, 1);
+ DPRINTF(("WM_WINDOWPOSCHANGED to iconified (flags:0x%x)\n", wp->flags));
+ enqEvent(0, hWnd, __WM_ICONIFIED, 1, 0, 0, 0, 0, EV_NOTIME);
+ }
+ } else {
+ if (GetWindow_iconified(hWnd)) {
+ EVENT_PRINTF(("deiconified.\n"));
+ SetWindow_iconified(hWnd, 0);
+ DPRINTF(("WM_WINDOWPOSCHANGED to deiconified (flags:0x%x)\n", wp->flags));
+ enqEvent(0, hWnd, __WM_ICONIFIED, 0, 0, 0, 0, 0, EV_NOTIME);
+ }
+ if (!(wp->flags & SWP_NOSIZE)
+ || !(wp->flags & SWP_NOMOVE)) {
+ EVENT_PRINTF(("enq event %x: %d, %d, %d, %d\n", hWnd, x, y, w, h));
#ifdef COMPRESS_WINDOWPOSCHANGED
- /*
- * remember the current
- * window and size;
- * This allows the backend to ignore
- * intermediate events.
- */
- lastPos_win = 0;
- lastPos_w = w;
- lastPos_h = h;
- lastPos_x = x;
- lastPos_y = y;
- lastPos_win = hWnd;
-#endif
- enqEvent(0, hWnd, WM_WINDOWPOSCHANGED, 0, x, y, w, h, EV_NOTIME);
- } else {
- EVENT_PRINTF(("no event due to SWP_NOSIZE/SWP_NOMOVE.\n"));
- }
- }
- }
- *pDefault = 0;
- return 0;
-
- case WM_ERASEBKGND:
- DPRINTFIF(__debug_WM_ERASEBKGND__ , ("WM_ERASEBKGND\n"));
- if (isNative) {
- NDPRINTF(("WM_ERASEBKGND for native - default handling\n"));
- return 0;
- }
+ /*
+ * remember the current
+ * window and size;
+ * This allows the backend to ignore
+ * intermediate events.
+ */
+ lastPos_win = 0;
+ lastPos_w = w;
+ lastPos_h = h;
+ lastPos_x = x;
+ lastPos_y = y;
+ lastPos_win = hWnd;
+#endif
+ enqEvent(0, hWnd, WM_WINDOWPOSCHANGED, 0, x, y, w, h, EV_NOTIME);
+ } else {
+ EVENT_PRINTF(("no event due to SWP_NOSIZE/SWP_NOMOVE.\n"));
+ }
+ }
+ }
+ *pDefault = 0;
+ return 0;
+
+ case WM_ERASEBKGND:
+ DPRINTFIF(__debug_WM_ERASEBKGND__ , ("WM_ERASEBKGND\n"));
+ if (isNative) {
+ NDPRINTF(("WM_ERASEBKGND for native - default handling\n"));
+ return 0;
+ }
#ifndef PRE_21_NOV
- *pDefault = 0;
- return 0;
-#else
-
- if (GetWindow_flag(hWnd) & LI_INPUTWIN) {
- *pDefault = 0;
- return 0;
- }
- if (hWnd == __rootWinSpezial) {
- *pDefault = 0;
- return 0;
- }
-
- /* THIS_WORKS */
- *pDefault = 0;
- return 0;
+ *pDefault = 0;
+ return 0;
+#else
+
+ if (GetWindow_flag(hWnd) & LI_INPUTWIN) {
+ *pDefault = 0;
+ return 0;
+ }
+ if (hWnd == __rootWinSpezial) {
+ *pDefault = 0;
+ return 0;
+ }
+
+ /* THIS_WORKS */
+ *pDefault = 0;
+ return 0;
#endif /* ! PRE_21_NOV */
- case WM_PAINT:
- DPRINTFIF(__debug_WM_PAINT__ , ("WM_PAINT ********************* "));
-
- if (isNative) {
- NDPRINTF(("WM_PAINT for native - default handling\n"));
- return 0;
- }
+ case WM_PAINT:
+ DPRINTFIF(__debug_WM_PAINT__ , ("WM_PAINT ********************* "));
+
+ if (isNative) {
+ NDPRINTF(("WM_PAINT for native - default handling\n"));
+ return 0;
+ }
#ifndef PRE_21_NOV
- { int n;
-
- n = __generateExposes( hWnd, NULL, WM_PAINT, 0 );
-
- if( n <= 0 ) {
- * pDefault = 1;
- return 0;
- }
- * pDefault = 0;
- return n;
- }
-#else
-
-
-
- if (GetWindow_flag(hWnd) & LI_INPUTWIN) {
- *pDefault = 0;
- return 0;
- }
-
- if (hWnd == __rootWinSpezial) {
+ { int n;
+
+ n = __generateExposes( hWnd, NULL, WM_PAINT, 0 );
+
+ if( n <= 0 ) {
+ * pDefault = 1;
+ return 0;
+ }
+ * pDefault = 0;
+ return n;
+ }
+#else
+
+
+
+ if (GetWindow_flag(hWnd) & LI_INPUTWIN) {
+ *pDefault = 0;
+ return 0;
+ }
+
+ if (hWnd == __rootWinSpezial) {
# ifdef THIS_MAKES_GUI_PAINTER_START_SLOW
- *pDefault = 0;
+ *pDefault = 0;
# endif
- return 0;
- }
-
- {
- int retVal;
+ return 0;
+ }
+
+ {
+ int retVal;
# ifdef LATE_GENERATE_EXPOSE
- enqEvent(0, hWnd, __WM_PAINT, 0, 0, 0, 0, 0, EV_NOTIME);
+ enqEvent(0, hWnd, __WM_PAINT, 0, 0, 0, 0, 0, EV_NOTIME);
# else
- AQUIRE_DRAW_MUTEX
- retVal = __generateExposes(hWnd, NULL, WM_PAINT, WM_PAINT_CLEAR_EARLY);
- RELEASE_DRAW_MUTEX
+ AQUIRE_DRAW_MUTEX
+ retVal = __generateExposes(hWnd, NULL, WM_PAINT, WM_PAINT_CLEAR_EARLY);
+ RELEASE_DRAW_MUTEX
# endif
- switch (retVal) {
- case -1: /* error */
- *pDefault = 0;
- break;
- case 0: /* nothing generated */
- default: /* generated events */
- break;
- }
+ switch (retVal) {
+ case -1: /* error */
+ *pDefault = 0;
+ break;
+ case 0: /* nothing generated */
+ default: /* generated events */
+ break;
+ }
# ifdef THIS_IS_BAD
- *pDefault = 0;
- return 1;
+ *pDefault = 0;
+ return 1;
# endif
- }
- return 0;
+ }
+ return 0;
#endif /* ! PRE_21_NOV */
- case WM_SIZE:
- DPRINTFIF(__debug_WM_SIZE__ , ("WM_SIZE\n"));
- /*
- * ignore child window messages ...
- */
- if (GetParent(hWnd) != NULL) {
- *pDefault = 0;
- return 0;
- }
-
- switch (wParam) {
- case SIZE_MAXIMIZED: /* default handling */
- case SIZE_MINIMIZED: /* default handling */
- case SIZE_RESTORED: /* default handling */
- {
- RECT rct;
- int x, y, w, h;
-
- GetClientRect(hWnd, &rct);
-
- x = rct.left;
- y = rct.top;
- w = rct.right - rct.left;
- h = rct.bottom - rct.top;
-
- EVENT_PRINTF(("WM_MIN/MAX/RESTORED\n"));
-
- if ((w == 0) && (h == 0)) {
- /*
- * iconified ...
- */
- if (! GetWindow_iconified(hWnd)) {
- SetWindow_iconified(hWnd, 1);
- enqEvent(0, hWnd, __WM_ICONIFIED, 1, 0, 0, 0, 0, EV_NOTIME);
- }
- } else {
- if (GetWindow_iconified(hWnd)) {
- SetWindow_iconified(hWnd, 0);
- enqEvent(0, hWnd, __WM_ICONIFIED, 0, 0, 0, 0, 0, EV_NOTIME);
- }
- EVENT_PRINTF(("enq event2 %x: %d, %d, %d, %d\n", hWnd, x, y, w, h));
+ case WM_SIZE:
+ DPRINTFIF(__debug_WM_SIZE__ , ("WM_SIZE\n"));
+ /*
+ * ignore child window messages ...
+ */
+ if (GetParent(hWnd) != NULL) {
+ *pDefault = 0;
+ return 0;
+ }
+
+ switch (wParam) {
+ case SIZE_MAXIMIZED: /* default handling */
+ case SIZE_MINIMIZED: /* default handling */
+ case SIZE_RESTORED: /* default handling */
+ {
+ RECT rct;
+ int x, y, w, h;
+
+ GetClientRect(hWnd, &rct);
+
+ x = rct.left;
+ y = rct.top;
+ w = rct.right - rct.left;
+ h = rct.bottom - rct.top;
+
+ EVENT_PRINTF(("WM_MIN/MAX/RESTORED\n"));
+
+ if ((w == 0) && (h == 0)) {
+ /*
+ * iconified ...
+ */
+ if (! GetWindow_iconified(hWnd)) {
+ SetWindow_iconified(hWnd, 1);
+ enqEvent(0, hWnd, __WM_ICONIFIED, 1, 0, 0, 0, 0, EV_NOTIME);
+ }
+ } else {
+ if (GetWindow_iconified(hWnd)) {
+ SetWindow_iconified(hWnd, 0);
+ enqEvent(0, hWnd, __WM_ICONIFIED, 0, 0, 0, 0, 0, EV_NOTIME);
+ }
+ EVENT_PRINTF(("enq event2 %x: %d, %d, %d, %d\n", hWnd, x, y, w, h));
#ifdef COMPRESS_WINDOWPOSCHANGED
- /*
- * remember the current
- * window and size;
- * This allows the backend to ignore
- * intermediate events.
- */
- lastPos_win = 0;
- lastPos_w = w;
- lastPos_h = h;
- lastPos_x = x;
- lastPos_y = y;
- lastPos_win = hWnd;
-#endif
- enqEvent(0, hWnd, WM_WINDOWPOSCHANGED, 0, x, y, w, h, EV_NOTIME);
- }
- }
- break;
-
- default: /* ignore */
- *pDefault = 0;
- return 0;
- }
- break;
-
- case WM_DROPFILES:
- DPRINTFIF(__debug_WM_DROPFILES__ , ("WM_DROPFILES\n"));
- enqEvent(0, hWnd, message, wParam, 0, 0, 0, 0, EV_NOTIME);
- break;
-
- case WM_SHOWWINDOW:
- DPRINTFIF(__debug_WM_SHOWWINDOW__ , ("WM_SHOWWINDOW\n"));
- enqEvent(0, hWnd, message, wParam, 0, 0, 0, 0, EV_NOTIME);
- if (isNative) {
- NDPRINTF(("WM_SHOWWINDOW for native - default handling\n"));
- return 0;
- }
- *pDefault = 0;
- break;
-
- case WM_MOUSEACTIVATE :
- DPRINTFIF(__debug_WM_MOUSEACTIVATE__ , ("WM_MOUSEACTIVATE h=%x parent=%x\n", hWnd, GetParent(hWnd)));
-
- /*
- * ignore child window messages ...
- */
- if (GetParent(hWnd)) {
- return 0;
- }
-
- *pDefault = 0;
- if ((hWnd == __rootWinSpezial) || (hWnd == GetActiveWindow())) {
- DDPRINTF(("NOACTIVATE (root or already)\n"));
- return MA_NOACTIVATE;
- }
- if (LOWORD(lParam) != HTCLIENT) {
- DDPRINTF(("ACTIVATE (not client)\n"));
- return MA_ACTIVATE;
- }
- if (__activateOnClick) {
- if (__ignoreButtonPressOnActivate) {
- DDPRINTF(("ACTIVATE_EAT\n"));
- /*
- * windows is sooo stupid:
- * it will send me a MOTION soon after, with the
- * to the click location, with the buttonState down.
- * The app will interpret that as a pressed motion and
- * do a selection (if in a textview).
- * To prevent this, we set a flag here, that the following
- * motion is to be suppressed.
- * Until the mouse is released.
- */
- __eatingMouseEvents = 1;
- return MA_ACTIVATEANDEAT;
- }
- DDPRINTF(("ACTIVATE\n"));
- return MA_ACTIVATE;
- }
- DDPRINTF(("NO_ACTIVATE\n"));
- return MA_NOACTIVATE;
-
- case WM_NCHITTEST:
- EVENT_PRINTF2(("WM_NCHITTEST\n"));
- if (hWnd == __rootWinSpezial) {
- *pDefault = 0;
- return HTCLIENT;
- }
- break;
-
- case WM_NCACTIVATE:
- EVENT_PRINTF(("WM_NCACTIVATE\n"));
- break;
-
- case WM_ACTIVATE:
- CPRINTF(("WM_ACTIVATE %s h=%x\n", LOWORD(wParam) ? "active" : "inactive", hWnd));
-
- switch (LOWORD(wParam)) {
- case WA_INACTIVE:
- EVENT_PRINTF2(("WM_ACTIVATE inactive h=%x\n", hWnd));
- break;
-
- case WA_ACTIVE:
- EVENT_PRINTF2(("WM_ACTIVATE active h=%x\n", hWnd));
+ /*
+ * remember the current
+ * window and size;
+ * This allows the backend to ignore
+ * intermediate events.
+ */
+ lastPos_win = 0;
+ lastPos_w = w;
+ lastPos_h = h;
+ lastPos_x = x;
+ lastPos_y = y;
+ lastPos_win = hWnd;
+#endif
+ enqEvent(0, hWnd, WM_WINDOWPOSCHANGED, 0, x, y, w, h, EV_NOTIME);
+ }
+ }
+ break;
+
+ default: /* ignore */
+ *pDefault = 0;
+ return 0;
+ }
+ break;
+
+ case WM_DROPFILES:
+ DPRINTFIF(__debug_WM_DROPFILES__ , ("WM_DROPFILES\n"));
+ enqEvent(0, hWnd, message, wParam, 0, 0, 0, 0, EV_NOTIME);
+ break;
+
+ case WM_SHOWWINDOW:
+ DPRINTFIF(__debug_WM_SHOWWINDOW__ , ("WM_SHOWWINDOW\n"));
+ enqEvent(0, hWnd, message, wParam, 0, 0, 0, 0, EV_NOTIME);
+ if (isNative) {
+ NDPRINTF(("WM_SHOWWINDOW for native - default handling\n"));
+ return 0;
+ }
+ *pDefault = 0;
+ break;
+
+ case WM_MOUSEACTIVATE :
+ DPRINTFIF(__debug_WM_MOUSEACTIVATE__ , ("WM_MOUSEACTIVATE h=%x parent=%x\n", hWnd, GetParent(hWnd)));
+
+ /*
+ * ignore child window messages ...
+ */
+ if (GetParent(hWnd)) {
+ return 0;
+ }
+
+ *pDefault = 0;
+ if ((hWnd == __rootWinSpezial) || (hWnd == GetActiveWindow())) {
+ DDPRINTF(("NOACTIVATE (root or already)\n"));
+ return MA_NOACTIVATE;
+ }
+ if (LOWORD(lParam) != HTCLIENT) {
+ DDPRINTF(("ACTIVATE (not client)\n"));
+ return MA_ACTIVATE;
+ }
+ if (__activateOnClick) {
+ if (__ignoreButtonPressOnActivate) {
+ DDPRINTF(("ACTIVATE_EAT\n"));
+ /*
+ * windows is sooo stupid:
+ * it will send me a MOTION soon after, with the
+ * to the click location, with the buttonState down.
+ * The app will interpret that as a pressed motion and
+ * do a selection (if in a textview).
+ * To prevent this, we set a flag here, that the following
+ * motion is to be suppressed.
+ * Until the mouse is released.
+ */
+ __eatingMouseEvents = 1;
+ return MA_ACTIVATEANDEAT;
+ }
+ DDPRINTF(("ACTIVATE\n"));
+ return MA_ACTIVATE;
+ }
+ DDPRINTF(("NO_ACTIVATE\n"));
+ return MA_NOACTIVATE;
+
+ case WM_NCHITTEST:
+ EVENT_PRINTF2(("WM_NCHITTEST\n"));
+ if (hWnd == __rootWinSpezial) {
+ *pDefault = 0;
+ return HTCLIENT;
+ }
+ break;
+
+ case WM_NCACTIVATE:
+ EVENT_PRINTF(("WM_NCACTIVATE\n"));
+ break;
+
+ case WM_ACTIVATE:
+ CPRINTF(("WM_ACTIVATE %s h=%x\n", LOWORD(wParam) ? "active" : "inactive", hWnd));
+
+ switch (LOWORD(wParam)) {
+ case WA_INACTIVE:
+ EVENT_PRINTF2(("WM_ACTIVATE inactive h=%x\n", hWnd));
+ break;
+
+ case WA_ACTIVE:
+ EVENT_PRINTF2(("WM_ACTIVATE active h=%x\n", hWnd));
#ifdef THIS_DOES_NOT_AVOID_DOUBLE_REPAINTS
- __generateRecursiveExposes(hWnd, WM_PAINT);
+ __generateRecursiveExposes(hWnd, WM_PAINT);
#endif /* sigh */
- break;
-
- case WA_CLICKACTIVE:
- EVENT_PRINTF2(("++ WM_ACTIVATE clkactive h=%x\n", hWnd));
- break;
-
- default:
- EVENT_PRINTF2(("WM_ACTIVATE ? h=%x\n", hWnd));
- break;
- }
+ break;
+
+ case WA_CLICKACTIVE:
+ EVENT_PRINTF2(("++ WM_ACTIVATE clkactive h=%x\n", hWnd));
+ break;
+
+ default:
+ EVENT_PRINTF2(("WM_ACTIVATE ? h=%x\n", hWnd));
+ break;
+ }
#ifndef PRE_25_NOV_03
- if (__currentCapture == CAPTURE_NONE) {
- HWND newHWnd = 0;
- POINT newPoint;
-
- if (LOWORD(wParam) != WA_INACTIVE) {
- if (MustHandleButtonEvent()) {
- newPoint.x = evRootX;
- newPoint.y = evRootY;
-
- newHWnd = WindowFromPoint (newPoint);
-
- if (newHWnd) {
- if ( (newHWnd == hWnd) || IsChild(hWnd, newHWnd) ) {
- ScreenToClient (newHWnd, & newPoint);
-
- if ((newPoint.x < 0) || (newPoint.y < 0)) {
- newHWnd = 0;
- }
- } else {
- newHWnd = 0;
- }
- }
- }
- }
- CPRINTF(( "Old Handle: %x New Handle: %x x:%d y:%d\n", __currentPointerView, newHWnd, newPoint.x, newPoint.y));
-
- if (newHWnd != __currentPointerView) {
- int modifiers = getModifiers();
-
- if (__currentPointerView) {
- if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask) {
- enqEvent(LeaveWindowMask, __currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, modifiers, EV_NOTIME);
- SetWindow_mouseXY(__currentPointerView, -9999, -9999);
- }
- }
- __currentPointerView = newHWnd;
-
- if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask) {
- enqEvent(EnterWindowMask, __currentPointerView, __WM_MOUSEENTER, 0, newPoint.x, newPoint.y, 0, modifiers, EV_NOTIME);
- SetWindow_mouseXY(__currentPointerView, newPoint.x, newPoint.y);
- }
- }
- }
-#endif
- enqEvent(0, hWnd, WM_ACTIVATE, wParam, 0, 0, 0, 0, EV_NOTIME);
-
- if (isNative) {
- return 0;
- }
- break;
-
- case WM_SYSCHAR:
- EVENT_PRINTF2(("WM_SYSCHAR h=%x %x\n", hWnd, wParam));
- goto commonChar;
+ if (__currentCapture == CAPTURE_NONE) {
+ HWND newHWnd = 0;
+ POINT newPoint;
+
+ if (LOWORD(wParam) != WA_INACTIVE) {
+ if (MustHandleButtonEvent()) {
+ newPoint.x = evRootX;
+ newPoint.y = evRootY;
+
+ newHWnd = WindowFromPoint (newPoint);
+
+ if (newHWnd) {
+ if ( (newHWnd == hWnd) || IsChild(hWnd, newHWnd) ) {
+ ScreenToClient (newHWnd, & newPoint);
+
+ if ((newPoint.x < 0) || (newPoint.y < 0)) {
+ newHWnd = 0;
+ }
+ } else {
+ newHWnd = 0;
+ }
+ }
+ }
+ }
+ CPRINTF(( "Old Handle: %x New Handle: %x x:%d y:%d\n", __currentPointerView, newHWnd, newPoint.x, newPoint.y));
+
+ if (newHWnd != __currentPointerView) {
+ int modifiers = getModifiers();
+
+ if (__currentPointerView) {
+ if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask) {
+ enqEvent(LeaveWindowMask, __currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, modifiers, EV_NOTIME);
+ SetWindow_mouseXY(__currentPointerView, -9999, -9999);
+ }
+ }
+ __currentPointerView = newHWnd;
+
+ if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask) {
+ enqEvent(EnterWindowMask, __currentPointerView, __WM_MOUSEENTER, 0, newPoint.x, newPoint.y, 0, modifiers, EV_NOTIME);
+ SetWindow_mouseXY(__currentPointerView, newPoint.x, newPoint.y);
+ }
+ }
+ }
+#endif
+ enqEvent(0, hWnd, WM_ACTIVATE, wParam, 0, 0, 0, 0, EV_NOTIME);
+
+ if (isNative) {
+ return 0;
+ }
+ break;
+
+ case WM_SYSCHAR:
+ EVENT_PRINTF2(("WM_SYSCHAR h=%x %x\n", hWnd, wParam));
+ goto commonChar;
#ifdef WM_UNICHAR
- /* does not work, anyway */
- case WM_UNICHAR:
- DPRINTFIF(__debug_WM_CHAR__ , ("WM_UNICHAR h=%x %x\n", hWnd, wParam));
- if (wParam == UNICODE_NOCHAR) {
- /* this is a query from windows to see if I am able to receive unicode... */
- *pDefault = 0;
- return 1;
- }
- goto commonChar;
-#endif
-
- case WM_CHAR:
- DPRINTFIF(__debug_WM_CHAR__ , ("WM_CHAR h=%x %x\n", hWnd, wParam));
+ /* does not work, anyway */
+ case WM_UNICHAR:
+ DPRINTFIF(__debug_WM_CHAR__ , ("WM_UNICHAR h=%x %x\n", hWnd, wParam));
+ if (wParam == UNICODE_NOCHAR) {
+ /* this is a query from windows to see if I am able to receive unicode... */
+ *pDefault = 0;
+ return 1;
+ }
+ goto commonChar;
+#endif
+
+ case WM_CHAR:
+ DPRINTFIF(__debug_WM_CHAR__ , ("WM_CHAR h=%x %x\n", hWnd, wParam));
#if 0
- EVENT_PRINTF2(("WM_CHAR h=%x %x\n", hWnd, wParam));
-#endif
- commonChar:
- if (isNative) {
- NDPRINTF(("WM_CHAR for native - default handling\n"));
- return 0;
- }
-
- {
- HWND destWindow;
- int evMask;
-
- if (__focusFollowsMouse) {
- destWindow = __currentPointerView;
- if (destWindow == 0) {
- destWindow = hWnd;
- }
- } else {
- destWindow = hWnd;
- }
-
- evMask = GetWindow_eventMask(destWindow);
- if (evMask & (KeyPressMask | KeyReleaseMask)) {
- POINT p;
- int modifiers = getModifiers();
-
- p.x = evRootX;
- p.y = evRootY;
- ScreenToClient(destWindow, &p);
- x = p.x;
- y = p.y;
-
- DPRINTFIF(__debug_WM_CHAR__ , ("key:%x modifiers: %x\n", wParam, modifiers));
- if (evMask & KeyPressMask)
- enqEvent(KeyPressMask, destWindow, WM_KEYDOWN, wParam, x, y, lParam, (modifiers | TRANSLATED_KEY), evTime);
- if (evMask & KeyReleaseMask)
- enqEvent(KeyReleaseMask, destWindow, WM_KEYUP, wParam, x, y, lParam, (modifiers | TRANSLATED_KEY), evTime);
- }
- }
- *pDefault = 0;
- return 0;
-
- case WM_KEYUP:
- DPRINTFIF(__debug_WM_KEYUP__ , ("WM_KEYUP h=%x %x\n", hWnd, wParam));
- goto commonKeyUp;
-
- case WM_SYSKEYUP:
- DPRINTFIF(__debug_WM_KEYUP__ , ("WM_SYSKEYUP %x\n, wParam"));
- commonKeyUp:
- if (isNative) {
- NDPRINTF(("WM_KEYUP/WM_SYSKEYUP for native - default handling\n"));
- return 0;
- }
- {
- HWND destWindow;
-
- if (__focusFollowsMouse) {
- destWindow = __currentPointerView;
- if (destWindow == 0) {
- destWindow = hWnd;
- }
- } else {
- destWindow = hWnd;
- }
-
- if (GetWindow_eventMask(destWindow) & KeyReleaseMask) {
- POINT p;
-
- p.x = evRootX;
- p.y = evRootY;
- ScreenToClient(destWindow, &p);
- x = p.x;
- y = p.y;
-
- enqEvent(KeyReleaseMask, destWindow, message, wParam, x, y, lParam, getModifiers(), evTime);
- }
- }
- *pDefault = 0;
- return 0;
-
- case WM_SYSKEYDOWN:
- DPRINTFIF(__debug_WM_KEYDOWN__ , ("WM_SYSKEYDOWN %x\n, wParam"));
- goto commonKey;
-
- case WM_KEYDOWN:
- DPRINTFIF(__debug_WM_KEYDOWN__ , ("WM_KEYDOWN h=%x %x\n", hWnd, wParam));
- commonKey:
- if (isNative) {
- NDPRINTF(("WM_KEYDOWN/WM_SYSKEYDOWN for native - default handling\n"));
- return 0;
- }
+ EVENT_PRINTF2(("WM_CHAR h=%x %x\n", hWnd, wParam));
+#endif
+ commonChar:
+ if (isNative) {
+ NDPRINTF(("WM_CHAR for native - default handling\n"));
+ return 0;
+ }
+
+ {
+ HWND destWindow;
+ int evMask;
+
+ if (__focusFollowsMouse) {
+ destWindow = __currentPointerView;
+ if (destWindow == 0) {
+ destWindow = hWnd;
+ }
+ } else {
+ destWindow = hWnd;
+ }
+
+ evMask = GetWindow_eventMask(destWindow);
+ if (evMask & (KeyPressMask | KeyReleaseMask)) {
+ POINT p;
+ int modifiers = getModifiers();
+
+ p.x = evRootX;
+ p.y = evRootY;
+ ScreenToClient(destWindow, &p);
+ x = p.x;
+ y = p.y;
+
+ DPRINTFIF(__debug_WM_CHAR__ , ("key:%x modifiers: %x\n", wParam, modifiers));
+ if (evMask & KeyPressMask)
+ enqEvent(KeyPressMask, destWindow, WM_KEYDOWN, wParam, x, y, lParam, (modifiers | TRANSLATED_KEY), evTime);
+ if (evMask & KeyReleaseMask)
+ enqEvent(KeyReleaseMask, destWindow, WM_KEYUP, wParam, x, y, lParam, (modifiers | TRANSLATED_KEY), evTime);
+ }
+ }
+ *pDefault = 0;
+ return 0;
+
+ case WM_KEYUP:
+ DPRINTFIF(__debug_WM_KEYUP__ , ("WM_KEYUP h=%x %x\n", hWnd, wParam));
+ goto commonKeyUp;
+
+ case WM_SYSKEYUP:
+ DPRINTFIF(__debug_WM_KEYUP__ , ("WM_SYSKEYUP %x\n, wParam"));
+ commonKeyUp:
+ if (isNative) {
+ NDPRINTF(("WM_KEYUP/WM_SYSKEYUP for native - default handling\n"));
+ return 0;
+ }
+ {
+ HWND destWindow;
+
+ if (__focusFollowsMouse) {
+ destWindow = __currentPointerView;
+ if (destWindow == 0) {
+ destWindow = hWnd;
+ }
+ } else {
+ destWindow = hWnd;
+ }
+
+ if (GetWindow_eventMask(destWindow) & KeyReleaseMask) {
+ POINT p;
+
+ p.x = evRootX;
+ p.y = evRootY;
+ ScreenToClient(destWindow, &p);
+ x = p.x;
+ y = p.y;
+
+ enqEvent(KeyReleaseMask, destWindow, message, wParam, x, y, lParam, getModifiers(), evTime);
+ }
+ }
+ *pDefault = 0;
+ return 0;
+
+ case WM_SYSKEYDOWN:
+ DPRINTFIF(__debug_WM_KEYDOWN__ , ("WM_SYSKEYDOWN %x\n, wParam"));
+ goto commonKey;
+
+ case WM_KEYDOWN:
+ DPRINTFIF(__debug_WM_KEYDOWN__ , ("WM_KEYDOWN h=%x %x\n", hWnd, wParam));
+ commonKey:
+ if (isNative) {
+ NDPRINTF(("WM_KEYDOWN/WM_SYSKEYDOWN for native - default handling\n"));
+ return 0;
+ }
#ifdef EXIT_WITH_3_CTRL_Cs
- if ((msg.wParam == 'c')
- && (GetKeyState(VK_CONTROL) & 0x8000)) {
- /* CTRL-C */
- if (ctrl_c_count++ > 3) /* for debugging */
- exit(1);
- } else {
- if (msg.wParam != VK_CONTROL)
- ctrl_c_count = 0;
- }
+ if ((msg.wParam == 'c')
+ && (GetKeyState(VK_CONTROL) & 0x8000)) {
+ /* CTRL-C */
+ if (ctrl_c_count++ > 3) /* for debugging */
+ exit(1);
+ } else {
+ if (msg.wParam != VK_CONTROL)
+ ctrl_c_count = 0;
+ }
#endif
#ifdef RELEASE_CAPTURE_WITH_3_ESCAPEs
- if (msg.wParam == VK_ESCAPE)) {
- /* ESCAPE */
- if (escape_count++ > 3) {
- __currentCapture = CAPTURE_NONE;
- ReleaseCapture();
- CPRINTF(("ReleaseCapture <ESC>\n"));
- }
- } else {
- escape_count = 0;
- }
-#endif
- /* FALL INTO */
-
- {
- HWND destWindow;
-
- if (__focusFollowsMouse) {
- destWindow = __currentPointerView;
- if (destWindow == 0) {
- destWindow = hWnd;
- }
- } else {
- destWindow = hWnd;
- }
-
- if (GetWindow_eventMask(destWindow) & KeyPressMask) {
- POINT p;
-
- p.x = evRootX;
- p.y = evRootY;
- ScreenToClient(destWindow, &p);
- x = p.x;
- y = p.y;
-
- enqEvent(KeyPressMask, destWindow, message, wParam, x, y, lParam, getModifiers(), evTime);
- }
- }
- *pDefault = 0;
- return 0;
+ if (msg.wParam == VK_ESCAPE)) {
+ /* ESCAPE */
+ if (escape_count++ > 3) {
+ __currentCapture = CAPTURE_NONE;
+ ReleaseCapture();
+ CPRINTF(("ReleaseCapture <ESC>\n"));
+ }
+ } else {
+ escape_count = 0;
+ }
+#endif
+ /* FALL INTO */
+
+ {
+ HWND destWindow;
+
+ if (__focusFollowsMouse) {
+ destWindow = __currentPointerView;
+ if (destWindow == 0) {
+ destWindow = hWnd;
+ }
+ } else {
+ destWindow = hWnd;
+ }
+
+ if (GetWindow_eventMask(destWindow) & KeyPressMask) {
+ POINT p;
+
+ p.x = evRootX;
+ p.y = evRootY;
+ ScreenToClient(destWindow, &p);
+ x = p.x;
+ y = p.y;
+
+ enqEvent(KeyPressMask, destWindow, message, wParam, x, y, lParam, getModifiers(), evTime);
+ }
+ }
+ *pDefault = 0;
+ return 0;
#ifdef WM_MOUSEWHEEL
- case WM_MOUSEWHEEL:
- {
- HWND destWindow;
-
- if (__focusFollowsMouse) {
- destWindow = __currentPointerView;
- if (destWindow == 0) {
- destWindow = hWnd;
- }
- } else {
- destWindow = hWnd;
- }
-
-
- EVENT_PRINTF(("WM_MOUSEWHEEL h=%x wP=%x lP=%x\n", hWnd, wParam, lParam));
- if (GetWindow_eventMask(destWindow) & KeyPressMask) {
- POINT p;
- int delta;
-
- p.x = evRootX;
- p.y = evRootY;
- ScreenToClient(destWindow, &p);
- x = p.x;
- y = p.y;
- delta = evTime - lastMouseWheelTime;
- if (evTime < lastMouseWheelTime) {
- delta = (0xFFFFFFFF - lastMouseWheelTime) + evTime;
- }
- enqEvent(0, destWindow, message, wParam, x, y, lParam, getModifiers(), delta);
- }
- lastMouseWheelTime = evTime;
- }
- *pDefault = 0;
- return 0;
-#endif
-
- case WM_MOUSEMOVE:
- DPRINTFIF(__debug_WM_MOUSEMOVE__ , ("WM_MOUSEMOVE h=%x\n", hWnd));
- if (isNative) {
- NDPRINTF(("WM_MOUSEMOVE for native - default handling\n"));
- return 0;
- }
-
- if (hWnd != __currentPointerView) {
- if (! MustHandleButtonEvent()) {
- *pDefault = 0;
- return 0;
- }
- }
-
- {
- short x, y;
- int modifiers = getModifiers();
-
- x = (int)(short)LOWORD(lParam);
- y = (int)(short)HIWORD(lParam);
-
- if (__currentCapture == CAPTURE_NONE) {
- if (hWnd != __currentPointerView) {
- HWND prevPointerView;
-
- prevPointerView = __currentPointerView;
- if (prevPointerView) {
- if (inSizeMove) {
- if (needDelayedMouseLeaveWindow == NULL) {
- needDelayedMouseLeaveWindow = __currentPointerView;
- }
- } else {
- if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask) {
- enqEvent(LeaveWindowMask, __currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, modifiers, evTime);
- SetWindow_mouseXY(__currentPointerView, -9999, -9999);
- }
- }
- __currentPointerView = 0;
- }
+ case WM_MOUSEWHEEL:
+ {
+ HWND destWindow;
+
+ if (__focusFollowsMouse) {
+ destWindow = __currentPointerView;
+ if (destWindow == 0) {
+ destWindow = hWnd;
+ }
+ } else {
+ destWindow = hWnd;
+ }
+
+
+ EVENT_PRINTF(("WM_MOUSEWHEEL h=%x wP=%x lP=%x\n", hWnd, wParam, lParam));
+ if (GetWindow_eventMask(destWindow) & KeyPressMask) {
+ POINT p;
+ int delta;
+
+ p.x = evRootX;
+ p.y = evRootY;
+ ScreenToClient(destWindow, &p);
+ x = p.x;
+ y = p.y;
+ delta = evTime - lastMouseWheelTime;
+ if (evTime < lastMouseWheelTime) {
+ delta = (0xFFFFFFFF - lastMouseWheelTime) + evTime;
+ }
+ enqEvent(0, destWindow, message, wParam, x, y, lParam, getModifiers(), delta);
+ }
+ lastMouseWheelTime = evTime;
+ }
+ *pDefault = 0;
+ return 0;
+#endif
+
+ case WM_MOUSEMOVE:
+ DPRINTFIF(__debug_WM_MOUSEMOVE__ , ("WM_MOUSEMOVE h=%x\n", hWnd));
+ if (isNative) {
+ NDPRINTF(("WM_MOUSEMOVE for native - default handling\n"));
+ return 0;
+ }
+
+ if (hWnd != __currentPointerView) {
+ if (! MustHandleButtonEvent()) {
+ *pDefault = 0;
+ return 0;
+ }
+ }
+
+ {
+ short x, y;
+ int modifiers = getModifiers();
+
+ x = (int)(short)LOWORD(lParam);
+ y = (int)(short)HIWORD(lParam);
+
+ if (__currentCapture == CAPTURE_NONE) {
+ if (hWnd != __currentPointerView) {
+ HWND prevPointerView;
+
+ prevPointerView = __currentPointerView;
+ if (prevPointerView) {
+ if (inSizeMove) {
+ if (needDelayedMouseLeaveWindow == NULL) {
+ needDelayedMouseLeaveWindow = __currentPointerView;
+ }
+ } else {
+ if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask) {
+ enqEvent(LeaveWindowMask, __currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, modifiers, evTime);
+ SetWindow_mouseXY(__currentPointerView, -9999, -9999);
+ }
+ }
+ __currentPointerView = 0;
+ }
#if 0
- if (__activateOnClick) {
- /*
- * only send mouseEnter if the window belongs to the current
- * active window
- */
- if (GetTopParent(prevPointerView) == GetTopParent(hWnd)) {
- }
- }
-#endif
- if (inSizeMove) {
- needDelayedMouseEnterWindow = hWnd;
- delayedMouseEnterX = x;
- delayedMouseEnterY = y;
- } else {
- if (GetWindow_eventMask(hWnd) & EnterWindowMask) {
- enqEvent(EnterWindowMask, hWnd, __WM_MOUSEENTER, 0, x, y, 0, modifiers, evTime);
- SetWindow_mouseXY(hWnd, x, y);
- }
- }
- __currentPointerView = hWnd;
- }
- DDPRINTF(("MouseMove %x\n", __currentPointerView));
- } else {
- CPRINTF(("MouseMove Capture %x\n", __currentPointerView));
- }
-
- if ((GetWindow_eventMask(__currentPointerView) & PointerMotionMask)
- || (modifiers & AnyButtonMask)) {
- if (! __eatingMouseEvents) {
- if ((x == lastMotionX)
- && (y == lastMotionY)
- && (__currentPointerView == lastMotionWnd)) {
- /* ignore */
- } else {
- lastMotionX = x;
- lastMotionY = y;
- lastMotionWnd = __currentPointerView;
-
- if ((GetWindow_mouseX(__currentPointerView) == x)
- && (GetWindow_mouseY(__currentPointerView) == y)) {
- } else {
- enqEvent(PointerMotionMask, __currentPointerView, WM_MOUSEMOVE, wParam, x, y, 0, modifiers, evTime);
- SetWindow_mouseXY(__currentPointerView, x, y);
- }
- }
- }
- }
- }
- *pDefault = 0;
- return 0;
-
- case WM_LBUTTONUP:
- curButton = Button1;
- goto commonButtonUp;
- case WM_MBUTTONUP:
- curButton = Button2;
- goto commonButtonUp;
- case WM_RBUTTONUP:
- curButton = Button3;
+ if (__activateOnClick) {
+ /*
+ * only send mouseEnter if the window belongs to the current
+ * active window
+ */
+ if (GetTopParent(prevPointerView) == GetTopParent(hWnd)) {
+ }
+ }
+#endif
+ if (inSizeMove) {
+ needDelayedMouseEnterWindow = hWnd;
+ delayedMouseEnterX = x;
+ delayedMouseEnterY = y;
+ } else {
+ if (GetWindow_eventMask(hWnd) & EnterWindowMask) {
+ enqEvent(EnterWindowMask, hWnd, __WM_MOUSEENTER, 0, x, y, 0, modifiers, evTime);
+ SetWindow_mouseXY(hWnd, x, y);
+ }
+ }
+ __currentPointerView = hWnd;
+ }
+ DDPRINTF(("MouseMove %x\n", __currentPointerView));
+ } else {
+ CPRINTF(("MouseMove Capture %x\n", __currentPointerView));
+ }
+
+ if ((GetWindow_eventMask(__currentPointerView) & PointerMotionMask)
+ || (modifiers & AnyButtonMask)) {
+ if (! __eatingMouseEvents) {
+ if ((x == lastMotionX)
+ && (y == lastMotionY)
+ && (__currentPointerView == lastMotionWnd)) {
+ /* ignore */
+ } else {
+ lastMotionX = x;
+ lastMotionY = y;
+ lastMotionWnd = __currentPointerView;
+
+ if ((GetWindow_mouseX(__currentPointerView) == x)
+ && (GetWindow_mouseY(__currentPointerView) == y)) {
+ } else {
+ enqEvent(PointerMotionMask, __currentPointerView, WM_MOUSEMOVE, wParam, x, y, 0, modifiers, evTime);
+ SetWindow_mouseXY(__currentPointerView, x, y);
+ }
+ }
+ }
+ }
+ }
+ *pDefault = 0;
+ return 0;
+
+ case WM_LBUTTONUP:
+ curButton = Button1;
+ goto commonButtonUp;
+ case WM_MBUTTONUP:
+ curButton = Button2;
+ goto commonButtonUp;
+ case WM_RBUTTONUP:
+ curButton = Button3;
commonButtonUp:
- if (isNative) {
- NDPRINTF(("WM_*BUTTONUP for native - default handling\n"));
- return 0;
- }
+ if (isNative) {
+ NDPRINTF(("WM_*BUTTONUP for native - default handling\n"));
+ return 0;
+ }
#ifndef PRE_01_APR_04
- if ((__currentPointerView != hWnd) && (__currentPointerView == (HANDLE)0)) {
- __currentPointerView = hWnd;
-
- if (GetWindow_eventMask(hWnd) & EnterWindowMask) {
- POINT p;
-
- p.x = evRootX;
- p.y = evRootY;
-
- ScreenToClient (hWnd, & p);
-
- if ((p.x >= 0) && (p.y >= 0)) {
- enqEvent(EnterWindowMask, hWnd, __WM_MOUSEENTER, 0, p.x, p.y, 0, getModifiers(), EV_NOTIME);
- SetWindow_mouseXY(hWnd, p.x, p.y);
- } else {
- __currentPointerView = (HANDLE) 0;
- }
- }
- }
-#endif
-
- if (__currentCapture == curButton /* CAPTURE_IMPLICIT*/) {
- __currentCapture = CAPTURE_NONE;
- ReleaseCapture();
- CPRINTF(("ReleaseCapture <BUTTONUP>\n"));
- }
- EVENT_PRINTF3(("WM_BUTTONUP h=%x pos=%d/%d\n",
- hWnd, (int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam)));
-
-
- if (GetWindow_eventMask(hWnd) & ButtonReleaseMask) {
- if (__eatingMouseEvents) {
- __eatingMouseEvents = 0;
- } else {
- enqEvent(ButtonReleaseMask, hWnd,
- message, wParam, (int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam),
- wParam, getModifiers(), evTime);
- }
- }
- *pDefault = 0;
- break;
-
- case WM_LBUTTONDOWN:
- curButton = Button1;
- goto commonButtonDown;
- case WM_MBUTTONDOWN:
- curButton = Button2;
- goto commonButtonDown;
- case WM_RBUTTONDOWN:
- curButton = Button3;
-commonButtonDown:
- if (isNative) {
- NDPRINTF(("WM_*BUTTONDOWN for native - default handling\n"));
- return 0;
- }
-
- if (__currentCapture == CAPTURE_NONE) {
- __currentCapture = curButton /*CAPTURE_IMPLICIT*/;
- //SetFocus(hWnd);
- SetCapture(hWnd);
- CPRINTF(("SetCapture <BUTTONDOWN>%x\n",hWnd));
- }
- goto commonButton;
-
- case WM_LBUTTONDBLCLK:
- case WM_MBUTTONDBLCLK:
- case WM_RBUTTONDBLCLK:
- if (isNative) {
- NDPRINTF(("WM_*BUTTONDBLCLK for native - default handling\n"));
- return 0;
- }
- commonButton:
- EVENT_PRINTF3(("WM_BUTTONDOWN h=%x pos=%d/%d\n",
- hWnd, LOWORD(lParam), HIWORD(lParam)));
-
- if (GetWindow_eventMask(hWnd) & ButtonPressMask) {
- if (__eatingMouseEvents) {
- __eatingMouseEvents = 0;
- } else {
- enqEvent(ButtonPressMask, hWnd,
- message, wParam, (int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam),
- wParam, getModifiers(), evTime);
- }
- }
- *pDefault = 0;
- break;
-
- case WM_CAPTURECHANGED:
- CPRINTF(("WM_CAPTURECHANGED %x to %x\n",hWnd,lParam));
+ if ((__currentPointerView != hWnd) && (__currentPointerView == (HANDLE)0)) {
+ __currentPointerView = hWnd;
+
+ if (GetWindow_eventMask(hWnd) & EnterWindowMask) {
+ POINT p;
+
+ p.x = evRootX;
+ p.y = evRootY;
+
+ ScreenToClient (hWnd, & p);
+
+ if ((p.x >= 0) && (p.y >= 0)) {
+ enqEvent(EnterWindowMask, hWnd, __WM_MOUSEENTER, 0, p.x, p.y, 0, getModifiers(), EV_NOTIME);
+ SetWindow_mouseXY(hWnd, p.x, p.y);
+ } else {
+ __currentPointerView = (HANDLE) 0;
+ }
+ }
+ }
+#endif
+
+ if (__currentCapture == curButton /* CAPTURE_IMPLICIT*/) {
+ __currentCapture = CAPTURE_NONE;
+ ReleaseCapture();
+ CPRINTF(("ReleaseCapture <BUTTONUP>\n"));
+ }
+ EVENT_PRINTF3(("WM_BUTTONUP h=%x pos=%d/%d\n",
+ hWnd, (int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam)));
+
+
+ if (GetWindow_eventMask(hWnd) & ButtonReleaseMask) {
+ if (__eatingMouseEvents) {
+ __eatingMouseEvents = 0;
+ } else {
+ enqEvent(ButtonReleaseMask, hWnd,
+ message, wParam, (int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam),
+ wParam, getModifiers(), evTime);
+ }
+ }
+ *pDefault = 0;
+ break;
+
+ case WM_LBUTTONDBLCLK:
+ case WM_MBUTTONDBLCLK:
+ case WM_RBUTTONDBLCLK:
+ if (isNative) {
+ NDPRINTF(("WM_*BUTTONDBLCLK for native - default handling\n"));
+ return 0;
+ }
+ goto commonButtonWithCapture;
+ // goto commonButton;
+
+ case WM_LBUTTONDOWN:
+ curButton = Button1;
+ goto commonButtonDown;
+ case WM_MBUTTONDOWN:
+ curButton = Button2;
+ goto commonButtonDown;
+ case WM_RBUTTONDOWN:
+ curButton = Button3;
+ commonButtonDown:
+ if (isNative) {
+ NDPRINTF(("WM_*BUTTONDOWN for native - default handling\n"));
+ return 0;
+ }
+
+ commonButtonWithCapture:
+ if (__currentCapture == CAPTURE_NONE) {
+ __currentCapture = curButton /*CAPTURE_IMPLICIT*/;
+ //SetFocus(hWnd);
+ SetCapture(hWnd);
+ CPRINTF(("SetCapture <BUTTONDOWN>%x\n",hWnd));
+ }
+ goto commonButton;
+
+ commonButton:
+ EVENT_PRINTF3(("WM_BUTTONDOWN h=%x pos=%d/%d\n",
+ hWnd, LOWORD(lParam), HIWORD(lParam)));
+
+ if (GetWindow_eventMask(hWnd) & ButtonPressMask) {
+ if (__eatingMouseEvents) {
+ __eatingMouseEvents = 0;
+ } else {
+ enqEvent(ButtonPressMask, hWnd,
+ message, wParam, (int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam),
+ wParam, getModifiers(), evTime);
+ }
+ }
+ *pDefault = 0;
+ break;
+
+ case WM_CAPTURECHANGED:
+ CPRINTF(("WM_CAPTURECHANGED %x to %x\n",hWnd,lParam));
#if 0
- if ((__currentCapture != CAPTURE_NONE) && (__currentCapture != CAPTURE_EXPLICIT))
- {
- }
-#endif
- break;
-
- case WM_KILLFOCUS:
- CPRINTF(("WM_KILLFOCUS\n"));
- //enqEvent(0, hWnd, WM_KILLFOCUS, wParam, 0, 0, 0, 0, EV_NOTIME);
- if (isNative) {
- NDPRINTF(("WM_KILLFOCUS for native - default handling\n"));
- return 0;
- }
- *pDefault = 0;
- break;
-
- case WM_SETFOCUS:
- CPRINTF(("WM_SETFOCUS %x\n",hWnd));
+ if ((__currentCapture != CAPTURE_NONE) && (__currentCapture != CAPTURE_EXPLICIT))
+ {
+ }
+#endif
+ break;
+
+ case WM_KILLFOCUS:
+ CPRINTF(("WM_KILLFOCUS\n"));
+ //enqEvent(0, hWnd, WM_KILLFOCUS, wParam, 0, 0, 0, 0, EV_NOTIME);
+ if (isNative) {
+ NDPRINTF(("WM_KILLFOCUS for native - default handling\n"));
+ return 0;
+ }
+ *pDefault = 0;
+ break;
+
+ case WM_SETFOCUS:
+ CPRINTF(("WM_SETFOCUS %x\n",hWnd));
#if 0
- //enqEvent(0,hWnd, WM_SETFOCUS, wParam, 0, 0, 0, 0, EV_NOTIME);
- {
- POINT p;
- HWND hWndChild,hWndTemp;
-
- p.x = evRootX;
- p.y = evRootY;
- ScreenToClient(hWnd, &p);
- hWndChild = hWnd; //hWndChild = ChildWindowFromPoint(hWnd,p);
- do {
- hWndTemp = hWndChild;
- hWndChild = ChildWindowFromPointEx(hWndTemp,p,CWP_SKIPINVISIBLE|CWP_SKIPDISABLED|CWP_SKIPTRANSPARENT);
- } while ((hWndChild) && (hWndChild != hWndTemp));
-
- /*console_printf("WM_ACTIVATE active h=%x p=%d.%d in %x\n", hWnd,p.x,p.y,hWndChild);*/
- if (hWndChild /*&& (hWndChild != hWnd)*/) {
- if (hWndChild != __currentPointerView) {
- int modifiers = getModifiers();
-
- if (__currentPointerView) {
- if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask)
- enqEvent(LeaveWindowMask, __currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, modifiers, EV_NOTIME);
- SetWindow_mouseXY(__currentPointerView, -9999, -9999);
-
- __currentPointerView = 0;
- }
- if (GetWindow_eventMask(hWndChild) & EnterWindowMask) {
- enqEvent(EnterWindowMask, hWndChild, __WM_MOUSEENTER, 0, evRootX, evRootY, 0, modifiers, EV_NOTIME);
- SetWindow_mouseXY(hWndChild, evRootX, evRootY);
- }
- //SetFocus(hWndChild);
- __currentPointerView = hWndChild;
- }
- }
- }
-
- if (isNative) {
- NDPRINTF(("WM_SETFOCUS for native - default handling\n"));
- return 0;
- }
- *pDefault = 0;
-#endif
- break;
-
- case WM_GETTEXT:
- /*EVENT_PRINTF(("WM_GETTEXT %x\n", message));*/
- break;
-
- case WM_GETTEXTLENGTH:
- EVENT_PRINTF(("WM_GETTEXTLENGTH %x\n", message));
- break;
-
- case WM_NCCREATE:
- EVENT_PRINTF(("WM_NCCREATE %x\n", message));
- break;
-
- case WM_NCMOUSEMOVE:
- if (__currentCapture == CAPTURE_NONE) {
- if (__currentPointerView && (hWnd != __currentPointerView)) {
- if (inSizeMove) {
- if (needDelayedMouseLeaveWindow == NULL) {
- needDelayedMouseLeaveWindow = __currentPointerView;
- }
- } else {
- if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask) {
- enqEvent(LeaveWindowMask, __currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, getModifiers(), evTime);
- SetWindow_mouseXY(__currentPointerView, -9999, -9999);
- }
- }
- __currentPointerView = 0;
- }
- }
- *pDefault = 0;
- break;
-
- case WM_PARENTNOTIFY:
- EVENT_PRINTF2(("WM_PARENTNOTIFY h=%x hChild=%x %d\n",
- hWnd, lParam, LOWORD(wParam)));
- break;
-
- case WM_NCLBUTTONDOWN:
- DPRINTFIF(__debug_WM_BUTTONDOWN__ , ("WM_NCLBUTTONDOWN\n"));
- if (__shiftedLeftButtonIsLowerWindow) {
- /*
- * with shift, this is a lower-operation
- */
- if (GetKeyState(VK_SHIFT) & 0x8000) {
- SetWindowPos(hWnd, HWND_BOTTOM, 0, 0, 0, 0,
- SWP_NOSENDCHANGING |
- SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
- *pDefault = 0;
- }
- }
- break;
-
- case WM_NCLBUTTONUP:
- DPRINTFIF(__debug_WM_BUTTONUP__ , ("WM_NCLBUTTONUP\n"));
- break;
-
- case WM_NCRBUTTONDOWN:
- DPRINTFIF(__debug_WM_BUTTONDOWN__ , ("WM_NCRBUTTONDOWN\n"));
- if (__rightButtonIsLowerWindow) {
- /*
- * this is a lower-operation
- */
- SetWindowPos(hWnd, HWND_BOTTOM, 0, 0, 0, 0,
- SWP_NOSENDCHANGING |
- SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
- *pDefault = 0;
- }
- break;
-
- case WM_NCRBUTTONUP:
- DPRINTFIF(__debug_WM_BUTTONUP__ , ("WM_NCRBUTTONUP\n"));
- break;
-
- case WM_NCMBUTTONDOWN:
- DPRINTFIF(__debug_WM_BUTTONDOWN__ , ("WM_NCMBUTTONDOWN\n"));
- break;
-
- case WM_NCMBUTTONUP:
- DPRINTFIF(__debug_WM_BUTTONUP__ , ("WM_NCMBUTTONUP\n"));
- break;
-
- case WM_NCLBUTTONDBLCLK:
- EVENT_PRINTF(("WM_NCLBUTTONDBLCLK\n"));
- break;
-
- case WM_NCRBUTTONDBLCLK:
- EVENT_PRINTF(("WM_NCRBUTTONDBLCLK\n"));
- break;
-
- case WM_NCMBUTTONDBLCLK:
- EVENT_PRINTF(("WM_NCMBUTTONDBLCLK\n"));
- break;
-
- case WM_SETTEXT:
- DPRINTFIF(__debug_WM_SETTEXT__ , ("WM_SETTEXT\n"));
- break;
+ //enqEvent(0,hWnd, WM_SETFOCUS, wParam, 0, 0, 0, 0, EV_NOTIME);
+ {
+ POINT p;
+ HWND hWndChild,hWndTemp;
+
+ p.x = evRootX;
+ p.y = evRootY;
+ ScreenToClient(hWnd, &p);
+ hWndChild = hWnd; //hWndChild = ChildWindowFromPoint(hWnd,p);
+ do {
+ hWndTemp = hWndChild;
+ hWndChild = ChildWindowFromPointEx(hWndTemp,p,CWP_SKIPINVISIBLE|CWP_SKIPDISABLED|CWP_SKIPTRANSPARENT);
+ } while ((hWndChild) && (hWndChild != hWndTemp));
+
+ /*console_printf("WM_ACTIVATE active h=%x p=%d.%d in %x\n", hWnd,p.x,p.y,hWndChild);*/
+ if (hWndChild /*&& (hWndChild != hWnd)*/) {
+ if (hWndChild != __currentPointerView) {
+ int modifiers = getModifiers();
+
+ if (__currentPointerView) {
+ if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask)
+ enqEvent(LeaveWindowMask, __currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, modifiers, EV_NOTIME);
+ SetWindow_mouseXY(__currentPointerView, -9999, -9999);
+
+ __currentPointerView = 0;
+ }
+ if (GetWindow_eventMask(hWndChild) & EnterWindowMask) {
+ enqEvent(EnterWindowMask, hWndChild, __WM_MOUSEENTER, 0, evRootX, evRootY, 0, modifiers, EV_NOTIME);
+ SetWindow_mouseXY(hWndChild, evRootX, evRootY);
+ }
+ //SetFocus(hWndChild);
+ __currentPointerView = hWndChild;
+ }
+ }
+ }
+
+ if (isNative) {
+ NDPRINTF(("WM_SETFOCUS for native - default handling\n"));
+ return 0;
+ }
+ *pDefault = 0;
+#endif
+ break;
+
+ case WM_GETTEXT:
+ /*EVENT_PRINTF(("WM_GETTEXT %x\n", message));*/
+ break;
+
+ case WM_GETTEXTLENGTH:
+ EVENT_PRINTF(("WM_GETTEXTLENGTH %x\n", message));
+ break;
+
+ case WM_NCCREATE:
+ EVENT_PRINTF(("WM_NCCREATE %x\n", message));
+ break;
+
+ case WM_NCMOUSEMOVE:
+ if (__currentCapture == CAPTURE_NONE) {
+ if (__currentPointerView && (hWnd != __currentPointerView)) {
+ if (inSizeMove) {
+ if (needDelayedMouseLeaveWindow == NULL) {
+ needDelayedMouseLeaveWindow = __currentPointerView;
+ }
+ } else {
+ if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask) {
+ enqEvent(LeaveWindowMask, __currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, getModifiers(), evTime);
+ SetWindow_mouseXY(__currentPointerView, -9999, -9999);
+ }
+ }
+ __currentPointerView = 0;
+ }
+ }
+ *pDefault = 0;
+ break;
+
+ case WM_PARENTNOTIFY:
+ EVENT_PRINTF2(("WM_PARENTNOTIFY h=%x hChild=%x %d\n",
+ hWnd, lParam, LOWORD(wParam)));
+ break;
+
+ case WM_NCLBUTTONDOWN:
+ DPRINTFIF(__debug_WM_BUTTONDOWN__ , ("WM_NCLBUTTONDOWN\n"));
+ if (__shiftedLeftButtonIsLowerWindow) {
+ /*
+ * with shift, this is a lower-operation
+ */
+ if (GetKeyState(VK_SHIFT) & 0x8000) {
+ SetWindowPos(hWnd, HWND_BOTTOM, 0, 0, 0, 0,
+ SWP_NOSENDCHANGING |
+ SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
+ *pDefault = 0;
+ }
+ }
+ break;
+
+ case WM_NCLBUTTONUP:
+ DPRINTFIF(__debug_WM_BUTTONUP__ , ("WM_NCLBUTTONUP\n"));
+ break;
+
+ case WM_NCRBUTTONDOWN:
+ DPRINTFIF(__debug_WM_BUTTONDOWN__ , ("WM_NCRBUTTONDOWN\n"));
+ if (__rightButtonIsLowerWindow) {
+ /*
+ * this is a lower-operation
+ */
+ SetWindowPos(hWnd, HWND_BOTTOM, 0, 0, 0, 0,
+ SWP_NOSENDCHANGING |
+ SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
+ *pDefault = 0;
+ }
+ break;
+
+ case WM_NCRBUTTONUP:
+ DPRINTFIF(__debug_WM_BUTTONUP__ , ("WM_NCRBUTTONUP\n"));
+ break;
+
+ case WM_NCMBUTTONDOWN:
+ DPRINTFIF(__debug_WM_BUTTONDOWN__ , ("WM_NCMBUTTONDOWN\n"));
+ break;
+
+ case WM_NCMBUTTONUP:
+ DPRINTFIF(__debug_WM_BUTTONUP__ , ("WM_NCMBUTTONUP\n"));
+ break;
+
+ case WM_NCLBUTTONDBLCLK:
+ EVENT_PRINTF(("WM_NCLBUTTONDBLCLK\n"));
+ break;
+
+ case WM_NCRBUTTONDBLCLK:
+ EVENT_PRINTF(("WM_NCRBUTTONDBLCLK\n"));
+ break;
+
+ case WM_NCMBUTTONDBLCLK:
+ EVENT_PRINTF(("WM_NCMBUTTONDBLCLK\n"));
+ break;
+
+ case WM_SETTEXT:
+ DPRINTFIF(__debug_WM_SETTEXT__ , ("WM_SETTEXT\n"));
+ break;
#ifdef WM_SYNCPAINT
- case WM_SYNCPAINT:
- EVENT_PRINTF(("WM_SYNCPAINT\n"));
- break;
-#else
- case 0x88:
- EVENT_PRINTF(("0x88 (undoc)\n"));
- break;
-#endif
-
- case WM_NCCALCSIZE:
- EVENT_PRINTF(("WM_NCCALCSIZE\n"));
- break;
-
- case WM_NCPAINT:
- EVENT_PRINTF3(("WM_NCPAINT\n"));
+ case WM_SYNCPAINT:
+ EVENT_PRINTF(("WM_SYNCPAINT\n"));
+ break;
+#else
+ case 0x88:
+ EVENT_PRINTF(("0x88 (undoc)\n"));
+ break;
+#endif
+
+ case WM_NCCALCSIZE:
+ EVENT_PRINTF(("WM_NCCALCSIZE\n"));
+ break;
+
+ case WM_NCPAINT:
+ EVENT_PRINTF3(("WM_NCPAINT\n"));
#ifdef THIS_DOES_NOT_WORK
- /* mhmh - something is drawn, but clipped wrong
- * and with wrong colors ....
- */
-
- /*
- * child windows only ...
- */
- if (GetParent(hWnd)) {
- int clr;
-
- clr = GetWindow_bdColor(hWnd);
- if (clr != BlackPixel) {
- /*
- * draw it here
- */
- HBRUSH br;
- RECT rect, lineRect;
- HDC hDC;
-
- if (clr == WhitePixel) {
- br = __whiteBrush;
- } else {
- br = CreateSolidBrush(clr);
- }
-
- GetWindowRect(hWnd, &rect);
- hDC = GetWindowDC(hWnd);
- SelectClipRgn(hDC, NULL);
-
- lineRect.left = rect.left;
- lineRect.right = rect.right;
- lineRect.top = rect.top;
- lineRect.bottom = rect.top + 1;
- FillRect(hDC, &lineRect, br);
-
- lineRect.bottom = rect.bottom - 1;
- lineRect.bottom = rect.bottom;
- FillRect(hDC, &lineRect, br);
-
- lineRect.top = rect.top;
- lineRect.bottom = rect.bottom;
- lineRect.left = rect.left;
- lineRect.right = rect.left + 1;
- FillRect(hDC, &lineRect, br);
-
- lineRect.left = rect.right - 1;
- lineRect.right = rect.right;
- FillRect(hDC, &lineRect, br);
-
- _DeleteBrush(br, __LINE__);
- ReleaseDC(hWnd, hDC);
- *pDefault = 0;
- return 0;
- }
- }
+ /* mhmh - something is drawn, but clipped wrong
+ * and with wrong colors ....
+ */
+
+ /*
+ * child windows only ...
+ */
+ if (GetParent(hWnd)) {
+ int clr;
+
+ clr = GetWindow_bdColor(hWnd);
+ if (clr != BlackPixel) {
+ /*
+ * draw it here
+ */
+ HBRUSH br;
+ RECT rect, lineRect;
+ HDC hDC;
+
+ if (clr == WhitePixel) {
+ br = __whiteBrush;
+ } else {
+ br = CreateSolidBrush(clr);
+ }
+
+ GetWindowRect(hWnd, &rect);
+ hDC = GetWindowDC(hWnd);
+ SelectClipRgn(hDC, NULL);
+
+ lineRect.left = rect.left;
+ lineRect.right = rect.right;
+ lineRect.top = rect.top;
+ lineRect.bottom = rect.top + 1;
+ FillRect(hDC, &lineRect, br);
+
+ lineRect.bottom = rect.bottom - 1;
+ lineRect.bottom = rect.bottom;
+ FillRect(hDC, &lineRect, br);
+
+ lineRect.top = rect.top;
+ lineRect.bottom = rect.bottom;
+ lineRect.left = rect.left;
+ lineRect.right = rect.left + 1;
+ FillRect(hDC, &lineRect, br);
+
+ lineRect.left = rect.right - 1;
+ lineRect.right = rect.right;
+ FillRect(hDC, &lineRect, br);
+
+ _DeleteBrush(br, __LINE__);
+ ReleaseDC(hWnd, hDC);
+ *pDefault = 0;
+ return 0;
+ }
+ }
#endif /* THIS_DOES_NOT_WORK */
- break;
-
- case WM_SYSCOMMAND:
- switch (wParam & ~0x000F) {
- case SC_CLOSE:
- EVENT_PRINTF2(("WM_SYSCOMMAND SC_CLOSE\n"));
- break;
-
- case SC_MOVE:
- EVENT_PRINTF2(("WM_SYSCOMMAND SC_MOVE\n"));
- break;
-
- case SC_RESTORE:
- EVENT_PRINTF2(("WM_SYSCOMMAND SC_RESTORE\n"));
- break;
-
- case SC_SIZE:
- EVENT_PRINTF2(("WM_SYSCOMMAND SC_SIZE\n"));
- break;
-
- default:
- EVENT_PRINTF2(("WM_SYSCOMMAND %x\n", wParam));
- break;
- }
- break;
-
- case WM_INITMENU:
- EVENT_PRINTF(("WM_INITMENU\n"));
- break;
-
- case WM_INITMENUPOPUP:
- EVENT_PRINTF(("WM_INITMENUPOPUP\n"));
- break;
-
- case WM_ENTERIDLE:
- EVENT_PRINTF(("WM_ENTERIDLE\n"));
- break;
-
- case WM_ENTERMENULOOP:
- EVENT_PRINTF(("WM_ENTERMENULOOP\n"));
- break;
-
- case WM_EXITMENULOOP:
- EVENT_PRINTF(("WM_EXITMENULOOP\n"));
- break;
-
- case WM_MENUSELECT:
- EVENT_PRINTF(("WM_MENUSELECT\n"));
- break;
-
- case WM_QUIT:
- DPRINTF(("quit message hWnd=0x%x lP=0x%x wP=0x%x\n", hWnd, lParam, wParam));
- enqEvent(0, 0, WM_QUIT, wParam, lParam, 0, 0, 0, EV_NOTIME);
- break;
-
- case WM_NCDESTROY:
- EVENT_PRINTF(("WM_NCDESTROY\n"));
- break;
-
- case WM_QUERYNEWPALETTE:
- EVENT_PRINTF(("WM_QUERYNEWPALETTE\n"));
- break;
-
- case WM_PALETTECHANGED:
- EVENT_PRINTF(("WM_PALETTECHANGED\n"));
- break;
-
- case WM_ACTIVATEAPP:
- EVENT_PRINTF2(("WM_ACTIVATEAPP %s\n", wParam ? "active" : "inactive"));
- break;
-
- case WM_SYSDEADCHAR:
- EVENT_PRINTF2(("WM_SYSDEADCHAR %x\n, wParam"));
- break;
-
- case WM_DEADCHAR:
- EVENT_PRINTF2(("WM_DEADCHAR %x\n, wParam"));
- break;
-
- case WM_PAINTICON:
- EVENT_PRINTF(("WM_PAINTICON\n"));
- break;
-
- case WM_ICONERASEBKGND:
- EVENT_PRINTF(("WM_ICONERASEBKGND\n"));
- break;
-
- case WM_WINDOWPOSCHANGING:
- DPRINTFIF(__debug_WM_WINDOWPOSCHANGING__ , ("WM_WINDOWPOSCHANGING\n"));
+ break;
+
+ case WM_SYSCOMMAND:
+ switch (wParam & ~0x000F) {
+ case SC_CLOSE:
+ EVENT_PRINTF2(("WM_SYSCOMMAND SC_CLOSE\n"));
+ break;
+
+ case SC_MOVE:
+ EVENT_PRINTF2(("WM_SYSCOMMAND SC_MOVE\n"));
+ break;
+
+ case SC_RESTORE:
+ EVENT_PRINTF2(("WM_SYSCOMMAND SC_RESTORE\n"));
+ break;
+
+ case SC_SIZE:
+ EVENT_PRINTF2(("WM_SYSCOMMAND SC_SIZE\n"));
+ break;
+
+ default:
+ EVENT_PRINTF2(("WM_SYSCOMMAND %x\n", wParam));
+ break;
+ }
+ break;
+
+ case WM_INITMENU:
+ EVENT_PRINTF(("WM_INITMENU\n"));
+ break;
+
+ case WM_INITMENUPOPUP:
+ EVENT_PRINTF(("WM_INITMENUPOPUP\n"));
+ break;
+
+ case WM_ENTERIDLE:
+ EVENT_PRINTF(("WM_ENTERIDLE\n"));
+ break;
+
+ case WM_ENTERMENULOOP:
+ EVENT_PRINTF(("WM_ENTERMENULOOP\n"));
+ break;
+
+ case WM_EXITMENULOOP:
+ EVENT_PRINTF(("WM_EXITMENULOOP\n"));
+ break;
+
+ case WM_MENUSELECT:
+ EVENT_PRINTF(("WM_MENUSELECT\n"));
+ break;
+
+ case WM_QUIT:
+ DPRINTF(("quit message hWnd=0x%x lP=0x%x wP=0x%x\n", hWnd, lParam, wParam));
+ enqEvent(0, 0, WM_QUIT, wParam, lParam, 0, 0, 0, EV_NOTIME);
+ break;
+
+ case WM_NCDESTROY:
+ EVENT_PRINTF(("WM_NCDESTROY\n"));
+ break;
+
+ case WM_QUERYNEWPALETTE:
+ EVENT_PRINTF(("WM_QUERYNEWPALETTE\n"));
+ break;
+
+ case WM_PALETTECHANGED:
+ EVENT_PRINTF(("WM_PALETTECHANGED\n"));
+ break;
+
+ case WM_ACTIVATEAPP:
+ EVENT_PRINTF2(("WM_ACTIVATEAPP %s\n", wParam ? "active" : "inactive"));
+ break;
+
+ case WM_SYSDEADCHAR:
+ EVENT_PRINTF2(("WM_SYSDEADCHAR %x\n, wParam"));
+ break;
+
+ case WM_DEADCHAR:
+ EVENT_PRINTF2(("WM_DEADCHAR %x\n, wParam"));
+ break;
+
+ case WM_PAINTICON:
+ EVENT_PRINTF(("WM_PAINTICON\n"));
+ break;
+
+ case WM_ICONERASEBKGND:
+ EVENT_PRINTF(("WM_ICONERASEBKGND\n"));
+ break;
+
+ case WM_WINDOWPOSCHANGING:
+ DPRINTFIF(__debug_WM_WINDOWPOSCHANGING__ , ("WM_WINDOWPOSCHANGING\n"));
#ifdef HANDLE_VIEWGRAVITY
- /*
- * any child with a viewGravity ?
- * (only care for topViews here;
- * child views do it on the smalltalk level ...)
- */
- if (GetParent(hWnd) == 0) {
- if (GetParent(hWnd) == 0) {
- struct gravityCallBackInfo i;
- RECT rct, dRect;
- int dW, dH;
- WINDOWPOS *wp = (WINDOWPOS *)lParam;
- int winStyleBits, winExStyleBits;
-
- if (! (wp->flags & SWP_NOSIZE)) {
- dRect.left = 0;
- dRect.top = 0;
- dRect.right = 100;
- dRect.bottom = 100;
- winStyleBits = GetWindowLong(hWnd, GWL_STYLE);
- winExStyleBits = GetWindowLong(hWnd, GWL_EXSTYLE);
- AdjustWindowRectEx(&dRect, winStyleBits, 0, winExStyleBits);
- dW = dRect.right - dRect.left;
- dH = dRect.bottom - dRect.top;
-
- GetClientRect(hWnd, &rct);
-
- i.parent = hWnd;
-
- i.currW = rct.right - rct.left;
- i.currH = rct.bottom - rct.top;
-
- /* wp gives us the new outer (frame) bounds */
- i.newW = wp->cx - (dW - 100);
- i.newH = wp->cy - (dH - 100);
-
- if ((i.currW != i.newW)
- || (i.currH != i.newH)) {
- DPRINTF((stderr, "about to sizeChange old: %d/%d new: %d/%d\n",
- i.currW, i.currH, i.newW, i.newH));
-
- GetWindowRect(hWnd, &rct);
- i.parentWinX = rct.left - dRect.left;
- i.parentWinY = rct.top - dRect.top;
- EnumChildWindows(hWnd, gravityEnumeratorCallBack, (int)(&i));
- }
- }
- }
- }
+ /*
+ * any child with a viewGravity ?
+ * (only care for topViews here;
+ * child views do it on the smalltalk level ...)
+ */
+ if (GetParent(hWnd) == 0) {
+ if (GetParent(hWnd) == 0) {
+ struct gravityCallBackInfo i;
+ RECT rct, dRect;
+ int dW, dH;
+ WINDOWPOS *wp = (WINDOWPOS *)lParam;
+ int winStyleBits, winExStyleBits;
+
+ if (! (wp->flags & SWP_NOSIZE)) {
+ dRect.left = 0;
+ dRect.top = 0;
+ dRect.right = 100;
+ dRect.bottom = 100;
+ winStyleBits = GetWindowLong(hWnd, GWL_STYLE);
+ winExStyleBits = GetWindowLong(hWnd, GWL_EXSTYLE);
+ AdjustWindowRectEx(&dRect, winStyleBits, 0, winExStyleBits);
+ dW = dRect.right - dRect.left;
+ dH = dRect.bottom - dRect.top;
+
+ GetClientRect(hWnd, &rct);
+
+ i.parent = hWnd;
+
+ i.currW = rct.right - rct.left;
+ i.currH = rct.bottom - rct.top;
+
+ /* wp gives us the new outer (frame) bounds */
+ i.newW = wp->cx - (dW - 100);
+ i.newH = wp->cy - (dH - 100);
+
+ if ((i.currW != i.newW)
+ || (i.currH != i.newH)) {
+ DPRINTF((stderr, "about to sizeChange old: %d/%d new: %d/%d\n",
+ i.currW, i.currH, i.newW, i.newH));
+
+ GetWindowRect(hWnd, &rct);
+ i.parentWinX = rct.left - dRect.left;
+ i.parentWinY = rct.top - dRect.top;
+ EnumChildWindows(hWnd, gravityEnumeratorCallBack, (int)(&i));
+ }
+ }
+ }
+ }
#endif /* HANDLE_VIEWGRAVITY */
- break;
-
- case WM_QUERYOPEN:
- EVENT_PRINTF(("WM_QUERYOPEN\n"));
- break;
-
- case WM_QUERYENDSESSION:
- EVENT_PRINTF(("WM_QUERYENDSESSION\n"));
- *pDefault = 0;
- if (@global(CanEndSession) == false) {
- enqEvent(0, hWnd, WM_QUERYENDSESSION, wParam, 0, 0, 0, 0, EV_NOTIME);
-
- // TODO: enter new event loop
- // which is left when an endSessionConfirmation
- // arrives from smalltalk
- // (either positive or negative).
- // for now, do not allow leaving
- // windows as long as ST/X is open.
-
- return(0);
- }
- return(TRUE); // allow leaving windows
- break;
-
- case WM_ENDSESSION:
- EVENT_PRINTF(("WM_ENDSESSION\n"));
- enqEvent(0, hWnd, WM_ENDSESSION, wParam, 0, 0, 0, 0, EV_NOTIME);
- break;
-
- case WM_DISPLAYCHANGE:
- EVENT_PRINTF(("WM_DISPLAYCHANGE\n"));
- enqEvent(0, hWnd, WM_DISPLAYCHANGE, wParam, 0, 0, 0, 0, EV_NOTIME);
- break;
-
- case WM_FONTCHANGE:
- EVENT_PRINTF(("WM_FONTCHANGE\n"));
- enqEvent(0, hWnd, WM_FONTCHANGE, wParam, 0, 0, 0, 0, EV_NOTIME);
- break;
-
- case WM_WININICHANGE:
- EVENT_PRINTF(("WM_WININICHANGE\n"));
- enqEvent(0, hWnd, WM_WININICHANGE, wParam, 0, 0, 0, 0, EV_NOTIME);
- break;
-
- case WM_SYSCOLORCHANGE:
- EVENT_PRINTF(("WM_SYSCOLORCHANGE\n"));
- enqEvent(0, hWnd, WM_SYSCOLORCHANGE, wParam, 0, 0, 0, 0, EV_NOTIME);
- break;
-
- case WM_MOVING:
- DPRINTFIF(__debug_WM_MOVING__ , ("WM_MOVING\n"));
+ break;
+
+ case WM_QUERYOPEN:
+ EVENT_PRINTF(("WM_QUERYOPEN\n"));
+ break;
+
+ case WM_QUERYENDSESSION:
+ EVENT_PRINTF(("WM_QUERYENDSESSION\n"));
+ *pDefault = 0;
+ if (@global(CanEndSession) == false) {
+ enqEvent(0, hWnd, WM_QUERYENDSESSION, wParam, 0, 0, 0, 0, EV_NOTIME);
+
+ // TODO: enter new event loop
+ // which is left when an endSessionConfirmation
+ // arrives from smalltalk
+ // (either positive or negative).
+ // for now, do not allow leaving
+ // windows as long as ST/X is open.
+
+ return(0);
+ }
+ return(TRUE); // allow leaving windows
+ break;
+
+ case WM_ENDSESSION:
+ EVENT_PRINTF(("WM_ENDSESSION\n"));
+ enqEvent(0, hWnd, WM_ENDSESSION, wParam, 0, 0, 0, 0, EV_NOTIME);
+ break;
+
+ case WM_DISPLAYCHANGE:
+ EVENT_PRINTF(("WM_DISPLAYCHANGE\n"));
+ enqEvent(0, hWnd, WM_DISPLAYCHANGE, wParam, 0, 0, 0, 0, EV_NOTIME);
+ break;
+
+ case WM_FONTCHANGE:
+ EVENT_PRINTF(("WM_FONTCHANGE\n"));
+ enqEvent(0, hWnd, WM_FONTCHANGE, wParam, 0, 0, 0, 0, EV_NOTIME);
+ break;
+
+ case WM_WININICHANGE:
+ EVENT_PRINTF(("WM_WININICHANGE\n"));
+ enqEvent(0, hWnd, WM_WININICHANGE, wParam, 0, 0, 0, 0, EV_NOTIME);
+ break;
+
+ case WM_SYSCOLORCHANGE:
+ EVENT_PRINTF(("WM_SYSCOLORCHANGE\n"));
+ enqEvent(0, hWnd, WM_SYSCOLORCHANGE, wParam, 0, 0, 0, 0, EV_NOTIME);
+ break;
+
+ case WM_MOVING:
+ DPRINTFIF(__debug_WM_MOVING__ , ("WM_MOVING\n"));
#ifdef DELAY_ENTER_LEAVE_WHILE_IN_SIZE_MOVE
- inMove = 1;
-#endif
- break;
-
- case WM_SIZING:
- EVENT_PRINTF(("WM_SIZING\n"));
+ inMove = 1;
+#endif
+ break;
+
+ case WM_SIZING:
+ EVENT_PRINTF(("WM_SIZING\n"));
#ifdef DELAY_ENTER_LEAVE_WHILE_IN_SIZE_MOVE
- inSize = 1;
-#endif
- break;
-
- case WM_ENTERSIZEMOVE:
- EVENT_PRINTF(("WM_ENTERSIZEMOVE\n"));
+ inSize = 1;
+#endif
+ break;
+
+ case WM_ENTERSIZEMOVE:
+ EVENT_PRINTF(("WM_ENTERSIZEMOVE\n"));
#ifdef DELAY_ENTER_LEAVE_WHILE_IN_SIZE_MOVE
- inSizeMove = 1;
-#endif
- break;
-
- case WM_EXITSIZEMOVE:
- EVENT_PRINTF(("WM_EXITSIZEMOVE\n"));
+ inSizeMove = 1;
+#endif
+ break;
+
+ case WM_EXITSIZEMOVE:
+ EVENT_PRINTF(("WM_EXITSIZEMOVE\n"));
#ifndef PRE_13_APR_04_POSCHANGED_IN_EXITSIZEMOVE
- if (inMove) {
- /* generate WM_WINDOWPOSCHANGED
- */
- RECT rct;
- int x, y, w, h;
-
- GetClientRect(hWnd, &rct);
-
- x = rct.left;
- y = rct.top;
- w = rct.right - rct.left;
- h = rct.bottom - rct.top;
-
- if ((w == 0) && (h == 0)) {
- if (! GetWindow_iconified(hWnd)) {
- SetWindow_iconified(hWnd, 1);
- }
- enqEvent(0, hWnd, __WM_ICONIFIED, 1, 0, 0, 0, 0, EV_NOTIME);
- } else {
- if (GetWindow_iconified(hWnd)) {
- SetWindow_iconified(hWnd, 0);
- enqEvent(0, hWnd, __WM_ICONIFIED, 0, 0, 0, 0, 0, EV_NOTIME);
- } else {
- enqEvent(0, hWnd, WM_WINDOWPOSCHANGED, 0, x, y, w, h, EV_NOTIME);
- }
- }
- }
-#endif
-
- inSizeMove = inMove = inSize = 0;
-
- if (needDelayedMouseLeaveWindow || needDelayedMouseEnterWindow) {
- int modifiers = getModifiers();
-
- if (needDelayedMouseLeaveWindow) {
- if (GetWindow_eventMask(needDelayedMouseLeaveWindow) & LeaveWindowMask) {
- enqEvent(LeaveWindowMask, needDelayedMouseLeaveWindow, __WM_MOUSELEAVE, 0, -1, -1, 0, modifiers, EV_NOTIME);
- SetWindow_mouseXY(needDelayedMouseLeaveWindow, -9999, -9999);
- }
- needDelayedMouseLeaveWindow = NULL;
- }
- if (needDelayedMouseEnterWindow) {
- if (GetWindow_eventMask(needDelayedMouseEnterWindow) & EnterWindowMask) {
- enqEvent(EnterWindowMask, needDelayedMouseEnterWindow, __WM_MOUSEENTER, 0, delayedMouseEnterX, delayedMouseEnterY, 0, modifiers, EV_NOTIME);
- SetWindow_mouseXY(needDelayedMouseEnterWindow, delayedMouseEnterX, delayedMouseEnterY);
- }
- needDelayedMouseEnterWindow = NULL;
- }
- }
-
- break;
-
- case WM_MOVE:
- EVENT_PRINTF(("WM_MOVE\n"));
- break;
-
- case WM_POWER:
- EVENT_PRINTF(("WM_POWER\n"));
- enqEvent(0, hWnd, WM_POWER, wParam, 0, 0, 0, 0, EV_NOTIME);
- break;
-
- /* native widget actions */
- case WM_COMMAND:
- if (lParam) {
- NDPRINTF(("COMMAND for widget\n"));
- enqEvent(0, (HWND)(lParam), WM_COMMAND, wParam, lParam, 0, 0, 0, EV_NOTIME);
- } else {
- NDPRINTF(("COMMAND for owner\n"));
- enqEvent(0, hWnd, WM_COMMAND, wParam, lParam, 0, 0, 0, EV_NOTIME);
- }
- break;
-
- /* tray action */
- case WM_TRAY_MESSAGE:
- DPRINTF(("tray message hWnd=0x%x lP=0x%x wP=0x%x\n", hWnd, lParam, wParam));
- enqEvent(0, hWnd, WM_TRAY_MESSAGE, wParam, lParam, 0, 0, 0, EV_NOTIME);
- break;
-
- case WM_COPYDATA:
- DPRINTFIF(__debug_WM_COPYDATA__ , ("WM_COPYDATA\n"));
- {
- PCOPYDATASTRUCT pCDs;
- int dwData;
- void *pData;
- void *pCopiedData;
- int nBytes;
-
- pCDs = (PCOPYDATASTRUCT) lParam;
- dwData = pCDs->dwData;
- nBytes = pCDs->cbData;
- pData = (void *)pCDs->lpData;
-
- /*
- * because pData is only valid here, copy it out to a malloc'd
- * area. This MUST be free'd by someone else !
- */
- if (nBytes) {
- pCopiedData = malloc(nBytes);
- memcpy(pCopiedData, pData, nBytes);
- } else {
- pCopiedData = NULL;
- }
- // (flag, hWnd, message, wParam, arg1, arg2, arg3, arg4, evTime)
- enqEvent(0, hWnd, WM_COPYDATA, wParam, (int)pCopiedData, nBytes, 0, 0, EV_NOTIME);
- }
- *pDefault = 0;
- break;
-
- case WM_HSCROLL:
- case WM_VSCROLL:
- NDPRINTF(("VM_*SCROLL\n"));
- enqEvent(0, hWnd, message, wParam, lParam, 0, 0, 0, EV_NOTIME);
- break;
-
- case WM_DRAWITEM:
- EVENT_PRINTF(("WM_DRAWITEM\n"));
+ if (inMove) {
+ /* generate WM_WINDOWPOSCHANGED
+ */
+ RECT rct;
+ int x, y, w, h;
+
+ GetClientRect(hWnd, &rct);
+
+ x = rct.left;
+ y = rct.top;
+ w = rct.right - rct.left;
+ h = rct.bottom - rct.top;
+
+ if ((w == 0) && (h == 0)) {
+ if (! GetWindow_iconified(hWnd)) {
+ SetWindow_iconified(hWnd, 1);
+ }
+ enqEvent(0, hWnd, __WM_ICONIFIED, 1, 0, 0, 0, 0, EV_NOTIME);
+ } else {
+ if (GetWindow_iconified(hWnd)) {
+ SetWindow_iconified(hWnd, 0);
+ enqEvent(0, hWnd, __WM_ICONIFIED, 0, 0, 0, 0, 0, EV_NOTIME);
+ } else {
+ enqEvent(0, hWnd, WM_WINDOWPOSCHANGED, 0, x, y, w, h, EV_NOTIME);
+ }
+ }
+ }
+#endif
+
+ inSizeMove = inMove = inSize = 0;
+
+ if (needDelayedMouseLeaveWindow || needDelayedMouseEnterWindow) {
+ int modifiers = getModifiers();
+
+ if (needDelayedMouseLeaveWindow) {
+ if (GetWindow_eventMask(needDelayedMouseLeaveWindow) & LeaveWindowMask) {
+ enqEvent(LeaveWindowMask, needDelayedMouseLeaveWindow, __WM_MOUSELEAVE, 0, -1, -1, 0, modifiers, EV_NOTIME);
+ SetWindow_mouseXY(needDelayedMouseLeaveWindow, -9999, -9999);
+ }
+ needDelayedMouseLeaveWindow = NULL;
+ }
+ if (needDelayedMouseEnterWindow) {
+ if (GetWindow_eventMask(needDelayedMouseEnterWindow) & EnterWindowMask) {
+ enqEvent(EnterWindowMask, needDelayedMouseEnterWindow, __WM_MOUSEENTER, 0, delayedMouseEnterX, delayedMouseEnterY, 0, modifiers, EV_NOTIME);
+ SetWindow_mouseXY(needDelayedMouseEnterWindow, delayedMouseEnterX, delayedMouseEnterY);
+ }
+ needDelayedMouseEnterWindow = NULL;
+ }
+ }
+
+ break;
+
+ case WM_MOVE:
+ EVENT_PRINTF(("WM_MOVE\n"));
+ break;
+
+ case WM_POWER:
+ EVENT_PRINTF(("WM_POWER\n"));
+ enqEvent(0, hWnd, WM_POWER, wParam, 0, 0, 0, 0, EV_NOTIME);
+ break;
+
+ /* native widget actions */
+ case WM_COMMAND:
+ if (lParam) {
+ NDPRINTF(("COMMAND for widget\n"));
+ enqEvent(0, (HWND)(lParam), WM_COMMAND, wParam, lParam, 0, 0, 0, EV_NOTIME);
+ } else {
+ NDPRINTF(("COMMAND for owner\n"));
+ enqEvent(0, hWnd, WM_COMMAND, wParam, lParam, 0, 0, 0, EV_NOTIME);
+ }
+ break;
+
+ /* tray action */
+ case WM_TRAY_MESSAGE:
+ DPRINTF(("tray message hWnd=0x%x lP=0x%x wP=0x%x\n", hWnd, lParam, wParam));
+ enqEvent(0, hWnd, WM_TRAY_MESSAGE, wParam, lParam, 0, 0, 0, EV_NOTIME);
+ break;
+
+ case WM_COPYDATA:
+ DPRINTFIF(__debug_WM_COPYDATA__ , ("WM_COPYDATA\n"));
+ {
+ PCOPYDATASTRUCT pCDs;
+ int dwData;
+ void *pData;
+ void *pCopiedData;
+ int nBytes;
+
+ pCDs = (PCOPYDATASTRUCT) lParam;
+ dwData = pCDs->dwData;
+ nBytes = pCDs->cbData;
+ pData = (void *)pCDs->lpData;
+
+ /*
+ * because pData is only valid here, copy it out to a malloc'd
+ * area. This MUST be free'd by someone else !
+ */
+ if (nBytes) {
+ pCopiedData = malloc(nBytes);
+ memcpy(pCopiedData, pData, nBytes);
+ } else {
+ pCopiedData = NULL;
+ }
+ // (flag, hWnd, message, wParam, arg1, arg2, arg3, arg4, evTime)
+ enqEvent(0, hWnd, WM_COPYDATA, wParam, (int)pCopiedData, nBytes, 0, 0, EV_NOTIME);
+ }
+ *pDefault = 0;
+ break;
+
+ case WM_HSCROLL:
+ case WM_VSCROLL:
+ NDPRINTF(("VM_*SCROLL\n"));
+ enqEvent(0, hWnd, message, wParam, lParam, 0, 0, 0, EV_NOTIME);
+ break;
+
+ case WM_DRAWITEM:
+ EVENT_PRINTF(("WM_DRAWITEM\n"));
#if 0
- {
- DRAWITEMSTRUCT *pItemStruct;
-
- pItemStruct = (DRAWITEMSTRUCT *)lParam;
- enqEvent(0, pItemStruct->hwndItem, WM_DRAWITEM, wParam, 0, 0, 0, 0, EV_NOTIME);
- }
-#endif
- break;
+ {
+ DRAWITEMSTRUCT *pItemStruct;
+
+ pItemStruct = (DRAWITEMSTRUCT *)lParam;
+ enqEvent(0, pItemStruct->hwndItem, WM_DRAWITEM, wParam, 0, 0, 0, 0, EV_NOTIME);
+ }
+#endif
+ break;
#ifdef TRACE_ALL_EVENTS
- case WM_CTLCOLORMSGBOX:
- UNHANDLED_EVENT_PRINTF(("WM_CTLCOLORMSGBOX\n"));
- break;
- case WM_CTLCOLOREDIT:
- UNHANDLED_EVENT_PRINTF(("WM_CTLCOLOREDIT\n"));
- break;
- case WM_CTLCOLORLISTBOX:
- UNHANDLED_EVENT_PRINTF(("WM_CTLCOLORLISTBOX\n"));
- break;
- case WM_CTLCOLORBTN:
- UNHANDLED_EVENT_PRINTF(("WM_CTLCOLORBTN\n"));
- break;
- case WM_CTLCOLORDLG:
- UNHANDLED_EVENT_PRINTF(("WM_CTLCOLORDLG\n"));
- break;
- case WM_CTLCOLORSTATIC:
- UNHANDLED_EVENT_PRINTF(("WM_CTLCOLORSTATIC\n"));
- break;
- case WM_CTLCOLORSCROLLBAR:
- UNHANDLED_EVENT_PRINTFIF(__debug_WM_CTLCOLORSCROLLBAR__, ("WM_CTLCOLORSCROLLBAR\n"));
- break;
-
- case WM_STYLECHANGING:
- UNHANDLED_EVENT_PRINTF(("WM_STYLECHANGING\n"));
- break;
- case WM_STYLECHANGED:
- UNHANDLED_EVENT_PRINTF(("WM_STYLECHANGED\n"));
- break;
-
- case WM_GETICON:
- UNHANDLED_EVENT_PRINTFIF(__debug_WM_GETICON__, ("WM_GETICON\n"));
- break;
- case WM_SETICON:
- UNHANDLED_EVENT_PRINTF(("WM_SETICON\n"));
- break;
-
- case WM_PRINT:
- UNHANDLED_EVENT_PRINTF(("WM_PRINT(lParam=%d)\n", lParam));
- break;
- case WM_PRINTCLIENT:
- UNHANDLED_EVENT_PRINTF(("WM_PRINTCLIENT(lParam=%d)\n", lParam));
- break;
-
- case WM_NULL:
- UNHANDLED_EVENT_PRINTF(("WM_NULL\n"));
- break;
-
- case WM_ENABLE:
- UNHANDLED_EVENT_PRINTF(("WM_ENABLE\n"));
- break;
-
- case WM_SETREDRAW:
- UNHANDLED_EVENT_PRINTF(("WM_SETREDRAW\n"));
- break;
-
- case WM_DEVMODECHANGE:
- UNHANDLED_EVENT_PRINTF(("WM_DEVMODECHANGE\n"));
- break;
-
- case WM_TIMECHANGE:
- UNHANDLED_EVENT_PRINTF(("WM_TIMECHANGE\n"));
- break;
-
- case WM_CANCELMODE:
- UNHANDLED_EVENT_PRINTF(("WM_CANCELMODE\n"));
- break;
-
- case WM_CHILDACTIVATE:
- UNHANDLED_EVENT_PRINTF(("WM_CHILDACTIVATE\n"));
- break;
-
- case WM_QUEUESYNC:
- UNHANDLED_EVENT_PRINTF(("WM_QUEUESYNC\n"));
- break;
-
- case WM_NEXTDLGCTL:
- UNHANDLED_EVENT_PRINTF(("WM_NEXTDLGCTL\n"));
- break;
-
- case WM_SPOOLERSTATUS:
- UNHANDLED_EVENT_PRINTF(("WM_SPOOLERSTATUS\n"));
- break;
-
- case WM_MEASUREITEM:
- UNHANDLED_EVENT_PRINTF(("WM_MEASUREITEM\n"));
- break;
-
- case WM_DELETEITEM:
- UNHANDLED_EVENT_PRINTF(("WM_DELETEITEM\n"));
- break;
-
- case WM_VKEYTOITEM:
- UNHANDLED_EVENT_PRINTF(("WM_VKEYTOITEM\n"));
- break;
-
- case WM_CHARTOITEM:
- UNHANDLED_EVENT_PRINTF(("WM_CHARTOITEM\n"));
- break;
-
- case WM_SETFONT:
- UNHANDLED_EVENT_PRINTF(("WM_SETFONT\n"));
- break;
-
- case WM_GETFONT:
- UNHANDLED_EVENT_PRINTF(("WM_GETFONT\n"));
- break;
-
- case WM_SETHOTKEY:
- UNHANDLED_EVENT_PRINTF(("WM_SETHOTKEY\n"));
- break;
-
- case WM_GETHOTKEY:
- UNHANDLED_EVENT_PRINTF(("WM_GETHOTKEY\n"));
- break;
-
- case WM_QUERYDRAGICON:
- UNHANDLED_EVENT_PRINTF(("WM_QUERYDRAGICON\n"));
- break;
-
- case WM_COMPAREITEM:
- UNHANDLED_EVENT_PRINTF(("WM_COMPAREITEM\n"));
- break;
-
- case WM_GETOBJECT:
- UNHANDLED_EVENT_PRINTF(("WM_GETOBJECT\n"));
- break;
-
- case WM_COMPACTING:
- UNHANDLED_EVENT_PRINTF(("WM_COMPACTING\n"));
- break;
-
- case WM_COMMNOTIFY:
- UNHANDLED_EVENT_PRINTF(("WM_COMMNOTIFY\n"));
- break;
-
- case WM_CANCELJOURNAL:
- UNHANDLED_EVENT_PRINTF(("WM_CANCELJOURNAL\n"));
- break;
-
- case WM_INPUTLANGCHANGEREQUEST:
- UNHANDLED_EVENT_PRINTF(("WM_INPUTLANGCHANGEREQUEST\n"));
- break;
-
- case WM_INPUTLANGCHANGE:
- UNHANDLED_EVENT_PRINTF(("WM_INPUTLANGCHANGE\n"));
- break;
-
- case WM_TCARD:
- UNHANDLED_EVENT_PRINTF(("WM_TCARD\n"));
- break;
-
- case WM_HELP:
- UNHANDLED_EVENT_PRINTF(("WM_HELP\n"));
- break;
-
- case WM_USERCHANGED:
- UNHANDLED_EVENT_PRINTF(("WM_USERCHANGED\n"));
- break;
-
- case WM_NOTIFY:
- UNHANDLED_EVENT_PRINTF(("WM_NOTIFY\n"));
- break;
-
- case WM_NOTIFYFORMAT:
- UNHANDLED_EVENT_PRINTF(("WM_NOTIFYFORMAT\n"));
- break;
-
- case WM_CONTEXTMENU:
- UNHANDLED_EVENT_PRINTF(("WM_CONTEXTMENU\n"));
- break;
-
- case WM_NCXBUTTONDOWN:
- UNHANDLED_EVENT_PRINTF(("WM_NCXBUTTONDOWN\n"));
- break;
-
- case WM_NCXBUTTONUP:
- UNHANDLED_EVENT_PRINTF(("WM_NCXBUTTONUP\n"));
- break;
-
- case WM_NCXBUTTONDBLCLK:
- UNHANDLED_EVENT_PRINTF(("WM_NCXBUTTONDBLCLK\n"));
- break;
-
- case WM_DEVICECHANGE:
- UNHANDLED_EVENT_PRINTF(("WM_DEVICECHANGE\n"));
- break;
-
-#endif
-
- default:
- EVENT_PRINTF(( "WinWorkstat [info] unhandled msg = %d 0x%x [%d]\n", message, message, __LINE__));
- break;
+ case WM_CTLCOLORMSGBOX:
+ UNHANDLED_EVENT_PRINTF(("WM_CTLCOLORMSGBOX\n"));
+ break;
+ case WM_CTLCOLOREDIT:
+ UNHANDLED_EVENT_PRINTF(("WM_CTLCOLOREDIT\n"));
+ break;
+ case WM_CTLCOLORLISTBOX:
+ UNHANDLED_EVENT_PRINTF(("WM_CTLCOLORLISTBOX\n"));
+ break;
+ case WM_CTLCOLORBTN:
+ UNHANDLED_EVENT_PRINTF(("WM_CTLCOLORBTN\n"));
+ break;
+ case WM_CTLCOLORDLG:
+ UNHANDLED_EVENT_PRINTF(("WM_CTLCOLORDLG\n"));
+ break;
+ case WM_CTLCOLORSTATIC:
+ UNHANDLED_EVENT_PRINTF(("WM_CTLCOLORSTATIC\n"));
+ break;
+ case WM_CTLCOLORSCROLLBAR:
+ UNHANDLED_EVENT_PRINTFIF(__debug_WM_CTLCOLORSCROLLBAR__, ("WM_CTLCOLORSCROLLBAR\n"));
+ break;
+
+ case WM_STYLECHANGING:
+ UNHANDLED_EVENT_PRINTF(("WM_STYLECHANGING\n"));
+ break;
+ case WM_STYLECHANGED:
+ UNHANDLED_EVENT_PRINTF(("WM_STYLECHANGED\n"));
+ break;
+
+ case WM_GETICON:
+ UNHANDLED_EVENT_PRINTFIF(__debug_WM_GETICON__, ("WM_GETICON\n"));
+ break;
+ case WM_SETICON:
+ UNHANDLED_EVENT_PRINTF(("WM_SETICON\n"));
+ break;
+
+ case WM_PRINT:
+ UNHANDLED_EVENT_PRINTF(("WM_PRINT(lParam=%d)\n", lParam));
+ break;
+ case WM_PRINTCLIENT:
+ UNHANDLED_EVENT_PRINTF(("WM_PRINTCLIENT(lParam=%d)\n", lParam));
+ break;
+
+ case WM_NULL:
+ UNHANDLED_EVENT_PRINTF(("WM_NULL\n"));
+ break;
+
+ case WM_ENABLE:
+ UNHANDLED_EVENT_PRINTF(("WM_ENABLE\n"));
+ break;
+
+ case WM_SETREDRAW:
+ UNHANDLED_EVENT_PRINTF(("WM_SETREDRAW\n"));
+ break;
+
+ case WM_DEVMODECHANGE:
+ UNHANDLED_EVENT_PRINTF(("WM_DEVMODECHANGE\n"));
+ break;
+
+ case WM_TIMECHANGE:
+ UNHANDLED_EVENT_PRINTF(("WM_TIMECHANGE\n"));
+ break;
+
+ case WM_CANCELMODE:
+ UNHANDLED_EVENT_PRINTF(("WM_CANCELMODE\n"));
+ break;
+
+ case WM_CHILDACTIVATE:
+ UNHANDLED_EVENT_PRINTF(("WM_CHILDACTIVATE\n"));
+ break;
+
+ case WM_QUEUESYNC:
+ UNHANDLED_EVENT_PRINTF(("WM_QUEUESYNC\n"));
+ break;
+
+ case WM_NEXTDLGCTL:
+ UNHANDLED_EVENT_PRINTF(("WM_NEXTDLGCTL\n"));
+ break;
+
+ case WM_SPOOLERSTATUS:
+ UNHANDLED_EVENT_PRINTF(("WM_SPOOLERSTATUS\n"));
+ break;
+
+ case WM_MEASUREITEM:
+ UNHANDLED_EVENT_PRINTF(("WM_MEASUREITEM\n"));
+ break;
+
+ case WM_DELETEITEM:
+ UNHANDLED_EVENT_PRINTF(("WM_DELETEITEM\n"));
+ break;
+
+ case WM_VKEYTOITEM:
+ UNHANDLED_EVENT_PRINTF(("WM_VKEYTOITEM\n"));
+ break;
+
+ case WM_CHARTOITEM:
+ UNHANDLED_EVENT_PRINTF(("WM_CHARTOITEM\n"));
+ break;
+
+ case WM_SETFONT:
+ UNHANDLED_EVENT_PRINTF(("WM_SETFONT\n"));
+ break;
+
+ case WM_GETFONT:
+ UNHANDLED_EVENT_PRINTF(("WM_GETFONT\n"));
+ break;
+
+ case WM_SETHOTKEY:
+ UNHANDLED_EVENT_PRINTF(("WM_SETHOTKEY\n"));
+ break;
+
+ case WM_GETHOTKEY:
+ UNHANDLED_EVENT_PRINTF(("WM_GETHOTKEY\n"));
+ break;
+
+ case WM_QUERYDRAGICON:
+ UNHANDLED_EVENT_PRINTF(("WM_QUERYDRAGICON\n"));
+ break;
+
+ case WM_COMPAREITEM:
+ UNHANDLED_EVENT_PRINTF(("WM_COMPAREITEM\n"));
+ break;
+
+ case WM_GETOBJECT:
+ UNHANDLED_EVENT_PRINTF(("WM_GETOBJECT\n"));
+ break;
+
+ case WM_COMPACTING:
+ UNHANDLED_EVENT_PRINTF(("WM_COMPACTING\n"));
+ break;
+
+ case WM_COMMNOTIFY:
+ UNHANDLED_EVENT_PRINTF(("WM_COMMNOTIFY\n"));
+ break;
+
+ case WM_CANCELJOURNAL:
+ UNHANDLED_EVENT_PRINTF(("WM_CANCELJOURNAL\n"));
+ break;
+
+ case WM_INPUTLANGCHANGEREQUEST:
+ UNHANDLED_EVENT_PRINTF(("WM_INPUTLANGCHANGEREQUEST\n"));
+ break;
+
+ case WM_INPUTLANGCHANGE:
+ UNHANDLED_EVENT_PRINTF(("WM_INPUTLANGCHANGE\n"));
+ break;
+
+ case WM_TCARD:
+ UNHANDLED_EVENT_PRINTF(("WM_TCARD\n"));
+ break;
+
+ case WM_HELP:
+ UNHANDLED_EVENT_PRINTF(("WM_HELP\n"));
+ break;
+
+ case WM_USERCHANGED:
+ UNHANDLED_EVENT_PRINTF(("WM_USERCHANGED\n"));
+ break;
+
+ case WM_NOTIFY:
+ UNHANDLED_EVENT_PRINTF(("WM_NOTIFY\n"));
+ break;
+
+ case WM_NOTIFYFORMAT:
+ UNHANDLED_EVENT_PRINTF(("WM_NOTIFYFORMAT\n"));
+ break;
+
+ case WM_CONTEXTMENU:
+ UNHANDLED_EVENT_PRINTF(("WM_CONTEXTMENU\n"));
+ break;
+
+ case WM_NCXBUTTONDOWN:
+ UNHANDLED_EVENT_PRINTF(("WM_NCXBUTTONDOWN\n"));
+ break;
+
+ case WM_NCXBUTTONUP:
+ UNHANDLED_EVENT_PRINTF(("WM_NCXBUTTONUP\n"));
+ break;
+
+ case WM_NCXBUTTONDBLCLK:
+ UNHANDLED_EVENT_PRINTF(("WM_NCXBUTTONDBLCLK\n"));
+ break;
+
+ case WM_DEVICECHANGE:
+ UNHANDLED_EVENT_PRINTF(("WM_DEVICECHANGE\n"));
+ break;
+
+#endif
+
+ default:
+ EVENT_PRINTF(( "WinWorkstat [info] unhandled msg = %d 0x%x [%d]\n", message, message, __LINE__));
+ break;
}
return 0;
}
@@ -4447,7 +4451,7 @@
#if 0
if (AttachThreadInput(_masterThreadId, _dispatchThreadId2, TRUE) != TRUE) {
- console_fprintf(stderr, "WinWorkstation [warning]: AttachThreadInput failed\n");
+ console_fprintf(stderr, "WinWorkstation [warning]: AttachThreadInput failed\n");
};
#endif
#ifndef WIN32THREADS
@@ -4461,20 +4465,20 @@
/* allocate localMemory for Window */
lI = (localWindowInfo *)malloc(sizeof(localWindowInfo));
if (lI) {
- memset(lI, 0, sizeof(*lI));
+ memset(lI, 0, sizeof(*lI));
}
__rootWinSpezial = CreateWindowExW(WS_EX_TOOLWINDOW | WS_EX_TRANSPARENT,
- wapp_nameRoot, wapp_nameRoot,
- WS_POPUP | WS_DISABLED,
- 0, 0,
- rect.right - rect.left, rect.bottom - rect.top,
- 0, 0, (HANDLE) __getHInstance(), lI);
+ wapp_nameRoot, wapp_nameRoot,
+ WS_POPUP | WS_DISABLED,
+ 0, 0,
+ rect.right - rect.left, rect.bottom - rect.top,
+ 0, 0, (HANDLE) __getHInstance(), lI);
//ShowWindow(__rootWinSpezial,SW_SHOWNOACTIVATE);
SetWindowPos(__rootWinSpezial, HWND_BOTTOM, 0, 0, 0, 0,
- SWP_NOSENDCHANGING |
- SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
+ SWP_NOSENDCHANGING |
+ SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
#ifdef STARTUP_DISPATCHTHREAD_DEBUG
console_fprintf(stderr, "WinWorkstation [info]: setting ThreadRunningEvent\n");
@@ -4482,273 +4486,273 @@
SetEvent(hDispatchThreadRunningEvent);
for (;;) {
- HANDLE dummy;
-
- TH_DPRINTF(("TG %d\n", th_calls++));
-
- /*
- * if there is no current capture (pointer-grab),
- * make certain that we do not get stuck in the GetMessage
- * but instead poll the mouse in 200ms intervals.
- * This is required to synthesize the MOUSELEAVE message,
- */
+ HANDLE dummy;
+
+ TH_DPRINTF(("TG %d\n", th_calls++));
+
+ /*
+ * if there is no current capture (pointer-grab),
+ * make certain that we do not get stuck in the GetMessage
+ * but instead poll the mouse in 200ms intervals.
+ * This is required to synthesize the MOUSELEAVE message,
+ */
DPRINTF(("X1\n"));
- if (__currentPointerView && (__currentCapture == CAPTURE_NONE)) {
+ if (__currentPointerView && (__currentCapture == CAPTURE_NONE)) {
DPRINTF(("X2\n"));
- while (PeekMessageW(&msg, 0, 0, 0, PM_NOREMOVE) == 0) {
+ while (PeekMessageW(&msg, 0, 0, 0, PM_NOREMOVE) == 0) {
DPRINTF(("PeekMessage -> 0\n"));
- /*
- * wait for an event; timeout after 200 millis
- */
- if (MsgWaitForMultipleObjects(0,&dummy,FALSE,200,QS_ALLINPUT) == WAIT_TIMEOUT) {
- if (! inSizeMove) {
- /*
- * timeout - see where mouse pointer is
- * for synthetic leave events.
- */
- POINT point;
-
- if (GetCursorPos(&point)) {
- HWND hWnd = WindowFromPoint(point);
-
- if (hWnd) {
- if (GetWindowThreadProcessId(hWnd,0) != GetCurrentThreadId()) {
- if (inSizeMove) {
- if (needDelayedMouseLeaveWindow == NULL) {
- needDelayedMouseLeaveWindow = __currentPointerView;
- }
- } else {
- if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask) {
- enqEvent(LeaveWindowMask, __currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, getModifiers(), EV_NOTIME);
- SetWindow_mouseXY(__currentPointerView, -9999, -9999);
- }
- }
- __currentPointerView = 0;
- break;
- }
- }
- }
- }
- }
- }
- }
-
- GetMessageW(&msg, NULL, 0, 0);
+ /*
+ * wait for an event; timeout after 200 millis
+ */
+ if (MsgWaitForMultipleObjects(0,&dummy,FALSE,200,QS_ALLINPUT) == WAIT_TIMEOUT) {
+ if (! inSizeMove) {
+ /*
+ * timeout - see where mouse pointer is
+ * for synthetic leave events.
+ */
+ POINT point;
+
+ if (GetCursorPos(&point)) {
+ HWND hWnd = WindowFromPoint(point);
+
+ if (hWnd) {
+ if (GetWindowThreadProcessId(hWnd,0) != GetCurrentThreadId()) {
+ if (inSizeMove) {
+ if (needDelayedMouseLeaveWindow == NULL) {
+ needDelayedMouseLeaveWindow = __currentPointerView;
+ }
+ } else {
+ if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask) {
+ enqEvent(LeaveWindowMask, __currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, getModifiers(), EV_NOTIME);
+ SetWindow_mouseXY(__currentPointerView, -9999, -9999);
+ }
+ }
+ __currentPointerView = 0;
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ GetMessageW(&msg, NULL, 0, 0);
DPRINTF(("GetMessage -> %d\n", msg.message));
- TH_DPRINTF(("TD %d\n", th_calls++));
- destroyWin = 0;
-
- switch (msg.message) {
+ TH_DPRINTF(("TD %d\n", th_calls++));
+ destroyWin = 0;
+
+ switch (msg.message) {
#if 0
- case WM_THREAD_DESTROYWINDOW:
- destroyWin = TRUE;
- msg.message = WM_CLOSE;
- EVENT_PRINTF(("thread WM_THREAD_DESTROYWINDOW %x\n",msg.hwnd));
- break;
+ case WM_THREAD_DESTROYWINDOW:
+ destroyWin = TRUE;
+ msg.message = WM_CLOSE;
+ EVENT_PRINTF(("thread WM_THREAD_DESTROYWINDOW %x\n",msg.hwnd));
+ break;
#endif
#ifdef SET_FOCUS_IN_WINTHREAD
- case WM_THREAD_SETFOCUS:
+ case WM_THREAD_SETFOCUS:
# ifdef xxWIN32THREADS
- if (msg.lParam) {
- if (AttachThreadInput(_dispatchThreadId2,msg.lParam,TRUE) == FALSE)
- PRINTF(("SetFocus AttachThreadInput error %d\n", GetLastError()));
- }
+ if (msg.lParam) {
+ if (AttachThreadInput(_dispatchThreadId2,msg.lParam,TRUE) == FALSE)
+ PRINTF(("SetFocus AttachThreadInput error %d\n", GetLastError()));
+ }
# endif
- EVENT_PRINTF(("threadSetfocus %x\n",msg.wParam));
- if (SetFocus((HWND)msg.wParam) == 0) {
- DDPRINTF(("SetFocus to %x failed.\n",msg.wParam));
- }
- continue;
+ EVENT_PRINTF(("threadSetfocus %x\n",msg.wParam));
+ if (SetFocus((HWND)msg.wParam) == 0) {
+ DDPRINTF(("SetFocus to %x failed.\n",msg.wParam));
+ }
+ continue;
#endif
#ifdef SET_CURSOR_IN_WINTHREAD
- case WM_THREAD_SETCURSOR:
- if (msg.lParam) {
+ case WM_THREAD_SETCURSOR:
+ if (msg.lParam) {
#if 1
- SetCursor((HCURSOR)msg.lParam);
-#else
- /* this check is done by our sender */
- {
- POINT p;
- GetCursorPos(&p);
- if (WindowFromPoint(p) == msg.hwnd) {
- EVENT_PRINTF(("threadSetCursor %x\n",msg.lParam));
- SetCursor((HCURSOR)msg.lParam);
- }
- }
-#endif
- }
- continue;
+ SetCursor((HCURSOR)msg.lParam);
+#else
+ /* this check is done by our sender */
+ {
+ POINT p;
+ GetCursorPos(&p);
+ if (WindowFromPoint(p) == msg.hwnd) {
+ EVENT_PRINTF(("threadSetCursor %x\n",msg.lParam));
+ SetCursor((HCURSOR)msg.lParam);
+ }
+ }
+#endif
+ }
+ continue;
#endif
#ifdef BEEP_IN_WINTHREAD
- case WM_THREAD_BEEP:
- MessageBeep( MB_ICONEXCLAMATION);
- continue;
-#endif
-
- case WM_THREAD_SETCAPTURE:
- if (msg.wParam) {
- if (__currentPointerView) {
- if (inSizeMove) {
- if (needDelayedMouseLeaveWindow == NULL) {
- needDelayedMouseLeaveWindow = __currentPointerView;
- }
- } else {
- if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask) {
- enqEvent(LeaveWindowMask, __currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, getModifiers(), EV_NOTIME);
- SetWindow_mouseXY(__currentPointerView, -9999, -9999);
- }
- }
- }
-
- __currentPointerView = (HWND)msg.wParam;
- __currentCapture = CAPTURE_EXPLICIT;
- EVENT_PRINTF(("threadSetCapture %x\n",msg.wParam));
- SetCapture(__currentPointerView);
- } else {
- if (__currentPointerView == __rootWinSpezial) {
- //ShowWindow(__rootWinSpezial, SW_HIDE);
- SetWindowPos(__rootWinSpezial, HWND_BOTTOM, 0, 0, 0, 0,
- SWP_NOREDRAW | SWP_NOSENDCHANGING | SWP_NOCOPYBITS
- | SWP_HIDEWINDOW | SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE
- /*| SWP_NOZORDER | SWP_NOOWNERZORDER */);
- }
- __currentPointerView = 0;
- __currentCapture = CAPTURE_NONE;
- EVENT_PRINTF(("threadReleaseCapture\n"));
- ReleaseCapture();
- }
- if (msg.lParam) {
- DDPRINTF(("threadSetCursor %x\n",msg.lParam));
- SetCursor((HCURSOR)msg.lParam);
- }
- continue;
-
- case WM_THREAD_CREATEWINDOW:
- EVENT_PRINTF(("*WM_THREAD_CREATEWINDOW %d\n", th_calls));
-
- {
- createWindowInfo *cwi = (createWindowInfo *)(msg.lParam);
-
- if ((cwi->sequenceNr == msg.wParam)
- && (cwi->sequenceNr != INVALIDATED_CWI)) {
- cwi->sequenceNr = INVALIDATED_CWI;
- cwi->infoWasRead = 1;
- if (cwi->newWinHandle == NULL) {
- HANDLE ev;
-
- cwi->newWinHandle = CreateWindowExW(
- cwi->winStyleBitsEx,
- cwi->className,
- cwi->windowName,
- cwi->winStyleBits,
- cwi->x, cwi->y,
- cwi->dx, cwi->dy,
- cwi->parentHandle,
- NULL, /* menu */
- (HANDLE) __getHInstance(),
- cwi->localWindowInfo
- );
-
- if (cwi->newWinHandle == NULL) {
- cwi->errCode = GetLastError();
- console_fprintf(stderr, "WinWorkstation [info]: CreateWindow %s failed: %d (0x%x) [%d]\n",
- cwi->className, cwi->errCode, cwi->errCode, __LINE__);
- } else {
- SETLOCALWINDOWINFOPTR(cwi->newWinHandle, cwi->localWindowInfo);
+ case WM_THREAD_BEEP:
+ MessageBeep( MB_ICONEXCLAMATION);
+ continue;
+#endif
+
+ case WM_THREAD_SETCAPTURE:
+ if (msg.wParam) {
+ if (__currentPointerView) {
+ if (inSizeMove) {
+ if (needDelayedMouseLeaveWindow == NULL) {
+ needDelayedMouseLeaveWindow = __currentPointerView;
+ }
+ } else {
+ if (GetWindow_eventMask(__currentPointerView) & LeaveWindowMask) {
+ enqEvent(LeaveWindowMask, __currentPointerView, __WM_MOUSELEAVE, 0, -1, -1, 0, getModifiers(), EV_NOTIME);
+ SetWindow_mouseXY(__currentPointerView, -9999, -9999);
+ }
+ }
+ }
+
+ __currentPointerView = (HWND)msg.wParam;
+ __currentCapture = CAPTURE_EXPLICIT;
+ EVENT_PRINTF(("threadSetCapture %x\n",msg.wParam));
+ SetCapture(__currentPointerView);
+ } else {
+ if (__currentPointerView == __rootWinSpezial) {
+ //ShowWindow(__rootWinSpezial, SW_HIDE);
+ SetWindowPos(__rootWinSpezial, HWND_BOTTOM, 0, 0, 0, 0,
+ SWP_NOREDRAW | SWP_NOSENDCHANGING | SWP_NOCOPYBITS
+ | SWP_HIDEWINDOW | SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE
+ /*| SWP_NOZORDER | SWP_NOOWNERZORDER */);
+ }
+ __currentPointerView = 0;
+ __currentCapture = CAPTURE_NONE;
+ EVENT_PRINTF(("threadReleaseCapture\n"));
+ ReleaseCapture();
+ }
+ if (msg.lParam) {
+ DDPRINTF(("threadSetCursor %x\n",msg.lParam));
+ SetCursor((HCURSOR)msg.lParam);
+ }
+ continue;
+
+ case WM_THREAD_CREATEWINDOW:
+ EVENT_PRINTF(("*WM_THREAD_CREATEWINDOW %d\n", th_calls));
+
+ {
+ createWindowInfo *cwi = (createWindowInfo *)(msg.lParam);
+
+ if ((cwi->sequenceNr == msg.wParam)
+ && (cwi->sequenceNr != INVALIDATED_CWI)) {
+ cwi->sequenceNr = INVALIDATED_CWI;
+ cwi->infoWasRead = 1;
+ if (cwi->newWinHandle == NULL) {
+ HANDLE ev;
+
+ cwi->newWinHandle = CreateWindowExW(
+ cwi->winStyleBitsEx,
+ cwi->className,
+ cwi->windowName,
+ cwi->winStyleBits,
+ cwi->x, cwi->y,
+ cwi->dx, cwi->dy,
+ cwi->parentHandle,
+ NULL, /* menu */
+ (HANDLE) __getHInstance(),
+ cwi->localWindowInfo
+ );
+
+ if (cwi->newWinHandle == NULL) {
+ cwi->errCode = GetLastError();
+ console_fprintf(stderr, "WinWorkstation [info]: CreateWindow %s failed: %d (0x%x) [%d]\n",
+ cwi->className, cwi->errCode, cwi->errCode, __LINE__);
+ } else {
+ SETLOCALWINDOWINFOPTR(cwi->newWinHandle, cwi->localWindowInfo);
#ifdef DEBUG /* PARANOIA */
- if (GETLOCALWINDOWINFOPTR(cwi->newWinHandle) != cwi->localWindowInfo) {
- console_fprintf(stderr, "lI-Error\n");
- }
-#endif
- }
-
- ev = cwi->hCreateEvent;
- if (ev) {
- SetEvent(ev);
- }
- }
- } else {
- DPRINTF(("obsolete createWindow message %x ignored\n", cwi->sequenceNr));
- }
- }
- continue;
-
- case WM_KEYDOWN:
- DPRINTFIF(__debug_WM_KEYDOWN__ , ("WM_KEYDOWN %x\n", msg.wParam));
- goto commonKey;
-
- case WM_KEYUP:
- DPRINTFIF(__debug_WM_KEYUP__ , ("WM_KEYUP %x\n", msg.wParam));
- goto commonKey;
-
- case WM_SYSKEYDOWN:
- DPRINTFIF(__debug_WM_KEYDOWN__ , ("WM_SYSKEYDOWN %x\n", msg.wParam));
- goto commonKey;
-
- case WM_SYSKEYUP:
- DPRINTFIF(__debug_WM_KEYUP__ , ("WM_SYSKEYUP %x\n", msg.wParam));
- goto commonKey;
-
- commonKey:
+ if (GETLOCALWINDOWINFOPTR(cwi->newWinHandle) != cwi->localWindowInfo) {
+ console_fprintf(stderr, "lI-Error\n");
+ }
+#endif
+ }
+
+ ev = cwi->hCreateEvent;
+ if (ev) {
+ SetEvent(ev);
+ }
+ }
+ } else {
+ DPRINTF(("obsolete createWindow message %x ignored\n", cwi->sequenceNr));
+ }
+ }
+ continue;
+
+ case WM_KEYDOWN:
+ DPRINTFIF(__debug_WM_KEYDOWN__ , ("WM_KEYDOWN %x\n", msg.wParam));
+ goto commonKey;
+
+ case WM_KEYUP:
+ DPRINTFIF(__debug_WM_KEYUP__ , ("WM_KEYUP %x\n", msg.wParam));
+ goto commonKey;
+
+ case WM_SYSKEYDOWN:
+ DPRINTFIF(__debug_WM_KEYDOWN__ , ("WM_SYSKEYDOWN %x\n", msg.wParam));
+ goto commonKey;
+
+ case WM_SYSKEYUP:
+ DPRINTFIF(__debug_WM_KEYUP__ , ("WM_SYSKEYUP %x\n", msg.wParam));
+ goto commonKey;
+
+ commonKey:
#if 1
- if (((msg.wParam >= '0') && (msg.wParam <= 'Z'))
- || ((msg.wParam >= VK_MULTIPLY) && (msg.wParam <= VK_DIVIDE))
- || (msg.wParam == VK_SPACE)
- || (msg.wParam == VK_CAPITAL)
- /* || (msg.wParam == VK_SHIFT) */
- || (msg.wParam >= 0xB0))
-#endif
- {
- /*
- * translate to a WM_CHAR message
- */
- if (TranslateMessage(&msg))
- continue;
- }
- break;
-
- /* short cirquit some messages */
+ if (((msg.wParam >= '0') && (msg.wParam <= 'Z'))
+ || ((msg.wParam >= VK_MULTIPLY) && (msg.wParam <= VK_DIVIDE))
+ || (msg.wParam == VK_SPACE)
+ || (msg.wParam == VK_CAPITAL)
+ /* || (msg.wParam == VK_SHIFT) */
+ || (msg.wParam >= 0xB0))
+#endif
+ {
+ /*
+ * translate to a WM_CHAR message
+ */
+ if (TranslateMessage(&msg))
+ continue;
+ }
+ break;
+
+ /* short cirquit some messages */
#if 0
#ifndef SUPPORT_NATIVE_WINDOWS
- /*
- * some can simply be ignored ...
- */
- case WM_ERASEBKGND:
- EVENT_PRINTF(("*WM_ERASEBKGND\n"));
- continue;
- case WM_KILLFOCUS:
- EVENT_PRINTF(("*WM_KILLFOCUS\n"));
- continue;
+ /*
+ * some can simply be ignored ...
+ */
+ case WM_ERASEBKGND:
+ EVENT_PRINTF(("*WM_ERASEBKGND\n"));
+ continue;
+ case WM_KILLFOCUS:
+ EVENT_PRINTF(("*WM_KILLFOCUS\n"));
+ continue;
#endif
#endif
#if 0
- case WM_SIZE:
- EVENT_PRINTF(("*WM_SIZE\n"));
- continue;
-#endif
- }
-
- /*
- * common ...
- */
- evRootX = msg.pt.x;
- evRootY = msg.pt.y;
+ case WM_SIZE:
+ EVENT_PRINTF(("*WM_SIZE\n"));
+ continue;
+#endif
+ }
+
+ /*
+ * common ...
+ */
+ evRootX = msg.pt.x;
+ evRootY = msg.pt.y;
#if 1
- {
- POINT p;
-
- if (GetCursorPos(&p)) {
- evRootX = p.x;
- evRootY = p.y;
- }
- }
-#endif
- lastMSGTime = msg.time;
- DispatchMessageW(&msg); /* Dispatches message to window */
+ {
+ POINT p;
+
+ if (GetCursorPos(&p)) {
+ evRootX = p.x;
+ evRootY = p.y;
+ }
+ }
+#endif
+ lastMSGTime = msg.time;
+ DispatchMessageW(&msg); /* Dispatches message to window */
}
}
@@ -4769,20 +4773,20 @@
*/
cwi = pendingCREATEWINDOWInfo;
if (cwi) {
- int dummyWantDefault;
- int seqNr = pendingSequenceNr;
-
- pendingCREATEWINDOWInfo = 0;
- pendingSequenceNr = INVALIDATED_CWI;
- DPRINTF(("### THREAD_CREATEWINDOW\n"));
- winEventProcessing(0, WM_THREAD_CREATEWINDOW, seqNr, (LONG)cwi, &dummyWantDefault);
+ int dummyWantDefault;
+ int seqNr = pendingSequenceNr;
+
+ pendingCREATEWINDOWInfo = 0;
+ pendingSequenceNr = INVALIDATED_CWI;
+ DPRINTF(("### THREAD_CREATEWINDOW\n"));
+ winEventProcessing(0, WM_THREAD_CREATEWINDOW, seqNr, (LONG)cwi, &dummyWantDefault);
}
retVal = winEventProcessing(hWnd, message, wParam, lParam, &wantDefault);
if (wantDefault) {
- DDPRINTF((">>DefWindowProc\n"));
- retVal = DefWindowProcW(hWnd, message, wParam, lParam);
- DDPRINTF(("<<DefWindowProc\n"));
+ DDPRINTF((">>DefWindowProc\n"));
+ retVal = DefWindowProcW(hWnd, message, wParam, lParam);
+ DDPRINTF(("<<DefWindowProc\n"));
}
return retVal;
}
@@ -4790,19 +4794,19 @@
static int CALLBACK
EnumWindowsProc(HWND hwnd, LPARAM lParam)
{
- volatile OBJ *refToCollection;
- OBJ collection;
- OBJ wHandle;
-
- if (hwnd) {
- refToCollection = (OBJ*) lParam;
- __PROTECT__(*refToCollection);
- wHandle = __MKEXTERNALADDRESS(hwnd);
- __UNPROTECT__(*refToCollection);
- collection = *refToCollection;
- __SSEND1( collection, @symbol(add:), 0, wHandle );
- }
- return TRUE;
+ volatile OBJ *refToCollection;
+ OBJ collection;
+ OBJ wHandle;
+
+ if (hwnd) {
+ refToCollection = (OBJ*) lParam;
+ __PROTECT__(*refToCollection);
+ wHandle = __MKEXTERNALADDRESS(hwnd);
+ __UNPROTECT__(*refToCollection);
+ collection = *refToCollection;
+ __SSEND1( collection, @symbol(add:), 0, wHandle );
+ }
+ return TRUE;
}
#define xxUSE_EnumFontFamiliesEx
@@ -4810,34 +4814,34 @@
static int CALLBACK
EnumFPTypeFaceProc( lplf, lptm, dwType, lpData )
#ifdef USE_EnumFontFamiliesEx
- ENUMLOGFONTEX *lplf;
-#else
- LOGFONT *lplf;
-#endif
- TEXTMETRIC *lptm;
- DWORD dwType;
- LPARAM lpData;
+ ENUMLOGFONTEX *lplf;
+#else
+ LOGFONT *lplf;
+#endif
+ TEXTMETRIC *lptm;
+ DWORD dwType;
+ LPARAM lpData;
{
- OBJ t;
- volatile OBJ *refToList;
- OBJ typeFaceList;
- char *faceNameString;
-
- if (lplf) {
- refToList = (OBJ*) lpData;
- __PROTECT__(*refToList);
+ OBJ t;
+ volatile OBJ *refToList;
+ OBJ typeFaceList;
+ char *faceNameString;
+
+ if (lplf) {
+ refToList = (OBJ*) lpData;
+ __PROTECT__(*refToList);
#ifdef USE_EnumFontFamiliesEx
- faceNameString = lplf->elfLogFont.lfFaceName;
-#else
- faceNameString = lplf->lfFaceName;
-#endif
- t = __MKSTRING( faceNameString );
- __UNPROTECT__(*refToList);
- typeFaceList = *refToList;
- __SSEND1( typeFaceList, @symbol(add:), 0, t );
- }
- return 1;
+ faceNameString = lplf->elfLogFont.lfFaceName;
+#else
+ faceNameString = lplf->lfFaceName;
+#endif
+ t = __MKSTRING( faceNameString );
+ __UNPROTECT__(*refToList);
+ typeFaceList = *refToList;
+ __SSEND1( typeFaceList, @symbol(add:), 0, t );
+ }
+ return 1;
}
/*
@@ -4874,98 +4878,98 @@
OBJ s;
switch (charSet) {
- case ANSI_CHARSET:
- s = @symbol('ms-ansi');
- break;
- case DEFAULT_CHARSET:
- s = @symbol('ms-default');
- break;
- case SYMBOL_CHARSET:
- s = @symbol('ms-symbol');
- break;
- case SHIFTJIS_CHARSET:
- s = @symbol('ms-shiftjis');
- break;
- case GB2312_CHARSET:
- s = @symbol('ms-gb2312');
- break;
- case HANGEUL_CHARSET:
- s = @symbol('ms-hangeul');
- break;
+ case ANSI_CHARSET:
+ s = @symbol('ms-ansi');
+ break;
+ case DEFAULT_CHARSET:
+ s = @symbol('ms-default');
+ break;
+ case SYMBOL_CHARSET:
+ s = @symbol('ms-symbol');
+ break;
+ case SHIFTJIS_CHARSET:
+ s = @symbol('ms-shiftjis');
+ break;
+ case GB2312_CHARSET:
+ s = @symbol('ms-gb2312');
+ break;
+ case HANGEUL_CHARSET:
+ s = @symbol('ms-hangeul');
+ break;
# if defined(HANGUL_CHARSET) && (HANGUL_CHARSET != HANGEUL_CHARSET)
- case HANGUL_CHARSET:
- s = @symbol('ms-hangul');
- break;
+ case HANGUL_CHARSET:
+ s = @symbol('ms-hangul');
+ break;
# endif
- case CHINESEBIG5_CHARSET:
- s = @symbol('ms-chinesebig5');
- break;
- case OEM_CHARSET:
- s = @symbol('ms-oem');
- break;
+ case CHINESEBIG5_CHARSET:
+ s = @symbol('ms-chinesebig5');
+ break;
+ case OEM_CHARSET:
+ s = @symbol('ms-oem');
+ break;
# ifdef JOHAB_CHARSET
- case JOHAB_CHARSET:
- s = @symbol('ms-johab');
- break;
+ case JOHAB_CHARSET:
+ s = @symbol('ms-johab');
+ break;
# endif
# ifdef HEBREW_CHARSET
- case HEBREW_CHARSET:
- s = @symbol('ms-hebrew');
- break;
+ case HEBREW_CHARSET:
+ s = @symbol('ms-hebrew');
+ break;
# endif
# ifdef ARABIC_CHARSET
- case ARABIC_CHARSET:
- s = @symbol('ms-arabic');
- break;
+ case ARABIC_CHARSET:
+ s = @symbol('ms-arabic');
+ break;
# endif
# ifdef GREEK_CHARSET
- case GREEK_CHARSET:
- s = @symbol('ms-greek');
- break;
+ case GREEK_CHARSET:
+ s = @symbol('ms-greek');
+ break;
# endif
# ifdef TURKISH_CHARSET
- case TURKISH_CHARSET:
- s = @symbol('ms-turkish');
- break;
+ case TURKISH_CHARSET:
+ s = @symbol('ms-turkish');
+ break;
# endif
# ifdef RUSSIAN_CHARSET
- case RUSSIAN_CHARSET:
- s = @symbol('ms-russian');
- break;
+ case RUSSIAN_CHARSET:
+ s = @symbol('ms-russian');
+ break;
# endif
# ifdef EASTEUROPE_CHARSET
- case EASTEUROPE_CHARSET:
- s = @symbol('ms-easteurope');
- break;
+ case EASTEUROPE_CHARSET:
+ s = @symbol('ms-easteurope');
+ break;
# endif
# ifdef BALTIC_CHARSET
- case BALTIC_CHARSET:
- s = @symbol('ms-baltic');
- break;
+ case BALTIC_CHARSET:
+ s = @symbol('ms-baltic');
+ break;
# endif
# ifdef VIETNAMESE_CHARSET
- case VIETNAMESE_CHARSET:
- s = @symbol('ms-vietnamese');
- break;
+ case VIETNAMESE_CHARSET:
+ s = @symbol('ms-vietnamese');
+ break;
# endif
# ifdef THAI_CHARSET
- case THAI_CHARSET:
- s = @symbol('ms-thai');
- break;
+ case THAI_CHARSET:
+ s = @symbol('ms-thai');
+ break;
# endif
# ifdef MAC_CHARSET
- case MAC_CHARSET:
- s = @symbol('ms-mac');
- break;
+ case MAC_CHARSET:
+ s = @symbol('ms-mac');
+ break;
# endif
# ifdef UNICODE_CHARSET
- case UNICODE_CHARSET:
- s = @symbol('ms-unicode');
- break;
+ case UNICODE_CHARSET:
+ s = @symbol('ms-unicode');
+ break;
# endif
- default:
- s = @symbol(unknown);
- break;
+ default:
+ s = @symbol(unknown);
+ break;
}
return s;
}
@@ -4973,150 +4977,150 @@
OBJ
__extractLogicalFontParameters(LOGFONT *lplf)
{
- OBJ newArray, t;
- OBJ s;
-
- DPRINTF((" lfHeight %d\n", lplf->lfHeight ));
- DPRINTF((" lfWidth %d\n", lplf->lfWidth ));
- DPRINTF((" lfEscapement %d\n", lplf->lfEscapement ));
- DPRINTF((" lfOrientation %d\n", lplf->lfOrientation ));
- DPRINTF((" lfWeight %d\n", lplf->lfWeight ));
- DPRINTF((" lfItalic %d\n", lplf->lfItalic ));
- DPRINTF((" lfUnderline %d\n", lplf->lfUnderline ));
- DPRINTF((" lfStrikeOut %d\n", lplf->lfStrikeOut ));
- DPRINTF((" lfCharSet %d\n", lplf->lfCharSet ));
- DPRINTF((" lfOutPrecision %d\n", lplf->lfOutPrecision ));
- DPRINTF((" lfClipPrecision %d\n", lplf->lfClipPrecision ));
- DPRINTF((" lfQuality %d\n", lplf->lfQuality ));
- DPRINTF((" lfPitchAndFamily %d\n", lplf->lfPitchAndFamily ));
- DPRINTF((" lfFaceName %s\n\n", lplf->lfFaceName ));
-
- newArray = __ARRAY_NEW_INT(20);
-
- __ArrayInstPtr(newArray)->a_element[0] = __MKSMALLINT(lplf->lfHeight);
- __ArrayInstPtr(newArray)->a_element[1] = __MKSMALLINT(lplf->lfWidth);
- __ArrayInstPtr(newArray)->a_element[2] = __MKSMALLINT(lplf->lfEscapement);
- __ArrayInstPtr(newArray)->a_element[3] = __MKSMALLINT(lplf->lfOrientation);
- __ArrayInstPtr(newArray)->a_element[4] = __MKSMALLINT(lplf->lfWeight);
- switch (lplf->lfWeight) {
- case FW_HEAVY:
- case FW_EXTRABOLD:
- case FW_SEMIBOLD:
- case FW_BOLD:
- s = @symbol(bold);
- break;
- case FW_NORMAL:
+ OBJ newArray, t;
+ OBJ s;
+
+ DPRINTF((" lfHeight %d\n", lplf->lfHeight ));
+ DPRINTF((" lfWidth %d\n", lplf->lfWidth ));
+ DPRINTF((" lfEscapement %d\n", lplf->lfEscapement ));
+ DPRINTF((" lfOrientation %d\n", lplf->lfOrientation ));
+ DPRINTF((" lfWeight %d\n", lplf->lfWeight ));
+ DPRINTF((" lfItalic %d\n", lplf->lfItalic ));
+ DPRINTF((" lfUnderline %d\n", lplf->lfUnderline ));
+ DPRINTF((" lfStrikeOut %d\n", lplf->lfStrikeOut ));
+ DPRINTF((" lfCharSet %d\n", lplf->lfCharSet ));
+ DPRINTF((" lfOutPrecision %d\n", lplf->lfOutPrecision ));
+ DPRINTF((" lfClipPrecision %d\n", lplf->lfClipPrecision ));
+ DPRINTF((" lfQuality %d\n", lplf->lfQuality ));
+ DPRINTF((" lfPitchAndFamily %d\n", lplf->lfPitchAndFamily ));
+ DPRINTF((" lfFaceName %s\n\n", lplf->lfFaceName ));
+
+ newArray = __ARRAY_NEW_INT(20);
+
+ __ArrayInstPtr(newArray)->a_element[0] = __MKSMALLINT(lplf->lfHeight);
+ __ArrayInstPtr(newArray)->a_element[1] = __MKSMALLINT(lplf->lfWidth);
+ __ArrayInstPtr(newArray)->a_element[2] = __MKSMALLINT(lplf->lfEscapement);
+ __ArrayInstPtr(newArray)->a_element[3] = __MKSMALLINT(lplf->lfOrientation);
+ __ArrayInstPtr(newArray)->a_element[4] = __MKSMALLINT(lplf->lfWeight);
+ switch (lplf->lfWeight) {
+ case FW_HEAVY:
+ case FW_EXTRABOLD:
+ case FW_SEMIBOLD:
+ case FW_BOLD:
+ s = @symbol(bold);
+ break;
+ case FW_NORMAL:
#if 0
- s = @symbol(normal);
- break;
-#endif
- case FW_MEDIUM:
- s = @symbol(medium);
- break;
- case FW_THIN:
- case FW_EXTRALIGHT:
- case FW_LIGHT:
- s = @symbol(demi);
- break;
- default:
- s = @symbol(other);
- break;
- }
- __ArrayInstPtr(newArray)->a_element[5] = s; __STORE(newArray, s);
- __ArrayInstPtr(newArray)->a_element[6] = __MKSMALLINT(lplf->lfItalic);
- __ArrayInstPtr(newArray)->a_element[7] = __MKSMALLINT(lplf->lfUnderline);
- __ArrayInstPtr(newArray)->a_element[8] = __MKSMALLINT(lplf->lfStrikeOut);
- __ArrayInstPtr(newArray)->a_element[9] = __MKSMALLINT(lplf->lfCharSet);
- __ArrayInstPtr(newArray)->a_element[10] = __MKSMALLINT(lplf->lfOutPrecision);
- __ArrayInstPtr(newArray)->a_element[11] = __MKSMALLINT(lplf->lfClipPrecision);
- __ArrayInstPtr(newArray)->a_element[12] = __MKSMALLINT(lplf->lfQuality);
- __ArrayInstPtr(newArray)->a_element[13] = __MKSMALLINT(lplf->lfPitchAndFamily);
- /* ... */
-
- if( lplf->lfItalic == TRUE ) {
- if( lplf->lfUnderline == TRUE ) {
- if( lplf->lfStrikeOut == TRUE ) {
- s = @symbol('italic-underline-strikeOut');
- } else {
- s = @symbol('italic-underline');
- }
- } else {
- if( lplf->lfStrikeOut == TRUE ) {
- s = @symbol('italic-strikeOut');
- } else {
- s = @symbol('italic');
- }
- }
- } else {
- if( lplf->lfUnderline == TRUE ) {
- if( lplf->lfStrikeOut == TRUE ) {
- s = @symbol('roman-underline-strikeOut');
- } else {
- s = @symbol('roman-underline');
- }
- } else {
- if( lplf->lfStrikeOut == TRUE ) {
- s = @symbol('roman-strikeOut');
- } else {
- s = @symbol('roman');
- }
- }
- }
- __ArrayInstPtr(newArray)->a_element[14] = s; __STORE(newArray, s);
-
- __PROTECT__(newArray);
- t = __MKSTRING(lplf->lfFaceName);
- __UNPROTECT__(newArray);
- __ArrayInstPtr(newArray)->a_element[15] = t; __STORE(newArray, t);
-
- t = __charSetSymbolFor(lplf->lfCharSet);
- __ArrayInstPtr(newArray)->a_element[16] = t; __STORE(newArray, t);
-
- return newArray;
+ s = @symbol(normal);
+ break;
+#endif
+ case FW_MEDIUM:
+ s = @symbol(medium);
+ break;
+ case FW_THIN:
+ case FW_EXTRALIGHT:
+ case FW_LIGHT:
+ s = @symbol(demi);
+ break;
+ default:
+ s = @symbol(other);
+ break;
+ }
+ __ArrayInstPtr(newArray)->a_element[5] = s; __STORE(newArray, s);
+ __ArrayInstPtr(newArray)->a_element[6] = __MKSMALLINT(lplf->lfItalic);
+ __ArrayInstPtr(newArray)->a_element[7] = __MKSMALLINT(lplf->lfUnderline);
+ __ArrayInstPtr(newArray)->a_element[8] = __MKSMALLINT(lplf->lfStrikeOut);
+ __ArrayInstPtr(newArray)->a_element[9] = __MKSMALLINT(lplf->lfCharSet);
+ __ArrayInstPtr(newArray)->a_element[10] = __MKSMALLINT(lplf->lfOutPrecision);
+ __ArrayInstPtr(newArray)->a_element[11] = __MKSMALLINT(lplf->lfClipPrecision);
+ __ArrayInstPtr(newArray)->a_element[12] = __MKSMALLINT(lplf->lfQuality);
+ __ArrayInstPtr(newArray)->a_element[13] = __MKSMALLINT(lplf->lfPitchAndFamily);
+ /* ... */
+
+ if( lplf->lfItalic == TRUE ) {
+ if( lplf->lfUnderline == TRUE ) {
+ if( lplf->lfStrikeOut == TRUE ) {
+ s = @symbol('italic-underline-strikeOut');
+ } else {
+ s = @symbol('italic-underline');
+ }
+ } else {
+ if( lplf->lfStrikeOut == TRUE ) {
+ s = @symbol('italic-strikeOut');
+ } else {
+ s = @symbol('italic');
+ }
+ }
+ } else {
+ if( lplf->lfUnderline == TRUE ) {
+ if( lplf->lfStrikeOut == TRUE ) {
+ s = @symbol('roman-underline-strikeOut');
+ } else {
+ s = @symbol('roman-underline');
+ }
+ } else {
+ if( lplf->lfStrikeOut == TRUE ) {
+ s = @symbol('roman-strikeOut');
+ } else {
+ s = @symbol('roman');
+ }
+ }
+ }
+ __ArrayInstPtr(newArray)->a_element[14] = s; __STORE(newArray, s);
+
+ __PROTECT__(newArray);
+ t = __MKSTRING(lplf->lfFaceName);
+ __UNPROTECT__(newArray);
+ __ArrayInstPtr(newArray)->a_element[15] = t; __STORE(newArray, t);
+
+ t = __charSetSymbolFor(lplf->lfCharSet);
+ __ArrayInstPtr(newArray)->a_element[16] = t; __STORE(newArray, t);
+
+ return newArray;
}
static int CALLBACK
EnumFontsProc( lplf, lptm, dwType, lpData )
#ifdef USE_EnumFontFamiliesEx
- ENUMLOGFONTEX *lplf;
-#else
- LOGFONT *lplf; /* ptr to of logical-font data */
-#endif
- TEXTMETRIC *lptm; /* ptr to physical font data */
- DWORD dwType; /* font type */
- LPARAM lpData; /* application supplied data */
+ ENUMLOGFONTEX *lplf;
+#else
+ LOGFONT *lplf; /* ptr to of logical-font data */
+#endif
+ TEXTMETRIC *lptm; /* ptr to physical font data */
+ DWORD dwType; /* font type */
+ LPARAM lpData; /* application supplied data */
{
- volatile OBJ *refToList;
- OBJ list;
- OBJ infoArray;
- OBJ *fullName;
-
- DPRINTF(("EnumFontsProc\n"));
-
- if ( lplf ) {
- refToList = (OBJ*) lpData;
-
- __PROTECT__(*refToList);
+ volatile OBJ *refToList;
+ OBJ list;
+ OBJ infoArray;
+ OBJ *fullName;
+
+ DPRINTF(("EnumFontsProc\n"));
+
+ if ( lplf ) {
+ refToList = (OBJ*) lpData;
+
+ __PROTECT__(*refToList);
#ifdef USE_EnumFontFamiliesEx
- infoArray = __extractLogicalFontParameters(lplf->elfLogFont);
- __PROTECT__(infoArray);
- fullName = __MKSTRING(lplf->elfFullName);
- __UNPROTECT__(infoArray);
- __ArrayInstPtr(infoArray)->a_element[17] = fullName; __STORE(infoArray, fullName);
-#else
- infoArray = __extractLogicalFontParameters(lplf);
-#endif
-
- __UNPROTECT__(*refToList);
-
- if ( dwType & TRUETYPE_FONTTYPE ) {
- /* change height to 0 to mark variable fonts */
- __ArrayInstPtr(infoArray)->a_element[0] = __MKSMALLINT(0);
- }
- list = *refToList;
- __SSEND1(list, @symbol(add:), 0, infoArray);
- }
- return 1;
+ infoArray = __extractLogicalFontParameters(lplf->elfLogFont);
+ __PROTECT__(infoArray);
+ fullName = __MKSTRING(lplf->elfFullName);
+ __UNPROTECT__(infoArray);
+ __ArrayInstPtr(infoArray)->a_element[17] = fullName; __STORE(infoArray, fullName);
+#else
+ infoArray = __extractLogicalFontParameters(lplf);
+#endif
+
+ __UNPROTECT__(*refToList);
+
+ if ( dwType & TRUETYPE_FONTTYPE ) {
+ /* change height to 0 to mark variable fonts */
+ __ArrayInstPtr(infoArray)->a_element[0] = __MKSMALLINT(0);
+ }
+ list = *refToList;
+ __SSEND1(list, @symbol(add:), 0, infoArray);
+ }
+ return 1;
}
%}
@@ -11346,961 +11350,961 @@
eB = __INST(eventBuffer);
if (__isByteArray(eB)) {
- ev = (struct queuedEvent *)(__ByteArrayInstPtr(eB)->ba_element);
+ ev = (struct queuedEvent *)(__ByteArrayInstPtr(eB)->ba_element);
} else {
- console_fprintf(stderr, "WinWorkstation [error]: no eventBuffer\n");
- RETURN (false);
+ console_fprintf(stderr, "WinWorkstation [error]: no eventBuffer\n");
+ RETURN (false);
}
if (ev) {
- _ev_buf = *ev;
- ev = &_ev_buf;
+ _ev_buf = *ev;
+ ev = &_ev_buf;
}
hWnd = ev->ev_hWnd;
if (!(hWnd /*&& IsWindow(hWnd)*/)) {
- DPRINTF(("wrong hWnd in event in dispatchLastEvent\n"));
- RETURN (false);
+ DPRINTF(("wrong hWnd in event in dispatchLastEvent\n"));
+ RETURN (false);
}
{
- OBJ t;
-
- /*
- * very often, its another event for the same view ...
- * avoid creation & lookup then.
- */
+ OBJ t;
+
+ /*
+ * very often, its another event for the same view ...
+ * avoid creation & lookup then.
+ */
#if 1
- if ((t = __INST(lastId)) != nil) {
- if (__isExternalAddress(t)) {
- if (_HWNDVal(t) == hWnd) {
- theView = __INST(lastView);
- if (__isNonNilObject(theView)) {
- if (__qClass(theView) == nil) {
- theView = nil;
- }
- }
- }
- }
- }
-#endif
- if (theView == nil) {
- windowID = __MKOBJ(ev->ev_hWnd);
- theView = (*vid.ilc_func)(self, @symbol(viewFromId:), nil, &vid, windowID);
- }
+ if ((t = __INST(lastId)) != nil) {
+ if (__isExternalAddress(t)) {
+ if (_HWNDVal(t) == hWnd) {
+ theView = __INST(lastView);
+ if (__isNonNilObject(theView)) {
+ if (__qClass(theView) == nil) {
+ theView = nil;
+ }
+ }
+ }
+ }
+ }
+#endif
+ if (theView == nil) {
+ windowID = __MKOBJ(ev->ev_hWnd);
+ theView = (*vid.ilc_func)(self, @symbol(viewFromId:), nil, &vid, windowID);
+ }
}
if (theView == nil) {
- DPRINTF(("nil view [hWnd=%x msg=0x%x] in dispatchEvent\n",
- ev->ev_hWnd, ev->ev_message));
-
- RETURN (false);
+ DPRINTF(("nil view [hWnd=%x msg=0x%x] in dispatchEvent\n",
+ ev->ev_hWnd, ev->ev_message));
+
+ RETURN (false);
}
switch (ev->ev_message) {
- case WM_WINDOWPOSCHANGED:
- {
- RECT rct;
-
- x = ev->ev_x;
- y = ev->ev_y;
- w = ev->ev_w;
- h = ev->ev_h;
-
- DPRINTF((">>> WM_WINDOWPOSCHANGED -> configure %d/%d , %d/%d\n", x,y,w,h));
-
- (*conf.ilc_func)(self,
- @symbol(configureX:y:width:height:view:),
- nil, &conf,
- __MKSMALLINT(x),
- __MKSMALLINT(y),
- __MKSMALLINT(w),
- __MKSMALLINT(h),
- theView);
- }
- break;
-
- case WM_DROPFILES:
- {
- HDROP hDrop = (HDROP) ev->ev_wParam;
- int count = DragQueryFile( hDrop,0xffffffff,0,0 );
-
- DPRINTFIF(__debug_WM_DROPFILES__ , ("count=%d hDrop=%x\n", count, hDrop));
- if (count > 0) {
- OBJ dropHandle, files, position;
- char buf[MAXPATH];
- int i;
-
- dropHandle = __MKOBJ(hDrop);
- __PROTECT__(dropHandle);
- files = __ARRAY_NEW_INT( count );
- __UNPROTECT__(dropHandle);
-
- for (i = 0;i < count;i++) {
- OBJ s;
-
- DragQueryFile(hDrop,i,buf,sizeof(buf));
- __PROTECT__(dropHandle);
- __PROTECT__(files);
- s = __MKSTRING(buf);
- __UNPROTECT__(files);
- __UNPROTECT__(dropHandle);
- __ArrayInstPtr(files)->a_element[i] = s; __STORE(files, s);
- }
-
- {
- POINT pos;
-
- DragQueryPoint(hDrop, &pos);
-
- __PROTECT__(dropHandle);
- __PROTECT__(files);
- position = __MKPOINT_INT(pos.x, pos.y);
- __UNPROTECT__(files);
- __UNPROTECT__(dropHandle);
- }
-
- (*dropFiles.ilc_func)
- ( self
- , @symbol(dropFiles:view:position:handle:)
- , nil, &dropFiles,
- files, theView, position, dropHandle
- );
- }
- }
- break;
-
- case WM_SHOWWINDOW:
- if (ev->ev_wParam == TRUE) {
- DPRINTF((">>> WM_SHOWWINDOW -> mappedView:\n"));
- arg = @symbol(unobscured);
- (*vis.ilc_func)(theView,
- @symbol(visibilityChange:),
- nil, &vis, arg);
- (*map.ilc_func)(self,
- @symbol(mappedView:),
- nil, &map, theView);
- } else {
- DPRINTF((">>> WM_SHOWWINDOW -> unMappedView:\n"));
+ case WM_WINDOWPOSCHANGED:
+ {
+ RECT rct;
+
+ x = ev->ev_x;
+ y = ev->ev_y;
+ w = ev->ev_w;
+ h = ev->ev_h;
+
+ DPRINTF((">>> WM_WINDOWPOSCHANGED -> configure %d/%d , %d/%d\n", x,y,w,h));
+
+ (*conf.ilc_func)(self,
+ @symbol(configureX:y:width:height:view:),
+ nil, &conf,
+ __MKSMALLINT(x),
+ __MKSMALLINT(y),
+ __MKSMALLINT(w),
+ __MKSMALLINT(h),
+ theView);
+ }
+ break;
+
+ case WM_DROPFILES:
+ {
+ HDROP hDrop = (HDROP) ev->ev_wParam;
+ int count = DragQueryFile( hDrop,0xffffffff,0,0 );
+
+ DPRINTFIF(__debug_WM_DROPFILES__ , ("count=%d hDrop=%x\n", count, hDrop));
+ if (count > 0) {
+ OBJ dropHandle, files, position;
+ char buf[MAXPATH];
+ int i;
+
+ dropHandle = __MKOBJ(hDrop);
+ __PROTECT__(dropHandle);
+ files = __ARRAY_NEW_INT( count );
+ __UNPROTECT__(dropHandle);
+
+ for (i = 0;i < count;i++) {
+ OBJ s;
+
+ DragQueryFile(hDrop,i,buf,sizeof(buf));
+ __PROTECT__(dropHandle);
+ __PROTECT__(files);
+ s = __MKSTRING(buf);
+ __UNPROTECT__(files);
+ __UNPROTECT__(dropHandle);
+ __ArrayInstPtr(files)->a_element[i] = s; __STORE(files, s);
+ }
+
+ {
+ POINT pos;
+
+ DragQueryPoint(hDrop, &pos);
+
+ __PROTECT__(dropHandle);
+ __PROTECT__(files);
+ position = __MKPOINT_INT(pos.x, pos.y);
+ __UNPROTECT__(files);
+ __UNPROTECT__(dropHandle);
+ }
+
+ (*dropFiles.ilc_func)
+ ( self
+ , @symbol(dropFiles:view:position:handle:)
+ , nil, &dropFiles,
+ files, theView, position, dropHandle
+ );
+ }
+ }
+ break;
+
+ case WM_SHOWWINDOW:
+ if (ev->ev_wParam == TRUE) {
+ DPRINTF((">>> WM_SHOWWINDOW -> mappedView:\n"));
+ arg = @symbol(unobscured);
+ (*vis.ilc_func)(theView,
+ @symbol(visibilityChange:),
+ nil, &vis, arg);
+ (*map.ilc_func)(self,
+ @symbol(mappedView:),
+ nil, &map, theView);
+ } else {
+ DPRINTF((">>> WM_SHOWWINDOW -> unMappedView:\n"));
#if 0
- arg = @symbol(fullyObscured);
- (*vis.ilc_func)(theView,
- @symbol(visibilityChange:),
- nil, &vis, arg);
-#endif
- (*unmap.ilc_func)(self,
- @symbol(unmappedView:),
- nil, &unmap, theView);
- }
- break;
-
- case __WM_ICONIFIED:
- if (ev->ev_wParam) {
- DPRINTF((">>> __WM_ICONIFIED -> unMappedView:\n"));
+ arg = @symbol(fullyObscured);
+ (*vis.ilc_func)(theView,
+ @symbol(visibilityChange:),
+ nil, &vis, arg);
+#endif
+ (*unmap.ilc_func)(self,
+ @symbol(unmappedView:),
+ nil, &unmap, theView);
+ }
+ break;
+
+ case __WM_ICONIFIED:
+ if (ev->ev_wParam) {
+ DPRINTF((">>> __WM_ICONIFIED -> unMappedView:\n"));
#if 0
- arg = @symbol(fullyObscured);
- (*vis.ilc_func)(theView,
- @symbol(visibilityChange:),
- nil, &vis, arg);
-#endif
- (*unmap.ilc_func)(self,
- @symbol(unmappedView:),
- nil, &unmap, theView);
- } else {
- DPRINTF((">>> __WM_DEICONIFIED -> mappedView:\n"));
- arg = @symbol(unobscured);
- (*vis.ilc_func)(theView,
- @symbol(visibilityChange:),
- nil, &vis, arg);
- (*map.ilc_func)(self,
- @symbol(mappedView:),
- nil, &map, theView);
- }
- break;
-
- case WM_CLOSE:
- DPRINTF((">>> WM_CLOSE -> terminateView:\n"));
- (*termS.ilc_func)(self,
- @symbol(terminateView:),
- nil, &termS, theView);
- break;
-
- case WM_DESTROY:
- DPRINTF((">>> WM_DESTROY -> destroyedView\n"));
- (*destr.ilc_func)(self,
- @symbol(destroyedView:),
- nil, &destr, theView);
- break;
-
- case WM_ACTIVATE:
-
- switch (LOWORD(ev->ev_wParam)) {
- case WA_INACTIVE:
- DPRINTF((">>> WM_ACTIVATE inactive h=%x\n", ev->ev_hWnd));
- (*act.ilc_func)(self,
- @symbol(activate:view:),
- nil, &act,
- false, theView);
- break;
-
- case WA_ACTIVE:
- case WA_CLICKACTIVE:
- DPRINTF((">>> WM_ACTIVATE active h=%x\n", ev->ev_hWnd));
- (*act.ilc_func)(self,
- @symbol(activate:view:),
- nil, &act,
- true, theView);
- break;
-
- default:
- break;
- }
- break;
-
- case WM_MOUSEACTIVATE:
- if (__debug_WM_MOUSEACTIVATE__) {
- PRINTF((">>> WM_MOUSEACTIVATE h=%x -> focusInView:\n", ev->ev_hWnd));
- }
-
- (*focIn.ilc_func)(self,
- @symbol(focusInView:),
- nil, &focIn, theView);
- break;
-
- case WM_SETFOCUS:
- DPRINTF((">>> WM_SETFOCUS h=%x -> focusInView:\n", ev->ev_hWnd));
- (*focIn.ilc_func)(self,
- @symbol(focusInView:),
- nil, &focIn, theView);
- break;
-
- case WM_KILLFOCUS:
- DPRINTF((">>> WM_KILLFOCUS h=%x -> focusOutOfView\n", ev->ev_hWnd));
- (*focOut.ilc_func)(self,
- @symbol(focusOutView:),
- nil, &focOut, theView);
- break;
-
- case __WM_GEXPOSE:
- x = ev->ev_x;
- y = ev->ev_y;
- w = ev->ev_w;
- h = ev->ev_h;
- DPRINTF((">>> __WM_GEXPOSE -> gExpose %d/%d -> %d/%d\n", x, y, w, h));
+ arg = @symbol(fullyObscured);
+ (*vis.ilc_func)(theView,
+ @symbol(visibilityChange:),
+ nil, &vis, arg);
+#endif
+ (*unmap.ilc_func)(self,
+ @symbol(unmappedView:),
+ nil, &unmap, theView);
+ } else {
+ DPRINTF((">>> __WM_DEICONIFIED -> mappedView:\n"));
+ arg = @symbol(unobscured);
+ (*vis.ilc_func)(theView,
+ @symbol(visibilityChange:),
+ nil, &vis, arg);
+ (*map.ilc_func)(self,
+ @symbol(mappedView:),
+ nil, &map, theView);
+ }
+ break;
+
+ case WM_CLOSE:
+ DPRINTF((">>> WM_CLOSE -> terminateView:\n"));
+ (*termS.ilc_func)(self,
+ @symbol(terminateView:),
+ nil, &termS, theView);
+ break;
+
+ case WM_DESTROY:
+ DPRINTF((">>> WM_DESTROY -> destroyedView\n"));
+ (*destr.ilc_func)(self,
+ @symbol(destroyedView:),
+ nil, &destr, theView);
+ break;
+
+ case WM_ACTIVATE:
+
+ switch (LOWORD(ev->ev_wParam)) {
+ case WA_INACTIVE:
+ DPRINTF((">>> WM_ACTIVATE inactive h=%x\n", ev->ev_hWnd));
+ (*act.ilc_func)(self,
+ @symbol(activate:view:),
+ nil, &act,
+ false, theView);
+ break;
+
+ case WA_ACTIVE:
+ case WA_CLICKACTIVE:
+ DPRINTF((">>> WM_ACTIVATE active h=%x\n", ev->ev_hWnd));
+ (*act.ilc_func)(self,
+ @symbol(activate:view:),
+ nil, &act,
+ true, theView);
+ break;
+
+ default:
+ break;
+ }
+ break;
+
+ case WM_MOUSEACTIVATE:
+ if (__debug_WM_MOUSEACTIVATE__) {
+ PRINTF((">>> WM_MOUSEACTIVATE h=%x -> focusInView:\n", ev->ev_hWnd));
+ }
+
+ (*focIn.ilc_func)(self,
+ @symbol(focusInView:),
+ nil, &focIn, theView);
+ break;
+
+ case WM_SETFOCUS:
+ DPRINTF((">>> WM_SETFOCUS h=%x -> focusInView:\n", ev->ev_hWnd));
+ (*focIn.ilc_func)(self,
+ @symbol(focusInView:),
+ nil, &focIn, theView);
+ break;
+
+ case WM_KILLFOCUS:
+ DPRINTF((">>> WM_KILLFOCUS h=%x -> focusOutOfView\n", ev->ev_hWnd));
+ (*focOut.ilc_func)(self,
+ @symbol(focusOutView:),
+ nil, &focOut, theView);
+ break;
+
+ case __WM_GEXPOSE:
+ x = ev->ev_x;
+ y = ev->ev_y;
+ w = ev->ev_w;
+ h = ev->ev_h;
+ DPRINTF((">>> __WM_GEXPOSE -> gExpose %d/%d -> %d/%d\n", x, y, w, h));
#if 0
- if (GetWindow_unmapping(hWnd)) {
- console_fprintf(stderr, "oops - __WM_GEXPOSE for unmapping\n");
- }
-#endif
- (*gexpS.ilc_func)(self,
- @symbol(graphicsExposeX:y:width:height:final:view:),
- nil, &gexpS,
- __MKSMALLINT(x),
- __MKSMALLINT(y),
- __MKSMALLINT(w),
- __MKSMALLINT(h),
- ev->ev_wParam ? true : false,
- theView);
- break;
-
- case __WM_NOGEXPOSE:
- DPRINTFIF(__debug_WM_EXPOSE__, (">>> __WM_NOGEXPOSE -> noExpose\n"));
+ if (GetWindow_unmapping(hWnd)) {
+ console_fprintf(stderr, "oops - __WM_GEXPOSE for unmapping\n");
+ }
+#endif
+ (*gexpS.ilc_func)(self,
+ @symbol(graphicsExposeX:y:width:height:final:view:),
+ nil, &gexpS,
+ __MKSMALLINT(x),
+ __MKSMALLINT(y),
+ __MKSMALLINT(w),
+ __MKSMALLINT(h),
+ ev->ev_wParam ? true : false,
+ theView);
+ break;
+
+ case __WM_NOGEXPOSE:
+ DPRINTFIF(__debug_WM_EXPOSE__, (">>> __WM_NOGEXPOSE -> noExpose\n"));
#if 0
- if (GetWindow_unmapping(hWnd)) {
- console_fprintf(stderr, "oops - __WM_NOGEXPOSE for unmapping\n");
- }
-#endif
- (*nexpS.ilc_func)(self,
- @symbol(noExposeView:), nil, &nexpS,
- theView);
- break;
+ if (GetWindow_unmapping(hWnd)) {
+ console_fprintf(stderr, "oops - __WM_NOGEXPOSE for unmapping\n");
+ }
+#endif
+ (*nexpS.ilc_func)(self,
+ @symbol(noExposeView:), nil, &nexpS,
+ theView);
+ break;
# ifdef LATE_GENERATE_EXPOSE
- case __WM_PAINT:
- {
- PAINTSTRUCT ps;
-
- AQUIRE_DRAW_MUTEX
- __generateExposes(hWnd, NULL, WM_PAINT, 0);
- RELEASE_DRAW_MUTEX
+ case __WM_PAINT:
+ {
+ PAINTSTRUCT ps;
+
+ AQUIRE_DRAW_MUTEX
+ __generateExposes(hWnd, NULL, WM_PAINT, 0);
+ RELEASE_DRAW_MUTEX
# if 0
- BeginPaint(hWnd, &ps);
- EndPaint(hWnd, &ps);
+ BeginPaint(hWnd, &ps);
+ EndPaint(hWnd, &ps);
# endif
- }
- break;
+ }
+ break;
# endif
- case WM_PAINT:
- x = ev->ev_x;
- y = ev->ev_y;
- w = ev->ev_w;
- h = ev->ev_h;
+ case WM_PAINT:
+ x = ev->ev_x;
+ y = ev->ev_y;
+ w = ev->ev_w;
+ h = ev->ev_h;
#if 0
- if (GetWindow_unmapping(hWnd)) {
- console_fprintf(stderr, "oops - WM_PAINT for unmapping\n");
- }
+ if (GetWindow_unmapping(hWnd)) {
+ console_fprintf(stderr, "oops - WM_PAINT for unmapping\n");
+ }
#endif
#ifndef PRE_21_NOV
- __clearWindow(hWnd, x, y, w, h);
+ __clearWindow(hWnd, x, y, w, h);
#else
# if WM_PAINT_CLEAR_LATE
- __clearWindow(hWnd, x, y, w, h);
+ __clearWindow(hWnd, x, y, w, h);
# endif
#endif
#ifdef DEBUG_COLORIZE_WM_PAINT_RECTS2
- {
- HDC hDC;
- HBRUSH hBrush;
- RECT rect;
-
- hBrush = CreateSolidBrush(BlackPixel);
- hDC = GetWindowDC(hWnd);
- SelectClipRgn(hDC, NULL);
- rect.left = x;
- rect.top = y;
- rect.right = x+w;
- rect.bottom = y+h;
-
- FillRect(hDC, &rect, hBrush);
- _DeleteBrush(hBrush, __LINE__);
- ReleaseDC(hWnd, hDC);
- }
-#endif
- if (__debug_WM_PAINT__) {
- PRINTF((">>> WM_PAINT -> expose %d/%d -> %d/%d\n", x, y, w, h));
- }
- (*exp.ilc_func)(self,
- @symbol(exposeX:y:width:height:view:),
- nil, &exp,
- __MKSMALLINT(x),
- __MKSMALLINT(y),
- __MKSMALLINT(w),
- __MKSMALLINT(h),
- theView);
- break;
-
- case WM_LBUTTONDBLCLK:
- isDoubleClick = 1;
- butt = __MKSMALLINT(Button1);
- goto commonButtonDown;
-
- case WM_LBUTTONUP:
- isDown = 0;
- butt = __MKSMALLINT(Button1);
- goto commonButtonDown;
-
- case WM_LBUTTONDOWN:
- butt = __MKSMALLINT(Button1);
- goto commonButtonDown;
-
- case WM_MBUTTONDBLCLK:
- isDoubleClick = 1;
- butt = __MKSMALLINT(Button2);
- goto commonButtonDown;
-
- case WM_MBUTTONUP:
- isDown = 0;
- butt = __MKSMALLINT(Button2);
- goto commonButtonDown;
-
- case WM_MBUTTONDOWN:
- butt = __MKSMALLINT(Button2);
- goto commonButtonDown;
-
- case WM_RBUTTONDBLCLK:
- isDoubleClick = 1;
- butt = __MKSMALLINT(Button3);
- goto commonButtonDown;
-
- case WM_RBUTTONUP:
- isDown = 0;
- butt = __MKSMALLINT(Button3);
- goto commonButtonDown;
-
- case WM_RBUTTONDOWN:
- butt = __MKSMALLINT(Button3);
- goto commonButtonDown;
-
- commonButtonDown:
- x = ev->ev_x;
- y = ev->ev_y;
- modifiers = ev->ev_modifiers;
-
- if (__INST(buttonTranslation) != nil) {
- butt = __AT_(__INST(buttonTranslation), butt);
- }
- arg = butt;
-
- __INST(altDown) = (modifiers & AltMask) ? true : false;
- __INST(metaDown) = (modifiers & MetaMask) ? true : false;
- __INST(shiftDown) = (modifiers & ShiftMask) ? true : false;
- __INST(ctrlDown) = (modifiers & ControlMask) ? true : false;
-
- if (deltaDoubleClickX == -999) {
- deltaDoubleClickX = GetSystemMetrics(SM_CXDOUBLECLK);
- deltaDoubleClickY = GetSystemMetrics(SM_CYDOUBLECLK);
- }
-
- if (isDoubleClick) {
- multiClickCount = 2;
- ipS = &bmp;
- symS = @symbol(buttonMultiPress:x:y:view:);
- nextMultiClickTime = ev->ev_time + __intVal(__INST(multiClickTimeDelta));
- } else {
- if (isDown) {
- if (multiClickCount
- && (ev->ev_time < nextMultiClickTime)
- && (butt == lastButton)
- && (x >= (lastClickX - (deltaDoubleClickX / 2)))
- && (x <= (lastClickX + (deltaDoubleClickX / 2)))
- && (y >= (lastClickY - (deltaDoubleClickY / 2)))
- && (y <= (lastClickY + (deltaDoubleClickY / 2)))
- ) {
- ipS = &bmp;
- symS = @symbol(buttonMultiPress:x:y:view:);
- } else {
- ipS = &bp;
- symS = @symbol(buttonPress:x:y:view:);
- multiClickCount = 0;
- }
- multiClickCount = multiClickCount + 1;
- nextMultiClickTime = ev->ev_time + __intVal(__INST(multiClickTimeDelta));
- } else {
- ipS = &br;
- symS = @symbol(buttonRelease:x:y:view:);
- }
- }
-
- if (isDown || isDoubleClick) {
- lastClickX = x;
- lastClickY = y;
- lastButton = butt;
- }
-
- if (__debug_WM_BUTTONUP__ | __debug_WM_BUTTONDOWN__) {
- if (__isSymbol(arg)) {
- PRINTF(("buttonPress/buttonRelease: %s %d/%d\n",
- __stringVal(arg), x, y));
- } else {
- PRINTF(("buttonPress/buttonRelease: %d %d/%d\n",
- __intVal(arg), x, y));
- }
- }
-
- (*(*ipS).ilc_func)(self, symS, nil, ipS,
- arg,
- __MKSMALLINT(x),
- __MKSMALLINT(y),
- theView);
- break;
-
- case __WM_MOUSEENTER:
- x = ev->ev_x;
- y = ev->ev_y;
- state = ev->ev_modifiers;
-
- if (__debug_WM_MOUSEENTER__) {
- PRINTF((">>> WM_MOUSEENTER: %x %d/%d state:%x\n", ev->ev_hWnd, x, y, state));
- }
+ {
+ HDC hDC;
+ HBRUSH hBrush;
+ RECT rect;
+
+ hBrush = CreateSolidBrush(BlackPixel);
+ hDC = GetWindowDC(hWnd);
+ SelectClipRgn(hDC, NULL);
+ rect.left = x;
+ rect.top = y;
+ rect.right = x+w;
+ rect.bottom = y+h;
+
+ FillRect(hDC, &rect, hBrush);
+ _DeleteBrush(hBrush, __LINE__);
+ ReleaseDC(hWnd, hDC);
+ }
+#endif
+ if (__debug_WM_PAINT__) {
+ PRINTF((">>> WM_PAINT -> expose %d/%d -> %d/%d\n", x, y, w, h));
+ }
+ (*exp.ilc_func)(self,
+ @symbol(exposeX:y:width:height:view:),
+ nil, &exp,
+ __MKSMALLINT(x),
+ __MKSMALLINT(y),
+ __MKSMALLINT(w),
+ __MKSMALLINT(h),
+ theView);
+ break;
+
+ case WM_LBUTTONDBLCLK:
+ isDoubleClick = 1;
+ butt = __MKSMALLINT(Button1);
+ goto commonButton;
+
+ case WM_LBUTTONUP:
+ isDown = 0;
+ butt = __MKSMALLINT(Button1);
+ goto commonButton;
+
+ case WM_LBUTTONDOWN:
+ butt = __MKSMALLINT(Button1);
+ goto commonButton;
+
+ case WM_MBUTTONDBLCLK:
+ isDoubleClick = 1;
+ butt = __MKSMALLINT(Button2);
+ goto commonButton;
+
+ case WM_MBUTTONUP:
+ isDown = 0;
+ butt = __MKSMALLINT(Button2);
+ goto commonButton;
+
+ case WM_MBUTTONDOWN:
+ butt = __MKSMALLINT(Button2);
+ goto commonButton;
+
+ case WM_RBUTTONDBLCLK:
+ isDoubleClick = 1;
+ butt = __MKSMALLINT(Button3);
+ goto commonButton;
+
+ case WM_RBUTTONUP:
+ isDown = 0;
+ butt = __MKSMALLINT(Button3);
+ goto commonButton;
+
+ case WM_RBUTTONDOWN:
+ butt = __MKSMALLINT(Button3);
+ goto commonButton;
+
+ commonButton:
+ x = ev->ev_x;
+ y = ev->ev_y;
+ modifiers = ev->ev_modifiers;
+
+ if (__INST(buttonTranslation) != nil) {
+ butt = __AT_(__INST(buttonTranslation), butt);
+ }
+ arg = butt;
+
+ __INST(altDown) = (modifiers & AltMask) ? true : false;
+ __INST(metaDown) = (modifiers & MetaMask) ? true : false;
+ __INST(shiftDown) = (modifiers & ShiftMask) ? true : false;
+ __INST(ctrlDown) = (modifiers & ControlMask) ? true : false;
+
+ if (deltaDoubleClickX == -999) {
+ deltaDoubleClickX = GetSystemMetrics(SM_CXDOUBLECLK);
+ deltaDoubleClickY = GetSystemMetrics(SM_CYDOUBLECLK);
+ }
+
+ if (isDoubleClick) {
+ multiClickCount = 2;
+ ipS = &bmp;
+ symS = @symbol(buttonMultiPress:x:y:view:);
+ nextMultiClickTime = ev->ev_time + __intVal(__INST(multiClickTimeDelta));
+ } else {
+ if (isDown) {
+ if (multiClickCount
+ && (ev->ev_time < nextMultiClickTime)
+ && (butt == lastButton)
+ && (x >= (lastClickX - (deltaDoubleClickX / 2)))
+ && (x <= (lastClickX + (deltaDoubleClickX / 2)))
+ && (y >= (lastClickY - (deltaDoubleClickY / 2)))
+ && (y <= (lastClickY + (deltaDoubleClickY / 2)))
+ ) {
+ ipS = &bmp;
+ symS = @symbol(buttonMultiPress:x:y:view:);
+ } else {
+ ipS = &bp;
+ symS = @symbol(buttonPress:x:y:view:);
+ multiClickCount = 0;
+ }
+ multiClickCount = multiClickCount + 1;
+ nextMultiClickTime = ev->ev_time + __intVal(__INST(multiClickTimeDelta));
+ } else {
+ ipS = &br;
+ symS = @symbol(buttonRelease:x:y:view:);
+ }
+ }
+
+ if (isDown || isDoubleClick) {
+ lastClickX = x;
+ lastClickY = y;
+ lastButton = butt;
+ }
+
+ if (__debug_WM_BUTTONUP__ | __debug_WM_BUTTONDOWN__) {
+ if (__isSymbol(arg)) {
+ PRINTF(("buttonPress/buttonRelease: %s %d/%d\n",
+ __stringVal(arg), x, y));
+ } else {
+ PRINTF(("buttonPress/buttonRelease: %d %d/%d\n",
+ __intVal(arg), x, y));
+ }
+ }
+
+ (*(*ipS).ilc_func)(self, symS, nil, ipS,
+ arg,
+ __MKSMALLINT(x),
+ __MKSMALLINT(y),
+ theView);
+ break;
+
+ case __WM_MOUSEENTER:
+ x = ev->ev_x;
+ y = ev->ev_y;
+ state = ev->ev_modifiers;
+
+ if (__debug_WM_MOUSEENTER__) {
+ PRINTF((">>> WM_MOUSEENTER: %x %d/%d state:%x\n", ev->ev_hWnd, x, y, state));
+ }
#if 0
- if (GetWindow_unmapping(hWnd)) {
- console_fprintf(stderr, "oops - WM_MOUSEENTER for unmapping\n");
- }
-#endif
- (*pe.ilc_func)(self, @symbol(pointerEnter:x:y:view:),
- nil, &pe,
- __MKSMALLINT(state),
- __MKSMALLINT(x),
- __MKSMALLINT(y),
- theView);
- break;
-
- case __WM_MOUSELEAVE:
- state = ev->ev_modifiers;
- if (__debug_WM_MOUSELEAVE__) {
- PRINTF((">>> WM_MOUSELEAVE: %x state:%x\n", ev->ev_hWnd, state));
- }
+ if (GetWindow_unmapping(hWnd)) {
+ console_fprintf(stderr, "oops - WM_MOUSEENTER for unmapping\n");
+ }
+#endif
+ (*pe.ilc_func)(self, @symbol(pointerEnter:x:y:view:),
+ nil, &pe,
+ __MKSMALLINT(state),
+ __MKSMALLINT(x),
+ __MKSMALLINT(y),
+ theView);
+ break;
+
+ case __WM_MOUSELEAVE:
+ state = ev->ev_modifiers;
+ if (__debug_WM_MOUSELEAVE__) {
+ PRINTF((">>> WM_MOUSELEAVE: %x state:%x\n", ev->ev_hWnd, state));
+ }
#if 0
- if (GetWindow_unmapping(hWnd)) {
- console_fprintf(stderr, "oops - WM_MOUSELEAVE for unmapping\n");
- }
-#endif
- (*pl.ilc_func)(self, @symbol(pointerLeave:view:),
- nil, &pl,
- __MKSMALLINT(state),
- theView);
- break;
-
- case WM_MOUSEMOVE:
- x = ev->ev_x;
- y = ev->ev_y;
- state = ev->ev_modifiers;
- if (__debug_WM_MOUSEMOVE__) {
- PRINTF((">>> WM_MOUSEMOVE: %d/%d %x\n", x, y, state));
- }
- (*mot.ilc_func)(self, @symbol(buttonMotion:x:y:view:),
- nil, &mot,
- __MKSMALLINT(state),
- __MKSMALLINT(x),
- __MKSMALLINT(y),
- theView);
- break;
+ if (GetWindow_unmapping(hWnd)) {
+ console_fprintf(stderr, "oops - WM_MOUSELEAVE for unmapping\n");
+ }
+#endif
+ (*pl.ilc_func)(self, @symbol(pointerLeave:view:),
+ nil, &pl,
+ __MKSMALLINT(state),
+ theView);
+ break;
+
+ case WM_MOUSEMOVE:
+ x = ev->ev_x;
+ y = ev->ev_y;
+ state = ev->ev_modifiers;
+ if (__debug_WM_MOUSEMOVE__) {
+ PRINTF((">>> WM_MOUSEMOVE: %d/%d %x\n", x, y, state));
+ }
+ (*mot.ilc_func)(self, @symbol(buttonMotion:x:y:view:),
+ nil, &mot,
+ __MKSMALLINT(state),
+ __MKSMALLINT(x),
+ __MKSMALLINT(y),
+ theView);
+ break;
#ifdef WM_MOUSEWHEEL
- case WM_MOUSEWHEEL:
- x = ev->ev_x;
- y = ev->ev_y;
- state = ev->ev_modifiers;
- dir = ev->ev_wParam;
- DPRINTF((">>> WM_MOUSEWHEEL: %d %x\n", dir, state));
- {
- OBJ tim;
-
- __PROTECT__(theView);
- tim = __MKUINT(ev->ev_time);
- __UNPROTECT__(theView);
- (*mwh.ilc_func)(self, @symbol(mouseWheelMotion:x:y:amount:deltaTime:view:),
- nil, &mwh,
- __MKSMALLINT(state),
- __MKSMALLINT(x),
- __MKSMALLINT(y),
- __MKSMALLINT(dir),
- tim,
- theView);
- }
- break;
-#endif
-
- case WM_CHAR:
- DPRINTFIF(__debug_WM_CHAR__ , ("WM_CHAR %x %d/%d\n", ev->ev_keyCode, ev->ev_x, ev->ev_y));
- DPRINTF((">>> WM_CHAR: %d/%d\n", x, y));
- symS = @symbol(keyPress:x:y:view:);
- ipS = &skp;
- upDown = true;
- goto keyPressAndRelease;
-
- case WM_SYSKEYUP:
- case WM_KEYUP:
- DPRINTFIF(__debug_WM_KEYUP__ , (">>> WM_KEYUP / SYSKEYUP: %x %d/%d\n", ev->ev_keyCode, ev->ev_x, ev->ev_y));
- symS = @symbol(keyRelease:x:y:view:);
- ipS = &skr;
- upDown = false;
- goto keyPressAndRelease;
-
- case WM_SYSKEYDOWN:
- case WM_KEYDOWN:
- DPRINTFIF(__debug_WM_KEYUP__ , (">>> WM_KEYDOWN / SYSKEYDOWN: %x %d/%d\n", ev->ev_keyCode, ev->ev_x, ev->ev_y));
- symS = @symbol(keyPress:x:y:view:);
- ipS = &skp;
- upDown = true;
- /* FALL INTO */
-
- keyPressAndRelease: ;
-
- x = ev->ev_x;
- y = ev->ev_y;
+ case WM_MOUSEWHEEL:
+ x = ev->ev_x;
+ y = ev->ev_y;
+ state = ev->ev_modifiers;
+ dir = ev->ev_wParam;
+ DPRINTF((">>> WM_MOUSEWHEEL: %d %x\n", dir, state));
+ {
+ OBJ tim;
+
+ __PROTECT__(theView);
+ tim = __MKUINT(ev->ev_time);
+ __UNPROTECT__(theView);
+ (*mwh.ilc_func)(self, @symbol(mouseWheelMotion:x:y:amount:deltaTime:view:),
+ nil, &mwh,
+ __MKSMALLINT(state),
+ __MKSMALLINT(x),
+ __MKSMALLINT(y),
+ __MKSMALLINT(dir),
+ tim,
+ theView);
+ }
+ break;
+#endif
+
+ case WM_CHAR:
+ DPRINTFIF(__debug_WM_CHAR__ , ("WM_CHAR %x %d/%d\n", ev->ev_keyCode, ev->ev_x, ev->ev_y));
+ DPRINTF((">>> WM_CHAR: %d/%d\n", x, y));
+ symS = @symbol(keyPress:x:y:view:);
+ ipS = &skp;
+ upDown = true;
+ goto keyPressAndRelease;
+
+ case WM_SYSKEYUP:
+ case WM_KEYUP:
+ DPRINTFIF(__debug_WM_KEYUP__ , (">>> WM_KEYUP / SYSKEYUP: %x %d/%d\n", ev->ev_keyCode, ev->ev_x, ev->ev_y));
+ symS = @symbol(keyRelease:x:y:view:);
+ ipS = &skr;
+ upDown = false;
+ goto keyPressAndRelease;
+
+ case WM_SYSKEYDOWN:
+ case WM_KEYDOWN:
+ DPRINTFIF(__debug_WM_KEYUP__ , (">>> WM_KEYDOWN / SYSKEYDOWN: %x %d/%d\n", ev->ev_keyCode, ev->ev_x, ev->ev_y));
+ symS = @symbol(keyPress:x:y:view:);
+ ipS = &skp;
+ upDown = true;
+ /* FALL INTO */
+
+ keyPressAndRelease: ;
+
+ x = ev->ev_x;
+ y = ev->ev_y;
#ifdef NOTDEF
- {
- BYTE vKeyState[256];
- char buff[5];
-
- GetKeyboardState(vKeyState);
- ToAscii(ev->ev_keyCode, ev->ev_scanCode, vKeyState, &buff; 0);
- }
-#endif
-
- keyCode = ev->ev_keyCode;
- modifiers = ev->ev_modifiers;
-
- if (modifiers & TRANSLATED_KEY) {
+ {
+ BYTE vKeyState[256];
+ char buff[5];
+
+ GetKeyboardState(vKeyState);
+ ToAscii(ev->ev_keyCode, ev->ev_scanCode, vKeyState, &buff; 0);
+ }
+#endif
+
+ keyCode = ev->ev_keyCode;
+ modifiers = ev->ev_modifiers;
+
+ if (modifiers & TRANSLATED_KEY) {
#if 1
- if (modifiers & ControlMask) {
- if (keyCode < 0x20) {
- keyCode = keyCode + 'a' - 1;
- if (modifiers & ShiftMask) {
- keyCode = keyCode - 'a' + 'A';
- }
- }
- } else if (modifiers & (MetaMask | AltMask)) {
- if (! (modifiers & ShiftMask)) {
- if ((keyCode >= 'A') && (keyCode <= 'Z')) {
- keyCode = keyCode - 'A' + 'a';
- }
- }
- }
-#endif
- arg = __MKSMALLINT(keyCode & 0xFFFF);
- } else {
- switch (keyCode) {
- case VK_F1:
- arg = @symbol(F1);
- break;
- case VK_F2:
- arg = @symbol(F2);
- break;
- case VK_F3:
- arg = @symbol(F3);
- break;
- case VK_F4:
- arg = @symbol(F4);
- break;
- case VK_F5:
- arg = @symbol(F5);
- break;
- case VK_F6:
- arg = @symbol(F6);
- break;
- case VK_F7:
- arg = @symbol(F7);
- break;
- case VK_F8:
- arg = @symbol(F8);
- break;
- case VK_F9:
- arg = @symbol(F9);
- break;
- case VK_F10:
- arg = @symbol(F10);
- break;
- case VK_F11:
- arg = @symbol(F11);
- break;
- case VK_F12:
- arg = @symbol(F12);
- break;
- case VK_PRIOR:
- arg = @symbol(Prior);
- break;
- case VK_NEXT:
- arg = @symbol(Next);
- break;
- case VK_END:
- arg = @symbol(End);
- break;
- case VK_HOME:
- arg = @symbol(Home);
- break;
- case VK_LEFT:
- arg = @symbol(CursorLeft);
- break;
- case VK_RIGHT:
- arg = @symbol(CursorRight);
- break;
- case VK_UP:
- arg = @symbol(CursorUp);
- break;
- case VK_DOWN:
- arg = @symbol(CursorDown);
- break;
- case VK_MENU: /*alt key with w95 ???*/
- arg = @symbol(Menu);
- break;
- case VK_LMENU:
- arg = @symbol(Menu_L);
- break;
- case VK_RMENU:
- arg = @symbol(Menu_R);
- break;
- case VK_PAUSE:
- arg = @symbol(Pause);
- break;
- case VK_HELP:
- arg = @symbol(Help);
- break;
- case VK_EXECUTE:
- arg = @symbol(Execute);
- break;
- case VK_CANCEL:
- arg = @symbol(Cancel);
- break;
- case VK_SELECT:
- arg = @symbol(Select);
- break;
- case VK_PRINT:
- arg = @symbol(Print);
- break;
- case VK_SNAPSHOT:
- arg = @symbol(Snapshot);
- break;
- case VK_INSERT:
- arg = @symbol(Insert);
- break;
- case VK_DELETE:
- arg = @symbol(Delete);
- break;
- case VK_BACK:
- arg = @symbol(BackSpace);
- break;
- case VK_LWIN:
- arg = @symbol(Win_L);
- break;
- case VK_RWIN:
- arg = @symbol(Win_R);
- break;
- case VK_APPS:
- arg = @symbol(Appl);
- break;
- case VK_NUMPAD0:
- arg = @symbol(KeyPad0);
- break;
- case VK_NUMPAD1:
- arg = @symbol(KeyPad1);
- break;
- case VK_NUMPAD2:
- arg = @symbol(KeyPad2);
- break;
- case VK_NUMPAD3:
- arg = @symbol(KeyPad3);
- break;
- case VK_NUMPAD4:
- arg = @symbol(KeyPad4);
- break;
- case VK_NUMPAD5:
- arg = @symbol(KeyPad5);
- break;
- case VK_NUMPAD6:
- arg = @symbol(KeyPad6);
- break;
- case VK_NUMPAD7:
- arg = @symbol(KeyPad7);
- break;
- case VK_NUMPAD8:
- arg = @symbol(KeyPad8);
- break;
- case VK_NUMPAD9:
- arg = @symbol(KeyPad9);
- break;
- case VK_LSHIFT:
- arg = @symbol(Shift_L);
- break;
- case VK_RSHIFT:
- arg = @symbol(Shift_R);
- break;
- case VK_LCONTROL:
- arg = @symbol(Ctrl_L);
- break;
- case VK_RCONTROL:
- arg = @symbol(Ctrl_R);
- break;
- case VK_CONTROL:
- arg = @symbol(Ctrl);
- break;
- case VK_SHIFT:
- arg = @symbol(Shift);
- break;
- case VK_TAB:
- arg = @symbol(Tab);
- break;
- case VK_ESCAPE:
- arg = @symbol(Escape);
- break;
- case VK_NUMLOCK:
- arg = @symbol(NumLock);
- break;
- case VK_SCROLL:
- arg = @symbol(ScrollLock);
- break;
- case VK_RETURN:
- arg = @symbol(Return);
- break;
-
- default:
+ if (modifiers & ControlMask) {
+ if (keyCode < 0x20) {
+ keyCode = keyCode + 'a' - 1;
+ if (modifiers & ShiftMask) {
+ keyCode = keyCode - 'a' + 'A';
+ }
+ }
+ } else if (modifiers & (MetaMask | AltMask)) {
+ if (! (modifiers & ShiftMask)) {
+ if ((keyCode >= 'A') && (keyCode <= 'Z')) {
+ keyCode = keyCode - 'A' + 'a';
+ }
+ }
+ }
+#endif
+ arg = __MKSMALLINT(keyCode & 0xFFFF);
+ } else {
+ switch (keyCode) {
+ case VK_F1:
+ arg = @symbol(F1);
+ break;
+ case VK_F2:
+ arg = @symbol(F2);
+ break;
+ case VK_F3:
+ arg = @symbol(F3);
+ break;
+ case VK_F4:
+ arg = @symbol(F4);
+ break;
+ case VK_F5:
+ arg = @symbol(F5);
+ break;
+ case VK_F6:
+ arg = @symbol(F6);
+ break;
+ case VK_F7:
+ arg = @symbol(F7);
+ break;
+ case VK_F8:
+ arg = @symbol(F8);
+ break;
+ case VK_F9:
+ arg = @symbol(F9);
+ break;
+ case VK_F10:
+ arg = @symbol(F10);
+ break;
+ case VK_F11:
+ arg = @symbol(F11);
+ break;
+ case VK_F12:
+ arg = @symbol(F12);
+ break;
+ case VK_PRIOR:
+ arg = @symbol(Prior);
+ break;
+ case VK_NEXT:
+ arg = @symbol(Next);
+ break;
+ case VK_END:
+ arg = @symbol(End);
+ break;
+ case VK_HOME:
+ arg = @symbol(Home);
+ break;
+ case VK_LEFT:
+ arg = @symbol(CursorLeft);
+ break;
+ case VK_RIGHT:
+ arg = @symbol(CursorRight);
+ break;
+ case VK_UP:
+ arg = @symbol(CursorUp);
+ break;
+ case VK_DOWN:
+ arg = @symbol(CursorDown);
+ break;
+ case VK_MENU: /*alt key with w95 ???*/
+ arg = @symbol(Menu);
+ break;
+ case VK_LMENU:
+ arg = @symbol(Menu_L);
+ break;
+ case VK_RMENU:
+ arg = @symbol(Menu_R);
+ break;
+ case VK_PAUSE:
+ arg = @symbol(Pause);
+ break;
+ case VK_HELP:
+ arg = @symbol(Help);
+ break;
+ case VK_EXECUTE:
+ arg = @symbol(Execute);
+ break;
+ case VK_CANCEL:
+ arg = @symbol(Cancel);
+ break;
+ case VK_SELECT:
+ arg = @symbol(Select);
+ break;
+ case VK_PRINT:
+ arg = @symbol(Print);
+ break;
+ case VK_SNAPSHOT:
+ arg = @symbol(Snapshot);
+ break;
+ case VK_INSERT:
+ arg = @symbol(Insert);
+ break;
+ case VK_DELETE:
+ arg = @symbol(Delete);
+ break;
+ case VK_BACK:
+ arg = @symbol(BackSpace);
+ break;
+ case VK_LWIN:
+ arg = @symbol(Win_L);
+ break;
+ case VK_RWIN:
+ arg = @symbol(Win_R);
+ break;
+ case VK_APPS:
+ arg = @symbol(Appl);
+ break;
+ case VK_NUMPAD0:
+ arg = @symbol(KeyPad0);
+ break;
+ case VK_NUMPAD1:
+ arg = @symbol(KeyPad1);
+ break;
+ case VK_NUMPAD2:
+ arg = @symbol(KeyPad2);
+ break;
+ case VK_NUMPAD3:
+ arg = @symbol(KeyPad3);
+ break;
+ case VK_NUMPAD4:
+ arg = @symbol(KeyPad4);
+ break;
+ case VK_NUMPAD5:
+ arg = @symbol(KeyPad5);
+ break;
+ case VK_NUMPAD6:
+ arg = @symbol(KeyPad6);
+ break;
+ case VK_NUMPAD7:
+ arg = @symbol(KeyPad7);
+ break;
+ case VK_NUMPAD8:
+ arg = @symbol(KeyPad8);
+ break;
+ case VK_NUMPAD9:
+ arg = @symbol(KeyPad9);
+ break;
+ case VK_LSHIFT:
+ arg = @symbol(Shift_L);
+ break;
+ case VK_RSHIFT:
+ arg = @symbol(Shift_R);
+ break;
+ case VK_LCONTROL:
+ arg = @symbol(Ctrl_L);
+ break;
+ case VK_RCONTROL:
+ arg = @symbol(Ctrl_R);
+ break;
+ case VK_CONTROL:
+ arg = @symbol(Ctrl);
+ break;
+ case VK_SHIFT:
+ arg = @symbol(Shift);
+ break;
+ case VK_TAB:
+ arg = @symbol(Tab);
+ break;
+ case VK_ESCAPE:
+ arg = @symbol(Escape);
+ break;
+ case VK_NUMLOCK:
+ arg = @symbol(NumLock);
+ break;
+ case VK_SCROLL:
+ arg = @symbol(ScrollLock);
+ break;
+ case VK_RETURN:
+ arg = @symbol(Return);
+ break;
+
+ default:
#if 0
- nameBuffer[0] = 0;
- GetKeyNameText(ev->ev_scanCode, nameBuffer, sizeof(nameBuffer));
- if (__debug_WM_KEYUP__ | __debug_WM_KEYDOWN__ | __debug_WM_CHAR__) {
- PRINTF(("char is <%d>\n", keyCode));
- }
-#endif
- arg = __MKSMALLINT(keyCode & 0xFFFF);
- break;
- }
- }
- __INST(altDown) = (modifiers & AltMask) ? true : false;
- __INST(metaDown) = (modifiers & MetaMask) ? true : false;
- __INST(shiftDown) = (modifiers & ShiftMask) ? true : false;
- __INST(ctrlDown) = (modifiers & ControlMask) ? true : false;
-
- if (__debug_WM_CHAR__ | __debug_WM_KEYUP__ | __debug_WM_KEYDOWN__) {
- PRINTF(("%s: code=%x mod=%x ", __stringVal(symS), keyCode, modifiers));
- PRINTF((" alt=%d meta=%d ", __INST(altDown) == true , __INST(metaDown) == true));
- PRINTF((" sh=%d ctrl=%d", __INST(shiftDown) == true , __INST(ctrlDown) == true));
- PRINTF((" arg=%x\n", arg));
- }
-
- (*(*ipS).ilc_func)(self, symS, nil, ipS,
- arg,
- __MKSMALLINT(x),
- __MKSMALLINT(y),
- theView);
- break;
-
- case WM_SYSCOLORCHANGE:
- DPRINTF((">>> WM_SYSCOLORCHANGE\n"));
- (*sysClrChg.ilc_func)(self, @symbol(systemColorChange:), nil, &sysClrChg, theView);
- break;
-
- case WM_FONTCHANGE:
- DPRINTF((">>> WM_FONTCHANGE\n"));
- (*fontChg.ilc_func)(self, @symbol(fontChange), nil, &fontChg);
- break;
-
- case WM_WININICHANGE:
- DPRINTF((">>> WM_WININICHANGE\n"));
- (*settingChg.ilc_func)(self, @symbol(settingsChange), nil, &settingChg);
- break;
-
- case WM_DISPLAYCHANGE:
- DPRINTF((">>> WM_DISPLAYCHANGE\n"));
- (*fontChg.ilc_func)(self, @symbol(displayChange), nil, &fontChg);
- break;
-
- case WM_QUERYENDSESSION:
- DPRINTF((">>> WM_QUERYENDSESSION\n"));
- (*qEndSess.ilc_func)(self, @symbol(queryEndSession), nil, &qEndSess);
- break;
+ nameBuffer[0] = 0;
+ GetKeyNameText(ev->ev_scanCode, nameBuffer, sizeof(nameBuffer));
+ if (__debug_WM_KEYUP__ | __debug_WM_KEYDOWN__ | __debug_WM_CHAR__) {
+ PRINTF(("char is <%d>\n", keyCode));
+ }
+#endif
+ arg = __MKSMALLINT(keyCode & 0xFFFF);
+ break;
+ }
+ }
+ __INST(altDown) = (modifiers & AltMask) ? true : false;
+ __INST(metaDown) = (modifiers & MetaMask) ? true : false;
+ __INST(shiftDown) = (modifiers & ShiftMask) ? true : false;
+ __INST(ctrlDown) = (modifiers & ControlMask) ? true : false;
+
+ if (__debug_WM_CHAR__ | __debug_WM_KEYUP__ | __debug_WM_KEYDOWN__) {
+ PRINTF(("%s: code=%x mod=%x ", __stringVal(symS), keyCode, modifiers));
+ PRINTF((" alt=%d meta=%d ", __INST(altDown) == true , __INST(metaDown) == true));
+ PRINTF((" sh=%d ctrl=%d", __INST(shiftDown) == true , __INST(ctrlDown) == true));
+ PRINTF((" arg=%x\n", arg));
+ }
+
+ (*(*ipS).ilc_func)(self, symS, nil, ipS,
+ arg,
+ __MKSMALLINT(x),
+ __MKSMALLINT(y),
+ theView);
+ break;
+
+ case WM_SYSCOLORCHANGE:
+ DPRINTF((">>> WM_SYSCOLORCHANGE\n"));
+ (*sysClrChg.ilc_func)(self, @symbol(systemColorChange:), nil, &sysClrChg, theView);
+ break;
+
+ case WM_FONTCHANGE:
+ DPRINTF((">>> WM_FONTCHANGE\n"));
+ (*fontChg.ilc_func)(self, @symbol(fontChange), nil, &fontChg);
+ break;
+
+ case WM_WININICHANGE:
+ DPRINTF((">>> WM_WININICHANGE\n"));
+ (*settingChg.ilc_func)(self, @symbol(settingsChange), nil, &settingChg);
+ break;
+
+ case WM_DISPLAYCHANGE:
+ DPRINTF((">>> WM_DISPLAYCHANGE\n"));
+ (*fontChg.ilc_func)(self, @symbol(displayChange), nil, &fontChg);
+ break;
+
+ case WM_QUERYENDSESSION:
+ DPRINTF((">>> WM_QUERYENDSESSION\n"));
+ (*qEndSess.ilc_func)(self, @symbol(queryEndSession), nil, &qEndSess);
+ break;
#ifdef LATER
- case WM_POWER:
- DPRINTF((">>> WM_POWER\n"));
- (*power.ilc_func)(self, @symbol(powerDown), nil, &power);
- break;
-#endif
- /* native widget actions */
- case WM_COMMAND:
- DPRINTF((">>> WM_COMMAND\n"));
- (*command.ilc_func)(self, @symbol(nativeWidgetCommand:view:), nil, &command,
- __MKSMALLINT(ev->ev_wParam), theView);
- break;
-
- /* tray action */
- case WM_TRAY_MESSAGE:
- DPRINTF((">>> WM_TRAY_MESSAGE\n"));
- (*trayMessage.ilc_func)(self, @symbol(trayAction:view:), nil, &trayMessage,
- __MKSMALLINT(ev->ev_arg1), theView);
- break;
-
- /* message from another process */
- case WM_COPYDATA:
- DPRINTF((">>> WM_COPYDATA\n"));
- {
- OBJ eventData;
- void *data = (void *)(ev->ev_arg1);
- int nBytes = ev->ev_arg2;
-
- if (ev->ev_arg1) {
- eventData = __MKBYTEARRAY(data, nBytes);
- } else {
- eventData = nil;
- }
- (*copyData.ilc_func)(self, @symbol(copyDataEvent:eventData:view:), nil, ©Data,
- __MKSMALLINT(ev->ev_wParam), eventData, theView);
- }
- break;
+ case WM_POWER:
+ DPRINTF((">>> WM_POWER\n"));
+ (*power.ilc_func)(self, @symbol(powerDown), nil, &power);
+ break;
+#endif
+ /* native widget actions */
+ case WM_COMMAND:
+ DPRINTF((">>> WM_COMMAND\n"));
+ (*command.ilc_func)(self, @symbol(nativeWidgetCommand:view:), nil, &command,
+ __MKSMALLINT(ev->ev_wParam), theView);
+ break;
+
+ /* tray action */
+ case WM_TRAY_MESSAGE:
+ DPRINTF((">>> WM_TRAY_MESSAGE\n"));
+ (*trayMessage.ilc_func)(self, @symbol(trayAction:view:), nil, &trayMessage,
+ __MKSMALLINT(ev->ev_arg1), theView);
+ break;
+
+ /* message from another process */
+ case WM_COPYDATA:
+ DPRINTF((">>> WM_COPYDATA\n"));
+ {
+ OBJ eventData;
+ void *data = (void *)(ev->ev_arg1);
+ int nBytes = ev->ev_arg2;
+
+ if (ev->ev_arg1) {
+ eventData = __MKBYTEARRAY(data, nBytes);
+ } else {
+ eventData = nil;
+ }
+ (*copyData.ilc_func)(self, @symbol(copyDataEvent:eventData:view:), nil, ©Data,
+ __MKSMALLINT(ev->ev_wParam), eventData, theView);
+ }
+ break;
#ifdef LATER
- case WM_QUIT:
- DPRINTF((">>> WM_QUIT_MESSAGE\n"));
- (*quit.ilc_func)(self, @symbol(quitCommand:), nil, &quit);
- break;
-#endif
- case WM_HSCROLL:
- case WM_VSCROLL:
- {
- int scrollCode = 0;
- OBJ scrollCodeOrScrollCodeSymbol = nil, positionOrNil = nil;
- int pos = 0;
-
- scrollCode = LOWORD(ev->ev_wParam);
- scrollCodeOrScrollCodeSymbol = __MKSMALLINT(scrollCode);
- positionOrNil = nil;
- switch (scrollCode) {
- case SB_BOTTOM:
- scrollCodeOrScrollCodeSymbol = @symbol(SB_BOTTOM);
- break;
- case SB_TOP:
- scrollCodeOrScrollCodeSymbol = @symbol(SB_TOP);
- break;
- case SB_ENDSCROLL:
- scrollCodeOrScrollCodeSymbol = @symbol(SB_ENDSCROLL);
- break;
- case SB_LINEDOWN:
- if (ev->ev_message == WM_HSCROLL) {
- scrollCodeOrScrollCodeSymbol = @symbol(SB_LINERIGHT);
- } else {
- scrollCodeOrScrollCodeSymbol = @symbol(SB_LINEDOWN);
- }
- break;
- case SB_LINEUP:
- if (ev->ev_message == WM_HSCROLL) {
- scrollCodeOrScrollCodeSymbol = @symbol(SB_LINELEFT);
- } else {
- scrollCodeOrScrollCodeSymbol = @symbol(SB_LINEUP);
- }
- break;
- case SB_PAGEDOWN:
- if (ev->ev_message == WM_HSCROLL) {
- scrollCodeOrScrollCodeSymbol = @symbol(SB_PAGERIGHT);
- } else {
- scrollCodeOrScrollCodeSymbol = @symbol(SB_PAGEDOWN);
- }
- break;
- case SB_PAGEUP:
- if (ev->ev_message == WM_HSCROLL) {
- scrollCodeOrScrollCodeSymbol = @symbol(SB_PAGELEFT);
- } else {
- scrollCodeOrScrollCodeSymbol = @symbol(SB_PAGEUP);
- }
- break;
- case SB_THUMBPOSITION:
- if (ev->ev_message == WM_HSCROLL) {
- scrollCodeOrScrollCodeSymbol = @symbol(SB_THUMBPOSITIONHORIZONTAL);
- } else {
- scrollCodeOrScrollCodeSymbol = @symbol(SB_THUMBPOSITIONVERTICAL);
- }
- pos = HIWORD(ev->ev_wParam);
- positionOrNil = __MKSMALLINT(pos);
- break;
- case SB_THUMBTRACK:
- if (ev->ev_message == WM_HSCROLL) {
- scrollCodeOrScrollCodeSymbol = @symbol(SB_THUMBTRACKHORIZONTAL);
- } else {
- scrollCodeOrScrollCodeSymbol = @symbol(SB_THUMBTRACKVERTICAL);
- }
- pos = HIWORD(ev->ev_wParam);
- positionOrNil = __MKSMALLINT(pos);
- break;
- default:
- DPRINTF((">>> WM_SCROLL: unhandled scrollCode:%d %d\n", scrollCode));
- break;
- }
- NDPRINTF((">>> WM_SCROLL: %d %d\n", scrollCode, pos));
-
- (*win32NativeScroll.ilc_func)(self, @symbol(win32NativeScroll:position:view:),
- nil, &win32NativeScroll,
- scrollCodeOrScrollCodeSymbol,
- positionOrNil,
- theView);
- }
- break;
-
- case WM_DRAWITEM:
- {
- NDPRINTF((">>> WM_DRAWITEM: wParam: %x\n", ev->ev_wParam));
- (*win32DrawItem.ilc_func)(self, @symbol(win32DrawItem:view:),
- nil, &win32DrawItem,
- __MKSMALLINT(ev->ev_wParam),
- theView);
- }
- break;
-
- default:
- UNHANDLED_EVENT_PRINTF(("WinWorkstat [info]: >>> unhandled event: %x\n", ev->ev_message));
- break;
+ case WM_QUIT:
+ DPRINTF((">>> WM_QUIT_MESSAGE\n"));
+ (*quit.ilc_func)(self, @symbol(quitCommand:), nil, &quit);
+ break;
+#endif
+ case WM_HSCROLL:
+ case WM_VSCROLL:
+ {
+ int scrollCode = 0;
+ OBJ scrollCodeOrScrollCodeSymbol = nil, positionOrNil = nil;
+ int pos = 0;
+
+ scrollCode = LOWORD(ev->ev_wParam);
+ scrollCodeOrScrollCodeSymbol = __MKSMALLINT(scrollCode);
+ positionOrNil = nil;
+ switch (scrollCode) {
+ case SB_BOTTOM:
+ scrollCodeOrScrollCodeSymbol = @symbol(SB_BOTTOM);
+ break;
+ case SB_TOP:
+ scrollCodeOrScrollCodeSymbol = @symbol(SB_TOP);
+ break;
+ case SB_ENDSCROLL:
+ scrollCodeOrScrollCodeSymbol = @symbol(SB_ENDSCROLL);
+ break;
+ case SB_LINEDOWN:
+ if (ev->ev_message == WM_HSCROLL) {
+ scrollCodeOrScrollCodeSymbol = @symbol(SB_LINERIGHT);
+ } else {
+ scrollCodeOrScrollCodeSymbol = @symbol(SB_LINEDOWN);
+ }
+ break;
+ case SB_LINEUP:
+ if (ev->ev_message == WM_HSCROLL) {
+ scrollCodeOrScrollCodeSymbol = @symbol(SB_LINELEFT);
+ } else {
+ scrollCodeOrScrollCodeSymbol = @symbol(SB_LINEUP);
+ }
+ break;
+ case SB_PAGEDOWN:
+ if (ev->ev_message == WM_HSCROLL) {
+ scrollCodeOrScrollCodeSymbol = @symbol(SB_PAGERIGHT);
+ } else {
+ scrollCodeOrScrollCodeSymbol = @symbol(SB_PAGEDOWN);
+ }
+ break;
+ case SB_PAGEUP:
+ if (ev->ev_message == WM_HSCROLL) {
+ scrollCodeOrScrollCodeSymbol = @symbol(SB_PAGELEFT);
+ } else {
+ scrollCodeOrScrollCodeSymbol = @symbol(SB_PAGEUP);
+ }
+ break;
+ case SB_THUMBPOSITION:
+ if (ev->ev_message == WM_HSCROLL) {
+ scrollCodeOrScrollCodeSymbol = @symbol(SB_THUMBPOSITIONHORIZONTAL);
+ } else {
+ scrollCodeOrScrollCodeSymbol = @symbol(SB_THUMBPOSITIONVERTICAL);
+ }
+ pos = HIWORD(ev->ev_wParam);
+ positionOrNil = __MKSMALLINT(pos);
+ break;
+ case SB_THUMBTRACK:
+ if (ev->ev_message == WM_HSCROLL) {
+ scrollCodeOrScrollCodeSymbol = @symbol(SB_THUMBTRACKHORIZONTAL);
+ } else {
+ scrollCodeOrScrollCodeSymbol = @symbol(SB_THUMBTRACKVERTICAL);
+ }
+ pos = HIWORD(ev->ev_wParam);
+ positionOrNil = __MKSMALLINT(pos);
+ break;
+ default:
+ DPRINTF((">>> WM_SCROLL: unhandled scrollCode:%d %d\n", scrollCode));
+ break;
+ }
+ NDPRINTF((">>> WM_SCROLL: %d %d\n", scrollCode, pos));
+
+ (*win32NativeScroll.ilc_func)(self, @symbol(win32NativeScroll:position:view:),
+ nil, &win32NativeScroll,
+ scrollCodeOrScrollCodeSymbol,
+ positionOrNil,
+ theView);
+ }
+ break;
+
+ case WM_DRAWITEM:
+ {
+ NDPRINTF((">>> WM_DRAWITEM: wParam: %x\n", ev->ev_wParam));
+ (*win32DrawItem.ilc_func)(self, @symbol(win32DrawItem:view:),
+ nil, &win32DrawItem,
+ __MKSMALLINT(ev->ev_wParam),
+ theView);
+ }
+ break;
+
+ default:
+ UNHANDLED_EVENT_PRINTF(("WinWorkstat [info]: >>> unhandled event: %x\n", ev->ev_message));
+ break;
}
%}.
^ true
@@ -12685,8 +12689,8 @@
!
getFontWithFamily:familyString face:faceString
- style:styleArgString size:sizeArg sizeUnit:sizeUnitArg
- encoding:encoding
+ style:styleArgString size:sizeArg sizeUnit:sizeUnitArg
+ encoding:encoding
"try to get the specified font, if not available, try the next smaller
font."
@@ -12695,75 +12699,75 @@
styleString := styleArgString.
encoding isEmptyOrNil ifTrue:[
- encodingSym := #'ms-default' "/ encoding.
+ encodingSym := #'ms-default' "/ encoding.
] ifFalse:[
- encodingSym := encoding asLowercase asSymbol.
+ encodingSym := encoding asLowercase asSymbol.
].
"special: if face is nil, allow access to X-fonts"
faceString isNil ifTrue:[
- sizeArg notNil ifTrue:[
- theName := familyString , '-' , sizeArg printString
- ] ifFalse:[
- theName := familyString
- ].
- theName isNil ifTrue:[
- "
- mhmh - fall back to the default font
- "
- theName := 'fixed'
- ].
- theId := self createFontFor:theName.
- theId isNil ifTrue:[
- theId := self getDefaultFont
- ].
- ^ theId
+ sizeArg notNil ifTrue:[
+ theName := familyString , '-' , sizeArg printString
+ ] ifFalse:[
+ theName := familyString
+ ].
+ theName isNil ifTrue:[
+ "
+ mhmh - fall back to the default font
+ "
+ theName := 'fixed'
+ ].
+ theId := self createFontFor:theName.
+ theId isNil ifTrue:[
+ theId := self getDefaultFont
+ ].
+ ^ theId
].
"/ spacing other than 'normal' is contained as last component
"/ in style
styleString notNil ifTrue:[
- ((styleString endsWith:'-narrow')
- or:[styleString endsWith:'-semicondensed']) ifTrue:[
- |i|
- i := styleString lastIndexOf:$-.
- spacing := styleString copyFrom:(i+1).
- styleString := styleString copyTo:(i-1).
- ] ifFalse:[
- spacing := #normal.
- ].
+ ((styleString endsWith:'-narrow')
+ or:[styleString endsWith:'-semicondensed']) ifTrue:[
+ |i|
+ i := styleString lastIndexOf:$-.
+ spacing := styleString copyFrom:(i+1).
+ styleString := styleString copyTo:(i-1).
+ ] ifFalse:[
+ spacing := #normal.
+ ].
].
xlatedStyle := styleString.
xlatedStyle notNil ifTrue:[
- xlatedStyle := xlatedStyle first asString
+ xlatedStyle := xlatedStyle first asString
].
pxSize := sizeUnitArg == #px ifTrue:[sizeArg] ifFalse:[nil].
ptSize := sizeUnitArg == #pt ifTrue:[sizeArg] ifFalse:[nil].
id := self
- getFontWithFoundry:#*
- family:familyString asLowercase
- weight:faceString
- slant:styleString "/ xlatedStyle
- spacing:spacing
- pixelSize:pxSize
- size:ptSize
- registry:#*
- encoding:encodingSym.
+ getFontWithFoundry:#*
+ family:familyString asLowercase
+ weight:faceString
+ slant:styleString "/ xlatedStyle
+ spacing:spacing
+ pixelSize:pxSize
+ size:ptSize
+ registry:#*
+ encoding:encodingSym.
id isNil ifTrue:[
- id := self
- getFontWithFoundry:#*
- family:familyString asLowercase
- weight:faceString asLowercase
- slant:styleString asLowercase
- spacing:spacing
- pixelSize:pxSize
- size:ptSize
- registry:#*
- encoding:encodingSym.
+ id := self
+ getFontWithFoundry:#*
+ family:familyString asLowercase
+ weight:faceString asLowercase
+ slant:styleString asLowercase
+ spacing:spacing
+ pixelSize:pxSize
+ size:ptSize
+ registry:#*
+ encoding:encodingSym.
].
^ id
@@ -12772,8 +12776,8 @@
!
getFontWithFoundry:foundry family:family weight:weight
- slant:slant spacing:spc pixelSize:pixelSizeOrNil size:pointSize
- registry:registry encoding:encodingArg
+ slant:slant spacing:spc pixelSize:pixelSizeOrNil size:pointSize
+ registry:registry encoding:encodingArg
"get the specified font, if not available, return nil.
For now, this is a poor (incomplete) emulation of the X code ...
@@ -12793,35 +12797,35 @@
"
Windows-NT/95 allows the creation of a font with the following parameters
- nHeight
- nWidth
- nEscapement
- nOrientation
- fnWeight FW_DONTCARE, FW_NORMAL, FW_MEDIUM, FW_BOLD, ...
- fdwItalic TRUE or FALSE
- fdwUnderline TRUE or FALSE
- fdwStrikeOut TRUE or FALSE
- fdwCharSet ANSI_CHARSET, UNICODE_, SYMBOL_, SHIFTJIS_,...
- fdwOutputPrecision DEFAULT, STRING, CHAR, ...
- fdwClipPrecision DEFAULT, CHAR, STROKE, MASK, ...
- fdwQuality DEFAULT, DRAFT, or PROOF.
- fdwPitchAndFamily
- DEFAULT, FIXED or VARIABLE pitch
- DECORATIVE, DONTCASE, MODERN, ROMAN, SCRIPT, or SWISS.
- lpszFace
- Typeface Name
+ nHeight
+ nWidth
+ nEscapement
+ nOrientation
+ fnWeight FW_DONTCARE, FW_NORMAL, FW_MEDIUM, FW_BOLD, ...
+ fdwItalic TRUE or FALSE
+ fdwUnderline TRUE or FALSE
+ fdwStrikeOut TRUE or FALSE
+ fdwCharSet ANSI_CHARSET, UNICODE_, SYMBOL_, SHIFTJIS_,...
+ fdwOutputPrecision DEFAULT, STRING, CHAR, ...
+ fdwClipPrecision DEFAULT, CHAR, STROKE, MASK, ...
+ fdwQuality DEFAULT, DRAFT, or PROOF.
+ fdwPitchAndFamily
+ DEFAULT, FIXED or VARIABLE pitch
+ DECORATIVE, DONTCASE, MODERN, ROMAN, SCRIPT, or SWISS.
+ lpszFace
+ Typeface Name
These two above descriptions will be matched as follows:
- foundry - ignored
- family - mapped to type face name.
- weight - mapped to fnWeight
- slant - used for style
- spacing - NOT USED INITIALLY
- pixelSize - NOT USED INITIALLY
- size - mapped to nHeight
- registry - NOT USED INITIALLY
- encoding - mapped to fdwCharSet
+ foundry - ignored
+ family - mapped to type face name.
+ weight - mapped to fnWeight
+ slant - used for style
+ spacing - NOT USED INITIALLY
+ pixelSize - NOT USED INITIALLY
+ size - mapped to nHeight
+ registry - NOT USED INITIALLY
+ encoding - mapped to fdwCharSet
"
|encoding logSize heightIsCellHeight|
@@ -12829,11 +12833,11 @@
encoding := encodingArg asSymbol.
pixelSizeOrNil notNil ifTrue:[
- logSize := pixelSizeOrNil.
- heightIsCellHeight := false.
+ logSize := pixelSizeOrNil.
+ heightIsCellHeight := false.
] ifFalse:[
- logSize := (pointSize * (self getLogicalPixelSizeY) / 72.0) rounded.
- heightIsCellHeight := false.
+ logSize := (pointSize * (self getLogicalPixelSizeY) / 72.0) rounded.
+ heightIsCellHeight := false.
].
%{
HGDIOBJ hFont;
@@ -12868,155 +12872,155 @@
fdwCharSet = ANSI_CHARSET;
if ((encoding == @symbol('ms-ansi'))) {
- fdwCharSet = ANSI_CHARSET;
+ fdwCharSet = ANSI_CHARSET;
} else if (encoding == @symbol('ms-default')
- || encoding == @symbol(*)) {
- fdwCharSet = DEFAULT_CHARSET;
+ || encoding == @symbol(*)) {
+ fdwCharSet = DEFAULT_CHARSET;
} else if ((encoding == @symbol('ms-symbol'))
- || (encoding == @symbol('misc-fontspecific'))) {
- fdwCharSet = SYMBOL_CHARSET;
+ || (encoding == @symbol('misc-fontspecific'))) {
+ fdwCharSet = SYMBOL_CHARSET;
} else if ((encoding == @symbol('ms-shiftjis'))
- || (encoding == @symbol('jisx0208.1983-0'))){
- fdwCharSet = SHIFTJIS_CHARSET;
+ || (encoding == @symbol('jisx0208.1983-0'))){
+ fdwCharSet = SHIFTJIS_CHARSET;
} else if ((encoding == @symbol('ms-gb2312'))
- || (encoding == @symbol('gb2312.1980-0'))) {
- fdwCharSet = GB2312_CHARSET;
+ || (encoding == @symbol('gb2312.1980-0'))) {
+ fdwCharSet = GB2312_CHARSET;
} else if ((encoding == @symbol('ms-hangeul'))
- || (encoding == @symbol('ksc5601.1987-0'))) {
- fdwCharSet = HANGEUL_CHARSET;
+ || (encoding == @symbol('ksc5601.1987-0'))) {
+ fdwCharSet = HANGEUL_CHARSET;
} else if ((encoding == @symbol('ms-chinesebig5'))
- || (encoding == @symbol('big5'))) {
- fdwCharSet = CHINESEBIG5_CHARSET;
+ || (encoding == @symbol('big5'))) {
+ fdwCharSet = CHINESEBIG5_CHARSET;
} else if (encoding == @symbol('ms-oem')) {
- fdwCharSet = OEM_CHARSET;
+ fdwCharSet = OEM_CHARSET;
} else if (encoding == @symbol('ms-johab')) {
- fdwCharSet = JOHAB_CHARSET;
+ fdwCharSet = JOHAB_CHARSET;
} else if ((encoding == @symbol('ms-hebrew'))
- || (encoding == @symbol('ms-cp1255'))) {
- fdwCharSet = HEBREW_CHARSET;
+ || (encoding == @symbol('ms-cp1255'))) {
+ fdwCharSet = HEBREW_CHARSET;
} else if ((encoding == @symbol('ms-arabic'))
- || (encoding == @symbol('ms-cp1256'))) {
- fdwCharSet = ARABIC_CHARSET;
+ || (encoding == @symbol('ms-cp1256'))) {
+ fdwCharSet = ARABIC_CHARSET;
} else if ((encoding == @symbol('ms-greek'))
- || (encoding == @symbol('ms-cp1253'))) {
- fdwCharSet = GREEK_CHARSET;
+ || (encoding == @symbol('ms-cp1253'))) {
+ fdwCharSet = GREEK_CHARSET;
} else if ((encoding == @symbol('ms-turkish'))
- || (encoding == @symbol('ms-cp1254'))) {
- fdwCharSet = TURKISH_CHARSET;
+ || (encoding == @symbol('ms-cp1254'))) {
+ fdwCharSet = TURKISH_CHARSET;
} else if ((encoding == @symbol('ms-russian'))
- || (encoding == @symbol('ms-cp1251'))) {
- fdwCharSet = RUSSIAN_CHARSET;
+ || (encoding == @symbol('ms-cp1251'))) {
+ fdwCharSet = RUSSIAN_CHARSET;
} else if ((encoding == @symbol('ms-easteurope'))
- || (encoding == @symbol('ms-cp1250'))) {
- fdwCharSet = EASTEUROPE_CHARSET;
+ || (encoding == @symbol('ms-cp1250'))) {
+ fdwCharSet = EASTEUROPE_CHARSET;
} else if ((encoding == @symbol('ms-baltic'))
- || (encoding == @symbol('ms-cp1257'))) {
- fdwCharSet = BALTIC_CHARSET;
+ || (encoding == @symbol('ms-cp1257'))) {
+ fdwCharSet = BALTIC_CHARSET;
} else if ((encoding == @symbol('ms-vietnamese'))) {
- fdwCharSet = VIETNAMESE_CHARSET;
+ fdwCharSet = VIETNAMESE_CHARSET;
} else if ((encoding == @symbol('ms-thai'))) {
- fdwCharSet = THAI_CHARSET;
+ fdwCharSet = THAI_CHARSET;
} else if ((encoding == @symbol('ms-mac'))) {
- fdwCharSet = MAC_CHARSET;
+ fdwCharSet = MAC_CHARSET;
#ifdef UNICODE_CHARSET
} else if ((encoding == @symbol('ms-unicode'))) {
- fdwCharSet = UNICODE_CHARSET;
+ fdwCharSet = UNICODE_CHARSET;
#endif
}
if ( __isStringLike( family ) ) {
- work = __stringVal( family );
- if (strcmp( work, "nil" ) != 0 ) {
- strncpy( faceName, work, sizeof(faceName)-1 );
- }
+ work = __stringVal( family );
+ if (strcmp( work, "nil" ) != 0 ) {
+ strncpy( faceName, work, sizeof(faceName)-1 );
+ }
}
/* Q: should we allow those ? (they make ST/X programs less portable to X */
if( __isStringLike( weight ) ) {
- work = __stringVal( weight );
- if (strcmp( work, "bold" ) == 0 ) {
- fnWeight = FW_BOLD;
- } else if (strcmp( work, "medium" ) == 0 ) {
- fnWeight = FW_MEDIUM;
- } else if (strcmp( work, "normal" ) == 0 ) {
- fnWeight = FW_NORMAL;
- } else if (strcmp( work, "light" ) == 0 ) {
- fnWeight = FW_LIGHT;
- } else if (strcmp( work, "demi" ) == 0 ) {
- fnWeight = FW_LIGHT;
- } else if (strcmp( work, "heavy" ) == 0 ) {
- fnWeight = FW_HEAVY;
- } else if (strcmp( work, "extraBold" ) == 0 ) {
- fnWeight = FW_EXTRABOLD;
- } else if (strcmp( work, "semiBold" ) == 0 ) {
- fnWeight = FW_SEMIBOLD;
- } else if (strcmp( work, "thin" ) == 0 ) {
- fnWeight = FW_THIN;
- } else if (strcmp( work, "extraLight" ) == 0 ) {
- fnWeight = FW_EXTRALIGHT;
- }
+ work = __stringVal( weight );
+ if (strcmp( work, "bold" ) == 0 ) {
+ fnWeight = FW_BOLD;
+ } else if (strcmp( work, "medium" ) == 0 ) {
+ fnWeight = FW_MEDIUM;
+ } else if (strcmp( work, "normal" ) == 0 ) {
+ fnWeight = FW_NORMAL;
+ } else if (strcmp( work, "light" ) == 0 ) {
+ fnWeight = FW_LIGHT;
+ } else if (strcmp( work, "demi" ) == 0 ) {
+ fnWeight = FW_LIGHT;
+ } else if (strcmp( work, "heavy" ) == 0 ) {
+ fnWeight = FW_HEAVY;
+ } else if (strcmp( work, "extraBold" ) == 0 ) {
+ fnWeight = FW_EXTRABOLD;
+ } else if (strcmp( work, "semiBold" ) == 0 ) {
+ fnWeight = FW_SEMIBOLD;
+ } else if (strcmp( work, "thin" ) == 0 ) {
+ fnWeight = FW_THIN;
+ } else if (strcmp( work, "extraLight" ) == 0 ) {
+ fnWeight = FW_EXTRALIGHT;
+ }
} else if (__isSmallInteger(weight)) {
- fnWeight = __intVal(weight);
+ fnWeight = __intVal(weight);
}
if(__isSmallInteger( logSize )) {
- nHeight = __intVal( logSize );
+ nHeight = __intVal( logSize );
}
if (__isStringLike(slant)) {
- work2 = __stringVal( slant );
- work = __stringVal( slant );
-
- if (strncmp(work2, "italic", 6) == 0) {
- fdwItalic = TRUE;
- if ( work2[6] == '-' )
- strncpy( work, &work2[7], ( strlen( work2) - 7) );
- } else {
- if (strncmp(work2, "oblique", 7) == 0) {
- fdwItalic = TRUE;
- if ( work2[7] == '-' )
- strncpy( work, &work2[8], ( strlen( work2) - 8) );
- }
- }
- if (strncmp( work, "underline", 9 ) == 0 ) {
- fdwUnderline = TRUE;
- if( work[10] == '-' )
- strncpy( work2, &work[11], ( strlen( work ) - 10 ) );
- }
- if (strncmp( work2, "strikeOut", 9 ) == 0 ) {
- fdwStrikeOut = TRUE;
- }
+ work2 = __stringVal( slant );
+ work = __stringVal( slant );
+
+ if (strncmp(work2, "italic", 6) == 0) {
+ fdwItalic = TRUE;
+ if ( work2[6] == '-' )
+ strncpy( work, &work2[7], ( strlen( work2) - 7) );
+ } else {
+ if (strncmp(work2, "oblique", 7) == 0) {
+ fdwItalic = TRUE;
+ if ( work2[7] == '-' )
+ strncpy( work, &work2[8], ( strlen( work2) - 8) );
+ }
+ }
+ if (strncmp( work, "underline", 9 ) == 0 ) {
+ fdwUnderline = TRUE;
+ if( work[10] == '-' )
+ strncpy( work2, &work[11], ( strlen( work ) - 10 ) );
+ }
+ if (strncmp( work2, "strikeOut", 9 ) == 0 ) {
+ fdwStrikeOut = TRUE;
+ }
}
DPRINTF(("CreateFont face:%s h=%d w=%d wght=%d\n",
- faceName, nHeight, nWidth, fnWeight));
+ faceName, nHeight, nWidth, fnWeight));
hFont = CreateFont(
- (
- (heightIsCellHeight == true) ?
- nHeight : -nHeight /* positive:cell height; negative:character height */
- ),
- nWidth,
- nEscapement,
- nOrientation,
- fnWeight,
- fdwItalic,
- fdwUnderline,
- fdwStrikeOut,
- fdwCharSet,
- fdwOutputPrecision,
- fdwClipPrecision,
- fdwQuality,
- fdwPitchAndFamily,
- faceName );
+ (
+ (heightIsCellHeight == true) ?
+ nHeight : -nHeight /* positive:cell height; negative:character height */
+ ),
+ nWidth,
+ nEscapement,
+ nOrientation,
+ fnWeight,
+ fdwItalic,
+ fdwUnderline,
+ fdwStrikeOut,
+ fdwCharSet,
+ fdwOutputPrecision,
+ fdwClipPrecision,
+ fdwQuality,
+ fdwPitchAndFamily,
+ faceName );
if (hFont != NULL) {
- DPRINTF(("createFont: %x\n", hFont));
+ DPRINTF(("createFont: %x\n", hFont));
#ifdef COUNT_RESOURCES
- __cnt_font++;
- RES1PRINTF(("CreateFont %d\n", __cnt_font));
-#endif
- RETURN ( __MKOBJ(hFont) );
+ __cnt_font++;
+ RES1PRINTF(("CreateFont %d\n", __cnt_font));
+#endif
+ RETURN ( __MKOBJ(hFont) );
}
DPRINTF(("***** ERROR createFontWithFoundry failed ERROR *****\n" ));
@@ -13025,14 +13029,14 @@
"
Display getFontWithFoundry:'*'
- family:'courier'
- weight:'medium'
- slant:'r'
- spacing:nil
- pixelSize:nil
- size:13
- registry:'iso8859'
- encoding:#*
+ family:'courier'
+ weight:'medium'
+ slant:'r'
+ spacing:nil
+ pixelSize:nil
+ size:13
+ registry:'iso8859'
+ encoding:#*
"
"new NT Version: 20.2.1997 / 22:33:29 / dq"
@@ -13063,28 +13067,28 @@
"/Transcript showCR:typeFaceList.
typeFaceList do:[:typeFace |
- self primEnumFontsIn:typeFace into:list.
+ self primEnumFontsIn:typeFace into:list.
].
] valueUninterruptably.
"/ Transcript showCR:list.
listOfFonts := OrderedCollection new.
list do:[:anInfoArray |
- | fntDescr italicFontDescr |
-
- fntDescr := self fontDescriptionFromLogicalFontInfoArray:anInfoArray.
- listOfFonts add:fntDescr.
-
- "/ manually generate italic version (any font can be made italic here)
- (fntDescr style startsWith:'roman') ifTrue:[
- italicFontDescr := FontDescription
- family:fntDescr family
- face:fntDescr face
- style:('italic' , (fntDescr style copyFrom:'roman' size+1))
- size:fntDescr size
- encoding:fntDescr encoding.
- listOfFonts add:italicFontDescr.
- ].
+ | fntDescr italicFontDescr |
+
+ fntDescr := self fontDescriptionFromLogicalFontInfoArray:anInfoArray.
+ listOfFonts add:fntDescr.
+
+ "/ manually generate italic version (any font can be made italic here)
+ (fntDescr style startsWith:'roman') ifTrue:[
+ italicFontDescr := FontDescription
+ family:fntDescr family
+ face:fntDescr face
+ style:('italic' , (fntDescr style copyFrom:'roman' size+1))
+ size:fntDescr size
+ encoding:fntDescr encoding.
+ listOfFonts add:italicFontDescr.
+ ].
].
^ listOfFonts
@@ -13124,9 +13128,9 @@
%{
if (__tmpDC) {
#ifdef USE_EnumFontFamiliesEx
- EnumFontFamiliesEx( __tmpDC, NULL, EnumFPTypeFaceProc, (DWORD)&(typeFaceList));
-#else
- EnumFontFamilies( __tmpDC, NULL, EnumFPTypeFaceProc, (DWORD)&(typeFaceList));
+ EnumFontFamiliesEx( __tmpDC, NULL, EnumFPTypeFaceProc, (DWORD)&(typeFaceList));
+#else
+ EnumFontFamilies( __tmpDC, NULL, EnumFPTypeFaceProc, (DWORD)&(typeFaceList));
#endif
}
%}
@@ -13137,13 +13141,13 @@
char *cp;
if (__isStringLike(typeFace)) {
- if (__tmpDC) {
+ if (__tmpDC) {
#ifdef USE_EnumFontFamiliesEx
- EnumFontFamiliesEx(__tmpDC, __stringVal(typeFace), EnumFontsProc, (DWORD)&(fontList));
-#else
- EnumFontFamilies(__tmpDC, __stringVal(typeFace), EnumFontsProc, (DWORD)&(fontList));
-#endif
- }
+ EnumFontFamiliesEx(__tmpDC, __stringVal(typeFace), EnumFontsProc, (DWORD)&(fontList));
+#else
+ EnumFontFamilies(__tmpDC, __stringVal(typeFace), EnumFontsProc, (DWORD)&(fontList));
+#endif
+ }
}
%}.
!
@@ -13166,68 +13170,68 @@
%{
if (__isExternalAddress(fontId)
- && __isArray(rawData)
- && (__arraySize(rawData) >= 11)) {
- SIZE size;
- int avgWidth;
- HGDIOBJ hFont;
- HGDIOBJ prevFont;
- TEXTMETRIC tmet;
- OBJ t;
-
- hFont = _HGDIOBJVal(fontId);
-
- /*
- * temporarily set this font in the tmpDC (root-) context
- */
+ && __isArray(rawData)
+ && (__arraySize(rawData) >= 11)) {
+ SIZE size;
+ int avgWidth;
+ HGDIOBJ hFont;
+ HGDIOBJ prevFont;
+ TEXTMETRIC tmet;
+ OBJ t;
+
+ hFont = _HGDIOBJVal(fontId);
+
+ /*
+ * temporarily set this font in the tmpDC (root-) context
+ */
#ifdef CACHE_LAST_TMP_FONT
- if (__tmpDC_hfont != hFont) {
- prevFont = SelectObject(__tmpDC, hFont);
- if (__tmpDC_prev_hfont == NULL) {
- __tmpDC_prev_hfont = prevFont;
- }
- __tmpDC_hfont = hFont;
- }
-#else
- prevFont = SelectObject(__tmpDC, hFont);
-#endif
- GetTextMetricsW(__tmpDC, &tmet);
+ if (__tmpDC_hfont != hFont) {
+ prevFont = SelectObject(__tmpDC, hFont);
+ if (__tmpDC_prev_hfont == NULL) {
+ __tmpDC_prev_hfont = prevFont;
+ }
+ __tmpDC_hfont = hFont;
+ }
+#else
+ prevFont = SelectObject(__tmpDC, hFont);
+#endif
+ GetTextMetricsW(__tmpDC, &tmet);
#if 0
- {
- static char *s = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
- static int len;
-
- if (len == 0) {
- len = strlen(s);
- }
- GetTextExtentPoint32(__tmpDC, s, len, &size);
- avgWidth = (size.cx / (len / 2) + 1) / 2;
- }
-#else
- avgWidth = tmet.tmAveCharWidth;
+ {
+ static char *s = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
+ static int len;
+
+ if (len == 0) {
+ len = strlen(s);
+ }
+ GetTextExtentPoint32(__tmpDC, s, len, &size);
+ avgWidth = (size.cx / (len / 2) + 1) / 2;
+ }
+#else
+ avgWidth = tmet.tmAveCharWidth;
#endif
#ifndef CACHE_LAST_TMP_FONT
- SelectObject(__tmpDC, prevFont);
-#endif
-
- __ArrayInstPtr(rawData)->a_element[0] = __MKSMALLINT(tmet.tmAscent); /* ascent -> (data at:1) */
- __ArrayInstPtr(rawData)->a_element[1] = __MKSMALLINT(tmet.tmDescent); /* descent -> (data at:2) */
- __ArrayInstPtr(rawData)->a_element[2] = __MKSMALLINT(tmet.tmAscent); /* maxAscent -> (data at:3) */
- __ArrayInstPtr(rawData)->a_element[3] = __MKSMALLINT(tmet.tmDescent); /* maxDescent -> (data at:4) */
- __ArrayInstPtr(rawData)->a_element[4] = __MKSMALLINT(avgWidth); /* minWidth -> (data at:5) */
- __ArrayInstPtr(rawData)->a_element[5] = __MKSMALLINT(tmet.tmMaxCharWidth); /* maxWidth -> (data at:6) */
- __ArrayInstPtr(rawData)->a_element[6] = __MKSMALLINT(avgWidth); /* avgWidth -> (data at:7) */
- __ArrayInstPtr(rawData)->a_element[7] = __MKSMALLINT(tmet.tmFirstChar); /* min -> (data at:8) */
- __ArrayInstPtr(rawData)->a_element[8] = __MKSMALLINT(tmet.tmLastChar); /* max -> (data at:9) */
- __ArrayInstPtr(rawData)->a_element[9] = __MKSMALLINT(tmet.tmDefaultChar); /* default -> (data at:10) */
- t = __charSetSymbolFor(tmet.tmCharSet);
- __ArrayInstPtr(rawData)->a_element[10]= t; __STORE(rawData, t); /* charSet -> (data at:11) */
-
- DPRINTF(("textMetrics h=%x avgAsc=%d avgDesc=%d minW=%d maxW=%d avgW=%d\n",
- hFont, tmet.tmAscent, tmet.tmDescent, avgWidth, tmet.tmMaxCharWidth,
- tmet.tmAveCharWidth));
- RETURN (self);
+ SelectObject(__tmpDC, prevFont);
+#endif
+
+ __ArrayInstPtr(rawData)->a_element[0] = __MKSMALLINT(tmet.tmAscent); /* ascent -> (data at:1) */
+ __ArrayInstPtr(rawData)->a_element[1] = __MKSMALLINT(tmet.tmDescent); /* descent -> (data at:2) */
+ __ArrayInstPtr(rawData)->a_element[2] = __MKSMALLINT(tmet.tmAscent); /* maxAscent -> (data at:3) */
+ __ArrayInstPtr(rawData)->a_element[3] = __MKSMALLINT(tmet.tmDescent); /* maxDescent -> (data at:4) */
+ __ArrayInstPtr(rawData)->a_element[4] = __MKSMALLINT(avgWidth); /* minWidth -> (data at:5) */
+ __ArrayInstPtr(rawData)->a_element[5] = __MKSMALLINT(tmet.tmMaxCharWidth); /* maxWidth -> (data at:6) */
+ __ArrayInstPtr(rawData)->a_element[6] = __MKSMALLINT(avgWidth); /* avgWidth -> (data at:7) */
+ __ArrayInstPtr(rawData)->a_element[7] = __MKSMALLINT(tmet.tmFirstChar); /* min -> (data at:8) */
+ __ArrayInstPtr(rawData)->a_element[8] = __MKSMALLINT(tmet.tmLastChar); /* max -> (data at:9) */
+ __ArrayInstPtr(rawData)->a_element[9] = __MKSMALLINT(tmet.tmDefaultChar); /* default -> (data at:10) */
+ t = __charSetSymbolFor(tmet.tmCharSet);
+ __ArrayInstPtr(rawData)->a_element[10]= t; __STORE(rawData, t); /* charSet -> (data at:11) */
+
+ DPRINTF(("textMetrics h=%x avgAsc=%d avgDesc=%d minW=%d maxW=%d avgW=%d\n",
+ hFont, tmet.tmAscent, tmet.tmDescent, avgWidth, tmet.tmMaxCharWidth,
+ tmet.tmAveCharWidth));
+ RETURN (self);
}
RETURN (nil);
%}
@@ -14501,13 +14505,13 @@
windows displays ...)"
displayId notNil ifTrue:[
- "/ already connected - trying to trick me ?
- ^ self
+ "/ already connected - trying to trick me ?
+ ^ self
].
displayId := self primInitializeFor:aDisplayName.
displayId isNil ifTrue:[
- self class deviceOpenErrorSignal raiseWith:aDisplayName
+ self class deviceOpenErrorSignal raiseWith:aDisplayName
].
dispatching := false.
@@ -17520,11 +17524,11 @@
primEnumChildWindowsOf:aWindowId into:handleList
%{
if (__isExternalAddress(aWindowId)) {
- HWND hwParent = _HWNDVal(aWindowId);
-
- if ( EnumChildWindows( hwParent, EnumWindowsProc, (DWORD)&(handleList))) {
- DPRINTF(("EnumChildWindows successful\n"));
- }
+ HWND hwParent = _HWNDVal(aWindowId);
+
+ if ( EnumChildWindows( hwParent, EnumWindowsProc, (DWORD)&(handleList))) {
+ DPRINTF(("EnumChildWindows successful\n"));
+ }
}
%}
!
@@ -17532,7 +17536,7 @@
primEnumWindowsInto:handleList
%{
if ( EnumWindows( EnumWindowsProc, (DWORD)&(handleList))) {
- DPRINTF(("EnumWindows successful\n"));
+ DPRINTF(("EnumWindows successful\n"));
}
%}
!
@@ -17540,9 +17544,9 @@
primEnumWindowsOf:threadId into:handleList
%{
if (__isSmallInteger(threadId)) {
- if ( EnumThreadWindows( __intVal(threadId), EnumWindowsProc, (DWORD)&(handleList))) {
- DPRINTF(("EnumThreadWindows successful\n"));
- }
+ if ( EnumThreadWindows( __intVal(threadId), EnumWindowsProc, (DWORD)&(handleList))) {
+ DPRINTF(("EnumThreadWindows successful\n"));
+ }
}
%}
!
@@ -18819,11 +18823,11 @@
!WinWorkstation class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libview/WinWorkstation.st,v 1.431 2010-08-05 13:42:11 stefan Exp $'
+ ^ '$Header: /cvs/stx/stx/libview/WinWorkstation.st,v 1.432 2010-08-24 11:59:28 cg Exp $'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libview/WinWorkstation.st,v 1.431 2010-08-05 13:42:11 stefan Exp $'
+ ^ '$Header: /cvs/stx/stx/libview/WinWorkstation.st,v 1.432 2010-08-24 11:59:28 cg Exp $'
! !
WinWorkstation initialize!