Form.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Fri, 25 Jan 2019 11:29:18 +0000
branchjv
changeset 8620 b4220c12f7ef
parent 8420 76e39223f5ab
permissions -rw-r--r--
Fix typo in (default) mapping for delete key
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
48194c26a46c Initial revision
claus
parents:
diff changeset
     1
"
6
7ee0cfde237d *** empty log message ***
claus
parents: 5
diff changeset
     2
 COPYRIGHT (c) 1989 by Claus Gittinger
8420
76e39223f5ab Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 7765
diff changeset
     3
 COPYRIGHT (c) 2016 Jan Vrany
78
1c9c22df3251 *** empty log message ***
claus
parents: 71
diff changeset
     4
	      All Rights Reserved
0
48194c26a46c Initial revision
claus
parents:
diff changeset
     5
48194c26a46c Initial revision
claus
parents:
diff changeset
     6
 This software is furnished under a license and may be used
48194c26a46c Initial revision
claus
parents:
diff changeset
     7
 only in accordance with the terms of that license and with the
48194c26a46c Initial revision
claus
parents:
diff changeset
     8
 inclusion of the above copyright notice.   This software may not
48194c26a46c Initial revision
claus
parents:
diff changeset
     9
 be provided or otherwise made available to, or used by, any
48194c26a46c Initial revision
claus
parents:
diff changeset
    10
 other person.  No title to or ownership of the software is
48194c26a46c Initial revision
claus
parents:
diff changeset
    11
 hereby transferred.
48194c26a46c Initial revision
claus
parents:
diff changeset
    12
"
3192
62b7b6c6419b halt with message arg
Claus Gittinger <cg@exept.de>
parents: 3177
diff changeset
    13
"{ Package: 'stx:libview' }"
62b7b6c6419b halt with message arg
Claus Gittinger <cg@exept.de>
parents: 3177
diff changeset
    14
6860
73f5e3b55940 class: Form
Claus Gittinger <cg@exept.de>
parents: 6533
diff changeset
    15
"{ NameSpace: Smalltalk }"
73f5e3b55940 class: Form
Claus Gittinger <cg@exept.de>
parents: 6533
diff changeset
    16
721
ba7861418087 renamed DisplayMedium to Graphicsmedium & changed inheritance
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
    17
GraphicsMedium subclass:#Form
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
    18
	instanceVariableNames:'depth localColorMap offset data maskedPixelsAre0'
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
    19
	classVariableNames:'VeryLightGreyForm LightGreyForm GreyForm DarkGreyForm
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
    20
		VeryDarkGreyForm AdditionalBitmapDirectoryNames
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
    21
		BlackAndWhiteColorMap DitherPatternArray'
412
766ba454c23d keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
    22
	poolDictionaries:''
3921
7bc2e9c7d9a4 category
Claus Gittinger <cg@exept.de>
parents: 3891
diff changeset
    23
	category:'Compatibility-ST80-Graphics-Display Objects'
0
48194c26a46c Initial revision
claus
parents:
diff changeset
    24
!
48194c26a46c Initial revision
claus
parents:
diff changeset
    25
4173
100ca435fb0e New class Form::ImageForm for Forms that are created from Images.
Stefan Vogel <sv@exept.de>
parents: 4165
diff changeset
    26
Form subclass:#ImageForm
100ca435fb0e New class Form::ImageForm for Forms that are created from Images.
Stefan Vogel <sv@exept.de>
parents: 4165
diff changeset
    27
	instanceVariableNames:''
100ca435fb0e New class Form::ImageForm for Forms that are created from Images.
Stefan Vogel <sv@exept.de>
parents: 4165
diff changeset
    28
	classVariableNames:''
100ca435fb0e New class Form::ImageForm for Forms that are created from Images.
Stefan Vogel <sv@exept.de>
parents: 4165
diff changeset
    29
	poolDictionaries:''
100ca435fb0e New class Form::ImageForm for Forms that are created from Images.
Stefan Vogel <sv@exept.de>
parents: 4165
diff changeset
    30
	privateIn:Form
100ca435fb0e New class Form::ImageForm for Forms that are created from Images.
Stefan Vogel <sv@exept.de>
parents: 4165
diff changeset
    31
!
100ca435fb0e New class Form::ImageForm for Forms that are created from Images.
Stefan Vogel <sv@exept.de>
parents: 4165
diff changeset
    32
1142
2a83bf7d5627 Form>>readFrom: are going to be obsoleted.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
    33
!Form class methodsFor:'documentation'!
46
7b331e9012fd *** empty log message ***
claus
parents: 35
diff changeset
    34
7b331e9012fd *** empty log message ***
claus
parents: 35
diff changeset
    35
copyright
7b331e9012fd *** empty log message ***
claus
parents: 35
diff changeset
    36
"
7b331e9012fd *** empty log message ***
claus
parents: 35
diff changeset
    37
 COPYRIGHT (c) 1989 by Claus Gittinger
8420
76e39223f5ab Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 7765
diff changeset
    38
 COPYRIGHT (c) 2016 Jan Vrany
78
1c9c22df3251 *** empty log message ***
claus
parents: 71
diff changeset
    39
	      All Rights Reserved
0
48194c26a46c Initial revision
claus
parents:
diff changeset
    40
46
7b331e9012fd *** empty log message ***
claus
parents: 35
diff changeset
    41
 This software is furnished under a license and may be used
7b331e9012fd *** empty log message ***
claus
parents: 35
diff changeset
    42
 only in accordance with the terms of that license and with the
7b331e9012fd *** empty log message ***
claus
parents: 35
diff changeset
    43
 inclusion of the above copyright notice.   This software may not
7b331e9012fd *** empty log message ***
claus
parents: 35
diff changeset
    44
 be provided or otherwise made available to, or used by, any
7b331e9012fd *** empty log message ***
claus
parents: 35
diff changeset
    45
 other person.  No title to or ownership of the software is
7b331e9012fd *** empty log message ***
claus
parents: 35
diff changeset
    46
 hereby transferred.
7b331e9012fd *** empty log message ***
claus
parents: 35
diff changeset
    47
"
7b331e9012fd *** empty log message ***
claus
parents: 35
diff changeset
    48
!
7b331e9012fd *** empty log message ***
claus
parents: 35
diff changeset
    49
7b331e9012fd *** empty log message ***
claus
parents: 35
diff changeset
    50
documentation
7b331e9012fd *** empty log message ***
claus
parents: 35
diff changeset
    51
"
7b331e9012fd *** empty log message ***
claus
parents: 35
diff changeset
    52
    Instances of this class represent forms (i.e. bit- and pixmaps)
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
    53
    which can be created on a drawing device.
590
fc18ba574a4d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 589
diff changeset
    54
    In X, these device resources are XPixmaps.
46
7b331e9012fd *** empty log message ***
claus
parents: 35
diff changeset
    55
    Not all devices will support forms.
134
claus
parents: 133
diff changeset
    56
claus
parents: 133
diff changeset
    57
    NOTICE:
1138
4a2b3b407cae need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
    58
	the Form class is a historic leftover and now only used for real
4a2b3b407cae need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
    59
	device forms (i.e. on devices which support downloading bitmaps).
590
fc18ba574a4d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 589
diff changeset
    60
1138
4a2b3b407cae need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
    61
	In your application, you should always use Image, both for compatibility
4a2b3b407cae need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
    62
	with ST-80 and for device independence, since Form may not be supported
4a2b3b407cae need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
    63
	by all devices.
589
2c119dc32f8c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 588
diff changeset
    64
935
e71b1be3eb6c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
    65
    WARNING:
1138
4a2b3b407cae need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
    66
	Forms created on some device may not be recreatable, when an
4a2b3b407cae need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
    67
	image is restarted on a display with different display capabilities.
4a2b3b407cae need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
    68
	For example, a 24bit truecolor form will be lost when the image is
4a2b3b407cae need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
    69
	saved and restarted in an 8bit or monochrome display.
4a2b3b407cae need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
    70
	Worse: the information is completely lost.
935
e71b1be3eb6c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
    71
1138
4a2b3b407cae need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
    72
	With images, the original information is always preserved, although
4a2b3b407cae need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
    73
	the display may be with less resolution, dithered or otherwise
4a2b3b407cae need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
    74
	approximated.
935
e71b1be3eb6c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 927
diff changeset
    75
591
d071af7739db commentary
Claus Gittinger <cg@exept.de>
parents: 590
diff changeset
    76
    [See also:]
1138
4a2b3b407cae need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
    77
	Image DeviceDrawable
610
f6951a01350f documentation
Claus Gittinger <cg@exept.de>
parents: 594
diff changeset
    78
f6951a01350f documentation
Claus Gittinger <cg@exept.de>
parents: 594
diff changeset
    79
    [author:]
1138
4a2b3b407cae need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
    80
	Claus Gittinger
46
7b331e9012fd *** empty log message ***
claus
parents: 35
diff changeset
    81
"
7b331e9012fd *** empty log message ***
claus
parents: 35
diff changeset
    82
! !
0
48194c26a46c Initial revision
claus
parents:
diff changeset
    83
1142
2a83bf7d5627 Form>>readFrom: are going to be obsoleted.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
    84
!Form class methodsFor:'initialization'!
0
48194c26a46c Initial revision
claus
parents:
diff changeset
    85
48194c26a46c Initial revision
claus
parents:
diff changeset
    86
initialize
126
4fc31fd808c8 *** empty log message ***
claus
parents: 118
diff changeset
    87
    "initialize set of dictionaries to look for bitmaps"
0
48194c26a46c Initial revision
claus
parents:
diff changeset
    88
48194c26a46c Initial revision
claus
parents:
diff changeset
    89
    AdditionalBitmapDirectoryNames isNil ifTrue:[
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
    90
	OperatingSystem isMSWINDOWSlike ifTrue:[
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
    91
	    AdditionalBitmapDirectoryNames := #().
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
    92
	] ifFalse:[
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
    93
	    AdditionalBitmapDirectoryNames := #('/usr/lib/X11/bitmaps').
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
    94
	].
6860
73f5e3b55940 class: Form
Claus Gittinger <cg@exept.de>
parents: 6533
diff changeset
    95
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
    96
	"want to be informed when returning from snapshot"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
    97
	ObjectMemory addDependent:self.
4437
735d7db913eb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4217
diff changeset
    98
    ].
0
48194c26a46c Initial revision
claus
parents:
diff changeset
    99
!
48194c26a46c Initial revision
claus
parents:
diff changeset
   100
48194c26a46c Initial revision
claus
parents:
diff changeset
   101
reinitializeAllOn:aDevice
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
   102
    "recreate all forms on aDevice; called by Workstation after snapIn, to
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   103
     have all background bitmaps at hand, when views are restored"
48194c26a46c Initial revision
claus
parents:
diff changeset
   104
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
   105
    Form allSubInstancesDo:[:eachForm |
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
   106
	eachForm graphicsDevice == aDevice ifTrue:[
6935
0de17e2f06f6 *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 6533
diff changeset
   107
            "now, try to recreate it"
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
   108
	    eachForm recreate.
6935
0de17e2f06f6 *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 6533
diff changeset
   109
        ]
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   110
    ]
927
c4bc2a7ff733 use #graphicsDevice instead of #device.
Claus Gittinger <cg@exept.de>
parents: 925
diff changeset
   111
c4bc2a7ff733 use #graphicsDevice instead of #device.
Claus Gittinger <cg@exept.de>
parents: 925
diff changeset
   112
    "Modified: 5.7.1996 / 17:55:58 / cg"
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   113
!
48194c26a46c Initial revision
claus
parents:
diff changeset
   114
870
2b7db80e7ad1 oops - restart mechanism got corrupted
Claus Gittinger <cg@exept.de>
parents: 836
diff changeset
   115
update:something with:aParameter from:changedObject
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   116
    "sent just before snapOut and just after a snapIn"
48194c26a46c Initial revision
claus
parents:
diff changeset
   117
48194c26a46c Initial revision
claus
parents:
diff changeset
   118
    (something == #save) ifTrue:[
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
   119
	"get all bits from the device into saveable arrays"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
   120
	Form allSubInstancesDo:[:eachForm |
6935
0de17e2f06f6 *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 6533
diff changeset
   121
            (PrimitiveFailureSignal , DeviceWorkstation drawingOnClosedDeviceSignal) handle:[:ex |
0de17e2f06f6 *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 6533
diff changeset
   122
                'Form [warning]: cannot fetch form bits from device' errorPrintCR
0de17e2f06f6 *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 6533
diff changeset
   123
            ] do:[
0de17e2f06f6 *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 6533
diff changeset
   124
                |dev|
2933
fd5033d6a182 ask device, if it wants to be made persistent in the snapshot image
Claus Gittinger <cg@exept.de>
parents: 2850
diff changeset
   125
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
   126
		((dev := eachForm graphicsDevice) notNil
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
   127
		 and:[dev isPersistentInSnapshot]) ifTrue:[
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
   128
		    eachForm getBits
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
   129
		]
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
   130
	    ]
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
   131
	]
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   132
    ].
48194c26a46c Initial revision
claus
parents:
diff changeset
   133
    (something == #restarted) ifTrue:[
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
   134
	"remove all left-over device info"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
   135
	Form allSubInstancesDo:[:eachForm |
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
   136
	    eachForm flushDeviceHandles.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
   137
	]
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   138
    ]
870
2b7db80e7ad1 oops - restart mechanism got corrupted
Claus Gittinger <cg@exept.de>
parents: 836
diff changeset
   139
2b7db80e7ad1 oops - restart mechanism got corrupted
Claus Gittinger <cg@exept.de>
parents: 836
diff changeset
   140
    "Modified: 15.6.1996 / 15:44:09 / cg"
2b7db80e7ad1 oops - restart mechanism got corrupted
Claus Gittinger <cg@exept.de>
parents: 836
diff changeset
   141
    "Created: 15.6.1996 / 15:47:50 / cg"
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   142
! !
48194c26a46c Initial revision
claus
parents:
diff changeset
   143
1142
2a83bf7d5627 Form>>readFrom: are going to be obsoleted.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
   144
!Form class methodsFor:'instance creation'!
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   145
2964
d9b5700dbfda checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   146
dotOfSize:size
d9b5700dbfda checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   147
    "create and return a form which contains a dot (filled circle)
d9b5700dbfda checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   148
     of the given size."
d9b5700dbfda checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   149
d9b5700dbfda checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   150
    |f|
d9b5700dbfda checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   151
4786
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   152
    f := self extent:size asPoint onDevice:Screen current.
2964
d9b5700dbfda checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   153
    f clear.
d9b5700dbfda checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   154
    f fillCircle:(f center) radius:(f width min:f height) // 2.
d9b5700dbfda checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   155
    ^ f
d9b5700dbfda checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   156
d9b5700dbfda checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   157
    "
d9b5700dbfda checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   158
     (Form dotOfSize:8) inspect
d9b5700dbfda checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   159
     (Form dotOfSize:20) inspect
d9b5700dbfda checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   160
    "
d9b5700dbfda checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   161
!
d9b5700dbfda checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   162
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   163
extent:ext
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   164
    "create a new, cleared form, take dimensions from ext.
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   165
     Smalltalk-80 compatibility"
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   166
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   167
    |newForm|
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   168
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   169
    newForm := self width:(ext x) height:(ext y).
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   170
    newForm fill:(Color colorId:0).
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   171
    newForm paint:(Color colorId:1).
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   172
    ^ newForm
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   173
!
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   174
1278
85b4c4898265 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1255
diff changeset
   175
extent:ext depth:d
85b4c4898265 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1255
diff changeset
   176
    "create a new, cleared form.
85b4c4898265 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1255
diff changeset
   177
     Smalltalk-80 compatibility"
85b4c4898265 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1255
diff changeset
   178
85b4c4898265 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1255
diff changeset
   179
    ^ self width:ext x height:ext y depth:d
85b4c4898265 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1255
diff changeset
   180
85b4c4898265 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1255
diff changeset
   181
    "Created: 27.1.1997 / 16:08:37 / cg"
85b4c4898265 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1255
diff changeset
   182
    "Modified: 27.1.1997 / 16:08:50 / cg"
85b4c4898265 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1255
diff changeset
   183
!
85b4c4898265 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1255
diff changeset
   184
3452
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   185
extent:ext depth:d onDevice:aDevice
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   186
    "create a new form on device, aDevice; depth is what device likes most"
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   187
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   188
    ^ self width:ext x height:ext y depth:d onDevice:aDevice
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   189
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   190
    "Created: 4.4.1997 / 20:23:32 / cg"
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   191
    "Modified: 4.4.1997 / 20:25:28 / cg"
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   192
!
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   193
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   194
extent:ext fromArray:data
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   195
    "create a new form, take dimensions from ext, bits from data.
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   196
     Smalltalk-80 compatibility."
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   197
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   198
    ^ self width:(ext x) height:(ext y) offset:0@0 fromArray:data
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   199
!
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   200
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   201
extent:ext fromArray:data offset:offs
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   202
    "create a new form, take dimensions from ext, bits from data.
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   203
     Smalltalk-80 compatibility."
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   204
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   205
    ^ self width:(ext x) height:(ext y) offset:offs fromArray:data
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   206
!
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   207
3452
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   208
extent:ext fromArray:data offset:offs onDevice:aDevice
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   209
    "create a new form, take dimensions from ext, bits from data."
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   210
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   211
    ^ self width:(ext x) height:(ext y) offset:offs fromArray:data onDevice:aDevice
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   212
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   213
    "Created: 10.4.1997 / 15:36:31 / cg"
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   214
!
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   215
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   216
extent:ext fromArray:data onDevice:aDevice
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   217
    "create a new form, take dimensions from ext, bits from data."
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   218
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   219
    ^ self width:(ext x) height:(ext y) fromArray:data onDevice:aDevice
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   220
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   221
    "Created: 10.4.1997 / 15:34:34 / cg"
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   222
    "Modified: 10.4.1997 / 15:36:04 / cg"
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   223
!
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   224
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   225
extent:ext offset:anOffset
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   226
    "create a new, cleared form, take dimensions from ext.
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   227
     Smalltalk-80 compatibility"
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   228
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   229
    ^ (self extent:ext) offset:anOffset.
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   230
!
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   231
3452
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   232
extent:ext onDevice:aDevice
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   233
    "create a new form on device, aDevice; depth is what device likes most"
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   234
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   235
    ^ self width:ext x height:ext y onDevice:aDevice
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   236
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   237
    "Modified: 4.4.1997 / 20:25:07 / cg"
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   238
!
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   239
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   240
width:w height:h
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   241
    "create a new form on the default device"
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   242
3135
f9304f22f07b handle the case, where not Screen is available
Claus Gittinger <cg@exept.de>
parents: 3106
diff changeset
   243
    |scr|
