public static MouseEvent GetMouse() { WrapMEvent wme; CursesMethods.getmouse(out wme); return(new MouseEvent(wme.id, wme.x, wme.y, wme.z, (MouseState)wme.bstate)); }
public static MouseState MouseMask(MouseState mask, out MouseState oldmask) { uint outMask = CursesMethods.mousemask((uint)mask, out uint tmpMask); oldmask = (MouseState)tmpMask; return((MouseState)outMask); }
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)); }
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()); }
private void DisposeImpl() { if (this.winptr != IntPtr.Zero && this.ownsPtr) { CursesMethods.delwin(this.winptr); this.winptr = IntPtr.Zero; } }
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); }
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); }
/// <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); }
/// <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; }
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); }
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; }
/// <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; } }
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; } }
/// <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; } }
public static void Clear() { CursesMethods.slk_clear(); }
public static void SetLabel(int labnum, string label, SoftLabelJustify justify) { CursesMethods.slk_set(labnum, label, (int)justify); }
public static string GetLabel(int labnum) { return(CursesMethods.slk_label(labnum)); }
public static void NoOutRefresh() { CursesMethods.slk_noutrefresh(); }
public static void Refresh() { CursesMethods.slk_refresh(); }
public static void Init(int fmt) { CursesMethods.slk_init(fmt); }
public void CurSyncUp() { CursesMethods.wcursyncup(this.winptr); }
public void SyncDown() { CursesMethods.wsyncdown(this.winptr); }
public void SyncUp() { CursesMethods.wsyncup(this.winptr); }
public void MoveWindowParent(int pary, int parx) { CursesMethods.mvderwin(this.winptr, pary, parx); }
public static void AttrOn(uint attrs) { CursesMethods.slk_attron(attrs); }
public static void Restore() { CursesMethods.slk_restore(); }
public static void Touch() { CursesMethods.slk_touch(); }
public bool IsTouched() { return(CursesMethods.is_wintouched(this.winptr)); }
public static void AttrOff(uint attrs) { CursesMethods.slk_attroff(attrs); }
public void MoveWindowScreen(int y, int x) { CursesMethods.mvwin(this.winptr, y, x); }