diff --git a/browser/base/content/syncNotification.xml b/browser/base/content/syncNotification.xml index 6056295c6d32..c7d37e579cda 100644 --- a/browser/base/content/syncNotification.xml +++ b/browser/base/content/syncNotification.xml @@ -56,19 +56,20 @@ @@ -140,7 +141,7 @@ onset="this._notification = val; return val;"/> toolbar:not(:-moz-lwtheme), - #addon-bar:not(:-moz-lwtheme) { + #browser-bottombox:not(:-moz-lwtheme) { background-color: @customToolbarColor@; } @@ -168,6 +168,7 @@ #main-window[sizemode=normal] #browser-bottombox { border: 1px solid @toolbarShadowColor@; border-top-style: none; + background-clip: padding-box; } #main-window[sizemode=normal][tabsontop=false] #PersonalToolbar:not(:-moz-lwtheme) { @@ -235,23 +236,6 @@ background-color: -moz-dialog; } - #browser-bottombox:not(:-moz-lwtheme) { - background-color: -moz-dialog; - background-clip: padding-box; - } - - #main-window[sizemode=normal] #browser-bottombox:not(:-moz-lwtheme), - #main-window[sizemode=normal] #addon-bar:not(:-moz-lwtheme) { - border-bottom-left-radius: 4px; - border-bottom-right-radius: 4px; - } - - #addon-bar:not(:-moz-lwtheme) { - -moz-appearance: none; - border-bottom-style: none; - background-image: -moz-linear-gradient(@toolbarHighlight@, rgba(255,255,255,0)); - } - #main-menubar:not(:-moz-lwtheme):not(:-moz-window-inactive) { background-color: rgba(255,255,255,.5); border-radius: 4px; diff --git a/browser/themes/winstripe/browser/browser.css b/browser/themes/winstripe/browser/browser.css index 946ecaa9c482..b5ca144b4525 100644 --- a/browser/themes/winstripe/browser/browser.css +++ b/browser/themes/winstripe/browser/browser.css @@ -141,6 +141,10 @@ -moz-appearance: toolbox; } +#browser-bottombox:not(:-moz-lwtheme) { + background-color: -moz-dialog; +} + /* ::::: app menu button ::::: */ #appmenu-button { @@ -2467,12 +2471,14 @@ panel[dimmed="true"] { /* Add-on bar */ #addon-bar { + -moz-appearance: none; min-height: 20px; - border-top: 1px solid ThreeDShadow !important; -} - -#addon-bar:not(:-moz-lwtheme) { - -moz-appearance: statusbar; + border-top-style: none; + border-bottom-style: none; + padding-top: 1px; + background-image: -moz-linear-gradient(rgba(0,0,0,.15) 1px, rgba(255,255,255,.15) 1px); + background-size: 100% 2px; + background-repeat: no-repeat; } #status-bar { diff --git a/gfx/thebes/gfxASurface.cpp b/gfx/thebes/gfxASurface.cpp index 1338e8a18af7..9aebc6891b53 100644 --- a/gfx/thebes/gfxASurface.cpp +++ b/gfx/thebes/gfxASurface.cpp @@ -225,19 +225,12 @@ gfxASurface::Wrap (cairo_surface_t *csurf) void gfxASurface::Init(cairo_surface_t* surface, bool existingSurface) { - if (cairo_surface_status(surface)) { - // the surface has an error on it - mSurfaceValid = PR_FALSE; - cairo_surface_destroy(surface); - return; - } - SetSurfaceWrapper(surface, this); mSurface = surface; - mSurfaceValid = PR_TRUE; + mSurfaceValid = surface && !cairo_surface_status(surface); - if (existingSurface) { + if (existingSurface || !mSurfaceValid) { mFloatingRefs = 0; } else { mFloatingRefs = 1; diff --git a/gfx/thebes/gfxImageSurface.cpp b/gfx/thebes/gfxImageSurface.cpp index 6d8730e71edb..ea48aef1ae20 100644 --- a/gfx/thebes/gfxImageSurface.cpp +++ b/gfx/thebes/gfxImageSurface.cpp @@ -69,6 +69,14 @@ gfxImageSurface::gfxImageSurface(unsigned char *aData, const gfxIntSize& aSize, InitWithData(aData, aSize, aStride, aFormat); } +void +gfxImageSurface::MakeInvalid() +{ + mSize = gfxIntSize(-1, -1); + mData = NULL; + mStride = 0; +} + void gfxImageSurface::InitWithData(unsigned char *aData, const gfxIntSize& aSize, long aStride, gfxImageFormat aFormat) @@ -80,7 +88,7 @@ gfxImageSurface::InitWithData(unsigned char *aData, const gfxIntSize& aSize, mStride = aStride; if (!CheckSurfaceSize(aSize)) - return; + MakeInvalid(); cairo_surface_t *surface = cairo_image_surface_create_for_data((unsigned char*)mData, @@ -121,7 +129,7 @@ gfxImageSurface::gfxImageSurface(const gfxIntSize& size, gfxImageFormat format) mStride = ComputeStride(); if (!CheckSurfaceSize(size)) - return; + MakeInvalid(); // if we have a zero-sized surface, just leave mData nsnull if (mSize.height * mStride > 0) { diff --git a/gfx/thebes/gfxImageSurface.h b/gfx/thebes/gfxImageSurface.h index a64b5ce78583..666bf199039d 100644 --- a/gfx/thebes/gfxImageSurface.h +++ b/gfx/thebes/gfxImageSurface.h @@ -122,6 +122,8 @@ protected: static long ComputeStride(const gfxIntSize&, gfxImageFormat); + void MakeInvalid(); + gfxIntSize mSize; bool mOwnsData; unsigned char *mData; diff --git a/gfx/thebes/gfxQuartzImageSurface.cpp b/gfx/thebes/gfxQuartzImageSurface.cpp index f6d7fe87f6a2..f89dea59244a 100644 --- a/gfx/thebes/gfxQuartzImageSurface.cpp +++ b/gfx/thebes/gfxQuartzImageSurface.cpp @@ -42,7 +42,7 @@ gfxQuartzImageSurface::gfxQuartzImageSurface(gfxImageSurface *imageSurface) { - if (imageSurface->CairoStatus() || imageSurface->CairoSurface() == NULL) + if (imageSurface->CairoSurface() == NULL) return; cairo_surface_t *surf = cairo_quartz_image_surface_create (imageSurface->CairoSurface()); diff --git a/gfx/thebes/gfxQuartzSurface.cpp b/gfx/thebes/gfxQuartzSurface.cpp index 7e04b3d3344b..5006742f3479 100644 --- a/gfx/thebes/gfxQuartzSurface.cpp +++ b/gfx/thebes/gfxQuartzSurface.cpp @@ -40,15 +40,23 @@ #include "cairo-quartz.h" -gfxQuartzSurface::gfxQuartzSurface(const gfxSize& size, gfxImageFormat format, - bool aForPrinting) - : mCGContext(NULL), mSize(size), mForPrinting(aForPrinting) +void +gfxQuartzSurface::MakeInvalid() { - unsigned int width = (unsigned int) floor(size.width); - unsigned int height = (unsigned int) floor(size.height); + mSize = gfxIntSize(-1, -1); +} - if (!CheckSurfaceSize(gfxIntSize(width, height))) - return; +gfxQuartzSurface::gfxQuartzSurface(const gfxSize& desiredSize, gfxImageFormat format, + bool aForPrinting) + : mCGContext(NULL), mSize(desiredSize), mForPrinting(aForPrinting) +{ + gfxIntSize size((unsigned int) floor(desiredSize.width), + (unsigned int) floor(desiredSize.height)); + if (!CheckSurfaceSize(size)) + MakeInvalid(); + + unsigned int width = static_cast(mSize.width); + unsigned int height = static_cast(mSize.height); cairo_surface_t *surf = cairo_quartz_surface_create ((cairo_format_t) format, width, height); @@ -61,12 +69,17 @@ gfxQuartzSurface::gfxQuartzSurface(const gfxSize& size, gfxImageFormat format, } gfxQuartzSurface::gfxQuartzSurface(CGContextRef context, - const gfxSize& size, + const gfxSize& desiredSize, bool aForPrinting) - : mCGContext(context), mSize(size), mForPrinting(aForPrinting) + : mCGContext(context), mSize(desiredSize), mForPrinting(aForPrinting) { - unsigned int width = (unsigned int) floor(size.width); - unsigned int height = (unsigned int) floor(size.height); + gfxIntSize size((unsigned int) floor(desiredSize.width), + (unsigned int) floor(desiredSize.height)); + if (!CheckSurfaceSize(size)) + MakeInvalid(); + + unsigned int width = static_cast(mSize.width); + unsigned int height = static_cast(mSize.height); cairo_surface_t *surf = cairo_quartz_surface_create_for_cg_context(context, @@ -88,17 +101,19 @@ gfxQuartzSurface::gfxQuartzSurface(cairo_surface_t *csurf, } gfxQuartzSurface::gfxQuartzSurface(unsigned char *data, - const gfxSize& size, + const gfxSize& desiredSize, long stride, gfxImageFormat format, bool aForPrinting) - : mCGContext(nsnull), mSize(size), mForPrinting(aForPrinting) + : mCGContext(nsnull), mSize(desiredSize), mForPrinting(aForPrinting) { - unsigned int width = (unsigned int) floor(size.width); - unsigned int height = (unsigned int) floor(size.height); + gfxIntSize size((unsigned int) floor(desiredSize.width), + (unsigned int) floor(desiredSize.height)); + if (!CheckSurfaceSize(size)) + MakeInvalid(); - if (!CheckSurfaceSize(gfxIntSize(width, height))) - return; + unsigned int width = static_cast(mSize.width); + unsigned int height = static_cast(mSize.height); cairo_surface_t *surf = cairo_quartz_surface_create_for_data (data, (cairo_format_t) format, width, height, stride); diff --git a/gfx/thebes/gfxQuartzSurface.h b/gfx/thebes/gfxQuartzSurface.h index f3d6ddf44d88..1165cc75d740 100644 --- a/gfx/thebes/gfxQuartzSurface.h +++ b/gfx/thebes/gfxQuartzSurface.h @@ -75,6 +75,8 @@ public: } protected: + void MakeInvalid(); + CGContextRef mCGContext; gfxSize mSize; bool mForPrinting; diff --git a/gfx/thebes/gfxWindowsSurface.cpp b/gfx/thebes/gfxWindowsSurface.cpp index 92aa907ef344..3a2a004f5ce1 100644 --- a/gfx/thebes/gfxWindowsSurface.cpp +++ b/gfx/thebes/gfxWindowsSurface.cpp @@ -66,11 +66,18 @@ gfxWindowsSurface::gfxWindowsSurface(HDC dc, PRUint32 flags) : InitWithDC(flags); } -gfxWindowsSurface::gfxWindowsSurface(const gfxIntSize& size, gfxImageFormat imageFormat) : +void +gfxWindowsSurface::MakeInvalid(gfxIntSize& size) +{ + size = gfxIntSize(-1, -1); +} + +gfxWindowsSurface::gfxWindowsSurface(const gfxIntSize& realSize, gfxImageFormat imageFormat) : mOwnsDC(PR_FALSE), mForPrinting(PR_FALSE), mWnd(nsnull) { + gfxIntSize size(realSize); if (!CheckSurfaceSize(size)) - return; + MakeInvalid(size); cairo_surface_t *surf = cairo_win32_surface_create_with_dib((cairo_format_t)imageFormat, size.width, size.height); @@ -85,11 +92,12 @@ gfxWindowsSurface::gfxWindowsSurface(const gfxIntSize& size, gfxImageFormat imag mDC = nsnull; } -gfxWindowsSurface::gfxWindowsSurface(HDC dc, const gfxIntSize& size, gfxImageFormat imageFormat) : +gfxWindowsSurface::gfxWindowsSurface(HDC dc, const gfxIntSize& realSize, gfxImageFormat imageFormat) : mOwnsDC(PR_FALSE), mForPrinting(PR_FALSE), mWnd(nsnull) { + gfxIntSize size(realSize); if (!CheckSurfaceSize(size)) - return; + MakeInvalid(size); cairo_surface_t *surf = cairo_win32_surface_create_with_ddb(dc, (cairo_format_t)imageFormat, size.width, size.height); diff --git a/gfx/thebes/gfxWindowsSurface.h b/gfx/thebes/gfxWindowsSurface.h index e286dc8aa550..f52c9263bbc5 100644 --- a/gfx/thebes/gfxWindowsSurface.h +++ b/gfx/thebes/gfxWindowsSurface.h @@ -103,6 +103,8 @@ public: virtual gfxASurface::MemoryLocation GetMemoryLocation() const; private: + void MakeInvalid(gfxIntSize& size); + bool mOwnsDC; bool mForPrinting; diff --git a/js/src/tests/ecma/Date/jstests.list b/js/src/tests/ecma/Date/jstests.list index bf0a03284cc2..041d4f2b0dd3 100644 --- a/js/src/tests/ecma/Date/jstests.list +++ b/js/src/tests/ecma/Date/jstests.list @@ -147,7 +147,7 @@ script 15.9.5.5.js script 15.9.5.6.js script 15.9.5.7.js fails-if(Android) script 15.9.5.8.js -script 15.9.5.9.js +skip-if(Android) script 15.9.5.9.js # bug 686143, skip temporarily to see what happens to the frequency and location of Android timeouts script 15.9.5.js slow script dst-offset-caching-1-of-8.js slow script dst-offset-caching-2-of-8.js diff --git a/layout/base/nsDisplayList.cpp b/layout/base/nsDisplayList.cpp index ccff799acace..55ec4803360b 100644 --- a/layout/base/nsDisplayList.cpp +++ b/layout/base/nsDisplayList.cpp @@ -2451,13 +2451,6 @@ nsDisplayTransform::GetResultingTransformMatrix(const nsIFrame* aFrame, *aOutAncestor = nsLayoutUtils::GetCrossDocParentFrame(aFrame); } - /* Preserve-3d can cause frames without a transform to get an nsDisplayTransform created, we should - * use our parent's transform here. - */ - if (!aFrame->GetStyleDisplay()->HasTransform()) { - return GetResultingTransformMatrix(aFrame->GetParent(), aOrigin - aFrame->GetPosition(), aFactor, nsnull, aOutAncestor); - } - /* Account for the -moz-transform-origin property by translating the * coordinate space to the new origin. */ diff --git a/layout/base/nsDisplayList.h b/layout/base/nsDisplayList.h index b29091b6c312..91a29b667f7d 100644 --- a/layout/base/nsDisplayList.h +++ b/layout/base/nsDisplayList.h @@ -2079,16 +2079,16 @@ public: * ferries the underlying frame to the nsDisplayItem constructor. */ nsDisplayTransform(nsDisplayListBuilder* aBuilder, nsIFrame *aFrame, - nsDisplayList *aList) : - nsDisplayItem(aBuilder, aFrame), mStoredList(aBuilder, aFrame, aList) + nsDisplayList *aList, PRUint32 aIndex = 0) : + nsDisplayItem(aBuilder, aFrame), mStoredList(aBuilder, aFrame, aList), mIndex(aIndex) { MOZ_COUNT_CTOR(nsDisplayTransform); NS_ABORT_IF_FALSE(aFrame, "Must have a frame!"); } nsDisplayTransform(nsDisplayListBuilder* aBuilder, nsIFrame *aFrame, - nsDisplayItem *aItem) : - nsDisplayItem(aBuilder, aFrame), mStoredList(aBuilder, aFrame, aItem) + nsDisplayItem *aItem, PRUint32 aIndex = 0) : + nsDisplayItem(aBuilder, aFrame), mStoredList(aBuilder, aFrame, aItem), mIndex(aIndex) { MOZ_COUNT_CTOR(nsDisplayTransform); NS_ABORT_IF_FALSE(aFrame, "Must have a frame!"); @@ -2127,6 +2127,12 @@ public: nsRegion *aVisibleRegion, const nsRect& aAllowVisibleRegionExpansion); virtual bool TryMerge(nsDisplayListBuilder *aBuilder, nsDisplayItem *aItem); + + virtual PRUint32 GetPerFrameKey() { return (mIndex << nsDisplayItem::TYPE_BITS) | nsDisplayItem::GetPerFrameKey(); } + + enum { + INDEX_MAX = PR_UINT32_MAX >> nsDisplayItem::TYPE_BITS + }; const gfx3DMatrix& GetTransform(float aFactor); @@ -2205,6 +2211,7 @@ private: nsDisplayWrapList mStoredList; gfx3DMatrix mTransform; float mCachedFactor; + PRUint32 mIndex; }; /** diff --git a/layout/base/nsPresContext.h b/layout/base/nsPresContext.h index dc23f7aeaeb8..c7b6bf3cce26 100644 --- a/layout/base/nsPresContext.h +++ b/layout/base/nsPresContext.h @@ -675,14 +675,12 @@ public: bool GetBackgroundImageDraw() const { return mDrawImageBackground; } void SetBackgroundImageDraw(bool aCanDraw) { - NS_ASSERTION(!(aCanDraw & ~1), "Value must be true or false"); mDrawImageBackground = aCanDraw; } bool GetBackgroundColorDraw() const { return mDrawColorBackground; } void SetBackgroundColorDraw(bool aCanDraw) { - NS_ASSERTION(!(aCanDraw & ~1), "Value must be true or false"); mDrawColorBackground = aCanDraw; } @@ -725,7 +723,6 @@ public: */ void SetVisualMode(bool aIsVisual) { - NS_ASSERTION(!(aIsVisual & ~1), "Value must be true or false"); mIsVisual = aIsVisual; } @@ -757,7 +754,6 @@ public: */ void SetIsRenderingOnlySelection(bool aResult) { - NS_ASSERTION(!(aResult & ~1), "Value must be true or false"); mIsRenderingOnlySelection = aResult; } diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index 29717ff27a6e..c4203a5e7a19 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -1518,47 +1518,78 @@ DisplayDebugBorders(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame, #endif static nsresult -WrapPreserve3DList(nsIFrame *aFrame, nsDisplayListBuilder *aBuilder, nsDisplayList *aList) +WrapPreserve3DListInternal(nsIFrame* aFrame, nsDisplayListBuilder *aBuilder, nsDisplayList *aList, PRUint32& aIndex) { + if (aIndex > nsDisplayTransform::INDEX_MAX) { + return NS_OK; + } + nsresult rv = NS_OK; nsDisplayList newList; + nsDisplayList temp; while (nsDisplayItem *item = aList->RemoveBottom()) { nsIFrame *childFrame = item->GetUnderlyingFrame(); NS_ASSERTION(childFrame, "All display items to be wrapped must have a frame!"); + + // We accumulate sequential items that aren't transforms into the 'temp' list + // and then flush this list into newList by wrapping the whole lot with a single + // nsDisplayTransform. + if (childFrame->GetParent()->Preserves3DChildren()) { switch (item->GetType()) { case nsDisplayItem::TYPE_TRANSFORM: { + if (!temp.IsEmpty()) { + newList.AppendToTop(new (aBuilder) nsDisplayTransform(aBuilder, aFrame, &temp, aIndex++)); + } + newList.AppendToTop(item); break; } case nsDisplayItem::TYPE_WRAP_LIST: { + if (!temp.IsEmpty()) { + newList.AppendToTop(new (aBuilder) nsDisplayTransform(aBuilder, aFrame, &temp, aIndex++)); + } nsDisplayWrapList *list = static_cast(item); - rv = WrapPreserve3DList(aFrame, aBuilder, list->GetList()); + rv = WrapPreserve3DListInternal(aFrame, aBuilder, list->GetList(), aIndex); + newList.AppendToTop(item); break; } case nsDisplayItem::TYPE_OPACITY: { + if (!temp.IsEmpty()) { + newList.AppendToTop(new (aBuilder) nsDisplayTransform(aBuilder, aFrame, &temp, aIndex++)); + } nsDisplayOpacity *opacity = static_cast(item); - rv = WrapPreserve3DList(aFrame, aBuilder, opacity->GetList()); + rv = WrapPreserve3DListInternal(aFrame, aBuilder, opacity->GetList(), aIndex); + newList.AppendToTop(item); break; } default: { - item = new (aBuilder) nsDisplayTransform(aBuilder, childFrame, item); + temp.AppendToTop(item); break; } } } else { - item = new (aBuilder) nsDisplayTransform(aBuilder, childFrame, item); + temp.AppendToTop(item); } - if (NS_FAILED(rv) || !item) + if (NS_FAILED(rv) || !item || aIndex > nsDisplayTransform::INDEX_MAX) return rv; - - newList.AppendToTop(item); + } + + if (!temp.IsEmpty()) { + newList.AppendToTop(new (aBuilder) nsDisplayTransform(aBuilder, aFrame, &temp, aIndex++)); } aList->AppendToTop(&newList); return NS_OK; } +static nsresult +WrapPreserve3DList(nsIFrame* aFrame, nsDisplayListBuilder* aBuilder, nsDisplayList *aList) +{ + PRUint32 index = 0; + return WrapPreserve3DListInternal(aFrame, aBuilder, aList, index); +} + nsresult nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder, const nsRect& aDirtyRect, diff --git a/layout/generic/nsObjectFrame.cpp b/layout/generic/nsObjectFrame.cpp index b0dfdd873ec5..a60270bcc6d3 100644 --- a/layout/generic/nsObjectFrame.cpp +++ b/layout/generic/nsObjectFrame.cpp @@ -275,9 +275,9 @@ protected: if (aSequenceNumber > mLastSequenceNumber && mFrame && mFrame->mInstanceOwner) { mLastSequenceNumber = aSequenceNumber; - return PR_TRUE; + return true; } - return PR_FALSE; + return false; } PRUint64 mLastSequenceNumber; @@ -286,7 +286,7 @@ protected: nsObjectFrame::nsObjectFrame(nsStyleContext* aContext) : nsObjectFrameSuper(aContext) - , mReflowCallbackPosted(PR_FALSE) + , mReflowCallbackPosted(false) { PR_LOG(nsObjectFrameLM, PR_LOG_DEBUG, ("Created new nsObjectFrame %p\n", this)); @@ -350,7 +350,7 @@ nsObjectFrame::DestroyFrom(nsIFrame* aDestructRoot) // we need to finish with the plugin before native window is destroyed // doing this in the destructor is too late. - StopPluginInternal(PR_TRUE); + StopPluginInternal(true); // StopPluginInternal might have disowned the widget; if it has, // mWidget will be null. @@ -450,7 +450,7 @@ nsObjectFrame::CreateWidget(nscoord aWidth, NS_ERROR("Could not create inner view"); return NS_ERROR_OUT_OF_MEMORY; } - viewMan->InsertChild(view, mInnerView, nsnull, PR_TRUE); + viewMan->InsertChild(view, mInnerView, nsnull, true); nsresult rv; mWidget = do_CreateInstance(kWidgetCID, &rv); @@ -459,9 +459,9 @@ nsObjectFrame::CreateWidget(nscoord aWidth, nsWidgetInitData initData; initData.mWindowType = eWindowType_plugin; - initData.mUnicode = PR_FALSE; - initData.clipChildren = PR_TRUE; - initData.clipSiblings = PR_TRUE; + initData.mUnicode = false; + initData.clipChildren = true; + initData.clipSiblings = true; // We want mWidget to be able to deliver events to us, especially on // Mac where events to the plugin are routed through Gecko. So we // allow the view to attach its event handler to mWidget even though @@ -475,7 +475,7 @@ nsObjectFrame::CreateWidget(nscoord aWidth, return rv; } - mWidget->EnableDragDrop(PR_TRUE); + mWidget->EnableDragDrop(true); // If this frame has an ancestor with a widget which is not // the root prescontext's widget, then this plugin should not be @@ -483,7 +483,7 @@ nsObjectFrame::CreateWidget(nscoord aWidth, // plugin may appear in the main window. In Web content this would // only happen with a plugin in a XUL popup. if (parentWidget == GetNearestWidget()) { - mWidget->Show(PR_TRUE); + mWidget->Show(true); #ifdef XP_MACOSX // On Mac, we need to invalidate ourselves since even windowed // plugins are painted through Thebes and we need to ensure @@ -545,7 +545,7 @@ nsObjectFrame::GetMinWidth(nsRenderingContext *aRenderingContext) { nscoord result = 0; - if (!IsHidden(PR_FALSE)) { + if (!IsHidden(false)) { nsIAtom *atom = mContent->Tag(); if (atom == nsGkAtoms::applet || atom == nsGkAtoms::embed) { result = nsPresContext::CSSPixelsToAppUnits(EMBED_DEF_WIDTH); @@ -571,7 +571,7 @@ nsObjectFrame::GetDesiredSize(nsPresContext* aPresContext, aMetrics.width = 0; aMetrics.height = 0; - if (IsHidden(PR_FALSE)) { + if (IsHidden(false)) { return; } @@ -662,12 +662,12 @@ nsObjectFrame::Reflow(nsPresContext* aPresContext, if (mInnerView) { nsIViewManager* vm = mInnerView->GetViewManager(); vm->MoveViewTo(mInnerView, r.x, r.y); - vm->ResizeView(mInnerView, nsRect(nsPoint(0, 0), r.Size()), PR_TRUE); + vm->ResizeView(mInnerView, nsRect(nsPoint(0, 0), r.Size()), true); } FixupWindow(r.Size()); if (!mReflowCallbackPosted) { - mReflowCallbackPosted = PR_TRUE; + mReflowCallbackPosted = true; aPresContext->PresShell()->PostReflowCallback(this); } @@ -682,15 +682,15 @@ nsObjectFrame::Reflow(nsPresContext* aPresContext, bool nsObjectFrame::ReflowFinished() { - mReflowCallbackPosted = PR_FALSE; + mReflowCallbackPosted = false; CallSetWindow(); - return PR_TRUE; + return true; } void nsObjectFrame::ReflowCallbackCanceled() { - mReflowCallbackPosted = PR_FALSE; + mReflowCallbackPosted = false; } nsresult @@ -773,7 +773,7 @@ nsObjectFrame::FixupWindow(const nsSize& aSize) window->clipRect.bottom = 0; window->clipRect.right = 0; #else - mInstanceOwner->UpdateWindowPositionAndClipRect(PR_FALSE); + mInstanceOwner->UpdateWindowPositionAndClipRect(false); #endif NotifyPluginReflowObservers(); @@ -845,7 +845,7 @@ nsObjectFrame::IsHidden(bool aCheckVisibilityStyle) const { if (aCheckVisibilityStyle) { if (!GetStyleVisibility()->IsVisibleOrCollapsed()) - return PR_TRUE; + return true; } // only tags support the HIDDEN attribute @@ -863,11 +863,11 @@ nsObjectFrame::IsHidden(bool aCheckVisibilityStyle) const (!hidden.LowerCaseEqualsLiteral("false") && !hidden.LowerCaseEqualsLiteral("no") && !hidden.LowerCaseEqualsLiteral("off")))) { - return PR_TRUE; + return true; } } - return PR_FALSE; + return false; } nsIntPoint nsObjectFrame::GetWindowOriginInPixels(bool aWindowless) @@ -985,7 +985,7 @@ nsDisplayPluginReadback::ComputeVisibility(nsDisplayListBuilder* aBuilder, { if (!nsDisplayItem::ComputeVisibility(aBuilder, aVisibleRegion, aAllowVisibleRegionExpansion)) - return PR_FALSE; + return false; nsRect expand; expand.IntersectRect(aAllowVisibleRegionExpansion, GetBounds(aBuilder)); @@ -993,7 +993,7 @@ nsDisplayPluginReadback::ComputeVisibility(nsDisplayListBuilder* aBuilder, // likely to be made visible, so we can use it for a background! This is // a bit crazy since we normally only subtract from the visible region. aVisibleRegion->Or(*aVisibleRegion, expand); - return PR_TRUE; + return true; } nsRect @@ -1025,7 +1025,7 @@ nsDisplayPlugin::GetOpaqueRegion(nsDisplayListBuilder* aBuilder, bool* aForceTransparentSurface) { if (aForceTransparentSurface) { - *aForceTransparentSurface = PR_FALSE; + *aForceTransparentSurface = false; } nsRegion result; nsObjectFrame* f = static_cast(mFrame); @@ -1142,7 +1142,7 @@ nsObjectFrame::IsOpaque() const { #if defined(XP_MACOSX) // ??? - return PR_FALSE; + return false; #else return !IsTransparentMode(); #endif @@ -1153,21 +1153,21 @@ nsObjectFrame::IsTransparentMode() const { #if defined(XP_MACOSX) // ??? - return PR_FALSE; + return false; #else if (!mInstanceOwner) - return PR_FALSE; + return false; NPWindow *window; mInstanceOwner->GetWindow(window); if (window->type != NPWindowTypeDrawable) - return PR_FALSE; + return false; nsresult rv; nsRefPtr pi; rv = mInstanceOwner->GetInstance(getter_AddRefs(pi)); if (NS_FAILED(rv) || !pi) - return PR_FALSE; + return false; bool transparent = false; pi->IsTransparent(&transparent); @@ -1210,7 +1210,7 @@ nsObjectFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, bool isVisible = window && window->width > 0 && window->height > 0; if (isVisible && aBuilder->ShouldSyncDecodeImages()) { #ifndef XP_MACOSX - mInstanceOwner->UpdateWindowVisibility(PR_TRUE); + mInstanceOwner->UpdateWindowVisibility(true); #endif } @@ -1788,7 +1788,7 @@ nsObjectFrame::PaintPlugin(nsDisplayListBuilder* aBuilder, windowContext->context != cgContext) { windowContext->context = cgContext; cgPluginPortCopy->context = cgContext; - mInstanceOwner->SetPluginPortChanged(PR_TRUE); + mInstanceOwner->SetPluginPortChanged(true); } #endif @@ -1839,7 +1839,7 @@ nsObjectFrame::PaintPlugin(nsDisplayListBuilder* aBuilder, gfxContext *ctx = aRenderingContext.ThebesContext(); gfxMatrix currentMatrix = ctx->CurrentMatrix(); - if (ctx->UserToDevicePixelSnapped(frameGfxRect, PR_FALSE)) { + if (ctx->UserToDevicePixelSnapped(frameGfxRect, false)) { dirtyGfxRect = ctx->UserToDevice(dirtyGfxRect); ctx->IdentityMatrix(); } @@ -1901,7 +1901,7 @@ nsObjectFrame::PaintPlugin(nsDisplayListBuilder* aBuilder, // on information here for clipping their drawing, and we can safely use this message // to tell the plugin exactly where it is in all cases. - nsIntPoint origin = GetWindowOriginInPixels(PR_TRUE); + nsIntPoint origin = GetWindowOriginInPixels(true); nsIntRect winlessRect = nsIntRect(origin, nsIntSize(window->width, window->height)); if (!mWindowlessRect.IsEqualEdges(winlessRect)) { @@ -1992,7 +1992,7 @@ nsObjectFrame::PaintPlugin(nsDisplayListBuilder* aBuilder, HPS hps = (HPS)GetPSFromRC(aRenderingContext); if (reinterpret_cast(window->window) != hps) { window->window = reinterpret_cast(hps); - doupdatewindow = PR_TRUE; + doupdatewindow = true; } LONG lPSid = GpiSavePS(hps); RECTL rclViewport; @@ -2009,7 +2009,7 @@ nsObjectFrame::PaintPlugin(nsDisplayListBuilder* aBuilder, if ((window->x != origin.x) || (window->y != origin.y)) { window->x = origin.x; window->y = origin.y; - doupdatewindow = PR_TRUE; + doupdatewindow = true; } // if our location or visible area has changed, we need to tell the plugin @@ -2113,7 +2113,7 @@ nsObjectFrame::PrepareInstanceOwner() nsWeakFrame weakFrame(this); // First, have to stop any possibly running plugins. - StopPluginInternal(PR_FALSE); + StopPluginInternal(false); if (!weakFrame.IsAlive()) { return NS_ERROR_NOT_AVAILABLE; @@ -2160,7 +2160,7 @@ nsObjectFrame::Instantiate(nsIChannel* aChannel, nsIStreamListener** aStreamList nsWeakFrame weakFrame(this); NS_ASSERTION(!mPreventInstantiation, "Say what?"); - mPreventInstantiation = PR_TRUE; + mPreventInstantiation = true; rv = pluginHost->InstantiatePluginForChannel(aChannel, mInstanceOwner, aStreamListener); if (!weakFrame.IsAlive()) { @@ -2169,7 +2169,7 @@ nsObjectFrame::Instantiate(nsIChannel* aChannel, nsIStreamListener** aStreamList NS_ASSERTION(mPreventInstantiation, "Instantiation should still be prevented!"); - mPreventInstantiation = PR_FALSE; + mPreventInstantiation = false; #ifdef ACCESSIBILITY nsAccessibilityService* accService = nsIPresShell::AccService(); @@ -2218,7 +2218,7 @@ nsObjectFrame::Instantiate(const char* aMimeType, nsIURI* aURI) mInstanceOwner->SetPluginHost(pluginHost); NS_ASSERTION(!mPreventInstantiation, "Say what?"); - mPreventInstantiation = PR_TRUE; + mPreventInstantiation = true; rv = InstantiatePlugin(static_cast(pluginHost.get()), aMimeType, aURI); @@ -2247,7 +2247,7 @@ nsObjectFrame::Instantiate(const char* aMimeType, nsIURI* aURI) } #endif - mPreventInstantiation = PR_FALSE; + mPreventInstantiation = false; return rv; } @@ -2309,7 +2309,7 @@ DoDelayedStop(nsPluginInstanceOwner *aInstanceOwner, bool aDelayedStop) #if (MOZ_PLATFORM_MAEMO==5) // Don't delay stop on Maemo/Hildon (bug 530739). if (aDelayedStop && aInstanceOwner->MatchPluginName("Shockwave Flash")) - return PR_FALSE; + return false; #endif // Don't delay stopping QuickTime (bug 425157), Flip4Mac (bug 426524), @@ -2324,9 +2324,9 @@ DoDelayedStop(nsPluginInstanceOwner *aInstanceOwner, bool aDelayedStop) ) { nsCOMPtr evt = new nsStopPluginRunnable(aInstanceOwner); NS_DispatchToCurrentThread(evt); - return PR_TRUE; + return true; } - return PR_FALSE; + return false; } static void @@ -2399,7 +2399,7 @@ nsStopPluginRunnable::Run() mTimer = nsnull; - DoStopPlugin(mInstanceOwner, PR_FALSE); + DoStopPlugin(mInstanceOwner, false); return NS_OK; } @@ -2465,7 +2465,7 @@ nsObjectFrame::StopPluginInternal(bool aDelayedStop) mWindowlessRect.SetEmpty(); bool oldVal = mPreventInstantiation; - mPreventInstantiation = PR_TRUE; + mPreventInstantiation = true; nsWeakFrame weakFrame(this); diff --git a/layout/style/nsCSSProps.cpp b/layout/style/nsCSSProps.cpp index 2e21994752c4..c73abef95260 100644 --- a/layout/style/nsCSSProps.cpp +++ b/layout/style/nsCSSProps.cpp @@ -584,12 +584,14 @@ const PRInt32 nsCSSProps::kAppearanceKTable[] = { const PRInt32 nsCSSProps::kBackfaceVisibilityKTable[] = { eCSSKeyword_visible, NS_STYLE_BACKFACE_VISIBILITY_VISIBLE, - eCSSKeyword_hidden, NS_STYLE_BACKFACE_VISIBILITY_HIDDEN + eCSSKeyword_hidden, NS_STYLE_BACKFACE_VISIBILITY_HIDDEN, + eCSSKeyword_UNKNOWN,-1 }; const PRInt32 nsCSSProps::kTransformStyleKTable[] = { eCSSKeyword_flat, NS_STYLE_TRANSFORM_STYLE_FLAT, - eCSSKeyword_preserve_3d, NS_STYLE_TRANSFORM_STYLE_PRESERVE_3D + eCSSKeyword_preserve_3d, NS_STYLE_TRANSFORM_STYLE_PRESERVE_3D, + eCSSKeyword_UNKNOWN,-1 }; const PRInt32 nsCSSProps::kBackgroundAttachmentKTable[] = { diff --git a/layout/tools/reftest/reftest.js b/layout/tools/reftest/reftest.js index 2f789eebe472..31d9382a1120 100644 --- a/layout/tools/reftest/reftest.js +++ b/layout/tools/reftest/reftest.js @@ -882,14 +882,13 @@ function Focus() return false; } - // FIXME/bug 623625: determine if the window is focused and/or try - // to acquire focus if it's not. - // - // NB: we can't add anything here that would return false on - // tinderbox, otherwise we could lose testing coverage due to - // problems on the test machines. We might want a require-focus - // mode, defaulting to false for developers, but that's true on - // tinderbox. + var fm = CC["@mozilla.org/focus-manager;1"].getService(CI.nsIFocusManager); + fm.activeWindow = window; + try { + var dock = CC["@mozilla.org/widget/macdocksupport;1"].getService(CI.nsIMacDockSupport); + dock.activateApplication(true); + } catch(ex) { + } return true; } diff --git a/mobile/themes/core/honeycomb/platform.css b/mobile/themes/core/honeycomb/platform.css index 9196da3bc300..80a3f6b6f54d 100644 --- a/mobile/themes/core/honeycomb/platform.css +++ b/mobile/themes/core/honeycomb/platform.css @@ -712,6 +712,7 @@ dialog { -moz-border-end: @border_width_tiny@ solid @color_button_border@; -moz-border-right-colors: transparent @color_button_border@; -moz-margin-end: -moz-calc(-3 * @border_width_tiny@); + padding: @padding_xxxnormal@ 0; } .prompt-button:last-of-type { diff --git a/modules/libpr0n/decoders/nsBMPDecoder.cpp b/modules/libpr0n/decoders/nsBMPDecoder.cpp index 5a55621f334c..94a00f5085db 100644 --- a/modules/libpr0n/decoders/nsBMPDecoder.cpp +++ b/modules/libpr0n/decoders/nsBMPDecoder.cpp @@ -44,7 +44,7 @@ #include -#include "Endian.h" +#include "EndianMacros.h" #include "nsBMPDecoder.h" #include "nsIInputStream.h" diff --git a/modules/libpr0n/decoders/nsICODecoder.cpp b/modules/libpr0n/decoders/nsICODecoder.cpp index 1d971cce2f4c..79c45dc726e7 100644 --- a/modules/libpr0n/decoders/nsICODecoder.cpp +++ b/modules/libpr0n/decoders/nsICODecoder.cpp @@ -44,7 +44,7 @@ #include -#include "Endian.h" +#include "EndianMacros.h" #include "nsICODecoder.h" #include "nsIInputStream.h" diff --git a/modules/libpr0n/encoders/bmp/nsBMPEncoder.cpp b/modules/libpr0n/encoders/bmp/nsBMPEncoder.cpp index ca004ec4b8ac..6c5a0817b1ce 100644 --- a/modules/libpr0n/encoders/bmp/nsBMPEncoder.cpp +++ b/modules/libpr0n/encoders/bmp/nsBMPEncoder.cpp @@ -36,7 +36,7 @@ * ***** END LICENSE BLOCK ***** */ #include "nsCRT.h" -#include "Endian.h" +#include "EndianMacros.h" #include "nsBMPEncoder.h" #include "prmem.h" #include "prprf.h" diff --git a/modules/libpr0n/encoders/ico/nsICOEncoder.cpp b/modules/libpr0n/encoders/ico/nsICOEncoder.cpp index bc2509cc3e12..975974952dee 100644 --- a/modules/libpr0n/encoders/ico/nsICOEncoder.cpp +++ b/modules/libpr0n/encoders/ico/nsICOEncoder.cpp @@ -36,7 +36,7 @@ * ***** END LICENSE BLOCK ***** */ #include "nsCRT.h" -#include "Endian.h" +#include "EndianMacros.h" #include "nsBMPEncoder.h" #include "nsPNGEncoder.h" #include "nsICOEncoder.h" diff --git a/modules/libpr0n/src/Endian.h b/modules/libpr0n/src/EndianMacros.h similarity index 100% rename from modules/libpr0n/src/Endian.h rename to modules/libpr0n/src/EndianMacros.h diff --git a/modules/libpr0n/test/crashtests/crashtests.list b/modules/libpr0n/test/crashtests/crashtests.list index 4c5c0b1a865b..a15e1a8100c7 100644 --- a/modules/libpr0n/test/crashtests/crashtests.list +++ b/modules/libpr0n/test/crashtests/crashtests.list @@ -8,7 +8,7 @@ load invalid-size.gif load invalid-size-second-frame.gif # Animated gifs with a very large canvas, but tiny actual content. -asserts(2) load delaytest.html?523528-1.gif # Bug 564231 +load delaytest.html?523528-1.gif load delaytest.html?523528-2.gif # this would have exposed the leak discovered in bug 642902 diff --git a/toolkit/components/prompts/content/tabprompts.xml b/toolkit/components/prompts/content/tabprompts.xml index b6ec6a9a2d3d..77f4c42c4606 100644 --- a/toolkit/components/prompts/content/tabprompts.xml +++ b/toolkit/components/prompts/content/tabprompts.xml @@ -213,10 +213,8 @@ ; to be made app-agnostic later - let container = this.parentNode.parentNode; - let availWidth = container.clientWidth; - let availHeight = container.clientHeight; + let availWidth = this.clientWidth; + let availHeight = this.clientHeight; if (availWidth == this.availWidth && availHeight == this.availHeight) return; this.availWidth = availWidth; diff --git a/toolkit/components/telemetry/TelemetryHistograms.h b/toolkit/components/telemetry/TelemetryHistograms.h index 62bc203a66b6..d845f12ea35a 100644 --- a/toolkit/components/telemetry/TelemetryHistograms.h +++ b/toolkit/components/telemetry/TelemetryHistograms.h @@ -186,6 +186,7 @@ HISTOGRAM(NETWORK_DISK_CACHE_DELETEDIR, 1, 10000, 10, EXPONENTIAL, "Time spent d */ #ifdef MOZ_URL_CLASSIFIER HISTOGRAM(URLCLASSIFIER_PS_FILELOAD_TIME, 1, 1000, 10, EXPONENTIAL, "Time spent loading PrefixSet from file (ms)") +HISTOGRAM(URLCLASSIFIER_PS_FALLOCATE_TIME, 1, 1000, 10, EXPONENTIAL, "Time spent fallocating PrefixSet (ms)") HISTOGRAM(URLCLASSIFIER_PS_CONSTRUCT_TIME, 1, 5000, 15, EXPONENTIAL, "Time spent constructing PrefixSet from DB (ms)") HISTOGRAM(URLCLASSIFIER_PS_LOOKUP_TIME, 1, 500, 10, EXPONENTIAL, "Time spent per PrefixSet lookup (ms)") #endif diff --git a/toolkit/components/url-classifier/nsUrlClassifierPrefixSet.cpp b/toolkit/components/url-classifier/nsUrlClassifierPrefixSet.cpp index bcb9188093cd..3b5fe21c9fcc 100644 --- a/toolkit/components/url-classifier/nsUrlClassifierPrefixSet.cpp +++ b/toolkit/components/url-classifier/nsUrlClassifierPrefixSet.cpp @@ -51,6 +51,7 @@ #include "nsTArray.h" #include "nsThreadUtils.h" #include "mozilla/Mutex.h" +#include "mozilla/Telemetry.h" #include "mozilla/FileUtils.h" #include "prlog.h" @@ -378,7 +379,7 @@ nsUrlClassifierPrefixSet::LoadFromFile(nsIFile * aFile) NS_ENSURE_SUCCESS(rv, rv); AutoFDClose fileFd; - rv = file->OpenNSPRFileDesc(PR_RDONLY, 0, &fileFd); + rv = file->OpenNSPRFileDesc(PR_RDONLY | nsILocalFile::OS_READAHEAD, 0, &fileFd); NS_ENSURE_SUCCESS(rv, rv); return LoadFromFd(fileFd); @@ -387,6 +388,15 @@ nsUrlClassifierPrefixSet::LoadFromFile(nsIFile * aFile) nsresult nsUrlClassifierPrefixSet::StoreToFd(AutoFDClose & fileFd) { + { + Telemetry::AutoTimer timer; + PRInt64 size = 4 * sizeof(PRUint32); + size += 2 * mIndexStarts.Length() * sizeof(PRUint32); + size += mDeltas.Length() * sizeof(PRUint16); + + mozilla::fallocate(fileFd, size); + } + PRInt32 written; PRUint32 magic = PREFIXSET_VERSION_MAGIC; written = PR_Write(fileFd, &magic, sizeof(PRUint32)); diff --git a/toolkit/content/xul.css b/toolkit/content/xul.css index f03061f2e828..86a3c02e8014 100644 --- a/toolkit/content/xul.css +++ b/toolkit/content/xul.css @@ -1192,5 +1192,6 @@ filefield { /*********** tabmodalprompt ************/ tabmodalprompt { -moz-binding: url("chrome://global/content/tabprompts.xml#tabmodalprompt"); + overflow: hidden; text-shadow: none; } diff --git a/toolkit/themes/winstripe/global/findBar.css b/toolkit/themes/winstripe/global/findBar.css index 103a80390572..eca331b61ad3 100644 --- a/toolkit/themes/winstripe/global/findBar.css +++ b/toolkit/themes/winstripe/global/findBar.css @@ -17,9 +17,10 @@ } findbar { - border-top: 2px solid; - -moz-border-top-colors: ThreeDShadow ThreeDHighlight; - padding-bottom: 1px; + padding-top: 1px; + background-image: -moz-linear-gradient(rgba(0,0,0,.15) 1px, rgba(255,255,255,.15) 1px); + background-size: 100% 2px; + background-repeat: no-repeat; min-width: 1px; } diff --git a/widget/src/gtk2/nsBidiKeyboard.cpp b/widget/src/gtk2/nsBidiKeyboard.cpp index 6154a6892090..26ac08e22636 100644 --- a/widget/src/gtk2/nsBidiKeyboard.cpp +++ b/widget/src/gtk2/nsBidiKeyboard.cpp @@ -93,7 +93,7 @@ nsBidiKeyboard::IsLangRTL(bool *aIsRTL) nsresult nsBidiKeyboard::SetHaveBidiKeyboards() { - mHaveBidiKeyboards = PR_FALSE; + mHaveBidiKeyboards = false; if (!gtklib || !GdkKeymapHaveBidiLayouts) return NS_ERROR_FAILURE; diff --git a/widget/src/gtk2/nsCUPSShim.cpp b/widget/src/gtk2/nsCUPSShim.cpp index 7c4ea326fcde..42d69cea5ab9 100644 --- a/widget/src/gtk2/nsCUPSShim.cpp +++ b/widget/src/gtk2/nsCUPSShim.cpp @@ -61,7 +61,7 @@ nsCUPSShim::Init() { mCupsLib = PR_LoadLibrary("libcups.so.2"); if (!mCupsLib) - return PR_FALSE; + return false; // List of symbol pointers. Must match gSymName[] defined above. void **symAddr[] = { @@ -83,8 +83,8 @@ nsCUPSShim::Init() #endif PR_UnloadLibrary(mCupsLib); mCupsLib = nsnull; - return PR_FALSE; + return false; } } - return PR_TRUE; + return true; } diff --git a/widget/src/gtk2/nsCUPSShim.h b/widget/src/gtk2/nsCUPSShim.h index 71aa88acd6b6..b84ebe708369 100644 --- a/widget/src/gtk2/nsCUPSShim.h +++ b/widget/src/gtk2/nsCUPSShim.h @@ -88,15 +88,15 @@ class nsCUPSShim { * Initialize this object. Attempt to load the CUPS shared * library and find function pointers for the supported * functions (see below). - * @return PR_FALSE if the shared library could not be loaded, or if + * @return false if the shared library could not be loaded, or if * any of the functions could not be found. - * PR_TRUE for successful initialization. + * true for successful initialization. */ bool Init(); /** - * @return PR_TRUE if the object was initialized successfully. - * PR_FALSE otherwise. + * @return true if the object was initialized successfully. + * false otherwise. */ bool IsInitialized() { return nsnull != mCupsLib; } diff --git a/widget/src/gtk2/nsClipboard.cpp b/widget/src/gtk2/nsClipboard.cpp index 4b517a66e3ac..7196932ee15b 100644 --- a/widget/src/gtk2/nsClipboard.cpp +++ b/widget/src/gtk2/nsClipboard.cpp @@ -103,8 +103,8 @@ struct retrieval_context void *data; retrieval_context() - : completed(PR_FALSE), - timed_out(PR_FALSE), + : completed(false), + timed_out(false), data(nsnull) { } }; @@ -147,7 +147,7 @@ nsClipboard::Init(void) if (!os) return NS_ERROR_FAILURE; - os->AddObserver(this, "quit-application", PR_FALSE); + os->AddObserver(this, "quit-application", false); return NS_OK; } @@ -239,7 +239,7 @@ nsClipboard::SetData(nsITransferable *aTransferable, if (!imagesAdded) { // accept any writable image type gtk_target_list_add_image_targets(list, 0, TRUE); - imagesAdded = PR_TRUE; + imagesAdded = true; } continue; } @@ -329,7 +329,7 @@ nsClipboard::GetData(nsITransferable *aTransferable, PRInt32 aWhichClipboard) data = (guchar *)ToNewUnicode(ucs2string); length = ucs2string.Length() * 2; g_free(new_text); - foundData = PR_TRUE; + foundData = true; foundFlavor = kUnicodeMime; break; } @@ -385,7 +385,7 @@ nsClipboard::GetData(nsITransferable *aTransferable, PRInt32 aWhichClipboard) break; memcpy(data, selectionData->data, length); } - foundData = PR_TRUE; + foundData = true; foundFlavor = flavorStr; break; } @@ -435,7 +435,7 @@ nsClipboard::HasDataMatchingFlavors(const char** aFlavorList, PRUint32 aLength, if (!aFlavorList || !_retval) return NS_ERROR_NULL_POINTER; - *_retval = PR_FALSE; + *_retval = false; GtkSelectionData *selection_data = GetTargets(GetSelectionAtom(aWhichClipboard)); @@ -456,7 +456,7 @@ nsClipboard::HasDataMatchingFlavors(const char** aFlavorList, PRUint32 aLength, // We special case text/unicode here. if (!strcmp(aFlavorList[i], kUnicodeMime) && gtk_selection_data_targets_include_text(selection_data)) { - *_retval = PR_TRUE; + *_retval = true; break; } @@ -466,11 +466,11 @@ nsClipboard::HasDataMatchingFlavors(const char** aFlavorList, PRUint32 aLength, continue; if (!strcmp(atom_name, aFlavorList[i])) - *_retval = PR_TRUE; + *_retval = true; // X clipboard wants image/jpeg, not image/jpg if (!strcmp(aFlavorList[i], kJPEGImageMime) && !strcmp(atom_name, "image/jpeg")) - *_retval = PR_TRUE; + *_retval = true; g_free(atom_name); @@ -487,7 +487,7 @@ nsClipboard::HasDataMatchingFlavors(const char** aFlavorList, PRUint32 aLength, NS_IMETHODIMP nsClipboard::SupportsSelectionClipboard(bool *_retval) { - *_retval = PR_TRUE; // yeah, unix supports the selection clipboard + *_retval = true; // yeah, unix supports the selection clipboard return NS_OK; } @@ -897,7 +897,7 @@ static bool wait_for_retrieval(GtkClipboard *clipboard, retrieval_context *r_context) { if (r_context->completed) // the request completed synchronously - return PR_TRUE; + return true; Display *xDisplay = GDK_DISPLAY(); checkEventContext context; @@ -930,7 +930,7 @@ wait_for_retrieval(GtkClipboard *clipboard, retrieval_context *r_context) DispatchPropertyNotifyEvent(context.cbWidget, &xevent); if (r_context->completed) - return PR_TRUE; + return true; } tv.tv_sec = 0; @@ -942,8 +942,8 @@ wait_for_retrieval(GtkClipboard *clipboard, retrieval_context *r_context) #ifdef DEBUG_CLIPBOARD printf("exceeded clipboard timeout\n"); #endif - r_context->timed_out = PR_TRUE; - return PR_FALSE; + r_context->timed_out = true; + return false; } static void @@ -957,7 +957,7 @@ clipboard_contents_received(GtkClipboard *clipboard, return; } - context->completed = PR_TRUE; + context->completed = true; if (selection_data->length >= 0) context->data = gtk_selection_data_copy(selection_data); @@ -994,7 +994,7 @@ clipboard_text_received(GtkClipboard *clipboard, return; } - context->completed = PR_TRUE; + context->completed = true; context->data = g_strdup(text); } diff --git a/widget/src/gtk2/nsDeviceContextSpecG.cpp b/widget/src/gtk2/nsDeviceContextSpecG.cpp index dac8bae4fadf..b8460a1f960a 100644 --- a/widget/src/gtk2/nsDeviceContextSpecG.cpp +++ b/widget/src/gtk2/nsDeviceContextSpecG.cpp @@ -77,9 +77,6 @@ using namespace mozilla; -/* Ensure that the result is always equal to either PR_TRUE or PR_FALSE */ -#define MAKE_PR_BOOL(val) ((val)?(PR_TRUE):(PR_FALSE)) - #ifdef PR_LOGGING static PRLogModuleInfo *DeviceContextSpecGTKLM = PR_NewLogModule("DeviceContextSpecGTK"); #endif /* PR_LOGGING */ @@ -223,7 +220,7 @@ nsPrinterFeatures::nsPrinterFeatures( const char *printername ) DO_PR_DEBUG_LOG(("nsPrinterFeatures::nsPrinterFeatures('%s')\n", printername)); mPrinterName.Assign(printername); - SetBoolValue("has_special_printerfeatures", PR_TRUE); + SetBoolValue("has_special_printerfeatures", true); } void nsPrinterFeatures::SetCanChangePaperSize( bool aCanSetPaperSize ) @@ -440,7 +437,7 @@ NS_IMETHODIMP nsDeviceContextSpecGTK::GetSurfaceForPrinter(gfxASurface **aSurfac return NS_ERROR_GFX_PRINTER_COULD_NOT_OPEN_FILE; close(fd); - rv = NS_NewNativeLocalFile(nsDependentCString(buf), PR_FALSE, + rv = NS_NewNativeLocalFile(nsDependentCString(buf), false, getter_AddRefs(mSpoolFile)); if (NS_FAILED(rv)) { unlink(buf); @@ -588,7 +585,7 @@ nsresult nsDeviceContextSpecGTK::GetPrintMethod(const char *aPrinter, PrintMetho static void print_callback(GtkPrintJob *aJob, gpointer aData, GError *aError) { g_object_unref(aJob); - ((nsILocalFile*) aData)->Remove(PR_FALSE); + ((nsILocalFile*) aData)->Remove(false); } static void @@ -629,7 +626,7 @@ NS_IMETHODIMP nsDeviceContextSpecGTK::EndDocument() mPrintSettings->GetToFileName(getter_Copies(targetPath)); nsresult rv = NS_NewNativeLocalFile(NS_ConvertUTF16toUTF8(targetPath), - PR_FALSE, getter_AddRefs(destFile)); + false, getter_AddRefs(destFile)); NS_ENSURE_SUCCESS(rv, rv); nsAutoString destLeafName; @@ -796,7 +793,7 @@ NS_IMETHODIMP nsPrinterEnumeratorGTK::InitPrintSettingsFromPrinter(const PRUnich nsPrintfCString prefName(256, PRINTERFEATURES_PREF ".%s.has_special_printerfeatures", fullPrinterName.get()); - Preferences::SetBool(prefName.get(), PR_FALSE); + Preferences::SetBool(prefName.get(), false); #endif /* SET_PRINTER_FEATURES_VIA_PREFS */ @@ -816,7 +813,7 @@ NS_IMETHODIMP nsPrinterEnumeratorGTK::InitPrintSettingsFromPrinter(const PRUnich DO_PR_DEBUG_LOG(("Setting default filename to '%s'\n", filename.get())); aPrintSettings->SetToFileName(NS_ConvertUTF8toUTF16(filename).get()); - aPrintSettings->SetIsInitializedFromPrinter(PR_TRUE); + aPrintSettings->SetIsInitializedFromPrinter(true); if (type == pmPostScript) { DO_PR_DEBUG_LOG(("InitPrintSettingsFromPrinter() for PostScript printer\n")); @@ -824,15 +821,15 @@ NS_IMETHODIMP nsPrinterEnumeratorGTK::InitPrintSettingsFromPrinter(const PRUnich #ifdef SET_PRINTER_FEATURES_VIA_PREFS nsPrinterFeatures printerFeatures(fullPrinterName); - printerFeatures.SetSupportsPaperSizeChange(PR_TRUE); - printerFeatures.SetSupportsOrientationChange(PR_TRUE); - printerFeatures.SetSupportsPlexChange(PR_FALSE); - printerFeatures.SetSupportsResolutionNameChange(PR_FALSE); - printerFeatures.SetSupportsColorspaceChange(PR_FALSE); + printerFeatures.SetSupportsPaperSizeChange(true); + printerFeatures.SetSupportsOrientationChange(true); + printerFeatures.SetSupportsPlexChange(false); + printerFeatures.SetSupportsResolutionNameChange(false); + printerFeatures.SetSupportsColorspaceChange(false); #endif /* SET_PRINTER_FEATURES_VIA_PREFS */ #ifdef SET_PRINTER_FEATURES_VIA_PREFS - printerFeatures.SetCanChangeOrientation(PR_TRUE); + printerFeatures.SetCanChangeOrientation(true); #endif /* SET_PRINTER_FEATURES_VIA_PREFS */ nsCAutoString orientation; @@ -859,7 +856,7 @@ NS_IMETHODIMP nsPrinterEnumeratorGTK::InitPrintSettingsFromPrinter(const PRUnich /* PostScript module does not support changing the plex mode... */ #ifdef SET_PRINTER_FEATURES_VIA_PREFS - printerFeatures.SetCanChangePlex(PR_FALSE); + printerFeatures.SetCanChangePlex(false); #endif /* SET_PRINTER_FEATURES_VIA_PREFS */ DO_PR_DEBUG_LOG(("setting default plex to '%s'\n", "default")); aPrintSettings->SetPlexName(NS_LITERAL_STRING("default").get()); @@ -870,7 +867,7 @@ NS_IMETHODIMP nsPrinterEnumeratorGTK::InitPrintSettingsFromPrinter(const PRUnich /* PostScript module does not support changing the resolution mode... */ #ifdef SET_PRINTER_FEATURES_VIA_PREFS - printerFeatures.SetCanChangeResolutionName(PR_FALSE); + printerFeatures.SetCanChangeResolutionName(false); #endif /* SET_PRINTER_FEATURES_VIA_PREFS */ DO_PR_DEBUG_LOG(("setting default resolution to '%s'\n", "default")); aPrintSettings->SetResolutionName(NS_LITERAL_STRING("default").get()); @@ -881,7 +878,7 @@ NS_IMETHODIMP nsPrinterEnumeratorGTK::InitPrintSettingsFromPrinter(const PRUnich /* PostScript module does not support changing the colorspace... */ #ifdef SET_PRINTER_FEATURES_VIA_PREFS - printerFeatures.SetCanChangeColorspace(PR_FALSE); + printerFeatures.SetCanChangeColorspace(false); #endif /* SET_PRINTER_FEATURES_VIA_PREFS */ DO_PR_DEBUG_LOG(("setting default colorspace to '%s'\n", "default")); aPrintSettings->SetColorspace(NS_LITERAL_STRING("default").get()); @@ -891,7 +888,7 @@ NS_IMETHODIMP nsPrinterEnumeratorGTK::InitPrintSettingsFromPrinter(const PRUnich #endif /* SET_PRINTER_FEATURES_VIA_PREFS */ #ifdef SET_PRINTER_FEATURES_VIA_PREFS - printerFeatures.SetCanChangePaperSize(PR_TRUE); + printerFeatures.SetCanChangePaperSize(true); #endif /* SET_PRINTER_FEATURES_VIA_PREFS */ nsCAutoString papername; if (NS_SUCCEEDED(CopyPrinterCharPref("postscript", printerName, @@ -929,15 +926,15 @@ NS_IMETHODIMP nsPrinterEnumeratorGTK::InitPrintSettingsFromPrinter(const PRUnich printerFeatures.SetCanChangeSpoolerCommand(hasSpoolerCmd); /* Postscript module does not pass the job title to lpr */ - printerFeatures.SetSupportsJobTitleChange(PR_FALSE); - printerFeatures.SetCanChangeJobTitle(PR_FALSE); + printerFeatures.SetSupportsJobTitleChange(false); + printerFeatures.SetCanChangeJobTitle(false); /* Postscript module has no control over builtin fonts yet */ - printerFeatures.SetSupportsDownloadFontsChange(PR_FALSE); - printerFeatures.SetCanChangeDownloadFonts(PR_FALSE); + printerFeatures.SetSupportsDownloadFontsChange(false); + printerFeatures.SetCanChangeDownloadFonts(false); /* Postscript module does not support multiple colorspaces * so it has to use the old way */ - printerFeatures.SetSupportsPrintInColorChange(PR_TRUE); - printerFeatures.SetCanChangePrintInColor(PR_TRUE); + printerFeatures.SetSupportsPrintInColorChange(true); + printerFeatures.SetCanChangePrintInColor(true); #endif /* SET_PRINTER_FEATURES_VIA_PREFS */ if (hasSpoolerCmd) { @@ -951,7 +948,7 @@ NS_IMETHODIMP nsPrinterEnumeratorGTK::InitPrintSettingsFromPrinter(const PRUnich } #ifdef SET_PRINTER_FEATURES_VIA_PREFS - printerFeatures.SetCanChangeNumCopies(PR_TRUE); + printerFeatures.SetCanChangeNumCopies(true); #endif /* SET_PRINTER_FEATURES_VIA_PREFS */ return NS_OK; diff --git a/widget/src/gtk2/nsDeviceContextSpecG.h b/widget/src/gtk2/nsDeviceContextSpecG.h index 299d3d1d2f94..143dda498e51 100644 --- a/widget/src/gtk2/nsDeviceContextSpecG.h +++ b/widget/src/gtk2/nsDeviceContextSpecG.h @@ -84,7 +84,7 @@ protected: nsCOMPtr mPrintSettings; bool mToPrinter : 1; /* If true, print to printer */ bool mIsPPreview : 1; /* If true, is print preview */ - char mPath[PATH_MAX]; /* If toPrinter = PR_FALSE, dest file */ + char mPath[PATH_MAX]; /* If toPrinter = false, dest file */ char mPrinter[256]; /* Printer name */ GtkPrintJob* mPrintJob; GtkPrinter* mGtkPrinter; diff --git a/widget/src/gtk2/nsDragService.cpp b/widget/src/gtk2/nsDragService.cpp index eed149ef277e..ca5a42cfaa07 100644 --- a/widget/src/gtk2/nsDragService.cpp +++ b/widget/src/gtk2/nsDragService.cpp @@ -132,7 +132,7 @@ nsDragService::nsDragService() // running. nsCOMPtr obsServ = mozilla::services::GetObserverService(); - obsServ->AddObserver(this, "quit-application", PR_FALSE); + obsServ->AddObserver(this, "quit-application", false); // our hidden source widget mHiddenWidget = gtk_invisible_new(); @@ -165,8 +165,8 @@ nsDragService::nsDragService() mTargetWidget = 0; mTargetDragContext = 0; mTargetTime = 0; - mCanDrop = PR_FALSE; - mTargetDragDataReceived = PR_FALSE; + mCanDrop = false; + mTargetDragDataReceived = false; mTargetDragData = 0; mTargetDragDataLen = 0; } @@ -378,16 +378,16 @@ nsDragService::SetAlphaPixmap(gfxASurface *aSurface, // Transparent drag icons need, like a lot of transparency-related things, // a compositing X window manager if (!gdk_screen_is_composited(screen)) - return PR_FALSE; + return false; GdkColormap* alphaColormap = gdk_screen_get_rgba_colormap(screen); if (!alphaColormap) - return PR_FALSE; + return false; GdkPixmap* pixmap = gdk_pixmap_new(NULL, dragRect.width, dragRect.height, gdk_colormap_get_visual(alphaColormap)->depth); if (!pixmap) - return PR_FALSE; + return false; gdk_drawable_set_colormap(GDK_DRAWABLE(pixmap), alphaColormap); @@ -396,7 +396,7 @@ nsDragService::SetAlphaPixmap(gfxASurface *aSurface, nsWindow::GetSurfaceForGdkDrawable(GDK_DRAWABLE(pixmap), dragRect.Size()); if (!xPixmapSurface) - return PR_FALSE; + return false; nsRefPtr xPixmapCtx = new gfxContext(xPixmapSurface); @@ -413,7 +413,7 @@ nsDragService::SetAlphaPixmap(gfxASurface *aSurface, gtk_drag_set_icon_pixmap(aContext, alphaColormap, pixmap, NULL, aXOffset, aYOffset); g_object_unref(pixmap); - return PR_TRUE; + return true; } NS_IMETHODIMP @@ -652,11 +652,11 @@ nsDragService::GetData(nsITransferable * aTransferable, GetTargetDragData(gdkFlavor); } if (mTargetDragData) { - PR_LOG(sDragLm, PR_LOG_DEBUG, ("dataFound = PR_TRUE\n")); - dataFound = PR_TRUE; + PR_LOG(sDragLm, PR_LOG_DEBUG, ("dataFound = true\n")); + dataFound = true; } else { - PR_LOG(sDragLm, PR_LOG_DEBUG, ("dataFound = PR_FALSE\n")); + PR_LOG(sDragLm, PR_LOG_DEBUG, ("dataFound = false\n")); // Dragging and dropping from the file manager would cause us // to parse the source text as a nsILocalFile URL. @@ -725,7 +725,7 @@ nsDragService::GetData(nsITransferable * aTransferable, g_free(mTargetDragData); mTargetDragData = convertedText; mTargetDragDataLen = ucs2string.Length() * 2; - dataFound = PR_TRUE; + dataFound = true; } // if plain text data on clipboard } else { PR_LOG(sDragLm, PR_LOG_DEBUG, @@ -750,7 +750,7 @@ nsDragService::GetData(nsITransferable * aTransferable, g_free(mTargetDragData); mTargetDragData = convertedText; mTargetDragDataLen = convertedTextLen * 2; - dataFound = PR_TRUE; + dataFound = true; } // if plain text data on clipboard } // if plain text flavor present } // if plain text charset=utf-8 flavor present @@ -784,7 +784,7 @@ nsDragService::GetData(nsITransferable * aTransferable, g_free(mTargetDragData); mTargetDragData = convertedText; mTargetDragDataLen = convertedTextLen * 2; - dataFound = PR_TRUE; + dataFound = true; } } else { @@ -814,7 +814,7 @@ nsDragService::GetData(nsITransferable * aTransferable, g_free(mTargetDragData); mTargetDragData = convertedText; mTargetDragDataLen = convertedTextLen * 2; - dataFound = PR_TRUE; + dataFound = true; } } else { @@ -863,7 +863,7 @@ nsDragService::IsDataFlavorSupported(const char *aDataFlavor, return NS_ERROR_INVALID_ARG; // set this to no by default - *_retval = PR_FALSE; + *_retval = false; // check to make sure that we have a drag object set, here if (!mTargetDragContext) { @@ -914,7 +914,7 @@ nsDragService::IsDataFlavorSupported(const char *aDataFlavor, if (strcmp(flavorStr, aDataFlavor) == 0) { PR_LOG(sDragLm, PR_LOG_DEBUG, ("boioioioiooioioioing!\n")); - *_retval = PR_TRUE; + *_retval = true; } } } @@ -935,7 +935,7 @@ nsDragService::IsDataFlavorSupported(const char *aDataFlavor, ("checking %s against %s\n", name, aDataFlavor)); if (name && (strcmp(name, aDataFlavor) == 0)) { PR_LOG(sDragLm, PR_LOG_DEBUG, ("good!\n")); - *_retval = PR_TRUE; + *_retval = true; } // check for automatic text/uri-list -> text/x-moz-url mapping if (!*_retval && @@ -945,7 +945,7 @@ nsDragService::IsDataFlavorSupported(const char *aDataFlavor, PR_LOG(sDragLm, PR_LOG_DEBUG, ("good! ( it's text/uri-list and \ we're checking against text/x-moz-url )\n")); - *_retval = PR_TRUE; + *_retval = true; } // check for automatic _NETSCAPE_URL -> text/x-moz-url mapping if (!*_retval && @@ -955,7 +955,7 @@ nsDragService::IsDataFlavorSupported(const char *aDataFlavor, PR_LOG(sDragLm, PR_LOG_DEBUG, ("good! ( it's _NETSCAPE_URL and \ we're checking against text/x-moz-url )\n")); - *_retval = PR_TRUE; + *_retval = true; } // check for auto text/plain -> text/unicode mapping if (!*_retval && @@ -966,7 +966,7 @@ nsDragService::IsDataFlavorSupported(const char *aDataFlavor, PR_LOG(sDragLm, PR_LOG_DEBUG, ("good! ( it's text plain and we're checking \ against text/unicode or application/x-moz-file)\n")); - *_retval = PR_TRUE; + *_retval = true; } g_free(name); } @@ -991,7 +991,7 @@ NS_IMETHODIMP nsDragService::TargetStartDragMotion(void) { PR_LOG(sDragLm, PR_LOG_DEBUG, ("nsDragService::TargetStartDragMotion")); - mCanDrop = PR_FALSE; + mCanDrop = false; return NS_OK; } @@ -1037,7 +1037,7 @@ nsDragService::TargetDataReceived(GtkWidget *aWidget, { PR_LOG(sDragLm, PR_LOG_DEBUG, ("nsDragService::TargetDataReceived")); TargetResetData(); - mTargetDragDataReceived = PR_TRUE; + mTargetDragDataReceived = true; if (aSelectionData->length > 0) { mTargetDragDataLen = aSelectionData->length; mTargetDragData = g_malloc(mTargetDragDataLen); @@ -1084,7 +1084,7 @@ nsDragService::IsTargetContextList(void) gchar *name = NULL; name = gdk_atom_name(atom); if (name && strcmp(name, gMimeListType) == 0) - retval = PR_TRUE; + retval = true; g_free(name); if (retval) break; @@ -1120,7 +1120,7 @@ nsDragService::GetTargetDragData(GdkAtom aFlavor) void nsDragService::TargetResetData(void) { - mTargetDragDataReceived = PR_FALSE; + mTargetDragDataReceived = false; // make sure to free old data if we have to g_free(mTargetDragData); mTargetDragData = 0; @@ -1370,7 +1370,7 @@ nsDragService::SourceEndDragSession(GdkDragContext *aContext, dropEffect = DRAGDROP_ACTION_NONE; if (aResult != MOZ_GTK_DRAG_RESULT_NO_TARGET) { - mUserCancelled = PR_TRUE; + mUserCancelled = true; } } @@ -1382,7 +1382,7 @@ nsDragService::SourceEndDragSession(GdkDragContext *aContext, } // Inform the drag session that we're ending the drag. - EndDragSession(PR_TRUE); + EndDragSession(true); } static void @@ -1489,19 +1489,19 @@ nsDragService::SourceDataGet(GtkWidget *aWidget, if (strcmp(mimeFlavor, kTextMime) == 0 || strcmp(mimeFlavor, gTextPlainUTF8Type) == 0) { actualFlavor = kUnicodeMime; - needToDoConversionToPlainText = PR_TRUE; + needToDoConversionToPlainText = true; } // if someone was asking for _NETSCAPE_URL we need to convert to // plain text but we also need to look for x-moz-url else if (strcmp(mimeFlavor, gMozUrlType) == 0) { actualFlavor = kURLMime; - needToDoConversionToPlainText = PR_TRUE; + needToDoConversionToPlainText = true; } // if someone was asking for text/uri-list we need to convert to // plain text. else if (strcmp(mimeFlavor, gTextUriListType) == 0) { actualFlavor = gTextUriListType; - needToDoConversionToPlainText = PR_TRUE; + needToDoConversionToPlainText = true; } else actualFlavor = mimeFlavor; diff --git a/widget/src/gtk2/nsFilePicker.cpp b/widget/src/gtk2/nsFilePicker.cpp index bea86df1345a..430bfd243dff 100644 --- a/widget/src/gtk2/nsFilePicker.cpp +++ b/widget/src/gtk2/nsFilePicker.cpp @@ -205,7 +205,7 @@ NS_IMPL_ISUPPORTS1(nsFilePicker, nsIFilePicker) nsFilePicker::nsFilePicker() : mMode(nsIFilePicker::modeOpen), mSelectedType(0), - mAllowURLs(PR_FALSE) + mAllowURLs(false) { } @@ -218,7 +218,7 @@ ReadMultipleFiles(gpointer filename, gpointer array) { nsCOMPtr localfile; nsresult rv = NS_NewNativeLocalFile(nsDependentCString(static_cast(filename)), - PR_FALSE, + false, getter_AddRefs(localfile)); if (NS_SUCCEEDED(rv)) { nsCOMArray& files = *static_cast*>(array); @@ -394,7 +394,7 @@ confirm_overwrite_file(GtkWidget *parent, nsILocalFile* file) nsresult rv = sbs->CreateBundle("chrome://global/locale/filepicker.properties", getter_AddRefs(bundle)); if (NS_FAILED(rv)) { - return PR_FALSE; + return false; } nsAutoString leafName; @@ -548,7 +548,7 @@ nsFilePicker::Show(PRInt16 *aReturn) } } - gtk_file_chooser_set_do_overwrite_confirmation(GTK_FILE_CHOOSER(file_chooser), PR_TRUE); + gtk_file_chooser_set_do_overwrite_confirmation(GTK_FILE_CHOOSER(file_chooser), TRUE); gint response = gtk_dialog_run(GTK_DIALOG(file_chooser)); switch (response) { diff --git a/widget/src/gtk2/nsGtkIMModule.cpp b/widget/src/gtk2/nsGtkIMModule.cpp index 8737c8a9ee3d..27ce7600d1e6 100644 --- a/widget/src/gtk2/nsGtkIMModule.cpp +++ b/widget/src/gtk2/nsGtkIMModule.cpp @@ -113,8 +113,8 @@ nsGtkIMModule::nsGtkIMModule(nsWindow* aOwnerWindow) : #endif mDummyContext(nsnull), mCompositionStart(PR_UINT32_MAX), mProcessingKeyEvent(nsnull), - mIsComposing(PR_FALSE), mIsIMFocused(PR_FALSE), - mIgnoreNativeCompositionEvent(PR_FALSE) + mIsComposing(false), mIsIMFocused(false), + mIgnoreNativeCompositionEvent(false) { #ifdef PR_LOGGING if (!gGtkIMLog) { @@ -372,7 +372,7 @@ nsGtkIMModule::OnKeyEvent(nsWindow* aCaller, GdkEventKey* aEvent, NS_PRECONDITION(aEvent, "aEvent must be non-null"); if (!IsEditable() || NS_UNLIKELY(IsDestroyed())) { - return PR_FALSE; + return false; } PR_LOG(gGtkIMLog, PR_LOG_ALWAYS, @@ -389,18 +389,18 @@ nsGtkIMModule::OnKeyEvent(nsWindow* aCaller, GdkEventKey* aEvent, PR_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" FAILED, the caller isn't focused window, mLastFocusedWindow=%p", mLastFocusedWindow)); - return PR_FALSE; + return false; } GtkIMContext* im = GetContext(); if (NS_UNLIKELY(!im)) { PR_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" FAILED, there are no context")); - return PR_FALSE; + return false; } mKeyDownEventWasSent = aKeyDownEventWasSent; - mFilterKeyEvent = PR_TRUE; + mFilterKeyEvent = true; mProcessingKeyEvent = aEvent; gboolean isFiltered = gtk_im_context_filter_keypress(im, aEvent); mProcessingKeyEvent = nsnull; @@ -417,7 +417,7 @@ nsGtkIMModule::OnKeyEvent(nsWindow* aCaller, GdkEventKey* aEvent, if (!mDispatchedCompositionString.IsEmpty()) { // If there is composition string, we shouldn't dispatch // any keydown events during composition. - filterThisEvent = PR_TRUE; + filterThisEvent = true; } else { // A Hangul input engine for SCIM doesn't emit preedit_end // signal even when composition string becomes empty. On the @@ -427,12 +427,12 @@ nsGtkIMModule::OnKeyEvent(nsWindow* aCaller, GdkEventKey* aEvent, // compositionend event, however, we don't need to reset IM // actually. CommitCompositionBy(EmptyString()); - filterThisEvent = PR_FALSE; + filterThisEvent = false; } } else { // Key release event may not be consumed by IM, however, we // shouldn't dispatch any keyup event during composition. - filterThisEvent = PR_TRUE; + filterThisEvent = true; } } @@ -455,7 +455,7 @@ nsGtkIMModule::OnFocusChangeInGecko(bool aFocus) if (aFocus) { // If we failed to commit forcedely in previous focused editor, // we should reopen the gate for native signals in new focused editor. - mIgnoreNativeCompositionEvent = PR_FALSE; + mIgnoreNativeCompositionEvent = false; } } @@ -473,7 +473,7 @@ nsGtkIMModule::ResetIME() return; } - mIgnoreNativeCompositionEvent = PR_TRUE; + mIgnoreNativeCompositionEvent = true; gtk_im_context_reset(im); } @@ -626,10 +626,10 @@ nsGtkIMModule::SetInputMode(nsWindow* aCaller, const IMEContext* aContext) g_object_set(im, "hildon-input-mode", (HildonGtkInputMode)mode, NULL); - gIsVirtualKeyboardOpened = PR_TRUE; + gIsVirtualKeyboardOpened = true; hildon_gtk_im_context_show(im); } else { - gIsVirtualKeyboardOpened = PR_FALSE; + gIsVirtualKeyboardOpened = false; hildon_gtk_im_context_hide(im); } } @@ -673,7 +673,7 @@ nsGtkIMModule::IsVirtualKeyboardOpened() #ifdef MOZ_PLATFORM_MAEMO return gIsVirtualKeyboardOpened; #else - return PR_FALSE; + return false; #endif } @@ -738,7 +738,7 @@ nsGtkIMModule::Focus() sLastFocusedModule = this; gtk_im_context_focus_in(im); - mIsIMFocused = PR_TRUE; + mIsIMFocused = true; if (!IsEnabled()) { // We should release IME focus for uim and scim. @@ -766,7 +766,7 @@ nsGtkIMModule::Blur() } gtk_im_context_focus_out(im); - mIsIMFocused = PR_FALSE; + mIsIMFocused = false; } /* static */ @@ -827,7 +827,7 @@ nsGtkIMModule::OnEndCompositionNative(GtkIMContext *aContext) // because DispatchCompositionEnd() is called ourselves when we need to // commit the composition string *before* the focus moves completely. // Note that the native commit can be fired *after* ResetIME(). - mIgnoreNativeCompositionEvent = PR_FALSE; + mIgnoreNativeCompositionEvent = false; if (!mIsComposing || shouldIgnoreThisEvent) { // If we already handled the commit event, we should do nothing here. @@ -873,7 +873,7 @@ nsGtkIMModule::OnChangeCompositionNative(GtkIMContext *aContext) } // Be aware, widget can be gone - DispatchTextEvent(compositionString, PR_TRUE); + DispatchTextEvent(compositionString, true); } /* static */ @@ -1012,7 +1012,7 @@ nsGtkIMModule::OnCommitCompositionNative(GtkIMContext *aContext, PR_LOG(gGtkIMLog, PR_LOG_ALWAYS, ("GtkIMModule(%p): OnCommitCompositionNative, we'll send normal key event", this)); - mFilterKeyEvent = PR_FALSE; + mFilterKeyEvent = false; return; } } @@ -1030,8 +1030,8 @@ nsGtkIMModule::CommitCompositionBy(const nsAString& aString) this, NS_ConvertUTF16toUTF8(aString).get(), NS_ConvertUTF16toUTF8(mDispatchedCompositionString).get())); - if (!DispatchTextEvent(aString, PR_FALSE)) { - return PR_FALSE; + if (!DispatchTextEvent(aString, false)) { + return false; } // We should dispatch the compositionend event here because some IMEs // might not fire "preedit_end" native event. @@ -1069,17 +1069,17 @@ nsGtkIMModule::DispatchCompositionStart() if (mIsComposing) { PR_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" WARNING, we're already in composition")); - return PR_TRUE; + return true; } if (!mLastFocusedWindow) { PR_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" FAILED, there are no focused window in this module")); - return PR_FALSE; + return false; } nsEventStatus status; - nsQueryContentEvent selection(PR_TRUE, NS_QUERY_SELECTED_TEXT, + nsQueryContentEvent selection(true, NS_QUERY_SELECTED_TEXT, mLastFocusedWindow); InitEvent(selection); mLastFocusedWindow->DispatchEvent(&selection, status); @@ -1087,7 +1087,7 @@ nsGtkIMModule::DispatchCompositionStart() if (!selection.mSucceeded || selection.mReply.mOffset == PR_UINT32_MAX) { PR_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" FAILED, cannot query the selection offset")); - return PR_FALSE; + return false; } mCompositionStart = selection.mReply.mOffset; @@ -1107,20 +1107,20 @@ nsGtkIMModule::DispatchCompositionStart() kungFuDeathGrip != mLastFocusedWindow) { PR_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" NOTE, the focused widget was destroyed/changed by keydown event")); - return PR_FALSE; + return false; } } if (mIgnoreNativeCompositionEvent) { PR_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" WARNING, mIgnoreNativeCompositionEvent is already TRUE, but we forcedly reset")); - mIgnoreNativeCompositionEvent = PR_FALSE; + mIgnoreNativeCompositionEvent = false; } PR_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" mCompositionStart=%u", mCompositionStart)); - mIsComposing = PR_TRUE; - nsCompositionEvent compEvent(PR_TRUE, NS_COMPOSITION_START, + mIsComposing = true; + nsCompositionEvent compEvent(true, NS_COMPOSITION_START, mLastFocusedWindow); InitEvent(compEvent); nsCOMPtr kungFuDeathGrip = mLastFocusedWindow; @@ -1129,10 +1129,10 @@ nsGtkIMModule::DispatchCompositionStart() kungFuDeathGrip != mLastFocusedWindow) { PR_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" NOTE, the focused widget was destroyed/changed by compositionstart event")); - return PR_FALSE; + return false; } - return PR_TRUE; + return true; } bool @@ -1146,34 +1146,34 @@ nsGtkIMModule::DispatchCompositionEnd() if (!mIsComposing) { PR_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" WARNING, we have alrady finished the composition")); - return PR_FALSE; + return false; } if (!mLastFocusedWindow) { mDispatchedCompositionString.Truncate(); PR_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" FAILED, there are no focused window in this module")); - return PR_FALSE; + return false; } - nsCompositionEvent compEvent(PR_TRUE, NS_COMPOSITION_END, + nsCompositionEvent compEvent(true, NS_COMPOSITION_END, mLastFocusedWindow); InitEvent(compEvent); compEvent.data = mDispatchedCompositionString; nsEventStatus status; nsCOMPtr kungFuDeathGrip = mLastFocusedWindow; mLastFocusedWindow->DispatchEvent(&compEvent, status); - mIsComposing = PR_FALSE; + mIsComposing = false; mCompositionStart = PR_UINT32_MAX; mDispatchedCompositionString.Truncate(); if (static_cast(kungFuDeathGrip.get())->IsDestroyed() || kungFuDeathGrip != mLastFocusedWindow) { PR_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" NOTE, the focused widget was destroyed/changed by compositionend event")); - return PR_FALSE; + return false; } - return PR_TRUE; + return true; } bool @@ -1187,7 +1187,7 @@ nsGtkIMModule::DispatchTextEvent(const nsAString &aCompositionString, if (!mLastFocusedWindow) { PR_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" FAILED, there are no focused window in this module")); - return PR_FALSE; + return false; } if (!mIsComposing) { @@ -1195,7 +1195,7 @@ nsGtkIMModule::DispatchTextEvent(const nsAString &aCompositionString, (" The composition wasn't started, force starting...")); nsCOMPtr kungFuDeathGrip = mLastFocusedWindow; if (!DispatchCompositionStart()) { - return PR_FALSE; + return false; } } @@ -1203,7 +1203,7 @@ nsGtkIMModule::DispatchTextEvent(const nsAString &aCompositionString, nsRefPtr lastFocusedWindow = mLastFocusedWindow; if (aCompositionString != mDispatchedCompositionString) { - nsCompositionEvent compositionUpdate(PR_TRUE, NS_COMPOSITION_UPDATE, + nsCompositionEvent compositionUpdate(true, NS_COMPOSITION_UPDATE, mLastFocusedWindow); InitEvent(compositionUpdate); compositionUpdate.data = aCompositionString; @@ -1213,11 +1213,11 @@ nsGtkIMModule::DispatchTextEvent(const nsAString &aCompositionString, lastFocusedWindow != mLastFocusedWindow) { PR_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" NOTE, the focused widget was destroyed/changed by compositionupdate")); - return PR_FALSE; + return false; } } - nsTextEvent textEvent(PR_TRUE, NS_TEXT_TEXT, mLastFocusedWindow); + nsTextEvent textEvent(true, NS_TEXT_TEXT, mLastFocusedWindow); InitEvent(textEvent); PRUint32 targetOffset = mCompositionStart; @@ -1246,12 +1246,12 @@ nsGtkIMModule::DispatchTextEvent(const nsAString &aCompositionString, lastFocusedWindow != mLastFocusedWindow) { PR_LOG(gGtkIMLog, PR_LOG_ALWAYS, (" NOTE, the focused widget was destroyed/changed by text event")); - return PR_FALSE; + return false; } SetCursorPosition(targetOffset); - return PR_TRUE; + return true; } void @@ -1404,7 +1404,7 @@ nsGtkIMModule::SetCursorPosition(PRUint32 aTargetOffset) return; } - nsQueryContentEvent charRect(PR_TRUE, NS_QUERY_TEXT_RECT, + nsQueryContentEvent charRect(true, NS_QUERY_TEXT_RECT, mLastFocusedWindow); charRect.InitForQueryTextRect(aTargetOffset, 1); InitEvent(charRect); @@ -1451,7 +1451,7 @@ nsGtkIMModule::GetCurrentParagraph(nsAString& aText, PRUint32& aCursorPos) nsEventStatus status; // Query cursor position & selection - nsQueryContentEvent querySelectedTextEvent(PR_TRUE, + nsQueryContentEvent querySelectedTextEvent(true, NS_QUERY_SELECTED_TEXT, mLastFocusedWindow); mLastFocusedWindow->DispatchEvent(&querySelectedTextEvent, status); @@ -1474,7 +1474,7 @@ nsGtkIMModule::GetCurrentParagraph(nsAString& aText, PRUint32& aCursorPos) } // Get all text contents of the focused editor - nsQueryContentEvent queryTextContentEvent(PR_TRUE, + nsQueryContentEvent queryTextContentEvent(true, NS_QUERY_TEXT_CONTENT, mLastFocusedWindow); queryTextContentEvent.InitForQueryTextContent(0, PR_UINT32_MAX); @@ -1493,8 +1493,8 @@ nsGtkIMModule::GetCurrentParagraph(nsAString& aText, PRUint32& aCursorPos) // Get only the focused paragraph, by looking for newlines PRInt32 parStart = (selOffset == 0) ? 0 : - textContent.RFind("\n", PR_FALSE, selOffset - 1, -1) + 1; - PRInt32 parEnd = textContent.Find("\n", PR_FALSE, selOffset + selLength, -1); + textContent.RFind("\n", false, selOffset - 1, -1) + 1; + PRInt32 parEnd = textContent.Find("\n", false, selOffset + selLength, -1); if (parEnd < 0) { parEnd = textContent.Length(); } @@ -1523,24 +1523,24 @@ nsGtkIMModule::DeleteText(const PRInt32 aOffset, const PRUint32 aNChars) nsEventStatus status; // Query cursor position & selection - nsQueryContentEvent querySelectedTextEvent(PR_TRUE, + nsQueryContentEvent querySelectedTextEvent(true, NS_QUERY_SELECTED_TEXT, mLastFocusedWindow); mLastFocusedWindow->DispatchEvent(&querySelectedTextEvent, status); NS_ENSURE_TRUE(querySelectedTextEvent.mSucceeded, NS_ERROR_FAILURE); // Set selection to delete - nsSelectionEvent selectionEvent(PR_TRUE, NS_SELECTION_SET, + nsSelectionEvent selectionEvent(true, NS_SELECTION_SET, mLastFocusedWindow); selectionEvent.mOffset = querySelectedTextEvent.mReply.mOffset + aOffset; selectionEvent.mLength = aNChars; - selectionEvent.mReversed = PR_FALSE; - selectionEvent.mExpandToClusterBoundary = PR_FALSE; + selectionEvent.mReversed = false; + selectionEvent.mExpandToClusterBoundary = false; mLastFocusedWindow->DispatchEvent(&selectionEvent, status); NS_ENSURE_TRUE(selectionEvent.mSucceeded, NS_ERROR_FAILURE); // Delete the selection - nsContentCommandEvent contentCommandEvent(PR_TRUE, + nsContentCommandEvent contentCommandEvent(true, NS_CONTENT_COMMAND_DELETE, mLastFocusedWindow); mLastFocusedWindow->DispatchEvent(&contentCommandEvent, status); @@ -1564,7 +1564,7 @@ nsGtkIMModule::ShouldIgnoreNativeCompositionEvent() mIgnoreNativeCompositionEvent ? "YES" : "NO")); if (!mLastFocusedWindow) { - return PR_TRUE; // cannot continue + return true; // cannot continue } return mIgnoreNativeCompositionEvent; diff --git a/widget/src/gtk2/nsIdleServiceGTK.cpp b/widget/src/gtk2/nsIdleServiceGTK.cpp index 4ea499b3e372..eaa954596c66 100644 --- a/widget/src/gtk2/nsIdleServiceGTK.cpp +++ b/widget/src/gtk2/nsIdleServiceGTK.cpp @@ -91,7 +91,7 @@ static void Initialize() PR_LOG(sIdleLog, PR_LOG_WARNING, ("Failed to get XSSQueryInfo!\n")); #endif - sInitialized = PR_TRUE; + sInitialized = true; } nsIdleServiceGTK::nsIdleServiceGTK() diff --git a/widget/src/gtk2/nsImageToPixbuf.cpp b/widget/src/gtk2/nsImageToPixbuf.cpp index 32d05b405df6..4ff6128afc47 100644 --- a/widget/src/gtk2/nsImageToPixbuf.cpp +++ b/widget/src/gtk2/nsImageToPixbuf.cpp @@ -91,7 +91,7 @@ nsImageToPixbuf::ImageToPixbuf(imgIContainer* aImage) GdkPixbuf* nsImageToPixbuf::ImgSurfaceToPixbuf(gfxImageSurface* aImgSurface, PRInt32 aWidth, PRInt32 aHeight) { - GdkPixbuf* pixbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, PR_TRUE, 8, + GdkPixbuf* pixbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8, aWidth, aHeight); if (!pixbuf) return nsnull; diff --git a/widget/src/gtk2/nsLookAndFeel.cpp b/widget/src/gtk2/nsLookAndFeel.cpp index 09a2bfd01c00..f8b42da7bc44 100644 --- a/widget/src/gtk2/nsLookAndFeel.cpp +++ b/widget/src/gtk2/nsLookAndFeel.cpp @@ -86,7 +86,7 @@ nsLookAndFeel::nsLookAndFeel() : nsXPLookAndFeel() static bool sInitialized = false; if (!sInitialized) { - sInitialized = PR_TRUE; + sInitialized = true; InitLookAndFeel(); } } @@ -367,7 +367,7 @@ static void darken_gdk_color(GdkColor *src, GdkColor *dest) } static PRInt32 CheckWidgetStyle(GtkWidget* aWidget, const char* aStyle, PRInt32 aResult) { - gboolean value = PR_FALSE; + gboolean value = FALSE; gtk_widget_style_get(aWidget, aStyle, &value, NULL); return value ? aResult : 0; } @@ -813,8 +813,8 @@ nsLookAndFeel::RefreshImpl() bool nsLookAndFeel::GetEchoPasswordImpl() { #ifdef MOZ_PLATFORM_MAEMO - return PR_TRUE; + return true; #else - return PR_FALSE; + return false; #endif } diff --git a/widget/src/gtk2/nsNativeKeyBindings.cpp b/widget/src/gtk2/nsNativeKeyBindings.cpp index 4585002b803f..7501a70ab74e 100644 --- a/widget/src/gtk2/nsNativeKeyBindings.cpp +++ b/widget/src/gtk2/nsNativeKeyBindings.cpp @@ -56,7 +56,7 @@ copy_clipboard_cb(GtkWidget *w, gpointer user_data) { gCurrentCallback("cmd_copy", gCurrentCallbackData); g_signal_stop_emission_by_name(w, "copy_clipboard"); - gHandled = PR_TRUE; + gHandled = true; } static void @@ -64,7 +64,7 @@ cut_clipboard_cb(GtkWidget *w, gpointer user_data) { gCurrentCallback("cmd_cut", gCurrentCallbackData); g_signal_stop_emission_by_name(w, "cut_clipboard"); - gHandled = PR_TRUE; + gHandled = true; } // GTK distinguishes between display lines (wrapped, as they appear on the @@ -92,7 +92,7 @@ delete_from_cursor_cb(GtkWidget *w, GtkDeleteType del_type, gint count, gpointer user_data) { g_signal_stop_emission_by_name(w, "delete_from_cursor"); - gHandled = PR_TRUE; + gHandled = true; bool forward = count > 0; if (PRUint32(del_type) >= NS_ARRAY_LENGTH(sDeleteCommands)) { @@ -184,7 +184,7 @@ move_cursor_cb(GtkWidget *w, GtkMovementStep step, gint count, gboolean extend_selection, gpointer user_data) { g_signal_stop_emission_by_name(w, "move_cursor"); - gHandled = PR_TRUE; + gHandled = true; bool forward = count > 0; if (PRUint32(step) >= NS_ARRAY_LENGTH(sMoveCommands)) { // unsupported movement type @@ -207,7 +207,7 @@ paste_clipboard_cb(GtkWidget *w, gpointer user_data) { gCurrentCallback("cmd_paste", gCurrentCallbackData); g_signal_stop_emission_by_name(w, "paste_clipboard"); - gHandled = PR_TRUE; + gHandled = true; } // GtkTextView-only signals @@ -216,7 +216,7 @@ select_all_cb(GtkWidget *w, gboolean select, gpointer user_data) { gCurrentCallback("cmd_selectAll", gCurrentCallbackData); g_signal_stop_emission_by_name(w, "select_all"); - gHandled = PR_TRUE; + gHandled = true; } void @@ -266,7 +266,7 @@ bool nsNativeKeyBindings::KeyDown(const nsNativeKeyEvent& aEvent, DoCommandCallback aCallback, void *aCallbackData) { - return PR_FALSE; + return false; } bool @@ -281,12 +281,12 @@ nsNativeKeyBindings::KeyPress(const nsNativeKeyEvent& aEvent, keyCode = DOMKeyCodeToGdkKeyCode(aEvent.keyCode); if (KeyPressInternal(aEvent, aCallback, aCallbackData, keyCode)) - return PR_TRUE; + return true; nsKeyEvent *nativeKeyEvent = static_cast(aEvent.nativeEvent); if (!nativeKeyEvent || nativeKeyEvent->eventStructType != NS_KEY_EVENT && nativeKeyEvent->message != NS_KEY_PRESS) - return PR_FALSE; + return false; for (PRUint32 i = 0; i < nativeKeyEvent->alternativeCharCodes.Length(); ++i) { PRUint32 ch = nativeKeyEvent->isShift ? @@ -295,7 +295,7 @@ nsNativeKeyBindings::KeyPress(const nsNativeKeyEvent& aEvent, if (ch && ch != aEvent.charCode) { keyCode = gdk_unicode_to_keyval(ch); if (KeyPressInternal(aEvent, aCallback, aCallbackData, keyCode)) - return PR_TRUE; + return true; } } @@ -312,7 +312,7 @@ See bugs 411005 406407 static_cast(guiEvent->pluginEvent)); */ - return PR_FALSE; + return false; } bool @@ -333,7 +333,7 @@ nsNativeKeyBindings::KeyPressInternal(const nsNativeKeyEvent& aEvent, gCurrentCallback = aCallback; gCurrentCallbackData = aCallbackData; - gHandled = PR_FALSE; + gHandled = false; gtk_bindings_activate(GTK_OBJECT(mNativeTarget), aKeyCode, GdkModifierType(modifiers)); @@ -348,5 +348,5 @@ bool nsNativeKeyBindings::KeyUp(const nsNativeKeyEvent& aEvent, DoCommandCallback aCallback, void *aCallbackData) { - return PR_FALSE; + return false; } diff --git a/widget/src/gtk2/nsNativeThemeGTK.cpp b/widget/src/gtk2/nsNativeThemeGTK.cpp index e59afac44c94..b12d8384e29e 100644 --- a/widget/src/gtk2/nsNativeThemeGTK.cpp +++ b/widget/src/gtk2/nsNativeThemeGTK.cpp @@ -82,7 +82,7 @@ nsNativeThemeGTK::nsNativeThemeGTK() // We have to call moz_gtk_shutdown before the event loop stops running. nsCOMPtr obsServ = mozilla::services::GetObserverService(); - obsServ->AddObserver(this, "xpcom-shutdown", PR_FALSE); + obsServ->AddObserver(this, "xpcom-shutdown", false); memset(mDisabledWidgetTypes, 0, sizeof(mDisabledWidgetTypes)); memset(mSafeWidgetStates, 0, sizeof(mSafeWidgetStates)); @@ -304,14 +304,14 @@ nsNativeThemeGTK::GetGtkWidgetAndState(PRUint8 aWidgetType, nsIFrame* aFrame, (curpos == maxpos && (aWidgetType == NS_THEME_SCROLLBAR_BUTTON_DOWN || aWidgetType == NS_THEME_SCROLLBAR_BUTTON_RIGHT))) - aState->disabled = PR_TRUE; + aState->disabled = true; // In order to simulate native GTK scrollbar click behavior, // we set the active attribute on the element to true if it's // pressed with any mouse button. // This allows us to show that it's active without setting :active else if (CheckBooleanAttr(aFrame, nsWidgetAtoms::active)) - aState->active = PR_TRUE; + aState->active = true; if (aWidgetFlags) { *aWidgetFlags = GetScrollbarButtonType(aFrame); @@ -466,9 +466,9 @@ nsNativeThemeGTK::GetGtkWidgetAndState(PRUint8 aWidgetType, nsIFrame* aFrame, if (aWidgetFlags) { // In this case, the flag denotes whether the header is the sorted one or not if (GetTreeSortDirection(aFrame) == eTreeSortDirection_Natural) - *aWidgetFlags = PR_FALSE; + *aWidgetFlags = false; else - *aWidgetFlags = PR_TRUE; + *aWidgetFlags = true; } aGtkWidgetType = MOZ_GTK_TREE_HEADER_CELL; break; @@ -490,7 +490,7 @@ nsNativeThemeGTK::GetGtkWidgetAndState(PRUint8 aWidgetType, nsIFrame* aFrame, #if GTK_CHECK_VERSION(2,10,0) *aWidgetFlags = GTK_ARROW_NONE; #else - return PR_FALSE; // Don't draw when we shouldn't + return false; // Don't draw when we shouldn't #endif // GTK_CHECK_VERSION(2,10,0) break; } @@ -513,7 +513,7 @@ nsNativeThemeGTK::GetGtkWidgetAndState(PRUint8 aWidgetType, nsIFrame* aFrame, *aWidgetFlags = IsFrameContentNodeInNamespace(aFrame, kNameSpaceID_XHTML); break; case NS_THEME_DROPDOWN_TEXT: - return PR_FALSE; // nothing to do, but prevents the bg from being drawn + return false; // nothing to do, but prevents the bg from being drawn case NS_THEME_DROPDOWN_TEXTFIELD: aGtkWidgetType = MOZ_GTK_DROPDOWN_ENTRY; break; @@ -642,10 +642,10 @@ nsNativeThemeGTK::GetGtkWidgetAndState(PRUint8 aWidgetType, nsIFrame* aFrame, aGtkWidgetType = MOZ_GTK_WINDOW; break; default: - return PR_FALSE; + return false; } - return PR_TRUE; + return true; } class ThemeRenderer : public gfxGdkNativeRenderer { @@ -703,10 +703,10 @@ nsNativeThemeGTK::GetExtraSizeForWidget(nsIFrame* aFrame, PRUint8 aWidgetType, switch (aWidgetType) { case NS_THEME_SCROLLBAR_THUMB_VERTICAL: aExtra->top = aExtra->bottom = 1; - return PR_TRUE; + return true; case NS_THEME_SCROLLBAR_THUMB_HORIZONTAL: aExtra->left = aExtra->right = 1; - return PR_TRUE; + return true; // Include the indicator spacing (the padding around the control). case NS_THEME_CHECKBOX: @@ -724,7 +724,7 @@ nsNativeThemeGTK::GetExtraSizeForWidget(nsIFrame* aFrame, PRUint8 aWidgetType, aExtra->right = indicator_spacing; aExtra->bottom = indicator_spacing; aExtra->left = indicator_spacing; - return PR_TRUE; + return true; } case NS_THEME_BUTTON : { @@ -737,19 +737,19 @@ nsNativeThemeGTK::GetExtraSizeForWidget(nsIFrame* aFrame, PRUint8 aWidgetType, aExtra->right = right; aExtra->bottom = bottom; aExtra->left = left; - return PR_TRUE; + return true; } } case NS_THEME_TAB : { if (!IsSelectedTab(aFrame)) - return PR_FALSE; + return false; gint gap_height = moz_gtk_get_tab_thickness(); PRInt32 extra = gap_height - GetTabMarginPixels(aFrame); if (extra <= 0) - return PR_FALSE; + return false; if (IsBottomTab(aFrame)) { aExtra->top = extra; @@ -758,7 +758,7 @@ nsNativeThemeGTK::GetExtraSizeForWidget(nsIFrame* aFrame, PRUint8 aWidgetType, } } default: - return PR_FALSE; + return false; } } @@ -975,14 +975,14 @@ nsNativeThemeGTK::GetWidgetPadding(nsDeviceContext* aContext, case NS_THEME_CHECKBOX: case NS_THEME_RADIO: aResult->SizeTo(0, 0, 0, 0); - return PR_TRUE; + return true; case NS_THEME_MENUITEM: case NS_THEME_CHECKMENUITEM: case NS_THEME_RADIOMENUITEM: { // Menubar and menulist have their padding specified in CSS. if (!IsRegularMenuItem(aFrame)) - return PR_FALSE; + return false; aResult->SizeTo(0, 0, 0, 0); GtkThemeWidgetType gtkWidgetType; @@ -1003,11 +1003,11 @@ nsNativeThemeGTK::GetWidgetPadding(nsDeviceContext* aContext, aResult->left += horizontal_padding; aResult->right += horizontal_padding; - return PR_TRUE; + return true; } } - return PR_FALSE; + return false; } bool @@ -1019,7 +1019,7 @@ nsNativeThemeGTK::GetWidgetOverflow(nsDeviceContext* aContext, PRInt32 p2a; nsIntMargin extraSize; if (!GetExtraSizeForWidget(aFrame, aWidgetType, &extraSize)) - return PR_FALSE; + return false; p2a = aContext->AppUnitsPerDevPixel(); m = nsMargin(NSIntPixelsToAppUnits(extraSize.left, p2a), @@ -1028,7 +1028,7 @@ nsNativeThemeGTK::GetWidgetOverflow(nsDeviceContext* aContext, NSIntPixelsToAppUnits(extraSize.bottom, p2a)); aOverflowRect->Inflate(m); - return PR_TRUE; + return true; } NS_IMETHODIMP @@ -1037,7 +1037,7 @@ nsNativeThemeGTK::GetMinimumWidgetSize(nsRenderingContext* aContext, nsIntSize* aResult, bool* aIsOverridable) { aResult->width = aResult->height = 0; - *aIsOverridable = PR_TRUE; + *aIsOverridable = true; switch (aWidgetType) { case NS_THEME_SCROLLBAR_BUTTON_UP: @@ -1048,7 +1048,7 @@ nsNativeThemeGTK::GetMinimumWidgetSize(nsRenderingContext* aContext, aResult->width = metrics.slider_width; aResult->height = metrics.stepper_size; - *aIsOverridable = PR_FALSE; + *aIsOverridable = false; } break; case NS_THEME_SCROLLBAR_BUTTON_LEFT: @@ -1059,7 +1059,7 @@ nsNativeThemeGTK::GetMinimumWidgetSize(nsRenderingContext* aContext, aResult->width = metrics.stepper_size; aResult->height = metrics.slider_width; - *aIsOverridable = PR_FALSE; + *aIsOverridable = false; } break; case NS_THEME_SPLITTER: @@ -1074,7 +1074,7 @@ nsNativeThemeGTK::GetMinimumWidgetSize(nsRenderingContext* aContext, aResult->width = 0; aResult->height = metrics; } - *aIsOverridable = PR_FALSE; + *aIsOverridable = false; } break; case NS_THEME_SCROLLBAR_TRACK_HORIZONTAL: @@ -1093,7 +1093,7 @@ nsNativeThemeGTK::GetMinimumWidgetSize(nsRenderingContext* aContext, else aResult->height = metrics.slider_width; - *aIsOverridable = PR_FALSE; + *aIsOverridable = false; } break; case NS_THEME_SCROLLBAR_THUMB_VERTICAL: @@ -1109,7 +1109,7 @@ nsNativeThemeGTK::GetMinimumWidgetSize(nsRenderingContext* aContext, /* Get the available space, if that is smaller then the minimum size, * adjust the mininum size to fit into it. - * Setting aIsOverridable to PR_TRUE has no effect for thumbs. */ + * Setting aIsOverridable to true has no effect for thumbs. */ aFrame->GetMargin(margin); rect.Deflate(margin); aFrame->GetParent()->GetBorderAndPadding(margin); @@ -1125,7 +1125,7 @@ nsNativeThemeGTK::GetMinimumWidgetSize(nsRenderingContext* aContext, metrics.min_slider_size); } - *aIsOverridable = PR_FALSE; + *aIsOverridable = false; } break; case NS_THEME_SCALE_THUMB_HORIZONTAL: @@ -1143,21 +1143,21 @@ nsNativeThemeGTK::GetMinimumWidgetSize(nsRenderingContext* aContext, aResult->height = thumb_height; } - *aIsOverridable = PR_FALSE; + *aIsOverridable = false; } break; case NS_THEME_TAB_SCROLLARROW_BACK: case NS_THEME_TAB_SCROLLARROW_FORWARD: { moz_gtk_get_tab_scroll_arrow_size(&aResult->width, &aResult->height); - *aIsOverridable = PR_FALSE; + *aIsOverridable = false; } break; case NS_THEME_DROPDOWN_BUTTON: { moz_gtk_get_combo_box_entry_button_size(&aResult->width, &aResult->height); - *aIsOverridable = PR_FALSE; + *aIsOverridable = false; } break; case NS_THEME_MENUSEPARATOR: @@ -1167,7 +1167,7 @@ nsNativeThemeGTK::GetMinimumWidgetSize(nsRenderingContext* aContext, moz_gtk_get_menu_separator_height(&separator_height); aResult->height = separator_height; - *aIsOverridable = PR_FALSE; + *aIsOverridable = false; } break; case NS_THEME_CHECKBOX: @@ -1184,7 +1184,7 @@ nsNativeThemeGTK::GetMinimumWidgetSize(nsRenderingContext* aContext, // Include space for the indicator and the padding around it. aResult->width = indicator_size; aResult->height = indicator_size; - *aIsOverridable = PR_FALSE; + *aIsOverridable = false; } break; case NS_THEME_TOOLBAR_BUTTON_DROPDOWN: @@ -1194,7 +1194,7 @@ nsNativeThemeGTK::GetMinimumWidgetSize(nsRenderingContext* aContext, case NS_THEME_BUTTON_ARROW_PREVIOUS: { moz_gtk_get_arrow_size(&aResult->width, &aResult->height); - *aIsOverridable = PR_FALSE; + *aIsOverridable = false; } break; case NS_THEME_CHECKBOX_CONTAINER: @@ -1238,7 +1238,7 @@ nsNativeThemeGTK::GetMinimumWidgetSize(nsRenderingContext* aContext, case NS_THEME_RESIZER: // same as Windows to make our lives easier aResult->width = aResult->height = 15; - *aIsOverridable = PR_FALSE; + *aIsOverridable = false; break; case NS_THEME_TREEVIEW_TWISTY: case NS_THEME_TREEVIEW_TWISTY_OPEN: @@ -1247,7 +1247,7 @@ nsNativeThemeGTK::GetMinimumWidgetSize(nsRenderingContext* aContext, moz_gtk_get_treeview_expander_size(&expander_size); aResult->width = aResult->height = expander_size; - *aIsOverridable = PR_FALSE; + *aIsOverridable = false; } break; } @@ -1274,7 +1274,7 @@ nsNativeThemeGTK::WidgetStateChanged(nsIFrame* aFrame, PRUint8 aWidgetType, aWidgetType == NS_THEME_MENUSEPARATOR || aWidgetType == NS_THEME_WINDOW || aWidgetType == NS_THEME_DIALOG) { - *aShouldRepaint = PR_FALSE; + *aShouldRepaint = false; return NS_OK; } @@ -1284,7 +1284,7 @@ nsNativeThemeGTK::WidgetStateChanged(nsIFrame* aFrame, PRUint8 aWidgetType, aWidgetType == NS_THEME_SCROLLBAR_BUTTON_RIGHT) && (aAttribute == nsWidgetAtoms::curpos || aAttribute == nsWidgetAtoms::maxpos)) { - *aShouldRepaint = PR_TRUE; + *aShouldRepaint = true; return NS_OK; } @@ -1293,12 +1293,12 @@ nsNativeThemeGTK::WidgetStateChanged(nsIFrame* aFrame, PRUint8 aWidgetType, // For example, a toolbar doesn't care about any states. if (!aAttribute) { // Hover/focus/active changed. Always repaint. - *aShouldRepaint = PR_TRUE; + *aShouldRepaint = true; } else { // Check the attribute to see if it's relevant. // disabled, checked, dlgtype, default, etc. - *aShouldRepaint = PR_FALSE; + *aShouldRepaint = false; if (aAttribute == nsWidgetAtoms::disabled || aAttribute == nsWidgetAtoms::checked || aAttribute == nsWidgetAtoms::selected || @@ -1308,7 +1308,7 @@ nsNativeThemeGTK::WidgetStateChanged(nsIFrame* aFrame, PRUint8 aWidgetType, aAttribute == nsWidgetAtoms::mozmenuactive || aAttribute == nsWidgetAtoms::open || aAttribute == nsWidgetAtoms::parentfocused) - *aShouldRepaint = PR_TRUE; + *aShouldRepaint = true; } return NS_OK; @@ -1329,7 +1329,7 @@ nsNativeThemeGTK::ThemeSupportsWidget(nsPresContext* aPresContext, PRUint8 aWidgetType) { if (IsWidgetTypeDisabled(mDisabledWidgetTypes, aWidgetType)) - return PR_FALSE; + return false; switch (aWidgetType) { case NS_THEME_BUTTON: @@ -1422,7 +1422,7 @@ nsNativeThemeGTK::ThemeSupportsWidget(nsPresContext* aPresContext, } - return PR_FALSE; + return false; } NS_IMETHODIMP_(bool) @@ -1438,8 +1438,8 @@ nsNativeThemeGTK::WidgetIsContainer(PRUint8 aWidgetType) aWidgetType == NS_THEME_BUTTON_ARROW_DOWN || aWidgetType == NS_THEME_BUTTON_ARROW_NEXT || aWidgetType == NS_THEME_BUTTON_ARROW_PREVIOUS) - return PR_FALSE; - return PR_TRUE; + return false; + return true; } bool @@ -1448,15 +1448,15 @@ nsNativeThemeGTK::ThemeDrawsFocusForWidget(nsPresContext* aPresContext, nsIFrame if (aWidgetType == NS_THEME_DROPDOWN || aWidgetType == NS_THEME_BUTTON || aWidgetType == NS_THEME_TREEVIEW_HEADER_CELL) - return PR_TRUE; + return true; - return PR_FALSE; + return false; } bool nsNativeThemeGTK::ThemeNeedsComboboxDropmarker() { - return PR_FALSE; + return false; } nsITheme::Transparency diff --git a/widget/src/gtk2/nsPSPrinters.cpp b/widget/src/gtk2/nsPSPrinters.cpp index 34ecdd72f4d7..f61be591cda4 100644 --- a/widget/src/gtk2/nsPSPrinters.cpp +++ b/widget/src/gtk2/nsPSPrinters.cpp @@ -74,7 +74,7 @@ nsPSPrinterList::Enabled() { const char *val = PR_GetEnv("MOZILLA_POSTSCRIPT_ENABLED"); if (val && (val[0] == '0' || !PL_strcasecmp(val, "false"))) - return PR_FALSE; + return false; // is the PS module enabled? return Preferences::GetBool("print.postscript.enabled", true); diff --git a/widget/src/gtk2/nsPSPrinters.h b/widget/src/gtk2/nsPSPrinters.h index 9845e53c194c..e82384861400 100644 --- a/widget/src/gtk2/nsPSPrinters.h +++ b/widget/src/gtk2/nsPSPrinters.h @@ -51,8 +51,8 @@ class nsPSPrinterList { /** * Is the PostScript module enabled or disabled? - * @return PR_TRUE if enabled, - * PR_FALSE if not. + * @return true if enabled, + * false if not. */ bool Enabled(); diff --git a/widget/src/gtk2/nsPaperPS.cpp b/widget/src/gtk2/nsPaperPS.cpp index 06488c232095..a50243a5eba1 100644 --- a/widget/src/gtk2/nsPaperPS.cpp +++ b/widget/src/gtk2/nsPaperPS.cpp @@ -47,13 +47,13 @@ const nsPaperSizePS_ nsPaperSizePS::mList[] = { #define SIZE_MM(x) (x) #define SIZE_INCH(x) ((x) * MM_PER_INCH_FLOAT) - { "A5", SIZE_MM(148), SIZE_MM(210), PR_TRUE }, - { "A4", SIZE_MM(210), SIZE_MM(297), PR_TRUE }, - { "A3", SIZE_MM(297), SIZE_MM(420), PR_TRUE }, - { "Letter", SIZE_INCH(8.5), SIZE_INCH(11), PR_FALSE }, - { "Legal", SIZE_INCH(8.5), SIZE_INCH(14), PR_FALSE }, - { "Tabloid", SIZE_INCH(11), SIZE_INCH(17), PR_FALSE }, - { "Executive", SIZE_INCH(7.5), SIZE_INCH(10), PR_FALSE }, + { "A5", SIZE_MM(148), SIZE_MM(210), true }, + { "A4", SIZE_MM(210), SIZE_MM(297), true }, + { "A3", SIZE_MM(297), SIZE_MM(420), true }, + { "Letter", SIZE_INCH(8.5), SIZE_INCH(11), false }, + { "Legal", SIZE_INCH(8.5), SIZE_INCH(14), false }, + { "Tabloid", SIZE_INCH(11), SIZE_INCH(17), false }, + { "Executive", SIZE_INCH(7.5), SIZE_INCH(10), false }, #undef SIZE_INCH #undef SIZE_MM }; @@ -66,8 +66,8 @@ nsPaperSizePS::Find(const char *aName) for (int i = mCount; i--; ) { if (!PL_strcasecmp(aName, mList[i].name)) { mCurrent = i; - return PR_TRUE; + return true; } } - return PR_FALSE; + return false; } diff --git a/widget/src/gtk2/nsPaperPS.h b/widget/src/gtk2/nsPaperPS.h index cd48cc685014..7e3716d2691d 100644 --- a/widget/src/gtk2/nsPaperPS.h +++ b/widget/src/gtk2/nsPaperPS.h @@ -58,7 +58,7 @@ class nsPaperSizePS { nsPaperSizePS() { mCurrent = 0; } /** --------------------------------------------------- - * @return PR_TRUE if the cursor points past the last item. + * @return true if the cursor points past the last item. */ bool AtEnd() { return mCurrent >= mCount; } @@ -79,7 +79,7 @@ class nsPaperSizePS { /** --------------------------------------------------- * Point the cursor to the entry with the given paper name. - * @return PR_TRUE if pointing to a valid entry. + * @return true if pointing to a valid entry. */ bool Find(const char *aName); @@ -108,7 +108,7 @@ class nsPaperSizePS { } /** --------------------------------------------------- - * @return PR_TRUE if the paper should be presented to + * @return true if the paper should be presented to * the user in metric units. */ bool IsMetric() { diff --git a/widget/src/gtk2/nsPrintDialogGTK.cpp b/widget/src/gtk2/nsPrintDialogGTK.cpp index 1d97a0c02c48..4ee04db371e7 100644 --- a/widget/src/gtk2/nsPrintDialogGTK.cpp +++ b/widget/src/gtk2/nsPrintDialogGTK.cpp @@ -270,14 +270,14 @@ nsPrintDialogWidgetGTK::nsPrintDialogWidgetGTK(nsIDOMWindow *aParent, nsIPrintSe aSettings->GetPrintOptions(nsIPrintSettings::kEnableSelectionRB, &canSelectText); if (gtk_major_version > 2 || (gtk_major_version == 2 && gtk_minor_version >= 18)) { - useNativeSelection = PR_TRUE; + useNativeSelection = true; g_object_set(dialog, "support-selection", TRUE, "has-selection", canSelectText, "embed-page-setup", TRUE, NULL); } else { - useNativeSelection = PR_FALSE; + useNativeSelection = false; selection_only_toggle = gtk_check_button_new_with_mnemonic(GetUTF8FromBundle("selectionOnly").get()); gtk_widget_set_sensitive(selection_only_toggle, canSelectText); gtk_box_pack_start(GTK_BOX(check_buttons_container), selection_only_toggle, FALSE, FALSE, 0); @@ -479,7 +479,7 @@ nsPrintDialogWidgetGTK::ExportSettings(nsIPrintSettings *aNSSettings) // Print-to-file is true by default. This must be turned off or else printing won't occur! // (We manually copy the spool file when this flag is set, because we love our embedders) // Even if it is print-to-file in GTK's case, GTK does The Right Thing when we send the job. - aNSSettings->SetPrintToFile(PR_FALSE); + aNSSettings->SetPrintToFile(false); aNSSettings->SetShrinkToFit(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(shrink_to_fit_toggle))); @@ -528,7 +528,7 @@ nsPrintDialogWidgetGTK::ConstructHeaderFooterDropdown(const PRUnichar *currentSt if (!strcmp(currentStringUTF8.get(), header_footer_tags[i])) { gtk_combo_box_set_active(GTK_COMBO_BOX(dropdown), i); g_object_set_data(G_OBJECT(dropdown), "previous-active", GINT_TO_POINTER(i)); - shouldBeCustom = PR_FALSE; + shouldBeCustom = false; break; } } @@ -621,7 +621,7 @@ nsPrintDialogServiceGTK::ShowPageSetup(nsIDOMWindow *aParent, psService->GetDefaultPrinterName(getter_Copies(printName)); aNSSettings->SetPrinterName(printName.get()); } - psService->InitPrintSettingsFromPrefs(aNSSettings, PR_TRUE, nsIPrintSettings::kInitSaveAll); + psService->InitPrintSettingsFromPrefs(aNSSettings, true, nsIPrintSettings::kInitSaveAll); } GtkPrintSettings* gtkSettings = aNSSettingsGTK->GetGtkPrintSettings(); @@ -636,7 +636,7 @@ nsPrintDialogServiceGTK::ShowPageSetup(nsIDOMWindow *aParent, g_object_unref(newPageSetup); if (psService) - psService->SavePrintSettingsToPrefs(aNSSettings, PR_TRUE, nsIPrintSettings::kInitSaveAll); + psService->SavePrintSettingsToPrefs(aNSSettings, true, nsIPrintSettings::kInitSaveAll); return NS_OK; } diff --git a/widget/src/gtk2/nsPrintSettingsGTK.cpp b/widget/src/gtk2/nsPrintSettingsGTK.cpp index 806d2ed42271..0ec3b03371f6 100644 --- a/widget/src/gtk2/nsPrintSettingsGTK.cpp +++ b/widget/src/gtk2/nsPrintSettingsGTK.cpp @@ -77,7 +77,7 @@ nsPrintSettingsGTK::nsPrintSettingsGTK() : mPageSetup(NULL), mPrintSettings(NULL), mGTKPrinter(NULL), - mPrintSelectionOnly(PR_FALSE) + mPrintSelectionOnly(false) { // The aim here is to set up the objects enough that silent printing works well. // These will be replaced anyway if the print dialog is used. @@ -118,7 +118,7 @@ nsPrintSettingsGTK::nsPrintSettingsGTK(const nsPrintSettingsGTK& aPS) : mPageSetup(NULL), mPrintSettings(NULL), mGTKPrinter(NULL), - mPrintSelectionOnly(PR_FALSE) + mPrintSelectionOnly(false) { *this = aPS; } @@ -258,11 +258,11 @@ NS_IMETHODIMP nsPrintSettingsGTK::GetPrintRange(PRInt16 *aPrintRange) NS_IMETHODIMP nsPrintSettingsGTK::SetPrintRange(PRInt16 aPrintRange) { if (aPrintRange == kRangeSelection) { - mPrintSelectionOnly = PR_TRUE; + mPrintSelectionOnly = true; return NS_OK; } - mPrintSelectionOnly = PR_FALSE; + mPrintSelectionOnly = false; if (aPrintRange == kRangeSpecifiedPageRange) gtk_print_settings_set_print_pages(mPrintSettings, GTK_PRINT_PAGES_RANGES); else @@ -448,7 +448,7 @@ nsPrintSettingsGTK::SetToFileName(const PRUnichar * aToFileName) } nsCOMPtr file; - nsresult rv = NS_NewLocalFile(nsDependentString(aToFileName), PR_TRUE, + nsresult rv = NS_NewLocalFile(nsDependentString(aToFileName), true, getter_AddRefs(file)); NS_ENSURE_SUCCESS(rv, rv); @@ -497,8 +497,8 @@ nsPrintSettingsGTK::SetPrinterName(const PRUnichar * aPrinter) // the name passed to this function. const char* oldPrinterName = gtk_print_settings_get_printer(mPrintSettings); if (!oldPrinterName || !gtkPrinter.Equals(oldPrinterName)) { - mIsInitedFromPrinter = PR_FALSE; - mIsInitedFromPrefs = PR_FALSE; + mIsInitedFromPrinter = false; + mIsInitedFromPrefs = false; gtk_print_settings_set_printer(mPrintSettings, gtkPrinter.get()); } diff --git a/widget/src/gtk2/nsSound.cpp b/widget/src/gtk2/nsSound.cpp index e7a7c7145155..6a9e0fd6952d 100644 --- a/widget/src/gtk2/nsSound.cpp +++ b/widget/src/gtk2/nsSound.cpp @@ -121,7 +121,7 @@ NS_IMPL_ISUPPORTS2(nsSound, nsISound, nsIStreamLoaderObserver) //////////////////////////////////////////////////////////////////////// nsSound::nsSound() { - mInited = PR_FALSE; + mInited = false; } nsSound::~nsSound() @@ -136,7 +136,7 @@ nsSound::Init() if (mInited) return NS_OK; - mInited = PR_TRUE; + mInited = true; if (!elib) { elib = PR_LoadLibrary("libesd.so.0"); @@ -504,7 +504,7 @@ NS_IMETHODIMP nsSound::PlaySystemSound(const nsAString &aSoundAlias) // create a nsILocalFile and then a nsIFileURL from that nsCOMPtr soundFile; - rv = NS_NewLocalFile(aSoundAlias, PR_TRUE, + rv = NS_NewLocalFile(aSoundAlias, true, getter_AddRefs(soundFile)); NS_ENSURE_SUCCESS(rv,rv); diff --git a/widget/src/gtk2/nsWindow.cpp b/widget/src/gtk2/nsWindow.cpp index 482af40642a9..03b81d46191d 100644 --- a/widget/src/gtk2/nsWindow.cpp +++ b/widget/src/gtk2/nsWindow.cpp @@ -400,23 +400,23 @@ GetBitmapStride(PRInt32 width) nsWindow::nsWindow() { - mIsTopLevel = PR_FALSE; - mIsDestroyed = PR_FALSE; - mNeedsResize = PR_FALSE; - mNeedsMove = PR_FALSE; - mListenForResizes = PR_FALSE; - mIsShown = PR_FALSE; - mNeedsShow = PR_FALSE; - mEnabled = PR_TRUE; - mCreated = PR_FALSE; + mIsTopLevel = false; + mIsDestroyed = false; + mNeedsResize = false; + mNeedsMove = false; + mListenForResizes = false; + mIsShown = false; + mNeedsShow = false; + mEnabled = true; + mCreated = false; mContainer = nsnull; mGdkWindow = nsnull; mShell = nsnull; mWindowGroup = nsnull; - mHasMappedToplevel = PR_FALSE; - mIsFullyObscured = PR_FALSE; - mRetryPointerGrab = PR_FALSE; + mHasMappedToplevel = false; + mIsFullyObscured = false; + mRetryPointerGrab = false; mTransientParent = nsnull; mWindowType = eWindowType_child; mSizeState = nsSizeMode_Normal; @@ -428,7 +428,7 @@ nsWindow::nsWindow() mPluginType = PluginType_NONE; if (!gGlobalsInitialized) { - gGlobalsInitialized = PR_TRUE; + gGlobalsInitialized = true; // It's OK if either of these fail, but it may not be one day. initialize_prefs(); @@ -440,7 +440,7 @@ nsWindow::nsWindow() mRootAccessible = nsnull; #endif - mIsTransparent = PR_FALSE; + mIsTransparent = false; mTransparencyBitmap = nsnull; mTransparencyBitmapWidth = 0; @@ -497,7 +497,7 @@ nsWindow::CommonCreate(nsIWidget *aParent, bool aListenForResizes) { mParent = aParent; mListenForResizes = aListenForResizes; - mCreated = PR_TRUE; + mCreated = true; } void @@ -556,7 +556,7 @@ nsWindow::InitKeyEvent(nsKeyEvent &aEvent, GdkEventKey *aGdkEvent) void nsWindow::DispatchResizeEvent(nsIntRect &aRect, nsEventStatus &aStatus) { - nsSizeEvent event(PR_TRUE, NS_SIZE, this); + nsSizeEvent event(true, NS_SIZE, this); event.windowSize = &aRect; event.refPoint.x = aRect.x; @@ -577,7 +577,7 @@ nsWindow::DispatchActivateEvent(void) #ifdef ACCESSIBILITY DispatchActivateEventAccessible(); #endif //ACCESSIBILITY - nsGUIEvent event(PR_TRUE, NS_ACTIVATE, this); + nsGUIEvent event(true, NS_ACTIVATE, this); nsEventStatus status; DispatchEvent(&event, status); } @@ -585,7 +585,7 @@ nsWindow::DispatchActivateEvent(void) void nsWindow::DispatchDeactivateEvent(void) { - nsGUIEvent event(PR_TRUE, NS_DEACTIVATE, this); + nsGUIEvent event(true, NS_DEACTIVATE, this); nsEventStatus status; DispatchEvent(&event, status); @@ -619,7 +619,7 @@ nsWindow::OnDestroy(void) if (mOnDestroyCalled) return; - mOnDestroyCalled = PR_TRUE; + mOnDestroyCalled = true; // Prevent deletion. nsCOMPtr kungFuDeathGrip = this; @@ -631,7 +631,7 @@ nsWindow::OnDestroy(void) nsBaseWidget::Destroy(); mParent = nsnull; - nsGUIEvent event(PR_TRUE, NS_DESTROY, this); + nsGUIEvent event(true, NS_DESTROY, this); nsEventStatus status; DispatchEvent(&event, status); } @@ -640,9 +640,9 @@ bool nsWindow::AreBoundsSane(void) { if (mBounds.width > 0 && mBounds.height > 0) - return PR_TRUE; + return true; - return PR_FALSE; + return false; } static GtkWidget* @@ -741,8 +741,8 @@ nsWindow::Destroy(void) return NS_OK; LOG(("nsWindow::Destroy [%p]\n", (void *)this)); - mIsDestroyed = PR_TRUE; - mCreated = PR_FALSE; + mIsDestroyed = true; + mCreated = false; /** Need to clean our LayerManager up while still alive */ if (mLayerManager) { @@ -776,7 +776,7 @@ nsWindow::Destroy(void) gRollupListener = nsnull; } - NativeShow(PR_FALSE); + NativeShow(false); if (mIMModule) { mIMModule->OnDestroyWindow(this); @@ -1094,22 +1094,22 @@ nsWindow::Show(bool aState) // and return. if ((aState && !AreBoundsSane()) || !mCreated) { LOG(("\tbounds are insane or window hasn't been created yet\n")); - mNeedsShow = PR_TRUE; + mNeedsShow = true; return NS_OK; } // If someone is hiding this widget, clear any needing show flag. if (!aState) - mNeedsShow = PR_FALSE; + mNeedsShow = false; // If someone is showing this window and it needs a resize then // resize the widget. if (aState) { if (mNeedsMove) { NativeResize(mBounds.x, mBounds.y, mBounds.width, mBounds.height, - PR_FALSE); + false); } else if (mNeedsResize) { - NativeResize(mBounds.width, mBounds.height, PR_FALSE); + NativeResize(mBounds.width, mBounds.height, false); } } @@ -1159,18 +1159,18 @@ nsWindow::Resize(PRInt32 aWidth, PRInt32 aHeight, bool aRepaint) // Does it need to be shown because it was previously insane? if (mNeedsShow) - NativeShow(PR_TRUE); + NativeShow(true); } else { // If someone has set this so that the needs show flag is false // and it needs to be hidden, update the flag and hide the // window. This flag will be cleared the next time someone // hides the window or shows it. It also prevents us from - // calling NativeShow(PR_FALSE) excessively on the window which + // calling NativeShow(false) excessively on the window which // causes unneeded X traffic. if (!mNeedsShow) { - mNeedsShow = PR_TRUE; - NativeShow(PR_FALSE); + mNeedsShow = true; + NativeShow(false); } } } @@ -1184,7 +1184,7 @@ nsWindow::Resize(PRInt32 aWidth, PRInt32 aHeight, bool aRepaint) NativeResize(aWidth, aHeight, aRepaint); } else { - mNeedsResize = PR_TRUE; + mNeedsResize = true; } } @@ -1206,7 +1206,7 @@ nsWindow::Resize(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight, mBounds.y = aY; mBounds.SizeTo(GetSafeWindowSize(nsIntSize(aWidth, aHeight))); - mNeedsMove = PR_TRUE; + mNeedsMove = true; if (!mCreated) return NS_OK; @@ -1223,18 +1223,18 @@ nsWindow::Resize(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight, NativeResize(aX, aY, aWidth, aHeight, aRepaint); // Does it need to be shown because it was previously insane? if (mNeedsShow) - NativeShow(PR_TRUE); + NativeShow(true); } else { // If someone has set this so that the needs show flag is false // and it needs to be hidden, update the flag and hide the // window. This flag will be cleared the next time someone // hides the window or shows it. It also prevents us from - // calling NativeShow(PR_FALSE) excessively on the window which + // calling NativeShow(false) excessively on the window which // causes unneeded X traffic. if (!mNeedsShow) { - mNeedsShow = PR_TRUE; - NativeShow(PR_FALSE); + mNeedsShow = true; + NativeShow(false); } } } @@ -1248,7 +1248,7 @@ nsWindow::Resize(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight, NativeResize(aX, aY, aWidth, aHeight, aRepaint); } else { - mNeedsResize = PR_TRUE; + mNeedsResize = true; } } @@ -1306,7 +1306,7 @@ nsWindow::Move(PRInt32 aX, PRInt32 aY) if (!mCreated) return NS_OK; - mNeedsMove = PR_FALSE; + mNeedsMove = false; if (mIsTopLevel) { gtk_window_move(GTK_WINDOW(mShell), aX, aY); @@ -1381,7 +1381,7 @@ nsWindow::SetSizeMode(PRInt32 aMode) gtk_window_iconify(GTK_WINDOW(mShell)); break; case nsSizeMode_Fullscreen: - MakeFullScreen(PR_TRUE); + MakeFullScreen(true); break; default: @@ -1476,7 +1476,7 @@ nsWindow::SetFocus(bool aRaise) if (!owningWidget) return NS_ERROR_FAILURE; - // Raise the window if someone passed in PR_TRUE and the prefs are + // Raise the window if someone passed in true and the prefs are // set properly. GtkWidget *toplevelWidget = gtk_widget_get_toplevel(owningWidget); @@ -1489,7 +1489,7 @@ nsWindow::SetFocus(bool aRaise) { gdk_window_show_unraised(gtk_widget_get_window(top_window)); // Unset the urgency hint if possible. - SetUrgencyHint(top_window, PR_FALSE); + SetUrgencyHint(top_window, false); } } @@ -1498,7 +1498,7 @@ nsWindow::SetFocus(bool aRaise) return NS_ERROR_FAILURE; if (aRaise) { - // aRaise == PR_TRUE means request toplevel activation. + // aRaise == true means request toplevel activation. // This is asynchronous. // If and when the window manager accepts the request, then the focus @@ -1516,7 +1516,7 @@ nsWindow::SetFocus(bool aRaise) return NS_OK; } - // aRaise == PR_FALSE means that keyboard events should be dispatched + // aRaise == false means that keyboard events should be dispatched // from this widget. // Ensure owningWidget is the focused GtkWidget within its toplevel window. @@ -1528,9 +1528,9 @@ nsWindow::SetFocus(bool aRaise) // in an embedder. The focus manager already knows that this window // is active so gBlockActivateEvent avoids another (unnecessary) // NS_ACTIVATE event. - gBlockActivateEvent = PR_TRUE; + gBlockActivateEvent = true; gtk_widget_grab_focus(owningWidget); - gBlockActivateEvent = PR_FALSE; + gBlockActivateEvent = false; } // If this is the widget that already has focus, return. @@ -1924,7 +1924,7 @@ nsWindow::GetAttention(PRInt32 aCycleCount) // Don't get attention if the window is focused anyway. if (top_window && (gtk_widget_get_visible(top_window)) && top_window != top_focused_window) { - SetUrgencyHint(top_window, PR_TRUE); + SetUrgencyHint(top_window, true); } return NS_OK; @@ -1959,7 +1959,7 @@ nsWindow::HasPendingInputEvent() XPutBackEvent(display, &ev); } #else - haveEvent = PR_FALSE; + haveEvent = false; #endif return haveEvent; } @@ -2041,7 +2041,7 @@ static void DispatchDidPaint(nsIWidget* aWidget) { nsEventStatus status; - nsPaintEvent didPaintEvent(PR_TRUE, NS_DID_PAINT, aWidget); + nsPaintEvent didPaintEvent(true, NS_DID_PAINT, aWidget); aWidget->DispatchEvent(&didPaintEvent, status); } @@ -2065,8 +2065,8 @@ nsWindow::OnExposeEvent(cairo_t *cr) // dispatch PAINT { nsEventStatus status; - nsPaintEvent willPaintEvent(PR_TRUE, NS_WILL_PAINT, this); - willPaintEvent.willSendDidPaint = PR_TRUE; + nsPaintEvent willPaintEvent(true, NS_WILL_PAINT, this); + willPaintEvent.willSendDidPaint = true; DispatchEvent(&willPaintEvent, status); // If the window has been destroyed during WILL_PAINT, there is @@ -2075,8 +2075,8 @@ nsWindow::OnExposeEvent(cairo_t *cr) return TRUE; } - nsPaintEvent event(PR_TRUE, NS_PAINT, this); - event.willSendDidPaint = PR_TRUE; + nsPaintEvent event(true, NS_PAINT, this); + event.willSendDidPaint = true; #if defined(MOZ_WIDGET_GTK2) GdkRectangle *rects; @@ -2302,13 +2302,13 @@ nsWindow::OnExposeEvent(cairo_t *cr) #endif if (dirtyArea) { - gdk_window_invalidate_region(mGdkWindow, dirtyArea, PR_FALSE); + gdk_window_invalidate_region(mGdkWindow, dirtyArea, false); #if defined(MOZ_WIDGET_GTK2) gdk_region_destroy(dirtyArea); #else cairo_region_destroy(dirtyArea); #endif - gdk_window_process_updates(mGdkWindow, PR_FALSE); + gdk_window_process_updates(mGdkWindow, false); } // check the return value! @@ -2348,7 +2348,7 @@ nsWindow::OnConfigureEvent(GtkWidget *aWidget, GdkEventConfigure *aEvent) return FALSE; if (mWindowType == eWindowType_toplevel || mWindowType == eWindowType_dialog) { - check_for_rollup(aEvent->window, 0, 0, PR_FALSE, PR_TRUE); + check_for_rollup(aEvent->window, 0, 0, false, true); } // This event indicates that the window position may have changed. @@ -2382,7 +2382,7 @@ nsWindow::OnConfigureEvent(GtkWidget *aWidget, GdkEventConfigure *aEvent) // client window origin. mBounds.MoveTo(WidgetToScreenOffset()); - nsGUIEvent event(PR_TRUE, NS_MOVE, this); + nsGUIEvent event(true, NS_MOVE, this); event.refPoint = mBounds.TopLeft(); @@ -2441,7 +2441,7 @@ nsWindow::OnSizeAllocate(GtkWidget *aWidget, GtkAllocation *aAllocation) void nsWindow::OnDeleteEvent(GtkWidget *aWidget, GdkEventAny *aEvent) { - nsGUIEvent event(PR_TRUE, NS_XUL_CLOSE, this); + nsGUIEvent event(true, NS_XUL_CLOSE, this); event.refPoint.x = 0; event.refPoint.y = 0; @@ -2468,7 +2468,7 @@ nsWindow::OnEnterNotifyEvent(GtkWidget *aWidget, GdkEventCrossing *aEvent) if (is_parent_ungrab_enter(aEvent)) return; - nsMouseEvent event(PR_TRUE, NS_MOUSE_ENTER, this, nsMouseEvent::eReal); + nsMouseEvent event(true, NS_MOUSE_ENTER, this, nsMouseEvent::eReal); event.refPoint.x = nscoord(aEvent->x); event.refPoint.y = nscoord(aEvent->y); @@ -2490,7 +2490,7 @@ is_top_level_mouse_exit(GdkWindow* aWindow, GdkEventCrossing *aEvent) GdkDisplay* display = gdk_window_get_display(aWindow); GdkWindow* winAtPt = gdk_display_get_window_at_pointer(display, &x, &y); if (!winAtPt) - return PR_TRUE; + return true; GdkWindow* topLevelAtPt = gdk_window_get_toplevel(winAtPt); GdkWindow* topLevelWidget = gdk_window_get_toplevel(aWindow); return topLevelAtPt != topLevelWidget; @@ -2510,7 +2510,7 @@ nsWindow::OnLeaveNotifyEvent(GtkWidget *aWidget, GdkEventCrossing *aEvent) if (aEvent->subwindow != NULL) return; - nsMouseEvent event(PR_TRUE, NS_MOUSE_EXIT, this, nsMouseEvent::eReal); + nsMouseEvent event(true, NS_MOUSE_EXIT, this, nsMouseEvent::eReal); event.refPoint.x = nscoord(aEvent->x); event.refPoint.y = nscoord(aEvent->y); @@ -2560,9 +2560,9 @@ nsWindow::OnMotionNotifyEvent(GtkWidget *aWidget, GdkEventMotion *aEvent) // when we receive this, it must be that the gtk dragging is over, // it is dropped either in or out of mozilla, clear the flag - sIsDraggingOutOf = PR_FALSE; + sIsDraggingOutOf = false; - nsMouseEvent event(PR_TRUE, NS_MOUSE_MOVE, this, nsMouseEvent::eReal); + nsMouseEvent event(true, NS_MOUSE_MOVE, this, nsMouseEvent::eReal); // should we move this into !synthEvent? gdouble pressure = 0; @@ -2576,11 +2576,11 @@ nsWindow::OnMotionNotifyEvent(GtkWidget *aWidget, GdkEventMotion *aEvent) event.refPoint = nsIntPoint(cursorX, cursorY) - WidgetToScreenOffset(); event.isShift = (aEvent->state & GDK_SHIFT_MASK) - ? PR_TRUE : PR_FALSE; + ? true : false; event.isControl = (aEvent->state & GDK_CONTROL_MASK) - ? PR_TRUE : PR_FALSE; + ? true : false; event.isAlt = (aEvent->state & GDK_MOD1_MASK) - ? PR_TRUE : PR_FALSE; + ? true : false; event.time = aEvent->time; @@ -2593,7 +2593,7 @@ nsWindow::OnMotionNotifyEvent(GtkWidget *aWidget, GdkEventMotion *aEvent) { // when we receive this, it must be that the gtk dragging is over, // it is dropped either in or out of mozilla, clear the flag - sIsDraggingOutOf = PR_FALSE; + sIsDraggingOutOf = false; // see if we can compress this event // XXXldb Why skip every other motion event when we have multiple, @@ -2609,7 +2609,7 @@ nsWindow::OnMotionNotifyEvent(GtkWidget *aWidget, GdkEventMotion *aEvent) || peeked.type != MotionNotify) break; - synthEvent = PR_TRUE; + synthEvent = true; XNextEvent (GDK_WINDOW_XDISPLAY(aEvent->window), &xevent); } #if defined(MOZ_WIDGET_GTK2) @@ -2621,7 +2621,7 @@ nsWindow::OnMotionNotifyEvent(GtkWidget *aWidget, GdkEventMotion *aEvent) #endif /* MOZ_WIDGET_GTK2 */ #endif /* MOZ_X11 */ - nsMouseEvent event(PR_TRUE, NS_MOUSE_MOVE, this, nsMouseEvent::eReal); + nsMouseEvent event(true, NS_MOUSE_MOVE, this, nsMouseEvent::eReal); gdouble pressure = 0; gdk_event_get_axis ((GdkEvent*)aEvent, GDK_AXIS_PRESSURE, &pressure); @@ -2637,11 +2637,11 @@ nsWindow::OnMotionNotifyEvent(GtkWidget *aWidget, GdkEventMotion *aEvent) event.refPoint.y = nscoord(xevent.xmotion.y); event.isShift = (xevent.xmotion.state & GDK_SHIFT_MASK) - ? PR_TRUE : PR_FALSE; + ? true : false; event.isControl = (xevent.xmotion.state & GDK_CONTROL_MASK) - ? PR_TRUE : PR_FALSE; + ? true : false; event.isAlt = (xevent.xmotion.state & GDK_MOD1_MASK) - ? PR_TRUE : PR_FALSE; + ? true : false; event.time = xevent.xmotion.time; #else @@ -2649,11 +2649,11 @@ nsWindow::OnMotionNotifyEvent(GtkWidget *aWidget, GdkEventMotion *aEvent) event.refPoint.y = nscoord(aEvent->y); event.isShift = (aEvent->state & GDK_SHIFT_MASK) - ? PR_TRUE : PR_FALSE; + ? true : false; event.isControl = (aEvent->state & GDK_CONTROL_MASK) - ? PR_TRUE : PR_FALSE; + ? true : false; event.isAlt = (aEvent->state & GDK_MOD1_MASK) - ? PR_TRUE : PR_FALSE; + ? true : false; event.time = aEvent->time; #endif /* MOZ_X11 */ @@ -2669,11 +2669,11 @@ nsWindow::OnMotionNotifyEvent(GtkWidget *aWidget, GdkEventMotion *aEvent) } event.isShift = (aEvent->state & GDK_SHIFT_MASK) - ? PR_TRUE : PR_FALSE; + ? true : false; event.isControl = (aEvent->state & GDK_CONTROL_MASK) - ? PR_TRUE : PR_FALSE; + ? true : false; event.isAlt = (aEvent->state & GDK_MOD1_MASK) - ? PR_TRUE : PR_FALSE; + ? true : false; event.time = aEvent->time; } @@ -2727,7 +2727,7 @@ nsWindow::DispatchMissedButtonReleases(GdkEventCrossing *aGdkEvent) // change in state. This event is marked as synthesized so that // it is not dispatched as a DOM event, because we don't know the // position, widget, modifiers, or time/order. - nsMouseEvent synthEvent(PR_TRUE, NS_MOUSE_BUTTON_UP, this, + nsMouseEvent synthEvent(true, NS_MOUSE_BUTTON_UP, this, nsMouseEvent::eSynthesized); synthEvent.button = buttonType; nsEventStatus status; @@ -2808,7 +2808,7 @@ nsWindow::OnButtonPressEvent(GtkWidget *aWidget, GdkEventButton *aEvent) // check to see if we should rollup bool rolledUp = check_for_rollup(aEvent->window, aEvent->x_root, - aEvent->y_root, PR_FALSE, PR_FALSE); + aEvent->y_root, false, false); if (gConsumeRollupEvent && rolledUp) return; @@ -2831,7 +2831,7 @@ nsWindow::OnButtonPressEvent(GtkWidget *aWidget, GdkEventButton *aEvent) case 6: case 7: { - nsMouseScrollEvent event(PR_TRUE, NS_MOUSE_SCROLL, this); + nsMouseScrollEvent event(true, NS_MOUSE_SCROLL, this); event.pressure = mLastMotionPressure; event.scrollFlags = nsMouseScrollEvent::kIsHorizontal; event.refPoint.x = nscoord(aEvent->x); @@ -2863,7 +2863,7 @@ nsWindow::OnButtonPressEvent(GtkWidget *aWidget, GdkEventButton *aEvent) gButtonState |= ButtonMaskFromGDKButton(aEvent->button); - nsMouseEvent event(PR_TRUE, NS_MOUSE_BUTTON_DOWN, this, nsMouseEvent::eReal); + nsMouseEvent event(true, NS_MOUSE_BUTTON_DOWN, this, nsMouseEvent::eReal); event.button = domButton; InitButtonEvent(event, aEvent); event.pressure = mLastMotionPressure; @@ -2873,7 +2873,7 @@ nsWindow::OnButtonPressEvent(GtkWidget *aWidget, GdkEventButton *aEvent) // right menu click on linux should also pop up a context menu if (domButton == nsMouseEvent::eRightButton && NS_LIKELY(!mIsDestroyed)) { - nsMouseEvent contextMenuEvent(PR_TRUE, NS_CONTEXTMENU, this, + nsMouseEvent contextMenuEvent(true, NS_CONTEXTMENU, this, nsMouseEvent::eReal); InitButtonEvent(contextMenuEvent, aEvent); contextMenuEvent.pressure = mLastMotionPressure; @@ -2905,7 +2905,7 @@ nsWindow::OnButtonReleaseEvent(GtkWidget *aWidget, GdkEventButton *aEvent) gButtonState &= ~ButtonMaskFromGDKButton(aEvent->button); - nsMouseEvent event(PR_TRUE, NS_MOUSE_BUTTON_UP, this, nsMouseEvent::eReal); + nsMouseEvent event(true, NS_MOUSE_BUTTON_UP, this, nsMouseEvent::eReal); event.button = domButton; InitButtonEvent(event, aEvent); gdouble pressure = 0; @@ -2929,7 +2929,7 @@ nsWindow::OnContainerFocusInEvent(GtkWidget *aWidget, GdkEventFocus *aEvent) GtkWidget* top_window = nsnull; GetToplevelWidget(&top_window); if (top_window && (gtk_widget_get_visible(top_window))) - SetUrgencyHint(top_window, PR_FALSE); + SetUrgencyHint(top_window, false); // Return if being called within SetFocus because the focus manager // already knows that the window is active. @@ -2972,7 +2972,7 @@ nsWindow::OnContainerFocusOutEvent(GtkWidget *aWidget, GdkEventFocus *aEvent) } if (shouldRollup) { - check_for_rollup(aEvent->window, 0, 0, PR_FALSE, PR_TRUE); + check_for_rollup(aEvent->window, 0, 0, false, true); } } @@ -3001,7 +3001,7 @@ bool nsWindow::DispatchCommandEvent(nsIAtom* aCommand) { nsEventStatus status; - nsCommandEvent event(PR_TRUE, nsWidgetAtoms::onAppCommand, aCommand, this); + nsCommandEvent event(true, nsWidgetAtoms::onAppCommand, aCommand, this); DispatchEvent(&event, status); return TRUE; } @@ -3010,7 +3010,7 @@ bool nsWindow::DispatchContentCommandEvent(PRInt32 aMsg) { nsEventStatus status; - nsContentCommandEvent event(PR_TRUE, aMsg, this); + nsContentCommandEvent event(true, aMsg, this); DispatchEvent(&event, status); return TRUE; } @@ -3070,19 +3070,19 @@ nsWindow::DispatchKeyDownEvent(GdkEventKey *aEvent, bool *aCancelled) { NS_PRECONDITION(aCancelled, "aCancelled must not be null"); - *aCancelled = PR_FALSE; + *aCancelled = false; if (IsCtrlAltTab(aEvent)) { - return PR_FALSE; + return false; } // send the key down event nsEventStatus status; - nsKeyEvent downEvent(PR_TRUE, NS_KEY_DOWN, this); + nsKeyEvent downEvent(true, NS_KEY_DOWN, this); InitKeyEvent(downEvent, aEvent); DispatchEvent(&downEvent, status); *aCancelled = (status == nsEventStatus_eConsumeNoDefault); - return PR_TRUE; + return true; } gboolean @@ -3127,7 +3127,7 @@ nsWindow::OnKeyPressEvent(GtkWidget *aWidget, GdkEventKey *aEvent) if (!IMEWasEnabled && mIMModule && mIMModule->IsEnabled()) { // Notice our keydown event was already dispatched. This prevents // unnecessary DOM keydown event in the editor. - if (mIMModule->OnKeyEvent(this, aEvent, PR_TRUE)) { + if (mIMModule->OnKeyEvent(this, aEvent, true)) { return TRUE; } } @@ -3183,7 +3183,7 @@ nsWindow::OnKeyPressEvent(GtkWidget *aWidget, GdkEventKey *aEvent) #endif /* ! AIX */ #endif /* MOZ_X11 */ - nsKeyEvent event(PR_TRUE, NS_KEY_PRESS, this); + nsKeyEvent event(true, NS_KEY_PRESS, this); InitKeyEvent(event, aEvent); if (isKeyDownCancelled) { // If prevent default set for onkeydown, do the same for onkeypress @@ -3271,7 +3271,7 @@ nsWindow::OnKeyPressEvent(GtkWidget *aWidget, GdkEventKey *aEvent) // before we dispatch a key, check if it's the context menu key. // If so, send a context menu key event instead. if (is_context_menu_key(event)) { - nsMouseEvent contextMenuEvent(PR_TRUE, NS_CONTEXTMENU, this, + nsMouseEvent contextMenuEvent(true, NS_CONTEXTMENU, this, nsMouseEvent::eReal, nsMouseEvent::eContextMenuKey); key_event_to_context_menu_event(contextMenuEvent, aEvent); @@ -3284,7 +3284,7 @@ nsWindow::OnKeyPressEvent(GtkWidget *aWidget, GdkEventKey *aEvent) DispatchEvent(&event, status); } else { - nsTextEvent textEvent(PR_TRUE, NS_TEXT_TEXT, this); + nsTextEvent textEvent(true, NS_TEXT_TEXT, this); PRUnichar textString[3]; textString[0] = H_SURROGATE(event.charCode); textString[1] = L_SURROGATE(event.charCode); @@ -3313,7 +3313,7 @@ nsWindow::OnKeyReleaseEvent(GtkWidget *aWidget, GdkEventKey *aEvent) } // send the key event as a key up event - nsKeyEvent event(PR_TRUE, NS_KEY_UP, this); + nsKeyEvent event(true, NS_KEY_UP, this); InitKeyEvent(event, aEvent); nsEventStatus status; @@ -3332,11 +3332,11 @@ nsWindow::OnScrollEvent(GtkWidget *aWidget, GdkEventScroll *aEvent) { // check to see if we should rollup bool rolledUp = check_for_rollup(aEvent->window, aEvent->x_root, - aEvent->y_root, PR_TRUE, PR_FALSE); + aEvent->y_root, true, false); if (gConsumeRollupEvent && rolledUp) return; - nsMouseScrollEvent event(PR_TRUE, NS_MOUSE_SCROLL, this); + nsMouseScrollEvent event(true, NS_MOUSE_SCROLL, this); switch (aEvent->direction) { case GDK_SCROLL_UP: event.scrollFlags = nsMouseScrollEvent::kIsVertical; @@ -3398,7 +3398,7 @@ nsWindow::OnVisibilityNotifyEvent(GtkWidget *aWidget, gdk_window_invalidate_rect(mGdkWindow, NULL, FALSE); } - mIsFullyObscured = PR_FALSE; + mIsFullyObscured = false; // In Hildon/Maemo, a browser window will get into 'patially visible' state wheneven an // autocomplete feature is dropped down (from urlbar or from an entry form completion), @@ -3412,7 +3412,7 @@ nsWindow::OnVisibilityNotifyEvent(GtkWidget *aWidget, } break; default: // includes GDK_VISIBILITY_FULLY_OBSCURED - mIsFullyObscured = PR_TRUE; + mIsFullyObscured = true; break; } } @@ -3444,7 +3444,7 @@ nsWindow::OnWindowStateEvent(GtkWidget *aWidget, GdkEventWindowState *aEvent) } // else the widget is a shell widget. - nsSizeModeEvent event(PR_TRUE, NS_SIZEMODE, this); + nsSizeModeEvent event(true, NS_SIZEMODE, this); // We don't care about anything but changes in the maximized/icon // states @@ -3490,7 +3490,7 @@ nsWindow::OnWindowStateEvent(GtkWidget *aWidget, GdkEventWindowState *aEvent) void nsWindow::ThemeChanged() { - nsGUIEvent event(PR_TRUE, NS_THEMECHANGED, this); + nsGUIEvent event(true, NS_THEMECHANGED, this); nsEventStatus status = nsEventStatus_eIgnore; DispatchEvent(&event, status); @@ -3572,7 +3572,7 @@ nsWindow::OnDragMotionEvent(GtkWidget *aWidget, } } - sIsDraggingOutOf = PR_FALSE; + sIsDraggingOutOf = false; // get our drag context nsCOMPtr dragService = do_GetService(kCDragServiceCID); @@ -3607,7 +3607,7 @@ nsWindow::OnDragMotionEvent(GtkWidget *aWidget, dragService->FireDragEventAtSource(NS_DRAGDROP_DRAG); - nsDragEvent event(PR_TRUE, NS_DRAGDROP_OVER, innerMostWidget); + nsDragEvent event(true, NS_DRAGDROP_OVER, innerMostWidget); InitDragEvent(event); @@ -3637,7 +3637,7 @@ nsWindow::OnDragLeaveEvent(GtkWidget *aWidget, LOGDRAG(("nsWindow::OnDragLeaveSignal(%p)\n", (void*)this)); - sIsDraggingOutOf = PR_TRUE; + sIsDraggingOutOf = true; if (mDragLeaveTimer) { return; @@ -3695,7 +3695,7 @@ nsWindow::OnDragDropEvent(GtkWidget *aWidget, // re-validate the drag target and then we do the drop. The events // look the same except for the type. - nsDragEvent event(PR_TRUE, NS_DRAGDROP_OVER, innerMostWidget); + nsDragEvent event(true, NS_DRAGDROP_OVER, innerMostWidget); InitDragEvent(event); @@ -3710,7 +3710,7 @@ nsWindow::OnDragDropEvent(GtkWidget *aWidget, // only protects innerMostWidget from being deleted, it does NOT protect // against nsView::~nsView() calling Destroy() on it, bug 378670. if (!innerMostWidget->mIsDestroyed) { - nsDragEvent event(PR_TRUE, NS_DRAGDROP_DROP, innerMostWidget); + nsDragEvent event(true, NS_DRAGDROP_DROP, innerMostWidget); event.refPoint.x = retx; event.refPoint.y = rety; @@ -3740,7 +3740,7 @@ nsWindow::OnDragDropEvent(GtkWidget *aWidget, gdk_display_get_pointer(display, NULL, &x, &y, NULL); ((nsDragService *)dragService.get())->SetDragEndPoint(nsIntPoint(x, y)); } - dragService->EndDragSession(PR_TRUE); + dragService->EndDragSession(true); return TRUE; } @@ -3770,7 +3770,7 @@ nsWindow::OnDragLeave(void) { LOGDRAG(("nsWindow::OnDragLeave(%p)\n", (void*)this)); - nsDragEvent event(PR_TRUE, NS_DRAGDROP_EXIT, this); + nsDragEvent event(true, NS_DRAGDROP_EXIT, this); nsEventStatus status; DispatchEvent(&event, status); @@ -3790,7 +3790,7 @@ nsWindow::OnDragLeave(void) // initiated in a different app. End the drag session, // since we're done with it for now (until the user // drags back into mozilla). - dragService->EndDragSession(PR_FALSE); + dragService->EndDragSession(false); } } } @@ -3803,7 +3803,7 @@ nsWindow::OnDragEnter(nscoord aX, nscoord aY) LOGDRAG(("nsWindow::OnDragEnter(%p)\n", (void*)this)); - nsDragEvent event(PR_TRUE, NS_DRAGDROP_ENTER, this); + nsDragEvent event(true, NS_DRAGDROP_ENTER, this); event.refPoint.x = aX; event.refPoint.y = aY; @@ -3899,7 +3899,7 @@ nsWindow::Create(nsIWidget *aParent, // Do we need to listen for resizes? bool listenForResizes = false;; if (aNativeParent || (aInitData && aInitData->mListenForResizes)) - listenForResizes = PR_TRUE; + listenForResizes = true; // and do our common creation CommonCreate(aParent, listenForResizes); @@ -3939,7 +3939,7 @@ nsWindow::Create(nsIWidget *aParent, case eWindowType_popup: case eWindowType_toplevel: case eWindowType_invisible: { - mIsTopLevel = PR_TRUE; + mIsTopLevel = true; // We only move a general managed toplevel window if someone has // actually placed the window somewhere. If no placement has taken @@ -3947,7 +3947,7 @@ nsWindow::Create(nsIWidget *aParent, // // Indicate that if we're shown, we at least need to have our size set. // If we get explicitly moved, the position will also be set. - mNeedsResize = PR_TRUE; + mNeedsResize = true; nsXPIDLString brandName; GetBrandName(brandName); @@ -3988,7 +3988,7 @@ nsWindow::Create(nsIWidget *aParent, // With popup windows, we want to control their position, so don't // wait for the window manager to place them (which wouldn't // happen with override-redirect windows anyway). - mNeedsMove = PR_TRUE; + mNeedsMove = true; // Popups that are not noautohide are only temporary. The are used // for menus and the like and disappear when another window is used. @@ -4281,12 +4281,12 @@ nsWindow::Create(nsIWidget *aParent, // resize so that everything is set to the right dimensions if (!mIsTopLevel) - Resize(mBounds.x, mBounds.y, mBounds.width, mBounds.height, PR_FALSE); + Resize(mBounds.x, mBounds.y, mBounds.width, mBounds.height, false); #ifdef ACCESSIBILITY nsresult rv; if (!sAccessibilityChecked) { - sAccessibilityChecked = PR_TRUE; + sAccessibilityChecked = true; //check if accessibility enabled/disabled by environment variable const char *envValue = PR_GetEnv(sAccEnv); @@ -4425,7 +4425,7 @@ nsWindow::NativeResize(PRInt32 aWidth, PRInt32 aHeight, bool aRepaint) ResizeTransparencyBitmap(aWidth, aHeight); // clear our resize flag - mNeedsResize = PR_FALSE; + mNeedsResize = false; if (mIsTopLevel) { gtk_window_resize(GTK_WINDOW(mShell), aWidth, aHeight); @@ -4450,8 +4450,8 @@ nsWindow::NativeResize(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight, bool aRepaint) { - mNeedsResize = PR_FALSE; - mNeedsMove = PR_FALSE; + mNeedsResize = false; + mNeedsMove = false; LOG(("nsWindow::NativeResize [%p] %d %d %d %d\n", (void *)this, aX, aY, aWidth, aHeight)); @@ -4494,7 +4494,7 @@ nsWindow::NativeShow (bool aAction) } // unset our flag now that our window has been shown - mNeedsShow = PR_FALSE; + mNeedsShow = false; if (mIsTopLevel) { // Set up usertime/startupID metadata for the created window. @@ -4661,15 +4661,15 @@ nsWindow::ConfigureChildren(const nsTArray& aConfigurations) nsWindow* w = static_cast(configuration.mChild); NS_ASSERTION(w->GetParent() == this, "Configured widget is not a child"); - w->SetWindowClipRegion(configuration.mClipRegion, PR_TRUE); + w->SetWindowClipRegion(configuration.mClipRegion, true); if (w->mBounds.Size() != configuration.mBounds.Size()) { w->Resize(configuration.mBounds.x, configuration.mBounds.y, configuration.mBounds.width, configuration.mBounds.height, - PR_TRUE); + true); } else if (w->mBounds.TopLeft() != configuration.mBounds.TopLeft()) { w->Move(configuration.mBounds.x, configuration.mBounds.y); } - w->SetWindowClipRegion(configuration.mClipRegion, PR_FALSE); + w->SetWindowClipRegion(configuration.mClipRegion, false); } return NS_OK; } @@ -4848,13 +4848,13 @@ ChangedMaskBits(gchar* aMaskBits, PRInt32 aMaskWidth, PRInt32 aMaskHeight, bool maskBit = (maskByte & (1 << (x & 7))) != 0; if (maskBit != newBit) { - return PR_TRUE; + return true; } } aAlphas += aStride; } - return PR_FALSE; + return false; } static @@ -4981,14 +4981,14 @@ nsWindow::GrabPointer(void) { LOG(("GrabPointer %d\n", mRetryPointerGrab)); - mRetryPointerGrab = PR_FALSE; + mRetryPointerGrab = false; // If the window isn't visible, just set the flag to retry the // grab. When this window becomes visible, the grab will be // retried. if (!mHasMappedToplevel || mIsFullyObscured) { LOG(("GrabPointer: window not visible\n")); - mRetryPointerGrab = PR_TRUE; + mRetryPointerGrab = true; return; } @@ -5009,7 +5009,7 @@ nsWindow::GrabPointer(void) if (retval != GDK_GRAB_SUCCESS) { LOG(("GrabPointer: pointer grab failed\n")); - mRetryPointerGrab = PR_TRUE; + mRetryPointerGrab = true; } } @@ -5018,7 +5018,7 @@ nsWindow::ReleaseGrabs(void) { LOG(("ReleaseGrabs\n")); - mRetryPointerGrab = PR_FALSE; + mRetryPointerGrab = false; gdk_pointer_ungrab(GDK_CURRENT_TIME); } @@ -5315,7 +5315,7 @@ nsWindow::HideWindowChrome(bool aShouldHide) GdkWindow *shellWindow = gtk_widget_get_window(mShell); if (gdk_window_is_visible(shellWindow)) { gdk_window_hide(shellWindow); - wasVisible = PR_TRUE; + wasVisible = true; } gint wmd; @@ -5358,7 +5358,7 @@ check_for_rollup(GdkWindow *aWindow, gdouble aMouseX, gdouble aMouseY, bool rollup = true; if (aIsWheel) { gRollupListener->ShouldRollupOnMouseWheelEvent(&rollup); - retVal = PR_TRUE; + retVal = 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 @@ -5378,7 +5378,7 @@ check_for_rollup(GdkWindow *aWindow, gdouble aMouseX, gdouble aMouseY, // number of popups to Rollup so that only those of the // same type close up. if (i < sameTypeCount) { - rollup = PR_FALSE; + rollup = false; } else { popupsToRollup = sameTypeCount; @@ -5392,7 +5392,7 @@ check_for_rollup(GdkWindow *aWindow, gdouble aMouseX, gdouble aMouseY, if (rollup) { gRollupListener->Rollup(popupsToRollup, nsnull); if (popupsToRollup == PR_UINT32_MAX) { - retVal = PR_TRUE; + retVal = true; } } } @@ -5456,9 +5456,9 @@ is_mouse_in_window (GdkWindow* aWindow, gdouble aMouseX, gdouble aMouseY) if (aMouseX > x && aMouseX < x + w && aMouseY > y && aMouseY < y + h) - return PR_TRUE; + return true; - return PR_FALSE; + return false; } static nsWindow * @@ -6194,10 +6194,10 @@ nsWindow::InitDragEvent(nsDragEvent &aEvent) // set the keyboard modifiers GdkModifierType state = (GdkModifierType)0; gdk_display_get_pointer(gdk_display_get_default(), NULL, NULL, NULL, &state); - aEvent.isShift = (state & GDK_SHIFT_MASK) ? PR_TRUE : PR_FALSE; - aEvent.isControl = (state & GDK_CONTROL_MASK) ? PR_TRUE : PR_FALSE; - aEvent.isAlt = (state & GDK_MOD1_MASK) ? PR_TRUE : PR_FALSE; - aEvent.isMeta = PR_FALSE; // GTK+ doesn't support the meta key + aEvent.isShift = (state & GDK_SHIFT_MASK) ? true : false; + aEvent.isControl = (state & GDK_CONTROL_MASK) ? true : false; + aEvent.isAlt = (state & GDK_MOD1_MASK) ? true : false; + aEvent.isMeta = false; // GTK+ doesn't support the meta key } // This will update the drag action based on the information in the @@ -6386,10 +6386,10 @@ key_event_to_context_menu_event(nsMouseEvent &aEvent, GdkEventKey *aGdkEvent) { aEvent.refPoint = nsIntPoint(0, 0); - aEvent.isShift = PR_FALSE; - aEvent.isControl = PR_FALSE; - aEvent.isAlt = PR_FALSE; - aEvent.isMeta = PR_FALSE; + aEvent.isShift = false; + aEvent.isControl = false; + aEvent.isAlt = false; + aEvent.isMeta = false; aEvent.time = aGdkEvent->time; aEvent.clickCount = 1; } @@ -6423,7 +6423,7 @@ gdk_keyboard_get_modifiers() #ifdef MOZ_X11 // Get the modifier masks for GDK_Caps_Lock, GDK_Num_Lock and GDK_Scroll_Lock. -// Return PR_TRUE on success, PR_FALSE on error. +// Return true on success, false on error. static bool gdk_keyboard_get_modmap_masks(Display* aDisplay, PRUint32* aCapsLockMask, @@ -6443,13 +6443,13 @@ gdk_keyboard_get_modmap_masks(Display* aDisplay, max_keycode - min_keycode + 1, &keysyms_per_keycode); if (!xkeymap) { - return PR_FALSE; + return false; } XModifierKeymap* xmodmap = XGetModifierMapping(aDisplay); if (!xmodmap) { XFree(xkeymap); - return PR_FALSE; + return false; } /* @@ -6477,7 +6477,7 @@ gdk_keyboard_get_modmap_masks(Display* aDisplay, XFreeModifiermap(xmodmap); XFree(xkeymap); - return PR_TRUE; + return true; } #endif /* MOZ_X11 */ @@ -6498,7 +6498,7 @@ nsWindow::CreateRootAccessible() nsAccessible* nsWindow::DispatchAccessibleEvent() { - nsAccessibleEvent event(PR_TRUE, NS_GETACCESSIBLE, this); + nsAccessibleEvent event(true, NS_GETACCESSIBLE, this); nsEventStatus status; DispatchEvent(&event, status); @@ -6769,14 +6769,14 @@ nsWindow::GetDragInfo(nsMouseEvent* aMouseEvent, { if (aMouseEvent->button != nsMouseEvent::eLeftButton) { // we can only begin a move drag with the left mouse button - return PR_FALSE; + return false; } *aButton = 1; // get the gdk window for this widget GdkWindow* gdk_window = mGdkWindow; if (!gdk_window) { - return PR_FALSE; + return false; } NS_ABORT_IF_FALSE(GDK_IS_WINDOW(gdk_window), "must really be window"); @@ -6787,7 +6787,7 @@ nsWindow::GetDragInfo(nsMouseEvent* aMouseEvent, *aWindow = gdk_window; if (!aMouseEvent->widget) { - return PR_FALSE; + return false; } // FIXME: It would be nice to have the widget position at the time @@ -6799,7 +6799,7 @@ nsWindow::GetDragInfo(nsMouseEvent* aMouseEvent, *aRootX = aMouseEvent->refPoint.x + offset.x; *aRootY = aMouseEvent->refPoint.y + offset.y; - return PR_TRUE; + return true; } NS_IMETHODIMP diff --git a/widget/src/qt/nsDeviceContextSpecQt.cpp b/widget/src/qt/nsDeviceContextSpecQt.cpp index fa75b6f9dba3..acf9aefe46df 100644 --- a/widget/src/qt/nsDeviceContextSpecQt.cpp +++ b/widget/src/qt/nsDeviceContextSpecQt.cpp @@ -71,9 +71,6 @@ #include #include "gfxPDFSurface.h" - -/* Ensure that the result is always equal to either PR_TRUE or PR_FALSE */ -#define MAKE_PR_BOOL(val) ((val)?(PR_TRUE):(PR_FALSE)) #ifdef PR_LOGGING static PRLogModuleInfo* DeviceContextSpecQtLM = diff --git a/widget/src/windows/GfxInfo.cpp b/widget/src/windows/GfxInfo.cpp index 3af8221c53ec..24fdcee179df 100644 --- a/widget/src/windows/GfxInfo.cpp +++ b/widget/src/windows/GfxInfo.cpp @@ -80,8 +80,8 @@ GfxInfo::GfxInfo() mAdapterVendorID2(0), mAdapterDeviceID2(0), mWindowsVersion(0), - mHasDualGPU(PR_FALSE), - mIsGPU2Active(PR_FALSE) + mHasDualGPU(false), + mIsGPU2Active(false) { } @@ -104,7 +104,7 @@ GfxInfo::GetDWriteEnabled(bool *aEnabled) nsresult GfxInfo::GetAzureEnabled(bool *aEnabled) { - *aEnabled = PR_FALSE; + *aEnabled = false; bool d2dEnabled = gfxWindowsPlatform::GetPlatform()->GetRenderMode() == gfxWindowsPlatform::RENDER_DIRECT2D; @@ -114,7 +114,7 @@ GfxInfo::GetAzureEnabled(bool *aEnabled) nsresult rv = mozilla::Preferences::GetBool("gfx.canvas.azure.enabled", &azure); if (NS_SUCCEEDED(rv) && azure) { - *aEnabled = PR_TRUE; + *aEnabled = true; } } @@ -439,7 +439,7 @@ GfxInfo::Init() } result = RegOpenKeyExW(HKEY_LOCAL_MACHINE, driverKey.BeginReading(), 0, KEY_QUERY_VALUE, &key); if (result == ERROR_SUCCESS) { - mHasDualGPU = PR_TRUE; + mHasDualGPU = true; mDeviceKey2 = driverKey; dwcbData = sizeof(value); result = RegQueryValueExW(key, L"DriverVersion", NULL, NULL, (LPBYTE)value, &dwcbData); @@ -488,7 +488,7 @@ GfxInfo::Init() PR_sscanf(spoofedVendor, "%x", &mAdapterVendorID); } - mHasDriverVersionMismatch = PR_FALSE; + mHasDriverVersionMismatch = false; if (mAdapterVendorID == vendorIntel) { // we've had big crashers (bugs 590373 and 595364) apparently correlated // with bad Intel driver installations where the DriverVersion reported @@ -508,7 +508,7 @@ GfxInfo::Init() // so if GetDLLVersion failed, we get dllNumericVersion = 0 // so this test implicitly handles the case where GetDLLVersion failed if (dllNumericVersion != driverNumericVersion) - mHasDriverVersionMismatch = PR_TRUE; + mHasDriverVersionMismatch = true; } const char *spoofedDevice = PR_GetEnv("MOZ_GFX_SPOOF_DEVICE_ID"); @@ -972,7 +972,7 @@ nsresult GfxInfo::GetFeatureStatusImpl(PRInt32 aFeature, PRInt32 *aStatus, nsAString & aSuggestedDriverVersion, GfxDriverInfo* aDriverInfo /* = nsnull */) { *aStatus = nsIGfxInfo::FEATURE_NO_INFO; - aSuggestedDriverVersion.SetIsVoid(PR_TRUE); + aSuggestedDriverVersion.SetIsVoid(true); PRInt32 status = nsIGfxInfo::FEATURE_NO_INFO; diff --git a/widget/src/windows/JumpListBuilder.cpp b/widget/src/windows/JumpListBuilder.cpp index dfb723c9cf25..0572fff20232 100644 --- a/widget/src/windows/JumpListBuilder.cpp +++ b/widget/src/windows/JumpListBuilder.cpp @@ -80,7 +80,7 @@ NS_IMPL_THREADSAFE_ISUPPORTS1(AsyncDeleteAllFaviconsFromDisk, nsIRunnable) JumpListBuilder::JumpListBuilder() : mMaxItems(0), - mHasCommit(PR_FALSE) + mHasCommit(false) { ::CoInitialize(NULL); @@ -102,10 +102,10 @@ JumpListBuilder::~JumpListBuilder() /* readonly attribute short available; */ NS_IMETHODIMP JumpListBuilder::GetAvailable(PRInt16 *aAvailable) { - *aAvailable = PR_FALSE; + *aAvailable = false; if (mJumpListMgr) - *aAvailable = PR_TRUE; + *aAvailable = true; return NS_OK; } @@ -149,7 +149,7 @@ NS_IMETHODIMP JumpListBuilder::InitListBuild(nsIMutableArray *removedItems, bool { NS_ENSURE_ARG_POINTER(removedItems); - *_retval = PR_FALSE; + *_retval = false; if (!mJumpListMgr) return NS_ERROR_NOT_AVAILABLE; @@ -167,8 +167,8 @@ NS_IMETHODIMP JumpListBuilder::InitListBuild(nsIMutableArray *removedItems, bool RemoveIconCacheForItems(removedItems); - sBuildingList = PR_TRUE; - *_retval = PR_TRUE; + sBuildingList = true; + *_retval = true; return NS_OK; } @@ -265,7 +265,7 @@ nsresult JumpListBuilder::RemoveIconCacheForAllItems() continue; // We found an ICO file that exists, so we should remove it - currFile->Remove(PR_FALSE); + currFile->Remove(false); } } while(true); @@ -277,7 +277,7 @@ NS_IMETHODIMP JumpListBuilder::AddListToBuild(PRInt16 aCatType, nsIArray *items, { nsresult rv; - *_retval = PR_FALSE; + *_retval = false; if (!mJumpListMgr) return NS_ERROR_NOT_AVAILABLE; @@ -327,21 +327,21 @@ NS_IMETHODIMP JumpListBuilder::AddListToBuild(PRInt16 aCatType, nsIArray *items, // Add the tasks hr = mJumpListMgr->AddUserTasks(pArray); if (SUCCEEDED(hr)) - *_retval = PR_TRUE; + *_retval = true; return NS_OK; } break; case nsIJumpListBuilder::JUMPLIST_CATEGORY_RECENT: { if (SUCCEEDED(mJumpListMgr->AppendKnownCategory(KDC_RECENT))) - *_retval = PR_TRUE; + *_retval = true; return NS_OK; } break; case nsIJumpListBuilder::JUMPLIST_CATEGORY_FREQUENT: { if (SUCCEEDED(mJumpListMgr->AppendKnownCategory(KDC_FREQUENT))) - *_retval = PR_TRUE; + *_retval = true; return NS_OK; } break; @@ -408,7 +408,7 @@ NS_IMETHODIMP JumpListBuilder::AddListToBuild(PRInt16 aCatType, nsIArray *items, // Add the tasks hr = mJumpListMgr->AppendCategory(catName.BeginReading(), pArray); if (SUCCEEDED(hr)) - *_retval = PR_TRUE; + *_retval = true; return NS_OK; } break; @@ -423,7 +423,7 @@ NS_IMETHODIMP JumpListBuilder::AbortListBuild() return NS_ERROR_NOT_AVAILABLE; mJumpListMgr->AbortList(); - sBuildingList = PR_FALSE; + sBuildingList = false; return NS_OK; } @@ -431,18 +431,18 @@ NS_IMETHODIMP JumpListBuilder::AbortListBuild() /* boolean commitListBuild(); */ NS_IMETHODIMP JumpListBuilder::CommitListBuild(bool *_retval) { - *_retval = PR_FALSE; + *_retval = false; if (!mJumpListMgr) return NS_ERROR_NOT_AVAILABLE; HRESULT hr = mJumpListMgr->CommitList(); - sBuildingList = PR_FALSE; + sBuildingList = false; // XXX We might want some specific error data here. if (SUCCEEDED(hr)) { - *_retval = PR_TRUE; - mHasCommit = PR_TRUE; + *_retval = true; + mHasCommit = true; } return NS_OK; @@ -451,7 +451,7 @@ NS_IMETHODIMP JumpListBuilder::CommitListBuild(bool *_retval) /* boolean deleteActiveList(); */ NS_IMETHODIMP JumpListBuilder::DeleteActiveList(bool *_retval) { - *_retval = PR_FALSE; + *_retval = false; if (!mJumpListMgr) return NS_ERROR_NOT_AVAILABLE; @@ -464,7 +464,7 @@ NS_IMETHODIMP JumpListBuilder::DeleteActiveList(bool *_retval) return NS_OK; if (SUCCEEDED(mJumpListMgr->DeleteList(uid.get()))) - *_retval = PR_TRUE; + *_retval = true; return NS_OK; } @@ -476,11 +476,11 @@ bool JumpListBuilder::IsSeparator(nsCOMPtr& item) PRInt16 type; item->GetType(&type); if (NS_FAILED(item->GetType(&type))) - return PR_FALSE; + return false; if (type == nsIJumpListItem::JUMPLIST_ITEM_SEPARATOR) - return PR_TRUE; - return PR_FALSE; + return true; + return false; } // TransferIObjectArrayToIMutableArray - used in converting removed items @@ -524,7 +524,7 @@ nsresult JumpListBuilder::TransferIObjectArrayToIMutableArray(IObjectArray *objA pItem->Release(); if (NS_SUCCEEDED(rv)) { - removedItems->AppendElement(item, PR_FALSE); + removedItems->AppendElement(item, false); } } return NS_OK; @@ -703,7 +703,7 @@ NS_IMETHODIMP AsyncDeleteIconFromDisk::Run() return NS_ERROR_FAILURE; // We found an ICO file that exists, so we should remove it - icoFile->Remove(PR_FALSE); + icoFile->Remove(false); } return NS_OK; @@ -753,7 +753,7 @@ NS_IMETHODIMP AsyncDeleteAllFaviconsFromDisk::Run() continue; // We found an ICO file that exists, so we should remove it - currFile->Remove(PR_FALSE); + currFile->Remove(false); } } while(true); diff --git a/widget/src/windows/JumpListItem.cpp b/widget/src/windows/JumpListItem.cpp index a6f74e47c34e..318fb87b77c8 100644 --- a/widget/src/windows/JumpListItem.cpp +++ b/widget/src/windows/JumpListItem.cpp @@ -110,7 +110,7 @@ NS_IMETHODIMP JumpListItem::Equals(nsIJumpListItem *aItem, bool *aResult) { NS_ENSURE_ARG_POINTER(aItem); - *aResult = PR_FALSE; + *aResult = false; PRInt16 theType = nsIJumpListItem::JUMPLIST_ITEM_EMPTY; if (NS_FAILED(aItem->GetType(&theType))) @@ -120,7 +120,7 @@ NS_IMETHODIMP JumpListItem::Equals(nsIJumpListItem *aItem, bool *aResult) if (Type() != theType) return NS_OK; - *aResult = PR_TRUE; + *aResult = true; return NS_OK; } @@ -197,7 +197,7 @@ NS_IMETHODIMP JumpListLink::Equals(nsIJumpListItem *aItem, bool *aResult) nsresult rv; - *aResult = PR_FALSE; + *aResult = false; PRInt16 theType = nsIJumpListItem::JUMPLIST_ITEM_EMPTY; if (NS_FAILED(aItem->GetType(&theType))) @@ -223,11 +223,11 @@ NS_IMETHODIMP JumpListLink::Equals(nsIJumpListItem *aItem, bool *aResult) if (NS_SUCCEEDED(link->GetUri(getter_AddRefs(theUri)))) { if (!theUri) { if (!mURI) - *aResult = PR_TRUE; + *aResult = true; return NS_OK; } if (NS_SUCCEEDED(theUri->Equals(mURI, &equals)) && equals) { - *aResult = PR_TRUE; + *aResult = true; } } @@ -291,7 +291,7 @@ NS_IMETHODIMP JumpListShortcut::Equals(nsIJumpListItem *aItem, bool *aResult) nsresult rv; - *aResult = PR_FALSE; + *aResult = false; PRInt16 theType = nsIJumpListItem::JUMPLIST_ITEM_EMPTY; if (NS_FAILED(aItem->GetType(&theType))) @@ -318,11 +318,11 @@ NS_IMETHODIMP JumpListShortcut::Equals(nsIJumpListItem *aItem, bool *aResult) if (NS_SUCCEEDED(shortcut->GetApp(getter_AddRefs(theApp)))) { if (!theApp) { if (!mHandlerApp) - *aResult = PR_TRUE; + *aResult = true; return NS_OK; } if (NS_SUCCEEDED(theApp->Equals(mHandlerApp, &equals)) && equals) { - *aResult = PR_TRUE; + *aResult = true; } } @@ -381,7 +381,7 @@ static PRInt32 GetICOCacheSecondsTimeout() { const char PREF_ICOTIMEOUT[] = "browser.taskbar.lists.icoTimeoutInSeconds"; icoReCacheSecondsTimeout = Preferences::GetInt(PREF_ICOTIMEOUT, kSecondsPerDay); - alreadyObtained = PR_TRUE; + alreadyObtained = true; return icoReCacheSecondsTimeout; } @@ -560,7 +560,7 @@ nsresult JumpListShortcut::GetShellLink(nsCOMPtr& item, nsCOMPtr iconUri; rv = shortcut->GetFaviconPageUri(getter_AddRefs(iconUri)); if (NS_SUCCEEDED(rv) && iconUri) { - useUriIcon = PR_TRUE; + useUriIcon = true; } // Store the title of the app @@ -592,7 +592,7 @@ nsresult JumpListShortcut::GetShellLink(nsCOMPtr& item, // Always use the first icon in the ICO file // our encoded icon only has 1 resource psl->SetIconLocation(icoFilePath.get(), 0); - usedUriIcon = PR_TRUE; + usedUriIcon = true; } } @@ -614,7 +614,7 @@ static nsresult IsPathInOurIconCache(nsCOMPtr& aShortcut, NS_ENSURE_ARG_POINTER(aPath); NS_ENSURE_ARG_POINTER(aSame); - *aSame = PR_FALSE; + *aSame = false; // Construct the path of our jump list cache nsCOMPtr jumpListCache; @@ -662,7 +662,7 @@ nsresult JumpListShortcut::GetJumpListShortcut(IShellLinkW *pLink, nsCOMPtr file; nsDependentString filepath(buf); - rv = NS_NewLocalFile(filepath, PR_FALSE, getter_AddRefs(file)); + rv = NS_NewLocalFile(filepath, false, getter_AddRefs(file)); NS_ENSURE_SUCCESS(rv, rv); rv = handlerApp->SetExecutable(file); @@ -813,7 +813,7 @@ bool JumpListShortcut::ExecutableExists(nsCOMPtr& handlerApp nsresult rv; if (!handlerApp) - return PR_FALSE; + return false; nsCOMPtr executable; rv = handlerApp->GetExecutable(getter_AddRefs(executable)); @@ -822,7 +822,7 @@ bool JumpListShortcut::ExecutableExists(nsCOMPtr& handlerApp executable->Exists(&exists); return exists; } - return PR_FALSE; + return false; } // (static) Helper method which will hash a URI @@ -846,7 +846,7 @@ nsresult JumpListItem::HashURI(nsCOMPtr &aCryptoHash, rv = aCryptoHash->Update(reinterpret_cast(spec.BeginReading()), spec.Length()); NS_ENSURE_SUCCESS(rv, rv); - rv = aCryptoHash->Finish(PR_TRUE, aUriHash); + rv = aCryptoHash->Finish(true, aUriHash); NS_ENSURE_SUCCESS(rv, rv); return NS_OK; diff --git a/widget/src/windows/KeyboardLayout.cpp b/widget/src/windows/KeyboardLayout.cpp index c8d49620afff..34ee08a1841a 100644 --- a/widget/src/windows/KeyboardLayout.cpp +++ b/widget/src/windows/KeyboardLayout.cpp @@ -130,7 +130,7 @@ VirtualKey::SetNormalChars(PRUint8 aShiftState, { NS_ASSERTION(aShiftState < NS_ARRAY_LENGTH(mShiftStates), "invalid index"); - SetDeadKey(aShiftState, PR_FALSE); + SetDeadKey(aShiftState, false); for (PRUint32 index = 0; index < aNumOfChars; index++) { // Ignore legacy non-printable control characters @@ -149,7 +149,7 @@ VirtualKey::SetDeadChar(PRUint8 aShiftState, PRUnichar aDeadChar) { NS_ASSERTION(aShiftState < NS_ARRAY_LENGTH(mShiftStates), "invalid index"); - SetDeadKey(aShiftState, PR_TRUE); + SetDeadKey(aShiftState, true); mShiftStates[aShiftState].DeadKey.DeadChar = aDeadChar; mShiftStates[aShiftState].DeadKey.Table = nsnull; @@ -624,7 +624,7 @@ KeyboardLayout::DeactivateDeadKeyState() SetShiftState(kbdState, mDeadKeyShiftState); - EnsureDeadKeyActive(PR_FALSE, mActiveDeadKey, kbdState); + EnsureDeadKeyActive(false, mActiveDeadKey, kbdState); mActiveDeadKey = -1; } @@ -636,14 +636,14 @@ KeyboardLayout::AddDeadKeyEntry(PRUnichar aBaseChar, { for (PRUint32 index = 0; index < aEntries; index++) { if (aDeadKeyArray[index].BaseChar == aBaseChar) { - return PR_FALSE; + return false; } } aDeadKeyArray[aEntries].BaseChar = aBaseChar; aDeadKeyArray[aEntries].CompositeChar = aCompositeChar; - return PR_TRUE; + return true; } PRUint32 @@ -673,7 +673,7 @@ KeyboardLayout::GetDeadKeyCombinations(PRUint8 aDeadKey, // Ensure dead-key is in active state, when it swallows entered // character and waits for the next pressed key. if (!deadKeyActive) { - deadKeyActive = EnsureDeadKeyActive(PR_TRUE, aDeadKey, + deadKeyActive = EnsureDeadKeyActive(true, aDeadKey, aDeadKeyKbdState); } @@ -702,14 +702,14 @@ KeyboardLayout::GetDeadKeyCombinations(PRUint8 aDeadKey, aDeadKeyArray, entries)) { entries++; } - deadKeyActive = PR_FALSE; + deadKeyActive = false; break; } default: // 1. Unexpected dead-key. Dead-key chaining is not supported. // 2. More than one character generated. This is not a valid // dead-key and base character combination. - deadKeyActive = PR_FALSE; + deadKeyActive = false; break; } } @@ -717,7 +717,7 @@ KeyboardLayout::GetDeadKeyCombinations(PRUint8 aDeadKey, } if (deadKeyActive) { - deadKeyActive = EnsureDeadKeyActive(PR_FALSE, aDeadKey, aDeadKeyKbdState); + deadKeyActive = EnsureDeadKeyActive(false, aDeadKey, aDeadKeyKbdState); } NS_QuickSort(aDeadKeyArray, entries, sizeof(DeadKeyEntry), diff --git a/widget/src/windows/KeyboardLayout.h b/widget/src/windows/KeyboardLayout.h index 4dd6be2e7fe2..863d5be45245 100644 --- a/widget/src/windows/KeyboardLayout.h +++ b/widget/src/windows/KeyboardLayout.h @@ -181,7 +181,7 @@ public: bool IsDeadKey() const { return (mLastVirtualKeyIndex >= 0) ? - mVirtualKeys[mLastVirtualKeyIndex].IsDeadKey(mLastShiftState) : PR_FALSE; + mVirtualKeys[mLastVirtualKeyIndex].IsDeadKey(mLastShiftState) : false; } void LoadLayout(HKL aLayout); diff --git a/widget/src/windows/TaskbarPreview.cpp b/widget/src/windows/TaskbarPreview.cpp index fc774eb838f3..b59f01090570 100644 --- a/widget/src/windows/TaskbarPreview.cpp +++ b/widget/src/windows/TaskbarPreview.cpp @@ -136,7 +136,7 @@ TaskbarPreview::TaskbarPreview(ITaskbarList4 *aTaskbar, nsITaskbarPreviewControl : mTaskbar(aTaskbar), mController(aController), mWnd(aHWND), - mVisible(PR_FALSE), + mVisible(false), mDocShell(do_GetWeakReference(aShell)) { // TaskbarPreview may outlive the WinTaskbar that created it @@ -252,7 +252,7 @@ TaskbarPreview::UpdateTaskbarProperties() { // and should be displayed as so. if (sActivePreview == this) { if (mWnd == ::GetActiveWindow()) { - nsresult rvActive = ShowActive(PR_TRUE); + nsresult rvActive = ShowActive(true); if (NS_FAILED(rvActive)) rv = rvActive; } else { @@ -287,10 +287,10 @@ TaskbarPreview::IsWindowAvailable() const { if (mWnd) { nsWindow* win = nsWindow::GetNSWindowPtr(mWnd); if(win && !win->HasDestroyStarted()) { - return PR_TRUE; + return true; } } - return PR_FALSE; + return false; } void @@ -324,7 +324,7 @@ TaskbarPreview::WndProc(UINT nMsg, WPARAM wParam, LPARAM lParam) { thumbnailHeight = PRUint32(thumbnailWidth / preferredAspectRatio); } - DrawBitmap(thumbnailWidth, thumbnailHeight, PR_FALSE); + DrawBitmap(thumbnailWidth, thumbnailHeight, false); } break; case WM_DWMSENDICONICLIVEPREVIEWBITMAP: @@ -338,7 +338,7 @@ TaskbarPreview::WndProc(UINT nMsg, WPARAM wParam, LPARAM lParam) { if (NS_FAILED(rv)) break; - DrawBitmap(width, height, PR_TRUE); + DrawBitmap(width, height, true); } break; } @@ -350,17 +350,17 @@ TaskbarPreview::CanMakeTaskbarCalls() { // If the nsWindow has already been destroyed and we know it but our caller // clearly doesn't so we can't make any calls. if (!mWnd) - return PR_FALSE; + return false; // Certain functions like SetTabOrder seem to require a visible window. During // window close, the window seems to be hidden before being destroyed. if (!::IsWindowVisible(mWnd)) - return PR_FALSE; + return false; if (mVisible) { nsWindow *window = nsWindow::GetNSWindowPtr(mWnd); NS_ASSERTION(window, "Could not get nsWindow from HWND"); return window->HasTaskbarIconBeenCreated(); } - return PR_FALSE; + return false; } WindowHook& @@ -457,7 +457,7 @@ TaskbarPreview::MainWindowHook(void *aContext, if (preview->mVisible) preview->UpdateTaskbarProperties(); } - return PR_FALSE; + return false; } TaskbarPreview * diff --git a/widget/src/windows/TaskbarPreviewButton.cpp b/widget/src/windows/TaskbarPreviewButton.cpp index 085f9a9a5194..eb04148319e2 100644 --- a/widget/src/windows/TaskbarPreviewButton.cpp +++ b/widget/src/windows/TaskbarPreviewButton.cpp @@ -59,7 +59,7 @@ TaskbarPreviewButton::TaskbarPreviewButton(TaskbarWindowPreview* preview, PRUint } TaskbarPreviewButton::~TaskbarPreviewButton() { - SetVisible(PR_FALSE); + SetVisible(false); } NS_IMETHODIMP @@ -140,7 +140,7 @@ TaskbarPreviewButton::SetImage(imgIContainer *img) { ::DestroyIcon(Button().hIcon); if (img) { nsresult rv; - rv = nsWindowGfx::CreateIcon(img, PR_FALSE, 0, 0, + rv = nsWindowGfx::CreateIcon(img, false, 0, 0, nsWindowGfx::GetIconMetrics(nsWindowGfx::kRegularIcon), &Button().hIcon); NS_ENSURE_SUCCESS(rv, rv); diff --git a/widget/src/windows/TaskbarTabPreview.cpp b/widget/src/windows/TaskbarTabPreview.cpp index aa89104e9384..85ae2af938f9 100644 --- a/widget/src/windows/TaskbarTabPreview.cpp +++ b/widget/src/windows/TaskbarTabPreview.cpp @@ -58,7 +58,7 @@ TaskbarTabPreview::TaskbarTabPreview(ITaskbarList4 *aTaskbar, nsITaskbarPreviewC : TaskbarPreview(aTaskbar, aController, aHWND, aShell), mProxyWindow(NULL), mIcon(NULL), - mRegistered(PR_FALSE) + mRegistered(false) { WindowHook &hook = GetWindowHook(); hook.AddMonitor(WM_WINDOWPOSCHANGED, MainWindowHook, this); @@ -125,7 +125,7 @@ TaskbarTabPreview::SetIcon(imgIContainer *icon) { HICON hIcon = NULL; if (icon) { nsresult rv; - rv = nsWindowGfx::CreateIcon(icon, PR_FALSE, 0, 0, + rv = nsWindowGfx::CreateIcon(icon, false, 0, 0, nsWindowGfx::GetIconMetrics(nsWindowGfx::kSmallIcon), &hIcon); NS_ENSURE_SUCCESS(rv, rv); @@ -163,7 +163,7 @@ TaskbarTabPreview::UpdateTaskbarProperties() { nsresult rv = UpdateNext(); NS_ENSURE_SUCCESS(rv, rv); rv = TaskbarPreview::UpdateTaskbarProperties(); - mRegistered = PR_TRUE; + mRegistered = true; return rv; } @@ -172,7 +172,7 @@ TaskbarTabPreview::WndProc(UINT nMsg, WPARAM wParam, LPARAM lParam) { nsRefPtr kungFuDeathGrip(this); switch (nMsg) { case WM_CREATE: - TaskbarPreview::EnableCustomDrawing(mProxyWindow, PR_TRUE); + TaskbarPreview::EnableCustomDrawing(mProxyWindow, true); return 0; case WM_CLOSE: mController->OnClose(); @@ -291,7 +291,7 @@ TaskbarTabPreview::Disable() { if (FAILED(mTaskbar->UnregisterTab(mProxyWindow))) return NS_ERROR_FAILURE; - mRegistered = PR_FALSE; + mRegistered = false; // TaskbarPreview::WndProc will set mProxyWindow to null if (!DestroyWindow(mProxyWindow)) @@ -302,7 +302,7 @@ TaskbarTabPreview::Disable() { void TaskbarTabPreview::DetachFromNSWindow() { - (void) SetVisible(PR_FALSE); + (void) SetVisible(false); WindowHook &hook = GetWindowHook(); hook.RemoveMonitor(WM_WINDOWPOSCHANGED, MainWindowHook, this); @@ -323,7 +323,7 @@ TaskbarTabPreview::MainWindowHook(void *aContext, } else { NS_NOTREACHED("Style changed hook fired on non-style changed message"); } - return PR_FALSE; + return false; } void diff --git a/widget/src/windows/TaskbarWindowPreview.cpp b/widget/src/windows/TaskbarWindowPreview.cpp index 4703a2ddc675..dee9651b94a9 100644 --- a/widget/src/windows/TaskbarWindowPreview.cpp +++ b/widget/src/windows/TaskbarWindowPreview.cpp @@ -57,7 +57,7 @@ bool WindowHookProc(void *aContext, HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM { TaskbarWindowPreview *preview = reinterpret_cast(aContext); *aResult = preview->WndProc(nMsg, wParam, lParam); - return PR_TRUE; + return true; } } @@ -80,15 +80,15 @@ static TBPFLAG sNativeStates[] = TaskbarWindowPreview::TaskbarWindowPreview(ITaskbarList4 *aTaskbar, nsITaskbarPreviewController *aController, HWND aHWND, nsIDocShell *aShell) : TaskbarPreview(aTaskbar, aController, aHWND, aShell), - mCustomDrawing(PR_FALSE), - mHaveButtons(PR_FALSE), + mCustomDrawing(false), + mHaveButtons(false), mState(TBPF_NOPROGRESS), mCurrentValue(0), mMaxValue(0), mOverlayIcon(NULL) { // Window previews are visible by default - (void) SetVisible(PR_TRUE); + (void) SetVisible(true); memset(mThumbButtons, 0, sizeof mThumbButtons); for (PRInt32 i = 0; i < nsITaskbarWindowPreview::NUM_TOOLBAR_BUTTONS; i++) { @@ -146,7 +146,7 @@ TaskbarWindowPreview::GetButton(PRUint32 index, nsITaskbarPreviewButton **_retVa } if (!mHaveButtons) { - mHaveButtons = PR_TRUE; + mHaveButtons = true; WindowHook &hook = GetWindowHook(); (void) hook.AddHook(WM_COMMAND, WindowHookProc, this); @@ -297,7 +297,7 @@ TaskbarWindowPreview::TaskbarWindowHook(void *aContext, reinterpret_cast(aContext); // Now we can make all the calls to mTaskbar preview->UpdateTaskbarProperties(); - return PR_FALSE; + return false; } nsresult @@ -323,7 +323,7 @@ TaskbarWindowPreview::Disable() { void TaskbarWindowPreview::DetachFromNSWindow() { // Remove the hooks we have for drawing - SetEnableCustomDrawing(PR_FALSE); + SetEnableCustomDrawing(false); WindowHook &hook = GetWindowHook(); (void) hook.RemoveHook(WM_COMMAND, WindowHookProc, this); diff --git a/widget/src/windows/WinTaskbar.cpp b/widget/src/windows/WinTaskbar.cpp index 102aac7f2af7..9035d84a270f 100644 --- a/widget/src/windows/WinTaskbar.cpp +++ b/widget/src/windows/WinTaskbar.cpp @@ -197,13 +197,13 @@ DefaultController::GetThumbnailAspectRatio(float *aThumbnailAspectRatio) { NS_IMETHODIMP DefaultController::DrawPreview(nsIDOMCanvasRenderingContext2D *ctx, bool *rDrawFrame) { - *rDrawFrame = PR_TRUE; + *rDrawFrame = true; return NS_OK; } NS_IMETHODIMP DefaultController::DrawThumbnail(nsIDOMCanvasRenderingContext2D *ctx, PRUint32 width, PRUint32 height, bool *rDrawFrame) { - *rDrawFrame = PR_FALSE; + *rDrawFrame = false; return NS_OK; } @@ -215,7 +215,7 @@ DefaultController::OnClose(void) { NS_IMETHODIMP DefaultController::OnActivate(bool *rAcceptActivation) { - *rAcceptActivation = PR_TRUE; + *rAcceptActivation = true; NS_NOTREACHED("OnActivate should not be called for TaskbarWindowPreviews"); return NS_OK; } @@ -239,7 +239,7 @@ NS_IMPL_THREADSAFE_ISUPPORTS1(WinTaskbar, nsIWinTaskbar) bool WinTaskbar::Initialize() { if (mTaskbar) - return PR_TRUE; + return true; ::CoInitialize(NULL); HRESULT hr = ::CoCreateInstance(CLSID_TaskbarList, @@ -248,15 +248,15 @@ WinTaskbar::Initialize() { IID_ITaskbarList4, (void**)&mTaskbar); if (FAILED(hr)) - return PR_FALSE; + return false; hr = mTaskbar->HrInit(); if (FAILED(hr)) { NS_WARNING("Unable to initialize taskbar"); NS_RELEASE(mTaskbar); - return PR_FALSE; + return false; } - return PR_TRUE; + return true; } WinTaskbar::WinTaskbar() @@ -276,7 +276,7 @@ WinTaskbar::GetAppUserModelID(nsAString & aDefaultGroupId) { nsCOMPtr appInfo = do_GetService("@mozilla.org/xre/app-info;1"); if (!appInfo) - return PR_FALSE; + return false; // The default, pulled from application.ini: // 'vendor.application.version' @@ -294,14 +294,14 @@ WinTaskbar::GetAppUserModelID(nsAString & aDefaultGroupId) { } if (aDefaultGroupId.IsEmpty()) - return PR_FALSE; + return false; // Differentiate 64-bit builds #if defined(_WIN64) aDefaultGroupId.AppendLiteral(".Win64"); #endif - return PR_TRUE; + return true; } /* readonly attribute AString defaultGroupId; */ @@ -317,14 +317,14 @@ WinTaskbar::GetDefaultGroupId(nsAString & aDefaultGroupId) { bool WinTaskbar::RegisterAppUserModelID() { if (nsWindow::GetWindowsVersion() < WIN7_VERSION) - return PR_FALSE; + return false; SetCurrentProcessExplicitAppUserModelIDPtr funcAppUserModelID = nsnull; bool retVal = false; nsAutoString uid; if (!GetAppUserModelID(uid)) - return PR_FALSE; + return false; HMODULE hDLL = ::LoadLibraryW(kShellLibraryName); @@ -333,11 +333,11 @@ WinTaskbar::RegisterAppUserModelID() { if (!funcAppUserModelID) { ::FreeLibrary(hDLL); - return PR_FALSE; + return false; } if (SUCCEEDED(funcAppUserModelID(uid.get()))) - retVal = PR_TRUE; + retVal = true; if (hDLL) ::FreeLibrary(hDLL); @@ -349,7 +349,7 @@ NS_IMETHODIMP WinTaskbar::GetAvailable(bool *aAvailable) { *aAvailable = nsWindow::GetWindowsVersion() < WIN7_VERSION ? - PR_FALSE : PR_TRUE; + false : true; return NS_OK; } diff --git a/widget/src/windows/WindowHook.cpp b/widget/src/windows/WindowHook.cpp index d4c9b0077218..8fdd9eec33b9 100644 --- a/widget/src/windows/WindowHook.cpp +++ b/widget/src/windows/WindowHook.cpp @@ -135,7 +135,7 @@ WindowHook::Notify(HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam, LRESULT *aResult) { MessageData *data = Lookup(nMsg); if (!data) - return PR_FALSE; + return false; PRUint32 length = data->monitors.Length(); for (PRUint32 midx = 0; midx < length; midx++) { @@ -149,7 +149,7 @@ bool WindowHook::CallbackData::Invoke(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, LRESULT *aResult) { if (!cb) - return PR_FALSE; + return false; return cb(context, hWnd, msg, wParam, lParam, aResult); } } // namespace widget diff --git a/widget/src/windows/nsAppShell.cpp b/widget/src/windows/nsAppShell.cpp index b1afadbbb43f..ac98bf8d5716 100644 --- a/widget/src/windows/nsAppShell.cpp +++ b/widget/src/windows/nsAppShell.cpp @@ -95,7 +95,7 @@ static bool PeekUIMessage(MSG* aMsg) } if (pMsg && !nsIMM32Handler::CanOptimizeKeyAndIMEMessages(pMsg)) { - return PR_FALSE; + return false; } if (haveMouseMsg && (!pMsg || mouseMsg.time < pMsg->time)) { @@ -103,7 +103,7 @@ static bool PeekUIMessage(MSG* aMsg) } if (!pMsg) { - return PR_FALSE; + return false; } return ::PeekMessageW(aMsg, NULL, pMsg->message, pMsg->message, PM_REMOVE); @@ -222,7 +222,7 @@ CollectNewLoadedModules() if (sLoadedModules[i].mStartAddr == module.modBaseAddr && !strcmp(moduleName.get(), sLoadedModules[i].mName)) { - found = PR_TRUE; + found = true; break; } } @@ -300,9 +300,9 @@ nsAppShell::DoProcessMoreGeckoEvents() // gecko events get processed. if (mEventloopNestingLevel < 2) { OnDispatchedEvent(nsnull); - mNativeCallbackPending = PR_FALSE; + mNativeCallbackPending = false; } else { - mNativeCallbackPending = PR_TRUE; + mNativeCallbackPending = true; } } @@ -322,7 +322,7 @@ nsAppShell::ProcessNextNativeEvent(bool mayWait) { #if defined(_MSC_VER) && defined(_M_IX86) if (sXPCOMHasLoadedNewDLLs && sLoadedModules) { - sXPCOMHasLoadedNewDLLs = PR_FALSE; + sXPCOMHasLoadedNewDLLs = false; CollectNewLoadedModules(); } #endif @@ -337,7 +337,7 @@ nsAppShell::ProcessNextNativeEvent(bool mayWait) // Give priority to keyboard and mouse messages. if (PeekUIMessage(&msg) || ::PeekMessageW(&msg, NULL, 0, 0, PM_REMOVE)) { - gotMessage = PR_TRUE; + gotMessage = true; if (msg.message == WM_QUIT) { ::PostQuitMessage(msg.wParam); Exit(); diff --git a/widget/src/windows/nsAppShell.h b/widget/src/windows/nsAppShell.h index 61aaa3052091..37e5563992e4 100644 --- a/widget/src/windows/nsAppShell.h +++ b/widget/src/windows/nsAppShell.h @@ -50,7 +50,7 @@ class nsAppShell : public nsBaseAppShell public: nsAppShell() : mEventWnd(NULL), - mNativeCallbackPending(PR_FALSE) + mNativeCallbackPending(false) {} typedef mozilla::TimeStamp TimeStamp; diff --git a/widget/src/windows/nsBidiKeyboard.cpp b/widget/src/windows/nsBidiKeyboard.cpp index 32a5149dddfd..e3f1ebcdfe65 100644 --- a/widget/src/windows/nsBidiKeyboard.cpp +++ b/widget/src/windows/nsBidiKeyboard.cpp @@ -46,8 +46,8 @@ NS_IMPL_ISUPPORTS1(nsBidiKeyboard, nsIBidiKeyboard) nsBidiKeyboard::nsBidiKeyboard() : nsIBidiKeyboard() { - mInitialized = PR_FALSE; - mHaveBidiKeyboards = PR_FALSE; + mInitialized = false; + mHaveBidiKeyboards = false; mLTRKeyboard[0] = '\0'; mRTLKeyboard[0] = '\0'; mCurrentLocaleName[0] = '\0'; @@ -86,7 +86,7 @@ NS_IMETHODIMP nsBidiKeyboard::SetLangFromBidiLevel(PRUint8 aLevel) NS_IMETHODIMP nsBidiKeyboard::IsLangRTL(bool *aIsRTL) { - *aIsRTL = PR_FALSE; + *aIsRTL = false; nsresult result = SetupBidiKeyboards(); if (NS_FAILED(result)) @@ -171,16 +171,16 @@ nsresult nsBidiKeyboard::SetupBidiKeyboards() if (IsRTLLanguage(locale)) { _snwprintf(mRTLKeyboard, KL_NAMELENGTH, L"%.*x", KL_NAMELENGTH - 1, LANGIDFROMLCID((DWORD_PTR)locale)); - isRTLKeyboardSet = PR_TRUE; + isRTLKeyboardSet = true; } else { _snwprintf(mLTRKeyboard, KL_NAMELENGTH, L"%.*x", KL_NAMELENGTH - 1, LANGIDFROMLCID((DWORD_PTR)locale)); - isLTRKeyboardSet = PR_TRUE; + isLTRKeyboardSet = true; } } PR_Free(buf); - mInitialized = PR_TRUE; + mInitialized = true; // If there is not at least one keyboard of each directionality, Bidi // keyboard functionality will be disabled. diff --git a/widget/src/windows/nsClipboard.cpp b/widget/src/windows/nsClipboard.cpp index 974ec11fcede..5c3bf0d46c9b 100644 --- a/widget/src/windows/nsClipboard.cpp +++ b/widget/src/windows/nsClipboard.cpp @@ -91,7 +91,7 @@ nsClipboard::nsClipboard() : nsBaseClipboard() } #endif - mIgnoreEmptyNotification = PR_FALSE; + mIgnoreEmptyNotification = false; mWindow = nsnull; } @@ -259,7 +259,7 @@ NS_IMETHODIMP nsClipboard::SetNativeClipboardData ( PRInt32 aWhichClipboard ) if ( aWhichClipboard != kGlobalClipboard ) return NS_ERROR_FAILURE; - mIgnoreEmptyNotification = PR_TRUE; + mIgnoreEmptyNotification = true; // make sure we have a good transferable if (nsnull == mTransferable) { @@ -275,7 +275,7 @@ NS_IMETHODIMP nsClipboard::SetNativeClipboardData ( PRInt32 aWhichClipboard ) ::OleSetClipboard(NULL); } - mIgnoreEmptyNotification = PR_FALSE; + mIgnoreEmptyNotification = false; return NS_OK; } @@ -615,11 +615,11 @@ nsresult nsClipboard::GetDataFromDataObject(IDataObject * aDataObject, bool dataFound = false; if (nsnull != aDataObject) { if ( NS_SUCCEEDED(GetNativeDataOffClipboard(aDataObject, anIndex, format, flavorStr, &data, &dataLen)) ) - dataFound = PR_TRUE; + dataFound = true; } else if (nsnull != aWindow) { if ( NS_SUCCEEDED(GetNativeDataOffClipboard(aWindow, anIndex, format, &data, &dataLen)) ) - dataFound = PR_TRUE; + dataFound = true; } // This is our second chance to try to find some data, having not found it @@ -644,7 +644,7 @@ nsresult nsClipboard::GetDataFromDataObject(IDataObject * aDataObject, // we have a file path in |data|. Create an nsLocalFile object. nsDependentString filepath(reinterpret_cast(data)); nsCOMPtr file; - if ( NS_SUCCEEDED(NS_NewLocalFile(filepath, PR_FALSE, getter_AddRefs(file))) ) + if ( NS_SUCCEEDED(NS_NewLocalFile(filepath, false, getter_AddRefs(file))) ) genericDataWrapper = do_QueryInterface(file); nsMemory::Free(data); } @@ -712,7 +712,7 @@ nsClipboard :: FindPlatformHTML ( IDataObject* inDataObject, UINT inIndex, void* // the header is ASCII. if (!outData || !*outData) { - return PR_FALSE; + return false; } float vers = 0.0; @@ -722,7 +722,7 @@ nsClipboard :: FindPlatformHTML ( IDataObject* inDataObject, UINT inIndex, void* &vers, &startOfData, &endOfData); if (numFound != 3 || startOfData < -1 || endOfData < -1) { - return PR_FALSE; + return false; } // Fixup the start and end markers if they have no context (set to -1) @@ -736,14 +736,14 @@ nsClipboard :: FindPlatformHTML ( IDataObject* inDataObject, UINT inIndex, void* // Make sure we were passed sane values within our buffer size. if (!endOfData || startOfData >= endOfData || endOfData > *outDataLen) { - return PR_FALSE; + return false; } // We want to return the buffer not offset by startOfData because it will be // parsed out later (probably by nsHTMLEditor::ParseCFHTML) when it is still // in CF_HTML format. *outDataLen = endOfData; - return PR_TRUE; + return true; } @@ -772,7 +772,7 @@ nsClipboard :: FindUnicodeFromPlainText ( IDataObject* inDataObject, UINT inInde nsMemory::Free(*outData); *outData = convertedText; *outDataLen = convertedTextLen * sizeof(PRUnichar); - dataFound = PR_TRUE; + dataFound = true; } } // if plain text data on clipboard @@ -799,7 +799,7 @@ nsClipboard :: FindURLFromLocalFile ( IDataObject* inDataObject, UINT inIndex, v // we have a file path in |data|. Is it an internet shortcut or a normal file? const nsDependentString filepath(static_cast(*outData)); nsCOMPtr file; - nsresult rv = NS_NewLocalFile(filepath, PR_TRUE, getter_AddRefs(file)); + nsresult rv = NS_NewLocalFile(filepath, true, getter_AddRefs(file)); if (NS_FAILED(rv)) { nsMemory::Free(*outData); return dataFound; @@ -823,7 +823,7 @@ nsClipboard :: FindURLFromLocalFile ( IDataObject* inDataObject, UINT inIndex, v *outData = ToNewUnicode(urlString + NS_LITERAL_STRING("\n") + title); *outDataLen = nsCRT::strlen(static_cast(*outData)) * sizeof(PRUnichar); - dataFound = PR_TRUE; + dataFound = true; } } else { @@ -835,7 +835,7 @@ nsClipboard :: FindURLFromLocalFile ( IDataObject* inDataObject, UINT inIndex, v nsMemory::Free(*outData); *outData = UTF8ToNewUnicode(urlSpec); *outDataLen = nsCRT::strlen(static_cast(*outData)) * sizeof(PRUnichar); - dataFound = PR_TRUE; + dataFound = true; } // else regular file } @@ -866,7 +866,7 @@ nsClipboard :: FindURLFromNativeURL ( IDataObject* inDataObject, UINT inIndex, v *outData = ToNewUnicode(urlString + NS_LITERAL_STRING("\n") + urlString); *outDataLen = nsCRT::strlen(static_cast(*outData)) * sizeof(PRUnichar); nsMemory::Free(tempOutData); - dataFound = PR_TRUE; + dataFound = true; } else { loadResult = GetNativeDataOffClipboard(inDataObject, inIndex, ::RegisterClipboardFormat(CFSTR_INETURLA), nsnull, &tempOutData, &tempDataLen); @@ -888,7 +888,7 @@ nsClipboard :: FindURLFromNativeURL ( IDataObject* inDataObject, UINT inIndex, v *outData = ToNewUnicode(urlString + NS_LITERAL_STRING("\n") + urlString); *outDataLen = nsCRT::strlen(static_cast(*outData)) * sizeof(PRUnichar); nsMemory::Free(tempOutData); - dataFound = PR_TRUE; + dataFound = true; } } @@ -959,7 +959,7 @@ NS_IMETHODIMP nsClipboard::HasDataMatchingFlavors(const char** aFlavorList, PRInt32 aWhichClipboard, bool *_retval) { - *_retval = PR_FALSE; + *_retval = false; if (aWhichClipboard != kGlobalClipboard || !aFlavorList) return NS_OK; @@ -971,7 +971,7 @@ NS_IMETHODIMP nsClipboard::HasDataMatchingFlavors(const char** aFlavorList, UINT format = GetFormat(aFlavorList[i]); if (IsClipboardFormatAvailable(format)) { - *_retval = PR_TRUE; + *_retval = true; break; } else { @@ -981,7 +981,7 @@ NS_IMETHODIMP nsClipboard::HasDataMatchingFlavors(const char** aFlavorList, // client asked for unicode and it wasn't present, check if we have CF_TEXT. // We'll handle the actual data substitution in the data object. if (IsClipboardFormatAvailable(GetFormat(kTextMime))) - *_retval = PR_TRUE; + *_retval = true; } } } diff --git a/widget/src/windows/nsDataObj.cpp b/widget/src/windows/nsDataObj.cpp index dde1f37f6b6f..af52a886fed9 100644 --- a/widget/src/windows/nsDataObj.cpp +++ b/widget/src/windows/nsDataObj.cpp @@ -193,7 +193,7 @@ nsresult nsDataObj::CStream::WaitForCompletion() // We are guaranteed OnStopRequest will get called, so this should be ok. while (!mChannelRead) { // Pump messages - NS_ProcessNextEvent(nsnull, PR_TRUE); + NS_ProcessNextEvent(nsnull, true); } if (!mChannelData.Length()) @@ -483,7 +483,7 @@ STDMETHODIMP_(ULONG) nsDataObj::Release() 500, nsITimer::TYPE_ONE_SHOT); return AddRef(); } - mCachedTempFile->Remove(PR_FALSE); + mCachedTempFile->Remove(false); mCachedTempFile = NULL; } @@ -558,13 +558,13 @@ STDMETHODIMP nsDataObj::GetData(LPFORMATETC aFormat, LPSTGMEDIUM pSTM) default: if ( format == fileDescriptorFlavorA ) - return GetFileDescriptor ( *aFormat, *pSTM, PR_FALSE ); + return GetFileDescriptor ( *aFormat, *pSTM, false ); if ( format == fileDescriptorFlavorW ) - return GetFileDescriptor ( *aFormat, *pSTM, PR_TRUE); + return GetFileDescriptor ( *aFormat, *pSTM, true); if ( format == uniformResourceLocatorA ) - return GetUniformResourceLocator( *aFormat, *pSTM, PR_FALSE); + return GetUniformResourceLocator( *aFormat, *pSTM, false); if ( format == uniformResourceLocatorW ) - return GetUniformResourceLocator( *aFormat, *pSTM, PR_TRUE); + return GetUniformResourceLocator( *aFormat, *pSTM, true); if ( format == fileFlavor ) return GetFileContents ( *aFormat, *pSTM ); if ( format == PreferredDropEffect ) @@ -664,7 +664,7 @@ nsDataObj::LookupArbitraryFormat(FORMATETC *aFormat, LPDATAENTRY *aDataEntry, BO *aDataEntry = NULL; if (aFormat->ptd != NULL) - return PR_FALSE; + return false; // See if it's already in our list. If so return the data entry. for (PRUint32 idx = 0; idx < mDataEntryList.Length(); idx++) { @@ -675,21 +675,21 @@ nsDataObj::LookupArbitraryFormat(FORMATETC *aFormat, LPDATAENTRY *aDataEntry, BO // If the caller requests we update, or if the // medium type matches, return the entry. *aDataEntry = mDataEntryList[idx]; - return PR_TRUE; + return true; } else { // Medium does not match, not found. - return PR_FALSE; + return false; } } } if (!aAddorUpdate) - return PR_FALSE; + return false; // Add another entry to mDataEntryList LPDATAENTRY dataEntry = (LPDATAENTRY)CoTaskMemAlloc(sizeof(DATAENTRY)); if (!dataEntry) - return PR_FALSE; + return false; dataEntry->fe = *aFormat; *aDataEntry = dataEntry; @@ -702,7 +702,7 @@ nsDataObj::LookupArbitraryFormat(FORMATETC *aFormat, LPDATAENTRY *aDataEntry, BO // Store a copy internally in the arbitrary formats array. mDataEntryList.AppendElement(dataEntry); - return PR_TRUE; + return true; } bool @@ -721,10 +721,10 @@ nsDataObj::CopyMediumData(STGMEDIUM *aMediumDst, STGMEDIUM *aMediumSrc, LPFORMAT if (!aMediumSrc->pUnkForRelease) { if (aSetData) { if (aMediumSrc->tymed != TYMED_HGLOBAL) - return PR_FALSE; + return false; stgmOut.hGlobal = OleDuplicateData(aMediumSrc->hGlobal, aFormat->cfFormat, 0); if (!stgmOut.hGlobal) - return PR_FALSE; + return false; } else { // We are returning this data from LookupArbitraryFormat, indicate to the // shell we hold it and will free it. @@ -733,7 +733,7 @@ nsDataObj::CopyMediumData(STGMEDIUM *aMediumDst, STGMEDIUM *aMediumSrc, LPFORMAT } break; default: - return PR_FALSE; + return false; } if (stgmOut.pUnkForRelease) @@ -741,7 +741,7 @@ nsDataObj::CopyMediumData(STGMEDIUM *aMediumDst, STGMEDIUM *aMediumSrc, LPFORMAT *aMediumDst = stgmOut; - return PR_TRUE; + return true; } //----------------------------------------------------- @@ -947,7 +947,7 @@ MangleTextToValidFilename(nsString & aText) }; aText.StripChars(FILE_PATH_SEPARATOR FILE_ILLEGAL_CHARACTERS); - aText.CompressWhitespace(PR_TRUE, PR_TRUE); + aText.CompressWhitespace(true, true); PRUint32 nameLen; for (size_t n = 0; n < NS_ARRAY_LENGTH(forbiddenNames); ++n) { nameLen = (PRUint32) strlen(forbiddenNames[n]); @@ -977,7 +977,7 @@ CreateFilenameFromTextA(nsString & aText, const char * aExtension, // text empty. MangleTextToValidFilename(aText); if (aText.IsEmpty()) - return PR_FALSE; + return false; // repeatably call WideCharToMultiByte as long as the title doesn't fit in the buffer // available to us. Continually reduce the length of the source title until the MBCS @@ -995,11 +995,11 @@ CreateFilenameFromTextA(nsString & aText, const char * aExtension, while (currLen == 0 && textLen > 0 && GetLastError() == ERROR_INSUFFICIENT_BUFFER); if (currLen > 0 && textLen > 0) { strcpy(&aFilename[currLen], aExtension); - return PR_TRUE; + return true; } else { // empty names aren't permitted - return PR_FALSE; + return false; } } @@ -1012,14 +1012,14 @@ CreateFilenameFromTextW(nsString & aText, const wchar_t * aExtension, // text empty. MangleTextToValidFilename(aText); if (aText.IsEmpty()) - return PR_FALSE; + return false; const int extensionLen = wcslen(aExtension); if (aText.Length() + extensionLen + 1 > aFilenameLen) aText.Truncate(aFilenameLen - extensionLen - 1); wcscpy(&aFilename[0], aText.get()); wcscpy(&aFilename[aText.Length()], aExtension); - return PR_TRUE; + return true; } #define PAGEINFO_PROPERTIES "chrome://navigator/locale/pageInfo.properties" @@ -1030,13 +1030,13 @@ GetLocalizedString(const PRUnichar * aName, nsXPIDLString & aString) nsCOMPtr stringService = mozilla::services::GetStringBundleService(); if (!stringService) - return PR_FALSE; + return false; nsCOMPtr stringBundle; nsresult rv = stringService->CreateBundle(PAGEINFO_PROPERTIES, getter_AddRefs(stringBundle)); if (NS_FAILED(rv)) - return PR_FALSE; + return false; rv = stringBundle->GetStringFromName(aName, getter_Copies(aString)); return NS_SUCCEEDED(rv); @@ -1180,12 +1180,12 @@ nsDataObj :: GetFileContentsInternetShortcut ( FORMATETC& aFE, STGMEDIUM& aSTG ) bool nsDataObj :: IsFlavourPresent(const char *inFlavour) { bool retval = false; - NS_ENSURE_TRUE(mTransferable, PR_FALSE); + NS_ENSURE_TRUE(mTransferable, false); // get the list of flavors available in the transferable nsCOMPtr flavorList; mTransferable->FlavorsTransferableCanExport(getter_AddRefs(flavorList)); - NS_ENSURE_TRUE(flavorList, PR_FALSE); + NS_ENSURE_TRUE(flavorList, false); // try to find requested flavour PRUint32 cnt; @@ -1198,7 +1198,7 @@ bool nsDataObj :: IsFlavourPresent(const char *inFlavour) nsCAutoString flavorStr; currentFlavor->GetData(flavorStr); if (flavorStr.Equals(inFlavour)) { - retval = PR_TRUE; // found it! + retval = true; // found it! break; } } @@ -2143,7 +2143,7 @@ void nsDataObj::RemoveTempFile(nsITimer* aTimer, void* aClosure) { nsDataObj *timedDataObj = static_cast(aClosure); if (timedDataObj->mCachedTempFile) { - timedDataObj->mCachedTempFile->Remove(PR_FALSE); + timedDataObj->mCachedTempFile->Remove(false); timedDataObj->mCachedTempFile = NULL; } timedDataObj->Release(); diff --git a/widget/src/windows/nsDeviceContextSpecWin.cpp b/widget/src/windows/nsDeviceContextSpecWin.cpp index 76836ecb7c39..1272024b98ae 100644 --- a/widget/src/windows/nsDeviceContextSpecWin.cpp +++ b/widget/src/windows/nsDeviceContextSpecWin.cpp @@ -125,47 +125,47 @@ typedef struct { // There are around 40 default print sizes defined by Windows const NativePaperSizes kPaperSizes[] = { - {DMPAPER_LETTER, 8.5, 11.0, PR_TRUE}, - {DMPAPER_LEGAL, 8.5, 14.0, PR_TRUE}, - {DMPAPER_A4, 210.0, 297.0, PR_FALSE}, - {DMPAPER_B4, 250.0, 354.0, PR_FALSE}, - {DMPAPER_B5, 182.0, 257.0, PR_FALSE}, - {DMPAPER_TABLOID, 11.0, 17.0, PR_TRUE}, - {DMPAPER_LEDGER, 17.0, 11.0, PR_TRUE}, - {DMPAPER_STATEMENT, 5.5, 8.5, PR_TRUE}, - {DMPAPER_EXECUTIVE, 7.25, 10.5, PR_TRUE}, - {DMPAPER_A3, 297.0, 420.0, PR_FALSE}, - {DMPAPER_A5, 148.0, 210.0, PR_FALSE}, - {DMPAPER_CSHEET, 17.0, 22.0, PR_TRUE}, - {DMPAPER_DSHEET, 22.0, 34.0, PR_TRUE}, - {DMPAPER_ESHEET, 34.0, 44.0, PR_TRUE}, - {DMPAPER_LETTERSMALL, 8.5, 11.0, PR_TRUE}, - {DMPAPER_A4SMALL, 210.0, 297.0, PR_FALSE}, - {DMPAPER_FOLIO, 8.5, 13.0, PR_TRUE}, - {DMPAPER_QUARTO, 215.0, 275.0, PR_FALSE}, - {DMPAPER_10X14, 10.0, 14.0, PR_TRUE}, - {DMPAPER_11X17, 11.0, 17.0, PR_TRUE}, - {DMPAPER_NOTE, 8.5, 11.0, PR_TRUE}, - {DMPAPER_ENV_9, 3.875, 8.875, PR_TRUE}, - {DMPAPER_ENV_10, 40.125, 9.5, PR_TRUE}, - {DMPAPER_ENV_11, 4.5, 10.375, PR_TRUE}, - {DMPAPER_ENV_12, 4.75, 11.0, PR_TRUE}, - {DMPAPER_ENV_14, 5.0, 11.5, PR_TRUE}, - {DMPAPER_ENV_DL, 110.0, 220.0, PR_FALSE}, - {DMPAPER_ENV_C5, 162.0, 229.0, PR_FALSE}, - {DMPAPER_ENV_C3, 324.0, 458.0, PR_FALSE}, - {DMPAPER_ENV_C4, 229.0, 324.0, PR_FALSE}, - {DMPAPER_ENV_C6, 114.0, 162.0, PR_FALSE}, - {DMPAPER_ENV_C65, 114.0, 229.0, PR_FALSE}, - {DMPAPER_ENV_B4, 250.0, 353.0, PR_FALSE}, - {DMPAPER_ENV_B5, 176.0, 250.0, PR_FALSE}, - {DMPAPER_ENV_B6, 176.0, 125.0, PR_FALSE}, - {DMPAPER_ENV_ITALY, 110.0, 230.0, PR_FALSE}, - {DMPAPER_ENV_MONARCH, 3.875, 7.5, PR_TRUE}, - {DMPAPER_ENV_PERSONAL, 3.625, 6.5, PR_TRUE}, - {DMPAPER_FANFOLD_US, 14.875, 11.0, PR_TRUE}, - {DMPAPER_FANFOLD_STD_GERMAN, 8.5, 12.0, PR_TRUE}, - {DMPAPER_FANFOLD_LGL_GERMAN, 8.5, 13.0, PR_TRUE}, + {DMPAPER_LETTER, 8.5, 11.0, true}, + {DMPAPER_LEGAL, 8.5, 14.0, true}, + {DMPAPER_A4, 210.0, 297.0, false}, + {DMPAPER_B4, 250.0, 354.0, false}, + {DMPAPER_B5, 182.0, 257.0, false}, + {DMPAPER_TABLOID, 11.0, 17.0, true}, + {DMPAPER_LEDGER, 17.0, 11.0, true}, + {DMPAPER_STATEMENT, 5.5, 8.5, true}, + {DMPAPER_EXECUTIVE, 7.25, 10.5, true}, + {DMPAPER_A3, 297.0, 420.0, false}, + {DMPAPER_A5, 148.0, 210.0, false}, + {DMPAPER_CSHEET, 17.0, 22.0, true}, + {DMPAPER_DSHEET, 22.0, 34.0, true}, + {DMPAPER_ESHEET, 34.0, 44.0, true}, + {DMPAPER_LETTERSMALL, 8.5, 11.0, true}, + {DMPAPER_A4SMALL, 210.0, 297.0, false}, + {DMPAPER_FOLIO, 8.5, 13.0, true}, + {DMPAPER_QUARTO, 215.0, 275.0, false}, + {DMPAPER_10X14, 10.0, 14.0, true}, + {DMPAPER_11X17, 11.0, 17.0, true}, + {DMPAPER_NOTE, 8.5, 11.0, true}, + {DMPAPER_ENV_9, 3.875, 8.875, true}, + {DMPAPER_ENV_10, 40.125, 9.5, true}, + {DMPAPER_ENV_11, 4.5, 10.375, true}, + {DMPAPER_ENV_12, 4.75, 11.0, true}, + {DMPAPER_ENV_14, 5.0, 11.5, true}, + {DMPAPER_ENV_DL, 110.0, 220.0, false}, + {DMPAPER_ENV_C5, 162.0, 229.0, false}, + {DMPAPER_ENV_C3, 324.0, 458.0, false}, + {DMPAPER_ENV_C4, 229.0, 324.0, false}, + {DMPAPER_ENV_C6, 114.0, 162.0, false}, + {DMPAPER_ENV_C65, 114.0, 229.0, false}, + {DMPAPER_ENV_B4, 250.0, 353.0, false}, + {DMPAPER_ENV_B5, 176.0, 250.0, false}, + {DMPAPER_ENV_B6, 176.0, 125.0, false}, + {DMPAPER_ENV_ITALY, 110.0, 230.0, false}, + {DMPAPER_ENV_MONARCH, 3.875, 7.5, true}, + {DMPAPER_ENV_PERSONAL, 3.625, 6.5, true}, + {DMPAPER_FANFOLD_US, 14.875, 11.0, true}, + {DMPAPER_FANFOLD_STD_GERMAN, 8.5, 12.0, true}, + {DMPAPER_FANFOLD_LGL_GERMAN, 8.5, 13.0, true}, }; const PRInt32 kNumPaperSizes = 41; @@ -238,7 +238,7 @@ EnumerateNativePrinters(DWORD aWhichPrinters, LPWSTR aPrinterName, bool& aIsFoun for (DWORD i = 0; i < dwNumItems; i++ ) { if (wcscmp(lpInfo[i].pPrinterName, aPrinterName) == 0) { - aIsFound = PR_TRUE; + aIsFound = true; aIsFile = wcscmp(lpInfo[i].pPortName, L"FILE:") == 0; break; } @@ -253,7 +253,7 @@ static void CheckForPrintToFileWithName(LPWSTR aPrinterName, bool& aIsFile) { bool isFound = false; - aIsFile = PR_FALSE; + aIsFile = false; nsresult rv = EnumerateNativePrinters(PRINTER_ENUM_LOCAL, aPrinterName, isFound, aIsFile); if (isFound) return; @@ -343,7 +343,7 @@ GetFileNameForPrintSettings(nsIPrintSettings* aPS) bool isFile; rv = localFile->IsFile(&isFile); if (NS_SUCCEEDED(rv) && isFile) { - rv = localFile->Remove(PR_FALSE /* recursive delete */); + rv = localFile->Remove(false /* recursive delete */); NS_ENSURE_SUCCESS(rv, rv); } } @@ -765,7 +765,7 @@ nsDeviceContextSpecWin::SetPrintSettingsFromDevMode(nsIPrintSettings* aPrintSett if (aPrintSettings == nsnull) { return NS_ERROR_FAILURE; } - aPrintSettings->SetIsInitializedFromPrinter(PR_TRUE); + aPrintSettings->SetIsInitializedFromPrinter(true); BOOL doingNumCopies = aDevMode->dmFields & DM_COPIES; BOOL doingOrientation = aDevMode->dmFields & DM_ORIENTATION; @@ -790,7 +790,7 @@ nsDeviceContextSpecWin::SetPrintSettingsFromDevMode(nsIPrintSettings* aPrintSett aPrintSettings->SetScaling(scale); aDevMode->dmScale = 100; // To turn this on you must change where the mPrt->mShrinkToFit is being set in the DocumentViewer - //aPrintSettings->SetShrinkToFit(PR_FALSE); + //aPrintSettings->SetShrinkToFit(false); } } @@ -814,7 +814,7 @@ nsDeviceContextSpecWin::SetPrintSettingsFromDevMode(nsIPrintSettings* aPrintSett aPrintSettings->SetPaperHeight(kPaperSizes[i].mHeight); aPrintSettings->SetPaperSizeUnit(kPaperSizes[i].mIsInches ?PRInt16(nsIPrintSettings::kPaperSizeInches):nsIPrintSettings::kPaperSizeMillimeters); - found = PR_TRUE; + found = true; break; } } diff --git a/widget/src/windows/nsDragService.cpp b/widget/src/windows/nsDragService.cpp index 30d99272deff..2dcede30d923 100644 --- a/widget/src/windows/nsDragService.cpp +++ b/widget/src/windows/nsDragService.cpp @@ -81,7 +81,7 @@ // //------------------------------------------------------------------------- nsDragService::nsDragService() - : mNativeDragSrc(nsnull), mNativeDragTarget(nsnull), mDataObject(nsnull), mSentLocalDropEvent(PR_FALSE) + : mNativeDragSrc(nsnull), mNativeDragTarget(nsnull), mDataObject(nsnull), mSentLocalDropEvent(false) { } @@ -103,11 +103,11 @@ nsDragService::CreateDragImage(nsIDOMNode *aDOMNode, SHDRAGIMAGE *psdi) { if (!psdi) - return PR_FALSE; + return false; memset(psdi, 0, sizeof(SHDRAGIMAGE)); if (!aDOMNode) - return PR_FALSE; + return false; // Prepare the drag image nsIntRect dragRect; @@ -117,12 +117,12 @@ nsDragService::CreateDragImage(nsIDOMNode *aDOMNode, mScreenX, mScreenY, &dragRect, getter_AddRefs(surface), &pc); if (!surface) - return PR_FALSE; + return false; PRUint32 bmWidth = dragRect.width, bmHeight = dragRect.height; if (bmWidth == 0 || bmHeight == 0) - return PR_FALSE; + return false; psdi->crColorKey = CLR_NONE; @@ -130,11 +130,11 @@ nsDragService::CreateDragImage(nsIDOMNode *aDOMNode, gfxIntSize(bmWidth, bmHeight), gfxImageSurface::ImageFormatARGB32); if (!imgSurface) - return PR_FALSE; + return false; nsRefPtr context = new gfxContext(imgSurface); if (!context) - return PR_FALSE; + return false; context->SetOperator(gfxContext::OPERATOR_SOURCE); context->SetSource(surface); @@ -298,7 +298,7 @@ nsDragService::StartInvokingDragSession(IDataObject * aDataObj, // XXX not sure why we bother to cache this, it can change during // the drag mDragAction = aActionType; - mSentLocalDropEvent = PR_FALSE; + mSentLocalDropEvent = false; // Start dragging StartDragSession(); @@ -351,9 +351,9 @@ nsDragService::StartInvokingDragSession(IDataObject * aDataObj, cpos.x = GET_X_LPARAM(pos); cpos.y = GET_Y_LPARAM(pos); SetDragEndPoint(nsIntPoint(cpos.x, cpos.y)); - EndDragSession(PR_TRUE); + EndDragSession(true); - mDoingDrag = PR_FALSE; + mDoingDrag = false; return DRAGDROP_S_DROP == res ? NS_OK : NS_ERROR_FAILURE; } @@ -485,7 +485,7 @@ nsDragService::SetDroppedLocal() { // Sent from the native drag handler, letting us know // a drop occurred within the application vs. outside of it. - mSentLocalDropEvent = PR_TRUE; + mSentLocalDropEvent = true; return; } @@ -501,7 +501,7 @@ nsDragService::IsDataFlavorSupported(const char *aDataFlavor, bool *_retval) NS_WARNING("DO NOT USE THE text/plain DATA FLAVOR ANY MORE. USE text/unicode INSTEAD"); #endif - *_retval = PR_FALSE; + *_retval = false; FORMATETC fe; UINT format = 0; @@ -520,7 +520,7 @@ nsDragService::IsDataFlavorSupported(const char *aDataFlavor, bool *_retval) for (PRUint32 i=0;iGetDataObjectAt(i); if (S_OK == dataObj->QueryGetData(&fe)) - *_retval = PR_TRUE; // found it! + *_retval = true; // found it! } } } // if special collection object @@ -533,7 +533,7 @@ nsDragService::IsDataFlavorSupported(const char *aDataFlavor, bool *_retval) SET_FORMATETC(fe, format, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL | TYMED_FILE | TYMED_GDI); if (mDataObject->QueryGetData(&fe) == S_OK) - *_retval = PR_TRUE; // found it! + *_retval = true; // found it! else { // We haven't found the exact flavor the client asked for, but // maybe we can still find it from something else that's on the @@ -546,7 +546,7 @@ nsDragService::IsDataFlavorSupported(const char *aDataFlavor, bool *_retval) SET_FORMATETC(fe, format, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL | TYMED_FILE | TYMED_GDI); if (mDataObject->QueryGetData(&fe) == S_OK) - *_retval = PR_TRUE; // found it! + *_retval = true; // found it! } else if (strcmp(aDataFlavor, kURLMime) == 0) { // client asked for a url and it wasn't present, but if we @@ -556,7 +556,7 @@ nsDragService::IsDataFlavorSupported(const char *aDataFlavor, bool *_retval) SET_FORMATETC(fe, format, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL | TYMED_FILE | TYMED_GDI); if (mDataObject->QueryGetData(&fe) == S_OK) - *_retval = PR_TRUE; // found it! + *_retval = true; // found it! } } // else try again } @@ -589,7 +589,7 @@ nsDragService::IsCollectionObject(IDataObject* inDataObj) // ask the object if it supports it. If yes, we have a collection // object if (inDataObj->QueryGetData(&sFE) == S_OK) - isCollection = PR_TRUE; + isCollection = true; return isCollection; diff --git a/widget/src/windows/nsFilePicker.cpp b/widget/src/windows/nsFilePicker.cpp index b25d9cfe2736..4c8424196dc5 100644 --- a/widget/src/windows/nsFilePicker.cpp +++ b/widget/src/windows/nsFilePicker.cpp @@ -218,7 +218,7 @@ NS_IMETHODIMP nsFilePicker::ShowW(PRInt16 *aReturnVal) if (mParentWidget) { nsIWidget *tmp = mParentWidget; nsWindow *parent = static_cast(tmp); - parent->SuppressBlurEvents(PR_TRUE); + parent->SuppressBlurEvents(true); } bool result = false; @@ -387,7 +387,7 @@ NS_IMETHODIMP nsFilePicker::ShowW(PRInt16 *aReturnVal) // Don't follow shortcuts when saving a shortcut, this can be used // to trick users (bug 271732) NS_ConvertUTF16toUTF8 ext(mDefault); - ext.Trim(" .", PR_FALSE, PR_TRUE); // watch out for trailing space and dots + ext.Trim(" .", false, true); // watch out for trailing space and dots ToLowerCase(ext); if (StringEndsWith(ext, NS_LITERAL_CSTRING(".lnk")) || StringEndsWith(ext, NS_LITERAL_CSTRING(".pif")) || @@ -411,12 +411,12 @@ NS_IMETHODIMP nsFilePicker::ShowW(PRInt16 *aReturnVal) NS_ERROR("unsupported mode"); } } - MOZ_SEH_EXCEPT(PR_TRUE) { + MOZ_SEH_EXCEPT(true) { MessageBoxW(ofn.hwndOwner, 0, L"The filepicker was unexpectedly closed by Windows.", MB_ICONERROR); - result = PR_FALSE; + result = false; } if (result) { @@ -536,7 +536,7 @@ NS_IMETHODIMP nsFilePicker::ShowW(PRInt16 *aReturnVal) if (mParentWidget) { nsIWidget *tmp = mParentWidget; nsWindow *parent = static_cast(tmp); - parent->SuppressBlurEvents(PR_FALSE); + parent->SuppressBlurEvents(false); } return NS_OK; diff --git a/widget/src/windows/nsIMM32Handler.cpp b/widget/src/windows/nsIMM32Handler.cpp index bb61774505df..a6b8d4786ffe 100644 --- a/widget/src/windows/nsIMM32Handler.cpp +++ b/widget/src/windows/nsIMM32Handler.cpp @@ -145,10 +145,10 @@ nsIMM32Handler::IsComposingWindow(nsWindow* aWindow) nsIMM32Handler::IsTopLevelWindowOfComposition(nsWindow* aWindow) { if (!gIMM32Handler || !gIMM32Handler->mComposingWindow) { - return PR_FALSE; + return false; } HWND wnd = gIMM32Handler->mComposingWindow->GetWindowHandle(); - return nsWindow::GetTopLevelHWND(wnd, PR_TRUE) == aWindow->GetWindowHandle(); + return nsWindow::GetTopLevelHWND(wnd, true) == aWindow->GetWindowHandle(); } /* static */ bool @@ -238,8 +238,8 @@ nsIMM32Handler::CanOptimizeKeyAndIMEMessages(MSG *aNextKeyOrIMEMessage) nsIMM32Handler::nsIMM32Handler() : mComposingWindow(nsnull), mCursorPosition(NO_IME_CARET), mCompositionStart(0), - mIsComposing(PR_FALSE), mIsComposingOnPlugin(PR_FALSE), - mNativeCaretIsCreated(PR_FALSE) + mIsComposing(false), mIsComposingOnPlugin(false), + mNativeCaretIsCreated(false) { PR_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: nsIMM32Handler is created\n")); } @@ -306,7 +306,7 @@ nsIMM32Handler::CommitComposition(nsWindow* aWindow, bool aForce) } if (associated) { - aWindow->AssociateDefaultIMC(PR_FALSE); + aWindow->AssociateDefaultIMC(false); } } @@ -336,7 +336,7 @@ nsIMM32Handler::CancelComposition(nsWindow* aWindow, bool aForce) } if (associated) { - aWindow->AssociateDefaultIMC(PR_FALSE); + aWindow->AssociateDefaultIMC(false); } } @@ -348,7 +348,7 @@ nsIMM32Handler::ProcessInputLangChangeMessage(nsWindow* aWindow, bool &aEatMessage) { *aRetValue = 0; - aEatMessage = PR_FALSE; + aEatMessage = false; // We don't need to create the instance of the handler here. if (gIMM32Handler) { aEatMessage = gIMM32Handler->OnInputLangChange(aWindow, wParam, lParam); @@ -359,7 +359,7 @@ nsIMM32Handler::ProcessInputLangChangeMessage(nsWindow* aWindow, Terminate(); // Don't return as "processed", the messages should be processed on nsWindow // too. - return PR_FALSE; + return false; } /* static */ bool @@ -383,7 +383,7 @@ nsIMM32Handler::ProcessMessage(nsWindow* aWindow, UINT msg, case WM_IME_SETCONTEXT: // For safety, we should reset sIsIMEOpening when we receive unexpected // message. - sIsIMEOpening = PR_FALSE; + sIsIMEOpening = false; } } @@ -401,15 +401,15 @@ nsIMM32Handler::ProcessMessage(nsWindow* aWindow, UINT msg, case WM_RBUTTONDOWN: { // We don't need to create the instance of the handler here. if (!gIMM32Handler) - return PR_FALSE; + return false; if (!gIMM32Handler->OnMouseEvent(aWindow, lParam, msg == WM_LBUTTONDOWN ? IMEMOUSE_LDOWN : msg == WM_MBUTTONDOWN ? IMEMOUSE_MDOWN : IMEMOUSE_RDOWN)) { - return PR_FALSE; + return false; } - aEatMessage = PR_FALSE; - return PR_TRUE; + aEatMessage = false; + return true; } case WM_INPUTLANGCHANGE: return ProcessInputLangChangeMessage(aWindow, wParam, lParam, @@ -417,37 +417,37 @@ nsIMM32Handler::ProcessMessage(nsWindow* aWindow, UINT msg, case WM_IME_STARTCOMPOSITION: EnsureHandlerInstance(); aEatMessage = gIMM32Handler->OnIMEStartComposition(aWindow); - return PR_TRUE; + return true; case WM_IME_COMPOSITION: EnsureHandlerInstance(); aEatMessage = gIMM32Handler->OnIMEComposition(aWindow, wParam, lParam); - return PR_TRUE; + return true; case WM_IME_ENDCOMPOSITION: EnsureHandlerInstance(); aEatMessage = gIMM32Handler->OnIMEEndComposition(aWindow); - return PR_TRUE; + return true; case WM_IME_CHAR: aEatMessage = OnIMEChar(aWindow, wParam, lParam); - return PR_TRUE; + return true; case WM_IME_NOTIFY: aEatMessage = OnIMENotify(aWindow, wParam, lParam); - return PR_TRUE; + return true; case WM_IME_REQUEST: EnsureHandlerInstance(); aEatMessage = gIMM32Handler->OnIMERequest(aWindow, wParam, lParam, aRetValue); - return PR_TRUE; + return true; case WM_IME_SELECT: aEatMessage = OnIMESelect(aWindow, wParam, lParam); - return PR_TRUE; + return true; case WM_IME_SETCONTEXT: aEatMessage = OnIMESetContext(aWindow, wParam, lParam, aRetValue); - return PR_TRUE; + return true; case WM_KEYDOWN: return OnKeyDownEvent(aWindow, wParam, lParam, aEatMessage); case WM_CHAR: if (!gIMM32Handler) { - return PR_FALSE; + return false; } aEatMessage = gIMM32Handler->OnChar(aWindow, wParam, lParam); // If we eat this message, we should return "processed", otherwise, @@ -455,7 +455,7 @@ nsIMM32Handler::ProcessMessage(nsWindow* aWindow, UINT msg, // "not processed" at that time. return aEatMessage; default: - return PR_FALSE; + return false; }; } @@ -466,42 +466,42 @@ nsIMM32Handler::ProcessMessageForPlugin(nsWindow* aWindow, UINT msg, bool &aEatMessage) { *aRetValue = 0; - aEatMessage = PR_FALSE; + aEatMessage = false; switch (msg) { case WM_INPUTLANGCHANGEREQUEST: case WM_INPUTLANGCHANGE: - aWindow->DispatchPluginEvent(msg, wParam, lParam, PR_FALSE); + aWindow->DispatchPluginEvent(msg, wParam, lParam, false); return ProcessInputLangChangeMessage(aWindow, wParam, lParam, aRetValue, aEatMessage); case WM_IME_COMPOSITION: EnsureHandlerInstance(); aEatMessage = gIMM32Handler->OnIMECompositionOnPlugin(aWindow, wParam, lParam); - return PR_TRUE; + return true; case WM_IME_STARTCOMPOSITION: EnsureHandlerInstance(); aEatMessage = gIMM32Handler->OnIMEStartCompositionOnPlugin(aWindow, wParam, lParam); - return PR_TRUE; + return true; case WM_IME_ENDCOMPOSITION: EnsureHandlerInstance(); aEatMessage = gIMM32Handler->OnIMEEndCompositionOnPlugin(aWindow, wParam, lParam); - return PR_TRUE; + return true; case WM_IME_CHAR: EnsureHandlerInstance(); aEatMessage = gIMM32Handler->OnIMECharOnPlugin(aWindow, wParam, lParam); - return PR_TRUE; + return true; case WM_IME_SETCONTEXT: aEatMessage = OnIMESetContextOnPlugin(aWindow, wParam, lParam, aRetValue); - return PR_TRUE; + return true; case WM_IME_NOTIFY: if (wParam == IMN_SETOPENSTATUS) { // finished being opening - sIsIMEOpening = PR_FALSE; + sIsIMEOpening = false; } - return PR_FALSE; + return false; case WM_KEYDOWN: if (wParam == VK_PROCESSKEY) { // If we receive when IME isn't open, it means IME is opening right now. @@ -509,24 +509,24 @@ nsIMM32Handler::ProcessMessageForPlugin(nsWindow* aWindow, UINT msg, sIsIMEOpening = IMEContext.IsValid() && ::ImmGetOpenStatus(IMEContext.get()); } - return PR_FALSE; + return false; case WM_CHAR: if (!gIMM32Handler) { - return PR_FALSE; + return false; } aEatMessage = gIMM32Handler->OnCharOnPlugin(aWindow, wParam, lParam); - return PR_FALSE; // is going to be handled by nsWindow. + return false; // is going to be handled by nsWindow. case WM_IME_COMPOSITIONFULL: case WM_IME_CONTROL: case WM_IME_KEYDOWN: case WM_IME_KEYUP: case WM_IME_REQUEST: case WM_IME_SELECT: - aEatMessage = aWindow->DispatchPluginEvent(msg, wParam, lParam, PR_FALSE); - return PR_TRUE; + aEatMessage = aWindow->DispatchPluginEvent(msg, wParam, lParam, false); + return true; } - return PR_FALSE; + return false; } /**************************************************************************** @@ -549,7 +549,7 @@ nsIMM32Handler::OnInputLangChange(nsWindow* aWindow, HandleEndComposition(aWindow); } - return PR_FALSE; + return false; } bool @@ -609,7 +609,7 @@ nsIMM32Handler::OnIMEEndComposition(nsWindow* aWindow) mCompositionString.Truncate(); nsIMEContext IMEContext(aWindow->GetWindowHandle()); - DispatchTextEvent(aWindow, IMEContext, PR_FALSE); + DispatchTextEvent(aWindow, IMEContext, false); HandleEndComposition(aWindow); @@ -631,7 +631,7 @@ nsIMM32Handler::OnIMEChar(nsWindow* aWindow, // processed in nsWindow::OnIMEComposition already. // We need to return TRUE here so that Windows don't send two WM_CHAR msgs - return PR_TRUE; + return true; } /* static */ bool @@ -642,7 +642,7 @@ nsIMM32Handler::OnIMECompositionFull(nsWindow* aWindow) aWindow->GetWindowHandle())); // not implement yet - return PR_FALSE; + return false; } /* static */ bool @@ -703,7 +703,7 @@ nsIMM32Handler::OnIMENotify(nsWindow* aWindow, aWindow->GetWindowHandle())); break; case IMN_SETOPENSTATUS: - sIsIMEOpening = PR_FALSE; + sIsIMEOpening = false; PR_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: OnIMENotify, hWnd=%08x, IMN_SETOPENSTATUS\n", aWindow->GetWindowHandle())); @@ -727,7 +727,7 @@ nsIMM32Handler::OnIMENotify(nsWindow* aWindow, #endif // PR_LOGGING if (::GetKeyState(NS_VK_ALT) >= 0) { - return PR_FALSE; + return false; } // XXXmnakano Following code was added by bug 28852 (Key combo to trun ON/OFF @@ -738,7 +738,7 @@ nsIMM32Handler::OnIMENotify(nsWindow* aWindow, // keypress event. So, we should find another way for the bug. // add hacky code here - nsModifierKeyState modKeyState(PR_FALSE, PR_FALSE, PR_TRUE); + nsModifierKeyState modKeyState(false, false, true); aWindow->DispatchKeyEvent(NS_KEY_PRESS, 0, nsnull, 192, nsnull, modKeyState); sIsStatusChanged = sIsStatusChanged || (wParam == IMN_SETOPENSTATUS); PR_LOG(gIMM32Log, PR_LOG_ALWAYS, @@ -746,7 +746,7 @@ nsIMM32Handler::OnIMENotify(nsWindow* aWindow, sIsStatusChanged ? "TRUE" : "FALSE")); // not implement yet - return PR_FALSE; + return false; } bool @@ -775,7 +775,7 @@ nsIMM32Handler::OnIMERequest(nsWindow* aWindow, PR_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: OnIMERequest, hWnd=%08x, wParam=%08x\n", aWindow->GetWindowHandle(), wParam)); - return PR_FALSE; + return false; } } @@ -789,7 +789,7 @@ nsIMM32Handler::OnIMESelect(nsWindow* aWindow, aWindow->GetWindowHandle(), wParam, lParam)); // not implement yet - return PR_FALSE; + return false; } /* static */ bool @@ -812,7 +812,7 @@ nsIMM32Handler::OnIMESetContext(nsWindow* aWindow, if (IsTopLevelWindowOfComposition(aWindow)) { PR_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: OnIMESetContext, hWnd=%08x is top level window\n")); - return PR_FALSE; + return false; } // When IME context is activating on another window, @@ -839,10 +839,10 @@ nsIMM32Handler::OnIMESetContext(nsWindow* aWindow, // Cancel composition on the new window if we committed our composition on // another window. if (cancelComposition) { - CancelComposition(aWindow, PR_TRUE); + CancelComposition(aWindow, true); } - return PR_TRUE; + return true; } bool @@ -851,7 +851,7 @@ nsIMM32Handler::OnChar(nsWindow* aWindow, LPARAM lParam) { if (IsIMECharRecordsEmpty()) { - return PR_FALSE; + return false; } WPARAM recWParam; LPARAM recLParam; @@ -866,12 +866,12 @@ nsIMM32Handler::OnChar(nsWindow* aWindow, // of course, this shouldn't happen. if (recWParam != wParam || recLParam != lParam) { ResetIMECharRecords(); - return PR_FALSE; + return false; } // Eat the char message which is caused by WM_IME_CHAR because we should // have processed the IME messages, so, this message could be come from // a windowless plug-in. - return PR_TRUE; + return true; } /**************************************************************************** @@ -886,11 +886,11 @@ nsIMM32Handler::OnIMEStartCompositionOnPlugin(nsWindow* aWindow, PR_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: OnIMEStartCompositionOnPlugin, hWnd=%08x, mIsComposingOnPlugin=%s\n", aWindow->GetWindowHandle(), mIsComposingOnPlugin ? "TRUE" : "FALSE")); - mIsComposingOnPlugin = PR_TRUE; + mIsComposingOnPlugin = true; mComposingWindow = aWindow; bool handled = aWindow->DispatchPluginEvent(WM_IME_STARTCOMPOSITION, wParam, lParam, - PR_FALSE); + false); return handled; } @@ -912,16 +912,16 @@ nsIMM32Handler::OnIMECompositionOnPlugin(nsWindow* aWindow, lParam & GCS_CURSORPOS ? "YES" : "no")); // We should end composition if there is a committed string. if (IS_COMMITTING_LPARAM(lParam)) { - mIsComposingOnPlugin = PR_FALSE; + mIsComposingOnPlugin = false; mComposingWindow = nsnull; } // Continue composition if there is still a string being composed. if (IS_COMPOSING_LPARAM(lParam)) { - mIsComposingOnPlugin = PR_TRUE; + mIsComposingOnPlugin = true; mComposingWindow = aWindow; } bool handled = - aWindow->DispatchPluginEvent(WM_IME_COMPOSITION, wParam, lParam, PR_TRUE); + aWindow->DispatchPluginEvent(WM_IME_COMPOSITION, wParam, lParam, true); return handled; } @@ -934,11 +934,11 @@ nsIMM32Handler::OnIMEEndCompositionOnPlugin(nsWindow* aWindow, ("IMM32: OnIMEEndCompositionOnPlugin, hWnd=%08x, mIsComposingOnPlugin=%s\n", aWindow->GetWindowHandle(), mIsComposingOnPlugin ? "TRUE" : "FALSE")); - mIsComposingOnPlugin = PR_FALSE; + mIsComposingOnPlugin = false; mComposingWindow = nsnull; bool handled = aWindow->DispatchPluginEvent(WM_IME_ENDCOMPOSITION, wParam, lParam, - PR_FALSE); + false); return handled; } @@ -952,7 +952,7 @@ nsIMM32Handler::OnIMECharOnPlugin(nsWindow* aWindow, aWindow->GetWindowHandle(), wParam, lParam)); bool handled = - aWindow->DispatchPluginEvent(WM_IME_CHAR, wParam, lParam, PR_TRUE); + aWindow->DispatchPluginEvent(WM_IME_CHAR, wParam, lParam, true); if (!handled) { // Record the WM_CHAR messages which are going to be coming. @@ -986,7 +986,7 @@ nsIMM32Handler::OnIMESetContextOnPlugin(nsWindow* aWindow, // Dispatch message to the plug-in. // XXX When a windowless plug-in gets focus, we should send // WM_IME_SETCONTEXT - aWindow->DispatchPluginEvent(WM_IME_SETCONTEXT, wParam, lParam, PR_FALSE); + aWindow->DispatchPluginEvent(WM_IME_SETCONTEXT, wParam, lParam, false); // We should send WM_IME_SETCONTEXT to the DefWndProc here. It shouldn't // be received on ancestor windows, see OnIMESetContext() for the detail. @@ -996,7 +996,7 @@ nsIMM32Handler::OnIMESetContextOnPlugin(nsWindow* aWindow, // Don't synchronously dispatch the pending events when we receive // WM_IME_SETCONTEXT because we get it during plugin destruction. // (bug 491848) - return PR_TRUE; + return true; } bool @@ -1005,7 +1005,7 @@ nsIMM32Handler::OnCharOnPlugin(nsWindow* aWindow, LPARAM lParam) { if (IsIMECharRecordsEmpty()) { - return PR_FALSE; + return false; } WPARAM recWParam; @@ -1023,7 +1023,7 @@ nsIMM32Handler::OnCharOnPlugin(nsWindow* aWindow, ResetIMECharRecords(); } // WM_CHAR on plug-in is always handled by nsWindow. - return PR_FALSE; + return false; } /**************************************************************************** @@ -1039,7 +1039,7 @@ nsIMM32Handler::HandleStartComposition(nsWindow* aWindow, NS_PRECONDITION(!aWindow->PluginHasFocus(), "HandleStartComposition should not be called when a plug-in has focus"); - nsQueryContentEvent selection(PR_TRUE, NS_QUERY_SELECTED_TEXT, aWindow); + nsQueryContentEvent selection(true, NS_QUERY_SELECTED_TEXT, aWindow); nsIntPoint point(0, 0); aWindow->InitEvent(selection, &point); aWindow->DispatchWindowEvent(&selection); @@ -1052,13 +1052,13 @@ nsIMM32Handler::HandleStartComposition(nsWindow* aWindow, mCompositionStart = selection.mReply.mOffset; mLastDispatchedCompositionString.Truncate(); - nsCompositionEvent event(PR_TRUE, NS_COMPOSITION_START, aWindow); + nsCompositionEvent event(true, NS_COMPOSITION_START, aWindow); aWindow->InitEvent(event, &point); aWindow->DispatchWindowEvent(&event); SetIMERelatedWindowsPos(aWindow, aIMEContext); - mIsComposing = PR_TRUE; + mIsComposing = true; mComposingWindow = aWindow; PR_LOG(gIMM32Log, PR_LOG_ALWAYS, @@ -1113,7 +1113,7 @@ nsIMM32Handler::HandleComposition(nsWindow* aWindow, } mCompositionString.Truncate(); - DispatchTextEvent(aWindow, aIMEContext, PR_FALSE); + DispatchTextEvent(aWindow, aIMEContext, false); return ShouldDrawCompositionStringOurselves(); } @@ -1134,7 +1134,7 @@ nsIMM32Handler::HandleComposition(nsWindow* aWindow, PR_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: HandleComposition, GCS_RESULTSTR\n")); - DispatchTextEvent(aWindow, aIMEContext, PR_FALSE); + DispatchTextEvent(aWindow, aIMEContext, false); HandleEndComposition(aWindow); if (!IS_COMPOSING_LPARAM(lParam)) { @@ -1183,7 +1183,7 @@ nsIMM32Handler::HandleComposition(nsWindow* aWindow, if (clauseArrayLength > 0) { nsresult rv = EnsureClauseArray(clauseArrayLength); - NS_ENSURE_SUCCESS(rv, PR_FALSE); + NS_ENSURE_SUCCESS(rv, false); // Intelligent ABC IME (Simplified Chinese IME, the code page is 936) // will crash in ImmGetCompositionStringW for GCS_COMPCLAUSE (bug 424663). @@ -1250,7 +1250,7 @@ nsIMM32Handler::HandleComposition(nsWindow* aWindow, if (attrArrayLength > 0) { nsresult rv = EnsureAttributeArray(attrArrayLength); - NS_ENSURE_SUCCESS(rv, PR_FALSE); + NS_ENSURE_SUCCESS(rv, false); attrArrayLength = ::ImmGetCompositionStringW(aIMEContext.get(), GCS_COMPATTR, mAttributeArray.Elements(), @@ -1305,19 +1305,19 @@ nsIMM32Handler::HandleEndComposition(nsWindow* aWindow) PR_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: HandleEndComposition\n")); - nsCompositionEvent event(PR_TRUE, NS_COMPOSITION_END, aWindow); + nsCompositionEvent event(true, NS_COMPOSITION_END, aWindow); nsIntPoint point(0, 0); if (mNativeCaretIsCreated) { ::DestroyCaret(); - mNativeCaretIsCreated = PR_FALSE; + mNativeCaretIsCreated = false; } aWindow->InitEvent(event, &point); // The last dispatched composition string must be the committed string. event.data = mLastDispatchedCompositionString; aWindow->DispatchWindowEvent(&event); - mIsComposing = PR_FALSE; + mIsComposing = false; mComposingWindow = nsnull; mLastDispatchedCompositionString.Truncate(); } @@ -1348,14 +1348,14 @@ nsIMM32Handler::HandleReconvert(nsWindow* aWindow, *oResult = 0; RECONVERTSTRING* pReconv = reinterpret_cast(lParam); - nsQueryContentEvent selection(PR_TRUE, NS_QUERY_SELECTED_TEXT, aWindow); + nsQueryContentEvent selection(true, NS_QUERY_SELECTED_TEXT, aWindow); nsIntPoint point(0, 0); aWindow->InitEvent(selection, &point); aWindow->DispatchWindowEvent(&selection); if (!selection.mSucceeded) { PR_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: HandleReconvert, FAILED (NS_QUERY_SELECTED_TEXT)\n")); - return PR_FALSE; + return false; } PRUint32 len = selection.mReply.mString.Length(); @@ -1366,20 +1366,20 @@ nsIMM32Handler::HandleReconvert(nsWindow* aWindow, if (len == 0) { PR_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: HandleReconvert, There are not selected text\n")); - return PR_FALSE; + return false; } *oResult = needSize; PR_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: HandleReconvert, SUCCEEDED result=%ld\n", *oResult)); - return PR_TRUE; + return true; } if (pReconv->dwSize < needSize) { PR_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: HandleReconvert, FAILED pReconv->dwSize=%ld, needSize=%ld\n", pReconv->dwSize, needSize)); - return PR_FALSE; + return false; } *oResult = needSize; @@ -1401,7 +1401,7 @@ nsIMM32Handler::HandleReconvert(nsWindow* aWindow, *oResult)); DumpReconvertString(pReconv); - return PR_TRUE; + return true; } bool @@ -1410,41 +1410,41 @@ nsIMM32Handler::HandleQueryCharPosition(nsWindow* aWindow, LRESULT *oResult) { PRUint32 len = mIsComposing ? mCompositionString.Length() : 0; - *oResult = PR_FALSE; + *oResult = false; IMECHARPOSITION* pCharPosition = reinterpret_cast(lParam); if (!pCharPosition) { PR_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: HandleQueryCharPosition, FAILED (pCharPosition is null)\n")); - return PR_FALSE; + return false; } if (pCharPosition->dwSize < sizeof(IMECHARPOSITION)) { PR_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: HandleReconvert, FAILED, pCharPosition->dwSize=%ld, sizeof(IMECHARPOSITION)=%ld\n", pCharPosition->dwSize, sizeof(IMECHARPOSITION))); - return PR_FALSE; + return false; } if (::GetFocus() != aWindow->GetWindowHandle()) { PR_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: HandleReconvert, FAILED, ::GetFocus()=%08x, OurWindowHandle=%08x\n", ::GetFocus(), aWindow->GetWindowHandle())); - return PR_FALSE; + return false; } if (pCharPosition->dwCharPos > len) { PR_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: HandleQueryCharPosition, FAILED, pCharPosition->dwCharPos=%ld, len=%ld\n", pCharPosition->dwCharPos, len)); - return PR_FALSE; + return false; } nsIntRect r; bool ret = GetCharacterRectOfSelectedTextAt(aWindow, pCharPosition->dwCharPos, r); - NS_ENSURE_TRUE(ret, PR_FALSE); + NS_ENSURE_TRUE(ret, false); nsIntRect screenRect; // We always need top level window that is owner window of the popup window // even if the content of the popup window has focus. - ResolveIMECaretPos(aWindow->GetTopLevelWindow(PR_FALSE), + ResolveIMECaretPos(aWindow->GetTopLevelWindow(false), r, nsnull, screenRect); pCharPosition->pt.x = screenRect.x; pCharPosition->pt.y = screenRect.y; @@ -1458,7 +1458,7 @@ nsIMM32Handler::HandleQueryCharPosition(nsWindow* aWindow, PR_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: HandleQueryCharPosition, SUCCEEDED\n")); - return PR_TRUE; + return true; } bool @@ -1476,13 +1476,13 @@ nsIMM32Handler::HandleDocumentFeed(nsWindow* aWindow, PRInt32 targetOffset, targetLength; if (!hasCompositionString) { - nsQueryContentEvent selection(PR_TRUE, NS_QUERY_SELECTED_TEXT, aWindow); + nsQueryContentEvent selection(true, NS_QUERY_SELECTED_TEXT, aWindow); aWindow->InitEvent(selection, &point); aWindow->DispatchWindowEvent(&selection); if (!selection.mSucceeded) { PR_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: HandleDocumentFeed, FAILED (NS_QUERY_SELECTED_TEXT)\n")); - return PR_FALSE; + return false; } targetOffset = PRInt32(selection.mReply.mOffset); targetLength = PRInt32(selection.mReply.mString.Length()); @@ -1498,32 +1498,32 @@ nsIMM32Handler::HandleDocumentFeed(nsWindow* aWindow, targetOffset + targetLength < 0) { PR_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: HandleDocumentFeed, FAILED (The selection is out of range)\n")); - return PR_FALSE; + return false; } // Get all contents of the focused editor. - nsQueryContentEvent textContent(PR_TRUE, NS_QUERY_TEXT_CONTENT, aWindow); + nsQueryContentEvent textContent(true, NS_QUERY_TEXT_CONTENT, aWindow); textContent.InitForQueryTextContent(0, PR_UINT32_MAX); aWindow->InitEvent(textContent, &point); aWindow->DispatchWindowEvent(&textContent); if (!textContent.mSucceeded) { PR_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: HandleDocumentFeed, FAILED (NS_QUERY_TEXT_CONTENT)\n")); - return PR_FALSE; + return false; } nsAutoString str(textContent.mReply.mString); if (targetOffset > PRInt32(str.Length())) { PR_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: HandleDocumentFeed, FAILED (The caret offset is invalid)\n")); - return PR_FALSE; + return false; } // Get the focused paragraph, we decide that it starts from the previous CRLF // (or start of the editor) to the next one (or the end of the editor). - PRInt32 paragraphStart = str.RFind("\n", PR_FALSE, targetOffset, -1) + 1; + PRInt32 paragraphStart = str.RFind("\n", false, targetOffset, -1) + 1; PRInt32 paragraphEnd = - str.Find("\r", PR_FALSE, targetOffset + targetLength, -1); + str.Find("\r", false, targetOffset + targetLength, -1); if (paragraphEnd < 0) { paragraphEnd = str.Length(); } @@ -1538,14 +1538,14 @@ nsIMM32Handler::HandleDocumentFeed(nsWindow* aWindow, PR_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: HandleDocumentFeed, SUCCEEDED result=%ld\n", *oResult)); - return PR_TRUE; + return true; } if (pReconv->dwSize < needSize) { PR_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: HandleDocumentFeed, FAILED pReconv->dwSize=%ld, needSize=%ld\n", pReconv->dwSize, needSize)); - return PR_FALSE; + return false; } // Fill reconvert struct @@ -1561,7 +1561,7 @@ nsIMM32Handler::HandleDocumentFeed(nsWindow* aWindow, if (!GetTargetClauseRange(&offset, &length)) { PR_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: HandleDocumentFeed, FAILED, by GetTargetClauseRange\n")); - return PR_FALSE; + return false; } pReconv->dwTargetStrLen = length; pReconv->dwTargetStrOffset = (offset - paragraphStart) * sizeof(WCHAR); @@ -1584,14 +1584,14 @@ nsIMM32Handler::HandleDocumentFeed(nsWindow* aWindow, *oResult)); DumpReconvertString(pReconv); - return PR_TRUE; + return true; } bool nsIMM32Handler::CommitCompositionOnPreviousWindow(nsWindow* aWindow) { if (!mComposingWindow || mComposingWindow == aWindow) { - return PR_FALSE; + return false; } PR_LOG(gIMM32Log, PR_LOG_ALWAYS, @@ -1603,9 +1603,9 @@ nsIMM32Handler::CommitCompositionOnPreviousWindow(nsWindow* aWindow) nsIMEContext IMEContext(mComposingWindow->GetWindowHandle()); NS_ASSERTION(IMEContext.IsValid(), "IME context must be valid"); - DispatchTextEvent(mComposingWindow, IMEContext, PR_FALSE); + DispatchTextEvent(mComposingWindow, IMEContext, false); HandleEndComposition(mComposingWindow); - return PR_TRUE; + return true; } // XXX When plug-in has composition, we should commit composition on the @@ -1629,7 +1629,7 @@ PlatformToNSAttr(PRUint8 aAttr) case ATTR_TARGET_CONVERTED: return NS_TEXTRANGE_SELECTEDCONVERTEDTEXT; default: - NS_ASSERTION(PR_FALSE, "unknown attribute"); + NS_ASSERTION(false, "unknown attribute"); return NS_TEXTRANGE_CARETPOSITION; } } @@ -1679,7 +1679,7 @@ nsIMM32Handler::DispatchTextEvent(nsWindow* aWindow, nsIntPoint point(0, 0); if (mCompositionString != mLastDispatchedCompositionString) { - nsCompositionEvent compositionUpdate(PR_TRUE, NS_COMPOSITION_UPDATE, + nsCompositionEvent compositionUpdate(true, NS_COMPOSITION_UPDATE, aWindow); aWindow->InitEvent(compositionUpdate, &point); compositionUpdate.data = mCompositionString; @@ -1693,7 +1693,7 @@ nsIMM32Handler::DispatchTextEvent(nsWindow* aWindow, SetIMERelatedWindowsPos(aWindow, aIMEContext); } - nsTextEvent event(PR_TRUE, NS_TEXT_TEXT, aWindow); + nsTextEvent event(true, NS_TEXT_TEXT, aWindow); aWindow->InitEvent(event, &point); @@ -1710,7 +1710,7 @@ nsIMM32Handler::DispatchTextEvent(nsWindow* aWindow, nsModifierKeyState modKeyState; event.isShift = modKeyState.mIsShiftDown; event.isControl = modKeyState.mIsControlDown; - event.isMeta = PR_FALSE; + event.isMeta = false; event.isAlt = modKeyState.mIsAltDown; aWindow->DispatchWindowEvent(&event); @@ -1815,9 +1815,9 @@ nsIMM32Handler::GetCompositionString(const nsIMEContext &aIMEContext, bool nsIMM32Handler::GetTargetClauseRange(PRUint32 *aOffset, PRUint32 *aLength) { - NS_ENSURE_TRUE(aOffset, PR_FALSE); - NS_ENSURE_TRUE(mIsComposing, PR_FALSE); - NS_ENSURE_TRUE(ShouldDrawCompositionStringOurselves(), PR_FALSE); + NS_ENSURE_TRUE(aOffset, false); + NS_ENSURE_TRUE(mIsComposing, false); + NS_ENSURE_TRUE(ShouldDrawCompositionStringOurselves(), false); bool found = false; *aOffset = mCompositionStart; @@ -1825,20 +1825,20 @@ nsIMM32Handler::GetTargetClauseRange(PRUint32 *aOffset, PRUint32 *aLength) if (mAttributeArray[i] == ATTR_TARGET_NOTCONVERTED || mAttributeArray[i] == ATTR_TARGET_CONVERTED) { *aOffset = mCompositionStart + i; - found = PR_TRUE; + found = true; break; } } if (!aLength) { - return PR_TRUE; + return true; } if (!found) { // The all composition string is targetted when there is no ATTR_TARGET_* // clause. E.g., there is only ATTR_INPUT *aLength = mCompositionString.Length(); - return PR_TRUE; + return true; } PRUint32 offsetInComposition = *aOffset - mCompositionStart; @@ -1850,7 +1850,7 @@ nsIMM32Handler::GetTargetClauseRange(PRUint32 *aOffset, PRUint32 *aLength) break; } } - return PR_TRUE; + return true; } bool @@ -1860,16 +1860,16 @@ nsIMM32Handler::ConvertToANSIString(const nsAFlatString& aStr, UINT aCodePage, int len = ::WideCharToMultiByte(aCodePage, 0, (LPCWSTR)aStr.get(), aStr.Length(), NULL, 0, NULL, NULL); - NS_ENSURE_TRUE(len >= 0, PR_FALSE); + NS_ENSURE_TRUE(len >= 0, false); if (!EnsureStringLength(aANSIStr, len)) { PR_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: ConvertToANSIString, FAILED by OOM\n")); - return PR_FALSE; + return false; } ::WideCharToMultiByte(aCodePage, 0, (LPCWSTR)aStr.get(), aStr.Length(), (LPSTR)aANSIStr.BeginWriting(), len, NULL, NULL); - return PR_TRUE; + return true; } bool @@ -1879,14 +1879,14 @@ nsIMM32Handler::GetCharacterRectOfSelectedTextAt(nsWindow* aWindow, { nsIntPoint point(0, 0); - nsQueryContentEvent selection(PR_TRUE, NS_QUERY_SELECTED_TEXT, aWindow); + nsQueryContentEvent selection(true, NS_QUERY_SELECTED_TEXT, aWindow); aWindow->InitEvent(selection, &point); aWindow->DispatchWindowEvent(&selection); if (!selection.mSucceeded) { PR_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: GetCharacterRectOfSelectedTextAt, aOffset=%lu, FAILED (NS_QUERY_SELECTED_TEXT)\n", aOffset)); - return PR_FALSE; + return false; } PRUint32 offset = selection.mReply.mOffset + aOffset; @@ -1895,7 +1895,7 @@ nsIMM32Handler::GetCharacterRectOfSelectedTextAt(nsWindow* aWindow, mIsComposing && !mCompositionString.IsEmpty()) { // There is not a normal selection, but we have composition string. // XXX mnakano - Should we implement NS_QUERY_IME_SELECTED_TEXT? - useCaretRect = PR_FALSE; + useCaretRect = false; if (mCursorPosition != NO_IME_CARET) { PRUint32 cursorPosition = NS_MIN(mCursorPosition, mCompositionString.Length()); @@ -1906,7 +1906,7 @@ nsIMM32Handler::GetCharacterRectOfSelectedTextAt(nsWindow* aWindow, nsIntRect r; if (!useCaretRect) { - nsQueryContentEvent charRect(PR_TRUE, NS_QUERY_TEXT_RECT, aWindow); + nsQueryContentEvent charRect(true, NS_QUERY_TEXT_RECT, aWindow); charRect.InitForQueryTextRect(offset, 1); aWindow->InitEvent(charRect, &point); aWindow->DispatchWindowEvent(&charRect); @@ -1918,7 +1918,7 @@ nsIMM32Handler::GetCharacterRectOfSelectedTextAt(nsWindow* aWindow, PR_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: GetCharacterRectOfSelectedTextAt, aCharRect={ x: %ld, y: %ld, width: %ld, height: %ld }\n", aCharRect.x, aCharRect.y, aCharRect.width, aCharRect.height)); - return PR_TRUE; + return true; } } @@ -1930,31 +1930,31 @@ nsIMM32Handler::GetCaretRect(nsWindow* aWindow, nsIntRect &aCaretRect) { nsIntPoint point(0, 0); - nsQueryContentEvent selection(PR_TRUE, NS_QUERY_SELECTED_TEXT, aWindow); + nsQueryContentEvent selection(true, NS_QUERY_SELECTED_TEXT, aWindow); aWindow->InitEvent(selection, &point); aWindow->DispatchWindowEvent(&selection); if (!selection.mSucceeded) { PR_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: GetCaretRect, FAILED (NS_QUERY_SELECTED_TEXT)\n")); - return PR_FALSE; + return false; } PRUint32 offset = selection.mReply.mOffset; - nsQueryContentEvent caretRect(PR_TRUE, NS_QUERY_CARET_RECT, aWindow); + nsQueryContentEvent caretRect(true, NS_QUERY_CARET_RECT, aWindow); caretRect.InitForQueryCaretRect(offset); aWindow->InitEvent(caretRect, &point); aWindow->DispatchWindowEvent(&caretRect); if (!caretRect.mSucceeded) { PR_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: GetCaretRect, FAILED (NS_QUERY_CARET_RECT)\n")); - return PR_FALSE; + return false; } aCaretRect = caretRect.mReply.mRect; PR_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: GetCaretRect, SUCCEEDED, aCaretRect={ x: %ld, y: %ld, width: %ld, height: %ld }\n", aCaretRect.x, aCaretRect.y, aCaretRect.width, aCaretRect.height)); - return PR_TRUE; + return true; } bool @@ -1965,8 +1965,8 @@ nsIMM32Handler::SetIMERelatedWindowsPos(nsWindow* aWindow, // Get first character rect of current a normal selected text or a composing // string. bool ret = GetCharacterRectOfSelectedTextAt(aWindow, 0, r); - NS_ENSURE_TRUE(ret, PR_FALSE); - nsWindow* toplevelWindow = aWindow->GetTopLevelWindow(PR_FALSE); + NS_ENSURE_TRUE(ret, false); + nsWindow* toplevelWindow = aWindow->GetTopLevelWindow(false); nsIntRect firstSelectedCharRect; ResolveIMECaretPos(toplevelWindow, r, aWindow, firstSelectedCharRect); @@ -2002,16 +2002,16 @@ nsIMM32Handler::SetIMERelatedWindowsPos(nsWindow* aWindow, if (!GetTargetClauseRange(&offset)) { PR_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: SetIMERelatedWindowsPos, FAILED, by GetTargetClauseRange\n")); - return PR_FALSE; + return false; } ret = GetCharacterRectOfSelectedTextAt(aWindow, offset - mCompositionStart, r); - NS_ENSURE_TRUE(ret, PR_FALSE); + NS_ENSURE_TRUE(ret, false); } else { // If there are no composition string, we should use a first character // rect. ret = GetCharacterRectOfSelectedTextAt(aWindow, 0, r); - NS_ENSURE_TRUE(ret, PR_FALSE); + NS_ENSURE_TRUE(ret, false); } nsIntRect firstTargetCharRect; ResolveIMECaretPos(toplevelWindow, r, aWindow, firstTargetCharRect); @@ -2042,7 +2042,7 @@ nsIMM32Handler::SetIMERelatedWindowsPos(nsWindow* aWindow, ::ImmSetCompositionWindow(aIMEContext.get(), &compForm); } - return PR_TRUE; + return true; } void @@ -2067,11 +2067,11 @@ bool nsIMM32Handler::OnMouseEvent(nsWindow* aWindow, LPARAM lParam, int aAction) { if (!sWM_MSIME_MOUSE || !mIsComposing) { - return PR_FALSE; + return false; } nsIntPoint cursor(LOWORD(lParam), HIWORD(lParam)); - nsQueryContentEvent charAtPt(PR_TRUE, NS_QUERY_CHARACTER_AT_POINT, aWindow); + nsQueryContentEvent charAtPt(true, NS_QUERY_CHARACTER_AT_POINT, aWindow); aWindow->InitEvent(charAtPt, &cursor); aWindow->DispatchWindowEvent(&charAtPt); if (!charAtPt.mSucceeded || @@ -2079,7 +2079,7 @@ nsIMM32Handler::OnMouseEvent(nsWindow* aWindow, LPARAM lParam, int aAction) charAtPt.mReply.mOffset < mCompositionStart || charAtPt.mReply.mOffset > mCompositionStart + mCompositionString.Length()) { - return PR_FALSE; + return false; } // calcurate positioning and offset @@ -2088,7 +2088,7 @@ nsIMM32Handler::OnMouseEvent(nsWindow* aWindow, LPARAM lParam, int aAction) // positioning: 2301 2301 2301 nsIntRect cursorInTopLevel, cursorRect(cursor, nsIntSize(0, 0)); ResolveIMECaretPos(aWindow, cursorRect, - aWindow->GetTopLevelWindow(PR_FALSE), cursorInTopLevel); + aWindow->GetTopLevelWindow(false), cursorInTopLevel); PRInt32 cursorXInChar = cursorInTopLevel.x - charAtPt.mReply.mRect.x; int positioning = cursorXInChar * 4 / charAtPt.mReply.mRect.width; positioning = (positioning + 2) % 4; @@ -2117,7 +2117,7 @@ nsIMM32Handler::OnKeyDownEvent(nsWindow* aWindow, WPARAM wParam, LPARAM lParam, PR_LOG(gIMM32Log, PR_LOG_ALWAYS, ("IMM32: OnKeyDownEvent, hWnd=%08x, wParam=%08x, lParam=%08x\n", aWindow->GetWindowHandle(), wParam, lParam)); - aEatMessage = PR_FALSE; + aEatMessage = false; switch (wParam) { case VK_PROCESSKEY: // If we receive when IME isn't open, it means IME is opening right now. @@ -2126,7 +2126,7 @@ nsIMM32Handler::OnKeyDownEvent(nsWindow* aWindow, WPARAM wParam, LPARAM lParam, sIsIMEOpening = IMEContext.IsValid() && !::ImmGetOpenStatus(IMEContext.get()); } - return PR_FALSE; + return false; case VK_TAB: case VK_PRIOR: case VK_NEXT: @@ -2145,10 +2145,10 @@ nsIMM32Handler::OnKeyDownEvent(nsWindow* aWindow, WPARAM wParam, LPARAM lParam, // it's needed. if (IsComposingOnOurEditor()) { // NOTE: We don't need to cancel the composition on another window. - CancelComposition(aWindow, PR_FALSE); + CancelComposition(aWindow, false); } - return PR_FALSE; + return false; default: - return PR_FALSE; + return false; } } diff --git a/widget/src/windows/nsIMM32Handler.h b/widget/src/windows/nsIMM32Handler.h index 0a29ab384078..afa814794197 100644 --- a/widget/src/windows/nsIMM32Handler.h +++ b/widget/src/windows/nsIMM32Handler.h @@ -127,7 +127,7 @@ public: static bool IsDoingKakuteiUndo(HWND aWnd); - static void NotifyEndStatusChange() { sIsStatusChanged = PR_FALSE; } + static void NotifyEndStatusChange() { sIsStatusChanged = false; } static bool CanOptimizeKeyAndIMEMessages(MSG *aNextKeyOrIMEMessage); diff --git a/widget/src/windows/nsImageClipboard.cpp b/widget/src/windows/nsImageClipboard.cpp index 00c26621a87b..7cd52cf4e286 100644 --- a/widget/src/windows/nsImageClipboard.cpp +++ b/widget/src/windows/nsImageClipboard.cpp @@ -462,7 +462,7 @@ void nsImageFromClipboard::CalcBitmask(PRUint32 aMask, PRUint8& aBegin, PRUint8& if (!started && (aMask & (1 << pos))) { aBegin = pos; - started = PR_TRUE; + started = true; } else if (started && !(aMask & (1 << pos))) { diff --git a/widget/src/windows/nsNativeDragSource.cpp b/widget/src/windows/nsNativeDragSource.cpp index b444e1f55392..e51101e286e7 100644 --- a/widget/src/windows/nsNativeDragSource.cpp +++ b/widget/src/windows/nsNativeDragSource.cpp @@ -52,7 +52,7 @@ static NS_DEFINE_IID(kCDragServiceCID, NS_DRAGSERVICE_CID); nsNativeDragSource::nsNativeDragSource(nsIDOMDataTransfer* aDataTransfer) : m_cRef(0), m_hCursor(nsnull), - mUserCancelled(PR_FALSE) + mUserCancelled(false) { mDataTransfer = do_QueryInterface(aDataTransfer); } @@ -107,7 +107,7 @@ nsNativeDragSource::QueryContinueDrag(BOOL fEsc, DWORD grfKeyState) } if (fEsc) { - mUserCancelled = PR_TRUE; + mUserCancelled = true; return DRAGDROP_S_CANCEL; } diff --git a/widget/src/windows/nsNativeDragTarget.cpp b/widget/src/windows/nsNativeDragTarget.cpp index cb2881c00f4a..cf6196bfe2a7 100644 --- a/widget/src/windows/nsNativeDragTarget.cpp +++ b/widget/src/windows/nsNativeDragTarget.cpp @@ -64,7 +64,7 @@ nsNativeDragTarget::nsNativeDragTarget(nsIWidget * aWnd) : m_cRef(0), mEffectsAllowed(DROPEFFECT_MOVE | DROPEFFECT_COPY | DROPEFFECT_LINK), mEffectsPreferred(DROPEFFECT_NONE), - mTookOwnRef(PR_FALSE), mWindow(aWnd), mDropTargetHelper(nsnull) + mTookOwnRef(false), mWindow(aWnd), mDropTargetHelper(nsnull) { mHWnd = (HWND)mWindow->GetNativeData(NS_NATIVE_WINDOW); @@ -187,7 +187,7 @@ void nsNativeDragTarget::DispatchDragDropEvent(PRUint32 aEventType, POINTL aPT) { nsEventStatus status; - nsDragEvent event(PR_TRUE, aEventType, mWindow); + nsDragEvent event(true, aEventType, mWindow); nsWindow * win = static_cast(mWindow); win->InitEvent(event); @@ -207,7 +207,7 @@ nsNativeDragTarget::DispatchDragDropEvent(PRUint32 aEventType, POINTL aPT) event.isShift = IsKeyDown(NS_VK_SHIFT); event.isControl = IsKeyDown(NS_VK_CONTROL); - event.isMeta = PR_FALSE; + event.isMeta = false; event.isAlt = IsKeyDown(NS_VK_ALT); event.inputSource = static_cast(mDragService)->GetInputSource(); @@ -247,7 +247,7 @@ nsNativeDragTarget::ProcessDrag(PRUint32 aEventType, } // Clear the cached value - currSession->SetCanDrop(PR_FALSE); + currSession->SetCanDrop(false); } // IDropTarget methods @@ -273,7 +273,7 @@ nsNativeDragTarget::DragEnter(LPDATAOBJECT pIDataSource, // save a ref to this, in case the window is destroyed underneath us NS_ASSERTION(!mTookOwnRef, "own ref already taken!"); this->AddRef(); - mTookOwnRef = PR_TRUE; + mTookOwnRef = true; // tell the drag service about this drag (it may have come from an // outside app). @@ -382,7 +382,7 @@ nsNativeDragTarget::DragLeave() // initiated in a different app. End the drag session, since // we're done with it for now (until the user drags back into // mozilla). - mDragService->EndDragSession(PR_FALSE); + mDragService->EndDragSession(false); } } @@ -390,7 +390,7 @@ nsNativeDragTarget::DragLeave() NS_ASSERTION(mTookOwnRef, "want to release own ref, but not taken!"); if (mTookOwnRef) { this->Release(); - mTookOwnRef = PR_FALSE; + mTookOwnRef = false; } return S_OK; @@ -405,10 +405,10 @@ nsNativeDragTarget::DragCancel() mDropTargetHelper->DragLeave(); } if (mDragService) { - mDragService->EndDragSession(PR_FALSE); + mDragService->EndDragSession(false); } this->Release(); // matching the AddRef in DragEnter - mTookOwnRef = PR_FALSE; + mTookOwnRef = false; } } @@ -466,13 +466,13 @@ nsNativeDragTarget::Drop(LPDATAOBJECT pData, cpos.x = GET_X_LPARAM(pos); cpos.y = GET_Y_LPARAM(pos); winDragService->SetDragEndPoint(nsIntPoint(cpos.x, cpos.y)); - serv->EndDragSession(PR_TRUE); + serv->EndDragSession(true); // release the ref that was taken in DragEnter NS_ASSERTION(mTookOwnRef, "want to release own ref, but not taken!"); if (mTookOwnRef) { this->Release(); - mTookOwnRef = PR_FALSE; + mTookOwnRef = false; } return S_OK; diff --git a/widget/src/windows/nsNativeThemeWin.cpp b/widget/src/windows/nsNativeThemeWin.cpp index aff9e6296d3f..6930761f5d0f 100644 --- a/widget/src/windows/nsNativeThemeWin.cpp +++ b/widget/src/windows/nsNativeThemeWin.cpp @@ -90,8 +90,8 @@ static PRInt32 GetTopLevelWindowActiveState(nsIFrame *aFrame) nsIWidget* widget = aFrame->GetNearestWidget(); nsWindow * window = static_cast(widget); if (widget && !window->IsTopLevelWidget() && - !(window = window->GetParentWindow(PR_FALSE))) - return PR_FALSE; + !(window = window->GetParentWindow(false))) + return false; if (window->GetWindowHandle() == ::GetActiveWindow()) return mozilla::widget::themeconst::FS_ACTIVE; @@ -132,7 +132,7 @@ static void QueryForButtonData(nsIFrame *aFrame) if (!window) return; if (!window->IsTopLevelWidget() && - !(window = window->GetParentWindow(PR_FALSE))) + !(window = window->GetParentWindow(false))) return; nsUXThemeData::UpdateTitlebarInfo(window->GetWindowHandle()); @@ -576,7 +576,7 @@ nsNativeThemeWin::GetThemePartAndState(nsIFrame* aFrame, PRUint8 aWidgetType, return NS_OK; } - aState = StandardGetState(aFrame, aWidgetType, PR_TRUE); + aState = StandardGetState(aFrame, aWidgetType, true); // Check for default dialog buttons. These buttons should always look // focused. @@ -610,7 +610,7 @@ nsNativeThemeWin::GetThemePartAndState(nsIFrame* aFrame, PRUint8 aWidgetType, if (IsDisabled(aFrame, eventState)) { aState = TS_DISABLED; } else { - aState = StandardGetState(aFrame, aWidgetType, PR_FALSE); + aState = StandardGetState(aFrame, aWidgetType, false); } } @@ -672,7 +672,7 @@ nsNativeThemeWin::GetThemePartAndState(nsIFrame* aFrame, PRUint8 aWidgetType, else if (IsReadOnly(aFrame)) aState = TFS_READONLY; else - aState = StandardGetState(aFrame, aWidgetType, PR_TRUE); + aState = StandardGetState(aFrame, aWidgetType, true); } return NS_OK; @@ -848,7 +848,7 @@ nsNativeThemeWin::GetThemePartAndState(nsIFrame* aFrame, PRUint8 aWidgetType, else if (IsDisabled(aFrame, eventState)) aState = TS_DISABLED; else - aState = StandardGetState(aFrame, aWidgetType, PR_FALSE); + aState = StandardGetState(aFrame, aWidgetType, false); return NS_OK; } case NS_THEME_TOOLBOX: @@ -926,7 +926,7 @@ nsNativeThemeWin::GetThemePartAndState(nsIFrame* aFrame, PRUint8 aWidgetType, aState = TS_ACTIVE; // The selected tab is always "pressed". } else - aState = StandardGetState(aFrame, aWidgetType, PR_TRUE); + aState = StandardGetState(aFrame, aWidgetType, true); return NS_OK; } @@ -943,7 +943,7 @@ nsNativeThemeWin::GetThemePartAndState(nsIFrame* aFrame, PRUint8 aWidgetType, return NS_OK; } - aState = StandardGetState(aFrame, aWidgetType, PR_TRUE); + aState = StandardGetState(aFrame, aWidgetType, true); return NS_OK; } @@ -1562,15 +1562,15 @@ RENDER_AGAIN: // the fallback path to cairo_d2d_acquire_dest if the area to fill // is a complex region. ctx->NewPath(); - ctx->Rectangle(buttonbox1, PR_TRUE); + ctx->Rectangle(buttonbox1, true); ctx->Fill(); ctx->NewPath(); - ctx->Rectangle(buttonbox2, PR_TRUE); + ctx->Rectangle(buttonbox2, true); ctx->Fill(); ctx->NewPath(); - ctx->Rectangle(buttonbox3, PR_TRUE); + ctx->Rectangle(buttonbox3, true); ctx->Fill(); ctx->Restore(); @@ -1772,7 +1772,7 @@ nsNativeThemeWin::GetWidgetPadding(nsDeviceContext* aContext, case NS_THEME_CHECKBOX: case NS_THEME_RADIO: aResult->SizeTo(0, 0, 0, 0); - return PR_TRUE; + return true; } HANDLE theme = GetTheme(aWidgetType); @@ -1784,14 +1784,14 @@ nsNativeThemeWin::GetWidgetPadding(nsDeviceContext* aContext, #if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN // aero glass doesn't display custom buttons if (nsUXThemeData::CheckForCompositor()) - return PR_TRUE; + return true; #endif // button padding for standard windows if (aWidgetType == NS_THEME_WINDOW_BUTTON_BOX) { aResult->top = GetSystemMetrics(SM_CXFRAME); } - return PR_TRUE; + return true; } // Content padding @@ -1802,7 +1802,7 @@ nsNativeThemeWin::GetWidgetPadding(nsDeviceContext* aContext, // the border padding. (windows quirk) if (aWidgetType == NS_THEME_WINDOW_TITLEBAR_MAXIMIZED) aResult->top = GetSystemMetrics(SM_CXFRAME); - return PR_TRUE; + return true; } if (!theme) @@ -1814,7 +1814,7 @@ nsNativeThemeWin::GetWidgetPadding(nsDeviceContext* aContext, nsUXThemeData::getThemePartSize(theme, NULL, MENU_POPUPBORDERS, /* state */ 0, NULL, TS_TRUE, &popupSize); aResult->top = aResult->bottom = popupSize.cy; aResult->left = aResult->right = popupSize.cx; - return PR_TRUE; + return true; } if (nsUXThemeData::sIsVistaOrLater) { @@ -1824,7 +1824,7 @@ nsNativeThemeWin::GetWidgetPadding(nsDeviceContext* aContext, { /* If we have author-specified padding for these elements, don't do the fixups below */ if (aFrame->PresContext()->HasAuthorSpecifiedRules(aFrame, NS_AUTHOR_SPECIFIED_PADDING)) - return PR_FALSE; + return false; } /* textfields need extra pixels on all sides, otherwise they @@ -1836,7 +1836,7 @@ nsNativeThemeWin::GetWidgetPadding(nsDeviceContext* aContext, if (aWidgetType == NS_THEME_TEXTFIELD || aWidgetType == NS_THEME_TEXTFIELD_MULTILINE) { aResult->top = aResult->bottom = 2; aResult->left = aResult->right = 2; - return PR_TRUE; + return true; } else if (IsHTMLContent(aFrame) && aWidgetType == NS_THEME_DROPDOWN) { /* For content menulist controls, we need an extra pixel so * that we have room to draw our focus rectangle stuff. @@ -1845,7 +1845,7 @@ nsNativeThemeWin::GetWidgetPadding(nsDeviceContext* aContext, */ aResult->top = aResult->bottom = 1; aResult->left = aResult->right = 1; - return PR_TRUE; + return true; } } @@ -1879,7 +1879,7 @@ nsNativeThemeWin::GetWidgetPadding(nsDeviceContext* aContext, } break; default: - return PR_FALSE; + return false; } if (IsFrameRTL(aFrame)) @@ -1893,7 +1893,7 @@ nsNativeThemeWin::GetWidgetPadding(nsDeviceContext* aContext, aResult->left = left; } - return PR_TRUE; + return true; } bool @@ -1925,12 +1925,12 @@ nsNativeThemeWin::GetWidgetOverflow(nsDeviceContext* aContext, /* Note: no overflow on the left */ nsMargin m(0, p2a, p2a, p2a); aOverflowRect->Inflate (m); - return PR_TRUE; + return true; } } #endif - return PR_FALSE; + return false; } NS_IMETHODIMP @@ -1939,7 +1939,7 @@ nsNativeThemeWin::GetMinimumWidgetSize(nsRenderingContext* aContext, nsIFrame* a nsIntSize* aResult, bool* aIsOverridable) { (*aResult).width = (*aResult).height = 0; - *aIsOverridable = PR_TRUE; + *aIsOverridable = true; HANDLE theme = GetTheme(aWidgetType); if (!theme) @@ -2007,7 +2007,7 @@ nsNativeThemeWin::GetMinimumWidgetSize(nsRenderingContext* aContext, nsIFrame* a SIZE boxSize(GetGutterSize(theme, NULL)); aResult->width = boxSize.cx+2; aResult->height = boxSize.cy; - *aIsOverridable = PR_FALSE; + *aIsOverridable = false; } case NS_THEME_MENUITEMTEXT: @@ -2027,13 +2027,13 @@ nsNativeThemeWin::GetMinimumWidgetSize(nsRenderingContext* aContext, nsIFrame* a break; case NS_THEME_RESIZER: - *aIsOverridable = PR_FALSE; + *aIsOverridable = false; break; case NS_THEME_SCALE_THUMB_HORIZONTAL: case NS_THEME_SCALE_THUMB_VERTICAL: { - *aIsOverridable = PR_FALSE; + *aIsOverridable = false; // on Vista, GetThemePartAndState returns odd values for // scale thumbs, so use a hardcoded size instead. if (nsUXThemeData::sIsVistaOrLater) { @@ -2080,7 +2080,7 @@ nsNativeThemeWin::GetMinimumWidgetSize(nsRenderingContext* aContext, nsIFrame* a aResult->height -= 4; } AddPaddingRect(aResult, CAPTIONBUTTON_RESTORE); - *aIsOverridable = PR_FALSE; + *aIsOverridable = false; return NS_OK; case NS_THEME_WINDOW_BUTTON_MINIMIZE: @@ -2092,7 +2092,7 @@ nsNativeThemeWin::GetMinimumWidgetSize(nsRenderingContext* aContext, nsIFrame* a aResult->height -= 4; } AddPaddingRect(aResult, CAPTIONBUTTON_MINIMIZE); - *aIsOverridable = PR_FALSE; + *aIsOverridable = false; return NS_OK; case NS_THEME_WINDOW_BUTTON_CLOSE: @@ -2104,14 +2104,14 @@ nsNativeThemeWin::GetMinimumWidgetSize(nsRenderingContext* aContext, nsIFrame* a aResult->height -= 4; } AddPaddingRect(aResult, CAPTIONBUTTON_CLOSE); - *aIsOverridable = PR_FALSE; + *aIsOverridable = false; return NS_OK; case NS_THEME_WINDOW_TITLEBAR: case NS_THEME_WINDOW_TITLEBAR_MAXIMIZED: aResult->height = GetSystemMetrics(SM_CYCAPTION); aResult->height += GetSystemMetrics(SM_CYFRAME); - *aIsOverridable = PR_FALSE; + *aIsOverridable = false; return NS_OK; case NS_THEME_WINDOW_BUTTON_BOX: @@ -2125,7 +2125,7 @@ nsNativeThemeWin::GetMinimumWidgetSize(nsRenderingContext* aContext, nsIFrame* a aResult->width += 1; aResult->height -= 2; } - *aIsOverridable = PR_FALSE; + *aIsOverridable = false; return NS_OK; } break; @@ -2135,7 +2135,7 @@ nsNativeThemeWin::GetMinimumWidgetSize(nsRenderingContext* aContext, nsIFrame* a case NS_THEME_WINDOW_FRAME_BOTTOM: aResult->width = GetSystemMetrics(SM_CXFRAME); aResult->height = GetSystemMetrics(SM_CYFRAME); - *aIsOverridable = PR_FALSE; + *aIsOverridable = false; return NS_OK; } @@ -2193,7 +2193,7 @@ nsNativeThemeWin::WidgetStateChanged(nsIFrame* aFrame, PRUint8 aWidgetType, aWidgetType == NS_THEME_TOOLBAR_SEPARATOR || aWidgetType == NS_THEME_WIN_GLASS || aWidgetType == NS_THEME_WIN_BORDERLESS_GLASS) { - *aShouldRepaint = PR_FALSE; + *aShouldRepaint = false; return NS_OK; } @@ -2206,7 +2206,7 @@ nsNativeThemeWin::WidgetStateChanged(nsIFrame* aFrame, PRUint8 aWidgetType, aWidgetType == NS_THEME_WINDOW_BUTTON_MINIMIZE || aWidgetType == NS_THEME_WINDOW_BUTTON_MINIMIZE || aWidgetType == NS_THEME_WINDOW_BUTTON_RESTORE) { - *aShouldRepaint = PR_TRUE; + *aShouldRepaint = true; return NS_OK; } @@ -2214,7 +2214,7 @@ nsNativeThemeWin::WidgetStateChanged(nsIFrame* aFrame, PRUint8 aWidgetType, if (!nsUXThemeData::sIsVistaOrLater && (aWidgetType == NS_THEME_SCROLLBAR_TRACK_VERTICAL || aWidgetType == NS_THEME_SCROLLBAR_TRACK_HORIZONTAL)) { - *aShouldRepaint = PR_FALSE; + *aShouldRepaint = false; return NS_OK; } @@ -2224,7 +2224,7 @@ nsNativeThemeWin::WidgetStateChanged(nsIFrame* aFrame, PRUint8 aWidgetType, (aWidgetType == NS_THEME_DROPDOWN || aWidgetType == NS_THEME_DROPDOWN_BUTTON) && IsHTMLContent(aFrame)) { - *aShouldRepaint = PR_TRUE; + *aShouldRepaint = true; return NS_OK; } @@ -2233,12 +2233,12 @@ nsNativeThemeWin::WidgetStateChanged(nsIFrame* aFrame, PRUint8 aWidgetType, // For example, a toolbar doesn't care about any states. if (!aAttribute) { // Hover/focus/active changed. Always repaint. - *aShouldRepaint = PR_TRUE; + *aShouldRepaint = true; } else { // Check the attribute to see if it's relevant. // disabled, checked, dlgtype, default, etc. - *aShouldRepaint = PR_FALSE; + *aShouldRepaint = false; if (aAttribute == nsWidgetAtoms::disabled || aAttribute == nsWidgetAtoms::checked || aAttribute == nsWidgetAtoms::selected || @@ -2246,7 +2246,7 @@ nsNativeThemeWin::WidgetStateChanged(nsIFrame* aFrame, PRUint8 aWidgetType, aAttribute == nsWidgetAtoms::open || aAttribute == nsWidgetAtoms::mozmenuactive || aAttribute == nsWidgetAtoms::focused) - *aShouldRepaint = PR_TRUE; + *aShouldRepaint = true; } return NS_OK; @@ -2268,7 +2268,7 @@ nsNativeThemeWin::ThemeSupportsWidget(nsPresContext* aPresContext, // specific widgets. if (aPresContext && !aPresContext->PresShell()->IsThemeSupportEnabled()) - return PR_FALSE; + return false; HANDLE theme = NULL; if (aWidgetType == NS_THEME_CHECKBOX_CONTAINER) @@ -2282,7 +2282,7 @@ nsNativeThemeWin::ThemeSupportsWidget(nsPresContext* aPresContext, // turn off theming for some HTML widgets styled by the page return (!IsWidgetStyled(aPresContext, aFrame, aWidgetType)); - return PR_FALSE; + return false; } bool @@ -2292,20 +2292,20 @@ nsNativeThemeWin::WidgetIsContainer(PRUint8 aWidgetType) if (aWidgetType == NS_THEME_DROPDOWN_BUTTON || aWidgetType == NS_THEME_RADIO || aWidgetType == NS_THEME_CHECKBOX) - return PR_FALSE; - return PR_TRUE; + return false; + return true; } bool nsNativeThemeWin::ThemeDrawsFocusForWidget(nsPresContext* aPresContext, nsIFrame* aFrame, PRUint8 aWidgetType) { - return PR_FALSE; + return false; } bool nsNativeThemeWin::ThemeNeedsComboboxDropmarker() { - return PR_TRUE; + return true; } nsITheme::Transparency @@ -2373,7 +2373,7 @@ nsNativeThemeWin::ClassicThemeSupportsWidget(nsPresContext* aPresContext, case NS_THEME_MENUPOPUP: // Classic non-flat menus are handled almost entirely through CSS. if (!nsUXThemeData::sFlatMenus) - return PR_FALSE; + return false; case NS_THEME_BUTTON: case NS_THEME_TEXTFIELD: case NS_THEME_TEXTFIELD_MULTILINE: @@ -2429,9 +2429,9 @@ nsNativeThemeWin::ClassicThemeSupportsWidget(nsPresContext* aPresContext, case NS_THEME_WINDOW_BUTTON_RESTORE: case NS_THEME_WINDOW_BUTTON_BOX: case NS_THEME_WINDOW_BUTTON_BOX_MAXIMIZED: - return PR_TRUE; + return true; } - return PR_FALSE; + return false; } nsresult @@ -2500,7 +2500,7 @@ nsNativeThemeWin::ClassicGetWidgetPadding(nsDeviceContext* aContext, bool focused; if (NS_FAILED(ClassicGetThemePartAndState(aFrame, aWidgetType, part, state, focused))) - return PR_FALSE; + return false; if (part == 1) { // top-level menu if (nsUXThemeData::sFlatMenus || !(state & DFCS_PUSHED)) { @@ -2516,14 +2516,14 @@ nsNativeThemeWin::ClassicGetWidgetPadding(nsDeviceContext* aContext, (*aResult).top = 0; (*aResult).bottom = (*aResult).left = (*aResult).right = 2; } - return PR_TRUE; + return true; } case NS_THEME_PROGRESSBAR: case NS_THEME_PROGRESSBAR_VERTICAL: (*aResult).top = (*aResult).left = (*aResult).bottom = (*aResult).right = 1; - return PR_TRUE; + return true; default: - return PR_FALSE; + return false; } } @@ -2533,7 +2533,7 @@ nsNativeThemeWin::ClassicGetMinimumWidgetSize(nsRenderingContext* aContext, nsIF nsIntSize* aResult, bool* aIsOverridable) { (*aResult).width = (*aResult).height = 0; - *aIsOverridable = PR_TRUE; + *aIsOverridable = true; switch (aWidgetType) { case NS_THEME_RADIO: case NS_THEME_CHECKBOX: @@ -2549,13 +2549,13 @@ nsNativeThemeWin::ClassicGetMinimumWidgetSize(nsRenderingContext* aContext, nsIF case NS_THEME_SCROLLBAR_BUTTON_DOWN: (*aResult).width = ::GetSystemMetrics(SM_CXVSCROLL); (*aResult).height = ::GetSystemMetrics(SM_CYVSCROLL); - *aIsOverridable = PR_FALSE; + *aIsOverridable = false; break; case NS_THEME_SCROLLBAR_BUTTON_LEFT: case NS_THEME_SCROLLBAR_BUTTON_RIGHT: (*aResult).width = ::GetSystemMetrics(SM_CXHSCROLL); (*aResult).height = ::GetSystemMetrics(SM_CYHSCROLL); - *aIsOverridable = PR_FALSE; + *aIsOverridable = false; break; case NS_THEME_SCROLLBAR_TRACK_VERTICAL: // XXX HACK We should be able to have a minimum height for the scrollbar @@ -2567,12 +2567,12 @@ nsNativeThemeWin::ClassicGetMinimumWidgetSize(nsRenderingContext* aContext, nsIF case NS_THEME_SCALE_THUMB_HORIZONTAL: (*aResult).width = 12; (*aResult).height = 20; - *aIsOverridable = PR_FALSE; + *aIsOverridable = false; break; case NS_THEME_SCALE_THUMB_VERTICAL: (*aResult).width = 20; (*aResult).height = 12; - *aIsOverridable = PR_FALSE; + *aIsOverridable = false; break; case NS_THEME_DROPDOWN_BUTTON: (*aResult).width = ::GetSystemMetrics(SM_CXVSCROLL); @@ -2605,7 +2605,7 @@ nsNativeThemeWin::ClassicGetMinimumWidgetSize(nsRenderingContext* aContext, nsIF (*aResult).width = (*aResult).height = abs(nc.lfStatusFont.lfHeight) + 4; else (*aResult).width = (*aResult).height = 15; - *aIsOverridable = PR_FALSE; + *aIsOverridable = false; break; case NS_THEME_SCROLLBAR_THUMB_VERTICAL: (*aResult).width = ::GetSystemMetrics(SM_CXVSCROLL); @@ -2614,7 +2614,7 @@ nsNativeThemeWin::ClassicGetMinimumWidgetSize(nsRenderingContext* aContext, nsIF // native if (!GetTheme(aWidgetType)) (*aResult).height >>= 1; - *aIsOverridable = PR_FALSE; + *aIsOverridable = false; break; case NS_THEME_SCROLLBAR_THUMB_HORIZONTAL: (*aResult).width = ::GetSystemMetrics(SM_CXHTHUMB); @@ -2623,7 +2623,7 @@ nsNativeThemeWin::ClassicGetMinimumWidgetSize(nsRenderingContext* aContext, nsIF // native if (!GetTheme(aWidgetType)) (*aResult).width >>= 1; - *aIsOverridable = PR_FALSE; + *aIsOverridable = false; break; case NS_THEME_SCROLLBAR_TRACK_HORIZONTAL: (*aResult).width = ::GetSystemMetrics(SM_CXHTHUMB) << 1; @@ -2685,14 +2685,14 @@ nsNativeThemeWin::ClassicGetMinimumWidgetSize(nsRenderingContext* aContext, nsIF nsresult nsNativeThemeWin::ClassicGetThemePartAndState(nsIFrame* aFrame, PRUint8 aWidgetType, PRInt32& aPart, PRInt32& aState, bool& aFocused) { - aFocused = PR_FALSE; + aFocused = false; switch (aWidgetType) { case NS_THEME_BUTTON: { nsEventStates contentState; aPart = DFC_BUTTON; aState = DFCS_BUTTONPUSH; - aFocused = PR_FALSE; + aFocused = false; contentState = GetContentState(aFrame, aWidgetType); if (IsDisabled(aFrame, contentState)) @@ -2710,12 +2710,12 @@ nsresult nsNativeThemeWin::ClassicGetThemePartAndState(nsIFrame* aFrame, PRUint8 if (!aFrame->GetContent()->IsHTML()) aState |= DFCS_FLAT; - aFocused = PR_TRUE; + aFocused = true; } } if (contentState.HasState(NS_EVENT_STATE_FOCUS) || (aState == DFCS_BUTTONPUSH && IsDefaultButton(aFrame))) { - aFocused = PR_TRUE; + aFocused = true; } } @@ -2725,7 +2725,7 @@ nsresult nsNativeThemeWin::ClassicGetThemePartAndState(nsIFrame* aFrame, PRUint8 case NS_THEME_CHECKBOX: case NS_THEME_RADIO: { nsEventStates contentState; - aFocused = PR_FALSE; + aFocused = false; aPart = DFC_BUTTON; aState = 0; @@ -2751,7 +2751,7 @@ nsresult nsNativeThemeWin::ClassicGetThemePartAndState(nsIFrame* aFrame, PRUint8 contentState = GetContentState(aFrame, aWidgetType); if (!content->IsXUL() && contentState.HasState(NS_EVENT_STATE_FOCUS)) { - aFocused = PR_TRUE; + aFocused = true; } if (IsDisabled(aFrame, contentState)) { diff --git a/widget/src/windows/nsPrintSettingsWin.cpp b/widget/src/windows/nsPrintSettingsWin.cpp index b3787173524d..c679502ff0e5 100644 --- a/widget/src/windows/nsPrintSettingsWin.cpp +++ b/widget/src/windows/nsPrintSettingsWin.cpp @@ -219,15 +219,15 @@ Tester::Tester() } if (ps) { - ps->SetPrintOptions(nsIPrintSettings::kPrintOddPages, PR_TRUE); - ps->SetPrintOptions(nsIPrintSettings::kPrintEvenPages, PR_FALSE); + ps->SetPrintOptions(nsIPrintSettings::kPrintOddPages, true); + ps->SetPrintOptions(nsIPrintSettings::kPrintEvenPages, false); ps->SetMarginTop(1.0); ps->SetMarginLeft(1.0); ps->SetMarginBottom(1.0); ps->SetMarginRight(1.0); ps->SetScaling(0.5); - ps->SetPrintBGColors(PR_TRUE); - ps->SetPrintBGImages(PR_TRUE); + ps->SetPrintBGColors(true); + ps->SetPrintBGImages(true); ps->SetPrintRange(15); ps->SetHeaderStrLeft(NS_ConvertUTF8toUTF16("Left").get()); ps->SetHeaderStrCenter(NS_ConvertUTF8toUTF16("Center").get()); @@ -241,13 +241,13 @@ Tester::Tester() ps->SetPaperWidth(100.0); ps->SetPaperHeight(50.0); ps->SetPaperSizeUnit(nsIPrintSettings::kPaperSizeMillimeters); - ps->SetPrintReversed(PR_TRUE); - ps->SetPrintInColor(PR_TRUE); + ps->SetPrintReversed(true); + ps->SetPrintInColor(true); ps->SetOrientation(nsIPrintSettings::kLandscapeOrientation); ps->SetPrintCommand(NS_ConvertUTF8toUTF16("Command").get()); ps->SetNumCopies(2); ps->SetPrinterName(NS_ConvertUTF8toUTF16("Printer Name").get()); - ps->SetPrintToFile(PR_TRUE); + ps->SetPrintToFile(true); ps->SetToFileName(NS_ConvertUTF8toUTF16("File Name").get()); ps->SetPrintPageDelay(1000); diff --git a/widget/src/windows/nsTextStore.cpp b/widget/src/windows/nsTextStore.cpp index 0f09b7aa142b..6c21e22c17cc 100644 --- a/widget/src/windows/nsTextStore.cpp +++ b/widget/src/windows/nsTextStore.cpp @@ -93,7 +93,7 @@ nsTextStore::Create(nsWindow* aWindow, // Create document manager HRESULT hr = sTsfThreadMgr->CreateDocumentMgr( getter_AddRefs(mDocumentMgr)); - NS_ENSURE_TRUE(SUCCEEDED(hr), PR_FALSE); + NS_ENSURE_TRUE(SUCCEEDED(hr), false); mWindow = aWindow; // Create context and add it to document manager hr = mDocumentMgr->CreateContext(sTsfClientId, 0, @@ -106,12 +106,12 @@ nsTextStore::Create(nsWindow* aWindow, if (SUCCEEDED(hr)) { PR_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: Created, window=%08x\n", aWindow)); - return PR_TRUE; + return true; } mContext = NULL; mDocumentMgr = NULL; } - return PR_FALSE; + return false; } bool @@ -138,7 +138,7 @@ nsTextStore::Destroy(void) PR_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: Destroyed, window=%08x\n", mWindow)); mWindow = NULL; - return PR_TRUE; + return true; } STDMETHODIMP @@ -301,7 +301,7 @@ nsTextStore::GetSelection(ULONG ulIndex, *pSelection = mCompositionSelection; } else { // Construct and initialize an event to get selection info - nsQueryContentEvent event(PR_TRUE, NS_QUERY_SELECTED_TEXT, mWindow); + nsQueryContentEvent event(true, NS_QUERY_SELECTED_TEXT, mWindow); mWindow->InitEvent(event); mWindow->DispatchWindowEvent(&event); NS_ENSURE_TRUE(event.mSucceeded, E_FAIL); @@ -543,7 +543,7 @@ nsTextStore::SaveTextEvent(const nsTextEvent* aEvent) if (!aEvent) return S_OK; - mLastDispatchedTextEvent = new nsTextEvent(PR_TRUE, NS_TEXT_TEXT, nsnull); + mLastDispatchedTextEvent = new nsTextEvent(true, NS_TEXT_TEXT, nsnull); if (!mLastDispatchedTextEvent) return E_OUTOFMEMORY; mLastDispatchedTextEvent->rangeCount = aEvent->rangeCount; @@ -608,7 +608,7 @@ nsTextStore::UpdateCompositionExtent(ITfRange* aRangeNew) // a new one. OnEndComposition followed by OnStartComposition // will accomplish this automagically. OnEndComposition(pComposition); - OnStartCompositionInternal(pComposition, composingRange, PR_TRUE); + OnStartCompositionInternal(pComposition, composingRange, true); PR_LOG(sTextStoreLog, PR_LOG_ALWAYS, ("TSF: UpdateCompositionExtent, (reset) range=%ld-%ld\n", compStart, compStart + compLength)); @@ -630,15 +630,15 @@ GetColor(const TF_DA_COLOR &aTSFColor, nscolor &aResult) DWORD sysColor = ::GetSysColor(aTSFColor.nIndex); aResult = NS_RGB(GetRValue(sysColor), GetGValue(sysColor), GetBValue(sysColor)); - return PR_TRUE; + return true; } case TF_CT_COLORREF: aResult = NS_RGB(GetRValue(aTSFColor.cr), GetGValue(aTSFColor.cr), GetBValue(aTSFColor.cr)); - return PR_TRUE; + return true; case TF_CT_NONE: default: - return PR_FALSE; + return false; } } @@ -648,21 +648,21 @@ GetLineStyle(TF_DA_LINESTYLE aTSFLineStyle, PRUint8 &aTextRangeLineStyle) switch (aTSFLineStyle) { case TF_LS_NONE: aTextRangeLineStyle = nsTextRangeStyle::LINESTYLE_NONE; - return PR_TRUE; + return true; case TF_LS_SOLID: aTextRangeLineStyle = nsTextRangeStyle::LINESTYLE_SOLID; - return PR_TRUE; + return true; case TF_LS_DOT: aTextRangeLineStyle = nsTextRangeStyle::LINESTYLE_DOTTED; - return PR_TRUE; + return true; case TF_LS_DASH: aTextRangeLineStyle = nsTextRangeStyle::LINESTYLE_DASHED; - return PR_TRUE; + return true; case TF_LS_SQUIGGLE: aTextRangeLineStyle = nsTextRangeStyle::LINESTYLE_WAVY; - return PR_TRUE; + return true; default: - return PR_FALSE; + return false; } } @@ -688,7 +688,7 @@ nsTextStore::SendTextEventForCompositionString() NS_ENSURE_TRUE(SUCCEEDED(hr) && attrPropetry, hr); // Use NS_TEXT_TEXT to set composition string - nsTextEvent event(PR_TRUE, NS_TEXT_TEXT, mWindow); + nsTextEvent event(true, NS_TEXT_TEXT, mWindow); mWindow->InitEvent(event); nsRefPtr composingRange; @@ -804,7 +804,7 @@ nsTextStore::SendTextEventForCompositionString() } if (mCompositionString != mLastDispatchedCompositionString) { - nsCompositionEvent compositionUpdate(PR_TRUE, NS_COMPOSITION_UPDATE, + nsCompositionEvent compositionUpdate(true, NS_COMPOSITION_UPDATE, mWindow); mWindow->InitEvent(compositionUpdate); compositionUpdate.data = mCompositionString; @@ -845,7 +845,7 @@ nsTextStore::SetSelectionInternal(const TS_SELECTION_ACP* pSelection, NS_ENSURE_TRUE(SUCCEEDED(hr), hr); } } else { - nsSelectionEvent event(PR_TRUE, NS_SELECTION_SET, mWindow); + nsSelectionEvent event(true, NS_SELECTION_SET, mWindow); event.mOffset = pSelection->acpStart; event.mLength = PRUint32(pSelection->acpEnd - pSelection->acpStart); event.mReversed = pSelection->style.ase == TS_AE_START; @@ -865,7 +865,7 @@ nsTextStore::SetSelection(ULONG ulCount, NS_ENSURE_TRUE(TS_LF_READWRITE == (mLock & TS_LF_READWRITE), TS_E_NOLOCK); NS_ENSURE_TRUE(1 == ulCount && pSelection, E_INVALIDARG); - return SetSelectionInternal(pSelection, PR_TRUE); + return SetSelectionInternal(pSelection, true); } STDMETHODIMP @@ -919,7 +919,7 @@ nsTextStore::GetText(LONG acpStart, } } // Send NS_QUERY_TEXT_CONTENT to get text content - nsQueryContentEvent event(PR_TRUE, NS_QUERY_TEXT_CONTENT, mWindow); + nsQueryContentEvent event(true, NS_QUERY_TEXT_CONTENT, mWindow); mWindow->InitEvent(event); event.InitForQueryTextContent(PRUint32(acpStart), length); mWindow->DispatchWindowEvent(&event); @@ -1081,7 +1081,7 @@ nsTextStore::GetEndACP(LONG *pacp) NS_ENSURE_TRUE(TS_LF_READ == (mLock & TS_LF_READ), TS_E_NOLOCK); NS_ENSURE_TRUE(pacp, E_INVALIDARG); // Flattened text is retrieved and its length returned - nsQueryContentEvent event(PR_TRUE, NS_QUERY_TEXT_CONTENT, mWindow); + nsQueryContentEvent event(true, NS_QUERY_TEXT_CONTENT, mWindow); mWindow->InitEvent(event); // Return entire text event.InitForQueryTextContent(0, PR_INT32_MAX); @@ -1126,7 +1126,7 @@ nsTextStore::GetTextExt(TsViewCookie vcView, NS_ENSURE_TRUE(acpStart >= 0 && acpEnd >= acpStart, TS_E_INVALIDPOS); // use NS_QUERY_TEXT_RECT to get rect in system, screen coordinates - nsQueryContentEvent event(PR_TRUE, NS_QUERY_TEXT_RECT, mWindow); + nsQueryContentEvent event(true, NS_QUERY_TEXT_RECT, mWindow); mWindow->InitEvent(event); event.InitForQueryTextRect(acpStart, acpEnd - acpStart); mWindow->DispatchWindowEvent(&event); @@ -1141,7 +1141,7 @@ nsTextStore::GetTextExt(TsViewCookie vcView, nsWindow* refWindow = static_cast( event.mReply.mFocusedWidget ? event.mReply.mFocusedWidget : mWindow); // Result rect is in top level widget coordinates - refWindow = refWindow->GetTopLevelWindow(PR_FALSE); + refWindow = refWindow->GetTopLevelWindow(false); NS_ENSURE_TRUE(refWindow, E_FAIL); event.mReply.mRect.MoveBy(refWindow->WidgetToScreenOffset()); @@ -1169,7 +1169,7 @@ nsTextStore::GetScreenExt(TsViewCookie vcView, { NS_ENSURE_TRUE(TEXTSTORE_DEFAULT_VIEW == vcView && prc, E_INVALIDARG); // use NS_QUERY_EDITOR_RECT to get rect in system, screen coordinates - nsQueryContentEvent event(PR_TRUE, NS_QUERY_EDITOR_RECT, mWindow); + nsQueryContentEvent event(true, NS_QUERY_EDITOR_RECT, mWindow); mWindow->InitEvent(event); mWindow->DispatchWindowEvent(&event); NS_ENSURE_TRUE(event.mSucceeded, E_FAIL); @@ -1177,7 +1177,7 @@ nsTextStore::GetScreenExt(TsViewCookie vcView, nsWindow* refWindow = static_cast( event.mReply.mFocusedWidget ? event.mReply.mFocusedWidget : mWindow); // Result rect is in top level widget coordinates - refWindow = refWindow->GetTopLevelWindow(PR_FALSE); + refWindow = refWindow->GetTopLevelWindow(false); NS_ENSURE_TRUE(refWindow, E_FAIL); nsIntRect boundRect; @@ -1255,7 +1255,7 @@ nsTextStore::InsertTextAtSelection(DWORD dwFlags, sel.acpEnd - mCompositionStart)); } else { // Use a temporary composition to contain the text - nsCompositionEvent compEvent(PR_TRUE, NS_COMPOSITION_START, mWindow); + nsCompositionEvent compEvent(true, NS_COMPOSITION_START, mWindow); mWindow->InitEvent(compEvent); mWindow->DispatchWindowEvent(&compEvent); if (mWindow && !mWindow->Destroyed()) { @@ -1263,7 +1263,7 @@ nsTextStore::InsertTextAtSelection(DWORD dwFlags, compEvent.data.Assign(pchText, cch); mWindow->DispatchWindowEvent(&compEvent); if (mWindow && !mWindow->Destroyed()) { - nsTextEvent event(PR_TRUE, NS_TEXT_TEXT, mWindow); + nsTextEvent event(true, NS_TEXT_TEXT, mWindow); mWindow->InitEvent(event); if (!cch) { // XXX See OnEndComposition comment on inserting empty strings @@ -1324,16 +1324,16 @@ nsTextStore::OnStartCompositionInternal(ITfCompositionView* pComposition, mCompositionStart + mCompositionLength)); // Select composition range so the new composition replaces the range - nsSelectionEvent selEvent(PR_TRUE, NS_SELECTION_SET, mWindow); + nsSelectionEvent selEvent(true, NS_SELECTION_SET, mWindow); mWindow->InitEvent(selEvent); selEvent.mOffset = PRUint32(mCompositionStart); selEvent.mLength = PRUint32(mCompositionLength); - selEvent.mReversed = PR_FALSE; + selEvent.mReversed = false; mWindow->DispatchWindowEvent(&selEvent); NS_ENSURE_TRUE(selEvent.mSucceeded, E_FAIL); // Set up composition - nsQueryContentEvent queryEvent(PR_TRUE, NS_QUERY_SELECTED_TEXT, mWindow); + nsQueryContentEvent queryEvent(true, NS_QUERY_SELECTED_TEXT, mWindow); mWindow->InitEvent(queryEvent); mWindow->DispatchWindowEvent(&queryEvent); NS_ENSURE_TRUE(queryEvent.mSucceeded, E_FAIL); @@ -1344,7 +1344,7 @@ nsTextStore::OnStartCompositionInternal(ITfCompositionView* pComposition, mCompositionSelection.style.ase = TS_AE_END; mCompositionSelection.style.fInterimChar = FALSE; } - nsCompositionEvent event(PR_TRUE, NS_COMPOSITION_START, mWindow); + nsCompositionEvent event(true, NS_COMPOSITION_START, mWindow); mWindow->InitEvent(event); mWindow->DispatchWindowEvent(&event); return S_OK; @@ -1375,7 +1375,7 @@ nsTextStore::OnStartComposition(ITfCompositionView* pComposition, nsRefPtr range; HRESULT hr = pComposition->GetRange(getter_AddRefs(range)); NS_ENSURE_TRUE(SUCCEEDED(hr), hr); - hr = OnStartCompositionInternal(pComposition, range, PR_FALSE); + hr = OnStartCompositionInternal(pComposition, range, false); if (FAILED(hr)) return hr; @@ -1424,7 +1424,7 @@ nsTextStore::OnEndComposition(ITfCompositionView* pComposition) } if (mCompositionString != mLastDispatchedCompositionString) { - nsCompositionEvent compositionUpdate(PR_TRUE, NS_COMPOSITION_UPDATE, + nsCompositionEvent compositionUpdate(true, NS_COMPOSITION_UPDATE, mWindow); mWindow->InitEvent(compositionUpdate); compositionUpdate.data = mCompositionString; @@ -1438,7 +1438,7 @@ nsTextStore::OnEndComposition(ITfCompositionView* pComposition) } // Use NS_TEXT_TEXT to commit composition string - nsTextEvent textEvent(PR_TRUE, NS_TEXT_TEXT, mWindow); + nsTextEvent textEvent(true, NS_TEXT_TEXT, mWindow); mWindow->InitEvent(textEvent); if (!mCompositionString.Length()) { // XXX HACK! HACK! NS_TEXT_TEXT handler specifically rejects @@ -1460,7 +1460,7 @@ nsTextStore::OnEndComposition(ITfCompositionView* pComposition) return S_OK; } - nsCompositionEvent event(PR_TRUE, NS_COMPOSITION_END, mWindow); + nsCompositionEvent event(true, NS_COMPOSITION_END, mWindow); event.data = mLastDispatchedCompositionString; mWindow->InitEvent(event); mWindow->DispatchWindowEvent(&event); @@ -1583,11 +1583,11 @@ GetCompartment(IUnknown* pUnk, const GUID& aID, ITfCompartment** aCompartment) { - if (!pUnk) return PR_FALSE; + if (!pUnk) return false; nsRefPtr compMgr; pUnk->QueryInterface(IID_ITfCompartmentMgr, getter_AddRefs(compMgr)); - if (!compMgr) return PR_FALSE; + if (!compMgr) return false; return SUCCEEDED(compMgr->GetCompartment(aID, aCompartment)) && (*aCompartment) != NULL; @@ -1618,7 +1618,7 @@ nsTextStore::GetIMEOpenState(void) if (!GetCompartment(sTsfThreadMgr, GUID_COMPARTMENT_KEYBOARD_OPENCLOSE, getter_AddRefs(comp))) - return PR_FALSE; + return false; VARIANT variant; ::VariantInit(&variant); @@ -1626,7 +1626,7 @@ nsTextStore::GetIMEOpenState(void) return variant.lVal != 0; ::VariantClear(&variant); // clear up in case variant.vt != VT_I4 - return PR_FALSE; + return false; } void diff --git a/widget/src/windows/nsToolkit.cpp b/widget/src/windows/nsToolkit.cpp index 4515c4c3550d..9ae1a8e39f3a 100644 --- a/widget/src/windows/nsToolkit.cpp +++ b/widget/src/windows/nsToolkit.cpp @@ -95,7 +95,7 @@ void RunPump(void* arg) // do registration and creation in this thread info->toolkit->CreateInternalWindow(PR_GetCurrentThread()); - gThreadState = PR_TRUE; + gThreadState = true; ::PR_Notify(info->monitor); ::PR_ExitMonitor(info->monitor); @@ -374,7 +374,7 @@ bool nsToolkit::InitVersionInfo() if (!isInitialized) { - isInitialized = PR_TRUE; + isInitialized = true; OSVERSIONINFO osversion; osversion.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); @@ -386,7 +386,7 @@ bool nsToolkit::InitVersionInfo() } } - return PR_TRUE; + return true; } //------------------------------------------------------------------------- @@ -394,7 +394,7 @@ bool nsToolkit::InitVersionInfo() // //------------------------------------------------------------------------- MouseTrailer::MouseTrailer() : mMouseTrailerWindow(nsnull), mCaptureWindow(nsnull), - mIsInCaptureMode(PR_FALSE), mEnabled(PR_TRUE) + mIsInCaptureMode(false), mEnabled(true) { } //------------------------------------------------------------------------- @@ -427,7 +427,7 @@ void MouseTrailer::SetCaptureWindow(HWND aWnd) { mCaptureWindow = aWnd; if (mCaptureWindow) { - mIsInCaptureMode = PR_TRUE; + mIsInCaptureMode = true; } } @@ -485,7 +485,7 @@ void MouseTrailer::TimerProc(nsITimer* aTimer, void* aClosure) // it if we were capturing and now this is the first timer callback // since we canceled the capture mtrailer->mMouseTrailerWindow = nsnull; - mtrailer->mIsInCaptureMode = PR_FALSE; + mtrailer->mIsInCaptureMode = false; return; } } diff --git a/widget/src/windows/nsToolkit.h b/widget/src/windows/nsToolkit.h index 2cc051784703..e326dab5f3c8 100644 --- a/widget/src/windows/nsToolkit.h +++ b/widget/src/windows/nsToolkit.h @@ -132,8 +132,8 @@ public: void SetMouseTrailerWindow(HWND aWnd); void SetCaptureWindow(HWND aWnd); - void Disable() { mEnabled = PR_FALSE; DestroyTimer(); } - void Enable() { mEnabled = PR_TRUE; CreateTimer(); } + void Disable() { mEnabled = false; DestroyTimer(); } + void Enable() { mEnabled = true; CreateTimer(); } void DestroyTimer(); MouseTrailer(); diff --git a/widget/src/windows/nsUXThemeData.cpp b/widget/src/windows/nsUXThemeData.cpp index 9cef1f2f709e..357c42e2560f 100644 --- a/widget/src/windows/nsUXThemeData.cpp +++ b/widget/src/windows/nsUXThemeData.cpp @@ -67,9 +67,9 @@ nsUXThemeData::sDwmDLL = NULL; BOOL nsUXThemeData::sFlatMenus = FALSE; bool -nsUXThemeData::sIsXPOrLater = PR_FALSE; +nsUXThemeData::sIsXPOrLater = false; bool -nsUXThemeData::sIsVistaOrLater = PR_FALSE; +nsUXThemeData::sIsVistaOrLater = false; bool nsUXThemeData::sTitlebarInfoPopulatedAero = false; bool nsUXThemeData::sTitlebarInfoPopulatedThemed = false; @@ -148,7 +148,7 @@ nsUXThemeData::Initialize() dwmSetWindowAttributePtr = (DwmSetWindowAttributeProc)::GetProcAddress(sDwmDLL, "DwmSetWindowAttribute"); dwmInvalidateIconicBitmapsPtr = (DwmInvalidateIconicBitmapsProc)::GetProcAddress(sDwmDLL, "DwmInvalidateIconicBitmaps"); dwmDwmDefWindowProcPtr = (DwmDefWindowProcProc)::GetProcAddress(sDwmDLL, "DwmDefWindowProc"); - CheckForCompositor(PR_TRUE); + CheckForCompositor(true); } #endif @@ -164,15 +164,15 @@ nsUXThemeData::Invalidate() { } } if (sIsXPOrLater) { - BOOL useFlat = PR_FALSE; + BOOL useFlat = false; sFlatMenus = ::SystemParametersInfo(SPI_GETFLATMENU, 0, &useFlat, 0) ? - useFlat : PR_FALSE; + useFlat : false; } else { // Contrary to Microsoft's documentation, SPI_GETFLATMENU will not fail // on Windows 2000, and it is also possible (though unlikely) for WIN2K // to be misconfigured in such a way that it would return true, so we // shall give WIN2K special treatment - sFlatMenus = PR_FALSE; + sFlatMenus = false; } } @@ -289,7 +289,7 @@ nsUXThemeData::UpdateTitlebarInfo(HWND aWnd) sizeof(captionButtons)))) { sCommandButtons[CMDBUTTONIDX_BUTTONBOX].cx = captionButtons.right - captionButtons.left - 3; sCommandButtons[CMDBUTTONIDX_BUTTONBOX].cy = (captionButtons.bottom - captionButtons.top) - 1; - sTitlebarInfoPopulatedAero = PR_TRUE; + sTitlebarInfoPopulatedAero = true; } } #endif @@ -348,7 +348,7 @@ nsUXThemeData::UpdateTitlebarInfo(HWND aWnd) sCommandButtons[2].cx = info.rgrect[5].right - info.rgrect[5].left; sCommandButtons[2].cy = info.rgrect[5].bottom - info.rgrect[5].top; - sTitlebarInfoPopulatedThemed = PR_TRUE; + sTitlebarInfoPopulatedThemed = true; } // visual style (aero glass, aero basic) @@ -378,7 +378,7 @@ LookAndFeel::WindowsTheme nsUXThemeData::sThemeId = LookAndFeel::eWindowsTheme_Generic; bool -nsUXThemeData::sIsDefaultWindowsTheme = PR_FALSE; +nsUXThemeData::sIsDefaultWindowsTheme = false; // static LookAndFeel::WindowsTheme @@ -400,7 +400,7 @@ nsUXThemeData::UpdateNativeThemeInfo() // Trigger a refresh of themed button metrics if needed sTitlebarInfoPopulatedThemed = (nsWindow::GetWindowsVersion() < VISTA_VERSION); - sIsDefaultWindowsTheme = PR_FALSE; + sIsDefaultWindowsTheme = false; sThemeId = LookAndFeel::eWindowsTheme_Generic; if (!IsAppThemed() || !getCurrentThemeName) { @@ -434,7 +434,7 @@ nsUXThemeData::UpdateNativeThemeInfo() return; if (theme == WINTHEME_AERO || theme == WINTHEME_LUNA) - sIsDefaultWindowsTheme = PR_TRUE; + sIsDefaultWindowsTheme = true; if (theme != WINTHEME_LUNA) { switch(theme) { diff --git a/widget/src/windows/nsWinGesture.cpp b/widget/src/windows/nsWinGesture.cpp index a4b713e88cdc..567de2675721 100644 --- a/widget/src/windows/nsWinGesture.cpp +++ b/widget/src/windows/nsWinGesture.cpp @@ -76,11 +76,11 @@ nsWinGesture::CloseTouchInputHandlePtr nsWinGesture::closeTouchInputHandle = nsn static bool gEnableSingleFingerPanEvents = false; nsWinGesture::nsWinGesture() : - mPanActive(PR_FALSE), - mFeedbackActive(PR_FALSE), - mXAxisFeedback(PR_FALSE), - mYAxisFeedback(PR_FALSE), - mPanInertiaActive(PR_FALSE) + mPanActive(false), + mFeedbackActive(false), + mXAxisFeedback(false), + mYAxisFeedback(false), + mPanInertiaActive(false) { (void)InitLibrary(); mPixelScrollOverflow = 0; @@ -91,9 +91,9 @@ nsWinGesture::nsWinGesture() : bool nsWinGesture::InitLibrary() { if (getGestureInfo) { - return PR_TRUE; + return true; } else if (sLibraryHandle) { - return PR_FALSE; + return false; } sLibraryHandle = ::LoadLibraryW(kGestureLibraryName); @@ -119,7 +119,7 @@ bool nsWinGesture::InitLibrary() getGestureExtraArgs = nsnull; setGestureConfig = nsnull; getGestureConfig = nsnull; - return PR_FALSE; + return false; } if (!registerTouchWindow || !unregisterTouchWindow || !getTouchInputInfo || !closeTouchInputHandle) { @@ -147,7 +147,7 @@ bool nsWinGesture::InitLibrary() gEnableSingleFingerPanEvents = Preferences::GetBool("gestures.enable_single_finger_input", false); - return PR_TRUE; + return true; } #define GCOUNT 5 @@ -155,7 +155,7 @@ bool nsWinGesture::InitLibrary() bool nsWinGesture::SetWinGestureSupport(HWND hWnd, nsGestureNotifyEvent::ePanDirection aDirection) { if (!getGestureInfo) - return PR_FALSE; + return false; GESTURECONFIG config[GCOUNT]; @@ -214,7 +214,7 @@ bool nsWinGesture::IsAvailable() bool nsWinGesture::RegisterTouchWindow(HWND hWnd) { if (!registerTouchWindow) - return PR_FALSE; + return false; return registerTouchWindow(hWnd, TWF_WANTPALM); } @@ -222,7 +222,7 @@ bool nsWinGesture::RegisterTouchWindow(HWND hWnd) bool nsWinGesture::UnregisterTouchWindow(HWND hWnd) { if (!unregisterTouchWindow) - return PR_FALSE; + return false; return unregisterTouchWindow(hWnd); } @@ -230,7 +230,7 @@ bool nsWinGesture::UnregisterTouchWindow(HWND hWnd) bool nsWinGesture::GetTouchInputInfo(HTOUCHINPUT hTouchInput, PRUint32 cInputs, PTOUCHINPUT pInputs) { if (!getTouchInputInfo) - return PR_FALSE; + return false; return getTouchInputInfo(hTouchInput, cInputs, pInputs, sizeof(TOUCHINPUT)); } @@ -238,7 +238,7 @@ bool nsWinGesture::GetTouchInputInfo(HTOUCHINPUT hTouchInput, PRUint32 cInputs, bool nsWinGesture::CloseTouchInputHandle(HTOUCHINPUT hTouchInput) { if (!closeTouchInputHandle) - return PR_FALSE; + return false; return closeTouchInputHandle(hTouchInput); } @@ -246,7 +246,7 @@ bool nsWinGesture::CloseTouchInputHandle(HTOUCHINPUT hTouchInput) bool nsWinGesture::GetGestureInfo(HGESTUREINFO hGestureInfo, PGESTUREINFO pGestureInfo) { if (!getGestureInfo || !hGestureInfo || !pGestureInfo) - return PR_FALSE; + return false; ZeroMemory(pGestureInfo, sizeof(GESTUREINFO)); pGestureInfo->cbSize = sizeof(GESTUREINFO); @@ -257,7 +257,7 @@ bool nsWinGesture::GetGestureInfo(HGESTUREINFO hGestureInfo, PGESTUREINFO pGestu bool nsWinGesture::CloseGestureInfoHandle(HGESTUREINFO hGestureInfo) { if (!getGestureInfo || !hGestureInfo) - return PR_FALSE; + return false; return closeGestureInfoHandle(hGestureInfo); } @@ -265,7 +265,7 @@ bool nsWinGesture::CloseGestureInfoHandle(HGESTUREINFO hGestureInfo) bool nsWinGesture::GetGestureExtraArgs(HGESTUREINFO hGestureInfo, UINT cbExtraArgs, PBYTE pExtraArgs) { if (!getGestureInfo || !hGestureInfo || !pExtraArgs) - return PR_FALSE; + return false; return getGestureExtraArgs(hGestureInfo, cbExtraArgs, pExtraArgs); } @@ -273,7 +273,7 @@ bool nsWinGesture::GetGestureExtraArgs(HGESTUREINFO hGestureInfo, UINT cbExtraAr bool nsWinGesture::SetGestureConfig(HWND hWnd, UINT cIDs, PGESTURECONFIG pGestureConfig) { if (!getGestureInfo || !pGestureConfig) - return PR_FALSE; + return false; return setGestureConfig(hWnd, 0, cIDs, pGestureConfig, sizeof(GESTURECONFIG)); } @@ -281,7 +281,7 @@ bool nsWinGesture::SetGestureConfig(HWND hWnd, UINT cIDs, PGESTURECONFIG pGestur bool nsWinGesture::GetGestureConfig(HWND hWnd, DWORD dwFlags, PUINT pcIDs, PGESTURECONFIG pGestureConfig) { if (!getGestureInfo || !pGestureConfig) - return PR_FALSE; + return false; return getGestureConfig(hWnd, 0, dwFlags, pcIDs, pGestureConfig, sizeof(GESTURECONFIG)); } @@ -289,7 +289,7 @@ bool nsWinGesture::GetGestureConfig(HWND hWnd, DWORD dwFlags, PUINT pcIDs, PGEST bool nsWinGesture::BeginPanningFeedback(HWND hWnd) { if (!beginPanningFeedback) - return PR_FALSE; + return false; return beginPanningFeedback(hWnd); } @@ -297,7 +297,7 @@ bool nsWinGesture::BeginPanningFeedback(HWND hWnd) bool nsWinGesture::EndPanningFeedback(HWND hWnd) { if (!beginPanningFeedback) - return PR_FALSE; + return false; return endPanningFeedback(hWnd, TRUE); } @@ -305,7 +305,7 @@ bool nsWinGesture::EndPanningFeedback(HWND hWnd) bool nsWinGesture::UpdatePanningFeedback(HWND hWnd, LONG offsetX, LONG offsetY, BOOL fInInertia) { if (!beginPanningFeedback) - return PR_FALSE; + return false; return updatePanningFeedback(hWnd, offsetX, offsetY, fInInertia); } @@ -319,12 +319,12 @@ bool nsWinGesture::IsPanEvent(LPARAM lParam) BOOL result = GetGestureInfo((HGESTUREINFO)lParam, &gi); if (!result) - return PR_FALSE; + return false; if (gi.dwID == GID_PAN) - return PR_TRUE; + return true; - return PR_FALSE; + return false; } /* Gesture event processing */ @@ -339,7 +339,7 @@ nsWinGesture::ProcessGestureMessage(HWND hWnd, WPARAM wParam, LPARAM lParam, nsS BOOL result = GetGestureInfo((HGESTUREINFO)lParam, &gi); if (!result) - return PR_FALSE; + return false; // The coordinates of this event nsPointWin coord; @@ -356,7 +356,7 @@ nsWinGesture::ProcessGestureMessage(HWND hWnd, WPARAM wParam, LPARAM lParam, nsS case GID_BEGIN: case GID_END: // These should always fall through to DefWndProc - return PR_FALSE; + return false; break; case GID_ZOOM: @@ -434,7 +434,7 @@ nsWinGesture::ProcessGestureMessage(HWND hWnd, WPARAM wParam, LPARAM lParam, nsS break; } - return PR_TRUE; + return true; } bool @@ -447,7 +447,7 @@ nsWinGesture::ProcessPanMessage(HWND hWnd, WPARAM wParam, LPARAM lParam) BOOL result = GetGestureInfo((HGESTUREINFO)lParam, &gi); if (!result) - return PR_FALSE; + return false; // The coordinates of this event nsPointWin coord; @@ -461,7 +461,7 @@ nsWinGesture::ProcessPanMessage(HWND hWnd, WPARAM wParam, LPARAM lParam) case GID_BEGIN: case GID_END: // These should always fall through to DefWndProc - return PR_FALSE; + return false; break; // Setup pixel scroll events for both axis @@ -470,8 +470,8 @@ nsWinGesture::ProcessPanMessage(HWND hWnd, WPARAM wParam, LPARAM lParam) if (gi.dwFlags & GF_BEGIN) { mPanIntermediate = coord; mPixelScrollDelta = 0; - mPanActive = PR_TRUE; - mPanInertiaActive = PR_FALSE; + mPanActive = true; + mPanInertiaActive = false; } else { @@ -488,25 +488,25 @@ nsWinGesture::ProcessPanMessage(HWND hWnd, WPARAM wParam, LPARAM lParam) mPanIntermediate = coord; if (gi.dwFlags & GF_INERTIA) - mPanInertiaActive = PR_TRUE; + mPanInertiaActive = true; if (gi.dwFlags & GF_END) { - mPanActive = PR_FALSE; - mPanInertiaActive = PR_FALSE; - PanFeedbackFinalize(hWnd, PR_TRUE); + mPanActive = false; + mPanInertiaActive = false; + PanFeedbackFinalize(hWnd, true); } } } break; } - return PR_TRUE; + return true; } inline bool TestTransition(PRInt32 a, PRInt32 b) { // If a is zero, overflow is zero, implying the cursor has moved back to the start position. // If b is zero, cached overscroll is zero, implying feedback just begun. - if (a == 0 || b == 0) return PR_TRUE; + if (a == 0 || b == 0) return true; // Test for different signs. return (a < 0) == (b < 0); } @@ -519,10 +519,10 @@ nsWinGesture::UpdatePanFeedbackX(HWND hWnd, PRInt32 scrollOverflow, bool& endFee if (scrollOverflow != 0) { if (!mFeedbackActive) { BeginPanningFeedback(hWnd); - mFeedbackActive = PR_TRUE; + mFeedbackActive = true; } - endFeedback = PR_FALSE; - mXAxisFeedback = PR_TRUE; + endFeedback = false; + mXAxisFeedback = true; return; } @@ -536,7 +536,7 @@ nsWinGesture::UpdatePanFeedbackX(HWND hWnd, PRInt32 scrollOverflow, bool& endFee // Cache the total over scroll in pixels. mPixelScrollOverflow.x = newOverflow; - endFeedback = PR_FALSE; + endFeedback = false; } } @@ -548,10 +548,10 @@ nsWinGesture::UpdatePanFeedbackY(HWND hWnd, PRInt32 scrollOverflow, bool& endFee if (scrollOverflow != 0) { if (!mFeedbackActive) { BeginPanningFeedback(hWnd); - mFeedbackActive = PR_TRUE; + mFeedbackActive = true; } - endFeedback = PR_FALSE; - mYAxisFeedback = PR_TRUE; + endFeedback = false; + mYAxisFeedback = true; return; } @@ -565,7 +565,7 @@ nsWinGesture::UpdatePanFeedbackY(HWND hWnd, PRInt32 scrollOverflow, bool& endFee // Cache the total over scroll in pixels. mPixelScrollOverflow.y = newOverflow; - endFeedback = PR_FALSE; + endFeedback = false; } } @@ -576,9 +576,9 @@ nsWinGesture::PanFeedbackFinalize(HWND hWnd, bool endFeedback) return; if (endFeedback) { - mFeedbackActive = PR_FALSE; - mXAxisFeedback = PR_FALSE; - mYAxisFeedback = PR_FALSE; + mFeedbackActive = false; + mXAxisFeedback = false; + mYAxisFeedback = false; mPixelScrollOverflow = 0; EndPanningFeedback(hWnd); return; @@ -597,7 +597,7 @@ nsWinGesture::PanDeltaToPixelScrollX(nsMouseScrollEvent& evt) // panning back from a max feedback position. This keeps the original drag point // constant. if (mXAxisFeedback) - return PR_FALSE; + return false; if (mPixelScrollDelta.x != 0) { @@ -608,9 +608,9 @@ nsWinGesture::PanDeltaToPixelScrollX(nsMouseScrollEvent& evt) evt.delta = mPixelScrollDelta.x; evt.refPoint.x = mPanRefPoint.x; evt.refPoint.y = mPanRefPoint.y; - return PR_TRUE; + return true; } - return PR_FALSE; + return false; } bool @@ -623,7 +623,7 @@ nsWinGesture::PanDeltaToPixelScrollY(nsMouseScrollEvent& evt) // panning back from a max feedback position. This keeps the original drag point // constant. if (mYAxisFeedback) - return PR_FALSE; + return false; if (mPixelScrollDelta.y != 0) { @@ -634,7 +634,7 @@ nsWinGesture::PanDeltaToPixelScrollY(nsMouseScrollEvent& evt) evt.delta = mPixelScrollDelta.y; evt.refPoint.x = mPanRefPoint.x; evt.refPoint.y = mPanRefPoint.y; - return PR_TRUE; + return true; } - return PR_FALSE; + return false; } diff --git a/widget/src/windows/nsWindow.cpp b/widget/src/windows/nsWindow.cpp index 3ca707f9ffc2..a4c5a03deb80 100644 --- a/widget/src/windows/nsWindow.cpp +++ b/widget/src/windows/nsWindow.cpp @@ -367,16 +367,16 @@ nsWindow::nsWindow() : nsBaseWidget() mPaintDC = nsnull; mPrevWndProc = nsnull; mNativeDragTarget = nsnull; - mInDtor = PR_FALSE; - mIsVisible = PR_FALSE; - mIsTopWidgetWindow = PR_FALSE; - mUnicodeWidget = PR_TRUE; - mDisplayPanFeedback = PR_FALSE; - mTouchWindow = PR_FALSE; - mCustomNonClient = PR_FALSE; - mHideChrome = PR_FALSE; - mFullscreenMode = PR_FALSE; - mMousePresent = PR_FALSE; + mInDtor = false; + mIsVisible = false; + mIsTopWidgetWindow = false; + mUnicodeWidget = true; + mDisplayPanFeedback = false; + mTouchWindow = false; + mCustomNonClient = false; + mHideChrome = false; + mFullscreenMode = false; + mMousePresent = false; mWindowType = eWindowType_child; mBorderStyle = eBorderStyle_default; mPopupType = ePopupTypeAny; @@ -406,7 +406,7 @@ nsWindow::nsWindow() : nsBaseWidget() #if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_WIN7 mTaskbarPreview = nsnull; - mHasTaskbarIconBeenCreated = PR_FALSE; + mHasTaskbarIconBeenCreated = false; #endif // Global initialization @@ -441,7 +441,7 @@ nsWindow::nsWindow() : nsBaseWidget() nsWindow::~nsWindow() { - mInDtor = PR_TRUE; + mInDtor = true; // If the widget was released without calling Destroy() then the native window still // exists, and we need to destroy it. This will also result in a call to OnDestroy. @@ -702,7 +702,7 @@ NS_METHOD nsWindow::Destroy() // Our windows can be subclassed which may prevent us receiving WM_DESTROY. If OnDestroy() // didn't get called, call it now. - if (PR_FALSE == mOnDestroyCalled) { + if (false == mOnDestroyCalled) { LRESULT result; mWindowHook.Notify(mWnd, WM_DESTROY, 0, 0, &result); OnDestroy(); @@ -1031,7 +1031,7 @@ nsWindow::ReparentNativeWidget(nsIWidget* aNewParent) nsIWidget* nsWindow::GetParent(void) { - return GetParentWindow(PR_FALSE); + return GetParentWindow(false); } float nsWindow::GetDPI() @@ -1143,12 +1143,12 @@ NS_METHOD nsWindow::Show(bool bState) { if (sDropShadowEnabled) { ::SetClassLongA(mWnd, GCL_STYLE, 0); - sDropShadowEnabled = PR_FALSE; + sDropShadowEnabled = false; } } else { if (!sDropShadowEnabled) { ::SetClassLongA(mWnd, GCL_STYLE, CS_DROPSHADOW); - sDropShadowEnabled = PR_TRUE; + sDropShadowEnabled = true; } } } @@ -1188,7 +1188,7 @@ NS_METHOD nsWindow::Show(bool bState) if (!wasVisible && mWindowType == eWindowType_toplevel) { // speed up the initial paint after show for // top level windows: - syncInvalidate = PR_TRUE; + syncInvalidate = true; switch (mSizeMode) { case nsSizeMode_Fullscreen: ::ShowWindow(mWnd, SW_SHOW); @@ -1267,7 +1267,7 @@ NS_METHOD nsWindow::Show(bool bState) * **************************************************************/ -// Return PR_TRUE if the whether the component is visible, PR_FALSE otherwise +// Return true if the whether the component is visible, false otherwise NS_METHOD nsWindow::IsVisible(bool & bState) { bState = mIsVisible; @@ -1327,14 +1327,14 @@ void nsWindow::SetThemeRegion() **************************************************************/ NS_METHOD nsWindow::RegisterTouchWindow() { - mTouchWindow = PR_TRUE; + mTouchWindow = true; mGesture.RegisterTouchWindow(mWnd); ::EnumChildWindows(mWnd, nsWindow::RegisterTouchForDescendants, 0); return NS_OK; } NS_METHOD nsWindow::UnregisterTouchWindow() { - mTouchWindow = PR_FALSE; + mTouchWindow = false; mGesture.UnregisterTouchWindow(mWnd); ::EnumChildWindows(mWnd, nsWindow::UnregisterTouchForDescendants, 0); return NS_OK; @@ -1459,7 +1459,7 @@ NS_METHOD nsWindow::Resize(PRInt32 aWidth, PRInt32 aHeight, bool aRepaint) } if (aRepaint) - Invalidate(PR_FALSE); + Invalidate(false); return NS_OK; } @@ -1498,7 +1498,7 @@ NS_METHOD nsWindow::Resize(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeig } if (aRepaint) - Invalidate(PR_FALSE); + Invalidate(false); return NS_OK; } @@ -1572,10 +1572,10 @@ nsWindow::BeginResizeDrag(nsGUIEvent* aEvent, PRInt32 aHorizontal, PRInt32 aVert } // resizing doesn't work if the mouse is already captured - CaptureMouse(PR_FALSE); + CaptureMouse(false); // find the top-level window - HWND toplevelWnd = GetTopLevelHWND(mWnd, PR_TRUE); + HWND toplevelWnd = GetTopLevelHWND(mWnd, true); // tell Windows to start the resize ::PostMessage(toplevelWnd, WM_SYSCOMMAND, syscommand, @@ -1716,7 +1716,7 @@ NS_METHOD nsWindow::ConstrainPosition(bool aAllowSlop, screenRect.right = left+width; screenRect.top = top; screenRect.bottom = top+height; - doConstrain = PR_TRUE; + doConstrain = true; } } else { if (mWnd) { @@ -1730,7 +1730,7 @@ NS_METHOD nsWindow::ConstrainPosition(bool aAllowSlop, screenRect.right = GetSystemMetrics(SM_CXFULLSCREEN); screenRect.bottom = GetSystemMetrics(SM_CYFULLSCREEN); } - doConstrain = PR_TRUE; + doConstrain = true; } ::ReleaseDC(mWnd, dc); } @@ -1956,7 +1956,7 @@ nsIntPoint nsWindow::GetClientOffset() void nsWindow::SetDrawsInTitlebar(bool aState) { - nsWindow * window = GetTopLevelWindow(PR_TRUE); + nsWindow * window = GetTopLevelWindow(true); if (window && window != this) { return window->SetDrawsInTitlebar(aState); } @@ -1975,7 +1975,7 @@ nsWindow::SetDrawsInTitlebar(bool aState) NS_IMETHODIMP nsWindow::GetNonClientMargins(nsIntMargin &margins) { - nsWindow * window = GetTopLevelWindow(PR_TRUE); + nsWindow * window = GetTopLevelWindow(true); if (window && window != this) { return window->GetNonClientMargins(margins); } @@ -2013,7 +2013,7 @@ nsWindow::ResetLayout() OnResize(evRect); // Invalidate and update - Invalidate(PR_FALSE); + Invalidate(false); } // Internally track the caption status via a window property. Required @@ -2068,7 +2068,7 @@ bool nsWindow::UpdateNonClientMargins(PRInt32 aSizeMode, bool aReflowWindow) { if (!mCustomNonClient) - return PR_FALSE; + return false; mNonClientOffset.top = mNonClientOffset.bottom = mNonClientOffset.left = mNonClientOffset.right = 0; @@ -2079,7 +2079,7 @@ nsWindow::UpdateNonClientMargins(PRInt32 aSizeMode, bool aReflowWindow) if (aSizeMode == nsSizeMode_Minimized || aSizeMode == nsSizeMode_Fullscreen) { mCaptionHeight = mVertResizeMargin = mHorResizeMargin = 0; - return PR_TRUE; + return true; } // Note, for maximized windows, we need to continue to offset the client by @@ -2144,7 +2144,7 @@ nsWindow::UpdateNonClientMargins(PRInt32 aSizeMode, bool aReflowWindow) ResetLayout(); } - return PR_TRUE; + return true; } NS_IMETHODIMP @@ -2158,7 +2158,7 @@ nsWindow::SetNonClientMargins(nsIntMargin &margins) // Request for a reset if (margins.top == -1 && margins.left == -1 && margins.right == -1 && margins.bottom == -1) { - mCustomNonClient = PR_FALSE; + mCustomNonClient = false; mNonClientMargins = margins; RemovePropW(mWnd, kManageWindowInfoProperty); // Force a reflow of content based on the new client @@ -2172,10 +2172,10 @@ nsWindow::SetNonClientMargins(nsIntMargin &margins) return NS_ERROR_INVALID_ARG; mNonClientMargins = margins; - mCustomNonClient = PR_TRUE; + mCustomNonClient = true; if (!UpdateNonClientMargins()) { NS_WARNING("UpdateNonClientMargins failed!"); - return PR_FALSE; + return false; } return NS_OK; @@ -2455,7 +2455,7 @@ NS_IMETHODIMP nsWindow::SetCursor(imgIContainer* aCursor, HCURSOR cursor; // No scaling gfxIntSize size(0, 0); - rv = nsWindowGfx::CreateIcon(aCursor, PR_TRUE, aHotspotX, aHotspotY, size, &cursor); + rv = nsWindowGfx::CreateIcon(aCursor, true, aHotspotX, aHotspotY, size, &cursor); NS_ENSURE_SUCCESS(rv, rv); mCursor = nsCursor(-1); @@ -2484,12 +2484,12 @@ NS_IMETHODIMP nsWindow::SetCursor(imgIContainer* aCursor, #ifdef MOZ_XUL nsTransparencyMode nsWindow::GetTransparencyMode() { - return GetTopLevelWindow(PR_TRUE)->GetWindowTranslucencyInner(); + return GetTopLevelWindow(true)->GetWindowTranslucencyInner(); } void nsWindow::SetTransparencyMode(nsTransparencyMode aMode) { - GetTopLevelWindow(PR_TRUE)->SetWindowTranslucencyInner(aMode); + GetTopLevelWindow(true)->SetWindowTranslucencyInner(aMode); } static const nsIntRegion @@ -2600,7 +2600,7 @@ void nsWindow::UpdateGlass() NS_IMETHODIMP nsWindow::HideWindowChrome(bool aShouldHide) { - HWND hwnd = GetTopLevelHWND(mWnd, PR_TRUE); + HWND hwnd = GetTopLevelHWND(mWnd, true); if (!GetNSWindowPtr(hwnd)) { NS_WARNING("Trying to hide window decorations in an embedded context"); @@ -2727,7 +2727,7 @@ nsWindow::MakeFullScreen(bool aFullScreen) bool visible = mIsVisible; if (mOldSizeMode == nsSizeMode_Normal) - Show(PR_FALSE); + Show(false); // Will call hide chrome, reposition window. Note this will // also cache dimensions for restoration, so it should only @@ -2735,8 +2735,8 @@ nsWindow::MakeFullScreen(bool aFullScreen) nsresult rv = nsBaseWidget::MakeFullScreen(aFullScreen); if (visible) { - Show(PR_TRUE); - Invalidate(PR_FALSE); + Show(true); + Invalidate(false); } // Notify the taskbar that we have exited full screen mode. @@ -2745,7 +2745,7 @@ nsWindow::MakeFullScreen(bool aFullScreen) } // Let the dom know via web shell window - nsSizeModeEvent event(PR_TRUE, NS_SIZEMODE, this); + nsSizeModeEvent event(true, NS_SIZEMODE, this); event.mSizeMode = mSizeMode; InitEvent(event); DispatchWindowEvent(&event); @@ -2965,7 +2965,7 @@ nsIntSize nsWindow::ClientToWindowSize(const nsIntSize& aClientSize) r.top = 200; r.right = 200 + aClientSize.width; r.bottom = 200 + aClientSize.height; - ::AdjustWindowRectEx(&r, WindowStyle(), PR_FALSE, WindowExStyle()); + ::AdjustWindowRectEx(&r, WindowStyle(), false, WindowExStyle()); return nsIntSize(r.right - r.left, r.bottom - r.top); } @@ -3065,12 +3065,12 @@ NS_IMETHODIMP nsWindow::CaptureRollupEvents(nsIRollupListener * aListener, if (!sMsgFilterHook && !sCallProcHook && !sCallMouseHook) { RegisterSpecialDropdownHooks(); } - sProcessHook = PR_TRUE; + sProcessHook = true; } else { sRollupListener = nsnull; NS_IF_RELEASE(sMenuRollup); NS_IF_RELEASE(sRollupWidget); - sProcessHook = PR_FALSE; + sProcessHook = false; UnregisterSpecialDropdownHooks(); } @@ -3148,11 +3148,11 @@ nsWindow::HasPendingInputEvent() // a separate event loop and input events are not // reported to the application. if (HIWORD(GetQueueStatus(QS_INPUT))) - return PR_TRUE; + return true; GUITHREADINFO guiInfo; guiInfo.cbSize = sizeof(GUITHREADINFO); if (!GetGUIThreadInfo(GetCurrentThreadId(), &guiInfo)) - return PR_FALSE; + return false; return GUI_INMOVESIZE == (guiInfo.flags & GUI_INMOVESIZE); } @@ -3166,10 +3166,10 @@ nsWindow::HasPendingInputEvent() struct LayerManagerPrefs { LayerManagerPrefs() - : mAccelerateByDefault(PR_TRUE) - , mDisableAcceleration(PR_FALSE) - , mPreferOpenGL(PR_FALSE) - , mPreferD3D9(PR_FALSE) + : mAccelerateByDefault(true) + , mDisableAcceleration(false) + , mPreferOpenGL(false) + , mPreferD3D9(false) {} bool mAccelerateByDefault; bool mDisableAcceleration; @@ -3244,9 +3244,9 @@ nsWindow::GetLayerManager(PLayersChild* aShadowManager, * want to support this case. See bug #593471 */ if (eTransparencyTransparent == mTransparencyMode || prefs.mDisableAcceleration) - mUseAcceleratedRendering = PR_FALSE; + mUseAcceleratedRendering = false; else if (prefs.mAccelerateByDefault) - mUseAcceleratedRendering = PR_TRUE; + mUseAcceleratedRendering = true; if (mUseAcceleratedRendering) { if (aPersistence == LAYER_MANAGER_PERSISTENT && !sAllowD3D9) { @@ -3299,6 +3299,8 @@ nsWindow::GetLayerManager(PLayersChild* aShadowManager, mLayerManager = CreateBasicLayerManager(); } + NS_ASSERTION(mLayerManager, "Couldn't provide a valid layer manager."); + return mLayerManager; } @@ -3359,7 +3361,7 @@ nsWindow::OnDefaultButtonLoaded(const nsIntRect &aButtonRect) // Don't snap when we are not active. HWND activeWnd = ::GetActiveWindow(); if (activeWnd != ::GetForegroundWindow() || - GetTopLevelHWND(mWnd, PR_TRUE) != GetTopLevelHWND(activeWnd, PR_TRUE)) { + GetTopLevelHWND(mWnd, true) != GetTopLevelHWND(activeWnd, true)) { return NS_OK; } @@ -3592,7 +3594,7 @@ NS_IMETHODIMP nsWindow::DispatchEvent(nsGUIEvent* event, nsEventStatus & aStatus bool nsWindow::DispatchStandardEvent(PRUint32 aMsg) { - nsGUIEvent event(PR_TRUE, aMsg, this); + nsGUIEvent event(true, aMsg, this); InitEvent(event); bool result = DispatchWindowEvent(&event); @@ -3619,7 +3621,7 @@ bool nsWindow::DispatchKeyEvent(PRUint32 aEventType, WORD aCharCode, { UserActivity(); - nsKeyEvent event(PR_TRUE, aEventType, this); + nsKeyEvent event(true, aEventType, this); nsIntPoint point(0, 0); InitEvent(event, &point); // this add ref's event.widget @@ -3657,7 +3659,7 @@ bool nsWindow::DispatchKeyEvent(PRUint32 aEventType, WORD aCharCode, event.isShift = aModKeyState.mIsShiftDown; event.isControl = aModKeyState.mIsControlDown; - event.isMeta = PR_FALSE; + event.isMeta = false; event.isAlt = aModKeyState.mIsAltDown; NPEvent pluginEvent; @@ -3699,14 +3701,14 @@ bool nsWindow::DispatchCommandEvent(PRUint32 aEventCommand) command = nsWidgetAtoms::Home; break; default: - return PR_FALSE; + return false; } - nsCommandEvent event(PR_TRUE, nsWidgetAtoms::onAppCommand, command, this); + nsCommandEvent event(true, nsWidgetAtoms::onAppCommand, command, this); InitEvent(event); DispatchWindowEvent(&event); - return PR_TRUE; + return true; } // Recursively dispatch synchronous paints for nsIWidget @@ -3765,9 +3767,9 @@ void nsWindow::DispatchPendingEvents() bool nsWindow::DispatchPluginEvent(const MSG &aMsg) { if (!PluginHasFocus()) - return PR_FALSE; + return false; - nsPluginEvent event(PR_TRUE, NS_PLUGIN_INPUT_EVENT, this); + nsPluginEvent event(true, NS_PLUGIN_INPUT_EVENT, this); nsIntPoint point(0, 0); InitEvent(event, &point); NPEvent pluginEvent; @@ -3775,7 +3777,7 @@ bool nsWindow::DispatchPluginEvent(const MSG &aMsg) pluginEvent.wParam = aMsg.wParam; pluginEvent.lParam = aMsg.lParam; event.pluginEvent = (void *)&pluginEvent; - event.retargetToFocusedDocument = PR_TRUE; + event.retargetToFocusedDocument = true; return DispatchWindowEvent(&event); } @@ -3821,7 +3823,7 @@ bool nsWindow::DispatchMouseEvent(PRUint32 aEventType, WPARAM wParam, switch (aEventType) { case NS_MOUSE_BUTTON_DOWN: - CaptureMouse(PR_TRUE); + CaptureMouse(true); break; // NS_MOUSE_MOVE and NS_MOUSE_EXIT are here because we need to make sure capture flag @@ -3830,7 +3832,7 @@ bool nsWindow::DispatchMouseEvent(PRUint32 aEventType, WPARAM wParam, case NS_MOUSE_MOVE: case NS_MOUSE_EXIT: if (!(wParam & (MK_LBUTTON | MK_MBUTTON | MK_RBUTTON)) && sIsInMouseCapture) - CaptureMouse(PR_FALSE); + CaptureMouse(false); break; default: @@ -3842,7 +3844,7 @@ bool nsWindow::DispatchMouseEvent(PRUint32 aEventType, WPARAM wParam, eventPoint.x = GET_X_LPARAM(lParam); eventPoint.y = GET_Y_LPARAM(lParam); - nsMouseEvent event(PR_TRUE, aEventType, this, nsMouseEvent::eReal, + nsMouseEvent event(true, aEventType, this, nsMouseEvent::eReal, aIsContextMenuKey ? nsMouseEvent::eContextMenuKey : nsMouseEvent::eNormal); @@ -3855,7 +3857,7 @@ bool nsWindow::DispatchMouseEvent(PRUint32 aEventType, WPARAM wParam, event.isShift = IS_VK_DOWN(NS_VK_SHIFT); event.isControl = IS_VK_DOWN(NS_VK_CONTROL); - event.isMeta = PR_FALSE; + event.isMeta = false; event.isAlt = IS_VK_DOWN(NS_VK_ALT); event.button = aButton; event.inputSource = aInputSource; @@ -4016,13 +4018,13 @@ bool nsWindow::DispatchMouseEvent(PRUint32 aEventType, WPARAM wParam, if (sCurrentWindow == NULL || sCurrentWindow != this) { if ((nsnull != sCurrentWindow) && (!sCurrentWindow->mInDtor)) { LPARAM pos = sCurrentWindow->lParamToClient(lParamToScreen(lParam)); - sCurrentWindow->DispatchMouseEvent(NS_MOUSE_EXIT, wParam, pos, PR_FALSE, + sCurrentWindow->DispatchMouseEvent(NS_MOUSE_EXIT, wParam, pos, false, nsMouseEvent::eLeftButton, aInputSource); } sCurrentWindow = this; if (!mInDtor) { LPARAM pos = sCurrentWindow->lParamToClient(lParamToScreen(lParam)); - sCurrentWindow->DispatchMouseEvent(NS_MOUSE_ENTER, wParam, pos, PR_FALSE, + sCurrentWindow->DispatchMouseEvent(NS_MOUSE_ENTER, wParam, pos, false, nsMouseEvent::eLeftButton, aInputSource); } } @@ -4056,12 +4058,12 @@ nsWindow::DispatchAccessibleEvent(PRUint32 aEventType) return nsnull; } - nsAccessibleEvent event(PR_TRUE, aEventType, this); + nsAccessibleEvent event(true, aEventType, this); InitEvent(event, nsnull); event.isShift = IS_VK_DOWN(NS_VK_SHIFT); event.isControl = IS_VK_DOWN(NS_VK_CONTROL); - event.isMeta = PR_FALSE; + event.isMeta = false; event.isAlt = IS_VK_DOWN(NS_VK_ALT); DispatchWindowEvent(&event); @@ -4073,8 +4075,8 @@ nsWindow::DispatchAccessibleEvent(PRUint32 aEventType) bool nsWindow::DispatchFocusToTopLevelWindow(PRUint32 aEventType) { if (aEventType == NS_ACTIVATE) - sJustGotActivate = PR_FALSE; - sJustGotDeactivate = PR_FALSE; + sJustGotActivate = false; + sJustGotDeactivate = false; // retrive the toplevel window or dialog HWND curWnd = mWnd; @@ -4099,7 +4101,7 @@ bool nsWindow::DispatchFocusToTopLevelWindow(PRUint32 aEventType) return win->DispatchFocus(aEventType); } - return PR_FALSE; + return false; } // Deal with focus messages @@ -4107,7 +4109,7 @@ bool nsWindow::DispatchFocus(PRUint32 aEventType) { // call the event callback if (mEventCallback) { - nsGUIEvent event(PR_TRUE, aEventType, this); + nsGUIEvent event(true, aEventType, this); InitEvent(event); //focus and blur event should go to their base widget loc, not current mouse pos @@ -4135,7 +4137,7 @@ bool nsWindow::DispatchFocus(PRUint32 aEventType) return DispatchWindowEvent(&event); } - return PR_FALSE; + return false; } bool nsWindow::IsTopLevelMouseExit(HWND aWnd) @@ -4151,7 +4153,7 @@ bool nsWindow::IsTopLevelMouseExit(HWND aWnd) // we should treat it as a top-level exit. HWND mouseTopLevel = nsWindow::GetTopLevelHWND(mouseWnd); if (mouseWnd == mouseTopLevel) - return PR_TRUE; + return true; return nsWindow::GetTopLevelHWND(aWnd) != mouseTopLevel; } @@ -4160,7 +4162,7 @@ bool nsWindow::BlurEventsSuppressed() { // are they suppressed in this window? if (mBlurSuppressLevel > 0) - return PR_TRUE; + return true; // are they suppressed by any container widget? HWND parentWnd = ::GetParent(mWnd); @@ -4169,7 +4171,7 @@ bool nsWindow::BlurEventsSuppressed() if (parent) return parent->BlurEventsSuppressed(); } - return PR_FALSE; + return false; } // In some circumstances (opening dependent windows) it makes more sense @@ -4279,7 +4281,7 @@ nsWindow::IPCWindowProcHandler(UINT& msg, WPARAM& wParam, LPARAM& lParam) break; } } - handled = PR_TRUE; + handled = true; } break; // Plugins taking or losing focus triggering focus app messages. @@ -4293,7 +4295,7 @@ nsWindow::IPCWindowProcHandler(UINT& msg, WPARAM& wParam, LPARAM& lParam) case WM_CONTEXTMENU: // IME events fired as a result of synchronous focus changes case WM_IME_SETCONTEXT: - handled = PR_TRUE; + handled = true; break; } @@ -4366,10 +4368,10 @@ DisplaySystemMenu(HWND hWnd, nsSizeMode sizeMode, bool isRtl, PRInt32 x, PRInt32 x, y, 0, hWnd, NULL); if (cmd) { PostMessage(hWnd, WM_SYSCOMMAND, cmd, 0); - return PR_TRUE; + return true; } } - return PR_FALSE; + return false; } // The WndProc procedure for all nsWindows in this toolkit. This merely catches @@ -4435,7 +4437,7 @@ LRESULT CALLBACK nsWindow::WindowProcInternal(HWND hWnd, UINT msg, WPARAM wParam // Call ProcessMessage LRESULT retValue; - if (PR_TRUE == someWindow->ProcessMessage(msg, wParam, lParam, &retValue)) { + if (true == someWindow->ProcessMessage(msg, wParam, lParam, &retValue)) { return retValue; } @@ -4457,7 +4459,7 @@ nsWindow::ProcessMessageForPlugin(const MSG &aMsg, NS_PRECONDITION(aResult, "aResult must be non-null."); *aResult = 0; - aCallDefWndProc = PR_FALSE; + aCallDefWndProc = false; bool eventDispatched = false; switch (aMsg.message) { case WM_CHAR: @@ -4486,13 +4488,13 @@ nsWindow::ProcessMessageForPlugin(const MSG &aMsg, break; default: - return PR_FALSE; + return false; } if (!eventDispatched) aCallDefWndProc = !DispatchPluginEvent(aMsg); DispatchPendingEvents(); - return PR_TRUE; + return true; } static void ForceFontUpdate() @@ -4514,14 +4516,14 @@ static bool CleartypeSettingChanged() BYTE quality = cairo_win32_get_system_text_quality(); if (currentQuality == quality) - return PR_FALSE; + return false; if (currentQuality < 0) { currentQuality = quality; - return PR_FALSE; + return false; } currentQuality = quality; - return PR_TRUE; + return true; } // The main windows message processing method. @@ -4548,7 +4550,7 @@ bool nsWindow::ProcessMessage(UINT msg, WPARAM &wParam, LPARAM &lParam, // (Large blocks of code should be broken out into OnEvent handlers.) if (mWindowHook.Notify(mWnd, msg, wParam, lParam, aRetValue)) - return PR_TRUE; + return true; #if defined(EVENT_DEBUG_OUTPUT) // First param shows all events, second param indicates whether @@ -4559,14 +4561,14 @@ bool nsWindow::ProcessMessage(UINT msg, WPARAM &wParam, LPARAM &lParam, bool eatMessage; if (nsIMM32Handler::ProcessMessage(this, msg, wParam, lParam, aRetValue, eatMessage)) { - return mWnd ? eatMessage : PR_TRUE; + return mWnd ? eatMessage : true; } if (PluginHasFocus()) { bool callDefaultWndProc; MSG nativeMsg = InitMSG(msg, wParam, lParam); if (ProcessMessageForPlugin(nativeMsg, aRetValue, callDefaultWndProc)) { - return mWnd ? !callDefaultWndProc : PR_TRUE; + return mWnd ? !callDefaultWndProc : true; } } @@ -4580,7 +4582,7 @@ bool nsWindow::ProcessMessage(UINT msg, WPARAM &wParam, LPARAM &lParam, nsUXThemeData::CheckForCompositor() && nsUXThemeData::dwmDwmDefWindowProcPtr(mWnd, msg, wParam, lParam, &dwmHitResult)) { *aRetValue = dwmHitResult; - return PR_TRUE; + return true; } #endif // MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN @@ -4596,7 +4598,7 @@ bool nsWindow::ProcessMessage(UINT msg, WPARAM &wParam, LPARAM &lParam, mozilla::services::GetObserverService(); nsCOMPtr cancelQuit = do_CreateInstance(NS_SUPPORTS_PRBOOL_CONTRACTID); - cancelQuit->SetData(PR_FALSE); + cancelQuit->SetData(false); obsServ->NotifyObservers(cancelQuit, "quit-application-requested", nsnull); bool abortQuit; @@ -4604,7 +4606,7 @@ bool nsWindow::ProcessMessage(UINT msg, WPARAM &wParam, LPARAM &lParam, sCanQuit = abortQuit ? TRI_FALSE : TRI_TRUE; } *aRetValue = sCanQuit ? TRUE : FALSE; - result = PR_TRUE; + result = true; break; case WM_ENDSESSION: @@ -4628,7 +4630,7 @@ bool nsWindow::ProcessMessage(UINT msg, WPARAM &wParam, LPARAM &lParam, _exit(0); } sCanQuit = TRI_UNKNOWN; - result = PR_TRUE; + result = true; break; case WM_DISPLAYCHANGE: @@ -4653,7 +4655,7 @@ bool nsWindow::ProcessMessage(UINT msg, WPARAM &wParam, LPARAM &lParam, case TCN_SELCHANGE: { DispatchStandardEvent(NS_TABCHANGE); - result = PR_TRUE; + result = true; } break; } @@ -4671,7 +4673,7 @@ bool nsWindow::ProcessMessage(UINT msg, WPARAM &wParam, LPARAM &lParam, // Invalidate the window so that the repaint will // pick up the new theme. - Invalidate(PR_FALSE); + Invalidate(false); } break; @@ -4701,7 +4703,7 @@ bool nsWindow::ProcessMessage(UINT msg, WPARAM &wParam, LPARAM &lParam, // return zero. if (mCustomNonClient) { if (!wParam) { - result = PR_TRUE; + result = true; *aRetValue = 0; break; } @@ -4723,7 +4725,7 @@ bool nsWindow::ProcessMessage(UINT msg, WPARAM &wParam, LPARAM &lParam, pncsp->rgrc[0].right += mNonClientOffset.right; pncsp->rgrc[0].bottom += mNonClientOffset.bottom; - result = PR_TRUE; + result = true; *aRetValue = res; } break; @@ -4744,7 +4746,7 @@ bool nsWindow::ProcessMessage(UINT msg, WPARAM &wParam, LPARAM &lParam, *aRetValue = ClientMarginHitTestPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)); - result = PR_TRUE; + result = true; break; } @@ -4766,7 +4768,7 @@ bool nsWindow::ProcessMessage(UINT msg, WPARAM &wParam, LPARAM &lParam, *aRetValue = CallWindowProcW(GetPrevWindowProc(), mWnd, msg, wParam, lParam); SetWindowLong(mWnd, GWL_STYLE, style); - return PR_TRUE; + return true; } case WM_NCACTIVATE: @@ -4788,16 +4790,16 @@ bool nsWindow::ProcessMessage(UINT msg, WPARAM &wParam, LPARAM &lParam, if (wParam == TRUE) { // going active *aRetValue = FALSE; // ignored - result = PR_TRUE; - UpdateGetWindowInfoCaptionStatus(PR_TRUE); + result = true; + UpdateGetWindowInfoCaptionStatus(true); // invalidate to trigger a paint InvalidateNonClientRegion(); break; } else { // going inactive *aRetValue = TRUE; // go ahead and deactive - result = PR_TRUE; - UpdateGetWindowInfoCaptionStatus(PR_FALSE); + result = true; + UpdateGetWindowInfoCaptionStatus(false); // invalidate to trigger a paint InvalidateNonClientRegion(); break; @@ -4827,7 +4829,7 @@ bool nsWindow::ProcessMessage(UINT msg, WPARAM &wParam, LPARAM &lParam, if (paintRgn != (HRGN)wParam) DeleteObject(paintRgn); *aRetValue = res; - result = PR_TRUE; + result = true; } break; @@ -4859,13 +4861,13 @@ bool nsWindow::ProcessMessage(UINT msg, WPARAM &wParam, LPARAM &lParam, case WM_CLOSE: // close request DispatchStandardEvent(NS_XUL_CLOSE); - result = PR_TRUE; // abort window closure + result = true; // abort window closure break; case WM_DESTROY: // clean up. OnDestroy(); - result = PR_TRUE; + result = true; break; case WM_PAINT: @@ -4877,7 +4879,7 @@ bool nsWindow::ProcessMessage(UINT msg, WPARAM &wParam, LPARAM &lParam, } } *aRetValue = (int) OnPaint(NULL, 0); - result = PR_TRUE; + result = true; break; case WM_PRINTCLIENT: @@ -4921,13 +4923,13 @@ bool nsWindow::ProcessMessage(UINT msg, WPARAM &wParam, LPARAM &lParam, case WM_ERASEBKGND: if (!AutoErase((HDC)wParam)) { *aRetValue = 1; - result = PR_TRUE; + result = true; } break; case WM_MOUSEMOVE: { - mMousePresent = PR_TRUE; + mMousePresent = true; // Suppress dispatch of pending events // when mouse moves are generated by widget @@ -4938,11 +4940,11 @@ bool nsWindow::ProcessMessage(UINT msg, WPARAM &wParam, LPARAM &lParam, mp.y = GET_Y_LPARAM(lParamScreen); bool userMovedMouse = false; if ((sLastMouseMovePoint.x != mp.x) || (sLastMouseMovePoint.y != mp.y)) { - userMovedMouse = PR_TRUE; + userMovedMouse = true; } result = DispatchMouseEvent(NS_MOUSE_MOVE, wParam, lParam, - PR_FALSE, nsMouseEvent::eLeftButton, MOUSE_INPUT_SOURCE()); + false, nsMouseEvent::eLeftButton, MOUSE_INPUT_SOURCE()); if (userMovedMouse) { DispatchPendingEvents(); } @@ -4959,7 +4961,7 @@ bool nsWindow::ProcessMessage(UINT msg, WPARAM &wParam, LPARAM &lParam, case WM_LBUTTONDOWN: { result = DispatchMouseEvent(NS_MOUSE_BUTTON_DOWN, wParam, lParam, - PR_FALSE, nsMouseEvent::eLeftButton, MOUSE_INPUT_SOURCE()); + false, nsMouseEvent::eLeftButton, MOUSE_INPUT_SOURCE()); DispatchPendingEvents(); } break; @@ -4967,7 +4969,7 @@ bool nsWindow::ProcessMessage(UINT msg, WPARAM &wParam, LPARAM &lParam, case WM_LBUTTONUP: { result = DispatchMouseEvent(NS_MOUSE_BUTTON_UP, wParam, lParam, - PR_FALSE, nsMouseEvent::eLeftButton, MOUSE_INPUT_SOURCE()); + false, nsMouseEvent::eLeftButton, MOUSE_INPUT_SOURCE()); DispatchPendingEvents(); } break; @@ -4976,7 +4978,7 @@ bool nsWindow::ProcessMessage(UINT msg, WPARAM &wParam, LPARAM &lParam, { if (!mMousePresent) break; - mMousePresent = PR_FALSE; + mMousePresent = false; // We need to check mouse button states and put them in for // wParam. @@ -4986,7 +4988,7 @@ bool nsWindow::ProcessMessage(UINT msg, WPARAM &wParam, LPARAM &lParam, // Synthesize an event position because we don't get one from // WM_MOUSELEAVE. LPARAM pos = lParamToClient(::GetMessagePos()); - DispatchMouseEvent(NS_MOUSE_EXIT, mouseState, pos, PR_FALSE, + DispatchMouseEvent(NS_MOUSE_EXIT, mouseState, pos, false, nsMouseEvent::eLeftButton, MOUSE_INPUT_SOURCE()); } break; @@ -4999,7 +5001,7 @@ bool nsWindow::ProcessMessage(UINT msg, WPARAM &wParam, LPARAM &lParam, bool contextMenukey = false; if (lParam == -1) { - contextMenukey = PR_TRUE; + contextMenukey = true; pos = lParamToClient(GetMessagePos()); } else @@ -5013,92 +5015,92 @@ bool nsWindow::ProcessMessage(UINT msg, WPARAM &wParam, LPARAM &lParam, nsMouseEvent::eRightButton, MOUSE_INPUT_SOURCE()); if (lParam != -1 && !result && mCustomNonClient && DispatchMouseEvent(NS_MOUSE_MOZHITTEST, wParam, pos, - PR_FALSE, nsMouseEvent::eLeftButton, + false, nsMouseEvent::eLeftButton, MOUSE_INPUT_SOURCE())) { // Blank area hit, throw up the system menu. DisplaySystemMenu(mWnd, mSizeMode, mIsRTL, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)); - result = PR_TRUE; + result = true; } } break; case WM_LBUTTONDBLCLK: - result = DispatchMouseEvent(NS_MOUSE_DOUBLECLICK, wParam, lParam, PR_FALSE, + result = DispatchMouseEvent(NS_MOUSE_DOUBLECLICK, wParam, lParam, false, nsMouseEvent::eLeftButton, MOUSE_INPUT_SOURCE()); DispatchPendingEvents(); break; case WM_MBUTTONDOWN: - result = DispatchMouseEvent(NS_MOUSE_BUTTON_DOWN, wParam, lParam, PR_FALSE, + result = DispatchMouseEvent(NS_MOUSE_BUTTON_DOWN, wParam, lParam, false, nsMouseEvent::eMiddleButton, MOUSE_INPUT_SOURCE()); DispatchPendingEvents(); break; case WM_MBUTTONUP: - result = DispatchMouseEvent(NS_MOUSE_BUTTON_UP, wParam, lParam, PR_FALSE, + result = DispatchMouseEvent(NS_MOUSE_BUTTON_UP, wParam, lParam, false, nsMouseEvent::eMiddleButton, MOUSE_INPUT_SOURCE()); DispatchPendingEvents(); break; case WM_MBUTTONDBLCLK: - result = DispatchMouseEvent(NS_MOUSE_DOUBLECLICK, wParam, lParam, PR_FALSE, + result = DispatchMouseEvent(NS_MOUSE_DOUBLECLICK, wParam, lParam, false, nsMouseEvent::eMiddleButton, MOUSE_INPUT_SOURCE()); DispatchPendingEvents(); break; case WM_NCMBUTTONDOWN: - result = DispatchMouseEvent(NS_MOUSE_BUTTON_DOWN, 0, lParamToClient(lParam), PR_FALSE, + result = DispatchMouseEvent(NS_MOUSE_BUTTON_DOWN, 0, lParamToClient(lParam), false, nsMouseEvent::eMiddleButton, MOUSE_INPUT_SOURCE()); DispatchPendingEvents(); break; case WM_NCMBUTTONUP: - result = DispatchMouseEvent(NS_MOUSE_BUTTON_UP, 0, lParamToClient(lParam), PR_FALSE, + result = DispatchMouseEvent(NS_MOUSE_BUTTON_UP, 0, lParamToClient(lParam), false, nsMouseEvent::eMiddleButton, MOUSE_INPUT_SOURCE()); DispatchPendingEvents(); break; case WM_NCMBUTTONDBLCLK: - result = DispatchMouseEvent(NS_MOUSE_DOUBLECLICK, 0, lParamToClient(lParam), PR_FALSE, + result = DispatchMouseEvent(NS_MOUSE_DOUBLECLICK, 0, lParamToClient(lParam), false, nsMouseEvent::eMiddleButton, MOUSE_INPUT_SOURCE()); DispatchPendingEvents(); break; case WM_RBUTTONDOWN: - result = DispatchMouseEvent(NS_MOUSE_BUTTON_DOWN, wParam, lParam, PR_FALSE, + result = DispatchMouseEvent(NS_MOUSE_BUTTON_DOWN, wParam, lParam, false, nsMouseEvent::eRightButton, MOUSE_INPUT_SOURCE()); DispatchPendingEvents(); break; case WM_RBUTTONUP: - result = DispatchMouseEvent(NS_MOUSE_BUTTON_UP, wParam, lParam, PR_FALSE, + result = DispatchMouseEvent(NS_MOUSE_BUTTON_UP, wParam, lParam, false, nsMouseEvent::eRightButton, MOUSE_INPUT_SOURCE()); DispatchPendingEvents(); break; case WM_RBUTTONDBLCLK: - result = DispatchMouseEvent(NS_MOUSE_DOUBLECLICK, wParam, lParam, PR_FALSE, + result = DispatchMouseEvent(NS_MOUSE_DOUBLECLICK, wParam, lParam, false, nsMouseEvent::eRightButton, MOUSE_INPUT_SOURCE()); DispatchPendingEvents(); break; case WM_NCRBUTTONDOWN: result = DispatchMouseEvent(NS_MOUSE_BUTTON_DOWN, 0, lParamToClient(lParam), - PR_FALSE, nsMouseEvent::eRightButton, + false, nsMouseEvent::eRightButton, MOUSE_INPUT_SOURCE()); DispatchPendingEvents(); break; case WM_NCRBUTTONUP: result = DispatchMouseEvent(NS_MOUSE_BUTTON_UP, 0, lParamToClient(lParam), - PR_FALSE, nsMouseEvent::eRightButton, + false, nsMouseEvent::eRightButton, MOUSE_INPUT_SOURCE()); DispatchPendingEvents(); break; case WM_NCRBUTTONDBLCLK: result = DispatchMouseEvent(NS_MOUSE_DOUBLECLICK, 0, lParamToClient(lParam), - PR_FALSE, nsMouseEvent::eRightButton, + false, nsMouseEvent::eRightButton, MOUSE_INPUT_SOURCE()); DispatchPendingEvents(); break; @@ -5111,11 +5113,11 @@ bool nsWindow::ProcessMessage(UINT msg, WPARAM &wParam, LPARAM &lParam, case WM_NCLBUTTONDBLCLK: DispatchMouseEvent(NS_MOUSE_DOUBLECLICK, 0, lParamToClient(lParam), - PR_FALSE, nsMouseEvent::eLeftButton, + false, nsMouseEvent::eLeftButton, MOUSE_INPUT_SOURCE()); result = DispatchMouseEvent(NS_MOUSE_BUTTON_UP, 0, lParamToClient(lParam), - PR_FALSE, nsMouseEvent::eLeftButton, + false, nsMouseEvent::eLeftButton, MOUSE_INPUT_SOURCE()); DispatchPendingEvents(); break; @@ -5136,10 +5138,10 @@ bool nsWindow::ProcessMessage(UINT msg, WPARAM &wParam, LPARAM &lParam, DispatchCommandEvent(appCommand); // tell the driver that we handled the event *aRetValue = 1; - result = PR_TRUE; + result = true; break; } - // default = PR_FALSE - tell the driver that the event was not handled + // default = false - tell the driver that the event was not handled } break; @@ -5154,7 +5156,7 @@ bool nsWindow::ProcessMessage(UINT msg, WPARAM &wParam, LPARAM &lParam, *aRetValue = 0; OnScrollInternal(GetNativeMessage(msg), wParam, lParam); // Doesn't need to call next wndproc for internal message. - return PR_TRUE; + return true; // The WM_ACTIVATE event is fired when a window is raised or lowered, // and the loword of wParam specifies which. But we don't want to tell @@ -5173,7 +5175,7 @@ bool nsWindow::ProcessMessage(UINT msg, WPARAM &wParam, LPARAM &lParam, if (HIWORD(wParam)) result = DispatchFocusToTopLevelWindow(NS_DEACTIVATE); else - sJustGotDeactivate = PR_TRUE; + sJustGotDeactivate = true; if (mIsTopWidgetWindow) mLastKeyboardLayout = gKbdLayout.GetLayout(); @@ -5181,8 +5183,8 @@ bool nsWindow::ProcessMessage(UINT msg, WPARAM &wParam, LPARAM &lParam, } else { StopFlashing(); - sJustGotActivate = PR_TRUE; - nsMouseEvent event(PR_TRUE, NS_MOUSE_ACTIVATE, this, + sJustGotActivate = true; + nsMouseEvent event(true, NS_MOUSE_ACTIVATE, this, nsMouseEvent::eReal); InitEvent(event); DispatchWindowEvent(&event); @@ -5201,7 +5203,7 @@ bool nsWindow::ProcessMessage(UINT msg, WPARAM &wParam, LPARAM &lParam, HWND owner = ::GetWindow(mWnd, GW_OWNER); if (owner && owner == ::GetForegroundWindow()) { *aRetValue = MA_NOACTIVATE; - result = PR_TRUE; + result = true; } } break; @@ -5248,14 +5250,14 @@ bool nsWindow::ProcessMessage(UINT msg, WPARAM &wParam, LPARAM &lParam, switch (wParam) { case SPI_SETWHEELSCROLLLINES: case SPI_SETWHEELSCROLLCHARS: - sNeedsToInitMouseWheelSettings = PR_TRUE; + sNeedsToInitMouseWheelSettings = true; break; } break; case WM_INPUTLANGCHANGEREQUEST: *aRetValue = TRUE; - result = PR_FALSE; + result = false; break; case WM_INPUTLANGCHANGE: @@ -5288,7 +5290,7 @@ bool nsWindow::ProcessMessage(UINT msg, WPARAM &wParam, LPARAM &lParam, if (msaaAccessible) { *aRetValue = LresultFromObject(IID_IAccessible, wParam, msaaAccessible); // does an addref msaaAccessible->Release(); // release extra addref - result = PR_TRUE; // We handled the WM_GETOBJECT message + result = true; // We handled the WM_GETOBJECT message } } } @@ -5301,7 +5303,7 @@ bool nsWindow::ProcessMessage(UINT msg, WPARAM &wParam, LPARAM &lParam, // prevent Windows from trimming the working set. bug 76831 if (!sTrimOnMinimize && filteredWParam == SC_MINIMIZE) { ::ShowWindow(mWnd, SW_SHOWMINIMIZED); - result = PR_TRUE; + result = true; } // Handle the system menu manually when we're in full screen mode @@ -5311,7 +5313,7 @@ bool nsWindow::ProcessMessage(UINT msg, WPARAM &wParam, LPARAM &lParam, DisplaySystemMenu(mWnd, mSizeMode, mIsRTL, MOZ_SYSCONTEXT_X_POS, MOZ_SYSCONTEXT_Y_POS); - result = PR_TRUE; + result = true; } } break; @@ -5322,7 +5324,7 @@ bool nsWindow::ProcessMessage(UINT msg, WPARAM &wParam, LPARAM &lParam, // We don't need to call next wndproc WM_MOUSEWHEEL and WM_MOUSEHWHEEL. // We should consume them always. If the messages would be handled by // our window again, it causes making infinite message loop. - return PR_TRUE; + return true; case MOZ_WM_MOUSEVWHEEL: case MOZ_WM_MOUSEHWHEEL: @@ -5336,21 +5338,21 @@ bool nsWindow::ProcessMessage(UINT msg, WPARAM &wParam, LPARAM &lParam, // we should fall through. OnMouseWheelInternal(nativeMessage, wParam, lParam, aRetValue); // Doesn't need to call next wndproc for internal message. - return PR_TRUE; + return true; } #if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN case WM_DWMCOMPOSITIONCHANGED: // First, update the compositor state to latest one. All other methods // should use same state as here for consistency painting. - nsUXThemeData::CheckForCompositor(PR_TRUE); + nsUXThemeData::CheckForCompositor(true); UpdateNonClientMargins(); RemovePropW(mWnd, kManageWindowInfoProperty); BroadcastMsg(mWnd, WM_DWMCOMPOSITIONCHANGED); DispatchStandardEvent(NS_THEMECHANGED); UpdateGlass(); - Invalidate(PR_FALSE); + Invalidate(false); break; #endif @@ -5363,7 +5365,7 @@ bool nsWindow::ProcessMessage(UINT msg, WPARAM &wParam, LPARAM &lParam, // the button should not. PRInt32 action = LOWORD(wParam); if (action == UIS_SET || action == UIS_CLEAR) { - nsUIStateChangeEvent event(PR_TRUE, NS_UISTATECHANGED, this); + nsUIStateChangeEvent event(true, NS_UISTATECHANGED, this); PRInt32 flags = HIWORD(wParam); if (flags & UISF_HIDEACCEL) event.showAccelerators = (action == UIS_SET) ? UIStateChangeType_Clear : UIStateChangeType_Set; @@ -5379,7 +5381,7 @@ bool nsWindow::ProcessMessage(UINT msg, WPARAM &wParam, LPARAM &lParam, case WM_TABLET_QUERYSYSTEMGESTURESTATUS: // According to MS samples, this must be handled to enable // rotational support in multi-touch drivers. - result = PR_TRUE; + result = true; *aRetValue = TABLET_ROTATE_GESTURE_ENABLE; break; @@ -5407,7 +5409,7 @@ bool nsWindow::ProcessMessage(UINT msg, WPARAM &wParam, LPARAM &lParam, nsPointWin touchPoint; touchPoint = gestureinfo->ptsLocation; touchPoint.ScreenToClient(mWnd); - nsGestureNotifyEvent gestureNotifyEvent(PR_TRUE, NS_GESTURENOTIFY_EVENT_START, this); + nsGestureNotifyEvent gestureNotifyEvent(true, NS_GESTURENOTIFY_EVENT_START, this); gestureNotifyEvent.refPoint = touchPoint; nsEventStatus status; DispatchEvent(&gestureNotifyEvent, status); @@ -5415,57 +5417,57 @@ bool nsWindow::ProcessMessage(UINT msg, WPARAM &wParam, LPARAM &lParam, if (!mTouchWindow) mGesture.SetWinGestureSupport(mWnd, gestureNotifyEvent.panDirection); } - result = PR_FALSE; //should always bubble to DefWindowProc + result = false; //should always bubble to DefWindowProc } break; case WM_CLEAR: { - nsContentCommandEvent command(PR_TRUE, NS_CONTENT_COMMAND_DELETE, this); + nsContentCommandEvent command(true, NS_CONTENT_COMMAND_DELETE, this); DispatchWindowEvent(&command); - result = PR_TRUE; + result = true; } break; case WM_CUT: { - nsContentCommandEvent command(PR_TRUE, NS_CONTENT_COMMAND_CUT, this); + nsContentCommandEvent command(true, NS_CONTENT_COMMAND_CUT, this); DispatchWindowEvent(&command); - result = PR_TRUE; + result = true; } break; case WM_COPY: { - nsContentCommandEvent command(PR_TRUE, NS_CONTENT_COMMAND_COPY, this); + nsContentCommandEvent command(true, NS_CONTENT_COMMAND_COPY, this); DispatchWindowEvent(&command); - result = PR_TRUE; + result = true; } break; case WM_PASTE: { - nsContentCommandEvent command(PR_TRUE, NS_CONTENT_COMMAND_PASTE, this); + nsContentCommandEvent command(true, NS_CONTENT_COMMAND_PASTE, this); DispatchWindowEvent(&command); - result = PR_TRUE; + result = true; } break; case EM_UNDO: { - nsContentCommandEvent command(PR_TRUE, NS_CONTENT_COMMAND_UNDO, this); + nsContentCommandEvent command(true, NS_CONTENT_COMMAND_UNDO, this); DispatchWindowEvent(&command); *aRetValue = (LRESULT)(command.mSucceeded && command.mIsEnabled); - result = PR_TRUE; + result = true; } break; case EM_REDO: { - nsContentCommandEvent command(PR_TRUE, NS_CONTENT_COMMAND_REDO, this); + nsContentCommandEvent command(true, NS_CONTENT_COMMAND_REDO, this); DispatchWindowEvent(&command); *aRetValue = (LRESULT)(command.mSucceeded && command.mIsEnabled); - result = PR_TRUE; + result = true; } break; @@ -5474,32 +5476,32 @@ bool nsWindow::ProcessMessage(UINT msg, WPARAM &wParam, LPARAM &lParam, // Support EM_CANPASTE message only when wParam isn't specified or // is plain text format. if (wParam == 0 || wParam == CF_TEXT || wParam == CF_UNICODETEXT) { - nsContentCommandEvent command(PR_TRUE, NS_CONTENT_COMMAND_PASTE, - this, PR_TRUE); + nsContentCommandEvent command(true, NS_CONTENT_COMMAND_PASTE, + this, true); DispatchWindowEvent(&command); *aRetValue = (LRESULT)(command.mSucceeded && command.mIsEnabled); - result = PR_TRUE; + result = true; } } break; case EM_CANUNDO: { - nsContentCommandEvent command(PR_TRUE, NS_CONTENT_COMMAND_UNDO, - this, PR_TRUE); + nsContentCommandEvent command(true, NS_CONTENT_COMMAND_UNDO, + this, true); DispatchWindowEvent(&command); *aRetValue = (LRESULT)(command.mSucceeded && command.mIsEnabled); - result = PR_TRUE; + result = true; } break; case EM_CANREDO: { - nsContentCommandEvent command(PR_TRUE, NS_CONTENT_COMMAND_REDO, - this, PR_TRUE); + nsContentCommandEvent command(true, NS_CONTENT_COMMAND_REDO, + this, true); DispatchWindowEvent(&command); *aRetValue = (LRESULT)(command.mSucceeded && command.mIsEnabled); - result = PR_TRUE; + result = true; } break; @@ -5539,7 +5541,7 @@ bool nsWindow::ProcessMessage(UINT msg, WPARAM &wParam, LPARAM &lParam, else { //Events which caused mWnd destruction and aren't consumed //will crash during the Windows default processing. - return PR_TRUE; + return true; } } @@ -5630,16 +5632,16 @@ nsWindow::ClientMarginHitTestPoint(PRInt32 mx, PRInt32 my) if (my >= winRect.top && my < (winRect.top + mVertResizeMargin + (mCaptionHeight - mNonClientOffset.top))) - top = PR_TRUE; + top = true; else if (my < winRect.bottom && my >= (winRect.bottom - mVertResizeMargin)) - bottom = PR_TRUE; + bottom = true; if (mx >= winRect.left && mx < (winRect.left + (bottom ? (2*mHorResizeMargin) : mHorResizeMargin))) - left = PR_TRUE; + left = true; else if (mx < winRect.right && mx >= (winRect.right - (bottom ? (2*mHorResizeMargin) : mHorResizeMargin))) - right = PR_TRUE; + right = true; if (top) { testResult = HTTOP; @@ -5688,7 +5690,7 @@ nsWindow::ClientMarginHitTestPoint(PRInt32 mx, PRInt32 my) LPARAM lParam = MAKELPARAM(mx, my); LPARAM lParamClient = lParamToClient(lParam); bool result = DispatchMouseEvent(NS_MOUSE_MOZHITTEST, 0, lParamClient, - PR_FALSE, nsMouseEvent::eLeftButton, MOUSE_INPUT_SOURCE()); + false, nsMouseEvent::eLeftButton, MOUSE_INPUT_SOURCE()); if (result) { // The mouse is over a blank area testResult = testResult == HTCLIENT ? HTCAPTION : testResult; @@ -5820,21 +5822,21 @@ LRESULT nsWindow::ProcessKeyDownMessage(const MSG &aMsg, result = OnKeyDown(aMsg, modKeyState, aEventDispatched, nsnull); // OnKeyDown cleaned up the redirected message information itself, so, // we should do nothing. - forgetRedirectedMessage.mCancel = PR_TRUE; + forgetRedirectedMessage.mCancel = true; } if (aMsg.wParam == VK_MENU || (aMsg.wParam == VK_F10 && !modKeyState.mIsShiftDown)) { // We need to let Windows handle this keypress, - // by returning PR_FALSE, if there's a native menu + // by returning false, if there's a native menu // bar somewhere in our containing window hierarchy. // Otherwise we handle the keypress and don't pass - // it on to Windows, by returning PR_TRUE. + // it on to Windows, by returning true. bool hasNativeMenu = false; HWND hWnd = mWnd; while (hWnd) { if (::GetMenu(hWnd)) { - hasNativeMenu = PR_TRUE; + hasNativeMenu = true; break; } hWnd = ::GetParent(hWnd); @@ -5949,7 +5951,7 @@ BOOL nsWindow::OnInputLangChange(HKL aHKL) PR_LOG(gWindowsLog, PR_LOG_ALWAYS, ("OnInputLanguageChange\n")); #endif gKbdLayout.LoadLayout(aHKL); - return PR_FALSE; // always pass to child window + return false; // always pass to child window } void nsWindow::OnWindowPosChanged(WINDOWPOS *wp, bool& result) @@ -5995,7 +5997,7 @@ void nsWindow::OnWindowPosChanged(WINDOWPOS *wp, bool& result) if (mSizeMode == nsSizeMode_Minimized && (wp->flags & SWP_NOACTIVATE)) return; - nsSizeModeEvent event(PR_TRUE, NS_SIZEMODE, this); + nsSizeModeEvent event(true, NS_SIZEMODE, this); WINDOWPLACEMENT pl; pl.length = sizeof(pl); @@ -6122,9 +6124,9 @@ void nsWindow::OnWindowPosChanged(WINDOWPOS *wp, bool& result) // ensure a 1 pixel margin at screen bottom to allow taskbar unhiding to // work properly. if (mSizeMode == nsSizeMode_Maximized) { - if (UpdateNonClientMargins(nsSizeMode_Maximized, PR_TRUE)) { + if (UpdateNonClientMargins(nsSizeMode_Maximized, true)) { // gecko resize event already sent by UpdateNonClientMargins. - result = PR_TRUE; + result = true; return; } } @@ -6186,20 +6188,20 @@ void nsWindow::OnWindowPosChanging(LPWINDOWPOS& info) else sizeMode = nsSizeMode_Normal; - nsSizeModeEvent event(PR_TRUE, NS_SIZEMODE, this); + nsSizeModeEvent event(true, NS_SIZEMODE, this); InitEvent(event); event.mSizeMode = static_cast(sizeMode); DispatchWindowEvent(&event); - UpdateNonClientMargins(sizeMode, PR_FALSE); + UpdateNonClientMargins(sizeMode, false); } // enforce local z-order rules if (!(info->flags & SWP_NOZORDER)) { HWND hwndAfter = info->hwndInsertAfter; - nsZLevelEvent event(PR_TRUE, NS_SETZLEVEL, this); + nsZLevelEvent event(true, NS_SETZLEVEL, this); nsWindow *aboveWindow = 0; InitEvent(event); @@ -6215,8 +6217,8 @@ void nsWindow::OnWindowPosChanging(LPWINDOWPOS& info) event.mReqBelow = aboveWindow; event.mActualBelow = nsnull; - event.mImmediate = PR_FALSE; - event.mAdjusted = PR_FALSE; + event.mImmediate = false; + event.mAdjusted = false; DispatchWindowEvent(&event); if (event.mAdjusted) { @@ -6272,7 +6274,7 @@ bool nsWindow::OnTouch(WPARAM wParam, LPARAM lParam) touchPoint.y = TOUCH_COORD_TO_PIXEL(pInputs[i].y); touchPoint.ScreenToClient(mWnd); - nsMozTouchEvent touchEvent(PR_TRUE, msg, this, pInputs[i].dwID); + nsMozTouchEvent touchEvent(true, msg, this, pInputs[i].dwID); touchEvent.inputSource = nsIDOMMouseEvent::MOZ_SOURCE_TOUCH; touchEvent.refPoint = touchPoint; @@ -6283,7 +6285,7 @@ bool nsWindow::OnTouch(WPARAM wParam, LPARAM lParam) delete [] pInputs; mGesture.CloseTouchInputHandle((HTOUCHINPUT)lParam); - return PR_TRUE; + return true; } #endif @@ -6292,16 +6294,16 @@ bool nsWindow::OnGesture(WPARAM wParam, LPARAM lParam) { // Treatment for pan events which translate into scroll events: if (mGesture.IsPanEvent(lParam)) { - nsMouseScrollEvent event(PR_TRUE, NS_MOUSE_PIXEL_SCROLL, this); + nsMouseScrollEvent event(true, NS_MOUSE_PIXEL_SCROLL, this); if ( !mGesture.ProcessPanMessage(mWnd, wParam, lParam) ) - return PR_FALSE; // ignore + return false; // ignore nsEventStatus status; event.isShift = IS_VK_DOWN(NS_VK_SHIFT); event.isControl = IS_VK_DOWN(NS_VK_CONTROL); - event.isMeta = PR_FALSE; + event.isMeta = false; event.isAlt = IS_VK_DOWN(NS_VK_ALT); event.button = 0; event.time = ::GetMessageTime(); @@ -6330,19 +6332,19 @@ bool nsWindow::OnGesture(WPARAM wParam, LPARAM lParam) mGesture.CloseGestureInfoHandle((HGESTUREINFO)lParam); - return PR_TRUE; + return true; } // Other gestures translate into simple gesture events: - nsSimpleGestureEvent event(PR_TRUE, 0, this, 0, 0.0); + nsSimpleGestureEvent event(true, 0, this, 0, 0.0); if ( !mGesture.ProcessGestureMessage(mWnd, wParam, lParam, event) ) { - return PR_FALSE; // fall through to DefWndProc + return false; // fall through to DefWndProc } // Polish up and send off the new event event.isShift = IS_VK_DOWN(NS_VK_SHIFT); event.isControl = IS_VK_DOWN(NS_VK_CONTROL); - event.isMeta = PR_FALSE; + event.isMeta = false; event.isAlt = IS_VK_DOWN(NS_VK_ALT); event.button = 0; event.time = ::GetMessageTime(); @@ -6351,13 +6353,13 @@ bool nsWindow::OnGesture(WPARAM wParam, LPARAM lParam) nsEventStatus status; DispatchEvent(&event, status); if (status == nsEventStatus_eIgnore) { - return PR_FALSE; // Ignored, fall through + return false; // Ignored, fall through } // Only close this if we process and return true. mGesture.CloseGestureInfoHandle((HGESTUREINFO)lParam); - return PR_TRUE; // Handled + return true; // Handled } PRUint16 nsWindow::GetMouseInputSource() @@ -6377,7 +6379,7 @@ nsWindow::InitMouseWheelScrollData() if (!sNeedsToInitMouseWheelSettings) { return; } - sNeedsToInitMouseWheelSettings = PR_FALSE; + sNeedsToInitMouseWheelSettings = false; ResetRemainingWheelDelta(); if (!::SystemParametersInfo(SPI_GETWHEELSCROLLLINES, 0, @@ -6487,20 +6489,20 @@ nsWindow::OnMouseWheelInternal(UINT aMessage, WPARAM aWParam, LPARAM aLParam, bool isControl; if (mAssumeWheelIsZoomUntil && static_cast(::GetMessageTime()) < mAssumeWheelIsZoomUntil) { - isControl = PR_TRUE; + isControl = true; } else { isControl = modKeyState.mIsControlDown; } // Create line (or page) scroll event. - nsMouseScrollEvent scrollEvent(PR_TRUE, NS_MOUSE_SCROLL, this); + nsMouseScrollEvent scrollEvent(true, NS_MOUSE_SCROLL, this); // Initialize common members on line scroll event, pixel scroll event and // test event. InitEvent(scrollEvent); scrollEvent.isShift = modKeyState.mIsShiftDown; scrollEvent.isControl = isControl; - scrollEvent.isMeta = PR_FALSE; + scrollEvent.isMeta = false; scrollEvent.isAlt = modKeyState.mIsAltDown; // Before dispatching line scroll event, we should get the current scroll @@ -6514,7 +6516,7 @@ nsWindow::OnMouseWheelInternal(UINT aMessage, WPARAM aWParam, LPARAM aLParam, (isVertical ? sMouseWheelScrollLines : sMouseWheelScrollChars); if (sEnablePixelScrolling) { - nsMouseScrollEvent testEvent(PR_TRUE, NS_MOUSE_SCROLL, this); + nsMouseScrollEvent testEvent(true, NS_MOUSE_SCROLL, this); InitEvent(testEvent); testEvent.scrollFlags = isPageScroll ? nsMouseScrollEvent::kIsFullPage : 0; testEvent.scrollFlags |= isVertical ? nsMouseScrollEvent::kIsVertical : @@ -6529,7 +6531,7 @@ nsWindow::OnMouseWheelInternal(UINT aMessage, WPARAM aWParam, LPARAM aLParam, (!isVertical && !sLastMouseWheelDeltaIsPositive)) { testEvent.delta *= -1; } - nsQueryContentEvent queryEvent(PR_TRUE, NS_QUERY_SCROLL_TARGET_INFO, this); + nsQueryContentEvent queryEvent(true, NS_QUERY_SCROLL_TARGET_INFO, this); InitEvent(queryEvent); queryEvent.InitForQueryScrollTargetInfo(&testEvent); DispatchWindowEvent(&queryEvent); @@ -6549,7 +6551,7 @@ nsWindow::OnMouseWheelInternal(UINT aMessage, WPARAM aWParam, LPARAM aLParam, computedScrollAmount = queryEvent.mReply.mComputedScrollAmount; if (pixelsPerUnit > 0 && computedScrollAmount != 0 && actualScrollAction != nsQueryContentEvent::SCROLL_ACTION_NONE) { - dispatchPixelScrollEvent = PR_TRUE; + dispatchPixelScrollEvent = true; // If original delta's sign and computed delta's one are different, // we need to reverse the pixel scroll direction at dispatching it. reversePixelScrollDirection = @@ -6610,7 +6612,7 @@ nsWindow::OnMouseWheelInternal(UINT aMessage, WPARAM aWParam, LPARAM aLParam, return; } - nsMouseScrollEvent pixelEvent(PR_TRUE, NS_MOUSE_PIXEL_SCROLL, this); + nsMouseScrollEvent pixelEvent(true, NS_MOUSE_PIXEL_SCROLL, this); InitEvent(pixelEvent); pixelEvent.scrollFlags = nsMouseScrollEvent::kAllowSmoothScroll; pixelEvent.scrollFlags |= isVertical ? @@ -6647,7 +6649,7 @@ StringCaseInsensitiveEquals(const PRUnichar* aChars1, const PRUint32 aNumChars1, const PRUnichar* aChars2, const PRUint32 aNumChars2) { if (aNumChars1 != aNumChars2) - return PR_FALSE; + return false; nsCaseInsensitiveStringComparator comp; return comp(aChars1, aChars2, aNumChars1, aNumChars2) == 0; @@ -6739,7 +6741,7 @@ LRESULT nsWindow::OnKeyDown(const MSG &aMsg, noDefault = DispatchKeyEvent(NS_KEY_DOWN, 0, nsnull, DOMKeyCode, &aMsg, aModKeyState); if (aEventDispatched) { - *aEventDispatched = PR_TRUE; + *aEventDispatched = true; } // If IMC wasn't associated to the window but is associated it now (i.e., @@ -6775,20 +6777,20 @@ LRESULT nsWindow::OnKeyDown(const MSG &aMsg, // Return here. We shouldn't dispatch keypress event for this WM_KEYDOWN. // If it's needed, it will be dispatched after next (redirected) // WM_KEYDOWN. - return PR_TRUE; + return true; } if (mOnDestroyCalled) { // If this was destroyed by the keydown event handler, we shouldn't // dispatch keypress event on this window. - return PR_TRUE; + return true; } } else { noDefault = sRedirectedKeyDownEventPreventedDefault; // If this is redirected keydown message, we have dispatched the keydown // event already. if (aEventDispatched) { - *aEventDispatched = PR_TRUE; + *aEventDispatched = true; } } @@ -6829,7 +6831,7 @@ LRESULT nsWindow::OnKeyDown(const MSG &aMsg, if (aFakeCharMessage) { RemoveMessageAndDispatchPluginEvent(WM_KEYFIRST, WM_KEYLAST, aFakeCharMessage); - anyCharMessagesRemoved = PR_TRUE; + anyCharMessagesRemoved = true; } else { while (gotMsg && (msg.message == WM_CHAR || msg.message == WM_SYSCHAR)) { @@ -6838,7 +6840,7 @@ LRESULT nsWindow::OnKeyDown(const MSG &aMsg, "WM_SYSCHAR" : "WM_CHAR", msg.wParam, HIWORD(msg.lParam) & 0xFF)); RemoveMessageAndDispatchPluginEvent(WM_KEYFIRST, WM_KEYLAST); - anyCharMessagesRemoved = PR_TRUE; + anyCharMessagesRemoved = true; gotMsg = ::PeekMessageW (&msg, mWnd, WM_KEYFIRST, WM_KEYLAST, PM_NOREMOVE | PM_NOYIELD); } @@ -6866,7 +6868,7 @@ LRESULT nsWindow::OnKeyDown(const MSG &aMsg, if (msg.message == WM_DEADCHAR) { if (!PluginHasFocus()) - return PR_FALSE; + return false; // We need to send the removed message to focused plug-in. DispatchPluginEvent(msg); @@ -7100,7 +7102,7 @@ LRESULT nsWindow::OnKeyUp(const MSG &aMsg, } if (aEventDispatched) - *aEventDispatched = PR_TRUE; + *aEventDispatched = true; return DispatchKeyEvent(NS_KEY_UP, 0, nsnull, virtualKeyCode, &aMsg, aModKeyState); } @@ -7133,7 +7135,7 @@ LRESULT nsWindow::OnCharRaw(UINT charCode, UINT aScanCode, bool saveIsAltDown = aModKeyState.mIsAltDown; bool saveIsControlDown = aModKeyState.mIsControlDown; if (aModKeyState.mIsAltDown && aModKeyState.mIsControlDown) - aModKeyState.mIsAltDown = aModKeyState.mIsControlDown = PR_FALSE; + aModKeyState.mIsAltDown = aModKeyState.mIsControlDown = false; wchar_t uniChar; @@ -7190,7 +7192,7 @@ LRESULT nsWindow::OnCharRaw(UINT charCode, UINT aScanCode, bool result = DispatchKeyEvent(NS_KEY_PRESS, uniChar, nsnull, charCode, aMsg, aModKeyState, aFlags); if (aEventDispatched) - *aEventDispatched = PR_TRUE; + *aEventDispatched = true; aModKeyState.mIsAltDown = saveIsAltDown; aModKeyState.mIsControlDown = saveIsControlDown; return result; @@ -7218,14 +7220,14 @@ nsWindow::ConfigureChildren(const nsTArray& aConfigurations) nsWindow* w = static_cast(configuration.mChild); NS_ASSERTION(w->GetParent() == this, "Configured widget is not a child"); - nsresult rv = w->SetWindowClipRegion(configuration.mClipRegion, PR_TRUE); + nsresult rv = w->SetWindowClipRegion(configuration.mClipRegion, true); NS_ENSURE_SUCCESS(rv, rv); nsIntRect bounds; w->GetBounds(bounds); if (bounds.Size() != configuration.mBounds.Size()) { w->Resize(configuration.mBounds.x, configuration.mBounds.y, configuration.mBounds.width, configuration.mBounds.height, - PR_TRUE); + true); } else if (bounds.TopLeft() != configuration.mBounds.TopLeft()) { w->Move(configuration.mBounds.x, configuration.mBounds.y); @@ -7240,10 +7242,10 @@ nsWindow::ConfigureChildren(const nsTArray& aConfigurations) r.Sub(bounds, configuration.mBounds); r.MoveBy(-bounds.x, -bounds.y); - w->Invalidate(r.GetBounds(), PR_FALSE); + w->Invalidate(r.GetBounds(), false); } } - rv = w->SetWindowClipRegion(configuration.mClipRegion, PR_FALSE); + rv = w->SetWindowClipRegion(configuration.mClipRegion, false); NS_ENSURE_SUCCESS(rv, rv); } return NS_OK; @@ -7350,7 +7352,7 @@ nsWindow::SetWindowClipRegion(const nsTArray& aRects, // WM_DESTROY event handler void nsWindow::OnDestroy() { - mOnDestroyCalled = PR_TRUE; + mOnDestroyCalled = true; // Make sure we don't get destroyed in the process of tearing down. nsCOMPtr kungFuDeathGrip(this); @@ -7384,18 +7386,18 @@ void nsWindow::OnDestroy() mParent = nsnull; // We have to destroy the native drag target before we null out our window pointer. - EnableDragDrop(PR_FALSE); + EnableDragDrop(false); // If we're going away and for some reason we're still the rollup widget, rollup and // turn off capture. if ( this == sRollupWidget ) { if ( sRollupListener ) sRollupListener->Rollup(nsnull, nsnull); - CaptureRollupEvents(nsnull, nsnull, PR_FALSE, PR_TRUE); + CaptureRollupEvents(nsnull, nsnull, false, true); } // Restore the IM context. - AssociateDefaultIMC(PR_TRUE); + AssociateDefaultIMC(true); // Turn off mouse trails if enabled. MouseTrailer* mtrailer = nsToolkit::gMouseTrailer; @@ -7434,7 +7436,7 @@ void nsWindow::OnDestroy() #endif // Finalize panning feedback to possibly restore window displacement - mGesture.PanFeedbackFinalize(mWnd, PR_TRUE); + mGesture.PanFeedbackFinalize(mWnd, true); // Clear the main HWND. mWnd = NULL; @@ -7446,7 +7448,7 @@ bool nsWindow::OnMove(PRInt32 aX, PRInt32 aY) mBounds.x = aX; mBounds.y = aY; - nsGUIEvent event(PR_TRUE, NS_MOVE, this); + nsGUIEvent event(true, NS_MOVE, this); InitEvent(event); event.refPoint.x = aX; event.refPoint.y = aY; @@ -7460,13 +7462,13 @@ bool nsWindow::OnResize(nsIntRect &aWindowRect) #ifdef CAIRO_HAS_D2D_SURFACE if (mD2DWindowSurface) { mD2DWindowSurface = NULL; - Invalidate(PR_FALSE); + Invalidate(false); } #endif // call the event callback if (mEventCallback) { - nsSizeEvent event(PR_TRUE, NS_SIZE, this); + nsSizeEvent event(true, NS_SIZE, this); InitEvent(event); event.windowSize = &aWindowRect; RECT r; @@ -7488,19 +7490,19 @@ bool nsWindow::OnResize(nsIntRect &aWindowRect) return DispatchWindowEvent(&event); } - return PR_FALSE; + return false; } bool nsWindow::OnHotKey(WPARAM wParam, LPARAM lParam) { - return PR_TRUE; + return true; } /* static */ bool nsWindow::IsOurProcessWindow(HWND aHWND) { if (!aHWND) { - return PR_FALSE; + return false; } DWORD processId = 0; ::GetWindowThreadProcessId(aHWND, &processId); @@ -7522,17 +7524,17 @@ static bool PointInWindow(HWND aHWND, const POINT& aPoint) { RECT bounds; if (!::GetWindowRect(aHWND, &bounds)) { - return PR_FALSE; + return false; } if (aPoint.x < bounds.left || aPoint.x >= bounds.right || aPoint.y < bounds.top || aPoint.y >= bounds.bottom) { - return PR_FALSE; + return false; } - return PR_TRUE; + return true; } static HWND FindTopmostWindowAtPoint(HWND aHWND, const POINT& aPoint) @@ -7608,7 +7610,7 @@ static bool IsElantechHelperWindow(HWND aHWND) reinterpret_cast(::GetProcAddress(hPSAPI, "GetProcessImageFileNameW")); if (!pGetProcessImageFileName) { - return PR_FALSE; + return false; } const PRUnichar* filenameSuffix = L"\\etdctrl.exe"; @@ -7626,7 +7628,7 @@ static bool IsElantechHelperWindow(HWND aHWND) int pathLength = lstrlenW(path); if (pathLength >= filenameSuffixLength) { if (lstrcmpiW(path + pathLength - filenameSuffixLength, filenameSuffix) == 0) { - result = PR_TRUE; + result = true; } } } @@ -7701,11 +7703,11 @@ nsWindow::OnMouseWheel(UINT aMsg, WPARAM aWParam, LPARAM aLParam, // ::GetMessagePos API if the sender is the driver. if (!sMayBeUsingLogitechMouse && aLParam == 0 && (DWORD)aLParam != dwPoints && ::InSendMessage()) { - sMayBeUsingLogitechMouse = PR_TRUE; + sMayBeUsingLogitechMouse = true; } else if (sMayBeUsingLogitechMouse && aLParam != 0 && ::InSendMessage()) { // The user has changed the mouse from Logitech's to another one (e.g., // the user has changed to the touchpad of the notebook. - sMayBeUsingLogitechMouse = PR_FALSE; + sMayBeUsingLogitechMouse = false; } // If the WM_MOUSEHWHEEL comes from Logitech's mouse driver, and the // ::GetMessagePos isn't correct, probably, we should use ::GetCursorPos @@ -7757,7 +7759,7 @@ nsWindow::OnMouseWheel(UINT aMsg, WPARAM aWParam, LPARAM aLParam, // cause accessing the plugin. Therefore, we should unlock the plugin // process by using PostMessage(). if (destWindow->mWindowType == eWindowType_plugin) { - destWindow = destWindow->GetParentWindow(PR_FALSE); + destWindow = destWindow->GetParentWindow(false); NS_ENSURE_TRUE(destWindow, ); } UINT internalMessage = GetInternalMessage(aMsg); @@ -7782,7 +7784,7 @@ nsWindow::OnMouseWheel(UINT aMsg, WPARAM aWParam, LPARAM aLParam, // the plugin. Therefore, we should unlock the plugin process by using // PostMessage(). if (mWindowType == eWindowType_plugin && pluginWnd == mWnd) { - nsWindow* destWindow = GetParentWindow(PR_FALSE); + nsWindow* destWindow = GetParentWindow(false); NS_ENSURE_TRUE(destWindow, ); UINT internalMessage = GetInternalMessage(aMsg); ::PostMessage(destWindow->mWnd, internalMessage, aWParam, aLParam); @@ -7814,11 +7816,11 @@ nsWindow::OnScroll(UINT aMsg, WPARAM aWParam, LPARAM aLParam) OnMouseWheel(aMsg, aWParam, aLParam, &retVal); // Always consume the scroll message if we try to emulate mouse wheel // action. - return PR_TRUE; + return true; } // Scroll message generated by external application - nsContentCommandEvent command(PR_TRUE, NS_CONTENT_COMMAND_SCROLL, this); + nsContentCommandEvent command(true, NS_CONTENT_COMMAND_SCROLL, this); command.mScroll.mIsHorizontal = (aMsg == WM_HSCROLL); @@ -7849,12 +7851,12 @@ nsWindow::OnScroll(UINT aMsg, WPARAM aWParam, LPARAM aLParam) command.mScroll.mAmount = 1; break; default: - return PR_FALSE; + return false; } // XXX If this is a plugin window, we should dispatch the event from // parent window. DispatchWindowEvent(&command); - return PR_TRUE; + return true; } /** @@ -7866,7 +7868,7 @@ nsWindow::OnScroll(UINT aMsg, WPARAM aWParam, LPARAM aLParam) void nsWindow::OnScrollInternal(UINT aMsg, WPARAM aWParam, LPARAM aLParam) { - nsMouseScrollEvent scrollevent(PR_TRUE, NS_MOUSE_SCROLL, this); + nsMouseScrollEvent scrollevent(true, NS_MOUSE_SCROLL, this); scrollevent.scrollFlags = (aMsg == WM_VSCROLL) ? nsMouseScrollEvent::kIsVertical : nsMouseScrollEvent::kIsHorizontal; @@ -7886,7 +7888,7 @@ nsWindow::OnScrollInternal(UINT aMsg, WPARAM aWParam, LPARAM aLParam) } scrollevent.isShift = IS_VK_DOWN(NS_VK_SHIFT); scrollevent.isControl = IS_VK_DOWN(NS_VK_CONTROL); - scrollevent.isMeta = PR_FALSE; + scrollevent.isMeta = false; scrollevent.isAlt = IS_VK_DOWN(NS_VK_ALT); InitEvent(scrollevent); if (mEventCallback) { @@ -7897,7 +7899,7 @@ nsWindow::OnScrollInternal(UINT aMsg, WPARAM aWParam, LPARAM aLParam) // Can be overriden. Controls auto-erase of background. bool nsWindow::AutoErase(HDC dc) { - return PR_FALSE; + return false; } void @@ -7995,7 +7997,7 @@ NS_IMETHODIMP nsWindow::ResetInputState() #endif #ifdef NS_ENABLE_TSF - nsTextStore::CommitComposition(PR_FALSE); + nsTextStore::CommitComposition(false); #endif //NS_ENABLE_TSF nsIMM32Handler::CommitComposition(this); @@ -8025,9 +8027,9 @@ NS_IMETHODIMP nsWindow::GetIMEOpenState(bool* aState) nsIMEContext IMEContext(mWnd); if (IMEContext.IsValid()) { BOOL isOpen = ::ImmGetOpenStatus(IMEContext.get()); - *aState = isOpen ? PR_TRUE : PR_FALSE; + *aState = isOpen ? true : false; } else - *aState = PR_FALSE; + *aState = false; #ifdef NS_ENABLE_TSF *aState |= nsTextStore::GetIMEOpenState(); @@ -8076,7 +8078,7 @@ NS_IMETHODIMP nsWindow::CancelIMEComposition() #endif #ifdef NS_ENABLE_TSF - nsTextStore::CommitComposition(PR_TRUE); + nsTextStore::CommitComposition(true); #endif //NS_ENABLE_TSF nsIMM32Handler::CancelComposition(this); @@ -8143,11 +8145,11 @@ bool nsWindow::AssociateDefaultIMC(bool aAssociate) if (mOnDestroyCalled) { // If OnDestroy() has been called, we shouldn't disassociate the default // IMC at destroying the window. - return PR_FALSE; + return false; } if (!IMEContext.get()) { - return PR_FALSE; // already disassociated + return false; // already disassociated } BOOL ret = ::ImmAssociateContextEx(mWnd, NULL, 0); @@ -8294,7 +8296,7 @@ void nsWindow::SetWindowTranslucencyInner(nsTransparencyMode aMode) return; // stop on dialogs and popups! - HWND hWnd = GetTopLevelHWND(mWnd, PR_TRUE); + HWND hWnd = GetTopLevelHWND(mWnd, true); nsWindow* parent = GetNSWindowPtr(hWnd); if (!parent) @@ -8310,10 +8312,10 @@ void nsWindow::SetWindowTranslucencyInner(nsTransparencyMode aMode) if (aMode == eTransparencyTransparent) { // If we're switching to the use of a transparent window, hide the chrome // on our parent. - HideWindowChrome(PR_TRUE); + HideWindowChrome(true); } else if (mHideChrome && mTransparencyMode == eTransparencyTransparent) { // if we're switching out of transparent, re-enable our parent's chrome. - HideWindowChrome(PR_FALSE); + HideWindowChrome(false); } LONG_PTR style = ::GetWindowLongPtrW(hWnd, GWL_STYLE), @@ -8348,7 +8350,7 @@ void nsWindow::SetWindowTranslucencyInner(nsTransparencyMode aMode) void nsWindow::SetupTranslucentWindowMemoryBitmap(nsTransparencyMode aMode) { if (eTransparencyTransparent == aMode) { - ResizeTranslucentWindow(mBounds.width, mBounds.height, PR_TRUE); + ResizeTranslucentWindow(mBounds.width, mBounds.height, true); } else { mTransparentSurface = nsnull; mMemoryDC = NULL; @@ -8365,7 +8367,7 @@ nsresult nsWindow::UpdateTranslucentWindow() BLENDFUNCTION bf = { AC_SRC_OVER, 0, 255, AC_SRC_ALPHA }; SIZE winSize = { mBounds.width, mBounds.height }; POINT srcPos = { 0, 0 }; - HWND hWnd = GetTopLevelHWND(mWnd, PR_TRUE); + HWND hWnd = GetTopLevelHWND(mWnd, true); RECT winRect; ::GetWindowRect(hWnd, &winRect); @@ -8373,7 +8375,7 @@ nsresult nsWindow::UpdateTranslucentWindow() if (gfxWindowsPlatform::GetPlatform()->GetRenderMode() == gfxWindowsPlatform::RENDER_DIRECT2D) { mMemoryDC = static_cast(mTransparentSurface.get())-> - GetDC(PR_TRUE); + GetDC(true); } #endif // perform the alpha blend @@ -8658,7 +8660,7 @@ nsWindow::EventIsInsideWindow(UINT Msg, nsWindow* aWindow) if (Msg == WM_ACTIVATEAPP) // don't care about activation/deactivation - return PR_FALSE; + return false; ::GetWindowRect(aWindow->mWnd, &r); DWORD pos = ::GetMessagePos(); @@ -8695,7 +8697,7 @@ nsWindow::DealWithPopups(HWND inWnd, UINT inMsg, WPARAM inWParam, LPARAM inLPara if (rollup && (inMsg == WM_MOUSEWHEEL || inMsg == WM_MOUSEHWHEEL)) { sRollupListener->ShouldRollupOnMouseWheelEvent(&rollup); - *outResult = PR_TRUE; + *outResult = true; } // If we're dealing with menus, we probably have submenus and we don't @@ -8713,7 +8715,7 @@ nsWindow::DealWithPopups(HWND inWnd, UINT inMsg, WPARAM inWParam, LPARAM inLPara // that, roll up, but pass the number of popups to Rollup so // that only those of the same type close up. if (i < sameTypeCount) { - rollup = PR_FALSE; + rollup = false; } else { popupsToRollup = sameTypeCount; @@ -8758,7 +8760,7 @@ nsWindow::DealWithPopups(HWND inWnd, UINT inMsg, WPARAM inWParam, LPARAM inLPara sRollupListener->Rollup(popupsToRollup, inMsg == WM_LBUTTONDOWN ? &mLastRollup : nsnull); // Tell hook to stop processing messages - sProcessHook = PR_FALSE; + sProcessHook = false; sRollupMsgId = 0; sRollupMsgWnd = NULL; @@ -8822,7 +8824,7 @@ PRInt32 nsWindow::GetWindowsVersion() if (!didCheck) { - didCheck = PR_TRUE; + didCheck = true; OSVERSIONINFOEX osInfo; osInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); // This cast is safe and supposed to be here, don't worry @@ -8840,7 +8842,7 @@ nsWindow* nsWindow::GetTopLevelWindow(bool aStopOnDialogOrPopup) { nsWindow* curWindow = this; - while (PR_TRUE) { + while (true) { if (aStopOnDialogOrPopup) { switch (curWindow->mWindowType) { case eWindowType_dialog: @@ -8852,7 +8854,7 @@ nsWindow* nsWindow::GetTopLevelWindow(bool aStopOnDialogOrPopup) } // Retrieve the top level parent or owner window - nsWindow* parentWindow = curWindow->GetParentWindow(PR_TRUE); + nsWindow* parentWindow = curWindow->GetParentWindow(true); if (!parentWindow) return curWindow; @@ -8896,7 +8898,7 @@ static BOOL CALLBACK gEnumWindowsProc(HWND hwnd, LPARAM lParam) ::GetWindowThreadProcessId(hwnd, &pid); if (pid == GetCurrentProcessId() && ::IsWindowVisible(hwnd)) { - gWindowsVisible = PR_TRUE; + gWindowsVisible = true; return FALSE; } return TRUE; @@ -8904,22 +8906,22 @@ static BOOL CALLBACK gEnumWindowsProc(HWND hwnd, LPARAM lParam) bool nsWindow::CanTakeFocus() { - gWindowsVisible = PR_FALSE; + gWindowsVisible = false; EnumWindows(gEnumWindowsProc, 0); if (!gWindowsVisible) { - return PR_TRUE; + return true; } else { HWND fgWnd = ::GetForegroundWindow(); if (!fgWnd) { - return PR_TRUE; + return true; } DWORD pid; GetWindowThreadProcessId(fgWnd, &pid); if (pid == GetCurrentProcessId()) { - return PR_TRUE; + return true; } } - return PR_FALSE; + return false; } void nsWindow::GetMainWindowClass(nsAString& aClass) @@ -8952,9 +8954,9 @@ bool nsWindow::GetInputWorkaroundPref(const char* aPrefName, if (NS_SUCCEEDED(Preferences::GetInt(aPrefName, &lHackValue))) { switch (lHackValue) { case 0: // disabled - return PR_FALSE; + return false; case 1: // enabled - return PR_TRUE; + return true; default: // -1: autodetect break; } @@ -8976,10 +8978,10 @@ HasRegistryKey(HKEY aRoot, PRUnichar* aName) if (result != ERROR_SUCCESS) { result = ::RegOpenKeyExW(aRoot, aName, 0, KEY_READ | KEY_WOW64_64KEY, &key); if (result != ERROR_SUCCESS) - return PR_FALSE; + return false; } ::RegCloseKey(key); - return PR_TRUE; + return true; } /** @@ -8999,7 +9001,7 @@ static bool GetRegistryKey(HKEY aRoot, PRUnichar* aKeyName, PRUnichar* aValueName, PRUnichar* aBuffer, DWORD aBufferLength) { if (!aKeyName) { - return PR_FALSE; + return false; } HKEY key; @@ -9007,16 +9009,16 @@ GetRegistryKey(HKEY aRoot, PRUnichar* aKeyName, PRUnichar* aValueName, PRUnichar if (result != ERROR_SUCCESS) { result = ::RegOpenKeyExW(aRoot, aKeyName, NULL, KEY_READ | KEY_WOW64_64KEY, &key); if (result != ERROR_SUCCESS) - return PR_FALSE; + return false; } DWORD type; result = ::RegQueryValueExW(key, aValueName, NULL, &type, (BYTE*) aBuffer, &aBufferLength); ::RegCloseKey(key); if (result != ERROR_SUCCESS || type != REG_SZ) - return PR_FALSE; + return false; if (aBuffer) aBuffer[aBufferLength / sizeof(*aBuffer) - 1] = 0; - return PR_TRUE; + return true; } static bool @@ -9029,7 +9031,7 @@ IsObsoleteSynapticsDriver() buf, sizeof buf); if (!foundKey) - return PR_FALSE; + return false; int majorVersion = wcstol(buf, NULL, 10); int minorVersion = 0; @@ -9058,7 +9060,7 @@ GetElantechDriverMajorVersion() sizeof buf); if (!foundKey) - return PR_FALSE; + return false; // Assume that the major version number can be found just after a space // or at the start of the string. @@ -9076,15 +9078,15 @@ void nsWindow::InitInputWorkaroundPrefDefaults() PRUint32 elantechDriverVersion = GetElantechDriverMajorVersion(); if (HasRegistryKey(HKEY_CURRENT_USER, L"Software\\Lenovo\\TrackPoint")) { - sDefaultTrackPointHack = PR_TRUE; + sDefaultTrackPointHack = true; } else if (HasRegistryKey(HKEY_CURRENT_USER, L"Software\\Lenovo\\UltraNav")) { - sDefaultTrackPointHack = PR_TRUE; + sDefaultTrackPointHack = true; } else if (HasRegistryKey(HKEY_CURRENT_USER, L"Software\\Alps\\Apoint\\TrackPoint")) { - sDefaultTrackPointHack = PR_TRUE; + sDefaultTrackPointHack = true; } else if ((HasRegistryKey(HKEY_CURRENT_USER, L"Software\\Synaptics\\SynTPEnh\\UltraNavUSB") || HasRegistryKey(HKEY_CURRENT_USER, L"Software\\Synaptics\\SynTPEnh\\UltraNavPS2")) && IsObsoleteSynapticsDriver()) { - sDefaultTrackPointHack = PR_TRUE; + sDefaultTrackPointHack = true; } bool useElantechGestureHacks = diff --git a/widget/src/windows/nsWindowDbg.h b/widget/src/windows/nsWindowDbg.h index 28a60c0abb80..f0b226969293 100644 --- a/widget/src/windows/nsWindowDbg.h +++ b/widget/src/windows/nsWindowDbg.h @@ -63,8 +63,8 @@ // Main event loop debug output flags #if defined(EVENT_DEBUG_OUTPUT) -#define SHOW_REPEAT_EVENTS PR_TRUE -#define SHOW_MOUSEMOVE_EVENTS PR_FALSE +#define SHOW_REPEAT_EVENTS true +#define SHOW_MOUSEMOVE_EVENTS false #endif // defined(EVENT_DEBUG_OUTPUT) #if defined(POPUP_ROLLUP_DEBUG_OUTPUT) || defined(EVENT_DEBUG_OUTPUT) || 1 diff --git a/widget/src/windows/nsWindowGfx.cpp b/widget/src/windows/nsWindowGfx.cpp index f474e2620ead..6d788f3d662f 100644 --- a/widget/src/windows/nsWindowGfx.cpp +++ b/widget/src/windows/nsWindowGfx.cpp @@ -226,7 +226,7 @@ bool nsWindow::OnPaint(HDC aDC, PRUint32 aNestingLevel) // but view manager will refuse to paint the surface, resulting is black // flashes on the plugin rendering surface. if (mozilla::ipc::RPCChannel::IsSpinLoopActive() && mPainting) - return PR_FALSE; + return false; if (mWindowType == eWindowType_plugin) { @@ -243,7 +243,7 @@ bool nsWindow::OnPaint(HDC aDC, PRUint32 aNestingLevel) PAINTSTRUCT ps; BeginPaint(mWnd, &ps); EndPaint(mWnd, &ps); - return PR_TRUE; + return true; } PluginInstanceParent* instance = reinterpret_cast( @@ -251,12 +251,12 @@ bool nsWindow::OnPaint(HDC aDC, PRUint32 aNestingLevel) if (instance) { instance->CallUpdateWindow(); ValidateRect(mWnd, NULL); - return PR_TRUE; + return true; } } - nsPaintEvent willPaintEvent(PR_TRUE, NS_WILL_PAINT, this); - willPaintEvent.willSendDidPaint = PR_TRUE; + nsPaintEvent willPaintEvent(true, NS_WILL_PAINT, this); + willPaintEvent.willSendDidPaint = true; DispatchWindowEvent(&willPaintEvent); bool result = true; @@ -279,7 +279,7 @@ bool nsWindow::OnPaint(HDC aDC, PRUint32 aNestingLevel) } #endif - mPainting = PR_TRUE; + mPainting = true; #ifdef WIDGET_DEBUG_OUTPUT HRGN debugPaintFlashRegion = NULL; @@ -299,7 +299,7 @@ bool nsWindow::OnPaint(HDC aDC, PRUint32 aNestingLevel) } // generate the event and call the event callback - nsPaintEvent event(PR_TRUE, NS_PAINT, this); + nsPaintEvent event(true, NS_PAINT, this); InitEvent(event); #ifdef MOZ_XUL @@ -308,7 +308,7 @@ bool nsWindow::OnPaint(HDC aDC, PRUint32 aNestingLevel) bool forceRepaint = NULL != aDC; #endif event.region = GetRegionToPaint(forceRepaint, ps, hDC); - event.willSendDidPaint = PR_TRUE; + event.willSendDidPaint = true; if (!event.region.IsEmpty() && mEventCallback) { @@ -400,7 +400,7 @@ bool nsWindow::OnPaint(HDC aDC, PRUint32 aNestingLevel) const nsIntRect* r; for (nsIntRegionRectIterator iter(event.region); (r = iter.Next()) != nsnull;) { - thebesContext->Rectangle(gfxRect(r->x, r->y, r->width, r->height), PR_TRUE); + thebesContext->Rectangle(gfxRect(r->x, r->y, r->width, r->height), true); } thebesContext->Clip(); thebesContext->SetOperator(gfxContext::OPERATOR_CLEAR); @@ -566,7 +566,7 @@ bool nsWindow::OnPaint(HDC aDC, PRUint32 aNestingLevel) // When our device was removed, we should have gfxWindowsPlatform // check if its render mode is up to date! gfxWindowsPlatform::GetPlatform()->UpdateRenderMode(); - Invalidate(PR_FALSE); + Invalidate(false); } } break; @@ -577,7 +577,7 @@ bool nsWindow::OnPaint(HDC aDC, PRUint32 aNestingLevel) gfxWindowsPlatform::GetPlatform()->UpdateRenderMode(); LayerManagerD3D10 *layerManagerD3D10 = static_cast(GetLayerManager()); if (layerManagerD3D10->device() != gfxWindowsPlatform::GetPlatform()->GetD3D10Device()) { - Invalidate(PR_FALSE); + Invalidate(false); } else { result = DispatchWindowEvent(&event, eventStatus); } @@ -613,12 +613,12 @@ bool nsWindow::OnPaint(HDC aDC, PRUint32 aNestingLevel) } #endif // WIDGET_DEBUG_OUTPUT - mPainting = PR_FALSE; + mPainting = false; - nsPaintEvent didPaintEvent(PR_TRUE, NS_DID_PAINT, this); + nsPaintEvent didPaintEvent(true, NS_DID_PAINT, this); DispatchWindowEvent(&didPaintEvent); - if (aNestingLevel == 0 && ::GetUpdateRect(mWnd, NULL, PR_FALSE)) { + if (aNestingLevel == 0 && ::GetUpdateRect(mWnd, NULL, false)) { OnPaint(aDC, 1); } @@ -751,7 +751,7 @@ bool nsWindowGfx::IsCursorTranslucencySupported() static bool didCheck = false; static bool isSupported = false; if (!didCheck) { - didCheck = PR_TRUE; + didCheck = true; // Cursor translucency is supported on Windows XP and newer isSupported = nsWindow::GetWindowsVersion() >= 0x501; } diff --git a/xpcom/io/nsILocalFile.idl b/xpcom/io/nsILocalFile.idl index 1ec2272c33d8..6b582a6158ea 100644 --- a/xpcom/io/nsILocalFile.idl +++ b/xpcom/io/nsILocalFile.idl @@ -95,6 +95,7 @@ interface nsILocalFile : nsIFile */ attribute boolean followLinks; + const unsigned long OS_READAHEAD = 0x40000000; const unsigned long DELETE_ON_CLOSE = 0x80000000; /** @@ -102,9 +103,11 @@ interface nsILocalFile : nsIFile * responsible for calling PR_Close on the result. * * @param flags the PR_Open flags from prio.h, plus optionally - * DELETE_ON_CLOSE. DELETE_ON_CLOSE may be implemented by removing - * the file (by path name) immediately after opening it, so beware - * of possible races; the file should be exclusively owned by this + * OS_READAHEAD or DELETE_ON_CLOSE. OS_READAHEAD is a hint to the + * OS that the file will be read sequentially with agressive + * readahead. DELETE_ON_CLOSE may be implemented by removing the + * file (by path name) immediately after opening it, so beware of + * possible races; the file should be exclusively owned by this * process. */ [noscript] PRFileDescStar openNSPRFileDesc(in long flags, in long mode); diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp index 5a907cee5877..10a259287e69 100644 --- a/xpcom/io/nsLocalFileUnix.cpp +++ b/xpcom/io/nsLocalFileUnix.cpp @@ -88,6 +88,7 @@ #include "prproces.h" #include "nsIDirectoryEnumerator.h" #include "nsISimpleEnumerator.h" +#include "private/pprio.h" #ifdef MOZ_WIDGET_GTK2 #include "nsIGIOService.h" @@ -431,6 +432,11 @@ nsLocalFile::OpenNSPRFileDesc(PRInt32 flags, PRInt32 mode, PRFileDesc **_retval) PR_Delete(mPath.get()); } +#if defined(LINUX) && !defined(ANDROID) + if (flags & OS_READAHEAD) { + readahead(PR_FileDesc2NativeHandle(*_retval), 0, 0); + } +#endif return NS_OK; } diff --git a/xpcom/io/nsLocalFileWin.cpp b/xpcom/io/nsLocalFileWin.cpp index 403562e0b6dc..97d2f1ab6c7b 100644 --- a/xpcom/io/nsLocalFileWin.cpp +++ b/xpcom/io/nsLocalFileWin.cpp @@ -398,6 +398,10 @@ OpenFile(const nsAFlatString &name, PRIntn osflags, PRIntn mode, flag6 |= FILE_FLAG_DELETE_ON_CLOSE; } + if (osflags && nsILocalFile::OS_READAHEAD) { + flag6 |= FILE_FLAG_SEQUENTIAL_SCAN; + } + HANDLE file = ::CreateFileW(name.get(), access, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, flags, flag6, NULL);