f9304f22f07b handle the case, where not Screen is available
Claus Gittinger <cg@exept.de>
parents: 3106
diff changeset
   244
f9304f22f07b handle the case, where not Screen is available
Claus Gittinger <cg@exept.de>
parents: 3106
diff changeset
   245
    Screen notNil ifTrue:[scr := Screen current].
4786
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   246
    ^ self width:w height:h onDevice:scr
789
9566544d68a1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 746
diff changeset
   247
9566544d68a1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 746
diff changeset
   248
    "Modified: 4.6.1996 / 22:16:33 / cg"
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   249
!
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   250
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   251
width:w height:h depth:d
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   252
    "create a new form on the default device"
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   253
3135
f9304f22f07b handle the case, where not Screen is available
Claus Gittinger <cg@exept.de>
parents: 3106
diff changeset
   254
    |scr|
f9304f22f07b handle the case, where not Screen is available
Claus Gittinger <cg@exept.de>
parents: 3106
diff changeset
   255
f9304f22f07b handle the case, where not Screen is available
Claus Gittinger <cg@exept.de>
parents: 3106
diff changeset
   256
    Screen notNil ifTrue:[scr := Screen current].
4786
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   257
    ^ self width:w height:h depth:d onDevice:scr
789
9566544d68a1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 746
diff changeset
   258
9566544d68a1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 746
diff changeset
   259
    "Modified: 4.6.1996 / 22:16:51 / cg"
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   260
!
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   261
3452
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   262
width:w height:h depth:d onDevice:aDevice
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   263
    "create a new form with depth d on device, aDevice"
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   264
7354
4a9f164c4605 #BUGFIX by sr
sr
parents: 7260
diff changeset
   265
    ^ (self onDevice:aDevice) width:w height:h depth:d.
3452
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   266
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   267
    "Modified: 18.1.1997 / 18:26:03 / cg"
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   268
!
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   269
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   270
width:w height:h fromArray:anArray
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   271
    "create a new form on the default device"
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   272
3135
f9304f22f07b handle the case, where not Screen is available
Claus Gittinger <cg@exept.de>
parents: 3106
diff changeset
   273
    |scr|
f9304f22f07b handle the case, where not Screen is available
Claus Gittinger <cg@exept.de>
parents: 3106
diff changeset
   274
f9304f22f07b handle the case, where not Screen is available
Claus Gittinger <cg@exept.de>
parents: 3106
diff changeset
   275
    Screen notNil ifTrue:[scr := Screen current].
4768
f61bf4ab2fba ...:on: -> ...:onDevice:
Claus Gittinger <cg@exept.de>
parents: 4642
diff changeset
   276
    ^ self width:w height:h fromArray:anArray onDevice:scr
f61bf4ab2fba ...:on: -> ...:onDevice:
Claus Gittinger <cg@exept.de>
parents: 4642
diff changeset
   277
f61bf4ab2fba ...:on: -> ...:onDevice:
Claus Gittinger <cg@exept.de>
parents: 4642
diff changeset
   278
    "Modified: / 29-05-2007 / 19:31:14 / cg"
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   279
!
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   280
3452
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   281
width:w height:h fromArray:anArray onDevice:aDevice
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   282
    "create a new form on device, aDevice and
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   283
     initialize the pixels from anArray"
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   284
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   285
    ^ (self onDevice:aDevice) width:w height:h fromArray:anArray
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   286
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   287
    "Modified: 18.1.1997 / 18:26:24 / cg"
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   288
!
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   289
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   290
width:w height:h offset:offs fromArray:anArray
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   291
    "create a new form on the default device"
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   292
3135
f9304f22f07b handle the case, where not Screen is available
Claus Gittinger <cg@exept.de>
parents: 3106
diff changeset
   293
    |scr|
f9304f22f07b handle the case, where not Screen is available
Claus Gittinger <cg@exept.de>
parents: 3106
diff changeset
   294
f9304f22f07b handle the case, where not Screen is available
Claus Gittinger <cg@exept.de>
parents: 3106
diff changeset
   295
    Screen notNil ifTrue:[scr := Screen current].
4774
3cf14143cbad more obsolete selector usage ...
Stefan Vogel <sv@exept.de>
parents: 4770
diff changeset
   296
    ^ self width:w height:h offset:offs fromArray:anArray onDevice:scr
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   297
!
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   298
3452
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   299
width:w height:h offset:offs fromArray:anArray onDevice:aDevice
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   300
    "create a new form on the default device"
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   301
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   302
    ^ (self onDevice:aDevice) width:w height:h offset:offs fromArray:anArray
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   303
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   304
    "Modified: 18.1.1997 / 18:26:28 / cg"
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   305
    "Created: 10.4.1997 / 15:35:07 / cg"
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   306
!
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   307
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   308
width:w height:h onDevice:aDevice
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   309
    "create a new form on device, aDevice; depth is what device likes most"
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   310
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   311
    ^ (self onDevice:aDevice) width:w height:h
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   312
58e757c27a76 compatibility methods
Claus Gittinger <cg@exept.de>
parents: 3431
diff changeset
   313
    "Modified: 18.1.1997 / 18:26:31 / cg"
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   314
! !
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   315
3891
48c1f9ab83e3 category
Claus Gittinger <cg@exept.de>
parents: 3880
diff changeset
   316
!Form class methodsFor:'Compatibility-ST80'!
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   317
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   318
and
632
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   319
    "return a constant usable as bitblt-combinationrule.
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   320
     In ST-80rel2.x, these used to be numeric constants; in ST/X,
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   321
     these are symbolic."
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   322
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   323
    ^ #and
632
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   324
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   325
    "Modified: 2.5.1996 / 11:41:23 / cg"
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   326
!
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   327
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   328
black
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   329
    "ST80 compatibility;
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
   330
     In old st80, you could use `Form black' for drawing
632
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   331
     - here we return the black color."
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   332
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   333
    ^ Color black
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   334
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   335
    "Modified: 2.5.1996 / 11:44:17 / cg"
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   336
!
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   337
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   338
darkGray
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   339
    "ST80 compatibility;
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
   340
     In old st80, you could use `Form darkGray' for drawing
632
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   341
     - here we return the darkGray color."
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   342
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   343
    ^ Color darkGray
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   344
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   345
    "Modified: 2.5.1996 / 11:44:06 / cg"
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   346
!
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   347
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   348
darkGrey
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   349
    "ST80 compatibility;
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
   350
     In old st80, you could use `Form darkGrey' for drawing
632
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   351
     - here we return the darkGrey color."
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   352
746
f5479d603f64 gray vs. grey
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
   353
    ^ Color darkGray
f5479d603f64 gray vs. grey
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
   354
f5479d603f64 gray vs. grey
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
   355
    "Modified: 28.5.1996 / 20:47:54 / cg"
632
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   356
!
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   357
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   358
gray
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   359
    "ST80 compatibility;
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
   360
     In old st80, you could use `Form gray' for drawing
632
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   361
     - here we return the grey color."
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   362
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   363
    ^ Color gray
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   364
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   365
    "Modified: 2.5.1996 / 11:43:44 / cg"
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   366
!
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   367
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   368
grey
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   369
    "ST80 compatibility;
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
   370
     In old st80, you could use `Form grey' for drawing
632
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   371
     - here we return the grey color."
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   372
6533
560075ecc897 class: Form
Claus Gittinger <cg@exept.de>
parents: 6483
diff changeset
   373
    ^ Color gray
632
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   374
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   375
    "Modified: 2.5.1996 / 11:43:17 / cg"
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   376
!
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   377
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   378
lightGray
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   379
    "ST80 compatibility;
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
   380
     In old st80, you could use `Form lightGray' for drawing
632
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   381
     - here we return the lightGray color."
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   382
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   383
    ^ Color lightGray
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   384
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   385
    "Created: 2.5.1996 / 11:40:07 / cg"
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   386
    "Modified: 2.5.1996 / 11:43:21 / cg"
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   387
!
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   388
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   389
lightGrey
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   390
    "ST80 compatibility;
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
   391
     In old st80, you could use `Form lightGray' for drawing
632
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   392
     - here we return the lightGray color."
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   393
746
f5479d603f64 gray vs. grey
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
   394
    ^ Color lightGray
f5479d603f64 gray vs. grey
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
   395
f5479d603f64 gray vs. grey
Claus Gittinger <cg@exept.de>
parents: 721
diff changeset
   396
    "Modified: 28.5.1996 / 20:53:28 / cg"
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   397
!
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   398
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   399
over
632
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   400
    "return a constant usable as bitblt-combinationrule.
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   401
     In ST-80rel2.x, these used to be numeric constants; in ST/X,
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   402
     these are symbolic."
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   403
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   404
    ^ #copy
632
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   405
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   406
    "Modified: 2.5.1996 / 11:41:31 / cg"
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   407
!
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   408
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   409
paint
632
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   410
    "return a constant usable as bitblt-combinationrule.
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   411
     In ST-80rel2.x, these used to be numeric constants; in ST/X,
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   412
     these are symbolic."
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   413
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   414
    ^ #copy
632
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   415
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   416
    "Modified: 2.5.1996 / 11:41:40 / cg"
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   417
!
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   418
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   419
reverse
632
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   420
    "return a constant usable as bitblt-combinationrule.
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   421
     In ST-80rel2.x, these used to be numeric constants; in ST/X,
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   422
     these are symbolic."
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   423
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   424
    ^ #xor
632
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   425
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   426
    "Modified: 2.5.1996 / 11:41:45 / cg"
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   427
!
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   428
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   429
under
632
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   430
    "return a constant usable as bitblt-combinationrule.
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   431
     In ST-80rel2.x, these used to be numeric constants; in ST/X,
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   432
     these are symbolic."
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   433
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   434
    ^ #or
632
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   435
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   436
    "Modified: 2.5.1996 / 11:41:49 / cg"
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   437
!
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   438
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   439
white
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   440
    "ST80rel2.x compatibility;
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
   441
     In old st80, you could use `Form white' for drawing
632
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   442
     - here we return the white color."
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   443
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   444
    ^ Color white
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   445
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   446
    "Modified: 2.5.1996 / 11:42:50 / cg"
109
ba47d9d6bda8 *** empty log message ***
claus
parents: 107
diff changeset
   447
! !
ba47d9d6bda8 *** empty log message ***
claus
parents: 107
diff changeset
   448
3891
48c1f9ab83e3 category
Claus Gittinger <cg@exept.de>
parents: 3880
diff changeset
   449
!Form class methodsFor:'Compatibility-Squeak'!
3142
4b5c726c0630 category renamining
Claus Gittinger <cg@exept.de>
parents: 3135
diff changeset
   450
4768
f61bf4ab2fba ...:on: -> ...:onDevice:
Claus Gittinger <cg@exept.de>
parents: 4642
diff changeset
   451
extent:ext depth:d bits:data
f61bf4ab2fba ...:on: -> ...:onDevice:
Claus Gittinger <cg@exept.de>
parents: 4642
diff changeset
   452
    ^ self width:(ext x) height:(ext y) offset:0 fromArray:data
f61bf4ab2fba ...:on: -> ...:onDevice:
Claus Gittinger <cg@exept.de>
parents: 4642
diff changeset
   453
f61bf4ab2fba ...:on: -> ...:onDevice:
Claus Gittinger <cg@exept.de>
parents: 4642
diff changeset
   454
    "Created: / 26-05-2007 / 22:35:12 / cg"
f61bf4ab2fba ...:on: -> ...:onDevice:
Claus Gittinger <cg@exept.de>
parents: 4642
diff changeset
   455
!
f61bf4ab2fba ...:on: -> ...:onDevice:
Claus Gittinger <cg@exept.de>
parents: 4642
diff changeset
   456
3142
4b5c726c0630 category renamining
Claus Gittinger <cg@exept.de>
parents: 3135
diff changeset
   457
extent:ext depth:d fromArray:data offset:offs
4b5c726c0630 category renamining
Claus Gittinger <cg@exept.de>
parents: 3135
diff changeset
   458
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
   459
    d ~~ 1 ifTrue:[self error:'unsupported depth' mayProceed:true].
4165
b24a5c2adcb2 Do not use obsolete method #readFromFile: in #onDevice.
Stefan Vogel <sv@exept.de>
parents: 3921
diff changeset
   460
    ^ self width:(ext x) height:(ext y) offset:offs fromArray:data
7381
b877572cc0d4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7355
diff changeset
   461
!
b877572cc0d4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7355
diff changeset
   462
b877572cc0d4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7355
diff changeset
   463
fromUser
b877572cc0d4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7355
diff changeset
   464
    ^ Image fromUser asFormOn:(Screen current)
b877572cc0d4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7355
diff changeset
   465
b877572cc0d4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7355
diff changeset
   466
    "
b877572cc0d4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7355
diff changeset
   467
     Delay waitForSeconds:1.
b877572cc0d4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7355
diff changeset
   468
     Form fromUser inspect.
b877572cc0d4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7355
diff changeset
   469
     Delay waitForSeconds:1.
b877572cc0d4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7355
diff changeset
   470
    "
b877572cc0d4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7355
diff changeset
   471
b877572cc0d4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 7355
diff changeset
   472
    "Created: / 07-06-2016 / 12:01:53 / cg"
3142
4b5c726c0630 category renamining
Claus Gittinger <cg@exept.de>
parents: 3135
diff changeset
   473
! !
4b5c726c0630 category renamining
Claus Gittinger <cg@exept.de>
parents: 3135
diff changeset
   474
7493
59db55fd753a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7446
diff changeset
   475
!Form class methodsFor:'accessing private classes'!
59db55fd753a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7446
diff changeset
   476
59db55fd753a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7446
diff changeset
   477
imageForm
59db55fd753a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7446
diff changeset
   478
    ^ ImageForm
59db55fd753a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7446
diff changeset
   479
! !
59db55fd753a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7446
diff changeset
   480
1142
2a83bf7d5627 Form>>readFrom: are going to be obsoleted.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
   481
!Form class methodsFor:'cleanup'!
12
9f0995fac1fa *** empty log message ***
claus
parents: 6
diff changeset
   482
9f0995fac1fa *** empty log message ***
claus
parents: 6
diff changeset
   483
lowSpaceCleanup
9f0995fac1fa *** empty log message ***
claus
parents: 6
diff changeset
   484
    "cleanup in low-memory situations"
9f0995fac1fa *** empty log message ***
claus
parents: 6
diff changeset
   485
54
29a6b2f8e042 *** empty log message ***
claus
parents: 46
diff changeset
   486
    DitherPatternArray := nil
12
9f0995fac1fa *** empty log message ***
claus
parents: 6
diff changeset
   487
! !
9f0995fac1fa *** empty log message ***
claus
parents: 6
diff changeset
   488
1142
2a83bf7d5627 Form>>readFrom: are going to be obsoleted.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
   489
!Form class methodsFor:'file search'!
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   490
48194c26a46c Initial revision
claus
parents:
diff changeset
   491
findBitmapFile:fileName
6227
72c2836e3151 class: Form
Stefan Vogel <sv@exept.de>
parents: 6143
diff changeset
   492
    <resource: #obsolete>
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   493
    "find the bitmap file in one of the standard places;
48194c26a46c Initial revision
claus
parents:
diff changeset
   494
     return the pathName or nil"
48194c26a46c Initial revision
claus
parents:
diff changeset
   495
4642
9eb7fed99649 bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents: 4621
diff changeset
   496
    |path|
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   497
48194c26a46c Initial revision
claus
parents:
diff changeset
   498
    ((fileName at:1) == $/) ifTrue:[^ fileName].
48194c26a46c Initial revision
claus
parents:
diff changeset
   499
    (fileName startsWith:'../') ifTrue:[^ fileName].
48194c26a46c Initial revision
claus
parents:
diff changeset
   500
    (fileName startsWith:'./') ifTrue:[^ fileName].
127
98b0725782bd *** empty log message ***
claus
parents: 126
diff changeset
   501
    fileName asFilename exists ifTrue:[^ fileName].
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   502
4642
9eb7fed99649 bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents: 4621
diff changeset
   503
    path := Smalltalk getBitmapFileName:fileName.
9eb7fed99649 bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents: 4621
diff changeset
   504
    path notNil ifTrue:[
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
   505
	^ path
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   506
    ].
4642
9eb7fed99649 bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents: 4621
diff changeset
   507
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   508
    AdditionalBitmapDirectoryNames notNil ifTrue:[
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
   509
	AdditionalBitmapDirectoryNames do:[:aPath |
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
   510
	    path := aPath , '/' , fileName.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
   511
	    (OperatingSystem isReadable:path) ifTrue:[
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
   512
		^ path
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
   513
	    ]
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
   514
	]
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   515
    ].
48194c26a46c Initial revision
claus
parents:
diff changeset
   516
    ^ nil
48194c26a46c Initial revision
claus
parents:
diff changeset
   517
! !
48194c26a46c Initial revision
claus
parents:
diff changeset
   518
1142
2a83bf7d5627 Form>>readFrom: are going to be obsoleted.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
   519
!Form class methodsFor:'obsolete instance creation'!
632
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   520
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   521
darkGreyFormOn:aDevice
4786
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   522
    <resource: #obsolete>
632
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   523
    "return a darkGrey form"
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   524
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   525
    |f|
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   526
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   527
    ((aDevice == Display) and:[DarkGreyForm notNil]) ifTrue:[
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
   528
	^ DarkGreyForm
632
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   529
    ].
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   530
4770
770e19fa6f50 Use Form class>>#width:height:fromArray:onDevice: instead of obsolete
Stefan Vogel <sv@exept.de>
parents: 4768
diff changeset
   531
    f := self width:8 height:4 fromArray:(self darkGreyFormBits) onDevice:aDevice.
