e_output: substitute e_input APIs for ecore_drm APIs and remove ecore drm dependency
[platform/upstream/enlightenment.git] / src / bin / e_output.h
1 #ifdef E_TYPEDEFS
2
3 #include <tbm_surface.h>
4
5 typedef struct _E_Output            E_Output;
6 typedef struct _E_Output_Mode       E_Output_Mode;
7 typedef enum   _E_Output_Dpms       E_OUTPUT_DPMS;
8
9 typedef struct _E_Output_Hook       E_Output_Hook;
10 typedef enum   _E_Output_Hook_Point E_Output_Hook_Point;
11 typedef void (*E_Output_Hook_Cb) (void *data, E_Output *output);
12
13 typedef void (*E_Output_Capture_Cb) (E_Output *output, tbm_surface_h surface, void *user_data);
14
15 #else
16 #ifndef E_OUTPUT_H
17 #define E_OUTPUT_H
18
19 #define E_OUTPUT_TYPE (int)0xE0b11002
20
21 #include "e_comp_screen.h"
22
23 enum _E_Output_Dpms
24 {
25    E_OUTPUT_DPMS_ON,
26    E_OUTPUT_DPMS_STANDBY,
27    E_OUTPUT_DPMS_SUSPEND,
28    E_OUTPUT_DPMS_OFF,
29 };
30
31 struct _E_Output_Mode
32 {
33    int    w, h; // resolution width and height
34    double refresh; // refresh in hz
35    Eina_Bool preferred : 1; // is this the preferred mode for the device?
36
37    const tdm_output_mode *tmode;
38 };
39
40 struct _E_Output
41 {
42    int index;
43    char *id; // string id which is "name/edid";
44    struct {
45         char                 *screen; // name of the screen device attached
46         char                 *name; // name of the output itself
47         char                 *edid; // full edid data
48         Eina_Bool             connected : 1; // some screen is plugged in or not
49         Eina_List            *modes; // available screen modes here
50         struct {
51              int                w, h; // physical width and height in mm
52         } size;
53    } info;
54    struct {
55         Eina_Rectangle        geom; // the geometry that is set (as a result)
56         E_Output_Mode         mode; // screen res/refresh to use
57         int                   rotation; // 0, 90, 180, 270
58         int                   priority; // larger num == more important
59         Eina_Bool             enabled : 1; // should this monitor be enabled?
60    } config;
61
62    int                  plane_count;
63    Eina_List           *planes;
64    E_Zone              *zone;
65
66    tdm_output           *toutput;
67
68    E_Comp_Screen        *e_comp_screen;
69    E_OUTPUT_DPMS        dpms;
70
71    struct {
72        int min_w, min_h;
73        int max_w, max_h;
74        int preferred_align;
75    } cursor_available;
76
77    Eina_Bool            zoom_set;
78    struct
79    {
80       double            zoomx;
81       double            zoomy;
82       int               init_cx;
83       int               init_cy;
84       int               adjusted_cx;
85       int               adjusted_cy;
86       int               init_angle;
87       int               current_angle;
88       Eina_Rectangle    rect;
89       Eina_Bool         need_touch_set;
90    } zoom_conf;
91    Ecore_Event_Handler *touch_up_handler;
92
93    struct
94    {
95       tdm_capture      *tcapture;
96       Eina_Bool         start;
97       Eina_List        *data;
98       Eina_Bool         possible_tdm_capture;
99       Ecore_Timer      *timer;
100       Eina_Bool         wait_vblank;
101    } stream_capture;
102 };
103
104 enum _E_Output_Hook_Point
105 {
106    E_OUTPUT_HOOK_DPMS_CHANGE,
107    E_OUTPUT_HOOK_LAST
108 };
109
110 struct _E_Output_Hook
111 {
112    EINA_INLIST;
113    E_Output_Hook_Point hookpoint;
114    E_Output_Hook_Cb func;
115    void *data;
116    unsigned char delete_me : 1;
117 };
118
119 EINTERN Eina_Bool         e_output_init(void);
120 EINTERN void              e_output_shutdown(void);
121 EINTERN E_Output        * e_output_new(E_Comp_Screen *e_comp_screen, int index);
122 EINTERN void              e_output_del(E_Output *output);
123 EINTERN Eina_Bool         e_output_rotate(E_Output *output, int rotate);
124 EINTERN Eina_Bool         e_output_update(E_Output *output);
125 EINTERN Eina_Bool         e_output_mode_apply(E_Output *output, E_Output_Mode *mode);
126 EINTERN Eina_Bool         e_output_commit(E_Output *output);
127 EINTERN Eina_Bool         e_output_render(E_Output *output);
128 EINTERN Eina_Bool         e_output_setup(E_Output *output);
129 EINTERN E_Output_Mode   * e_output_best_mode_find(E_Output *output);
130 EINTERN Eina_Bool         e_output_connected(E_Output *output);
131 EINTERN Eina_Bool         e_output_dpms_set(E_Output *output, E_OUTPUT_DPMS val);
132 E_API E_OUTPUT_DPMS       e_output_dpms_get(E_Output *output);
133 EINTERN void              e_output_size_get(E_Output *output, int *w, int *h);
134 EINTERN E_Plane         * e_output_default_fb_target_get(E_Output *output);
135 EINTERN Eina_Bool         e_output_fake_config_set(E_Output *output, int w, int h);
136 EINTERN Eina_Bool         e_output_zoom_set(E_Output *output, double zoomx, double zoomy, int cx, int cy);
137 EINTERN void              e_output_zoom_unset(E_Output *output);
138 EINTERN Eina_Bool         e_output_capture(E_Output *output, tbm_surface_h surface, Eina_Bool auto_rotate, E_Output_Capture_Cb func, void *data);
139 EINTERN Eina_Bool         e_output_stream_capture_queue(E_Output *output, tbm_surface_h surface, E_Output_Capture_Cb func, void *data);
140 EINTERN Eina_Bool         e_output_stream_capture_dequeue(E_Output *output, tbm_surface_h surface);
141 EINTERN Eina_Bool         e_output_stream_capture_start(E_Output *output);
142 EINTERN void              e_output_stream_capture_stop(E_Output *output);
143 E_API E_Output          * e_output_find(const char *id);
144 E_API E_Output          * e_output_find_by_index(int index);
145 E_API const Eina_List   * e_output_planes_get(E_Output *output);
146 E_API void                e_output_util_planes_print(void);
147 E_API Eina_Bool           e_output_is_fb_composing(E_Output *output);
148 E_API Eina_Bool           e_output_is_fb_full_compositing(E_Output *output);
149 E_API E_Plane           * e_output_fb_target_get(E_Output *output);
150 E_API E_Plane           * e_output_plane_get_by_zpos(E_Output *output, int zpos);
151 E_API E_Output_Hook     * e_output_hook_add(E_Output_Hook_Point hookpoint, E_Output_Hook_Cb func, const void *data);
152 E_API void                e_output_hook_del(E_Output_Hook *ch);
153
154
155 #endif
156 #endif