create rotation job and EAPI e_border_rotation_set
[platform/core/uifw/e17.git] / src / bin / e_randr.h
1 #ifdef E_TYPEDEFS
2
3 typedef struct _E_Randr_Crtc_Info E_Randr_Crtc_Info;
4 typedef struct _E_Randr_Edid_Hash E_Randr_Edid_Hash;
5 typedef struct _E_Randr_Monitor_Info E_Randr_Monitor_Info;
6 typedef struct _E_Randr_Output_Info E_Randr_Output_Info;
7 typedef struct _E_Randr_Screen_Info_11 E_Randr_Screen_Info_11;
8 typedef struct _E_Randr_Screen_Info_12 E_Randr_Screen_Info_12;
9 typedef union _E_Randr_Screen_RRVD_Info E_Randr_Screen_RRVD_Info;
10 typedef struct _E_Randr_Screen_Info E_Randr_Screen_Info;
11 typedef struct _E_Randr_Serialized_Output_Policy E_Randr_Serialized_Output_Policy;
12 typedef struct _E_Randr_Serialized_Output E_Randr_Serialized_Output;
13 typedef struct _E_Randr_Serialized_Crtc E_Randr_Serialized_Crtc;
14 typedef struct _E_Randr_Serialized_Setup_11 E_Randr_Serialized_Setup_11;
15 typedef struct _E_Randr_Serialized_Setup_12 E_Randr_Serialized_Setup_12;
16 typedef struct _E_Randr_Serialized_Setup E_Randr_Serialized_Setup;
17
18 typedef enum _E_Randr_Configuration_Store_Modifier
19 {
20    E_RANDR_CONFIGURATION_STORE_POLICIES = (1 << 0),
21    E_RANDR_CONFIGURATION_STORE_RESOLUTIONS = (1 << 1),
22    E_RANDR_CONFIGURATION_STORE_ARRANGEMENT = (1 << 2),
23    E_RANDR_CONFIGURATION_STORE_ORIENTATIONS = (1 << 3),
24    E_RANDR_CONFIGURATION_STORE_ALL = (
25          E_RANDR_CONFIGURATION_STORE_POLICIES
26          | E_RANDR_CONFIGURATION_STORE_RESOLUTIONS
27          | E_RANDR_CONFIGURATION_STORE_ARRANGEMENT
28          | E_RANDR_CONFIGURATION_STORE_ORIENTATIONS)
29 } E_Randr_Configuration_Store_Modifier;
30
31 EAPI void e_randr_store_configuration(E_Randr_Configuration_Store_Modifier modifier);
32 EAPI void e_randr_11_store_configuration(E_Randr_Configuration_Store_Modifier modifier);
33
34 #else
35 #ifndef E_RANDR_H
36 #define E_RANDR_H
37
38 struct _E_Randr_Crtc_Info
39 {
40    Ecore_X_Randr_Crtc xid;
41    Eina_Rectangle geometry;
42    Eina_Rectangle panning;
43    Eina_Rectangle tracking;
44    Eina_Rectangle border;
45    Ecore_X_Randr_Orientation current_orientation;
46    Ecore_X_Randr_Orientation orientations;
47    Ecore_X_Randr_Crtc_Gamma **gamma_ramps;
48    int gamma_ramp_size;
49    Eina_List *outputs;
50    Eina_List *possible_outputs;
51    Eina_List *outputs_common_modes;
52    Ecore_X_Randr_Mode_Info *current_mode;
53 };
54
55 struct _E_Randr_Edid_Hash
56 {
57    int hash;
58 };
59
60 struct _E_Randr_Monitor_Info
61 {
62    Eina_List *modes;
63    Eina_List *preferred_modes;
64    Ecore_X_Randr_Screen_Size size_mm;
65    unsigned char *edid;
66    unsigned long edid_length;
67    E_Randr_Edid_Hash edid_hash;
68    int max_backlight;
69    double backlight_level;
70 };
71
72 struct _E_Randr_Output_Info
73 {
74    Ecore_X_Randr_Output xid;
75    Eina_Stringshare *name;
76    int name_length;
77    E_Randr_Crtc_Info *crtc;
78    Eina_List *wired_clones;
79    Ecore_X_Randr_Signal_Format signalformats;
80    Ecore_X_Randr_Signal_Format signalformat;
81    int connector_number;
82    Ecore_X_Randr_Connector_Type connector_type;
83    Ecore_X_Randr_Connection_Status connection_status;
84    Ecore_X_Randr_Output_Policy policy;
85    Eina_List *possible_crtcs;
86    Eina_List *compatibility_list;
87    Ecore_X_Render_Subpixel_Order subpixel_order;
88    /*
89     * Attached Monitor specific:
90     */
91    E_Randr_Monitor_Info *monitor;
92 };
93
94 struct _E_Randr_Screen_Info_11
95 {
96    Ecore_X_Randr_Screen_Size_MM *sizes;
97    int nsizes;
98    int csize_index;
99    Ecore_X_Randr_Orientation corientation;
100    Ecore_X_Randr_Orientation orientations;
101    Ecore_X_Randr_Refresh_Rate **rates;
102    int *nrates; // size is nsizes
103    Ecore_X_Randr_Refresh_Rate current_rate;
104 };
105
106 struct _E_Randr_Screen_Info_12
107 {
108    Ecore_X_Randr_Screen_Size min_size;
109    Ecore_X_Randr_Screen_Size max_size;
110    Ecore_X_Randr_Screen_Size current_size;
111    Eina_List *modes;
112    Eina_List *crtcs;
113    Eina_List *outputs;
114    E_Randr_Output_Info *primary_output;
115    Ecore_X_Randr_Relative_Alignment alignment;
116 };
117
118 //RRVD == RandR(R) Version Depended
119 union _E_Randr_Screen_RRVD_Info
120 {
121    E_Randr_Screen_Info_11 *randr_info_11;
122    E_Randr_Screen_Info_12 *randr_info_12;
123 };
124
125 struct _E_Randr_Screen_Info
126 {
127    Ecore_X_Window root;
128    int randr_version;
129    E_Randr_Screen_RRVD_Info rrvd_info;
130 };
131
132 //Following stuff is just for configuration purposes
133
134 struct _E_Randr_Serialized_Output_Policy
135 {
136    Eina_Stringshare *name;
137    Ecore_X_Randr_Output_Policy policy;
138 };
139
140 struct _E_Randr_Serialized_Output
141 {
142    Eina_Stringshare *name;
143    double backlight_level;
144 };
145
146 struct _E_Randr_Serialized_Crtc
147 {
148    int index;
149    //List of E_Randr_Serialized_Output objects that were used on the same output
150    Eina_List *outputs;
151    Evas_Coord_Point pos;
152    Ecore_X_Randr_Orientation orientation;
153    //the serialized mode_info
154    Ecore_X_Randr_Mode_Info *mode_info;
155 };
156
157 struct _E_Randr_Serialized_Setup_12
158 {
159    double timestamp;
160    //List of E_Randr_Serialized_Crtc objects
161    Eina_List *crtcs;
162    /*
163     * List of E_Randr_Edid_Hash elements of all connected monitors
164     */
165    Eina_List *edid_hashes;
166 };
167
168 struct _E_Randr_Serialized_Setup_11
169 {
170    Ecore_X_Randr_Screen_Size_MM size;
171    Ecore_X_Randr_Refresh_Rate refresh_rate;
172    Ecore_X_Randr_Orientation orientation;
173 };
174
175 struct _E_Randr_Serialized_Setup
176 {
177    E_Randr_Serialized_Setup_11 *serialized_setup_11;
178    //List of E_Randr_Serialized_Setup_12 objects
179    Eina_List *serialized_setups_12;
180    //List of E_Randr_Serialized_Output_Policy objects
181    Eina_List *outputs_policies;
182 };
183
184 EINTERN Eina_Bool e_randr_init(void);
185 EAPI Eina_Bool e_randr_screen_info_refresh(void);
186 EINTERN int e_randr_shutdown(void);
187 EINTERN Eina_Bool e_randr_try_restore_configuration(void);
188 EINTERN E_Randr_Serialized_Setup *e_randr_serialized_setup_new(void);
189 EINTERN void e_randr_serialized_setup_free(E_Randr_Serialized_Setup *ss);
190 EINTERN void e_randr_11_serialized_setup_free(E_Randr_Serialized_Setup_11 *ss_11);
191 EINTERN void e_randr_12_serialized_setup_free(E_Randr_Serialized_Setup_12 *ss_12);
192 EINTERN void e_randr_12_serialized_output_policy_free(E_Randr_Serialized_Output_Policy *policy);
193
194 EINTERN Eina_Bool e_randr_12_try_enable_output(E_Randr_Output_Info *output_info, Ecore_X_Randr_Output_Policy policy, Eina_Bool force);
195 EINTERN void e_randr_12_ask_dialog_new(E_Randr_Output_Info *oi);
196
197 EAPI extern E_Randr_Screen_Info e_randr_screen_info;
198
199 #endif
200 #endif