]> git.deb.at Git - pkg/abook.git/blobdiff - list.c
First attempt of the better interface for filters
[pkg/abook.git] / list.c
diff --git a/list.c b/list.c
index ce0f9efa6eb3f8304ff8897ae4b65b8ffe19dcb4..13a794fb0f11e563fc503380e836034d92af61b7 100644 (file)
--- a/list.c
+++ b/list.c
@@ -1,6 +1,7 @@
 
 /*
- * list.c
+ * $Id$
+ *
  * by JH <jheinonen@bigfoot.com>
  *
  * Copyright (C) Jaakko Heinonen
@@ -8,8 +9,8 @@
 
 #include <stdio.h>
 #include <string.h>
-#include "abook_curses.h"
 #include "abook.h"
+#include "ui.h"
 #include "database.h"
 #include "edit.h"
 #include "list.h"
@@ -47,7 +48,7 @@ refresh_list()
        
        werase(list);
 
-       print_number_of_items();
+       ui_print_number_of_items();
        
        if( items < 1 ) {
                refresh();
@@ -269,13 +270,13 @@ highlight_line(WINDOW *win, int line)
 int
 selected_items()
 {
-       int i, a=0;
+       int i, n = 0;
 
        for(i = 0; i < items; i++)
                if(selected[i])
-                       a++;
+                       n++;
 
-       return a;
+       return n;
 }
 
 void
@@ -290,3 +291,16 @@ invert_selection()
                selected[i] = !selected[i];
 }
 
+inline int
+list_current_item()
+{
+       return curitem;
+}
+
+inline int
+list_is_empty()
+{
+       return items < 1;
+}
+
+