Ecore_X(cb): Add macro to check for validity of the xcb_connection
authordevilhorns <devilhorns@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 20 Sep 2011 09:12:02 +0000 (09:12 +0000)
committerdevilhorns <devilhorns@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 20 Sep 2011 09:12:02 +0000 (09:12 +0000)
before trying to use it.

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/ecore@63494 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

34 files changed:
src/lib/ecore_x/xcb/ecore_xcb.c
src/lib/ecore_x/xcb/ecore_xcb_atoms.c
src/lib/ecore_x/xcb/ecore_xcb_composite.c
src/lib/ecore_x/xcb/ecore_xcb_cursor.c
src/lib/ecore_x/xcb/ecore_xcb_damage.c
src/lib/ecore_x/xcb/ecore_xcb_dnd.c
src/lib/ecore_x/xcb/ecore_xcb_dpms.c
src/lib/ecore_x/xcb/ecore_xcb_drawable.c
src/lib/ecore_x/xcb/ecore_xcb_e.c
src/lib/ecore_x/xcb/ecore_xcb_error.c
src/lib/ecore_x/xcb/ecore_xcb_events.c
src/lib/ecore_x/xcb/ecore_xcb_gc.c
src/lib/ecore_x/xcb/ecore_xcb_icccm.c
src/lib/ecore_x/xcb/ecore_xcb_image.c
src/lib/ecore_x/xcb/ecore_xcb_input.c
src/lib/ecore_x/xcb/ecore_xcb_keymap.c
src/lib/ecore_x/xcb/ecore_xcb_mwm.c
src/lib/ecore_x/xcb/ecore_xcb_netwm.c
src/lib/ecore_x/xcb/ecore_xcb_pixmap.c
src/lib/ecore_x/xcb/ecore_xcb_private.h
src/lib/ecore_x/xcb/ecore_xcb_randr.c
src/lib/ecore_x/xcb/ecore_xcb_region.c
src/lib/ecore_x/xcb/ecore_xcb_render.c
src/lib/ecore_x/xcb/ecore_xcb_screensaver.c
src/lib/ecore_x/xcb/ecore_xcb_selection.c
src/lib/ecore_x/xcb/ecore_xcb_sync.c
src/lib/ecore_x/xcb/ecore_xcb_vsync.c
src/lib/ecore_x/xcb/ecore_xcb_window.c
src/lib/ecore_x/xcb/ecore_xcb_window_prop.c
src/lib/ecore_x/xcb/ecore_xcb_window_shadow.c
src/lib/ecore_x/xcb/ecore_xcb_window_shape.c
src/lib/ecore_x/xcb/ecore_xcb_xfixes.c
src/lib/ecore_x/xcb/ecore_xcb_xinerama.c
src/lib/ecore_x/xcb/ecore_xcb_xtest.c

index 5380e98..4054c19 100644 (file)
@@ -331,6 +331,7 @@ ecore_x_flush(void)
 {
 //   LOGFN(__FILE__, __LINE__, __FUNCTION__);
 
+   CHECK_XCB_CONN;
    xcb_flush(_ecore_xcb_conn);
 }
 
@@ -352,6 +353,7 @@ ecore_x_connection_get(void)
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
 
+   CHECK_XCB_CONN;
    return (Ecore_X_Connection *)_ecore_xcb_conn;
 }
 
@@ -374,6 +376,7 @@ ecore_x_sync(void)
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
 
+   CHECK_XCB_CONN;
    free(xcb_get_input_focus_reply(_ecore_xcb_conn, 
                                   xcb_get_input_focus_unchecked(_ecore_xcb_conn), 
                                   NULL));
@@ -384,6 +387,7 @@ ecore_x_grab(void)
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
 
+   CHECK_XCB_CONN;
    _ecore_xcb_grab_count++;
    if (_ecore_xcb_grab_count == 1) 
      xcb_grab_server(_ecore_xcb_conn);
@@ -394,6 +398,7 @@ ecore_x_ungrab(void)
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
 
+   CHECK_XCB_CONN;
    _ecore_xcb_grab_count--;
    if (_ecore_xcb_grab_count < 0) _ecore_xcb_grab_count = 0;
    if (_ecore_xcb_grab_count == 0) 
