forked from pyrite-dev/milsko
cocoa: move interfaces to header (guarded by ifdef __OBJC__)
This commit is contained in:
parent
e2f34df4e3
commit
a710967115
2 changed files with 59 additions and 53 deletions
|
|
@ -10,11 +10,67 @@
|
||||||
#include <Mw/MachDep.h>
|
#include <Mw/MachDep.h>
|
||||||
#include <Mw/TypeDefs.h>
|
#include <Mw/TypeDefs.h>
|
||||||
|
|
||||||
|
#ifdef __OBJC__
|
||||||
|
@interface MilskoCocoaPixmap : NSObject {
|
||||||
|
NSImage* image;
|
||||||
|
}
|
||||||
|
+ (MilskoCocoaPixmap*)newWithWidth:(int)width height:(int)height;
|
||||||
|
- (void)updateWithData:(void*)data;
|
||||||
|
- (void)destroy;
|
||||||
|
@end
|
||||||
|
@interface MilskoCocoa : NSObject {
|
||||||
|
NSApplication* application;
|
||||||
|
NSWindow* window;
|
||||||
|
NSRect rect;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ (MilskoCocoa*)newWithParent:(MwLL)parent
|
||||||
|
x:(int)x
|
||||||
|
y:(int)y
|
||||||
|
width:(int)width
|
||||||
|
height:(int)height;
|
||||||
|
- (void)polygonWithPoints:(MwPoint*)points
|
||||||
|
points_count:(int)points_count
|
||||||
|
color:(MwLLColor)color;
|
||||||
|
- (void)lineWithPoints:(MwPoint*)points color:(MwLLColor)color;
|
||||||
|
- (void)getX:(int*)x Y:(int*)y W:(unsigned int*)w H:(unsigned int*)h;
|
||||||
|
- (void)setX:(int)x Y:(int)y;
|
||||||
|
- (void)setW:(int)w H:(int)h;
|
||||||
|
- (int)pending;
|
||||||
|
- (void)getNextEvent;
|
||||||
|
- (void)setTitle:(const char*)title;
|
||||||
|
- (void)drawPixmap:(MwLLPixmap)pixmap rect:(MwRect*)rect;
|
||||||
|
- (void)setIcon:(MwLLPixmap)pixmap;
|
||||||
|
- (void)forceRender;
|
||||||
|
- (void)setCursor:(MwCursor*)image mask:(MwCursor*)mask;
|
||||||
|
- (void)detachWithPoint:(MwPoint*)point;
|
||||||
|
- (void)show:(int)show;
|
||||||
|
- (void)makePopupWithParent:(MwLL)parent;
|
||||||
|
- (void)setSizeHintsWithMinX:(int)minx
|
||||||
|
MinY:(int)miny
|
||||||
|
MaxX:(int)maxx
|
||||||
|
MaxY:(int)maxy;
|
||||||
|
- (void)makeBorderless:(int)toggle;
|
||||||
|
- (void)focus;
|
||||||
|
- (void)grabPointer:(int)toggle;
|
||||||
|
- (void)setClipboard:(const char*)text;
|
||||||
|
- (void)makeToolWindow;
|
||||||
|
- (void)getCursorCoord:(MwPoint*)point;
|
||||||
|
- (void)getScreenSize:(MwRect*)rect;
|
||||||
|
- (void)destroy;
|
||||||
|
|
||||||
|
@end
|
||||||
|
#define OBJC(x) x
|
||||||
|
#else
|
||||||
|
#define OBJC(x) void*
|
||||||
|
#endif
|
||||||
|
|
||||||
MWDECL int MwLLCocoaCallInit(void);
|
MWDECL int MwLLCocoaCallInit(void);
|
||||||
|
|
||||||
struct _MwLLCocoa {
|
struct _MwLLCocoa {
|
||||||
struct _MwLLCommon common;
|
struct _MwLLCommon common;
|
||||||
void* real;
|
OBJC(MilskoCocoa*)
|
||||||
|
real;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _MwLLCocoaColor {
|
struct _MwLLCocoaColor {
|
||||||
|
|
@ -23,7 +79,8 @@ struct _MwLLCocoaColor {
|
||||||
|
|
||||||
struct _MwLLCocoaPixmap {
|
struct _MwLLCocoaPixmap {
|
||||||
struct _MwLLCommonPixmap common;
|
struct _MwLLCommonPixmap common;
|
||||||
void* real;
|
OBJC(MilskoCocoaPixmap*)
|
||||||
|
real;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -12,14 +12,6 @@
|
||||||
|
|
||||||
#include "../../external/stb_ds.h"
|
#include "../../external/stb_ds.h"
|
||||||
|
|
||||||
@interface MilskoCocoaPixmap : NSObject {
|
|
||||||
NSImage* image;
|
|
||||||
}
|
|
||||||
+ (MilskoCocoaPixmap*)newWithWidth:(int)width height:(int)height;
|
|
||||||
- (void)updateWithData:(void*)data;
|
|
||||||
- (void)destroy;
|
|
||||||
@end
|
|
||||||
|
|
||||||
@implementation MilskoCocoaPixmap
|
@implementation MilskoCocoaPixmap
|
||||||
|
|
||||||
+ (MilskoCocoaPixmap*)newWithWidth:(int)width height:(int)height {
|
+ (MilskoCocoaPixmap*)newWithWidth:(int)width height:(int)height {
|
||||||
|
|
@ -40,49 +32,6 @@
|
||||||
}
|
}
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface MilskoCocoa : NSObject {
|
|
||||||
NSApplication* application;
|
|
||||||
NSWindow* window;
|
|
||||||
NSRect rect;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (MilskoCocoa*)newWithParent:(MwLL)parent
|
|
||||||
x:(int)x
|
|
||||||
y:(int)y
|
|
||||||
width:(int)width
|
|
||||||
height:(int)height;
|
|
||||||
- (void)polygonWithPoints:(MwPoint*)points
|
|
||||||
points_count:(int)points_count
|
|
||||||
color:(MwLLColor)color;
|
|
||||||
- (void)lineWithPoints:(MwPoint*)points color:(MwLLColor)color;
|
|
||||||
- (void)getX:(int*)x Y:(int*)y W:(unsigned int*)w H:(unsigned int*)h;
|
|
||||||
- (void)setX:(int)x Y:(int)y;
|
|
||||||
- (void)setW:(int)w H:(int)h;
|
|
||||||
- (int)pending;
|
|
||||||
- (void)getNextEvent;
|
|
||||||
- (void)setTitle:(const char*)title;
|
|
||||||
- (void)drawPixmap:(MwLLPixmap)pixmap rect:(MwRect*)rect;
|
|
||||||
- (void)setIcon:(MwLLPixmap)pixmap;
|
|
||||||
- (void)forceRender;
|
|
||||||
- (void)setCursor:(MwCursor*)image mask:(MwCursor*)mask;
|
|
||||||
- (void)detachWithPoint:(MwPoint*)point;
|
|
||||||
- (void)show:(int)show;
|
|
||||||
- (void)makePopupWithParent:(MwLL)parent;
|
|
||||||
- (void)setSizeHintsWithMinX:(int)minx
|
|
||||||
MinY:(int)miny
|
|
||||||
MaxX:(int)maxx
|
|
||||||
MaxY:(int)maxy;
|
|
||||||
- (void)makeBorderless:(int)toggle;
|
|
||||||
- (void)focus;
|
|
||||||
- (void)grabPointer:(int)toggle;
|
|
||||||
- (void)setClipboard:(const char*)text;
|
|
||||||
- (void)makeToolWindow;
|
|
||||||
- (void)getCursorCoord:(MwPoint*)point;
|
|
||||||
- (void)getScreenSize:(MwRect*)rect;
|
|
||||||
- (void)destroy;
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
@implementation MilskoCocoa
|
@implementation MilskoCocoa
|
||||||
|
|
||||||
+ (MilskoCocoa*)newWithParent:(MwLL)parent
|
+ (MilskoCocoa*)newWithParent:(MwLL)parent
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue