Bug 295481. WINCE Fixes. This includes changes to make the makefiles do the right thing if we try to build Minimo and XUL together. These changes rs=bsmedberg. Further WINCE fixes in GFX and Widget. r=emaijala, sr=rbs, a=asa.

git-svn-id: svn://10.0.0.236/trunk@174301 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
dougt%meer.net
2005-06-08 16:48:44 +00:00
parent 3c73f98c69
commit c4e6e2a6f1
15 changed files with 190 additions and 183 deletions

View File

@@ -378,9 +378,11 @@ tier_99_dirs += toolkit/mozapps/installer
endif
else
ifneq (,$(MOZ_XPFE_COMPONENTS)$(MOZ_XUL))
ifndef MINIMO
tier_99_dirs += xpfe/bootstrap
endif
endif
endif
ifneq (,$(MOZ_ENABLE_GTK)$(MOZ_ENABLE_GTK2))
tier_99_dirs += embedding/browser/gtk

View File

@@ -485,12 +485,6 @@ rdf/base/Makefile
rdf/base/idl/Makefile
rdf/base/public/Makefile
rdf/base/src/Makefile
rdf/chrome/Makefile
rdf/chrome/public/Makefile
rdf/chrome/build/Makefile
rdf/chrome/src/Makefile
rdf/chrome/tools/Makefile
rdf/chrome/tools/chromereg/Makefile
rdf/util/Makefile
rdf/util/public/Makefile
rdf/util/src/Makefile
@@ -518,6 +512,20 @@ caps/include/Makefile
caps/src/Makefile
"
MAKEFILES_chrome="
chrome/Makefile
chrome/public/Makefile
chrome/src/Makefile
embedding/minimo/chromelite/Makefile
rdf/chrome/Makefile
rdf/chrome/public/Makefile
rdf/chrome/build/Makefile
rdf/chrome/src/Makefile
rdf/chrome/tools/Makefile
rdf/chrome/tools/chromereg/Makefile
"
MAKEFILES_view="
view/Makefile
view/public/Makefile
@@ -669,10 +677,15 @@ xpfe/components/shistory/src/Makefile
xpfe/components/bookmarks/Makefile
xpfe/components/bookmarks/public/Makefile
xpfe/components/bookmarks/src/Makefile
xpfe/components/bookmarks/resources/Makefile
xpfe/components/directory/Makefile
xpfe/components/download-manager/Makefile
xpfe/components/download-manager/src/Makefile
xpfe/components/download-manager/public/Makefile
xpfe/components/download-manager/resources/Makefile
xpfe/components/extensions/Makefile
xpfe/components/extensions/src/Makefile
xpfe/components/extensions/public/Makefile
xpfe/components/find/Makefile
xpfe/components/find/public/Makefile
xpfe/components/find/src/Makefile
@@ -682,6 +695,7 @@ xpfe/components/filepicker/src/Makefile
xpfe/components/history/Makefile
xpfe/components/history/src/Makefile
xpfe/components/history/public/Makefile
xpfe/components/intl/Makefile
xpfe/components/prefwindow/Makefile
xpfe/components/prefwindow/resources/Makefile
xpfe/components/prefwindow/resources/content/Makefile
@@ -691,6 +705,7 @@ xpfe/components/prefwindow/resources/locale/Makefile
xpfe/components/prefwindow/resources/locale/en-US/Makefile
xpfe/components/prefwindow/resources/locale/en-US/unix/Makefile
xpfe/components/prefwindow/resources/locale/en-US/win/Makefile
xpfe/components/prefwindow/resources/locale/en-US/mac/Makefile
xpfe/components/related/Makefile
xpfe/components/related/src/Makefile
xpfe/components/related/public/Makefile
@@ -707,8 +722,11 @@ xpfe/components/startup/src/Makefile
xpfe/components/autocomplete/Makefile
xpfe/components/autocomplete/public/Makefile
xpfe/components/autocomplete/src/Makefile
xpfe/components/updates/Makefile
xpfe/components/updates/src/Makefile
xpfe/components/urlwidget/Makefile
xpfe/components/winhooks/Makefile
xpfe/components/windowds/Makefile
xpfe/components/alerts/Makefile
xpfe/components/alerts/public/Makefile
xpfe/components/alerts/src/Makefile
@@ -781,7 +799,6 @@ embedding/tests/mfcembed/components/Makefile
MAKEFILES_minimo="
embedding/minimo/Makefile
embedding/minimo/app/Makefile
embedding/minimo/chromelite/Makefile
embedding/minimo/popuplite/Makefile
"
@@ -933,9 +950,6 @@ xulrunner/installer/Makefile
"
MAKEFILES_xulapp="
chrome/Makefile
chrome/public/Makefile
chrome/src/Makefile
toolkit/Makefile
toolkit/library/Makefile
toolkit/content/Makefile
@@ -1528,6 +1542,7 @@ MAKEFILES_themes=`cat ${srcdir}/themes/makefiles`
add_makefiles "
$MAKEFILES_caps
$MAKEFILES_chrome
$MAKEFILES_db
$MAKEFILES_dbm
$MAKEFILES_docshell
@@ -1643,8 +1658,9 @@ if test -n "$MOZ_PROFILESHARING"; then
add_makefiles "$MAKEFILES_profilesharingsetup"
fi
if test -z "$MOZ_XUL"; then
if test -n "MINIMO"; then
add_makefiles "$MAKEFILES_minimo"
add_makefiles "$MAKEFILES_xulapp"
fi
if test -n "$MOZ_ENABLE_GTK2"; then
@@ -2023,6 +2039,7 @@ MAKEFILES_zlib="modules/zlib/standalone/Makefile"
build) add_makefiles "$MAKEFILES_build" ;;
calendar) add_makefiles "$MAKEFILES_calendar" ;;
caps) add_makefiles "$MAKEFILES_caps" ;;
chrome) add_makefiles "$MAKEFILES_chrome" ;;
chardet) add_makefiles "$MAKEFILES_chardet" ;;
chatzilla) add_makefiles "$MAKEFILES_chatzilla" ;;
chrome) add_makefiles "$MAKEFILES_chrome" ;;

