1extern unsigned int __invalid_size_argument_for_IOC;
2typedef unsigned int __u32;
3struct video_window
4{
5  __u32 x, y;
6  __u32 width, height;
7};
8typedef unsigned long XID;
9typedef XID Window;
10typedef struct _XExtData
11{
12  Window root;
13}
14Screen;
15typedef struct
16{
17  int border_width;
18}
19XWindowAttributes;
20typedef struct _XDisplay Display;
21typedef struct
22{
23  int default_screen;
24  Screen *screens;
25}
26 *_XPrivDisplay;
27typedef struct
28{
29  int x, y;
30}
31XSizeHints;
32typedef struct
33{
34  unsigned short hdisplay;
35  unsigned short vdisplay;
36}
37XF86VidModeModeInfo;
38Display *display;
39int tfd;
40int ccapt;
41int tml;
42int fswidth = 0;
43int fsheight = 0;
44Window fmwin;
45XF86VidModeModeInfo **modelines, *fullscreenmode = ((void *) 0);
46struct video_window vswin;
47DoFullScreen (void)
48{
49  int i;
50  int rx, ry;
51  Window junkwin;
52  XSizeHints fmsizehints;
53  XWindowAttributes fmwinattr;
54  if (ioctl
55      (tfd,
56       (((1U) << (((0 + 8) + 8) + 14)) | ((('v')) << (0 + 8)) | (((8)) << 0) |
57	(((((sizeof (int) == sizeof (int[1])
58	     && sizeof (int) <
59	     (1 << 14)) ? sizeof (int) : __invalid_size_argument_for_IOC))) <<
60	 ((0 + 8) + 8))), &ccapt) < 0)
61    {
62      perror ("ioctl VIDIOCCAPTURE");
63    }
64  if (!XTranslateCoordinates
65      (display, fmwin,
66       ((&((_XPrivDisplay) display)->
67	 screens[(((_XPrivDisplay) display)->default_screen)])->root),
68       -fmwinattr.border_width, -fmwinattr.border_width, &rx, &ry, &junkwin))
69    {
70    }
71  vswin.width = fswidth;
72  vswin.height = fsheight;
73  vswin.x = fmsizehints.x + rx;
74  vswin.y = fmsizehints.y + ry;
75  if (ioctl
76      (tfd,
77       (((1U) << (((0 + 8) + 8) + 14)) | ((('v')) << (0 + 8)) | (((8)) << 0) |
78	(((((sizeof (int) == sizeof (int[1])
79	     && sizeof (int) <
80	     (1 << 14)) ? sizeof (int) : __invalid_size_argument_for_IOC))) <<
81	 ((0 + 8) + 8))), &ccapt) < 0)
82    {
83      XF86VidModeGetAllModeLines (display, XDefaultScreen (display), &tml,
84				  &modelines);
85	{
86	  if ((modelines[i]->hdisplay == fswidth)
87	      && (modelines[i]->vdisplay == fsheight))
88	    {
89	      fullscreenmode = modelines[i];
90	    }
91	}
92	{
93	  XF86VidModeSetViewPort (display, XDefaultScreen (display), vswin.x,
94				  vswin.y);
95	}
96    }
97}
98