Merge jv
authorJan Vrany <jan.vrany@fit.cvut.cz>
Tue, 12 May 2015 08:52:59 +0100
branchjv
changeset 6865 d68e403297d6
parent 6859 3705bc26d1d5 (current diff)
parent 6863 48127be3e1be (diff)
child 6866 43c6f8fe92e6
Merge
Form.st
SimpleView.st
--- a/Form.st	Thu May 07 06:36:23 2015 +0200
+++ b/Form.st	Tue May 12 08:52:59 2015 +0100
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "
  COPYRIGHT (c) 1989 by Claus Gittinger
 	      All Rights Reserved
@@ -11,6 +13,8 @@
 "
 "{ Package: 'stx:libview' }"
 
+"{ NameSpace: Smalltalk }"
+
 GraphicsMedium subclass:#Form
 	instanceVariableNames:'depth localColorMap offset data maskedPixelsAre0'
 	classVariableNames:'VeryLightGreyForm LightGreyForm GreyForm DarkGreyForm
@@ -77,10 +81,6 @@
 "
 !
 
-version
-    ^ '$Header: /cvs/stx/stx/libview/Form.st,v 1.150.2.4 2015-01-29 09:54:04 stefan Exp $'
-! !
-
 !Form class methodsFor:'initialization'!
 
 initialize
@@ -88,13 +88,14 @@
 
     AdditionalBitmapDirectoryNames isNil ifTrue:[
         OperatingSystem isMSWINDOWSlike ifTrue:[
+            AdditionalBitmapDirectoryNames := #().
         ] ifFalse:[
             AdditionalBitmapDirectoryNames := #('/usr/lib/X11/bitmaps').
         ].
+
+        "want to be informed when returning from snapshot"
+        ObjectMemory addDependent:self.
     ].
-
-    "want to be informed when returning from snapshot"
-    ObjectMemory addDependent:self.
 !
 
 reinitializeAllOn:aDevice
@@ -2030,5 +2031,11 @@
     ^ self
 ! !
 
+!Form class methodsFor:'documentation'!
+
+version
+    ^ '$Header: /cvs/stx/stx/libview/Form.st,v 1.153 2015-05-07 20:41:47 cg Exp $'
+! !
+
 
 Form initialize!
--- a/Image.st	Thu May 07 06:36:23 2015 +0200
+++ b/Image.st	Tue May 12 08:52:59 2015 +0100
@@ -126,6 +126,15 @@
                             planned - not yet implemented.
 
 
+    Notice:
+        the set of attributes and the way they are stored originated initially 
+        from the need to represent tiff images. These turned out to use a relatively
+        large set of atributes, of which many are unused in other image formats.
+        (so it was sufficient).
+        Later, some VisualWorks compatibility protocol was added (mapped palettes, for
+        example), and some stuff could well be redefined in simpler ways.
+        We may do that, if we are bored and there is nothing else to improve... ;-)
+
 
     [instance variables:]
 
@@ -3310,7 +3319,18 @@
      instances or by image readers. Calling for a change of an
      existing image may confuse later pixel interpretation."
 
-    bitsPerSample := aCollection
+    "/ the following is a trick to get shared Immutable instances, at least for the
+    "/ most common cases. Prevents writers to do what is described above.
+    "/ Just an experiment...
+    aCollection = #( 8 8 8 ) ifTrue:[
+        bitsPerSample := #( 8 8 8 )
+    ] ifFalse:[
+        aCollection = #( 8 ) ifTrue:[
+            bitsPerSample := #( 8 )
+        ] ifFalse:[
+            bitsPerSample := aCollection
+        ].
+    ].
 
     "Modified: 23.4.1996 / 11:08:31 / cg"
 !
@@ -3325,21 +3345,21 @@
     depth := self depth.
     bitsPerPixel := d.
     d == 24 ifTrue:[
-	samplesPerPixel := 3.
-	bitsPerSample := #[8 8 8]
+        samplesPerPixel := 3.
+        bitsPerSample := #(8 8 8)
     ] ifFalse:[
-	d == 32 ifTrue:[
-	    samplesPerPixel := 4.
-	    bitsPerSample := #[8 8 8 8]
-	] ifFalse:[
-	    d == 16 ifTrue:[
-		samplesPerPixel := 3.
-		bitsPerSample := #[5 5 5]
-	    ] ifFalse:[
-		samplesPerPixel := 1.
-		bitsPerSample := ByteArray with:d
-	    ]
-	]
+        d == 32 ifTrue:[
+            samplesPerPixel := 4.
+            bitsPerSample := #(8 8 8 8)
+        ] ifFalse:[
+            d == 16 ifTrue:[
+                samplesPerPixel := 3.
+                bitsPerSample := #(5 5 5)
+            ] ifFalse:[
+                samplesPerPixel := 1.
+                bitsPerSample := ByteArray with:d
+            ]
+        ]
     ]
 
     "Modified: / 27-05-2007 / 16:59:47 / cg"