View File

@@ -81,7 +81,7 @@ REQUIRES = xpcom \
CPPSRCS = nsEditorRegistration.cpp
ifdef MOZ_PLAINTEXT_EDITOR_ONLY
ifeq ($(OS_ARCH),WINNT)
ifeq (,$(filter-out WINNT WINCE,$(OS_ARCH)))
LIBRARY_NAME = texteditor
endif
SHARED_LIBRARY_LIBS = $(NULL)

View File

@@ -1250,7 +1250,7 @@ GetCustomEncoding(const char* aFontName, nsCString& aValue, PRBool* aIsWide)
(!strcmp(aFontName, "Times New Roman" )) ||
(!strcmp(aFontName, "Courier New" )) ||
(!strcmp(aFontName, mspgothic )) )
return NS_ERROR_NOT_AVAILABLE; // error mean do not get a special encoding
return NS_ERROR_NOT_AVAILABLE; // error means do not get a special encoding
// XXX We need this kludge to deal with aFontName in CP949 when the locale
// is Korean until we figure out a way to get facename in US-ASCII
@@ -1610,6 +1610,7 @@ nsFontMetricsWin::GetFontCCMAP(HDC aDC, const char* aShortName,
PRBool aNameQuirks, eFontType& aFontType, PRUint8& aCharset)
{
PRUint16 *ccmap = nsnull;
DWORD len = GetFontData(aDC, CMAP, 0, nsnull, 0);
if ((len == GDI_ERROR) || (!len)) {
return nsnull;
@@ -2499,11 +2500,13 @@ enumProc(const LOGFONT* logFont, const TEXTMETRIC* metrics,
}
// copy Unicode subrange bitfield (128bit) if it's a truetype font.
#ifndef WINCE
if (fontType & hasFontSig) {
#ifndef WINCE
memcpy(font->signature.fsUsb, ((NEWTEXTMETRICEX*)metrics)->ntmFontSig.fsUsb, 16);
}
#else
memset(font->signature.fsUsb, '\0', 16);
#endif
}
return 1;
}
}
@@ -2533,6 +2536,8 @@ enumProc(const LOGFONT* logFont, const TEXTMETRIC* metrics,
#ifndef WINCE
// copy Unicode subrange bitfield (128 bits = 16 bytes)
memcpy(font->signature.fsUsb, ((NEWTEXTMETRICEX*)metrics)->ntmFontSig.fsUsb, 16);
#else
memset(font->signature.fsUsb, '\0', 16);
#endif
}

