• 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     if (componentCallback_ != nullptr) {
37         componentCallback_->OnBackPress();
38         WLOGI("called");
39     }
40 }
41 
OnKeyEvent(const std::shared_ptr<MMI::KeyEvent> & keyEvent)42 void WindowExtensionClientStubImpl::OnKeyEvent(const std::shared_ptr<MMI::KeyEvent>& keyEvent)
43 {
44     if (componentCallback_ != nullptr) {
45         componentCallback_->OnKeyEvent(keyEvent);
46         WLOGI("called");
47     }
48 }
49 
OnPointerEvent(const std::shared_ptr<MMI::PointerEvent> & pointerEvent)50 void WindowExtensionClientStubImpl::OnPointerEvent(const std::shared_ptr<MMI::PointerEvent>& pointerEvent)
51 {
52     if (componentCallback_ != nullptr) {
53         componentCallback_->OnPointerEvent(pointerEvent);
54         WLOGI("called");
55     }
56 }
57 } // namespace Rosen
58 } // namespace OHOS