1 /*
2  * Copyright (c) 2021-2022 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 "window_manager_agent.h"
17 #include "foundation/window/window_manager/interfaces/innerkits/wm/window_manager.h"
18 #include "singleton_container.h"
19 #include "wm_common.h"
20 
21 namespace OHOS {
22 namespace Rosen {
UpdateFocusChangeInfo(const sptr<FocusChangeInfo> & focusChangeInfo,bool focused)23 void WindowManagerAgent::UpdateFocusChangeInfo(const sptr<FocusChangeInfo>& focusChangeInfo, bool focused)
24 {
25     SingletonContainer::Get<WindowManager>().UpdateFocusChangeInfo(focusChangeInfo, focused);
26 }
27 
UpdateWindowModeTypeInfo(WindowModeType type)28 void WindowManagerAgent::UpdateWindowModeTypeInfo(WindowModeType type)
29 {
30     SingletonContainer::Get<WindowManager>().UpdateWindowModeTypeInfo(type);
31 }
32 
UpdateSystemBarRegionTints(DisplayId displayId,const SystemBarRegionTints & tints)33 void WindowManagerAgent::UpdateSystemBarRegionTints(DisplayId displayId, const SystemBarRegionTints& tints)
34 {
35     SingletonContainer::Get<WindowManager>().UpdateSystemBarRegionTints(displayId, tints);
36 }
37 
NotifyAccessibilityWindowInfo(const std::vector<sptr<AccessibilityWindowInfo>> & infos,WindowUpdateType type)38 void WindowManagerAgent::NotifyAccessibilityWindowInfo(const std::vector<sptr<AccessibilityWindowInfo>>& infos,
39     WindowUpdateType type)
40 {
41     SingletonContainer::Get<WindowManager>().NotifyAccessibilityWindowInfo(infos, type);
42 }
43 
UpdateWindowVisibilityInfo(const std::vector<sptr<WindowVisibilityInfo>> & visibilityInfos)44 void WindowManagerAgent::UpdateWindowVisibilityInfo(const std::vector<sptr<WindowVisibilityInfo>>& visibilityInfos)
45 {
46     SingletonContainer::Get<WindowManager>().UpdateWindowVisibilityInfo(visibilityInfos);
47 }
48 
UpdateWindowDrawingContentInfo(const std::vector<sptr<WindowDrawingContentInfo>> & windowDrawingContentInfos)49 void WindowManagerAgent::UpdateWindowDrawingContentInfo(
50     const std::vector<sptr<WindowDrawingContentInfo>>& windowDrawingContentInfos)
51 {
52     SingletonContainer::Get<WindowManager>().UpdateWindowDrawingContentInfo(windowDrawingContentInfos);
53 }
54 
UpdateCameraFloatWindowStatus(uint32_t accessTokenId,bool isShowing)55 void WindowManagerAgent::UpdateCameraFloatWindowStatus(uint32_t accessTokenId, bool isShowing)
56 {
57     SingletonContainer::Get<WindowManager>().UpdateCameraFloatWindowStatus(accessTokenId, isShowing);
58 }
59 
NotifyWaterMarkFlagChangedResult(bool showWaterMark)60 void WindowManagerAgent::NotifyWaterMarkFlagChangedResult(bool showWaterMark)
61 {
62     SingletonContainer::Get<WindowManager>().NotifyWaterMarkFlagChangedResult(showWaterMark);
63 }
64 
UpdateVisibleWindowNum(const std::vector<VisibleWindowNumInfo> & visibleWindowNumInfo)65 void WindowManagerAgent::UpdateVisibleWindowNum(
66     const std::vector<VisibleWindowNumInfo>& visibleWindowNumInfo)
67 {
68     SingletonContainer::Get<WindowManager>().UpdateVisibleWindowNum(visibleWindowNumInfo);
69 }
70 
NotifyGestureNavigationEnabledResult(bool enable)71 void WindowManagerAgent::NotifyGestureNavigationEnabledResult(bool enable)
72 {
73     SingletonContainer::Get<WindowManager>().NotifyGestureNavigationEnabledResult(enable);
74 }
75 
NotifyWindowStyleChange(WindowStyleType type)76 void WindowManagerAgent::NotifyWindowStyleChange(WindowStyleType type)
77 {
78     SingletonContainer::Get<WindowManager>().NotifyWindowStyleChange(type);
79 }
80 
81 } // namespace Rosen
82 } // namespace OHOS
83