632
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   532
    (aDevice == Display) ifTrue:[
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
   533
	DarkGreyForm := f
632
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   534
    ].
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   535
    ^ f
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   536
!
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   537
4786
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   538
extent:ext depth:d on:aDevice
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   539
    <resource: #obsolete>
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   540
    "create a new form on device, aDevice; depth is what device likes most"
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   541
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   542
    self obsoleteMethodWarning:'use #extent:depth:onDevice:'.
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   543
    ^ self width:ext x height:ext y depth:d onDevice:aDevice
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   544
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   545
    "Created: / 04-04-1997 / 20:23:32 / cg"
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   546
    "Modified: / 27-05-2007 / 12:39:51 / cg"
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   547
!
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   548
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   549
extent:ext fromArray:data offset:offs on:aDevice
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   550
    <resource: #obsolete>
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   551
    "create a new form, take dimensions from ext, bits from data."
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   552
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   553
    self obsoleteMethodWarning:'use #extent:fromArray:offset:onDevice:'.
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   554
    ^ self width:(ext x) height:(ext y) offset:offs fromArray:data onDevice:aDevice
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   555
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   556
    "Created: / 10-04-1997 / 15:36:31 / cg"
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   557
    "Modified: / 27-05-2007 / 12:42:26 / cg"
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   558
!
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   559
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   560
extent:ext fromArray:data on:aDevice
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   561
    <resource: #obsolete>
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   562
    "create a new form, take dimensions from ext, bits from data."
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   563
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   564
    self obsoleteMethodWarning:'use #extent:fromArray:onDevice:'.
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   565
    ^ self width:(ext x) height:(ext y) fromArray:data onDevice:aDevice
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   566
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   567
    "Created: / 10-04-1997 / 15:34:34 / cg"
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   568
    "Modified: / 27-05-2007 / 12:41:57 / cg"
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   569
!
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   570
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   571
extent:ext on:aDevice
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   572
    <resource: #obsolete>
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   573
    "create a new form on device, aDevice; depth is what device likes most"
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   574
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   575
    self obsoleteMethodWarning:'use #extent:onDevice:'.
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   576
    ^ self width:ext x height:ext y onDevice:aDevice
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   577
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   578
    "Modified: / 27-05-2007 / 12:41:42 / cg"
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   579
!
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   580
632
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   581
grey:percent on:aDevice
4786
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   582
    <resource: #obsolete>
632
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   583
    "return a form for dithering"
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   584
2827
4f30d3aa96e5 #on: -> #onDevice:
Claus Gittinger <cg@exept.de>
parents: 2823
diff changeset
   585
    (percent < 20) ifTrue:[^ Color black onDevice:aDevice].
632
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   586
    (percent < 40) ifTrue:[^ self darkGreyFormOn:aDevice].
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   587
    (percent < 60) ifTrue:[^ self mediumGreyFormOn:aDevice].
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   588
    (percent < 80) ifTrue:[^ self lightGreyFormOn:aDevice].
2827
4f30d3aa96e5 #on: -> #onDevice:
Claus Gittinger <cg@exept.de>
parents: 2823
diff changeset
   589
    ^ Color white onDevice:aDevice
632
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   590
!
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   591
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   592
lightGreyFormOn:aDevice
4786
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   593
    <resource: #obsolete>
632
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   594
    "return a lightGrey form"
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   595
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   596
    |f|
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   597
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   598
    ((aDevice == Display) and:[LightGreyForm notNil]) ifTrue:[
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
   599
	^ LightGreyForm
632
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   600
    ].
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   601
4770
770e19fa6f50 Use Form class>>#width:height:fromArray:onDevice: instead of obsolete
Stefan Vogel <sv@exept.de>
parents: 4768
diff changeset
   602
    f := self width:8 height:4 fromArray:(self lightGreyFormBits) onDevice:aDevice.
632
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   603
    (aDevice == Display) ifTrue:[
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
   604
	LightGreyForm := f
632
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   605
    ].
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   606
    ^ f
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   607
!
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   608
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   609
mediumGreyFormOn:aDevice
4786
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   610
    <resource: #obsolete>
632
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   611
    "return a grey form"
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   612
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   613
    |f|
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   614
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   615
    ((aDevice == Display) and:[GreyForm notNil]) ifTrue:[
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
   616
	^ GreyForm
632
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   617
    ].
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   618
4770
770e19fa6f50 Use Form class>>#width:height:fromArray:onDevice: instead of obsolete
Stefan Vogel <sv@exept.de>
parents: 4768
diff changeset
   619
    f := self width:8 height:4 fromArray:(self greyFormBits) onDevice:aDevice.
632
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   620
    (aDevice == Display) ifTrue:[
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
   621
	GreyForm := f
632
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   622
    ].
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   623
    ^ f
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   624
!
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   625
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   626
veryDarkGreyFormOn:aDevice
4786
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   627
    <resource: #obsolete>
632
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   628
    "return a veryDarkGrey form"
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   629
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   630
    |f|
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   631
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   632
    ((aDevice == Display) and:[VeryDarkGreyForm notNil]) ifTrue:[
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
   633
	^ VeryDarkGreyForm
632
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   634
    ].
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   635
4770
770e19fa6f50 Use Form class>>#width:height:fromArray:onDevice: instead of obsolete
Stefan Vogel <sv@exept.de>
parents: 4768
diff changeset
   636
    f := self width:8 height:4 fromArray:(self veryDarkGreyFormBits) onDevice:aDevice.
632
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   637
    (aDevice == Display) ifTrue:[
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
   638
	VeryDarkGreyForm := f
632
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   639
    ].
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   640
    ^ f
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   641
!
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   642
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   643
veryLightGreyFormOn:aDevice
4786
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   644
    <resource: #obsolete>
632
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   645
    "return a veryLightGrey form"
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   646
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   647
    |f|
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   648
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   649
    ((aDevice == Display) and:[VeryLightGreyForm notNil]) ifTrue:[
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
   650
	^ VeryLightGreyForm
632
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   651
    ].
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   652
4770
770e19fa6f50 Use Form class>>#width:height:fromArray:onDevice: instead of obsolete
Stefan Vogel <sv@exept.de>
parents: 4768
diff changeset
   653
    f := self width:8 height:4 fromArray:(self veryLightGreyFormBits) onDevice:aDevice.
632
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   654
    (aDevice == Display) ifTrue:[
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
   655
	VeryLightGreyForm := f
632
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   656
    ].
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   657
    ^ f
4786
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   658
!
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   659
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   660
width:w height:h depth:d on:aDevice
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   661
    <resource: #obsolete>
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   662
    "create a new form with depth d on device, aDevice"
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   663
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   664
    self obsoleteMethodWarning:'use #width:height:depth:onDevice:'.
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   665
    ^ (self onDevice:aDevice) width:w height:h depth:d
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   666
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   667
    "Modified: / 27-05-2007 / 12:40:25 / cg"
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   668
!
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   669
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   670
width:w height:h fromArray:anArray on:aDevice
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   671
    <resource: #obsolete>
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   672
    "create a new form on device, aDevice and
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   673
     initialize the pixels from anArray"
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   674
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   675
    self obsoleteMethodWarning:'use #width:height:fromArray:onDevice:'.
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   676
    ^ (self onDevice:aDevice) width:w height:h fromArray:anArray
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   677
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   678
    "Modified: / 27-05-2007 / 12:40:41 / cg"
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   679
!
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   680
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   681
width:w height:h offset:offs fromArray:anArray on:aDevice
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   682
    <resource: #obsolete>
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   683
    "create a new form on the default device"
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   684
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   685
    self obsoleteMethodWarning:'use #width:height:offset:fromArray:onDevice:'.
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   686
    ^ (self onDevice:aDevice) width:w height:h offset:offs fromArray:anArray
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   687
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   688
    "Created: / 10-04-1997 / 15:35:07 / cg"
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   689
    "Modified: / 27-05-2007 / 12:41:17 / cg"
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   690
!
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   691
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   692
width:w height:h on:aDevice
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   693
    <resource: #obsolete>
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   694
    "create a new form on device, aDevice; depth is what device likes most"
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   695
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   696
    self obsoleteMethodWarning:'use #width:height:onDevice:'.
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   697
    ^ (self onDevice:aDevice) width:w height:h
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   698
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   699
    "Modified: / 27-05-2007 / 12:40:57 / cg"
632
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   700
! !
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   701
1142
2a83bf7d5627 Form>>readFrom: are going to be obsoleted.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
   702
!Form class methodsFor:'obsolete patterns'!
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   703
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   704
darkGreyFormBits
4786
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   705
    <resource: #obsolete>
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   706
    "return a pattern usable to simulate darkGray on monochrome device"
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   707
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   708
    ^ #(2r10111011
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   709
	2r11101110
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   710
	2r10111011
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   711
	2r11101110)
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   712
!
48194c26a46c Initial revision
claus
parents:
diff changeset
   713
632
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   714
grey12Bits
4786
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   715
    <resource: #obsolete>
632
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   716
    "return a pattern with 12% grey, usable for dithering"
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   717
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   718
    ^ #(2r00010001
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   719
	2r00000000
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   720
	2r01000100
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   721
	2r00000000)
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   722
!
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   723
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   724
grey25Bits
4786
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   725
    <resource: #obsolete>
632
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   726
    "return a pattern with 25% grey, usable for dithering"
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   727
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   728
    ^ #(2r00010001
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   729
	2r01000100
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   730
	2r00010001
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   731
	2r01000100)
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   732
!
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   733
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   734
grey37Bits
4786
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   735
    <resource: #obsolete>
632
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   736
    "return a pattern with 37% grey, usable for dithering"
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   737
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   738
    ^ #(2r00010001
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   739
	2r10101010
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   740
	2r01000100
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   741
	2r10101010)
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   742
!
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   743
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   744
grey50Bits
4786
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   745
    <resource: #obsolete>
632
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   746
    "return a pattern with 50% grey, usable for dithering"
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   747
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   748
    ^ #(2r01010101
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   749
	2r10101010
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   750
	2r01010101
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   751
	2r10101010)
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   752
!
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   753
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   754
grey6Bits
4786
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   755
    <resource: #obsolete>
632
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   756
    "return a pattern with 6% grey, usable for dithering"
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   757
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   758
    ^ #(2r00000001
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   759
	2r00000000
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   760
	2r00010000
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   761
	2r00000000)
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   762
!
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   763
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   764
greyFormBits
4786
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   765
    <resource: #obsolete>
632
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   766
    "return a pattern usable to simulate gray on monochrome device"
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   767
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   768
    ^ #(2r01010101
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   769
	2r10101010
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   770
	2r01010101
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   771
	2r10101010)
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   772
!
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   773
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   774
lightGreyFormBits
4786
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   775
    <resource: #obsolete>
632
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   776
    "return a pattern usable to simulate lightGray on monochrome device"
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   777
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   778
    ^ #(2r01000100
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   779
	2r00010001
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   780
	2r01000100
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   781
	2r00010001
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   782
	2r01000100)
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   783
!
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   784
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   785
veryDarkGreyFormBits
4786
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   786
    <resource: #obsolete>
632
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   787
    "return a pattern usable to simulate veryDarkGray on monochrome device"
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   788
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   789
    ^ #(2r01110111
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   790
	2r11111111
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   791
	2r11011101
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   792
	2r11111111)
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   793
!
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   794
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   795
veryLightGreyFormBits
4786
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
   796
    <resource: #obsolete>
632
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   797
    "return a pattern usable to simulate veryDarkGray on monochrome device"
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   798
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   799
    ^ #(2r10001000
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   800
	2r00000000
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   801
	2r00100010
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   802
	2r00000000)
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   803
! !
28cbc6517090 marked some obsolete; grey/gray (sigh)
Claus Gittinger <cg@exept.de>
parents: 610
diff changeset
   804
3880
c4c8268a2d9f method category rename
Claus Gittinger <cg@exept.de>
parents: 3812
diff changeset
   805
!Form methodsFor:'Compatibility-ST80'!
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   806
2964
d9b5700dbfda checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   807
displayAt:aPoint
d9b5700dbfda checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   808
    "show the receiver on the current display screen"
d9b5700dbfda checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   809
d9b5700dbfda checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   810
    self displayOn:Screen current rootView at:aPoint
d9b5700dbfda checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   811
d9b5700dbfda checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   812
    "
d9b5700dbfda checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   813
     (Form dotOfSize:8) displayAt:10@10
d9b5700dbfda checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   814
    "
d9b5700dbfda checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   815
d9b5700dbfda checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   816
d9b5700dbfda checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   817
!
d9b5700dbfda checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2939
diff changeset
   818
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   819
displayOn:aGC at:aPoint rule:rule
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   820
    "draw in aGC.
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   821
     Smalltalk-80 (2.x) compatibility"
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   822
672
01d7c8b9d2e7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 632
diff changeset
   823
    self displayOn:aGC x:aPoint x y:aPoint y rule:rule
01d7c8b9d2e7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 632
diff changeset
   824
01d7c8b9d2e7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 632
diff changeset
   825
    "Modified: 12.5.1996 / 20:16:02 / cg"
01d7c8b9d2e7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 632
diff changeset
   826
!
01d7c8b9d2e7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 632
diff changeset
   827
01d7c8b9d2e7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 632
diff changeset
   828
displayOn:aGC rule:rule
01d7c8b9d2e7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 632
diff changeset
   829
    "draw in aGC.
01d7c8b9d2e7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 632
diff changeset
   830
     Smalltalk-80 (2.x) compatibility"
01d7c8b9d2e7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 632
diff changeset
   831
01d7c8b9d2e7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 632
diff changeset
   832
    ^ self displayOn:aGC x:0 y:0 rule:rule
01d7c8b9d2e7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 632
diff changeset
   833
01d7c8b9d2e7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 632
diff changeset
   834
    "Modified: 12.5.1996 / 20:15:41 / cg"
01d7c8b9d2e7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 632
diff changeset
   835
!
01d7c8b9d2e7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 632
diff changeset
   836
01d7c8b9d2e7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 632
diff changeset
   837
displayOn:aGC x:x y:y
01d7c8b9d2e7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 632
diff changeset
   838
    "draw in aGC.
01d7c8b9d2e7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 632
diff changeset
   839
     Smalltalk-80 (2.x) compatibility"
01d7c8b9d2e7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 632
diff changeset
   840
01d7c8b9d2e7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 632
diff changeset
   841
    ^ self displayOn:aGC x:x y:y rule:#copy
01d7c8b9d2e7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 632
diff changeset
   842
01d7c8b9d2e7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 632
diff changeset
   843
    "Created: 12.5.1996 / 20:15:05 / cg"
01d7c8b9d2e7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 632
diff changeset
   844
!
01d7c8b9d2e7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 632
diff changeset
   845
01d7c8b9d2e7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 632
diff changeset
   846
displayOn:aGC x:x y:y rule:rule
01d7c8b9d2e7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 632
diff changeset
   847
    "draw in aGC.
01d7c8b9d2e7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 632
diff changeset
   848
     Smalltalk-80 (2.x) compatibility"
01d7c8b9d2e7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 632
diff changeset
   849
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   850
    |f|
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   851
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   852
    f := aGC function.
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   853
    aGC function:rule.
672
01d7c8b9d2e7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 632
diff changeset
   854
    aGC displayOpaqueForm:self x:x y:y.
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   855
    aGC function:f.
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   856
672
01d7c8b9d2e7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 632
diff changeset
   857
    "Created: 12.5.1996 / 20:15:26 / cg"
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   858
!
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   859
1325
3c09b139de30 more st80 compatibility
Claus Gittinger <cg@exept.de>
parents: 1278
diff changeset
   860
isOpen
3c09b139de30 more st80 compatibility
Claus Gittinger <cg@exept.de>
parents: 1278
diff changeset
   861
    ^ true
3c09b139de30 more st80 compatibility
Claus Gittinger <cg@exept.de>
parents: 1278
diff changeset
   862
3c09b139de30 more st80 compatibility
Claus Gittinger <cg@exept.de>
parents: 1278
diff changeset
   863
    "Created: 10.2.1997 / 12:43:49 / cg"
3c09b139de30 more st80 compatibility
Claus Gittinger <cg@exept.de>
parents: 1278
diff changeset
   864
!
3c09b139de30 more st80 compatibility
Claus Gittinger <cg@exept.de>
parents: 1278
diff changeset
   865
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   866
offset
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   867
    "set the offset.
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   868
     Smalltalk-80 compatibility"
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   869
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   870
    ^ offset
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   871
!
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   872
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   873
offset:org
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   874
    "set the offset.
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   875
     Smalltalk-80 compatibility"
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   876
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   877
    offset := org
1325
3c09b139de30 more st80 compatibility
Claus Gittinger <cg@exept.de>
parents: 1278
diff changeset
   878
!
3c09b139de30 more st80 compatibility
Claus Gittinger <cg@exept.de>
parents: 1278
diff changeset
   879
3c09b139de30 more st80 compatibility
Claus Gittinger <cg@exept.de>
parents: 1278
diff changeset
   880
preferredBounds
3c09b139de30 more st80 compatibility
Claus Gittinger <cg@exept.de>
parents: 1278
diff changeset
   881
    ^ self bounds
3c09b139de30 more st80 compatibility
Claus Gittinger <cg@exept.de>
parents: 1278
diff changeset
   882
3c09b139de30 more st80 compatibility
Claus Gittinger <cg@exept.de>
parents: 1278
diff changeset
   883
    "Created: 10.2.1997 / 12:43:00 / cg"
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   884
! !
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   885
3880
c4c8268a2d9f method category rename
Claus Gittinger <cg@exept.de>
parents: 3812
diff changeset
   886
!Form methodsFor:'Compatibility-Squeak'!
3020
e043c3d30613 more Squeak compatibility stuff
ps
parents: 2980
diff changeset
   887
e043c3d30613 more Squeak compatibility stuff
ps
parents: 2980
diff changeset
   888
colormapIfNeededForDepth:destDepth
e043c3d30613 more Squeak compatibility stuff
ps
parents: 2980
diff changeset
   889
e043c3d30613 more Squeak compatibility stuff
ps
parents: 2980
diff changeset
   890
    ^nil
