aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xwin/winmisc.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/hw/xwin/winmisc.c')
-rw-r--r--xorg-server/hw/xwin/winmisc.c119
1 files changed, 55 insertions, 64 deletions
diff --git a/xorg-server/hw/xwin/winmisc.c b/xorg-server/hw/xwin/winmisc.c
index a5a2d3d1c..f810ed073 100644
--- a/xorg-server/hw/xwin/winmisc.c
+++ b/xorg-server/hw/xwin/winmisc.c
@@ -41,112 +41,103 @@
*/
void
-winQueryBestSizeNativeGDI (int class, unsigned short *pWidth,
- unsigned short *pHeight, ScreenPtr pScreen)
+winQueryBestSizeNativeGDI(int class, unsigned short *pWidth,
+ unsigned short *pHeight, ScreenPtr pScreen)
{
winDebug ("winQueryBestSizeNativeGDI\n");
}
#endif
-
/*
* Count the number of one bits in a color mask.
*/
CARD8
-winCountBits (DWORD dw)
+winCountBits(DWORD dw)
{
- DWORD dwBits = 0;
+ DWORD dwBits = 0;
- while (dw)
- {
- dwBits += (dw & 1);
- dw >>= 1;
+ while (dw) {
+ dwBits += (dw & 1);
+ dw >>= 1;
}
- return dwBits;
+ return dwBits;
}
-
/*
* Modify the screen pixmap to point to the new framebuffer address
*/
Bool
-winUpdateFBPointer (ScreenPtr pScreen, void *pbits)
+winUpdateFBPointer(ScreenPtr pScreen, void *pbits)
{
- winScreenPriv(pScreen);
- winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
-
- /* Location of shadow framebuffer has changed */
- pScreenInfo->pfb = pbits;
-
- /* Update the screen pixmap */
- if (!(*pScreen->ModifyPixmapHeader) (pScreen->devPrivate,
- pScreen->width,
- pScreen->height,
- pScreen->rootDepth,
- BitsPerPixel (pScreen->rootDepth),
- PixmapBytePad (pScreenInfo->dwStride,
- pScreenInfo->dwBPP),
- pScreenInfo->pfb))
- {
- FatalError ("winUpdateFramebufferPointer - Failed modifying "\
- "screen pixmap\n");
+ winScreenPriv(pScreen);
+ winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
+
+ /* Location of shadow framebuffer has changed */
+ pScreenInfo->pfb = pbits;
+
+ /* Update the screen pixmap */
+ if (!(*pScreen->ModifyPixmapHeader) (pScreen->devPrivate,
+ pScreen->width,
+ pScreen->height,
+ pScreen->rootDepth,
+ BitsPerPixel(pScreen->rootDepth),
+ PixmapBytePad(pScreenInfo->dwStride,
+ pScreenInfo->dwBPP),
+ pScreenInfo->pfb)) {
+ FatalError("winUpdateFramebufferPointer - Failed modifying "
+ "screen pixmap\n");
}
- return TRUE;
+ return TRUE;
}
-
#ifdef XWIN_NATIVEGDI
/*
* Paint the window background with the specified color
*/
BOOL
-winPaintBackground (HWND hwnd, COLORREF colorref)
+winPaintBackground(HWND hwnd, COLORREF colorref)
{
- HDC hdc;
- HBRUSH hbrush;
- RECT rect;
-
- /* Create an hdc */
- hdc = GetDC (hwnd);
- if (hdc == NULL)
- {
- printf ("gdiWindowProc - GetDC failed\n");
- exit (1);
+ HDC hdc;
+ HBRUSH hbrush;
+ RECT rect;
+
+ /* Create an hdc */
+ hdc = GetDC(hwnd);
+ if (hdc == NULL) {
+ printf("gdiWindowProc - GetDC failed\n");
+ exit(1);
}
- /* Create and select blue brush */
- hbrush = CreateSolidBrush (colorref);
- if (hbrush == NULL)
- {
- printf ("gdiWindowProc - CreateSolidBrush failed\n");
- exit (1);
+ /* Create and select blue brush */
+ hbrush = CreateSolidBrush(colorref);
+ if (hbrush == NULL) {
+ printf("gdiWindowProc - CreateSolidBrush failed\n");
+ exit(1);
}
- /* Get window extents */
- if (GetClientRect (hwnd, &rect) == FALSE)
- {
- printf ("gdiWindowProc - GetClientRect failed\n");
- exit (1);
+ /* Get window extents */
+ if (GetClientRect(hwnd, &rect) == FALSE) {
+ printf("gdiWindowProc - GetClientRect failed\n");
+ exit(1);
}
- /* Fill window with blue brush */
- if (FillRect (hdc, &rect, hbrush) == 0)
- {
- printf ("gdiWindowProc - FillRect failed\n");
- exit (1);
+ /* Fill window with blue brush */
+ if (FillRect(hdc, &rect, hbrush) == 0) {
+ printf("gdiWindowProc - FillRect failed\n");
+ exit(1);
}
- /* Delete blue brush */
- DeleteObject (hbrush);
+ /* Delete blue brush */
+ DeleteObject(hbrush);
- /* Release the hdc */
- ReleaseDC (hwnd, hdc);
+ /* Release the hdc */
+ ReleaseDC(hwnd, hdc);
- return TRUE;
+ return TRUE;
}
#endif