Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikita Nemkin2019-03-28 07:23:52 -0400
committerNiraj Modi2019-05-13 01:52:28 -0400
commitf804009794bd9f8d72782079d13adf55fdb5ef02 (patch)
tree44ac66f0733edbeb58bdc7212fa95aeb31600d66 /bundles/org.eclipse.swt/Eclipse SWT PI
parent461060f5b0570c7ad06157b8a3ea8894f3d1d545 (diff)
downloadeclipse.platform.swt-f804009794bd9f8d72782079d13adf55fdb5ef02.tar.gz
eclipse.platform.swt-f804009794bd9f8d72782079d13adf55fdb5ef02.tar.xz
eclipse.platform.swt-f804009794bd9f8d72782079d13adf55fdb5ef02.zip
Bug 546835 - [Win32] Remove application palette management
When running on a 8-bit (indexed) display, applications will be limited to the default 20-color palette. Change-Id: I4878aa17b63f55e4a6c8300e13f74c6728a700f2 Signed-off-by: Nikita Nemkin <nikita@nemkin.ru>
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT PI')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os.c102
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.c9
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.h9
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java36
4 files changed, 3 insertions, 153 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os.c b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os.c
index ee960d35cb..ed1dad625c 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os.c
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2018 IBM Corporation and others.
+ * Copyright (c) 2000, 2019 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -1118,22 +1118,6 @@ JNIEXPORT jintLong JNICALL OS_NATIVE(CreateMenu)
}
#endif
-#ifndef NO_CreatePalette
-JNIEXPORT jintLong JNICALL OS_NATIVE(CreatePalette)
- (JNIEnv *env, jclass that, jbyteArray arg0)
-{
- jbyte *lparg0=NULL;
- jintLong rc = 0;
- OS_NATIVE_ENTER(env, that, CreatePalette_FUNC);
- if (arg0) if ((lparg0 = (*env)->GetPrimitiveArrayCritical(env, arg0, NULL)) == NULL) goto fail;
- rc = (jintLong)CreatePalette((LOGPALETTE *)lparg0);
-fail:
- if (arg0 && lparg0) (*env)->ReleasePrimitiveArrayCritical(env, arg0, lparg0, JNI_ABORT);
- OS_NATIVE_EXIT(env, that, CreatePalette_FUNC);
- return rc;
-}
-#endif
-
#ifndef NO_CreatePatternBrush
JNIEXPORT jintLong JNICALL OS_NATIVE(CreatePatternBrush)
(JNIEnv *env, jclass that, jintLong arg0)
@@ -3230,18 +3214,6 @@ fail:
}
#endif
-#ifndef NO_GetNearestPaletteIndex
-JNIEXPORT jint JNICALL OS_NATIVE(GetNearestPaletteIndex)
- (JNIEnv *env, jclass that, jintLong arg0, jint arg1)
-{
- jint rc = 0;
- OS_NATIVE_ENTER(env, that, GetNearestPaletteIndex_FUNC);
- rc = (jint)GetNearestPaletteIndex((HPALETTE)arg0, (COLORREF)arg1);
- OS_NATIVE_EXIT(env, that, GetNearestPaletteIndex_FUNC);
- return rc;
-}
-#endif
-
#if (!defined(NO_GetObject__III) && !defined(JNI64)) || (!defined(NO_GetObject__JIJ) && defined(JNI64))
#ifndef JNI64
JNIEXPORT jint JNICALL OS_NATIVE(GetObject__III)(JNIEnv *env, jclass that, jintLong arg0, jint arg1, jintLong arg2)
@@ -3405,22 +3377,6 @@ fail:
}
#endif
-#ifndef NO_GetPaletteEntries
-JNIEXPORT jint JNICALL OS_NATIVE(GetPaletteEntries)
- (JNIEnv *env, jclass that, jintLong arg0, jint arg1, jint arg2, jbyteArray arg3)
-{
- jbyte *lparg3=NULL;
- jint rc = 0;
- OS_NATIVE_ENTER(env, that, GetPaletteEntries_FUNC);
- if (arg3) if ((lparg3 = (*env)->GetPrimitiveArrayCritical(env, arg3, NULL)) == NULL) goto fail;
- rc = (jint)GetPaletteEntries((HPALETTE)arg0, arg1, arg2, (LPPALETTEENTRY)lparg3);
-fail:
- if (arg3 && lparg3) (*env)->ReleasePrimitiveArrayCritical(env, arg3, lparg3, 0);
- OS_NATIVE_EXIT(env, that, GetPaletteEntries_FUNC);
- return rc;
-}
-#endif
-
#ifndef NO_GetParent
JNIEXPORT jintLong JNICALL OS_NATIVE(GetParent)
(JNIEnv *env, jclass that, jintLong arg0)
@@ -3696,22 +3652,6 @@ JNIEXPORT jint JNICALL OS_NATIVE(GetSystemMetrics)
}
#endif
-#ifndef NO_GetSystemPaletteEntries
-JNIEXPORT jint JNICALL OS_NATIVE(GetSystemPaletteEntries)
- (JNIEnv *env, jclass that, jintLong arg0, jint arg1, jint arg2, jbyteArray arg3)
-{
- jbyte *lparg3=NULL;
- jint rc = 0;
- OS_NATIVE_ENTER(env, that, GetSystemPaletteEntries_FUNC);
- if (arg3) if ((lparg3 = (*env)->GetPrimitiveArrayCritical(env, arg3, NULL)) == NULL) goto fail;
- rc = (jint)GetSystemPaletteEntries((HDC)arg0, (UINT)arg1, (UINT)arg2, (LPPALETTEENTRY)lparg3);
-fail:
- if (arg3 && lparg3) (*env)->ReleasePrimitiveArrayCritical(env, arg3, lparg3, 0);
- OS_NATIVE_EXIT(env, that, GetSystemPaletteEntries_FUNC);
- return rc;
-}
-#endif
-
#ifndef NO_GetTextColor
JNIEXPORT jint JNICALL OS_NATIVE(GetTextColor)
(JNIEnv *env, jclass that, jintLong arg0)
@@ -8555,18 +8495,6 @@ JNIEXPORT jint JNICALL OS_NATIVE(RECT_1sizeof)
}
#endif
-#ifndef NO_RealizePalette
-JNIEXPORT jint JNICALL OS_NATIVE(RealizePalette)
- (JNIEnv *env, jclass that, jintLong arg0)
-{
- jint rc = 0;
- OS_NATIVE_ENTER(env, that, RealizePalette_FUNC);
- rc = (jint)RealizePalette((HDC)arg0);
- OS_NATIVE_EXIT(env, that, RealizePalette_FUNC);
- return rc;
-}
-#endif
-
#ifndef NO_RectInRegion
JNIEXPORT jboolean JNICALL OS_NATIVE(RectInRegion)
(JNIEnv *env, jclass that, jintLong arg0, jobject arg1)
@@ -9759,18 +9687,6 @@ JNIEXPORT jintLong JNICALL OS_NATIVE(SelectObject)
}
#endif
-#ifndef NO_SelectPalette
-JNIEXPORT jintLong JNICALL OS_NATIVE(SelectPalette)
- (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jboolean arg2)
-{
- jintLong rc = 0;
- OS_NATIVE_ENTER(env, that, SelectPalette_FUNC);
- rc = (jintLong)SelectPalette((HDC)arg0, (HPALETTE)arg1, arg2);
- OS_NATIVE_EXIT(env, that, SelectPalette_FUNC);
- return rc;
-}
-#endif
-
#ifndef NO_SendInput
JNIEXPORT jint JNICALL OS_NATIVE(SendInput)
(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jint arg2)
@@ -10908,22 +10824,6 @@ JNIEXPORT jint JNICALL OS_NATIVE(SetMetaRgn)
}
#endif
-#ifndef NO_SetPaletteEntries
-JNIEXPORT jint JNICALL OS_NATIVE(SetPaletteEntries)
- (JNIEnv *env, jclass that, jintLong arg0, jint arg1, jint arg2, jbyteArray arg3)
-{
- jbyte *lparg3=NULL;
- jint rc = 0;
- OS_NATIVE_ENTER(env, that, SetPaletteEntries_FUNC);
- if (arg3) if ((lparg3 = (*env)->GetPrimitiveArrayCritical(env, arg3, NULL)) == NULL) goto fail;
- rc = (jint)SetPaletteEntries((HPALETTE)arg0, arg1, arg2, (PALETTEENTRY *)lparg3);
-fail:
- if (arg3 && lparg3) (*env)->ReleasePrimitiveArrayCritical(env, arg3, lparg3, JNI_ABORT);
- OS_NATIVE_EXIT(env, that, SetPaletteEntries_FUNC);
- return rc;
-}
-#endif
-
#ifndef NO_SetParent
JNIEXPORT jintLong JNICALL OS_NATIVE(SetParent)
(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1)
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.c b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.c
index 6713d7da63..94546b87c3 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.c
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2018 IBM Corporation and others.
+ * Copyright (c) 2000, 2019 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -110,7 +110,6 @@ char * OS_nativeFunctionNames[] = {
"CreateFontIndirect__Lorg_eclipse_swt_internal_win32_LOGFONT_2",
"CreateIconIndirect",
"CreateMenu",
- "CreatePalette",
"CreatePatternBrush",
"CreatePen",
"CreatePolygonRgn",
@@ -260,7 +259,6 @@ char * OS_nativeFunctionNames[] = {
"GetModuleFileName",
"GetModuleHandle",
"GetMonitorInfo",
- "GetNearestPaletteIndex",
#ifndef JNI64
"GetObject__III",
#else
@@ -288,7 +286,6 @@ char * OS_nativeFunctionNames[] = {
#endif
"GetOpenFileName",
"GetOutlineTextMetrics",
- "GetPaletteEntries",
"GetParent",
"GetPixel",
"GetPolyFillMode",
@@ -309,7 +306,6 @@ char * OS_nativeFunctionNames[] = {
"GetSystemDefaultUILanguage",
"GetSystemMenu",
"GetSystemMetrics",
- "GetSystemPaletteEntries",
"GetTextColor",
"GetTextExtentPoint32",
"GetTextMetrics",
@@ -963,7 +959,6 @@ char * OS_nativeFunctionNames[] = {
"PtInRegion",
"REBARBANDINFO_1sizeof",
"RECT_1sizeof",
- "RealizePalette",
"RectInRegion",
"Rectangle",
"RedrawWindow",
@@ -1045,7 +1040,6 @@ char * OS_nativeFunctionNames[] = {
"ScrollWindowEx",
"SelectClipRgn",
"SelectObject",
- "SelectPalette",
"SendInput",
#ifndef JNI64
"SendMessage__IIII",
@@ -1220,7 +1214,6 @@ char * OS_nativeFunctionNames[] = {
"SetMenuInfo",
"SetMenuItemInfo",
"SetMetaRgn",
- "SetPaletteEntries",
"SetParent",
"SetPixel",
"SetPolyFillMode",
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.h b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.h
index 8e2fb4ee60..c5df36e115 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_stats.h
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2018 IBM Corporation and others.
+ * Copyright (c) 2000, 2019 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -120,7 +120,6 @@ typedef enum {
CreateFontIndirect__Lorg_eclipse_swt_internal_win32_LOGFONT_2_FUNC,
CreateIconIndirect_FUNC,
CreateMenu_FUNC,
- CreatePalette_FUNC,
CreatePatternBrush_FUNC,
CreatePen_FUNC,
CreatePolygonRgn_FUNC,
@@ -270,7 +269,6 @@ typedef enum {
GetModuleFileName_FUNC,
GetModuleHandle_FUNC,
GetMonitorInfo_FUNC,
- GetNearestPaletteIndex_FUNC,
#ifndef JNI64
GetObject__III_FUNC,
#else
@@ -298,7 +296,6 @@ typedef enum {
#endif
GetOpenFileName_FUNC,
GetOutlineTextMetrics_FUNC,
- GetPaletteEntries_FUNC,
GetParent_FUNC,
GetPixel_FUNC,
GetPolyFillMode_FUNC,
@@ -319,7 +316,6 @@ typedef enum {
GetSystemDefaultUILanguage_FUNC,
GetSystemMenu_FUNC,
GetSystemMetrics_FUNC,
- GetSystemPaletteEntries_FUNC,
GetTextColor_FUNC,
GetTextExtentPoint32_FUNC,
GetTextMetrics_FUNC,
@@ -973,7 +969,6 @@ typedef enum {
PtInRegion_FUNC,
REBARBANDINFO_1sizeof_FUNC,
RECT_1sizeof_FUNC,
- RealizePalette_FUNC,
RectInRegion_FUNC,
Rectangle_FUNC,
RedrawWindow_FUNC,
@@ -1055,7 +1050,6 @@ typedef enum {
ScrollWindowEx_FUNC,
SelectClipRgn_FUNC,
SelectObject_FUNC,
- SelectPalette_FUNC,
SendInput_FUNC,
#ifndef JNI64
SendMessage__IIII_FUNC,
@@ -1230,7 +1224,6 @@ typedef enum {
SetMenuInfo_FUNC,
SetMenuItemInfo_FUNC,
SetMetaRgn_FUNC,
- SetPaletteEntries_FUNC,
SetParent_FUNC,
SetPixel_FUNC,
SetPolyFillMode_FUNC,
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java
index a3d5f93cba..19de3759b3 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java
@@ -1044,7 +1044,6 @@ public class OS extends C {
public static final int NULLREGION = 0x1;
public static final int NULL_BRUSH = 0x5;
public static final int NULL_PEN = 0x8;
- public static final int NUMRESERVED = 106;
public static final int OBJID_WINDOW = 0x00000000;
public static final int OBJID_SYSMENU = 0xFFFFFFFF;
public static final int OBJID_TITLEBAR = 0xFFFFFFFE;
@@ -1210,7 +1209,6 @@ public class OS extends C {
public static final int RB_SETBANDINFO = 0x40b;
public static final int RB_SETBKCOLOR = 0x413;
public static final int RB_SETTEXTCOLOR = 0x415;
- public static final int RC_PALETTE = 0x100;
public static final int RDW_ALLCHILDREN = 0x80;
public static final int RDW_ERASE = 0x4;
public static final int RDW_FRAME = 0x400;
@@ -1288,7 +1286,6 @@ public class OS extends C {
public static final int SIZE_RESTORED = 0;
public static final int SIZE_MINIMIZED = 1;
public static final int SIZE_MAXIMIZED = 2;
- public static final int SIZEPALETTE = 104;
public static final int SM_CMONITORS = 80;
public static final int SM_CXBORDER = 0x5;
public static final int SM_CXCURSOR = 0xd;
@@ -1900,13 +1897,11 @@ public class OS extends C {
public static final int WM_NOTIFY = 0x4e;
public static final int WM_NULL = 0x0;
public static final int WM_PAINT = 0xf;
- public static final int WM_PALETTECHANGED = 0x311;
public static final int WM_PARENTNOTIFY = 0x0210;
public static final int WM_PASTE = 0x302;
public static final int WM_PRINT = 0x0317;
public static final int WM_PRINTCLIENT = 0x0318;
public static final int WM_QUERYENDSESSION = 0x11;
- public static final int WM_QUERYNEWPALETTE = 0x30f;
public static final int WM_QUERYOPEN = 0x13;
public static final int WM_QUERYUISTATE = 0x129;
public static final int WM_RBUTTONDBLCLK = 0x206;
@@ -2521,8 +2516,6 @@ public static final native long /*int*/ CreateFontIndirect (LOGFONT lplf);
/** @param lplf flags=no_out */
public static final native long /*int*/ CreateIconIndirect (ICONINFO lplf);
public static final native long /*int*/ CreateMenu ();
-/** @param logPalette cast=(LOGPALETTE *),flags=no_out critical */
-public static final native long /*int*/ CreatePalette (byte[] logPalette);
/** @param hbmp cast=(HBITMAP) */
public static final native long /*int*/ CreatePatternBrush (long /*int*/ hbmp);
/** @param crColor cast=(COLORREF) */
@@ -2928,11 +2921,6 @@ public static final native long /*int*/ GetModuleHandle (char [] lpModuleName);
*/
public static final native boolean GetMonitorInfo (long /*int*/ hmonitor, MONITORINFO lpmi);
/**
- * @param hPal cast=(HPALETTE)
- * @param crColor cast=(COLORREF)
- */
-public static final native int GetNearestPaletteIndex (long /*int*/ hPal, int crColor);
-/**
* @param hgdiobj cast=(HGDIOBJ)
* @param lpvObject flags=no_in
*/
@@ -2961,11 +2949,6 @@ public static final native int GetObject (long /*int*/ hgdiobj, int cbBuffer, lo
public static final native boolean GetOpenFileName (OPENFILENAME lpofn);
/** @param hdc cast=(HDC) */
public static final native int GetOutlineTextMetrics (long /*int*/ hdc, int cbData, OUTLINETEXTMETRIC lpOTM);
-/**
- * @param hPalette cast=(HPALETTE)
- * @param logPalette cast=(LPPALETTEENTRY),flags=no_in critical
- */
-public static final native int GetPaletteEntries (long /*int*/ hPalette, int iStartIndex, int nEntries, byte[] logPalette);
/** @param hWnd cast=(HWND) */
public static final native long /*int*/ GetParent (long /*int*/ hWnd);
/** @param hdc cast=(HDC) */
@@ -3023,13 +3006,6 @@ public static final native short GetSystemDefaultUILanguage ();
/** @param hWnd cast=(HWND) */
public static final native long /*int*/ GetSystemMenu (long /*int*/ hWnd, boolean bRevert);
public static final native int GetSystemMetrics (int nIndex);
-/**
- * @param hdc cast=(HDC)
- * @param iStartIndex cast=(UINT)
- * @param nEntries cast=(UINT)
- * @param lppe cast=(LPPALETTEENTRY),flags=no_in critical
- */
-public static final native int GetSystemPaletteEntries (long /*int*/ hdc, int iStartIndex, int nEntries, byte[] lppe);
/** @param hDC cast=(HDC) */
public static final native int GetTextColor (long /*int*/ hDC);
/**
@@ -3887,8 +3863,6 @@ public static final native int PSPropertyKeyFromString (char[] pszString, PROPER
public static final native boolean PtInRect (RECT rect, POINT pt);
/** @param hrgn cast=(HRGN) */
public static final native boolean PtInRegion (long /*int*/ hrgn, int X, int Y);
-/** @param hDC cast=(HDC) */
-public static final native int RealizePalette (long /*int*/ hDC);
/** @param hdc cast=(HDC) */
public static final native boolean Rectangle (long /*int*/ hdc, int nLeftRect, int nTopRect, int nRightRect, int nBottomRect);
/**
@@ -4143,11 +4117,6 @@ public static final native int SelectClipRgn (long /*int*/ hdc, long /*int*/ hrg
* @param HGDIObj cast=(HGDIOBJ)
*/
public static final native long /*int*/ SelectObject (long /*int*/ hDC, long /*int*/ HGDIObj);
-/**
- * @param hDC cast=(HDC)
- * @param hpal cast=(HPALETTE)
- */
-public static final native long /*int*/ SelectPalette (long /*int*/ hDC, long /*int*/ hpal, boolean bForceBackground);
/** @param pInputs cast=(LPINPUT) */
public static final native int SendInput (int nInputs, long /*int*/ pInputs, int cbSize);
/**
@@ -4395,11 +4364,6 @@ public static final native boolean SetMenuItemInfo (long /*int*/ hMenu, int uIte
/** @param hdc cast=(HDC) */
public static final native int SetMetaRgn (long /*int*/ hdc);
/**
- * @param hPal cast=(HPALETTE)
- * @param lppe cast=(PALETTEENTRY *),flags=no_out critical
- */
-public static final native int SetPaletteEntries (long /*int*/ hPal, int iStart, int cEntries, byte[] lppe);
-/**
* @param hWndChild cast=(HWND)
* @param hWndNewParent cast=(HWND)
*/

Back to the top