3025
11d768e415c2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3020
diff changeset
   891
!
11d768e415c2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3020
diff changeset
   892
11d768e415c2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3020
diff changeset
   893
magnify:aRectangle by:scale smoothing:smooth
11d768e415c2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3020
diff changeset
   894
    ^ ((Image fromSubForm:aRectangle in:self) magnifiedBy:scale) asFormOn:device.
3020
e043c3d30613 more Squeak compatibility stuff
ps
parents: 2980
diff changeset
   895
! !
e043c3d30613 more Squeak compatibility stuff
ps
parents: 2980
diff changeset
   896
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   897
!Form methodsFor:'accessing'!
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   898
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   899
bits
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   900
    "return a ByteArray filled with my bits -
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   901
     for depth 8 forms, 1 pixel/byte is filled;
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   902
     for depth 1 forms, 8 pixels/byte are filled
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   903
     for depth 4 forms, 2 pixels/byte are filled.
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
   904
     Padding is done row-wise to the next BYTE-boundary
1645
67ea694c219d comment
Claus Gittinger <cg@exept.de>
parents: 1571
diff changeset
   905
     If multiple pixels are contained in a single byte,
67ea694c219d comment
Claus Gittinger <cg@exept.de>
parents: 1571
diff changeset
   906
     left bits are in the most significant bit positions.
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   907
     (i.e. for width==13 and depth==1 it will return 2 bytes per scanline)"
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   908
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   909
    |bytesPerLine   "{ Class: SmallInteger }"
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   910
     bytesPerLineIn "{ Class: SmallInteger }"
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   911
     inData tmpData info
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   912
     srcIndex "{ Class: SmallInteger }"
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   913
     dstIndex "{ Class: SmallInteger }"
2060
effcaa60f42d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
   914
     buffer spaceBitsPerPixel|
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   915
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   916
    data notNil ifTrue:[
1458
612420702141 splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents: 1452
diff changeset
   917
        ^ data
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   918
    ].
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
   919
    self drawableId isNil ifTrue:[
1458
612420702141 splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents: 1452
diff changeset
   920
        ^ nil
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   921
    ].
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   922
2060
effcaa60f42d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
   923
    spaceBitsPerPixel := depth.
effcaa60f42d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
   924
    (depth > 8) ifTrue:[
effcaa60f42d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
   925
        spaceBitsPerPixel := 16.
effcaa60f42d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
   926
        (depth > 16) ifTrue:[
effcaa60f42d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
   927
            spaceBitsPerPixel := 32.
effcaa60f42d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
   928
            (depth > 32) ifTrue:[
effcaa60f42d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
   929
                spaceBitsPerPixel := depth.
effcaa60f42d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
   930
            ]
effcaa60f42d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
   931
        ]
effcaa60f42d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
   932
    ].
effcaa60f42d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
   933
effcaa60f42d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
   934
    bytesPerLine := (width * spaceBitsPerPixel + 31) // 32 * 4.
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   935
    inData := ByteArray uninitializedNew:(bytesPerLine * height).
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
   936
    info := device getBitsFromPixmapId:self drawableId x:0 y:0 width:width height:height into:inData.
