1 | /** @file
|
---|
2 | *
|
---|
3 | * VBox frontends: VBoxSDL (simple frontend based on SDL):
|
---|
4 | * Main header
|
---|
5 | */
|
---|
6 |
|
---|
7 | /*
|
---|
8 | * Copyright (C) 2006-2007 Sun Microsystems, Inc.
|
---|
9 | *
|
---|
10 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
11 | * available from http://www.virtualbox.org. This file is free software;
|
---|
12 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
13 | * General Public License (GPL) as published by the Free Software
|
---|
14 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
15 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
16 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
17 | *
|
---|
18 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
|
---|
19 | * Clara, CA 95054 USA or visit http://www.sun.com if you need
|
---|
20 | * additional information or have any questions.
|
---|
21 | */
|
---|
22 |
|
---|
23 | #ifndef __H_VBOXSDL
|
---|
24 | #define __H_VBOXSDL
|
---|
25 |
|
---|
26 | #ifdef RT_OS_WINDOWS /** @todo check why we need to do this on windows. */
|
---|
27 | /* convince SDL to not overload main() */
|
---|
28 | #define _SDL_main_h
|
---|
29 | #endif
|
---|
30 | /* include this first so Windows.h get's in before our stuff. */
|
---|
31 | #include <SDL.h>
|
---|
32 |
|
---|
33 | /** custom SDL event for display update handling */
|
---|
34 | #define SDL_USER_EVENT_UPDATERECT (SDL_USEREVENT + 4)
|
---|
35 | /** custom SDL event for resize handling */
|
---|
36 | #define SDL_USER_EVENT_RESIZE (SDL_USEREVENT + 5)
|
---|
37 | /** custom SDL for XPCOM event queue processing */
|
---|
38 | #define SDL_USER_EVENT_XPCOM_EVENTQUEUE (SDL_USEREVENT + 6)
|
---|
39 | /** custom SDL event for updating the titlebar */
|
---|
40 | #define SDL_USER_EVENT_UPDATE_TITLEBAR (SDL_USEREVENT + 7)
|
---|
41 | /** custom SDL user event for terminating the session */
|
---|
42 | #define SDL_USER_EVENT_TERMINATE (SDL_USEREVENT + 8)
|
---|
43 | /** custom SDL user event for secure label update notification */
|
---|
44 | #define SDL_USER_EVENT_SECURELABEL_UPDATE (SDL_USEREVENT + 9)
|
---|
45 | /** custom SDL user event for pointer shape change request */
|
---|
46 | #define SDL_USER_EVENT_POINTER_CHANGE (SDL_USEREVENT + 10)
|
---|
47 | /** custom SDL user event for a regular timer */
|
---|
48 | #define SDL_USER_EVENT_TIMER (SDL_USEREVENT + 11)
|
---|
49 | /** custom SDL user event for resetting mouse cursor */
|
---|
50 | #define SDL_USER_EVENT_GUEST_CAP_CHANGED (SDL_USEREVENT + 12)
|
---|
51 | /** custom SDL user event for window resize down */
|
---|
52 | #define SDL_USER_EVENT_WINDOW_RESIZE_DONE (SDL_USEREVENT + 13)
|
---|
53 |
|
---|
54 |
|
---|
55 | /** The user.code field of the SDL_USER_EVENT_TERMINATE event.
|
---|
56 | * @{
|
---|
57 | */
|
---|
58 | /** Normal termination. */
|
---|
59 | #define VBOXSDL_TERM_NORMAL 0
|
---|
60 | /** Abnormal termination. */
|
---|
61 | #define VBOXSDL_TERM_ABEND 1
|
---|
62 | /** @} */
|
---|
63 |
|
---|
64 | void ResetVM(void);
|
---|
65 | void SaveState(void);
|
---|
66 |
|
---|
67 | #ifdef VBOX_WIN32_UI
|
---|
68 | int initUI(bool fResizable);
|
---|
69 | int uninitUI(void);
|
---|
70 | int resizeUI(uint16_t width, uint16_t height);
|
---|
71 | int setUITitle(char *title);
|
---|
72 | #endif /* VBOX_WIN32_UI */
|
---|
73 |
|
---|
74 | #ifdef VBOXSDL_WITH_X11
|
---|
75 | void PushNotifyUpdateEvent(SDL_Event *event);
|
---|
76 | #endif
|
---|
77 | int PushSDLEventForSure(SDL_Event *event);
|
---|
78 |
|
---|
79 | #endif // __H_VBOXSDL
|
---|