[9] | 1 | <?xml version='1.0' encoding='UTF-8'?>
|
---|
| 2 | <?xml-stylesheet type="text/css"
|
---|
| 3 | href="eclipseos2-xxe.css"
|
---|
| 4 | ?>
|
---|
| 5 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
---|
| 6 | "xhtml1-strict.dtd">
|
---|
| 7 | <html>
|
---|
| 8 | <head>
|
---|
| 9 | <link type="text/css"
|
---|
| 10 | href="eclipseos2.css"
|
---|
| 11 | rel="stylesheet" />
|
---|
| 12 |
|
---|
| 13 | <title>Eclipse for OS/2 Transitional Project Notes</title>
|
---|
| 14 | </head>
|
---|
| 15 |
|
---|
| 16 | <body>
|
---|
| 17 | <h1>SWT Step 6. Image handling</h1>
|
---|
| 18 |
|
---|
| 19 | <h2>Objective</h2>
|
---|
| 20 |
|
---|
| 21 | <p>Implement image handling (including <code>o.e.swt.graphics.Image</code>
|
---|
| 22 | class). The test example of this step should draw images of different
|
---|
| 23 | formats in the SWT top window client area using corresponding methods of
|
---|
| 24 | <code>o.e.swt.graphics.GC</code> class.</p>
|
---|
| 25 |
|
---|
| 26 | <h2>Task notes</h2>
|
---|
| 27 |
|
---|
| 28 | <p>There is one issue with getting image data when the system (the
|
---|
| 29 | display) is in 256-color mode -- it is described <a href="diff.html#007">here</a>.</p>
|
---|
| 30 |
|
---|
| 31 | <p>Also we have a potential problem with icons, because OS/2 supports only
|
---|
| 32 | 32x32/16x16 px and 40x40/20x20 px icons. Although we made it possible to
|
---|
| 33 | create and draw icons of any size we cannot use non-standard ones in
|
---|
| 34 | places where OS/2 accepts standard icon/pointer handlers (for example, in
|
---|
| 35 | some controls).</p>
|
---|
| 36 |
|
---|
| 37 | <h2>Step checklist</h2>
|
---|
| 38 |
|
---|
| 39 | <table>
|
---|
| 40 | <col width="40%" />
|
---|
| 41 |
|
---|
| 42 | <col />
|
---|
| 43 |
|
---|
| 44 | <col width="50%" />
|
---|
| 45 |
|
---|
| 46 | <thead>
|
---|
| 47 | <tr>
|
---|
| 48 | <th>Operation</th>
|
---|
| 49 |
|
---|
| 50 | <th>Status</th>
|
---|
| 51 |
|
---|
| 52 | <th>Remarks</th>
|
---|
| 53 | </tr>
|
---|
| 54 | </thead>
|
---|
| 55 |
|
---|
| 56 | <tr>
|
---|
| 57 | <td>Add <code>OS.DevOpenDC()</code> and <code>OD_*</code> constants,
|
---|
| 58 | <code>DevCloseDC()</code>; <code>OS.GpiCreatePS()</code> and
|
---|
| 59 | <code>PU_*</code>, <code>GPIF_*</code>, <code>GPIT_*</code>,
|
---|
| 60 | <code>GPIA_*</code>, <code>GPIM_*</code> constants, GpiDestr</td>
|
---|
| 61 |
|
---|
| 62 | <td>Done [dmik]</td>
|
---|
| 63 |
|
---|
| 64 | <td>During to complicacy of one of its parameters <code>OS.DevOpenDC()</code>is
|
---|
| 65 | implemented in an unusual way, see the source</td>
|
---|
| 66 | </tr>
|
---|
| 67 |
|
---|
| 68 | <tr>
|
---|
| 69 | <td>Add <code>Display.internal_get_HAB()</code> method</td>
|
---|
| 70 |
|
---|
| 71 | <td>Done [dmik]</td>
|
---|
| 72 |
|
---|
| 73 | <td>This is a static and public method, not intended for use by
|
---|
| 74 | applications. It is intended for those classes inside SWT to obtain
|
---|
| 75 | the <code>HAB</code> which don't have the direct access to the
|
---|
| 76 | <code>Display</code> object but need it.</td>
|
---|
| 77 | </tr>
|
---|
| 78 |
|
---|
| 79 | <tr>
|
---|
| 80 | <td>Add <code>OS.GpiQueryDeviceBitmapFormats()</code>, <code>GpiCreateBitmap()</code>
|
---|
| 81 | and <code>CBM_INIT</code> constant, constants for <code>BITMAPINFOHEADER2</code>:
|
---|
| 82 | <code>OS.BCA_*</code>, <code>BRU_*</code>, <code>BRA_*</code>,
|
---|
| 83 | <code>BRH_*</code> and <code>BCE_*</code>, <code>OS.GpiSetBitmap()</code></td>
|
---|
| 84 |
|
---|
| 85 | <td>Done [dmik]</td>
|
---|
| 86 |
|
---|
| 87 | <td></td>
|
---|
| 88 | </tr>
|
---|
| 89 |
|
---|
| 90 | <tr>
|
---|
| 91 | <td>Add two static helper methods to <code>Image</code> class:
|
---|
| 92 | <code>new_compatible_GC()</code> and <code>dispose_compatible_GC()</code></td>
|
---|
| 93 |
|
---|
| 94 | <td>Done [dmik]</td>
|
---|
| 95 |
|
---|
| 96 | <td>Done for convenience</td>
|
---|
| 97 | </tr>
|
---|
| 98 |
|
---|
| 99 | <tr>
|
---|
| 100 | <td>Add <code>OS.GpiBitBlt()</code> and <code>CBM_*</code>,
|
---|
| 101 | <code>ROP_*</code>, <code>BBO_*</code> constants</td>
|
---|
| 102 |
|
---|
| 103 | <td>Done [dmik]</td>
|
---|
| 104 |
|
---|
| 105 | <td></td>
|
---|
| 106 | </tr>
|
---|
| 107 |
|
---|
| 108 | <tr>
|
---|
| 109 | <td>Implement <code>GC.fillGradientRectagle()</code></td>
|
---|
| 110 |
|
---|
| 111 | <td>Done [dmik]</td>
|
---|
| 112 |
|
---|
| 113 | <td></td>
|
---|
| 114 | </tr>
|
---|
| 115 |
|
---|
| 116 | <tr>
|
---|
| 117 | <td>Add <code>OS.GpiQueryPalette()</code>, <code>OS.GpiQueryBitmapBits()</code>,
|
---|
| 118 | <code>OS.GpiSetBitmapBits()</code>, <code>GpiDrawBits()</code>,
|
---|
| 119 | <code>GpiWCBitBlt()</code>, <code>GpiQueryDefaultViewMatrix()</code></td>
|
---|
| 120 |
|
---|
| 121 | <td>Done [dmik]</td>
|
---|
| 122 |
|
---|
| 123 | <td><code>GpiWCBitBlt()</code> is used now instead of <code>GpiBitBlt()</code>
|
---|
| 124 | when possible -- because it does blitting faster.</td>
|
---|
| 125 | </tr>
|
---|
| 126 |
|
---|
| 127 | <tr>
|
---|
| 128 | <td>Add the package static method <code>Image.createBitmap()</code>,
|
---|
| 129 | the protected field <code>Device.has32bitDepth</code></td>
|
---|
| 130 |
|
---|
| 131 | <td>Done [dmik]</td>
|
---|
| 132 |
|
---|
| 133 | <td>Used for convenience when dealing with bitmaps. <code>has32BitDepth</code>
|
---|
| 134 | is true when the device supports the 32-bit color depth.</td>
|
---|
| 135 | </tr>
|
---|
| 136 |
|
---|
| 137 | <tr>
|
---|
| 138 | <td>Add <code>OS.WinCreatePointerIndirect()</code>, <code>WinDestroyPointer()</code>,
|
---|
| 139 | <code>WinDrawPointer()</code>, <code>WinQueryPointerInfo()</code>,
|
---|
| 140 | <code>DP_*</code> constants and <code>POINTERINFO</code> class</td>
|
---|
| 141 |
|
---|
| 142 | <td>Done [dmik]</td>
|
---|
| 143 |
|
---|
| 144 | <td></td>
|
---|
| 145 | </tr>
|
---|
| 146 |
|
---|
| 147 | <tr>
|
---|
| 148 | <td>Implement <code>GC.drawImage()</code></td>
|
---|
| 149 |
|
---|
| 150 | <td>Done [dmik]</td>
|
---|
| 151 |
|
---|
| 152 | <td></td>
|
---|
| 153 | </tr>
|
---|
| 154 |
|
---|
| 155 | <tr>
|
---|
| 156 | <td>Implement <code>Image</code> class, add <code>SWT006_01</code>
|
---|
| 157 | testcase + different test images, add <code>SWT006_02</code> testcase</td>
|
---|
| 158 |
|
---|
| 159 | <td>Done [dmik]</td>
|
---|
| 160 |
|
---|
| 161 | <td></td>
|
---|
| 162 | </tr>
|
---|
| 163 |
|
---|
| 164 | <tr>
|
---|
| 165 | <td>Change the behavior of filled versions of some graphic primitives
|
---|
| 166 | in <code>GC</code> (rectangles and arcs) back to that one in Windows
|
---|
| 167 | (meaning that they are drawn 1 pixel narrower than their outlined
|
---|
| 168 | counterparts with the same width and height arguments)</td>
|
---|
| 169 |
|
---|
| 170 | <td>Done [dmik]</td>
|
---|
| 171 |
|
---|
| 172 | <td>This is done for compatibility reasons -- filling an area of a
|
---|
| 173 | client window with <code>GC.fillRectangle()</code> is quite a frequent
|
---|
| 174 | task and must work equally across platforms (see <a
|
---|
| 175 | href="swt003.html#GraphicPrimitives">here</a> for initial discussion
|
---|
| 176 | of this issue).</td>
|
---|
| 177 | </tr>
|
---|
| 178 |
|
---|
| 179 | <tr>
|
---|
| 180 | <td>Fix <code>Decorations</code>: redirect the call to <code>layout()</code>
|
---|
| 181 | to <code>client.layout()</code>; fix <code>Shell</code>: do implicit
|
---|
| 182 | layout upon the first <code>open()</code> or <code>setVisible()</code>
|
---|
| 183 | call as it done in Windows.</td>
|
---|
| 184 |
|
---|
| 185 | <td>Done [dmik]</td>
|
---|
| 186 |
|
---|
| 187 | <td></td>
|
---|
| 188 | </tr>
|
---|
| 189 |
|
---|
| 190 | <tr>
|
---|
| 191 | <td>Add <code>OS.WinScrollWindow()</code> and <code>SW_*</code>
|
---|
| 192 | constants, <code>HRGN_ERROR</code> constant; implement <code>GC.copyArea()</code></td>
|
---|
| 193 |
|
---|
| 194 | <td>Done [dmik]</td>
|
---|
| 195 |
|
---|
| 196 | <td>Note, that this item and the following ones are added after the
|
---|
| 197 | SWT006 Step was considered to be done and tagged in the repository.</td>
|
---|
| 198 | </tr>
|
---|
| 199 |
|
---|
| 200 | <tr>
|
---|
| 201 | <td>Add <code>OS.GpiSetRegion()</code>, <code>GpiQueryClipBox()</code>;
|
---|
| 202 | implement <code>GC.getClipping(Region)</code>, <code>isClipped()</code></td>
|
---|
| 203 |
|
---|
| 204 | <td>Done [dmik]</td>
|
---|
| 205 |
|
---|
| 206 | <td></td>
|
---|
| 207 | </tr>
|
---|
| 208 |
|
---|
| 209 | <tr>
|
---|
| 210 | <td>Add <code>SWT006_03</code> testcase</td>
|
---|
| 211 |
|
---|
| 212 | <td>Done [dmik]</td>
|
---|
| 213 |
|
---|
| 214 | <td>This testcase is for testing of two items above.</td>
|
---|
| 215 | </tr>
|
---|
| 216 | </table>
|
---|
| 217 | </body>
|
---|
| 218 | </html>
|
---|