[HACK] Fade into Squeak
Bert Freudenberg
bert at isgnw.CS.Uni-Magdeburg.De
Tue May 23 20:21:13 UTC 2000
This changeset demonstrates STP's idea for fading into Squeak on start up.
The screen capturing uses an external tool. If there's a file named
sqbgtemp.gif in the image directory, load it, fade it to black, and
delete the file.
On Unix, you can use xwd and netpbm to capture the screen:
xwd -root -silent | xwdtopnm | ppmtogif > sqbgtemp.gif
squeak -fullscreen some.image
For other platforms, you're on your own ;-)
-- Bert
PS: I slightly modified the Unix VM to not clear the window on startup if
fullscreen, a patch is attached.
-------------- next part --------------
'From Squeak2.8alpha of 18 January 2000 [latest update: #2158] on 23 May 2000 at 9:25:53 pm'!
"Change Set: fadesqueak-bf
Date: 23 May 2000
Author: Bert Freudenberg
This changeset demonstrates STP's idea for fading into Squeak on start up. The screen capturing uses an external tool. If there's a file named sqbgtemp.gif in the image directory, load it, fade it to black, and delete the file.
On Unix, you can use xwd and netpbm to capture the screen:
xwd -root -silent | xwdtopnm | ppmtogif > sqbgtemp.gif ; squeak -fullscreen some.image
Note that I modified the Unix VM to not clear the window on startup."!
!DisplayScreen class methodsFor: 'snapshots' stamp: 'bf 5/23/2000 18:15'!
fadeOut
"If there's a file named sqbgtemp.gif in the image directory, load it, fade it to black, and delete the file. Provided the file contained a current screenshot and Squeak is started up in fullscreen mode, this looks like fading into the Squeak screen.
On Unix, you can use xwd and netpbm:
xwd -root -silent | xwdtopnm | ppmtogif > sqbgtemp.gif ; squeak -fullscreen some.image
"
| file form map t d s |
file _ FileStream oldFileOrNoneNamed: 'sqbgtemp.gif'.
file ifNil: [^self].
[ form _ GIFReadWriter formFromStream: file.
map _ form colors copy.
d _ 2000. "duration in ms"
s _ Time millisecondClockValue.
[t _ Time millisecondsSince: s. t < d] whileTrue: [
form colors: (map collect: [:c | Color black mixed: t/d with: c]).
form display].
form _ nil.
] ensure: [file close].
FileDirectory default deleteFileNamed: 'sqbgtemp.gif' ifAbsent: []! !
!DisplayScreen class methodsFor: 'snapshots' stamp: 'bf 5/23/2000 13:11'!
startUp: resuming "DisplayScreen startUp: true"
self startUp.
resuming ifTrue: [self fadeOut]! !
-------------- next part --------------
*** /home/bert/Squeak/2.8a.ian/src/sqXWindow.c Sat May 20 00:31:08 2000
--- /home/bert/sqXWindow.c Tue May 23 21:31:06 2000
***************
*** 410,415 ****
--- 410,417 ----
SetUpPixmap();
SetWindowSize();
XMapWindow(stDisplay, stWindow);
+ if (fullScreen)
+ ioSetFullScreen(true);
isConnectedToXServer= 1;
}
return 0;
***************
*** 1102,1113 ****
XSetWindowAttributes attributes;
unsigned long valuemask;
- attributes.border_pixel= BlackPixel(stDisplay, DefaultScreen(stDisplay));
- attributes.background_pixel= BlackPixel(stDisplay, DefaultScreen(stDisplay));
attributes.event_mask= EVENTMASK;
attributes.backing_store= Always;
! valuemask= CWEventMask | CWBackingStore | CWBorderPixel | CWBackPixel;
/* A visual that is not DefaultVisual requires its own color map.
If visual is PseudoColor, the new color map is made elsewhere. */
--- 1078,1092 ----
XSetWindowAttributes attributes;
unsigned long valuemask;
attributes.event_mask= EVENTMASK;
attributes.backing_store= Always;
+ valuemask= CWEventMask | CWBackingStore;
! if (!fullScreen) {
! attributes.border_pixel= BlackPixel(stDisplay, DefaultScreen(stDisplay));
! attributes.background_pixel= BlackPixel(stDisplay, DefaultScreen(stDisplay));
! valuemask |= CWBorderPixel | CWBackPixel;
! }
/* A visual that is not DefaultVisual requires its own color map.
If visual is PseudoColor, the new color map is made elsewhere. */
More information about the Squeak-dev
mailing list
|