зеркало из https://github.com/mozilla/gecko-dev.git
bug 1301148 - add custom gecko interface r=aklotz, mshal
This commit is contained in:
Родитель
1cdf6bbf9b
Коммит
2952bb9ab3
|
@ -0,0 +1,23 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
import "objidl.idl";
|
||||
import "oaidl.idl";
|
||||
|
||||
[object, uuid(7510360f-cdae-4de9-88c8-d167eda62afc)]
|
||||
interface IGeckoCustom : IUnknown
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
[
|
||||
uuid(55769d85-f830-4d76-9e39-3670914a28f7),
|
||||
helpstring("private custom gecko interfaces")
|
||||
]
|
||||
library IGeckoCustom
|
||||
{
|
||||
interface IGeckoCustom;
|
||||
};
|
|
@ -0,0 +1,31 @@
|
|||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
GARBAGE += $(MIDL_GENERATED_FILES) done_gen dlldata.c
|
||||
|
||||
MIDL_GENERATED_FILES = \
|
||||
IGeckoCustom.h \
|
||||
IGeckoCustom_p.c \
|
||||
IGeckoCustom_i.c \
|
||||
$(NULL)
|
||||
|
||||
$(MIDL_GENERATED_FILES): done_gen
|
||||
|
||||
done_gen: IGeckoCustom.idl
|
||||
$(MIDL) $(MIDL_FLAGS) -I $(srcdir) -Oicf $(srcdir)/IGeckoCustom.idl
|
||||
touch $@
|
||||
|
||||
export:: done_gen
|
||||
|
||||
midl_exports := \
|
||||
IGeckoCustom.h \
|
||||
IGeckoCustom_i.c \
|
||||
$(NULL)
|
||||
|
||||
INSTALL_TARGETS += midl_exports
|
||||
midl_exports_FILES := $(midl_exports)
|
||||
midl_exports_DEST = $(DIST)/include
|
||||
midl_exports_TARGET := midl
|
||||
|
||||
export:: midl
|
|
@ -0,0 +1,25 @@
|
|||
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
SOURCES += [
|
||||
'!dlldata.c',
|
||||
'!IGeckoCustom_i.c',
|
||||
'!IGeckoCustom_p.c',
|
||||
]
|
||||
|
||||
GENERATED_FILES += [
|
||||
'IGeckoCustom.tlb',
|
||||
]
|
||||
|
||||
FINAL_LIBRARY = 'xul'
|
||||
|
||||
# The Windows MIDL code generator creates things like:
|
||||
#
|
||||
# #endif !_MIDL_USE_GUIDDEF_
|
||||
#
|
||||
# which clang-cl complains about. MSVC doesn't, so turn this warning off.
|
||||
if CONFIG['CLANG_CL']:
|
||||
CFLAGS += ['-Wno-extra-tokens']
|
|
@ -5,7 +5,7 @@
|
|||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows' and CONFIG['COMPILE_ENVIRONMENT']:
|
||||
DIRS += ['msaa', 'ia2']
|
||||
DIRS += ['gecko', 'msaa', 'ia2']
|
||||
|
||||
XPIDL_SOURCES += [
|
||||
'nsIAccessibilityService.idl',
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#include "DocAccessible-inl.h"
|
||||
#include "mozilla/a11y/DocAccessibleParent.h"
|
||||
#include "EnumVariant.h"
|
||||
#include "GeckoCustom.h"
|
||||
#include "nsAccUtils.h"
|
||||
#include "nsCoreUtils.h"
|
||||
#include "nsIAccessibleEvent.h"
|
||||
|
@ -157,6 +158,12 @@ AccessibleWrap::QueryInterface(REFIID iid, void** ppv)
|
|||
return hr;
|
||||
}
|
||||
|
||||
if (!*ppv && iid == IID_IGeckoCustom) {
|
||||
RefPtr<GeckoCustom> gkCrap = new GeckoCustom(this);
|
||||
gkCrap.forget(ppv);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
if (nullptr == *ppv)
|
||||
return E_NOINTERFACE;
|
||||
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "GeckoCustom.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::a11y;
|
||||
|
||||
IMPL_IUNKNOWN_QUERY_HEAD(GeckoCustom)
|
||||
IMPL_IUNKNOWN_QUERY_IFACE(IGeckoCustom)
|
||||
IMPL_IUNKNOWN_QUERY_TAIL_AGGREGATED(mAcc)
|
|
@ -0,0 +1,45 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#ifndef mozilla_a11y_GeckoCustom_h_
|
||||
#define mozilla_a11y_GeckoCustom_h_
|
||||
|
||||
#include "AccessibleWrap.h"
|
||||
#include "IUnknownImpl.h"
|
||||
#include "IGeckoCustom.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace a11y {
|
||||
|
||||
/**
|
||||
* a dumpster to put things exposed by the xpcom API but not a windows platform
|
||||
* API for the purposes of testing.
|
||||
*/
|
||||
class GeckoCustom final : public IGeckoCustom
|
||||
{
|
||||
public:
|
||||
explicit GeckoCustom(AccessibleWrap* aAcc) : mAcc(aAcc) {}
|
||||
|
||||
// IUnknown
|
||||
DECL_IUNKNOWN
|
||||
|
||||
private:
|
||||
GeckoCustom() = delete;
|
||||
GeckoCustom& operator =(const GeckoCustom&) = delete;
|
||||
GeckoCustom(const GeckoCustom&) = delete;
|
||||
GeckoCustom(GeckoCustom&&) = delete;
|
||||
GeckoCustom& operator=(GeckoCustom&&) = delete;
|
||||
|
||||
~GeckoCustom() { }
|
||||
|
||||
protected:
|
||||
RefPtr<AccessibleWrap> mAcc;
|
||||
};
|
||||
|
||||
} // a11y namespace
|
||||
} // mozilla namespace
|
||||
|
||||
#endif
|
|
@ -23,6 +23,7 @@ UNIFIED_SOURCES += [
|
|||
'Compatibility.cpp',
|
||||
'DocAccessibleWrap.cpp',
|
||||
'EnumVariant.cpp',
|
||||
'GeckoCustom.cpp',
|
||||
'HTMLTableAccessibleWrap.cpp',
|
||||
'HTMLWin32ObjectAccessible.cpp',
|
||||
'HyperTextAccessibleWrap.cpp',
|
||||
|
|
|
@ -47,6 +47,9 @@ def Libxul(name):
|
|||
'api-ms-win-core-winrt-string-l1-1-0.dll',
|
||||
]
|
||||
|
||||
if CONFIG['OS_ARCH'] == 'WINNT' and CONFIG['ACCESSIBILITY']:
|
||||
LOCAL_INCLUDES += ['!/accessible/interfaces/gecko/']
|
||||
|
||||
if CONFIG['OS_ARCH'] == 'WINNT' and not CONFIG['GNU_CC']:
|
||||
LOCAL_INCLUDES += [
|
||||
'/widget/windows',
|
||||
|
|
|
@ -3,3 +3,6 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "widget.rc"
|
||||
#ifdef ACCESSIBILITY
|
||||
1 typelib IGeckoCustom.tlb
|
||||
#endif
|
||||
|
|
Загрузка…
Ссылка в новой задаче