forked from enlightenment/efl
Ecore_X(cb): Add more trapping for build when randr is not
found/enabled. SVN revision: 71732
This commit is contained in:
parent
827c2f6dd6
commit
b4924826c3
|
@ -74,8 +74,10 @@ static Eina_Bool _ecore_xcb_randr_crtc_val
|
|||
Ecore_X_Randr_Crtc crtc);
|
||||
static Eina_Bool _ecore_xcb_randr_root_validate(Ecore_X_Window root);
|
||||
static int _ecore_xcb_randr_root_to_screen(Ecore_X_Window root);
|
||||
#ifdef ECORE_XCB_RANDR
|
||||
static xcb_randr_get_screen_resources_reply_t *_ecore_xcb_randr_12_get_resources(Ecore_X_Window win);
|
||||
static xcb_randr_get_screen_resources_current_reply_t *_ecore_xcb_randr_13_get_resources(Ecore_X_Window win);
|
||||
#endif
|
||||
static xcb_timestamp_t _ecore_xcb_randr_12_get_resource_timestamp(Ecore_X_Window win);
|
||||
static xcb_timestamp_t _ecore_xcb_randr_13_get_resource_timestamp(Ecore_X_Window win);
|
||||
|
||||
|
@ -191,7 +193,11 @@ _ecore_xcb_randr_finalize(void)
|
|||
}
|
||||
|
||||
static Eina_Bool
|
||||
#ifdef ECORE_XCB_RANDR
|
||||
_ecore_xcb_randr_root_validate(Ecore_X_Window root)
|
||||
#else
|
||||
_ecore_xcb_randr_root_validate(Ecore_X_Window root __UNUSED__)
|
||||
#endif
|
||||
{
|
||||
#ifdef ECORE_XCB_RANDR
|
||||
Ecore_X_Randr_Screen scr = -1;
|
||||
|
@ -842,8 +848,8 @@ ecore_x_randr_mode_info_get(Ecore_X_Window root,
|
|||
EAPI Ecore_X_Randr_Mode
|
||||
ecore_x_randr_mode_info_add(Ecore_X_Window root, Ecore_X_Randr_Mode_Info *mode_info)
|
||||
{
|
||||
#ifdef ECORE_XCB_RANDR
|
||||
Ecore_X_Randr_Mode mode = Ecore_X_Randr_None;
|
||||
#ifdef ECORE_XCB_RANDR
|
||||
xcb_randr_create_mode_cookie_t cookie;
|
||||
xcb_randr_create_mode_reply_t *reply;
|
||||
xcb_randr_mode_info_t info;
|
||||
|
@ -2934,6 +2940,7 @@ _ecore_xcb_randr_12_output_modes_get(Ecore_X_Window root,
|
|||
int *npreferred)
|
||||
{
|
||||
Ecore_X_Randr_Mode *modes = NULL;
|
||||
#ifdef ECORE_XCB_RANDR
|
||||
xcb_randr_get_screen_resources_reply_t *reply;
|
||||
|
||||
reply = _ecore_xcb_randr_12_get_resources(root);
|
||||
|
@ -2967,7 +2974,7 @@ _ecore_xcb_randr_12_output_modes_get(Ecore_X_Window root,
|
|||
}
|
||||
free(reply);
|
||||
}
|
||||
|
||||
#endif
|
||||
return modes;
|
||||
}
|
||||
|
||||
|
@ -2978,6 +2985,7 @@ _ecore_xcb_randr_13_output_modes_get(Ecore_X_Window root,
|
|||
int *npreferred)
|
||||
{
|
||||
Ecore_X_Randr_Mode *modes = NULL;
|
||||
#ifdef ECORE_XCB_RANDR
|
||||
xcb_timestamp_t stamp = 0;
|
||||
xcb_randr_get_output_info_cookie_t ocookie;
|
||||
xcb_randr_get_output_info_reply_t *oreply;
|
||||
|
@ -3004,7 +3012,7 @@ _ecore_xcb_randr_13_output_modes_get(Ecore_X_Window root,
|
|||
}
|
||||
free(oreply);
|
||||
}
|
||||
|
||||
#endif
|
||||
return modes;
|
||||
}
|
||||
|
||||
|
@ -3013,6 +3021,7 @@ _ecore_xcb_randr_12_mode_info_get(Ecore_X_Window root,
|
|||
Ecore_X_Randr_Mode mode)
|
||||
{
|
||||
Ecore_X_Randr_Mode_Info *ret = NULL;
|
||||
#ifdef ECORE_XCB_RANDR
|
||||
xcb_randr_get_screen_resources_reply_t *reply;
|
||||
|
||||
reply = _ecore_xcb_randr_12_get_resources(root);
|
||||
|
@ -3063,6 +3072,7 @@ _ecore_xcb_randr_12_mode_info_get(Ecore_X_Window root,
|
|||
|
||||
free(reply);
|
||||
}
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -3071,6 +3081,7 @@ _ecore_xcb_randr_13_mode_info_get(Ecore_X_Window root,
|
|||
Ecore_X_Randr_Mode mode)
|
||||
{
|
||||
Ecore_X_Randr_Mode_Info *ret = NULL;
|
||||
#ifdef ECORE_XCB_RANDR
|
||||
xcb_randr_get_screen_resources_current_reply_t *reply;
|
||||
|
||||
reply = _ecore_xcb_randr_13_get_resources(root);
|
||||
|
@ -3122,6 +3133,7 @@ _ecore_xcb_randr_13_mode_info_get(Ecore_X_Window root,
|
|||
|
||||
free(reply);
|
||||
}
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -3130,6 +3142,7 @@ _ecore_xcb_randr_12_modes_info_get(Ecore_X_Window root,
|
|||
int *num)
|
||||
{
|
||||
Ecore_X_Randr_Mode_Info **ret = NULL;
|
||||
#ifdef ECORE_XCB_RANDR
|
||||
xcb_randr_get_screen_resources_reply_t *reply;
|
||||
|
||||
reply = _ecore_xcb_randr_12_get_resources(root);
|
||||
|
@ -3189,6 +3202,7 @@ _ecore_xcb_randr_12_modes_info_get(Ecore_X_Window root,
|
|||
}
|
||||
free(reply);
|
||||
}
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -3197,6 +3211,7 @@ _ecore_xcb_randr_13_modes_info_get(Ecore_X_Window root,
|
|||
int *num)
|
||||
{
|
||||
Ecore_X_Randr_Mode_Info **ret = NULL;
|
||||
#ifdef ECORE_XCB_RANDR
|
||||
xcb_randr_get_screen_resources_current_reply_t *reply;
|
||||
|
||||
reply = _ecore_xcb_randr_13_get_resources(root);
|
||||
|
@ -3257,6 +3272,7 @@ _ecore_xcb_randr_13_modes_info_get(Ecore_X_Window root,
|
|||
}
|
||||
free(reply);
|
||||
}
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -3266,6 +3282,10 @@ _ecore_xcb_randr_12_mode_size_get(Ecore_X_Window root,
|
|||
int *w,
|
||||
int *h)
|
||||
{
|
||||
if (w) *w = 0;
|
||||
if (h) *h = 0;
|
||||
|
||||
#ifdef ECORE_XCB_RANDR
|
||||
xcb_randr_get_screen_resources_reply_t *reply;
|
||||
|
||||
reply = _ecore_xcb_randr_12_get_resources(root);
|
||||
|
@ -3289,6 +3309,7 @@ _ecore_xcb_randr_12_mode_size_get(Ecore_X_Window root,
|
|||
}
|
||||
free(reply);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -3297,6 +3318,10 @@ _ecore_xcb_randr_13_mode_size_get(Ecore_X_Window root,
|
|||
int *w,
|
||||
int *h)
|
||||
{
|
||||
if (w) *w = 0;
|
||||
if (h) *h = 0;
|
||||
|
||||
#ifdef ECORE_XCB_RANDR
|
||||
xcb_randr_get_screen_resources_current_reply_t *reply;
|
||||
|
||||
reply = _ecore_xcb_randr_13_get_resources(root);
|
||||
|
@ -3320,6 +3345,7 @@ _ecore_xcb_randr_13_mode_size_get(Ecore_X_Window root,
|
|||
}
|
||||
free(reply);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static Ecore_X_Randr_Output *
|
||||
|
@ -3328,6 +3354,7 @@ _ecore_xcb_randr_12_output_clones_get(Ecore_X_Window root,
|
|||
int *num)
|
||||
{
|
||||
Ecore_X_Randr_Output *outputs = NULL;
|
||||
#ifdef ECORE_XCB_RANDR
|
||||
xcb_randr_get_screen_resources_reply_t *reply;
|
||||
|
||||
reply = _ecore_xcb_randr_12_get_resources(root);
|
||||
|
@ -3356,6 +3383,7 @@ _ecore_xcb_randr_12_output_clones_get(Ecore_X_Window root,
|
|||
}
|
||||
free(reply);
|
||||
}
|
||||
#endif
|
||||
return outputs;
|
||||
}
|
||||
|
||||
|
@ -3365,6 +3393,7 @@ _ecore_xcb_randr_13_output_clones_get(Ecore_X_Window root,
|
|||
int *num)
|
||||
{
|
||||
Ecore_X_Randr_Output *outputs = NULL;
|
||||
#ifdef ECORE_XCB_RANDR
|
||||
xcb_randr_get_screen_resources_current_reply_t *reply;
|
||||
|
||||
reply = _ecore_xcb_randr_13_get_resources(root);
|
||||
|
@ -3393,6 +3422,7 @@ _ecore_xcb_randr_13_output_clones_get(Ecore_X_Window root,
|
|||
}
|
||||
free(reply);
|
||||
}
|
||||
#endif
|
||||
return outputs;
|
||||
}
|
||||
|
||||
|
@ -3402,6 +3432,7 @@ _ecore_xcb_randr_12_output_possible_crtcs_get(Ecore_X_Window root,
|
|||
int *num)
|
||||
{
|
||||
Ecore_X_Randr_Crtc *crtcs = NULL;
|
||||
#ifdef ECORE_XCB_RANDR
|
||||
xcb_randr_get_screen_resources_reply_t *reply;
|
||||
|
||||
reply = _ecore_xcb_randr_12_get_resources(root);
|
||||
|
@ -3429,6 +3460,7 @@ _ecore_xcb_randr_12_output_possible_crtcs_get(Ecore_X_Window root,
|
|||
}
|
||||
free(reply);
|
||||
}
|
||||
#endif
|
||||
return crtcs;
|
||||
}
|
||||
|
||||
|
@ -3438,6 +3470,7 @@ _ecore_xcb_randr_13_output_possible_crtcs_get(Ecore_X_Window root,
|
|||
int *num)
|
||||
{
|
||||
Ecore_X_Randr_Crtc *crtcs = NULL;
|
||||
#ifdef ECORE_XCB_RANDR
|
||||
xcb_randr_get_screen_resources_current_reply_t *reply;
|
||||
|
||||
reply = _ecore_xcb_randr_13_get_resources(root);
|
||||
|
@ -3465,6 +3498,7 @@ _ecore_xcb_randr_13_output_possible_crtcs_get(Ecore_X_Window root,
|
|||
}
|
||||
free(reply);
|
||||
}
|
||||
#endif
|
||||
return crtcs;
|
||||
}
|
||||
|
||||
|
@ -3474,6 +3508,7 @@ _ecore_xcb_randr_12_output_name_get(Ecore_X_Window root,
|
|||
int *len)
|
||||
{
|
||||
char *ret = NULL;
|
||||
#ifdef ECORE_XCB_RANDR
|
||||
xcb_randr_get_screen_resources_reply_t *reply;
|
||||
|
||||
reply = _ecore_xcb_randr_12_get_resources(root);
|
||||
|
@ -3506,6 +3541,7 @@ _ecore_xcb_randr_12_output_name_get(Ecore_X_Window root,
|
|||
}
|
||||
free(reply);
|
||||
}
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -3515,6 +3551,7 @@ _ecore_xcb_randr_13_output_name_get(Ecore_X_Window root,
|
|||
int *len)
|
||||
{
|
||||
char *ret = NULL;
|
||||
#ifdef ECORE_XCB_RANDR
|
||||
xcb_randr_get_screen_resources_current_reply_t *reply;
|
||||
|
||||
reply = _ecore_xcb_randr_13_get_resources(root);
|
||||
|
@ -3547,6 +3584,7 @@ _ecore_xcb_randr_13_output_name_get(Ecore_X_Window root,
|
|||
}
|
||||
free(reply);
|
||||
}
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -3555,6 +3593,7 @@ _ecore_xcb_randr_12_output_connection_status_get(Ecore_X_Window root,
|
|||
Ecore_X_Randr_Output output)
|
||||
{
|
||||
Ecore_X_Randr_Connection_Status ret = ECORE_X_RANDR_CONNECTION_STATUS_UNKNOWN;
|
||||
#ifdef ECORE_XCB_RANDR
|
||||
xcb_randr_get_screen_resources_reply_t *reply;
|
||||
|
||||
reply = _ecore_xcb_randr_12_get_resources(root);
|
||||
|
@ -3575,6 +3614,7 @@ _ecore_xcb_randr_12_output_connection_status_get(Ecore_X_Window root,
|
|||
}
|
||||
free(reply);
|
||||
}
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -3583,6 +3623,7 @@ _ecore_xcb_randr_13_output_connection_status_get(Ecore_X_Window root,
|
|||
Ecore_X_Randr_Output output)
|
||||
{
|
||||
Ecore_X_Randr_Connection_Status ret = ECORE_X_RANDR_CONNECTION_STATUS_UNKNOWN;
|
||||
#ifdef ECORE_XCB_RANDR
|
||||
xcb_randr_get_screen_resources_current_reply_t *reply;
|
||||
|
||||
reply = _ecore_xcb_randr_13_get_resources(root);
|
||||
|
@ -3603,6 +3644,7 @@ _ecore_xcb_randr_13_output_connection_status_get(Ecore_X_Window root,
|
|||
}
|
||||
free(reply);
|
||||
}
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -3611,6 +3653,7 @@ _ecore_xcb_randr_12_outputs_get(Ecore_X_Window root,
|
|||
int *num)
|
||||
{
|
||||
Ecore_X_Randr_Output *ret = NULL;
|
||||
#ifdef ECORE_XCB_RANDR
|
||||
xcb_randr_get_screen_resources_reply_t *reply;
|
||||
|
||||
reply = _ecore_xcb_randr_12_get_resources(root);
|
||||
|
@ -3623,6 +3666,7 @@ _ecore_xcb_randr_12_outputs_get(Ecore_X_Window root,
|
|||
sizeof(Ecore_X_Randr_Output) * reply->num_outputs);
|
||||
free(reply);
|
||||
}
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -3631,6 +3675,7 @@ _ecore_xcb_randr_13_outputs_get(Ecore_X_Window root,
|
|||
int *num)
|
||||
{
|
||||
Ecore_X_Randr_Output *ret = NULL;
|
||||
#ifdef ECORE_XCB_RANDR
|
||||
xcb_randr_get_screen_resources_current_reply_t *reply;
|
||||
|
||||
reply = _ecore_xcb_randr_13_get_resources(root);
|
||||
|
@ -3643,6 +3688,7 @@ _ecore_xcb_randr_13_outputs_get(Ecore_X_Window root,
|
|||
sizeof(Ecore_X_Randr_Output) * reply->num_outputs);
|
||||
free(reply);
|
||||
}
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -3651,6 +3697,7 @@ _ecore_xcb_randr_12_output_crtc_get(Ecore_X_Window root,
|
|||
Ecore_X_Randr_Output output)
|
||||
{
|
||||
Ecore_X_Randr_Crtc ret = Ecore_X_Randr_None;
|
||||
#ifdef ECORE_XCB_RANDR
|
||||
xcb_randr_get_screen_resources_reply_t *reply;
|
||||
|
||||
reply = _ecore_xcb_randr_12_get_resources(root);
|
||||
|
@ -3671,6 +3718,7 @@ _ecore_xcb_randr_12_output_crtc_get(Ecore_X_Window root,
|
|||
}
|
||||
free(reply);
|
||||
}
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -3679,6 +3727,7 @@ _ecore_xcb_randr_13_output_crtc_get(Ecore_X_Window root,
|
|||
Ecore_X_Randr_Output output)
|
||||
{
|
||||
Ecore_X_Randr_Crtc ret = Ecore_X_Randr_None;
|
||||
#ifdef ECORE_XCB_RANDR
|
||||
xcb_randr_get_screen_resources_current_reply_t *reply;
|
||||
|
||||
reply = _ecore_xcb_randr_13_get_resources(root);
|
||||
|
@ -3699,6 +3748,7 @@ _ecore_xcb_randr_13_output_crtc_get(Ecore_X_Window root,
|
|||
}
|
||||
free(reply);
|
||||
}
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -3731,11 +3781,13 @@ static xcb_timestamp_t
|
|||
_ecore_xcb_randr_12_get_resource_timestamp(Ecore_X_Window win)
|
||||
{
|
||||
xcb_timestamp_t stamp = 0;
|
||||
#ifdef ECORE_XCB_RANDR
|
||||
xcb_randr_get_screen_resources_reply_t *reply;
|
||||
|
||||
reply = _ecore_xcb_randr_12_get_resources(win);
|
||||
stamp = reply->config_timestamp;
|
||||
free(reply);
|
||||
#endif
|
||||
return stamp;
|
||||
}
|
||||
|
||||
|
@ -3743,11 +3795,13 @@ static xcb_timestamp_t
|
|||
_ecore_xcb_randr_13_get_resource_timestamp(Ecore_X_Window win)
|
||||
{
|
||||
xcb_timestamp_t stamp = 0;
|
||||
#ifdef ECORE_XCB_RANDR
|
||||
xcb_randr_get_screen_resources_current_reply_t *reply;
|
||||
|
||||
reply = _ecore_xcb_randr_13_get_resources(win);
|
||||
stamp = reply->config_timestamp;
|
||||
free(reply);
|
||||
#endif
|
||||
return stamp;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue