Skip to content

Commit

Permalink
Change RandR property datatype to include pending/valid values.
Browse files Browse the repository at this point in the history
This patch tracks the protocol changes which introduce more complex
semantics for RandR output properties including pending and valid value
information.
  • Loading branch information
Keith Packard committed Nov 21, 2006
1 parent 2953ef0 commit af55c65
Show file tree
Hide file tree
Showing 5 changed files with 384 additions and 124 deletions.
9 changes: 5 additions & 4 deletions randr/mirandr.c
Expand Up @@ -64,10 +64,11 @@ miRRCrtcSetGamma (ScreenPtr pScreen,
return TRUE;
}

static Bool
miRROutputSetProperty (ScreenPtr pScreen,
RROutputPtr output,
Atom property)
Bool
miRROutputSetProperty (ScreenPtr pScreen,
RROutputPtr output,
Atom property,
RRPropertyValuePtr value)
{
return TRUE;
}
Expand Down
57 changes: 50 additions & 7 deletions randr/randrstr.h
Expand Up @@ -69,9 +69,11 @@ extern int (*SProcRandrVector[RRNumberRequests])(ClientPtr);
*/

#define RRModeName(pMode) ((char *) (pMode + 1))
typedef struct _rrMode RRModeRec, *RRModePtr;
typedef struct _rrCrtc RRCrtcRec, *RRCrtcPtr;
typedef struct _rrOutput RROutputRec, *RROutputPtr;
typedef struct _rrMode RRModeRec, *RRModePtr;
typedef struct _rrPropertyValue RRPropertyValueRec, *RRPropertyValuePtr;
typedef struct _rrProperty RRPropertyRec, *RRPropertyPtr;
typedef struct _rrCrtc RRCrtcRec, *RRCrtcPtr;
typedef struct _rrOutput RROutputRec, *RROutputPtr;

struct _rrMode {
int refcnt;
Expand All @@ -81,6 +83,24 @@ struct _rrMode {
Bool userDefined;
};

struct _rrPropertyValue {
Atom type; /* ignored by server */
short format; /* format of data for swapping - 8,16,32 */
long size; /* size of data in (format/8) bytes */
pointer data; /* private to client */
};

struct _rrProperty {
RRPropertyPtr next;
ATOM propertyName;
Bool is_pending;
Bool range;
Bool immutable;
int num_valid;
INT32 *valid_values;
RRPropertyValueRec current, pending;
};

struct _rrCrtc {
RRCrtc id;
ScreenPtr pScreen;
Expand Down Expand Up @@ -116,7 +136,7 @@ struct _rrOutput {
int numPreferred;
RRModePtr *modes;
Bool changed;
PropertyPtr properties;
RRPropertyPtr properties;
void *devPrivate;
};

Expand All @@ -139,9 +159,10 @@ typedef Bool (*RRCrtcSetProcPtr) (ScreenPtr pScreen,
typedef Bool (*RRCrtcSetGammaProcPtr) (ScreenPtr pScreen,
RRCrtcPtr crtc);

typedef Bool (*RROutputSetPropertyProcPtr) (ScreenPtr pScreen,
RROutputPtr output,
Atom property);
typedef Bool (*RROutputSetPropertyProcPtr) (ScreenPtr pScreen,
RROutputPtr output,
Atom property,
RRPropertyValuePtr value);

#endif

Expand Down Expand Up @@ -363,6 +384,12 @@ miRRCrtcSet (ScreenPtr pScreen,
int numOutput,
RROutputPtr *outputs);

Bool
miRROutputSetProperty (ScreenPtr pScreen,
RROutputPtr output,
Atom property,
RRPropertyValuePtr value);

/* randr.c */
/*
* Send all pending events
Expand Down Expand Up @@ -676,6 +703,12 @@ RRPointerScreenConfigured (ScreenPtr pScreen);
void
RRDeleteAllOutputProperties (RROutputPtr output);

RRPropertyValuePtr
RRGetOutputProperty (RROutputPtr output, Atom property, Bool pending);

RRPropertyPtr
RRQueryOutputProperty (RROutputPtr output, Atom property);

void
RRDeleteOutputProperty (RROutputPtr output, Atom property);

Expand All @@ -685,6 +718,10 @@ RRChangeOutputProperty (RROutputPtr output, Atom property, Atom type,
pointer value, Bool sendevent);

int
RRConfigureOutputProperty (RROutputPtr output, Atom property,
Bool pending, Bool range, Bool immutable,
int num_values, INT32 *values);
int
ProcRRChangeOutputProperty (ClientPtr client);

int
Expand All @@ -693,6 +730,12 @@ ProcRRGetOutputProperty (ClientPtr client);
int
ProcRRListOutputProperties (ClientPtr client);

int
ProcRRQueryOutputProperty (ClientPtr client);

int
ProcRRConfigureOutputProperty (ClientPtr client);

int
ProcRRDeleteOutputProperty (ClientPtr client);

Expand Down
26 changes: 14 additions & 12 deletions randr/rrdispatch.c
Expand Up @@ -192,17 +192,19 @@ int (*ProcRandrVector[RRNumberRequests])(ClientPtr) = {
ProcRRGetScreenResources, /* 8 */
ProcRRGetOutputInfo, /* 9 */
ProcRRListOutputProperties, /* 10 */
ProcRRChangeOutputProperty, /* 11 */
ProcRRDeleteOutputProperty, /* 12 */
ProcRRGetOutputProperty, /* 13 */
ProcRRCreateMode, /* 14 */
ProcRRDestroyMode, /* 15 */
ProcRRAddOutputMode, /* 16 */
ProcRRDeleteOutputMode, /* 17 */
ProcRRGetCrtcInfo, /* 18 */
ProcRRSetCrtcConfig, /* 19 */
ProcRRGetCrtcGammaSize, /* 20 */
ProcRRGetCrtcGamma, /* 21 */
ProcRRSetCrtcGamma, /* 22 */
ProcRRQueryOutputProperty, /* 11 */
ProcRRConfigureOutputProperty, /* 12 */
ProcRRChangeOutputProperty, /* 13 */
ProcRRDeleteOutputProperty, /* 14 */
ProcRRGetOutputProperty, /* 15 */
ProcRRCreateMode, /* 16 */
ProcRRDestroyMode, /* 17 */
ProcRRAddOutputMode, /* 18 */
ProcRRDeleteOutputMode, /* 19 */
ProcRRGetCrtcInfo, /* 20 */
ProcRRSetCrtcConfig, /* 21 */
ProcRRGetCrtcGammaSize, /* 22 */
ProcRRGetCrtcGamma, /* 23 */
ProcRRSetCrtcGamma, /* 24 */
};

0 comments on commit af55c65

Please sign in to comment.