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); int  cairo = data.cairo; if (cairo != 0) { if (OS.GTK_VERSION < OS.VERSION(2, 8, 0)) {  checkGC(FONT); byte[] buffer = Converter.wcsToMbcs(null, string, true); cairo_font_extents_t font_extents = new cairo_font_extents_t(); Cairo.cairo_font_extents(cairo, font_extents); cairo_text_extents_t extents = new cairo_text_extents_t(); Cairo.cairo_text_extents(cairo, buffer, extents); return new Point((int)extents.width, (int)font_extents.height); } } setString(string, flags); checkGC(FONT); if (data.stringWidth != -1) return new Point(data.stringWidth, data.stringHeight); int[] width = new int[1], height = new int[1]; OS.pango_layout_get_size(data.layout, width, height); return new Point(data.stringWidth = OS.PANGO_PIXELS(width[0]), data.stringHeight = OS.PANGO_PIXELS(height[0]));
public Point textExtent(String string) { return textExtent(string, SWT.DRAW_DELIMITER | SWT.DRAW_TAB);
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);	int /*long*/ cairo = data.cairo;	if (cairo != 0) {		if (OS.GTK_VERSION < OS.VERSION(2, 8, 0)) {			//TODO - honor flags			checkGC(FONT);			byte[] buffer = Converter.wcsToMbcs(null, string, true);			cairo_font_extents_t font_extents = new cairo_font_extents_t();			Cairo.cairo_font_extents(cairo, font_extents);			cairo_text_extents_t extents = new cairo_text_extents_t();			Cairo.cairo_text_extents(cairo, buffer, extents);			return new Point((int)extents.width, (int)font_extents.height);		}	}	setString(string, flags);	checkGC(FONT);	if (data.stringWidth != -1) return new Point(data.stringWidth, data.stringHeight);	int[] width = new int[1], height = new int[1];	OS.pango_layout_get_size(data.layout, width, height);	return new Point(data.stringWidth = OS.PANGO_PIXELS(width[0]), data.stringHeight = OS.PANGO_PIXELS(height[0]));}