You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
(27) |
Apr
(11) |
May
(112) |
Jun
(8) |
Jul
(10) |
Aug
(68) |
Sep
(12) |
Oct
(3) |
Nov
(19) |
Dec
(3) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(6) |
Feb
(15) |
Mar
(20) |
Apr
(22) |
May
(131) |
Jun
(27) |
Jul
(19) |
Aug
(207) |
Sep
(61) |
Oct
(27) |
Nov
(28) |
Dec
(21) |
| 2004 |
Jan
(7) |
Feb
(25) |
Mar
(14) |
Apr
(55) |
May
(15) |
Jun
(2) |
Jul
(14) |
Aug
(28) |
Sep
(29) |
Oct
|
Nov
|
Dec
|
|
From: Andreas R. <and...@us...> - 2003-04-08 21:17:40
|
Update of /cvsroot/squeak/squeak/platforms/win32/extras In directory sc8-pr-cvs1:/tmp/cvs-serv9234/extras Log Message: Directory /cvsroot/squeak/squeak/platforms/win32/extras added to the repository |
|
From: Andreas R. <and...@us...> - 2003-04-08 21:17:16
|
Update of /cvsroot/squeak/squeak/platforms/win32/vm
In directory sc8-pr-cvs1:/tmp/cvs-serv8923
Modified Files:
sqWin32Window.c
Log Message:
fix sqNextEventPut() to be non-static
Index: sqWin32Window.c
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/win32/vm/sqWin32Window.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** sqWin32Window.c 8 Apr 2003 20:59:02 -0000 1.12
--- sqWin32Window.c 8 Apr 2003 21:17:11 -0000 1.13
***************
*** 145,149 ****
void SetSystemTrayIcon(BOOL on);
! static sqInputEvent *sqNextEventPut(void);
--- 145,149 ----
void SetSystemTrayIcon(BOOL on);
! sqInputEvent *sqNextEventPut(void);
***************
*** 935,939 ****
static int eventBufferPut = 0;
! static sqInputEvent *sqNextEventPut(void) {
sqInputEvent *evt;
evt = eventBuffer + eventBufferPut;
--- 935,939 ----
static int eventBufferPut = 0;
! sqInputEvent *sqNextEventPut(void) {
sqInputEvent *evt;
evt = eventBuffer + eventBufferPut;
|
|
From: Andreas R. <and...@us...> - 2003-04-08 21:02:29
|
Update of /cvsroot/squeak/squeak/platforms/win32/vm
In directory sc8-pr-cvs1:/tmp/cvs-serv2097
Modified Files:
sqWin32.h
Log Message:
updated to 3.4.2
Index: sqWin32.h
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/win32/vm/sqWin32.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** sqWin32.h 9 Mar 2003 01:25:36 -0000 1.8
--- sqWin32.h 8 Apr 2003 21:02:24 -0000 1.9
***************
*** 241,245 ****
#endif
! #define SQUEAK_VM_VERSION TEXT("Squeak 3.4.2 / Tea 1.9 VM (release) from ") TEXT(__DATE__) \
TEXT("\n") TEXT("Compiler: ") TEXT(COMPILER) TEXT(VERSION)
--- 241,245 ----
#endif
! #define SQUEAK_VM_VERSION TEXT("Squeak 3.4.3 / Tea 1.9 VM (release) from ") TEXT(__DATE__) \
TEXT("\n") TEXT("Compiler: ") TEXT(COMPILER) TEXT(VERSION)
|
|
From: Andreas R. <and...@us...> - 2003-04-08 21:00:43
|
Update of /cvsroot/squeak/squeak/platforms/win32/vm In directory sc8-pr-cvs1:/tmp/cvs-serv1305 Modified Files: sqWin32GUID.c Log Message: added direct input lib Index: sqWin32GUID.c =================================================================== RCS file: /cvsroot/squeak/squeak/platforms/win32/vm/sqWin32GUID.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** sqWin32GUID.c 24 Oct 2001 23:14:28 -0000 1.1.1.1 --- sqWin32GUID.c 8 Apr 2003 21:00:36 -0000 1.2 *************** *** 11,15 **** #include <dsound.h> #include <d3d.h> ! --- 11,15 ---- #include <dsound.h> #include <d3d.h> ! #include <dinput.h> |
|
From: Andreas R. <and...@us...> - 2003-04-08 20:59:54
|
Update of /cvsroot/squeak/squeak/platforms/win32/vm
In directory sc8-pr-cvs1:/tmp/cvs-serv688
Added Files:
sqWin32DirectInput.c
Log Message:
direct input support for mouse trails
--- NEW FILE: sqWin32DirectInput.c ---
/****************************************************************************
* PROJECT: Squeak Win32 port
* FILE: sqWin32DirectInput.c
* CONTENT: Win32 specific support for DirectInput
*
* AUTHOR: Andreas Raab (ar)
* ADDRESS: Impara GmbH, Magdeburg, Germany
* EMAIL: And...@im...
* RCSID: $Id: sqWin32DirectInput.c,v 1.1 2003/04/08 20:59:48 andreasraab Exp $
*
* NOTES:
* The function enclosed here provide direct support to the
* mouse driver using DirectInput. This allows us to get accurate
* mouse information even if Squeak is in a busy-loop or primitive.
* Note that due to talking to the driver directly we need to take
* different resolutions of the input devices into account
* (e.g., Windows map the input from the driver through its internal
* settings which means that the relative information we get is
* extremely relative indeed). We deal with this problem by
* remapping any mouse events into the input we have received
* from Windows.
*
*****************************************************************************/
#ifndef NO_DIRECTINPUT
#define DIRECTINPUT_VERSION 0x700 /* restrict to DX7 */
#include <windows.h>
#include <ole2.h>
#include "sq.h"
#ifdef __MINGW32__
#define HMONITOR_DECLARED
#undef WINNT
#endif
#include <dinput.h>
#include <stdio.h>
#include <math.h>
#define BUFFER_SIZE 100
static int xData[BUFFER_SIZE];
static int yData[BUFFER_SIZE];
static int stampData[BUFFER_SIZE];
IDirectInput *lpDI = NULL;
IDirectInputDevice *lpDev = NULL;
HANDLE hMouseEvent = NULL;
#define ERROR_CHECK(hResult, errMsg) \
if(FAILED(hResult)) { \
printf("%s (%s, %s)\n", errMsg, __FILE__, __LINE__); \
return hResult; \
}
HRESULT InitDirectInput( HANDLE hInstance, HWND hWnd )
{
HRESULT hr;
DIPROPDWORD propWord;
/* connect to direct input */
hr = DirectInputCreate( hInstance, DIRECTINPUT_VERSION, &lpDI, NULL );
ERROR_CHECK(hr, "Error creating DirectInput object");
/* get the mouse */
hr = lpDI->lpVtbl->CreateDevice(lpDI, &GUID_SysMouse, &lpDev, NULL );
ERROR_CHECK(hr, "Error creating DirectDevice object (mouse)");
/* tell it to get us mouse format data */
hr = lpDev->lpVtbl->SetDataFormat(lpDev, &c_dfDIMouse );
ERROR_CHECK(hr, "Error setting data format");
/* be quite cooperative */
hr = lpDev->lpVtbl->SetCooperativeLevel(lpDev,
hWnd,
DISCL_NONEXCLUSIVE |
DISCL_BACKGROUND);
ERROR_CHECK(hr, "Error setting cooperative mode");
/* create the event to signal */
hMouseEvent = CreateEvent( NULL, FALSE, FALSE, NULL );
if(!hMouseEvent) {
ERROR_CHECK(E_FAIL, "Error creating mouse event");
}
/* install it */
hr = lpDev->lpVtbl->SetEventNotification(lpDev, hMouseEvent );
ERROR_CHECK(hr, "Error setting event notification");
/* setup buffer size */
propWord.diph.dwSize = sizeof(DIPROPDWORD);
propWord.diph.dwHeaderSize = sizeof(DIPROPHEADER);
propWord.diph.dwObj = 0;
propWord.diph.dwHow = DIPH_DEVICE;
propWord.dwData = BUFFER_SIZE;
hr = lpDev->lpVtbl->SetProperty(lpDev, DIPROP_BUFFERSIZE, &propWord.diph );
ERROR_CHECK(hr, "Error setting input buffer size");
/* try to aquire the device right away */
lpDev->lpVtbl->Acquire(lpDev);
return S_OK;
}
HRESULT FreeDirectInput()
{
if(lpDev != NULL) {
lpDev->lpVtbl->Unacquire(lpDev);
lpDev->lpVtbl->Release(lpDev);
lpDev = NULL;
}
if(lpDI != NULL) {
lpDI->lpVtbl->Release(lpDI);
lpDI = NULL;
}
if(hMouseEvent != NULL) {
CloseHandle( hMouseEvent );
hMouseEvent = NULL;
}
return S_OK;
}
/* dump all buffered mouse input */
void DumpBufferedMouseTrail(void) {
DIDEVICEOBJECTDATA data;
DWORD count;
HRESULT hr;
if(!lpDev) return;
while(1) {
count = 1;
hr = lpDev->lpVtbl->GetDeviceData(lpDev,
sizeof(DIDEVICEOBJECTDATA),
&data,
&count,
0);
if (hr == DIERR_INPUTLOST) {
/* re-aquire the device if possible */
hr = lpDev->lpVtbl->Acquire(lpDev);
if(FAILED(hr) || hr == S_FALSE) {
/* sorry, can't do it */
break;
}
continue; /* start over reading */
}
if(FAILED(hr) || count == 0) {
/* no data or error */
break;
}
}
}
/* get pending input from the device up to the baseEvt*/
void GetBufferedMouseTrail(DWORD firstTick, DWORD lastTick,
sqMouseEvent *proto)
{
DIDEVICEOBJECTDATA data;
DWORD count, seqNum, timeStamp;
HRESULT hr;
sqMouseEvent *evt;
static int lastX = 0;
static int lastY = 0;
static int nextX = 0;
static int nextY = 0;
int numExtra;
/* printf("[%d@%d] -- %d\n", x, y, lastTick - firstTick);*/
if(!lpDev) return;
seqNum = 0;
nextX = lastX;
nextY = lastY;
numExtra = 0;
while(1) {
count = 1;
hr = lpDev->lpVtbl->GetDeviceData(lpDev,
sizeof(DIDEVICEOBJECTDATA),
&data,
&count,
0);
if (hr == DIERR_INPUTLOST) {
/* re-aquire the device if possible */
hr = lpDev->lpVtbl->Acquire(lpDev);
if(FAILED(hr) || hr == S_FALSE) {
/* sorry, can't do it */
break;
}
continue; /* start over reading */
}
if(FAILED(hr) || count == 0) {
/* no data or error */
break;
}
/* if data arrived before first tick, ignore it */
if(data.dwTimeStamp <= firstTick) continue;
/* if data arrives at or after last tick, we're done */
if(data.dwTimeStamp >= lastTick) break;
/* otherwise process it */
switch (data.dwOfs) {
case DIMOFS_X:
case DIMOFS_Y:
if(seqNum != 0 && seqNum != data.dwSequence) {
/* flush last event */
if(numExtra < BUFFER_SIZE) {
xData[numExtra] = nextX;
yData[numExtra] = nextY;
stampData[numExtra] = timeStamp;
numExtra++;
}
/* printf("(%d)%d@%d\n", timeStamp - firstTick, x, y); */
}
timeStamp = data.dwTimeStamp;
seqNum = data.dwSequence;
if(data.dwOfs == DIMOFS_X) {
nextX += (int)data.dwData;
} else {
nextY += (int)data.dwData;
}
break;
/* ignore all buttons */
case DIMOFS_BUTTON0:
case DIMOFS_BUTTON1:
case DIMOFS_BUTTON2:
case DIMOFS_BUTTON3:
break;
}
}
if(seqNum != 0 && (numExtra < BUFFER_SIZE)) {
xData[numExtra] = nextX;
yData[numExtra] = nextY;
stampData[numExtra] = timeStamp;
numExtra++;
}
if(numExtra > 0) {
int i;
/* check if lastX and lastY match what we got from the proto event.
we need this as windows settings can affect the mouse events,
and we really want to fill the stuff obtained here so that it
matches in/out as close as possible. */
if(nextX != proto->x || nextY != proto->y) {
/* rescale the trail to fit proto's expectations */
int protoDx = proto->x - lastX;
int protoDy = proto->y - lastY;
int trailDx = nextX - lastX;
int trailDy = nextY - lastY;
for(i=0; i<numExtra;i++) {
xData[i] = MulDiv(xData[i]-lastX, protoDx, trailDx) + lastX;
yData[i] = MulDiv(yData[i]-lastY, protoDy, trailDy) + lastY;
}
}
/* create the trail events */
for(i=0; i<numExtra;i++) {
evt = (sqMouseEvent*) sqNextEventPut();
*evt = *proto;
evt->x = xData[i];
evt->y = yData[i];
evt->timeStamp = stampData[i];
}
}
/* remember x and y */
lastX = proto->x;
lastY = proto->y;
}
void SetupDirectInput(void) {
HRESULT hr;
FreeDirectInput();
hr = InitDirectInput(hInstance, stWindow);
if(FAILED(hr)) {
FreeDirectInput();
}
}
#endif /* NO_DIRECTINPUT */
|
|
From: Andreas R. <and...@us...> - 2003-04-08 20:59:09
|
Update of /cvsroot/squeak/squeak/platforms/win32/vm
In directory sc8-pr-cvs1:/tmp/cvs-serv359
Modified Files:
sqWin32Window.c
Log Message:
added direct input support for mouse trails
Index: sqWin32Window.c
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/win32/vm/sqWin32Window.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** sqWin32Window.c 25 Mar 2003 17:42:49 -0000 1.11
--- sqWin32Window.c 8 Apr 2003 20:59:02 -0000 1.12
***************
*** 145,149 ****
void SetSystemTrayIcon(BOOL on);
! static sqInputEvent *nextEventPut(void);
--- 145,149 ----
void SetSystemTrayIcon(BOOL on);
! static sqInputEvent *sqNextEventPut(void);
***************
*** 213,217 ****
short zDelta = (short) HIWORD(wParam);
if(inputSemaphoreIndex) {
! sqKeyboardEvent *evt = (sqKeyboardEvent*) nextEventPut();
evt->type = EventTypeKeyboard;
evt->timeStamp = lastMessage->time;
--- 213,217 ----
short zDelta = (short) HIWORD(wParam);
if(inputSemaphoreIndex) {
! sqKeyboardEvent *evt = (sqKeyboardEvent*) sqNextEventPut();
evt->type = EventTypeKeyboard;
evt->timeStamp = lastMessage->time;
***************
*** 785,788 ****
--- 785,792 ----
SetupDragAndDrop();
#endif
+ #ifndef NO_DIRECTINPUT
+ /* direct input needs to be set up on per-window basis */
+ SetupDirectInput();
+ #endif
ioScreenSize(); /* compute new rect initially */
}
***************
*** 906,910 ****
case VK_UP : return 30;
case VK_DOWN : return 31;
! /* case VK_RETURN: return 13; */
/* remap appropriately so that we get _all_ key down events */
case 127: return VK_DELETE;
--- 910,914 ----
case VK_UP : return 30;
case VK_DOWN : return 31;
! case VK_RETURN: return 13;
/* remap appropriately so that we get _all_ key down events */
case 127: return VK_DELETE;
***************
*** 926,935 ****
/* Event based primitive set */
/****************************************************************************/
! #define MAX_EVENT_BUFFER 500
static sqInputEvent eventBuffer[MAX_EVENT_BUFFER];
static int eventBufferGet = 0;
static int eventBufferPut = 0;
! static sqInputEvent *nextEventPut(void) {
sqInputEvent *evt;
evt = eventBuffer + eventBufferPut;
--- 930,939 ----
/* Event based primitive set */
/****************************************************************************/
! #define MAX_EVENT_BUFFER 1024
static sqInputEvent eventBuffer[MAX_EVENT_BUFFER];
static int eventBufferGet = 0;
static int eventBufferPut = 0;
! static sqInputEvent *sqNextEventPut(void) {
sqInputEvent *evt;
evt = eventBuffer + eventBufferPut;
***************
*** 937,940 ****
--- 941,945 ----
if (eventBufferGet == eventBufferPut) {
/* buffer overflow; drop the last event */
+ printf("WARNING: event buffer overflow\n");
eventBufferGet = (eventBufferGet + 1) % MAX_EVENT_BUFFER;
}
***************
*** 944,953 ****
int recordMouseEvent(MSG *msg) {
! sqMouseEvent *evt;
int alt, shift, ctrl, red, blue, yellow;
if(!msg) return 0;
- evt = (sqMouseEvent*) nextEventPut();
-
alt = GetKeyState(VK_MENU) & 0x8000;
shift = msg->wParam & MK_SHIFT;
--- 949,957 ----
int recordMouseEvent(MSG *msg) {
! static DWORD firstEventTime = 0;
! sqMouseEvent proto, *event;
int alt, shift, ctrl, red, blue, yellow;
if(!msg) return 0;
alt = GetKeyState(VK_MENU) & 0x8000;
shift = msg->wParam & MK_SHIFT;
***************
*** 975,995 ****
}
/* first the basics */
! evt->type = EventTypeMouse;
! evt->timeStamp = msg->time;
! evt->x = (int)(short)LOWORD(msg->lParam);
! evt->y = (int)(short)HIWORD(msg->lParam);
/* then the buttons */
! evt->buttons = 0;
! evt->buttons |= red ? RedButtonBit : 0;
! evt->buttons |= blue ? BlueButtonBit : 0;
! evt->buttons |= yellow ? YellowButtonBit : 0;
/* then the modifiers */
! evt->modifiers = 0;
! evt->modifiers |= shift ? ShiftKeyBit : 0;
! evt->modifiers |= ctrl ? CtrlKeyBit : 0;
! evt->modifiers |= alt ? CommandKeyBit : 0;
/* clean up reserved */
! evt->reserved1 = 0;
! evt->reserved2 = 0;
return 1;
}
--- 979,1009 ----
}
/* first the basics */
! proto.type = EventTypeMouse;
! proto.timeStamp = msg->time;
! proto.x = (int)(short)LOWORD(msg->lParam);
! proto.y = (int)(short)HIWORD(msg->lParam);
/* then the buttons */
! proto.buttons = 0;
! proto.buttons |= red ? RedButtonBit : 0;
! proto.buttons |= blue ? BlueButtonBit : 0;
! proto.buttons |= yellow ? YellowButtonBit : 0;
/* then the modifiers */
! proto.modifiers = 0;
! proto.modifiers |= shift ? ShiftKeyBit : 0;
! proto.modifiers |= ctrl ? CtrlKeyBit : 0;
! proto.modifiers |= alt ? CommandKeyBit : 0;
/* clean up reserved */
! proto.reserved1 = 0;
! proto.reserved2 = 0;
! #ifndef NO_DIRECTINPUT
! /* get buffered input */
! if(msg->message == WM_MOUSEMOVE) {
! GetBufferedMouseTrail(firstEventTime, msg->time, &proto);
! }
! firstEventTime = msg->time;
! #endif
! /* and lastly, fill in the event itself */
! event = (sqMouseEvent*) sqNextEventPut();
! *event = proto;
return 1;
}
***************
*** 1000,1004 ****
int alt, shift, ctrl, modifiers;
! evt = (sqDragDropFilesEvent*) nextEventPut();
alt = GetKeyState(VK_MENU) & 0x8000;
--- 1014,1018 ----
int alt, shift, ctrl, modifiers;
! evt = (sqDragDropFilesEvent*) sqNextEventPut();
alt = GetKeyState(VK_MENU) & 0x8000;
***************
*** 1065,1069 ****
}
/* first the basics */
! evt = (sqKeyboardEvent*) nextEventPut();
evt->type = EventTypeKeyboard;
evt->timeStamp = msg->time;
--- 1079,1083 ----
}
/* first the basics */
! evt = (sqKeyboardEvent*) sqNextEventPut();
evt->type = EventTypeKeyboard;
evt->timeStamp = msg->time;
***************
*** 1082,1086 ****
if(pressCode == EventKeyDown && virtCode != 0) {
/* generate extra character event */
! sqKeyboardEvent *extra = (sqKeyboardEvent*)nextEventPut();
*extra = *evt;
extra->pressCode = EventKeyChar;
--- 1096,1100 ----
if(pressCode == EventKeyDown && virtCode != 0) {
/* generate extra character event */
! sqKeyboardEvent *extra = (sqKeyboardEvent*)sqNextEventPut();
*extra = *evt;
extra->pressCode = EventKeyChar;
***************
*** 1343,1346 ****
--- 1357,1361 ----
MsgWaitForMultipleObjects(1, &vmWakeUpEvent, FALSE,
microSeconds / 1000, QS_ALLINPUT);
+ ioProcessEvents(); /* keep up with mouse moves etc. */
return microSeconds;
}
***************
*** 1386,1389 ****
--- 1401,1409 ----
DispatchMessage(&msg);
}
+
+ #ifndef NO_DIRECTINPUT
+ /* any buffered mouse input which hasn't been processed is obsolete */
+ DumpBufferedMouseTrail();
+ #endif
/* If we're running in a browser check if the browser's still there */
|
|
From: Andreas R. <and...@us...> - 2003-04-08 20:57:58
|
Update of /cvsroot/squeak/squeak/platforms/win32 In directory sc8-pr-cvs1:/tmp/cvs-serv32334 Modified Files: Makefile.mingw32 Log Message: added direct input lib Index: Makefile.mingw32 =================================================================== RCS file: /cvsroot/squeak/squeak/platforms/win32/Makefile.mingw32,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Makefile.mingw32 8 Mar 2003 21:26:57 -0000 1.3 --- Makefile.mingw32 8 Apr 2003 20:57:53 -0000 1.4 *************** *** 112,116 **** LD= gcc LDFLAGS= -mwindows ! STDLIBS= -lddraw -lopengl32 -lwsock32 -lcomdlg32 -lole32 -lwinmm -luser32 -lgdi32 -lkernel32 CRTLIB = -lcrtdll LIBS= $(STDLIBS) $(CRTLIB) --- 112,116 ---- LD= gcc LDFLAGS= -mwindows ! STDLIBS= -lddraw -ldinput -lopengl32 -lwsock32 -lcomdlg32 -lole32 -lwinmm -luser32 -lgdi32 -lkernel32 CRTLIB = -lcrtdll LIBS= $(STDLIBS) $(CRTLIB) |
|
From: Andreas R. <and...@us...> - 2003-03-25 17:42:53
|
Update of /cvsroot/squeak/squeak/platforms/win32/vm
In directory sc8-pr-cvs1:/tmp/cvs-serv32255
Modified Files:
sqWin32Window.c
Log Message:
make virtual key mapping bidirectional
Index: sqWin32Window.c
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/win32/vm/sqWin32Window.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** sqWin32Window.c 23 Mar 2003 20:00:59 -0000 1.10
--- sqWin32Window.c 25 Mar 2003 17:42:49 -0000 1.11
***************
*** 906,910 ****
case VK_UP : return 30;
case VK_DOWN : return 31;
! case VK_RETURN: return 13;
}
return 0;
--- 906,922 ----
case VK_UP : return 30;
case VK_DOWN : return 31;
! /* case VK_RETURN: return 13; */
! /* remap appropriately so that we get _all_ key down events */
! case 127: return VK_DELETE;
! case 5: return VK_INSERT;
! case 11: return VK_PRIOR;
! case 12: return VK_NEXT;
! case 4: return VK_END;
! case 1: return VK_HOME;
! case 28: return VK_LEFT;
! case 29: return VK_RIGHT;
! case 30: return VK_UP;
! case 31: return VK_DOWN;
! /* case 13: return VK_RETURN; */
}
return 0;
|
|
From: Andreas R. <and...@us...> - 2003-03-23 20:01:02
|
Update of /cvsroot/squeak/squeak/platforms/win32/vm
In directory sc8-pr-cvs1:/tmp/cvs-serv14883
Modified Files:
sqWin32Window.c
Log Message:
fixed keycode translation
Index: sqWin32Window.c
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/win32/vm/sqWin32Window.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** sqWin32Window.c 8 Mar 2003 21:07:51 -0000 1.9
--- sqWin32Window.c 23 Mar 2003 20:00:59 -0000 1.10
***************
*** 1035,1038 ****
--- 1035,1039 ----
case WM_KEYUP:
case WM_SYSKEYUP:
+ if(virtCode) keyCode = virtCode;
pressCode = EventKeyUp;
break;
|
|
From: Andreas R. <and...@us...> - 2003-03-09 01:25:39
|
Update of /cvsroot/squeak/squeak/platforms/win32/vm
In directory sc8-pr-cvs1:/tmp/cvs-serv29138
Modified Files:
sqWin32.h
Log Message:
updated to 3.4.2
Index: sqWin32.h
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/win32/vm/sqWin32.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** sqWin32.h 8 Mar 2003 21:04:53 -0000 1.7
--- sqWin32.h 9 Mar 2003 01:25:36 -0000 1.8
***************
*** 241,245 ****
#endif
! #define SQUEAK_VM_VERSION TEXT("Squeak 3.4.1 / Tea 1.9 VM (release) from ") TEXT(__DATE__) \
TEXT("\n") TEXT("Compiler: ") TEXT(COMPILER) TEXT(VERSION)
--- 241,245 ----
#endif
! #define SQUEAK_VM_VERSION TEXT("Squeak 3.4.2 / Tea 1.9 VM (release) from ") TEXT(__DATE__) \
TEXT("\n") TEXT("Compiler: ") TEXT(COMPILER) TEXT(VERSION)
|
|
From: Andreas R. <and...@us...> - 2003-03-09 00:49:30
|
Update of /cvsroot/squeak/squeak/platforms/Cross/plugins/RePlugin In directory sc8-pr-cvs1:/tmp/cvs-serv16827 Modified Files: pcre.h Log Message: added #define STATIC for Win32 builds Index: pcre.h =================================================================== RCS file: /cvsroot/squeak/squeak/platforms/Cross/plugins/RePlugin/pcre.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pcre.h 2 Oct 2002 12:37:40 -0000 1.2 --- pcre.h 9 Mar 2003 00:49:27 -0000 1.3 *************** *** 18,21 **** --- 18,22 ---- #ifdef _WIN32 + #define STATIC # ifdef STATIC # define PCRE_DL_IMPORT |
|
From: Andreas R. <and...@us...> - 2003-03-09 00:45:35
|
Update of /cvsroot/squeak/squeak/platforms/Cross/plugins/SurfacePlugin
In directory sc8-pr-cvs1:/tmp/cvs-serv15794
Modified Files:
SurfacePlugin.c
Log Message:
changed moduleName to report build date and (i) vs. (e)
Index: SurfacePlugin.c
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/Cross/plugins/SurfacePlugin/SurfacePlugin.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** SurfacePlugin.c 9 May 2002 01:36:50 -0000 1.2
--- SurfacePlugin.c 9 Mar 2003 00:45:32 -0000 1.3
***************
*** 41,45 ****
static int maxSurfaces = 0;
! static const char *moduleName = "SurfacePlugin";
static VirtualMachine *interpreterProxy;
#define FAIL { interpreterProxy->primitiveFail(); return 0; }
--- 41,50 ----
static int maxSurfaces = 0;
! #ifdef SQUEAK_BUILTIN_PLUGIN
! static const char *moduleName = "SurfacePlugin "__DATE__" (i)";
! #else
! static const char *moduleName = "SurfacePlugin "__DATE__" (e)";
! #endif
!
static VirtualMachine *interpreterProxy;
#define FAIL { interpreterProxy->primitiveFail(); return 0; }
|
|
From: Andreas R. <and...@us...> - 2003-03-08 22:28:45
|
Update of /cvsroot/squeak/squeak/platforms/win32/plugins/FontPlugin
In directory sc8-pr-cvs1:/tmp/cvs-serv26285
Added Files:
sqWin32FontPlugin.c
Log Message:
initial import
--- NEW FILE: sqWin32FontPlugin.c ---
#include <windows.h>
#include "sqVirtualMachine.h"
#include "sqConfig.h"
#include "sqPlatformSpecific.h"
extern struct VirtualMachine *interpreterProxy;
/* Ref to Squeak window for getting DC etc. */
static HWND *theSTWindow;
/* Number of elements in font cache to grow by */
#define FONT_CACHE_SIZE 50
#define FontFlagBold 1
#define FontFlagItalic 2
#define FontFlagUnderline 4
#define FontFlagStrikeout 8
/*****************************************************************************/
/*****************************************************************************/
/*****************************************************************************/
typedef struct sqFont {
HFONT handle;
TEXTMETRIC textMetric;
ABC abcWidths[256];
int nKernPairs;
KERNINGPAIR *kernPairs;
} sqFont;
/* font cache */
static sqFont *fontCache = NULL;
static int maxFonts = 0;
/*****************************************************************/
/*****************************************************************/
/*****************************************************************/
/* font creation */
int ioCreateFont(int fontNameIndex, int fontNameLength, int pixelSize, int flags)
{
LOGFONT logFont;
HFONT hFont;
int fontIndex, i, nKernPairs;
HDC hDC;
if(fontNameLength >= LF_FACESIZE) return -1;
logFont.lfHeight = -pixelSize;
logFont.lfWidth = 0;
logFont.lfEscapement = 0;
logFont.lfOrientation = 0;
logFont.lfWeight = (flags & FontFlagBold) ? FW_BOLD : FW_REGULAR;
logFont.lfItalic = (flags & FontFlagItalic) != 0;
logFont.lfUnderline = (flags & FontFlagUnderline) != 0;
logFont.lfStrikeOut = (flags & FontFlagStrikeout) != 0;
logFont.lfCharSet = DEFAULT_CHARSET;
logFont.lfOutPrecision = OUT_TT_PRECIS;
logFont.lfClipPrecision = CLIP_DEFAULT_PRECIS;
logFont.lfQuality = PROOF_QUALITY;
logFont.lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
for(i=0;i < fontNameLength; i++) {
logFont.lfFaceName[i] = ((char*)fontNameIndex)[i];
}
logFont.lfFaceName[fontNameLength] = 0;
hFont = CreateFontIndirect(&logFont);
if(!hFont) {
MessageBox(*theSTWindow, "Failed to create font", "Font error", MB_OK);
return -1;
}
/* Find free slot in fontCache */
for(fontIndex = 0; fontIndex < maxFonts; fontIndex++)
if(fontCache[fontIndex].handle == NULL) break;
if(fontIndex == maxFonts) {
int i;
maxFonts = maxFonts + FONT_CACHE_SIZE; /* grow linearly */
fontCache = (sqFont*) realloc(fontCache, maxFonts * sizeof(sqFont));
for(i = fontIndex; i < maxFonts; i++) fontCache[i].handle = NULL;
}
fontCache[fontIndex].handle = hFont;
/* Query for the width of each character */
{
HANDLE oldFont;
hDC = GetDC(*theSTWindow);
oldFont = SelectObject(hDC, hFont);
if(!GetCharABCWidths(hDC, 0, 255, fontCache[fontIndex].abcWidths)) {
/* This must have been a bitmap font */
int widthArray[256];
ABC *abc = fontCache[fontIndex].abcWidths;
int i;
GetCharWidth(hDC, 0, 255, widthArray);
for(i=0; i < 256; i++) {
abc[i].abcA = 0;
abc[i].abcB = widthArray[i];
abc[i].abcC = 0;
}
}
GetTextMetrics(hDC, &(fontCache[fontIndex].textMetric));
nKernPairs = GetKerningPairs(hDC, 0, NULL);
fontCache[fontIndex].nKernPairs = nKernPairs;
fontCache[fontIndex].kernPairs = calloc(nKernPairs, sizeof(KERNINGPAIR));
GetKerningPairs(hDC, nKernPairs, fontCache[fontIndex].kernPairs);
SelectObject(hDC, oldFont);
ReleaseDC(*theSTWindow, hDC);
}
return fontIndex;
}
int ioDestroyFont(int fontIndex) {
if(fontIndex < 0 || fontIndex >= maxFonts) return 0;
if(fontCache[fontIndex].handle == NULL) return 0;
DeleteObject(fontCache[fontIndex].handle);
free(fontCache[fontIndex].kernPairs);
fontCache[fontIndex].kernPairs = NULL;
fontCache[fontIndex].handle = 0;
return 1;
}
/*****************************************************************/
/*****************************************************************/
/*****************************************************************/
/* Font information */
int ioFontEncoding(int fontIndex) {
/* Font encoding is always ANSI - we don't allow anything else */
return 1;
}
int ioFontAscent(int fontIndex) {
TEXTMETRIC *tm;
if(fontIndex < 0 || fontIndex >= maxFonts) return 0;
if(fontCache[fontIndex].handle == NULL) return 0;
tm = &(fontCache[fontIndex].textMetric);
return tm->tmAscent /* + tm->tmInternalLeading */;
}
int ioFontDescent(int fontIndex) {
TEXTMETRIC *tm;
if(fontIndex < 0 || fontIndex >= maxFonts) return 0;
if(fontCache[fontIndex].handle == NULL) return 0;
tm = &(fontCache[fontIndex].textMetric);
return tm->tmDescent /* + tm->tmExternalLeading */;
}
int ioFontEmbeddingFlags(int fontIndex) {
HDC hDC;
HANDLE hFont;
DWORD size;
OUTLINETEXTMETRIC otm;
if(fontIndex < 0 || fontIndex >= maxFonts) return 0;
if(fontCache[fontIndex].handle == NULL) return 0;
hDC = GetDC(*theSTWindow);
hFont = SelectObject(hDC, fontCache[fontIndex].handle);
otm.otmSize = sizeof(otm);
if(GetOutlineTextMetrics(hDC, sizeof(otm), &otm) == 0) {
/* no embedding if function fails */
otm.otmfsType = 1;
}
SelectObject(hDC, hFont);
ReleaseDC(*theSTWindow, hDC);
return otm.otmfsType;
}
int ioGetFontDataSize(int fontIndex) {
HDC hDC;
HANDLE hFont;
DWORD size;
if(fontIndex < 0 || fontIndex >= maxFonts) return 0;
if(fontCache[fontIndex].handle == NULL) return 0;
hDC = GetDC(*theSTWindow);
hFont = SelectObject(hDC, fontCache[fontIndex].handle);
size = GetFontData(hDC, 0, 0, NULL, -1);
SelectObject(hDC, hFont);
ReleaseDC(*theSTWindow, hDC);
return size;
}
int ioGetFontData(int fontIndex, char *fontDataBuffer, int bufferSize) {
HDC hDC;
HANDLE hFont;
DWORD size;
if(fontIndex < 0 || fontIndex >= maxFonts) return 0;
if(fontCache[fontIndex].handle == NULL) return 0;
hDC = GetDC(*theSTWindow);
hFont = SelectObject(hDC, fontCache[fontIndex].handle);
size = GetFontData(hDC, 0, 0, fontDataBuffer, bufferSize);
SelectObject(hDC, hFont);
ReleaseDC(*theSTWindow, hDC);
return size;
}
/*****************************************************************/
/*****************************************************************/
/*****************************************************************/
/* character measuring */
int ioFontWidthOfChar(int fontIndex, int characterIndex)
{ ABC abcWidth;
int width;
if(fontIndex < 0 || fontIndex >= maxFonts) return -1;
if(fontCache[fontIndex].handle == NULL) return -1;
if(characterIndex < 0 || characterIndex > 255) return -1;
abcWidth = fontCache[fontIndex].abcWidths[characterIndex];
/* Note: To prevent overhangs and underhangs we must
examine the 'a' and 'c' member of the abcWidth.
If either 'a' or 'c' is negative we simply have to
ignore it since Squeak can currently not correctly
deal with these. */
width = abcWidth.abcB;
if(abcWidth.abcA > 0) width += abcWidth.abcA;
if(abcWidth.abcC > 0) width += abcWidth.abcC;
return width;
}
int ioFontFullWidthOfChar(int fontIndex, int characterIndex, int fullWidth[3])
{
ABC abcWidth;
if(fontIndex < 0 || fontIndex >= maxFonts) return 0;
if(fontCache[fontIndex].handle == NULL) return 0;
if(characterIndex < 0 || characterIndex > 255) return 0;
abcWidth = fontCache[fontIndex].abcWidths[characterIndex];
fullWidth[0] = abcWidth.abcA;
fullWidth[1] = abcWidth.abcB;
fullWidth[2] = abcWidth.abcC;
return 1;
}
/*****************************************************************/
/*****************************************************************/
/*****************************************************************/
/* Kerning support */
int ioFontNumKernPairs(int fontIndex)
{
if(fontIndex < 0 || fontIndex >= maxFonts) return -1;
if(fontCache[fontIndex].handle == NULL) return -1;
return fontCache[fontIndex].nKernPairs;
}
int ioFontGetKernPair(int fontIndex, int kernIndex, int kernPair[3])
{
KERNINGPAIR kp;
if(fontIndex < 0 || fontIndex >= maxFonts) return 0;
if(fontCache[fontIndex].handle == NULL) return 0;
if(kernIndex < 1 || kernIndex > fontCache[fontIndex].nKernPairs) return 0;
kp = fontCache[fontIndex].kernPairs[kernIndex-1];
kernPair[0] = kp.wFirst;
kernPair[1] = kp.wSecond;
kernPair[2] = kp.iKernAmount;
return 1;
}
/*****************************************************************/
/*****************************************************************/
/*****************************************************************/
/* Glyph retrieval */
int ioFontGlyphOfChar(int fontIndex, int characterIndex,
int formBitsIndex, int formWidth, int formHeight, int formDepth)
{
HDC hDC;
HDC mDC;
HBITMAP hBM;
HANDLE oldBM, oldFont;
unsigned int *dibBits;
static BITMAPINFO *bmi = NULL;
char string[1];
int xPos;
if(formDepth != 1) return 0; /* unsupported */
if(fontIndex < 0 || fontIndex >= maxFonts) return 0;
if(fontCache[fontIndex].handle == NULL) return 0;
if(characterIndex < 0 || characterIndex > 255) return 0;
if(!bmi) {
bmi = (BITMAPINFO*) calloc(1, sizeof(BITMAPINFO) + 2 * sizeof(RGBQUAD));
bmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
}
bmi->bmiHeader.biWidth = formWidth;
bmi->bmiHeader.biHeight = -formHeight;
bmi->bmiHeader.biPlanes = 1;
bmi->bmiHeader.biBitCount = 1;
bmi->bmiHeader.biCompression = BI_RGB;
bmi->bmiColors[0].rgbRed = 255;
bmi->bmiColors[0].rgbGreen = 255;
bmi->bmiColors[0].rgbBlue = 255;
bmi->bmiColors[1].rgbRed = 0;
bmi->bmiColors[1].rgbGreen = 0;
bmi->bmiColors[1].rgbBlue = 0;
string[0] = characterIndex;
/* Draw the character glyph */
hDC = GetDC(*theSTWindow);
mDC = CreateCompatibleDC(hDC);
hBM = CreateDIBSection(mDC, bmi, DIB_RGB_COLORS, (void*)&dibBits, NULL, 0);
oldBM = SelectObject(mDC, hBM);
oldFont = SelectObject(mDC, fontCache[fontIndex].handle);
PatBlt(mDC, 0, 0, formWidth, formHeight, BLACKNESS);
SetTextAlign(mDC, TA_TOP | TA_LEFT | TA_NOUPDATECP);
SetTextColor(mDC, RGB(0, 0, 0));
/* Note: For underhang characters we have to make sure nothing is clipped */
xPos = fontCache[fontIndex].abcWidths[characterIndex].abcA;
if(xPos < 0) xPos = -xPos;
else xPos = 0; /* insets are okay */
TextOut(mDC, xPos, 0, string, 1);
/* BitBlt(hDC, (characterIndex & 15) * formWidth, (characterIndex >> 4) * formHeight, formWidth, formHeight, mDC, 0, 0, SRCCOPY); */
/* And swap those bits */
{
unsigned int *bits = (unsigned int*) formBitsIndex;
int numWords = (formWidth + 31) / 32;
int i;
# define BYTE_SWAP(w) ((w << 24) | ((w & 0xFF00) << 8) | ((w >> 8) & 0xFF00) | (w >> 24))
for(i=0; i < formHeight*numWords; i++) {
bits[i] = BYTE_SWAP(dibBits[i]);
}
# undef BYTE_SWAP
}
/* done it. */
SelectObject(mDC, oldBM);
SelectObject(mDC, oldFont);
DeleteDC(mDC);
DeleteObject(hBM);
ReleaseDC(*theSTWindow, hDC);
}
/*****************************************************************************/
/*****************************************************************************/
/*****************************************************************************/
/* Font name cache */
static LOGFONT *fontNameCache = NULL;
static int numFontNames = 0;
static int maxFontNames = 0;
int CALLBACK enumFontsCallback(ENUMLOGFONTEX *logFont, NEWTEXTMETRICEX *textMetric, int fontType, LPARAM param)
{
int i;
if(numFontNames == maxFontNames) {
/* Resize font cache */
maxFontNames = maxFontNames + FONT_CACHE_SIZE; /* grow linearly */
fontNameCache = (LOGFONT*) realloc(fontNameCache, maxFontNames * sizeof(LOGFONT));
}
/* We check for unique names here since fonts will be listed in all available char sets */
for(i = 0; i < numFontNames; i++) {
if(strcmp(fontNameCache[i].lfFaceName, logFont->elfLogFont.lfFaceName) == 0) {
/* we had this guy already */
return 1; /* but continue enumerating */
}
}
fontNameCache[numFontNames++] = logFont->elfLogFont;
return 1; /* continue enumeration */
}
char *ioListFont(int fontIndex) {
static char taggedName[256];
/* Enumerate fonts on index 0 or first use */
if(fontIndex == 0 || !fontNameCache) {
LOGFONT logFont;
HDC hDC;
numFontNames = 0; /* start over with enumeration */
hDC = GetDC(*theSTWindow);
if(!hDC) return NULL;
ZeroMemory(&logFont, sizeof(logFont));
logFont.lfCharSet = DEFAULT_CHARSET;
logFont.lfFaceName;
EnumFontFamiliesEx(hDC, &logFont, enumFontsCallback, 0, 0);
ReleaseDC(*theSTWindow, hDC);
}
if(!fontNameCache) return NULL;
if(fontIndex >= numFontNames) return NULL;
return fontNameCache[fontIndex].lfFaceName;
}
/*****************************************************************/
/*****************************************************************/
/*****************************************************************/
/* initialize/shutdown */
int ioFontInit(void) {
/* lookup the necessary things from interpreter */
theSTWindow = (HWND*) interpreterProxy->ioLoadFunctionFrom("stWindow","");
if(!theSTWindow) return 0;
numFontNames = maxFontNames = 0;
fontNameCache = NULL;
maxFonts = 0;
fontCache = NULL;
return 1;
}
int ioFontShutdown(void) {
int i;
if(fontNameCache) free(fontNameCache);
for(i=0; i < maxFonts; i++)
if(fontCache[i].handle) DeleteObject(fontCache[i].handle);
if(fontCache) free(fontCache);
return 1;
}
|
|
From: Andreas R. <and...@us...> - 2003-03-08 22:27:52
|
Update of /cvsroot/squeak/squeak/platforms/win32/plugins/FontPlugin In directory sc8-pr-cvs1:/tmp/cvs-serv25973/FontPlugin Log Message: Directory /cvsroot/squeak/squeak/platforms/win32/plugins/FontPlugin added to the repository |
|
From: Andreas R. <and...@us...> - 2003-03-08 21:27:00
|
Update of /cvsroot/squeak/squeak/platforms/win32 In directory sc8-pr-cvs1:/tmp/cvs-serv1919 Modified Files: Makefile.mingw32 Log Message: updated to use cp/rm Index: Makefile.mingw32 =================================================================== RCS file: /cvsroot/squeak/squeak/platforms/win32/Makefile.mingw32,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Makefile.mingw32 5 May 2002 01:54:17 -0000 1.2 --- Makefile.mingw32 8 Mar 2003 21:26:57 -0000 1.3 *************** *** 12,17 **** AR = ar rc ! CP = copy ! RM = del ############################################################################# --- 12,17 ---- AR = ar rc ! CP = cp ! RM = rm ############################################################################# *************** *** 182,206 **** $(LIBOBJ) strip --strip-all $(OBJDIR)/$(LIB).dll ! $(RM) $(LIBOBJ) $(LIB).lib $(LIB).exp $(LIB).def Mpeg3Plugin.lib: @$(MAKE) -Cplugins/Mpeg3Plugin -f Makefile.win32 XDEFS=-DSQUEAK_BUILTIN_PLUGIN makelib ! $(CP) plugins\Mpeg3Plugin\Mpeg3Plugin.lib release\Mpeg3Plugin.lib ! $(RM) plugins\Mpeg3Plugin\Mpeg3Plugin.lib Mpeg3Plugin.dll: @$(MAKE) -Cplugins/Mpeg3Plugin -f Makefile.win32 makedll ! $(CP) plugins\Mpeg3Plugin\Mpeg3Plugin.dll release\Mpeg3Plugin.dll ! $(RM) plugins\Mpeg3Plugin\Mpeg3Plugin.dll %.lib: @$(MAKE) -C plugins/$* -f ../../Makefile.mingw32 SRCDIR=../../ LIB=$*.lib OBJDIR=. XDEFS=-DSQUEAK_BUILTIN_PLUGIN makelib ! $(CP) plugins\$*\$*.lib release\$*.lib ! $(RM) plugins\$*\$*.lib %.dll: @$(MAKE) -C plugins/$* -f ../../Makefile.mingw32 SRCDIR=../../ LIB=$* OBJDIR=. XDEFS=-DNIX makedll ! $(CP) plugins\$*\$*.dll release\$*.dll ! $(RM) plugins\$*\$*.dll --- 182,206 ---- $(LIBOBJ) strip --strip-all $(OBJDIR)/$(LIB).dll ! $(RM) -f $(LIBOBJ) $(LIB).lib $(LIB).exp $(LIB).def Mpeg3Plugin.lib: @$(MAKE) -Cplugins/Mpeg3Plugin -f Makefile.win32 XDEFS=-DSQUEAK_BUILTIN_PLUGIN makelib ! $(CP) plugins/Mpeg3Plugin/Mpeg3Plugin.lib release/Mpeg3Plugin.lib ! $(RM) plugins/Mpeg3Plugin/Mpeg3Plugin.lib Mpeg3Plugin.dll: @$(MAKE) -Cplugins/Mpeg3Plugin -f Makefile.win32 makedll ! $(CP) plugins/Mpeg3Plugin/Mpeg3Plugin.dll release/Mpeg3Plugin.dll ! $(RM) plugins/Mpeg3Plugin/Mpeg3Plugin.dll %.lib: @$(MAKE) -C plugins/$* -f ../../Makefile.mingw32 SRCDIR=../../ LIB=$*.lib OBJDIR=. XDEFS=-DSQUEAK_BUILTIN_PLUGIN makelib ! $(CP) plugins/$*/$*.lib release/$*.lib ! $(RM) plugins/$*/$*.lib %.dll: @$(MAKE) -C plugins/$* -f ../../Makefile.mingw32 SRCDIR=../../ LIB=$* OBJDIR=. XDEFS=-DNIX makedll ! $(CP) plugins/$*/$*.dll release/$*.dll ! $(RM) plugins/$*/$*.dll |
|
From: Andreas R. <and...@us...> - 2003-03-08 21:07:58
|
Update of /cvsroot/squeak/squeak/platforms/win32/vm
In directory sc8-pr-cvs1:/tmp/cvs-serv27246
Modified Files:
sqWin32Window.c
Log Message:
lazy printer setup; fixed startup size
Index: sqWin32Window.c
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/win32/vm/sqWin32Window.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** sqWin32Window.c 26 May 2002 18:52:10 -0000 1.8
--- sqWin32Window.c 8 Mar 2003 21:07:51 -0000 1.9
***************
*** 125,128 ****
--- 125,129 ----
/* printer settings */
PRINTDLG printValues;
+ static int printerSetup = FALSE;
#endif
***************
*** 493,496 ****
--- 494,498 ----
{
#ifndef NO_PRINTER
+ if(!printerSetup) SetupPrinter();
printValues.Flags = PD_PRINTSETUP;
PrintDlg(&printValues);
***************
*** 513,516 ****
--- 515,519 ----
printValues.Flags = PD_RETURNDEFAULT;
PrintDlg(&printValues);
+ printerSetup = 1;
#endif
}
***************
*** 789,793 ****
void SetWindowSize(void)
! { RECT r;
int width, height, maxWidth, maxHeight, actualWidth, actualHeight;
int deltaWidth, deltaHeight;
--- 792,798 ----
void SetWindowSize(void)
! {
! RECT r;
! RECT workArea;
int width, height, maxWidth, maxHeight, actualWidth, actualHeight;
int deltaWidth, deltaHeight;
***************
*** 811,817 ****
height = (height > 64) ? height : 64;
! /* maximum size is screen size */
! maxWidth = GetSystemMetrics(SM_CXFULLSCREEN);
! maxHeight = GetSystemMetrics(SM_CYFULLSCREEN);
width = ( width <= maxWidth) ? width : maxWidth;
height = (height <= maxHeight) ? height : maxHeight;
--- 816,824 ----
height = (height > 64) ? height : 64;
! /* maximum size is working area */
! SystemParametersInfo( SPI_GETWORKAREA, 0, &workArea, 0);
! maxWidth = workArea.right - workArea.left;
! maxHeight = workArea.bottom - workArea.top;
!
width = ( width <= maxWidth) ? width : maxWidth;
height = (height <= maxHeight) ? height : maxHeight;
***************
*** 834,842 ****
width += deltaWidth;
height += deltaHeight;
! width = (width <= (maxWidth + deltaWidth)) ?
! width : (maxWidth + deltaWidth);
! height = (height <= (maxHeight + deltaHeight)) ?
! height : (maxHeight + deltaHeight);
!
SetWindowPos(stWindow,
NULL,
--- 841,846 ----
width += deltaWidth;
height += deltaHeight;
! width = (width <= maxWidth ) ? width : maxWidth;
! height = (height <= maxHeight ) ? height : maxHeight;
SetWindowPos(stWindow,
NULL,
***************
*** 1807,1810 ****
--- 1811,1815 ----
int scHeight;
+ if(!printerSetup) SetupPrinter();
devNames = GlobalLock(printValues.hDevNames);
if(!devNames)
|
|
From: Andreas R. <and...@us...> - 2003-03-08 21:06:58
|
Update of /cvsroot/squeak/squeak/platforms/win32/vm
In directory sc8-pr-cvs1:/tmp/cvs-serv26947
Modified Files:
sqWin32Prefs.c
Log Message:
fixed typo
Index: sqWin32Prefs.c
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/win32/vm/sqWin32Prefs.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** sqWin32Prefs.c 18 Jul 2002 22:12:57 -0000 1.6
--- sqWin32Prefs.c 8 Mar 2003 21:06:56 -0000 1.7
***************
*** 181,185 ****
fPriorityBoost,squeakIniName);
! fUseOpenGL =
GetPrivateProfileInt(U_GLOBAL,TEXT("UseDirectSound"),
fUseDirectSound,squeakIniName);
--- 181,185 ----
fPriorityBoost,squeakIniName);
! fUseDirectSound =
GetPrivateProfileInt(U_GLOBAL,TEXT("UseDirectSound"),
fUseDirectSound,squeakIniName);
|
|
From: Andreas R. <and...@us...> - 2003-03-08 21:06:18
|
Update of /cvsroot/squeak/squeak/platforms/win32/vm
In directory sc8-pr-cvs1:/tmp/cvs-serv26737
Modified Files:
sqWin32Intel.c
Log Message:
print loaded plugins in crashes; removed printer setup
Index: sqWin32Intel.c
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/win32/vm/sqWin32Intel.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** sqWin32Intel.c 5 Sep 2002 19:33:54 -0000 1.5
--- sqWin32Intel.c 8 Mar 2003 21:06:15 -0000 1.6
***************
*** 380,421 ****
/* print the above information */
f = fopen("crash.dmp","a");
! if(f)
! { time_t crashTime = time(NULL);
! fprintf(f,"---------------------------------------------------------------------\n");
! fprintf(f,"%s\n", ctime(&crashTime));
! /* Print the exception code */
! fprintf(f,"Exception code: %08X\nException addr: %08X\n",
! exp->ExceptionRecord->ExceptionCode,
! exp->ExceptionRecord->ExceptionAddress);
! if(exp->ExceptionRecord->ExceptionCode == EXCEPTION_ACCESS_VIOLATION) {
! /* For access violations print what actually happened */
! fprintf(f,"Access violation (%s) at %08X\n",
! (exp->ExceptionRecord->ExceptionInformation[0] ? "write access" : "read access"),
! exp->ExceptionRecord->ExceptionInformation[1]);
! }
! fprintf(f,"EAX:%08X\tEBX:%08X\tECX:%08X\tEDX:%08X\n",
! exp->ContextRecord->Eax,
! exp->ContextRecord->Ebx,
! exp->ContextRecord->Ecx,
! exp->ContextRecord->Edx);
! fprintf(f,"ESI:%08X\tEDI:%08X\tEBP:%08X\tESP:%08X\n",
! exp->ContextRecord->Esi,
! exp->ContextRecord->Edi,
! exp->ContextRecord->Ebp,
! exp->ContextRecord->Esp);
! fprintf(f,"EIP:%08X\tEFL:%08X\n",
! exp->ContextRecord->Eip,
! exp->ContextRecord->EFlags);
! fprintf(f,"FP Control: %08X\nFP Status: %08X\nFP Tag: %08X\n",
! exp->ContextRecord->FloatSave.ControlWord,
! exp->ContextRecord->FloatSave.StatusWord,
! exp->ContextRecord->FloatSave.TagWord);
! fprintf(f,"\n"
! "Current byte code: %d\n"
! "Primitive index: %d\n"
! "Stack dump follows:\n\n",
! byteCode,
! methodPrimitiveIndex());
}
fflush(f);
--- 380,436 ----
/* print the above information */
f = fopen("crash.dmp","a");
! if(f){
! time_t crashTime = time(NULL);
! fprintf(f,"---------------------------------------------------------------------\n");
! fprintf(f,"%s\n", ctime(&crashTime));
! /* Print the exception code */
! fprintf(f,"Exception code: %08X\nException addr: %08X\n",
! exp->ExceptionRecord->ExceptionCode,
! exp->ExceptionRecord->ExceptionAddress);
! if(exp->ExceptionRecord->ExceptionCode == EXCEPTION_ACCESS_VIOLATION) {
! /* For access violations print what actually happened */
! fprintf(f,"Access violation (%s) at %08X\n",
! (exp->ExceptionRecord->ExceptionInformation[0] ? "write access" : "read access"),
! exp->ExceptionRecord->ExceptionInformation[1]);
}
+ fprintf(f,"EAX:%08X\tEBX:%08X\tECX:%08X\tEDX:%08X\n",
+ exp->ContextRecord->Eax,
+ exp->ContextRecord->Ebx,
+ exp->ContextRecord->Ecx,
+ exp->ContextRecord->Edx);
+ fprintf(f,"ESI:%08X\tEDI:%08X\tEBP:%08X\tESP:%08X\n",
+ exp->ContextRecord->Esi,
+ exp->ContextRecord->Edi,
+ exp->ContextRecord->Ebp,
+ exp->ContextRecord->Esp);
+ fprintf(f,"EIP:%08X\tEFL:%08X\n",
+ exp->ContextRecord->Eip,
+ exp->ContextRecord->EFlags);
+ fprintf(f,"FP Control: %08X\nFP Status: %08X\nFP Tag: %08X\n",
+ exp->ContextRecord->FloatSave.ControlWord,
+ exp->ContextRecord->FloatSave.StatusWord,
+ exp->ContextRecord->FloatSave.TagWord);
+ /* print version information */
+ fprintf(f,"VM Version: %s\n", SQUEAK_VM_VERSION);
+ fflush(f);
+ fprintf(f,"\n"
+ "Current byte code: %d\n"
+ "Primitive index: %d\n",
+ byteCode,
+ methodPrimitiveIndex());
+ fflush(f);
+ /* print loaded plugins */
+ fprintf(f,"\nLoaded plugins:\n");
+ {
+ int index = 1;
+ char *pluginName;
+ while( (pluginName = ioListLoadedModule(index)) != NULL) {
+ fprintf(f,"\t%s\n", pluginName);
+ fflush(f);
+ index++;
+ }
+ }
+ fprintf(f, "\n\nStack dump:\n\n");
+ }
fflush(f);
***************
*** 600,603 ****
--- 615,619 ----
LoadPreferences();
+
/* parse command line args */
if(!parseArguments(strdup(GetCommandLine()), args))
***************
*** 670,674 ****
SetupWindows();
SetupPixmaps();
- SetupPrinter();
SetupService95();
SetupTimer();
--- 686,689 ----
|
|
From: Andreas R. <and...@us...> - 2003-03-08 21:04:56
|
Update of /cvsroot/squeak/squeak/platforms/win32/vm
In directory sc8-pr-cvs1:/tmp/cvs-serv26306
Modified Files:
sqWin32.h
Log Message:
updated to 3.4.1
Index: sqWin32.h
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/win32/vm/sqWin32.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** sqWin32.h 5 Sep 2002 20:21:26 -0000 1.6
--- sqWin32.h 8 Mar 2003 21:04:53 -0000 1.7
***************
*** 241,245 ****
#endif
! #define SQUEAK_VM_VERSION TEXT("Squeak 3.2.3 / Tea 1.8 VM (release) from ") TEXT(__DATE__) \
TEXT("\n") TEXT("Compiler: ") TEXT(COMPILER) TEXT(VERSION)
--- 241,245 ----
#endif
! #define SQUEAK_VM_VERSION TEXT("Squeak 3.4.1 / Tea 1.9 VM (release) from ") TEXT(__DATE__) \
TEXT("\n") TEXT("Compiler: ") TEXT(COMPILER) TEXT(VERSION)
|
|
From: John M M. <jo...@us...> - 2003-03-05 20:15:09
|
Update of /cvsroot/squeak/squeak/platforms/Mac OS/vm
In directory sc8-pr-cvs1:/tmp/cvs-serv17713/squeak/platforms/Mac OS/vm
Modified Files:
sqMacMain.c
Log Message:
3.5.0b4 Alter for Safari support, use pthreads and project builder
Index: sqMacMain.c
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/Mac OS/vm/sqMacMain.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** sqMacMain.c 30 Sep 2002 23:54:23 -0000 1.12
--- sqMacMain.c 5 Mar 2003 19:52:18 -0000 1.13
***************
*** 87,94 ****
#if I_AM_CARBON_EVENT
#include <pthread.h>
! extern pthread_mutex_t gEventQueueLock,gEventUILock;
! extern pthread_cond_t gEventUILockCondition;
#endif
!
extern char shortImageName[];
extern char documentName[];
--- 87,96 ----
#if I_AM_CARBON_EVENT
#include <pthread.h>
! extern pthread_mutex_t gEventQueueLock,gEventUILock,gEventDrawLock,gSleepLock;
! extern pthread_cond_t gEventUILockCondition,gSleepLockCondition;
!
! pthread_t gSqueakPThread;
#endif
!
extern char shortImageName[];
extern char documentName[];
***************
*** 247,251 ****
#if I_AM_CARBON_EVENT && defined ( __APPLE__ ) && defined ( __MACH__ )
{
- pthread_t thread;
gThreadManager = false;
--- 249,252 ----
***************
*** 253,257 ****
pthread_mutex_init(&gEventUILock, NULL);
pthread_cond_init(&gEventUILockCondition,NULL);
! err = pthread_create(&thread,null,(void *) interpret, null);
if (err == 0) {
SetUpCarbonEvent();
--- 254,258 ----
pthread_mutex_init(&gEventUILock, NULL);
pthread_cond_init(&gEventUILockCondition,NULL);
! err = pthread_create(&gSqueakPThread,null,(void *) interpret, null);
if (err == 0) {
SetUpCarbonEvent();
***************
*** 283,295 ****
#endif
OSErr createNewThread() {
gSqueakThreadUPP = NewThreadEntryUPP(squeakThread); //We should dispose of someday
!
! #ifndef PLUGIN
! return NewThread( kCooperativeThread, gSqueakThreadUPP, nil, 80*1024, kCreateIfNeeded, 0L, &gSqueakThread);
! #else
! return NewThread( kCooperativeThread, gSqueakThreadUPP, nil, 80*1024, kCreateIfNeeded+kNewSuspend, 0L, &gSqueakThread);
#endif
}
--- 284,317 ----
#endif
+ #ifdef PLUGIN
+ OSErr createNewThread() {
+ #if I_AM_CARBON_EVENT && defined ( __APPLE__ ) && defined ( __MACH__ )
+ {
+ OSErr err;
+
+ gThreadManager = false;
+ pthread_mutex_init(&gEventQueueLock, NULL);
+ pthread_mutex_init(&gEventUILock, NULL);
+ pthread_mutex_init(&gEventDrawLock, NULL);
+ pthread_cond_init(&gEventUILockCondition,NULL);
+ err = pthread_create(&gSqueakPThread,null,(void *) interpret, null);
+ }
+ #else
+ gSqueakThreadUPP = NewThreadEntryUPP(squeakThread); //We should dispose of someday
+ return NewThread( kCooperativeThread, gSqueakThreadUPP, nil, 80*1024, kCreateIfNeeded+kNewSuspend, 0L, &gSqueakThread);
+ #endif
+ }
+ #else
OSErr createNewThread() {
gSqueakThreadUPP = NewThreadEntryUPP(squeakThread); //We should dispose of someday
! return NewThread( kCooperativeThread, gSqueakThreadUPP, nil, 80*1024, kCreateIfNeeded, 0L, &gSqueakThread);
! }
!
#endif
+ pascal short SqueakYieldToAnyThread(void) {
+ #if !defined( I_AM_CARBON_EVENT) && !defined ( __APPLE__ ) && !defined ( __MACH__ )
+ YieldToAnyThread();
+ #endif
}
***************
*** 303,311 ****
}
- pascal short SqueakYieldToAnyThread(void) {
- #ifndef I_AM_CARBON_EVENT
- YieldToAnyThread();
- #endif
- }
#if TARGET_API_MAC_CARBON
--- 325,328 ----
***************
*** 539,542 ****
--- 556,569 ----
if (gThreadManager)
DisposeThread(gSqueakThread,null,true);
+ #if I_AM_CARBON_EVENT && defined ( __APPLE__ ) && defined ( __MACH__ )
+ pthread_cancel(gSqueakPThread);
+ pthread_join(gSqueakPThread,NULL);
+ pthread_mutex_destroy(&gEventQueueLock);
+ pthread_mutex_destroy(&gEventUILock);
+ pthread_mutex_destroy(&gEventDrawLock);
+ pthread_mutex_destroy(&gSleepLock);
+ pthread_cond_destroy(&gEventUILockCondition);
+ pthread_cond_destroy(&gSleepLockCondition);
+ #endif
sqMacMemoryFree();
}
|
|
From: John M M. <jo...@us...> - 2003-03-05 20:00:15
|
Update of /cvsroot/squeak/squeak/platforms/Mac OS/vm/PluginSDK 4.01a/Common In directory sc8-pr-cvs1:/tmp/cvs-serv21321/squeak/platforms/Mac OS/vm/PluginSDK 4.01a/Common Modified Files: npmac.cpp Log Message: 3.5.0b4 Change interface to C style and various fixes for os-x project builder support |
|
From: John M M. <jo...@us...> - 2003-03-05 19:58:44
|
Update of /cvsroot/squeak/squeak/platforms/Mac OS/vm In directory sc8-pr-cvs1:/tmp/cvs-serv20659/squeak/platforms/Mac OS/vm Modified Files: sqMacWindow.c Log Message: 3.5.0b4 Handle browser plugin needs Index: sqMacWindow.c =================================================================== RCS file: /cvsroot/squeak/squeak/platforms/Mac OS/vm/sqMacWindow.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** sqMacWindow.c 8 Feb 2003 18:34:34 -0000 1.20 --- sqMacWindow.c 5 Mar 2003 19:58:36 -0000 1.21 *************** *** 527,531 **** ! #if !I_AM_CARBON_EVENT #define rectWidth(aRect) ((aRect).right - (aRect).left) #define rectHeight(aRect) ((aRect).bottom - (aRect).top) --- 527,531 ---- ! #if !I_AM_CARBON_EVENT || PLUGIN #define rectWidth(aRect) ((aRect).right - (aRect).left) #define rectHeight(aRect) ((aRect).bottom - (aRect).top) |
|
From: John M M. <jo...@us...> - 2003-03-05 19:57:55
|
Update of /cvsroot/squeak/squeak/platforms/Mac OS/vm
In directory sc8-pr-cvs1:/tmp/cvs-serv20218/squeak/platforms/Mac OS/vm
Modified Files:
sqMacUIEvents.c
Log Message:
3.5.0b4 Handle Safari browser pthread needs
Index: sqMacUIEvents.c
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/Mac OS/vm/sqMacUIEvents.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** sqMacUIEvents.c 14 Nov 2002 20:06:51 -0000 1.12
--- sqMacUIEvents.c 5 Mar 2003 19:57:48 -0000 1.13
***************
*** 132,136 ****
Boolean IsKeyDown(void);
! #ifndef I_AM_CARBON_EVENT
int HandleEvents(void);
void HandleMenu(int mSelect);
--- 132,136 ----
Boolean IsKeyDown(void);
! #if !defined(I_AM_CARBON_EVENT) || PLUGIN
int HandleEvents(void);
void HandleMenu(int mSelect);
***************
*** 1853,1856 ****
--- 1853,1857 ----
}
+ #ifndef PLUGIN
int ioProcessEvents(void) {
if (gQuitNowRightNow) {
***************
*** 1860,1863 ****
--- 1861,1865 ----
}
}
+ #endif
int getUIToLock(long *data) {
|
|
From: John M M. <jo...@us...> - 2003-03-05 19:57:12
|
Update of /cvsroot/squeak/squeak/platforms/Mac OS/vm
In directory sc8-pr-cvs1:/tmp/cvs-serv19779/squeak/platforms/Mac OS/vm
Modified Files:
sqMacTime.c
Log Message:
3.5.0b4 Alter logic a bit for browser plugin case to ensure time is surrendered
Index: sqMacTime.c
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/Mac OS/vm/sqMacTime.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** sqMacTime.c 27 Apr 2002 18:58:38 -0000 1.8
--- sqMacTime.c 5 Mar 2003 19:57:02 -0000 1.9
***************
*** 276,287 ****
#if !I_AM_CARBON_EVENT
microSeconds;
- if ((getNextWakeupTick() <= (ioMSecs() & 536870911)) && (getNextWakeupTick() != 0)) {
- setInterruptCheckCounter(0);
- return;
- }
if (gThreadManager)
SqueakYieldToAnyThread();
else
ioProcessEvents();
#endif
#endif
--- 276,287 ----
#if !I_AM_CARBON_EVENT
microSeconds;
if (gThreadManager)
SqueakYieldToAnyThread();
else
ioProcessEvents();
+ if ((getNextWakeupTick() <= (ioMSecs() & 536870911)) && (getNextWakeupTick() != 0)) {
+ setInterruptCheckCounter(0);
+ return;
+ }
#endif
#endif
|
|
From: John M M. <jo...@us...> - 2003-03-05 19:54:33
|
Update of /cvsroot/squeak/squeak/platforms/Mac OS/vm
In directory sc8-pr-cvs1:/tmp/cvs-serv18639/squeak/platforms/Mac OS/vm
Modified Files:
sqMacNSPlugin.c
Log Message:
3.5.0b4 Fix for safari plugin support. use real pthreads for os-x. Fix race conditions at startup time.
Index: sqMacNSPlugin.c
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/Mac OS/vm/sqMacNSPlugin.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** sqMacNSPlugin.c 8 Aug 2002 04:45:11 -0000 1.8
--- sqMacNSPlugin.c 5 Mar 2003 19:54:29 -0000 1.9
***************
*** 71,74 ****
--- 71,75 ----
#include "sqMacFileLogic.h"
#include "FilePlugin.h"
+ #include "sqMacTime.h"
#include "npapi.h"
***************
*** 108,112 ****
*
**********/
-
#define ENABLE_URL_FETCH
#define IMAGE_NAME "SqueakPlugin.image"
--- 109,112 ----
***************
*** 141,147 ****
#if PLUGIN_TRACE
! int printOnOSXPascal(unsigned char *msg);
! #define PLUGINDEBUGSTR(msg) printOnOSXPascal(msg);
! //#define PLUGINDEBUGSTR(msg) ::DebugStr(msg)
#else
#define PLUGINDEBUGSTR
--- 141,147 ----
#if PLUGIN_TRACE
! //int printOnOSXPascal(unsigned char *msg);
! //#define PLUGINDEBUGSTR(msg) printOnOSXPascal(msg);
! #define PLUGINDEBUGSTR(msg) DebugStr(msg)
#else
#define PLUGINDEBUGSTR
***************
*** 166,169 ****
--- 166,173 ----
extern int thisSession; /* from sqFilePrims.c: */
+ #if defined ( __APPLE__ ) && defined ( __MACH__ )
+ pthread_mutex_t gEventDrawLock;
+ extern TMTask gTMTask;
+ #endif
/*** Local Variables ***/
***************
*** 204,208 ****
/*** Functions Imported from sqMacWindow ***/
! void ioSetFullScreenRestore();
/*** From VM ***/
--- 208,212 ----
/*** Functions Imported from sqMacWindow ***/
! int ioSetFullScreenRestore();
/*** From VM ***/
***************
*** 310,314 ****
int16 argc, char* argn[], char* argv[], NPSavedData* saved) {
int i;
- long threadGestaltInfo;
OSErr err;
--- 314,317 ----
***************
*** 338,351 ****
gSavePortClipRgn = NewRgn();
- if ((Gestalt( gestaltThreadMgrAttr, &threadGestaltInfo) == noErr) &&
- threadGestaltInfo & (1<<gestaltThreadMgrPresent) &&
- ((Ptr) NewThread != (Ptr)kUnresolvedCFragSymbolAddress)) {
-
- gThreadManager = true;
- err = createNewThread();
- if (err != noErr)
- gThreadManager = false;
- }
-
return NPERR_NO_ERROR;
--- 341,344 ----
***************
*** 394,402 ****
NPError NPP_SetWindow(NPP instance, NPWindow* window) {
NP_Port* port;
!
! if (window == NULL) return NPERR_NO_ERROR;
! if (window->window == NULL) {
return NPERR_NO_ERROR;
! }
if (window->width == 0 && window->height == 0) {
if (gIWasRunning) {
--- 387,395 ----
NPError NPP_SetWindow(NPP instance, NPWindow* window) {
NP_Port* port;
! OSErr err;
!
! if (window == NULL || window->window == NULL)
return NPERR_NO_ERROR;
!
if (window->width == 0 && window->height == 0) {
if (gIWasRunning) {
***************
*** 407,418 ****
}
! gIWasRunning = true;
netscapeWindow = window;
port = (NP_Port *) netscapeWindow->window;
! stWindow = (WindowPtr) port->port;
needsUpdate = true;
ioLoadFunctionFrom(NULL, "DropPlugin");
if (gSqueakThread != kNoThreadID)
! SetThreadState (gSqueakThread,kReadyThreadState,kNoThreadID); //OK start Squeak
return NPERR_NO_ERROR;
--- 400,422 ----
}
!
netscapeWindow = window;
port = (NP_Port *) netscapeWindow->window;
! stWindow = GetWindowFromPort(port->port);
needsUpdate = true;
+
+ if (gIWasRunning)
+ return NPERR_NO_ERROR;
+ gIWasRunning = true;
+
ioLoadFunctionFrom(NULL, "DropPlugin");
+
+ gThreadManager = true;
+ err = createNewThread();
+ if (err != noErr)
+ gThreadManager = false;
+
if (gSqueakThread != kNoThreadID)
! SetThreadState (gSqueakThread,kReadyThreadState,kNoThreadID); //OK start Squeak (os-9)
return NPERR_NO_ERROR;
***************
*** 580,583 ****
--- 584,588 ----
}
+ if (gThreadManager)
SqueakYieldToAnyThread(); //Give some time up, needed for Netscape
***************
*** 686,694 ****
}
if (getFullScreenFlag()) {
! ok = WaitNextEvent(everyEvent, &theEvent,0,null);
eventPtr = &theEvent;
SqueakYieldToAnyThread();
}
} while (getFullScreenFlag());
return true;
}
--- 691,700 ----
}
if (getFullScreenFlag()) {
! ok = WaitNextEvent(everyEvent, &theEvent,1,null);
eventPtr = &theEvent;
SqueakYieldToAnyThread();
}
} while (getFullScreenFlag());
+
return true;
}
***************
*** 700,703 ****
--- 706,713 ----
SetClip(gSavePortClipRgn);
SetPort((GrafPtr) gOldPort);
+ #if defined ( __APPLE__ ) && defined ( __MACH__ )
+ UnlockPortBits((GrafPtr)GetWindowPort(stWindow));
+ pthread_mutex_unlock(&gEventDrawLock);
+ #endif
}
***************
*** 706,709 ****
--- 716,722 ----
Rect clipRect;
+ #if defined ( __APPLE__ ) && defined ( __MACH__ )
+ pthread_mutex_lock(&gEventDrawLock);
+ #endif
port = (NP_Port *) netscapeWindow->window;
***************
*** 711,716 ****
/* save old graphics port and switch to ours */
GetPort((GrafPtr *) &gOldPort);
- SetPort((GrafPtr) port->port);
stWindow = (WindowPtr) port->port;
/* save old drawing environment */
--- 724,732 ----
/* save old graphics port and switch to ours */
GetPort((GrafPtr *) &gOldPort);
stWindow = (WindowPtr) port->port;
+ #if defined ( __APPLE__ ) && defined ( __MACH__ )
+ LockPortBits((GrafPtr)GetWindowPort(stWindow));
+ #endif
+ SetPort((GrafPtr) port->port);
/* save old drawing environment */
***************
*** 738,743 ****
Rect dstRect = { 0, 0, 0, 0 };
Rect srcRect = { 0, 0, 0, 0 };
! RgnHandle maskRect = nil;
! Boolean restorePort=false;
if (stWindow == nil || exitRequested) {
--- 754,758 ----
Rect dstRect = { 0, 0, 0, 0 };
Rect srcRect = { 0, 0, 0, 0 };
! static RgnHandle maskRect = nil;
if (stWindow == nil || exitRequested) {
***************
*** 745,762 ****
}
- restorePort = true;
StartDraw();
- /*if (((NP_Port *) netscapeWindow->window)->port != (struct CGrafPort *) stWindow) {
- StartDraw();
- restorePort = true;
- }*/
- dstRect.left = 0;
- dstRect.top = 0;
dstRect.right = width;
dstRect.bottom = height;
-
- srcRect.left = 0;
- srcRect.top = 0;
srcRect.right = width;
srcRect.bottom = height;
--- 760,767 ----
***************
*** 780,794 ****
/* create a mask region so that only the affected rectangle is copied */
maskRect = NewRgn();
SetRectRgn(maskRect, affectedL, affectedT, affectedR, affectedB);
- SetPortWindowPort(stWindow);
CopyBits((BitMap *) *stPixMap, GetPortBitMapForCopyBits(GetWindowPort(stWindow)), &srcRect, &dstRect, srcCopy, maskRect);
! /* causes IE to crash #if TARGET_API_MAC_CARBON
! QDFlushPortBuffer (GetWindowPort(stWindow), maskRect);
! #endif */
! DisposeRgn(maskRect);
!
! if (restorePort)
EndDraw();
}
--- 785,796 ----
/* create a mask region so that only the affected rectangle is copied */
+ if (maskRect == nil)
maskRect = NewRgn();
SetRectRgn(maskRect, affectedL, affectedT, affectedR, affectedB);
CopyBits((BitMap *) *stPixMap, GetPortBitMapForCopyBits(GetWindowPort(stWindow)), &srcRect, &dstRect, srcCopy, maskRect);
! #if defined ( __APPLE__ ) && defined ( __MACH__ )
! QDFlushPortBuffer ((struct CGrafPort*)stWindow, maskRect);
! #endif
EndDraw();
}
***************
*** 854,861 ****
long junk;
char mail[8];
- if (thisInstance == null) return -1;
- handle = FindIdleURLRequest();
- if (handle < 0) return handle;
urlRequests[handle].id = nextRequestID++;
urlRequests[handle].status = STATUS_IN_PROGRESS;
--- 856,865 ----
long junk;
char mail[8];
+ NPError err;
+
+ if (thisInstance == null) return -1;
+ handle = FindIdleURLRequest();
+ if (handle < 0) return handle;
urlRequests[handle].id = nextRequestID++;
urlRequests[handle].status = STATUS_IN_PROGRESS;
***************
*** 1064,1069 ****
oldNetscapeWindow = netscapeWindow;
oldStWindow = stWindow;
! #if TARGET_API_MAC_CARBON & !defined(PLUGIN)
! GetWindowGreatestAreaDevice(stWindow,kWindowContentRgn,&dominantGDevice,&windRect);
#else
dominantGDevice = getDominateDevice(stWindow,&windRect);
--- 1068,1073 ----
oldNetscapeWindow = netscapeWindow;
oldStWindow = stWindow;
! #if TARGET_API_MAC_CARBON
! GetWindowGreatestAreaDevice((GrafPtr) FrontWindow(),kWindowContentRgn,&dominantGDevice,&windRect);
#else
dominantGDevice = getDominateDevice(stWindow,&windRect);
***************
*** 1101,1105 ****
}
! void ioSetFullScreenRestore()
{
if (gRestorableStateForScreen != nil) {
--- 1105,1109 ----
}
! int ioSetFullScreenRestore()
{
if (gRestorableStateForScreen != nil) {
***************
*** 1458,1462 ****
! void OpenFileReadOnly(SQFile *f, char *fileName) {
/* Opens the given file for reading using the supplied sqFile
structure. This is a simplified version of sqFileOpen() that
--- 1462,1466 ----
! void OpenFileReadOnly(SQFile *f, char *MacfileName) {
/* Opens the given file for reading using the supplied sqFile
structure. This is a simplified version of sqFileOpen() that
***************
*** 1465,1468 ****
--- 1469,1480 ----
we only allow reading of this file. Sets the primitive
failure flag if not successful. */
+ char fileName[1024];
+ sqImageFile remember;
+
+ if (*MacfileName == NULL) {
+ interpreterProxy->success(false);
+ return;
+ }
+ sqFilenameFromStringOpen(fileName,(long) MacfileName, strlen(MacfileName));
f->file = fopen(fileName, "rb");
***************
*** 1535,1542 ****
int i;
if (thisInstance == nil) return;
thisInstance = nil;
exitRequested = true;
!
/* do { This hangs things, not sure what to do about outstanding URL requests...
URLFetchInProgress = false;
--- 1547,1559 ----
int i;
+ #if defined ( __APPLE__ ) && defined ( __MACH__ )
+ pthread_mutex_lock(&gEventDrawLock);
+ #endif
if (thisInstance == nil) return;
thisInstance = nil;
exitRequested = true;
! #if defined ( __APPLE__ ) && defined ( __MACH__ )
! pthread_mutex_unlock(&gEventDrawLock);
! #endif
/* do { This hangs things, not sure what to do about outstanding URL requests...
URLFetchInProgress = false;
***************
*** 1555,1561 ****
--- 1572,1589 ----
while(gSqueakThread != kNoThreadID && YieldToThread(gSqueakThread) == noErr){};
+ #if defined ( __APPLE__ ) && defined ( __MACH__ )
+ if (gTMTask.tmAddr) {
+
+ RemoveTimeTask((QElemPtr)&gTMTask);
+ DisposeTimerUPP(gTMTask.tmAddr);
+ gTMTask.tmAddr = NULL;
+ }
+ #endif
+
plugInShutdown();
ioSetFullScreenRestore();
NPP_Initialize(); /* reset local variables */
+ ignoreFirstEvent=false;
+ gIWasRunning=false;
}
|