[BUG][FIX] DeclarativePools

Tim Rowledge tim at sumeru.stanford.edu
Mon Jun 2 01:50:23 UTC 2003


"Andreas Raab" <andreas.raab at gmx.de> wrote:

>  TextConstants includes all of the TextStyles which is
> problematic.
I see a couple of dozen places where 'TextContants' is specifically used
as opposed to values within it. The simplistic answer here is to add
some protocol to the shared pool to handle the following:-

#at: as in dictionary access (TextMorphEditor>changeStyle*,
Array>objectForDataStream:, EToySystem class>fixComicCharacters*,
TextStyle>collectionFromFileNamed:*,
ParseNode>printSingleComment:on:indent: - really weird use to get tab
width)

#at:ifAbsent: (TextStyle class>named:*, ProgressMorph>fontOfPointSize:*,
TextStyle>collectionFromFileNamed:, StrikeFont>objectForDataStream: -
abuse of TextConstants as a preference)

#at:put: (TTFontReader class>installTTF:asTextStyle:sizes:*, Text
class>initialize, Text class>initTextConstants, BDFFontReader
class>installX11Fonts*, Preferences class>setSystemFontTo:*, TextStyle
class>changeDefaultFontSizeBy:*, TextStyle
class>initDefaultFontsAndStyle*, FontSet class>installAsTextStyle*,
FontSet class>installAsDefault*)

#removeKey:ifAbsent: (SystemDictionary>makeExternalRelease* - are we
going to keep this?, SystemDictionary>discardOddsAndEnds* - surely this
will soon disappear?, SystemDictionary>makeSqueaklandRelease* ??)

#select:[] (Utilities class>actualTextStyles*, Utilities
class>knownTextStyles*, StrikeFont class>familyNames* - same as
Utilities class>knownTextStyles except for asSortedCollection instead of
asSortedArray and both of them ought to be replaced by TextStyle class
methods, UpdatingStringMorph>setFontStyle*)  - all of these are to allow
finding a TextStyle of a certain name

19 out of 25 uses are to do TextStyle related stuff, leading me to the
staggering conclusion that maybe something needs a bit of a cleanup.
After all, when we have 'TextStyle default' _and_ 'TextConstants at:
#DefaulTextStyle' AND they may not be the same I think that implies a
bit of a mess. Since TextStyle is a class and already globally
accessible I'm not sure what the value of keeping instances of styles
'hidden' in TextConstants.

Anybody want to offer suggestions for improvements?

tim
-- 
Tim Rowledge, tim at sumeru.stanford.edu, http://sumeru.stanford.edu/tim
Useful random insult:- 3K RAM free, no EMS.



More information about the Squeak-dev mailing list