Skip to content

Commit

Permalink
Merge branch 'eclipse-platform:master' into fileDialogError
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonhy-wang authored Jun 23, 2022
2 parents 61afb9d + c280d68 commit 272353b
Show file tree
Hide file tree
Showing 46 changed files with 333 additions and 556 deletions.
18 changes: 9 additions & 9 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ A clear and concise description of what you expected to happen.
If applicable, add screenshots to help explain your problem.

**Environment:**
- Select the platforms on which the behavior is seen.
[x] All OS
[ ] Windows
[ ] Linux
[ ] macOS
- Additional OS info (e.g. OS version, Linux Desktop, etc)
- JRE/JDK version
1. Select the platform(s) on which the behavior is seen:
- - [x] All OS
- - [ ] Windows
- - [ ] Linux
- - [ ] macOS

2. Additional OS info (e.g. OS version, Linux Desktop, etc)

3. JRE/JDK version

**Version since**
Eclipse or SWT version since when the behavior is seen [e.g. 4.23]
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/rebase.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Automatic Rebase
on:
issue_comment:
types: [created]
jobs:
rebase:
name: Rebase
if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/rebase')
runs-on: ubuntu-latest
steps:
- name: Checkout the latest code
uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0 # otherwise, you will fail to push refs to dest repo
- name: Automatic Rebase
uses: cirrus-actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10 changes: 5 additions & 5 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ spec:
memory: "512Mi"
cpu: "500m"
- name: container
image: akurtakov/swtbuild@sha256:fca953c5f0fa9fadb92b1875c1942f6042f4bd51327d1e1e8e40f39923103fe1
image: akurtakov/swtbuild@sha256:43085feb91b1703e019a282188d996607385dcd746a7441cb7d2ca453a0adcc9
tty: true
command: [ "uid_entrypoint", "cat" ]
resources:
Expand All @@ -37,9 +37,9 @@ spec:
mountPath: "/home/jenkins/.m2/settings.xml"
subPath: "settings.xml"
readOnly: true
- name: "toolchains-xml"
mountPath: "/home/jenkins/.m2/toolchains.xml"
subPath: "toolchains.xml"
- name: toolchains-xml
mountPath: /home/jenkins/.m2/toolchains.xml
subPath: toolchains.xml
readOnly: true
- name: "settings-security-xml"
mountPath: "/home/jenkins/.m2/settings-security.xml"
Expand Down Expand Up @@ -97,7 +97,7 @@ spec:
steps {
container('container') {
wrap([$class: 'Xvnc', useXauthority: true]) {
withEnv(["JAVA_HOME=${ tool 'openjdk-jdk11-latest' }"]) {
withEnv(["JAVA_HOME=${ tool 'openjdk-jdk17-latest' }"]) {
dir ('eclipse.platform.swt.binaries') {
sh '/opt/tools/apache-maven/latest/bin/mvn --batch-mode -Pbuild-individual-bundles -DforceContextQualifier=zzz -Dnative=gtk.linux.x86_64 -DskipJni -DskipRust -Dcompare-version-with-baselines.skip=true -Dmaven.compiler.failOnWarning=true install '
}
Expand Down
2 changes: 1 addition & 1 deletion bundles/org.eclipse.swt.tools.base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<parent>
<artifactId>eclipse.platform.swt.localbuild</artifactId>
<groupId>eclipse.platform.swt</groupId>
<version>4.24.0-SNAPSHOT</version>
<version>4.25.0-SNAPSHOT</version>
<relativePath>../../local-build/local-build-parent/</relativePath>
</parent>
<groupId>org.eclipse.swt</groupId>
Expand Down
2 changes: 1 addition & 1 deletion bundles/org.eclipse.swt.tools.spies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<parent>
<artifactId>eclipse.platform.swt.localbuild</artifactId>
<groupId>eclipse.platform.swt</groupId>
<version>4.24.0-SNAPSHOT</version>
<version>4.25.0-SNAPSHOT</version>
<relativePath>../../local-build/local-build-parent/</relativePath>
</parent>
<groupId>org.eclipse.swt</groupId>
Expand Down
2 changes: 1 addition & 1 deletion bundles/org.eclipse.swt.tools/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-SymbolicName: org.eclipse.swt.tools; singleton:=true
Bundle-Version: 3.109.400.qualifier
Bundle-Version: 3.109.500.qualifier
Bundle-ManifestVersion: 2
Export-Package: org.eclipse.swt.tools.internal; x-internal:=true
Bundle-ActivationPolicy: lazy
Expand Down
2 changes: 0 additions & 2 deletions bundles/org.eclipse.swt.tools/Oomph/platformSwt.setup
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,6 @@
name="org.eclipse.jdt.feature.group"/>
<requirement
name="org.eclipse.pde.feature.group"/>
<requirement
name="org.eclipse.pde.api.tools.ee.feature.feature.group"/>
<repository
url="${eclipse.latest.p2}"/>
</setupTask>
Expand Down
4 changes: 2 additions & 2 deletions bundles/org.eclipse.swt.tools/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
<parent>
<artifactId>eclipse.platform.swt.localbuild</artifactId>
<groupId>eclipse.platform.swt</groupId>
<version>4.24.0-SNAPSHOT</version>
<version>4.25.0-SNAPSHOT</version>
<relativePath>../../local-build/local-build-parent/</relativePath>
</parent>
<groupId>org.eclipse.swt</groupId>
<artifactId>org.eclipse.swt.tools</artifactId>
<version>3.109.400-SNAPSHOT</version>
<version>3.109.500-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ public class CTabFolder extends Composite {
boolean selectionGradientVertical;
Color selectionForeground;
Color selectionBackground;
int selectionHighlightBarThickness = 2;

/* Unselected item appearance */
Color[] gradientColors;
Expand Down Expand Up @@ -3470,6 +3471,27 @@ public void setSelectionForeground (Color color) {
if (selectedIndex > -1) redraw();
}

/**
* Sets the thickness of the highlight bar on the selected tab. The highlight bar is drawn in the top margin of the selected tab.
*
* @param thickness the desired thickness. Must be positive and lower than {@link CTabFolderRenderer#ITEM_TOP_MARGIN} (that is either {@code 0} {@code 1} or {@code 2} at the moment),for correct results.
* Set to {@code 0} to not draw a highlight bar.
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* <li>ERROR_INVALID_ARGUMENT - if the parameter value is invalid</li>
* </ul>
* @implNote Default {@link CTabFolderRenderer} currently ignores this setting if {@link #getSimple()} is {@code true}.
* @since 3.121
*/
public void setSelectionBarThickness(int thickness) {
checkWidget();
if (thickness < 0) {
SWT.error(SWT.ERROR_INVALID_ARGUMENT);
}
this.selectionHighlightBarThickness = thickness;
}

/**
* Sets the shape that the CTabFolder will use to render itself.
*
Expand Down Expand Up @@ -4192,7 +4214,7 @@ public void setHighlightEnabled(boolean enabled) {
* highlighted.
*
* @return <code>true</code> if the selected tab is rendered as
* highlighted
* highlighted.
*
* @exception SWTException
* <ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1354,10 +1354,18 @@ void drawSelected(int itemIndex, GC gc, Rectangle bounds, int state ) {
}
}

//Highlight MUST be drawn before the outline so that outline can cover it in the right spots (start of swoop)
//Highlight colors MUST be drawn before the outline so that outline can cover it in the right spots (start of swoop)
//otherwise the curve looks jagged
drawHighlight(gc, bounds, state, rightEdge);

// draw highlight marker of selected tab
if (parent.selectionHighlightBarThickness > 0 && parent.simple) {
Color previousColor = gc.getBackground();
gc.setBackground(item.getDisplay().getSystemColor(parent.shouldHighlight() ? SWT.COLOR_LIST_SELECTION : SWT.COLOR_WIDGET_DISABLED_FOREGROUND));
gc.fillRectangle(x + 1 /* outline */, parent.onBottom ? y + height - 1 - parent.selectionHighlightBarThickness : y + 1, width - 2 /*outline*/, parent.selectionHighlightBarThickness);
gc.setBackground(previousColor);
}

// draw outline
shape[0] = Math.max(0, borderLeft - 1);
if (borderLeft == 0 && itemIndex == parent.firstIndex) {
Expand Down Expand Up @@ -1797,4 +1805,5 @@ void updateCurves () {
boolean useEllipses() {
return parent.simple;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@


import org.eclipse.swt.*;
import org.eclipse.swt.graphics.*;
import org.eclipse.swt.internal.*;
import org.eclipse.swt.internal.gtk.*;
import org.eclipse.swt.internal.gtk3.*;
Expand Down Expand Up @@ -348,6 +349,18 @@ private Object getContents_gtk4(Transfer transfer, int clipboards) {
}
return str;
}
if(transfer.getTypeIds()[0] == (int)GDK.GDK_TYPE_PIXBUF()) {
ImageData imgData = null;
OS.g_value_init(value, GDK.GDK_TYPE_PIXBUF());
if (!GTK4.gdk_content_provider_get_value (contents, value, null)) return null;
long pixbufObj = OS.g_value_get_object(value);
if (pixbufObj != 0) {
Image img = Image.gtk_new_from_pixbuf(Display.getCurrent(), SWT.BITMAP, pixbufObj);
imgData = img.getImageData();
img.dispose();
}
return imgData;
}
//TODO: [GTK4] Other cases
return null;
}
Expand Down Expand Up @@ -539,6 +552,8 @@ public TransferData[] getAvailableTypes() {
*/
public TransferData[] getAvailableTypes(int clipboards) {
checkWidget();

//TODO: [GTK4] This currently will not work in GTK4
TransferData[] result = null;
if ((clipboards & DND.CLIPBOARD) != 0) {
int[] types = getAvailableClipboardTypes();
Expand Down Expand Up @@ -585,6 +600,12 @@ public TransferData[] getAvailableTypes(int clipboards) {
*/
public String[] getAvailableTypeNames() {
checkWidget();
if(GTK.GTK4) {
long formatsCStr = GTK4.gdk_content_formats_to_string(GTK4.gdk_clipboard_get_formats(Clipboard.GTKCLIPBOARD));
String formatsStr = Converter.cCharPtrToJavaString(formatsCStr, true);
String[] types = formatsStr.split(" ");
return types;
}
int[] types1 = getAvailableClipboardTypes();
int[] types2 = getAvailablePrimaryTypes();
String[] result = new String[types1.length + types2.length];
Expand Down Expand Up @@ -637,12 +658,6 @@ private int[] getAvailablePrimaryTypes() {
}
private int[] getAvailableClipboardTypes () {

if(GTK.GTK4) {
/*TODO: can use gdk_clipboard_get_formats and gdk_content_formats_to_string
*Then from the comma separated list of formats find their respective IDs
*/
}

int[] types = new int[0];
long selection_data = gtk_clipboard_wait_for_contents(GTKCLIPBOARD, TARGET);
if (selection_data != 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
package org.eclipse.swt.dnd;


import org.eclipse.swt.*;
import org.eclipse.swt.graphics.*;
import org.eclipse.swt.internal.*;
import org.eclipse.swt.internal.gtk.*;
import org.eclipse.swt.internal.gtk3.*;
Expand Down Expand Up @@ -220,8 +222,6 @@ boolean setData(Clipboard owner, Object[] data, Transfer[] dataTypes, int clipbo

private boolean setData_gtk4(Clipboard owner, Object[] data, Transfer[] dataTypes, int clipboards) {
boolean result = false;

//Handle the text transfer case first
for (int i = 0; i < dataTypes.length; i++) {
Transfer transfer = dataTypes[i];
String[] typeNames = transfer.getTypeNames();
Expand All @@ -232,15 +232,25 @@ private boolean setData_gtk4(Clipboard owner, Object[] data, Transfer[] dataType
activeClipboard = owner;
}
}
//TODO: [GTK4] Other cases for setting data
return result;
}

private boolean setContentFromType(long clipboard, String string, Object data) {
if(data != null) {
if (data == null ) SWT.error(SWT.ERROR_NULL_ARGUMENT);
else {
if(string.equals("STRING") || string.equals("text/rtf")) {
GTK4.gdk_clipboard_set_text(clipboard, Converter.javaStringToCString((String)data));
}
if(string.equals("PIXBUF")) {
if(!(data instanceof ImageData)) DND.error(DND.ERROR_INVALID_DATA);
ImageData imgData = (ImageData)data;
Image image = new Image(Display.getCurrent(), imgData);
long pixbuf = ImageList.createPixbuf(image);
if (pixbuf != 0) {
GTK4.gdk_clipboard_set(clipboard, GDK.GDK_TYPE_PIXBUF(), pixbuf);
}
image.dispose();
}
return true;
}
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,27 +40,27 @@ public class ImageTransfer extends ByteArrayTransfer {
private static ImageTransfer _instance = new ImageTransfer();

private static final String JPEG = "image/jpeg"; //$NON-NLS-1$
private static final int JPEG_ID = registerType(JPEG);
private static final int JPEG_ID = GTK.GTK4 ? 0: registerType(JPEG);
private static final String PNG = "image/png"; //$NON-NLS-1$
private static final int PNG_ID = registerType(PNG);
private static final int PNG_ID = GTK.GTK4 ? 0:registerType(PNG);
private static final String BMP = "image/bmp"; //$NON-NLS-1$
private static final int BMP_ID = registerType(BMP);
private static final int BMP_ID = GTK.GTK4 ? 0:registerType(BMP);
private static final String EPS = "image/eps"; //$NON-NLS-1$
private static final int EPS_ID = registerType(EPS);
private static final int EPS_ID = GTK.GTK4 ? 0:registerType(EPS);
private static final String PCX = "image/pcx"; //$NON-NLS-1$
private static final int PCX_ID = registerType(PCX);
private static final int PCX_ID = GTK.GTK4 ? 0:registerType(PCX);
private static final String PPM = "image/ppm"; //$NON-NLS-1$
private static final int PPM_ID = registerType(PPM);
private static final int PPM_ID = GTK.GTK4 ? 0:registerType(PPM);
private static final String RGB = "image/ppm"; //$NON-NLS-1$
private static final int RGB_ID = registerType(RGB);
private static final int RGB_ID = GTK.GTK4 ? 0:registerType(RGB);
private static final String TGA = "image/tga"; //$NON-NLS-1$
private static final int TGA_ID = registerType(TGA);
private static final int TGA_ID = GTK.GTK4 ? 0:registerType(TGA);
private static final String XBM = "image/xbm"; //$NON-NLS-1$
private static final int XBM_ID = registerType(XBM);
private static final int XBM_ID = GTK.GTK4 ? 0:registerType(XBM);
private static final String XPM = "image/xpm"; //$NON-NLS-1$
private static final int XPM_ID = registerType(XPM);
private static final int XPM_ID = GTK.GTK4 ? 0:registerType(XPM);
private static final String XV = "image/xv"; //$NON-NLS-1$
private static final int XV_ID = registerType(XV);
private static final int XV_ID = GTK.GTK4 ? 0:registerType(XV);

private ImageTransfer() {}

Expand Down Expand Up @@ -116,7 +116,7 @@ public void javaToNative(Object object, TransferData transferData) {
transferData.result = 1;
// The following value has been changed from 32 to 8 as a simple fix for #146
// See https://www.cc.gatech.edu/data_files/public/doc/gtk/tutorial/gtk_tut-16.html where it states:
// "The format field is actually important here - the X server uses it to figure out whether the data
// "The format field is actually important here - the X server uses it to figure out whether the data
// needs to be byte-swapped or not. Usually it will be 8 - i.e. a character - or 32 - i.e. a. integer."
transferData.format = 8;
}
Expand Down Expand Up @@ -156,11 +156,17 @@ public Object nativeToJava(TransferData transferData) {

@Override
protected int[] getTypeIds(){
if(GTK.GTK4) {
return new int[] {(int) GDK.GDK_TYPE_PIXBUF()};
}
return new int[]{PNG_ID, BMP_ID, EPS_ID, JPEG_ID, PCX_ID, PPM_ID, RGB_ID, TGA_ID, XBM_ID, XPM_ID, XV_ID};
}

@Override
protected String[] getTypeNames(){
if(GTK.GTK4) {
return new String[]{"PIXBUF"};
}
return new String[]{PNG, BMP, EPS, JPEG, PCX, PPM, RGB, TGA, XBM, XPM, XV};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ public class Library {
/**
* SWT Minor version number (must be in the range 0..999)
*/
static int MINOR_VERSION = 952;
static int MINOR_VERSION = 954;

/**
* SWT revision number (must be >= 0)
*/
static int REVISION = 11;
static int REVISION = 3;

/**
* The JAVA and SWT versions
Expand Down
Loading

0 comments on commit 272353b

Please sign in to comment.