summaryrefslogtreecommitdiff
path: root/src/gx_cursor.c
diff options
context:
space:
mode:
authorJordan Crouse <jordan.crouse@amd.com>2008-03-11 16:21:58 -0600
committerJordan Crouse <jordan.crouse@amd.com>2008-03-14 14:16:42 -0600
commit1fd63467e3fa71f289f80dba013046d0065ff3f3 (patch)
tree7fb9b02c9c387818ece447b82ad2d183d423cd15 /src/gx_cursor.c
parentec8edd1393f482ca42b401463f0f09580aa263a0 (diff)
Massive coding style fixup - move to X coding style,
remove trailing whitespace, zap unused files and remove blocks of ifdefed out code.
Diffstat (limited to 'src/gx_cursor.c')
-rw-r--r--src/gx_cursor.c150
1 files changed, 76 insertions, 74 deletions
diff --git a/src/gx_cursor.c b/src/gx_cursor.c
index bec7fde..9221dfa 100644
--- a/src/gx_cursor.c
+++ b/src/gx_cursor.c
@@ -24,9 +24,9 @@
* */
/*
- * File Contents: Xfree cursor implementation routines for geode HWcursor
+ * File Contents: Xfree cursor implementation routines for geode HWcursor
* init.setting cursor color,image etc. are done here.
- *
+ *
* Project: Geode Xfree Frame buffer device driver.
* */
@@ -72,15 +72,15 @@ GXHWCursorInit(ScreenPtr pScrn)
infoPtr = xf86CreateCursorInfoRec();
if (!infoPtr)
- return FALSE;
+ return FALSE;
/* the geode structure is intiallized with the cursor infoRec */
pGeode->CursorInfo = infoPtr;
infoPtr->MaxWidth = 32;
infoPtr->MaxHeight = 32;
/* seeting up the cursor flags */
infoPtr->Flags = HARDWARE_CURSOR_BIT_ORDER_MSBFIRST |
- HARDWARE_CURSOR_TRUECOLOR_AT_8BPP |
- HARDWARE_CURSOR_SOURCE_MASK_NOT_INTERLEAVED;
+ HARDWARE_CURSOR_TRUECOLOR_AT_8BPP |
+ HARDWARE_CURSOR_SOURCE_MASK_NOT_INTERLEAVED;
/* cursor info ptr is intiallized with the values obtained from
* * durnago calls
*/
@@ -102,7 +102,7 @@ GXHWCursorInit(ScreenPtr pScrn)
* pScrn: Screeen pointer structure.
* bg: Specifies the color value of cursor background color.
* fg: Specifies the color value of cursor foreground color.
- *
+ *
* Returns: none.
*
* Comments: The integer color value passed by this function is
@@ -125,7 +125,7 @@ GXSetCursorColors(ScrnInfoPtr pScrni, int bg, int fg)
* pScrn: Screeen pointer structure.
* x: Specifies the x-cordinates of the cursor.
* y: Specifies the y co-ordinate of the cursor.
- *
+ *
* Returns: none.
*
*----------------------------------------------------------------------------
@@ -143,27 +143,29 @@ GXSetCursorPosition(ScrnInfoPtr pScrni, int x, int y)
savex = x + pScrni->frameX0;
savey = y + pScrni->frameY0;
- switch(pGeode->rotation) {
+ switch (pGeode->rotation) {
default:
- ErrorF("%s:%d invalid rotation %d\n", __func__, __LINE__, pGeode->rotation);
+ ErrorF("%s:%d invalid rotation %d\n", __func__, __LINE__,
+ pGeode->rotation);
case RR_Rotate_0:
- newX = savex; newY = savey;
- break;
-
+ newX = savex;
+ newY = savey;
+ break;
+
case RR_Rotate_90:
- newX = savey;
- newY = pScrni->pScreen->width - savex;
- break;
-
+ newX = savey;
+ newY = pScrni->pScreen->width - savex;
+ break;
+
case RR_Rotate_180:
- newX = pScrni->pScreen->width - savex;
- newY = pScrni->pScreen->height - savey;
- break;
-
+ newX = pScrni->pScreen->width - savex;
+ newY = pScrni->pScreen->height - savey;
+ break;
+
case RR_Rotate_270:
- newX = pScrni->pScreen->height - savey;
- newY = savex;
- break;
+ newX = pScrni->pScreen->height - savey;
+ newY = savex;
+ break;
}
newX += pScrni->frameX0;
@@ -172,25 +174,25 @@ GXSetCursorPosition(ScrnInfoPtr pScrni, int x, int y)
//ErrorF("Turned (%d,%d) into (%d,%d)\n", x,y,newX, newY);
if (newX < -31)
- newX = -31;
+ newX = -31;
if (newY < -31)
- newY = -31;
+ newY = -31;
gfx_set_cursor_position(pGeode->CursorStartOffset, newX + 31, newY + 31,
- 31, 31);
+ 31, 31);
gfx_set_cursor_enable(1);
if ((pGeode->OverlayON) && (pGeode->Panel)) {
- pGeode->PrevDisplayOffset = gfx_get_display_offset();
- if (pGeode->PrevDisplayOffset != panOffset) {
- GXSetVideoPosition(pGeode->video_x, pGeode->video_y,
- pGeode->video_w, pGeode->video_h,
- pGeode->video_srcw, pGeode->video_srch,
- pGeode->video_dstw, pGeode->video_dsth,
- pGeode->video_id, pGeode->video_offset,
- pGeode->video_scrnptr);
- panOffset = pGeode->PrevDisplayOffset;
- }
+ pGeode->PrevDisplayOffset = gfx_get_display_offset();
+ if (pGeode->PrevDisplayOffset != panOffset) {
+ GXSetVideoPosition(pGeode->video_x, pGeode->video_y,
+ pGeode->video_w, pGeode->video_h,
+ pGeode->video_srcw, pGeode->video_srch,
+ pGeode->video_dstw, pGeode->video_dsth,
+ pGeode->video_id, pGeode->video_offset,
+ pGeode->video_scrnptr);
+ panOffset = pGeode->PrevDisplayOffset;
+ }
}
}
@@ -203,7 +205,7 @@ GXSetCursorPosition(ScrnInfoPtr pScrni, int x, int y)
* Parameters:
* pScrn: Screeen pointer structure.
* src: Specifies cursor data.
- *
+ *
* Returns: none
*
*----------------------------------------------------------------------------
@@ -219,55 +221,55 @@ GXLoadCursorImage(ScrnInfoPtr pScrni, unsigned char *src)
unsigned char *mskp = &src[128];
if (src != NULL) {
- mskb = rowb = 0;
- for (y = 32; --y >= 0;)
- andMask[y] = xorMask[y] = 0;
- for (y = 0; y < 32; ++y) {
- for (x = 0; x < 32; ++x) {
- if ((i = x & 7) == 0) {
- rowb = (*rowp & *mskp);
- mskb = ~(*mskp);
- ++rowp;
- ++mskp;
- }
+ mskb = rowb = 0;
+ for (y = 32; --y >= 0;)
+ andMask[y] = xorMask[y] = 0;
+ for (y = 0; y < 32; ++y) {
+ for (x = 0; x < 32; ++x) {
+ if ((i = x & 7) == 0) {
+ rowb = (*rowp & *mskp);
+ mskb = ~(*mskp);
+ ++rowp;
+ ++mskp;
+ }
- switch(pGeode->rotation) {
+ switch (pGeode->rotation) {
default:
- ErrorF("%s:%d invalid rotation %d\n", __func__, __LINE__,
- pGeode->rotation);
+ ErrorF("%s:%d invalid rotation %d\n", __func__, __LINE__,
+ pGeode->rotation);
case RR_Rotate_0:
- newX = x;
- newY = y;
- break;
+ newX = x;
+ newY = y;
+ break;
case RR_Rotate_90:
- newX = y;
- newY = 31 - x;
- break;
+ newX = y;
+ newY = 31 - x;
+ break;
case RR_Rotate_180:
- newX = 31 - x;
- newY = 31 - y;
- break;
+ newX = 31 - x;
+ newY = 31 - y;
+ break;
case RR_Rotate_270:
- newX = 31 - y;
- newY = x;
- break;
+ newX = 31 - y;
+ newY = x;
+ break;
}
- i = 7 - i;
- n = 31 - newX;
- andMask[newY] |= (((mskb >> i) & 1) << n);
- xorMask[newY] |= (((rowb >> i) & 1) << n);
- }
- }
+ i = 7 - i;
+ n = 31 - newX;
+ andMask[newY] |= (((mskb >> i) & 1) << n);
+ xorMask[newY] |= (((rowb >> i) & 1) << n);
+ }
+ }
} else {
- for (y = 32; --y >= 0;) {
- andMask[y] = ~0;
- xorMask[y] = 0;
- }
+ for (y = 32; --y >= 0;) {
+ andMask[y] = ~0;
+ xorMask[y] = 0;
+ }
}
gfx_set_cursor_shape32(pGeode->CursorStartOffset, &andMask[0],
- &xorMask[0]);
+ &xorMask[0]);
}
/*----------------------------------------------------------------------------