@@ -421,6 +426,7 @@ ecore_x_client_message32_send(Ecore_X_Window win, Ecore_X_Atom type, Ecore_X_Eve
    xcb_generic_error_t *err;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    memset(&ev, 0, sizeof(xcb_client_message_event_t));
 
@@ -468,6 +474,7 @@ ecore_x_client_message8_send(Ecore_X_Window win, Ecore_X_Atom type, const void *
    xcb_generic_error_t *err;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    memset(&ev, 0, sizeof(xcb_client_message_event_t));
 
@@ -507,6 +514,7 @@ ecore_x_mouse_down_send(Ecore_X_Window win, int x, int y, int b)
    Ecore_X_Window root = 0;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    root = ecore_x_window_root_get(win);
    cookie = xcb_translate_coordinates(_ecore_xcb_conn, win, root, x, y);
@@ -554,6 +562,7 @@ ecore_x_mouse_up_send(Ecore_X_Window win, int x, int y, int b)
    Ecore_X_Window root = 0;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    root = ecore_x_window_root_get(win);
    cookie = xcb_translate_coordinates(_ecore_xcb_conn, win, root, x, y);
@@ -601,6 +610,7 @@ ecore_x_mouse_move_send(Ecore_X_Window win, int x, int y)
    Ecore_X_Window root = 0;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    root = ecore_x_window_root_get(win);
    cookie = xcb_translate_coordinates(_ecore_xcb_conn, win, root, x, y);
@@ -644,6 +654,7 @@ ecore_x_keyboard_grab(Ecore_X_Window win)
    xcb_grab_keyboard_reply_t *reply;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    cookie = 
      xcb_grab_keyboard_unchecked(_ecore_xcb_conn, 0, win, XCB_CURRENT_TIME, 
@@ -658,6 +669,7 @@ EAPI void
 ecore_x_keyboard_ungrab(void) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    xcb_ungrab_keyboard(_ecore_xcb_conn, XCB_CURRENT_TIME);
 }
@@ -669,6 +681,7 @@ ecore_x_pointer_xy_get(Ecore_X_Window win, int *x, int *y)
    xcb_query_pointer_reply_t *reply;
 
 //   LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
 //   if (!win) win = ((xcb_screen_t *)_ecore_xcb_screen)->root;
 
@@ -690,6 +703,7 @@ ecore_x_pointer_control_set(int accel_num, int accel_denom, int threshold)
    xcb_generic_error_t *err;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    vcookie = 
      xcb_change_pointer_control(_ecore_xcb_conn, 
@@ -712,6 +726,7 @@ ecore_x_pointer_control_get(int *accel_num, int *accel_denom, int *threshold)
    xcb_get_pointer_control_reply_t *reply;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (accel_num) *accel_num = 0;
    if (accel_denom) *accel_denom = 0;
@@ -737,6 +752,7 @@ ecore_x_pointer_mapping_set(unsigned char *map, int nmap)
    Eina_Bool ret = EINA_FALSE;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    cookie = xcb_set_pointer_mapping_unchecked(_ecore_xcb_conn, nmap, map);
    reply = xcb_set_pointer_mapping_reply(_ecore_xcb_conn, cookie, NULL);
@@ -755,6 +771,7 @@ ecore_x_pointer_mapping_get(unsigned char *map, int nmap)
    xcb_get_pointer_mapping_reply_t *reply;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (map) *map = 0;
    nmap = 0;
@@ -793,6 +810,7 @@ ecore_x_pointer_grab(Ecore_X_Window win)
    Eina_Bool ret = EINA_FALSE;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    mask = (XCB_EVENT_MASK_BUTTON_PRESS | XCB_EVENT_MASK_BUTTON_RELEASE | 
            XCB_EVENT_MASK_ENTER_WINDOW | XCB_EVENT_MASK_LEAVE_WINDOW | 
@@ -820,6 +838,7 @@ ecore_x_pointer_confine_grab(Ecore_X_Window win)
    Eina_Bool ret = EINA_FALSE;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    mask = (XCB_EVENT_MASK_BUTTON_PRESS | XCB_EVENT_MASK_BUTTON_RELEASE | 
            XCB_EVENT_MASK_ENTER_WINDOW | XCB_EVENT_MASK_LEAVE_WINDOW | 
@@ -842,6 +861,7 @@ EAPI void
 ecore_x_pointer_ungrab(void) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    xcb_ungrab_pointer(_ecore_xcb_conn, XCB_CURRENT_TIME);
 }
@@ -853,6 +873,7 @@ ecore_x_pointer_warp(Ecore_X_Window win, int x, int y)
    xcb_generic_error_t *err;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    vcookie = 
      xcb_warp_pointer_checked(_ecore_xcb_conn, XCB_NONE, win, 0, 0, 0, 0, x, y);
@@ -885,6 +906,8 @@ ecore_x_bell(int percent)
    xcb_void_cookie_t cookie;
    xcb_generic_error_t *err;
 
+   CHECK_XCB_CONN;
+
    // FIXME: Use unchecked version after development is ironed out
    cookie = xcb_bell_checked(_ecore_xcb_conn, percent);
    err = xcb_request_check(_ecore_xcb_conn, cookie);
@@ -904,6 +927,7 @@ ecore_x_display_size_get(Ecore_X_Display *dsp __UNUSED__, int *w, int *h)
    xcb_screen_t *screen;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    /* grab the default screen */
    screen = xcb_setup_roots_iterator(xcb_get_setup(_ecore_xcb_conn)).data;
@@ -917,6 +941,7 @@ ecore_x_display_black_pixel_get(Ecore_X_Display *dsp __UNUSED__)
    xcb_screen_t *screen;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    /* grab the default screen */
    screen = xcb_setup_roots_iterator(xcb_get_setup(_ecore_xcb_conn)).data;
@@ -929,6 +954,7 @@ ecore_x_display_white_pixel_get(Ecore_X_Display *dsp __UNUSED__)
    xcb_screen_t *screen;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    /* grab the default screen */
    screen = xcb_setup_roots_iterator(xcb_get_setup(_ecore_xcb_conn)).data;
@@ -948,6 +974,7 @@ EAPI void
 ecore_x_focus_reset(void) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    xcb_set_input_focus(_ecore_xcb_conn, XCB_INPUT_FOCUS_POINTER_ROOT, 
                        ((xcb_screen_t *)_ecore_xcb_screen)->root, 
@@ -959,6 +986,7 @@ EAPI void
 ecore_x_events_allow_all(void) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    xcb_allow_events(_ecore_xcb_conn, XCB_ALLOW_ASYNC_BOTH, XCB_CURRENT_TIME);
 //   ecore_x_flush();
@@ -975,6 +1003,7 @@ EAPI void
 ecore_x_kill(Ecore_X_Window win) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    xcb_kill_client(_ecore_xcb_conn, win);
 //   ecore_x_flush();
@@ -995,6 +1024,7 @@ ecore_x_killall(Ecore_X_Window root)
    int screens = 0, i = 0;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    ecore_x_grab();
 
@@ -1064,6 +1094,8 @@ ecore_x_display_get(void)
 {
    char *gl = NULL;
 
+   CHECK_XCB_CONN;
+
    /* if we have the 'dont use xlib' env var, then we are not using 
     * XLib and thus cannot return a real XDisplay.
     * 
@@ -1083,6 +1115,7 @@ EAPI int
 ecore_x_fd_get(void) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
    return xcb_get_file_descriptor(_ecore_xcb_conn);
 }
 
@@ -1131,12 +1164,8 @@ EAPI int
 ecore_x_screen_count_get(void) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
-   if (xcb_connection_has_error(_ecore_xcb_conn)) 
-     {
-        DBG("XCB Connection Has Error !!!");
-        return 0;
-     }
    return xcb_setup_roots_length(xcb_get_setup(_ecore_xcb_conn));
 }
 
@@ -1154,6 +1183,8 @@ ecore_x_screen_index_get(const Ecore_X_Screen *screen)
    xcb_screen_iterator_t iter;
    int i = 0;
 
+   CHECK_XCB_CONN;
+
    iter = 
      xcb_setup_roots_iterator(xcb_get_setup(_ecore_xcb_conn));
    for (; iter.rem; xcb_screen_next(&iter)) 
@@ -1179,6 +1210,8 @@ ecore_x_screen_get(int index)
 {
    xcb_screen_iterator_t iter;
 
+   CHECK_XCB_CONN;
+
    iter = 
      xcb_setup_roots_iterator(xcb_get_setup(_ecore_xcb_conn));
    for (; iter.rem; xcb_screen_next(&iter)) 
@@ -1212,6 +1245,8 @@ ecore_x_default_visual_get(Ecore_X_Display *disp __UNUSED__, Ecore_X_Screen *scr
    xcb_depth_iterator_t diter;
    xcb_visualtype_iterator_t viter;
 
+   CHECK_XCB_CONN;
+
    s = (xcb_screen_t *)screen;
    diter = xcb_screen_allowed_depths_iterator(s);
    for (; diter.rem; xcb_depth_next(&diter)) 
@@ -1304,6 +1339,7 @@ _ecore_xcb_shutdown(Eina_Bool close_display)
      return _ecore_xcb_init_count;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    ecore_idle_enterer_del(_ecore_xcb_idle_enterer);
    _ecore_xcb_idle_enterer = NULL;
@@ -1458,6 +1494,8 @@ _ecore_xcb_fd_handle_buff(void *data, Ecore_Fd_Handler *hdlr __UNUSED__)
 static Eina_Bool 
 _ecore_xcb_idle_enter(void *data __UNUSED__) 
 {
+   CHECK_XCB_CONN;
+
    xcb_flush(_ecore_xcb_conn);
    return ECORE_CALLBACK_RENEW;
 }
index b44e9d3..26fda8a 100644 (file)
@@ -268,6 +268,7 @@ _ecore_xcb_atoms_init(void)
    int i = 0, num = 0;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    num = (sizeof(atoms) / sizeof(Xcb_Atom));
    for (i = 0; i < num; i++)  
@@ -284,6 +285,7 @@ _ecore_xcb_atoms_finalize(void)
    int i = 0, num = 0;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    num = (sizeof(atoms) / sizeof(Xcb_Atom));
    for (i = 0; i < num; i++) 
@@ -328,6 +330,7 @@ ecore_x_atom_get(const char *name)
    Ecore_X_Atom a;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    cookie = xcb_intern_atom_unchecked(_ecore_xcb_conn, 0, strlen(name), name);
    reply = xcb_intern_atom_reply(_ecore_xcb_conn, cookie, NULL);
@@ -354,6 +357,7 @@ ecore_x_atom_name_get(Ecore_X_Atom atom)
    int len = 0;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    cookie = xcb_get_atom_name_unchecked(_ecore_xcb_conn, atom);
    reply = xcb_get_atom_name_reply(_ecore_xcb_conn, cookie, NULL);
@@ -379,6 +383,7 @@ ecore_x_atoms_get(const char **names, int num, Ecore_X_Atom *atoms)
    int i = 0;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    for (i = 0; i < num; i++) 
      {
index 1894e0b..0f66b24 100644 (file)
@@ -84,6 +84,7 @@ EAPI void
 ecore_x_composite_redirect_window(Ecore_X_Window win, Ecore_X_Composite_Update_Type type) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_composite_avail) return;
 
@@ -108,6 +109,7 @@ EAPI void
 ecore_x_composite_redirect_subwindows(Ecore_X_Window win, Ecore_X_Composite_Update_Type type) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_composite_avail) return;
 
@@ -132,6 +134,7 @@ EAPI void
 ecore_x_composite_unredirect_window(Ecore_X_Window win, Ecore_X_Composite_Update_Type type) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_composite_avail) return;
 
@@ -156,6 +159,7 @@ EAPI void
 ecore_x_composite_unredirect_subwindows(Ecore_X_Window win, Ecore_X_Composite_Update_Type type) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_composite_avail) return;
 
@@ -184,6 +188,7 @@ ecore_x_composite_name_window_pixmap_get(Ecore_X_Window win)
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_composite_avail) return XCB_NONE;
 
@@ -200,6 +205,7 @@ EAPI void
 ecore_x_composite_window_events_disable(Ecore_X_Window win) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_composite_avail) return;
 
@@ -216,6 +222,7 @@ EAPI void
 ecore_x_composite_window_events_enable(Ecore_X_Window win) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_composite_avail) return;
 
@@ -238,6 +245,7 @@ ecore_x_composite_render_window_enable(Ecore_X_Window root)
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_composite_avail) return 0;
 
@@ -261,6 +269,7 @@ EAPI void
 ecore_x_composite_render_window_disable(Ecore_X_Window win) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_composite_avail) return;
 
index 676160b..06654d7 100644 (file)
@@ -75,6 +75,7 @@ ecore_x_cursor_new(Ecore_X_Window win, int *pixels, int w, int h, int hot_x, int
    xcb_image_t *img;
 
 //   LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
 #ifdef ECORE_XCB_CURSOR
    if (_ecore_xcb_cursor) 
@@ -231,6 +232,7 @@ EAPI void
 ecore_x_cursor_free(Ecore_X_Cursor c) 
 {
 //   LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    xcb_free_cursor(_ecore_xcb_conn, c);
 }
@@ -247,6 +249,7 @@ ecore_x_cursor_shape_get(int shape)
    xcb_font_t font;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    font = xcb_generate_id(_ecore_xcb_conn);
    xcb_open_font(_ecore_xcb_conn, font, strlen("cursor"), "cursor");
@@ -285,6 +288,8 @@ _ecore_xcb_cursor_format_get(void)
    const xcb_render_query_pict_formats_reply_t *reply;
    xcb_render_pictforminfo_t *ret = NULL;
 
+   CHECK_XCB_CONN;
+
    reply = xcb_render_util_query_formats(_ecore_xcb_conn);
    if (reply) 
      ret = xcb_render_util_find_standard_format(reply, 
@@ -349,6 +354,8 @@ _ecore_xcb_cursor_image_load_cursor(xcb_image_t *img, int hot_x, int hot_y)
    xcb_pixmap_t pmap;
    xcb_render_picture_t pict;
 
+   CHECK_XCB_CONN;
+
    pmap = xcb_generate_id(_ecore_xcb_conn);
    xcb_create_pixmap(_ecore_xcb_conn, img->depth, pmap, 
                      ((xcb_screen_t *)_ecore_xcb_screen)->root, 
@@ -376,5 +383,6 @@ _ecore_xcb_cursor_image_load_cursor(xcb_image_t *img, int hot_x, int hot_y)
 static void 
 _ecore_xcb_cursor_image_destroy(xcb_image_t *img) 
 {
+   CHECK_XCB_CONN;
    if (img) xcb_image_destroy(img);
 }
index 6e96120..84870a8 100644 (file)
@@ -82,6 +82,7 @@ ecore_x_damage_new(Ecore_X_Drawable drawable, Ecore_X_Damage_Report_Level level)
    Ecore_X_Damage damage = 0;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_damage_avail) return 0;
 
@@ -107,6 +108,7 @@ EAPI void
 ecore_x_damage_free(Ecore_X_Damage damage) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_damage_avail) return;
 
@@ -138,6 +140,7 @@ EAPI void
 ecore_x_damage_subtract(Ecore_X_Damage damage, Ecore_X_Region repair, Ecore_X_Region parts) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_damage_avail) return;
 
index 1cf12b5..7b313b8 100644 (file)
@@ -87,6 +87,7 @@ ecore_x_dnd_send_status(Eina_Bool will_accept, Eina_Bool suppress, Ecore_X_Recta
    xcb_client_message_event_t ev;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (_target->state == ECORE_X_DND_TARGET_IDLE) return;
 
@@ -128,6 +129,7 @@ ecore_x_dnd_drop(void)
    Eina_Bool status = EINA_FALSE;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    memset(&ev, 0, sizeof(xcb_client_message_event_t));
 
@@ -258,6 +260,7 @@ ecore_x_dnd_type_isset(Ecore_X_Window win, const char *type)
    Ecore_X_Atom *atoms, atom;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!ecore_x_window_prop_property_get(win, ECORE_X_ATOM_XDND_TYPE_LIST, 
                                          ECORE_X_ATOM_ATOM, 32, &data, &num))
@@ -286,6 +289,7 @@ ecore_x_dnd_type_set(Ecore_X_Window win, const char *type, Eina_Bool on)
    unsigned char *data = NULL, *old_data = NULL;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    atom = ecore_x_atom_get(type);
    ecore_x_window_prop_property_get(win, ECORE_X_ATOM_XDND_TYPE_LIST, 
@@ -339,6 +343,7 @@ ecore_x_dnd_types_set(Ecore_X_Window win, const char **types, unsigned int num_t
    unsigned char *data = NULL;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!num_types)
       ecore_x_window_prop_property_del(win, ECORE_X_ATOM_XDND_TYPE_LIST);
@@ -368,6 +373,7 @@ ecore_x_dnd_actions_set(Ecore_X_Window win, Ecore_X_Atom *actions, unsigned int
    unsigned char *data = NULL;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!num_actions)
       ecore_x_window_prop_property_del(win, ECORE_X_ATOM_XDND_ACTION_LIST);
@@ -444,6 +450,7 @@ ecore_x_dnd_send_finished(void)
    xcb_client_message_event_t ev;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (_target->state == ECORE_X_DND_TARGET_IDLE) return;
 
@@ -502,6 +509,7 @@ _ecore_xcb_dnd_drag(Ecore_X_Window root, int x, int y)
    if (_source->state != ECORE_X_DND_SOURCE_DRAGGING) return;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    memset(&ev, 0, sizeof(xcb_client_message_event_t));
 
index 79760bc..fb5a330 100644 (file)
@@ -87,6 +87,7 @@ ecore_x_dpms_capable_get(void)
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_dpms_avail) return EINA_FALSE;
 
@@ -118,6 +119,7 @@ ecore_x_dpms_enabled_get(void)
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_dpms_avail) return EINA_FALSE;
 
@@ -141,6 +143,7 @@ EAPI void
 ecore_x_dpms_enabled_set(int enabled) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_dpms_avail) return;
 
@@ -168,6 +171,7 @@ ecore_x_dpms_timeouts_get(unsigned int *standby, unsigned int *suspend, unsigned
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (standby) *standby = 0;
    if (suspend) *suspend = 0;
@@ -197,6 +201,7 @@ EAPI Eina_Bool
 ecore_x_dpms_timeouts_set(unsigned int standby, unsigned int suspend, unsigned int off) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_dpms_avail) return EINA_FALSE;
 
index 9487699..6ea235b 100644 (file)
@@ -21,6 +21,7 @@ ecore_x_drawable_rectangle_fill(Ecore_X_Drawable draw, Ecore_X_GC gc, int x, int
    xcb_rectangle_t rect;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    rect.x = x;
    rect.y = y;
@@ -47,6 +48,7 @@ ecore_x_drawable_geometry_get(Ecore_X_Drawable draw, int *x, int *y, int *w, int
    xcb_get_geometry_reply_t *reply;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (x) *x = 0;
    if (y) *y = 0;
@@ -76,6 +78,7 @@ ecore_x_drawable_border_width_get(Ecore_X_Drawable d)
    int ret = 0;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    cookie = xcb_get_geometry_unchecked(_ecore_xcb_conn, d);
    reply = xcb_get_geometry_reply(_ecore_xcb_conn, cookie, NULL);
@@ -99,6 +102,7 @@ ecore_x_drawable_depth_get(Ecore_X_Drawable d)
    int ret = 0;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    cookie = xcb_get_geometry_unchecked(_ecore_xcb_conn, d);
    reply = xcb_get_geometry_reply(_ecore_xcb_conn, cookie, NULL);
index f31e184..5b9162d 100644 (file)
@@ -20,6 +20,7 @@ ecore_x_e_comp_sync_draw_done_send(Ecore_X_Window root, Ecore_X_Window win)
    xcb_client_message_event_t ev;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!root) root = ((xcb_screen_t *)_ecore_xcb_screen)->root;
 
@@ -47,6 +48,7 @@ ecore_x_e_comp_sync_draw_size_done_send(Ecore_X_Window root, Ecore_X_Window win,
    xcb_client_message_event_t ev;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!root) root = ((xcb_screen_t *)_ecore_xcb_screen)->root;
 
@@ -155,6 +157,7 @@ ecore_x_e_comp_sync_begin_send(Ecore_X_Window win)
    xcb_client_message_event_t ev;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    memset(&ev, 0, sizeof(xcb_client_message_event_t));
 
@@ -179,6 +182,7 @@ ecore_x_e_comp_sync_end_send(Ecore_X_Window win)
    xcb_client_message_event_t ev;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    memset(&ev, 0, sizeof(xcb_client_message_event_t));
 
@@ -203,6 +207,7 @@ ecore_x_e_comp_sync_cancel_send(Ecore_X_Window win)
    xcb_client_message_event_t ev;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    memset(&ev, 0, sizeof(xcb_client_message_event_t));
 
@@ -227,6 +232,7 @@ ecore_x_e_comp_flush_send(Ecore_X_Window win)
    xcb_client_message_event_t ev;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    memset(&ev, 0, sizeof(xcb_client_message_event_t));
 
@@ -251,6 +257,7 @@ ecore_x_e_comp_dump_send(Ecore_X_Window win)
    xcb_client_message_event_t ev;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    memset(&ev, 0, sizeof(xcb_client_message_event_t));
 
index f5a457e..0afd8b2 100644 (file)
@@ -92,8 +92,11 @@ int
 _ecore_xcb_io_error_handle(xcb_generic_error_t *err) 
 {
    CRIT("IO Error:");
-   CRIT("\tRequest: %d", err->sequence);
-   CRIT("\tCode: %d", err->error_code);
+   if (err) 
+     {
+        CRIT("\tRequest: %d", err->sequence);
+        CRIT("\tCode: %d", err->error_code);
+     }
    if (_io_error_func)
      _io_error_func(_io_error_data);
    else
index 44c4ed1..3510f0b 100644 (file)
@@ -238,6 +238,7 @@ _ecore_xcb_events_handle(xcb_generic_event_t *ev)
    uint8_t response = 0;
 
 //   LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    /* strip highest bit (set if event is generated) */
    response = (ev->response_type & ~0x80);
@@ -436,6 +437,7 @@ ecore_x_event_mask_set(Ecore_X_Window win, Ecore_X_Event_Mask mask)
    uint32_t list;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!win) win = ((xcb_screen_t *)_ecore_xcb_screen)->root;
    cookie = xcb_get_window_attributes_unchecked(_ecore_xcb_conn, win);
@@ -457,6 +459,7 @@ ecore_x_event_mask_unset(Ecore_X_Window win, Ecore_X_Event_Mask mask)
    uint32_t list;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!win) win = ((xcb_screen_t *)_ecore_xcb_screen)->root;
    cookie = xcb_get_window_attributes_unchecked(_ecore_xcb_conn, win);
@@ -1639,6 +1642,8 @@ _ecore_xcb_event_handle_client_message(xcb_generic_event_t *event)
         e->event_win = ev->data.data32[2];
         ecore_event_add(ECORE_X_EVENT_PING, e, NULL, NULL);
 
+        CHECK_XCB_CONN;
+
         count = xcb_setup_roots_length(xcb_get_setup(_ecore_xcb_conn));
         if (count > 1) 
           root = ecore_x_window_root_get(e->win);
index accc662..ae52e6f 100644 (file)
@@ -18,6 +18,7 @@ ecore_x_gc_new(Ecore_X_Drawable drawable, Ecore_X_GC_Value_Mask value_mask, cons
    int i = 0, mask = 0;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!drawable) drawable = ((xcb_screen_t *)_ecore_xcb_screen)->root;
 
@@ -112,6 +113,7 @@ EAPI void
 ecore_x_gc_free(Ecore_X_GC gc) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    xcb_free_gc(_ecore_xcb_conn, gc);
 //   ecore_x_flush();
@@ -123,6 +125,7 @@ ecore_x_gc_foreground_set(Ecore_X_GC gc, unsigned long foreground)
    uint32_t list;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    list = foreground;
    xcb_change_gc(_ecore_xcb_conn, gc, XCB_GC_FOREGROUND, &list);
@@ -135,6 +138,7 @@ ecore_x_gc_background_set(Ecore_X_GC gc, unsigned long background)
    uint32_t list;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    list = background;
    xcb_change_gc(_ecore_xcb_conn, gc, XCB_GC_BACKGROUND, &list);
index f672c3d..d61e91c 100644 (file)
@@ -22,6 +22,7 @@ ecore_x_icccm_command_set(Ecore_X_Window win, int argc, char **argv)
    int nbytes, i;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    for (i = 0, nbytes = 0; i < argc; i++)
      nbytes += strlen(argv[i]) + 1;
@@ -65,6 +66,7 @@ ecore_x_icccm_command_get(Ecore_X_Window win, int *argc, char ***argv)
    int c = 0, i = 0, j = 0;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (argc) *argc = 0;
    if (argv) *argv = NULL;
@@ -170,6 +172,7 @@ ecore_x_icccm_title_get(Ecore_X_Window win)
    char *title = NULL;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!win) return NULL;
 #ifdef OLD_XCB_VERSION
@@ -242,6 +245,7 @@ ecore_x_icccm_title_set(Ecore_X_Window win, const char *title)
    Eina_Bool ret = EINA_FALSE;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!title) return;
 
@@ -298,6 +302,7 @@ ecore_x_icccm_name_class_get(Ecore_X_Window win, char **name, char **class)
    uint8_t ret = 0;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (name) *name = NULL;
    if (class) *class = NULL;
@@ -336,6 +341,7 @@ ecore_x_icccm_name_class_set(Ecore_X_Window win, const char *name, const char *c
    int length_name, length_class;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    length_name = strlen(name);
    length_class = strlen(class);
@@ -372,6 +378,7 @@ EAPI void
 ecore_x_icccm_transient_for_set(Ecore_X_Window win, Ecore_X_Window forwindow) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    xcb_change_property(_ecore_xcb_conn, XCB_PROP_MODE_REPLACE, win, 
                        ECORE_X_ATOM_WM_TRANSIENT_FOR, ECORE_X_ATOM_WINDOW, 32, 
@@ -402,6 +409,7 @@ ecore_x_icccm_transient_for_get(Ecore_X_Window win)
    xcb_get_property_cookie_t cookie;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
 #ifdef OLD_XCB_VERSION
    cookie = xcb_get_wm_transient_for_unchecked(_ecore_xcb_conn, win);
@@ -485,6 +493,7 @@ ecore_x_icccm_state_get(Ecore_X_Window win)
    uint8_t *prop;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    cookie = 
      xcb_get_property_unchecked(_ecore_xcb_conn, 0, win, 
@@ -545,6 +554,7 @@ ecore_x_icccm_state_set(Ecore_X_Window win, Ecore_X_Window_State_Hint state)
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
 #ifdef OLD_XCB_VERSION
    xcb_wm_hints_set_none(&hints);
@@ -595,6 +605,7 @@ ecore_x_icccm_hints_set(Ecore_X_Window win, Eina_Bool accepts_focus, Ecore_X_Win
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
 #ifdef OLD_XCB_VERSION
    xcb_wm_hints_set_none(&hints);
@@ -652,6 +663,7 @@ ecore_x_icccm_hints_get(Ecore_X_Window win, Eina_Bool *accepts_focus, Ecore_X_Wi
    uint8_t ret = 0;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (accepts_focus) *accepts_focus = EINA_TRUE;
    if (initial_state) *initial_state = ECORE_X_WINDOW_STATE_HINT_NORMAL;
@@ -759,6 +771,7 @@ ecore_x_icccm_icon_name_get(Ecore_X_Window win)
    char *tmp = NULL;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!win) return NULL;
 
@@ -840,6 +853,7 @@ ecore_x_icccm_icon_name_set(Ecore_X_Window win, const char *name)
    Eina_Bool ret = EINA_FALSE;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if ((!win) || (!name)) return;
 
@@ -883,6 +897,7 @@ ecore_x_icccm_iconic_request_send(Ecore_X_Window win, Ecore_X_Window root)
    xcb_client_message_event_t ev;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!win) return;
    if (!root) root = ((xcb_screen_t *)_ecore_xcb_screen)->root;
@@ -925,6 +940,7 @@ ecore_x_icccm_protocol_set(Ecore_X_Window win, Ecore_X_WM_Protocol protocol, Ein
    int i = 0, count = 0, set = 0;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (protocol >= ECORE_X_WM_PROTOCOL_NUM) return;
    proto = _ecore_xcb_atoms_wm_protocol[protocol];
@@ -1033,6 +1049,7 @@ ecore_x_icccm_protocol_isset(Ecore_X_Window win, Ecore_X_WM_Protocol protocol)
    unsigned int i = 0;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (protocol >= ECORE_X_WM_PROTOCOL_NUM) return EINA_FALSE;
 
@@ -1072,6 +1089,7 @@ EAPI void
 ecore_x_icccm_protocol_atoms_set(Ecore_X_Window win, Ecore_X_Atom *protos, int num) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (num > 0) 
 #ifdef OLD_XCB_VERSION
@@ -1099,6 +1117,7 @@ ecore_x_icccm_size_pos_hints_get(Ecore_X_Window win, Eina_Bool *request_pos, Eco
    double mina = 0.0, maxa = 0.0;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (request_pos) *request_pos = EINA_FALSE;
    if (gravity) *gravity = ECORE_X_GRAVITY_NW;
@@ -1224,6 +1243,7 @@ ecore_x_icccm_size_pos_hints_set(Ecore_X_Window win, Eina_Bool request_pos, Ecor
    uint8_t ret = 0;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
 #ifdef OLD_XCB_VERSION
    cookie = xcb_get_wm_normal_hints_unchecked(_ecore_xcb_conn, win);
@@ -1286,6 +1306,7 @@ ecore_x_icccm_move_resize_send(Ecore_X_Window win, int x, int y, int w, int h)
    xcb_configure_notify_event_t ev;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!win) return;
 
@@ -1327,6 +1348,7 @@ ecore_x_icccm_client_machine_get(Ecore_X_Window win)
    char *tmp = NULL;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
 #ifdef OLD_XCB_VERSION
    cookie = xcb_get_wm_client_machine_unchecked(_ecore_xcb_conn, win);
index 776f717..afec5f1 100644 (file)
@@ -44,6 +44,7 @@ EAPI void
 ecore_x_image_free(Ecore_X_Image *im) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!im) return;
    if (im->shm) 
@@ -73,6 +74,7 @@ ecore_x_image_get(Ecore_X_Image *im, Ecore_X_Drawable draw, int x, int y, int sx
    Eina_Bool ret = EINA_TRUE;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (im->shm) 
      {
@@ -182,6 +184,7 @@ ecore_x_image_put(Ecore_X_Image *im, Ecore_X_Drawable draw, Ecore_X_GC gc, int x
    Ecore_X_GC tgc = 0;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!gc) 
      {
@@ -218,6 +221,7 @@ ecore_x_image_is_argb32_get(Ecore_X_Image *im)
    xcb_visualtype_t *vis;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    vis = (xcb_visualtype_t *)im->vis;
    if (!im->xim) _ecore_xcb_image_shm_create(im);
@@ -260,6 +264,7 @@ ecore_x_image_to_argb_convert(void *src, int sbpp, int sbpl, Ecore_X_Colormap c,
      };
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    sbpp *= 8;
 
@@ -498,6 +503,7 @@ _ecore_xcb_image_shm_check(void)
    uint8_t depth = 0;
 
    if (_ecore_xcb_image_shm_can != -1) return;
+   CHECK_XCB_CONN;
 
    /* reply =  */
    /*   xcb_shm_query_version_reply(_ecore_xcb_conn,  */
@@ -578,6 +584,8 @@ _ecore_xcb_image_shm_check(void)
 static void 
 _ecore_xcb_image_shm_create(Ecore_X_Image *im) 
 {
+   CHECK_XCB_CONN;
+
    im->xim = 
      _ecore_xcb_image_create_native(im->w, im->h, XCB_IMAGE_FORMAT_Z_PIXMAP, 
                                     im->depth, NULL, ~0, NULL);
@@ -623,6 +631,8 @@ _ecore_xcb_image_create_native(int w, int h, xcb_image_format_t format, uint8_t
    const xcb_setup_t *setup;
    xcb_image_format_t xif;
 
+   CHECK_XCB_CONN;
+
    /* NB: We cannot use xcb_image_create_native as it only creates images 
     * using MSB_FIRST, so this routine recreates that function and uses 
     * the endian-ness of the server setup */
@@ -664,6 +674,8 @@ _ecore_xcb_image_find_format(const xcb_setup_t *setup, uint8_t depth)
 {
    xcb_format_t *fmt, *fmtend;
 
+   CHECK_XCB_CONN;
+
    fmt = xcb_setup_pixmap_formats(setup);
    fmtend = fmt + xcb_setup_pixmap_formats_length(setup);
    for (; fmt != fmtend; ++fmt)
index a5b2120..b0fa27c 100644 (file)
@@ -71,6 +71,7 @@ _ecore_xcb_input_handle_event(xcb_generic_event_t *event __UNUSED__)
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
 #ifdef ECORE_XCB_XINPUT
    ev = (xcb_ge_event_t *)event;
@@ -145,6 +146,7 @@ ecore_x_input_multi_select(Ecore_X_Window win)
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_input_avail) return EINA_FALSE;
 
index ab7ca86..83fb2a2 100644 (file)
@@ -40,6 +40,7 @@ _ecore_xcb_keymap_finalize(void)
    xcb_get_modifier_mapping_reply_t *reply;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    cookie = xcb_get_modifier_mapping_unchecked(_ecore_xcb_conn);
    reply = xcb_get_modifier_mapping_reply(_ecore_xcb_conn, cookie, NULL);
@@ -88,6 +89,7 @@ _ecore_xcb_keymap_shutdown(void)
 void 
 _ecore_xcb_keymap_refresh(xcb_mapping_notify_event_t *event) 
 {
+   CHECK_XCB_CONN;
    xcb_refresh_keyboard_mapping(_ecore_xcb_keysyms, event);
 }
 
@@ -96,6 +98,7 @@ _ecore_xcb_keymap_keycode_to_keysym(xcb_keycode_t keycode, int col)
 {
    xcb_keysym_t key0, key1;
 
+   CHECK_XCB_CONN;
    if (col & _ecore_xcb_mode_switch) 
      {
         key0 = xcb_key_symbols_get_keysym(_ecore_xcb_keysyms, keycode, 4);
@@ -137,6 +140,7 @@ _ecore_xcb_keymap_keycode_to_keysym(xcb_keycode_t keycode, int col)
 xcb_keycode_t *
 _ecore_xcb_keymap_keysym_to_keycode(xcb_keysym_t keysym) 
 {
+   CHECK_XCB_CONN;
    return xcb_key_symbols_get_keycode(_ecore_xcb_keysyms, keysym);
 }
 
@@ -147,6 +151,7 @@ _ecore_xcb_keymap_keysym_to_string(xcb_keysym_t keysym)
    const unsigned char *entry;
    unsigned char val1, val2, val3, val4;
 
+   CHECK_XCB_CONN;
    if (!keysym) return NULL;
    if (keysym == XK_VoidSymbol) keysym = 0;
    if (keysym <= 0x1fffffff) 
@@ -212,6 +217,8 @@ _ecore_xcb_keymap_string_to_keycode(const char *key)
         xcb_keycode_t *keycodes, keycode = 0;
         int i = 0;
 
+        CHECK_XCB_CONN;
+
         keysym = _ecore_xcb_keymap_string_to_keysym(key);
         if (keysym == XCB_NO_SYMBOL) return XCB_NO_SYMBOL;
 
@@ -237,6 +244,7 @@ _ecore_xcb_keymap_lookup_string(xcb_keycode_t keycode, int state, char *buffer,
    unsigned int modifiers = 0;
    xcb_keysym_t keysym;
 
+   CHECK_XCB_CONN;
    if (!_ecore_xcb_keymap_translate_key(keycode, state, &modifiers, &keysym))
      return 0;
 
@@ -268,6 +276,7 @@ _ecore_xcb_keymap_mask_get(void *reply, xcb_keysym_t sym)
      };
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    rep = (xcb_get_modifier_mapping_reply_t *)reply;
    if ((rep) && (rep->keycodes_per_modifier > 0))
index acb79e7..cd89fd7 100644 (file)
@@ -54,6 +54,7 @@ ecore_x_mwm_hints_get(Ecore_X_Window win, Ecore_X_MWM_Hint_Func *fhint, Ecore_X_
    int ret = EINA_FALSE;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    cookie = 
      xcb_get_property_unchecked(_ecore_xcb_conn, 0, win, 
index 6d58765..6ac8805 100644 (file)
@@ -253,6 +253,7 @@ ecore_x_netwm_desk_names_set(Ecore_X_Window root, const char **names, unsigned i
    uint32_t len = 0, i, l;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    for (i = 0; i < n_desks; i++)
      {
@@ -376,6 +377,7 @@ ecore_x_netwm_state_request_send(Ecore_X_Window win, Ecore_X_Window root, Ecore_
    xcb_client_message_event_t ev;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!win) return;
    if (!root) root = ((xcb_screen_t *)_ecore_xcb_screen)->root;
@@ -470,6 +472,7 @@ ecore_x_netwm_client_active_request(Ecore_X_Window root, Ecore_X_Window win, int
    xcb_client_message_event_t ev;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!root) root = ((xcb_screen_t *)_ecore_xcb_screen)->root;
 
@@ -517,6 +520,7 @@ ecore_x_screen_is_composited(int screen)
    static Ecore_X_Atom atom = XCB_NONE;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    snprintf(buff, sizeof(buff), "_NET_WM_CM_S%i", screen);
 
@@ -550,6 +554,7 @@ ecore_x_screen_is_composited_set(int screen, Ecore_X_Window win)
    char buff[32];
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    snprintf(buff, sizeof(buff), "_NET_WM_CM_S%i", screen);
    if (atom == XCB_NONE) 
@@ -575,6 +580,7 @@ ecore_x_netwm_ping_send(Ecore_X_Window win)
    xcb_client_message_event_t ev;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!win) return;
 
@@ -634,6 +640,7 @@ ecore_x_netwm_sync_request_send(Ecore_X_Window win, unsigned int serial)
    xcb_client_message_event_t ev;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!win) return;
 
@@ -685,6 +692,7 @@ ecore_x_netwm_desktop_request_send(Ecore_X_Window win, Ecore_X_Window root, unsi
    xcb_client_message_event_t ev;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!root) root = ((xcb_screen_t *)_ecore_xcb_screen)->root;
 
index e194a52..64ebdd0 100644 (file)
@@ -24,6 +24,7 @@ ecore_x_pixmap_new(Ecore_X_Window win, int w, int h, int dep)
    Ecore_X_Pixmap pmap;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (win == 0) win = ((xcb_screen_t *)_ecore_xcb_screen)->root;
    if (dep == 0) dep = ((xcb_screen_t *)_ecore_xcb_screen)->root_depth;
@@ -48,6 +49,7 @@ EAPI void
 ecore_x_pixmap_free(Ecore_X_Pixmap pmap) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    xcb_free_pixmap(_ecore_xcb_conn, pmap);
 //   ecore_x_flush();
@@ -71,6 +73,7 @@ EAPI void
 ecore_x_pixmap_paste(Ecore_X_Pixmap pmap, Ecore_X_Drawable dest, Ecore_X_GC gc, int sx, int sy, int w, int h, int dx, int dy) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    xcb_copy_area(_ecore_xcb_conn, pmap, dest, gc, sx, sy, dx, dy, w, h);
 //   ecore_x_flush();
index 21decbd..c118c2e 100644 (file)
@@ -72,6 +72,15 @@ extern int _ecore_xcb_log_dom;
 #  define MAX(a, b) ((a < b) ? b : a)
 # endif
 
+#define CHECK_XCB_CONN \
+   { \
+      if (xcb_connection_has_error(_ecore_xcb_conn)) \
+        { \
+           DBG("XCB Connection Has Error !!"); \
+           _ecore_xcb_io_error_handle(NULL); \
+        } \
+   }
+
 /* enums */
 typedef enum _Ecore_Xcb_Encoding_Style Ecore_Xcb_Encoding_Style;
 
index 6e0eb7e..e00a8ac 100644 (file)
@@ -133,6 +133,8 @@ _ecore_xcb_randr_root_to_screen(Ecore_X_Window root)
 {
    int count = 0, num = 0;
 
+   CHECK_XCB_CONN;
+
    count = xcb_setup_roots_length(xcb_get_setup(_ecore_xcb_conn));
    for (num = 0; num < count; num++)
      if (_ecore_xcb_window_root_of_screen_get(num) == root) 
@@ -177,6 +179,7 @@ ecore_x_randr_screen_primary_output_orientations_get(Ecore_X_Window root)
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_randr_avail) return Ecore_X_Randr_None;
 
@@ -207,6 +210,7 @@ ecore_x_randr_screen_primary_output_orientation_get(Ecore_X_Window root)
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_randr_avail) return Ecore_X_Randr_None;
 
@@ -239,6 +243,7 @@ ecore_x_randr_screen_primary_output_orientation_set(Ecore_X_Window root, Ecore_X
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_randr_avail) return EINA_FALSE;
 
@@ -289,6 +294,7 @@ ecore_x_randr_screen_primary_output_sizes_get(Ecore_X_Window root, int *num)
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_randr_avail) return NULL;
 
@@ -349,6 +355,7 @@ ecore_x_randr_screen_primary_output_current_size_get(Ecore_X_Window root, int *w
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_randr_avail) return;
 
@@ -398,6 +405,7 @@ ecore_x_randr_screen_primary_output_size_set(Ecore_X_Window root, int size_index
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_randr_avail) return EINA_FALSE;
 
@@ -462,6 +470,7 @@ ecore_x_randr_screen_primary_output_current_refresh_rate_get(Ecore_X_Window root
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_randr_avail) return 0.0;
 
@@ -497,6 +506,7 @@ ecore_x_randr_screen_primary_output_refresh_rates_get(Ecore_X_Window root, int s
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_randr_avail) return NULL;
 
@@ -551,6 +561,7 @@ ecore_x_randr_screen_primary_output_refresh_rate_set(Ecore_X_Window root, int si
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_randr_avail) return EINA_FALSE;
 
@@ -617,6 +628,7 @@ ecore_x_randr_primary_output_get(Ecore_X_Window root)
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_randr_avail) return Ecore_X_Randr_None;
 
@@ -643,6 +655,7 @@ EAPI void
 ecore_x_randr_primary_output_set(Ecore_X_Window root, Ecore_X_Randr_Output output) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_randr_avail) return;
 
@@ -662,6 +675,7 @@ ecore_x_randr_output_modes_get(Ecore_X_Window root, Ecore_X_Randr_Output output,
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_randr_avail) return NULL;
 
@@ -718,6 +732,7 @@ ecore_x_randr_mode_info_get(Ecore_X_Window root, Ecore_X_Randr_Mode mode)
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_randr_avail) return NULL;
 
@@ -793,6 +808,7 @@ ecore_x_randr_modes_info_get(Ecore_X_Window root, int *num)
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (num) *num = 0;
    if (!_randr_avail) return NULL;
@@ -876,6 +892,7 @@ ecore_x_randr_mode_size_get(Ecore_X_Window root, Ecore_X_Randr_Mode mode, int *w
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_randr_avail) return;
 
@@ -925,6 +942,7 @@ ecore_x_randr_output_edid_get(Ecore_X_Window root, Ecore_X_Randr_Output output,
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_randr_avail) return NULL;
 
@@ -973,6 +991,7 @@ ecore_x_randr_output_clones_get(Ecore_X_Window root, Ecore_X_Randr_Output output
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_randr_avail) return NULL;
 
@@ -1020,6 +1039,7 @@ ecore_x_randr_output_possible_crtcs_get(Ecore_X_Window root, Ecore_X_Randr_Outpu
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_randr_avail) return NULL;
 
@@ -1072,6 +1092,7 @@ ecore_x_randr_output_name_get(Ecore_X_Window root, Ecore_X_Randr_Output output,
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_randr_avail) return NULL;
 
@@ -1124,6 +1145,7 @@ ecore_x_randr_output_connection_status_get(Ecore_X_Window root, Ecore_X_Randr_Ou
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_randr_avail) return ret;
 
@@ -1164,6 +1186,7 @@ ecore_x_randr_outputs_get(Ecore_X_Window root, int *num)
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_randr_avail) return NULL;
 
@@ -1194,6 +1217,7 @@ ecore_x_randr_output_crtc_get(Ecore_X_Window root, Ecore_X_Randr_Output output)
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_randr_avail) return Ecore_X_Randr_None;
 
@@ -1254,6 +1278,7 @@ ecore_x_randr_crtc_settings_set(Ecore_X_Window root, Ecore_X_Randr_Crtc crtc, Ec
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_randr_avail) return EINA_FALSE;
 
@@ -1334,6 +1359,7 @@ ecore_x_randr_crtc_mode_set(Ecore_X_Window root, Ecore_X_Randr_Crtc crtc, Ecore_
    Eina_Bool ret = EINA_FALSE;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_randr_avail) return ret;
 
@@ -1365,6 +1391,7 @@ ecore_x_randr_crtc_mode_get(Ecore_X_Window root, Ecore_X_Randr_Crtc crtc)
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_randr_avail) return Ecore_X_Randr_Unset;
 
@@ -1405,6 +1432,7 @@ ecore_x_randr_crtc_orientation_get(Ecore_X_Window root, Ecore_X_Randr_Crtc crtc)
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_randr_avail) return Ecore_X_Randr_None;
 
@@ -1441,6 +1469,7 @@ ecore_x_randr_crtc_orientation_set(Ecore_X_Window root, Ecore_X_Randr_Crtc crtc,
    Eina_Bool ret = EINA_FALSE;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_randr_avail) return EINA_FALSE;
 
@@ -1467,6 +1496,7 @@ ecore_x_randr_crtc_orientations_get(Ecore_X_Window root, Ecore_X_Randr_Crtc crtc
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_randr_avail) return Ecore_X_Randr_None;
 
@@ -1512,6 +1542,7 @@ ecore_x_randr_crtc_possible_outputs_get(Ecore_X_Window root, Ecore_X_Randr_Crtc
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_randr_avail) return NULL;
 
@@ -1566,6 +1597,7 @@ ecore_x_randr_crtcs_get(Ecore_X_Window root, int *num)
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_randr_avail) return NULL;
 
@@ -1601,6 +1633,7 @@ ecore_x_randr_crtc_outputs_get(Ecore_X_Window root, Ecore_X_Randr_Crtc crtc, int
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_randr_avail) return NULL;
 
@@ -1644,6 +1677,7 @@ ecore_x_randr_crtc_geometry_get(Ecore_X_Window root, Ecore_X_Randr_Crtc crtc, in
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_randr_avail) return;
 
@@ -1694,6 +1728,7 @@ ecore_x_randr_crtc_pos_relative_set(Ecore_X_Window root, Ecore_X_Randr_Crtc crtc
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_randr_avail) return EINA_FALSE;
 
@@ -1776,6 +1811,7 @@ ecore_x_randr_move_all_crtcs_but(Ecore_X_Window root, const Ecore_X_Randr_Crtc *
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_randr_avail) return EINA_FALSE;
 
@@ -1808,6 +1844,7 @@ EAPI void
 ecore_x_randr_crtc_pos_get(Ecore_X_Window root, Ecore_X_Randr_Crtc crtc, int *x, int *y) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_randr_avail) return;
 
@@ -1834,6 +1871,7 @@ ecore_x_randr_crtc_pos_set(Ecore_X_Window root, Ecore_X_Randr_Crtc crtc, int x,
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_randr_avail) return EINA_FALSE;
 
@@ -1864,6 +1902,7 @@ EAPI void
 ecore_x_randr_crtc_size_get(Ecore_X_Window root, Ecore_X_Randr_Crtc crtc, int *w, int *h) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_randr_avail) return;
 
@@ -1882,6 +1921,7 @@ ecore_x_randr_crtc_refresh_rate_get(Ecore_X_Window root, Ecore_X_Randr_Crtc crtc
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_randr_avail) return 0.0;
 
@@ -1935,6 +1975,7 @@ ecore_x_randr_move_crtcs(Ecore_X_Window root, const Ecore_X_Randr_Crtc *crtcs, i
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_randr_avail) return EINA_FALSE;
 
@@ -2038,6 +2079,7 @@ ecore_x_randr_events_select(Ecore_X_Window win, Eina_Bool on)
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_randr_avail) return;
 
@@ -2074,6 +2116,7 @@ ecore_x_randr_screen_reset(Ecore_X_Window root)
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_randr_avail) return;
 
@@ -2081,12 +2124,12 @@ ecore_x_randr_screen_reset(Ecore_X_Window root)
    if (!_ecore_xcb_randr_root_validate(root)) return;
    crtcs = ecore_x_randr_crtcs_get(root, &total);
 
-   Ecore_X_Randr_Crtc enabled[total];
-
    cookie = xcb_randr_get_screen_resources_unchecked(_ecore_xcb_conn, root);
    reply = xcb_randr_get_screen_resources_reply(_ecore_xcb_conn, cookie, NULL);
    if (reply) 
      {
+        Ecore_X_Randr_Crtc enabled[total];
+
         for (i = 0; i < total; i++) 
           {
              xcb_randr_get_crtc_info_cookie_t ocookie;
@@ -2148,6 +2191,7 @@ ecore_x_randr_screen_size_range_get(Ecore_X_Window root, int *minw, int *minh, i
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_randr_avail) return;
 
@@ -2181,6 +2225,7 @@ ecore_x_randr_screen_current_size_get(Ecore_X_Window root, int *w, int *h, int *
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_randr_avail) return;
 
@@ -2236,6 +2281,7 @@ ecore_x_randr_screen_current_size_set(Ecore_X_Window root, int w, int h, int w_m
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_randr_avail) return EINA_FALSE;
 
@@ -2283,6 +2329,7 @@ ecore_x_randr_window_outputs_get(Ecore_X_Window window, int *num)
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (num) *num = 0;
    if (!_randr_avail) return NULL;
@@ -2375,6 +2422,7 @@ ecore_x_randr_output_backlight_level_get(Ecore_X_Window root, Ecore_X_Randr_Outp
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_randr_avail) return -1;
 
@@ -2470,6 +2518,7 @@ ecore_x_randr_output_backlight_level_set(Ecore_X_Window root, Ecore_X_Randr_Outp
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_randr_avail) return EINA_FALSE;
 
@@ -2542,6 +2591,7 @@ _ecore_xcb_randr_output_validate(Ecore_X_Window root, Ecore_X_Randr_Output outpu
    Eina_Bool ret = EINA_FALSE;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_randr_avail) return EINA_FALSE;
 
@@ -2589,6 +2639,7 @@ _ecore_xcb_randr_crtc_validate(Ecore_X_Window root, Ecore_X_Randr_Crtc crtc)
    Eina_Bool ret = EINA_FALSE;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_randr_avail) return EINA_FALSE;
 
index b0a3792..0b6ff46 100644 (file)
@@ -37,6 +37,8 @@ ecore_x_xregion_set(Ecore_X_XRegion *region, Ecore_X_GC gc)
    pixman_box16_t *boxes;
    int num = 0, i = 0;
 
+   CHECK_XCB_CONN;
+
    if (!region) return EINA_FALSE;
 
    boxes = pixman_region_rectangles((pixman_region16_t *)region, &num);
index 4c4eac4..2301f7e 100644 (file)
@@ -108,6 +108,7 @@ _ecore_xcb_render_visual_supports_alpha(Ecore_X_Visual visual)
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!visual) return EINA_FALSE;
    if (!_render_avail) return EINA_FALSE;
@@ -150,6 +151,7 @@ _ecore_xcb_render_find_visual_id(int type, Eina_Bool check_alpha)
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_render_avail) return 0;
 
