src/video/uikit/SDL_uikitview.h
author Holmes Futrell <hfutrell@umail.ucsb.edu>
Wed, 13 Aug 2008 23:14:36 +0000
branchgsoc2008_iphone
changeset 2419 ab89ff6e97af
parent 2409 8cd70487d040
child 2425 491958a6c881
permissions -rw-r--r--
Originally keyboard support was in the form of a category of the class SDL_uikitview. It turns out this can cause problems with compilation where the code is not actually included and doesn't fail until dynamic dispatch. This is just awful, so I've moved to the code into the SDL_uikitview class itself.
hfutrell@2409
     1
/*
hfutrell@2409
     2
 SDL - Simple DirectMedia Layer
hfutrell@2409
     3
 Copyright (C) 1997-2006 Sam Lantinga
hfutrell@2409
     4
 
hfutrell@2409
     5
 This library is free software; you can redistribute it and/or
hfutrell@2409
     6
 modify it under the terms of the GNU Lesser General Public
hfutrell@2409
     7
 License as published by the Free Software Foundation; either
hfutrell@2409
     8
 version 2.1 of the License, or (at your option) any later version.
hfutrell@2409
     9
 
hfutrell@2409
    10
 This library is distributed in the hope that it will be useful,
hfutrell@2409
    11
 but WITHOUT ANY WARRANTY; without even the implied warranty of
hfutrell@2409
    12
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
hfutrell@2409
    13
 Lesser General Public License for more details.
hfutrell@2409
    14
 
hfutrell@2409
    15
 You should have received a copy of the GNU Lesser General Public
hfutrell@2409
    16
 License along with this library; if not, write to the Free Software
hfutrell@2409
    17
 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
hfutrell@2409
    18
 
hfutrell@2409
    19
 Sam Lantinga
hfutrell@2409
    20
 slouken@libsdl.org
hfutrell@2409
    21
 */
hfutrell@2409
    22
hfutrell@2409
    23
#import <UIKit/UIKit.h>
hfutrell@2409
    24
#include "SDL_stdinc.h"
hfutrell@2409
    25
#include "SDL_mouse.h"
hfutrell@2409
    26
#include "SDL_mouse_c.h"
hfutrell@2409
    27
#include "SDL_events.h"
hfutrell@2409
    28
hfutrell@2409
    29
#define MAX_SIMULTANEOUS_TOUCHES 5
hfutrell@2409
    30
hfutrell@2409
    31
@interface SDL_uikitview : UIView<UITextFieldDelegate> {
hfutrell@2409
    32
		
hfutrell@2409
    33
	SDL_Mouse mice[MAX_SIMULTANEOUS_TOUCHES];
hfutrell@2409
    34
hfutrell@2409
    35
#if SDL_IPHONE_KEYBOARD
hfutrell@2409
    36
	UITextField *textField;
hfutrell@2409
    37
	BOOL keyboardVisible;
hfutrell@2409
    38
#endif	
hfutrell@2409
    39
	
hfutrell@2409
    40
}
hfutrell@2409
    41
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event;
hfutrell@2409
    42
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event;
hfutrell@2409
    43
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event;
hfutrell@2409
    44
hfutrell@2419
    45
#if SDL_IPHONE_KEYBOARD
hfutrell@2419
    46
- (void)showKeyboard;
hfutrell@2419
    47
- (void)hideKeyboard;
hfutrell@2419
    48
- (void)initializeKeyboard;
hfutrell@2419
    49
@property (readonly) BOOL keyboardVisible;
hfutrell@2419
    50
#endif 
hfutrell@2419
    51
hfutrell@2409
    52
@end
hfutrell@2419
    53
hfutrell@2419
    54
#if SDL_IPHONE_KEYBOARD
hfutrell@2419
    55
extern DECLSPEC int SDLCALL SDL_iPhoneKeyboardShow(SDL_WindowID windowID);
hfutrell@2419
    56
extern DECLSPEC int SDLCALL SDL_iPhoneKeyboardHide(SDL_WindowID windowID);
hfutrell@2419
    57
extern DECLSPEC SDL_bool SDLCALL SDL_iPhoneKeyboardIsShown(SDL_WindowID windowID);
hfutrell@2419
    58
extern DECLSPEC int SDLCALL SDL_iPhoneKeyboardToggle(SDL_WindowID windowID);
hfutrell@2419
    59
#endif