diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2008-12-02 20:57:45 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2008-12-02 20:57:45 +0000 |
commit | f39c1b667ec6b707bb925ef4c5b553c6c08c1ebf (patch) | |
tree | 7cd39be21910ee92fb9f72dfdea587796405a6b8 | |
parent | aebaefc303f12beb92c4da219411bdb00aa4e03c (diff) | |
download | px4-nuttx-f39c1b667ec6b707bb925ef4c5b553c6c08c1ebf.tar.gz px4-nuttx-f39c1b667ec6b707bb925ef4c5b553c6c08c1ebf.tar.bz2 px4-nuttx-f39c1b667ec6b707bb925ef4c5b553c6c08c1ebf.zip |
Remove redundant origin value
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1393 42af7a65-404d-4744-a932-0658087f49c3
-rw-r--r-- | nuttx/graphics/nxbe/nxbe.h | 5 | ||||
-rw-r--r-- | nuttx/graphics/nxbe/nxbe_bitmap.c | 4 | ||||
-rw-r--r-- | nuttx/graphics/nxbe/nxbe_fill.c | 2 | ||||
-rw-r--r-- | nuttx/graphics/nxbe/nxbe_filltrapezoid.c | 4 | ||||
-rw-r--r-- | nuttx/graphics/nxbe/nxbe_move.c | 2 | ||||
-rw-r--r-- | nuttx/graphics/nxbe/nxbe_setposition.c | 11 | ||||
-rw-r--r-- | nuttx/graphics/nxbe/nxbe_setsize.c | 2 | ||||
-rw-r--r-- | nuttx/graphics/nxmu/nxmu_mouse.c | 2 | ||||
-rw-r--r-- | nuttx/graphics/nxmu/nxmu_redrawreq.c | 2 | ||||
-rw-r--r-- | nuttx/graphics/nxmu/nxmu_reportposition.c | 4 | ||||
-rw-r--r-- | nuttx/graphics/nxsu/nx_mousein.c | 2 | ||||
-rw-r--r-- | nuttx/graphics/nxsu/nxsu_redrawreq.c | 2 | ||||
-rw-r--r-- | nuttx/graphics/nxsu/nxsu_reportposition.c | 2 | ||||
-rw-r--r-- | nuttx/graphics/nxtk/nxtk_filltraptoolbar.c | 2 | ||||
-rw-r--r-- | nuttx/graphics/nxtk/nxtk_filltrapwindow.c | 2 | ||||
-rw-r--r-- | nuttx/graphics/nxtk/nxtk_setposition.c | 2 | ||||
-rw-r--r-- | nuttx/graphics/nxtk/nxtk_setsubwindows.c | 6 |
17 files changed, 26 insertions, 30 deletions
diff --git a/nuttx/graphics/nxbe/nxbe.h b/nuttx/graphics/nxbe/nxbe.h index e4b3a923d..533303928 100644 --- a/nuttx/graphics/nxbe/nxbe.h +++ b/nuttx/graphics/nxbe/nxbe.h @@ -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 */ diff --git a/nuttx/graphics/nxbe/nxbe_bitmap.c b/nuttx/graphics/nxbe/nxbe_bitmap.c index dbaa1c6b1..293033dc2 100644 --- a/nuttx/graphics/nxbe/nxbe_bitmap.c +++ b/nuttx/graphics/nxbe/nxbe_bitmap.c @@ -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 diff --git a/nuttx/graphics/nxbe/nxbe_fill.c b/nuttx/graphics/nxbe/nxbe_fill.c index d175d64fc..fca2445b0 100644 --- a/nuttx/graphics/nxbe/nxbe_fill.c +++ b/nuttx/graphics/nxbe/nxbe_fill.c @@ -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 diff --git a/nuttx/graphics/nxbe/nxbe_filltrapezoid.c b/nuttx/graphics/nxbe/nxbe_filltrapezoid.c index d314fec30..f465abbdd 100644 --- a/nuttx/graphics/nxbe/nxbe_filltrapezoid.c +++ b/nuttx/graphics/nxbe/nxbe_filltrapezoid.c @@ -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); } diff --git a/nuttx/graphics/nxbe/nxbe_move.c b/nuttx/graphics/nxbe/nxbe_move.c index 515c2c215..d0237ec4e 100644 --- a/nuttx/graphics/nxbe/nxbe_move.c +++ b/nuttx/graphics/nxbe/nxbe_move.c @@ -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 */ diff --git a/nuttx/graphics/nxbe/nxbe_setposition.c b/nuttx/graphics/nxbe/nxbe_setposition.c index bba946fe6..826beb3c8 100644 --- a/nuttx/graphics/nxbe/nxbe_setposition.c +++ b/nuttx/graphics/nxbe/nxbe_setposition.c @@ -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. diff --git a/nuttx/graphics/nxbe/nxbe_setsize.c b/nuttx/graphics/nxbe/nxbe_setsize.c index 3873807d9..39b6b3f16 100644 --- a/nuttx/graphics/nxbe/nxbe_setsize.c +++ b/nuttx/graphics/nxbe/nxbe_setsize.c @@ -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; diff --git a/nuttx/graphics/nxmu/nxmu_mouse.c b/nuttx/graphics/nxmu/nxmu_mouse.c index 80ab60cb7..0bcb09a34 100644 --- a/nuttx/graphics/nxmu/nxmu_mouse.c +++ b/nuttx/graphics/nxmu/nxmu_mouse.c @@ -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); diff --git a/nuttx/graphics/nxmu/nxmu_redrawreq.c b/nuttx/graphics/nxmu/nxmu_redrawreq.c index 7151301d2..3f25e1ebf 100644 --- a/nuttx/graphics/nxmu/nxmu_redrawreq.c +++ b/nuttx/graphics/nxmu/nxmu_redrawreq.c @@ -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) diff --git a/nuttx/graphics/nxmu/nxmu_reportposition.c b/nuttx/graphics/nxmu/nxmu_reportposition.c index 7f8ebb3b7..858f3ab82 100644 --- a/nuttx/graphics/nxmu/nxmu_reportposition.c +++ b/nuttx/graphics/nxmu/nxmu_reportposition.c @@ -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); diff --git a/nuttx/graphics/nxsu/nx_mousein.c b/nuttx/graphics/nxsu/nx_mousein.c index 2ed59e894..f5ea76476 100644 --- a/nuttx/graphics/nxsu/nx_mousein.c +++ b/nuttx/graphics/nxsu/nx_mousein.c @@ -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; } diff --git a/nuttx/graphics/nxsu/nxsu_redrawreq.c b/nuttx/graphics/nxsu/nxsu_redrawreq.c index 3226c0c2d..8cd2e8aa2 100644 --- a/nuttx/graphics/nxsu/nxsu_redrawreq.c +++ b/nuttx/graphics/nxsu/nxsu_redrawreq.c @@ -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 */ diff --git a/nuttx/graphics/nxsu/nxsu_reportposition.c b/nuttx/graphics/nxsu/nxsu_reportposition.c index 972986f9d..d8ec61580 100644 --- a/nuttx/graphics/nxsu/nxsu_reportposition.c +++ b/nuttx/graphics/nxsu/nxsu_reportposition.c @@ -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); } } diff --git a/nuttx/graphics/nxtk/nxtk_filltraptoolbar.c b/nuttx/graphics/nxtk/nxtk_filltraptoolbar.c index 22377ab3c..526dfec8f 100644 --- a/nuttx/graphics/nxtk/nxtk_filltraptoolbar.c +++ b/nuttx/graphics/nxtk/nxtk_filltraptoolbar.c @@ -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); } diff --git a/nuttx/graphics/nxtk/nxtk_filltrapwindow.c b/nuttx/graphics/nxtk/nxtk_filltrapwindow.c index e789db956..02e86e9b7 100644 --- a/nuttx/graphics/nxtk/nxtk_filltrapwindow.c +++ b/nuttx/graphics/nxtk/nxtk_filltrapwindow.c @@ -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); } diff --git a/nuttx/graphics/nxtk/nxtk_setposition.c b/nuttx/graphics/nxtk/nxtk_setposition.c index 185c715d7..4be1b77e8 100644 --- a/nuttx/graphics/nxtk/nxtk_setposition.c +++ b/nuttx/graphics/nxtk/nxtk_setposition.c @@ -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 */ diff --git a/nuttx/graphics/nxtk/nxtk_setsubwindows.c b/nuttx/graphics/nxtk/nxtk_setsubwindows.c index 57c280c73..a2c8e4281 100644 --- a/nuttx/graphics/nxtk/nxtk_setsubwindows.c +++ b/nuttx/graphics/nxtk/nxtk_setsubwindows.c @@ -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 */ |