Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1723.mcz ==================== Summary ==================== Name: Morphic-mt.1723 Author: mt Time: 19 February 2021, 9:25:48.003408 am UUID: d3f91505-ae1c-f246-92f4-c4fdd2a6c929 Ancestors: Morphic-mt.1722 Minor clean-up. WorldState already handles deferred updates and min-cycle lapse. (I think this was just forgotten when WoldState was introduced. Note that I kept the commentary in #disableDeferredUpdates:) =============== Diff against Morphic-mt.1722 =============== Item was changed: BorderedMorph subclass: #PasteUpMorph instanceVariableNames: 'presenter model cursor padding backgroundMorph turtleTrailsForm turtlePen lastTurtlePositions isPartsBin indicateCursor wantsMouseOverHalos worldState griddingOn' + classVariableNames: 'GlobalCommandKeysEnabled WindowEventHandler' - classVariableNames: 'DisableDeferredUpdates GlobalCommandKeysEnabled MinCycleLapse StillAlive WindowEventHandler' poolDictionaries: '' category: 'Morphic-Worlds'! !PasteUpMorph commentStamp: '<historical>' prior: 0! A morph whose submorphs comprise a paste-up of rectangular subparts which "show through". Anything called a 'Playfield' is a PasteUpMorph. Facilities commonly needed on pages of graphical presentations and on simulation playfields, such as the painting of new objects, turtle trails, gradient fills, background paintings, parts-bin behavior, collision-detection, etc., are (or will be) provided. A World, the entire Smalltalk screen, is a PasteUpMorph. A World responds true to isWorld. Morph subclasses that have specialized menus (BookMorph) build them in the message addBookMenuItemsTo:hand:. A PasteUpMorph that is a world, builds its menu in HandMorph buildWorldMenu. presenter A Presenter in charge of stopButton stepButton and goButton, mouseOverHalosEnabled soundsEnabled fenceEnabled coloredTilesEnabled. model <not used> cursor ?? padding ?? backgroundMorph A Form that covers the background. turtleTrailsForm Moving submorphs may leave trails on this form. turtlePen Draws the trails. lastTurtlePositions A Dictionary of (aPlayer -> aPoint) so turtle trails can be drawn only once each step cycle. The point is the start of the current stroke. isPartsBin If true, every object dragged out is copied. autoLineLayout ?? indicateCursor ?? resizeToFit ?? wantsMouseOverHalos If true, simply moving the cursor over a submorph brings up its halo. worldState If I am also a World, keeps the hands, damageRecorder, stepList etc. griddingOn If true, submorphs are on a grid ! Item was removed: - ----- Method: PasteUpMorph class>>MinCycleLapse: (in category 'project') ----- - MinCycleLapse: milliseconds - "set the minimum amount of time that may transpire between two calls to doOneCycle" - MinCycleLapse := milliseconds ifNotNil: [ milliseconds rounded ].! Item was removed: - ----- Method: PasteUpMorph class>>disableDeferredUpdates (in category 'project') ----- - disableDeferredUpdates - - ^DisableDeferredUpdates ifNil: [DisableDeferredUpdates := false] - ! Item was removed: - ----- Method: PasteUpMorph class>>disableDeferredUpdates: (in category 'project') ----- - disableDeferredUpdates: aBoolean - "If the argument is true, disable deferred screen updating." - "Details: When deferred updating is used, Morphic performs double-buffered screen updates by telling the VM to de-couple the Display from the hardware display buffer, drawing directly into the Display, and then forcing the changed regions of the Display to be copied to the screen. This saves both time (an extra BitBlt is avoided) and space (an extra display buffer is avoided). However, on platforms on which the Display points directly to the hardware screen buffer, deferred updating can't be used (you'd see ugly flashing as the layers of the drawing were assembled). In this case, the drawing is composited into an offscreen FormCanvas and then copied to the hardware display buffer." - - DisableDeferredUpdates := aBoolean. - ! Item was added: + ----- Method: WorldState class>>disableDeferredUpdates (in category 'accessing') ----- + disableDeferredUpdates + + ^DisableDeferredUpdates ifNil: [DisableDeferredUpdates := false] + ! Item was added: + ----- Method: WorldState class>>disableDeferredUpdates: (in category 'accessing') ----- + disableDeferredUpdates: aBoolean + "If the argument is true, disable deferred screen updating." + "Details: When deferred updating is used, Morphic performs double-buffered screen updates by telling the VM to de-couple the Display from the hardware display buffer, drawing directly into the Display, and then forcing the changed regions of the Display to be copied to the screen. This saves both time (an extra BitBlt is avoided) and space (an extra display buffer is avoided). However, on platforms on which the Display points directly to the hardware screen buffer, deferred updating can't be used (you'd see ugly flashing as the layers of the drawing were assembled). In this case, the drawing is composited into an offscreen FormCanvas and then copied to the hardware display buffer." + + DisableDeferredUpdates := aBoolean. + ! Item was changed: ----- Method: WorldState>>doDeferredUpdatingFor: (in category 'update cycle') ----- doDeferredUpdatingFor: aWorld "If this platform supports deferred updates, then make my canvas be the Display (or a rectangular portion of it), set the Display to deferred update mode, and answer true. Otherwise, do nothing and answer false. One can set the class variable DisableDeferredUpdates to true to completely disable the deferred updating feature." | properDisplay | + DisableDeferredUpdates ifTrue: [^ false]. - PasteUpMorph disableDeferredUpdates ifTrue: [^ false]. (Display deferUpdates: true) ifNil: [^ false]. "deferred updates not supported" remoteServer ifNotNil:[ self assuredCanvas. ^true]. properDisplay := canvas notNil and: [canvas form == Display]. aWorld == Project current world ifTrue: [ "this world fills the entire Display" properDisplay ifFalse: [ aWorld viewBox: Display boundingBox. "do first since it may clear canvas" self canvas: (Display getCanvas copyClipRect: Display boundingBox). ] ]. ^ true ! |
Free forum by Nabble | Edit this page |