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: John M M. <jo...@us...> - 2002-12-21 06:36:41
|
Update of /cvsroot/squeak/squeak/platforms/Mac OS/plugins/SqueakFFIPrims
In directory sc8-pr-cvs1:/tmp/cvs-serv30333/squeak/platforms/Mac OS/plugins/SqueakFFIPrims
Modified Files:
sqMacFFIPPC.c
Log Message:
1.3.1 Add test cases for 7 and 13 arguments
Index: sqMacFFIPPC.c
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/Mac OS/plugins/SqueakFFIPrims/sqMacFFIPPC.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** sqMacFFIPPC.c 18 Nov 2002 19:09:23 -0000 1.3
--- sqMacFFIPPC.c 21 Dec 2002 06:36:37 -0000 1.4
***************
*** 503,507 ****
--- 503,510 ----
EXPORT(short) ffiTestShorts(short c1, short c2, short c3, short c4);
EXPORT(int) ffiTestInts(int c1, int c2, int c3, int c4);
+ EXPORT(int) ffiTestInts8(int c1, int c2, int c3, int c4, int c5, int c6, int c7, int c8);
EXPORT(float) ffiTestFloats(float f1, float f2);
+ EXPORT(float) ffiTestFloats7(float f1, float f2, float f3, float f4, float f5, float f6, float f7);
+ EXPORT(float) ffiTestFloats13(float f1, float f2, float f3, float f4, float f5, float f6, float f7, float f8, float f9, float f10, float f11, float f12, float f13);
EXPORT(double) ffiTestDoubles(double d1, double d2);
EXPORT(char *) ffiPrintString(char *string);
***************
*** 531,534 ****
--- 534,543 ----
}
+ EXPORT(int) ffiTestInts8(int c1, int c2, int c3, int c4, int c5, int c6, int c7, int c8) {
+ printf("4 ints came in as\ni1 = %d (%x)\ni2 = %d (%x)\ni3 = %d (%x)\ni4 = %d (%x)\ni5 = %d (%x)\ni6 = %d (%x)\ni7 = %d (%x)\ni8 = %d (%x)\n", c1, c1, c2, c2, c3, c3, c4, c4, c5, c5, c6, c6, c7, c7, c8, c8);
+ return 42;
+ }
+
+
/* test passing and returning floats */
EXPORT(float) ffiTestFloats(float f1, float f2) {
***************
*** 536,539 ****
--- 545,559 ----
return (float) (f1 + f2);
}
+
+ EXPORT(float) ffiTestFloats7(float f1, float f2, float f3, float f4, float f5, float f6, float f7) {
+ printf("The 7 floats are %f %f %f %f %f %f %f\n", f1, f2, f3, f4, f5, f6, f7);
+ return (float) (f1 + f2 + f3 + f4 + f5 + f6 + f7);
+ }
+
+ EXPORT(float) ffiTestFloats13(float f1, float f2, float f3, float f4, float f5, float f6, float f7, float f8, float f9, float f10, float f11, float f12, float f13) {
+ printf("The 13 floats are %f %f %f %f %f %f %f %f %f %f %f %f %f\n", f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13);
+ return (float) (f1 + f2 + f3 + f4 + f5 + f6 + f7 + f8 + f9 + f10 + f11 + f12 + f13);
+ }
+
/* test passing and returning doubles */
|
|
From: John M M. <jo...@pr...> - 2002-11-18 20:40:56
|
Update of /cvsroot/squeak/squeak/platforms/Mac OS/vm/Documentation In directory sc8-pr-cvs1:/tmp/cvs-serv25152/squeak/platforms/Mac OS/vm/Documentation Modified Files: 3.4.0 Release Notes.rtf Log Message: 3.4.0b2 Update readme Index: 3.4.0 Release Notes.rtf =================================================================== RCS file: /cvsroot/squeak/squeak/platforms/Mac OS/vm/Documentation/3.4.0 Release Notes.rtf,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** 3.4.0 Release Notes.rtf 14 Nov 2002 19:49:28 -0000 1.1 --- 3.4.0 Release Notes.rtf 18 Nov 2002 20:40:53 -0000 1.2 *************** *** 7,11 **** \f0\fs24 \cf0 Mac VM 3.4.0 mach-o build for Carbon, and build for Classic. Support for Croquet\ ! Nov 14th, 2002 (3.4.0b1)\ Still yet to do, in future versions.\ Verify that file delete rename etc works on aliases, not the targets.\ --- 7,11 ---- \f0\fs24 \cf0 Mac VM 3.4.0 mach-o build for Carbon, and build for Classic. Support for Croquet\ ! Nov 18th, 2002 (3.4.0b2)\ Still yet to do, in future versions.\ Verify that file delete rename etc works on aliases, not the targets.\ *************** *** 24,27 **** --- 24,30 ---- This is fixed in 3.2.7b3\ Some issues with alias files and folder were fixed in 3.2.7b6 and 3.2.8b3\ + 3.4.0b2 (Croquet support)\ + \ + a) Ensure vmVersion information reports correct information, was bogus in 3.4.0b1\ \ 3.4.0b1 (Croquet support)\ |
|
From: John M M. <jo...@pr...> - 2002-11-18 19:14:50
|
Update of /cvsroot/squeak/squeak/platforms/Mac OS/vm/Developer In directory sc8-pr-cvs1:/tmp/cvs-serv21918/squeak/platforms/Mac OS/vm/Developer Modified Files: SqueakVMForCarbon.pbproj.sit Log Message: 3.4.0b2 build files. Index: SqueakVMForCarbon.pbproj.sit =================================================================== RCS file: /cvsroot/squeak/squeak/platforms/Mac OS/vm/Developer/SqueakVMForCarbon.pbproj.sit,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 Binary files /tmp/cvsHen7hX and /tmp/cvsIszVgK differ |
|
From: John M M. <jo...@pr...> - 2002-11-18 19:14:41
|
Update of /cvsroot/squeak/squeak/platforms/Mac OS/vm/Developer
In directory sc8-pr-cvs1:/tmp/cvs-serv21623/squeak/platforms/Mac OS/vm/Developer
Modified Files:
SqueakPro5.xml
Log Message:
3.4.0b2 build files.
Index: SqueakPro5.xml
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/Mac OS/vm/Developer/SqueakPro5.xml,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** SqueakPro5.xml 22 Aug 2002 06:56:27 -0000 1.4
--- SqueakPro5.xml 18 Nov 2002 19:14:38 -0000 1.5
***************
*** 606,610 ****
<SETTING><VALUE></VALUE></SETTING>
<SETTING><VALUE></VALUE></SETTING>
! <SETTING><VALUE>"</VALUE></SETTING>
<SETTING><VALUE></VALUE></SETTING>
</SETTING>
--- 606,610 ----
<SETTING><VALUE></VALUE></SETTING>
<SETTING><VALUE></VALUE></SETTING>
! <SETTING><VALUE> §1</VALUE></SETTING>
<SETTING><VALUE></VALUE></SETTING>
</SETTING>
***************
*** 1996,1999 ****
--- 1996,2013 ----
<FILEFLAGS>Debug</FILEFLAGS>
</FILE>
+ <FILE>
+ <PATHTYPE>Name</PATHTYPE>
+ <PATH>BMPReadWriterPlugin.c</PATH>
+ <PATHFORMAT>MacOS</PATHFORMAT>
+ <FILEKIND>Text</FILEKIND>
+ <FILEFLAGS>Debug</FILEFLAGS>
+ </FILE>
+ <FILE>
+ <PATHTYPE>Name</PATHTYPE>
+ <PATH>GeniePlugin.c</PATH>
+ <PATHFORMAT>MacOS</PATHFORMAT>
+ <FILEKIND>Text</FILEKIND>
+ <FILEFLAGS>Debug</FILEFLAGS>
+ </FILE>
</FILELIST>
<LINKORDER>
***************
*** 2923,2926 ****
--- 2937,2950 ----
<PATHFORMAT>MacOS</PATHFORMAT>
</FILEREF>
+ <FILEREF>
+ <PATHTYPE>Name</PATHTYPE>
+ <PATH>BMPReadWriterPlugin.c</PATH>
+ <PATHFORMAT>MacOS</PATHFORMAT>
+ </FILEREF>
+ <FILEREF>
+ <PATHTYPE>Name</PATHTYPE>
+ <PATH>GeniePlugin.c</PATH>
+ <PATHFORMAT>MacOS</PATHFORMAT>
+ </FILEREF>
</LINKORDER>
</TARGET>
***************
*** 3482,3486 ****
<SETTING><VALUE></VALUE></SETTING>
<SETTING><VALUE></VALUE></SETTING>
! <SETTING><VALUE>"</VALUE></SETTING>
<SETTING><VALUE></VALUE></SETTING>
</SETTING>
--- 3506,3510 ----
<SETTING><VALUE></VALUE></SETTING>
<SETTING><VALUE></VALUE></SETTING>
! <SETTING><VALUE> §1</VALUE></SETTING>
<SETTING><VALUE></VALUE></SETTING>
</SETTING>
***************
*** 4872,4875 ****
--- 4896,4913 ----
<FILEFLAGS></FILEFLAGS>
</FILE>
+ <FILE>
+ <PATHTYPE>Name</PATHTYPE>
+ <PATH>BMPReadWriterPlugin.c</PATH>
+ <PATHFORMAT>MacOS</PATHFORMAT>
+ <FILEKIND>Text</FILEKIND>
+ <FILEFLAGS></FILEFLAGS>
+ </FILE>
+ <FILE>
+ <PATHTYPE>Name</PATHTYPE>
+ <PATH>GeniePlugin.c</PATH>
+ <PATHFORMAT>MacOS</PATHFORMAT>
+ <FILEKIND>Text</FILEKIND>
+ <FILEFLAGS></FILEFLAGS>
+ </FILE>
</FILELIST>
<LINKORDER>
***************
*** 5799,5802 ****
--- 5837,5850 ----
<PATHFORMAT>MacOS</PATHFORMAT>
</FILEREF>
+ <FILEREF>
+ <PATHTYPE>Name</PATHTYPE>
+ <PATH>BMPReadWriterPlugin.c</PATH>
+ <PATHFORMAT>MacOS</PATHFORMAT>
+ </FILEREF>
+ <FILEREF>
+ <PATHTYPE>Name</PATHTYPE>
+ <PATH>GeniePlugin.c</PATH>
+ <PATHFORMAT>MacOS</PATHFORMAT>
+ </FILEREF>
</LINKORDER>
</TARGET>
***************
*** 6367,6371 ****
<SETTING><VALUE></VALUE></SETTING>
<SETTING><VALUE></VALUE></SETTING>
! <SETTING><VALUE>"</VALUE></SETTING>
<SETTING><VALUE></VALUE></SETTING>
</SETTING>
--- 6415,6419 ----
<SETTING><VALUE></VALUE></SETTING>
<SETTING><VALUE></VALUE></SETTING>
! <SETTING><VALUE> §1</VALUE></SETTING>
<SETTING><VALUE></VALUE></SETTING>
</SETTING>
***************
*** 7785,7788 ****
--- 7833,7850 ----
<FILEFLAGS></FILEFLAGS>
</FILE>
+ <FILE>
+ <PATHTYPE>Name</PATHTYPE>
+ <PATH>BMPReadWriterPlugin.c</PATH>
+ <PATHFORMAT>MacOS</PATHFORMAT>
+ <FILEKIND>Text</FILEKIND>
+ <FILEFLAGS></FILEFLAGS>
+ </FILE>
+ <FILE>
+ <PATHTYPE>Name</PATHTYPE>
+ <PATH>GeniePlugin.c</PATH>
+ <PATHFORMAT>MacOS</PATHFORMAT>
+ <FILEKIND>Text</FILEKIND>
+ <FILEFLAGS></FILEFLAGS>
+ </FILE>
</FILELIST>
<LINKORDER>
***************
*** 8732,8735 ****
--- 8794,8807 ----
<PATHFORMAT>MacOS</PATHFORMAT>
</FILEREF>
+ <FILEREF>
+ <PATHTYPE>Name</PATHTYPE>
+ <PATH>BMPReadWriterPlugin.c</PATH>
+ <PATHFORMAT>MacOS</PATHFORMAT>
+ </FILEREF>
+ <FILEREF>
+ <PATHTYPE>Name</PATHTYPE>
+ <PATH>GeniePlugin.c</PATH>
+ <PATHFORMAT>MacOS</PATHFORMAT>
+ </FILEREF>
</LINKORDER>
</TARGET>
***************
*** 9300,9304 ****
<SETTING><VALUE></VALUE></SETTING>
<SETTING><VALUE></VALUE></SETTING>
! <SETTING><VALUE>"</VALUE></SETTING>
<SETTING><VALUE></VALUE></SETTING>
</SETTING>
--- 9372,9376 ----
<SETTING><VALUE></VALUE></SETTING>
<SETTING><VALUE></VALUE></SETTING>
! <SETTING><VALUE> §1</VALUE></SETTING>
<SETTING><VALUE></VALUE></SETTING>
</SETTING>
***************
*** 10599,10602 ****
--- 10671,10688 ----
<FILEFLAGS>Debug</FILEFLAGS>
</FILE>
+ <FILE>
+ <PATHTYPE>Name</PATHTYPE>
+ <PATH>BMPReadWriterPlugin.c</PATH>
+ <PATHFORMAT>MacOS</PATHFORMAT>
+ <FILEKIND>Text</FILEKIND>
+ <FILEFLAGS>Debug</FILEFLAGS>
+ </FILE>
+ <FILE>
+ <PATHTYPE>Name</PATHTYPE>
+ <PATH>GeniePlugin.c</PATH>
+ <PATHFORMAT>MacOS</PATHFORMAT>
+ <FILEKIND>Text</FILEKIND>
+ <FILEFLAGS>Debug</FILEFLAGS>
+ </FILE>
</FILELIST>
<LINKORDER>
***************
*** 11461,11464 ****
--- 11547,11560 ----
<PATHFORMAT>MacOS</PATHFORMAT>
</FILEREF>
+ <FILEREF>
+ <PATHTYPE>Name</PATHTYPE>
+ <PATH>BMPReadWriterPlugin.c</PATH>
+ <PATHFORMAT>MacOS</PATHFORMAT>
+ </FILEREF>
+ <FILEREF>
+ <PATHTYPE>Name</PATHTYPE>
+ <PATH>GeniePlugin.c</PATH>
+ <PATHFORMAT>MacOS</PATHFORMAT>
+ </FILEREF>
</LINKORDER>
</TARGET>
***************
*** 12029,12033 ****
<SETTING><VALUE></VALUE></SETTING>
<SETTING><VALUE></VALUE></SETTING>
! <SETTING><VALUE>"</VALUE></SETTING>
<SETTING><VALUE></VALUE></SETTING>
</SETTING>
--- 12125,12129 ----
<SETTING><VALUE></VALUE></SETTING>
<SETTING><VALUE></VALUE></SETTING>
! <SETTING><VALUE> §1</VALUE></SETTING>
<SETTING><VALUE></VALUE></SETTING>
</SETTING>
***************
*** 13447,13450 ****
--- 13543,13560 ----
<FILEFLAGS>Debug</FILEFLAGS>
</FILE>
+ <FILE>
+ <PATHTYPE>Name</PATHTYPE>
+ <PATH>BMPReadWriterPlugin.c</PATH>
+ <PATHFORMAT>MacOS</PATHFORMAT>
+ <FILEKIND>Text</FILEKIND>
+ <FILEFLAGS>Debug</FILEFLAGS>
+ </FILE>
+ <FILE>
+ <PATHTYPE>Name</PATHTYPE>
+ <PATH>GeniePlugin.c</PATH>
+ <PATHFORMAT>MacOS</PATHFORMAT>
+ <FILEKIND>Text</FILEKIND>
+ <FILEFLAGS>Debug</FILEFLAGS>
+ </FILE>
</FILELIST>
<LINKORDER>
***************
*** 14394,14397 ****
--- 14504,14517 ----
<PATHFORMAT>MacOS</PATHFORMAT>
</FILEREF>
+ <FILEREF>
+ <PATHTYPE>Name</PATHTYPE>
+ <PATH>BMPReadWriterPlugin.c</PATH>
+ <PATHFORMAT>MacOS</PATHFORMAT>
+ </FILEREF>
+ <FILEREF>
+ <PATHTYPE>Name</PATHTYPE>
+ <PATH>GeniePlugin.c</PATH>
+ <PATHFORMAT>MacOS</PATHFORMAT>
+ </FILEREF>
</LINKORDER>
</TARGET>
***************
*** 14962,14966 ****
<SETTING><VALUE></VALUE></SETTING>
<SETTING><VALUE></VALUE></SETTING>
! <SETTING><VALUE>"</VALUE></SETTING>
<SETTING><VALUE></VALUE></SETTING>
</SETTING>
--- 15082,15086 ----
<SETTING><VALUE></VALUE></SETTING>
<SETTING><VALUE></VALUE></SETTING>
! <SETTING><VALUE> §1</VALUE></SETTING>
<SETTING><VALUE></VALUE></SETTING>
</SETTING>
***************
*** 16261,16264 ****
--- 16381,16398 ----
<FILEFLAGS></FILEFLAGS>
</FILE>
+ <FILE>
+ <PATHTYPE>Name</PATHTYPE>
+ <PATH>BMPReadWriterPlugin.c</PATH>
+ <PATHFORMAT>MacOS</PATHFORMAT>
+ <FILEKIND>Text</FILEKIND>
+ <FILEFLAGS></FILEFLAGS>
+ </FILE>
+ <FILE>
+ <PATHTYPE>Name</PATHTYPE>
+ <PATH>GeniePlugin.c</PATH>
+ <PATHFORMAT>MacOS</PATHFORMAT>
+ <FILEKIND>Text</FILEKIND>
+ <FILEFLAGS></FILEFLAGS>
+ </FILE>
</FILELIST>
<LINKORDER>
***************
*** 17123,17126 ****
--- 17257,17270 ----
<PATHFORMAT>MacOS</PATHFORMAT>
</FILEREF>
+ <FILEREF>
+ <PATHTYPE>Name</PATHTYPE>
+ <PATH>BMPReadWriterPlugin.c</PATH>
+ <PATHFORMAT>MacOS</PATHFORMAT>
+ </FILEREF>
+ <FILEREF>
+ <PATHTYPE>Name</PATHTYPE>
+ <PATH>GeniePlugin.c</PATH>
+ <PATHFORMAT>MacOS</PATHFORMAT>
+ </FILEREF>
</LINKORDER>
</TARGET>
***************
*** 17709,17713 ****
<SETTING><VALUE></VALUE></SETTING>
<SETTING><VALUE></VALUE></SETTING>
! <SETTING><VALUE>"</VALUE></SETTING>
<SETTING><VALUE></VALUE></SETTING>
</SETTING>
--- 17853,17857 ----
<SETTING><VALUE></VALUE></SETTING>
<SETTING><VALUE></VALUE></SETTING>
! <SETTING><VALUE> §1</VALUE></SETTING>
<SETTING><VALUE></VALUE></SETTING>
</SETTING>
***************
*** 19001,19004 ****
--- 19145,19162 ----
<FILEFLAGS>Debug</FILEFLAGS>
</FILE>
+ <FILE>
+ <PATHTYPE>Name</PATHTYPE>
+ <PATH>BMPReadWriterPlugin.c</PATH>
+ <PATHFORMAT>MacOS</PATHFORMAT>
+ <FILEKIND>Text</FILEKIND>
+ <FILEFLAGS>Debug</FILEFLAGS>
+ </FILE>
+ <FILE>
+ <PATHTYPE>Name</PATHTYPE>
+ <PATH>GeniePlugin.c</PATH>
+ <PATHFORMAT>MacOS</PATHFORMAT>
+ <FILEKIND>Text</FILEKIND>
+ <FILEFLAGS>Debug</FILEFLAGS>
+ </FILE>
</FILELIST>
<LINKORDER>
***************
*** 19858,19861 ****
--- 20016,20029 ----
<PATHFORMAT>MacOS</PATHFORMAT>
</FILEREF>
+ <FILEREF>
+ <PATHTYPE>Name</PATHTYPE>
+ <PATH>BMPReadWriterPlugin.c</PATH>
+ <PATHFORMAT>MacOS</PATHFORMAT>
+ </FILEREF>
+ <FILEREF>
+ <PATHTYPE>Name</PATHTYPE>
+ <PATH>GeniePlugin.c</PATH>
+ <PATHFORMAT>MacOS</PATHFORMAT>
+ </FILEREF>
</LINKORDER>
</TARGET>
***************
*** 20444,20448 ****
<SETTING><VALUE></VALUE></SETTING>
<SETTING><VALUE></VALUE></SETTING>
! <SETTING><VALUE>"</VALUE></SETTING>
<SETTING><VALUE></VALUE></SETTING>
</SETTING>
--- 20612,20616 ----
<SETTING><VALUE></VALUE></SETTING>
<SETTING><VALUE></VALUE></SETTING>
! <SETTING><VALUE> §1</VALUE></SETTING>
<SETTING><VALUE></VALUE></SETTING>
</SETTING>
***************
*** 21743,21746 ****
--- 21911,21928 ----
<FILEFLAGS></FILEFLAGS>
</FILE>
+ <FILE>
+ <PATHTYPE>Name</PATHTYPE>
+ <PATH>BMPReadWriterPlugin.c</PATH>
+ <PATHFORMAT>MacOS</PATHFORMAT>
+ <FILEKIND>Text</FILEKIND>
+ <FILEFLAGS></FILEFLAGS>
+ </FILE>
+ <FILE>
+ <PATHTYPE>Name</PATHTYPE>
+ <PATH>GeniePlugin.c</PATH>
+ <PATHFORMAT>MacOS</PATHFORMAT>
+ <FILEKIND>Text</FILEKIND>
+ <FILEFLAGS></FILEFLAGS>
+ </FILE>
</FILELIST>
<LINKORDER>
***************
*** 22605,22608 ****
--- 22787,22800 ----
<PATHFORMAT>MacOS</PATHFORMAT>
</FILEREF>
+ <FILEREF>
+ <PATHTYPE>Name</PATHTYPE>
+ <PATH>BMPReadWriterPlugin.c</PATH>
+ <PATHFORMAT>MacOS</PATHFORMAT>
+ </FILEREF>
+ <FILEREF>
+ <PATHTYPE>Name</PATHTYPE>
+ <PATH>GeniePlugin.c</PATH>
+ <PATHFORMAT>MacOS</PATHFORMAT>
+ </FILEREF>
</LINKORDER>
</TARGET>
***************
*** 23071,23074 ****
--- 23263,23272 ----
<TARGETNAME>Squeak VM PPC Debug</TARGETNAME>
<PATHTYPE>Name</PATHTYPE>
+ <PATH>BMPReadWriterPlugin.c</PATH>
+ <PATHFORMAT>MacOS</PATHFORMAT>
+ </FILEREF>
+ <FILEREF>
+ <TARGETNAME>Squeak VM PPC Debug</TARGETNAME>
+ <PATHTYPE>Name</PATHTYPE>
<PATH>DSAPrims.c</PATH>
<PATHFORMAT>MacOS</PATHFORMAT>
***************
*** 23114,23117 ****
--- 23312,23321 ----
<PATHTYPE>Name</PATHTYPE>
<PATH>FloatArrayPlugin.c</PATH>
+ <PATHFORMAT>MacOS</PATHFORMAT>
+ </FILEREF>
+ <FILEREF>
+ <TARGETNAME>Squeak VM PPC Debug</TARGETNAME>
+ <PATHTYPE>Name</PATHTYPE>
+ <PATH>GeniePlugin.c</PATH>
<PATHFORMAT>MacOS</PATHFORMAT>
</FILEREF>
|
|
From: John M M. <jo...@pr...> - 2002-11-18 19:14:15
|
Update of /cvsroot/squeak/squeak/platforms/Mac OS/vm/Developer In directory sc8-pr-cvs1:/tmp/cvs-serv21503/squeak/platforms/Mac OS/vm/Developer Modified Files: resources.sit Log Message: 3.4.0b2 build files. Index: resources.sit =================================================================== RCS file: /cvsroot/squeak/squeak/platforms/Mac OS/vm/Developer/resources.sit,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 Binary files /tmp/cvs7KDfFM and /tmp/cvss8pJQo differ |
|
From: John M M. <jo...@pr...> - 2002-11-18 19:12:43
|
Update of /cvsroot/squeak/squeak/platforms/Mac OS/plugins/SqueakFFIPrims In directory sc8-pr-cvs1:/tmp/cvs-serv20705/squeak/platforms/Mac OS/plugins/SqueakFFIPrims Modified Files: SqueakFFI.pbproj.sit Log Message: 1.3 CW Project used to build 1.3 of the FFI prim plugin Index: SqueakFFI.pbproj.sit =================================================================== RCS file: /cvsroot/squeak/squeak/platforms/Mac OS/plugins/SqueakFFIPrims/SqueakFFI.pbproj.sit,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvs7840Us and /tmp/cvsG7P9WN differ |
|
From: John M M. <jo...@pr...> - 2002-11-18 19:10:21
|
Update of /cvsroot/squeak/squeak/platforms/Mac OS/plugins/SqueakFFIPrims In directory sc8-pr-cvs1:/tmp/cvs-serv19410/squeak/platforms/Mac OS/plugins/SqueakFFIPrims Modified Files: sqMacFFIPPC.c Log Message: 1.3 Changes to save and restore CCR, align stack on 32byte boundaries, and to make some variables static versus non-static for classic, versus os-x Index: sqMacFFIPPC.c =================================================================== RCS file: /cvsroot/squeak/squeak/platforms/Mac OS/plugins/SqueakFFIPrims/sqMacFFIPPC.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** sqMacFFIPPC.c 1 Feb 2002 07:05:09 -0000 1.2 --- sqMacFFIPPC.c 18 Nov 2002 19:09:23 -0000 1.3 *************** *** 20,23 **** --- 20,29 ---- #endif + #if defined ( __APPLE__ ) && defined ( __MACH__ ) + #define staticIssue + #else + #define staticIssue static + #endif + extern struct VirtualMachine *interpreterProxy; #define primitiveFail() interpreterProxy->primitiveFail(); *************** *** 28,46 **** /* Values passed in GPR3-GPR10 */ ! int GPRegs[8]; ! /* Nr of GPRegs used so far */ ! int gpRegCount = 0; /* Values passed in FPR1-FPR13 */ ! double FPRegs[13]; /* Nr of FPRegs used so far */ ! int fpRegCount = 0; /* Max stack size */ #define FFI_MAX_STACK 512 /* The stack used to assemble the arguments for a call */ ! int ffiStack[FFI_MAX_STACK]; /* The stack pointer while filling the stack */ ! int ffiStackIndex = 0; /* The area for temporarily allocated strings */ static char *ffiTempStrings[FFI_MAX_STACK]; --- 34,51 ---- /* Values passed in GPR3-GPR10 */ ! static int GPRegs[8]; /* Nr of GPRegs used so far */ ! staticIssue int gpRegCount = 0; /* Values passed in FPR1-FPR13 */ ! static double FPRegs[13]; /* Nr of FPRegs used so far */ ! staticIssue int fpRegCount = 0; /* Max stack size */ #define FFI_MAX_STACK 512 /* The stack used to assemble the arguments for a call */ ! static int ffiStack[FFI_MAX_STACK]; /* The stack pointer while filling the stack */ ! staticIssue int ffiStackIndex = 0; /* The area for temporarily allocated strings */ static char *ffiTempStrings[FFI_MAX_STACK]; *************** *** 49,55 **** /* The return values for calls */ ! int intReturnValue; ! LONGLONG longReturnValue; ! double floatReturnValue; static int *structReturnValue = NULL; --- 54,60 ---- /* The return values for calls */ ! staticIssue int intReturnValue; ! static LONGLONG longReturnValue; ! static double floatReturnValue; static int *structReturnValue = NULL; *************** *** 338,346 **** } ! int ffiStackLocation=&ffiStack; ! int FPRegsLocation=&FPRegs; ! int GPRegsLocation=&GPRegs; ! int longReturnValueLocation=&longReturnValue; ! int floatReturnValueLocation=&floatReturnValue; /*****************************************************************************/ /*****************************************************************************/ --- 343,351 ---- } ! int ffiStackLocation=(int) &ffiStack; ! int FPRegsLocation=(int) &FPRegs; ! int GPRegsLocation=(int) &GPRegs; ! int longReturnValueLocation=(int) &longReturnValue; ! int floatReturnValueLocation=(int) &floatReturnValue; /*****************************************************************************/ /*****************************************************************************/ *************** *** 355,358 **** --- 360,365 ---- mflr r0 stw r0, 8(SP) + mfcr r0 /* save CCR */ + stw r0,4(sp) /* get stack index and preserve it for copying stuff later */ *************** *** 361,365 **** /* compute frame size */ rlwinm r5, r4, 2, 0, 29 /* ffiStackIndex words to bytes (e.g., "slwi r5, r4, 2") */ ! addi r5, r5, 24 /* linkage area */ neg r5, r5 /* stack goes down */ --- 368,373 ---- /* compute frame size */ rlwinm r5, r4, 2, 0, 29 /* ffiStackIndex words to bytes (e.g., "slwi r5, r4, 2") */ ! addi r5, r5, 24+15 /* linkage area */ ! rlwinm r5,r5,0,0,27 /* JMM round up to quad word*/ neg r5, r5 /* stack goes down */ *************** *** 389,393 **** lwz r12, FPRegs(RTOC) cmpwi r3, 0 /* skip all fpregs if no FP values used */ ! blt _0_fpregs cmpwi r3, 8 blt _7_fpregs /* skip last N fpregs if unused */ --- 397,401 ---- lwz r12, FPRegs(RTOC) cmpwi r3, 0 /* skip all fpregs if no FP values used */ ! beq _0_fpregs cmpwi r3, 8 blt _7_fpregs /* skip last N fpregs if unused */ *************** *** 412,416 **** lwz r3, gpRegCount lwz r12, GPRegs(RTOC) ! cmpwi r3, 4 blt _4_gpregs /* skip last four gpregs if unused */ _all_gpregs: --- 420,424 ---- lwz r3, gpRegCount lwz r12, GPRegs(RTOC) ! cmpwi r3, 5 blt _4_gpregs /* skip last four gpregs if unused */ _all_gpregs: *************** *** 448,451 **** --- 456,461 ---- /* and get out of here */ + lwz r0, 4(sp) /*restore CCR */ + mtcrf 0xff,r0 lwz r0, 8(SP) mtlr r0 |
|
From: John M M. <jo...@pr...> - 2002-11-18 19:01:50
|
Update of /cvsroot/squeak/squeak/platforms/Mac OS/plugins/SqueakFFIPrims
In directory sc8-pr-cvs1:/tmp/cvs-serv17023/squeak/platforms/Mac OS/plugins/SqueakFFIPrims
Modified Files:
SqueakFFIPrims.proj.xml
Log Message:
1.3 CW project used to build FFI prims 1.3 for classic
Index: SqueakFFIPrims.proj.xml
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/Mac OS/plugins/SqueakFFIPrims/SqueakFFIPrims.proj.xml,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** SqueakFFIPrims.proj.xml 24 Oct 2001 23:13:45 -0000 1.1.1.1
--- SqueakFFIPrims.proj.xml 18 Nov 2002 19:01:42 -0000 1.2
***************
*** 93,99 ****
<SETTING>
<SETTING><NAME>SearchPath</NAME>
! <SETTING><NAME>Path</NAME><VALUE>::</VALUE></SETTING>
<SETTING><NAME>PathFormat</NAME><VALUE>MacOS</VALUE></SETTING>
! <SETTING><NAME>PathRoot</NAME><VALUE>Project</VALUE></SETTING>
</SETTING>
<SETTING><NAME>Recursive</NAME><VALUE>true</VALUE></SETTING>
--- 93,108 ----
<SETTING>
<SETTING><NAME>SearchPath</NAME>
! <SETTING><NAME>Path</NAME><VALUE>Lamie:Squeak:SqueakAtSourceForge:squeak:platforms:Mac OS:</VALUE></SETTING>
<SETTING><NAME>PathFormat</NAME><VALUE>MacOS</VALUE></SETTING>
! <SETTING><NAME>PathRoot</NAME><VALUE>Absolute</VALUE></SETTING>
! </SETTING>
! <SETTING><NAME>Recursive</NAME><VALUE>true</VALUE></SETTING>
! <SETTING><NAME>HostFlags</NAME><VALUE>All</VALUE></SETTING>
! </SETTING>
! <SETTING>
! <SETTING><NAME>SearchPath</NAME>
! <SETTING><NAME>Path</NAME><VALUE>Lamie:Squeak:SqueakAtSourceForge:squeak:platforms:Cross:</VALUE></SETTING>
! <SETTING><NAME>PathFormat</NAME><VALUE>MacOS</VALUE></SETTING>
! <SETTING><NAME>PathRoot</NAME><VALUE>Absolute</VALUE></SETTING>
</SETTING>
<SETTING><NAME>Recursive</NAME><VALUE>true</VALUE></SETTING>
***************
*** 274,278 ****
<SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
<SETTING><NAME>FileExtension</NAME><VALUE>.idl</VALUE></SETTING>
! <SETTING><NAME>Compiler</NAME><VALUE>SOMobjects TS</VALUE></SETTING>
<SETTING><NAME>Precompile</NAME><VALUE>true</VALUE></SETTING>
<SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
--- 283,287 ----
<SETTING><NAME>FileType</NAME><VALUE>TEXT</VALUE></SETTING>
<SETTING><NAME>FileExtension</NAME><VALUE>.idl</VALUE></SETTING>
! <SETTING><NAME>Compiler</NAME><VALUE>SOMobjectsª TS</VALUE></SETTING>
<SETTING><NAME>Precompile</NAME><VALUE>true</VALUE></SETTING>
<SETTING><NAME>Launchable</NAME><VALUE>false</VALUE></SETTING>
***************
*** 591,595 ****
<SETTING><VALUE></VALUE></SETTING>
<SETTING><VALUE></VALUE></SETTING>
! <SETTING><VALUE>s0¯</VALUE></SETTING>
<SETTING><VALUE></VALUE></SETTING>
</SETTING>
--- 600,604 ----
<SETTING><VALUE></VALUE></SETTING>
<SETTING><VALUE></VALUE></SETTING>
! <SETTING><VALUE> §1</VALUE></SETTING>
<SETTING><VALUE></VALUE></SETTING>
</SETTING>
***************
*** 626,630 ****
<!-- Settings for "PPC Linker" panel -->
<SETTING><NAME>MWLinker_PPC_linksym</NAME><VALUE>0</VALUE></SETTING>
! <SETTING><NAME>MWLinker_PPC_symfullpath</NAME><VALUE>0</VALUE></SETTING>
<SETTING><NAME>MWLinker_PPC_linkmap</NAME><VALUE>0</VALUE></SETTING>
<SETTING><NAME>MWLinker_PPC_nolinkwarnings</NAME><VALUE>0</VALUE></SETTING>
--- 635,639 ----
<!-- Settings for "PPC Linker" panel -->
<SETTING><NAME>MWLinker_PPC_linksym</NAME><VALUE>0</VALUE></SETTING>
! <SETTING><NAME>MWLinker_PPC_symfullpath</NAME><VALUE>1</VALUE></SETTING>
<SETTING><NAME>MWLinker_PPC_linkmap</NAME><VALUE>0</VALUE></SETTING>
<SETTING><NAME>MWLinker_PPC_nolinkwarnings</NAME><VALUE>0</VALUE></SETTING>
***************
*** 797,801 ****
<TARGETNAME>SqueakFFIPrims</TARGETNAME>
<PATHTYPE>Name</PATHTYPE>
! <PATH>MSL C.PPC.Lib</PATH>
<PATHFORMAT>MacOS</PATHFORMAT>
</FILEREF>
--- 806,810 ----
<TARGETNAME>SqueakFFIPrims</TARGETNAME>
<PATHTYPE>Name</PATHTYPE>
! <PATH>InterfaceLib</PATH>
<PATHFORMAT>MacOS</PATHFORMAT>
</FILEREF>
***************
*** 803,807 ****
<TARGETNAME>SqueakFFIPrims</TARGETNAME>
<PATHTYPE>Name</PATHTYPE>
! <PATH>MSL RuntimePPC.Lib</PATH>
<PATHFORMAT>MacOS</PATHFORMAT>
</FILEREF>
--- 812,816 ----
<TARGETNAME>SqueakFFIPrims</TARGETNAME>
<PATHTYPE>Name</PATHTYPE>
! <PATH>MathLib</PATH>
<PATHFORMAT>MacOS</PATHFORMAT>
</FILEREF>
***************
*** 809,813 ****
<TARGETNAME>SqueakFFIPrims</TARGETNAME>
<PATHTYPE>Name</PATHTYPE>
! <PATH>InterfaceLib</PATH>
<PATHFORMAT>MacOS</PATHFORMAT>
</FILEREF>
--- 818,822 ----
<TARGETNAME>SqueakFFIPrims</TARGETNAME>
<PATHTYPE>Name</PATHTYPE>
! <PATH>MSL C.PPC.Lib</PATH>
<PATHFORMAT>MacOS</PATHFORMAT>
</FILEREF>
***************
*** 815,819 ****
<TARGETNAME>SqueakFFIPrims</TARGETNAME>
<PATHTYPE>Name</PATHTYPE>
! <PATH>MathLib</PATH>
<PATHFORMAT>MacOS</PATHFORMAT>
</FILEREF>
--- 824,828 ----
<TARGETNAME>SqueakFFIPrims</TARGETNAME>
<PATHTYPE>Name</PATHTYPE>
! <PATH>MSL RuntimePPC.Lib</PATH>
<PATHFORMAT>MacOS</PATHFORMAT>
</FILEREF>
|
|
From: John M M. <jo...@us...> - 2002-11-14 20:07:27
|
Update of /cvsroot/squeak/squeak/platforms/Mac OS/vm/Developer In directory usw-pr-cvs1:/tmp/cvs-serv7455/squeak/platforms/Mac OS/vm/Developer Modified Files: SqueakVMForCarbon.pbproj.sit Log Message: 3.4.0b1 project builder project for 3.4.0b1 build Index: SqueakVMForCarbon.pbproj.sit =================================================================== RCS file: /cvsroot/squeak/squeak/platforms/Mac OS/vm/Developer/SqueakVMForCarbon.pbproj.sit,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 Binary files /tmp/cvsJEaxij and /tmp/cvsWLCrfs differ |
|
From: John M M. <jo...@us...> - 2002-11-14 20:07:01
|
Update of /cvsroot/squeak/squeak/platforms/Mac OS/vm In directory usw-pr-cvs1:/tmp/cvs-serv7147/squeak/platforms/Mac OS/vm Modified Files: sqMacUIEvents.c Log Message: 3.4.0b1 Change cmd key to control key for modifier on scroll wheel mouse arrow key modifer Index: sqMacUIEvents.c =================================================================== RCS file: /cvsroot/squeak/squeak/platforms/Mac OS/vm/sqMacUIEvents.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** sqMacUIEvents.c 6 Aug 2002 21:53:33 -0000 1.11 --- sqMacUIEvents.c 14 Nov 2002 20:06:51 -0000 1.12 *************** *** 1611,1615 **** evt->charCode = macKeyCode; evt->pressCode = EventKeyDown; ! evt->modifiers = modifierMap[(cmdKey >> 8)]; /* clean up reserved */ evt->reserved1 = 0; --- 1611,1615 ---- evt->charCode = macKeyCode; evt->pressCode = EventKeyDown; ! evt->modifiers = modifierMap[(controlKey >> 8)]; /* clean up reserved */ evt->reserved1 = 0; *************** *** 1652,1656 **** evt->charCode = macKeyCode; evt->pressCode = EventKeyUp; ! evt->modifiers = modifierMap[(cmdKey >> 8)]; /* clean up reserved */ evt->reserved1 = 0; --- 1652,1656 ---- evt->charCode = macKeyCode; evt->pressCode = EventKeyUp; ! evt->modifiers = modifierMap[(controlKey >> 8)]; /* clean up reserved */ evt->reserved1 = 0; |
|
From: John M M. <jo...@us...> - 2002-11-14 19:52:23
|
Update of /cvsroot/squeak/squeak/platforms/Mac OS/plugins/SqueakFFIPrims
In directory usw-pr-cvs1:/tmp/cvs-serv31708/squeak/platforms/Mac OS/plugins/SqueakFFIPrims
Modified Files:
sqMacFFI.s
Log Message:
3.4.0b1 (1.2.0b1) Found a bug with croquet crashing. the stack needs to be algined on a quad word, otherwise nasty things can happen. Also cleaned up assembler a bit.
Index: sqMacFFI.s
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/Mac OS/plugins/SqueakFFIPrims/sqMacFFI.s,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** sqMacFFI.s 1 Feb 2002 07:05:03 -0000 1.1
--- sqMacFFI.s 14 Nov 2002 19:52:20 -0000 1.2
***************
*** 12,16 ****
* 1/24/2002 JMM hacked from the original code for os-x, added save for CCR and
* tweaked _4_gpregs compare
! *
*****************************************************************************/
#import <architecture/ppc/asm_help.h>
--- 12,17 ----
* 1/24/2002 JMM hacked from the original code for os-x, added save for CCR and
* tweaked _4_gpregs compare
! *
! * 11/14/2002 JMM clean & fix quad word alignment issue
*****************************************************************************/
#import <architecture/ppc/asm_help.h>
***************
*** 18,27 ****
.text
.globl _ffiCallAddressOf
! _ffiCallAddressOf: /* Save link register */
! mflr r0
! mfcr r12
! stw r12,4(sp)
stw r0, 8(sp)
!
/* get stack index and preserve it for copying stuff later */
EXTERN_TO_REG(r4, _ffiStackIndex) // lwz r4, ffiStackIndex(r2)
--- 19,28 ----
.text
.globl _ffiCallAddressOf
! _ffiCallAddressOf:
! mflr r0 /* Save link register */
stw r0, 8(sp)
! mfcr r0 /* save CCR */
! stw r0,4(sp)
!
/* get stack index and preserve it for copying stuff later */
EXTERN_TO_REG(r4, _ffiStackIndex) // lwz r4, ffiStackIndex(r2)
***************
*** 29,37 ****
/* compute frame size */
rlwinm r5, r4, 2, 0, 29 /* ffiStackIndex words to bytes (e.g., "slwi r5, r4, 2") */
! addi r5, r5, 24 /* linkage area */
! neg r5, r5 /* stack goes down */
!
! /* adjust stack frame */
! stwux sp, sp, r5
/* load the stack frame area */
--- 30,37 ----
/* compute frame size */
rlwinm r5, r4, 2, 0, 29 /* ffiStackIndex words to bytes (e.g., "slwi r5, r4, 2") */
! addi r5, r5, 24+15 /* linkage area */
! rlwinm r5,r5,0,0,27 /* JMM round up to quad word*/
! neg r5, r5 /* stack goes down */
! stwux sp, sp, r5 /* adjust stack frame */
/* load the stack frame area */
***************
*** 57,61 ****
EXTERN_TO_REG(r12, _FPRegsLocation) // lwz r12, FPRegs(r2)
cmpwi r3, 0 /* skip all fpregs if no FP values used */
! blt _0_fpregs
cmpwi r3, 8
blt _7_fpregs /* skip last N fpregs if unused */
--- 57,61 ----
EXTERN_TO_REG(r12, _FPRegsLocation) // lwz r12, FPRegs(r2)
cmpwi r3, 0 /* skip all fpregs if no FP values used */
! beq _0_fpregs /* was lt should be eq */
cmpwi r3, 8
blt _7_fpregs /* skip last N fpregs if unused */
***************
*** 80,84 ****
EXTERN_TO_REG(r3, _gpRegCount) //lwz r3, gpRegCount
EXTERN_TO_REG(r12, _GPRegsLocation) // lwz r12, GPRegs(r2)
! cmpwi r3, 5 /* was 4 in original code but that seems to be a bug? */
blt _4_gpregs /* skip last four gpregs if unused */
_all_gpregs:
--- 80,84 ----
EXTERN_TO_REG(r3, _gpRegCount) //lwz r3, gpRegCount
EXTERN_TO_REG(r12, _GPRegsLocation) // lwz r12, GPRegs(r2)
! cmpwi r3, 5 /* 5 was 4 in original code but that seems to be a bug? */
blt _4_gpregs /* skip last four gpregs if unused */
_all_gpregs:
***************
*** 95,113 ****
/* go calling out */
- //mr r12, r0 /* tvector into GPR12 */
- /* Note: The code below is nearly identical to to what's described in
- "MacOS Runtime Architectures"
- Chapter 2, Listing 2-2, pp. 2-11 */
- //lwz r0, 0(r12) /* get entry point */
//Note: OS-X mach-o does not use TVectors rather the addr is the entry point
! lwz r0, 20(sp) /* fetch addr */
! stw r2, 20(sp) /* save GPR2 */
! mtctr r0 /* move entry point into count register */
! //lwz r2, 4(r12) /* new base pointer */
bctrl /* jump through count register and link */
! lwz r2, 20(sp) /* restore GPR2 */
lwz sp, 0(sp) /* restore frame */
/* store the result of the call */
REG_TO_EXTERN(r3,_intReturnValue) // stw r3, intReturnValue(r2)
EXTERN_TO_REG(r12, _longReturnValueLocation) //lwz r12, longReturnValue(r2)
--- 95,108 ----
/* go calling out */
//Note: OS-X mach-o does not use TVectors rather the addr is the entry point
! lwz r12, 20(sp) /* fetch addr */
! mtctr r12 /* move entry point into count register */
bctrl /* jump through count register and link */
!
lwz sp, 0(sp) /* restore frame */
/* store the result of the call */
+ /* more intelligent logic would have a check for type versus assuming all */
+
REG_TO_EXTERN(r3,_intReturnValue) // stw r3, intReturnValue(r2)
EXTERN_TO_REG(r12, _longReturnValueLocation) //lwz r12, longReturnValue(r2)
***************
*** 118,124 ****
/* and get out of here */
! lwz r0, 8(sp)
! lwz r12, 4(sp)
! mtlr r0
! mtcrf 0xff,r12
blr
--- 113,119 ----
/* and get out of here */
! lwz r0, 4(sp) /*restore CCR */
! mtcrf 0xff,r0
! lwz r0, 8(sp) /* restore ltr */
! mtlr r0
blr
|
|
From: John M M. <jo...@us...> - 2002-11-14 19:50:33
|
Update of /cvsroot/squeak/squeak/platforms/Mac OS/vm/Developer In directory usw-pr-cvs1:/tmp/cvs-serv30742/squeak/platforms/Mac OS/vm/Developer Modified Files: resources.sit Log Message: 3.4.0b1 rev all the version numbers Index: resources.sit =================================================================== RCS file: /cvsroot/squeak/squeak/platforms/Mac OS/vm/Developer/resources.sit,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsnaJStu and /tmp/cvsQaoOBO differ |
|
From: John M M. <jo...@us...> - 2002-11-14 19:50:10
|
Update of /cvsroot/squeak/squeak/platforms/Mac OS/vm/Documentation
In directory usw-pr-cvs1:/tmp/cvs-serv30557/squeak/platforms/Mac OS/vm/Documentation
Modified Files:
readme
Log Message:
3.4.0b1 changes noted for building 3.4.0b1
Index: readme
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/Mac OS/vm/Documentation/readme,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** readme 8 Aug 2002 01:27:46 -0000 1.3
--- readme 14 Nov 2002 19:50:07 -0000 1.4
***************
*** 1,3 ****
! Updated August 6th 2002
Building the Squeak Virtual Machine (Aug 6th, 2002)
--- 1,3 ----
! Updated Nov 14th 2002
Building the Squeak Virtual Machine (Aug 6th, 2002)
***************
*** 8,11 ****
--- 8,12 ----
-- Changes Jay Hardesty, July 6, 2002
-- Changes John Mcintosh & Andrew C. Greenberg. Aug 6 & 7th, 2002
+ -- Changes John McIntosh Nov 14th, 2002 (some cleanup and modernization
(Note to readers, it is possible a step was missed, so beware)
***************
*** 13,17 ****
Building a Carbon Squeak VM with ProjectBuilder:
! {JMM notes this is building with 10.1.5, and Squeak 3.2gamma5)}
Overview
--- 14,18 ----
Building a Carbon Squeak VM with ProjectBuilder:
! {JMM notes this is building with 10.2.2, and Squeak 3.4alpha (for croquet)}
Overview
***************
*** 33,37 ****
(Note building with GCC 3.x will produce a slower VM than with GCC 2.9x (Sad but true), you can pick which compiler
to use, see the April 2002 or higher developer tools CD documentation)
!
Step One (b):
A. Get the OpenGL sdk if you need to build with codeWarrior under system 9.x
--- 34,42 ----
(Note building with GCC 3.x will produce a slower VM than with GCC 2.9x (Sad but true), you can pick which compiler
to use, see the April 2002 or higher developer tools CD documentation)
!
! You might need to use the "sudo /usr/sbin/gcc_select 2" command to pick the GCC 2.x compiler, although project builder seems to give you a choice (2.x, 3.x) it lies...
! do a "gcc --version" to confirm what you think you are using is what you are using.
!
!
Step One (b):
A. Get the OpenGL sdk if you need to build with codeWarrior under system 9.x
***************
*** 60,67 ****
performance by 10%.
- Interpreter-normalSend.1.cs (THIS IS ALREADY IN 3.2GAMMA5 SO YOU CAN SKIP IT)
MoreInterpAccessors-JMM.2.cs
! CheckInterruptOften-JMM.1.cs (THIS IS ALREADY IN 3.2GAMMA5 SO YOU CAN SKIP IT)
! Globalstructure-JMM.2.cs
CGeneratorEnhancements-ajh.1.cs
Gnuifier.3.cs
--- 65,70 ----
performance by 10%.
MoreInterpAccessors-JMM.2.cs
! Globalstructure-JMM.3.cs
CGeneratorEnhancements-ajh.1.cs
Gnuifier.3.cs
|
|
From: John M M. <jo...@us...> - 2002-11-14 19:49:32
|
Update of /cvsroot/squeak/squeak/platforms/Mac OS/vm/Documentation
In directory usw-pr-cvs1:/tmp/cvs-serv30213/squeak/platforms/Mac OS/vm/Documentation
Added Files:
3.4.0 Release Notes.rtf
Log Message:
3.4.0b1 Notes for 3.4.0b1
--- NEW FILE: 3.4.0 Release Notes.rtf ---
{\rtf1\mac\ansicpg10000\cocoartf102
{\fonttbl\f0\fnil\fcharset77 Geneva;\f1\fnil\fcharset77 LucidaGrande;\f2\fswiss\fcharset77 Helvetica;
}
{\colortbl;\red255\green255\blue255;}
\margl1440\margr1440\vieww17300\viewh12720\viewkind0
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
\f0\fs24 \cf0 Mac VM 3.4.0 mach-o build for Carbon, and build for Classic. Support for Croquet\
Nov 14th, 2002 (3.4.0b1)\
Still yet to do, in future versions.\
Verify that file delete rename etc works on aliases, not the targets.\
You will need mach-o os-x bundle plugins to work with this VM. example ->
\f1 mpeg3Plugin.bundle.\
Old carbon non-bundled plugins will not work, but keep reading to understand where classic \
plugins still are needed.\
\f0 \
Pre OS-X users should read about OS-9 packages in the 3.2.4 change notes.\
Notes About previous VM.\
3.2.6 VM classic have an issue when the tickcount clock goes over 0x7FFFFFFF, about 24 days. \
This exhibits it self as Squeak won't accept user input, or allow you to switch under os 9 or earlier.\
Starting a Squeak image hangs durning the screen painting.\
Restarting the mac solved these problems. Force quit does not.\
This is fixed in 3.2.7b3\
Some issues with alias files and folder were fixed in 3.2.7b6 and 3.2.8b3\
\
3.4.0b1 (Croquet support)\
a) Added plugin BMPReadWriterPlugin 14 November 2002 (i)\
b) B3DAcceleratorPlugin.c gets primitiveCreateRendererFlags (new api)\
c) two more op codes get added to BitBltPlugin (fixAlphawith, pixClearwith)\
d) Squeak3D gets (b3dOrthoNormInverseMatrix, b3dTransformDirection,b3dTransformPoint,b3dTransposeMatrix)\
e) The scroll wheel mouse logic was using apple cmd key as the modifier on the arrow key events, Other platforms use the Control key. So the \
mac falls in line (changed to use the control-key)\
\
3.2.8b9\
a) recompiled os-x version, 3.2.8b8 seem to have a bad compiler option and gave 20% less performance.\
\
3.2.8b8\
a) exposed
\f2 vmParameter
\f0 24 & 25 which control how memory is allocated/freed \
\f2 Smalltalk vmParameterAt: 24 put: 48*1024*1024.\
Smalltalk vmParameterAt: 25 put: 24*1024*1024.\
\f0 b) Added argv,argc, env variables to main\
c) Fixed for Jaguar 10.2. Full screen mode cmd-tab broke menu bar hiding, this is a 10.2 bug\
d) Added support for IP_ADD/DROPMEMBERSHIP and the ability to bind to the wild card port (0).\
e) OpenGL changes for TEA\
\
3.2.8b7 was testing release and not distributed to the public.\
3.2.8b6 was testing release and not distributed to the public.\
3.2.8b5\
a) Oops broke the logic returning the vmversion information in classic. Also incremented os-x version (which was fine) to keep numbers in sync\
\
3.2.8b3 The squeak.sourceforge.net CVS tree was reorganized and the project builder project revamped. The \
major change to the source was upgrading the netscape browser plugin to 3.2.7b6 levels.\
\
a) Gnunifer.3.cs Changed to add register var on FOO_REG and to remove sqGnu.h file embedded in method.\
b) sqMacDirectory.c Add logic to handle case of building as CFM carbon plugin under CW6, needed some carbon calls\
c) osExports.c needed to ifdef out the getUIToLock entry point (not available as CFM carbon browser plugin)\
d) sqMacFileLogic.c Fix alias problem. Add logic to deal with path names as CFM carbon browser plugin, ensure vmPath is correct.\
e) sqMacImageIO.c Cast to get rid of warning message\
f) sqMacMain.c Cast to get rid of warning message, Check for CFM Carbon and bundle check. Revise vm parm 1201 code to return long file names are ok as CFM carbon browser plugin. Some diagnostic routines for printing to the console as CFM carbon browser plugin.\
g) sqMacMemory.c Logic change as CFM carbon browser plugin.\
h) sqNSPlugin.c Fix to beginFullScreen logic (carbon call is broken?)\
i) sqMacUIEvents.c Remove getUIToLock dummy call. This entry point should only exist for mach-o carbon builds. Not CFM carbon browser plugins\
j) sqMacWindow.c Use old call to create window when a CW 5 carbon application.\
k) sqPlatformSpecific.h Change #ifdef to correct logic error when building as CFM carbon browser plugin under CW 5.\
\
\
\
May 31st, 2002 (3.2.7b6)\
For 3.2.7\
\
3.2.7b3 We build the VM using patchs to enable globals as a structure. This improves performance by 10%\
\
a) Classic Vm builders might need to add "struct foo *foo = &fum; " to int interpret(void). \
b) readme: add notes about changesets and alter build instructions\
c) sqMacFileLogic.c: use accessors for interp.c globals\
d) sqMacMain.c: use accessors for interp.c globals. Also Alain Fischer added logic to fetch os-x version number and to enable you to put squeak.image in the resource folder for autostarting.\
e) sqMacTime.h: Fix busted lowresclock again. After 24 days of mac uptime, 3.2.6 squeak will hang.\
f) sqMacUIEvents.h: use accessors for interp.c globals.\
g) sqPlatformSpecific.h: alter sqFTruncate to use fileno() as needed.\
h) sqMacWindow.c: use accessors for interp.c globals.\
i) 3.2.7b5 sqMacFileLogic.c: change vmpath to resolve to classic VM if vm is moved from MacOSClassic folder\
j) Misc changes for Netscape plugin support\
k) Introduce osExports.c logic\
l) 3.2.7b6 Fixed a problem in path name resolving need to use UTF8 to properly interact with high ascii characters\
m) 3.2.7b6 Fixed a problem in path name resolving there was a bug with certain types of alias path name combinations in quick name resolving.\
\
Mac VM 3.2.6 mach-o build for Carbon, and build for Classic.\
March 14th, 2002\
Still yet to do, in future versions.\
Verify that file delete rename etc works on aliases, not the targets.\
\
You will need mach-o os-x bundle plugins to work with this VM. example ->
\f1 mpeg3Plugin.bundle.\
Old carbon non-bundled plugins will not work, but keep reading to understand where classic \
plugins still are needed.\
\f0 \
Pre OS-X users should read about OS-9 packages in the 3.2.4 change notes.\
Notes About previous VM.\
3.2.6b6 Classic or earlier has a bug that makes it stop collecting user input on a 19.88 hour cycle depending on reboot time.\
Seems many systems don't run for more than 19 hours so we've not had major complains about this issue. \
Bug was introduced in 3.2.1.\
3.2.5 has a bug that prevents the use of accented characters without \
a image patch to fix a VM issue (not an issue in 3.2.4). Also you can't enter an double keystroke characters, ie ^ \
which makes life difficult. It also does not support the AppleScript Plugin (not an issue in 3.2.4)\
3.2.4 a bug in project builder introduced a performance problem (bad compiler options).\
\
See the 3.2.5 about why this 3.2.6 is different inside.\
\
For 3.2.6:\
a) Change an internal number that dictates how often pending interrupts should be looked at from 5ms to 3ms This improves \
delay accuracy.\
b) Change how sleeping is done when squeak is idle. This reduces CPU consumption, and improves Delay accuracy.\
c) Fix bug with high bit problem with keyboard (accented characters are ok now)\
c2) 3.2.6b6 has fixed characters that require multiple key strokes to enter.\
d) Externals that make UI interactions (IE AppleScript) Must now make a call back to the VM to schedule\
the main thread to do the call that will invoke UI interaction to prevent a deadlock in Carbon between threads. \
See the OSAExecute call in the AppleScript plugin for details.\
e) If you run a classic mac VM more than 23.x days nonstop it will stop responding to UI events. Ensure clocks get anded with 536870911.\
f) signal inputSemaphoreIndex because we are mulithreaded. Not that it does anything for us yet...\
g) 3.2.6b6 Pass the unicode value of the keystroke up as the EventKeyDown/EventKeyUp data, versus mackeyboard code.\
h) Somewhere there is a bug with mktime + time, so use the unix code of time+localtime+gmt \
i) Change iorelinquishPrcessorForMicroseconds to sleep the quatum between now and wakeup time. Also schedule a\
check for interrupts if wakeup time is now or in the past. This improves delay accuracy. For OS-x this was a big deal,\
for os-9 it improves things by 1 or 2ms. Also in os-x we sleep more when idle so CPU usage goes down.\
j) On OS-9 umap AND free the VM backing store. Just doing the free doesn't work and you lose 128Mb of disk space until you reboot\
k) 3.2.6b7 for post event processing ignore mouse move/drag/or scroll wheel events. These are ignored by the open/gl plugin and only suck a major amount of CPU time to process in the post event processing logic. \
l) 3.2.6b8 (3.2.6b4 classic) removed call to uncouple shift keys introduced in 3.2.1. This causes some macs after sleeping not to respond to keyboard input\
m) 3.2.6b8 (3.2.5b7 classic) added function for ioLowResMSecs to avoid early bit overflow. Rework clock checking in ioHandleEvents to handle clock rollovers properly.\
\
Mac VM 3.2.5 mach-o build for Carbon, and build for Classic.\
March 4th, 2002\
Still yet to do, in future versions.\
Verify that file delete rename etc works on aliases, not the targets.\
\
You will need mach-o os-x bundle plugins to work with this VM. example ->
\f1 mpeg3Plugin.bundle.\
Old carbon non-bundled plugins will not work, but keep reading to understand where classic \
plugins still are needed.\
\f0 \
Pre OS-X users should read about OS-9 packages in the 3.2.4 change notes.\
\
Beware this version of the VM is significantly different inside! \
\
\pard\tx1440\tx2880\tx4320\tx5760\tx7200\ql\qnatural
\f2 \cf0 a) Broke sqMacWindow.c into 10 different files by function type.\
\
b) Moved most of the memory allocation logic out of sqMacMain.c into sqMacMemory.c. and ensure memory is freed when Squeak is terminated. \
The major change in this code is support for OS 9.x virtual memory mapping. This only applies to Mac OS 9.2.0 or higher, excluding os-x. It appears Mac OS 9.1 has a bug that prevents this feature from working.\
\
For images that require less than 128MB of memory, mapping is used to allow the image to grow/shrink to the 128MB boundary, therefore you can change the application memory size to about 2MB. \
\
For images that require more than 128MB then change the application memory size to > 128MB and mapping will not occur. \
\
If mapping is not available because virtual memory is turned off or the api is not supported by the macintosh OS then mapping is not used. Note that mapping is not support under the classic os-9.x environment under OS-X, however in this case you should be using the OS-X version of Squeak, not the classic version.\
\
c) Use of Carbon event logic for OS-X only. This is a major structural change. \
\
It also encouraged the use of a pthread for interp.c. \
\
All user interaction with the VM follows a new code path, so problems with keyboard or mouse input should be reported asap. Also any issues with application switching, windows being brought to the foreground or sent to the background and usage of the full screen logic should be reported asap.\
\
As part of this change I have build in support for scroll-wheeled multi-button mice under os-x. Thanks to Doug Way for testing this for me. Maybe someone can post to the list what their favorite 3 button scroll wheeled mouse/trackball is.\
\
d) Use of a carbon call to get the dominate Device if you have multiple screens. People with multiple screens should confirm window resizing, full screen on/off works as expected.\
\
e) Corrected comment in sqMacFileLogic.c\
\
f) Changes to sqMacNSPlugin.c. This makes it compile, but it's not usable yet.\
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
\f0 \cf0 \
\
Feb 20th 2002 3.2.4\
\
For this version of the VM I have migrated towards using OS-9 packages. This allows us to provide one \
folder/package that supports os-x and previous operating system versions.\
\
Given Squeak 3.2.4Beta1.app\
The classic VM is found in the *.app:Contents:MacOSClassic, with an alias in *.app:\
The mach-o OS-X VM is found in *.app.Contents:MacOS\
\
If you are running OS-9 then clicking on the *.app or doing drag and drop will just run Squeak, same applies for OS-X.\
If you are running OS-7.5.5 or OS-8.x then the *.app package will appear as a folder, just open and click on the alias within. \
Note that if you want to use classic plugins I suspect you need to put them in the MacOSClassic Folder beside the VM. \
Bundles for os-x go in the same location as the *.app application package.\
\
Changes\
a) Drag and drop at open time with image file that has no meta type, will now open the image, versus prompting you.\
b) Use an os-x window attribute at open time to signal that the window should not be moved by the dock when you go to full screen.\
c) Fix window update logic to use window that needs updating versus stwindowg to fix issues with print dialog windows in classic. \
d) bitblt gets recompile to pickup fixes posted in 3.2 update stream.\
\
Feb 5th 2002 3.2.3\
Changes\
\
a) use old extended time manger to update psudeo-TickCount, versus sigalrm. siglarm make sound recording not work.\
b) fiddle with sound recording and make it work.\
\
Jan 2002 3.2.2\
Changes:\
\
a) AsyncFilePlugin.c Use global to remember security function entry point for performance reasons\
b) FilePlugin.c Use global to remember security function entry point for performance reasons\
c) interp.c Use squeakFileOffsetType versus off_t and add a bunch of checks to handle lack of long long and conversion errors between 64/32 bit integers and LargeInteger objects\
d) readme, it's http://www.mucow.com/Gnuifier.1.cs \
e) SocketPlugin.c Use global to remember security function entry point for performance reasons\
f) sq.h added default sqFilenameFromStringOpen and sqTruncate\
g) sqFilePluginBasicPrims.c revert to anti specs, but ensure #def to fseeko and ftello for 64 bit aware file systems.\
h) sqMacDirectory.c A bit more error checking on bad file names\
i) sqMacFileLogic.c Folders size is now zero in classic, and a bit more checking on bad file names\
j) sqMacSound.c Fixed a problem with sound recording in classic due to a change made in Sept. But sound recording still does not work under os-x\
k) sqMacWindow.c two very important changes:\
\
1) You can now do FFI calls with the FFI bundle plugin to Mach-o frameworks. \
However you need to rework your api calls. For example:\
apiGetMousePoint: aMacPoint was\
<apicall: void 'GetMouse' (MacPoint*) module:'InterfaceLib'>\
It now is:\
<apicall: void 'GetMouse' (MacPoint*) module:'Carbon.framework'>\
\
If you review /System/Library/Frameworks I'm sure you can come up with interesting ways to \
make mac only squeak images.\
\
I now use map( NULL, gMaxHeapSize, PROT_READ | PROT_WRITE, MAP_ANON | MAP_SHARED,-1,0);\
anonymous memory mapping to 512MB as the squeak memory block. The VM can then grow or shrink\
within the 512MB block, I just move a pointer. \
\
Note in 3.2.1 a slight error on my part restricted Squeak to 50MB. I am of course\
interested to hear about issues with my choice of 512MB. Note a Squeak VM is limited to 2GB under perfect \
conditions, however if any part of the image crosses the 2GB boundary the VM will fail, right now 512MB\
seemed a safe choice.\
\
PhysMem: 60.2M wired, 78.6M active, 412M inactive, 551M used, 217M free\
VM: 3.03G + 55.3M 7847(0) pageins, 1(0) pageouts \
PID COMMAND %CPU TIME #TH #PRTS #DREGS RPRVT RSHRD RSIZE VSIZE\
422 Squeak VM 0.8% 0:35.59 2 71 100 23.3M 8.53M 26.5M 571M\
\
but I only have one 80,000,000 byte swap file in /var/vm\
\
Note if you turn crash reporter on, then if the VM crashes a nice report should be generated in your log directory. See the Apple documentation for a description of this feature, currently it is set in OS-X 10.1.x via the preferences window for the Console Application. If you have a crash with this VM, please recreate and post the crash log (found in Users/foobar/Library/Logs/ to the Squeak mailing list so we can continue to make the VM fault tolerant.\
\
3.2.1 Notes\
\
You might need these change sets to build a new VM or to use all the features of this VM with your image, hopefully these will get into the pending 3.2.x image.\
\
Fixes and feature extensions.\
AsyncFileFixFu...hName-JMM.1.cs fix for async test method.\
DragAndDropAtStart-JMM.5.cs fix to enable drag and drop at startup\
\
Needed to compile a VM with VMMaker\
LargeFiles-JMM.3.cs Enable large file support, files > 2GB\
\
Needed to turn this feature on\
MacLongFileName-JMM.5.cs Enable long file names on the mac\
\
The SUnit\
MacLongFileNamesSUnits-JMM.3.cs Test long file names and long directory names and large file support\
\
Kinda optional features some people might need.\
InternetConfiguration-JMM.5.cs Allow internet configuration information access, internal plugin\
UUID-JMM.3.cs Allow UUID generation, internal plugin\
\
a) The ability to get back a UUID. This uses the hosting UUID generator if the\
hosting OS supports it and we have a primitive we can call. If not then we generate\
a type 4 version of a UUID (the random bits one).\
(This requires a special change set)\
\
b) Ability to start squeak on the mac by dragging multiple documents onto the\
image, or drag and drop of stuff onto the running VM icon.\
(This requires a special change set)\
\
c) Usage of the Internet Configuration tool kit to supply information about\
what the mac proxy is etc. etc.\
(This requires a special change set)\
\
d) Migrate file system to use 64 bits. This allows you to read/write and seek\
with files > 2 GB. This includes a change to the VM to convert from/to long\
long integers. It also allows the file system to actually deal with 2GB files,\
the current file interface actually fails once the file exceeds 1GB.\
\
e) For the carbon based Squeak VM we now support long file names 255\
characters. Close both eyes and touch everywhere the mac VM deals with file\
name paths and hope for the best (Actually we write an Sunit to ensure we've\
not broken everything). This also includes the ability to put an image in a\
long file name directory, but right now the image name must stay under 32 characters.\
\
FilePlugin.c changes to support large integers.\
FilePlugin.h changes\
sq.h changes to support large files.\
sqConfig.h changes to resolve some conflicts.\
sqFilePluginBasicPrims.c changes to support large files.\
sqMacAsyncFilePrims.c changes to use fspec versus 255 file path.\
sqMacDirectory.c changes to use hosting OS (OS-X) bsd create and delete directory\
and truncate. dir_look changes as part of the general rewrite.\
sqMacDragAndDrop.c use new call to get path name from fsspec. Use fsspec more, and added \
interface code to setup drag and drop of items at application startup time. max document name\
goes to 1000 characters.\
sqMacFileLogic.c Mostly rewrote!\
sqMacSecurity.c use new file calls.\
sqMacWindow.c \
increase size of vmpath, docpath, imagepath to 1000 chars, shortname to 255 characters.\
add logic for left/right modifier keys \
reworked LoadLibViaPath logic \
sqImageFileOpen uses fsspec versus 255 path name.\
sqImageFileStartLocation uses ffspec.\
bundle support for bundles\
\
e2) interp.c supports get/put of large integers to long long integers.\
e3) fixed fTruncate\
\
Hint getting this to work was a pain. Think of 255 character folder names and nested aliases,\
folder 1 refers to folder 2 which then refers to folder 1 again, just go down the path say 8 times,\
then ask to create a file or directory!\
\
f) Support to change the Mac screen resolution under Squeak control.\
\
g) Fix to unload/load the scrap at startup time to ensure the clipboard is\
correct when starting up the VM.\
\
h) Uncouple the shift key and left/right shift keys on old extended keyboard.\
Also add a call to get which keys are currently pressed on a USB keyboard or\
the USB codes for an apple non-usb keyboard. (Note this isn't working quite yet under OS-X)\
\
i) Changes to enable us to compile the VM under Apple's OS-X Project Builder\
environments.\
\
j) Some rewriting to ensure serial and midi support can be written as external\
plugins.\
\
k) Fiddling to get sound input to work under OS-X\
\
l) Platform.exports changed macintosh to macintoshSqueak to avoid conflict.\
\
m) Memory is allocated at 50MB at start, then will grow or shrink, verus previous carbon apps\
that did 1GB. \
\
n) sqPlatformSpecific.h changes to support long file names and os-x posix file names\
\
o) sqVirtualmachine.c & sqVirtualmachine.h\
#if VM_PROXY_MINOR > 4\
VM->positive64BitIntegerFor = positive64BitIntegerFor;\
VM->positive64BitValueOf = positive64BitValueOf;\
VM->signed64BitIntegerFor = signed64BitIntegerFor;\
VM->signed64BitValueOf = signed64BitValueOf;\
#endif\
\
Beware this causes an interesting problem, if you compile plugins with VM_PROXY_MINOR now set to 5, then they will not work with older VMs. The solution is to define the VM_PROXY_MINOR in the plugin to the value that indicates what features it is using.\
\
p) Changed to use ITimer logic as a 16ms lowres timer to improve performance\
\
q) Changed to use single thread, no thread manager.\
\
r) Changed to use lowres timer in checking for polling time to improve performance\
\
s) It should have faster startup times.\
\
t) It will hide the empty window at startup, then show the squeak window when required.\
\
u) It has a different menu structure.\
\
v) It does less I/O when navigating directories.\
\
The macintosh 3.1Alpha1MT VM, Sept 24th 2001 \
This VM was built with the base 3.1 image at change set #4347\
V3.1.1 at change set #4347\
\
\
We go to V3.1.1 to indicate that the 3.1 VM is being used. In the past the 3.1 Image was used but some changes in the openGL logic makes 3.1 Vm and 3.0 image not quite work correctly with 3d graphics. Although a 3.1 VM will run many images way back to the 2x series no careful study has been done on the ability to do this. So at this point we are indicating this VM is a 3.1 VM and best used with a 3.1 image.\
\
Use of VMMaker to build VM. As of this version everything can be built as an external except for the window logic which hasn't been decoupled from the VM support for the macintosh. \
\
1) AsynchFilePlugin the security check for ability to create file is now a plugin call.\
2) B2DPlugin logic changes to fillLinearGradientfromtoat\
3) b3dRemapFaces, b3dRemapEdges, b3dRemapEdgeList, b3dRemapAET, b3dRemapEdgeVertices, b3dRemapFaceVertices, b3dRemapFaceFree, b3dRemapEdgeFree, b3dRemapAttributes. Some casting and changing of += to = + to make some compilers happy.\
4) BitBltPlugin added tableLookupat call.\
5) DropPlugin added setFileAccessCallback to allow the Security Module plugin the ability to give us the entry point to turn security off so we can open files as read only when security is turned on. This was broken in the past. \
6) FilePlugin added fileOpennamesizewrite,getThisSession to allow for callbacks. Changed the file security logic to use the plugin interface. \
7) interp.c, fixes for 4347ByteArrayRangeCheck-di, ability to printAllStacks, security calls for image rename, write to use plugin interface.\
8) Added GetAttributeString, and recordDragDropEvent and entry points for callbacks.\
9) SecurityPlugin changed when initialization is called to initialize the safe and unsafe directorys, also added entry points for all the testing calls so it can be a true plugin.\
10) Serialplugin. The serial plugin was redesigned to seperate out MIDI logic. People with MIDI devices and old serial macintosh should check to see if they still work since we lack equipment now to test this obsolete technology set.\
11) SocketPlugin. Make security calls true plugin calls.\
12 SoundGenerationPlugin. Removed \
EXPORT(int) SoundGenerationPlugin_primitiveFMSoundMix(void);\
EXPORT(int) SoundGenerationPlugin_primitiveOldSampledSoundMix(void);\
EXPORT(int) SoundGenerationPlugin_primitivePluckedSoundMix(void);\
EXPORT(int) SoundGenerationPlugin_primitiveSampledSoundMix(void);\
EXPORT(int) SoundGenerationPlugin_primitiveWaveTableSoundMix(void);\
They were a hack at the plugin level and discussion on the list seemed to show they were no longer used. \
13) Checking for if defined (__APPLE__) && defined(__MACH__) for the Mac OS-X native development environment\
14) Changed sqMacAsyncFilePrims, usage of interpreterProxy->, plugin calls for getThisSession. \
15) Changed sqMacDirectory.c. Removed some utility code and make it a seperate file so that it can be shared between sqMacWindow and other plugins that require them. \
16) Changed sqMacDragDrop.c. Added plugin callback for getSTWindow, the sqSetFileAccessCallback logic, fileOpennamesizewrite, and secHasFileAccess. Added logic to do the recordDragDropEvent callback to sqMacWindow.c \
17) sqMacNetwork.c. Some cleanup for the OS-X version of the OpenTransport headers, some constants have name changes\
18) sqMacNSPlugin.c Use of ioLoadFunctionFrom(NULL, "DropPlugin"); versus explicit call.\
19) sqMacOpenGL.c. Some cleanup for the OS-X version of the OpenGL headers\
20) sqMacOpenGLInfo.c. Some cleanup for the OS-X version of the OpenGL headers\
21) sqMacSecurity.c ioInitSecurity calls back to dragAndDrop plugin to set entry point to turn security off. Added code to create directories if required and ensured callbacks are plugitized.\
22) sqMacSound.c Some cleanup for the OS-X version of the Sound headers. Use of interpreterProxy-> in the proper places.\
23) sqMacWindow.c Some cleanup for the OS-X version of the compiler. Fixed saveAsEmbeddedImage, this got broken when we moved from a FAT to a ppc only application. Altered interface to recordDragDropEvent so that it was plugable. Some file path name logic goes to a seperate C source file. The drag and drop plugin is loaded and intialized after the image is loaded but before the interpreter is started, before it was done a bit earlier in the startup process. This also has the effect of initializing the security module.\
24)sqOpenGLRenderer.c. Some cleanup for the OS-X version of the OpenGL headers\
25)SurfacePlugin.c gets a hack so it knows when it is internal versus external.\
\
\
\
v3.0.18 at change set #4081\
(Note browser plugin goes to 3.0.23\
\
1) sqMacOpenGL.c Quite a few changes were made to the code to support it as an internal plugin for the browser. This is because the drawable frame for a browser plugin is a subset of the browser's grafport, so lots more care must be taken to draw in the correct location using OpenGL. We also fixed issues with re-configurating the Open/GL draw area when the window gets resized or goes to full screen, and attempted to ensure multiple screens will work.\
\
2) sqMacWindow.c, minor fix to cast a constant char * to char * for CW 6.1\
\
\
Browser plugin 3.0.23 fixes\
\
1) Integerated the H/W Acceleration as an builtin plugin\
2) Added logic for pre and post event interaction to browser plugin event handler for H/W Acceleration logic. The external H/W Acceleration plugin mostly works with the browser plugin but doesn't work with full screen mode, or if the plugin is embedded in a window or a scrollable frame, so don't use it. Use the browser plugin 3.0.23 or higher which has the H/W Acceleration builtin.\
\
v3.0.17 at change set #4081\
(Note browser plugin goes to 3.0.21)\
\
1) Added HW acceleration as internal plugin.\
2) 4079BBAlphaTextFix-ar Fixes the problem with alpha text, changes BitBltPlugin.c \
3) Added primitive on the mac to truncate a file.\
4) Added logic to flush volume on a flush file to ensure file and control blocks are flushed.\
5) For the Carbon VM we increase nextevent wait time if we get sufficent idle time. This should reduce CPU usage under OS-X\
6) GetAttribute: 1002 now returns the gestaltSystemVersion as a hex string, and getAttribute: 1003 now returns either '68K' or 'PowerPC'.\
7) Starting with 3.0.17 the VM is build only as a powerpc application. The latest VM as a 68K application will be made available from time to time permits based on people's needs. \
8) Changes to sqOpenGLRenderer.c to improve performance, OpenGL 1.1 support.\
\
Plugin 3.0.21 fixes\
\
1) added check for mailto: tag on posts to fix problem with Netscape crashing, and IE hanging.\
2) Plus above fixes.\
\
What has been fixed/changed.\
v3.0.16 at change set #4041\
(Note browser plugin goes to 3.0.20)\
\
1) Lots of fixes for BitBlt and HW acceleration.\
2) Hardware Acceleration plugin goes to 1.0.1. Please note there is a seperate plugin with the same name for Carbon. Doing a get info will identify if the plugin is only usable with Carbon Squeak.\
\
v3.0.15 at change set #4026 (May 17th test version)\
(Note browser plugin goes to 3.0.19)\
\
1) Added support for OpenGL HW acceleration plugin\
\
Plugin 3.0.19 fixes\
\
a) Obey embedded tag plug\
b) Fix problem with plugin 3.0.17 not working with netscape 4.x\
c) Carbonize plugin for IE 5.1 \
d) Remove debugging printf than occurred on transition to full screen mode\
\
What has been fixed/changed.\
v3.0.14 at change set #3987\
\
(Note plugin goes to 3.0.17)\
\
1) sqMacDirectory.c. The pathlookup would handle the case of foo:bar::do incorrectly by ignoring the :: path redirection. This has been fixed. However a path lookup will not work if it contains :: and an aliased directory in the middle of the path.\
\
2) sqMacSecurity.c. The pathname for the untrustedUserDirectory was built incorrectly, and the bug mentioned above in sqMacDirectory.c usually kept this from being noticed.\
\
3) sqMacWindow.c we added some logic to do the delay for primitiveRelinquishProcessor, but found it had an large effect on a freecell benchmark. I suspect on a Morpic step wait there is nothing to do so primitiveRelinquishProcessor gets called which then affects response time. So for now we revert to the 3.0.11 behavior, good performance and 100% CPU usage!\
\
4) GetAttribute 1004 returns returns interpreterVersion; which is for example\
"Squeak3.1alpha of 6 February 2001 [latest update: #3987]"\
\
5) When in full screen mode we now attempt to disable resizing, zooming, or moving the window. The window borders are hidden, but in the past it was feasible to grab an edge and alter it, thus confusing the VM.\
\
6) Worked on Carbonizing the browser plugin\
\
7) 3977 & 3978 FloatArray fixes. Makes float arrays go through a new (and working) version of #primitiveHash\
\
8) Fixed problem with accidental mouse clicks being triggered from pulldown menus on application switching.\
\
9)\
"Change Set: 3984 BitBltExtensions-ar\
Date: 4 May 2001\
Author: Andreas Raab\
\
The change set includes various extensions for BitBlt with the goal of migrating the useful features from FXBlt into the general BitBlt mechanisms. These include:\
\
* Handling of LSB and MSB forms:\
BitBlt now handles both, MSB and LSB forms (and their conversions). Only instances of Bitmap are assumed to contain big-endian pixels. All others are assumed to be little endian (reason is that we can only identify Bitmap here). Note that 'LSB' and 'MSB' refers to PIXELS, that is a 1bpp LSB form has its left most pixel in the lowest bit whereas a 1bpp MSB form has its left-most pixel in the highest bit.\
\
For pixel depths < 8 this can be different from what your OS supplies (as an example, Windows bitmaps < 8 are big-endian pixels in little-endian words; we might call them 'middle-endian'). We simply don't deal with those - forms are either big or little endian but nothing inbetween.\
\
BitBlt has got an extra combination rule for swapping pixels in the destination form. This can be used to make byte swapping much more efficient (as soon as we've got more VMs with support for it).\
\
* Handling of 'native bitmaps' (aka surfaces):\
BitBlt is now able to deal with OS surfaces that are registered with the surface plugin.\
\
* Handling of full color maps:\
BitBlt has been extended to deal with instances of ColorMap in addition to the prior mechanism of using only indexed lookups and provide an implicit 16-32 bit color conversion. ColorMaps can specify both, a lookup table and an additional set of masks and shifts to apply during the color mapping operation. \
\
Four independent shifts and masks can be given which can be used for a lot more than just color conversion (as an example, one could do byte swapping with this; but see also BitBlt class>>exampleColorMap). \
\
* Better handling of default arguments:\
For most of the required arguments for BitBlt very reasonable default assumptions can be made. This includes the destOrigin (0@0), clipRect (0@0 extent: destForm extent), sourceOrigin (0@0). BitBlt now substitutes these if they are absent (e.g., nil) in the instance provided.\
\
"\
\
\
v3.0.13 at change set #3848\
\
1) sqMacSecurity was changed to set the unsecure directory to\
system folder:Preferences:Squeak:Internet:My Squeak\
\
v3.0.12 at change set #3848\
1) Fixed problem with creating My Squeak Folder in Documents Folder with System 8.6\
\
What has been fixed/changed.\
v3.0.11 at change set #3848\
\
1) sqMacDirectory had a bug when you resolved a path name. The fast resolve always failed, which invoked the slow resolver. Now the fast resolver works.\
\
2) sqMacSecurity was changed to set the unsecure directory to Documents:My Squeak. \
\
3) sqMacWindow was changed to fix some issues with Squeak capturing events from other applications and to reduce the number of duplicate mouse events that are generated. Also we capture modifier information directly from the mouse and keyboard on null events to fix some problems with Carbon. We hopefully fixed problems with mouse clicks from foreground applications being seen by Squeak and issues with the OS-X Dock clicks.\
\
4) sqMacNSPlugin was changed to use the above mouse/keyboard capture code which is much cleaner than the original fix for the bogus modifier information given to us by netscape on a null event. \
\
5) When you turn full screen off we now correctly reposition the window to the original location versus a few pixels to the left. \
\
What has been fixed/changed.\
v3.0.10 at change set #3848\
\
1) changed VM exception unwind logic\
3796-Exception-unwind-V3,ti...@su..., Paul McDonough, Stephen Pair and others\
\
2) Fixes for the JPEGReader plugin and for Jitter 3\
\
3) Added minimal Mac VM logic to assist in building a small VM.\
\
4) Changed how the browser plugin starts up. Now it starts the interpreter running only after getting the browser setwindow command. This seems to fix a race condition that resulted in a crash at startup time with Netscape 4.x\
\
5) Fixed broken full screen redraw on cmd-tab\
\
6) Fixed what looked like mouse-down, mouse-down, mouse-up sequence. Now reports mouse-down, mouse up.\
\
7) Added StarSqueak plugin as internal plugin\
\
8) Note the current Squeak Plugin should be gotten from the www.squeakland.org site.\
\
v3.0.9 at change set #3776, Boston Snow storm build.\
\
1) A number of changes were made to the interpreter:\
a) added primitive to change a class.\
b) added primitives to get or put 32bit integers\
c) Fix problem with GC and class reshaping\
d) Better logic for method cache flushing\
\
2) Added JPEGReader plugin\
\
\
V3.0.8 at change set #3740\
\
1) The caps lock no longer maps to the shift attribute. So if the caps lock is down mouse clicks will behave normally. \
\
2) Numerous fixes for the BitBltPlugin plugin\
\
3) Memory allocation grow/shrink logic for Carbon was added.\
\
4) Spurious mouse clicks for the browser plugin has been fixed. (This took awhile to fix, I'm sure it's a bug with the Swedish version of Netscape)\
\
5) The browser plugin will attempt first to allocate memory from the browser heap, then the system heap. Most people when faced with a memory issue usually increase memory for the browser first. However memory for the plugin is controlled by an attribute in the EMBED HTML statement. \
\
V3.0.7\
\
1) A bug exists in pre OS 8.x that causes a crash in activate window if the standard get file \
dialog comes up before the Squeak Window. I remove the InvalWindow call found in that routine since it is actually redundant.\
\
2) The standard get file dialog on system 7.x would not terminate if you did a cancel.\
\
3) The InterfaceLib had to be weak linked to prevent CFM startup issues. \
\
V3.0.6\
\
1) Alias resolving is less aggressive.\
\
2) We no longer cache image reads or writes. This was done because OS 9.1 allows you to have very large disk caches, and it's pointless to cache the image read or write.\
\
3) The file flush primitive now actually flushes the file via an OS call. This was a bug in the CodeWarrior 5.3 source code.\
\
4) The 68K version was being built with the 68881 math library. This fails on 68040LC chips. We now use the non-68881 math library. Thanks to Bruce ONeel for find this.\
\
5) A bug was found in the path resolving logic that was added for 3.x. This bug apparently only affects 68K machines, never was identified as a PowerPC issue. \
\
6) The Netscape plugin needs a properly allocated clip region, this code seemed to work ok on new systems, but fails on system 7.6.1\
\
7) The security interface will create a Documents folder on the root volume if the default Document folder has been deleted. This is needed for security purposes. \
\
8) Jitter needs 1MB of free memory to run.\
\
9) 68K machines require another 32K of stack\
\
10) Threads now work on 68K machines, but turned off because of possible performance issues. (I think more study is needed).\
\
11) The 68K version was compiled with better optimization, expect a 15% improvement.\
\
12) fix for BitBltPlugin ascii = byteAt((sourcePtr + charIndex) - 1);\
\
13) The interpreter object validation checking code was alter to work correctly.\
\
V3.0.5\
\
1) sqConfig.h changed due to BE OS header changes\
\
2) sqMacDirectory.c. Added support for Navigation services or Standard File Get to find the image at startup time when the Squeak.image is not found by the VM. This replaces the DOS like console message that comes up saying that Squeak can't find a image.\
\
3) A fix to drag and drop for the browser plugin.\
\
4) We now use Apple's cooperative multithreading package to run the UI in one thread, the VM in the other. This solves some issues with the browser and makes the UI versus VM logic and execution responsibilities easier to understand. \
\
5) Changed the sqMacNSPlugin.c code to support a 3.0VM using multithreading support. This should give Squeak in a browser better performance. Also changed the full screen support to correctly work with multiple monitors.\
\
6) BitBltPlugin.c gets one more op code\
\
7) Added the security interface\
\
8) Added the file flush primitive\
\
9) Rewrote the macintosh readme file\
\
10) Revisited the zoomWindow code and found a bug with multiple monitor support, then I fixed the code to make Full Screen mode work on screen that Squeak window is mostly on, versus the menubar screen. Also if you switch from full screen back it resizes the window back to the orginal size and location before you invoked the full screen. \
\
V3.0.2\
Plugins\
\
Recompiled the internal BitBltPlugin plugin to encorporate:\
Change Set: 258AlphaBlendOpt-dsm\
Author: Duane Maxwell, Paul Phillips/exobox\
a) Short circuits full opaque and full transparent pixels when alpha blending.\
\
Recompiled the internal LargeIntegerPlugin\
3298LargeIntegersV1-2-sr -- Stephan Rudlof -- 29 November 2000\
3299LargeIntV1-2For29-sr -- Stephan Rudlof -- 29 November 2000\
\
VM Software\
\
(b) PowerManagement for macintosh is now supported. You can disable the power manager to give you better performance on some powerbooks at the expense of battery life. See the Preferences Panel for details, category 'Performance'\
- changed sq.h\
- changed sqMacWindow.c to add support for power mgr disabling\
\
(c) Drag and Drop support for the macintosh, dragging files from the Finder to the Squeak window is now supported.\
- sqMacDragDrop.c added\
- sqMacWindow.c changed\
\
(d) Added primitive for get macintosh creator and file type.\
- sqMacDirectory.c changed\
\
(e) Carbon support. Thanks to Karl Goiser ka...@wa... for work he did on sound and other Carbonization hotspots.\
- sqMacAsyncFilePrims.c changed\
- sqMacFFIPPC.c changed (not supported for Carbon)\
- sqMacNetwork.c changed per Apple tech note 1173 Carbon asset tracking\
-sqMacSerialAndMIDIPort.c chnaged (Not supported for Carbon)\
- sqMacSound.c changed per Apple tech note 1198 Carbon double sound buffer playing\
- sqMacWindow.c changed (various changes for Carbon)\
\
(f) Poll at least 60 times a second for the mouse if required. Previous 2.9.x VM did it 30 times but this is too slow and 2.8.x VM do it 60 times a second.\
\
(g) Reworked path support Thanks to Karl Goiser ka...@wa... for starting this.\
- sqmacDirectory.c changed reworked lookupPath\
- sqMacWindow.c changed, added GetApplicationDirectory to get application directory\
\
(h) I rewrote the sqMacDirectory.c logic to enable proper understanding of Apple's Alias logic. This means for example you can alias the "SqueakV3.sources" file and then only have one copy and have all your images point to it. \
\
(i) Added Zoom Window support.\
\
(j) Change the Squeak change file icon to better match Apple's visual guidelines, Thanks to Doug Way for the suggestion and the new icons.\
\
(k) The sound plugins have changed...\
\
(j) Dropped FFI out of the base Squeak because of security concerns\
\
(k) Compiled for 750(G3) processor versus 603\
\
(l) Added screenDepth primitive\
\
The 3.0.x VM contains most of the optional plugins, you might want to check this by inspecting "Smalltalk listBuiltinModules" to see where your plugins are coming from. In some case people have been accidentally overriding the new builtin plugins with older plugins. \
\
The file "Squeak 3.0Alpha10MT.sig" contains the PGP signature for the Squeak 3.0Alpha10MT VM\
\
John M McIntosh jo...@sm...\
\
\
\
\
\
\
\
\
}
|
|
From: John M M. <jo...@us...> - 2002-11-14 17:37:34
|
Update of /cvsroot/squeak/squeak/platforms/Mac OS/vm/specialChangeSets In directory usw-pr-cvs1:/tmp/cvs-serv31084/squeak/platforms/Mac OS/vm/specialChangeSets Removed Files: CheckInterruptOften-JMM.1.cs Log Message: 3.2.4b1 remove checkInterruptOften-JMM.1.cs, was rolled into 3.2 update stream --- CheckInterruptOften-JMM.1.cs DELETED --- |
|
From: John M M. <jo...@us...> - 2002-11-14 17:34:43
|
Update of /cvsroot/squeak/squeak/platforms/Mac OS/vm/specialChangeSets In directory usw-pr-cvs1:/tmp/cvs-serv29431/squeak/platforms/Mac OS/vm/specialChangeSets Removed Files: Interpreter-normalSend.1.cs Log Message: 3.2.4b1 remove normalsend special mac changeset. That was rolled into the 3.2 and higher update stream --- Interpreter-normalSend.1.cs DELETED --- |
|
From: John M M. <jo...@us...> - 2002-11-10 09:26:59
|
Update of /cvsroot/squeak/squeak/platforms/Mac OS/vm/Documentation
In directory usw-pr-cvs1:/tmp/cvs-serv27939/squeak/platforms/Mac OS/vm/Documentation
Modified Files:
3.2.8 Release Notes.rtf
Log Message:
3.2.8b9 Changes to docs
Index: 3.2.8 Release Notes.rtf
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/Mac OS/vm/Documentation/3.2.8 Release Notes.rtf,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** 3.2.8 Release Notes.rtf 22 Aug 2002 06:56:48 -0000 1.2
--- 3.2.8 Release Notes.rtf 10 Nov 2002 09:26:56 -0000 1.3
***************
*** 1,3 ****
! {\rtf1\mac\ansicpg10000\cocoartf100
{\fonttbl\f0\fnil\fcharset77 Geneva;\f1\fnil\fcharset77 LucidaGrande;\f2\fswiss\fcharset77 Helvetica;
}
--- 1,3 ----
! {\rtf1\mac\ansicpg10000\cocoartf102
{\fonttbl\f0\fnil\fcharset77 Geneva;\f1\fnil\fcharset77 LucidaGrande;\f2\fswiss\fcharset77 Helvetica;
}
***************
*** 7,11 ****
\f0\fs24 \cf0 Mac VM 3.2.8 mach-o build for Carbon, and build for Classic.\
! Aug 7th, 2002 (3.2.8b3)\
Still yet to do, in future versions.\
Verify that file delete rename etc works on aliases, not the targets.\
--- 7,11 ----
\f0\fs24 \cf0 Mac VM 3.2.8 mach-o build for Carbon, and build for Classic.\
! Oct 24rd, 2002 (3.2.8b9)\
Still yet to do, in future versions.\
Verify that file delete rename etc works on aliases, not the targets.\
***************
*** 25,28 ****
--- 25,46 ----
Some issues with alias files and folder were fixed in 3.2.7b6 and 3.2.8b3\
\
+ 3.2.8b9\
+ a) recompiled os-x version, 3.2.8b8 seem to have a bad compiler option and gave 20% less performance.\
+ \
+ 3.2.8b8\
+ a) exposed
+ \f2 vmParameter
+ \f0 24 & 25 which control how memory is allocated/freed \
+
+ \f2 Smalltalk vmParameterAt: 24 put: 48*1024*1024.\
+ Smalltalk vmParameterAt: 25 put: 24*1024*1024.\
+
+ \f0 b) Added argv,argc, env variables to main\
+ c) Fixed for Jaguar 10.2. Full screen mode cmd-tab broke menu bar hiding, this is a 10.2 bug\
+ d) Added support for IP_ADD/DROPMEMBERSHIP and the ability to bind to the wild card port (0).\
+ e) OpenGL changes for TEA\
+ \
+ 3.2.8b7 was testing release and not distributed to the public.\
+ 3.2.8b6 was testing release and not distributed to the public.\
3.2.8b5\
a) Oops broke the logic returning the vmversion information in classic. Also incremented os-x version (which was fine) to keep numbers in sync\
|
|
From: John M M. <jo...@us...> - 2002-11-10 09:24:25
|
Update of /cvsroot/squeak/squeak/platforms/Mac OS/plugins/PrintJobPlugin
In directory usw-pr-cvs1:/tmp/cvs-serv26262/squeak/platforms/Mac OS/plugins/PrintJobPlugin
Modified Files:
sqMacPrinting.c
Log Message:
3.2.8b9 Fix us temp memory for newgworld to enable one to print large screens, otherwise it silently fails and causes the printer to eject a blank page.
Index: sqMacPrinting.c
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/Mac OS/plugins/PrintJobPlugin/sqMacPrinting.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** sqMacPrinting.c 8 Aug 2002 01:25:31 -0000 1.4
--- sqMacPrinting.c 10 Nov 2002 09:24:22 -0000 1.5
***************
*** 906,910 ****
PixMapHandle thePix;
! NewGWorld(&aGWorld, printJob->depth, &srcRect, stColorTable, NULL, keepLocal);
thePix = GetGWorldPixMap (aGWorld);
LockPixels(thePix);
--- 906,910 ----
PixMapHandle thePix;
! NewGWorld(&aGWorld, printJob->depth, &srcRect, stColorTable, NULL, keepLocal+useTempMem);
thePix = GetGWorldPixMap (aGWorld);
LockPixels(thePix);
|
|
From: John M M. <jo...@us...> - 2002-11-10 09:22:18
|
Update of /cvsroot/squeak/squeak/platforms/Mac OS/vm/specialChangeSets
In directory usw-pr-cvs1:/tmp/cvs-serv24878/squeak/platforms/Mac OS/vm/specialChangeSets
Added Files:
Globalstructure-JMM.3.cs
Log Message:
Fix for class definition where something did a double class reshape and dropped an instance var. This makes pluginName a undeclared, which has the side effect of building the exports list wrong in inter.c
--- NEW FILE: Globalstructure-JMM.3.cs ---
'From Squeak3.2gamma of 15 January 2002 [latest update: #4889] on 6 November 2002 at 5:54:58 pm'!
"Change Set: Globalstructure-JMM
Date: 5 April 2002
Author: John M McIntosh
Slang logic change to extrude global variables as a structure. This has performance implications on
some platforms (better). Or is needed on some hardware because you don't have support for multiple globals"!
Object subclass: #CCodeGenerator
instanceVariableNames: 'translationDict inlineList constants variables variableDeclarations methods variablesSetCache headerFiles pluginName extraDefs postProcesses isCPP pluginPrefix '
classVariableNames: 'UseRightShiftForDivide '
poolDictionaries: ''
category: 'VMConstruction-Translation to C'!
CCodeGenerator subclass: #CCodeGeneratorGlobalStructure
instanceVariableNames: 'globalVariables '
classVariableNames: ''
poolDictionaries: ''
category: 'VMConstruction-Translation to C'!
ObjectMemory subclass: #Interpreter
instanceVariableNames: 'activeContext theHomeContext method receiver instructionPointer stackPointer localIP localSP localHomeContext messageSelector argumentCount newMethod currentBytecode successFlag primitiveIndex methodCache atCache lkupClass reclaimableContextCount nextPollTick nextWakeupTick lastTick interruptKeycode interruptPending semaphoresToSignalA semaphoresUseBufferA semaphoresToSignalCountA semaphoresToSignalB semaphoresToSignalCountB savedWindowSize fullScreenFlag deferDisplayUpdates pendingFinalizationSignals compilerInitialized compilerHooks extraVMMemory newNativeMethod methodClass receiverClass interpreterVersion obsoleteIndexedPrimitiveTable obsoleteNamedPrimitiveTable interpreterProxy showSurfaceFn interruptCheckCounterFeedBackReset interruptChecksEveryNms externalPrimitiveTable cntx val '
classVariableNames: 'ActiveProcessIndex AtCacheEntries AtCacheFixedFields AtCacheFmt AtCacheMask AtCacheOop AtCacheSize AtCacheTotalSize AtPutBase BlockArgumentCountIndex BytecodeTable CacheProbeMax CallerIndex CharacterValueIndex CompilerHooksSize CrossedX DirBadPath DirEntryFound DirNoMoreEntries EndOfRun ExcessSignalsIndex FirstLinkIndex GenerateBrowserPlugin HeaderIndex HomeIndex InitialIPIndex InstanceSpecificationIndex InstructionPointerIndex JitterTable LastLinkIndex LiteralStart MaxExternalPrimitiveTableSize MaxPrimitiveIndex MessageArgumentsIndex MessageDictionaryIndex MessageLookupClassIndex MessageSelectorIndex MethodArrayIndex MethodCacheClass MethodCacheEntries MethodCacheEntrySize MethodCacheMask MethodCacheMethod MethodCacheNative MethodCachePrim MethodCacheSelector MethodCacheSize MethodIndex MillisecondClockMask MyListIndex NextLinkIndex PrimitiveExternalCallIndex PrimitiveTable PriorityIndex ProcessListsIndex ReceiverIndex SelectorStart SemaphoresToSignalSize SenderIndex StackPointerIndex StreamArrayIndex StreamIndexIndex StreamReadLimitIndex StreamWriteLimitIndex SuperclassIndex SuspendedContextIndex TempFrameStart ValueIndex XIndex YIndex '
poolDictionaries: ''
category: 'VMConstruction-Interpreter'!
!CCodeGenerator methodsFor: 'utilities' stamp: 'JMM 4/16/2002 22:39'!
returnPrefixFromVariable: aName
^aName! !
!CCodeGenerator methodsFor: 'C code generator' stamp: 'ar 4/7/2002 18:25'!
emitCVariablesOn: aStream
"Store the global variable declarations on the given stream."
| varString |
aStream nextPutAll: '/*** Variables ***/'; cr.
variables asSortedCollection do: [ :var |
varString _ var asString.
(self isGeneratingPluginCode) ifTrue:[
varString = 'interpreterProxy' ifTrue:[
"quite special..."
aStream cr; nextPutAll: '#ifdef SQUEAK_BUILTIN_PLUGIN'.
aStream cr; nextPutAll: 'extern'.
aStream cr; nextPutAll: '#endif'; cr.
] ifFalse:[aStream nextPutAll:'static '].
].
(variableDeclarations includesKey: varString) ifTrue: [
aStream nextPutAll: (variableDeclarations at: varString), ';'; cr.
] ifFalse: [
"default variable declaration"
aStream nextPutAll: 'int ', varString, ';'; cr.
].
].
aStream cr.! !
!CCodeGeneratorGlobalStructure methodsFor: 'C code generator' stamp: 'JMM 4/16/2002 22:38'!
buildSortedVariablesCollection
"Build sorted vars, cheat do an allinstances to get the variables node, then consolidate in a bag
however I want to special case the arrays to put last in the structure
end result will be sorted collection based on static usage, perhaps cache lines will like this!!"
| globalNames sorted |
globalNames _ TVariableNode allInstances select: [:e | self globalVariables includes: e name].
globalNames _ globalNames collect: [:e | e name].
globalNames _ globalNames reject: [:e | variableDeclarations includesKey: e].
globalNames _ globalNames asBag.
variableDeclarations keysDo:
[:e | globalNames add: e withOccurrences: 0].
sorted _ SortedCollection sortBlock:
[:a :b | (globalNames occurrencesOf: a) > (globalNames occurrencesOf: b)].
sorted addAll: variables.
^sorted! !
!CCodeGeneratorGlobalStructure methodsFor: 'C code generator' stamp: 'JMM 5/9/2002 14:09'!
emitCVariablesOn: aStream
"Store the global variable declarations on the given stream.
break logic into vars for structure and vars for non-structure"
| varString structure nonstruct target |
structure _ WriteStream on: (String new: 32768).
nonstruct _ WriteStream on: (String new: 32768).
aStream nextPutAll: '/*** Variables ***/'; cr.
structure nextPutAll: 'struct foo {'; cr.
self buildSortedVariablesCollection do: [ :var |
varString _ var asString.
target _ (self placeInStructure: var)
ifTrue: [structure]
ifFalse: [nonstruct].
(self isGeneratingPluginCode) ifTrue:[
varString = 'interpreterProxy' ifTrue:[
"quite special..."
aStream cr; nextPutAll: '#ifdef SQUEAK_BUILTIN_PLUGIN'.
aStream cr; nextPutAll: 'extern'.
aStream cr; nextPutAll: '#endif'; cr.
] ifFalse:[aStream nextPutAll:'static '].
].
(variableDeclarations includesKey: varString) ifTrue: [
target nextPutAll: (variableDeclarations at: varString), ';'; cr.
] ifFalse: [
"default variable declaration"
target nextPutAll: 'int ', varString, ';'; cr.
].
].
structure nextPutAll: ' } fum;';cr.
structure nextPutAll: 'struct foo * foo = &fum;';cr;cr.
aStream nextPutAll: structure contents.
aStream nextPutAll: nonstruct contents.
aStream cr.! !
!CCodeGeneratorGlobalStructure methodsFor: 'C code generator' stamp: 'JMM 4/16/2002 22:45'!
globalVariables
"First time we get called we get the global variables into a set"
globalVariables ifNil:
[globalVariables _ Set withAll: variables].
^globalVariables! !
!CCodeGeneratorGlobalStructure methodsFor: 'C code generator' stamp: 'JMM 4/17/2002 16:15'!
placeInStructure: var
"See if we should put this array into a structure
This has hard coded vars, should go somewhere else!!
The variables listed are hardcoded as C in the interpreter thus they don't get resolved via TVariableNode logic
Also Lets igore variables that have special defintions that require initialization,
and the function def which has problems"
| check |
check _ variableDeclarations at: var ifAbsent: [''].
(check includes: $=) ifTrue: [^false].
(check includes: $() ifTrue: [^false].
(check includes: $[) ifTrue: [^false].
(#( 'showSurfaceFn' 'memory' 'extraVMMemory' 'interpreterProxy') includes: var) ifTrue: [^false].
^true.
! !
!CCodeGeneratorGlobalStructure methodsFor: 'C code generator' stamp: 'JMM 4/16/2002 22:39'!
returnPrefixFromVariable: aName
^((self globalVariables includes: aName) and: [self placeInStructure: aName])
ifTrue: ['foo->',aName]
ifFalse: [aName]! !
!Interpreter methodsFor: 'return bytecodes' stamp: 'JMM 4/17/2002 00:05'!
returnFalse
cntx _ self sender.
val _ falseObj.
self returnValueTo.! !
!Interpreter methodsFor: 'return bytecodes' stamp: 'JMM 4/17/2002 00:04'!
returnNil
cntx _ self sender.
val _ nilObj.
self returnValueTo.
! !
!Interpreter methodsFor: 'return bytecodes' stamp: 'JMM 4/17/2002 00:04'!
returnReceiver
cntx _ self sender.
val _ receiver.
self returnValueTo.! !
!Interpreter methodsFor: 'return bytecodes' stamp: 'JMM 4/17/2002 00:05'!
returnTopFromBlock
"Return to the caller of the method containing the block."
cntx _ self caller. "Note: caller, not sender!!"
val _ self internalStackTop.
self returnValueTo.! !
!Interpreter methodsFor: 'return bytecodes' stamp: 'JMM 4/17/2002 00:04'!
returnTopFromMethod
cntx _ self sender.
val _ self internalStackTop.
self returnValueTo.! !
!Interpreter methodsFor: 'return bytecodes' stamp: 'JMM 4/17/2002 00:05'!
returnTrue
cntx _ self sender.
val _ trueObj.
self returnValueTo.! !
!Interpreter methodsFor: 'return bytecodes' stamp: 'JMM 4/17/2002 00:16'!
returnValueTo
"Note: Assumed to be inlined into the dispatch loop."
| nilOop thisCntx contextOfCaller localCntx localVal|
self inline: true.
self sharedCodeNamed: 'commonReturn' inCase: 120.
nilOop _ nilObj. "keep in a register"
thisCntx _ activeContext.
localCntx _ cntx.
localVal _ val.
"make sure we can return to the given context"
((localCntx = nilOop) or:
[(self fetchPointer: InstructionPointerIndex ofObject: localCntx) = nilOop]) ifTrue: [
"error: sender's instruction pointer or context is nil; cannot return"
^self internalCannotReturn: localVal].
"If this return is not to our immediate predecessor (i.e. from a method to its sender, or from a block to its caller), scan the stack for the first unwind marked context and inform this context and let it deal with it. This provides a chance for ensure unwinding to occur."
thisCntx _ self fetchPointer: SenderIndex ofObject: activeContext.
"Just possibly a faster test would be to compare the homeContext and activeContext - they are of course different for blocks. Thus we might be able to optimise a touch by having a different returnTo for the blockreteurn (since we know that must return to caller) and then if active ~= home we must be doing a non-local return. I think. Maybe."
[thisCntx = localCntx] whileFalse: [
thisCntx = nilObj ifTrue:[
"error: sender's instruction pointer or context is nil; cannot return"
^self internalCannotReturn: localVal].
"Climb up stack towards localCntx. Break out to a send of #aboutToReturn:through: if an unwind marked context is found"
(self isUnwindMarked: thisCntx) ifTrue:[
"context is marked; break out"
^self internalAboutToReturn: localVal through: thisCntx].
thisCntx _ self fetchPointer: SenderIndex ofObject: thisCntx.
].
"If we get here there is no unwind to worry about. Simply terminate the stack up to the localCntx - often just the sender of the method"
thisCntx _ activeContext.
[thisCntx = localCntx]
whileFalse:
["climb up stack to localCntx"
contextOfCaller _ self fetchPointer: SenderIndex ofObject: thisCntx.
"zap exited contexts so any future attempted use will be caught"
self storePointerUnchecked: SenderIndex ofObject: thisCntx withValue: nilOop.
self storePointerUnchecked: InstructionPointerIndex ofObject: thisCntx withValue: nilOop.
reclaimableContextCount > 0 ifTrue:
["try to recycle this context"
reclaimableContextCount _ reclaimableContextCount - 1.
self recycleContextIfPossible: thisCntx].
thisCntx _ contextOfCaller].
activeContext _ thisCntx.
(thisCntx < youngStart) ifTrue: [ self beRootIfOld: thisCntx ].
self internalFetchContextRegisters: thisCntx. "updates local IP and SP"
self fetchNextBytecode.
self internalPush: localVal.
! !
!Interpreter class methodsFor: 'translation' stamp: 'JMM 4/16/2002 22:32'!
translateInDirectory: directory doInlining: inlineFlag forBrowserPlugin: pluginFlag
^self translateInDirectory: directory doInlining: inlineFlag forBrowserPlugin: pluginFlag forGlobalStructure: false! !
!Interpreter class methodsFor: 'translation' stamp: 'JMM 5/9/2002 14:21'!
translateInDirectory: directory doInlining: inlineFlag forBrowserPlugin: pluginFlag forGlobalStructure: globalStructureFlag
"Translate the Smalltalk description of the virtual machine into C. If inlineFlag is true, small method bodies are inlined to reduce procedure call overhead. On the PPC, this results in a factor of three speedup with only 30% increase in code size. If pluginFlag is true, generate code for an interpreter that runs as a browser plugin (Netscape or IE)."
"Note: The pluginFlag is meaningless on Windows and Unix. On these platforms Squeak runs as it's own process and doesn't need any special attention from the VMs point of view. Meaning that NONE of the required additional functions will be supported. In other words, the pluginFlag is not needed and not supported."
"The forGlobalStructure flag if true uses a different CCodeGenerator to build globals as a pointer to a structure, some RISC based platforms PPC for example
them make better assembler"
"Return the list of exports for this module"
| doInlining cg fileName tStamp fstat |
tStamp _ { Interpreter. ObjectMemory} inject: 0 into: [:tS :cl|
tS _ tS max: cl timeStamp].
"don't translate if the file is newer than my timeStamp"
fileName _ 'interp.c'.
fstat _ directory entryAt: fileName ifAbsent:[nil].
fstat ifNotNil:[tStamp < fstat modificationTime ifTrue:[^nil]].
doInlining _ inlineFlag.
pluginFlag ifTrue: [doInlining _ true]. "must inline when generating browser plugin"
Interpreter initialize.
ObjectMemory initialize.
GenerateBrowserPlugin _ pluginFlag.
cg _ globalStructureFlag
ifTrue: [CCodeGeneratorGlobalStructure new initialize]
ifFalse: [CCodeGenerator new initialize].
cg addClass: Interpreter.
cg addClass: ObjectMemory.
Interpreter declareCVarsIn: cg.
ObjectMemory declareCVarsIn: cg.
cg storeCodeOnFile: (directory fullNameFor: fileName) doInlining: doInlining! !
!MacOSPowerPCOS9VMMaker methodsFor: 'generate sources' stamp: 'JMM 5/9/2002 14:21'!
generateInterpreterFile
"generate the main 'interp.c' file for the interpreter and the list of
export statments"
Interpreter
translateInDirectory: self coreVMDirectory
doInlining: inline
forBrowserPlugin: forBrowser
forGlobalStructure: true.
! !
!TVariableNode methodsFor: 'as yet unclassified' stamp: 'JMM 4/5/2002 14:14'!
emitCCodeOn: aStream level: level generator: aCodeGen
name = 'nil'
ifTrue: [ aStream nextPutAll: (aCodeGen cLiteralFor: nil) ]
ifFalse: [ aStream nextPutAll: (aCodeGen returnPrefixFromVariable: name) ].! !
Interpreter removeSelector: #returnValue:to:!
|
|
From: John M M. <jo...@us...> - 2002-11-10 09:22:14
|
Update of /cvsroot/squeak/squeak/platforms/Mac OS/vm/specialChangeSets In directory usw-pr-cvs1:/tmp/cvs-serv24814/squeak/platforms/Mac OS/vm/specialChangeSets Removed Files: Globalstructure-JMM.2.cs Log Message: Fix for class definition where something did a double class reshape and dropped an instance var. This makes pluginName a undeclared, which has the side effect of building the exports list wrong in inter.c --- Globalstructure-JMM.2.cs DELETED --- |
Update of /cvsroot/squeak/squeak/platforms/unix/misc/rfb
In directory usw-pr-cvs1:/tmp/cvs-serv21961
Added Files:
Tag: cg_unix_rfb_server
README auth.c cmap.c corre.c cutpaste.c dispcur.c draw.c
hextile.c httpd.c init.c kbdptr.c rfb.h rfbserver.c rre.c
sockets.c sprite.c sprite.h spritest.h stats.c
tableinitcmtemplate.c tableinittctemplate.c
tabletranstemplate.c translate.c
Log Message:
* Code from Xvnc server for RFB server support
--- NEW FILE: README ---
$Id: README,v 1.1.2.1 2002/10/07 20:32:54 cdegroot Exp $
This code is support code for an - experimental - RFB server implementation
in Squeak. The idea is to use this for server-side Squeak.
Copied from the VNC Xserver source code. This is the basis for a Squeak
built-in RFB server. Plan of attack:
- Make sqXwindow bitmap (stImage) available to rfb server;
- Start RFB server;
- See whether we can connect and view a snapshot;
- Add updating;
- Add event processing;
- Iterate until perfect;
- Remove unneeded code (everything in sqXWindow.c that talks to X :-)).
This way, we can slowly move in while always being able to work/test
in Squeak. In fact, in version 2 I'd like to simply share the bitmap
image and update list with Smalltalk and code the RFB server over there...
cg...@cd...
--- NEW FILE: auth.c ---
/*
* auth.c - deal with authentication.
*
* This file implements the VNC authentication protocol when setting up an RFB
* connection.
*/
/*
* Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
*/
#include <stdio.h>
#include <stdlib.h>
#include "windowstr.h"
#include "rfb.h"
#define MAX_AUTH_TRIES 5
#define AUTH_TOO_MANY_BASE_DELAY 10 * 1000 /* in ms, doubles for each failure
over MAX_AUTH_TRIES */
static CARD32 rfbAuthReenable(OsTimerPtr timer, CARD32 now, pointer arg);
char *rfbAuthPasswdFile = NULL;
int rfbAuthTries = 0;
Bool rfbAuthTooManyTries = FALSE;
static OsTimerPtr timer = NULL;
/*
* rfbAuthNewClient is called when we reach the point of authenticating
* a new client. If authentication isn't being used then we simply send
* rfbNoAuth. Otherwise we send rfbVncAuth plus the challenge.
*/
void
rfbAuthNewClient(cl)
rfbClientPtr cl;
{
char buf[4 + CHALLENGESIZE];
int len;
cl->state = RFB_AUTHENTICATION;
if (rfbAuthPasswdFile && !cl->reverseConnection) {
if (rfbAuthTooManyTries) {
rfbClientConnFailed(cl, "Too many authentication failures");
return;
}
*(CARD32 *)buf = Swap32IfLE(rfbVncAuth);
vncRandomBytes(cl->authChallenge);
memcpy(&buf[4], (char *)cl->authChallenge, CHALLENGESIZE);
len = 4 + CHALLENGESIZE;
} else {
*(CARD32 *)buf = Swap32IfLE(rfbNoAuth);
len = 4;
cl->state = RFB_INITIALISATION;
}
if (WriteExact(cl->sock, buf, len) < 0) {
rfbLogPerror("rfbAuthNewClient: write");
rfbCloseSock(cl->sock);
return;
}
}
/*
* rfbAuthProcessClientMessage is called when the client sends its
* authentication response.
*/
void
rfbAuthProcessClientMessage(cl)
rfbClientPtr cl;
{
char *passwd;
Bool ok;
int i, n;
CARD8 response[CHALLENGESIZE];
CARD32 authResult;
if ((n = ReadExact(cl->sock, (char *)response, CHALLENGESIZE)) <= 0) {
if (n != 0)
rfbLogPerror("rfbAuthProcessClientMessage: read");
rfbCloseSock(cl->sock);
return;
}
passwd = vncDecryptPasswdFromFile(rfbAuthPasswdFile);
if (passwd == NULL) {
rfbLog("rfbAuthProcessClientMessage: could not get password from %s\n",
rfbAuthPasswdFile);
authResult = Swap32IfLE(rfbVncAuthFailed);
if (WriteExact(cl->sock, (char *)&authResult, 4) < 0) {
rfbLogPerror("rfbAuthProcessClientMessage: write");
}
rfbCloseSock(cl->sock);
return;
}
vncEncryptBytes(cl->authChallenge, passwd);
/* Lose the password from memory */
for (i = strlen(passwd); i >= 0; i--) {
passwd[i] = '\0';
}
free((char *)passwd);
if (memcmp(cl->authChallenge, response, CHALLENGESIZE) != 0) {
rfbLog("rfbAuthProcessClientMessage: authentication failed from %s\n",
cl->host);
rfbAuthTries++;
if (rfbAuthTries >= MAX_AUTH_TRIES) {
CARD32 delay = AUTH_TOO_MANY_BASE_DELAY;
for (i = MAX_AUTH_TRIES; i < rfbAuthTries; i++)
delay *= 2;
timer = TimerSet(timer, 0, delay, rfbAuthReenable, NULL);
rfbAuthTooManyTries = TRUE;
authResult = Swap32IfLE(rfbVncAuthTooMany);
} else {
authResult = Swap32IfLE(rfbVncAuthFailed);
}
if (WriteExact(cl->sock, (char *)&authResult, 4) < 0) {
rfbLogPerror("rfbAuthProcessClientMessage: write");
}
rfbCloseSock(cl->sock);
return;
}
rfbAuthTries = 0;
authResult = Swap32IfLE(rfbVncAuthOK);
if (WriteExact(cl->sock, (char *)&authResult, 4) < 0) {
rfbLogPerror("rfbAuthProcessClientMessage: write");
rfbCloseSock(cl->sock);
return;
}
cl->state = RFB_INITIALISATION;
}
static CARD32
rfbAuthReenable(OsTimerPtr timer, CARD32 now, pointer arg)
{
rfbAuthTooManyTries = FALSE;
return 0;
}
--- NEW FILE: cmap.c ---
/*
* cmap.c
*/
/*
* Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
*/
/*
Copyright (c) 1993 X Consortium
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of the X Consortium shall
not be used in advertising or otherwise to promote the sale, use or
other dealings in this Software without prior written authorization
from the X Consortium.
*/
#include <stdio.h>
#include "scrnintstr.h"
#include "resource.h"
#include "colormapst.h"
#include "rfb.h"
ColormapPtr rfbInstalledColormap;
int
rfbListInstalledColormaps(pScreen, pmaps)
ScreenPtr pScreen;
Colormap *pmaps;
{
/* By the time we are processing requests, we can guarantee that there
* is always a colormap installed */
*pmaps = rfbInstalledColormap->mid;
return (1);
}
void
rfbInstallColormap(pmap)
ColormapPtr pmap;
{
ColormapPtr oldpmap = rfbInstalledColormap;
if (pmap != oldpmap) {
if(oldpmap != (ColormapPtr)None)
WalkTree(pmap->pScreen, TellLostMap, (char *)&oldpmap->mid);
/* Install pmap */
rfbInstalledColormap = pmap;
WalkTree(pmap->pScreen, TellGainedMap, (char *)&pmap->mid);
rfbSetClientColourMaps(0, 0);
}
}
void
rfbUninstallColormap(pmap)
ColormapPtr pmap;
{
ColormapPtr curpmap = rfbInstalledColormap;
if(pmap == curpmap)
{
if (pmap->mid != pmap->pScreen->defColormap)
{
curpmap = (ColormapPtr) LookupIDByType(pmap->pScreen->defColormap,
RT_COLORMAP);
(*pmap->pScreen->InstallColormap)(curpmap);
}
}
}
/*
* rfbStoreColors. We have a set of pixels but they may be in any order.
* If some of them happen to be in continuous ascending order then we can
* group them together into a single call to rfbSetClientColourMaps.
*/
void
rfbStoreColors(pmap, ndef, pdefs)
ColormapPtr pmap;
int ndef;
xColorItem *pdefs;
{
int i;
int first = -1;
int n = 0;
if (pmap == rfbInstalledColormap) {
for (i = 0; i < ndef; i++) {
if ((first != -1) && (first + n == pdefs[i].pixel)) {
n++;
} else {
if (first != -1) {
rfbSetClientColourMaps(first, n);
}
first = pdefs[i].pixel;
n = 1;
}
}
rfbSetClientColourMaps(first, n);
}
}
--- NEW FILE: corre.c ---
/*
* corre.c
*
* Routines to implement Compact Rise-and-Run-length Encoding (CoRRE). This
* code is based on krw's original javatel rfbserver.
*/
/*
* Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
*/
#include <stdio.h>
#include "rfb.h"
/*
* rreBeforeBuf contains pixel data in the client's format.
* rreAfterBuf contains the RRE encoded version. If the RRE encoded version is
* larger than the raw data or if it exceeds rreAfterBufSize then
* raw encoding is used instead.
*/
static int rreBeforeBufSize = 0;
static char *rreBeforeBuf = NULL;
static int rreAfterBufSize = 0;
static char *rreAfterBuf = NULL;
static int rreAfterBufLen;
static int subrectEncode8(CARD8 *data, int w, int h);
static int subrectEncode16(CARD16 *data, int w, int h);
static int subrectEncode32(CARD32 *data, int w, int h);
static CARD32 getBgColour(char *data, int size, int bpp);
static Bool rfbSendSmallRectEncodingCoRRE(rfbClientPtr cl, int x, int y,
int w, int h);
/*
* rfbSendRectEncodingCoRRE - send an arbitrary size rectangle using CoRRE
* encoding.
*/
Bool
rfbSendRectEncodingCoRRE(cl, x, y, w, h)
rfbClientPtr cl;
int x, y, w, h;
{
if (h > cl->correMaxHeight) {
rfbSendRectEncodingCoRRE(cl, x, y, w, cl->correMaxHeight );
rfbSendRectEncodingCoRRE(cl, x, y + cl->correMaxHeight, w,
h - cl->correMaxHeight);
return;
}
if (w > cl->correMaxWidth) {
rfbSendRectEncodingCoRRE(cl, x, y, cl->correMaxWidth, h);
rfbSendRectEncodingCoRRE(cl, x + cl->correMaxWidth, y,
w - cl->correMaxWidth, h);
return;
}
rfbSendSmallRectEncodingCoRRE(cl, x, y, w, h);
}
/*
* rfbSendSmallRectEncodingCoRRE - send a small (guaranteed < 256x256)
* rectangle using CoRRE encoding.
*/
static Bool
rfbSendSmallRectEncodingCoRRE(cl, x, y, w, h)
rfbClientPtr cl;
int x, y, w, h;
{
rfbFramebufferUpdateRectHeader rect;
rfbRREHeader hdr;
int nSubrects;
int i;
char *fbptr = (rfbScreen.pfbMemory + (rfbScreen.paddedWidthInBytes * y)
+ (x * (rfbScreen.bitsPerPixel / 8)));
int maxRawSize = (rfbScreen.width * rfbScreen.height
* (cl->format.bitsPerPixel / 8));
if (rreBeforeBufSize < maxRawSize) {
rreBeforeBufSize = maxRawSize;
if (rreBeforeBuf == NULL)
rreBeforeBuf = (char *)xalloc(rreBeforeBufSize);
else
rreBeforeBuf = (char *)xrealloc(rreBeforeBuf, rreBeforeBufSize);
}
if (rreAfterBufSize < maxRawSize) {
rreAfterBufSize = maxRawSize;
if (rreAfterBuf == NULL)
rreAfterBuf = (char *)xalloc(rreAfterBufSize);
else
rreAfterBuf = (char *)xrealloc(rreAfterBuf, rreAfterBufSize);
}
(*cl->translateFn)(cl->translateLookupTable, &rfbServerFormat,
&cl->format, fbptr, rreBeforeBuf,
rfbScreen.paddedWidthInBytes, w, h);
switch (cl->format.bitsPerPixel) {
case 8:
nSubrects = subrectEncode8((CARD8 *)rreBeforeBuf, w, h);
break;
case 16:
nSubrects = subrectEncode16((CARD16 *)rreBeforeBuf, w, h);
break;
case 32:
nSubrects = subrectEncode32((CARD32 *)rreBeforeBuf, w, h);
break;
default:
rfbLog("getBgColour: bpp %d?\n",cl->format.bitsPerPixel);
exit(1);
}
if (nSubrects < 0) {
/* RRE encoding was too large, use raw */
return rfbSendRectEncodingRaw(cl, x, y, w, h);
}
cl->rfbRectanglesSent[rfbEncodingCoRRE]++;
cl->rfbBytesSent[rfbEncodingCoRRE] += (sz_rfbFramebufferUpdateRectHeader
+ sz_rfbRREHeader + rreAfterBufLen);
if (ublen + sz_rfbFramebufferUpdateRectHeader + sz_rfbRREHeader
> UPDATE_BUF_SIZE)
{
if (!rfbSendUpdateBuf(cl))
return FALSE;
}
rect.r.x = Swap16IfLE(x);
rect.r.y = Swap16IfLE(y);
rect.r.w = Swap16IfLE(w);
rect.r.h = Swap16IfLE(h);
rect.encoding = Swap32IfLE(rfbEncodingCoRRE);
memcpy(&updateBuf[ublen], (char *)&rect,
sz_rfbFramebufferUpdateRectHeader);
ublen += sz_rfbFramebufferUpdateRectHeader;
hdr.nSubrects = Swap32IfLE(nSubrects);
memcpy(&updateBuf[ublen], (char *)&hdr, sz_rfbRREHeader);
ublen += sz_rfbRREHeader;
for (i = 0; i < rreAfterBufLen;) {
int bytesToCopy = UPDATE_BUF_SIZE - ublen;
if (i + bytesToCopy > rreAfterBufLen) {
bytesToCopy = rreAfterBufLen - i;
}
memcpy(&updateBuf[ublen], &rreAfterBuf[i], bytesToCopy);
ublen += bytesToCopy;
i += bytesToCopy;
if (ublen == UPDATE_BUF_SIZE) {
if (!rfbSendUpdateBuf(cl))
return FALSE;
}
}
return TRUE;
}
/*
* subrectEncode() encodes the given multicoloured rectangle as a background
* colour overwritten by single-coloured rectangles. It returns the number
* of subrectangles in the encoded buffer, or -1 if subrect encoding won't
* fit in the buffer. It puts the encoded rectangles in rreAfterBuf. The
* single-colour rectangle partition is not optimal, but does find the biggest
* horizontal or vertical rectangle top-left anchored to each consecutive
* coordinate position.
*
* The coding scheme is simply [<bgcolour><subrect><subrect>...] where each
* <subrect> is [<colour><x><y><w><h>].
*/
#define DEFINE_SUBRECT_ENCODE(bpp) \
static int \
subrectEncode##bpp(data,w,h) \
CARD##bpp *data; \
int w; \
int h; \
{ \
CARD##bpp cl; \
rfbCoRRERectangle subrect; \
int x,y; \
int i,j; \
int hx=0,hy,vx=0,vy; \
int hyflag; \
CARD##bpp *seg; \
CARD##bpp *line; \
int hw,hh,vw,vh; \
int thex,they,thew,theh; \
int numsubs = 0; \
int newLen; \
CARD##bpp bg = (CARD##bpp)getBgColour((char*)data,w*h,bpp); \
\
*((CARD##bpp*)rreAfterBuf) = bg; \
\
rreAfterBufLen = (bpp/8); \
\
for (y=0; y<h; y++) { \
line = data+(y*w); \
for (x=0; x<w; x++) { \
if (line[x] != bg) { \
cl = line[x]; \
hy = y-1; \
hyflag = 1; \
for (j=y; j<h; j++) { \
seg = data+(j*w); \
if (seg[x] != cl) {break;} \
i = x; \
while ((seg[i] == cl) && (i < w)) i += 1; \
i -= 1; \
if (j == y) vx = hx = i; \
if (i < vx) vx = i; \
if ((hyflag > 0) && (i >= hx)) {hy += 1;} else {hyflag = 0;} \
} \
vy = j-1; \
\
/* We now have two possible subrects: (x,y,hx,hy) and (x,y,vx,vy) \
* We'll choose the bigger of the two. \
*/ \
hw = hx-x+1; \
hh = hy-y+1; \
vw = vx-x+1; \
vh = vy-y+1; \
\
thex = x; \
they = y; \
\
if ((hw*hh) > (vw*vh)) { \
thew = hw; \
theh = hh; \
} else { \
thew = vw; \
theh = vh; \
} \
\
subrect.x = thex; \
subrect.y = they; \
subrect.w = thew; \
subrect.h = theh; \
\
newLen = rreAfterBufLen + (bpp/8) + sz_rfbCoRRERectangle; \
if ((newLen > (w * h * (bpp/8))) || (newLen > rreAfterBufSize)) \
return -1; \
\
numsubs += 1; \
*((CARD##bpp*)(rreAfterBuf + rreAfterBufLen)) = cl; \
rreAfterBufLen += (bpp/8); \
memcpy(&rreAfterBuf[rreAfterBufLen],&subrect,sz_rfbCoRRERectangle); \
rreAfterBufLen += sz_rfbCoRRERectangle; \
\
/* \
* Now mark the subrect as done. \
*/ \
for (j=they; j < (they+theh); j++) { \
for (i=thex; i < (thex+thew); i++) { \
data[j*w+i] = bg; \
} \
} \
} \
} \
} \
\
return numsubs; \
}
DEFINE_SUBRECT_ENCODE(8)
DEFINE_SUBRECT_ENCODE(16)
DEFINE_SUBRECT_ENCODE(32)
/*
* getBgColour() gets the most prevalent colour in a byte array.
*/
static CARD32
getBgColour(data,size,bpp)
char *data;
int size;
int bpp;
{
#define NUMCLRS 256
static int counts[NUMCLRS];
int i,j,k;
int maxcount = 0;
CARD8 maxclr = 0;
if (bpp != 8) {
if (bpp == 16) {
return ((CARD16 *)data)[0];
} else if (bpp == 32) {
return ((CARD32 *)data)[0];
} else {
rfbLog("getBgColour: bpp %d?\n",bpp);
exit(1);
}
}
for (i=0; i<NUMCLRS; i++) {
counts[i] = 0;
}
for (j=0; j<size; j++) {
k = (int)(((CARD8 *)data)[j]);
if (k >= NUMCLRS) {
rfbLog("getBgColour: unusual colour = %d\n", k);
exit(1);
}
counts[k] += 1;
if (counts[k] > maxcount) {
maxcount = counts[k];
maxclr = ((CARD8 *)data)[j];
}
}
return maxclr;
}
--- NEW FILE: cutpaste.c ---
/*
* cutpaste.c - routines to deal with cut & paste buffers / selection.
*/
/*
* Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
*/
#include <stdio.h>
#define NEED_EVENTS
#include <X.h>
#include <Xproto.h>
#include "rfb.h"
#include "selection.h"
#include "input.h"
#include <Xatom.h>
extern WindowPtr *WindowTable; /* Why isn't this in a header file? */
extern Selection *CurrentSelections;
extern int NumCurrentSelections;
static Bool inSetXCutText = FALSE;
/*
* rfbSetXCutText sets the cut buffer to be the given string. We also clear
* the primary selection. Ideally we'd like to set it to the same thing, but I
* can't work out how to do that without some kind of helper X client.
*/
void
rfbSetXCutText(char *str, int len)
{
int i = 0;
inSetXCutText = TRUE;
ChangeWindowProperty(WindowTable[0], XA_CUT_BUFFER0, XA_STRING,
8, PropModeReplace, len,
(pointer)str, TRUE);
while ((i < NumCurrentSelections) &&
CurrentSelections[i].selection != XA_PRIMARY)
i++;
if (i < NumCurrentSelections) {
xEvent event;
if (CurrentSelections[i].client) {
event.u.u.type = SelectionClear;
event.u.selectionClear.time = GetTimeInMillis();
event.u.selectionClear.window = CurrentSelections[i].window;
event.u.selectionClear.atom = CurrentSelections[i].selection;
(void) TryClientEvents (CurrentSelections[i].client, &event, 1,
NoEventMask, NoEventMask /* CantBeFiltered */,
NullGrab);
}
CurrentSelections[i].window = None;
CurrentSelections[i].pWin = NULL;
CurrentSelections[i].client = NullClient;
}
inSetXCutText = FALSE;
}
void rfbGotXCutText(char *str, int len)
{
if (!inSetXCutText)
rfbSendServerCutText(str, len);
}
--- NEW FILE: dispcur.c ---
/*
* dispcur.c
*
* cursor display routines - based on midispcur.c
*/
/*
* Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
*/
/*
Copyright (c) 1989 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of the X Consortium shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from the X Consortium.
*/
#define NEED_EVENTS
# include "X.h"
# include "misc.h"
# include "input.h"
# include "cursorstr.h"
# include "windowstr.h"
# include "regionstr.h"
# include "dixstruct.h"
# include "scrnintstr.h"
# include "servermd.h"
# include "mipointer.h"
# include "sprite.h"
# include "gcstruct.h"
extern WindowPtr *WindowTable;
/* per-screen private data */
static int rfbDCScreenIndex;
static unsigned long rfbDCGeneration = 0;
static Bool rfbDCCloseScreen();
typedef struct {
GCPtr pSourceGC, pMaskGC;
GCPtr pSaveGC, pRestoreGC;
GCPtr pPixSourceGC, pPixMaskGC;
CloseScreenProcPtr CloseScreen;
PixmapPtr pSave;
} rfbDCScreenRec, *rfbDCScreenPtr;
/* per-cursor per-screen private data */
typedef struct {
PixmapPtr sourceBits; /* source bits */
PixmapPtr maskBits; /* mask bits */
} rfbDCCursorRec, *rfbDCCursorPtr;
/*
* sprite/cursor method table
*/
static Bool rfbDCRealizeCursor(), rfbDCUnrealizeCursor();
static Bool rfbDCPutUpCursor(), rfbDCSaveUnderCursor();
static Bool rfbDCRestoreUnderCursor();
static rfbSpriteCursorFuncRec rfbDCFuncs = {
rfbDCRealizeCursor,
rfbDCUnrealizeCursor,
rfbDCPutUpCursor,
rfbDCSaveUnderCursor,
rfbDCRestoreUnderCursor,
};
Bool
rfbDCInitialize (pScreen, screenFuncs)
ScreenPtr pScreen;
miPointerScreenFuncPtr screenFuncs;
{
rfbDCScreenPtr pScreenPriv;
if (rfbDCGeneration != serverGeneration)
{
rfbDCScreenIndex = AllocateScreenPrivateIndex ();
if (rfbDCScreenIndex < 0)
return FALSE;
rfbDCGeneration = serverGeneration;
}
pScreenPriv = (rfbDCScreenPtr) xalloc (sizeof (rfbDCScreenRec));
if (!pScreenPriv)
return FALSE;
/*
* initialize the entire private structure to zeros
*/
pScreenPriv->pSourceGC =
pScreenPriv->pMaskGC =
pScreenPriv->pSaveGC =
pScreenPriv->pRestoreGC =
pScreenPriv->pPixSourceGC =
pScreenPriv->pPixMaskGC = NULL;
pScreenPriv->pSave = NULL;
pScreenPriv->CloseScreen = pScreen->CloseScreen;
pScreen->CloseScreen = rfbDCCloseScreen;
pScreen->devPrivates[rfbDCScreenIndex].ptr = (pointer) pScreenPriv;
if (!rfbSpriteInitialize (pScreen, &rfbDCFuncs, screenFuncs))
{
xfree ((pointer) pScreenPriv);
return FALSE;
}
return TRUE;
}
#define tossGC(gc) (gc ? FreeGC (gc, (GContext) 0) : 0)
#define tossPix(pix) (pix ? (*pScreen->DestroyPixmap) (pix) : TRUE)
static Bool
rfbDCCloseScreen (index, pScreen)
ScreenPtr pScreen;
{
rfbDCScreenPtr pScreenPriv;
pScreenPriv = (rfbDCScreenPtr) pScreen->devPrivates[rfbDCScreenIndex].ptr;
pScreen->CloseScreen = pScreenPriv->CloseScreen;
tossGC (pScreenPriv->pSourceGC);
tossGC (pScreenPriv->pMaskGC);
tossGC (pScreenPriv->pSaveGC);
tossGC (pScreenPriv->pRestoreGC);
tossGC (pScreenPriv->pPixSourceGC);
tossGC (pScreenPriv->pPixMaskGC);
tossPix (pScreenPriv->pSave);
xfree ((pointer) pScreenPriv);
return (*pScreen->CloseScreen) (index, pScreen);
}
static Bool
rfbDCRealizeCursor (pScreen, pCursor)
ScreenPtr pScreen;
CursorPtr pCursor;
{
if (pCursor->bits->refcnt <= 1)
pCursor->bits->devPriv[pScreen->myNum] = (pointer)NULL;
return TRUE;
}
static rfbDCCursorPtr
rfbDCRealize (pScreen, pCursor)
ScreenPtr pScreen;
CursorPtr pCursor;
{
rfbDCCursorPtr pPriv;
GCPtr pGC;
XID gcvals[3];
pPriv = (rfbDCCursorPtr) xalloc (sizeof (rfbDCCursorRec));
if (!pPriv)
return (rfbDCCursorPtr)NULL;
pPriv->sourceBits = (*pScreen->CreatePixmap) (pScreen, pCursor->bits->width, pCursor->bits->height, 1);
if (!pPriv->sourceBits)
{
xfree ((pointer) pPriv);
return (rfbDCCursorPtr)NULL;
}
pPriv->maskBits = (*pScreen->CreatePixmap) (pScreen, pCursor->bits->width, pCursor->bits->height, 1);
if (!pPriv->maskBits)
{
(*pScreen->DestroyPixmap) (pPriv->sourceBits);
xfree ((pointer) pPriv);
return (rfbDCCursorPtr)NULL;
}
pCursor->bits->devPriv[pScreen->myNum] = (pointer) pPriv;
/* create the two sets of bits, clipping as appropriate */
pGC = GetScratchGC (1, pScreen);
if (!pGC)
{
(void) rfbDCUnrealizeCursor (pScreen, pCursor);
return (rfbDCCursorPtr)NULL;
}
ValidateGC ((DrawablePtr)pPriv->sourceBits, pGC);
(*pGC->ops->PutImage) ((DrawablePtr)pPriv->sourceBits, pGC, 1,
0, 0, pCursor->bits->width, pCursor->bits->height,
0, XYPixmap, (char *)pCursor->bits->source);
gcvals[0] = GXand;
ChangeGC (pGC, GCFunction, gcvals);
ValidateGC ((DrawablePtr)pPriv->sourceBits, pGC);
(*pGC->ops->PutImage) ((DrawablePtr)pPriv->sourceBits, pGC, 1,
0, 0, pCursor->bits->width, pCursor->bits->height,
0, XYPixmap, (char *)pCursor->bits->mask);
/* mask bits -- pCursor->mask & ~pCursor->source */
gcvals[0] = GXcopy;
ChangeGC (pGC, GCFunction, gcvals);
ValidateGC ((DrawablePtr)pPriv->maskBits, pGC);
(*pGC->ops->PutImage) ((DrawablePtr)pPriv->maskBits, pGC, 1,
0, 0, pCursor->bits->width, pCursor->bits->height,
0, XYPixmap, (char *)pCursor->bits->mask);
gcvals[0] = GXandInverted;
ChangeGC (pGC, GCFunction, gcvals);
ValidateGC ((DrawablePtr)pPriv->maskBits, pGC);
(*pGC->ops->PutImage) ((DrawablePtr)pPriv->maskBits, pGC, 1,
0, 0, pCursor->bits->width, pCursor->bits->height,
0, XYPixmap, (char *)pCursor->bits->source);
FreeScratchGC (pGC);
return pPriv;
}
static Bool
rfbDCUnrealizeCursor (pScreen, pCursor)
ScreenPtr pScreen;
CursorPtr pCursor;
{
rfbDCCursorPtr pPriv;
pPriv = (rfbDCCursorPtr) pCursor->bits->devPriv[pScreen->myNum];
if (pPriv && (pCursor->bits->refcnt <= 1))
{
(*pScreen->DestroyPixmap) (pPriv->sourceBits);
(*pScreen->DestroyPixmap) (pPriv->maskBits);
xfree ((pointer) pPriv);
pCursor->bits->devPriv[pScreen->myNum] = (pointer)NULL;
}
return TRUE;
}
static void
rfbDCPutBits (pDrawable, pPriv, sourceGC, maskGC, x, y, w, h, source, mask)
DrawablePtr pDrawable;
GCPtr sourceGC, maskGC;
int x, y;
unsigned w, h;
rfbDCCursorPtr pPriv;
unsigned long source, mask;
{
XID gcvals[1];
if (sourceGC->fgPixel != source)
{
gcvals[0] = source;
DoChangeGC (sourceGC, GCForeground, gcvals, 0);
}
if (sourceGC->serialNumber != pDrawable->serialNumber)
ValidateGC (pDrawable, sourceGC);
(*sourceGC->ops->PushPixels) (sourceGC, pPriv->sourceBits, pDrawable, w, h, x, y);
if (maskGC->fgPixel != mask)
{
gcvals[0] = mask;
DoChangeGC (maskGC, GCForeground, gcvals, 0);
}
if (maskGC->serialNumber != pDrawable->serialNumber)
ValidateGC (pDrawable, maskGC);
(*maskGC->ops->PushPixels) (maskGC, pPriv->maskBits, pDrawable, w, h, x, y);
}
#define EnsureGC(gc,win) (gc || rfbDCMakeGC(&gc, win))
static GCPtr
rfbDCMakeGC(ppGC, pWin)
GCPtr *ppGC;
WindowPtr pWin;
{
GCPtr pGC;
int status;
XID gcvals[2];
gcvals[0] = IncludeInferiors;
gcvals[1] = FALSE;
pGC = CreateGC((DrawablePtr)pWin,
GCSubwindowMode|GCGraphicsExposures, gcvals, &status);
if (pGC)
(*pWin->drawable.pScreen->DrawGuarantee) (pWin, pGC, GuaranteeVisBack);
*ppGC = pGC;
return pGC;
}
static Bool
rfbDCPutUpCursor (pScreen, pCursor, x, y, source, mask)
ScreenPtr pScreen;
CursorPtr pCursor;
int x, y;
unsigned long source, mask;
{
rfbDCScreenPtr pScreenPriv;
rfbDCCursorPtr pPriv;
WindowPtr pWin;
pPriv = (rfbDCCursorPtr) pCursor->bits->devPriv[pScreen->myNum];
if (!pPriv)
{
pPriv = rfbDCRealize(pScreen, pCursor);
if (!pPriv)
return FALSE;
}
pScreenPriv = (rfbDCScreenPtr) pScreen->devPrivates[rfbDCScreenIndex].ptr;
pWin = WindowTable[pScreen->myNum];
if (!EnsureGC(pScreenPriv->pSourceGC, pWin))
return FALSE;
if (!EnsureGC(pScreenPriv->pMaskGC, pWin))
{
FreeGC (pScreenPriv->pSourceGC, (GContext) 0);
pScreenPriv->pSourceGC = 0;
return FALSE;
}
rfbDCPutBits ((DrawablePtr)pWin, pPriv,
pScreenPriv->pSourceGC, pScreenPriv->pMaskGC,
x, y, pCursor->bits->width, pCursor->bits->height,
source, mask);
return TRUE;
}
static Bool
rfbDCSaveUnderCursor (pScreen, x, y, w, h)
ScreenPtr pScreen;
int x, y, w, h;
{
rfbDCScreenPtr pScreenPriv;
PixmapPtr pSave;
WindowPtr pWin;
GCPtr pGC;
pScreenPriv = (rfbDCScreenPtr) pScreen->devPrivates[rfbDCScreenIndex].ptr;
pSave = pScreenPriv->pSave;
pWin = WindowTable[pScreen->myNum];
if (!pSave || pSave->drawable.width < w || pSave->drawable.height < h)
{
if (pSave)
(*pScreen->DestroyPixmap) (pSave);
pScreenPriv->pSave = pSave =
(*pScreen->CreatePixmap) (pScreen, w, h, pScreen->rootDepth);
if (!pSave)
return FALSE;
}
if (!EnsureGC(pScreenPriv->pSaveGC, pWin))
return FALSE;
pGC = pScreenPriv->pSaveGC;
if (pSave->drawable.serialNumber != pGC->serialNumber)
ValidateGC ((DrawablePtr) pSave, pGC);
(*pGC->ops->CopyArea) ((DrawablePtr) pWin, (DrawablePtr) pSave, pGC,
x, y, w, h, 0, 0);
return TRUE;
}
static Bool
rfbDCRestoreUnderCursor (pScreen, x, y, w, h)
ScreenPtr pScreen;
int x, y, w, h;
{
rfbDCScreenPtr pScreenPriv;
PixmapPtr pSave;
WindowPtr pWin;
GCPtr pGC;
pScreenPriv = (rfbDCScreenPtr) pScreen->devPrivates[rfbDCScreenIndex].ptr;
pSave = pScreenPriv->pSave;
pWin = WindowTable[pScreen->myNum];
if (!pSave)
return FALSE;
if (!EnsureGC(pScreenPriv->pRestoreGC, pWin))
return FALSE;
pGC = pScreenPriv->pRestoreGC;
if (pWin->drawable.serialNumber != pGC->serialNumber)
ValidateGC ((DrawablePtr) pWin, pGC);
(*pGC->ops->CopyArea) ((DrawablePtr) pSave, (DrawablePtr) pWin, pGC,
0, 0, w, h, x, y);
return TRUE;
}
--- NEW FILE: draw.c ---
/*
* draw.c - drawing routines for the RFB X server. This is a set of
* wrappers around the standard MI/MFB/CFB drawing routines which work out
* to a fair approximation the region of the screen being modified by the
* drawing. If the RFB client is ready then the modified region of the screen
* is sent to the client, otherwise the modified region will simply grow with
* each drawing request until the client is ready.
*/
/*
* Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
[...1837 lines suppressed...]
ScreenPtr pScreen;
RegionPtr reg;
{
int nrects = REGION_NUM_RECTS(reg);
int i;
rfbLog("Region num rects %d extents %d,%d %d,%d\n",nrects,
(REGION_EXTENTS(pScreen,reg))->x1,
(REGION_EXTENTS(pScreen,reg))->y1,
(REGION_EXTENTS(pScreen,reg))->x2,
(REGION_EXTENTS(pScreen,reg))->y2);
for (i = 0; i < nrects; i++) {
rfbLog(" rect %d,%d %dx%d\n",
REGION_RECTS(reg)[i].x1,
REGION_RECTS(reg)[i].y1,
REGION_RECTS(reg)[i].x2-REGION_RECTS(reg)[i].x1,
REGION_RECTS(reg)[i].y2-REGION_RECTS(reg)[i].y1);
}
}
--- NEW FILE: hextile.c ---
/*
* hextile.c
*
* Routines to implement Hextile Encoding
*/
/*
* Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
*/
#include <stdio.h>
#include "rfb.h"
static Bool sendHextiles8(rfbClientPtr cl, int x, int y, int w, int h);
static Bool sendHextiles16(rfbClientPtr cl, int x, int y, int w, int h);
static Bool sendHextiles32(rfbClientPtr cl, int x, int y, int w, int h);
/*
* rfbSendRectEncodingHextile - send a rectangle using hextile encoding.
*/
Bool
rfbSendRectEncodingHextile(cl, x, y, w, h)
rfbClientPtr cl;
int x, y, w, h;
{
rfbFramebufferUpdateRectHeader rect;
if (ublen + sz_rfbFramebufferUpdateRectHeader > UPDATE_BUF_SIZE) {
if (!rfbSendUpdateBuf(cl))
return FALSE;
}
rect.r.x = Swap16IfLE(x);
rect.r.y = Swap16IfLE(y);
rect.r.w = Swap16IfLE(w);
rect.r.h = Swap16IfLE(h);
rect.encoding = Swap32IfLE(rfbEncodingHextile);
memcpy(&updateBuf[ublen], (char *)&rect,
sz_rfbFramebufferUpdateRectHeader);
ublen += sz_rfbFramebufferUpdateRectHeader;
cl->rfbRectanglesSent[rfbEncodingHextile]++;
cl->rfbBytesSent[rfbEncodingHextile] += sz_rfbFramebufferUpdateRectHeader;
switch (cl->format.bitsPerPixel) {
case 8:
return sendHextiles8(cl, x, y, w, h);
case 16:
return sendHextiles16(cl, x, y, w, h);
case 32:
return sendHextiles32(cl, x, y, w, h);
}
rfbLog("rfbSendRectEncodingHextile: bpp %d?\n", cl->format.bitsPerPixel);
return FALSE;
}
#define PUT_PIXEL8(pix) (updateBuf[ublen++] = (pix))
#define PUT_PIXEL16(pix) (updateBuf[ublen++] = ((char*)&(pix))[0], \
updateBuf[ublen++] = ((char*)&(pix))[1])
#define PUT_PIXEL32(pix) (updateBuf[ublen++] = ((char*)&(pix))[0], \
updateBuf[ublen++] = ((char*)&(pix))[1], \
updateBuf[ublen++] = ((char*)&(pix))[2], \
updateBuf[ublen++] = ((char*)&(pix))[3])
#define DEFINE_SEND_HEXTILES(bpp) \
\
\
static Bool subrectEncode##bpp(CARD##bpp *data, int w, int h, CARD##bpp bg, \
CARD##bpp fg, Bool mono); \
static void testColours##bpp(CARD##bpp *data, int size, Bool *mono, \
Bool *solid, CARD##bpp *bg, CARD##bpp *fg); \
\
\
/* \
* rfbSendHextiles \
*/ \
\
static Bool \
sendHextiles##bpp(cl, rx, ry, rw, rh) \
rfbClientPtr cl; \
int rx, ry, rw, rh; \
{ \
int x, y, w, h; \
int startUblen; \
char *fbptr; \
CARD##bpp bg, fg, newBg, newFg; \
Bool mono, solid; \
Bool validBg = FALSE; \
Bool validFg = FALSE; \
CARD##bpp clientPixelData[16*16*(bpp/8)]; \
\
for (y = ry; y < ry+rh; y += 16) { \
for (x = rx; x < rx+rw; x += 16) { \
w = h = 16; \
if (rx+rw - x < 16) \
w = rx+rw - x; \
if (ry+rh - y < 16) \
h = ry+rh - y; \
\
if ((ublen + 1 + (2 + 16 * 16) * (bpp/8)) > UPDATE_BUF_SIZE) { \
if (!rfbSendUpdateBuf(cl)) \
return FALSE; \
} \
\
fbptr = (rfbScreen.pfbMemory + (rfbScreen.paddedWidthInBytes * y) \
+ (x * (rfbScreen.bitsPerPixel / 8))); \
\
(*cl->translateFn)(cl->translateLookupTable, &rfbServerFormat, \
&cl->format, fbptr, (char *)clientPixelData, \
rfbScreen.paddedWidthInBytes, w, h); \
\
startUblen = ublen; \
updateBuf[startUblen] = 0; \
ublen++; \
\
testColours##bpp(clientPixelData, w * h, \
&mono, &solid, &newBg, &newFg); \
\
if (!validBg || (newBg != bg)) { \
validBg = TRUE; \
bg = newBg; \
updateBuf[startUblen] |= rfbHextileBackgroundSpecified; \
PUT_PIXEL##bpp(bg); \
} \
\
if (solid) { \
cl->rfbBytesSent[rfbEncodingHextile] += ublen - startUblen; \
continue; \
} \
\
updateBuf[startUblen] |= rfbHextileAnySubrects; \
\
if (mono) { \
if (!validFg || (newFg != fg)) { \
validFg = TRUE; \
fg = newFg; \
updateBuf[startUblen] |= rfbHextileForegroundSpecified; \
PUT_PIXEL##bpp(fg); \
} \
} else { \
validFg = FALSE; \
updateBuf[startUblen] |= rfbHextileSubrectsColoured; \
} \
\
if (!subrectEncode##bpp(clientPixelData, w, h, bg, fg, mono)) { \
/* encoding was too large, use raw */ \
validBg = FALSE; \
validFg = FALSE; \
ublen = startUblen; \
updateBuf[ublen++] = rfbHextileRaw; \
(*cl->translateFn)(cl->translateLookupTable, \
&rfbServerFormat, &cl->format, fbptr, \
(char *)clientPixelData, \
rfbScreen.paddedWidthInBytes, w, h); \
\
memcpy(&updateBuf[ublen], (char *)clientPixelData, \
w * h * (bpp/8)); \
\
ublen += w * h * (bpp/8); \
} \
\
cl->rfbBytesSent[rfbEncodingHextile] += ublen - startUblen; \
} \
} \
\
return TRUE; \
} \
\
\
static Bool \
subrectEncode##bpp(CARD##bpp *data, int w, int h, CARD##bpp bg, \
CARD##bpp fg, Bool mono) \
{ \
CARD##bpp cl; \
int x,y; \
int i,j; \
int hx=0,hy,vx=0,vy; \
int hyflag; \
CARD##bpp *seg; \
CARD##bpp *line; \
int hw,hh,vw,vh; \
int thex,they,thew,theh; \
int numsubs = 0; \
int newLen; \
int nSubrectsUblen; \
\
nSubrectsUblen = ublen; \
ublen++; \
\
for (y=0; y<h; y++) { \
line = data+(y*w); \
for (x=0; x<w; x++) { \
if (line[x] != bg) { \
cl = line[x]; \
hy = y-1; \
hyflag = 1; \
for (j=y; j<h; j++) { \
seg = data+(j*w); \
if (seg[x] != cl) {break;} \
i = x; \
while ((seg[i] == cl) && (i < w)) i += 1; \
i -= 1; \
if (j == y) vx = hx = i; \
if (i < vx) vx = i; \
if ((hyflag > 0) && (i >= hx)) { \
hy += 1; \
} else { \
hyflag = 0; \
} \
} \
vy = j-1; \
\
/* We now have two possible subrects: (x,y,hx,hy) and \
* (x,y,vx,vy). We'll choose the bigger of the two. \
*/ \
hw = hx-x+1; \
hh = hy-y+1; \
vw = vx-x+1; \
vh = vy-y+1; \
\
thex = x; \
they = y; \
\
if ((hw*hh) > (vw*vh)) { \
thew = hw; \
theh = hh; \
} else { \
thew = vw; \
theh = vh; \
} \
\
if (mono) { \
newLen = ublen - nSubrectsUblen + 2; \
} else { \
newLen = ublen - nSubrectsUblen + bpp/8 + 2; \
} \
\
if (newLen > (w * h * (bpp/8))) \
return FALSE; \
\
numsubs += 1; \
\
if (!mono) PUT_PIXEL##bpp(cl); \
\
updateBuf[ublen++] = rfbHextilePackXY(thex,they); \
updateBuf[ublen++] = rfbHextilePackWH(thew,theh); \
\
/* \
* Now mark the subrect as done. \
*/ \
for (j=they; j < (they+theh); j++) { \
for (i=thex; i < (thex+thew); i++) { \
data[j*w+i] = bg; \
} \
} \
} \
} \
} \
\
updateBuf[nSubrectsUblen] = numsubs; \
\
return TRUE; \
} \
\
\
/* \
* testColours() tests if there are one (solid), two (mono) or more \
* colours in a tile and gets a reasonable guess at the best background \
* pixel, and the foreground pixel for mono. \
*/ \
\
static void \
testColours##bpp(data,size,mono,solid,bg,fg) \
CARD##bpp *data; \
int size; \
Bool *mono; \
Bool *solid; \
CARD##bpp *bg; \
CARD##bpp *fg; \
{ \
CARD##bpp colour1, colour2; \
int n1 = 0, n2 = 0; \
*mono = TRUE; \
*solid = TRUE; \
\
for (; size > 0; size--, data++) { \
\
if (n1 == 0) \
colour1 = *data; \
\
if (*data == colour1) { \
n1++; \
continue; \
} \
\
if (n2 == 0) { \
*solid = FALSE; \
colour2 = *data; \
} \
\
if (*data == colour2) { \
n2++; \
continue; \
} \
\
*mono = FALSE; \
break; \
} \
\
if (n1 > n2) { \
*bg = colour1; \
*fg = colour2; \
} else { \
*bg = colour2; \
*fg = colour1; \
} \
}
DEFINE_SEND_HEXTILES(8)
DEFINE_SEND_HEXTILES(16)
DEFINE_SEND_HEXTILES(32)
--- NEW FILE: httpd.c ---
/*
* httpd.c - a simple HTTP server
*/
/*
* Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
*/
#include <stdio.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <netdb.h>
#include <fcntl.h>
#include <errno.h>
#include <pwd.h>
#include "rfb.h"
#define NOT_FOUND_STR "HTTP/1.0 404 Not found\n\n" \
"<HEAD><TITLE>File Not Found</TITLE></HEAD>\n" \
"<BODY><H1>File Not Found</H1></BODY>\n"
#define OK_STR "HTTP/1.0 200 OK\n\n"
static void httpProcessInput();
static Bool compareAndSkip(char **ptr, const char *str);
int httpPort = 0;
char *httpDir = NULL;
int httpListenSock = -1;
int httpSock = -1;
FILE* httpFP = NULL;
#define BUF_SIZE 32768
static char buf[BUF_SIZE];
/*
* httpInitSockets sets up the TCP socket to listen for HTTP connections.
*/
void
httpInitSockets()
{
static Bool done = FALSE;
if (done)
return;
done = TRUE;
if (!httpDir)
return;
if (httpPort == 0) {
httpPort = 5800 + atoi(display);
}
rfbLog("Listening for HTTP connections on TCP port %d\n", httpPort);
rfbLog(" URL http://%s:%d\n",rfbThisHost,httpPort);
if ((httpListenSock = ListenOnTCPPort(httpPort)) < 0) {
rfbLogPerror("ListenOnTCPPort");
exit(1);
}
AddEnabledDevice(httpListenSock);
}
/*
* httpCheckFds is called from ProcessInputEvents to check for input on the
* HTTP socket(s). If there is input to process, httpProcessInput is called.
*/
void
httpCheckFds()
{
int nfds, n;
fd_set fds;
struct timeval tv;
struct sockaddr_in addr;
int addrlen = sizeof(addr);
if (!httpDir)
return;
FD_ZERO(&fds);
FD_SET(httpListenSock, &fds);
if (httpSock >= 0) {
FD_SET(httpSock, &fds);
}
tv.tv_sec = 0;
tv.tv_usec = 0;
nfds = select(max(httpSock,httpListenSock) + 1, &fds, NULL, NULL, &tv);
if (nfds == 0) {
return;
}
if (nfds < 0) {
rfbLogPerror("httpCheckFds: select");
return;
}
if ((httpSock >= 0) && FD_ISSET(httpSock, &fds)) {
httpProcessInput();
}
if (FD_ISSET(httpListenSock, &fds)) {
if (httpSock >= 0) close(httpSock);
if ((httpSock = accept(httpListenSock,
(struct sockaddr *)&addr, &addrlen)) < 0) {
rfbLogPerror("httpCheckFds: accept");
return;
}
if ((httpFP = fdopen(httpSock, "r+")) == NULL) {
rfbLogPerror("httpCheckFds: fdopen");
close(httpSock);
httpSock = -1;
return;
}
AddEnabledDevice(httpSock);
}
}
static void
httpCloseSock()
{
fclose(httpFP);
httpFP = NULL;
RemoveEnabledDevice(httpSock);
httpSock = -1;
}
/*
* httpProcessInput is called when input is received on the HTTP socket.
*/
static void
httpProcessInput()
{
struct sockaddr_in addr;
int addrlen = sizeof(addr);
char fullFname[256];
char *fname;
int maxFnameLen;
int fd;
Bool gotGet = FALSE;
Bool performSubstitutions = FALSE;
char str[256];
struct passwd *user = getpwuid(getuid());;
if (strlen(httpDir) > 200) {
rfbLog("-httpd directory too long\n");
httpCloseSock();
return;
}
strcpy(fullFname, httpDir);
fname = &fullFname[strlen(fullFname)];
maxFnameLen = 255 - strlen(fullFname);
buf[0] = '\0';
while (1) {
/* Read lines from the HTTP client until a blank line. The only
line we need to parse is the line "GET <filename> ..." */
if (!fgets(buf, BUF_SIZE, httpFP)) {
rfbLogPerror("httpProcessInput: fgets");
httpCloseSock();
return;
}
if ((strcmp(buf,"\n") == 0) || (strcmp(buf,"\r\n") == 0)
|| (strcmp(buf,"\r") == 0) || (strcmp(buf,"\n\r") == 0))
/* end of client request */
break;
if (strncmp(buf, "GET ", 4) == 0) {
gotGet = TRUE;
if (strlen(buf) > maxFnameLen) {
rfbLog("GET line too long\n");
httpCloseSock();
return;
}
if (sscanf(buf, "GET %s HTTP/1.0", fname) != 1) {
rfbLog("couldn't parse GET line\n");
httpCloseSock();
return;
}
if (fname[0] != '/') {
rfbLog("filename didn't begin with '/'\n");
WriteExact(httpSock, NOT_FOUND_STR, strlen(NOT_FOUND_STR));
httpCloseSock();
return;
}
if (strchr(fname+1, '/') != NULL) {
rfbLog("asking for file in other directory\n");
WriteExact(httpSock, NOT_FOUND_STR, strlen(NOT_FOUND_STR));
httpCloseSock();
return;
}
getpeername(httpSock, (struct sockaddr *)&addr, &addrlen);
rfbLog("httpd: get '%s' for %s\n", fname+1,
inet_ntoa(addr.sin_addr));
continue;
}
}
if (!gotGet) {
rfbLog("no GET line\n");
httpCloseSock();
return;
}
/* If we were asked for '/', actually read the file index.vnc */
if (strcmp(fname, "/") == 0) {
strcpy(fname, "/index.vnc");
rfbLog("httpd: defaulting to '%s'\n", fname+1);
}
/* Substitutions are performed on files ending .vnc */
if (strlen(fname) >= 4 && strcmp(&fname[strlen(fname)-4], ".vnc") == 0) {
performSubstitutions = TRUE;
}
/* Open the file */
if ((fd = open(fullFname, O_RDONLY)) < 0) {
rfbLogPerror("httpProcessInput: open");
WriteExact(httpSock, NOT_FOUND_STR, strlen(NOT_FOUND_STR));
httpCloseSock();
return;
}
WriteExact(httpSock, OK_STR, strlen(OK_STR));
while (1) {
int n = read(fd, buf, BUF_SIZE-1);
if (n < 0) {
rfbLogPerror("httpProcessInput: read");
close(fd);
httpCloseSock();
return;
}
if (n == 0)
break;
if (performSubstitutions) {
/* Substitute $WIDTH, $HEIGHT, etc with the appropriate values.
This won't quite work properly if the .vnc file is longer than
BUF_SIZE, but it's reasonable to assume that .vnc files will
always be short. */
char *ptr = buf;
char *dollar;
buf[n] = 0; /* make sure it's null-terminated */
while (dollar = strchr(ptr, '$')) {
WriteExact(httpSock, ptr, (dollar - ptr));
ptr = dollar;
if (compareAndSkip(&ptr, "$WIDTH")) {
sprintf(str, "%d", rfbScreen.width);
WriteExact(httpSock, str, strlen(str));
} else if (compareAndSkip(&ptr, "$HEIGHT")) {
sprintf(str, "%d", rfbScreen.height);
WriteExact(httpSock, str, strlen(str));
} else if (compareAndSkip(&ptr, "$APPLETWIDTH")) {
sprintf(str, "%d", rfbScreen.width);
WriteExact(httpSock, str, strlen(str));
} else if (compareAndSkip(&ptr, "$APPLETHEIGHT")) {
sprintf(str, "%d", rfbScreen.height + 32);
WriteExact(httpSock, str, strlen(str));
} else if (compareAndSkip(&ptr, "$PORT")) {
sprintf(str, "%d", rfbPort);
WriteExact(httpSock, str, strlen(str));
} else if (compareAndSkip(&ptr, "$DESKTOP")) {
WriteExact(httpSock, desktopName, strlen(desktopName));
} else if (compareAndSkip(&ptr, "$DISPLAY")) {
sprintf(str, "%s:%s", rfbThisHost, display);
WriteExact(httpSock, str, strlen(str));
} else if (compareAndSkip(&ptr, "$USER")) {
if (user) {
WriteExact(httpSock, user->pw_name,
strlen(user->pw_name));
} else {
WriteExact(httpSock, "?", 1);
}
} else {
if (!compareAndSkip(&ptr, "$$"))
ptr++;
if (WriteExact(httpSock, "$", 1) < 0) {
close(fd);
httpCloseSock();
return;
}
}
}
if (WriteExact(httpSock, ptr, (&buf[n] - ptr)) < 0)
break;
} else {
/* For files not ending .vnc, just write out the buffer */
if (WriteExact(httpSock, buf, n) < 0)
break;
}
}
close(fd);
httpCloseSock();
}
static Bool
compareAndSkip(char **ptr, const char *str)
{
if (strncmp(*ptr, str, strlen(str)) == 0) {
*ptr += strlen(str);
return TRUE;
}
return FALSE;
}
--- NEW FILE: init.c ---
/*
* init.c
*/
/*
* Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
*/
/*
Copyright (c) 1993 X Consortium
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of the X Consortium shall
not be used in advertising or otherwise to promote the sale, use or
other dealings in this Software without prior written authorization
from the X Consortium.
*/
/* Use ``#define CORBA'' to enable CORBA control interface */
#include <stdio.h>
#include <stdarg.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include "X11/X.h"
#define NEED_EVENTS
#include "X11/Xproto.h"
#include "X11/Xos.h"
#include "scrnintstr.h"
#include "servermd.h"
#define PSZ 8
#include "cfb.h"
#include "mibstore.h"
#include "colormapst.h"
#include "gcstruct.h"
#include "input.h"
#include "mipointer.h"
#include "dixstruct.h"
#include "propertyst.h"
#include <Xatom.h>
#include <errno.h>
#include <sys/param.h>
#include "dix.h"
#include "rfb.h"
#ifdef CORBA
#include <vncserverctrl.h>
#endif
#define RFB_DEFAULT_WIDTH 640
#define RFB_DEFAULT_HEIGHT 480
#define RFB_DEFAULT_DEPTH 8
#define RFB_DEFAULT_WHITEPIXEL 0
#define RFB_DEFAULT_BLACKPIXEL 1
rfbScreenInfo rfbScreen;
int rfbGCIndex;
static Bool initOutputCalled = FALSE;
static Bool noCursor = FALSE;
char *desktopName = "x11";
char rfbThisHost[256];
Atom VNC_LAST_CLIENT_ID;
Atom VNC_CONNECT;
static HWEventQueueType alwaysCheckForInput[2] = { 0, 1 };
static HWEventQueueType *mieqCheckForInput[2];
static char primaryOrder[4] = "";
static int redBits, greenBits, blueBits;
static Bool rfbScreenInit(int index, ScreenPtr pScreen, int argc,
char **argv);
static int rfbKeybdProc(DeviceIntPtr pDevice, int onoff);
static int rfbMouseProc(DeviceIntPtr pDevice, int onoff);
static Bool CheckDisplayNumber(int n);
static Bool rfbAlwaysTrue();
static char *rfbAllocateFramebufferMemory(rfbScreenInfoPtr prfb);
static Bool rfbCursorOffScreen(ScreenPtr *ppScreen, int *x, int *y);
static void rfbCrossScreen(ScreenPtr pScreen, Bool entering);
static void rfbClientStateChange(CallbackListPtr *, pointer myData,
pointer client);
static miPointerScreenFuncRec rfbPointerCursorFuncs = {
rfbCursorOffScreen,
rfbCrossScreen,
miPointerWarpCursor
};
int inetdSock = -1;
static char inetdDisplayNumStr[10];
/*
* ddxProcessArgument is our first entry point and will be called at the
* very start for each argument. It is not called again on server reset.
*/
int
ddxProcessArgument (argc, argv, i)
int argc;
char *argv[];
int i;
{
static Bool firstTime = TRUE;
if (firstTime)
{
rfbScreen.width = RFB_DEFAULT_WIDTH;
rfbScreen.height = RFB_DEFAULT_HEIGHT;
rfbScreen.depth = RFB_DEFAULT_DEPTH;
rfbScreen.blackPixel = RFB_DEFAULT_BLACKPIXEL;
rfbScreen.whitePixel = RFB_DEFAULT_WHITEPIXEL;
rfbScreen.pfbMemory = NULL;
gethostname(rfbThisHost, 255);
firstTime = FALSE;
}
if (strcmp (argv[i], "-geometry") == 0) /* -geometry WxH */
{
if (i + 1 >= argc) UseMsg();
if (sscanf(argv[i+1],"%dx%d",
&rfbScreen.width,&rfbScreen.height) != 2) {
ErrorF("Invalid geometry %s\n", argv[i+1]);
UseMsg();
}
#ifdef CORBA
screenWidth= rfbScreen.width;
screenHeight= rfbScreen.height;
#endif
return 2;
}
if (strcmp (argv[i], "-depth") == 0) /* -depth D */
{
if (i + 1 >= argc) UseMsg();
rfbScreen.depth = atoi(argv[i+1]);
#ifdef CORBA
screenDepth= rfbScreen.depth;
#endif
return 2;
}
if (strcmp (argv[i], "-pixelformat") == 0) {
if (i + 1 >= argc) UseMsg();
if (sscanf(argv[i+1], "%3s%1d%1d%1d", prima...
[truncated message content] |
|
From: Cees de G. <cde...@us...> - 2002-10-07 20:29:52
|
Update of /cvsroot/squeak/squeak/platforms/unix/misc/rfb In directory usw-pr-cvs1:/tmp/cvs-serv20511/rfb Log Message: Directory /cvsroot/squeak/squeak/platforms/unix/misc/rfb added to the repository --> Using per-directory sticky tag `cg_unix_rfb_server' |
Update of /cvsroot/squeak/squeak/platforms/Cross/plugins/RePlugin In directory usw-pr-cvs1:/tmp/cvs-serv23862 Added Files: chartables.c config.h get.c internal.h oldInternal.h pcre.c pcre.h rePlugin.h study.c Log Message: Merge into trunk. |
|
From: John M M. <jo...@us...> - 2002-09-30 23:54:27
|
Update of /cvsroot/squeak/squeak/platforms/Mac OS/vm
In directory usw-pr-cvs1:/tmp/cvs-serv25674/squeak/platforms/Mac OS/vm
Modified Files:
sqMacMain.c
Log Message:
3.2.8b8 added argc argv env variables for UnixOSProcessPlugin
Index: sqMacMain.c
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/Mac OS/vm/sqMacMain.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** sqMacMain.c 17 Aug 2002 16:46:56 -0000 1.11
--- sqMacMain.c 30 Sep 2002 23:54:23 -0000 1.12
***************
*** 122,126 ****
--- 122,135 ----
#ifndef PLUGIN
+ #if defined ( __APPLE__ ) && defined ( __MACH__ )
+ /*** Variables -- globals for access from pluggable primitives ***/
+ int argCnt= 0;
+ char **argVec= 0;
+ char **envVec= 0;
+
+ int main(int argc, char **argv, char **envp) {
+ #else
int main(void) {
+ #endif
EventRecord theEvent;
sqImageFile f;
***************
*** 138,141 ****
--- 147,157 ----
error("This C compiler's time_t's are not 32 bits.");
}
+
+ #if defined ( __APPLE__ ) && defined ( __MACH__ )
+ /* Make parameters global for access from pluggable primitives */
+ argCnt= argc;
+ argVec= argv;
+ envVec= envp;
+ #endif
InitMacintosh();
|
|
From: John M M. <jo...@us...> - 2002-09-27 20:00:44
|
Update of /cvsroot/squeak/squeak/platforms/Mac OS/vm
In directory usw-pr-cvs1:/tmp/cvs-serv14527/squeak/platforms/Mac OS/vm
Modified Files:
sqMacUIMenuBar.c
Log Message:
3.2.8b8 Jaguar 10.2 broke how menubars are hidden/shown on cmd-tab. This is a 10.2 bug, a fix has been made to work around the bug. Should be backwards compatible with 10.1.x
Index: sqMacUIMenuBar.c
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/Mac OS/vm/sqMacUIMenuBar.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** sqMacUIMenuBar.c 23 Feb 2002 11:26:06 -0000 1.2
--- sqMacUIMenuBar.c 27 Sep 2002 20:00:41 -0000 1.3
***************
*** 37,40 ****
--- 37,41 ----
if (menuBarRegion != nil) return; /* saved state, so menu bar is already hidden */
menuBarRegion = (RgnHandle) 1;
+ ShowMenuBar();
HideMenuBar();
}
|