Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions org.eclipse.wb.doc.user/html-src/whatsnew/v125.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
ifdef::env-github[]
:imagesdir: ../../html/whatsnew
endif::[]

= What's New - v1.25.0

== General

- [Linux] Wayland Support for SWT Designer

The screenshot mechanism for GTK3 has been adapted to support both X11 and Wayland. _Note_ This support is only
available with Java 24 or higher.

What's new - xref:v124.adoc[*v1.24.0*]
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@
* Contributors:
* Patrick Ziegler - initial API and implementation
*******************************************************************************/
package org.eclipse.wb.internal.os.linux.cairo;
package org.eclipse.wb.internal.os.linux;

import org.eclipse.wb.internal.core.utils.reflect.ReflectionUtils;

import org.eclipse.swt.graphics.GC;

import java.lang.foreign.MemorySegment;

Expand All @@ -21,6 +25,19 @@
* Cairo contexts, as {@code cairo_t} objects are named, are central to cairo
* and all drawing with cairo is always done to a cairo_t object.
*/
public record CairoContext(MemorySegment segment) {
public record Cairo(MemorySegment segment) {
/**
* Creates a new CairoContext instance associated with the GC object.
*
* @param gc The context to paint on.
* @return The Cairo context backed by the given GC.
*/
public static Cairo from(GC gc) {
long handle = getHandleValue(gc, "handle");
return new Cairo(MemorySegment.ofAddress(handle));
}

private static long getHandleValue(GC gc, String fieldName) {
return ReflectionUtils.getFieldLong(gc, fieldName);
}
}

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading