Mercurial > projects > dwt-linux
changeset 198:e2846bbf2256
merge
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Thu, 06 Mar 2008 21:24:47 +0100 |
parents | 91610024165a (diff) ed84552892d2 (current diff) |
children | a5adab24940b |
files | |
diffstat | 15 files changed, 78 insertions(+), 75 deletions(-) [+] |
line wrap: on
line diff
--- a/README Wed Mar 05 16:57:05 2008 -0800 +++ b/README Thu Mar 06 21:24:47 2008 +0100 @@ -4,10 +4,13 @@ Compiler : DMD 1.027 Runtime : Tango 0.99.5 DSSS : 0.75 -Libs packages : libgtk2.0-dev, libxtst-dev, libgnomeui-dev [1] +Lib packages : libgtk2.0-dev, + libxtst-dev, + libgnomeui-dev (needed for dwt.program.Program) +OpenGl : Derelict (needed for dwt.opengl.GLCanvas) -[1] only for the module dwt.program.Program needed - +DSSS +==== Note: DSSS has by default the feature active to compile one file a time. For DWT this make compilation _very_ slow (> 30 min). By switching this off, and make it compile several files at once, the
--- a/dwt/accessibility/AccessibleObject.d Wed Mar 05 16:57:05 2008 -0800 +++ b/dwt/accessibility/AccessibleObject.d Thu Mar 06 21:24:47 2008 +0100 @@ -863,7 +863,7 @@ } case ATK.ATK_TEXT_BOUNDARY_LINE_START: { int lineStart1 = locate( text, '\n' ); - if( lineStart1 == text.length ) lineStart1 = -1; + if( lineStart1 is text.length ) lineStart1 = -1; if (lineStart1 is -1) { startBounds = endBounds = length; break; @@ -875,7 +875,7 @@ } startBounds = lineStart1; int lineStart2 = locate( text, '\n' ); - if( lineStart2 == text.length ) lineStart2 = -1; + if( lineStart2 is text.length ) lineStart2 = -1; if (lineStart2 is -1) { endBounds = length; break;
--- a/dwt/graphics/Color.d Wed Mar 05 16:57:05 2008 -0800 +++ b/dwt/graphics/Color.d Thu Mar 06 21:24:47 2008 +0100 @@ -124,7 +124,7 @@ int pixel = handle.pixel; if (device.colorRefCount !is null) { /* If this was the last reference, remove the color from the list */ - if (--device.colorRefCount[pixel] == 0) { + if (--device.colorRefCount[pixel] is 0) { device.gdkColors[pixel] = null; } } @@ -149,9 +149,9 @@ if (object is this) return true; if ( auto color = cast(Color)object ){ GdkColor* gdkColor = color.handle; - if (handle == gdkColor) return true; - return device == color.device && handle.red == gdkColor.red && - handle.green == gdkColor.green && handle.blue == gdkColor.blue; + if (handle is gdkColor) return true; + return device is color.device && handle.red is gdkColor.red && + handle.green is gdkColor.green && handle.blue is gdkColor.blue; } return false; } @@ -268,7 +268,7 @@ OS.gdk_colormap_alloc_color(colormap, gdkColor, true, true); } handle = gdkColor; - if (device.colorRefCount != null) { + if (device.colorRefCount !is null) { /* Make a copy of the color to put in the colors array */ GdkColor* colorCopy = new GdkColor(); colorCopy.red = handle.red;
--- a/dwt/graphics/Cursor.d Wed Mar 05 16:57:05 2008 -0800 +++ b/dwt/graphics/Cursor.d Thu Mar 06 21:24:47 2008 +0100 @@ -133,8 +133,8 @@ * @see DWT#CURSOR_HAND */ public this(Device device, int style) { - if (device == null) device = Device.getDevice(); - if (device == null) DWT.error(DWT.ERROR_NULL_ARGUMENT); + if (device is null) device = Device.getDevice(); + if (device is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); this.device = device; int shape = 0; switch (style) { @@ -163,7 +163,7 @@ default: DWT.error(DWT.ERROR_INVALID_ARGUMENT); } - if (shape == 0 && style == DWT.CURSOR_APPSTARTING) { + if (shape is 0 && style is DWT.CURSOR_APPSTARTING) { handle = createCursor(APPSTARTING_SRC, APPSTARTING_MASK, 32, 32, 2, 2, true); } else { handle = OS.gdk_cursor_new(shape); @@ -204,16 +204,16 @@ * </ul> */ public this(Device device, ImageData source, ImageData mask, int hotspotX, int hotspotY) { - if (device == null) device = Device.getDevice(); - if (device == null) DWT.error(DWT.ERROR_NULL_ARGUMENT); + if (device is null) device = Device.getDevice(); + if (device is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); this.device = device; - if (source == null) DWT.error(DWT.ERROR_NULL_ARGUMENT); - if (mask == null) { - if (!(source.getTransparencyType() == DWT.TRANSPARENCY_MASK)) DWT.error(DWT.ERROR_NULL_ARGUMENT); + if (source is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); + if (mask is null) { + if (!(source.getTransparencyType() is DWT.TRANSPARENCY_MASK)) DWT.error(DWT.ERROR_NULL_ARGUMENT); mask = source.getTransparencyMask(); } /* Check the bounds. Mask must be the same size as source */ - if (mask.width != source.width || mask.height != source.height) { + if (mask.width !is source.width || mask.height !is source.height) { DWT.error(DWT.ERROR_INVALID_ARGUMENT); } /* Check the hotspots */ @@ -289,10 +289,10 @@ * @since 3.0 */ public this(Device device, ImageData source, int hotspotX, int hotspotY) { - if (device == null) device = Device.getDevice(); - if (device == null) DWT.error(DWT.ERROR_NULL_ARGUMENT); + if (device is null) device = Device.getDevice(); + if (device is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); this.device = device; - if (source == null) DWT.error(DWT.ERROR_NULL_ARGUMENT); + if (source is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); if (hotspotX >= source.width || hotspotX < 0 || hotspotY >= source.height || hotspotY < 0) { DWT.error(DWT.ERROR_INVALID_ARGUMENT); @@ -307,7 +307,7 @@ int stride = OS.gdk_pixbuf_get_rowstride(pixbuf); auto data = OS.gdk_pixbuf_get_pixels(pixbuf); byte[] buffer = source.data; - if (!palette.isDirect || source.depth != 24 || stride != source.bytesPerLine || palette.redMask != 0xFF000000 || palette.greenMask != 0xFF0000 || palette.blueMask != 0xFF00) { + if (!palette.isDirect || source.depth !is 24 || stride !is source.bytesPerLine || palette.redMask !is 0xFF000000 || palette.greenMask !is 0xFF0000 || palette.blueMask !is 0xFF00) { buffer = new byte[source.width * source.height * 4]; if (palette.isDirect) { ImageData.blit(ImageData.BLIT_SRC, @@ -323,7 +323,7 @@ byte[] srcBlues = new byte[length]; for (int i = 0; i < rgbs.length; i++) { RGB rgb = rgbs[i]; - if (rgb == null) continue; + if (rgb is null) continue; srcReds[i] = cast(byte)rgb.red; srcGreens[i] = cast(byte)rgb.green; srcBlues[i] = cast(byte)rgb.blue; @@ -334,24 +334,24 @@ buffer, 32, source.width * 4, ImageData.MSB_FIRST, 0, 0, source.width, source.height, 0xFF000000, 0xFF0000, 0xFF00, false, false); } - if (source.maskData != null || source.transparentPixel != -1) { + if (source.maskData !is null || source.transparentPixel !is -1) { ImageData mask = source.getTransparencyMask(); byte[] maskData = mask.data; int maskBpl = mask.bytesPerLine; int offset = 3, maskOffset = 0; for (int y = 0; y<source.height; y++) { for (int x = 0; x<source.width; x++) { - buffer[offset] = ((maskData[maskOffset + (x >> 3)]) & (1 << (7 - (x & 0x7)))) != 0 ? cast(byte)0xff : 0; + buffer[offset] = ((maskData[maskOffset + (x >> 3)]) & (1 << (7 - (x & 0x7)))) !is 0 ? cast(byte)0xff : 0; offset += 4; } maskOffset += maskBpl; } - } else if (source.alpha != -1) { + } else if (source.alpha !is -1) { byte alpha = cast(byte)source.alpha; for (int i=3; i<buffer.length; i+=4) { buffer[i] = alpha; } - } else if (source.alphaData != null) { + } else if (source.alphaData !is null) { byte[] alphaData = source.alphaData; for (int i=3; i<buffer.length; i+=4) { buffer[i] = alphaData[i/4]; @@ -390,7 +390,7 @@ byte[] srcBlues = new byte[length]; for (int i = 0; i < rgbs.length; i++) { RGB rgb = rgbs[i]; - if (rgb == null) continue; + if (rgb is null) continue; srcReds[i] = cast(byte)rgb.red; srcGreens[i] = cast(byte)rgb.green; srcBlues[i] = cast(byte)rgb.blue; @@ -503,7 +503,7 @@ * @private */ public static Cursor gtk_new(Device device, GdkCursor* handle) { - if (device == null) device = Device.getDevice(); + if (device is null) device = Device.getDevice(); Cursor cursor = new Cursor(); cursor.handle = handle; cursor.device = device;
--- a/dwt/graphics/FontData.d Wed Mar 05 16:57:05 2008 -0800 +++ b/dwt/graphics/FontData.d Thu Mar 06 21:24:47 2008 +0100 @@ -127,22 +127,22 @@ if (str is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); int start = 0; int end = locate( str, '|' ); - if (end == str.length ) DWT.error(DWT.ERROR_INVALID_ARGUMENT); + if (end is str.length ) DWT.error(DWT.ERROR_INVALID_ARGUMENT); char[] version1 = str[ start .. end ]; try { - if (to!(int)(version1) != 1) DWT.error(DWT.ERROR_INVALID_ARGUMENT); + if (to!(int)(version1) !is 1) DWT.error(DWT.ERROR_INVALID_ARGUMENT); } catch (ConversionException e) { DWT.error(DWT.ERROR_INVALID_ARGUMENT); } start = end + 1; end = locate( str, '|', start ); - if (end == str.length ) DWT.error(DWT.ERROR_INVALID_ARGUMENT); + if (end is str.length ) DWT.error(DWT.ERROR_INVALID_ARGUMENT); char[] name = str[start .. end ]; start = end + 1; end = locate( str, '|', start ); - if (end == str.length ) DWT.error(DWT.ERROR_INVALID_ARGUMENT); + if (end is str.length ) DWT.error(DWT.ERROR_INVALID_ARGUMENT); float height = 0; try { height = to!(float)(str[start .. end]); @@ -152,7 +152,7 @@ start = end + 1; end = locate( str, '|', start ); - if (end == str.length ) DWT.error(DWT.ERROR_INVALID_ARGUMENT); + if (end is str.length ) DWT.error(DWT.ERROR_INVALID_ARGUMENT); int style = 0; try { style = to!(int)( str[start .. end ]); @@ -165,15 +165,15 @@ setName(name); setHeight(height); setStyle(style); - if (end == str.length) return; + if (end is str.length) return; char[] platform = str[ start .. end ]; start = end + 1; end = locate( str, '|', start ); - if (end == str.length) return; + if (end is str.length) return; char[] version2 = str[ start .. end ]; - if (platform == "GTK" && version2 == "1" ) { + if (platform.equals("GTK") && version2.equals("1")) { return; } } @@ -217,7 +217,7 @@ public override int opEquals (Object object) { if (object is this) return true; if( auto data = cast(FontData)object ){ - return name == data.name && height == data.height && style == data.style; + return name.equals(data.name) && height is data.height && style is data.style; } return false; } @@ -257,20 +257,20 @@ public char[] getLocale () { char[] result; const char sep = '_'; - if (lang != null) { + if (lang !is null) { result ~= lang; result ~= sep; } - if (country != null) { + if (country !is null) { result ~= country; result ~= sep; } - if (variant != null) { + if (variant !is null) { result ~= variant; } if (result) { - if (result[$-1] == sep) { + if (result[$-1] is sep) { result = result[0 .. $ - 1]; } } @@ -367,11 +367,11 @@ int firstSep, secondSep; firstSep = locate( locale, sep ); - if (firstSep == locale.length) { + if (firstSep is locale.length) { firstSep = secondSep = length; } else { secondSep = locate( locale, sep, firstSep + 1); - if (secondSep == locale.length) secondSep = length; + if (secondSep is locale.length) secondSep = length; } if (firstSep > 0) lang = locale[0 .. firstSep]; if (secondSep > firstSep + 1) country = locale[firstSep + 1 .. secondSep ];
--- a/dwt/graphics/FontMetrics.d Wed Mar 05 16:57:05 2008 -0800 +++ b/dwt/graphics/FontMetrics.d Thu Mar 06 21:24:47 2008 +0100 @@ -41,9 +41,9 @@ public override int opEquals (Object object) { if (object is this) return true; if( auto metrics = cast(FontMetrics)object ){ - return ascent == metrics.ascent && descent == metrics.descent && - averageCharWidth == metrics.averageCharWidth && leading == metrics.leading && - height == metrics.height; + return ascent is metrics.ascent && descent is metrics.descent && + averageCharWidth is metrics.averageCharWidth && leading is metrics.leading && + height is metrics.height; } return false; }
--- a/dwt/graphics/GC.d Wed Mar 05 16:57:05 2008 -0800 +++ b/dwt/graphics/GC.d Thu Mar 06 21:24:47 2008 +0100 @@ -1818,7 +1818,7 @@ fromRGB = backgroundRGB; toRGB = foregroundRGB; } - if (fromRGB ==/*eq*/ toRGB ) { + if (fromRGB.opEquals(toRGB)) { fillRectangle(x, y, width, height); return; }
--- a/dwt/graphics/GlyphMetrics.d Wed Mar 05 16:57:05 2008 -0800 +++ b/dwt/graphics/GlyphMetrics.d Thu Mar 06 21:24:47 2008 +0100 @@ -80,7 +80,7 @@ public override int opEquals (Object object) { if (object is this) return true; if (auto metrics = cast(GlyphMetrics)object ){ - return metrics.ascent == ascent && metrics.descent == descent && metrics.width == width; + return metrics.ascent is ascent && metrics.descent is descent && metrics.width is width; } return false; }
--- a/dwt/graphics/ImageLoader.d Wed Mar 05 16:57:05 2008 -0800 +++ b/dwt/graphics/ImageLoader.d Thu Mar 06 21:24:47 2008 +0100 @@ -293,7 +293,7 @@ */ public void removeImageLoaderListener(ImageLoaderListener listener) { if (listener is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); - if (imageLoaderListeners.length == 0 ) return; + if (imageLoaderListeners.length is 0 ) return; tango.core.Array.remove( imageLoaderListeners, listener, delegate bool(ImageLoaderListener l1, ImageLoaderListener l2 ){ return l1 is l2; }); }
--- a/dwt/graphics/Path.d Wed Mar 05 16:57:05 2008 -0800 +++ b/dwt/graphics/Path.d Thu Mar 06 21:24:47 2008 +0100 @@ -125,7 +125,7 @@ public void addArc(float x, float y, float width, float height, float startAngle, float arcAngle) { if (isDisposed()) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED); moved = true; - if (width == height) { + if (width is height) { float angle = -startAngle * cast(float)Compatibility.PI / 180; if (closed) Cairo.cairo_move_to(handle, (x + width / 2f) + width / 2f * Math.cos(angle), (y + height / 2f) + height / 2f * Math.sin(angle)); if (arcAngle >= 0) { @@ -213,7 +213,7 @@ */ public void addString(char[] str, float x, float y, Font font) { if (isDisposed()) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED); - if (font == null) DWT.error(DWT.ERROR_NULL_ARGUMENT); + if (font is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); if (font.isDisposed()) DWT.error(DWT.ERROR_INVALID_ARGUMENT); moved = false; GC.addCairoString(handle, str, x, y, font); @@ -261,7 +261,7 @@ */ public bool contains(float x, float y, GC gc, bool outline) { if (isDisposed()) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED); - if (gc == null) DWT.error(DWT.ERROR_NULL_ARGUMENT); + if (gc is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); if (gc.isDisposed()) DWT.error(DWT.ERROR_INVALID_ARGUMENT); //TODO - see Windows gc.initCairo(); @@ -273,9 +273,9 @@ Cairo.cairo_append_path(cairo, copy); Cairo.cairo_path_destroy(copy); if (outline) { - result = Cairo.cairo_in_stroke(cairo, x, y) != 0; + result = Cairo.cairo_in_stroke(cairo, x, y) !is 0; } else { - result = Cairo.cairo_in_fill(cairo, x, y) != 0; + result = Cairo.cairo_in_fill(cairo, x, y) !is 0; } Cairo.cairo_new_path(cairo); return result; @@ -324,7 +324,7 @@ */ public void getBounds(float[] bounds) { if (isDisposed()) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED); - if (bounds == null) DWT.error(DWT.ERROR_NULL_ARGUMENT); + if (bounds is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); if (bounds.length < 4) DWT.error(DWT.ERROR_INVALID_ARGUMENT); auto copy = Cairo.cairo_copy_path(handle); if (copy is null) DWT.error(DWT.ERROR_NO_HANDLES); @@ -394,7 +394,7 @@ */ public void getCurrentPoint(float[] point) { if (isDisposed()) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED); - if (point == null) DWT.error(DWT.ERROR_NULL_ARGUMENT); + if (point is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); if (point.length < 2) DWT.error(DWT.ERROR_INVALID_ARGUMENT); double x, y; Cairo.cairo_get_current_point(handle, &x, &y); @@ -455,12 +455,12 @@ i += data.header.length; } } - if (typeIndex != types.length) { + if (typeIndex !is types.length) { byte[] newTypes = new byte[typeIndex]; System.arraycopy(types, 0, newTypes, 0, typeIndex); types = newTypes; } - if (ptsIndex != pts.length) { + if (ptsIndex !is pts.length) { float[] newPts = new float[ptsIndex]; System.arraycopy(pts, 0, newPts, 0, ptsIndex); pts = newPts;
--- a/dwt/graphics/Region.d Wed Mar 05 16:57:05 2008 -0800 +++ b/dwt/graphics/Region.d Thu Mar 06 21:24:47 2008 +0100 @@ -394,7 +394,7 @@ gdkRect.y = y; gdkRect.width = width; gdkRect.height = height; - return OS.gdk_region_rect_in(handle, gdkRect) != OS.GDK_OVERLAP_RECTANGLE_OUT; + return OS.gdk_region_rect_in(handle, gdkRect) !is OS.GDK_OVERLAP_RECTANGLE_OUT; } /** * Returns <code>true</code> if the given rectangle intersects
--- a/dwt/graphics/Transform.d Wed Mar 05 16:57:05 2008 -0800 +++ b/dwt/graphics/Transform.d Thu Mar 06 21:24:47 2008 +0100 @@ -144,7 +144,7 @@ } static float[] checkTransform(float[] elements) { - if (elements == null) DWT.error(DWT.ERROR_NULL_ARGUMENT); + if (elements is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); if (elements.length < 6) DWT.error(DWT.ERROR_INVALID_ARGUMENT); return elements; } @@ -199,7 +199,7 @@ */ public void invert() { if (isDisposed()) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED); - if (Cairo.cairo_matrix_invert(cast(cairo_matrix_t*)handle.ptr) != 0) { + if (Cairo.cairo_matrix_invert(cast(cairo_matrix_t*)handle.ptr) !is 0) { DWT.error(DWT.ERROR_CANNOT_INVERT_MATRIX); } } @@ -228,7 +228,7 @@ if (isDisposed()) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED); float[] m = new float[6]; getElements(m); - return m[0] == 1 && m[1] == 0 && m[2] == 0 && m[3] == 1 && m[4] == 0 && m[5] == 0; + return m[0] is 1 && m[1] is 0 && m[2] is 0 && m[3] is 1 && m[4] is 0 && m[5] is 0; } /** @@ -248,7 +248,7 @@ */ public void multiply(Transform matrix) { if (isDisposed()) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED); - if (matrix == null) DWT.error(DWT.ERROR_NULL_ARGUMENT); + if (matrix is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); if (matrix.isDisposed()) DWT.error(DWT.ERROR_INVALID_ARGUMENT); Cairo.cairo_matrix_multiply(cast(cairo_matrix_t*)handle.ptr,cast(cairo_matrix_t*)matrix.handle.ptr, cast(cairo_matrix_t*)handle.ptr); } @@ -323,7 +323,7 @@ */ public void transform(float[] pointArray) { if (isDisposed()) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED); - if (pointArray == null) DWT.error(DWT.ERROR_NULL_ARGUMENT); + if (pointArray is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); double dx, dy; int length = pointArray.length / 2; for (int i = 0, j = 0; i < length; i++, j += 2) {
--- a/dwt/layout/FormAttachment.d Wed Mar 05 16:57:05 2008 -0800 +++ b/dwt/layout/FormAttachment.d Thu Mar 06 21:24:47 2008 +0100 @@ -185,7 +185,7 @@ * @param offset the offset of the side from the position */ public this (int numerator, int denominator, int offset) { - if (denominator == 0) DWT.error (DWT.ERROR_CANNOT_BE_ZERO); + if (denominator is 0) DWT.error (DWT.ERROR_CANNOT_BE_ZERO); this.numerator = numerator; this.denominator = denominator; this.offset = offset; @@ -244,7 +244,7 @@ m = n; n = temp; } - while (n != 0){ + while (n !is 0){ temp = m; m = n; n = temp % n; @@ -283,12 +283,12 @@ } int solveX (int value) { - if (denominator == 0) DWT.error (DWT.ERROR_CANNOT_BE_ZERO); + if (denominator is 0) DWT.error (DWT.ERROR_CANNOT_BE_ZERO); return ((numerator * value) / denominator) + offset; } int solveY (int value) { - if (numerator == 0) DWT.error (DWT.ERROR_CANNOT_BE_ZERO); + if (numerator is 0) DWT.error (DWT.ERROR_CANNOT_BE_ZERO); return (value - offset) * denominator / numerator; } @@ -299,7 +299,7 @@ * @return a string representation of the FormAttachment */ public override char[] toString () { - char[] string = control != null ? control.toString () : Format( "{}/{}", numerator, denominator ); + char[] string = control !is null ? control.toString () : Format( "{}/{}", numerator, denominator ); return Format("{{y = ({})x + {}}", string, ( offset >= 0 ? Format(")x + {}", offset ) : Format( ")x - {}", -offset))); }
--- a/dwt/printing/PrintDialog.d Wed Mar 05 16:57:05 2008 -0800 +++ b/dwt/printing/PrintDialog.d Thu Mar 06 21:24:47 2008 +0100 @@ -299,7 +299,7 @@ default: } - printToFile = ( data.name ==/*eq*/ "Print to File" ); //$NON-NLS-1$ + printToFile = ( data.name.equals("Print to File")); //$NON-NLS-1$ if (printToFile) { auto address = OS.gtk_print_settings_get(settings, OS.GTK_PRINT_SETTINGS_OUTPUT_URI.ptr); data.fileName = tango.stdc.stringz.fromStringz( address).dup;
--- a/dwt/printing/Printer.d Wed Mar 05 16:57:05 2008 -0800 +++ b/dwt/printing/Printer.d Thu Mar 06 21:24:47 2008 +0100 @@ -103,7 +103,7 @@ * which means the event loop never ends. The fix is to check to see if the driver * is of type Lpr, and stop the enumeration, which exits the event loop. */ - if (printerList[length_].driver ==/*eq*/ GTK_LPR_BACKEND) return 1; + if (printerList[length_].driver.equals(GTK_LPR_BACKEND)) return 1; return 0; } @@ -144,7 +144,7 @@ } int GtkPrinterFunc_FindNamedPrinter (GtkPrinter* printer, void* user_data) { PrinterData pd = printerDataFromGtkPrinter(printer); - if (pd.driver ==/*eq*/data.driver && pd.name ==/*eq*/ data.name ) { + if (pd.driver.equals(data.driver) && pd.name.equals(data.name)) { this.printer = printer; OS.g_object_ref(printer); return 1; @@ -707,7 +707,7 @@ char* buffer = tango.stdc.stringz.toStringz( data.fileName ); OS.gtk_print_settings_set(settings, OS.GTK_PRINT_SETTINGS_OUTPUT_URI.ptr, buffer); } - if (data.driver ==/*eq*/ "GtkPrintBackendFile" && data.name ==/*eq*/ "Print to File" ) { //$NON-NLS-1$ //$NON-NLS-2$ + if (data.driver.equals("GtkPrintBackendFile") && data.name.equals("Print to File")) { //$NON-NLS-1$ //$NON-NLS-2$ char* buffer = tango.stdc.stringz.toStringz( data.fileName ); OS.gtk_print_settings_set(settings, OS.GTK_PRINT_SETTINGS_OUTPUT_URI.ptr, buffer); }