Skip to content

Commit 2b9121b

Browse files
Deprecation: Cursor(Device, ImageData, ImageData, int, int)
The constructor Cursor(Device, ImageData source, ImageData mask, int hotspotX, int hotspotY) allows creating a cursor by providing a source image and a 1-bit mask to define transparency. This approach requires developers to manually define mask pixels and works reliably only in fixed DPI environments.recommended to use: Cursor(Device device, ImageDataProvider imageDataProvider, int hotspotX, int hotspotY).
1 parent ce98326 commit 2b9121b

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Cursor.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,10 @@ public Cursor(Device device, int style) {
276276
* </ul>
277277
*
278278
* @see #dispose()
279+
*
280+
* @deprecated Use {@link #Cursor(Device, ImageDataProvider, int, int)} instead.
279281
*/
282+
@Deprecated
280283
public Cursor(Device device, ImageData source, ImageData mask, int hotspotX, int hotspotY) {
281284
super(device);
282285
if (source == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);

bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Cursor.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,10 @@ public Cursor(Device device, int style) {
184184
* </ul>
185185
*
186186
* @see #dispose()
187+
*
188+
* @deprecated Use {@link #Cursor(Device, ImageDataProvider, int, int)} instead.
187189
*/
190+
@Deprecated
188191
public Cursor(Device device, ImageData source, ImageData mask, int hotspotX, int hotspotY) {
189192
super(device);
190193
if (source == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);

bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Cursor.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,10 @@ public Cursor(Device device, int style) {
146146
* </ul>
147147
*
148148
* @see #dispose()
149+
*
150+
* @deprecated Use {@link #Cursor(Device, ImageDataProvider, int, int)} instead.
149151
*/
152+
@Deprecated
150153
public Cursor(Device device, ImageData source, ImageData mask, int hotspotX, int hotspotY) {
151154
super(device);
152155
this.cursorHandleProvider = new ImageDataWithMaskCursorHandleProvider(source, mask, hotspotX, hotspotY);

0 commit comments

Comments
 (0)