Bug 1265386: Fix white-space errors in widget/, r=nfroyd

MozReview-Commit-ID: ATXI7dYFHmA
This commit is contained in:
Thomas Zimmermann 2016-07-22 10:56:13 +02:00
Родитель ade553c6cf
Коммит 48ef99e762
29 изменённых файлов: 251 добавлений и 251 удалений

Просмотреть файл

@ -63,22 +63,22 @@ nsDeviceContextSpecAndroid::EndDocument()
nsXPIDLString targetPath;
nsCOMPtr<nsIFile> destFile;
mPrintSettings->GetToFileName(getter_Copies(targetPath));
nsresult rv = NS_NewNativeLocalFile(NS_ConvertUTF16toUTF8(targetPath),
false, getter_AddRefs(destFile));
NS_ENSURE_SUCCESS(rv, rv);
nsAutoString destLeafName;
rv = destFile->GetLeafName(destLeafName);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIFile> destDir;
rv = destFile->GetParent(getter_AddRefs(destDir));
NS_ENSURE_SUCCESS(rv, rv);
rv = mTempFile->MoveTo(destDir, destLeafName);
NS_ENSURE_SUCCESS(rv, rv);
destFile->SetPermissions(0666);
return NS_OK;
}

Просмотреть файл

@ -172,7 +172,7 @@ typedef struct _nsCocoaWindowList {
@class ToolbarWindow;
// NSColor subclass that allows us to draw separate colors both in the titlebar
// NSColor subclass that allows us to draw separate colors both in the titlebar
// and for background of the window.
@interface TitlebarAndBackgroundColor : NSColor
{

Просмотреть файл

@ -127,7 +127,7 @@ nsresult nsMenuBarX::Create(nsIWidget* aParent, nsIContent* aContent)
void nsMenuBarX::ConstructNativeMenus()
{
uint32_t count = mContent->GetChildCount();
for (uint32_t i = 0; i < count; i++) {
for (uint32_t i = 0; i < count; i++) {
nsIContent *menuContent = mContent->GetChildAt(i);
if (menuContent &&
menuContent->IsXULElement(nsGkAtoms::menu)) {
@ -140,7 +140,7 @@ void nsMenuBarX::ConstructNativeMenus()
delete newMenu;
}
}
}
}
}
void nsMenuBarX::ConstructFallbackNativeMenus()
@ -270,7 +270,7 @@ void nsMenuBarX::ObserveAttributeChanged(nsIDocument* aDocument,
}
void nsMenuBarX::ObserveContentRemoved(nsIDocument* aDocument,
nsIContent* aChild,
nsIContent* aChild,
int32_t aIndexInContainer)
{
RemoveMenuAtIndex(aIndexInContainer);
@ -478,7 +478,7 @@ void nsMenuBarX::ResetNativeApplicationMenu()
void nsMenuBarX::HideItem(nsIDOMDocument* inDoc, const nsAString & inID, nsIContent** outHiddenNode)
{
nsCOMPtr<nsIDOMElement> menuItem;
inDoc->GetElementById(inID, getter_AddRefs(menuItem));
inDoc->GetElementById(inID, getter_AddRefs(menuItem));
nsCOMPtr<nsIContent> menuContent(do_QueryInterface(menuItem));
if (menuContent) {
menuContent->SetAttr(kNameSpaceID_None, nsGkAtoms::hidden, NS_LITERAL_STRING("true"), false);
@ -505,7 +505,7 @@ void nsMenuBarX::AquifyMenuBar()
HideItem(domDoc, NS_LITERAL_STRING("menu_FileQuitItem"), getter_AddRefs(mQuitItemContent));
if (!sQuitItemContent)
sQuitItemContent = mQuitItemContent;
// remove prefs item and its separator, but save off the pref content node
// so we can invoke its command later.
HideItem(domDoc, NS_LITERAL_STRING("menu_PrefsSeparator"), nullptr);
@ -586,7 +586,7 @@ NSMenuItem* nsMenuBarX::CreateNativeAppMenuItem(nsMenuX* inMenu, const nsAString
// put together the actual NSMenuItem
NSMenuItem* newMenuItem = [[NSMenuItem alloc] initWithTitle:labelString action:action keyEquivalent:keyEquiv];
[newMenuItem setTag:tag];
[newMenuItem setTarget:target];
[newMenuItem setKeyEquivalentModifierMask:macKeyModifiers];
@ -609,36 +609,36 @@ nsresult nsMenuBarX::CreateApplicationMenu(nsMenuX* inMenu)
// the nib in cocoa widgets. We do not have a way to create an application
// menu manually, so we grab the one from the nib and use that.
sApplicationMenu = [[[[NSApp mainMenu] itemAtIndex:0] submenu] retain];
/*
We support the following menu items here:
Menu Item DOM Node ID Notes
========================
= About This App = <- aboutName
========================
= Preferences... = <- menu_preferences
========================
= Services > = <- menu_mac_services <- (do not define key equivalent)
========================
========================
= Hide App = <- menu_mac_hide_app
= Hide Others = <- menu_mac_hide_others
= Show All = <- menu_mac_show_all
========================
========================
= Quit = <- menu_FileQuitItem
========================
========================
If any of them are ommitted from the application's DOM, we just don't add
them. We always add a "Quit" item, but if an app developer does not provide a
DOM node with the right ID for the Quit item, we add it in English. App
developers need only add each node with a label and a key equivalent (if they
want one). Other attributes are optional. Like so:
<menuitem id="menu_preferences"
label="&preferencesCmdMac.label;"
key="open_prefs_key"/>
We need to use this system for localization purposes, until we have a better way
to define the Application menu to be used on Mac OS X.
*/
@ -681,21 +681,21 @@ nsresult nsMenuBarX::CreateApplicationMenu(nsMenuX* inMenu)
0, nil);
if (itemBeingAdded) {
[sApplicationMenu addItem:itemBeingAdded];
// set this menu item up as the Mac OS X Services menu
NSMenu* servicesMenu = [[GeckoServicesNSMenu alloc] initWithTitle:@""];
[itemBeingAdded setSubmenu:servicesMenu];
[NSApp setServicesMenu:servicesMenu];
[itemBeingAdded release];
itemBeingAdded = nil;
// Add separator after Services menu
[sApplicationMenu addItem:[NSMenuItem separatorItem]];
[sApplicationMenu addItem:[NSMenuItem separatorItem]];
}
BOOL addHideShowSeparator = FALSE;
// Add menu item to hide this application
itemBeingAdded = CreateNativeAppMenuItem(inMenu, NS_LITERAL_STRING("menu_mac_hide_app"), @selector(menuItemHit:),
eCommand_ID_HideApp, nsMenuBarX::sNativeEventTarget);
@ -703,10 +703,10 @@ nsresult nsMenuBarX::CreateApplicationMenu(nsMenuX* inMenu)
[sApplicationMenu addItem:itemBeingAdded];
[itemBeingAdded release];
itemBeingAdded = nil;
addHideShowSeparator = TRUE;
}
// Add menu item to hide other applications
itemBeingAdded = CreateNativeAppMenuItem(inMenu, NS_LITERAL_STRING("menu_mac_hide_others"), @selector(menuItemHit:),
eCommand_ID_HideOthers, nsMenuBarX::sNativeEventTarget);
@ -714,10 +714,10 @@ nsresult nsMenuBarX::CreateApplicationMenu(nsMenuX* inMenu)
[sApplicationMenu addItem:itemBeingAdded];
[itemBeingAdded release];
itemBeingAdded = nil;
addHideShowSeparator = TRUE;
}
// Add menu item to show all applications
itemBeingAdded = CreateNativeAppMenuItem(inMenu, NS_LITERAL_STRING("menu_mac_show_all"), @selector(menuItemHit:),
eCommand_ID_ShowAll, nsMenuBarX::sNativeEventTarget);
@ -725,14 +725,14 @@ nsresult nsMenuBarX::CreateApplicationMenu(nsMenuX* inMenu)
[sApplicationMenu addItem:itemBeingAdded];
[itemBeingAdded release];
itemBeingAdded = nil;
addHideShowSeparator = TRUE;
}
// Add a separator after the hide/show menus if at least one exists
if (addHideShowSeparator)
[sApplicationMenu addItem:[NSMenuItem separatorItem]];
// Add quit menu item
itemBeingAdded = CreateNativeAppMenuItem(inMenu, NS_LITERAL_STRING("menu_FileQuitItem"), @selector(menuItemHit:),
eCommand_ID_Quit, nsMenuBarX::sNativeEventTarget);
@ -751,7 +751,7 @@ nsresult nsMenuBarX::CreateApplicationMenu(nsMenuX* inMenu)
[sApplicationMenu addItem:defaultQuitItem];
}
}
return (sApplicationMenu) ? NS_OK : NS_ERROR_FAILURE;
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;

Просмотреть файл

