VirtualBox

Changeset 614 in vbox


Ignore:
Timestamp:
Feb 5, 2007 1:07:44 AM (18 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
18243
Message:

Darwin port (hope I didn't mess up anything, am very Zzzzz...)

Location:
trunk/src/VBox/Frontends/VBoxSDL
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxSDL/Framebuffer.cpp

    r524 r614  
    4141#include "Ico64x01.h"
    4242
    43 #ifdef __LINUX__
     43#if defined(VBOX_WITH_XPCOM)
    4444NS_IMPL_ISUPPORTS1_CI(VBoxSDLFB, IFramebuffer)
    4545NS_DECL_CLASSINFO(VBoxSDLFB)
  • trunk/src/VBox/Frontends/VBoxSDL/Helper.cpp

    r143 r614  
    3030#include "Helper.h"
    3131
     32#include <sys/select.h>
     33
    3234/**
    3335 * Globals
     
    3537
    3638
    37 #ifdef __LINUX__
     39#ifdef VBOX_WITH_XPCOM
    3840
    3941/** global flag indicating that the event queue thread should terminate */
     
    6264    do
    6365    {
     66#ifdef __DARWIN__
     67        /** @todo figure out how this works here! */
     68        RTThreadSleep(100);
     69        int n = 1;
     70#else
    6471        fd_set fdset;
    6572        FD_ZERO(&fdset);
    6673        FD_SET(eqFD, &fdset);
    6774        int n = select(eqFD + 1, &fdset, NULL, NULL, NULL);
     75#endif
     76
    6877
    6978        /* are there any events to process? */
     
    139148
    140149
    141 #endif /* __LINUX__ */
     150#endif /* VBOX_WITH_XPCOM */
    142151
  • trunk/src/VBox/Frontends/VBoxSDL/Helper.h

    r1 r614  
    2424#define __H_HELPER
    2525
    26 #ifdef __LINUX__
     26#ifdef VBOX_WITH_XPCOM
    2727
    2828/**
  • trunk/src/VBox/Frontends/VBoxSDL/Makefile

    r200 r614  
    2828# VBoxSDL
    2929#
    30 ## @todo isn't the main program template more appropriate?
    31 VBoxSDL_TEMPLATE   = VBOXR3NPEXE
     30ifneq ($(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
     37else
     38 VBoxSDL_TEMPLATE  = VBOXMAINCLIENT
     39endif
    3240VBoxSDL_SDKS       = LIBSDL
    3341VBoxSDL_SOURCES    = \
     
    4149        win32/VBoxSDL.rc
    4250endif
    43 VBoxSDL_DEFS       = IN_RING3 IN_RT_R3 _GNU_SOURCE
     51VBoxSDL_DEFS       =
    4452ifdef VBOX_WITH_SECURELABEL
    45 VBoxSDL_DEFS      += VBOX_SECURELABEL
     53 VBoxSDL_DEFS     += VBOX_SECURELABEL
    4654endif
    4755ifdef VBOX_WITH_VRDP
    48 VBoxSDL_DEFS      += VBOX_VRDP
     56 VBoxSDL_DEFS     += VBOX_VRDP
     57endif
     58VBoxSDL_DEFS.linux = _GNU_SOURCE
     59ifdef VBOX_OPENGL
     60 #VBoxSDL_DEFS.linux += VBOX_OPENGL
    4961endif
    5062ifndef VBOX_OSE
    51  VBoxSDL_DEFS.win   = VBOX_WIN32_UI
     63 VBoxSDL_DEFS.win  = VBOX_WIN32_UI
    5264endif
    5365VBoxSDL_DEFS.win.x86 = _WIN32_WINNT=0x0500
    5466VBoxSDL_DEFS.win.amd64 = _WIN32_WINNT=0x0510
    55 ifdef VBOX_OPENGL
    56 #VBoxSDL_DEFS.linux = VBOX_OPENGL
    57 endif
    58 VBoxSDL_RCDEFS     = \
    59         VBOX_VERSION_MAJOR=\"$(VBOX_VERSION_MAJOR)\" \
    60         VBOX_VERSION_MINOR=\"$(VBOX_VERSION_MINOR)\" \
    61         VBOX_VERSION_BUILD=\"$(VBOX_VERSION_BUILD)\"
    6267VBoxSDL_INCS = \
    63         $(PATH_VBoxSDL) \
    6468        $(PATH_BIN)/sdk/include
    65 VBoxSDL_INCS.win = \
    66         $(PATH_TOOL_$(VBOX_VCC_TOOL)_ATLMFC_INC)
    67 VBoxSDL_INCS.linux = \
     69ifdef VBOX_WITH_XPCOM
     70 VBoxSDL_INCS = \
    6871        $(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) \
    7676        $(PATH_LIB)/VBoxXPCOM$(VBOX_SUFF_LIB) \
    7777        $(LIB_RUNTIME) \
    78         $(PATH_BIN)/VBoxXPCOM.so \
    7978        $(PATH_LIB)/VBoxXPCOMGlue$(VBOX_SUFF_LIB) \
     79        $(PATH_BIN)/VBoxXPCOM$(VBOX_SUFF_DLL)
     80 VBoxSDL_LIBS.linux = \
    8081        $(LIB_UUID) \
    8182        $(LIB_XCURSOR)
     83 VBoxSDL_LDFLAGS.darwin = \
     84    -framework Foundation -framework AppKit
     85else # !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)
     94endif # !VBOX_WITH_XPCOM
    8295ifdef VBOX_OPENGL
    83 #VBoxSDL_LIBS.linux += GL
     96 #VBoxSDL_LIBS.linux += GL
    8497endif
    8598VBoxSDL_LIBPATH.linux = \
    86         $(LIBPATH_XPCOM) \
    8799        /usr/X11R6/lib
    88 VBoxSDL_CXXFLAGS.win = \
    89         -EHsc
    90 VBoxSDL_CXXFLAGS.linux = \
    91         -DNDEBUG -DTRIMMED -O -Wall -fno-rtti -fno-exceptions \
    92         -Wno-non-virtual-dtor -Wno-long-long -fshort-wchar -pthread -pipe
    93100
    94101VBoxSDL_CLEAN = $(PATH_VBoxSDL)/Ico64x01.h
  • trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp

    r522 r614  
    5858#include <iprt/uuid.h>
    5959#include <iprt/ldr.h>
    60 
    61 #include <stdlib.h> /* for alloca */
    62 #include <malloc.h> /* for alloca */
     60#include <iprt/alloca.h>
     61
    6362#include <signal.h>
    6463
     
    441440            event.type      = SDL_USEREVENT;
    442441            event.user.type = SDL_USER_EVENT_TERMINATE;
    443             event.user.code = machineState == MachineState_Aborted 
     442            event.user.code = machineState == MachineState_Aborted
    444443                                           ? VBOXSDL_TERM_ABEND
    445444                                           : VBOXSDL_TERM_NORMAL;
     
    523522};
    524523
    525 #ifdef __LINUX__
     524#ifdef VBOX_WITH_XPCOM
    526525NS_DECL_CLASSINFO(VBoxSDLCallback)
    527526NS_IMPL_ISUPPORTS1_CI(VBoxSDLCallback, IVirtualBoxCallback)
    528527NS_DECL_CLASSINFO(VBoxSDLConsoleCallback)
    529528NS_IMPL_ISUPPORTS1_CI(VBoxSDLConsoleCallback, IConsoleCallback)
    530 #endif /* __LINUX__ */
     529#endif /* VBOX_WITH_XPCOM */
    531530
    532531static void show_usage()
     
    549548             "  -detecthostkey           Get the hostkey identifier and modifier state\n"
    550549             "  -hostkey <key> {<key2>} <mod> Set the host key to the values obtained using -detecthostkey\n"
    551 #ifdef __LINUX__
     550#if defined(__LINUX__) || defined(__DARWIN__) /** @todo UNIXISH_TAP stuff out of main and up to Config.kmk! */
    552551             "  -tapdev<1-N> <dev>       Use existing persistent TAP device with the given name\n"
    553552             "  -tapfd<1-N> <fd>         Use existing TAP device, don't allocate\n"
     
    848847//    EventQueue eventQ;
    849848
    850 #ifdef __LINUX__
     849#ifdef VBOX_WITH_XPCOM
    851850    nsCOMPtr<nsIEventQueue> eventQ;
    852851    NS_GetMainEventQ(getter_AddRefs(eventQ));
    853 #endif /* __LINUX__ */
     852#endif /* VBOX_WITH_XPCOM */
    854853
    855854    /* Get the number of network adapters */
     
    859858    sysInfo->COMGETTER (NetworkAdapterCount) (&NetworkAdapterCount);
    860859
    861 #ifdef __LINUX__
     860#if defined(__LINUX__) || defined(__DARWIN__)
    862861    std::vector <Bstr> tapdev (NetworkAdapterCount);
    863862    std::vector <int> tapfd (NetworkAdapterCount, 0);
     
    10301029            }
    10311030        }
    1032 #ifdef __LINUX__
     1031#if defined(__LINUX__) || defined(__DARWIN__)
    10331032        else if (strncmp(argv[curArg], "-tapdev", 7) == 0)
    10341033        {
     
    10571056            curArg++;
    10581057        }
    1059 #endif /* __LINUX__ */
     1058#endif /* __LINUX__ || __DARWIN__ */
    10601059#ifdef VBOX_VRDP
    10611060        else if (strcmp(argv[curArg], "-vrdp") == 0)
     
    16921691    consoleCallback->ignorePowerOffEvents(true);
    16931692
    1694 #ifdef __LINUX__
     1693#if defined(__LINUX__) || defined(__DARWIN__)
    16951694    /*
    16961695     * Do we have a TAP device name or file descriptor? If so, communicate
     
    17291728        }
    17301729    }
    1731 #endif /* __LINUX__ */
     1730#endif /* __LINUX__ || __DARWIN__ */
    17321731
    17331732#ifdef VBOX_VRDP
     
    18731872    }
    18741873
    1875 #ifdef __LINUX__
     1874#if defined(VBOX_WITH_XPCOM)
    18761875    /*
    18771876     * Before we starting to do stuff, we have to launch the XPCOM
     
    18831882     */
    18841883    startXPCOMEventQueueThread(eventQ->GetEventQueueSelectFD());
    1885 #endif /** __LINUX__ */
     1884#endif /* VBOX_WITH_XPCOM */
    18861885
    18871886    /* termination flag */
     
    19091908             * service the XPCOM event queue!
    19101909             */
    1911 #ifdef __LINUX__
     1910#ifdef VBOX_WITH_XPCOM
    19121911            if (!fXPCOMEventThreadSignaled)
    19131912            {
     
    19471946                    }
    19481947
    1949 #ifdef __LINUX__
     1948#ifdef VBOX_WITH_XPCOM
    19501949                    /*
    19511950                     * User specific XPCOM event queue event
     
    19581957                        break;
    19591958                    }
    1960 #endif /* __LINUX__ */
     1959#endif /* VBOX_WITH_XPCOM */
    19611960
    19621961                    /*
     
    20362035     * Main event loop
    20372036     */
    2038 #ifdef __LINUX__
     2037#ifdef VBOX_WITH_XPCOM
    20392038    if (!fXPCOMEventThreadSignaled)
    20402039    {
     
    20962095                                break;
    20972096                            }
    2098                             enmHKeyState = event.type == SDL_KEYUP ? HKEYSTATE_NORMAL 
     2097                            enmHKeyState = event.type == SDL_KEYUP ? HKEYSTATE_NORMAL
    20992098                                                                 : HKEYSTATE_NOT_IT;
    21002099                            ProcessKey(&EvHKeyDown1.key);
     
    23442343            }
    23452344
    2346 #ifdef __LINUX__
     2345#ifdef VBOX_WITH_XPCOM
    23472346            /*
    23482347             * User specific XPCOM event queue event
     
    23552354                break;
    23562355            }
    2357 #endif /* __LINUX__ */
     2356#endif /* VBOX_WITH_XPCOM */
    23582357
    23592358            /*
     
    24272426leave:
    24282427    LogFlow(("leaving...\n"));
    2429 #ifdef __LINUX__
     2428#ifdef VBOX_WITH_XPCOM
    24302429    /* make sure the XPCOM event queue thread doesn't do anything harmful */
    24312430    terminateXPCOMQueueThread();
    2432 #endif /* __LINUX__ */
     2431#endif /* VBOX_WITH_XPCOM */
    24332432
    24342433#ifdef VBOX_VRDP
  • trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.h

    r522 r614  
    2424#define __H_VBOXSDL
    2525
     26#ifdef __WIN__ /** @todo check why we need to do this on windows. */
    2627/* convince SDL to not overload main() */
    2728#define _SDL_main_h
     29#endif
    2830/* include this first so Windows.h get's in before our stuff. */
    2931#include <SDL.h>
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette