From 4d3db7ecea707b7ed5e9ef6abb3265fa85be195d Mon Sep 17 00:00:00 2001 From: "joshmoz%gmail.com" Date: Mon, 4 Jul 2005 20:25:26 +0000 Subject: [PATCH] get cocoa widgets running in Firefox. this means the app launches, but you probably don't want to use it as you have windows with no menu bar :) Also some macro cleanup. only a few lines of codein a component that isn't used, so no reviews necessary. git-svn-id: svn://10.0.0.236/trunk@175584 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/widget/src/cocoa/nsAppShellCocoa.h | 2 +- mozilla/widget/src/cocoa/nsAppShellCocoa.mm | 12 ++++++++---- mozilla/widget/src/cocoa/nsCocoaWindow.mm | 8 -------- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/mozilla/widget/src/cocoa/nsAppShellCocoa.h b/mozilla/widget/src/cocoa/nsAppShellCocoa.h index a621e783722..f050a8e7f27 100644 --- a/mozilla/widget/src/cocoa/nsAppShellCocoa.h +++ b/mozilla/widget/src/cocoa/nsAppShellCocoa.h @@ -60,7 +60,7 @@ class nsAppShellCocoa : public nsIAppShell NS_DECL_NSIAPPSHELL private: - + NSAutoreleasePool *mainPool; }; diff --git a/mozilla/widget/src/cocoa/nsAppShellCocoa.mm b/mozilla/widget/src/cocoa/nsAppShellCocoa.mm index e6f0f6b50c6..530c26719c4 100644 --- a/mozilla/widget/src/cocoa/nsAppShellCocoa.mm +++ b/mozilla/widget/src/cocoa/nsAppShellCocoa.mm @@ -60,6 +60,7 @@ NS_IMPL_THREADSAFE_ISUPPORTS1(nsAppShellCocoa, nsIAppShell) //------------------------------------------------------------------------- nsAppShellCocoa::nsAppShellCocoa() { + mainPool = [[NSAutoreleasePool alloc] init]; } //------------------------------------------------------------------------- @@ -69,6 +70,7 @@ nsAppShellCocoa::nsAppShellCocoa() //------------------------------------------------------------------------- nsAppShellCocoa::~nsAppShellCocoa() { + [mainPool release]; } @@ -76,15 +78,17 @@ nsAppShellCocoa::~nsAppShellCocoa() // // Create the application shell // +// There's reallly not a whole lot that needs to be done here. The +// window will register its own interest in the necessary events +// so there's no need for us to create a pump or a sink. +// //------------------------------------------------------------------------- NS_IMETHODIMP nsAppShellCocoa::Create(int* argc, char ** argv) { - // There's reallly not a whole lot that needs to be done here. The - // window will register its own interest in the necessary events - // so there's no need for us to create a pump or a sink. - + // this call initializes NSApplication + [NSApplication sharedApplication]; return NS_OK; } diff --git a/mozilla/widget/src/cocoa/nsCocoaWindow.mm b/mozilla/widget/src/cocoa/nsCocoaWindow.mm index 264cc42a13c..a48def919bc 100644 --- a/mozilla/widget/src/cocoa/nsCocoaWindow.mm +++ b/mozilla/widget/src/cocoa/nsCocoaWindow.mm @@ -59,16 +59,8 @@ #include -#if UNIVERSAL_INTERFACES_VERSION < 0x0340 -enum { - kEventWindowConstrain = 83 -}; -const UInt32 kWindowLiveResizeAttribute = (1L << 28); -#endif - // Define Class IDs -- i hate having to do this static NS_DEFINE_CID(kCDragServiceCID, NS_DRAGSERVICE_CID); -//static const char *sScreenManagerContractID = "@mozilla.org/gfx/screenmanager;1"; // from MacHeaders.c #ifndef topLeft