@@ -14552,11 +14572,11 @@
 !Image class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/Image.st,v 1.469 2015-04-23 21:26:11 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/Image.st,v 1.470 2015-05-11 15:46:36 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libview/Image.st,v 1.469 2015-04-23 21:26:11 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/Image.st,v 1.470 2015-05-11 15:46:36 cg Exp $'
 ! !
 
 
--- a/SimpleView.st	Thu May 07 06:36:23 2015 +0200
+++ b/SimpleView.st	Tue May 12 08:52:59 2015 +0100
@@ -9665,11 +9665,11 @@
     self fetchDeviceResources.
 
     self drawableId isNil ifTrue:[
-	self create.
-	self drawableId isNil ifTrue:[
-	    ('SimpleView [warning]: could not create view: ' , self class name) errorPrintCR.
-	    ^ self
-	]
+        self create.
+        self drawableId isNil ifTrue:[
+            ('SimpleView [warning]: could not create view: ' , self class name) errorPrintCR.
+            ^ self
+        ]
     ].
 
     groupChange := false.
@@ -9677,85 +9677,85 @@
     (windowGroup notNil
      and:[superView isNil
      and:[windowGroup isForModalSubview]]) ifTrue:[
-	keep := true.
+        keep := true.
     ] ifFalse:[
-	keep := keepGroupAsIs
+        keep := keepGroupAsIs
     ].
 
     keep ifFalse:[
-	"
-	 put myself into superviews windowgroup if there is a superview
-	 This is the default behavior, which may be suppressed by
-	 passing true as keepGroupAsIs-argument.
-	 (it may be useful to assign a separate windowGroup to
-	  a childView to have it execute independent of the parent
-	  -> an example is found in the fileBrowsers kill-button)
-	"
-	superView notNil ifTrue:[
-	    superGroup := superView windowGroup.
-	    (windowGroup notNil and:[superGroup ~~ windowGroup]) ifTrue:[
-		"
-		 mhmh - seems that the windowgroup has changed ....
-		"
+        "
+         put myself into superviews windowgroup if there is a superview
+         This is the default behavior, which may be suppressed by
+         passing true as keepGroupAsIs-argument.
+         (it may be useful to assign a separate windowGroup to
+          a childView to have it execute independent of the parent
+          -> an example is found in the fileBrowsers kill-button)
+        "
+        superView notNil ifTrue:[
+            superGroup := superView windowGroup.
+            (windowGroup notNil and:[superGroup ~~ windowGroup]) ifTrue:[
+                "
+                 mhmh - seems that the windowgroup has changed ....
+                "
 "/                'oops - wgroup change on realize' printNL.
-		groupChange := true.
-
-		"/
-		"/ recursively change the windowGroup of
-		"/ myself and all of my children
-		"/
-		self windowGroup:superGroup.
-	    ] ifFalse:[
-		windowGroup isNil ifTrue:[
-		    "/
-		    "/ only change the group of myself -
-		    "/ subviews will fetch it when realized.
-		    "/
-		    windowGroup := superGroup.
-		    superGroup notNil ifTrue:[superGroup addView:self].
-		]
-	    ].
-	].
+                groupChange := true.
+
+                "/
+                "/ recursively change the windowGroup of
+                "/ myself and all of my children
+                "/
+                self windowGroup:superGroup.
+            ] ifFalse:[
+                windowGroup isNil ifTrue:[
+                    "/
+                    "/ only change the group of myself -
+                    "/ subviews will fetch it when realized.
+                    "/
+                    windowGroup := superGroup.
+                    superGroup notNil ifTrue:[superGroup addView:self].
+                ]
+            ].
+        ].
     ].
 
     (self originOrExtentChanged) ifTrue:[
-	self fixSize.
-	self sizeChanged:nil.
+        self fixSize.
+        self sizeChanged:nil.
     ].
     position notNil ifTrue:[
-	self origin:position.
+        self origin:position.
     ].
 
     (subViews notNil or:[components notNil]) ifTrue:[
-	(realized not or:[groupChange]) ifTrue:[
-self isHiddenOnRealize ifFalse:[
-	    self realizeAllSubViews.
-].
-	].
+        (realized not or:[groupChange]) ifTrue:[
+            self isHiddenOnRealize ifFalse:[
+                self realizeAllSubViews.
+            ].
+        ].
     ].
 
     self preRealize.
 
     iconified ifTrue:[
-	realized ifFalse:[
-	    self mapIconified
-	]
+        realized ifFalse:[
+            self mapIconified
+        ]
     ] ifFalse:[
-	(self isHiddenOnRealize not
-	 and:[visibilityChannel isNil or:[visibilityChannel value]]) ifTrue:[
-	    self setInnerClip.
-
-	    realized ifFalse:[
-		"
-		 now, make the view visible
-		"
-		self mapAt:position
-	    ]
-	]
+        (self isHiddenOnRealize not
+         and:[visibilityChannel isNil or:[visibilityChannel value]]) ifTrue:[
+            self setInnerClip.
+
+            realized ifFalse:[
+                "
+                 now, make the view visible
+                "
+                self mapAt:position
+            ]
+        ]
     ].
 
     controller notNil ifTrue:[
-	controller startUp
+        controller startUp
     ].
 
     self postRealize
