VirtualBox

source: vbox/trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.h@ 103068

Last change on this file since 103068 was 99494, checked in by vboxsync, 15 months ago

FE/VBoxSDL: Make it work with macOS, bugref:9449

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.4 KB
Line 
1/* $Id: VBoxSDL.h 99494 2023-04-20 19:52:23Z vboxsync $ */
2/** @file
3 *
4 * VBox frontends: VBoxSDL (simple frontend based on SDL):
5 * Main header
6 */
7
8/*
9 * Copyright (C) 2006-2023 Oracle and/or its affiliates.
10 *
11 * This file is part of VirtualBox base platform packages, as
12 * available from https://www.virtualbox.org.
13 *
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License
16 * as published by the Free Software Foundation, in version 3 of the
17 * License.
18 *
19 * This program is distributed in the hope that it will be useful, but
20 * WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 * General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, see <https://www.gnu.org/licenses>.
26 *
27 * SPDX-License-Identifier: GPL-3.0-only
28 */
29
30#ifndef VBOX_INCLUDED_SRC_VBoxSDL_VBoxSDL_h
31#define VBOX_INCLUDED_SRC_VBoxSDL_VBoxSDL_h
32#ifndef RT_WITHOUT_PRAGMA_ONCE
33# pragma once
34#endif
35
36#include <iprt/cdefs.h>
37#ifdef RT_OS_WINDOWS /** @todo check why we need to do this on windows. */
38/* convince SDL to not overload main() */
39# define _SDL_main_h
40#endif
41
42/* include this first so Windows.h get's in before our stuff. */
43#ifdef _MSC_VER
44# pragma warning(push)
45# pragma warning(disable: 4121) /* warning C4121: 'SDL_SysWMmsg' : alignment of a member was sensitive to packing*/
46# pragma warning(disable: 4668) /* warning C4668: '__GNUC__' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif' */
47#endif
48#include <SDL.h>
49#ifdef _MSC_VER
50# pragma warning(pop)
51#endif
52
53/** custom SDL event for display update handling */
54#define SDL_USER_EVENT_UPDATERECT (SDL_USEREVENT + 4)
55/** custom SDL event for changing the guest resolution */
56#define SDL_USER_EVENT_NOTIFYCHANGE (SDL_USEREVENT + 5)
57/** custom SDL for XPCOM event queue processing */
58#define SDL_USER_EVENT_XPCOM_EVENTQUEUE (SDL_USEREVENT + 6)
59/** custom SDL event for updating the titlebar */
60#define SDL_USER_EVENT_UPDATE_TITLEBAR (SDL_USEREVENT + 7)
61/** custom SDL user event for terminating the session */
62#define SDL_USER_EVENT_TERMINATE (SDL_USEREVENT + 8)
63/** custom SDL user event for pointer shape change request */
64#define SDL_USER_EVENT_POINTER_CHANGE (SDL_USEREVENT + 9)
65/** custom SDL user event for a regular timer */
66#define SDL_USER_EVENT_TIMER (SDL_USEREVENT + 10)
67/** custom SDL user event for resetting mouse cursor */
68#define SDL_USER_EVENT_GUEST_CAP_CHANGED (SDL_USEREVENT + 11)
69/** custom SDL user event for window resize done */
70#define SDL_USER_EVENT_WINDOW_RESIZE_DONE (SDL_USEREVENT + 12)
71
72
73/** The user.code field of the SDL_USER_EVENT_TERMINATE event.
74 * @{
75 */
76/** Normal termination. */
77#define VBOXSDL_TERM_NORMAL 0
78/** Abnormal termination. */
79#define VBOXSDL_TERM_ABEND 1
80/** @} */
81
82void ResetVM(void);
83void SaveState(void);
84
85#ifdef VBOX_WIN32_UI
86int initUI(bool fResizable, int64_t &winId);
87int uninitUI(void);
88int resizeUI(uint16_t width, uint16_t height);
89int setUITitle(char *title);
90#endif /* VBOX_WIN32_UI */
91
92#if defined(VBOXSDL_WITH_X11) || defined(RT_OS_DARWIN)
93void PushNotifyUpdateEvent(SDL_Event *event);
94#endif
95int PushSDLEventForSure(SDL_Event *event);
96
97#ifdef RT_OS_DARWIN
98RT_C_DECLS_BEGIN
99void *VBoxSDLGetDarwinWindowId(void);
100RT_C_DECLS_END
101#endif
102
103#endif /* !VBOX_INCLUDED_SRC_VBoxSDL_VBoxSDL_h */
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use