diff options
Diffstat (limited to 'perl-install/Newt/Newt.xs')
-rw-r--r-- | perl-install/Newt/Newt.xs | 139 |
1 files changed, 109 insertions, 30 deletions
diff --git a/perl-install/Newt/Newt.xs b/perl-install/Newt/Newt.xs index 97c056ee6..e60583de1 100644 --- a/perl-install/Newt/Newt.xs +++ b/perl-install/Newt/Newt.xs @@ -9,13 +9,6 @@ static void suspend() { newtResume(); } -static void componentCallback(newtComponent co, void *data) { - dSP; - PUSHMARK(SP); - perl_call_sv((SV *) data, G_DISCARD); -} - - typedef newtComponent Newt__Component; typedef newtGrid Newt__Grid; @@ -29,6 +22,38 @@ DESTROY() newtFinished(); } +void +changeColors() + CODE: +{ +const struct newtColors colors = { + "cyan", "black", /* root fg, bg */ + "black", "blue", /* border fg, bg */ + "white", "blue", /* window fg, bg */ + "white", "black", /* shadow fg, bg */ + "white", "blue", /* title fg, bg */ + "yellow", "cyan", /* button fg, bg */ + "white", "cyan", /* active button fg, bg */ + "yellow", "blue", /* checkbox fg, bg */ + "blue", "brown", /* active checkbox fg, bg */ + "yellow", "blue", /* entry box fg, bg */ + "white", "blue", /* label fg, bg */ + "black", "cyan", /* listbox fg, bg */ + "yellow", "cyan", /* active listbox fg, bg */ + "white", "blue", /* textbox fg, bg */ + "cyan", "black", /* active textbox fg, bg */ + "white", "blue", /* help line */ + "yellow", "blue", /* root text */ + "blue", /* scale full */ + "red", /* scale empty */ + "blue", "cyan", /* disabled entry fg, bg */ + "white", "blue", /* compact button fg, bg */ + "yellow", "red", /* active & sel listbox */ + "black", "brown" /* selected listbox */ +}; + newtSetColors(colors); +} + int newtInit() @@ -38,12 +63,6 @@ newtFinished() void newtCls() -void -newtSuspend() - -void -newtResume() - int newtCenteredWindow(width,height,title) int width; @@ -142,13 +161,6 @@ newtWinMenu(title,text,suggestedWidth,flexDown,flexUp,maxListHeight,list,def,but MODULE = Newt PACKAGE = Newt::Component PREFIX = newt -void -addCallback(co, callback) - Newt::Component co; - SV *callback; - CODE: - newtComponentAddCallback(co, componentCallback, callback); - Newt::Component newtCompactButton(left,top,text) int left; @@ -162,14 +174,15 @@ newtButton(left,top,text) const char * text; Newt::Component -newtCheckbox(left,top,text,defValue,seq) +newtCheckbox(left,top,text,defValue,seq,result) int left; int top; const char * text; char *defValue; const char * seq; + int *result; CODE: - RETVAL = newtCheckbox(left, top, text, defValue[0], seq, NULL); + RETVAL = newtCheckbox(left, top, text, defValue[0], seq, (char*)result); OUTPUT: RETVAL @@ -216,28 +229,94 @@ newtListbox(left,top,height,flags) int height; int flags; -char * +void * newtListboxGetCurrent(co) Newt::Component co; void -newtListboxSetCurrent(co,indice) +newtListboxSetCurrent(co,num) + Newt::Component co; + int num; + +void +newtListboxSetCurrentByKey(co,key) + Newt::Component co; + void * key; + +void +newtListboxSetText(co,num,text) Newt::Component co; - int indice; + int num; + const char * text; + +void +newtListboxSetEntry(co,num,text) + Newt::Component co; + int num; + const char * text; void newtListboxSetWidth(co,width) Newt::Component co; int width; +# return the data passed to AddEntry +void +newtListboxSetData(co,num,data) + Newt::Component co; + int num; + void * data; + int -newtListboxAddEntry(co,text) +newtListboxAddEntry(co,text,data) Newt::Component co; const char * text; -CODE: - RETVAL = newtListboxAddEntry(co, text, text); -OUTPUT: - RETVAL + const void * data; + +# Send the key to insert after, or NULL to insert at the top +int +newtListboxInsertEntry(co,text,data,key) + Newt::Component co; + const char * text; + const void * data; + void * key; + +int +newtListboxDeleteEntry(co,data) + Newt::Component co; + void * data; + +# removes all entries from listbox +void +newtListboxClear(co) + Newt::Component co; + +void +newtListboxGetEntry(co,num,text,data) + Newt::Component co; + int num; + char * text; + void * data; + PPCODE: + { + newtListboxGetEntry(co, num, &text, data); + } + +# Returns an array of data pointers from items, last element is NULL +void * +newtListboxGetSelection(co,numitems) + Newt::Component co; + int *numitems; + +void +newtListboxClearSelection(co) + Newt::Component co; + +void +newtListboxSelectItem(co,key,sense) + Newt::Component co; + void *key + enum newtFlagsSense sense; Newt::Component newtTextboxReflowed(left,top,text,width,flexDown,flexUp,flags) |