index ea491fd..03641e0 100644 (file)
@@ -67,6 +67,7 @@ ecore_x_screensaver_idle_time_get(void)
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_screensaver_avail) return 0;
 
@@ -86,6 +87,7 @@ EAPI void
 ecore_x_screensaver_set(int timeout, int interval, int prefer_blanking, int allow_exposures) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_screensaver_avail) return;
 
@@ -106,6 +108,7 @@ ecore_x_screensaver_timeout_set(int timeout)
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_screensaver_avail) return;
 
@@ -131,6 +134,7 @@ ecore_x_screensaver_timeout_get(void)
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_screensaver_avail) return 0;
 
@@ -156,6 +160,7 @@ ecore_x_screensaver_blank_set(int blank)
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_screensaver_avail) return;
 
@@ -181,6 +186,7 @@ ecore_x_screensaver_blank_get(void)
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_screensaver_avail) return 0;
 
@@ -206,6 +212,7 @@ ecore_x_screensaver_expose_set(int expose)
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_screensaver_avail) return;
 
@@ -231,6 +238,7 @@ ecore_x_screensaver_expose_get(void)
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_screensaver_avail) return 0;
 
@@ -256,6 +264,7 @@ ecore_x_screensaver_interval_set(int interval)
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_screensaver_avail) return;
 
