static inline int nxeg_setposition(NXEGWINDOW hwnd, FAR struct nxgl_point_s *pos) { int ret = nx_setposition(hwnd, pos); if (ret < 0) { message("nxeg_setposition: nx_setposition failed: %d\n", errno); g_exitcode = NXEXIT_NXSETPOSITION; } return ret; }
int nxtk_setposition(NXTKWINDOW hfwnd, FAR const struct nxgl_point_s *pos) { FAR struct nxtk_framedwindow_s *fwnd = (FAR struct nxtk_framedwindow_s *)hfwnd; struct nxgl_point_s offset; struct nxgl_point_s newpos; /* 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.bounds.pt1); /* Then set that position */ return nx_setposition((NXWINDOW)hfwnd, &newpos); }