carbon changes. r=pink/sdagley/beard. a=sfraser.

This commit is contained in:
pinkerton%netscape.com 2001-02-13 21:48:26 +00:00
Родитель b593b4e3a4
Коммит 105d3c555e
55 изменённых файлов: 424 добавлений и 2579 удалений

Просмотреть файл

@ -46,6 +46,7 @@ mailextras 1
xptlink 0
psm 0
embedding_test 1
carbon 0
filepath_flags
idepath ":CodeWarrior IDE Path.txt"

Просмотреть файл

@ -1314,7 +1314,8 @@ sub BuildLayoutProjects()
BuildOneProject(":mozilla:expat:macbuild:expat.mcp", "expat$D.o", 0, 0, 0);
BuildOneProject(":mozilla:htmlparser:macbuild:htmlparser.mcp", "htmlparser$D.shlb", 1, $main::ALIAS_SYM_FILES, 1);
BuildOneProject(":mozilla:gfx:macbuild:gfx.mcp", "gfx$D.shlb", 1, $main::ALIAS_SYM_FILES, 0);
# BuildOneProject(":mozilla:gfx:macbuild:gfx.mcp", "gfx$D.shlb", 1, $main::ALIAS_SYM_FILES, 0);
BuildOneProjectWithOutput(":mozilla:gfx:macbuild:gfx.mcp", "gfx$C$D.shlb", "gfx$D.shlb", 1, $main::ALIAS_SYM_FILES, 0);
BuildOneProject(":mozilla:dom:macbuild:dom.mcp", "dom$D.shlb", 1, $main::ALIAS_SYM_FILES, 0);
BuildOneProject(":mozilla:modules:plugin:macbuild:plugin.mcp", "plugin$D.shlb", 1, $main::ALIAS_SYM_FILES, 1);
BuildOneProject(":mozilla:layout:macbuild:layoutxsl.mcp", "layoutxsl$D.o", 0, 0, 0);

Просмотреть файл

@ -29,7 +29,6 @@
*/
/* enable to start building for Carbon */
#define TARGET_CARBON 0
#if TARGET_CARBON
#define PP_Target_Carbon 1
#define OLDP2C 1

Просмотреть файл

@ -23,8 +23,6 @@
#ifndef DefinesMozilla_h_
#define DefinesMozilla_h_
#include "DefinesOptions.h" // written at build time
// *** Security
//#define NADA_VERSION
//#define EXPORT_VERSION

Просмотреть файл

@ -34,6 +34,9 @@
/* Read compiler options */
#include "IDE_Options.h"
/* Read generated build options. */
#include "DefinesOptions.h" // written at build time
/* Read file of defines global to the Mac build */
#include "DefinesMac.h"

Просмотреть файл

@ -101,7 +101,7 @@
#if defined(__cplusplus)
#define __inline inline /* convert to C++ keyword */
#else
#ifndef __GNUC__
#if !defined(__GNUC__) && !defined(__MWERKS__)
#define __inline /* delete GCC keyword */
#endif /* !__GNUC__ */
#endif /* !__cplusplus */

Просмотреть файл

@ -47,9 +47,7 @@ static char sccsid[] = "@(#)db.c 8.4 (Berkeley) 2/21/94";
#endif
#include <errno.h>
#ifndef macintosh
#include <fcntl.h>
#endif
#include <stddef.h>
#include <stdio.h>

Просмотреть файл

@ -66,10 +66,12 @@ static char sccsid[] = "@(#)hash_page.c 8.7 (Berkeley) 8/16/94";
#include <sys/types.h>
#endif
#include <errno.h>
#ifndef macintosh
#include <fcntl.h>
#if defined(macintosh)
#include <unistd.h>
#endif
#include <errno.h>
#include <fcntl.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>

Просмотреть файл

@ -51,12 +51,13 @@ static char sccsid[] = "@(#)hash.c 8.9 (Berkeley) 6/16/94";
#include <sys/stat.h>
#endif
#include <errno.h>
#ifdef macintosh
#if defined(macintosh)
#include <unix.h>
#else
#include <fcntl.h>
#include <unistd.h>
#endif
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

Просмотреть файл

@ -42,9 +42,9 @@ static char sccsid[] = "@(#)hsearch.c 8.4 (Berkeley) 7/21/94";
#ifndef macintosh
#include <sys/types.h>
#endif
#include <fcntl.h>
#endif
#include <string.h>
#include "mcom_db.h"

Двоичные данные
gfx/macbuild/gfx.mcp

Двоичный файл не отображается.

Просмотреть файл

@ -24,6 +24,7 @@
#include "nsDeviceContextMac.h"
#include "nsRenderingContextMac.h"
#include "nsDeviceContextSpecMac.h"
#include "nsIPrintingContext.h"
#include "nsString.h"
#include "nsHashtable.h"
#include "nsFont.h"
@ -671,10 +672,9 @@ NS_IMETHODIMP nsDeviceContextMac::GetClientRect(nsRect &aRect)
NS_IMETHODIMP nsDeviceContextMac::GetDeviceContextFor(nsIDeviceContextSpec *aDevice,nsIDeviceContext *&aContext)
{
GrafPtr curPort;
THPrint thePrintRecord; // handle to print record
double pix_Inch;
nsDeviceContextMac *macDC;
GrafPtr curPort;
double pix_Inch;
nsDeviceContextMac *macDC;
aContext = new nsDeviceContextMac();
macDC = (nsDeviceContextMac*)aContext;
@ -682,22 +682,35 @@ nsDeviceContextMac *macDC;
NS_ADDREF(aDevice);
::GetPort(&curPort);
thePrintRecord = ((nsDeviceContextSpecMac*)aDevice)->mPrtRec;
#if !TARGET_CARBON
THPrint thePrintRecord = ((nsDeviceContextSpecMac*)aDevice)->mPrtRec;
pix_Inch = (**thePrintRecord).prInfo.iHRes;
macDC->mPageRect = (**thePrintRecord).prInfo.rPage;
#else
nsCOMPtr<nsIPrintingContext> printingContext = do_QueryInterface(aDevice);
if (printingContext) {
if (NS_FAILED(printingContext->GetPrinterResolution(&pix_Inch)))
pix_Inch = 72.0;
double top, left, bottom, right;
printingContext->GetPageRect(&top, &left, &bottom, &right);
Rect& pageRect = macDC->mPageRect;
pageRect.top = top, pageRect.left = left;
pageRect.bottom = bottom, pageRect.right = right;
}
#endif
((nsDeviceContextMac*)aContext)->Init(curPort);
macDC->mPageRect = (**thePrintRecord).prInfo.rPage;
macDC->mTwipsToPixels = pix_Inch/(float)NSIntPointsToTwips(72);
macDC->mPixelsToTwips = 1.0f/macDC->mTwipsToPixels;
macDC->mAppUnitsToDevUnits = macDC->mTwipsToPixels;
macDC->mDevUnitsToAppUnits = 1.0f / macDC->mAppUnitsToDevUnits;
macDC->mAppUnitsToDevUnits = macDC->mTwipsToPixels;
macDC->mDevUnitsToAppUnits = 1.0f / macDC->mAppUnitsToDevUnits;
macDC->mCPixelScale = macDC->mTwipsToPixels / mTwipsToPixels;
macDC->mCPixelScale = macDC->mTwipsToPixels / mTwipsToPixels;
//((nsDeviceContextMac*)aContext)->Init(this);
return NS_OK;
return NS_OK;
}
@ -717,8 +730,14 @@ GrafPtr thePort;
SetDrawingSurface(((nsDeviceContextSpecMac*)(this->mSpec))->mPrtRec);
SetPort(thePort);
}
#endif
return NS_OK;
#else
nsresult rv = NS_ERROR_FAILURE;
nsCOMPtr<nsIPrintingContext> printingContext = do_QueryInterface(mSpec);
if (printingContext)
rv = printingContext->BeginDocument();
return rv;
#endif
}
@ -728,13 +747,19 @@ GrafPtr thePort;
*/
NS_IMETHODIMP nsDeviceContextMac::EndDocument(void)
{
#if !TARGET_CARBON
if(((nsDeviceContextSpecMac*)(this->mSpec))->mPrintManagerOpen){
::SetPort(mOldPort);
#if !TARGET_CARBON
::PrCloseDoc(((nsDeviceContextSpecMac*)(this->mSpec))->mPrinterPort);
#endif
}
return NS_OK;
return NS_OK;
#else
nsresult rv = NS_ERROR_FAILURE;
nsCOMPtr<nsIPrintingContext> printingContext = do_QueryInterface(mSpec);
if (printingContext)
rv = printingContext->EndDocument();
return rv;
#endif
}
@ -747,8 +772,14 @@ NS_IMETHODIMP nsDeviceContextMac::BeginPage(void)
#if !TARGET_CARBON
if(((nsDeviceContextSpecMac*)(this->mSpec))->mPrintManagerOpen)
::PrOpenPage(((nsDeviceContextSpecMac*)(this->mSpec))->mPrinterPort,nsnull);
#endif
return NS_OK;
#else
nsresult rv = NS_ERROR_FAILURE;
nsCOMPtr<nsIPrintingContext> printingContext = do_QueryInterface(mSpec);
if (printingContext)
rv = printingContext->BeginPage();
return rv;
#endif
}
@ -763,8 +794,14 @@ NS_IMETHODIMP nsDeviceContextMac::EndPage(void)
::SetPort((GrafPtr)(((nsDeviceContextSpecMac*)(this->mSpec))->mPrinterPort));
::PrClosePage(((nsDeviceContextSpecMac*)(this->mSpec))->mPrinterPort);
}
return NS_OK;
#else
nsresult rv = NS_ERROR_FAILURE;
nsCOMPtr<nsIPrintingContext> printingContext = do_QueryInterface(mSpec);
if (printingContext)
rv = printingContext->EndPage();
return rv;
#endif
return NS_OK;
}

Просмотреть файл

