summaryrefslogtreecommitdiff
path: root/src/Fl_cocoa.mm
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2016-04-18 14:31:07 +0000
committerManolo Gouy <Manolo>2016-04-18 14:31:07 +0000
commit0629b40afd8fc49ef2d9db898d190e3a1a508d8d (patch)
treed339e4c02fa7a222446dc441398966a7ab07c05c /src/Fl_cocoa.mm
parent516d0e5f9ca1850ad76c81c10c5e3c415f21c5cd (diff)
Move set_cursor() member functions from class Fl_X to classes Fl_Window_Driver and derived.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11652 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_cocoa.mm')
-rw-r--r--src/Fl_cocoa.mm20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm
index eebd07da1..0e1b44e98 100644
--- a/src/Fl_cocoa.mm
+++ b/src/Fl_cocoa.mm
@@ -2318,8 +2318,8 @@ static FLTextInputContext* fltextinputcontext_instance = nil;
if (!i) return; // fix for STR #3128
// We have to have at least one cursor rect for invalidateCursorRectsForView
// to work, hence the "else" clause.
- if (i->cursor)
- [self addCursorRect:[self visibleRect] cursor:(NSCursor*)i->cursor];
+ if (((Fl_Cocoa_Window_Driver*)w->driver())->cursor)
+ [self addCursorRect:[self visibleRect] cursor:((Fl_Cocoa_Window_Driver*)w->driver())->cursor];
else
[self addCursorRect:[self visibleRect] cursor:[NSCursor arrowCursor]];
}
@@ -2947,7 +2947,6 @@ void Fl_X::make(Fl_Window* w)
x->other_xid = 0; // room for doublebuffering image map. On OS X this is only used by overlay windows
x->region = 0;
x->subRect(0);
- x->cursor = NULL;
((Fl_Cocoa_Window_Driver*)w->pWindowDriver)->gc = 0;
x->mapped_to_retina(false);
x->changed_resolution(false);
@@ -3519,10 +3518,9 @@ void Fl_Cocoa_Window_Driver::map() {
// after a subwindow has been unmapped, it has lost its parent window and its frame may be wrong
[xid setSubwindowFrame];
}
- Fl_X *i = Fl_X::i(pWindow);
- if (i->cursor) {
- [(NSCursor*)i->cursor release];
- i->cursor = NULL;
+ if (cursor) {
+ [cursor release];
+ cursor = NULL;
}
}
@@ -3571,7 +3569,7 @@ static NSImage *CGBitmapContextToNSImage(CGContextRef c)
return [image autorelease];
}
-int Fl_X::set_cursor(Fl_Cursor c)
+int Fl_Cocoa_Window_Driver::set_cursor(Fl_Cursor c)
{
if (cursor) {
[(NSCursor*)cursor release];
@@ -3596,12 +3594,12 @@ int Fl_X::set_cursor(Fl_Cursor c)
[(NSCursor*)cursor retain];
- [(NSWindow*)xid invalidateCursorRectsForView:[(NSWindow*)xid contentView]];
+ [(NSWindow*)fl_xid(pWindow) invalidateCursorRectsForView:[(NSWindow*)fl_xid(pWindow) contentView]];
return 1;
}
-int Fl_X::set_cursor(const Fl_RGB_Image *image, int hotx, int hoty) {
+int Fl_Cocoa_Window_Driver::set_cursor(const Fl_RGB_Image *image, int hotx, int hoty) {
if (cursor) {
[(NSCursor*)cursor release];
cursor = NULL;
@@ -3665,7 +3663,7 @@ int Fl_X::set_cursor(const Fl_RGB_Image *image, int hotx, int hoty) {
initWithImage:nsimage
hotSpot:NSMakePoint(hotx, hoty)];
- [(NSWindow*)xid invalidateCursorRectsForView:[(NSWindow*)xid contentView]];
+ [(NSWindow*)fl_xid(pWindow) invalidateCursorRectsForView:[(NSWindow*)fl_xid(pWindow) contentView]];
[bitmap release];
[nsimage release];