Skip to content

Commit 7ea6253

Browse files
Adding native code
1 parent 4ef8a5d commit 7ea6253

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2000, 2024 IBM Corporation and others.
2+
* Copyright (c) 2000, 2025 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -124,6 +124,22 @@ JNIEXPORT jboolean JNICALL OS_NATIVE(AdjustWindowRectEx)
124124
}
125125
#endif
126126

127+
#ifndef NO_AdjustWindowRectExForDpi
128+
JNIEXPORT jboolean JNICALL OS_NATIVE(AdjustWindowRectExForDpi)
129+
(JNIEnv *env, jclass that, jobject arg0, jint arg1, jboolean arg2, jint arg3, jint arg4)
130+
{
131+
RECT _arg0, *lparg0=NULL;
132+
jboolean rc = 0;
133+
OS_NATIVE_ENTER(env, that, AdjustWindowRectExForDpi_FUNC);
134+
if (arg0) if ((lparg0 = getRECTFields(env, arg0, &_arg0)) == NULL) goto fail;
135+
rc = (jboolean)AdjustWindowRectExForDpi(lparg0, arg1, arg2, arg3, arg4);
136+
fail:
137+
if (arg0 && lparg0) setRECTFields(env, arg0, lparg0);
138+
OS_NATIVE_EXIT(env, that, AdjustWindowRectExForDpi_FUNC);
139+
return rc;
140+
}
141+
#endif
142+
127143
#ifndef NO_AllowSetForegroundWindow
128144
JNIEXPORT jboolean JNICALL OS_NATIVE(AllowSetForegroundWindow)
129145
(JNIEnv *env, jclass that, jint arg0)

bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2000, 2024 IBM Corporation and others.
2+
* Copyright (c) 2000, 2025 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -30,6 +30,7 @@ typedef enum {
3030
ActivateKeyboardLayout_FUNC,
3131
AddFontResourceEx_FUNC,
3232
AdjustWindowRectEx_FUNC,
33+
AdjustWindowRectExForDpi_FUNC,
3334
AllowDarkModeForWindow_FUNC,
3435
AllowSetForegroundWindow_FUNC,
3536
AlphaBlend_FUNC,

0 commit comments

Comments
 (0)