Back to index

lightning-sunbird  0.9+nobinonly
Classes | Functions
nsNativeAppSupportBeOS.cpp File Reference
#include "nsStringSupport.h"
#include "nsNativeAppSupportBase.h"
#include "nsIObserver.h"
#include "nsICmdLineService.h"
#include "nsIBrowserDOMWindow.h"
#include "nsIScriptGlobalObject.h"
#include "nsIDOMWindowInternal.h"
#include "nsIDOMChromeWindow.h"
#include "nsIWindowMediator.h"
#include "nsIURI.h"
#include "nsIURIFixup.h"
#include "nsCDefaultURIFixup.h"
#include "nsIProxyObjectManager.h"
#include "nsXPFEComponentsCID.h"
#include "nsIAppStartup.h"
#include "nsIComponentManager.h"
#include "nsIAppShellService.h"
#include "nsVoidArray.h"
#include "nsIBaseWindow.h"
#include "nsIWidget.h"
#include "nsIDocShell.h"
#include <Application.h>
#include <AppFileInfo.h>
#include <Window.h>
#include <View.h>
#include <StringView.h>
#include <Bitmap.h>
#include <Screen.h>
#include <Font.h>
#include <Resources.h>
#include <Path.h>
#include <stdlib.h>

Go to the source code of this file.

Classes

class  nsNativeAppSupportBeOS
class  nsBeOSApp

Functions

static nsresult GetMostRecentWindow (const PRUnichar *aType, nsIDOMWindowInternal **aWindow)
static nsresult ActivateWindow (nsIDOMWindowInternal *aWindow)
nsresult NS_CreateNativeAppSupport (nsINativeAppSupport **aResult)
 Create the nativeappsupport implementation.

Function Documentation

static nsresult ActivateWindow ( nsIDOMWindowInternal aWindow) [static]

Definition at line 107 of file nsNativeAppSupportBeOS.cpp.

{
       nsCOMPtr<nsIScriptGlobalObject> window(do_QueryInterface(aWindow));
       NS_ENSURE_TRUE(window, NS_ERROR_FAILURE);

       nsCOMPtr<nsIBaseWindow> baseWindow(do_QueryInterface(window->GetDocShell()));
       NS_ENSURE_TRUE(baseWindow, NS_ERROR_FAILURE);
       nsCOMPtr<nsIWidget> mainWidget;
       baseWindow->GetMainWidget(getter_AddRefs(mainWidget));
       NS_ENSURE_TRUE(mainWidget, NS_ERROR_FAILURE);
       BWindow *bwindow = (BWindow *)(mainWidget->GetNativeData(NS_NATIVE_WINDOW));
       if (bwindow)
       {
              bwindow->SetWorkspaces(B_CURRENT_WORKSPACE);
              bwindow->Activate(true);
       }
       return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static nsresult GetMostRecentWindow ( const PRUnichar aType,
nsIDOMWindowInternal **  aWindow 
) [static]

Definition at line 87 of file nsNativeAppSupportBeOS.cpp.

{
       nsresult rv;
       nsCOMPtr<nsIWindowMediator> med(do_GetService( NS_WINDOWMEDIATOR_CONTRACTID, &rv));
       if (NS_FAILED(rv))
       {
#ifdef DC_PROGRAMNAME
              TRACE("no med");
#endif
              return rv;
       }

       if (med)
              return med->GetMostRecentWindow(aType, aWindow);
       return NS_ERROR_FAILURE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Create the nativeappsupport implementation.

Note:
XPCOMInit has not happened yet.

Definition at line 272 of file nsNativeAppSupportBeOS.cpp.

{
    if(!aResult) 
        return NS_ERROR_NULL_POINTER;
    
    nsNativeAppSupportBeOS *pNative = new nsNativeAppSupportBeOS();
    if (!pNative)
        return NS_ERROR_OUT_OF_MEMORY;

    *aResult = pNative;
    NS_ADDREF(*aResult);
    return NS_OK;
}

Here is the call graph for this function: