зеркало из https://github.com/mozilla/pjs.git
Bug 254191: Cleanup Win32 nsWindow.cpp / nsWindow.h
Patch by Dainis Jonitis r=ere sr=roc
This commit is contained in:
Родитель
5ae0619670
Коммит
8200b4e17c
|
@ -79,15 +79,15 @@ typedef nsEventStatus (*PR_CALLBACK EVENT_CALLBACK)(nsGUIEvent *event);
|
|||
* Flags for the getNativeData function.
|
||||
* See getNativeData()
|
||||
*/
|
||||
#define NS_NATIVE_WINDOW 0
|
||||
#define NS_NATIVE_GRAPHIC 1
|
||||
#define NS_NATIVE_COLORMAP 2
|
||||
#define NS_NATIVE_WIDGET 3
|
||||
#define NS_NATIVE_DISPLAY 4
|
||||
#define NS_NATIVE_REGION 5
|
||||
#define NS_NATIVE_OFFSETX 6
|
||||
#define NS_NATIVE_OFFSETY 7
|
||||
#define NS_NATIVE_PLUGIN_PORT 8
|
||||
#define NS_NATIVE_WINDOW 0
|
||||
#define NS_NATIVE_GRAPHIC 1
|
||||
#define NS_NATIVE_COLORMAP 2
|
||||
#define NS_NATIVE_WIDGET 3
|
||||
#define NS_NATIVE_DISPLAY 4
|
||||
#define NS_NATIVE_REGION 5
|
||||
#define NS_NATIVE_OFFSETX 6
|
||||
#define NS_NATIVE_OFFSETY 7
|
||||
#define NS_NATIVE_PLUGIN_PORT 8
|
||||
#define NS_NATIVE_SCREEN 9
|
||||
|
||||
// {18032AD5-B265-11d1-AA2A-000000000000}
|
||||
|
@ -709,7 +709,7 @@ class nsIWidget : public nsISupports {
|
|||
/**
|
||||
* Invalidate the widget and repaint it.
|
||||
*
|
||||
* @param aIsSynchronouse PR_TRUE then repaint synchronously. If PR_FALSE repaint later.
|
||||
* @param aIsSynchronous PR_TRUE then repaint synchronously. If PR_FALSE repaint later.
|
||||
* @see #Update()
|
||||
*/
|
||||
|
||||
|
@ -929,7 +929,7 @@ class nsIWidget : public nsISupports {
|
|||
NS_IMETHOD SetPreferredSize(PRInt32 aWidth, PRInt32 aHeight) = 0;
|
||||
|
||||
/**
|
||||
* Dispatches and event to the widget
|
||||
* Dispatches an event to the widget
|
||||
*
|
||||
*/
|
||||
NS_IMETHOD DispatchEvent(nsGUIEvent* event, nsEventStatus & aStatus) = 0;
|
||||
|
@ -948,7 +948,7 @@ class nsIWidget : public nsISupports {
|
|||
*/
|
||||
NS_IMETHOD EnableDragDrop(PRBool aEnable) = 0;
|
||||
|
||||
virtual void ConvertToDeviceCoordinates(nscoord &aX,nscoord &aY) = 0;
|
||||
virtual void ConvertToDeviceCoordinates(nscoord &aX,nscoord &aY) = 0;
|
||||
|
||||
/**
|
||||
* Enables/Disables system mouse capture.
|
||||
|
@ -973,7 +973,7 @@ class nsIWidget : public nsISupports {
|
|||
* Enables/Disables system capture of any and all events that would cause a
|
||||
* dropdown to be rolled up, This method ignores the aConsumeRollupEvent
|
||||
* parameter when aDoCapture is FALSE
|
||||
* @param aCapture PR_TRUE enables capture, PR_FALSE disables capture
|
||||
* @param aDoCapture PR_TRUE enables capture, PR_FALSE disables capture
|
||||
* @param aConsumeRollupEvent PR_TRUE consumes the rollup event, PR_FALSE dispatches rollup event
|
||||
*
|
||||
*/
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -78,319 +78,306 @@ class nsIMenuBar;
|
|||
/*
|
||||
* ::: IMPORTANT :::
|
||||
* External apps and drivers depend on window class names.
|
||||
* For example, changing the window classes
|
||||
* For example, changing the window classes
|
||||
* could break touchpad scrolling or screen readers.
|
||||
*/
|
||||
const PRUint32 kMaxClassNameLength = 40;
|
||||
const PRUint32 kMaxClassNameLength = 40;
|
||||
const LPCWSTR kWClassNameHidden = L"MozillaHiddenWindowClass";
|
||||
const LPCWSTR kWClassNameUI = L"MozillaUIWindowClass";
|
||||
const LPCWSTR kWClassNameContent = L"MozillaContentWindowClass";
|
||||
const LPCWSTR kWClassNameGeneral = L"MozillaWindowClass";
|
||||
const LPCSTR kClassNameHidden = "MozillaHiddenWindowClass";
|
||||
const LPCSTR kClassNameUI = "MozillaUIWindowClass";
|
||||
const LPCSTR kClassNameContent = "MozillaContentWindowClass";
|
||||
const LPCSTR kClassNameGeneral = "MozillaWindowClass";
|
||||
const LPCSTR kClassNameHidden = "MozillaHiddenWindowClass";
|
||||
const LPCSTR kClassNameUI = "MozillaUIWindowClass";
|
||||
const LPCSTR kClassNameContent = "MozillaContentWindowClass";
|
||||
const LPCSTR kClassNameGeneral = "MozillaWindowClass";
|
||||
|
||||
/**
|
||||
/**
|
||||
* Native IMM wrapper
|
||||
*/
|
||||
class nsIMM
|
||||
class nsIMM
|
||||
{
|
||||
//prototypes for DLL function calls...
|
||||
typedef LONG (CALLBACK *GetCompStrPtr) (HIMC,DWORD,LPVOID,DWORD);
|
||||
typedef LONG (CALLBACK *GetContextPtr) (HWND);
|
||||
typedef LONG (CALLBACK *RelContextPtr) (HWND,HIMC);
|
||||
typedef LONG (CALLBACK *GetCStatusPtr) (HIMC,LPDWORD,LPDWORD);
|
||||
typedef LONG (CALLBACK *SetCStatusPtr) (HIMC,DWORD,DWORD);
|
||||
typedef LONG (CALLBACK *NotifyIMEPtr) (HIMC,DWORD,DWORD,DWORD);
|
||||
typedef LONG (CALLBACK *SetCandWindowPtr) (HIMC,LPCANDIDATEFORM);
|
||||
typedef LONG (CALLBACK *SetCompWindowPtr) (HIMC,LPCOMPOSITIONFORM);
|
||||
typedef LONG (CALLBACK *GetCompFontPtr) (HIMC, PLOGFONT);
|
||||
typedef LONG (CALLBACK *SetCompFontPtr) (HIMC, PLOGFONT);
|
||||
typedef LONG (CALLBACK *GetCompWindowPtr) (HIMC,LPCOMPOSITIONFORM);
|
||||
typedef LONG (CALLBACK *GetPropertyPtr) (HKL, DWORD);
|
||||
typedef LONG (CALLBACK *GetDefaultIMEWndPtr) (HWND);
|
||||
//prototypes for DLL function calls...
|
||||
typedef LONG (CALLBACK *GetCompStrPtr) (HIMC, DWORD, LPVOID, DWORD);
|
||||
typedef LONG (CALLBACK *GetContextPtr) (HWND);
|
||||
typedef LONG (CALLBACK *RelContextPtr) (HWND, HIMC);
|
||||
typedef LONG (CALLBACK *GetCStatusPtr) (HIMC, LPDWORD, LPDWORD);
|
||||
typedef LONG (CALLBACK *SetCStatusPtr) (HIMC, DWORD, DWORD);
|
||||
typedef LONG (CALLBACK *NotifyIMEPtr) (HIMC, DWORD, DWORD, DWORD);
|
||||
typedef LONG (CALLBACK *SetCandWindowPtr)(HIMC, LPCANDIDATEFORM);
|
||||
typedef LONG (CALLBACK *SetCompWindowPtr)(HIMC, LPCOMPOSITIONFORM);
|
||||
typedef LONG (CALLBACK *GetCompFontPtr) (HIMC, PLOGFONT);
|
||||
typedef LONG (CALLBACK *SetCompFontPtr) (HIMC, PLOGFONT);
|
||||
typedef LONG (CALLBACK *GetCompWindowPtr)(HIMC, LPCOMPOSITIONFORM);
|
||||
typedef LONG (CALLBACK *GetPropertyPtr) (HKL, DWORD);
|
||||
typedef LONG (CALLBACK *GetDefaultIMEWndPtr) (HWND);
|
||||
public:
|
||||
|
||||
static nsIMM& LoadModule() {
|
||||
static nsIMM gIMM;
|
||||
return gIMM;
|
||||
static nsIMM& LoadModule() {
|
||||
static nsIMM gIMM;
|
||||
return gIMM;
|
||||
}
|
||||
|
||||
nsIMM(const char* aModuleName="IMM32.DLL") {
|
||||
mInstance=::LoadLibrary(aModuleName);
|
||||
NS_ASSERTION(mInstance!=NULL, "nsIMM.LoadLibrary failed.");
|
||||
|
||||
mGetCompositionStringA=(mInstance) ? (GetCompStrPtr)GetProcAddress(mInstance, "ImmGetCompositionStringA") : 0;
|
||||
NS_ASSERTION(mGetCompositionStringA!=NULL, "nsIMM.ImmGetCompositionStringA failed.");
|
||||
|
||||
mGetCompositionStringW=(mInstance) ? (GetCompStrPtr)GetProcAddress(mInstance, "ImmGetCompositionStringW") : 0;
|
||||
NS_ASSERTION(mGetCompositionStringW!=NULL, "nsIMM.ImmGetCompositionStringW failed.");
|
||||
|
||||
mGetContext=(mInstance) ? (GetContextPtr)GetProcAddress(mInstance, "ImmGetContext") : 0;
|
||||
NS_ASSERTION(mGetContext!=NULL, "nsIMM.ImmGetContext failed.");
|
||||
|
||||
mReleaseContext=(mInstance) ? (RelContextPtr)GetProcAddress(mInstance, "ImmReleaseContext") : 0;
|
||||
NS_ASSERTION(mReleaseContext!=NULL, "nsIMM.ImmReleaseContext failed.");
|
||||
|
||||
mGetConversionStatus=(mInstance) ? (GetCStatusPtr)GetProcAddress(mInstance, "ImmGetConversionStatus") : 0;
|
||||
NS_ASSERTION(mGetConversionStatus!=NULL, "nsIMM.ImmGetConversionStatus failed.");
|
||||
|
||||
mSetConversionStatus=(mInstance) ? (SetCStatusPtr)GetProcAddress(mInstance, "ImmSetConversionStatus") : 0;
|
||||
NS_ASSERTION(mSetConversionStatus!=NULL, "nsIMM.ImmSetConversionStatus failed.");
|
||||
|
||||
mNotifyIME=(mInstance) ? (NotifyIMEPtr)GetProcAddress(mInstance, "ImmNotifyIME") : 0;
|
||||
NS_ASSERTION(mNotifyIME!=NULL, "nsIMM.ImmNotifyIME failed.");
|
||||
|
||||
mSetCandiateWindow=(mInstance) ? (SetCandWindowPtr)GetProcAddress(mInstance, "ImmSetCandidateWindow") : 0;
|
||||
NS_ASSERTION(mSetCandiateWindow!=NULL, "nsIMM.ImmSetCandidateWindow failed.");
|
||||
|
||||
mGetCompositionWindow=(mInstance) ? (GetCompWindowPtr)GetProcAddress(mInstance, "ImmGetCompositionWindow") : 0;
|
||||
NS_ASSERTION(mGetCompositionWindow!=NULL, "nsIMM.ImmGetCompositionWindow failed.");
|
||||
|
||||
mGetCompositionFontA=(mInstance) ? (GetCompFontPtr)GetProcAddress(mInstance, "ImmGetCompositionFontA") : 0;
|
||||
NS_ASSERTION(mGetCompositionFontA!=NULL, "nsIMM.ImmGetCompositionFontA failed.");
|
||||
|
||||
mGetCompositionFontW=(mInstance) ? (GetCompFontPtr)GetProcAddress(mInstance, "ImmGetCompositionFontW") : 0;
|
||||
NS_ASSERTION(mGetCompositionFontW!=NULL, "nsIMM.ImmGetCompositionFontW failed.");
|
||||
|
||||
mSetCompositionFontA=(mInstance) ? (SetCompFontPtr)GetProcAddress(mInstance, "ImmSetCompositionFontA") : 0;
|
||||
NS_ASSERTION(mSetCompositionFontA!=NULL, "nsIMM.ImmSetCompositionFontA failed.");
|
||||
|
||||
mSetCompositionFontW=(mInstance) ? (SetCompFontPtr)GetProcAddress(mInstance, "ImmSetCompositionFontW") : 0;
|
||||
NS_ASSERTION(mSetCompositionFontW!=NULL, "nsIMM.ImmSetCompositionFontW failed.");
|
||||
|
||||
mSetCompositionWindow=(mInstance) ? (SetCompWindowPtr)GetProcAddress(mInstance, "ImmSetCompositionWindow") : 0;
|
||||
NS_ASSERTION(mSetCompositionWindow!=NULL, "nsIMM.ImmSetCompositionWindow failed.");
|
||||
|
||||
mGetProperty=(mInstance) ? (GetPropertyPtr)GetProcAddress(mInstance, "ImmGetProperty") : 0;
|
||||
NS_ASSERTION(mGetProperty!=NULL, "nsIMM.ImmGetProperty failed.");
|
||||
|
||||
mGetDefaultIMEWnd=(mInstance) ? (GetDefaultIMEWndPtr)GetProcAddress(mInstance, "ImmGetDefaultIMEWnd") : 0;
|
||||
NS_ASSERTION(mGetDefaultIMEWnd!=NULL, "nsIMM.ImmGetDefaultIMEWnd failed.");
|
||||
}
|
||||
|
||||
~nsIMM() {
|
||||
if(mInstance) {
|
||||
::FreeLibrary(mInstance);
|
||||
}
|
||||
mGetCompositionStringA=0;
|
||||
mGetCompositionStringW=0;
|
||||
mGetContext=0;
|
||||
mReleaseContext=0;
|
||||
mGetConversionStatus=0;
|
||||
mSetConversionStatus=0;
|
||||
mNotifyIME=0;
|
||||
mSetCandiateWindow=0;
|
||||
mGetCompositionWindow=0;
|
||||
mSetCompositionWindow=0;
|
||||
mGetCompositionFontA=0;
|
||||
mGetCompositionFontA=0;
|
||||
mSetCompositionFontW=0;
|
||||
mSetCompositionFontW=0;
|
||||
mGetProperty=0;
|
||||
mGetDefaultIMEWnd=0;
|
||||
}
|
||||
|
||||
nsIMM(const char* aModuleName="IMM32.DLL") {
|
||||
mInstance=::LoadLibrary(aModuleName);
|
||||
NS_ASSERTION(mInstance!=NULL,"nsIMM.LoadLibrary failed.");
|
||||
LONG GetCompositionStringA(HIMC h, DWORD d1, LPVOID v, DWORD d2) {
|
||||
return (mGetCompositionStringA) ? mGetCompositionStringA(h, d1, v, d2) : 0L;
|
||||
}
|
||||
|
||||
mGetCompositionStringA=(mInstance) ? (GetCompStrPtr)GetProcAddress(mInstance,"ImmGetCompositionStringA") : 0;
|
||||
NS_ASSERTION(mGetCompositionStringA!=NULL,"nsIMM.ImmGetCompositionStringA failed.");
|
||||
LONG GetCompositionStringW(HIMC h, DWORD d1, LPVOID v, DWORD d2) {
|
||||
return (mGetCompositionStringW) ? mGetCompositionStringW(h, d1, v, d2) : 0L;
|
||||
}
|
||||
|
||||
mGetCompositionStringW=(mInstance) ? (GetCompStrPtr)GetProcAddress(mInstance,"ImmGetCompositionStringW") : 0;
|
||||
NS_ASSERTION(mGetCompositionStringW!=NULL,"nsIMM.ImmGetCompositionStringW failed.");
|
||||
|
||||
mGetContext=(mInstance) ? (GetContextPtr)GetProcAddress(mInstance,"ImmGetContext") : 0;
|
||||
NS_ASSERTION(mGetContext!=NULL,"nsIMM.ImmGetContext failed.");
|
||||
|
||||
mReleaseContext=(mInstance) ? (RelContextPtr)GetProcAddress(mInstance,"ImmReleaseContext") : 0;
|
||||
NS_ASSERTION(mReleaseContext!=NULL,"nsIMM.ImmReleaseContext failed.");
|
||||
|
||||
mGetConversionStatus=(mInstance) ? (GetCStatusPtr)GetProcAddress(mInstance,"ImmGetConversionStatus") : 0;
|
||||
NS_ASSERTION(mGetConversionStatus!=NULL,"nsIMM.ImmGetConversionStatus failed.");
|
||||
|
||||
mSetConversionStatus=(mInstance) ? (SetCStatusPtr)GetProcAddress(mInstance,"ImmSetConversionStatus") : 0;
|
||||
NS_ASSERTION(mSetConversionStatus!=NULL,"nsIMM.ImmSetConversionStatus failed.");
|
||||
|
||||
mNotifyIME=(mInstance) ? (NotifyIMEPtr)GetProcAddress(mInstance,"ImmNotifyIME") : 0;
|
||||
NS_ASSERTION(mNotifyIME!=NULL,"nsIMM.ImmNotifyIME failed.");
|
||||
|
||||
mSetCandiateWindow=(mInstance) ? (SetCandWindowPtr)GetProcAddress(mInstance,"ImmSetCandidateWindow") : 0;
|
||||
NS_ASSERTION(mSetCandiateWindow!=NULL,"nsIMM.ImmSetCandidateWindow failed.");
|
||||
|
||||
mGetCompositionWindow=(mInstance) ? (GetCompWindowPtr)GetProcAddress(mInstance,"ImmGetCompositionWindow") : 0;
|
||||
NS_ASSERTION(mGetCompositionWindow!=NULL,"nsIMM.ImmGetCompositionWindow failed.");
|
||||
|
||||
mGetCompositionFontA=(mInstance) ? (GetCompFontPtr)GetProcAddress(mInstance,"ImmGetCompositionFontA") : 0;
|
||||
NS_ASSERTION(mGetCompositionFontA!=NULL,"nsIMM.ImmGetCompositionFontA failed.");
|
||||
LONG GetContext(HWND anHWND) {
|
||||
return (mGetContext) ? mGetContext(anHWND) : 0L;
|
||||
}
|
||||
|
||||
mGetCompositionFontW=(mInstance) ? (GetCompFontPtr)GetProcAddress(mInstance,"ImmGetCompositionFontW") : 0;
|
||||
NS_ASSERTION(mGetCompositionFontW!=NULL,"nsIMM.ImmGetCompositionFontW failed.");
|
||||
LONG ReleaseContext(HWND anHWND, HIMC anIMC) {
|
||||
return (mReleaseContext) ? mReleaseContext(anHWND, anIMC) : 0L;
|
||||
}
|
||||
|
||||
mSetCompositionFontA=(mInstance) ? (SetCompFontPtr)GetProcAddress(mInstance,"ImmSetCompositionFontA") : 0;
|
||||
NS_ASSERTION(mSetCompositionFontA!=NULL,"nsIMM.ImmSetCompositionFontA failed.");
|
||||
LONG GetConversionStatus(HIMC h, LPDWORD w1, LPDWORD w2) {
|
||||
return (mGetConversionStatus) ? mGetConversionStatus(h, w1, w2) : 0L;
|
||||
}
|
||||
|
||||
mSetCompositionFontW=(mInstance) ? (SetCompFontPtr)GetProcAddress(mInstance,"ImmSetCompositionFontW") : 0;
|
||||
NS_ASSERTION(mSetCompositionFontW!=NULL,"nsIMM.ImmSetCompositionFontW failed.");
|
||||
LONG SetConversionStatus(HIMC h, DWORD d1, DWORD d2) {
|
||||
return (mSetConversionStatus) ? mSetConversionStatus(h, d1, d2) : 0L;
|
||||
}
|
||||
|
||||
mSetCompositionWindow=(mInstance) ? (SetCompWindowPtr)GetProcAddress(mInstance,"ImmSetCompositionWindow") : 0;
|
||||
NS_ASSERTION(mSetCompositionWindow!=NULL,"nsIMM.ImmSetCompositionWindow failed.");
|
||||
LONG NotifyIME(HIMC h, DWORD d1, DWORD d2, DWORD d3) {
|
||||
return (mNotifyIME) ? mNotifyIME(h, d1, d2, d3) : 0L;
|
||||
}
|
||||
|
||||
mGetProperty=(mInstance) ? (GetPropertyPtr)GetProcAddress(mInstance,"ImmGetProperty") : 0;
|
||||
NS_ASSERTION(mGetProperty!=NULL,"nsIMM.ImmGetProperty failed.");
|
||||
LONG SetCandidateWindow(HIMC h, LPCANDIDATEFORM l) {
|
||||
return (mSetCandiateWindow) ? mSetCandiateWindow(h, l) : 0L;
|
||||
}
|
||||
|
||||
mGetDefaultIMEWnd=(mInstance) ? (GetDefaultIMEWndPtr)GetProcAddress(mInstance,"ImmGetDefaultIMEWnd") : 0;
|
||||
NS_ASSERTION(mGetDefaultIMEWnd!=NULL,"nsIMM.ImmGetDefaultIMEWnd failed.");
|
||||
}
|
||||
LONG SetCompositionWindow(HIMC h, LPCOMPOSITIONFORM l) {
|
||||
return (mSetCompositionWindow) ? mSetCompositionWindow(h, l) : 0L;
|
||||
}
|
||||
|
||||
~nsIMM() {
|
||||
if(mInstance) {
|
||||
::FreeLibrary(mInstance);
|
||||
}
|
||||
mGetCompositionStringA= 0;
|
||||
mGetCompositionStringW= 0;
|
||||
mGetContext=0;
|
||||
mReleaseContext=0;
|
||||
mGetConversionStatus=0;
|
||||
mSetConversionStatus=0;
|
||||
mNotifyIME=0;
|
||||
mSetCandiateWindow=0;
|
||||
mGetCompositionWindow=0;
|
||||
mSetCompositionWindow=0;
|
||||
mGetCompositionFontA=0;
|
||||
mGetCompositionFontA=0;
|
||||
mSetCompositionFontW=0;
|
||||
mSetCompositionFontW=0;
|
||||
mGetProperty=0;
|
||||
mGetDefaultIMEWnd=0;
|
||||
}
|
||||
LONG GetCompositionFontA(HIMC h, PLOGFONT l) {
|
||||
return (mGetCompositionFontA) ? mGetCompositionFontA(h, l) : 0L;
|
||||
}
|
||||
|
||||
LONG GetCompositionStringA(HIMC h,DWORD d1,LPVOID v,DWORD d2) {
|
||||
return (mGetCompositionStringA) ? mGetCompositionStringA(h,d1,v,d2) : 0L;
|
||||
}
|
||||
LONG GetCompositionFontW(HIMC h, PLOGFONT l) {
|
||||
return (mGetCompositionFontW) ? mGetCompositionFontW(h, l) : 0L;
|
||||
}
|
||||
|
||||
LONG GetCompositionStringW(HIMC h,DWORD d1,LPVOID v,DWORD d2) {
|
||||
return (mGetCompositionStringW) ? mGetCompositionStringW(h,d1,v,d2) : 0L;
|
||||
}
|
||||
LONG SetCompositionFontA(HIMC h, PLOGFONT l) {
|
||||
return (mSetCompositionFontA) ? mSetCompositionFontA(h, l) : 0L;
|
||||
}
|
||||
|
||||
LONG GetContext(HWND anHWND) {
|
||||
return (mGetContext) ? mGetContext(anHWND) : 0L;
|
||||
}
|
||||
LONG SetCompositionFontW(HIMC h, PLOGFONT l) {
|
||||
return (mSetCompositionFontW) ? mSetCompositionFontW(h, l) : 0L;
|
||||
}
|
||||
|
||||
LONG ReleaseContext(HWND anHWND,HIMC anIMC) {
|
||||
return (mReleaseContext) ? mReleaseContext(anHWND,anIMC) : 0L;
|
||||
}
|
||||
LONG GetCompositionWindow(HIMC h,LPCOMPOSITIONFORM l) {
|
||||
return (mGetCompositionWindow) ? mGetCompositionWindow(h, l) : 0L;
|
||||
}
|
||||
|
||||
LONG GetConversionStatus(HIMC h, LPDWORD w1, LPDWORD w2) {
|
||||
return (mGetConversionStatus) ? mGetConversionStatus(h,w1,w2) : 0L;
|
||||
}
|
||||
LONG GetProperty(HKL hKL, DWORD dwIndex) {
|
||||
return (mGetProperty) ? mGetProperty(hKL, dwIndex) : 0L;
|
||||
}
|
||||
|
||||
LONG SetConversionStatus(HIMC h,DWORD d1,DWORD d2) {
|
||||
return (mSetConversionStatus) ? mSetConversionStatus(h,d1,d2) : 0L;
|
||||
}
|
||||
|
||||
LONG NotifyIME(HIMC h,DWORD d1,DWORD d2,DWORD d3) {
|
||||
return (mNotifyIME) ? mNotifyIME(h,d1,d2,d3) : 0L;
|
||||
}
|
||||
|
||||
LONG SetCandidateWindow(HIMC h,LPCANDIDATEFORM l) {
|
||||
return (mSetCandiateWindow) ? mSetCandiateWindow(h,l) : 0L;
|
||||
}
|
||||
|
||||
LONG SetCompositionWindow(HIMC h,LPCOMPOSITIONFORM l) {
|
||||
return (mSetCompositionWindow) ? mSetCompositionWindow(h,l) : 0L;
|
||||
}
|
||||
|
||||
LONG GetCompositionFontA(HIMC h, PLOGFONT l) {
|
||||
return (mGetCompositionFontA) ? mGetCompositionFontA(h,l) : 0L;
|
||||
}
|
||||
|
||||
LONG GetCompositionFontW(HIMC h, PLOGFONT l) {
|
||||
return (mGetCompositionFontW) ? mGetCompositionFontW(h,l) : 0L;
|
||||
}
|
||||
|
||||
LONG SetCompositionFontA(HIMC h, PLOGFONT l) {
|
||||
return (mSetCompositionFontA) ? mSetCompositionFontA(h,l) : 0L;
|
||||
}
|
||||
|
||||
LONG SetCompositionFontW(HIMC h, PLOGFONT l) {
|
||||
return (mSetCompositionFontW) ? mSetCompositionFontW(h,l) : 0L;
|
||||
}
|
||||
|
||||
LONG GetCompositionWindow(HIMC h,LPCOMPOSITIONFORM l) {
|
||||
return (mGetCompositionWindow) ? mGetCompositionWindow(h,l) : 0L;
|
||||
}
|
||||
|
||||
LONG GetProperty(HKL hKL, DWORD dwIndex) {
|
||||
return (mGetProperty) ? mGetProperty(hKL, dwIndex) : 0L;
|
||||
}
|
||||
|
||||
LONG GetDefaultIMEWnd(HWND hWnd) {
|
||||
return (mGetDefaultIMEWnd) ? mGetDefaultIMEWnd(hWnd) : 0L;
|
||||
}
|
||||
LONG GetDefaultIMEWnd(HWND hWnd) {
|
||||
return (mGetDefaultIMEWnd) ? mGetDefaultIMEWnd(hWnd) : 0L;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
HINSTANCE mInstance;
|
||||
GetCompStrPtr mGetCompositionStringA;
|
||||
GetCompStrPtr mGetCompositionStringW;
|
||||
GetContextPtr mGetContext;
|
||||
RelContextPtr mReleaseContext;
|
||||
GetCStatusPtr mGetConversionStatus;
|
||||
SetCStatusPtr mSetConversionStatus;
|
||||
NotifyIMEPtr mNotifyIME;
|
||||
SetCandWindowPtr mSetCandiateWindow;
|
||||
SetCompWindowPtr mSetCompositionWindow;
|
||||
GetCompFontPtr mGetCompositionFontA;
|
||||
GetCompFontPtr mGetCompositionFontW;
|
||||
SetCompFontPtr mSetCompositionFontA;
|
||||
SetCompFontPtr mSetCompositionFontW;
|
||||
GetCompWindowPtr mGetCompositionWindow;
|
||||
GetPropertyPtr mGetProperty;
|
||||
GetDefaultIMEWndPtr mGetDefaultIMEWnd;
|
||||
HINSTANCE mInstance;
|
||||
GetCompStrPtr mGetCompositionStringA;
|
||||
GetCompStrPtr mGetCompositionStringW;
|
||||
GetContextPtr mGetContext;
|
||||
RelContextPtr mReleaseContext;
|
||||
GetCStatusPtr mGetConversionStatus;
|
||||
SetCStatusPtr mSetConversionStatus;
|
||||
NotifyIMEPtr mNotifyIME;
|
||||
SetCandWindowPtr mSetCandiateWindow;
|
||||
SetCompWindowPtr mSetCompositionWindow;
|
||||
GetCompFontPtr mGetCompositionFontA;
|
||||
GetCompFontPtr mGetCompositionFontW;
|
||||
SetCompFontPtr mSetCompositionFontA;
|
||||
SetCompFontPtr mSetCompositionFontW;
|
||||
GetCompWindowPtr mGetCompositionWindow;
|
||||
GetPropertyPtr mGetProperty;
|
||||
GetDefaultIMEWndPtr mGetDefaultIMEWnd;
|
||||
};
|
||||
|
||||
/**
|
||||
* Native WIN32 window wrapper.
|
||||
* Native WIN32 window wrapper.
|
||||
*/
|
||||
|
||||
class nsWindow : public nsSwitchToUIThread,
|
||||
public nsBaseWidget,
|
||||
public nsIKBStateControl
|
||||
|
||||
{
|
||||
|
||||
public:
|
||||
nsWindow();
|
||||
virtual ~nsWindow();
|
||||
nsWindow();
|
||||
virtual ~nsWindow();
|
||||
|
||||
// nsISupports
|
||||
NS_IMETHOD_(nsrefcnt) AddRef(void);
|
||||
NS_IMETHOD_(nsrefcnt) Release(void);
|
||||
NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr);
|
||||
// nsISupports
|
||||
NS_IMETHOD_(nsrefcnt) AddRef(void);
|
||||
NS_IMETHOD_(nsrefcnt) Release(void);
|
||||
NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr);
|
||||
|
||||
// nsIWidget interface
|
||||
NS_IMETHOD Create(nsIWidget *aParent,
|
||||
const nsRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext,
|
||||
nsIAppShell *aAppShell = nsnull,
|
||||
nsIToolkit *aToolkit = nsnull,
|
||||
nsWidgetInitData *aInitData = nsnull);
|
||||
NS_IMETHOD Create(nsNativeWidget aParent,
|
||||
const nsRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext,
|
||||
nsIAppShell *aAppShell = nsnull,
|
||||
nsIToolkit *aToolkit = nsnull,
|
||||
nsWidgetInitData *aInitData = nsnull);
|
||||
// nsIWidget interface
|
||||
NS_IMETHOD Create(nsIWidget *aParent,
|
||||
const nsRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext,
|
||||
nsIAppShell *aAppShell = nsnull,
|
||||
nsIToolkit *aToolkit = nsnull,
|
||||
nsWidgetInitData *aInitData = nsnull);
|
||||
NS_IMETHOD Create(nsNativeWidget aParent,
|
||||
const nsRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext,
|
||||
nsIAppShell *aAppShell = nsnull,
|
||||
nsIToolkit *aToolkit = nsnull,
|
||||
nsWidgetInitData *aInitData = nsnull);
|
||||
|
||||
// Utility method for implementing both Create(nsIWidget ...) and
|
||||
// Create(nsNativeWidget...)
|
||||
// Utility method for implementing both Create(nsIWidget ...) and
|
||||
// Create(nsNativeWidget...)
|
||||
|
||||
virtual nsresult StandardWindowCreate(nsIWidget *aParent,
|
||||
const nsRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext,
|
||||
nsIAppShell *aAppShell,
|
||||
nsIToolkit *aToolkit,
|
||||
nsWidgetInitData *aInitData,
|
||||
nsNativeWidget aNativeParent = nsnull);
|
||||
virtual nsresult StandardWindowCreate(nsIWidget *aParent,
|
||||
const nsRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext,
|
||||
nsIAppShell *aAppShell,
|
||||
nsIToolkit *aToolkit,
|
||||
nsWidgetInitData *aInitData,
|
||||
nsNativeWidget aNativeParent = nsnull);
|
||||
|
||||
NS_IMETHOD Destroy();
|
||||
NS_IMETHOD SetParent(nsIWidget *aNewParent);
|
||||
virtual nsIWidget* GetParent(void);
|
||||
NS_IMETHOD Show(PRBool bState);
|
||||
NS_IMETHOD IsVisible(PRBool & aState);
|
||||
NS_IMETHOD PlaceBehind(nsTopLevelWidgetZPlacement aPlacement,
|
||||
nsIWidget *aWidget, PRBool aActivate);
|
||||
NS_IMETHOD SetSizeMode(PRInt32 aMode);
|
||||
NS_IMETHOD Destroy();
|
||||
NS_IMETHOD SetParent(nsIWidget *aNewParent);
|
||||
virtual nsIWidget* GetParent(void);
|
||||
NS_IMETHOD Show(PRBool bState);
|
||||
NS_IMETHOD IsVisible(PRBool & aState);
|
||||
NS_IMETHOD PlaceBehind(nsTopLevelWidgetZPlacement aPlacement, nsIWidget *aWidget, PRBool aActivate);
|
||||
NS_IMETHOD SetSizeMode(PRInt32 aMode);
|
||||
NS_IMETHOD ModalEventFilter(PRBool aRealEvent, void *aEvent, PRBool *aForWindow);
|
||||
NS_IMETHOD CaptureMouse(PRBool aCapture);
|
||||
NS_IMETHOD ConstrainPosition(PRBool aAllowSlop, PRInt32 *aX, PRInt32 *aY);
|
||||
NS_IMETHOD Move(PRInt32 aX, PRInt32 aY);
|
||||
NS_IMETHOD Resize(PRInt32 aWidth, PRInt32 aHeight, PRBool aRepaint);
|
||||
NS_IMETHOD Resize(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight, PRBool aRepaint);
|
||||
NS_IMETHOD Enable(PRBool aState);
|
||||
NS_IMETHOD IsEnabled(PRBool *aState);
|
||||
NS_IMETHOD SetFocus(PRBool aRaise);
|
||||
NS_IMETHOD GetBounds(nsRect &aRect);
|
||||
NS_IMETHOD GetClientBounds(nsRect &aRect);
|
||||
NS_IMETHOD GetScreenBounds(nsRect &aRect);
|
||||
NS_IMETHOD SetBackgroundColor(const nscolor &aColor);
|
||||
virtual nsIFontMetrics* GetFont(void);
|
||||
NS_IMETHOD SetFont(const nsFont &aFont);
|
||||
NS_IMETHOD SetCursor(nsCursor aCursor);
|
||||
NS_IMETHOD HideWindowChrome(PRBool aShouldHide);
|
||||
NS_IMETHOD Validate();
|
||||
NS_IMETHOD Invalidate(PRBool aIsSynchronous);
|
||||
NS_IMETHOD Invalidate(const nsRect & aRect, PRBool aIsSynchronous);
|
||||
NS_IMETHOD InvalidateRegion(const nsIRegion *aRegion, PRBool aIsSynchronous);
|
||||
NS_IMETHOD Update();
|
||||
virtual void* GetNativeData(PRUint32 aDataType);
|
||||
virtual void FreeNativeData(void * data, PRUint32 aDataType);//~~~
|
||||
NS_IMETHOD SetColorMap(nsColorMap *aColorMap);
|
||||
//XXX-Scroll is obsolete it is going away soon
|
||||
NS_IMETHOD Scroll(PRInt32 aDx, PRInt32 aDy, nsRect *aClipRect);
|
||||
NS_IMETHOD ScrollWidgets(PRInt32 aDx, PRInt32 aDy);
|
||||
NS_IMETHOD ScrollRect(nsRect &aRect, PRInt32 aDx, PRInt32 aDy);
|
||||
NS_IMETHOD SetTitle(const nsAString& aTitle);
|
||||
NS_IMETHOD SetIcon(const nsAString& aIconSpec);
|
||||
NS_IMETHOD SetMenuBar(nsIMenuBar * aMenuBar) { return NS_ERROR_FAILURE; }
|
||||
NS_IMETHOD ShowMenuBar(PRBool aShow) { return NS_ERROR_FAILURE; }
|
||||
NS_IMETHOD WidgetToScreen(const nsRect& aOldRect, nsRect& aNewRect);
|
||||
NS_IMETHOD ScreenToWidget(const nsRect& aOldRect, nsRect& aNewRect);
|
||||
NS_IMETHOD BeginResizingChildren(void);
|
||||
NS_IMETHOD EndResizingChildren(void);
|
||||
NS_IMETHOD GetPreferredSize(PRInt32& aWidth, PRInt32& aHeight);
|
||||
NS_IMETHOD SetPreferredSize(PRInt32 aWidth, PRInt32 aHeight);
|
||||
NS_IMETHOD DispatchEvent(nsGUIEvent* event, nsEventStatus & aStatus);
|
||||
NS_IMETHOD EnableDragDrop(PRBool aEnable);
|
||||
|
||||
NS_IMETHOD ModalEventFilter(PRBool aRealEvent, void *aEvent,
|
||||
PRBool *aForWindow);
|
||||
virtual void SetUpForPaint(HDC aHDC);
|
||||
virtual void ConvertToDeviceCoordinates(nscoord& aX,nscoord& aY) {}
|
||||
|
||||
NS_IMETHOD CaptureMouse(PRBool aCapture);
|
||||
NS_IMETHOD ConstrainPosition(PRBool aAllowSlop,
|
||||
PRInt32 *aX, PRInt32 *aY);
|
||||
NS_IMETHOD Move(PRInt32 aX, PRInt32 aY);
|
||||
NS_IMETHOD Resize(PRInt32 aWidth,
|
||||
PRInt32 aHeight,
|
||||
PRBool aRepaint);
|
||||
NS_IMETHOD Resize(PRInt32 aX,
|
||||
PRInt32 aY,
|
||||
PRInt32 aWidth,
|
||||
PRInt32 aHeight,
|
||||
PRBool aRepaint);
|
||||
NS_IMETHOD Enable(PRBool aState);
|
||||
NS_IMETHOD IsEnabled(PRBool *aState);
|
||||
NS_IMETHOD SetFocus(PRBool aRaise);
|
||||
NS_IMETHOD GetBounds(nsRect &aRect);
|
||||
NS_IMETHOD GetClientBounds(nsRect &aRect);
|
||||
NS_IMETHOD GetScreenBounds(nsRect &aRect);
|
||||
NS_IMETHOD SetBackgroundColor(const nscolor &aColor);
|
||||
virtual nsIFontMetrics* GetFont(void);
|
||||
NS_IMETHOD SetFont(const nsFont &aFont);
|
||||
NS_IMETHOD SetCursor(nsCursor aCursor);
|
||||
NS_IMETHOD HideWindowChrome(PRBool aShouldHide);
|
||||
NS_IMETHOD Validate();
|
||||
NS_IMETHOD Invalidate(PRBool aIsSynchronous);
|
||||
NS_IMETHOD Invalidate(const nsRect & aRect, PRBool aIsSynchronous);
|
||||
NS_IMETHOD InvalidateRegion(const nsIRegion *aRegion, PRBool aIsSynchronous);
|
||||
NS_IMETHOD Update();
|
||||
virtual void* GetNativeData(PRUint32 aDataType);
|
||||
virtual void FreeNativeData(void * data, PRUint32 aDataType);//~~~
|
||||
NS_IMETHOD SetColorMap(nsColorMap *aColorMap);
|
||||
//XXX-Scroll is obsolete it is going away soon
|
||||
NS_IMETHOD Scroll(PRInt32 aDx, PRInt32 aDy, nsRect *aClipRect);
|
||||
NS_IMETHOD ScrollWidgets(PRInt32 aDx, PRInt32 aDy);
|
||||
NS_IMETHOD ScrollRect(nsRect &aRect, PRInt32 aDx, PRInt32 aDy);
|
||||
NS_IMETHOD SetTitle(const nsAString& aTitle);
|
||||
NS_IMETHOD SetIcon(const nsAString& aIconSpec);
|
||||
NS_IMETHOD SetMenuBar(nsIMenuBar * aMenuBar) { return NS_ERROR_FAILURE; }
|
||||
NS_IMETHOD ShowMenuBar(PRBool aShow) { return NS_ERROR_FAILURE; }
|
||||
NS_IMETHOD WidgetToScreen(const nsRect& aOldRect, nsRect& aNewRect);
|
||||
NS_IMETHOD ScreenToWidget(const nsRect& aOldRect, nsRect& aNewRect);
|
||||
NS_IMETHOD BeginResizingChildren(void);
|
||||
NS_IMETHOD EndResizingChildren(void);
|
||||
NS_IMETHOD GetPreferredSize(PRInt32& aWidth, PRInt32& aHeight);
|
||||
NS_IMETHOD SetPreferredSize(PRInt32 aWidth, PRInt32 aHeight);
|
||||
NS_IMETHOD DispatchEvent(nsGUIEvent* event, nsEventStatus & aStatus);
|
||||
NS_IMETHOD EnableDragDrop(PRBool aEnable);
|
||||
NS_IMETHOD CaptureRollupEvents(nsIRollupListener * aListener, PRBool aDoCapture, PRBool aConsumeRollupEvent);
|
||||
|
||||
virtual void SetUpForPaint(HDC aHDC);
|
||||
virtual void ConvertToDeviceCoordinates(nscoord &aX,nscoord &aY) {}
|
||||
|
||||
NS_IMETHOD CaptureRollupEvents(nsIRollupListener * aListener, PRBool aDoCapture, PRBool aConsumeRollupEvent);
|
||||
|
||||
NS_IMETHOD GetAttention(PRInt32 aCycleCount);
|
||||
NS_IMETHOD GetLastInputEventTime(PRUint32& aTime);
|
||||
NS_IMETHOD GetAttention(PRInt32 aCycleCount);
|
||||
NS_IMETHOD GetLastInputEventTime(PRUint32& aTime);
|
||||
|
||||
#ifdef MOZ_XUL
|
||||
NS_IMETHOD SetWindowTranslucency(PRBool aTransparent);
|
||||
|
@ -406,141 +393,137 @@ private:
|
|||
public:
|
||||
#endif
|
||||
|
||||
// nsIKBStateControl interface
|
||||
// nsIKBStateControl interface
|
||||
|
||||
NS_IMETHOD ResetInputState();
|
||||
NS_IMETHOD ResetInputState();
|
||||
|
||||
PRBool IMEMouseHandling(PRUint32 aEventType, PRInt32 aAction, LPARAM lParam);
|
||||
PRBool IMECompositionHitTest(PRUint32 aEventType, POINT * ptPos);
|
||||
PRBool HandleMouseActionOfIME(PRInt32 aAction, POINT* ptPos);
|
||||
void GetCompositionWindowPos(HIMC hIMC, PRUint32 aEventType, COMPOSITIONFORM *cpForm);
|
||||
PRBool IMEMouseHandling(PRUint32 aEventType, PRInt32 aAction, LPARAM lParam);
|
||||
PRBool IMECompositionHitTest(PRUint32 aEventType, POINT * ptPos);
|
||||
PRBool HandleMouseActionOfIME(PRInt32 aAction, POINT* ptPos);
|
||||
void GetCompositionWindowPos(HIMC hIMC, PRUint32 aEventType, COMPOSITIONFORM *cpForm);
|
||||
|
||||
// nsSwitchToUIThread interface
|
||||
virtual BOOL CallMethod(MethodInfo *info);
|
||||
// nsSwitchToUIThread interface
|
||||
virtual BOOL CallMethod(MethodInfo *info);
|
||||
|
||||
HWND GetWindowHandle() { return mWnd; }
|
||||
WNDPROC GetPrevWindowProc() { return mPrevWndProc; }
|
||||
HWND GetWindowHandle() { return mWnd; }
|
||||
WNDPROC GetPrevWindowProc() { return mPrevWndProc; }
|
||||
|
||||
virtual PRBool DispatchMouseEvent(PRUint32 aEventType, WPARAM wParam = NULL, nsPoint* aPoint = nsnull);
|
||||
virtual PRBool DispatchMouseEvent(PRUint32 aEventType, WPARAM wParam = NULL, nsPoint* aPoint = nsnull);
|
||||
#ifdef ACCESSIBILITY
|
||||
virtual PRBool DispatchAccessibleEvent(PRUint32 aEventType, nsIAccessible** aAccessible, nsPoint* aPoint = nsnull);
|
||||
void CreateRootAccessible();
|
||||
void ClearRootAccessible();
|
||||
virtual PRBool DispatchAccessibleEvent(PRUint32 aEventType, nsIAccessible** aAccessible, nsPoint* aPoint = nsnull);
|
||||
void CreateRootAccessible();
|
||||
void ClearRootAccessible();
|
||||
#endif
|
||||
virtual PRBool AutoErase();
|
||||
nsPoint* GetLastPoint() { return &mLastPoint; }
|
||||
virtual PRBool AutoErase();
|
||||
nsPoint* GetLastPoint() { return &mLastPoint; }
|
||||
|
||||
PRInt32 GetNewCmdMenuId() { mMenuCmdId++; return mMenuCmdId;}
|
||||
PRInt32 GetNewCmdMenuId() { mMenuCmdId++; return mMenuCmdId; }
|
||||
|
||||
void InitEvent(nsGUIEvent& event, nsPoint* aPoint = nsnull);
|
||||
void InitEvent(nsGUIEvent& event, nsPoint* aPoint = nsnull);
|
||||
|
||||
void SuppressBlurEvents(PRBool aSuppress);
|
||||
PRBool BlurEventsSuppressed();
|
||||
void SuppressBlurEvents(PRBool aSuppress);
|
||||
PRBool BlurEventsSuppressed();
|
||||
|
||||
protected:
|
||||
// special callback hook methods for pop ups
|
||||
static LRESULT CALLBACK MozSpecialMsgFilter(int code, WPARAM wParam, LPARAM lParam);
|
||||
static LRESULT CALLBACK MozSpecialWndProc(int code, WPARAM wParam, LPARAM lParam);
|
||||
static LRESULT CALLBACK MozSpecialMouseProc(int code, WPARAM wParam, LPARAM lParam);
|
||||
static VOID CALLBACK HookTimerForPopups( HWND hwnd, UINT uMsg, UINT idEvent, DWORD dwTime );
|
||||
static void ScheduleHookTimer(HWND aWnd, UINT aMsgId);
|
||||
// special callback hook methods for pop ups
|
||||
static LRESULT CALLBACK MozSpecialMsgFilter(int code, WPARAM wParam, LPARAM lParam);
|
||||
static LRESULT CALLBACK MozSpecialWndProc(int code, WPARAM wParam, LPARAM lParam);
|
||||
static LRESULT CALLBACK MozSpecialMouseProc(int code, WPARAM wParam, LPARAM lParam);
|
||||
static VOID CALLBACK HookTimerForPopups( HWND hwnd, UINT uMsg, UINT idEvent, DWORD dwTime );
|
||||
static void ScheduleHookTimer(HWND aWnd, UINT aMsgId);
|
||||
|
||||
static void RegisterSpecialDropdownHooks();
|
||||
static void UnregisterSpecialDropdownHooks();
|
||||
static void RegisterSpecialDropdownHooks();
|
||||
static void UnregisterSpecialDropdownHooks();
|
||||
|
||||
static BOOL DealWithPopups ( UINT inMsg, WPARAM inWParam, LPARAM inLParam, LRESULT* outResult ) ;
|
||||
static BOOL DealWithPopups (UINT inMsg, WPARAM inWParam, LPARAM inLParam, LRESULT* outResult);
|
||||
|
||||
static PRBool EventIsInsideWindow(UINT Msg, nsWindow* aWindow);
|
||||
static PRBool EventIsInsideWindow(UINT Msg, nsWindow* aWindow);
|
||||
|
||||
static nsWindow * GetNSWindowPtr(HWND aWnd);
|
||||
static BOOL SetNSWindowPtr(HWND aWnd, nsWindow * ptr);
|
||||
static nsWindow * GetNSWindowPtr(HWND aWnd);
|
||||
static BOOL SetNSWindowPtr(HWND aWnd, nsWindow * ptr);
|
||||
|
||||
void DispatchPendingEvents();
|
||||
virtual PRBool ProcessMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT *aRetValue);
|
||||
virtual PRBool DispatchWindowEvent(nsGUIEvent* event);
|
||||
virtual PRBool DispatchWindowEvent(nsGUIEvent*event, nsEventStatus &aStatus);
|
||||
void DispatchPendingEvents();
|
||||
virtual PRBool ProcessMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT *aRetValue);
|
||||
virtual PRBool DispatchWindowEvent(nsGUIEvent* event);
|
||||
virtual PRBool DispatchWindowEvent(nsGUIEvent*event, nsEventStatus &aStatus);
|
||||
|
||||
// Allow Derived classes to modify the height that is passed
|
||||
// when the window is created or resized.
|
||||
virtual PRInt32 GetHeight(PRInt32 aProposedHeight);
|
||||
virtual LPCWSTR WindowClassW();
|
||||
virtual LPCWSTR WindowPopupClassW();
|
||||
virtual LPCTSTR WindowClass();
|
||||
virtual LPCTSTR WindowPopupClass();
|
||||
virtual DWORD WindowStyle();
|
||||
virtual DWORD WindowExStyle();
|
||||
// Allow Derived classes to modify the height that is passed
|
||||
// when the window is created or resized.
|
||||
virtual PRInt32 GetHeight(PRInt32 aProposedHeight);
|
||||
virtual LPCWSTR WindowClassW();
|
||||
virtual LPCWSTR WindowPopupClassW();
|
||||
virtual LPCTSTR WindowClass();
|
||||
virtual LPCTSTR WindowPopupClass();
|
||||
virtual DWORD WindowStyle();
|
||||
virtual DWORD WindowExStyle();
|
||||
|
||||
virtual void SubclassWindow(BOOL bState);
|
||||
virtual void SubclassWindow(BOOL bState);
|
||||
|
||||
virtual void OnDestroy();
|
||||
virtual PRBool OnMove(PRInt32 aX, PRInt32 aY);
|
||||
virtual PRBool OnPaint(HDC aDC = nsnull);
|
||||
virtual PRBool OnResize(nsRect &aWindowRect);
|
||||
virtual void OnDestroy();
|
||||
virtual PRBool OnMove(PRInt32 aX, PRInt32 aY);
|
||||
virtual PRBool OnPaint(HDC aDC = nsnull);
|
||||
virtual PRBool OnResize(nsRect &aWindowRect);
|
||||
|
||||
BOOL OnChar(UINT charCode);
|
||||
BOOL OnChar(UINT charCode);
|
||||
|
||||
BOOL OnKeyDown( UINT aVirtualKeyCode, UINT aScanCode, LPARAM aKeyCode);
|
||||
BOOL OnKeyUp( UINT aVirtualKeyCode, UINT aScanCode, LPARAM aKeyCode);
|
||||
UINT MapFromNativeToDOM(UINT aNativeKeyCode);
|
||||
BOOL OnKeyDown( UINT aVirtualKeyCode, UINT aScanCode, LPARAM aKeyCode);
|
||||
BOOL OnKeyUp( UINT aVirtualKeyCode, UINT aScanCode, LPARAM aKeyCode);
|
||||
UINT MapFromNativeToDOM(UINT aNativeKeyCode);
|
||||
|
||||
|
||||
BOOL OnInputLangChange(HKL aHKL, LRESULT *oResult);
|
||||
BOOL OnIMEChar(BYTE aByte1, BYTE aByte2, LPARAM aKeyState);
|
||||
BOOL OnIMEComposition(LPARAM aGCS);
|
||||
BOOL OnIMECompositionFull();
|
||||
BOOL OnIMEEndComposition();
|
||||
BOOL OnIMENotify(WPARAM aIMN, LPARAM aData, LRESULT *oResult);
|
||||
BOOL OnIMERequest(WPARAM aIMR, LPARAM aData, LRESULT *oResult, PRBool aUseUnicode = PR_FALSE);
|
||||
BOOL OnIMESelect(BOOL aSelected, WORD aLangID);
|
||||
BOOL OnIMESetContext(BOOL aActive, LPARAM& aISC);
|
||||
BOOL OnIMEStartComposition();
|
||||
BOOL OnIMEReconvert(LPARAM aData, LRESULT *oResult, PRBool aUseUnicode);
|
||||
BOOL OnInputLangChange(HKL aHKL, LRESULT *oResult);
|
||||
BOOL OnIMEChar(BYTE aByte1, BYTE aByte2, LPARAM aKeyState);
|
||||
BOOL OnIMEComposition(LPARAM aGCS);
|
||||
BOOL OnIMECompositionFull();
|
||||
BOOL OnIMEEndComposition();
|
||||
BOOL OnIMENotify(WPARAM aIMN, LPARAM aData, LRESULT *oResult);
|
||||
BOOL OnIMERequest(WPARAM aIMR, LPARAM aData, LRESULT *oResult, PRBool aUseUnicode = PR_FALSE);
|
||||
BOOL OnIMESelect(BOOL aSelected, WORD aLangID);
|
||||
BOOL OnIMESetContext(BOOL aActive, LPARAM& aISC);
|
||||
BOOL OnIMEStartComposition();
|
||||
BOOL OnIMEReconvert(LPARAM aData, LRESULT *oResult, PRBool aUseUnicode);
|
||||
|
||||
virtual PRBool DispatchKeyEvent(PRUint32 aEventType, WORD aCharCode, UINT aVirtualCharCode, LPARAM aKeyCode);
|
||||
virtual PRBool DispatchKeyEvent(PRUint32 aEventType, WORD aCharCode, UINT aVirtualCharCode, LPARAM aKeyCode);
|
||||
|
||||
virtual PRBool DispatchFocus(PRUint32 aEventType, PRBool isMozWindowTakingFocus);
|
||||
virtual PRBool OnScroll(UINT scrollCode, int cPos);
|
||||
virtual HBRUSH OnControlColor();
|
||||
virtual PRBool DispatchFocus(PRUint32 aEventType, PRBool isMozWindowTakingFocus);
|
||||
virtual PRBool OnScroll(UINT scrollCode, int cPos);
|
||||
virtual HBRUSH OnControlColor();
|
||||
|
||||
static LRESULT CALLBACK WindowProc(HWND hWnd,
|
||||
UINT msg,
|
||||
WPARAM wParam,
|
||||
LPARAM lParam);
|
||||
static LRESULT CALLBACK DefaultWindowProc(HWND hWns, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
static LRESULT CALLBACK WindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
static LRESULT CALLBACK DefaultWindowProc(HWND hWns, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
|
||||
static PRBool ConvertStatus(nsEventStatus aStatus);
|
||||
static PRBool ConvertStatus(nsEventStatus aStatus);
|
||||
|
||||
PRBool DispatchStandardEvent(PRUint32 aMsg);
|
||||
PRBool DispatchAppCommandEvent(PRUint32 aEventCommand);
|
||||
void RelayMouseEvent(UINT aMsg, WPARAM wParam, LPARAM lParam);
|
||||
PRBool DispatchStandardEvent(PRUint32 aMsg);
|
||||
PRBool DispatchAppCommandEvent(PRUint32 aEventCommand);
|
||||
void RelayMouseEvent(UINT aMsg, WPARAM wParam, LPARAM lParam);
|
||||
|
||||
void GetNonClientBounds(nsRect &aRect);
|
||||
void HandleTextEvent(HIMC hIMEContext, PRBool aCheckAttr=PR_TRUE);
|
||||
BOOL HandleStartComposition(HIMC hIMEContext);
|
||||
void HandleEndComposition(void);
|
||||
void MapDBCSAtrributeArrayToUnicodeOffsets(PRUint32* textRangeListLengthResult, nsTextRangeArray* textRangeListResult);
|
||||
void GetNonClientBounds(nsRect &aRect);
|
||||
void HandleTextEvent(HIMC hIMEContext, PRBool aCheckAttr=PR_TRUE);
|
||||
BOOL HandleStartComposition(HIMC hIMEContext);
|
||||
void HandleEndComposition(void);
|
||||
void MapDBCSAtrributeArrayToUnicodeOffsets(PRUint32* textRangeListLengthResult, nsTextRangeArray* textRangeListResult);
|
||||
|
||||
void ConstrainZLevel(HWND *aAfter);
|
||||
void ConstrainZLevel(HWND *aAfter);
|
||||
|
||||
private:
|
||||
|
||||
|
||||
#ifdef DEBUG
|
||||
void DebugPrintEvent(nsGUIEvent & aEvent,
|
||||
HWND aWnd);
|
||||
void DebugPrintEvent(nsGUIEvent& aEvent, HWND aWnd);
|
||||
#endif
|
||||
|
||||
protected:
|
||||
nsSize mLastSize;
|
||||
static nsWindow* gCurrentWindow;
|
||||
nsPoint mLastPoint;
|
||||
HWND mWnd;
|
||||
nsSize mLastSize;
|
||||
static nsWindow* gCurrentWindow;
|
||||
nsPoint mLastPoint;
|
||||
HWND mWnd;
|
||||
HWND mBorderlessParent;
|
||||
#if 0
|
||||
HPALETTE mPalette;
|
||||
HPALETTE mPalette;
|
||||
#endif
|
||||
WNDPROC mPrevWndProc;
|
||||
HBRUSH mBrush;
|
||||
WNDPROC mPrevWndProc;
|
||||
HBRUSH mBrush;
|
||||
|
||||
#ifdef MOZ_XUL
|
||||
HBITMAP mMemoryBitmap;
|
||||
|
@ -548,98 +531,98 @@ protected:
|
|||
PRUint8* mAlphaMask;
|
||||
PRPackedBool mIsTranslucent;
|
||||
#endif
|
||||
PRPackedBool mIsTopWidgetWindow;
|
||||
PRPackedBool mHas3DBorder;
|
||||
PRPackedBool mIsShiftDown;
|
||||
PRPackedBool mIsControlDown;
|
||||
PRPackedBool mIsAltDown;
|
||||
PRPackedBool mIsDestroying;
|
||||
PRPackedBool mOnDestroyCalled;
|
||||
PRPackedBool mIsVisible;
|
||||
PRPackedBool mIMEIsComposing;
|
||||
PRPackedBool mIMEIsStatusChanged;
|
||||
PRPackedBool mIsInMouseCapture;
|
||||
PRPackedBool mIsInMouseWheelProcessing;
|
||||
PRPackedBool mUnicodeWidget;
|
||||
PRPackedBool mIsTopWidgetWindow;
|
||||
PRPackedBool mHas3DBorder;
|
||||
PRPackedBool mIsShiftDown;
|
||||
PRPackedBool mIsControlDown;
|
||||
PRPackedBool mIsAltDown;
|
||||
PRPackedBool mIsDestroying;
|
||||
PRPackedBool mOnDestroyCalled;
|
||||
PRPackedBool mIsVisible;
|
||||
PRPackedBool mIMEIsComposing;
|
||||
PRPackedBool mIMEIsStatusChanged;
|
||||
PRPackedBool mIsInMouseCapture;
|
||||
PRPackedBool mIsInMouseWheelProcessing;
|
||||
PRPackedBool mUnicodeWidget;
|
||||
|
||||
char mLeadByte;
|
||||
PRUint32 mBlurEventSuppressionLevel;
|
||||
nsContentType mContentType;
|
||||
char mLeadByte;
|
||||
PRUint32 mBlurEventSuppressionLevel;
|
||||
nsContentType mContentType;
|
||||
|
||||
// XXX Temporary, should not be caching the font
|
||||
nsFont * mFont;
|
||||
// XXX Temporary, should not be caching the font
|
||||
nsFont * mFont;
|
||||
|
||||
PRInt32 mPreferredWidth;
|
||||
PRInt32 mPreferredHeight;
|
||||
PRInt32 mPreferredWidth;
|
||||
PRInt32 mPreferredHeight;
|
||||
|
||||
PRInt32 mMenuCmdId;
|
||||
PRInt32 mMenuCmdId;
|
||||
|
||||
// Window styles used by this window before chrome was hidden
|
||||
DWORD mOldStyle;
|
||||
DWORD mOldExStyle;
|
||||
DWORD mOldStyle;
|
||||
DWORD mOldExStyle;
|
||||
|
||||
// For Input Method Support
|
||||
DWORD mIMEProperty;
|
||||
nsCString* mIMECompString;
|
||||
nsString* mIMECompUnicode;
|
||||
PRUint8* mIMEAttributeString;
|
||||
PRInt32 mIMEAttributeStringLength;
|
||||
PRInt32 mIMEAttributeStringSize;
|
||||
PRUint32* mIMECompClauseString;
|
||||
PRInt32 mIMECompClauseStringLength;
|
||||
PRInt32 mIMECompClauseStringSize;
|
||||
long mIMECursorPosition;
|
||||
PRUnichar* mIMEReconvertUnicode; // reconvert string
|
||||
|
||||
// For describing composing frame
|
||||
RECT* mIMECompCharPos;
|
||||
// For Input Method Support
|
||||
DWORD mIMEProperty;
|
||||
nsCString* mIMECompString;
|
||||
nsString* mIMECompUnicode;
|
||||
PRUint8* mIMEAttributeString;
|
||||
PRInt32 mIMEAttributeStringLength;
|
||||
PRInt32 mIMEAttributeStringSize;
|
||||
PRUint32* mIMECompClauseString;
|
||||
PRInt32 mIMECompClauseStringLength;
|
||||
PRInt32 mIMECompClauseStringSize;
|
||||
long mIMECursorPosition;
|
||||
PRUnichar* mIMEReconvertUnicode; // reconvert string
|
||||
|
||||
static UINT gCurrentKeyboardCP;
|
||||
static HKL gKeyboardLayout;
|
||||
// For describing composing frame
|
||||
RECT* mIMECompCharPos;
|
||||
|
||||
// Drag & Drop
|
||||
nsNativeDragTarget * mNativeDragTarget;
|
||||
static UINT gCurrentKeyboardCP;
|
||||
static HKL gKeyboardLayout;
|
||||
|
||||
// Enumeration of the methods which are accessable on the "main GUI thread"
|
||||
// via the CallMethod(...) mechanism...
|
||||
// see nsSwitchToUIThread
|
||||
enum {
|
||||
CREATE = 0x0101,
|
||||
CREATE_NATIVE,
|
||||
DESTROY,
|
||||
SET_FOCUS,
|
||||
SET_CURSOR,
|
||||
CREATE_HACK
|
||||
};
|
||||
// Drag & Drop
|
||||
nsNativeDragTarget * mNativeDragTarget;
|
||||
|
||||
static BOOL sIsRegistered;
|
||||
static BOOL sIsPopupClassRegistered;
|
||||
// Enumeration of the methods which are accessable on the "main GUI thread"
|
||||
// via the CallMethod(...) mechanism...
|
||||
// see nsSwitchToUIThread
|
||||
enum {
|
||||
CREATE = 0x0101,
|
||||
CREATE_NATIVE,
|
||||
DESTROY,
|
||||
SET_FOCUS,
|
||||
SET_CURSOR,
|
||||
CREATE_HACK
|
||||
};
|
||||
|
||||
HDWP mDeferredPositioner;
|
||||
static UINT uMSH_MOUSEWHEEL;
|
||||
static BOOL sIsRegistered;
|
||||
static BOOL sIsPopupClassRegistered;
|
||||
|
||||
// IME special message
|
||||
static UINT uWM_MSIME_RECONVERT; // reconvert messge for MSIME
|
||||
static UINT uWM_MSIME_MOUSE; // mouse messge for MSIME
|
||||
static UINT uWM_ATOK_RECONVERT; // reconvert messge for ATOK
|
||||
HDWP mDeferredPositioner;
|
||||
static UINT uMSH_MOUSEWHEEL;
|
||||
|
||||
// Heap dump
|
||||
static UINT uWM_HEAP_DUMP; // Dump heap to a file
|
||||
// IME special message
|
||||
static UINT uWM_MSIME_RECONVERT; // reconvert message for MSIME
|
||||
static UINT uWM_MSIME_MOUSE; // mouse message for MSIME
|
||||
static UINT uWM_ATOK_RECONVERT; // reconvert message for ATOK
|
||||
|
||||
// Heap dump
|
||||
static UINT uWM_HEAP_DUMP; // Dump heap to a file
|
||||
|
||||
#ifdef ACCESSIBILITY
|
||||
nsIAccessible* mRootAccessible;
|
||||
static BOOL gIsAccessibilityOn;
|
||||
static HINSTANCE gmAccLib;
|
||||
static LPFNLRESULTFROMOBJECT gmLresultFromObject;
|
||||
static STDMETHODIMP_(LRESULT) LresultFromObject(REFIID riid,WPARAM wParam,LPUNKNOWN pAcc);
|
||||
nsIAccessible* mRootAccessible;
|
||||
static BOOL gIsAccessibilityOn;
|
||||
static HINSTANCE gmAccLib;
|
||||
static LPFNLRESULTFROMOBJECT gmLresultFromObject;
|
||||
static STDMETHODIMP_(LRESULT) LresultFromObject(REFIID riid, WPARAM wParam, LPUNKNOWN pAcc);
|
||||
#endif
|
||||
|
||||
static BOOL CALLBACK BroadcastMsgToChildren(HWND aWnd, LPARAM aMsg);
|
||||
static BOOL CALLBACK BroadcastMsg(HWND aTopWindow, LPARAM aMsg);
|
||||
static BOOL CALLBACK DispatchStarvedPaints(HWND aTopWindow, LPARAM aMsg);
|
||||
static BOOL CALLBACK BroadcastMsgToChildren(HWND aWnd, LPARAM aMsg);
|
||||
static BOOL CALLBACK BroadcastMsg(HWND aTopWindow, LPARAM aMsg);
|
||||
static BOOL CALLBACK DispatchStarvedPaints(HWND aTopWindow, LPARAM aMsg);
|
||||
|
||||
public:
|
||||
static void GlobalMsgWindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
static void GlobalMsgWindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
};
|
||||
|
||||
//
|
||||
|
@ -648,11 +631,11 @@ public:
|
|||
class ChildWindow : public nsWindow {
|
||||
|
||||
public:
|
||||
ChildWindow(){}
|
||||
PRBool DispatchMouseEvent(PRUint32 aEventType, WPARAM wParam = NULL, nsPoint* aPoint = nsnull);
|
||||
ChildWindow() {}
|
||||
PRBool DispatchMouseEvent(PRUint32 aEventType, WPARAM wParam = NULL, nsPoint* aPoint = nsnull);
|
||||
|
||||
protected:
|
||||
virtual DWORD WindowStyle();
|
||||
virtual DWORD WindowStyle();
|
||||
};
|
||||
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче