tin  2.6.1
About: TIN is a threaded NNTP and spool based UseNet newsreader.
  Fossies Dox: tin-2.6.1.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

curses.c File Reference
#include "tin.h"
#include "tcurses.h"
#include "tnntp.h"
#include <missing_fd.h>
Include dependency graph for curses.c:

Go to the source code of this file.

Macros

#define DEFAULT_LINES_ON_TERMINAL   24
 
#define DEFAULT_COLUMNS_ON_TERMINAL   80
 
#define TTYIN   0
 
#define USE_SGTTY   0
 
#define USE_POSIX_TERMIOS   0
 
#define USE_TERMIO   0
 
#define USE_TERMCAP   1
 
#define CAPNAME(a, b)   a
 
#define dCAPNAME(a, b)   a
 
#define TGETSTR(a, bufp)   tgetstr(a, bufp)
 
#define TGETNUM(a)   tgetnum(a)
 
#define TGETFLAG(a)   tgetflag(a)
 
#define NO_CAP(s)   (s == 0)
 
#define TFORMAT(fmt, a, b)   tgoto(fmt, b, a)
 

Functions

static int input_pending (int delay)
 
static void ScreenSize (int *num_lines, int *num_columns)
 
static void xclick (int state)
 
void setup_screen (void)
 
int get_termcaps (void)
 
int InitScreen (void)
 
void InitWin (void)
 
void EndWin (void)
 
void set_keypad_on (void)
 
void set_keypad_off (void)
 
void ClearScreen (void)
 
void MoveCursor (int row, int col)
 
void CleartoEOLN (void)
 
void CleartoEOS (void)
 
void SetScrollRegion (int topline, int bottomline)
 
void ScrollScreen (int lines_to_scroll)
 
void StartInverse (void)
 
void EndInverse (void)
 
int RawState (void)
 
void Raw (int state)
 
void outchar (int c)
 
void set_xclick_on (void)
 
void set_xclick_off (void)
 
void cursoron (void)
 
void cursoroff (void)
 
void highlight_string (int row, int col, int size)
 
void word_highlight_string (int row, int col, int size, int color)
 
int get_arrow_key (int prech)
 
int ReadCh (void)
 

Variables

int cLINES = 24 - 1
 
int cCOLS = 80
 
int _hp_glitch = 0
 
static int _inraw = 0
 
static int xclicks = 0
 
t_bool have_linescroll = 0
 
static TTY _raw_tty
 
static TTY _original_tty
 
static char * _clearscreen
 
static char * _moveto
 
static char * _cleartoeoln
 
static char * _cleartoeos
 
static char * _setinverse
 
static char * _clearinverse
 
static char * _setunderline
 
static char * _clearunderline
 
static char * _xclickinit
 
static char * _xclickend
 
static char * _cursoron
 
static char * _cursoroff
 
static char * _terminalinit
 
static char * _terminalend
 
static char * _keypadlocal
 
static char * _keypadxmit
 
static char * _scrollregion
 
static char * _scrollfwd
 
static char * _scrollback
 
static char * _reset
 
static char * _reversevideo
 
static char * _blink
 
static char * _dim
 
static char * _bold
 
static int _columns
 
static int _line
 
static int _lines
 
static int _colors
 
static int _topscrregion
 
static int _bottomscrregion
 

Macro Definition Documentation

◆ CAPNAME

#define CAPNAME (   a,
 
)    a

Definition at line 197 of file curses.c.

◆ dCAPNAME

#define dCAPNAME (   a,
 
)    a

Definition at line 198 of file curses.c.

◆ DEFAULT_COLUMNS_ON_TERMINAL

#define DEFAULT_COLUMNS_ON_TERMINAL   80

Definition at line 50 of file curses.c.

◆ DEFAULT_LINES_ON_TERMINAL

#define DEFAULT_LINES_ON_TERMINAL   24

Definition at line 49 of file curses.c.

◆ NO_CAP

#define NO_CAP (   s)    (s == 0)

Definition at line 202 of file curses.c.

◆ TFORMAT

#define TFORMAT (   fmt,
  a,
 
)    tgoto(fmt, b, a)

Definition at line 208 of file curses.c.

◆ TGETFLAG

#define TGETFLAG (   a)    tgetflag(a)

Definition at line 201 of file curses.c.

◆ TGETNUM

#define TGETNUM (   a)    tgetnum(a)

Definition at line 200 of file curses.c.

◆ TGETSTR

#define TGETSTR (   a,
  bufp 
)    tgetstr(a, bufp)

