src/video/uikit/SDL_uikitviewcontroller.h
author Sam Lantinga <slouken@libsdl.org>
Tue, 26 May 2015 06:27:46 -0700
changeset 9619 b94b6d0bff0f
parent 9532 318042c16b76
child 9879 8465a79c9f85
permissions -rw-r--r--
Updated the copyright year to 2015
kees@5640
     1
/*
kees@5640
     2
 Simple DirectMedia Layer
slouken@9619
     3
 Copyright (C) 1997-2015 Sam Lantinga <slouken@libsdl.org>
kees@6001
     4
kees@5640
     5
 This software is provided 'as-is', without any express or implied
kees@5640
     6
 warranty.  In no event will the authors be held liable for any damages
kees@5640
     7
 arising from the use of this software.
kees@6001
     8
kees@5640
     9
 Permission is granted to anyone to use this software for any purpose,
kees@5640
    10
 including commercial applications, and to alter it and redistribute it
kees@5640
    11
 freely, subject to the following restrictions:
kees@6001
    12
kees@5640
    13
 1. The origin of this software must not be misrepresented; you must not
kees@5640
    14
 claim that you wrote the original software. If you use this software
kees@5640
    15
 in a product, an acknowledgment in the product documentation would be
kees@5640
    16
 appreciated but is not required.
kees@5640
    17
 2. Altered source versions must be plainly marked as such, and must not be
kees@5640
    18
 misrepresented as being the original software.
kees@5640
    19
 3. This notice may not be removed or altered from any source distribution.
kees@5640
    20
 */
kees@5640
    21
kees@5640
    22
#import <UIKit/UIKit.h>
kees@5640
    23
kees@6005
    24
#include "../SDL_sysvideo.h"
kees@5640
    25
slime73@9532
    26
#include "SDL_touch.h"
slime73@9532
    27
slime73@9532
    28
#if SDL_IPHONE_KEYBOARD
slime73@9532
    29
@interface SDL_uikitviewcontroller : UIViewController <UITextFieldDelegate>
slime73@9532
    30
#else
slime73@9501
    31
@interface SDL_uikitviewcontroller : UIViewController
slime73@9532
    32
#endif
kees@6011
    33
slime73@9501
    34
@property (nonatomic, assign) SDL_Window *window;
kees@6011
    35
slime73@9532
    36
- (instancetype)initWithSDLWindow:(SDL_Window *)_window;
slime73@9532
    37
slime73@9532
    38
- (void)setAnimationCallback:(int)interval
slime73@9532
    39
                    callback:(void (*)(void*))callback
slime73@9532
    40
               callbackParam:(void*)callbackParam;
slime73@9532
    41
slime73@9532
    42
- (void)startAnimation;
slime73@9532
    43
- (void)stopAnimation;
slime73@9532
    44
slime73@9532
    45
- (void)doLoop:(CADisplayLink*)sender;
slime73@9532
    46
slouken@6440
    47
- (void)loadView;
slouken@6451
    48
- (void)viewDidLayoutSubviews;
slouken@6451
    49
- (NSUInteger)supportedInterfaceOrientations;
kees@5640
    50
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)orient;
slouken@7862
    51
- (BOOL)prefersStatusBarHidden;
slime73@9492
    52
- (UIStatusBarStyle)preferredStatusBarStyle;
kees@6011
    53
slime73@9532
    54
#if SDL_IPHONE_KEYBOARD
slime73@9532
    55
- (void)showKeyboard;
slime73@9532
    56
- (void)hideKeyboard;
slime73@9532
    57
- (void)initKeyboard;
slime73@9532
    58
- (void)deinitKeyboard;
slime73@9532
    59
slime73@9532
    60
- (void)keyboardWillShow:(NSNotification *)notification;
slime73@9532
    61
- (void)keyboardWillHide:(NSNotification *)notification;
slime73@9532
    62
slime73@9532
    63
- (void)updateKeyboard;
slime73@9532
    64
slime73@9532
    65
@property (nonatomic, assign, getter=isKeyboardVisible) BOOL keyboardVisible;
slime73@9532
    66
@property (nonatomic, assign) SDL_Rect textInputRect;
slime73@9532
    67
@property (nonatomic, assign) int keyboardHeight;
slime73@9532
    68
#endif
slime73@9532
    69
kees@5640
    70
@end
slime73@9532
    71
slime73@9532
    72
#if SDL_IPHONE_KEYBOARD
slime73@9532
    73
SDL_bool UIKit_HasScreenKeyboardSupport(_THIS);
slime73@9532
    74
void UIKit_ShowScreenKeyboard(_THIS, SDL_Window *window);
slime73@9532
    75
void UIKit_HideScreenKeyboard(_THIS, SDL_Window *window);
slime73@9532
    76
SDL_bool UIKit_IsScreenKeyboardShown(_THIS, SDL_Window *window);
slime73@9532
    77
void UIKit_SetTextInputRect(_THIS, SDL_Rect *rect);
slime73@9532
    78
#endif