398
2b35bb58a82b changes for new returned info from getBits
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   937
    bytesPerLineIn := (info at:#bytesPerLine).                    "what I got"
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   938
    bytesPerLine := (width * depth + 7) // 8.                     "what I want"
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   939
    (bytesPerLine ~~ bytesPerLineIn) ifTrue:[
1458
612420702141 splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents: 1452
diff changeset
   940
        "
612420702141 splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents: 1452
diff changeset
   941
         different padding - have to copy over row-wise
612420702141 splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents: 1452
diff changeset
   942
        "
612420702141 splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents: 1452
diff changeset
   943
        tmpData := inData.
612420702141 splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents: 1452
diff changeset
   944
        inData := ByteArray uninitializedNew:(bytesPerLine * height).
612420702141 splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents: 1452
diff changeset
   945
        srcIndex := 1.
612420702141 splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents: 1452
diff changeset
   946
        dstIndex := 1.
612420702141 splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents: 1452
diff changeset
   947
        1 to:height do:[:hi |
612420702141 splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents: 1452
diff changeset
   948
            inData replaceFrom:dstIndex to:(dstIndex + bytesPerLine - 1)
612420702141 splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents: 1452
diff changeset
   949
                          with:tmpData startingAt:srcIndex.
612420702141 splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents: 1452
diff changeset
   950
            dstIndex := dstIndex + bytesPerLine.
612420702141 splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents: 1452
diff changeset
   951
            srcIndex := srcIndex + bytesPerLineIn
612420702141 splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents: 1452
diff changeset
   952
        ]
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   953
    ] ifFalse:[
1458
612420702141 splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents: 1452
diff changeset
   954
        "
612420702141 splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents: 1452
diff changeset
   955
         same padding - copy over all in one chunk
612420702141 splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents: 1452
diff changeset
   956
        "
612420702141 splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents: 1452
diff changeset
   957
        (bytesPerLine * height) ~~ inData size ifTrue:[
612420702141 splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents: 1452
diff changeset
   958
            tmpData := inData.
612420702141 splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents: 1452
diff changeset
   959
            inData := ByteArray uninitializedNew:(bytesPerLine * height).
612420702141 splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents: 1452
diff changeset
   960
            inData replaceFrom:1 to:bytesPerLine * height with:tmpData startingAt:1
612420702141 splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents: 1452
diff changeset
   961
        ]
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   962
    ].
1645
67ea694c219d comment
Claus Gittinger <cg@exept.de>
parents: 1571
diff changeset
   963
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   964
    "
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   965
     have to reverse bytes, if not msbFirst ?
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   966
    "
915
1ac3e38e6da5 oops - accessing a forms device bits was wrong for
ca
parents: 910
diff changeset
   967
1ac3e38e6da5 oops - accessing a forms device bits was wrong for
ca
parents: 910
diff changeset
   968
"/    (info at:#byteOrder) ~~ #msbFirst ifTrue:[
1ac3e38e6da5 oops - accessing a forms device bits was wrong for
ca
parents: 910
diff changeset
   969
"/        buffer := ByteArray new:bytesPerLine.
1ac3e38e6da5 oops - accessing a forms device bits was wrong for
ca
parents: 910
diff changeset
   970
"/        dstIndex := 1.
1ac3e38e6da5 oops - accessing a forms device bits was wrong for
ca
parents: 910
diff changeset
   971
"/        1 to:height do:[:hi |
1ac3e38e6da5 oops - accessing a forms device bits was wrong for
ca
parents: 910
diff changeset
   972
"/            buffer replaceFrom:1 to:bytesPerLine with:inData startingAt:dstIndex.
1ac3e38e6da5 oops - accessing a forms device bits was wrong for
ca
parents: 910
diff changeset
   973
"/            buffer reverse.
1ac3e38e6da5 oops - accessing a forms device bits was wrong for
ca
parents: 910
diff changeset
   974
"/            inData replaceFrom:dstIndex to:dstIndex+bytesPerLine-1 with:buffer startingAt:1.
1ac3e38e6da5 oops - accessing a forms device bits was wrong for
ca
parents: 910
diff changeset
   975
"/            dstIndex := dstIndex + bytesPerLine
1ac3e38e6da5 oops - accessing a forms device bits was wrong for
ca
parents: 910
diff changeset
   976
"/        ]
1ac3e38e6da5 oops - accessing a forms device bits was wrong for
ca
parents: 910
diff changeset
   977
"/    ].
1645
67ea694c219d comment
Claus Gittinger <cg@exept.de>
parents: 1571
diff changeset
   978
67ea694c219d comment
Claus Gittinger <cg@exept.de>
parents: 1571
diff changeset
   979
    "
67ea694c219d comment
Claus Gittinger <cg@exept.de>
parents: 1571
diff changeset
   980
     have to reverse bits, if not msbFirst ?
67ea694c219d comment
Claus Gittinger <cg@exept.de>
parents: 1571
diff changeset
   981
    "
398
2b35bb58a82b changes for new returned info from getBits
Claus Gittinger <cg@exept.de>
parents: 278
diff changeset
   982
    (info at:#bitOrder) ~~ #msbFirst ifTrue:[
1458
612420702141 splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents: 1452
diff changeset
   983
        buffer := ByteArray new:bytesPerLine.
612420702141 splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents: 1452
diff changeset
   984
        dstIndex := 1.
612420702141 splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents: 1452
diff changeset
   985
        1 to:height do:[:hi |
612420702141 splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents: 1452
diff changeset
   986
            buffer replaceFrom:1 to:bytesPerLine with:inData startingAt:dstIndex.
612420702141 splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents: 1452
diff changeset
   987
            buffer expandPixels:8 width:bytesPerLine height:1 into:buffer
612420702141 splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents: 1452
diff changeset
   988
                                mapping:(ImageReader reverseBits).  "/ translate only
612420702141 splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents: 1452
diff changeset
   989
            inData replaceFrom:dstIndex to:dstIndex+bytesPerLine-1 with:buffer startingAt:1.
612420702141 splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents: 1452
diff changeset
   990
            dstIndex := dstIndex + bytesPerLine
612420702141 splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents: 1452
diff changeset
   991
        ]
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   992
    ].
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   993
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   994
    ^ inData.
1458
612420702141 splitted getBitsFrom into getBitsFromPixmap
Claus Gittinger <cg@exept.de>
parents: 1452
diff changeset
   995
2060
effcaa60f42d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1964
diff changeset
   996
    "Modified: / 19.2.1998 / 14:47:06 / cg"
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   997
!
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   998
588
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
   999
bits:aByteArray
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1000
    "set the forms bits;
588
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1001
     for depth-8 forms, 1 pixel/byte is expected;
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1002
     for depth-1 forms, 8 pixels/byte are expected
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1003
     for depth-4 forms, 2 pixels/byte are expected.
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1004
     Padding is expected to the next byte-boundary
588
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1005
     (i.e. for width==13 and depth==1 2 bytes per scanline are expected)"
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1006
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1007
    data := aByteArray
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1008
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1009
    "Modified: 23.4.1996 / 10:06:01 / cg"
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1010
!
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1011
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1012
bitsPerSample
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1013
    "for compatibility with Image class ..."
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1014
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1015
    ^ Array with:depth
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1016
!
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1017
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1018
colorMap
7238
f3b9554e8095 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 7106
diff changeset
  1019
    "return the receiver's colormap"
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1020
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1021
    ^ localColorMap
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1022
!
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1023
1436
c64b7abfc5fe checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1325
diff changeset
  1024
colorMap:anArrayOrColorMap
7238
f3b9554e8095 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 7106
diff changeset
  1025
    "set the receiver's colormap"
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1026
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1027
    localColorMap := anArrayOrColorMap.
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1028
!
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1029
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1030
depth
7238
f3b9554e8095 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 7106
diff changeset
  1031
    "return the receiver's depth"
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1032
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1033
    ^ depth
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1034
!
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1035
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1036
forgetBits
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1037
    "for image, which also keeps the bits - so there is
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1038
     no need to hold them again here"
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1039
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1040
    data := nil
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1041
!
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1042
897
ad8ff0206343 mask access
Claus Gittinger <cg@exept.de>
parents: 889
diff changeset
  1043
mask
ad8ff0206343 mask access
Claus Gittinger <cg@exept.de>
parents: 889
diff changeset
  1044
    "for compatibility with images; forms have no mask/alpha channel"
ad8ff0206343 mask access
Claus Gittinger <cg@exept.de>
parents: 889
diff changeset
  1045
ad8ff0206343 mask access
Claus Gittinger <cg@exept.de>
parents: 889
diff changeset
  1046
    ^ nil
ad8ff0206343 mask access
Claus Gittinger <cg@exept.de>
parents: 889
diff changeset
  1047
ad8ff0206343 mask access
Claus Gittinger <cg@exept.de>
parents: 889
diff changeset
  1048
    "Created: 21.6.1996 / 12:52:42 / cg"
ad8ff0206343 mask access
Claus Gittinger <cg@exept.de>
parents: 889
diff changeset
  1049
!
ad8ff0206343 mask access
Claus Gittinger <cg@exept.de>
parents: 889
diff changeset
  1050
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1051
maskedPixelsAre0
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1052
    ^ maskedPixelsAre0
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1053
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1054
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1055
maskedPixelsAre0:something
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1056
    maskedPixelsAre0 := something.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1057
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1058
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1059
photometric
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1060
    "for compatibility with Image class ..."
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1061
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1062
    depth == 1 ifTrue:[
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1063
	localColorMap isNil ifTrue:[
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1064
	    ^ #whiteIs0
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1065
	].
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1066
	((localColorMap at:1) = Color white) ifTrue:[
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1067
	    ((localColorMap at:2) = Color black) ifTrue:[
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1068
		^ #whiteIs0
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1069
	    ].
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1070
	].
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1071
	((localColorMap at:1) = Color black) ifTrue:[
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1072
	    ((localColorMap at:2) = Color white) ifTrue:[
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1073
		^ #blackIs0
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1074
	    ].
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1075
	].
6483
10d4084f12cc class: Form
Stefan Vogel <sv@exept.de>
parents: 6257
diff changeset
  1076
    ] ifFalse:[depth > 8 ifTrue:[
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1077
	^ #rgb
6483
10d4084f12cc class: Form
Stefan Vogel <sv@exept.de>
parents: 6257
diff changeset
  1078
    ]].
10d4084f12cc class: Form
Stefan Vogel <sv@exept.de>
parents: 6257
diff changeset
  1079
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1080
    ^ #palette
872
ae232ece067d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 871
diff changeset
  1081
ae232ece067d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 871
diff changeset
  1082
    "Modified: 17.6.1996 / 11:45:16 / cg"
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1083
!
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1084
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1085
samplesPerPixel
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1086
    "for compatibility with Image class ..."
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1087
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1088
    ^ 1
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1089
!
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1090
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1091
valueAt:aPoint
588
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1092
    "return the pixel at aPoint; the coordinates start with 0@0
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1093
     in the upper left, increasing to the lower right"
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1094
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1095
    ^ self at:aPoint
588
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1096
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1097
    "Modified: 23.4.1996 / 10:06:55 / cg"
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1098
!
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1099
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1100
valueAt:aPoint put:value
588
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1101
    "set the pixel at aPoint; the coordinates start with 0@0
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1102
     in the upper left, increasing to the lower right."
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1103
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1104
    ^ self at:aPoint put:value
588
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1105
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1106
    "
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1107
     |f|
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1108
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1109
     f := Form width:10 height:10 depth:1.
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1110
     f clear.
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1111
     1 to:10 do:[:i |
1138
4a2b3b407cae need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
  1112
	f valueAt:(i @ i) put:1
588
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1113
     ].
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1114
     f inspect
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1115
    "
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1116
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1117
    "Modified: 23.4.1996 / 10:12:48 / cg"
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1118
! !
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1119
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1120
5213
638447e61970 Mark obsolete methods
Stefan Vogel <sv@exept.de>
parents: 4938
diff changeset
  1121
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1122
!Form methodsFor:'converting'!
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1123
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1124
asForm
588
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1125
    "convert & return the receiver into a Form instance - nothing to be done here"
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1126
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1127
    ^ self
588
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1128
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1129
    "Modified: 23.4.1996 / 10:14:11 / cg"
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1130
!
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1131
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1132
asImage
588
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1133
    "convert & return the receiver into an Image instance"
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1134
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1135
    ^ Image fromForm:self
588
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1136
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1137
    "Modified: 23.4.1996 / 10:13:56 / cg"
4173
100ca435fb0e New class Form::ImageForm for Forms that are created from Images.
Stefan Vogel <sv@exept.de>
parents: 4165
diff changeset
  1138
!
100ca435fb0e New class Form::ImageForm for Forms that are created from Images.
Stefan Vogel <sv@exept.de>
parents: 4165
diff changeset
  1139
100ca435fb0e New class Form::ImageForm for Forms that are created from Images.
Stefan Vogel <sv@exept.de>
parents: 4165
diff changeset
  1140
asImageForm
100ca435fb0e New class Form::ImageForm for Forms that are created from Images.
Stefan Vogel <sv@exept.de>
parents: 4165
diff changeset
  1141
    "convert & return the receiver into a ImageForm instance"
100ca435fb0e New class Form::ImageForm for Forms that are created from Images.
Stefan Vogel <sv@exept.de>
parents: 4165
diff changeset
  1142
100ca435fb0e New class Form::ImageForm for Forms that are created from Images.
Stefan Vogel <sv@exept.de>
parents: 4165
diff changeset
  1143
    |imageForm|
100ca435fb0e New class Form::ImageForm for Forms that are created from Images.
Stefan Vogel <sv@exept.de>
parents: 4165
diff changeset
  1144
100ca435fb0e New class Form::ImageForm for Forms that are created from Images.
Stefan Vogel <sv@exept.de>
parents: 4165
diff changeset
  1145
    imageForm := ImageForm cloneFrom:self.
100ca435fb0e New class Form::ImageForm for Forms that are created from Images.
Stefan Vogel <sv@exept.de>
parents: 4165
diff changeset
  1146
100ca435fb0e New class Form::ImageForm for Forms that are created from Images.
Stefan Vogel <sv@exept.de>
parents: 4165
diff changeset
  1147
    "kludge: have to unregister. Otherwise the form will be destroyed when
100ca435fb0e New class Form::ImageForm for Forms that are created from Images.
Stefan Vogel <sv@exept.de>
parents: 4165
diff changeset
  1148
     we are garbage collected"
100ca435fb0e New class Form::ImageForm for Forms that are created from Images.
Stefan Vogel <sv@exept.de>
parents: 4165
diff changeset
  1149
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1150
    gc finalizationLobby
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1151
	unregister:gc;
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1152
	registerChange:imageForm graphicsContext.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1153
4173
100ca435fb0e New class Form::ImageForm for Forms that are created from Images.
Stefan Vogel <sv@exept.de>
parents: 4165
diff changeset
  1154
    ^ imageForm.
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1155
! !
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1156
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1157
!Form methodsFor:'copying'!
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1158
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1159
postCopy
588
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1160
    "redefined to copy the colorMap as well"
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1161
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1162
    super postCopy.
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1163
    localColorMap := localColorMap copy.
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1164
    data := data copy
588
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1165
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1166
    "Modified: 23.4.1996 / 10:14:46 / cg"
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1167
! !
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1168
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1169
!Form methodsFor:'editing'!
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1170
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1171
show
588
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1172
    "open an imageView on the receiver"
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1173
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1174
    ImageView openOnImage:self
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1175
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1176
    "
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1177
     (Form fromFile:'bitmaps/SBrowser.xbm') show
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1178
    "
588
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1179
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1180
    "Modified: 23.4.1996 / 10:16:12 / cg"
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1181
! !
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1182
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1183
!Form methodsFor:'getting a device form'!
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1184
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1185
asFormOn:aDevice
588
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1186
    "convert & return the receiver into a Form instance
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1187
     and associate it to a device (i.e. download its bits).
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1188
     Added for protocol compatibility with Image."
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1189
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1190
    aDevice == device ifTrue:[
1889
8e24afd8174e Send #onDevice instead of obsolete #on:
Stefan Vogel <sv@exept.de>
parents: 1745
diff changeset
  1191
        ^ self
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1192
    ].
1889
8e24afd8174e Send #onDevice instead of obsolete #on:
Stefan Vogel <sv@exept.de>
parents: 1745
diff changeset
  1193
    ^ self onDevice:aDevice
588
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1194
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1195
    "Modified: 23.4.1996 / 10:17:26 / cg"
1889
8e24afd8174e Send #onDevice instead of obsolete #on:
Stefan Vogel <sv@exept.de>
parents: 1745
diff changeset
  1196
    "Modified: 26.8.1997 / 10:29:14 / stefan"
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1197
!
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1198
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1199
asMonochromeFormOn:aDevice
588
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1200
    "added for protocol compatiblity with Image"
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1201
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1202
    depth == 1 ifTrue:[
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1203
        aDevice == device ifTrue:[
2191
7be9c2c6c66f use #onDevice: in #asMono
Claus Gittinger <cg@exept.de>
parents: 2074
diff changeset
  1204
            ^ self
7be9c2c6c66f use #onDevice: in #asMono
Claus Gittinger <cg@exept.de>
parents: 2074
diff changeset
  1205
        ].
7be9c2c6c66f use #onDevice: in #asMono
Claus Gittinger <cg@exept.de>
parents: 2074
diff changeset
  1206
        ^ self onDevice:aDevice
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1207
    ].
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1208
    ^ nil
588
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1209
2191
7be9c2c6c66f use #onDevice: in #asMono
Claus Gittinger <cg@exept.de>
parents: 2074
diff changeset
  1210
    "Modified: / 27.7.1998 / 20:04:37 / cg"
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1211
!
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1212
3104
edc88b280153 added #exactOn: - for Color-protocol compatibility
Claus Gittinger <cg@exept.de>
parents: 3068
diff changeset
  1213
exactOn:aDevice
3106
d6333a2bd850 more Color-protocol compatibility
Claus Gittinger <cg@exept.de>
parents: 3104
diff changeset
  1214
    "for compatibility with color protocol - here, the same as #onDevice."
d6333a2bd850 more Color-protocol compatibility
Claus Gittinger <cg@exept.de>
parents: 3104
diff changeset
  1215
d6333a2bd850 more Color-protocol compatibility
Claus Gittinger <cg@exept.de>
parents: 3104
diff changeset
  1216
    ^ self onDevice:aDevice
d6333a2bd850 more Color-protocol compatibility
Claus Gittinger <cg@exept.de>
parents: 3104
diff changeset
  1217
d6333a2bd850 more Color-protocol compatibility
Claus Gittinger <cg@exept.de>
parents: 3104
diff changeset
  1218
!
d6333a2bd850 more Color-protocol compatibility
Claus Gittinger <cg@exept.de>
parents: 3104
diff changeset
  1219
d6333a2bd850 more Color-protocol compatibility
Claus Gittinger <cg@exept.de>
parents: 3104
diff changeset
  1220
exactOrNearestOn:aDevice
d6333a2bd850 more Color-protocol compatibility
Claus Gittinger <cg@exept.de>
parents: 3104
diff changeset
  1221
    "for compatibility with color protocol - here, the same as #onDevice."
d6333a2bd850 more Color-protocol compatibility
Claus Gittinger <cg@exept.de>
parents: 3104
diff changeset
  1222
d6333a2bd850 more Color-protocol compatibility
Claus Gittinger <cg@exept.de>
parents: 3104
diff changeset
  1223
    ^ self onDevice:aDevice
d6333a2bd850 more Color-protocol compatibility
Claus Gittinger <cg@exept.de>
parents: 3104
diff changeset
  1224
d6333a2bd850 more Color-protocol compatibility
Claus Gittinger <cg@exept.de>
parents: 3104
diff changeset
  1225
!
d6333a2bd850 more Color-protocol compatibility
Claus Gittinger <cg@exept.de>
parents: 3104
diff changeset
  1226
d6333a2bd850 more Color-protocol compatibility
Claus Gittinger <cg@exept.de>
parents: 3104
diff changeset
  1227
nearestOn:aDevice
d6333a2bd850 more Color-protocol compatibility
Claus Gittinger <cg@exept.de>
parents: 3104
diff changeset
  1228
    "for compatibility with color protocol - here, the same as #onDevice."
3104
edc88b280153 added #exactOn: - for Color-protocol compatibility
Claus Gittinger <cg@exept.de>
parents: 3068
diff changeset
  1229
edc88b280153 added #exactOn: - for Color-protocol compatibility
Claus Gittinger <cg@exept.de>
parents: 3068
diff changeset
  1230
    ^ self onDevice:aDevice
edc88b280153 added #exactOn: - for Color-protocol compatibility
Claus Gittinger <cg@exept.de>
parents: 3068
diff changeset
  1231
edc88b280153 added #exactOn: - for Color-protocol compatibility
Claus Gittinger <cg@exept.de>
parents: 3068
diff changeset
  1232
!
edc88b280153 added #exactOn: - for Color-protocol compatibility
Claus Gittinger <cg@exept.de>
parents: 3068
diff changeset
  1233
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1234
on:aDevice
588
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1235
    "associate the receiver to a device (i.e. download its bits);
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1236
     return a deviceForm (possibly different from the receiver)."
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1237
1741
b84a2f4317e9 warn #on: vs. #onDevice:
Claus Gittinger <cg@exept.de>
parents: 1645
diff changeset
  1238
    "/ send out a warning: #on: is typically used to create views
b84a2f4317e9 warn #on: vs. #onDevice:
Claus Gittinger <cg@exept.de>
parents: 1645
diff changeset
  1239
    "/ operating on a model.
b84a2f4317e9 warn #on: vs. #onDevice:
Claus Gittinger <cg@exept.de>
parents: 1645
diff changeset
  1240
    "/ Please use #onDevice: to avoid confusion.
b84a2f4317e9 warn #on: vs. #onDevice:
Claus Gittinger <cg@exept.de>
parents: 1645
diff changeset
  1241
3431
afd71b27768d Use <resource:#obsolete>
Stefan Vogel <sv@exept.de>
parents: 3339
diff changeset
  1242
    <resource:#obsolete>
afd71b27768d Use <resource:#obsolete>
Stefan Vogel <sv@exept.de>
parents: 3339
diff changeset
  1243
1741
b84a2f4317e9 warn #on: vs. #onDevice:
Claus Gittinger <cg@exept.de>
parents: 1645
diff changeset
  1244
    self obsoleteMethodWarning:'use #onDevice:'.
b84a2f4317e9 warn #on: vs. #onDevice:
Claus Gittinger <cg@exept.de>
parents: 1645
diff changeset
  1245
    ^ self onDevice:aDevice
b84a2f4317e9 warn #on: vs. #onDevice:
Claus Gittinger <cg@exept.de>
parents: 1645
diff changeset
  1246
b84a2f4317e9 warn #on: vs. #onDevice:
Claus Gittinger <cg@exept.de>
parents: 1645
diff changeset
  1247
    "Modified: 5.6.1997 / 21:05:34 / cg"
b84a2f4317e9 warn #on: vs. #onDevice:
Claus Gittinger <cg@exept.de>
parents: 1645
diff changeset
  1248
!
b84a2f4317e9 warn #on: vs. #onDevice:
Claus Gittinger <cg@exept.de>
parents: 1645
diff changeset
  1249
b84a2f4317e9 warn #on: vs. #onDevice:
Claus Gittinger <cg@exept.de>
parents: 1645
diff changeset
  1250
onDevice:aDevice
b84a2f4317e9 warn #on: vs. #onDevice:
Claus Gittinger <cg@exept.de>
parents: 1645
diff changeset
  1251
    "associate the receiver to a device (i.e. download its bits);
b84a2f4317e9 warn #on: vs. #onDevice:
Claus Gittinger <cg@exept.de>
parents: 1645
diff changeset
  1252
     return a deviceForm (possibly different from the receiver)."
b84a2f4317e9 warn #on: vs. #onDevice:
Claus Gittinger <cg@exept.de>
parents: 1645
diff changeset
  1253
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1254
    aDevice == device ifTrue:[
1436
c64b7abfc5fe checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1325
diff changeset
  1255
        ^ self
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1256
    ].
2980
409e9547a45c ignore nil device in #onDevice:
Claus Gittinger <cg@exept.de>
parents: 2964
diff changeset
  1257
    aDevice isNil ifTrue:[^ self].
409e9547a45c ignore nil device in #onDevice:
Claus Gittinger <cg@exept.de>
parents: 2964
diff changeset
  1258
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1259
    "create a new form ..."
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1260
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1261
    data notNil ifTrue:[
2191
7be9c2c6c66f use #onDevice: in #asMono
Claus Gittinger <cg@exept.de>
parents: 2074
diff changeset
  1262
        "/ 'Form [info]: create from data' printCR.
4770
770e19fa6f50 Use Form class>>#width:height:fromArray:onDevice: instead of obsolete
Stefan Vogel <sv@exept.de>
parents: 4768
diff changeset
  1263
        ^ self class width:width height:height fromArray:data onDevice:aDevice
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1264
    ].
7632
18569ff6badb #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 7493
diff changeset
  1265
    Logger warning:'no bit data in #onDevice: - returning a black form'.
4786
0a24601e3f0e Change senders of obsolete messages Form>>...on: to ...onDevice:
Stefan Vogel <sv@exept.de>
parents: 4774
diff changeset
  1266
    ^ (self class width:width height:height onDevice:aDevice) clear
588
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1267
2191
7be9c2c6c66f use #onDevice: in #asMono
Claus Gittinger <cg@exept.de>
parents: 2074
diff changeset
  1268
    "Modified: / 27.7.1998 / 20:05:20 / cg"
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1269
! !
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1270
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1271
!Form methodsFor:'image manipulations'!
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1272
3655
1521a53dba17 +clearMaskedPixels
Claus Gittinger <cg@exept.de>
parents: 3624
diff changeset
  1273
clearMaskedPixels
1521a53dba17 +clearMaskedPixels
Claus Gittinger <cg@exept.de>
parents: 3624
diff changeset
  1274
    "Added for protocol compatibility with Image."
1521a53dba17 +clearMaskedPixels
Claus Gittinger <cg@exept.de>
parents: 3624
diff changeset
  1275
1521a53dba17 +clearMaskedPixels
Claus Gittinger <cg@exept.de>
parents: 3624
diff changeset
  1276
    ^ self
1521a53dba17 +clearMaskedPixels
Claus Gittinger <cg@exept.de>
parents: 3624
diff changeset
  1277
!
1521a53dba17 +clearMaskedPixels
Claus Gittinger <cg@exept.de>
parents: 3624
diff changeset
  1278
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1279
clearMaskedPixels:maskForm
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1280
    "clear any masked pixels.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1281
     This will allow faster drawing in the future."
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1282
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1283
    "black is 0 in mask - masked bits are 0"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1284
    gc
7493
59db55fd753a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7446
diff changeset
  1285
        foreground:Color allColor background:Color noColor;
59db55fd753a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7446
diff changeset
  1286
        function:#and;
59db55fd753a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7446
diff changeset
  1287
        copyPlaneFrom:maskForm graphicsContext x:0 y:0 toX:0 y:0 width:width height:height.
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1288
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1289
    maskedPixelsAre0 := true.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1290
!
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1291
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1292
darkened
588
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1293
    "return a darkened version of the receiver.
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1294
     Added for protocol compatibility with Color and Image.
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1295
     Here, the receiver is returned as a kludge
588
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1296
     - actually should return a darkened image (or Color black ?) .."
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1297
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1298
    ^ self
588
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1299
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1300
    "Modified: 23.4.1996 / 10:19:52 / cg"
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1301
!
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1302
3334
952a3553df45 st80 bitblt
martin
parents: 3300
diff changeset
  1303
easyMagnifiedBy:extent into: newForm
952a3553df45 st80 bitblt
martin
parents: 3300
diff changeset
  1304
    "return a new form magnified by extent, aPoint.
952a3553df45 st80 bitblt
martin
parents: 3300
diff changeset
  1305
     If non-integral magnify is asked for, pass the work on to 'hardMagnifiedBy:'"
952a3553df45 st80 bitblt
martin
parents: 3300
diff changeset
  1306
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1307
    |mX mY dstX dstY ext
3334
952a3553df45 st80 bitblt
martin
parents: 3300
diff changeset
  1308
     factor "{ Class: SmallInteger }"
952a3553df45 st80 bitblt
martin
parents: 3300
diff changeset
  1309
     n      "{ Class: SmallInteger }" |
952a3553df45 st80 bitblt
martin
parents: 3300
diff changeset
  1310
952a3553df45 st80 bitblt
martin
parents: 3300
diff changeset
  1311
    ext := extent asPoint.
952a3553df45 st80 bitblt
martin
parents: 3300
diff changeset
  1312
    mX := ext x.
952a3553df45 st80 bitblt
martin
parents: 3300
diff changeset
  1313
    mY := ext y.
952a3553df45 st80 bitblt
martin
parents: 3300
diff changeset
  1314
    ((mX = 1) and:[mY = 1]) ifTrue:[^ self].
952a3553df45 st80 bitblt
martin
parents: 3300
diff changeset
  1315
952a3553df45 st80 bitblt
martin
parents: 3300
diff changeset
  1316
    "expand rows"
952a3553df45 st80 bitblt
martin
parents: 3300
diff changeset
  1317
    (mY > 1) ifTrue:[
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1318
	dstY := 0.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1319
	n := height.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1320
	factor := mY.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1321
	0 to:(n - 1) do:[:srcY |
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1322
	    1 to:factor do:[:i |
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1323
		newForm copyFrom:self
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1324
			       x:0 y:srcY
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1325
			     toX:0 y:dstY
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1326
			   width:width height:1.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1327
		dstY := dstY + 1
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1328
	    ]
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1329
	]
3334
952a3553df45 st80 bitblt
martin
parents: 3300
diff changeset
  1330
    ].
952a3553df45 st80 bitblt
martin
parents: 3300
diff changeset
  1331
952a3553df45 st80 bitblt
martin
parents: 3300
diff changeset
  1332
    "expand cols"
952a3553df45 st80 bitblt
martin
parents: 3300
diff changeset
  1333
    (mX > 1) ifTrue:[
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1334
	n := width.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1335
	factor := mX.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1336
	dstX := (n * factor) - 1.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1337
	(n - 1) to:0 by:-1 do:[:srcX |
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1338
	    1 to:factor do:[:i |
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1339
		newForm copyFrom:newForm
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1340
			       x:srcX y:0
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1341
			     toX:dstX y:0
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1342
			   width:1 height:(height * mY).
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1343
		dstX := dstX - 1
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1344
	    ]
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1345
	]
3334
952a3553df45 st80 bitblt
martin
parents: 3300
diff changeset
  1346
    ].
952a3553df45 st80 bitblt
martin
parents: 3300
diff changeset
  1347
    ^ newForm
952a3553df45 st80 bitblt
martin
parents: 3300
diff changeset
  1348
952a3553df45 st80 bitblt
martin
parents: 3300
diff changeset
  1349
    "
952a3553df45 st80 bitblt
martin
parents: 3300
diff changeset
  1350
     (ArrowButton upArrowButtonForm:#iris on:Display) magnifiedBy:(2 @ 2)
952a3553df45 st80 bitblt
martin
parents: 3300
diff changeset
  1351
     (Form fromFile:'bitmaps/SBrowser.xbm') magnifiedBy:(2 @ 2)
952a3553df45 st80 bitblt
martin
parents: 3300
diff changeset
  1352
     (Form fromFile:'bitmaps/SBrowser.xbm') magnifiedBy:(0.4 @ 0.4)
952a3553df45 st80 bitblt
martin
parents: 3300
diff changeset
  1353
    "
952a3553df45 st80 bitblt
martin
parents: 3300
diff changeset
  1354
!
952a3553df45 st80 bitblt
martin
parents: 3300
diff changeset
  1355
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1356
flipHorizontal
4206
4d3273b10f37 flip fixed
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  1357
    "return a new form flipped vertically"
4d3273b10f37 flip fixed
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  1358
4d3273b10f37 flip fixed
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  1359
    |dstX newForm |
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1360
3624
7996877d60fb Do not use obsolete methods.
Stefan Vogel <sv@exept.de>
parents: 3611
diff changeset
  1361
    newForm := (self class onDevice:device)
2827
4f30d3aa96e5 #on: -> #onDevice:
Claus Gittinger <cg@exept.de>
parents: 2823
diff changeset
  1362
                                width:width
4f30d3aa96e5 #on: -> #onDevice:
Claus Gittinger <cg@exept.de>
parents: 2823
diff changeset
  1363
                                height:height
4f30d3aa96e5 #on: -> #onDevice:
Claus Gittinger <cg@exept.de>
parents: 2823
diff changeset
  1364
                                depth:depth.
4206
4d3273b10f37 flip fixed
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  1365
    dstX := width - 1.
4d3273b10f37 flip fixed
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  1366
    0 to:dstX do:[:srcX |
4d3273b10f37 flip fixed
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  1367
        newForm copyFrom:self
4d3273b10f37 flip fixed
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  1368
                       x:srcX y:0
4d3273b10f37 flip fixed
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  1369
                     toX:dstX y:0
4d3273b10f37 flip fixed
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  1370
                   width:1 height:height.
4d3273b10f37 flip fixed
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  1371
        dstX := dstX - 1
4d3273b10f37 flip fixed
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  1372
    ].
4d3273b10f37 flip fixed
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  1373
    newForm colorMap:localColorMap.
4d3273b10f37 flip fixed
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  1374
    ^ newForm
4d3273b10f37 flip fixed
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  1375
4d3273b10f37 flip fixed
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  1376
    "
4d3273b10f37 flip fixed
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  1377
     |testForm|
4d3273b10f37 flip fixed
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  1378
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1379
     testForm _ Form
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1380
                    extent: 8@8
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1381
                    depth: 1
4206
4d3273b10f37 flip fixed
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  1382
                    fromArray:
4d3273b10f37 flip fixed
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  1383
                     #( 2r10000000
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1384
                        2r11000000
4206
4d3273b10f37 flip fixed
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  1385
                        2r11100000
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1386
                        2r11110000
4206
4d3273b10f37 flip fixed
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  1387
                        2r11111000
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1388
                        2r11111100
4206
4d3273b10f37 flip fixed
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  1389
                        2r11111110
4d3273b10f37 flip fixed
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  1390
                        2r11111111)
4d3273b10f37 flip fixed
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  1391
                    offset: 0@0.
4d3273b10f37 flip fixed
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  1392
     testForm inspect.
4d3273b10f37 flip fixed
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  1393
     testForm flipVertical inspect.
4d3273b10f37 flip fixed
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  1394
     testForm flipHorizontal inspect.
4d3273b10f37 flip fixed
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  1395
    "
4d3273b10f37 flip fixed
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  1396
!
4d3273b10f37 flip fixed
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  1397
4d3273b10f37 flip fixed
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  1398
flipVertical
4d3273b10f37 flip fixed
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  1399
    "return a new form flipped horizontally"
4d3273b10f37 flip fixed
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  1400
4d3273b10f37 flip fixed
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  1401
    |dstY newForm |
4d3273b10f37 flip fixed
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  1402
4d3273b10f37 flip fixed
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  1403
    newForm := (self class onDevice:device)
4d3273b10f37 flip fixed
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  1404
                                width:width
4d3273b10f37 flip fixed
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  1405
                                height:height
4d3273b10f37 flip fixed
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  1406
                                depth:depth.
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1407
    dstY := height - 1.
4206
4d3273b10f37 flip fixed
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  1408
    0 to:dstY do:[:srcY |
2827
4f30d3aa96e5 #on: -> #onDevice:
Claus Gittinger <cg@exept.de>
parents: 2823
diff changeset
  1409
        newForm copyFrom:self
4f30d3aa96e5 #on: -> #onDevice:
Claus Gittinger <cg@exept.de>
parents: 2823
diff changeset
  1410
                       x:0 y:srcY
4f30d3aa96e5 #on: -> #onDevice:
Claus Gittinger <cg@exept.de>
parents: 2823
diff changeset
  1411
                     toX:0 y:dstY
4f30d3aa96e5 #on: -> #onDevice:
Claus Gittinger <cg@exept.de>
parents: 2823
diff changeset
  1412
                   width:width height:1.
4f30d3aa96e5 #on: -> #onDevice:
Claus Gittinger <cg@exept.de>
parents: 2823
diff changeset
  1413
        dstY := dstY - 1
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1414
    ].
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1415
    newForm colorMap:localColorMap.
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1416
    ^ newForm
4206
4d3273b10f37 flip fixed
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  1417
4d3273b10f37 flip fixed
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  1418
    "
4d3273b10f37 flip fixed
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  1419
     |testForm|
4d3273b10f37 flip fixed
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  1420
4d3273b10f37 flip fixed
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  1421
     testForm _ Form 
4d3273b10f37 flip fixed
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  1422
                    extent: 8@8 
4d3273b10f37 flip fixed
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  1423
                    depth: 1 
4d3273b10f37 flip fixed
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  1424
                    fromArray:
4d3273b10f37 flip fixed
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  1425
                     #( 2r10000000
4d3273b10f37 flip fixed
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  1426
                        2r11000000 
4d3273b10f37 flip fixed
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  1427
                        2r11100000
4d3273b10f37 flip fixed
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  1428
                        2r11110000 
4d3273b10f37 flip fixed
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  1429
                        2r11111000
4d3273b10f37 flip fixed
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  1430
                        2r11111100 
4d3273b10f37 flip fixed
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  1431
                        2r11111110
4d3273b10f37 flip fixed
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  1432
                        2r11111111)
