xserver-multidpi/randr/randrstr.h

220 lines
5.2 KiB
C
Raw Normal View History

2003-11-14 17:48:57 +01:00
/*
* Copyright © 2000 Compaq Computer Corporation
2006-07-02 04:46:38 +02:00
* Copyright © 2002 Hewlett-Packard Company
* Copyright © 2006 Intel Corporation
2003-11-14 17:48:57 +01:00
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
2006-07-02 04:46:38 +02:00
* the above copyright notice appear in all copies and that both that copyright
* notice and this permission notice appear in supporting documentation, and
* that the name of the copyright holders not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. The copyright holders make no representations
* about the suitability of this software for any purpose. It is provided "as
* is" without express or implied warranty.
2003-11-14 17:48:57 +01:00
*
2006-07-02 04:46:38 +02:00
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
2003-11-14 17:48:57 +01:00
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
2006-07-02 04:46:38 +02:00
* EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
2003-11-14 17:48:57 +01:00
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
2006-07-02 04:46:38 +02:00
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
* OF THIS SOFTWARE.
*
* Author: Jim Gettys, Hewlett-Packard Company, Inc.
* Keith Packard, Intel Corporation
2003-11-14 17:48:57 +01:00
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
2003-11-14 17:48:57 +01:00
#ifndef _RANDRSTR_H_
#define _RANDRSTR_H_
2006-07-02 04:46:38 +02:00
#include <X11/extensions/randrproto.h>
2003-11-14 17:48:57 +01:00
2006-07-02 04:46:38 +02:00
typedef struct _rrMode {
struct _rrMode *next;
2003-11-14 17:48:57 +01:00
int id;
Bool referenced;
Bool oldReferenced;
2006-07-02 04:46:38 +02:00
xRRMonitorMode mode;
} RRMode, *RRModePtr;
typedef struct _rrMonitor {
struct _rrMonitor *next;
ScreenPtr pScreen;
RRModePtr pModes;
void *identifier; /* made unique by DDX */
Bool referenced;
/*
* Current state
*/
int mode;
int x, y;
Rotation rotation;
} RRMonitor, *RRMonitorPtr;
typedef Bool (*RRSetScreenSizeProcPtr) (ScreenPtr pScreen,
CARD16 width,
CARD16 height,
CARD32 widthInMM,
CARD32 heightInMM);
typedef Bool (*RRSetModeProcPtr) (ScreenPtr pScreen,
int monitor,
RRModePtr pMode,
int x,
int y,
Rotation rotation);
typedef Bool (*RRGetInfoProcPtr) (ScreenPtr pScreen, Rotation *rotations);
typedef Bool (*RRCloseScreenProcPtr) ( int i, ScreenPtr pscreen);
#ifdef RANDR_SCREEN_INTERFACE
typedef void *RRScreenSizePtr;
2003-11-14 17:48:57 +01:00
typedef Bool (*RRSetConfigProcPtr) (ScreenPtr pScreen,
Rotation rotation,
int rate,
RRScreenSizePtr pSize);
2006-07-02 04:46:38 +02:00
#endif
2003-11-14 17:48:57 +01:00
2006-07-02 04:46:38 +02:00
2003-11-14 17:48:57 +01:00
typedef struct _rrScrPriv {
2006-07-02 04:46:38 +02:00
RRSetModeProcPtr rrSetMode;
2003-11-14 17:48:57 +01:00
RRGetInfoProcPtr rrGetInfo;
2006-07-02 04:46:38 +02:00
RRCloseScreenProcPtr CloseScreen;
2003-11-14 17:48:57 +01:00
TimeStamp lastSetTime; /* last changed by client */
TimeStamp lastConfigTime; /* possible configs changed */
2006-07-02 04:46:38 +02:00
/*
* monitor data
*/
RRMonitorPtr pMonitors;
#ifdef RANDR_SCREEN_INTERFACE
2003-11-14 17:48:57 +01:00
/*
* Configuration information
*/
Rotation rotations;
2006-07-02 04:46:38 +02:00
RRSetConfigProcPtr rrSetConfig;
2003-11-14 17:48:57 +01:00
Rotation rotation;
2006-07-02 04:46:38 +02:00
#endif
2003-11-14 17:48:57 +01:00
} rrScrPrivRec, *rrScrPrivPtr;
extern int rrPrivIndex;
#define rrGetScrPriv(pScr) ((rrScrPrivPtr) (pScr)->devPrivates[rrPrivIndex].ptr)
#define rrScrPriv(pScr) rrScrPrivPtr pScrPriv = rrGetScrPriv(pScr)
#define SetRRScreen(s,p) ((s)->devPrivates[rrPrivIndex].ptr = (pointer) (p))
/* Initialize the extension */
void
RRExtensionInit (void);
2006-07-02 04:46:38 +02:00
/*
* Then, register a monitor with the screen
*/
RRMonitorPtr
RRRegisterMonitor (ScreenPtr pScreen,
void *identifier,
Rotation rotations);
/*
* Next, register the list of modes with the monitor
*/
RRModePtr
RRRegisterMode (RRMonitorPtr pMonitor,
xRRMonitorMode *pMode,
char *name,
int nameLength);
/*
* Finally, set the current configuration of each monitor
*/
void
RRSetCurrentMode (RRMonitorPtr pMonitor,
RRModePtr pMode,
Rotation rotation);
Bool RRScreenInit(ScreenPtr pScreen);
Rotation
RRGetRotation (ScreenPtr pScreen);
Bool
miRandRInit (ScreenPtr pScreen);
Bool
miRRGetInfo (ScreenPtr pScreen, Rotation *rotations);
Bool
miRRGetScreenInfo (ScreenPtr pScreen);
Bool
miRRSetMode (ScreenPtr pScreen,
int monitor,
RRModePtr pMode,
Rotation rotation);
#ifdef RANDR_SCREEN_INTERFACE
/*
* This is the old interface, deprecated but left
* around for compatibility
*/
2003-11-14 17:48:57 +01:00
/*
* Then, register the specific size with the screen
*/
RRScreenSizePtr
RRRegisterSize (ScreenPtr pScreen,
short width,
short height,
short mmWidth,
short mmHeight);
Bool RRRegisterRate (ScreenPtr pScreen,
RRScreenSizePtr pSize,
int rate);
2006-07-02 04:46:38 +02:00
Bool RRRegisterRotation (ScreenPtr pScreen,
Rotation rotation);
2003-11-14 17:48:57 +01:00
/*
* Finally, set the current configuration of the screen
*/
void
RRSetCurrentConfig (ScreenPtr pScreen,
Rotation rotation,
int rate,
RRScreenSizePtr pSize);
2004-06-25 10:56:04 +02:00
int
RRSetScreenConfig (ScreenPtr pScreen,
Rotation rotation,
int rate,
RRScreenSizePtr pSize);
2003-11-14 17:48:57 +01:00
Bool
miRRSetConfig (ScreenPtr pScreen,
Rotation rotation,
int rate,
RRScreenSizePtr size);
2006-07-02 04:46:38 +02:00
#endif
2003-11-14 17:48:57 +01:00
#endif /* _RANDRSTR_H_ */