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 #ifndef FB_DEVICE_H
17 #define FB_DEVICE_H
18 #include <memory>
19 #include <unordered_map>
20 #include "hdi_device_common.h"
21 #include "hdi_device_interface.h"
22 #include "hdi_display.h"
23 #include "fb_display.h"
24 #include "display_module_loader.h"
25 namespace OHOS {
26 namespace HDI {
27 namespace DISPLAY {
28 class FbDevice : public HdiDeviceInterface {
29 public:
30     static std::shared_ptr<HdiDeviceInterface> Create();
31     explicit FbDevice(int fd);
32     virtual ~FbDevice() override;
33     virtual int32_t Init() override;
34     virtual void DeInit() override;
35     std::unordered_map<uint32_t, std::shared_ptr<HdiDisplay>> DiscoveryDisplay() override;
36 
37 private:
38     IdMapPtr<HdiDisplay> displays_;
39     int deviceFd_ = -1;
40 };
41 } // namespace DISPLAY
42 } // namespace HDI
43 } // namespace OHOS
44 
45 #endif // FB_DEVICE_H