Revision 477a3877 ui/cocoa.m
b/ui/cocoa.m | ||
---|---|---|
265 | 265 |
BOOL isTabletEnabled; |
266 | 266 |
} |
267 | 267 |
- (void) resizeContentToWidth:(int)w height:(int)h displayState:(DisplayState *)ds; |
268 |
- (void) updateDataOffset:(DisplayState *)ds; |
|
268 | 269 |
- (void) grabMouse; |
269 | 270 |
- (void) ungrabMouse; |
270 | 271 |
- (void) toggleFullScreen:(id)sender; |
... | ... | |
429 | 430 |
[self setFrame:NSMakeRect(cx, cy, cw, ch)]; |
430 | 431 |
} |
431 | 432 |
|
433 |
- (void) updateDataOffset:(DisplayState *)ds |
|
434 |
{ |
|
435 |
COCOA_DEBUG("QemuCocoaView: UpdateDataOffset\n"); |
|
436 |
|
|
437 |
// update screenBuffer |
|
438 |
if (dataProviderRef) { |
|
439 |
CGDataProviderRelease(dataProviderRef); |
|
440 |
} |
|
441 |
|
|
442 |
size_t size = ds_get_width(ds) * 4 * ds_get_height(ds); |
|
443 |
dataProviderRef = CGDataProviderCreateWithData(NULL, ds_get_data(ds), |
|
444 |
size, NULL); |
|
445 |
} |
|
446 |
|
|
432 | 447 |
- (void) toggleFullScreen:(id)sender |
433 | 448 |
{ |
434 | 449 |
COCOA_DEBUG("QemuCocoaView: toggleFullScreen\n"); |
... | ... | |
1004 | 1019 |
vga_hw_update(); |
1005 | 1020 |
} |
1006 | 1021 |
|
1022 |
static void cocoa_setdata(DisplayState *ds) |
|
1023 |
{ |
|
1024 |
[cocoaView updateDataOffset:ds]; |
|
1025 |
} |
|
1026 |
|
|
1007 | 1027 |
static void cocoa_cleanup(void) |
1008 | 1028 |
{ |
1009 | 1029 |
COCOA_DEBUG("qemu_cocoa: cocoa_cleanup\n"); |
... | ... | |
1020 | 1040 |
dcl->dpy_gfx_update = cocoa_update; |
1021 | 1041 |
dcl->dpy_gfx_resize = cocoa_resize; |
1022 | 1042 |
dcl->dpy_refresh = cocoa_refresh; |
1043 |
dcl->dpy_gfx_setdata = cocoa_setdata; |
|
1023 | 1044 |
|
1024 | 1045 |
register_displaychangelistener(ds, dcl); |
1025 | 1046 |
|
Also available in: Unified diff