1 /*
2                                     __
3                                    / _|
4   __ _ _   _ _ __ ___  _ __ __ _  | |_ ___  ___ ___
5  / _` | | | | '__/ _ \| '__/ _` | |  _/ _ \/ __/ __|
6 | (_| | |_| | | | (_) | | | (_| | | || (_) \__ \__ \
7  \__,_|\__,_|_|  \___/|_|  \__,_| |_| \___/|___/___/
8 
9 Copyright (C) 2018-2019 Aurora Free Open Source Software.
10 
11 This file is part of the Aurora Free Open Source Software. This
12 organization promote free and open source software that you can
13 redistribute and/or modify under the terms of the GNU Lesser General
14 Public License Version 3 as published by the Free Software Foundation or
15 (at your option) any later version approved by the Aurora Free Open Source
16 Software Organization. The license is available in the package root path
17 as 'LICENSE' file. Please review the following information to ensure the
18 GNU Lesser General Public License version 3 requirements will be met:
19 https://www.gnu.org/licenses/lgpl.html .
20 
21 Alternatively, this file may be used under the terms of the GNU General
22 Public License version 3 or later as published by the Free Software
23 Foundation. Please review the following information to ensure the GNU
24 General Public License requirements will be met:
25 http://www.gnu.org/licenses/gpl-3.0.html.
26 
27 NOTE: All products, services or anything associated to trademarks and
28 service marks used or referenced on this file are the property of their
29 respective companies/owners or its subsidiaries. Other names and brands
30 may be claimed as the property of others.
31 
32 For more info about intellectual property visit: aurorafoss.org or
33 directly send an email to: contact (at) aurorafoss.org .
34 */
35 
36 module aurorafw.gui.platform.x11.extensions.xf86vmode.types;
37 
38 import X = aurorafw.gui.platform.x11.x;
39 import core.stdc.config;
40 
41 enum CLKFLAG_PROGRAMABLE = 1;
42 
43 enum XF86VidModeBadClock = 0;
44 enum XF86VidModeBadHTimings = 1;
45 enum XF86VidModeBadVTimings = 2;
46 enum XF86VidModeModeUnsuitable = 3;
47 enum XF86VidModeExtensionDisabled = 4;
48 enum XF86VidModeClientNotLocal = 5;
49 enum XF86VidModeZoomLocked = 6;
50 enum XF86VidModeNumberErrors = (XF86VidModeZoomLocked + 1);
51 enum XF86VM_READ_PERMISSION	= 1;
52 enum XF86VM_WRITE_PERMISSION = 2;
53 
54 struct XF86VidModeModeLine {
55 	ushort hdisplay;
56 	ushort hsyncstart;
57 	ushort hsyncend;
58 	ushort htotal;
59 	ushort hskew;
60 	ushort vdisplay;
61 	ushort vsyncstart;
62 	ushort vsyncend;
63 	ushort vtotal;
64 	uint flags;
65 	int privsize;
66 	int *c_private;
67 }
68 
69 struct XF86VidModeModeInfo {
70 	uint dotclock;
71 	ushort hdisplay;
72 	ushort hsyncstart;
73 	ushort hsyncend;
74 	ushort htotal;
75 	ushort hskew;
76 	ushort vdisplay;
77 	ushort vsyncstart;
78 	ushort vsyncend;
79 	ushort vtotal;
80 	uint flags;
81 	int privsize;
82 	int *c_private;
83 }
84 
85 struct XF86VidModeSyncRange {
86 	float hi;
87 	float lo;
88 }
89 
90 struct XF86VidModeMonitor {
91 	char* vendor;
92 	char* model;
93 	float EMPTY;
94 	char nhsync;
95 	XF86VidModeSyncRange* hsync;
96 	char nvsync;
97 	XF86VidModeSyncRange* vsync;
98 }
99 
100 struct XF86VidModeNotifyEvent {
101 	int type; /* of event */
102 	c_ulong serial; /* # of last request processed by server */
103 	X.Bool send_event; /* true if this came from a SendEvent req */
104 	X.Display *display; /* Display the event was read from */
105 	X.Window root; /* root window of event screen */
106 	int state; /* What happened */
107 	int kind; /* What happened */
108 	X.Bool forced; /* extents of new region */
109 	X.Time time; /* event timestamp */
110 }
111 
112 extern(C) @nogc nothrow {
113 	alias da_XF86VidModeQueryExtension = X.Bool function(X.Display*, int*, int*);
114 	alias da_XF86VidModeGetGammaRamp = X.Bool function(X.Display*,int,int,ushort*,ushort*,ushort*);
115 	alias da_XF86VidModeSetGammaRamp = X.Bool function(X.Display*,int,int,ushort*,ushort*,ushort*);
116 	alias da_XF86VidModeGetGammaRampSize = X.Bool function(X.Display*, int, int*);
117 }