├── .gitignore ├── AUTHORS ├── AssemblyInfo.cs ├── ChangeLog ├── Makefile ├── README.md ├── TODO ├── attrib.c ├── binding.cs ├── configure ├── docs ├── Mono.Terminal │ ├── Anchor.xml.remove │ ├── Application.xml │ ├── Button.xml │ ├── CheckBox.xml │ ├── Container.xml │ ├── Curses+Event.xml │ ├── Curses+MouseEvent.xml │ ├── Curses.xml │ ├── Dialog.xml │ ├── Entry.xml │ ├── Fill.xml │ ├── Frame.xml │ ├── IListProvider.xml │ ├── Label.xml │ ├── ListView.xml │ ├── MainLoop+Condition.xml │ ├── MainLoop.xml │ ├── MenuBar.xml │ ├── MenuBarItem.xml │ ├── MenuItem.xml │ ├── MessageBox.xml │ ├── Screen.xml │ ├── TrimLabel.xml │ ├── Widget.xml │ └── Window.xml ├── index.xml └── ns-Mono.Terminal.xml ├── gtest.cs ├── gtestshot.png ├── gui.cs ├── guitest.cs ├── handles.cs ├── mainloop.cs ├── mltest.cs ├── mono-curses.csproj ├── mono-curses.pc.in ├── mono-curses.sln ├── mono-curses.snk ├── mono-curses.source ├── monotorrent.in └── test.cs /.gitignore: -------------------------------------------------------------------------------- 1 | *.exe 2 | *.dll 3 | *~ 4 | *.mdb 5 | config.make 6 | mono-curses.pc 7 | mono-curses.tree 8 | mono-curses.xml 9 | mono-curses.zip 10 | tmp 11 | tmp.c 12 | attrib 13 | binding.cs 14 | *.so 15 | log 16 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Miguel de Icaza (miguel@gnome.org) -------------------------------------------------------------------------------- /AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // 2 | // used to sign mono-curses.dll 3 | // 4 | using System.Reflection; 5 | 6 | [assembly: AssemblyDelaySign (false)] 7 | [assembly: AssemblyKeyFile ("mono-curses.snk")] 8 | 9 | [assembly: AssemblyTitle ("Curses Binding for Mono/.NET")] 10 | [assembly: AssemblyProduct ("Mono")] 11 | [assembly: AssemblyCopyright ("2007-2008 Novell, Inc.")] 12 | [assembly: AssemblyCompany ("Novell, Inc.")] 13 | [assembly: AssemblyCulture ("")] 14 | [assembly: AssemblyConfiguration ("")] 15 | 16 | [assembly: AssemblyVersion ("1.0.0.0")] 17 | 18 | -------------------------------------------------------------------------------- /ChangeLog: -------------------------------------------------------------------------------- 1 | 2010-05-25 Miguel de Icaza 2 | 3 | * binding.cs.in: Assist in installation setups. 4 | 5 | 2010-02-08 Chris Howie 6 | 7 | * gui.cs: ProcessColdKey is broadcast to all widgets just like 8 | ProcessHotKey, but after ProcessKey instead of before. 9 | 10 | This method is now used by Button to implement default-button 11 | logic. This prevents a default button from consuming '\n' keys when there is 12 | another default button, or some other widget interested in '\n' when it it focused 13 | (like perhaps a TextArea widget). 14 | 15 | 16 | 2009-04-24 Miguel de Icaza 17 | 18 | * gui.cs (Entry): Raise the Changed event if set. 19 | 20 | * gui.cs: A handful of bug fixes. 21 | 22 | Based on patches from Flavio Percoco Premoli (flaper87@gmail.com): 23 | 24 | * gui.cs (Entry): Add support for Secret property. 25 | 26 | * gui.cs (CheckBox): New widget, a Checkbox. 27 | 28 | 2009-02-09 Jonathan Pryor 29 | 30 | * mono-curses.source: Add a /monodoc/node element so that 31 | documentation is inserted under the "Mono Libraries" node. 32 | 33 | Wed Oct 17 15:09:30 CEST 2007 Paolo Molaro 34 | 35 | * attrib.c: fixed compilation of constants. Note that mono-curses 36 | programs that use these constants are not portable to different 37 | systems and they'll need a recompile (bug #333808). 38 | 39 | 2007-04-15 Miguel de Icaza 40 | 41 | * demo.cs: Link it with MonoTorrent, add statistics display, 42 | actually switch the stats based on it, add resizing support, etc. 43 | 44 | Add a bunch of extra settings. 45 | 46 | * gui.cs: Add filing, fix Clear and all the related classes, 47 | complete resizing support, add Info methods, run in raw mode, 48 | support c-c and c-z. 49 | 50 | * Makefile: You must specify your bitsharp directory now. 51 | 52 | 2007-04-14 Miguel de Icaza 53 | 54 | * binding.cs.in: Add support for checking SIGWINCH. 55 | 56 | * gui.cs: Support SIGWINCH. Add the basics for layout, only 57 | Dialogs take advantage of this now. more to come. 58 | 59 | Add error method. 60 | 61 | * demo.cs: Add some prototypical stuff for starting to layout the 62 | UI for monotorrent. 63 | 64 | Add load/save settings, 65 | 66 | Add options dialog. 67 | 68 | 2007-04-13 Miguel de Icaza 69 | 70 | * binding.cs (IsAlt): new routine, constants to encode alt 71 | setting. 72 | 73 | * demo.cs: Provide a model for the listview, improve demo, include 74 | new pane to test focus across containers. 75 | 76 | * gui.cs: 77 | 78 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | CURSES=ncurses 2 | DESTDIR=/tmp 3 | MONO_CURSES=mono-curses 4 | 5 | CORE_SOURCES = \ 6 | handles.cs \ 7 | binding.cs \ 8 | mainloop.cs \ 9 | constants.cs 10 | 11 | SOURCES = \ 12 | $(CORE_SOURCES) \ 13 | AssemblyInfo.cs \ 14 | gui.cs 15 | 16 | EXTRA_DIST = \ 17 | mono-curses.snk \ 18 | configure \ 19 | Makefile \ 20 | binding.cs.in \ 21 | attrib.c \ 22 | mono-curses.c \ 23 | mono-curses.source \ 24 | mono-curses.pc.in 25 | 26 | 27 | DOCS_DIST = \ 28 | docs/ns-Mono.Terminal.xml \ 29 | docs/index.xml 30 | 31 | TESTS = test.exe \ 32 | gtest.exe \ 33 | guitest.exe \ 34 | mltest.exe 35 | 36 | all: config.make mono-curses.dll mono-curses.zip mono-curses.pc $(TESTS) 37 | 38 | test.exe: test.cs mono-curses.dll 39 | mcs -debug test.cs -r:mono-curses.dll 40 | 41 | grun: gtest.exe guitest.exe 42 | MONO_PATH=. mono --debug guitest.exe 43 | 44 | gtest.exe: gtest.cs mono-curses.dll 45 | dmcs -debug gtest.cs -r:mono-curses.dll 46 | 47 | guitest.exe: guitest.cs mono-curses.dll 48 | mcs -debug guitest.cs -r:mono-curses.dll 49 | 50 | mltest.exe: mltest.cs mono-curses.dll 51 | dmcs -debug mltest.cs -r:mono-curses.dll 52 | 53 | mlrun: mltest.exe 54 | mono --debug mltest.exe 55 | 56 | mono-curses.pc: mono-curses.pc.in Makefile 57 | sed -e 's,@PREFIX@,$(prefix),' -e 's/@VERSION@/$(VERSION)/' < mono-curses.pc.in > mono-curses.pc 58 | 59 | mono-curses.dll mono-curses.xml: $(SOURCES) 60 | mcs -nowarn:1591 -doc:mono-curses.xml -debug -target:library -out:mono-curses.dll -debug $(SOURCES) 61 | 62 | 63 | publish-internal: 64 | for i in $(CORE_SOURCES); do sed -e 's/public partial/internal partial/' -e 's/public struct /internal struct /g' -e 's/public class/internal class/' -e 's/public enum/internal enum/' -e 's/public interface/internal interface/' -e 's/internal class MainLoop/public class MainLoop/' -e 's/internal enum Condition/public enum Condition/' < $$i > $(DESTDIR)/$$i; done 65 | 66 | publish-to-gui: 67 | make publish-internal DESTDIR=../gui.cs/Terminal.Gui/MonoCurses/ 68 | 69 | # 70 | mono-curses.tree mono-curses.zip: mono-curses.xml mono-curses.dll docs/ns-Mono.Terminal.xml docs/index.xml 71 | monodocer -importslashdoc:mono-curses.xml -path:docs -assembly:mono-curses.dll 72 | mdassembler --ecma docs/ --out mono-curses 73 | 74 | #cute hack to avoid depending on ncurses-devel on Linux 75 | detect: 76 | echo "main () {initscr();}" > tmp.c 77 | gcc tmp.c -lncursesw -o tmp 78 | make binding CURSES=`ldd ./tmp | grep ncurses | awk '{print $$3}' | sed 's#.*libncurses#ncurses#'` 79 | 80 | constants.cs: attrib.c 81 | gcc -o attrib attrib.c -lncurses 82 | ./attrib constants.cs 83 | 84 | test: test.exe 85 | mono test.exe 86 | 87 | clean: 88 | -rm -f *.exe *dll *.so *dylib 89 | 90 | install: all 91 | mkdir -p $(prefix)/bin 92 | mkdir -p $(prefix)/lib/mono-curses 93 | mkdir -p $(prefix)/lib/pkgconfig 94 | gacutil -i mono-curses.dll -package mono-curses -root $(DESTDIR)$(prefix)/lib 95 | cp mono-curses.pc $(prefix)/lib/pkgconfig/ 96 | cp mono-curses.tree mono-curses.zip mono-curses.source `pkg-config --variable sourcesdir monodoc` 97 | 98 | config.make: 99 | @echo You must run configure first 100 | @exit 1 101 | 102 | include config.make 103 | 104 | dist: 105 | rm -rf mono-curses-$(VERSION) 106 | mkdir mono-curses-$(VERSION) 107 | mkdir mono-curses-$(VERSION)/docs 108 | cp -a $(SOURCES) $(EXTRA_DIST) mono-curses-$(VERSION) 109 | cp -a $(DOCS_DIST) mono-curses-$(VERSION)/docs 110 | tar czvf mono-curses-$(VERSION).tar.gz mono-curses-$(VERSION) 111 | rm -rf mono-curses-$(VERSION) 112 | 113 | distcheck: dist 114 | rm -rf test 115 | (mkdir test; cd test; tar xzvf ../mono-curses-$(VERSION).tar.gz; cd mono-curses-$(VERSION); \ 116 | ./configure --prefix=$$(cd `pwd`/..; pwd); \ 117 | make && make install && make dist); 118 | rm -rf test 119 | echo mono-curses-$(VERSION).tar.gz is ready for release 120 | 121 | push: 122 | scp mono-curses.tree mono-curses.zip mono-curses.source root@www.go-mono.com:/usr/lib/monodoc/sources/ 123 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | mono-curses 2 | =========== 3 | 4 | This provides both a low-level API, as well as a simple console 5 | UI toolkit called `gui.cs`. 6 | 7 | The goal of this library was to bind curses. There is a 8 | low-level binding in binding.cs and a few chunks in handles.cs 9 | that provide a basic abstraction. 10 | 11 | The focus of this work though has been on a simple GUI toolkit 12 | for writing desktop applications, inspired on the 15 year old 13 | work that I did for the Midnight Commander (you can tell I 14 | like those colors). 15 | 16 | The work in `gui' does not take advantage of curses "WINDOWS" 17 | or the Panel library as am not familiar with them, instead we 18 | create our own abstraction here. 19 | 20 | Example 21 | ======= 22 | 23 | I recently added a neutered version of an old UI I did for MonoTorrent 24 | that has the actual torrent code removed, but shows how to use 25 | the gui.cs toolkit. 26 | 27 | To run, just type `make grun` 28 | 29 | ![sample guitest.cs in action](gtestshot.png "Sample GuiTest.cs in action") 30 | 31 | License 32 | ======= 33 | 34 | This is an ncurses binding licensed under the terms of the MIT X11 35 | license. 36 | 37 | Features 38 | ======== 39 | 40 | Detects window changes, invokes event for widgets to relayout if 41 | the user wishes to. 42 | 43 | Hotkeys (Alt-letter) are handled by buttons and a handful others. 44 | 45 | Dialog boxes automatically get centered (even with window size change 46 | scenarios). 47 | 48 | Entry widget has emacs keybindings. 49 | 50 | ListView widget uses Model/View setup. 51 | 52 | Color and black and white support (first parameter to Application.Init) 53 | 54 | Setup and Building 55 | ================== 56 | 57 | To build, make sure that you run the configure script, where you can specify 58 | an installation prefix, and then run make. Like this: 59 | 60 | ``` 61 | $ configure 62 | $ make 63 | ``` 64 | 65 | The above defaults to installing in `/usr/local`, if you want to change that 66 | use the `--prefix` flag, like this: 67 | 68 | ``` 69 | $ configure --prefix=/opt/mono-curses/my-install 70 | $ make 71 | ``` 72 | 73 | Once you do a first build with the above, you can use the provided solution 74 | file to rebuild. 75 | 76 | Demo 77 | ==== 78 | 79 | You can see how to use the curses API by running the `test.exe`, which only shows 80 | some letters on the screen with curses, or the `guitest.exe` which is a fake 81 | application using gui.cs 82 | 83 | TODO for the tiny Gui.cs library 84 | ================================ 85 | 86 | I started an alternative version for gui.cs here: 87 | 88 | github.com/migueldeicaza/gui.cs 89 | 90 | * Rename x,y,w,h into something better, expose rects? 91 | * Merge Widget and Container? 92 | * Add scrollbar and thumb to listviews 93 | * Add text view widget 94 | * Add scrollable control 95 | * Checkbox/Radio button are missing 96 | * Date/Time widget 97 | * Process widget 98 | * Command line parsing to demo (to active B&W support). 99 | * Implement Layout managers, which? 100 | * Write a manual/tutorial 101 | 102 | 103 | -------------------------------------------------------------------------------- /TODO: -------------------------------------------------------------------------------- 1 | Things that should be done: 2 | 3 | * Switch the main loop in gui.cs to use mainloop.cs 4 | 5 | * Make some of the virtual methods that are part of the GUI 6 | infrastructure protected, no point in having ProcessEvent, 7 | HandleKey and so on be public. 8 | 9 | * Expose x, y, w, h into properties and have those trigger 10 | repaints if changed. 11 | 12 | * Rename? those to Width, Height? 13 | 14 | -------------------------------------------------------------------------------- /attrib.c: -------------------------------------------------------------------------------- 1 | // 2 | // attrib.c: Generates some C-level glue 3 | // 4 | // Authors: 5 | // Miguel de Icaza (miguel.de.icaza@gmail.com) 6 | // 7 | // Copyright (C) 2007 Novell (http://www.novell.com) 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | #include 29 | #include 30 | 31 | #define put(x) fprintf (OUT, "\t\tpublic const int " #x " = unchecked((int)0x%x);\n", x) 32 | #define pute(k,x) fprintf (OUT, "\t\t\t%s = unchecked((int)0x%x),\n", k, x) 33 | #define put2(s,x) fprintf (OUT, "\t\tpublic const int Key%s = unchecked((int)0x%x);\n", s, x) 34 | 35 | int 36 | main (int argc, char *argv []) 37 | { 38 | FILE *OUT = fopen (argv [1], "w"); 39 | 40 | int diff; 41 | 42 | initscr (); 43 | fprintf (OUT, "/*\n * This file is autogenerated by the attrib.c program, do not edit \n */\n\n"); 44 | fprintf (OUT, "using System;\n\n" 45 | "namespace Unix.Terminal {\n" 46 | "\tpublic partial class Curses {\n"); 47 | put (A_NORMAL); 48 | put (A_STANDOUT); 49 | put (A_UNDERLINE); 50 | put (A_REVERSE); 51 | put (A_BLINK); 52 | put (A_DIM); 53 | put (A_BOLD); 54 | put (A_PROTECT); 55 | put (A_INVIS); 56 | 57 | put (ACS_LLCORNER); 58 | put (ACS_LRCORNER); 59 | put (ACS_HLINE); 60 | put (ACS_ULCORNER); 61 | put (ACS_URCORNER); 62 | put (ACS_VLINE); 63 | put (ACS_LTEE); 64 | put (ACS_RTEE); 65 | put (ACS_BTEE); 66 | put (ACS_TTEE); 67 | put (ACS_PLUS); 68 | put (ACS_S1); 69 | put (ACS_S9); 70 | put (ACS_DIAMOND); 71 | put (ACS_CKBOARD); 72 | put (ACS_DEGREE); 73 | put (ACS_PLMINUS); 74 | put (ACS_BULLET); 75 | put (ACS_LARROW); 76 | put (ACS_RARROW); 77 | put (ACS_DARROW); 78 | put (ACS_UARROW); 79 | put (ACS_BOARD); 80 | put (ACS_LANTERN); 81 | put (ACS_BLOCK); 82 | 83 | 84 | 85 | put (COLOR_BLACK); 86 | put (COLOR_RED); 87 | put (COLOR_GREEN); 88 | put (COLOR_YELLOW); 89 | put (COLOR_BLUE); 90 | put (COLOR_MAGENTA); 91 | put (COLOR_CYAN); 92 | put (COLOR_WHITE); 93 | put (KEY_CODE_YES); 94 | 95 | fprintf (OUT, "\t\tpublic enum Event : long {\n"); 96 | pute ("Button1Pressed", BUTTON1_PRESSED); 97 | pute ("Button1Released", BUTTON1_RELEASED); 98 | pute ("Button1Clicked", BUTTON1_CLICKED); 99 | pute ("Button1DoubleClicked", BUTTON1_DOUBLE_CLICKED); 100 | pute ("Button1TripleClicked", BUTTON1_TRIPLE_CLICKED); 101 | pute ("Button2Pressed", BUTTON2_PRESSED); 102 | pute ("Button2Released", BUTTON2_RELEASED); 103 | pute ("Button2Clicked", BUTTON2_CLICKED); 104 | pute ("Button2DoubleClicked", BUTTON2_DOUBLE_CLICKED); 105 | pute ("Button2TrippleClicked", BUTTON2_TRIPLE_CLICKED); 106 | pute ("Button3Pressed", BUTTON3_PRESSED); 107 | pute ("Button3Released", BUTTON3_RELEASED); 108 | pute ("Button3Clicked", BUTTON3_CLICKED); 109 | pute ("Button3DoubleClicked", BUTTON3_DOUBLE_CLICKED); 110 | pute ("Button3TripleClicked", BUTTON3_TRIPLE_CLICKED); 111 | pute ("Button4Pressed", BUTTON4_PRESSED); 112 | pute ("Button4Released", BUTTON4_RELEASED); 113 | pute ("Button4Clicked", BUTTON4_CLICKED); 114 | pute ("Button4DoubleClicked", BUTTON4_DOUBLE_CLICKED); 115 | pute ("Button4TripleClicked", BUTTON4_TRIPLE_CLICKED); 116 | pute ("ButtonShift", BUTTON_SHIFT); 117 | pute ("ButtonCtrl", BUTTON_CTRL); 118 | pute ("ButtonAlt", BUTTON_ALT); 119 | pute ("ReportMousePosition", REPORT_MOUSE_POSITION); 120 | pute ("AllEvents", ALL_MOUSE_EVENTS); 121 | fprintf (OUT, "\t\t}\n"); 122 | put (ERR); 123 | 124 | put2 ("Backspace", KEY_BACKSPACE); 125 | put2 ("Up", KEY_UP); 126 | put2 ("Down", KEY_DOWN); 127 | put2 ("Left", KEY_LEFT); 128 | put2 ("Right", KEY_RIGHT); 129 | put2 ("NPage", KEY_NPAGE); 130 | put2 ("PPage", KEY_PPAGE); 131 | put2 ("Home", KEY_HOME); 132 | put2 ("Mouse", KEY_MOUSE); 133 | put2 ("End", KEY_END); 134 | put2 ("DeleteChar", KEY_DC); 135 | put2 ("InsertChar", KEY_IC); 136 | put2 ("BackTab", KEY_BTAB); 137 | put2 ("F1", KEY_F(1)); 138 | put2 ("F2", KEY_F(2)); 139 | put2 ("F3", KEY_F(3)); 140 | put2 ("F4", KEY_F(4)); 141 | put2 ("F5", KEY_F(5)); 142 | put2 ("F6", KEY_F(6)); 143 | put2 ("F7", KEY_F(7)); 144 | put2 ("F8", KEY_F(8)); 145 | put2 ("F9", KEY_F(9)); 146 | put2 ("F10", KEY_F(10)); 147 | put2 ("Resize", KEY_RESIZE); 148 | 149 | diff = COLOR_PAIR (1) - COLOR_PAIR(0); 150 | fprintf (OUT, "\n\n\t\tstatic public int ColorPair(int n){\n" 151 | "\t\t\treturn %d + n * %d;\n" 152 | "\t\t}\n\n", COLOR_PAIR (0), diff); 153 | fprintf (OUT,"\t}\n}\n"); 154 | fclose (OUT); 155 | endwin (); 156 | return 0; 157 | } 158 | -------------------------------------------------------------------------------- /configure: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | VERSION=0.3 3 | prefix=/usr/local 4 | while test x$1 != x; do 5 | case $1 in 6 | --prefix=*) 7 | prefix=`echo $1 | sed 's/--prefix=//'` 8 | ;; 9 | --prefix) 10 | echo --prefix needs an argument: --prefix=directory >&2 11 | ;; 12 | *) 13 | echo Unknown argument $1 >&2 14 | esac 15 | shift 16 | done 17 | 18 | echo "prefix=$prefix" > config.make 19 | echo "RUNTIME=mono" >> config.make 20 | echo "ASSEMBLY_VERSION=$VERSION.0.0" >> config.make 21 | echo "VERSION=$VERSION" >> config.make 22 | 23 | echo "MonoTorrent+Curses has been configure to be installed in $prefix" -------------------------------------------------------------------------------- /docs/Mono.Terminal/Anchor.xml.remove: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | mono-curses 5 | 0.0.0.0 6 | 7 | 8 | System.Enum 9 | 10 | 11 | 12 | System.Flags 13 | 14 | 15 | 16 | To be added. 17 | To be added. 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | Field 27 | Mono.Terminal.Anchor 28 | To be added. 29 | 0.0.0.0 30 | 31 | Field 32 | Mono.Terminal.Anchor 33 | To be added. 34 | 0.0.0.0 35 | 36 | Field 37 | Mono.Terminal.Anchor 38 | To be added. 39 | 0.0.0.0 40 | 41 | Field 42 | Mono.Terminal.Anchor 43 | To be added. 44 | 0.0.0.0 45 | 46 | Field 47 | Mono.Terminal.Anchor 48 | To be added. 49 | 0.0.0.0 50 | 51 | 52 | -------------------------------------------------------------------------------- /docs/Mono.Terminal/Button.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | mono-curses 6 | 0.0.0.0 7 | 1.0.0.0 8 | 9 | 10 | Mono.Terminal.Widget 11 | 12 | 13 | 14 | 15 | Button widget 16 | 17 | 18 | Provides a button that can be clicked, or pressed with 19 | the enter key and processes hotkeys (the first uppercase 20 | letter in the button becomes the hotkey). 21 | 22 | 23 | 24 | 25 | 26 | 27 | Constructor 28 | 29 | 0.0.0.0 30 | 1.0.0.0 31 | 32 | 33 | 34 | 35 | 36 | To be added. 37 | 38 | Public constructor, creates a button based on 39 | the given text at position 0,0 40 | 41 | 42 | The size of the button is computed based on the 43 | text length. This button is not a default button. 44 | 45 | 46 | 47 | 48 | 49 | 50 | Constructor 51 | 52 | 0.0.0.0 53 | 1.0.0.0 54 | 55 | 56 | 57 | 58 | 59 | 60 | To be added. 61 | To be added. 62 | 63 | Public constructor, creates a button based on 64 | the given text. 65 | 66 | 67 | If the value for is_default is true, a special 68 | decoration is used, and the enter key on a 69 | dialog would implicitly activate this button. 70 | 71 | 72 | 73 | 74 | 75 | 76 | Constructor 77 | 78 | 0.0.0.0 79 | 1.0.0.0 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | To be added. 88 | To be added. 89 | To be added. 90 | 91 | Public constructor, creates a button based on 92 | the given text at the given position. 93 | 94 | 95 | The size of the button is computed based on the 96 | text length. This button is not a default button. 97 | 98 | 99 | 100 | 101 | 102 | 103 | Constructor 104 | 105 | 0.0.0.0 106 | 1.0.0.0 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | To be added. 116 | To be added. 117 | To be added. 118 | To be added. 119 | 120 | Public constructor, creates a button based on 121 | the given text at the given position. 122 | 123 | 124 | If the value for is_default is true, a special 125 | decoration is used, and the enter key on a 126 | dialog would implicitly activate this button. 127 | 128 | 129 | 130 | 131 | 132 | 133 | Event 134 | 135 | 0.0.0.0 136 | 1.0.0.0 137 | 138 | 139 | System.EventHandler 140 | 141 | 142 | 143 | Clicked event, raised when the button is clicked. 144 | 145 | 146 | Client code can hook up to this event, it is 147 | raised when the button is activated either with 148 | the mouse or the keyboard. 149 | 150 | 151 | 152 | 153 | 154 | 155 | Method 156 | 157 | 1.0.0.0 158 | 159 | 160 | System.Void 161 | 162 | 163 | 164 | To be added. 165 | To be added. 166 | 167 | 168 | 169 | 170 | 171 | Method 172 | 173 | 1.0.0.0 174 | 175 | 176 | System.Boolean 177 | 178 | 179 | 180 | 181 | 182 | To be added. 183 | To be added. 184 | To be added. 185 | To be added. 186 | 187 | 188 | 189 | 190 | 191 | Method 192 | 193 | 1.0.0.0 194 | 195 | 196 | System.Boolean 197 | 198 | 199 | 200 | 201 | 202 | To be added. 203 | To be added. 204 | To be added. 205 | To be added. 206 | 207 | 208 | 209 | 210 | 211 | Method 212 | 213 | 1.0.0.0 214 | 215 | 216 | System.Boolean 217 | 218 | 219 | 220 | 221 | 222 | To be added. 223 | To be added. 224 | To be added. 225 | To be added. 226 | 227 | 228 | 229 | 230 | 231 | Method 232 | 233 | 1.0.0.0 234 | 235 | 236 | System.Void 237 | 238 | 239 | 240 | 241 | 242 | To be added. 243 | To be added. 244 | To be added. 245 | 246 | 247 | 248 | 249 | 250 | Method 251 | 252 | 1.0.0.0 253 | 254 | 255 | System.Void 256 | 257 | 258 | 259 | To be added. 260 | To be added. 261 | 262 | 263 | 264 | 265 | 266 | Property 267 | 268 | 0.0.0.0 269 | 1.0.0.0 270 | 271 | 272 | System.String 273 | 274 | 275 | 276 | The text displayed by this widget. 277 | 278 | To be added. 279 | To be added. 280 | 281 | 282 | 283 | 284 | -------------------------------------------------------------------------------- /docs/Mono.Terminal/CheckBox.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | mono-curses 6 | 1.0.0.0 7 | 8 | 9 | Mono.Terminal.Widget 10 | 11 | 12 | 13 | To be added. 14 | To be added. 15 | 16 | 17 | 18 | 19 | 20 | Constructor 21 | 22 | 1.0.0.0 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | To be added. 31 | To be added. 32 | To be added. 33 | 34 | Public constructor, creates a CheckButton based on 35 | the given text at the given position. 36 | 37 | 38 | The size of CheckButton is computed based on the 39 | text length. This CheckButton is not toggled. 40 | 41 | 42 | 43 | 44 | 45 | 46 | Constructor 47 | 48 | 1.0.0.0 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | To be added. 58 | To be added. 59 | To be added. 60 | To be added. 61 | 62 | Public constructor, creates a CheckButton based on 63 | the given text at the given position and a state. 64 | 65 | 66 | The size of CheckButton is computed based on the 67 | text length. 68 | 69 | 70 | 71 | 72 | 73 | 74 | Property 75 | 76 | 1.0.0.0 77 | 78 | 79 | System.Boolean 80 | 81 | 82 | 83 | The state of the checkbox. 84 | 85 | To be added. 86 | To be added. 87 | 88 | 89 | 90 | 91 | 92 | Method 93 | 94 | 1.0.0.0 95 | 96 | 97 | System.Void 98 | 99 | 100 | 101 | To be added. 102 | To be added. 103 | 104 | 105 | 106 | 107 | 108 | Method 109 | 110 | 1.0.0.0 111 | 112 | 113 | System.Boolean 114 | 115 | 116 | 117 | 118 | 119 | To be added. 120 | To be added. 121 | To be added. 122 | To be added. 123 | 124 | 125 | 126 | 127 | 128 | Method 129 | 130 | 1.0.0.0 131 | 132 | 133 | System.Void 134 | 135 | 136 | 137 | 138 | 139 | To be added. 140 | To be added. 141 | To be added. 142 | 143 | 144 | 145 | 146 | 147 | Method 148 | 149 | 1.0.0.0 150 | 151 | 152 | System.Void 153 | 154 | 155 | 156 | To be added. 157 | To be added. 158 | 159 | 160 | 161 | 162 | 163 | Property 164 | 165 | 1.0.0.0 166 | 167 | 168 | System.String 169 | 170 | 171 | 172 | The text displayed by this widget. 173 | 174 | To be added. 175 | To be added. 176 | 177 | 178 | 179 | 180 | 181 | Event 182 | 183 | 1.0.0.0 184 | 185 | 186 | System.EventHandler 187 | 188 | 189 | 190 | Toggled event, raised when the CheckButton is toggled. 191 | 192 | 193 | Client code can hook up to this event, it is 194 | raised when the checkbutton is activated either with 195 | the mouse or the keyboard. 196 | 197 | 198 | 199 | 200 | 201 | -------------------------------------------------------------------------------- /docs/Mono.Terminal/Curses+Event.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | mono-curses 6 | 0.0.0.0 7 | 8 | 9 | System.Enum 10 | 11 | 12 | To be added. 13 | To be added. 14 | 15 | 16 | 17 | 18 | 19 | Field 20 | 21 | 0.0.0.0 22 | 1.0.0.0 23 | 24 | 25 | Mono.Terminal.Curses+Event 26 | 27 | 28 | To be added. 29 | 30 | 31 | 32 | 33 | 34 | Field 35 | 36 | 0.0.0.0 37 | 1.0.0.0 38 | 39 | 40 | Mono.Terminal.Curses+Event 41 | 42 | 43 | To be added. 44 | 45 | 46 | 47 | 48 | 49 | Field 50 | 51 | 0.0.0.0 52 | 1.0.0.0 53 | 54 | 55 | Mono.Terminal.Curses+Event 56 | 57 | 58 | To be added. 59 | 60 | 61 | 62 | 63 | 64 | Field 65 | 66 | 0.0.0.0 67 | 1.0.0.0 68 | 69 | 70 | Mono.Terminal.Curses+Event 71 | 72 | 73 | To be added. 74 | 75 | 76 | 77 | 78 | 79 | Field 80 | 81 | 0.0.0.0 82 | 1.0.0.0 83 | 84 | 85 | Mono.Terminal.Curses+Event 86 | 87 | 88 | To be added. 89 | 90 | 91 | 92 | 93 | 94 | Field 95 | 96 | 0.0.0.0 97 | 1.0.0.0 98 | 99 | 100 | Mono.Terminal.Curses+Event 101 | 102 | 103 | To be added. 104 | 105 | 106 | 107 | 108 | 109 | Field 110 | 111 | 0.0.0.0 112 | 1.0.0.0 113 | 114 | 115 | Mono.Terminal.Curses+Event 116 | 117 | 118 | To be added. 119 | 120 | 121 | 122 | 123 | 124 | Field 125 | 126 | 0.0.0.0 127 | 1.0.0.0 128 | 129 | 130 | Mono.Terminal.Curses+Event 131 | 132 | 133 | To be added. 134 | 135 | 136 | 137 | 138 | 139 | Field 140 | 141 | 0.0.0.0 142 | 1.0.0.0 143 | 144 | 145 | Mono.Terminal.Curses+Event 146 | 147 | 148 | To be added. 149 | 150 | 151 | 152 | 153 | 154 | Field 155 | 156 | 0.0.0.0 157 | 1.0.0.0 158 | 159 | 160 | Mono.Terminal.Curses+Event 161 | 162 | 163 | To be added. 164 | 165 | 166 | 167 | 168 | 169 | Field 170 | 171 | 0.0.0.0 172 | 1.0.0.0 173 | 174 | 175 | Mono.Terminal.Curses+Event 176 | 177 | 178 | To be added. 179 | 180 | 181 | 182 | 183 | 184 | Field 185 | 186 | 0.0.0.0 187 | 1.0.0.0 188 | 189 | 190 | Mono.Terminal.Curses+Event 191 | 192 | 193 | To be added. 194 | 195 | 196 | 197 | 198 | 199 | Field 200 | 201 | 0.0.0.0 202 | 1.0.0.0 203 | 204 | 205 | Mono.Terminal.Curses+Event 206 | 207 | 208 | To be added. 209 | 210 | 211 | 212 | 213 | 214 | Field 215 | 216 | 0.0.0.0 217 | 1.0.0.0 218 | 219 | 220 | Mono.Terminal.Curses+Event 221 | 222 | 223 | To be added. 224 | 225 | 226 | 227 | 228 | 229 | Field 230 | 231 | 0.0.0.0 232 | 1.0.0.0 233 | 234 | 235 | Mono.Terminal.Curses+Event 236 | 237 | 238 | To be added. 239 | 240 | 241 | 242 | 243 | 244 | Field 245 | 246 | 0.0.0.0 247 | 1.0.0.0 248 | 249 | 250 | Mono.Terminal.Curses+Event 251 | 252 | 253 | To be added. 254 | 255 | 256 | 257 | 258 | 259 | Field 260 | 261 | 0.0.0.0 262 | 1.0.0.0 263 | 264 | 265 | Mono.Terminal.Curses+Event 266 | 267 | 268 | To be added. 269 | 270 | 271 | 272 | 273 | 274 | Field 275 | 276 | 0.0.0.0 277 | 1.0.0.0 278 | 279 | 280 | Mono.Terminal.Curses+Event 281 | 282 | 283 | To be added. 284 | 285 | 286 | 287 | 288 | 289 | Field 290 | 291 | 0.0.0.0 292 | 1.0.0.0 293 | 294 | 295 | Mono.Terminal.Curses+Event 296 | 297 | 298 | To be added. 299 | 300 | 301 | 302 | 303 | 304 | Field 305 | 306 | 0.0.0.0 307 | 1.0.0.0 308 | 309 | 310 | Mono.Terminal.Curses+Event 311 | 312 | 313 | To be added. 314 | 315 | 316 | 317 | 318 | 319 | Field 320 | 321 | 0.0.0.0 322 | 1.0.0.0 323 | 324 | 325 | Mono.Terminal.Curses+Event 326 | 327 | 328 | To be added. 329 | 330 | 331 | 332 | 333 | 334 | Field 335 | 336 | 0.0.0.0 337 | 1.0.0.0 338 | 339 | 340 | Mono.Terminal.Curses+Event 341 | 342 | 343 | To be added. 344 | 345 | 346 | 347 | 348 | 349 | Field 350 | 351 | 0.0.0.0 352 | 1.0.0.0 353 | 354 | 355 | Mono.Terminal.Curses+Event 356 | 357 | 358 | To be added. 359 | 360 | 361 | 362 | 363 | 364 | Field 365 | 366 | 0.0.0.0 367 | 1.0.0.0 368 | 369 | 370 | Mono.Terminal.Curses+Event 371 | 372 | 373 | To be added. 374 | 375 | 376 | 377 | 378 | 379 | Field 380 | 381 | 0.0.0.0 382 | 1.0.0.0 383 | 384 | 385 | Mono.Terminal.Curses+Event 386 | 387 | 388 | To be added. 389 | 390 | 391 | 392 | 393 | -------------------------------------------------------------------------------- /docs/Mono.Terminal/Curses+MouseEvent.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | mono-curses 6 | 0.0.0.0 7 | 8 | 9 | System.ValueType 10 | 11 | 12 | 13 | To be added. 14 | To be added. 15 | 16 | 17 | 18 | 19 | 20 | Field 21 | 22 | 0.0.0.0 23 | 1.0.0.0 24 | 25 | 26 | Mono.Terminal.Curses+Event 27 | 28 | 29 | To be added. 30 | To be added. 31 | 32 | 33 | 34 | 35 | 36 | Field 37 | 38 | 0.0.0.0 39 | 1.0.0.0 40 | 41 | 42 | System.Int16 43 | 44 | 45 | To be added. 46 | To be added. 47 | 48 | 49 | 50 | 51 | 52 | Field 53 | 54 | 0.0.0.0 55 | 1.0.0.0 56 | 57 | 58 | System.Int32 59 | 60 | 61 | To be added. 62 | To be added. 63 | 64 | 65 | 66 | 67 | 68 | Field 69 | 70 | 0.0.0.0 71 | 1.0.0.0 72 | 73 | 74 | System.Int32 75 | 76 | 77 | To be added. 78 | To be added. 79 | 80 | 81 | 82 | 83 | 84 | Field 85 | 86 | 0.0.0.0 87 | 1.0.0.0 88 | 89 | 90 | System.Int32 91 | 92 | 93 | To be added. 94 | To be added. 95 | 96 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /docs/Mono.Terminal/Dialog.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | mono-curses 6 | 0.0.0.0 7 | 1.0.0.0 8 | 9 | 10 | Mono.Terminal.Frame 11 | 12 | 13 | 14 | 15 | A Dialog is a container that can also have a number of 16 | buttons at the bottom 17 | 18 | 19 | Dialogs are containers that can have a set of buttons at 20 | the bottom. Dialogs are automatically centered on the 21 | screen, and on screen changes the buttons are 22 | relaid out. 23 | 24 | To make the dialog box run until an option has been 25 | executed, you would typically create the dialog box and 26 | then call Application.Run on the Dialog instance. 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | Constructor 35 | 36 | 0.0.0.0 37 | 1.0.0.0 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | To be added. 46 | To be added. 47 | To be added. 48 | 49 | Public constructor. 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | Method 58 | 59 | 0.0.0.0 60 | 1.0.0.0 61 | 62 | 63 | System.Void 64 | 65 | 66 | 67 | 68 | 69 | To be added. 70 | 71 | Adds a button to the dialog 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | Method 80 | 81 | 1.0.0.0 82 | 83 | 84 | System.Void 85 | 86 | 87 | 88 | 89 | 90 | 91 | To be added. 92 | To be added. 93 | To be added. 94 | To be added. 95 | 96 | 97 | 98 | 99 | 100 | Method 101 | 102 | 1.0.0.0 103 | 104 | 105 | System.Void 106 | 107 | 108 | 109 | To be added. 110 | To be added. 111 | 112 | 113 | 114 | 115 | 116 | Method 117 | 118 | 1.0.0.0 119 | 120 | 121 | System.Void 122 | 123 | 124 | 125 | 126 | Makes the default style for the dialog use the error colors. 127 | 128 | To be added. 129 | 130 | 131 | 132 | 133 | 134 | Method 135 | 136 | 1.0.0.0 137 | 138 | 139 | System.Void 140 | 141 | 142 | 143 | 144 | 145 | 146 | To be added. 147 | To be added. 148 | To be added. 149 | To be added. 150 | 151 | 152 | 153 | 154 | 155 | Method 156 | 157 | 1.0.0.0 158 | 159 | 160 | System.Void 161 | 162 | 163 | 164 | To be added. 165 | To be added. 166 | 167 | 168 | 169 | 170 | 171 | Method 172 | 173 | 1.0.0.0 174 | 175 | 176 | System.Boolean 177 | 178 | 179 | 180 | 181 | 182 | To be added. 183 | To be added. 184 | To be added. 185 | To be added. 186 | 187 | 188 | 189 | 190 | 191 | Method 192 | 193 | 1.0.0.0 194 | 195 | 196 | System.Void 197 | 198 | 199 | 200 | To be added. 201 | To be added. 202 | 203 | 204 | 205 | 206 | -------------------------------------------------------------------------------- /docs/Mono.Terminal/Entry.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | mono-curses 6 | 0.0.0.0 7 | 1.0.0.0 8 | 9 | 10 | Mono.Terminal.Widget 11 | 12 | 13 | 14 | 15 | Text data entry widget 16 | 17 | 18 | The Entry widget provides Emacs-like editing 19 | functionality, and mouse support. 20 | 21 | 22 | 23 | 24 | 25 | 26 | Constructor 27 | 28 | 0.0.0.0 29 | 1.0.0.0 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | To be added. 39 | To be added. 40 | To be added. 41 | To be added. 42 | 43 | Public constructor. 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | Event 52 | 53 | 1.0.0.0 54 | 55 | 56 | System.EventHandler 57 | 58 | 59 | 60 | Changed event, raised when the text has clicked. 61 | 62 | 63 | Client code can hook up to this event, it is 64 | raised when the text in the entry changes. 65 | 66 | 67 | 68 | 69 | 70 | 71 | Property 72 | 73 | 1.0.0.0 74 | 75 | 76 | System.Int32 77 | 78 | 79 | 80 | The color used to display the text 81 | 82 | To be added. 83 | To be added. 84 | 85 | 86 | 87 | 88 | 89 | Property 90 | 91 | 1.0.0.0 92 | 93 | 94 | System.Int32 95 | 96 | 97 | 98 | The current cursor position. 99 | 100 | To be added. 101 | To be added. 102 | 103 | 104 | 105 | 106 | 107 | Method 108 | 109 | 1.0.0.0 110 | 111 | 112 | System.Void 113 | 114 | 115 | 116 | 117 | Sets the cursor position. 118 | 119 | To be added. 120 | 121 | 122 | 123 | 124 | 125 | Method 126 | 127 | 1.0.0.0 128 | 129 | 130 | System.Boolean 131 | 132 | 133 | 134 | 135 | 136 | To be added. 137 | To be added. 138 | To be added. 139 | To be added. 140 | 141 | 142 | 143 | 144 | 145 | Method 146 | 147 | 1.0.0.0 148 | 149 | 150 | System.Void 151 | 152 | 153 | 154 | 155 | 156 | To be added. 157 | To be added. 158 | To be added. 159 | 160 | 161 | 162 | 163 | 164 | Method 165 | 166 | 1.0.0.0 167 | 168 | 169 | System.Void 170 | 171 | 172 | 173 | To be added. 174 | To be added. 175 | 176 | 177 | 178 | 179 | 180 | Property 181 | 182 | 1.0.0.0 183 | 184 | 185 | System.Boolean 186 | 187 | 188 | 189 | Sets the secret property. 190 | 191 | To be added. 192 | 193 | This makes the text entry suitable for entering passwords. 194 | 195 | 196 | 197 | 198 | 199 | 200 | Property 201 | 202 | 0.0.0.0 203 | 1.0.0.0 204 | 205 | 206 | System.String 207 | 208 | 209 | 210 | Sets or gets the text in the entry. 211 | 212 | To be added. 213 | 214 | 215 | 216 | 217 | 218 | -------------------------------------------------------------------------------- /docs/Mono.Terminal/Fill.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | mono-curses 6 | 0.0.0.0 7 | 1.0.0.0 8 | 9 | 10 | System.Enum 11 | 12 | 13 | 14 | System.Flags 15 | 16 | 17 | 18 | 19 | The fill values apply from the given x, y values, they will not do 20 | a full fill, you must compute x, y yourself. 21 | 22 | To be added. 23 | 24 | 25 | 26 | 27 | 28 | Field 29 | 30 | 0.0.0.0 31 | 1.0.0.0 32 | 33 | 34 | Mono.Terminal.Fill 35 | 36 | 37 | To be added. 38 | 39 | 40 | 41 | 42 | 43 | Field 44 | 45 | 0.0.0.0 46 | 1.0.0.0 47 | 48 | 49 | Mono.Terminal.Fill 50 | 51 | 52 | To be added. 53 | 54 | 55 | 56 | 57 | 58 | Field 59 | 60 | 0.0.0.0 61 | 1.0.0.0 62 | 63 | 64 | Mono.Terminal.Fill 65 | 66 | 67 | To be added. 68 | 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /docs/Mono.Terminal/Frame.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | mono-curses 6 | 0.0.0.0 7 | 1.0.0.0 8 | 9 | 10 | Mono.Terminal.Container 11 | 12 | 13 | 14 | 15 | Framed-container widget. 16 | 17 | 18 | A container that provides a frame around its children, 19 | and an optional title. 20 | 21 | 22 | 23 | 24 | 25 | 26 | Constructor 27 | 28 | 0.0.0.0 29 | 1.0.0.0 30 | 31 | 32 | 33 | 34 | 35 | To be added. 36 | 37 | Creates an empty frame, with the given title 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | Constructor 46 | 47 | 0.0.0.0 48 | 1.0.0.0 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | To be added. 59 | To be added. 60 | To be added. 61 | To be added. 62 | To be added. 63 | 64 | Public constructor, a frame, with the given title. 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | Method 73 | 74 | 1.0.0.0 75 | 76 | 77 | System.Void 78 | 79 | 80 | 81 | 82 | 83 | To be added. 84 | To be added. 85 | To be added. 86 | 87 | 88 | 89 | 90 | 91 | Method 92 | 93 | 1.0.0.0 94 | 95 | 96 | System.Void 97 | 98 | 99 | 100 | 101 | 102 | 103 | To be added. 104 | To be added. 105 | To be added. 106 | To be added. 107 | 108 | 109 | 110 | 111 | 112 | Method 113 | 114 | 1.0.0.0 115 | 116 | 117 | System.Void 118 | 119 | 120 | 121 | 122 | 123 | 124 | To be added. 125 | To be added. 126 | To be added. 127 | To be added. 128 | 129 | 130 | 131 | 132 | 133 | Method 134 | 135 | 1.0.0.0 136 | 137 | 138 | System.Void 139 | 140 | 141 | 142 | To be added. 143 | To be added. 144 | 145 | 146 | 147 | 148 | 149 | Field 150 | 151 | 0.0.0.0 152 | 1.0.0.0 153 | 154 | 155 | System.String 156 | 157 | 158 | To be added. 159 | To be added. 160 | 161 | 162 | 163 | 164 | -------------------------------------------------------------------------------- /docs/Mono.Terminal/IListProvider.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | mono-curses 6 | 0.0.0.0 7 | 1.0.0.0 8 | 9 | 10 | 11 | 12 | Model for the widget. 13 | 14 | 15 | Consumers of the widget should 16 | implement this interface 17 | 18 | 19 | 20 | 21 | 22 | 23 | Property 24 | 25 | 0.0.0.0 26 | 1.0.0.0 27 | 28 | 29 | System.Boolean 30 | 31 | 32 | 33 | Whether the ListView should allow items to be 34 | marked. 35 | 36 | To be added. 37 | To be added. 38 | 39 | 40 | 41 | 42 | 43 | Method 44 | 45 | 0.0.0.0 46 | 1.0.0.0 47 | 48 | 49 | System.Boolean 50 | 51 | 52 | 53 | 54 | 55 | To be added. 56 | 57 | Whether the given item is marked. 58 | 59 | To be added. 60 | To be added. 61 | 62 | 63 | 64 | 65 | 66 | Property 67 | 68 | 0.0.0.0 69 | 1.0.0.0 70 | 71 | 72 | System.Int32 73 | 74 | 75 | 76 | Number of items in the model. 77 | 78 | To be added. 79 | 80 | This should return the number of items in the 81 | model. 82 | 83 | 84 | 85 | 86 | 87 | 88 | Method 89 | 90 | 0.0.0.0 91 | 1.0.0.0 92 | 93 | 94 | System.Boolean 95 | 96 | 97 | 98 | 99 | 100 | To be added. 101 | 102 | Allows the model to process the given keystroke. 103 | 104 | To be added. 105 | 106 | The model should return true if the key was 107 | processed, false otherwise. 108 | 109 | 110 | 111 | 112 | 113 | 114 | Method 115 | 116 | 0.0.0.0 117 | 1.0.0.0 118 | 119 | 120 | System.Void 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | To be added. 130 | To be added. 131 | To be added. 132 | To be added. 133 | 134 | This should render the item at the given line, 135 | col with the specified width. 136 | 137 | To be added. 138 | 139 | 140 | 141 | 142 | 143 | Method 144 | 145 | 0.0.0.0 146 | 1.0.0.0 147 | 148 | 149 | System.Void 150 | 151 | 152 | 153 | 154 | Callback: invoked when the selected item has changed. 155 | 156 | To be added. 157 | 158 | 159 | 160 | 161 | 162 | Method 163 | 164 | 0.0.0.0 165 | 1.0.0.0 166 | 167 | 168 | System.Void 169 | 170 | 171 | 172 | 173 | 174 | To be added. 175 | 176 | Callback: this is the way that the model is 177 | hooked up to its actual view. 178 | 179 | To be added. 180 | 181 | 182 | 183 | 184 | -------------------------------------------------------------------------------- /docs/Mono.Terminal/Label.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | mono-curses 6 | 0.0.0.0 7 | 1.0.0.0 8 | 9 | 10 | Mono.Terminal.Widget 11 | 12 | 13 | 14 | 15 | Label widget, displays a string at a given position. 16 | 17 | To be added. 18 | 19 | 20 | 21 | 22 | 23 | Constructor 24 | 25 | 0.0.0.0 26 | 1.0.0.0 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | To be added. 35 | To be added. 36 | To be added. 37 | 38 | Public constructor: creates a label at the given 39 | coordinate with the given string. 40 | 41 | To be added. 42 | 43 | 44 | 45 | 46 | 47 | Constructor 48 | 49 | 1.0.0.0 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | System.ParamArray 59 | 60 | 61 | 62 | 63 | 64 | To be added. 65 | To be added. 66 | To be added. 67 | To be added. 68 | To be added. 69 | To be added. 70 | 71 | 72 | 73 | 74 | 75 | Field 76 | 77 | 0.0.0.0 78 | 1.0.0.0 79 | 80 | 81 | System.Int32 82 | 83 | 84 | To be added. 85 | To be added. 86 | 87 | 88 | 89 | 90 | 91 | Method 92 | 93 | 1.0.0.0 94 | 95 | 96 | System.Void 97 | 98 | 99 | 100 | To be added. 101 | To be added. 102 | 103 | 104 | 105 | 106 | 107 | Field 108 | 109 | 0.0.0.0 110 | 1.0.0.0 111 | 112 | 113 | System.String 114 | 115 | 116 | To be added. 117 | To be added. 118 | 119 | 120 | 121 | 122 | 123 | Property 124 | 125 | 0.0.0.0 126 | 1.0.0.0 127 | 128 | 129 | System.String 130 | 131 | 132 | 133 | The text displayed by this widget. 134 | 135 | To be added. 136 | To be added. 137 | 138 | 139 | 140 | 141 | -------------------------------------------------------------------------------- /docs/Mono.Terminal/ListView.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | mono-curses 6 | 0.0.0.0 7 | 1.0.0.0 8 | 9 | 10 | Mono.Terminal.Widget 11 | 12 | 13 | 14 | 15 | A Listview widget. 16 | 17 | 18 | This widget renders a list of data. The actual 19 | rendering is implemented by an instance of the class 20 | IListProvider that must be supplied at construction time. 21 | 22 | 23 | 24 | 25 | 26 | 27 | Constructor 28 | 29 | 0.0.0.0 30 | 1.0.0.0 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | To be added. 41 | To be added. 42 | To be added. 43 | To be added. 44 | To be added. 45 | 46 | Public constructor. 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | Method 55 | 56 | 1.0.0.0 57 | 58 | 59 | System.Void 60 | 61 | 62 | 63 | To be added. 64 | To be added. 65 | 66 | 67 | 68 | 69 | 70 | Method 71 | 72 | 1.0.0.0 73 | 74 | 75 | System.Boolean 76 | 77 | 78 | 79 | 80 | 81 | To be added. 82 | To be added. 83 | To be added. 84 | To be added. 85 | 86 | 87 | 88 | 89 | 90 | Method 91 | 92 | 1.0.0.0 93 | 94 | 95 | System.Void 96 | 97 | 98 | 99 | 100 | 101 | To be added. 102 | To be added. 103 | To be added. 104 | 105 | 106 | 107 | 108 | 109 | Method 110 | 111 | 0.0.0.0 112 | 1.0.0.0 113 | 114 | 115 | System.Void 116 | 117 | 118 | 119 | 120 | This method can be invoked by the model to 121 | notify the view that the contents of the model 122 | have changed. 123 | 124 | 125 | Invoke this method to invalidate the contents of 126 | the ListView and force the ListView to repaint 127 | the contents displayed. 128 | 129 | 130 | 131 | 132 | 133 | 134 | Method 135 | 136 | 1.0.0.0 137 | 138 | 139 | System.Void 140 | 141 | 142 | 143 | To be added. 144 | To be added. 145 | 146 | 147 | 148 | 149 | 150 | Property 151 | 152 | 0.0.0.0 153 | 1.0.0.0 154 | 155 | 156 | System.Int32 157 | 158 | 159 | 160 | Returns the index of the currently selected item. 161 | 162 | To be added. 163 | To be added. 164 | 165 | 166 | 167 | 168 | -------------------------------------------------------------------------------- /docs/Mono.Terminal/MainLoop+Condition.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | mono-curses 6 | 1.0.0.0 7 | 8 | 9 | System.Enum 10 | 11 | 12 | 13 | System.Flags 14 | 15 | 16 | 17 | 18 | Condition on which to wake up from file descriptor activity. These match the Linux/BSD poll definitions. 19 | 20 | To be added. 21 | 22 | 23 | 24 | 25 | 26 | Field 27 | 28 | 1.0.0.0 29 | 30 | 31 | Mono.Terminal.MainLoop+Condition 32 | 33 | 34 | 35 | Error condition on output 36 | 37 | 38 | 39 | 40 | 41 | 42 | Field 43 | 44 | 1.0.0.0 45 | 46 | 47 | Mono.Terminal.MainLoop+Condition 48 | 49 | 50 | 51 | Hang-up on output 52 | 53 | 54 | 55 | 56 | 57 | 58 | Field 59 | 60 | 1.0.0.0 61 | 62 | 63 | Mono.Terminal.MainLoop+Condition 64 | 65 | 66 | 67 | There is data to read 68 | 69 | 70 | 71 | 72 | 73 | 74 | Field 75 | 76 | 1.0.0.0 77 | 78 | 79 | Mono.Terminal.MainLoop+Condition 80 | 81 | 82 | 83 | File descriptor is not open. 84 | 85 | 86 | 87 | 88 | 89 | 90 | Field 91 | 92 | 1.0.0.0 93 | 94 | 95 | Mono.Terminal.MainLoop+Condition 96 | 97 | 98 | 99 | Writing to the specified descriptor will not block 100 | 101 | 102 | 103 | 104 | 105 | 106 | Field 107 | 108 | 1.0.0.0 109 | 110 | 111 | Mono.Terminal.MainLoop+Condition 112 | 113 | 114 | 115 | There is urgent data to read 116 | 117 | 118 | 119 | 120 | 121 | -------------------------------------------------------------------------------- /docs/Mono.Terminal/MainLoop.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | mono-curses 6 | 1.0.0.0 7 | 8 | 9 | System.Object 10 | 11 | 12 | 13 | 14 | Simple main loop implementation that can be used to monitor 15 | file descriptor, run timers and idle handlers. 16 | 17 | 18 | Monitoring of file descriptors is only available on Unix, there 19 | does not seem to be a way of supporting this on Windows. 20 | 21 | 22 | 23 | 24 | 25 | 26 | Constructor 27 | 28 | 1.0.0.0 29 | 30 | 31 | 32 | 33 | Default constructor 34 | 35 | To be added. 36 | 37 | 38 | 39 | 40 | 41 | Constructor 42 | 43 | 1.0.0.0 44 | 45 | 46 | 47 | 48 | 49 | To be added. 50 | To be added. 51 | To be added. 52 | 53 | 54 | 55 | 56 | 57 | Method 58 | 59 | 1.0.0.0 60 | 61 | 62 | System.Func<System.Boolean> 63 | 64 | 65 | 66 | 67 | 68 | To be added. 69 | 70 | Executes the specified @idleHandler on the idle loop. The return value is a token to remove it. 71 | 72 | To be added. 73 | To be added. 74 | 75 | 76 | 77 | 78 | 79 | Method 80 | 81 | 1.0.0.0 82 | 83 | 84 | System.Object 85 | 86 | 87 | 88 | 89 | 90 | 91 | To be added. 92 | To be added. 93 | 94 | Adds a timeout to the mainloop. 95 | 96 | To be added. 97 | 98 | When time time specified passes, the callback will be invoked. 99 | If the callback returns true, the timeout will be reset, repeating 100 | the invocation. If it returns false, the timeout will stop. 101 | 102 | The returned value is a token that can be used to stop the timeout 103 | by calling RemoveTimeout. 104 | 105 | 106 | 107 | 108 | 109 | 110 | Method 111 | 112 | 1.0.0.0 113 | 114 | 115 | System.Object 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | To be added. 124 | To be added. 125 | To be added. 126 | 127 | Watches a file descriptor for activity. 128 | 129 | To be added. 130 | 131 | When the condition is met, the provided callback 132 | is invoked. If the callback returns false, the 133 | watch is automatically removed. 134 | 135 | The return value is a token that represents this watch, you can 136 | use this token to remove the watch by calling RemoveWatch. 137 | 138 | 139 | 140 | 141 | 142 | 143 | Method 144 | 145 | 1.0.0.0 146 | 147 | 148 | System.Boolean 149 | 150 | 151 | 152 | 153 | 154 | To be added. 155 | 156 | Determines whether there are pending events to be processed. 157 | 158 | To be added. 159 | 160 | You can use this method if you want to probe if events are pending. 161 | Typically used if you need to flush the input queue while still 162 | running some of your own code in your main thread. 163 | 164 | 165 | 166 | 167 | 168 | 169 | Method 170 | 171 | System.Void 172 | 173 | 174 | 175 | 176 | 177 | To be added. 178 | 179 | Runs @action on the thread that is processing events 180 | 181 | To be added. 182 | 183 | 184 | 185 | 186 | 187 | Method 188 | 189 | 1.0.0.0 190 | 191 | 192 | System.Void 193 | 194 | 195 | 196 | 197 | 198 | To be added. 199 | 200 | Runs @action on the thread that is processing events 201 | 202 | To be added. 203 | 204 | 205 | 206 | 207 | 208 | Method 209 | 210 | 1.0.0.0 211 | 212 | 213 | System.Void 214 | 215 | 216 | 217 | 218 | Runs one iteration of timers and file watches 219 | 220 | 221 | You use this to process all pending events (timers, idle handlers and file watches). 222 | 223 | You can use it like this: 224 | while (main.EvensPending ()) MainIteration (); 225 | 226 | 227 | 228 | 229 | 230 | 231 | Method 232 | 233 | 1.0.0.0 234 | 235 | 236 | System.Void 237 | 238 | 239 | 240 | 241 | 242 | To be added. 243 | 244 | Removes the specified idleHandler from processing. 245 | 246 | To be added. 247 | 248 | 249 | 250 | 251 | 252 | Method 253 | 254 | 1.0.0.0 255 | 256 | 257 | System.Void 258 | 259 | 260 | 261 | 262 | 263 | To be added. 264 | 265 | Removes a previously scheduled timeout 266 | 267 | 268 | The token parameter is the value returned by AddTimeout. 269 | 270 | 271 | 272 | 273 | 274 | 275 | Method 276 | 277 | 1.0.0.0 278 | 279 | 280 | System.Void 281 | 282 | 283 | 284 | 285 | 286 | To be added. 287 | 288 | Removes an active watch from the mainloop. 289 | 290 | 291 | The token parameter is the value returned from AddWatch 292 | 293 | 294 | 295 | 296 | 297 | 298 | Method 299 | 300 | 1.0.0.0 301 | 302 | 303 | System.Void 304 | 305 | 306 | 307 | 308 | Runs the mainloop. 309 | 310 | To be added. 311 | 312 | 313 | 314 | 315 | 316 | Method 317 | 318 | 1.0.0.0 319 | 320 | 321 | System.Void 322 | 323 | 324 | 325 | 326 | Stops the mainloop. 327 | 328 | To be added. 329 | 330 | 331 | 332 | 333 | 334 | Field 335 | 336 | 1.0.0.0 337 | 338 | 339 | System.Action<System.ConsoleKeyInfo> 340 | 341 | 342 | 343 | This event is raised when a key is pressed when using the Windows driver. 344 | 345 | To be added. 346 | 347 | 348 | 349 | 350 | -------------------------------------------------------------------------------- /docs/Mono.Terminal/MenuBar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | mono-curses 6 | 1.0.0.0 7 | 8 | 9 | Mono.Terminal.Container 10 | 11 | 12 | 13 | To be added. 14 | To be added. 15 | 16 | 17 | 18 | 19 | 20 | Constructor 21 | 22 | 1.0.0.0 23 | 24 | 25 | 26 | 27 | 28 | To be added. 29 | To be added. 30 | To be added. 31 | 32 | 33 | 34 | 35 | 36 | Method 37 | 38 | 1.0.0.0 39 | 40 | 41 | System.Void 42 | 43 | 44 | 45 | 46 | 47 | To be added. 48 | 49 | Activates the menubar 50 | 51 | To be added. 52 | 53 | 54 | 55 | 56 | 57 | Property 58 | 59 | 1.0.0.0 60 | 61 | 62 | Mono.Terminal.MenuBarItem[] 63 | 64 | 65 | To be added. 66 | To be added. 67 | To be added. 68 | 69 | 70 | 71 | 72 | 73 | Method 74 | 75 | 1.0.0.0 76 | 77 | 78 | System.Void 79 | 80 | 81 | 82 | To be added. 83 | To be added. 84 | 85 | 86 | 87 | 88 | 89 | Method 90 | 91 | 1.0.0.0 92 | 93 | 94 | System.Boolean 95 | 96 | 97 | 98 | 99 | 100 | To be added. 101 | To be added. 102 | To be added. 103 | To be added. 104 | 105 | 106 | 107 | 108 | 109 | Method 110 | 111 | 1.0.0.0 112 | 113 | 114 | System.Void 115 | 116 | 117 | 118 | To be added. 119 | To be added. 120 | 121 | 122 | 123 | 124 | -------------------------------------------------------------------------------- /docs/Mono.Terminal/MenuBarItem.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | mono-curses 6 | 1.0.0.0 7 | 8 | 9 | System.Object 10 | 11 | 12 | 13 | To be added. 14 | To be added. 15 | 16 | 17 | 18 | 19 | 20 | Constructor 21 | 22 | 1.0.0.0 23 | 24 | 25 | 26 | 27 | 28 | 29 | To be added. 30 | To be added. 31 | To be added. 32 | To be added. 33 | 34 | 35 | 36 | 37 | 38 | Property 39 | 40 | 1.0.0.0 41 | 42 | 43 | Mono.Terminal.MenuItem[] 44 | 45 | 46 | To be added. 47 | To be added. 48 | To be added. 49 | 50 | 51 | 52 | 53 | 54 | Property 55 | 56 | 1.0.0.0 57 | 58 | 59 | System.Int32 60 | 61 | 62 | To be added. 63 | To be added. 64 | To be added. 65 | 66 | 67 | 68 | 69 | 70 | Property 71 | 72 | 1.0.0.0 73 | 74 | 75 | System.String 76 | 77 | 78 | To be added. 79 | To be added. 80 | To be added. 81 | 82 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /docs/Mono.Terminal/MenuItem.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | mono-curses 6 | 1.0.0.0 7 | 8 | 9 | System.Object 10 | 11 | 12 | 13 | To be added. 14 | To be added. 15 | 16 | 17 | 18 | 19 | 20 | Constructor 21 | 22 | 1.0.0.0 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | To be added. 31 | To be added. 32 | To be added. 33 | To be added. 34 | To be added. 35 | 36 | 37 | 38 | 39 | 40 | Property 41 | 42 | 1.0.0.0 43 | 44 | 45 | System.Action 46 | 47 | 48 | To be added. 49 | To be added. 50 | To be added. 51 | 52 | 53 | 54 | 55 | 56 | Property 57 | 58 | 1.0.0.0 59 | 60 | 61 | System.String 62 | 63 | 64 | To be added. 65 | To be added. 66 | To be added. 67 | 68 | 69 | 70 | 71 | 72 | Property 73 | 74 | 1.0.0.0 75 | 76 | 77 | System.String 78 | 79 | 80 | To be added. 81 | To be added. 82 | To be added. 83 | 84 | 85 | 86 | 87 | 88 | Property 89 | 90 | 1.0.0.0 91 | 92 | 93 | System.Int32 94 | 95 | 96 | To be added. 97 | To be added. 98 | To be added. 99 | 100 | 101 | 102 | 103 | -------------------------------------------------------------------------------- /docs/Mono.Terminal/MessageBox.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | mono-curses 6 | 1.0.0.0 7 | 8 | 9 | System.Object 10 | 11 | 12 | 13 | To be added. 14 | To be added. 15 | 16 | 17 | 18 | 19 | 20 | Constructor 21 | 22 | 1.0.0.0 23 | 24 | 25 | 26 | To be added. 27 | To be added. 28 | 29 | 30 | 31 | 32 | 33 | Method 34 | 35 | 1.0.0.0 36 | 37 | 38 | System.Int32 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | System.ParamArray 49 | 50 | 51 | 52 | 53 | 54 | To be added. 55 | To be added. 56 | To be added. 57 | To be added. 58 | To be added. 59 | To be added. 60 | To be added. 61 | To be added. 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /docs/Mono.Terminal/Screen.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | mono-curses 6 | 0.0.0.0 7 | 8 | 9 | System.Object 10 | 11 | 12 | 13 | To be added. 14 | To be added. 15 | 16 | 17 | 18 | 19 | 20 | Field 21 | 22 | 0.0.0.0 23 | 1.0.0.0 24 | 25 | 26 | System.IntPtr 27 | 28 | 29 | To be added. 30 | To be added. 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /docs/Mono.Terminal/TrimLabel.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | mono-curses 6 | 0.0.0.0 7 | 1.0.0.0 8 | 9 | 10 | Mono.Terminal.Label 11 | 12 | 13 | 14 | 15 | A label that can be trimmed to a given position 16 | 17 | 18 | Just like a label, but it can be trimmed to a given 19 | position if the text being displayed overflows the 20 | specified width. 21 | 22 | 23 | 24 | 25 | 26 | 27 | Constructor 28 | 29 | 0.0.0.0 30 | 1.0.0.0 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | To be added. 40 | To be added. 41 | To be added. 42 | To be added. 43 | 44 | Public constructor. 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | Method 53 | 54 | 1.0.0.0 55 | 56 | 57 | System.Void 58 | 59 | 60 | 61 | To be added. 62 | To be added. 63 | 64 | 65 | 66 | 67 | 68 | Property 69 | 70 | 1.0.0.0 71 | 72 | 73 | System.String 74 | 75 | 76 | 77 | The text displayed by this widget. 78 | 79 | To be added. 80 | To be added. 81 | 82 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /docs/Mono.Terminal/Window.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | mono-curses 6 | 0.0.0.0 7 | 8 | 9 | System.Object 10 | 11 | 12 | 13 | To be added. 14 | To be added. 15 | 16 | 17 | 18 | 19 | 20 | Method 21 | 22 | 0.0.0.0 23 | 1.0.0.0 24 | 25 | 26 | System.Int32 27 | 28 | 29 | 30 | 31 | 32 | To be added. 33 | To be added. 34 | To be added. 35 | To be added. 36 | 37 | 38 | 39 | 40 | 41 | Method 42 | 43 | 0.0.0.0 44 | 1.0.0.0 45 | 46 | 47 | System.Int32 48 | 49 | 50 | 51 | 52 | 53 | To be added. 54 | To be added. 55 | To be added. 56 | To be added. 57 | 58 | 59 | 60 | 61 | 62 | Property 63 | 64 | 0.0.0.0 65 | 1.0.0.0 66 | 67 | 68 | Mono.Terminal.Window 69 | 70 | 71 | To be added. 72 | To be added. 73 | To be added. 74 | 75 | 76 | 77 | 78 | 79 | Field 80 | 81 | 0.0.0.0 82 | 1.0.0.0 83 | 84 | 85 | System.IntPtr 86 | 87 | 88 | To be added. 89 | To be added. 90 | 91 | 92 | 93 | 94 | 95 | Method 96 | 97 | 0.0.0.0 98 | 1.0.0.0 99 | 100 | 101 | System.Void 102 | 103 | 104 | 105 | 106 | 107 | To be added. 108 | To be added. 109 | To be added. 110 | 111 | 112 | 113 | 114 | 115 | Method 116 | 117 | 0.0.0.0 118 | 1.0.0.0 119 | 120 | 121 | System.Int32 122 | 123 | 124 | 125 | 126 | 127 | To be added. 128 | To be added. 129 | To be added. 130 | To be added. 131 | 132 | 133 | 134 | 135 | 136 | Method 137 | 138 | 0.0.0.0 139 | 1.0.0.0 140 | 141 | 142 | System.Void 143 | 144 | 145 | 146 | 147 | 148 | To be added. 149 | To be added. 150 | To be added. 151 | 152 | 153 | 154 | 155 | 156 | Method 157 | 158 | 0.0.0.0 159 | 1.0.0.0 160 | 161 | 162 | System.Int32 163 | 164 | 165 | 166 | 167 | 168 | To be added. 169 | To be added. 170 | To be added. 171 | To be added. 172 | 173 | 174 | 175 | 176 | 177 | Method 178 | 179 | 0.0.0.0 180 | 1.0.0.0 181 | 182 | 183 | System.Int32 184 | 185 | 186 | 187 | 188 | 189 | To be added. 190 | To be added. 191 | To be added. 192 | To be added. 193 | 194 | 195 | 196 | 197 | 198 | Method 199 | 200 | 0.0.0.0 201 | 1.0.0.0 202 | 203 | 204 | System.Int32 205 | 206 | 207 | 208 | 209 | 210 | To be added. 211 | To be added. 212 | To be added. 213 | To be added. 214 | 215 | 216 | 217 | 218 | 219 | Method 220 | 221 | 0.0.0.0 222 | 1.0.0.0 223 | 224 | 225 | System.Int32 226 | 227 | 228 | 229 | 230 | 231 | To be added. 232 | To be added. 233 | To be added. 234 | To be added. 235 | 236 | 237 | 238 | 239 | 240 | Method 241 | 242 | 0.0.0.0 243 | 1.0.0.0 244 | 245 | 246 | System.Int32 247 | 248 | 249 | 250 | 251 | 252 | 253 | To be added. 254 | To be added. 255 | To be added. 256 | To be added. 257 | To be added. 258 | 259 | 260 | 261 | 262 | 263 | Method 264 | 265 | 0.0.0.0 266 | 1.0.0.0 267 | 268 | 269 | System.Int32 270 | 271 | 272 | 273 | 274 | 275 | To be added. 276 | To be added. 277 | To be added. 278 | To be added. 279 | 280 | 281 | 282 | 283 | 284 | Method 285 | 286 | 0.0.0.0 287 | 1.0.0.0 288 | 289 | 290 | System.Int32 291 | 292 | 293 | 294 | To be added. 295 | To be added. 296 | To be added. 297 | 298 | 299 | 300 | 301 | 302 | Method 303 | 304 | 0.0.0.0 305 | 1.0.0.0 306 | 307 | 308 | System.Int32 309 | 310 | 311 | 312 | To be added. 313 | To be added. 314 | To be added. 315 | 316 | 317 | 318 | 319 | 320 | Method 321 | 322 | 0.0.0.0 323 | 1.0.0.0 324 | 325 | 326 | System.Int32 327 | 328 | 329 | 330 | 331 | 332 | To be added. 333 | To be added. 334 | To be added. 335 | To be added. 336 | 337 | 338 | 339 | 340 | 341 | Method 342 | 343 | 0.0.0.0 344 | 1.0.0.0 345 | 346 | 347 | System.Int32 348 | 349 | 350 | 351 | 352 | 353 | 354 | To be added. 355 | To be added. 356 | To be added. 357 | To be added. 358 | To be added. 359 | 360 | 361 | 362 | 363 | 364 | Property 365 | 366 | 0.0.0.0 367 | 1.0.0.0 368 | 369 | 370 | Mono.Terminal.Window 371 | 372 | 373 | To be added. 374 | To be added. 375 | To be added. 376 | 377 | 378 | 379 | 380 | 381 | Method 382 | 383 | 0.0.0.0 384 | 1.0.0.0 385 | 386 | 387 | System.Int32 388 | 389 | 390 | 391 | To be added. 392 | To be added. 393 | To be added. 394 | 395 | 396 | 397 | 398 | 399 | Method 400 | 401 | 0.0.0.0 402 | 1.0.0.0 403 | 404 | 405 | System.Int32 406 | 407 | 408 | 409 | 410 | 411 | 412 | To be added. 413 | To be added. 414 | To be added. 415 | To be added. 416 | To be added. 417 | 418 | 419 | 420 | 421 | 422 | Method 423 | 424 | 0.0.0.0 425 | 1.0.0.0 426 | 427 | 428 | System.Int32 429 | 430 | 431 | 432 | To be added. 433 | To be added. 434 | To be added. 435 | 436 | 437 | 438 | 439 | 440 | Method 441 | 442 | 0.0.0.0 443 | 1.0.0.0 444 | 445 | 446 | System.Int32 447 | 448 | 449 | 450 | 451 | 452 | To be added. 453 | To be added. 454 | To be added. 455 | To be added. 456 | 457 | 458 | 459 | 460 | -------------------------------------------------------------------------------- /docs/index.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | [00 24 00 00 04 80 00 00 94 00 00 00 06 02 00 00 00 24 00 00 52 53 41 31 00 04 00 00 11 00 00 00 95 c1 72 1e 2f a8 72 7e f4 03 4d 8a 92 9f ed f2 b2 b1 58 4e 79 f2 b6 45 7a 77 00 e5 e6 bc 35 eb 79 ab 54 ab ec 06 b4 21 dd 87 0e 57 ef ca c9 d5 42 dc f9 43 93 d2 dc 3a b6 90 50 65 99 c6 c8 25 75 f0 e9 3d 31 08 fe df 98 c6 68 03 c1 ee f8 e4 d2 17 99 26 ff 77 8b 50 96 9d 4d 3b 0c 42 c5 72 29 c1 e8 58 19 f3 db e4 6c be 4e 8a 8f 5f a9 cf 40 97 c6 bc 21 fb 69 2d 18 65 70 52 33 2b bc 85 ] 5 | 6 | 7 | System.Diagnostics.Debuggable(System.Diagnostics.DebuggableAttribute+DebuggingModes.DisableOptimizations | System.Diagnostics.DebuggableAttribute+DebuggingModes.IgnoreSymbolStoreSequencePoints) 8 | 9 | 10 | System.Reflection.AssemblyCompany("Novell, Inc.") 11 | 12 | 13 | System.Reflection.AssemblyConfiguration("") 14 | 15 | 16 | System.Reflection.AssemblyCopyright("2007-2008 Novell, Inc.") 17 | 18 | 19 | System.Reflection.AssemblyProduct("Mono") 20 | 21 | 22 | System.Reflection.AssemblyTitle("Curses Binding for Mono/.NET") 23 | 24 | 25 | System.Runtime.CompilerServices.RuntimeCompatibility(WrapNonExceptionThrows=true) 26 | 27 | 28 | 29 | 30 | To be added. 31 | To be added. 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | mono-curses 69 | 70 | -------------------------------------------------------------------------------- /docs/ns-Mono.Terminal.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | A toolkit for building terminal applications with curses. 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /gtest.cs: -------------------------------------------------------------------------------- 1 | using Mono.Terminal; 2 | 3 | class Test { 4 | static void Main () 5 | { 6 | Application.Init (false); 7 | var d = new Container (0, 0, Application.Cols, Application.Lines); 8 | 9 | d.Add (new Label (10, 10, "Text")); 10 | d.Add (new Entry (16, 10, 20, "Edit me")); 11 | Application.Run (d); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /gtestshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mono/mono-curses/eec5a9c9521b955626f6ed63c35fb11dae31f2a1/gtestshot.png -------------------------------------------------------------------------------- /guitest.cs: -------------------------------------------------------------------------------- 1 | using Unix.Terminal; 2 | using Mono.Terminal; 3 | using System; 4 | using System.IO; 5 | 6 | class GuiTest { 7 | 8 | static void OptionsDialog () 9 | { 10 | Dialog d = new Dialog (62, 15, "Options"); 11 | 12 | d.Add (new Label (1, 1, " Download Directory:")); 13 | d.Add (new Label (1, 3, " Listen Port:")); 14 | d.Add (new Label (1, 5, " Upload Speed Limit:")); 15 | d.Add (new Label (35,5, "kB/s")); 16 | d.Add (new Label (1, 7, "Download Speed Limit:")); 17 | d.Add (new Label (35,7, "kB/s")); 18 | 19 | Entry download_dir = new Entry (24, 1, 30, "~/Download"); 20 | d.Add (download_dir); 21 | 22 | Entry listen_port = new Entry (24, 3, 6, "34"); 23 | d.Add (listen_port); 24 | 25 | Entry upload_limit = new Entry (24, 5, 10, "1024"); 26 | d.Add (upload_limit); 27 | 28 | Entry download_limit = new Entry (24, 7, 10, "1024"); 29 | d.Add (download_limit); 30 | 31 | bool ok = false; 32 | 33 | Button b = new Button ("Ok", true); 34 | b.Clicked += delegate { ok = true; b.Container.Running = false; }; 35 | d.AddButton (b); 36 | 37 | b = new Button ("Cancel"); 38 | b.Clicked += delegate { b.Container.Running = false; }; 39 | d.AddButton (b); 40 | 41 | Application.Run (d); 42 | 43 | if (ok){ 44 | int v; 45 | 46 | if (!Int32.TryParse (listen_port.Text, out v)){ 47 | Application.Error ("Error", "The value `{0}' is not a valid port number", listen_port.Text); 48 | return; 49 | } 50 | 51 | if (!Directory.Exists (download_dir.Text)){ 52 | Application.Error ("Error", "The directory\n{0}\ndoes not exist", download_dir.Text); 53 | return; 54 | } 55 | } 56 | } 57 | 58 | static void AddDialog () 59 | { 60 | int cols = (int) (Application.Cols * 0.7); 61 | Dialog d = new Dialog (cols, 8, "Add"); 62 | Entry e; 63 | string name = null; 64 | 65 | 66 | d.Add (new Label (1, 0, "Torrent file:")); 67 | e = new Entry (1, 1, cols - 6, Environment.CurrentDirectory); 68 | d.Add (e); 69 | 70 | // buttons 71 | Button b = new Button ("Ok", true); 72 | b.Clicked += delegate { 73 | b.Container.Running = false; 74 | name = e.Text; 75 | }; 76 | d.AddButton (b); 77 | b = new Button ("Cancel"); 78 | b.Clicked += delegate { 79 | b.Container.Running = false; 80 | }; 81 | d.AddButton (b); 82 | 83 | Application.Run (d); 84 | 85 | if (name != null){ 86 | if (!File.Exists (name)){ 87 | Application.Error ("Missing File", "Torrent file:\n" + name + "\ndoes not exist"); 88 | return; 89 | } 90 | } 91 | } 92 | 93 | public class TorrentDetailsList : IListProvider { 94 | public ListView view; 95 | 96 | void IListProvider.SetListView (ListView v) 97 | { 98 | view = v; 99 | } 100 | 101 | int IListProvider.Items => 5; 102 | bool IListProvider.AllowMark => false; 103 | 104 | bool IListProvider.IsMarked (int n) 105 | { 106 | return false; 107 | } 108 | 109 | void IListProvider.Render (int line, int col, int width, int item) 110 | { 111 | string s = $"{item} This is item {item}"; 112 | if (s.Length > width){ 113 | s = s.Substring (0, width); 114 | Curses.addstr (s); 115 | } else { 116 | Curses.addstr (s); 117 | for (int i = s.Length; i < width; i++) 118 | Curses.addch (' '); 119 | } 120 | } 121 | 122 | bool IListProvider.ProcessKey (int ch) 123 | { 124 | return false; 125 | } 126 | 127 | void IListProvider.SelectedChanged () 128 | { 129 | } 130 | } 131 | 132 | public class LogWidget : Widget { 133 | string [] messages = new string [80]; 134 | int head, tail; 135 | int count; 136 | 137 | public LogWidget (int x, int y) : base (x, y, 0, 0) 138 | { 139 | Fill = Fill.Horizontal | Fill.Vertical; 140 | AddText ("Started"); 141 | } 142 | 143 | public void AddText (string s) 144 | { 145 | messages [head] = s; 146 | head++; 147 | if (head == messages.Length) 148 | head = 0; 149 | if (head == tail) 150 | tail = (tail+1) % messages.Length; 151 | } 152 | 153 | public override void Redraw () 154 | { 155 | Curses.attrset (ColorNormal); 156 | 157 | int i = 0; 158 | int l; 159 | int n = head > tail ? head-tail : (head + messages.Length) - tail; 160 | for (l = h-1; l >= 0 && n-- > 0; l--){ 161 | int item = head-1-i; 162 | if (item < 0) 163 | item = messages.Length+item; 164 | 165 | Move (y+l, x); 166 | 167 | int sl = messages [item].Length; 168 | if (sl < w){ 169 | Curses.addstr (messages [item]); 170 | for (int fi = 0; fi < w-sl; fi++) 171 | Curses.addch (' '); 172 | } else { 173 | Curses.addstr (messages [item].Substring (0, sl)); 174 | } 175 | i++; 176 | } 177 | 178 | for (; l >= 0; l--){ 179 | Move (y+l, x); 180 | for (i = 0; i < w; i++) 181 | Curses.addch (' '); 182 | } 183 | } 184 | } 185 | 186 | static Label status_progress, status_state, status_peers, status_tracker, status_up, status_up_speed; 187 | static Label status_down, status_down_speed, status_warnings, status_failures, iteration; 188 | static Frame SetupStatus () 189 | { 190 | Frame fstatus = new Frame ("Status"); 191 | int y = 0; 192 | int x = 13; 193 | string init = ""; 194 | 195 | fstatus.Add (status_progress = new Label (x, y, "0%")); 196 | status_progress.Color = status_progress.ColorHotNormal; 197 | fstatus.Add (new Label (1, y++, "Progress:")); 198 | 199 | fstatus.Add (status_state = new Label (x, y, init)); 200 | fstatus.Add (new Label (1, y++, "State:")); 201 | 202 | fstatus.Add (status_peers = new Label (x, y, init)); 203 | fstatus.Add (new Label (1, y++, "Peers:")); 204 | 205 | fstatus.Add (status_tracker = new Label (x, y, init)); 206 | fstatus.Add (new Label (1, y++, "Tracker: ")); 207 | y++; 208 | 209 | fstatus.Add (new Label (1, y++, "Upload:")); 210 | fstatus.Add (new Label (16, y, "KB Speed: ")); 211 | fstatus.Add (status_up = new Label (1, y, init)); 212 | fstatus.Add (status_up_speed = new Label (28, y, init)); 213 | y++; 214 | fstatus.Add (new Label (1, y++, "Download:")); 215 | fstatus.Add (new Label (16, y, "KB Speed: ")); 216 | fstatus.Add (status_down = new Label (1, y, init)); 217 | fstatus.Add (status_down_speed = new Label (28, y, init)); 218 | y += 2; 219 | fstatus.Add (status_warnings = new Label (11, y, init)); 220 | fstatus.Add (new Label (1, y++, "Warnings: ")); 221 | fstatus.Add (status_failures = new Label (11, y, init)); 222 | fstatus.Add (new Label (1, y++, "Failures: ")); 223 | y += 2; 224 | 225 | return fstatus; 226 | } 227 | 228 | // 229 | // We split this, so if the terminal resizes, we resize accordingly 230 | // 231 | static void LayoutDialogs (Frame ftorrents, Frame fstatus, Frame fdetails, Frame fprogress) 232 | { 233 | int cols = Application.Cols; 234 | int lines = Application.Lines; 235 | 236 | int midx = Application.Cols/2; 237 | int midy = Application.Lines/2; 238 | 239 | // Torrents 240 | ftorrents.x = 0; 241 | ftorrents.y = 0; 242 | ftorrents.w = cols - 40; 243 | ftorrents.h = midy; 244 | 245 | // Status: Always 40x12 246 | fstatus.x = cols - 40; 247 | fstatus.y = 0; 248 | fstatus.w = 40; 249 | fstatus.h = midy; 250 | 251 | // Details 252 | fdetails.x = 0; 253 | fdetails.y = midy; 254 | fdetails.w = midx; 255 | fdetails.h = midy; 256 | 257 | // fprogress 258 | fprogress.x = midx; 259 | fprogress.y = midy; 260 | fprogress.w = midx + Application.Cols % 2; 261 | fprogress.h = midy; 262 | } 263 | 264 | static void UpdateStatus () 265 | { 266 | status_progress.Text = $"{DateTime.Now}"; 267 | status_state.Text = $"{DateTime.Now}"; 268 | status_peers.Text = $"{DateTime.Now}"; 269 | status_up.Text = "1000"; 270 | status_up_speed.Text = "Lots"; 271 | } 272 | 273 | static void Main () 274 | { 275 | Application.Init (false); 276 | 277 | var frame = new Frame (0, 0, Application.Cols, Application.Lines, "List"); 278 | var top = new Container (0, 0, Application.Cols, Application.Lines) { 279 | frame 280 | }; 281 | // Add 282 | Button badd = new Button (1, 1, "Add"); 283 | badd.Clicked += delegate { AddDialog (); }; 284 | frame.Add (badd); 285 | 286 | // Options 287 | Button boptions = new Button (9, 1, "Options"); 288 | boptions.Clicked += delegate { OptionsDialog (); }; 289 | frame.Add (boptions); 290 | 291 | // Quit 292 | Button bquit = new Button (21, 1, "Quit"); 293 | bquit.Clicked += delegate { 294 | // FIXME: shut down torrent here 295 | top.Running = false; 296 | }; 297 | frame.Add (bquit); 298 | 299 | ListView list = new ListView (1, 5, 0, 0, new TorrentDetailsList ()); 300 | list.Fill = Fill.Horizontal | Fill.Vertical; 301 | frame.Add (list); 302 | 303 | Frame fprogress = new Frame ("Messages"); 304 | LogWidget log_widget = new LogWidget (0, 0); 305 | fprogress.Add (log_widget); 306 | top.Add (fprogress); 307 | 308 | // For testing focus, not ready 309 | //f.Add (new Label (0, 0, "->0<-")); 310 | //f.Add (new Entry (7, 0, 20, "Another")); 311 | 312 | 313 | // Details 314 | Frame fdetails = new Frame ("Details"); 315 | fdetails.Add (new Label (1, 1, "Files for: ")); 316 | var torrent_name = new TrimLabel (12, 1, 10, ""); 317 | torrent_name.Fill = Fill.Horizontal; 318 | fdetails.Add (torrent_name); 319 | 320 | var details_list = new TorrentDetailsList (); 321 | var list_details = new ListView (1, 3, 0, 0, details_list); 322 | list_details.Fill = Fill.Horizontal | Fill.Vertical; 323 | fdetails.Add (list_details); 324 | 325 | top.Add (fdetails); 326 | 327 | // Status 328 | Frame fstatus = SetupStatus (); 329 | top.Add (fstatus); 330 | 331 | iteration = new Label (35, 0, "0"); 332 | fstatus.Add (iteration); 333 | 334 | int it = 0; 335 | Application.MainLoop.AddTimeout (TimeSpan.FromSeconds (1), (mainloop) => { 336 | iteration.Text = (it++).ToString (); 337 | UpdateStatus (); 338 | log_widget.AddText ("Iteration " + it); 339 | Application.Refresh (); 340 | return true; 341 | }); 342 | 343 | LayoutDialogs (frame, fstatus, fdetails, fprogress); 344 | top.SizeChangedEvent += delegate { 345 | LayoutDialogs (frame, fstatus, fdetails, fprogress); 346 | }; 347 | 348 | UpdateStatus (); 349 | 350 | Application.Run (top); 351 | } 352 | } -------------------------------------------------------------------------------- /handles.cs: -------------------------------------------------------------------------------- 1 | // 2 | // handles.cs: OO wrappers for some curses objects 3 | // 4 | // Authors: 5 | // Miguel de Icaza (miguel.de.icaza@gmail.com) 6 | // 7 | // Copyright (C) 2007 Novell (http://www.novell.com) 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | using System; 29 | using System.Runtime.InteropServices; 30 | 31 | namespace Unix.Terminal { 32 | 33 | public partial class Curses { 34 | public class Window { 35 | public readonly IntPtr Handle; 36 | static Window curscr; 37 | static Window stdscr; 38 | 39 | static Window () 40 | { 41 | Curses.initscr (); 42 | stdscr = new Window (Curses.console_sharp_get_stdscr ()); 43 | curscr = new Window (Curses.console_sharp_get_curscr ()); 44 | } 45 | 46 | internal Window (IntPtr handle) 47 | { 48 | Handle = handle; 49 | } 50 | 51 | static public Window Standard { 52 | get { 53 | return stdscr; 54 | } 55 | } 56 | 57 | static public Window Current { 58 | get { 59 | return curscr; 60 | } 61 | } 62 | 63 | 64 | public int wtimeout (int delay) 65 | { 66 | return Curses.wtimeout (Handle, delay); 67 | } 68 | 69 | public int notimeout (bool bf) 70 | { 71 | return Curses.notimeout (Handle, bf); 72 | } 73 | 74 | public int keypad (bool bf) 75 | { 76 | return Curses.keypad (Handle, bf); 77 | } 78 | 79 | public int meta (bool bf) 80 | { 81 | return Curses.meta (Handle, bf); 82 | } 83 | 84 | public int intrflush (bool bf) 85 | { 86 | return Curses.intrflush (Handle, bf); 87 | } 88 | 89 | public int clearok (bool bf) 90 | { 91 | return Curses.clearok (Handle, bf); 92 | } 93 | 94 | public int idlok (bool bf) 95 | { 96 | return Curses.idlok (Handle, bf); 97 | } 98 | 99 | public void idcok (bool bf) 100 | { 101 | Curses.idcok (Handle, bf); 102 | } 103 | 104 | public void immedok (bool bf) 105 | { 106 | Curses.immedok (Handle, bf); 107 | } 108 | 109 | public int leaveok (bool bf) 110 | { 111 | return Curses.leaveok (Handle, bf); 112 | } 113 | 114 | public int setscrreg (int top, int bot) 115 | { 116 | return Curses.wsetscrreg (Handle, top, bot); 117 | } 118 | 119 | public int scrollok (bool bf) 120 | { 121 | return Curses.scrollok (Handle, bf); 122 | } 123 | 124 | public int wrefresh () 125 | { 126 | return Curses.wrefresh (Handle); 127 | } 128 | 129 | public int redrawwin () 130 | { 131 | return Curses.redrawwin (Handle); 132 | } 133 | 134 | public int wredrawwin (int beg_line, int num_lines) 135 | { 136 | return Curses.wredrawwin (Handle, beg_line, num_lines); 137 | } 138 | 139 | public int wnoutrefresh () 140 | { 141 | return Curses.wnoutrefresh (Handle); 142 | } 143 | 144 | public int move (int line, int col) 145 | { 146 | return Curses.wmove (Handle, line, col); 147 | } 148 | 149 | public int addch (char ch) 150 | { 151 | return Curses.waddch (Handle, ch); 152 | } 153 | 154 | public int refresh () 155 | { 156 | return Curses.wrefresh (Handle); 157 | } 158 | } 159 | 160 | // Currently unused, to do later 161 | public class Screen { 162 | public readonly IntPtr Handle; 163 | 164 | internal Screen (IntPtr handle) 165 | { 166 | Handle = handle; 167 | } 168 | } 169 | 170 | } 171 | 172 | } 173 | -------------------------------------------------------------------------------- /mainloop.cs: -------------------------------------------------------------------------------- 1 | // 2 | // mainloop.cs: Simple managed mainloop implementation. 3 | // 4 | // Authors: 5 | // Miguel de Icaza (miguel.de.icaza@gmail.com) 6 | // 7 | // Copyright (C) 2011 Novell (http://www.novell.com) 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining 10 | // a copy of this software and associated documentation files (the 11 | // "Software"), to deal in the Software without restriction, including 12 | // without limitation the rights to use, copy, modify, merge, publish, 13 | // distribute, sublicense, and/or sell copies of the Software, and to 14 | // permit persons to whom the Software is furnished to do so, subject to 15 | // the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 | // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 | // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | // 28 | using System.Collections.Generic; 29 | using System; 30 | using System.Runtime.InteropServices; 31 | using System.Threading; 32 | 33 | namespace Mono.Terminal { 34 | 35 | /// 36 | /// Simple main loop implementation that can be used to monitor 37 | /// file descriptor, run timers and idle handlers. 38 | /// 39 | /// 40 | /// Monitoring of file descriptors is only available on Unix, there 41 | /// does not seem to be a way of supporting this on Windows. 42 | /// 43 | public class MainLoop { 44 | bool useUnix = true; 45 | 46 | /// 47 | /// Condition on which to wake up from file descriptor activity. These match the Linux/BSD poll definitions. 48 | /// 49 | [Flags] 50 | public enum Condition : short { 51 | /// 52 | /// There is data to read 53 | /// 54 | PollIn = 1, 55 | /// 56 | /// Writing to the specified descriptor will not block 57 | /// 58 | PollOut = 4, 59 | /// 60 | /// There is urgent data to read 61 | /// 62 | PollPri = 2, 63 | /// 64 | /// Error condition on output 65 | /// 66 | PollErr = 8, 67 | /// 68 | /// Hang-up on output 69 | /// 70 | PollHup = 16, 71 | /// 72 | /// File descriptor is not open. 73 | /// 74 | PollNval = 32 75 | } 76 | 77 | class Watch { 78 | public int File; 79 | public Condition Condition; 80 | public Func Callback; 81 | } 82 | 83 | class Timeout { 84 | public TimeSpan Span; 85 | public Func Callback; 86 | } 87 | 88 | Dictionary descriptorWatchers = new Dictionary(); 89 | SortedList timeouts = new SortedList (); 90 | List> idleHandlers = new List> (); 91 | 92 | [StructLayout(LayoutKind.Sequential)] 93 | struct Pollfd { 94 | public int fd; 95 | public short events, revents; 96 | } 97 | 98 | [DllImport ("libc")] 99 | extern static int poll ([In,Out]Pollfd[] ufds, uint nfds, int timeout); 100 | 101 | [DllImport ("libc")] 102 | extern static int pipe ([In,Out]int [] pipes); 103 | 104 | [DllImport ("libc")] 105 | extern static int read (int fd, IntPtr buf, IntPtr n); 106 | 107 | [DllImport ("libc")] 108 | extern static int write (int fd, IntPtr buf, IntPtr n); 109 | 110 | Pollfd [] pollmap; 111 | bool poll_dirty = true; 112 | int [] wakeupPipes = new int [2]; 113 | static IntPtr ignore = Marshal.AllocHGlobal (1); 114 | 115 | /// 116 | /// Default constructor 117 | /// 118 | public MainLoop () : this (useUnix: true) 119 | { 120 | } 121 | 122 | public MainLoop (bool useUnix) 123 | { 124 | this.useUnix = useUnix; 125 | if (useUnix) { 126 | pipe (wakeupPipes); 127 | AddWatch (wakeupPipes [0], Condition.PollIn, ml => { 128 | read (wakeupPipes [0], ignore, (IntPtr)1); 129 | return true; 130 | }); 131 | } else { 132 | Thread readThread = new Thread (WindowsKeyReader); 133 | readThread.Start (); 134 | } 135 | } 136 | 137 | void Wakeup () 138 | { 139 | write (wakeupPipes [1], ignore, (IntPtr) 1); 140 | } 141 | 142 | /// 143 | /// Runs @action on the thread that is processing events 144 | /// 145 | public void Invoke (Action action) 146 | { 147 | AddIdle (()=> { 148 | action (); 149 | return false; 150 | }); 151 | Wakeup (); 152 | } 153 | 154 | /// 155 | /// Executes the specified @idleHandler on the idle loop. The return value is a token to remove it. 156 | /// 157 | public Func AddIdle (Func idleHandler) 158 | { 159 | lock (idleHandlers) 160 | idleHandlers.Add (idleHandler); 161 | return idleHandler; 162 | } 163 | 164 | /// 165 | /// Removes the specified idleHandler from processing. 166 | /// 167 | public void RemoveIdle (Func idleHandler) 168 | { 169 | lock (idleHandler) 170 | idleHandlers.Remove (idleHandler); 171 | } 172 | 173 | /// 174 | /// Watches a file descriptor for activity. 175 | /// 176 | /// 177 | /// When the condition is met, the provided callback 178 | /// is invoked. If the callback returns false, the 179 | /// watch is automatically removed. 180 | /// 181 | /// The return value is a token that represents this watch, you can 182 | /// use this token to remove the watch by calling RemoveWatch. 183 | /// 184 | public object AddWatch (int fileDescriptor, Condition condition, Func callback) 185 | { 186 | if (callback == null) 187 | throw new ArgumentNullException ("callback"); 188 | if (!useUnix) 189 | throw new Exception ("AddWatch is only supported for Unix"); 190 | 191 | var watch = new Watch () { Condition = condition, Callback = callback, File = fileDescriptor }; 192 | descriptorWatchers [fileDescriptor] = watch; 193 | poll_dirty = true; 194 | return watch; 195 | } 196 | 197 | /// 198 | /// This event is raised when a key is pressed when using the Windows driver. 199 | /// 200 | public Action WindowsKeyPressed; 201 | 202 | /// 203 | /// Removes an active watch from the mainloop. 204 | /// 205 | /// 206 | /// The token parameter is the value returned from AddWatch 207 | /// 208 | public void RemoveWatch (object token) 209 | { 210 | var watch = token as Watch; 211 | if (watch == null) 212 | return; 213 | descriptorWatchers.Remove (watch.File); 214 | } 215 | 216 | void AddTimeout (TimeSpan time, Timeout timeout) 217 | { 218 | timeouts.Add ((DateTime.UtcNow + time).Ticks, timeout); 219 | } 220 | 221 | /// 222 | /// Adds a timeout to the mainloop. 223 | /// 224 | /// 225 | /// When time time specified passes, the callback will be invoked. 226 | /// If the callback returns true, the timeout will be reset, repeating 227 | /// the invocation. If it returns false, the timeout will stop. 228 | /// 229 | /// The returned value is a token that can be used to stop the timeout 230 | /// by calling RemoveTimeout. 231 | /// 232 | public object AddTimeout (TimeSpan time, Func callback) 233 | { 234 | if (callback == null) 235 | throw new ArgumentNullException ("callback"); 236 | var timeout = new Timeout () { 237 | Span = time, 238 | Callback = callback 239 | }; 240 | AddTimeout (time, timeout); 241 | return timeout; 242 | } 243 | 244 | /// 245 | /// Removes a previously scheduled timeout 246 | /// 247 | /// 248 | /// The token parameter is the value returned by AddTimeout. 249 | /// 250 | public void RemoveTimeout (object token) 251 | { 252 | var idx = timeouts.IndexOfValue (token as Timeout); 253 | if (idx == -1) 254 | return; 255 | timeouts.RemoveAt (idx); 256 | } 257 | 258 | void UpdatePollMap () 259 | { 260 | if (!poll_dirty) 261 | return; 262 | poll_dirty = false; 263 | 264 | pollmap = new Pollfd [descriptorWatchers.Count]; 265 | int i = 0; 266 | foreach (var fd in descriptorWatchers.Keys){ 267 | pollmap [i].fd = fd; 268 | pollmap [i].events = (short) descriptorWatchers [fd].Condition; 269 | i++; 270 | } 271 | } 272 | 273 | void RunTimers () 274 | { 275 | long now = DateTime.UtcNow.Ticks; 276 | var copy = timeouts; 277 | timeouts = new SortedList (); 278 | foreach (var k in copy.Keys){ 279 | var timeout = copy [k]; 280 | if (k < now) { 281 | if (timeout.Callback (this)) 282 | AddTimeout (timeout.Span, timeout); 283 | } else 284 | timeouts.Add (k, timeout); 285 | } 286 | } 287 | 288 | void RunIdle () 289 | { 290 | List> iterate; 291 | lock (idleHandlers){ 292 | iterate = idleHandlers; 293 | idleHandlers = new List> (); 294 | } 295 | 296 | foreach (var idle in iterate){ 297 | if (idle ()) 298 | lock (idleHandlers) 299 | idleHandlers.Add (idle); 300 | } 301 | } 302 | 303 | bool running; 304 | 305 | /// 306 | /// Stops the mainloop. 307 | /// 308 | public void Stop () 309 | { 310 | running = false; 311 | Wakeup (); 312 | } 313 | 314 | AutoResetEvent keyReady = new AutoResetEvent (false); 315 | AutoResetEvent waitForProbe = new AutoResetEvent (false); 316 | ConsoleKeyInfo? windowsKeyResult = null; 317 | void WindowsKeyReader () 318 | { 319 | while (true) { 320 | waitForProbe.WaitOne (); 321 | windowsKeyResult = Console.ReadKey (true); 322 | keyReady.Set (); 323 | } 324 | } 325 | 326 | /// 327 | /// Determines whether there are pending events to be processed. 328 | /// 329 | /// 330 | /// You can use this method if you want to probe if events are pending. 331 | /// Typically used if you need to flush the input queue while still 332 | /// running some of your own code in your main thread. 333 | /// 334 | public bool EventsPending (bool wait = false) 335 | { 336 | long now = DateTime.UtcNow.Ticks; 337 | if (useUnix) { 338 | int pollTimeout, n; 339 | if (timeouts.Count > 0){ 340 | pollTimeout = (int)((timeouts.Keys [0] - now) / TimeSpan.TicksPerMillisecond); 341 | if (pollTimeout < 0) 342 | return true; 343 | 344 | } else 345 | pollTimeout = -1; 346 | 347 | if (!wait) 348 | pollTimeout = 0; 349 | 350 | UpdatePollMap (); 351 | 352 | n = poll (pollmap, (uint)pollmap.Length, pollTimeout); 353 | int ic; 354 | lock (idleHandlers) 355 | ic = idleHandlers.Count; 356 | return n > 0 || timeouts.Count > 0 && ((timeouts.Keys [0] - DateTime.UtcNow.Ticks) < 0) || ic > 0; 357 | } else { 358 | int waitTimeout; 359 | if (timeouts.Count > 0){ 360 | waitTimeout = (int)((timeouts.Keys [0] - now) / TimeSpan.TicksPerMillisecond); 361 | if (waitTimeout < 0) 362 | return true; 363 | } else 364 | waitTimeout = -1; 365 | 366 | if (!wait) 367 | waitTimeout = 0; 368 | 369 | windowsKeyResult = null; 370 | waitForProbe.Set (); 371 | keyReady.WaitOne (waitTimeout); 372 | return windowsKeyResult.HasValue; 373 | } 374 | } 375 | 376 | /// 377 | /// Runs one iteration of timers and file watches 378 | /// 379 | /// 380 | /// You use this to process all pending events (timers, idle handlers and file watches). 381 | /// 382 | /// You can use it like this: 383 | /// while (main.EvensPending ()) MainIteration (); 384 | /// 385 | public void MainIteration () 386 | { 387 | if (timeouts.Count > 0) 388 | RunTimers (); 389 | 390 | if (useUnix) { 391 | foreach (var p in pollmap) { 392 | Watch watch; 393 | 394 | if (p.revents == 0) 395 | continue; 396 | 397 | if (!descriptorWatchers.TryGetValue (p.fd, out watch)) 398 | continue; 399 | if (!watch.Callback (this)) 400 | descriptorWatchers.Remove (p.fd); 401 | } 402 | } else { 403 | if (windowsKeyResult.HasValue) { 404 | if (WindowsKeyPressed != null) 405 | WindowsKeyPressed (windowsKeyResult.Value); 406 | windowsKeyResult = null; 407 | } 408 | } 409 | 410 | if (idleHandlers.Count > 0) 411 | RunIdle (); 412 | } 413 | 414 | /// 415 | /// Runs the mainloop. 416 | /// 417 | public void Run () 418 | { 419 | bool prev = running; 420 | running = true; 421 | while (running){ 422 | EventsPending (true); 423 | MainIteration (); 424 | } 425 | running = prev; 426 | } 427 | } 428 | } 429 | -------------------------------------------------------------------------------- /mltest.cs: -------------------------------------------------------------------------------- 1 | using Mono.Terminal; 2 | using System; 3 | 4 | class X { 5 | static void Main () 6 | { 7 | MainLoop ml = new MainLoop (); 8 | Stamp ("Start"); 9 | ml.AddTimeout (TimeSpan.FromSeconds (1), x => { 10 | Stamp ("second"); 11 | return true; 12 | }); 13 | 14 | int i = 0; 15 | ml.AddTimeout (TimeSpan.FromSeconds (3), x => { 16 | Stamp ("three"); 17 | if (++i >= 3) 18 | return false; 19 | return true; 20 | }); 21 | 22 | ml.Run (); 23 | } 24 | 25 | static void Stamp (string txt) 26 | { 27 | Console.WriteLine ("{0} At {1}", txt, DateTime.Now); 28 | } 29 | } -------------------------------------------------------------------------------- /mono-curses.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | AnyCPU 6 | 8.0.50727 7 | 2.0 8 | {B1089A76-F6BE-4F5B-AD31-3296CD5CD922} 9 | Library 10 | mono-curses 11 | monocurses 12 | v4.0 13 | 14 | 15 | true 16 | full 17 | false 18 | bin\Debug 19 | DEBUG 20 | prompt 21 | 4 22 | false 23 | 24 | 25 | none 26 | false 27 | bin\Release 28 | prompt 29 | 4 30 | false 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /mono-curses.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@PREFIX@ 2 | exec_prefix=${prefix} 3 | pkglibdir=${exec_prefix}/lib/mono/mono-curses 4 | Libraries= ${pkglibdir}/mono-curses.dll 5 | 6 | Name: Mono.Curses 7 | Description: Mono bindings for Curses Console Library. 8 | Version: @VERSION@ 9 | 10 | Requires: 11 | Libs: -lib:${pkglibdir} -r:mono-curses.dll 12 | -------------------------------------------------------------------------------- /mono-curses.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "mono-curses", "mono-curses.csproj", "{B1089A76-F6BE-4F5B-AD31-3296CD5CD922}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Any CPU = Debug|Any CPU 9 | Release|Any CPU = Release|Any CPU 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {B1089A76-F6BE-4F5B-AD31-3296CD5CD922}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 13 | {B1089A76-F6BE-4F5B-AD31-3296CD5CD922}.Debug|Any CPU.Build.0 = Debug|Any CPU 14 | {B1089A76-F6BE-4F5B-AD31-3296CD5CD922}.Release|Any CPU.ActiveCfg = Release|Any CPU 15 | {B1089A76-F6BE-4F5B-AD31-3296CD5CD922}.Release|Any CPU.Build.0 = Release|Any CPU 16 | EndGlobalSection 17 | GlobalSection(MonoDevelopProperties) = preSolution 18 | StartupItem = mono-curses.csproj 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /mono-curses.snk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mono/mono-curses/eec5a9c9521b955626f6ed63c35fb11dae31f2a1/mono-curses.snk -------------------------------------------------------------------------------- /mono-curses.source: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /monotorrent.in: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | export DYLD_LIBRARY_PATH 3 | export LD_LIBRARY_PATH 4 | DYLD_LIBRARY_PATH=@prefix@/lib/monotorrent:$DYLD_LIBRARY_PATH 5 | LD_LIBRARY_PATH=@prefix@/lib/monotorrent:$LD_LIBRARY_PATH 6 | 7 | mono @prefix@/lib/monotorrent/monotorrent.exe || stty sane -------------------------------------------------------------------------------- /test.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Mono; 3 | using Unix.Terminal; 4 | 5 | class Demo { 6 | static void Main () 7 | { 8 | // Standard Init sequence 9 | Curses.initscr (); 10 | Curses.cbreak (); 11 | Curses.noecho (); 12 | 13 | // Recommended 14 | Curses.nonl (); 15 | 16 | Curses.addch ('ó'); 17 | Curses.addch ('ó'); 18 | Curses.addch ('ó'); 19 | Curses.addch ('ó'); 20 | Curses.addch ('ó'); 21 | Curses.addch ('ó'); 22 | Curses.addch ('ó'); 23 | Curses.addstr ("acción"); 24 | Curses.refresh (); 25 | Curses.getch (); 26 | 27 | Curses.Window.Standard.intrflush (false); 28 | Curses.Window.Standard.keypad (true); 29 | 30 | // Shutdown 31 | Curses.endwin (); 32 | } 33 | } 34 | --------------------------------------------------------------------------------