1 | /* $XFree86$ */
|
---|
2 | /*
|
---|
3 | * Copyright 2002-2004 Red Hat Inc., Durham, North Carolina.
|
---|
4 | *
|
---|
5 | * All Rights Reserved.
|
---|
6 | *
|
---|
7 | * Permission is hereby granted, free of charge, to any person obtaining
|
---|
8 | * a copy of this software and associated documentation files (the
|
---|
9 | * "Software"), to deal in the Software without restriction, including
|
---|
10 | * without limitation on the rights to use, copy, modify, merge,
|
---|
11 | * publish, distribute, sublicense, and/or sell copies of the Software,
|
---|
12 | * and to permit persons to whom the Software is furnished to do so,
|
---|
13 | * subject to the following conditions:
|
---|
14 | *
|
---|
15 | * The above copyright notice and this permission notice (including the
|
---|
16 | * next paragraph) shall be included in all copies or substantial
|
---|
17 | * portions of the Software.
|
---|
18 | *
|
---|
19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
---|
20 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
---|
21 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
---|
22 | * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
|
---|
23 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
---|
24 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
---|
25 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
---|
26 | * SOFTWARE.
|
---|
27 | */
|
---|
28 |
|
---|
29 | /*
|
---|
30 | * Authors:
|
---|
31 | * Rickard E. (Rik) Faith <[email protected]>
|
---|
32 | *
|
---|
33 | */
|
---|
34 |
|
---|
35 | /** \file
|
---|
36 | * This file describes the interface to the client-side libdmx.a
|
---|
37 | * library. All DMX-aware client-side applications should include this
|
---|
38 | * file. */
|
---|
39 |
|
---|
40 | #ifndef _DMXEXT_H_
|
---|
41 | #define _DMXEXT_H_
|
---|
42 |
|
---|
43 | /* These values must be larger than LastExtensionError.
|
---|
44 | The values in dmxext.h and dmxproto.h *MUST* match. */
|
---|
45 | #define DmxBadXinerama 1001
|
---|
46 | #define DmxBadValue 1002
|
---|
47 | #define DmxBadReply 1003
|
---|
48 |
|
---|
49 | #define DMXScreenWindowWidth (1L<<0)
|
---|
50 | #define DMXScreenWindowHeight (1L<<1)
|
---|
51 | #define DMXScreenWindowXoffset (1L<<2)
|
---|
52 | #define DMXScreenWindowYoffset (1L<<3)
|
---|
53 | #define DMXRootWindowWidth (1L<<4)
|
---|
54 | #define DMXRootWindowHeight (1L<<5)
|
---|
55 | #define DMXRootWindowXoffset (1L<<6)
|
---|
56 | #define DMXRootWindowYoffset (1L<<7)
|
---|
57 | #define DMXRootWindowXorigin (1L<<8)
|
---|
58 | #define DMXRootWindowYorigin (1L<<9)
|
---|
59 |
|
---|
60 | #define DMXDesktopWidth (1L<<0)
|
---|
61 | #define DMXDesktopHeight (1L<<1)
|
---|
62 | #define DMXDesktopShiftX (1L<<2)
|
---|
63 | #define DMXDesktopShiftY (1L<<3)
|
---|
64 |
|
---|
65 | #define DMXInputType (1L<<0)
|
---|
66 | #define DMXInputPhysicalScreen (1L<<1)
|
---|
67 | #define DMXInputSendsCore (1L<<2)
|
---|
68 |
|
---|
69 | #ifndef _DMX_SERVER_
|
---|
70 |
|
---|
71 | /** Client-library screen information structure, returned by
|
---|
72 | * #DMXGetScreenAttributes. */
|
---|
73 | typedef struct {
|
---|
74 | char *displayName;
|
---|
75 | int logicalScreen;
|
---|
76 |
|
---|
77 | unsigned int screenWindowWidth; /* displayName's coordinate system */
|
---|
78 | unsigned int screenWindowHeight; /* displayName's coordinate system */
|
---|
79 | int screenWindowXoffset; /* displayName's coordinate system */
|
---|
80 | int screenWindowYoffset; /* displayName's coordinate system */
|
---|
81 |
|
---|
82 | unsigned int rootWindowWidth; /* screenWindow's coordinate system */
|
---|
83 | unsigned int rootWindowHeight; /* screenWindow's coordinate system */
|
---|
84 | int rootWindowXoffset; /* screenWindow's coordinate system */
|
---|
85 | int rootWindowYoffset; /* screenWindow's coordinate system */
|
---|
86 |
|
---|
87 | int rootWindowXorigin; /* global coordinate system */
|
---|
88 | int rootWindowYorigin; /* global coordinate system */
|
---|
89 | } DMXScreenAttributes;
|
---|
90 |
|
---|
91 | /** Client-library window information structure, returned by
|
---|
92 | * #DMXGetWindowAttributes. */
|
---|
93 | typedef struct {
|
---|
94 | int screen;
|
---|
95 | Window window;
|
---|
96 | XRectangle pos, vis;
|
---|
97 | } DMXWindowAttributes;
|
---|
98 |
|
---|
99 | /** Client-library desktop information structure, returned by
|
---|
100 | * #DMXGetDesktopAttributes. */
|
---|
101 | typedef struct {
|
---|
102 | unsigned int width; /* global coordinate system */
|
---|
103 | unsigned int height; /* global coordinate system */
|
---|
104 | int shiftX; /* global coordinate system */
|
---|
105 | int shiftY; /* global coordinate system */
|
---|
106 | } DMXDesktopAttributes;
|
---|
107 |
|
---|
108 | /** Enumeration for the #inputType field in the #DMXInputAttributes
|
---|
109 | * structure. */
|
---|
110 | typedef enum {
|
---|
111 | DMXLocalInputType,
|
---|
112 | DMXConsoleInputType,
|
---|
113 | DMXBackendInputType
|
---|
114 | } DMXInputEnum;
|
---|
115 |
|
---|
116 | /** Client-library input information structure, returned by
|
---|
117 | * #DMXGetInputAttributes. */
|
---|
118 | typedef struct {
|
---|
119 | DMXInputEnum inputType;
|
---|
120 | int physicalScreen;
|
---|
121 | int physicalId;
|
---|
122 | Bool isCore;
|
---|
123 | Bool sendsCore;
|
---|
124 | const char *name;
|
---|
125 | Bool detached;
|
---|
126 | } DMXInputAttributes;
|
---|
127 |
|
---|
128 | _XFUNCPROTOBEGIN
|
---|
129 |
|
---|
130 | extern Bool DMXQueryExtension(Display *dpy,
|
---|
131 | int *event_basep, int *error_basep);
|
---|
132 | extern Bool DMXQueryVersion(Display *dpy, int *major_version,
|
---|
133 | int *minor_version, int *patch_version);
|
---|
134 | extern Bool DMXSync(Display *dpy);
|
---|
135 | extern Bool DMXForceWindowCreation(Display *dpy, Window window);
|
---|
136 |
|
---|
137 |
|
---|
138 | extern Bool DMXGetScreenCount(Display *dpy, int *screen_count);
|
---|
139 | extern Bool DMXGetScreenAttributes(Display *dpy,
|
---|
140 | int screen,
|
---|
141 | DMXScreenAttributes *attr);
|
---|
142 | extern int DMXChangeScreensAttributes(Display *dpy,
|
---|
143 | int screen_count,
|
---|
144 | int *screens,
|
---|
145 | int mask_count,
|
---|
146 | unsigned int *masks,
|
---|
147 | DMXScreenAttributes *attr, /* vector */
|
---|
148 | int *error_screen);
|
---|
149 |
|
---|
150 | extern Bool DMXAddScreen(Display *dpy,
|
---|
151 | const char *displayName,
|
---|
152 | unsigned int mask,
|
---|
153 | DMXScreenAttributes *attr,
|
---|
154 | int *screen);
|
---|
155 | extern Bool DMXRemoveScreen(Display *dpy, int screen);
|
---|
156 |
|
---|
157 | /* Call DMXGetScreenWindowCount and allocate info to that size. Pass
|
---|
158 | * the size in available_count. This call can generate a large amount
|
---|
159 | * of wire traffic and should not be used called with available_count=0
|
---|
160 | * just to determine the screen_count value -- use DMXGetScreenCount
|
---|
161 | * instead. NOTE: Also see DMX protocol specification (DMXSpec.txt) for
|
---|
162 | * usage of DMXSync to flush pending commands. */
|
---|
163 | extern Bool DMXGetWindowAttributes(Display *dpy, Window window,
|
---|
164 | int *screen_count, int available_count,
|
---|
165 | DMXWindowAttributes *attr);
|
---|
166 |
|
---|
167 | extern Bool DMXGetDesktopAttributes(Display *dpy, DMXDesktopAttributes *attr);
|
---|
168 | extern int DMXChangeDesktopAttributes(Display *dpy,
|
---|
169 | unsigned int mask,
|
---|
170 | DMXDesktopAttributes *attr);
|
---|
171 |
|
---|
172 | extern Bool DMXGetInputCount(Display *dpy, int *input_count);
|
---|
173 | extern Bool DMXGetInputAttributes(Display *dpy, int id,
|
---|
174 | DMXInputAttributes *attr);
|
---|
175 |
|
---|
176 | extern Bool DMXAddInput(Display *dpy,
|
---|
177 | unsigned int mask,
|
---|
178 | DMXInputAttributes *attr,
|
---|
179 | int *id);
|
---|
180 | extern Bool DMXRemoveInput(Display *dpy, int id);
|
---|
181 |
|
---|
182 | /* These are helper functions that call DMXAddInput. */
|
---|
183 | extern Bool DMXAddBackendInput(Display *dpy, int screen, int sendsCore,
|
---|
184 | int *newId);
|
---|
185 | extern Bool DMXAddConsoleInput(Display *dpy, const char *name, int sendsCore,
|
---|
186 | int *newId);
|
---|
187 |
|
---|
188 | _XFUNCPROTOEND
|
---|
189 | #endif
|
---|
190 | #endif
|
---|