summaryrefslogtreecommitdiff
path: root/src/video/cocoa/wnd_quickdraw.mm
diff options
context:
space:
mode:
Diffstat (limited to 'src/video/cocoa/wnd_quickdraw.mm')
-rw-r--r--src/video/cocoa/wnd_quickdraw.mm40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/video/cocoa/wnd_quickdraw.mm b/src/video/cocoa/wnd_quickdraw.mm
index abf38599f..15c15fabb 100644
--- a/src/video/cocoa/wnd_quickdraw.mm
+++ b/src/video/cocoa/wnd_quickdraw.mm
@@ -86,7 +86,7 @@ class WindowQuickdrawSubdriver: public CocoaSubdriver {
void *pixel_buffer;
void *window_buffer;
- OTTD_QuickdrawWindow *window;
+ id window;
#define MAX_DIRTY_RECTS 100
Rect dirty_rects[MAX_DIRTY_RECTS];
@@ -98,7 +98,7 @@ public:
bool active;
bool setup;
- NSQuickDrawView *qdview;
+ id cocoaview;
private:
void GetDeviceInfo();
@@ -203,7 +203,7 @@ public:
driver->SetPortAlphaOpaque();
/* save current visible surface */
- [ self cacheImageInRect:[ driver->qdview frame ] ];
+ [ self cacheImageInRect:[ driver->cocoaview frame ] ];
/* let the window manager redraw controls, border, etc */
[ super display ];
@@ -236,7 +236,7 @@ public:
driver->SetPortAlphaOpaque ();
/* save current visible surface */
- [ self cacheImageInRect:[ driver->qdview frame ] ];
+ [ self cacheImageInRect:[ driver->cocoaview frame ] ];
}
- (void)appDidUnhide:(NSNotification*)note
@@ -399,7 +399,7 @@ bool WindowQuickdrawSubdriver::SetVideoMode(int width, int height)
* The height of title bar of the window is 22 pixels */
contentRect.size.height = Clamp(height, 0, [ this->window frame ].size.height - 22);
height = contentRect.size.height;
- [ this->qdview setFrameSize:contentRect.size ];
+ [ this->cocoaview setFrameSize:contentRect.size ];
}
/* Update again */
@@ -409,17 +409,17 @@ bool WindowQuickdrawSubdriver::SetVideoMode(int width, int height)
[ this->window center ];
/* Only recreate the view if it doesn't already exist */
- if (this->qdview == nil) {
- this->qdview = [ [ NSQuickDrawView alloc ] initWithFrame:contentRect ];
- if (this->qdview == nil) {
+ if (this->cocoaview == nil) {
+ this->cocoaview = [ [ NSQuickDrawView alloc ] initWithFrame:contentRect ];
+ if (this->cocoaview == nil) {
DEBUG(driver, 0, "Could not create the Quickdraw view.");
this->setup = false;
return false;
}
- [ this->qdview setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable ];
- [ [ this->window contentView ] addSubview:this->qdview ];
- [ this->qdview release ];
+ [ this->cocoaview setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable ];
+ [ [ this->window contentView ] addSubview:this->cocoaview ];
+ [ this->cocoaview release ];
[ this->window makeKeyAndOrderFront:nil ];
}
@@ -533,7 +533,7 @@ WindowQuickdrawSubdriver::WindowQuickdrawSubdriver(int bpp)
this->setup = false;
this->window = nil;
- this->qdview = nil;
+ this->cocoaview = nil;
this->num_dirty_rects = MAX_DIRTY_RECTS;
}
@@ -579,7 +579,7 @@ void WindowQuickdrawSubdriver::Draw(bool force_update)
this->DrawResizeIcon();
/* Flush the dirty region */
- QDFlushPortBuffer( (OpaqueGrafPtr*) [ this->qdview qdPort ], dirty);
+ QDFlushPortBuffer( (OpaqueGrafPtr*) [ this->cocoaview qdPort ], dirty);
DisposeRgn(dirty);
DisposeRgn(temp);
@@ -645,7 +645,7 @@ bool WindowQuickdrawSubdriver::ChangeResolution(int w, int h)
/* Convert local coordinate to window server (CoreGraphics) coordinate */
CGPoint WindowQuickdrawSubdriver::PrivateLocalToCG(NSPoint *p)
{
- *p = [ this->qdview convertPoint:*p toView: nil ];
+ *p = [ this->cocoaview convertPoint:*p toView: nil ];
*p = [ this->window convertBaseToScreen:*p ];
p->y = this->device_height - p->y;
@@ -655,14 +655,14 @@ CGPoint WindowQuickdrawSubdriver::PrivateLocalToCG(NSPoint *p)
NSPoint WindowQuickdrawSubdriver::GetMouseLocation(NSEvent *event)
{
NSPoint pt = [ event locationInWindow ];
- pt = [ this->qdview convertPoint:pt fromView:nil ];
+ pt = [ this->cocoaview convertPoint:pt fromView:nil ];
return pt;
}
bool WindowQuickdrawSubdriver::MouseIsInsideView(NSPoint *pt)
{
- return [ this->qdview mouse:*pt inRect:[ this->qdview bounds ] ];
+ return [ this->cocoaview mouse:*pt inRect:[ this->cocoaview bounds ] ];
}
@@ -685,10 +685,10 @@ void WindowQuickdrawSubdriver::SetPortAlphaOpaque()
bool WindowQuickdrawSubdriver::WindowResized()
{
- if (this->window == nil || this->qdview == nil) return true;
+ if (this->window == nil || this->cocoaview == nil) return true;
- NSRect newframe = [ this->qdview frame ];
- CGrafPtr thePort = (OpaqueGrafPtr*) [ this->qdview qdPort ];
+ NSRect newframe = [ this->cocoaview frame ];
+ CGrafPtr thePort = (OpaqueGrafPtr*) [ this->cocoaview qdPort ];
LockPortBits(thePort);
this->window_buffer = GetPixBaseAddr(GetPortPixMap(thePort));
@@ -699,7 +699,7 @@ bool WindowQuickdrawSubdriver::WindowResized()
* We want it to point to the *view's* pixels
*/
int voff = [ this->window frame ].size.height - newframe.size.height - newframe.origin.y;
- int hoff = [ this->qdview frame ].origin.x;
+ int hoff = [ this->cocoaview frame ].origin.x;
this->window_buffer = (uint8*)this->window_buffer + (voff * this->window_pitch) + hoff * (this->device_depth / 8);
this->window_width = newframe.size.width;