Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #1 from gkrnours/master
Add whline and wvline
  • Loading branch information
fresc81 committed Feb 16, 2013
2 parents 0dcfd03 + e6543cb commit 41b9e9c
Showing 1 changed file with 38 additions and 2 deletions.
40 changes: 38 additions & 2 deletions src/curses.cc
Expand Up @@ -181,6 +181,19 @@ Handle<Value> node_has_colors(const Arguments& args) {
return scope.Close(Boolean::New( result ));
}

Handle<Value> node_whline(const Arguments& args) {
HandleScope scope;
NODE_ARGS(3)
NODE_PARG(0, WINDOW)
NODE_ARG(1, Number)
NODE_ARG(2, Number)
WINDOW* win = CAST_PWINDOW(args[0]);
chtype ch = CAST_CHTYPE(args[1]->Int32Value());
int32_t n = CAST_INT32(args[2]->Int32Value());
int32_t result = whline( win, ch, n );
return scope.Close(Int32::New( result ));
}

Handle<Value> node_init_color(const Arguments& args) {
HandleScope scope;
NODE_ARGS(4)
Expand Down Expand Up @@ -576,6 +589,19 @@ Handle<Value> node_wscrl(const Arguments& args) {
return scope.Close(Int32::New( result ));
}

Handle<Value> node_wvline(const Arguments& args) {
HandleScope scope;
NODE_ARGS(3)
NODE_PARG(0, WINDOW)
NODE_ARG(1, Number)
NODE_ARG(2, Number)
WINDOW* win = CAST_PWINDOW(args[0]);
chtype ch = CAST_CHTYPE(args[1]->Int32Value());
int32_t n = CAST_INT32(args[2]->Int32Value());
int32_t result = wvline( win, ch, n );
return scope.Close(Int32::New( result ));
}

Handle<Value> node_curses_version(const Arguments& args) {
HandleScope scope;
NODE_ARGS(0)
Expand Down Expand Up @@ -1097,6 +1123,11 @@ void init(Handle<Object> target) {
FunctionTemplate::New(node_wgetch)->GetFunction()
);

target->Set(
String::NewSymbol("whline"),
FunctionTemplate::New(node_whline)->GetFunction()
);

target->Set(
String::NewSymbol("wmove"),
FunctionTemplate::New(node_wmove)->GetFunction()
Expand All @@ -1117,6 +1148,11 @@ void init(Handle<Object> target) {
FunctionTemplate::New(node_wscrl)->GetFunction()
);

target->Set(
String::NewSymbol("wvline"),
FunctionTemplate::New(node_wvline)->GetFunction()
);

target->Set(
String::NewSymbol("assume_default_colors"),
FunctionTemplate::New(node_assume_default_colors)->GetFunction()
Expand Down Expand Up @@ -1432,7 +1468,7 @@ NODE_MODULE(curses, init)
# int wgetch(WINDOW *);
int wgetnstr(WINDOW *, char *, int);
int wgetstr(WINDOW *, char *);
int whline(WINDOW *, chtype, int);
# int whline(WINDOW *, chtype, int);
int winchnstr(WINDOW *, chtype *, int);
int winchstr(WINDOW *, chtype *);
chtype winch(WINDOW *);
Expand All @@ -1457,7 +1493,7 @@ NODE_MODULE(curses, init)
void wsyncup(WINDOW *);
void wtimeout(WINDOW *, int);
int wtouchln(WINDOW *, int, int, int);
int wvline(WINDOW *, chtype, int);
# int wvline(WINDOW *, chtype, int);
chtype getattrs(WINDOW *);
int getbegx(WINDOW *);
Expand Down

0 comments on commit 41b9e9c

Please sign in to comment.