Backout last checkin because of build bustage

This commit is contained in:
smontagu%smontagu.org 2004-09-11 07:48:29 +00:00
parent efa975d2f7
commit 596da04448
16 changed files with 32 additions and 279 deletions

View File

@ -49,7 +49,7 @@ struct nsReconversionEventReply;
[ptr] native nsReconversionEventReplyPtr(nsReconversionEventReply);
[scriptable, uuid(fe489b4d-d2f6-4215-ab33-6afd66388416)]
[scriptable, uuid(4805e680-49b9-11d3-9ce4-ed60bd6cb5bc)]
interface nsIEditorIMESupport : nsISupports
{
@ -89,18 +89,5 @@ interface nsIEditorIMESupport : nsISupports
* GetReconvertionString() Get the reconvertion string
*/
[noscript] void GetReconversionString(in nsReconversionEventReplyPtr aReply);
/**
* Notify for IME when the editor got focus.
*/
[noscript] void NotifyIMEOnFocus();
/**
* Notify for IME when the editor lost focus.
*/
[noscript] void NotifyIMEOnBlur();
};

View File

@ -114,10 +114,6 @@ static PRBool gNoisy = PR_FALSE;
PRInt32 nsEditor::gInstanceCount = 0;
// Value of "ime.password.onFocus.dontCare"
static PRBool gDontCareForIMEOnFocusPassword = PR_FALSE;
// Value of "ime.password.onBlur.dontCare"
static PRBool gDontCareForIMEOnBlurPassword = PR_FALSE;
//---------------------------------------------------------------------------
//
@ -150,7 +146,6 @@ nsEditor::nsEditor()
, mIMETextOffset(0)
, mIMEBufferLength(0)
, mIsIMEComposing(PR_FALSE)
, mNeedRecoverIMEOpenState(PR_FALSE)
, mActionListeners(nsnull)
, mEditorObservers(nsnull)
, mDocDirtyState(-1)
@ -309,17 +304,6 @@ nsEditor::Init(nsIDOMDocument *aDoc, nsIPresShell* aPresShell, nsIContent *aRoot
NS_POSTCONDITION(mDocWeak && mPresShellWeak, "bad state");
nsresult result;
nsCOMPtr<nsIPrefBranch> prefBranch =
do_GetService(NS_PREFSERVICE_CONTRACTID, &result);
if (NS_SUCCEEDED(result) && prefBranch) {
PRBool val;
if (NS_SUCCEEDED(prefBranch->GetBoolPref("ime.password.onFocus.dontCare", &val)))
gDontCareForIMEOnFocusPassword = val;
if (NS_SUCCEEDED(prefBranch->GetBoolPref("ime.password.onBlur.dontCare", &val)))
gDontCareForIMEOnBlurPassword = val;
}
return NS_OK;
}
@ -1928,12 +1912,6 @@ nsEditor::BeginComposition(nsTextEventReply* aReply)
mInIMEMode = PR_TRUE;
if (mPhonetic)
mPhonetic->Truncate(0);
// If user changes the IME open state, don't recover it.
// Because the user may not want to change the state.
if (mNeedRecoverIMEOpenState)
mNeedRecoverIMEOpenState = PR_FALSE;
return ret;
}
@ -2037,35 +2015,6 @@ GetEditorContentWindow(nsIPresShell *aPresShell, nsIDOMElement *aRoot, nsIWidget
return NS_OK;
}
nsresult
nsEditor::GetKBStateControl(nsIKBStateControl **aKBSC)
{
if (!aKBSC)
return NS_ERROR_NULL_POINTER;
*aKBSC = nsnull;
nsCOMPtr<nsIPresShell> shell;
nsresult res = GetPresShell(getter_AddRefs(shell));
if (NS_FAILED(res))
return res;
if (!shell)
return NS_ERROR_FAILURE;
nsCOMPtr<nsIWidget> widget;
res = GetEditorContentWindow(shell, mBodyElement, getter_AddRefs(widget));
if (NS_FAILED(res))
return res;
nsCOMPtr<nsIKBStateControl> kb = do_QueryInterface(widget);
if (!kb)
return NS_ERROR_NOT_INITIALIZED;
NS_ADDREF(*aKBSC = kb);
return NS_OK;
}
NS_IMETHODIMP
nsEditor::ForceCompositionEnd()
{
@ -2085,74 +2034,27 @@ nsEditor::ForceCompositionEnd()
return NS_OK;
#endif
nsCOMPtr<nsIKBStateControl> kb;
nsresult res = GetKBStateControl(getter_AddRefs(kb));
nsCOMPtr<nsIPresShell> shell;
nsresult res = GetPresShell(getter_AddRefs(shell));
if (NS_FAILED(res))
return res;
if (kb) {
if (!shell)
return NS_ERROR_FAILURE;
nsCOMPtr<nsIWidget> widget;
res = GetEditorContentWindow(shell, mBodyElement, getter_AddRefs(widget));
if (NS_FAILED(res))
return res;
nsCOMPtr<nsIKBStateControl> kb = do_QueryInterface(widget);
if (kb)
res = kb->ResetInputState();
if (NS_FAILED(res))
return res;
}
return NS_OK;
}
NS_IMETHODIMP
nsEditor::NotifyIMEOnFocus()
{
mNeedRecoverIMEOpenState = PR_FALSE;
if(gDontCareForIMEOnFocusPassword
|| !(mFlags & nsIPlaintextEditor::eEditorPasswordMask))
return NS_OK;
nsCOMPtr<nsIKBStateControl> kb;
nsresult res = GetKBStateControl(getter_AddRefs(kb));
if (NS_FAILED(res))
return res;
if (kb) {
PRBool isOpen;
res = kb->GetIMEOpenState(&isOpen);
if (NS_FAILED(res))
return res;
if (isOpen) {
res = kb->SetIMEOpenState(PR_FALSE);
if (NS_FAILED(res))
return res;
}
mNeedRecoverIMEOpenState = isOpen;
}
return NS_OK;
}
NS_IMETHODIMP
nsEditor::NotifyIMEOnBlur()
{
if (!mNeedRecoverIMEOpenState)
return NS_OK;
mNeedRecoverIMEOpenState = PR_FALSE;
if (gDontCareForIMEOnBlurPassword
|| !(mFlags & nsIPlaintextEditor::eEditorPasswordMask))
return NS_OK;
nsCOMPtr<nsIKBStateControl> kb;
nsresult res = GetKBStateControl(getter_AddRefs(kb));
if (NS_FAILED(res))
return res;
if (kb) {
res = kb->SetIMEOpenState(PR_TRUE);
if (NS_FAILED(res))
return res;
}
return NS_OK;
}

