From 3b4924a156246928ac672c5ce3321a6f43d3b4e9 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Thu, 15 May 2014 22:30:19 -0400 Subject: [PATCH] Removed some residual drawRect: stuff from bleh_darwin.m. So close... --- bleh_darwin.m | 28 ---------------------------- objc_darwin.h | 7 ------- 2 files changed, 35 deletions(-) diff --git a/bleh_darwin.m b/bleh_darwin.m index a8febcf..7bb9344 100644 --- a/bleh_darwin.m +++ b/bleh_darwin.m @@ -81,31 +81,3 @@ id makeDummyEvent() (NSInteger) 0, /* data1: */ (NSInteger) 0); /* data2: */ } - -/* -[NSView drawRect:] needs to be overridden in our Area subclass. This takes a NSRect, which I'm not sure how to encode, so we're going to have to use @encode() and hope for the best for portability. -*/ - -extern void areaView_drawRect(id, struct xrect); - -static void __areaView_drawRect(id self, SEL sel, NSRect r) -{ - struct xrect t; - - t.x = (int64_t) r.origin.x; - t.y = (int64_t) r.origin.y; - t.width = (int64_t) r.size.width; - t.height = (int64_t) r.size.height; - areaView_drawRect(self, t); -} - -void *_areaView_drawRect = (void *) __areaView_drawRect; - -/* -this and one below it are the only objective-c feature you'll see here - -unfortunately NSRect both varies across architectures and is passed as just a structure, so its encoding has to be computed at compile time -because @encode() is NOT A LITERAL, we're going to just stick it all the way back in objc_darwin.go -see also: http://stackoverflow.com/questions/6812035/adding-methods-dynamically -*/ -char *encodedNSRect = @encode(NSRect); diff --git a/objc_darwin.h b/objc_darwin.h index 06e79f9..42c7ce6 100644 --- a/objc_darwin.h +++ b/objc_darwin.h @@ -53,11 +53,4 @@ struct xpoint { extern void initBleh(); extern id makeDummyEvent(); -/* for area_darwin.go */ -/* TODO apparently ISO C forbids casting a function pointer to a non-function pointer; this will need to change???? */ -extern void *_areaView_drawRect; - -/* for objc_darwin.go */ -extern char *encodedNSRect; - #endif