DeviceGraphicsContext.st
changeset 6266 1503c5e038d2
parent 6235 7cdc094296b2
child 6271 15254eaf8d5f
equal deleted inserted replaced
6265:3f9d9dacedcc 6266:1503c5e038d2
   886     self function:f
   886     self function:f
   887 
   887 
   888     "Modified: 16.5.1996 / 15:36:35 / cg"
   888     "Modified: 16.5.1996 / 15:36:35 / cg"
   889 !
   889 !
   890 
   890 
       
   891 setClippingBounds:aRectangleOrNil
       
   892     "set the clipping rectangle for drawing (in physical coordinates.
       
   893      Only set the variable, do not change the gc"
       
   894 
       
   895     clipRect := aRectangleOrNil
       
   896 !
       
   897 
   891 setGraphicsExposures:aBoolean
   898 setGraphicsExposures:aBoolean
   892     "want to if aBoolean is true - or dont want to be notified
   899     "want to if aBoolean is true - or dont want to be notified
   893      of graphics exposures"
   900      of graphics exposures"
   894 
   901 
   895     gcId notNil ifTrue:[
   902     gcId notNil ifTrue:[
   896 	device setGraphicsExposures:aBoolean in:gcId
   903 	device setGraphicsExposures:aBoolean in:gcId
   897     ]
   904     ]
       
   905 !
       
   906 
       
   907 setPaint:fgColor on:bgColor
       
   908     "set the paint and background-paint color. 
       
   909      The bg-paint is used in opaque-draw operations.
       
   910      Only set the variables, but do not send it to the device,
       
   911      Used on initialization."
       
   912 
       
   913     fgColor notNil ifTrue:[
       
   914         foreground := paint := fgColor
       
   915     ].
       
   916     bgColor notNil ifTrue:[
       
   917         background := bgPaint := bgColor
       
   918     ].
   898 ! !
   919 ! !
   899 
   920 
   900 !DeviceGraphicsContext methodsFor:'accessing-internals'!
   921 !DeviceGraphicsContext methodsFor:'accessing-internals'!
   901 
   922 
   902 background
   923 background
       
   924     <resource: #obsolete>
   903     "return the current background drawing color.
   925     "return the current background drawing color.
   904      OBSOLETE: use #paint: / #backgroundPaint: / #paint:on:"
   926      OBSOLETE: use #paint: / #backgroundPaint: / #paint:on:"
   905 
   927 
   906     ^ background
   928     ^ background
   907 
   929 
   908     "Modified: 12.5.1996 / 22:28:09 / cg"
   930     "Modified: 12.5.1996 / 22:28:09 / cg"
   909 !
   931 !
   910 
   932 
   911 background:aColor
   933 background:aColor
       
   934     <resource: #obsolete>
   912     "set the internal background color for drawing - aColor must be a real color.
   935     "set the internal background color for drawing - aColor must be a real color.
   913      OBSOLETE: this method will vanish; use #paint: / #backgroundPaint: / #paint:on:"
   936      OBSOLETE: this method will vanish; use #paint: / #backgroundPaint: / #paint:on:"
   914 
   937 
   915     |bgId|
   938     |bgId|
   916 
   939 
   938 
   961 
   939     "Modified: 28.5.1996 / 20:44:55 / cg"
   962     "Modified: 28.5.1996 / 20:44:55 / cg"
   940 !
   963 !
   941 
   964 
   942 foreground
   965 foreground
       
   966     <resource: #obsolete>
   943     "return the current foreground drawing color.
   967     "return the current foreground drawing color.
   944      OBSOLETE: use #paint: / #paint:on:"
   968      OBSOLETE: use #paint: / #paint:on:"
   945 
   969 
   946     ^ foreground
   970     ^ foreground
   947 
   971 
   948     "Modified: 12.5.1996 / 22:28:03 / cg"
   972     "Modified: 12.5.1996 / 22:28:03 / cg"
   949 !
   973 !
   950 
   974 
   951 foreground:aColor
   975 foreground:aColor
       
   976     <resource: #obsolete>
   952     "set the internal foreground color for drawing - aColor must be a real color.
   977     "set the internal foreground color for drawing - aColor must be a real color.
   953      OBSOLETE: this method will vanish; use #paint: / #paint:on:"
   978      OBSOLETE: this method will vanish; use #paint: / #paint:on:"
   954 
   979 
   955     |fgId|
   980     |fgId|
   956 
   981 
   981 
  1006 
   982     "Modified: 28.5.1996 / 20:45:02 / cg"
  1007     "Modified: 28.5.1996 / 20:45:02 / cg"
   983 !
  1008 !
   984 
  1009 
   985 foreground:fgColor background:bgColor
  1010 foreground:fgColor background:bgColor
       
  1011     <resource: #obsolete>
   986     "set both internal foreground and internal background colors 
  1012     "set both internal foreground and internal background colors 
   987      - these must be real colors.
  1013      - these must be real colors.
   988      OBSOLETE: this method will vanish; use #paint: / #paint:on:"
  1014      OBSOLETE: this method will vanish; use #paint: / #paint:on:"
   989 
  1015 
   990     |fgPixel bgPixel|
  1016     |fgPixel bgPixel|
  1024 
  1050 
  1025     "Modified: 28.5.1996 / 20:45:27 / cg"
  1051     "Modified: 28.5.1996 / 20:45:27 / cg"
  1026 !
  1052 !
  1027 
  1053 
  1028 foreground:fgColor background:bgColor function:fun
  1054 foreground:fgColor background:bgColor function:fun
       
  1055     <resource: #obsolete>
  1029     "set foreground, background colors and function.
  1056     "set foreground, background colors and function.
  1030      OBSOLETE: this method will vanish; use #paint: / #paint:on:"
  1057      OBSOLETE: this method will vanish; use #paint: / #paint:on:"
  1031 
  1058 
  1032     self foreground:fgColor background:bgColor.
  1059     self foreground:fgColor background:bgColor.
  1033     self function:fun
  1060     self function:fun
  1034 
  1061 
  1035     "Modified: 12.5.1996 / 22:28:34 / cg"
  1062     "Modified: 12.5.1996 / 22:28:34 / cg"
  1036 !
  1063 !
  1037 
  1064 
  1038 foreground:aColor function:fun
  1065 foreground:aColor function:fun
       
  1066     <resource: #obsolete>
  1039     "set the foreground color and function for drawing.
  1067     "set the foreground color and function for drawing.
  1040      OBSOLETE: this method will vanish; use #paint: / #paint:on:"
  1068      OBSOLETE: this method will vanish; use #paint: / #paint:on:"
  1041 
  1069 
  1042     |fgPixel|
  1070     |fgPixel|
  1043 
  1071 
  3561     id := gcId.
  3589     id := gcId.
  3562     id notNil ifTrue:[
  3590     id notNil ifTrue:[
  3563         gcId := nil.
  3591         gcId := nil.
  3564         device destroyGC:id.
  3592         device destroyGC:id.
  3565     ].
  3593     ].
       
  3594 !
       
  3595 
       
  3596 destroyPixmap
       
  3597     "physically destroy the pixmap."
       
  3598 
       
  3599     |id|
       
  3600 
       
  3601     (id := drawableId) notNil ifTrue:[
       
  3602         drawableId := nil.
       
  3603         device destroyPixmap:id.
       
  3604     ].
       
  3605     Lobby unregister:self.
       
  3606 !
       
  3607 
       
  3608 destroyView
       
  3609     "physically destroy the view."
       
  3610 
       
  3611     |id|
       
  3612 
  3566     (id := drawableId) notNil ifTrue:[
  3613     (id := drawableId) notNil ifTrue:[
  3567         drawableId := nil.
  3614         drawableId := nil.
  3568         device destroyView:self withId:id.
  3615         device destroyView:self withId:id.
  3569     ].
  3616     ].
  3570     Lobby unregister:self.
  3617     Lobby unregister:self.
  4036 ! !
  4083 ! !
  4037 
  4084 
  4038 !DeviceGraphicsContext class methodsFor:'documentation'!
  4085 !DeviceGraphicsContext class methodsFor:'documentation'!
  4039 
  4086 
  4040 version
  4087 version
  4041     ^ '$Header: /cvs/stx/stx/libview/DeviceGraphicsContext.st,v 1.132 2014-02-04 15:53:01 stefan Exp $'
  4088     ^ '$Header: /cvs/stx/stx/libview/DeviceGraphicsContext.st,v 1.133 2014-02-18 14:30:19 stefan Exp $'
  4042 !
  4089 !
  4043 
  4090 
  4044 version_CVS
  4091 version_CVS
  4045     ^ '$Header: /cvs/stx/stx/libview/DeviceGraphicsContext.st,v 1.132 2014-02-04 15:53:01 stefan Exp $'
  4092     ^ '$Header: /cvs/stx/stx/libview/DeviceGraphicsContext.st,v 1.133 2014-02-18 14:30:19 stefan Exp $'
  4046 ! !
  4093 ! !
  4047 
  4094 
  4048 
  4095 
  4049 DeviceGraphicsContext initialize!
  4096 DeviceGraphicsContext initialize!