cocoa: attempted drawing

This commit is contained in:
IoIxD
2026-01-14 17:13:12 -07:00
parent a710967115
commit 04f1a94cb5
3 changed files with 144 additions and 29 deletions

View File

@@ -6,6 +6,7 @@
#ifndef __MW_LOWLEVEL_H__
#define __MW_LOWLEVEL_H__
#include "Mw/BaseTypes.h"
#include <Mw/MachDep.h>
typedef struct _MwLLHandler* MwLLHandler;
@@ -40,9 +41,9 @@ struct _MwLLCommon {
};
struct _MwLLCommonColor {
int red;
int green;
int blue;
MwU8 red;
MwU8 green;
MwU8 blue;
};
struct _MwLLCommonPixmap {

View File

@@ -11,17 +11,50 @@
#include <Mw/TypeDefs.h>
#ifdef __OBJC__
#import <Foundation/NSGeometry.h>
#import <AppKit/AppKit.h>
#import <Foundation/Foundation.h>
#ifdef __APPLE__
#import <CoreServices/CoreServices.h>
#else
#import <CoreGraphics/CoreGraphics.h>
#endif
@interface MilskoCocoaPixmap : NSObject {
int width;
int height;
NSData* data;
NSImage* image;
}
+ (MilskoCocoaPixmap*)newWithWidth:(int)width height:(int)height;
- (void)updateWithData:(void*)data;
- (void)destroy;
/* using @property to create instance variables fucks up 10.4 gcc for some reason? */
- (NSImage*)image;
@end
@interface MilskoCocoaView : NSView {
CGContextRef cg;
CGColorSpaceRef space;
CGDataProviderRef provider;
MwU32* buf;
float width;
float height;
}
- (CGContextRef)context;
@end
@interface MilskoCocoa : NSObject {
NSApplication* application;
NSWindow* window;
NSRect rect;
NSApplication* application;
NSWindow* window;
NSRect rect;
MilskoCocoaView* view;
}
+ (MilskoCocoa*)newWithParent:(MwLL)parent