summaryrefslogtreecommitdiffstats
path: root/perl-install/Newt/Newt.xs
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/Newt/Newt.xs')
-rw-r--r--perl-install/Newt/Newt.xs139
1 files changed, 30 insertions, 109 deletions
diff --git a/perl-install/Newt/Newt.xs b/perl-install/Newt/Newt.xs
index e60583de1..97c056ee6 100644
--- a/perl-install/Newt/Newt.xs
+++ b/perl-install/Newt/Newt.xs
@@ -9,6 +9,13 @@ 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;
@@ -22,38 +29,6 @@ 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()
@@ -63,6 +38,12 @@ newtFinished()
void
newtCls()
+void
+newtSuspend()
+
+void
+newtResume()
+
int
newtCenteredWindow(width,height,title)
int width;
@@ -161,6 +142,13 @@ 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;
@@ -174,15 +162,14 @@ newtButton(left,top,text)
const char * text;
Newt::Component
-newtCheckbox(left,top,text,defValue,seq,result)
+newtCheckbox(left,top,text,defValue,seq)
int left;
int top;
const char * text;
char *defValue;
const char * seq;
- int *result;
CODE:
- RETVAL = newtCheckbox(left, top, text, defValue[0], seq, (char*)result);
+ RETVAL = newtCheckbox(left, top, text, defValue[0], seq, NULL);
OUTPUT:
RETVAL
@@ -229,94 +216,28 @@ newtListbox(left,top,height,flags)
int height;
int flags;
-void *
+char *
newtListboxGetCurrent(co)
Newt::Component co;
void
-newtListboxSetCurrent(co,num)
- Newt::Component co;
- int num;
-
-void
-newtListboxSetCurrentByKey(co,key)
- Newt::Component co;
- void * key;
-
-void
-newtListboxSetText(co,num,text)
+newtListboxSetCurrent(co,indice)
Newt::Component co;
- int num;
- const char * text;
-
-void
-newtListboxSetEntry(co,num,text)
- Newt::Component co;
- int num;
- const char * text;
+ int indice;
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,data)
+newtListboxAddEntry(co,text)
Newt::Component co;
const char * text;
- 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;
+CODE:
+ RETVAL = newtListboxAddEntry(co, text, text);
+OUTPUT:
+ RETVAL
Newt::Component
newtTextboxReflowed(left,top,text,width,flexDown,flexUp,flags)