license statements.
[apps/madmutt.git] / mutt_curses.h
index b7b1a82..1141e25 100644 (file)
@@ -1,24 +1,18 @@
 /*
+ * Copyright notice from original mutt:
  * Copyright (C) 1996-2000 Michael R. Elkins <me@mutt.org>
- * 
- *     This program is free software; you can redistribute it and/or modify
- *     it under the terms of the GNU General Public License as published by
- *     the Free Software Foundation; either version 2 of the License, or
- *     (at your option) any later version.
- * 
- *     This program is distributed in the hope that it will be useful,
- *     but WITHOUT ANY WARRANTY; without even the implied warranty of
- *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *     GNU General Public License for more details.
- * 
- *     You should have received a copy of the GNU General Public License
- *     along with this program; if not, write to the Free Software
- *     Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
- */ 
+ * Copyright (C) 2004 g10 Code GmbH
+ *
+ * This file is part of mutt-ng, see http://www.muttng.org/.
+ * It's licensed under the GNU General Public License,
+ * please see the file GPL in the top level source directory.
+ */
+#ifndef _MUTT_CURSES_H
+#define _MUTT_CURSES_H
 
 #ifdef USE_SLANG_CURSES
 
-#ifndef unix /* this symbol is not defined by the hp-ux compiler (sigh) */
+#ifndef unix                    /* this symbol is not defined by the hp-ux compiler (sigh) */
 #define unix
 #endif /* unix */
 
 
 #ifdef HAVE_NCURSESW_NCURSES_H
 #include <ncursesw/ncurses.h>
-#else
-#ifdef HAVE_NCURSES_H
+#elif HAVE_NCURSES_NCURSES_H
+#include <ncurses/ncurses.h>
+#elif HAVE_NCURSES_H
 #include <ncurses.h>
 #else
 #include <curses.h>
 #endif
-#endif
 
 #define M_ENTER_C '\n'
 #define M_ENTER_S "\n"
@@ -58,6 +52,7 @@
 #undef lines
 #endif /* lines */
 
+#define CLEARLINE_WIN(x) move(x,(option(OPTMBOXPANE)?SidebarWidth:0)), clrtoeol()
 #define CLEARLINE(x) move(x,0), clrtoeol()
 #define CENTERLINE(x,y) move(y, (COLS-strlen(x))/2), addstr(x)
 #define BEEP() do { if (option (OPTBEEP)) beep(); } while (0)
@@ -94,13 +89,13 @@ void mutt_flushinp (void);
 void mutt_refresh (void);
 void mutt_resize_screen (void);
 void mutt_ungetch (int, int);
+void mutt_need_hard_redraw (void);
 
 /* ----------------------------------------------------------------------------
  * Support for color
  */
 
-enum
-{
+enum {
   MT_COLOR_HDEFAULT = 0,
   MT_COLOR_QUOTED,
   MT_COLOR_SIGNATURE,
@@ -117,23 +112,34 @@ enum
   MT_COLOR_ATTACHMENT,
   MT_COLOR_SEARCH,
   MT_COLOR_BOLD,
+  MT_COLOR_SIDEBAR,
   MT_COLOR_UNDERLINE,
   MT_COLOR_INDEX,
+  MT_COLOR_NEW,
+  MT_COLOR_FLAGGED,
   MT_COLOR_MAX
 };
 
-typedef struct color_line
-{
+typedef struct color_line {
   regex_t rx;
   char *pattern;
-  pattern_t *color_pattern; /* compiled pattern to speed up index color
-                               calculation */
+  pattern_t *color_pattern;     /* compiled pattern to speed up index color
+                                   calculation */
   short fg;
   short bg;
   int pair;
   struct color_line *next;
 } COLOR_LINE;
 
+typedef struct {
+  const char* msg;
+  long pos;
+  long size;
+  char sizestr[SHORT_STRING];
+} progress_t;
+
+void mutt_progress_bar (progress_t* progress, long pos);
+
 extern int *ColorQuote;
 extern int ColorQuoteUsed;
 extern int ColorDefs[];
@@ -154,21 +160,23 @@ void ci_start_color (void);
  */
 
 #if !defined(STDC_HEADERS) && !defined(NCURSES_VERSION) && !defined(USE_SLANG_CURSES)
-extern int endwin();
-extern int printw();
-extern int beep();
-extern int isendwin();
-extern int w32addch();
-extern int keypad();
-extern int wclrtobot();
-extern int mvprintw();
-extern int getcurx();
-extern int getcury();
-extern int noecho();
-extern int wdelch();
-extern int wrefresh();
-extern int wmove();
-extern int wclear();
-extern int waddstr();
-extern int wclrtoeol();
+extern int endwin ();
+extern int printw ();
+extern int beep ();
+extern int isendwin ();
+extern int w32addch ();
+extern int keypad ();
+extern int wclrtobot ();
+extern int mvprintw ();
+extern int getcurx ();
+extern int getcury ();
+extern int noecho ();
+extern int wdelch ();
+extern int wrefresh ();
+extern int wmove ();
+extern int wclear ();
+extern int waddstr ();
+extern int wclrtoeol ();
 #endif
+
+#endif /* !_MUTT_CURSES_H */