Removed objc_msgSend_uint().

This commit is contained in:
Pietro Gagliardi 2014-04-04 18:56:37 -04:00
parent bf1e7aae42
commit ba2c1d6d20
6 changed files with 9 additions and 12 deletions

View File

@ -38,7 +38,7 @@ uintptr_t objc_msgSend_uintret_noargs(id obj, SEL sel)
return (uintptr_t) ((NSUInteger) objc_msgSend(obj, sel)); return (uintptr_t) ((NSUInteger) objc_msgSend(obj, sel));
} }
id _objc_msgSend_uint(id obj, SEL sel, uintptr_t a) id objc_msgSend_uint(id obj, SEL sel, uintptr_t a)
{ {
return objc_msgSend(obj, sel, (NSUInteger) a); return objc_msgSend(obj, sel, (NSUInteger) a);
} }

View File

@ -34,7 +34,7 @@ func _msgBox(primarytext string, secondarytext string, style uintptr, button0 st
box := C.objc_msgSend_noargs(_NSAlert, _new) box := C.objc_msgSend_noargs(_NSAlert, _new)
C.objc_msgSend_id(box, _setMessageText, toNSString(primarytext)) C.objc_msgSend_id(box, _setMessageText, toNSString(primarytext))
C.objc_msgSend_id(box, _setInformativeText, toNSString(secondarytext)) C.objc_msgSend_id(box, _setInformativeText, toNSString(secondarytext))
objc_msgSend_uint(box, _setAlertStyle, style) C.objc_msgSend_uint(box, _setAlertStyle, C.uintptr_t(style))
C.objc_msgSend_id(box, _addButtonWithTitle, toNSString(button0)) C.objc_msgSend_id(box, _addButtonWithTitle, toNSString(button0))
C.objc_msgSend_noargs(box, _runModal) C.objc_msgSend_noargs(box, _runModal)
ret <- struct{}{} ret <- struct{}{}

View File

@ -100,12 +100,13 @@ func insertListboxArrayBefore(array C.id, what string, before int) {
} }
func deleteListboxArray(array C.id, index int) { func deleteListboxArray(array C.id, index int) {
objc_msgSend_uint(array, _removeObjectAtArrangedObjectIndex, uintptr(index)) C.objc_msgSend_uint(array, _removeObjectAtArrangedObjectIndex,
C.uintptr_t(index))
} }
func indexListboxArray(array C.id, index int) string { func indexListboxArray(array C.id, index int) string {
array = C.objc_msgSend_noargs(array, _arrangedObjects) array = C.objc_msgSend_noargs(array, _arrangedObjects)
dict := objc_msgSend_uint(array, _objectAtIndex, uintptr(index)) dict := C.objc_msgSend_uint(array, _objectAtIndex, C.uintptr_t(index))
return fromListboxItem(dict) return fromListboxItem(dict)
} }

View File

@ -66,10 +66,6 @@ func objc_msgSend_rect(obj C.id, sel C.SEL, x int, y int, w int, h int) C.id {
C.int64_t(x), C.int64_t(y), C.int64_t(w), C.int64_t(h)) C.int64_t(x), C.int64_t(y), C.int64_t(w), C.int64_t(h))
} }
func objc_msgSend_uint(obj C.id, sel C.SEL, a uintptr) C.id {
return C._objc_msgSend_uint(obj, sel, C.uintptr_t(a))
}
func objc_msgSend_rect_bool(obj C.id, sel C.SEL, x int, y int, w int, h int, b C.BOOL) C.id { func objc_msgSend_rect_bool(obj C.id, sel C.SEL, x int, y int, w int, h int, b C.BOOL) C.id {
return C._objc_msgSend_rect_bool(obj, sel, return C._objc_msgSend_rect_bool(obj, sel,
C.int64_t(x), C.int64_t(y), C.int64_t(w), C.int64_t(h), C.int64_t(x), C.int64_t(y), C.int64_t(w), C.int64_t(h),

View File

@ -86,7 +86,7 @@ m1(str, char *) /* TODO Go string? */
m1(id, id) m1(id, id)
extern id _objc_msgSend_rect(id obj, SEL sel, int64_t x, int64_t y, int64_t w, int64_t h); extern id _objc_msgSend_rect(id obj, SEL sel, int64_t x, int64_t y, int64_t w, int64_t h);
m1(sel, SEL) m1(sel, SEL)
extern id _objc_msgSend_uint(id obj, SEL sel, uintptr_t a); extern id objc_msgSend_uint(id obj, SEL sel, uintptr_t a);
m1(ptr, void *) m1(ptr, void *)
m1(bool, BOOL) m1(bool, BOOL)
extern id objc_msgSend_int(id obj, SEL sel, intptr_t a); extern id objc_msgSend_int(id obj, SEL sel, intptr_t a);

View File

@ -137,7 +137,7 @@ var classTypes = [nctypes]*classData{
// NSControl requires that we specify a frame; dummy frame for now // NSControl requires that we specify a frame; dummy frame for now
button = objc_msgSend_rect(button, _initWithFrame, button = objc_msgSend_rect(button, _initWithFrame,
0, 0, 100, 100) 0, 0, 100, 100)
objc_msgSend_uint(button, _setBezelStyle, 1) // NSRoundedBezelStyle C.objc_msgSend_uint(button, _setBezelStyle, C.uintptr_t(1)) // NSRoundedBezelStyle
C.objc_msgSend_id(button, _setTarget, appDelegate) C.objc_msgSend_id(button, _setTarget, appDelegate)
C.objc_msgSend_sel(button, _setAction, _buttonClicked) C.objc_msgSend_sel(button, _setAction, _buttonClicked)
// by default the button uses the wrong text size // by default the button uses the wrong text size
@ -156,7 +156,7 @@ var classTypes = [nctypes]*classData{
checkbox := objc_alloc(_NSButton) checkbox := objc_alloc(_NSButton)
checkbox = objc_msgSend_rect(checkbox, _initWithFrame, checkbox = objc_msgSend_rect(checkbox, _initWithFrame,
0, 0, 100, 100) 0, 0, 100, 100)
objc_msgSend_uint(checkbox, _setButtonType, 3) // NSSwitchButton C.objc_msgSend_uint(checkbox, _setButtonType, C.uintptr_t(3)) // NSSwitchButton
addControl(parentWindow, checkbox) addControl(parentWindow, checkbox)
return checkbox return checkbox
}, },
@ -268,7 +268,7 @@ var classTypes = [nctypes]*classData{
0, 0, 100, 100) 0, 0, 100, 100)
// TODO really int? // TODO really int?
C.objc_msgSend_int(pbar, _setStyle, 0) // NSProgressIndicatorBarStyle C.objc_msgSend_int(pbar, _setStyle, 0) // NSProgressIndicatorBarStyle
objc_msgSend_uint(pbar, _setControlSize, 0) // NSRegularControlSize C.objc_msgSend_uint(pbar, _setControlSize, C.uintptr_t(0)) // NSRegularControlSize
C.objc_msgSend_bool(pbar, _setIndeterminate, C.BOOL(C.NO)) C.objc_msgSend_bool(pbar, _setIndeterminate, C.BOOL(C.NO))
addControl(parentWindow, pbar) addControl(parentWindow, pbar)
return pbar return pbar