2014-03-01 03:17:32 -06:00
/* 28 february 2014 */
/*
This includes all Objective - C runtime headers for convenience . It also creates wrappers around objc_msgSend ( ) out of necessity .
cgo doesn ' t support calling variable argument list C functions , so objc_msgSend ( ) cannot be called directly .
Furthermore , Objective - C selectors work by basically sending the arguments to objc_msgSend ( ) verbatim across the wire . This basically means we ' re stuck making wrapper functions for every possible argument list . What fun !
The format should be self - explanatory .
*/
2014-03-01 16:01:28 -06:00
/* for some reason I now have to use an include guard after commit [master 9b4e30c] ("Started to build a single global delegate object; now to fix issues.") */
# ifndef _OBJC_DARWIN_H_
# define _OBJC_DARWIN_H_
2014-03-01 03:17:32 -06:00
# include <objc/message.h>
# include <objc/objc.h>
# include <objc/runtime.h>
# include <stdint.h>
2014-05-15 18:55:16 -05:00
struct xrect ; // TODO move that up here when finally getting rid of bleh_darwin.m
extern id toNSString ( char * ) ;
extern char * fromNSString ( id ) ;
extern void display ( id ) ;
extern struct xrect frame ( id ) ;
extern id makeScrollView ( id ) ;
extern void giveScrollViewBezelBorder ( id ) ;
extern id scrollViewContent ( id ) ;
// BEGIN OLD CODE
2014-03-01 12:58:38 -06:00
struct xrect {
int64_t x ;
int64_t y ;
int64_t width ;
int64_t height ;
} ;
2014-03-01 03:21:47 -06:00
struct xsize {
int64_t width ;
int64_t height ;
} ;
2014-03-30 16:52:27 -05:00
struct xpoint {
int64_t x ;
int64_t y ;
} ;
2014-03-05 19:09:15 -06:00
/* for uitask_darwin.go */
2014-04-05 12:30:56 -05:00
extern void initBleh ( ) ;
2014-03-05 19:09:15 -06:00
extern id makeDummyEvent ( ) ;
2014-03-29 22:57:49 -05:00
/* for area_darwin.go */
2014-05-10 20:03:04 -05:00
/* TODO apparently ISO C forbids casting a function pointer to a non-function pointer; this will need to change???? */
2014-04-04 21:21:53 -05:00
extern void * _areaView_drawRect ;
2014-03-30 16:52:27 -05:00
extern void drawImage ( void * , int64_t , int64_t , int64_t , int64_t , int64_t ) ;
extern struct xpoint getTranslatedEventPoint ( id , id ) ;
2014-03-29 22:57:49 -05:00
2014-04-04 21:21:53 -05:00
/* for objc_darwin.go */
extern char * encodedNSRect ;
2014-04-06 22:33:27 -05:00
extern char * encodedTerminateReply ;
2014-04-04 21:21:53 -05:00
2014-04-04 13:52:38 -05:00
/* for sysdata_darwin.go */
extern void objc_setFont ( id , unsigned int ) ;
2014-04-06 22:33:27 -05:00
/* for delegate_darwin.go */
extern void * _appDelegate_applicationShouldTerminate ;
2014-03-01 16:01:28 -06:00
# endif