00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef header_x11resolution
00016 #define header_x11resolution
00017
00018 #ifdef USE_X11
00019
00020 #include <X11/Xlib.h>
00021 #include <X11/Xutil.h>
00022 #ifdef USE_VIDMODE
00023 #include <X11/extensions/xf86vmode.h>
00024 #endif
00025
00026 class CL_X11Resolution
00027 {
00028 public:
00029 CL_X11Resolution(Display *dpy, int scr);
00030 ~CL_X11Resolution();
00031
00032 void set_mode(int width, int height);
00033 void restore_mode();
00034
00035 int get_width() const;
00036 int get_height() const;
00037
00038 private:
00039 #ifdef USE_VIDMODE
00040 XF86VidModeModeInfo get_best_mode(int width, int height);
00041
00042 XF86VidModeModeInfo orig_mode;
00043 #endif
00044 Display *dpy;
00045 int scr;
00046
00047 bool mode_set;
00048 struct
00049 {
00050 int x,y;
00051 } orig_view;
00052
00053 int cur_width, cur_height;
00054 bool has_vidmode_extension;
00055 };
00056
00057 #endif
00058 #endif