From 2828d92c6ca400b603b6a20a221d9c858732292f Mon Sep 17 00:00:00 2001 From: Alan Hourihane Date: Tue, 11 Oct 2005 14:45:01 +0000 Subject: [PATCH] programs/Xserver/hw/xfree86/common/xf86RandR.c programs/Xserver/hw/xfree86/loader/xf86sym.c Add a new function xf86GetRotation to allow third party modules to obtain the current rotation. --- hw/xfree86/common/xf86RandR.c | 13 ++++++++++++- hw/xfree86/loader/xf86sym.c | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/hw/xfree86/common/xf86RandR.c b/hw/xfree86/common/xf86RandR.c index 7d79395a4..da8be9bd3 100644 --- a/hw/xfree86/common/xf86RandR.c +++ b/hw/xfree86/common/xf86RandR.c @@ -47,7 +47,7 @@ typedef struct _xf86RandRInfo { Rotation rotation; } XF86RandRInfoRec, *XF86RandRInfoPtr; -static int xf86RandRIndex; +static int xf86RandRIndex = -1; static int xf86RandRGeneration; #define XF86RANDRINFO(p) ((XF86RandRInfoPtr) (p)->devPrivates[xf86RandRIndex].ptr) @@ -317,6 +317,17 @@ xf86RandRCloseScreen (int index, ScreenPtr pScreen) return (*pScreen->CloseScreen) (index, pScreen); } +Rotation +xf86GetRotation(ScreenPtr pScreen) +{ + XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); + + if (xf86RandRIndex == -1) + return RR_Rotate_0; + + return randrp->rotation; +} + Bool xf86RandRInit (ScreenPtr pScreen) { diff --git a/hw/xfree86/loader/xf86sym.c b/hw/xfree86/loader/xf86sym.c index c68077834..b26ec8407 100644 --- a/hw/xfree86/loader/xf86sym.c +++ b/hw/xfree86/loader/xf86sym.c @@ -474,6 +474,7 @@ LOOKUP xfree86LookupTab[] = { SYMFUNC(xf86CommonSpecialKey) SYMFUNC(xf86IsPc98) SYMFUNC(xf86DisableRandR) + SYMFUNC(xf86GetRotation) SYMFUNC(xf86GetVersion) SYMFUNC(xf86GetModuleVersion) SYMFUNC(xf86GetClocks)