1 #ifndef foox11wraphfoo 2 #define foox11wraphfoo 3 4 /*** 5 This file is part of PulseAudio. 6 7 Copyright 2004-2006 Lennart Poettering 8 9 PulseAudio is free software; you can redistribute it and/or modify 10 it under the terms of the GNU Lesser General Public License as published 11 by the Free Software Foundation; either version 2.1 of the License, 12 or (at your option) any later version. 13 14 PulseAudio is distributed in the hope that it will be useful, but 15 WITHOUT ANY WARRANTY; without even the implied warranty of 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 General Public License for more details. 18 19 You should have received a copy of the GNU Lesser General Public License 20 along with PulseAudio; if not, see <http://www.gnu.org/licenses/>. 21 ***/ 22 23 #include <X11/Xlib.h> 24 #include <X11/Xlib-xcb.h> 25 26 #include <pulsecore/core.h> 27 28 typedef struct pa_x11_wrapper pa_x11_wrapper; 29 30 typedef struct pa_x11_client pa_x11_client; 31 32 typedef int (*pa_x11_event_cb_t)(pa_x11_wrapper *w, XEvent *e, void *userdata); 33 typedef void (*pa_x11_kill_cb_t)(pa_x11_wrapper *w, void *userdata); 34 35 /* Return the X11 wrapper for this core. In case no wrapper was 36 existent before, allocate a new one */ 37 pa_x11_wrapper* pa_x11_wrapper_get(pa_core *c, const char *name); 38 39 /* Increase the wrapper's reference count by one */ 40 pa_x11_wrapper* pa_x11_wrapper_ref(pa_x11_wrapper *w); 41 42 /* Decrease the reference counter of an X11 wrapper object */ 43 void pa_x11_wrapper_unref(pa_x11_wrapper* w); 44 45 /* Return the X11 display object for this connection */ 46 Display *pa_x11_wrapper_get_display(pa_x11_wrapper *w); 47 48 /* Return the XCB connection object for this connection */ 49 xcb_connection_t *pa_x11_wrapper_get_xcb_connection(pa_x11_wrapper *w); 50 51 /* Kill the connection to the X11 display */ 52 void pa_x11_wrapper_kill(pa_x11_wrapper *w); 53 54 /* Register an X11 client, that is called for each X11 event */ 55 pa_x11_client* pa_x11_client_new(pa_x11_wrapper *w, pa_x11_event_cb_t event_cb, pa_x11_kill_cb_t kill_cb, void *userdata); 56 57 /* Free an X11 client object */ 58 void pa_x11_client_free(pa_x11_client *c); 59 60 #endif 61