summaryrefslogtreecommitdiffstats
path: root/xorg/X11R7.6/rdp/rdprandr.c
diff options
context:
space:
mode:
authorLaxmikant Rashinkar <LK.Rashinkar@gmail.com>2012-09-19 20:51:34 -0700
committerLaxmikant Rashinkar <LK.Rashinkar@gmail.com>2012-09-19 20:51:34 -0700
commit1123323fda6d128fb98b0427e0ea5f6a2dc9e632 (patch)
tree3407a3771a069f812554312ce7c36db625139cc2 /xorg/X11R7.6/rdp/rdprandr.c
parent3cedfae76a2351bc8b1e5bd2ee33bbf8630dbacf (diff)
downloadxrdp-proprietary-1123323fda6d128fb98b0427e0ea5f6a2dc9e632.tar.gz
xrdp-proprietary-1123323fda6d128fb98b0427e0ea5f6a2dc9e632.zip
o moved from GNU General Public License to Apache License, Version 2.0
o applied new coding standards to all .c files o moved some files around
Diffstat (limited to 'xorg/X11R7.6/rdp/rdprandr.c')
-rw-r--r--xorg/X11R7.6/rdp/rdprandr.c299
1 files changed, 155 insertions, 144 deletions
diff --git a/xorg/X11R7.6/rdp/rdprandr.c b/xorg/X11R7.6/rdp/rdprandr.c
index ec011e8f..832d86d4 100644
--- a/xorg/X11R7.6/rdp/rdprandr.c
+++ b/xorg/X11R7.6/rdp/rdprandr.c
@@ -42,17 +42,17 @@ static XID g_wid = 0;
Bool
rdpRRRegisterSize(ScreenPtr pScreen, int width, int height)
{
- int mmwidth;
- int mmheight;
- RRScreenSizePtr pSize;
-
- ErrorF("rdpRRRegisterSize: width %d height %d\n", width, height);
- mmwidth = PixelToMM(width);
- mmheight = PixelToMM(height);
- pSize = RRRegisterSize(pScreen, width, height, mmwidth, mmheight);
- /* Tell RandR what the current config is */
- RRSetCurrentConfig(pScreen, RR_Rotate_0, 0, pSize);
- return TRUE;
+ int mmwidth;
+ int mmheight;
+ RRScreenSizePtr pSize;
+
+ ErrorF("rdpRRRegisterSize: width %d height %d\n", width, height);
+ mmwidth = PixelToMM(width);
+ mmheight = PixelToMM(height);
+ pSize = RRRegisterSize(pScreen, width, height, mmwidth, mmheight);
+ /* Tell RandR what the current config is */
+ RRSetCurrentConfig(pScreen, RR_Rotate_0, 0, pSize);
+ return TRUE;
}
/******************************************************************************/
@@ -60,24 +60,24 @@ Bool
rdpRRSetConfig(ScreenPtr pScreen, Rotation rotateKind, int rate,
RRScreenSizePtr pSize)
{
- ErrorF("rdpRRSetConfig:\n");
- return TRUE;
+ ErrorF("rdpRRSetConfig:\n");
+ return TRUE;
}
/******************************************************************************/
Bool
-rdpRRGetInfo(ScreenPtr pScreen, Rotation* pRotations)
+rdpRRGetInfo(ScreenPtr pScreen, Rotation *pRotations)
{
- int width;
- int height;
+ int width;
+ int height;
- ErrorF("rdpRRGetInfo:\n");
- *pRotations = RR_Rotate_0;
+ ErrorF("rdpRRGetInfo:\n");
+ *pRotations = RR_Rotate_0;
- width = g_rdpScreen.width;
- height = g_rdpScreen.height;
- rdpRRRegisterSize(pScreen, width, height);
- return TRUE;
+ width = g_rdpScreen.width;
+ height = g_rdpScreen.height;
+ rdpRRRegisterSize(pScreen, width, height);
+ return TRUE;
}
/******************************************************************************/
@@ -86,35 +86,39 @@ rdpRRGetInfo(ScreenPtr pScreen, Rotation* pRotations)
static int
rdpInvalidateArea(ScreenPtr pScreen, int x, int y, int cx, int cy)
{
- WindowPtr pWin;
- int result;
- int attri;
- XID attributes[4];
- Mask mask;
-
- DEBUG_OUT(("rdpInvalidateArea:\n"));
- mask = 0;
- attri = 0;
- attributes[attri++] = pScreen->blackPixel;
- mask |= CWBackPixel;
- attributes[attri++] = xTrue;
- mask |= CWOverrideRedirect;
- if (g_wid == 0)
- {
- g_wid = FakeClientID(0);
- }
- pWin = CreateWindow(g_wid, pScreen->root,
- x, y, cx, cy, 0, InputOutput, mask,
- attributes, 0, serverClient,
- wVisual(pScreen->root), &result);
- if (result == 0)
- {
- g_invalidate_window = pWin;
- MapWindow(pWin, serverClient);
- DeleteWindow(pWin, None);
- g_invalidate_window = pWin;
- }
- return 0;
+ WindowPtr pWin;
+ int result;
+ int attri;
+ XID attributes[4];
+ Mask mask;
+
+ DEBUG_OUT(("rdpInvalidateArea:\n"));
+ mask = 0;
+ attri = 0;
+ attributes[attri++] = pScreen->blackPixel;
+ mask |= CWBackPixel;
+ attributes[attri++] = xTrue;
+ mask |= CWOverrideRedirect;
+
+ if (g_wid == 0)
+ {
+ g_wid = FakeClientID(0);
+ }
+
+ pWin = CreateWindow(g_wid, pScreen->root,
+ x, y, cx, cy, 0, InputOutput, mask,
+ attributes, 0, serverClient,
+ wVisual(pScreen->root), &result);
+
+ if (result == 0)
+ {
+ g_invalidate_window = pWin;
+ MapWindow(pWin, serverClient);
+ DeleteWindow(pWin, None);
+ g_invalidate_window = pWin;
+ }
+
+ return 0;
}
/******************************************************************************/
@@ -122,84 +126,87 @@ Bool
rdpRRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height,
CARD32 mmWidth, CARD32 mmHeight)
{
- PixmapPtr screenPixmap;
- BoxRec box;
-
- ErrorF("rdpRRScreenSetSize: width %d height %d mmWidth %d mmHeight %d\n",
- width, height, (int)mmWidth, (int)mmHeight);
-
- if ((width < 1) || (height < 1))
- {
- ErrorF(" error width %d height %d\n", width, height);
- return FALSE;
- }
- g_rdpScreen.width = width;
- g_rdpScreen.height = height;
- g_rdpScreen.paddedWidthInBytes =
- PixmapBytePad(g_rdpScreen.width, g_rdpScreen.depth);
- g_rdpScreen.sizeInBytes =
- g_rdpScreen.paddedWidthInBytes * g_rdpScreen.height;
- pScreen->width = width;
- pScreen->height = height;
- pScreen->mmWidth = mmWidth;
- pScreen->mmHeight = mmHeight;
-
- screenPixmap = pScreen->GetScreenPixmap(pScreen);
- if (screenPixmap != 0)
- {
- ErrorF(" resizing screenPixmap [%p] to %dx%d, currently at %dx%d\n",
- (void*)screenPixmap, width, height,
- screenPixmap->drawable.width, screenPixmap->drawable.height);
- pScreen->ModifyPixmapHeader(screenPixmap, width, height,
- g_rdpScreen.depth, g_rdpScreen.bitsPerPixel,
- g_rdpScreen.paddedWidthInBytes,
- g_rdpScreen.pfbMemory);
- ErrorF(" pixmap resized to %dx%d\n",
- screenPixmap->drawable.width, screenPixmap->drawable.height);
- }
- DEBUG_OUT((" root window %p\n", (void*)pScreen->root));
- box.x1 = 0;
- box.y1 = 0;
- box.x2 = width;
- box.y2 = height;
- RegionInit(&pScreen->root->winSize, &box, 1);
- RegionInit(&pScreen->root->borderSize, &box, 1);
- RegionReset(&pScreen->root->borderClip, &box);
- RegionBreak(&pScreen->root->clipList);
- pScreen->root->drawable.width = width;
- pScreen->root->drawable.height = height;
- ResizeChildrenWinSize(pScreen->root, 0, 0, 0, 0);
- RRScreenSizeNotify(pScreen);
- rdpInvalidateArea(g_pScreen, 0, 0, g_rdpScreen.width, g_rdpScreen.height);
- ErrorF(" screen resized to %dx%d\n",
- pScreen->width, pScreen->height);
- return TRUE;
+ PixmapPtr screenPixmap;
+ BoxRec box;
+
+ ErrorF("rdpRRScreenSetSize: width %d height %d mmWidth %d mmHeight %d\n",
+ width, height, (int)mmWidth, (int)mmHeight);
+
+ if ((width < 1) || (height < 1))
+ {
+ ErrorF(" error width %d height %d\n", width, height);
+ return FALSE;
+ }
+
+ g_rdpScreen.width = width;
+ g_rdpScreen.height = height;
+ g_rdpScreen.paddedWidthInBytes =
+ PixmapBytePad(g_rdpScreen.width, g_rdpScreen.depth);
+ g_rdpScreen.sizeInBytes =
+ g_rdpScreen.paddedWidthInBytes * g_rdpScreen.height;
+ pScreen->width = width;
+ pScreen->height = height;
+ pScreen->mmWidth = mmWidth;
+ pScreen->mmHeight = mmHeight;
+
+ screenPixmap = pScreen->GetScreenPixmap(pScreen);
+
+ if (screenPixmap != 0)
+ {
+ ErrorF(" resizing screenPixmap [%p] to %dx%d, currently at %dx%d\n",
+ (void *)screenPixmap, width, height,
+ screenPixmap->drawable.width, screenPixmap->drawable.height);
+ pScreen->ModifyPixmapHeader(screenPixmap, width, height,
+ g_rdpScreen.depth, g_rdpScreen.bitsPerPixel,
+ g_rdpScreen.paddedWidthInBytes,
+ g_rdpScreen.pfbMemory);
+ ErrorF(" pixmap resized to %dx%d\n",
+ screenPixmap->drawable.width, screenPixmap->drawable.height);
+ }
+
+ DEBUG_OUT((" root window %p\n", (void *)pScreen->root));
+ box.x1 = 0;
+ box.y1 = 0;
+ box.x2 = width;
+ box.y2 = height;
+ RegionInit(&pScreen->root->winSize, &box, 1);
+ RegionInit(&pScreen->root->borderSize, &box, 1);
+ RegionReset(&pScreen->root->borderClip, &box);
+ RegionBreak(&pScreen->root->clipList);
+ pScreen->root->drawable.width = width;
+ pScreen->root->drawable.height = height;
+ ResizeChildrenWinSize(pScreen->root, 0, 0, 0, 0);
+ RRScreenSizeNotify(pScreen);
+ rdpInvalidateArea(g_pScreen, 0, 0, g_rdpScreen.width, g_rdpScreen.height);
+ ErrorF(" screen resized to %dx%d\n",
+ pScreen->width, pScreen->height);
+ return TRUE;
}
/******************************************************************************/
Bool
rdpRRCrtcSet(ScreenPtr pScreen, RRCrtcPtr crtc, RRModePtr mode,
int x, int y, Rotation rotation, int numOutputs,
- RROutputPtr* outputs)
+ RROutputPtr *outputs)
{
- ErrorF("rdpRRCrtcSet:\n");
- return TRUE;
+ ErrorF("rdpRRCrtcSet:\n");
+ return TRUE;
}
/******************************************************************************/
Bool
rdpRRCrtcSetGamma(ScreenPtr pScreen, RRCrtcPtr crtc)
{
- ErrorF("rdpRRCrtcSetGamma:\n");
- return TRUE;
+ ErrorF("rdpRRCrtcSetGamma:\n");
+ return TRUE;
}
/******************************************************************************/
Bool
rdpRRCrtcGetGamma(ScreenPtr pScreen, RRCrtcPtr crtc)
{
- ErrorF("rdpRRCrtcGetGamma:\n");
- return TRUE;
+ ErrorF("rdpRRCrtcGetGamma:\n");
+ return TRUE;
}
/******************************************************************************/
@@ -207,8 +214,8 @@ Bool
rdpRROutputSetProperty(ScreenPtr pScreen, RROutputPtr output, Atom property,
RRPropertyValuePtr value)
{
- ErrorF("rdpRROutputSetProperty:\n");
- return TRUE;
+ ErrorF("rdpRROutputSetProperty:\n");
+ return TRUE;
}
/******************************************************************************/
@@ -216,60 +223,64 @@ Bool
rdpRROutputValidateMode(ScreenPtr pScreen, RROutputPtr output,
RRModePtr mode)
{
- ErrorF("rdpRROutputValidateMode:\n");
- return TRUE;
+ ErrorF("rdpRROutputValidateMode:\n");
+ return TRUE;
}
/******************************************************************************/
void
rdpRRModeDestroy(ScreenPtr pScreen, RRModePtr mode)
{
- ErrorF("rdpRRModeDestroy:\n");
+ ErrorF("rdpRRModeDestroy:\n");
}
/******************************************************************************/
Bool
rdpRROutputGetProperty(ScreenPtr pScreen, RROutputPtr output, Atom property)
{
- ErrorF("rdpRROutputGetProperty:\n");
- return TRUE;
+ ErrorF("rdpRROutputGetProperty:\n");
+ return TRUE;
}
/******************************************************************************/
Bool
rdpRRGetPanning(ScreenPtr pScrn, RRCrtcPtr crtc, BoxPtr totalArea,
- BoxPtr trackingArea, INT16* border)
+ BoxPtr trackingArea, INT16 *border)
{
- ErrorF("rdpRRGetPanning:\n");
- if (totalArea != 0)
- {
- totalArea->x1 = 0;
- totalArea->y1 = 0;
- totalArea->x2 = g_rdpScreen.width;
- totalArea->y2 = g_rdpScreen.height;
- }
- if (trackingArea != 0)
- {
- trackingArea->x1 = 0;
- trackingArea->y1 = 0;
- trackingArea->x2 = g_rdpScreen.width;
- trackingArea->y2 = g_rdpScreen.height;
- }
- if (border != 0)
- {
- border[0] = 0;
- border[1] = 0;
- border[2] = 0;
- border[3] = 0;
- }
- return TRUE;
+ ErrorF("rdpRRGetPanning:\n");
+
+ if (totalArea != 0)
+ {
+ totalArea->x1 = 0;
+ totalArea->y1 = 0;
+ totalArea->x2 = g_rdpScreen.width;
+ totalArea->y2 = g_rdpScreen.height;
+ }
+
+ if (trackingArea != 0)
+ {
+ trackingArea->x1 = 0;
+ trackingArea->y1 = 0;
+ trackingArea->x2 = g_rdpScreen.width;
+ trackingArea->y2 = g_rdpScreen.height;
+ }
+
+ if (border != 0)
+ {
+ border[0] = 0;
+ border[1] = 0;
+ border[2] = 0;
+ border[3] = 0;
+ }
+
+ return TRUE;
}
/******************************************************************************/
Bool
rdpRRSetPanning(ScreenPtr pScrn, RRCrtcPtr crtc, BoxPtr totalArea,
- BoxPtr trackingArea, INT16* border)
+ BoxPtr trackingArea, INT16 *border)
{
- ErrorF("rdpRRSetPanning:\n");
- return TRUE;
+ ErrorF("rdpRRSetPanning:\n");
+ return TRUE;
}