@ -21,7 +21,8 @@
*/
#include "nsDeviceContextSpecFactoryM.h"
#include "nsDeviceContextSpecMac.h"
#include "nsIDeviceContextSpec.h"
#include "nsIPrintingContext.h"
#include "nsGfxCIID.h"
#include "plstr.h"
@ -42,13 +43,7 @@ nsDeviceContextSpecFactoryMac :: ~nsDeviceContextSpecFactoryMac()
{
}
static NS_DEFINE_IID(kDeviceContextSpecFactoryIID, NS_IDEVICE_CONTEXT_SPEC_FACTORY_IID);
static NS_DEFINE_IID(kIDeviceContextSpecIID, NS_IDEVICE_CONTEXT_SPEC_IID);
static NS_DEFINE_IID(kDeviceContextSpecCID, NS_DEVICE_CONTEXT_SPEC_CID);
NS_IMPL_QUERY_INTERFACE(nsDeviceContextSpecFactoryMac, kDeviceContextSpecFactoryIID)
NS_IMPL_ADDREF(nsDeviceContextSpecFactoryMac)
NS_IMPL_RELEASE(nsDeviceContextSpecFactoryMac)
NS_IMPL_ISUPPORTS1(nsDeviceContextSpecFactoryMac, nsIDeviceContextSpecFactory)
/** -------------------------------------------------------
* Initialize the device context spec factory
@ -56,7 +51,7 @@ NS_IMPL_RELEASE(nsDeviceContextSpecFactoryMac)
*/
NS_IMETHODIMP nsDeviceContextSpecFactoryMac :: Init(void)
{
return NS_OK;
return NS_OK;
}
/** -------------------------------------------------------
@ -67,16 +62,18 @@ NS_IMETHODIMP nsDeviceContextSpecFactoryMac :: CreateDeviceContextSpec(nsIWidget
nsIDeviceContextSpec *&aNewSpec,
PRBool aQuiet)
{
nsresult rv = NS_ERROR_FAILURE;
nsIDeviceContextSpec *devSpec = nsnull;
nsComponentManager::CreateInstance(kDeviceContextSpecCID, nsnull, kIDeviceContextSpecIID, (void **)&devSpec);
if (nsnull != devSpec){
if (NS_OK == ((nsDeviceContextSpecMac *)devSpec)->Init(aQuiet)){
aNewSpec = devSpec;
rv = NS_OK;
}
nsresult rv;
static NS_DEFINE_CID(kDeviceContextSpecCID, NS_DEVICE_CONTEXT_SPEC_CID);
nsCOMPtr<nsIDeviceContextSpec> devSpec = do_CreateInstance(kDeviceContextSpecCID, &rv);
if (NS_SUCCEEDED(rv)) {
nsCOMPtr<nsIPrintingContext> printingContext = do_QueryInterface(devSpec, &rv);
if (NS_SUCCEEDED(rv)) {
rv = printingContext->Init(aQuiet);
if (NS_SUCCEEDED(rv)) {
aNewSpec = devSpec;
NS_ADDREF(aNewSpec);
}
}
}
return rv;
}

Просмотреть файл

@ -55,9 +55,7 @@ nsDeviceContextSpecMac :: ~nsDeviceContextSpecMac()
static NS_DEFINE_IID(kDeviceContextSpecIID, NS_IDEVICE_CONTEXT_SPEC_IID);
NS_IMPL_QUERY_INTERFACE(nsDeviceContextSpecMac, kDeviceContextSpecIID)
NS_IMPL_ADDREF(nsDeviceContextSpecMac)
NS_IMPL_RELEASE(nsDeviceContextSpecMac)
NS_IMPL_ISUPPORTS2(nsDeviceContextSpecMac, nsIDeviceContextSpec, nsIPrintingContext)
/** -------------------------------------------------------
* Initialize the nsDeviceContextSpecMac
@ -115,3 +113,39 @@ PRBool isPMOpen;
return NS_OK;
}
NS_IMETHODIMP nsDeviceContextSpecMac::BeginDocument()
{
nsresult rv = NS_OK;
return rv;
}
NS_IMETHODIMP nsDeviceContextSpecMac::EndDocument()
{
nsresult rv = NS_OK;
return rv;
}
NS_IMETHODIMP nsDeviceContextSpecMac::BeginPage()
{
nsresult rv = NS_OK;
return rv;
}
NS_IMETHODIMP nsDeviceContextSpecMac::EndPage()
{
nsresult rv = NS_OK;
return rv;
}
NS_IMETHODIMP nsDeviceContextSpecMac::GetPrinterResolution(double* aResolution)
{
nsresult rv = NS_OK;
return rv;
}
NS_IMETHODIMP nsDeviceContextSpecMac::GetPageRect(double* aTop, double* aLeft, double* aBottom, double* aRight)
{
nsresult rv = NS_OK;
return rv;
}

Просмотреть файл

@ -24,11 +24,11 @@
#define nsDeviceContextSpecMac_h___
#include "nsIDeviceContextSpec.h"
#include "nsIPrintingContext.h"
#include "nsDeviceContextMac.h"
#include <Printing.h>
class nsDeviceContextSpecMac : public nsIDeviceContextSpec
{
class nsDeviceContextSpecMac : public nsIDeviceContextSpec, public nsIPrintingContext {
public:
/**
* Construct a nsDeviceContextSpecMac, which is an object which contains and manages a mac printrecord
@ -65,6 +65,17 @@ public:
*/
NS_IMETHOD ClosePrintManager();
NS_IMETHOD BeginDocument();
NS_IMETHOD EndDocument();
NS_IMETHOD BeginPage();
NS_IMETHOD EndPage();
NS_IMETHOD GetPrinterResolution(double* aResolution);
NS_IMETHOD GetPageRect(double* aTop, double* aLeft, double* aBottom, double* aRight);
protected:
/**
* Destuct a nsDeviceContextSpecMac, this will release the printrecord

Просмотреть файл

@ -32,6 +32,9 @@
#include "nsScriptableRegion.h"
#include "nsIImageManager.h"
#include "nsDeviceContextSpecMac.h"
#if TARGET_CARBON
#include "nsDeviceContextSpecX.h"
#endif
#include "nsDeviceContextSpecFactoryM.h"
#include "nsScreenManagerMac.h"
#include "nsBlender.h"
@ -124,7 +127,13 @@ nsresult nsGfxFactoryMac::CreateInstance(nsISupports *aOuter,
}
}
else if (mClassID.Equals(kCDeviceContextSpec)) {
NS_NEWXPCOM(inst, nsDeviceContextSpecMac);
nsCOMPtr<nsIDeviceContextSpec> dcSpec;
#if TARGET_CARBON
NS_NEWXPCOM(dcSpec, nsDeviceContextSpecX);
#else
NS_NEWXPCOM(dcSpec, nsDeviceContextSpecMac);
#endif
inst = dcSpec;
}
else if (mClassID.Equals(kCPrintOptions)) {
NS_NEWXPCOM(inst, nsPrintOptionsMac);

Просмотреть файл

@ -22,7 +22,7 @@
/*
* npupp.h $Revision: 3.3 $
* npupp.h $Revision: 3.4 $
* function call mecahnics needed by platform specific glue code.
*/
@ -56,7 +56,9 @@
/* NPP_Initialize */
#if TARGET_RT_MAC_CFM
#define _NPUPP_USE_UPP_ (TARGET_RT_MAC_CFM && !TARGET_API_MAC_CARBON)
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPP_InitializeUPP;
enum {
@ -83,7 +85,7 @@ typedef void (* NP_LOADDS NPP_InitializeUPP)(void);
/* NPP_Shutdown */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPP_ShutdownUPP;
enum {
@ -110,7 +112,7 @@ typedef void (* NP_LOADDS NPP_ShutdownUPP)(void);
/* NPP_New */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPP_NewUPP;
enum {
@ -143,7 +145,7 @@ typedef NPError (* NP_LOADDS NPP_NewUPP)(NPMIMEType pluginType, NPP instance, ui
/* NPP_Destroy */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPP_DestroyUPP;
enum {
@ -169,7 +171,7 @@ typedef NPError (* NP_LOADDS NPP_DestroyUPP)(NPP instance, NPSavedData** save);
/* NPP_SetWindow */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPP_SetWindowUPP;
enum {
@ -196,7 +198,7 @@ typedef NPError (* NP_LOADDS NPP_SetWindowUPP)(NPP instance, NPWindow* window);
/* NPP_NewStream */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPP_NewStreamUPP;
enum {
@ -224,7 +226,7 @@ typedef NPError (* NP_LOADDS NPP_NewStreamUPP)(NPP instance, NPMIMEType type, NP
/* NPP_DestroyStream */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPP_DestroyStreamUPP;
enum {
@ -252,7 +254,7 @@ typedef NPError (* NP_LOADDS NPP_DestroyStreamUPP)(NPP instance, NPStream* strea
/* NPP_WriteReady */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPP_WriteReadyUPP;
enum {
@ -279,7 +281,7 @@ typedef int32 (* NP_LOADDS NPP_WriteReadyUPP)(NPP instance, NPStream* stream);
/* NPP_Write */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPP_WriteUPP;
enum {
@ -309,7 +311,7 @@ typedef int32 (* NP_LOADDS NPP_WriteUPP)(NPP instance, NPStream* stream, int32 o
/* NPP_StreamAsFile */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPP_StreamAsFileUPP;
enum {
@ -336,7 +338,7 @@ typedef void (* NP_LOADDS NPP_StreamAsFileUPP)(NPP instance, NPStream* stream, c
/* NPP_Print */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPP_PrintUPP;
enum {
@ -363,7 +365,7 @@ typedef void (* NP_LOADDS NPP_PrintUPP)(NPP instance, NPPrint* platformPrint);
/* NPP_HandleEvent */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPP_HandleEventUPP;
enum {
@ -390,7 +392,7 @@ typedef int16 (* NP_LOADDS NPP_HandleEventUPP)(NPP instance, void* event);
/* NPP_URLNotify */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPP_URLNotifyUPP;
enum {
@ -419,7 +421,7 @@ typedef void (* NP_LOADDS NPP_URLNotifyUPP)(NPP instance, const char* url, NPRea
/* NPP_GetValue */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPP_GetValueUPP;
enum {
@ -445,7 +447,7 @@ typedef NPError (* NP_LOADDS NPP_GetValueUPP)(NPP instance, NPPVariable variable
/* NPP_SetValue */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPP_SetValueUPP;
enum {
@ -478,7 +480,7 @@ typedef NPError (* NP_LOADDS NPP_SetValueUPP)(NPP instance, NPNVariable variable
/* NPN_GetValue */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPN_GetValueUPP;
enum {
@ -504,7 +506,7 @@ typedef NPError (* NP_LOADDS NPN_GetValueUPP)(NPP instance, NPNVariable variable
/* NPN_SetValue */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPN_SetValueUPP;
enum {
@ -530,7 +532,7 @@ typedef NPError (* NP_LOADDS NPN_SetValueUPP)(NPP instance, NPPVariable variable
/* NPN_GetUrlNotify */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPN_GetURLNotifyUPP;
enum {
@ -557,7 +559,7 @@ typedef NPError (* NP_LOADDS NPN_GetURLNotifyUPP)(NPP instance, const char* url,
/* NPN_PostUrlNotify */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPN_PostURLNotifyUPP;
enum {
@ -587,7 +589,7 @@ typedef NPError (* NP_LOADDS NPN_PostURLNotifyUPP)(NPP instance, const char* url
/* NPN_GetUrl */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPN_GetURLUPP;
enum {
@ -613,7 +615,7 @@ typedef NPError (* NP_LOADDS NPN_GetURLUPP)(NPP instance, const char* url, const
/* NPN_PostUrl */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPN_PostURLUPP;
enum {
@ -642,7 +644,7 @@ typedef NPError (* NP_LOADDS NPN_PostURLUPP)(NPP instance, const char* url, cons
/* NPN_RequestRead */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPN_RequestReadUPP;
enum {
@ -669,7 +671,7 @@ typedef NPError (* NP_LOADDS NPN_RequestReadUPP)(NPStream* stream, NPByteRange*
/* NPN_NewStream */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPN_NewStreamUPP;
enum {
@ -698,7 +700,7 @@ typedef NPError (* NP_LOADDS NPN_NewStreamUPP)(NPP instance, NPMIMEType type, co
/* NPN_Write */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPN_WriteUPP;
enum {
@ -727,7 +729,7 @@ typedef int32 (* NP_LOADDS NPN_WriteUPP)(NPP instance, NPStream* stream, int32 l
/* NPN_DestroyStream */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPN_DestroyStreamUPP;
enum {
@ -755,7 +757,7 @@ typedef NPError (* NP_LOADDS NPN_DestroyStreamUPP)(NPP instance, NPStream* strea
/* NPN_Status */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPN_StatusUPP;
enum {
@ -781,7 +783,7 @@ typedef void (* NP_LOADDS NPN_StatusUPP)(NPP instance, const char* message);
/* NPN_UserAgent */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPN_UserAgentUPP;
enum {
@ -807,7 +809,7 @@ typedef const char* (* NP_LOADDS NPN_UserAgentUPP)(NPP instance);
/* NPN_MemAlloc */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPN_MemAllocUPP;
enum {
@ -834,7 +836,7 @@ typedef void* (* NP_LOADDS NPN_MemAllocUPP)(uint32 size);
/* NPN__MemFree */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPN_MemFreeUPP;
enum {
@ -860,7 +862,7 @@ typedef void (* NP_LOADDS NPN_MemFreeUPP)(void* ptr);
/* NPN_MemFlush */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPN_MemFlushUPP;
enum {
@ -888,7 +890,7 @@ typedef uint32 (* NP_LOADDS NPN_MemFlushUPP)(uint32 size);
/* NPN_ReloadPlugins */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPN_ReloadPluginsUPP;
enum {
@ -915,7 +917,7 @@ typedef void (* NP_LOADDS NPN_ReloadPluginsUPP)(NPBool reloadPages);
/* NPN_GetJavaEnv */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPN_GetJavaEnvUPP;
enum {
@ -940,7 +942,7 @@ typedef JRIEnv* (* NP_LOADDS NPN_GetJavaEnvUPP)(void);
/* NPN_GetJavaPeer */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPN_GetJavaPeerUPP;
enum {
@ -967,7 +969,7 @@ typedef jref (* NP_LOADDS NPN_GetJavaPeerUPP)(NPP instance);
/* NPN_InvalidateRect */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPN_InvalidateRectUPP;
enum {
@ -995,7 +997,7 @@ typedef void (* NP_LOADDS NPN_InvalidateRectUPP)(NPP instance, NPRect *rect);
/* NPN_InvalidateRegion */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPN_InvalidateRegionUPP;
enum {
@ -1022,7 +1024,7 @@ typedef void (* NP_LOADDS NPN_InvalidateRegionUPP)(NPP instance, NPRegion region
/* NPN_ForceRedraw */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPN_ForceRedrawUPP;
enum {
@ -1121,7 +1123,7 @@ typedef struct _NPNetscapeFuncs {
* and NPPShutdownUPP for Netscape's use.
*/
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPP_MainEntryUPP;
enum {

Просмотреть файл

@ -5387,7 +5387,7 @@ nsCSSFrameConstructor::ConstructXULFrame(nsIPresShell* aPresShell,
((nsMenuFrame*) newFrame)->SetFrameConstructor(this);
}
else if (aTag == nsXULAtoms::menubar) {
#if (defined(XP_MAC) && !TARGET_CARBON) || defined(RHAPSODY) // The Mac uses its native menu bar.
#if defined(XP_MAC) || defined(RHAPSODY) // The Mac uses its native menu bar.
aHaltProcessing = PR_TRUE;
return NS_OK;
#else

Просмотреть файл

@ -426,8 +426,7 @@ nsScrollFrame::CreateScrollingView(nsIPresContext* aPresContext)
}
// Initialize the scrolling view
view->Init(viewManager, mRect, parentView, display->IsVisible()?
nsViewVisibility_kShow : nsViewVisibility_kHide);
view->Init(viewManager, mRect, parentView, nsViewVisibility_kHide);
// Insert the view into the view hierarchy
viewManager->InsertChild(parentView, view, zIndex);

Просмотреть файл

@ -5387,7 +5387,7 @@ nsCSSFrameConstructor::ConstructXULFrame(nsIPresShell* aPresShell,
((nsMenuFrame*) newFrame)->SetFrameConstructor(this);
}
else if (aTag == nsXULAtoms::menubar) {
#if (defined(XP_MAC) && !TARGET_CARBON) || defined(RHAPSODY) // The Mac uses its native menu bar.
#if defined(XP_MAC) || defined(RHAPSODY) // The Mac uses its native menu bar.
aHaltProcessing = PR_TRUE;
return NS_OK;
#else

Двоичные данные
lib/mac/NSStdLib/NSStdLib.mcp

Двоичный файл не отображается.

Просмотреть файл

Просмотреть файл

@ -33,7 +33,7 @@
** applefile definitions used
*/
#ifdef XP_MAC
#if PRAGMA_ALIGN_SUPPORTED
#if PRAGMA_STRUCT_ALIGN
#pragma options align=mac68k
#endif
#endif /* XP_MAC */
@ -114,7 +114,7 @@ int ap_decode_process_data( appledouble_decode_object* p_ap_decode_obj, PRBool
XP_END_PROTOS
#ifdef XP_MAC
#if PRAGMA_ALIGN_SUPPORTED
#if PRAGMA_STRUCT_ALIGN
#pragma options align=reset
#endif
#endif /* XP_MAC */

Просмотреть файл

@ -159,6 +159,10 @@ int ap_encode_file_infor(
}
/* get a file comment, if possible */
#if TARGET_CARBON
// not sure why working directories are needed here...
comlen = 0;
#else
procID = 0;
GetWDInfo(p_ap_encode_obj->vRefNum, &fpb->ioVRefNum, &fpb->ioDirID, &procID);
memset((void *) &vinfo, '\0', sizeof (vinfo));
@ -182,6 +186,7 @@ int ap_encode_file_infor(
comlen = dtp.ioDTActCount;
}
}
#endif
/* write header */
// head.magic = dfork ? APPLESINGLE_MAGIC : APPLEDOUBLE_MAGIC;

Просмотреть файл

@ -33,6 +33,7 @@
# include <time.h>
#endif
#include <stdlib.h>
#include <time.h>
#include "prlog.h"
#include "prmem.h"
#include "plstr.h"

Просмотреть файл

@ -22,7 +22,7 @@
/*
* npupp.h $Revision: 3.3 $
* npupp.h $Revision: 3.4 $
* function call mecahnics needed by platform specific glue code.
*/
@ -56,7 +56,9 @@
/* NPP_Initialize */
#if TARGET_RT_MAC_CFM
#define _NPUPP_USE_UPP_ (TARGET_RT_MAC_CFM && !TARGET_API_MAC_CARBON)
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPP_InitializeUPP;
enum {
@ -83,7 +85,7 @@ typedef void (* NP_LOADDS NPP_InitializeUPP)(void);
/* NPP_Shutdown */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPP_ShutdownUPP;
enum {
@ -110,7 +112,7 @@ typedef void (* NP_LOADDS NPP_ShutdownUPP)(void);
/* NPP_New */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPP_NewUPP;
enum {
@ -143,7 +145,7 @@ typedef NPError (* NP_LOADDS NPP_NewUPP)(NPMIMEType pluginType, NPP instance, ui
/* NPP_Destroy */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPP_DestroyUPP;
enum {
@ -169,7 +171,7 @@ typedef NPError (* NP_LOADDS NPP_DestroyUPP)(NPP instance, NPSavedData** save);
/* NPP_SetWindow */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPP_SetWindowUPP;
enum {
@ -196,7 +198,7 @@ typedef NPError (* NP_LOADDS NPP_SetWindowUPP)(NPP instance, NPWindow* window);
/* NPP_NewStream */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPP_NewStreamUPP;
enum {
@ -224,7 +226,7 @@ typedef NPError (* NP_LOADDS NPP_NewStreamUPP)(NPP instance, NPMIMEType type, NP
/* NPP_DestroyStream */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPP_DestroyStreamUPP;
enum {
@ -252,7 +254,7 @@ typedef NPError (* NP_LOADDS NPP_DestroyStreamUPP)(NPP instance, NPStream* strea
/* NPP_WriteReady */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPP_WriteReadyUPP;
enum {
@ -279,7 +281,7 @@ typedef int32 (* NP_LOADDS NPP_WriteReadyUPP)(NPP instance, NPStream* stream);
/* NPP_Write */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPP_WriteUPP;
enum {
@ -309,7 +311,7 @@ typedef int32 (* NP_LOADDS NPP_WriteUPP)(NPP instance, NPStream* stream, int32 o
/* NPP_StreamAsFile */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPP_StreamAsFileUPP;
enum {
@ -336,7 +338,7 @@ typedef void (* NP_LOADDS NPP_StreamAsFileUPP)(NPP instance, NPStream* stream, c
/* NPP_Print */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPP_PrintUPP;
enum {
@ -363,7 +365,7 @@ typedef void (* NP_LOADDS NPP_PrintUPP)(NPP instance, NPPrint* platformPrint);
/* NPP_HandleEvent */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPP_HandleEventUPP;
enum {
@ -390,7 +392,7 @@ typedef int16 (* NP_LOADDS NPP_HandleEventUPP)(NPP instance, void* event);
/* NPP_URLNotify */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPP_URLNotifyUPP;
enum {
@ -419,7 +421,7 @@ typedef void (* NP_LOADDS NPP_URLNotifyUPP)(NPP instance, const char* url, NPRea
/* NPP_GetValue */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPP_GetValueUPP;
enum {
@ -445,7 +447,7 @@ typedef NPError (* NP_LOADDS NPP_GetValueUPP)(NPP instance, NPPVariable variable
/* NPP_SetValue */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPP_SetValueUPP;
enum {
@ -478,7 +480,7 @@ typedef NPError (* NP_LOADDS NPP_SetValueUPP)(NPP instance, NPNVariable variable
/* NPN_GetValue */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPN_GetValueUPP;
enum {
@ -504,7 +506,7 @@ typedef NPError (* NP_LOADDS NPN_GetValueUPP)(NPP instance, NPNVariable variable
/* NPN_SetValue */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPN_SetValueUPP;
enum {
@ -530,7 +532,7 @@ typedef NPError (* NP_LOADDS NPN_SetValueUPP)(NPP instance, NPPVariable variable
/* NPN_GetUrlNotify */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPN_GetURLNotifyUPP;
enum {
@ -557,7 +559,7 @@ typedef NPError (* NP_LOADDS NPN_GetURLNotifyUPP)(NPP instance, const char* url,
/* NPN_PostUrlNotify */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPN_PostURLNotifyUPP;
enum {
@ -587,7 +589,7 @@ typedef NPError (* NP_LOADDS NPN_PostURLNotifyUPP)(NPP instance, const char* url
/* NPN_GetUrl */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPN_GetURLUPP;
enum {
@ -613,7 +615,7 @@ typedef NPError (* NP_LOADDS NPN_GetURLUPP)(NPP instance, const char* url, const
/* NPN_PostUrl */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPN_PostURLUPP;
enum {
@ -642,7 +644,7 @@ typedef NPError (* NP_LOADDS NPN_PostURLUPP)(NPP instance, const char* url, cons
/* NPN_RequestRead */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPN_RequestReadUPP;
enum {
@ -669,7 +671,7 @@ typedef NPError (* NP_LOADDS NPN_RequestReadUPP)(NPStream* stream, NPByteRange*
/* NPN_NewStream */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPN_NewStreamUPP;
enum {
@ -698,7 +700,7 @@ typedef NPError (* NP_LOADDS NPN_NewStreamUPP)(NPP instance, NPMIMEType type, co
/* NPN_Write */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPN_WriteUPP;
enum {
@ -727,7 +729,7 @@ typedef int32 (* NP_LOADDS NPN_WriteUPP)(NPP instance, NPStream* stream, int32 l
/* NPN_DestroyStream */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPN_DestroyStreamUPP;
enum {
@ -755,7 +757,7 @@ typedef NPError (* NP_LOADDS NPN_DestroyStreamUPP)(NPP instance, NPStream* strea
/* NPN_Status */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPN_StatusUPP;
enum {
@ -781,7 +783,7 @@ typedef void (* NP_LOADDS NPN_StatusUPP)(NPP instance, const char* message);
/* NPN_UserAgent */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPN_UserAgentUPP;
enum {
@ -807,7 +809,7 @@ typedef const char* (* NP_LOADDS NPN_UserAgentUPP)(NPP instance);
/* NPN_MemAlloc */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPN_MemAllocUPP;
enum {
@ -834,7 +836,7 @@ typedef void* (* NP_LOADDS NPN_MemAllocUPP)(uint32 size);
/* NPN__MemFree */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPN_MemFreeUPP;
enum {
@ -860,7 +862,7 @@ typedef void (* NP_LOADDS NPN_MemFreeUPP)(void* ptr);
/* NPN_MemFlush */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPN_MemFlushUPP;
enum {
@ -888,7 +890,7 @@ typedef uint32 (* NP_LOADDS NPN_MemFlushUPP)(uint32 size);
/* NPN_ReloadPlugins */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPN_ReloadPluginsUPP;
enum {
@ -915,7 +917,7 @@ typedef void (* NP_LOADDS NPN_ReloadPluginsUPP)(NPBool reloadPages);
/* NPN_GetJavaEnv */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPN_GetJavaEnvUPP;
enum {
@ -940,7 +942,7 @@ typedef JRIEnv* (* NP_LOADDS NPN_GetJavaEnvUPP)(void);
/* NPN_GetJavaPeer */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPN_GetJavaPeerUPP;
enum {
@ -967,7 +969,7 @@ typedef jref (* NP_LOADDS NPN_GetJavaPeerUPP)(NPP instance);
/* NPN_InvalidateRect */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPN_InvalidateRectUPP;
enum {
@ -995,7 +997,7 @@ typedef void (* NP_LOADDS NPN_InvalidateRectUPP)(NPP instance, NPRect *rect);
/* NPN_InvalidateRegion */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPN_InvalidateRegionUPP;
enum {
@ -1022,7 +1024,7 @@ typedef void (* NP_LOADDS NPN_InvalidateRegionUPP)(NPP instance, NPRegion region
/* NPN_ForceRedraw */
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPN_ForceRedrawUPP;
enum {
@ -1121,7 +1123,7 @@ typedef struct _NPNetscapeFuncs {
* and NPPShutdownUPP for Netscape's use.
*/
#if TARGET_RT_MAC_CFM
#if _NPUPP_USE_UPP_
typedef UniversalProcPtr NPP_MainEntryUPP;
enum {

Просмотреть файл

@ -60,10 +60,6 @@ ns4xPlugin::CheckClassInitialized(void)
CALLBACKS.size = sizeof(CALLBACKS);
CALLBACKS.version = (NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR;
#if !TARGET_CARBON
// pinkerton - these macros rely on BuildRoutineDescriptor(), which is no longer in
// Carbon. Our easy solution to this is to drop support for 68K plugins. Now we just
// need to do the work...
CALLBACKS.geturl = NewNPN_GetURLProc(_geturl);
CALLBACKS.posturl = NewNPN_PostURLProc(_posturl);
CALLBACKS.requestread = NewNPN_RequestReadProc(_requestread);
@ -85,10 +81,9 @@ ns4xPlugin::CheckClassInitialized(void)
CALLBACKS.invalidaterect = NewNPN_InvalidateRectProc(_invalidaterect);
CALLBACKS.invalidateregion = NewNPN_InvalidateRegionProc(_invalidateregion);
CALLBACKS.forceredraw = NewNPN_ForceRedrawProc(_forceredraw);
#endif
initialized = TRUE;
};
}
////////////////////////////////////////////////////////////////////////
// nsISupports stuff
@ -313,9 +308,14 @@ ns4xPlugin::CreatePlugin(nsIServiceManager* aServiceMgr,
return NS_ERROR_UNEXPECTED;
#endif
#if defined(XP_MAC) && !TARGET_CARBON
#if defined(XP_MAC)
#if TARGET_CARBON
// get the main entry point
NP_MAIN pfnMain = (NP_MAIN) PR_FindSymbol(aLibrary, "main");
#else
// get the mainRD entry point
NP_MAIN pfnMain = (NP_MAIN) PR_FindSymbol(aLibrary, "mainRD");
#endif
if(pfnMain == NULL)
return NS_ERROR_FAILURE;
@ -335,14 +335,13 @@ ns4xPlugin::CreatePlugin(nsIServiceManager* aServiceMgr,
const nsFileSpec& file = iter;
if (pluginsDir.IsPluginFile(file))
{
FSSpec spec = file;
char* fileName = p2cstrdup(spec.name);
if(!PL_strcmp(fileName, aFileName))
{
Boolean targetIsFolder, wasAliased;
OSErr err = ::ResolveAliasFile(&spec, true, &targetIsFolder, &wasAliased);
pluginRefNum = ::FSpOpenResFile(&spec, fsRdPerm);
}
FSSpec spec = file;
if (!nsCRT::memcmp(spec.name + 1, aFileName, spec.name[0]))
{
Boolean targetIsFolder, wasAliased;
OSErr err = ::ResolveAliasFile(&spec, true, &targetIsFolder, &wasAliased);
pluginRefNum = ::FSpOpenResFile(&spec, fsRdPerm);
}
}
}
@ -438,10 +437,8 @@ ns4xPlugin::Shutdown(void)
printf("shutting down plugin %08x\n",(int)this);
#endif
#ifdef XP_MAC
#if !TARGET_CARBON
CallNPP_ShutdownProc(fShutdownEntry);
::CloseResFile(fPluginRefNum);
#endif
#else
NS_TRY_SAFE_CALL_VOID(fShutdownEntry(), fLibrary);
#endif

Просмотреть файл

@ -127,27 +127,23 @@ ns4xPluginStreamListener::OnStartBinding(nsIPluginStreamInfo* pluginInfo)
mInst->GetCallbacks(&callbacks);
mInst->GetNPP(&npp);
#if !TARGET_CARBON
// pinkerton
// relies on routine descriptors, not present in carbon. We need to fix this.
PRLibrary* lib = nsnull;
if(mInst)
PRLibrary* lib = nsnull;
if(mInst)
lib = mInst->fLibrary;
// if we don't know the end of the stream, use 0 instead of -1. bug 59571
if (mNPStream.end == -1)
// if we don't know the end of the stream, use 0 instead of -1. bug 59571
if (mNPStream.end == -1)
mNPStream.end = 0;
NS_TRY_SAFE_CALL_RETURN(error, CallNPP_NewStreamProc(callbacks->newstream,
npp,
(char *)contentType,
&mNPStream,
seekable,
&streamType), lib);
if(error != NPERR_NO_ERROR)
return NS_ERROR_FAILURE;
#endif
NS_TRY_SAFE_CALL_RETURN(error, CallNPP_NewStreamProc(callbacks->newstream,
npp,
(char *)contentType,
&mNPStream,
seekable,
&streamType), lib);
if(error != NPERR_NO_ERROR)
return NS_ERROR_FAILURE;
// translate the old 4x style stream type to the new one
switch(streamType)
{
@ -172,7 +168,7 @@ ns4xPluginStreamListener::OnDataAvailable(nsIPluginStreamInfo* pluginInfo,
nsIInputStream* input,
PRUint32 length)
{
const NPPluginFuncs *callbacks;
const NPPluginFuncs *callbacks;
NPP npp;
PRUint32 numtowrite = 0;
PRUint32 amountRead = 0;
@ -200,11 +196,6 @@ ns4xPluginStreamListener::OnDataAvailable(nsIPluginStreamInfo* pluginInfo,
{
if (callbacks->writeready != NULL)
{
#if !TARGET_CARBON
// pinkerton
// relies on routine descriptors, not present in carbon.
// We need to fix this.
PRLibrary* lib = nsnull;
PRBool started = PR_FALSE;
if(mInst) {
@ -218,7 +209,6 @@ ns4xPluginStreamListener::OnDataAvailable(nsIPluginStreamInfo* pluginInfo,
npp,
&mNPStream), lib);
}
#endif
// if WriteReady returned 0, the plugin is not ready to handle
// the data, return FAILURE for now
@ -235,14 +225,9 @@ ns4xPluginStreamListener::OnDataAvailable(nsIPluginStreamInfo* pluginInfo,
if(numtowrite > 0)
{
#if !TARGET_CARBON
// pinkerton
// relies on routine descriptors, not present in carbon.
// We need to fix this.
PRLibrary* lib = nsnull;
if(mInst)
lib = mInst->fLibrary;
lib = mInst->fLibrary;
NS_TRY_SAFE_CALL_RETURN(writeCount, CallNPP_WriteProc(callbacks->write,
npp,
@ -251,8 +236,7 @@ ns4xPluginStreamListener::OnDataAvailable(nsIPluginStreamInfo* pluginInfo,
numtowrite,
(void *)buffer), lib);
if(writeCount < 0)
return NS_ERROR_FAILURE;
#endif
return NS_ERROR_FAILURE;
amountRead -= numtowrite;
mPosition += numtowrite;
}
@ -276,11 +260,6 @@ ns4xPluginStreamListener::OnFileAvailable(nsIPluginStreamInfo* pluginInfo,
if (callbacks->asfile == NULL)
return NS_OK;
#if !TARGET_CARBON
// pinkerton
// relies on routine descriptors, not present in carbon.
// We need to fix this.
PRLibrary* lib = nsnull;
PRBool started = PR_FALSE;
if(mInst) {
@ -295,7 +274,6 @@ ns4xPluginStreamListener::OnFileAvailable(nsIPluginStreamInfo* pluginInfo,
&mNPStream,
fileName), lib);
}
#endif
return NS_OK;
}
@ -317,10 +295,6 @@ ns4xPluginStreamListener::OnStopBinding(nsIPluginStreamInfo* pluginInfo,
if (callbacks->destroystream != NULL)
{
// XXX need to convert status to NPReason
#if !TARGET_CARBON
// pinkerton
// relies on routine descriptors, not present in carbon.
// We need to fix this.
PRLibrary* lib = nsnull;
PRBool started = PR_FALSE;
if(mInst) {
@ -337,17 +311,11 @@ ns4xPluginStreamListener::OnStopBinding(nsIPluginStreamInfo* pluginInfo,
}
if(error != NPERR_NO_ERROR)
return NS_ERROR_FAILURE;
#endif
}
// check to see if we have a call back
if (callbacks->urlnotify != NULL && mNotifyData != nsnull)
{
#if !TARGET_CARBON
// pinkerton
// relies on routine descriptors, not present in carbon.
// We need to fix this.
PRLibrary* lib = nsnull;
if(mInst)
lib = mInst->fLibrary;
@ -357,7 +325,6 @@ ns4xPluginStreamListener::OnStopBinding(nsIPluginStreamInfo* pluginInfo,
mNPStream.url,
nsPluginReason_Done,
mNotifyData), lib);
#endif
}
@ -471,14 +438,8 @@ NS_IMETHODIMP ns4xPluginInstance::Stop(void)
NPSavedData *sdata;
#if !TARGET_CARBON
// pinkerton
// relies on routine descriptors, not present in carbon.
// We need to fix this.
NS_TRY_SAFE_CALL_RETURN(error, CallNPP_DestroyProc(fCallbacks->destroy, &fNPP, &sdata), fLibrary);
#endif
mStarted = PR_FALSE;
if(error != NPERR_NO_ERROR)
return NS_ERROR_FAILURE;
@ -518,10 +479,6 @@ nsresult ns4xPluginInstance::InitializePlugin(nsIPluginInstancePeer* peer)
mPeer->GetMode(&mode);
mPeer->GetMIMEType(&mimetype);
#if !TARGET_CARBON
// pinkerton
// relies on routine descriptors, not present in carbon. We need to fix this.
NS_TRY_SAFE_CALL_RETURN(error, CallNPP_NewProc(fCallbacks->newp,
(char *)mimetype,
&fNPP,
@ -530,7 +487,6 @@ nsresult ns4xPluginInstance::InitializePlugin(nsIPluginInstancePeer* peer)
(char**)names,
(char**)values,
NULL), fLibrary);
#endif //!TARGET_CARBON
if(error != NPERR_NO_ERROR)
rv = NS_ERROR_FAILURE;
@ -639,10 +595,6 @@ NS_IMETHODIMP ns4xPluginInstance::SetWindow(nsPluginWindow* window)
// XXX Turns out that NPPluginWindow and NPWindow are structurally
// identical (on purpose!), so there's no need to make a copy.
#if !TARGET_CARBON
// pinkerton
// relies on routine descriptors, not present in carbon. We
// need to fix this.
#ifdef NS_DEBUG
printf("About to call CallNPP_SetWindowProc()...\n");
fflush(NULL);
@ -652,7 +604,6 @@ NS_IMETHODIMP ns4xPluginInstance::SetWindow(nsPluginWindow* window)
&fNPP,
(NPWindow*) window), fLibrary);
#endif
// XXX In the old code, we'd just ignore any errors coming
// back from the plugin's SetWindow(). Is this the correct
@ -706,10 +657,6 @@ NS_IMETHODIMP ns4xPluginInstance::HandleEvent(nsPluginEvent* event, PRBool* hand
if (fCallbacks->event)
{
#if !TARGET_CARBON
// pinkerton
// relies on routine descriptors, not present in carbon.
// We need to fix this.
#ifdef XP_MAC
res = CallNPP_HandleEventProc(fCallbacks->event,
&fNPP,
@ -725,8 +672,6 @@ NS_IMETHODIMP ns4xPluginInstance::HandleEvent(nsPluginEvent* event, PRBool* hand
NS_TRY_SAFE_CALL_RETURN(res, CallNPP_HandleEventProc(fCallbacks->event,
&fNPP,
(void*)&npEvent), fLibrary);
#endif
#endif
*handled = res;

Просмотреть файл

@ -99,6 +99,14 @@
#endif
#endif
#if defined(XP_MAC) && TARGET_CARBON
#include "nsIClassicPluginFactory.h"
#endif
#if defined(XP_MAC) && TARGET_CARBON
#include "nsIClassicPluginFactory.h"
#endif
// We need this hackery so that we can dynamically register doc
// loaders for the 4.x plugins that we discover.
#if defined(XP_PC)
@ -3109,10 +3117,10 @@ NS_IMETHODIMP nsPluginHostImpl::GetPluginFactory(const char *aMimeType, nsIPlugi
nsIPlugin* plugin = pluginTag->mEntryPoint;
if(plugin == NULL)
{
// No, this is not a leak. GetGlobalServiceManager() doesn't
// addref the pointer on the way out. It probably should.
nsIServiceManager* serviceManager;
nsServiceManager::GetGlobalServiceManager(&serviceManager);
// No, this is not a leak. GetGlobalServiceManager() doesn't
// addref the pointer on the way out. It probably should.
nsIServiceManager* serviceManager;
nsServiceManager::GetGlobalServiceManager(&serviceManager);
// need to get the plugin factory from this plugin.
nsFactoryProc nsGetFactory = nsnull;
@ -3127,11 +3135,19 @@ NS_IMETHODIMP nsPluginHostImpl::GetPluginFactory(const char *aMimeType, nsIPlugi
}
else
{
#if defined(XP_MAC) && TARGET_CARBON
// should we also look for a 'carb' resource?
if (PR_FindSymbol(pluginTag->mLibrary, "mainRD") != NULL) {
NS_WITH_SERVICE(nsIClassicPluginFactory, factory, NS_CLASSIC_PLUGIN_FACTORY_CONTRACTID, &rv);
if (NS_SUCCEEDED(rv)) rv = factory->CreatePlugin(serviceManager, pluginTag->mFileName,
pluginTag->mLibrary, &pluginTag->mEntryPoint);
} else
#endif
rv = ns4xPlugin::CreatePlugin(serviceManager,
pluginTag->mFileName,
pluginTag->mLibrary,
&pluginTag->mEntryPoint);
plugin = pluginTag->mEntryPoint;
pluginTag->mFlags |= NS_PLUGIN_FLAG_OLDSCHOOL;
@ -3139,7 +3155,7 @@ NS_IMETHODIMP nsPluginHostImpl::GetPluginFactory(const char *aMimeType, nsIPlugi
}
}
if(plugin != nsnull)
if (plugin != nsnull)
{
*aPlugin = plugin;
plugin->AddRef();

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -1,646 +0,0 @@
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
//
// npmac.cpp
//
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
#include <Processes.h>
#include <Gestalt.h>
#include <CodeFragments.h>
#include <Timer.h>
#include <Resources.h>
#include <ToolUtils.h>
#define XP_MAC 1
//
// A4Stuff.h contains the definition of EnterCodeResource and
// EnterCodeResource, used for setting up the code resourceÕs
// globals for 68K (analagous to the function SetCurrentA5
// defined by the toolbox).
//
#include <A4Stuff.h>
#include "npapi.h"
//
// The Mixed Mode procInfos defined in npupp.h assume Think C-
// style calling conventions. These conventions are used by
// Metrowerks with the exception of pointer return types, which
// in Metrowerks 68K are returned in A0, instead of the standard
// D0. Thus, since NPN_MemAlloc and NPN_UserAgent return pointers,
// Mixed Mode will return the values to a 68K plugin in D0, but
// a 68K plugin compiled by Metrowerks will expect the result in
// A0. The following pragma forces Metrowerks to use D0 instead.
//
#ifdef __MWERKS__
#ifndef powerc
#pragma pointers_in_D0
#endif
#endif
#include "npupp.h"
#ifdef __MWERKS__
#ifndef powerc
#pragma pointers_in_A0
#endif
#endif
// The following fix for static initializers (which fixes a preious
// incompatibility with some parts of PowerPlant, was submitted by
// Jan Ulbrich.
#ifdef __MWERKS__
#ifdef __cplusplus
extern "C" {
#endif
#ifndef powerc
extern void __InitCode__(void);
#else
extern void __sinit(void);
#define __InitCode__ __sinit
#endif
extern void __destroy_global_chain(void);
#ifdef __cplusplus
}
#endif // __cplusplus
#endif // __MWERKS__
//
// Define PLUGIN_TRACE to 1 to have the wrapper functions emit
// DebugStr messages whenever they are called.
//
#define PLUGIN_TRACE 0
#if PLUGIN_TRACE
#define PLUGINDEBUGSTR(msg) ::DebugStr(msg)
#else
#define PLUGINDEBUGSTR
#endif
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
//
// Globals
//
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
QDGlobals* gQDPtr; // Pointer to NetscapeÕs QuickDraw globals
short gResFile; // Refnum of the pluginÕs resource file
NPNetscapeFuncs gNetscapeFuncs; // Function table for procs in Netscape called by plugin
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
//
// Wrapper functions for all calls from the plugin to Netscape.
// These functions let the plugin developer just call the APIs
// as documented and defined in npapi.h, without needing to know
// about the function table and call macros in npupp.h.
//
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
void NPN_Version(int* plugin_major, int* plugin_minor, int* netscape_major, int* netscape_minor)
{
*plugin_major = NP_VERSION_MAJOR;
*plugin_minor = NP_VERSION_MINOR;
*netscape_major = gNetscapeFuncs.version >> 8; // Major version is in high byte
*netscape_minor = gNetscapeFuncs.version & 0xFF; // Minor version is in low byte
}
NPError NPN_GetURLNotify(NPP instance, const char* url, const char* window, void* notifyData)
{
int navMinorVers = gNetscapeFuncs.version & 0xFF;
NPError err;
if( navMinorVers >= NPVERS_HAS_NOTIFICATION )
{
err = CallNPN_GetURLNotifyProc(gNetscapeFuncs.geturlnotify, instance, url, window, notifyData);
}
else
{
err = NPERR_INCOMPATIBLE_VERSION_ERROR;
}
return err;
}
NPError NPN_GetURL(NPP instance, const char* url, const char* window)
{
return CallNPN_GetURLProc(gNetscapeFuncs.geturl, instance, url, window);
}
NPError NPN_PostURLNotify(NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file, void* notifyData)
{
int navMinorVers = gNetscapeFuncs.version & 0xFF;
NPError err;
if( navMinorVers >= NPVERS_HAS_NOTIFICATION )
{
err = CallNPN_PostURLNotifyProc(gNetscapeFuncs.posturlnotify, instance, url,
window, len, buf, file, notifyData);
}
else
{
err = NPERR_INCOMPATIBLE_VERSION_ERROR;
}
return err;
}
NPError NPN_PostURL(NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file)
{
return CallNPN_PostURLProc(gNetscapeFuncs.posturl, instance, url, window, len, buf, file);
}
NPError NPN_RequestRead(NPStream* stream, NPByteRange* rangeList)
{
return CallNPN_RequestReadProc(gNetscapeFuncs.requestread, stream, rangeList);
}
NPError NPN_NewStream(NPP instance, NPMIMEType type, const char* window, NPStream** stream)
{
int navMinorVers = gNetscapeFuncs.version & 0xFF;
NPError err;
if( navMinorVers >= NPVERS_HAS_STREAMOUTPUT )
{
err = CallNPN_NewStreamProc(gNetscapeFuncs.newstream, instance, type, window, stream);
}
else
{
err = NPERR_INCOMPATIBLE_VERSION_ERROR;
}
return err;
}
int32 NPN_Write(NPP instance, NPStream* stream, int32 len, void* buffer)
{
int navMinorVers = gNetscapeFuncs.version & 0xFF;
NPError err;
if( navMinorVers >= NPVERS_HAS_STREAMOUTPUT )
{
err = CallNPN_WriteProc(gNetscapeFuncs.write, instance, stream, len, buffer);
}
else
{
err = NPERR_INCOMPATIBLE_VERSION_ERROR;
}
return err;
}
NPError NPN_DestroyStream(NPP instance, NPStream* stream, NPError reason)
{
int navMinorVers = gNetscapeFuncs.version & 0xFF;
NPError err;
if( navMinorVers >= NPVERS_HAS_STREAMOUTPUT )
{
err = CallNPN_DestroyStreamProc(gNetscapeFuncs.destroystream, instance, stream, reason);
}
else
{
err = NPERR_INCOMPATIBLE_VERSION_ERROR;
}
return err;
}
void NPN_Status(NPP instance, const char* message)
{
CallNPN_StatusProc(gNetscapeFuncs.status, instance, message);
}
const char* NPN_UserAgent(NPP instance)
{
return CallNPN_UserAgentProc(gNetscapeFuncs.uagent, instance);
}
void* NPN_MemAlloc(uint32 size)
{
return CallNPN_MemAllocProc(gNetscapeFuncs.memalloc, size);
}
void NPN_MemFree(void* ptr)
{
CallNPN_MemFreeProc(gNetscapeFuncs.memfree, ptr);
}
uint32 NPN_MemFlush(uint32 size)
{
return CallNPN_MemFlushProc(gNetscapeFuncs.memflush, size);
}
void NPN_ReloadPlugins(NPBool reloadPages)
{
CallNPN_ReloadPluginsProc(gNetscapeFuncs.reloadplugins, reloadPages);
}
JRIEnv* NPN_GetJavaEnv(void)
{
return CallNPN_GetJavaEnvProc( gNetscapeFuncs.getJavaEnv );
}
jobject NPN_GetJavaPeer(NPP instance)
{
return CallNPN_GetJavaPeerProc( gNetscapeFuncs.getJavaPeer, instance );
}
NPError NPN_GetValue(NPP instance, NPNVariable variable, void *value)
{
return CallNPN_GetValueProc( gNetscapeFuncs.getvalue, instance, variable, value);
}
NPError NPN_SetValue(NPP instance, NPPVariable variable, void *value)
{
return CallNPN_SetValueProc( gNetscapeFuncs.setvalue, instance, variable, value);
}
void NPN_InvalidateRect(NPP instance, NPRect *rect)
{
CallNPN_InvalidateRectProc( gNetscapeFuncs.invalidaterect, instance, rect);
}
void NPN_InvalidateRegion(NPP instance, NPRegion region)
{
CallNPN_InvalidateRegionProc( gNetscapeFuncs.invalidateregion, instance, region);
}
void NPN_ForceRedraw(NPP instance)
{
CallNPN_ForceRedrawProc( gNetscapeFuncs.forceredraw, instance);
}
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
//
// Wrapper functions for all calls from Netscape to the plugin.
// These functions let the plugin developer just create the APIs
// as documented and defined in npapi.h, without needing to
// install those functions in the function table or worry about
// setting up globals for 68K plugins.
//
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
NPError Private_Initialize(void);
void Private_Shutdown(void);
NPError Private_New(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, char* argn[], char* argv[], NPSavedData* saved);
NPError Private_Destroy(NPP instance, NPSavedData** save);
NPError Private_SetWindow(NPP instance, NPWindow* window);
NPError Private_NewStream(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16* stype);
NPError Private_DestroyStream(NPP instance, NPStream* stream, NPError reason);
int32 Private_WriteReady(NPP instance, NPStream* stream);
int32 Private_Write(NPP instance, NPStream* stream, int32 offset, int32 len, void* buffer);
void Private_StreamAsFile(NPP instance, NPStream* stream, const char* fname);
void Private_Print(NPP instance, NPPrint* platformPrint);
int16 Private_HandleEvent(NPP instance, void* event);
void Private_URLNotify(NPP instance, const char* url, NPReason reason, void* notifyData);
jobject Private_GetJavaClass(void);
NPError Private_Initialize(void)
{
NPError err;
EnterCodeResource();
PLUGINDEBUGSTR("\pInitialize;g;");
err = NPP_Initialize();
ExitCodeResource();
return err;
}
void Private_Shutdown(void)
{
EnterCodeResource();
PLUGINDEBUGSTR("\pShutdown;g;");
NPP_Shutdown();
__destroy_global_chain();
ExitCodeResource();
}
NPError Private_New(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, char* argn[], char* argv[], NPSavedData* saved)
{
EnterCodeResource();
NPError ret = NPP_New(pluginType, instance, mode, argc, argn, argv, saved);
PLUGINDEBUGSTR("\pNew;g;");
ExitCodeResource();
return ret;
}
NPError Private_Destroy(NPP instance, NPSavedData** save)
{
NPError err;
EnterCodeResource();
PLUGINDEBUGSTR("\pDestroy;g;");
err = NPP_Destroy(instance, save);
ExitCodeResource();
return err;
}
NPError Private_SetWindow(NPP instance, NPWindow* window)
{
NPError err;
EnterCodeResource();
PLUGINDEBUGSTR("\pSetWindow;g;");
err = NPP_SetWindow(instance, window);
ExitCodeResource();
return err;
}
NPError Private_NewStream(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16* stype)
{
NPError err;
EnterCodeResource();
PLUGINDEBUGSTR("\pNewStream;g;");
err = NPP_NewStream(instance, type, stream, seekable, stype);
ExitCodeResource();
return err;
}
int32 Private_WriteReady(NPP instance, NPStream* stream)
{
int32 result;
EnterCodeResource();
PLUGINDEBUGSTR("\pWriteReady;g;");
result = NPP_WriteReady(instance, stream);
ExitCodeResource();
return result;
}
int32 Private_Write(NPP instance, NPStream* stream, int32 offset, int32 len, void* buffer)
{
int32 result;
EnterCodeResource();
PLUGINDEBUGSTR("\pWrite;g;");
result = NPP_Write(instance, stream, offset, len, buffer);
ExitCodeResource();
return result;
}
void Private_StreamAsFile(NPP instance, NPStream* stream, const char* fname)
{
EnterCodeResource();
PLUGINDEBUGSTR("\pStreamAsFile;g;");
NPP_StreamAsFile(instance, stream, fname);
ExitCodeResource();
}
NPError Private_DestroyStream(NPP instance, NPStream* stream, NPError reason)
{
NPError err;
EnterCodeResource();
PLUGINDEBUGSTR("\pDestroyStream;g;");
err = NPP_DestroyStream(instance, stream, reason);
ExitCodeResource();
return err;
}
int16 Private_HandleEvent(NPP instance, void* event)
{
int16 result;
EnterCodeResource();
PLUGINDEBUGSTR("\pHandleEvent;g;");
result = NPP_HandleEvent(instance, event);
ExitCodeResource();
return result;
}
void Private_Print(NPP instance, NPPrint* platformPrint)
{
EnterCodeResource();
PLUGINDEBUGSTR("\pPrint;g;");
NPP_Print(instance, platformPrint);
ExitCodeResource();
}
void Private_URLNotify(NPP instance, const char* url, NPReason reason, void* notifyData)
{
EnterCodeResource();
PLUGINDEBUGSTR("\pURLNotify;g;");
NPP_URLNotify(instance, url, reason, notifyData);
ExitCodeResource();
}
jobject Private_GetJavaClass(void)
{
EnterCodeResource();
PLUGINDEBUGSTR("\pGetJavaClass;g;");
jobject clazz = NPP_GetJavaClass();
ExitCodeResource();
if (clazz)
{
JRIEnv* env = NPN_GetJavaEnv();
return (jobject)JRI_NewGlobalRef(env, clazz);
}
return NULL;
}
void SetUpQD(void);
void SetUpQD(void)
{
ProcessSerialNumber PSN;
FSSpec myFSSpec;
Str63 name;
ProcessInfoRec infoRec;
OSErr result = noErr;
CFragConnectionID connID;
Str255 errName;
//
// Memorize the pluginÕs resource file
// refnum for later use.
//
gResFile = CurResFile();
//
// Ask the system if CFM is available.
//
long response;
OSErr err = Gestalt(gestaltCFMAttr, &response);
Boolean hasCFM = BitTst(&response, 31-gestaltCFMPresent);
if (hasCFM)
{
//
// GetProcessInformation takes a process serial number and
// will give us back the name and FSSpec of the application.
// See the Process Manager in IM.
//
infoRec.processInfoLength = sizeof(ProcessInfoRec);
infoRec.processName = name;
infoRec.processAppSpec = &myFSSpec;
PSN.highLongOfPSN = 0;
PSN.lowLongOfPSN = kCurrentProcess;
result = GetProcessInformation(&PSN, &infoRec);
if (result != noErr)
PLUGINDEBUGSTR("\pFailed in GetProcessInformation");
}
else
//
// If no CFM installed, assume it must be a 68K app.
//
result = -1;
if (result == noErr)
{
//
// Now that we know the app name and FSSpec, we can call GetDiskFragment
// to get a connID to use in a subsequent call to FindSymbol (it will also
// return the address of ÒmainÓ in app, which we ignore). If GetDiskFragment
// returns an error, we assume the app must be 68K.
//
Ptr mainAddr;
result = GetDiskFragment(infoRec.processAppSpec, 0L, 0L, infoRec.processName,
kLoadCFrag, &connID, (Ptr*)&mainAddr, errName);
}
if (result == noErr)
{
//
// The app is a PPC code fragment, so call FindSymbol
// to get the exported ÒqdÓ symbol so we can access its
// QuickDraw globals.
//
CFragSymbolClass symClass;
result = FindSymbol(connID, "\pqd", (Ptr*)&gQDPtr, &symClass);
if (result != noErr) { // this fails if we are in NS 6
gQDPtr = &qd; // so we default to the standard QD globals
}
}
else
{
//
// The app is 68K, so use its A5 to compute the address
// of its QuickDraw globals.
//
gQDPtr = (QDGlobals*)(*((long*)SetCurrentA5()) - (sizeof(QDGlobals) - sizeof(GrafPtr)));
}
}
NPError main(NPNetscapeFuncs* nsTable, NPPluginFuncs* pluginFuncs, NPP_ShutdownUPP* unloadUpp);
#pragma export on
#if GENERATINGCFM
RoutineDescriptor mainRD = BUILD_ROUTINE_DESCRIPTOR(uppNPP_MainEntryProcInfo, main);
#endif
#pragma export off
NPError main(NPNetscapeFuncs* nsTable, NPPluginFuncs* pluginFuncs, NPP_ShutdownUPP* unloadUpp)
{
EnterCodeResource();
PLUGINDEBUGSTR("\pmain");
__InitCode__();
NPError err = NPERR_NO_ERROR;
//
// Ensure that everything Netscape passed us is valid!
//
if ((nsTable == NULL) || (pluginFuncs == NULL) || (unloadUpp == NULL))
err = NPERR_INVALID_FUNCTABLE_ERROR;
//
// Check the ÒmajorÓ version passed in NetscapeÕs function table.
// We wonÕt load if the major version is newer than what we expect.
// Also check that the function tables passed in are big enough for
// all the functions we need (they could be bigger, if Netscape added
// new APIs, but thatÕs OK with us -- weÕll just ignore them).
//
if (err == NPERR_NO_ERROR)
{
if ((nsTable->version >> 8) > NP_VERSION_MAJOR) // Major version is in high byte
err = NPERR_INCOMPATIBLE_VERSION_ERROR;
}
if (err == NPERR_NO_ERROR)
{
//
// Copy all the fields of NetscapeÕs function table into our
// copy so we can call back into Netscape later. Note that
// we need to copy the fields one by one, rather than assigning
// the whole structure, because the Netscape function table
// could actually be bigger than what we expect.
//
int navMinorVers = nsTable->version & 0xFF;
gNetscapeFuncs.version = nsTable->version;
gNetscapeFuncs.size = nsTable->size;
gNetscapeFuncs.posturl = nsTable->posturl;
gNetscapeFuncs.geturl = nsTable->geturl;
gNetscapeFuncs.requestread = nsTable->requestread;
gNetscapeFuncs.newstream = nsTable->newstream;
gNetscapeFuncs.write = nsTable->write;
gNetscapeFuncs.destroystream = nsTable->destroystream;
gNetscapeFuncs.status = nsTable->status;
gNetscapeFuncs.uagent = nsTable->uagent;
gNetscapeFuncs.memalloc = nsTable->memalloc;
gNetscapeFuncs.memfree = nsTable->memfree;
gNetscapeFuncs.memflush = nsTable->memflush;
gNetscapeFuncs.reloadplugins = nsTable->reloadplugins;
if( navMinorVers >= NPVERS_HAS_LIVECONNECT )
{
gNetscapeFuncs.getJavaEnv = nsTable->getJavaEnv;
gNetscapeFuncs.getJavaPeer = nsTable->getJavaPeer;
}
if( navMinorVers >= NPVERS_HAS_NOTIFICATION )
{
gNetscapeFuncs.geturlnotify = nsTable->geturlnotify;
gNetscapeFuncs.posturlnotify = nsTable->posturlnotify;
}
gNetscapeFuncs.getvalue = nsTable->getvalue;
gNetscapeFuncs.setvalue = nsTable->setvalue;
gNetscapeFuncs.invalidaterect = nsTable->invalidaterect;
gNetscapeFuncs.invalidateregion = nsTable->invalidateregion;
gNetscapeFuncs.forceredraw = nsTable->forceredraw;
//
// Set up the plugin function table that Netscape will use to
// call us. Netscape needs to know about our version and size
// and have a UniversalProcPointer for every function we implement.
//
pluginFuncs->version = (NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR;
pluginFuncs->size = sizeof(NPPluginFuncs);
pluginFuncs->newp = NewNPP_NewProc(Private_New);
pluginFuncs->destroy = NewNPP_DestroyProc(Private_Destroy);
pluginFuncs->setwindow = NewNPP_SetWindowProc(Private_SetWindow);
pluginFuncs->newstream = NewNPP_NewStreamProc(Private_NewStream);
pluginFuncs->destroystream = NewNPP_DestroyStreamProc(Private_DestroyStream);
pluginFuncs->asfile = NewNPP_StreamAsFileProc(Private_StreamAsFile);
pluginFuncs->writeready = NewNPP_WriteReadyProc(Private_WriteReady);
pluginFuncs->write = NewNPP_WriteProc(Private_Write);
pluginFuncs->print = NewNPP_PrintProc(Private_Print);
pluginFuncs->event = NewNPP_HandleEventProc(Private_HandleEvent);
if( navMinorVers >= NPVERS_HAS_NOTIFICATION )
{
pluginFuncs->urlnotify = NewNPP_URLNotifyProc(Private_URLNotify);
}
if( navMinorVers >= NPVERS_HAS_LIVECONNECT )
{
pluginFuncs->javaClass = (JRIGlobalRef) Private_GetJavaClass();
}
*unloadUpp = NewNPP_ShutdownProc(Private_Shutdown);
SetUpQD();
err = Private_Initialize();
}
ExitCodeResource();
return err;
}

Просмотреть файл

@ -60,10 +60,6 @@ ns4xPlugin::CheckClassInitialized(void)
CALLBACKS.size = sizeof(CALLBACKS);
CALLBACKS.version = (NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR;
#if !TARGET_CARBON
// pinkerton - these macros rely on BuildRoutineDescriptor(), which is no longer in
// Carbon. Our easy solution to this is to drop support for 68K plugins. Now we just
// need to do the work...
CALLBACKS.geturl = NewNPN_GetURLProc(_geturl);
CALLBACKS.posturl = NewNPN_PostURLProc(_posturl);
CALLBACKS.requestread = NewNPN_RequestReadProc(_requestread);
@ -85,10 +81,9 @@ ns4xPlugin::CheckClassInitialized(void)
CALLBACKS.invalidaterect = NewNPN_InvalidateRectProc(_invalidaterect);
CALLBACKS.invalidateregion = NewNPN_InvalidateRegionProc(_invalidateregion);
CALLBACKS.forceredraw = NewNPN_ForceRedrawProc(_forceredraw);
#endif
initialized = TRUE;
};
}
////////////////////////////////////////////////////////////////////////
// nsISupports stuff
@ -313,9 +308,14 @@ ns4xPlugin::CreatePlugin(nsIServiceManager* aServiceMgr,
return NS_ERROR_UNEXPECTED;
#endif
#if defined(XP_MAC) && !TARGET_CARBON
#if defined(XP_MAC)
#if TARGET_CARBON
// get the main entry point
NP_MAIN pfnMain = (NP_MAIN) PR_FindSymbol(aLibrary, "main");
#else
// get the mainRD entry point
NP_MAIN pfnMain = (NP_MAIN) PR_FindSymbol(aLibrary, "mainRD");
#endif
if(pfnMain == NULL)
return NS_ERROR_FAILURE;
@ -335,14 +335,13 @@ ns4xPlugin::CreatePlugin(nsIServiceManager* aServiceMgr,
const nsFileSpec& file = iter;
if (pluginsDir.IsPluginFile(file))
{
FSSpec spec = file;
char* fileName = p2cstrdup(spec.name);
if(!PL_strcmp(fileName, aFileName))
{
Boolean targetIsFolder, wasAliased;
OSErr err = ::ResolveAliasFile(&spec, true, &targetIsFolder, &wasAliased);
pluginRefNum = ::FSpOpenResFile(&spec, fsRdPerm);
}
FSSpec spec = file;
if (!nsCRT::memcmp(spec.name + 1, aFileName, spec.name[0]))
{
Boolean targetIsFolder, wasAliased;
OSErr err = ::ResolveAliasFile(&spec, true, &targetIsFolder, &wasAliased);
pluginRefNum = ::FSpOpenResFile(&spec, fsRdPerm);
}
}
}
@ -438,10 +437,8 @@ ns4xPlugin::Shutdown(void)
printf("shutting down plugin %08x\n",(int)this);
#endif
#ifdef XP_MAC
#if !TARGET_CARBON
CallNPP_ShutdownProc(fShutdownEntry);
::CloseResFile(fPluginRefNum);
#endif
#else
NS_TRY_SAFE_CALL_VOID(fShutdownEntry(), fLibrary);
#endif

Просмотреть файл

@ -127,27 +127,23 @@ ns4xPluginStreamListener::OnStartBinding(nsIPluginStreamInfo* pluginInfo)
mInst->GetCallbacks(&callbacks);
mInst->GetNPP(&npp);
#if !TARGET_CARBON
// pinkerton
// relies on routine descriptors, not present in carbon. We need to fix this.
PRLibrary* lib = nsnull;
if(mInst)
PRLibrary* lib = nsnull;
if(mInst)
lib = mInst->fLibrary;
// if we don't know the end of the stream, use 0 instead of -1. bug 59571
if (mNPStream.end == -1)
// if we don't know the end of the stream, use 0 instead of -1. bug 59571
if (mNPStream.end == -1)
mNPStream.end = 0;
NS_TRY_SAFE_CALL_RETURN(error, CallNPP_NewStreamProc(callbacks->newstream,
npp,
(char *)contentType,
&mNPStream,
seekable,
&streamType), lib);
if(error != NPERR_NO_ERROR)
return NS_ERROR_FAILURE;
#endif
NS_TRY_SAFE_CALL_RETURN(error, CallNPP_NewStreamProc(callbacks->newstream,
npp,
(char *)contentType,
&mNPStream,
seekable,
&streamType), lib);
if(error != NPERR_NO_ERROR)
return NS_ERROR_FAILURE;
// translate the old 4x style stream type to the new one
switch(streamType)
{
@ -172,7 +168,7 @@ ns4xPluginStreamListener::OnDataAvailable(nsIPluginStreamInfo* pluginInfo,
nsIInputStream* input,
PRUint32 length)
{
const NPPluginFuncs *callbacks;
const NPPluginFuncs *callbacks;
NPP npp;
PRUint32 numtowrite = 0;
PRUint32 amountRead = 0;
@ -200,11 +196,6 @@ ns4xPluginStreamListener::OnDataAvailable(nsIPluginStreamInfo* pluginInfo,
{
if (callbacks->writeready != NULL)
{
#if !TARGET_CARBON
// pinkerton
// relies on routine descriptors, not present in carbon.
// We need to fix this.
PRLibrary* lib = nsnull;
PRBool started = PR_FALSE;
if(mInst) {
@ -218,7 +209,6 @@ ns4xPluginStreamListener::OnDataAvailable(nsIPluginStreamInfo* pluginInfo,
npp,
&mNPStream), lib);
}
#endif
// if WriteReady returned 0, the plugin is not ready to handle
// the data, return FAILURE for now
@ -235,14 +225,9 @@ ns4xPluginStreamListener::OnDataAvailable(nsIPluginStreamInfo* pluginInfo,
if(numtowrite > 0)
{
#if !TARGET_CARBON
// pinkerton
// relies on routine descriptors, not present in carbon.
// We need to fix this.
PRLibrary* lib = nsnull;
if(mInst)
lib = mInst->fLibrary;
lib = mInst->fLibrary;
NS_TRY_SAFE_CALL_RETURN(writeCount, CallNPP_WriteProc(callbacks->write,
npp,
@ -251,8 +236,7 @@ ns4xPluginStreamListener::OnDataAvailable(nsIPluginStreamInfo* pluginInfo,
numtowrite,
(void *)buffer), lib);
if(writeCount < 0)
return NS_ERROR_FAILURE;
#endif
return NS_ERROR_FAILURE;
amountRead -= numtowrite;
mPosition += numtowrite;
}
@ -276,11 +260,6 @@ ns4xPluginStreamListener::OnFileAvailable(nsIPluginStreamInfo* pluginInfo,
if (callbacks->asfile == NULL)
return NS_OK;
#if !TARGET_CARBON
// pinkerton
// relies on routine descriptors, not present in carbon.
// We need to fix this.
PRLibrary* lib = nsnull;
PRBool started = PR_FALSE;
if(mInst) {
@ -295,7 +274,6 @@ ns4xPluginStreamListener::OnFileAvailable(nsIPluginStreamInfo* pluginInfo,
&mNPStream,
fileName), lib);
}
#endif
return NS_OK;
}
@ -317,10 +295,6 @@ ns4xPluginStreamListener::OnStopBinding(nsIPluginStreamInfo* pluginInfo,
if (callbacks->destroystream != NULL)
{
// XXX need to convert status to NPReason
#if !TARGET_CARBON
// pinkerton
// relies on routine descriptors, not present in carbon.
// We need to fix this.
PRLibrary* lib = nsnull;
PRBool started = PR_FALSE;
if(mInst) {
@ -337,17 +311,11 @@ ns4xPluginStreamListener::OnStopBinding(nsIPluginStreamInfo* pluginInfo,
}
if(error != NPERR_NO_ERROR)
return NS_ERROR_FAILURE;
#endif
}
// check to see if we have a call back
if (callbacks->urlnotify != NULL && mNotifyData != nsnull)
{
#if !TARGET_CARBON
// pinkerton
// relies on routine descriptors, not present in carbon.
// We need to fix this.
PRLibrary* lib = nsnull;
if(mInst)
lib = mInst->fLibrary;
@ -357,7 +325,6 @@ ns4xPluginStreamListener::OnStopBinding(nsIPluginStreamInfo* pluginInfo,
mNPStream.url,
nsPluginReason_Done,
mNotifyData), lib);
#endif
}
@ -471,14 +438,8 @@ NS_IMETHODIMP ns4xPluginInstance::Stop(void)
NPSavedData *sdata;
#if !TARGET_CARBON
// pinkerton
// relies on routine descriptors, not present in carbon.
// We need to fix this.
NS_TRY_SAFE_CALL_RETURN(error, CallNPP_DestroyProc(fCallbacks->destroy, &fNPP, &sdata), fLibrary);
#endif
mStarted = PR_FALSE;
if(error != NPERR_NO_ERROR)
return NS_ERROR_FAILURE;
@ -518,10 +479,6 @@ nsresult ns4xPluginInstance::InitializePlugin(nsIPluginInstancePeer* peer)
mPeer->GetMode(&mode);
mPeer->GetMIMEType(&mimetype);
#if !TARGET_CARBON
// pinkerton
// relies on routine descriptors, not present in carbon. We need to fix this.
NS_TRY_SAFE_CALL_RETURN(error, CallNPP_NewProc(fCallbacks->newp,
(char *)mimetype,
&fNPP,
@ -530,7 +487,6 @@ nsresult ns4xPluginInstance::InitializePlugin(nsIPluginInstancePeer* peer)
(char**)names,
(char**)values,
NULL), fLibrary);
#endif //!TARGET_CARBON
if(error != NPERR_NO_ERROR)
rv = NS_ERROR_FAILURE;
@ -639,10 +595,6 @@ NS_IMETHODIMP ns4xPluginInstance::SetWindow(nsPluginWindow* window)
// XXX Turns out that NPPluginWindow and NPWindow are structurally
// identical (on purpose!), so there's no need to make a copy.
#if !TARGET_CARBON
// pinkerton
// relies on routine descriptors, not present in carbon. We
// need to fix this.
#ifdef NS_DEBUG
printf("About to call CallNPP_SetWindowProc()...\n");
fflush(NULL);
@ -652,7 +604,6 @@ NS_IMETHODIMP ns4xPluginInstance::SetWindow(nsPluginWindow* window)
&fNPP,
(NPWindow*) window), fLibrary);
#endif
// XXX In the old code, we'd just ignore any errors coming
// back from the plugin's SetWindow(). Is this the correct
@ -706,10 +657,6 @@ NS_IMETHODIMP ns4xPluginInstance::HandleEvent(nsPluginEvent* event, PRBool* hand
if (fCallbacks->event)
{
#if !TARGET_CARBON
// pinkerton
// relies on routine descriptors, not present in carbon.
// We need to fix this.
#ifdef XP_MAC
res = CallNPP_HandleEventProc(fCallbacks->event,
&fNPP,
@ -725,8 +672,6 @@ NS_IMETHODIMP ns4xPluginInstance::HandleEvent(nsPluginEvent* event, PRBool* hand
NS_TRY_SAFE_CALL_RETURN(res, CallNPP_HandleEventProc(fCallbacks->event,
&fNPP,
(void*)&npEvent), fLibrary);
#endif
#endif
*handled = res;

Просмотреть файл

@ -99,6 +99,14 @@
#endif
#endif
#if defined(XP_MAC) && TARGET_CARBON
#include "nsIClassicPluginFactory.h"
#endif
#if defined(XP_MAC) && TARGET_CARBON
#include "nsIClassicPluginFactory.h"
#endif
// We need this hackery so that we can dynamically register doc
// loaders for the 4.x plugins that we discover.
#if defined(XP_PC)
@ -3109,10 +3117,10 @@ NS_IMETHODIMP nsPluginHostImpl::GetPluginFactory(const char *aMimeType, nsIPlugi
nsIPlugin* plugin = pluginTag->mEntryPoint;
if(plugin == NULL)
{
// No, this is not a leak. GetGlobalServiceManager() doesn't
// addref the pointer on the way out. It probably should.
nsIServiceManager* serviceManager;
nsServiceManager::GetGlobalServiceManager(&serviceManager);
// No, this is not a leak. GetGlobalServiceManager() doesn't
// addref the pointer on the way out. It probably should.
nsIServiceManager* serviceManager;
nsServiceManager::GetGlobalServiceManager(&serviceManager);
// need to get the plugin factory from this plugin.
nsFactoryProc nsGetFactory = nsnull;
@ -3127,11 +3135,19 @@ NS_IMETHODIMP nsPluginHostImpl::GetPluginFactory(const char *aMimeType, nsIPlugi
}
else
{
#if defined(XP_MAC) && TARGET_CARBON
// should we also look for a 'carb' resource?
if (PR_FindSymbol(pluginTag->mLibrary, "mainRD") != NULL) {
NS_WITH_SERVICE(nsIClassicPluginFactory, factory, NS_CLASSIC_PLUGIN_FACTORY_CONTRACTID, &rv);
if (NS_SUCCEEDED(rv)) rv = factory->CreatePlugin(serviceManager, pluginTag->mFileName,
pluginTag->mLibrary, &pluginTag->mEntryPoint);
} else
#endif
rv = ns4xPlugin::CreatePlugin(serviceManager,
pluginTag->mFileName,
pluginTag->mLibrary,
&pluginTag->mEntryPoint);
plugin = pluginTag->mEntryPoint;
pluginTag->mFlags |= NS_PLUGIN_FLAG_OLDSCHOOL;
@ -3139,7 +3155,7 @@ NS_IMETHODIMP nsPluginHostImpl::GetPluginFactory(const char *aMimeType, nsIPlugi
}
}
if(plugin != nsnull)
if (plugin != nsnull)
{
*aPlugin = plugin;
plugin->AddRef();

Просмотреть файл

@ -113,8 +113,10 @@ char* CPlugin::sJavaScriptPage = NULL;
FSSpec CPlugin::sDataFileSpec;
extern short gResFile;
extern QDGlobals* gQDPtr;
#if !TARGET_API_MAC_CARBON
extern QDGlobals* gQDPtr;
#endif
// 'cicn'
const short rBrokenPluginIcon = 326;
@ -696,7 +698,12 @@ void CPlugin::Draw(HiliteState hilite)
RGBForeColor(&black);
RGBBackColor(&white);
#if !TARGET_API_MAC_CARBON
FillRect(&drawRect, &(gQDPtr->white));
#else
Pattern qdWhite;
FillRect(&drawRect, GetQDGlobalsWhite(&qdWhite));
#endif
if (hilite == kHilited) {
hiliteColor.red = 0xFFFF;
@ -784,8 +791,14 @@ Boolean CPlugin::FocusDraw()
{
GetPort(&fSavePort);
SetPort((GrafPtr) ourPort);
fSavePortTop = ourPort->portRect.top;
fSavePortLeft = ourPort->portRect.left;
Rect portRect;
#if !TARGET_API_MAC_CARBON
portRect = ourPort->portRect;
#else
GetPortBounds(ourPort, &portRect);
#endif
fSavePortTop = portRect.top;
fSavePortLeft = portRect.left;
GetClip(fSaveClip);
fRevealedRect.top = fWindow->clipRect.top + npport->porty;
@ -1051,8 +1064,13 @@ void CPlugin::AskAndLoadURL()
// NOTE: We need to set the cursor because almost always we will have set it to the
// hand cursor before we get here.
#if !TARGET_API_MAC_CARBON
SetCursor(&(gQDPtr->arrow));
#else
Cursor qdArrow;
SetCursor(GetQDGlobalsArrow(&qdArrow));
#endif
// Now that weÕve queried the user about this mime type,
// add it to our list so we wonÕt bug them again.
AddMimeTypeToList(ourType);

Просмотреть файл

@ -90,7 +90,9 @@
//
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
#if !TARGET_API_MAC_CARBON
QDGlobals* gQDPtr; // Pointer to NetscapeÕs QuickDraw globals
#endif
short gResFile; // Refnum of the pluginÕs resource file
NPNetscapeFuncs gNetscapeFuncs; // Function table for procs in Netscape called by plugin
@ -461,6 +463,7 @@ void SetUpQD(void)
//
gResFile = CurResFile();
#if !TARGET_API_MAC_CARBON
//
// Ask the system if CFM is available.
//
@ -526,21 +529,22 @@ void SetUpQD(void)
//
gQDPtr = (QDGlobals*)(*((long*)SetCurrentA5()) - (sizeof(QDGlobals) - sizeof(GrafPtr)));
}
#endif
}
NPError main(NPNetscapeFuncs* nsTable, NPPluginFuncs* pluginFuncs, NPP_ShutdownUPP* unloadUpp);
#if !TARGET_API_MAC_CARBON
#pragma export on
#if GENERATINGCFM
RoutineDescriptor mainRD = BUILD_ROUTINE_DESCRIPTOR(uppNPP_MainEntryProcInfo, main);
#endif
#pragma export off
#endif /* !TARGET_API_MAC_CARBON */
NPError main(NPNetscapeFuncs* nsTable, NPPluginFuncs* pluginFuncs, NPP_ShutdownUPP* unloadUpp)
DEFINE_API_C(NPError) main(NPNetscapeFuncs* nsTable, NPPluginFuncs* pluginFuncs, NPP_ShutdownUPP* unloadUpp)
{
EnterCodeResource();
PLUGINDEBUGSTR("\pmain");

437
netwerk/cache/filecache/nsDBAccessor.cpp поставляемый
Просмотреть файл

@ -1,437 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla Communicator.
*
* The Initial Developer of the Original Code is Intel Corp.
* Portions created by Intel Corp. are
* Copyright (C) 1999, 1999 Intel Corp. All
* Rights Reserved.
*
* Contributor(s): Yixiong Zou <yixiong.zou@intel.com>
* Carl Wong <carl.wong@intel.com>
*/
/*
* This file is part of filecache implementation.
*
* nsIDBAccessor is a interface that shields all the direct database access
* method from nsNetDiskCache.
*
* nsDBAccessor is a implementation of the nsIDBAccessor interface. It
* uses dbm(Berkely) as the database.
*
* a nsDiskCacheRecord is mapped into two entries in the database,
* key->recordID
* recordID->metadata
*/
#include "nsDBAccessor.h"
#include "nscore.h"
#include "prtypes.h"
#include "plhash.h"
#include "nsCRT.h"
#include "nsIFile.h"
nsDBAccessor::nsDBAccessor() :
mDB(0) ,
mDBFile(0) ,
mSessionID(0) ,
mSessionCntr(0)
{
mDBFilesize = LL_Zero();
mLastSyncTime = PR_IntervalNow() ;
NS_INIT_REFCNT();
}
nsDBAccessor::~nsDBAccessor()
{
Shutdown() ;
}
//
// Implement nsISupports methods
//
NS_IMPL_THREADSAFE_ISUPPORTS1(nsDBAccessor, nsIDBAccessor)
///////////////////////////////////////////////////////////
// nsIDBAccessor methods
NS_IMETHODIMP
nsDBAccessor::Init(nsIFile* dbfile)
{
char* dbname ;
// this should cover all platforms.
dbfile->GetPath(&dbname) ;
mDBFile = dbfile ;
// FUR - how is page size chosen ? It's worth putting a comment
// in here about the possible usefulness of tuning these parameters
HASHINFO hash_info = {
16*1024 , /* bucket size */
0 , /* fill factor */
0 , /* number of elements */
0 , /* bytes to cache */
0 , /* hash function */
0} ; /* byte order */
mDB = dbopen(dbname,
O_RDWR | O_CREAT ,
0600 ,
DB_HASH ,
& hash_info) ;
nsCRT::free(dbname) ;
if(!mDB)
return NS_ERROR_FAILURE ;
// set mSessionID
DBT db_key, db_data ;
db_key.data = NS_CONST_CAST(char*, SessionKey) ;
db_key.size = PL_strlen(SessionKey) ;
int status = (*mDB->get)(mDB, &db_key, &db_data, 0) ;
if(status == -1) {
NS_ERROR("ERROR: failed get session id in database.") ;
return NS_ERROR_FAILURE ;
}
if(status == 0) {
// get the last session id
PRInt16 old_ID;
memcpy(&old_ID, db_data.data, sizeof(PRInt16));
if(old_ID < ini_sessionID) {
NS_ERROR("ERROR: Bad Session ID in database, corrupted db.") ;
return NS_ERROR_FAILURE ;
}
mSessionID = old_ID + 1 ;
}
else if(status == 1) {
// must be a new db
mSessionID = ini_sessionID ;
}
db_data.data = NS_REINTERPRET_CAST(void*, &mSessionID) ;
db_data.size = sizeof(PRInt16) ;
// store the new session id
status = (*mDB->put)(mDB, &db_key, &db_data, 0) ;
if(status == 0) {
(*mDB->sync)(mDB, 0) ;
// initialize database filesize
return mDBFile->GetFileSize(&mDBFilesize) ;
}
else {
NS_ERROR("reset session ID failure.") ;
return NS_ERROR_FAILURE ;
}
}
NS_IMETHODIMP
nsDBAccessor::Shutdown(void)
{
if(mDB) {
(*mDB->sync)(mDB, 0) ;
(*mDB->close)(mDB) ;
mDB = nsnull ;
}
return NS_OK ;
}
NS_IMETHODIMP
nsDBAccessor::Get(PRInt32 aID, void** anEntry, PRUint32 *aLength)
{
if(!anEntry)
return NS_ERROR_NULL_POINTER ;
*anEntry = nsnull ;
*aLength = 0 ;
NS_ASSERTION(mDB, "no database") ;
if(!mDB)
return NS_ERROR_FAILURE ;
DBT db_key, db_data ;
db_key.data = NS_REINTERPRET_CAST(void*, &aID) ;
db_key.size = sizeof(PRInt32) ;
int status = 0 ;
status = (*mDB->get)(mDB, &db_key, &db_data, 0) ;
if(status == 0) {
*anEntry = db_data.data ;
*aLength = db_data.size ;
return NS_OK ;
}
else if(status == 1)
return NS_OK ;
else
return NS_ERROR_FAILURE ;
}
NS_IMETHODIMP
nsDBAccessor::Put(PRInt32 aID, void* anEntry, PRUint32 aLength)
{
NS_ASSERTION(mDB, "no database") ;
if(!mDB)
return NS_ERROR_FAILURE ;
DBT db_key, db_data ;
db_key.data = NS_REINTERPRET_CAST(void*, &aID) ;
db_key.size = sizeof(PRInt32) ;
db_data.data = anEntry ;
db_data.size = aLength ;
if(0 == (*mDB->put)(mDB, &db_key, &db_data, 0)) {
return Sync() ;
}
else {
return NS_ERROR_FAILURE ;
}
}
/*
* It's more important to remove the id->metadata entry first since
* key->id mapping is just a reference
*/
NS_IMETHODIMP
nsDBAccessor::Del(PRInt32 aID, void* anEntry, PRUint32 aLength)
{
NS_ASSERTION(mDB, "no database") ;
if(!mDB)
return NS_ERROR_FAILURE ;
DBT db_key ;
// delete recordID->metadata
db_key.data = NS_REINTERPRET_CAST(void*, &aID) ;
db_key.size = sizeof(PRInt32) ;
PRInt32 status = -1 ;
status = (*mDB->del)(mDB, &db_key, 0) ;
if(-1 == status) {
return NS_ERROR_FAILURE ;
}
// delete key->recordID
db_key.data = anEntry ;
db_key.size = aLength ;
status = (*mDB->del)(mDB, &db_key, 0) ;
if(-1 == status) {
return NS_ERROR_FAILURE ;
}
return Sync() ;
}
NS_IMETHODIMP
nsDBAccessor::GetID(const char* key, PRUint32 length, PRInt32* aID)
{
NS_ASSERTION(mDB, "no database") ;
if(!mDB)
return NS_ERROR_FAILURE ;
DBT db_key, db_data ;
db_key.data = NS_CONST_CAST(char*, key) ;
db_key.size = length ;
int status = (*mDB->get)(mDB, &db_key, &db_data, 0) ;
if(status == 0) {
// found recordID
memcpy(aID, db_data.data, sizeof(PRInt32));
return NS_OK ;
}
else if(status == 1) {
// create a new one
PRInt32 id = 0 ;
id = mSessionID << 16 | mSessionCntr++ ;
// add new id into mDB
db_data.data = NS_REINTERPRET_CAST(void*, &id) ;
db_data.size = sizeof(PRInt32) ;
status = (*mDB->put)(mDB, &db_key, &db_data, 0) ;
if(status != 0) {
NS_ERROR("updating db failure.") ;
return NS_ERROR_FAILURE ;
}
*aID = id ;
return Sync() ;
}
else {
NS_ERROR("ERROR: keydb failure.") ;
return NS_ERROR_FAILURE ;
}
}
NS_IMETHODIMP
nsDBAccessor::EnumEntry(void** anEntry, PRUint32* aLength, PRBool bReset)
{
if(!anEntry)
return NS_ERROR_NULL_POINTER ;
*anEntry = nsnull ;
*aLength = 0 ;
NS_ASSERTION(mDB, "no database") ;
if(!mDB)
return NS_ERROR_FAILURE ;
PRUint32 flag ;
if(bReset)
flag = R_FIRST ;
else
flag = R_NEXT ;
DBT db_key, db_data ;
PRUint32 len = PL_strlen(SessionKey) ;
int status ;
do {
status = (*mDB->seq)(mDB, &db_key, &db_data, flag) ;
flag = R_NEXT ;
if(status == -1)
return NS_ERROR_FAILURE ;
// get next if it's a key->recordID
if(db_key.size > sizeof(PRInt32) && db_data.size == sizeof(PRInt32))
continue ;
// get next if it's a sessionID entry
if(db_key.size == len && db_data.size == sizeof(PRInt16))
continue ;
// recordID is always 32 bits long
if(db_key.size == sizeof(PRInt32))
break ;
} while(!status) ;
if (0 == status) {
*anEntry = db_data.data ;
*aLength = db_data.size ;
}
return NS_OK ;
}
/*
* returns the cached database file size.
* mDBFilesize will be updated during Sync().
*/
NS_IMETHODIMP
nsDBAccessor::GetDBFilesize(PRUint64* aSize)
{
*aSize = mDBFilesize ;
return NS_OK ;
}
NS_IMETHODIMP
nsDBAccessor::GetSizeEntry(void** anEntry, PRUint32* aLength)
{
if(!anEntry)
return NS_ERROR_NULL_POINTER ;
NS_ASSERTION(mDB, "no database") ;
if(!mDB)
return NS_ERROR_FAILURE ;
*anEntry = nsnull ;
*aLength = 0 ;
DBT db_key, db_data ;
db_key.data = NS_CONST_CAST(char*, SizeEntry) ;
db_key.size = PL_strlen(SizeEntry) ;
int status = (*mDB->get)(mDB, &db_key, &db_data, 0) ;
if(status == -1) {
NS_ERROR("ERROR: failed get special entry in database.") ;
return NS_ERROR_FAILURE ;
}
if(status == 0) {
*anEntry = db_data.data ;
*aLength = db_data.size ;
}
return NS_OK ;
}
NS_IMETHODIMP
nsDBAccessor::SetSizeEntry(void* anEntry, PRUint32 aLength)
{
NS_ASSERTION(mDB, "no database") ;
if( !mDB )
return NS_ERROR_FAILURE;
DBT db_key, db_data ;
db_key.data = NS_CONST_CAST(char*, SizeEntry) ;
db_key.size = PL_strlen(SizeEntry) ;
db_data.data = anEntry ;
db_data.size = aLength ;
if(0 == (*mDB->put)(mDB, &db_key, &db_data, 0)) {
(*mDB->sync)(mDB, 0) ;
return NS_OK ;
}
else {
return NS_ERROR_FAILURE ;
}
}
/*
* sync routine is only called when the SyncInterval is reached. Otherwise
* it just returns. If db synced, the filesize will be updated at the
* same time.
*/
nsresult
nsDBAccessor::Sync(void)
{
PRIntervalTime time = PR_IntervalNow() ;
PRIntervalTime duration = time - mLastSyncTime ;
NS_ASSERTION(mDB, "no database") ;
if(!mDB)
return NS_ERROR_FAILURE ;
if (PR_IntervalToMilliseconds(duration) > SyncInterval) {
int status = (*mDB->sync)(mDB, 0) ;
if(status == 0) {
// printf("\tsynced\n") ;
mLastSyncTime = time ;
// update db filesize here
return mDBFile->GetFileSize(&mDBFilesize) ;
} else
return NS_ERROR_FAILURE ;
} else {
// printf("\tnot synced\n") ;
return NS_OK ;
}
}

Двоичные данные
netwerk/macbuild/netwerk.mcp

Двоичный файл не отображается.

Просмотреть файл

@ -51,6 +51,8 @@
#include <string>
using namespace std;
extern nsIPluginManager* thePluginManager;
extern nsIPluginManager2* thePluginManager2;

Просмотреть файл

@ -33,7 +33,7 @@
/*
** applefile definitions used
*/
#if PRAGMA_ALIGN_SUPPORTED
#if PRAGMA_STRUCT_ALIGN
#pragma options align=mac68k
#endif
@ -78,7 +78,7 @@ typedef struct ap_dates
} ap_dates;
#if PRAGMA_ALIGN_SUPPORTED
#if PRAGMA_STRUCT_ALIGN
#pragma options align=reset
#endif

Двоичные данные
widget/macbuild/widget.mcp

Двоичный файл не отображается.

Просмотреть файл

@ -283,8 +283,8 @@ nsFilePicker::GetLocalFile(Str255 & inTitle, /* filter list here later */ FSSpec
PRInt16 retVal = returnCancel;
NavReplyRecord reply;
NavDialogOptions dialogOptions;
NavEventUPP eventProc = NewNavEventProc(FileDialogEventHandlerProc); // doesn't really matter if this fails
NavObjectFilterUPP filterProc = NewNavObjectFilterProc(FileDialogFilterProc); // doesn't really matter if this fails
NavEventUPP eventProc = NewNavEventUPP(FileDialogEventHandlerProc); // doesn't really matter if this fails
NavObjectFilterUPP filterProc = NewNavObjectFilterUPP(FileDialogFilterProc); // doesn't really matter if this fails
OSErr anErr = NavGetDefaultDialogOptions(&dialogOptions);
if (anErr == noErr) {
@ -357,7 +357,7 @@ nsFilePicker::GetLocalFolder(Str255 & inTitle, FSSpec* outSpec)
PRInt16 retVal = returnCancel;
NavReplyRecord reply;
NavDialogOptions dialogOptions;
NavEventUPP eventProc = NewNavEventProc(FileDialogEventHandlerProc); // doesn't really matter if this fails
NavEventUPP eventProc = NewNavEventUPP(FileDialogEventHandlerProc); // doesn't really matter if this fails
OSErr anErr = NavGetDefaultDialogOptions(&dialogOptions);
if (anErr == noErr) {
@ -413,7 +413,7 @@ nsFilePicker::PutLocalFile(Str255 & inTitle, Str255 & inDefaultName, FSSpec* out
PRInt16 retVal = returnCancel;
NavReplyRecord reply;
NavDialogOptions dialogOptions;
NavEventUPP eventProc = NewNavEventProc(FileDialogEventHandlerProc); // doesn't really matter if this fails
NavEventUPP eventProc = NewNavEventUPP(FileDialogEventHandlerProc); // doesn't really matter if this fails
OSType typeToSave = 'TEXT';
OSType creatorToSave = 'MOZZ';

Просмотреть файл

@ -235,7 +235,7 @@ nsFileWidget :: PutFile ( Str255 & inTitle, Str255 & inDefaultName, FSSpec* outS
PRBool retVal = PR_FALSE;
NavReplyRecord reply;
NavDialogOptions dialogOptions;
NavEventUPP eventProc = NewNavEventProc(myProc); // doesn't really matter if this fails
NavEventUPP eventProc = NewNavEventUPP(myProc); // doesn't really matter if this fails
OSType typeToSave = 'TEXT';
OSType creatorToSave = 'MOZZ';
@ -313,7 +313,7 @@ nsFileWidget :: GetFile ( Str255 & inTitle, /* filter list here later */ FSSpec*
PRBool retVal = PR_FALSE;
NavReplyRecord reply;
NavDialogOptions dialogOptions;
NavEventUPP eventProc = NewNavEventProc(myProc); // doesn't really matter if this fails
NavEventUPP eventProc = NewNavEventUPP(myProc); // doesn't really matter if this fails
OSErr anErr = NavGetDefaultDialogOptions(&dialogOptions);
if (anErr == noErr) {
@ -383,7 +383,7 @@ nsFileWidget :: GetFolder ( Str255 & inTitle, FSSpec* outSpec )
PRBool retVal = PR_FALSE;
NavReplyRecord reply;
NavDialogOptions dialogOptions;
NavEventUPP eventProc = NewNavEventProc(myProc); // doesn't really matter if this fails
NavEventUPP eventProc = NewNavEventUPP(myProc); // doesn't really matter if this fails
OSErr anErr = NavGetDefaultDialogOptions(&dialogOptions);
if (anErr == noErr) {

Просмотреть файл

@ -365,7 +365,7 @@ nsMacEventHandler::nsMacEventHandler(nsMacWindow* aTopLevelWidget)
mIMEIsComposing = PR_FALSE;
mIMECompositionStr=nsnull;
mControlActionProc = NewControlActionProc(ScrollActionProc);
mControlActionProc = NewControlActionUPP(ScrollActionProc);
}

Просмотреть файл

@ -828,6 +828,7 @@ void nsMacMessagePump::DoMenu(EventRecord &anEvent, long menuResult)
// The app can handle its menu commands here or
// in the nsNativeBrowserWindow and nsNativeViewerApp
#if !TARGET_CARBON
extern const PRInt16 kAppleMenuID; // Danger Will Robinson!!! - this currently requires
// APPLE_MENU_HACK to be defined in nsMenu.h
// One of these days it'll become a non-hack
@ -844,14 +845,14 @@ extern const PRInt16 kAppleMenuID; // Danger Will Robinson!!! - this currently r
::GetMenuItemText(::GetMenuHandle(kAppleMenuID), theItem, daName);
::GetPort(&savePort);
#if !TARGET_CARBON
::OpenDeskAcc(daName);
#endif
::SetPort(savePort);
HiliteMenu(0);
return;
}
}
#endif
// Note that we still give Raptor a shot at the event as it will eventually
// handle the About... selection

Просмотреть файл

@ -49,14 +49,14 @@ nsMacTSMMessagePump::nsMacTSMMessagePump()
{
OSErr err;
mPos2OffsetUPP = NewAEEventHandlerProc(nsMacTSMMessagePump::PositionToOffsetHandler);
NS_ASSERTION(mPos2OffsetUPP!=NULL,"nsMacTSMMessagePump::InstallTSMAEHandlers: NewAEEventHandlerProc[Pos2Pffset] failed");
mPos2OffsetUPP = NewAEEventHandlerUPP(nsMacTSMMessagePump::PositionToOffsetHandler);
NS_ASSERTION(mPos2OffsetUPP!=NULL,"nsMacTSMMessagePump::InstallTSMAEHandlers: NewAEEventHandlerUPP[Pos2Pffset] failed");
mOffset2PosUPP = NewAEEventHandlerProc(nsMacTSMMessagePump::OffsetToPositionHandler);
NS_ASSERTION(mPos2OffsetUPP!=NULL,"nsMacTSMMessagePump::InstallTSMAEHandlers: NewAEEventHandlerProc[Pos2Pffset] failed");
mOffset2PosUPP = NewAEEventHandlerUPP(nsMacTSMMessagePump::OffsetToPositionHandler);
NS_ASSERTION(mPos2OffsetUPP!=NULL,"nsMacTSMMessagePump::InstallTSMAEHandlers: NewAEEventHandlerUPP[Pos2Pffset] failed");
mUpdateUPP = NewAEEventHandlerProc(nsMacTSMMessagePump::UpdateHandler);
NS_ASSERTION(mPos2OffsetUPP!=NULL,"nsMacTSMMessagePump::InstallTSMAEHandlers: NewAEEventHandlerProc[Pos2Pffset] failed");
mUpdateUPP = NewAEEventHandlerUPP(nsMacTSMMessagePump::UpdateHandler);
NS_ASSERTION(mPos2OffsetUPP!=NULL,"nsMacTSMMessagePump::InstallTSMAEHandlers: NewAEEventHandlerUPP[Pos2Pffset] failed");
err = AEInstallEventHandler(kTextServiceClass,kPos2Offset,mPos2OffsetUPP,(long)this,false);
NS_ASSERTION(err==noErr,"nsMacTSMMessagePump::InstallTSMAEHandlers: AEInstallEventHandlers[Pos2Offset] failed");
@ -114,7 +114,7 @@ void nsMacTSMMessagePump::Shutdown()
//
//-------------------------------------------------------------------------
pascal OSErr nsMacTSMMessagePump::PositionToOffsetHandler(const AppleEvent *theAppleEvent, AppleEvent *reply, UInt32 handlerRefcon)
pascal OSErr nsMacTSMMessagePump::PositionToOffsetHandler(const AppleEvent *theAppleEvent, AppleEvent *reply, long handlerRefcon)
{
OSErr err;
DescType returnedType;
@ -163,7 +163,7 @@ pascal OSErr nsMacTSMMessagePump::PositionToOffsetHandler(const AppleEvent *theA
return noErr;
}
pascal OSErr nsMacTSMMessagePump::OffsetToPositionHandler(const AppleEvent *theAppleEvent, AppleEvent *reply, UInt32 handlerRefcon)
pascal OSErr nsMacTSMMessagePump::OffsetToPositionHandler(const AppleEvent *theAppleEvent, AppleEvent *reply, long handlerRefcon)
{
OSErr err;
DescType returnedType;
@ -209,7 +209,7 @@ pascal OSErr nsMacTSMMessagePump::OffsetToPositionHandler(const AppleEvent *theA
return noErr;
}
pascal OSErr nsMacTSMMessagePump::UpdateHandler(const AppleEvent *theAppleEvent, AppleEvent *reply, UInt32 handlerRefcon)
pascal OSErr nsMacTSMMessagePump::UpdateHandler(const AppleEvent *theAppleEvent, AppleEvent *reply, long handlerRefcon)
{
OSErr err;
DescType returnedType;

Просмотреть файл

@ -45,9 +45,9 @@ public:
void Shutdown();
private:
static pascal OSErr PositionToOffsetHandler(const AppleEvent *theAppleEvent, AppleEvent *reply, UInt32 handlerRefcon);
static pascal OSErr OffsetToPositionHandler(const AppleEvent *theAppleEvent, AppleEvent *reply, UInt32 handlerRefcon);
static pascal OSErr UpdateHandler(const AppleEvent *theAppleEvent, AppleEvent *reply, UInt32 handlerRefcon);
static pascal OSErr PositionToOffsetHandler(const AppleEvent *theAppleEvent, AppleEvent *reply, long handlerRefcon);
static pascal OSErr OffsetToPositionHandler(const AppleEvent *theAppleEvent, AppleEvent *reply, long handlerRefcon);
static pascal OSErr UpdateHandler(const AppleEvent *theAppleEvent, AppleEvent *reply, long handlerRefcon);
static AEEventHandlerUPP mPos2OffsetUPP;
static AEEventHandlerUPP mOffset2PosUPP;
static AEEventHandlerUPP mUpdateUPP;

Просмотреть файл

@ -380,7 +380,6 @@ nsresult nsMacWindow::StandardCreate(nsIWidget *aParent,
break;
case eWindowType_dialog:
#if !TARGET_CARBON
if (aInitData)
{
switch (aInitData->mBorderStyle)
@ -426,7 +425,6 @@ nsresult nsMacWindow::StandardCreate(nsIWidget *aParent,
hOffset = kDialogMarginWidth;
vOffset = kDialogTitleBarHeight;
break;
#endif
case eWindowType_toplevel:
if (aInitData &&
@ -581,7 +579,7 @@ NS_IMETHODIMP nsMacWindow::Show(PRBool bState)
// we need to make sure we call ::Show/HideWindow() to generate the
// necessary activate/deactivate events. Calling ::ShowHide() is
// not adequate, unless we don't want activation (popups). (pinkerton).
if ( bState ) {
if ( bState && !mBounds.IsEmpty() ) {
if ( mAcceptsActivation )
::ShowWindow(mWindowPtr);
else {

Просмотреть файл

@ -27,6 +27,7 @@
#include "nsIMenuListener.h"
#include "nsIDocumentObserver.h"
#include "nsIChangeManager.h"
#include "nsIPresContext.h"
#include "nsSupportsArray.h"
#include "nsVoidArray.h"
#include "nsHashtable.h"

Просмотреть файл

@ -51,7 +51,7 @@ nsScrollbar::nsScrollbar(PRBool /*aIsVertical*/)
WIDGET_SET_CLASSNAME("nsScrollbar");
SetControlType(kControlScrollBarLiveProc);
if (!sControlActionProc)
sControlActionProc = NewControlActionProc(nsScrollbar::ScrollActionProc);
sControlActionProc = NewControlActionUPP(nsScrollbar::ScrollActionProc);
// Unfortunately, not disposed when the app quits, but that's still a non-issue.
}

Просмотреть файл

@ -320,7 +320,10 @@ OSErr nsMacMemoryCushion::Init(Size bufferSize, Size reserveSize)
// make this purgable
::HPurge(mBufferHandle);
#if !TARGET_CARBON
::SetGrowZone(NewGrowZoneProc(GrowZoneProc));
#endif
return noErr;
}

Просмотреть файл

@ -36,9 +36,22 @@
#include "nsFilePicker.h"
#include "nsFileSpecWithUIImpl.h"
#include "nsScrollbar.h"
#if TARGET_CARBON
#include "nsMenuBarX.h"
#include "nsMenuX.h"
#include "nsMenuItemX.h"
#define nsMenuBar nsMenuBarX
#define nsMenu nsMenuX
#define nsMenuItem nsMenuItemX
#else
#include "nsMenuBar.h"
#include "nsMenu.h"
#include "nsMenuItem.h"
#endif
#include "nsFileWidget.h"
#include "nsClipboard.h"

Просмотреть файл

@ -751,7 +751,8 @@ nsNativeComponentLoader::AutoRegisterComponent(PRInt32 when,
// so that 3rd party shared libraries will be noticed!
validExtension = ((type == 'shlb') || (type == 'NSPL'));
}
#if !TARGET_CARBON
if (validExtension)
{
// This call to SystemTask is here to give the OS time to grow it's
@ -760,6 +761,7 @@ nsNativeComponentLoader::AutoRegisterComponent(PRInt32 when,
// story.
::SystemTask();
}
#endif
}
#else

Просмотреть файл

@ -42,7 +42,7 @@ extern CWPluginContext gPluginContext;
* global data. Just be careful out there!
*/
const bool kTemporaryAllocation = false;
const Boolean kTemporaryAllocation = false;
void* operator new(size_t size)
{

Просмотреть файл

@ -120,7 +120,7 @@ static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
#include "nsIDOMXULDocument.h"
// End hack
#if (defined(XP_MAC) && !TARGET_CARBON) || defined(RHAPSODY)
#if defined(XP_MAC) || defined(RHAPSODY)
#define USE_NATIVE_MENUS
#endif