File: display.h

package info (click to toggle)
horst 5.1-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 932 kB
  • sloc: ansic: 9,261; makefile: 109; sh: 28
file content (92 lines) | stat: -rw-r--r-- 3,026 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/* horst - Highly Optimized Radio Scanning Tool
 *
 * Copyright (C) 2005-2016 Bruno Randolf (br1@einfach.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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */

#ifndef _DISPLAY_H_
#define _DISPLAY_H_

#include <curses.h>

#define WHITE		COLOR_PAIR(1)
#define GREEN		COLOR_PAIR(2)
#define RED		COLOR_PAIR(3)
#define CYAN		COLOR_PAIR(4)
#define BLUE		COLOR_PAIR(5)
#define BLACKONWHITE	COLOR_PAIR(6)
#define MAGENTA		COLOR_PAIR(7)
#define ALLGREEN	COLOR_PAIR(8)
#define ALLRED		COLOR_PAIR(9)
#define ALLBLUE		COLOR_PAIR(10)
#define ALLCYAN		COLOR_PAIR(11)
#define YELLOW		COLOR_PAIR(12)
#define ALLYELLOW	COLOR_PAIR(13)
#define WHITEONRED	COLOR_PAIR(14)

#define CHECKED(_exp) (_exp) ? '*' : ' '

#define FILTER_WIN_WIDTH	56
#define FILTER_WIN_HEIGHT	35

#define CHANNEL_WIN_WIDTH	41
#define CHANNEL_WIN_HEIGHT	31

struct packet_info;
struct node_info;

void get_per_second(unsigned long bytes, unsigned long duration,
		    unsigned long packets, unsigned long retries,
		    int *bps, int *dps, int *pps, int *rps);
void __attribute__ ((format (printf, 4, 5)))
print_centered(WINDOW* win, int line, int cols, const char *fmt, ...);
int get_packet_type_color(int type);
void signal_average_bar(WINDOW *win, int sig, int siga, int y, int x,
			int height, int width);
void general_average_bar(WINDOW *win, int val, int avg, int y, int x,
			 int width, short color, short color_avg);
void update_display(struct packet_info* pkg);
void update_display_clock(void);
void display_log(const char *string);
void handle_user_input(void);
void init_display(void);
void finish_display(void);
void display_clear(void);

/* main windows are special */
void init_display_main(void);
void clear_display_main(void);
void update_main_win(struct packet_info *pkt);
void update_dump_win(struct packet_info* pkt);
bool main_input(int c);
void print_dump_win(const char *str, int refresh);
void resize_display_main(void);

/* smaller config windows */
void update_filter_win(WINDOW *win);
void update_channel_win(WINDOW *win);
bool filter_input(WINDOW *win, int c);
bool channel_input(WINDOW *win, int c);

/* "standard" windows */
void update_spectrum_win(WINDOW *win);
void update_statistics_win(WINDOW *win);
void update_essid_win(WINDOW *win);
void update_history_win(WINDOW *win);
void update_help_win(WINDOW *win);
bool spectrum_input(WINDOW *win, int c);

#endif