diff options
author | Silenio Quarti <silenio> | 2006-06-13 14:36:34 +0000 |
---|---|---|
committer | Silenio Quarti <silenio> | 2006-06-13 14:36:34 +0000 |
commit | 82d9762c932708c073b22d5340f37497e7b81612 (patch) | |
tree | ce8d71f00fc8aaca429d0f4360b94bcd2abc8e37 | |
parent | c5319bf89ea1686278d68af93aa053fe8bac4ea5 (diff) | |
download | eclipse.platform.swt-82d9762c932708c073b22d5340f37497e7b81612.tar.gz eclipse.platform.swt-82d9762c932708c073b22d5340f37497e7b81612.tar.xz eclipse.platform.swt-82d9762c932708c073b22d5340f37497e7b81612.zip |
fixing compile problems on Motifv3301a
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/cairo/org/eclipse/swt/graphics/Path.java | 19 | ||||
-rwxr-xr-x | bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/graphics/GC.java | 9 |
2 files changed, 10 insertions, 18 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cairo/org/eclipse/swt/graphics/Path.java b/bundles/org.eclipse.swt/Eclipse SWT/cairo/org/eclipse/swt/graphics/Path.java index c4908caae4..735dd5eebe 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cairo/org/eclipse/swt/graphics/Path.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cairo/org/eclipse/swt/graphics/Path.java @@ -13,7 +13,6 @@ package org.eclipse.swt.graphics; import org.eclipse.swt.*; import org.eclipse.swt.internal.*; import org.eclipse.swt.internal.cairo.*; -import org.eclipse.swt.internal.gtk.*; /** * Instances of this class represent paths through the two-dimensional @@ -186,23 +185,7 @@ public void addString(String string, float x, float y, Font font) { if (font == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); if (font.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT); move = false; - byte[] buffer = Converter.wcsToMbcs(null, string, true); - if (OS.GTK_VERSION >= OS.VERSION(2, 8, 0)) { - int /*long*/ layout = OS.pango_cairo_create_layout(handle); - if (layout == 0) SWT.error(SWT.ERROR_NO_HANDLES); - OS.pango_layout_set_text(layout, buffer, -1); - OS.pango_layout_set_font_description(layout, font.handle); - Cairo.cairo_move_to(handle, x, y); - OS.pango_cairo_layout_path(handle, layout); - OS.g_object_unref(layout); - } else { - GC.setCairoFont(handle, font); - cairo_font_extents_t extents = new cairo_font_extents_t(); - Cairo.cairo_font_extents(handle, extents); - double baseline = y + extents.ascent; - Cairo.cairo_move_to(handle, x, baseline); - Cairo.cairo_text_path(handle, buffer); - } + GC.addCairoString(handle, string, x, y, font); } /** 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 9828025211..df1f06429e 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 @@ -134,6 +134,15 @@ public GC(Drawable drawable, int style) { init(drawable, data, xGC); if (device.tracking) device.new_Object(this); } +static void addCairoString(int cairo, String string, float x, float y, Font font) { + byte[] buffer = Converter.wcsToMbcs(null, string, true); + GC.setCairoFont(cairo, font); + cairo_font_extents_t extents = new cairo_font_extents_t(); + Cairo.cairo_font_extents(cairo, extents); + double baseline = y + extents.ascent; + Cairo.cairo_move_to(cairo, x, baseline); + Cairo.cairo_text_path(cairo, buffer); +} static int checkStyle (int style) { if ((style & SWT.LEFT_TO_RIGHT) != 0) style &= ~SWT.RIGHT_TO_LEFT; return style & (SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT); |