View File

@ -45,7 +45,6 @@
#include "nsIEditor.h"
#include "nsIEditorIMESupport.h"
#include "nsIPhonetic.h"
#include "nsIKBStateControl.h"
#include "nsIAtom.h"
#include "nsIDOMDocument.h"
@ -144,7 +143,13 @@ public:
/* ------------ nsIEditor methods -------------- */
NS_DECL_NSIEDITOR
/* ------------ nsIEditorIMESupport methods -------------- */
NS_DECL_NSIEDITORIMESUPPORT
NS_IMETHOD BeginComposition(nsTextEventReply* aReply);
NS_IMETHOD QueryComposition(nsTextEventReply* aReply);
NS_IMETHOD SetCompositionString(const nsAString& aCompositionString, nsIPrivateTextRangeList* aTextRangeList,nsTextEventReply* aReply);
NS_IMETHOD EndComposition(void);
NS_IMETHOD ForceCompositionEnd(void);
NS_IMETHOD GetReconversionString(nsReconversionEventReply *aReply);
// nsIPhonetic
NS_DECL_NSIPHONETIC
@ -327,8 +332,6 @@ protected:
nsCOMPtr<nsIDOMNode> *aResultNode,
PRBool bNoBlockCrossing = PR_FALSE);
// Get nsIKBStateControl interface
nsresult GetKBStateControl(nsIKBStateControl **aKBSC);
public:
/** All editor operations which alter the doc should be prefaced
@ -581,9 +584,8 @@ protected:
nsCOMPtr<nsIDOMCharacterData> mIMETextNode; // current IME text node
PRUint32 mIMETextOffset; // offset in text node where IME comp string begins
PRUint32 mIMEBufferLength; // current length of IME comp string
PRPackedBool mIsIMEComposing; // is IME in composition state?
PRBool mIsIMEComposing; // is IME in composition state?
// This is different from mInIMEMode. see Bug 98434.
PRPackedBool mNeedRecoverIMEOpenState; // Need IME open state change on blur.
// various listeners
nsVoidArray* mActionListeners; // listens to all low level actions on the doc

View File

@ -1059,10 +1059,6 @@ nsTextEditorFocusListener::Focus(nsIDOMEvent* aEvent)
}
}
}
nsCOMPtr<nsIEditorIMESupport> imeEditor = do_QueryInterface(mEditor);
if (imeEditor)
imeEditor->NotifyIMEOnFocus();
}
return NS_OK;
}
@ -1081,10 +1077,8 @@ nsTextEditorFocusListener::Blur(nsIDOMEvent* aEvent)
// when imeEditor exists, call ForceCompositionEnd() to tell
// the input focus is leaving first
nsCOMPtr<nsIEditorIMESupport> imeEditor = do_QueryInterface(mEditor);
if (imeEditor) {
if (imeEditor)
imeEditor->ForceCompositionEnd();
imeEditor->NotifyIMEOnBlur();
}
nsCOMPtr<nsIEditor>editor = do_QueryInterface(mEditor);
if (editor)

View File

@ -632,9 +632,6 @@ pref("network.enablePad", false); // Allow client to do proxy
pref("converter.html2txt.structs", true); // Output structured phrases (strong, em, code, sub, sup, b, i, u)
pref("converter.html2txt.header_strategy", 1); // 0 = no indention; 1 = indention, increased with header level; 2 = numbering and slight indention
pref("ime.password.onFocus.dontCare", false);
pref("ime.password.onBlur.dontCare", false);
pref("intl.accept_languages", "chrome://navigator/locale/navigator.properties");
pref("intl.accept_charsets", "iso-8859-1,*,utf-8");
pref("intl.collationOption", "chrome://navigator-platform/locale/navigator.properties");

View File

@ -62,29 +62,9 @@ class nsIKBStateControl : public nsISupports {
NS_IMETHOD ResetInputState()=0;
/*
* Following methods relates to IME 'Opened'/'Closed' state.
* 'Opened' means the user can input any character. I.e., users can input Japanese
* and other characters. The user can change the state to 'Closed'.
* 'Closed' means the user can input ASCII characters only. This is the same as a
* non-IME environment. The user can change the state to 'Opened'.
* For more information is here.
* http://bugzilla.mozilla.org/show_bug.cgi?id=16940#c48
* This method is called in the init stage of a password field
*/
/*
* Set the state to 'Opened' or 'Closed'.
* If aState is TRUE, IME open state is set to 'Opened'.
* If aState is FALSE, set to 'Closed'.
*/
NS_IMETHOD SetIMEOpenState(PRBool aState) = 0;
/*
* Get IME is 'Opened' or 'Closed'.
* If IME is 'Opened', aState is set PR_TRUE.
* If IME is 'Closed', aState is set PR_FALSE.
*/
NS_IMETHOD GetIMEOpenState(PRBool* aState) = 0;
};
#endif // nsIKBStateControl_h__

