Restructure how we look for Read files slightly.
[fvwm.git] / libs / FScreen.h
blob6822020fb66caa4f649b2461757b0ba3d5ef8b33
1 /* -*-c-*- */
2 #ifndef FVWMLIB_FSCRREN_H
3 #define FVWMLIB_FSCRREN_H
5 /* needs X11/Xlib.h and X11/Xutil.h */
7 typedef enum
9 FSCREEN_GLOBAL = -1,
10 FSCREEN_CURRENT = -2,
11 FSCREEN_PRIMARY = -3,
12 FSCREEN_XYPOS = -4
13 } fscreen_scr_t;
15 typedef enum
17 FSCREEN_SPEC_GLOBAL = 'g',
18 FSCREEN_SPEC_CURRENT = 'c',
19 FSCREEN_SPEC_PRIMARY = 'p',
20 FSCREEN_SPEC_WINDOW = 'w'
21 } fscreen_scr_spec_t;
23 typedef union
25 XEvent *mouse_ev;
26 struct
28 int x;
29 int y;
30 } xypos;
31 } fscreen_scr_arg;
33 #define FSCREEN_MANGLE_USPOS_HINTS_MAGIC ((short)-32109)
36 /* Control */
37 Bool FScreenIsEnabled(void);
38 Bool FScreenIsSLSEnabled(void);
39 void FScreenInit(Display *dpy);
40 void FScreenOnOff(Bool do_enable);
41 Bool FScreenConfigureSLSSize(int width, int height);
42 Bool FScreenConfigureSLSScreens(int nscreens, char *args);
43 void FScreenSLSOnOff(Bool do_enable);
44 /* Intended to be called by modules. Simply pass in the parameter from the
45 * config string sent by fvwm. */
46 void FScreenConfigureModule(char *args);
47 const char* FScreenGetConfiguration(void); /* For use by fvwm */
48 void FScreenSetDefaultModuleScreen(char *scr_spec);
49 void FScreenDisableRandR(void);
51 void FScreenSetPrimaryScreen(int scr);
53 /* Screen info */
54 Bool FScreenGetScrRect(
55 fscreen_scr_arg *arg, fscreen_scr_t screen, int *x, int *y,
56 int *w, int *h);
57 Bool FScreenGetScrId(
58 fscreen_scr_arg *arg, fscreen_scr_t screen);
59 void FScreenTranslateCoordinates(
60 fscreen_scr_arg *arg_src, fscreen_scr_t screen_src,
61 fscreen_scr_arg *arg_dest, fscreen_scr_t screen_dest,
62 int *x, int *y);
63 void FScreenGetResistanceRect(
64 int wx, int wy, unsigned int ww, unsigned int wh, int *x0, int *y0,
65 int *x1, int *y1);
66 Bool FScreenIsRectangleOnScreen(
67 fscreen_scr_arg *arg, fscreen_scr_t screen, rectangle *rec);
68 void FScreenSpecToString(char *dest, int space, fscreen_scr_t screen);
70 /* Clipping/positioning */
71 int FScreenClipToScreen(
72 fscreen_scr_arg *arg, fscreen_scr_t screen, int *x, int *y, int w,
73 int h);
74 void FScreenCenterOnScreen(
75 fscreen_scr_arg *arg, fscreen_scr_t screen, int *x, int *y, int w,
76 int h);
78 /* Geometry management */
79 int FScreenGetScreenArgument(char *scr_spec, fscreen_scr_spec_t default_screen);
80 int FScreenParseGeometryWithScreen(
81 char *parsestring, int *x_return, int *y_return,
82 unsigned int *width_return, unsigned int *height_return,
83 int *screen_return);
84 int FScreenParseGeometry(
85 char *parsestring, int *x_return, int *y_return,
86 unsigned int *width_return, unsigned int *height_return);
87 int FScreenGetGeometry(
88 char *parsestring, int *x_return, int *y_return,
89 int *width_return, int *height_return, XSizeHints *hints, int flags);
90 void FScreenMangleScreenIntoUSPosHints(fscreen_scr_t screen, XSizeHints *hints);
91 fscreen_scr_t FScreenFetchMangledScreenFromUSPosHints(XSizeHints *hints);
93 /* RandR support */
94 int FScreenGetRandrEventType(void);
95 Bool FScreenHandleRandrEvent(
96 XEvent *event, int *old_w, int *old_h, int *new_w, int *new_h);
98 #endif /* FVWMLIB_FSCRREN_H */