• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2020-2021 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #include "lite_proxy_windows_manager.h"
17 
18 #include "gfx_utils/color.h"
19 #include "gfx_utils/graphic_log.h"
20 #include "lite_wm_requestor.h"
21 #include "lite_wms_client.h"
22 
23 namespace OHOS {
Init()24 int LiteProxyWindowsManager::Init()
25 {
26     GRAPHIC_LOGI("Init");
27     LiteWMSClient::GetInstance()->InitLiteWMSClient();
28     LiteWMRequestor::GetInstance()->ClientRegister();
29     LiteWMRequestor::GetInstance()->GetLayerInfo();
30     return 0;
31 }
32 
CreateWindow(const LiteWinConfig & config)33 IWindow* LiteProxyWindowsManager::CreateWindow(const LiteWinConfig& config)
34 {
35     LiteWinRequestor* requstor = LiteWMRequestor::GetInstance()->CreateWindow(config);
36     if (requstor == nullptr) {
37         return nullptr;
38     } else {
39         return new LiteProxyWindow(requstor);
40     }
41 }
42 
RemoveWindow(IWindow * win)43 void LiteProxyWindowsManager::RemoveWindow(IWindow* win)
44 {
45     if (win != nullptr) {
46         int32_t id = win->GetWindowId();
47         delete win;
48         LiteWMRequestor::GetInstance()->RemoveWindow(id);
49     }
50 }
51 
GetEventData(DeviceData * data)52 void LiteProxyWindowsManager::GetEventData(DeviceData* data)
53 {
54     LiteWMRequestor::GetInstance()->GetEventData(data);
55 }
56 
Screenshot()57 void LiteProxyWindowsManager::Screenshot()
58 {
59     LiteWMRequestor::GetInstance()->Screenshot();
60 }
61 
SetScreenshotListener(ScreenshotListener * listener)62 void LiteProxyWindowsManager::SetScreenshotListener(ScreenshotListener* listener)
63 {
64     LiteWMRequestor::GetInstance()->SetScreenshotListener(listener);
65 }
66 } // namespace OHOS