merge
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good

This commit is contained in:
IoI_xD 2026-04-14 13:37:14 -07:00
commit 70c9d3a1f6
27 changed files with 724 additions and 1006 deletions

View file

@ -53,7 +53,7 @@ MWDECL void MwDrawRect(MwWidget handle, MwRect* rect, MwLLColor color);
* @param rect Rectangle area
* @param color Color
*/
MWDECL void MwDrawRectFading(MwWidget handle, MwRect* rect, MwLLColor color, int rounded);
MWDECL void MwDrawRectFading(MwWidget handle, MwRect* rect, MwLLColor color);
/*!
* @brief Draws a frame
@ -63,7 +63,7 @@ MWDECL void MwDrawRectFading(MwWidget handle, MwRect* rect, MwLLColor color, int
* @param invert Invert the 3D border color or not
* @warning `rect` gets changed to the area of rectangle inside
*/
MWDECL void MwDrawFrame(MwWidget handle, MwRect* rect, MwLLColor color, int invert, int rounded);
MWDECL void MwDrawFrame(MwWidget handle, MwRect* rect, MwLLColor color, int invert);
/*!
* @brief Does the DrawFrame/DrawRect combo used for drawing widget.
@ -96,7 +96,7 @@ MWDECL void MwDrawTriangle(MwWidget handle, MwRect* rect, MwLLColor color, int i
* @param rounded Rounded or not
* @warning `rect` gets changed to the area of rectangle inside
*/
MWDECL void MwDrawFrameEx(MwWidget handle, MwRect* rect, MwLLColor color, int invert, int border, int diff, int same, int rounded);
MWDECL void MwDrawFrameEx(MwWidget handle, MwRect* rect, MwLLColor color, int invert, int border, int diff, int same);
/*!
* @brief Creates a pixmap from image

View file

@ -15,12 +15,6 @@
#import <Foundation/Foundation.h>
#import <Foundation/NSGeometry.h>
#ifdef __APPLE__
#import <CoreServices/CoreServices.h>
#else
#import <CoreGraphics/CoreGraphics.h>
#endif
@interface MilskoCocoaApplication : NSApplication {
MwBool doPending;
}
@ -40,9 +34,9 @@
// Note: implements NSWindowDelegate
@interface MilskoCocoaWindowDelegate : NSObject {
MilskoCocoaWindow* w;
NSWindow* w;
}
- (MilskoCocoaWindowDelegate*)initWithWin:(MilskoCocoaWindow*)win;
- (MilskoCocoaWindowDelegate*)initWithWin:(NSWindow*)win;
@end
/*
@ -67,6 +61,7 @@
@end
@interface MilskoCocoaPixmap : NSObject {
@public
MwBool valid;
int width;
int height;
@ -86,18 +81,17 @@
@end
@interface MilskoCocoaView : NSView {
NSBitmapImageRep* rep;
NSGraphicsContext* context;
MwBool valid;
CGColorSpaceRef space;
CGDataProviderRef provider;
NSRect givenRect;
float x;
float y;
float width;
float height;
MwBool _child;
IBOutlet NSViewController* viewController;
@public
unsigned char* buf;
NSBitmapImageRep* rep;
NSGraphicsContext* context;
MwBool valid;
NSRect givenRect;
float x;
float y;
float width;
float height;
MwBool _child;
}
- (void)initRepAndContextWithWidth:(float)w Height:(float)h;
@ -105,14 +99,18 @@
- (void)destroy;
- (NSBitmapImageRep*)getRep;
- (void)setChild;
@end
@interface MilskoCocoaSubView : MilskoCocoaView {
}
@end
@interface MilskoCocoa : NSObject {
@public
MilskoCocoaApplication* application;
MwBool _forceRender;
MwBool _eventsPending;
MilskoCocoaWindow* window;
NSWindow* window;
NSRect rect;
MilskoCocoaView* view;
MwLL parent;
@ -126,55 +124,21 @@
MwBool pointerLocked;
MwBool mouseMoved;
}
+ (MilskoCocoa*)newWithParent:(MwLL)parent
x:(int)x
y:(int)y
width:(int)width
height:(int)height
handle:(MwLL)handle;
- (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;
MwBool rejectFirstTest;
}
- (void)destroy;
- (void)sendClipboardEvent;
- (MwLL)getParent;
- (NSView*)getView;
- (MilskoCocoaWindow*)getWindow;
- (NSWindow*)getWindow;
- (void)nudge;
- (void)pushCursor;
- (void)popCursor;
- (MilskoFakePointer*)getHandle;
+ (void)eventCanceller:(MilskoCocoa*)this;
@end
#define OBJC(x) x

View file

@ -57,17 +57,26 @@
#define M_PI 3.14159265
#endif
/* Windows */
#if defined(_MILSKO) && defined(_WIN32)
#define MWDECL extern __declspec(dllexport)
#elif defined(_WIN32)
#define MWDECL extern __declspec(dllimport)
/* GCC/Clang */
/* First check if we have __has_attribute and can check for the existence of visibility */
#elif defined(__has_attribute)
#if __has_attribute(visibility)
#define MWDECL extern __attribute__((visibility("default")))
#else
#define MWDECL extern
#endif
/* It might be that we're on an old version of GCC (like the one Apple ships with older versions of Mac OS).
* If we're on gcc 3 or above, assume it's there
*/
#elif __GNUC__ >= 3
#define MWDECL extern __attribute__((visibility("default")))
#else
/* all else fails */
#define MWDECL extern
#endif