ScummVM API documentation
iphone_common.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef BACKENDS_PLATFORM_IPHONE_IPHONE_COMMON_H
23 #define BACKENDS_PLATFORM_IPHONE_IPHONE_COMMON_H
24 
25 #include "graphics/surface.h"
26 
27 enum InputEvent {
28  kInputMouseDown,
29  kInputMouseUp,
30  kInputMouseDragged,
31  kInputMouseSecondDragged,
32  kInputMouseSecondDown,
33  kInputMouseSecondUp,
34  kInputOrientationChanged,
35  kInputKeyPressed,
36  kInputApplicationSuspended,
37  kInputApplicationResumed,
38  kInputSwipe
39 };
40 
41 enum ScreenOrientation {
42  kScreenOrientationPortrait,
43  kScreenOrientationLandscape,
44  kScreenOrientationFlippedLandscape
45 };
46 
47 enum UIViewSwipeDirection {
48  kUIViewSwipeUp = 1,
49  kUIViewSwipeDown = 2,
50  kUIViewSwipeLeft = 4,
51  kUIViewSwipeRight = 8
52 };
53 
54 struct VideoContext {
55  VideoContext() : asprectRatioCorrection(), screenWidth(), screenHeight(), overlayVisible(false),
56  overlayWidth(), overlayHeight(), mouseX(), mouseY(),
57  mouseHotspotX(), mouseHotspotY(), mouseWidth(), mouseHeight(),
58  mouseIsVisible(), filtering(false),
59  shakeXOffset(), shakeYOffset() {
60  }
61 
62  // Game screen state
63  bool asprectRatioCorrection;
64  uint screenWidth, screenHeight;
65  Graphics::Surface screenTexture;
66 
67  // Overlay state
68  bool overlayVisible;
69  uint overlayWidth, overlayHeight;
70  Graphics::Surface overlayTexture;
71 
72  // Mouse cursor state
73  uint mouseX, mouseY;
74  int mouseHotspotX, mouseHotspotY;
75  uint mouseWidth, mouseHeight;
76  bool mouseIsVisible;
77  Graphics::Surface mouseTexture;
78 
79  // Misc state
80  bool filtering;
81  int shakeXOffset;
82  int shakeYOffset;
83 };
84 
85 struct InternalEvent {
86  InternalEvent() : type(), value1(), value2() {}
87  InternalEvent(InputEvent t, int v1, int v2) : type(t), value1(v1), value2(v2) {}
88 
89  InputEvent type;
90  int value1, value2;
91 };
92 
93 // On the ObjC side
94 void iPhone_updateScreen();
95 bool iPhone_fetchEvent(InternalEvent *event);
96 const char *iPhone_getDocumentsDir();
97 bool iPhone_isHighResDevice();
98 
99 uint getSizeNextPOT(uint size);
100 
101 #endif
Definition: surface.h:53
Definition: ios7_common.h:100
Definition: ios7_common.h:70