Compare commits
No commits in common. "bb876b96201a93c1fe6a55583ebcd79a9842b27f" and "f44a70d4ecc621897eb723eb30c848cb6235fd9d" have entirely different histories.
bb876b9620
...
f44a70d4ec
1 changed files with 73 additions and 36 deletions
|
|
@ -330,6 +330,7 @@ static void recursive_dispatch_key_released(MwLL handle, int* k) {
|
||||||
frame = localRectFlip(frame, parent->cocoa.real->view);
|
frame = localRectFlip(frame, parent->cocoa.real->view);
|
||||||
[self->view setBounds:frame];
|
[self->view setBounds:frame];
|
||||||
}
|
}
|
||||||
|
// [self->view setNeedsDisplay:true];
|
||||||
[self nudge];
|
[self nudge];
|
||||||
};
|
};
|
||||||
- (void)setW:(int)w H:(int)h {
|
- (void)setW:(int)w H:(int)h {
|
||||||
|
|
@ -359,10 +360,12 @@ static void recursive_dispatch_key_released(MwLL handle, int* k) {
|
||||||
MwLL h = [self->handle pointer];
|
MwLL h = [self->handle pointer];
|
||||||
if(_forceRender) {
|
if(_forceRender) {
|
||||||
MwLLDispatch(h, draw, NULL);
|
MwLLDispatch(h, draw, NULL);
|
||||||
|
// [self->view setNeedsDisplay:true];
|
||||||
_forceRender = MwFALSE;
|
_forceRender = MwFALSE;
|
||||||
}
|
}
|
||||||
if(_eventsPending) {
|
if(_eventsPending) {
|
||||||
MwLLDispatch(h, draw, NULL);
|
MwLLDispatch(h, draw, NULL);
|
||||||
|
// [self->view setNeedsDisplay:true];
|
||||||
_eventsPending = MwFALSE;
|
_eventsPending = MwFALSE;
|
||||||
}
|
}
|
||||||
[self sendClipboardEvent];
|
[self sendClipboardEvent];
|
||||||
|
|
@ -440,6 +443,18 @@ static void recursive_dispatch_key_released(MwLL handle, int* k) {
|
||||||
};
|
};
|
||||||
- (void)forceRender {
|
- (void)forceRender {
|
||||||
self->_forceRender = MwTRUE;
|
self->_forceRender = MwTRUE;
|
||||||
|
// NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||||
|
// NSEvent *event = [NSEvent otherEventWithType:NSApplicationDefined
|
||||||
|
// location:NSMakePoint(0, 0)
|
||||||
|
// modifierFlags:0
|
||||||
|
// timestamp:0
|
||||||
|
// windowNumber:0
|
||||||
|
// context:nil
|
||||||
|
// subtype:0
|
||||||
|
// data1:0
|
||||||
|
// data2:0];
|
||||||
|
// [NSApp postEvent:event atStart:YES];
|
||||||
|
// [pool release];
|
||||||
};
|
};
|
||||||
- (void)setCursor:(MwCursor*)image mask:(MwCursor*)mask {
|
- (void)setCursor:(MwCursor*)image mask:(MwCursor*)mask {
|
||||||
int y, x, ys, xs;
|
int y, x, ys, xs;
|
||||||
|
|
@ -654,19 +669,17 @@ static void recursive_dispatch_key_released(MwLL handle, int* k) {
|
||||||
NSArray* subviews = [self subviews];
|
NSArray* subviews = [self subviews];
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if(self->width != dirtyRect.size.width || self->height != dirtyRect.size.height) {
|
if(self->rep) {
|
||||||
if(self->rep) {
|
[self->rep release];
|
||||||
[self->rep release];
|
}
|
||||||
}
|
if(dirtyRect.size.width && dirtyRect.size.height) {
|
||||||
if(dirtyRect.size.width && dirtyRect.size.height) {
|
[self initRepAndContextWithWidth:dirtyRect.size.width
|
||||||
[self initRepAndContextWithWidth:dirtyRect.size.width
|
Height:dirtyRect.size.height];
|
||||||
Height:dirtyRect.size.height];
|
self->width = dirtyRect.size.width;
|
||||||
self->width = dirtyRect.size.width;
|
self->height = dirtyRect.size.height;
|
||||||
self->height = dirtyRect.size.height;
|
} else {
|
||||||
} else {
|
[pool release];
|
||||||
[pool release];
|
return;
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[self->rep drawInRect:[self bounds]];
|
[self->rep drawInRect:[self bounds]];
|
||||||
|
|
@ -980,6 +993,7 @@ static void recursive_dispatch_key_released(MwLL handle, int* k) {
|
||||||
if([ptr isKindOfClass:[MilskoFakePointer class]]) {
|
if([ptr isKindOfClass:[MilskoFakePointer class]]) {
|
||||||
MwLL h = [(MilskoFakePointer*)ptr pointer];
|
MwLL h = [(MilskoFakePointer*)ptr pointer];
|
||||||
MwLLDispatch(h, resize, NULL);
|
MwLLDispatch(h, resize, NULL);
|
||||||
|
// MwLLDispatch(h, draw, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return frameSize;
|
return frameSize;
|
||||||
|
|
@ -1104,15 +1118,18 @@ static void MwLLColorUpdateImpl(MwLL handle, MwLLColor c, int r, int g, int b) {
|
||||||
|
|
||||||
static void MwLLGetXYWHImpl(MwLL handle, int* x, int* y, unsigned int* w,
|
static void MwLLGetXYWHImpl(MwLL handle, int* x, int* y, unsigned int* w,
|
||||||
unsigned int* height) {
|
unsigned int* height) {
|
||||||
[handle->cocoa.real getX:x Y:y W:w H:height];
|
MilskoCocoa* h = handle->cocoa.real;
|
||||||
|
[h getX:x Y:y W:w H:height];
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MwLLSetXYImpl(MwLL handle, int x, int y) {
|
static void MwLLSetXYImpl(MwLL handle, int x, int y) {
|
||||||
[handle->cocoa.real setX:x Y:y];
|
MilskoCocoa* h = handle->cocoa.real;
|
||||||
|
[h setX:x Y:y];
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MwLLSetWHImpl(MwLL handle, int w, int height) {
|
static void MwLLSetWHImpl(MwLL handle, int w, int height) {
|
||||||
[handle->cocoa.real setW:w H:height];
|
MilskoCocoa* h = handle->cocoa.real;
|
||||||
|
[h setW:w H:height];
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MwLLFreeColorImpl(MwLLColor color) {
|
static void MwLLFreeColorImpl(MwLLColor color) {
|
||||||
|
|
@ -1124,11 +1141,13 @@ static int MwLLPendingImpl(MwLL handle) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MwLLNextEventImpl(MwLL handle) {
|
static void MwLLNextEventImpl(MwLL handle) {
|
||||||
[handle->cocoa.real getNextEvent];
|
MilskoCocoa* h = handle->cocoa.real;
|
||||||
|
[h getNextEvent];
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MwLLSetTitleImpl(MwLL handle, const char* title) {
|
static void MwLLSetTitleImpl(MwLL handle, const char* title) {
|
||||||
[handle->cocoa.real setTitle:title];
|
MilskoCocoa* h = handle->cocoa.real;
|
||||||
|
[h setTitle:title];
|
||||||
}
|
}
|
||||||
|
|
||||||
static MwLLPixmap MwLLCreatePixmapImpl(MwLL handle, unsigned char* data,
|
static MwLLPixmap MwLLCreatePixmapImpl(MwLL handle, unsigned char* data,
|
||||||
|
|
@ -1151,63 +1170,77 @@ static MwLLPixmap MwLLCreatePixmapImpl(MwLL handle, unsigned char* data,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MwLLPixmapUpdateImpl(MwLLPixmap pixmap) {
|
static void MwLLPixmapUpdateImpl(MwLLPixmap pixmap) {
|
||||||
[pixmap->cocoa.real updateWithData:pixmap->common.raw];
|
MilskoCocoaPixmap* p = pixmap->cocoa.real;
|
||||||
|
[p updateWithData:pixmap->common.raw];
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MwLLDestroyPixmapImpl(MwLLPixmap pixmap) {
|
static void MwLLDestroyPixmapImpl(MwLLPixmap pixmap) {
|
||||||
[pixmap->cocoa.real destroy];
|
MilskoCocoaPixmap* p = pixmap->cocoa.real;
|
||||||
[pixmap->cocoa.real release];
|
[p destroy];
|
||||||
|
[p release];
|
||||||
free(pixmap);
|
free(pixmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MwLLDrawPixmapImpl(MwLL handle, MwRect* rect, MwLLPixmap pixmap) {
|
static void MwLLDrawPixmapImpl(MwLL handle, MwRect* rect, MwLLPixmap pixmap) {
|
||||||
[handle->cocoa.real drawPixmap:pixmap rect:rect];
|
MilskoCocoa* h = handle->cocoa.real;
|
||||||
|
[h drawPixmap:pixmap rect:rect];
|
||||||
MwLLForceRender(handle);
|
MwLLForceRender(handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MwLLSetIconImpl(MwLL handle, MwLLPixmap pixmap) {
|
static void MwLLSetIconImpl(MwLL handle, MwLLPixmap pixmap) {
|
||||||
[handle->cocoa.real setIcon:pixmap];
|
MilskoCocoa* h = handle->cocoa.real;
|
||||||
|
[h setIcon:pixmap];
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MwLLForceRenderImpl(MwLL handle) {
|
static void MwLLForceRenderImpl(MwLL handle) {
|
||||||
[handle->cocoa.real forceRender];
|
MilskoCocoa* h = handle->cocoa.real;
|
||||||
|
[h forceRender];
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MwLLSetCursorImpl(MwLL handle, MwCursor* image, MwCursor* mask) {
|
static void MwLLSetCursorImpl(MwLL handle, MwCursor* image, MwCursor* mask) {
|
||||||
[handle->cocoa.real setCursor:image mask:mask];
|
MilskoCocoa* h = handle->cocoa.real;
|
||||||
|
[h setCursor:image mask:mask];
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MwLLDetachImpl(MwLL handle, MwPoint* point) {
|
static void MwLLDetachImpl(MwLL handle, MwPoint* point) {
|
||||||
[handle->cocoa.real detachWithPoint:point];
|
MilskoCocoa* h = handle->cocoa.real;
|
||||||
|
[h detachWithPoint:point];
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MwLLShowImpl(MwLL handle, int show) {
|
static void MwLLShowImpl(MwLL handle, int show) {
|
||||||
[handle->cocoa.real show:show];
|
MilskoCocoa* h = handle->cocoa.real;
|
||||||
|
[h show:show];
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MwLLMakePopupImpl(MwLL handle, MwLL parent) {
|
static void MwLLMakePopupImpl(MwLL handle, MwLL parent) {
|
||||||
[handle->cocoa.real makePopupWithParent:parent];
|
MilskoCocoa* h = handle->cocoa.real;
|
||||||
|
[h makePopupWithParent:parent];
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MwLLSetSizeHintsImpl(MwLL handle, int minx, int miny, int maxx,
|
static void MwLLSetSizeHintsImpl(MwLL handle, int minx, int miny, int maxx,
|
||||||
int maxy) {
|
int maxy) {
|
||||||
[handle->cocoa.real setSizeHintsWithMinX:minx MinY:miny MaxX:maxx MaxY:maxy];
|
MilskoCocoa* h = handle->cocoa.real;
|
||||||
|
[h setSizeHintsWithMinX:minx MinY:miny MaxX:maxx MaxY:maxy];
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MwLLMakeBorderlessImpl(MwLL handle, int toggle) {
|
static void MwLLMakeBorderlessImpl(MwLL handle, int toggle) {
|
||||||
[handle->cocoa.real makeBorderless:toggle];
|
MilskoCocoa* h = handle->cocoa.real;
|
||||||
|
[h makeBorderless:toggle];
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MwLLFocusImpl(MwLL handle) {
|
static void MwLLFocusImpl(MwLL handle) {
|
||||||
[handle->cocoa.real focus];
|
MilskoCocoa* h = handle->cocoa.real;
|
||||||
|
[h focus];
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MwLLGrabPointerImpl(MwLL handle, int toggle) {
|
static void MwLLGrabPointerImpl(MwLL handle, int toggle) {
|
||||||
[handle->cocoa.real grabPointer:toggle];
|
MilskoCocoa* h = handle->cocoa.real;
|
||||||
|
[h grabPointer:toggle];
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MwLLSetClipboardImpl(MwLL handle, const char* text) {
|
static void MwLLSetClipboardImpl(MwLL handle, const char* text) {
|
||||||
[handle->cocoa.real setClipboard:text];
|
MilskoCocoa* h = handle->cocoa.real;
|
||||||
|
[h setClipboard:text];
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MwLLGetClipboardImpl(MwLL handle) {
|
static void MwLLGetClipboardImpl(MwLL handle) {
|
||||||
|
|
@ -1215,15 +1248,19 @@ static void MwLLGetClipboardImpl(MwLL handle) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MwLLMakeToolWindowImpl(MwLL handle) {
|
static void MwLLMakeToolWindowImpl(MwLL handle) {
|
||||||
[handle->cocoa.real makeToolWindow];
|
|
||||||
|
MilskoCocoa* h = handle->cocoa.real;
|
||||||
|
[h makeToolWindow];
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MwLLGetCursorCoordImpl(MwLL handle, MwPoint* point) {
|
static void MwLLGetCursorCoordImpl(MwLL handle, MwPoint* point) {
|
||||||
[handle->cocoa.real getCursorCoord:point];
|
MilskoCocoa* h = handle->cocoa.real;
|
||||||
|
[h getCursorCoord:point];
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MwLLGetScreenSizeImpl(MwLL handle, MwRect* rect) {
|
static void MwLLGetScreenSizeImpl(MwLL handle, MwRect* rect) {
|
||||||
[handle->cocoa.real getScreenSize:rect];
|
MilskoCocoa* h = handle->cocoa.real;
|
||||||
|
[h getScreenSize:rect];
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MwLLBeginStateChangeImpl(MwLL handle) {
|
static void MwLLBeginStateChangeImpl(MwLL handle) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue