aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/Xext/dpms.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2009-09-09 05:23:48 +0000
committermarha <marha@users.sourceforge.net>2009-09-09 05:23:48 +0000
commit81f91c615982e50bb62708201569c33a3cd3d973 (patch)
tree4f32ecc48a3b7b5e76642f3792338263c53879bd /xorg-server/Xext/dpms.c
parentb571a562410f565af2bdde52d9f7f9a23ffae04f (diff)
parenta915739887477b28d924ecc8417ee107d125bd6c (diff)
downloadvcxsrv-81f91c615982e50bb62708201569c33a3cd3d973.tar.gz
vcxsrv-81f91c615982e50bb62708201569c33a3cd3d973.tar.bz2
vcxsrv-81f91c615982e50bb62708201569c33a3cd3d973.zip
svn merge https://vcxsrv.svn.sourceforge.net/svnroot/vcxsrv/branches/released .
Diffstat (limited to 'xorg-server/Xext/dpms.c')
-rw-r--r--xorg-server/Xext/dpms.c108
1 files changed, 28 insertions, 80 deletions
diff --git a/xorg-server/Xext/dpms.c b/xorg-server/Xext/dpms.c
index 06425993b..1130fe244 100644
--- a/xorg-server/Xext/dpms.c
+++ b/xorg-server/Xext/dpms.c
@@ -26,13 +26,6 @@ Equipment Corporation.
******************************************************************/
-/*
- * HISTORY
- *
- * @(#)RCSfile: dpms.c,v Revision: 1.1.4.5 (DEC) Date: 1996/03/04 15:27:00
- */
-
-
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#else
@@ -46,42 +39,12 @@ Equipment Corporation.
#include "dixstruct.h"
#include "extnsionst.h"
#include "opaque.h"
-#define DPMS_SERVER
-#include <X11/extensions/dpms.h>
-#include <X11/extensions/dpmsstr.h>
+#include <X11/extensions/dpmsproto.h>
#include "dpmsproc.h"
#include "modinit.h"
-static DISPATCH_PROC(ProcDPMSDispatch);
-static DISPATCH_PROC(SProcDPMSDispatch);
-static DISPATCH_PROC(ProcDPMSGetVersion);
-static DISPATCH_PROC(SProcDPMSGetVersion);
-static DISPATCH_PROC(ProcDPMSGetTimeouts);
-static DISPATCH_PROC(SProcDPMSGetTimeouts);
-static DISPATCH_PROC(ProcDPMSSetTimeouts);
-static DISPATCH_PROC(SProcDPMSSetTimeouts);
-static DISPATCH_PROC(ProcDPMSEnable);
-static DISPATCH_PROC(SProcDPMSEnable);
-static DISPATCH_PROC(ProcDPMSDisable);
-static DISPATCH_PROC(SProcDPMSDisable);
-static DISPATCH_PROC(ProcDPMSForceLevel);
-static DISPATCH_PROC(SProcDPMSForceLevel);
-static DISPATCH_PROC(ProcDPMSInfo);
-static DISPATCH_PROC(SProcDPMSInfo);
-static DISPATCH_PROC(ProcDPMSCapable);
-static DISPATCH_PROC(SProcDPMSCapable);
-
-void
-DPMSExtensionInit(INITARGS)
-{
- AddExtension(DPMSExtensionName, 0, 0,
- ProcDPMSDispatch, SProcDPMSDispatch,
- NULL, StandardMinorOpcode);
-}
-
static int
-ProcDPMSGetVersion(client)
- ClientPtr client;
+ProcDPMSGetVersion(ClientPtr client)
{
/* REQUEST(xDPMSGetVersionReq); */
xDPMSGetVersionReply rep;
@@ -125,8 +88,7 @@ ProcDPMSCapable(ClientPtr client)
}
static int
-ProcDPMSGetTimeouts(client)
- ClientPtr client;
+ProcDPMSGetTimeouts(ClientPtr client)
{
/* REQUEST(xDPMSGetTimeoutsReq); */
xDPMSGetTimeoutsReply rep;
@@ -152,8 +114,7 @@ ProcDPMSGetTimeouts(client)
}
static int
-ProcDPMSSetTimeouts(client)
- ClientPtr client;
+ProcDPMSSetTimeouts(ClientPtr client)
{
REQUEST(xDPMSSetTimeoutsReq);
@@ -179,8 +140,7 @@ ProcDPMSSetTimeouts(client)
}
static int
-ProcDPMSEnable(client)
- ClientPtr client;
+ProcDPMSEnable(ClientPtr client)
{
Bool was_enabled = DPMSEnabled;
@@ -196,8 +156,7 @@ ProcDPMSEnable(client)
}
static int
-ProcDPMSDisable(client)
- ClientPtr client;
+ProcDPMSDisable(ClientPtr client)
{
/* REQUEST(xDPMSDisableReq); */
@@ -211,8 +170,7 @@ ProcDPMSDisable(client)
}
static int
-ProcDPMSForceLevel(client)
- ClientPtr client;
+ProcDPMSForceLevel(ClientPtr client)
{
REQUEST(xDPMSForceLevelReq);
@@ -221,19 +179,10 @@ ProcDPMSForceLevel(client)
if (!DPMSEnabled)
return BadMatch;
- if (stuff->level == DPMSModeOn) {
- lastDeviceEventTime.milliseconds =
- GetTimeInMillis();
- } else if (stuff->level == DPMSModeStandby) {
- lastDeviceEventTime.milliseconds =
- GetTimeInMillis() - DPMSStandbyTime;
- } else if (stuff->level == DPMSModeSuspend) {
- lastDeviceEventTime.milliseconds =
- GetTimeInMillis() - DPMSSuspendTime;
- } else if (stuff->level == DPMSModeOff) {
- lastDeviceEventTime.milliseconds =
- GetTimeInMillis() - DPMSOffTime;
- } else {
+ if (stuff->level != DPMSModeOn &&
+ stuff->level != DPMSModeStandby &&
+ stuff->level != DPMSModeSuspend &&
+ stuff->level != DPMSModeOff) {
client->errorValue = stuff->level;
return BadValue;
}
@@ -267,8 +216,7 @@ ProcDPMSInfo(ClientPtr client)
}
static int
-ProcDPMSDispatch (client)
- ClientPtr client;
+ProcDPMSDispatch (ClientPtr client)
{
REQUEST(xReq);
@@ -296,8 +244,7 @@ ProcDPMSDispatch (client)
}
static int
-SProcDPMSGetVersion(client)
- ClientPtr client;
+SProcDPMSGetVersion(ClientPtr client)
{
int n;
REQUEST(xDPMSGetVersionReq);
@@ -322,8 +269,7 @@ SProcDPMSCapable(ClientPtr client)
}
static int
-SProcDPMSGetTimeouts(client)
- ClientPtr client;
+SProcDPMSGetTimeouts(ClientPtr client)
{
REQUEST(xDPMSGetTimeoutsReq);
int n;
@@ -335,8 +281,7 @@ SProcDPMSGetTimeouts(client)
}
static int
-SProcDPMSSetTimeouts(client)
- ClientPtr client;
+SProcDPMSSetTimeouts(ClientPtr client)
{
REQUEST(xDPMSSetTimeoutsReq);
int n;
@@ -351,8 +296,7 @@ SProcDPMSSetTimeouts(client)
}
static int
-SProcDPMSEnable(client)
- ClientPtr client;
+SProcDPMSEnable(ClientPtr client)
{
REQUEST(xDPMSEnableReq);
int n;
@@ -364,8 +308,7 @@ SProcDPMSEnable(client)
}
static int
-SProcDPMSDisable(client)
- ClientPtr client;
+SProcDPMSDisable(ClientPtr client)
{
REQUEST(xDPMSDisableReq);
int n;
@@ -377,8 +320,7 @@ SProcDPMSDisable(client)
}
static int
-SProcDPMSForceLevel(client)
- ClientPtr client;
+SProcDPMSForceLevel(ClientPtr client)
{
REQUEST(xDPMSForceLevelReq);
int n;
@@ -392,8 +334,7 @@ SProcDPMSForceLevel(client)
}
static int
-SProcDPMSInfo(client)
- ClientPtr client;
+SProcDPMSInfo(ClientPtr client)
{
REQUEST(xDPMSInfoReq);
int n;
@@ -405,8 +346,7 @@ SProcDPMSInfo(client)
}
static int
-SProcDPMSDispatch (client)
- ClientPtr client;
+SProcDPMSDispatch (ClientPtr client)
{
REQUEST(xReq);
switch (stuff->data)
@@ -431,3 +371,11 @@ SProcDPMSDispatch (client)
return BadRequest;
}
}
+
+void
+DPMSExtensionInit(INITARGS)
+{
+ AddExtension(DPMSExtensionName, 0, 0,
+ ProcDPMSDispatch, SProcDPMSDispatch,
+ NULL, StandardMinorOpcode);
+}