Skip to content

Commit 739b489

Browse files
committed
[win32] Dynamic handle creation for region
This commit refactors Region in the win32 implementation to better support multiple handles for different zoom settings by creating all handles only on demand.
1 parent 9f60279 commit 739b489

File tree

4 files changed

+107
-154
lines changed

4 files changed

+107
-154
lines changed

binaries/org.eclipse.swt.win32.win32.x86_64/.settings/.api_filters

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,20 @@
592592
</message_arguments>
593593
</filter>
594594
</resource>
595+
<resource path="Eclipse SWT/win32/org/eclipse/swt/graphics/Region.java" type="org.eclipse.swt.graphics.Region">
596+
<filter id="338792546">
597+
<message_arguments>
598+
<message_argument value="org.eclipse.swt.graphics.Region"/>
599+
<message_argument value="equals(Object)"/>
600+
</message_arguments>
601+
</filter>
602+
<filter id="338792546">
603+
<message_arguments>
604+
<message_argument value="org.eclipse.swt.graphics.Region"/>
605+
<message_argument value="hashCode()"/>
606+
</message_arguments>
607+
</filter>
608+
</resource>
595609
<resource path="Eclipse SWT/win32/org/eclipse/swt/widgets/Composite.java" type="org.eclipse.swt.widgets.Composite">
596610
<filter id="576778288">
597611
<message_arguments>

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

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -424,23 +424,6 @@ void destroy() {
424424
handle = 0;
425425
}
426426

427-
/**
428-
* Compares the argument to the receiver, and returns true
429-
* if they represent the <em>same</em> object using a class
430-
* specific comparison.
431-
*
432-
* @param object the object to compare with this object
433-
* @return <code>true</code> if the object is the same as this object and <code>false</code> otherwise
434-
*
435-
* @see #hashCode
436-
*/
437-
@Override
438-
public boolean equals(Object object) {
439-
if (this == object) return true;
440-
if (!(object instanceof Region region)) return false;
441-
return handle == region.handle;
442-
}
443-
444427
/**
445428
* Returns a rectangle which represents the rectangular
446429
* union of the collection of polygons the receiver
@@ -499,21 +482,6 @@ long regionToRects(long message, long rgn, long r, long path) {
499482
return 0;
500483
}
501484

502-
/**
503-
* Returns an integer hash code for the receiver. Any two
504-
* objects that return <code>true</code> when passed to
505-
* <code>equals</code> must return the same value for this
506-
* method.
507-
*
508-
* @return the receiver's hash
509-
*
510-
* @see #equals
511-
*/
512-
@Override
513-
public int hashCode() {
514-
return (int)handle;
515-
}
516-
517485
/**
518486
* Intersects the given rectangle to the collection of polygons
519487
* the receiver maintains to describe its area.

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

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -298,24 +298,6 @@ void destroy() {
298298
handle = 0;
299299
}
300300

301-
/**
302-
* Compares the argument to the receiver, and returns true
303-
* if they represent the <em>same</em> object using a class
304-
* specific comparison.
305-
*
306-
* @param object the object to compare with this object
307-
* @return <code>true</code> if the object is the same as this object and <code>false</code> otherwise
308-
*
309-
* @see #hashCode
310-
*/
311-
@Override
312-
public boolean equals(Object object) {
313-
if (this == object) return true;
314-
if (!(object instanceof Region)) return false;
315-
Region region = (Region)object;
316-
return handle == region.handle;
317-
}
318-
319301
/**
320302
* Returns a rectangle which represents the rectangular
321303
* union of the collection of polygons the receiver
@@ -359,21 +341,6 @@ public static Region gtk_new(Device device, long handle) {
359341
return new Region(device, handle);
360342
}
361343

362-
/**
363-
* Returns an integer hash code for the receiver. Any two
364-
* objects that return <code>true</code> when passed to
365-
* <code>equals</code> must return the same value for this
366-
* method.
367-
*
368-
* @return the receiver's hash
369-
*
370-
* @see #equals
371-
*/
372-
@Override
373-
public int hashCode() {
374-
return (int)handle;
375-
}
376-
377344
/**
378345
* Intersects the given rectangle to the collection of polygons
379346
* the receiver maintains to describe its area.

0 commit comments

Comments
 (0)