| 1 |
/*************************************************************************** |
/* SPDX-License-Identifier: GPL-3.0-or-later */ |
| 2 |
screen.h - description |
/* |
| 3 |
------------------- |
* screen |
| 4 |
copyright : (C) 2004-2025 by Leaflet |
* - advanced telnet-based user interactive input / output features |
| 5 |
email : leaflet@leafok.com |
* |
| 6 |
***************************************************************************/ |
* Copyright (C) 2004-2026 Leaflet <leaflet@leafok.com> |
| 7 |
|
*/ |
|
/*************************************************************************** |
|
|
* * |
|
|
* 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 3 of the License, or * |
|
|
* (at your option) any later version. * |
|
|
* * |
|
|
***************************************************************************/ |
|
| 8 |
|
|
| 9 |
#ifndef _SCREEN_H_ |
#ifndef _SCREEN_H_ |
| 10 |
#define _SCREEN_H_ |
#define _SCREEN_H_ |
| 11 |
|
|
| 12 |
|
#include "io.h" |
| 13 |
#include <stddef.h> |
#include <stddef.h> |
| 14 |
|
|
| 15 |
#define CTRL_SEQ_CLR_LINE "\033[K" |
extern const char CTRL_SEQ_CLR_LINE[]; |
| 16 |
#define MSG_EXT_MAX_LEN 200 |
|
| 17 |
|
enum display_constant_t |
| 18 |
|
{ |
| 19 |
|
MSG_EXT_MAX_LEN = 400, |
| 20 |
|
}; |
| 21 |
|
|
| 22 |
struct display_ctx_t |
struct display_ctx_t |
| 23 |
{ |
{ |
| 38 |
extern void clearscr(); |
extern void clearscr(); |
| 39 |
|
|
| 40 |
extern int press_any_key(); |
extern int press_any_key(); |
| 41 |
|
extern int press_any_key_ex(const char *msg, int sec); |
| 42 |
|
|
| 43 |
extern void set_input_echo(int echo); |
extern void set_input_echo(int echo); |
| 44 |
|
|
| 45 |
extern int str_input(char *buffer, int buffer_length, int echo_mode); |
extern int str_input(char *buffer, int buffer_length, enum io_echo_t echo_mode); |
| 46 |
extern int get_data(int row, int col, char *prompt, char *buffer, int buffer_length, int echo_mode); |
extern int get_data(int row, int col, char *prompt, char *buffer, int buffer_length, int max_display_len); |
| 47 |
|
|
| 48 |
// eof_exit = 0 : Do not exit at EOF |
// eof_exit = 0 : Do not exit at EOF |
| 49 |
// 1 : Prompt for any key at EOF, then exit |
// 1 : Prompt for any key at EOF, then exit |
| 52 |
display_data_key_handler key_handler, const char *help_filename); |
display_data_key_handler key_handler, const char *help_filename); |
| 53 |
extern int display_file(const char *filename, int eof_exit); |
extern int display_file(const char *filename, int eof_exit); |
| 54 |
|
|
| 55 |
|
extern int display_file_key_handler(int *p_key, DISPLAY_CTX *p_ctx); |
| 56 |
|
|
| 57 |
extern int show_top(const char *str_left, const char *str_center, const char *str_right); |
extern int show_top(const char *str_left, const char *str_center, const char *str_right); |
| 58 |
extern int show_bottom(const char *msg); |
extern int show_bottom(const char *msg); |
| 59 |
|
|