|
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/. */ |
|
5 |
|
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 |
|
20 |
|
21 NS_GENERIC_FACTORY_CONSTRUCTOR(nsThebesFontEnumerator) |
|
22 |
|
23 static nsresult |
|
24 nsScriptableRegionConstructor(nsISupports *aOuter, REFNSIID aIID, void **aResult) |
|
25 { |
|
26 if (!aResult) { |
|
27 return NS_ERROR_NULL_POINTER; |
|
28 } |
|
29 *aResult = nullptr; |
|
30 if (aOuter) { |
|
31 return NS_ERROR_NO_AGGREGATION; |
|
32 } |
|
33 |
|
34 nsCOMPtr<nsIScriptableRegion> scriptableRgn = new nsScriptableRegion(); |
|
35 return scriptableRgn->QueryInterface(aIID, aResult); |
|
36 } |
|
37 |
|
38 NS_DEFINE_NAMED_CID(NS_FONT_ENUMERATOR_CID); |
|
39 NS_DEFINE_NAMED_CID(NS_SCRIPTABLE_REGION_CID); |
|
40 |
|
41 static const mozilla::Module::CIDEntry kThebesCIDs[] = { |
|
42 { &kNS_FONT_ENUMERATOR_CID, false, nullptr, nsThebesFontEnumeratorConstructor }, |
|
43 { &kNS_SCRIPTABLE_REGION_CID, false, nullptr, nsScriptableRegionConstructor }, |
|
44 { nullptr } |
|
45 }; |
|
46 |
|
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 }, |
|
50 { nullptr } |
|
51 }; |
|
52 |
|
53 static const mozilla::Module kThebesModule = { |
|
54 mozilla::Module::kVersion, |
|
55 kThebesCIDs, |
|
56 kThebesContracts, |
|
57 nullptr, |
|
58 nullptr, |
|
59 nullptr, |
|
60 nullptr |
|
61 }; |
|
62 |
|
63 NSMODULE_DEFN(nsGfxModule) = &kThebesModule; |