mirror of
https://github.com/apache/nuttx.git
synced 2026-06-05 07:12:54 +08:00
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:
@@ -142,10 +142,11 @@ struct nxbe_window_s
|
||||
FAR struct nxbe_window_s *above; /* The window "above" this window */
|
||||
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_point_s origin; /* The position of the top-left corner of the window */
|
||||
|
||||
/* Client state information this is provide in window callbacks */
|
||||
|
||||
|
||||
@@ -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 */
|
||||
|
||||
nxgl_rectoffset(&bounds, dest, wnd->origin.x, wnd->origin.y);
|
||||
nxgl_vectoradd(&offset, origin, &wnd->origin);
|
||||
nxgl_rectoffset(&bounds, dest, wnd->bounds.pt1.x, wnd->bounds.pt1.y);
|
||||
nxgl_vectoradd(&offset, origin, &wnd->bounds.pt1);
|
||||
|
||||
/* Verify that the destination rectangle begins "below" and to the "right"
|
||||
* of the origin
|
||||
|
||||
@@ -125,7 +125,7 @@ void nxbe_fill(FAR struct nxbe_window_s *wnd,
|
||||
* 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
|
||||
* background screen
|
||||
|
||||
@@ -130,7 +130,7 @@ void nxbe_filltrapezoid(FAR struct nxbe_window_s *wnd,
|
||||
* 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 */
|
||||
|
||||
@@ -144,7 +144,7 @@ void nxbe_filltrapezoid(FAR struct nxbe_window_s *wnd,
|
||||
if (clip && !nxgl_nullrect(clip))
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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 */
|
||||
|
||||
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 */
|
||||
|
||||
|
||||
@@ -93,17 +93,12 @@ void nxbe_setposition(FAR struct nxbe_window_s *wnd,
|
||||
|
||||
/* 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 */
|
||||
|
||||
wnd->origin.x = pos->x;
|
||||
wnd->origin.y = pos->y;
|
||||
|
||||
/* Add the new window origin back into the bounding box */
|
||||
/* Add the new window origin into the bounding box */
|
||||
|
||||
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
|
||||
* this union is the region of the display that must be updated.
|
||||
|
||||
@@ -94,7 +94,7 @@ void nxbe_setsize(FAR struct nxbe_window_s *wnd,
|
||||
|
||||
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.y = wnd->bounds.pt1.y + size->h - 1;
|
||||
|
||||
@@ -128,7 +128,7 @@ int nxmu_mousereport(struct nxbe_window_s *wnd)
|
||||
outmsg.msgid = NX_CLIMSG_MOUSEIN;
|
||||
outmsg.wnd = wnd;
|
||||
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,
|
||||
sizeof(struct nxclimsg_mousein_s), NX_SVRMSG_PRIO);
|
||||
|
||||
@@ -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.wnd = wnd;
|
||||
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);
|
||||
if (ret < 0)
|
||||
|
||||
@@ -88,8 +88,8 @@ void nxfe_reportposition(FAR struct nxbe_window_s *wnd)
|
||||
|
||||
outmsg.msgid = NX_CLIMSG_NEWPOSITION;
|
||||
outmsg.wnd = wnd;
|
||||
outmsg.pos.x = wnd->origin.x;
|
||||
outmsg.pos.y = wnd->origin.y;
|
||||
outmsg.pos.x = wnd->bounds.pt1.x;
|
||||
outmsg.pos.y = wnd->bounds.pt1.y;
|
||||
|
||||
nxgl_rectsize(&outmsg.size, &wnd->bounds);
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@ int nxsu_mousereport(struct nxbe_window_s *wnd)
|
||||
{
|
||||
/* 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);
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -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 */
|
||||
|
||||
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 */
|
||||
|
||||
|
||||
@@ -102,6 +102,6 @@ void nxfe_reportposition(FAR struct nxbe_window_s *wnd)
|
||||
|
||||
/* 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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,6 +106,6 @@ int nxtk_filltraptoolbar(NXTKTOOLBAR htb, FAR const struct nxgl_trapezoid_s *tra
|
||||
|
||||
/* 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);
|
||||
}
|
||||
|
||||
@@ -106,6 +106,6 @@ int nxtk_filltrapwindow(NXTKWINDOW hfwnd, FAR const struct nxgl_trapezoid_s *tra
|
||||
|
||||
/* 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);
|
||||
}
|
||||
|
||||
@@ -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. */
|
||||
|
||||
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 */
|
||||
|
||||
|
||||
@@ -90,9 +90,9 @@ void nxtk_setsubwindows(FAR struct nxtk_framedwindow_s *fwnd)
|
||||
{
|
||||
nxgl_coord_t fullheight;
|
||||
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 fwtop = fwnd->wnd.origin.y;
|
||||
nxgl_coord_t fwtop = fwnd->wnd.bounds.pt1.y;
|
||||
nxgl_coord_t fwheight = 0;
|
||||
nxgl_coord_t fullwidth;
|
||||
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;
|
||||
bdrwidth = ngl_min(2 * CONFIG_NXTK_BORDERWIDTH, fullwidth);
|
||||
fwwidth = fullwidth - bdrwidth;
|
||||
fwleft = fwnd->wnd.origin.x + bdrwidth/2;
|
||||
fwleft = fwnd->wnd.bounds.pt1.x + bdrwidth / 2;
|
||||
|
||||
/* Realize the positions/dimensions */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user