remerge with head

git-svn-id: svn://10.0.0.236/branches/GTK2_BRANCH@113529 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
blizzard%redhat.com
2002-02-02 19:08:15 +00:00
parent 612edbfe49
commit 6342ea2aef
18 changed files with 721 additions and 373 deletions

View File

@@ -162,6 +162,13 @@ interface nsIPrintOptions : nsISupports
*/
nsIPrintSettings CreatePrintSettings();
/**
* Creates a new PrintSettnigs Object if it doesn't exist
* otherwise it always hand back the same one.
* This is THE global PrintSettings
*/
readonly attribute nsIPrintSettings globalPrintSettings;
/**
* Initialize the values in the PrintSettings from Prefs
*/
@@ -243,14 +250,6 @@ interface nsIPrintOptions : nsISupports
*/
nsISimpleEnumerator availablePrinters ();
/**
* Indicates whether the list of printers contains the extended
* information. i.e. That there are "pairs" of values returned. Where the second
* value is either "FILE", "PRINTER", "BOTH"
*
*/
readonly attribute boolean isExtended;
/**
* display Printer Job Properties dialog
*/
@@ -276,25 +275,6 @@ interface nsIPrinterEnumerator : nsISupports
*/
void enumeratePrinters(out PRUint32 aCount,[retval, array, size_is(aCount)] out wstring aResult);
/**
* Returns an array of "pairs" of strings
* The first string in the pair is the printer name
* the second string in the pair is can be "FILE", "PRINTER", or "BOTH"
* which indicates whether the printer driver associated with this printer
* ALWAYS "spools" to a file or to a printer.
*
* If this type of information is not available, it should return zero items
*
* Note: On some platforms any given driveris able to spool to either
*
* @param aCount returns number of printers AND info strings returned
* i.e If there are 5 printers define the
* "count" returned will be 10
* @param aResult returns array of names
* @return void
*/
void enumeratePrintersExtended(out PRUint32 aCount,[retval, array, size_is(aCount)] out wstring aResult);
/* takes printer selected and will display job properties dlg for that printer
* returns true if dialog displays
*/

View File

