]> git.ipfire.org Git - thirdparty/newt.git/commitdiff
changes to clean up the interface, including:
authorewt <ewt>
Sat, 1 Aug 1998 15:53:16 +0000 (15:53 +0000)
committerewt <ewt>
Sat, 1 Aug 1998 15:53:16 +0000 (15:53 +0000)
1) newtListboxSelectItem() uses a key, not an index
2) newtListboxAddEntry() was removed (it was redundant anyway)
   (a #define was added for backwards compatibility)
3) DOBORDER flag was renambed to just BORDER
4) NEWT_FLAG_NOSCROLL was removed as only listboxes used it, and
   negative logic sucks [this one will be a pita]

newt.h

diff --git a/newt.h b/newt.h
index 8c5ae46d5d83900b5cd84a1f943ad1fbc6bec3e5..5ac374bffc80167697ba770a3acea3b71e9e22b8 100644 (file)
--- a/newt.h
+++ b/newt.h
@@ -62,13 +62,16 @@ enum newtFlagsSense { NEWT_FLAGS_SET, NEWT_FLAGS_RESET, NEWT_FLAGS_TOGGLE };
 #define NEWT_FLAG_HIDDEN       (1 << 1)
 #define NEWT_FLAG_SCROLL       (1 << 2)
 #define NEWT_FLAG_DISABLED     (1 << 3)
-#define NEWT_FLAG_NOSCROLL     (1 << 4)        /* for listboxes */
-#define NEWT_FLAG_DOBORDER     (1 << 5)
+/* OBSOLETE #define NEWT_FLAG_NOSCROLL         (1 << 4)        for listboxes */
+#define NEWT_FLAG_BORDER       (1 << 5)
 #define NEWT_FLAG_WRAP         (1 << 6)
 #define NEWT_FLAG_NOF12                (1 << 7)
 #define NEWT_FLAG_MULTIPLE      (1 << 8)
 #define NEWT_FLAG_SELECTED     (1 << 9)
 
+#define NEWT_FD_READ           (1 << 0)
+#define NEWT_FD_WRITE          (1 << 1)
+
 /* Backwards compatibility */
 #define NEWT_LISTBOX_RETURNEXIT NEWT_FLAG_RETURNEXIT
 #define NEWT_ENTRY_SCROLL      NEWT_FLAG_SCROLL
@@ -80,8 +83,8 @@ enum newtFlagsSense { NEWT_FLAGS_SET, NEWT_FLAGS_RESET, NEWT_FLAGS_TOGGLE };
 #define NEWT_TEXTBOX_SCROLL    NEWT_FLAG_SCROLL
 #define NEWT_FORM_NOF12                NEWT_FLAG_NOF12
 
-#define NEWT_FD_READ           (1 << 0)
-#define NEWT_FD_WRITE          (1 << 1)
+#define newtListboxAddEntry    newtListboxAppendEntry
+
 
 typedef struct newtComponent_struct * newtComponent;
 
@@ -110,7 +113,7 @@ void newtResume(void);
 void newtPushHelpLine(const char * text);
 void newtRedrawHelpLine(void);
 void newtPopHelpLine(void);
-void newtDrawRootText(int row, int col, const char * text);
+void newtDrawRootText(int col, int row, const char * text);
 void newtBell(void);
 
 /* Components */
@@ -139,12 +142,11 @@ newtComponent newtListbox(int left, int top, int height, int flags);
 void * newtListboxGetCurrent(newtComponent co);
 void newtListboxSetCurrent(newtComponent co, int num);
 void newtListboxSetCurrentByKey(newtComponent co, void * key);
-void newtListboxSetText(newtComponent co, int num, const char * text);
 void newtListboxSetEntry(newtComponent co, int num, const char * text);
 void newtListboxSetWidth(newtComponent co, int width);
-/* return the data passed to AddEntry */
 void newtListboxSetData(newtComponent co, int num, void * data);
-int newtListboxAddEntry(newtComponent co, const char * text, const void * data);
+int newtListboxAppendEntry(newtComponent co, const char * text, 
+                          const void * data);
 /* Send the key to insert after, or NULL to insert at the top */
 int newtListboxInsertEntry(newtComponent co, const char * text, const void * data, void * key);
 int newtListboxDeleteEntry(newtComponent co, void * data);
@@ -153,13 +155,13 @@ void newtListboxGetEntry(newtComponent co, int num, char **text, void **data);
 /* Returns an array of data pointers from items, last element is NULL */
 void **newtListboxGetSelection(newtComponent co, int *numitems);
 void newtListboxClearSelection(newtComponent co);
-void newtListboxSelectItem(newtComponent co, int item,
+void newtListboxSelectItem(newtComponent co, const void * key,
        enum newtFlagsSense sense);
 
     
 newtComponent newtTextboxReflowed(int left, int top, char * text, int width,
                                  int flexDown, int flexUp, int flags);
-newtComponent newtTextbox(int left, int top, int with, int height, int flags);
+newtComponent newtTextbox(int left, int top, int width, int height, int flags);
 void newtTextboxSetText(newtComponent co, const char * text);
 void newtTextboxSetHeight(newtComponent co, int height);
 int newtTextboxGetNumLines(newtComponent co);