Definition at line 199 of file curses.c.

◆ TTYIN

#define TTYIN   0

Definition at line 59 of file curses.c.

◆ USE_POSIX_TERMIOS

#define USE_POSIX_TERMIOS   0

Definition at line 100 of file curses.c.

◆ USE_SGTTY

#define USE_SGTTY   0

Definition at line 96 of file curses.c.

◆ USE_TERMCAP

#define USE_TERMCAP   1

Definition at line 196 of file curses.c.

◆ USE_TERMIO

#define USE_TERMIO   0

Definition at line 102 of file curses.c.

Function Documentation

◆ ClearScreen()

◆ CleartoEOLN()

◆ CleartoEOS()

void CleartoEOS ( void  )

◆ cursoroff()

void cursoroff ( void  )

◆ cursoron()

void cursoron ( void  )

◆ EndInverse()

◆ EndWin()

◆ get_arrow_key()

◆ get_termcaps()

◆ highlight_string()

void highlight_string ( int  row,
int  col,
int  size 
)

◆ InitScreen()

int InitScreen ( void  )

Definition at line 343 of file curses.c.

References _colors, InitWin(), MAX, MAX_COLOR, and TRUE.

Referenced by main().

◆ InitWin()

◆ input_pending()

static int input_pending ( int  delay)
static

Definition at line 890 of file curses.c.

References FALSE, STDIN_FILENO, and TRUE.

Referenced by get_arrow_key().

◆ MoveCursor()

◆ outchar()

◆ Raw()

◆ RawState()

int RawState ( void  )

Definition at line 604 of file curses.c.

References _inraw.

Referenced by cancel_article(), check_article_to_be_posted(), and show_progress().

◆ ReadCh()

◆ ScreenSize()

static void ScreenSize ( int *  num_lines,
int *  num_columns 
)
static

Definition at line 152 of file curses.c.

References _columns, _lines, DEFAULT_COLUMNS_ON_TERMINAL, and DEFAULT_LINES_ON_TERMINAL.

Referenced by setup_screen().

◆ ScrollScreen()

void ScrollScreen ( int  lines_to_scroll)

◆ set_keypad_off()

void set_keypad_off ( void  )

Definition at line 394 of file curses.c.

References _keypadlocal, my_flush, outchar(), and tinrc.

Referenced by EndWin().

◆ set_keypad_on()

void set_keypad_on ( void  )

Definition at line 381 of file curses.c.

References _keypadxmit, my_flush, outchar(), and tinrc.

Referenced by InitWin().

◆ set_xclick_off()

◆ set_xclick_on()

void set_xclick_on ( void  )

Definition at line 691 of file curses.c.

References tinrc, TRUE, t_config::use_mouse, and xclick().

Referenced by group_page(), InitWin(), selection_page(), show_page(), and thread_page().

◆ SetScrollRegion()

void SetScrollRegion ( int  topline,
int  bottomline 
)

Definition at line 490 of file curses.c.

References _bottomscrregion, _scrollregion, _topscrregion, have_linescroll, my_flush, outchar(), and TFORMAT.

Referenced by scroll_page().

◆ setup_screen()

void setup_screen ( void  )

Definition at line 170 of file curses.c.

References _line, cCOLS, cLINES, cmd_line, FALSE, Raw(), ScreenSize(), set_win_size(), tinrc, and TRUE.

Referenced by main().

◆ StartInverse()

◆ word_highlight_string()

void word_highlight_string ( int  row,
int  col,
int  size,
int  color 
)

◆ xclick()

static void xclick ( int  state)
static

Definition at line 670 of file curses.c.

References _xclickend, _xclickinit, my_flush, outchar(), and xclicks.

Referenced by set_xclick_off(), and set_xclick_on().

Variable Documentation

◆ _blink

char * _blink
static

Definition at line 111 of file curses.c.

Referenced by get_termcaps(), and word_highlight_string().

◆ _bold

char * _bold
static

Definition at line 111 of file curses.c.

Referenced by get_termcaps(), and word_highlight_string().

◆ _bottomscrregion

int _bottomscrregion
static

Definition at line 487 of file curses.c.

Referenced by ScrollScreen(), and SetScrollRegion().

◆ _clearinverse

char * _clearinverse
static

Definition at line 107 of file curses.c.

Referenced by EndInverse(), and get_termcaps().

◆ _clearscreen

char* _clearscreen
static

Definition at line 106 of file curses.c.

Referenced by ClearScreen(), and get_termcaps().

◆ _cleartoeoln

