src/video/uikit/SDL_uikitview.h
author jimtla
Sat, 31 Jul 2010 01:24:50 +0400
changeset 4677 31607094315c
parent 4676 99b4560b7aa1
child 5133 b915b3181cc2
permissions -rw-r--r--
Added Iphone project. Iphone multi-touch is now functional.
     1 /*
     2     SDL - Simple DirectMedia Layer
     3     Copyright (C) 1997-2010 Sam Lantinga
     4 
     5     This library is free software; you can redistribute it and/or
     6     modify it under the terms of the GNU Lesser General Public
     7     License as published by the Free Software Foundation; either
     8     version 2.1 of the License, or (at your option) any later version.
     9 
    10     This library is distributed in the hope that it will be useful,
    11     but WITHOUT ANY WARRANTY; without even the implied warranty of
    12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    13     Lesser General Public License for more details.
    14 
    15     You should have received a copy of the GNU Lesser General Public
    16     License along with this library; if not, write to the Free Software    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    17 
    18     Sam Lantinga
    19     slouken@libsdl.org
    20 */
    21 
    22 #import <UIKit/UIKit.h>
    23 #include "SDL_stdinc.h"
    24 #include "SDL_events.h"
    25 
    26 #define IPHONE_TOUCH_EFFICIENT_DANGEROUS
    27 #define FIXED_MULTITOUCH
    28 
    29 #ifndef IPHONE_TOUCH_EFFICIENT_DANGEROUS
    30 #define MAX_SIMULTANEOUS_TOUCHES 5
    31 #endif
    32 
    33 /* *INDENT-OFF* */
    34 #if SDL_IPHONE_KEYBOARD
    35 @interface SDL_uikitview : UIView<UITextFieldDelegate> {
    36 #else
    37 @interface SDL_uikitview : UIView {
    38 #endif
    39 
    40 #ifdef FIXED_MULTITOUCH
    41 	long touchId;
    42 #ifndef IPHONE_TOUCH_EFFICIENT_DANGEROUS
    43 	UITouch *finger[MAX_SIMULTANEOUS_TOUCHES];
    44 #endif
    45 #endif
    46 
    47 #if SDL_IPHONE_KEYBOARD
    48 	UITextField *textField;
    49 	BOOL keyboardVisible;
    50 #endif	
    51 	
    52 }
    53 - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event;
    54 - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event;
    55 - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event;
    56 
    57 #if SDL_IPHONE_KEYBOARD
    58 - (void)showKeyboard;
    59 - (void)hideKeyboard;
    60 - (void)initializeKeyboard;
    61 @property (readonly) BOOL keyboardVisible;
    62 #endif 
    63 
    64 @end
    65 /* *INDENT-ON* */