#include <string.h>
#include "scrnintstr.h"
-#ifdef RANDR
#include "randrstr.h"
-#endif
#include "RandrGlue.h"
int vncRandRResizeScreen(int scrIdx, int width, int height)
{
-#ifdef RANDR
ScreenPtr pScreen = screenInfo.screens[scrIdx];
/* Try to retain DPI when we resize */
return RRScreenSizeSet(pScreen, width, height,
pScreen->mmWidth * width / pScreen->width,
pScreen->mmHeight * height / pScreen->height);
-#else
- return 0;
-#endif
}
void vncRandRUpdateSetTime(int scrIdx)
{
-#ifdef RANDR
rrScrPrivPtr rp = rrGetScrPriv(screenInfo.screens[scrIdx]);
rp->lastSetTime = currentTime;
-#endif
}
int vncRandRHasOutputClones(int scrIdx)
{
-#ifdef RANDR
rrScrPrivPtr rp = rrGetScrPriv(screenInfo.screens[scrIdx]);
for (int i = 0;i < rp->numCrtcs;i++) {
if (rp->crtcs[i]->numOutputs > 1)
return 1;
}
-#endif
return 0;
}
int vncRandRGetOutputCount(int scrIdx)
{
-#ifdef RANDR
rrScrPrivPtr rp = rrGetScrPriv(screenInfo.screens[scrIdx]);
return rp->numOutputs;
-#else
- return 0;
-#endif
}
int vncRandRGetAvailableOutputs(int scrIdx)
{
-#ifdef RANDR
rrScrPrivPtr rp = rrGetScrPriv(screenInfo.screens[scrIdx]);
int availableOutputs;
free(usedCrtcs);
return availableOutputs;
-#else
- return 0;
-#endif
}
char *vncRandRGetOutputName(int scrIdx, int outputIdx)
{
-#ifdef RANDR
rrScrPrivPtr rp = rrGetScrPriv(screenInfo.screens[scrIdx]);
return strdup(rp->outputs[outputIdx]->name);
-#else
- return strdup("");
-#endif
}
int vncRandRIsOutputEnabled(int scrIdx, int outputIdx)
{
-#ifdef RANDR
rrScrPrivPtr rp = rrGetScrPriv(screenInfo.screens[scrIdx]);
if (rp->outputs[outputIdx]->crtc == NULL)
return 0;
return 1;
-#else
- return 0;
-#endif
}
int vncRandRIsOutputUsable(int scrIdx, int outputIdx)
{
-#ifdef RANDR
rrScrPrivPtr rp = rrGetScrPriv(screenInfo.screens[scrIdx]);
RROutputPtr output;
if (output->crtcs[i]->numOutputs == 0)
return 1;
}
-#endif
return 0;
}
int vncRandRDisableOutput(int scrIdx, int outputIdx)
{
-#ifdef RANDR
rrScrPrivPtr rp = rrGetScrPriv(screenInfo.screens[scrIdx]);
RRCrtcPtr crtc;
return 1;
return RRCrtcSet(crtc, NULL, crtc->x, crtc->y, crtc->rotation, 0, NULL);
-#else
- return 0;
-#endif
}
unsigned int vncRandRGetOutputId(int scrIdx, int outputIdx)
{
-#ifdef RANDR
rrScrPrivPtr rp = rrGetScrPriv(screenInfo.screens[scrIdx]);
return rp->outputs[outputIdx]->id;
-#else
- return 0;
-#endif
}
void vncRandRGetOutputDimensions(int scrIdx, int outputIdx,
int *x, int *y, int *width, int *height)
{
-#ifdef RANDR
rrScrPrivPtr rp = rrGetScrPriv(screenInfo.screens[scrIdx]);
int swap;
*height = swap;
break;
}
-#endif
}
int vncRandRReconfigureOutput(int scrIdx, int outputIdx, int x, int y,
int width, int height)
{
-#ifdef RANDR
rrScrPrivPtr rp = rrGetScrPriv(screenInfo.screens[scrIdx]);
RROutputPtr output;
/* Reconfigure new mode and position */
return RRCrtcSet(crtc, mode, x, y, crtc->rotation, 1, &output);
-#else
- return 0;
-#endif
}
#ifdef RENDER
#include "picturestr.h"
#endif
-#ifdef RANDR
#include "randrstr.h"
-#endif
#define DBGPRINT(x) //(fprintf x)
TriFanProcPtr TriFan;
#endif
#endif
-#ifdef RANDR
RRSetConfigProcPtr rrSetConfig;
RRScreenSetSizeProcPtr rrScreenSetSize;
RRCrtcSetProcPtr rrCrtcSet;
-#endif
} vncHooksScreenRec, *vncHooksScreenPtr;
typedef struct _vncHooksGCRec {
int npoint, xPointFixed * points);
#endif
#endif
-#ifdef RANDR
static Bool vncHooksRandRSetConfig(ScreenPtr pScreen, Rotation rotation,
int rate, RRScreenSizePtr pSize);
static Bool vncHooksRandRScreenSetSize(ScreenPtr pScreen,
RRModePtr mode, int x, int y,
Rotation rotation, int numOutputs,
RROutputPtr *outputs);
-#endif
// GC "funcs"
#ifdef RENDER
PictureScreenPtr ps;
#endif
-#ifdef RANDR
rrScrPrivPtr rp;
-#endif
pScreen = screenInfo.screens[scrIdx];
#endif
}
#endif
-#ifdef RANDR
rp = rrGetScrPriv(pScreen);
if (rp) {
/* Some RandR callbacks are optional */
if (rp->rrCrtcSet)
wrap(vncHooksScreen, rp, rrCrtcSet, vncHooksRandRCrtcSet);
}
-#endif
return TRUE;
}
#ifdef RENDER
PictureScreenPtr ps;
#endif
-#ifdef RANDR
rrScrPrivPtr rp;
-#endif
SCREEN_PROLOGUE(pScreen_, CloseScreen);
#endif
}
#endif
-#ifdef RANDR
rp = rrGetScrPriv(pScreen);
if (rp) {
unwrap(vncHooksScreen, rp, rrSetConfig);
unwrap(vncHooksScreen, rp, rrScreenSetSize);
unwrap(vncHooksScreen, rp, rrCrtcSet);
}
-#endif
DBGPRINT((stderr,"vncHooksCloseScreen: unwrapped screen functions\n"));
#endif /* RENDER */
-#ifdef RANDR
-
// Unwrap and rewrap helpers
#define RANDR_PROLOGUE(field) \
return TRUE;
}
-#endif /* RANDR */
-
/////////////////////////////////////////////////////////////////////////////
//
// GC "funcs"