GraphicsMedium.st
changeset 7420 c1c1c574f217
parent 7416 bd3b9e9edd9e
child 7443 e2d05b756727
equal deleted inserted replaced
7419:b594081e3710 7420:c1c1c574f217
       
     1 "{ Encoding: utf8 }"
       
     2 
     1 "
     3 "
     2  COPYRIGHT (c) 1989 by Claus Gittinger
     4  COPYRIGHT (c) 1989 by Claus Gittinger
     3 	      All Rights Reserved
     5 	      All Rights Reserved
     4 
     6 
     5  This software is furnished under a license and may be used
     7  This software is furnished under a license and may be used
     7  inclusion of the above copyright notice.   This software may not
     9  inclusion of the above copyright notice.   This software may not
     8  be provided or otherwise made available to, or used by, any
    10  be provided or otherwise made available to, or used by, any
     9  other person.  No title to or ownership of the software is
    11  other person.  No title to or ownership of the software is
    10  hereby transferred.
    12  hereby transferred.
    11 "
    13 "
    12 'From Smalltalk/X, Version:7.1.0.0 on 19-07-2016 at 15:53:05'                   !
       
    13 
       
    14 "{ Package: 'stx:libview' }"
    14 "{ Package: 'stx:libview' }"
    15 
    15 
    16 "{ NameSpace: Smalltalk }"
    16 "{ NameSpace: Smalltalk }"
    17 
    17 
    18 Object subclass:#GraphicsMedium
    18 Object subclass:#GraphicsMedium
   299 
   299 
   300 widthOfString:aString
   300 widthOfString:aString
   301     "given a string, return its width in pixels if
   301     "given a string, return its width in pixels if
   302      drawn on the receivers device."
   302      drawn on the receivers device."
   303 
   303 
   304     gc == self ifTrue:[
       
   305 	^ super widthOfString:aString.
       
   306     ].
       
   307     ^ gc widthOfString:aString.
   304     ^ gc widthOfString:aString.
   308 
   305 
   309     "Modified: 28.5.1996 / 20:22:22 / cg"
   306     "Modified: 28.5.1996 / 20:22:22 / cg"
   310 !
   307 !
   311 
   308 
   312 widthOfString:aString from:start to:stop
   309 widthOfString:aString from:start to:stop
   313     "given a string, return the width in pixels if
   310     "given a string, return the width in pixels if
   314      a substring is drawn on the receivers device."
   311      a substring is drawn on the receivers device."
   315 
   312 
   316     gc == self ifTrue:[
       
   317 	^ super widthOfString:aString from:start to:stop.
       
   318     ].
       
   319     ^ gc widthOfString:aString from:start to:stop.
   313     ^ gc widthOfString:aString from:start to:stop.
   320 
   314 
   321     "Modified: 28.5.1996 / 20:22:18 / cg"
   315     "Modified: 28.5.1996 / 20:22:18 / cg"
   322 ! !
   316 ! !
   323 
   317 
   411 !
   405 !
   412 
   406 
   413 fill:aRectangle fillColor:aColor
   407 fill:aRectangle fillColor:aColor
   414     "fill the rectangular area specified by aRectangle with the black color"
   408     "fill the rectangular area specified by aRectangle with the black color"
   415 
   409 
   416     gc == self ifTrue:[
       
   417 	super fill:aRectangle fillColor:aColor.
       
   418 	^ self.
       
   419     ].
       
   420     gc fill:aRectangle fillColor:aColor
   410     gc fill:aRectangle fillColor:aColor
   421 !
   411 !
   422 
   412 
   423 fillBlack:aRectangle
   413 fillBlack:aRectangle
   424     "fill the rectangular area specified by aRectangle with the black color"
   414     "fill the rectangular area specified by aRectangle with the black color"
   425 
   415 
   426     self fill:aRectangle fillColor:Color black
   416     self fill:aRectangle fillColor:self blackColor
   427 !
   417 !
   428 
   418 
   429 fillColor:something
   419 fillColor:something
   430     "fill the receiver with something;
   420     "fill the receiver with something;
   431      something may be a Form, Color or colorIndex"
   421      something may be a Form, Color or colorIndex"
   434 !
   424 !
   435 
   425 
   436 fillRectangle:aRectangle color:aColor
   426 fillRectangle:aRectangle color:aColor
   437     "fill a rectangle with the given paint color"
   427     "fill a rectangle with the given paint color"
   438 
   428 
   439     gc == self ifTrue:[
       
   440 	super fillRectangle:aRectangle color:aColor.
       
   441 	^ self.
       
   442     ].
       
   443     gc fillRectangle:aRectangle color:aColor
   429     gc fillRectangle:aRectangle color:aColor
   444 !
   430 !
   445 
   431 
   446 fillWhite
   432 fillWhite
   447     "fill all of the receiver with the white color"
   433     "fill all of the receiver with the white color"
   448 
   434 
   449     self fill:Color white
   435     self fill:self whiteColor
   450 !
   436 !
   451 
   437 
   452 fillWhite:aRectangle
   438 fillWhite:aRectangle
   453     "fill the rectangular area specified by aRectangle with the white color"
   439     "fill the rectangular area specified by aRectangle with the white color"
   454 
   440 
   455     self fill:aRectangle fillColor:Color white
   441     self fill:aRectangle fillColor:self whiteColor
   456 ! !
   442 ! !
   457 
   443 
   458 !GraphicsMedium methodsFor:'Compatibility-VW'!
   444 !GraphicsMedium methodsFor:'Compatibility-VW'!
   459 
   445 
   460 displayBackgroundIfNeededOn: aGraphicsContext
   446 displayBackgroundIfNeededOn: aGraphicsContext
   511 !
   497 !
   512 
   498 
   513 atX:x y:y
   499 atX:x y:y
   514     "return the pixel at the coordinate given by x/y"
   500     "return the pixel at the coordinate given by x/y"
   515 
   501 
   516     gc == self ifTrue:[
       
   517 	^ super atX:x y:y
       
   518     ].
       
   519     ^ gc atX:x y:y
   502     ^ gc atX:x y:y
   520 !
   503 !
   521 
   504 
   522 atX:x y:y put:aPixelColor
   505 atX:x y:y put:aPixelColor
   523     "set a pixel"
   506     "set a pixel"
   524 
   507 
   525     gc == self ifTrue:[
       
   526 	super atX:x y:y put:aPixelColor.
       
   527 	^ self.
       
   528     ].
       
   529     gc atX:x y:y put:aPixelColor.
   508     gc atX:x y:y put:aPixelColor.
   530 !
   509 !
   531 
   510 
   532 backgroundPaint
   511 backgroundPaint
   533     "return the background paint color.
   512     "return the background paint color.
   534      (used for opaqueForms and opaqueStrings)"
   513      (used for opaqueForms and opaqueStrings)"
   535 
   514 
   536     gc == self ifTrue:[
       
   537 	^ super backgroundPaint.
       
   538     ].
       
   539     ^ gc backgroundPaint
   515     ^ gc backgroundPaint
   540 !
   516 !
   541 
   517 
   542 backgroundPaint:aColor
   518 backgroundPaint:aColor
   543     "set the background-paint color; this is used in opaque-draw
   519     "set the background-paint color; this is used in opaque-draw
   544      operations"
   520      operations"
   545 
   521 
   546     gc == self ifTrue:[
       
   547 	super backgroundPaint:aColor.
       
   548 	^ self.
       
   549     ].
       
   550     gc backgroundPaint:aColor
   522     gc backgroundPaint:aColor
   551 !
   523 !
   552 
   524 
   553 basicFont
   525 basicFont
   554     "return the font for drawing"
   526     "return the font for drawing"
   555 
   527 
   556     gc == self ifTrue:[
       
   557 	^ super basicFont.
       
   558     ].
       
   559     ^ gc basicFont
   528     ^ gc basicFont
   560 !
   529 !
   561 
   530 
   562 basicFont:aFont
   531 basicFont:aFont
   563     "set the font for drawing if it has changed.
   532     "set the font for drawing if it has changed.
   564      This is a low level entry, which is not to be redefined
   533      This is a low level entry, which is not to be redefined
   565      (i.e. it must not imply a redraw operation)"
   534      (i.e. it must not imply a redraw operation)"
   566 
   535 
   567     gc == self ifTrue:[
       
   568 	super basicFont:aFont.
       
   569 	^ self.
       
   570     ].
       
   571     gc basicFont:aFont
   536     gc basicFont:aFont
   572 !
   537 !
   573 
   538 
   574 blackColor
   539 blackColor
   575     gc isNil ifTrue:[
   540     gc isNil ifTrue:[
   576 	^ Color black.
   541         ^ Color black.
   577     ].
   542     ].
   578     gc == self ifTrue:[
   543     ^ gc blackColor
   579 	^ super device blackColor.
       
   580     ].
       
   581     ^ gc device blackColor
       
   582 !
   544 !
   583 
   545 
   584 bottomCenter
   546 bottomCenter
   585     "return the topCenter point"
   547     "return the topCenter point"
   586 
   548 
   602 
   564 
   603 capStyle
   565 capStyle
   604     "return the current cap-style for line-drawing.
   566     "return the current cap-style for line-drawing.
   605      possible styles are: #notLast, #butt, #round, #projecting"
   567      possible styles are: #notLast, #butt, #round, #projecting"
   606 
   568 
   607     gc == self ifTrue:[
       
   608 	^ super capStyle.
       
   609     ].
       
   610     ^ gc capStyle
   569     ^ gc capStyle
   611 !
   570 !
   612 
   571 
   613 capStyle:aStyleSymbol
   572 capStyle:aStyleSymbol
   614     "set the cap-style for line-drawing;
   573     "set the cap-style for line-drawing;
   615      possible styles are: #notLast, #butt, #round, #projecting"
   574      possible styles are: #notLast, #butt, #round, #projecting"
   616 
   575 
   617     gc == self ifTrue:[
       
   618 	super capStyle:aStyleSymbol.
       
   619 	^ self.
       
   620     ].
       
   621     gc capStyle:aStyleSymbol
   576     gc capStyle:aStyleSymbol
   622 
   577 
   623     "Modified: 12.5.1996 / 22:24:30 / cg"
   578     "Modified: 12.5.1996 / 22:24:30 / cg"
   624 !
   579 !
   625 
   580 
   635      occur when drawing).
   590      occur when drawing).
   636      This is (currently) only passed down from the fileBrowser,
   591      This is (currently) only passed down from the fileBrowser,
   637      and required when japanese/chinese/korean text is edited.
   592      and required when japanese/chinese/korean text is edited.
   638      (encoding is something like #'iso8859-5' #euc, #sjis, #jis7, #gb, #big5 or #ksc)"
   593      (encoding is something like #'iso8859-5' #euc, #sjis, #jis7, #gb, #big5 or #ksc)"
   639 
   594 
   640     gc == self ifTrue:[
       
   641 	^ super characterEncoding.
       
   642     ].
       
   643     ^ gc characterEncoding
   595     ^ gc characterEncoding
   644 !
   596 !
   645 
   597 
   646 characterEncoding:encodingArg
   598 characterEncoding:encodingArg
   647     "define how the contents is encoded internally.
   599     "define how the contents is encoded internally.
   650      The possibility to change the characterEncoding is provided as
   602      The possibility to change the characterEncoding is provided as
   651      a backward compatibility hook for programs which want to use
   603      a backward compatibility hook for programs which want to use
   652      another encoding internally. One such view is the CharacterSetView,
   604      another encoding internally. One such view is the CharacterSetView,
   653      which wants to show character as they are actually present in a font."
   605      which wants to show character as they are actually present in a font."
   654 
   606 
   655     gc == self ifTrue:[
       
   656 	super characterEncoding:encodingArg.
       
   657 	^ self.
       
   658     ].
       
   659     gc characterEncoding:encodingArg
   607     gc characterEncoding:encodingArg
   660 !
   608 !
   661 
   609 
   662 clipByChildren
   610 clipByChildren
   663     "drawing shall be done into my view only (default)"
   611     "drawing shall be done into my view only (default)"
   699      If on, a superview may draw 'over' its children.
   647      If on, a superview may draw 'over' its children.
   700      If off (the default), drawing is 'under' its children.
   648      If off (the default), drawing is 'under' its children.
   701      Only useful for the rootView, to draw over any visible views.
   649      Only useful for the rootView, to draw over any visible views.
   702      (for example, when dragging a rubber-line)"
   650      (for example, when dragging a rubber-line)"
   703 
   651 
   704     gc == self ifTrue:[
       
   705 	super clippedByChildren:aBoolean.
       
   706 	^ self.
       
   707     ].
       
   708     gc clippedByChildren:aBoolean.
   652     gc clippedByChildren:aBoolean.
   709 
   653 
   710     "Created: 17.7.1996 / 13:25:16 / cg"
   654     "Created: 17.7.1996 / 13:25:16 / cg"
   711     "Modified: 29.4.1997 / 15:33:55 / dq"
   655     "Modified: 29.4.1997 / 15:33:55 / dq"
   712 !
   656 !
   713 
   657 
   714 clippingBounds
   658 clippingBounds
   715     "return the clipping rectangle for drawing, nil if there is none."
   659     "return the clipping rectangle for drawing, nil if there is none."
   716 
   660 
   717     gc == self ifTrue:[
       
   718 	^ super clippingBounds.
       
   719     ].
       
   720     ^ gc clippingBounds
   661     ^ gc clippingBounds
   721 !
   662 !
   722 
   663 
   723 clippingBounds:aRectangleOrNil
   664 clippingBounds:aRectangleOrNil
   724     "set the clipping rectangle for drawing (in logical coordinates);
   665     "set the clipping rectangle for drawing (in logical coordinates);
   725      a nil argument turn off clipping (i.e. whole view is drawable)"
   666      a nil argument turn off clipping (i.e. whole view is drawable)"
   726 
   667 
   727     gc == self ifTrue:[
       
   728 	super clippingBounds:aRectangleOrNil.
       
   729 	^ self.
       
   730     ].
       
   731     gc clippingBounds:aRectangleOrNil
   668     gc clippingBounds:aRectangleOrNil
   732 !
   669 !
   733 
   670 
   734 clippingBoundsOrNil
   671 clippingBoundsOrNil
   735     "return the clipping rectangle for drawing, nil if there is none."
   672     "return the clipping rectangle for drawing, nil if there is none."
   736 
   673 
   737     gc == self ifTrue:[
       
   738 	^ super clippingBoundsOrNil.
       
   739     ].
       
   740     ^ gc clippingBoundsOrNil
   674     ^ gc clippingBoundsOrNil
   741 !
   675 !
   742 
   676 
   743 clippingRectangle:aRectangleOrNil
   677 clippingRectangle:aRectangleOrNil
   744     "set the clipping rectangle for drawing (in logical coordinates);
   678     "set the clipping rectangle for drawing (in logical coordinates);
   766 !
   700 !
   767 
   701 
   768 colorAtX:x y:y
   702 colorAtX:x y:y
   769     "return the color of the pixel at the coordinate given by aPoint"
   703     "return the color of the pixel at the coordinate given by aPoint"
   770 
   704 
   771     gc == self ifTrue:[
       
   772 	^ super colorAtX:x y:y.
       
   773     ].
       
   774     ^ gc colorAtX:x y:y
   705     ^ gc colorAtX:x y:y
   775 !
   706 !
   776 
   707 
   777 container
   708 container
   778     "return my container - for protocol compatibility"
   709     "return my container - for protocol compatibility"
   801      defines 4on-4off dashing;
   732      defines 4on-4off dashing;
   802      Setting it to [1 2 4 2] defines 1on-2off-4on-2off dashes.
   733      Setting it to [1 2 4 2] defines 1on-2off-4on-2off dashes.
   803      The dashOffset specifies where in the dashList the dashing starts.
   734      The dashOffset specifies where in the dashList the dashing starts.
   804      Ignored here - this may not be supported by all graphics devices."
   735      Ignored here - this may not be supported by all graphics devices."
   805 
   736 
   806     gc == self ifTrue:[
       
   807 	^ super dashStyle:aDashList offset:dashOffset.
       
   808     ].
       
   809     ^ gc dashStyle:aDashList offset:dashOffset
   737     ^ gc dashStyle:aDashList offset:dashOffset
   810 !
   738 !
   811 
   739 
   812 device
   740 device
   813     "return the device, the receiver is associated with"
   741     "return the device, the receiver is associated with"
   817 
   745 
   818 device:aDevice
   746 device:aDevice
   819     "set the device"
   747     "set the device"
   820 
   748 
   821     aDevice isNil ifTrue:[
   749     aDevice isNil ifTrue:[
   822 	^ self.
   750         ^ self.
   823     ].
   751     ].
   824 
   752 
   825     device := aDevice.
   753     device := aDevice.
   826     gc isNil ifTrue:[
   754     gc isNil ifTrue:[
   827 	gc := aDevice newGraphicsContextFor:self.
   755         gc := aDevice newGraphicsContextFor:self.
   828 	^ self.
   756         ^ self.
   829     ].
   757     ].
   830 
   758 
   831     gc == self ifTrue:[
   759     gc device:aDevice
   832 	super device:aDevice.
       
   833     ] ifFalse:[
       
   834 	gc device:aDevice
       
   835     ].
       
   836 !
   760 !
   837 
   761 
   838 deviceClippingRectangle:aRectangleOrNil
   762 deviceClippingRectangle:aRectangleOrNil
   839     "set the clipping rectangle for drawing (in device coordinates);
   763     "set the clipping rectangle for drawing (in device coordinates);
   840      a nil argument turns off clipping (i.e. whole view is drawable - incl. margins)"
   764      a nil argument turns off clipping (i.e. whole view is drawable - incl. margins)"
   841 
   765 
   842     gc == self ifTrue:[
       
   843 	super deviceClippingRectangle:aRectangleOrNil.
       
   844 	^ self.
       
   845     ].
       
   846     gc deviceClippingRectangle:aRectangleOrNil
   766     gc deviceClippingRectangle:aRectangleOrNil
   847 !
   767 !
   848 
   768 
   849 drawableId
   769 drawableId
   850     "return the id of the drawable on the device"
   770     "return the id of the drawable on the device"
   851 
   771 
   852     gc == self ifTrue:[
       
   853 	^ super drawableId.
       
   854     ].
       
   855     gc isNil ifTrue:[
   772     gc isNil ifTrue:[
   856 	^ nil.
   773         ^ nil.
   857     ].
   774     ].
   858     ^ gc drawableId
   775     ^ gc drawableId
   859 !
   776 !
   860 
   777 
   861 extent
   778 extent
   873 !
   790 !
   874 
   791 
   875 font
   792 font
   876     "return the current drawing font"
   793     "return the current drawing font"
   877 
   794 
   878     gc == self ifTrue:[
       
   879 	^ super font.
       
   880     ].
       
   881     ^ gc font
   795     ^ gc font
   882 !
   796 !
   883 
   797 
   884 font:aFont
   798 font:aFont
   885     "set the font for drawing if it has changed.
   799     "set the font for drawing if it has changed.
   886      This should be redefined in some widget to perform an automatic
   800      This should be redefined in some widget to perform an automatic
   887      redraw. See also: #basicFont:"
   801      redraw. See also: #basicFont:"
   888 
   802 
   889     gc == self ifTrue:[
   803     gc font:aFont.
   890 	super font:aFont.
       
   891     ] ifFalse:[
       
   892 	gc font:aFont.
       
   893     ].
       
   894     self changed:#font.
   804     self changed:#font.
   895 !
   805 !
   896 
   806 
   897 function
   807 function
   898     "return the current drawing function"
   808     "return the current drawing function"
   899 
   809 
   900     gc == self ifTrue:[
       
   901 	^ super function.
       
   902     ].
       
   903     ^ gc function
   810     ^ gc function
   904 !
   811 !
   905 
   812 
   906 function:aSymbol
   813 function:aSymbol
   907     "set the drawing function if it has changed"
   814     "set the drawing function if it has changed"
   908 
   815 
   909     gc == self ifTrue:[
       
   910 	super function:aSymbol.
       
   911 	^ self.
       
   912     ].
       
   913     gc function:aSymbol
   816     gc function:aSymbol
   914 !
   817 !
   915 
   818 
   916 gcId
   819 gcId
   917     "return the receivers graphic context id on the device"
   820     "return the receivers graphic context id on the device"
   918 
   821 
   919     gc == self ifTrue:[
       
   920 	^ super gcId.
       
   921     ].
       
   922     gc isNil ifTrue:[
   822     gc isNil ifTrue:[
   923 	^ nil.
   823         ^ nil.
   924     ].
   824     ].
   925     ^ gc gcId.
   825     ^ gc gcId.
   926 !
   826 !
   927 
   827 
   928 graphicsContext
   828 graphicsContext
   965 
   865 
   966 joinStyle
   866 joinStyle
   967     "return the current join-style for polygon-drawing.
   867     "return the current join-style for polygon-drawing.
   968      possible styles are: #miter, #bevel, #round"
   868      possible styles are: #miter, #bevel, #round"
   969 
   869 
   970     gc == self ifTrue:[
       
   971 	^ super joinStyle.
       
   972     ].
       
   973     ^ gc joinStyle
   870     ^ gc joinStyle
   974 !
   871 !
   975 
   872 
   976 joinStyle:aStyleSymbol
   873 joinStyle:aStyleSymbol
   977     "set the join-style of lines in polygon-drawing;
   874     "set the join-style of lines in polygon-drawing;
   978      possible styles are: #miter, #bevel, #round"
   875      possible styles are: #miter, #bevel, #round"
   979 
   876 
   980     gc == self ifTrue:[
       
   981 	super joinStyle:aStyleSymbol.
       
   982 	^ self.
       
   983     ].
       
   984     gc joinStyle:aStyleSymbol
   877     gc joinStyle:aStyleSymbol
   985 !
   878 !
   986 
   879 
   987 left
   880 left
   988     "return the left i.e. x-coordinate of top-left of the receiver"
   881     "return the left i.e. x-coordinate of top-left of the receiver"
   999 lineStyle
   892 lineStyle
  1000     "return the current line-drawing-style.
   893     "return the current line-drawing-style.
  1001      possible styles are: #solid, #dashed, #doubleDashed,
   894      possible styles are: #solid, #dashed, #doubleDashed,
  1002      #dotted, #dashDot or #dashDotDot."
   895      #dotted, #dashDot or #dashDotDot."
  1003 
   896 
  1004     gc == self ifTrue:[
       
  1005 	^ super lineStyle.
       
  1006     ].
       
  1007     ^ gc lineStyle
   897     ^ gc lineStyle
  1008 !
   898 !
  1009 
   899 
  1010 lineStyle:aStyleSymbol
   900 lineStyle:aStyleSymbol
  1011     "set the line-drawing-style;
   901     "set the line-drawing-style;
  1012      possible styles are: #solid, #dashed, #doubleDashed,
   902      possible styles are: #solid, #dashed, #doubleDashed,
  1013      #dotted, #dashDot or #dashDotDot."
   903      #dotted, #dashDot or #dashDotDot."
  1014 
   904 
  1015     gc == self ifTrue:[
       
  1016 	super lineStyle:aStyleSymbol.
       
  1017 	^ self.
       
  1018     ].
       
  1019     gc lineStyle:aStyleSymbol
   905     gc lineStyle:aStyleSymbol
  1020 !
   906 !
  1021 
   907 
  1022 lineWidth
   908 lineWidth
  1023     "return the current drawing linewidth"
   909     "return the current drawing linewidth"
  1024 
   910 
  1025     gc == self ifTrue:[
       
  1026 	^ super lineWidth.
       
  1027     ].
       
  1028     ^ gc lineWidth
   911     ^ gc lineWidth
  1029 !
   912 !
  1030 
   913 
  1031 lineWidth:aNumber
   914 lineWidth:aNumber
  1032     "set the line drawing width in pixels"
   915     "set the line drawing width in pixels"
  1033 
   916 
  1034     gc == self ifTrue:[
       
  1035 	super lineWidth:aNumber.
       
  1036 	^ self.
       
  1037     ].
       
  1038     gc lineWidth:aNumber
   917     gc lineWidth:aNumber
  1039 !
   918 !
  1040 
   919 
  1041 mask
   920 mask
  1042     "return the current drawing mask"
   921     "return the current drawing mask"
  1043 
   922 
  1044     gc == self ifTrue:[
       
  1045 	^ super mask.
       
  1046     ].
       
  1047     ^ gc mask
   923     ^ gc mask
  1048 !
   924 !
  1049 
   925 
  1050 mask:aForm
   926 mask:aForm
  1051     "set the drawing mask"
   927     "set the drawing mask"
  1052 
   928 
  1053     gc == self ifTrue:[
       
  1054 	super mask:aForm.
       
  1055 	^ self.
       
  1056     ].
       
  1057     gc mask:aForm
   929     gc mask:aForm
  1058 !
   930 !
  1059 
   931 
  1060 maskOrigin
   932 maskOrigin
  1061     "return the origin within the mask (used to draw with patterns).
   933     "return the origin within the mask (used to draw with patterns).
  1062      Should be redefined in classes which support it.
   934      Should be redefined in classes which support it.
  1063      This is an alias for ST-80's #phase"
   935      This is an alias for ST-80's #phase"
  1064 
   936 
  1065     gc == self ifTrue:[
       
  1066 	^ super maskOrigin.
       
  1067     ].
       
  1068     ^ gc maskOrigin
   937     ^ gc maskOrigin
  1069 !
   938 !
  1070 
   939 
  1071 maskOrigin:aPoint
   940 maskOrigin:aPoint
  1072     "set the origin within the mask (used to draw with patterns).
   941     "set the origin within the mask (used to draw with patterns).
  1073      Should be redefined in classes which support it.
   942      Should be redefined in classes which support it.
  1074      This is an alias for ST-80's #phase:"
   943      This is an alias for ST-80's #phase:"
  1075 
   944 
  1076     gc == self ifTrue:[
       
  1077 	super maskOrigin:aPoint.
       
  1078 	^ self.
       
  1079     ].
       
  1080     gc maskOrigin:aPoint
   945     gc maskOrigin:aPoint
  1081 !
   946 !
  1082 
   947 
  1083 maskOriginX:x y:y
   948 maskOriginX:x y:y
  1084     "set the origin within the mask (used to draw with patterns).
   949     "set the origin within the mask (used to draw with patterns).
  1089 !
   954 !
  1090 
   955 
  1091 medium
   956 medium
  1092     "return the destination medium i.e. the underlying graphics device"
   957     "return the destination medium i.e. the underlying graphics device"
  1093 
   958 
  1094     gc == self ifTrue:[
       
  1095 	^ super graphicsDevice.
       
  1096     ].
       
  1097     ^ gc graphicsDevice
   959     ^ gc graphicsDevice
  1098 !
   960 !
  1099 
   961 
  1100 noClipByChildren
   962 noClipByChildren
  1101     "drawing shall also be done into subviews"
   963     "drawing shall also be done into subviews"
  1115 !
   977 !
  1116 
   978 
  1117 paint
   979 paint
  1118     "return the current paint drawing color"
   980     "return the current paint drawing color"
  1119 
   981 
  1120     gc == self ifTrue:[
       
  1121 	^ super paint.
       
  1122     ].
       
  1123     ^ gc paint
   982     ^ gc paint
  1124 !
   983 !
  1125 
   984 
  1126 paint:aColor
   985 paint:aColor
  1127     "set the drawing painting color, aColor can be a dithered one"
   986     "set the drawing painting color, aColor can be a dithered one"
  1128 
   987 
  1129     gc == self ifTrue:[
       
  1130 	super paint:aColor.
       
  1131 	^ self.
       
  1132     ].
       
  1133     gc paint:aColor
   988     gc paint:aColor
  1134 !
   989 !
  1135 
   990 
  1136 paint:fgColor on:bgColor
   991 paint:fgColor on:bgColor
  1137     "set the paint and backgroundPaint, used for text and bitmaps.
   992     "set the paint and backgroundPaint, used for text and bitmaps.
  1138      Both colors may be dithered colors"
   993      Both colors may be dithered colors"
  1139 
   994 
  1140     gc == self ifTrue:[
       
  1141 	super paint:fgColor on:bgColor.
       
  1142 	^ self.
       
  1143     ].
       
  1144     gc paint:fgColor on:bgColor
   995     gc paint:fgColor on:bgColor
  1145 !
   996 !
  1146 
   997 
  1147 paint:fgColor on:bgColor function:f
   998 paint:fgColor on:bgColor function:f
  1148     "set paint, background-paint and function"
   999     "set paint, background-paint and function"
  1174 
  1025 
  1175     ^ (self left + width - 1) @ (self top + (height // 2) - 1)
  1026     ^ (self left + width - 1) @ (self top + (height // 2) - 1)
  1176 !
  1027 !
  1177 
  1028 
  1178 setClippingBounds:aRectangleOrNil
  1029 setClippingBounds:aRectangleOrNil
  1179     gc == self ifTrue:[
       
  1180 	super setClippingBounds:aRectangleOrNil.
       
  1181 	^ self.
       
  1182     ].
       
  1183     gc setClippingBounds:aRectangleOrNil
  1030     gc setClippingBounds:aRectangleOrNil
  1184 !
  1031 !
  1185 
  1032 
  1186 setGraphicsExposures:aBoolean
  1033 setGraphicsExposures:aBoolean
  1187     "want to if aBoolean is true - or don't want to be notified
  1034     "want to if aBoolean is true - or don't want to be notified
  1188      of graphics exposures"
  1035      of graphics exposures"
  1189 
  1036 
  1190     gc == self ifTrue:[
       
  1191 	super setGraphicsExposures:aBoolean.
       
  1192 	^ self.
       
  1193     ].
       
  1194     gc setGraphicsExposures:aBoolean
  1037     gc setGraphicsExposures:aBoolean
  1195 !
  1038 !
  1196 
  1039 
  1197 setMaskOrigin:aPoint
  1040 setMaskOrigin:aPoint
  1198     <resource: #obsolete>
  1041     <resource: #obsolete>
  1251     ^ 0@0
  1094     ^ 0@0
  1252 !
  1095 !
  1253 
  1096 
  1254 whiteColor
  1097 whiteColor
  1255     gc isNil ifTrue:[
  1098     gc isNil ifTrue:[
  1256 	^ Color white.
  1099         ^ Color white.
  1257     ].
  1100     ].
  1258     gc == self ifTrue:[
  1101     ^ gc whiteColor
  1259 	^ super graphicsDevice whiteColor.
       
  1260     ].
       
  1261     ^ gc graphicsDevice whiteColor
       
  1262 !
  1102 !
  1263 
  1103 
  1264 width
  1104 width
  1265     "return the width of the receiver"
  1105     "return the width of the receiver"
  1266 
  1106 
  1285 background
  1125 background
  1286     <resource: #obsolete>
  1126     <resource: #obsolete>
  1287     "return the current background drawing color.
  1127     "return the current background drawing color.
  1288      OBSOLETE: use #paint: / #backgroundPaint: / #paint:on:"
  1128      OBSOLETE: use #paint: / #backgroundPaint: / #paint:on:"
  1289 
  1129 
  1290     gc == self ifTrue:[
       
  1291 	^ super background.
       
  1292     ].
       
  1293     ^ gc background
  1130     ^ gc background
  1294 
  1131 
  1295     "Modified: 12.5.1996 / 22:28:09 / cg"
  1132     "Modified: 12.5.1996 / 22:28:09 / cg"
  1296 !
  1133 !
  1297 
  1134 
  1298 background:aColor
  1135 background:aColor
  1299     <resource: #obsolete>
  1136     <resource: #obsolete>
  1300     "set the internal background color for drawing - aColor must be a real color.
  1137     "set the internal background color for drawing - aColor must be a real color.
  1301      OBSOLETE: this method will vanish; use #paint: / #backgroundPaint: / #paint:on:"
  1138      OBSOLETE: this method will vanish; use #paint: / #backgroundPaint: / #paint:on:"
  1302 
  1139 
  1303     gc == self ifTrue:[
       
  1304 	super background:aColor.
       
  1305 	^ self.
       
  1306     ].
       
  1307     gc background:aColor
  1140     gc background:aColor
  1308 !
  1141 !
  1309 
  1142 
  1310 foreground
  1143 foreground
  1311     <resource: #obsolete>
  1144     <resource: #obsolete>
  1312     "return the current foreground drawing color.
  1145     "return the current foreground drawing color.
  1313      OBSOLETE: use #paint: / #paint:on:"
  1146      OBSOLETE: use #paint: / #paint:on:"
  1314 
  1147 
  1315     gc == self ifTrue:[
       
  1316 	^ super foreground.
       
  1317     ].
       
  1318     ^ gc foreground
  1148     ^ gc foreground
  1319 !
  1149 !
  1320 
  1150 
  1321 foreground:aColor
  1151 foreground:aColor
  1322     <resource: #obsolete>
  1152     <resource: #obsolete>
  1323     "set the internal foreground color for drawing - aColor must be a real color.
  1153     "set the internal foreground color for drawing - aColor must be a real color.
  1324      OBSOLETE: this method will vanish; use #paint: / #paint:on:"
  1154      OBSOLETE: this method will vanish; use #paint: / #paint:on:"
  1325 
  1155 
  1326     gc == self ifTrue:[
       
  1327 	super foreground:aColor.
       
  1328 	^ self.
       
  1329     ].
       
  1330     gc foreground:aColor
  1156     gc foreground:aColor
  1331 !
  1157 !
  1332 
  1158 
  1333 foreground:fgColor background:bgColor
  1159 foreground:fgColor background:bgColor
  1334     <resource: #obsolete>
  1160     <resource: #obsolete>
  1335     "set both internal foreground and internal background colors
  1161     "set both internal foreground and internal background colors
  1336      - these must be real colors.
  1162      - these must be real colors.
  1337      OBSOLETE: this method will vanish; use #paint: / #paint:on:"
  1163      OBSOLETE: this method will vanish; use #paint: / #paint:on:"
  1338 
  1164 
  1339     gc == self ifTrue:[
       
  1340 	super foreground:fgColor background:bgColor.
       
  1341 	^ self.
       
  1342     ].
       
  1343     gc foreground:fgColor background:bgColor
  1165     gc foreground:fgColor background:bgColor
  1344 !
  1166 !
  1345 
  1167 
  1346 foreground:fgColor background:bgColor function:fun
  1168 foreground:fgColor background:bgColor function:fun
  1347     <resource: #obsolete>
  1169     <resource: #obsolete>
  1357 foreground:aColor function:fun
  1179 foreground:aColor function:fun
  1358     <resource: #obsolete>
  1180     <resource: #obsolete>
  1359     "set the foreground color and function for drawing.
  1181     "set the foreground color and function for drawing.
  1360      OBSOLETE: this method will vanish; use #paint: / #paint:on:"
  1182      OBSOLETE: this method will vanish; use #paint: / #paint:on:"
  1361 
  1183 
  1362     gc == self ifTrue:[
       
  1363 	super foreground:aColor function:fun.
       
  1364 	^ self.
       
  1365     ].
       
  1366     gc foreground:aColor function:fun
  1184     gc foreground:aColor function:fun
  1367 !
  1185 !
  1368 
  1186 
  1369 setRealized:aBoolean
  1187 setRealized:aBoolean
  1370     "low level special interface to manipulate the realized state.
  1188     "low level special interface to manipulate the realized state.
  1377 !GraphicsMedium methodsFor:'accessing-transformation'!
  1195 !GraphicsMedium methodsFor:'accessing-transformation'!
  1378 
  1196 
  1379 scale
  1197 scale
  1380     "return the scale factor (as point) of the transformation"
  1198     "return the scale factor (as point) of the transformation"
  1381 
  1199 
  1382     gc == self ifTrue:[
       
  1383 	^ super scale.
       
  1384     ].
       
  1385     ^ gc scale
  1200     ^ gc scale
  1386 !
  1201 !
  1387 
  1202 
  1388 scale:aPoint
  1203 scale:aPoint
  1389     "set the scale factor of the transformation"
  1204     "set the scale factor of the transformation"
  1390 
  1205 
  1391     gc == self ifTrue:[
       
  1392 	super scale:aPoint.
       
  1393 	^ self.
       
  1394     ].
       
  1395     ^ gc scale:aPoint
  1206     ^ gc scale:aPoint
  1396 !
  1207 !
  1397 
  1208 
  1398 transformation
  1209 transformation
  1399     "return the transformation"
  1210     "return the transformation"
  1400 
  1211 
  1401     gc == self ifTrue:[
       
  1402 	^ super transformation.
       
  1403     ].
       
  1404     ^ gc transformation
  1212     ^ gc transformation
  1405 !
  1213 !
  1406 
  1214 
  1407 transformation:aTransformation
  1215 transformation:aTransformation
  1408     "set the transformation"
  1216     "set the transformation"
  1409 
  1217 
  1410     gc == self ifTrue:[
       
  1411 	super transformation:aTransformation.
       
  1412 	^ self.
       
  1413     ].
       
  1414     ^ gc transformation:aTransformation
  1218     ^ gc transformation:aTransformation
  1415 !
  1219 !
  1416 
  1220 
  1417 translateBy:aPoint
  1221 translateBy:aPoint
  1418     "add to the translation offset of the transformation"
  1222     "add to the translation offset of the transformation"
  1419 
  1223 
  1420     gc == self ifTrue:[
       
  1421 	super translateBy:aPoint.
       
  1422 	^ self.
       
  1423     ].
       
  1424     ^ gc translateBy:aPoint
  1224     ^ gc translateBy:aPoint
  1425 !
  1225 !
  1426 
  1226 
  1427 translation
  1227 translation
  1428     "return the translation factor (as point) of the transformation"
  1228     "return the translation factor (as point) of the transformation"
  1429 
  1229 
  1430     gc == self ifTrue:[
       
  1431 	^ super translation.
       
  1432     ].
       
  1433     ^ gc translation
  1230     ^ gc translation
  1434 !
  1231 !
  1435 
  1232 
  1436 translation:aPoint
  1233 translation:aPoint
  1437     "set the translation offset of the transformation"
  1234     "set the translation offset of the transformation"
  1438 
  1235 
  1439     gc == self ifTrue:[
       
  1440 	super translation:aPoint.
       
  1441 	^ self.
       
  1442     ].
       
  1443     ^ gc translation:aPoint
  1236     ^ gc translation:aPoint
  1444 ! !
  1237 ! !
  1445 
  1238 
  1446 !GraphicsMedium methodsFor:'basic drawing'!
  1239 !GraphicsMedium methodsFor:'basic drawing'!
  1447 
  1240 
  1448 displayArcX:x y:y width:width height:height from:startAngle angle:angle
  1241 displayArcX:x y:y width:width height:height from:startAngle angle:angle
  1449     "draw an arc in a box
  1242     "draw an arc in a box
  1450      - this could be recoded to draw using displayLine"
  1243      - this could be recoded to draw using displayLine"
  1451 
  1244 
  1452     gc == self ifTrue:[
       
  1453 	super displayArcX:x y:y width:width height:height from:startAngle angle:angle.
       
  1454 	^ self.
       
  1455     ].
       
  1456     gc displayArcX:x y:y width:width height:height from:startAngle angle:angle
  1245     gc displayArcX:x y:y width:width height:height from:startAngle angle:angle
  1457 !
  1246 !
  1458 
  1247 
  1459 displayDottedRectangleX:x y:y width:w height:h
  1248 displayDottedRectangleX:x y:y width:w height:h
  1460     "draw a dotted-line rectangle
  1249     "draw a dotted-line rectangle
  1461      A general implementation is found here; deviceGC's
  1250      A general implementation is found here; deviceGC's
  1462      may reimplement this if directly supported by the device"
  1251      may reimplement this if directly supported by the device"
  1463 
  1252 
  1464     gc == self ifTrue:[
       
  1465 	super displayDottedRectangleX:x y:y width:w height:h.
       
  1466 	^ self.
       
  1467     ].
       
  1468     gc displayDottedRectangleX:x y:y width:w height:h
  1253     gc displayDottedRectangleX:x y:y width:w height:h
  1469 !
  1254 !
  1470 
  1255 
  1471 displayHorizontalWavelineFromX:x0 y:y0 toX:x1
  1256 displayHorizontalWavelineFromX:x0 y:y0 toX:x1
  1472     "draw a horizontal wave-line from x0/y0 to x1/y0"
  1257     "draw a horizontal wave-line from x0/y0 to x1/y0"
  1473 
  1258 
  1474     gc == self ifTrue:[
       
  1475 	super displayHorizontalWavelineFromX:x0 y:y0 toX:x1.
       
  1476 	^ self.
       
  1477     ].
       
  1478     gc displayHorizontalWavelineFromX:x0 y:y0 toX:x1
  1259     gc displayHorizontalWavelineFromX:x0 y:y0 toX:x1
  1479 !
  1260 !
  1480 
  1261 
  1481 displayLineFromX:x0 y:y0 toX:x1 y:y1
  1262 displayLineFromX:x0 y:y0 toX:x1 y:y1
  1482     "draw a line from x0/y0 to x1/y1"
  1263     "draw a line from x0/y0 to x1/y1"
  1483 
  1264 
  1484     gc == self ifTrue:[
       
  1485 	super displayLineFromX:x0 y:y0 toX:x1 y:y1.
       
  1486 	^ self.
       
  1487     ].
       
  1488     gc displayLineFromX:x0 y:y0 toX:x1 y:y1
  1265     gc displayLineFromX:x0 y:y0 toX:x1 y:y1
  1489 !
  1266 !
  1490 
  1267 
  1491 displayOpaqueForm:aForm x:x y:y
  1268 displayOpaqueForm:aForm x:x y:y
  1492     "draw a form at x/y; if the form has depth 1, 1's in the form are
  1269     "draw a form at x/y; if the form has depth 1, 1's in the form are
  1493      drawn in current fg, 0's in current bg color.
  1270      drawn in current fg, 0's in current bg color.
  1494      If the form has depth ~~ 1, it is copied as is onto the receiver"
  1271      If the form has depth ~~ 1, it is copied as is onto the receiver"
  1495 
  1272 
  1496     gc == self ifTrue:[
       
  1497 	super displayOpaqueForm:aForm x:x y:y.
       
  1498 	^ self.
       
  1499     ].
       
  1500     gc displayOpaqueForm:aForm x:x y:y
  1273     gc displayOpaqueForm:aForm x:x y:y
  1501 !
  1274 !
  1502 
  1275 
  1503 displayOpaqueString:aString from:index1 to:index2 x:x y:y
  1276 displayOpaqueString:aString from:index1 to:index2 x:x y:y
  1504     "draw part of a string with both fg and bg at x/y in current font"
  1277     "draw part of a string with both fg and bg at x/y in current font"
  1505 
  1278 
  1506     gc == self ifTrue:[
       
  1507 	super displayString:aString from:index1 to:index2 x:x y:y opaque:true maxWidth:self width.
       
  1508 	^ self.
       
  1509     ].
       
  1510     gc displayString:aString from:index1 to:index2 x:x y:y opaque:true maxWidth:self width
  1279     gc displayString:aString from:index1 to:index2 x:x y:y opaque:true maxWidth:self width
  1511 !
  1280 !
  1512 
  1281 
  1513 displayPolygon:aPolygon
  1282 displayPolygon:aPolygon
  1514     "draw a polygon
  1283     "draw a polygon
  1515      - this could be recoded to draw using displayLine"
  1284      - this could be recoded to draw using displayLine"
  1516 
  1285 
  1517     gc == self ifTrue:[
       
  1518 	super displayPolygon:aPolygon.
       
  1519 	^ self.
       
  1520     ].
       
  1521     gc displayPolygon:aPolygon
  1286     gc displayPolygon:aPolygon
  1522 !
  1287 !
  1523 
  1288 
  1524 displayRectangleX:x y:y width:w height:h
  1289 displayRectangleX:x y:y width:w height:h
  1525     "draw a rectangle
  1290     "draw a rectangle
  1526      - this could be recoded to draw using displayLine"
  1291      - this could be recoded to draw using displayLine"
  1527 
  1292 
  1528     gc == self ifTrue:[
       
  1529 	super displayRectangleX:x y:y width:w height:h.
       
  1530 	^ self.
       
  1531     ].
       
  1532     gc displayRectangleX:x y:y width:w height:h
  1293     gc displayRectangleX:x y:y width:w height:h
  1533 !
  1294 !
  1534 
  1295 
  1535 displayString:aString from:index1 to:index2 x:x y:y
  1296 displayString:aString from:index1 to:index2 x:x y:y
  1536     "draw part of a string with fg at x/y in current font"
  1297     "draw part of a string with fg at x/y in current font"
  1545 !
  1306 !
  1546 
  1307 
  1547 displayString:aString from:index1 to:index2 x:x y:y opaque:opaque maxWidth:maxWidth
  1308 displayString:aString from:index1 to:index2 x:x y:y opaque:opaque maxWidth:maxWidth
  1548     "draw part of a string with both fg and bg at x/y in current font"
  1309     "draw part of a string with both fg and bg at x/y in current font"
  1549 
  1310 
  1550     gc == self ifTrue:[
       
  1551 	super displayString:aString from:index1 to:index2 x:x y:y opaque:opaque maxWidth:maxWidth.
       
  1552 	^ self.
       
  1553     ].
       
  1554     gc displayString:aString from:index1 to:index2 x:x y:y opaque:opaque maxWidth:maxWidth
  1311     gc displayString:aString from:index1 to:index2 x:x y:y opaque:opaque maxWidth:maxWidth
  1555 ! !
  1312 ! !
  1556 
  1313 
  1557 !GraphicsMedium methodsFor:'basic filling'!
  1314 !GraphicsMedium methodsFor:'basic filling'!
  1558 
  1315 
  1559 fillArcX:x y:y width:w height:h from:start angle:angle
  1316 fillArcX:x y:y width:w height:h from:start angle:angle
  1560     "fill an arc with current paint color"
  1317     "fill an arc with current paint color"
  1561 
  1318 
  1562     gc == self ifTrue:[
       
  1563 	super fillArcX:x y:y width:w height:h from:start angle:angle.
       
  1564 	^ self.
       
  1565     ].
       
  1566     gc fillArcX:x y:y width:w height:h from:start angle:angle
  1319     gc fillArcX:x y:y width:w height:h from:start angle:angle
  1567 !
  1320 !
  1568 
  1321 
  1569 fillPolygon:points
  1322 fillPolygon:points
  1570     "fill a polygon with current paint color"
  1323     "fill a polygon with current paint color"
  1571 
  1324 
  1572     gc == self ifTrue:[
       
  1573 	super fillPolygon:points.
       
  1574 	^ self.
       
  1575     ].
       
  1576     gc fillPolygon:points
  1325     gc fillPolygon:points
  1577 !
  1326 !
  1578 
  1327 
  1579 fillRectangleX:x y:y width:w height:h
  1328 fillRectangleX:x y:y width:w height:h
  1580     "fill a rectangle with current paint color"
  1329     "fill a rectangle with current paint color"
  1581 
  1330 
  1582     gc == self ifTrue:[
       
  1583 	super fillRectangleX:x y:y width:w height:h.
       
  1584 	^ self.
       
  1585     ].
       
  1586     gc fillRectangleX:x y:y width:w height:h
  1331     gc fillRectangleX:x y:y width:w height:h
  1587 !
  1332 !
  1588 
  1333 
  1589 fillRectangleX:x y:y width:w height:h color:aColor
  1334 fillRectangleX:x y:y width:w height:h color:aColor
  1590     "fill a rectangle with given color"
  1335     "fill a rectangle with given color"
  1591 
  1336 
  1592     gc == self ifTrue:[
       
  1593 	super fillRectangleX:x y:y width:w height:h color:aColor.
       
  1594 	^ self.
       
  1595     ].
       
  1596     gc fillRectangleX:x y:y width:w height:h color:aColor
  1337     gc fillRectangleX:x y:y width:w height:h color:aColor
  1597 ! !
  1338 ! !
  1598 
  1339 
  1599 !GraphicsMedium methodsFor:'bit blitting'!
  1340 !GraphicsMedium methodsFor:'bit blitting'!
  1600 
  1341 
  1603      The bits found there are supposed to be in the devices native format (i.e.
  1344      The bits found there are supposed to be in the devices native format (i.e.
  1604      translated to allocated color indices on pseudoColor devices and padded as required.
  1345      translated to allocated color indices on pseudoColor devices and padded as required.
  1605      The byteOrder is MSB and will be converted as appropriate by the underlying devices
  1346      The byteOrder is MSB and will be converted as appropriate by the underlying devices
  1606      method to whatever the device needs."
  1347      method to whatever the device needs."
  1607 
  1348 
  1608     gc == self ifTrue:[
       
  1609 	super copyBitsFrom:aByteArray bitsPerPixel:bpp depth:depth padding:pad width:srcW height:srcH x:srcX y:srcY toX:dstX y:dstY.
       
  1610 	^ self.
       
  1611     ].
       
  1612     gc copyBitsFrom:aByteArray bitsPerPixel:bpp depth:depth padding:pad width:srcW height:srcH x:srcX y:srcY toX:dstX y:dstY
  1349     gc copyBitsFrom:aByteArray bitsPerPixel:bpp depth:depth padding:pad width:srcW height:srcH x:srcX y:srcY toX:dstX y:dstY
  1613 !
  1350 !
  1614 
  1351 
  1615 copyBitsFrom:aByteArray bitsPerPixel:bpp depth:depth width:srcW height:srcH x:srcX y:srcY toX:dstX y:dstY
  1352 copyBitsFrom:aByteArray bitsPerPixel:bpp depth:depth width:srcW height:srcH x:srcX y:srcY toX:dstX y:dstY
  1616     "copy bits from a smalltalk byteArray.
  1353     "copy bits from a smalltalk byteArray.
  1618      translated to allocated color indices on pseudoColor devices and padded as required.
  1355      translated to allocated color indices on pseudoColor devices and padded as required.
  1619      The byteOrder is MSB and will be converted as appropriate by the underlying devices
  1356      The byteOrder is MSB and will be converted as appropriate by the underlying devices
  1620      method to whatever the device needs.
  1357      method to whatever the device needs.
  1621      Assumes the source bits are in ST/X's natural padding (i.e. 8-bit padded)"
  1358      Assumes the source bits are in ST/X's natural padding (i.e. 8-bit padded)"
  1622 
  1359 
  1623     gc == self ifTrue:[
       
  1624 	super copyBitsFrom:aByteArray bitsPerPixel:bpp depth:depth width:srcW height:srcH x:srcX y:srcY toX:dstX y:dstY.
       
  1625 	^ self.
       
  1626     ].
       
  1627     gc copyBitsFrom:aByteArray bitsPerPixel:bpp depth:depth width:srcW height:srcH x:srcX y:srcY toX:dstX y:dstY
  1360     gc copyBitsFrom:aByteArray bitsPerPixel:bpp depth:depth width:srcW height:srcH x:srcX y:srcY toX:dstX y:dstY
  1628 !
  1361 !
  1629 
  1362 
  1630 copyFrom:aGC toX:dstX y:dstY
  1363 copyFrom:aGC toX:dstX y:dstY
  1631     "copy from a drawable - maybe self"
  1364     "copy from a drawable - maybe self"
  1632 
  1365 
  1633     gc == self ifTrue:[
       
  1634 	super copyFrom:aGC toX:dstX y:dstY.
       
  1635 	^ self.
       
  1636     ].
       
  1637     gc copyFrom:aGC toX:dstX y:dstY
  1366     gc copyFrom:aGC toX:dstX y:dstY
  1638 !
  1367 !
  1639 
  1368 
  1640 copyFrom:aGC x:srcX y:srcY toX:dstX y:dstY width:w height:h
  1369 copyFrom:aGC x:srcX y:srcY toX:dstX y:dstY width:w height:h
  1641     "copy from a drawable - maybe self"
  1370     "copy from a drawable - maybe self"
  1642 
  1371 
  1643     gc == self ifTrue:[
       
  1644 	super copyFrom:aGC x:srcX y:srcY toX:dstX y:dstY width:w height:h.
       
  1645 	^ self.
       
  1646     ].
       
  1647     gc copyFrom:aGC x:srcX y:srcY toX:dstX y:dstY width:w height:h
  1372     gc copyFrom:aGC x:srcX y:srcY toX:dstX y:dstY width:w height:h
  1648 !
  1373 !
  1649 
  1374 
  1650 copyFrom:aDrawable x:srcX y:srcY toX:dstX y:dstY width:w height:h async:async
  1375 copyFrom:aDrawable x:srcX y:srcY toX:dstX y:dstY width:w height:h async:async
  1651     "copy from aDrawable into the receiver;
  1376     "copy from aDrawable into the receiver;
  1654      If the receiver is a view AND async is true, the call returns immediately
  1379      If the receiver is a view AND async is true, the call returns immediately
  1655      - otherwise, it returns when the scroll operation is finished.
  1380      - otherwise, it returns when the scroll operation is finished.
  1656      (not all devices care for this).
  1381      (not all devices care for this).
  1657      If the receiver is a pixmap, the call always returns immediately."
  1382      If the receiver is a pixmap, the call always returns immediately."
  1658 
  1383 
  1659     |myDevice deviceDrawable asy|
  1384     |deviceDrawable asy|
  1660 
  1385 
  1661     myDevice := gc graphicsDevice.
  1386     ((aDrawable graphicsDevice ~~ device)
  1662 
       
  1663     ((aDrawable graphicsDevice ~~ myDevice)
       
  1664      or:[aDrawable isImage]) ifTrue:[
  1387      or:[aDrawable isImage]) ifTrue:[
  1665 	deviceDrawable := aDrawable asFormOn:myDevice.
  1388         deviceDrawable := aDrawable asFormOn:device.
  1666     ] ifFalse:[
  1389     ] ifFalse:[
  1667 	deviceDrawable := aDrawable
  1390         deviceDrawable := aDrawable
  1668     ].
  1391     ].
  1669     asy := async or:[self isView not].
  1392     asy := async or:[self isView not].
  1670     asy ifFalse:[
  1393     asy ifFalse:[
  1671 	self catchExpose
  1394         self catchExpose
  1672     ].
  1395     ].
  1673     gc == self ifTrue:[
  1396     gc copyFrom:deviceDrawable x:srcX y:srcY toX:dstX y:dstY width:w height:h async:async.
  1674 	super copyFrom:deviceDrawable x:srcX y:srcY toX:dstX y:dstY width:w height:h async:async.
       
  1675     ] ifFalse:[
       
  1676 	gc copyFrom:deviceDrawable x:srcX y:srcY toX:dstX y:dstY width:w height:h async:async.
       
  1677     ].
       
  1678     asy ifFalse:[
  1397     asy ifFalse:[
  1679 	myDevice flush.
  1398         device flush.
  1680 	self waitForExpose
  1399         self waitForExpose
  1681     ]
  1400     ]
  1682 !
  1401 !
  1683 
  1402 
  1684 copyFrom:aGC x:dstX y:dstY width:w height:h
  1403 copyFrom:aGC x:dstX y:dstY width:w height:h
  1685     "copy from a drawable - maybe self"
  1404     "copy from a drawable - maybe self"
  1686 
  1405 
  1687     gc == self ifTrue:[
       
  1688 	super copyFrom:aGC x:dstX y:dstY width:w height:h.
       
  1689 	^ self.
       
  1690     ].
       
  1691     gc copyFrom:aGC x:dstX y:dstY width:w height:h
  1406     gc copyFrom:aGC x:dstX y:dstY width:w height:h
  1692 !
  1407 !
  1693 
  1408 
  1694 copyPlaneFrom:aDrawable x:srcX y:srcY toX:dstX y:dstY width:w height:h
  1409 copyPlaneFrom:aDrawable x:srcX y:srcY toX:dstX y:dstY width:w height:h
  1695     "copy one plane from aDrawable into the receiver. 0's are drawn in
  1410     "copy one plane from aDrawable into the receiver. 0's are drawn in
  1696      background, while 1's are drawn with foreground color.
  1411      background, while 1's are drawn with foreground color.
  1697      The depth of aDrawable must (should) be 1.
  1412      The depth of aDrawable must (should) be 1.
  1698      The drawable must have been allocated on the same device.
  1413      The drawable must have been allocated on the same device.
  1699      All coordinates are in device coordinates."
  1414      All coordinates are in device coordinates."
  1700 
  1415 
  1701     gc == self ifTrue:[
       
  1702 	super copyPlaneFrom:aDrawable x:srcX y:srcY toX:dstX y:dstY width:w height:h.
       
  1703 	^ self.
       
  1704     ].
       
  1705     gc copyPlaneFrom:aDrawable x:srcX y:srcY toX:dstX y:dstY width:w height:h
  1416     gc copyPlaneFrom:aDrawable x:srcX y:srcY toX:dstX y:dstY width:w height:h
  1706 ! !
  1417 ! !
  1707 
  1418 
  1708 !GraphicsMedium methodsFor:'copying'!
  1419 !GraphicsMedium methodsFor:'copying'!
  1709 
  1420 
  1773 !
  1484 !
  1774 
  1485 
  1775 displayCircle:aPoint radius:r
  1486 displayCircle:aPoint radius:r
  1776     "draw a circle around a center point"
  1487     "draw a circle around a center point"
  1777 
  1488 
  1778     gc == self ifTrue:[
       
  1779 	super displayCircleX:(aPoint x) y:(aPoint y) radius:r.
       
  1780 	^ self.
       
  1781     ].
       
  1782     gc displayCircleX:(aPoint x) y:(aPoint y) radius:r
  1489     gc displayCircleX:(aPoint x) y:(aPoint y) radius:r
  1783 !
  1490 !
  1784 
  1491 
  1785 displayCircleIn:aRectangle
  1492 displayCircleIn:aRectangle
  1786     "draw a circle in a box"
  1493     "draw a circle in a box"
  1813 !
  1520 !
  1814 
  1521 
  1815 displayForm:aFormOrImage
  1522 displayForm:aFormOrImage
  1816     "draw a form (or image) at the origin"
  1523     "draw a form (or image) at the origin"
  1817 
  1524 
  1818     gc == self ifTrue:[
       
  1819 	super displayForm:aFormOrImage x:0 y:0.
       
  1820 	^ self.
       
  1821     ].
       
  1822     gc displayForm:aFormOrImage x:0 y:0
  1525     gc displayForm:aFormOrImage x:0 y:0
  1823 
  1526 
  1824     "Modified: / 24.4.1997 / 16:00:11 / cg"
  1527     "Modified: / 24.4.1997 / 16:00:11 / cg"
  1825     "Created: / 9.11.1997 / 00:50:52 / cg"
  1528     "Created: / 9.11.1997 / 00:50:52 / cg"
  1826 !
  1529 !
  1827 
  1530 
  1828 displayForm:aFormOrImage at:aPoint
  1531 displayForm:aFormOrImage at:aPoint
  1829     "draw a form (or image)"
  1532     "draw a form (or image)"
  1830 
  1533 
  1831     gc == self ifTrue:[
       
  1832 	super displayForm:aFormOrImage x:(aPoint x) y:(aPoint y).
       
  1833 	^ self.
       
  1834     ].
       
  1835     gc displayForm:aFormOrImage x:(aPoint x) y:(aPoint y)
  1534     gc displayForm:aFormOrImage x:(aPoint x) y:(aPoint y)
  1836 
  1535 
  1837     "Modified: 24.4.1997 / 16:00:11 / cg"
  1536     "Modified: 24.4.1997 / 16:00:11 / cg"
  1838 !
  1537 !
  1839 
  1538 
  1848      (by sending #on: to the color) before doing so.
  1547      (by sending #on: to the color) before doing so.
  1849      Using functions other than #copy only makes sense if you are
  1548      Using functions other than #copy only makes sense if you are
  1850      certain, that the colors are real colors (actually, only for
  1549      certain, that the colors are real colors (actually, only for
  1851      noColor or allColor)."
  1550      noColor or allColor)."
  1852 
  1551 
  1853     gc == self ifTrue:[
       
  1854 	super displayForm:formToDraw x:x y:y.
       
  1855 	^ self.
       
  1856     ].
       
  1857     gc displayForm:formToDraw x:x y:y
  1552     gc displayForm:formToDraw x:x y:y
  1858 !
  1553 !
  1859 
  1554 
  1860 displayForm:aFormOrImage x:x y:y opaque:opaque
  1555 displayForm:aFormOrImage x:x y:y opaque:opaque
  1861     "draw a form (or image) at x/y;
  1556     "draw a form (or image) at x/y;
  1873 displayImage:aFormOrImage
  1568 displayImage:aFormOrImage
  1874     "draw an image (or form).
  1569     "draw an image (or form).
  1875      Provided for ST-80 compatibilty;
  1570      Provided for ST-80 compatibilty;
  1876      in ST/X, images are also handled by #displayForm:"
  1571      in ST/X, images are also handled by #displayForm:"
  1877 
  1572 
  1878     gc == self ifTrue:[
       
  1879 	super displayForm:aFormOrImage x:0 y:0.
       
  1880 	^ self.
       
  1881     ].
       
  1882     gc displayForm:aFormOrImage x:0 y:0
  1573     gc displayForm:aFormOrImage x:0 y:0
  1883 !
  1574 !
  1884 
  1575 
  1885 displayImage:aFormOrImage at:aPoint
  1576 displayImage:aFormOrImage at:aPoint
  1886     "draw an image (or form).
  1577     "draw an image (or form).
  1887      Provided for ST-80 compatibilty;
  1578      Provided for ST-80 compatibilty;
  1888      in ST/X, images are also handled by #displayForm:"
  1579      in ST/X, images are also handled by #displayForm:"
  1889 
  1580 
  1890     gc == self ifTrue:[
       
  1891 	super displayForm:aFormOrImage x:(aPoint x) y:(aPoint y).
       
  1892 	^ self.
       
  1893     ].
       
  1894     gc displayForm:aFormOrImage x:(aPoint x) y:(aPoint y)
  1581     gc displayForm:aFormOrImage x:(aPoint x) y:(aPoint y)
  1895 
  1582 
  1896     "Modified: 24.4.1997 / 16:02:43 / cg"
  1583     "Modified: 24.4.1997 / 16:02:43 / cg"
  1897 !
  1584 !
  1898 
  1585 
  1899 displayImage:aFormOrImage x:x y:y
  1586 displayImage:aFormOrImage x:x y:y
  1900     "draw an image (or form).
  1587     "draw an image (or form).
  1901      Provided for ST-80 compatibilty;
  1588      Provided for ST-80 compatibilty;
  1902      in ST/X, images are also handled by #displayForm:"
  1589      in ST/X, images are also handled by #displayForm:"
  1903 
  1590 
  1904     gc == self ifTrue:[
       
  1905 	super displayForm:aFormOrImage x:x y:y.
       
  1906 	^ self.
       
  1907     ].
       
  1908     gc displayForm:aFormOrImage x:x y:y
  1591     gc displayForm:aFormOrImage x:x y:y
  1909 
  1592 
  1910     "Created: 24.4.1997 / 16:03:03 / cg"
  1593     "Created: 24.4.1997 / 16:03:03 / cg"
  1911 !
  1594 !
  1912 
  1595 
  1913 displayLineFrom:point1 to:point2
  1596 displayLineFrom:point1 to:point2
  1914     "draw a line"
  1597     "draw a line"
  1915 
  1598 
  1916     gc == self ifTrue:[
       
  1917 	super displayLineFromX:(point1 x) y:(point1 y)
       
  1918 		      toX:(point2 x) y:(point2 y).
       
  1919 	^ self.
       
  1920     ].
       
  1921     gc displayLineFromX:(point1 x) y:(point1 y)
  1599     gc displayLineFromX:(point1 x) y:(point1 y)
  1922 		      toX:(point2 x) y:(point2 y)
  1600                       toX:(point2 x) y:(point2 y)
  1923 !
  1601 !
  1924 
  1602 
  1925 displayLineFromX:xStart y:yStart toX:xEnd y:yEnd brush:aForm
  1603 displayLineFromX:xStart y:yStart toX:xEnd y:yEnd brush:aForm
  1926     "draw a line using a brush.
  1604     "draw a line using a brush.
  1927      Here, a slow fallback is used, drawing into a
  1605      Here, a slow fallback is used, drawing into a
  2012 !
  1690 !
  2013 
  1691 
  2014 displayOpaqueString:aString at:aPoint
  1692 displayOpaqueString:aString at:aPoint
  2015     "draw a string with both fg and bg"
  1693     "draw a string with both fg and bg"
  2016 
  1694 
  2017     gc == self ifTrue:[
       
  2018 	super displayOpaqueString:aString x:(aPoint x) y:(aPoint y).
       
  2019 	^ self.
       
  2020     ].
       
  2021     gc displayOpaqueString:aString x:(aPoint x) y:(aPoint y)
  1695     gc displayOpaqueString:aString x:(aPoint x) y:(aPoint y)
  2022 !
  1696 !
  2023 
  1697 
  2024 displayOpaqueString:aString from:start to:stop at:aPoint
  1698 displayOpaqueString:aString from:start to:stop at:aPoint
  2025     "draw part of a string - drawing both fg and bg"
  1699     "draw part of a string - drawing both fg and bg"
  2032      background pixels in bgPaint color. If the transformation involves scaling,
  1706      background pixels in bgPaint color. If the transformation involves scaling,
  2033      the fonts point-size is scaled as appropriate.
  1707      the fonts point-size is scaled as appropriate.
  2034      Assuming that device can only draw in device colors, we have to handle
  1708      Assuming that device can only draw in device colors, we have to handle
  2035      the case where paint and/or bgPaint are dithered colors or images."
  1709      the case where paint and/or bgPaint are dithered colors or images."
  2036 
  1710 
  2037     gc == self ifTrue:[
       
  2038 	super displayOpaqueString:aString x:x y:y.
       
  2039 	^ self.
       
  2040     ].
       
  2041     gc displayOpaqueString:aString x:x y:y
  1711     gc displayOpaqueString:aString x:x y:y
  2042 !
  1712 !
  2043 
  1713 
  2044 displayOpaqueString:aString x:x y:y angle:drawAngle
  1714 displayOpaqueString:aString x:x y:y angle:drawAngle
  2045     "draw a string along a (possibly non-horizontal) line,
  1715     "draw a string along a (possibly non-horizontal) line,
  2047      The angle is in degrees, clock-wise, starting with 0 for
  1717      The angle is in degrees, clock-wise, starting with 0 for
  2048      a horizontal draw.
  1718      a horizontal draw.
  2049      Drawing is done by first drawing the string into a temporary bitmap,
  1719      Drawing is done by first drawing the string into a temporary bitmap,
  2050      which is rotated and finally drawn as usual.
  1720      which is rotated and finally drawn as usual.
  2051      NOTICE: due to the rotation of the temporary bitmap, this is a slow
  1721      NOTICE: due to the rotation of the temporary bitmap, this is a slow
  2052 	     operation - not to be used with cillions of strings ..."
  1722              operation - not to be used with cillions of strings ..."
  2053 
  1723 
  2054     gc == self ifTrue:[
       
  2055 	super displayString:aString x:x y:y angle:drawAngle opaque:true.
       
  2056 	^ self.
       
  2057     ].
       
  2058     gc displayString:aString x:x y:y angle:drawAngle opaque:true
  1724     gc displayString:aString x:x y:y angle:drawAngle opaque:true
  2059 
  1725 
  2060     "
  1726     "
  2061      |v|
  1727      |v|
  2062 
  1728 
  2063      v := View new.
  1729      v := View new.
  2064      v extent:300@200.
  1730      v extent:300@200.
  2065      v openAndWait.
  1731      v openAndWait.
  2066      0 to:360 by:45 do:[:a |
  1732      0 to:360 by:45 do:[:a |
  2067 	 v paint:Color black on:Color red.
  1733          v paint:Color black on:Color red.
  2068 	 v displayOpaqueString:'hello world' x:100 y:100 angle:a.
  1734          v displayOpaqueString:'hello world' x:100 y:100 angle:a.
  2069      ].
  1735      ].
  2070     "
  1736     "
  2071 
  1737 
  2072     "in contrast to non-opaque draw:
  1738     "in contrast to non-opaque draw:
  2073      |v|
  1739      |v|
  2074 
  1740 
  2075      v := View new.
  1741      v := View new.
  2076      v extent:300@200.
  1742      v extent:300@200.
  2077      v openAndWait.
  1743      v openAndWait.
  2078      0 to:360 by:45 do:[:a |
  1744      0 to:360 by:45 do:[:a |
  2079 	 v paint:Color black on:Color red.
  1745          v paint:Color black on:Color red.
  2080 	 v displayString:'hello world' x:100 y:100 angle:a.
  1746          v displayString:'hello world' x:100 y:100 angle:a.
  2081      ].
  1747      ].
  2082     "
  1748     "
  2083 
  1749 
  2084     "Modified: 23.4.1997 / 17:50:23 / cg"
  1750     "Modified: 23.4.1997 / 17:50:23 / cg"
  2085 !
  1751 !
  2086 
  1752 
  2087 displayPoint:aPoint
  1753 displayPoint:aPoint
  2088     "draw a pixel"
  1754     "draw a pixel"
  2089 
  1755 
  2090     gc == self ifTrue:[
       
  2091 	super displayPointX:(aPoint x) y:(aPoint y).
       
  2092 	^ self.
       
  2093     ].
       
  2094     gc displayPointX:(aPoint x) y:(aPoint y)
  1756     gc displayPointX:(aPoint x) y:(aPoint y)
  2095 !
  1757 !
  2096 
  1758 
  2097 displayPointX:x y:y
  1759 displayPointX:x y:y
  2098     "draw a point (with current paint-color); apply transformation if nonNil"
  1760     "draw a point (with current paint-color); apply transformation if nonNil"
  2099 
  1761 
  2100     gc == self ifTrue:[
       
  2101 	super displayPointX:x y:y.
       
  2102 	^ self.
       
  2103     ].
       
  2104     gc displayPointX:x y:y
  1762     gc displayPointX:x y:y
  2105 !
  1763 !
  2106 
  1764 
  2107 displayRectangle:aRectangle
  1765 displayRectangle:aRectangle
  2108     "draw a rectangle"
  1766     "draw a rectangle"
  2301      The angle is in degrees, clock-wise, starting with 0 for
  1959      The angle is in degrees, clock-wise, starting with 0 for
  2302      a horizontal draw.
  1960      a horizontal draw.
  2303      Drawing is done by first drawing the string into a temporary bitmap,
  1961      Drawing is done by first drawing the string into a temporary bitmap,
  2304      which is rotated and finally drawn as usual.
  1962      which is rotated and finally drawn as usual.
  2305      NOTICE: due to the rotation of the temporary bitmap, this is a slow
  1963      NOTICE: due to the rotation of the temporary bitmap, this is a slow
  2306 	     operation - not to be used with cillions of strings ...
  1964              operation - not to be used with cillions of strings ...
  2307      CAVEAT: if the string is not a real string (i.e. a LabelAndIcon),
  1965      CAVEAT: if the string is not a real string (i.e. a LabelAndIcon),
  2308 	     this can (currently) only be done opaque"
  1966              this can (currently) only be done opaque"
  2309 
  1967 
  2310     gc == self ifTrue:[
       
  2311 	super displayString:aString x:x y:y angle:drawAngle opaque:opaque.
       
  2312 	^ self.
       
  2313     ].
       
  2314     gc displayString:aString x:x y:y angle:drawAngle opaque:opaque
  1968     gc displayString:aString x:x y:y angle:drawAngle opaque:opaque
  2315 !
  1969 !
  2316 
  1970 
  2317 displayUnscaledForm:formToDraw x:x y:y
  1971 displayUnscaledForm:formToDraw x:x y:y
  2318     "draw a form or image non opaque and unscaled;
  1972     "draw a form or image non opaque and unscaled;
  2326      Using functions other than #copy only makes sense if you are
  1980      Using functions other than #copy only makes sense if you are
  2327      certain, that the colors are real colors (actually, only for
  1981      certain, that the colors are real colors (actually, only for
  2328      noColor or allColor).
  1982      noColor or allColor).
  2329      The origins coordinate is transformed, but the image itself is unscaled."
  1983      The origins coordinate is transformed, but the image itself is unscaled."
  2330 
  1984 
  2331     gc == self ifTrue:[
       
  2332 	super displayUnscaledForm:formToDraw x:x y:y.
       
  2333 	^ self.
       
  2334     ].
       
  2335     gc displayUnscaledForm:formToDraw x:x y:y
  1985     gc displayUnscaledForm:formToDraw x:x y:y
  2336 !
  1986 !
  2337 
  1987 
  2338 displayUnscaledOpaqueForm:formToDraw x:x y:y
  1988 displayUnscaledOpaqueForm:formToDraw x:x y:y
  2339     "draw a form or image opaque and unscaled;
  1989     "draw a form or image opaque and unscaled;
  2341      current paint-color, 0 bits in background color.
  1991      current paint-color, 0 bits in background color.
  2342      If its a deep form (i.e. a pixmap) the current paint
  1992      If its a deep form (i.e. a pixmap) the current paint
  2343      settings are ignored and the form is drawn as-is (opaque).
  1993      settings are ignored and the form is drawn as-is (opaque).
  2344      The origins coordinate is transformed, but the image itself is unscaled."
  1994      The origins coordinate is transformed, but the image itself is unscaled."
  2345 
  1995 
  2346     gc == self ifTrue:[
       
  2347 	super displayUnscaledOpaqueForm:formToDraw x:x y:y.
       
  2348 	^ self.
       
  2349     ].
       
  2350     gc displayUnscaledOpaqueForm:formToDraw x:x y:y
  1996     gc displayUnscaledOpaqueForm:formToDraw x:x y:y
  2351 !
  1997 !
  2352 
  1998 
  2353 displayUnscaledOpaqueString:aString from:index1 to:index2 x:x y:y
  1999 displayUnscaledOpaqueString:aString from:index1 to:index2 x:x y:y
  2354     "draw a substring at the transformed coordinate x/y but do not scale the font.
  2000     "draw a substring at the transformed coordinate x/y but do not scale the font.
  2355      Draw foreground pixels in paint-color, background pixels in bgPaint color."
  2001      Draw foreground pixels in paint-color, background pixels in bgPaint color."
  2356 
  2002 
  2357     gc == self ifTrue:[
       
  2358 	super displayUnscaledOpaqueString:aString from:index1 to:index2 x:x y:y.
       
  2359 	^ self.
       
  2360     ].
       
  2361     gc displayUnscaledOpaqueString:aString from:index1 to:index2 x:x y:y
  2003     gc displayUnscaledOpaqueString:aString from:index1 to:index2 x:x y:y
  2362 !
  2004 !
  2363 
  2005 
  2364 displayUnscaledOpaqueString:aString x:x y:y
  2006 displayUnscaledOpaqueString:aString x:x y:y
  2365     "draw a string at the transformed coordinate x/y but do not scale the font.
  2007     "draw a string at the transformed coordinate x/y but do not scale the font.
  2366      Draw foreground pixels in paint-color, background pixels in bgPaint color."
  2008      Draw foreground pixels in paint-color, background pixels in bgPaint color."
  2367 
  2009 
  2368     gc == self ifTrue:[
       
  2369 	super displayUnscaledOpaqueString:aString x:x y:y.
       
  2370 	^ self.
       
  2371     ].
       
  2372     gc displayUnscaledOpaqueString:aString x:x y:y
  2010     gc displayUnscaledOpaqueString:aString x:x y:y
  2373 !
  2011 !
  2374 
  2012 
  2375 displayUnscaledString:aString from:index1 to:index2 x:x y:y
  2013 displayUnscaledString:aString from:index1 to:index2 x:x y:y
  2376     "draw a substring at the transformed coordinate x/y but do not scale the font.
  2014     "draw a substring at the transformed coordinate x/y but do not scale the font.
  2377      draw foreground-pixels only (in current paint-color), leaving background as-is."
  2015      draw foreground-pixels only (in current paint-color), leaving background as-is."
  2378 
  2016 
  2379     gc == self ifTrue:[
       
  2380 	super displayUnscaledString:aString from:index1 to:index2 x:x y:y.
       
  2381 	^ self.
       
  2382     ].
       
  2383     gc displayUnscaledString:aString from:index1 to:index2 x:x y:y
  2017     gc displayUnscaledString:aString from:index1 to:index2 x:x y:y
  2384 !
  2018 !
  2385 
  2019 
  2386 displayUnscaledString:aString x:x y:y
  2020 displayUnscaledString:aString x:x y:y
  2387     "draw a string at the transformed coordinate x/y but do not scale the font.
  2021     "draw a string at the transformed coordinate x/y but do not scale the font.
  2388      draw foreground-pixels only (in current paint-color), leaving background as-is."
  2022      draw foreground-pixels only (in current paint-color), leaving background as-is."
  2389 
  2023 
  2390     gc == self ifTrue:[
       
  2391 	super displayUnscaledString:aString x:x y:y.
       
  2392 	^ self.
       
  2393     ].
       
  2394     gc displayUnscaledString:aString x:x y:y
  2024     gc displayUnscaledString:aString x:x y:y
  2395 ! !
  2025 ! !
  2396 
  2026 
  2397 !GraphicsMedium methodsFor:'drawing in device coordinates'!
  2027 !GraphicsMedium methodsFor:'drawing in device coordinates'!
  2398 
  2028 
  2412      (by sending #on: to the color) before doing so.
  2042      (by sending #on: to the color) before doing so.
  2413      Using functions other than #copy only makes sense if you are
  2043      Using functions other than #copy only makes sense if you are
  2414      certain, that the colors are real colors (actually, only for
  2044      certain, that the colors are real colors (actually, only for
  2415      noColor or allColor)."
  2045      noColor or allColor)."
  2416 
  2046 
  2417     gc == self ifTrue:[
       
  2418 	super displayDeviceForm:aForm x:x y:y.
       
  2419 	^ self.
       
  2420     ].
       
  2421     gc displayDeviceForm:aForm x:x y:y
  2047     gc displayDeviceForm:aForm x:x y:y
  2422 !
  2048 !
  2423 
  2049 
  2424 displayDeviceLineFromX:x1 y:y1 toX:x2 y:y2
  2050 displayDeviceLineFromX:x1 y:y1 toX:x2 y:y2
  2425     "draw a line in device coordinates"
  2051     "draw a line in device coordinates"
  2426 
  2052 
  2427     gc == self ifTrue:[
       
  2428 	super displayDeviceLineFromX:x1 y:y1 toX:x2 y:y2.
       
  2429 	^ self.
       
  2430     ].
       
  2431     gc displayDeviceLineFromX:x1 y:y1 toX:x2 y:y2
  2053     gc displayDeviceLineFromX:x1 y:y1 toX:x2 y:y2
  2432 !
  2054 !
  2433 
  2055 
  2434 displayDeviceOpaqueForm:aForm x:x y:y
  2056 displayDeviceOpaqueForm:aForm x:x y:y
  2435     "draw a form or image opaque (i.e. both fg and bg is drawn);
  2057     "draw a form or image opaque (i.e. both fg and bg is drawn);
  2443      to the colors) before doing so.
  2065      to the colors) before doing so.
  2444      The form should have been allocated on the same device; otherwise,
  2066      The form should have been allocated on the same device; otherwise,
  2445      its converted here, which slows down the draw.
  2067      its converted here, which slows down the draw.
  2446      Drawing is in device coordinates; no scaling is done."
  2068      Drawing is in device coordinates; no scaling is done."
  2447 
  2069 
  2448     gc == self ifTrue:[
       
  2449 	super displayDeviceOpaqueForm:aForm x:x y:y.
       
  2450 	^ self.
       
  2451     ].
       
  2452     gc displayDeviceOpaqueForm:aForm x:x y:y
  2070     gc displayDeviceOpaqueForm:aForm x:x y:y
  2453 !
  2071 !
  2454 
  2072 
  2455 displayDeviceOpaqueString:aString from:index1 to:index2 x:x y:y
  2073 displayDeviceOpaqueString:aString from:index1 to:index2 x:x y:y
  2456     "draw a substring at the coordinate x/y - draw foreground pixels in
  2074     "draw a substring at the coordinate x/y - draw foreground pixels in
  2471 !
  2089 !
  2472 
  2090 
  2473 displayDeviceRectangleX:x y:y width:w height:h
  2091 displayDeviceRectangleX:x y:y width:w height:h
  2474     "draw a rectangle in device coordinates"
  2092     "draw a rectangle in device coordinates"
  2475 
  2093 
  2476     gc == self ifTrue:[
       
  2477 	super displayDeviceRectangleX:x y:y width:w height:h.
       
  2478 	^ self.
       
  2479     ].
       
  2480     gc displayDeviceRectangleX:x y:y width:w height:h
  2094     gc displayDeviceRectangleX:x y:y width:w height:h
  2481 !
  2095 !
  2482 
  2096 
  2483 displayDeviceString:aString from:index1 to:index2 in:font x:x y:y
  2097 displayDeviceString:aString from:index1 to:index2 in:font x:x y:y
  2484     "draw a substring at the coordinate x/y -
  2098     "draw a substring at the coordinate x/y -
  2485      draw foreground-pixels only (in current paint-color), leaving background as-is.
  2099      draw foreground-pixels only (in current paint-color), leaving background as-is.
  2486      No translation or scaling is done"
  2100      No translation or scaling is done"
  2487 
  2101 
  2488     gc == self ifTrue:[
       
  2489 	super displayDeviceString:aString from:index1 to:index2 in:font x:x y:y.
       
  2490 	^ self.
       
  2491     ].
       
  2492     gc displayDeviceString:aString from:index1 to:index2 in:font x:x y:y
  2102     gc displayDeviceString:aString from:index1 to:index2 in:font x:x y:y
  2493 !
  2103 !
  2494 
  2104 
  2495 displayDeviceString:aString from:index1 to:index2 x:x y:y
  2105 displayDeviceString:aString from:index1 to:index2 x:x y:y
  2496     "draw a substring at the coordinate x/y -
  2106     "draw a substring at the coordinate x/y -
  2509 !
  2119 !
  2510 
  2120 
  2511 fillDeviceRectangleX:x y:y width:w height:h
  2121 fillDeviceRectangleX:x y:y width:w height:h
  2512     "fill a rectangle with current paint color (device coordinates)"
  2122     "fill a rectangle with current paint color (device coordinates)"
  2513 
  2123 
  2514     gc == self ifTrue:[
       
  2515 	super fillDeviceRectangleX:x y:y width:w height:h.
       
  2516 	^ self.
       
  2517     ].
       
  2518     gc fillDeviceRectangleX:x y:y width:w height:h
  2124     gc fillDeviceRectangleX:x y:y width:w height:h
  2519 ! !
  2125 ! !
  2520 
  2126 
  2521 !GraphicsMedium methodsFor:'edge drawing'!
  2127 !GraphicsMedium methodsFor:'edge drawing'!
  2522 
  2128 
  2657 
  2263 
  2658 reverseDo:aBlock
  2264 reverseDo:aBlock
  2659     "evaluate aBlock with foreground and background interchanged.
  2265     "evaluate aBlock with foreground and background interchanged.
  2660      This can be reimplemented here in a faster way."
  2266      This can be reimplemented here in a faster way."
  2661 
  2267 
  2662     gc == self ifTrue:[
       
  2663 	super reverseDo:aBlock.
       
  2664 	^ self.
       
  2665     ].
       
  2666     gc reverseDo:aBlock
  2268     gc reverseDo:aBlock
  2667 !
  2269 !
  2668 
  2270 
  2669 withBackground:fgColor do:aBlock
  2271 withBackground:fgColor do:aBlock
  2670     "evaluate aBlock with changed background."
  2272     "evaluate aBlock with changed background."
  2671 
  2273 
  2672     gc == self ifTrue:[
       
  2673 	super withBackground:fgColor do:aBlock.
       
  2674 	^ self.
       
  2675     ].
       
  2676     gc withBackground:fgColor do:aBlock
  2274     gc withBackground:fgColor do:aBlock
  2677 !
  2275 !
  2678 
  2276 
  2679 withForeground:fgColor background:bgColor do:aBlock
  2277 withForeground:fgColor background:bgColor do:aBlock
  2680     "evaluate aBlock with changed foreground and background."
  2278     "evaluate aBlock with changed foreground and background."
  2681 
  2279 
  2682     gc == self ifTrue:[
       
  2683 	super withForeground:fgColor background:bgColor do:aBlock.
       
  2684 	^ self.
       
  2685     ].
       
  2686     gc withForeground:fgColor background:bgColor do:aBlock
  2280     gc withForeground:fgColor background:bgColor do:aBlock
  2687 !
  2281 !
  2688 
  2282 
  2689 withForeground:fgColor background:bgColor function:aFunction do:aBlock
  2283 withForeground:fgColor background:bgColor function:aFunction do:aBlock
  2690     "evaluate aBlock with foreground, background and function"
  2284     "evaluate aBlock with foreground, background and function"
  2691 
  2285 
  2692     gc == self ifTrue:[
       
  2693 	super withForeground:fgColor background:bgColor function:aFunction do:aBlock.
       
  2694 	^ self.
       
  2695     ].
       
  2696     gc withForeground:fgColor background:bgColor function:aFunction do:aBlock
  2286     gc withForeground:fgColor background:bgColor function:aFunction do:aBlock
  2697 !
  2287 !
  2698 
  2288 
  2699 withForeground:fgColor background:bgColor mask:aMask do:aBlock
  2289 withForeground:fgColor background:bgColor mask:aMask do:aBlock
  2700     "evaluate aBlock with foreground, background and mask"
  2290     "evaluate aBlock with foreground, background and mask"
  2701 
  2291 
  2702     gc == self ifTrue:[
       
  2703 	super withForeground:fgColor background:bgColor mask:aMask do:aBlock.
       
  2704 	^ self.
       
  2705     ].
       
  2706     gc withForeground:fgColor background:bgColor mask:aMask do:aBlock
  2292     gc withForeground:fgColor background:bgColor mask:aMask do:aBlock
  2707 !
  2293 !
  2708 
  2294 
  2709 withForeground:fgColor do:aBlock
  2295 withForeground:fgColor do:aBlock
  2710     "evaluate aBlock with changed foreground."
  2296     "evaluate aBlock with changed foreground."
  2711 
  2297 
  2712     gc == self ifTrue:[
       
  2713 	super withForeground:fgColor do:aBlock.
       
  2714 	^ self.
       
  2715     ].
       
  2716     gc withForeground:fgColor do:aBlock
  2298     gc withForeground:fgColor do:aBlock
  2717 !
  2299 !
  2718 
  2300 
  2719 withForeground:fgColor function:aFunction do:aBlock
  2301 withForeground:fgColor function:aFunction do:aBlock
  2720     "evaluate aBlock with changed foreground and function."
  2302     "evaluate aBlock with changed foreground and function."
  2721 
  2303 
  2722     gc == self ifTrue:[
       
  2723 	super withForeground:fgColor function:aFunction do:aBlock.
       
  2724 	^ self.
       
  2725     ].
       
  2726     gc withForeground:fgColor function:aFunction do:aBlock
  2304     gc withForeground:fgColor function:aFunction do:aBlock
  2727 !
  2305 !
  2728 
  2306 
  2729 xoring:aBlock
  2307 xoring:aBlock
  2730     "evaluate aBlock with function xoring"
  2308     "evaluate aBlock with function xoring"
  2731 
  2309 
  2732     gc == self ifTrue:[
       
  2733 	super xoring:aBlock.
       
  2734 	^ self.
       
  2735     ].
       
  2736     gc xoring:aBlock
  2310     gc xoring:aBlock
  2737 ! !
  2311 ! !
  2738 
  2312 
  2739 !GraphicsMedium methodsFor:'filling'!
  2313 !GraphicsMedium methodsFor:'filling'!
  2740 
  2314 
  2788 
  2362 
  2789 fill:something
  2363 fill:something
  2790     "fill the receiver with something;
  2364     "fill the receiver with something;
  2791      something may be a Form, Color or colorIndex"
  2365      something may be a Form, Color or colorIndex"
  2792 
  2366 
  2793     |oldPaint|
  2367     gc fillRectangle:self boundingBox color:something
  2794 
       
  2795     oldPaint := self paint.
       
  2796     self paint:something.
       
  2797     self fillRectangleX:0 y:0 width:width height:height.
       
  2798     self paint:oldPaint
       
  2799 
       
  2800     "Modified: 28.5.1996 / 20:13:29 / cg"
       
  2801 !
  2368 !
  2802 
  2369 
  2803 fillArc:origin radius:r from:startAngle angle:angle
  2370 fillArc:origin radius:r from:startAngle angle:angle
  2804     "draw a filled arc around a point"
  2371     "draw a filled arc around a point"
  2805 
  2372 
  3016 !
  2583 !
  3017 
  2584 
  3018 white
  2585 white
  3019     "fill the receiver with white"
  2586     "fill the receiver with white"
  3020 
  2587 
  3021     self fill:Color white
  2588     self fill:self whiteColor
  3022 ! !
  2589 ! !
  3023 
  2590 
  3024 !GraphicsMedium methodsFor:'initialization & release'!
  2591 !GraphicsMedium methodsFor:'initialization & release'!
  3025 
  2592 
  3026 close
  2593 close
  3043 initGC
  2610 initGC
  3044     "since we do not need a gc-object for the drawable until something is
  2611     "since we do not need a gc-object for the drawable until something is
  3045      really drawn, none is created.
  2612      really drawn, none is created.
  3046      This method is sent, when the first drawing happens"
  2613      This method is sent, when the first drawing happens"
  3047 
  2614 
  3048     gc == self ifTrue:[
       
  3049 	super initGC.
       
  3050 	^ self.
       
  3051     ].
       
  3052     gc initGC
  2615     gc initGC
  3053 !
  2616 !
  3054 
  2617 
  3055 initialize
  2618 initialize
  3056     super initialize.
  2619     super initialize.
  3087 
  2650 
  3088 releaseGC
  2651 releaseGC
  3089     "destroy the associated device GC resource - can be done to be nice to the
  2652     "destroy the associated device GC resource - can be done to be nice to the
  3090      display if you know that you are done with a drawable."
  2653      display if you know that you are done with a drawable."
  3091 
  2654 
  3092     gc == self ifTrue:[
       
  3093 	super releaseGC.
       
  3094 	^ self.
       
  3095     ].
       
  3096     gc notNil ifTrue:[
  2655     gc notNil ifTrue:[
  3097 	gc releaseGC.
  2656         gc releaseGC.
  3098     ].
  2657     ].
  3099 ! !
  2658 ! !
  3100 
  2659 
  3101 !GraphicsMedium methodsFor:'misc'!
  2660 !GraphicsMedium methodsFor:'misc'!
  3102 
  2661 
  3113 !
  2672 !
  3114 
  2673 
  3115 flush
  2674 flush
  3116     "send all buffered drawing to the device."
  2675     "send all buffered drawing to the device."
  3117 
  2676 
  3118     gc == self ifTrue:[
       
  3119 	super flush.
       
  3120 	^ self.
       
  3121     ].
       
  3122     gc flush
  2677     gc flush
  3123 !
  2678 !
  3124 
  2679 
  3125 setDevice:aDevice id:aDrawbleId gcId:aGCId
  2680 setDevice:aDevice id:aDrawbleId gcId:aGCId
  3126     "private"
  2681     "private"
  3127 
  2682 
  3128     gc == self ifTrue:[
       
  3129 	super setDevice:aDevice id:aDrawbleId gcId:aGCId.
       
  3130 	^ self.
       
  3131     ].
       
  3132     gc notNil ifTrue:[
  2683     gc notNil ifTrue:[
  3133 	gc setDevice:aDevice id:aDrawbleId gcId:aGCId
  2684         gc setDevice:aDevice id:aDrawbleId gcId:aGCId
  3134     ].
  2685     ].
  3135 !
  2686 !
  3136 
  2687 
  3137 setId:aDrawableId
  2688 setId:aDrawableId
  3138     "private"
  2689     "private"
  3139 
  2690 
  3140     gc == self ifTrue:[
       
  3141 	super setId:aDrawableId.
       
  3142 	^ self.
       
  3143     ].
       
  3144     gc setId:aDrawableId
  2691     gc setId:aDrawableId
  3145 !
  2692 !
  3146 
  2693 
  3147 setPaint:fgColor on:bgColor
  2694 setPaint:fgColor on:bgColor
  3148     "set the paint and background-paint color.
  2695     "set the paint and background-paint color.
  3149      The bg-paint is used in opaque-draw operations.
  2696      The bg-paint is used in opaque-draw operations.
  3150      Only set the variables, but do not send it to the device,
  2697      Only set the variables, but do not send it to the device,
  3151      Used on initialization."
  2698      Used on initialization."
  3152 
  2699 
  3153     gc == self ifTrue:[
       
  3154 	super setPaint:fgColor on:bgColor.
       
  3155 	^ self.
       
  3156     ].
       
  3157     gc setPaint:fgColor on:bgColor
  2700     gc setPaint:fgColor on:bgColor
  3158 !
  2701 !
  3159 
  2702 
  3160 sync
  2703 sync
  3161     "send all buffered drawing to the device and wait until the device responds"
  2704     "send all buffered drawing to the device and wait until the device responds"
  3162 
  2705 
  3163     gc == self ifTrue:[
       
  3164 	super sync.
       
  3165 	^ self.
       
  3166     ].
       
  3167     gc sync
  2706     gc sync
  3168 ! !
  2707 ! !
  3169 
  2708 
  3170 !GraphicsMedium methodsFor:'printing & storing'!
  2709 !GraphicsMedium methodsFor:'printing & storing'!
  3171 
  2710 
  3180 !GraphicsMedium methodsFor:'queries'!
  2719 !GraphicsMedium methodsFor:'queries'!
  3181 
  2720 
  3182 fontAscent
  2721 fontAscent
  3183     "answer the ascent of the current font on the current device"
  2722     "answer the ascent of the current font on the current device"
  3184 
  2723 
  3185     gc == self ifTrue:[
       
  3186 	^ super fontAscent.
       
  3187     ].
       
  3188     ^ gc fontAscent
  2724     ^ gc fontAscent
  3189 !
  2725 !
  3190 
  2726 
  3191 horizontalIntegerPixelPerMillimeter
  2727 horizontalIntegerPixelPerMillimeter
  3192     "return the (rounded) number of pixels per millimeter"
  2728     "return the (rounded) number of pixels per millimeter"
  3201 !
  2737 !
  3202 
  2738 
  3203 horizontalPixelPerMillimeter
  2739 horizontalPixelPerMillimeter
  3204     "return the number of pixels per millimeter (not rounded)"
  2740     "return the number of pixels per millimeter (not rounded)"
  3205 
  2741 
  3206     gc == self ifTrue:[
       
  3207 	^ super horizontalPixelPerMillimeter.
       
  3208     ].
       
  3209     ^ gc horizontalPixelPerMillimeter
  2742     ^ gc horizontalPixelPerMillimeter
  3210 !
  2743 !
  3211 
  2744 
  3212 horizontalPixelPerMillimeter:millis
  2745 horizontalPixelPerMillimeter:millis
  3213     "return the number of pixels (not rounded) for millis millimeter"
  2746     "return the number of pixels (not rounded) for millis millimeter"
  3216 !
  2749 !
  3217 
  2750 
  3218 resolution
  2751 resolution
  3219     "return a point consisting of pixel-per-inch horizontally and vertically."
  2752     "return a point consisting of pixel-per-inch horizontally and vertically."
  3220 
  2753 
  3221     gc == self ifTrue:[
       
  3222 	^ super resolution.
       
  3223     ].
       
  3224     ^ gc resolution
  2754     ^ gc resolution
  3225 !
  2755 !
  3226 
  2756 
  3227 verticalIntegerPixelPerMillimeter
  2757 verticalIntegerPixelPerMillimeter
  3228     "return the (rounded) number of pixels per millimeter"
  2758     "return the (rounded) number of pixels per millimeter"
  3237 !
  2767 !
  3238 
  2768 
  3239 verticalPixelPerMillimeter
  2769 verticalPixelPerMillimeter
  3240     "return the number of pixels per millimeter (not rounded)"
  2770     "return the number of pixels per millimeter (not rounded)"
  3241 
  2771 
  3242     gc == self ifTrue:[
       
  3243 	^ super verticalPixelPerMillimeter.
       
  3244     ].
       
  3245     ^ gc verticalPixelPerMillimeter
  2772     ^ gc verticalPixelPerMillimeter
  3246 !
  2773 !
  3247 
  2774 
  3248 verticalPixelPerMillimeter:millis
  2775 verticalPixelPerMillimeter:millis
  3249     "return the number of pixels (not rounded) for millis millimeter"
  2776     "return the number of pixels (not rounded) for millis millimeter"
  3254 !GraphicsMedium methodsFor:'view creation'!
  2781 !GraphicsMedium methodsFor:'view creation'!
  3255 
  2782 
  3256 createBitmapFromArray:data width:width height:height
  2783 createBitmapFromArray:data width:width height:height
  3257     "create a bitmap from data and set the drawableId"
  2784     "create a bitmap from data and set the drawableId"
  3258 
  2785 
  3259     gc == self ifTrue:[
       
  3260 	super createBitmapFromArray:data width:width height:height.
       
  3261 	^ self.
       
  3262     ].
       
  3263     gc createBitmapFromArray:data width:width height:height
  2786     gc createBitmapFromArray:data width:width height:height
  3264 !
  2787 !
  3265 
  2788 
  3266 createPixmapWidth:w height:h depth:d
  2789 createPixmapWidth:w height:h depth:d
  3267     "create a pixmap and set the drawableId"
  2790     "create a pixmap and set the drawableId"
  3268 
  2791 
  3269     gc == self ifTrue:[
       
  3270 	super createPixmapWidth:w height:h depth:d.
       
  3271 	^ self.
       
  3272     ].
       
  3273     gc createPixmapWidth:w height:h depth:d
  2792     gc createPixmapWidth:w height:h depth:d
  3274 !
  2793 !
  3275 
  2794 
  3276 createRootWindow
  2795 createRootWindow
  3277     gc == self ifTrue:[
       
  3278 	super createRootWindowFor:self.
       
  3279 	^ self.
       
  3280     ].
       
  3281     gc createRootWindowFor:self
  2796     gc createRootWindowFor:self
  3282 !
  2797 !
  3283 
  2798 
  3284 createWindowFor:aView type:typeSymbol origin:org extent:ext minExtent:minE maxExtent:maxE borderWidth:bw subViewOf:sv style:styleSymbol inputOnly:inp label:label owner:owner icon:icn iconMask:icnM iconView:icnV
  2799 createWindowFor:aView type:typeSymbol origin:org extent:ext minExtent:minE maxExtent:maxE borderWidth:bw subViewOf:sv style:styleSymbol inputOnly:inp label:label owner:owner icon:icn iconMask:icnM iconView:icnV
  3285     "create a window and set the drawableId"
  2800     "create a window and set the drawableId"
  3286 
  2801 
  3287     gc == self ifTrue:[
       
  3288 	super createWindowFor:aView type:typeSymbol origin:org extent:ext minExtent:minE maxExtent:maxE borderWidth:bw subViewOf:sv style:styleSymbol inputOnly:inp label:label owner:owner icon:icn iconMask:icnM iconView:icnV.
       
  3289 	^ self.
       
  3290     ].
       
  3291     gc createWindowFor:aView type:typeSymbol origin:org extent:ext minExtent:minE maxExtent:maxE borderWidth:bw subViewOf:sv style:styleSymbol inputOnly:inp label:label owner:owner icon:icn iconMask:icnM iconView:icnV
  2802     gc createWindowFor:aView type:typeSymbol origin:org extent:ext minExtent:minE maxExtent:maxE borderWidth:bw subViewOf:sv style:styleSymbol inputOnly:inp label:label owner:owner icon:icn iconMask:icnM iconView:icnV
  3292 ! !
  2803 ! !
  3293 
  2804 
  3294 !GraphicsMedium class methodsFor:'documentation'!
  2805 !GraphicsMedium class methodsFor:'documentation'!
  3295 
  2806