Patch by marco@gnome.org to bug 241145
r=caillon sr=dbaron
This commit is contained in:
caillon%redhat.com 2004-05-18 18:09:16 +00:00
Родитель bf28673582
Коммит e55198520c
36 изменённых файлов: 273 добавлений и 1038 удалений

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

@ -1,273 +0,0 @@
// PrintProgressDialog.cpp : implementation file
//
#include "stdafx.h"
//#include "mfcembed.h"
#include "PrintProgressDialog.h"
//#include "BrowserView.h"
#include "nsIWebBrowser.h"
#include "nsIWebBrowserPrint.h"
#include "nsIInterfaceRequestorUtils.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CPrintProgressDialog dialog
class CDlgPrintListener : public nsIWebProgressListener
{
// Construction
public:
CDlgPrintListener(CPrintProgressDialog* aDlg);
NS_DECL_ISUPPORTS
NS_DECL_NSIWEBPROGRESSLISTENER
void ClearDlg() { m_PrintDlg = NULL; } // weak reference
// Implementation
protected:
CPrintProgressDialog* m_PrintDlg;
};
NS_IMPL_ADDREF(CDlgPrintListener)
NS_IMPL_RELEASE(CDlgPrintListener)
NS_INTERFACE_MAP_BEGIN(CDlgPrintListener)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIWebProgressListener)
NS_INTERFACE_MAP_ENTRY(nsIWebProgressListener)
NS_INTERFACE_MAP_END
CDlgPrintListener::CDlgPrintListener(CPrintProgressDialog* aDlg) :
m_PrintDlg(aDlg)
{
}
/* void onStateChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in unsigned long aStateFlags, in nsresult aStatus); */
NS_IMETHODIMP
CDlgPrintListener::OnStateChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 aStateFlags, nsresult aStatus)
{
if (m_PrintDlg) {
if (aStateFlags == (nsIWebProgressListener::STATE_START|nsIWebProgressListener::STATE_IS_DOCUMENT)) {
return m_PrintDlg->OnStartPrinting();
} else if (aStateFlags == (nsIWebProgressListener::STATE_STOP|nsIWebProgressListener::STATE_IS_DOCUMENT)) {
return m_PrintDlg->OnEndPrinting(aStatus);
}
}
return NS_OK;
}
/* void onProgressChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long aCurSelfProgress, in long aMaxSelfProgress, in long aCurTotalProgress, in long aMaxTotalProgress); */
NS_IMETHODIMP
CDlgPrintListener::OnProgressChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRInt32 aCurSelfProgress, PRInt32 aMaxSelfProgress, PRInt32 aCurTotalProgress, PRInt32 aMaxTotalProgress)
{
if (m_PrintDlg) {
return m_PrintDlg->OnProgressPrinting(aCurSelfProgress, aMaxSelfProgress);
}
return NS_OK;
}
/* void onLocationChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in nsIURI location); */
NS_IMETHODIMP
CDlgPrintListener::OnLocationChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, nsIURI *location)
{
return NS_OK;
}
/* void onStatusChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in nsresult aStatus, in wstring aMessage); */
NS_IMETHODIMP
CDlgPrintListener::OnStatusChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, nsresult aStatus, const PRUnichar *aMessage)
{
return NS_OK;
}
/* void onSecurityChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in unsigned long state); */
NS_IMETHODIMP
CDlgPrintListener::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 state)
{
return NS_OK;
}
/////////////////////////////////////////////////////////////////////////////
// CPrintProgressDialog dialog
CPrintProgressDialog::CPrintProgressDialog(CWnd* pParent,
BOOL aIsForPrinting,
nsIPrintProgressParams* aPPParams,
nsIWebBrowserPrint* aWebBrowserPrint,
nsIPrintSettings* aPrintSettings)
: CDialog(CPrintProgressDialog::IDD, pParent),
m_WebBrowserPrint(aWebBrowserPrint),
m_PPParams(aPPParams),
m_PrintListener(nsnull),
m_PrintSettings(aPrintSettings),
m_HasStarted(FALSE),
m_IsForPrinting(aIsForPrinting)
{
//{{AFX_DATA_INIT(CPrintProgressDialog)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
CPrintProgressDialog::~CPrintProgressDialog()
{
CDlgPrintListener * pl = (CDlgPrintListener*)m_PrintListener.get();
if (pl) {
pl->ClearDlg();
}
}
void CPrintProgressDialog::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CPrintProgressDialog)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CPrintProgressDialog, CDialog)
//{{AFX_MSG_MAP(CPrintProgressDialog)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CPrintProgressDialog message handlers
BOOL CPrintProgressDialog::OnInitDialog()
{
CDialog::OnInitDialog();
CWnd* cancelBtn = (CWnd*)GetDlgItem(IDCANCEL);
if (cancelBtn)
{
if (m_IsForPrinting)
{
cancelBtn->EnableWindow(FALSE);
} else {
cancelBtn->ShowWindow(SW_HIDE);
SetWindowText(_T("Print Preview"));
}
}
SetDocAndURL();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
/* void OnStartPrinting (); */
NS_IMETHODIMP
CPrintProgressDialog::OnStartPrinting()
{
CProgressCtrl* progressCtrl = (CProgressCtrl *)GetDlgItem(IDC_PRINT_PROGRESS_PRG);
CWnd* progressText = (CWnd*)GetDlgItem(IDC_PRINT_PROGRESS_TXT);
if (!progressCtrl || !progressText) return NS_OK;
m_HasStarted = TRUE;
progressCtrl->ShowWindow(SW_HIDE);
SetDocAndURL();
return NS_OK;
}
/* void OnProgressPrinting (in PRUint32 aProgress, in PRUint32 aProgressMax); */
NS_IMETHODIMP
CPrintProgressDialog::OnProgressPrinting(PRUint32 aProgress, PRUint32 aProgressMax)
{
CProgressCtrl* progressCtrl = (CProgressCtrl *)GetDlgItem(IDC_PRINT_PROGRESS_PRG);
CWnd* progressText = (CWnd*)GetDlgItem(IDC_PRINT_PROGRESS_TXT);
if (!progressCtrl || !progressText) return NS_OK;
if (m_HasStarted && aProgress != 100)
{
progressText->ShowWindow(SW_HIDE);
progressCtrl->ShowWindow(SW_SHOW);
progressCtrl->SetRange(0, aProgressMax);
m_HasStarted = FALSE;
progressText->UpdateWindow();
}
SetDocAndURL();
// Initialize the progress meter we we get the "zero" progress
// which also tells us the max progress
if (aProgress == 0) {
progressCtrl->SetRange(0, aProgressMax);
progressCtrl->SetPos(0);
}
CWnd* cancelBtn = (CWnd*)GetDlgItem(IDCANCEL);
if (cancelBtn && m_IsForPrinting)
{
cancelBtn->EnableWindow(TRUE);
}
progressCtrl->SetPos(aProgress);
RedrawWindow(NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW);
return NS_OK;
}
/* void OnEndPrinting (in PRUint32 aStatus); */
NS_IMETHODIMP
CPrintProgressDialog::OnEndPrinting(PRUint32 aStatus)
{
return NS_OK;
}
void CPrintProgressDialog::OnCancel()
{
if (m_WebBrowserPrint) {
m_WebBrowserPrint->Cancel();
}
CDialog::OnCancel();
}
void CPrintProgressDialog::SetDocAndURL()
{
USES_CONVERSION;
if (m_PPParams)
{
PRUnichar* docTitle = nsnull;
PRUnichar* urlStr = nsnull;
m_PPParams->GetDocTitle(&docTitle);
m_PPParams->GetDocURL(&urlStr);
if (docTitle)
{
if (*docTitle && W2T(docTitle))
{
SetWindowText(W2T(docTitle));
}
nsMemory::Free(docTitle);
}
if (urlStr)
{
if (*urlStr && W2T(urlStr))
{
CWnd *pWnd = GetDlgItem(IDC_PRINT_PROGRESS_URL_TXT);
if (pWnd)
{
pWnd->SetWindowText(W2T(urlStr));
}
}
nsMemory::Free(urlStr);
}
}
Invalidate();
UpdateWindow();
}

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

@ -65,7 +65,6 @@
#include "nsUnicharUtils.h"
#include "nsReadableUtils.h"
#include "nsICategoryManager.h"
#include "nsComObsolete.h"
// for making the leap from nsIDOMWindowInternal -> nsIPresShell
#include "nsIScriptGlobalObject.h"
@ -292,7 +291,7 @@ nsWalletlibService::UnregisterProc(nsIComponentManager *aCompMgr,
PRBool expireMasterPassword = PR_FALSE;
#define expireMasterPasswordPref "signon.expireMasterPassword"
MODULE_PRIVATE int PR_CALLBACK
int PR_CALLBACK
ExpireMasterPasswordPrefChanged(const char * newpref, void * data) {
nsresult rv;
nsCOMPtr<nsIPref> prefs(do_GetService(NS_PREF_CONTRACTID, &rv));

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

@ -42,7 +42,6 @@
#include "singsign.h"
#include "wallet.h"
#include "nsNetUtil.h"
#include "nsComObsolete.h"
#ifdef XP_MAC
#include "prpriv.h" /* for NewNamedMonitor */
@ -100,7 +99,7 @@ static PRInt32 si_LastFormForWhichUserHasBeenSelected = -1;
#ifdef APPLE_KEYCHAIN
static PRBool si_list_invalid = PR_FALSE;
static KCCallbackUPP si_kcUPP = NULL;
PRIVATE int
static int
si_SaveSignonDataInKeychain();
#endif
@ -120,7 +119,7 @@ static PRUint32 gSelectUserDialogCount = 0;
* Locking the Signon List *
***************************/
PRIVATE void
static void
si_lock_signon_list(void) {
if(!signon_lock_monitor) {
signon_lock_monitor = PR_NewNamedMonitor("signon-lock");
@ -142,7 +141,7 @@ si_lock_signon_list(void) {
}
}
PRIVATE void
static void
si_unlock_signon_list(void) {
PR_EnterMonitor(signon_lock_monitor);
@ -164,7 +163,7 @@ si_unlock_signon_list(void) {
* Preference Utility Functions *
********************************/
PUBLIC void
void
SI_RegisterCallback(const char* domain, PrefChangedFunc callback, void* instance_data) {
nsresult ret;
nsCOMPtr<nsIPref> pPrefService = do_GetService(NS_PREF_CONTRACTID, &ret);
@ -173,7 +172,7 @@ SI_RegisterCallback(const char* domain, PrefChangedFunc callback, void* instance
}
}
PUBLIC void
void
SI_UnregisterCallback(const char* domain, PrefChangedFunc callback, void* instance_data) {
nsresult ret;
nsCOMPtr<nsIPref> pPrefService = do_GetService(NS_PREF_CONTRACTID, &ret);
@ -182,7 +181,7 @@ SI_UnregisterCallback(const char* domain, PrefChangedFunc callback, void* instan
}
}
PUBLIC void
void
SI_SetBoolPref(const char * prefname, PRBool prefvalue) {
nsresult ret;
nsCOMPtr<nsIPref> pPrefService = do_GetService(NS_PREF_CONTRACTID, &ret);
@ -194,7 +193,7 @@ SI_SetBoolPref(const char * prefname, PRBool prefvalue) {
}
}
PUBLIC PRBool
PRBool
SI_GetBoolPref(const char * prefname, PRBool defaultvalue) {
nsresult ret;
PRBool prefvalue = defaultvalue;
@ -205,7 +204,7 @@ SI_GetBoolPref(const char * prefname, PRBool defaultvalue) {
return prefvalue;
}
PUBLIC void
void
SI_SetCharPref(const char * prefname, const char * prefvalue) {
if (!prefvalue) {
return; /* otherwise the SetCharPref routine called below will crash */
@ -220,7 +219,7 @@ SI_SetCharPref(const char * prefname, const char * prefvalue) {
}
}
PUBLIC void
void
SI_GetCharPref(const char * prefname, char** aPrefvalue) {
nsresult ret;
nsCOMPtr<nsIPref> pPrefService = do_GetService(NS_PREF_CONTRACTID, &ret);
@ -234,7 +233,7 @@ SI_GetCharPref(const char * prefname, char** aPrefvalue) {
}
}
PUBLIC void
void
SI_GetLocalizedUnicharPref(const char * prefname, PRUnichar** aPrefvalue) {
nsresult ret;
nsCOMPtr<nsIPref> pPrefService = do_GetService(NS_PREF_CONTRACTID, &ret);
@ -259,34 +258,34 @@ static const char *pref_Notified = "signon.Notified";
#endif
static const char *pref_SignonFileName = "signon.SignonFileName";
PRIVATE PRBool si_RememberSignons = PR_FALSE;
static PRBool si_RememberSignons = PR_FALSE;
#ifdef WALLET_PASSWORDMANAGER_DEFAULT_IS_OFF
PRIVATE PRBool si_Notified = PR_FALSE;
static PRBool si_Notified = PR_FALSE;
#endif
PRIVATE int
static int
si_SaveSignonDataLocked(char * state, PRBool notify);
PUBLIC int
int
SI_LoadSignonData();
PUBLIC void
void
SI_RemoveAllSignonData();
#ifdef WALLET_PASSWORDMANAGER_DEFAULT_IS_OFF
PRIVATE PRBool
static PRBool
si_GetNotificationPref(void) {
return si_Notified;
}
PRIVATE void
static void
si_SetNotificationPref(PRBool x) {
SI_SetBoolPref(pref_Notified, x);
si_Notified = x;
}
#endif
PRIVATE void
static void
si_SetSignonRememberingPref(PRBool x) {
#ifdef APPLE_KEYCHAIN
if (x == 0) {
@ -299,7 +298,7 @@ si_SetSignonRememberingPref(PRBool x) {
si_RememberSignons = x;
}
MODULE_PRIVATE int PR_CALLBACK
int PR_CALLBACK
si_SignonRememberingPrefChanged(const char * newpref, void * data) {
PRBool x;
x = SI_GetBoolPref(pref_rememberSignons, PR_TRUE);
@ -307,7 +306,7 @@ si_SignonRememberingPrefChanged(const char * newpref, void * data) {
return 0; /* this is PREF_NOERROR but we no longer include prefapi.h */
}
PRIVATE void
static void
si_RegisterSignonPrefCallbacks(void) {
PRBool x;
static PRBool first_time = PR_TRUE;
@ -328,7 +327,7 @@ si_RegisterSignonPrefCallbacks(void) {
}
}
PRIVATE PRBool
static PRBool
si_GetSignonRememberingPref(void) {
#ifdef APPLE_KEYCHAIN
/* If the Keychain has been locked or an item deleted or updated,
@ -363,7 +362,7 @@ si_GetSignonRememberingPref(void) {
#endif
}
PUBLIC void
void
SI_InitSignonFileName() {
SI_GetCharPref(pref_SignonFileName, &signonFileName);
if (!signonFileName) {
@ -378,18 +377,18 @@ SI_InitSignonFileName() {
***********/
#ifdef WALLET_PASSWORDMANAGER_DEFAULT_IS_OFF
PRIVATE PRBool
static PRBool
si_ConfirmYN(PRUnichar * szMessage, nsIDOMWindowInternal* window) {
return Wallet_ConfirmYN(szMessage, window);
}
#endif
PRIVATE PRInt32
static PRInt32
si_3ButtonConfirm(PRUnichar * szMessage, nsIDOMWindowInternal* window) {
return Wallet_3ButtonConfirm(szMessage, window);
}
PRIVATE PRBool
static PRBool
si_SelectDialog(const PRUnichar* szMessage, nsIPrompt* dialog, PRUnichar** pList, PRInt32* pCount, PRUint32 formNumber) {
if (si_LastFormForWhichUserHasBeenSelected == (PRInt32)formNumber) {
/* a user was already selected for this form, use same one again */
@ -590,7 +589,7 @@ si_CheckGetUsernamePassword
#undef StrAllocCopy
#define StrAllocCopy(dest, src) Local_SACopy (&(dest), src)
PRIVATE char *
static char *
Local_SACopy(char **destination, const char *source) {
if(*destination) {
PL_strfree(*destination);
@ -600,14 +599,14 @@ Local_SACopy(char **destination, const char *source) {
}
/* remove terminating CRs or LFs */
PRIVATE void
static void
si_StripLF(nsAutoString buffer) {
buffer.Trim("\n\r", PR_FALSE, PR_TRUE, PR_FALSE);
}
#ifdef WALLET_PASSWORDMANAGER_DEFAULT_IS_OFF
/* If user-entered password is "********", then generate a random password */
PRIVATE void
static void
si_Randomize(nsString& password) {
PRIntervalTime randomNumber;
int i;
@ -769,17 +768,17 @@ public:
// nsAutoString userName;
//} si_Reject;
PRIVATE nsVoidArray * si_signon_list=0;
PRIVATE nsVoidArray * si_reject_list=0;
static nsVoidArray * si_signon_list=0;
static nsVoidArray * si_reject_list=0;
#define LIST_COUNT(list) (list ? list->Count() : 0)
PRIVATE PRBool si_signon_list_changed = PR_FALSE;
static PRBool si_signon_list_changed = PR_FALSE;
/*
* Get the URL node for a given URL name
*
* This routine is called only when holding the signon lock!!!
*/
PRIVATE si_SignonURLStruct *
static si_SignonURLStruct *
si_GetURL(const char * passwordRealm) {
si_SignonURLStruct * url;
if (!passwordRealm) {
@ -819,10 +818,10 @@ public:
si_SignonURLStruct *legacyUrl;
};
PRIVATE si_SignonCompositeURLStruct * si_composite_url=0;
static si_SignonCompositeURLStruct * si_composite_url=0;
#if defined(SINGSIGN_LOGGING)
PRIVATE void
static void
si_DumpUserList(nsVoidArray &list)
{
LOG(("dumping user list:\n"));
@ -841,7 +840,7 @@ si_DumpUserList(nsVoidArray &list)
}
#endif
PRIVATE si_SignonURLStruct *
static si_SignonURLStruct *
si_GetCompositeURL(const char *primaryRealm, const char *legacyRealm)
{
si_SignonURLStruct *primaryUrl, *legacyUrl;
@ -910,7 +909,7 @@ si_GetCompositeURL(const char *primaryRealm, const char *legacyRealm)
return legacyUrl;
}
PRIVATE PRInt32
static PRInt32
si_SetChosenUser(si_SignonURLStruct *url, si_SignonUserStruct *chosen_user)
{
PRInt32 index;
@ -925,7 +924,7 @@ si_SetChosenUser(si_SignonURLStruct *url, si_SignonUserStruct *chosen_user)
return index;
}
PRIVATE void
static void
si_ReleaseCompositeURL(si_SignonURLStruct *url)
{
if (url == si_composite_url) {
@ -960,7 +959,7 @@ si_ReleaseCompositeURL(si_SignonURLStruct *url)
}
/* Remove a user node from a given URL node */
PRIVATE PRBool
static PRBool
si_RemoveUser(const char *passwordRealm, const nsString& userName, PRBool save, PRBool loginFailure, PRBool notify, PRBool first = PR_FALSE) {
si_SignonURLStruct * url;
si_SignonUserStruct * user;
@ -1023,22 +1022,22 @@ si_RemoveUser(const char *passwordRealm, const nsString& userName, PRBool save,
return PR_TRUE;
}
PUBLIC nsresult
nsresult
SINGSIGN_RemoveUser(const char *host, const PRUnichar *user, PRBool notify) {
PRBool rv = si_RemoveUser(host, nsAutoString(user), PR_TRUE, PR_FALSE, notify);
return rv ? NS_OK : NS_ERROR_FAILURE;
}
PUBLIC nsresult
nsresult
SINGSIGN_RemoveUserAfterLoginFailure(const char *host, const PRUnichar *user, PRBool notify) {
PRBool rv = si_RemoveUser(host, nsAutoString(user), PR_TRUE, PR_TRUE, notify);
return rv ? NS_OK : NS_ERROR_FAILURE;
}
PRIVATE void
static void
si_FreeReject(si_Reject * reject);
PUBLIC nsresult
nsresult
SINGSIGN_RemoveReject(const char *host) {
si_Reject* reject;
nsresult rv = NS_ERROR_FAILURE;
@ -1060,10 +1059,10 @@ SINGSIGN_RemoveReject(const char *host) {
return rv;
}
PRIVATE void
static void
si_PutReject(const char * passwordRealm, const nsString& userName, PRBool save);
PUBLIC nsresult
nsresult
SINGSIGN_AddReject(const char *host /*, const char *userName*/) {
si_PutReject(host, nsString(/*thisParameter_isObsolete*/), PR_TRUE);
// @see http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/extensions/wallet/src/singsign.cpp&rev=1.212&mark=1693#1650
@ -1071,7 +1070,7 @@ SINGSIGN_AddReject(const char *host /*, const char *userName*/) {
}
/* Determine if a specified url/user exists */
PRIVATE PRBool
static PRBool
si_CheckForUser(const char *passwordRealm, const nsString& userName) {
si_SignonURLStruct * url;
si_SignonUserStruct * user;
@ -1113,7 +1112,7 @@ si_CheckForUser(const char *passwordRealm, const nsString& userName) {
* Get first data node that is not a password
*/
PRIVATE si_SignonDataStruct *
static si_SignonDataStruct *
si_GetFirstNonPasswordData(si_SignonUserStruct* user) {
PRInt32 dataCount = user->signonData_list.Count();
for (PRInt32 j=0; j<dataCount; j++) {
@ -1133,7 +1132,7 @@ si_GetFirstNonPasswordData(si_SignonUserStruct* user) {
*
* This routine is called only if signon pref is enabled!!!
*/
PRIVATE si_SignonUserStruct*
static si_SignonUserStruct*
si_GetUser(nsIPrompt* dialog, const char* passwordRealm, const char *legacyRealm,
PRBool pickFirstUser, const nsString& userText, PRUint32 formNumber) {
si_SignonURLStruct* url;
@ -1265,7 +1264,7 @@ si_GetUser(nsIPrompt* dialog, const char* passwordRealm, const char *legacyRealm
*
* This routine is called only if signon pref is enabled!!!
*/
PRIVATE si_SignonUserStruct*
static si_SignonUserStruct*
si_GetSpecificUser(const char* passwordRealm, const nsString& userName, const nsString& userText) {
si_SignonURLStruct* url;
si_SignonUserStruct* user;
@ -1313,7 +1312,7 @@ si_GetSpecificUser(const char* passwordRealm, const nsString& userName, const ns
*
* This routine is called only if signon pref is enabled!!!
*/
PRIVATE si_SignonUserStruct*
static si_SignonUserStruct*
si_GetURLAndUserForChangeForm(nsIPrompt* dialog, const nsString& password)
{
si_SignonURLStruct* url;
@ -1424,7 +1423,7 @@ si_GetURLAndUserForChangeForm(nsIPrompt* dialog, const nsString& password)
* Remove all the signons and free everything
*/
PUBLIC void
void
SI_RemoveAllSignonData() {
if (si_PartiallyLoaded) {
/* repeatedly remove first user node of first URL node */
@ -1449,7 +1448,7 @@ SI_RemoveAllSignonData() {
si_signon_list = nsnull;
}
PUBLIC void
void
SI_DeleteAll() {
if (si_PartiallyLoaded) {
/* repeatedly remove first user node of first URL node */
@ -1461,13 +1460,13 @@ SI_DeleteAll() {
si_SaveSignonDataLocked("signons", PR_TRUE);
}
PUBLIC void
void
SI_ClearUserData() {
SI_RemoveAllSignonData();
gLoadedUserData = PR_FALSE;
}
PUBLIC void
void
SI_DeletePersistentUserData() {
if (signonFileName && signonFileName[0]) {
@ -1485,7 +1484,7 @@ SI_DeletePersistentUserData() {
* Managing the Reject List *
****************************/
PRIVATE void
static void
si_FreeReject(si_Reject * reject) {
/*
@ -1501,7 +1500,7 @@ si_FreeReject(si_Reject * reject) {
delete reject;
}
PRIVATE PRBool
static PRBool
si_CheckForReject(const char * passwordRealm, const nsString& userName) {
si_Reject * reject;
@ -1522,7 +1521,7 @@ si_CheckForReject(const char * passwordRealm, const nsString& userName) {
return PR_FALSE;
}
PRIVATE void
static void
si_PutReject(const char * passwordRealm, const nsString& userName, PRBool save) {
char * passwordRealm2=NULL;
nsAutoString userName2;
@ -1595,7 +1594,7 @@ si_PutReject(const char * passwordRealm, const nsString& userName, PRBool save)
*
* This routine is called only if signon pref is enabled!!!
*/
PRIVATE void
static void
si_PutData(const char *passwordRealm, nsVoidArray *signonData, PRBool save) {
PRBool added_to_list = PR_FALSE;
si_SignonURLStruct * url;
@ -1885,7 +1884,7 @@ static nsresult EnsureSingleSignOnProfileObserver()
* return -1 if end of file reached
* strip carriage returns and line feeds from end of line
*/
PRIVATE PRInt32
static PRInt32
si_ReadLine(nsInputFileStream& strm, nsString& lineBuffer)
{
const PRUint32 kInitialStringCapacity = 64;
@ -1931,7 +1930,7 @@ si_ReadLine(nsInputFileStream& strm, nsString& lineBuffer)
* 0: successfully load
* +1: user aborted the load (by failing to open the database)
*/
PUBLIC int
int
SI_LoadSignonData() {
char * passwordRealm;
nsAutoString buffer;
@ -2071,12 +2070,12 @@ SI_LoadSignonData() {
* This routine is called only if signon pref is enabled!!!
*/
PRIVATE void
static void
si_WriteChar(nsOutputFileStream& strm, PRUnichar c) {
Wallet_UTF8Put(strm, c);
}
PRIVATE void
static void
si_WriteLine(nsOutputFileStream& strm, const nsAFlatString& lineBuffer) {
for (PRUint32 i=0; i<lineBuffer.Length(); i++) {
@ -2085,7 +2084,7 @@ si_WriteLine(nsOutputFileStream& strm, const nsAFlatString& lineBuffer) {
Wallet_UTF8Put(strm, '\n');
}
PRIVATE int
static int
si_SaveSignonDataLocked(char * state, PRBool notify) {
si_SignonURLStruct * url;
si_SignonUserStruct * user;
@ -2190,7 +2189,7 @@ si_SaveSignonDataLocked(char * state, PRBool notify) {
* Processing Signon Forms *
***************************/
PRIVATE PRBool
static PRBool
si_ExtractRealm(nsIURI *uri, nsCString &realm)
{
nsCAutoString hostPort;
@ -2212,7 +2211,7 @@ si_ExtractRealm(nsIURI *uri, nsCString &realm)
}
/* Ask user if it is ok to save the signon data */
PRIVATE PRBool
static PRBool
si_OkToSave(const char *passwordRealm, const char *legacyRealm,
const nsString& userName, nsIDOMWindowInternal* window) {
@ -2263,7 +2262,7 @@ si_OkToSave(const char *passwordRealm, const char *legacyRealm,
/*
* Check for a signon submission and remember the data if so
*/
PRIVATE void
static void
si_RememberSignonData
(nsIPrompt* dialog, const char* passwordRealm, const char* legacyRealm,
nsVoidArray * signonData, nsIDOMWindowInternal* window)
@ -2382,7 +2381,7 @@ si_RememberSignonData
}
}
PUBLIC void
void
SINGSIGN_RememberSignonData
(nsIPrompt* dialog, nsIURI* passwordRealm, nsVoidArray * signonData,
nsIDOMWindowInternal* window)
@ -2402,7 +2401,7 @@ SINGSIGN_RememberSignonData
}
}
PRIVATE void
static void
si_RestoreSignonData(nsIPrompt* dialog,
const char* passwordRealm, const char* legacyRealm,
const PRUnichar* name, PRUnichar** value,
@ -2514,7 +2513,7 @@ si_RestoreSignonData(nsIPrompt* dialog,
si_unlock_signon_list();
}
PUBLIC void
void
SINGSIGN_RestoreSignonData(nsIPrompt* dialog, nsIURI* passwordRealm, const PRUnichar* name, PRUnichar** value, PRUint32 formNumber, PRUint32 elementNumber) {
LOG(("enter SINGSIGN_RestoreSignonData\n"));
@ -2538,7 +2537,7 @@ SINGSIGN_RestoreSignonData(nsIPrompt* dialog, nsIURI* passwordRealm, const PRUni
/*
* Remember signon data from a browser-generated password dialog
*/
PRIVATE void
static void
si_RememberSignonDataFromBrowser(const char* passwordRealm, const nsString& username, const nsString& password) {
/* do nothing if signon preference is not enabled */
if (!si_GetSignonRememberingPref()){
@ -2569,7 +2568,7 @@ si_RememberSignonDataFromBrowser(const char* passwordRealm, const nsString& user
* Check for remembered data from a previous browser-generated password dialog
* restore it if so
*/
PRIVATE void
static void
si_RestoreOldSignonDataFromBrowser
(nsIPrompt* dialog, const char* passwordRealm, PRBool pickFirstUser, nsString& username, nsString& password) {
si_SignonUserStruct* user;
@ -2607,7 +2606,7 @@ si_RestoreOldSignonDataFromBrowser
si_unlock_signon_list();
}
PUBLIC PRBool
PRBool
SINGSIGN_StorePassword(const char *passwordRealm, const PRUnichar *user, const PRUnichar *password)
{
// Wallet_GiveCaveat(nsnull, dialog); ??? what value to use for dialog?
@ -2617,7 +2616,7 @@ SINGSIGN_StorePassword(const char *passwordRealm, const PRUnichar *user, const P
enum DialogType {promptUsernameAndPassword, promptPassword, prompt};
PRIVATE nsresult
static nsresult
si_DoDialogIfPrefIsOff(
const PRUnichar *dialogTitle,
const PRUnichar *text,
@ -2688,7 +2687,7 @@ si_DoDialogIfPrefIsOff(
* "pressedOK" is undefined.
*/
PUBLIC nsresult
nsresult
SINGSIGN_PromptUsernameAndPassword
(const PRUnichar *dialogTitle, const PRUnichar *text, PRUnichar **user, PRUnichar **pwd,
const char *passwordRealm, nsIPrompt* dialog, PRBool *pressedOK, PRUint32 savePassword) {
@ -2746,7 +2745,7 @@ SINGSIGN_PromptUsernameAndPassword
return NS_OK;
}
PUBLIC nsresult
nsresult
SINGSIGN_PromptPassword
(const PRUnichar *dialogTitle, const PRUnichar *text, PRUnichar **pwd, const char *passwordRealm,
nsIPrompt* dialog, PRBool *pressedOK, PRUint32 savePassword)
@ -2800,7 +2799,7 @@ SINGSIGN_PromptPassword
return NS_OK;
}
PUBLIC nsresult
nsresult
SINGSIGN_Prompt
(const PRUnichar *dialogTitle, const PRUnichar *text, const PRUnichar *defaultText, PRUnichar **resultText,
const char *passwordRealm, nsIPrompt* dialog, PRBool *pressedOK, PRUint32 savePassword)
@ -2859,7 +2858,7 @@ SINGSIGN_Prompt
*****************/
/* return PR_TRUE if "number" is in sequence of comma-separated numbers */
PUBLIC PRBool
PRBool
SI_InSequence(const nsString& sequence, PRInt32 number)
{
nsAutoString tail( sequence );
@ -2887,7 +2886,7 @@ SI_InSequence(const nsString& sequence, PRInt32 number)
return PR_FALSE;
}
PUBLIC void
void
SI_FindValueInArgs(const nsAString& results, const nsAString& name, nsAString& value)
{
/* note: name must start and end with a vertical bar */
@ -2906,13 +2905,13 @@ SI_FindValueInArgs(const nsAString& results, const nsAString& name, nsAString& v
value = Substring(start, barPos);
}
PUBLIC void
void
SINGSIGN_SignonViewerReturn(const nsString& results) {
/* give wallet a chance to do its deletions */
Wallet_SignonViewerReturn(results);
}
PUBLIC PRBool
PRBool
SINGSIGN_ReencryptAll()
{
/* force loading of the signons file */
@ -2952,7 +2951,7 @@ SINGSIGN_ReencryptAll()
return PR_TRUE;
}
PUBLIC nsresult
nsresult
SINGSIGN_HaveData(nsIPrompt* dialog, const char *passwordRealm, const PRUnichar *userName, PRBool *retval)
{
nsAutoString data, usernameForLookup;
@ -2973,7 +2972,7 @@ SINGSIGN_HaveData(nsIPrompt* dialog, const char *passwordRealm, const PRUnichar
return NS_OK;
}
PUBLIC PRInt32
PRInt32
SINGSIGN_HostCount() {
/* force loading of the signons file */
si_RegisterSignonPrefCallbacks();
@ -2984,7 +2983,7 @@ SINGSIGN_HostCount() {
return si_signon_list->Count();
}
PUBLIC PRInt32
PRInt32
SINGSIGN_UserCount(PRInt32 host) {
if (!si_signon_list) {
return 0;
@ -2995,7 +2994,7 @@ SINGSIGN_UserCount(PRInt32 host) {
return hostStruct->signonUser_list.Count();
}
PUBLIC nsresult
nsresult
SINGSIGN_Enumerate
(PRInt32 hostNumber, PRInt32 userNumber, char **host,
PRUnichar ** user, PRUnichar ** pswd) {
@ -3064,7 +3063,7 @@ SINGSIGN_Enumerate
return NS_OK;
}
PUBLIC PRInt32
PRInt32
SINGSIGN_RejectCount() {
if (!si_reject_list) {
return 0;
@ -3072,7 +3071,7 @@ SINGSIGN_RejectCount() {
return si_reject_list->Count();
}
PUBLIC nsresult
nsresult
SINGSIGN_RejectEnumerate
(PRInt32 rejectNumber, char **host) {
@ -3110,7 +3109,7 @@ si_KeychainCallback( KCEvent keychainEvent, KCCallbackInfo *info, void *userCont
*
* This routine is called only if signon pref is enabled!!!
*/
PRIVATE int
static int
si_LoadSignonDataFromKeychain() {
char * passwordRealm;
si_FormSubmitData submit;
@ -3297,7 +3296,7 @@ si_LoadSignonDataFromKeychain() {
*
* This routine is called only if signon pref is enabled!!!
*/
PRIVATE int
static int
si_SaveSignonDataInKeychain() {
char* account = nil;
char* password = nil;

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

@ -71,7 +71,6 @@
#include "nsIObserverService.h"
#include "nsIWalletService.h"
#include "nsComObsolete.h"
#include <time.h>
@ -97,9 +96,9 @@ static const char *pref_captureForms = "wallet.captureForms";
static const char *pref_enabled = "wallet.enabled";
static const char *pref_WalletSchemaValueFileName = "wallet.SchemaValueFileName";
PRIVATE PRBool wallet_captureForms = PR_FALSE;
static PRBool wallet_captureForms = PR_FALSE;
PRIVATE void
static void
wallet_SetFormsCapturingPref(PRBool x)
{
/* do nothing if new value of pref is same as current value */
@ -111,7 +110,7 @@ wallet_SetFormsCapturingPref(PRBool x)
wallet_captureForms = x;
}
MODULE_PRIVATE int PR_CALLBACK
int PR_CALLBACK
wallet_FormsCapturingPrefChanged(const char * newpref, void * data)
{
PRBool x;
@ -135,14 +134,14 @@ wallet_RegisterCapturePrefCallbacks(void)
}
}
PRIVATE PRBool
static PRBool
wallet_GetFormsCapturingPref(void)
{
wallet_RegisterCapturePrefCallbacks();
return wallet_captureForms;
}
PRIVATE PRBool
static PRBool
wallet_GetEnabledPref(void)
{
/* This pref is not in the prefs panel. It's purpose is to remove wallet from all UI */
@ -248,15 +247,15 @@ public:
};
wallet_HelpMac * helpMac;
PRIVATE nsVoidArray * wallet_FieldToSchema_list = 0;
PRIVATE nsVoidArray * wallet_VcardToSchema_list = 0;
PRIVATE nsVoidArray * wallet_SchemaToValue_list = 0;
PRIVATE nsVoidArray * wallet_SchemaConcat_list = 0;
PRIVATE nsVoidArray * wallet_SchemaStrings_list = 0;
PRIVATE nsVoidArray * wallet_PositionalSchema_list = 0;
PRIVATE nsVoidArray * wallet_StateSchema_list = 0;
PRIVATE nsVoidArray * wallet_URL_list = 0;
PRIVATE nsVoidArray * wallet_DistinguishedSchema_list = 0;
static nsVoidArray * wallet_FieldToSchema_list = 0;
static nsVoidArray * wallet_VcardToSchema_list = 0;
static nsVoidArray * wallet_SchemaToValue_list = 0;
static nsVoidArray * wallet_SchemaConcat_list = 0;
static nsVoidArray * wallet_SchemaStrings_list = 0;
static nsVoidArray * wallet_PositionalSchema_list = 0;
static nsVoidArray * wallet_StateSchema_list = 0;
static nsVoidArray * wallet_URL_list = 0;
static nsVoidArray * wallet_DistinguishedSchema_list = 0;
#define NO_CAPTURE(x) x[0]
#define NO_PREVIEW(x) x[1]
@ -428,7 +427,7 @@ wallet_DumpStopwatch() {
#define PROPERTIES_URL "chrome://communicator/locale/wallet/wallet.properties"
PUBLIC PRUnichar *
PRUnichar *
Wallet_Localize(const char* genericString) {
nsresult ret;
nsAutoString v;
@ -480,7 +479,7 @@ Wallet_Localize(const char* genericString) {
/* Modal dialog boxes */
/**********************/
PUBLIC PRBool
PRBool
Wallet_Confirm(PRUnichar * szMessage, nsIDOMWindowInternal* window)
{
PRBool retval = PR_TRUE; /* default value */
@ -498,7 +497,7 @@ Wallet_Confirm(PRUnichar * szMessage, nsIDOMWindowInternal* window)
return retval;
}
PUBLIC PRBool
PRBool
Wallet_ConfirmYN(PRUnichar * szMessage, nsIDOMWindowInternal* window) {
nsresult res;
nsCOMPtr<nsIPrompt> dialog;
@ -519,7 +518,7 @@ Wallet_ConfirmYN(PRUnichar * szMessage, nsIDOMWindowInternal* window) {
return (buttonPressed == 0);
}
PUBLIC PRInt32
PRInt32
Wallet_3ButtonConfirm(PRUnichar * szMessage, nsIDOMWindowInternal* window)
{
nsresult res;
@ -545,7 +544,7 @@ Wallet_3ButtonConfirm(PRUnichar * szMessage, nsIDOMWindowInternal* window)
return buttonPressed;
}
PRIVATE void
static void
wallet_Alert(PRUnichar * szMessage, nsIDOMWindowInternal* window)
{
nsresult res;
@ -562,7 +561,7 @@ wallet_Alert(PRUnichar * szMessage, nsIDOMWindowInternal* window)
return; // XXX should return the error
}
PRIVATE void
static void
wallet_Alert(PRUnichar * szMessage, nsIPrompt* dialog)
{
nsresult res;
@ -573,7 +572,7 @@ wallet_Alert(PRUnichar * szMessage, nsIPrompt* dialog)
return; // XXX should return the error
}
PUBLIC PRBool
PRBool
Wallet_CheckConfirmYN
(PRUnichar * szMessage, PRUnichar * szCheckMessage, PRBool* checkValue,
nsIDOMWindowInternal* window) {
@ -613,7 +612,7 @@ nsISecretDecoderRing* gSecretDecoderRing;
PRBool gEncryptionFailure = PR_FALSE;
PRInt32 gReencryptionLevel = 0;
PRIVATE nsresult
static nsresult
wallet_CryptSetup() {
if (!gSecretDecoderRing)
{
@ -633,7 +632,7 @@ wallet_CryptSetup() {
#define PREFIX "~"
#include "plbase64.h"
PRIVATE nsresult EncryptString (const char * text, char *& crypt) {
static nsresult EncryptString (const char * text, char *& crypt) {
/* use SecretDecoderRing if encryption pref is set */
nsresult rv;
@ -669,7 +668,7 @@ PRIVATE nsresult EncryptString (const char * text, char *& crypt) {
return NS_OK;
}
PRIVATE nsresult DecryptString (const char * crypt, char *& text) {
static nsresult DecryptString (const char * crypt, char *& text) {
/* treat zero-length crypt string as a special case */
if (crypt[0] == '\0') {
@ -720,7 +719,7 @@ PRIVATE nsresult DecryptString (const char * crypt, char *& text) {
return NS_OK;
}
PUBLIC void
void
WLLT_ExpirePassword(PRBool* status) {
nsresult rv = wallet_CryptSetup();
if (NS_SUCCEEDED(rv)) {
@ -729,7 +728,7 @@ WLLT_ExpirePassword(PRBool* status) {
*status = NS_SUCCEEDED(rv);
}
PUBLIC void
void
WLLT_ExpirePasswordOnly(PRBool* status) {
nsresult rv = wallet_CryptSetup();
if (NS_SUCCEEDED(rv)) {
@ -740,7 +739,7 @@ WLLT_ExpirePasswordOnly(PRBool* status) {
PRBool changingPassword = PR_FALSE;
PUBLIC void
void
WLLT_ChangePassword(PRBool* status) {
nsresult rv = wallet_CryptSetup();
if (NS_SUCCEEDED(rv)) {
@ -780,7 +779,7 @@ wallet_Decrypt(const nsCString& crypt, nsCString& text) {
return NS_OK;
}
PUBLIC nsresult
nsresult
Wallet_Encrypt (const nsString& textUCS2, nsString& cryptUCS2) {
nsCAutoString cryptUTF8;
nsresult rv = wallet_Encrypt(NS_ConvertUCS2toUTF8(textUCS2), cryptUTF8);
@ -788,7 +787,7 @@ Wallet_Encrypt (const nsString& textUCS2, nsString& cryptUCS2) {
return rv;
}
PUBLIC nsresult
nsresult
Wallet_Decrypt(const nsString& cryptUCS2, nsString& textUCS2) {
nsCAutoString textUTF8;
nsresult rv = wallet_Decrypt(NS_ConvertUCS2toUTF8(cryptUCS2), textUTF8);
@ -796,13 +795,13 @@ Wallet_Decrypt(const nsString& cryptUCS2, nsString& textUCS2) {
return rv;
}
PUBLIC nsresult
nsresult
Wallet_Encrypt2(const nsString& text, nsString& crypt)
{
return Wallet_Encrypt (text, crypt);
}
PUBLIC nsresult
nsresult
Wallet_Decrypt2 (const nsString& crypt, nsString& text)
{
return Wallet_Decrypt (crypt, text);
@ -837,7 +836,7 @@ wallet_Clear(nsVoidArray ** list) {
* element at a time was very inefficient on the mac
*/
PRIVATE nsVoidArray * wallet_MapElementAllocations_list = 0;
static nsVoidArray * wallet_MapElementAllocations_list = 0;
const PRInt32 kAllocBlockElems = 500;
static PRInt32 wallet_NextAllocSlot = kAllocBlockElems;
@ -1121,7 +1120,7 @@ wallet_ReadFromList(
*
*/
PUBLIC void
void
Wallet_UTF8Put(nsOutputFileStream& strm, PRUnichar c) {
if (c <= 0x7F) {
strm.put((char)c);
@ -1152,7 +1151,7 @@ wallet_Get(nsInputFileStream& strm) {
return (buf[next++]);
}
PUBLIC PRUnichar
PRUnichar
Wallet_UTF8Get(nsInputFileStream& strm) {
PRUnichar c = wallet_Get(strm);
if ((c & 0x80) == 0x00) {
@ -1189,7 +1188,7 @@ Wallet_UTF8Get(nsInputFileStream& strm) {
*
*/
PUBLIC void
void
Wallet_SimplePut(nsOutputFileStream& strm, PRUnichar c) {
if (c < 0xFF) {
strm.put((char)c);
@ -1200,7 +1199,7 @@ Wallet_SimplePut(nsOutputFileStream& strm, PRUnichar c) {
}
}
PUBLIC PRUnichar
PRUnichar
Wallet_SimpleGet(nsInputFileStream& strm) {
PRUnichar c = (strm.get() & 0xFF);
if (c != 0xFF) {
@ -1232,7 +1231,7 @@ const char distinguishedSchemaFileName[] = "DistinguishedSchema.tbl";
/* The following routines are for accessing the files */
/******************************************************/
PUBLIC nsresult Wallet_ProfileDirectory(nsFileSpec& dirSpec) {
nsresult Wallet_ProfileDirectory(nsFileSpec& dirSpec) {
/* return the profile */
nsresult res;
@ -1254,7 +1253,7 @@ PUBLIC nsresult Wallet_ProfileDirectory(nsFileSpec& dirSpec) {
return res;
}
PUBLIC nsresult Wallet_DefaultsDirectory(nsFileSpec& dirSpec) {
nsresult Wallet_DefaultsDirectory(nsFileSpec& dirSpec) {
nsresult res;
nsCOMPtr<nsIFile> aFile;
@ -1277,7 +1276,7 @@ PUBLIC nsresult Wallet_DefaultsDirectory(nsFileSpec& dirSpec) {
return res;
}
PUBLIC char *
char *
Wallet_RandomName(char* suffix)
{
/* pick the current time as the random number */
@ -1558,7 +1557,7 @@ wallet_ReadFromFile
/* The following are utility routines for the main wallet processing */
/*********************************************************************/
PUBLIC void
void
Wallet_GiveCaveat(nsIDOMWindowInternal* window, nsIPrompt* dialog) {
/* test for first capturing of data ever and give caveat if so */
if (!SI_GetBoolPref(pref_Caveat, PR_FALSE)) {
@ -2459,7 +2458,7 @@ wallet_GetPrefills(
/*
* termination for wallet session
*/
PUBLIC void
void
Wallet_ReleaseAllLists() {
wallet_Clear(&wallet_FieldToSchema_list); /* otherwise we will duplicate the list */
wallet_Clear(&wallet_VcardToSchema_list); /* otherwise we will duplicate the list */
@ -2680,7 +2679,7 @@ wallet_ReleasePrefillElementList(nsVoidArray * wallet_PrefillElement_list) {
nsVoidArray * wallet_list;
nsAutoString wallet_url;
PUBLIC void
void
WLLT_GetPrefillListForViewer(nsString& aPrefillList)
{
wallet_Initialize(PR_FALSE); /* to initialize helpMac */
@ -2702,7 +2701,7 @@ WLLT_GetPrefillListForViewer(nsString& aPrefillList)
aPrefillList = buffer;
}
PRIVATE void
static void
wallet_FreeURL(wallet_MapElement *url) {
if(!url) {
@ -2717,7 +2716,7 @@ const char* permission_NoCapture_Preview = "yn";
const char* permission_Capture_NoPreview = "ny";
const char* permission_Capture_Preview = "nn";
PUBLIC void
void
Wallet_SignonViewerReturn(const nsString& results)
{
wallet_MapElement *url;
@ -2776,7 +2775,7 @@ Wallet_SignonViewerReturn(const nsString& results)
/*
* see if user wants to capture data on current page
*/
PRIVATE PRBool
static PRBool
wallet_OKToCapture(const nsAFlatCString& url, nsIDOMWindowInternal* window) {
/* exit if pref is not set */
@ -2822,7 +2821,7 @@ wallet_OKToCapture(const nsAFlatCString& url, nsIDOMWindowInternal* window) {
/*
* capture the value of a form element
*/
PRIVATE PRBool
static PRBool
wallet_Capture(nsIDocument* doc, const nsString& field, const nsString& value, nsACString& schema)
{
/* do nothing if there is no value */
@ -2946,7 +2945,7 @@ wallet_Capture(nsIDocument* doc, const nsString& field, const nsString& value, n
/* The following are the interface routines seen by other dlls */
/***************************************************************/
PUBLIC void
void
WLLT_GetNopreviewListForViewer(nsString& aNopreviewList)
{
wallet_Initialize(PR_FALSE); /* to initialize helpMac */
@ -2965,7 +2964,7 @@ WLLT_GetNopreviewListForViewer(nsString& aNopreviewList)
aNopreviewList = buffer;
}
PUBLIC void
void
WLLT_GetNocaptureListForViewer(nsString& aNocaptureList)
{
nsAutoString buffer;
@ -2983,7 +2982,7 @@ WLLT_GetNocaptureListForViewer(nsString& aNocaptureList)
aNocaptureList = buffer;
}
PUBLIC void
void
WLLT_PostEdit(const nsString& walletList)
{
nsFileSpec dirSpec;
@ -3037,7 +3036,7 @@ WLLT_PostEdit(const nsString& walletList)
wallet_ReadFromFile(schemaValueFileName, wallet_SchemaToValue_list, PR_TRUE);
}
PUBLIC void
void
WLLT_PreEdit(nsString& walletList)
{
wallet_Initialize();
@ -3065,7 +3064,7 @@ WLLT_PreEdit(nsString& walletList)
}
}
PUBLIC void
void
WLLT_DeleteAll() {
wallet_Initialize();
wallet_Clear(&wallet_SchemaToValue_list);
@ -3073,14 +3072,14 @@ WLLT_DeleteAll() {
SI_DeleteAll();
}
PUBLIC void
void
WLLT_ClearUserData() {
wallet_ValuesReadIn = PR_FALSE;
namesInitialized = PR_FALSE;
wallet_URLListInitialized = PR_FALSE;
}
PUBLIC void
void
WLLT_DeletePersistentUserData() {
if (schemaValueFileName && schemaValueFileName[0]) {
@ -3094,7 +3093,7 @@ WLLT_DeletePersistentUserData() {
}
}
MODULE_PRIVATE int PR_CALLBACK
int PR_CALLBACK
wallet_ReencryptAll(const char * newpref, void* window) {
PRUnichar * message;
@ -3181,7 +3180,7 @@ fail:
return 1;
}
PUBLIC void
void
WLLT_InitReencryptCallback(nsIDOMWindowInternal* window) {
static PRBool registered = PR_FALSE;
static nsIDOMWindowInternal* lastWindow;
@ -3193,7 +3192,7 @@ WLLT_InitReencryptCallback(nsIDOMWindowInternal* window) {
registered = PR_TRUE;
}
PRIVATE void
static void
wallet_DecodeVerticalBars(nsString& s) {
s.ReplaceSubstring(NS_LITERAL_STRING("^2").get(), NS_LITERAL_STRING("|").get());
s.ReplaceSubstring(NS_LITERAL_STRING("^1").get(), NS_LITERAL_STRING("^").get());
@ -3202,7 +3201,7 @@ wallet_DecodeVerticalBars(nsString& s) {
/*
* return after previewing a set of prefills
*/
PUBLIC void
void
WLLT_PrefillReturn(const nsString& results)
{
nsAutoString fillins;
@ -3344,7 +3343,7 @@ WLLT_PrefillReturn(const nsString& results)
/*
* get the form elements on the current page and prefill them if possible
*/
PRIVATE void
static void
wallet_TraversalForPrefill
(nsIDOMWindow* win, nsVoidArray* wallet_PrefillElement_list, nsString& urlName) {
@ -3450,7 +3449,7 @@ wallet_TraversalForPrefill
}
}
PUBLIC nsresult
nsresult
WLLT_PrefillOneElement
(nsIDOMWindowInternal* win, nsIDOMNode* elementNode, nsString& compositeValue)
{
@ -3487,7 +3486,7 @@ WLLT_PrefillOneElement
return NS_OK;
}
PUBLIC nsresult
nsresult
WLLT_Prefill(nsIPresShell* shell, PRBool quick, nsIDOMWindowInternal* win)
{
/* do not prefill if preview window is open in some other browser window */
@ -3565,7 +3564,7 @@ WLLT_Prefill(nsIPresShell* shell, PRBool quick, nsIDOMWindowInternal* win)
}
}
PRIVATE PRBool
static PRBool
wallet_CaptureInputElement(nsIDOMNode* elementNode, nsIDocument* doc) {
nsresult result;
PRBool captured = PR_FALSE;
@ -3611,7 +3610,7 @@ wallet_CaptureInputElement(nsIDOMNode* elementNode, nsIDocument* doc) {
return captured;
}
PRIVATE PRBool
static PRBool
wallet_CaptureSelectElement(nsIDOMNode* elementNode, nsIDocument* doc) {
nsresult result;
PRBool captured = PR_FALSE;
@ -3683,7 +3682,7 @@ wallet_CaptureSelectElement(nsIDOMNode* elementNode, nsIDocument* doc) {
return captured;
}
PRIVATE void
static void
wallet_TraversalForRequestToCapture(nsIDOMWindow* win, PRInt32& captureCount) {
nsresult result;
@ -3754,7 +3753,7 @@ wallet_TraversalForRequestToCapture(nsIDOMWindow* win, PRInt32& captureCount) {
}
}
PUBLIC void
void
WLLT_RequestToCapture(nsIPresShell* shell, nsIDOMWindowInternal* win, PRUint32* status) {
PRInt32 captureCount = 0;
@ -3796,7 +3795,7 @@ public:
PRBool isPassword;
};
PRIVATE PRBool
static PRBool
wallet_IsNewValue(nsIDOMNode* elementNode, nsString valueOnForm) {
if (valueOnForm.Equals(EmptyString())) {
return PR_FALSE;
@ -3816,7 +3815,7 @@ wallet_IsNewValue(nsIDOMNode* elementNode, nsString valueOnForm) {
return PR_TRUE;
}
PUBLIC void
void
WLLT_OnSubmit(nsIContent* currentForm, nsIDOMWindowInternal* window) {
nsCOMPtr<nsIDOMHTMLFormElement> currentFormNode(do_QueryInterface(currentForm));

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

@ -43,7 +43,6 @@
%{ C++
#include "nsMargin.h"
#include "nsFont.h"
%}
/**

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

@ -45,6 +45,7 @@ include $(DEPTH)/config/autoconf.mk
MODULE = gfx
EXPORTS = \
gfxCore.h \
nsColor.h \
nsColorNames.h \
nsColorNameList.h \

51
gfx/public/gfxCore.h Normal file
Просмотреть файл

@ -0,0 +1,51 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* 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.org code.
*
* The Initial Developer of the Original Code is
* Marco Pesenti Gritti <marco@gnome.org>
* Portions created by the Initial Developer are Copyright (C) 2004
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef gfxCore_h__
#define gfxCore_h__
#include "nscore.h"
#ifdef _IMPL_NS_GFX
#define NS_GFX NS_EXPORT
#define NS_GFX_(type) NS_EXPORT_(type)
#else
#define NS_GFX NS_IMPORT
#define NS_GFX_(type) NS_IMPORT_(type)
#endif
#endif

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

@ -38,8 +38,7 @@
#ifndef nsColor_h___
#define nsColor_h___
#include "nscore.h"
#include "nsComObsolete.h"
#include "gfxCore.h"
class nsString;
class nsAString;

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

@ -39,7 +39,7 @@
#define nsColorNames_h___
#include "nsColor.h"
#include "nsComObsolete.h"
#include "gfxCore.h"
#include "nsStringFwd.h"
/*

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

@ -47,7 +47,7 @@
#include "nsIObserver.h"
#include "nsIObserverService.h"
#include "nsWeakReference.h"
#include "nsComObsolete.h"
#include "gfxCore.h"
class nsIImageRequest;
class nsHashtable;

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

@ -38,8 +38,7 @@
#ifndef nsFont_h___
#define nsFont_h___
#include "nscore.h"
#include "nsComObsolete.h"
#include "gfxCore.h"
#include "nsCoord.h"
#include "nsString.h"

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

@ -45,7 +45,7 @@
#include "nsSize.h"
#include "nsMargin.h"
#include "nsUnitConversion.h"
#include "nsComObsolete.h"
#include "gfxCore.h"
struct NS_GFX nsRect {
nscoord x, y;

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

@ -1,82 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* 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.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef nsRepeater_h___
#define nsRepeater_h___
#include "nscore.h"
#include "nsComObsolete.h"
class EventRecord;
class NS_WIDGET Repeater
{
public:
Repeater();
virtual ~Repeater();
virtual void RepeatAction(const EventRecord &aMacEvent) {}
virtual void IdleAction(const EventRecord &aMacEvent) {}
void StartRepeating();
void StopRepeating();
void StartIdling();
void StopIdling();
static void DoRepeaters(const EventRecord &aMacEvent);
static void DoIdlers(const EventRecord &aMacEvent);
protected:
void AddToRepeatList();
void RemoveFromRepeatList();
void AddToIdleList();
void RemoveFromIdleList();
static Repeater* sRepeaters;
static Repeater* sIdlers;
bool mRepeating;
bool mIdling;
Repeater* mPrevRptr;
Repeater* mNextRptr;
Repeater* mPrevIdlr;
Repeater* mNextIdlr;
};
#endif

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

@ -38,10 +38,9 @@
#ifndef nsTransform2D_h___
#define nsTransform2D_h___
#include "nscore.h"
#include "gfxCore.h"
#include "nsCoord.h"
#include "nsUnitConversion.h"
#include "nsComObsolete.h"
#define MG_2DIDENTITY 0
#define MG_2DTRANSLATION 1

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

@ -1,106 +0,0 @@
/* -*- Mode: c++; tab-width: 2; indent-tabs-mode: nil; -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* 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.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef WatchTask_h__
#define WatchTask_h__
#ifndef XP_MACOSX
#include <Retrace.h>
#endif
#include <Quickdraw.h>
#include "prtypes.h"
#include "nscore.h"
#include "nsComObsolete.h"
//
// class nsWatchTask
//
// A nice little class that installs/removes a VBL to set the cursor to
// the watch if we're away from the event loop for a while. Will also
// animate the watch cursor.
//
class nsWatchTask
{
public:
nsWatchTask ( ) ;
~nsWatchTask ( ) ;
// Registers the VBL task and does other various init tasks to begin
// watching for time away from the event loop. It is ok to call other
// methods on this object w/out calling Start().
NS_GFX void Start ( ) ;
// call from the main event loop
NS_GFX void EventLoopReached ( ) ;
// turn off when we know we're going into an area where it's ok
// that WNE is not called (eg, the menu code)
void Suspend ( ) { mSuspended = PR_TRUE; };
void Resume ( ) { mSuspended = PR_FALSE; };
static NS_GFX nsWatchTask& GetTask ( ) ;
private:
enum {
kRepeatInterval = 10, // check every 1/6 of a second if we should show watch (10/60)
kTicksToShowWatch = 45, // show watch if haven't seen WNE for 3/4 second (45/60)
kStepsInAnimation = 12
};
// the VBL task
static pascal void DoWatchTask(nsWatchTask* theTaskPtr) ;
#if !TARGET_CARBON
VBLTask mTask; // this must be first!!
#endif
long mChecksum; // 'mozz' to validate we have real data at interrupt time (not needed?)
void* mSelf; // so we can get back to |this| from the static routine
long mTicks; // last time the event loop was hit
Cursor mWatchCursor; // the watch cursor
PRPackedBool mBusy; // are we currently spinning the cursor?
PRPackedBool mSuspended; // set if we've temporarily suspended operation
PRPackedBool mInstallSucceeded; // did we succeed in installing the task? (used in dtor)
short mAnimation; // stage of animation
};
#endif

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

@ -1,48 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* 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.org code.
*
* The Initial Developer of the Original Code is
* Tomas Mšller.
* Portions created by the Initial Developer are Copyright (C) 2001
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Tomas Mšller
* Tim Rowley <tor@cs.brown.edu>
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsComObsolete.h"
NS_GFX_(void)
RectStretch(unsigned aSrcWidth, unsigned aSrcHeight,
unsigned aDstWidth, unsigned aDstHeight,
unsigned aStartColumn, unsigned aStartRow,
unsigned aEndColumn, unsigned aEndRowe,
unsigned char *aSrcImage, unsigned aSrcStride,
unsigned char *aDstImage, unsigned aDstStride,
unsigned aDepth);

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

@ -1,63 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* 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.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef nsFontUtils_h_
#define nsFontUtils_h_
#include <TextEdit.h>
#include "nsIFontMetrics.h"
#include "nsIDeviceContext.h"
#include "nsComObsolete.h"
class NS_GFX nsFontUtils
{
public:
static void GetNativeTextStyle(nsIFontMetrics& inMetrics, const nsIDeviceContext& inDevContext, TextStyle &outStyle);
static PRBool DisplayVerySmallFonts();
protected:
static PRBool sDisplayVerySmallFonts;
};
#endif // nsFontUtils_h_

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

@ -45,8 +45,7 @@
#endif
#include <Quickdraw.h>
#include "prtypes.h"
#include "nscore.h"
#include "nsComObsolete.h"
#include "gfxCore.h"
//
// class nsWatchTask

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

@ -1,69 +0,0 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* 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 client code, released
* March 31, 1998.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 2001
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Brian Stell <bstell@netscape.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/*
* Implementation of nsIFontList
*/
#ifndef _nsFontList_H_
#define _nsFontList_H_
#include "nsIFontList.h"
#include "nsComObsolete.h"
#define NS_FONTLIST_CONTRACTID "@mozilla.org/gfx/fontlist;1"
class NS_GFX nsFontList : public nsIFontList
{
public:
nsFontList();
virtual ~nsFontList();
// nsISupports
NS_DECL_ISUPPORTS
// nsIFontList
NS_DECL_NSIFONTLIST
protected:
};
#endif /* _nsFontList_H_ */

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

@ -1,69 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* 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.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Conrad Carlen <ccarlen@netscape.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef nsPrintSession_h__
#define nsPrintSession_h__
#include "nsIPrintSession.h"
#include "nsWeakReference.h"
#include "nsComObsolete.h"
//*****************************************************************************
//*** nsPrintSession
//*****************************************************************************
#undef IMETHOD_VISIBILITY
#define IMETHOD_VISIBILITY NS_VISIBILITY_DEFAULT
class NS_GFX nsPrintSession : public nsIPrintSession,
public nsSupportsWeakReference
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIPRINTSESSION
nsPrintSession();
virtual ~nsPrintSession();
virtual nsresult Init();
};
#undef IMETHOD_VISIBILITY
#define IMETHOD_VISIBILITY NS_VISIBILITY_HIDDEN
#endif // nsPrintSession_h__

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

@ -40,6 +40,7 @@
#ifndef nsPrintSettingsImpl_h__
#define nsPrintSettingsImpl_h__
#include "gfxCore.h"
#include "nsIPrintSettings.h"
#include "nsMargin.h"
#include "nsString.h"

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

@ -38,7 +38,7 @@
#ifndef nsRenderingContextImpl_h___
#define nsRenderingContextImpl_h___
#include "nsComObsolete.h"
#include "gfxCore.h"
#include "nsIRenderingContext.h"
#include "nsPoint.h"
#include "nsSize.h"

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

@ -38,7 +38,7 @@
* ***** END LICENSE BLOCK ***** */
#include "nsIScriptableRegion.h"
#include "nsComObsolete.h"
#include "gfxCore.h"
class nsIRegion;

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

@ -1,74 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* 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.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef __UNIPRIV__
#define __UNIPRIV__
#include "ubase.h"
#include "umap.h"
#include "uconvutil.h"
#include "nsComObsolete.h"
#ifdef __cplusplus
extern "C" {
#endif
void uFillInfo(const uTable *uT,
PRUint32 *info);
PRBool uMapCode(const uTable *uT,
PRUint16 in,
PRUint16* out);
PRBool uGenerate( uShiftTable *shift,
PRInt32* state,
PRUint16 in,
unsigned char* out,
PRUint32 outbuflen,
PRUint32* outlen);
PRBool uScan( uShiftTable *shift,
PRInt32 *state,
unsigned char *in,
PRUint16 *out,
PRUint32 inbuflen,
PRUint32* inscanlen);
#ifdef __cplusplus
}
#endif
#endif /* __UNIPRIV__ */

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

@ -44,7 +44,6 @@
#include "nsIMsgFolder.h"
#include "nsIMsgHdr.h"
#include "nsIMsgWindow.h"
#include "nsComObsolete.h"
typedef enum _nsCopyRequestType
{

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

@ -44,7 +44,6 @@
#include "nsMsgCompFields.h"
#include "nsIMsgSend.h"
#include "nsIMsgCompUtils.h"
#include "nsComObsolete.h"
class nsIPrompt;
@ -66,7 +65,7 @@ public:
virtual ~nsMsgCompUtils();
};
NS_BEGIN_EXTERN_C
PR_BEGIN_EXTERN_C
//
// Create a file spec or file name using the name passed
@ -171,7 +170,7 @@ nsresult ConvertBufToPlainText(nsString &aConBuf, PRBool formatflowed = PR_FALSE
PRBool UseFormatFlowed(const char *charset);
NS_END_EXTERN_C
PR_END_EXTERN_C
#endif /* _nsMsgCompUtils_H_ */

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

@ -39,14 +39,13 @@
#define _nsImapStringBundle_H__
#include "nsIStringBundle.h"
#include "nsComObsolete.h"
NS_BEGIN_EXTERN_C
PR_BEGIN_EXTERN_C
nsresult IMAPGetStringByID(PRInt32 stringID, PRUnichar **aString);
nsresult IMAPGetStringBundle(nsIStringBundle **aBundle);
NS_END_EXTERN_C
PR_END_EXTERN_C

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

@ -47,6 +47,7 @@ XPIDL_MODULE = widget
GRE_MODULE = 1
EXPORTS = \
widgetCore.h \
nsIMenuBar.h \
nsIMenu.h \
nsIMenuItem.h \

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

@ -0,0 +1,49 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* 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.org code.
*
* The Initial Developer of the Original Code is
* Marco Pesenti Gritti <marco@gnome.org>
* Portions created by the Initial Developer are Copyright (C) 2004
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef widgetCore_h__
#define widgetCore_h__
#include "nscore.h"
#ifdef _IMPL_NS_WIDGET
#define NS_WIDGET NS_EXPORT
#else
#define NS_WIDGET NS_IMPORT
#endif
#endif

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

@ -36,6 +36,7 @@
* ***** END LICENSE BLOCK ***** */
#include "widgetCore.h"
#include "nsWidgetSupport.h"
#include "nsRect.h"
#include "nsIAppShell.h"

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

@ -72,7 +72,6 @@ EXPORTS = \
nsAgg.h \
nsAutoPtr.h \
nsCom.h \
nsComObsolete.h \
nsDebugImpl.h \
nsIAllocator.h \
nsIID.h \

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

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

@ -39,10 +39,9 @@
#include <stdlib.h>
#include "prtypes.h"
#include "nsComObsolete.h"
#include "nsQuickSort.h"
NS_BEGIN_EXTERN_C
PR_BEGIN_EXTERN_C
#if !defined(DEBUG) && (defined(__cplusplus) || defined(__gcc))
# ifndef INLINE
@ -184,4 +183,4 @@ loop: SWAPINIT(a, es);
/* NS_QuickSort(pn - r, r / es, es, cmp, data);*/
}
NS_END_EXTERN_C
PR_END_EXTERN_C

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

@ -1,68 +0,0 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* 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.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/* We need this because Solaris' version of qsort is broken and
* causes array bounds reads.
*/
#ifndef nsQuickSort_h___
#define nsQuickSort_h___
#include "prtypes.h"
#include "nsComObsolete.h"
NS_BEGIN_EXTERN_C
/**
* Parameters:
* 1. the array to sort
* 2. the number of elements in the array
* 3. the size of each array element
* 4. comparison function taking two elements and parameter #5 and
* returning an integer:
* + less than zero if the first element should be before the second
* + 0 if the order of the elements does not matter
* + greater than zero if the second element should be before the first
* 5. extra data to pass to comparison function
*/
PR_EXTERN(void) NS_QuickSort(void *, unsigned int, unsigned int,
int (*)(const void *, const void *, void *),
void *);
NS_END_EXTERN_C
#endif /* nsQuickSort_h___ */

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

@ -40,8 +40,6 @@
#include "nsICmdLineHandler.idl"
%{C++
#include "nsComObsolete.h" //for NS_APPSHELL
// e34783f5-ac08-11d2-8d19-00805fc2500c
#define NS_COMMANDLINE_SERVICE_CID \
{ 0xe34783f5, 0xac08, 0x11d2, \

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

@ -40,8 +40,6 @@
#include "nsICmdLineHandler.idl"
%{C++
#include "nsComObsolete.h" //for NS_APPSHELL
// e34783f5-ac08-11d2-8d19-00805fc2500c
#define NS_COMMANDLINE_SERVICE_CID \
{ 0xe34783f5, 0xac08, 0x11d2, \