@@ -487,15 +487,6 @@ nsPrinterEnumeratorBeOS::nsPrinterEnumeratorBeOS()
NS_IMPL_ISUPPORTS1(nsPrinterEnumeratorBeOS, nsIPrinterEnumerator)
NS_IMETHODIMP nsPrinterEnumeratorBeOS::EnumeratePrintersExtended(PRUint32* aCount, PRUnichar*** aResult)
{
NS_ENSURE_ARG(aCount);
NS_ENSURE_ARG_POINTER(aResult);
*aCount = 0;
*aResult = nsnull;
return NS_OK;
}
NS_IMETHODIMP nsPrinterEnumeratorBeOS::EnumeratePrinters(PRUint32* aCount, PRUnichar*** aResult)
{
NS_ENSURE_ARG(aCount);

View File

@@ -480,15 +480,6 @@ nsPrinterEnumeratorGTK::nsPrinterEnumeratorGTK()
NS_IMPL_ISUPPORTS1(nsPrinterEnumeratorGTK, nsIPrinterEnumerator)
NS_IMETHODIMP nsPrinterEnumeratorGTK::EnumeratePrintersExtended(PRUint32* aCount, PRUnichar*** aResult)
{
NS_ENSURE_ARG(aCount);
NS_ENSURE_ARG_POINTER(aResult);
*aCount = 0;
*aResult = nsnull;
return NS_OK;
}
NS_IMETHODIMP nsPrinterEnumeratorGTK::EnumeratePrinters(PRUint32* aCount, PRUnichar*** aResult)
{
NS_ENSURE_ARG(aCount);

View File

@@ -478,14 +478,14 @@ nsImageMac::UnlockImagePixels(PRBool aMaskPixels)
#pragma mark -
/** -----------------------------------------------------------------
* Create a PixMap, filling in ioPixMap
* Create a PixMap, filling in ioPixMap
*/
OSErr nsImageMac::CreatePixMap( PRInt32 aWidth, PRInt32 aHeight,
PRInt32 aDepth, CTabHandle aColorTable,
PixMap& ioPixMap, Handle& ioBitsHandle)
{
CreatePixMapInternal( aWidth, aHeight, aDepth, aColorTable,
ioPixMap, ioBitsHandle, PR_FALSE);
OSErr nsImageMac::CreatePixMap( PRInt32 aWidth, PRInt32 aHeight,
PRInt32 aDepth, CTabHandle aColorTable,
PixMap& ioPixMap, Handle& ioBitsHandle)
{
return CreatePixMapInternal(aWidth, aHeight, aDepth, aColorTable,
ioPixMap, ioBitsHandle, PR_FALSE);
}
@@ -703,7 +703,7 @@ PRInt32 nsImageMac::CalculateRowBytesInternal(PRUint32 aWidth, PRUint32 aDepth,
*/
PRInt32 nsImageMac::CalculateRowBytes(PRUint32 aWidth, PRUint32 aDepth)
{
CalculateRowBytesInternal(aWidth, aDepth, PR_FALSE);
return CalculateRowBytesInternal(aWidth, aDepth, PR_FALSE);
}
#pragma mark -
@@ -1132,12 +1132,12 @@ nsImageMac::CopyPixMap(Rect& aSrcRegion,
)
{
CopyPixMapInternal(aSrcRegion,
aDestRegion,
aDestDepth,
aCopyMaskBits,
aDestData,
PR_FALSE);
return CopyPixMapInternal(aSrcRegion,
aDestRegion,
aDestDepth,
aCopyMaskBits,
aDestData,
PR_FALSE);
}

View File

@@ -663,6 +663,14 @@ nsNativeThemeMac::DrawWidgetBackground(nsIRenderingContext* aContext, nsIFrame*
::EraseRect(&macRect);
break;
case NS_THEME_TOOLTIP:
{
RGBColor yellow = {65535,65535,45000};
::RGBBackColor(&yellow);
::EraseRect(&macRect);
break;
}
case NS_THEME_CHECKBOX:
DrawCheckbox ( macRect, IsChecked(aFrame), IsDisabled(aFrame), eventState );
break;
@@ -894,7 +902,6 @@ nsNativeThemeMac::GetMinimumWidgetSize(nsIRenderingContext* aContext, nsIFrame*
::GetThemeMetric(kThemeMetricCheckBoxHeight, &radioHeight);
aResult->SizeTo(radioWidth, radioHeight);
*aIsOverridable = PR_FALSE;
aResult->SizeTo(18,18);
break;
}
@@ -1037,6 +1044,7 @@ nsNativeThemeMac::ThemeSupportsWidget(nsIPresContext* aPresContext,
case NS_THEME_DIALOG:
case NS_THEME_WINDOW:
case NS_THEME_MENU:
case NS_THEME_TOOLTIP:
case NS_THEME_CHECKBOX:
case NS_THEME_CHECKBOX_CONTAINER:

View File

@@ -300,10 +300,10 @@ nsUnicodeMappingUtil::PrefEnumCallback(const char* aName, void* aClosure)
nsUnicodeMappingUtil* Self = (nsUnicodeMappingUtil*)aClosure;
nsCAutoString curPrefName(aName);
PRInt32 p1 = curPrefName.RFindChar('.', PR_TRUE);
PRInt32 p1 = curPrefName.RFindChar('.');
if(-1==p1)
return;
PRInt32 p2 = curPrefName.RFindChar('.', PR_TRUE, p1-1);
PRInt32 p2 = curPrefName.RFindChar('.', p1-1);
if(-1==p1)
return;

View File

@@ -128,8 +128,7 @@ nsPrintOptions::nsPrintOptions() :
mPrintReversed(PR_FALSE),
mPrintInColor(PR_TRUE),
mOrientation(kPortraitOrientation),
mPrintToFile(PR_FALSE),
mIsExtendedInfo(PR_FALSE)
mPrintToFile(PR_FALSE)
{
NS_INIT_ISUPPORTS();
@@ -183,7 +182,7 @@ nsPrinterListEnumerator : public nsISimpleEnumerator
//nsISimpleEnumerator interface
NS_DECL_NSISIMPLEENUMERATOR
NS_IMETHOD Init(PRBool& aIsExtendedInfo);
NS_IMETHOD Init();
protected:
PRUnichar **mPrinters;
@@ -210,7 +209,7 @@ nsPrinterListEnumerator::~nsPrinterListEnumerator()
NS_IMPL_ISUPPORTS1(nsPrinterListEnumerator, nsISimpleEnumerator)
NS_IMETHODIMP nsPrinterListEnumerator::Init(PRBool& aIsExtended)
NS_IMETHODIMP nsPrinterListEnumerator::Init()
{
nsresult rv;
nsCOMPtr<nsIPrinterEnumerator> printerEnumerator;
@@ -219,17 +218,7 @@ NS_IMETHODIMP nsPrinterListEnumerator::Init(PRBool& aIsExtended)
if (NS_FAILED(rv))
return rv;
// First check to see if we can get the extended printer informations
// if not then get the regular
rv = printerEnumerator->EnumeratePrintersExtended(&mCount, &mPrinters);
if (NS_SUCCEEDED(rv) && mCount > 0) {
aIsExtended = PR_TRUE;
} else {
aIsExtended = PR_FALSE;
rv = printerEnumerator->EnumeratePrinters(&mCount, &mPrinters);
}
return rv;
return printerEnumerator->EnumeratePrinters(&mCount, &mPrinters);
}
NS_IMETHODIMP nsPrinterListEnumerator::HasMoreElements(PRBool *result)
@@ -708,7 +697,7 @@ NS_IMETHODIMP nsPrintOptions::AvailablePrinters(nsISimpleEnumerator **aPrinterEn
NS_ENSURE_TRUE(printerListEnum.get(), NS_ERROR_OUT_OF_MEMORY);
// if Init fails NS_OK is return (script needs NS_OK) but the enumerator will be null
nsresult rv = printerListEnum->Init(mIsExtendedInfo);
nsresult rv = printerListEnum->Init();
if (NS_SUCCEEDED(rv)) {
*aPrinterEnumerator = NS_STATIC_CAST(nsISimpleEnumerator*, printerListEnum);
NS_ADDREF(*aPrinterEnumerator);
@@ -716,15 +705,6 @@ NS_IMETHODIMP nsPrintOptions::AvailablePrinters(nsISimpleEnumerator **aPrinterEn
return NS_OK;
}
/* readonly attribute boolean isExtended; */
NS_IMETHODIMP nsPrintOptions::GetIsExtended(PRBool *aIsExtended)
{
NS_ENSURE_ARG(aIsExtended);
*aIsExtended = mIsExtendedInfo;
return NS_OK;
}
NS_IMETHODIMP nsPrintOptions::DisplayJobProperties( const PRUnichar *aPrinter, nsIPrintSettings* aPrintSettings, PRBool *aDisplayed)
{
NS_ENSURE_ARG(aPrinter);
@@ -897,8 +877,11 @@ NS_IMETHODIMP nsPrintOptions::GetTitle(PRUnichar * *aTitle)
}
NS_IMETHODIMP nsPrintOptions::SetTitle(const PRUnichar * aTitle)
{
NS_ENSURE_ARG_POINTER(aTitle);
mTitle = aTitle;
if (aTitle) {
mTitle = aTitle;
} else {
mTitle.SetLength(0);
}
return NS_OK;
}
@@ -911,8 +894,11 @@ NS_IMETHODIMP nsPrintOptions::GetDocURL(PRUnichar * *aDocURL)
}
NS_IMETHODIMP nsPrintOptions::SetDocURL(const PRUnichar * aDocURL)
{
NS_ENSURE_ARG_POINTER(aDocURL);
mURL = aDocURL;
if (aDocURL) {
mURL = aDocURL;
} else {
mURL.SetLength(0);
}
return NS_OK;
}
@@ -1395,6 +1381,25 @@ NS_IMETHODIMP nsPrintOptions::CreatePrintSettings(nsIPrintSettings **_retval)
return rv;
}
/* readonly attribute nsIPrintSettings globalPrintSettings; */
NS_IMETHODIMP nsPrintOptions::GetGlobalPrintSettings(nsIPrintSettings * *aGlobalPrintSettings)
{
if (!mGlobalPrintSettings) {
CreatePrintSettings(getter_AddRefs(mGlobalPrintSettings));
NS_ASSERTION(mGlobalPrintSettings, "Can't be NULL!");
}
// If this still NULL, we have some very big problems going on
if (!mGlobalPrintSettings) {
return NS_ERROR_FAILURE;
}
*aGlobalPrintSettings = mGlobalPrintSettings.get();
NS_ADDREF(*aGlobalPrintSettings);
return NS_OK;
}
//-----------------------------------------------------
//-- Protected Methods

View File

@@ -104,7 +104,7 @@ protected:
PRBool mPrintToFile;
nsString mToFileName;
PRBool mIsExtendedInfo;
nsCOMPtr<nsIPrintSettings> mGlobalPrintSettings;
static nsFont* sDefaultFont;
};

View File

@@ -345,15 +345,6 @@ nsPrinterEnumeratorOS2::nsPrinterEnumeratorOS2()
NS_IMPL_ISUPPORTS1(nsPrinterEnumeratorOS2, nsIPrinterEnumerator)
NS_IMETHODIMP nsPrinterEnumeratorOS2::EnumeratePrintersExtended(PRUint32* aCount, PRUnichar*** aResult)
{
NS_ENSURE_ARG(aCount);
NS_ENSURE_ARG_POINTER(aResult);
*aCount = 0;
*aResult = nsnull;
return NS_OK;
}
NS_IMETHODIMP nsPrinterEnumeratorOS2::EnumeratePrinters(PRUint32* aCount, PRUnichar*** aResult)
{
NS_ENSURE_ARG(aCount);

View File

@@ -139,11 +139,6 @@ nsPrinterEnumeratorPh::~nsPrinterEnumeratorPh()
NS_IMPL_ISUPPORTS1(nsPrinterEnumeratorPh, nsIPrinterEnumerator)
NS_IMETHODIMP nsPrinterEnumeratorPh::EnumeratePrintersExtended(PRUint32* aCount, PRUnichar*** aResult)
{
return DoEnumeratePrinters(PR_TRUE, aCount, aResult);
}
//----------------------------------------------------------------------------------
// Enumerate all the Printers from the global array and pass their
// names back (usually to script)
@@ -175,9 +170,8 @@ static void CleanupArray(PRUnichar**& aArray, PRInt32& aCount)
nsresult
nsPrinterEnumeratorPh::DoEnumeratePrinters(PRBool aDoExtended,
PRUint32* aCount,
PRUnichar*** aResult)
nsPrinterEnumeratorPh::DoEnumeratePrinters(PRUint32* aCount,
PRUnichar*** aResult)
{
NS_ENSURE_ARG(aCount);
NS_ENSURE_ARG_POINTER(aResult);

View File

@@ -75,7 +75,7 @@ public:
private:
// helper
nsresult DoEnumeratePrinters(PRBool aDoExtended, PRUint32* aCount, PRUnichar*** aResult);
nsresult DoEnumeratePrinters(PRUint32* aCount, PRUnichar*** aResult);
};

View File

@@ -31,3 +31,4 @@ PrintFrames=Print Frames
Aslaid=As &laid out on the screen
selectedframe=The selected &frame
Eachframe=&Each frame separately
options=Options

View File

@@ -591,7 +591,7 @@ static void ParseFontPref(nsCAutoString &aPrefValue,QString &aFontName,
/* Try both foundry-name and name */
start = aPrefValue.FindChar('-');
end = aPrefValue.FindChar('-',PR_FALSE,start + 1);
end = aPrefValue.FindChar('-',start + 1);
aPrefValue.Left(fontFoundryName,end);
aPrefValue.Right(fontCharSetName,len - end - 1);
aPrefValue.Mid(fontName,start + 1,end - start - 1);

View File

@@ -100,6 +100,7 @@ WIN_LIBS= \
ole32.lib \
!endif
winspool.lib \
comctl32.lib \
comdlg32.lib
LLFLAGS = $(LLFLAGS)

File diff suppressed because it is too large Load Diff

View File

@@ -63,6 +63,10 @@ protected:
nsresult ShowXPPrintDialog(PRBool aQuiet);
nsresult ShowNativePrintDialog(nsIWidget* aWidget, PRBool aQuiet);
#ifdef MOZ_REQUIRE_CURRENT_SDK
nsresult ShowNativePrintDialogEx(nsIWidget* aWidget, PRBool aQuiet);
#endif
void SetDeviceName(char* aDeviceName);
void SetDriverName(char* aDriverName);
void SetGlobalDevMode(HGLOBAL aHGlobal);
@@ -80,6 +84,9 @@ protected:
PRBool mIsDEVMODEGlobalHandle;
nsCOMPtr<nsIPrintSettings> mPrintSettings;
// For PrintDlgEx
FARPROC mUseExtendedPrintDlg;
};

View File

@@ -1035,7 +1035,7 @@ NS_IMETHODIMP nsDeviceContextWin :: BeginDocument(PRUnichar * aTitle)
docinfo.cbSize = sizeof(docinfo);
docinfo.lpszDocName = title != nsnull?title:"Mozilla Document";
#ifdef DEBUG_rodsX
#ifdef DEBUG_rods
docinfo.lpszOutput = "p.ps";
#else
docinfo.lpszOutput = docName;

View File

@@ -466,15 +466,6 @@ nsPrinterEnumeratorXlib::nsPrinterEnumeratorXlib()
NS_IMPL_ISUPPORTS1(nsPrinterEnumeratorXlib, nsIPrinterEnumerator)
NS_IMETHODIMP nsPrinterEnumeratorXlib::EnumeratePrintersExtended(PRUint32* aCount, PRUnichar*** aResult)
{
NS_ENSURE_ARG(aCount);
NS_ENSURE_ARG_POINTER(aResult);
*aCount = 0;
*aResult = nsnull;
return NS_OK;
}
NS_IMETHODIMP nsPrinterEnumeratorXlib::EnumeratePrinters(PRUint32* aCount, PRUnichar*** aResult)
{
NS_ENSURE_ARG(aCount);