michael@0: /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "gfxPlatform.h" // for gfxPlatform michael@0: #include "mozilla/Assertions.h" // for MOZ_ASSERT_HELPER2 michael@0: #include "mozilla/Attributes.h" // for MOZ_FINAL michael@0: #include "mozilla/Module.h" // for Module, Module::CIDEntry, etc michael@0: #include "mozilla/ModuleUtils.h" michael@0: #include "mozilla/mozalloc.h" // for operator new michael@0: #include "nsCOMPtr.h" // for nsCOMPtr michael@0: #include "nsError.h" // for NS_ERROR_NO_AGGREGATION, etc michael@0: #include "nsGfxCIID.h" // for NS_FONT_ENUMERATOR_CID, etc michael@0: #include "nsID.h" // for NS_DEFINE_NAMED_CID, etc michael@0: #include "nsIScriptableRegion.h" // for nsIScriptableRegion michael@0: #include "nsISupports.h" // for NS_DECL_ISUPPORTS, etc michael@0: #include "nsScriptableRegion.h" // for nsScriptableRegion michael@0: #include "nsThebesFontEnumerator.h" // for nsThebesFontEnumerator michael@0: michael@0: NS_GENERIC_FACTORY_CONSTRUCTOR(nsThebesFontEnumerator) michael@0: michael@0: static nsresult michael@0: nsScriptableRegionConstructor(nsISupports *aOuter, REFNSIID aIID, void **aResult) michael@0: { michael@0: if (!aResult) { michael@0: return NS_ERROR_NULL_POINTER; michael@0: } michael@0: *aResult = nullptr; michael@0: if (aOuter) { michael@0: return NS_ERROR_NO_AGGREGATION; michael@0: } michael@0: michael@0: nsCOMPtr scriptableRgn = new nsScriptableRegion(); michael@0: return scriptableRgn->QueryInterface(aIID, aResult); michael@0: } michael@0: michael@0: NS_DEFINE_NAMED_CID(NS_FONT_ENUMERATOR_CID); michael@0: NS_DEFINE_NAMED_CID(NS_SCRIPTABLE_REGION_CID); michael@0: michael@0: static const mozilla::Module::CIDEntry kThebesCIDs[] = { michael@0: { &kNS_FONT_ENUMERATOR_CID, false, nullptr, nsThebesFontEnumeratorConstructor }, michael@0: { &kNS_SCRIPTABLE_REGION_CID, false, nullptr, nsScriptableRegionConstructor }, michael@0: { nullptr } michael@0: }; michael@0: michael@0: static const mozilla::Module::ContractIDEntry kThebesContracts[] = { michael@0: { "@mozilla.org/gfx/fontenumerator;1", &kNS_FONT_ENUMERATOR_CID }, michael@0: { "@mozilla.org/gfx/region;1", &kNS_SCRIPTABLE_REGION_CID }, michael@0: { nullptr } michael@0: }; michael@0: michael@0: static const mozilla::Module kThebesModule = { michael@0: mozilla::Module::kVersion, michael@0: kThebesCIDs, michael@0: kThebesContracts, michael@0: nullptr, michael@0: nullptr, michael@0: nullptr, michael@0: nullptr michael@0: }; michael@0: michael@0: NSMODULE_DEFN(nsGfxModule) = &kThebesModule;