[vlc-commits] commit: XCB/window: allow compilation without xcb-keysyms ( Rémi Denis-Courmont )

git at videolan.org git at videolan.org
Sun Jul 11 11:19:39 CEST 2010


vlc/vlc-1.1 | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Jul 10 17:17:12 2010 +0300| [3ad058de0f6d411060ef8285917cf3a5befeac9a] | committer: Rémi Denis-Courmont 

XCB/window: allow compilation without xcb-keysyms

(cherry picked from commit c7dd9b7ee11d95598e3c0414439b95bd220f7466)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.1.git/?a=commit;h=3ad058de0f6d411060ef8285917cf3a5befeac9a
---

 configure.ac                    |    5 +++--
 modules/video_output/xcb/keys.c |   32 ++++++++++++++++++++++++++++----
 2 files changed, 31 insertions(+), 6 deletions(-)

diff --git a/configure.ac b/configure.ac
index 0ddc095..9f5a364 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3333,7 +3333,7 @@ AS_IF([test "${enable_xcb}" != "no"], [
   dnl libxcb
   PKG_CHECK_MODULES(XCB, [xcb])
   PKG_CHECK_MODULES(XCB_SHM, [xcb-shm])
-  VLC_ADD_PLUGIN([screensaver xcb_x11 xcb_screen xcb_apps])
+  VLC_ADD_PLUGIN([screensaver xcb_x11 xcb_window xcb_screen xcb_apps])
 
   AS_IF([test "${enable_xvideo}" != "no"], [
     PKG_CHECK_MODULES(XCB_XV, [xcb-xv >= 1.1.90.1], [
@@ -3367,9 +3367,10 @@ AS_IF([test "${enable_xcb}" != "no"], [
 
   AS_IF([test "${have_xcb_keysyms}" = "yes"], [
     PKG_CHECK_MODULES(XPROTO, [xproto])
-    VLC_ADD_PLUGIN([xcb_window globalhotkeys])
+    VLC_ADD_PLUGIN([globalhotkeys])
     VLC_ADD_CFLAGS([globalhotkeys], [${XCB_KEYSYMS_CFLAGS} ${XCB_CFLAGS}])
     VLC_ADD_LIBS([globalhotkeys], [${XCB_KEYSYMS_LIBS} ${XCB_LIBS}])
+    VLC_ADD_CFLAGS([xcb_window], [-DHAVE_XCB_KEYSYMS])
   ])
   VLC_ADD_PLUGIN([xdg_screensaver])
 ])
diff --git a/modules/video_output/xcb/keys.c b/modules/video_output/xcb/keys.c
index 855b149..4dcfe99 100644
--- a/modules/video_output/xcb/keys.c
+++ b/modules/video_output/xcb/keys.c
@@ -29,15 +29,15 @@
 #include <assert.h>
 
 #include <xcb/xcb.h>
+#include <vlc_common.h>
+#include "xcb_vlc.h"
+
+#ifdef HAVE_XCB_KEYSYMS
 #include <xcb/xcb_keysyms.h>
 #include <X11/keysym.h>
 #include <X11/XF86keysym.h>
-
-#include <vlc_common.h>
 #include <vlc_keys.h>
 
-#include "xcb_vlc.h"
-
 struct key_handler_t
 {
     vlc_object_t      *obj;
@@ -164,3 +164,27 @@ int ProcessKeyEvent (key_handler_t *ctx, xcb_generic_event_t *ev)
     free (ev);
     return 0;
 }
+
+#else /* HAVE_XCB_KEYSYMS */
+
+key_handler_t *CreateKeyHandler (vlc_object_t *obj, xcb_connection_t *conn)
+{
+    msg_Err (obj, "X11 key press support not compiled-in");
+    (void) conn;
+    return NULL;
+}
+
+void DestroyKeyHandler (key_handler_t *ctx)
+{
+    (void) ctx;
+    abort ();
+}
+
+int ProcessKeyEvent (key_handler_t *ctx, xcb_generic_event_t *ev)
+{
+    (void) ctx;
+    (void) ev;
+    abort ();
+}
+
+#endif /* HAVE_XCB_KEYSYMS */



More information about the vlc-commits mailing list