4d3273b10f37 flip fixed
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  1433
                    offset: 0@0.
4d3273b10f37 flip fixed
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  1434
     testForm inspect.
4d3273b10f37 flip fixed
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  1435
     testForm flipVertical inspect.
4d3273b10f37 flip fixed
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  1436
     testForm flipHorizontal inspect.
4d3273b10f37 flip fixed
Claus Gittinger <cg@exept.de>
parents: 4173
diff changeset
  1437
    "
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1438
!
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1439
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1440
hardMagnifiedBy:extent
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1441
    "return a new form magnified by extent, aPoint.
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1442
     This method handles non-integral factors."
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1443
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1444
    "
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1445
     since Form will be replaced by Image in the long run,
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1446
     and this operation is slow anyway, use the implementation
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1447
     in Image for this."
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1448
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1449
    ^ ((Image fromForm:self) magnifiedBy:extent) asFormOn:device.
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1450
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1451
    "
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1452
     (Form fromFile:'OutputOn.64') magnifiedBy:0.5@0.5
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1453
     (Form fromFile:'OutputOn.64') magnifiedBy:1.5@1.5
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1454
    "
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1455
!
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1456
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1457
lightened
588
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1458
    "return a lightened version of the receiver.
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1459
     Added for protocol compatibility with Color and Image.
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1460
     Here, the receiver is returned as a kludge
588
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1461
     - actually should return a lightened image (or Color white ?) .."
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1462
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1463
    ^ self
588
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1464
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1465
    "Modified: 23.4.1996 / 10:20:14 / cg"
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1466
!
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1467
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1468
magnifiedBy:extent
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1469
    "return a new form magnified by extent, aPoint.
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1470
     If non-integral magnify is asked for, pass the work on to 'hardMagnifiedBy:'"
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1471
3624
7996877d60fb Do not use obsolete methods.
Stefan Vogel <sv@exept.de>
parents: 3611
diff changeset
  1472
    |mX mY newForm ext|
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1473
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1474
    ext := extent asPoint.
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1475
    mX := ext x.
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1476
    mY := ext y.
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1477
    ((mX = 1) and:[mY = 1]) ifTrue:[^ self].
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1478
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1479
    ((mX isMemberOf:SmallInteger) and:[mY isMemberOf:SmallInteger]) ifFalse:[
2827
4f30d3aa96e5 #on: -> #onDevice:
Claus Gittinger <cg@exept.de>
parents: 2823
diff changeset
  1480
        ^ self hardMagnifiedBy:ext
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1481
    ].
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1482
3624
7996877d60fb Do not use obsolete methods.
Stefan Vogel <sv@exept.de>
parents: 3611
diff changeset
  1483
    newForm := (self class onDevice:device)
2827
4f30d3aa96e5 #on: -> #onDevice:
Claus Gittinger <cg@exept.de>
parents: 2823
diff changeset
  1484
                                width:(width * mX)
4f30d3aa96e5 #on: -> #onDevice:
Claus Gittinger <cg@exept.de>
parents: 2823
diff changeset
  1485
                                height:(height * mY)
4f30d3aa96e5 #on: -> #onDevice:
Claus Gittinger <cg@exept.de>
parents: 2823
diff changeset
  1486
                                depth:depth.
3334
952a3553df45 st80 bitblt
martin
parents: 3300
diff changeset
  1487
    self easyMagnifiedBy:extent into:newForm.
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1488
    newForm colorMap:localColorMap.
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1489
    ^ newForm
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1490
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1491
    "
