From 2b85bf81680e2243ef5a5daf85d9eb04321c7278 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Tue, 27 Nov 2001 17:44:08 +0000 Subject: Preliminary commit of my MacOS X work. **** THIS CODE COMPILES BUT DOES NOT WORK. **** TODO: fix event handling - getting blank windows, etc. TODO: re-port OpenGL code. TODO: add support for images with alpha. TODO: add support for more then just beeps in fl_beep(). TODO: other stuff I'm sure... git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1765 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/fl_cursor.cxx | 48 ++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 44 insertions(+), 4 deletions(-) (limited to 'src/fl_cursor.cxx') diff --git a/src/fl_cursor.cxx b/src/fl_cursor.cxx index aa7249e25..af9676cc7 100644 --- a/src/fl_cursor.cxx +++ b/src/fl_cursor.cxx @@ -1,5 +1,5 @@ // -// "$Id: fl_cursor.cxx,v 1.6.2.6 2001/01/22 15:13:40 easysw Exp $" +// "$Id: fl_cursor.cxx,v 1.6.2.6.2.1 2001/11/27 17:44:08 easysw Exp $" // // Mouse cursor support for the Fast Light Tool Kit (FLTK). // @@ -32,8 +32,8 @@ #include #include #include -#ifndef WIN32 -#include +#if !defined(WIN32) && !defined(__APPLE__) +# include #endif #include @@ -95,6 +95,46 @@ void Fl_Window::cursor(Fl_Cursor c, Fl_Color, Fl_Color) { SetCursor(i->cursor); } +#elif defined(__APPLE__) + +static Cursor crsrNS = +{ + { 0x0000, 0x0180, 0x03c0, 0x07e0, 0x0180, 0x0180, 0x0180, 0x0180, + 0x0180, 0x0180, 0x0180, 0x0180, 0x07e0, 0x03c0, 0x0180, 0x0000 }, + { 0x0180, 0x03c0, 0x07e0, 0x0ff0, 0x0ff0, 0x03c0, 0x03c0, 0x03c0, + 0x03c0, 0x03c0, 0x03c0, 0x0ff0, 0x0ff0, 0x07e0, 0x03c0, 0x0180 }, + { 8, 8 } +}, *crsrNSptr = &crsrNS; + +void Fl_Window::cursor(Fl_Cursor c, Fl_Color, Fl_Color) { + if (!shown()) return; + switch (c) { + case FL_CURSOR_CROSS: i->cursor = GetCursor( crossCursor ); break; + case FL_CURSOR_WAIT: i->cursor = GetCursor( watchCursor ); break; + case FL_CURSOR_NS: i->cursor = &crsrNSptr; break; + case FL_CURSOR_INSERT: //++ the following shapes are missing... + case FL_CURSOR_HELP: + case FL_CURSOR_HAND: + case FL_CURSOR_MOVE: + case FL_CURSOR_N: + case FL_CURSOR_S: + case FL_CURSOR_NE: + case FL_CURSOR_SW: + case FL_CURSOR_NESW: + case FL_CURSOR_E: + case FL_CURSOR_W: + case FL_CURSOR_WE: + case FL_CURSOR_SE: + case FL_CURSOR_NW: + case FL_CURSOR_NWSE: + case FL_CURSOR_ARROW: + case FL_CURSOR_DEFAULT: + default: + i->cursor = fl_default_cursor; break; + } + SetCursor( *i->cursor ); +} + #else // I like the MSWindows resize cursors, so I duplicate them here: @@ -184,5 +224,5 @@ void Fl_Window::cursor(Fl_Cursor c, Fl_Color fg, Fl_Color bg) { #endif // -// End of "$Id: fl_cursor.cxx,v 1.6.2.6 2001/01/22 15:13:40 easysw Exp $". +// End of "$Id: fl_cursor.cxx,v 1.6.2.6.2.1 2001/11/27 17:44:08 easysw Exp $". // -- cgit v1.2.3