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 GRAPHIC_LITE_LITE_WM_TYPE_H
17 #define GRAPHIC_LITE_LITE_WM_TYPE_H
18 
19 #include "gfx_utils/geometry2d.h"
20 #include "gfx_utils/pixel_format_utils.h"
21 
22 namespace OHOS {
23 struct LiteWinConfig {
24     enum CompositeMode {
25         COPY,
26         BLEND
27     };
28     Rect rect;
29     uint8_t opacity;
30     ImagePixelFormat pixelFormat;
31     CompositeMode compositeMode;
32     bool isModal;
33 };
34 
35 struct LiteSurfaceData {
36     ImagePixelFormat pixelFormat;
37     uint16_t width;
38     uint16_t height;
39     uint8_t* virAddr;
40     uint8_t* phyAddr;
41     uint32_t stride;
42     uint8_t bytePerPixel;
43 };
44 
45 struct LiteLayerInfo {
46     ImagePixelFormat pixelFormat;
47     uint16_t width;
48     uint16_t height;
49 };
50 
51 typedef enum {
52     LiteWMS_GetSurface,
53     LiteWMS_Show,
54     LiteWMS_Hide,
55     LiteWMS_RaiseToTop,
56     LiteWMS_LowerToBottom,
57     LiteWMS_MoveTo,
58     LiteWMS_Resize,
59     LiteWMS_Update,
60     LiteWMS_CreateWindow,
61     LiteWMS_RemoveWindow,
62     LiteWMS_GetEventData,
63     LiteWMS_Screenshot,
64     LiteWMS_ClientRegister,
65     LiteWMS_GetLayerInfo
66 } LiteWMSCall;
67 
68 typedef enum {
69     LiteWMS_EOK = 0,
70     LiteWMS_EUNKNOWN
71 } LiteWMSErrorCode;
72 
73 struct CallBackPara {
74     int funcId;
75     void* data;
76 };
77 
78 #ifdef LAYER_PF_ARGB1555
79 typedef uint16_t LayerColorType;
80 #elif defined LAYER_PF_ARGB8888
81 typedef uint32_t LayerColorType;
82 #endif
83 
84 const char SERVICE_NAME[] = "WMS";
85 const int INVALID_WINDOW_ID = -1;
86 const int INVALID_PID = -1;
87 }
88 #endif
89