Changeset 77 for Include/Classes/System
- Timestamp:
- Jan 27, 2007, 12:04:09 PM (18 years ago)
- Location:
- Include/Classes/System
- Files:
-
- 15 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
Include/Classes/System/Drawing/Color.ab
r25 r77 50 50 51 51 Function A() As Byte 52 Return ( Argb >> Color_AlphaShift) As Byte52 Return (argb >> ALPHA_SHIFT) As Byte 53 53 End Function 54 54 55 55 Function R() As Byte 56 Return ( Argb >> Color_RedShift) As Byte56 Return (argb >> RED_SHIFT) As Byte 57 57 End Function 58 58 59 59 Function G() As Byte 60 Return ( Argb >> Color_GreenShift) As Byte60 Return (argb >> GREEN_SHIFT) As Byte 61 61 End Function 62 62 63 63 Function B() As Byte 64 GetBlue = (argb >> Color_BlueShift) As Byte64 Return (argb >> BLUE_SHIFT) As Byte 65 65 End Function 66 66 … … 306 306 */ 307 307 Static Function MakeARGB(a As Byte, r As Byte, g As Byte, b As Byte) As ARGB 308 MakeARGB = (((b As ARGB) << Color_BlueShift) Or _309 ((g As ARGB) << Color_GreenShift) Or _310 ((r As ARGB) << Color_RedShift) Or _311 ((a As ARGB) << Color_AlphaShift))308 MakeARGB = (((b As ARGB) << BLUE_SHIFT) Or _ 309 ((g As ARGB) << GREEN_SHIFT) Or _ 310 ((r As ARGB) << RED_SHIFT) Or _ 311 ((a As ARGB) << ALPHA_SHIFT)) 312 312 End Function 313 313 -
Include/Classes/System/Drawing/Imaging/misc.ab
r12 r77 14 14 End Enum 15 15 16 Const ALPHA_SHIFT = 24 17 Const RED_SHIFT = 16 18 Const GREEN_SHIFT = 8 19 Const BLUE_SHIFT = 0 16 Const ALPHA_SHIFT = 24 As DWord 17 Const RED_SHIFT = 16 As DWord 18 Const GREEN_SHIFT = 8 As DWord 19 Const BLUE_SHIFT = 0 As DWord 20 20 Const ALPHA_MASK = ((&hff As ARGB) << ALPHA_SHIFT) 21 21 -
Include/Classes/System/Drawing/PointF.ab
r27 r77 110 110 End Function 111 111 112 Static Function Substract( (pt1 As PointF, pt2 As PointF) As PointF112 Static Function Substract(pt1 As PointF, pt2 As PointF) As PointF 113 113 Dim ret As PointF(pt1.x - pt2.x, pt1.y - pt2.y) 114 114 Return ret -
Include/Classes/System/Drawing/Rectangle.ab
r28 r77 18 18 End Sub 19 19 20 Sub Rectangle(x As Single, y As Single, width As Single, height As Single)20 Sub Rectangle(x As Long, y As Long, width As Long, height As Long) 21 21 x = x 22 22 y = y … … 25 25 End Sub 26 26 27 Sub Rectangle(location As Point, size As Size) 28 x = location.X 29 y = location.Y 30 width = size.Height 31 height = size.Height 32 End Sub 33 34 Sub Rectangle(ByRef rc As Rectangle) 35 x = rc.x 36 y = rc.y 37 width = rc.width 38 height = rc.height 27 Sub Rectangle(l As Point, s As Size) 28 x = l.X 29 y = l.Y 30 width = s.Height 31 height = s.Height 32 End Sub 33 34 Sub Rectangle(ByRef r As Rectangle) 35 x = r.x 36 y = r.y 37 width = r.width 38 height = r.height 39 End Sub 40 41 Sub Rectangle(ByRef r As RECT) 42 This = FromLTRB(r.left, r.top, r.right, r.bottom) 39 43 End Sub 40 44 … … 58 62 End Sub 59 63 60 Function X() As Single64 Function X() As Long 61 65 Return x 62 66 End Function 63 67 64 Sub X(value As Single)68 Sub X(value As Long) 65 69 x = value 66 70 End Sub 67 71 68 Function Y() As Single72 Function Y() As Long 69 73 Return y 70 74 End Function 71 75 72 Sub Y(value As Single)76 Sub Y(value As Long) 73 77 y = value 74 78 End Sub 75 79 76 Function Width() As Single80 Function Width() As Long 77 81 Return width 78 82 End Function 79 83 80 Sub Width(value As Single)84 Sub Width(value As Long) 81 85 width = value 82 86 End Sub 83 87 84 Function Height() As Single88 Function Height() As Long 85 89 Return height 86 90 End Function 87 91 88 Sub Height(value As Single)92 Sub Height(value As Long) 89 93 height = value 90 94 End Sub 91 95 92 Function Left() As Single96 Function Left() As Long 93 97 Return X 94 98 End Function 95 99 96 Function Top() As Single100 Function Top() As Long 97 101 Return Y 98 102 End Function 99 103 100 Function Right() As Single104 Function Right() As Long 101 105 Return X + Width 102 106 End Function 103 107 104 Function Bottom() As Single108 Function Bottom() As Long 105 109 Return Y + Height 106 110 End Function … … 144 148 End Function 145 149 146 Static Function FromLTRB(l As Single, t As Single, r As Single, b As Single) As Rectangle150 Static Function FromLTRB(l As Long, t As Long, r As Long, b As Long) As Rectangle 147 151 Dim rect As Rectangle(l, t, r - l, r - b) 148 152 return rect 149 153 End Function 150 154 151 Function Contains(x As Single, y As Single) As BOOL155 Function Contains(x As Long, y As Long) As BOOL 152 156 If x >= X And x < X + Width And y >= Y And y < Y + Height Then 153 157 Contains = _System_TRUE … … 169 173 End Function 170 174 171 Sub Inflate(dx As Single, dy As Single)175 Sub Inflate(dx As Long, dy As Long) 172 176 X -= dx 173 177 Y -= dy … … 180 184 End Sub 181 185 182 Static Function Inflate(ByRef rc As Rectangle, x As Single, y As Single) As Rectangle186 Static Function Inflate(ByRef rc As Rectangle, x As Long, y As Long) As Rectangle 183 187 Inflate = rc 184 188 Inflate.Inflate(x, y) … … 190 194 191 195 Static Function Intersect(ByRef a As Rectangle, ByRef b As Rectangle) As Rectangle 192 Dim right As Single, bottom As Single, left As Single, top As Single196 Dim right As Long, bottom As Long, left As Long, top As Long 193 197 right = Math.Min(a.Right, b.Right) 194 198 bottom = Math.Min(a.Bottom, b.Bottom) … … 210 214 211 215 Static Function Union(ByRef a As Rectangle, ByRef b As Rectangle) As Rectangle 212 Dim right As Single, bottom As Single, left As Single, top As Single216 Dim right As Long, bottom As Long, left As Long, top As Long 213 217 right = Math.Max(a.Right(), b.Right()) 214 218 bottom = Math.Max(a.Bottom(), b.Bottom()) … … 222 226 End Sub 223 227 224 Sub Offset(dx As Single, dy As Single)228 Sub Offset(dx As Long, dy As Long) 225 229 X += dx 226 230 Y += dy … … 254 258 End Function 255 259 260 Function ToRECT() As RECT 261 With ToRECT 262 .left = x 263 .top = y 264 .right = x + width 265 .bottom = y + height 266 End With 267 End Function 268 256 269 Public 257 x As Single258 y As Single259 width As Single260 height As Single270 x As Long 271 y As Long 272 width As Long 273 height As Long 261 274 End Class 262 275 -
Include/Classes/System/Threading/WaitHandle.ab
r58 r77 6 6 Class WaitHandle 7 7 Public 8 Virtual Sub ~WaitHandle() 9 Close() 10 End Sub 11 12 ' Const Function SafeWaitHandle() As SafeWaitHandle 13 ' Sub SafeWaitHandle(h As SafeWaitHandle) 8 ' Properties 9 ' Const Function SafeWaitHandle() As SafeWaitHandle 10 ' Sub SafeWaitHandle(h As SafeWaitHandle) 14 11 15 12 Const Virtual Function Handle() As HANDLE … … 19 16 Virtual Sub Handle(newHandle As HANDLE) 20 17 h = newHandle 18 End Sub 19 20 ' Methods 21 22 Virtual Sub ~WaitHandle() 23 Close() 21 24 End Sub 22 25
Note:
See TracChangeset
for help on using the changeset viewer.