diff --git a/mozilla/accessible/public/nsIAccessibleDocument.idl b/mozilla/accessible/public/nsIAccessibleDocument.idl new file mode 100644 index 00000000000..f3b564a29a9 --- /dev/null +++ b/mozilla/accessible/public/nsIAccessibleDocument.idl @@ -0,0 +1,41 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * + * 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 the Mozilla browser. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1999 Netscape Communications Corporation. All + * Rights Reserved. + * + * Original Author: Aaron Leventhal + * + * Contributor(s): + * John Gaunt + */ + +#include "nsISupports.idl" +#include "nsIAccessible.idl" +#include "domstubs.idl" +interface nsIDocument; + +[scriptable, uuid(8781FC88-355F-4439-881F-6504A0A1CEB6)] +interface nsIAccessibleDocument : nsISupports +{ + readonly attribute DOMString URL; + readonly attribute DOMString title; + readonly attribute DOMString mimeType; + readonly attribute DOMString docType; + DOMString getNameSpaceURIForID(in short nameSpaceID); + [noscript] nsIDocument getDocument(); + +}; diff --git a/mozilla/accessible/public/nsIAccessibleSelectable.idl b/mozilla/accessible/public/nsIAccessibleSelectable.idl new file mode 100644 index 00000000000..45908df85c4 --- /dev/null +++ b/mozilla/accessible/public/nsIAccessibleSelectable.idl @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * + * 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 the Mozilla browser. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1999 Netscape Communications Corporation. All + * Rights Reserved. + * + * Original Author: John Gaunt (jgaunt@netscape.com) + * + * Contributor(s): + * John Gaunt + */ + +#include "nsISupports.idl" +#include "nsIAccessible.idl" +#include "nsISupportsArray.idl" + +[scriptable, uuid(34d268d6-1dd2-11b2-9d63-83a5e0ada290)] +interface nsIAccessibleSelectable : nsISupports +{ + nsISupportsArray GetSelectedChildren(); +}; diff --git a/mozilla/accessible/src/html/nsHTMLSelectAccessible.cpp b/mozilla/accessible/src/html/nsHTMLSelectAccessible.cpp new file mode 100644 index 00000000000..7cab0f760ec --- /dev/null +++ b/mozilla/accessible/src/html/nsHTMLSelectAccessible.cpp @@ -0,0 +1,792 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * + * The contents of this file are subject to the Netscape 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/NPL/ + * + * 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 Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Original Author: Eric Vaughan (evaughan@netscape.com) + * + * Contributor(s): + */ + +#include "nsHTMLSelectAccessible.h" +#include "nsCOMPtr.h" +#include "nsIDocument.h" +#include "nsIPresShell.h" +#include "nsIPresContext.h" +#include "nsIContent.h" +#include "nsIFrame.h" +#include "nsRootAccessible.h" +#include "nsINameSpaceManager.h" +#include "nsIDOMHTMLInputElement.h" +#include "nsLayoutAtoms.h" +#include "nsIDOMMenuListener.h" +#include "nsIDOMEventReceiver.h" +#include "nsReadableUtils.h" +#include "nsIDOMHTMLCollection.h" +#include "nsISelectElement.h" +#include "nsIDOMHTMLSelectElement.h" +#include "nsIAccessibilityService.h" +#include "nsIServiceManager.h" +#include "nsIDOMHTMLOptionElement.h" + +/* + * A class the represents the text field in the Select to the left + * of the drop down button + */ +class nsHTMLSelectTextFieldAccessible : public nsLeafAccessible +{ +public: + + nsHTMLSelectTextFieldAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell); + + NS_IMETHOD GetAccNextSibling(nsIAccessible **_retval); + NS_IMETHOD GetAccPreviousSibling(nsIAccessible **_retval); + NS_IMETHOD GetAccParent(nsIAccessible **_retval); + NS_IMETHOD GetAccRole(PRUint32 *_retval); + NS_IMETHOD GetAccValue(nsAWritableString& _retval); + + virtual void GetBounds(nsRect& aBounds, nsIFrame** aRelativeFrame); + + nsCOMPtr mParent; +}; + +/* + * A base class that can listen to menu events. Its used so the + * button and the window accessibles can change there name and role + * depending on whether the drop down list is dropped down on not + */ +class nsMenuListenerAccessible : public nsAccessible, + public nsIDOMMenuListener +{ +public: + + NS_DECL_ISUPPORTS_INHERITED + + nsMenuListenerAccessible(nsIDOMNode* aDOMNode, nsIWeakReference* aShell); + virtual ~nsMenuListenerAccessible(); + + // popup listener + NS_IMETHOD Create(nsIDOMEvent* aEvent); + NS_IMETHOD Close(nsIDOMEvent* aEvent); + NS_IMETHOD Destroy(nsIDOMEvent* aEvent); + NS_IMETHOD Action(nsIDOMEvent* aEvent) { return NS_OK; } + NS_IMETHOD Broadcast(nsIDOMEvent* aEvent) { return NS_OK; } + NS_IMETHOD CommandUpdate(nsIDOMEvent* aEvent) { return NS_OK; } + NS_IMETHOD HandleEvent(nsIDOMEvent* aEvent) { return NS_OK; } + + virtual void SetupMenuListener(); + + PRBool mRegistered; + PRBool mOpen; +}; + +NS_IMPL_ISUPPORTS_INHERITED(nsMenuListenerAccessible, nsAccessible, nsIDOMMenuListener) + +/** + * A class that represents the button inside the Select to the right of the text field + */ +class nsHTMLSelectButtonAccessible : public nsMenuListenerAccessible +{ +public: + + nsHTMLSelectButtonAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell); + + NS_IMETHOD GetAccNextSibling(nsIAccessible **_retval); + NS_IMETHOD GetAccPreviousSibling(nsIAccessible **_retval); + NS_IMETHOD GetAccParent(nsIAccessible **_retval); + NS_IMETHOD GetAccName(nsAWritableString& _retval); + NS_IMETHOD GetAccRole(PRUint32 *_retval); + NS_IMETHOD GetAccLastChild(nsIAccessible **_retval); + NS_IMETHOD GetAccFirstChild(nsIAccessible **_retval); + NS_IMETHOD GetAccChildCount(PRInt32 *_retval); + NS_IMETHOD GetAccNumActions(PRUint8 *_retval); + NS_IMETHOD GetAccActionName(PRUint8 index, nsAWritableString& _retval); + NS_IMETHOD AccDoAction(PRUint8 index); + + + virtual void GetBounds(nsRect& aBounds, nsIFrame** aRelativeFrame); + + + + nsCOMPtr mParent; +}; + +/* + * A class that represents the window that lives to the right + * of the drop down button inside the Select. This is the window + * that is made visible when the button is pressed. + */ +class nsHTMLSelectWindowAccessible : public nsMenuListenerAccessible +{ +public: + + nsHTMLSelectWindowAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell); + + NS_IMETHOD GetAccParent(nsIAccessible **_retval); + NS_IMETHOD GetAccNextSibling(nsIAccessible **_retval); + NS_IMETHOD GetAccPreviousSibling(nsIAccessible **_retval); + NS_IMETHOD GetAccLastChild(nsIAccessible **_retval); + NS_IMETHOD GetAccFirstChild(nsIAccessible **_retval); + NS_IMETHOD GetAccChildCount(PRInt32 *_retval); + NS_IMETHOD GetAccRole(PRUint32 *_retval); + NS_IMETHOD GetAccState(PRUint32 *_retval); + + virtual void GetBounds(nsRect& aBounds, nsIFrame** aRelativeFrame); + + nsCOMPtr mParent; +}; + +/* + * The list that contains all the options in the select. It is inside the window. + */ +class nsHTMLSelectListAccessible : public nsAccessible +{ +public: + + nsHTMLSelectListAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell); + virtual ~nsHTMLSelectListAccessible() {} + + NS_IMETHOD GetAccParent(nsIAccessible **_retval); + NS_IMETHOD GetAccRole(PRUint32 *_retval); + NS_IMETHOD GetAccNextSibling(nsIAccessible **_retval); + NS_IMETHOD GetAccPreviousSibling(nsIAccessible **_retval); + NS_IMETHOD AccGetBounds(PRInt32 *x, PRInt32 *y, PRInt32 *width, PRInt32 *height); + NS_IMETHOD GetAccLastChild(nsIAccessible **_retval); + NS_IMETHOD GetAccFirstChild(nsIAccessible **_retval); + + nsCOMPtr mParent; +}; + +//--------- nsHTMLSelectAccessible ----- + +nsHTMLSelectAccessible::nsHTMLSelectAccessible(nsIDOMNode* aDOMNode, + nsIWeakReference* aShell) + :nsAccessible(aDOMNode, aShell) +{ +} + +NS_IMPL_ISUPPORTS_INHERITED1(nsHTMLSelectAccessible, nsAccessible, nsIAccessibleSelectable) + +// ------------- Helper method for determination of proper Frame ------ +//static +PRBool nsHTMLSelectAccessible::IsCorrectFrame( nsIFrame* aFrame, nsIAtom* aAtom ) { + if (!aFrame || !aAtom) + return PR_FALSE; + nsCOMPtr frameType; + aFrame->GetFrameType(getter_AddRefs(frameType)); + if (frameType.get() != aAtom) + return PR_FALSE; + return PR_TRUE; +} + +NS_IMETHODIMP nsHTMLSelectAccessible::GetAccValue(nsAWritableString& _retval) +{ + nsCOMPtr text; + GetAccFirstChild(getter_AddRefs(text)); + if (text) + return text->GetAccValue(_retval); + + return NS_ERROR_FAILURE; +} + + +NS_IMETHODIMP nsHTMLSelectAccessible::GetAccRole(PRUint32 *_retval) +{ + *_retval = ROLE_COMBOBOX; + return NS_OK; +} + +NS_IMETHODIMP nsHTMLSelectAccessible::GetAccLastChild(nsIAccessible **_retval) +{ + // create a window accessible + *_retval = new nsHTMLSelectWindowAccessible(this, mDOMNode, mPresShell); + if ( ! *_retval ) + return NS_ERROR_FAILURE; + NS_ADDREF(*_retval); + return NS_OK; +} + +NS_IMETHODIMP nsHTMLSelectAccessible::GetAccFirstChild(nsIAccessible **_retval) +{ + // create a text field + + *_retval = new nsHTMLSelectTextFieldAccessible(this, mDOMNode, mPresShell); + if ( ! *_retval ) + return NS_ERROR_FAILURE; + NS_ADDREF(*_retval); + return NS_OK; +} + +NS_IMETHODIMP nsHTMLSelectAccessible::GetAccChildCount(PRInt32 *_retval) +{ + // always have 3 children + *_retval = 3; + return NS_OK; +} + +NS_IMETHODIMP nsHTMLSelectAccessible::GetSelectedChildren(nsISupportsArray **_retval) +{ + *_retval = nsnull; + return NS_OK; +} + +//-------- SelectTextFieldAccessible ------ + +nsHTMLSelectTextFieldAccessible::nsHTMLSelectTextFieldAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell): +nsLeafAccessible(aDOMNode, aShell) +{ + mParent = aParent; +} + +NS_IMETHODIMP nsHTMLSelectTextFieldAccessible::GetAccValue(nsAWritableString& _retval) +{ + nsIFrame* frame = nsAccessible::GetBoundsFrame(); + nsCOMPtr context; + GetPresContext(context); + if ( !frame ) + return NS_ERROR_FAILURE; + + frame->FirstChild(context, nsnull, &frame); + if ( ! nsHTMLSelectAccessible::IsCorrectFrame( frame, nsLayoutAtoms::blockFrame) ) + return NS_ERROR_FAILURE; + + frame->FirstChild(context, nsnull, &frame); + if ( ! nsHTMLSelectAccessible::IsCorrectFrame( frame, nsLayoutAtoms::textFrame) ) + return NS_ERROR_FAILURE; + + nsCOMPtr content; + frame->GetContent(getter_AddRefs(content)); + + if (!content) + return NS_ERROR_FAILURE; + + AppendFlatStringFromSubtree(content, &_retval); + + return NS_OK; +} + +void nsHTMLSelectTextFieldAccessible::GetBounds(nsRect& aBounds, nsIFrame** aRelativeFrame) +{ + // get our first child's frame + nsIFrame* frame = nsAccessible::GetBoundsFrame(); + nsCOMPtr context; + GetPresContext(context); + if ( !frame ) + return; + + frame->FirstChild(context, nsnull, &frame); + if ( ! nsHTMLSelectAccessible::IsCorrectFrame( frame, nsLayoutAtoms::blockFrame) ) + return; + + frame->GetParent(aRelativeFrame); + if ( ! nsHTMLSelectAccessible::IsCorrectFrame( *aRelativeFrame, nsLayoutAtoms::areaFrame) ) + return; + + frame->GetRect(aBounds); +} + +NS_IMETHODIMP nsHTMLSelectTextFieldAccessible::GetAccParent(nsIAccessible **_retval) +{ + *_retval = mParent; + NS_IF_ADDREF(*_retval); + return NS_OK; +} + +NS_IMETHODIMP nsHTMLSelectTextFieldAccessible::GetAccNextSibling(nsIAccessible **_retval) +{ + nsCOMPtr parent; + GetAccParent(getter_AddRefs(parent)); + + *_retval = new nsHTMLSelectButtonAccessible(parent, mDOMNode, mPresShell); + if ( ! *_retval ) + return NS_ERROR_FAILURE; + NS_ADDREF(*_retval); + return NS_OK; +} + +NS_IMETHODIMP nsHTMLSelectTextFieldAccessible::GetAccPreviousSibling(nsIAccessible **_retval) +{ + *_retval = nsnull; + return NS_OK; +} + +NS_IMETHODIMP nsHTMLSelectTextFieldAccessible::GetAccRole(PRUint32 *_retval) +{ + *_retval = ROLE_STATICTEXT; + return NS_OK; +} + +// --------- nsMenuListenerAccessible ----------- + +nsMenuListenerAccessible::nsMenuListenerAccessible(nsIDOMNode* aDOMNode, nsIWeakReference* aShell): +nsAccessible(aDOMNode, aShell) +{ + mRegistered = PR_FALSE; + mOpen = PR_FALSE; +} + +nsMenuListenerAccessible::~nsMenuListenerAccessible() +{ + if (mRegistered) { + nsCOMPtr eventReceiver(do_QueryInterface(mDOMNode)); + if (eventReceiver) + eventReceiver->RemoveEventListener(NS_LITERAL_STRING("create"), this, PR_TRUE); + } +} + +NS_IMETHODIMP nsMenuListenerAccessible::Create(nsIDOMEvent* aEvent) +{ + mOpen = PR_TRUE; + + /* TBD send state change event */ + + return NS_OK; +} + +NS_IMETHODIMP nsMenuListenerAccessible::Destroy(nsIDOMEvent* aEvent) +{ + mOpen = PR_FALSE; + + /* TBD send state change event */ + + return NS_OK; +} + +NS_IMETHODIMP nsMenuListenerAccessible::Close(nsIDOMEvent* aEvent) +{ + mOpen = PR_FALSE; + + /* TBD send state change event */ + + return NS_OK; +} + +void +nsMenuListenerAccessible::SetupMenuListener() +{ + // not not already one register ourselves as a popup listener + if (!mRegistered) { + + nsCOMPtr eventReceiver(do_QueryInterface(mDOMNode)); + if (!eventReceiver) { + return; + } + + nsresult rv = eventReceiver->AddEventListener(NS_LITERAL_STRING("create"), this, PR_TRUE); + + if (NS_FAILED(rv)) { + return; + } + + mRegistered = PR_TRUE; + } + +} + + +//-------- SelectButtonAccessible ------ + +nsHTMLSelectButtonAccessible::nsHTMLSelectButtonAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell): +nsMenuListenerAccessible(aDOMNode, aShell) +{ + mParent = aParent; +} + +/* void accDoAction (in PRUint8 index); */ +NS_IMETHODIMP nsHTMLSelectButtonAccessible::AccDoAction(PRUint8 index) +{ + nsIFrame* frame = nsAccessible::GetBoundsFrame(); + nsCOMPtr context; + GetPresContext(context); + + frame->FirstChild(context, nsnull, &frame); + if ( ! nsHTMLSelectAccessible::IsCorrectFrame( frame, nsLayoutAtoms::blockFrame) ) + return NS_ERROR_FAILURE; + + frame->GetNextSibling(&frame); + if ( ! nsHTMLSelectAccessible::IsCorrectFrame( frame, nsLayoutAtoms::gfxButtonControlFrame) ) + return NS_ERROR_FAILURE; + + nsCOMPtr content; + frame->GetContent(getter_AddRefs(content)); + + if (index == 0) { + nsCOMPtr element(do_QueryInterface(content)); + if (element) + { + element->Click(); + return NS_OK; + } + return NS_ERROR_FAILURE; + } + return NS_ERROR_NOT_IMPLEMENTED; +} + +/* PRUint8 getAccNumActions (); */ +NS_IMETHODIMP nsHTMLSelectButtonAccessible::GetAccNumActions(PRUint8 *_retval) +{ + *_retval = 1; + return NS_OK; +} + +void nsHTMLSelectButtonAccessible::GetBounds(nsRect& aBounds, nsIFrame** aRelativeFrame) +{ + // get our second child's frame + nsIFrame* frame = nsAccessible::GetBoundsFrame(); + nsCOMPtr context; + GetPresContext(context); + + frame->FirstChild(context, nsnull, &frame); + if ( ! nsHTMLSelectAccessible::IsCorrectFrame( frame, nsLayoutAtoms::blockFrame) ) + return; + + frame->GetNextSibling(&frame); + if ( ! nsHTMLSelectAccessible::IsCorrectFrame( frame, nsLayoutAtoms::gfxButtonControlFrame) ) + return; + + frame->GetParent(aRelativeFrame); + if ( ! nsHTMLSelectAccessible::IsCorrectFrame( *aRelativeFrame, nsLayoutAtoms::areaFrame) ) + return; + + frame->GetRect(aBounds); +} + +NS_IMETHODIMP nsHTMLSelectButtonAccessible::GetAccRole(PRUint32 *_retval) +{ + *_retval = ROLE_PUSHBUTTON; + return NS_OK; +} + +NS_IMETHODIMP nsHTMLSelectButtonAccessible::GetAccParent(nsIAccessible **_retval) +{ + *_retval = mParent; + NS_IF_ADDREF(*_retval); + return NS_OK; +} + + +NS_IMETHODIMP nsHTMLSelectButtonAccessible::GetAccName(nsAWritableString& _retval) +{ + return GetAccActionName(0, _retval); +} + +NS_IMETHODIMP nsHTMLSelectButtonAccessible::GetAccActionName(PRUint8 index, nsAWritableString& _retval) +{ + SetupMenuListener(); + + // get the current state open or closed + // set _retval to it. + // notice its supposed to be reversed. Close if opened + // and Open if closed. + + if (mOpen) + _retval = NS_LITERAL_STRING("Close"); + else + _retval = NS_LITERAL_STRING("Open"); + + return NS_OK; +} + + +NS_IMETHODIMP nsHTMLSelectButtonAccessible::GetAccNextSibling(nsIAccessible **_retval) +{ + nsCOMPtr parent; + GetAccParent(getter_AddRefs(parent)); + + *_retval = new nsHTMLSelectWindowAccessible(parent, mDOMNode, mPresShell); + if ( ! *_retval ) + return NS_ERROR_FAILURE; + NS_ADDREF(*_retval); + return NS_OK; +} + +NS_IMETHODIMP nsHTMLSelectButtonAccessible::GetAccPreviousSibling(nsIAccessible **_retval) +{ + nsCOMPtr parent; + GetAccParent(getter_AddRefs(parent)); + + *_retval = new nsHTMLSelectTextFieldAccessible(parent, mDOMNode, mPresShell); + if ( ! *_retval ) + return NS_ERROR_FAILURE; + NS_ADDREF(*_retval); + return NS_OK; +} + +NS_IMETHODIMP nsHTMLSelectButtonAccessible::GetAccLastChild(nsIAccessible **_retval) +{ + *_retval = nsnull; + return NS_OK; +} + +NS_IMETHODIMP nsHTMLSelectButtonAccessible::GetAccFirstChild(nsIAccessible **_retval) +{ + *_retval = nsnull; + return NS_OK; +} + +NS_IMETHODIMP nsHTMLSelectButtonAccessible::GetAccChildCount(PRInt32 *_retval) +{ + *_retval = 0; + return NS_OK; +} + +//--------------------- + + +nsHTMLSelectWindowAccessible::nsHTMLSelectWindowAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell) +:nsMenuListenerAccessible(aDOMNode, aShell) +{ + mParent = aParent; +} + + +NS_IMETHODIMP nsHTMLSelectWindowAccessible::GetAccState(PRUint32 *_retval) +{ + nsAccessible::GetAccState(_retval); + + SetupMenuListener(); + + // if open we are visible if closed we are invisible + // set _retval to it. + if (mOpen) + *_retval |= STATE_DEFAULT; + else + *_retval |= STATE_INVISIBLE; + + return NS_OK; +} + +NS_IMETHODIMP nsHTMLSelectWindowAccessible::GetAccRole(PRUint32 *_retval) +{ + *_retval = ROLE_WINDOW; + return NS_OK; +} + +NS_IMETHODIMP nsHTMLSelectWindowAccessible::GetAccParent(nsIAccessible **_retval) +{ + *_retval = mParent; + NS_IF_ADDREF(*_retval); + return NS_OK; +} + +NS_IMETHODIMP nsHTMLSelectWindowAccessible::GetAccPreviousSibling(nsIAccessible **_retval) +{ + nsCOMPtr parent; + GetAccParent(getter_AddRefs(parent)); + + *_retval = new nsHTMLSelectButtonAccessible(parent, mDOMNode, mPresShell); + if ( ! *_retval ) + return NS_ERROR_FAILURE; + NS_ADDREF(*_retval); + return NS_OK; +} + +NS_IMETHODIMP nsHTMLSelectWindowAccessible::GetAccNextSibling(nsIAccessible **_retval) +{ + *_retval = nsnull; + return NS_OK; +} + +NS_IMETHODIMP nsHTMLSelectWindowAccessible::GetAccLastChild(nsIAccessible **_retval) +{ + *_retval = new nsHTMLSelectListAccessible(this, mDOMNode, mPresShell); + if ( ! *_retval ) + return NS_ERROR_FAILURE; + NS_ADDREF(*_retval); + return NS_OK; +} + +NS_IMETHODIMP nsHTMLSelectWindowAccessible::GetAccFirstChild(nsIAccessible **_retval) +{ + *_retval = new nsHTMLSelectListAccessible(this, mDOMNode, mPresShell); + if ( ! *_retval ) + return NS_ERROR_FAILURE; + NS_ADDREF(*_retval); + return NS_OK; +} + +NS_IMETHODIMP nsHTMLSelectWindowAccessible::GetAccChildCount(PRInt32 *_retval) +{ + *_retval = 1; + return NS_OK; +} + +void nsHTMLSelectWindowAccessible::GetBounds(nsRect& aBounds, nsIFrame** aRelativeFrame) +{ + // get our first option + nsCOMPtr child; + mDOMNode->GetFirstChild(getter_AddRefs(child)); + + // now get its frame + nsCOMPtr shell(do_QueryReferent(mPresShell)); + if (!shell) { + *aRelativeFrame = nsnull; + return; + } + + nsIFrame* frame = nsnull; + nsCOMPtr content(do_QueryInterface(child)); + shell->GetPrimaryFrameFor(content, &frame); + if ( ! nsHTMLSelectAccessible::IsCorrectFrame( frame, nsLayoutAtoms::blockFrame) ) + return; + + frame->GetParent(&frame); + if ( ! nsHTMLSelectAccessible::IsCorrectFrame( frame, nsLayoutAtoms::areaFrame) ) + return; + + frame->GetParent(aRelativeFrame); + if ( ! nsHTMLSelectAccessible::IsCorrectFrame( *aRelativeFrame, nsLayoutAtoms::listControlFrame) ) + return; + + frame->GetRect(aBounds); +} + +//---------- + + +nsHTMLSelectListAccessible::nsHTMLSelectListAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell) +:nsAccessible(aDOMNode, aShell) +{ + mParent = aParent; +} + +NS_IMETHODIMP nsHTMLSelectListAccessible::AccGetBounds(PRInt32 *x, PRInt32 *y, PRInt32 *width, PRInt32 *height) +{ + return mParent->AccGetBounds(x,y,width,height); +} + +NS_IMETHODIMP nsHTMLSelectListAccessible::GetAccParent(nsIAccessible **_retval) +{ + *_retval = mParent; + NS_ADDREF(*_retval); + return NS_OK; +} + +NS_IMETHODIMP nsHTMLSelectListAccessible::GetAccRole(PRUint32 *_retval) +{ + *_retval = ROLE_LIST; + return NS_OK; +} + +NS_IMETHODIMP nsHTMLSelectListAccessible::GetAccPreviousSibling(nsIAccessible **_retval) +{ + *_retval = nsnull; + return NS_OK; +} + +NS_IMETHODIMP nsHTMLSelectListAccessible::GetAccNextSibling(nsIAccessible **_retval) +{ + *_retval = nsnull; + return NS_OK; +} + +NS_IMETHODIMP nsHTMLSelectListAccessible::GetAccLastChild(nsIAccessible **_retval) +{ + nsCOMPtr last; + mDOMNode->GetLastChild(getter_AddRefs(last)); + + *_retval = new nsHTMLSelectOptionAccessible(this, last, mPresShell); + if ( ! *_retval ) + return NS_ERROR_FAILURE; + NS_ADDREF(*_retval); + return NS_OK; +} + +NS_IMETHODIMP nsHTMLSelectListAccessible::GetAccFirstChild(nsIAccessible **_retval) +{ + nsCOMPtr first; + mDOMNode->GetFirstChild(getter_AddRefs(first)); + + *_retval = new nsHTMLSelectOptionAccessible(this, first, mPresShell); + if ( ! *_retval ) + return NS_ERROR_FAILURE; + NS_ADDREF(*_retval); + return NS_OK; +} + +//-------- + +nsHTMLSelectOptionAccessible::nsHTMLSelectOptionAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell): +nsLeafAccessible(aDOMNode, aShell) +{ + mParent = aParent; +} + +NS_IMETHODIMP nsHTMLSelectOptionAccessible::GetAccRole(PRUint32 *_retval) +{ + *_retval = ROLE_LISTITEM; + return NS_OK; +} + +NS_IMETHODIMP nsHTMLSelectOptionAccessible::GetAccParent(nsIAccessible **_retval) +{ + *_retval = mParent; + NS_IF_ADDREF(*_retval); + return NS_OK; +} + +NS_IMETHODIMP nsHTMLSelectOptionAccessible::GetAccNextSibling(nsIAccessible **_retval) +{ + *_retval = nsnull; + + nsCOMPtr next; + mDOMNode->GetNextSibling(getter_AddRefs(next)); + + if (next) { + *_retval = new nsHTMLSelectOptionAccessible(mParent, next, mPresShell); + if ( ! *_retval ) + return NS_ERROR_FAILURE; + NS_ADDREF(*_retval); + } + + return NS_OK; +} + +NS_IMETHODIMP nsHTMLSelectOptionAccessible::GetAccPreviousSibling(nsIAccessible **_retval) +{ + *_retval = nsnull; + + nsCOMPtr prev; + mDOMNode->GetPreviousSibling(getter_AddRefs(prev)); + + if (prev) { + *_retval = new nsHTMLSelectOptionAccessible(mParent, prev, mPresShell); + if ( ! *_retval ) + return NS_ERROR_FAILURE; + NS_ADDREF(*_retval); + } + + return NS_OK; +} + +NS_IMETHODIMP nsHTMLSelectOptionAccessible::GetAccName(nsAWritableString& _retval) +{ + nsCOMPtr content (do_QueryInterface(mDOMNode)); + if (!content) { + return NS_ERROR_FAILURE; + } + + nsAutoString option; + nsresult rv = AppendFlatStringFromSubtree(content, &option); + if (NS_SUCCEEDED(rv)) { + // Temp var needed until CompressWhitespace built for nsAWritableString + option.CompressWhitespace(); + _retval.Assign(option); + } + return rv; +} + diff --git a/mozilla/accessible/src/html/nsHTMLSelectAccessible.h b/mozilla/accessible/src/html/nsHTMLSelectAccessible.h new file mode 100644 index 00000000000..cdf858c842a --- /dev/null +++ b/mozilla/accessible/src/html/nsHTMLSelectAccessible.h @@ -0,0 +1,72 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * + * The contents of this file are subject to the Netscape 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/NPL/ + * + * 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 Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Original Author: Eric Vaughan (evaughan@netscape.com) + * + * Contributor(s): + */ +#ifndef __nsHTMLSelectAccessible_h__ +#define __nsHTMLSelectAccessible_h__ + +#include "nsAccessible.h" +#include "nsCOMPtr.h" +#include "nsIAtom.h" +#include "nsIAccessibleSelectable.h" + +class nsHTMLSelectAccessible : public nsAccessible, + public nsIAccessibleSelectable +{ +public: + + NS_DECL_ISUPPORTS_INHERITED + NS_DECL_NSIACCESSIBLESELECTABLE + + nsHTMLSelectAccessible(nsIDOMNode* aDOMNode, nsIWeakReference* aShell); + virtual ~nsHTMLSelectAccessible() {} + + NS_IMETHOD GetAccLastChild(nsIAccessible **_retval); + NS_IMETHOD GetAccFirstChild(nsIAccessible **_retval); + NS_IMETHOD GetAccRole(PRUint32 *_retval); + NS_IMETHOD GetAccValue(nsAWritableString& _retval); + NS_IMETHOD GetAccChildCount(PRInt32 *_retval); + +// helper method to verify frames + static PRBool IsCorrectFrame( nsIFrame* aFrame, nsIAtom* aAtom ); + +}; + +/* + * Each option in the Select. These are in the nsListAccessible + */ +class nsHTMLSelectOptionAccessible : public nsLeafAccessible +{ +public: + + nsHTMLSelectOptionAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell); + + NS_IMETHOD GetAccParent(nsIAccessible **_retval); + NS_IMETHOD GetAccRole(PRUint32 *_retval); + NS_IMETHOD GetAccNextSibling(nsIAccessible **_retval); + NS_IMETHOD GetAccPreviousSibling(nsIAccessible **_retval); + NS_IMETHOD GetAccName(nsAWritableString& _retval); + + nsCOMPtr mParent; +}; + +#endif diff --git a/mozilla/accessible/src/nsHTMLSelectAccessible.cpp b/mozilla/accessible/src/nsHTMLSelectAccessible.cpp new file mode 100644 index 00000000000..7cab0f760ec --- /dev/null +++ b/mozilla/accessible/src/nsHTMLSelectAccessible.cpp @@ -0,0 +1,792 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * + * The contents of this file are subject to the Netscape 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/NPL/ + * + * 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 Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Original Author: Eric Vaughan (evaughan@netscape.com) + * + * Contributor(s): + */ + +#include "nsHTMLSelectAccessible.h" +#include "nsCOMPtr.h" +#include "nsIDocument.h" +#include "nsIPresShell.h" +#include "nsIPresContext.h" +#include "nsIContent.h" +#include "nsIFrame.h" +#include "nsRootAccessible.h" +#include "nsINameSpaceManager.h" +#include "nsIDOMHTMLInputElement.h" +#include "nsLayoutAtoms.h" +#include "nsIDOMMenuListener.h" +#include "nsIDOMEventReceiver.h" +#include "nsReadableUtils.h" +#include "nsIDOMHTMLCollection.h" +#include "nsISelectElement.h" +#include "nsIDOMHTMLSelectElement.h" +#include "nsIAccessibilityService.h" +#include "nsIServiceManager.h" +#include "nsIDOMHTMLOptionElement.h" + +/* + * A class the represents the text field in the Select to the left + * of the drop down button + */ +class nsHTMLSelectTextFieldAccessible : public nsLeafAccessible +{ +public: + + nsHTMLSelectTextFieldAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell); + + NS_IMETHOD GetAccNextSibling(nsIAccessible **_retval); + NS_IMETHOD GetAccPreviousSibling(nsIAccessible **_retval); + NS_IMETHOD GetAccParent(nsIAccessible **_retval); + NS_IMETHOD GetAccRole(PRUint32 *_retval); + NS_IMETHOD GetAccValue(nsAWritableString& _retval); + + virtual void GetBounds(nsRect& aBounds, nsIFrame** aRelativeFrame); + + nsCOMPtr mParent; +}; + +/* + * A base class that can listen to menu events. Its used so the + * button and the window accessibles can change there name and role + * depending on whether the drop down list is dropped down on not + */ +class nsMenuListenerAccessible : public nsAccessible, + public nsIDOMMenuListener +{ +public: + + NS_DECL_ISUPPORTS_INHERITED + + nsMenuListenerAccessible(nsIDOMNode* aDOMNode, nsIWeakReference* aShell); + virtual ~nsMenuListenerAccessible(); + + // popup listener + NS_IMETHOD Create(nsIDOMEvent* aEvent); + NS_IMETHOD Close(nsIDOMEvent* aEvent); + NS_IMETHOD Destroy(nsIDOMEvent* aEvent); + NS_IMETHOD Action(nsIDOMEvent* aEvent) { return NS_OK; } + NS_IMETHOD Broadcast(nsIDOMEvent* aEvent) { return NS_OK; } + NS_IMETHOD CommandUpdate(nsIDOMEvent* aEvent) { return NS_OK; } + NS_IMETHOD HandleEvent(nsIDOMEvent* aEvent) { return NS_OK; } + + virtual void SetupMenuListener(); + + PRBool mRegistered; + PRBool mOpen; +}; + +NS_IMPL_ISUPPORTS_INHERITED(nsMenuListenerAccessible, nsAccessible, nsIDOMMenuListener) + +/** + * A class that represents the button inside the Select to the right of the text field + */ +class nsHTMLSelectButtonAccessible : public nsMenuListenerAccessible +{ +public: + + nsHTMLSelectButtonAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell); + + NS_IMETHOD GetAccNextSibling(nsIAccessible **_retval); + NS_IMETHOD GetAccPreviousSibling(nsIAccessible **_retval); + NS_IMETHOD GetAccParent(nsIAccessible **_retval); + NS_IMETHOD GetAccName(nsAWritableString& _retval); + NS_IMETHOD GetAccRole(PRUint32 *_retval); + NS_IMETHOD GetAccLastChild(nsIAccessible **_retval); + NS_IMETHOD GetAccFirstChild(nsIAccessible **_retval); + NS_IMETHOD GetAccChildCount(PRInt32 *_retval); + NS_IMETHOD GetAccNumActions(PRUint8 *_retval); + NS_IMETHOD GetAccActionName(PRUint8 index, nsAWritableString& _retval); + NS_IMETHOD AccDoAction(PRUint8 index); + + + virtual void GetBounds(nsRect& aBounds, nsIFrame** aRelativeFrame); + + + + nsCOMPtr mParent; +}; + +/* + * A class that represents the window that lives to the right + * of the drop down button inside the Select. This is the window + * that is made visible when the button is pressed. + */ +class nsHTMLSelectWindowAccessible : public nsMenuListenerAccessible +{ +public: + + nsHTMLSelectWindowAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell); + + NS_IMETHOD GetAccParent(nsIAccessible **_retval); + NS_IMETHOD GetAccNextSibling(nsIAccessible **_retval); + NS_IMETHOD GetAccPreviousSibling(nsIAccessible **_retval); + NS_IMETHOD GetAccLastChild(nsIAccessible **_retval); + NS_IMETHOD GetAccFirstChild(nsIAccessible **_retval); + NS_IMETHOD GetAccChildCount(PRInt32 *_retval); + NS_IMETHOD GetAccRole(PRUint32 *_retval); + NS_IMETHOD GetAccState(PRUint32 *_retval); + + virtual void GetBounds(nsRect& aBounds, nsIFrame** aRelativeFrame); + + nsCOMPtr mParent; +}; + +/* + * The list that contains all the options in the select. It is inside the window. + */ +class nsHTMLSelectListAccessible : public nsAccessible +{ +public: + + nsHTMLSelectListAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell); + virtual ~nsHTMLSelectListAccessible() {} + + NS_IMETHOD GetAccParent(nsIAccessible **_retval); + NS_IMETHOD GetAccRole(PRUint32 *_retval); + NS_IMETHOD GetAccNextSibling(nsIAccessible **_retval); + NS_IMETHOD GetAccPreviousSibling(nsIAccessible **_retval); + NS_IMETHOD AccGetBounds(PRInt32 *x, PRInt32 *y, PRInt32 *width, PRInt32 *height); + NS_IMETHOD GetAccLastChild(nsIAccessible **_retval); + NS_IMETHOD GetAccFirstChild(nsIAccessible **_retval); + + nsCOMPtr mParent; +}; + +//--------- nsHTMLSelectAccessible ----- + +nsHTMLSelectAccessible::nsHTMLSelectAccessible(nsIDOMNode* aDOMNode, + nsIWeakReference* aShell) + :nsAccessible(aDOMNode, aShell) +{ +} + +NS_IMPL_ISUPPORTS_INHERITED1(nsHTMLSelectAccessible, nsAccessible, nsIAccessibleSelectable) + +// ------------- Helper method for determination of proper Frame ------ +//static +PRBool nsHTMLSelectAccessible::IsCorrectFrame( nsIFrame* aFrame, nsIAtom* aAtom ) { + if (!aFrame || !aAtom) + return PR_FALSE; + nsCOMPtr frameType; + aFrame->GetFrameType(getter_AddRefs(frameType)); + if (frameType.get() != aAtom) + return PR_FALSE; + return PR_TRUE; +} + +NS_IMETHODIMP nsHTMLSelectAccessible::GetAccValue(nsAWritableString& _retval) +{ + nsCOMPtr text; + GetAccFirstChild(getter_AddRefs(text)); + if (text) + return text->GetAccValue(_retval); + + return NS_ERROR_FAILURE; +} + + +NS_IMETHODIMP nsHTMLSelectAccessible::GetAccRole(PRUint32 *_retval) +{ + *_retval = ROLE_COMBOBOX; + return NS_OK; +} + +NS_IMETHODIMP nsHTMLSelectAccessible::GetAccLastChild(nsIAccessible **_retval) +{ + // create a window accessible + *_retval = new nsHTMLSelectWindowAccessible(this, mDOMNode, mPresShell); + if ( ! *_retval ) + return NS_ERROR_FAILURE; + NS_ADDREF(*_retval); + return NS_OK; +} + +NS_IMETHODIMP nsHTMLSelectAccessible::GetAccFirstChild(nsIAccessible **_retval) +{ + // create a text field + + *_retval = new nsHTMLSelectTextFieldAccessible(this, mDOMNode, mPresShell); + if ( ! *_retval ) + return NS_ERROR_FAILURE; + NS_ADDREF(*_retval); + return NS_OK; +} + +NS_IMETHODIMP nsHTMLSelectAccessible::GetAccChildCount(PRInt32 *_retval) +{ + // always have 3 children + *_retval = 3; + return NS_OK; +} + +NS_IMETHODIMP nsHTMLSelectAccessible::GetSelectedChildren(nsISupportsArray **_retval) +{ + *_retval = nsnull; + return NS_OK; +} + +//-------- SelectTextFieldAccessible ------ + +nsHTMLSelectTextFieldAccessible::nsHTMLSelectTextFieldAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell): +nsLeafAccessible(aDOMNode, aShell) +{ + mParent = aParent; +} + +NS_IMETHODIMP nsHTMLSelectTextFieldAccessible::GetAccValue(nsAWritableString& _retval) +{ + nsIFrame* frame = nsAccessible::GetBoundsFrame(); + nsCOMPtr context; + GetPresContext(context); + if ( !frame ) + return NS_ERROR_FAILURE; + + frame->FirstChild(context, nsnull, &frame); + if ( ! nsHTMLSelectAccessible::IsCorrectFrame( frame, nsLayoutAtoms::blockFrame) ) + return NS_ERROR_FAILURE; + + frame->FirstChild(context, nsnull, &frame); + if ( ! nsHTMLSelectAccessible::IsCorrectFrame( frame, nsLayoutAtoms::textFrame) ) + return NS_ERROR_FAILURE; + + nsCOMPtr content; + frame->GetContent(getter_AddRefs(content)); + + if (!content) + return NS_ERROR_FAILURE; + + AppendFlatStringFromSubtree(content, &_retval); + + return NS_OK; +} + +void nsHTMLSelectTextFieldAccessible::GetBounds(nsRect& aBounds, nsIFrame** aRelativeFrame) +{ + // get our first child's frame + nsIFrame* frame = nsAccessible::GetBoundsFrame(); + nsCOMPtr context; + GetPresContext(context); + if ( !frame ) + return; + + frame->FirstChild(context, nsnull, &frame); + if ( ! nsHTMLSelectAccessible::IsCorrectFrame( frame, nsLayoutAtoms::blockFrame) ) + return; + + frame->GetParent(aRelativeFrame); + if ( ! nsHTMLSelectAccessible::IsCorrectFrame( *aRelativeFrame, nsLayoutAtoms::areaFrame) ) + return; + + frame->GetRect(aBounds); +} + +NS_IMETHODIMP nsHTMLSelectTextFieldAccessible::GetAccParent(nsIAccessible **_retval) +{ + *_retval = mParent; + NS_IF_ADDREF(*_retval); + return NS_OK; +} + +NS_IMETHODIMP nsHTMLSelectTextFieldAccessible::GetAccNextSibling(nsIAccessible **_retval) +{ + nsCOMPtr parent; + GetAccParent(getter_AddRefs(parent)); + + *_retval = new nsHTMLSelectButtonAccessible(parent, mDOMNode, mPresShell); + if ( ! *_retval ) + return NS_ERROR_FAILURE; + NS_ADDREF(*_retval); + return NS_OK; +} + +NS_IMETHODIMP nsHTMLSelectTextFieldAccessible::GetAccPreviousSibling(nsIAccessible **_retval) +{ + *_retval = nsnull; + return NS_OK; +} + +NS_IMETHODIMP nsHTMLSelectTextFieldAccessible::GetAccRole(PRUint32 *_retval) +{ + *_retval = ROLE_STATICTEXT; + return NS_OK; +} + +// --------- nsMenuListenerAccessible ----------- + +nsMenuListenerAccessible::nsMenuListenerAccessible(nsIDOMNode* aDOMNode, nsIWeakReference* aShell): +nsAccessible(aDOMNode, aShell) +{ + mRegistered = PR_FALSE; + mOpen = PR_FALSE; +} + +nsMenuListenerAccessible::~nsMenuListenerAccessible() +{ + if (mRegistered) { + nsCOMPtr eventReceiver(do_QueryInterface(mDOMNode)); + if (eventReceiver) + eventReceiver->RemoveEventListener(NS_LITERAL_STRING("create"), this, PR_TRUE); + } +} + +NS_IMETHODIMP nsMenuListenerAccessible::Create(nsIDOMEvent* aEvent) +{ + mOpen = PR_TRUE; + + /* TBD send state change event */ + + return NS_OK; +} + +NS_IMETHODIMP nsMenuListenerAccessible::Destroy(nsIDOMEvent* aEvent) +{ + mOpen = PR_FALSE; + + /* TBD send state change event */ + + return NS_OK; +} + +NS_IMETHODIMP nsMenuListenerAccessible::Close(nsIDOMEvent* aEvent) +{ + mOpen = PR_FALSE; + + /* TBD send state change event */ + + return NS_OK; +} + +void +nsMenuListenerAccessible::SetupMenuListener() +{ + // not not already one register ourselves as a popup listener + if (!mRegistered) { + + nsCOMPtr eventReceiver(do_QueryInterface(mDOMNode)); + if (!eventReceiver) { + return; + } + + nsresult rv = eventReceiver->AddEventListener(NS_LITERAL_STRING("create"), this, PR_TRUE); + + if (NS_FAILED(rv)) { + return; + } + + mRegistered = PR_TRUE; + } + +} + + +//-------- SelectButtonAccessible ------ + +nsHTMLSelectButtonAccessible::nsHTMLSelectButtonAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell): +nsMenuListenerAccessible(aDOMNode, aShell) +{ + mParent = aParent; +} + +/* void accDoAction (in PRUint8 index); */ +NS_IMETHODIMP nsHTMLSelectButtonAccessible::AccDoAction(PRUint8 index) +{ + nsIFrame* frame = nsAccessible::GetBoundsFrame(); + nsCOMPtr context; + GetPresContext(context); + + frame->FirstChild(context, nsnull, &frame); + if ( ! nsHTMLSelectAccessible::IsCorrectFrame( frame, nsLayoutAtoms::blockFrame) ) + return NS_ERROR_FAILURE; + + frame->GetNextSibling(&frame); + if ( ! nsHTMLSelectAccessible::IsCorrectFrame( frame, nsLayoutAtoms::gfxButtonControlFrame) ) + return NS_ERROR_FAILURE; + + nsCOMPtr content; + frame->GetContent(getter_AddRefs(content)); + + if (index == 0) { + nsCOMPtr element(do_QueryInterface(content)); + if (element) + { + element->Click(); + return NS_OK; + } + return NS_ERROR_FAILURE; + } + return NS_ERROR_NOT_IMPLEMENTED; +} + +/* PRUint8 getAccNumActions (); */ +NS_IMETHODIMP nsHTMLSelectButtonAccessible::GetAccNumActions(PRUint8 *_retval) +{ + *_retval = 1; + return NS_OK; +} + +void nsHTMLSelectButtonAccessible::GetBounds(nsRect& aBounds, nsIFrame** aRelativeFrame) +{ + // get our second child's frame + nsIFrame* frame = nsAccessible::GetBoundsFrame(); + nsCOMPtr context; + GetPresContext(context); + + frame->FirstChild(context, nsnull, &frame); + if ( ! nsHTMLSelectAccessible::IsCorrectFrame( frame, nsLayoutAtoms::blockFrame) ) + return; + + frame->GetNextSibling(&frame); + if ( ! nsHTMLSelectAccessible::IsCorrectFrame( frame, nsLayoutAtoms::gfxButtonControlFrame) ) + return; + + frame->GetParent(aRelativeFrame); + if ( ! nsHTMLSelectAccessible::IsCorrectFrame( *aRelativeFrame, nsLayoutAtoms::areaFrame) ) + return; + + frame->GetRect(aBounds); +} + +NS_IMETHODIMP nsHTMLSelectButtonAccessible::GetAccRole(PRUint32 *_retval) +{ + *_retval = ROLE_PUSHBUTTON; + return NS_OK; +} + +NS_IMETHODIMP nsHTMLSelectButtonAccessible::GetAccParent(nsIAccessible **_retval) +{ + *_retval = mParent; + NS_IF_ADDREF(*_retval); + return NS_OK; +} + + +NS_IMETHODIMP nsHTMLSelectButtonAccessible::GetAccName(nsAWritableString& _retval) +{ + return GetAccActionName(0, _retval); +} + +NS_IMETHODIMP nsHTMLSelectButtonAccessible::GetAccActionName(PRUint8 index, nsAWritableString& _retval) +{ + SetupMenuListener(); + + // get the current state open or closed + // set _retval to it. + // notice its supposed to be reversed. Close if opened + // and Open if closed. + + if (mOpen) + _retval = NS_LITERAL_STRING("Close"); + else + _retval = NS_LITERAL_STRING("Open"); + + return NS_OK; +} + + +NS_IMETHODIMP nsHTMLSelectButtonAccessible::GetAccNextSibling(nsIAccessible **_retval) +{ + nsCOMPtr parent; + GetAccParent(getter_AddRefs(parent)); + + *_retval = new nsHTMLSelectWindowAccessible(parent, mDOMNode, mPresShell); + if ( ! *_retval ) + return NS_ERROR_FAILURE; + NS_ADDREF(*_retval); + return NS_OK; +} + +NS_IMETHODIMP nsHTMLSelectButtonAccessible::GetAccPreviousSibling(nsIAccessible **_retval) +{ + nsCOMPtr parent; + GetAccParent(getter_AddRefs(parent)); + + *_retval = new nsHTMLSelectTextFieldAccessible(parent, mDOMNode, mPresShell); + if ( ! *_retval ) + return NS_ERROR_FAILURE; + NS_ADDREF(*_retval); + return NS_OK; +} + +NS_IMETHODIMP nsHTMLSelectButtonAccessible::GetAccLastChild(nsIAccessible **_retval) +{ + *_retval = nsnull; + return NS_OK; +} + +NS_IMETHODIMP nsHTMLSelectButtonAccessible::GetAccFirstChild(nsIAccessible **_retval) +{ + *_retval = nsnull; + return NS_OK; +} + +NS_IMETHODIMP nsHTMLSelectButtonAccessible::GetAccChildCount(PRInt32 *_retval) +{ + *_retval = 0; + return NS_OK; +} + +//--------------------- + + +nsHTMLSelectWindowAccessible::nsHTMLSelectWindowAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell) +:nsMenuListenerAccessible(aDOMNode, aShell) +{ + mParent = aParent; +} + + +NS_IMETHODIMP nsHTMLSelectWindowAccessible::GetAccState(PRUint32 *_retval) +{ + nsAccessible::GetAccState(_retval); + + SetupMenuListener(); + + // if open we are visible if closed we are invisible + // set _retval to it. + if (mOpen) + *_retval |= STATE_DEFAULT; + else + *_retval |= STATE_INVISIBLE; + + return NS_OK; +} + +NS_IMETHODIMP nsHTMLSelectWindowAccessible::GetAccRole(PRUint32 *_retval) +{ + *_retval = ROLE_WINDOW; + return NS_OK; +} + +NS_IMETHODIMP nsHTMLSelectWindowAccessible::GetAccParent(nsIAccessible **_retval) +{ + *_retval = mParent; + NS_IF_ADDREF(*_retval); + return NS_OK; +} + +NS_IMETHODIMP nsHTMLSelectWindowAccessible::GetAccPreviousSibling(nsIAccessible **_retval) +{ + nsCOMPtr parent; + GetAccParent(getter_AddRefs(parent)); + + *_retval = new nsHTMLSelectButtonAccessible(parent, mDOMNode, mPresShell); + if ( ! *_retval ) + return NS_ERROR_FAILURE; + NS_ADDREF(*_retval); + return NS_OK; +} + +NS_IMETHODIMP nsHTMLSelectWindowAccessible::GetAccNextSibling(nsIAccessible **_retval) +{ + *_retval = nsnull; + return NS_OK; +} + +NS_IMETHODIMP nsHTMLSelectWindowAccessible::GetAccLastChild(nsIAccessible **_retval) +{ + *_retval = new nsHTMLSelectListAccessible(this, mDOMNode, mPresShell); + if ( ! *_retval ) + return NS_ERROR_FAILURE; + NS_ADDREF(*_retval); + return NS_OK; +} + +NS_IMETHODIMP nsHTMLSelectWindowAccessible::GetAccFirstChild(nsIAccessible **_retval) +{ + *_retval = new nsHTMLSelectListAccessible(this, mDOMNode, mPresShell); + if ( ! *_retval ) + return NS_ERROR_FAILURE; + NS_ADDREF(*_retval); + return NS_OK; +} + +NS_IMETHODIMP nsHTMLSelectWindowAccessible::GetAccChildCount(PRInt32 *_retval) +{ + *_retval = 1; + return NS_OK; +} + +void nsHTMLSelectWindowAccessible::GetBounds(nsRect& aBounds, nsIFrame** aRelativeFrame) +{ + // get our first option + nsCOMPtr child; + mDOMNode->GetFirstChild(getter_AddRefs(child)); + + // now get its frame + nsCOMPtr shell(do_QueryReferent(mPresShell)); + if (!shell) { + *aRelativeFrame = nsnull; + return; + } + + nsIFrame* frame = nsnull; + nsCOMPtr content(do_QueryInterface(child)); + shell->GetPrimaryFrameFor(content, &frame); + if ( ! nsHTMLSelectAccessible::IsCorrectFrame( frame, nsLayoutAtoms::blockFrame) ) + return; + + frame->GetParent(&frame); + if ( ! nsHTMLSelectAccessible::IsCorrectFrame( frame, nsLayoutAtoms::areaFrame) ) + return; + + frame->GetParent(aRelativeFrame); + if ( ! nsHTMLSelectAccessible::IsCorrectFrame( *aRelativeFrame, nsLayoutAtoms::listControlFrame) ) + return; + + frame->GetRect(aBounds); +} + +//---------- + + +nsHTMLSelectListAccessible::nsHTMLSelectListAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell) +:nsAccessible(aDOMNode, aShell) +{ + mParent = aParent; +} + +NS_IMETHODIMP nsHTMLSelectListAccessible::AccGetBounds(PRInt32 *x, PRInt32 *y, PRInt32 *width, PRInt32 *height) +{ + return mParent->AccGetBounds(x,y,width,height); +} + +NS_IMETHODIMP nsHTMLSelectListAccessible::GetAccParent(nsIAccessible **_retval) +{ + *_retval = mParent; + NS_ADDREF(*_retval); + return NS_OK; +} + +NS_IMETHODIMP nsHTMLSelectListAccessible::GetAccRole(PRUint32 *_retval) +{ + *_retval = ROLE_LIST; + return NS_OK; +} + +NS_IMETHODIMP nsHTMLSelectListAccessible::GetAccPreviousSibling(nsIAccessible **_retval) +{ + *_retval = nsnull; + return NS_OK; +} + +NS_IMETHODIMP nsHTMLSelectListAccessible::GetAccNextSibling(nsIAccessible **_retval) +{ + *_retval = nsnull; + return NS_OK; +} + +NS_IMETHODIMP nsHTMLSelectListAccessible::GetAccLastChild(nsIAccessible **_retval) +{ + nsCOMPtr last; + mDOMNode->GetLastChild(getter_AddRefs(last)); + + *_retval = new nsHTMLSelectOptionAccessible(this, last, mPresShell); + if ( ! *_retval ) + return NS_ERROR_FAILURE; + NS_ADDREF(*_retval); + return NS_OK; +} + +NS_IMETHODIMP nsHTMLSelectListAccessible::GetAccFirstChild(nsIAccessible **_retval) +{ + nsCOMPtr first; + mDOMNode->GetFirstChild(getter_AddRefs(first)); + + *_retval = new nsHTMLSelectOptionAccessible(this, first, mPresShell); + if ( ! *_retval ) + return NS_ERROR_FAILURE; + NS_ADDREF(*_retval); + return NS_OK; +} + +//-------- + +nsHTMLSelectOptionAccessible::nsHTMLSelectOptionAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell): +nsLeafAccessible(aDOMNode, aShell) +{ + mParent = aParent; +} + +NS_IMETHODIMP nsHTMLSelectOptionAccessible::GetAccRole(PRUint32 *_retval) +{ + *_retval = ROLE_LISTITEM; + return NS_OK; +} + +NS_IMETHODIMP nsHTMLSelectOptionAccessible::GetAccParent(nsIAccessible **_retval) +{ + *_retval = mParent; + NS_IF_ADDREF(*_retval); + return NS_OK; +} + +NS_IMETHODIMP nsHTMLSelectOptionAccessible::GetAccNextSibling(nsIAccessible **_retval) +{ + *_retval = nsnull; + + nsCOMPtr next; + mDOMNode->GetNextSibling(getter_AddRefs(next)); + + if (next) { + *_retval = new nsHTMLSelectOptionAccessible(mParent, next, mPresShell); + if ( ! *_retval ) + return NS_ERROR_FAILURE; + NS_ADDREF(*_retval); + } + + return NS_OK; +} + +NS_IMETHODIMP nsHTMLSelectOptionAccessible::GetAccPreviousSibling(nsIAccessible **_retval) +{ + *_retval = nsnull; + + nsCOMPtr prev; + mDOMNode->GetPreviousSibling(getter_AddRefs(prev)); + + if (prev) { + *_retval = new nsHTMLSelectOptionAccessible(mParent, prev, mPresShell); + if ( ! *_retval ) + return NS_ERROR_FAILURE; + NS_ADDREF(*_retval); + } + + return NS_OK; +} + +NS_IMETHODIMP nsHTMLSelectOptionAccessible::GetAccName(nsAWritableString& _retval) +{ + nsCOMPtr content (do_QueryInterface(mDOMNode)); + if (!content) { + return NS_ERROR_FAILURE; + } + + nsAutoString option; + nsresult rv = AppendFlatStringFromSubtree(content, &option); + if (NS_SUCCEEDED(rv)) { + // Temp var needed until CompressWhitespace built for nsAWritableString + option.CompressWhitespace(); + _retval.Assign(option); + } + return rv; +} + diff --git a/mozilla/accessible/src/nsHTMLSelectAccessible.h b/mozilla/accessible/src/nsHTMLSelectAccessible.h new file mode 100644 index 00000000000..cdf858c842a --- /dev/null +++ b/mozilla/accessible/src/nsHTMLSelectAccessible.h @@ -0,0 +1,72 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * + * The contents of this file are subject to the Netscape 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/NPL/ + * + * 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 Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Original Author: Eric Vaughan (evaughan@netscape.com) + * + * Contributor(s): + */ +#ifndef __nsHTMLSelectAccessible_h__ +#define __nsHTMLSelectAccessible_h__ + +#include "nsAccessible.h" +#include "nsCOMPtr.h" +#include "nsIAtom.h" +#include "nsIAccessibleSelectable.h" + +class nsHTMLSelectAccessible : public nsAccessible, + public nsIAccessibleSelectable +{ +public: + + NS_DECL_ISUPPORTS_INHERITED + NS_DECL_NSIACCESSIBLESELECTABLE + + nsHTMLSelectAccessible(nsIDOMNode* aDOMNode, nsIWeakReference* aShell); + virtual ~nsHTMLSelectAccessible() {} + + NS_IMETHOD GetAccLastChild(nsIAccessible **_retval); + NS_IMETHOD GetAccFirstChild(nsIAccessible **_retval); + NS_IMETHOD GetAccRole(PRUint32 *_retval); + NS_IMETHOD GetAccValue(nsAWritableString& _retval); + NS_IMETHOD GetAccChildCount(PRInt32 *_retval); + +// helper method to verify frames + static PRBool IsCorrectFrame( nsIFrame* aFrame, nsIAtom* aAtom ); + +}; + +/* + * Each option in the Select. These are in the nsListAccessible + */ +class nsHTMLSelectOptionAccessible : public nsLeafAccessible +{ +public: + + nsHTMLSelectOptionAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell); + + NS_IMETHOD GetAccParent(nsIAccessible **_retval); + NS_IMETHOD GetAccRole(PRUint32 *_retval); + NS_IMETHOD GetAccNextSibling(nsIAccessible **_retval); + NS_IMETHOD GetAccPreviousSibling(nsIAccessible **_retval); + NS_IMETHOD GetAccName(nsAWritableString& _retval); + + nsCOMPtr mParent; +}; + +#endif diff --git a/mozilla/extensions/help/resources/skin/classic/help.css b/mozilla/extensions/help/resources/skin/classic/help.css new file mode 100644 index 00000000000..95405f842dc --- /dev/null +++ b/mozilla/extensions/help/resources/skin/classic/help.css @@ -0,0 +1,46 @@ +/* + * The contents of this file are subject to the Netscape 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/NPL/ + * + * 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 Netscape are + * Copyright (C) 1998-1999 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Joe Hewitt (hewitt@netscape.com) + */ + +@import url("chrome://communicator/skin/"); + +@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); + +/* ::::: primary toolbar buttons ::::: */ + +#print { + list-style-image: url("chrome://global/skin/print.gif"); +} + +#print[disabled="true"], +#print[disabled="true"]:hover, +#print[disabled="true"]:hover:active { + list-style-image: url("chrome://global/skin/print-disabled.gif"); +} + +#print:hover { + list-style-image: url("chrome://global/skin/print-hover.gif"); +} + +#print:hover:active { + list-style-image: url("chrome://global/skin/print-hover-active.gif"); +} + diff --git a/mozilla/extensions/help/resources/skin/modern/help.css b/mozilla/extensions/help/resources/skin/modern/help.css new file mode 100644 index 00000000000..420193792f8 --- /dev/null +++ b/mozilla/extensions/help/resources/skin/modern/help.css @@ -0,0 +1,117 @@ +/* + * The contents of this file are subject to the Netscape 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/NPL/ + * + * 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 Netscape are + * Copyright (C) 1998-1999 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Joe Hewitt (hewitt@netscape.com) + */ + +@import url("chrome://communicator/skin/"); + +@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); + +/* ::::: primary toolbar masthead ::::: */ + +#helpToolbar > .toolbar-holder > .toolbar-primary-icon { + background-image: url("chrome://communicator/skin/help/mast-help.gif"); +} + +/* ::::: primary toolbar buttons ::::: */ + +.button-toolbar-1 { + margin: 0px; +} + +.toolbar-primary-mid-top { + background-image: url("chrome://navigator/skin/toolbar/navbar-mid-top.gif"); +} + +#helpBackButton { + list-style-image: url("chrome://navigator/skin/btn1/back.gif"); +} + +#helpBackButton[disabled="true"], +#helpBackButton[disabled="true"]:hover, +#helpBackButton[disabled="true"]:hover:active +{ + list-style-image: url("chrome://navigator/skin/btn1/back-dis.gif"); +} + +#helpBackButton:hover { + list-style-image: url("chrome://navigator/skin/btn1/back-hov.gif"); +} + +#helpBackButton:hover:active { + list-style-image: url("chrome://navigator/skin/btn1/back-act.gif"); +} + +#helpForwardButton { + list-style-image: url("chrome://navigator/skin/btn1/forward.gif"); +} + +#helpForwardButton[disabled="true"], +#helpForwardButton[disabled="true"]:hover, +#helpForwardButton[disabled="true"]:hover:active +{ + list-style-image: url("chrome://navigator/skin/btn1/forward-dis.gif"); +} + +#helpForwardButton:hover { + list-style-image: url("chrome://navigator/skin/btn1/forward-hov.gif"); +} + +#helpForwardButton:hover:active { + list-style-image: url("chrome://navigator/skin/btn1/forward-act.gif"); +} + +#helpHomeButton { + list-style-image: url("chrome://communicator/skin/help/home.gif"); +} + +#helpHomeButton[disabled="true"], +#helpHomeButton[disabled="true"]:hover, +#helpHomeButton[disabled="true"]:hover:active +{ + list-style-image: url("chrome://communicator/skin/help/home-dis.gif"); +} + +#helpHomeButton:hover { + list-style-image: url("chrome://communicator/skin/help/home-hov.gif"); +} + +#helpHomeButton:hover:active { + list-style-image: url("chrome://communicator/skin/help/home-act.gif"); +} + +#print { + list-style-image: url("chrome://communicator/skin/btn1/print.gif"); +} + +#print[disabled="true"], +#print[disabled="true"]:hover, +#print[disabled="true"]:hover:active { + list-style-image: url("chrome://communicator/skin/btn1/print-dis.gif"); +} + +#print:hover { + list-style-image: url("chrome://communicator/skin/btn1/print-hov.gif"); +} + +#print:hover:active { + list-style-image: url("chrome://communicator/skin/btn1/print-act.gif"); +} + diff --git a/mozilla/extensions/help/resources/skin/modern/home-act.gif b/mozilla/extensions/help/resources/skin/modern/home-act.gif new file mode 100644 index 00000000000..090b4937c9f Binary files /dev/null and b/mozilla/extensions/help/resources/skin/modern/home-act.gif differ diff --git a/mozilla/extensions/help/resources/skin/modern/home-dis.gif b/mozilla/extensions/help/resources/skin/modern/home-dis.gif new file mode 100644 index 00000000000..cbe0c7ff97a Binary files /dev/null and b/mozilla/extensions/help/resources/skin/modern/home-dis.gif differ diff --git a/mozilla/extensions/help/resources/skin/modern/home-hov.gif b/mozilla/extensions/help/resources/skin/modern/home-hov.gif new file mode 100644 index 00000000000..cf58f65ceaf Binary files /dev/null and b/mozilla/extensions/help/resources/skin/modern/home-hov.gif differ diff --git a/mozilla/extensions/help/resources/skin/modern/home.gif b/mozilla/extensions/help/resources/skin/modern/home.gif new file mode 100644 index 00000000000..6043cee8005 Binary files /dev/null and b/mozilla/extensions/help/resources/skin/modern/home.gif differ diff --git a/mozilla/extensions/help/resources/skin/modern/mast-help.gif b/mozilla/extensions/help/resources/skin/modern/mast-help.gif new file mode 100644 index 00000000000..cae3414231c Binary files /dev/null and b/mozilla/extensions/help/resources/skin/modern/mast-help.gif differ diff --git a/mozilla/extensions/transformiix/source/xpath/Expr.cpp b/mozilla/extensions/transformiix/source/xpath/Expr.cpp new file mode 100644 index 00000000000..380e4c3c9eb --- /dev/null +++ b/mozilla/extensions/transformiix/source/xpath/Expr.cpp @@ -0,0 +1,44 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * 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 Initial Developer of the Original Code is Jonas Sicking. + * Portions created by Jonas Sicking are Copyright (C) 2001, Jonas Sicking. + * All rights reserved. + * + * Contributor(s): + * Jonas Sicking, sicking@bigfoot.com + * -- original author. + */ + +#include "Expr.h" + +Expr::~Expr() { +} + +/* + * Determines whether this Expr matches the given node within + * the given context. + */ +MBool Expr::matches(Node* node, Node* context, ContextState* cs) +{ + NS_ASSERTION(0, "Expr::matches() called"); + return MB_FALSE; +} + +/* + * Returns the default priority of this Expr based on the given Node, + * context Node, and ContextState. + */ +double Expr::getDefaultPriority(Node* node, Node* context, ContextState* cs) +{ + NS_ASSERTION(0, "Expr::matches() called"); + return 0; +} diff --git a/mozilla/extensions/transformiix/source/xpath/ExprLexerChars.cpp b/mozilla/extensions/transformiix/source/xpath/ExprLexerChars.cpp new file mode 100644 index 00000000000..2ee2fe0fa20 --- /dev/null +++ b/mozilla/extensions/transformiix/source/xpath/ExprLexerChars.cpp @@ -0,0 +1,372 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * 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 Axel Hecht. Portions + * created by Axel Hecht are Copyright (C) 2001 Axel Hecht. All + * Rights Reserved. + * + * Contributor(s): + * Axel Hecht (Original Author) + */ + +#include "ExprLexer.h" + +// macros for inclusion of char range headers +#define TX_CHAR_RANGE(ch, a, b) if (ch < a) return MB_FALSE; \ + if (ch <= b) return MB_TRUE +#define TX_MATCH_CHAR(ch, a) if (ch < a) return MB_FALSE; \ + if (ch == a) return MB_TRUE + +/** + * Returns true if the given character represents a numeric letter (digit) +**/ +MBool ExprLexer::isDigit(UNICODE_CHAR ch) +{ + TX_CHAR_RANGE(ch, '0', '9'); + return MB_FALSE; +} //-- isDigit + +/** + * Returns true if the given character represents an Alpha letter +**/ +MBool ExprLexer::isLetter(UNICODE_CHAR ch) +{ +/* Letter = BaseChar | Ideographic; and _ */ + TX_CHAR_RANGE(ch, 0x0041, 0x005A); + TX_MATCH_CHAR(ch, 0x005F); /* '_' */ + TX_CHAR_RANGE(ch, 0x0061, 0x007A); + TX_CHAR_RANGE(ch, 0x00C0, 0x00D6); + TX_CHAR_RANGE(ch, 0x00D8, 0x00F6); + TX_CHAR_RANGE(ch, 0x00F8, 0x00FF); + TX_CHAR_RANGE(ch, 0x0100, 0x0131); + TX_CHAR_RANGE(ch, 0x0134, 0x013E); + TX_CHAR_RANGE(ch, 0x0141, 0x0148); + TX_CHAR_RANGE(ch, 0x014A, 0x017E); + TX_CHAR_RANGE(ch, 0x0180, 0x01C3); + TX_CHAR_RANGE(ch, 0x01CD, 0x01F0); + TX_CHAR_RANGE(ch, 0x01F4, 0x01F5); + TX_CHAR_RANGE(ch, 0x01FA, 0x0217); + TX_CHAR_RANGE(ch, 0x0250, 0x02A8); + TX_CHAR_RANGE(ch, 0x02BB, 0x02C1); + TX_MATCH_CHAR(ch, 0x0386); + TX_CHAR_RANGE(ch, 0x0388, 0x038A); + TX_MATCH_CHAR(ch, 0x038C); + TX_CHAR_RANGE(ch, 0x038E, 0x03A1); + TX_CHAR_RANGE(ch, 0x03A3, 0x03CE); + TX_CHAR_RANGE(ch, 0x03D0, 0x03D6); + TX_MATCH_CHAR(ch, 0x03DA); + TX_MATCH_CHAR(ch, 0x03DC); + TX_MATCH_CHAR(ch, 0x03DE); + TX_MATCH_CHAR(ch, 0x03E0); + TX_CHAR_RANGE(ch, 0x03E2, 0x03F3); + TX_CHAR_RANGE(ch, 0x0401, 0x040C); + TX_CHAR_RANGE(ch, 0x040E, 0x044F); + TX_CHAR_RANGE(ch, 0x0451, 0x045C); + TX_CHAR_RANGE(ch, 0x045E, 0x0481); + TX_CHAR_RANGE(ch, 0x0490, 0x04C4); + TX_CHAR_RANGE(ch, 0x04C7, 0x04C8); + TX_CHAR_RANGE(ch, 0x04CB, 0x04CC); + TX_CHAR_RANGE(ch, 0x04D0, 0x04EB); + TX_CHAR_RANGE(ch, 0x04EE, 0x04F5); + TX_CHAR_RANGE(ch, 0x04F8, 0x04F9); + TX_CHAR_RANGE(ch, 0x0531, 0x0556); + TX_MATCH_CHAR(ch, 0x0559); + TX_CHAR_RANGE(ch, 0x0561, 0x0586); + TX_CHAR_RANGE(ch, 0x05D0, 0x05EA); + TX_CHAR_RANGE(ch, 0x05F0, 0x05F2); + TX_CHAR_RANGE(ch, 0x0621, 0x063A); + TX_CHAR_RANGE(ch, 0x0641, 0x064A); + TX_CHAR_RANGE(ch, 0x0671, 0x06B7); + TX_CHAR_RANGE(ch, 0x06BA, 0x06BE); + TX_CHAR_RANGE(ch, 0x06C0, 0x06CE); + TX_CHAR_RANGE(ch, 0x06D0, 0x06D3); + TX_MATCH_CHAR(ch, 0x06D5); + TX_CHAR_RANGE(ch, 0x06E5, 0x06E6); + TX_CHAR_RANGE(ch, 0x0905, 0x0939); + TX_MATCH_CHAR(ch, 0x093D); + TX_CHAR_RANGE(ch, 0x0958, 0x0961); + TX_CHAR_RANGE(ch, 0x0985, 0x098C); + TX_CHAR_RANGE(ch, 0x098F, 0x0990); + TX_CHAR_RANGE(ch, 0x0993, 0x09A8); + TX_CHAR_RANGE(ch, 0x09AA, 0x09B0); + TX_MATCH_CHAR(ch, 0x09B2); + TX_CHAR_RANGE(ch, 0x09B6, 0x09B9); + TX_CHAR_RANGE(ch, 0x09DC, 0x09DD); + TX_CHAR_RANGE(ch, 0x09DF, 0x09E1); + TX_CHAR_RANGE(ch, 0x09F0, 0x09F1); + TX_CHAR_RANGE(ch, 0x0A05, 0x0A0A); + TX_CHAR_RANGE(ch, 0x0A0F, 0x0A10); + TX_CHAR_RANGE(ch, 0x0A13, 0x0A28); + TX_CHAR_RANGE(ch, 0x0A2A, 0x0A30); + TX_CHAR_RANGE(ch, 0x0A32, 0x0A33); + TX_CHAR_RANGE(ch, 0x0A35, 0x0A36); + TX_CHAR_RANGE(ch, 0x0A38, 0x0A39); + TX_CHAR_RANGE(ch, 0x0A59, 0x0A5C); + TX_MATCH_CHAR(ch, 0x0A5E); + TX_CHAR_RANGE(ch, 0x0A72, 0x0A74); + TX_CHAR_RANGE(ch, 0x0A85, 0x0A8B); + TX_MATCH_CHAR(ch, 0x0A8D); + TX_CHAR_RANGE(ch, 0x0A8F, 0x0A91); + TX_CHAR_RANGE(ch, 0x0A93, 0x0AA8); + TX_CHAR_RANGE(ch, 0x0AAA, 0x0AB0); + TX_CHAR_RANGE(ch, 0x0AB2, 0x0AB3); + TX_CHAR_RANGE(ch, 0x0AB5, 0x0AB9); + TX_MATCH_CHAR(ch, 0x0ABD); + TX_MATCH_CHAR(ch, 0x0AE0); + TX_CHAR_RANGE(ch, 0x0B05, 0x0B0C); + TX_CHAR_RANGE(ch, 0x0B0F, 0x0B10); + TX_CHAR_RANGE(ch, 0x0B13, 0x0B28); + TX_CHAR_RANGE(ch, 0x0B2A, 0x0B30); + TX_CHAR_RANGE(ch, 0x0B32, 0x0B33); + TX_CHAR_RANGE(ch, 0x0B36, 0x0B39); + TX_MATCH_CHAR(ch, 0x0B3D); + TX_CHAR_RANGE(ch, 0x0B5C, 0x0B5D); + TX_CHAR_RANGE(ch, 0x0B5F, 0x0B61); + TX_CHAR_RANGE(ch, 0x0B85, 0x0B8A); + TX_CHAR_RANGE(ch, 0x0B8E, 0x0B90); + TX_CHAR_RANGE(ch, 0x0B92, 0x0B95); + TX_CHAR_RANGE(ch, 0x0B99, 0x0B9A); + TX_MATCH_CHAR(ch, 0x0B9C); + TX_CHAR_RANGE(ch, 0x0B9E, 0x0B9F); + TX_CHAR_RANGE(ch, 0x0BA3, 0x0BA4); + TX_CHAR_RANGE(ch, 0x0BA8, 0x0BAA); + TX_CHAR_RANGE(ch, 0x0BAE, 0x0BB5); + TX_CHAR_RANGE(ch, 0x0BB7, 0x0BB9); + TX_CHAR_RANGE(ch, 0x0C05, 0x0C0C); + TX_CHAR_RANGE(ch, 0x0C0E, 0x0C10); + TX_CHAR_RANGE(ch, 0x0C12, 0x0C28); + TX_CHAR_RANGE(ch, 0x0C2A, 0x0C33); + TX_CHAR_RANGE(ch, 0x0C35, 0x0C39); + TX_CHAR_RANGE(ch, 0x0C60, 0x0C61); + TX_CHAR_RANGE(ch, 0x0C85, 0x0C8C); + TX_CHAR_RANGE(ch, 0x0C8E, 0x0C90); + TX_CHAR_RANGE(ch, 0x0C92, 0x0CA8); + TX_CHAR_RANGE(ch, 0x0CAA, 0x0CB3); + TX_CHAR_RANGE(ch, 0x0CB5, 0x0CB9); + TX_MATCH_CHAR(ch, 0x0CDE); + TX_CHAR_RANGE(ch, 0x0CE0, 0x0CE1); + TX_CHAR_RANGE(ch, 0x0D05, 0x0D0C); + TX_CHAR_RANGE(ch, 0x0D0E, 0x0D10); + TX_CHAR_RANGE(ch, 0x0D12, 0x0D28); + TX_CHAR_RANGE(ch, 0x0D2A, 0x0D39); + TX_CHAR_RANGE(ch, 0x0D60, 0x0D61); + TX_CHAR_RANGE(ch, 0x0E01, 0x0E2E); + TX_MATCH_CHAR(ch, 0x0E30); + TX_CHAR_RANGE(ch, 0x0E32, 0x0E33); + TX_CHAR_RANGE(ch, 0x0E40, 0x0E45); + TX_CHAR_RANGE(ch, 0x0E81, 0x0E82); + TX_MATCH_CHAR(ch, 0x0E84); + TX_CHAR_RANGE(ch, 0x0E87, 0x0E88); + TX_MATCH_CHAR(ch, 0x0E8A); + TX_MATCH_CHAR(ch, 0x0E8D); + TX_CHAR_RANGE(ch, 0x0E94, 0x0E97); + TX_CHAR_RANGE(ch, 0x0E99, 0x0E9F); + TX_CHAR_RANGE(ch, 0x0EA1, 0x0EA3); + TX_MATCH_CHAR(ch, 0x0EA5); + TX_MATCH_CHAR(ch, 0x0EA7); + TX_CHAR_RANGE(ch, 0x0EAA, 0x0EAB); + TX_CHAR_RANGE(ch, 0x0EAD, 0x0EAE); + TX_MATCH_CHAR(ch, 0x0EB0); + TX_CHAR_RANGE(ch, 0x0EB2, 0x0EB3); + TX_MATCH_CHAR(ch, 0x0EBD); + TX_CHAR_RANGE(ch, 0x0EC0, 0x0EC4); + TX_CHAR_RANGE(ch, 0x0F40, 0x0F47); + TX_CHAR_RANGE(ch, 0x0F49, 0x0F69); + TX_CHAR_RANGE(ch, 0x10A0, 0x10C5); + TX_CHAR_RANGE(ch, 0x10D0, 0x10F6); + TX_MATCH_CHAR(ch, 0x1100); + TX_CHAR_RANGE(ch, 0x1102, 0x1103); + TX_CHAR_RANGE(ch, 0x1105, 0x1107); + TX_MATCH_CHAR(ch, 0x1109); + TX_CHAR_RANGE(ch, 0x110B, 0x110C); + TX_CHAR_RANGE(ch, 0x110E, 0x1112); + TX_MATCH_CHAR(ch, 0x113C); + TX_MATCH_CHAR(ch, 0x113E); + TX_MATCH_CHAR(ch, 0x1140); + TX_MATCH_CHAR(ch, 0x114C); + TX_MATCH_CHAR(ch, 0x114E); + TX_MATCH_CHAR(ch, 0x1150); + TX_CHAR_RANGE(ch, 0x1154, 0x1155); + TX_MATCH_CHAR(ch, 0x1159); + TX_CHAR_RANGE(ch, 0x115F, 0x1161); + TX_MATCH_CHAR(ch, 0x1163); + TX_MATCH_CHAR(ch, 0x1165); + TX_MATCH_CHAR(ch, 0x1167); + TX_MATCH_CHAR(ch, 0x1169); + TX_CHAR_RANGE(ch, 0x116D, 0x116E); + TX_CHAR_RANGE(ch, 0x1172, 0x1173); + TX_MATCH_CHAR(ch, 0x1175); + TX_MATCH_CHAR(ch, 0x119E); + TX_MATCH_CHAR(ch, 0x11A8); + TX_MATCH_CHAR(ch, 0x11AB); + TX_CHAR_RANGE(ch, 0x11AE, 0x11AF); + TX_CHAR_RANGE(ch, 0x11B7, 0x11B8); + TX_MATCH_CHAR(ch, 0x11BA); + TX_CHAR_RANGE(ch, 0x11BC, 0x11C2); + TX_MATCH_CHAR(ch, 0x11EB); + TX_MATCH_CHAR(ch, 0x11F0); + TX_MATCH_CHAR(ch, 0x11F9); + TX_CHAR_RANGE(ch, 0x1E00, 0x1E9B); + TX_CHAR_RANGE(ch, 0x1EA0, 0x1EF9); + TX_CHAR_RANGE(ch, 0x1F00, 0x1F15); + TX_CHAR_RANGE(ch, 0x1F18, 0x1F1D); + TX_CHAR_RANGE(ch, 0x1F20, 0x1F45); + TX_CHAR_RANGE(ch, 0x1F48, 0x1F4D); + TX_CHAR_RANGE(ch, 0x1F50, 0x1F57); + TX_MATCH_CHAR(ch, 0x1F59); + TX_MATCH_CHAR(ch, 0x1F5B); + TX_MATCH_CHAR(ch, 0x1F5D); + TX_CHAR_RANGE(ch, 0x1F5F, 0x1F7D); + TX_CHAR_RANGE(ch, 0x1F80, 0x1FB4); + TX_CHAR_RANGE(ch, 0x1FB6, 0x1FBC); + TX_MATCH_CHAR(ch, 0x1FBE); + TX_CHAR_RANGE(ch, 0x1FC2, 0x1FC4); + TX_CHAR_RANGE(ch, 0x1FC6, 0x1FCC); + TX_CHAR_RANGE(ch, 0x1FD0, 0x1FD3); + TX_CHAR_RANGE(ch, 0x1FD6, 0x1FDB); + TX_CHAR_RANGE(ch, 0x1FE0, 0x1FEC); + TX_CHAR_RANGE(ch, 0x1FF2, 0x1FF4); + TX_CHAR_RANGE(ch, 0x1FF6, 0x1FFC); + TX_MATCH_CHAR(ch, 0x2126); + TX_CHAR_RANGE(ch, 0x212A, 0x212B); + TX_MATCH_CHAR(ch, 0x212E); + TX_CHAR_RANGE(ch, 0x2180, 0x2182); + TX_MATCH_CHAR(ch, 0x3007); + TX_CHAR_RANGE(ch, 0x3021, 0x3029); + TX_CHAR_RANGE(ch, 0x3041, 0x3094); + TX_CHAR_RANGE(ch, 0x30A1, 0x30FA); + TX_CHAR_RANGE(ch, 0x3105, 0x312C); + TX_CHAR_RANGE(ch, 0x4E00, 0x9FA5); + TX_CHAR_RANGE(ch, 0xAC00, 0xD7A3); + return MB_FALSE; +} //-- isAlphaChar + +/** + * Returns true if the given character is an allowable NCName character +**/ +MBool ExprLexer::isNCNameChar(UNICODE_CHAR ch) +{ +/* NCNameChar = Letter | Digit ('0'-'9') | '.' | '-' | '_' | + CombiningChar | Extender */ + if (isLetter(ch)) return MB_TRUE; /* Letter | '_' */ + + TX_CHAR_RANGE(ch, 0x002D, 0x002E); /* '-' | '.' */ + TX_CHAR_RANGE(ch, 0x0030, 0x0039); /* Digit */ + TX_MATCH_CHAR(ch, 0x00B7); + TX_MATCH_CHAR(ch, 0x02D0); + TX_MATCH_CHAR(ch, 0x02D1); + TX_CHAR_RANGE(ch, 0x0300, 0x0345); + TX_CHAR_RANGE(ch, 0x0360, 0x0361); + TX_MATCH_CHAR(ch, 0x0387); + TX_CHAR_RANGE(ch, 0x0483, 0x0486); + TX_CHAR_RANGE(ch, 0x0591, 0x05A1); + TX_CHAR_RANGE(ch, 0x05A3, 0x05B9); + TX_CHAR_RANGE(ch, 0x05BB, 0x05BD); + TX_MATCH_CHAR(ch, 0x05BF); + TX_CHAR_RANGE(ch, 0x05C1, 0x05C2); + TX_MATCH_CHAR(ch, 0x05C4); + TX_MATCH_CHAR(ch, 0x0640); + TX_CHAR_RANGE(ch, 0x064B, 0x0652); + TX_MATCH_CHAR(ch, 0x0670); + TX_CHAR_RANGE(ch, 0x06D6, 0x06DC); + TX_CHAR_RANGE(ch, 0x06DD, 0x06DF); + TX_CHAR_RANGE(ch, 0x06E0, 0x06E4); + TX_CHAR_RANGE(ch, 0x06E7, 0x06E8); + TX_CHAR_RANGE(ch, 0x06EA, 0x06ED); + TX_CHAR_RANGE(ch, 0x0901, 0x0903); + TX_MATCH_CHAR(ch, 0x093C); + TX_CHAR_RANGE(ch, 0x093E, 0x094C); + TX_MATCH_CHAR(ch, 0x094D); + TX_CHAR_RANGE(ch, 0x0951, 0x0954); + TX_CHAR_RANGE(ch, 0x0962, 0x0963); + TX_CHAR_RANGE(ch, 0x0981, 0x0983); + TX_MATCH_CHAR(ch, 0x09BC); + TX_MATCH_CHAR(ch, 0x09BE); + TX_MATCH_CHAR(ch, 0x09BF); + TX_CHAR_RANGE(ch, 0x09C0, 0x09C4); + TX_CHAR_RANGE(ch, 0x09C7, 0x09C8); + TX_CHAR_RANGE(ch, 0x09CB, 0x09CD); + TX_MATCH_CHAR(ch, 0x09D7); + TX_CHAR_RANGE(ch, 0x09E2, 0x09E3); + TX_MATCH_CHAR(ch, 0x0A02); + TX_MATCH_CHAR(ch, 0x0A3C); + TX_MATCH_CHAR(ch, 0x0A3E); + TX_MATCH_CHAR(ch, 0x0A3F); + TX_CHAR_RANGE(ch, 0x0A40, 0x0A42); + TX_CHAR_RANGE(ch, 0x0A47, 0x0A48); + TX_CHAR_RANGE(ch, 0x0A4B, 0x0A4D); + TX_CHAR_RANGE(ch, 0x0A70, 0x0A71); + TX_CHAR_RANGE(ch, 0x0A81, 0x0A83); + TX_MATCH_CHAR(ch, 0x0ABC); + TX_CHAR_RANGE(ch, 0x0ABE, 0x0AC5); + TX_CHAR_RANGE(ch, 0x0AC7, 0x0AC9); + TX_CHAR_RANGE(ch, 0x0ACB, 0x0ACD); + TX_CHAR_RANGE(ch, 0x0B01, 0x0B03); + TX_MATCH_CHAR(ch, 0x0B3C); + TX_CHAR_RANGE(ch, 0x0B3E, 0x0B43); + TX_CHAR_RANGE(ch, 0x0B47, 0x0B48); + TX_CHAR_RANGE(ch, 0x0B4B, 0x0B4D); + TX_CHAR_RANGE(ch, 0x0B56, 0x0B57); + TX_CHAR_RANGE(ch, 0x0B82, 0x0B83); + TX_CHAR_RANGE(ch, 0x0BBE, 0x0BC2); + TX_CHAR_RANGE(ch, 0x0BC6, 0x0BC8); + TX_CHAR_RANGE(ch, 0x0BCA, 0x0BCD); + TX_MATCH_CHAR(ch, 0x0BD7); + TX_CHAR_RANGE(ch, 0x0C01, 0x0C03); + TX_CHAR_RANGE(ch, 0x0C3E, 0x0C44); + TX_CHAR_RANGE(ch, 0x0C46, 0x0C48); + TX_CHAR_RANGE(ch, 0x0C4A, 0x0C4D); + TX_CHAR_RANGE(ch, 0x0C55, 0x0C56); + TX_CHAR_RANGE(ch, 0x0C82, 0x0C83); + TX_CHAR_RANGE(ch, 0x0CBE, 0x0CC4); + TX_CHAR_RANGE(ch, 0x0CC6, 0x0CC8); + TX_CHAR_RANGE(ch, 0x0CCA, 0x0CCD); + TX_CHAR_RANGE(ch, 0x0CD5, 0x0CD6); + TX_CHAR_RANGE(ch, 0x0D02, 0x0D03); + TX_CHAR_RANGE(ch, 0x0D3E, 0x0D43); + TX_CHAR_RANGE(ch, 0x0D46, 0x0D48); + TX_CHAR_RANGE(ch, 0x0D4A, 0x0D4D); + TX_MATCH_CHAR(ch, 0x0D57); + TX_MATCH_CHAR(ch, 0x0E31); + TX_CHAR_RANGE(ch, 0x0E34, 0x0E3A); + TX_MATCH_CHAR(ch, 0x0E46); + TX_CHAR_RANGE(ch, 0x0E47, 0x0E4E); + TX_MATCH_CHAR(ch, 0x0EB1); + TX_CHAR_RANGE(ch, 0x0EB4, 0x0EB9); + TX_CHAR_RANGE(ch, 0x0EBB, 0x0EBC); + TX_MATCH_CHAR(ch, 0x0EC6); + TX_CHAR_RANGE(ch, 0x0EC8, 0x0ECD); + TX_CHAR_RANGE(ch, 0x0F18, 0x0F19); + TX_MATCH_CHAR(ch, 0x0F35); + TX_MATCH_CHAR(ch, 0x0F37); + TX_MATCH_CHAR(ch, 0x0F39); + TX_MATCH_CHAR(ch, 0x0F3E); + TX_MATCH_CHAR(ch, 0x0F3F); + TX_CHAR_RANGE(ch, 0x0F71, 0x0F84); + TX_CHAR_RANGE(ch, 0x0F86, 0x0F8B); + TX_CHAR_RANGE(ch, 0x0F90, 0x0F95); + TX_MATCH_CHAR(ch, 0x0F97); + TX_CHAR_RANGE(ch, 0x0F99, 0x0FAD); + TX_CHAR_RANGE(ch, 0x0FB1, 0x0FB7); + TX_MATCH_CHAR(ch, 0x0FB9); + TX_CHAR_RANGE(ch, 0x20D0, 0x20DC); + TX_MATCH_CHAR(ch, 0x20E1); + TX_MATCH_CHAR(ch, 0x3005); + TX_CHAR_RANGE(ch, 0x302A, 0x302F); + TX_CHAR_RANGE(ch, 0x3031, 0x3035); + TX_MATCH_CHAR(ch, 0x3099); + TX_MATCH_CHAR(ch, 0x309A); + TX_CHAR_RANGE(ch, 0x309D, 0x309E); + TX_CHAR_RANGE(ch, 0x30FC, 0x30FE); + return MB_FALSE; +} //-- isNCNameChar diff --git a/mozilla/extensions/transformiix/source/xpath/UnaryExpr.cpp b/mozilla/extensions/transformiix/source/xpath/UnaryExpr.cpp new file mode 100644 index 00000000000..356d583a2e1 --- /dev/null +++ b/mozilla/extensions/transformiix/source/xpath/UnaryExpr.cpp @@ -0,0 +1,73 @@ +/* + * 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 Initial Developer of the Original Code is Jonas Sicking. + * Portions created by Jonas Sicking are Copyright (C) 2001, Jonas Sicking. + * All rights reserved. + * + * Contributor(s): + * Jonas Sicking, sicking@bigfoot.com + * -- original author. + */ + +#include "Expr.h" + +UnaryExpr::UnaryExpr() +{ + expr = 0; +} + +UnaryExpr::UnaryExpr(Expr* expr) +{ + this->expr = expr; +} + +UnaryExpr::~UnaryExpr() +{ + delete expr; +} + +void UnaryExpr::setExpr(Expr* expr) +{ + delete this->expr; + this->expr = expr; +} + +/* + * Evaluates this Expr based on the given context node and processor state + * @param context the context node for evaluation of this Expr + * @param ps the ContextState containing the stack information needed + * for evaluation. + * @return the result of the evaluation. + */ +ExprResult* UnaryExpr::evaluate(Node* context, ContextState* cs) +{ + ExprResult* exprRes = expr->evaluate(context, cs); + double value = exprRes->numberValue(); + delete exprRes; + return new NumberResult(-value); +} + +/* + * Returns the String representation of this Expr. + * @param dest the String to use when creating the String + * representation. The String representation will be appended to + * any data in the destination String, to allow cascading calls to + * other #toString() methods for Expressions. + * @return the String representation of this Expr. + */ +void UnaryExpr::toString(String& str) +{ + if (!expr) + return; + str.append('-'); + expr->toString(str); +} diff --git a/mozilla/themes/modern/communicator/icons/lock-mixed.gif b/mozilla/themes/modern/communicator/icons/lock-mixed.gif new file mode 100644 index 00000000000..82e4391ffe4 Binary files /dev/null and b/mozilla/themes/modern/communicator/icons/lock-mixed.gif differ diff --git a/mozilla/themes/modern/communicator/sidebar/sbtab-lft-btm-act.gif b/mozilla/themes/modern/communicator/sidebar/sbtab-lft-btm-act.gif new file mode 100644 index 00000000000..405bc7c40db Binary files /dev/null and b/mozilla/themes/modern/communicator/sidebar/sbtab-lft-btm-act.gif differ diff --git a/mozilla/themes/modern/communicator/sidebar/sbtab-lft-btm-hov.gif b/mozilla/themes/modern/communicator/sidebar/sbtab-lft-btm-hov.gif new file mode 100644 index 00000000000..ae3569f2d86 Binary files /dev/null and b/mozilla/themes/modern/communicator/sidebar/sbtab-lft-btm-hov.gif differ diff --git a/mozilla/themes/modern/communicator/sidebar/sbtab-lft-btm-sel.gif b/mozilla/themes/modern/communicator/sidebar/sbtab-lft-btm-sel.gif new file mode 100644 index 00000000000..5897f98c715 Binary files /dev/null and b/mozilla/themes/modern/communicator/sidebar/sbtab-lft-btm-sel.gif differ diff --git a/mozilla/themes/modern/communicator/sidebar/sbtab-lft-btm.gif b/mozilla/themes/modern/communicator/sidebar/sbtab-lft-btm.gif new file mode 100644 index 00000000000..f1500c4c2d5 Binary files /dev/null and b/mozilla/themes/modern/communicator/sidebar/sbtab-lft-btm.gif differ diff --git a/mozilla/themes/modern/communicator/sidebar/sbtab-lft-mid-act.gif b/mozilla/themes/modern/communicator/sidebar/sbtab-lft-mid-act.gif new file mode 100644 index 00000000000..bc81aec54b2 Binary files /dev/null and b/mozilla/themes/modern/communicator/sidebar/sbtab-lft-mid-act.gif differ diff --git a/mozilla/themes/modern/communicator/sidebar/sbtab-lft-mid-hov.gif b/mozilla/themes/modern/communicator/sidebar/sbtab-lft-mid-hov.gif new file mode 100644 index 00000000000..968af6ea4d5 Binary files /dev/null and b/mozilla/themes/modern/communicator/sidebar/sbtab-lft-mid-hov.gif differ diff --git a/mozilla/themes/modern/communicator/sidebar/sbtab-lft-mid-sel.gif b/mozilla/themes/modern/communicator/sidebar/sbtab-lft-mid-sel.gif new file mode 100644 index 00000000000..495d52119d9 Binary files /dev/null and b/mozilla/themes/modern/communicator/sidebar/sbtab-lft-mid-sel.gif differ diff --git a/mozilla/themes/modern/communicator/sidebar/sbtab-lft-mid.gif b/mozilla/themes/modern/communicator/sidebar/sbtab-lft-mid.gif new file mode 100644 index 00000000000..968af6ea4d5 Binary files /dev/null and b/mozilla/themes/modern/communicator/sidebar/sbtab-lft-mid.gif differ diff --git a/mozilla/themes/modern/communicator/sidebar/sbtab-lft-top-act.gif b/mozilla/themes/modern/communicator/sidebar/sbtab-lft-top-act.gif new file mode 100644 index 00000000000..f5b941985a5 Binary files /dev/null and b/mozilla/themes/modern/communicator/sidebar/sbtab-lft-top-act.gif differ diff --git a/mozilla/themes/modern/communicator/sidebar/sbtab-lft-top-hov.gif b/mozilla/themes/modern/communicator/sidebar/sbtab-lft-top-hov.gif new file mode 100644 index 00000000000..7b75b6b8b09 Binary files /dev/null and b/mozilla/themes/modern/communicator/sidebar/sbtab-lft-top-hov.gif differ diff --git a/mozilla/themes/modern/communicator/sidebar/sbtab-lft-top-sel.gif b/mozilla/themes/modern/communicator/sidebar/sbtab-lft-top-sel.gif new file mode 100644 index 00000000000..a063ca6000b Binary files /dev/null and b/mozilla/themes/modern/communicator/sidebar/sbtab-lft-top-sel.gif differ diff --git a/mozilla/themes/modern/communicator/sidebar/sbtab-lft-top.gif b/mozilla/themes/modern/communicator/sidebar/sbtab-lft-top.gif new file mode 100644 index 00000000000..fac11d6b9da Binary files /dev/null and b/mozilla/themes/modern/communicator/sidebar/sbtab-lft-top.gif differ diff --git a/mozilla/themes/modern/communicator/sidebar/sbtab-mid-btm-act.gif b/mozilla/themes/modern/communicator/sidebar/sbtab-mid-btm-act.gif new file mode 100644 index 00000000000..daa9a177de9 Binary files /dev/null and b/mozilla/themes/modern/communicator/sidebar/sbtab-mid-btm-act.gif differ diff --git a/mozilla/themes/modern/communicator/sidebar/sbtab-mid-btm-hov.gif b/mozilla/themes/modern/communicator/sidebar/sbtab-mid-btm-hov.gif new file mode 100644 index 00000000000..1df63d5fdf5 Binary files /dev/null and b/mozilla/themes/modern/communicator/sidebar/sbtab-mid-btm-hov.gif differ diff --git a/mozilla/themes/modern/communicator/sidebar/sbtab-mid-btm-sel.gif b/mozilla/themes/modern/communicator/sidebar/sbtab-mid-btm-sel.gif new file mode 100644 index 00000000000..1b206e26fa4 Binary files /dev/null and b/mozilla/themes/modern/communicator/sidebar/sbtab-mid-btm-sel.gif differ diff --git a/mozilla/themes/modern/communicator/sidebar/sbtab-mid-btm.gif b/mozilla/themes/modern/communicator/sidebar/sbtab-mid-btm.gif new file mode 100644 index 00000000000..07b003114d8 Binary files /dev/null and b/mozilla/themes/modern/communicator/sidebar/sbtab-mid-btm.gif differ diff --git a/mozilla/themes/modern/communicator/sidebar/sbtab-mid-top-act.gif b/mozilla/themes/modern/communicator/sidebar/sbtab-mid-top-act.gif new file mode 100644 index 00000000000..ba86bb38218 Binary files /dev/null and b/mozilla/themes/modern/communicator/sidebar/sbtab-mid-top-act.gif differ diff --git a/mozilla/themes/modern/communicator/sidebar/sbtab-mid-top-hov.gif b/mozilla/themes/modern/communicator/sidebar/sbtab-mid-top-hov.gif new file mode 100644 index 00000000000..495628476c4 Binary files /dev/null and b/mozilla/themes/modern/communicator/sidebar/sbtab-mid-top-hov.gif differ diff --git a/mozilla/themes/modern/communicator/sidebar/sbtab-mid-top-sel.gif b/mozilla/themes/modern/communicator/sidebar/sbtab-mid-top-sel.gif new file mode 100644 index 00000000000..d8d2c64d20a Binary files /dev/null and b/mozilla/themes/modern/communicator/sidebar/sbtab-mid-top-sel.gif differ diff --git a/mozilla/themes/modern/communicator/sidebar/sbtab-mid-top.gif b/mozilla/themes/modern/communicator/sidebar/sbtab-mid-top.gif new file mode 100644 index 00000000000..8f6df9ce27c Binary files /dev/null and b/mozilla/themes/modern/communicator/sidebar/sbtab-mid-top.gif differ diff --git a/mozilla/themes/modern/communicator/sidebar/sbtab-rit-btm-act.gif b/mozilla/themes/modern/communicator/sidebar/sbtab-rit-btm-act.gif new file mode 100644 index 00000000000..4900191f6e7 Binary files /dev/null and b/mozilla/themes/modern/communicator/sidebar/sbtab-rit-btm-act.gif differ diff --git a/mozilla/themes/modern/communicator/sidebar/sbtab-rit-btm-hov.gif b/mozilla/themes/modern/communicator/sidebar/sbtab-rit-btm-hov.gif new file mode 100644 index 00000000000..4a45f101de5 Binary files /dev/null and b/mozilla/themes/modern/communicator/sidebar/sbtab-rit-btm-hov.gif differ diff --git a/mozilla/themes/modern/communicator/sidebar/sbtab-rit-btm-sel.gif b/mozilla/themes/modern/communicator/sidebar/sbtab-rit-btm-sel.gif new file mode 100644 index 00000000000..3693fbfa34c Binary files /dev/null and b/mozilla/themes/modern/communicator/sidebar/sbtab-rit-btm-sel.gif differ diff --git a/mozilla/themes/modern/communicator/sidebar/sbtab-rit-btm.gif b/mozilla/themes/modern/communicator/sidebar/sbtab-rit-btm.gif new file mode 100644 index 00000000000..4e4ea85259d Binary files /dev/null and b/mozilla/themes/modern/communicator/sidebar/sbtab-rit-btm.gif differ diff --git a/mozilla/themes/modern/communicator/sidebar/sbtab-rit-mid-act.gif b/mozilla/themes/modern/communicator/sidebar/sbtab-rit-mid-act.gif new file mode 100644 index 00000000000..e98ace6342b Binary files /dev/null and b/mozilla/themes/modern/communicator/sidebar/sbtab-rit-mid-act.gif differ diff --git a/mozilla/themes/modern/communicator/sidebar/sbtab-rit-mid-hov.gif b/mozilla/themes/modern/communicator/sidebar/sbtab-rit-mid-hov.gif new file mode 100644 index 00000000000..43b0c739254 Binary files /dev/null and b/mozilla/themes/modern/communicator/sidebar/sbtab-rit-mid-hov.gif differ diff --git a/mozilla/themes/modern/communicator/sidebar/sbtab-rit-mid-sel.gif b/mozilla/themes/modern/communicator/sidebar/sbtab-rit-mid-sel.gif new file mode 100644 index 00000000000..fce1215efe5 Binary files /dev/null and b/mozilla/themes/modern/communicator/sidebar/sbtab-rit-mid-sel.gif differ diff --git a/mozilla/themes/modern/communicator/sidebar/sbtab-rit-mid.gif b/mozilla/themes/modern/communicator/sidebar/sbtab-rit-mid.gif new file mode 100644 index 00000000000..607d98beefc Binary files /dev/null and b/mozilla/themes/modern/communicator/sidebar/sbtab-rit-mid.gif differ diff --git a/mozilla/themes/modern/communicator/sidebar/sbtab-rit-top-act.gif b/mozilla/themes/modern/communicator/sidebar/sbtab-rit-top-act.gif new file mode 100644 index 00000000000..ff3ab46dee4 Binary files /dev/null and b/mozilla/themes/modern/communicator/sidebar/sbtab-rit-top-act.gif differ diff --git a/mozilla/themes/modern/communicator/sidebar/sbtab-rit-top-hov.gif b/mozilla/themes/modern/communicator/sidebar/sbtab-rit-top-hov.gif new file mode 100644 index 00000000000..f1455e65bb9 Binary files /dev/null and b/mozilla/themes/modern/communicator/sidebar/sbtab-rit-top-hov.gif differ diff --git a/mozilla/themes/modern/communicator/sidebar/sbtab-rit-top-sel.gif b/mozilla/themes/modern/communicator/sidebar/sbtab-rit-top-sel.gif new file mode 100644 index 00000000000..78a04971e52 Binary files /dev/null and b/mozilla/themes/modern/communicator/sidebar/sbtab-rit-top-sel.gif differ diff --git a/mozilla/themes/modern/communicator/sidebar/sbtab-rit-top.gif b/mozilla/themes/modern/communicator/sidebar/sbtab-rit-top.gif new file mode 100644 index 00000000000..b45ce47cb43 Binary files /dev/null and b/mozilla/themes/modern/communicator/sidebar/sbtab-rit-top.gif differ diff --git a/mozilla/themes/modern/communicator/sidebar/sbtab-ritcap-act.gif b/mozilla/themes/modern/communicator/sidebar/sbtab-ritcap-act.gif new file mode 100644 index 00000000000..48658c25153 Binary files /dev/null and b/mozilla/themes/modern/communicator/sidebar/sbtab-ritcap-act.gif differ diff --git a/mozilla/themes/modern/communicator/sidebar/sbtab-ritcap-hov.gif b/mozilla/themes/modern/communicator/sidebar/sbtab-ritcap-hov.gif new file mode 100644 index 00000000000..e01a129c1f2 Binary files /dev/null and b/mozilla/themes/modern/communicator/sidebar/sbtab-ritcap-hov.gif differ diff --git a/mozilla/themes/modern/communicator/sidebar/sbtab-ritcap-sel.gif b/mozilla/themes/modern/communicator/sidebar/sbtab-ritcap-sel.gif new file mode 100644 index 00000000000..c556f9871a9 Binary files /dev/null and b/mozilla/themes/modern/communicator/sidebar/sbtab-ritcap-sel.gif differ diff --git a/mozilla/themes/modern/communicator/sidebar/sbtab-ritcap.gif b/mozilla/themes/modern/communicator/sidebar/sbtab-ritcap.gif new file mode 100644 index 00000000000..37929ca7c01 Binary files /dev/null and b/mozilla/themes/modern/communicator/sidebar/sbtab-ritcap.gif differ diff --git a/mozilla/themes/modern/global/scrollbar/mini-slider-hrz-mid.gif b/mozilla/themes/modern/global/scrollbar/mini-slider-hrz-mid.gif new file mode 100644 index 00000000000..5fe1eaedee0 Binary files /dev/null and b/mozilla/themes/modern/global/scrollbar/mini-slider-hrz-mid.gif differ diff --git a/mozilla/themes/modern/global/scrollbar/mini-slider-vrt-mid.gif b/mozilla/themes/modern/global/scrollbar/mini-slider-vrt-mid.gif new file mode 100644 index 00000000000..e31b43700e0 Binary files /dev/null and b/mozilla/themes/modern/global/scrollbar/mini-slider-vrt-mid.gif differ diff --git a/mozilla/themes/modern/global/scrollbar/mini-thumb-hrz-grip-act.gif b/mozilla/themes/modern/global/scrollbar/mini-thumb-hrz-grip-act.gif new file mode 100644 index 00000000000..331ac8b11a1 Binary files /dev/null and b/mozilla/themes/modern/global/scrollbar/mini-thumb-hrz-grip-act.gif differ diff --git a/mozilla/themes/modern/global/scrollbar/mini-thumb-hrz-lft-act.gif b/mozilla/themes/modern/global/scrollbar/mini-thumb-hrz-lft-act.gif new file mode 100644 index 00000000000..61ae5f18295 Binary files /dev/null and b/mozilla/themes/modern/global/scrollbar/mini-thumb-hrz-lft-act.gif differ diff --git a/mozilla/themes/modern/global/scrollbar/mini-thumb-hrz-mid-act.gif b/mozilla/themes/modern/global/scrollbar/mini-thumb-hrz-mid-act.gif new file mode 100644 index 00000000000..349f4228787 Binary files /dev/null and b/mozilla/themes/modern/global/scrollbar/mini-thumb-hrz-mid-act.gif differ diff --git a/mozilla/themes/modern/global/scrollbar/mini-thumb-hrz-rit-act.gif b/mozilla/themes/modern/global/scrollbar/mini-thumb-hrz-rit-act.gif new file mode 100644 index 00000000000..7cc951680b6 Binary files /dev/null and b/mozilla/themes/modern/global/scrollbar/mini-thumb-hrz-rit-act.gif differ diff --git a/mozilla/themes/modern/global/scrollbar/mini-thumb-vrt-btm-act.gif b/mozilla/themes/modern/global/scrollbar/mini-thumb-vrt-btm-act.gif new file mode 100644 index 00000000000..714149955ba Binary files /dev/null and b/mozilla/themes/modern/global/scrollbar/mini-thumb-vrt-btm-act.gif differ diff --git a/mozilla/themes/modern/global/scrollbar/mini-thumb-vrt-grip-act.gif b/mozilla/themes/modern/global/scrollbar/mini-thumb-vrt-grip-act.gif new file mode 100644 index 00000000000..2e5af5a392e Binary files /dev/null and b/mozilla/themes/modern/global/scrollbar/mini-thumb-vrt-grip-act.gif differ diff --git a/mozilla/themes/modern/global/scrollbar/mini-thumb-vrt-mid-act.gif b/mozilla/themes/modern/global/scrollbar/mini-thumb-vrt-mid-act.gif new file mode 100644 index 00000000000..7dddc66afa3 Binary files /dev/null and b/mozilla/themes/modern/global/scrollbar/mini-thumb-vrt-mid-act.gif differ diff --git a/mozilla/themes/modern/global/scrollbar/mini-thumb-vrt-top-act.gif b/mozilla/themes/modern/global/scrollbar/mini-thumb-vrt-top-act.gif new file mode 100644 index 00000000000..9183231ae9a Binary files /dev/null and b/mozilla/themes/modern/global/scrollbar/mini-thumb-vrt-top-act.gif differ diff --git a/mozilla/themes/modern/global/scrollbar/slider-hrz-lft.gif b/mozilla/themes/modern/global/scrollbar/slider-hrz-lft.gif new file mode 100644 index 00000000000..9c8d26107bd Binary files /dev/null and b/mozilla/themes/modern/global/scrollbar/slider-hrz-lft.gif differ diff --git a/mozilla/themes/modern/global/scrollbar/slider-hrz-mid.gif b/mozilla/themes/modern/global/scrollbar/slider-hrz-mid.gif new file mode 100644 index 00000000000..208e7178701 Binary files /dev/null and b/mozilla/themes/modern/global/scrollbar/slider-hrz-mid.gif differ diff --git a/mozilla/themes/modern/global/scrollbar/slider-hrz-rit.gif b/mozilla/themes/modern/global/scrollbar/slider-hrz-rit.gif new file mode 100644 index 00000000000..7e676e414fd Binary files /dev/null and b/mozilla/themes/modern/global/scrollbar/slider-hrz-rit.gif differ diff --git a/mozilla/themes/modern/global/scrollbar/slider-vrt-mid.gif b/mozilla/themes/modern/global/scrollbar/slider-vrt-mid.gif new file mode 100644 index 00000000000..d4c995d4f43 Binary files /dev/null and b/mozilla/themes/modern/global/scrollbar/slider-vrt-mid.gif differ diff --git a/mozilla/themes/modern/global/scrollbar/thumb-hrz-grip-act.gif b/mozilla/themes/modern/global/scrollbar/thumb-hrz-grip-act.gif new file mode 100644 index 00000000000..69c3573036f Binary files /dev/null and b/mozilla/themes/modern/global/scrollbar/thumb-hrz-grip-act.gif differ diff --git a/mozilla/themes/modern/global/scrollbar/thumb-hrz-lft-act.gif b/mozilla/themes/modern/global/scrollbar/thumb-hrz-lft-act.gif new file mode 100644 index 00000000000..3f5dd04e4e7 Binary files /dev/null and b/mozilla/themes/modern/global/scrollbar/thumb-hrz-lft-act.gif differ diff --git a/mozilla/themes/modern/global/scrollbar/thumb-hrz-mid-act.gif b/mozilla/themes/modern/global/scrollbar/thumb-hrz-mid-act.gif new file mode 100644 index 00000000000..be29240261e Binary files /dev/null and b/mozilla/themes/modern/global/scrollbar/thumb-hrz-mid-act.gif differ diff --git a/mozilla/themes/modern/global/scrollbar/thumb-hrz-rit-act.gif b/mozilla/themes/modern/global/scrollbar/thumb-hrz-rit-act.gif new file mode 100644 index 00000000000..850c6f3a632 Binary files /dev/null and b/mozilla/themes/modern/global/scrollbar/thumb-hrz-rit-act.gif differ diff --git a/mozilla/themes/modern/global/scrollbar/thumb-vrt-btm-act.gif b/mozilla/themes/modern/global/scrollbar/thumb-vrt-btm-act.gif new file mode 100644 index 00000000000..b538f65c6d2 Binary files /dev/null and b/mozilla/themes/modern/global/scrollbar/thumb-vrt-btm-act.gif differ diff --git a/mozilla/themes/modern/global/scrollbar/thumb-vrt-grip-act.gif b/mozilla/themes/modern/global/scrollbar/thumb-vrt-grip-act.gif new file mode 100644 index 00000000000..faf89d99911 Binary files /dev/null and b/mozilla/themes/modern/global/scrollbar/thumb-vrt-grip-act.gif differ diff --git a/mozilla/themes/modern/global/scrollbar/thumb-vrt-mid-act.gif b/mozilla/themes/modern/global/scrollbar/thumb-vrt-mid-act.gif new file mode 100644 index 00000000000..4852cfac392 Binary files /dev/null and b/mozilla/themes/modern/global/scrollbar/thumb-vrt-mid-act.gif differ diff --git a/mozilla/themes/modern/global/scrollbar/thumb-vrt-top-act.gif b/mozilla/themes/modern/global/scrollbar/thumb-vrt-top-act.gif new file mode 100644 index 00000000000..99fcbf0663d Binary files /dev/null and b/mozilla/themes/modern/global/scrollbar/thumb-vrt-top-act.gif differ diff --git a/mozilla/themes/modern/global/scrollbars-mini.css b/mozilla/themes/modern/global/scrollbars-mini.css new file mode 100644 index 00000000000..02551783814 --- /dev/null +++ b/mozilla/themes/modern/global/scrollbars-mini.css @@ -0,0 +1,186 @@ +/* + * The contents of this file are subject to the Netscape 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/NPL/ + * + * 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 Communicator client code, released + * March 31, 1998. + * + * The Initial Developer of the Original Code is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1998-2001 Netscape Communications Corporation. All + * Rights Reserved. + * + * Contributor(s): + * Joe Hewitt (hewitt@netscape.com) + */ + +/* ===== scrollbars.css ================================================= + == Styles used by XUL scrollbar-related elements. + ======================================================================= */ + +@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); + +/* ::::: scrollbar ::::: */ + +scrollbar { + -moz-binding: url("chrome://global/content/bindings/scrollbar.xml#scrollbar"); +} + +/* ::::: slider ::::: */ + +slider { + height: 8px; + background: url("chrome://global/skin/scrollbar/mini-slider-hrz-mid.gif") repeat-x; +} + +slider[align="vertical"] { + border-top: 0px; + border-bottom: 0px; + width: 8px; + background: url("chrome://global/skin/scrollbar/mini-slider-vrt-mid.gif") repeat-y; +} + +/* ::::: thumb (horizontal) ::::: */ + +thumb { + -moz-binding: url("chrome://global/skin/globalBindings.xml#thumb-horizontal"); +} + +.thumb-horz-spring-left { + width: 3px; + height: 8px; + background: url("chrome://global/skin/scrollbar/mini-thumb-hrz-lft.gif") no-repeat; +} + +.thumb-horz-box-middle { + height: 8px; + background: url("chrome://global/skin/scrollbar/mini-thumb-hrz-mid.gif") repeat-x; +} + +.thumb-horz-spring-right { + width: 3px; + height: 8px; + background: url("chrome://global/skin/scrollbar/mini-thumb-hrz-rit.gif") no-repeat; +} + +.thumb-horz-grippy { + margin-left: 1px; + width: 10px; + background: url("chrome://global/skin/scrollbar/mini-thumb-hrz-grip.gif") repeat-x; +} + +/* ..... active state ..... */ + +thumb:active > .thumb-horz-spring-left { + background-image: url("chrome://global/skin/scrollbar/mini-thumb-hrz-lft-act.gif"); +} + +thumb:active > .thumb-horz-box-middle { + background-image: url("chrome://global/skin/scrollbar/mini-thumb-hrz-mid-act.gif"); +} + +thumb:active > .thumb-horz-spring-right { + background-image: url("chrome://global/skin/scrollbar/mini-thumb-hrz-rit-act.gif"); +} + +thumb:active > .thumb-horz-box-middle > .thumb-horz-grippy { + background-image: url("chrome://global/skin/scrollbar/mini-thumb-hrz-grip-act.gif"); +} + +/* ::::: thumb (vertical) ::::: */ + +thumb[align="vertical"] { + -moz-binding: url("chrome://global/skin/globalBindings.xml#thumb-vertical"); +} + +.thumb-vert-spring-top { + background: url("chrome://global/skin/scrollbar/mini-thumb-vrt-top.gif") no-repeat; + height: 3px; + width: 8px; +} + +.thumb-vert-box-middle { + background: url("chrome://global/skin/scrollbar/mini-thumb-vrt-mid.gif") repeat-y; + width: 8px; +} + +.thumb-vert-spring-bottom { + background: url("chrome://global/skin/scrollbar/mini-thumb-vrt-btm.gif") no-repeat; + height: 3px; + width: 8px; +} + +.thumb-vert-grippy { + margin-top: 1px; + height: 10px; + background: url("chrome://global/skin/scrollbar/mini-thumb-vrt-grip.gif") repeat-y; +} + +/* ..... active state ..... */ + +thumb:active > .thumb-vert-spring-top { + background-image: url("chrome://global/skin/scrollbar/mini-thumb-vrt-top-act.gif") no-repeat; +} + +thumb:active > .thumb-vert-box-middle { + background-image: url("chrome://global/skin/scrollbar/mini-thumb-vrt-mid-act.gif") repeat-y; +} + +thumb:active > .thumb-vert-spring-bottom { + background-image: url("chrome://global/skin/scrollbar/mini-thumb-vrt-btm-act.gif") no-repeat; +} + +thumb:active > .thumb-vert-box-middle > .thumb-vert-grippy { + background-image: url("chrome://global/skin/scrollbar/mini-thumb-vrt-grip-act.gif"); +} + +/* ::::: scrollbar button ::::: */ + +scrollbarbutton { + -moz-binding: url("chrome://global/content/bindings/scrollbar.xml#scrollbarbutton"); + cursor: default; + vertical-align: bottom; +} + +/* ..... increment .... */ + +scrollbarbutton[type="increment"] { + list-style-image: url("chrome://global/skin/scrollbar/mini-btn-rit.gif") +} + +scrollbarbutton[type="increment"]:hover:active { + list-style-image: url("chrome://global/skin/scrollbar/mini-btn-rit-act.gif") +} + +scrollbar[align="vertical"] > scrollbarbutton[type="increment"] { + list-style-image: url("chrome://global/skin/scrollbar/mini-btn-dn.gif") +} + +scrollbar[align="vertical"] > scrollbarbutton[type="increment"]:hover:active { + list-style-image: url("chrome://global/skin/scrollbar/mini-btn-dn-act.gif") +} + +/* ..... decrement .... */ + +scrollbarbutton[type="decrement"] { + list-style-image: url("chrome://global/skin/scrollbar/mini-btn-lft.gif") +} + +scrollbarbutton[type="decrement"]:hover:active { + list-style-image: url("chrome://global/skin/scrollbar/mini-btn-lft-act.gif") +} + +scrollbar[align="vertical"] > scrollbarbutton[type="decrement"] { + list-style-image: url("chrome://global/skin/scrollbar/mini-btn-up.gif") +} + +scrollbar[align="vertical"] > scrollbarbutton[type="decrement"]:hover:active { + list-style-image: url("chrome://global/skin/scrollbar/mini-btn-up-act.gif") +} diff --git a/mozilla/widget/src/windows/SimpleDOMNode.cpp b/mozilla/widget/src/windows/SimpleDOMNode.cpp new file mode 100644 index 00000000000..aa105b8e9d2 --- /dev/null +++ b/mozilla/widget/src/windows/SimpleDOMNode.cpp @@ -0,0 +1,436 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * + * The contents of this file are subject to the Netscape 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/NPL/ + * + * 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 Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Original Author: Aaron Leventhal (aaronl@netscape.com) + * + * Contributor(s): + */ + +#include "nsIAccessible.h" +#include "nsIAccessibleDocument.h" +#include "Accessible.h" +#include "SimpleDOMNode.h" +#include "ISimpleDOMNode_iid.h" +#include "ISimpleDOMDocument_iid.h" +#include "nsIWidget.h" +#include "nsWindow.h" +#include "nsCOMPtr.h" +#include "nsXPIDLString.h" +#include "nsIAccessibleEventReceiver.h" +#include "nsReadableUtils.h" +#include "nsITextContent.h" +#include "nsIFrame.h" +#include "nsIDocument.h" +#include "nsIPresShell.h" +#include "nsIDOMNodeList.h" +#include "nsIDOMDocument.h" +#include "nsIScriptGlobalObject.h" +#include "nsIDOMCSSStyleDeclaration.h" +#include "nsIDOMViewCSS.h" +#include "nsIDOMHTMLAreaElement.h" +#include "nsILink.h" +#include "nsIAccessibilityService.h" +#include "nsIServiceManager.h" +#include "nsIWeakReference.h" +#include "nsIDocShellTreeItem.h" +#include "nsIPresContext.h" +#include "nsPromiseFlatString.h" + +/* For documentation of the accessibility architecture, + * see http://lxr.mozilla.org/seamonkey/source/accessible/accessible-docs.html + */ + +//#define DEBUG_LEAKS + +#ifdef DEBUG_LEAKS +static gSimpleDOMNodes = 0; +#endif + +/* + * Class Accessible + */ + + +//----------------------------------------------------- +// construction +//----------------------------------------------------- + +SimpleDOMNode::SimpleDOMNode(nsIAccessible* aNSAcc, nsIDOMNode *aNode, HWND aWnd): mWnd(aWnd), m_cRef(0) +{ + MOZ_COUNT_CTOR(SimpleDOMNode); // For catching leaks on tinderbox + mDOMNode = aNode; + if (!aNode && aNSAcc) + aNSAcc->AccGetDOMNode(getter_AddRefs(mDOMNode)); + +#ifdef DEBUG_LEAKS + printf("SimpleDOMNodes=%d\n", ++gSimpleDOMNodes); +#endif +} + +//----------------------------------------------------- +// destruction +//----------------------------------------------------- +SimpleDOMNode::~SimpleDOMNode() +{ + MOZ_COUNT_DTOR(SimpleDOMNode); // For catching leaks on tinderbox + m_cRef = 0; +#ifdef DEBUG_LEAKS + printf("SimpleDOMNodes=%d\n", --gSimpleDOMNodes); +#endif +} + + +//----------------------------------------------------- +// IUnknown interface methods - see iunknown.h for documentation +//----------------------------------------------------- +STDMETHODIMP SimpleDOMNode::QueryInterface(REFIID iid, void** ppv) +{ + *ppv = nsnull; + + if (IID_IUnknown == iid || IID_ISimpleDOMNode == iid) + *ppv = NS_STATIC_CAST(ISimpleDOMNode*, this); + + if (nsnull == *ppv) + return E_NOINTERFACE; //iid not supported. + + (NS_REINTERPRET_CAST(IUnknown*, *ppv))->AddRef(); + return S_OK; +} + +//----------------------------------------------------- +STDMETHODIMP_(ULONG) SimpleDOMNode::AddRef() +{ + return ++m_cRef; +} + + +//----------------------------------------------------- +STDMETHODIMP_(ULONG) SimpleDOMNode::Release() +{ + if (0 != --m_cRef) + return m_cRef; + + delete this; + + return 0; +} + + +//----------------------------------------------------- +// ISimpleDOMNode methods +//----------------------------------------------------- + +STDMETHODIMP SimpleDOMNode::get_nodeInfo( + /* [out] */ BSTR __RPC_FAR *aNodeName, + /* [out] */ short __RPC_FAR *aNameSpaceID, + /* [out] */ BSTR __RPC_FAR *aNodeValue, + /* [out] */ unsigned int __RPC_FAR *aNumChildren, + /* [out] */ unsigned short __RPC_FAR *aNodeType) +{ + *aNodeName = nsnull; + nsCOMPtr domElement; + nsCOMPtr content; + GetElementAndContentFor(domElement, content); + + PRUint16 nodeType = 0; + mDOMNode->GetNodeType(&nodeType); + *aNodeType=NS_STATIC_CAST(unsigned short, nodeType); + + if (*aNodeType != NODETYPE_TEXT) { + nsAutoString nodeName; + mDOMNode->GetNodeName(nodeName); + *aNodeName = ::SysAllocString(nodeName.get()); + } + + nsAutoString nodeValue; + + mDOMNode->GetNodeValue(nodeValue); + *aNodeValue = ::SysAllocString(nodeValue.get()); + + PRInt32 nameSpaceID = 0; + if (content) + content->GetNameSpaceID(nameSpaceID); + *aNameSpaceID = NS_STATIC_CAST(short, nameSpaceID); + + *aNumChildren = 0; + PRUint32 numChildren = 0; + nsCOMPtr nodeList; + mDOMNode->GetChildNodes(getter_AddRefs(nodeList)); + if (nodeList && NS_OK == nodeList->GetLength(&numChildren)) + *aNumChildren = NS_STATIC_CAST(unsigned int, numChildren); + + return S_OK; +} + + + +STDMETHODIMP SimpleDOMNode::get_attributes( + /* [in] */ unsigned short aMaxAttribs, + /* [length_is][size_is][out] */ BSTR __RPC_FAR *aAttribNames, + /* [length_is][size_is][out] */ short __RPC_FAR *aNameSpaceIDs, + /* [length_is][size_is][out] */ BSTR __RPC_FAR *aAttribValues, + /* [out] */ unsigned short __RPC_FAR *aNumAttribs) +{ + nsCOMPtr domElement; + nsCOMPtr content; + GetElementAndContentFor(domElement, content); + *aNumAttribs = 0; + + if (!content || !domElement) + return S_FALSE; + PRInt32 numAttribs; + content->GetAttributeCount(numAttribs); + if (numAttribs > aMaxAttribs) + numAttribs = aMaxAttribs; + *aNumAttribs = NS_STATIC_CAST(unsigned short, numAttribs); + + PRInt32 index, nameSpaceID; + nsCOMPtr nameAtom, prefixAtom; + + for (index = 0; index < numAttribs; index++) { + aNameSpaceIDs[index] = 0; aAttribValues[index] = aAttribNames[index] = nsnull; + nsAutoString attributeValue; + const PRUnichar *pszAttributeName; + + if (NS_SUCCEEDED(content->GetAttributeNameAt(index, nameSpaceID, *getter_AddRefs(nameAtom), *getter_AddRefs(prefixAtom)))) { + aNameSpaceIDs[index] = NS_STATIC_CAST(short, nameSpaceID); + nameAtom->GetUnicode(&pszAttributeName); + aAttribNames[index] = ::SysAllocString(pszAttributeName); + if (NS_SUCCEEDED(content->GetAttribute(nameSpaceID, nameAtom, attributeValue))) + aAttribValues[index] = ::SysAllocString(attributeValue.get()); + } + } + + return S_OK; +} + + +NS_IMETHODIMP SimpleDOMNode::GetComputedStyleDeclaration(nsIDOMCSSStyleDeclaration **aCssDecl, PRUint32 *aLength) +{ + nsCOMPtr domElement; + nsCOMPtr content; + GetElementAndContentFor(domElement, content); + if (!domElement || !content) + return NS_ERROR_FAILURE; + + nsCOMPtr doc; + if (content) + content->GetDocument(*getter_AddRefs(doc)); + + nsCOMPtr shell; + if (doc) + doc->GetShellAt(0, getter_AddRefs(shell)); + + if (!shell) + return NS_ERROR_FAILURE; + + nsCOMPtr global; + doc->GetScriptGlobalObject(getter_AddRefs(global)); + nsCOMPtr viewCSS(do_QueryInterface(global)); + + if (!viewCSS) + return NS_ERROR_FAILURE; + + nsCOMPtr cssDecl; + nsAutoString empty; + viewCSS->GetComputedStyle(domElement, empty, getter_AddRefs(cssDecl)); + if (cssDecl) { + *aCssDecl = cssDecl; + NS_ADDREF(*aCssDecl); + cssDecl->GetLength(aLength); + return NS_OK; + } + return NS_ERROR_FAILURE; +} + + +/* To do: use media type if not null */ +STDMETHODIMP SimpleDOMNode::get_computedStyle( + /* [in] */ unsigned short aMaxStyleProperties, + /* [in] */ boolean aUseAlternateView, + /* [length_is][size_is][out] */ BSTR __RPC_FAR *aStyleProperties, + /* [length_is][size_is][out] */ BSTR __RPC_FAR *aStyleValues, + /* [out] */ unsigned short __RPC_FAR *aNumStyleProperties) +{ + *aNumStyleProperties = 0; + PRUint32 length; + nsCOMPtr cssDecl; + if (NS_FAILED(GetComputedStyleDeclaration(getter_AddRefs(cssDecl), &length))) + return S_FALSE; + + PRUint32 index, realIndex; + for (index = realIndex = 0; index < length && realIndex < aMaxStyleProperties; index ++) { + nsAutoString property, value; + if (NS_SUCCEEDED(cssDecl->Item(index, property)) && property.CharAt(0) != '-') // Ignore -moz-* properties + cssDecl->GetPropertyValue(property, value); // Get property value + if (!value.IsEmpty()) { + aStyleProperties[realIndex] = ::SysAllocString(property.get()); + aStyleValues[realIndex] = ::SysAllocString(value.get()); + ++realIndex; + } + } + *aNumStyleProperties = NS_STATIC_CAST(unsigned short, realIndex); + + return S_OK; +} + + +STDMETHODIMP SimpleDOMNode::get_computedStyleForProperties( + /* [in] */ unsigned short aNumStyleProperties, + /* [in] */ boolean aUseAlternateView, + /* [length_is][size_is][in] */ BSTR __RPC_FAR *aStyleProperties, + /* [length_is][size_is][out] */ BSTR __RPC_FAR *aStyleValues) +{ + PRUint32 length = 0; + nsCOMPtr cssDecl; + nsresult rv = GetComputedStyleDeclaration(getter_AddRefs(cssDecl), &length); + if (NS_FAILED(rv)) + return S_FALSE; + + PRUint32 index; + for (index = 0; index < aNumStyleProperties; index ++) { + nsAutoString value; + if (aStyleProperties[index]) + cssDecl->GetPropertyValue(nsDependentString(NS_STATIC_CAST(PRUnichar*,aStyleProperties[index])), value); // Get property value + aStyleValues[index] = ::SysAllocString(value.get()); + } + + return S_OK; +} + + +ISimpleDOMNode* SimpleDOMNode::MakeSimpleDOMNode(nsIDOMNode *node) +{ + if (!node) + return NULL; + + ISimpleDOMNode *newNode = NULL; + + nsCOMPtr content(do_QueryInterface(node)); + nsCOMPtr doc; + + if (content) + content->GetDocument(*getter_AddRefs(doc)); + else { + // Get the document via QueryInterface, since there is no content node + doc = do_QueryInterface(node); + } + + if (!doc) + return NULL; + + nsCOMPtr shell; + doc->GetShellAt(0, getter_AddRefs(shell)); + if (!shell) + return NULL; + + nsCOMPtr accService(do_GetService("@mozilla.org/accessibilityService;1")); + if (!accService) + return NULL; + + nsCOMPtr nsAcc; + nsCOMPtr wr (getter_AddRefs(NS_GetWeakReference(shell))); + accService->GetAccessibleFor(wr, node, getter_AddRefs(nsAcc)); + if (nsAcc) { + nsCOMPtr nsAccDoc(do_QueryInterface(nsAcc)); + if (nsAccDoc) + newNode = new DocAccessible(nsAcc, node, mWnd); + else + newNode = new Accessible(nsAcc, node, mWnd); + } + else if (!content) { // We're on a the root frame + IAccessible * pAcc = NULL; + HRESULT hr = Accessible::AccessibleObjectFromWindow( mWnd, OBJID_CLIENT, IID_IAccessible, (void **) &pAcc ); + if (pAcc) { + ISimpleDOMNode *testNode; + pAcc->QueryInterface(IID_ISimpleDOMNode, (void**)&testNode); + newNode = testNode; + pAcc->Release(); + } + } + else + newNode = new SimpleDOMNode(nsnull, node, mWnd); + + if (newNode) + newNode->AddRef(); + + return newNode; +} + + +STDMETHODIMP SimpleDOMNode::get_parentNode(ISimpleDOMNode __RPC_FAR *__RPC_FAR *aNode) +{ + nsCOMPtr node; + mDOMNode->GetParentNode(getter_AddRefs(node)); + *aNode = MakeSimpleDOMNode(node); + + return S_OK; +} + +STDMETHODIMP SimpleDOMNode::get_firstChild(ISimpleDOMNode __RPC_FAR *__RPC_FAR *aNode) +{ + nsCOMPtr node; + mDOMNode->GetFirstChild(getter_AddRefs(node)); + *aNode = MakeSimpleDOMNode(node); + + return S_OK; +} + +STDMETHODIMP SimpleDOMNode::get_lastChild(ISimpleDOMNode __RPC_FAR *__RPC_FAR *aNode) +{ + nsCOMPtr node; + mDOMNode->GetLastChild(getter_AddRefs(node)); + *aNode = MakeSimpleDOMNode(node); + + return S_OK; +} + +STDMETHODIMP SimpleDOMNode::get_previousSibling(ISimpleDOMNode __RPC_FAR *__RPC_FAR *aNode) +{ + nsCOMPtr node; + mDOMNode->GetPreviousSibling(getter_AddRefs(node)); + *aNode = MakeSimpleDOMNode(node); + + return S_OK; +} + +STDMETHODIMP SimpleDOMNode::get_nextSibling(ISimpleDOMNode __RPC_FAR *__RPC_FAR *aNode) +{ + nsCOMPtr node; + mDOMNode->GetNextSibling(getter_AddRefs(node)); + *aNode = MakeSimpleDOMNode(node); + + return S_OK; +} + + + +//------- Helper methods --------- + +void SimpleDOMNode::GetElementAndContentFor(nsCOMPtr& aElement, nsCOMPtr &aContent) +{ + aElement = do_QueryInterface(mDOMNode); + aContent = do_QueryInterface(mDOMNode); +} + + +nsIDOMNode* SimpleDOMNode::GetRealDOMNode() +{ + return mDOMNode; +} \ No newline at end of file diff --git a/mozilla/widget/src/windows/SimpleDOMNode.h b/mozilla/widget/src/windows/SimpleDOMNode.h new file mode 100644 index 00000000000..37aa7b15adc --- /dev/null +++ b/mozilla/widget/src/windows/SimpleDOMNode.h @@ -0,0 +1,107 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * + * The contents of this file are subject to the Netscape 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/NPL/ + * + * 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 Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Original Author: Aaron Leventhal + * + * Contributor(s): + */ + +/* For documentation of the accessibility architecture, + * see http://lxr.mozilla.org/seamonkey/source/accessible/accessible-docs.html + */ + +#ifndef _SimpleDOMNode_H_ +#define _SimpleDOMNode_H_ + +#include "nsCOMPtr.h" +#include "nsIAccessible.h" +#include "Accessible.h" +#include "nsIAccessibleEventListener.h" +#include "ISimpleDOMNode.h" +#include "ISimpleDOMDocument.h" +#include "nsIDOMElement.h" +#include "nsIContent.h" + +#include "nsString.h" + +class SimpleDOMNode : public ISimpleDOMNode +{ + public: // construction, destruction + SimpleDOMNode(nsIAccessible *, HWND); + SimpleDOMNode(nsIAccessible *, nsIDOMNode *, HWND); + virtual ~SimpleDOMNode(); + + public: // IUnknown methods - see iunknown.h for documentation + STDMETHODIMP_(ULONG) AddRef (); + STDMETHODIMP QueryInterface(REFIID, void**); + STDMETHODIMP_(ULONG) Release (); + + nsIDOMNode* GetRealDOMNode(); + + private: + void GetAccessibleFor(nsIDOMNode *node, nsIAccessible **newAcc); + ISimpleDOMNode* SimpleDOMNode::MakeSimpleDOMNode(nsIDOMNode *node); + NS_IMETHOD GetComputedStyleDeclaration(nsIDOMCSSStyleDeclaration **aCssDecl, PRUint32 *aLength); + + + public: + + virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_nodeInfo( + /* [out] */ BSTR __RPC_FAR *tagName, + /* [out] */ short __RPC_FAR *nameSpaceID, + /* [out] */ BSTR __RPC_FAR *nodeValue, + /* [out] */ unsigned int __RPC_FAR *numChildren, + /* [out][retval] */ unsigned short __RPC_FAR *nodeType); + + virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_attributes( + /* [in] */ unsigned short maxAttribs, + /* [length_is][size_is][out] */ BSTR __RPC_FAR *attribNames, + /* [length_is][size_is][out] */ short __RPC_FAR *nameSpaceID, + /* [length_is][size_is][out] */ BSTR __RPC_FAR *attribValues, + /* [out][retval] */ unsigned short __RPC_FAR *numAttribs); + + virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_computedStyle( + /* [in] */ unsigned short maxStyleProperties, + /* [in] */ boolean useAlternateView, + /* [length_is][size_is][out] */ BSTR __RPC_FAR *styleProperties, + /* [length_is][size_is][out] */ BSTR __RPC_FAR *styleValues, + /* [out][retval] */ unsigned short __RPC_FAR *numStyleProperties); + + virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_computedStyleForProperties( + /* [in] */ unsigned short numStyleProperties, + /* [in] */ boolean useAlternateView, + /* [length_is][size_is][in] */ BSTR __RPC_FAR *styleProperties, + /* [length_is][size_is][out][retval] */ BSTR __RPC_FAR *styleValues); + + virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_parentNode(ISimpleDOMNode __RPC_FAR *__RPC_FAR *node); + virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_firstChild(ISimpleDOMNode __RPC_FAR *__RPC_FAR *node); + virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_lastChild(ISimpleDOMNode __RPC_FAR *__RPC_FAR *node); + virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_previousSibling(ISimpleDOMNode __RPC_FAR *__RPC_FAR *node); + virtual /* [propget] */ HRESULT STDMETHODCALLTYPE get_nextSibling(ISimpleDOMNode __RPC_FAR *__RPC_FAR *node); + + protected: + nsCOMPtr mDOMNode; + ULONG m_cRef; // the reference count + HWND mWnd; + + void GetElementAndContentFor(nsCOMPtr& aElement, nsCOMPtr& aContent); +}; + +#endif + diff --git a/mozilla/widget/src/windows/expose/ISimpleDOMDocument/ISimpleDOMDocument.def b/mozilla/widget/src/windows/expose/ISimpleDOMDocument/ISimpleDOMDocument.def new file mode 100644 index 00000000000..2b9854b7500 --- /dev/null +++ b/mozilla/widget/src/windows/expose/ISimpleDOMDocument/ISimpleDOMDocument.def @@ -0,0 +1,7 @@ +LIBRARY ISimpleDOMDocumentMarshal.dll +DESCRIPTION 'ISimpleDOMDocument proxy/stub DLL - allows cross-process communication' +EXPORTS DllGetClassObject @1 PRIVATE + DllCanUnloadNow @2 PRIVATE + DllRegisterServer @4 PRIVATE + DllUnregisterServer @5 PRIVATE + diff --git a/mozilla/widget/src/windows/expose/ISimpleDOMDocument/ISimpleDOMDocument.idl b/mozilla/widget/src/windows/expose/ISimpleDOMDocument/ISimpleDOMDocument.idl new file mode 100644 index 00000000000..6f9d3e5cc58 --- /dev/null +++ b/mozilla/widget/src/windows/expose/ISimpleDOMDocument/ISimpleDOMDocument.idl @@ -0,0 +1,108 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * + * The contents of this file are subject to the Netscape 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/NPL/ + * + * 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 Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Author: Aaron Leventhal (aaronl@netscape.com) + */ + +cpp_quote("///////////////////////////////////////////////////////////////////////////////////////////////////////") +cpp_quote("//") +cpp_quote("// ISimpleDOMDocument.h") +cpp_quote("// ---------------------------------------------------------------------------------------------------=") +cpp_quote("//") +cpp_quote("// get_URL(out] BSTR *url)") +cpp_quote("// ---------------------------------------------------------------------------------------------------=") +cpp_quote("// Get the internet URL associated with this document.") +cpp_quote("//") +cpp_quote("// get_title([out BSTR *title") +cpp_quote("// ---------------------------------------------------------------------------------------------------=") +cpp_quote("// Get the document's title from the element") +cpp_quote("//") +cpp_quote("// get_mimeType([out BSTR *mimeType") +cpp_quote("// ---------------------------------------------------------------------------------------------------=") +cpp_quote("// Get the registered mime type, such as text/html") +cpp_quote("//") +cpp_quote("// get_docType([out] BSTR *docType") +cpp_quote("// ---------------------------------------------------------------------------------------------------=") +cpp_quote("// Get doctype associated with the <!DOCTYPE ..> element") +cpp_quote("//") +cpp_quote("// get_nameSpaceURIForID([in] short nameSpaceID, [out] BSTR *nameSpaceURI)") +cpp_quote("// ---------------------------------------------------------------------------------------------------=") +cpp_quote("// Some of the methods for ISimpleDOMNode return a nameSpaceID (-1,0,1,2,3,....)") +cpp_quote("// This method returns the associated namespace URI for each ID.") +cpp_quote("//") +cpp_quote("// set_alternateViewMediaTypes([in] BSTR *commaSeparatedMediaType)") +cpp_quote("// ---------------------------------------------------------------------------------------------------=") +cpp_quote("// For style property retrieval on nsISimpleDOMNode elements, ") +cpp_quote("// set the additional alternate media types that properties are available for.") +cpp_quote("// [in] BSTR *commaSeparatedMediaTypes is a comma separate list, for example \"aural, braille\".") +cpp_quote("// The alternate media properties are requested with nsISimpleDOMNode::get_computedStyle.") +cpp_quote("// Note: setting this value on a document will increase memory overhead, and may create a small delay.") +cpp_quote("//") +cpp_quote("// W3C media Types:") +cpp_quote("// * all: Suitable for all devices. ") +cpp_quote("// * aural: Intended for speech synthesizers. See the section on aural style sheets for details. ") +cpp_quote("// * braille: Intended for braille tactile feedback devices. ") +cpp_quote("// * embossed: Intended for paged braille printers. ") +cpp_quote("// * handheld: Intended for handheld devices - typically small screen, monochrome, limited bandwidth. ") +cpp_quote("// * print: Intended for paged, opaque material and for documents viewed on screen in print preview mode. Please consult the section on paged media for information about formatting issues that are specific to paged media. ") +cpp_quote("// * projection: Intended for projected presentations, for example projectors or print to transparencies. Please consult the section on paged media for information about formatting issues that are specific to paged media. ") +cpp_quote("// * screen: Intended primarily for color computer screens. ") +cpp_quote("// * tty: intended for media using a fixed-pitch character grid, such as teletypes, terminals, or portable devices with limited display capabilities. Authors should not use pixel units with the tty media type. ") +cpp_quote("// * tv: Intended for television-type devices - low resolution, color, limited-scrollability screens, sound") +cpp_quote("// * See latest W3C CSS specs for complete list of media types") +cpp_quote("//") +cpp_quote("//") +cpp_quote("///////////////////////////////////////////////////////////////////////////////////////////////////////") +cpp_quote("") +cpp_quote("") + +import "objidl.idl"; +import "oaidl.idl"; + + +const long DISPID_DOC_URL = -5904; +const long DISPID_DOC_TITLE = -5905; +const long DISPID_DOC_MIMETYPE = -5906; +const long DISPID_DOC_DOCTYPE = -5907; +const long DISPID_DOC_NAMESPACE = -5908; +const long DISPID_DOC_MEDIATYPES = -5909; + +[object, uuid(0D68D6D0-D93D-4d08-A30D-F00DD1F45B24)] +interface ISimpleDOMDocument : IUnknown +{ + [propget, id(DISPID_DOC_URL)] HRESULT URL( + [out, retval] BSTR * url + ); + [propget, id(DISPID_DOC_TITLE)] HRESULT title( + [out, retval] BSTR * title + ); + [propget, id(DISPID_DOC_MIMETYPE)] HRESULT mimeType( + [out, retval] BSTR * mimeType + ); + [propget, id(DISPID_DOC_DOCTYPE)] HRESULT docType( + [out, retval] BSTR * docType + ); + [propget, id(DISPID_DOC_NAMESPACE)] HRESULT nameSpaceURIForID( + [in] short nameSpaceID, + [out, retval] BSTR * nameSpaceURI + ); + [propput, id(DISPID_DOC_MEDIATYPES)] HRESULT alternateViewMediaTypes( + [in] BSTR * commaSeparatedMediaTypes + ); +} diff --git a/mozilla/widget/src/windows/expose/ISimpleDOMDocument/makefile.win b/mozilla/widget/src/windows/expose/ISimpleDOMDocument/makefile.win new file mode 100755 index 00000000000..dcfd900eee1 --- /dev/null +++ b/mozilla/widget/src/windows/expose/ISimpleDOMDocument/makefile.win @@ -0,0 +1,72 @@ +#!nmake +# +# The contents of this file are subject to the Netscape 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/NPL/ +# +# 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 Netscape are +# Copyright (C) 1998 Netscape Communications Corporation. All +# Rights Reserved. +# +# Contributor(s): +# leaf@mozilla.org + +DEPTH=..\..\..\..\.. + +MAKE_OBJ_TYPE = DLL +MODULE = ISimpleDOMDocumentMarshal +DLL = .\$(OBJDIR)\$(MODULE).dll + +PROXYSTUBIDL = ISimpleDOMDocument.idl +LCFLAGS =-DWIN$(MOZ_BITS) -DREGISTER_PROXY_DLL -D_WIN$(MOZ_BITS)_WINNT=0x400 + +DEFFILE = ISimpleDOMDocument.def + +OBJS = \ + dlldata.obj \ + ISimpleDOMDocument_p.obj \ + ISimpleDOMDocument_i.obj \ + $(NULL) + +WIN_LIBS = \ + kernel$(MOZ_BITS).lib \ + rpcndr.lib \ + rpcns4.lib \ + rpcrt4.lib \ + uuid.lib \ + oleaut$(MOZ_BITS).lib \ + $(NULL) + +MIDL_GENERATED_FILES = \ + ..\..\ISimpleDOMDocument.h \ + ..\..\ISimpleDOMDocument_iid.h \ + ISimpleDOMDocument_p.c \ + ISimpleDOMDocument_i.c \ + dlldata.c \ + $(NULL) + +include <$(DEPTH)\config\rules.mak> + +install:: $(DLL) + $(MAKE_INSTALL) $(DLL) $(DIST)\bin + regsvr32 /s $(DIST)\bin\$(MODULE).dll + +$(MIDL_GENERATED_FILES): ISimpleDOMDocument.idl + midl ISimpleDOMDocument.idl + copy ISimpleDOMDocument.h ..\.. + copy ISimpleDOMDocument_i.c ..\..\ISimpleDOMDocument_iid.h + +export:: $(MIDL_GENERATED_FILES) + +clobber:: + rm -rf $(MIDL_GENERATED_FILES) + rm -rf $(DLL) diff --git a/mozilla/widget/src/windows/expose/ISimpleDOMNode/ISimpleDOMNode.def b/mozilla/widget/src/windows/expose/ISimpleDOMNode/ISimpleDOMNode.def new file mode 100644 index 00000000000..1cfdf1dfef1 --- /dev/null +++ b/mozilla/widget/src/windows/expose/ISimpleDOMNode/ISimpleDOMNode.def @@ -0,0 +1,7 @@ +LIBRARY ISimpleDOMNodeMarshal.dll +DESCRIPTION 'ISimpleDOMNode proxy/stub DLL - enables cross-process communication' +EXPORTS DllGetClassObject @1 PRIVATE + DllCanUnloadNow @2 PRIVATE + DllRegisterServer @4 PRIVATE + DllUnregisterServer @5 PRIVATE + diff --git a/mozilla/widget/src/windows/expose/ISimpleDOMNode/ISimpleDOMNode.idl b/mozilla/widget/src/windows/expose/ISimpleDOMNode/ISimpleDOMNode.idl new file mode 100644 index 00000000000..d37aeee891e --- /dev/null +++ b/mozilla/widget/src/windows/expose/ISimpleDOMNode/ISimpleDOMNode.idl @@ -0,0 +1,145 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * + * The contents of this file are subject to the Netscape 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/NPL/ + * + * 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 Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All + * Rights Reserved. + * + * Author: Aaron Leventhal (aaronl@netscape.com) + */ + +cpp_quote("///////////////////////////////////////////////////////////////////////////////////////////////////////") +cpp_quote("//") +cpp_quote("// ISimpleDOMNode.h ") +cpp_quote("// ---------------------------------------------------------------------------------------------------=") +cpp_quote("//") +cpp_quote("// get_nodeInfo(") +cpp_quote("// /* [out] */ BSTR *nodeName, // For elements, this is the tag name") +cpp_quote("// /* [out] */ short *nameSpaceID,") +cpp_quote("// /* [out] */ unsigned short *nodeType,") +cpp_quote("// /* [out] */ BSTR *nodeValue, ") +cpp_quote("// /* [out] */ unsigned int *numChildren); ") +cpp_quote("// ---------------------------------------------------------------------------------------------------=") +cpp_quote("// Get the basic information about a node.") +cpp_quote("// The namespace ID can be mapped to an URI using nsISimpleDOMDocument::get_nameSpaceURIForID()") +cpp_quote("//") +cpp_quote("// get_attributes(") +cpp_quote("// /* [in] */ unsigned short maxAttribs,") +cpp_quote("// /* [out] */ unsigned short *numAttribs,") +cpp_quote("// /* [out] */ BSTR *attribNames,") +cpp_quote("// /* [out] */ short *nameSpaceID,") +cpp_quote("// /* [out] */ BSTR *attribValues);") +cpp_quote("// ---------------------------------------------------------------------------------------------------=") +cpp_quote("// Returns 3 arrays - the attribute names and values, and a namespace ID for each") +cpp_quote("// If the namespace ID is 0, it's the same namespace as the node's namespace") +cpp_quote("//") +cpp_quote("// computedStyle( ") +cpp_quote("// /* [in] */ unsigned short maxStyleProperties,") +cpp_quote("// /* [out] */ unsigned short *numStyleProperties, ") +cpp_quote("// /* [in] */ boolean useAlternateView, // If TRUE, returns properites for media as set in nsIDOMDocument::set_alternateViewMediaTypes") +cpp_quote("// /* [out] */ BSTR *styleProperties, ") +cpp_quote("// /* [out] */ BSTR *styleValues);") +cpp_quote("// ---------------------------------------------------------------------------------------------------=") +cpp_quote("// Returns 2 arrays -- the style properties and their values") +cpp_quote("// useAlternateView=FALSE: gets properties for the default media type (usually screen)") +cpp_quote("// useAlternateView=TRUE: properties for media types set w/ nsIDOMSimpleDocument::set_alternateViewMediaTypes()") +cpp_quote("//") +cpp_quote("// computedStyleForProperties( ") +cpp_quote("// /* [in] */ unsigned short numStyleProperties, ") +cpp_quote("// /* [in] */ boolean useAlternateView, // If TRUE, returns properites for media as set in nsIDOMDocument::set_alternateViewMediaTypes") +cpp_quote("// /* [in] */ BSTR *styleProperties, ") +cpp_quote("// /* [out] */ BSTR *styleValues);") +cpp_quote("// ---------------------------------------------------------------------------------------------------=") +cpp_quote("// Returns style property values for those properties in the styleProperties [in] array") +cpp_quote("// Returns 2 arrays -- the style properties and their values") +cpp_quote("// useAlternateView=FALSE: gets properties for the default media type (usually screen)") +cpp_quote("// useAlternateView=TRUE: properties for media types set w/ nsIDOMSimpleDocument::set_alternateViewMediaTypes()") +cpp_quote("//") +cpp_quote("// get_parentNode (/* [in] */ ISimpleDOMNode *newNodePtr);") +cpp_quote("// get_firstChild (/* [in] */ ISimpleDOMNode *newNodePtr);") +cpp_quote("// get_lastChild (/* [in] */ ISimpleDOMNode *newNodePtr);") +cpp_quote("// get_previousSibling(/* [in] */ ISimpleDOMNode *newNodePtr);") +cpp_quote("// get_nextSibling (/* [in] */ ISimpleDOMNode *newNodePtr);") +cpp_quote("// ---------------------------------------------------------------------------------------------------=") +cpp_quote("// DOM navigation - get a different node.") +cpp_quote("//") +cpp_quote("//") +cpp_quote("///////////////////////////////////////////////////////////////////////////////////////////////////////") +cpp_quote("") +cpp_quote("") + +import "objidl.idl"; +import "oaidl.idl"; + +const long DISPID_NODE_NODEINFO = -5900; +const long DISPID_NODE_ATTRIBUTES = -5901; +const long DISPID_NODE_COMPSTYLE = -5902; +const long DISPID_NODE_COMPSTYLEFORPROPS = -5903; + +[object, uuid(96917748-8922-4fd9-8a73-d72e8aad671a)] +interface ISimpleDOMNode : IUnknown +{ + const unsigned short NODETYPE_ELEMENT = 1; + const unsigned short NODETYPE_ATTRIBUTE = 2; + const unsigned short NODETYPE_TEXT = 3; + const unsigned short NODETYPE_CDATA_SECTION = 4; + const unsigned short NODETYPE_ENTITY_REFERENCE = 5; + const unsigned short NODETYPE_ENTITY = 6; + const unsigned short NODETYPE_PROCESSING_INSTRUCTION = 7; + const unsigned short NODETYPE_COMMENT = 8; + const unsigned short NODETYPE_DOCUMENT = 9; + const unsigned short NODETYPE_DOCUMENT_TYPE = 10; + const unsigned short NODETYPE_DOCUMENT_FRAGMENT = 11; + const unsigned short NODETYPE_NOTATION = 12; + + [propget, id(DISPID_NODE_NODEINFO)] HRESULT nodeInfo( + [out] BSTR *nodeName, // for performance returns NULL for text nodes (true nodeName would be "#text") + [out] short *nameSpaceID, + [out] BSTR *nodeValue, + [out] unsigned int *numChildren, + [out, retval] unsigned short *nodeType + ); + + [propget, id(DISPID_NODE_ATTRIBUTES)] HRESULT attributes( + [in] unsigned short maxAttribs, + [out, size_is(maxAttribs), length_is(*numAttribs)] BSTR *attribNames, + [out, size_is(maxAttribs), length_is(*numAttribs)] short *nameSpaceID, + [out, size_is(maxAttribs), length_is(*numAttribs)] BSTR *attribValues, + [out, retval] unsigned short *numAttribs + ); + + [propget, id(DISPID_NODE_COMPSTYLE)] HRESULT computedStyle( + [in] unsigned short maxStyleProperties, + [in] boolean useAlternateView, // If TRUE, returns properites for media as set in nsIDOMDocument::set_alternateViewMediaTypes + [out, size_is(maxStyleProperties), length_is(*numStyleProperties)] BSTR *styleProperties, + [out, size_is(maxStyleProperties), length_is(*numStyleProperties)] BSTR *styleValues, + [out, retval] unsigned short *numStyleProperties + ); + + [propget, id(DISPID_NODE_COMPSTYLEFORPROPS)] HRESULT computedStyleForProperties( + [in] unsigned short numStyleProperties, + [in] boolean useAlternateView, // If TRUE, returns properites for media as set in nsIDOMDocument::set_alternateViewMediaTypes + [in, size_is(numStyleProperties), length_is(numStyleProperties)] BSTR *styleProperties, + [out, retval, size_is(numStyleProperties), length_is(numStyleProperties)] BSTR *styleValues + ); + + [propget] HRESULT parentNode([out, retval] ISimpleDOMNode **node); + [propget] HRESULT firstChild([out, retval] ISimpleDOMNode **node); + [propget] HRESULT lastChild([out, retval] ISimpleDOMNode **node); + [propget] HRESULT previousSibling([out, retval] ISimpleDOMNode **node); + [propget] HRESULT nextSibling([out, retval] ISimpleDOMNode **node); +} + + diff --git a/mozilla/widget/src/windows/expose/ISimpleDOMNode/makefile.win b/mozilla/widget/src/windows/expose/ISimpleDOMNode/makefile.win new file mode 100755 index 00000000000..c77e3451947 --- /dev/null +++ b/mozilla/widget/src/windows/expose/ISimpleDOMNode/makefile.win @@ -0,0 +1,72 @@ +#!nmake +# +# The contents of this file are subject to the Netscape 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/NPL/ +# +# 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 Netscape are +# Copyright (C) 1998 Netscape Communications Corporation. All +# Rights Reserved. +# +# Contributor(s): +# leaf@mozilla.org + +DEPTH=..\..\..\..\.. + +MAKE_OBJ_TYPE = DLL +MODULE = ISimpleDOMNodeMarshal +DLL = .\$(OBJDIR)\$(MODULE).dll + +PROXYSTUBIDL = ISimpleDOMNode.idl +LCFLAGS =-DWIN$(MOZ_BITS) -DREGISTER_PROXY_DLL -D_WIN$(MOZ_BITS)_WINNT=0x400 + +DEFFILE = ISimpleDOMNode.def + +OBJS = \ + dlldata.obj \ + ISimpleDOMNode_p.obj \ + ISimpleDOMNode_i.obj \ + $(NULL) + +WIN_LIBS = \ + kernel$(MOZ_BITS).lib \ + rpcndr.lib \ + rpcns4.lib \ + rpcrt4.lib \ + uuid.lib \ + oleaut$(MOZ_BITS).lib \ + $(NULL) + +MIDL_GENERATED_FILES = \ + ..\..\ISimpleDOMNode.h \ + ..\..\ISimpleDOMNode_iid.h \ + ISimpleDOMNode_p.c \ + ISimpleDOMNode_i.c \ + dlldata.c \ + $(NULL) + +include <$(DEPTH)\config\rules.mak> + +install:: $(DLL) + $(MAKE_INSTALL) $(DLL) $(DIST)\bin + regsvr32 /s $(DIST)\bin\$(MODULE).dll + +$(MIDL_GENERATED_FILES): ISimpleDOMNode.idl + midl ISimpleDOMNode.idl + copy ISimpleDOMNode.h ..\.. + copy ISimpleDOMNode_i.c ..\..\ISimpleDOMNode_iid.h + +export:: $(MIDL_GENERATED_FILES) + +clobber:: + rm -rf $(MIDL_GENERATED_FILES) + rm -rf $(DLL) diff --git a/mozilla/widget/src/windows/expose/makefile.win b/mozilla/widget/src/windows/expose/makefile.win new file mode 100755 index 00000000000..5c82c0926d1 --- /dev/null +++ b/mozilla/widget/src/windows/expose/makefile.win @@ -0,0 +1,25 @@ +#!nmake +# +# The contents of this file are subject to the Netscape 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/NPL/ +# +# 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 Netscape are +# Copyright (C) 1998 Netscape Communications Corporation. All +# Rights Reserved. +# +# Contributor(s): +DEPTH=..\..\..\.. + +DIRS=ISimpleDOMNode ISimpleDOMDocument + +include <$(DEPTH)\config\rules.mak> diff --git a/mozilla/xpfe/global/resources/locale/en-US/mac/platformKeys.properties b/mozilla/xpfe/global/resources/locale/en-US/mac/platformKeys.properties new file mode 100644 index 00000000000..6ce22e40d87 --- /dev/null +++ b/mozilla/xpfe/global/resources/locale/en-US/mac/platformKeys.properties @@ -0,0 +1,18 @@ +#mac +#this file defines the on screen display names for the various modifier keys +#these are used in XP menus to show keyboard shortcuts + +#the shift key - open up arrow symbol (ctrl-e) +VK_SHIFT=\u05 + +#the command key - clover leaf symbol (ctrl-q) +VK_META=\u11 + +#the option/alt key - splitting tracks symbol (ctrl-g) +VK_ALT=\u07 + +#the control key. hat symbol (ctrl-f) +VK_CONTROL=\u06 + +#the seperator character used between modifiers (none on Mac OS) +MODIFIER_SEPARATOR= diff --git a/mozilla/xpfe/global/resources/locale/en-US/os2/platformKeys.properties b/mozilla/xpfe/global/resources/locale/en-US/os2/platformKeys.properties new file mode 100644 index 00000000000..9ebe95b9526 --- /dev/null +++ b/mozilla/xpfe/global/resources/locale/en-US/os2/platformKeys.properties @@ -0,0 +1,18 @@ +#default +#this file defines the on screen display names for the various modifier keys +#these are used in XP menus to show keyboard shortcuts + +#the shift key +VK_SHIFT=Shift + +#the command key +VK_META=Meta + +#the alt key +VK_ALT=Alt + +#the control key +VK_CONTROL=Ctrl + +#the seperator character used between modifiers +MODIFIER_SEPARATOR=+ diff --git a/mozilla/xpfe/global/resources/locale/en-US/unix/platformKeys.properties b/mozilla/xpfe/global/resources/locale/en-US/unix/platformKeys.properties new file mode 100644 index 00000000000..9ebe95b9526 --- /dev/null +++ b/mozilla/xpfe/global/resources/locale/en-US/unix/platformKeys.properties @@ -0,0 +1,18 @@ +#default +#this file defines the on screen display names for the various modifier keys +#these are used in XP menus to show keyboard shortcuts + +#the shift key +VK_SHIFT=Shift + +#the command key +VK_META=Meta + +#the alt key +VK_ALT=Alt + +#the control key +VK_CONTROL=Ctrl + +#the seperator character used between modifiers +MODIFIER_SEPARATOR=+ diff --git a/mozilla/xpfe/global/resources/locale/en-US/win/platformKeys.properties b/mozilla/xpfe/global/resources/locale/en-US/win/platformKeys.properties new file mode 100644 index 00000000000..9ebe95b9526 --- /dev/null +++ b/mozilla/xpfe/global/resources/locale/en-US/win/platformKeys.properties @@ -0,0 +1,18 @@ +#default +#this file defines the on screen display names for the various modifier keys +#these are used in XP menus to show keyboard shortcuts + +#the shift key +VK_SHIFT=Shift + +#the command key +VK_META=Meta + +#the alt key +VK_ALT=Alt + +#the control key +VK_CONTROL=Ctrl + +#the seperator character used between modifiers +MODIFIER_SEPARATOR=+