|
From: Andreas R. <and...@us...> - 2002-05-04 23:20:32
|
Update of /cvsroot/squeak/squeak/platforms/win32/vm
In directory usw-pr-cvs1:/tmp/cvs-serv7733/vm
Modified Files:
sqWin32.h sqWin32Alloc.c sqWin32Args.c sqWin32Directory.c
sqWin32ExternalPrims.c sqWin32Intel.c sqWin32PluginSupport.c
sqWin32Prefs.c sqWin32Service.c sqWin32Utils.c sqWin32Window.c
Added Files:
sqWin32Exports.c
Log Message:
Update to 3.2.1
--- NEW FILE: sqWin32Exports.c ---
#include <stdio.h>
int win32JoystickDebugInfo(void);
int win32JoystickDebugPrintRawValues(void);
int win32JoystickDebugPrintAlternativeValues(void);
int win32DebugPrintSocketState(void);
int primitivePluginBrowserReady(void);
int primitivePluginRequestURLStream(void);
int primitivePluginRequestURL(void);
int primitivePluginPostURL(void);
int primitivePluginRequestFileHandle(void);
int primitivePluginDestroyRequest(void);
int primitivePluginRequestState(void);
extern void* stWindow;
extern void* firstMessageHook;
extern void* preMessageHook;
void *os_exports[][3] = {
{"","win32JoystickDebugInfo", win32JoystickDebugInfo},
{"","win32JoystickDebugPrintRawValues", win32JoystickDebugPrintRawValues},
{"","win32JoystickDebugPrintAlternativeValues", win32JoystickDebugPrintAlternativeValues},
{"","win32DebugPrintSocketState", win32DebugPrintSocketState},
{"","primitivePluginBrowserReady", primitivePluginBrowserReady},
{"","primitivePluginRequestURLStream", primitivePluginRequestURLStream},
{"","primitivePluginRequestURL", primitivePluginRequestURL},
{"","primitivePluginPostURL", primitivePluginPostURL},
{"","primitivePluginRequestFileHandle", primitivePluginRequestFileHandle},
{"","primitivePluginDestroyRequest", primitivePluginDestroyRequest},
{"","primitivePluginRequestState", primitivePluginRequestState},
{"","stWindow", &stWindow},
{"","firstMessageHook", &firstMessageHook},
{"","preMessageHook", &preMessageHook},
{NULL,NULL, NULL}
};
Index: sqWin32.h
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/win32/vm/sqWin32.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** sqWin32.h 28 Jan 2002 13:56:59 -0000 1.2
--- sqWin32.h 4 May 2002 23:20:28 -0000 1.3
***************
*** 241,245 ****
#endif
! #define SQUEAK_VM_VERSION TEXT("Squeak 3.1 VM (alpha build 6) from ") TEXT(__DATE__) \
TEXT("\n") TEXT("Compiler: ") TEXT(COMPILER) TEXT(VERSION)
--- 241,245 ----
#endif
! #define SQUEAK_VM_VERSION TEXT("Squeak 3.2.1 VM (release candidate) from ") TEXT(__DATE__) \
TEXT("\n") TEXT("Compiler: ") TEXT(COMPILER) TEXT(VERSION)
Index: sqWin32Alloc.c
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/win32/vm/sqWin32Alloc.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
Index: sqWin32Args.c
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/win32/vm/sqWin32Args.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** sqWin32Args.c 5 Apr 2002 00:42:25 -0000 1.2
--- sqWin32Args.c 4 May 2002 23:20:28 -0000 1.3
***************
*** 26,45 ****
fp = fopen(name,"rb");
if(!fp) return 0; /* not an image */
! if(fread(&magic, 1, sizeof(magic), fp) != sizeof(magic))
! {
! fclose(fp);
! return 0;
! }
! if (readableFormat(magic) || readableFormat(byteSwapped(magic))) {
! fclose(fp);
! return true;
}
/* no luck at beginning of file, seek to 512 and try again */
if(fseek( fp, 512, SEEK_SET)) {
! /* seek failed, which implies file is too small */
! fclose(fp);
! return false;
};
if(fread(&magic, 1, sizeof(magic), fp) != sizeof(magic))
{
--- 26,45 ----
fp = fopen(name,"rb");
if(!fp) return 0; /* not an image */
! if(fread(&magic, 1, sizeof(magic), fp) != sizeof(magic)) {
! fclose(fp);
! return 0;
! }
! if(readableFormat(magic) || readableFormat(byteSwapped(magic))) {
! fclose(fp);
! return true;
}
/* no luck at beginning of file, seek to 512 and try again */
if(fseek( fp, 512, SEEK_SET)) {
! /* seek failed, which implies file is too small */
! fclose(fp);
! return false;
};
+
if(fread(&magic, 1, sizeof(magic), fp) != sizeof(magic))
{
Index: sqWin32Directory.c
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/win32/vm/sqWin32Directory.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
Index: sqWin32ExternalPrims.c
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/win32/vm/sqWin32ExternalPrims.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
Index: sqWin32Intel.c
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/win32/vm/sqWin32Intel.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** sqWin32Intel.c 28 Jan 2002 13:56:59 -0000 1.2
--- sqWin32Intel.c 4 May 2002 23:20:28 -0000 1.3
***************
*** 145,150 ****
int OutputConsoleString(char *string)
! { int pos;
pos = SendMessage(consoleWindow,WM_GETTEXTLENGTH, 0,0);
SendMessage(consoleWindow, EM_SETSEL, pos, pos);
--- 145,164 ----
int OutputConsoleString(char *string)
! {
! int pos;
+ if(fDynamicConsole && !fShowConsole) {
+ /* show console window */
+ ShowWindow(consoleWindow, SW_SHOW);
+ fShowConsole = TRUE;
+ #ifndef NO_PREFERENCES
+ CheckMenuItem(vmPrefsMenu, 0x0030, MF_BYCOMMAND | MF_CHECKED);
+ #endif
+ OutputConsoleString(
+ "# Debug console\n"
+ "# To close: F2 -> 'debug options' -> 'show output console'\n"
+ "# To disable: F2 -> 'debug options' -> 'show console on errors'\n"
+ );
+ }
pos = SendMessage(consoleWindow,WM_GETTEXTLENGTH, 0,0);
SendMessage(consoleWindow, EM_SETSEL, pos, pos);
***************
*** 154,166 ****
string++;
}
- /* something has been written in the console */
- if(fDynamicConsole)
- {
- ShowWindow(consoleWindow, SW_SHOW);
- fShowConsole = TRUE;
- #ifndef NO_PREFERENCES
- CheckMenuItem(vmPrefsMenu, 0x0030, MF_BYCOMMAND | MF_CHECKED);
- #endif
- }
return 1;
}
--- 168,171 ----
***************
*** 465,471 ****
--- 470,481 ----
}
+ extern int inCleanExit;
+
void __cdecl Cleanup(void)
{ /* not all of these are essential, but they're polite... */
+ if(!inCleanExit) {
+ printCallStack();
+ }
ioShutdownAllModules();
#ifndef NO_PLUGIN_SUPPORT
Index: sqWin32PluginSupport.c
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/win32/vm/sqWin32PluginSupport.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** sqWin32PluginSupport.c 24 Oct 2001 23:14:28 -0000 1.1.1.1
--- sqWin32PluginSupport.c 4 May 2002 23:20:28 -0000 1.2
***************
*** 1,7 ****
-
/* Plugin support primitives */
#include <windows.h>
#include "sq.h"
! #include "FilePlugin.h"
#ifdef DEBUG
--- 1,6 ----
/* Plugin support primitives */
#include <windows.h>
#include "sq.h"
! #include "../plugins/FilePlugin/FilePlugin.h"
#ifdef DEBUG
Index: sqWin32Prefs.c
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/win32/vm/sqWin32Prefs.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
Index: sqWin32Service.c
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/win32/vm/sqWin32Service.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
Index: sqWin32Utils.c
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/win32/vm/sqWin32Utils.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
Index: sqWin32Window.c
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/win32/vm/sqWin32Window.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** sqWin32Window.c 6 Mar 2002 10:32:21 -0000 1.3
--- sqWin32Window.c 4 May 2002 23:20:28 -0000 1.4
***************
*** 444,447 ****
--- 444,455 ----
static DWORD dwTimerPeriod;
+ static DWORD timerID;
+ int _lowResMSecs = 0;
+
+ void CALLBACK timerCallback(UINT uTimerID, UINT uMsg, DWORD dwUser, DWORD dw1, DWORD dw2) {
+ _lowResMSecs++;
+ interruptCheckCounter = 0;
+ }
+
#include <mmsystem.h>
void SetupTimer()
***************
*** 458,461 ****
--- 466,473 ----
if(timeBeginPeriod(dwTimerPeriod) != 0)
return;
+ timerID = timeSetEvent(dwTimerPeriod, 0,
+ timerCallback, 0,
+ TIME_PERIODIC |
+ TIME_CALLBACK_FUNCTION);
#endif /* defined(_WIN32_WCE) */
}
***************
*** 464,467 ****
--- 476,480 ----
{
#if !defined(_WIN32_WCE)
+ timeKillEvent(timerID);
timeEndPeriod(dwTimerPeriod);
#endif /* !defined(_WIN32_WCE) */
***************
*** 769,772 ****
--- 782,786 ----
{ RECT r;
int width, height, maxWidth, maxHeight, actualWidth, actualHeight;
+ int deltaWidth, deltaHeight;
if(!IsWindow(stWindow)) return; /* might happen if run as NT service */
***************
*** 806,813 ****
actualWidth = r.right - r.left;
actualHeight = r.bottom - r.top;
! width += (width - actualWidth);
! height += (height - actualHeight);
! width = ( width <= maxWidth) ? width : maxWidth;
! height = (height <= maxHeight) ? height : maxHeight;
SetWindowPos(stWindow,
--- 820,832 ----
actualWidth = r.right - r.left;
actualHeight = r.bottom - r.top;
! /* deltaWidth/height contains the 'decoration' of the window */
! deltaWidth = width - actualWidth;
! deltaHeight = height - actualHeight;
! width += deltaWidth;
! height += deltaHeight;
! width = (width <= (maxWidth + deltaWidth)) ?
! width : (maxWidth + deltaWidth);
! height = (height <= (maxHeight + deltaHeight)) ?
! height : (maxHeight + deltaHeight);
SetWindowPos(stWindow,
***************
*** 916,924 ****
blue = yellow = 0;
} else if(f3ButtonMouse) {
- blue = msg->wParam & MK_RBUTTON;
- yellow = msg->wParam & MK_MBUTTON;
- } else {
blue = msg->wParam & MK_MBUTTON;
yellow = msg->wParam & MK_RBUTTON;
}
if(red && !blue && !yellow) { /* red button honors modifiers */
--- 935,943 ----
blue = yellow = 0;
} else if(f3ButtonMouse) {
blue = msg->wParam & MK_MBUTTON;
yellow = msg->wParam & MK_RBUTTON;
+ } else {
+ blue = msg->wParam & MK_RBUTTON;
+ yellow = msg->wParam & MK_MBUTTON;
}
if(red && !blue && !yellow) { /* red button honors modifiers */
***************
*** 1258,1264 ****
--- 1277,1285 ----
/* Misc support primitves */
/****************************************************************************/
+ int inCleanExit = 0;
int ioExit(void)
{
+ inCleanExit = 1;
exit(0);
/* avoid the warnings here */
***************
*** 1275,1279 ****
--- 1296,1304 ----
{
/* Make sure the value fits into Squeak SmallIntegers */
+ #ifndef _WIN32_WCE
+ return timeGetTime() & 0x3FFFFFFF;
+ #else
return GetTickCount() &0x3FFFFFFF;
+ #endif
}
***************
*** 1973,1981 ****
After resizing the main window the affected area can
be larger than the area covered by the display bits ... */
! if (affectedR > width) affectedR= width;
! if (affectedB > height) affectedB= height;
/* ... and don't forget left and top - else reverse_image_* will crash */
! if (affectedL > width) affectedL= width;
! if (affectedT > height) affectedT= height;
/* Don't draw empty areas */
--- 1998,2006 ----
After resizing the main window the affected area can
be larger than the area covered by the display bits ... */
! if (affectedR > width) affectedR= width-1;
! if (affectedB > height) affectedB= height-1;
/* ... and don't forget left and top - else reverse_image_* will crash */
! if (affectedL > width) affectedL= width-1;
! if (affectedT > height) affectedT= height-1;
/* Don't draw empty areas */
|