RemoteFrameBuffer running on 3.9

Brad Fuller brad at bradfuller.com
Sat Feb 17 00:35:43 UTC 2007


I don't know if this is the right way to do it, but the following code 
makes RFB work for v3.9, thanks to Norbert.

If it is correct (and the seaside people should know this since they are 
mostly using v3.9), shouldn't this be used to create an updated version 
of RFB?

brad


Norbert Hartl wrote:
> Hi,
>
> this is my first post to this list. I don't know 
> if this is the right place to write. I tried the
> RemoteFrameBuffer package from SqueakMap. It didn't
> work. I needed only to change a few things to get
> it running. I hope this changes are right.
>
> I don't know the usual procedure to do notification
> of bugs/applying code, etc. So I attach the changeset
> to this mail. Maybe it is of interest for anyone.
>
> regards,
>
> Norbert
>   
> ------------------------------------------------------------------------
>
> 'From Squeak3.9 of 7 November 2006 [latest update: #7067] on 18 January 2007 at 9:26:45 pm'!
> !RFBPixelFormat methodsFor: 'private' stamp: 'noha 1/18/2007 21:21'!
> setOrderMap: serverFormat
> 	"Set the ColorMap used to convert local byte order to viewer byte order.  This map is effective only when sending an entire Bitmap to the remote viewer.  (Individual pixel values are always sent in big-endian order; see RFBStream{16,32}>>nextPutPixel:.)"
> 	orderMap _ bigEndian == SmalltalkImage current isBigEndian	"no map if byte order is commensurate"
> 		ifFalse:
> 			[bitsPerPixel == 16
> 				ifTrue: [ColorMap
> 							masks: #(16r00FF 16rFF00 0 0)
> 							shifts: #(8 -8 0 0)]
> 				ifFalse: [bitsPerPixel == 32
> 					ifTrue: [ColorMap
> 								masks: #(16r000000FF 16r0000FF00 16r00FF0000 16rFF000000)
> 								shifts: #(24 8 -8 -24)]]]! !
> !RFBPixelFormat class methodsFor: 'instance creation' stamp: 'noha 1/18/2007 21:17'!
> forForm: aForm
> 	"Answer a pixel format describing the pixels in aForm, in host byte order."
> 	^self new forForm: aForm bigEndian: SmalltalkImage current isBigEndian! !
> !RFBSession methodsFor: 'private' stamp: 'noha 1/18/2007 21:20'!
> desktopName
> 	"Answer the name of the desktop, constructed from the image, host and platform names."
> 	"RFBSession new desktopName"
> 	^String streamContents: [:stream |
> 		stream
> 			nextPutAll: (FileDirectory default localNameFor: SmalltalkImage current imageName);
> 			nextPut: $@;
> 			nextPutAll: server localHostName;
> 			nextPutAll: ' [';
> 			nextPutAll: SmalltalkImage current platformName; space; nextPutAll: SmalltalkImage current osVersion;
> 			nextPut: $].
> 		interactive ifFalse: [stream nextPutAll: ' - view only']]! !
> ------------------------------------------------------------------------
>
>
>   


-- 
brad fuller
www.bradfuller.com
+1 (408) 799-6124

-------------- next part --------------
'From Squeak3.9 of 7 November 2006 [latest update: #7067] on 18 January 2007 at 9:26:45 pm'!
!RFBPixelFormat methodsFor: 'private' stamp: 'noha 1/18/2007 21:21'!
setOrderMap: serverFormat
	"Set the ColorMap used to convert local byte order to viewer byte order.  This map is effective only when sending an entire Bitmap to the remote viewer.  (Individual pixel values are always sent in big-endian order; see RFBStream{16,32}>>nextPutPixel:.)"
	orderMap _ bigEndian == SmalltalkImage current isBigEndian	"no map if byte order is commensurate"
		ifFalse:
			[bitsPerPixel == 16
				ifTrue: [ColorMap
							masks: #(16r00FF 16rFF00 0 0)
							shifts: #(8 -8 0 0)]
				ifFalse: [bitsPerPixel == 32
					ifTrue: [ColorMap
								masks: #(16r000000FF 16r0000FF00 16r00FF0000 16rFF000000)
								shifts: #(24 8 -8 -24)]]]! !
!RFBPixelFormat class methodsFor: 'instance creation' stamp: 'noha 1/18/2007 21:17'!
forForm: aForm
	"Answer a pixel format describing the pixels in aForm, in host byte order."
	^self new forForm: aForm bigEndian: SmalltalkImage current isBigEndian! !
!RFBSession methodsFor: 'private' stamp: 'noha 1/18/2007 21:20'!
desktopName
	"Answer the name of the desktop, constructed from the image, host and platform names."
	"RFBSession new desktopName"
	^String streamContents: [:stream |
		stream
			nextPutAll: (FileDirectory default localNameFor: SmalltalkImage current imageName);
			nextPut: $@;
			nextPutAll: server localHostName;
			nextPutAll: ' [';
			nextPutAll: SmalltalkImage current platformName; space; nextPutAll: SmalltalkImage current osVersion;
			nextPut: $].
		interactive ifFalse: [stream nextPutAll: ' - view only']]! !


More information about the Squeak-dev mailing list