@@ -281,6 +290,7 @@ ecore_x_screensaver_interval_get(void)
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_screensaver_avail) return 0;
 
@@ -303,6 +313,7 @@ ecore_x_screensaver_event_listen_set(Eina_Bool on)
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_screensaver_avail) return;
 
index 2d495ad..a6d589c 100644 (file)
@@ -351,6 +351,7 @@ ecore_x_selection_xdnd_request(Ecore_X_Window win, const char *target)
    Ecore_X_DND_Target *_target;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    _target = _ecore_xcb_dnd_target_get();
    atom = _ecore_xcb_selection_target_atom_get(target);
@@ -442,6 +443,7 @@ ecore_x_selection_notify_send(Ecore_X_Window requestor, Ecore_X_Atom selection,
    xcb_selection_notify_event_t ev;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    memset(&ev, 0, sizeof(xcb_selection_notify_event_t));
 
@@ -463,6 +465,7 @@ EAPI void
 ecore_x_selection_owner_set(Ecore_X_Window win, Ecore_X_Atom atom, Ecore_X_Time tim) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    xcb_set_selection_owner(_ecore_xcb_conn, win, atom, tim);
 }
@@ -475,6 +478,7 @@ ecore_x_selection_owner_get(Ecore_X_Atom atom)
    Ecore_X_Window ret;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    cookie = xcb_get_selection_owner(_ecore_xcb_conn, atom);
    reply = xcb_get_selection_owner_reply(_ecore_xcb_conn, cookie, NULL);