@@ -9788,6 +9788,23 @@
     ]
 !
 
+recursiveRealizeAllSubViews
+    "realize all my subviews and all of their subviews - but not myself."
+
+    subViews notNil ifTrue:[
+        subViews do:[:subView |
+            subView realize.
+            subView recursiveRealizeAllSubViews.
+        ]
+    ].
+    components notNil ifTrue:[
+        components do:[:component |
+            component realize.
+            component recursiveRealizeAllSubViews.
+        ]
+    ].
+!
+
 remap
     "make the view visible on the screen at its previous position.
      In contrast to map, this asks the windowManager to show the view
@@ -11472,11 +11489,11 @@
 !SimpleView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/SimpleView.st,v 1.788 2015-05-05 20:59:21 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/SimpleView.st,v 1.789 2015-05-11 18:57:02 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libview/SimpleView.st,v 1.788 2015-05-05 20:59:21 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/SimpleView.st,v 1.789 2015-05-11 18:57:02 cg Exp $'
 
 ! !
 
--- a/WindowGroup.st	Thu May 07 06:36:23 2015 +0200
+++ b/WindowGroup.st	Tue May 12 08:52:59 2015 +0100
@@ -1581,7 +1581,7 @@
 !
 
 processEvents
-    "process events from either the damage- or user input queues.
+    "process all pending events from either the damage- or user input queues.
      Abort is assumed to be handled elsewhere."
 
     self processEventsWithModalGroup:nil
@@ -1590,7 +1590,7 @@
 !
 
 processEventsWithModalGroup:modalGroup
-    "process events from either the damage- or user input queues.
+    "process all pending events from either the damage- or user input queues.
      Abort is assumed to be handled elsewhere.
      If modalGroup is non-nil, this is actually called from a modal-groups eventloop,
      in order for the underlying mainGroup (me) to handle its redraw events.
@@ -1847,7 +1847,7 @@
 !
 
 processExposeEvents
-    "process only expose events from the damage queue.
+    "process only pending expose events from the damage queue.
      This also handles resize, mapped and unmap events."
 
     self processExposeEventsFor:nil
@@ -1856,7 +1856,7 @@
 !
 
 processExposeEventsFor:aViewOrNil
-    "process only expose events from the damage queue.
+    "process only pending expose events from the damage queue.
      This also handles resize, mapped and unmap events."
 
     |event view sensor thisProcess|
@@ -1903,7 +1903,7 @@
 !
 
 processRealExposeEvents
-    "process only expose events from the damage queue
+    "process only pending expose events from the damage queue
      (for any of my views).
      This only handles true expose events - leaving map, unmap etc. in the queue.
      This is required after a scroll operation,
@@ -1913,7 +1913,7 @@
 !
 
 processRealExposeEventsFor:someViewOrNil
-    "process only expose events from the damage queue
+    "process only pending expose events from the damage queue
      (for any of my views if the arg is nil).
      This only handles true expose events - leaving map, unmap etc. in the queue.
      This is required after a scroll operation,
@@ -2867,11 +2867,11 @@
 !WindowGroup class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/WindowGroup.st,v 1.342 2015-05-03 20:45:27 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/WindowGroup.st,v 1.343 2015-05-11 15:27:27 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libview/WindowGroup.st,v 1.342 2015-05-03 20:45:27 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/WindowGroup.st,v 1.343 2015-05-11 15:27:27 cg Exp $'
 ! !