• 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 #ifndef OHOS_HDI_DISPLAY_LAYER_V1_0_INTERFACE_PROXY_H
17 #define OHOS_HDI_DISPLAY_LAYER_V1_0_INTERFACE_PROXY_H
18 
19 #include <iremote_proxy.h>
20 #include "idisplay_layer.h"
21 
22 namespace OHOS {
23 namespace HDI {
24 namespace Display {
25 namespace V1_0 {
26 
27 class DisplayLayerProxy : public IRemoteProxy<IDisplayLayer> {
28 public:
DisplayLayerProxy(const sptr<IRemoteObject> & impl)29     explicit DisplayLayerProxy(const sptr<IRemoteObject>& impl) : IRemoteProxy<IDisplayLayer>(impl) {}
~DisplayLayerProxy()30     virtual ~DisplayLayerProxy() {}
31 
32     virtual DispErrCode InitDisplay(unsigned int devId) override;
33     virtual DispErrCode DeinitDisplay(unsigned int devId) override;
34     virtual DispErrCode GetDisplayInfo(unsigned int devId, std::shared_ptr<DisplayInfo> &dispInfo) override;
35     virtual DispErrCode CreateLayer(unsigned int devId, LayerInfo &layerInfo, unsigned int &layerId) override;
36     virtual DispErrCode CloseLayer(unsigned int devId, unsigned int layerId) override;
37     virtual DispErrCode SetLayerVisible(unsigned int devId, unsigned int layerId, bool visible) override;
38     virtual DispErrCode GetLayerVisibleState(unsigned int devId, unsigned int layerId, bool &visible) override;
39     virtual DispErrCode SetLayerRect(unsigned int devId, unsigned int layerId, IRect &rect) override;
40     virtual DispErrCode GetLayerRect(unsigned int devId, unsigned int layerId, std::shared_ptr<IRect> &rect) override;
41     virtual DispErrCode SetLayerZorder(unsigned int devId, unsigned int layerId, unsigned int zorder) override;
42     virtual DispErrCode GetLayerZorder(unsigned int devId, unsigned int layerId, unsigned int &zorder) override;
43     virtual DispErrCode SetTransformMode(unsigned int devId, unsigned int layerId, TransformType &type) override;
44     virtual DispErrCode SetLayerBuffer(unsigned int devId, unsigned int layerId, const BufferHandle &buffer,
45         int fence) override;
46 
47 private:
48     static constexpr int  CMD_DISPLAY_LAYER_REMOTE_INIT_DISPLAY = 0;
49     static constexpr int  CMD_DISPLAY_LAYER_REMOTE_DEINIT_DISPLAY = 1;
50     static constexpr int  CMD_DISPLAY_LAYER_REMOTE_GET_DISPLAY_INFO = 2;
51     static constexpr int  CMD_DISPLAY_LAYER_REMOTE_CREATE_LAYER = 3;
52     static constexpr int  CMD_DISPLAY_LAYER_REMOTE_CLOSE_LAYER = 4;
53     static constexpr int  CMD_DISPLAY_LAYER_REMOTE_SET_LAYER_VISIBLE = 5;
54     static constexpr int  CMD_DISPLAY_LAYER_REMOTE_GET_LAYER_VISIBLE_STATE = 6;
55     static constexpr int  CMD_DISPLAY_LAYER_REMOTE_SET_LAYER_RECT = 7;
56     static constexpr int  CMD_DISPLAY_LAYER_REMOTE_GET_LAYER_RECT = 8;
57     static constexpr int  CMD_DISPLAY_LAYER_REMOTE_SET_LAYER_ZORDER = 9;
58     static constexpr int  CMD_DISPLAY_LAYER_REMOTE_GET_LAYER_ZORDER = 10;
59     static constexpr int  CMD_DISPLAY_LAYER_REMOTE_SET_TRANSFORM_MODE = 11;
60     static constexpr int  CMD_DISPLAY_LAYER_REMOTE_SET_LAYER_BUFFER = 12;
61 
62     static inline BrokerDelegator<DisplayLayerProxy> delegator_;
63 };
64 
65 } // namespace V1_0
66 } // namespace Display
67 } // namespace HDI
68 } // namespace OHOS
69 
70 #endif // OHOS_HDI_DISPLAY_LAYER_V1_0_INTERFACE_PROXY_H
71