1 /* 2 * Copyright (c) 2022 HiSilicon (Shanghai) Technologies CO., LIMITED. 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 HI_GO_WINC_H 17 #define HI_GO_WINC_H 18 19 #include "hi_type.h" 20 #include "hi_go_comm.h" 21 #include "hi_go_surface.h" 22 23 #ifdef __cplusplus 24 #if __cplusplus 25 extern "C" { 26 #endif /* __cplusplus */ 27 #endif /* __cplusplus */ 28 29 /** \addtogroup HIGO_WINC */ 30 /** @{ */ /** <![HIGO_WINC] */ 31 32 /* Number of buffers used by the window. */ 33 typedef enum { 34 HIGO_BUFFER_SINGLE = 0, /* The window uses a buffer. */ 35 HIGO_BUFFER_DOUBLE, /* The window uses dual buffers. */ 36 HIGO_BUFFER_BUTT 37 } HIGO_BUFFERTYPE_E; 38 39 /* Maximum number of window layers. */ 40 #define HIGO_WINTREE_NUM 17 41 42 typedef struct { 43 HI_HANDLE hLayer; /* Graphics layer on which a window is displayed. */ 44 HI_RECT rect; /* Window range. */ 45 HI_U32 LayerNum; /* Display level of a window, ranging from 0 to 15. The greater the number, 46 * the upper the position of the window. 47 * 48 */ 49 HIGO_PF_E PixelFormat; /* Pixel format of a window. */ 50 HIGO_BUFFERTYPE_E BufferType; /* 51 * Number of surface buffers required by a window. 52 * 53 */ 54 HI_BOOL bPubPallette; /* Window surface use single Palette or not. 55 * 56 * ֻеڵڴģʽΪڴʱñ־Ч 57 */ 58 } HIGO_WNDINFO_S; 59 /** @} */ /*! <!-- Structure Definition end */ 60 typedef enum { 61 HIGO_WNDMEM_SHARED = 0, /* All windows share memory. */ 62 HIGO_WNDMEM_SEP, /* Window uses it's own memory. */ 63 HIGO_WNDMEM_BUTT, 64 } HIGO_WNDMEM_E; 65 66 typedef struct { 67 HI_HANDLE hWindow; 68 HI_REGION InvRgn; 69 } HIGO_INVRGN_S; 70 71 HI_S32 HI_GO_CreateWindowEx(const HIGO_WNDINFO_S *pInfo, HI_HANDLE *pWindow); 72 73 HI_S32 HI_GO_CreateWindow(HI_HANDLE hLayer, const HI_RECT *pRect, HI_U32 LayerNum, 74 HI_BOOL bHasPixelAlpha, HI_HANDLE *pWindow, HIGO_BUFFERTYPE_E eBufferType); 75 76 HI_S32 HI_GO_DestroyWindow(HI_HANDLE Window); 77 78 HI_S32 HI_GO_GetWindowRect(HI_HANDLE Window, HI_RECT *pRect); 79 80 HI_S32 HI_GO_SetWindowPos(HI_HANDLE Window, HI_S32 StartX, HI_S32 StartY); 81 82 HI_S32 HI_GO_ResizeWindow(HI_HANDLE Window, HI_S32 Width, HI_S32 Height); 83 84 HI_S32 HI_GO_GetWindowZOrder(HI_HANDLE Window, HI_U32 *pZOrder); 85 86 HI_S32 HI_GO_ChangeWindowZOrder(HI_HANDLE Window, HIGO_ZORDER_E EnType); 87 88 HI_S32 HI_GO_GetWindowOpacity(HI_HANDLE Window, HI_U8 *pOpacity); 89 90 HI_S32 HI_GO_SetWindowOpacity(HI_HANDLE Window, HI_U8 Opacity); 91 92 HI_S32 HI_GO_SetWindowColorkey(HI_HANDLE Window, HI_COLOR ColorKey); 93 94 HI_S32 HI_GO_GetWindowSurface(HI_HANDLE Window, HI_HANDLE *pSurface); 95 96 HI_S32 HI_GO_UpdateWindow(HI_HANDLE Window, const HI_RECT *pRect); 97 98 HI_S32 HI_GO_ChangeWindowLayer(HI_HANDLE hWindow, HI_HANDLE hNewLayer); 99 100 HI_S32 HI_GO_FlipWindowSurface(HI_HANDLE hWindow); 101 102 HI_S32 HI_GO_SetWindowMode(HIGO_WNDMEM_E enMode); 103 104 HI_S32 HI_GO_GetWindowMode(HIGO_WNDMEM_E *penMode); 105 106 HI_S32 HI_GO_GetWindowClipRgn(HI_HANDLE hWindow, HI_REGION **ppClipRgn, HI_U32 *pu32Num); 107 108 HI_S32 HI_GO_GetWindowInvRgn(HI_HANDLE hWindow, HIGO_INVRGN_S **ppInvRgn, HI_U32 *pu32Num); 109 110 HI_S32 HI_GO_SetWindowDispRegion(HI_HANDLE window, HI_RECT *region); 111 112 #ifdef __cplusplus 113 #if __cplusplus 114 } 115 #endif 116 #endif 117 118 #endif /* HI_GO_WINC_H */ 119