* fix warnings

* add missing guards
 * add missing QueryVersion check for the screensaver extension


SVN revision: 40207
This commit is contained in:
Vincent Torri 2009-04-19 06:36:47 +00:00
parent 864a5ff8c2
commit aaa733d25b
11 changed files with 90 additions and 5 deletions

View File

@ -2,9 +2,12 @@
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#include <string.h>
#include <X11/keysym.h>
#include "Ecore.h"
#include <Ecore.h>
#include "ecore_xcb_private.h"
#include "Ecore_X_Atoms.h"
@ -371,14 +374,33 @@ ecore_x_init(const char *name)
/*********************/
/* We ask for the QueryVersion request of the extensions */
#ifdef ECORE_XCB_DAMAGE
_ecore_x_damage_init(reply_damage);
#endif /* ECORE_XCB_DAMAGE */
#ifdef ECORE_XCB_COMPOSITE
_ecore_x_composite_init(reply_composite);
#endif /* ECORE_XCB_COMPOSITE */
#ifdef ECORE_XCB_DPMS
_ecore_x_dpms_init(reply_dpms);
#endif /* ECORE_XCB_DPMS */
#ifdef ECORE_XCB_RANDR
_ecore_x_randr_init(reply_randr);
#endif /* ECORE_XCB_RANDR */
#ifdef ECORE_XCB_SCREENSAVER
_ecore_x_screensaver_init(reply_screensaver);
#endif /* ECORE_XCB_SCREENSAVER */
#ifdef ECORE_XCB_SHAPE
_ecore_x_shape_init(reply_shape);
#endif /* ECORE_XCB_SHAPE */
#ifdef ECORE_XCB_SYNC
_ecore_x_sync_init(reply_sync);
#endif /* ECORE_XCB_SYNC */
#ifdef ECORE_XCB_FIXES
_ecore_x_xfixes_init(reply_xfixes);
#endif /* ECORE_XCB_FIXES */
#ifdef ECORE_XCB_XINERAMA
_ecore_x_xinerama_init(reply_xinerama);
#endif /* ECORE_XCB_XINERAMA */
/* we enable the Big Request extension if present */
max_request_length = xcb_get_maximum_request_length(_ecore_xcb_conn);

View File

@ -2,6 +2,8 @@
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#include <string.h>
#include "ecore_xcb_private.h"

View File

@ -2,6 +2,8 @@
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#include <string.h>
#include "Ecore.h"
#include "ecore_xcb_private.h"
#include "Ecore_X_Atoms.h"

View File

@ -9,11 +9,13 @@
* client.
*/
#include "ecore_xcb_private.h"
#include "Ecore_X_Atoms.h"
#include <string.h>
#include <xcb/xcb_icccm.h>
#include "ecore_xcb_private.h"
#include "Ecore_X_Atoms.h"
/**
* @defgroup Ecore_X_ICCCM_Group ICCCM related functions.

View File

@ -6,7 +6,11 @@
* _NET_WM... aka Extended Window Manager Hint (EWMH) functions.
*/
#include "Ecore_Data.h"
#include <stdio.h>
#include <string.h>
#include <Ecore_Data.h>
#include "ecore_xcb_private.h"
#include "Ecore_X_Atoms.h"

View File

@ -120,11 +120,13 @@ ecore_x_randr_events_select(Ecore_X_Window window,
EAPI void
ecore_x_randr_get_screen_info_prefetch(Ecore_X_Window window)
{
#ifdef ECORE_XCB_RANDR
xcb_randr_get_screen_info_cookie_t cookie;
cookie = xcb_randr_get_screen_info_unchecked(_ecore_xcb_conn,
_xcb_randr_root_to_screen(window));
_ecore_xcb_cookie_cache(cookie.sequence);
#endif /* ECORE_XCB_RANDR */
}
@ -135,12 +137,14 @@ ecore_x_randr_get_screen_info_prefetch(Ecore_X_Window window)
EAPI void
ecore_x_randr_get_screen_info_fetch(void)
{
#ifdef ECORE_XCB_RANDR
xcb_randr_get_screen_info_cookie_t cookie;
xcb_randr_get_screen_info_reply_t *reply;
cookie.sequence = _ecore_xcb_cookie_get();
reply =xcb_randr_get_screen_info_reply(_ecore_xcb_conn, cookie, NULL);
_ecore_xcb_reply_cache(reply);
#endif /* ECORE_XCB_RANDR */
}
/**

View File

@ -12,6 +12,46 @@
*/
#ifdef ECORE_XCB_SCREENSAVER
static int _screensaver_available = 0;
static xcb_screensaver_query_version_cookie_t _ecore_xcb_screensaver_init_cookie;
#endif /* ECORE_XCB_SCREENSAVER */
/* To avoid round trips, the initialization is separated in 2
functions: _ecore_xcb_screensaver_init and
_ecore_xcb_screensaver_init_finalize. The first one gets the cookies and
the second one gets the replies and set the atoms. */
void
_ecore_x_screensaver_init(const xcb_query_extension_reply_t *reply)
{
#ifdef ECORE_XCB_SCREENSAVER
if (reply && (reply->present))
_ecore_xcb_screensaver_init_cookie = xcb_screensaver_query_version_unchecked(_ecore_xcb_conn, 1, 1);
#endif /* ECORE_XCB_SCREENSAVER */
}
void
_ecore_x_screensaver_init_finalize(void)
{
#ifdef ECORE_XCB_SCREENSAVER
xcb_screensaver_query_version_reply_t *reply;
reply = xcb_screensaver_query_version_reply(_ecore_xcb_conn,
_ecore_xcb_screensaver_init_cookie, NULL);
if (reply)
{
if ((reply->server_major_version >= 1) &&
(reply->server_minor_version >= 1))
_screensaver_available = 1;
free(reply);
}
#endif /* ECORE_XCB_SCREENSAVER */
}
/**
* Return whether the X server supports the ScreenSaver Extension.
* @return 1 if the X ScreenSaver Extension is available, 0 otherwise.

View File

@ -2,6 +2,8 @@
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#include <string.h>
#include "ecore_xcb_private.h"
#include "Ecore_X_Atoms.h"

View File

@ -178,6 +178,7 @@ ecore_x_window_shape_rectangle_clip(Ecore_X_Window dest_win,
int width,
int height)
{
#ifdef ECORE_XCB_SHAPE
xcb_rectangle_t rect;
rect.x = x;
@ -187,6 +188,7 @@ ecore_x_window_shape_rectangle_clip(Ecore_X_Window dest_win,
xcb_shape_rectangles(_ecore_xcb_conn,
XCB_SHAPE_SO_INTERSECT, XCB_SHAPE_SK_BOUNDING,
0, dest_win, 0, 0, 1, &rect);
#endif /* ECORE_XCB_SHAPE */
}
EAPI void

View File

@ -2,7 +2,10 @@
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#include "Ecore.h"
#include <string.h>
#include <Ecore.h>
#include "ecore_xcb_private.h"
#include "Ecore_X_Atoms.h"

View File

@ -2,6 +2,8 @@
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#include <string.h>
#include "ecore_xcb_private.h"
#include "Ecore_X_Atoms.h"