diff options
| author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2014-03-26 19:21:20 +0000 |
|---|---|---|
| committer | <> | 2014-05-08 15:03:54 +0000 |
| commit | fb123f93f9f5ce42c8e5785d2f8e0edaf951740e (patch) | |
| tree | c2103d76aec5f1f10892cd1d3a38e24f665ae5db /src/VBox/Frontends/VBoxSDL | |
| parent | 58ed4748338f9466599adfc8a9171280ed99e23f (diff) | |
| download | VirtualBox-master.tar.gz | |
Imported from /home/lorry/working-area/delta_VirtualBox/VirtualBox-4.3.10.tar.bz2.HEADVirtualBox-4.3.10master
Diffstat (limited to 'src/VBox/Frontends/VBoxSDL')
| -rw-r--r-- | src/VBox/Frontends/VBoxSDL/Framebuffer.cpp | 9 | ||||
| -rw-r--r-- | src/VBox/Frontends/VBoxSDL/Framebuffer.h | 4 | ||||
| -rw-r--r-- | src/VBox/Frontends/VBoxSDL/Helper.cpp | 4 | ||||
| -rw-r--r-- | src/VBox/Frontends/VBoxSDL/Helper.h | 2 | ||||
| -rw-r--r-- | src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp | 44 | ||||
| -rw-r--r-- | src/VBox/Frontends/VBoxSDL/VBoxSDL.h | 2 | ||||
| -rw-r--r-- | src/VBox/Frontends/VBoxSDL/VBoxSDLHardened.cpp | 2 | ||||
| -rw-r--r-- | src/VBox/Frontends/VBoxSDL/VBoxSDLTest.cpp | 4 |
8 files changed, 51 insertions, 20 deletions
diff --git a/src/VBox/Frontends/VBoxSDL/Framebuffer.cpp b/src/VBox/Frontends/VBoxSDL/Framebuffer.cpp index 73216b6e..00b80ab4 100644 --- a/src/VBox/Frontends/VBoxSDL/Framebuffer.cpp +++ b/src/VBox/Frontends/VBoxSDL/Framebuffer.cpp @@ -20,7 +20,6 @@ #include <VBox/com/string.h> #include <VBox/com/Guid.h> #include <VBox/com/ErrorInfo.h> -#include <VBox/com/EventQueue.h> #include <VBox/com/VirtualBox.h> #include <iprt/stream.h> @@ -168,7 +167,7 @@ bool VBoxSDLFB::init(bool fShowSDLConfig) #ifdef RT_OS_WINDOWS /* default to DirectX if nothing else set */ - if (!RTEnvGet("SDL_VIDEODRIVER")) + if (!RTEnvExist("SDL_VIDEODRIVER")) { _putenv("SDL_VIDEODRIVER=directx"); // _putenv("SDL_VIDEODRIVER=windib"); @@ -621,6 +620,12 @@ STDMETHODIMP VBoxSDLFB::ProcessVHWACommand(BYTE *pCommand) { return E_NOTIMPL; } + +STDMETHODIMP VBoxSDLFB::Notify3DEvent(ULONG uType, BYTE *pReserved) +{ + return E_NOTIMPL; +} + // // Internal public methods // diff --git a/src/VBox/Frontends/VBoxSDL/Framebuffer.h b/src/VBox/Frontends/VBoxSDL/Framebuffer.h index 69de07eb..0e3c433a 100644 --- a/src/VBox/Frontends/VBoxSDL/Framebuffer.h +++ b/src/VBox/Frontends/VBoxSDL/Framebuffer.h @@ -5,7 +5,7 @@ */ /* - * Copyright (C) 2006-2007 Oracle Corporation + * Copyright (C) 2006-2012 Oracle Corporation * * This file is part of VirtualBox Open Source Edition (OSE), as * available from http://www.virtualbox.org. This file is free software; @@ -95,6 +95,8 @@ public: STDMETHOD(ProcessVHWACommand)(BYTE *pCommand); + STDMETHOD(Notify3DEvent)(ULONG uType, BYTE *pReserved); + // internal public methods bool initialized() { return mfInitialized; } void resizeGuest(); diff --git a/src/VBox/Frontends/VBoxSDL/Helper.cpp b/src/VBox/Frontends/VBoxSDL/Helper.cpp index a2f4e275..5750d0f7 100644 --- a/src/VBox/Frontends/VBoxSDL/Helper.cpp +++ b/src/VBox/Frontends/VBoxSDL/Helper.cpp @@ -5,7 +5,7 @@ */ /* - * Copyright (C) 2006-2007 Oracle Corporation + * Copyright (C) 2006-2011 Oracle Corporation * * This file is part of VirtualBox Open Source Edition (OSE), as * available from http://www.virtualbox.org. This file is free software; @@ -127,7 +127,7 @@ int startXPCOMEventQueueThread(int eqFD) if (RT_SUCCESS(rc)) { RTTHREAD Thread; - rc = RTThreadCreate(&Thread, xpcomEventThread, (void *)(intptr_t)eqFD, + rc = RTThreadCreate(&Thread, xpcomEventThread, (void *)(intptr_t)eqFD, 0, RTTHREADTYPE_MSG_PUMP, 0, "XPCOMEvent"); } AssertRC(rc); diff --git a/src/VBox/Frontends/VBoxSDL/Helper.h b/src/VBox/Frontends/VBoxSDL/Helper.h index caf48f4f..6b725200 100644 --- a/src/VBox/Frontends/VBoxSDL/Helper.h +++ b/src/VBox/Frontends/VBoxSDL/Helper.h @@ -5,7 +5,7 @@ */ /* - * Copyright (C) 2006-2007 Oracle Corporation + * Copyright (C) 2006-2010 Oracle Corporation * * This file is part of VirtualBox Open Source Edition (OSE), as * available from http://www.virtualbox.org. This file is free software; diff --git a/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp b/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp index 64bcd25f..53e49b7f 100644 --- a/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp +++ b/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp @@ -4,7 +4,7 @@ */ /* - * Copyright (C) 2006-2011 Oracle Corporation + * Copyright (C) 2006-2013 Oracle Corporation * * This file is part of VirtualBox Open Source Edition (OSE), as * available from http://www.virtualbox.org. This file is free software; @@ -27,7 +27,7 @@ #include <VBox/com/ErrorInfo.h> #include <VBox/com/errorprint.h> -#include <VBox/com/EventQueue.h> +#include <VBox/com/NativeEventQueue.h> #include <VBox/com/VirtualBox.h> using namespace com; @@ -732,6 +732,10 @@ static CComModule _Module; extern "C" DECLEXPORT(int) TrustedMain(int argc, char **argv, char **envp) { +#ifdef Q_WS_X11 + if (!XInitThreads()) + return 1; +#endif #ifdef VBOXSDL_WITH_X11 /* * Lock keys on SDL behave different from normal keys: A KeyPress event is generated @@ -949,11 +953,17 @@ DECLEXPORT(int) TrustedMain(int argc, char **argv, char **envp) } // first check if a UUID was supplied uuidVM = argv[curArg]; - if (uuidVM.isEmpty()) + + if (!uuidVM.isValid()) { LogFlow(("invalid UUID format, assuming it's a VM name\n")); vmName = argv[curArg]; } + else if (uuidVM.isZero()) + { + RTPrintf("Error: UUID argument is zero!\n"); + return 1; + } } else if ( !strcmp(argv[curArg], "--comment") || !strcmp(argv[curArg], "-comment")) @@ -1371,7 +1381,7 @@ DECLEXPORT(int) TrustedMain(int argc, char **argv, char **envp) ComPtr<IVirtualBox> pVirtualBox; ComPtr<ISession> pSession; bool sessionOpened = false; - EventQueue* eventQ = com::EventQueue::getMainEventQueue(); + NativeEventQueue* eventQ = com::NativeEventQueue::getMainEventQueue(); ComPtr<IMachine> pMachine; @@ -1416,7 +1426,7 @@ DECLEXPORT(int) TrustedMain(int argc, char **argv, char **envp) /* * Do we have a UUID? */ - if (!uuidVM.isEmpty()) + if (uuidVM.isValid()) { rc = pVirtualBox->FindMachine(uuidVM.toUtf16().raw(), pMachine.asOutParam()); if (FAILED(rc) || !pMachine) @@ -1439,20 +1449,28 @@ DECLEXPORT(int) TrustedMain(int argc, char **argv, char **envp) } else { - RTPrintf("Error: machine with the given ID not found!\n"); + RTPrintf("Error: machine with the given name not found!\n"); + RTPrintf("Check if this VM has been corrupted and is now inaccessible."); goto leave; } } - else if (uuidVM.isEmpty()) - { - RTPrintf("Error: no machine specified!\n"); - goto leave; - } /* create SDL event semaphore */ vrc = RTSemEventCreate(&g_EventSemSDLEvents); AssertReleaseRC(vrc); + rc = pVirtualBoxClient->CheckMachineError(pMachine); + if (FAILED(rc)) + { + com::ErrorInfo info; + if (info.isFullAvailable()) + PrintError("The VM has errors", + info.getText().raw(), info.getComponent().raw()); + else + RTPrintf("Failed to check for VM errors! No error information available (rc=%Rhrc).\n", rc); + goto leave; + } + rc = pMachine->LockMachine(pSession, LockType_VM); if (FAILED(rc)) { @@ -3028,6 +3046,10 @@ static RTEXITCODE settingsPasswordFile(ComPtr<IVirtualBox> virtualBox, const cha */ int main(int argc, char **argv) { +#ifdef Q_WS_X11 + if (!XInitThreads()) + return 1; +#endif /* * Before we do *anything*, we initialize the runtime. */ diff --git a/src/VBox/Frontends/VBoxSDL/VBoxSDL.h b/src/VBox/Frontends/VBoxSDL/VBoxSDL.h index 04b73955..038ab10c 100644 --- a/src/VBox/Frontends/VBoxSDL/VBoxSDL.h +++ b/src/VBox/Frontends/VBoxSDL/VBoxSDL.h @@ -5,7 +5,7 @@ */ /* - * Copyright (C) 2006-2007 Oracle Corporation + * Copyright (C) 2006-2010 Oracle Corporation * * This file is part of VirtualBox Open Source Edition (OSE), as * available from http://www.virtualbox.org. This file is free software; diff --git a/src/VBox/Frontends/VBoxSDL/VBoxSDLHardened.cpp b/src/VBox/Frontends/VBoxSDL/VBoxSDLHardened.cpp index f2ae7640..40dd494e 100644 --- a/src/VBox/Frontends/VBoxSDL/VBoxSDLHardened.cpp +++ b/src/VBox/Frontends/VBoxSDL/VBoxSDLHardened.cpp @@ -4,7 +4,7 @@ */ /* - * Copyright (C) 2008 Oracle Corporation + * Copyright (C) 2008-2010 Oracle Corporation * * This file is part of VirtualBox Open Source Edition (OSE), as * available from http://www.virtualbox.org. This file is free software; diff --git a/src/VBox/Frontends/VBoxSDL/VBoxSDLTest.cpp b/src/VBox/Frontends/VBoxSDL/VBoxSDLTest.cpp index bfd5524b..159266a4 100644 --- a/src/VBox/Frontends/VBoxSDL/VBoxSDLTest.cpp +++ b/src/VBox/Frontends/VBoxSDL/VBoxSDLTest.cpp @@ -5,7 +5,7 @@ */ /* - * Copyright (C) 2006-2007 Oracle Corporation + * Copyright (C) 2006-2013 Oracle Corporation * * This file is part of VirtualBox Open Source Edition (OSE), as * available from http://www.virtualbox.org. This file is free software; @@ -261,6 +261,8 @@ static void bench(unsigned long w, unsigned long h, unsigned long bpp) checkSDL("SDL_GL_SetAttribute", SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, Bsize)); checkSDL("SDL_GL_SetAttribute", SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 0)); } +#else + NOREF(Rsize); NOREF(Gsize); NOREF(Bsize); #endif RTPrintf("Testing "ESC_BOLD"%ldx%ld@%ld"ESC_NORM"\n", guGuestXRes, guGuestYRes, guGuestBpp); |
