Exemplo n.º 1
0
        public static MouseEvent GetMouse()
        {
            WrapMEvent wme;

            CursesMethods.getmouse(out wme);
            return(new MouseEvent(wme.id, wme.x, wme.y, wme.z, (MouseState)wme.bstate));
        }
Exemplo n.º 2
0
        public static MouseState MouseMask(MouseState mask, out MouseState oldmask)
        {
            uint outMask = CursesMethods.mousemask((uint)mask, out uint tmpMask);

            oldmask = (MouseState)tmpMask;
            return((MouseState)outMask);
        }
Exemplo n.º 3
0
        public string ReadOutputString(int y, int x, int n)
        {
            StringBuilder sb   = new StringBuilder(n + 1);
            int           nOut = CursesMethods.mvwinnstr(this.winptr, y, x, sb, n);

            return(sb.ToString(0, nOut));
        }
Exemplo n.º 4
0
        public string GetString(int y, int x, int n)
        {
            StringBuilder sb = new StringBuilder(n + 1);

            CursesMethods.mvwgetnstr(this.winptr, y, x, sb, n);
            return(sb.ToString());
        }
Exemplo n.º 5
0
 private void DisposeImpl()
 {
     if (this.winptr != IntPtr.Zero && this.ownsPtr)
     {
         CursesMethods.delwin(this.winptr);
         this.winptr = IntPtr.Zero;
     }
 }
Exemplo n.º 6
0
        public uint[] ReadOutputChars(int y, int x, int n)
        {
            uint[] buf  = new uint[n + 1];
            int    nOut = CursesMethods.mvwinchnstr(this.winptr, y, x, buf, n);

            uint[] ret = new uint[nOut];
            Array.Copy(buf, ret, nOut);
            return(ret);
        }
Exemplo n.º 7
0
        public static void RipOffLine(int line, RipOffLineFun init)
        {
            RipOffLineFunInt initInt = delegate(IntPtr winptr, int ncols)
            {
                return(init(Window.WrapHandle(winptr), ncols));
            };

            CursesMethods.ripoffline(line, initInt);
        }
Exemplo n.º 8
0
        /// <summary>
        /// Initializes Curses Sharp and the underlying curses implementation.
        /// </summary>
        ///
        /// <remarks>
        /// It should be the first function called as most other functions
        /// require the library be initialized.
        /// <para>
        /// The Window object returned can be later retrieved using
        /// <see cref="StdScr"/> property.
        /// </para>
        /// </remarks>
        /// <returns>The default Window object</returns>
        public static Window InitScr()
        {
            if (stdscr != null)
            {
                throw new InvalidOperationException("Curses is already initialized.");
            }

            stdscr = Window.WrapHandle(CursesMethods.initscr());
            return(stdscr);
        }
Exemplo n.º 9
0
 /// <summary>
 /// Shuts down Curses Sharp and the underlying curses implementation.
 /// </summary>
 public static void EndWin()
 {
     if (stdscr == null)
     {
         throw new InvalidOperationException("Curses is not initialized.");
     }
     stdscr.Dispose();
     CursesMethods.endwin();
     //stdscr = null;
 }
Exemplo n.º 10
0
        public static void UngetMouse(MouseEvent mevent)
        {
            WrapMEvent wme;

            wme.id     = mevent.Id;
            wme.x      = mevent.X;
            wme.y      = mevent.Y;
            wme.z      = mevent.Z;
            wme.bstate = (uint)mevent.State;
            CursesMethods.ungetmouse(ref wme);
        }
Exemplo n.º 11
0
        public static void GetMouse(MouseEvent mevent)
        {
            WrapMEvent wme;

            CursesMethods.getmouse(out wme);
            mevent.Id    = wme.id;
            mevent.X     = wme.x;
            mevent.Y     = wme.y;
            mevent.Z     = wme.z;
            mevent.State = (MouseState)wme.bstate;
        }
Exemplo n.º 12
0
 /// <summary>
 /// The bulk of the clean-up code is implemented in Dispose(bool)
 /// </summary>
 /// <param name="disposing"></param>
 protected virtual void Dispose(bool disposing)
 {
     if (disposing)
     {
         // free managed resources
     }
     // free native resources if there are any.
     if (this.winptr != IntPtr.Zero)
     {
         CursesMethods.delwin(winptr);
         winptr = IntPtr.Zero;
     }
 }
Exemplo n.º 13
0
 private void DisposeImpl(bool disposing)
 {
     if (this.handle != IntPtr.Zero)
     {
         if (disposing)
         {
             allPanels.Remove(this.handle);
         }
         CursesMethods.del_panel(this.handle);
         this.handle = IntPtr.Zero;
         this.window = null;
     }
 }
Exemplo n.º 14
0
 /// <summary>
 /// The bulk of the clean-up code is implemented in Dispose(bool)
 /// </summary>
 /// <param name="disposing"></param>
 protected virtual void Dispose(bool disposing)
 {
     if (disposing)
     {
         // free managed resources
         if (this.window != null)
         {
             this.window.Dispose();
             this.window = null;
         }
     }
     // free native resources if there are any.
     if (this.handle != IntPtr.Zero)
     {
         if (disposing)
         {
             allPanels.Remove(this.handle);
         }
         CursesMethods.del_panel(this.handle);
         this.handle = IntPtr.Zero;
     }
 }
Exemplo n.º 15
0
 public static void Clear()
 {
     CursesMethods.slk_clear();
 }
Exemplo n.º 16
0
 public static void SetLabel(int labnum, string label, SoftLabelJustify justify)
 {
     CursesMethods.slk_set(labnum, label, (int)justify);
 }
Exemplo n.º 17
0
 public static string GetLabel(int labnum)
 {
     return(CursesMethods.slk_label(labnum));
 }
Exemplo n.º 18
0
 public static void NoOutRefresh()
 {
     CursesMethods.slk_noutrefresh();
 }
Exemplo n.º 19
0
 public static void Refresh()
 {
     CursesMethods.slk_refresh();
 }
Exemplo n.º 20
0
 public static void Init(int fmt)
 {
     CursesMethods.slk_init(fmt);
 }
Exemplo n.º 21
0
 public void CurSyncUp()
 {
     CursesMethods.wcursyncup(this.winptr);
 }
Exemplo n.º 22
0
 public void SyncDown()
 {
     CursesMethods.wsyncdown(this.winptr);
 }
Exemplo n.º 23
0
 public void SyncUp()
 {
     CursesMethods.wsyncup(this.winptr);
 }
Exemplo n.º 24
0
 public void MoveWindowParent(int pary, int parx)
 {
     CursesMethods.mvderwin(this.winptr, pary, parx);
 }
Exemplo n.º 25
0
 public static void AttrOn(uint attrs)
 {
     CursesMethods.slk_attron(attrs);
 }
Exemplo n.º 26
0
 public static void Restore()
 {
     CursesMethods.slk_restore();
 }
Exemplo n.º 27
0
 public static void Touch()
 {
     CursesMethods.slk_touch();
 }
Exemplo n.º 28
0
 public bool IsTouched()
 {
     return(CursesMethods.is_wintouched(this.winptr));
 }
Exemplo n.º 29
0
 public static void AttrOff(uint attrs)
 {
     CursesMethods.slk_attroff(attrs);
 }
Exemplo n.º 30
0
 public void MoveWindowScreen(int y, int x)
 {
     CursesMethods.mvwin(this.winptr, y, x);
 }