Exemple #1
0
int nxmu_mousereport(struct nxbe_window_s *wnd)
{
  struct nxclimsg_mousein_s outmsg;

  /* Does this window support mouse callbacks? */

  if (wnd->cb->mousein)
    {
      /* Yes.. Is the mouse position visible in this window? */

      if (nxbe_visible(wnd, &g_mpos))
        {
          /* Yes... Convert the mouse position to window relative
           * coordinates and send it to the client
           */

          outmsg.msgid   = NX_CLIMSG_MOUSEIN;
          outmsg.wnd     = wnd;
          outmsg.buttons = g_mbutton;
          nxgl_vectsubtract(&outmsg.pos, &g_mpos, &wnd->bounds.pt1);

          return nxmu_sendclientwindow(wnd, &outmsg, sizeof(struct nxclimsg_mousein_s));
        }
    }

  /* No error occurred, but the mouse report was not sent */

  return 1;
}
Exemple #2
0
int nxsu_mousereport(struct nxbe_window_s *wnd)
{
  struct nxgl_point_s relpos;

  /* Does this window support mouse callbacks? */

  if (wnd->cb->mousein)
    {
      /* Yes.. Is the mouse position visible in this window? */

      if (nxbe_visible(wnd, &g_mpos))
        {
          /* Yes... Convert the mouse position to window relative coordinates */

          nxgl_vectsubtract(&relpos, &g_mpos, &wnd->bounds.pt1);
          wnd->cb->mousein((NXWINDOW)wnd, &relpos, g_mbutton, wnd->arg);
          return OK;
        }
    }

  /* No error occurred, but the mouse report was not sent */

  return 1;
}