00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include <X11/Xlib.h>
00024 #include <X11/extensions/Xrandr.h>
00025
00026 struct ScreenInfo;
00027
00028 struct CrtcInfo {
00029 RRCrtc id;
00030 XRRCrtcInfo *info;
00031 int cur_x;
00032 int cur_y;
00033 RRMode cur_mode_id;
00034 Rotation cur_rotation;
00035 Rotation rotations;
00036 int cur_noutput;
00037
00038 int changed;
00039
00040 struct ScreenInfo *screen_info;
00041 };
00042
00043 struct OutputInfo {
00044 RROutput id;
00045 XRROutputInfo *info;
00046 struct CrtcInfo *cur_crtc;
00047
00048 int auto_set;
00049 int off_set;
00050 };
00051
00052 struct ScreenInfo {
00053 Display *dpy;
00054 Window window;
00055 XRRScreenResources *res;
00056 int min_width, min_height;
00057 int max_width, max_height;
00058 int cur_width;
00059 int cur_height;
00060 int cur_mmWidth;
00061 int cur_mmHeight;
00062
00063 int n_output;
00064 int n_crtc;
00065 struct OutputInfo **outputs;
00066 struct CrtcInfo **crtcs;
00067
00068 int clone;
00069 struct CrtcInfo *primary_crtc;
00070
00071 struct CrtcInfo *cur_crtc;
00072 struct OutputInfo *cur_output;
00073 };
00074
00075 extern struct ScreenInfo *screen_info;
00076 extern const uint big_pixbuf[], small_pixbuf[];
00077
00078 #ifdef __cplusplus
00079 extern "C" {
00080 #endif
00081 void free_screen_info (struct ScreenInfo *screen_info);
00082
00083 struct ScreenInfo* internal_read_screen_info (Display *);
00084
00085 int internal_set_screen_size (struct ScreenInfo *screen_info);
00086 void internal_output_auto (struct ScreenInfo *screen_info, struct OutputInfo *output_info);
00087 void internal_output_off (struct ScreenInfo *screen_info, struct OutputInfo *output);
00088 void internal_output_set_primary (struct ScreenInfo *screen_info, RROutput output_id);
00089 struct CrtcInfo* internal_auto_find_crtc (struct ScreenInfo *screen_info, struct OutputInfo *output_info);
00090
00091 XRRModeInfo *internal_find_mode_by_xid (struct ScreenInfo *screen_info, RRMode mode_id);
00092 int internal_mode_height (XRRModeInfo *mode_info, Rotation rotation);
00093 int internal_mode_width (XRRModeInfo *mode_info, Rotation rotation);
00094 int internal_get_width_by_output_id (struct ScreenInfo *screen_info, RROutput output_id);
00095 int internal_get_height_by_output_id (struct ScreenInfo *screen_info, RROutput output_id);
00096 char *internal_get_output_name (struct ScreenInfo *screen_info, RROutput id);
00097 Status internal_crtc_apply (struct CrtcInfo *crtc_info);
00098 Status internal_crtc_disable (struct CrtcInfo *crtc);
00099 int internal_main_low_apply (struct ScreenInfo *screen_info);
00100
00101 #ifdef __cplusplus
00102 }
00103 #endif