BOOL isTabletEnabled;
}
- (void) resizeContentToWidth:(int)w height:(int)h displayState:(DisplayState *)ds;
+- (void) updateDataOffset:(DisplayState *)ds;
- (void) grabMouse;
- (void) ungrabMouse;
- (void) toggleFullScreen:(id)sender;
[self setFrame:NSMakeRect(cx, cy, cw, ch)];
}
+- (void) updateDataOffset:(DisplayState *)ds
+{
+ COCOA_DEBUG("QemuCocoaView: UpdateDataOffset\n");
+
+ // update screenBuffer
+ if (dataProviderRef) {
+ CGDataProviderRelease(dataProviderRef);
+ }
+
+ size_t size = ds_get_width(ds) * 4 * ds_get_height(ds);
+ dataProviderRef = CGDataProviderCreateWithData(NULL, ds_get_data(ds),
+ size, NULL);
+}
+
- (void) toggleFullScreen:(id)sender
{
COCOA_DEBUG("QemuCocoaView: toggleFullScreen\n");
vga_hw_update();
}
+static void cocoa_setdata(DisplayState *ds)
+{
+ [cocoaView updateDataOffset:ds];
+}
+
static void cocoa_cleanup(void)
{
COCOA_DEBUG("qemu_cocoa: cocoa_cleanup\n");
dcl->dpy_gfx_update = cocoa_update;
dcl->dpy_gfx_resize = cocoa_resize;
dcl->dpy_refresh = cocoa_refresh;
+ dcl->dpy_gfx_setdata = cocoa_setdata;
register_displaychangelistener(ds, dcl);