@@ -533,6 +537,7 @@ _ecore_xcb_selection_set(Ecore_X_Window win, const void *data, int size, Ecore_X
    int in = 0;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    xcb_set_selection_owner(_ecore_xcb_conn, win, selection, XCB_CURRENT_TIME);
 
@@ -587,6 +592,7 @@ _ecore_xcb_selection_request(Ecore_X_Window win, Ecore_X_Atom selection, const c
    Ecore_X_Atom atarget, prop;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (selection == ECORE_X_ATOM_SELECTION_PRIMARY)
      prop = ECORE_X_ATOM_SELECTION_PROP_PRIMARY;
@@ -611,6 +617,7 @@ _ecore_xcb_selection_converter_text(char *target, void *data, int size, void **d
    char *str;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if ((!data) || (!size)) return EINA_FALSE;
 
@@ -790,6 +797,7 @@ _ecore_xcb_selection_parser_targets(const char *target __UNUSED__, void *data, i
    int i = 0;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!(targets = (unsigned long *)data)) return NULL;
 
index 24db622..98476fa 100644 (file)
@@ -72,6 +72,7 @@ ecore_x_sync_alarm_new(Ecore_X_Sync_Counter counter)
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if ((!_sync_avail) || (!counter)) return 0;
 
@@ -103,6 +104,7 @@ EAPI Eina_Bool
 ecore_x_sync_alarm_free(Ecore_X_Sync_Alarm alarm) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if ((!_sync_avail) || (!alarm)) return EINA_FALSE;
 
@@ -124,6 +126,7 @@ ecore_x_sync_counter_query(Ecore_X_Sync_Counter counter, unsigned int *val)
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if ((!_sync_avail) || (!counter)) return EINA_FALSE;
 
@@ -148,6 +151,7 @@ ecore_x_sync_counter_inc(Ecore_X_Sync_Counter counter, int by)
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if ((!_sync_avail) || (!counter)) return;
 
@@ -171,6 +175,7 @@ ecore_x_sync_counter_val_wait(Ecore_X_Sync_Counter counter, int val)
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if ((!_sync_avail) || (!counter)) return;
 
@@ -206,6 +211,7 @@ ecore_x_sync_counter_new(int val)
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_sync_avail) return 0;
 
@@ -227,6 +233,7 @@ EAPI void
 ecore_x_sync_counter_free(Ecore_X_Sync_Counter counter) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if ((!_sync_avail) || (!counter)) return;
 
@@ -244,6 +251,7 @@ ecore_x_sync_counter_set(Ecore_X_Sync_Counter counter, int val)
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if ((!_sync_avail) || (!counter)) return;
 
@@ -264,6 +272,7 @@ ecore_x_sync_counter_2_set(Ecore_X_Sync_Counter counter, int val_hi, unsigned in
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if ((!_sync_avail) || (!counter)) return;
 
@@ -286,6 +295,7 @@ ecore_x_sync_counter_2_query(Ecore_X_Sync_Counter counter, int *val_hi, unsigned
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if ((!_sync_avail) || (!counter)) return EINA_FALSE;
 
index 12cd033..9f18d51 100644 (file)
@@ -130,6 +130,7 @@ ecore_x_vsync_animator_tick_source_set(Ecore_X_Window win)
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_dri2_avail) return EINA_FALSE;
 
@@ -245,6 +246,7 @@ _ecore_xcb_dri_start(void)
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_dri2_avail) return EINA_FALSE;
 
@@ -340,6 +342,7 @@ _ecore_xcb_dri_tick_schedule(void)
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
 #ifdef ECORE_XCB_DRI
    vbl.request.type = (DRM_VBLANK_RELATIVE | DRM_VBLANK_EVENT);
index 6bdd507..4f2605b 100644 (file)
@@ -54,6 +54,7 @@ ecore_x_window_new(Ecore_X_Window parent, int x, int y, int w, int h)
    uint32_t mask, mask_list[9];
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (parent == 0)
      parent = ((xcb_screen_t *)_ecore_xcb_screen)->root;
@@ -113,6 +114,7 @@ ecore_x_window_override_new(Ecore_X_Window parent, int x, int y, int w, int h)
    uint32_t mask, mask_list[9];
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (parent == 0)
      parent = ((xcb_screen_t *)_ecore_xcb_screen)->root;
@@ -168,7 +170,8 @@ ecore_x_window_input_new(Ecore_X_Window parent, int x, int y, int w, int h)
    Ecore_X_Window win;
    uint32_t mask, mask_list[3];
 
-   LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   LOGFN(__FILE__, __LINE__, __FUNCTION__)
+   CHECK_XCB_CONN;
 
    if (parent == 0)
      parent = ((xcb_screen_t *)_ecore_xcb_screen)->root;
@@ -283,6 +286,7 @@ EAPI void
 ecore_x_window_free(Ecore_X_Window win) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (win) 
      {
@@ -344,6 +348,7 @@ ecore_x_window_configure(Ecore_X_Window win, Ecore_X_Window_Configure_Mask mask,
    unsigned int i = 0;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!win) return;
 
@@ -411,6 +416,7 @@ ecore_x_window_move(Ecore_X_Window win, int x, int y)
    uint32_t list[2], mask;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!win) return;
 
@@ -436,6 +442,7 @@ ecore_x_window_resize(Ecore_X_Window win, int w, int h)
    uint32_t list[2], mask;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!win) return;
    if (w < 1) w = 1;
@@ -465,6 +472,7 @@ ecore_x_window_move_resize(Ecore_X_Window win, int x, int y, int w, int h)
    uint32_t list[4], mask;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!win) return;
    if (w < 1) w = 1;
