• Stars
    star
    160
  • Rank 234,703 (Top 5 %)
  • Language
    C#
  • License
    GNU Lesser Genera...
  • Created over 9 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Curses Sharp is a ncurses terminal control library binding for C#.

#CursesSharp

##INTRODUCTION

CursesSharp is a C# wrapper for curses library. The latest version of this 'fork'' can be found at Github. The original version can be found at the SourceForge.net project page.

RainDemo

##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 namespace contains several important classes:

  • Defs - contains constants from curses: attribute, color and key definitions as well as some macros (COLOR_PAIR, PAIR_NUMBER)
  • Curses - the main interface to curses; contains methods global to the library, a StdScr property that returns the stdscr window, and as a convenience, some window-specific functions that operate on stdscr
  • Window - represents a curses window that can be written to, or read from; contains wrappers for most of curses functions with names starting with w* or mvw*
  • CursesException - an exception class, thrown when a curses function reports an error

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

##Installing CursesSharp on OS-X

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

The build process has been tested on:

  • OS-X 10.10.5
  • Apple LLVM version 7.0.0 (clang-700.1.76)
  • Mono JIT compiler version 4.2.1 64-bit build.

##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

##1. Getting CursesSharp

You can clone it from the following repository:

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

##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

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. While still in the repo's root directory:

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

There is also a CI script that can be called via source to setup DYLD_FALLBACK_LIBRARY_PATH and LD_LIBRARY_PATH

source CI/libpath-source-me.sh

To learn more about dyld check out the man page:

man dyld

##Demos:

There are various demos available to review:

  • Demo.CursesSharp.Firework
  • Demo.CursesSharp.Gui.HelloWorld
  • Demo.CursesSharp.HelloWorld
  • Demo.CursesSharp.Rain
  • Demo.CursesSharp.Unicode
  • Demo.Gui.MessageBox
  • Demo.Gui.MidnightCommander
  • Demo.Gui.Timeout
  • Demo.Native.ResizeTerm

##Rain Demo:

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

RainDemo

##FireWorks Demo:

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

##MidnightCommander Demo:

pushd CursesSharp.Demo/Demo.Gui.MidnightCommander/bin/x64/Debug/
mono Demo.Gui.MidnightCommander.exe
popd

##Installing CursesSharp on Linux

###0. Prerequisites

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

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

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

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

#Demos:

Note: To run the demos from the CLI, make sure that set the LD_LIBRARY_PATH. While still in the repo's root directory:

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

There is also a CI script that can be called via source to setup DYLD_FALLBACK_LIBRARY_PATH and LD_LIBRARY_PATH

source CI/libpath-source-me.sh

To learn more about ld check out the man page:

man ld

##MessageBox Demo:

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

#####(Ubuntu / Konsole)

##MidnightCommander Demo:

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

####(Ubuntu / Konsole)

##Installing CursesSharp on Windows

Refer the original Windows project, source code and instructions are here

CI

OS-X:

source CI/libpath-source-me.sh
CI/build.osx.sh

Linux:

{TODO}

##TODO & Contributors:

  • Nuget support
  • MS Window support (via PDCurses)
  • Documentation
  • Bug reporting/fixes

Looking for contributors in these areas and/or any other areas that you would help out on.

Fork and Contribute ;-)

More Repositories

1

SushiHangover-PowerShell

PowerShell 3.0 My Home
PowerShell
129
star
2

llvm_baremetal

LLVM Bare Metal GitSlave
C
51
star
3

llvm-avr

LLVM 3.5 Bleeding edge fork of avr-llvm (http://sourceforge.net/projects/avr-llvm)
C++
18
star
4

Irony

Irony - .NET Language Implementation Kit. Forked/Mirrored from CodePlex to Add Gtk# Explorer
C#
12
star
5

Realm.Json.Extensions

Extension Methods for adding JSON APIs to a Realm Instance
C#
11
star
6

SVGKit.Binding

This is a Xamarin.iOS binding project for SVGKit
C#
9
star
7

SushiHangover-AWS

PowerShell 2/3 for Amazon Web Sevices (AWS) Inteface
PowerShell
9
star
8

RealmThread

An Action/Task Message Pump for running commands on a dedicated Realm thread
C#
9
star
9

CorFlags

Cross Platform CorFlags Conversion Tool
C#
5
star
10

SushiHangover.GoogleChrome.CustomTabs.Shared

Xamarin Android Chrome CustomTabs (Android.Support.CustomTabs.Shared)
C#
4
star
11

Jurassic

Jurassic (.Net based ECMAScript) See branch "mono-3.2.5"
C#
4
star
12

Xamarin.iOS.Settings.Bundle

Xamarin.iOS Settings.Bundle Debug vs. Release Example
C#
4
star
13

SushiHangover.AppleScript

An OS-X AppleScript C# library - Call AppleScript Function with Arguments and get Return value
Objective-C
4
star
14

Xamarin.Android.jCIFS

Xamarin Android C# bindings for Java CIFS (jCIFS) Client Library
C#
3
star
15

SushiHangover.Android.Maps.Utils

Xamarin Android Binding Library : Handy extensions to the Google Maps Android API
C#
2
star
16

SupermodifiedServo

Supermodified Servo
C
2
star
17

Xamarin.Forms.Renderer.Tests

Various solutions/projects for custom renderer creations and other stuff
HTML
2
star
18

SushiHangover.BlueStacks.Addin

Xamarin Studio Addin to allow the use of BlueStacks Player for debugging
2
star
19

sushihangover.github.io

SushiHangover GitHub Pages
HTML
1
star
20

SushiHangover.DropBoxChooser

Xamarin.Android Binding of the Dropbox Chooser on Android
Java
1
star
21

OSX-Dev-Configs

C#
1
star
22

as3-commons

Automatically exported from code.google.com/p/as3-commons
ActionScript
1
star