Changeset 48:9a64a7781bab
- Timestamp:
- 02/02/08 19:14:54
(10 months ago)
- Author:
- Frank Benoit <benoit@tionex.de>
- branch:
- default
- Message:
Added override and alias, first chunk. Thanks torhu for doing this patch.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r4 |
r48 |
|
| 1 | | /******************************************************************************* |
|---|
| | 1 | /******************************************************************************* |
|---|
| 2 | 2 | * Copyright (c) 2000, 2005 IBM Corporation and others. |
|---|
| 3 | 3 | * All rights reserved. This program and the accompanying materials |
|---|
| … | … | |
| 45 | 45 | |
|---|
| 46 | 46 | public class DWTError : PlatformException { |
|---|
| | 47 | |
|---|
| 47 | 48 | /** |
|---|
| 48 | 49 | * The DWT error code, one of DWT.ERROR_*. |
|---|
| r4 |
r48 |
|
| 1 | | /******************************************************************************* |
|---|
| | 1 | /******************************************************************************* |
|---|
| 2 | 2 | * Copyright (c) 2000, 2005 IBM Corporation and others. |
|---|
| 3 | 3 | * All rights reserved. This program and the accompanying materials |
|---|
| … | … | |
| 36 | 36 | |
|---|
| 37 | 37 | public class DWTException : TracedException { |
|---|
| | 38 | |
|---|
| 38 | 39 | /** |
|---|
| 39 | 40 | * The DWT error code, one of DWT.ERROR_*. |
|---|
| r34 |
r48 |
|
| 65 | 65 | * @return a string representation of the event |
|---|
| 66 | 66 | */ |
|---|
| 67 | | public char[] toString () { |
|---|
| | 67 | override public char[] toString () { |
|---|
| 68 | 68 | return Format( "AccessibleEvent {childID={} result={}}", childID, result ); |
|---|
| 69 | 69 | } |
|---|
| r34 |
r48 |
|
| 54 | 54 | * @return a string representation of the event |
|---|
| 55 | 55 | */ |
|---|
| 56 | | public char[] toString () { |
|---|
| | 56 | override public char[] toString () { |
|---|
| 57 | 57 | return Format( "AccessibleTextEvent {{childID={} offset={} length={}}", |
|---|
| 58 | 58 | childID, |
|---|
| r0 |
r48 |
|
| 99 | 99 | * @return a string representation of the event |
|---|
| 100 | 100 | */ |
|---|
| 101 | | public char[] toString() { |
|---|
| | 101 | override public char[] toString() { |
|---|
| 102 | 102 | return Format( "{} character={} keyCode={} stateMask={} doit={}}", |
|---|
| 103 | 103 | super.toString[ 0 .. $-2 ], |
|---|
| r0 |
r48 |
|
| 68 | 68 | * @return a string representation of the event |
|---|
| 69 | 69 | */ |
|---|
| 70 | | public char[] toString() { |
|---|
| | 70 | override public char[] toString() { |
|---|
| 71 | 71 | return Format( "{} x={} y={} doit={}}", super.toString[ 0 .. $-2 ], x, y, doit ); |
|---|
| 72 | 72 | } |
|---|
| r0 |
r48 |
|
| 93 | 93 | * @return a string representation of the event |
|---|
| 94 | 94 | */ |
|---|
| 95 | | public char[] toString() { |
|---|
| | 95 | override public char[] toString() { |
|---|
| 96 | 96 | return Format( "{} gc={} x={} y={} width={} height={} count={}}", |
|---|
| 97 | 97 | super.toString[ 0 .. $-2 ], |
|---|
| r0 |
r48 |
|
| 129 | 129 | * @return a string representation of the event |
|---|
| 130 | 130 | */ |
|---|
| 131 | | public char[] toString() { |
|---|
| | 131 | override public char[] toString() { |
|---|
| 132 | 132 | return Format( "{} item={} detail={} x={} y={} width={} height={} stateMask={} text={} doit={}}", |
|---|
| 133 | 133 | super.toString[ 0 .. $-2 ], |
|---|
| r0 |
r48 |
|
| 132 | 132 | * @return a string representation of the event |
|---|
| 133 | 133 | */ |
|---|
| 134 | | public char[] toString() { |
|---|
| | 134 | override public char[] toString() { |
|---|
| 135 | 135 | return Format( "{} detail={}}", super.toString[ 0 .. $-2 ], detail ); |
|---|
| 136 | 136 | } |
|---|
| r0 |
r48 |
|
| 99 | 99 | * @return a string representation of the event |
|---|
| 100 | 100 | */ |
|---|
| 101 | | public char[] toString() { |
|---|
| | 101 | override public char[] toString() { |
|---|
| 102 | 102 | return Format( "{}{{{} time={} data={}}", widget.toString(), time, data.toString() ); |
|---|
| 103 | 103 | } |
|---|
| r0 |
r48 |
|
| 61 | 61 | * @return a string representation of the event |
|---|
| 62 | 62 | */ |
|---|
| 63 | | public char[] toString() { |
|---|
| | 63 | override public char[] toString() { |
|---|
| 64 | 64 | return Format( "{} start={} end={} text={}}", super.toString[ 0 .. $-2 ], start, end, text ); |
|---|
| 65 | 65 | } |
|---|
| r23 |
r48 |
|
| 125 | 125 | * they allocate. |
|---|
| 126 | 126 | */ |
|---|
| 127 | | public void dispose() { |
|---|
| | 127 | override public void dispose() { |
|---|
| 128 | 128 | if (handle is -1) return; |
|---|
| 129 | 129 | if (device.isDisposed()) return; |
|---|
| … | … | |
| 309 | 309 | * @return <code>true</code> when the color is disposed and <code>false</code> otherwise |
|---|
| 310 | 310 | */ |
|---|
| 311 | | public bool isDisposed() { |
|---|
| | 311 | override public bool isDisposed() { |
|---|
| 312 | 312 | return handle is -1; |
|---|
| 313 | 313 | } |
|---|
| … | … | |
| 319 | 319 | * @return a string representation of the receiver |
|---|
| 320 | 320 | */ |
|---|
| 321 | | public char[] toString () { |
|---|
| | 321 | override public char[] toString () { |
|---|
| 322 | 322 | if (isDisposed()) return "Color {*DISPOSED*}"; //$NON-NLS-1$ |
|---|
| 323 | 323 | return Format( "Color {{{}, {}, {}}", getRed(), getGreen(), getBlue()); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ |
|---|
| r28 |
r48 |
|
| 369 | 369 | * they allocate. |
|---|
| 370 | 370 | */ |
|---|
| 371 | | public void dispose () { |
|---|
| | 371 | override public void dispose () { |
|---|
| 372 | 372 | if (handle is null) return; |
|---|
| 373 | 373 | if (device.isDisposed()) return; |
|---|
| … | … | |
| 445 | 445 | * @return <code>true</code> when the cursor is disposed and <code>false</code> otherwise |
|---|
| 446 | 446 | */ |
|---|
| 447 | | public bool isDisposed() { |
|---|
| | 447 | override public bool isDisposed() { |
|---|
| 448 | 448 | return handle is null; |
|---|
| 449 | 449 | } |
|---|
| … | … | |
| 455 | 455 | * @return a string representation of the receiver |
|---|
| 456 | 456 | */ |
|---|
| 457 | | public char[] toString () { |
|---|
| | 457 | override public char[] toString () { |
|---|
| 458 | 458 | if (isDisposed()) return "Cursor {*DISPOSED*}"; |
|---|
| 459 | 459 | return Format( "Cursor {{{}}", handle ); |
|---|
| r23 |
r48 |
|
| 163 | 163 | * they allocate. |
|---|
| 164 | 164 | */ |
|---|
| 165 | | public void dispose() { |
|---|
| | 165 | override public void dispose() { |
|---|
| 166 | 166 | if (handle is null) return; |
|---|
| 167 | 167 | if (device.isDisposed()) return; |
|---|
| … | … | |
| 219 | 219 | * @see #equals |
|---|
| 220 | 220 | */ |
|---|
| 221 | | public hash_t toHash () { |
|---|
| | 221 | override public hash_t toHash () { |
|---|
| 222 | 222 | return cast(hash_t)handle; |
|---|
| 223 | 223 | } |
|---|
| … | … | |
| 244 | 244 | * @return <code>true</code> when the font is disposed and <code>false</code> otherwise |
|---|
| 245 | 245 | */ |
|---|
| 246 | | public bool isDisposed() { |
|---|
| | 246 | override public bool isDisposed() { |
|---|
| 247 | 247 | return handle is null; |
|---|
| 248 | 248 | } |
|---|
| … | … | |
| 254 | 254 | * @return a string representation of the receiver |
|---|
| 255 | 255 | */ |
|---|
| 256 | | public char[] toString () { |
|---|
| | 256 | override public char[] toString () { |
|---|
| 257 | 257 | if (isDisposed()) return "Font {*DISPOSED*}"; |
|---|
| 258 | 258 | return Format( "Font {{{}}", handle ); |
|---|
| r23 |
r48 |
|
| 295 | 295 | * @see #hashCode |
|---|
| 296 | 296 | */ |
|---|
| 297 | | public int opEquals (Object object) { |
|---|
| | 297 | override public int opEquals (Object object) { |
|---|
| 298 | 298 | if (object is this) return true; |
|---|
| 299 | 299 | if( auto fd = cast(FontData)object ){ |
|---|
| … | … | |
| 453 | 453 | * @see #equals |
|---|
| 454 | 454 | */ |
|---|
| 455 | | public hash_t toHash () { |
|---|
| | 455 | override public hash_t toHash () { |
|---|
| 456 | 456 | char[] name = getName(); |
|---|
| 457 | 457 | return data.lfCharSet ^ getHeight() ^ data.lfWidth ^ data.lfEscapement ^ |
|---|
| … | … | |
| 598 | 598 | * @see FontData |
|---|
| 599 | 599 | */ |
|---|
| 600 | | public char[] toString() { |
|---|
| | 600 | override public char[] toString() { |
|---|
| 601 | 601 | StringBuffer buffer = new StringBuffer(); |
|---|
| 602 | 602 | buffer.append("1|"); //$NON-NLS-1$ |
|---|
| r23 |
r48 |
|
| 57 | 57 | * @see #hashCode |
|---|
| 58 | 58 | */ |
|---|
| 59 | | public int opEquals (Object object) { |
|---|
| | 59 | override public int opEquals (Object object) { |
|---|
| 60 | 60 | if (object is this) return true; |
|---|
| 61 | 61 | if( auto metricObj = cast(FontMetrics)object ){ |
|---|
| … | … | |
| 155 | 155 | * @see #equals |
|---|
| 156 | 156 | */ |
|---|
| 157 | | public hash_t toHash() { |
|---|
| | 157 | override public hash_t toHash() { |
|---|
| 158 | 158 | return handle.tmHeight ^ handle.tmAscent ^ handle.tmDescent ^ |
|---|
| 159 | 159 | handle.tmInternalLeading ^ handle.tmExternalLeading ^ |
|---|
| r25 |
r48 |
|
| 632 | 632 | * </ul> |
|---|
| 633 | 633 | */ |
|---|
| 634 | | public void dispose() { |
|---|
| | 634 | override public void dispose() { |
|---|
| 635 | 635 | if (handle is null) return; |
|---|
| 636 | 636 | if (data.device.isDisposed()) return; |
|---|
| … | … | |
| 3767 | 3767 | * @return <code>true</code> when the GC is disposed and <code>false</code> otherwise |
|---|
| 3768 | 3768 | */ |
|---|
| 3769 | | public bool isDisposed() { |
|---|
| | 3769 | override public bool isDisposed() { |
|---|
| 3770 | 3770 | return handle is null; |
|---|
| 3771 | 3771 | } |
|---|
| … | … | |
| 4818 | 4818 | * @return a string representation of the receiver |
|---|
| 4819 | 4819 | */ |
|---|
| 4820 | | public char[] toString () { |
|---|
| | 4820 | override public char[] toString () { |
|---|
| 4821 | 4821 | if (isDisposed()) return "GC {*DISPOSED*}"; |
|---|
| 4822 | 4822 | return Format( "GC {{{}}", handle ); |
|---|
| r23 |
r48 |
|
| 1033 | 1033 | * they allocate. |
|---|
| 1034 | 1034 | */ |
|---|
| 1035 | | public void dispose () { |
|---|
| | 1035 | override public void dispose () { |
|---|
| 1036 | 1036 | if (handle is null) return; |
|---|
| 1037 | 1037 | if (device.isDisposed()) return; |
|---|
| … | … | |
| 1059 | 1059 | * @see #hashCode |
|---|
| 1060 | 1060 | */ |
|---|
| 1061 | | public int opEquals (Object object) { |
|---|
| | 1061 | override public int opEquals (Object object) { |
|---|
| 1062 | 1062 | if (object is this) return true; |
|---|
| 1063 | 1063 | if (!(cast(Image)object)) return false; |
|---|
| … | … | |
| 1556 | 1556 | * @see #equals |
|---|
| 1557 | 1557 | */ |
|---|
| 1558 | | public hash_t toHash () { |
|---|
| | 1558 | override public hash_t toHash () { |
|---|
| 1559 | 1559 | return cast(hash_t)handle; |
|---|
| 1560 | 1560 | } |
|---|
| … | … | |
| 2026 | 2026 | * @return <code>true</code> when the image is disposed and <code>false</code> otherwise |
|---|
| 2027 | 2027 | */ |
|---|
| 2028 | | public bool isDisposed() { |
|---|
| | 2028 | override public bool isDisposed() { |
|---|
| 2029 | 2029 | return handle is null; |
|---|
| 2030 | 2030 | } |
|---|
| … | … | |
| 2104 | 2104 | * @return a string representation of the receiver |
|---|
| 2105 | 2105 | */ |
|---|
| 2106 | | public char[] toString () { |
|---|
| | 2106 | override public char[] toString () { |
|---|
| 2107 | 2107 | if (isDisposed()) return "Image {*DISPOSED*}"; |
|---|
| 2108 | 2108 | return Format( "Image {{{}}", handle ); |
|---|
| r22 |
r48 |
|
| 86 | 86 | * @return a string representation of the event |
|---|
| 87 | 87 | */ |
|---|
| 88 | | public char[] toString () { |
|---|
| | 88 | override public char[] toString () { |
|---|
| 89 | 89 | return Format( "ImageLoaderEvent {source={} imageData={} incrementCount={} endOfImage={}}", source, imageData, incrementCount, endOfImage); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ |
|---|
| 90 | 90 | } |
|---|
| r26 |
r48 |
|
| 326 | 326 | * they allocate. |
|---|
| 327 | 327 | */ |
|---|
| 328 | | public void dispose() { |
|---|
| | 328 | override public void dispose() { |
|---|
| 329 | 329 | if (handle is null) return; |
|---|
| 330 | 330 | if (device.isDisposed()) return; |
|---|
| … | … | |
| 468 | 468 | * @return <code>true</code> when the Path is disposed, and <code>false</code> otherwise |
|---|
| 469 | 469 | */ |
|---|
| 470 | | public bool isDisposed() { |
|---|
| | 470 | override public bool isDisposed() { |
|---|
| 471 | 471 | return handle is null; |
|---|
| 472 | 472 | } |
|---|
| … | … | |
| 519 | 519 | * @return a string representation of the receiver |
|---|
| 520 | 520 | */ |
|---|
| 521 | | public char[] toString() { |
|---|
| | 521 | override public char[] toString() { |
|---|
| 522 | 522 | if (isDisposed()) return "Path {*DISPOSED*}"; |
|---|
| 523 | 523 | return Format( "Path {{{}}", handle ); |
|---|
| r27 |
r48 |
|
| 229 | 229 | * they allocate. |
|---|
| 230 | 230 | */ |
|---|
| 231 | | public void dispose() { |
|---|
| | 231 | override public void dispose() { |
|---|
| 232 | 232 | if (handle is null) return; |
|---|
| 233 | 233 | if (device.isDisposed()) return; |
|---|
| … | … | |
| 262 | 262 | * @return <code>true</code> when the Pattern is disposed, and <code>false</code> otherwise |
|---|
| 263 | 263 | */ |
|---|
| 264 | | public bool isDisposed() { |
|---|
| | 264 | override public bool isDisposed() { |
|---|
| 265 | 265 | return handle is null; |
|---|
| 266 | 266 | } |
|---|
| … | … | |
| 272 | 272 | * @return a string representation of the receiver |
|---|
| 273 | 273 | */ |
|---|
| 274 | | public char[] toString() { |
|---|
| | 274 | override public char[] toString() { |
|---|
| 275 | 275 | if (isDisposed()) return "Pattern {*DISPOSED*}"; |
|---|
| 276 | 276 | return Format( "Pattern {{{}}", handle ); |
|---|
| r4 |
r48 |
|
| 95 | 95 | * @see #equals(Object) |
|---|
| 96 | 96 | */ |
|---|
| 97 | | public hash_t toHash () { |
|---|
| | 97 | override public hash_t toHash () { |
|---|
| 98 | 98 | return x ^ y; |
|---|
| 99 | 99 | } |
|---|
| … | … | |
| 105 | 105 | * @return a string representation of the point |
|---|
| 106 | 106 | */ |
|---|
| 107 | | public char[] toString () { |
|---|
| | 107 | override public char[] toString () { |
|---|
| 108 | 108 | return Format( "Point {}, {}}", x, y );; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
|---|
| 109 | 109 | } |
|---|
| r16 |
r48 |
|
| 214 | 214 | * @see #equals(Object) |
|---|
| 215 | 215 | */ |
|---|
| 216 | | public hash_t toHash() { |
|---|
| | 216 | override public hash_t toHash() { |
|---|
| 217 | 217 | return (blue << 16) | (green << 8) | red; |
|---|
| 218 | 218 | } |
|---|
| r23 |
r48 |
|
| 238 | 238 | * they allocate. |
|---|
| 239 | 239 | */ |
|---|
| 240 | | public void dispose () { |
|---|
| | 240 | override public void dispose () { |
|---|
| 241 | 241 | if (handle is null) return; |
|---|
| 242 | 242 | if (device.isDisposed()) return; |
|---|
| … | … | |
| 257 | 257 | * @see #hashCode |
|---|
| 258 | 258 | */ |
|---|
| 259 | | public int opEquals (Object object) { |
|---|
| | 259 | override public int opEquals (Object object) { |
|---|
| 260 | 260 | if (this is object) return true; |
|---|
| 261 | 261 | if (!(cast(Region)object)) return false; |
|---|
| … | … | |
| 294 | 294 | * @see #equals |
|---|
| 295 | 295 | */ |
|---|
| 296 | | public hash_t toHash () { |
|---|
| | 296 | override public hash_t toHash () { |
|---|
| 297 | 297 | return cast(hash_t)handle; |
|---|
| 298 | 298 | } |
|---|
| … | … | |
| 427 | 427 | * @return <code>true</code> when the region is disposed, and <code>false</code> otherwise |
|---|
| 428 | 428 | */ |
|---|
| 429 | | public bool isDisposed() { |
|---|
| | 429 | override public bool isDisposed() { |
|---|
| 430 | 430 | return handle is null; |
|---|
| 431 | 431 | } |
|---|
| … | … | |
| 591 | 591 | * @return a string representation of the receiver |
|---|
| 592 | 592 | */ |
|---|
| 593 | | public char[] toString () { |
|---|
| | 593 | override public char[] toString () { |
|---|
| 594 | 594 | if (isDisposed()) return "Region {*DISPOSED*}"; |
|---|
| 595 | 595 | return Format( "Region {{{}}", handle ); |
|---|
| r31 |
r48 |
|
| 161 | 161 | lineBreak = softBreak = false; |
|---|
| 162 | 162 | } |
|---|
| 163 | | public char[] toString () { |
|---|
| | 163 | override public char[] toString () { |
|---|
| 164 | 164 | return Format( "StyleItem {{{}, {}}", start, style ); |
|---|
| 165 | 165 | } |
|---|
| … | … | |
| 464 | 464 | * the text layout. Applications must dispose of all allocated text layouts. |
|---|
| 465 | 465 | */ |
|---|
| 466 | | public void dispose () { |
|---|
| | 466 | override public void dispose () { |
|---|
| 467 | 467 | if (device is null) return; |
|---|
| 468 | 468 | freeRuns(); |
|---|
| … | … | |
| 1871 | 1871 | * @return <code>true</code> when the text layout is disposed and <code>false</code> otherwise |
|---|
| 1872 | 1872 | */ |
|---|
| 1873 | | public bool isDisposed () { |
|---|
| | 1873 | override public bool isDisposed () { |
|---|
| 1874 | 1874 | return device is null; |
|---|
| 1875 | 1875 | } |
|---|
| … | … | |
| 2497 | 2497 | * @return a string representation of the receiver |
|---|
| 2498 | 2498 | */ |
|---|
| 2499 | | public char[] toString () { |
|---|
| | 2499 | override public char[] toString () { |
|---|
| 2500 | 2500 | if (isDisposed()) return "TextLayout {*DISPOSED*}"; |
|---|
| 2501 | 2501 | return "TextLayout {}"; |
|---|
| r21 |
r48 |
|
| 161 | 161 | * @return a string representation of the <code>TextStyle</code> |
|---|
| 162 | 162 | */ |
|---|
| 163 | | public char[] toString () { |
|---|
| | 163 | override public char[] toString () { |
|---|
| 164 | 164 | char[] buffer = "TextStyle {"; |
|---|
| 165 | 165 | int startLength = buffer.length; |
|---|
| r23 |
r48 |
|
| 157 | 157 | * they allocate. |
|---|
| 158 | 158 | */ |
|---|
| 159 | | public void dispose() { |
|---|
| | 159 | override public void dispose() { |
|---|
| 160 | 160 | if (handle is null) return; |
|---|
| 161 | 161 | if (device.isDisposed()) return; |
|---|
| … | … | |
| 211 | 211 | * @return <code>true</code> when the Transform is disposed, and <code>false</code> otherwise |
|---|
| 212 | 212 | */ |
|---|
| 213 | | public bool isDisposed() { |
|---|
| | 213 | override public bool isDisposed() { |
|---|
| 214 | 214 | return handle is null; |
|---|
| 215 | 215 | } |
|---|
| … | … | |
| 344 | 344 | * @return a string representation of the receiver |
|---|
| 345 | 345 | */ |
|---|
| 346 | | public char[] toString() { |
|---|
| | 346 | override public char[] toString() { |
|---|
| 347 | 347 | if (isDisposed()) return "Transform {*DISPOSED*}"; |
|---|
| 348 | 348 | float[6] elements; |
|---|
| r31 |
r48 |
|
| 57 | 57 | } |
|---|
| 58 | 58 | |
|---|
| 59 | | bool isFileFormat(LEDataInputStream stream) { |
|---|
| | 59 | override bool isFileFormat(LEDataInputStream stream) { |
|---|
| 60 | 60 | try { |
|---|
| 61 | 61 | byte[3] signature; |
|---|
| … | … | |
| 72 | 72 | * Return an array of ImageData representing the image(s). |
|---|
| 73 | 73 | */ |
|---|
| 74 | | ImageData[] loadFromByteStream() { |
|---|
| | 74 | override ImageData[] loadFromByteStream() { |
|---|
| 75 | 75 | byte[3] signatureBytes; |
|---|
| 76 | 76 | byte[3] versionBytes; |
|---|
| … | … | |
| 439 | 439 | } |
|---|
| 440 | 440 | |
|---|
| 441 | | void unloadIntoByteStream(ImageLoader loader) { |
|---|
| | 441 | override void unloadIntoByteStream(ImageLoader loader) { |
|---|
| 442 | 442 | |
|---|
| 443 | 443 | /* Step 1: Acquire GIF parameters. */ |
|---|
| r2 |
r48 |
|
| 27 | 27 | } |
|---|
| 28 | 28 | |
|---|
| 29 | | public bool verify() { |
|---|
| | 29 | override public bool verify() { |
|---|
| 30 | 30 | int marker = getSegmentMarker(); |
|---|
| 31 | 31 | return marker >= JPEGFileFormat.APP0 && marker <= JPEGFileFormat.APP15; |
|---|
| r2 |
r48 |
|
| 23 | 23 | } |
|---|
| 24 | 24 | |
|---|
| 25 | | public int signature() { |
|---|
| | 25 | override public int signature() { |
|---|
| 26 | 26 | return JPEGFileFormat.DAC; |
|---|
| 27 | 27 | } |
|---|
| r2 |
r48 |
|
| 27 | 27 | } |
|---|
| 28 | 28 | |
|---|
| 29 | | public int signature() { |
|---|
| | 29 | override public int signature() { |
|---|
| 30 | 30 | return JPEGFileFormat.COM; |
|---|
| 31 | 31 | } |
|---|
| r31 |
r48 |
|
| 410 | 410 | } |
|---|
| 411 | 411 | |
|---|
| 412 | | void start_pass (jpeg_decompress_struct cinfo) { |
|---|
| | 412 | override void start_pass (jpeg_decompress_struct cinfo) { |
|---|
| 413 | 413 | start_pass_huff_decoder(cinfo); |
|---|
| 414 | 414 | } |
|---|
| 415 | 415 | |
|---|
| 416 | | bool decode_mcu (jpeg_decompress_struct cinfo, short[][] MCU_data) { |
|---|
| | 416 | override bool decode_mcu (jpeg_decompress_struct cinfo, short[][] MCU_data) { |
|---|
| 417 | 417 | huff_entropy_decoder entropy = this; |
|---|
| 418 | 418 | int blkn; |
|---|
| … | … | |
| 787 | 787 | } |
|---|
| 788 | 788 | |
|---|
| 789 | | void start_pass (jpeg_decompress_struct cinfo) { |
|---|
| | 789 | override void start_pass (jpeg_decompress_struct cinfo) { |
|---|
| 790 | 790 | start_pass_phuff_decoder(cinfo); |
|---|
| 791 | 791 | } |
|---|
| 792 | 792 | |
|---|
| 793 | | bool decode_mcu (jpeg_decompress_struct cinfo, short[][] MCU_data) { |
|---|
| | 793 | override bool decode_mcu (jpeg_decompress_struct cinfo, short[][] MCU_data) { |
|---|
| 794 | 794 | bool is_DC_band = (cinfo.Ss is 0); |
|---|
| 795 | 795 | if (cinfo.Ah is 0) { |
|---|
| r2 |
r48 |
|
| 27 | 27 | } |
|---|
| 28 | 28 | |
|---|
| 29 | | public int signature() { |
|---|
| | 29 | override public int signature() { |
|---|
| 30 | 30 | return JPEGFileFormat.EOI; |
|---|
| 31 | 31 | } |
|---|
| 32 | 32 | |
|---|
| 33 | | public int fixedSize() { |
|---|
| | 33 | override public int fixedSize() { |
|---|
| 34 | 34 | return 2; |
|---|
| 35 | 35 | } |
|---|
| r31 |
r48 |
|
| 1371 | 1371 | } |
|---|
| 1372 | 1372 | } |
|---|
| 1373 | | bool isFileFormat(LEDataInputStream stream) { |
|---|
| | 1373 | override bool isFileFormat(LEDataInputStream stream) { |
|---|
| 1374 | 1374 | try { |
|---|
| 1375 | 1375 | JPEGStartOfImage soi = new JPEGStartOfImage(stream); |
|---|
| … | … | |
| 1392 | 1392 | && dataUnit[rIndex + 7] is 0; |
|---|
| 1393 | 1393 | } |
|---|
| 1394 | | ImageData[] loadFromByteStream() { |
|---|
| | 1394 | override ImageData[] loadFromByteStream() { |
|---|
| 1395 | 1395 | //TEMPORARY CODE |
|---|
| 1396 | 1396 | //PORTING_FIXME |
|---|
| … | … | |
| 1773 | 1773 | } |
|---|
| 1774 | 1774 | } |
|---|
| 1775 | | void unloadIntoByteStream(ImageLoader loader) { |
|---|
| | 1775 | override void unloadIntoByteStream(ImageLoader loader) { |
|---|
| 1776 | 1776 | ImageData image = loader.data[0]; |
|---|
| 1777 | 1777 | if (!(new JPEGStartOfImage()).writeToStream(outputStream)) { |
|---|
| r2 |
r48 |
|
| 43 | 43 | abstract public int fixedSize(); |
|---|
| 44 | 44 | |
|---|
| 45 | | public int getSegmentLength() { |
|---|
| | 45 | override public int getSegmentLength() { |
|---|
| 46 | 46 | return fixedSize() - 2; |
|---|
| 47 | 47 | } |
|---|
| 48 | 48 | |
|---|
| 49 | | public void setSegmentLength(int length) { |
|---|
| | 49 | override public void setSegmentLength(int length) { |
|---|
| 50 | 50 | } |
|---|
| 51 | 51 | } |
|---|
| r31 |
r48 |
|
| 199 | 199 | * SOF_15 - Differential lossless, arithmetic coding |
|---|
| 200 | 200 | */ |
|---|
| 201 | | public bool verify() { |
|---|
| | 201 | override public bool verify() { |
|---|
| 202 | 202 | int marker = getSegmentMarker(); |
|---|
| 203 | 203 | return (marker >= JPEGFileFormat.SOF0 && marker <= JPEGFileFormat.SOF3) || |
|---|
| r2 |
r48 |
|
| 265 | 265 | } |
|---|
| 266 | 266 | |
|---|
| 267 | | public int signature() { |
|---|
| | 267 | override public int signature() { |
|---|
| 268 | 268 | return JPEGFileFormat.DHT; |
|---|
| 269 | 269 | } |
|---|
| r2 |
r48 |
|
| 167 | 167 | } |
|---|
| 168 | 168 | |
|---|
| 169 | | public int signature() { |
|---|
| | 169 | override public int signature() { |
|---|
| 170 | 170 | return JPEGFileFormat.DQT; |
|---|
| 171 | 171 | } |
|---|
| r2 |
r48 |
|
| 23 | 23 | } |
|---|
| 24 | 24 | |
|---|
| 25 | | public int signature() { |
|---|
| | 25 | override public int signature() { |
|---|
| 26 | 26 | return JPEGFileFormat.DRI; |
|---|
| 27 | 27 | } |
|---|
| … | … | |
| 31 | 31 | } |
|---|
| 32 | 32 | |
|---|
| 33 | | public int fixedSize() { |
|---|
| | 33 | override public int fixedSize() { |
|---|
| 34 | 34 | return 6; |
|---|
| 35 | 35 | } |
|---|
| r31 |
r48 |
|
| 96 | 96 | } |
|---|
| 97 | 97 | |
|---|
| 98 | | public int signature() { |
|---|
| | 98 | override public int signature() { |
|---|
| 99 | 99 | return JPEGFileFormat.SOS; |
|---|
| 100 | 100 | } |
|---|
| r2 |
r48 |
|
| 31 | 31 | } |
|---|
| 32 | 32 | |
|---|
| 33 | | public int signature() { |
|---|
| | 33 | override public int signature() { |
|---|
| 34 | 34 | return JPEGFileFormat.SOI; |
|---|
| 35 | 35 | } |
|---|
| 36 | 36 | |
|---|
| 37 | | public int fixedSize() { |
|---|
| | 37 | override public int fixedSize() { |
|---|
| 38 | 38 | return 2; |
|---|
| 39 | 39 | } |
|---|
| r2 |
r48 |
|
| 52 | 52 | } |
|---|
| 53 | 53 | |
|---|
| 54 | | public void close() { |
|---|
| | 54 | override public void close() { |
|---|
| 55 | 55 | buf = null; |
|---|
| 56 | 56 | if (host !is null) { |
|---|
| … | … | |
| 70 | 70 | * Answers how many bytes are available for reading without blocking |
|---|
| 71 | 71 | */ |
|---|
| 72 | | public int available() { |
|---|
| | 72 | override public int available() { |
|---|
| 73 | 73 | if (buf is null) throw new IOException("buf is null"); |
|---|
| 74 | 74 | return (buf.length - pos) + host.available(); |
|---|
| … | … | |
| 78 | 78 | * Answer the next byte of the input stream. |
|---|
| 79 | 79 | */ |
|---|
| 80 | | public int read() { |
|---|
| | 80 | override public int read() { |
|---|
| 81 | 81 | if (buf is null) throw new IOException("buf is null"); |
|---|
| 82 | 82 | if (pos < buf.length) { |
|---|
| … | … | |
| 93 | 93 | * of bytes when you can actually read them all. |
|---|
| 94 | 94 | */ |
|---|
| 95 | | public int read(byte b[], int off, int len) { |
|---|
| | 95 | override public int read(byte b[], int off, int len) { |
|---|
| 96 | 96 | int read = 0, count; |
|---|
| 97 | 97 | while (read !is len && (count = readData(b, off, len - read)) !is -1) { |
|---|