Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 39 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
#CursesSharp
# CursesSharp

![](http://sushihangover.github.io/images/FireworksDemo.gif)

##INTRODUCTION
## INTRODUCTION

CursesSharp is a C# wrapper for curses library.
The latest version of this 'fork'' can be found at [Github](https://github.com/sushihangover/CursesSharp).
The original version can be found at the [SourceForge.net project page](http://sourceforge.net/projects/curses-sharp/).

![RainDemo](http://sushihangover.github.io/images/RainDemo.gif )

##DOCUMENTATION
## DOCUMENTATION

CursesSharp consists of a .NET assembly (CursesSharp.dll) and a native wrapper shared library (DLL) which is linked with PDCurses (in Windows) or ncurses (in Unix-like systems). This wrapper library is called CursesWrapper.dll in Windows or libCursesWrapper.so in Unix or libCursesWrapper.dylib in OS-X. CursesSharp provides a bit cleaner
API to curses than the original one, although function names remain unchanged for the most part.
CursesSharp consists of a .NET assembly (CursesSharp.dll) and a native wrapper shared library (DLL) which is linked with PDCurses (in Windows) or ncurses (in Unix-like systems). This wrapper library is called CursesWrapper.dll in Windows or libCursesWrapper.so in Unix or libCursesWrapper.dylib in OS-X. CursesSharp provides a bit cleaner API to curses than the original one, although function names remain unchanged for the most part.

![](http://sushihangover.github.io/images/UnicodeDemo.gif)

###CursesSharp namespace contains several important classes:
### CursesSharp namespace contains several important classes:

* Defs - contains constants from curses: attribute, color and key definitions
as well as some macros (COLOR_PAIR, PAIR_NUMBER)
Expand All @@ -32,7 +31,7 @@ API to curses than the original one, although function names remain unchanged fo

*Documentation is (always) under construction. Help would be much appreciated.*

##Installing CursesSharp on OS-X
## Installing CursesSharp on OS-X

These are the instructions for building CursesSharp on OS-X.

Expand All @@ -42,39 +41,42 @@ The build process has been tested on:
* Apple LLVM version 7.0.0 (clang-700.1.76)
* Mono JIT compiler version 4.2.1 64-bit build.

##0. Prerequisites
### 0. Prerequisites

The native library is now built as a 'fat' library so either a Mono 32-bit or 64-bit build can be used.

**$> file libCursesWrapper.so**

libCursesWrapper.so: Mach-O universal binary with 2 architectures
libCursesWrapper.so (for architecture i386): Mach-O dynamically linked shared library i386
libCursesWrapper.so (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64
```console
user@localhost:~$ file libCursesWrapper.so
libCursesWrapper.so: Mach-O universal binary with 2 architectures
libCursesWrapper.so (for architecture i386): Mach-O dynamically linked shared library i386
libCursesWrapper.so (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64
```

<!--A **64-bit build of Mono** as the the native shared library (so/dylib) is of ARCH type x64_86.

**If you are running the default 32-bit Mono install, you will have to build the native library as ARCH i386. Currently there is not an included build process for this.
**
-->

##1. Getting CursesSharp
### 1. Getting CursesSharp

You can clone it from the following repository:

https://github.com/sushihangover/CursesSharp.git

##2. Make the Native Library
### 2. Make the Native Library

mdtool build CursesSharp.Native.sln --target:Build --configuration:Release
mdtool build CursesSharp.Native.sln --target:Build --configuration:Debug

##3. Make the C# Libraries and Demos
### 3. Make the C# Libraries and Demos

xbuild CursesSharp.sln /target:Clean
xbuild CursesSharp.sln /target:Build

Note: To run the demos from the CLI, make sure that set the [`DYLD_FALLBACK_LIBRARY_PATH`](https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/dyld.1.html). While still in the repo's root directory:
> **Note** To run the demos from the CLI, make sure that set the [`DYLD_FALLBACK_LIBRARY_PATH`](https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/dyld.1.html).

While still in the repo's root directory:

export DYLD_FALLBACK_LIBRARY_PATH=$(PWD)/CursesSharp.Native/bin/Debug:/usr/lib:$DYLD_FALLBACK_LIBRARY_PATH

Expand All @@ -86,7 +88,7 @@ To learn more about `dyld` check out the `man` page:

man dyld

##Demos:
## Demos:

There are various demos available to review:

Expand All @@ -100,23 +102,23 @@ There are various demos available to review:
* Demo.Gui.Timeout
* Demo.Native.ResizeTerm

##Rain Demo:
### Rain Demo:

pushd CursesSharp.Demo/Demo.CursesSharp.Rain/bin/x64/Debug/
mono RainDemo.exe
popd

![RainDemo](http://sushihangover.github.io/images/RainDemo.gif )

##FireWorks Demo:
### FireWorks Demo:

pushd CursesSharp.Demo/Demo.CursesSharp.Rain/bin/x64/Debug/
mono FireworkDemo.exe
popd

![](http://sushihangover.github.io/images/FireworksDemo.gif)

##MidnightCommander Demo:
### MidnightCommander Demo:

pushd CursesSharp.Demo/Demo.Gui.MidnightCommander/bin/x64/Debug/
mono Demo.Gui.MidnightCommander.exe
Expand All @@ -125,37 +127,39 @@ There are various demos available to review:
![](http://sushihangover.github.io/images/CursesSharp-Midnight.png)


##Installing CursesSharp on Linux
## Installing CursesSharp on Linux

###0. Prerequisites
### 0. Prerequisites

Note: It is assumed you are running 64-bit Linux (ARCH x86_64)
> **Note** It is assumed you are running 64-bit Linux (ARCH x86_64)

Install some dependencies:

sudo apt-get install lib32ncursesw5-dev
sudo apt-get install lib32ncurses5-dev
sudo apt-get install ncurses-doc

##1. Getting CursesSharp
### 1. Getting CursesSharp

You will have to obtain CursesSharp sources. You clone it from the following repository:

https://github.com/sushihangover/CursesSharp.git

###2. Make the Native Library
### 2. Make the Native Library

mdtool build CursesSharp.Native.Linux.sln --target:Build --configuration:Release
mdtool build CursesSharp.Native.Linux.sln --target:Build --configuration:Debug

###3. Make the C# Libraries and Demos
### 3. Make the C# Libraries and Demos

xbuild CursesSharp.sln /target:Clean /property:configuration=Debug
xbuild CursesSharp.sln /target:Build /property:configuration=Debug

#Demos:
## Demos:

> **Note** To run the demos from the CLI, make sure that set the [`LD_LIBRARY_PATH`](http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html).

Note: To run the demos from the CLI, make sure that set the [`LD_LIBRARY_PATH`](http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html). While still in the repo's root directory:
While still in the repo's root directory:

export LD_LIBRARY_PATH=$(PWD)/CursesSharp.Native/bin/Debug:/usr/lib:$LD_LIBRARY_PATH

Expand All @@ -167,25 +171,25 @@ To learn more about `ld` check out the `man` page:

man ld

##MessageBox Demo:
### MessageBox Demo:

cd CursesSharp.Demo/Demo.Gui.MidnightCommander/bin/x64/Debug/
mono Demo.Gui.Messagebox.exe
cd -

#####(Ubuntu / Konsole)
#### (Ubuntu / Konsole)
![](http://sushihangover.github.io/images/CursesSharp-MsgBox-Konsole.png)

##MidnightCommander Demo:
### MidnightCommander Demo:

cd CursesSharp.Demo/Demo.Gui.MidnightCommander/bin/x64/Debug/
mono Demo.Gui.MidnightCommander.exe
cd -

####(Ubuntu / Konsole)
#### (Ubuntu / Konsole)
![](http://sushihangover.github.io/images/CursesSharp-Midnight-Konsole.png)

##Installing CursesSharp on Windows
## Installing CursesSharp on Windows

Refer the original Windows project, source code and instructions are [here](http://curses-sharp.sourceforge.net/index.php?page=windows)

Expand All @@ -200,7 +204,7 @@ Linux:

{TODO}

##TODO & Contributors:
## TODO & Contributors:

* Nuget support
* MS Window support (via PDCurses)
Expand Down