View File

@ -245,8 +245,6 @@ public:
public:
// nsIKBStateControl interface
NS_IMETHOD ResetInputState();
NS_IMETHOD SetIMEOpenState(PRBool aState);
NS_IMETHOD GetIMEOpenState(PRBool* aState);
protected:

View File

@ -2036,16 +2036,6 @@ NS_IMETHODIMP nsChildView::ResetInputState()
return NS_ERROR_ABORT;
}
NS_IMETHODIMP nsChildView::SetIMEOpenState(PRBool aState)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsChildView::GetIMEOpenState(PRBool* aState)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
//
// GetQuickDrawPort

View File

@ -4100,14 +4100,6 @@ NS_IMETHODIMP nsWindow::ResetInputState()
return NS_OK;
}
NS_IMETHODIMP SetIMEOpenState(PRBool aState) {
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP GetIMEOpenState(PRBool* aState) {
return NS_ERROR_NOT_IMPLEMENTED;
}
static void
gdk_wmspec_change_state (gboolean add,
GdkWindow *window,

View File

@ -130,8 +130,6 @@ public:
// nsIKBStateControl
NS_IMETHOD ResetInputState();
NS_IMETHOD SetIMEOpenState(PRBool aState);
NS_IMETHOD GetIMEOpenState(PRBool* aState);
void QueueDraw();
void UnqueueDraw();

View File

@ -2614,14 +2614,6 @@ NS_IMETHODIMP nsWindow::ResetInputState()
return NS_ERROR_ABORT;
}
NS_IMETHODIMP SetIMEOpenState(PRBool aState) {
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP GetIMEOpenState(PRBool* aState) {
return NS_ERROR_NOT_IMPLEMENTED;
}
#if !TARGET_CARBON

View File

@ -225,8 +225,6 @@ public:
// nsIKBStateControl interface
NS_IMETHOD ResetInputState();
NS_IMETHOD SetIMEOpenState(PRBool aState);
NS_IMETHOD GetIMEOpenState(PRBool* aState);
protected:

View File

@ -225,12 +225,9 @@ NS_IMETHODIMP nsWidget::ResetInputState( ) {
return NS_OK;
}
NS_IMETHODIMP SetIMEOpenState(PRBool aState) {
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP GetIMEOpenState(PRBool* aState) {
return NS_ERROR_NOT_IMPLEMENTED;
// to be implemented
NS_IMETHODIMP nsWidget::PasswordFieldInit( ) {
return NS_OK;
}
//-------------------------------------------------------------------------

View File

@ -213,8 +213,7 @@ public:
// nsIKBStateControl
NS_IMETHOD ResetInputState();
NS_IMETHOD SetIMEOpenState(PRBool aState);
NS_IMETHOD GetIMEOpenState(PRBool* aState);
NS_IMETHOD PasswordFieldInit();
inline void InitEvent(nsGUIEvent& event, PRUint32 aEventType, nsPoint* aPoint = nsnull)
{

View File

@ -410,26 +410,6 @@ static PRBool is_vk_down(int vk)
} \
}
#define NS_IMM_GETOPENSTATUS(hIMC, bRtn) \
{ \
if (nsToolkit::gAIMMApp) \
bRtn = nsToolkit::gAIMMApp->GetOpenStatus(hIMC); \
else { \
nsIMM& theIMM = nsIMM::LoadModule(); \
bRtn = theIMM.GetOpenStatus(hIMC); \
} \
}
#define NS_IMM_SETOPENSTATUS(hIMC, bOpen) \
{ \
if (nsToolkit::gAIMMApp) \
nsToolkit::gAIMMApp->SetOpenStatus(hIMC, bOpen); \
else { \
nsIMM& theIMM = nsIMM::LoadModule(); \
theIMM.SetOpenStatus(hIMC, bOpen); \
} \
}
//
// Macro for Input Method A/W conversion.
//
@ -6563,36 +6543,6 @@ NS_IMETHODIMP nsWindow::ResetInputState()
return NS_OK;
}
//==========================================================================
NS_IMETHODIMP nsWindow::SetIMEOpenState(PRBool aState)
{
#ifdef DEBUG_KBSTATE
printf("SetImeOpenState %s\n", (aState ? "Open" : "Close"));
#endif
HIMC hIMC;
NS_IMM_GETCONTEXT(mWnd, hIMC);
if (hIMC) {
NS_IMM_SETOPENSTATUS(hIMC, aState ? TRUE : FALSE);
NS_IMM_RELEASECONTEXT(mWnd, hIMC);
}
return NS_OK;
}
//==========================================================================
NS_IMETHODIMP nsWindow::GetIMEOpenState(PRBool* aState)
{
HIMC hIMC;
NS_IMM_GETCONTEXT(mWnd, hIMC);
if (hIMC) {
BOOL isOpen;
NS_IMM_GETOPENSTATUS(hIMC, isOpen);
*aState = isOpen ? PR_TRUE : PR_FALSE;
NS_IMM_RELEASECONTEXT(mWnd, hIMC);
} else
*aState = PR_FALSE;
return NS_OK;
}
#define PT_IN_RECT(pt, rc) ((pt).x>(rc).left && (pt).x <(rc).right && (pt).y>(rc).top && (pt).y<(rc).bottom)

View File

@ -24,7 +24,6 @@
* Dean Tessman <dean_tessman@hotmail.com>
* Makoto Kato <m_kato@ga2.so-net.ne.jp>
* Dainis Jonitis <Dainis_Jonitis@swh-t.lv>
* Masayuki Nakano <masayuki@d-toybox.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
@ -108,8 +107,6 @@ class nsIMM
typedef LONG (CALLBACK *GetCompWindowPtr)(HIMC, LPCOMPOSITIONFORM);
typedef LONG (CALLBACK *GetPropertyPtr) (HKL, DWORD);
typedef LONG (CALLBACK *GetDefaultIMEWndPtr) (HWND);
typedef BOOL (CALLBACK *GetOpenStatusPtr) (HIMC);
typedef BOOL (CALLBACK *SetOpenStatusPtr) (HIMC, BOOL);
public:
static nsIMM& LoadModule() {
@ -150,12 +147,6 @@ public:
mGetDefaultIMEWnd=(mInstance) ? (GetDefaultIMEWndPtr)GetProcAddress(mInstance, "ImmGetDefaultIMEWnd") : 0;
NS_ASSERTION(mGetDefaultIMEWnd!=NULL, "nsIMM.ImmGetDefaultIMEWnd failed.");
mGetOpenStatus=(mInstance) ? (GetOpenStatusPtr)GetProcAddress(mInstance,"ImmGetOpenStatus") : 0;
NS_ASSERTION(mGetOpenStatus!=NULL, "nsIMM.ImmGetOpenStatus failed.");
mSetOpenStatus=(mInstance) ? (SetOpenStatusPtr)GetProcAddress(mInstance,"ImmSetOpenStatus") : 0;
NS_ASSERTION(mSetOpenStatus!=NULL, "nsIMM.ImmSetOpenStatus failed.");
}
~nsIMM() {
@ -172,8 +163,6 @@ public:
mSetCompositionWindow=0;
mGetProperty=0;
mGetDefaultIMEWnd=0;
mGetOpenStatus=0;
mSetOpenStatus=0;
}
LONG GetCompositionStringA(HIMC h, DWORD d1, LPVOID v, DWORD d2) {
@ -216,14 +205,6 @@ public:
return (mGetDefaultIMEWnd) ? mGetDefaultIMEWnd(hWnd) : 0L;
}
BOOL GetOpenStatus(HIMC h) {
return (mGetOpenStatus) ? mGetOpenStatus(h) : FALSE;
}
BOOL SetOpenStatus(HIMC h, BOOL b) {
return (mSetOpenStatus) ? mSetOpenStatus(h,b) : FALSE;
}
private:
HINSTANCE mInstance;
@ -237,8 +218,6 @@ private:
GetCompWindowPtr mGetCompositionWindow;
GetPropertyPtr mGetProperty;
GetDefaultIMEWndPtr mGetDefaultIMEWnd;
GetOpenStatusPtr mGetOpenStatus;
SetOpenStatusPtr mSetOpenStatus;
};
/**
@ -360,8 +339,6 @@ public:
// nsIKBStateControl interface
NS_IMETHOD ResetInputState();
NS_IMETHOD SetIMEOpenState(PRBool aState);
NS_IMETHOD GetIMEOpenState(PRBool* aState);
PRBool IMEMouseHandling(PRUint32 aEventType, PRInt32 aAction, LPARAM lParam);
PRBool IMECompositionHitTest(PRUint32 aEventType, POINT * ptPos);