char * _cleartoeoln
static

Definition at line 106 of file curses.c.

Referenced by CleartoEOLN(), and get_termcaps().

◆ _cleartoeos

char * _cleartoeos
static

Definition at line 106 of file curses.c.

Referenced by CleartoEOS(), and get_termcaps().

◆ _clearunderline

char * _clearunderline
static

Definition at line 107 of file curses.c.

Referenced by get_termcaps().

◆ _colors

int _colors
static

Definition at line 113 of file curses.c.

Referenced by get_termcaps(), and InitScreen().

◆ _columns

int _columns
static

Definition at line 113 of file curses.c.

Referenced by get_termcaps(), and ScreenSize().

◆ _cursoroff

char * _cursoroff
static

Definition at line 108 of file curses.c.

Referenced by cursoroff(), and get_termcaps().

◆ _cursoron

char * _cursoron
static

Definition at line 108 of file curses.c.

Referenced by cursoron(), and get_termcaps().

◆ _dim

char * _dim
static

Definition at line 111 of file curses.c.

Referenced by get_termcaps(), and word_highlight_string().

◆ _hp_glitch

int _hp_glitch = 0

Definition at line 54 of file curses.c.

Referenced by get_termcaps().

◆ _inraw

int _inraw = 0
static

Definition at line 55 of file curses.c.

Referenced by Raw(), and RawState().

◆ _keypadlocal

char * _keypadlocal
static

Definition at line 109 of file curses.c.

Referenced by get_termcaps(), and set_keypad_off().

◆ _keypadxmit

char * _keypadxmit
static

Definition at line 109 of file curses.c.

Referenced by get_termcaps(), and set_keypad_on().

◆ _line

int _line
static

Definition at line 113 of file curses.c.

Referenced by ClearScreen(), CleartoEOS(), MoveCursor(), and setup_screen().

◆ _lines

int _lines
static

Definition at line 113 of file curses.c.

Referenced by CleartoEOS(), get_termcaps(), and ScreenSize().

◆ _moveto

char * _moveto
static

Definition at line 106 of file curses.c.

Referenced by get_termcaps(), and MoveCursor().

◆ _original_tty

TTY _original_tty
static

Definition at line 92 of file curses.c.

Referenced by Raw().

◆ _raw_tty

TTY _raw_tty
static

Definition at line 92 of file curses.c.

Referenced by Raw().

◆ _reset

char * _reset
static

Definition at line 111 of file curses.c.

Referenced by get_termcaps(), and word_highlight_string().

◆ _reversevideo

char * _reversevideo
static

Definition at line 111 of file curses.c.

Referenced by get_termcaps(), and word_highlight_string().

◆ _scrollback

char * _scrollback
static

Definition at line 110 of file curses.c.

Referenced by get_termcaps(), and ScrollScreen().

◆ _scrollfwd

char * _scrollfwd
static

Definition at line 110 of file curses.c.

Referenced by get_termcaps(), and ScrollScreen().

◆ _scrollregion

char * _scrollregion
static

Definition at line 110 of file curses.c.

Referenced by get_termcaps(), and SetScrollRegion().

◆ _setinverse

char * _setinverse
static

Definition at line 107 of file curses.c.

Referenced by get_termcaps(), StartInverse(), and word_highlight_string().

◆ _setunderline

char * _setunderline
static

Definition at line 107 of file curses.c.

Referenced by get_termcaps(), and word_highlight_string().

◆ _terminalend

char * _terminalend
static

Definition at line 109 of file curses.c.

Referenced by EndWin(), and get_termcaps().

◆ _terminalinit

char * _terminalinit
static

Definition at line 109 of file curses.c.

Referenced by get_termcaps(), and InitWin().

◆ _topscrregion

int _topscrregion
static

Definition at line 487 of file curses.c.

Referenced by ScrollScreen(), and SetScrollRegion().

◆ _xclickend

char * _xclickend
static

Definition at line 108 of file curses.c.

Referenced by get_termcaps(), and xclick().

◆ _xclickinit

char * _xclickinit
static

Definition at line 108 of file curses.c.

Referenced by get_termcaps(), and xclick().

◆ cCOLS

◆ cLINES

◆ have_linescroll

t_bool have_linescroll = 0

Definition at line 57 of file curses.c.

Referenced by display_info_page(), draw_page(), get_termcaps(), ScrollScreen(), and SetScrollRegion().

◆ xclicks

int xclicks = 0
static

Definition at line 56 of file curses.c.

Referenced by get_termcaps(), and xclick().