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