'From OLPC2.0 of ''24 October 2006'' [latest update: #1470] on 27 July 2007 at 12:15:47 pm'! "Change Set: avoidScreenCtlr-yo Date: 27 July 2007 Author: Yoshiki Ohshima Morphic World menu shouldn't hold onto ScreenController instance."! Form subclass: #DisplayScreen instanceVariableNames: 'clippingBox extraRegions ' classVariableNames: 'DeferringUpdates DisplayChangeSignature ScreenSave LastScreenModeSelected ' poolDictionaries: '' category: 'Graphics-Display Objects'! !DisplayScreen class methodsFor: 'screen modes' stamp: 'yo 7/27/2007 12:06'! fullScreenOff Display fullScreenMode: (LastScreenModeSelected _ false). DisplayScreen checkForNewScreenSize. self restoreDisplay. ! ! !DisplayScreen class methodsFor: 'screen modes' stamp: 'yo 7/27/2007 12:05'! fullScreenOn Display fullScreenMode: (LastScreenModeSelected _ true). DisplayScreen checkForNewScreenSize. self restoreDisplay.! ! !DisplayScreen class methodsFor: 'screen modes' stamp: 'yo 7/27/2007 12:06'! lastScreenModeSelected ^LastScreenModeSelected! ! !DisplayScreen class methodsFor: 'screen modes' stamp: 'yo 7/27/2007 12:06'! restoreDisplay "Clear the screen to gray and then redisplay all the scheduled views." Smalltalk isMorphic ifTrue: [^ World restoreMorphicDisplay]. Display extent = DisplayScreen actualScreenSize ifFalse: [DisplayScreen startUp. ScheduledControllers unCacheWindows]. ScheduledControllers restore! ! !HTTPClient class methodsFor: 'testing' stamp: 'yo 7/27/2007 12:07'! shouldUsePluginAPI "HTTPClient shouldUsePluginAPI" self isRunningInBrowser ifFalse: [^false]. self browserSupportsAPI ifFalse: [^false]. "The Mac plugin calls do not work in full screen mode" ^((SmalltalkImage current platformName = 'Mac OS') and: [DisplayScreen lastScreenModeSelected]) not! ! !ProjectNavigationMorph methodsFor: 'as yet unclassified' stamp: 'yo 7/27/2007 12:07'! checkForRebuild | lastScreenMode flapsSuppressed | lastScreenMode _ DisplayScreen lastScreenModeSelected ifNil: [false]. flapsSuppressed _ CurrentProjectRefactoring currentFlapsSuppressed. ((self valueOfProperty: #currentNavigatorVersion) = self currentNavigatorVersion and: [lastScreenMode = self inFullScreenMode and: [flapsSuppressed = self inFlapsSuppressedMode and: [(self valueOfProperty: #includeSoundControlInNavigator) = Preferences includeSoundControlInNavigator]]]) ifFalse: [ self setProperty: #includeSoundControlInNavigator toValue: Preferences includeSoundControlInNavigator. self setProperty: #flapsSuppressedMode toValue: flapsSuppressed. self setProperty: #showingFullScreenMode toValue: lastScreenMode. self setProperty: #currentNavigatorVersion toValue: self currentNavigatorVersion. self removeAllMorphs. self addButtons. ]. ! ! !ProjectNavigationMorph methodsFor: 'the actions' stamp: 'yo 7/27/2007 12:12'! fullScreenOff self setProperty: #showingFullScreenMode toValue: false. DisplayScreen fullScreenOff. self removeProperty: #currentNavigatorVersion. mouseInside _ false. ! ! !ProjectNavigationMorph methodsFor: 'the actions' stamp: 'yo 7/27/2007 12:08'! fullScreenOn self setProperty: #showingFullScreenMode toValue: true. DisplayScreen fullScreenOn. self removeProperty: #currentNavigatorVersion. mouseInside _ false. ! ! !TheWorldMenu methodsFor: 'construction' stamp: 'yo 7/27/2007 12:08'! appearanceMenu "Build the appearance menu for the world." | screenCtrl | screenCtrl _ DisplayScreen. ^self fillIn: (self menu: 'appearance...') from: { {'preferences...' . { Preferences . #openFactoredPanel} . 'Opens a "Preferences Panel" which allows you to alter many settings' } . {'choose theme...' . { Preferences . #offerThemesMenu} . 'Presents you with a menu of themes; each item''s balloon-help will tell you about the theme. If you choose a theme, many different preferences that come along with that theme are set at the same time; you can subsequently change any settings by using a Preferences Panel'} . nil . {'window colors...' . { Preferences . #windowSpecificationPanel} . 'Lets you specify colors for standard system windows.'}. {'system fonts...' . { self . #standardFontDo} . 'Choose the standard fonts to use for code, lists, menus, window titles, etc.'}. {'text highlight color...' . { Preferences . #chooseTextHighlightColor} . 'Choose which color should be used for text highlighting in Morphic.'}. {'insertion point color...' . { Preferences . #chooseInsertionPointColor} . 'Choose which color to use for the text insertion point in Morphic.'}. {'keyboard focus color' . { Preferences . #chooseKeyboardFocusColor} . 'Choose which color to use for highlighting which pane has the keyboard focus'}. nil. {#menuColorString . { Preferences . #toggleMenuColorPolicy} . 'Governs whether menu colors should be derived from the desktop color.'}. {#roundedCornersString . { Preferences . #toggleRoundedCorners} . 'Governs whether morphic windows and menus should have rounded corners.'}. nil. {'full screen on' . { screenCtrl . #fullScreenOn} . 'puts you in full-screen mode, if not already there.'}. {'full screen off' . { screenCtrl . #fullScreenOff} . 'if in full-screen mode, takes you out of it.'}. nil. {'set display depth...' . {self. #setDisplayDepth} . 'choose how many bits per pixel.'}. {'set desktop color...' . {self. #changeBackgroundColor} . 'choose a uniform color to use as desktop background.'}. {'set gradient color...' . {self. #setGradientColor} . 'choose second color to use as gradient for desktop background.'}. {'use texture background' . { #myWorld . #setStandardTexture} . 'apply a graph-paper-like texture background to the desktop.'}. nil. {'clear turtle trails from desktop' . { #myWorld . #clearTurtleTrails} . 'remove any pigment laid down on the desktop by objects moving with their pens down.'}. {'pen-trail arrowhead size...' . { Preferences. #setArrowheads} . 'choose the shape to be used in arrowheads on pen trails.'}. }! ! !DisplayScreen class reorganize! ('screen modes' fullScreenOff fullScreenOn lastScreenModeSelected restoreDisplay) ('display box access' boundingBox checkForNewScreenSize depth:width:height:fullscreen:) ('snapshots' actualScreenDepth actualScreenSize shutDown startUp) ! Form subclass: #DisplayScreen instanceVariableNames: 'clippingBox extraRegions' classVariableNames: 'DeferringUpdates DisplayChangeSignature LastScreenModeSelected ScreenSave' poolDictionaries: '' category: 'Graphics-Display Objects'! "Postscript: " DisplayScreen classPool at: #LastScreenModeSelected put: (ScreenController classPool at: #LastScreenModeSelected)!