dmxextension.h
Go to the documentation of this file.
00001 /*
00002  * Copyright 2003-2004 Red Hat Inc., Durham, North Carolina.
00003  *
00004  * All Rights Reserved.
00005  *
00006  * Permission is hereby granted, free of charge, to any person obtaining
00007  * a copy of this software and associated documentation files (the
00008  * "Software"), to deal in the Software without restriction, including
00009  * without limitation on the rights to use, copy, modify, merge,
00010  * publish, distribute, sublicense, and/or sell copies of the Software,
00011  * and to permit persons to whom the Software is furnished to do so,
00012  * subject to the following conditions:
00013  *
00014  * The above copyright notice and this permission notice (including the
00015  * next paragraph) shall be included in all copies or substantial
00016  * portions of the Software.
00017  *
00018  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00019  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00020  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
00021  * NON-INFRINGEMENT.  IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
00022  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
00023  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
00024  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
00025  * SOFTWARE.
00026  */
00027 
00028 /*
00029  * Author:
00030  *   Rickard E. (Rik) Faith <faith@redhat.com>
00031  *   Kevin E. Martin <kem@redhat.com>
00032  *
00033  */
00034 
00039 #ifndef _DMXEXTENSION_H_
00040 #define _DMXEXTENSION_H_
00041 
00044 typedef struct {
00045     const char   *displayName;
00046     int          logicalScreen;
00047 
00048     unsigned int screenWindowWidth;    /* displayName's coordinate system */
00049     unsigned int screenWindowHeight;   /* displayName's coordinate system */
00050     int          screenWindowXoffset;  /* displayName's coordinate system */
00051     int          screenWindowYoffset;  /* displayName's coordinate system */
00052 
00053     unsigned int rootWindowWidth;      /* screenWindow's coordinate system */
00054     unsigned int rootWindowHeight;     /* screenWindow's coordinate system */
00055     int          rootWindowXoffset;    /* screenWindow's coordinate system */
00056     int          rootWindowYoffset;    /* screenWindow's coordinate system */
00057 
00058     int          rootWindowXorigin;    /* global coordinate system */
00059     int          rootWindowYorigin;    /* global coordinate system */
00060 } DMXScreenAttributesRec, *DMXScreenAttributesPtr;
00061 
00063 typedef struct {
00064     int          screen;
00065     Window       window;
00066     xRectangle   pos;
00067     xRectangle   vis;
00068 } DMXWindowAttributesRec, *DMXWindowAttributesPtr;
00069 
00072 typedef struct {
00073     int          width;
00074     int          height;
00075     int          shiftX;
00076     int          shiftY;
00077 } DMXDesktopAttributesRec, *DMXDesktopAttributesPtr;
00078 
00080 typedef struct {
00081     const char   *name;
00082     int          inputType;
00083     int          physicalScreen;
00084     int          physicalId;
00085     int          isCore;
00086     int          sendsCore;
00087     int          detached;
00088 } DMXInputAttributesRec, *DMXInputAttributesPtr;
00089 
00090 
00091 extern unsigned long dmxGetNumScreens(void);
00092 extern void          dmxForceWindowCreation(WindowPtr pWindow);
00093 extern void          dmxFlushPendingSyncs(void);
00094 extern Bool          dmxGetScreenAttributes(int physical,
00095                                             DMXScreenAttributesPtr attr);
00096 extern Bool          dmxGetWindowAttributes(WindowPtr pWindow,
00097                                             DMXWindowAttributesPtr attr);
00098 extern void          dmxGetDesktopAttributes(DMXDesktopAttributesPtr attr);
00099 extern int           dmxGetInputCount(void);
00100 extern int           dmxGetInputAttributes(int deviceId,
00101                                            DMXInputAttributesPtr attr);
00102 extern int           dmxAddInput(DMXInputAttributesPtr attr, int *deviceId);
00103 extern int           dmxRemoveInput(int deviceId);
00104 
00105 extern int           dmxConfigureScreenWindows(int nscreens,
00106                                                CARD32 *screens,
00107                                                DMXScreenAttributesPtr attribs,
00108                                                int *errorScreen);
00109 
00110 extern int           dmxConfigureDesktop(DMXDesktopAttributesPtr attribs);
00111 
00112 /* dmxUpdateScreenResources exposed for dmxCreateWindow in dmxwindow.c */
00113 extern void          dmxUpdateScreenResources(ScreenPtr pScreen,
00114                                               int x, int y, int w, int h);
00115 
00116 extern int           dmxAttachScreen(int idx, DMXScreenAttributesPtr attr);
00117 extern int           dmxDetachScreen(int idx);
00118 #endif