1 /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include "gfxPlatform.h" // for gfxPlatform
7 #include "mozilla/Assertions.h" // for MOZ_ASSERT_HELPER2
8 #include "mozilla/Attributes.h" // for MOZ_FINAL
9 #include "mozilla/Module.h" // for Module, Module::CIDEntry, etc
10 #include "mozilla/ModuleUtils.h"
11 #include "mozilla/mozalloc.h" // for operator new
12 #include "nsCOMPtr.h" // for nsCOMPtr
13 #include "nsError.h" // for NS_ERROR_NO_AGGREGATION, etc
14 #include "nsGfxCIID.h" // for NS_FONT_ENUMERATOR_CID, etc
15 #include "nsID.h" // for NS_DEFINE_NAMED_CID, etc
16 #include "nsIScriptableRegion.h" // for nsIScriptableRegion
17 #include "nsISupports.h" // for NS_DECL_ISUPPORTS, etc
18 #include "nsScriptableRegion.h" // for nsScriptableRegion
19 #include "nsThebesFontEnumerator.h" // for nsThebesFontEnumerator
21 NS_GENERIC_FACTORY_CONSTRUCTOR(nsThebesFontEnumerator
)
24 nsScriptableRegionConstructor(nsISupports
*aOuter
, REFNSIID aIID
, void **aResult
)
27 return NS_ERROR_NULL_POINTER
;
31 return NS_ERROR_NO_AGGREGATION
;
34 nsCOMPtr
<nsIScriptableRegion
> scriptableRgn
= new nsScriptableRegion();
35 return scriptableRgn
->QueryInterface(aIID
, aResult
);
38 NS_DEFINE_NAMED_CID(NS_FONT_ENUMERATOR_CID
);
39 NS_DEFINE_NAMED_CID(NS_SCRIPTABLE_REGION_CID
);
41 static const mozilla::Module::CIDEntry kThebesCIDs
[] = {
42 { &kNS_FONT_ENUMERATOR_CID
, false, nullptr, nsThebesFontEnumeratorConstructor
},
43 { &kNS_SCRIPTABLE_REGION_CID
, false, nullptr, nsScriptableRegionConstructor
},
47 static const mozilla::Module::ContractIDEntry kThebesContracts
[] = {
48 { "@mozilla.org/gfx/fontenumerator;1", &kNS_FONT_ENUMERATOR_CID
},
49 { "@mozilla.org/gfx/region;1", &kNS_SCRIPTABLE_REGION_CID
},
53 static const mozilla::Module kThebesModule
= {
54 mozilla::Module::kVersion
,
63 NSMODULE_DEFN(nsGfxModule
) = &kThebesModule
;