Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSilenio Quarti2001-11-09 00:35:18 +0000
committerSilenio Quarti2001-11-09 00:35:18 +0000
commit8a38e5075e653df3889cb080a0f04508bee57d8f (patch)
tree7c437b766d8c092ada2903755b85583d2cb78e6c
parent2da14226ad0194251d73fcc9e143564faa5e089c (diff)
downloadeclipse.platform.swt-8a38e5075e653df3889cb080a0f04508bee57d8f.tar.gz
eclipse.platform.swt-8a38e5075e653df3889cb080a0f04508bee57d8f.tar.xz
eclipse.platform.swt-8a38e5075e653df3889cb080a0f04508bee57d8f.zip
*** empty log message ***
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/motif/library/swt.c10
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/graphics/Device.java32
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/graphics/GC.java141
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/internal/motif/OS.java2
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/DirectoryDialog.java11
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Display.java38
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Label.java10
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/MessageBox.java14
-rw-r--r--bundles/org.eclipse.swt/ws/motif/libswt-linux-2012.sobin379780 -> 380251 bytes
9 files changed, 171 insertions, 87 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/motif/library/swt.c b/bundles/org.eclipse.swt/Eclipse SWT/motif/library/swt.c
index f0d0c24c2d..f53479778b 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/motif/library/swt.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT/motif/library/swt.c
@@ -7185,9 +7185,10 @@ JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_motif_OS_XmGetPixmapByDepth
* Method: XmStringDrawUnderline
* Signature: (IIIIIIIIIILorg/eclipse/swt/internal/motif/XRectangle;I)V
*/
-/* JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_motif_OS_XmStringDrawUnderline
+JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_motif_OS_XmStringDrawUnderline
(JNIEnv *env, jclass that, jint display, jint window, jint fontlist, jint xmString, jint gc, jint x, jint y, jint width, jint align, jint lay_dir, jobject clip, jint xmStringUnderline)
{
+ DECL_GLOB(pGlob)
XRectangle xRect, *lpxRect=NULL;
#ifdef DEBUG_CALL_PRINTS
fprintf(stderr, "XmStringDrawUnderline\n");
@@ -7195,15 +7196,14 @@ JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_motif_OS_XmGetPixmapByDepth
if (clip) {
lpxRect = &xRect;
- cacheXrectangleFids(env, clip, &XrectangleFc);
- getXrectangleFields(env, clip, lpxRect, &XrectangleFc);
+ cacheXrectangleFids(env, clip, &PGLOB(XrectangleFc));
+ getXrectangleFields(env, clip, lpxRect, &PGLOB(XrectangleFc));
}
XmStringDrawUnderline((Display *)display, window, (XmFontList)fontlist, (XmString)xmString, (GC)gc, x, y, width, align, lay_dir, lpxRect, (XmString)xmStringUnderline);
if (clip) {
- setXrectangleFields(env, clip, lpxRect, &XrectangleFc);
+ setXrectangleFields(env, clip, lpxRect, &PGLOB(XrectangleFc));
}
}
-*/
/*
* Class: org_eclipse_swt_internal_motif_OS
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/graphics/Device.java b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/graphics/Device.java
index 5dc1701dfb..826e4f4c26 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/graphics/Device.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/graphics/Device.java
@@ -48,6 +48,9 @@ public abstract class Device implements Drawable {
int xErrorProc, xtWarningProc, xIOErrorProc, xtErrorProc;
int xNullErrorProc, xtNullWarningProc, xNullIOErrorProc, xtNullErrorProc;
+ /* Parsing Tables */
+ int tabMapping, crMapping, tabPointer, crPointer;
+
public static String XDefaultPrintServer = ":1";
static {
/* Read the default print server name from
@@ -478,6 +481,28 @@ protected void init () {
COLOR_MAGENTA = new Color (this, 0xFF,0,0xFF);
COLOR_CYAN = new Color (this, 0,0xFF,0xFF);
COLOR_WHITE = new Color (this, 0xFF,0xFF,0xFF);
+
+ /* Create the parsing tables */
+ byte[] tabBuffer = {(byte) '\t', 0};
+ tabPointer = OS.XtMalloc (tabBuffer.length);
+ OS.memmove (tabPointer, tabBuffer, tabBuffer.length);
+ int tabString = OS.XmStringComponentCreate(OS.XmSTRING_COMPONENT_TAB, 0, null);
+ int [] argList = {
+ OS.XmNpattern, tabPointer,
+ OS.XmNsubstitute, tabString,
+ };
+ tabMapping = OS.XmParseMappingCreate(argList, argList.length / 2);
+ OS.XmStringFree(tabString);
+ byte[] crBuffer = {(byte) '\n', 0};
+ crPointer = OS.XtMalloc (crBuffer.length);
+ OS.memmove (crPointer, crBuffer, crBuffer.length);
+ int crString = OS.XmStringComponentCreate(OS.XmSTRING_COMPONENT_SEPARATOR, 0, null);
+ argList = new int[] {
+ OS.XmNpattern, crPointer,
+ OS.XmNsubstitute, crString,
+ };
+ crMapping = OS.XmParseMappingCreate(argList, argList.length / 2);
+ OS.XmStringFree(crString);
}
/**
@@ -547,6 +572,13 @@ void new_Object (Object object) {
}
protected void release () {
+ /* Free the parsing tables */
+ OS.XtFree(tabPointer);
+ OS.XtFree(crPointer);
+ int[] parseTable = {tabMapping, crMapping};
+ OS.XmParseTableFree(parseTable, parseTable.length);
+ tabPointer = crPointer = tabMapping = crMapping = 0;
+
/*
* Free the palette. Note that this disposes all colors on
* the display that were allocated using the Color constructor.
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/graphics/GC.java b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/graphics/GC.java
index 05694c8067..930283e307 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/graphics/GC.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/graphics/GC.java
@@ -32,8 +32,6 @@ public final class GC {
Drawable drawable;
GCData data;
-
- static final byte[] _MOTIF_DEFAULT_LOCALE = Converter.wcsToMbcs(null, "_MOTIF_DEFAULT_LOCALE");
GC() {
}
@@ -1007,7 +1005,7 @@ void createRenderTable() {
OS.XmNfont, fontPtr,
OS.XmNfontType, fontType,
};
- int rendition = OS.XmRenditionCreate(shellHandle, _MOTIF_DEFAULT_LOCALE, argList, argList.length / 2);
+ int rendition = OS.XmRenditionCreate(shellHandle, OS.XmFONTLIST_DEFAULT_TAG, argList, argList.length / 2);
renditions[renditionCount++] = rendition;
if (renditionCount == renditions.length) {
int[] newArray = new int[renditions.length + 4];
@@ -1043,7 +1041,7 @@ void createRenderTable() {
* </ul>
*/
public void drawText (String string, int x, int y) {
- drawText(string, x, y, false);
+ drawText(string, x, y, SWT.DRAW_DELIMITER | SWT.DRAW_TAB);
}
/**
* Draws the given string, using the receiver's current font and
@@ -1066,19 +1064,76 @@ public void drawText (String string, int x, int y) {
* </ul>
*/
public void drawText (String string, int x, int y, boolean isTransparent) {
+ int flags = SWT.DRAW_DELIMITER | SWT.DRAW_TAB;
+ if (isTransparent) flags |= SWT.DRAW_TRANSPARENT;
+ drawText(string, x, y, flags);
+}
+/**
+ * Draws the given string, using the receiver's current font and
+ * foreground color. Tab expansion, line delimiter and mnemonic
+ * processing are performed according to the specified flags. If
+ * <code>flags</code> includes <code>DRAW_TRANSPARENT</code>,
+ * then the background of the rectangular area where the text is being
+ * drawn will not be modified, otherwise it will be filled with the
+ * receiver's background color.
+ * <p>
+ * The parameter <code>flags</code> may be a combination of:
+ * <dl>
+ * <dt><b>DRAW_DELIMITER</b></dt>
+ * <dd>draw multiple lines</dd>
+ * <dt><b>DRAW_TAB</b></dt>
+ * <dd>expand tabs</dd>
+ * <dt><b>DRAW_MNEMONIC</b></dt>
+ * <dd>underline the mnemonic character</dd>
+ * <dt><b>DRAW_TRANSPARENT</b></dt>
+ * <dd>transparent background</dd>
+ * </dl>
+ * </p>
+ *
+ * @param string the string to be drawn
+ * @param x the x coordinate of the top left corner of the rectangular area where the text is to be drawn
+ * @param y the y coordinate of the top left corner of the rectangular area where the text is to be drawn
+ * @param flags the flags specifing how to process the text
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the string is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public void drawText (String string, int x, int y, int flags) {
if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
if (string == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
if (data.renderTable == 0) createRenderTable();
int renderTable = data.renderTable;
- byte [] textBuffer = Converter.wcsToMbcs (getCodePage (), string, true);
- int xmString = OS.XmStringGenerate(textBuffer, null, OS.XmCHARSET_TEXT, _MOTIF_DEFAULT_LOCALE);
- if (isTransparent) {
- OS.XmStringDraw (data.display, data.drawable, renderTable, xmString, handle, x, y, 0x7FFFFFFF, OS.XmALIGNMENT_BEGINNING, 0, null);
+
+ char mnemonic=0;
+ int tableLength = 0;
+ Device device = data.device;
+ int[] parseTable = new int[2];
+ char[] text = new char[string.length()];
+ string.getChars(0, text.length, text, 0);
+ if ((flags & SWT.DRAW_DELIMITER) != 0) parseTable[tableLength++] = device.crMapping;
+ if ((flags & SWT.DRAW_TAB) != 0) parseTable[tableLength++] = device.tabMapping;
+ if ((flags & SWT.DRAW_MNEMONIC) != 0) mnemonic = stripMnemonic(text);
+
+ String codePage = getCodePage();
+ byte[] buffer = Converter.wcsToMbcs(codePage, text, true);
+ int xmString = OS.XmStringParseText(buffer, 0, OS.XmFONTLIST_DEFAULT_TAG, OS.XmCHARSET_TEXT, parseTable, tableLength, 0);
+ if (mnemonic != 0) {
+ byte [] buffer1 = Converter.wcsToMbcs(codePage, new char[]{mnemonic}, true);
+ int xmStringUnderline = OS.XmStringCreate (buffer1, OS.XmFONTLIST_DEFAULT_TAG);
+ OS.XmStringDrawUnderline(data.display, data.drawable, renderTable, xmString, handle, x, y, 0x7FFFFFFF, OS.XmALIGNMENT_BEGINNING, 0, null, xmStringUnderline);
+ OS.XmStringFree(xmStringUnderline);
} else {
- OS.XmStringDrawImage (data.display, data.drawable, renderTable, xmString, handle, x, y, 0x7FFFFFFF, OS.XmALIGNMENT_BEGINNING, 0, null);
- }
-// OS.XmStringDrawUnderline (display, drawable, renderTable, xmString, handle, x, y, 0x7FFFFFFF, OS.XmALIGNMENT_BEGINNING, 0, null, 0);
- OS.XmStringFree (xmString);
+ if ((flags & SWT.DRAW_TRANSPARENT) != 0) {
+ OS.XmStringDraw(data.display, data.drawable, renderTable, xmString, handle, x, y, 0x7FFFFFFF, OS.XmALIGNMENT_BEGINNING, 0, null);
+ } else {
+ OS.XmStringDrawImage(data.display, data.drawable, renderTable, xmString, handle, x, y, 0x7FFFFFFF, OS.XmALIGNMENT_BEGINNING, 0, null);
+ }
+ }
+ OS.XmStringFree(xmString);
}
/**
* Compares the argument to the receiver, and returns true
@@ -2344,6 +2399,20 @@ public Point stringExtent(String string) {
OS.XmStringFree(xmString);
return new Point(width, height);
}
+char stripMnemonic(char[] text) {
+ char mnemonic=0;
+ int i=0, j=0;
+ while (i < text.length) {
+ if ((text [j++] = text [i++]) == '&') {
+ if (i == text.length) {continue;}
+ if (text [i] == '&') {i++; continue;}
+ if (mnemonic == 0) mnemonic = text [i];
+ j--;
+ }
+ }
+ while (j < text.length) text [j++] = 0;
+ return mnemonic;
+}
/**
* Returns the extent of the given string. Tab expansion and
* carriage return processing are performed.
@@ -2364,13 +2433,57 @@ public Point stringExtent(String string) {
* </ul>
*/
public Point textExtent(String string) {
+ return textExtent(string, SWT.DRAW_DELIMITER | SWT.DRAW_TAB);
+}
+/**
+ * Returns the extent of the given string. Tab expansion, line
+ * delimiter and mnemonic processing are performed according to
+ * the specified flags, which can be a combination of:
+ * <dl>
+ * <dt><b>DRAW_DELIMITER</b></dt>
+ * <dd>draw multiple lines</dd>
+ * <dt><b>DRAW_TAB</b></dt>
+ * <dd>expand tabs</dd>
+ * <dt><b>DRAW_MNEMONIC</b></dt>
+ * <dd>underline the mnemonic character</dd>
+ * <dt><b>DRAW_TRANSPARENT</b></dt>
+ * <dd>transparent background</dd>
+ * </dl>
+ * <p>
+ * The <em>extent</em> of a string is the width and height of
+ * the rectangular area it would cover if drawn in a particular
+ * font (in this case, the current font in the receiver).
+ * </p>
+ *
+ * @param string the string to measure
+ * @param flags the flags specifing how to process the text
+ * @return a point containing the extent of the string
+ *
+ * @exception IllegalArgumentException <ul>
+ * <li>ERROR_NULL_ARGUMENT - if the string is null</li>
+ * </ul>
+ * @exception SWTException <ul>
+ * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ */
+public Point textExtent(String string, int flags) {
if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
if (string == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
if (string.length () == 0) return new Point(0, getFontHeight());
- byte [] textBuffer = Converter.wcsToMbcs (getCodePage (), string, true);
- int xmString = OS.XmStringGenerate(textBuffer, null, OS.XmCHARSET_TEXT, _MOTIF_DEFAULT_LOCALE);
if (data.renderTable == 0) createRenderTable();
int renderTable = data.renderTable;
+
+ int tableLength = 0;
+ Device device = data.device;
+ int[] parseTable = new int[2];
+ char[] text = new char[string.length()];
+ string.getChars(0, text.length, text, 0);
+ if ((flags & SWT.DRAW_DELIMITER) != 0) parseTable[tableLength++] = device.crMapping;
+ if ((flags & SWT.DRAW_TAB) != 0) parseTable[tableLength++] = device.tabMapping;
+ if ((flags & SWT.DRAW_MNEMONIC) != 0) stripMnemonic(text);
+
+ byte[] buffer = Converter.wcsToMbcs(getCodePage(), text, true);
+ int xmString = OS.XmStringParseText(buffer, 0, OS.XmFONTLIST_DEFAULT_TAG, OS.XmCHARSET_TEXT, parseTable, tableLength, 0);
int width = OS.XmStringWidth(renderTable, xmString);
int height = OS.XmStringHeight(renderTable, xmString);
OS.XmStringFree(xmString);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/internal/motif/OS.java b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/internal/motif/OS.java
index 2cc90d97fb..461175195e 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/internal/motif/OS.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/internal/motif/OS.java
@@ -878,7 +878,6 @@ public class OS {
public static final native void XmListDeselectItem (int list, int xmString);
public static final native void XmListSelectItem (int list, int xmString, boolean notify);
public static final native int XmPushButtonWidgetClass ();
- public static final native void XmStringDrawUnderline (int display, int window, int fontlist, int xmString, int gc, int x, int y, int width, int align, int lay_dir, XRectangle clip, int xmStringUnderline);
public static final native int XmStringLineCount (int xmString);
public static final native boolean XmTextRemove (int widget);
public static final native int XtAppSetErrorHandler (int app_context, int handler);
@@ -1119,6 +1118,7 @@ public static final native int XmStringCreateLocalized (byte [] string);
public static final native int XmStringCreateLtoR (byte [] string, byte [] charset);
public static final native void XmStringDraw (int display, int window, int renderTable, int xmString, int gc, int x, int y, int width, int align, int lay_dir, XRectangle clip);
public static final native void XmStringDrawImage (int display, int window, int renderTable, int xmString, int gc, int x, int y, int width, int align, int lay_dir, XRectangle clip);
+public static final native void XmStringDrawUnderline (int display, int window, int fontlist, int xmString, int gc, int x, int y, int width, int align, int lay_dir, XRectangle clip, int xmStringUnderline);
public static final native boolean XmStringEmpty (int s1);
public static final native void XmStringFree (int xmString);
public static final native boolean XmStringGetLtoR (int xmString, byte [] charset, int [] text);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/DirectoryDialog.java b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/DirectoryDialog.java
index 7b1b05beb8..a5880c4b48 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/DirectoryDialog.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/DirectoryDialog.java
@@ -223,21 +223,14 @@ public String open () {
// Add label widget for message text.
/* Use the character encoding for the default locale */
byte [] buffer4 = Converter.wcsToMbcs (null, message, true);
- int [] parseTable = Display.getDefault ().parseTable;
- int xmString1 = OS.XmStringParseText (
- buffer4,
- 0,
- OS.XmFONTLIST_DEFAULT_TAG,
- OS.XmCHARSET_TEXT,
- parseTable,
- parseTable.length,
- 0);
+ int xmString1 = OS.XmStringGenerate(buffer4, null, OS.XmCHARSET_TEXT, null);
int [] argList = {
OS.XmNlabelType, OS.XmSTRING,
OS.XmNlabelString, xmString1
};
int textArea = OS.XmCreateLabel(dialog, name, argList, argList.length/2);
OS.XtManageChild(textArea);
+ OS.XmStringFree (xmString1);
/* Hook the callbacks. */
Callback callback = new Callback (this, "activate", 3);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Display.java
index 450f79bcf6..0ea0a53817 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Display.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Display.java
@@ -221,10 +221,6 @@ public class Display extends Device {
int mouseHoverID, mouseHoverProc;
int mouseHoverHandle, toolTipHandle;
- /* Parse Tables */
- int [] parseTable;
- int crPointer, tabPointer;
-
/* Xt Translations */
int dragTranslations;
int arrowTranslations, tabTranslations;
@@ -913,7 +909,6 @@ protected void init () {
initializeText ();
initializeSystemColors ();
initializeDefaults ();
- initializeParseTable ();
initializeTranslations ();
}
void initializeButton () {
@@ -1169,33 +1164,6 @@ void initializeList () {
}
OS.XtDestroyWidget (shellHandle);
}
-void initializeParseTable () {
- byte[] tabBuffer = {(byte) '\t', 0};
- tabPointer = OS.XtMalloc (tabBuffer.length);
- OS.memmove (tabPointer, tabBuffer, tabBuffer.length);
- int tabString = OS.XmStringComponentCreate(OS.XmSTRING_COMPONENT_TAB, 0, null);
- int [] argList = {
- OS.XmNpattern, tabPointer,
- OS.XmNsubstitute, tabString,
- };
- int tabMapping = OS.XmParseMappingCreate(argList, argList.length / 2);
- OS.XmStringFree(tabString);
-
- byte[] crBuffer = {(byte) '\n', 0};
- crPointer = OS.XtMalloc (crBuffer.length);
- OS.memmove (crPointer, crBuffer, crBuffer.length);
- int crString = OS.XmStringComponentCreate(OS.XmSTRING_COMPONENT_SEPARATOR, 0, null);
- argList = new int[] {
- OS.XmNpattern, crPointer,
- OS.XmNsubstitute, crString,
- };
- int crMapping = OS.XmParseMappingCreate(argList, argList.length / 2);
- OS.XmStringFree(crString);
-
- parseTable = new int[2];
- parseTable[0] = tabMapping;
- parseTable[1] = crMapping;
-}
void initializeScrollBar () {
int shellHandle, widgetHandle;
int widgetClass = OS.TopLevelShellWidgetClass ();
@@ -1502,12 +1470,6 @@ void releaseDisplay () {
listFont = textFont = labelFont = buttonFont = 0;
defaultFontList = defaultFont = 0;
- /* Free the parse table */
- OS.XtFree(tabPointer);
- OS.XtFree(crPointer);
- OS.XmParseTableFree(parseTable, parseTable.length);
- parseTable = null;
-
/* Free the translations (no documentation describes how to do this) */
//OS.XtFree (arrowTranslations);
//OS.XtFree (tabTranslations);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Label.java b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Label.java
index 23554a1254..6b8791191b 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Label.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Label.java
@@ -424,15 +424,7 @@ public void setText (String string) {
buffer = Converter.wcsToMbcs (getCodePage (), unicode, true);
}
- int [] parseTable = getDisplay ().parseTable;
- int xmString = OS.XmStringParseText (
- buffer,
- 0,
- OS.XmFONTLIST_DEFAULT_TAG,
- OS.XmCHARSET_TEXT,
- parseTable,
- parseTable.length,
- 0);
+ int xmString = OS.XmStringGenerate(buffer, null, OS.XmCHARSET_TEXT, null);
if (xmString == 0) error (SWT.ERROR_CANNOT_SET_TEXT);
/*
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/MessageBox.java b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/MessageBox.java
index 341e83083d..5d2d4a5119 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/MessageBox.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/MessageBox.java
@@ -396,18 +396,10 @@ void setMessage (int dialogHandle) {
}
/* Use the character encoding for the default locale */
byte [] buffer = Converter.wcsToMbcs (null, text, true);
- int [] parseTable = Display.getDefault ().parseTable;
- int xmStringPtr = OS.XmStringParseText (
- buffer,
- 0,
- OS.XmFONTLIST_DEFAULT_TAG,
- OS.XmCHARSET_TEXT,
- parseTable,
- parseTable.length,
- 0);
- int [] argList = {OS.XmNmessageString, xmStringPtr};
+ int xmString = OS.XmStringGenerate(buffer, null, OS.XmCHARSET_TEXT, null);
+ int [] argList = {OS.XmNmessageString, xmString};
OS.XtSetValues (dialogHandle, argList, argList.length / 2);
- OS.XmStringFree (xmStringPtr);
+ OS.XmStringFree (xmString);
}
/**
diff --git a/bundles/org.eclipse.swt/ws/motif/libswt-linux-2012.so b/bundles/org.eclipse.swt/ws/motif/libswt-linux-2012.so
index 71a8a82ada..c5010f6e52 100644
--- a/bundles/org.eclipse.swt/ws/motif/libswt-linux-2012.so
+++ b/bundles/org.eclipse.swt/ws/motif/libswt-linux-2012.so
Binary files differ

Back to the top