From 3d16bdf9400649d9f4f0fff0831768ba6c38fdea Mon Sep 17 00:00:00 2001 From: Grant Gayed Date: Thu, 6 May 2004 19:18:37 +0000 Subject: 25703 --- .../motif/org/eclipse/swt/widgets/Display.java | 80 ++++++++++++++++++++-- .../motif/org/eclipse/swt/widgets/MessageBox.java | 2 + 2 files changed, 76 insertions(+), 6 deletions(-) (limited to 'bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt') 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 2b829e8db7..76e31e5c74 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 @@ -133,6 +133,9 @@ public class Display extends Device { XColor COLOR_LIST_FOREGROUND, COLOR_LIST_BACKGROUND, COLOR_LIST_SELECTION, COLOR_LIST_SELECTION_TEXT; Color COLOR_INFO_BACKGROUND; + /* System Images */ + int errorImage, infoImage, questionImage, warningImage, workingImage; + /* Initial Guesses for Shell Trimmings. */ int leftBorderWidth = 2, rightBorderWidth = 2; int topBorderHeight = 2, bottomBorderHeight = 2; @@ -689,6 +692,18 @@ void createDisplay (DeviceData data) { } if (ptr1 != 0) OS.XtFree (ptr1); } +int createImage (String name) { + int screen = OS.XDefaultScreenOfDisplay (xDisplay); + int fgPixel = OS.XBlackPixel (xDisplay, OS.XDefaultScreen (xDisplay)); + int bgPixel = OS.XWhitePixel (xDisplay, OS.XDefaultScreen (xDisplay)); + byte[] buffer = Converter.wcsToMbcs (null, name, true); + int pixmap = OS.XmGetPixmap (screen, buffer, fgPixel, bgPixel); + if (pixmap == OS.XmUNSPECIFIED_PIXMAP) { + buffer = Converter.wcsToMbcs (null, "default_" + name, true); + pixmap = OS.XmGetPixmap (screen, buffer, fgPixel, bgPixel); + } + return pixmap; +} synchronized static void deregister (Display display) { for (int i=0; i