|
1 /* -*- Mode: C++; tab-width: 40; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
|
2 /* Copyright 2012 Mozilla Foundation and Mozilla contributors |
|
3 * |
|
4 * Licensed under the Apache License, Version 2.0 (the "License"); |
|
5 * you may not use this file except in compliance with the License. |
|
6 * You may obtain a copy of the License at |
|
7 * |
|
8 * http://www.apache.org/licenses/LICENSE-2.0 |
|
9 * |
|
10 * Unless required by applicable law or agreed to in writing, software |
|
11 * distributed under the License is distributed on an "AS IS" BASIS, |
|
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
13 * See the License for the specific language governing permissions and |
|
14 * limitations under the License. |
|
15 */ |
|
16 |
|
17 #ifndef nsScreenManagerGonk_h___ |
|
18 #define nsScreenManagerGonk_h___ |
|
19 |
|
20 #include "mozilla/Hal.h" |
|
21 #include "nsCOMPtr.h" |
|
22 |
|
23 #include "nsBaseScreen.h" |
|
24 #include "nsIScreenManager.h" |
|
25 |
|
26 class nsScreenGonk : public nsBaseScreen |
|
27 { |
|
28 typedef mozilla::hal::ScreenConfiguration ScreenConfiguration; |
|
29 |
|
30 public: |
|
31 nsScreenGonk(void* nativeScreen); |
|
32 ~nsScreenGonk(); |
|
33 |
|
34 NS_IMETHOD GetRect(int32_t* aLeft, int32_t* aTop, int32_t* aWidth, int32_t* aHeight); |
|
35 NS_IMETHOD GetAvailRect(int32_t* aLeft, int32_t* aTop, int32_t* aWidth, int32_t* aHeight); |
|
36 NS_IMETHOD GetPixelDepth(int32_t* aPixelDepth); |
|
37 NS_IMETHOD GetColorDepth(int32_t* aColorDepth); |
|
38 NS_IMETHOD GetRotation(uint32_t* aRotation); |
|
39 NS_IMETHOD SetRotation(uint32_t aRotation); |
|
40 |
|
41 static uint32_t GetRotation(); |
|
42 static ScreenConfiguration GetConfiguration(); |
|
43 }; |
|
44 |
|
45 class nsScreenManagerGonk MOZ_FINAL : public nsIScreenManager |
|
46 { |
|
47 public: |
|
48 nsScreenManagerGonk(); |
|
49 ~nsScreenManagerGonk(); |
|
50 |
|
51 NS_DECL_ISUPPORTS |
|
52 NS_DECL_NSISCREENMANAGER |
|
53 |
|
54 protected: |
|
55 nsCOMPtr<nsIScreen> mOneScreen; |
|
56 }; |
|
57 |
|
58 #endif /* nsScreenManagerGonk_h___ */ |