зеркало из https://github.com/mozilla/pjs.git
More Carbon usage cleanup. b=550787 r=bsmedberg
This commit is contained in:
Родитель
b64cf6455e
Коммит
fcb9bf889c
|
@ -56,7 +56,7 @@
|
|||
#include "nsStringAPI.h"
|
||||
|
||||
#include <CoreFoundation/CoreFoundation.h>
|
||||
#include <Carbon/Carbon.h>
|
||||
#include <ApplicationServices/ApplicationServices.h>
|
||||
|
||||
#define NETWORK_PREFPANE NS_LITERAL_CSTRING("/System/Library/PreferencePanes/Network.prefPane")
|
||||
#define DESKTOP_PREFPANE NS_LITERAL_CSTRING("/System/Library/PreferencePanes/DesktopScreenEffectsPref.prefPane")
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
#if defined(XP_WIN)
|
||||
#include <windows.h>
|
||||
#elif defined(XP_MACOSX)
|
||||
#include <Carbon/Carbon.h>
|
||||
#include <CoreServices/CoreServices.h>
|
||||
#elif defined(MOZ_WIDGET_GTK2)
|
||||
#include <gtk/gtk.h>
|
||||
#endif
|
||||
|
|
|
@ -39,7 +39,6 @@
|
|||
#include "npapi.h"
|
||||
#include "npfunctions.h"
|
||||
|
||||
#include <Carbon/Carbon.h>
|
||||
#include <CoreFoundation/CoreFoundation.h>
|
||||
|
||||
#pragma GCC visibility push(default)
|
||||
|
|
|
@ -86,7 +86,7 @@
|
|||
#endif
|
||||
|
||||
#if defined(XP_MACOSX)
|
||||
#include <Carbon/Carbon.h>
|
||||
#include <CoreServices/CoreServices.h>
|
||||
#endif
|
||||
|
||||
#if defined(XP_OS2)
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
|
||||
#include "nsString.h"
|
||||
|
||||
#import <Carbon/Carbon.h>
|
||||
#import <CoreServices/CoreServices.h>
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
|
@ -59,24 +59,32 @@
|
|||
#include "nsIWidget.h"
|
||||
#include "nsIWindowMediator.h"
|
||||
|
||||
const OSType kNSCreator = 'MOSS';
|
||||
const OSType kMozCreator = 'MOZZ';
|
||||
const SInt16 kNSCanRunStrArrayID = 1000;
|
||||
const SInt16 kAnotherVersionStrIndex = 1;
|
||||
|
||||
nsresult
|
||||
GetNativeWindowPointerFromDOMWindow(nsIDOMWindowInternal *window, NSWindow **nativeWindow);
|
||||
GetNativeWindowPointerFromDOMWindow(nsIDOMWindowInternal *a_window, NSWindow **a_nativeWindow)
|
||||
{
|
||||
*a_nativeWindow = nil;
|
||||
if (!a_window)
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
|
||||
const SInt16 kNSOSVersErrsStrArrayID = 1001;
|
||||
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 = (NSWindow*)mruWidget->GetNativeData(NS_NATIVE_WINDOW);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
enum {
|
||||
eOSXVersTooOldErrIndex = 1,
|
||||
eOSXVersTooOldExplanationIndex,
|
||||
eContinueButtonTextIndex,
|
||||
eQuitButtonTextIndex,
|
||||
eCarbonLibVersTooOldIndex,
|
||||
eCarbonLibVersTooOldExplanationIndex
|
||||
};
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
class nsNativeAppSupportCocoa : public nsNativeAppSupportBase
|
||||
{
|
||||
|
@ -210,31 +218,6 @@ nsNativeAppSupportCocoa::ReOpen()
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
}
|
||||
|
||||
nsresult
|
||||
GetNativeWindowPointerFromDOMWindow(nsIDOMWindowInternal *a_window, NSWindow **a_nativeWindow)
|
||||
{
|
||||
*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 = (NSWindow*)mruWidget->GetNativeData(NS_NATIVE_WINDOW);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
|
||||
// Create and return an instance of class nsNativeAppSupportCocoa.
|
||||
|
|
|
@ -35,7 +35,8 @@
|
|||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#import <Carbon/Carbon.h>
|
||||
#import <CoreFoundation/CoreFoundation.h>
|
||||
#import <ApplicationServices/ApplicationServices.h>
|
||||
|
||||
#include "nsObjCExceptions.h"
|
||||
#include "nsLocalHandlerAppMac.h"
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#import <Carbon/Carbon.h>
|
||||
#import <ApplicationServices/ApplicationServices.h>
|
||||
|
||||
#include "nsObjCExceptions.h"
|
||||
#include "nsMIMEInfoMac.h"
|
||||
|
|
|
@ -56,7 +56,8 @@
|
|||
#include "nsMIMEInfoMac.h"
|
||||
#include "nsEmbedCID.h"
|
||||
|
||||
#import <Carbon/Carbon.h>
|
||||
#import <CoreFoundation/CoreFoundation.h>
|
||||
#import <ApplicationServices/ApplicationServices.h>
|
||||
|
||||
// chrome URL's
|
||||
#define HELPERAPPLAUNCHER_BUNDLE_URL "chrome://global/locale/helperAppLauncher.properties"
|
||||
|
|
|
@ -43,8 +43,6 @@
|
|||
#include "nsCocoaUtils.h"
|
||||
#include "nsCocoaTextInputHandler.h"
|
||||
|
||||
#import <Carbon/Carbon.h>
|
||||
|
||||
NS_IMPL_ISUPPORTS1(nsBidiKeyboard, nsIBidiKeyboard)
|
||||
|
||||
nsBidiKeyboard::nsBidiKeyboard() : nsIBidiKeyboard()
|
||||
|
|
|
@ -41,7 +41,6 @@
|
|||
#include "nsIServiceManager.h"
|
||||
#include "nsNativeThemeColors.h"
|
||||
|
||||
#import <Carbon/Carbon.h>
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
nsLookAndFeel::nsLookAndFeel() : nsXPLookAndFeel()
|
||||
|
|
|
@ -51,7 +51,6 @@ class nsIContent;
|
|||
class imgIRequest;
|
||||
class nsMenuObjectX;
|
||||
|
||||
#import <Carbon/Carbon.h>
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
class nsMenuItemIconX : public imgIDecoderObserver
|
||||
|
|
|
@ -44,14 +44,11 @@
|
|||
#include "nsMenuBaseX.h"
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import <Carbon/Carbon.h>
|
||||
|
||||
class nsIContent;
|
||||
class nsString;
|
||||
class nsMenuBarX;
|
||||
|
||||
extern "C" MenuRef _NSGetCarbonMenu(NSMenu* aMenu);
|
||||
|
||||
// Namespace containing utility functions used in our native menu implementation.
|
||||
namespace nsMenuUtilsX
|
||||
{
|
||||
|
|
|
@ -53,6 +53,8 @@
|
|||
#include "nsPIDOMWindow.h"
|
||||
#include "nsIDOMAbstractView.h"
|
||||
|
||||
#include <Carbon/Carbon.h>
|
||||
|
||||
void nsMenuUtilsX::DispatchCommandTo(nsIContent* aTargetContent)
|
||||
{
|
||||
NS_PRECONDITION(aTargetContent, "null ptr");
|
||||
|
|
|
@ -48,7 +48,6 @@
|
|||
#include <mach/mach_init.h>
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import <Carbon/Carbon.h>
|
||||
#import <IOKit/pwr_mgt/IOPMLib.h>
|
||||
#import <IOKit/IOMessage.h>
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче