Changeset 614 in vbox
- Timestamp:
- Feb 5, 2007 1:07:44 AM (18 years ago)
- svn:sync-xref-src-repo-rev:
- 18243
- Location:
- trunk/src/VBox/Frontends/VBoxSDL
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxSDL/Framebuffer.cpp
r524 r614 41 41 #include "Ico64x01.h" 42 42 43 #if def __LINUX__43 #if defined(VBOX_WITH_XPCOM) 44 44 NS_IMPL_ISUPPORTS1_CI(VBoxSDLFB, IFramebuffer) 45 45 NS_DECL_CLASSINFO(VBoxSDLFB) -
trunk/src/VBox/Frontends/VBoxSDL/Helper.cpp
r143 r614 30 30 #include "Helper.h" 31 31 32 #include <sys/select.h> 33 32 34 /** 33 35 * Globals … … 35 37 36 38 37 #ifdef __LINUX__39 #ifdef VBOX_WITH_XPCOM 38 40 39 41 /** global flag indicating that the event queue thread should terminate */ … … 62 64 do 63 65 { 66 #ifdef __DARWIN__ 67 /** @todo figure out how this works here! */ 68 RTThreadSleep(100); 69 int n = 1; 70 #else 64 71 fd_set fdset; 65 72 FD_ZERO(&fdset); 66 73 FD_SET(eqFD, &fdset); 67 74 int n = select(eqFD + 1, &fdset, NULL, NULL, NULL); 75 #endif 76 68 77 69 78 /* are there any events to process? */ … … 139 148 140 149 141 #endif /* __LINUX__*/150 #endif /* VBOX_WITH_XPCOM */ 142 151 -
trunk/src/VBox/Frontends/VBoxSDL/Helper.h
r1 r614 24 24 #define __H_HELPER 25 25 26 #ifdef __LINUX__26 #ifdef VBOX_WITH_XPCOM 27 27 28 28 /** -
trunk/src/VBox/Frontends/VBoxSDL/Makefile
r200 r614 28 28 # VBoxSDL 29 29 # 30 ## @todo isn't the main program template more appropriate? 31 VBoxSDL_TEMPLATE = VBOXR3NPEXE 30 ifneq ($(filter win linux,$(BUILD_TARGET)),) ## @todo Convert these two to the other template too! 31 VBoxSDL_TEMPLATE = VBOXR3NPEXE 32 VBoxSDL_CXXFLAGS.win = \ 33 -EHsc 34 VBoxSDL_CXXFLAGS.linux = \ 35 -DNDEBUG -DTRIMMED -DVBOX_WITH_XPCOM -O -Wall -fno-rtti -fno-exceptions \ 36 -Wno-non-virtual-dtor -Wno-long-long -fshort-wchar -pthread -pipe 37 else 38 VBoxSDL_TEMPLATE = VBOXMAINCLIENT 39 endif 32 40 VBoxSDL_SDKS = LIBSDL 33 41 VBoxSDL_SOURCES = \ … … 41 49 win32/VBoxSDL.rc 42 50 endif 43 VBoxSDL_DEFS = IN_RING3 IN_RT_R3 _GNU_SOURCE51 VBoxSDL_DEFS = 44 52 ifdef VBOX_WITH_SECURELABEL 45 VBoxSDL_DEFS+= VBOX_SECURELABEL53 VBoxSDL_DEFS += VBOX_SECURELABEL 46 54 endif 47 55 ifdef VBOX_WITH_VRDP 48 VBoxSDL_DEFS += VBOX_VRDP 56 VBoxSDL_DEFS += VBOX_VRDP 57 endif 58 VBoxSDL_DEFS.linux = _GNU_SOURCE 59 ifdef VBOX_OPENGL 60 #VBoxSDL_DEFS.linux += VBOX_OPENGL 49 61 endif 50 62 ifndef VBOX_OSE 51 VBoxSDL_DEFS.win 63 VBoxSDL_DEFS.win = VBOX_WIN32_UI 52 64 endif 53 65 VBoxSDL_DEFS.win.x86 = _WIN32_WINNT=0x0500 54 66 VBoxSDL_DEFS.win.amd64 = _WIN32_WINNT=0x0510 55 ifdef VBOX_OPENGL56 #VBoxSDL_DEFS.linux = VBOX_OPENGL57 endif58 VBoxSDL_RCDEFS = \59 VBOX_VERSION_MAJOR=\"$(VBOX_VERSION_MAJOR)\" \60 VBOX_VERSION_MINOR=\"$(VBOX_VERSION_MINOR)\" \61 VBOX_VERSION_BUILD=\"$(VBOX_VERSION_BUILD)\"62 67 VBoxSDL_INCS = \ 63 $(PATH_VBoxSDL) \64 68 $(PATH_BIN)/sdk/include 65 VBoxSDL_INCS.win = \ 66 $(PATH_TOOL_$(VBOX_VCC_TOOL)_ATLMFC_INC) 67 VBoxSDL_INCS.linux = \ 69 ifdef VBOX_WITH_XPCOM 70 VBoxSDL_INCS = \ 68 71 $(PATH_BIN)/sdk/include \ 69 $(VBOX_XPCOM_INCS) 70 VBoxSDL_LIBS = \ 71 $(LIB_RUNTIME) 72 VBoxSDL_LIBS.win = \ 73 $(PATH_LIB)/VBoxCOM$(VBOX_SUFF_LIB) \ 74 $(PATH_TOOL_$(VBOX_VCC_TOOL)_ATLMFC_LIB)/atls.lib 75 VBoxSDL_LIBS.linux = \ 72 $(VBOX_XPCOM_INCS) \ 73 $(PATH_VBoxSDL) 74 VBoxSDL_LIBS = \ 75 $(LIB_SDK_LIBSDL_SDLMAIN) \ 76 76 $(PATH_LIB)/VBoxXPCOM$(VBOX_SUFF_LIB) \ 77 77 $(LIB_RUNTIME) \ 78 $(PATH_BIN)/VBoxXPCOM.so \79 78 $(PATH_LIB)/VBoxXPCOMGlue$(VBOX_SUFF_LIB) \ 79 $(PATH_BIN)/VBoxXPCOM$(VBOX_SUFF_DLL) 80 VBoxSDL_LIBS.linux = \ 80 81 $(LIB_UUID) \ 81 82 $(LIB_XCURSOR) 83 VBoxSDL_LDFLAGS.darwin = \ 84 -framework Foundation -framework AppKit 85 else # !VBOX_WITH_XPCOM 86 VBoxSDL_INCS.win = \ 87 $(PATH_BIN)/sdk/include \ 88 $(PATH_TOOL_$(VBOX_VCC_TOOL)_ATLMFC_INC) \ 89 $(PATH_VBoxSDL) 90 VBoxSDL_LIBS.win = \ 91 $(PATH_LIB)/VBoxCOM$(VBOX_SUFF_LIB) \ 92 $(PATH_TOOL_$(VBOX_VCC_TOOL)_ATLMFC_LIB)/atls.lib \ 93 $(LIB_RUNTIME) 94 endif # !VBOX_WITH_XPCOM 82 95 ifdef VBOX_OPENGL 83 #VBoxSDL_LIBS.linux += GL96 #VBoxSDL_LIBS.linux += GL 84 97 endif 85 98 VBoxSDL_LIBPATH.linux = \ 86 $(LIBPATH_XPCOM) \87 99 /usr/X11R6/lib 88 VBoxSDL_CXXFLAGS.win = \89 -EHsc90 VBoxSDL_CXXFLAGS.linux = \91 -DNDEBUG -DTRIMMED -O -Wall -fno-rtti -fno-exceptions \92 -Wno-non-virtual-dtor -Wno-long-long -fshort-wchar -pthread -pipe93 100 94 101 VBoxSDL_CLEAN = $(PATH_VBoxSDL)/Ico64x01.h -
trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp
r522 r614 58 58 #include <iprt/uuid.h> 59 59 #include <iprt/ldr.h> 60 61 #include <stdlib.h> /* for alloca */ 62 #include <malloc.h> /* for alloca */ 60 #include <iprt/alloca.h> 61 63 62 #include <signal.h> 64 63 … … 441 440 event.type = SDL_USEREVENT; 442 441 event.user.type = SDL_USER_EVENT_TERMINATE; 443 event.user.code = machineState == MachineState_Aborted 442 event.user.code = machineState == MachineState_Aborted 444 443 ? VBOXSDL_TERM_ABEND 445 444 : VBOXSDL_TERM_NORMAL; … … 523 522 }; 524 523 525 #ifdef __LINUX__524 #ifdef VBOX_WITH_XPCOM 526 525 NS_DECL_CLASSINFO(VBoxSDLCallback) 527 526 NS_IMPL_ISUPPORTS1_CI(VBoxSDLCallback, IVirtualBoxCallback) 528 527 NS_DECL_CLASSINFO(VBoxSDLConsoleCallback) 529 528 NS_IMPL_ISUPPORTS1_CI(VBoxSDLConsoleCallback, IConsoleCallback) 530 #endif /* __LINUX__*/529 #endif /* VBOX_WITH_XPCOM */ 531 530 532 531 static void show_usage() … … 549 548 " -detecthostkey Get the hostkey identifier and modifier state\n" 550 549 " -hostkey <key> {<key2>} <mod> Set the host key to the values obtained using -detecthostkey\n" 551 #if def __LINUX__550 #if defined(__LINUX__) || defined(__DARWIN__) /** @todo UNIXISH_TAP stuff out of main and up to Config.kmk! */ 552 551 " -tapdev<1-N> <dev> Use existing persistent TAP device with the given name\n" 553 552 " -tapfd<1-N> <fd> Use existing TAP device, don't allocate\n" … … 848 847 // EventQueue eventQ; 849 848 850 #ifdef __LINUX__849 #ifdef VBOX_WITH_XPCOM 851 850 nsCOMPtr<nsIEventQueue> eventQ; 852 851 NS_GetMainEventQ(getter_AddRefs(eventQ)); 853 #endif /* __LINUX__*/852 #endif /* VBOX_WITH_XPCOM */ 854 853 855 854 /* Get the number of network adapters */ … … 859 858 sysInfo->COMGETTER (NetworkAdapterCount) (&NetworkAdapterCount); 860 859 861 #if def __LINUX__860 #if defined(__LINUX__) || defined(__DARWIN__) 862 861 std::vector <Bstr> tapdev (NetworkAdapterCount); 863 862 std::vector <int> tapfd (NetworkAdapterCount, 0); … … 1030 1029 } 1031 1030 } 1032 #if def __LINUX__1031 #if defined(__LINUX__) || defined(__DARWIN__) 1033 1032 else if (strncmp(argv[curArg], "-tapdev", 7) == 0) 1034 1033 { … … 1057 1056 curArg++; 1058 1057 } 1059 #endif /* __LINUX__ */1058 #endif /* __LINUX__ || __DARWIN__ */ 1060 1059 #ifdef VBOX_VRDP 1061 1060 else if (strcmp(argv[curArg], "-vrdp") == 0) … … 1692 1691 consoleCallback->ignorePowerOffEvents(true); 1693 1692 1694 #if def __LINUX__1693 #if defined(__LINUX__) || defined(__DARWIN__) 1695 1694 /* 1696 1695 * Do we have a TAP device name or file descriptor? If so, communicate … … 1729 1728 } 1730 1729 } 1731 #endif /* __LINUX__ */1730 #endif /* __LINUX__ || __DARWIN__ */ 1732 1731 1733 1732 #ifdef VBOX_VRDP … … 1873 1872 } 1874 1873 1875 #if def __LINUX__1874 #if defined(VBOX_WITH_XPCOM) 1876 1875 /* 1877 1876 * Before we starting to do stuff, we have to launch the XPCOM … … 1883 1882 */ 1884 1883 startXPCOMEventQueueThread(eventQ->GetEventQueueSelectFD()); 1885 #endif /* * __LINUX__*/1884 #endif /* VBOX_WITH_XPCOM */ 1886 1885 1887 1886 /* termination flag */ … … 1909 1908 * service the XPCOM event queue! 1910 1909 */ 1911 #ifdef __LINUX__1910 #ifdef VBOX_WITH_XPCOM 1912 1911 if (!fXPCOMEventThreadSignaled) 1913 1912 { … … 1947 1946 } 1948 1947 1949 #ifdef __LINUX__1948 #ifdef VBOX_WITH_XPCOM 1950 1949 /* 1951 1950 * User specific XPCOM event queue event … … 1958 1957 break; 1959 1958 } 1960 #endif /* __LINUX__*/1959 #endif /* VBOX_WITH_XPCOM */ 1961 1960 1962 1961 /* … … 2036 2035 * Main event loop 2037 2036 */ 2038 #ifdef __LINUX__2037 #ifdef VBOX_WITH_XPCOM 2039 2038 if (!fXPCOMEventThreadSignaled) 2040 2039 { … … 2096 2095 break; 2097 2096 } 2098 enmHKeyState = event.type == SDL_KEYUP ? HKEYSTATE_NORMAL 2097 enmHKeyState = event.type == SDL_KEYUP ? HKEYSTATE_NORMAL 2099 2098 : HKEYSTATE_NOT_IT; 2100 2099 ProcessKey(&EvHKeyDown1.key); … … 2344 2343 } 2345 2344 2346 #ifdef __LINUX__2345 #ifdef VBOX_WITH_XPCOM 2347 2346 /* 2348 2347 * User specific XPCOM event queue event … … 2355 2354 break; 2356 2355 } 2357 #endif /* __LINUX__*/2356 #endif /* VBOX_WITH_XPCOM */ 2358 2357 2359 2358 /* … … 2427 2426 leave: 2428 2427 LogFlow(("leaving...\n")); 2429 #ifdef __LINUX__2428 #ifdef VBOX_WITH_XPCOM 2430 2429 /* make sure the XPCOM event queue thread doesn't do anything harmful */ 2431 2430 terminateXPCOMQueueThread(); 2432 #endif /* __LINUX__*/2431 #endif /* VBOX_WITH_XPCOM */ 2433 2432 2434 2433 #ifdef VBOX_VRDP -
trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.h
r522 r614 24 24 #define __H_VBOXSDL 25 25 26 #ifdef __WIN__ /** @todo check why we need to do this on windows. */ 26 27 /* convince SDL to not overload main() */ 27 28 #define _SDL_main_h 29 #endif 28 30 /* include this first so Windows.h get's in before our stuff. */ 29 31 #include <SDL.h>
Note:
See TracChangeset
for help on using the changeset viewer.