View | Details | Raw Unified | Return to bug 233579
Collapse All | Expand All

(-)Eclipse SWT PI/cocoa/library/os.c (+20 lines)
Lines 226-231 Link Here
226
}
226
}
227
#endif
227
#endif
228
228
229
#ifndef NO_CALLBACK_1columnAtPoint_1
230
static jintLong CALLBACK_1columnAtPoint_1;
231
static NSInteger proc_CALLBACK_1columnAtPoint_1(id arg0, SEL arg1, NSPoint arg2) {
232
	return ((NSInteger (*)(id, SEL, NSPoint*))CALLBACK_1columnAtPoint_1)(arg0, arg1, &arg2);
233
}
234
static jintLong CALLBACK_columnAtPoint_(jintLong func) {
235
	CALLBACK_1columnAtPoint_1 = func;
236
	return (jintLong)proc_CALLBACK_1columnAtPoint_1;
237
}
238
JNIEXPORT jintLong JNICALL OS_NATIVE(CALLBACK_1columnAtPoint_1)
239
	(JNIEnv *env, jclass that, jintLong arg0)
240
{
241
	jintLong rc = 0;
242
	OS_NATIVE_ENTER(env, that, CALLBACK_1columnAtPoint_1_FUNC);
243
	rc = (jintLong)CALLBACK_columnAtPoint_(arg0);
244
	OS_NATIVE_EXIT(env, that, CALLBACK_1columnAtPoint_1_FUNC);
245
	return rc;
246
}
247
#endif
248
229
#ifndef NO_CALLBACK_1dragSelectionWithEvent_1offset_1slideBack_1
249
#ifndef NO_CALLBACK_1dragSelectionWithEvent_1offset_1slideBack_1
230
static jintLong CALLBACK_1dragSelectionWithEvent_1offset_1slideBack_1;
250
static jintLong CALLBACK_1dragSelectionWithEvent_1offset_1slideBack_1;
231
static BOOL proc_CALLBACK_1dragSelectionWithEvent_1offset_1slideBack_1(id arg0, SEL arg1, NSEvent* arg2, NSSize arg3, BOOL arg4) {
251
static BOOL proc_CALLBACK_1dragSelectionWithEvent_1offset_1slideBack_1(id arg0, SEL arg1, NSEvent* arg2, NSSize arg3, BOOL arg4) {
(-)Eclipse SWT PI/cocoa/library/os_stats.c (-2 / +3 lines)
Lines 14-21 Link Here
14
14
15
#ifdef NATIVE_STATS
15
#ifdef NATIVE_STATS
16
16
17
int OS_nativeFunctionCount = 587;
17
int OS_nativeFunctionCount = 588;
18
int OS_nativeFunctionCallCount[587];
18
int OS_nativeFunctionCallCount[588];
19
char * OS_nativeFunctionNames[] = {
19
char * OS_nativeFunctionNames[] = {
20
	"ATSFontActivateFromFileReference",
20
	"ATSFontActivateFromFileReference",
21
	"AcquireRootMenu",
21
	"AcquireRootMenu",
Lines 26-31 Link Here
26
	"CALLBACK_1cellBaselineOffset",
26
	"CALLBACK_1cellBaselineOffset",
27
	"CALLBACK_1cellSize",
27
	"CALLBACK_1cellSize",
28
	"CALLBACK_1characterIndexForPoint_1",
28
	"CALLBACK_1characterIndexForPoint_1",
29
	"CALLBACK_1columnAtPoint_1",
29
	"CALLBACK_1dragSelectionWithEvent_1offset_1slideBack_1",
30
	"CALLBACK_1dragSelectionWithEvent_1offset_1slideBack_1",
30
	"CALLBACK_1draggedImage_1beganAt_1",
31
	"CALLBACK_1draggedImage_1beganAt_1",
31
	"CALLBACK_1draggedImage_1endedAt_1operation_1",
32
	"CALLBACK_1draggedImage_1endedAt_1operation_1",
(-)Eclipse SWT PI/cocoa/library/os_stats.h (+1 lines)
Lines 34-39 Link Here
34
	CALLBACK_1cellBaselineOffset_FUNC,
34
	CALLBACK_1cellBaselineOffset_FUNC,
35
	CALLBACK_1cellSize_FUNC,
35
	CALLBACK_1cellSize_FUNC,
36
	CALLBACK_1characterIndexForPoint_1_FUNC,
36
	CALLBACK_1characterIndexForPoint_1_FUNC,
37
	CALLBACK_1columnAtPoint_1_FUNC,
37
	CALLBACK_1dragSelectionWithEvent_1offset_1slideBack_1_FUNC,
38
	CALLBACK_1dragSelectionWithEvent_1offset_1slideBack_1_FUNC,
38
	CALLBACK_1draggedImage_1beganAt_1_FUNC,
39
	CALLBACK_1draggedImage_1beganAt_1_FUNC,
39
	CALLBACK_1draggedImage_1endedAt_1operation_1_FUNC,
40
	CALLBACK_1draggedImage_1endedAt_1operation_1_FUNC,
(-)Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/AppKitFull.bridgesupport.extras (-1 / +1 lines)
Lines 2984-2990 Link Here
2984
		</method>
2984
		</method>
2985
	</class>
2985
	</class>
2986
	<class name="NSTableHeaderView" swt_gen="mixed" swt_superclass="NSView">
2986
	<class name="NSTableHeaderView" swt_gen="mixed" swt_superclass="NSView">
2987
		<method selector="columnAtPoint:" swt_gen="true">
2987
		<method selector="columnAtPoint:" swt_gen="true" swt_gen_custom_callback="true" swt_gen_super_msgSend="true">
2988
			<arg swt_gen="true"></arg>
2988
			<arg swt_gen="true"></arg>
2989
			<retval swt_gen="true"></retval>
2989
			<retval swt_gen="true"></retval>
2990
		</method>
2990
		</method>
(-)Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java (+2 lines)
Lines 482-487 Link Here
482
public static final native int /*long*/ CALLBACK_cellSize(int /*long*/ func);
482
public static final native int /*long*/ CALLBACK_cellSize(int /*long*/ func);
483
/** @method callback_types=NSUInteger;id;SEL;NSPoint;,callback_flags=none;none;none;struct; */
483
/** @method callback_types=NSUInteger;id;SEL;NSPoint;,callback_flags=none;none;none;struct; */
484
public static final native int /*long*/ CALLBACK_characterIndexForPoint_(int /*long*/ func);
484
public static final native int /*long*/ CALLBACK_characterIndexForPoint_(int /*long*/ func);
485
/** @method callback_types=NSInteger;id;SEL;NSPoint;,callback_flags=none;none;none;struct; */
486
public static final native int /*long*/ CALLBACK_columnAtPoint_(int /*long*/ func);
485
/** @method callback_types=BOOL;id;SEL;NSEvent*;NSSize;BOOL;,callback_flags=none;none;none;none;struct;none; */
487
/** @method callback_types=BOOL;id;SEL;NSEvent*;NSSize;BOOL;,callback_flags=none;none;none;none;struct;none; */
486
public static final native int /*long*/ CALLBACK_dragSelectionWithEvent_offset_slideBack_(int /*long*/ func);
488
public static final native int /*long*/ CALLBACK_dragSelectionWithEvent_offset_slideBack_(int /*long*/ func);
487
/** @method callback_types=void;id;SEL;NSImage*;NSPoint;,callback_flags=none;none;none;none;struct; */
489
/** @method callback_types=void;id;SEL;NSImage*;NSPoint;,callback_flags=none;none;none;none;struct; */
(-)Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java (-1 / +7 lines)
Lines 2150-2156 Link Here
2150
	int /*long*/ drawViewBackgroundInRectProc = OS.CALLBACK_drawViewBackgroundInRect_(proc3);
2150
	int /*long*/ drawViewBackgroundInRectProc = OS.CALLBACK_drawViewBackgroundInRect_(proc3);
2151
	int /*long*/ drawBackgroundInClipRectProc = OS.CALLBACK_drawBackgroundInClipRect_(proc3);
2151
	int /*long*/ drawBackgroundInClipRectProc = OS.CALLBACK_drawBackgroundInClipRect_(proc3);
2152
	int /*long*/ scrollClipView_ToPointProc = OS.CALLBACK_scrollClipView_toPoint_(proc4);
2152
	int /*long*/ scrollClipView_ToPointProc = OS.CALLBACK_scrollClipView_toPoint_(proc4);
2153
	
2153
	int /*long*/ columnAtPointProc = OS.CALLBACK_columnAtPoint_(proc3);
2154
2154
	byte[] types = {'*','\0'};
2155
	byte[] types = {'*','\0'};
2155
	int size = C.PTR_SIZEOF, align = C.PTR_SIZEOF == 4 ? 2 : 3;
2156
	int size = C.PTR_SIZEOF, align = C.PTR_SIZEOF == 4 ? 2 : 3;
2156
2157
Lines 2466-2471 Link Here
2466
	OS.class_addMethod(cls, OS.sel_resetCursorRects, proc2, "@:");
2467
	OS.class_addMethod(cls, OS.sel_resetCursorRects, proc2, "@:");
2467
	OS.class_addMethod(cls, OS.sel_updateTrackingAreas, proc2, "@:");
2468
	OS.class_addMethod(cls, OS.sel_updateTrackingAreas, proc2, "@:");
2468
	OS.class_addMethod(cls, OS.sel_menuForEvent_, proc3, "@:@");
2469
	OS.class_addMethod(cls, OS.sel_menuForEvent_, proc3, "@:@");
2470
	OS.class_addMethod(cls, OS.sel_columnAtPoint_, columnAtPointProc, "@:{NSPoint}");
2469
	//TODO hitTestProc and drawRectProc should be set Control.setRegion()? 
2471
	//TODO hitTestProc and drawRectProc should be set Control.setRegion()? 
2470
	OS.objc_registerClassPair(cls);
2472
	OS.objc_registerClassPair(cls);
2471
2473
Lines 4956-4961 Link Here
4956
		NSRect rect = new NSRect();
4958
		NSRect rect = new NSRect();
4957
		OS.memmove(rect, arg0, NSRect.sizeof);
4959
		OS.memmove(rect, arg0, NSRect.sizeof);
4958
		widget.drawRect(id, sel, rect);
4960
		widget.drawRect(id, sel, rect);
4961
	} else if (sel == OS.sel_columnAtPoint_) {
4962
		NSPoint point = new NSPoint();
4963
		OS.memmove(point, arg0, NSPoint.sizeof);
4964
		return widget.columnAtPoint(id, sel, point);
4959
	} else if (sel == OS.sel__drawThemeProgressArea_) {
4965
	} else if (sel == OS.sel__drawThemeProgressArea_) {
4960
		widget._drawThemeProgressArea(id, sel, arg0);
4966
		widget._drawThemeProgressArea(id, sel, arg0);
4961
	} else if (sel == OS.sel_setFrameOrigin_) {
4967
	} else if (sel == OS.sel_setFrameOrigin_) {
(-)Eclipse SWT/cocoa/org/eclipse/swt/widgets/Table.java (+34 lines)
Lines 123-128 Link Here
123
	super (parent, checkStyle (style));
123
	super (parent, checkStyle (style));
124
}
124
}
125
125
126
int /*long*/ accessibilityAttributeValue(int /*long*/ id, int /*long*/ sel, int /*long*/ arg0) {
127
	int /*long*/ returnValue = 0;
128
	NSString attributeName = new NSString(arg0);
129
	
130
	// If the check column is visible, don't report it back as a column for accessibility purposes.
131
	// The check column is meant to appear as a part of the first column.
132
	if (attributeName.isEqualToString (OS.NSAccessibilityColumnsAttribute) || attributeName.isEqualToString(OS.NSAccessibilityVisibleColumnsAttribute)) {
133
		if ((style & SWT.CHECK) != 0) {
134
			int /*long*/ superValue = super.accessibilityAttributeValue(id, sel, arg0);
135
			if (superValue != 0) {
136
				NSArray columns = new NSArray(superValue);
137
				NSMutableArray columnsWithoutCheck = NSMutableArray.arrayWithCapacity(columns.count() - 1);
138
				columnsWithoutCheck.addObjectsFromArray(columns);
139
				columnsWithoutCheck.removeObjectAtIndex(0);
140
				returnValue = columnsWithoutCheck.id;
141
			}
142
		}
143
	}
144
	
145
	if (returnValue != 0) {
146
		return returnValue;
147
	} else {
148
		return super.accessibilityAttributeValue(id, sel, arg0);
149
	}
150
}
151
126
void _addListener (int eventType, Listener listener) {
152
void _addListener (int eventType, Listener listener) {
127
	super._addListener (eventType, listener);
153
	super._addListener (eventType, listener);
128
	clearCachedWidth(items);
154
	clearCachedWidth(items);
Lines 409-414 Link Here
409
	}
435
	}
410
}
436
}
411
437
438
int /*long*/ columnAtPoint(int /*long*/ id, int /*long*/ sel, NSPoint point) {
439
	if ((style & SWT.CHECK) != 0) {
440
		if (point.x <= getCheckColumnWidth() && point.y < headerView.frame().height) return -1;
441
	}
442
	
443
	return super.columnAtPoint(id, sel, point);
444
}
445
412
public Point computeSize (int wHint, int hHint, boolean changed) {
446
public Point computeSize (int wHint, int hHint, boolean changed) {
413
	checkWidget ();
447
	checkWidget ();
414
	int width = 0;
448
	int width = 0;
(-)Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tree.java (+34 lines)
Lines 155-160 Link Here
155
	return item;
155
	return item;
156
}
156
}
157
157
158
int /*long*/ accessibilityAttributeValue(int /*long*/ id, int /*long*/ sel, int /*long*/ arg0) {
159
	int /*long*/ returnValue = 0;
160
	NSString attributeName = new NSString(arg0);
161
	
162
	// If the check column is visible, don't report it back as a column for accessibility purposes.
163
	// The check column is meant to appear as a part of the first column.
164
	if (attributeName.isEqualToString (OS.NSAccessibilityColumnsAttribute) || attributeName.isEqualToString(OS.NSAccessibilityVisibleColumnsAttribute)) {
165
		if ((style & SWT.CHECK) != 0) {
166
			int /*long*/ superValue = super.accessibilityAttributeValue(id, sel, arg0);
167
			if (superValue != 0) {
168
				NSArray columns = new NSArray(superValue);
169
				NSMutableArray columnsWithoutCheck = NSMutableArray.arrayWithCapacity(columns.count() - 1);
170
				columnsWithoutCheck.addObjectsFromArray(columns);
171
				columnsWithoutCheck.removeObjectAtIndex(0);
172
				returnValue = columnsWithoutCheck.id;
173
			}
174
		}
175
	}
176
	
177
	if (returnValue != 0) {
178
		return returnValue;
179
	} else {
180
		return super.accessibilityAttributeValue(id, sel, arg0);
181
	}
182
}
183
158
/**
184
/**
159
 * Adds the listener to the collection of listeners who will
185
 * Adds the listener to the collection of listeners who will
160
 * be notified when the user changes the receiver's selection, by sending
186
 * be notified when the user changes the receiver's selection, by sending
Lines 430-435 Link Here
430
	setScrollWidth ();
456
	setScrollWidth ();
431
}
457
}
432
458
459
int /*long*/ columnAtPoint(int /*long*/ id, int /*long*/ sel, NSPoint point) {
460
	if ((style & SWT.CHECK) != 0) {
461
		if (point.x <= getCheckColumnWidth() && point.y < headerView.frame().height) return -1;
462
	}
463
	
464
	return super.columnAtPoint(id, sel, point);
465
}
466
433
public Point computeSize (int wHint, int hHint, boolean changed) {
467
public Point computeSize (int wHint, int hHint, boolean changed) {
434
	checkWidget ();
468
	checkWidget ();
435
	int width = 0, height = 0;
469
	int width = 0, height = 0;
(-)Eclipse SWT/cocoa/org/eclipse/swt/widgets/Widget.java (+7 lines)
Lines 547-552 Link Here
547
	OS.objc_msgSendSuper(super_struct, sel, item, children);
547
	OS.objc_msgSendSuper(super_struct, sel, item, children);
548
}
548
}
549
549
550
int /*long*/ columnAtPoint(int /*long*/ id, int /*long*/ sel, NSPoint point) {
551
	objc_super super_struct = new objc_super();
552
	super_struct.receiver = id;
553
	super_struct.super_class = OS.objc_msgSend(id, OS.sel_superclass);
554
	return OS.objc_msgSendSuper(super_struct, sel, point);
555
}
556
550
void copyToClipboard (char [] buffer) {
557
void copyToClipboard (char [] buffer) {
551
	if (buffer.length == 0) return;
558
	if (buffer.length == 0) return;
552
	NSPasteboard pasteboard = NSPasteboard.generalPasteboard ();
559
	NSPasteboard pasteboard = NSPasteboard.generalPasteboard ();

Return to bug 233579