[squeak-dev] The Trunk: Graphics-bf.189.mcz

Chris Muller asqueaker at gmail.com
Fri Jan 6 04:49:13 UTC 2012


Wow, you'd been holding back..!

On Thu, Jan 5, 2012 at 11:49 AM,  <commits at source.squeak.org> wrote:
> Bert Freudenberg uploaded a new version of Graphics to project The Trunk:
> http://source.squeak.org/trunk/Graphics-bf.189.mcz
>
> ==================== Summary ====================
>
> Name: Graphics-bf.189
> Author: bf
> Time: 5 January 2012, 6:49:09.36 pm
> UUID: d007ccad-e223-498d-9e78-bfc861403099
> Ancestors: Graphics-bf.188
>
> Add host window support. This is based on the stubs found in Pharo, with various fixes and extensions by me. In particular, I added event handling support. See examplePaint in DisplayHostWindow class.
>
> =============== Diff against Graphics-bf.188 ===============
>
> Item was changed:
>  SystemOrganization addCategory: #'Graphics-Display Objects'!
>  SystemOrganization addCategory: #'Graphics-Files'!
>  SystemOrganization addCategory: #'Graphics-Fonts'!
>  SystemOrganization addCategory: #'Graphics-Primitives'!
>  SystemOrganization addCategory: #'Graphics-Text'!
>  SystemOrganization addCategory: #'Graphics-Transformations'!
> + SystemOrganization addCategory: #'Graphics-External-Ffenestri'!
>
> Item was added:
> + DisplayScreen subclass: #DisplayHostWindow
> +       instanceVariableNames: 'windowProxy title windowType eventQueue'
> +       classVariableNames: ''
> +       poolDictionaries: 'EventSensorConstants'
> +       category: 'Graphics-External-Ffenestri'!
> +
> + !DisplayHostWindow commentStamp: '<historical>' prior: 0!
> + A subclass of DisplayScreen that uses a (platform appropriate) HostWindowProxy
> + to do its displaying in a separate host OS window. This is just one example of a
> + client for HostWindowProxy.
> + See #test #test2 and HostWindowTests for example usage.!
>
> Item was added:
> + ----- Method: DisplayHostWindow class>>examplePaint (in category 'examples') -----
> + examplePaint
> +       "DisplayHostWindow examplePaint inspect"
> +       "Should
> +               a) open a window
> +               b) fork a process to allow painting with mouse
> +               c) survive saving and re-opening the image
> +               d) close and terminate the process when clicking close box or pressing ESC or garbage collect
> +       This relies on the Morphic main loop repeatedly fetching events from Sensor.
> +       "
> +       | win evt pen |
> +       win := DisplayHostWindow extent: 400 at 400 depth: 32.
> +       win offset: 50 at 50; open; windowTitle: 'Paint Test'.
> +       pen := nil.
> +       [
> +               [win isOpen] whileTrue: [
> +                       evt := win nextEvent.
> +                       "check for ESC event"
> +                       ((evt at: 1) = EventTypeKeyboard and: [(evt at: 4) = EventKeyChar and: [(evt at: 3) = 27]])
> +                               ifTrue: [win close].
> +                       "process for mouse events"
> +                       (evt at: 1) = EventTypeMouse ifTrue: [
> +                               (evt at: 5) > 0 "button pressed"
> +                                       ifTrue: [
> +                                               pen ifNil: [
> +                                                       pen := Pen newOnForm: win.
> +                                                       pen roundNib: 5; color: Color random.
> +                                                       pen place: (evt at: 3)@(evt at: 4)].
> +                                               pen goto: (evt at: 3)@(evt at: 4)]
> +                                       ifFalse: [pen := nil]].
> +                       win forceToScreen.
> +               ].
> +       ] forkNamed: thisContext asString.
> +       ^win!
>
> Item was added:
> + ----- Method: DisplayHostWindow>>actualScreenSize (in category 'snapshots') -----
> + actualScreenSize
> + "return the host window size as if it were 'the' screen"
> +       ^self windowSize!
>
> Item was added:
> + ----- Method: DisplayHostWindow>>close (in category 'initialize-release') -----
> + close
> +       "close this window"
> +       windowProxy ifNil: [ ^ self error: 'cannot close never opened window' ].
> +       "We don't use 'self windowProxy close' here because if we've never setup the window why do it now only to close it immediately?"
> +       windowProxy close.
> +       windowProxy := nil!
>
> Item was added:
> + ----- Method: DisplayHostWindow>>eventQueue (in category 'accessing') -----
> + eventQueue
> +       ^eventQueue ifNil: [eventQueue := SharedQueue new]
> + !
>
> Item was added:
> + ----- Method: DisplayHostWindow>>forceToScreen (in category 'basic api') -----
> + forceToScreen
> +       "update the area defined by my bounds"
> +       self forceToScreen: self boundingBox!
>
> Item was added:
> + ----- Method: DisplayHostWindow>>forceToScreen: (in category 'basic api') -----
> + forceToScreen: damageRectangle
> +       "update the area defined by damageRectangle"
> +       windowProxy ifNotNil:[ windowProxy forceToScreen: damageRectangle]!
>
> Item was added:
> + ----- Method: DisplayHostWindow>>handleActivated (in category 'private-events') -----
> + handleActivated
> +       "window made active - some platforms only - do not rely upon this"!
>
> Item was added:
> + ----- Method: DisplayHostWindow>>handleClose (in category 'private-events') -----
> + handleClose
> +       "window close icon pressed"
> +
> +       self close.
> + !
>
> Item was added:
> + ----- Method: DisplayHostWindow>>handleIconise (in category 'private-events') -----
> + handleIconise
> +       "window iconised or hidden etc"!
>
> Item was added:
> + ----- Method: DisplayHostWindow>>handleMetricChange: (in category 'private-events') -----
> + handleMetricChange: aRectangle
> +       "size or position of window changed"
> +
> +       offset := aRectangle origin.
> +
> +       (width = aRectangle width and: [height = aRectangle height])
> +               ifFalse: [self setExtent: aRectangle extent depth: depth].
> + !
>
> Item was added:
> + ----- Method: DisplayHostWindow>>handlePaint: (in category 'private-events') -----
> + handlePaint: aRectangle
> +       "window area needs updating. Some platforms do not need to send this, do not rely on it in image"
> +
> +       self forceToScreen: aRectangle.
> + !
>
> Item was added:
> + ----- Method: DisplayHostWindow>>isOpen (in category 'accessing') -----
> + isOpen
> +       ^windowProxy notNil!
>
> Item was added:
> + ----- Method: DisplayHostWindow>>nextEvent (in category 'accessing') -----
> + nextEvent
> +       ^self eventQueue next!
>
> Item was added:
> + ----- Method: DisplayHostWindow>>nextEventOrNil (in category 'accessing') -----
> + nextEventOrNil
> +       ^self eventQueue nextOrNil!
>
> Item was added:
> + ----- Method: DisplayHostWindow>>open (in category 'initialize-release') -----
> + open
> +       "open the host window"
> +       windowProxy ifNil: [ windowProxy := HostWindowProxy on: self ].
> +       windowType ifNil: [ windowType := #defaultWindowType ].
> +       windowProxy perform: windowType.
> +       windowProxy open.
> +       title ifNotNil: [ windowProxy windowTitle: title ].
> + !
>
> Item was added:
> + ----- Method: DisplayHostWindow>>processEvent: (in category 'private-events') -----
> + processEvent: evt
> +       "evt is a raw event buffer from VM. Check for window events (close etc.). Queue events if queue exists"
> +       (evt at: 1) = EventTypeWindow
> +               ifTrue: [self processWindowEvent: evt].
> +       self queueEvent: evt.
> + !
>
> Item was added:
> + ----- Method: DisplayHostWindow>>processWindowEvent: (in category 'private-events') -----
> + processWindowEvent: evt
> +       (evt at: 3) caseOf: {
> +               [WindowEventMetricChange] -> [self handleMetricChange: ((evt at: 4)@(evt at: 5) corner: (evt at: 6)@(evt at: 7)) ].
> +               [WindowEventClose] ->    [self handleClose].
> +               [WindowEventIconise] -> [self handleIconise].
> +               [WindowEventActivated] -> [self handleActivated].
> +               [WindowEventPaint] -> [self handlePaint: ((evt at: 4)@(evt at: 5) corner: (evt at: 6)@(evt at: 7))].
> +       } otherwise: ["unknown"]
> + !
>
> Item was added:
> + ----- Method: DisplayHostWindow>>queueEvent: (in category 'private-events') -----
> + queueEvent: evt
> +       "Queue the given event in the event queue (if any).
> +       Note that the event buffer must be copied since it
> +       will be reused later on."
> +       eventQueue ifNil: [^self].      "queue gets created by client"
> +       eventQueue nextPut: evt clone.
> + !
>
> Item was added:
> + ----- Method: DisplayHostWindow>>resetProxy (in category 'snapshots') -----
> + resetProxy
> +       "private - for use when resuming a snapshot file only. If the windowProxy had previously been created, nil it and reopen cleanly. IF you try to use this in a 'live' system it will NOT close the windows since startup conditions assume that proxies are invalid so we don't attempt to close them - since that could cause other problems"
> +       windowProxy ifNotNil:
> +               [ windowProxy := nil.
> +               self open ]!
>
> Item was added:
> + ----- Method: DisplayHostWindow>>test (in category 'testing') -----
> + test
> +       "((DisplayHostWindow extent: 400 at 400 depth: 16 ) translateBy: 210 at 450) test"
> +       "Should
> +               a) open a window with the upper left portion of the current Display
> +               b) find the window size
> +               f) close the window"
> +       | size |
> +       self open.
> +       Display displayOn: self.
> +       self forceToScreen: self boundingBox.
> +       size := self windowSize.
> +       self close.
> +       ^ size!
>
> Item was added:
> + ----- Method: DisplayHostWindow>>test2 (in category 'testing') -----
> + test2
> +       "((DisplayHostWindow extent: 400 @ 400 depth: 16 ) translateBy: 210 @ 450) test2"
> +       "Should
> +               a) open a window with the upper left portion of the current Display
> +               b) update the middle area with part of Display
> +               c) move the window from 210 @ 450 to 300 @ 300
> +               d) change the window title
> +               e) change the window size from 400 @ 400 to 600 @ 400
> +               f) wait 4 seconds so you can see the result
> +               g) close the window via the garbage collecttor finalizing it"
> +       self open.
> +       Display displayOn: self.
> +       self forceToScreen.
> +       Display displayOn: self at: -100 @ -200.
> +       self forceToScreen: (100 @ 100 extent: 200 @ 200).
> +       self windowPosition: 300 @ 300.
> +       self windowTitle: 'YooHoo!! New title'.
> +       self windowSize: 600 @ 400.
> +       (Delay forSeconds: 4) wait.!
>
> Item was added:
> + ----- Method: DisplayHostWindow>>windowPosition (in category 'basic api') -----
> + windowPosition
> +       "return the current position of the window"
> +
> +       ^windowProxy ifNotNil:[ windowProxy windowPosition]!
>
> Item was added:
> + ----- Method: DisplayHostWindow>>windowPosition: (in category 'basic api') -----
> + windowPosition: aPoint
> +       "set the position of the window and then return the new position"
> +       ^windowProxy ifNotNil:[ windowProxy windowPosition: aPoint]!
>
> Item was added:
> + ----- Method: DisplayHostWindow>>windowSize (in category 'basic api') -----
> + windowSize
> +       "return the current size of the window - not neccessarily the same as my bitmap"
> +
> +       ^windowProxy ifNotNil:[ windowProxy windowSize]!
>
> Item was added:
> + ----- Method: DisplayHostWindow>>windowSize: (in category 'basic api') -----
> + windowSize: aPoint
> +       "Set the size of the window and then return the current size of the window -
> + not neccessarily the same "
> +
> +       ^windowProxy ifNotNil:[ windowProxy windowSize: aPoint]!
>
> Item was added:
> + ----- Method: DisplayHostWindow>>windowTitle: (in category 'basic api') -----
> + windowTitle: titleString
> +       "set the label in the window titlebar to titleString"
> +       title := titleString.
> +       windowProxy ifNotNil: [ windowProxy windowTitle: title ]!
>
> Item was added:
> + Object subclass: #HostWindowProxy
> +       instanceVariableNames: 'windowHandle sourceForm'
> +       classVariableNames: 'ActiveProxyClass Registry'
> +       poolDictionaries: ''
> +       category: 'Graphics-External-Ffenestri'!
> +
> + !HostWindowProxy commentStamp: 'bf 1/4/2012 18:37' prior: 0!
> + This is a proxy for a Host OS window and as such is considered a disposable item. When an image is restarted the client must recreate suitable instances from the information they hold. Platform specific subclasses are available to translate abstract requirements into possible platform concrete data.
> + There is a registry of instances so that when users let go they can be guaranteed to close down properly. Because the instances point to the source Form in use this can on occasion result in a cycle that defeats the Weak mechanism - hence the implementation of #executor & #asExecutor.
> + The only requirements placed on the sourceForm instvar are those of being like a DisplayScreen - can return a bits array, the width, depth etc PLUS implement processEvent: AND able to respond to #resetProxy to remove and rebuild the window proxy!
>
> Item was added:
> + ----- Method: HostWindowProxy class>>activeWindowProxyClass (in category 'system startup') -----
> + activeWindowProxyClass
> +       "Return the concrete HostWindowProxy subclass for the platform on which we are
> + currently running."
> +
> +       HostWindowProxy allSubclasses do: [:class |
> +               class isActiveHostWindowProxyClass ifTrue: [^ class]].
> +
> +       "no responding subclass; use HostWindowProxy"
> +       ^ HostWindowProxy
> + !
>
> Item was added:
> + ----- Method: HostWindowProxy class>>initialize (in category 'class initialization') -----
> + initialize
> + "Add me to the system startup list and make sure to do a file-in init for first time loading"
> + "HostWindowProxy initialize"
> +       self setDefaultWindowProxyClass.
> +       Smalltalk addToStartUpList: self.!
>
> Item was added:
> + ----- Method: HostWindowProxy class>>isActiveHostWindowProxyClass (in category 'system startup') -----
> + isActiveHostWindowProxyClass
> + "subclasses must override this"
> +       self subclassResponsibility!
>
> Item was added:
> + ----- Method: HostWindowProxy class>>on: (in category 'initialize-release') -----
> + on: aSourceForm
> + "Build a new window proxy by finding the appropriate platform specific subclass
> + and setting it up for this Form-like argument"
> +       ^ActiveProxyClass new on: aSourceForm!
>
> Item was added:
> + ----- Method: HostWindowProxy class>>processEvent: (in category 'events') -----
> + processEvent: evt
> +       "evt is a raw event buffer from VM. Pass it on to the appropiate proxy."
> +       self registry keys do: [:proxy |
> +               (proxy wantsEvent: evt) ifTrue: [proxy processEvent: evt]].
> + !
>
> Item was added:
> + ----- Method: HostWindowProxy class>>register: (in category 'registry') -----
> + register: anObject
> + "boilerplate WeakRegistry usage"
> +       ^self registry add: anObject!
>
> Item was added:
> + ----- Method: HostWindowProxy class>>registry (in category 'registry') -----
> + registry
> + "boilerplate WeakRegistry usage"
> +       ^Registry ifNil: [Registry := WeakRegistry new]!
>
> Item was added:
> + ----- Method: HostWindowProxy class>>setDefaultWindowProxyClass (in category 'system startup') -----
> + setDefaultWindowProxyClass
> +       "connect to the proper platform subclass of proxy"
> +       ActiveProxyClass := self activeWindowProxyClass!
>
> Item was added:
> + ----- Method: HostWindowProxy class>>startUp: (in category 'system startup') -----
> + startUp: resuming
> +       resuming ifFalse: [^self].
> +       "system startup - find the appropriate proxy class for this platform"
> +       self setDefaultWindowProxyClass.
> +       "any currently extant instances must tell their sourceForm to resetProxy in order to kill potentially wrong-platform versions and reset to correct-platform"
> +       self registry keys do: [:i | i resetProxy]!
>
> Item was added:
> + ----- Method: HostWindowProxy class>>unregister: (in category 'registry') -----
> + unregister: anObject
> + "boilerplate WeakRegistry usage"
> +       ^self registry remove: anObject ifAbsent:[]!
>
> Item was added:
> + ----- Method: HostWindowProxy>>asExecutor (in category 'finalization') -----
> + asExecutor
> +       sourceForm := nil!
>
> Item was added:
> + ----- Method: HostWindowProxy>>attributes (in category 'window decorations') -----
> + attributes
> + "return the ByteArray representing the desired window attributes. This is utterly platform dependent and my default is an empty ByteArray to signify a default window"
> +       ^ByteArray new!
>
> Item was added:
> + ----- Method: HostWindowProxy>>bits (in category 'metrics') -----
> + bits
> + "return the bits - normally of the sourceForm"
> +       ^sourceForm bits!
>
> Item was added:
> + ----- Method: HostWindowProxy>>close (in category 'initialize-release') -----
> + close
> +       "close this window"
> +       windowHandle ifNil: [^self].
> +       self unregister.
> +       self primitiveWindowClose: windowHandle.
> +       windowHandle := nil.
> + !
>
> Item was added:
> + ----- Method: HostWindowProxy>>defaultWindowType (in category 'window decorations') -----
> + defaultWindowType
> + "set up my attributes to be a default window - a titlebar, usual decorations etc"
> +       ^self subclassResponsibility!
>
> Item was added:
> + ----- Method: HostWindowProxy>>depth (in category 'metrics') -----
> + depth
> + "return the depth - normally of the sourceForm"
> +       ^sourceForm depth!
>
> Item was added:
> + ----- Method: HostWindowProxy>>executor (in category 'finalization') -----
> + executor
> +       ^self shallowCopy asExecutor!
>
> Item was added:
> + ----- Method: HostWindowProxy>>finalize (in category 'finalization') -----
> + finalize
> +       "close this window"
> +       self close!
>
> Item was added:
> + ----- Method: HostWindowProxy>>forceToScreen: (in category 'window manipulation') -----
> + forceToScreen: damageRectangle
> +       "update the area of the sourceForm defined by damageRectangle"
> +       self
> +               primitiveUpdateHostWindow: windowHandle
> +               bitmap: self bits
> +               width: self width
> +               height: self height
> +               depth: self depth
> +               left: damageRectangle left
> +               right: damageRectangle right
> +               top: damageRectangle top
> +               bottom: damageRectangle bottom!
>
> Item was added:
> + ----- Method: HostWindowProxy>>height (in category 'metrics') -----
> + height
> + "return the height - normally of the sourceForm"
> +       ^sourceForm height!
>
> Item was added:
> + ----- Method: HostWindowProxy>>isOpen (in category 'accessing') -----
> + isOpen
> + "am I already opened?"
> +       ^windowHandle notNil!
>
> Item was added:
> + ----- Method: HostWindowProxy>>offset (in category 'metrics') -----
> + offset
> + "return the offset - normally of the sourceForm"
> +       ^sourceForm offset!
>
> Item was added:
> + ----- Method: HostWindowProxy>>on: (in category 'initialize-release') -----
> + on: aSourceForm
> +       "set my sourceForm; usually an actual Form but so long as methods like bits, height etc work, it can be anything"
> +       sourceForm := aSourceForm!
>
> Item was added:
> + ----- Method: HostWindowProxy>>open (in category 'initialize-release') -----
> + open
> +       "open a host window built around my position, size and bitmap"
> +       windowHandle
> +               ifNil: [sourceForm
> +                               ifNotNil:[windowHandle := self
> +                                               primitiveCreateHostWindowWidth: self width
> +                                               height: self height
> +                                               originX: self offset x
> +                                               y: self offset y
> +                                               attributes: self attributes.
> +                                               windowHandle ifNotNil:[self register].
> +                                               ^windowHandle]]!
>
> Item was added:
> + ----- Method: HostWindowProxy>>primitiveCreateHostWindowWidth:height:originX:y:attributes: (in category 'system primitives') -----
> + primitiveCreateHostWindowWidth: w height: h originX: x y: y attributes: list
> + "create and open a host window. list is a ByteArray list of window attributes in some platform manner. See subclasses for information"
> +       <primitive: 'primitiveCreateHostWindow' module: 'HostWindowPlugin'>
> +       ^self error: 'Unable to create Host Window'!
>
> Item was added:
> + ----- Method: HostWindowProxy>>primitiveUpdateHostWindow:bitmap:width:height:depth:left:right:top:bottom: (in category 'system primitives') -----
> + primitiveUpdateHostWindow: id bitmap: bitmap width: w height: h depth: d left: l
> + right: r top: t bottom: b
> +       "Force the pixels to the screen. The bitmap details and affected area are given
> + explicitly to avoid dependence upon any object structure"
> +       <primitive: 'primitiveShowHostWindowRect' module:'HostWindowPlugin'>
> +       ^self windowProxyError: 'update'!
>
> Item was added:
> + ----- Method: HostWindowProxy>>primitiveWindowClose: (in category 'system primitives') -----
> + primitiveWindowClose: id
> + "Close the window"
> +       <primitive: 'primitiveCloseHostWindow' module: 'HostWindowPlugin'>
> +       ^self windowProxyError: 'close'!
>
> Item was added:
> + ----- Method: HostWindowProxy>>primitiveWindowPosition: (in category 'system primitives') -----
> + primitiveWindowPosition: id
> + "Find the topleft corner of the window"
> +       <primitive: 'primitiveHostWindowPosition' module: 'HostWindowPlugin'>
> +       ^self windowProxyError: 'get position'!
>
> Item was added:
> + ----- Method: HostWindowProxy>>primitiveWindowPosition:x:y: (in category 'system primitives') -----
> + primitiveWindowPosition: id x: x y: y
> + "Set the topleft corner of the window - return what is actually set"
> +       <primitive: 'primitiveHostWindowPositionSet' module: 'HostWindowPlugin'>
> +       ^self windowProxyError: 'set position'!
>
> Item was added:
> + ----- Method: HostWindowProxy>>primitiveWindowSize: (in category 'system primitives') -----
> + primitiveWindowSize: id
> + "Find the size of the window, just like primitiveScreenSize"
> +       <primitive: 'primitiveHostWindowSize' module: 'HostWindowPlugin'>
> +       ^self windowProxyError: 'get size'!
>
> Item was added:
> + ----- Method: HostWindowProxy>>primitiveWindowSize:x:y: (in category 'system primitives') -----
> + primitiveWindowSize: id x: x y: y
> + "Set the size of the window, just like primitiveScreenSize. Return the actually
> + achieved size"
> +       <primitive: 'primitiveHostWindowSizeSet' module: 'HostWindowPlugin'>
> +       ^self windowProxyError: 'set size'!
>
> Item was added:
> + ----- Method: HostWindowProxy>>primitiveWindowTitle:string: (in category 'system primitives') -----
> + primitiveWindowTitle: id string: titleString
> + "Set the label of the title bar of the window"
> +       <primitive: 'primitiveHostWindowTitle' module: 'HostWindowPlugin'>
> +       ^self error: 'Unable to set title of Host Window'!
>
> Item was added:
> + ----- Method: HostWindowProxy>>printOn: (in category 'printing') -----
> + printOn: aStream
> +       super printOn:aStream.
> +       aStream nextPutAll: ' (windowIndex '.
> +       windowHandle printOn: aStream.
> +       aStream nextPut: $)!
>
> Item was added:
> + ----- Method: HostWindowProxy>>processEvent: (in category 'events') -----
> + processEvent: evt
> +       "evt is a raw event buffer from VM. delegate to client window"
> +       sourceForm processEvent: evt!
>
> Item was added:
> + ----- Method: HostWindowProxy>>recreate (in category 'window manipulation') -----
> + recreate
> + "something has changed that require deleting the host window before opening it
> + with new attributes"
> +       self close; open!
>
> Item was added:
> + ----- Method: HostWindowProxy>>register (in category 'finalization') -----
> + register
> +       ^self class register: self!
>
> Item was added:
> + ----- Method: HostWindowProxy>>resetProxy (in category 'finalization') -----
> + resetProxy
> + "tell my sourceForm to kill me (gulp) and resurrect me in the correct clothing"
> +       sourceForm ifNotNil:[ sourceForm resetProxy]!
>
> Item was added:
> + ----- Method: HostWindowProxy>>unregister (in category 'finalization') -----
> + unregister
> +       ^self class unregister: self!
>
> Item was added:
> + ----- Method: HostWindowProxy>>wantsEvent: (in category 'events') -----
> + wantsEvent: evt
> +       "evt is a raw event buffer from VM. check if its window field matches ours"
> +       ^ windowHandle = (evt at: 8)!
>
> Item was added:
> + ----- Method: HostWindowProxy>>width (in category 'metrics') -----
> + width
> + "return the width - normally of the sourceForm"
> +       ^sourceForm width!
>
> Item was added:
> + ----- Method: HostWindowProxy>>windowPosition (in category 'window manipulation') -----
> + windowPosition
> +       "return the current position of the window"
> +               ^self primitiveWindowPosition: windowHandle!
>
> Item was added:
> + ----- Method: HostWindowProxy>>windowPosition: (in category 'window manipulation') -----
> + windowPosition: aPoint
> +       "set the position of the window and then return the new position"
> +               ^self primitiveWindowPosition: windowHandle x: aPoint x y: aPoint y!
>
> Item was added:
> + ----- Method: HostWindowProxy>>windowProxyError: (in category 'accessing') -----
> + windowProxyError: problemString
> +       "Could be useful to raise an exception but not yet"!
>
> Item was added:
> + ----- Method: HostWindowProxy>>windowSize (in category 'window manipulation') -----
> + windowSize
> +       "return the current size of the window "
> +               ^self primitiveWindowSize: windowHandle!
>
> Item was added:
> + ----- Method: HostWindowProxy>>windowSize: (in category 'window manipulation') -----
> + windowSize: aPoint
> +       "Set the size of the window and then return the actually set size of the window - not neccessarily the same "
> +               ^self primitiveWindowSize: windowHandle x: aPoint x y: aPoint y!
>
> Item was added:
> + ----- Method: HostWindowProxy>>windowTitle: (in category 'window manipulation') -----
> + windowTitle: titleString
> + "set the label in the window titlebar to titleString"
> +       ^self primitiveWindowTitle: windowHandle string: titleString squeakToUtf8!
>
> Item was added:
> + HostWindowProxy subclass: #MacOS9WindowProxy
> +       instanceVariableNames: 'windowClass windowAttributes'
> +       classVariableNames: ''
> +       poolDictionaries: ''
> +       category: 'Graphics-External-Ffenestri'!
>
> Item was added:
> + ----- Method: MacOS9WindowProxy class>>altDBoxProc (in category 'constants') -----
> + altDBoxProc
> +       ^3
> + !
>
> Item was added:
> + ----- Method: MacOS9WindowProxy class>>closeBoxAttribute (in category 'constants') -----
> + closeBoxAttribute
> +       ^1!
>
> Item was added:
> + ----- Method: MacOS9WindowProxy class>>dBoxProc (in category 'constants') -----
> + dBoxProc
> +       ^1!
>
> Item was added:
> + ----- Method: MacOS9WindowProxy class>>documentProc (in category 'constants') -----
> + documentProc
> +       ^0!
>
> Item was added:
> + ----- Method: MacOS9WindowProxy class>>documentWindowClass (in category 'constants') -----
> + documentWindowClass
> +       ^self zoomDocProc!
>
> Item was added:
> + ----- Method: MacOS9WindowProxy class>>floatGrowProc (in category 'constants') -----
> + floatGrowProc
> +       ^1987
> + !
>
> Item was added:
> + ----- Method: MacOS9WindowProxy class>>floatProc (in category 'constants') -----
> + floatProc
> +       ^1985
> + !
>
> Item was added:
> + ----- Method: MacOS9WindowProxy class>>floatSideGrowProc (in category 'constants') -----
> + floatSideGrowProc
> +       ^1995
> + !
>
> Item was added:
> + ----- Method: MacOS9WindowProxy class>>floatSideProc (in category 'constants') -----
> + floatSideProc
> +       ^1993
> + !
>
> Item was added:
> + ----- Method: MacOS9WindowProxy class>>floatSideZoomGrowProc (in category 'constants') -----
> + floatSideZoomGrowProc
> +       ^1999!
>
> Item was added:
> + ----- Method: MacOS9WindowProxy class>>floatSideZoomProc (in category 'constants') -----
> + floatSideZoomProc
> +       ^1997!
>
> Item was added:
> + ----- Method: MacOS9WindowProxy class>>floatZoomGrowProc (in category 'constants') -----
> + floatZoomGrowProc
> +       ^1991
> + !
>
> Item was added:
> + ----- Method: MacOS9WindowProxy class>>floatZoomProc (in category 'constants') -----
> + floatZoomProc
> +       ^1989
> + !
>
> Item was added:
> + ----- Method: MacOS9WindowProxy class>>isActiveHostWindowProxyClass (in category 'system startup') -----
> + isActiveHostWindowProxyClass
> + "Am I active?"
> +       ^SmalltalkImage current platformName  = 'Mac OS' and: [SmalltalkImage current osVersion asInteger < 1000]!
>
> Item was added:
> + ----- Method: MacOS9WindowProxy class>>movableDBoxProc (in category 'constants') -----
> + movableDBoxProc
> +       ^5
> + !
>
> Item was added:
> + ----- Method: MacOS9WindowProxy class>>noAttributes (in category 'constants') -----
> + noAttributes
> +       ^0!
>
> Item was added:
> + ----- Method: MacOS9WindowProxy class>>noGrowDocProc (in category 'constants') -----
> + noGrowDocProc
> +       ^4
> + !
>
> Item was added:
> + ----- Method: MacOS9WindowProxy class>>plainDBox (in category 'constants') -----
> + plainDBox
> +       ^2!
>
> Item was added:
> + ----- Method: MacOS9WindowProxy class>>rDocProc (in category 'constants') -----
> + rDocProc
> +       ^16
> + !
>
> Item was added:
> + ----- Method: MacOS9WindowProxy class>>standardDocumentAttributes (in category 'constants') -----
> + standardDocumentAttributes
> +       ^self closeBoxAttribute!
>
> Item was added:
> + ----- Method: MacOS9WindowProxy class>>zoomDocProc (in category 'constants') -----
> + zoomDocProc
> +       ^8!
>
> Item was added:
> + ----- Method: MacOS9WindowProxy class>>zoomNoGrow (in category 'constants') -----
> + zoomNoGrow
> +       ^12
> + !
>
> Item was added:
> + ----- Method: MacOS9WindowProxy>>attributes (in category 'accessing') -----
> + attributes
> +       | val |
> +       val := ByteArray new: 8.
> +       val
> +               unsignedLongAt: 1
> +               put: windowClass
> +               bigEndian: Smalltalk isBigEndian.
> +       val
> +               unsignedLongAt: 5
> +               put: windowAttributes
> +               bigEndian: Smalltalk isBigEndian.
> +       ^ val!
>
> Item was added:
> + ----- Method: MacOS9WindowProxy>>defaultWindowType (in category 'metrics') -----
> + defaultWindowType
> +       self windowClass: self class documentWindowClass.
> +       self windowAttributes: self class standardDocumentAttributes.!
>
> Item was added:
> + ----- Method: MacOS9WindowProxy>>windowAttributes (in category 'accessing') -----
> + windowAttributes
> +       ^windowAttributes
> + !
>
> Item was added:
> + ----- Method: MacOS9WindowProxy>>windowAttributes: (in category 'accessing') -----
> + windowAttributes: aNumber
> +       windowAttributes := aNumber!
>
> Item was added:
> + ----- Method: MacOS9WindowProxy>>windowClass (in category 'accessing') -----
> + windowClass
> +       ^windowClass
> + !
>
> Item was added:
> + ----- Method: MacOS9WindowProxy>>windowClass: (in category 'accessing') -----
> + windowClass: aNumber
> +       windowClass := aNumber!
>
> Item was added:
> + HostWindowProxy subclass: #MacOSXWindowProxy
> +       instanceVariableNames: 'windowClass windowAttributes'
> +       classVariableNames: ''
> +       poolDictionaries: ''
> +       category: 'Graphics-External-Ffenestri'!
>
> Item was added:
> + ----- Method: MacOSXWindowProxy class>>activatesAttribute (in category 'constants') -----
> + activatesAttribute
> +       ^2 raisedTo: 17!
>
> Item was added:
> + ----- Method: MacOSXWindowProxy class>>alertWindowClass (in category 'constants') -----
> + alertWindowClass
> +       ^1!
>
> Item was added:
> + ----- Method: MacOSXWindowProxy class>>altPlainWindowClass (in category 'constants') -----
> + altPlainWindowClass
> +       ^16!
>
> Item was added:
> + ----- Method: MacOSXWindowProxy class>>asyncDragAttribute (in category 'constants') -----
> + asyncDragAttribute
> +       ^2 raisedTo: 23!
>
> Item was added:
> + ----- Method: MacOSXWindowProxy class>>closeBoxAttribute (in category 'constants') -----
> + closeBoxAttribute
> +       ^2 raisedTo: 0!
>
> Item was added:
> + ----- Method: MacOSXWindowProxy class>>collapseBoxAttribute (in category 'constants') -----
> + collapseBoxAttribute
> +       ^2 raisedTo: 3!
>
> Item was added:
> + ----- Method: MacOSXWindowProxy class>>compositingAttribute (in category 'constants') -----
> + compositingAttribute
> +       ^2 raisedTo: 19!
>
> Item was added:
> + ----- Method: MacOSXWindowProxy class>>documentWindowClass (in category 'constants') -----
> + documentWindowClass
> +       ^6!
>
> Item was added:
> + ----- Method: MacOSXWindowProxy class>>doesNotCycleAttribute (in category 'constants') -----
> + doesNotCycleAttribute
> +       ^2 raisedTo: 15!
>
> Item was added:
> + ----- Method: MacOSXWindowProxy class>>drawerWindowClass (in category 'constants') -----
> + drawerWindowClass
> +       ^20!
>
> Item was added:
> + ----- Method: MacOSXWindowProxy class>>floatingWindowClass (in category 'constants') -----
> + floatingWindowClass
> +       ^5!
>
> Item was added:
> + ----- Method: MacOSXWindowProxy class>>fullZoomAttribute (in category 'constants') -----
> + fullZoomAttribute
> +       ^self verticalZoomAttribute bitOr: self horizontalZoomAttribute!
>
> Item was added:
> + ----- Method: MacOSXWindowProxy class>>helpWindowClass (in category 'constants') -----
> + helpWindowClass
> +       ^10!
>
> Item was added:
> + ----- Method: MacOSXWindowProxy class>>hideOnFullScreenAttribute (in category 'constants') -----
> + hideOnFullScreenAttribute
> +       ^2 raisedTo: 26!
>
> Item was added:
> + ----- Method: MacOSXWindowProxy class>>hideOnSuspendAttribute (in category 'constants') -----
> + hideOnSuspendAttribute
> +       ^2 raisedTo: 24!
>
> Item was added:
> + ----- Method: MacOSXWindowProxy class>>horizontalZoomAttribute (in category 'constants') -----
> + horizontalZoomAttribute
> +       ^2 raisedTo: 1!
>
> Item was added:
> + ----- Method: MacOSXWindowProxy class>>ignoreClicksAttribute (in category 'constants') -----
> + ignoreClicksAttribute
> +       ^2 raisedTo: 29!
>
> Item was added:
> + ----- Method: MacOSXWindowProxy class>>inWindowMenuAttribute (in category 'constants') -----
> + inWindowMenuAttribute
> +       ^2 raisedTo: 27!
>
> Item was added:
> + ----- Method: MacOSXWindowProxy class>>isActiveHostWindowProxyClass (in category 'system startup') -----
> + isActiveHostWindowProxyClass
> + "Am I active?"
> +       ^SmalltalkImage current platformName  = 'Mac OS' and: [SmalltalkImage current osVersion asInteger >= 1000]!
>
> Item was added:
> + ----- Method: MacOSXWindowProxy class>>liveResizeAttribute (in category 'constants') -----
> + liveResizeAttribute
> +       ^2 raisedTo: 28!
>
> Item was added:
> + ----- Method: MacOSXWindowProxy class>>metalAttribute (in category 'constants') -----
> + metalAttribute
> +       ^2 raisedTo: 8!
>
> Item was added:
> + ----- Method: MacOSXWindowProxy class>>modalWindowClass (in category 'constants') -----
> + modalWindowClass
> +       ^3!
>
> Item was added:
> + ----- Method: MacOSXWindowProxy class>>movableAlertWindowClass (in category 'constants') -----
> + movableAlertWindowClass
> +       ^2!
>
> Item was added:
> + ----- Method: MacOSXWindowProxy class>>movableModalWindowClass (in category 'constants') -----
> + movableModalWindowClass
> +       ^4!
>
> Item was added:
> + ----- Method: MacOSXWindowProxy class>>noAttributes (in category 'constants') -----
> + noAttributes
> +       ^0!
>
> Item was added:
> + ----- Method: MacOSXWindowProxy class>>noConstrainAttribute (in category 'constants') -----
> + noConstrainAttribute
> +       ^2 raisedTo: 31!
>
> Item was added:
> + ----- Method: MacOSXWindowProxy class>>noShadowAttribute (in category 'constants') -----
> + noShadowAttribute
> +       ^2 raisedTo: 21!
>
> Item was added:
> + ----- Method: MacOSXWindowProxy class>>noUpdatesAttribute (in category 'constants') -----
> + noUpdatesAttribute
> +       ^2 raisedTo: 16!
>
> Item was added:
> + ----- Method: MacOSXWindowProxy class>>opaqueForEventsAttribute (in category 'constants') -----
> + opaqueForEventsAttribute
> +       ^2 raisedTo: 18!
>
> Item was added:
> + ----- Method: MacOSXWindowProxy class>>overlayWindowClass (in category 'constants') -----
> + overlayWindowClass
> +       ^14!
>
> Item was added:
> + ----- Method: MacOSXWindowProxy class>>plainWindowClass (in category 'constants') -----
> + plainWindowClass
> +       ^13!
>
> Item was added:
> + ----- Method: MacOSXWindowProxy class>>resizableAttribute (in category 'constants') -----
> + resizableAttribute
> +       ^2 raisedTo: 4!
>
> Item was added:
> + ----- Method: MacOSXWindowProxy class>>sheetAlertWindowClass (in category 'constants') -----
> + sheetAlertWindowClass
> +       ^15!
>
> Item was added:
> + ----- Method: MacOSXWindowProxy class>>sheetWindowClass (in category 'constants') -----
> + sheetWindowClass
> +       ^11!
>
> Item was added:
> + ----- Method: MacOSXWindowProxy class>>sideTitlebarAttribute (in category 'constants') -----
> + sideTitlebarAttribute
> +       ^2 raisedTo: 5!
>
> Item was added:
> + ----- Method: MacOSXWindowProxy class>>simpleWindowClass (in category 'constants') -----
> + simpleWindowClass
> +       ^18!
>
> Item was added:
> + ----- Method: MacOSXWindowProxy class>>standardDocumentAttributes (in category 'constants') -----
> + standardDocumentAttributes
> +       ^self noConstrainAttribute + self standardHandlerAttribute + self closeBoxAttribute + self fullZoomAttribute + self collapseBoxAttribute + self resizableAttribute
> +
> +
> + "16r8200001E printStringBase: 2 '2r 10000010 00000000 00000000 00011110'"!
>
> Item was added:
> + ----- Method: MacOSXWindowProxy class>>standardFloatingAttributes (in category 'constants') -----
> + standardFloatingAttributes
> +       ^self closeBoxAttribute + self collapseBoxAttribute
> + !
>
> Item was added:
> + ----- Method: MacOSXWindowProxy class>>standardHandlerAttribute (in category 'constants') -----
> + standardHandlerAttribute
> +       ^2 raisedTo: 25!
>
> Item was added:
> + ----- Method: MacOSXWindowProxy class>>toolbarButtonAttribute (in category 'constants') -----
> + toolbarButtonAttribute
> +       ^2 raisedTo: 6!
>
> Item was added:
> + ----- Method: MacOSXWindowProxy class>>toolbarWindowClass (in category 'constants') -----
> + toolbarWindowClass
> +       ^12!
>
> Item was added:
> + ----- Method: MacOSXWindowProxy class>>utilityWindowClass (in category 'constants') -----
> + utilityWindowClass
> +       ^8!
>
> Item was added:
> + ----- Method: MacOSXWindowProxy class>>verticalZoomAttribute (in category 'constants') -----
> + verticalZoomAttribute
> +       ^2 raisedTo: 2!
>
> Item was added:
> + ----- Method: MacOSXWindowProxy>>attributes (in category 'accessing') -----
> + attributes
> +       | val |
> +       val := ByteArray new: 8.
> +       val
> +               unsignedLongAt: 1
> +               put: windowClass
> +               bigEndian: Smalltalk isBigEndian.
> +       val
> +               unsignedLongAt: 5
> +               put: windowAttributes
> +               bigEndian: Smalltalk isBigEndian.
> +       ^ val!
>
> Item was added:
> + ----- Method: MacOSXWindowProxy>>defaultWindowType (in category 'metrics') -----
> + defaultWindowType
> +       self windowClass: self class documentWindowClass.
> +       self windowAttributes: self class standardDocumentAttributes.!
>
> Item was added:
> + ----- Method: MacOSXWindowProxy>>windowAttributes (in category 'accessing') -----
> + windowAttributes
> +       ^windowAttributes
> + !
>
> Item was added:
> + ----- Method: MacOSXWindowProxy>>windowAttributes: (in category 'accessing') -----
> + windowAttributes: aNumber
> +       windowAttributes := aNumber!
>
> Item was added:
> + ----- Method: MacOSXWindowProxy>>windowClass (in category 'accessing') -----
> + windowClass
> +       ^windowClass
> + !
>
> Item was added:
> + ----- Method: MacOSXWindowProxy>>windowClass: (in category 'accessing') -----
> + windowClass: aNumber
> +       windowClass := aNumber!
>
>



More information about the Squeak-dev mailing list