View File

@@ -1164,13 +1164,14 @@ nsNativeThemeWin::ClassicGetMinimumWidgetSize(nsIRenderingContext* aContext, nsI
case NS_THEME_TAB_PANELS:
// no minimum widget size
break;
#ifndef WINCE
case NS_THEME_RESIZER: {
#ifndef WINCE
NONCLIENTMETRICS nc;
nc.cbSize = sizeof(nc);
if (SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(nc), &nc, 0))
(*aResult).width = (*aResult).height = abs(nc.lfStatusFont.lfHeight) + 4;
else
#endif
(*aResult).width = (*aResult).height = 15;
break;
case NS_THEME_SCROLLBAR_THUMB_VERTICAL:
@@ -1187,7 +1188,6 @@ nsNativeThemeWin::ClassicGetMinimumWidgetSize(nsIRenderingContext* aContext, nsI
(*aResult).width = ::GetSystemMetrics(SM_CXHTHUMB) << 1;
break;
}
#endif
default:
return NS_ERROR_FAILURE;
}
@@ -1381,12 +1381,10 @@ nsresult nsNativeThemeWin::ClassicGetThemePartAndState(nsIFrame* aFrame, PRUint8
return NS_OK;
}
#ifndef WINCE
case NS_THEME_RESIZER:
aPart = DFC_SCROLL;
aState = DFCS_SCROLLSIZEGRIP;
return NS_OK;
#endif
}
return NS_ERROR_FAILURE;
}

View File

