summaryrefslogtreecommitdiff
path: root/src/fl_cursor.cxx
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2001-11-27 17:44:08 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2001-11-27 17:44:08 +0000
commit2b85bf81680e2243ef5a5daf85d9eb04321c7278 (patch)
treedc7d3e1cdbd44ed10b358412098b73d24b64d143 /src/fl_cursor.cxx
parent4dc5732a3e0f376786d1d6b788e5cf601439e890 (diff)
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
Diffstat (limited to 'src/fl_cursor.cxx')
-rw-r--r--src/fl_cursor.cxx48
1 files changed, 44 insertions, 4 deletions
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 <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/x.H>
-#ifndef WIN32
-#include <X11/cursorfont.h>
+#if !defined(WIN32) && !defined(__APPLE__)
+# include <X11/cursorfont.h>
#endif
#include <FL/fl_draw.H>
@@ -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 $".
//