diff --git a/mozilla/accessible/build/Makefile.in b/mozilla/accessible/build/Makefile.in index 9f217a3dcce..c0538548aa1 100644 --- a/mozilla/accessible/build/Makefile.in +++ b/mozilla/accessible/build/Makefile.in @@ -49,6 +49,7 @@ LOCAL_INCLUDES = -I$(srcdir)/../src SHARED_LIBRARY_LIBS = \ $(DIST)/lib/$(LIB_PREFIX)accessibility_base_s.$(LIB_SUFFIX) \ $(DIST)/lib/$(LIB_PREFIX)accessibility_html_s.$(LIB_SUFFIX) \ + $(DIST)/lib/$(LIB_PREFIX)accessibility_toolkit_s.$(LIB_SUFFIX) \ $(NULL) ifdef MOZ_XUL diff --git a/mozilla/accessible/public/Makefile.in b/mozilla/accessible/public/Makefile.in index c4908070c54..cbb2c09e3f6 100644 --- a/mozilla/accessible/public/Makefile.in +++ b/mozilla/accessible/public/Makefile.in @@ -26,6 +26,10 @@ VPATH = @srcdir@ include $(DEPTH)/config/autoconf.mk +ifeq ($(MOZ_WIDGET_TOOLKIT),windows) +DIRS = msaa +endif + MODULE = accessibility XPIDL_MODULE= accessibility GRE_MODULE = 1 @@ -46,7 +50,7 @@ XPIDLSRCS = \ nsIAccessibleTable.idl \ nsIAccessibleText.idl \ nsIAccessibleValue.idl \ - nsIAccessibleWin32Object.idl \ + nsIAccessNode.idl \ $(NULL) include $(topsrcdir)/config/rules.mk diff --git a/mozilla/accessible/public/nsIAccessibilityService.idl b/mozilla/accessible/public/nsIAccessibilityService.idl index bfc6b8fa51a..ece38307083 100644 --- a/mozilla/accessible/public/nsIAccessibilityService.idl +++ b/mozilla/accessible/public/nsIAccessibilityService.idl @@ -35,9 +35,8 @@ interface nsIAccessibleEventListener; [scriptable, uuid(68D9720A-0984-42b6-A3F5-8237ED925727)] interface nsIAccessibilityService : nsISupports { - nsIAccessible createAccessible(in nsIDOMNode aNode, in nsISupports aDocument); - nsIAccessible createIFrameAccessible(in nsIDOMNode aNode); - nsIAccessible createRootAccessible(in nsISupports aPresContext, in nsISupports aFrame); + nsIAccessible createOuterDocAccessible(in nsIDOMNode aNode); + nsIAccessible createRootAccessible(in nsISupports aPresContext); nsIAccessibleCaret createCaretAccessible(in nsIDOMNode aNode, in nsIAccessibleEventListener aListener); nsIAccessible createHTML4ButtonAccessible(in nsISupports aFrame); @@ -53,7 +52,7 @@ interface nsIAccessibilityService : nsISupports nsIAccessible createHTMLImageAccessible(in nsISupports aFrame); nsIAccessible createHTMLLabelAccessible(in nsISupports aFrame); nsIAccessible createHTMLListboxAccessible(in nsIDOMNode aNode, in nsISupports aPresShell); - nsIAccessible createHTMLNativeWindowAccessible(in nsIDOMNode aDOMNode, in nsIWeakReference aShell, in PRInt32 aHWnd); + [noscript] nsIAccessible createHTMLNativeWindowAccessible(in nsIDOMNode aDOMNode, in nsIWeakReference aShell, in voidPtr aHWnd); nsIAccessible createHTMLPluginAccessible(in nsIDOMNode aDOMNode, in nsIWeakReference aShell); nsIAccessible createHTMLRadioButtonAccessible(in nsISupports aFrame); nsIAccessible createHTMLRadioButtonAccessibleXBL(in nsIDOMNode aNode); diff --git a/mozilla/accessible/public/nsIAccessible.idl b/mozilla/accessible/public/nsIAccessible.idl index bf9bca4f297..59e47693e32 100644 --- a/mozilla/accessible/public/nsIAccessible.idl +++ b/mozilla/accessible/public/nsIAccessible.idl @@ -82,6 +82,8 @@ interface nsIAccessible : nsISupports [noscript] void handleEvent(in unsigned long aEvent, in nsIAccessible aTarget, in voidPtr aData); + [noscript] void getNativeInterface(out voidPtr aOutAccessible); + // MSAA State flags - used for bitfield. More than 1 allowed. const unsigned long STATE_UNAVAILABLE = 0x00000001; // Disabled, maps to opposite of Java ENABLED, Gnome/ATK SENSITIVE? const unsigned long STATE_SELECTED = 0x00000002; diff --git a/mozilla/accessible/public/nsIAccessibleDocument.idl b/mozilla/accessible/public/nsIAccessibleDocument.idl index 2dccc93936b..6d0d535909f 100644 --- a/mozilla/accessible/public/nsIAccessibleDocument.idl +++ b/mozilla/accessible/public/nsIAccessibleDocument.idl @@ -37,6 +37,6 @@ interface nsIAccessibleDocument : nsISupports readonly attribute AString mimeType; readonly attribute AString docType; AString getNameSpaceURIForID(in short nameSpaceID); - [noscript] nsIDocument getDocument(); readonly attribute nsIAccessibleCaret caretAccessible; + [noscript] attribute voidPtr window; }; diff --git a/mozilla/accessible/public/nsIAccessibleWin32Object.idl b/mozilla/accessible/public/nsIAccessibleWin32Object.idl deleted file mode 100644 index e99f0a0c6f7..00000000000 --- a/mozilla/accessible/public/nsIAccessibleWin32Object.idl +++ /dev/null @@ -1,34 +0,0 @@ -/* -*- 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): - * - */ - -#include "nsISupports.idl" - -[scriptable, uuid(ca7a3a93-822f-4cdf-8cb4-c52d16b9afc7)] -interface nsIAccessibleWin32Object : nsISupports -{ - /** handle to the external window implementing IAccessible */ - readonly attribute long hwnd; -}; diff --git a/mozilla/accessible/src/Makefile.in b/mozilla/accessible/src/Makefile.in index b7e2d2b80a0..9ef5d5a8d49 100644 --- a/mozilla/accessible/src/Makefile.in +++ b/mozilla/accessible/src/Makefile.in @@ -26,7 +26,19 @@ VPATH = @srcdir@ include $(DEPTH)/config/autoconf.mk -DIRS = \ +ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2) +DIRS += atk +else +ifeq ($(MOZ_WIDGET_TOOLKIT),windows) +DIRS += msaa +else +ifeq ($(MOZ_WIDGET_TOOLKIT),mac) +DIRS += mac +endif +endif +endif + +DIRS += \ base \ html \ $(null) diff --git a/mozilla/accessible/src/atk/Makefile.in b/mozilla/accessible/src/atk/Makefile.in new file mode 100644 index 00000000000..3a45260467f --- /dev/null +++ b/mozilla/accessible/src/atk/Makefile.in @@ -0,0 +1,91 @@ +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Original Code is mozilla.org code +# +# The Initial Developer of the Original Code is +# Aaron Leventhal +# Portions created by the Initial Developer are Copyright (C) 2003 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +DEPTH = ../../.. +topsrcdir = @top_srcdir@ +srcdir = @srcdir@ +VPATH = @srcdir@ + +include $(DEPTH)/config/autoconf.mk + +MODULE = accessibility +LIBRARY_NAME = accessibility_toolkit_s +REQUIRES = content \ + docshell \ + dom \ + gfx \ + htmlparser \ + intl \ + layout \ + locale \ + necko \ + plugin \ + pref \ + string \ + uriloader \ + view \ + webshell \ + widget \ + xpcom \ + xuldoc \ + $(NULL) + +CPPSRCS = \ + nsAccessNodeWrap.cpp \ + nsAccessibleWrap.cpp \ + nsDocAccessibleWrap.cpp \ + nsRootAccessibleWrap.cpp \ + $(NULL) + +EXPORTS = \ + nsAccessNodeWrap.h \ + nsAccessibleWrap.h \ + nsDocAccessibleWrap.h \ + nsRootAccessibleWrap.h \ + $(NULL) + +# we don't want the shared lib, but we want to force the creation of a static lib. +FORCE_STATIC_LIB = 1 + +include $(topsrcdir)/config/rules.mk + +LOCAL_INCLUDES += \ + -I$(srcdir) \ + -I$(srcdir)/../base \ + -I$(srcdir)/../html \ + -I$(srcdir)/../xul \ + $(NULL) + diff --git a/mozilla/accessible/src/atk/nsAccessNodeWrap.cpp b/mozilla/accessible/src/atk/nsAccessNodeWrap.cpp new file mode 100644 index 00000000000..9cbee8451c2 --- /dev/null +++ b/mozilla/accessible/src/atk/nsAccessNodeWrap.cpp @@ -0,0 +1,65 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 2003 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Original Author: Aaron Leventhal (aaronl@netscape.com) + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +#include "nsAccessNodeWrap.h" + +/* For documentation of the accessibility architecture, + * see http://lxr.mozilla.org/seamonkey/source/accessible/accessible-docs.html + */ + + +/* + * Class nsAccessNodeWrap + */ + +//----------------------------------------------------- +// construction +//----------------------------------------------------- + +nsAccessNodeWrap::nsAccessNodeWrap(nsIDOMNode *aNode): nsAccessNode(aNode) +{ +} + +//----------------------------------------------------- +// destruction +//----------------------------------------------------- +nsAccessNodeWrap::~nsAccessNodeWrap() +{ +} + + diff --git a/mozilla/accessible/src/atk/nsAccessNodeWrap.h b/mozilla/accessible/src/atk/nsAccessNodeWrap.h new file mode 100644 index 00000000000..fabd2a0ace7 --- /dev/null +++ b/mozilla/accessible/src/atk/nsAccessNodeWrap.h @@ -0,0 +1,56 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 2003 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Original Author: Aaron Leventhal (aaronl@netscape.com) + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +/* For documentation of the accessibility architecture, + * see http://lxr.mozilla.org/seamonkey/source/accessible/accessible-docs.html + */ + +#ifndef _nsAccessNodeWrap_H_ +#define _nsAccessNodeWrap_H_ + +#include "nsAccessNode.h" + +class nsAccessNodeWrap : public nsAccessNode +{ + public: // construction, destruction + nsAccessNodeWrap(nsIDOMNode *); + virtual ~nsAccessNodeWrap(); +}; + +#endif + diff --git a/mozilla/accessible/src/atk/nsAccessibleWrap.cpp b/mozilla/accessible/src/atk/nsAccessibleWrap.cpp new file mode 100644 index 00000000000..b721d97eb81 --- /dev/null +++ b/mozilla/accessible/src/atk/nsAccessibleWrap.cpp @@ -0,0 +1,55 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 2003 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Original Author: Aaron Leventhal (aaronl@netscape.com) + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +#include "nsAccessibleWrap.h" + +//----------------------------------------------------- +// construction +//----------------------------------------------------- +nsAccessibleWrap::nsAccessibleWrap(nsIDOMNode* aNode, nsIWeakReference *aShell): + nsAccessible(aNode, aShell) +{ +} + +//----------------------------------------------------- +// destruction +//----------------------------------------------------- +nsAccessibleWrap::~nsAccessibleWrap() +{ +} + diff --git a/mozilla/accessible/src/base/nsGenericAccessible.h b/mozilla/accessible/src/atk/nsAccessibleWrap.h similarity index 55% rename from mozilla/accessible/src/base/nsGenericAccessible.h rename to mozilla/accessible/src/atk/nsAccessibleWrap.h index 33f8c406bb5..58540c2bdf6 100644 --- a/mozilla/accessible/src/base/nsGenericAccessible.h +++ b/mozilla/accessible/src/atk/nsAccessibleWrap.h @@ -1,11 +1,11 @@ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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/ + * 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 @@ -14,14 +14,13 @@ * * The Original Code is mozilla.org code. * - * The Initial Developer of the Original Code is + * The Initial Developer of the Original Code is * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 + * Portions created by the Initial Developer are Copyright (C) 2003 * the Initial Developer. All Rights Reserved. * * Contributor(s): - * Author: Eric D Vaughan (evaughan@netscape.com) - * + * Original Author: Aaron Leventhal (aaronl@netscape.com) * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or @@ -29,39 +28,29 @@ * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your + * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#ifndef _nsGenericAccessible_H_ -#define _nsGenericAccessible_H_ - -#include "nsISupports.h" -#include "nsIAccessible.h" -#include "nsIContent.h" -#include "nsIDOMNode.h" -#include "nsIPresShell.h" -#include "nsIPresContext.h" -#include "nsCOMPtr.h" -#include "nsIWeakReference.h" - -/** - * Basic implementation - * supports nothing +/* For documentation of the accessibility architecture, + * see http://lxr.mozilla.org/seamonkey/source/accessible/accessible-docs.html */ -class nsGenericAccessible : public nsIAccessible -{ - NS_DECL_ISUPPORTS - NS_DECL_NSIACCESSIBLE - public: - nsGenericAccessible(); - virtual ~nsGenericAccessible(); +#ifndef _nsAccessibleWrap_H_ +#define _nsAccessibleWrap_H_ + +#include "nsCOMPtr.h" +#include "nsAccessible.h" + +class nsAccessibleWrap : public nsAccessible +{ + public: // construction, destruction + nsAccessibleWrap(nsIDOMNode*, nsIWeakReference *aShell); + virtual ~nsAccessibleWrap(); }; - -#endif +#endif diff --git a/mozilla/accessible/src/atk/nsDocAccessibleWrap.cpp b/mozilla/accessible/src/atk/nsDocAccessibleWrap.cpp new file mode 100644 index 00000000000..c643a7f2e7b --- /dev/null +++ b/mozilla/accessible/src/atk/nsDocAccessibleWrap.cpp @@ -0,0 +1,51 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 2003 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Original Author: Aaron Leventhal (aaronl@netscape.com) + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +#include "nsDocAccessibleWrap.h" + +//----- nsDocAccessibleWrap ----- + +nsDocAccessibleWrap::nsDocAccessibleWrap(nsIDOMNode *aDOMNode, nsIWeakReference *aShell): + nsDocAccessible(aDOMNode, aShell) +{ +} + +nsDocAccessibleWrap::~nsDocAccessibleWrap() +{ +} + diff --git a/mozilla/accessible/src/atk/nsDocAccessibleWrap.h b/mozilla/accessible/src/atk/nsDocAccessibleWrap.h new file mode 100644 index 00000000000..39f09df0ce9 --- /dev/null +++ b/mozilla/accessible/src/atk/nsDocAccessibleWrap.h @@ -0,0 +1,55 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 2003 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Original Author: Aaron Leventhal (aaronl@netscape.com) + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +/* For documentation of the accessibility architecture, + * see http://lxr.mozilla.org/seamonkey/source/accessible/accessible-docs.html + */ + +#ifndef _nsDocAccessibleWrap_H_ +#define _nsDocAccessibleWrap_H_ + +#include "nsDocAccessible.h" + +class nsDocAccessibleWrap: public nsDocAccessible +{ +public: + nsDocAccessibleWrap(nsIDOMNode *aNode, nsIWeakReference *aShell); + virtual ~nsDocAccessibleWrap(); +}; + +#endif diff --git a/mozilla/accessible/src/atk/nsRootAccessibleWrap.cpp b/mozilla/accessible/src/atk/nsRootAccessibleWrap.cpp new file mode 100644 index 00000000000..abf28ddaf91 --- /dev/null +++ b/mozilla/accessible/src/atk/nsRootAccessibleWrap.cpp @@ -0,0 +1,54 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 2003 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Original Author: Aaron Leventhal (aaronl@netscape.com) + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +#include "nsCOMPtr.h" +#include "nsRootAccessibleWrap.h" +#include "nsIServiceManager.h" +#include "nsIAccessibilityService.h" + +//----- nsRootAccessibleWrap ----- + +nsRootAccessibleWrap::nsRootAccessibleWrap(nsIDOMNode *aDOMNode, nsIWeakReference *aShell): + nsRootAccessible(aDOMNode, aShell) +{ +} + +nsRootAccessibleWrap::~nsRootAccessibleWrap() +{ +} + diff --git a/mozilla/accessible/src/atk/nsRootAccessibleWrap.h b/mozilla/accessible/src/atk/nsRootAccessibleWrap.h new file mode 100644 index 00000000000..89942f4e6e9 --- /dev/null +++ b/mozilla/accessible/src/atk/nsRootAccessibleWrap.h @@ -0,0 +1,56 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 2003 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Original Author: Aaron Leventhal (aaronl@netscape.com) + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +/* For documentation of the accessibility architecture, + * see http://lxr.mozilla.org/seamonkey/source/accessible/accessible-docs.html + */ + +#ifndef _nsRootAccessibleWrap_H_ +#define _nsRootAccessibleWrap_H_ + +#include "nsRootAccessible.h" + +class nsRootAccessibleWrap: public nsRootAccessible +{ +public: + nsRootAccessibleWrap(nsIDOMNode *aNode, nsIWeakReference *aShell); + virtual ~nsRootAccessibleWrap(); +}; + + +#endif diff --git a/mozilla/accessible/src/base/Makefile.in b/mozilla/accessible/src/base/Makefile.in index a66a7e596f5..71592c5f383 100644 --- a/mozilla/accessible/src/base/Makefile.in +++ b/mozilla/accessible/src/base/Makefile.in @@ -50,20 +50,23 @@ REQUIRES = content \ $(NULL) CPPSRCS = \ + nsDocAccessible.cpp \ + nsOuterDocAccessible.cpp \ nsAccessibilityService.cpp \ nsAccessible.cpp \ nsBaseWidgetAccessible.cpp \ nsFormControlAccessible.cpp \ - nsGenericAccessible.cpp \ nsHyperTextAccessible.cpp \ nsRootAccessible.cpp \ nsCaretAccessible.cpp \ nsTextAccessible.cpp \ + nsAccessNode.cpp \ $(NULL) EXPORTS = \ nsRootAccessible.h \ nsAccessibleEventData.h \ + nsAccessNode.h \ $(NULL) # we don't want the shared lib, but we want to force the creation of a static lib. diff --git a/mozilla/accessible/src/base/nsAccessibilityService.cpp b/mozilla/accessible/src/base/nsAccessibilityService.cpp index 291293bb3d3..537a9aa9da2 100644 --- a/mozilla/accessible/src/base/nsAccessibilityService.cpp +++ b/mozilla/accessible/src/base/nsAccessibilityService.cpp @@ -41,7 +41,6 @@ // NOTE: alphabetically ordered #include "nsAccessibilityService.h" -#include "nsAccessible.h" #include "nsCOMPtr.h" #include "nsHTMLAreaAccessible.h" #include "nsHTMLFormControlAccessible.h" @@ -84,6 +83,7 @@ #include "nsXULTabAccessible.h" #include "nsXULTextAccessible.h" #include "nsXULTreeAccessible.h" +#include "nsRootAccessibleWrap.h" #include "nsCaretAccessible.h" #include "nsIAccessibleCaret.h" @@ -94,7 +94,8 @@ // IFrame #include "nsIDocShell.h" -#include "nsHTMLIFrameRootAccessible.h" +#include "nsDocAccessible.h" +#include "nsOuterDocAccessible.h" /** * nsAccessibility Service @@ -241,31 +242,7 @@ NS_IMETHODIMP nsAccessibilityService::Shutdown() } NS_IMETHODIMP -nsAccessibilityService::CreateAccessible(nsIDOMNode* aDOMNode, nsISupports* aDocument, nsIAccessible **_retval) -{ - nsCOMPtr document (do_QueryInterface(aDocument)); - if (!document) - return NS_ERROR_FAILURE; - -#ifdef DEBUG - PRInt32 shells = document->GetNumberOfShells(); - NS_ASSERTION(shells > 0,"Error no shells!"); -#endif - - nsCOMPtr tempShell; - document->GetShellAt(0, getter_AddRefs(tempShell)); - nsCOMPtr weakShell = do_GetWeakReference(tempShell); - - *_retval = new nsAccessible(aDOMNode, weakShell); - if (! *_retval) - return NS_ERROR_OUT_OF_MEMORY; - - NS_ADDREF(*_retval); - return NS_OK; -} - -NS_IMETHODIMP -nsAccessibilityService::CreateIFrameAccessible(nsIDOMNode* aDOMNode, nsIAccessible **_retval) +nsAccessibilityService::CreateOuterDocAccessible(nsIDOMNode* aDOMNode, nsIAccessible **_retval) { NS_ENSURE_ARG_POINTER(aDOMNode); @@ -295,8 +272,9 @@ nsAccessibilityService::CreateIFrameAccessible(nsIDOMNode* aDOMNode, nsIAccessib if (NS_SUCCEEDED(content->GetDocument(*getter_AddRefs(doc))) && doc) { nsCOMPtr sub_doc; doc->GetSubDocumentFor(content, getter_AddRefs(sub_doc)); + nsCOMPtr innerNode(do_QueryInterface(sub_doc)); - if (sub_doc) { + if (sub_doc && innerNode) { nsCOMPtr innerPresShell; sub_doc->GetShellAt(0, getter_AddRefs(innerPresShell)); @@ -304,25 +282,26 @@ nsAccessibilityService::CreateIFrameAccessible(nsIDOMNode* aDOMNode, nsIAccessib nsCOMPtr innerWeakShell = do_GetWeakReference(innerPresShell); - // In these variable names, "outer" relates to the nsHTMLIFrameAccessible, - // as opposed to the nsHTMLIFrameRootAccessible which is "inner". + // In these variable names, "outer" relates to the nsOuterDocAccessible + // as opposed to the nsDocAccessibleWrap which is "inner". // The outer node is a or