Back to index

lightning-sunbird  0.9+nobinonly
Classes | Enumerations | Functions | Variables
nsNativeAppSupportMac.cpp File Reference
#include "nsString.h"
#include <Gestalt.h>
#include <Dialogs.h>
#include <Resources.h>
#include <TextUtils.h>
#include <ControlDefinitions.h>
#include "nsCOMPtr.h"
#include "nsNativeAppSupportBase.h"
#include "nsIAppShellService.h"
#include "nsIAppStartup.h"
#include "nsIBaseWindow.h"
#include "nsICommandLineRunner.h"
#include "nsIDOMWindowInternal.h"
#include "nsIDocShellTreeItem.h"
#include "nsIDocShellTreeOwner.h"
#include "nsIInterfaceRequestorUtils.h"
#include "nsIObserver.h"
#include "nsIServiceManager.h"
#include "nsIWebNavigation.h"
#include "nsIWidget.h"
#include "nsIWindowMediator.h"
#include "nsXPFEComponentsCID.h"

Go to the source code of this file.

Classes

class  nsNativeAppSupportMac

Enumerations

enum  {
  eOSXVersTooOldErrIndex = 1, eOSXVersTooOldExplanationIndex, eContinueButtonTextIndex, eQuitButtonTextIndex,
  eCarbonLibVersTooOldIndex, eCarbonLibVersTooOldExplanationIndex
}

Functions

static Boolean VersGreaterThan4 (const FSSpec *fSpec)
nsresult GetNativeWindowPointerFromDOMWindow (nsIDOMWindowInternal *window, WindowRef *nativeWindow)
nsresult NS_CreateNativeAppSupport (nsINativeAppSupport **aResult)
 Create the nativeappsupport implementation.

Variables

const OSType kNSCreator = 'MOSS'
const OSType kMozCreator = 'MOZZ'
const SInt16 kNSCanRunStrArrayID = 1000
const SInt16 kAnotherVersionStrIndex = 1
const SInt16 kNSOSVersErrsStrArrayID = 1001

Enumeration Type Documentation

anonymous enum
Enumerator:
eOSXVersTooOldErrIndex 
eOSXVersTooOldExplanationIndex 
eContinueButtonTextIndex 
eQuitButtonTextIndex 
eCarbonLibVersTooOldIndex 
eCarbonLibVersTooOldExplanationIndex 

Definition at line 77 of file nsNativeAppSupportMac.cpp.


Function Documentation

nsresult GetNativeWindowPointerFromDOMWindow ( nsIDOMWindowInternal window,
WindowRef *  nativeWindow 
)

Definition at line 277 of file nsNativeAppSupportMac.cpp.

{
    *a_nativeWindow = nil;
    if (!a_window) return NS_ERROR_INVALID_ARG;
    
    nsCOMPtr<nsIWebNavigation> mruWebNav(do_GetInterface(a_window));
    if (mruWebNav)
    {
      nsCOMPtr<nsIDocShellTreeItem> mruTreeItem(do_QueryInterface(mruWebNav));
      nsCOMPtr<nsIDocShellTreeOwner> mruTreeOwner = nsnull;
      mruTreeItem->GetTreeOwner(getter_AddRefs(mruTreeOwner));
      if(mruTreeOwner)
      {
        nsCOMPtr<nsIBaseWindow> mruBaseWindow(do_QueryInterface(mruTreeOwner));
        if (mruBaseWindow)
        {
          nsCOMPtr<nsIWidget> mruWidget = nsnull;
          mruBaseWindow->GetMainWidget(getter_AddRefs(mruWidget));
          if (mruWidget)
          {
            *a_nativeWindow = (WindowRef)mruWidget->GetNativeData(NS_NATIVE_DISPLAY);
          }
        }
      }
    }
    return NS_OK;
}

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 308 of file nsNativeAppSupportMac.cpp.

{
  *aResult = new nsNativeAppSupportMac;
  if (!*aResult) return NS_ERROR_OUT_OF_MEMORY;

  NS_ADDREF( *aResult );
  return NS_OK;
}

Here is the call graph for this function:

static Boolean VersGreaterThan4 ( const FSSpec fSpec) [static]

Variable Documentation

Definition at line 70 of file nsNativeAppSupportMac.cpp.

Definition at line 68 of file nsNativeAppSupportMac.cpp.

const SInt16 kNSCanRunStrArrayID = 1000

Definition at line 69 of file nsNativeAppSupportMac.cpp.

Definition at line 67 of file nsNativeAppSupportMac.cpp.

Definition at line 75 of file nsNativeAppSupportMac.cpp.