if (hHint == SWT.DEFAULT && labelHandle != 0) { int  layout = OS.gtk_label_get_layout (labelHandle); int  context = OS.pango_layout_get_context (layout); int  lang = OS.pango_context_get_language (context); int  font = getFontDescription (); int  metrics = OS.pango_context_get_metrics (context, font, lang); int ascent = OS.PANGO_PIXELS (OS.pango_font_metrics_get_ascent (metrics)); int descent = OS.PANGO_PIXELS (OS.pango_font_metrics_get_descent (metrics)); OS.pango_font_metrics_unref (metrics); int fontHeight = ascent + descent; int [] buffer = new int [1]; OS.g_object_get (labelHandle, OS.ypad, buffer, 0); fontHeight += 2 * buffer [0]; if (frameHandle != 0) { int  style = OS.gtk_widget_get_style (frameHandle); fontHeight += 2 * OS.gtk_style_get_ythickness (style); fontHeight += 2 * OS.gtk_container_get_border_width (frameHandle); } size.y = Math.max (size.y, fontHeight); }
public Point computeSize (int wHint, int hHint, boolean changed) {	checkWidget ();	if (wHint != SWT.DEFAULT && wHint < 0) wHint = 0;	if (hHint != SWT.DEFAULT && hHint < 0) hHint = 0;	if ((style & SWT.SEPARATOR) != 0) {		if ((style & SWT.HORIZONTAL) != 0) {			if (wHint == SWT.DEFAULT) wHint = DEFAULT_WIDTH;		} else {			if (hHint == SWT.DEFAULT) hHint = DEFAULT_HEIGHT;		}	}	boolean fixWrap = labelHandle != 0 && (style & SWT.WRAP) != 0;	if (fixWrap || frameHandle != 0) forceResize ();	int [] labelWidth = new int [1], labelHeight = new int [1];	if (fixWrap) {		OS.gtk_widget_get_size_request (labelHandle, labelWidth, labelHeight);		OS.gtk_widget_set_size_request (labelHandle, wHint, hHint);	}		Point size; 	if (frameHandle != 0) {		int [] reqWidth = new int [1], reqHeight = new int [1];		OS.gtk_widget_get_size_request (handle, reqWidth, reqHeight);		OS.gtk_widget_set_size_request (handle, wHint, hHint);		size = computeNativeSize (frameHandle, -1, -1, changed);		OS.gtk_widget_set_size_request (handle, reqWidth [0], reqHeight [0]);	} else {		size = computeNativeSize (handle, wHint, hHint, changed);	}	if (fixWrap) {		OS.gtk_widget_set_size_request (labelHandle, labelWidth [0], labelHeight [0]);	}	return size;}