Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 298698 | Differences between
and this patch

Collapse All | Expand All

(-)Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java (+13 lines)
Lines 24-29 Link Here
24
		VERSION = response [0] & 0xffff;		
24
		VERSION = response [0] & 0xffff;		
25
	}
25
	}
26
	
26
	
27
	/*
28
	 *  Magic number explanation, from Cocoa's TextSizingExample:
29
	 *  
30
	 *  "The first is called LargeNumberForText [1.0e7] and it was not arbitrarily chosen.
31
	 *  The actual value was chosen to be around the largest floating point value possible that can preserve at least pixel precision. [...]
32
	 *  It is not wise to use bigger dimensions for text system objects because, even if you ever fill all that space, 
33
	 *  by the time you get to the far reaches, the letters won't have the precision necessary to look and act correctly. 
34
	 *  [...] Because the Cocoa text system respects this limit in various ways, a second constant, NotQuiteAsLargeNumberForText, is used for the 
35
	 *  field-like text views created by the FieldAspect class. This is simply half of LargeNumberForText; at sizes as large as LargeNumberForText, 
36
	 *  the text system stops aligning text, for various reasons."
37
	 */
38
	public static final float /*double*/ MAX_TEXT_CONTAINER_SIZE = 0.5e7f;
39
	
27
	public static final int gestaltSystemVersion = ('s'<<24) + ('y'<<16) + ('s'<<8) + 'v';
40
	public static final int gestaltSystemVersion = ('s'<<24) + ('y'<<16) + ('s'<<8) + 'v';
28
	public static final int noErr = 0;
41
	public static final int noErr = 0;
29
	public static final int kProcessTransformToForegroundApplication = 1;
42
	public static final int kProcessTransformToForegroundApplication = 1;
(-)Eclipse SWT/cocoa/org/eclipse/swt/graphics/GC.java (-2 / +2 lines)
Lines 742-749 Link Here
742
742
743
void createLayout () {
743
void createLayout () {
744
	NSSize size = new NSSize();
744
	NSSize size = new NSSize();
745
	size.width = Float.MAX_VALUE;
745
	size.width = OS.MAX_TEXT_CONTAINER_SIZE;
746
	size.height = Float.MAX_VALUE;
746
	size.height = OS.MAX_TEXT_CONTAINER_SIZE;
747
	NSTextStorage textStorage = (NSTextStorage)new NSTextStorage().alloc().init();
747
	NSTextStorage textStorage = (NSTextStorage)new NSTextStorage().alloc().init();
748
	NSLayoutManager layoutManager = (NSLayoutManager)new NSLayoutManager().alloc().init();
748
	NSLayoutManager layoutManager = (NSLayoutManager)new NSLayoutManager().alloc().init();
749
	layoutManager.setBackgroundLayoutEnabled(NSThread.isMainThread());
749
	layoutManager.setBackgroundLayoutEnabled(NSThread.isMainThread());
(-)Eclipse SWT/cocoa/org/eclipse/swt/graphics/Path.java (-2 / +2 lines)
Lines 359-366 Link Here
359
		NSLayoutManager layoutManager = (NSLayoutManager)new NSLayoutManager().alloc().init();
359
		NSLayoutManager layoutManager = (NSLayoutManager)new NSLayoutManager().alloc().init();
360
		NSTextContainer textContainer = (NSTextContainer)new NSTextContainer().alloc();
360
		NSTextContainer textContainer = (NSTextContainer)new NSTextContainer().alloc();
361
		NSSize size = new NSSize();
361
		NSSize size = new NSSize();
362
		size.width = Float.MAX_VALUE;
362
		size.width = OS.MAX_TEXT_CONTAINER_SIZE;
363
		size.height = Float.MAX_VALUE;
363
		size.height = OS.MAX_TEXT_CONTAINER_SIZE;
364
		textContainer.initWithContainerSize(size);
364
		textContainer.initWithContainerSize(size);
365
		textStorage.addLayoutManager(layoutManager);
365
		textStorage.addLayoutManager(layoutManager);
366
		layoutManager.addTextContainer(textContainer);
366
		layoutManager.addTextContainer(textContainer);
(-)Eclipse SWT/cocoa/org/eclipse/swt/graphics/TextLayout.java (-2 / +2 lines)
Lines 291-298 Link Here
291
	attrStr.endEditing();
291
	attrStr.endEditing();
292
292
293
	NSSize size = new NSSize();
293
	NSSize size = new NSSize();
294
	size.width = wrapWidth != -1 ? wrapWidth : Float.MAX_VALUE;
294
	size.width = wrapWidth != -1 ? wrapWidth : OS.MAX_TEXT_CONTAINER_SIZE;
295
	size.height = Float.MAX_VALUE;
295
	size.height = OS.MAX_TEXT_CONTAINER_SIZE;
296
	if (textStorage == null) {
296
	if (textStorage == null) {
297
		textStorage = (NSTextStorage)new NSTextStorage().alloc().init();
297
		textStorage = (NSTextStorage)new NSTextStorage().alloc().init();
298
		layoutManager = (NSLayoutManager)new NSLayoutManager().alloc().init();
298
		layoutManager = (NSLayoutManager)new NSLayoutManager().alloc().init();
(-)Eclipse SWT/cocoa/org/eclipse/swt/widgets/Link.java (-1 / +1 lines)
Lines 135-141 Link Here
135
	NSLayoutManager layoutManager = (NSLayoutManager)new NSLayoutManager ().alloc ().init ();
135
	NSLayoutManager layoutManager = (NSLayoutManager)new NSLayoutManager ().alloc ().init ();
136
	NSTextContainer textContainer = (NSTextContainer)new NSTextContainer ().alloc ();
136
	NSTextContainer textContainer = (NSTextContainer)new NSTextContainer ().alloc ();
137
	NSSize size = new NSSize ();
137
	NSSize size = new NSSize ();
138
	size.width = size.height = Float.MAX_VALUE;
138
	size.width = size.height = OS.MAX_TEXT_CONTAINER_SIZE;
139
	if (wHint != SWT.DEFAULT) size.width = wHint;
139
	if (wHint != SWT.DEFAULT) size.width = wHint;
140
	if (hHint != SWT.DEFAULT) size.height = hHint;
140
	if (hHint != SWT.DEFAULT) size.height = hHint;
141
	textContainer.initWithContainerSize (size);
141
	textContainer.initWithContainerSize (size);
(-)Eclipse SWT/cocoa/org/eclipse/swt/widgets/Text.java (-1 / +1 lines)
Lines 370-376 Link Here
370
		NSLayoutManager layoutManager = (NSLayoutManager)new NSLayoutManager ().alloc ().init ();
370
		NSLayoutManager layoutManager = (NSLayoutManager)new NSLayoutManager ().alloc ().init ();
371
		NSTextContainer textContainer = (NSTextContainer)new NSTextContainer ().alloc ();
371
		NSTextContainer textContainer = (NSTextContainer)new NSTextContainer ().alloc ();
372
		NSSize size = new NSSize ();
372
		NSSize size = new NSSize ();
373
		size.width = size.height = Float.MAX_VALUE;
373
		size.width = size.height = OS.MAX_TEXT_CONTAINER_SIZE;
374
		if ((style & SWT.WRAP) != 0) {
374
		if ((style & SWT.WRAP) != 0) {
375
			if (wHint != SWT.DEFAULT) size.width = wHint;
375
			if (wHint != SWT.DEFAULT) size.width = wHint;
376
			if (hHint != SWT.DEFAULT) size.height = hHint;
376
			if (hHint != SWT.DEFAULT) size.height = hHint;

Return to bug 298698