@@ -509,6 +517,7 @@ ecore_x_window_border_width_set(Ecore_X_Window win, int border_width)
    uint32_t list;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!win) return;
 
@@ -536,6 +545,7 @@ ecore_x_window_raise(Ecore_X_Window win)
    uint32_t list[] = { XCB_STACK_MODE_ABOVE };
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    xcb_configure_window(_ecore_xcb_conn, win, 
                         XCB_CONFIG_WINDOW_STACK_MODE, list);
@@ -553,6 +563,7 @@ ecore_x_window_lower(Ecore_X_Window win)
    uint32_t list[] = { XCB_STACK_MODE_BELOW };
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    xcb_configure_window(_ecore_xcb_conn, win, 
                         XCB_CONFIG_WINDOW_STACK_MODE, list);
@@ -595,6 +606,7 @@ ecore_x_window_defaults_set(Ecore_X_Window win)
    pid_t pid;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    gethostname(buff, MAXHOSTNAMELEN);
    buff[MAXHOSTNAMELEN - 1] = '\0';
@@ -628,12 +640,10 @@ EAPI void
 ecore_x_window_show(Ecore_X_Window win) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (win) 
-     {
-        xcb_map_window(_ecore_xcb_conn, win);
-//        ecore_x_flush();
-     }
+     xcb_map_window(_ecore_xcb_conn, win);
 }
 
 /**
@@ -648,6 +658,7 @@ EAPI void
 ecore_x_window_hide(Ecore_X_Window win) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (win) 
      {
@@ -700,6 +711,7 @@ EAPI void
 ecore_x_window_focus(Ecore_X_Window win) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!win) win = ((xcb_screen_t *)_ecore_xcb_screen)->root;
 
@@ -718,6 +730,7 @@ EAPI void
 ecore_x_window_focus_at_time(Ecore_X_Window win, Ecore_X_Time time) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!win) win = ((xcb_screen_t *)_ecore_xcb_screen)->root;
    xcb_set_input_focus(_ecore_xcb_conn, XCB_INPUT_FOCUS_PARENT, win, time);
@@ -742,6 +755,7 @@ EAPI void
 ecore_x_window_reparent(Ecore_X_Window win, Ecore_X_Window parent, int x, int y) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (parent == 0) 
      parent = ((xcb_screen_t *)_ecore_xcb_screen)->root;
@@ -756,6 +770,7 @@ ecore_x_window_pixmap_set(Ecore_X_Window win, Ecore_X_Pixmap pixmap)
    uint32_t list;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    list = pixmap;
 
@@ -779,6 +794,7 @@ ecore_x_window_background_color_set(Ecore_X_Window win, unsigned short red, unsi
    uint32_t list;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    cookie = 
      xcb_alloc_color_unchecked(_ecore_xcb_conn, 
@@ -800,6 +816,7 @@ ecore_x_window_pixel_gravity_set(Ecore_X_Window win, Ecore_X_Gravity gravity)
    uint32_t list;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    list = gravity;
 
@@ -814,6 +831,7 @@ ecore_x_window_gravity_set(Ecore_X_Window win, Ecore_X_Gravity gravity)
    uint32_t list;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    list = gravity;
 
@@ -828,6 +846,7 @@ ecore_x_window_override_set(Ecore_X_Window win, Eina_Bool override)
    uint32_t list;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    list = override;
 
@@ -847,6 +866,7 @@ ecore_x_window_cursor_show(Ecore_X_Window win, Eina_Bool show)
    uint32_t list = 0;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!win) win = ((xcb_screen_t *)_ecore_xcb_screen)->root;
 
@@ -896,6 +916,7 @@ ecore_x_window_cursor_set(Ecore_X_Window win, Ecore_X_Cursor cursor)
    uint32_t list;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    list = cursor;
 
@@ -909,6 +930,7 @@ ecore_x_window_container_manage(Ecore_X_Window win)
    uint32_t list;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    list = (XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT | 
            XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY);
@@ -924,6 +946,7 @@ ecore_x_window_client_manage(Ecore_X_Window win)
    uint32_t list;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    list = (XCB_EVENT_MASK_VISIBILITY_CHANGE | 
            XCB_EVENT_MASK_FOCUS_CHANGE | 
@@ -947,6 +970,7 @@ ecore_x_window_sniff(Ecore_X_Window win)
    uint32_t list;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    list = (XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY | 
            XCB_EVENT_MASK_PROPERTY_CHANGE);
@@ -962,6 +986,7 @@ ecore_x_window_client_sniff(Ecore_X_Window win)
    uint32_t list;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    list = (XCB_EVENT_MASK_VISIBILITY_CHANGE | 
            XCB_EVENT_MASK_STRUCTURE_NOTIFY | 
@@ -982,6 +1007,7 @@ EAPI void
 ecore_x_window_area_clear(Ecore_X_Window win, int x, int y, int w, int h) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    xcb_clear_area(_ecore_xcb_conn, 0, win, x, y, w, h);
 //   ecore_x_flush();
@@ -991,6 +1017,7 @@ EAPI void
 ecore_x_window_area_expose(Ecore_X_Window win, int x, int y, int w, int h) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    xcb_clear_area(_ecore_xcb_conn, 1, win, x, y, w, h);
 //   ecore_x_flush();
@@ -1000,6 +1027,7 @@ EAPI void
 ecore_x_window_save_set_add(Ecore_X_Window win) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    xcb_change_save_set(_ecore_xcb_conn, XCB_SET_MODE_INSERT, win);
 }
@@ -1008,6 +1036,7 @@ EAPI void
 ecore_x_window_save_set_del(Ecore_X_Window win) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    xcb_change_save_set(_ecore_xcb_conn, XCB_SET_MODE_DELETE, win);
 }
@@ -1025,6 +1054,7 @@ ecore_x_window_focus_get(void)
    Ecore_X_Window focus = 0;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    cookie = xcb_get_input_focus_unchecked(_ecore_xcb_conn);
    reply = xcb_get_input_focus_reply(_ecore_xcb_conn, cookie, NULL);
@@ -1043,6 +1073,7 @@ ecore_x_window_argb_get(Ecore_X_Window win)
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
 //   if (!win) return ret;
 
@@ -1067,6 +1098,7 @@ ecore_x_window_manage(Ecore_X_Window win)
    uint32_t list;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    cookie = xcb_get_window_attributes(_ecore_xcb_conn, win);
    reply = xcb_get_window_attributes_reply(_ecore_xcb_conn, cookie, NULL);
@@ -1108,6 +1140,7 @@ ecore_x_window_attributes_get(Ecore_X_Window win, Ecore_X_Window_Attributes *att
    xcb_get_geometry_reply_t *greply;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    cookie = xcb_get_window_attributes_unchecked(_ecore_xcb_conn, win);
    reply = xcb_get_window_attributes_reply(_ecore_xcb_conn, cookie, NULL);
@@ -1184,6 +1217,7 @@ EAPI void
 ecore_x_window_size_get(Ecore_X_Window win, int *width, int *height) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!win) win = ((xcb_screen_t *)_ecore_xcb_screen)->root;
    ecore_x_drawable_geometry_get(win, NULL, NULL, width, height);
@@ -1200,6 +1234,7 @@ ecore_x_window_ignore_set(Ecore_X_Window win, int ignore)
    int i = 0, j = 0, count = 0;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (ignore) 
      {
@@ -1277,6 +1312,7 @@ ecore_x_window_root_list(int *num_ret)
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!num_ret) return NULL;
    if (num_ret) *num_ret = 0;
@@ -1393,6 +1429,7 @@ ecore_x_window_children_get(Ecore_X_Window win, int *num)
    Ecore_X_Window *windows = NULL;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (num) *num = 0;
    cookie = xcb_query_tree_unchecked(_ecore_xcb_conn, win);
@@ -1432,6 +1469,7 @@ ecore_x_window_root_get(Ecore_X_Window win)
    Ecore_X_Window window = 0;
 
    /* LOGFN(__FILE__, __LINE__, __FUNCTION__); */
