add capture type enum
[platform/core/uifw/libtdm.git] / include / tdm_types.h
1 /**************************************************************************
2  *
3  * libtdm
4  *
5  * Copyright 2015 Samsung Electronics co., Ltd. All Rights Reserved.
6  *
7  * Contact: Eunchul Kim <chulspro.kim@samsung.com>,
8  *          JinYoung Jeon <jy0.jeon@samsung.com>,
9  *          Taeheon Kim <th908.kim@samsung.com>,
10  *          YoungJun Cho <yj44.cho@samsung.com>,
11  *          SooChan Lim <sc1.lim@samsung.com>,
12  *          Boram Park <sc1.lim@samsung.com>
13  *
14  * Permission is hereby granted, free of charge, to any person obtaining a
15  * copy of this software and associated documentation files (the
16  * "Software"), to deal in the Software without restriction, including
17  * without limitation the rights to use, copy, modify, merge, publish,
18  * distribute, sub license, and/or sell copies of the Software, and to
19  * permit persons to whom the Software is furnished to do so, subject to
20  * the following conditions:
21  *
22  * The above copyright notice and this permission notice (including the
23  * next paragraph) shall be included in all copies or substantial portions
24  * of the Software.
25  *
26  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
27  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
28  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
29  * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
30  * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
31  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
32  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
33  *
34 **************************************************************************/
35
36 #ifndef _TDM_TYPES_H_
37 #define _TDM_TYPES_H_
38
39 #include <tbm_surface.h>
40
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44
45 /**
46  * @file tdm_types.h
47  * @brief The header file which defines Enumerations and Structures for frontend and backend.
48  * @details
49  * Both frontend(@ref tdm.h) and backend(@ref tdm_backend.h) header files
50  * include @ref tdm_types.h
51  * @par Example
52  * @code
53  * #include <tdm.h>    //for a frontend user
54  * @endcode
55  * @code
56  * #include <tdm_backend.h>  //for a vendor to implement a backend module
57  * @endcode
58  */
59
60 #include <tdm_common.h>
61
62 typedef enum {
63         TDM_EVENT_LOOP_READABLE = (1 << 0),
64         TDM_EVENT_LOOP_WRITABLE = (1 << 1),
65         TDM_EVENT_LOOP_HANGUP   = (1 << 2),
66         TDM_EVENT_LOOP_ERROR    = (1 << 3),
67 } tdm_event_loop_mask;
68
69 /**
70  * @brief The output mode structure
71  */
72 typedef struct _tdm_output_mode {
73         unsigned int clock;
74         unsigned int hdisplay, hsync_start, hsync_end, htotal, hskew;
75         unsigned int vdisplay, vsync_start, vsync_end, vtotal, vscan;
76         unsigned int vrefresh;
77         unsigned int flags;
78         unsigned int type;
79         char name[TDM_NAME_LEN];
80 } tdm_output_mode;
81
82 /**
83  * @brief The property structure
84  */
85 typedef struct _tdm_prop {
86         unsigned int id;
87         char name[TDM_NAME_LEN];
88 } tdm_prop;
89
90 /**
91  * @brief The info config structure
92  */
93 typedef struct _tdm_info_config {
94         tdm_size size;
95         tdm_pos pos;
96         tbm_format format;
97 } tdm_info_config;
98
99 /**
100  * @brief The layer info structre
101  */
102 typedef struct _tdm_info_layer {
103         tdm_info_config src_config;
104         tdm_pos dst_pos;
105         tdm_transform transform;
106 } tdm_info_layer;
107
108 /**
109  * @brief The pp info structre
110  */
111 typedef struct _tdm_info_pp {
112         tdm_info_config src_config;
113         tdm_info_config dst_config;
114         tdm_transform transform;
115         int sync;
116         int flags;
117 } tdm_info_pp;
118
119 /**
120  * @brief The capture info structre
121  */
122 typedef struct _tdm_info_capture {
123         tdm_info_config dst_config;
124         tdm_transform transform;
125         tdm_capture_type type;
126         int frequency;
127         int flags;
128 } tdm_info_capture;
129
130 /**
131  * @brief The tdm display object
132  */
133 typedef void tdm_display;
134
135 /**
136  * @brief The tdm output object
137  */
138 typedef void tdm_output;
139
140 /**
141  * @brief The tdm layer object
142  */
143 typedef void tdm_layer;
144
145 /**
146  * @brief The tdm capture object
147  */
148 typedef void tdm_capture;
149
150 /**
151  * @brief The tdm pp object
152  */
153 typedef void tdm_pp;
154
155 /**
156  * @brief The tdm vblank object
157  */
158 typedef void tdm_vblank;
159
160 /**
161  * @brief The vblank handler
162  * @see output_set_vblank_handler() function of #tdm_func_display
163  */
164 typedef void (*tdm_output_vblank_handler)(tdm_output *output, unsigned int sequence,
165                                                                                   unsigned int tv_sec, unsigned int tv_usec,
166                                                                                   void *user_data);
167
168 /**
169  * @brief The commit handler
170  * @see output_set_commit_handler() function of #tdm_func_display
171  */
172 typedef void (*tdm_output_commit_handler)(tdm_output *output, unsigned int sequence,
173                                                                                   unsigned int tv_sec, unsigned int tv_usec,
174                                                                                   void *user_data);
175 /**
176  * @brief The done handler of a pp object
177  */
178 typedef void (*tdm_pp_done_handler)(tdm_pp *pp, tbm_surface_h src,
179                                                                         tbm_surface_h dst, void *user_data);
180
181 /**
182  * @brief The done handler of a capture object
183  */
184 typedef void (*tdm_capture_done_handler)(tdm_capture *capture,
185                                                                                  tbm_surface_h buffer, void *user_data);
186
187 #ifdef __cplusplus
188 }
189 #endif
190
191 #endif /* _TDM_TYPES_H_ */