00001
00003 #ifndef __UTIL_X11_H__
00004 #define __UTIL_X11_H__
00005
00006 #include <qmutex.h>
00007
00008 #ifdef USING_X11
00009 #include <qsize.h>
00010 #include <qwindowdefs.h>
00011 #include <X11/Xlib.h>
00012 #include <vector>
00013
00014 #include "mythexp.h"
00015
00016 MPUBLIC Display *MythXOpenDisplay(void);
00017 MPUBLIC void InstallXErrorHandler(Display *d);
00018 MPUBLIC void PrintXErrors(Display *d, const std::vector<XErrorEvent>& events);
00019 MPUBLIC std::vector<XErrorEvent> UninstallXErrorHandler(Display *d, bool printErrors = true);
00020 MPUBLIC QSize MythXGetDisplaySize( Display *d = NULL, int screen = -1);
00021 MPUBLIC QSize MythXGetDisplayDimensions(Display *d = NULL, int screen = -1);
00022 MPUBLIC double MythXGetPixelAspectRatio( Display *d = NULL, int screen = -1);
00023 #endif // USING_X11
00024
00025 MPUBLIC int GetNumberOfXineramaScreens();
00026
00027 MPUBLIC extern QMutex x11_lock;
00028
00029 #define X11L x11_lock.lock()
00030 #define X11U x11_lock.unlock()
00031 #define X11S(arg) do { X11L; arg; X11U; } while (0)
00032
00033
00034 #undef KeyPress
00035 #undef KeyRelease
00036
00037 #endif // __UTIL_X11_H__