• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 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_extension_client_stub_impl.h"
17 
18 #include "window_manager_hilog.h"
19 
20 namespace OHOS {
21 namespace Rosen {
22 namespace {
23 constexpr HiviewDFX::HiLogLabel LABEL = {LOG_CORE, HILOG_DOMAIN_WINDOW, "WindowExtensionClientStubImpl"};
24 }
25 
OnWindowReady(const std::shared_ptr<RSSurfaceNode> & surfaceNode)26 void WindowExtensionClientStubImpl::OnWindowReady(const std::shared_ptr<RSSurfaceNode>& surfaceNode)
27 {
28     if (componentCallback_ != nullptr) {
29         componentCallback_->OnWindowReady(surfaceNode);
30         WLOGI("called");
31     }
32 }
33 
OnBackPress()34 void WindowExtensionClientStubImpl::OnBackPress()
35 {
36     // LCOV_EXCL_START
37     if (componentCallback_ != nullptr) {
38         componentCallback_->OnBackPress();
39         WLOGI("called");
40     }
41     // LCOV_EXCL_STOP
42 }
43 
OnKeyEvent(const std::shared_ptr<MMI::KeyEvent> & keyEvent)44 void WindowExtensionClientStubImpl::OnKeyEvent(const std::shared_ptr<MMI::KeyEvent>& keyEvent)
45 {
46     // LCOV_EXCL_START
47     if (componentCallback_ != nullptr) {
48         componentCallback_->OnKeyEvent(keyEvent);
49         WLOGI("called");
50     }
51     // LCOV_EXCL_STOP
52 }
53 
OnPointerEvent(const std::shared_ptr<MMI::PointerEvent> & pointerEvent)54 void WindowExtensionClientStubImpl::OnPointerEvent(const std::shared_ptr<MMI::PointerEvent>& pointerEvent)
55 {
56     // LCOV_EXCL_START
57     if (componentCallback_ != nullptr) {
58         componentCallback_->OnPointerEvent(pointerEvent);
59         WLOGI("called");
60     }
61     // LCOV_EXCL_STOP
62 }
63 } // namespace Rosen
64 } // namespace OHOS