@@ -178,6 +178,10 @@ static HPEN gStockWhitePen = (HPEN)::GetStockObject(WHITE_PEN);
nsRenderingContextWin :: nsRenderingContextWin()
{
#ifdef WINCE
gIsWIN95 = PR_FALSE;
gBidiInfo = DONT_INIT;
#else
// The first time in we initialize gIsWIN95 flag
if (NOT_SETUP == gIsWIN95) {
OSVERSIONINFO os;
@@ -195,7 +199,6 @@ nsRenderingContextWin :: nsRenderingContextWin()
// Windows 95 or earlier: assume it's not Bidi
gBidiInfo = DONT_INIT;
}
#ifndef WINCE
else if (os.dwMajorVersion >= 4) {
// Windows 98 or later
UINT cp = ::GetACP();
@@ -206,9 +209,9 @@ nsRenderingContextWin :: nsRenderingContextWin()
gBidiInfo = GCP_REORDER;
}
}
#endif
}
}
#endif
mDC = NULL;
mMainDC = NULL;
@@ -1070,6 +1073,7 @@ NS_IMETHODIMP nsRenderingContextWin :: DrawLine(nscoord aX0, nscoord aY0, nscoor
SetupPen();
#ifndef WINCE
if (nsLineStyle_kDotted == mCurrLineStyle)
{
lineddastruct dda_struct;
@@ -1081,6 +1085,7 @@ NS_IMETHODIMP nsRenderingContextWin :: DrawLine(nscoord aX0, nscoord aY0, nscoor
LineDDA((int)(aX0),(int)(aY0),(int)(aX1),(int)(aY1),(LINEDDAPROC) LineDDAFunc,(long)&dda_struct);
}
else
#endif
{
::MoveToEx(mDC, (int)(aX0), (int)(aY0), NULL);
::LineTo(mDC, (int)(aX1), (int)(aY1));

View File

@@ -141,7 +141,9 @@ ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
EXTRA_DSO_LDOPTS += $(TK_LIBS)
endif
ifndef WINCE
ENABLE_CXX_EXCEPTIONS = 1
endif
include $(topsrcdir)/config/rules.mk

View File

@@ -401,7 +401,7 @@ nsProfileDirServiceProvider::InitProfileDir(nsIFile *profileDir)
return rv;
}
#ifndef XP_MAC
#if !defined(XP_MAC) && !defined(WINCE)
rv = profileDir->SetPermissions(0700);
if (NS_FAILED(rv))
return rv;

View File

@@ -110,7 +110,9 @@ GARBAGE += L_Ienumfe.cpp $(srcdir)/L_Ienumfe.cpp
SRCS_IN_OBJDIR = 1
ifndef WINCE
ENABLE_CXX_EXCEPTIONS = 1
endif
include $(topsrcdir)/config/rules.mk

View File

@@ -92,9 +92,7 @@ DEFINE_GUID(IID_IActiveIMMMessagePumpOwner,
IActiveIMMApp* nsToolkit::gAIMMApp = NULL;
PRInt32 nsToolkit::gAIMMCount = 0;
#ifndef WINCE
MouseTrailer MouseTrailer::mSingleton;
#endif
#if !defined(MOZ_STATIC_COMPONENT_LIBS) && !defined(MOZ_ENABLE_LIBXUL)
//
@@ -106,6 +104,8 @@ MouseTrailer MouseTrailer::mSingleton;
extern "C" {
#endif
// Windows CE is created when nsToolkit
// starts up, not when the dll is loaded.
#ifndef WINCE
BOOL APIENTRY DllMain( HINSTANCE hModule,
DWORD reason,
@@ -130,7 +130,7 @@ BOOL APIENTRY DllMain( HINSTANCE hModule,
return TRUE;
}
#endif //wince
#endif //#ifndef WINCE
#if defined(__GNUC__)
} // extern "C"
@@ -175,11 +175,7 @@ LRESULT CALLBACK DetectWindowMove(int code, WPARAM wParam, LPARAM lParam)
}
return CallNextHookEx(nsMsgFilterHook, code, wParam, lParam);
}
#endif // WINCE
#endif //#ifndef WINCE
#include "nsWindowAPI.h"
@@ -488,7 +484,7 @@ LPITEMIDLIST WINAPI nsSHBrowseForFolder(LPBROWSEINFOW aBiW)
}
return itemIdList;
}
#endif
#endif //#ifndef WINCE
HMODULE nsToolkit::mShell32Module = NULL;
NS_DefWindowProc nsToolkit::mDefWindowProc = DefWindowProcA;
@@ -561,7 +557,7 @@ nsToolkit::nsToolkit()
::CoCreateInstance(CLSID_CActiveIMM, NULL, CLSCTX_INPROC_SERVER, IID_IActiveIMMApp, (void**) &nsToolkit::gAIMMApp);
nsToolkit::gAIMMCount++;
#endif
#endif //#ifndef WINCE
#if defined(MOZ_STATIC_COMPONENT_LIBS) || defined (WINCE)
nsToolkit::Startup(GetModuleHandle(NULL));
@@ -642,7 +638,8 @@ nsToolkit::Startup(HMODULE hModule)
nsToolkit::mIsNT = (osversion.dwPlatformId == VER_PLATFORM_WIN32_NT);
if (nsToolkit::mIsNT)
#endif
#endif // #ifndef WINCE
{
// For Windows 9x base OS nsFoo is already pointing to A functions
// However on NT base OS we should point them to respective W functions
@@ -682,7 +679,7 @@ nsToolkit::Startup(HMODULE hModule)
nsToolkit::mW2KXP_CP936 = PR_TRUE;
}
}
#endif
#endif // #ifndef WINCE
}
nsToolkit::mDllInstance = hModule;
@@ -925,7 +922,6 @@ NS_METHOD NS_GetCurrentToolkit(nsIToolkit* *aResult)
return rv;
}
#ifndef WINCE
//-------------------------------------------------------------------------
//
//
@@ -1051,5 +1047,3 @@ void MouseTrailer::TimerProc(nsITimer* aTimer, void* aClosure)
}
}
#endif