3624
7996877d60fb Do not use obsolete methods.
Stefan Vogel <sv@exept.de>
parents: 3611
diff changeset
  1492
     (ArrowButton upArrowButtonForm:#iris on:Screen current) magnifiedBy:(2 @ 2)
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1493
     (Form fromFile:'bitmaps/SBrowser.xbm') magnifiedBy:(2 @ 2)
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1494
     (Form fromFile:'bitmaps/SBrowser.xbm') magnifiedBy:(0.4 @ 0.4)
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1495
    "
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1496
!
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1497
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1498
magnifiedTo:anExtent
569
7dee80bce37b added #magnifiedTo: (protocol compatibility with Image)
Claus Gittinger <cg@exept.de>
parents: 425
diff changeset
  1499
    "return a new form magnified to have the size specified by extent.
7dee80bce37b added #magnifiedTo: (protocol compatibility with Image)
Claus Gittinger <cg@exept.de>
parents: 425
diff changeset
  1500
     This may distort the image if the arguments ratio is not the images ratio.
7dee80bce37b added #magnifiedTo: (protocol compatibility with Image)
Claus Gittinger <cg@exept.de>
parents: 425
diff changeset
  1501
     See also #magnifiedPreservingRatioTo: and #magnifiedBy:"
7dee80bce37b added #magnifiedTo: (protocol compatibility with Image)
Claus Gittinger <cg@exept.de>
parents: 425
diff changeset
  1502
7dee80bce37b added #magnifiedTo: (protocol compatibility with Image)
Claus Gittinger <cg@exept.de>
parents: 425
diff changeset
  1503
    ^ self magnifiedBy:(anExtent / self extent)
7dee80bce37b added #magnifiedTo: (protocol compatibility with Image)
Claus Gittinger <cg@exept.de>
parents: 425
diff changeset
  1504
7dee80bce37b added #magnifiedTo: (protocol compatibility with Image)
Claus Gittinger <cg@exept.de>
parents: 425
diff changeset
  1505
    "Created: 18.4.1996 / 16:17:52 / cg"
7dee80bce37b added #magnifiedTo: (protocol compatibility with Image)
Claus Gittinger <cg@exept.de>
parents: 425
diff changeset
  1506
!
7dee80bce37b added #magnifiedTo: (protocol compatibility with Image)
Claus Gittinger <cg@exept.de>
parents: 425
diff changeset
  1507
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1508
magnifyBy:scale
5213
638447e61970 Mark obsolete methods
Stefan Vogel <sv@exept.de>
parents: 4938
diff changeset
  1509
    <resource: #obsolete>
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1510
    "obsolete: has been renamed to magnifiedBy: for ST-80 compatibility
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1511
     and name consistency ..."
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1512
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1513
    self obsoleteMethodWarning.
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1514
    ^ self magnifiedBy:scale
0
48194c26a46c Initial revision
claus
parents:
diff changeset
  1515
! !
48194c26a46c Initial revision
claus
parents:
diff changeset
  1516
48194c26a46c Initial revision
claus
parents:
diff changeset
  1517
!Form methodsFor:'initialization'!
48194c26a46c Initial revision
claus
parents:
diff changeset
  1518
48194c26a46c Initial revision
claus
parents:
diff changeset
  1519
initGC
48194c26a46c Initial revision
claus
parents:
diff changeset
  1520
    "stop server from sending exposure events for Forms -
48194c26a46c Initial revision
claus
parents:
diff changeset
  1521
     (will fill up stream-queue on some stupid (i.e. sco) systems"
48194c26a46c Initial revision
claus
parents:
diff changeset
  1522
7751
b264b5ca7e35 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7636
diff changeset
  1523
    |gcId|
b264b5ca7e35 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7636
diff changeset
  1524
951
ebedf8da0e89 initGC stuff fixed
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  1525
    "/ depth-1 forms draw differently ...
ebedf8da0e89 initGC stuff fixed
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  1526
    depth == 1 ifTrue:[
7751
b264b5ca7e35 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7636
diff changeset
  1527
        |fg bg|
b264b5ca7e35 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7636
diff changeset
  1528
        self foreground isNil ifTrue:[
b264b5ca7e35 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7636
diff changeset
  1529
            fg := Color colorId:1.
b264b5ca7e35 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7636
diff changeset
  1530
        ].
b264b5ca7e35 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7636
diff changeset
  1531
        self background isNil ifTrue:[
b264b5ca7e35 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7636
diff changeset
  1532
            bg := Color colorId:0
b264b5ca7e35 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7636
diff changeset
  1533
        ].
b264b5ca7e35 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7636
diff changeset
  1534
        "nil colors will not be set"
b264b5ca7e35 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7636
diff changeset
  1535
        self setPaint:fg on:bg.
951
ebedf8da0e89 initGC stuff fixed
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  1536
    ].
7751
b264b5ca7e35 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7636
diff changeset
  1537
    gcId := super initGC.
b264b5ca7e35 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7636
diff changeset
  1538
    self setGraphicsExposures:false.
b264b5ca7e35 #REFACTORING by stefan
Stefan Vogel <sv@exept.de>
parents: 7636
diff changeset
  1539
    ^ gcId.
836
d6eb406b1c04 dither bitmaps moved to Color
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
  1540
951
ebedf8da0e89 initGC stuff fixed
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  1541
    "Modified: 17.7.1996 / 13:21:24 / cg"
0
48194c26a46c Initial revision
claus
parents:
diff changeset
  1542
!
48194c26a46c Initial revision
claus
parents:
diff changeset
  1543
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1544
initialize
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1545
    depth := 1.
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1546
    maskedPixelsAre0 := false.
7315
aed1314a2448 Issue #82: UIPainterView does not understand: #deviceClippingRectangle
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 7287
diff changeset
  1547
    gc notNil ifTrue:[ 
aed1314a2448 Issue #82: UIPainterView does not understand: #deviceClippingRectangle
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 7287
diff changeset
  1548
        gc paint: (Color colorId:1).
aed1314a2448 Issue #82: UIPainterView does not understand: #deviceClippingRectangle
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 7287
diff changeset
  1549
        gc backgroundPaint:(Color colorId:0).      
aed1314a2448 Issue #82: UIPainterView does not understand: #deviceClippingRectangle
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 7287
diff changeset
  1550
    ].
6232
3dcb1d72eac1 class: Form
Stefan Vogel <sv@exept.de>
parents: 6230
diff changeset
  1551
    super initialize.
836
d6eb406b1c04 dither bitmaps moved to Color
Claus Gittinger <cg@exept.de>
parents: 789
diff changeset
  1552
7315
aed1314a2448 Issue #82: UIPainterView does not understand: #deviceClippingRectangle
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 7287
diff changeset
  1553
    "Modified: / 25-04-2016 / 20:19:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1554
!
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1555
0
48194c26a46c Initial revision
claus
parents:
diff changeset
  1556
recreate
3300
d7b046ccbb33 comment
Claus Gittinger <cg@exept.de>
parents: 3192
diff changeset
  1557
    "reconstruct the form after a snapin or a migration"
0
48194c26a46c Initial revision
claus
parents:
diff changeset
  1558
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1559
    device isNil ifTrue:[^ self].
2473
2d4b51e6eb48 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2456
diff changeset
  1560
0
48194c26a46c Initial revision
claus
parents:
diff changeset
  1561
    data notNil ifTrue:[
2473
2d4b51e6eb48 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2456
diff changeset
  1562
        "
2d4b51e6eb48 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2456
diff changeset
  1563
         create one from data
2d4b51e6eb48 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2456
diff changeset
  1564
        "
2d4b51e6eb48 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2456
diff changeset
  1565
        (depth == 1 or:[depth == device depth]) ifTrue:[
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1566
            gc createBitmapFromArray:data width:width height:height.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1567
            gc drawableId notNil ifTrue:[
2473
2d4b51e6eb48 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2456
diff changeset
  1568
                ^ self
2d4b51e6eb48 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2456
diff changeset
  1569
            ]
2d4b51e6eb48 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2456
diff changeset
  1570
        ].
2d4b51e6eb48 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2456
diff changeset
  1571
        'FORM: cannot recreate form' errorPrintCR.
0
48194c26a46c Initial revision
claus
parents:
diff changeset
  1572
    ].
871
c078c33c51ac recreate was somehow corrupted ?!
Claus Gittinger <cg@exept.de>
parents: 870
diff changeset
  1573
c078c33c51ac recreate was somehow corrupted ?!
Claus Gittinger <cg@exept.de>
parents: 870
diff changeset
  1574
    ^ self.
c078c33c51ac recreate was somehow corrupted ?!
Claus Gittinger <cg@exept.de>
parents: 870
diff changeset
  1575
3474
2043444bdc24 statements after return
Claus Gittinger <cg@exept.de>
parents: 3452
diff changeset
  1576
"/    "
2043444bdc24 statements after return
Claus Gittinger <cg@exept.de>
parents: 3452
diff changeset
  1577
"/     create an empty one
2043444bdc24 statements after return
Claus Gittinger <cg@exept.de>
parents: 3452
diff changeset
  1578
"/    "
2043444bdc24 statements after return
Claus Gittinger <cg@exept.de>
parents: 3452
diff changeset
  1579
"/    depth == 1 ifTrue:[
2043444bdc24 statements after return
Claus Gittinger <cg@exept.de>
parents: 3452
diff changeset
  1580
"/        drawableId := device createBitmapWidth:width height:height
2043444bdc24 statements after return
Claus Gittinger <cg@exept.de>
parents: 3452
diff changeset
  1581
"/    ] ifFalse:[
2043444bdc24 statements after return
Claus Gittinger <cg@exept.de>
parents: 3452
diff changeset
  1582
"/        drawableId := device createPixmapWidth:width height:height depth:device depth
2043444bdc24 statements after return
Claus Gittinger <cg@exept.de>
parents: 3452
diff changeset
  1583
"/    ].
871
c078c33c51ac recreate was somehow corrupted ?!
Claus Gittinger <cg@exept.de>
parents: 870
diff changeset
  1584
c078c33c51ac recreate was somehow corrupted ?!
Claus Gittinger <cg@exept.de>
parents: 870
diff changeset
  1585
    "Modified: 15.6.1996 / 16:18:12 / cg"
4217
7786f64f5926 New: #releaseFromDevice
Stefan Vogel <sv@exept.de>
parents: 4206
diff changeset
  1586
!
7786f64f5926 New: #releaseFromDevice
Stefan Vogel <sv@exept.de>
parents: 4206
diff changeset
  1587
7786f64f5926 New: #releaseFromDevice
Stefan Vogel <sv@exept.de>
parents: 4206
diff changeset
  1588
releaseFromDevice
7786f64f5926 New: #releaseFromDevice
Stefan Vogel <sv@exept.de>
parents: 4206
diff changeset
  1589
    "flush device data.
7786f64f5926 New: #releaseFromDevice
Stefan Vogel <sv@exept.de>
parents: 4206
diff changeset
  1590
     The sender has to take care that the Form has been
7786f64f5926 New: #releaseFromDevice
Stefan Vogel <sv@exept.de>
parents: 4206
diff changeset
  1591
     unregistered from (Finalization-)Lobby"
7786f64f5926 New: #releaseFromDevice
Stefan Vogel <sv@exept.de>
parents: 4206
diff changeset
  1592
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1593
    self setDevice:nil id:nil gcId:nil
2
b35336ab0de3 *** empty log message ***
claus
parents: 0
diff changeset
  1594
! !
b35336ab0de3 *** empty log message ***
claus
parents: 0
diff changeset
  1595
b35336ab0de3 *** empty log message ***
claus
parents: 0
diff changeset
  1596
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1597
!Form methodsFor:'printing & storing'!
107
ef48048a8b34 *** empty log message ***
claus
parents: 99
diff changeset
  1598
7493
59db55fd753a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7446
diff changeset
  1599
displayOn:aStreamOrGC
59db55fd753a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7446
diff changeset
  1600
    super displayOn:aStreamOrGC.
59db55fd753a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7446
diff changeset
  1601
    aStreamOrGC isStream ifTrue:[
59db55fd753a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7446
diff changeset
  1602
        aStreamOrGC nextPutAll:' (depth='.
59db55fd753a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7446
diff changeset
  1603
        depth printOn:aStreamOrGC.
59db55fd753a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7446
diff changeset
  1604
        aStreamOrGC nextPut:$).
59db55fd753a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7446
diff changeset
  1605
    ].
59db55fd753a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7446
diff changeset
  1606
!
59db55fd753a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7446
diff changeset
  1607
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1608
storeOn:aStream
588
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1609
    "append an ascii representation of the receiver to aStream,
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1610
     from which a copy of the receiver can be reconstructed"
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1611
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1612
    aStream nextPutAll:'(Form width:'.
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1613
    width storeOn:aStream.
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1614
    aStream nextPutAll:' height:'.
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1615
    height storeOn:aStream.
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1616
    aStream nextPutAll:' fromArray:('.
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1617
    self bits storeOn:aStream.
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1618
    aStream nextPutAll:'))'
588
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1619
8aee1c8800c9 commentary
Claus Gittinger <cg@exept.de>
parents: 569
diff changeset
  1620
    "Modified: 23.4.1996 / 10:21:10 / cg"
107
ef48048a8b34 *** empty log message ***
claus
parents: 99
diff changeset
  1621
! !
ef48048a8b34 *** empty log message ***
claus
parents: 99
diff changeset
  1622
0
48194c26a46c Initial revision
claus
parents:
diff changeset
  1623
!Form methodsFor:'private'!
48194c26a46c Initial revision
claus
parents:
diff changeset
  1624
412
766ba454c23d keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  1625
beImmediateForm
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1626
    "read the pixels from the device into a local data array.
412
766ba454c23d keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  1627
     To make the image smaller (i.e. not keep all those bitmaps),
766ba454c23d keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  1628
     this is NOT done by default."
766ba454c23d keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  1629
766ba454c23d keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  1630
    data isNil ifTrue:[
1138
4a2b3b407cae need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
  1631
	data := self bits.
412
766ba454c23d keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  1632
    ]
766ba454c23d keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  1633
766ba454c23d keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  1634
    "
766ba454c23d keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  1635
     Form allInstances:[:f |
1138
4a2b3b407cae need separate createGC method for bitmaps (for WIN)
Claus Gittinger <cg@exept.de>
parents: 1058
diff changeset
  1636
	f beImmediateForm
412
766ba454c23d keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  1637
     ]
766ba454c23d keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  1638
    "
766ba454c23d keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  1639
766ba454c23d keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  1640
    "Created: 7.2.1996 / 16:04:18 / cg"
766ba454c23d keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  1641
!
766ba454c23d keep the relative fileName; added #beImmediateForm to avoid problems if bitmap files are not present at startup
Claus Gittinger <cg@exept.de>
parents: 398
diff changeset
  1642
870
2b7db80e7ad1 oops - restart mechanism got corrupted
Claus Gittinger <cg@exept.de>
parents: 836
diff changeset
  1643
flushDeviceHandles
2b7db80e7ad1 oops - restart mechanism got corrupted
Claus Gittinger <cg@exept.de>
parents: 836
diff changeset
  1644
    "flush device handles (sent after a restart)"
2b7db80e7ad1 oops - restart mechanism got corrupted
Claus Gittinger <cg@exept.de>
parents: 836
diff changeset
  1645
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1646
    self setDevice:device id:nil gcId:nil.
6935
0de17e2f06f6 *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 6533
diff changeset
  1647
    gc notNil ifTrue:[
0de17e2f06f6 *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 6533
diff changeset
  1648
        gc registerChange.
0de17e2f06f6 *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 6533
diff changeset
  1649
    ].
870
2b7db80e7ad1 oops - restart mechanism got corrupted
Claus Gittinger <cg@exept.de>
parents: 836
diff changeset
  1650
2b7db80e7ad1 oops - restart mechanism got corrupted
Claus Gittinger <cg@exept.de>
parents: 836
diff changeset
  1651
    "Created: 15.6.1996 / 15:44:28 / cg"
2b7db80e7ad1 oops - restart mechanism got corrupted
Claus Gittinger <cg@exept.de>
parents: 836
diff changeset
  1652
!
2b7db80e7ad1 oops - restart mechanism got corrupted
Claus Gittinger <cg@exept.de>
parents: 836
diff changeset
  1653
54
29a6b2f8e042 *** empty log message ***
claus
parents: 46
diff changeset
  1654
getBits
29a6b2f8e042 *** empty log message ***
claus
parents: 46
diff changeset
  1655
    "if the receiver was not created from a file, or
29a6b2f8e042 *** empty log message ***
claus
parents: 46
diff changeset
  1656
     an array (i.e. it was drawn), read the pixels from the
29a6b2f8e042 *** empty log message ***
claus
parents: 46
diff changeset
  1657
     device into a local data array. This has to be done before
29a6b2f8e042 *** empty log message ***
claus
parents: 46
diff changeset
  1658
     an image is saved, or the receiver is storedBinary, since
29a6b2f8e042 *** empty log message ***
claus
parents: 46
diff changeset
  1659
     the information present in the device is lost after restart/reload"
29a6b2f8e042 *** empty log message ***
claus
parents: 46
diff changeset
  1660
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1661
    data isNil ifTrue:[
78
1c9c22df3251 *** empty log message ***
claus
parents: 71
diff changeset
  1662
	data := self bits
54
29a6b2f8e042 *** empty log message ***
claus
parents: 46
diff changeset
  1663
    ]
29a6b2f8e042 *** empty log message ***
claus
parents: 46
diff changeset
  1664
!
29a6b2f8e042 *** empty log message ***
claus
parents: 46
diff changeset
  1665
1058
103860173cb2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 951
diff changeset
  1666
restored
103860173cb2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 951
diff changeset
  1667
    "flush device data, when restored (sent after a binaryLoad)"
103860173cb2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 951
diff changeset
  1668
103860173cb2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 951
diff changeset
  1669
    self release
103860173cb2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 951
diff changeset
  1670
103860173cb2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 951
diff changeset
  1671
    "Modified: 16.9.1996 / 21:08:57 / cg"
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1672
!
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1673
0
48194c26a46c Initial revision
claus
parents:
diff changeset
  1674
width:w height:h
54
29a6b2f8e042 *** empty log message ***
claus
parents: 46
diff changeset
  1675
    "actual create of a monochrome form"
0
48194c26a46c Initial revision
claus
parents:
diff changeset
  1676
6227
72c2836e3151 class: Form
Stefan Vogel <sv@exept.de>
parents: 6143
diff changeset
  1677
    ^ self width:w height:h depth:1.
0
48194c26a46c Initial revision
claus
parents:
diff changeset
  1678
!
48194c26a46c Initial revision
claus
parents:
diff changeset
  1679
48194c26a46c Initial revision
claus
parents:
diff changeset
  1680
width:w height:h depth:d
7355
b54b8aebbb90 #FEATURE by sr
sr
parents: 7354
diff changeset
  1681
    "actual create of an arbitrary deep form (but, must be supported by device).
b54b8aebbb90 #FEATURE by sr
sr
parents: 7354
diff changeset
  1682
     Return nil (after raising a notification) if the allocation failed"
0
48194c26a46c Initial revision
claus
parents:
diff changeset
  1683
6227
72c2836e3151 class: Form
Stefan Vogel <sv@exept.de>
parents: 6143
diff changeset
  1684
    ((w == 0) or:[h == 0]) ifTrue:[
7427
90bf8cf72b75 #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
  1685
        self error:'invalid form extent'.
6227
72c2836e3151 class: Form
Stefan Vogel <sv@exept.de>
parents: 6143
diff changeset
  1686
    ].
0
48194c26a46c Initial revision
claus
parents:
diff changeset
  1687
    width := w.
48194c26a46c Initial revision
claus
parents:
diff changeset
  1688
    height := h.
48194c26a46c Initial revision
claus
parents:
diff changeset
  1689
    offset := 0@0.
48194c26a46c Initial revision
claus
parents:
diff changeset
  1690
    depth := d.
6227
72c2836e3151 class: Form
Stefan Vogel <sv@exept.de>
parents: 6143
diff changeset
  1691
    depth == 1 ifTrue:[
7427
90bf8cf72b75 #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
  1692
        localColorMap isNil ifTrue:[
90bf8cf72b75 #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
  1693
            BlackAndWhiteColorMap isNil ifTrue:[
90bf8cf72b75 #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
  1694
                BlackAndWhiteColorMap := Array with:(Color white) with:(Color black)
90bf8cf72b75 #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
  1695
            ].
90bf8cf72b75 #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
  1696
            localColorMap := BlackAndWhiteColorMap.
90bf8cf72b75 #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
  1697
        ].
6227
72c2836e3151 class: Form
Stefan Vogel <sv@exept.de>
parents: 6143
diff changeset
  1698
    ].
7260
5b9f9cbd2435 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 7238
diff changeset
  1699
    device notNil ifTrue:[
7427
90bf8cf72b75 #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7416
diff changeset
  1700
        (gc createPixmapWidth:w height:h depth:d) isNil ifTrue:[^nil].
7365
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 7315 7355
diff changeset
  1701
        realized := self drawableId notNil.
3067
908e910e6c94 allow forms to be created without a device.
Claus Gittinger <cg@exept.de>
parents: 3025
diff changeset
  1702
    ].
0
48194c26a46c Initial revision
claus
parents:
diff changeset
  1703
!
48194c26a46c Initial revision
claus
parents:
diff changeset
  1704
2773
8aefa2576a50 a few more smallInteger type hints
Claus Gittinger <cg@exept.de>
parents: 2473
diff changeset
  1705
width:wIn height:hIn fromArray:anArray
54
29a6b2f8e042 *** empty log message ***
claus
parents: 46
diff changeset
  1706
    "actual create of a monochrome form from array.
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1707
     This method is somewhat more complicated as it should be due to
0
48194c26a46c Initial revision
claus
parents:
diff changeset
  1708
     supporting both byte-wise (ST/X-type) and short-word-wise (ST-80-type)
48194c26a46c Initial revision
claus
parents:
diff changeset
  1709
     Arrays; in the later case, the shorts are first converted to bytes in
48194c26a46c Initial revision
claus
parents:
diff changeset
  1710
     a ByteArray, then passed to the device."
48194c26a46c Initial revision
claus
parents:
diff changeset
  1711
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1712
    |bytes bits
134
claus
parents: 133
diff changeset
  1713
     srcPerRow "{ Class: SmallInteger }"
claus
parents: 133
diff changeset
  1714
     dstPerRow "{ Class: SmallInteger }"
claus
parents: 133
diff changeset
  1715
     srcStart  "{ Class: SmallInteger }"
claus
parents: 133
diff changeset
  1716
     srcIndex  "{ Class: SmallInteger }"
claus
parents: 133
diff changeset
  1717
     dstIndex  "{ Class: SmallInteger }"
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1718
     w         "{ Class: SmallInteger }"
2773
8aefa2576a50 a few more smallInteger type hints
Claus Gittinger <cg@exept.de>
parents: 2473
diff changeset
  1719
     h         "{ Class: SmallInteger }"
8aefa2576a50 a few more smallInteger type hints
Claus Gittinger <cg@exept.de>
parents: 2473
diff changeset
  1720
     sz        "{ Class: SmallInteger }" |
0
48194c26a46c Initial revision
claus
parents:
diff changeset
  1721
2773
8aefa2576a50 a few more smallInteger type hints
Claus Gittinger <cg@exept.de>
parents: 2473
diff changeset
  1722
    w := wIn.
8aefa2576a50 a few more smallInteger type hints
Claus Gittinger <cg@exept.de>
parents: 2473
diff changeset
  1723
    h := hIn.
0
48194c26a46c Initial revision
claus
parents:
diff changeset
  1724
    bytes := anArray.
2773
8aefa2576a50 a few more smallInteger type hints
Claus Gittinger <cg@exept.de>
parents: 2473
diff changeset
  1725
    sz := anArray size.
0
48194c26a46c Initial revision
claus
parents:
diff changeset
  1726
2773
8aefa2576a50 a few more smallInteger type hints
Claus Gittinger <cg@exept.de>
parents: 2473
diff changeset
  1727
    sz ~~ (((w + 7) // 8) * h) ifTrue:[
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1728
	"/ not bytes ...
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1729
	sz == (((w + 15) // 16) * h) ifTrue:[
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1730
	    "I want the bytes but got shorts (ST-80)"
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1731
	    bytes := ByteArray uninitializedNew:(((w + 7) // 8) * h).
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1732
	    srcPerRow := (w + 15) // 16.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1733
	    dstPerRow := (w + 7) // 8.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1734
	    srcStart := 1.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1735
	    dstIndex := 1.
2773
8aefa2576a50 a few more smallInteger type hints
Claus Gittinger <cg@exept.de>
parents: 2473
diff changeset
  1736
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1737
	    1 to:h do:[:hi |
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1738
		srcIndex := srcStart.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1739
		bits := anArray at:srcIndex.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1740
		1 to:dstPerRow do:[:di |
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1741
		    di odd ifTrue:[
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1742
			bits := anArray at:srcIndex.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1743
			bytes at:dstIndex put:(bits bitShift:-8)
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1744
		    ] ifFalse:[
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1745
			bytes at:dstIndex put:(bits bitAnd:16rFF).
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1746
			srcIndex := srcIndex + 1
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1747
		    ].
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1748
		    dstIndex := dstIndex + 1
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1749
		].
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1750
		srcStart := srcStart + srcPerRow
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1751
	    ]
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1752
	] ifFalse:[
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1753
	    sz == (((w + 31) // 32) * h) ifTrue:[
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1754
		"I want the bytes but got longs (Squeak)"
3020
e043c3d30613 more Squeak compatibility stuff
ps
parents: 2980
diff changeset
  1755
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1756
		bytes := ByteArray uninitializedNew:(((w + 7) // 8) * h).
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1757
		srcPerRow := (w + 31) // 32.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1758
		dstPerRow := (w + 7) // 8.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1759
		srcStart := 1.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1760
		dstIndex := 1.
3020
e043c3d30613 more Squeak compatibility stuff
ps
parents: 2980
diff changeset
  1761
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1762
		1 to:h do:[:hi |
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1763
		    |ss|
3020
e043c3d30613 more Squeak compatibility stuff
ps
parents: 2980
diff changeset
  1764
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1765
		    srcIndex := srcStart.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1766
		    bits := anArray at:srcIndex.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1767
		    ss := 0.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1768
		    1 to:dstPerRow do:[:di |
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1769
			ss == 0 ifTrue:[
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1770
			    bits := anArray at:srcIndex.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1771
			].
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1772
			bytes at:dstIndex put:((bits bitShift:-24) bitAnd:16rFF).
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1773
			bits := bits bitShift:8.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1774
			ss := ss + 1.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1775
			ss == 4 ifTrue:[
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1776
			    srcIndex := srcIndex + 1.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1777
			    ss := 0.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1778
			].
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1779
			dstIndex := dstIndex + 1
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1780
		    ].
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1781
		    srcStart := srcStart + srcPerRow
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1782
		]
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1783
	    ]
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1784
	]
0
48194c26a46c Initial revision
claus
parents:
diff changeset
  1785
    ].
48194c26a46c Initial revision
claus
parents:
diff changeset
  1786
    data := bytes.
6230
22cbdd5e9a35 class: Form
Stefan Vogel <sv@exept.de>
parents: 6227
diff changeset
  1787
    width := w.
22cbdd5e9a35 class: Form
Stefan Vogel <sv@exept.de>
parents: 6227
diff changeset
  1788
    height := h.
22cbdd5e9a35 class: Form
Stefan Vogel <sv@exept.de>
parents: 6227
diff changeset
  1789
    depth := 1.
22cbdd5e9a35 class: Form
Stefan Vogel <sv@exept.de>
parents: 6227
diff changeset
  1790
    offset := 0@0.
6483
10d4084f12cc class: Form
Stefan Vogel <sv@exept.de>
parents: 6257
diff changeset
  1791
10d4084f12cc class: Form
Stefan Vogel <sv@exept.de>
parents: 6257
diff changeset
  1792
    localColorMap isNil ifTrue:[
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1793
	BlackAndWhiteColorMap isNil ifTrue:[
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1794
	    BlackAndWhiteColorMap := Array with:(Color white) with:(Color black)
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1795
	].
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1796
	localColorMap := BlackAndWhiteColorMap.
6230
22cbdd5e9a35 class: Form
Stefan Vogel <sv@exept.de>
parents: 6227
diff changeset
  1797
    ].
6483
10d4084f12cc class: Form
Stefan Vogel <sv@exept.de>
parents: 6257
diff changeset
  1798
7260
5b9f9cbd2435 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 7238
diff changeset
  1799
    device notNil ifTrue:[
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1800
	gc createBitmapFromArray:bytes width:w height:h.
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1801
	realized := true.
6230
22cbdd5e9a35 class: Form
Stefan Vogel <sv@exept.de>
parents: 6227
diff changeset
  1802
    ].
0
48194c26a46c Initial revision
claus
parents:
diff changeset
  1803
!
48194c26a46c Initial revision
claus
parents:
diff changeset
  1804
48194c26a46c Initial revision
claus
parents:
diff changeset
  1805
width:w height:h offset:offs fromArray:anArray
54
29a6b2f8e042 *** empty log message ***
claus
parents: 46
diff changeset
  1806
    "actual create of a monochrome form from array"
0
48194c26a46c Initial revision
claus
parents:
diff changeset
  1807
48194c26a46c Initial revision
claus
parents:
diff changeset
  1808
    self width:w height:h fromArray:anArray.
48194c26a46c Initial revision
claus
parents:
diff changeset
  1809
    offset := offs
48194c26a46c Initial revision
claus
parents:
diff changeset
  1810
! !
48194c26a46c Initial revision
claus
parents:
diff changeset
  1811
3177
8aa3c800394a category rename
Claus Gittinger <cg@exept.de>
parents: 3142
diff changeset
  1812
!Form methodsFor:'queries'!
99
c40b8a508283 *** empty log message ***
claus
parents: 98
diff changeset
  1813
3812
377a6198fcfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3811
diff changeset
  1814
ascentOn:aGC
377a6198fcfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3811
diff changeset
  1815
    "displayOn: does not draw above baseline"
377a6198fcfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3811
diff changeset
  1816
377a6198fcfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3811
diff changeset
  1817
    ^ 0
377a6198fcfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3811
diff changeset
  1818
!
377a6198fcfe *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3811
diff changeset
  1819
680
a905d02dcb82 added #bounds (for VisualComponent protocol compatibility)
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  1820
bounds
a905d02dcb82 added #bounds (for VisualComponent protocol compatibility)
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  1821
    "return my bounds (added to make forms usable as VisualComponents)"
a905d02dcb82 added #bounds (for VisualComponent protocol compatibility)
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  1822
a905d02dcb82 added #bounds (for VisualComponent protocol compatibility)
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  1823
    ^ Rectangle left:0 top:0 width:width height:height
a905d02dcb82 added #bounds (for VisualComponent protocol compatibility)
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  1824
a905d02dcb82 added #bounds (for VisualComponent protocol compatibility)
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  1825
    "Modified: 13.5.1996 / 10:26:13 / cg"
a905d02dcb82 added #bounds (for VisualComponent protocol compatibility)
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  1826
!
a905d02dcb82 added #bounds (for VisualComponent protocol compatibility)
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  1827
910
6a19a80f66b4 added colorFromValue: for Image compatibility
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1828
colorFromValue:pixel
1200
b77327efe724 comment
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
  1829
    "given a pixelValue, return the corresponding color.
b77327efe724 comment
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
  1830
     For compatibility with Images"
b77327efe724 comment
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
  1831
910
6a19a80f66b4 added colorFromValue: for Image compatibility
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1832
    localColorMap notNil ifTrue:[
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1833
	^ localColorMap at:(pixel + 1)
910
6a19a80f66b4 added colorFromValue: for Image compatibility
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1834
    ].
6a19a80f66b4 added colorFromValue: for Image compatibility
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1835
    depth == 1 ifTrue:[
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1836
	pixel == 0 ifTrue:[^ self whiteColor].
910
6a19a80f66b4 added colorFromValue: for Image compatibility
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1837
    ].
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1838
    ^ self blackColor
910
6a19a80f66b4 added colorFromValue: for Image compatibility
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1839
6a19a80f66b4 added colorFromValue: for Image compatibility
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1840
    "Created: 28.6.1996 / 16:10:13 / cg"
1200
b77327efe724 comment
Claus Gittinger <cg@exept.de>
parents: 1145
diff changeset
  1841
    "Modified: 13.1.1997 / 23:06:25 / cg"
910
6a19a80f66b4 added colorFromValue: for Image compatibility
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1842
!
6a19a80f66b4 added colorFromValue: for Image compatibility
Claus Gittinger <cg@exept.de>
parents: 897
diff changeset
  1843
925
1467e7850045 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 915
diff changeset
  1844
hasBits
1467e7850045 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 915
diff changeset
  1845
    "return true, if the receiver has its pixel data available.
1467e7850045 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 915
diff changeset
  1846
     For forms, which were created from data, this is always true.
1467e7850045 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 915
diff changeset
  1847
     For forms, which were created as off-screen device forms on some
1467e7850045 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 915
diff changeset
  1848
     device, this is always false."
1467e7850045 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 915
diff changeset
  1849
1467e7850045 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 915
diff changeset
  1850
    ^ data notNil
1467e7850045 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 915
diff changeset
  1851
1467e7850045 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 915
diff changeset
  1852
    "Created: 5.7.1996 / 16:21:20 / cg"
1467e7850045 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 915
diff changeset
  1853
!
1467e7850045 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 915
diff changeset
  1854
673
c755f681e169 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 672
diff changeset
  1855
heightOn:aGC
674
e0f6bd36a99d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 673
diff changeset
  1856
    "return my height, if displayed on aGC;
e0f6bd36a99d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 673
diff changeset
  1857
     since my height is independent of the device (the number of pixels),
e0f6bd36a99d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 673
diff changeset
  1858
     return the pixel-height"
e0f6bd36a99d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 673
diff changeset
  1859
680
a905d02dcb82 added #bounds (for VisualComponent protocol compatibility)
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  1860
    ^ height
673
c755f681e169 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 672
diff changeset
  1861
c755f681e169 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 672
diff changeset
  1862
    "Created: 12.5.1996 / 21:35:33 / cg"
680
a905d02dcb82 added #bounds (for VisualComponent protocol compatibility)
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  1863
    "Modified: 13.5.1996 / 10:26:09 / cg"
673
c755f681e169 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 672
diff changeset
  1864
!
c755f681e169 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 672
diff changeset
  1865
3700
9b40f1e55270 dummy isDithered - for color compatibility
Claus Gittinger <cg@exept.de>
parents: 3655
diff changeset
  1866
isDithered
9b40f1e55270 dummy isDithered - for color compatibility
Claus Gittinger <cg@exept.de>
parents: 3655
diff changeset
  1867
    "for compatibility with color protocol"
9b40f1e55270 dummy isDithered - for color compatibility
Claus Gittinger <cg@exept.de>
parents: 3655
diff changeset
  1868
9b40f1e55270 dummy isDithered - for color compatibility
Claus Gittinger <cg@exept.de>
parents: 3655
diff changeset
  1869
    ^ false
9b40f1e55270 dummy isDithered - for color compatibility
Claus Gittinger <cg@exept.de>
parents: 3655
diff changeset
  1870
!
9b40f1e55270 dummy isDithered - for color compatibility
Claus Gittinger <cg@exept.de>
parents: 3655
diff changeset
  1871
99
c40b8a508283 *** empty log message ***
claus
parents: 98
diff changeset
  1872
isForm
c40b8a508283 *** empty log message ***
claus
parents: 98
diff changeset
  1873
    "return true, if the receiver is some kind of form;
c40b8a508283 *** empty log message ***
claus
parents: 98
diff changeset
  1874
     true is returned here - the method is redefined from Object."
c40b8a508283 *** empty log message ***
claus
parents: 98
diff changeset
  1875
c40b8a508283 *** empty log message ***
claus
parents: 98
diff changeset
  1876
    ^ true
c40b8a508283 *** empty log message ***
claus
parents: 98
diff changeset
  1877
!
c40b8a508283 *** empty log message ***
claus
parents: 98
diff changeset
  1878
c40b8a508283 *** empty log message ***
claus
parents: 98
diff changeset
  1879
isImageOrForm
c40b8a508283 *** empty log message ***
claus
parents: 98
diff changeset
  1880
    "return true, if the receiver is some kind of image or form;
c40b8a508283 *** empty log message ***
claus
parents: 98
diff changeset
  1881
     true is returned here - the method is redefined from Object."
c40b8a508283 *** empty log message ***
claus
parents: 98
diff changeset
  1882
c40b8a508283 *** empty log message ***
claus
parents: 98
diff changeset
  1883
    ^ true
673
c755f681e169 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 672
diff changeset
  1884
!
c755f681e169 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 672
diff changeset
  1885
c755f681e169 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 672
diff changeset
  1886
widthOn:aGC
674
e0f6bd36a99d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 673
diff changeset
  1887
    "return my width, if displayed on aGC;
e0f6bd36a99d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 673
diff changeset
  1888
     since my width is independent of the device (the number of pixels),
e0f6bd36a99d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 673
diff changeset
  1889
     return the pixel-width"
e0f6bd36a99d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 673
diff changeset
  1890
680
a905d02dcb82 added #bounds (for VisualComponent protocol compatibility)
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  1891
    ^ width
673
c755f681e169 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 672
diff changeset
  1892
c755f681e169 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 672
diff changeset
  1893
    "Created: 12.5.1996 / 21:35:29 / cg"
680
a905d02dcb82 added #bounds (for VisualComponent protocol compatibility)
Claus Gittinger <cg@exept.de>
parents: 674
diff changeset
  1894
    "Modified: 13.5.1996 / 10:26:05 / cg"
99
c40b8a508283 *** empty log message ***
claus
parents: 98
diff changeset
  1895
! !
c40b8a508283 *** empty log message ***
claus
parents: 98
diff changeset
  1896
4173
100ca435fb0e New class Form::ImageForm for Forms that are created from Images.
Stefan Vogel <sv@exept.de>
parents: 4165
diff changeset
  1897
!Form::ImageForm class methodsFor:'documentation'!
100ca435fb0e New class Form::ImageForm for Forms that are created from Images.
Stefan Vogel <sv@exept.de>
parents: 4165
diff changeset
  1898
100ca435fb0e New class Form::ImageForm for Forms that are created from Images.
Stefan Vogel <sv@exept.de>
parents: 4165
diff changeset
  1899
documentation
100ca435fb0e New class Form::ImageForm for Forms that are created from Images.
Stefan Vogel <sv@exept.de>
parents: 4165
diff changeset
  1900
"
100ca435fb0e New class Form::ImageForm for Forms that are created from Images.
Stefan Vogel <sv@exept.de>
parents: 4165
diff changeset
  1901
    ImageForm is used for Forms, that have been created from an image and do not
100ca435fb0e New class Form::ImageForm for Forms that are created from Images.
Stefan Vogel <sv@exept.de>
parents: 4165
diff changeset
  1902
    hold the image bits.
100ca435fb0e New class Form::ImageForm for Forms that are created from Images.
Stefan Vogel <sv@exept.de>
parents: 4165
diff changeset
  1903
100ca435fb0e New class Form::ImageForm for Forms that are created from Images.
Stefan Vogel <sv@exept.de>
parents: 4165
diff changeset
  1904
    It does not fetch the image bits when doing a snapshot.
100ca435fb0e New class Form::ImageForm for Forms that are created from Images.
Stefan Vogel <sv@exept.de>
parents: 4165
diff changeset
  1905
100ca435fb0e New class Form::ImageForm for Forms that are created from Images.
Stefan Vogel <sv@exept.de>
parents: 4165
diff changeset
  1906
    [author:]
7416
bd3b9e9edd9e Delegate GraphicsContext objects
Stefan Vogel <sv@exept.de>
parents: 7381
diff changeset
  1907
	Stefan Vogel (stefan@zwerg)
4173
100ca435fb0e New class Form::ImageForm for Forms that are created from Images.
Stefan Vogel <sv@exept.de>
parents: 4165
diff changeset
  1908
100ca435fb0e New class Form::ImageForm for Forms that are created from Images.
Stefan Vogel <sv@exept.de>
parents: 4165
diff changeset
  1909
    [instance variables:]
100ca435fb0e New class Form::ImageForm for Forms that are created from Images.
Stefan Vogel <sv@exept.de>
parents: 4165
diff changeset
  1910
100ca435fb0e New class Form::ImageForm for Forms that are created from Images.
Stefan Vogel <sv@exept.de>
parents: 4165
diff changeset
  1911
    [class variables:]
100ca435fb0e New class Form::ImageForm for Forms that are created from Images.
Stefan Vogel <sv@exept.de>
parents: 4165
diff changeset
  1912
100ca435fb0e New class Form::ImageForm for Forms that are created from Images.
Stefan Vogel <sv@exept.de>
parents: 4165
diff changeset
  1913
    [see also:]
100ca435fb0e New class Form::ImageForm for Forms that are created from Images.
Stefan Vogel <sv@exept.de>
parents: 4165
diff changeset
  1914
100ca435fb0e New class Form::ImageForm for Forms that are created from Images.
Stefan Vogel <sv@exept.de>
parents: 4165
diff changeset
  1915
"
100ca435fb0e New class Form::ImageForm for Forms that are created from Images.
Stefan Vogel <sv@exept.de>
parents: 4165
diff changeset
  1916
! !
100ca435fb0e New class Form::ImageForm for Forms that are created from Images.
Stefan Vogel <sv@exept.de>
parents: 4165
diff changeset
  1917
7493
59db55fd753a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7446
diff changeset
  1918
!Form::ImageForm methodsFor:'converting'!
59db55fd753a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7446
diff changeset
  1919
59db55fd753a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7446
diff changeset
  1920
asImageForm
59db55fd753a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7446
diff changeset
  1921
    ^ self
59db55fd753a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7446
diff changeset
  1922
! !
59db55fd753a #OTHER by stefan
Stefan Vogel <sv@exept.de>
parents: 7446
diff changeset
  1923
4173
100ca435fb0e New class Form::ImageForm for Forms that are created from Images.
Stefan Vogel <sv@exept.de>
parents: 4165
diff changeset
  1924
!Form::ImageForm methodsFor:'private'!
100ca435fb0e New class Form::ImageForm for Forms that are created from Images.
Stefan Vogel <sv@exept.de>
parents: 4165
diff changeset
  1925
100ca435fb0e New class Form::ImageForm for Forms that are created from Images.
Stefan Vogel <sv@exept.de>
parents: 4165
diff changeset
  1926
getBits
100ca435fb0e New class Form::ImageForm for Forms that are created from Images.
Stefan Vogel <sv@exept.de>
parents: 4165
diff changeset
  1927
    "do nothing. The image, that created the ImageForm, has the bits"
100ca435fb0e New class Form::ImageForm for Forms that are created from Images.
Stefan Vogel <sv@exept.de>
parents: 4165
diff changeset
  1928
100ca435fb0e New class Form::ImageForm for Forms that are created from Images.
Stefan Vogel <sv@exept.de>
parents: 4165
diff changeset
  1929
    ^ self
100ca435fb0e New class Form::ImageForm for Forms that are created from Images.
Stefan Vogel <sv@exept.de>
parents: 4165
diff changeset
  1930
!
100ca435fb0e New class Form::ImageForm for Forms that are created from Images.
Stefan Vogel <sv@exept.de>
parents: 4165
diff changeset
  1931
100ca435fb0e New class Form::ImageForm for Forms that are created from Images.
Stefan Vogel <sv@exept.de>
parents: 4165
diff changeset
  1932
recreate
100ca435fb0e New class Form::ImageForm for Forms that are created from Images.
Stefan Vogel <sv@exept.de>
parents: 4165
diff changeset
  1933
    "nothing to do here. The image recreates the form if needed"
100ca435fb0e New class Form::ImageForm for Forms that are created from Images.
Stefan Vogel <sv@exept.de>
parents: 4165
diff changeset
  1934
100ca435fb0e New class Form::ImageForm for Forms that are created from Images.
Stefan Vogel <sv@exept.de>
parents: 4165
diff changeset
  1935
    ^ self
100ca435fb0e New class Form::ImageForm for Forms that are created from Images.
Stefan Vogel <sv@exept.de>
parents: 4165
diff changeset
  1936
! !
100ca435fb0e New class Form::ImageForm for Forms that are created from Images.
Stefan Vogel <sv@exept.de>
parents: 4165
diff changeset
  1937
1142
2a83bf7d5627 Form>>readFrom: are going to be obsoleted.
Claus Gittinger <cg@exept.de>
parents: 1138
diff changeset
  1938
!Form class methodsFor:'documentation'!
134
claus
parents: 133
diff changeset
  1939
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1940
version
7106
52956049570c #DOCUMENTATION
mawalch
parents: 6860
diff changeset
  1941
    ^ '$Header$'
7355
b54b8aebbb90 #FEATURE by sr
sr
parents: 7354
diff changeset
  1942
!
b54b8aebbb90 #FEATURE by sr
sr
parents: 7354
diff changeset
  1943
b54b8aebbb90 #FEATURE by sr
sr
parents: 7354
diff changeset
  1944
version_CVS
b54b8aebbb90 #FEATURE by sr
sr
parents: 7354
diff changeset
  1945
    ^ '$Header$'
7365
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 7315 7355
diff changeset
  1946
!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 7315 7355
diff changeset
  1947
7315
aed1314a2448 Issue #82: UIPainterView does not understand: #deviceClippingRectangle
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 7287
diff changeset
  1948
version_HG
aed1314a2448 Issue #82: UIPainterView does not understand: #deviceClippingRectangle
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 7287
diff changeset
  1949
aed1314a2448 Issue #82: UIPainterView does not understand: #deviceClippingRectangle
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 7287
diff changeset
  1950
    ^ '$Changeset: <not expanded> $'
0
48194c26a46c Initial revision
claus
parents:
diff changeset
  1951
! !
3811
cfea9bc25737 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1952
6046
66cadbdbe9cf class: Form
Claus Gittinger <cg@exept.de>
parents: 5915
diff changeset
  1953
278
15e2959e1e58 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1954
Form initialize!