@ -125,12 +125,12 @@ nsresult nsMenuItemX::SetChecked(bool aIsChecked)
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
mIsChecked = aIsChecked;
// update the content model. This will also handle unchecking our siblings
// if we are a radiomenu
mContent->SetAttr(kNameSpaceID_None, nsGkAtoms::checked,
mContent->SetAttr(kNameSpaceID_None, nsGkAtoms::checked,
mIsChecked ? NS_LITERAL_STRING("true") : NS_LITERAL_STRING("false"), true);
// update native menu item
if (mIsChecked)
[mNativeMenuItem setState:NSOnState];
@ -217,14 +217,14 @@ void nsMenuItemX::UncheckRadioSiblings(nsIContent* inCheckedContent)
uint32_t count = parent->GetChildCount();
for (uint32_t i = 0; i < count; i++) {
nsIContent *sibling = parent->GetChildAt(i);
if (sibling) {
if (sibling) {
if (sibling != inCheckedContent) { // skip this node
// if the current sibling is in the same group, clear it
if (sibling->AttrValueIs(kNameSpaceID_None, nsGkAtoms::name,
myGroupName, eCaseMatters))
sibling->SetAttr(kNameSpaceID_None, nsGkAtoms::checked, NS_LITERAL_STRING("false"), true);
}
}
}
}
}
@ -289,7 +289,7 @@ nsMenuItemX::ObserveAttributeChanged(nsIDocument *aDocument, nsIContent *aConten
if (!aContent)
return;
if (aContent == mContent) { // our own content node changed
if (aAttribute == nsGkAtoms::checked) {
// if we're a radio menu, uncheck our sibling radio items. No need to
@ -330,7 +330,7 @@ nsMenuItemX::ObserveAttributeChanged(nsIDocument *aDocument, nsIContent *aConten
mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::disabled, menuDisabled);
if (!commandDisabled.Equals(menuDisabled)) {
// The menu's disabled state needs to be updated to match the command.
if (commandDisabled.IsEmpty())
if (commandDisabled.IsEmpty())
mContent->UnsetAttr(kNameSpaceID_None, nsGkAtoms::disabled, true);
else
mContent->SetAttr(kNameSpaceID_None, nsGkAtoms::disabled, commandDisabled, true);

Просмотреть файл

@ -75,7 +75,7 @@ protected:
bool OnClose();
nsresult AddMenuItem(nsMenuItemX* aMenuItem);
nsMenuX* AddMenu(mozilla::UniquePtr<nsMenuX> aMenu);
void LoadMenuItem(nsIContent* inMenuItemContent);
void LoadMenuItem(nsIContent* inMenuItemContent);
void LoadSubMenu(nsIContent* inMenuContent);
GeckoNSMenu* CreateMenuWithGeckoString(nsString& menuTitle);

Просмотреть файл

@ -119,7 +119,7 @@ nsMenuX::nsMenuX()
}
mMenuDelegate = [[MenuDelegate alloc] initWithGeckoMenu:this];
if (!nsMenuBarX::sNativeEventTarget)
nsMenuBarX::sNativeEventTarget = [[NativeMenuItemTarget alloc] init];
@ -287,7 +287,7 @@ nsresult nsMenuX::GetVisibleItemCount(uint32_t &aCount)
// If you need to iterate or search, consider using GetItemAt and doing your own filtering
nsMenuObjectX* nsMenuX::GetVisibleItemAt(uint32_t aPos)
{
uint32_t count = mMenuObjectsArray.Length();
if (aPos >= mVisibleItemsCount || aPos >= count)
return NULL;
@ -362,7 +362,7 @@ nsEventStatus nsMenuX::MenuOpened()
GetMenuPopupContent(getter_AddRefs(popupContent));
nsIContent* dispatchTo = popupContent ? popupContent : mContent;
dispatchTo->DispatchDOMEvent(&event, nullptr, nullptr, &status);
return nsEventStatus_eConsumeNoDefault;
}
@ -396,7 +396,7 @@ void nsMenuX::MenuConstruct()
{
mConstructed = false;
gConstructingMenu = true;
// reset destroy handler flag so that we'll know to fire it next time this menu goes away.
mDestroyHandlerCalled = false;
@ -564,10 +564,10 @@ bool nsMenuX::OnOpen()
nsEventStatus status = nsEventStatus_eIgnore;
WidgetMouseEvent event(true, eXULPopupShowing, nullptr,
WidgetMouseEvent::eReal);
nsCOMPtr<nsIContent> popupContent;
GetMenuPopupContent(getter_AddRefs(popupContent));
nsresult rv = NS_OK;
nsIContent* dispatchTo = popupContent ? popupContent : mContent;
rv = dispatchTo->DispatchDOMEvent(&event, nullptr, nullptr, &status);
@ -609,12 +609,12 @@ bool nsMenuX::OnClose()
nsresult rv = NS_OK;
nsIContent* dispatchTo = popupContent ? popupContent : mContent;
rv = dispatchTo->DispatchDOMEvent(&event, nullptr, nullptr, &status);
mDestroyHandlerCalled = true;
if (NS_FAILED(rv) || status == nsEventStatus_eConsumeNoDefault)
return false;
return true;
}
@ -626,7 +626,7 @@ void nsMenuX::GetMenuPopupContent(nsIContent** aResult)
if (!aResult)
return;
*aResult = nullptr;
// Check to see if we are a "menupopup" node (if we are a native menu).
{
int32_t dummy;
@ -639,7 +639,7 @@ void nsMenuX::GetMenuPopupContent(nsIContent** aResult)
}
// Otherwise check our child nodes.
uint32_t count = mContent->GetChildCount();
for (uint32_t i = 0; i < count; i++) {
@ -704,7 +704,7 @@ void nsMenuX::ObserveAttributeChanged(nsIDocument *aDocument, nsIContent *aConte
}
else if (parentType == eSubmenuObjectType) {
static_cast<nsMenuX*>(mParent)->SetRebuild(true);
}
}
else if (parentType == eStandaloneNativeMenuObjectType) {
static_cast<nsStandaloneNativeMenu*>(mParent)->GetMenuXObject()->SetRebuild(true);
}
@ -902,7 +902,7 @@ static NSMutableDictionary *gShadowKeyEquivDB = nil;
- (id)initWithItem:(NSMenuItem *)aItem table:(NSMapTable *)aTable
{
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
if (!gShadowKeyEquivDB)
gShadowKeyEquivDB = [[NSMutableDictionary alloc] init];
self = [super init];

Просмотреть файл

@ -145,7 +145,7 @@ nsScreenManagerGtk :: Init()
_XnrmQueryScreens_fn _XnrmQueryScreens = (_XnrmQueryScreens_fn)
PR_FindFunctionSymbol(mXineramalib, "XineramaQueryScreens");
// get the number of screens via xinerama
Display *display = GDK_DISPLAY_XDISPLAY(gdk_display_get_default());
if (_XnrmIsActive && _XnrmQueryScreens && _XnrmIsActive(display)) {
@ -233,7 +233,7 @@ nsScreenManagerGtk :: ScreenForId ( uint32_t aId, nsIScreen **outScreen )
//
// ScreenForRect
// ScreenForRect
//
// Returns the screen that contains the rectangle. If the rect overlaps
// multiple screens, it picks the screen with the greatest area of intersection.
@ -279,7 +279,7 @@ nsScreenManagerGtk::ScreenForRect(int32_t aX, int32_t aY,
*aOutScreen = mCachedScreenArray.SafeObjectAt(which);
NS_IF_ADDREF(*aOutScreen);
return NS_OK;
} // ScreenForRect
@ -289,8 +289,8 @@ nsScreenManagerGtk::ScreenForRect(int32_t aX, int32_t aY,
// The screen with the menubar/taskbar. This shouldn't be needed very
// often.
//
NS_IMETHODIMP
nsScreenManagerGtk :: GetPrimaryScreen(nsIScreen * *aPrimaryScreen)
NS_IMETHODIMP
nsScreenManagerGtk :: GetPrimaryScreen(nsIScreen * *aPrimaryScreen)
{
nsresult rv;
rv = EnsureInit();
@ -301,7 +301,7 @@ nsScreenManagerGtk :: GetPrimaryScreen(nsIScreen * *aPrimaryScreen)
*aPrimaryScreen = mCachedScreenArray.SafeObjectAt(0);
NS_IF_ADDREF(*aPrimaryScreen);
return NS_OK;
} // GetPrimaryScreen
@ -321,7 +321,7 @@ nsScreenManagerGtk :: GetNumberOfScreens(uint32_t *aNumberOfScreens)
}
*aNumberOfScreens = mCachedScreenArray.Count();
return NS_OK;
} // GetNumberOfScreens
NS_IMETHODIMP

Просмотреть файл

@ -184,7 +184,7 @@ nsSound::Init()
{
// This function is designed so that no library is compulsory, and
// one library missing doesn't cause the other(s) to not be used.
if (mInited)
if (mInited)
return NS_OK;
mInited = true;
@ -429,7 +429,7 @@ NS_IMETHODIMP nsSound::PlaySystemSound(const nsAString &aSoundAlias)
// create a nsIFile and then a nsIFileURL from that
nsCOMPtr <nsIFile> soundFile;
rv = NS_NewLocalFile(aSoundAlias, true,
rv = NS_NewLocalFile(aSoundAlias, true,
getter_AddRefs(soundFile));
NS_ENSURE_SUCCESS(rv,rv);

Просмотреть файл

@ -217,7 +217,7 @@ NS_DEFINE_NAMED_CID(NS_PRINTER_ENUMERATOR_CID);
NS_DEFINE_NAMED_CID(NS_PRINTSESSION_CID);
NS_DEFINE_NAMED_CID(NS_DEVICE_CONTEXT_SPEC_CID);
NS_DEFINE_NAMED_CID(NS_PRINTDIALOGSERVICE_CID);
#endif
#endif
NS_DEFINE_NAMED_CID(NS_IMAGE_TO_PIXBUF_CID);
#if defined(MOZ_X11)
NS_DEFINE_NAMED_CID(NS_IDLE_SERVICE_CID);

Просмотреть файл

@ -591,13 +591,13 @@ nsWindow::OnDestroy(void)
return;
mOnDestroyCalled = true;
// Prevent deletion.
nsCOMPtr<nsIWidget> kungFuDeathGrip = this;
// release references to children, device context, toolkit + app shell
nsBaseWidget::OnDestroy();
nsBaseWidget::OnDestroy();
// Remove association between this object and its parent and siblings.
nsBaseWidget::Destroy();
mParent = nullptr;
@ -719,9 +719,9 @@ nsWindow::Destroy(void)
}
mLayerManager = nullptr;
// It is safe to call DestroyeCompositor several times (here and
// It is safe to call DestroyeCompositor several times (here and
// in the parent class) since it will take effect only once.
// The reason we call it here is because on gtk platforms we need
// The reason we call it here is because on gtk platforms we need
// to destroy the compositor before we destroy the gdk window (which
// destroys the the gl context attached to it).
DestroyCompositor();
@ -889,7 +889,7 @@ nsWindow::ReparentNativeWidget(nsIWidget* aNewParent)
}
MOZ_ASSERT(!gdk_window_is_destroyed(mGdkWindow),
"destroyed GdkWindow with widget");
nsWindow* newParent = static_cast<nsWindow*>(aNewParent);
GdkWindow* newParentWindow = newParent->mGdkWindow;
GtkWidget* newContainer = newParent->GetMozContainerWidget();
@ -975,14 +975,14 @@ nsWindow::RegisterTouchWindow()
NS_IMETHODIMP
nsWindow::ConstrainPosition(bool aAllowSlop, int32_t *aX, int32_t *aY)
{
if (!mIsTopLevel || !mShell)
if (!mIsTopLevel || !mShell)
return NS_OK;
double dpiScale = GetDefaultScale().scale;
// we need to use the window size in logical screen pixels
int32_t logWidth = std::max(NSToIntRound(mBounds.width / dpiScale), 1);
int32_t logHeight = std::max(NSToIntRound(mBounds.height / dpiScale), 1);
int32_t logHeight = std::max(NSToIntRound(mBounds.height / dpiScale), 1);
/* get our playing field. use the current screen, or failing that
for any reason, use device caps for the default screen. */
@ -1018,7 +1018,7 @@ nsWindow::ConstrainPosition(bool aAllowSlop, int32_t *aX, int32_t *aY)
*aY = screenRect.y - logHeight + kWindowPositionSlop;
else if (*aY >= screenRect.YMost() - kWindowPositionSlop)
*aY = screenRect.YMost() - kWindowPositionSlop;
} else {
} else {
if (*aX < screenRect.x)
*aX = screenRect.x;
else if (*aX >= screenRect.XMost() - logWidth)
@ -1398,7 +1398,7 @@ nsWindow::GetLastUserInputTime()
if (sLastUserInputTime != GDK_CURRENT_TIME &&
TimestampIsNewerThan(sLastUserInputTime, timestamp)) {
return sLastUserInputTime;
}
}
return timestamp;
}
@ -1814,7 +1814,7 @@ nsWindow::SetIcon(const nsAString& aIconSpec)
return NS_OK;
nsAutoCString iconName;
if (aIconSpec.EqualsLiteral("default")) {
nsXPIDLString brandName;
GetBrandName(brandName);
@ -1823,7 +1823,7 @@ nsWindow::SetIcon(const nsAString& aIconSpec)
} else {
AppendUTF16toUTF8(aIconSpec, iconName);
}
nsCOMPtr<nsIFile> iconFile;
nsAutoCString path;
@ -3224,7 +3224,7 @@ nsWindow::OnScrollEvent(GdkEventScroll *aEvent)
// check for duplicate legacy scroll event, see GNOME bug 726878
if (aEvent->direction != GDK_SCROLL_SMOOTH &&
mLastScrollEventTime == aEvent->time)
return;
return;
#endif
WidgetWheelEvent wheelEvent(true, eWheel, this);
wheelEvent.mDeltaMode = nsIDOMWheelEvent::DOM_DELTA_LINE;
@ -3240,8 +3240,8 @@ nsWindow::OnScrollEvent(GdkEventScroll *aEvent)
wheelEvent.mDeltaX = aEvent->delta_x * 3;
wheelEvent.mDeltaY = aEvent->delta_y * 3;
wheelEvent.mIsNoLineOrPageDelta = true;
// This next step manually unsets smooth scrolling for touch devices
// that trigger GDK_SCROLL_SMOOTH. We use the slave device, which
// This next step manually unsets smooth scrolling for touch devices
// that trigger GDK_SCROLL_SMOOTH. We use the slave device, which
// represents the actual input.
GdkDevice *device = gdk_event_get_source_device((GdkEvent*)aEvent);
GdkInputSource source = gdk_device_get_source(device);
@ -3663,7 +3663,7 @@ nsWindow::Create(nsIWidget* aParent,
if (mWindowType == eWindowType_dialog) {
SetDefaultIcon();
gtk_window_set_wmclass(GTK_WINDOW(mShell), "Dialog",
gtk_window_set_wmclass(GTK_WINDOW(mShell), "Dialog",
gdk_get_program_class());
gtk_window_set_type_hint(GTK_WINDOW(mShell),
GDK_WINDOW_TYPE_HINT_DIALOG);
@ -3719,7 +3719,7 @@ nsWindow::Create(nsIWidget* aParent,
// WM_TAKE_FOCUS, focus is requested on the parent window.
gtk_widget_realize(mShell);
gdk_window_add_filter(gtk_widget_get_window(mShell),
popup_take_focus_filter, nullptr);
popup_take_focus_filter, nullptr);
#endif
}
@ -3750,7 +3750,7 @@ nsWindow::Create(nsIWidget* aParent,
}
else { // must be eWindowType_toplevel
SetDefaultIcon();
gtk_window_set_wmclass(GTK_WINDOW(mShell), "Toplevel",
gtk_window_set_wmclass(GTK_WINDOW(mShell), "Toplevel",
gdk_get_program_class());
// each toplevel window gets its own window group
@ -4031,7 +4031,7 @@ nsWindow::SetWindowClass(const nsAString &xulWinType)
const char *res_class = gdk_get_program_class();
if (!res_class)
return NS_ERROR_FAILURE;
char *res_name = ToNewCString(xulWinType);
if (!res_name)
return NS_ERROR_OUT_OF_MEMORY;
@ -4578,9 +4578,9 @@ nsWindow::ApplyTransparencyBitmap()
g_object_unref(maskBitmap);
#else
cairo_surface_t *maskBitmap;
maskBitmap = cairo_image_surface_create_for_data((unsigned char*)mTransparencyBitmap,
CAIRO_FORMAT_A1,
mTransparencyBitmapWidth,
maskBitmap = cairo_image_surface_create_for_data((unsigned char*)mTransparencyBitmap,
CAIRO_FORMAT_A1,
mTransparencyBitmapWidth,
mTransparencyBitmapHeight,
GetBitmapStride(mTransparencyBitmapWidth));
if (!maskBitmap)
@ -4766,7 +4766,7 @@ nsWindow::SetUrgencyHint(GtkWidget *top_window, bool state)
{
if (!top_window)
return;
gdk_window_set_urgency_hint(gtk_widget_get_window(top_window), state);
}
@ -4780,12 +4780,12 @@ nsWindow::SetupPluginPort(void)
return nullptr;
Window window = gdk_x11_window_get_xid(mGdkWindow);
// we have to flush the X queue here so that any plugins that
// might be running on separate X connections will be able to use
// this window in case it was just created
#ifdef MOZ_X11
XWindowAttributes xattrs;
XWindowAttributes xattrs;
Display *display = GDK_DISPLAY_XDISPLAY(gdk_display_get_default());
XGetWindowAttributes(display, window, &xattrs);
XSelectInput (display, window,
@ -4796,7 +4796,7 @@ nsWindow::SetupPluginPort(void)
XSync(display, False);
#endif /* MOZ_X11 */
return (void *)window;
}
@ -4829,7 +4829,7 @@ nsWindow::SetNonXEmbedPluginFocus()
Window curFocusWindow;
int focusState;
GdkDisplay *gdkDisplay = gdk_window_get_display(mGdkWindow);
XGetInputFocus(gdk_x11_display_get_xdisplay(gdkDisplay),
&curFocusWindow,
@ -5313,7 +5313,7 @@ get_gtk_cursor(nsCursor aCursor)
if ((gdkcursor = gCursorCache[aCursor])) {
return gdkcursor;
}
GdkDisplay *defaultDisplay = gdk_display_get_default();
// The strategy here is to use standard GDK cursors, and, if not available,
@ -5487,15 +5487,15 @@ get_gtk_cursor(nsCursor aCursor)
GdkPixbuf * cursor_pixbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8, 32, 32);
if (!cursor_pixbuf)
return nullptr;
guchar *data = gdk_pixbuf_get_pixels(cursor_pixbuf);
// Read data from GtkCursors and compose RGBA surface from 1bit bitmap and mask
// GtkCursors bits and mask are 32x32 monochrome bitmaps (1 bit for each pixel)
// so it's 128 byte array (4 bytes for are one bitmap row and there are 32 rows here).
const unsigned char *bits = GtkCursors[newType].bits;
const unsigned char *mask_bits = GtkCursors[newType].mask_bits;
for (int i = 0; i < 128; i++) {
char bit = *bits++;
char mask = *mask_bits++;
@ -5507,11 +5507,11 @@ get_gtk_cursor(nsCursor aCursor)
*data++ = (((mask >> j) & 0x01) * 0xff);
}
}
gdkcursor = gdk_cursor_new_from_pixbuf(gdk_display_get_default(), cursor_pixbuf,
GtkCursors[newType].hot_x,
GtkCursors[newType].hot_y);
g_object_unref(cursor_pixbuf);
}
@ -5542,16 +5542,16 @@ draw_window_of_widget(GtkWidget *widget, GdkWindow *aWindow, cairo_t *cr)
if (!window) {
NS_WARNING("Cannot get nsWindow from GtkWidget");
}
else {
cairo_save(cr);
gtk_cairo_transform_to_window(cr, widget, aWindow);
else {
cairo_save(cr);
gtk_cairo_transform_to_window(cr, widget, aWindow);
// TODO - window->OnExposeEvent() can destroy this or other windows,
// do we need to handle it somehow?
window->OnExposeEvent(cr);
cairo_restore(cr);
}
}
GList *children = gdk_window_get_children(aWindow);
GList *child = children;
while (child) {
@ -5562,7 +5562,7 @@ draw_window_of_widget(GtkWidget *widget, GdkWindow *aWindow, cairo_t *cr)
draw_window_of_widget(widget, window, cr);
}
child = g_list_next(child);
}
}
g_list_free(children);
}
@ -5846,7 +5846,7 @@ plugin_window_filter_func(GdkXEvent *gdk_xevent, GdkEvent *event, gpointer data)
#else
plugin_window = gdk_x11_window_lookup_for_display(
gdk_x11_lookup_xdisplay(xevent->xcreatewindow.display), xeventWindow);
#endif
#endif
if (plugin_window) {
GtkWidget *widget =
get_gtk_widget_for_gdk_window(plugin_window);
@ -5857,7 +5857,7 @@ plugin_window_filter_func(GdkXEvent *gdk_xevent, GdkEvent *event, gpointer data)
nswindow->SetPluginType(nsWindow::PluginType_NONXEMBED);
break;
}
else
else
#endif
if(GTK_IS_SOCKET(widget)) {
if (!g_object_get_data(G_OBJECT(widget), "enable-xt-focus")) {

Просмотреть файл

@ -79,12 +79,12 @@ public:
static void ReleaseGlobals();
NS_DECL_ISUPPORTS_INHERITED
void CommonCreate(nsIWidget *aParent, bool aListenForResizes);
virtual nsresult DispatchEvent(mozilla::WidgetGUIEvent* aEvent,
nsEventStatus& aStatus) override;
// called when we are destroyed
virtual void OnDestroy(void) override;
@ -100,7 +100,7 @@ public:
NS_IMETHOD Destroy(void) override;
virtual nsIWidget *GetParent() override;
virtual float GetDPI() override;
virtual double GetDefaultScaleInternal() override;
virtual double GetDefaultScaleInternal() override;
// Under Gtk, we manage windows using device pixels so no scaling is needed:
mozilla::DesktopToLayoutDeviceScale GetDesktopToDeviceScale() final
{
@ -529,7 +529,7 @@ private:
// full translucency at this time; each pixel is either fully opaque
// or fully transparent.
gchar* mTransparencyBitmap;
// all of our DND stuff
void InitDragEvent(mozilla::WidgetDragEvent& aEvent);

Просмотреть файл

@ -98,9 +98,9 @@ public:
/**
* Common widget implementation used as base class for native
* or crossplatform implementations of Widgets.
* All cross-platform behavior that all widgets need to implement
* should be placed in this class.
* or crossplatform implementations of Widgets.
* All cross-platform behavior that all widgets need to implement
* should be placed in this class.
* (Note: widget implementations are not required to use this
* class, but it gives them a head start.)
*/
@ -326,7 +326,7 @@ public:
// return true if this is a popup widget with a native titlebar
bool IsPopupWithTitleBar() const
{
return (mWindowType == eWindowType_popup &&
return (mWindowType == eWindowType_popup &&
mBorderStyle != eBorderStyle_default &&
mBorderStyle & eBorderStyle_title);
}
@ -590,7 +590,7 @@ protected:
/**
* Starts the OMTC compositor destruction sequence.
*
* When this function returns, the compositor should not be
* When this function returns, the compositor should not be
* able to access the opengl context anymore.
* It is safe to call it several times if platform implementations
* require the compositor to be destroyed before ~nsBaseWidget is

Просмотреть файл

@ -170,13 +170,13 @@ enum nsTransparencyMode {
*/
enum nsCursor { ///(normal cursor, usually rendered as an arrow)
eCursor_standard,
eCursor_standard,
///(system is busy, usually rendered as a hourglass or watch)
eCursor_wait,
eCursor_wait,
///(Selecting something, usually rendered as an IBeam)
eCursor_select,
eCursor_select,
///(can hyper-link, usually rendered as a human hand)
eCursor_hyperlink,
eCursor_hyperlink,
///(north/south/west/east edge sizing)
eCursor_n_resize,
eCursor_s_resize,
@ -212,7 +212,7 @@ enum nsCursor { ///(normal cursor, usually rendered as an arrow)
eCursor_none,
// This one better be the last one in this list.
eCursorCount
};
};
enum nsTopLevelWidgetZPlacement { // for PlaceBehind()
eZPlacementBottom = 0, // bottom of the window stack
@ -389,9 +389,9 @@ class nsIWidget : public nsISupports
ClearNativeTouchSequence(nullptr);
}
/**
* Create and initialize a widget.
* Create and initialize a widget.
*
* All the arguments can be null in which case a top level window
* with size 0 is created. The event callback function has to be
@ -400,10 +400,10 @@ class nsIWidget : public nsISupports
* hook called synchronously. The return value determines whether
* the event goes to the default window procedure or it is hidden
* to the os. The assumption is that if the event handler returns
* false the widget does not see the event. The widget should not
* automatically clear the window to the background color. The
* calling code must handle paint messages and clear the background
* itself.
* false the widget does not see the event. The widget should not
* automatically clear the window to the background color. The
* calling code must handle paint messages and clear the background
* itself.
*
* In practice at least one of aParent and aNativeParent will be null. If
* both are null the widget isn't parented (e.g. context menus or
@ -466,7 +466,7 @@ class nsIWidget : public nsISupports
bool aForceUseIWidgetParent = false) = 0;
/**
* Attach to a top level widget.
* Attach to a top level widget.
*
* In cases where a top level chrome widget is being used as a content
* container, attach a secondary listener and update the device
@ -500,7 +500,7 @@ class nsIWidget : public nsISupports
//@}
/**
* Close and destroy the internal native window.
* Close and destroy the internal native window.
* This method does not delete the widget.
*/
@ -518,12 +518,12 @@ class nsIWidget : public nsISupports
*
* Change the widget's parent. Null parents are allowed.
*
* @param aNewParent new parent
* @param aNewParent new parent
*/
NS_IMETHOD SetParent(nsIWidget* aNewParent) = 0;
/**
* Return the parent Widget of this Widget or nullptr if this is a
* Return the parent Widget of this Widget or nullptr if this is a
* top level window
*
* @return the parent widget or nullptr if it does not have a parent
@ -590,7 +590,7 @@ class nsIWidget : public nsISupports
nsIWidget* GetFirstChild() const {
return mFirstChild;
}
/**
* Return the last child of this widget. Will return null if
* there are no children.
@ -605,14 +605,14 @@ class nsIWidget : public nsISupports
nsIWidget* GetNextSibling() const {
return mNextSibling;
}
/**
* Set the next sibling of this widget
*/
void SetNextSibling(nsIWidget* aSibling) {
mNextSibling = aSibling;
}
/**
* Return the previous sibling of this widget
*/
@ -800,7 +800,7 @@ class nsIWidget : public nsISupports
virtual void SetZIndex(int32_t aZIndex) = 0;
/**
* Gets the widget's z-index.
* Gets the widget's z-index.
*/
int32_t GetZIndex()
{
@ -982,7 +982,7 @@ class nsIWidget : public nsISupports
NS_IMETHOD SetCursor(imgIContainer* aCursor,
uint32_t aHotspotX, uint32_t aHotspotY) = 0;
/**
/**
* Get the window type of this widget.
*/
nsWindowType WindowType() { return mWindowType; }
@ -1157,7 +1157,7 @@ class nsIWidget : public nsISupports
*/
virtual void SetUseBrightTitlebarForeground(bool aBrightForeground) {}
/**
/**
* Hide window chrome (borders, buttons) for this widget.
*
*/
@ -1378,10 +1378,10 @@ class nsIWidget : public nsISupports
*
*/
NS_IMETHOD EnableDragDrop(bool aEnable) = 0;
/**
* Enables/Disables system mouse capture.
* @param aCapture true enables mouse capture, false disables mouse capture
* @param aCapture true enables mouse capture, false disables mouse capture
*
*/
NS_IMETHOD CaptureMouse(bool aCapture) = 0;
@ -1395,7 +1395,7 @@ class nsIWidget : public nsISupports
* Enables/Disables system capture of any and all events that would cause a
* popup to be rolled up. aListener should be set to a non-null value for
* any popups that are not managed by the popup manager.
* @param aDoCapture true enables capture, false disables capture
* @param aDoCapture true enables capture, false disables capture
*
*/
NS_IMETHOD CaptureRollupEvents(nsIRollupListener* aListener, bool aDoCapture) = 0;
@ -1407,8 +1407,8 @@ class nsIWidget : public nsISupports
* the Mac. The notification should be suppressed if the window is already
* in the foreground and should be dismissed when the user brings this window
* to the foreground.
* @param aCycleCount Maximum number of times to animate the window per system
* conventions. If set to -1, cycles indefinitely until
* @param aCycleCount Maximum number of times to animate the window per system
* conventions. If set to -1, cycles indefinitely until
* window is brought into the foreground.
*/
NS_IMETHOD GetAttention(int32_t aCycleCount) = 0;
@ -1427,9 +1427,9 @@ class nsIWidget : public nsISupports
* Ignored on any platform that does not support it. Ignored by widgets that
* do not represent windows.
*
* @param aColor The color to set the title bar background to. Alpha values
* other than fully transparent (0) are respected if possible
* on the platform. An alpha of 0 will cause the window to
* @param aColor The color to set the title bar background to. Alpha values
* other than fully transparent (0) are respected if possible
* on the platform. An alpha of 0 will cause the window to
* draw with the default style for the platform.
*
* @param aActive Whether the color should be applied to active or inactive
@ -1705,7 +1705,7 @@ public:
* This is used for native menu system testing.
*
* Updates a native menu at the position specified by the index string.
* The index string is a string of positive integers separated by the "|"
* The index string is a string of positive integers separated by the "|"
* (pipe) character.
*
* Example: 1|0|4
@ -1752,7 +1752,7 @@ public:
/*
* Tell the plugin has focus. It is unnecessary to use IPC
*/
bool PluginHasFocus()
bool PluginHasFocus()
{
return GetInputContext().mIMEState.mEnabled == IMEState::PLUGIN;
}

Просмотреть файл

@ -435,7 +435,7 @@ GetPrefName((_a2), aPrefName), (_a3));
* or read the prefs in using the printer name to qualify.
* It is either "print.attr_name" or "print.printer_HPLasr5.attr_name"
*/
nsresult
nsresult
nsPrintOptions::ReadPrefs(nsIPrintSettings* aPS, const nsAString& aPrinterName,
uint32_t aFlags)
{
@ -731,7 +731,7 @@ nsPrintOptions::ReadPrefs(nsIPrintSettings* aPS, const nsAString& aPrinterName,
* See documentation in nsPrintOptionsImpl.h
* @update 1/12/01 rods
*/
nsresult
nsresult
nsPrintOptions::WritePrefs(nsIPrintSettings *aPS, const nsAString& aPrinterName,
uint32_t aFlags)
{
@ -796,7 +796,7 @@ nsPrintOptions::WritePrefs(nsIPrintSettings *aPS, const nsAString& aPrinterName,
int16_t sizeUnit;
double width, height;
char16_t *name;
if (
NS_SUCCEEDED(aPS->GetPaperSizeUnit(&sizeUnit)) &&
NS_SUCCEEDED(aPS->GetPaperWidth(&width)) &&
@ -1103,7 +1103,7 @@ nsPrintOptions::InitPrintSettingsFromPrinter(const char16_t *aPrinterName,
/** ---------------------------------------------------
* Helper function - Returns either the name or sets the length to zero
*/
static nsresult
static nsresult
GetAdjustedPrinterName(nsIPrintSettings* aPS, bool aUsePNP,
nsAString& aPrinterName)
{
@ -1113,7 +1113,7 @@ GetAdjustedPrinterName(nsIPrintSettings* aPS, bool aUsePNP,
if (!aUsePNP)
return NS_OK;
// Get the Printer Name from the PrintSettings
// Get the Printer Name from the PrintSettings
// to use as a prefix for Pref Names
char16_t* prtName = nullptr;
@ -1141,7 +1141,7 @@ GetAdjustedPrinterName(nsIPrintSettings* aPS, bool aUsePNP,
}
#endif
NS_IMETHODIMP
NS_IMETHODIMP
nsPrintOptions::InitPrintSettingsFromPrefs(nsIPrintSettings* aPS,
bool aUsePNP, uint32_t aFlags)
{

Просмотреть файл

@ -12,7 +12,7 @@ Notes to self:
*/
#include "nsTransferable.h"
#include "nsString.h"
#include "nsReadableUtils.h"
@ -28,7 +28,7 @@ Notes to self:
#include "nsXPIDLString.h"
#include "nsDirectoryServiceDefs.h"
#include "nsDirectoryService.h"
#include "nsCRT.h"
#include "nsCRT.h"
#include "nsNetUtil.h"
#include "nsIDOMNode.h"
#include "nsIOutputStream.h"
@ -52,9 +52,9 @@ size_t GetDataForFlavor (const nsTArray<DataStruct>& aArray,
}
//-------------------------------------------------------------------------
DataStruct::~DataStruct()
{
if (mCacheFileName) free(mCacheFileName);
DataStruct::~DataStruct()
{
if (mCacheFileName) free(mCacheFileName);
}
//-------------------------------------------------------------------------
@ -68,11 +68,11 @@ DataStruct::SetData ( nsISupports* aData, uint32_t aDataLen, bool aIsPrivateData
if ( NS_SUCCEEDED(WriteCache(aData, aDataLen)) )
return;
else
NS_WARNING("Oh no, couldn't write data to the cache file");
}
NS_WARNING("Oh no, couldn't write data to the cache file");
}
mData = aData;
mDataLen = aDataLen;
mDataLen = aDataLen;
}
@ -94,10 +94,10 @@ DataStruct::GetData ( nsISupports** aData, uint32_t *aDataLen )
return;
}
}
*aData = mData;
if ( mData )
NS_ADDREF(*aData);
NS_ADDREF(*aData);
*aDataLen = mDataLen;
}
@ -108,7 +108,7 @@ DataStruct::GetFileSpec(const char* aFileName)
{
nsCOMPtr<nsIFile> cacheFile;
NS_GetSpecialDirectory(NS_OS_TEMP_DIR, getter_AddRefs(cacheFile));
if (!cacheFile)
return nullptr;
@ -121,7 +121,7 @@ DataStruct::GetFileSpec(const char* aFileName)
} else {
cacheFile->AppendNative(nsDependentCString(aFileName));
}
return cacheFile.forget();
}
@ -187,12 +187,12 @@ DataStruct::ReadCache(nsISupports** aData, uint32_t* aDataLen)
auto data = mozilla::MakeUnique<char[]>(size);
if ( !data )
return NS_ERROR_OUT_OF_MEMORY;
// now read it all in
nsCOMPtr<nsIInputStream> inStr;
NS_NewLocalFileInputStream( getter_AddRefs(inStr),
cacheFile);
if (!cacheFile) return NS_ERROR_FAILURE;
nsresult rv = inStr->Read(data.get(), fileSize, aDataLen);
@ -254,7 +254,7 @@ nsTransferable::Init(nsILoadContext* aContext)
//
// GetTransferDataFlavors
//
// Returns a copy of the internal list of flavors. This does NOT take into
// Returns a copy of the internal list of flavors. This does NOT take into
// account any converter that may be registered. This list consists of
// nsISupportsCString objects so that the flavor list can be accessed from JS.
//
@ -296,7 +296,7 @@ nsTransferable::GetTransferData(const char *aFlavor, nsISupports **aData, uint32
nsresult rv = NS_OK;
nsCOMPtr<nsISupports> savedData;
// first look and see if the data is present in one of the intrinsic flavors
for (size_t i = 0; i < mDataArray.Length(); ++i) {
DataStruct& data = mDataArray.ElementAt(i);
@ -368,7 +368,7 @@ nsTransferable::GetTransferData(const char *aFlavor, nsISupports **aData, uint32
//
// Returns the data of the first flavor found. Caller is responsible for deleting the
// flavor string.
//
//
NS_IMETHODIMP
nsTransferable::GetAnyTransferData(char **aFlavor, nsISupports **aData, uint32_t *aDataLen)
{
@ -393,7 +393,7 @@ nsTransferable::GetAnyTransferData(char **aFlavor, nsISupports **aData, uint32_t
// SetTransferData
//
//
//
//
NS_IMETHODIMP
nsTransferable::SetTransferData(const char *aFlavor, nsISupports *aData, uint32_t aDataLen)
{
@ -431,7 +431,7 @@ nsTransferable::SetTransferData(const char *aFlavor, nsISupports *aData, uint32_
nsresult result = NS_ERROR_FAILURE;
if ( NS_SUCCEEDED(AddDataFlavor(aFlavor)) )
result = SetTransferData (aFlavor, aData, aDataLen);
return result;
}
@ -440,7 +440,7 @@ nsTransferable::SetTransferData(const char *aFlavor, nsISupports *aData, uint32_
// AddDataFlavor
//
// Adds a data flavor to our list with no data. Error if it already exists.
//
//
NS_IMETHODIMP
nsTransferable::AddDataFlavor(const char *aDataFlavor)
{
@ -477,7 +477,7 @@ nsTransferable::RemoveDataFlavor(const char *aDataFlavor)
/**
*
*
*
*/
NS_IMETHODIMP
@ -492,7 +492,7 @@ nsTransferable::IsLargeDataSet(bool *_retval)
/**
*
*
*
*/
NS_IMETHODIMP nsTransferable::SetConverter(nsIFormatConverter * aConverter)
@ -505,7 +505,7 @@ NS_IMETHODIMP nsTransferable::SetConverter(nsIFormatConverter * aConverter)
/**
*
*
*
*/
NS_IMETHODIMP nsTransferable::GetConverter(nsIFormatConverter * *aConverter)
@ -531,7 +531,7 @@ nsTransferable::FlavorsTransferableCanImport(nsISupportsArray **_retval)
MOZ_ASSERT(mInitialized);
NS_ENSURE_ARG_POINTER(_retval);
// Get the flavor list, and on to the end of it, append the list of flavors we
// can also get to through a converter. This is so that we can just walk the list
// in one go, looking for the desired flavor.
@ -561,7 +561,7 @@ nsTransferable::FlavorsTransferableCanImport(nsISupportsArray **_retval)
}
} // if a converter exists
return NS_OK;
return NS_OK;
} // FlavorsTransferableCanImport
@ -577,7 +577,7 @@ nsTransferable::FlavorsTransferableCanExport(nsISupportsArray **_retval)
MOZ_ASSERT(mInitialized);
NS_ENSURE_ARG_POINTER(_retval);
// Get the flavor list, and on to the end of it, append the list of flavors we
// can also get to through a converter. This is so that we can just walk the list
// in one go, looking for the desired flavor.

Просмотреть файл

@ -26,7 +26,7 @@
namespace mozilla {
namespace widget {
/*
/*
* To take advantage of what Vista+ have to offer with respect to audio,
* we need to maintain an audio session. This class wraps IAudioSessionControl
* and implements IAudioSessionEvents (for callbacks from Windows)
@ -201,7 +201,7 @@ AudioSession::Start()
MOZ_ASSERT(XRE_IsParentProcess(),
"Should only get here in a chrome process!");
nsCOMPtr<nsIStringBundleService> bundleService =
nsCOMPtr<nsIStringBundleService> bundleService =
do_GetService(NS_STRINGBUNDLE_CONTRACTID);
NS_ENSURE_TRUE(bundleService, NS_ERROR_FAILURE);
nsCOMPtr<nsIStringBundle> bundle;

Просмотреть файл

@ -48,7 +48,7 @@ JumpListBuilder::JumpListBuilder() :
mHasCommit(false)
{
::CoInitialize(nullptr);
CoCreateInstance(CLSID_DestinationList, nullptr, CLSCTX_INPROC_SERVER,
IID_ICustomDestinationList, getter_AddRefs(mJumpListMgr));
@ -148,12 +148,12 @@ NS_IMETHODIMP JumpListBuilder::InitListBuild(nsIMutableArray *removedItems, bool
return NS_OK;
}
// Ensures that we don't have old ICO files that aren't in our jump lists
// Ensures that we don't have old ICO files that aren't in our jump lists
// anymore left over in the cache.
nsresult JumpListBuilder::RemoveIconCacheForItems(nsIMutableArray *items)
nsresult JumpListBuilder::RemoveIconCacheForItems(nsIMutableArray *items)
{
NS_ENSURE_ARG_POINTER(items);
nsresult rv;
uint32_t length;
items->GetLength(&length);
@ -176,14 +176,14 @@ nsresult JumpListBuilder::RemoveIconCacheForItems(nsIMutableArray *items)
nsCOMPtr<nsIURI> uri;
rv = shortcut->GetFaviconPageUri(getter_AddRefs(uri));
if (NS_SUCCEEDED(rv) && uri) {
// The local file path is stored inside the nsIURI
// Get the nsIURI spec which stores the local path for the icon to remove
nsAutoCString spec;
nsresult rv = uri->GetSpec(spec);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIRunnable> event
nsCOMPtr<nsIRunnable> event
= new mozilla::widget::AsyncDeleteIconFromDisk(NS_ConvertUTF8toUTF16(spec));
mIOThread->Dispatch(event, NS_DISPATCH_NORMAL);
@ -202,11 +202,11 @@ nsresult JumpListBuilder::RemoveIconCacheForItems(nsIMutableArray *items)
}
// Ensures that we have no old ICO files left in the jump list cache
nsresult JumpListBuilder::RemoveIconCacheForAllItems()
nsresult JumpListBuilder::RemoveIconCacheForAllItems()
{
// Construct the path of our jump list cache
nsCOMPtr<nsIFile> jumpListCacheDir;
nsresult rv = NS_GetSpecialDirectory("ProfLDS",
nsresult rv = NS_GetSpecialDirectory("ProfLDS",
getter_AddRefs(jumpListCacheDir));
NS_ENSURE_SUCCESS(rv, rv);
rv = jumpListCacheDir->AppendNative(nsDependentCString(
@ -215,7 +215,7 @@ nsresult JumpListBuilder::RemoveIconCacheForAllItems()
nsCOMPtr<nsISimpleEnumerator> entries;
rv = jumpListCacheDir->GetDirectoryEntries(getter_AddRefs(entries));
NS_ENSURE_SUCCESS(rv, rv);
// Loop through each directory entry and remove all ICO files found
do {
bool hasMore = false;
@ -274,7 +274,7 @@ NS_IMETHODIMP JumpListBuilder::AddListToBuild(int16_t aCatType, nsIArray *items,
nsCOMPtr<nsIJumpListItem> item = do_QueryElementAt(items, i);
if (!item)
continue;
// Check for separators
// Check for separators
if (IsSeparator(item)) {
RefPtr<IShellLinkW> link;
rv = JumpListSeparator::GetSeparator(link);
@ -454,7 +454,7 @@ bool JumpListBuilder::IsSeparator(nsCOMPtr<nsIJumpListItem>& item)
item->GetType(&type);
if (NS_FAILED(item->GetType(&type)))
return false;
if (type == nsIJumpListItem::JUMPLIST_ITEM_SEPARATOR)
return true;
return false;
@ -479,7 +479,7 @@ nsresult JumpListBuilder::TransferIObjectArrayToIMutableArray(IObjectArray *objA
IShellItem * pItem = nullptr;
if (SUCCEEDED(objArray->GetAt(idx, IID_IShellLinkW, (LPVOID*)&pLink))) {
nsCOMPtr<nsIJumpListShortcut> shortcut =
nsCOMPtr<nsIJumpListShortcut> shortcut =
do_CreateInstance(kJumpListShortcutCID, &rv);
if (NS_FAILED(rv))
return NS_ERROR_UNEXPECTED;
@ -487,7 +487,7 @@ nsresult JumpListBuilder::TransferIObjectArrayToIMutableArray(IObjectArray *objA
item = do_QueryInterface(shortcut);
}
else if (SUCCEEDED(objArray->GetAt(idx, IID_IShellItem, (LPVOID*)&pItem))) {
nsCOMPtr<nsIJumpListLink> link =
nsCOMPtr<nsIJumpListLink> link =
do_CreateInstance(kJumpListLinkCID, &rv);
if (NS_FAILED(rv))
return NS_ERROR_UNEXPECTED;
@ -523,8 +523,8 @@ NS_IMETHODIMP JumpListBuilder::Observe(nsISupports* aSubject,
nsDependentString(aData).EqualsASCII(kPrefTaskbarEnabled)) {
bool enabled = Preferences::GetBool(kPrefTaskbarEnabled, true);
if (!enabled) {
nsCOMPtr<nsIRunnable> event =
nsCOMPtr<nsIRunnable> event =
new mozilla::widget::AsyncDeleteAllFaviconsFromDisk();
mIOThread->Dispatch(event, NS_DISPATCH_NORMAL);
}

Просмотреть файл

@ -105,11 +105,11 @@ public:
NS_IMETHOD Equals(nsIJumpListItem *item, bool *_retval) override;
NS_DECL_NSIJUMPLISTSHORTCUT
static nsresult GetShellLink(nsCOMPtr<nsIJumpListItem>& item,
RefPtr<IShellLinkW>& aShellLink,
static nsresult GetShellLink(nsCOMPtr<nsIJumpListItem>& item,
RefPtr<IShellLinkW>& aShellLink,
nsCOMPtr<nsIThread> &aIOThread);
static nsresult GetJumpListShortcut(IShellLinkW *pLink, nsCOMPtr<nsIJumpListShortcut>& aShortcut);
static nsresult GetOutputIconPath(nsCOMPtr<nsIURI> aFaviconPageURI,
static nsresult GetOutputIconPath(nsCOMPtr<nsIURI> aFaviconPageURI,
nsCOMPtr<nsIFile> &aICOFile);
protected:
@ -118,10 +118,10 @@ protected:
nsCOMPtr<nsILocalHandlerApp> mHandlerApp;
bool ExecutableExists(nsCOMPtr<nsILocalHandlerApp>& handlerApp);
static nsresult ObtainCachedIconFile(nsCOMPtr<nsIURI> aFaviconPageURI,
static nsresult ObtainCachedIconFile(nsCOMPtr<nsIURI> aFaviconPageURI,
nsString &aICOFilePath,
nsCOMPtr<nsIThread> &aIOThread);
static nsresult CacheIconFileFromFaviconURIAsync(nsCOMPtr<nsIURI> aFaviconPageURI,
static nsresult CacheIconFileFromFaviconURIAsync(nsCOMPtr<nsIURI> aFaviconPageURI,
nsCOMPtr<nsIFile> aICOFile,
nsCOMPtr<nsIThread> &aIOThread);
};

Просмотреть файл

@ -675,7 +675,7 @@ protected:
// When On*Composition() is called without document lock, we need to flush
// the recorded actions at quitting the method.
// AutoPendingActionAndContentFlusher class is usedful for it.
// AutoPendingActionAndContentFlusher class is usedful for it.
class MOZ_STACK_CLASS AutoPendingActionAndContentFlusher final
{
public:
@ -866,7 +866,7 @@ protected:
DWORD Cookie() const { return mCookie; }
bool OnMouseButtonEvent(ULONG aEdge, ULONG aQuadrant, DWORD aButtonStatus);
LONG RangeStart() const { return mStart; }
private:
RefPtr<ITfMouseSink> mSink;
LONG mStart;

Просмотреть файл

@ -25,7 +25,7 @@ class TaskbarPreviewButton : public nsITaskbarPreviewButton, public nsSupportsWe
{
virtual ~TaskbarPreviewButton();
public:
public:
TaskbarPreviewButton(TaskbarWindowPreview* preview, uint32_t index);
NS_DECL_ISUPPORTS

Просмотреть файл

@ -60,7 +60,7 @@ public:
}
nsCOMPtr<nsIBaseWindow> baseWindow(do_QueryInterface(docShell));
if (!baseWindow)
return NS_ERROR_FAILURE;

Просмотреть файл

@ -57,7 +57,7 @@ HWND
GetHWNDFromDOMWindow(mozIDOMWindow *dw) {
nsCOMPtr<nsIWidget> widget;
if (!dw)
if (!dw)
return nullptr;
nsCOMPtr<nsPIDOMWindowInner> window = nsPIDOMWindowInner::From(dw);
@ -125,7 +125,7 @@ class DefaultController final : public nsITaskbarPreviewController
~DefaultController() {}
HWND mWnd;
public:
DefaultController(HWND hWnd)
DefaultController(HWND hWnd)
: mWnd(hWnd)
{
}
@ -241,7 +241,7 @@ WinTaskbar::Initialize() {
return true;
}
WinTaskbar::WinTaskbar()
WinTaskbar::WinTaskbar()
: mTaskbar(nullptr) {
}
@ -456,7 +456,7 @@ WinTaskbar::CreateJumpListBuilder(nsIJumpListBuilder * *aJumpListBuilder) {
if (JumpListBuilder::sBuildingList)
return NS_ERROR_ALREADY_INITIALIZED;
nsCOMPtr<nsIJumpListBuilder> builder =
nsCOMPtr<nsIJumpListBuilder> builder =
do_CreateInstance(kJumpListBuilderCID, &rv);
if (NS_FAILED(rv))
return NS_ERROR_UNEXPECTED;
@ -479,7 +479,7 @@ WinTaskbar::PrepareFullScreen(mozIDOMWindow *aWindow, bool aFullScreen) {
HWND toplevelHWND = ::GetAncestor(GetHWNDFromDOMWindow(aWindow), GA_ROOT);
if (!toplevelHWND)
return NS_ERROR_INVALID_ARG;
return PrepareFullScreenHWND(toplevelHWND, aFullScreen);
}
@ -490,7 +490,7 @@ WinTaskbar::PrepareFullScreenHWND(void *aHWND, bool aFullScreen) {
NS_ENSURE_ARG_POINTER(aHWND);
if (!::IsWindow((HWND)aHWND))
if (!::IsWindow((HWND)aHWND))
return NS_ERROR_INVALID_ARG;
HRESULT hr = mTaskbar->MarkFullscreenWindow((HWND)aHWND, aFullScreen);

Просмотреть файл

@ -292,8 +292,8 @@ public:
* | | | window like dialog | |
* +-----------------+-------+-----------------------+-----------------------+
*/
static HWND GetTopLevelHWND(HWND aWnd,
bool aStopIfNotChild = false,
static HWND GetTopLevelHWND(HWND aWnd,
bool aStopIfNotChild = false,
bool aStopIfNotPopup = true);
/**
@ -534,9 +534,9 @@ class AsyncFaviconDataReady final : public nsIFaviconDataCallback
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIFAVICONDATACALLBACK
AsyncFaviconDataReady(nsIURI *aNewURI,
nsCOMPtr<nsIThread> &aIOThread,
AsyncFaviconDataReady(nsIURI *aNewURI,
nsCOMPtr<nsIThread> &aIOThread,
const bool aURLShortcut);
nsresult OnFaviconDataNotAvailable(void);
private:
@ -614,7 +614,7 @@ public:
nsCOMPtr<nsIThread> &aIOThread,
bool aURLShortcut);
static nsresult HashURI(nsCOMPtr<nsICryptoHash> &aCryptoHash,
static nsresult HashURI(nsCOMPtr<nsICryptoHash> &aCryptoHash,
nsIURI *aUri,
nsACString& aUriHash);
@ -622,7 +622,7 @@ public:
nsCOMPtr<nsIFile> &aICOFile,
bool aURLShortcut);
static nsresult
static nsresult
CacheIconFileFromFaviconURIAsync(nsCOMPtr<nsIURI> aFaviconPageURI,
nsCOMPtr<nsIFile> aICOFile,
nsCOMPtr<nsIThread> &aIOThread,

Просмотреть файл

@ -22,7 +22,7 @@ EXTERN_C const IID IID_IDataObjCollection;
// this way we can filter out collection objects that aren't ours
class nsIDataObjCollection : public IUnknown {
public:
};
/*
@ -30,7 +30,7 @@ public:
* can be adapted by an object derived from CfDragDrop. The CfDragDrop is
* associated with instances via SetDragDrop().
*/
class nsDataObjCollection final : public nsIDataObjCollection, public nsDataObj
{
public:

Просмотреть файл

@ -198,7 +198,7 @@ NS_IMETHODIMP nsDeviceContextSpecWin::Init(nsIWidget* aWidget,
NS_ASSERTION(printerName, "We have to have a printer name");
if (!printerName || !*printerName) return rv;
return GetDataFromPrinter(printerName, mPrintSettings);
}
@ -318,13 +318,13 @@ void nsDeviceContextSpecWin::SetDevMode(LPDEVMODEW aDevMode)
}
//------------------------------------------------------------------
void
void
nsDeviceContextSpecWin::GetDevMode(LPDEVMODEW &aDevMode)
{
aDevMode = mDevMode;
}
#define DISPLAY_LAST_ERROR
#define DISPLAY_LAST_ERROR
//----------------------------------------------------------------------------------
// Setup the object's data member with the selected printer's data
@ -344,7 +344,7 @@ nsDeviceContextSpecWin::GetDataFromPrinter(char16ptr_t aName, nsIPrintSettings*
HANDLE hPrinter = nullptr;
wchar_t *name = (wchar_t*)aName; // Windows APIs use non-const name argument
BOOL status = ::OpenPrinterW(name, &hPrinter, nullptr);
if (status) {
@ -426,7 +426,7 @@ NS_IMPL_ISUPPORTS(nsPrinterEnumeratorWin, nsIPrinterEnumerator)
//----------------------------------------------------------------------------------
// Return the Default Printer name
NS_IMETHODIMP
NS_IMETHODIMP
nsPrinterEnumeratorWin::GetDefaultPrinterName(char16_t * *aDefaultPrinterName)
{
NS_ENSURE_ARG_POINTER(aDefaultPrinterName);
@ -436,7 +436,7 @@ nsPrinterEnumeratorWin::GetDefaultPrinterName(char16_t * *aDefaultPrinterName)
return NS_OK;
}
NS_IMETHODIMP
NS_IMETHODIMP
nsPrinterEnumeratorWin::InitPrintSettingsFromPrinter(const char16_t *aPrinterName, nsIPrintSettings *aPrintSettings)
{
NS_ENSURE_ARG_POINTER(aPrinterName);
@ -498,7 +498,7 @@ nsPrinterEnumeratorWin::InitPrintSettingsFromPrinter(const char16_t *aPrinterNam
//----------------------------------------------------------------------------------
// Enumerate all the Printers from the global array and pass their
// names back (usually to script)
NS_IMETHODIMP
NS_IMETHODIMP
nsPrinterEnumeratorWin::GetPrinterNameList(nsIStringEnumerator **aPrinterNameList)
{
NS_ENSURE_ARG_POINTER(aPrinterNameList);
@ -530,7 +530,7 @@ nsPrinterEnumeratorWin::GetPrinterNameList(nsIStringEnumerator **aPrinterNameLis
//----------------------------------------------------------------------------------
// THe array hold the name and port for each printer
void
void
GlobalPrinters::ReallocatePrinters()
{
if (PrintersAreAllocated()) {
@ -541,7 +541,7 @@ GlobalPrinters::ReallocatePrinters()
}
//----------------------------------------------------------------------------------
void
void
GlobalPrinters::FreeGlobalPrinters()
{
if (mPrinters != nullptr) {
@ -554,14 +554,14 @@ GlobalPrinters::FreeGlobalPrinters()
}
//----------------------------------------------------------------------------------
nsresult
nsresult
GlobalPrinters::EnumerateNativePrinters()
{
nsresult rv = NS_ERROR_GFX_PRINTER_NO_PRINTER_AVAILABLE;
PR_PL(("-----------------------\n"));
PR_PL(("EnumerateNativePrinters\n"));
WCHAR szDefaultPrinterName[1024];
WCHAR szDefaultPrinterName[1024];
DWORD status = GetProfileStringW(L"devices", 0, L",",
szDefaultPrinterName,
ArrayLength(szDefaultPrinterName));
@ -588,18 +588,18 @@ GlobalPrinters::EnumerateNativePrinters()
//------------------------------------------------------------------
// Uses the GetProfileString to get the default printer from the registry
void
void
GlobalPrinters::GetDefaultPrinterName(nsString& aDefaultPrinterName)
{
aDefaultPrinterName.Truncate();
WCHAR szDefaultPrinterName[1024];
WCHAR szDefaultPrinterName[1024];
DWORD status = GetProfileStringW(L"windows", L"device", 0,
szDefaultPrinterName,
ArrayLength(szDefaultPrinterName));
if (status > 0) {
WCHAR comma = ',';
LPWSTR sPtr = szDefaultPrinterName;
while (*sPtr != comma && *sPtr != 0)
while (*sPtr != comma && *sPtr != 0)
sPtr++;
if (*sPtr == comma) {
*sPtr = 0;
@ -615,7 +615,7 @@ GlobalPrinters::GetDefaultPrinterName(nsString& aDefaultPrinterName)
//----------------------------------------------------------------------------------
// This goes and gets the list of available printers and puts
// the default printer at the beginning of the list
nsresult
nsresult
GlobalPrinters::EnumeratePrinterList()
{
// reallocate and get a new list each time it is asked for

Просмотреть файл

@ -73,7 +73,7 @@ nsDragService::CreateDragImage(nsIDOMNode *aDOMNode,
return false;
memset(psdi, 0, sizeof(SHDRAGIMAGE));
if (!aDOMNode)
if (!aDOMNode)
return false;
// Prepare the drag image
@ -137,7 +137,7 @@ nsDragService::CreateDragImage(nsIDOMNode *aDOMNode,
HDC hdcSrc = CreateCompatibleDC(nullptr);
void *lpBits = nullptr;
if (hdcSrc) {
psdi->hbmpDragImage =
psdi->hbmpDragImage =
::CreateDIBSection(hdcSrc, (BITMAPINFO*)&bmih, DIB_RGB_COLORS,
(void**)&lpBits, nullptr, 0);
if (psdi->hbmpDragImage && lpBits) {
@ -297,7 +297,7 @@ nsDragService::StartInvokingDragSession(IDataObject * aDataObj,
HRESULT res = ::DoDragDrop(aDataObj, nativeDragSrc, effects, &winDropRes);
// In cases where the drop operation completed outside the application, update
// the source node's nsIDOMDataTransfer dropEffect value so it is up to date.
// the source node's nsIDOMDataTransfer dropEffect value so it is up to date.
if (!mSentLocalDropEvent) {
uint32_t dropResult;
// Order is important, since multiple flags can be returned.
@ -309,9 +309,9 @@ nsDragService::StartInvokingDragSession(IDataObject * aDataObj,
dropResult = DRAGDROP_ACTION_MOVE;
else
dropResult = DRAGDROP_ACTION_NONE;
if (mDataTransfer) {
if (res == DRAGDROP_S_DROP) // Success
if (res == DRAGDROP_S_DROP) // Success
mDataTransfer->SetDropEffectInt(dropResult);
else
mDataTransfer->SetDropEffectInt(DRAGDROP_ACTION_NONE);
@ -373,7 +373,7 @@ nsDragService::GetNumDropItems(uint32_t * aNumItems)
}
else {
// If the count cannot be determined just return 0.
// This can happen if we have collection data of type
// This can happen if we have collection data of type
// MULTI_MIME ("Mozilla/IDataObjectCollectionFormat") on the clipboard
// from another process but we can't obtain an IID_IDataObjCollection
// from this process.

Просмотреть файл

@ -58,12 +58,12 @@ class nsFilePicker :
{
virtual ~nsFilePicker();
public:
nsFilePicker();
nsFilePicker();
NS_IMETHOD Init(mozIDOMWindowProxy *aParent, const nsAString& aTitle, int16_t aMode);
NS_DECL_ISUPPORTS
// IUnknown's QueryInterface
STDMETHODIMP QueryInterface(REFIID refiid, void** ppvResult);
@ -73,8 +73,8 @@ public:
NS_IMETHOD GetFile(nsIFile * *aFile);
NS_IMETHOD GetFileURL(nsIURI * *aFileURL);
NS_IMETHOD GetFiles(nsISimpleEnumerator **aFiles);
NS_IMETHOD Show(int16_t *aReturnVal);
NS_IMETHOD ShowW(int16_t *aReturnVal);
NS_IMETHOD Show(int16_t *aReturnVal);
NS_IMETHOD ShowW(int16_t *aReturnVal);
NS_IMETHOD AppendFilter(const nsAString& aTitle, const nsAString& aFilter);
// IFileDialogEvents
@ -131,7 +131,7 @@ protected:
public:
ComDlgFilterSpec() {}
~ComDlgFilterSpec() {}
const uint32_t Length() {
return mSpecList.Length();
}
@ -143,7 +143,7 @@ protected:
const COMDLG_FILTERSPEC* get() {
return mSpecList.Elements();
}
void Append(const nsAString& aTitle, const nsAString& aFilter);
private:
AutoTArray<COMDLG_FILTERSPEC, 1> mSpecList;

Просмотреть файл

@ -481,7 +481,7 @@ protected:
static bool IsTopLevelMouseExit(HWND aWnd);
virtual nsresult SetWindowClipRegion(const nsTArray<LayoutDeviceIntRect>& aRects,
bool aIntersectWithExisting) override;
nsIntRegion GetRegionToPaint(bool aForceFullRepaint,
nsIntRegion GetRegionToPaint(bool aForceFullRepaint,
PAINTSTRUCT ps, HDC aDC);
static void ActivateOtherWindowHelper(HWND aWnd);
void ClearCachedResources();
@ -567,7 +567,7 @@ protected:
// Indicates custom frames are enabled
bool mCustomNonClient;
// Cached copy of L&F's resize border
// Cached copy of L&F's resize border
int32_t mHorResizeMargin;
int32_t mVertResizeMargin;
// Height of the caption plus border

Просмотреть файл

@ -87,7 +87,7 @@ nsWindowBase::InjectTouchPoint(uint32_t aId, LayoutDeviceIntPoint& aPoint,
info.touchMask = TOUCH_MASK_CONTACTAREA|TOUCH_MASK_ORIENTATION|TOUCH_MASK_PRESSURE;
info.pressure = aPressure;
info.orientation = aOrientation;
info.pointerInfo.pointerFlags = aFlags;
info.pointerInfo.pointerType = PT_TOUCH;
info.pointerInfo.pointerId = aId;
@ -98,7 +98,7 @@ nsWindowBase::InjectTouchPoint(uint32_t aId, LayoutDeviceIntPoint& aPoint,
info.rcContact.bottom = info.pointerInfo.ptPixelLocation.y + 2;
info.rcContact.left = info.pointerInfo.ptPixelLocation.x - 2;
info.rcContact.right = info.pointerInfo.ptPixelLocation.x + 2;
if (!sInjectTouchFuncPtr(1, &info)) {
WinUtils::Log("InjectTouchInput failure. GetLastError=%d", GetLastError());
return false;