1 | /* $Id: VBoxSDL.h 69496 2017-10-28 14:55:58Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | *
|
---|
4 | * VBox frontends: VBoxSDL (simple frontend based on SDL):
|
---|
5 | * Main header
|
---|
6 | */
|
---|
7 |
|
---|
8 | /*
|
---|
9 | * Copyright (C) 2006-2017 Oracle Corporation
|
---|
10 | *
|
---|
11 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
12 | * available from http://www.virtualbox.org. This file is free software;
|
---|
13 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
14 | * General Public License (GPL) as published by the Free Software
|
---|
15 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
16 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
17 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
18 | */
|
---|
19 |
|
---|
20 | #ifndef __H_VBOXSDL
|
---|
21 | #define __H_VBOXSDL
|
---|
22 |
|
---|
23 | #include <iprt/cdefs.h>
|
---|
24 | #ifdef RT_OS_WINDOWS /** @todo check why we need to do this on windows. */
|
---|
25 | /* convince SDL to not overload main() */
|
---|
26 | # define _SDL_main_h
|
---|
27 | #endif
|
---|
28 |
|
---|
29 | /* include this first so Windows.h get's in before our stuff. */
|
---|
30 | #ifdef _MSC_VER
|
---|
31 | # pragma warning(push)
|
---|
32 | # pragma warning(disable: 4121) /* warning C4121: 'SDL_SysWMmsg' : alignment of a member was sensitive to packing*/
|
---|
33 | #endif
|
---|
34 | #include <SDL.h>
|
---|
35 | #ifdef _MSC_VER
|
---|
36 | # pragma warning(pop)
|
---|
37 | #endif
|
---|
38 |
|
---|
39 | /** custom SDL event for display update handling */
|
---|
40 | #define SDL_USER_EVENT_UPDATERECT (SDL_USEREVENT + 4)
|
---|
41 | /** custom SDL event for changing the guest resolution */
|
---|
42 | #define SDL_USER_EVENT_NOTIFYCHANGE (SDL_USEREVENT + 5)
|
---|
43 | /** custom SDL for XPCOM event queue processing */
|
---|
44 | #define SDL_USER_EVENT_XPCOM_EVENTQUEUE (SDL_USEREVENT + 6)
|
---|
45 | /** custom SDL event for updating the titlebar */
|
---|
46 | #define SDL_USER_EVENT_UPDATE_TITLEBAR (SDL_USEREVENT + 7)
|
---|
47 | /** custom SDL user event for terminating the session */
|
---|
48 | #define SDL_USER_EVENT_TERMINATE (SDL_USEREVENT + 8)
|
---|
49 | /** custom SDL user event for secure label update notification */
|
---|
50 | #define SDL_USER_EVENT_SECURELABEL_UPDATE (SDL_USEREVENT + 9)
|
---|
51 | /** custom SDL user event for pointer shape change request */
|
---|
52 | #define SDL_USER_EVENT_POINTER_CHANGE (SDL_USEREVENT + 10)
|
---|
53 | /** custom SDL user event for a regular timer */
|
---|
54 | #define SDL_USER_EVENT_TIMER (SDL_USEREVENT + 11)
|
---|
55 | /** custom SDL user event for resetting mouse cursor */
|
---|
56 | #define SDL_USER_EVENT_GUEST_CAP_CHANGED (SDL_USEREVENT + 12)
|
---|
57 | /** custom SDL user event for window resize done */
|
---|
58 | #define SDL_USER_EVENT_WINDOW_RESIZE_DONE (SDL_USEREVENT + 13)
|
---|
59 |
|
---|
60 |
|
---|
61 | /** The user.code field of the SDL_USER_EVENT_TERMINATE event.
|
---|
62 | * @{
|
---|
63 | */
|
---|
64 | /** Normal termination. */
|
---|
65 | #define VBOXSDL_TERM_NORMAL 0
|
---|
66 | /** Abnormal termination. */
|
---|
67 | #define VBOXSDL_TERM_ABEND 1
|
---|
68 | /** @} */
|
---|
69 |
|
---|
70 | void ResetVM(void);
|
---|
71 | void SaveState(void);
|
---|
72 |
|
---|
73 | #ifdef VBOX_WIN32_UI
|
---|
74 | int initUI(bool fResizable, int64_t &winId);
|
---|
75 | int uninitUI(void);
|
---|
76 | int resizeUI(uint16_t width, uint16_t height);
|
---|
77 | int setUITitle(char *title);
|
---|
78 | #endif /* VBOX_WIN32_UI */
|
---|
79 |
|
---|
80 | #ifdef VBOXSDL_WITH_X11
|
---|
81 | void PushNotifyUpdateEvent(SDL_Event *event);
|
---|
82 | #endif
|
---|
83 | int PushSDLEventForSure(SDL_Event *event);
|
---|
84 |
|
---|
85 | #ifdef RT_OS_DARWIN
|
---|
86 | RT_C_DECLS_BEGIN
|
---|
87 | void *VBoxSDLGetDarwinWindowId(void);
|
---|
88 | RT_C_DECLS_END
|
---|
89 | #endif
|
---|
90 |
|
---|
91 | #endif
|
---|