ncurses 5.6 - patch 20080503
[ncurses.git] / panel / p_move.c
index 6bec36b91246ae9b6553963ee2b039fe2257f91a..3818e8cba860c773c3f1606128497c545abc5632 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998 Free Software Foundation, Inc.                        *
+ * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
  */
 #include "panel.priv.h"
 
-MODULE_ID("$Id: p_move.c,v 1.2 1998/02/11 12:14:01 tom Exp $")
+MODULE_ID("$Id: p_move.c,v 1.9 2005/02/19 16:46:49 tom Exp $")
 
-int
-move_panel(PANEL *pan, int starty, int startx)
+NCURSES_EXPORT(int)
+move_panel(PANEL * pan, int starty, int startx)
 {
-  WINDOW *win;
+  T((T_CALLED("move_panel(%p,%d,%d)"), pan, starty, startx));
 
-  if(!pan)
-    return(ERR);
-  if(_nc_panel_is_linked(pan))
-    _nc_override(pan,P_TOUCH);
-  win = pan->win;
-  if(mvwin(win,starty,startx))
-    return(ERR);
-  getbegyx(win, pan->wstarty, pan->wstartx);
-  pan->wendy = pan->wstarty + getmaxy(win);
-  pan->wendx = pan->wstartx + getmaxx(win);
-  if(_nc_panel_is_linked(pan))
-    _nc_calculate_obscure();
-  return(OK);
+  if (!pan)
+    returnCode(ERR);
+
+  if (IS_LINKED(pan))
+    {
+      Touchpan(pan);
+      PANEL_UPDATE(pan, (PANEL *) 0);
+    }
+
+  returnCode(mvwin(pan->win, starty, startx));
 }