2008-11-28 15:42:52 +01:00
|
|
|
/****************************************************************************
|
|
|
|
* graphics/nxmu/nxmu_reportposition.c
|
|
|
|
*
|
2021-02-05 11:12:53 +01:00
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed with
|
|
|
|
* this work for additional information regarding copyright ownership. The
|
|
|
|
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
|
|
|
* "License"); you may not use this file except in compliance with the
|
|
|
|
* License. You may obtain a copy of the License at
|
2008-11-28 15:42:52 +01:00
|
|
|
*
|
2021-02-05 11:12:53 +01:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2008-11-28 15:42:52 +01:00
|
|
|
*
|
2021-02-05 11:12:53 +01:00
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
|
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
|
|
* License for the specific language governing permissions and limitations
|
|
|
|
* under the License.
|
2008-11-28 15:42:52 +01:00
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Included Files
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#include <nuttx/config.h>
|
|
|
|
|
|
|
|
#include <errno.h>
|
|
|
|
#include <debug.h>
|
|
|
|
|
2011-07-24 22:49:01 +02:00
|
|
|
#include <nuttx/nx/nxglib.h>
|
|
|
|
#include <nuttx/nx/nx.h>
|
2019-03-13 16:16:30 +01:00
|
|
|
#include "nxmu.h"
|
2008-11-28 15:42:52 +01:00
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Public Functions
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
2019-03-13 16:16:30 +01:00
|
|
|
* Name: nxmu_reportposition
|
2008-11-28 15:42:52 +01:00
|
|
|
*
|
2018-02-01 19:03:55 +01:00
|
|
|
* Description:
|
2008-11-28 15:42:52 +01:00
|
|
|
* Report the new size/position of the window.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
2019-03-13 16:16:30 +01:00
|
|
|
void nxmu_reportposition(FAR struct nxbe_window_s *wnd)
|
2008-11-28 15:42:52 +01:00
|
|
|
{
|
|
|
|
FAR struct nxclimsg_newposition_s outmsg;
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
/* Send the size/position info */
|
|
|
|
|
2008-12-02 21:02:59 +01:00
|
|
|
outmsg.msgid = NX_CLIMSG_NEWPOSITION;
|
|
|
|
outmsg.wnd = wnd;
|
2008-12-02 21:57:45 +01:00
|
|
|
outmsg.pos.x = wnd->bounds.pt1.x;
|
|
|
|
outmsg.pos.y = wnd->bounds.pt1.y;
|
2008-11-28 15:42:52 +01:00
|
|
|
|
2008-12-02 21:02:59 +01:00
|
|
|
nxgl_rectsize(&outmsg.size, &wnd->bounds);
|
2008-11-28 15:42:52 +01:00
|
|
|
|
2008-11-29 00:04:54 +01:00
|
|
|
/* Provide the background window bounding box which is the screen limits
|
|
|
|
* It must always have (0,0) as its origin
|
|
|
|
*/
|
|
|
|
|
|
|
|
nxgl_rectcopy(&outmsg.bounds, &wnd->be->bkgd.bounds);
|
|
|
|
|
2008-11-28 15:42:52 +01:00
|
|
|
/* And provide this to the client */
|
|
|
|
|
2021-02-05 09:05:48 +01:00
|
|
|
ret = nxmu_sendclientwindow(wnd,
|
|
|
|
&outmsg,
|
|
|
|
sizeof(struct nxclimsg_newposition_s));
|
2008-11-28 15:42:52 +01:00
|
|
|
if (ret < 0)
|
|
|
|
{
|
2016-06-12 19:11:57 +02:00
|
|
|
gerr("ERROR: nxmu_sendclient failed: %d\n", errno);
|
2008-11-28 15:42:52 +01:00
|
|
|
}
|
|
|
|
}
|