+   CHECK_XCB_CONN;
 
    gcookie = xcb_get_geometry_unchecked(_ecore_xcb_conn, win);
    greply = xcb_get_geometry_reply(_ecore_xcb_conn, gcookie, NULL);
@@ -1468,6 +1506,7 @@ EAPI void
 ecore_x_window_geometry_get(Ecore_X_Window win, int *x, int *y, int *w, int *h) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!win) win = ((xcb_screen_t *)_ecore_xcb_screen)->root;
    ecore_x_drawable_geometry_get(win, x, y, w, h);
@@ -1486,6 +1525,7 @@ ecore_x_window_at_xy_get(int x, int y)
    Ecore_X_Window root, win = 0;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    root = ((xcb_screen_t *)_ecore_xcb_screen)->root;
 
@@ -1510,6 +1550,7 @@ ecore_x_window_at_xy_with_skip_get(int x, int y, Ecore_X_Window *skip, int skip_
    Ecore_X_Window root, win = 0;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    root = ((xcb_screen_t *)_ecore_xcb_screen)->root;
 
@@ -1526,6 +1567,7 @@ ecore_x_window_at_xy_begin_get(Ecore_X_Window begin, int x, int y)
    Ecore_X_Window win = 0;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    ecore_x_grab();
    win = _ecore_xcb_window_at_xy_get(begin, 0, 0, x, y, NULL, 0);
@@ -1548,6 +1590,7 @@ ecore_x_window_parent_get(Ecore_X_Window win)
    Ecore_X_Window window = 0;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
 //   if (!win) return 0;
    cookie = xcb_query_tree(_ecore_xcb_conn, win);
@@ -1573,6 +1616,7 @@ ecore_x_window_visible_get(Ecore_X_Window win)
    int ret = EINA_FALSE;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    cookie = xcb_get_window_attributes_unchecked(_ecore_xcb_conn, win);
    reply = xcb_get_window_attributes_reply(_ecore_xcb_conn, cookie, NULL);
@@ -1594,6 +1638,7 @@ ecore_x_window_button_grab(Ecore_X_Window win, int button, Ecore_X_Event_Mask ma
    Ecore_X_Window *t;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    b = button;
    if (b == 0)
@@ -1634,6 +1679,7 @@ ecore_x_window_button_ungrab(Ecore_X_Window win, int button, int mod, int any_mo
    uint8_t b;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    b = button;
    if (b == 0) b = XCB_BUTTON_INDEX_ANY;
@@ -1665,6 +1711,7 @@ ecore_x_window_key_grab(Ecore_X_Window win, const char *key, int mod, int any_mo
    Ecore_X_Window *t;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    keycode = _ecore_xcb_keymap_string_to_keycode(key);
    if (keycode == XCB_NO_SYMBOL) return;
@@ -1700,6 +1747,7 @@ ecore_x_window_key_ungrab(Ecore_X_Window win, const char *key, int mod, int any_
    int i = 0;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    keycode = _ecore_xcb_keymap_string_to_keycode(key);
    if (keycode == XCB_NO_SYMBOL) return;
@@ -1728,6 +1776,7 @@ _ecore_xcb_window_root_of_screen_get(int screen)
 {
    xcb_screen_iterator_t iter;
 
+   CHECK_XCB_CONN;
    iter = xcb_setup_roots_iterator(xcb_get_setup(_ecore_xcb_conn));
    for (; iter.rem; --screen, xcb_screen_next(&iter))
      if (screen == 0) 
@@ -1752,6 +1801,7 @@ _ecore_xcb_window_argb_internal_new(Ecore_X_Window parent, int x, int y, int w,
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
 #ifdef ECORE_XCB_RENDER
    if (parent == 0)
@@ -1813,6 +1863,7 @@ _ecore_xcb_window_at_xy_get(Ecore_X_Window base, int bx, int by, int x, int y, E
    Eina_Bool skipit = EINA_FALSE;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!ecore_x_window_visible_get(base)) return 0;
 
@@ -1874,6 +1925,8 @@ _ecore_xcb_window_visual_get(Ecore_X_Window win)
    xcb_get_window_attributes_reply_t *reply;
    Ecore_X_Visual visual = 0;
 
+   CHECK_XCB_CONN;
+
    cookie = xcb_get_window_attributes(_ecore_xcb_conn, win);
    reply = xcb_get_window_attributes_reply(_ecore_xcb_conn, cookie, NULL);
    if (!reply) return 0;
@@ -1887,6 +1940,7 @@ void
 _ecore_xcb_window_button_grab_remove(Ecore_X_Window win) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (_ecore_xcb_button_grabs_num > 0) 
      {
@@ -1925,6 +1979,7 @@ void
 _ecore_xcb_window_key_grab_remove(Ecore_X_Window win) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (_ecore_xcb_key_grabs_num > 0) 
      {
@@ -1965,6 +2020,7 @@ _ecore_xcb_window_grab_allow_events(Ecore_X_Window event_win, Ecore_X_Window chi
    int i = 0;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    for (i = 0; i < _ecore_xcb_button_grabs_num; i++) 
      {
@@ -2025,6 +2081,7 @@ _ecore_xcb_window_find_visual_by_id(xcb_visualid_t id)
    xcb_depth_iterator_t diter;
    xcb_visualtype_iterator_t viter;
 
+   CHECK_XCB_CONN;
    diter = xcb_screen_allowed_depths_iterator(_ecore_xcb_screen);
    for (; diter.rem; xcb_depth_next(&diter)) 
      {
@@ -2044,6 +2101,7 @@ _ecore_xcb_window_screen_of_display(int screen)
 {
    xcb_screen_iterator_t iter;
 
+   CHECK_XCB_CONN;
    iter = xcb_setup_roots_iterator(xcb_get_setup(_ecore_xcb_conn));
    for (; iter.rem; --screen, xcb_screen_next(&iter))
      if (screen == 0)
index a6b37cb..be94a2b 100644 (file)
@@ -9,6 +9,7 @@ ecore_x_window_prop_card32_get(Ecore_X_Window win, Ecore_X_Atom atom, unsigned i
    int num = 0;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    cookie = xcb_get_property_unchecked(_ecore_xcb_conn, 0, win, atom, 
                                        ECORE_X_ATOM_CARDINAL, 0, 0x7fffffff);
@@ -44,6 +45,7 @@ EAPI void
 ecore_x_window_prop_card32_set(Ecore_X_Window win, Ecore_X_Atom atom, unsigned int *val, unsigned int num) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
 #if SIZEOF_INT == SIZEOF_LONG
    xcb_change_property(_ecore_xcb_conn, XCB_PROP_MODE_REPLACE, win, atom, 
@@ -73,6 +75,7 @@ ecore_x_window_prop_card32_list_get(Ecore_X_Window win, Ecore_X_Atom atom, unsig
    int num = -1;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (list) *list = NULL;
 
@@ -133,6 +136,8 @@ EAPI void
 ecore_x_window_prop_xid_set(Ecore_X_Window win, Ecore_X_Atom atom, Ecore_X_Atom type, Ecore_X_ID *xids, unsigned int num) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
+
 #if SIZEOF_INT == SIZEOF_LONG
    xcb_change_property(_ecore_xcb_conn, XCB_PROP_MODE_REPLACE, win, atom, 
                        type, 32, num, (unsigned char *)xids);
@@ -161,6 +166,7 @@ ecore_x_window_prop_xid_get(Ecore_X_Window win, Ecore_X_Atom atom, Ecore_X_Atom
    int num = 0;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    num = len;
    cookie = xcb_get_property_unchecked(_ecore_xcb_conn, 0, win, atom, type, 
@@ -195,6 +201,7 @@ EAPI void
 ecore_x_window_prop_string_set(Ecore_X_Window win, Ecore_X_Atom type, const char *str) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    xcb_change_property(_ecore_xcb_conn, XCB_PROP_MODE_REPLACE, win, type, 
                        ECORE_X_ATOM_UTF8_STRING, 8, strlen(str), str);
@@ -210,6 +217,7 @@ ecore_x_window_prop_string_get(Ecore_X_Window win, Ecore_X_Atom type)
    int len = 0;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    cookie = 
      xcb_get_property_unchecked(_ecore_xcb_conn, 0, 
@@ -290,6 +298,7 @@ EAPI void
 ecore_x_window_prop_property_del(Ecore_X_Window win, Ecore_X_Atom property) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    xcb_delete_property(_ecore_xcb_conn, win, property);
 }
@@ -298,6 +307,7 @@ EAPI void
 ecore_x_window_prop_property_set(Ecore_X_Window win, Ecore_X_Atom property, Ecore_X_Atom type, int size, void *data, int num) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (win == 0)
      win = ((xcb_screen_t *)_ecore_xcb_screen)->root;
@@ -337,6 +347,7 @@ ecore_x_window_prop_property_get(Ecore_X_Window win, Ecore_X_Atom property, Ecor
    void *value;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (num) *num = 0;
 
@@ -411,6 +422,7 @@ ecore_x_window_prop_xid_list_get(Ecore_X_Window win, Ecore_X_Atom atom, Ecore_X_
    int num = -1;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (xids) *xids = NULL;
 
@@ -452,6 +464,7 @@ ecore_x_window_prop_xid_list_change(Ecore_X_Window win, Ecore_X_Atom atom, Ecore
    int i = 0, num = 0;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    num = ecore_x_window_prop_xid_list_get(win, atom, type, &lst);
    if (num < 0) return;
@@ -498,6 +511,7 @@ ecore_x_window_prop_protocol_isset(Ecore_X_Window win, Ecore_X_WM_Protocol proto
    uint32_t count = 0, i = 0;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (protocol >= ECORE_X_WM_PROTOCOL_NUM) return EINA_FALSE;
 
@@ -546,6 +560,7 @@ ecore_x_window_prop_protocol_list_get(Ecore_X_Window win, int *num_ret)
    Ecore_X_WM_Protocol *prot_ret = NULL;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!num_ret) return NULL;
 
@@ -617,6 +632,7 @@ ecore_x_window_prop_list(Ecore_X_Window win, int *num)
    int i = 0;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (num) *num = 0;
 
index c1ff849..7893a06 100644 (file)
@@ -29,6 +29,8 @@ _ecore_x_window_tree_walk(Ecore_X_Window window)
    xcb_query_tree_cookie_t cookie_tree;
    int i, j;
 
+   CHECK_XCB_CONN;
+
    cookie_attr = xcb_get_window_attributes_unchecked(_ecore_xcb_conn, window);
    reply_attr = xcb_get_window_attributes_reply(_ecore_xcb_conn, cookie_attr, NULL);
    if (!reply_attr) return NULL;
index ae82ffe..a778f9a 100644 (file)
@@ -21,6 +21,7 @@ EAPI void
 ecore_x_window_shape_input_mask_set(Ecore_X_Window win, Ecore_X_Pixmap mask) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
 #ifdef ECORE_XCB_SHAPE
    xcb_shape_mask(_ecore_xcb_conn, XCB_SHAPE_SO_SET, XCB_SHAPE_SK_INPUT, 
@@ -44,6 +45,7 @@ EAPI void
 ecore_x_window_shape_mask_set(Ecore_X_Window win, Ecore_X_Pixmap mask) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
 #ifdef ECORE_XCB_SHAPE
    xcb_shape_mask(_ecore_xcb_conn, XCB_SHAPE_SO_SET, XCB_SHAPE_SK_BOUNDING, 
@@ -60,6 +62,7 @@ EAPI void
 ecore_x_window_shape_window_set(Ecore_X_Window win, Ecore_X_Window shape_win) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
 #ifdef ECORE_XCB_SHAPE
    xcb_shape_combine(_ecore_xcb_conn, XCB_SHAPE_SO_SET, XCB_SHAPE_SK_BOUNDING, 
@@ -76,6 +79,7 @@ EAPI void
 ecore_x_window_shape_window_set_xy(Ecore_X_Window win, Ecore_X_Window shape_win, int x, int y) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
 #ifdef ECORE_XCB_SHAPE
    xcb_shape_combine(_ecore_xcb_conn, XCB_SHAPE_SO_SET, XCB_SHAPE_SK_BOUNDING, 
@@ -98,6 +102,7 @@ ecore_x_window_shape_rectangle_set(Ecore_X_Window win, int x, int y, int w, int
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
 #ifdef ECORE_XCB_SHAPE
    rect.x = x;
@@ -126,6 +131,7 @@ ecore_x_window_shape_rectangles_set(Ecore_X_Window win, Ecore_X_Rectangle *rects
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!rects) return;
 
@@ -163,6 +169,7 @@ EAPI void
 ecore_x_window_shape_window_add(Ecore_X_Window win, Ecore_X_Window shape_win) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
 #ifdef ECORE_XCB_SHAPE
    xcb_shape_combine(_ecore_xcb_conn, XCB_SHAPE_SO_UNION, 
@@ -180,6 +187,7 @@ EAPI void
 ecore_x_window_shape_window_add_xy(Ecore_X_Window win, Ecore_X_Window shape_win, int x, int y) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
 #ifdef ECORE_XCB_SHAPE
    xcb_shape_combine(_ecore_xcb_conn, XCB_SHAPE_SO_UNION, 
@@ -203,6 +211,7 @@ ecore_x_window_shape_rectangle_add(Ecore_X_Window win, int x, int y, int w, int
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
 #ifdef ECORE_XCB_SHAPE
    rect.x = x;
@@ -231,6 +240,7 @@ ecore_x_window_shape_rectangle_subtract(Ecore_X_Window win, int x, int y, int w,
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
 #ifdef ECORE_XCB_SHAPE
    rect.x = x;
@@ -259,6 +269,7 @@ ecore_x_window_shape_rectangle_clip(Ecore_X_Window win, int x, int y, int w, int
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
 #ifdef ECORE_XCB_SHAPE
    rect.x = x;
@@ -287,6 +298,7 @@ ecore_x_window_shape_rectangles_add(Ecore_X_Window win, Ecore_X_Rectangle *rects
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
 #ifdef ECORE_XCB_SHAPE
    if (num > 0) 
@@ -331,6 +343,7 @@ ecore_x_window_shape_rectangles_get(Ecore_X_Window win, int *num_ret)
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (num_ret) *num_ret = 0;
 
@@ -377,6 +390,7 @@ EAPI void
 ecore_x_window_shape_events_select(Ecore_X_Window win, Eina_Bool on) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
 #ifdef ECORE_XCB_SHAPE
    xcb_shape_select_input(_ecore_xcb_conn, win, on);
@@ -400,6 +414,7 @@ ecore_x_window_shape_input_rectangles_get(Ecore_X_Window win, int *num_ret)
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (num_ret) *num_ret = 0;
 
@@ -467,6 +482,7 @@ ecore_x_window_shape_input_rectangles_set(Ecore_X_Window win, Ecore_X_Rectangle
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!rects) return;
 
@@ -508,6 +524,7 @@ ecore_x_window_shape_input_rectangle_subtract(Ecore_X_Window win, int x, int y,
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
 #ifdef ECORE_XCB_SHAPE
    rect.x = x;
@@ -536,6 +553,7 @@ ecore_x_window_shape_input_rectangle_add(Ecore_X_Window win, int x, int y, int w
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
 #ifdef ECORE_XCB_SHAPE
    rect.x = x;
@@ -564,6 +582,7 @@ ecore_x_window_shape_input_rectangle_set(Ecore_X_Window win, int x, int y, int w
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
 #ifdef ECORE_XCB_SHAPE
    rect.x = x;
@@ -588,6 +607,7 @@ EAPI void
 ecore_x_window_shape_input_window_set_xy(Ecore_X_Window win, Ecore_X_Window shape_win, int x, int y) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
 #ifdef ECORE_XCB_SHAPE
    xcb_shape_combine(_ecore_xcb_conn, XCB_SHAPE_SO_SET, XCB_SHAPE_SK_INPUT, 
@@ -606,6 +626,7 @@ EAPI void
 ecore_x_window_shape_input_window_add_xy(Ecore_X_Window win, Ecore_X_Window shape_win, int x, int y) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
 #ifdef ECORE_XCB_SHAPE
    xcb_shape_combine(_ecore_xcb_conn, XCB_SHAPE_SO_UNION, XCB_SHAPE_SK_INPUT, 
@@ -624,6 +645,7 @@ EAPI void
 ecore_x_window_shape_input_window_set(Ecore_X_Window win, Ecore_X_Window shape_win) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
 #ifdef ECORE_XCB_SHAPE
    xcb_shape_combine(_ecore_xcb_conn, XCB_SHAPE_SO_SET, XCB_SHAPE_SK_INPUT, 
@@ -644,6 +666,7 @@ ecore_x_window_shape_input_rectangle_clip(Ecore_X_Window win, int x, int y, int
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
 #ifdef ECORE_XCB_SHAPE
    rect.x = x;
@@ -672,6 +695,7 @@ ecore_x_window_shape_input_rectangles_add(Ecore_X_Window win, Ecore_X_Rectangle
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
 #ifdef ECORE_XCB_SHAPE
    if (num > 0) 
index faa70c6..8a6da74 100644 (file)
@@ -72,6 +72,8 @@ ecore_x_fixes_selection_notification_request(Ecore_X_Atom selection)
    int mask = 0;
 #endif
 
+   CHECK_XCB_CONN;
+
    if (!_xfixes_avail) return EINA_FALSE;
 
 #ifdef ECORE_XCB_XFIXES
@@ -128,6 +130,7 @@ ecore_x_region_new(Ecore_X_Rectangle *rects, int num)
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_xfixes_avail) return 0;
 
@@ -157,6 +160,7 @@ ecore_x_region_new_from_bitmap(Ecore_X_Pixmap bitmap)
    Ecore_X_Region region = 0;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_xfixes_avail) return 0;
 
@@ -186,6 +190,7 @@ ecore_x_region_new_from_window(Ecore_X_Window win, Ecore_X_Region_Type type)
    Ecore_X_Region region = 0;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_xfixes_avail) return 0;
 
@@ -212,6 +217,7 @@ ecore_x_region_new_from_gc(Ecore_X_GC gc)
    Ecore_X_Region region = 0;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_xfixes_avail) return 0;
 
@@ -238,6 +244,7 @@ ecore_x_region_new_from_picture(Ecore_X_Picture picture)
    Ecore_X_Region region = 0;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_xfixes_avail) return 0;
 
@@ -261,6 +268,7 @@ EAPI void
 ecore_x_region_free(Ecore_X_Region region) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_xfixes_avail) return;
 
@@ -288,6 +296,7 @@ ecore_x_region_set(Ecore_X_Region region, Ecore_X_Rectangle *rects, int num)
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_xfixes_avail) return;
 
@@ -311,6 +320,7 @@ EAPI void
 ecore_x_region_copy(Ecore_X_Region dest, Ecore_X_Region source) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_xfixes_avail) return;
 
@@ -335,6 +345,7 @@ EAPI void
 ecore_x_region_combine(Ecore_X_Region dest, Ecore_X_Region source1, Ecore_X_Region source2) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_xfixes_avail) return;
 
@@ -358,6 +369,7 @@ EAPI void
 ecore_x_region_intersect(Ecore_X_Region dest, Ecore_X_Region source1, Ecore_X_Region source2) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_xfixes_avail) return;
 
@@ -381,6 +393,7 @@ EAPI void
 ecore_x_region_subtract(Ecore_X_Region dest, Ecore_X_Region source1, Ecore_X_Region source2) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_xfixes_avail) return;
 
@@ -409,6 +422,7 @@ ecore_x_region_invert(Ecore_X_Region dest, Ecore_X_Rectangle *bounds, Ecore_X_Re
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_xfixes_avail) return;
 
@@ -436,6 +450,7 @@ EAPI void
 ecore_x_region_translate(Ecore_X_Region region, int dx, int dy) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_xfixes_avail) return;
 
@@ -457,6 +472,7 @@ EAPI void
 ecore_x_region_extents(Ecore_X_Region dest, Ecore_X_Region source) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_xfixes_avail) return;
 
@@ -494,6 +510,7 @@ ecore_x_region_fetch(Ecore_X_Region region, int *num, Ecore_X_Rectangle *bounds)
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (num) *num = 0;
    if (bounds) *bounds = extents;
@@ -553,6 +570,7 @@ EAPI void
 ecore_x_region_expand(Ecore_X_Region dest, Ecore_X_Region source, unsigned int left, unsigned int right, unsigned int top, unsigned int bottom) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_xfixes_avail) return;
 
@@ -582,6 +600,7 @@ EAPI void
 ecore_x_region_gc_clip_set(Ecore_X_Region region, Ecore_X_GC gc, int x, int y) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_xfixes_avail) return;
 
@@ -608,6 +627,7 @@ EAPI void
 ecore_x_region_window_shape_set(Ecore_X_Region region, Ecore_X_Window dest, Ecore_X_Shape_Type type, int x, int y) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_xfixes_avail) return;
 
@@ -636,6 +656,7 @@ EAPI void
 ecore_x_region_picture_clip_set(Ecore_X_Region region, Ecore_X_Picture picture, int x, int y) 
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_xfixes_avail) return;
 
index 062bb20..c58ffce 100644 (file)
@@ -74,6 +74,7 @@ ecore_x_xinerama_screen_count_get(void)
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_xinerama_avail) return 0;
 
@@ -98,6 +99,7 @@ ecore_x_xinerama_screen_geometry_get(int screen, int *x, int *y, int *w, int *h)
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (x) *x = 0;
    if (y) *y = 0;
index a0e8ea6..16acabb 100644 (file)
@@ -47,6 +47,7 @@ ecore_x_test_fake_key_down(const char *key __UNUSED__)
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_test_avail) return EINA_FALSE;
 
@@ -84,6 +85,7 @@ ecore_x_test_fake_key_up(const char *key __UNUSED__)
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_test_avail) return EINA_FALSE;
 
@@ -124,6 +126,7 @@ ecore_x_test_fake_key_press(const char *key __UNUSED__)
 #endif
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
+   CHECK_XCB_CONN;
 
    if (!_test_avail) return EINA_FALSE;