Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelipe Heidrich2003-10-21 12:05:14 -0400
committerFelipe Heidrich2003-10-21 12:05:14 -0400
commit417d224d7ff1030a70a8f1f77ff6406c4cdb6a81 (patch)
tree21c31076277ea03a42cfee7922639546ff626210
parentaae8e21e3c379b8af28005dfae74ab7b7e0573c8 (diff)
downloadeclipse.platform.swt-417d224d7ff1030a70a8f1f77ff6406c4cdb6a81.tar.gz
eclipse.platform.swt-417d224d7ff1030a70a8f1f77ff6406c4cdb6a81.tar.xz
eclipse.platform.swt-417d224d7ff1030a70a8f1f77ff6406c4cdb6a81.zip
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/swt.c16
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/internal/BidiUtil.java20
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java20
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java4
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java4
6 files changed, 46 insertions, 20 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/swt.c b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/swt.c
index 9ca13a3cc5..99de5ce610 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/swt.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/swt.c
@@ -2008,11 +2008,21 @@ JNIEXPORT jboolean JNICALL OS_NATIVE(GetComboBoxInfo)
{
COMBOBOXINFO _arg1, *lparg1=NULL;
jboolean rc;
-
DEBUG_CALL("GetComboBoxInfo\n\n")
-
if (arg1) lparg1 = getCOMBOBOXINFOFields(env, arg1, &_arg1);
- rc = (jboolean)GetComboBoxInfo((HWND)arg0, lparg1);
+ {
+ /*
+ * GetComboBoxInfo is a Win2000 and Win98 specific call
+ * If you link it into swt.dll a system modal entry point not found dialog will
+ * appear as soon as swt.dll is loaded. Here we check for the entry point and
+ * only do the call if it exists.
+ */
+ HMODULE hm;
+ FARPROC fp;
+ if ((hm=GetModuleHandle("user32.dll")) && (fp=GetProcAddress(hm, "GetComboBoxInfo"))) {
+ rc = (jboolean)(fp)((HWND)arg0, lparg1);
+ }
+ }
if (arg1) setCOMBOBOXINFOFields(env, arg1, lparg1);
return rc;
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java
index 89b8f36e72..7a7991ff89 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/GC.java
@@ -1983,7 +1983,7 @@ void init(Drawable drawable, GCData data, int hDC) {
}
int layout = data.layout;
if (layout != -1) {
- if ((OS.WIN32_MAJOR << 16 | OS.WIN32_MINOR) >= (4 << 16 | 10)) {
+ if ((OS.WIN32_MAJOR << 16 | OS.WIN32_MINOR) >= (4 << 16 | 10)) {
int flags = OS.GetLayout(hDC);
if ((flags & OS.LAYOUT_RTL) != (layout & OS.LAYOUT_RTL)) {
flags &= ~OS.LAYOUT_RTL;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/internal/BidiUtil.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/internal/BidiUtil.java
index 27cd786f66..6f587a0d98 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/internal/BidiUtil.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/internal/BidiUtil.java
@@ -134,10 +134,12 @@ static int EnumSystemLanguageGroupsProc(int lpLangGrpId, int lpLangGrpIdString,
public static void drawGlyphs(GC gc, char[] renderBuffer, int[] renderDx, int x, int y) {
int length = renderDx.length;
- if (OS.GetLayout (gc.handle) != 0) {
- reverse(renderDx);
- renderDx[length-1]--; //fixes bug 40006
- reverse(renderBuffer);
+ if ((OS.WIN32_MAJOR << 16 | OS.WIN32_MINOR) >= (4 << 16 | 10)) {
+ if (OS.GetLayout (gc.handle) != 0) {
+ reverse(renderDx);
+ renderDx[length-1]--; //fixes bug 40006
+ reverse(renderBuffer);
+ }
}
// render transparently to avoid overlapping segments. fixes bug 40006
int oldBkMode = OS.SetBkMode(gc.handle, OS.TRANSPARENT);
@@ -167,7 +169,10 @@ public static char[] getRenderInfo(GC gc, String text, int[] order, byte[] class
int hHeap = OS.GetProcessHeap();
int[] lpCs = new int[8];
int cs = OS.GetTextCharset(gc.handle);
- boolean isRightOriented = OS.GetLayout(gc.handle) != 0;
+ boolean isRightOriented = false;
+ if ((OS.WIN32_MAJOR << 16 | OS.WIN32_MINOR) >= (4 << 16 | 10)) {
+ isRightOriented = OS.GetLayout(gc.handle) != 0;
+ }
OS.TranslateCharsetInfo(cs, lpCs, OS.TCI_SRCCHARSET);
TCHAR textBuffer = new TCHAR(lpCs[1], text, false);
int byteCount = textBuffer.length();
@@ -300,7 +305,10 @@ public static void getOrderInfo(GC gc, String text, int[] order, byte[] classBuf
OS.TranslateCharsetInfo(cs, lpCs, OS.TCI_SRCCHARSET);
TCHAR textBuffer = new TCHAR(lpCs[1], text, false);
int byteCount = textBuffer.length();
- boolean isRightOriented = (OS.GetLayout(gc.handle) != 0);
+ boolean isRightOriented = false;
+ if ((OS.WIN32_MAJOR << 16 | OS.WIN32_MINOR) >= (4 << 16 | 10)) {
+ isRightOriented = OS.GetLayout(gc.handle) != 0;
+ }
GCP_RESULTS result = new GCP_RESULTS();
result.lStructSize = GCP_RESULTS.sizeof;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java
index dc0b14f966..b7fa98ff9d 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java
@@ -1016,16 +1016,20 @@ public int internal_new_GC (GCData data) {
}
if (hDC == 0) SWT.error(SWT.ERROR_NO_HANDLES);
if (data != null) {
- int mask = SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT;
- if ((data.style & mask) != 0) {
- data.layout = (data.style & SWT.RIGHT_TO_LEFT) != 0 ? OS.LAYOUT_RTL : 0;
- } else {
- int flags = OS.GetLayout (hDC);
- if ((flags & OS.LAYOUT_RTL) != 0) {
- data.style |= SWT.RIGHT_TO_LEFT | SWT.MIRRORED;
+ if ((OS.WIN32_MAJOR << 16 | OS.WIN32_MINOR) >= (4 << 16 | 10)) {
+ int mask = SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT;
+ if ((data.style & mask) != 0) {
+ data.layout = (data.style & SWT.RIGHT_TO_LEFT) != 0 ? OS.LAYOUT_RTL : 0;
} else {
- data.style |= SWT.LEFT_TO_RIGHT;
+ int flags = OS.GetLayout (hDC);
+ if ((flags & OS.LAYOUT_RTL) != 0) {
+ data.style |= SWT.RIGHT_TO_LEFT | SWT.MIRRORED;
+ } else {
+ data.style |= SWT.LEFT_TO_RIGHT;
+ }
}
+ } else {
+ data.style |= SWT.LEFT_TO_RIGHT;
}
data.device = getDisplay ();
data.foreground = getForegroundPixel ();
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java
index dc56325db7..2899b205dd 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java
@@ -1601,7 +1601,9 @@ void setCheckboxImageList (int width, int height) {
int count = 4;
int hStateList = OS.ImageList_Create (width, height, OS.ILC_COLOR, count, count);
int hDC = OS.GetDC (handle);
- OS.SetLayout (hDC, 0);
+ if ((OS.WIN32_MAJOR << 16 | OS.WIN32_MINOR) >= (4 << 16 | 10)) {
+ OS.SetLayout (hDC, 0);
+ }
int memDC = OS.CreateCompatibleDC (hDC);
int hBitmap = OS.CreateCompatibleBitmap (hDC, width * count, height);
int hOldBitmap = OS.SelectObject (memDC, hBitmap);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java
index 3ec3ac8697..d68df5c871 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java
@@ -921,7 +921,9 @@ void setCheckboxImageList () {
int height = OS.SendMessage (handle, OS.TVM_GETITEMHEIGHT, 0, 0), width = height;
int hImageList = OS.ImageList_Create (width, height, OS.ILC_COLOR, count, count);
int hDC = OS.GetDC (handle);
- OS.SetLayout (hDC, 0);
+ if ((OS.WIN32_MAJOR << 16 | OS.WIN32_MINOR) >= (4 << 16 | 10)) {
+ OS.SetLayout (hDC, 0);
+ }
int memDC = OS.CreateCompatibleDC (hDC);
int hBitmap = OS.CreateCompatibleBitmap (hDC, width * count, height);
int hOldBitmap = OS.SelectObject (memDC, hBitmap);

Back to the top