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