Mercurial > projects > dwt-linux
comparison dwt/graphics/TextLayout.d @ 261:edcf78db8722
fix compile errors for SWT 3.4
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Thu, 03 Jul 2008 21:20:33 +0200 |
parents | c0d810de7093 |
children | 6956821fe8ed |
comparison
equal
deleted
inserted
replaced
260:71a9cd1cf2e9 | 261:edcf78db8722 |
---|---|
9 * IBM Corporation - initial API and implementation | 9 * IBM Corporation - initial API and implementation |
10 * Port to the D programming language: | 10 * Port to the D programming language: |
11 * Frank Benoit <benoit@tionex.de> | 11 * Frank Benoit <benoit@tionex.de> |
12 *******************************************************************************/ | 12 *******************************************************************************/ |
13 module dwt.graphics.TextLayout; | 13 module dwt.graphics.TextLayout; |
14 | |
15 import dwt.dwthelper.utils; | |
14 | 16 |
15 import dwt.internal.Compatibility; | 17 import dwt.internal.Compatibility; |
16 import dwt.internal.cairo.Cairo; | 18 import dwt.internal.cairo.Cairo; |
17 import dwt.internal.gtk.OS; | 19 import dwt.internal.gtk.OS; |
18 import dwt.internal.Converter; | 20 import dwt.internal.Converter; |
50 * </p> | 52 * </p> |
51 * | 53 * |
52 * @see <a href="http://www.eclipse.org/swt/snippets/#textlayout">TextLayout, TextStyle snippets</a> | 54 * @see <a href="http://www.eclipse.org/swt/snippets/#textlayout">TextLayout, TextStyle snippets</a> |
53 * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: CustomControlExample, StyledText tab</a> | 55 * @see <a href="http://www.eclipse.org/swt/examples.php">DWT Example: CustomControlExample, StyledText tab</a> |
54 * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> | 56 * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a> |
55 * | 57 * |
56 * @since 3.0 | 58 * @since 3.0 |
57 */ | 59 */ |
58 public final class TextLayout : Resource { | 60 public final class TextLayout : Resource { |
59 | 61 |
60 static class StyleItem { | 62 static class StyleItem { |
215 int byteStart = start;//(OS.g_utf8_offset_to_pointer(ptr, start) - ptr); | 217 int byteStart = start;//(OS.g_utf8_offset_to_pointer(ptr, start) - ptr); |
216 int byteEnd = end+1;//(OS.g_utf8_offset_to_pointer(ptr, end + 1) - ptr); | 218 int byteEnd = end+1;//(OS.g_utf8_offset_to_pointer(ptr, end + 1) - ptr); |
217 byteStart = Math.min(byteStart, slen); | 219 byteStart = Math.min(byteStart, slen); |
218 byteEnd = Math.min(byteEnd, slen); | 220 byteEnd = Math.min(byteEnd, slen); |
219 Font font = style.font; | 221 Font font = style.font; |
220 if (font !is null && !font.isDisposed() && !defaultFont.equals(font)) { | 222 if (font !is null && !font.isDisposed() && !defaultFont.opEquals(font)) { |
221 auto attr = OS.pango_attr_font_desc_new (font.handle); | 223 auto attr = OS.pango_attr_font_desc_new (font.handle); |
222 attr.start_index = byteStart; | 224 attr.start_index = byteStart; |
223 attr.end_index = byteEnd; | 225 attr.end_index = byteEnd; |
224 OS.pango_attr_list_insert(attrList, attr); | 226 OS.pango_attr_list_insert(attrList, attr); |
225 } | 227 } |
896 * @return the bounds of the receiver | 898 * @return the bounds of the receiver |
897 * | 899 * |
898 * @exception DWTException <ul> | 900 * @exception DWTException <ul> |
899 * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> | 901 * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> |
900 * </ul> | 902 * </ul> |
901 * | 903 * |
902 * @see #setWidth(int) | 904 * @see #setWidth(int) |
903 * @see #getLineBounds(int) | 905 * @see #getLineBounds(int) |
904 */ | 906 */ |
905 public Rectangle getBounds() { | 907 public Rectangle getBounds() { |
906 checkLayout(); | 908 checkLayout(); |