зеркало из https://github.com/mozilla/gecko-dev.git
Merge last good changeset from mozilla-inbound to mozilla-central
This commit is contained in:
Коммит
a730c3543c
|
@ -56,19 +56,20 @@
|
|||
|
||||
<implementation>
|
||||
<constructor><![CDATA[
|
||||
Cu.import("resource://services-sync/ext/Observers.js");
|
||||
Cu.import("resource://services-sync/notifications.js");
|
||||
let temp = {};
|
||||
Cu.import("resource://services-sync/ext/Observers.js", temp);
|
||||
temp.Observers.add("weave:notification:added", this.onNotificationAdded, this);
|
||||
temp.Observers.add("weave:notification:removed", this.onNotificationRemoved, this);
|
||||
|
||||
Observers.add("weave:notification:added", this.onNotificationAdded, this);
|
||||
Observers.add("weave:notification:removed", this.onNotificationRemoved, this);
|
||||
|
||||
for each (var notification in Notifications.notifications)
|
||||
for each (var notification in Weave.Notifications.notifications)
|
||||
this._appendNotification(notification);
|
||||
]]></constructor>
|
||||
|
||||
<destructor><![CDATA[
|
||||
Observers.remove("weave:notification:added", this.onNotificationAdded, this);
|
||||
Observers.remove("weave:notification:removed", this.onNotificationRemoved, this);
|
||||
let temp = {};
|
||||
Cu.import("resource://services-sync/ext/Observers.js", temp);
|
||||
temp.Observers.remove("weave:notification:added", this.onNotificationAdded, this);
|
||||
temp.Observers.remove("weave:notification:removed", this.onNotificationRemoved, this);
|
||||
]]></destructor>
|
||||
|
||||
<method name="onNotificationAdded">
|
||||
|
@ -140,7 +141,7 @@
|
|||
onset="this._notification = val; return val;"/>
|
||||
<method name="close">
|
||||
<body><![CDATA[
|
||||
Notifications.remove(this.notification);
|
||||
Weave.Notifications.remove(this.notification);
|
||||
|
||||
// We should be able to call the base class's close method here
|
||||
// to remove the notification element from the notification box,
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
|
||||
@media all and (-moz-windows-default-theme) {
|
||||
#navigator-toolbox > 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;
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -122,6 +122,8 @@ protected:
|
|||
|
||||
static long ComputeStride(const gfxIntSize&, gfxImageFormat);
|
||||
|
||||
void MakeInvalid();
|
||||
|
||||
gfxIntSize mSize;
|
||||
bool mOwnsData;
|
||||
unsigned char *mData;
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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<unsigned int>(mSize.width);
|
||||
unsigned int height = static_cast<unsigned int>(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<unsigned int>(mSize.width);
|
||||
unsigned int height = static_cast<unsigned int>(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<unsigned int>(mSize.width);
|
||||
unsigned int height = static_cast<unsigned int>(mSize.height);
|
||||
|
||||
cairo_surface_t *surf = cairo_quartz_surface_create_for_data
|
||||
(data, (cairo_format_t) format, width, height, stride);
|
||||
|
|
|
@ -75,6 +75,8 @@ public:
|
|||
}
|
||||
|
||||
protected:
|
||||
void MakeInvalid();
|
||||
|
||||
CGContextRef mCGContext;
|
||||
gfxSize mSize;
|
||||
bool mForPrinting;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -103,6 +103,8 @@ public:
|
|||
virtual gfxASurface::MemoryLocation GetMemoryLocation() const;
|
||||
|
||||
private:
|
||||
void MakeInvalid(gfxIntSize& size);
|
||||
|
||||
bool mOwnsDC;
|
||||
bool mForPrinting;
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
*/
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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<nsDisplayWrapList*>(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<nsDisplayOpacity*>(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,
|
||||
|
|
|
@ -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 <embed> 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<nsObjectFrame*>(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<nsNPAPIPluginInstance> 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<HPS>(window->window) != hps) {
|
||||
window->window = reinterpret_cast<void*>(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<nsPluginHost*>(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<nsIRunnable> 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);
|
||||
|
||||
|
|
|
@ -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[] = {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "Endian.h"
|
||||
#include "EndianMacros.h"
|
||||
#include "nsBMPDecoder.h"
|
||||
|
||||
#include "nsIInputStream.h"
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "Endian.h"
|
||||
#include "EndianMacros.h"
|
||||
#include "nsICODecoder.h"
|
||||
|
||||
#include "nsIInputStream.h"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -213,10 +213,8 @@
|
|||
<method name="onResize">
|
||||
<body>
|
||||
<![CDATA[
|
||||
// XXX the <notificationbox/>; 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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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<Telemetry::URLCLASSIFIER_PS_FALLOCATE_TIME> 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));
|
||||
|
|
|
@ -1192,5 +1192,6 @@ filefield {
|
|||
/*********** tabmodalprompt ************/
|
||||
tabmodalprompt {
|
||||
-moz-binding: url("chrome://global/content/tabprompts.xml#tabmodalprompt");
|
||||
overflow: hidden;
|
||||
text-shadow: none;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -93,7 +93,7 @@ nsBidiKeyboard::IsLangRTL(bool *aIsRTL)
|
|||
nsresult
|
||||
nsBidiKeyboard::SetHaveBidiKeyboards()
|
||||
{
|
||||
mHaveBidiKeyboards = PR_FALSE;
|
||||
mHaveBidiKeyboards = false;
|
||||
|
||||
if (!gtklib || !GdkKeymapHaveBidiLayouts)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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; }
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -84,7 +84,7 @@ protected:
|
|||
nsCOMPtr<nsIPrintSettings> 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;
|
||||
|
|
|
@ -132,7 +132,7 @@ nsDragService::nsDragService()
|
|||
// running.
|
||||
nsCOMPtr<nsIObserverService> 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<gfxContext> 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;
|
||||
|
|
|
@ -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<nsILocalFile> localfile;
|
||||
nsresult rv = NS_NewNativeLocalFile(nsDependentCString(static_cast<char*>(filename)),
|
||||
PR_FALSE,
|
||||
false,
|
||||
getter_AddRefs(localfile));
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
nsCOMArray<nsILocalFile>& files = *static_cast<nsCOMArray<nsILocalFile>*>(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) {
|
||||
|
|
|
@ -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<nsIWidget> 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<nsIWidget> kungFuDeathGrip = mLastFocusedWindow;
|
||||
mLastFocusedWindow->DispatchEvent(&compEvent, status);
|
||||
mIsComposing = PR_FALSE;
|
||||
mIsComposing = false;
|
||||
mCompositionStart = PR_UINT32_MAX;
|
||||
mDispatchedCompositionString.Truncate();
|
||||
if (static_cast<nsWindow*>(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<nsIWidget> kungFuDeathGrip = mLastFocusedWindow;
|
||||
if (!DispatchCompositionStart()) {
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1203,7 +1203,7 @@ nsGtkIMModule::DispatchTextEvent(const nsAString &aCompositionString,
|
|||
nsRefPtr<nsWindow> 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;
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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<nsKeyEvent*>(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<GdkEventKey*>(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;
|
||||
}
|
||||
|
|
|
@ -82,7 +82,7 @@ nsNativeThemeGTK::nsNativeThemeGTK()
|
|||
// We have to call moz_gtk_shutdown before the event loop stops running.
|
||||
nsCOMPtr<nsIObserverService> 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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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<nsILocalFile> 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());
|
||||
}
|
||||
|
||||
|
|
|
@ -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 <nsILocalFile> soundFile;
|
||||
rv = NS_NewLocalFile(aSoundAlias, PR_TRUE,
|
||||
rv = NS_NewLocalFile(aSoundAlias, true,
|
||||
getter_AddRefs(soundFile));
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -71,9 +71,6 @@
|
|||
#include <sys/stat.h>
|
||||
|
||||
#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 =
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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<nsIJumpListItem>& 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);
|
||||
|
||||
|
|
|
@ -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<nsIJumpListItem>& item,
|
|||
nsCOMPtr<nsIURI> 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<nsIJumpListItem>& 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<nsIJumpListShortcut>& 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<nsIFile> jumpListCache;
|
||||
|
@ -662,7 +662,7 @@ nsresult JumpListShortcut::GetJumpListShortcut(IShellLinkW *pLink, nsCOMPtr<nsIJ
|
|||
|
||||
nsCOMPtr<nsILocalFile> 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<nsILocalHandlerApp>& handlerApp
|
|||
nsresult rv;
|
||||
|
||||
if (!handlerApp)
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
|
||||
nsCOMPtr<nsIFile> executable;
|
||||
rv = handlerApp->GetExecutable(getter_AddRefs(executable));
|
||||
|
@ -822,7 +822,7 @@ bool JumpListShortcut::ExecutableExists(nsCOMPtr<nsILocalHandlerApp>& 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<nsICryptoHash> &aCryptoHash,
|
|||
rv = aCryptoHash->Update(reinterpret_cast<const PRUint8*>(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;
|
||||
|
|
|
@ -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),
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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 *
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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<TaskbarTabPreview> 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
|
||||
|
|
|
@ -57,7 +57,7 @@ bool WindowHookProc(void *aContext, HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM
|
|||
{
|
||||
TaskbarWindowPreview *preview = reinterpret_cast<TaskbarWindowPreview*>(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<TaskbarWindowPreview*>(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);
|
||||
|
|
|
@ -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<nsIXULAppInfo> 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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -50,7 +50,7 @@ class nsAppShell : public nsBaseAppShell
|
|||
public:
|
||||
nsAppShell() :
|
||||
mEventWnd(NULL),
|
||||
mNativeCallbackPending(PR_FALSE)
|
||||
mNativeCallbackPending(false)
|
||||
{}
|
||||
typedef mozilla::TimeStamp TimeStamp;
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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<PRUnichar*>(data));
|
||||
nsCOMPtr<nsILocalFile> 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<PRUnichar*>(*outData));
|
||||
nsCOMPtr<nsILocalFile> 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<PRUnichar*>(*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<PRUnichar*>(*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<PRUnichar*>(*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<PRUnichar*>(*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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<nsIStringBundleService> stringService =
|
||||
mozilla::services::GetStringBundleService();
|
||||
if (!stringService)
|
||||
return PR_FALSE;
|
||||
return false;
|
||||
|
||||
nsCOMPtr<nsIStringBundle> 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<nsISupportsArray> 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<nsDataObj *>(aClosure);
|
||||
if (timedDataObj->mCachedTempFile) {
|
||||
timedDataObj->mCachedTempFile->Remove(PR_FALSE);
|
||||
timedDataObj->mCachedTempFile->Remove(false);
|
||||
timedDataObj->mCachedTempFile = NULL;
|
||||
}
|
||||
timedDataObj->Release();
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<gfxContext> 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;i<cnt;++i) {
|
||||
IDataObject * dataObj = dataObjCol->GetDataObjectAt(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;
|
||||
|
||||
|
|
|
@ -218,7 +218,7 @@ NS_IMETHODIMP nsFilePicker::ShowW(PRInt16 *aReturnVal)
|
|||
if (mParentWidget) {
|
||||
nsIWidget *tmp = mParentWidget;
|
||||
nsWindow *parent = static_cast<nsWindow *>(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<nsWindow *>(tmp);
|
||||
parent->SuppressBlurEvents(PR_FALSE);
|
||||
parent->SuppressBlurEvents(false);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
|
|
@ -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<RECONVERTSTRING*>(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<IMECHARPOSITION*>(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<PRUint32>(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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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)))
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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<nsWindow *>(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<nsBaseDragService*>(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;
|
||||
|
|
|
@ -90,8 +90,8 @@ static PRInt32 GetTopLevelWindowActiveState(nsIFrame *aFrame)
|
|||
nsIWidget* widget = aFrame->GetNearestWidget();
|
||||
nsWindow * window = static_cast<nsWindow*>(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)) {
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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<ITfRange> 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<nsWindow*>(
|
||||
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<nsWindow*>(
|
||||
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<ITfRange> 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<ITfCompartmentMgr> 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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -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
|
||||
|
|
|
@ -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<PluginInstanceParent*>(
|
||||
|
@ -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<mozilla::layers::LayerManagerD3D10*>(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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче