forked from mathk/gst-objc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gst-objc-ext.h
90 lines (67 loc) · 2.47 KB
/
gst-objc-ext.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#include <gstpub.h>
#import <Cocoa/Cocoa.h>
#import "gst-objc.h"
#import "gst-string.h"
#import "gst-array.h"
#import "objc-proxy.h"
#ifndef GNU_RUNTIME
#import <objc/objc-runtime.h>
#endif
@interface NSObject (gst)
- (BOOL)isSmalltalk;
- (BOOL)isStProxy;
@end
@interface NSApplication (gst)
- (void)setRunning;
- (void)setLaunched;
@end
typedef struct gst_objc_object
{
OBJ_HEADER;
OOP objcPtr;
OOP isClass;
}
*gst_objc_object;
/* Initialize threading object */
void gst_initThreading ();
/* Initialize ffi type */
void gst_initFFIType ();
/* Initialize some variables */
void gst_initGlobal ();
/* Retain ObjC object */
void gst_retain(id object);
/* Release ObjC object */
void gst_release(id object);
/* Return number of byte of a CGFlaot */
int gst_sizeofCGFloat();
/* Set the smalltalk object of a ObjC proxy */
void gst_setIvarOOP(id receiver, const char * name, OOP value);
/* Fill a NSRect with the current NSColor. This is needed since gst
ccall out does not suport struct */
void gst_rectFill (NSRect * rect);
/* Return the size of the return value for a given message */
int gst_sendMessageReturnSize (id receiver, SEL selector);
/* Return the string encode of the return value */
char* gst_sendMessageReturnType (id receiver, SEL selector);
/* Add a method to smalltalk object. This create a call into
smalltalk whenever a message is send to the ObjC object */
void gst_addMethod(char * selector, Class cls, const char * typeStr);
/* Convert from smalltalk to ObjC*/
void gst_boxValue (void* value, OOP* dest, const char *objctype);
/* Convert from ObjC to smalltalk */
void gst_unboxValue (OOP value, void* dest, const char *objctype);
/* Send a message to an ObjC object */
void gst_sendMessage(id receiver, SEL selector, int argc, OOP args, Class superClass, char* result);
/* Make a sublcass behave as a smalltalk object. Especialy when
returning this object into smalltalk */
void gst_makeSmalltalk (Class cls);
/* Add a setter to a instance variable of an objc object */
void gst_addSetter (char * iVarName, char * setterName, Class cls, const char * typeStr);
/* Add a getter to a instance variable of an objc object */
void gst_addGetter (char * iVarName, char * getterName, Class cls, const char * typeStr);
/* Speciall getter for the hidden ivar of objective-c object that is
an instance of a subclass declare in smalltalk */
void gst_addStObjectGetter (Class cls);
/* install the hook for idle task */
void gst_installSuspendLoop ();
void gst_installEventLoop ();