Community
Participate
Working Groups
VERSION = response [0] & 0xffff;
}
/*
* Magic number explanation, from Cocoa's TextSizingExample:
*
* "The first is called LargeNumberForText [1.0e7] and it was not arbitrarily chosen.
* The actual value was chosen to be around the largest floating point value possible that can preserve at least pixel precision. [...]
* It is not wise to use bigger dimensions for text system objects because, even if you ever fill all that space,
* by the time you get to the far reaches, the letters won't have the precision necessary to look and act correctly.
* [...] Because the Cocoa text system respects this limit in various ways, a second constant, NotQuiteAsLargeNumberForText, is used for the
* field-like text views created by the FieldAspect class. This is simply half of LargeNumberForText; at sizes as large as LargeNumberForText,
* the text system stops aligning text, for various reasons."
*/
public static final float /*double*/ MAX_TEXT_CONTAINER_SIZE = 0.5e7f;
public static final int gestaltSystemVersion = ('s'<<24) + ('y'<<16) + ('s'<<8) + 'v';
public static final int noErr = 0;
public static final int kProcessTransformToForegroundApplication = 1;
void createLayout () {
NSSize size = new NSSize();
size.width = Float.MAX_VALUE;
size.width = OS.MAX_TEXT_CONTAINER_SIZE;
size.height = Float.MAX_VALUE;
size.height = OS.MAX_TEXT_CONTAINER_SIZE;
NSTextStorage textStorage = (NSTextStorage)new NSTextStorage().alloc().init();
NSLayoutManager layoutManager = (NSLayoutManager)new NSLayoutManager().alloc().init();
layoutManager.setBackgroundLayoutEnabled(NSThread.isMainThread());
NSTextContainer textContainer = (NSTextContainer)new NSTextContainer().alloc();
textContainer.initWithContainerSize(size);
textStorage.addLayoutManager(layoutManager);
layoutManager.addTextContainer(textContainer);
attrStr.endEditing();
size.width = wrapWidth != -1 ? wrapWidth : Float.MAX_VALUE;
size.width = wrapWidth != -1 ? wrapWidth : OS.MAX_TEXT_CONTAINER_SIZE;
if (textStorage == null) {
textStorage = (NSTextStorage)new NSTextStorage().alloc().init();
layoutManager = (NSLayoutManager)new NSLayoutManager().alloc().init();
NSLayoutManager layoutManager = (NSLayoutManager)new NSLayoutManager ().alloc ().init ();
NSTextContainer textContainer = (NSTextContainer)new NSTextContainer ().alloc ();
NSSize size = new NSSize ();
size.width = size.height = Float.MAX_VALUE;
size.width = size.height = OS.MAX_TEXT_CONTAINER_SIZE;
if (wHint != SWT.DEFAULT) size.width = wHint;
if (hHint != SWT.DEFAULT) size.height = hHint;
textContainer.initWithContainerSize (size);
if ((style & SWT.WRAP) != 0) {