• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2024 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 INCLUDE_GRAPHIC_ERROR_CODE_H
17 #define INCLUDE_GRAPHIC_ERROR_CODE_H
18 
19 /**
20  * @addtogroup NativeWindow
21  * @{
22  *
23  * @brief Provides the error codes for native window.
24  *
25  * @syscap SystemCapability.Graphic.Graphic2D.NativeWindow
26  * @since 12
27  * @version 1.0
28  */
29 
30 /**
31  * @file external_window.h
32  *
33  * @brief Defines the error codes.
34  * @syscap SystemCapability.Graphic.Graphic2D.NativeWindow
35  * @library libnative_window.so
36  * @since 12
37  * @version 1.0
38  */
39 
40 #include <stdint.h>
41 
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45 
46 /**
47  * @brief interface error code.
48  * @since 12
49  */
50 typedef enum OHNativeErrorCode {
51     /** @error succeed */
52     NATIVE_ERROR_OK = 0,
53     /** @error input invalid parameter */
54     NATIVE_ERROR_INVALID_ARGUMENTS = 40001000,
55     /** @error unauthorized operation */
56     NATIVE_ERROR_NO_PERMISSION = 40301000,
57     /** @error no idle buffer is available */
58     NATIVE_ERROR_NO_BUFFER = 40601000,
59     /** @error the consumer side doesn't exist */
60     NATIVE_ERROR_NO_CONSUMER = 41202000,
61     /** @error uninitialized */
62     NATIVE_ERROR_NOT_INIT = 41203000,
63     /** @error the consumer is connected */
64     NATIVE_ERROR_CONSUMER_CONNECTED = 41206000,
65     /** @error the buffer status did not meet expectations */
66     NATIVE_ERROR_BUFFER_STATE_INVALID = 41207000,
67     /** @error buffer is already in the cache queue */
68     NATIVE_ERROR_BUFFER_IN_CACHE = 41208000,
69     /** @error the buffer queue is full */
70     NATIVE_ERROR_BUFFER_QUEUE_FULL = 41209000,
71     /** @error buffer is not in the cache queue */
72     NATIVE_ERROR_BUFFER_NOT_IN_CACHE = 41210000,
73     /** @error the current device or platform does not support it */
74     NATIVE_ERROR_UNSUPPORTED = 50102000,
75     /** @error unknown error, please check log */
76     NATIVE_ERROR_UNKNOWN = 50002000,
77     /** @error the egl environment is abnormal */
78     NATIVE_ERROR_EGL_STATE_UNKNOWN = 60001000,
79     /** @error egl interface invocation failed */
80     NATIVE_ERROR_EGL_API_FAILED = 60002000,
81 } OHNativeErrorCode;
82 
83 #ifdef __cplusplus
84 }
85 #endif
86 
87 /** @} */
88 #endif // INCLUDE_GRAPHIC_ERROR_CODE_H