mirror of
https://gitea.nishi.boats/pyrite-dev/milsko
synced 2026-01-18 15:14:09 +00:00
cocoa: move interfaces to header (guarded by ifdef __OBJC__)
This commit is contained in:
@@ -10,11 +10,67 @@
|
||||
#include <Mw/MachDep.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);
|
||||
|
||||
struct _MwLLCocoa {
|
||||
struct _MwLLCommon common;
|
||||
void* real;
|
||||
OBJC(MilskoCocoa*)
|
||||
real;
|
||||
};
|
||||
|
||||
struct _MwLLCocoaColor {
|
||||
@@ -23,7 +79,8 @@ struct _MwLLCocoaColor {
|
||||
|
||||
struct _MwLLCocoaPixmap {
|
||||
struct _MwLLCommonPixmap common;
|
||||
void* real;
|
||||
OBJC(MilskoCocoaPixmap*)
|
||||
real;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -12,14 +12,6 @@
|
||||
|
||||
#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
|
||||
|
||||
+ (MilskoCocoaPixmap*)newWithWidth:(int)width height:(int)height {
|
||||
@@ -40,49 +32,6 @@
|
||||
}
|
||||
@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
|
||||
|
||||
+ (MilskoCocoa*)newWithParent:(MwLL)parent
|
||||
|
||||
Reference in New Issue
Block a user