From 8084ef53e1f64e41e35c44dac22e93635120cf46 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Fri, 16 May 2014 02:00:21 -0400 Subject: [PATCH] Removed bleh_darwin.m and the initBleh() function that it contained as its only remaining code. --- bleh_darwin.m | 66 ------------------------------------------------ objc_darwin.h | 3 --- uitask_darwin.go | 1 - 3 files changed, 70 deletions(-) delete mode 100644 bleh_darwin.m diff --git a/bleh_darwin.m b/bleh_darwin.m deleted file mode 100644 index b2f0fe7..0000000 --- a/bleh_darwin.m +++ /dev/null @@ -1,66 +0,0 @@ -/* 28 february 2014 */ - -/* -I wanted to avoid invoking Objective-C directly, preferring to do everything directly with the API. However, there are some things that simply cannot be done too well; for those situations, there's this. It does use the Objective-C runtime, eschewing the actual Objective-C part of this being an Objective-C file. - -The main culprits are: -- data types listed as being defined in nonexistent headers -- 32-bit/64-bit type differences that are more than just a different typedef -- wrong documentation -though this is not always the case. -*/ - -#include "objc_darwin.h" - -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -/* -These are all the selectors and class IDs used by the functions below. -*/ - -static id c_NSEvent; /* makeDummyEvent() */ -static SEL s_newEvent; -static id c_NSBitmapImageRep; /* drawImage() */ -static SEL s_alloc; -static SEL s_initWithBitmapDataPlanes; -static SEL s_drawInRect; -static SEL s_release; -static SEL s_locationInWindow; /* getTranslatedEventPoint() */ -static SEL s_convertPointFromView; -static id c_NSFont; -static SEL s_setFont; /* objc_setFont() */ -static SEL s_systemFontOfSize; -static SEL s_systemFontSizeForControlSize; -static id c_NSTrackingArea; -static SEL s_bounds; -static SEL s_initTrackingArea; - -void initBleh() -{ - c_NSEvent = objc_getClass("NSEvent"); - s_newEvent = sel_getUid("otherEventWithType:location:modifierFlags:timestamp:windowNumber:context:subtype:data1:data2:"); - c_NSBitmapImageRep = objc_getClass("NSBitmapImageRep"); - s_alloc = sel_getUid("alloc"); - s_initWithBitmapDataPlanes = sel_getUid("initWithBitmapDataPlanes:pixelsWide:pixelsHigh:bitsPerSample:samplesPerPixel:hasAlpha:isPlanar:colorSpaceName:bitmapFormat:bytesPerRow:bitsPerPixel:"); - s_drawInRect = sel_getUid("drawInRect:fromRect:operation:fraction:respectFlipped:hints:"); - s_release = sel_getUid("release"); - s_locationInWindow = sel_getUid("locationInWindow"); - s_convertPointFromView = sel_getUid("convertPoint:fromView:"); - c_NSFont = objc_getClass("NSFont"); - s_setFont = sel_getUid("setFont:"); - s_systemFontOfSize = sel_getUid("systemFontOfSize:"); - s_systemFontSizeForControlSize = sel_getUid("systemFontSizeForControlSize:"); - c_NSTrackingArea = objc_getClass("NSTrackingArea"); - s_bounds = sel_getUid("bounds"); - s_initTrackingArea = sel_getUid("initWithRect:options:owner:userInfo:"); -} - diff --git a/objc_darwin.h b/objc_darwin.h index 4c5c6d8..feab715 100644 --- a/objc_darwin.h +++ b/objc_darwin.h @@ -49,7 +49,4 @@ struct xpoint { int64_t y; }; -/* for uitask_darwin.go */ -extern void initBleh(); - #endif diff --git a/uitask_darwin.go b/uitask_darwin.go index 79cd5c3..6427b07 100644 --- a/uitask_darwin.go +++ b/uitask_darwin.go @@ -46,7 +46,6 @@ func ui(main func()) error { // TODO move to init_darwin.go? func initCocoa() (err error) { - C.initBleh() // initialize bleh_darwin.m functions makeAppDelegate() if C.initCocoa(appDelegate) != C.YES { return fmt.Errorf("error setting NSApplication activation policy (basically identifies our program as a separate program; needed for several things, such as Dock icon, application menu, window resizing, etc.) (unknown reason)")