View File

@@ -155,7 +155,6 @@ class nsWindow;
* mouse pointer to see if it is within the outer most window.
*/
#ifndef WINCE
class MouseTrailer
{
public:
@@ -190,6 +189,5 @@ private:
nsCOMPtr<nsITimer> mTimer;
};
#endif // WINCE
#endif // TOOLKIT_H

View File

@@ -269,7 +269,7 @@ OleRegisterMgr::~OleRegisterMgr()
#endif
::OleUninitialize();
}
#endif
#endif //WINCE
////////////////////////////////////////////////////
// nsWindow Class static variable definitions
@@ -704,10 +704,9 @@ public:
if (info) {
// make sure it's unflashed and kill the timer
#ifndef WINCE
if (info->hasFlashed)
::FlashWindow(info->flashWindow, FALSE);
#endif
::KillTimer(info->timerWindow, info->timerID);
RemoveTimer(info);
delete info;
@@ -947,11 +946,9 @@ nsWindow::~nsWindow()
gCurrentWindow = nsnull;
}
#ifndef WINCE
if (MouseTrailer::GetSingleton().GetMouseTrailerWindow() == this) {
MouseTrailer::GetSingleton().DestroyTimer();
}
#endif
// If the widget was released without calling Destroy() then the native
// window still exists, and we need to destroy it
@@ -991,14 +988,10 @@ nsWindow::~nsWindow()
NS_METHOD nsWindow::CaptureMouse(PRBool aCapture)
{
if (aCapture) {
#ifndef WINCE
MouseTrailer::GetSingleton().SetCaptureWindow(this);
#endif
::SetCapture(mWnd);
} else {
#ifndef WINCE
MouseTrailer::GetSingleton().SetCaptureWindow(NULL);
#endif
::ReleaseCapture();
}
mIsInMouseCapture = aCapture;
@@ -1314,122 +1307,6 @@ BOOL nsWindow::SetNSWindowPtr(HWND aWnd, nsWindow * ptr) {
}
}
//
// DealWithPopups
//
// Handle events that may cause a popup (combobox, XPMenu, etc) to need to rollup.
//
BOOL
nsWindow :: DealWithPopups ( HWND inWnd, UINT inMsg, WPARAM inWParam, LPARAM inLParam, LRESULT* outResult )
{
if ( gRollupListener && gRollupWidget) {
if (inMsg == WM_ACTIVATE || inMsg == WM_LBUTTONDOWN ||
inMsg == WM_RBUTTONDOWN || inMsg == WM_MBUTTONDOWN ||
inMsg == WM_MOUSEWHEEL || inMsg == uMSH_MOUSEWHEEL
#ifndef WINCE
||
inMsg == WM_NCRBUTTONDOWN ||
inMsg == WM_MOVING ||
inMsg == WM_SIZING ||
inMsg == WM_GETMINMAXINFO ||
inMsg == WM_NCLBUTTONDOWN ||
inMsg == WM_NCMBUTTONDOWN ||
inMsg == WM_MOUSEACTIVATE ||
inMsg == WM_ACTIVATEAPP ||
inMsg == WM_MENUSELECT ||
(inMsg == WM_GETMINMAXINFO && !::GetParent(inWnd))
#endif
)
{
// Rollup if the event is outside the popup.
PRBool rollup = !nsWindow::EventIsInsideWindow(inMsg, (nsWindow*)gRollupWidget);
if (rollup && (inMsg == WM_MOUSEWHEEL || inMsg == uMSH_MOUSEWHEEL))
{
gRollupListener->ShouldRollupOnMouseWheelEvent(&rollup);
*outResult = PR_TRUE;
}
// If we're dealing with menus, we probably have submenus and we don't
// want to rollup if the click is in a parent menu of the current submenu.
if (rollup) {
nsCOMPtr<nsIMenuRollup> menuRollup ( do_QueryInterface(gRollupListener) );
if ( menuRollup ) {
nsCOMPtr<nsISupportsArray> widgetChain;
menuRollup->GetSubmenuWidgetChain ( getter_AddRefs(widgetChain) );
if ( widgetChain ) {
PRUint32 count = 0;
widgetChain->Count(&count);
for ( PRUint32 i = 0; i < count; ++i ) {
nsCOMPtr<nsISupports> genericWidget;
widgetChain->GetElementAt ( i, getter_AddRefs(genericWidget) );
nsCOMPtr<nsIWidget> widget ( do_QueryInterface(genericWidget) );
if ( widget ) {
nsIWidget* temp = widget.get();
if ( nsWindow::EventIsInsideWindow(inMsg, (nsWindow*)temp) ) {
rollup = PR_FALSE;
break;
}
}
} // foreach parent menu widget
}
} // if rollup listener knows about menus
}
#ifndef WINCE
if (inMsg == WM_MOUSEACTIVATE) {
// Prevent the click inside the popup from causing a change in window
// activation. Since the popup is shown non-activated, we need to eat
// any requests to activate the window while it is displayed. Windows
// will automatically activate the popup on the mousedown otherwise.
if (!rollup) {
*outResult = MA_NOACTIVATE;
return TRUE;
}
else
{
UINT uMsg = HIWORD(inLParam);
if (uMsg == WM_MOUSEMOVE)
{
// WM_MOUSEACTIVATE cause by moving the mouse - X-mouse (eg. TweakUI)
// must be enabled in Windows.
gRollupListener->ShouldRollupOnMouseActivate(&rollup);
if (!rollup)
{
*outResult = MA_NOACTIVATE;
return true;
}
}
}
}
// if we've still determined that we should still rollup everything, do it.
else
#endif
if ( rollup ) {
gRollupListener->Rollup();
// Tell hook to stop processing messages
gProcessHook = PR_FALSE;
gRollupMsgId = 0;
gRollupMsgWnd = NULL;
// return TRUE tells Windows that the event is consumed,
// false allows the event to be dispatched
//
// So if we are NOT supposed to be consuming events, let it go through
if (gRollupConsumeRollupEvent && inMsg != WM_RBUTTONDOWN) {
*outResult = TRUE;
return TRUE;
}
}
} // if event that might trigger a popup to rollup
} // if rollup listeners registered
return FALSE;
} // DealWithPopups
//-------------------------------------------------------------------------
//
// the nsWindow procedure for all nsWindows in this toolkit
@@ -1437,9 +1314,11 @@ nsWindow :: DealWithPopups ( HWND inWnd, UINT inMsg, WPARAM inWParam, LPARAM inL
//-------------------------------------------------------------------------
LRESULT CALLBACK nsWindow::WindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
#ifndef WINCE
LRESULT popupHandlingResult;
if ( DealWithPopups(hWnd, msg, wParam, lParam, &popupHandlingResult) )
return popupHandlingResult;
#endif
// Get the window which caused the event and ask it to process the message
nsWindow *someWindow = GetNSWindowPtr(hWnd);
@@ -5389,11 +5268,15 @@ LPCSTR nsWindow::WindowPopupClass()
//-------------------------------------------------------------------------
DWORD nsWindow::WindowStyle()
{
#ifdef WINCE
return WS_CHILD;
#else
DWORD style;
#ifdef WINCE
if (mWindowType == eWindowType_popup)
style = WS_POPUP;
else
style = WS_CHILD;
#else
switch (mWindowType) {
case eWindowType_child:
@@ -5457,9 +5340,8 @@ DWORD nsWindow::WindowStyle()
if (mBorderStyle == eBorderStyle_none || !(mBorderStyle & eBorderStyle_maximize))
style &= ~WS_MAXIMIZEBOX;
}
return style;
#endif
return style;
}
@@ -5927,9 +5809,7 @@ PRBool nsWindow::DispatchMouseEvent(PRUint32 aEventType, WPARAM wParam, nsPoint*
// So we use "WindowFromPoint" to find what window we are over and
// set that window into the mouse trailer timer.
if (!mIsInMouseCapture) {
#ifndef WINCE
MouseTrailer::GetSingleton().SetMouseTrailerWindow(this);
#endif
} else {
POINT mp;
DWORD pos = ::GetMessagePos();
@@ -5958,9 +5838,7 @@ PRBool nsWindow::DispatchMouseEvent(PRUint32 aEventType, WPARAM wParam, nsPoint*
}
// only set the window into the mouse trailer if we have a good window
if (nsnull != someWindow) {
#ifndef WINCE
MouseTrailer::GetSingleton().SetMouseTrailerWindow(someWindow);
#endif
}
}
@@ -5972,9 +5850,7 @@ PRBool nsWindow::DispatchMouseEvent(PRUint32 aEventType, WPARAM wParam, nsPoint*
if (rect.Contains(event.point.x, event.point.y)) {
if (gCurrentWindow == NULL || gCurrentWindow != this) {
if ((nsnull != gCurrentWindow) && (!gCurrentWindow->mIsDestroying)) {
#ifndef WINCE
MouseTrailer::GetSingleton().IgnoreNextCycle();
#endif
gCurrentWindow->DispatchMouseEvent(NS_MOUSE_EXIT, wParam, gCurrentWindow->GetLastPoint());
}
gCurrentWindow = this;
@@ -7478,9 +7354,7 @@ static VOID CALLBACK nsGetAttentionTimerFunc(HWND hwnd, UINT uMsg, UINT idEvent,
if (maxFlashCount > 0) {
// We have a max flash count, if we haven't met it yet, flash again.
if (flashCount < maxFlashCount) {
#ifndef WINCE
::FlashWindow(flashwnd, TRUE);
#endif
gAttentionTimerMonitor->IncrementFlashCount(hwnd);
}
else
@@ -7488,9 +7362,7 @@ static VOID CALLBACK nsGetAttentionTimerFunc(HWND hwnd, UINT uMsg, UINT idEvent,
}
else {
// The caller didn't specify a flash count.
#ifndef WINCE
::FlashWindow(flashwnd, TRUE);
#endif
}
gAttentionTimerMonitor->SetFlashed(hwnd);
@@ -7790,6 +7662,119 @@ VOID CALLBACK nsWindow::HookTimerForPopups(HWND hwnd, UINT uMsg, UINT idEvent, D
gRollupMsgWnd = NULL;
}
}
//
// DealWithPopups
//
// Handle events that may cause a popup (combobox, XPMenu, etc) to need to rollup.
//
BOOL
nsWindow :: DealWithPopups ( HWND inWnd, UINT inMsg, WPARAM inWParam, LPARAM inLParam, LRESULT* outResult )
{
if ( gRollupListener && gRollupWidget) {
if (inMsg == WM_ACTIVATE || inMsg == WM_LBUTTONDOWN ||
inMsg == WM_RBUTTONDOWN || inMsg == WM_MBUTTONDOWN ||
inMsg == WM_MOUSEWHEEL || inMsg == uMSH_MOUSEWHEEL
||
inMsg == WM_NCRBUTTONDOWN ||
inMsg == WM_MOVING ||
inMsg == WM_SIZING ||
inMsg == WM_GETMINMAXINFO ||
inMsg == WM_NCLBUTTONDOWN ||
inMsg == WM_NCMBUTTONDOWN ||
inMsg == WM_MOUSEACTIVATE ||
inMsg == WM_ACTIVATEAPP ||
inMsg == WM_MENUSELECT ||
(inMsg == WM_GETMINMAXINFO && !::GetParent(inWnd))
)
{
// Rollup if the event is outside the popup.
PRBool rollup = !nsWindow::EventIsInsideWindow(inMsg, (nsWindow*)gRollupWidget);
if (rollup && (inMsg == WM_MOUSEWHEEL || inMsg == uMSH_MOUSEWHEEL))
{
gRollupListener->ShouldRollupOnMouseWheelEvent(&rollup);
*outResult = PR_TRUE;
}
// If we're dealing with menus, we probably have submenus and we don't
// want to rollup if the click is in a parent menu of the current submenu.
if (rollup) {
nsCOMPtr<nsIMenuRollup> menuRollup ( do_QueryInterface(gRollupListener) );
if ( menuRollup ) {
nsCOMPtr<nsISupportsArray> widgetChain;
menuRollup->GetSubmenuWidgetChain ( getter_AddRefs(widgetChain) );
if ( widgetChain ) {
PRUint32 count = 0;
widgetChain->Count(&count);
for ( PRUint32 i = 0; i < count; ++i ) {
nsCOMPtr<nsISupports> genericWidget;
widgetChain->GetElementAt ( i, getter_AddRefs(genericWidget) );
nsCOMPtr<nsIWidget> widget ( do_QueryInterface(genericWidget) );
if ( widget ) {
nsIWidget* temp = widget.get();
if ( nsWindow::EventIsInsideWindow(inMsg, (nsWindow*)temp) ) {
rollup = PR_FALSE;
break;
}
}
} // foreach parent menu widget
}
} // if rollup listener knows about menus
}
if (inMsg == WM_MOUSEACTIVATE) {
// Prevent the click inside the popup from causing a change in window
// activation. Since the popup is shown non-activated, we need to eat
// any requests to activate the window while it is displayed. Windows
// will automatically activate the popup on the mousedown otherwise.
if (!rollup) {
*outResult = MA_NOACTIVATE;
return TRUE;
}
else
{
UINT uMsg = HIWORD(inLParam);
if (uMsg == WM_MOUSEMOVE)
{
// WM_MOUSEACTIVATE cause by moving the mouse - X-mouse (eg. TweakUI)
// must be enabled in Windows.
gRollupListener->ShouldRollupOnMouseActivate(&rollup);
if (!rollup)
{
*outResult = MA_NOACTIVATE;
return true;
}
}
}
}
// if we've still determined that we should still rollup everything, do it.
else
if ( rollup ) {
gRollupListener->Rollup();
// Tell hook to stop processing messages
gProcessHook = PR_FALSE;
gRollupMsgId = 0;
gRollupMsgWnd = NULL;
// return TRUE tells Windows that the event is consumed,
// false allows the event to be dispatched
//
// So if we are NOT supposed to be consuming events, let it go through
if (gRollupConsumeRollupEvent && inMsg != WM_RBUTTONDOWN) {
*outResult = TRUE;
return TRUE;
}
}
} // if event that might trigger a popup to rollup
} // if rollup listeners registered
return FALSE;
} // DealWithPopups
#endif // WinCE

View File

@@ -443,9 +443,8 @@ protected:
static void RegisterSpecialDropdownHooks();
static void UnregisterSpecialDropdownHooks();
#endif
static BOOL DealWithPopups (HWND inWnd, UINT inMsg, WPARAM inWParam, LPARAM inLParam, LRESULT* outResult);
#endif
static PRBool EventIsInsideWindow(UINT Msg, nsWindow* aWindow);

View File

@@ -70,7 +70,7 @@ endif
# If we have an import library, then copy that to the SDK. Otherwise,
# copy the shared library.
ifneq (,$(filter OS2 WINNT,$(OS_ARCH)))
ifneq (,$(filter OS2 WINCE WINNT,$(OS_ARCH)))
SDK_LIBRARY = $(IMPORT_LIBRARY)
else
SDK_LIBRARY = $(SHARED_LIBRARY)

View File

@@ -43,7 +43,7 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
ifndef MOZ_XUL_APP
ifneq (,$(filter OS2 WINNT,$(OS_ARCH)))
ifneq (,$(filter OS2 WINNT WINCE,$(OS_ARCH)))
DIRS = win
else
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))