diff --git a/content/base/src/nsGkAtomList.h b/content/base/src/nsGkAtomList.h index d93224444067..642601044506 100644 --- a/content/base/src/nsGkAtomList.h +++ b/content/base/src/nsGkAtomList.h @@ -379,6 +379,7 @@ GK_ATOM(floating, "floating") GK_ATOM(floor, "floor") GK_ATOM(flowlength, "flowlength") GK_ATOM(focus, "focus") +GK_ATOM(focused, "focused") GK_ATOM(following, "following") GK_ATOM(followingSibling, "following-sibling") GK_ATOM(font, "font") @@ -429,6 +430,7 @@ GK_ATOM(height, "height") GK_ATOM(hgroup, "hgroup") GK_ATOM(hidden, "hidden") GK_ATOM(hidechrome, "hidechrome") +GK_ATOM(hidecolumnpicker, "hidecolumnpicker") GK_ATOM(high, "high") GK_ATOM(highest, "highest") GK_ATOM(horizontal, "horizontal") @@ -458,6 +460,7 @@ GK_ATOM(include, "include") GK_ATOM(includes, "includes") GK_ATOM(increment, "increment") GK_ATOM(indent, "indent") +GK_ATOM(indeterminate, "indeterminate") GK_ATOM(index, "index") GK_ATOM(infer, "infer") GK_ATOM(infinity, "infinity") @@ -635,6 +638,7 @@ GK_ATOM(onafterscriptexecute, "onafterscriptexecute") GK_ATOM(onanimationend, "onanimationend") GK_ATOM(onanimationiteration, "onanimationiteration") GK_ATOM(onanimationstart, "onanimationstart") +GK_ATOM(onAppCommand, "onAppCommand") GK_ATOM(onbeforecopy, "onbeforecopy") GK_ATOM(onbeforecut, "onbeforecut") GK_ATOM(onbeforepaste, "onbeforepaste") @@ -762,6 +766,7 @@ GK_ATOM(panel, "panel") GK_ATOM(param, "param") GK_ATOM(parameter, "parameter") GK_ATOM(parent, "parent") +GK_ATOM(parentfocused, "parentfocused") GK_ATOM(parsetype, "parsetype") GK_ATOM(pattern, "pattern") GK_ATOM(patternSeparator, "pattern-separator") @@ -854,6 +859,7 @@ GK_ATOM(rev, "rev") GK_ATOM(reverse, "reverse") GK_ATOM(reversed, "reversed") GK_ATOM(richlistbox, "richlistbox") +GK_ATOM(richlistitem, "richlistitem") GK_ATOM(right, "right") GK_ATOM(rightmargin, "rightmargin") GK_ATOM(rightpadding, "rightpadding") @@ -870,6 +876,7 @@ GK_ATOM(rule, "rule") GK_ATOM(rules, "rules") GK_ATOM(s, "s") GK_ATOM(samp, "samp") +GK_ATOM(sbattr, "sbattr") GK_ATOM(scale, "scale") GK_ATOM(scan, "scan") GK_ATOM(scheme, "scheme") @@ -882,6 +889,10 @@ GK_ATOM(script, "script") GK_ATOM(scriptEnabledBeforePrintOrPreview, "scriptEnabledBeforePrintOrPreview") GK_ATOM(scrollbar, "scrollbar") GK_ATOM(scrollbarbutton, "scrollbarbutton") +GK_ATOM(scrollbarDownBottom, "scrollbarDownBottom") +GK_ATOM(scrollbarDownTop, "scrollbarDownTop") +GK_ATOM(scrollbarUpBottom, "scrollbarUpBottom") +GK_ATOM(scrollbarUpTop, "scrollbarUpTop") GK_ATOM(scrollbox, "scrollbox") GK_ATOM(scrollcorner, "scrollcorner") GK_ATOM(scrolling, "scrolling") @@ -942,6 +953,7 @@ GK_ATOM(startsWith, "starts-with") GK_ATOM(state, "state") GK_ATOM(statedatasource, "statedatasource") GK_ATOM(staticHint, "staticHint") +GK_ATOM(statusbar, "statusbar") GK_ATOM(statustext, "statustext") GK_ATOM(stop, "stop") GK_ATOM(stretch, "stretch") @@ -1016,6 +1028,7 @@ GK_ATOM(tree, "tree") GK_ATOM(treecell, "treecell") GK_ATOM(treechildren, "treechildren") GK_ATOM(treecol, "treecol") +GK_ATOM(treecolpicker, "treecolpicker") GK_ATOM(treecols, "treecols") GK_ATOM(treeitem, "treeitem") GK_ATOM(treerow, "treerow") @@ -1903,6 +1916,19 @@ GK_ATOM(_moz_device_pixel_ratio, "-moz-device-pixel-ratio") GK_ATOM(_moz_device_orientation, "-moz-device-orientation") GK_ATOM(_moz_is_resource_document, "-moz-is-resource-document") +// application commands +GK_ATOM(Back, "Back") +GK_ATOM(Forward, "Forward") +GK_ATOM(Reload, "Reload") +GK_ATOM(Stop, "Stop") +GK_ATOM(Search, "Search") +GK_ATOM(Bookmarks, "Bookmarks") +GK_ATOM(Home, "Home") +GK_ATOM(Clear, "Clear") +GK_ATOM(VolumeUp, "VolumeUp") +GK_ATOM(VolumeDown, "VolumeDown") +GK_ATOM(Menu, "Menu") + #ifdef ACCESSIBILITY GK_ATOM(anonid, "anonid") GK_ATOM(aria_activedescendant, "aria-activedescendant") diff --git a/widget/src/android/nsToolkit.cpp b/widget/src/android/nsToolkit.cpp index af078a7dc9f8..3535373d32ae 100644 --- a/widget/src/android/nsToolkit.cpp +++ b/widget/src/android/nsToolkit.cpp @@ -38,7 +38,7 @@ #include "nsToolkit.h" #include "nsGUIEvent.h" -#include "nsWidgetAtoms.h" +#include "nsGkAtoms.h" NS_IMPL_ISUPPORTS1(nsToolkit, nsIToolkit) @@ -59,7 +59,6 @@ nsToolkit::~nsToolkit() NS_IMETHODIMP nsToolkit::Init(PRThread *aThread) { - nsWidgetAtoms::RegisterAtoms(); return NS_OK; } diff --git a/widget/src/android/nsWindow.cpp b/widget/src/android/nsWindow.cpp index e8733638da4a..0a958392a48a 100644 --- a/widget/src/android/nsWindow.cpp +++ b/widget/src/android/nsWindow.cpp @@ -57,7 +57,7 @@ using mozilla::unused; #include "nsRenderingContext.h" #include "nsIDOMSimpleGestureEvent.h" -#include "nsWidgetAtoms.h" +#include "nsGkAtoms.h" #include "nsWidgetsCID.h" #include "nsGfxCIID.h" @@ -1530,16 +1530,16 @@ nsWindow::HandleSpecialKey(AndroidGeckoEvent *ae) switch (keyCode) { case AndroidKeyEvent::KEYCODE_BACK: if (isLongPress) { - command = nsWidgetAtoms::Clear; + command = nsGkAtoms::Clear; doCommand = PR_TRUE; } break; case AndroidKeyEvent::KEYCODE_VOLUME_UP: - command = nsWidgetAtoms::VolumeUp; + command = nsGkAtoms::VolumeUp; doCommand = PR_TRUE; break; case AndroidKeyEvent::KEYCODE_VOLUME_DOWN: - command = nsWidgetAtoms::VolumeDown; + command = nsGkAtoms::VolumeDown; doCommand = PR_TRUE; break; case AndroidKeyEvent::KEYCODE_MENU: @@ -1558,12 +1558,12 @@ nsWindow::HandleSpecialKey(AndroidGeckoEvent *ae) case AndroidKeyEvent::KEYCODE_MENU: gMenu = PR_FALSE; if (!gMenuConsumed) { - command = nsWidgetAtoms::Menu; + command = nsGkAtoms::Menu; doCommand = PR_TRUE; } break; case AndroidKeyEvent::KEYCODE_SEARCH: - command = nsWidgetAtoms::Search; + command = nsGkAtoms::Search; doCommand = PR_TRUE; break; default: @@ -1572,7 +1572,7 @@ nsWindow::HandleSpecialKey(AndroidGeckoEvent *ae) } } if (doCommand) { - nsCommandEvent event(PR_TRUE, nsWidgetAtoms::onAppCommand, command, this); + nsCommandEvent event(PR_TRUE, nsGkAtoms::onAppCommand, command, this); InitEvent(event); DispatchEvent(&event); } diff --git a/widget/src/cocoa/nsMenuBarX.mm b/widget/src/cocoa/nsMenuBarX.mm index bfe41ea28e5b..4107824db9d2 100644 --- a/widget/src/cocoa/nsMenuBarX.mm +++ b/widget/src/cocoa/nsMenuBarX.mm @@ -50,7 +50,7 @@ #include "nsCOMPtr.h" #include "nsString.h" -#include "nsWidgetAtoms.h" +#include "nsGkAtoms.h" #include "nsGUIEvent.h" #include "nsObjCExceptions.h" #include "nsHashtable.h" @@ -161,7 +161,7 @@ void nsMenuBarX::ConstructNativeMenus() for (PRUint32 i = 0; i < count; i++) { nsIContent *menuContent = mContent->GetChildAt(i); if (menuContent && - menuContent->Tag() == nsWidgetAtoms::menu && + menuContent->Tag() == nsGkAtoms::menu && menuContent->IsXUL()) { nsMenuX* newMenu = new nsMenuX(); if (newMenu) { @@ -429,7 +429,7 @@ char nsMenuBarX::GetLocalizedAccelKey(const char *shortcutID) return 0; nsAutoString key; - shortcutContent->GetAttr(kNameSpaceID_None, nsWidgetAtoms::key, key); + shortcutContent->GetAttr(kNameSpaceID_None, nsGkAtoms::key, key); NS_LossyConvertUTF16toASCII keyASC(key.get()); const char *keyASCPtr = keyASC.get(); if (!keyASCPtr) @@ -453,7 +453,7 @@ void nsMenuBarX::HideItem(nsIDOMDocument* inDoc, const nsAString & inID, nsICont inDoc->GetElementById(inID, getter_AddRefs(menuItem)); nsCOMPtr menuContent(do_QueryInterface(menuItem)); if (menuContent) { - menuContent->SetAttr(kNameSpaceID_None, nsWidgetAtoms::hidden, NS_LITERAL_STRING("true"), false); + menuContent->SetAttr(kNameSpaceID_None, nsGkAtoms::hidden, NS_LITERAL_STRING("true"), false); if (outHiddenNode) { *outHiddenNode = menuContent.get(); NS_IF_ADDREF(*outHiddenNode); @@ -540,13 +540,13 @@ NSMenuItem* nsMenuBarX::CreateNativeAppMenuItem(nsMenuX* inMenu, const nsAString nsCOMPtr keyContent (do_QueryInterface(keyElement)); // first grab the key equivalent character nsAutoString keyChar(NS_LITERAL_STRING(" ")); - keyContent->GetAttr(kNameSpaceID_None, nsWidgetAtoms::key, keyChar); + keyContent->GetAttr(kNameSpaceID_None, nsGkAtoms::key, keyChar); if (!keyChar.EqualsLiteral(" ")) { keyEquiv = [[NSString stringWithCharacters:keyChar.get() length:keyChar.Length()] lowercaseString]; } // now grab the key equivalent modifiers nsAutoString modifiersStr; - keyContent->GetAttr(kNameSpaceID_None, nsWidgetAtoms::modifiers, modifiersStr); + keyContent->GetAttr(kNameSpaceID_None, nsGkAtoms::modifiers, modifiersStr); PRUint8 geckoModifiers = nsMenuUtilsX::GeckoModifiersForNodeAttribute(modifiersStr); macKeyModifiers = nsMenuUtilsX::MacModifiersForGeckoModifiers(geckoModifiers); } diff --git a/widget/src/cocoa/nsMenuGroupOwnerX.mm b/widget/src/cocoa/nsMenuGroupOwnerX.mm index 45954a663b75..ea6892565992 100644 --- a/widget/src/cocoa/nsMenuGroupOwnerX.mm +++ b/widget/src/cocoa/nsMenuGroupOwnerX.mm @@ -47,7 +47,6 @@ #include "nsCOMPtr.h" #include "nsString.h" -#include "nsWidgetAtoms.h" #include "nsGUIEvent.h" #include "nsObjCExceptions.h" #include "nsHashtable.h" diff --git a/widget/src/cocoa/nsMenuItemIconX.mm b/widget/src/cocoa/nsMenuItemIconX.mm index f119ffbe5205..d68e924ab032 100644 --- a/widget/src/cocoa/nsMenuItemIconX.mm +++ b/widget/src/cocoa/nsMenuItemIconX.mm @@ -48,7 +48,7 @@ #include "nsIContent.h" #include "nsIDocument.h" #include "nsINameSpaceManager.h" -#include "nsWidgetAtoms.h" +#include "nsGkAtoms.h" #include "nsIDOMElement.h" #include "nsIDOMCSSStyleDeclaration.h" #include "nsIDOMCSSValue.h" @@ -188,8 +188,8 @@ nsMenuItemIconX::GetIconURI(nsIURI** aIconURI) // First, look at the content node's "image" attribute. nsAutoString imageURIString; bool hasImageAttr = mContent->GetAttr(kNameSpaceID_None, - nsWidgetAtoms::image, - imageURIString); + nsGkAtoms::image, + imageURIString); nsresult rv; nsCOMPtr cssValue; diff --git a/widget/src/cocoa/nsMenuItemX.mm b/widget/src/cocoa/nsMenuItemX.mm index b43c05522197..82cdddc142b9 100644 --- a/widget/src/cocoa/nsMenuItemX.mm +++ b/widget/src/cocoa/nsMenuItemX.mm @@ -45,7 +45,7 @@ #include "nsObjCExceptions.h" #include "nsCOMPtr.h" -#include "nsWidgetAtoms.h" +#include "nsGkAtoms.h" #include "nsGUIEvent.h" #include "mozilla/dom/Element.h" @@ -109,7 +109,7 @@ nsresult nsMenuItemX::Create(nsMenuX* aParent, const nsString& aLabel, EMenuItem // to the command DOM node if (doc) { nsAutoString ourCommand; - mContent->GetAttr(kNameSpaceID_None, nsWidgetAtoms::command, ourCommand); + mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::command, ourCommand); if (!ourCommand.IsEmpty()) { nsIContent *commandElement = doc->GetElementById(ourCommand); @@ -126,9 +126,9 @@ nsresult nsMenuItemX::Create(nsMenuX* aParent, const nsString& aLabel, EMenuItem // on our own content bool isEnabled; if (mCommandContent) - isEnabled = !mCommandContent->AttrValueIs(kNameSpaceID_None, nsWidgetAtoms::disabled, nsWidgetAtoms::_true, eCaseMatters); + isEnabled = !mCommandContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::disabled, nsGkAtoms::_true, eCaseMatters); else - isEnabled = !mContent->AttrValueIs(kNameSpaceID_None, nsWidgetAtoms::disabled, nsWidgetAtoms::_true, eCaseMatters); + isEnabled = !mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::disabled, nsGkAtoms::_true, eCaseMatters); // set up the native menu item if (mType == eSeparatorMenuItemType) { @@ -140,8 +140,8 @@ nsresult nsMenuItemX::Create(nsMenuX* aParent, const nsString& aLabel, EMenuItem [mNativeMenuItem setEnabled:(BOOL)isEnabled]; - SetChecked(mContent->AttrValueIs(kNameSpaceID_None, nsWidgetAtoms::checked, - nsWidgetAtoms::_true, eCaseMatters)); + SetChecked(mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::checked, + nsGkAtoms::_true, eCaseMatters)); SetKeyEquiv(); } @@ -162,7 +162,7 @@ nsresult nsMenuItemX::SetChecked(bool aIsChecked) // update the content model. This will also handle unchecking our siblings // if we are a radiomenu - mContent->SetAttr(kNameSpaceID_None, nsWidgetAtoms::checked, + mContent->SetAttr(kNameSpaceID_None, nsGkAtoms::checked, mIsChecked ? NS_LITERAL_STRING("true") : NS_LITERAL_STRING("false"), true); // update native menu item @@ -188,8 +188,8 @@ void nsMenuItemX::DoCommand() // flip "checked" state if we're a checkbox menu, or an un-checked radio menu if (mType == eCheckboxMenuItemType || (mType == eRadioMenuItemType && !mIsChecked)) { - if (!mContent->AttrValueIs(kNameSpaceID_None, nsWidgetAtoms::autocheck, - nsWidgetAtoms::_false, eCaseMatters)) + if (!mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::autocheck, + nsGkAtoms::_false, eCaseMatters)) SetChecked(!mIsChecked); /* the AttributeChanged code will update all the internal state */ } @@ -245,7 +245,7 @@ nsresult nsMenuItemX::DispatchDOMEvent(const nsString &eventName, bool *preventD void nsMenuItemX::UncheckRadioSiblings(nsIContent* inCheckedContent) { nsAutoString myGroupName; - inCheckedContent->GetAttr(kNameSpaceID_None, nsWidgetAtoms::name, myGroupName); + inCheckedContent->GetAttr(kNameSpaceID_None, nsGkAtoms::name, myGroupName); if (!myGroupName.Length()) // no groupname, nothing to do return; @@ -260,9 +260,9 @@ void nsMenuItemX::UncheckRadioSiblings(nsIContent* inCheckedContent) if (sibling) { if (sibling != inCheckedContent) { // skip this node // if the current sibling is in the same group, clear it - if (sibling->AttrValueIs(kNameSpaceID_None, nsWidgetAtoms::name, + if (sibling->AttrValueIs(kNameSpaceID_None, nsGkAtoms::name, myGroupName, eCaseMatters)) - sibling->SetAttr(kNameSpaceID_None, nsWidgetAtoms::checked, NS_LITERAL_STRING("false"), true); + sibling->SetAttr(kNameSpaceID_None, nsGkAtoms::checked, NS_LITERAL_STRING("false"), true); } } } @@ -274,15 +274,15 @@ void nsMenuItemX::SetKeyEquiv() // Set key shortcut and modifiers nsAutoString keyValue; - mContent->GetAttr(kNameSpaceID_None, nsWidgetAtoms::key, keyValue); + mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::key, keyValue); if (!keyValue.IsEmpty() && mContent->GetCurrentDoc()) { nsIContent *keyContent = mContent->GetCurrentDoc()->GetElementById(keyValue); if (keyContent) { nsAutoString keyChar(NS_LITERAL_STRING(" ")); - keyContent->GetAttr(kNameSpaceID_None, nsWidgetAtoms::key, keyChar); + keyContent->GetAttr(kNameSpaceID_None, nsGkAtoms::key, keyChar); nsAutoString modifiersStr; - keyContent->GetAttr(kNameSpaceID_None, nsWidgetAtoms::modifiers, modifiersStr); + keyContent->GetAttr(kNameSpaceID_None, nsGkAtoms::modifiers, modifiersStr); PRUint8 modifiers = nsMenuUtilsX::GeckoModifiersForNodeAttribute(modifiersStr); unsigned int macModifiers = nsMenuUtilsX::MacModifiersForGeckoModifiers(modifiers); @@ -318,29 +318,29 @@ nsMenuItemX::ObserveAttributeChanged(nsIDocument *aDocument, nsIContent *aConten return; if (aContent == mContent) { // our own content node changed - if (aAttribute == nsWidgetAtoms::checked) { + if (aAttribute == nsGkAtoms::checked) { // if we're a radio menu, uncheck our sibling radio items. No need to // do any of this if we're just a normal check menu. if (mType == eRadioMenuItemType) { - if (mContent->AttrValueIs(kNameSpaceID_None, nsWidgetAtoms::checked, - nsWidgetAtoms::_true, eCaseMatters)) + if (mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::checked, + nsGkAtoms::_true, eCaseMatters)) UncheckRadioSiblings(mContent); } mMenuParent->SetRebuild(true); } - else if (aAttribute == nsWidgetAtoms::hidden || - aAttribute == nsWidgetAtoms::collapsed || - aAttribute == nsWidgetAtoms::label) { + else if (aAttribute == nsGkAtoms::hidden || + aAttribute == nsGkAtoms::collapsed || + aAttribute == nsGkAtoms::label) { mMenuParent->SetRebuild(true); } - else if (aAttribute == nsWidgetAtoms::key) { + else if (aAttribute == nsGkAtoms::key) { SetKeyEquiv(); } - else if (aAttribute == nsWidgetAtoms::image) { + else if (aAttribute == nsGkAtoms::image) { SetupIcon(); } - else if (aAttribute == nsWidgetAtoms::disabled) { - if (aContent->AttrValueIs(kNameSpaceID_None, nsWidgetAtoms::disabled, nsWidgetAtoms::_true, eCaseMatters)) + else if (aAttribute == nsGkAtoms::disabled) { + if (aContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::disabled, nsGkAtoms::_true, eCaseMatters)) [mNativeMenuItem setEnabled:NO]; else [mNativeMenuItem setEnabled:YES]; @@ -349,21 +349,21 @@ nsMenuItemX::ObserveAttributeChanged(nsIDocument *aDocument, nsIContent *aConten else if (aContent == mCommandContent) { // the only thing that really matters when the menu isn't showing is the // enabled state since it enables/disables keyboard commands - if (aAttribute == nsWidgetAtoms::disabled) { + if (aAttribute == nsGkAtoms::disabled) { // first we sync our menu item DOM node with the command DOM node nsAutoString commandDisabled; nsAutoString menuDisabled; - aContent->GetAttr(kNameSpaceID_None, nsWidgetAtoms::disabled, commandDisabled); - mContent->GetAttr(kNameSpaceID_None, nsWidgetAtoms::disabled, menuDisabled); + aContent->GetAttr(kNameSpaceID_None, nsGkAtoms::disabled, commandDisabled); + 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()) - mContent->UnsetAttr(kNameSpaceID_None, nsWidgetAtoms::disabled, true); + mContent->UnsetAttr(kNameSpaceID_None, nsGkAtoms::disabled, true); else - mContent->SetAttr(kNameSpaceID_None, nsWidgetAtoms::disabled, commandDisabled, true); + mContent->SetAttr(kNameSpaceID_None, nsGkAtoms::disabled, commandDisabled, true); } // now we sync our native menu item with the command DOM node - if (aContent->AttrValueIs(kNameSpaceID_None, nsWidgetAtoms::disabled, nsWidgetAtoms::_true, eCaseMatters)) + if (aContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::disabled, nsGkAtoms::_true, eCaseMatters)) [mNativeMenuItem setEnabled:NO]; else [mNativeMenuItem setEnabled:YES]; diff --git a/widget/src/cocoa/nsMenuUtilsX.mm b/widget/src/cocoa/nsMenuUtilsX.mm index e4b042423f5d..4cda5511cfc7 100644 --- a/widget/src/cocoa/nsMenuUtilsX.mm +++ b/widget/src/cocoa/nsMenuUtilsX.mm @@ -44,7 +44,7 @@ #include "nsObjCExceptions.h" #include "nsCocoaUtils.h" #include "nsCocoaWindow.h" -#include "nsWidgetAtoms.h" +#include "nsGkAtoms.h" #include "nsIDocument.h" #include "nsIDOMDocument.h" #include "nsIDOMEventTarget.h" @@ -204,10 +204,10 @@ NSMenuItem* nsMenuUtilsX::GetStandardEditMenuItem() bool nsMenuUtilsX::NodeIsHiddenOrCollapsed(nsIContent* inContent) { - return (inContent->AttrValueIs(kNameSpaceID_None, nsWidgetAtoms::hidden, - nsWidgetAtoms::_true, eCaseMatters) || - inContent->AttrValueIs(kNameSpaceID_None, nsWidgetAtoms::collapsed, - nsWidgetAtoms::_true, eCaseMatters)); + return (inContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::hidden, + nsGkAtoms::_true, eCaseMatters) || + inContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::collapsed, + nsGkAtoms::_true, eCaseMatters)); } // Determines how many items are visible among the siblings in a menu that are diff --git a/widget/src/cocoa/nsMenuX.mm b/widget/src/cocoa/nsMenuX.mm index 5de2b65256ff..947f4bdaeac8 100644 --- a/widget/src/cocoa/nsMenuX.mm +++ b/widget/src/cocoa/nsMenuX.mm @@ -54,7 +54,7 @@ #include "nsReadableUtils.h" #include "nsUnicharUtils.h" #include "plstr.h" -#include "nsWidgetAtoms.h" +#include "nsGkAtoms.h" #include "nsGUIEvent.h" #include "nsCRT.h" @@ -189,7 +189,7 @@ nsresult nsMenuX::Create(nsMenuObjectX* aParent, nsMenuGroupOwnerX* aMenuGroupOw NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT; mContent = aNode; - mContent->GetAttr(kNameSpaceID_None, nsWidgetAtoms::label, mLabel); + mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::label, mLabel); mNativeMenu = CreateMenuWithGeckoString(mLabel); // register this menu to be notified when changes are made to our content object @@ -216,8 +216,8 @@ nsresult nsMenuX::Create(nsMenuObjectX* aParent, nsMenuGroupOwnerX* aMenuGroupOw mNativeMenuItem = [[NSMenuItem alloc] initWithTitle:newCocoaLabelString action:nil keyEquivalent:@""]; [mNativeMenuItem setSubmenu:mNativeMenu]; - SetEnabled(!mContent->AttrValueIs(kNameSpaceID_None, nsWidgetAtoms::disabled, - nsWidgetAtoms::_true, eCaseMatters)); + SetEnabled(!mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::disabled, + nsGkAtoms::_true, eCaseMatters)); // We call MenuConstruct here because keyboard commands are dependent upon // native menu items being created. If we only call MenuConstruct when a menu @@ -367,7 +367,7 @@ nsresult nsMenuX::RemoveAll() nsEventStatus nsMenuX::MenuOpened() { // Open the node. - mContent->SetAttr(kNameSpaceID_None, nsWidgetAtoms::open, NS_LITERAL_STRING("true"), true); + mContent->SetAttr(kNameSpaceID_None, nsGkAtoms::open, NS_LITERAL_STRING("true"), true); // Fire a handler. If we're told to stop, don't build the menu at all bool keepProcessing = OnOpen(); @@ -404,7 +404,7 @@ void nsMenuX::MenuClosed() if (mNeedsRebuild) mConstructed = false; - mContent->UnsetAttr(kNameSpaceID_None, nsWidgetAtoms::open, true); + mContent->UnsetAttr(kNameSpaceID_None, nsGkAtoms::open, true); nsEventStatus status = nsEventStatus_eIgnore; nsMouseEvent event(true, NS_XUL_POPUP_HIDDEN, nsnull, nsMouseEvent::eReal); @@ -469,9 +469,9 @@ void nsMenuX::MenuConstruct() if (child) { // depending on the type, create a menu item, separator, or submenu nsIAtom *tag = child->Tag(); - if (tag == nsWidgetAtoms::menuitem || tag == nsWidgetAtoms::menuseparator) + if (tag == nsGkAtoms::menuitem || tag == nsGkAtoms::menuseparator) LoadMenuItem(child); - else if (tag == nsWidgetAtoms::menu) + else if (tag == nsGkAtoms::menu) LoadSubMenu(child); } } // for each menu item @@ -532,18 +532,18 @@ void nsMenuX::LoadMenuItem(nsIContent* inMenuItemContent) return; nsAutoString menuitemName; - inMenuItemContent->GetAttr(kNameSpaceID_None, nsWidgetAtoms::label, menuitemName); + inMenuItemContent->GetAttr(kNameSpaceID_None, nsGkAtoms::label, menuitemName); // printf("menuitem %s \n", NS_LossyConvertUTF16toASCII(menuitemName).get()); EMenuItemType itemType = eRegularMenuItemType; - if (inMenuItemContent->Tag() == nsWidgetAtoms::menuseparator) { + if (inMenuItemContent->Tag() == nsGkAtoms::menuseparator) { itemType = eSeparatorMenuItemType; } else { static nsIContent::AttrValuesArray strings[] = - {&nsWidgetAtoms::checkbox, &nsWidgetAtoms::radio, nsnull}; - switch (inMenuItemContent->FindAttrValueIn(kNameSpaceID_None, nsWidgetAtoms::type, + {&nsGkAtoms::checkbox, &nsGkAtoms::radio, nsnull}; + switch (inMenuItemContent->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::type, strings, eCaseMatters)) { case 0: itemType = eCheckboxMenuItemType; break; case 1: itemType = eRadioMenuItemType; break; @@ -621,10 +621,10 @@ bool nsMenuX::OnOpen() PRUint32 count = popupContent->GetChildCount(); for (PRUint32 i = 0; i < count; i++) { nsIContent *grandChild = popupContent->GetChildAt(i); - if (grandChild->Tag() == nsWidgetAtoms::menuitem) { + if (grandChild->Tag() == nsGkAtoms::menuitem) { // See if we have a command attribute. nsAutoString command; - grandChild->GetAttr(kNameSpaceID_None, nsWidgetAtoms::command, command); + grandChild->GetAttr(kNameSpaceID_None, nsGkAtoms::command, command); if (!command.IsEmpty()) { // We do! Look it up in our document nsCOMPtr commandElt; @@ -633,33 +633,33 @@ bool nsMenuX::OnOpen() if (commandContent) { nsAutoString commandDisabled, menuDisabled; - commandContent->GetAttr(kNameSpaceID_None, nsWidgetAtoms::disabled, commandDisabled); - grandChild->GetAttr(kNameSpaceID_None, nsWidgetAtoms::disabled, menuDisabled); + commandContent->GetAttr(kNameSpaceID_None, nsGkAtoms::disabled, commandDisabled); + grandChild->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()) - grandChild->UnsetAttr(kNameSpaceID_None, nsWidgetAtoms::disabled, true); + grandChild->UnsetAttr(kNameSpaceID_None, nsGkAtoms::disabled, true); else - grandChild->SetAttr(kNameSpaceID_None, nsWidgetAtoms::disabled, commandDisabled, true); + grandChild->SetAttr(kNameSpaceID_None, nsGkAtoms::disabled, commandDisabled, true); } // The menu's value and checked states need to be updated to match the command. // Note that (unlike the disabled state) if the command has *no* value for either, we // assume the menu is supplying its own. nsAutoString commandChecked, menuChecked; - commandContent->GetAttr(kNameSpaceID_None, nsWidgetAtoms::checked, commandChecked); - grandChild->GetAttr(kNameSpaceID_None, nsWidgetAtoms::checked, menuChecked); + commandContent->GetAttr(kNameSpaceID_None, nsGkAtoms::checked, commandChecked); + grandChild->GetAttr(kNameSpaceID_None, nsGkAtoms::checked, menuChecked); if (!commandChecked.Equals(menuChecked)) { if (!commandChecked.IsEmpty()) - grandChild->SetAttr(kNameSpaceID_None, nsWidgetAtoms::checked, commandChecked, true); + grandChild->SetAttr(kNameSpaceID_None, nsGkAtoms::checked, commandChecked, true); } nsAutoString commandValue, menuValue; - commandContent->GetAttr(kNameSpaceID_None, nsWidgetAtoms::label, commandValue); - grandChild->GetAttr(kNameSpaceID_None, nsWidgetAtoms::label, menuValue); + commandContent->GetAttr(kNameSpaceID_None, nsGkAtoms::label, commandValue); + grandChild->GetAttr(kNameSpaceID_None, nsGkAtoms::label, menuValue); if (!commandValue.Equals(menuValue)) { if (!commandValue.IsEmpty()) - grandChild->SetAttr(kNameSpaceID_None, nsWidgetAtoms::label, commandValue, true); + grandChild->SetAttr(kNameSpaceID_None, nsGkAtoms::label, commandValue, true); } } } @@ -714,7 +714,7 @@ void nsMenuX::GetMenuPopupContent(nsIContent** aResult) PRInt32 dummy; nsCOMPtr tag; xblService->ResolveTag(mContent, &dummy, getter_AddRefs(tag)); - if (tag == nsWidgetAtoms::menupopup) { + if (tag == nsGkAtoms::menupopup) { *aResult = mContent; NS_ADDREF(*aResult); return; @@ -730,7 +730,7 @@ void nsMenuX::GetMenuPopupContent(nsIContent** aResult) nsIContent *child = mContent->GetChildAt(i); nsCOMPtr tag; xblService->ResolveTag(child, &dummy, getter_AddRefs(tag)); - if (tag == nsWidgetAtoms::menupopup) { + if (tag == nsGkAtoms::menupopup) { *aResult = child; NS_ADDREF(*aResult); return; @@ -748,7 +748,7 @@ bool nsMenuX::IsXULHelpMenu(nsIContent* aMenuContent) bool retval = false; if (aMenuContent) { nsAutoString id; - aMenuContent->GetAttr(kNameSpaceID_None, nsWidgetAtoms::id, id); + aMenuContent->GetAttr(kNameSpaceID_None, nsGkAtoms::id, id); if (id.Equals(NS_LITERAL_STRING("helpMenu"))) retval = true; } @@ -765,17 +765,17 @@ void nsMenuX::ObserveAttributeChanged(nsIDocument *aDocument, nsIContent *aConte NS_OBJC_BEGIN_TRY_ABORT_BLOCK; // ignore the |open| attribute, which is by far the most common - if (gConstructingMenu || (aAttribute == nsWidgetAtoms::open)) + if (gConstructingMenu || (aAttribute == nsGkAtoms::open)) return; nsMenuObjectTypeX parentType = mParent->MenuObjectType(); - if (aAttribute == nsWidgetAtoms::disabled) { - SetEnabled(!mContent->AttrValueIs(kNameSpaceID_None, nsWidgetAtoms::disabled, - nsWidgetAtoms::_true, eCaseMatters)); + if (aAttribute == nsGkAtoms::disabled) { + SetEnabled(!mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::disabled, + nsGkAtoms::_true, eCaseMatters)); } - else if (aAttribute == nsWidgetAtoms::label) { - mContent->GetAttr(kNameSpaceID_None, nsWidgetAtoms::label, mLabel); + else if (aAttribute == nsGkAtoms::label) { + mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::label, mLabel); // invalidate my parent. If we're a submenu parent, we have to rebuild // the parent menu in order for the changes to be picked up. If we're @@ -793,7 +793,7 @@ void nsMenuX::ObserveAttributeChanged(nsIDocument *aDocument, nsIContent *aConte static_cast(mParent)->GetMenuXObject()->SetRebuild(true); } } - else if (aAttribute == nsWidgetAtoms::hidden || aAttribute == nsWidgetAtoms::collapsed) { + else if (aAttribute == nsGkAtoms::hidden || aAttribute == nsGkAtoms::collapsed) { SetRebuild(true); bool contentIsHiddenOrCollapsed = nsMenuUtilsX::NodeIsHiddenOrCollapsed(mContent); @@ -833,7 +833,7 @@ void nsMenuX::ObserveAttributeChanged(nsIDocument *aDocument, nsIContent *aConte } } } - else if (aAttribute == nsWidgetAtoms::image) { + else if (aAttribute == nsGkAtoms::image) { SetupIcon(); } diff --git a/widget/src/cocoa/nsNativeThemeCocoa.mm b/widget/src/cocoa/nsNativeThemeCocoa.mm index cb1d58575855..7611c84aca12 100644 --- a/widget/src/cocoa/nsNativeThemeCocoa.mm +++ b/widget/src/cocoa/nsNativeThemeCocoa.mm @@ -55,7 +55,7 @@ #include "nsEventStates.h" #include "nsINameSpaceManager.h" #include "nsPresContext.h" -#include "nsWidgetAtoms.h" +#include "nsGkAtoms.h" #include "nsToolkit.h" #include "nsCocoaWindow.h" #include "nsNativeThemeColors.h" @@ -244,9 +244,9 @@ static BOOL IsToolbarStyleContainer(nsIFrame* aFrame) if (!content) return NO; - if (content->Tag() == nsWidgetAtoms::toolbar || - content->Tag() == nsWidgetAtoms::toolbox || - content->Tag() == nsWidgetAtoms::statusbar) + if (content->Tag() == nsGkAtoms::toolbar || + content->Tag() == nsGkAtoms::toolbox || + content->Tag() == nsGkAtoms::statusbar) return YES; switch (aFrame->GetStyleDisplay()->mAppearance) { @@ -1541,10 +1541,10 @@ void nsNativeThemeCocoa::GetScrollbarPressStates(nsIFrame *aFrame, nsEventStates aButtonStates[]) { static nsIContent::AttrValuesArray attributeValues[] = { - &nsWidgetAtoms::scrollbarUpTop, - &nsWidgetAtoms::scrollbarDownTop, - &nsWidgetAtoms::scrollbarUpBottom, - &nsWidgetAtoms::scrollbarDownBottom, + &nsGkAtoms::scrollbarUpTop, + &nsGkAtoms::scrollbarDownTop, + &nsGkAtoms::scrollbarUpBottom, + &nsGkAtoms::scrollbarDownBottom, nsnull }; @@ -1555,7 +1555,7 @@ nsNativeThemeCocoa::GetScrollbarPressStates(nsIFrame *aFrame, nsEventStates aBut nsIContent *childContent = childFrame->GetContent(); if (!childContent) continue; - PRInt32 attrIndex = childContent->FindAttrValueIn(kNameSpaceID_None, nsWidgetAtoms::sbattr, + PRInt32 attrIndex = childContent->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::sbattr, attributeValues, eCaseMatters); if (attrIndex < 0) continue; @@ -1579,13 +1579,13 @@ nsNativeThemeCocoa::GetScrollbarDrawInfo(HIThemeTrackDrawInfo& aTdi, nsIFrame *a { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; - PRInt32 curpos = CheckIntAttr(aFrame, nsWidgetAtoms::curpos, 0); - PRInt32 minpos = CheckIntAttr(aFrame, nsWidgetAtoms::minpos, 0); - PRInt32 maxpos = CheckIntAttr(aFrame, nsWidgetAtoms::maxpos, 100); - PRInt32 thumbSize = CheckIntAttr(aFrame, nsWidgetAtoms::pageincrement, 10); + PRInt32 curpos = CheckIntAttr(aFrame, nsGkAtoms::curpos, 0); + PRInt32 minpos = CheckIntAttr(aFrame, nsGkAtoms::minpos, 0); + PRInt32 maxpos = CheckIntAttr(aFrame, nsGkAtoms::maxpos, 100); + PRInt32 thumbSize = CheckIntAttr(aFrame, nsGkAtoms::pageincrement, 10); - bool isHorizontal = aFrame->GetContent()->AttrValueIs(kNameSpaceID_None, nsWidgetAtoms::orient, - nsWidgetAtoms::horizontal, eCaseMatters); + bool isHorizontal = aFrame->GetContent()->AttrValueIs(kNameSpaceID_None, nsGkAtoms::orient, + nsGkAtoms::horizontal, eCaseMatters); bool isSmall = aFrame->GetStyleDisplay()->mAppearance == NS_THEME_SCROLLBAR_SMALL; aTdi.version = 0; @@ -1672,7 +1672,7 @@ nsNativeThemeCocoa::GetParentScrollbarFrame(nsIFrame *aFrame) // Walk our parents to find a scrollbar frame nsIFrame *scrollbarFrame = aFrame; do { - if (scrollbarFrame->GetType() == nsWidgetAtoms::scrollbarFrame) break; + if (scrollbarFrame->GetType() == nsGkAtoms::scrollbarFrame) break; } while ((scrollbarFrame = scrollbarFrame->GetParent())); // We return null if we can't find a parent scrollbar frame @@ -1887,7 +1887,7 @@ nsNativeThemeCocoa::DrawWidgetBackground(nsRenderingContext* aContext, version: 0, itemType: kThemeMenuItemPlain, state: (IsDisabled(aFrame, eventState) ? static_cast(kThemeMenuDisabled) : - CheckBooleanAttr(aFrame, nsWidgetAtoms::mozmenuactive) ? + CheckBooleanAttr(aFrame, nsGkAtoms::menuactive) ? static_cast(kThemeMenuSelected) : static_cast(kThemeMenuActive)) }; @@ -1904,7 +1904,7 @@ nsNativeThemeCocoa::DrawWidgetBackground(nsRenderingContext* aContext, menuState = kThemeMenuDisabled; } else { - menuState = CheckBooleanAttr(aFrame, nsWidgetAtoms::mozmenuactive) ? + menuState = CheckBooleanAttr(aFrame, nsGkAtoms::menuactive) ? kThemeMenuSelected : kThemeMenuActive; } @@ -1949,11 +1949,11 @@ nsNativeThemeCocoa::DrawWidgetBackground(nsRenderingContext* aContext, case NS_THEME_SPINNER: { ThemeDrawState state = kThemeStateActive; nsIContent* content = aFrame->GetContent(); - if (content->AttrValueIs(kNameSpaceID_None, nsWidgetAtoms::state, + if (content->AttrValueIs(kNameSpaceID_None, nsGkAtoms::state, NS_LITERAL_STRING("up"), eCaseMatters)) { state = kThemeStatePressedUp; } - else if (content->AttrValueIs(kNameSpaceID_None, nsWidgetAtoms::state, + else if (content->AttrValueIs(kNameSpaceID_None, nsGkAtoms::state, NS_LITERAL_STRING("down"), eCaseMatters)) { state = kThemeStatePressedDown; } @@ -2104,14 +2104,14 @@ nsNativeThemeCocoa::DrawWidgetBackground(nsRenderingContext* aContext, case NS_THEME_SCALE_HORIZONTAL: case NS_THEME_SCALE_VERTICAL: { - PRInt32 curpos = CheckIntAttr(aFrame, nsWidgetAtoms::curpos, 0); - PRInt32 minpos = CheckIntAttr(aFrame, nsWidgetAtoms::minpos, 0); - PRInt32 maxpos = CheckIntAttr(aFrame, nsWidgetAtoms::maxpos, 100); + PRInt32 curpos = CheckIntAttr(aFrame, nsGkAtoms::curpos, 0); + PRInt32 minpos = CheckIntAttr(aFrame, nsGkAtoms::minpos, 0); + PRInt32 maxpos = CheckIntAttr(aFrame, nsGkAtoms::maxpos, 100); if (!maxpos) maxpos = 100; bool reverse = aFrame->GetContent()-> - AttrValueIs(kNameSpaceID_None, nsWidgetAtoms::dir, + AttrValueIs(kNameSpaceID_None, nsGkAtoms::dir, NS_LITERAL_STRING("reverse"), eCaseMatters); DrawScale(cgContext, macRect, eventState, (aWidgetType == NS_THEME_SCALE_VERTICAL), reverse, @@ -2655,14 +2655,14 @@ nsNativeThemeCocoa::WidgetStateChanged(nsIFrame* aFrame, PRUint8 aWidgetType, // Check the attribute to see if it's relevant. // disabled, checked, dlgtype, default, etc. *aShouldRepaint = false; - if (aAttribute == nsWidgetAtoms::disabled || - aAttribute == nsWidgetAtoms::checked || - aAttribute == nsWidgetAtoms::selected || - aAttribute == nsWidgetAtoms::mozmenuactive || - aAttribute == nsWidgetAtoms::sortdirection || - aAttribute == nsWidgetAtoms::focused || - aAttribute == nsWidgetAtoms::_default || - aAttribute == nsWidgetAtoms::open) + if (aAttribute == nsGkAtoms::disabled || + aAttribute == nsGkAtoms::checked || + aAttribute == nsGkAtoms::selected || + aAttribute == nsGkAtoms::menuactive || + aAttribute == nsGkAtoms::sortDirection || + aAttribute == nsGkAtoms::focused || + aAttribute == nsGkAtoms::_default || + aAttribute == nsGkAtoms::open) *aShouldRepaint = true; } @@ -2690,7 +2690,7 @@ nsNativeThemeCocoa::ThemeSupportsWidget(nsPresContext* aPresContext, nsIFrame* a // if this is a dropdown button in a combobox the answer is always no if (aWidgetType == NS_THEME_DROPDOWN_BUTTON) { nsIFrame* parentFrame = aFrame->GetParent(); - if (parentFrame && (parentFrame->GetType() == nsWidgetAtoms::comboboxControlFrame)) + if (parentFrame && (parentFrame->GetType() == nsGkAtoms::comboboxControlFrame)) return false; } @@ -2765,7 +2765,7 @@ nsNativeThemeCocoa::ThemeSupportsWidget(nsPresContext* aPresContext, nsIFrame* a case NS_THEME_RESIZER: { nsIFrame* parentFrame = aFrame->GetParent(); - if (!parentFrame || parentFrame->GetType() != nsWidgetAtoms::scrollFrame) + if (!parentFrame || parentFrame->GetType() != nsGkAtoms::scrollFrame) return true; // Note that IsWidgetStyled is not called for resizers on Mac. This is @@ -2851,7 +2851,7 @@ nsNativeThemeCocoa::GetProgressValue(nsIFrame* aFrame) } } - return (double)CheckIntAttr(aFrame, nsWidgetAtoms::value, 0); + return (double)CheckIntAttr(aFrame, nsGkAtoms::value, 0); } double @@ -2869,5 +2869,5 @@ nsNativeThemeCocoa::GetProgressMaxValue(nsIFrame* aFrame) } } - return (double)NS_MAX(CheckIntAttr(aFrame, nsWidgetAtoms::max, 100), 1); + return (double)NS_MAX(CheckIntAttr(aFrame, nsGkAtoms::max, 100), 1); } diff --git a/widget/src/cocoa/nsStandaloneNativeMenu.mm b/widget/src/cocoa/nsStandaloneNativeMenu.mm index c2157c6cdaaf..d32b2b831e67 100644 --- a/widget/src/cocoa/nsStandaloneNativeMenu.mm +++ b/widget/src/cocoa/nsStandaloneNativeMenu.mm @@ -43,7 +43,7 @@ #include "nsIMutationObserver.h" #include "nsEvent.h" #include "nsGUIEvent.h" -#include "nsWidgetAtoms.h" +#include "nsGkAtoms.h" #include "nsContentUtils.h" #include "nsObjCExceptions.h" @@ -72,7 +72,7 @@ nsStandaloneNativeMenu::Init(nsIDOMElement * aDOMElement) nsIAtom * tag = content->Tag(); if (!content->IsXUL() || - (tag != nsWidgetAtoms::menu && tag != nsWidgetAtoms::menupopup)) + (tag != nsGkAtoms::menu && tag != nsGkAtoms::menupopup)) return NS_ERROR_FAILURE; rv = nsMenuGroupOwnerX::Create(content); diff --git a/widget/src/cocoa/nsToolkit.mm b/widget/src/cocoa/nsToolkit.mm index 2632d051f940..1667413eb95d 100644 --- a/widget/src/cocoa/nsToolkit.mm +++ b/widget/src/cocoa/nsToolkit.mm @@ -63,7 +63,7 @@ extern "C" { #include "nsCocoaUtils.h" #include "nsObjCExceptions.h" -#include "nsWidgetAtoms.h" +#include "nsGkAtoms.h" #include "nsIRollupListener.h" #include "nsIWidget.h" @@ -107,8 +107,6 @@ NS_IMPL_THREADSAFE_ISUPPORTS1(nsToolkit, nsIToolkit); NS_IMETHODIMP nsToolkit::Init(PRThread * aThread) { - nsWidgetAtoms::RegisterAtoms(); - mInited = true; RegisterForSleepWakeNotifcations(); diff --git a/widget/src/gtk2/nsNativeThemeGTK.cpp b/widget/src/gtk2/nsNativeThemeGTK.cpp index b12d8384e29e..19a430898f0c 100644 --- a/widget/src/gtk2/nsNativeThemeGTK.cpp +++ b/widget/src/gtk2/nsNativeThemeGTK.cpp @@ -57,7 +57,7 @@ #include "prlink.h" #include "nsIDOMHTMLInputElement.h" #include "nsRenderingContext.h" -#include "nsWidgetAtoms.h" +#include "nsGkAtoms.h" #include "mozilla/Services.h" #include @@ -224,8 +224,8 @@ nsNativeThemeGTK::GetGtkWidgetAndState(PRUint8 aWidgetType, nsIFrame* aFrame, if (aWidgetFlags) { if (!atom) { atom = (aWidgetType == NS_THEME_CHECKBOX || - aWidgetType == NS_THEME_CHECKBOX_LABEL) ? nsWidgetAtoms::checked - : nsWidgetAtoms::selected; + aWidgetType == NS_THEME_CHECKBOX_LABEL) ? nsGkAtoms::checked + : nsGkAtoms::selected; } *aWidgetFlags = CheckBooleanAttr(aFrame, atom); } @@ -287,8 +287,8 @@ nsNativeThemeGTK::GetGtkWidgetAndState(PRUint8 aWidgetType, nsIFrame* aFrame, // the slider to the actual scrollbar object nsIFrame *tmpFrame = aFrame->GetParent()->GetParent(); - aState->curpos = CheckIntAttr(tmpFrame, nsWidgetAtoms::curpos, 0); - aState->maxpos = CheckIntAttr(tmpFrame, nsWidgetAtoms::maxpos, 100); + aState->curpos = CheckIntAttr(tmpFrame, nsGkAtoms::curpos, 0); + aState->maxpos = CheckIntAttr(tmpFrame, nsGkAtoms::maxpos, 100); } if (aWidgetType == NS_THEME_SCROLLBAR_BUTTON_UP || @@ -297,8 +297,8 @@ nsNativeThemeGTK::GetGtkWidgetAndState(PRUint8 aWidgetType, nsIFrame* aFrame, aWidgetType == NS_THEME_SCROLLBAR_BUTTON_RIGHT) { // set the state to disabled when the scrollbar is scrolled to // the beginning or the end, depending on the button type. - PRInt32 curpos = CheckIntAttr(aFrame, nsWidgetAtoms::curpos, 0); - PRInt32 maxpos = CheckIntAttr(aFrame, nsWidgetAtoms::maxpos, 100); + PRInt32 curpos = CheckIntAttr(aFrame, nsGkAtoms::curpos, 0); + PRInt32 maxpos = CheckIntAttr(aFrame, nsGkAtoms::maxpos, 100); if ((curpos == 0 && (aWidgetType == NS_THEME_SCROLLBAR_BUTTON_UP || aWidgetType == NS_THEME_SCROLLBAR_BUTTON_LEFT)) || (curpos == maxpos && @@ -310,7 +310,7 @@ nsNativeThemeGTK::GetGtkWidgetAndState(PRUint8 aWidgetType, nsIFrame* aFrame, // 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)) + else if (CheckBooleanAttr(aFrame, nsGkAtoms::active)) aState->active = true; if (aWidgetFlags) { @@ -340,7 +340,7 @@ nsNativeThemeGTK::GetGtkWidgetAndState(PRUint8 aWidgetType, nsIFrame* aFrame, aState->inHover = menuFrame->IsOpen(); *aWidgetFlags |= MOZ_TOPLEVEL_MENU_ITEM; } else { - aState->inHover = CheckBooleanAttr(aFrame, nsWidgetAtoms::mozmenuactive); + aState->inHover = CheckBooleanAttr(aFrame, nsGkAtoms::menuactive); *aWidgetFlags &= ~MOZ_TOPLEVEL_MENU_ITEM; } @@ -351,8 +351,8 @@ nsNativeThemeGTK::GetGtkWidgetAndState(PRUint8 aWidgetType, nsIFrame* aFrame, *aWidgetFlags = 0; if (aFrame && aFrame->GetContent()) { *aWidgetFlags = aFrame->GetContent()-> - AttrValueIs(kNameSpaceID_None, nsWidgetAtoms::checked, - nsWidgetAtoms::_true, eIgnoreCase); + AttrValueIs(kNameSpaceID_None, nsGkAtoms::checked, + nsGkAtoms::_true, eIgnoreCase); } } } @@ -374,7 +374,7 @@ nsNativeThemeGTK::GetGtkWidgetAndState(PRUint8 aWidgetType, nsIFrame* aFrame, // When the input field of the drop down button has focus, some themes // should draw focus for the drop down button as well. if (aWidgetType == NS_THEME_DROPDOWN_BUTTON && aWidgetFlags) { - *aWidgetFlags = CheckBooleanAttr(aFrame, nsWidgetAtoms::parentfocused); + *aWidgetFlags = CheckBooleanAttr(aFrame, nsGkAtoms::parentfocused); } } } @@ -1282,8 +1282,8 @@ nsNativeThemeGTK::WidgetStateChanged(nsIFrame* aFrame, PRUint8 aWidgetType, aWidgetType == NS_THEME_SCROLLBAR_BUTTON_DOWN || aWidgetType == NS_THEME_SCROLLBAR_BUTTON_LEFT || aWidgetType == NS_THEME_SCROLLBAR_BUTTON_RIGHT) && - (aAttribute == nsWidgetAtoms::curpos || - aAttribute == nsWidgetAtoms::maxpos)) { + (aAttribute == nsGkAtoms::curpos || + aAttribute == nsGkAtoms::maxpos)) { *aShouldRepaint = true; return NS_OK; } @@ -1299,15 +1299,15 @@ nsNativeThemeGTK::WidgetStateChanged(nsIFrame* aFrame, PRUint8 aWidgetType, // Check the attribute to see if it's relevant. // disabled, checked, dlgtype, default, etc. *aShouldRepaint = false; - if (aAttribute == nsWidgetAtoms::disabled || - aAttribute == nsWidgetAtoms::checked || - aAttribute == nsWidgetAtoms::selected || - aAttribute == nsWidgetAtoms::focused || - aAttribute == nsWidgetAtoms::readonly || - aAttribute == nsWidgetAtoms::_default || - aAttribute == nsWidgetAtoms::mozmenuactive || - aAttribute == nsWidgetAtoms::open || - aAttribute == nsWidgetAtoms::parentfocused) + if (aAttribute == nsGkAtoms::disabled || + aAttribute == nsGkAtoms::checked || + aAttribute == nsGkAtoms::selected || + aAttribute == nsGkAtoms::focused || + aAttribute == nsGkAtoms::readonly || + aAttribute == nsGkAtoms::_default || + aAttribute == nsGkAtoms::menuactive || + aAttribute == nsGkAtoms::open || + aAttribute == nsGkAtoms::parentfocused) *aShouldRepaint = true; } diff --git a/widget/src/gtk2/nsToolkit.cpp b/widget/src/gtk2/nsToolkit.cpp index cfa39a71c04c..778be8f83fde 100644 --- a/widget/src/gtk2/nsToolkit.cpp +++ b/widget/src/gtk2/nsToolkit.cpp @@ -39,7 +39,6 @@ #include "nscore.h" // needed for 'nsnull' #include "nsGTKToolkit.h" -#include "nsWidgetAtoms.h" // // Static thread local storage index of the Toolkit @@ -105,9 +104,6 @@ GdkGC *nsGTKToolkit::GetSharedGC(void) NS_IMETHODIMP nsGTKToolkit::Init(PRThread *aThread) { CreateSharedGC(); - - nsWidgetAtoms::RegisterAtoms(); - return NS_OK; } diff --git a/widget/src/gtk2/nsWindow.cpp b/widget/src/gtk2/nsWindow.cpp index 6b2f1567d7c7..1e712dc6cfa4 100644 --- a/widget/src/gtk2/nsWindow.cpp +++ b/widget/src/gtk2/nsWindow.cpp @@ -89,7 +89,7 @@ #include "gtk2compat.h" #endif -#include "nsWidgetAtoms.h" +#include "nsGkAtoms.h" #ifdef MOZ_ENABLE_STARTUP_NOTIFICATION #define SN_API_NOT_YET_FROZEN @@ -2852,10 +2852,10 @@ nsWindow::OnButtonPressEvent(GtkWidget *aWidget, GdkEventButton *aEvent) } // Map buttons 8-9 to back/forward case 8: - DispatchCommandEvent(nsWidgetAtoms::Back); + DispatchCommandEvent(nsGkAtoms::Back); return; case 9: - DispatchCommandEvent(nsWidgetAtoms::Forward); + DispatchCommandEvent(nsGkAtoms::Forward); return; default: return; @@ -3001,7 +3001,7 @@ bool nsWindow::DispatchCommandEvent(nsIAtom* aCommand) { nsEventStatus status; - nsCommandEvent event(true, nsWidgetAtoms::onAppCommand, aCommand, this); + nsCommandEvent event(true, nsGkAtoms::onAppCommand, aCommand, this); DispatchEvent(&event, status); return TRUE; } @@ -3152,19 +3152,19 @@ nsWindow::OnKeyPressEvent(GtkWidget *aWidget, GdkEventKey *aEvent) // Look for specialized app-command keys switch (aEvent->keyval) { case XF86XK_Back: - return DispatchCommandEvent(nsWidgetAtoms::Back); + return DispatchCommandEvent(nsGkAtoms::Back); case XF86XK_Forward: - return DispatchCommandEvent(nsWidgetAtoms::Forward); + return DispatchCommandEvent(nsGkAtoms::Forward); case XF86XK_Refresh: - return DispatchCommandEvent(nsWidgetAtoms::Reload); + return DispatchCommandEvent(nsGkAtoms::Reload); case XF86XK_Stop: - return DispatchCommandEvent(nsWidgetAtoms::Stop); + return DispatchCommandEvent(nsGkAtoms::Stop); case XF86XK_Search: - return DispatchCommandEvent(nsWidgetAtoms::Search); + return DispatchCommandEvent(nsGkAtoms::Search); case XF86XK_Favorites: - return DispatchCommandEvent(nsWidgetAtoms::Bookmarks); + return DispatchCommandEvent(nsGkAtoms::Bookmarks); case XF86XK_HomePage: - return DispatchCommandEvent(nsWidgetAtoms::Home); + return DispatchCommandEvent(nsGkAtoms::Home); case XF86XK_Copy: case GDK_F16: // F16, F20, F18, F14 are old keysyms for Copy Cut Paste Undo return DispatchContentCommandEvent(NS_CONTENT_COMMAND_COPY); diff --git a/widget/src/gtk2/nsWindow.h b/widget/src/gtk2/nsWindow.h index f95aeb47d59a..17afae40833e 100644 --- a/widget/src/gtk2/nsWindow.h +++ b/widget/src/gtk2/nsWindow.h @@ -49,7 +49,7 @@ #include "nsIDragService.h" #include "nsITimer.h" -#include "nsWidgetAtoms.h" +#include "nsGkAtoms.h" #include "gfxASurface.h" diff --git a/widget/src/os2/nsToolkit.cpp b/widget/src/os2/nsToolkit.cpp index 3e22f3b103a7..4366dcc69c87 100644 --- a/widget/src/os2/nsToolkit.cpp +++ b/widget/src/os2/nsToolkit.cpp @@ -38,7 +38,6 @@ * ***** END LICENSE BLOCK ***** */ #include "nsToolkit.h" -#include "nsWidgetAtoms.h" NS_IMPL_ISUPPORTS1(nsToolkit, nsIToolkit) @@ -78,9 +77,6 @@ nsToolkit::~nsToolkit() NS_METHOD nsToolkit::Init(PRThread *aThread) { NS_ASSERTION(aThread, "Can only initialize toolkit on the current thread"); - - nsWidgetAtoms::RegisterAtoms(); - return NS_OK; } diff --git a/widget/src/os2/nsWindow.cpp b/widget/src/os2/nsWindow.cpp index ea59bbee2bee..2f6b8bd383f7 100644 --- a/widget/src/os2/nsWindow.cpp +++ b/widget/src/os2/nsWindow.cpp @@ -80,7 +80,7 @@ #include "nsOS2Uni.h" #include "nsTHashtable.h" #include "nsToolkit.h" -#include "nsWidgetAtoms.h" +#include "nsGkAtoms.h" #include "wdgtos2rc.h" #include "mozilla/Preferences.h" @@ -2801,22 +2801,22 @@ bool nsWindow::DispatchCommandEvent(PRUint32 aEventCommand) switch (aEventCommand) { case APPCOMMAND_BROWSER_BACKWARD: - command = nsWidgetAtoms::Back; + command = nsGkAtoms::Back; break; case APPCOMMAND_BROWSER_FORWARD: - command = nsWidgetAtoms::Forward; + command = nsGkAtoms::Forward; break; case APPCOMMAND_BROWSER_REFRESH: - command = nsWidgetAtoms::Reload; + command = nsGkAtoms::Reload; break; case APPCOMMAND_BROWSER_STOP: - command = nsWidgetAtoms::Stop; + command = nsGkAtoms::Stop; break; default: return PR_FALSE; } - nsCommandEvent event(PR_TRUE, nsWidgetAtoms::onAppCommand, command, this); + nsCommandEvent event(PR_TRUE, nsGkAtoms::onAppCommand, command, this); InitEvent(event); return DispatchWindowEvent(&event); } diff --git a/widget/src/qt/nsToolkit.cpp b/widget/src/qt/nsToolkit.cpp index 67186bc35e28..f823b632d206 100644 --- a/widget/src/qt/nsToolkit.cpp +++ b/widget/src/qt/nsToolkit.cpp @@ -43,8 +43,6 @@ #include "nscore.h" // needed for 'nsnull' #include "nsGUIEvent.h" -#include "nsWidgetAtoms.h" -//#include "plevent.h" // Static thread local storage index of the Toolkit // object associated with a given thread... @@ -76,8 +74,6 @@ NS_IMPL_ISUPPORTS1(nsToolkit, nsIToolkit) //------------------------------------------------------------------------- NS_IMETHODIMP nsToolkit::Init(PRThread *aThread) { - nsWidgetAtoms::RegisterAtoms(); - return NS_OK; } diff --git a/widget/src/qt/nsWindow.cpp b/widget/src/qt/nsWindow.cpp index 95222bcb005e..82fd0c40080b 100644 --- a/widget/src/qt/nsWindow.cpp +++ b/widget/src/qt/nsWindow.cpp @@ -1517,7 +1517,7 @@ is_latin_shortcut_key(quint32 aKeyval) nsEventStatus nsWindow::DispatchCommandEvent(nsIAtom* aCommand) { - nsCommandEvent event(PR_TRUE, nsWidgetAtoms::onAppCommand, aCommand, this); + nsCommandEvent event(PR_TRUE, nsGkAtoms::onAppCommand, aCommand, this); nsEventStatus status; DispatchEvent(&event, status); @@ -1673,19 +1673,19 @@ nsWindow::OnKeyPressEvent(QKeyEvent *aEvent) // Look for specialized app-command keys switch (aEvent->key()) { case Qt::Key_Back: - return DispatchCommandEvent(nsWidgetAtoms::Back); + return DispatchCommandEvent(nsGkAtoms::Back); case Qt::Key_Forward: - return DispatchCommandEvent(nsWidgetAtoms::Forward); + return DispatchCommandEvent(nsGkAtoms::Forward); case Qt::Key_Refresh: - return DispatchCommandEvent(nsWidgetAtoms::Reload); + return DispatchCommandEvent(nsGkAtoms::Reload); case Qt::Key_Stop: - return DispatchCommandEvent(nsWidgetAtoms::Stop); + return DispatchCommandEvent(nsGkAtoms::Stop); case Qt::Key_Search: - return DispatchCommandEvent(nsWidgetAtoms::Search); + return DispatchCommandEvent(nsGkAtoms::Search); case Qt::Key_Favorites: - return DispatchCommandEvent(nsWidgetAtoms::Bookmarks); + return DispatchCommandEvent(nsGkAtoms::Bookmarks); case Qt::Key_HomePage: - return DispatchCommandEvent(nsWidgetAtoms::Home); + return DispatchCommandEvent(nsGkAtoms::Home); case Qt::Key_Copy: case Qt::Key_F16: // F16, F20, F18, F14 are old keysyms for Copy Cut Paste Undo return DispatchContentCommandEvent(NS_CONTENT_COMMAND_COPY); diff --git a/widget/src/qt/nsWindow.h b/widget/src/qt/nsWindow.h index 801e9c9af4ba..eec116c00101 100644 --- a/widget/src/qt/nsWindow.h +++ b/widget/src/qt/nsWindow.h @@ -52,7 +52,7 @@ #include "nsWeakReference.h" -#include "nsWidgetAtoms.h" +#include "nsGkAtoms.h" #ifdef MOZ_LOGGING diff --git a/widget/src/windows/nsNativeThemeWin.cpp b/widget/src/windows/nsNativeThemeWin.cpp index 6930761f5d0f..7932a089195d 100644 --- a/widget/src/windows/nsNativeThemeWin.cpp +++ b/widget/src/windows/nsNativeThemeWin.cpp @@ -55,7 +55,7 @@ #include "nsINameSpaceManager.h" #include "nsIDOMHTMLInputElement.h" #include "nsMenuFrame.h" -#include "nsWidgetAtoms.h" +#include "nsGkAtoms.h" #include #include "nsWindow.h" #include "nsIComboboxControlFrame.h" @@ -535,10 +535,10 @@ nsNativeThemeWin::IsMenuActive(nsIFrame *aFrame, PRUint8 aWidgetType) { nsIContent* content = aFrame->GetContent(); if (content->IsXUL() && - content->NodeInfo()->Equals(nsWidgetAtoms::richlistitem)) - return CheckBooleanAttr(aFrame, nsWidgetAtoms::selected); + content->NodeInfo()->Equals(nsGkAtoms::richlistitem)) + return CheckBooleanAttr(aFrame, nsGkAtoms::selected); - return CheckBooleanAttr(aFrame, nsWidgetAtoms::mozmenuactive); + return CheckBooleanAttr(aFrame, nsGkAtoms::menuactive); } /** @@ -983,7 +983,7 @@ nsNativeThemeWin::GetThemePartAndState(nsIFrame* aFrame, PRUint8 aWidgetType, case NS_THEME_DROPDOWN_BUTTON: { bool isHTML = IsHTMLContent(aFrame); nsIFrame* parentFrame = aFrame->GetParent(); - bool isMenulist = !isHTML && parentFrame->GetType() == nsWidgetAtoms::menuFrame; + bool isMenulist = !isHTML && parentFrame->GetType() == nsGkAtoms::menuFrame; bool isOpen = false; // HTML select and XUL menulist dropdown buttons get state from the parent. @@ -1125,7 +1125,7 @@ nsNativeThemeWin::GetThemePartAndState(nsIFrame* aFrame, PRUint8 aWidgetType, nsEventStates eventState = GetContentState(aFrame, aWidgetType); // NOTE: we can probably use NS_EVENT_STATE_CHECKED - isChecked = CheckBooleanAttr(aFrame, nsWidgetAtoms::checked); + isChecked = CheckBooleanAttr(aFrame, nsGkAtoms::checked); aPart = MENU_POPUPCHECK; aState = MC_CHECKMARKNORMAL; @@ -1371,7 +1371,7 @@ RENDER_AGAIN: else if (aWidgetType == NS_THEME_MENUCHECKBOX || aWidgetType == NS_THEME_MENURADIO) { bool isChecked = false; - isChecked = CheckBooleanAttr(aFrame, nsWidgetAtoms::checked); + isChecked = CheckBooleanAttr(aFrame, nsGkAtoms::checked); if (isChecked) { @@ -2239,13 +2239,13 @@ nsNativeThemeWin::WidgetStateChanged(nsIFrame* aFrame, PRUint8 aWidgetType, // Check the attribute to see if it's relevant. // disabled, checked, dlgtype, default, etc. *aShouldRepaint = false; - if (aAttribute == nsWidgetAtoms::disabled || - aAttribute == nsWidgetAtoms::checked || - aAttribute == nsWidgetAtoms::selected || - aAttribute == nsWidgetAtoms::readonly || - aAttribute == nsWidgetAtoms::open || - aAttribute == nsWidgetAtoms::mozmenuactive || - aAttribute == nsWidgetAtoms::focused) + if (aAttribute == nsGkAtoms::disabled || + aAttribute == nsGkAtoms::checked || + aAttribute == nsGkAtoms::selected || + aAttribute == nsGkAtoms::readonly || + aAttribute == nsGkAtoms::open || + aAttribute == nsGkAtoms::menuactive || + aAttribute == nsGkAtoms::focused) *aShouldRepaint = true; } @@ -2367,7 +2367,7 @@ nsNativeThemeWin::ClassicThemeSupportsWidget(nsPresContext* aPresContext, // match the usually white background of the scrollable container, so // only support the native resizer if not in a scrollframe. nsIFrame* parentFrame = aFrame->GetParent(); - return (!parentFrame || parentFrame->GetType() != nsWidgetAtoms::scrollFrame); + return (!parentFrame || parentFrame->GetType() != nsGkAtoms::scrollFrame); } case NS_THEME_MENUBAR: case NS_THEME_MENUPOPUP: @@ -2857,7 +2857,7 @@ nsresult nsNativeThemeWin::ClassicGetThemePartAndState(nsIFrame* aFrame, PRUint8 nsIFrame* parentFrame = aFrame->GetParent(); bool isHTML = IsHTMLContent(aFrame); - bool isMenulist = !isHTML && parentFrame->GetType() == nsWidgetAtoms::menuFrame; + bool isMenulist = !isHTML && parentFrame->GetType() == nsGkAtoms::menuFrame; bool isOpen = false; // HTML select and XUL menulist dropdown buttons get state from the parent. diff --git a/widget/src/windows/nsToolkit.cpp b/widget/src/windows/nsToolkit.cpp index caaee38c1dae..173ab0a1eb3d 100644 --- a/widget/src/windows/nsToolkit.cpp +++ b/widget/src/windows/nsToolkit.cpp @@ -45,7 +45,6 @@ #include "nsGUIEvent.h" #include "nsIServiceManager.h" #include "nsComponentManagerUtils.h" -#include "nsWidgetAtoms.h" #include #include @@ -286,8 +285,6 @@ NS_METHOD nsToolkit::Init(PRThread *aThread) kD3DUsageDelay, nsITimer::TYPE_ONE_SHOT); - nsWidgetAtoms::RegisterAtoms(); - return NS_OK; } diff --git a/widget/src/windows/nsWindow.cpp b/widget/src/windows/nsWindow.cpp index 73f233b63afa..29339dda681a 100644 --- a/widget/src/windows/nsWindow.cpp +++ b/widget/src/windows/nsWindow.cpp @@ -138,7 +138,7 @@ #include "nsRect.h" #include "nsThreadUtils.h" #include "nsNativeCharsetUtils.h" -#include "nsWidgetAtoms.h" +#include "nsGkAtoms.h" #include "nsUnicharUtils.h" #include "nsCRT.h" #include "nsAppDirectoryServiceDefs.h" @@ -3701,30 +3701,30 @@ bool nsWindow::DispatchCommandEvent(PRUint32 aEventCommand) nsCOMPtr command; switch (aEventCommand) { case APPCOMMAND_BROWSER_BACKWARD: - command = nsWidgetAtoms::Back; + command = nsGkAtoms::Back; break; case APPCOMMAND_BROWSER_FORWARD: - command = nsWidgetAtoms::Forward; + command = nsGkAtoms::Forward; break; case APPCOMMAND_BROWSER_REFRESH: - command = nsWidgetAtoms::Reload; + command = nsGkAtoms::Reload; break; case APPCOMMAND_BROWSER_STOP: - command = nsWidgetAtoms::Stop; + command = nsGkAtoms::Stop; break; case APPCOMMAND_BROWSER_SEARCH: - command = nsWidgetAtoms::Search; + command = nsGkAtoms::Search; break; case APPCOMMAND_BROWSER_FAVORITES: - command = nsWidgetAtoms::Bookmarks; + command = nsGkAtoms::Bookmarks; break; case APPCOMMAND_BROWSER_HOME: - command = nsWidgetAtoms::Home; + command = nsGkAtoms::Home; break; default: return false; } - nsCommandEvent event(true, nsWidgetAtoms::onAppCommand, command, this); + nsCommandEvent event(true, nsGkAtoms::onAppCommand, command, this); InitEvent(event); DispatchWindowEvent(&event); diff --git a/widget/src/xpwidgets/Makefile.in b/widget/src/xpwidgets/Makefile.in index 38dc02601953..340f2c31c237 100644 --- a/widget/src/xpwidgets/Makefile.in +++ b/widget/src/xpwidgets/Makefile.in @@ -65,7 +65,6 @@ CPPSRCS = \ nsPrintOptionsImpl.cpp \ nsPrintSettingsImpl.cpp \ nsPrintSession.cpp \ - nsWidgetAtoms.cpp \ nsIdleService.cpp \ nsClipboardPrivacyHandler.cpp \ GfxInfoWebGL.cpp \ diff --git a/widget/src/xpwidgets/nsNativeTheme.cpp b/widget/src/xpwidgets/nsNativeTheme.cpp index 44f2ce833be3..7172fb3f40c1 100644 --- a/widget/src/xpwidgets/nsNativeTheme.cpp +++ b/widget/src/xpwidgets/nsNativeTheme.cpp @@ -191,8 +191,8 @@ nsNativeTheme::GetCheckedOrSelected(nsIFrame* aFrame, bool aCheckSelected) } } - return CheckBooleanAttr(aFrame, aCheckSelected ? nsWidgetAtoms::selected - : nsWidgetAtoms::checked); + return CheckBooleanAttr(aFrame, aCheckSelected ? nsGkAtoms::selected + : nsGkAtoms::checked); } bool @@ -202,7 +202,7 @@ nsNativeTheme::IsButtonTypeMenu(nsIFrame* aFrame) return PR_FALSE; nsIContent* content = aFrame->GetContent(); - return content->AttrValueIs(kNameSpaceID_None, nsWidgetAtoms::type, + return content->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type, NS_LITERAL_STRING("menu"), eCaseMatters); } @@ -229,7 +229,7 @@ nsNativeTheme::GetIndeterminate(nsIFrame* aFrame) if (content->IsXUL()) { // For a XUL checkbox or radio button, the state of the parent determines // the state - return CheckBooleanAttr(aFrame->GetParent(), nsWidgetAtoms::indeterminate); + return CheckBooleanAttr(aFrame->GetParent(), nsGkAtoms::indeterminate); } // Check for an HTML input element @@ -258,7 +258,7 @@ nsNativeTheme::IsWidgetStyled(nsPresContext* aPresContext, nsIFrame* aFrame, // fall through and return false. if (aWidgetType == NS_THEME_RESIZER) { nsIFrame* parentFrame = aFrame->GetParent(); - if (parentFrame && parentFrame->GetType() == nsWidgetAtoms::scrollFrame) { + if (parentFrame && parentFrame->GetType() == nsGkAtoms::scrollFrame) { // if the parent is a scrollframe, the resizer should be native themed // only if the scrollable area doesn't override the widget style. parentFrame = parentFrame->GetParent(); @@ -312,7 +312,7 @@ nsNativeTheme::IsDisabled(nsIFrame* aFrame, nsEventStates aEventStates) // For XML/XUL elements, an attribute must be equal to the literal // string "true" to be counted as true. An empty string should _not_ // be counted as true. - return content->AttrValueIs(kNameSpaceID_None, nsWidgetAtoms::disabled, + return content->AttrValueIs(kNameSpaceID_None, nsGkAtoms::disabled, NS_LITERAL_STRING("true"), eCaseMatters); } @@ -330,12 +330,12 @@ nsNativeTheme::GetScrollbarButtonType(nsIFrame* aFrame) return 0; static nsIContent::AttrValuesArray strings[] = - {&nsWidgetAtoms::scrollbarDownBottom, &nsWidgetAtoms::scrollbarDownTop, - &nsWidgetAtoms::scrollbarUpBottom, &nsWidgetAtoms::scrollbarUpTop, + {&nsGkAtoms::scrollbarDownBottom, &nsGkAtoms::scrollbarDownTop, + &nsGkAtoms::scrollbarUpBottom, &nsGkAtoms::scrollbarUpTop, nsnull}; switch (aFrame->GetContent()->FindAttrValueIn(kNameSpaceID_None, - nsWidgetAtoms::sbattr, + nsGkAtoms::sbattr, strings, eCaseMatters)) { case 0: return eScrollbarButton_Down | eScrollbarButton_Bottom; case 1: return eScrollbarButton_Down; @@ -354,9 +354,9 @@ nsNativeTheme::GetTreeSortDirection(nsIFrame* aFrame) return eTreeSortDirection_Natural; static nsIContent::AttrValuesArray strings[] = - {&nsWidgetAtoms::descending, &nsWidgetAtoms::ascending, nsnull}; + {&nsGkAtoms::descending, &nsGkAtoms::ascending, nsnull}; switch (aFrame->GetContent()->FindAttrValueIn(kNameSpaceID_None, - nsWidgetAtoms::sortdirection, + nsGkAtoms::sortDirection, strings, eCaseMatters)) { case 0: return eTreeSortDirection_Descending; case 1: return eTreeSortDirection_Ascending; @@ -372,17 +372,17 @@ nsNativeTheme::IsLastTreeHeaderCell(nsIFrame* aFrame) return PR_FALSE; // A tree column picker is always the last header cell. - if (aFrame->GetContent()->Tag() == nsWidgetAtoms::treecolpicker) + if (aFrame->GetContent()->Tag() == nsGkAtoms::treecolpicker) return PR_TRUE; // Find the parent tree. nsIContent* parent = aFrame->GetContent()->GetParent(); - while (parent && parent->Tag() != nsWidgetAtoms::tree) { + while (parent && parent->Tag() != nsGkAtoms::tree) { parent = parent->GetParent(); } // If the column picker is visible, this can't be the last column. - if (parent && !parent->AttrValueIs(kNameSpaceID_None, nsWidgetAtoms::hidecolumnpicker, + if (parent && !parent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::hidecolumnpicker, NS_LITERAL_STRING("true"), eCaseMatters)) return PR_FALSE; @@ -401,7 +401,7 @@ nsNativeTheme::IsBottomTab(nsIFrame* aFrame) return PR_FALSE; nsAutoString classStr; - aFrame->GetContent()->GetAttr(kNameSpaceID_None, nsWidgetAtoms::_class, classStr); + aFrame->GetContent()->GetAttr(kNameSpaceID_None, nsGkAtoms::_class, classStr); return !classStr.IsEmpty() && classStr.Find("tab-bottom") != kNotFound; } @@ -413,7 +413,7 @@ nsNativeTheme::IsFirstTab(nsIFrame* aFrame) nsIFrame* first = aFrame->GetParent()->GetFirstPrincipalChild(); while (first) { - if (first->GetRect().width > 0 && first->GetContent()->Tag() == nsWidgetAtoms::tab) + if (first->GetRect().width > 0 && first->GetContent()->Tag() == nsGkAtoms::tab) return (first == aFrame); first = first->GetNextSibling(); } @@ -426,8 +426,8 @@ nsNativeTheme::IsHorizontal(nsIFrame* aFrame) if (!aFrame) return PR_FALSE; - return !aFrame->GetContent()->AttrValueIs(kNameSpaceID_None, nsWidgetAtoms::orient, - nsWidgetAtoms::vertical, + return !aFrame->GetContent()->AttrValueIs(kNameSpaceID_None, nsGkAtoms::orient, + nsGkAtoms::vertical, eCaseMatters); } @@ -467,11 +467,11 @@ nsNativeTheme::IsIndeterminateProgress(nsIFrame* aFrame, if (!aFrame || !aFrame->GetContent()) return PR_FALSE; - if (aFrame->GetContent()->IsHTML(nsWidgetAtoms::progress)) { + if (aFrame->GetContent()->IsHTML(nsGkAtoms::progress)) { return aEventStates.HasState(NS_EVENT_STATE_INDETERMINATE); } - return aFrame->GetContent()->AttrValueIs(kNameSpaceID_None, nsWidgetAtoms::mode, + return aFrame->GetContent()->AttrValueIs(kNameSpaceID_None, nsGkAtoms::mode, NS_LITERAL_STRING("undetermined"), eCaseMatters); } @@ -491,7 +491,7 @@ nsNativeTheme::IsSubmenu(nsIFrame* aFrame, bool* aLeftOfParent) return PR_FALSE; nsIContent* parentContent = aFrame->GetContent()->GetParent(); - if (!parentContent || parentContent->Tag() != nsWidgetAtoms::menu) + if (!parentContent || parentContent->Tag() != nsGkAtoms::menu) return PR_FALSE; nsIFrame* parent = aFrame; diff --git a/widget/src/xpwidgets/nsNativeTheme.h b/widget/src/xpwidgets/nsNativeTheme.h index c93ce63842d0..ef95f27d0e02 100644 --- a/widget/src/xpwidgets/nsNativeTheme.h +++ b/widget/src/xpwidgets/nsNativeTheme.h @@ -45,7 +45,7 @@ #include "nsCOMPtr.h" #include "nsString.h" #include "nsMargin.h" -#include "nsWidgetAtoms.h" +#include "nsGkAtoms.h" #include "nsEventStates.h" #include "nsTArray.h" #include "nsITimer.h" @@ -94,7 +94,7 @@ class nsNativeTheme : public nsITimerCallback // button: bool IsDefaultButton(nsIFrame* aFrame) { - return CheckBooleanAttr(aFrame, nsWidgetAtoms::_default); + return CheckBooleanAttr(aFrame, nsGkAtoms::_default); } bool IsButtonTypeMenu(nsIFrame* aFrame); @@ -110,7 +110,7 @@ class nsNativeTheme : public nsITimerCallback } bool IsFocused(nsIFrame* aFrame) { - return CheckBooleanAttr(aFrame, nsWidgetAtoms::focused); + return CheckBooleanAttr(aFrame, nsGkAtoms::focused); } // scrollbar button: @@ -118,7 +118,7 @@ class nsNativeTheme : public nsITimerCallback // tab: bool IsSelectedTab(nsIFrame* aFrame) { - return CheckBooleanAttr(aFrame, nsWidgetAtoms::selected); + return CheckBooleanAttr(aFrame, nsGkAtoms::selected); } bool IsNextToSelectedTab(nsIFrame* aFrame, PRInt32 aOffset); @@ -141,16 +141,16 @@ class nsNativeTheme : public nsITimerCallback // button / toolbarbutton: bool IsCheckedButton(nsIFrame* aFrame) { - return CheckBooleanAttr(aFrame, nsWidgetAtoms::checked); + return CheckBooleanAttr(aFrame, nsGkAtoms::checked); } bool IsSelectedButton(nsIFrame* aFrame) { - return CheckBooleanAttr(aFrame, nsWidgetAtoms::checked) || - CheckBooleanAttr(aFrame, nsWidgetAtoms::selected); + return CheckBooleanAttr(aFrame, nsGkAtoms::checked) || + CheckBooleanAttr(aFrame, nsGkAtoms::selected); } bool IsOpenButton(nsIFrame* aFrame) { - return CheckBooleanAttr(aFrame, nsWidgetAtoms::open); + return CheckBooleanAttr(aFrame, nsGkAtoms::open); } bool IsPressedButton(nsIFrame* aFrame); @@ -171,7 +171,7 @@ class nsNativeTheme : public nsITimerCallback // textfield: bool IsReadOnly(nsIFrame* aFrame) { - return CheckBooleanAttr(aFrame, nsWidgetAtoms::readonly); + return CheckBooleanAttr(aFrame, nsGkAtoms::readonly); } // menupopup: diff --git a/widget/src/xpwidgets/nsWidgetAtomList.h b/widget/src/xpwidgets/nsWidgetAtomList.h deleted file mode 100644 index c6a5849c32cf..000000000000 --- a/widget/src/xpwidgets/nsWidgetAtomList.h +++ /dev/null @@ -1,135 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1999 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Original Author: Mike Pinkerton (pinkerton@netscape.com) - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/****** - - This file contains the list of all Widget nsIAtoms and their values - - It is designed to be used as inline input to nsWidgetAtoms.cpp *only* - through the magic of C preprocessing. - - All entries must be enclosed in the macro WIDGET_ATOM which will have cruel - and unusual things done to it - - It is recommended (but not strictly necessary) to keep all entries - in alphabetical order - - The first argument to WIDGET_ATOM is the C++ identifier of the atom - The second argument is the string value of the atom - - ******/ - -WIDGET_ATOM(accesskey, "accesskey") // The shortcut key for a menu or menu item -WIDGET_ATOM(active, "active") -WIDGET_ATOM(ascending, "ascending") -WIDGET_ATOM(autocheck, "autocheck") -WIDGET_ATOM(Back, "Back") -WIDGET_ATOM(Bookmarks, "Bookmarks") -WIDGET_ATOM(checkbox, "checkbox") -WIDGET_ATOM(checked, "checked") -WIDGET_ATOM(_class, "class") -WIDGET_ATOM(collapsed, "collapsed") -WIDGET_ATOM(comboboxControlFrame, "ComboboxControlFrame") -WIDGET_ATOM(command, "command") -WIDGET_ATOM(curpos, "curpos") -WIDGET_ATOM(_default, "default") -WIDGET_ATOM(descending, "descending") -WIDGET_ATOM(dir, "dir") -WIDGET_ATOM(disabled, "disabled") -WIDGET_ATOM(Clear, "Clear") // AppCommand to return to a previous state -WIDGET_ATOM(_false, "false") -WIDGET_ATOM(focused, "focused") -WIDGET_ATOM(Forward, "Forward") -WIDGET_ATOM(Home, "Home") -WIDGET_ATOM(hidden, "hidden") -WIDGET_ATOM(hidecolumnpicker, "hidecolumnpicker") -WIDGET_ATOM(horizontal, "horizontal") -WIDGET_ATOM(vertical, "vertical") -WIDGET_ATOM(id, "id") -WIDGET_ATOM(image, "image") -WIDGET_ATOM(input, "input") -WIDGET_ATOM(indeterminate, "indeterminate") -WIDGET_ATOM(key, "key") // The key element / attribute -WIDGET_ATOM(label, "label") -WIDGET_ATOM(max, "max") -WIDGET_ATOM(maxpos, "maxpos") -WIDGET_ATOM(Menu, "Menu") // AppCommand to open a menu -WIDGET_ATOM(menu, "menu") // Represents an XP menu -WIDGET_ATOM(menuitem, "menuitem") // Represents an XP menu item -WIDGET_ATOM(menupopup, "menupopup") // The XP menu's children. -WIDGET_ATOM(menuseparator, "menuseparator") // Divider between menu items -WIDGET_ATOM(menuFrame, "MenuFrame") -WIDGET_ATOM(minpos, "minpos") -WIDGET_ATOM(mode, "mode") -WIDGET_ATOM(modifiers, "modifiers") // The modifiers attribute -WIDGET_ATOM(mozmenuactive, "_moz-menuactive") -WIDGET_ATOM(name, "name") -WIDGET_ATOM(onAppCommand, "onAppCommand") -WIDGET_ATOM(open, "open") // Whether or not a menu, tree, etc. is open -WIDGET_ATOM(orient, "orient") -WIDGET_ATOM(pageincrement, "pageincrement") -WIDGET_ATOM(parentfocused, "parentfocused") -WIDGET_ATOM(progress, "progress") -WIDGET_ATOM(radio, "radio") -WIDGET_ATOM(readonly, "readonly") -WIDGET_ATOM(Reload, "Reload") -WIDGET_ATOM(richlistitem, "richlistitem") -WIDGET_ATOM(sbattr, "sbattr") -WIDGET_ATOM(scrollFrame, "ScrollFrame") -WIDGET_ATOM(scrollbarFrame, "ScrollbarFrame") -WIDGET_ATOM(scrollbarDownBottom, "scrollbar-down-bottom") -WIDGET_ATOM(scrollbarDownTop, "scrollbar-down-top") -WIDGET_ATOM(scrollbarUpBottom, "scrollbar-up-bottom") -WIDGET_ATOM(scrollbarUpTop, "scrollbar-up-top") -WIDGET_ATOM(Search, "Search") -WIDGET_ATOM(selected, "selected") -WIDGET_ATOM(sortdirection, "sortDirection") -WIDGET_ATOM(state, "state") -WIDGET_ATOM(statusbar, "statusbar") -WIDGET_ATOM(Stop, "Stop") -WIDGET_ATOM(_true, "true") -WIDGET_ATOM(tab, "tab") -WIDGET_ATOM(toolbar, "toolbar") -WIDGET_ATOM(toolbox, "toolbox") -WIDGET_ATOM(tree, "tree") -WIDGET_ATOM(treecolpicker, "treecolpicker") -WIDGET_ATOM(type, "type") -WIDGET_ATOM(value, "value") -WIDGET_ATOM(VolumeUp, "VolumeUp") -WIDGET_ATOM(VolumeDown, "VolumeDown") - diff --git a/widget/src/xpwidgets/nsWidgetAtoms.cpp b/widget/src/xpwidgets/nsWidgetAtoms.cpp deleted file mode 100644 index 8430643edb40..000000000000 --- a/widget/src/xpwidgets/nsWidgetAtoms.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Original Author: Mike Pinkerton (pinkerton@netscape.com) - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "nsWidgetAtoms.h" -#include "nsStaticAtom.h" -#include "nsMemory.h" - -#define WIDGET_ATOM(_name, _value) nsIAtom* nsWidgetAtoms::_name = 0; -#include "nsWidgetAtomList.h" -#undef WIDGET_ATOM - -#define WIDGET_ATOM(_name, _value) NS_STATIC_ATOM_BUFFER(_name##_buffer, _value) -#include "nsWidgetAtomList.h" -#undef WIDGET_ATOM - -static const nsStaticAtom widget_atoms[] = { -// define storage for all atoms -#define WIDGET_ATOM(_name, _value) NS_STATIC_ATOM(_name##_buffer, &nsWidgetAtoms::_name), -#include "nsWidgetAtomList.h" -#undef WIDGET_ATOM -}; - - -void nsWidgetAtoms::RegisterAtoms() { - - NS_RegisterStaticAtoms(widget_atoms, NS_ARRAY_LENGTH(widget_atoms)); -} diff --git a/widget/src/xpwidgets/nsWidgetAtoms.h b/widget/src/xpwidgets/nsWidgetAtoms.h deleted file mode 100644 index 945d6fa0dee9..000000000000 --- a/widget/src/xpwidgets/nsWidgetAtoms.h +++ /dev/null @@ -1,71 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Original Author: Mike Pinkerton (pinkerton@netscape.com) - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#ifndef nsWidgetAtoms_h___ -#define nsWidgetAtoms_h___ - -#include "prtypes.h" -#include "nsIAtom.h" - -/** - * This class wraps up the creation and destruction of the standard - * set of xul atoms used during normal xul handling. This object - * is created when the first xul content object is created, and - * destroyed when the last such content object is destroyed. - * - * It's here because we cannot use nsGkAtoms from - * the Widget shlb. They are components are we're not. - */ -class nsWidgetAtoms { -public: - - static void RegisterAtoms(); - - /* Declare all atoms - - The atom names and values are stored in nsWidgetAtomList.h and - are brought to you by the magic of C preprocessing - - Add new atoms to nsWidgetAtomList and all support logic will be auto-generated - */ -#define WIDGET_ATOM(_name, _value) static nsIAtom* _name; -#include "nsWidgetAtomList.h" -#undef WIDGET_ATOM - -}; - -#endif /* nsWidgetAtoms_h___ */