-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
131 additions
and
262 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Project: termbox - a ncurses alternative | ||
|
||
May 5th 2012, youngkevinjonas@gmail.com: | ||
I have completely reorganized the project | ||
while leaving most of the code intact (fixed | ||
a couple of warnings). Now you can either use | ||
it as a dependency for a C/C++ project by employing | ||
CMake, or you can install it as a Python package | ||
by using Python distutils and Cython. | ||
|
||
Fixed misuse of C prototypes (ie. foo() -> foo(void)) | ||
Changed a couple of include paths |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,29 @@ | ||
CMAKE_MINIMUM_REQUIRED(VERSION 2.6) | ||
################################################################# | ||
# Termbox - A ncurses alternative | ||
# | ||
# Author: nsf - no.smile.face@gmail.com | ||
# Website: http://code.google.com/p/termbox/ | ||
# | ||
# Termbox library is a simple and clean ncurses alternative. | ||
# Of course everything has it's own price. | ||
# In this case it's portability and stability. | ||
# | ||
# Modified by: ykj - youngkevinjonas@gmail.com | ||
# On: May 5th 2012 | ||
# I have completely reorganized the project | ||
# while leaving most of the code intact (fixed | ||
# a couple of warnings). Now you can either use | ||
# it as a dependency for a C/C++ project by employing | ||
# CMake, or you can install it as a Python package | ||
# by using Python distutils and Cython. | ||
# | ||
# This file constitutes the CMake build. | ||
################################################################# | ||
|
||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8) | ||
|
||
PROJECT(TERMBOX C) | ||
|
||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -std=gnu99") | ||
|
||
SET(TERMBOX_LIB_SRC | ||
${CMAKE_CURRENT_SOURCE_DIR}/input.c | ||
${CMAKE_CURRENT_SOURCE_DIR}/ringbuffer.c | ||
${CMAKE_CURRENT_SOURCE_DIR}/term.c | ||
${CMAKE_CURRENT_SOURCE_DIR}/termbox.c | ||
${CMAKE_CURRENT_SOURCE_DIR}/utf8.c | ||
) | ||
|
||
SET(KEYBOARD_SRC | ||
${CMAKE_CURRENT_SOURCE_DIR}/keyboard.c | ||
) | ||
|
||
|
||
ADD_LIBRARY(termbox STATIC ${TERMBOX_LIB_SRC}) | ||
ADD_EXECUTABLE(keyboard ${KEYBOARD_SRC}) | ||
TARGET_LINK_LIBRARIES(keyboard termbox) | ||
|
||
OPTION(TERMBOX_SHARED "Build static library for use in shared libraries (uses fPIC)" OFF) | ||
|
||
|
||
IF(TERMBOX_SHARED) | ||
SET_TARGET_PROPERTIES(termbox PROPERTIES COMPILE_FLAGS -fPIC) | ||
ENDIF(TERMBOX_SHARED) | ||
|
||
FIND_PROGRAM(PYREX pyrexc) | ||
IF(PYREX) | ||
SUBDIRS(py) | ||
ENDIF() | ||
ADD_SUBDIRECTORY(src) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Project: termbox - a ncurses alternative | ||
|
||
This file describes how to build and install termbox, | ||
depending on your usecase. | ||
|
||
If you're a Python, run: | ||
$ python setup.py install | ||
|
||
Dependencies: Cython | ||
|
||
And go ahead and use it as: | ||
>>> import termbox | ||
>>> (...) | ||
|
||
If you would like to test termbox before installing: | ||
$ python setup.py build_ext --inplace | ||
$ python test_termboxmodule.py | ||
|
||
(Press ESC to exit the program) | ||
|
||
If you're more of a C/C++ dude, use: | ||
$ mkdir build_termbox | ||
$ cd build_termbox | ||
$ cmake /path/to/src | ||
$ make | ||
$ (...) | ||
|
||
Dependencies: cmake > 2.8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from distutils.core import setup | ||
from distutils.extension import Extension | ||
from Cython.Distutils import build_ext | ||
|
||
import glob | ||
|
||
sourcefiles = ['src/termboxmodule.pyx'] + glob.glob('src/*.c') | ||
|
||
setup( | ||
name = 'termbox', | ||
version = '1.0.1a1', | ||
description = 'A simple and clean ncurses alternative', | ||
author = 'nsf', | ||
author_email = 'no.smile.face@gmail.com', | ||
url = 'http://code.google.com/p/termbox/', | ||
license = 'MIT', | ||
cmdclass = {'build_ext': build_ext}, | ||
ext_modules = [Extension('termbox', sourcefiles)], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
SET(TERMBOX_LIB_SRC | ||
${CMAKE_CURRENT_SOURCE_DIR}/input.c | ||
${CMAKE_CURRENT_SOURCE_DIR}/ringbuffer.c | ||
${CMAKE_CURRENT_SOURCE_DIR}/term.c | ||
${CMAKE_CURRENT_SOURCE_DIR}/termbox.c | ||
${CMAKE_CURRENT_SOURCE_DIR}/utf8.c | ||
) | ||
|
||
ADD_LIBRARY(termbox STATIC ${TERMBOX_LIB_SRC}) | ||
|
||
OPTION(TERMBOX_SHARED "Build static library for use in shared libraries (uses fPIC)" OFF) | ||
|
||
IF(TERMBOX_SHARED) | ||
SET_TARGET_PROPERTIES(termbox PROPERTIES COMPILE_FLAGS -fPIC) | ||
ENDIF(TERMBOX_SHARED) | ||
|
||
ADD_SUBDIRECTORY(demo) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
SET(KEYBOARD_SRC | ||
${CMAKE_CURRENT_SOURCE_DIR}/keyboard.c | ||
) | ||
|
||
ADD_EXECUTABLE(keyboard ${KEYBOARD_SRC}) | ||
TARGET_LINK_LIBRARIES(keyboard termbox) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.