summaryrefslogtreecommitdiff
path: root/src/Fl_cocoa.mm
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2009-12-07 19:15:37 +0000
committerMatthias Melcher <fltk@matthiasm.com>2009-12-07 19:15:37 +0000
commitb34b7a8d2bd39323caabbcfed2bb40add0660d86 (patch)
treead1d123879139787db93979962bc331eead87355 /src/Fl_cocoa.mm
parentb2cffc688ea7abbddabc9ed23deea1921f59ac9d (diff)
Some fixes for the Cocoa port
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6952 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_cocoa.mm')
-rw-r--r--src/Fl_cocoa.mm22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm
index e20b5c76d..a42ae081d 100644
--- a/src/Fl_cocoa.mm
+++ b/src/Fl_cocoa.mm
@@ -61,6 +61,13 @@ extern "C" {
#include <stdarg.h>
#import <Cocoa/Cocoa.h>
+#include <AvailabilityMacros.h>
+#if defined(__LP64__) && __LP64__
+typedef double CGFloat;
+#else
+typedef float CGFloat;
+#endif
+
#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5
typedef long NSInteger;
typedef unsigned long NSUInteger;
@@ -803,7 +810,7 @@ static void cocoaMouseHandler(NSEvent *theEvent)
// fall through
case NSLeftMouseDragged:
case NSRightMouseDragged:
- case NSOtherMouseDragged:
+ case NSOtherMouseDragged: {
if (suppressed) break;
if ( !sendEvent ) {
sendEvent = FL_MOVE; // Fl::handle will convert into FL_DRAG
@@ -817,7 +824,9 @@ static void cocoaMouseHandler(NSEvent *theEvent)
Fl::e_x = pos.x;
Fl::e_y = pos.y;
Fl::handle( sendEvent, window );
- break;
+ } break;
+ default:
+ break;
}
fl_unlock_function();
@@ -1090,7 +1099,7 @@ OSStatus cocoaKeyboardHandler(NSEvent *theEvent)
if([s length] == 0) {//this is a dead key that must be combined with the next key to be pressed
while (window->parent()) window = window->window();
Fl::e_keysym = FL_Control_R;//first simulate pressing of the compose key (FL_Control_R)
- Fl::e_text = "";
+ Fl::e_text = (char*)"";
Fl::e_length = 0;
Fl::handle(FL_KEYBOARD, window);
compose=YES;
@@ -1129,7 +1138,7 @@ OSStatus cocoaKeyboardHandler(NSEvent *theEvent)
case NSKeyDown:
sendEvent = FL_KEYBOARD;
// fall through
- case NSKeyUp:
+ case NSKeyUp: {
if ( !sendEvent ) {
sendEvent = FL_KEYUP;
Fl::e_state &= 0xbfffffff; // clear the deadkey flag
@@ -1155,7 +1164,10 @@ OSStatus cocoaKeyboardHandler(NSEvent *theEvent)
Fl::e_length = strlen(buffer);
Fl::e_text = buffer;
buffer[Fl::e_length] = 0; // just in case...
- break;
+ } break;
+ default:
+ fl_unlock_function();
+ return eventNotHandledErr;
}
while (window->parent()) window = window->window();
if (sendEvent && Fl::handle(sendEvent,window)) {