summaryrefslogtreecommitdiffstats
path: root/libalx/inc/alx_ncur.h
blob: f1a774fcd07afba08f321825e75ab979d06acf52 (plain) (blame)
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
93
94
95
96
97
98
99
100
/******************************************************************************
 *	Copyright (C) 2017	Alejandro Colomar Andrés		      *
 ******************************************************************************/


/******************************************************************************
 ******* include guard ********************************************************
 ******************************************************************************/
# ifndef		ALX_NCUR_H
	# define	ALX_NCUR_H


/******************************************************************************
 ******* headers **************************************************************
 ******************************************************************************/
	#include <ncurses.h>
	#include <stdint.h>


/******************************************************************************
 ******* structs **************************************************************
 ******************************************************************************/
	struct	Alx_Menu {
		int	r;
		int	c;
		char	*t;
	};


/******************************************************************************
 ******* functions ************************************************************
 ******************************************************************************/
	void	alx_start_curses	(void);
	void	alx_pause_curses	(void);
	void	alx_resume_curses	(void);
	void	alx_end_curses		(void);
	void	alx_win_del		(WINDOW		*win);

	int	alx_menu		(int		h,
					int		w,
					int		N,
					struct Alx_Menu	mnu[N],
					const char	*str);

	int	alx_menu_2		(WINDOW		*win,
					int		N,
					struct Alx_Menu	mnu[N],
					const char	*str);

	double	alx_w_getdbl		(int		w,
					int		r,
					const char	*title,
					double		m,
					double		def,
					double		M,
					const char	*format,
							...);

	int64_t	alx_w_getint		(int		w,
					int		r,
					const char	*title,
					double		m,
					int64_t		def,
					double		M,
					const char	*format,
							...);

	void	alx_w_getstr		(char		*dest,
					int		destsize,
					int		w,
					int		r,
					const char	*title,
					const char	*format,
							...);

	void	alx_w_getfname		(const char	*fpath,
					char		*fname,
					bool		exist,
					int		w,
					int		r,
					const char	*title,
					const char	*format,
							...);

	void	alx_ncur_prn_title	(WINDOW		*win,
					const char	*title);

	void	alx_ncur_prn_subtitle	(WINDOW		*win,
					const char	*subtitle);


/******************************************************************************
 ******* include guard ********************************************************
 ******************************************************************************/
# endif			/* alx_ncur.h */


/******************************************************************************
 ******* end of file **********************************************************
 ******************************************************************************/