aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_randr_11.c
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/ecore/src/lib/ecore_x/xlib/ecore_x_randr_11.c')
-rw-r--r--libraries/ecore/src/lib/ecore_x/xlib/ecore_x_randr_11.c49
1 files changed, 26 insertions, 23 deletions
diff --git a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_randr_11.c b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_randr_11.c
index a6bafb6..816f8d5 100644
--- a/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_randr_11.c
+++ b/libraries/ecore/src/lib/ecore_x/xlib/ecore_x_randr_11.c
@@ -8,6 +8,10 @@
8 8
9#include "ecore_x_private.h" 9#include "ecore_x_private.h"
10#include "ecore_x_randr.h" 10#include "ecore_x_randr.h"
11#include <stdio.h>
12#include <stdlib.h>
13#include <unistd.h>
14#include <string.h>
11 15
12#define Ecore_X_Randr_None 0 16#define Ecore_X_Randr_None 0
13#ifdef ECORE_XRANDR 17#ifdef ECORE_XRANDR
@@ -18,7 +22,8 @@
18 root) ((screen = \ 22 root) ((screen = \
19 XRRRootToScreen(_ecore_x_disp, \ 23 XRRRootToScreen(_ecore_x_disp, \
20 root)) != -1) 24 root)) != -1)
21#define RANDR_CHECK_1_1_RET(ret) if(_randr_version < RANDR_1_1) return ret 25#define RANDR_CHECK_1_1_RET(ret) if (_randr_version < RANDR_1_1) \
26 return ret
22 27
23extern XRRScreenResources *(*_ecore_x_randr_get_screen_resources)(Display * 28extern XRRScreenResources *(*_ecore_x_randr_get_screen_resources)(Display *
24 dpy, 29 dpy,
@@ -44,7 +49,7 @@ ecore_x_randr_screen_primary_output_orientations_get(Ecore_X_Window root)
44#else /* ifdef ECORE_XRANDR */ 49#else /* ifdef ECORE_XRANDR */
45 return Ecore_X_Randr_None; 50 return Ecore_X_Randr_None;
46#endif /* ifdef ECORE_XRANDR */ 51#endif /* ifdef ECORE_XRANDR */
47} /* ecore_x_randr_screen_primary_output_orientations_get */ 52}
48 53
49/* 54/*
50 * @param root window which's primary output will be queried 55 * @param root window which's primary output will be queried
@@ -61,7 +66,7 @@ ecore_x_randr_screen_primary_output_orientation_get(Ecore_X_Window root)
61#else /* ifdef ECORE_XRANDR */ 66#else /* ifdef ECORE_XRANDR */
62 return Ecore_X_Randr_None; 67 return Ecore_X_Randr_None;
63#endif /* ifdef ECORE_XRANDR */ 68#endif /* ifdef ECORE_XRANDR */
64} /* ecore_x_randr_screen_primary_output_orientation_get */ 69}
65 70
66/* 71/*
67 * @brief sets a given screen's primary output's orientation 72 * @brief sets a given screen's primary output's orientation
@@ -95,7 +100,7 @@ ecore_x_randr_screen_primary_output_orientation_set(
95#else /* ifdef ECORE_XRANDR */ 100#else /* ifdef ECORE_XRANDR */
96 return EINA_FALSE; 101 return EINA_FALSE;
97#endif /* ifdef ECORE_XRANDR */ 102#endif /* ifdef ECORE_XRANDR */
98} /* ecore_x_randr_screen_primary_output_orientation_set */ 103}
99 104
100/* 105/*
101 * @brief gets a screen's primary output's possible sizes 106 * @brief gets a screen's primary output's possible sizes
@@ -105,7 +110,7 @@ ecore_x_randr_screen_primary_output_orientation_set(
105 */ 110 */
106EAPI Ecore_X_Randr_Screen_Size_MM * 111EAPI Ecore_X_Randr_Screen_Size_MM *
107ecore_x_randr_screen_primary_output_sizes_get(Ecore_X_Window root, 112ecore_x_randr_screen_primary_output_sizes_get(Ecore_X_Window root,
108 int *num) 113 int *num)
109{ 114{
110#ifdef ECORE_XRANDR 115#ifdef ECORE_XRANDR
111 Ecore_X_Randr_Screen_Size_MM *ret = NULL; 116 Ecore_X_Randr_Screen_Size_MM *ret = NULL;
@@ -135,7 +140,7 @@ ecore_x_randr_screen_primary_output_sizes_get(Ecore_X_Window root,
135#else /* ifdef ECORE_XRANDR */ 140#else /* ifdef ECORE_XRANDR */
136 return NULL; 141 return NULL;
137#endif /* ifdef ECORE_XRANDR */ 142#endif /* ifdef ECORE_XRANDR */
138} /* ecore_x_randr_screen_primary_output_sizes_get */ 143}
139 144
140/* 145/*
141 * @brief get the current set size of a given screen's primary output 146 * @brief get the current set size of a given screen's primary output
@@ -148,11 +153,11 @@ ecore_x_randr_screen_primary_output_sizes_get(Ecore_X_Window root,
148 */ 153 */
149EAPI void 154EAPI void
150ecore_x_randr_screen_primary_output_current_size_get(Ecore_X_Window root, 155ecore_x_randr_screen_primary_output_current_size_get(Ecore_X_Window root,
151 int *w, 156 int *w,
152 int *h, 157 int *h,
153 int *w_mm, 158 int *w_mm,
154 int *h_mm, 159 int *h_mm,
155 int *size_index) 160 int *size_index)
156{ 161{
157#ifdef ECORE_XRANDR 162#ifdef ECORE_XRANDR
158 XRRScreenSize *sizes; 163 XRRScreenSize *sizes;
@@ -192,7 +197,7 @@ ecore_x_randr_screen_primary_output_current_size_get(Ecore_X_Window root,
192 197
193 XRRFreeScreenConfigInfo(sc); 198 XRRFreeScreenConfigInfo(sc);
194#endif /* ifdef ECORE_XRANDR */ 199#endif /* ifdef ECORE_XRANDR */
195} /* ecore_x_randr_screen_primary_output_current_size_get */ 200}
196 201
197/* 202/*
198 * @brief sets a given screen's primary output size, but disables all other outputs at the same time 203 * @brief sets a given screen's primary output size, but disables all other outputs at the same time
@@ -202,18 +207,16 @@ ecore_x_randr_screen_primary_output_current_size_get(Ecore_X_Window root,
202 */ 207 */
203EAPI Eina_Bool 208EAPI Eina_Bool
204ecore_x_randr_screen_primary_output_size_set(Ecore_X_Window root, 209ecore_x_randr_screen_primary_output_size_set(Ecore_X_Window root,
205 int size_index) 210 int size_index)
206{ 211{
207#ifdef ECORE_XRANDR 212#ifdef ECORE_XRANDR
208 XRRScreenConfiguration *sc = NULL; 213 XRRScreenConfiguration *sc = NULL;
209 XRRScreenSize *sizes;
210 Eina_Bool ret = EINA_FALSE; 214 Eina_Bool ret = EINA_FALSE;
211 int nsizes = 0; 215 int nsizes = 0;
212 216
213 if (size_index >= 0 && _ecore_x_randr_root_validate(root)) 217 if (size_index >= 0 && _ecore_x_randr_root_validate(root))
214 { 218 {
215 sizes = 219 XRRSizes(_ecore_x_disp, XRRRootToScreen(_ecore_x_disp,
216 XRRSizes(_ecore_x_disp, XRRRootToScreen(_ecore_x_disp,
217 root), &nsizes); 220 root), &nsizes);
218 221
219 if (size_index < nsizes) 222 if (size_index < nsizes)
@@ -235,7 +238,7 @@ ecore_x_randr_screen_primary_output_size_set(Ecore_X_Window root,
235#else /* ifdef ECORE_XRANDR */ 238#else /* ifdef ECORE_XRANDR */
236 return EINA_FALSE; 239 return EINA_FALSE;
237#endif /* ifdef ECORE_XRANDR */ 240#endif /* ifdef ECORE_XRANDR */
238} /* ecore_x_randr_screen_primary_output_size_set */ 241}
239 242
240/* 243/*
241 * @param root window which's primary output will be queried 244 * @param root window which's primary output will be queried
@@ -261,7 +264,7 @@ ecore_x_randr_screen_primary_output_current_refresh_rate_get(
261#else /* ifdef ECORE_XRANDR */ 264#else /* ifdef ECORE_XRANDR */
262 return 0.0; 265 return 0.0;
263#endif /* ifdef ECORE_XRANDR */ 266#endif /* ifdef ECORE_XRANDR */
264} /* ecore_x_randr_screen_primary_output_current_refresh_rate_get */ 267}
265 268
266/* 269/*
267 * @param root window which's primary output will be queried 270 * @param root window which's primary output will be queried
@@ -270,8 +273,8 @@ ecore_x_randr_screen_primary_output_current_refresh_rate_get(
270 */ 273 */
271EAPI Ecore_X_Randr_Refresh_Rate * 274EAPI Ecore_X_Randr_Refresh_Rate *
272ecore_x_randr_screen_primary_output_refresh_rates_get(Ecore_X_Window root, 275ecore_x_randr_screen_primary_output_refresh_rates_get(Ecore_X_Window root,
273 int size_index, 276 int size_index,
274 int *num) 277 int *num)
275{ 278{
276#ifdef ECORE_XRANDR 279#ifdef ECORE_XRANDR
277 Ecore_X_Randr_Refresh_Rate *ret = NULL, *rates = NULL; 280 Ecore_X_Randr_Refresh_Rate *ret = NULL, *rates = NULL;
@@ -293,7 +296,7 @@ ecore_x_randr_screen_primary_output_refresh_rates_get(Ecore_X_Window root,
293#else /* ifdef ECORE_XRANDR */ 296#else /* ifdef ECORE_XRANDR */
294 return NULL; 297 return NULL;
295#endif /* ifdef ECORE_XRANDR */ 298#endif /* ifdef ECORE_XRANDR */
296} /* ecore_x_randr_screen_primary_output_refresh_rates_get */ 299}
297 300
298//>= 1.1 301//>= 1.1
299/* 302/*
@@ -306,7 +309,7 @@ ecore_x_randr_screen_primary_output_refresh_rates_get(Ecore_X_Window root,
306EAPI Eina_Bool 309EAPI Eina_Bool
307ecore_x_randr_screen_primary_output_refresh_rate_set( 310ecore_x_randr_screen_primary_output_refresh_rate_set(
308 Ecore_X_Window root, 311 Ecore_X_Window root,
309 int size_index, 312 int size_index,
310 Ecore_X_Randr_Refresh_Rate 313 Ecore_X_Randr_Refresh_Rate
311 rate) 314 rate)
312{ 315{
@@ -328,5 +331,5 @@ ecore_x_randr_screen_primary_output_refresh_rate_set(
328#else /* ifdef ECORE_XRANDR */ 331#else /* ifdef ECORE_XRANDR */
329 return EINA_FALSE; 332 return EINA_FALSE;
330#endif /* ifdef ECORE_XRANDR */ 333#endif /* ifdef ECORE_XRANDR */
331} /* ecore_x_randr_screen_primary_output_refresh_rate_set */ 334}
332 335