зеркало из https://github.com/mozilla/pjs.git
Bug 690700 Remove PR_TRUE/PR_FALSE from widget/src/gtk2 r=karlt
This commit is contained in:
Родитель
e72fafb94c
Коммит
4f40175547
|
@ -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,8 +77,8 @@
|
|||
|
||||
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))
|
||||
/* Ensure that the result is always equal to either true or false */
|
||||
#define MAKE_PR_BOOL(val) ((val)?(true):(false))
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
static PRLogModuleInfo *DeviceContextSpecGTKLM = PR_NewLogModule("DeviceContextSpecGTK");
|
||||
|
@ -223,7 +223,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 +440,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 +588,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 +629,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 +796,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 +816,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 +824,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 +859,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 +870,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 +881,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 +891,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 +929,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 +951,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);
|
||||
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Загрузка…
Ссылка в новой задаче