From VisualWorks®, 7.6 of February 8, 2008 on March 3, 2008 at 9:41:42 pm (Dialog confirm: 'You are filing-in a Parcel source file!\\While this is possible it will not have\the same effect as loading the parcel.\None of the Parcel''s prerequisites will\be loaded and none of its load actions\will be performed.\\Are you sure you want to file-in?' withCRs) ifFalse: [self error: 'Parcel file-in abandoned. Choose terminate or close.'] <class> <name>Screen</name> <environment>Graphics</environment> <super>Graphics.HostGraphicsDevice</super> <private>false</private> none boundingBox subRegions resolution rendererName currentColorDepth currentBitsPerPixel <imports></imports> <category>OS-Window System</category> <attributes> <package>Windows ColorDepth Workaround</package> </attributes> </class> <comment> Graphics.Screen
Class Screen represents a display screen. It supports screen-oriented protocol such as screen-wide user-interaction animation. Currently, Smalltalk supports only a single display screen, so this class only has one instance. Instance Variables: boundingBox <Rectangle> bounding box for the screen subRegions <Array of: Rectangle> rectangles that describe the screen's area resolution <Point> number of pixels per inch in the x and y directions renderName <Symbol> platform name Class variables: AllScreens <HandleRegistry> registry of all the available screens DefaultScreen <Screen> the default screen Object Reference: A Screen is the interface to a display monitor. Currently, only one screen at a time is supported -- that screen can be accessed by sending #default to this class. Applications usually interact with the screen indirectly, via display surfaces (windows, Pixmaps and Masks). In certain situations, however, direct communication with the screen may be necessary. The most common situation involves drag-and-drop animation, in which an object such as an icon is moved from one window to another. Screen's user-interaction methods enable you to perform such animations. Similarly, the zooming methods support the simulation of an expanding or shrinking object, which may also transcend window boundaries and require direct display on the screen. Other useful abilities of the screen, in addition to its inherited abilities, include: -Ringing a bell (utilities protocol) -Getting the window at a certain location on the screen (utilities) -Getting all windows on the screen (accessing) -Getting the size and resolution of the screen (accessing) -Creating an image from an area of the screen (accessing) -Getting and setting the contents of the operating system's clipboard (selection)
</comment> <methods> Graphics.Screen <category>initialize-release</category>
initialize "Install my state" super initialize. self installBoundingBox. resolution := 75@75. currentColorDepth := currentBitsPerPixel := nil
</methods> <methods> Graphics.Screen <category>accessing</category>
contentsOfArea: aRectangle "Obtain the bitmap contents of the specified area on my surface as an Image. The palette of the returned image may differ from the receiver's default color palette. For example, the captured image may potentially use pixel values that are unallocated in the default color palette. Answer a two-element array: Element 1 is an image with the bitmap contents. Element 2 is an array of rectangles representing the areas of the returned image that correspond to unobtainable portions of the source display medium." | image damageAndPalette newPalette actualDepth | image := Image extent: aRectangle extent depth: self currentColorDepth bitsPerPixel: self currentBitsPerPixel palette: self colorPalette. damageAndPalette := self contentsOfArea: aRectangle into: image bitsInstVar startingAt: 1. ((newPalette := damageAndPalette at: 2) isNil and: [self currentColorDepth = self colorDepth]) ifFalse: [newPalette isNil ifFalse: [newPalette := self paletteForDeviceColormap: newPalette. actualDepth := newPalette depth. (actualDepth == 24 and: [self currentColorDepth == 32]) ifTrue: [actualDepth := 32]] ifTrue: [newPalette := self currentColorPalette. actualDepth := self currentColorDepth]. actualDepth = self colorBitsPerPixel ifFalse: [image := Image extent: aRectangle extent depth: actualDepth bitsPerPixel: actualDepth palette: newPalette usingBits: image bitsInstVar] ifTrue: [image palette: newPalette]]. ^Array with: image with: ((damageAndPalette at: 1) collect: [:a | Rectangle origin: (a at: 1) @ (a at: 2) extent: (a at: 3) @ (a at: 4)])
currentBitsPerPixel currentBitsPerPixel == nil ifTrue: [^self colorBitsPerPixel]. ^currentBitsPerPixel
currentColorDepth currentColorDepth == nil ifTrue: [^self colorDepth]. ^currentColorDepth
currentColorPalette (self currentColorDepth = 32 or: [self currentColorDepth = 24]) ifTrue: [^FixedPalette redShift: 0 redMask: 255 greenShift: 8 greenMask: 255 blueShift: 16 blueMask: 255]. (self currentColorDepth = 16 or: [self currentColorDepth = 15]) ifTrue: [^FixedPalette rgb5Bit]. self currentColorDepth = 8 ifTrue: [^self class win256Palette]. ^self colorPalette
</methods> <methods> Graphics.Screen <category>private</category>
setChangedColorDepth currentColorDepth := currentBitsPerPixel := Win32SystemSupport new getScreenColorDepth.
</methods> <methods> Graphics.Screen class <category>accessing</category>
win256Palette ^MappedPalette withColors: (#(#(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(0 0 0)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(4112 0 0)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(0 4112 0)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(4112 4112 0)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(0 0 4112)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(4112 0 4112)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(0 4112 4112)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(6167 6167 6167)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(5525 5396 4915)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(7581 7484 6938)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(546 546 546)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(1092 1092 1092)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(1638 1638 1638)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(2184 2184 2184)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(2730 2730 2730)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(3276 3276 3276)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(3822 3822 3822)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(4369 4369 4369)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(4915 4915 4915)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(5461 5461 5461)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(6007 6007 6007)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(6553 6553 6553)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(7099 7099 7099)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(7645 7645 7645)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(0 0 2056)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(0 0 4112)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(0 0 6135)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(1638 0 0)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(1638 0 2056)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(1638 0 4112)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(1638 0 6135)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(1638 0 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(3276 0 0)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(3276 0 2056)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(3276 0 4112)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(3276 0 6135)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(3276 0 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(4915 0 0)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(4915 0 2056)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(4915 0 4112)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(4915 0 6135)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(4915 0 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(6553 0 0)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(6553 0 2056)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(6553 0 4112)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(6553 0 6135)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(6553 0 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 0 2056)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 0 4112)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 0 6135)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(0 1638 0)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(0 1638 2056)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(0 1638 4112)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(0 1638 6135)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(0 1638 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(1638 1638 0)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(1638 1638 2056)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(1638 1638 4112)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(1638 1638 6135)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(1638 1638 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(3276 1638 0)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(3276 1638 2056)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(3276 1638 4112)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(3276 1638 6135)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(3276 1638 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(4915 1638 0)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(4915 1638 2056)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(4915 1638 4112)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(4915 1638 6135)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(4915 1638 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(6553 1638 0)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(6553 1638 2056)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(6553 1638 4112)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(6553 1638 6135)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(6553 1638 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 1638 0)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 1638 2056)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 1638 4112)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 1638 6135)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 1638 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(0 3276 0)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(0 3276 2056)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(0 3276 4112)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(0 3276 6135)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(0 3276 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(1638 3276 0)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(1638 3276 2056)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(1638 3276 4112)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(1638 3276 6135)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(1638 3276 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(3276 3276 0)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(3276 3276 2056)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(3276 3276 4112)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(3276 3276 6135)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(3276 3276 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(4915 3276 0)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(4915 3276 2056)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(4915 3276 4112)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(4915 3276 6135)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(4915 3276 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(6553 3276 0)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(6553 3276 2056)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(6553 3276 4112)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(6553 3276 6135)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(6553 3276 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 3276 0)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 3276 2056)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 3276 4112)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 3276 6135)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 3276 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(0 4915 0)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(0 4915 2056)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(0 4915 4112)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(0 4915 6135)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(0 4915 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(1638 4915 0)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(1638 4915 2056)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(1638 4915 4112)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(1638 4915 6135)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(1638 4915 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(3276 4915 0)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(3276 4915 2056)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(3276 4915 4112)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(3276 4915 6135)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(3276 4915 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(4915 4915 0)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(4915 4915 2056)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(4915 4915 4112)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(4915 4915 6135)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(4915 4915 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(6553 4915 0)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(6553 4915 2056)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(6553 4915 4112)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(6553 4915 6135)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(6553 4915 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 4915 0)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 4915 2056)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 4915 4112)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 4915 6135)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 4915 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(0 6553 0)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(0 6553 2056)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(0 6553 4112)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(0 6553 6135)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(0 6553 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(1638 6553 0)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(1638 6553 2056)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(1638 6553 4112)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(1638 6553 6135)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(1638 6553 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(3276 6553 0)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(3276 6553 2056)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(3276 6553 4112)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(3276 6553 6135)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(3276 6553 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(4915 6553 0)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(4915 6553 2056)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(4915 6553 4112)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(4915 6553 6135)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(4915 6553 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(6553 6553 0)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(6553 6553 2056)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(6553 6553 4112)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(6553 6553 6135)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(6553 6553 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 6553 0)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 6553 2056)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 6553 4112)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 6553 6135)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 6553 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(0 8191 2056)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(0 8191 4112)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(0 8191 6135)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(1638 8191 0)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(1638 8191 2056)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(1638 8191 4112)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(1638 8191 6135)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(1638 8191 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(3276 8191 0)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(3276 8191 2056)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(3276 8191 4112)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(3276 8191 6135)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(3276 8191 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(4915 8191 0)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(4915 8191 2056)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(4915 8191 4112)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(4915 8191 6135)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(4915 8191 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(6553 8191 0)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(6553 8191 2056)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(6553 8191 4112)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(6553 8191 6135)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(6553 8191 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 8191 2056)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 8191 4112)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 8191 6135)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 8191 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 8191 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 8191 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 8191 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 8191 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 8191 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 8191 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 8191 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 8191 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 8191 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 8191 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 8191 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 8191 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 8191 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 8191 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 8191 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 8191 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 8191 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 8191 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 8191 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 8191 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 8191 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 8191 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 8191 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 8191 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 8191 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 8191 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 8191 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 8191 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 8191 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 8191 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 8191 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 8191 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 8191 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 8191 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 8191 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 8191 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 8191 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 8191 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 8191 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 8191 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 8191 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 8191 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 8191 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 8191 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 8191 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 8191 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 8191 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 8191 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 8191 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 8063 7709)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(0 2505 4882)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(4112 4112 4112)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 0 0)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(0 8191 0)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 8191 0)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(0 0 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 0 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(0 8191 8191)) #(#{Graphics.ColorValue} #scaledRed:scaledGreen:scaledBlue: #(8191 8191 8191))) collect: [:each | (each at: 1) value perform: (each at: 2) withArguments: (each at: 3)])
</methods> <methods> Graphics.Pixmap <category>accessing</category>
currentBitsPerPixel ^self graphicsDevice currentBitsPerPixel
currentDepth ^self graphicsDevice currentColorDepth
</methods> <methods> Graphics.DisplaySurface <category>accessing</category>
contentsOfArea: aRectangle "Obtain the bitmap contents of the specified area on my surface as an Image. The palette of the returned image may differ from the receiver's default color palette. For example, the captured image may potentially use pixel values that are unallocated in the default color palette. Answer a two-element array: Element 1 is an image with the bitmap contents. Element 2 is an array of rectangles representing the areas of the returned image that correspond to unobtainable portions of the source display medium." | image damageAndPalette newPalette actualDepth | image := Image extent: aRectangle extent depth: self currentDepth bitsPerPixel: self currentBitsPerPixel palette: self palette. damageAndPalette := self contentsOfArea: aRectangle into: image bitsInstVar startingAt: 1. ((newPalette := damageAndPalette at: 2) isNil and: [self currentDepth = self depth]) ifFalse: [newPalette isNil ifFalse: [newPalette := self paletteForDeviceColormap: newPalette. actualDepth := newPalette depth] ifTrue: [newPalette := Screen default currentColorPalette. actualDepth := self currentDepth]. actualDepth = self bitsPerPixel ifFalse: [image := Image extent: aRectangle extent depth: actualDepth bitsPerPixel: actualDepth palette: newPalette usingBits: image bitsInstVar] ifTrue: [image palette: newPalette]]. ^Array with: image with: ((damageAndPalette at: 1) collect: [:a | Rectangle origin: (a at: 1) @ (a at: 2) extent: (a at: 3) @ (a at: 4)])
</methods> <methods> UI.InputState <category>private</category>
processUnknownEvent: event for: aWindow "Process an unknown event, which are general window system events that Smalltalk itself doesn't use." Screen default platformName = 'MS-Windows' ifTrue: [| eventID | eventID := (event at: 10) longAt: 9. eventID = 16r51 ifTrue: [WindowsInputManager charSet: ((event at: 10) longAt: 13)]. eventID = 16r7E ifTrue: [ "WM_DISPLAYCHANGE" Screen default installBoundingBox; setChangedColorDepth. CachedImage eraseCaches. Icon eraseCaches]]. aWindow ifNil: [^self]. aWindow sensor ifNotNil: [:sensor | sensor eventUnknown: event]
</methods> <methods> Graphics.CachedImage class <category>private</category>
eraseCaches self allInstancesDo: [:inst | inst eraseCache]
</methods> <methods> Graphics.CachedImage <category>private</category>
eraseCache retainedMedium := nil
</methods> <methods> Graphics.Mask <category>accessing</category>
currentBitsPerPixel ^self bitsPerPixel
currentDepth ^self depth
</methods> <methods> OS.Win32SystemSupport <category>constants</category>
BITSPIXEL ^12
</methods> <methods> OS.Win32SystemSupport <category>procedures</category>
getScreenColorDepth | hdc | hdc := self GetDC: nil. ^ [(self GetDeviceCaps: hdc for: self BITSPIXEL) * (self GetDeviceCaps: hdc for: self PLANES)] ensure: [self ReleaseDC: hdc forWindow: nil]
</methods> <methods> OS.Win32SystemSupport <category>types</category>
HWND <C: typedef HANDLE HWND>
</methods> <methods> OS.Win32SystemSupport <category>constants</category>
PLANES ^14
</methods> <methods> Graphics.Window <category>accessing</category>
currentBitsPerPixel ^self graphicsDevice currentBitsPerPixel
currentDepth ^self graphicsDevice currentColorDepth
</methods> <methods> UI.Icon class <category>private</category>
eraseCaches | figure | IconConstants do: [:icon | figure := icon figure. (figure isKindOf: CachedImage) ifTrue: [figure eraseCache]]
</methods> <methods> UI.Icon <category>private accessing</category>
figure ^figure
</methods> <methods> OS.Win32SystemSupport <category>procedures</category>
GetDC: windowHndlOrNil <C:HDC GetDC(HWND windowHndlOrNil)> ^self externalAccessFailedWith: _errorCode
GetDeviceCaps: hdc for: nIndex <C: int GetDeviceCaps(HDC hdc, int nIndex)> ^self externalAccessFailedWith: _errorCode
ReleaseDC: hdc forWindow: windowHndlOrNil <C: int ReleaseDC(HWND windowHndlOrNil, HDC hdc)> ^self externalAccessFailedWith: _errorCode
</methods> "Imported Classes:" self error: 'Attempting to file-in parcel imports. Choose terminate or close' <class> <name>Icon</name> <environment>UI</environment> <super>Graphics.VisualComponent</super> <private>false</private> none figure shape <imports></imports> <category>Interface-Support</category> <attributes> <package>Interface-Support</package> </attributes> </class> <class> <name>DisplaySurface</name> <environment>Graphics</environment> <super>Graphics.GraphicsMedium</super> <private>false</private> none handle width height background <imports></imports> <category>OS-Window System</category> <attributes> <package>OS-Window System</package> </attributes> </class> <class> <name>InputState</name> <environment>UI</environment> <super>Core.Object</super> <private>false</private> none x y bitState shiftState ctrlState lockState metaState metaKeyState otherMetaKey1State lastClick eventDispatcher lastDownPoint lastUpPoint lastUpButton lastWindow <imports></imports> <category>OS-Window System</category> <attributes> <package>OS-Window System</package> </attributes> </class> <class> <name>CachedImage</name> <environment>Graphics</environment> <super>Graphics.PixelArray</super> <private>false</private> none image retainedMedium conversionMessage <imports></imports> <category>Graphics-Images</category> <attributes> <package>Graphics-Images</package> </attributes> </class> <class> <name>Win32SystemSupport</name> <environment>OS</environment> <super>OS.OSSystemSupport</super> <private>false</private> none <imports> OS.Win32SystemSupportDictionary.* </imports> <category>OS-Support</category> <attributes> <includeFiles></includeFiles> <includeDirectories></includeDirectories> <libraryFiles><item>kernel32.dll</item> <item>gdi32.dll</item> <item>advapi32.dll</item> <item>user32.dll</item></libraryFiles> <libraryDirectories></libraryDirectories> false full <package>OS-Support</package> </attributes> </class> <class> <name>Window</name> <environment>Graphics</environment> <super>Graphics.DisplaySurface</super> <private>false</private> none inputOrigin creationOrigin sensor iconic windowType effectiveWindowType statusLineHeight allowsStatusLine mapped eventHandlers windowManager <imports></imports> <category>OS-Window System</category> <attributes> <package>OS-Window System</package> </attributes> </class> <class> <name>Mask</name> <environment>Graphics</environment> <super>Graphics.UnmappableSurface</super> <private>false</private> none <imports></imports> <category>OS-Window System</category> <attributes> <package>OS-Window System</package> </attributes> </class> <class> <name>HostGraphicsDevice</name> <environment>Graphics</environment> <super>Graphics.GraphicsDevice</super> <private>false</private> none colorDepth colorBitsPerPixel coverageDepth coverageBitsPerPixel openFonts platName <imports></imports> <category>Graphics-Support</category> <attributes> <package>Graphics-Support</package> </attributes> </class> <class> <name>Pixmap</name> <environment>Graphics</environment> <super>Graphics.UnmappableSurface</super> <private>false</private> none <imports></imports> <category>OS-Window System</category> <attributes> <package>OS-Window System</package> </attributes> </class>