Line data Source code
1 : /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 : /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 : /* This Source Code Form is subject to the terms of the Mozilla Public
4 : * License, v. 2.0. If a copy of the MPL was not distributed with this
5 : * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 :
7 : #include "HeadlessLookAndFeel.h"
8 :
9 : using mozilla::LookAndFeel;
10 :
11 : namespace mozilla {
12 : namespace widget {
13 :
14 : static const char16_t UNICODE_BULLET = 0x2022;
15 :
16 0 : HeadlessLookAndFeel::HeadlessLookAndFeel()
17 : {
18 0 : }
19 :
20 0 : HeadlessLookAndFeel::~HeadlessLookAndFeel()
21 : {
22 0 : }
23 :
24 : nsresult
25 0 : HeadlessLookAndFeel::NativeGetColor(ColorID aID, nscolor& aColor)
26 : {
27 : // Default all colors to black.
28 0 : aColor = NS_RGB(0x00, 0x00, 0x00);
29 0 : return NS_OK;
30 : }
31 :
32 : nsresult
33 0 : HeadlessLookAndFeel::GetIntImpl(IntID aID, int32_t &aResult)
34 : {
35 0 : nsresult res = nsXPLookAndFeel::GetIntImpl(aID, aResult);
36 0 : if (NS_SUCCEEDED(res)) {
37 0 : return res;
38 : }
39 0 : aResult = 0;
40 0 : return NS_ERROR_FAILURE;
41 : }
42 :
43 : nsresult
44 0 : HeadlessLookAndFeel::GetFloatImpl(FloatID aID, float &aResult)
45 : {
46 0 : nsresult res = NS_OK;
47 0 : res = nsXPLookAndFeel::GetFloatImpl(aID, aResult);
48 0 : if (NS_SUCCEEDED(res)) {
49 0 : return res;
50 : }
51 0 : aResult = -1.0;
52 0 : return NS_ERROR_FAILURE;
53 : }
54 :
55 : bool
56 0 : HeadlessLookAndFeel::GetFontImpl(FontID aID, nsString& aFontName,
57 : gfxFontStyle& aFontStyle,
58 : float aDevPixPerCSSPixel)
59 : {
60 0 : return true;
61 : }
62 :
63 : char16_t
64 0 : HeadlessLookAndFeel::GetPasswordCharacterImpl()
65 : {
66 0 : return UNICODE_BULLET;
67 : }
68 :
69 : void
70 0 : HeadlessLookAndFeel::RefreshImpl()
71 : {
72 0 : nsXPLookAndFeel::RefreshImpl();
73 0 : }
74 :
75 : bool
76 0 : HeadlessLookAndFeel::GetEchoPasswordImpl() {
77 0 : return false;
78 : }
79 :
80 : } // namespace widget
81 : } // namespace mozilla
|