Marcel Taeumel uploaded a new version of Graphics to project The Trunk:
http://source.squeak.org/trunk/Graphics-mt.524.mcz
==================== Summary ====================
Name: Graphics-mt.524
Author: mt
Time: 22 June 2022, 11:47:35.985723 am
UUID: fc41bc62-0b72-a14f-999b-12d64a0a0cff
Ancestors: Graphics-mt.523
Document programming model for scale-factor-aware applications.
Note that this is not yet used throughout the system. However, applications written for Squeak 6.0 should be able to look as elegant as possible.
=============== Diff against Graphics-mt.523 ===============
Item was added:
+ ----- Method: Number>>em (in category '*Graphics-scale factor') -----
+ em
+ "Convert the receiver from multiples of width-of-capital-letter-M to pixels using the system's default font. Works also with pre-rendered fonts."
+
+ ^ (self * (TextStyle defaultFont widthOf: $M)) rounded!
Item was added:
+ ----- Method: Number>>ex (in category '*Graphics-scale factor') -----
+ ex
+ "Convert the receiver from multiples of x-height-of-font to pixels using the system's default TrueType font."
+
+ | tt |
+ tt := TextStyle defaultTTFont ttcDescription.
+ ^ (self asFloat
+ * (tt xHeight asFloat / tt unitsPerEm)
+ * (TextStyle defaultFont widthOf: $M)) rounded!
Item was added:
+ ----- Method: Number>>pt (in category '*Graphics-scale factor') -----
+ pt
+ "Convert the receiver from points to pixels. Note that this will not work correctly for 'faked' scale factors where larger (pre-rendered) fonts are used instead of adjusting the system's current ppi value."
+
+ ^ (TextStyle pointsToPixels: self) rounded
+
+ "
+ (TextStyle pixelsPerInch = 96.0 ifTrue: [
+ | extra |
+ extra := TextStyle defaultFont pointSize / TTCFont referencePointSize.
+ ^ (TextStyle pointsToPixels: self * extra) rounded]
+ "!
Item was added:
+ ----- Method: Number>>px (in category '*Graphics-scale factor') -----
+ px
+ "Convert the receiver representing raw pixels at 100% (96ppi) to the current scale factor. Note that you currently have to do this manually for all graphics-related properties and layout-specific measures such as #borderWidth: and #layoutInset:. Only for model windows (see #initialExtent) that are no dialogs, that scaling will happen automatically in ToolBuilder."
+
+ self flag: #discuss. "mt: For self > 4, I would recommend #rounded instead of #truncated. For smaller values, however, rounding makes no sense because we have no sub-pixel access and things would look too big too soon."
+ ^ (self * RealEstateAgent scaleFactor) truncated!
Marcel Taeumel uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-mt.1483.mcz
==================== Summary ====================
Name: Kernel-mt.1483
Author: mt
Time: 22 June 2022, 10:27:26.552465 am
UUID: cbe2e16a-7674-1b49-9c6e-f68c2d11eb94
Ancestors: Kernel-ct.1482
Document specific stepOver bug.
=============== Diff against Kernel-ct.1482 ===============
Item was changed:
----- Method: Context>>return:from: (in category 'instruction decoding') -----
return: value from: aSender
"For simulation. Roll back self to aSender and return value from it. Execute any unwind blocks on the way. ASSUMES aSender is a sender of self"
| newTop |
aSender isDead ifTrue:
[^self send: #cannotReturn: to: self with: {value}].
newTop := aSender sender.
(self findNextUnwindContextUpTo: newTop) ifNotNil:
[:unwindProtectCtxt|
+ self flag: #knownBug. "Cannot #stepOver '^2' in example '[^2] ensure: []'.
+ See http://lists.squeakfoundation.org/pipermail/squeak-dev/2022-June/220975.html"
^self send: #aboutToReturn:through: to: self with: {value. unwindProtectCtxt}].
self releaseTo: newTop.
newTop ifNotNil: [newTop push: value].
^newTop!
Marcel Taeumel uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-mt.1165.mcz
==================== Summary ====================
Name: Tools-mt.1165
Author: mt
Time: 22 June 2022, 9:01:09.312465 am
UUID: 9cc6a693-d855-bc46-a690-bb76af2a3210
Ancestors: Tools-mt.1164
Fixes serious regression from Tools-tpr.1008 (25 October 2020). Now the method-inheritance view works again.
Thanks to Chris (cmm) for reporting this!
=============== Diff against Tools-mt.1164 ===============
Item was changed:
----- Method: MessageSet>>initializeMessageList: (in category 'private') -----
initializeMessageList: anArray
"Initialize my messageList from the given list of MethodReference or string objects. NB: special handling for uniclasses.
+ Do /not/ replace the elements of anArray if they are already MethodReferences, so as to allow users to construct richer systems, such as differencers between existing and edited versions of code.
+ NOTE THAT we must support anArray to already have the desired amount and order of elements such as for the 'method inheritance' view, where all elements are prefixed with spaces to indicate the inheritance tree."
+
+ | isOrdered |
+ isOrdered := anArray size > 1
+ and: [anArray second isMethodReference]
+ and: [anArray second stringVersion first = Character space].
+ messageList := isOrdered
+ ifTrue: [OrderedCollection new]
+ ifFalse: [Set new].
- Do /not/ replace the elements of anArray if they are already MethodReferences, so as to allow users to construct richer systems, such as differencers between existing and edited versions of code."
- messageList := Set new.
anArray do:
[:each | each isMethodReference
ifTrue: [messageList add: each]
ifFalse:
[ MessageSet
parse: each
toClassAndSelector:
[ : class : sel | class ifNotNil: [ messageList add: (MethodReference class: class selector: sel) ] ] ] ].
+ isOrdered ifFalse: [messageList := messageList asOrderedCollection sort].
- messageList := messageList asOrderedCollection sort.
"Unify labels if wanted."
self class useUnifiedMessageLabels ifTrue:
[ messageList withIndexDo:
[ : each : index | | cls |
cls := each actualClass.
each stringVersion:
(self indentionPrefixOfSize: (self indentionsIn: each stringVersion))
, (cls
ifNil: [each asString]
ifNotNil:
[cls isUniClass
ifTrue: [cls typicalInstanceName, ' ', each selector]
ifFalse:
[ cls name , ' ' , each selector , ' {'
, ((cls organization categoryOfElement: each selector) ifNil: ['']) , '}'
, ' {', cls category, '}' ] ]) ] ].
messageListIndex := messageList isEmpty ifTrue: [0] ifFalse: [1].
contents := String empty!
Marcel Taeumel uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-mt.1363.mcz
==================== Summary ====================
Name: System-mt.1363
Author: mt
Time: 22 June 2022, 8:25:40.123465 am
UUID: 3e4c5e3a-0b73-ad4f-a018-fa710696e7dd
Ancestors: System-ct.1362
Updates copyright to 2022.
=============== Diff against System-ct.1362 ===============
Item was changed:
----- Method: SmalltalkImage>>license (in category 'license') -----
license
"This method was automatically generated. Edit it using:"
"SqueakLicenseHelp edit: #officialLicense"
^ (
'The current release of Squeak is a combination of source code originating from Apple which Apple agreed to license under the Apache License and more recent contributions licensed under the MIT license. The vast majority of the code is under the MIT License:
MIT License
+ Copyright (c) The individual, corporate, and institutional contributors who have collectively contributed elements to this software ("The Squeak Community"), 1996-2022 All rights reserved.
- Copyright (c) The individual, corporate, and institutional contributors who have collectively contributed elements to this software ("The Squeak Community"), 1996-2021 All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Portions of Squeak are covered by the Apache License:
Apache License, Version 2.0
Copyright (c) Xerox Corp. 1981, 1982 All rights reserved.
Copyright (c) Apple Computer, Inc. 1985-1996 All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
!!
]style[(258 1 11 1216 53 2 27 297 42 308)c159159159,,b,,c159159159,,b,,Rhttp://www.apache.org/licenses/LICENSE-2…;,!!' readStream nextChunkText)!
Christoph Thiede uploaded a new version of Help-Squeak-Project to project The Trunk:
http://source.squeak.org/trunk/Help-Squeak-Project-ct.93.mcz
==================== Summary ====================
Name: Help-Squeak-Project-ct.93
Author: ct
Time: 21 June 2022, 10:31:42.580176 pm
UUID: 93c9bbf1-56fe-2141-8574-f579cc34d177
Ancestors: Help-Squeak-Project-ct.92
Fixes formatting issues to licenses. Removes unintentional font changes. Do not use "style it" from the extra emphasis menu at the moment because syntax highlights will not be updated when the user chooses a different color theme.
=============== Diff against Help-Squeak-Project-ct.92 ===============
Item was changed:
----- Method: SqueakLicenseHelp class>>fontLicenseBitstreamVera (in category 'pages') -----
fontLicenseBitstreamVera
"This method was automatically generated. Edit it using:"
"SqueakLicenseHelp edit: #fontLicenseBitstreamVera"
<generated>
^(HelpTopic
title: 'Bitstream Vera License'
readOnlyContents:
'Bitstream Vera Fonts Copyright
The fonts have a generous copyright, allowing derivative works (as
long as "Bitstream" or "Vera" are not in the names), and full
redistribution (so long as they are not *sold* by themselves). They
can be be bundled, redistributed and sold with any software.
The fonts are distributed under the following copyright:
Copyright
Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream
Vera is a trademark of Bitstream, Inc.
Permission is hereby granted, free of charge, to any person obtaining
a copy of the fonts accompanying this license ("Fonts") and associated
documentation files (the "Font Software"), to reproduce and distribute
the Font Software, including without limitation the rights to use,
copy, merge, publish, distribute, and/or sell copies of the Font
Software, and to permit persons to whom the Font Software is furnished
to do so, subject to the following conditions:
The above copyright and trademark notices and this permission notice
shall be included in all copies of one or more of the Font Software
typefaces.
The Font Software may be modified, altered, or added to, and in
particular the designs of glyphs or characters in the Fonts may be
modified and additional glyphs or characters may be added to the
Fonts, only if the fonts are renamed to names not containing either
the words "Bitstream" or the word "Vera".
This License becomes null and void to the extent applicable to Fonts
or Font Software that has been modified and is distributed under the
"Bitstream Vera" names.
The Font Software may be sold as part of a larger software package but
no copy of one or more of the Font Software typefaces may be sold by
itself.
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL
BITSTREAM OR THE GNOME FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL,
OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT
SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.
Except as contained in this notice, the names of Gnome, the Gnome
Foundation, and Bitstream Inc., shall not be used in advertising or
otherwise to promote the sale, use or other dealings in this Font
Software without prior written authorization from the Gnome Foundation
or Bitstream Inc., respectively. For further information, contact:
fonts at gnome dot org.
Copyright FAQ
1. I don''t understand the resale restriction... What gives?
Bitstream is giving away these fonts, but wishes to ensure its
competitors can''t just drop the fonts as is into a font sale system
and sell them as is. It seems fair that if Bitstream can''t make money
from the Bitstream Vera fonts, their competitors should not be able to
do so either. You can sell the fonts as part of any software package,
however.
2. I want to package these fonts separately for distribution and
sale as part of a larger software package or system. Can I do so?
Yes. A RPM or Debian package is a "larger software package" to begin
with, and you aren''t selling them independently by themselves.
See 1. above.
3. Are derivative works allowed?
Yes!!!!
4. Can I change or add to the font(s)?
Yes, but you must change the name(s) of the font(s).
5. Under what terms are derivative works allowed?
You must change the name(s) of the fonts. This is to ensure the
quality of the fonts, both to protect Bitstream and Gnome. We want to
ensure that if an application has opened a font specifically of these
names, it gets what it expects (though of course, using fontconfig,
substitutions could still could have occurred during font
opening). You must include the Bitstream copyright. Additional
copyrights can be added, as per copyright law. Happy Font Hacking!!!!
6. If I have improvements for Bitstream Vera, is it possible they might get
adopted in future versions?
Yes. The contract between the Gnome Foundation and Bitstream has
provisions for working with Bitstream to ensure quality additions to
the Bitstream Vera font family. Please contact us if you have such
additions. Note, that in general, we will want such additions for the
entire family, not just a single font, and that you''ll have to keep
both Gnome and Jim Lyles, Vera''s designer, happy!!!! To make sense to add
glyphs to the font, they must be stylistically in keeping with Vera''s
design. Vera cannot become a "ransom note" font. Jim Lyles will be
providing a document describing the design elements used in Vera, as a
guide and aid for people interested in contributing to Vera.
7. I want to sell a software package that uses these fonts: Can I do so?
Sure. Bundle the fonts with your software and sell your software
with the fonts. That is the intent of the copyright.
8. If applications have built the names "Bitstream Vera" into them,
can I override this somehow to use fonts of my choosing?
This depends on exact details of the software. Most open source
systems and software (e.g., Gnome, KDE, etc.) are now converting to
use fontconfig (see www.fontconfig.org) to handle font configuration,
selection and substitution; it has provisions for overriding font
names and subsituting alternatives. An example is provided by the
supplied local.conf file, which chooses the family Bitstream Vera for
"sans", "serif" and "monospace". Other software (e.g., the XFree86
core server) has other mechanisms for font substitution.
***
TTFontDescription descriptionFullNamed: ''Bitstream Vera Sans''.
TTFontDescription descriptionFullNamed: ''Bitstream Vera Sans Bold''.
TTFontDescription descriptionFullNamed: ''Bitstream Vera Sans Bold Oblique''.
TTFontDescription descriptionFullNamed: ''Bitstream Vera Sans Mono''.
TTFontDescription descriptionFullNamed: ''Bitstream Vera Sans Mono Bold''.
TTFontDescription descriptionFullNamed: ''Bitstream Vera Sans Mono Bold Oblique''.
TTFontDescription descriptionFullNamed: ''Bitstream Vera Sans Mono Oblique''.
TTFontDescription descriptionFullNamed: ''Bitstream Vera Sans Oblique''.
TTFontDescription descriptionFullNamed: ''Bitstream Vera Serif''.
+ TTFontDescription descriptionFullNamed: ''Bitstream Vera Serif Bold''.!!' readStream nextChunkText)
- TTFontDescription descriptionFullNamed: ''Bitstream Vera Serif Bold''.!!
- ]style[(30 319 9 2311 13 3176 22 21 20 21 1 26 20 21 1 34 20 21 1 26 20 21 1 31 20 21 1 39 20 21 1 34 20 21 1 29 20 21 1 22 20 21 1 27 1)b,,b,,b,,c000000124,c124000124n,,c000000124,,c124000124n,,c000000124,,c124000124n,,c000000124,,c124000124n,,c000000124,,c124000124n,,c000000124,,c124000124n,,c000000124,,c124000124n,,c000000124,,c124000124n,,c000000124,,c124000124n,,c000000124,,c124000124n,!!' readStream nextChunkText)
key: #fontLicenseBitstreamVera;
shouldStyle: false;
yourself!
Item was changed:
----- Method: SqueakLicenseHelp class>>noteOnResources (in category 'pages') -----
noteOnResources
"This method was automatically generated. Edit it using:"
"SqueakLicenseHelp edit: #noteOnResources"
+ <generated>
^(HelpTopic
title: 'Note on Resources'
contents:
'Squeak provides several resources (such as icons or sounds) that may come with an extra license if the MIT license does not cover the particular artistic work. If such resources are materialized in source code (such as MenuIcons class >> #fugueBroomIconContents), we note the particular license in method comments.
In general, we are eager to only use extra licenses that share the spirit of the MIT license. Creative Commons falls in this category. Visit https://creativecommons.org/share-your-work/ to learn more.!!
+ ]style[(82 13 8 11 105 42 37 15 97 16 31 44 15),i,,b,,Rcode:// MenuIcons class >> #fugueBroomIconContents;,,i,,b,,Rhttps://creativecommons.org/share-your-work/;,!!' readStream nextChunkText)
- ]style[(82 13 8 11 31 13 61 42 37 15 97 16 31 44 15)f1,f1i,f1,f1b,f1,f1i,f1,Rcode://MenuIcons class >> #fugueBroomIconContents;,f1,f1i,f1,f1b,f1,Rhttps://creativecommons.org/share-your-work/;,!!' readStream nextChunkText)
key: #noteOnResources;
shouldStyle: false;
yourself!
Christoph Thiede uploaded a new version of Help-Squeak-Project to project The Trunk:
http://source.squeak.org/trunk/Help-Squeak-Project-ct.92.mcz
==================== Summary ====================
Name: Help-Squeak-Project-ct.92
Author: ct
Time: 21 June 2022, 10:23:31.150176 pm
UUID: b3a47996-1e44-8d41-876c-7914e08d56d4
Ancestors: Help-Squeak-Project-tpr.91
Updates help on some tools:
Transcript: Document core API of TranscriptStream. Fix some formatting.
Versions Browser: Fix formatting (redundant font changes).
=============== Diff against Help-Squeak-Project-tpr.91 ===============
Item was changed:
----- Method: SqueakToolsTranscriptHelp class>>transcript (in category 'pages') -----
transcript
"This method was automatically generated. Edit it using:"
"SqueakToolsTranscriptHelp edit: #transcript"
+ <generated>
^(HelpTopic
title: 'The Transcript window'
contents:
'The Transcript window is often used for logging or printing results from text only code.
To open the Transcript use TheWorldMenu and choose ''open...''. Then choose ''Transcript''.
You can also type
+ Transcript open
- Transcript open
in a Workspace and doIt.
+
+ To write anything into the Transcript, send it #show: or #showln::
+
+ Transcript showln: ''Hello world!!!!''.
+ Transcript show: '' :-)''.!!
+ ]style[(197 16 6 9 59 6 4 8 3 59),I1,,Rcode://Workspace open;,,LTranscriptStream show:;,,LTranscriptStream showln:;,,I1!!' readStream nextChunkText)
+ key: #transcript;
+ shouldStyle: false;
+ yourself!
- !!
- ]style[(222 9 11),Rcode://Workspace open;,!!' readStream nextChunkText)
- key: #transcript!
Item was changed:
----- Method: SqueakToolsVersionsBrowserHelp class>>versionsBrowser (in category 'pages') -----
versionsBrowser
- <generated>
"This method was automatically generated. Edit it using:"
"SqueakToolsVersionsBrowserHelp edit: #versionsBrowser"
+ <generated>
^(HelpTopic
title: 'What is a Versions Browser'
contents:
'The VersionsBrowser is a window that shows all implementations of a method or a class comment that have been ever installed in past or present. Inter alia, it allows you to compare certain versions or revert earlier versions.
Each entry in the list pane represents a version of the source code for the same method; the topmost entry is the current version, the next entry is the next most recent, etc.!!
+ ]style[(4 15 383)b,Rcode:// VersionsBrowser browseMethod: VersionsBrowser >> #compareToOtherVersion;b,!!' readStream nextChunkText)
- ]style[(4 15 208 175)f1b,Rcode://VersionsBrowser browseMethod: VersionsBrowser >> #compareToOtherVersion;b,f1,!!' readStream nextChunkText)
key: #versionsBrowser;
shouldStyle: false;
yourself!
Marcel Taeumel uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-mt.1013.mcz
==================== Summary ====================
Name: Collections-mt.1013
Author: mt
Time: 21 June 2022, 2:11:52.477349 pm
UUID: dc83d352-edda-ef46-a1ba-483a6e4dd256
Ancestors: Collections-ct.1012
Fixes Z-order of Morphic windows for text actions other than "code://" in TextURL. All use #addDeferredUIMessage: for now. Also tested in MVC.
Thanks to Lauren (lrnp) and Karl (kfr) for the pointer!!
Also see: https://github.com/squeak-smalltalk/squeak-object-memory/issues/50
=============== Diff against Collections-ct.1012 ===============
Item was changed:
----- Method: TextDoIt>>actOnClickFor: (in category 'event handling') -----
actOnClickFor: anObject
"Note: evalString gets evaluated IN THE CONTEXT OF anObject
-- meaning that self and all instVars are accessible"
+ Project current addDeferredUIMessage: [Compiler evaluate: evalString for: anObject].
- Compiler evaluate: evalString for: anObject.
^ true !
Item was changed:
----- Method: TextInspectIt>>actOnClickFor:in:at:editor: (in category 'mouse events') -----
actOnClickFor: anObject in: aParagraph at: clickPoint editor: editor
"Note: evalString gets evaluated IN THE CONTEXT OF anObject
-- meaning that self and all instVars are accessible"
+ Project current addDeferredUIMessage: [
+ self target
+ ifNil: [(Compiler evaluate: evalString for: anObject) inspect]
+ ifNotNil: [:object | object inspect] ].
- self target
- ifNil: [(Compiler evaluate: evalString for: anObject) inspect]
- ifNotNil: [:object | object inspect].
^ true !
Item was changed:
----- Method: TextLink>>actOnClickFor: (in category 'event handling') -----
actOnClickFor: aMessageSet
"Add to the end of the list. 'aClass selector', 'aClass Comment', 'aClass Definition', 'aClass Hierarchy' are the formats allowed."
+ Project current addDeferredUIMessage: [aMessageSet addItem: classAndMethod].
- aMessageSet addItem: classAndMethod.
^ true!
Marcel Taeumel uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-mt.1164.mcz
==================== Summary ====================
Name: Tools-mt.1164
Author: mt
Time: 21 June 2022, 12:11:44.074865 pm
UUID: d9b06d00-9ac3-6445-be0f-9951d54a20ff
Ancestors: Tools-mt.1163
Tweak the debugger UI a little bit wrt. the new #terminate vs. #terminateAggressively semantics. Note that the current #terminateAggressively is the former #terminate while the current #terminate will allow the active unwind context to complete.
Use preferences to tweak the close button and the notifier-debugger buttons. Use the window menu to always choose between "abandon" (i.e., #terminateAggressively) and "terminate".
The defaults are so that both GUI and semantics remain compatible with Squeak 5.3:
[x] #closeMeansAbandon
[x] #showAbandonButton
[ ] #showTerminateButton
=============== Diff against Tools-mt.1163 ===============
Item was changed:
CodeHolder subclass: #Debugger
instanceVariableNames: 'interruptedProcess contextStack contextStackIndex contextStackList receiverInspector receiverInspectorState contextVariablesInspector contextVariablesInspectorState externalInterrupt proceedValue selectingPC savedCursor isolationHead failedProject labelString message untilExpression terminateProcessSelector'
+ classVariableNames: 'CloseMeansAbandon ContextStackKeystrokes ErrorReportServer FullStackSize InterruptUIProcessIfBlockedOnErrorInBackgroundProcess NotifierStackSize SavedExtent ShowAbandonButton ShowTerminateButton StackSizeLimit WantsAnnotationPane'
- classVariableNames: 'ContextStackKeystrokes ErrorReportServer FullStackSize InterruptUIProcessIfBlockedOnErrorInBackgroundProcess NotifierStackSize SavedExtent StackSizeLimit WantsAnnotationPane'
poolDictionaries: ''
category: 'Tools-Debugger'!
!Debugger commentStamp: 'mt 12/17/2019 12:19' prior: 0!
I represent the machine state at the time of an interrupted process. I also represent a query path into the state of the process. The debugger is typically viewed through a window that views the stack of suspended contexts, the code for, and execution point in, the currently selected message, and inspectors on both the receiver of the currently selected message, and the variables in the current context.
Special note on recursive errors:
Some errors affect Squeak's ability to present a debugger. This is normally an unrecoverable situation. However, if such an error occurs in an isolation layer, Squeak will attempt to exit from the isolation layer and then present a debugger. Here is the chain of events in such a recovery.
* A recursive error is detected.
* The current project is queried for an isolationHead
* Changes in the isolationHead are revoked
* The parent project of isolated project is returned to
* The debugger is opened there and execution resumes.
If the user closes that debugger, execution continues in the outer project and layer. If, after repairing some damage, the user proceeds from the debugger, then the isolationHead is re-invoked, the failed project is re-entered, and execution resumes in that world.
---
In September 2019, we added MorphicDebugger and MVCDebugger to untangle framework-specific features in our debugger infrastructure. However, this is just an intermediate step. The overall goal would be to remove those two subclasses again while preserving their functionality. Mostly, MVC and Morphic differ in their GUI-process management. This means that "proceed" and "close" work differently depending on the process that is being debugged. --- One idea is to attach that framework-specific information to the process objects. See Process >> #environmentAt: and #environmentAt:put:. Also see ToolSet's #handle* and #debug* methods.!
Item was added:
+ ----- Method: Debugger class>>closeMeansAbandon (in category 'preferences') -----
+ closeMeansAbandon
+ <preference: 'Terminate aggressively on window closed'
+ categoryList: #(debug tools)
+ description: 'When enabled, closing the window of a full or notifier debugger will terminate the process aggressively, which means that the active unwind context (i.e., ensure-block) will not be completed. Not-yet-started unwind contexts are allowed to start and complete.'
+ type: #Boolean>
+
+ ^ CloseMeansAbandon ifNil: [true]!
Item was added:
+ ----- Method: Debugger class>>closeMeansAbandon: (in category 'preferences') -----
+ closeMeansAbandon: aBooleanOrNil
+
+ CloseMeansAbandon := aBooleanOrNil.!
Item was added:
+ ----- Method: Debugger class>>showAbandonButton (in category 'preferences') -----
+ showAbandonButton
+ <preference: 'Show ''Abandon'' button in notifier debugger'
+ categoryList: #(debug tools)
+ description: 'An extra button in the notifier window that allows the user to terminate the process aggressively, which means that the active unwind context (i.e., ensure-block) will not be completed. Not-yet-started unwind contexts are allowed to start and complete.'
+ type: #Boolean>
+
+ ^ ShowAbandonButton ifNil: [true]!
Item was added:
+ ----- Method: Debugger class>>showAbandonButton: (in category 'preferences') -----
+ showAbandonButton: aBooleanOrNil
+
+ ShowAbandonButton := aBooleanOrNil.!
Item was added:
+ ----- Method: Debugger class>>showTerminateButton (in category 'preferences') -----
+ showTerminateButton
+ <preference: 'Show ''Terminate'' button in notifier debugger'
+ categoryList: #(debug tools)
+ description: 'An extra button in the notifier window that allows the user to terminate the process while allowing the active context (i.e., ensure-block) to unwind first.'
+ type: #Boolean>
+
+ ^ ShowTerminateButton ifNil: [false]!
Item was added:
+ ----- Method: Debugger class>>showTerminateButton: (in category 'preferences') -----
+ showTerminateButton: aBooleanOrNil
+
+ ShowTerminateButton := aBooleanOrNil.!
Item was changed:
----- Method: Debugger>>addModelItemsToWindowMenu: (in category 'misc') -----
addModelItemsToWindowMenu: aMenu
super addModelItemsToWindowMenu: aMenu.
aMenu addLine.
aMenu
add: 'inspect process' translated target: self interruptedProcess action: #inspect;
add: 'explore process' translated target: self interruptedProcess action: #explore;
+ addLine;
add: 'terminate process' translated target: self action: #terminateProcess;
+ balloonTextForLastItem: 'Terminates this process while allowing the active context to unwind first. Unlike ''abandon,'' even a currently active ensure-block will be allowed to finish.' translated;
+ add: 'abandon process' translated target: self action: #abandon;
+ balloonTextForLastItem: 'Terminates this process <b>aggressively</b>, still allowing not-yet-started unwind contexts to start and complete. Unlike ''terminate,'' a currently active ensure-block will be discarded. ' translated asTextFromHtml.!
- balloonTextForLastItem: 'other than Abandon, this will allow the active context to unwind first.' translated.!
Item was changed:
----- Method: Debugger>>initialize (in category 'initialize') -----
initialize
super initialize.
Smalltalk at: #MessageTally ifPresentAndInMemory: [ :tally |
tally terminateTimerProcess].
externalInterrupt := false.
selectingPC := true.
contextStackIndex := 0.
+ "The default termination procedure is aggressive to ignore currently running, and thus erroneous, ensure-blocks in the debugged process. The preference can change that."
+ terminateProcessSelector := self class closeMeansAbandon
+ ifTrue: [#terminateAggressively]
+ ifFalse:[#terminate].!
- "The default termination procedure is aggressive to ignore currently running, and thus erroneous, ensure-blocks in the debugged process."
- terminateProcessSelector := #terminateAggressively.!
Item was changed:
----- Method: Debugger>>preDebugButtonQuads (in category 'initialize') -----
preDebugButtonQuads
^Preferences eToyFriendly
ifTrue: [
{
{'Send error report' translated. #sendReport. #blue. 'send a report of the encountered problem to the Squeak developers' translated}.
{'Abandon' translated. #abandon. #black. 'abandon this execution by closing this window' translated}.
{'Debug' translated. #debug. #red. 'bring up a debugger' translated}}]
ifFalse: [
{
{'Proceed' translated. #proceed. #blue. 'continue execution' translated. #interruptedProcessShouldResume}.
+ self class showTerminateButton ifTrue: [
+ {'Terminate' translated. #terminateProcess. #black. 'terminate this execution and close this window' translated}].
+ self class showAbandonButton ifTrue: [
+ {'Abandon' translated. #abandon. #black. 'terminate this execution aggressively and close this window' translated}].
+ {'Debug' translated. #debug. #red. 'bring up a debugger' translated}}
+ reject: [:quad | quad isNil] ]
- {'Abandon' translated. #abandon. #black. 'abandon this execution by closing this window' translated}.
- {'Debug' translated. #debug. #red. 'bring up a debugger' translated}}]
!
Karl Ramberg uploaded a new version of MorphicExtras to project The Treated Inbox:
http://source.squeak.org/treated/MorphicExtras-kfr.254.mcz
==================== Summary ====================
Name: MorphicExtras-kfr.254
Author: kfr
Time: 28 February 2019, 3:27:07.129575 pm
UUID: 9e0ac524-c2e1-44e1-a258-b2b5a7755fc8
Ancestors: MorphicExtras-kfr.253
Update extent form halo handle. Only grow allow extent to grow.
Unlimited undo of SketchMorphEditor. Just add current form to a collection.
Redo with holding shift down while undo.
This is a memory hog of a change. Must be reviewed
=============== Diff against MorphicExtras-kfr.253 ===============
Item was changed:
Morph subclass: #SketchEditorMorph
+ instanceVariableNames: 'hostView palette ticksToDwell rotationCenter registrationPoint newPicBlock emptyPicBlock paintingForm dimForm formCanvas rotationButton scaleButton cumRot cumMag undoBuffer enclosingPasteUpMorph forEachHand firstUndoFlag undoBufferIndex'
- instanceVariableNames: 'hostView palette ticksToDwell rotationCenter registrationPoint newPicBlock emptyPicBlock paintingForm dimForm formCanvas rotationButton scaleButton cumRot cumMag undoBuffer enclosingPasteUpMorph forEachHand'
classVariableNames: 'SketchTimes'
poolDictionaries: ''
category: 'MorphicExtras-Support'!
!SketchEditorMorph commentStamp: '<historical>' prior: 0!
Inst vars (converting to morphic events)
hostView -- SketchMorph we are working on.
stampForm -- Stamp is stored here.
canvasRectangle -- later use bounds
palette -- the PaintBox interface Morph
dirty -- not used
currentColor
ticksToDwell rotationCenter registrationPoint
newPicBlock -- do this after painting
action -- selector of painting action
paintingForm -- our copy
composite -- now paintArea origin. world relative. stop using it.
dimForm -- SketchMorph of the dimmed background. Opaque.
installed behind the editor morph.
buff
brush -- 1-bit Form of the brush,
paintingFormPen
formCanvas -- Aim it at paintingForm to allow it to draw ovals, rectangles, lines, etc.
picToComp dimToComp compToDisplay -- used to composite -- obsolete
picToBuff brushToBuff buffToBuff buffToPic
rotationButton scaleButton -- submorphs, handles to do these actions.
strokeOrigin -- During Pickup, origin of rect.
cumRot cumMag -- cumulative for multiple operations from same original
undoBuffer
lastEvent
currentNib -- 1 bit deep form.
For now, we do not carry the SketchMorph's registration point, rotation center, or ticksToDwell.
New -- using transform morphs to rotate the finished player. How get it rotated back and the rotationDegrees to be right? We cancel out rotationDegrees, so how remember it?
Registration point convention:
In a GraphicFrame, reg point is relative to this image's origin.
During painting, it is relative to canvasRectangle origin, and thus us absolute within the canvas. To convert back, subract newBox origin.
Be sure to convert back and forth correctly. In deliverPainting. initializeFromFrame:inView: !
Item was changed:
+ ----- Method: SketchEditorMorph>>extent: (in category 'morphic') -----
+ extent: aPoint
+ | form |
+ paintingForm ifNil: [^super extent: aPoint].
+ super extent: aPoint.
- ----- Method: SketchEditorMorph>>extent: (in category 'actions & preps') -----
- extent: aPoint
- | form |
- super extent: aPoint.
- paintingForm ifNotNil:[
form := Form extent: self extent depth: paintingForm depth.
paintingForm displayOn: form.
paintingForm := form.
+ forEachHand do: [:i | i at: #changed put: true].
+ rotationButton position: bounds topCenter - (6@0).
+ scaleButton position: bounds rightCenter - ((scaleButton width)@6).
+
+ !
- forEachHand do:[ :i| i at:#changed put: true]
- ]!
Item was changed:
----- Method: SketchEditorMorph>>initializeFor:inBounds:pasteUpMorph:paintBoxPosition: (in category 'initialization') -----
initializeFor: aSketchMorph inBounds: boundsToUse pasteUpMorph: aPasteUpMorph paintBoxPosition: aPosition
"NB: if aPosition is nil, then it's assumed that the paintbox is obtained from a flap or some such, so do nothing special regarding a palette in this case. The palette needs already to be in the world for this to work."
| w |
(w := aPasteUpMorph world) addMorphInLayer: self. "in back of palette"
enclosingPasteUpMorph := aPasteUpMorph.
hostView := aSketchMorph. "may be ownerless"
self bounds: boundsToUse.
palette := w paintBox focusMorph: self.
palette beStatic. "give Nebraska whatever help we can"
palette addWeakDependent: self.
aPosition ifNotNil:
[w addMorphFront: palette. "bring to front"
palette position: aPosition].
paintingForm := Form extent: bounds extent depth: w assuredCanvas depth.
self dimTheWindow.
self addRotationScaleHandles.
aSketchMorph ifNotNil:
[
aSketchMorph form
displayOn: paintingForm
at: (hostView boundsInWorld origin - bounds origin - hostView form offset)
clippingBox: (0@0 extent: paintingForm extent)
rule: Form over
fillColor: nil. "assume they are the same depth".
+ undoBuffer := OrderedCollection new.
+ undoBuffer add: paintingForm deepCopy.
- undoBuffer := paintingForm deepCopy.
rotationCenter := aSketchMorph rotationCenter]!
Item was changed:
----- Method: SketchEditorMorph>>mouseDown: (in category 'morphic') -----
mouseDown: evt
"Start a new stroke. Check if any palette setting have changed. 6/11/97 20:30 tk"
| cur pfPen myAction |
"verify that we are in a good state"
self verifyState: evt. "includes prepareToPaint and #scalingOrRotate"
pfPen := self get: #paintingFormPen for: evt.
+ undoBuffer add: paintingForm deepCopy.
+ firstUndoFlag := true.
- paintingForm extent = undoBuffer extent ifTrue: [
- paintingForm displayOn: undoBuffer at: 0@0 rule: Form over.
- ] ifFalse: [
- undoBuffer := paintingForm deepCopy. "know we will draw something"
- ].
pfPen place: (evt cursorPoint - bounds origin).
myAction := self getActionFor: evt.
palette colorable ifTrue:[
palette recentColor: (self getColorFor: evt)].
self set: #strokeOrigin for: evt to: evt cursorPoint.
"origin point for pickup: rect: ellispe: polygon: line: star:. Always take it."
myAction == #pickup: ifTrue: [
cur := Cursor corner shallowCopy.
cur offset: 0@0 "cur offset abs".
evt hand showTemporaryCursor: cur].
myAction == #polygon: ifTrue: [self polyNew: evt]. "a mode lets you drag vertices"
self mouseMove: evt.!
Item was changed:
----- Method: SketchEditorMorph>>restoreRect: (in category 'actions & preps') -----
restoreRect: oldRect
"Restore the given rectangular area of the painting Form from the undo buffer."
+ formCanvas drawImage: undoBuffer last
- formCanvas drawImage: undoBuffer
at: oldRect origin
sourceRect: (oldRect translateBy: self topLeft negated).
self invalidRect: oldRect.
!
Item was changed:
----- Method: SketchEditorMorph>>rotateBy: (in category 'actions & preps') -----
rotateBy: evt
"Left-right is rotation. 3/26/97 tk Slider at top of window. 4/3/97 tk"
| pt temp amt smooth myBuff |
+ undoBuffer add: paintingForm deepCopy.
+ firstUndoFlag := true.
-
myBuff := self get: #buff for: evt.
evt cursorPoint x - self left < 20
ifTrue: [^ self flipHoriz: evt].
"at left end flip horizontal"
evt cursorPoint x - self right > -20
ifTrue: [^ self flipVert: evt].
"at right end flip vertical"
pt := evt cursorPoint - bounds center.
smooth := 2.
"paintingForm depth > 8 ifTrue: [2] ifFalse: [1]."
"Could go back to 1 for speed"
amt := pt x abs < 12
ifTrue: ["detent"
0]
ifFalse: [pt x - (12 * pt x abs // pt x)].
amt := amt * 1.8.
temp := myBuff
rotateBy: amt
magnify: cumMag
smoothing: smooth.
temp displayOn: paintingForm at: paintingForm center - temp center + myBuff offset.
rotationButton position: evt cursorPoint x - 6 @ rotationButton position y.
self render: bounds.
cumRot := amt!
Item was changed:
----- Method: SketchEditorMorph>>scaleBy: (in category 'actions & preps') -----
scaleBy: evt
"up-down is scale. 3/26/97 tk Now a slider on the right."
| pt temp cy oldRect amt myBuff |
+ undoBuffer add: paintingForm deepCopy.
+ firstUndoFlag := true.
-
myBuff := self get: #buff for: evt.
pt := evt cursorPoint - bounds center.
cy := bounds height * 0.5.
oldRect := myBuff boundingBox expandBy: myBuff extent * cumMag / 2.
amt := pt y abs < 12
ifTrue: ["detent"
1.0]
ifFalse: [pt y - (12 * pt y abs // pt x)].
amt := amt asFloat / cy + 1.0.
temp := myBuff
rotateBy: cumRot
magnify: amt
smoothing: 2.
cumMag > amt
ifTrue: ["shrinking"
oldRect := oldRect translateBy: paintingForm center - oldRect center + myBuff offset.
paintingForm
fill: (oldRect expandBy: 1 @ 1)
rule: Form over
fillColor: Color transparent].
temp displayOn: paintingForm at: paintingForm center - temp center + myBuff offset.
scaleButton position: scaleButton position x @ (evt cursorPoint y - 6).
self render: bounds.
cumMag := amt!
Item was added:
+ ----- Method: SketchEditorMorph>>setExtentFromHalo: (in category 'morphic') -----
+ setExtentFromHalo: anExtent
+ "The user has dragged the grow box such that the receiver's extent would be anExtent. Do what's needed"
+
+ super setExtentFromHalo: ((anExtent x max: paintingForm width) @ (anExtent y max: paintingForm height)).
+ !
Item was changed:
----- Method: SketchEditorMorph>>undo: (in category 'start & finish') -----
undo: evt
"revert to a previous state. "
+ | poly pen |
- | temp poly pen |
self flag: #bob. "what is undo in multihand environment?"
undoBuffer ifNil: [^Beeper beep]. "nothing to go back to"
(poly := self valueOfProperty: #polygon) ifNotNil:
[poly delete.
self setProperty: #polygon toValue: nil.
self polyEditing: false.
^self].
+ firstUndoFlag ifTrue:[
+ undoBuffer add: paintingForm deepCopy.
+ firstUndoFlag := false.
+ undoBufferIndex := undoBuffer size].
+ evt shiftPressed
+ ifTrue:[undoBufferIndex := undoBufferIndex + 1.
+ paintingForm := undoBuffer at: undoBufferIndex ifAbsent:[^self inform:'Nothing to redo']]
+ ifFalse:[undoBufferIndex := undoBufferIndex - 1.
+ paintingForm := undoBuffer at: undoBufferIndex ifAbsent:[^self inform:'Nothing to undo']].
- temp := paintingForm.
- paintingForm := undoBuffer.
- undoBuffer := temp. "can get back to what you had by undoing again"
pen := self get: #paintingFormPen for: evt.
pen ifNil: [^Beeper beep].
pen setDestForm: paintingForm.
formCanvas := paintingForm getCanvas. "used for lines, ovals, etc."
formCanvas := formCanvas copyOrigin: self topLeft negated
clipRect: (0 @ 0 extent: bounds extent).
self render: bounds!