17777dab0Sopenharmony_ci/*
27777dab0Sopenharmony_ci * Copyright (c) 2021 Huawei Device Co., Ltd.
37777dab0Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
47777dab0Sopenharmony_ci * you may not use this file except in compliance with the License.
57777dab0Sopenharmony_ci * You may obtain a copy of the License at
67777dab0Sopenharmony_ci *
77777dab0Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
87777dab0Sopenharmony_ci *
97777dab0Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
107777dab0Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
117777dab0Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
127777dab0Sopenharmony_ci * See the License for the specific language governing permissions and
137777dab0Sopenharmony_ci * limitations under the License.
147777dab0Sopenharmony_ci */
157777dab0Sopenharmony_ci
167777dab0Sopenharmony_ci#ifndef INCLUDE_BUFFER_HANDLE_H
177777dab0Sopenharmony_ci#define INCLUDE_BUFFER_HANDLE_H
187777dab0Sopenharmony_ci
197777dab0Sopenharmony_ci/**
207777dab0Sopenharmony_ci * @addtogroup NativeWindow
217777dab0Sopenharmony_ci * @{
227777dab0Sopenharmony_ci *
237777dab0Sopenharmony_ci * @brief Provides the BufferHandle struct for native window.
247777dab0Sopenharmony_ci *
257777dab0Sopenharmony_ci * @syscap SystemCapability.Graphic.Graphic2D.NativeWindow
267777dab0Sopenharmony_ci * @since 8
277777dab0Sopenharmony_ci * @version 1.0
287777dab0Sopenharmony_ci */
297777dab0Sopenharmony_ci
307777dab0Sopenharmony_ci/**
317777dab0Sopenharmony_ci * @file buffer_handle.h
327777dab0Sopenharmony_ci *
337777dab0Sopenharmony_ci * @brief Defines the BufferHandle struct for native window.
347777dab0Sopenharmony_ci *
357777dab0Sopenharmony_ci * @kit ArkGraphics2D
367777dab0Sopenharmony_ci * @library libnative_window.so
377777dab0Sopenharmony_ci * @syscap SystemCapability.Graphic.Graphic2D.NativeWindow
387777dab0Sopenharmony_ci * @since 8
397777dab0Sopenharmony_ci * @version 1.0
407777dab0Sopenharmony_ci */
417777dab0Sopenharmony_ci
427777dab0Sopenharmony_ci#include <stdint.h>
437777dab0Sopenharmony_ci
447777dab0Sopenharmony_ci#ifdef __cplusplus
457777dab0Sopenharmony_ciextern "C" {
467777dab0Sopenharmony_ci#endif
477777dab0Sopenharmony_ci
487777dab0Sopenharmony_citypedef struct {
497777dab0Sopenharmony_ci    int32_t fd;           /**< buffer fd, -1 if not supported */
507777dab0Sopenharmony_ci    int32_t width;        /**< the width of memory */
517777dab0Sopenharmony_ci    int32_t stride;       /**< the stride of memory */
527777dab0Sopenharmony_ci    int32_t height;       /**< the height of memory */
537777dab0Sopenharmony_ci    int32_t size;         /* < size of memory */
547777dab0Sopenharmony_ci    int32_t format;       /**< the format of memory */
557777dab0Sopenharmony_ci    uint64_t usage;        /**< the usage of memory */
567777dab0Sopenharmony_ci    void *virAddr;        /**< Virtual address of memory  */
577777dab0Sopenharmony_ci    int32_t key;          /**< Shared memory key */
587777dab0Sopenharmony_ci    uint64_t phyAddr;     /**< Physical address */
597777dab0Sopenharmony_ci    uint32_t reserveFds;  /**< the number of reserved fd value */
607777dab0Sopenharmony_ci    uint32_t reserveInts; /**< the number of reserved integer value */
617777dab0Sopenharmony_ci    int32_t reserve[0];   /**< the data */
627777dab0Sopenharmony_ci} BufferHandle;
637777dab0Sopenharmony_ci
647777dab0Sopenharmony_ci#ifdef __cplusplus
657777dab0Sopenharmony_ci}
667777dab0Sopenharmony_ci#endif
677777dab0Sopenharmony_ci
687777dab0Sopenharmony_ci#endif // INCLUDE_BUFFER_HANDLE_H
69