Remove redundant origin value

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1393 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2008-12-02 20:57:45 +00:00
parent c13aa8eb4d
commit 9414c64d0d
17 changed files with 26 additions and 30 deletions
+3 -2
View File
@@ -142,10 +142,11 @@ struct nxbe_window_s
FAR struct nxbe_window_s *above; /* The window "above" this window */ FAR struct nxbe_window_s *above; /* The window "above" this window */
FAR struct nxbe_window_s *below; /* The window "below this one */ FAR struct nxbe_window_s *below; /* The window "below this one */
/* Window geometry */ /* Window geometry. The window is described by a rectangle in the
* absolute screen coordinate system (0,0)->(xres,yres)
*/
struct nxgl_rect_s bounds; /* The bounding rectangle of window */ struct nxgl_rect_s bounds; /* The bounding rectangle of window */
struct nxgl_point_s origin; /* The position of the top-left corner of the window */
/* Client state information this is provide in window callbacks */ /* Client state information this is provide in window callbacks */
+2 -2
View File
@@ -137,8 +137,8 @@ void nxbe_bitmap(FAR struct nxbe_window_s *wnd, FAR const struct nxgl_rect_s *de
/* Offset the rectangle and image origin by the window origin */ /* Offset the rectangle and image origin by the window origin */
nxgl_rectoffset(&bounds, dest, wnd->origin.x, wnd->origin.y); nxgl_rectoffset(&bounds, dest, wnd->bounds.pt1.x, wnd->bounds.pt1.y);
nxgl_vectoradd(&offset, origin, &wnd->origin); nxgl_vectoradd(&offset, origin, &wnd->bounds.pt1);
/* Verify that the destination rectangle begins "below" and to the "right" /* Verify that the destination rectangle begins "below" and to the "right"
* of the origin * of the origin
+1 -1
View File
@@ -125,7 +125,7 @@ void nxbe_fill(FAR struct nxbe_window_s *wnd,
* bounding box * bounding box
*/ */
nxgl_rectoffset(&remaining, rect, wnd->origin.x, wnd->origin.y); nxgl_rectoffset(&remaining, rect, wnd->bounds.pt1.x, wnd->bounds.pt1.y);
/* Clip to the bounding box to the limits of the window and of the /* Clip to the bounding box to the limits of the window and of the
* background screen * background screen
+2 -2
View File
@@ -130,7 +130,7 @@ void nxbe_filltrapezoid(FAR struct nxbe_window_s *wnd,
* the framebuffer region * the framebuffer region
*/ */
nxgl_trapoffset(&info.trap, trap, wnd->origin.x, wnd->origin.y); nxgl_trapoffset(&info.trap, trap, wnd->bounds.pt1.x, wnd->bounds.pt1.y);
/* Create a bounding box that contains the trapezoid */ /* Create a bounding box that contains the trapezoid */
@@ -144,7 +144,7 @@ void nxbe_filltrapezoid(FAR struct nxbe_window_s *wnd,
if (clip && !nxgl_nullrect(clip)) if (clip && !nxgl_nullrect(clip))
{ {
struct nxgl_rect_s tmp; struct nxgl_rect_s tmp;
nxgl_rectoffset(&tmp, clip, wnd->origin.x, wnd->origin.y); nxgl_rectoffset(&tmp, clip, wnd->bounds.pt1.x, wnd->bounds.pt1.y);
nxgl_rectintersect(&remaining, &remaining, &tmp); nxgl_rectintersect(&remaining, &remaining, &tmp);
} }
+1 -1
View File
@@ -210,7 +210,7 @@ void nxbe_move(FAR struct nxbe_window_s *wnd, FAR const struct nxgl_rect_s *rect
/* Offset the rectangle by the window origin to create a bounding box */ /* Offset the rectangle by the window origin to create a bounding box */
nxgl_rectoffset(&info.srcrect, rect, wnd->origin.x, wnd->origin.y); nxgl_rectoffset(&info.srcrect, rect, wnd->bounds.pt1.x, wnd->bounds.pt1.y);
/* Clip to the limits of the window and of the background screen */ /* Clip to the limits of the window and of the background screen */
+3 -8
View File
@@ -93,17 +93,12 @@ void nxbe_setposition(FAR struct nxbe_window_s *wnd,
/* Back out the old window origin position from the bounding box */ /* Back out the old window origin position from the bounding box */
nxgl_rectoffset(&rect, &wnd->bounds, -wnd->origin.x, -wnd->origin.y); nxgl_rectoffset(&rect, &wnd->bounds, -wnd->bounds.pt1.x, -wnd->bounds.pt1.y);
/* Set the new origin */ /* Add the new window origin into the bounding box */
wnd->origin.x = pos->x;
wnd->origin.y = pos->y;
/* Add the new window origin back into the bounding box */
nxgl_rectcopy(&before, &wnd->bounds); nxgl_rectcopy(&before, &wnd->bounds);
nxgl_rectoffset(&wnd->bounds, &rect, wnd->origin.x, wnd->origin.y); nxgl_rectoffset(&wnd->bounds, &rect, pos->x, pos->y);
/* Get the union of the 'before' bounding box and the 'after' bounding /* Get the union of the 'before' bounding box and the 'after' bounding
* this union is the region of the display that must be updated. * this union is the region of the display that must be updated.
+1 -1
View File
@@ -94,7 +94,7 @@ void nxbe_setsize(FAR struct nxbe_window_s *wnd,
nxgl_rectcopy(&bounds, &wnd->bounds); nxgl_rectcopy(&bounds, &wnd->bounds);
/* Add the window origin to supplied size get the new window bounding box */ /* Add the window origin to the supplied size get the new window bounding box */
wnd->bounds.pt2.x = wnd->bounds.pt1.x + size->w - 1; wnd->bounds.pt2.x = wnd->bounds.pt1.x + size->w - 1;
wnd->bounds.pt2.y = wnd->bounds.pt1.y + size->h - 1; wnd->bounds.pt2.y = wnd->bounds.pt1.y + size->h - 1;
+1 -1
View File
@@ -128,7 +128,7 @@ int nxmu_mousereport(struct nxbe_window_s *wnd)
outmsg.msgid = NX_CLIMSG_MOUSEIN; outmsg.msgid = NX_CLIMSG_MOUSEIN;
outmsg.wnd = wnd; outmsg.wnd = wnd;
outmsg.buttons = g_mbutton; outmsg.buttons = g_mbutton;
nxgl_vectsubtract(&outmsg.pos, &g_mpos, &wnd->origin); nxgl_vectsubtract(&outmsg.pos, &g_mpos, &wnd->bounds.pt1);
ret = mq_send(wnd->conn->swrmq, &outmsg, ret = mq_send(wnd->conn->swrmq, &outmsg,
sizeof(struct nxclimsg_mousein_s), NX_SVRMSG_PRIO); sizeof(struct nxclimsg_mousein_s), NX_SVRMSG_PRIO);
+1 -1
View File
@@ -86,7 +86,7 @@ void nxfe_redrawreq(FAR struct nxbe_window_s *wnd, FAR const struct nxgl_rect_s
outmsg.msgid = NX_CLIMSG_REDRAW; outmsg.msgid = NX_CLIMSG_REDRAW;
outmsg.wnd = wnd; outmsg.wnd = wnd;
outmsg.more = FALSE; outmsg.more = FALSE;
nxgl_rectoffset(&outmsg.rect, rect, -wnd->origin.x, -wnd->origin.y); nxgl_rectoffset(&outmsg.rect, rect, -wnd->bounds.pt1.x, -wnd->bounds.pt1.y);
ret = mq_send(wnd->conn->swrmq, &outmsg, sizeof(struct nxclimsg_redraw_s), NX_CLIMSG_PRIO); ret = mq_send(wnd->conn->swrmq, &outmsg, sizeof(struct nxclimsg_redraw_s), NX_CLIMSG_PRIO);
if (ret < 0) if (ret < 0)
+2 -2
View File
@@ -88,8 +88,8 @@ void nxfe_reportposition(FAR struct nxbe_window_s *wnd)
outmsg.msgid = NX_CLIMSG_NEWPOSITION; outmsg.msgid = NX_CLIMSG_NEWPOSITION;
outmsg.wnd = wnd; outmsg.wnd = wnd;
outmsg.pos.x = wnd->origin.x; outmsg.pos.x = wnd->bounds.pt1.x;
outmsg.pos.y = wnd->origin.y; outmsg.pos.y = wnd->bounds.pt1.y;
nxgl_rectsize(&outmsg.size, &wnd->bounds); nxgl_rectsize(&outmsg.size, &wnd->bounds);
+1 -1
View File
@@ -123,7 +123,7 @@ int nxsu_mousereport(struct nxbe_window_s *wnd)
{ {
/* Yes... Convert the mouse position to window relative coordinates */ /* Yes... Convert the mouse position to window relative coordinates */
nxgl_vectsubtract(&relpos, &g_mpos, &wnd->origin); nxgl_vectsubtract(&relpos, &g_mpos, &wnd->bounds.pt1);
wnd->cb->mousein((NXWINDOW)wnd, &relpos, g_mbutton, wnd->arg); wnd->cb->mousein((NXWINDOW)wnd, &relpos, g_mbutton, wnd->arg);
return OK; return OK;
} }
+1 -1
View File
@@ -93,7 +93,7 @@ void nxfe_redrawreq(FAR struct nxbe_window_s *wnd, FAR const struct nxgl_rect_s
{ {
/* Convert the frame rectangle to a window-relative rectangle */ /* Convert the frame rectangle to a window-relative rectangle */
nxgl_rectoffset(&relrect, rect, -wnd->origin.x, -wnd->origin.y); nxgl_rectoffset(&relrect, rect, -wnd->bounds.pt1.x, -wnd->bounds.pt1.y);
/* And request the redraw */ /* And request the redraw */
+1 -1
View File
@@ -102,6 +102,6 @@ void nxfe_reportposition(FAR struct nxbe_window_s *wnd)
/* And provide this to the client */ /* And provide this to the client */
wnd->cb->position(wnd, &rect, &wnd->origin, &be->bkgd.bounds, wnd->arg); wnd->cb->position(wnd, &rect, &wnd->bounds.pt1, &be->bkgd.bounds, wnd->arg);
} }
} }
+1 -1
View File
@@ -106,6 +106,6 @@ int nxtk_filltraptoolbar(NXTKTOOLBAR htb, FAR const struct nxgl_trapezoid_s *tra
/* Perform the fill, clipping to the client window */ /* Perform the fill, clipping to the client window */
nxgl_rectoffset(&relclip, &fwnd->tbrect, -fwnd->wnd.origin.x, -fwnd->wnd.origin.y); nxgl_rectoffset(&relclip, &fwnd->tbrect, -fwnd->wnd.bounds.pt1.x, -fwnd->wnd.bounds.pt1.y);
return nx_filltrapezoid((NXWINDOW)htb, &relclip, trap, color); return nx_filltrapezoid((NXWINDOW)htb, &relclip, trap, color);
} }
+1 -1
View File
@@ -106,6 +106,6 @@ int nxtk_filltrapwindow(NXTKWINDOW hfwnd, FAR const struct nxgl_trapezoid_s *tra
/* Perform the fill, clipping to the client window */ /* Perform the fill, clipping to the client window */
nxgl_rectoffset(&relclip, &fwnd->fwrect, -fwnd->wnd.origin.x, -fwnd->wnd.origin.y); nxgl_rectoffset(&relclip, &fwnd->fwrect, -fwnd->wnd.bounds.pt1.x, -fwnd->wnd.bounds.pt1.y);
return nx_filltrapezoid((NXWINDOW)hfwnd, &relclip, trap, color); return nx_filltrapezoid((NXWINDOW)hfwnd, &relclip, trap, color);
} }
+1 -1
View File
@@ -100,7 +100,7 @@ int nxtk_setposition(NXTKWINDOW hfwnd, FAR struct nxgl_point_s *pos)
/* Calculate the offset that is requested and add that to the window origin. */ /* Calculate the offset that is requested and add that to the window origin. */
nxgl_vectsubtract(&offset, pos, &fwnd->fwrect.pt1); nxgl_vectsubtract(&offset, pos, &fwnd->fwrect.pt1);
nxgl_vectoradd(&newpos, &offset, &fwnd->wnd.origin); nxgl_vectoradd(&newpos, &offset, &fwnd->wnd.bounds.pt1);
/* Then set that position */ /* Then set that position */
+3 -3
View File
@@ -90,9 +90,9 @@ void nxtk_setsubwindows(FAR struct nxtk_framedwindow_s *fwnd)
{ {
nxgl_coord_t fullheight; nxgl_coord_t fullheight;
nxgl_coord_t bdrheight = 0; nxgl_coord_t bdrheight = 0;
nxgl_coord_t tbtop = fwnd->wnd.origin.y; nxgl_coord_t tbtop = fwnd->wnd.bounds.pt1.y;
nxgl_coord_t tbheight = 0; nxgl_coord_t tbheight = 0;
nxgl_coord_t fwtop = fwnd->wnd.origin.y; nxgl_coord_t fwtop = fwnd->wnd.bounds.pt1.y;
nxgl_coord_t fwheight = 0; nxgl_coord_t fwheight = 0;
nxgl_coord_t fullwidth; nxgl_coord_t fullwidth;
nxgl_coord_t bdrwidth; nxgl_coord_t bdrwidth;
@@ -145,7 +145,7 @@ void nxtk_setsubwindows(FAR struct nxtk_framedwindow_s *fwnd)
fullwidth = fwnd->wnd.bounds.pt2.x - fwnd->wnd.bounds.pt1.x + 1; fullwidth = fwnd->wnd.bounds.pt2.x - fwnd->wnd.bounds.pt1.x + 1;
bdrwidth = ngl_min(2 * CONFIG_NXTK_BORDERWIDTH, fullwidth); bdrwidth = ngl_min(2 * CONFIG_NXTK_BORDERWIDTH, fullwidth);
fwwidth = fullwidth - bdrwidth; fwwidth = fullwidth - bdrwidth;
fwleft = fwnd->wnd.origin.x + bdrwidth/2; fwleft = fwnd->wnd.bounds.pt1.x + bdrwidth / 2;
/* Realize the positions/dimensions */ /* Realize the positions/dimensions */