--- a/DeviceWorkstation.st Thu Feb 11 16:26:49 2016 +0000
+++ b/DeviceWorkstation.st Sun Feb 14 07:00:26 2016 +0100
@@ -2242,36 +2242,34 @@
!
preferredIconSize
- "Get the preferrered icon size. These are typically set by the window manager.
- We return nil here (as if there are no special size preferences)."
+ "Get the preferrered icon size. These are typically set by the window manager."
|sizes spec sz sz2|
preferredIconSize isNil ifTrue:[
- sizes := self iconSizes.
- sizes notNil ifTrue:[
- spec := sizes first.
-
- "/ we prefer square icons ...
-
- sz := (spec at:#maxWidth) min: (spec at:#maxHeight).
- sz > 64 ifTrue:[
- sz2 := (spec at:#minWidth) max: (spec at:#minHeight).
- sz2 <= 48 ifTrue:[
- sz := 48
- ]
- ].
- preferredIconSize := sz @ sz
- ].
- preferredIconSize isNil ifTrue:[
- preferredIconSize := 48@48
- ].
+ sizes := self iconSizes.
+ sizes notNil ifTrue:[
+ spec := sizes first.
+
+ "/ we prefer square icons ...
+ sz := (spec at:#maxWidth) min: (spec at:#maxHeight).
+ sz > 64 ifTrue:[
+ sz2 := (spec at:#minWidth) max: (spec at:#minHeight).
+ sz2 <= 48 ifTrue:[
+ sz := 48
+ ]
+ ].
+ preferredIconSize := sz @ sz
+ ] ifFalse:[
+ preferredIconSize := 48@48
+ ].
].
^ preferredIconSize
"
- Display preferredIconSize
+ Display preferredIconSize:nil.
+ Display preferredIconSize.
Display preferredIconSize:32@32
Display preferredIconSize:nil
"
--- a/ImageReader.st Thu Feb 11 16:26:49 2016 +0000
+++ b/ImageReader.st Sun Feb 14 07:00:26 2016 +0100
@@ -11,6 +11,8 @@
"
"{ Package: 'stx:libview' }"
+"{ NameSpace: Smalltalk }"
+
Object subclass:#ImageReader
instanceVariableNames:'width height data byteOrder inStream outStream photometric
samplesPerPixel bitsPerSample colorMap mask maskPixel
@@ -1904,13 +1906,13 @@
readLong
"return the next 4-byte long, honoring the byte-order"
- ^ inStream nextLongMSB:(byteOrder ~~ #lsb)
+ ^ inStream nextInt32MSB:(byteOrder ~~ #lsb)
!
readShort
"return the next 2-byte short, honoring the byte-order"
- ^ inStream nextUnsignedShortMSB:(byteOrder ~~ #lsb)
+ ^ inStream nextUnsignedInt16MSB:(byteOrder ~~ #lsb)
!
readShortLong
@@ -1934,19 +1936,19 @@
readUnsignedLong
"return the next 4-byte long, honoring the byte-order"
- ^ inStream nextUnsignedLongMSB:(byteOrder ~~ #lsb)
+ ^ inStream nextUnsignedInt32MSB:(byteOrder ~~ #lsb)
!
writeLong:anInteger
"write a 4-byte long, honoring the byte-order."
- outStream nextPutLong:anInteger MSB:(byteOrder ~~ #lsb)
+ outStream nextPutInt32:anInteger MSB:(byteOrder ~~ #lsb)
!
writeShort:anInteger
"write a 2-byte short, honoring the byte-order."
- outStream nextPutShort:anInteger MSB:(byteOrder ~~ #lsb)
+ outStream nextPutInt16:anInteger MSB:(byteOrder ~~ #lsb)
! !
!ImageReader methodsFor:'image reading'!
@@ -2117,3 +2119,4 @@
version_CVS
^ '$Header$'
! !
+
--- a/StandardSystemView.st Thu Feb 11 16:26:49 2016 +0000
+++ b/StandardSystemView.st Sun Feb 14 07:00:26 2016 +0100
@@ -481,82 +481,7 @@
defaultSTXIcon
<resource: #programImage>
- ^ self defaultSTXIcon3.
-!
-
-defaultSTXIcon1
- <resource: #image>
- "This resource specification was automatically generated
- by the ImageEditor of ST/X."
- "Do not manually edit this!! If it is corrupted,
- the ImageEditor may not be able to read the specification."
- "
- self defaultSTXIcon1 inspect
- ImageEditor openOnClass:self andSelector:#defaultSTXIcon1
- Icon flushCachedIcons"
-
- ^ Icon constantNamed:#'StandardSystemView class defaultSTXIcon1'
- ifAbsentPut:[
- (Depth2Image new)
- width:16;
- height:16;
- photometric:(#palette);
- bitsPerSample:(#[ 2 ]);
- samplesPerPixel:(1);
- bits:(ByteArray
- fromPackedString:'@@@@@@@@@@@@E@@@@AP@D@@V@D@@APF@@@F&@@@AV@@@@&@@@@%P@@@&F@@@VBP@@V@I@@V@@P@@@@@@@@@@@@@a');
- colorMapFromArray:#[ 0 0 0 0 127 127 184 231 231 ];
- mask:((ImageMask new)
- width:16;
- height:16;
- bits:(ByteArray
- fromPackedString:'@@@@@@X@A PGB@LX@_@A8@G@@<@GX@9 GC@8D@@@@@@b');
- yourself);
- yourself
- ]
-!
-
-defaultSTXIcon2
- "This resource specification was automatically generated
- by the ImageEditor of ST/X."
-
- "Do not manually edit this!! If it is corrupted,
- the ImageEditor may not be able to read the specification."
-
- "
- self defaultSTXIcon2 inspect
- ImageEditor openOnClass:self andSelector:#defaultSTXIcon2
- Icon flushCachedIcons
- "
-
- <resource: #image>
-
- ^Icon
- constantNamed:#'StandardSystemView class defaultSTXIcon2'
- ifAbsentPut:[(Depth8Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#[8]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
-@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@HB@@@@@@@@@@@@@@@@@@@B@ @@@@@@@@H@@@@@@@@@@ H@@@@@@@H@@@@@@@@@@@@B@ @@
-@@H@@@@@@@@@@@@@@@H@@@H@@@@@@@@@@@@@@@@B@ H@@@@@@@@@@@@@@@@@@@H@@@@@@@@@@@@@@@@@@@HB@ @@@@@@@@@@@@@@@@H@@@H@@@@@@@@@@@@@
-@ H@@@@@@ @@@@@@@@@@@ H@@@@@@@@B@@@@@@@@@ H@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a') ; colorMapFromArray:#[184 231 231 63 63 63 0 127 127]; yourself]
-!
-
-defaultSTXIcon3
- "This resource specification was automatically generated
- by the ImageEditor of ST/X."
-
- "Do not manually edit this!! If it is corrupted,
- the ImageEditor may not be able to read the specification."
-
- "
- self defaultSTXIcon3 inspect
- ImageEditor openOnClass:self andSelector:#defaultSTXIcon3
- Icon flushCachedIcons
- "
-
- <resource: #image>
-
- ^Icon
- constantNamed:#'StandardSystemView class defaultSTXIcon3'
- ifAbsentPut:[(Depth2Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#[2]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@E@@@@AP@D@@V@D@@APF@@@FF@@@AV@@@@&@@@@%P@@@$F@@@T@X@@T@I@@T@@P@@@@@@@@@@@@@a') ; colorMapFromArray:#[0 0 0 0 204 51 0 112 0]; yourself]
+ ^ Icon stxIcon.
! !
!StandardSystemView class methodsFor:'startup'!
--- a/XWorkstation.st Thu Feb 11 16:26:49 2016 +0000
+++ b/XWorkstation.st Sun Feb 14 07:00:26 2016 +0100
@@ -1316,50 +1316,49 @@
|xIconSizes count ret|
+ count := 0.
%{
int screen = __intVal(__INST(screen));
XIconSize *sizeList;
int cnt;
if (ISCONNECTED) {
- Display *dpy = myDpy;
- int status;
-
- ENTER_XLIB();
- status = XGetIconSizes(dpy, RootWindow(dpy, screen), &sizeList, &cnt);
- LEAVE_XLIB();
- if (status > 0) {
- xIconSizes = __MKEXTERNALBYTES(sizeList);
- count = __MKSMALLINT(cnt);
- }
- }
-%}.
- xIconSizes isNil ifTrue:[^ nil].
-
- ret := OrderedCollection new:count.
+ Display *dpy = myDpy;
+ int status;
+
+ ENTER_XLIB();
+ status = XGetIconSizes(dpy, RootWindow(dpy, screen), &sizeList, &cnt);
+ LEAVE_XLIB();
+ if (status > 0) {
+ xIconSizes = __MKEXTERNALBYTES(sizeList);
+ count = __MKSMALLINT(cnt);
+ }
+ }
+%}.
+ count == 0 ifTrue:[^ nil].
+
+ ret := Array new:count.
1 to:count do:[ :i |
- |minWidth minHeight maxWidth maxHeight widthStep heightStep d|
-
-%{
- XIconSize *slp;
-
- slp = &((XIconSize *)__externalAddressVal(xIconSizes))[__intVal(i)-1];
- minWidth = __MKSMALLINT(slp->min_width);
- minHeight = __MKSMALLINT(slp->min_height);
- maxWidth = __MKSMALLINT(slp->max_width);
- maxHeight = __MKSMALLINT(slp->max_height);
- widthStep = __MKSMALLINT(slp->width_inc);
- heightStep = __MKSMALLINT(slp->height_inc);
-%}.
- d := IdentityDictionary new.
- d at:#minWidth put:minWidth.
- d at:#maxWidth put:maxWidth.
- d at:#widthStep put:widthStep.
- d at:#minHeight put:minHeight.
- d at:#maxHeight put:maxHeight.
- d at:#heightStep put:heightStep.
-
- ret add:d
+ |minWidth minHeight maxWidth maxHeight widthStep heightStep d|
+
+%{
+ XIconSize *slp = &((XIconSize *)__externalAddressVal(xIconSizes))[__intVal(i)-1];
+ minWidth = __MKSMALLINT(slp->min_width);
+ minHeight = __MKSMALLINT(slp->min_height);
+ maxWidth = __MKSMALLINT(slp->max_width);
+ maxHeight = __MKSMALLINT(slp->max_height);
+ widthStep = __MKSMALLINT(slp->width_inc);
+ heightStep = __MKSMALLINT(slp->height_inc);
+%}.
+ d := IdentityDictionary new:6.
+ d at:#minWidth put:minWidth.
+ d at:#maxWidth put:maxWidth.
+ d at:#widthStep put:widthStep.
+ d at:#minHeight put:minHeight.
+ d at:#maxHeight put:maxHeight.
+ d at:#heightStep put:heightStep.
+
+ ret at:i put:d.
].
xIconSizes free.