File src/int/term_title.c changed (mode: 100644) (index bf0850926..a33f5342a) |
40 |
40 |
#include "../utils/macros.h" |
#include "../utils/macros.h" |
41 |
41 |
#include "../utils/str.h" |
#include "../utils/str.h" |
42 |
42 |
#include "../utils/string_array.h" |
#include "../utils/string_array.h" |
|
43 |
|
#include "../utils/test_helpers.h" |
43 |
44 |
#include "../utils/utf8.h" |
#include "../utils/utf8.h" |
44 |
45 |
|
|
45 |
46 |
/* Kind of title we're working with. */ |
/* Kind of title we're working with. */ |
|
... |
... |
typedef enum |
52 |
53 |
TitleKind; |
TitleKind; |
53 |
54 |
|
|
54 |
55 |
static void ensure_initialized(void); |
static void ensure_initialized(void); |
55 |
|
static TitleKind get_title_kind(const char term[]); |
|
|
56 |
|
TSTATIC TitleKind get_title_kind(const char term[]); |
56 |
57 |
static void save_term_title(void); |
static void save_term_title(void); |
57 |
58 |
static void restore_term_title(void); |
static void restore_term_title(void); |
58 |
59 |
#if !defined(_WIN32) && defined(HAVE_X11) |
#if !defined(_WIN32) && defined(HAVE_X11) |
|
... |
... |
ensure_initialized(void) |
160 |
161 |
|
|
161 |
162 |
/* Checks if we can alter terminal emulator title. Returns kind of writes we |
/* Checks if we can alter terminal emulator title. Returns kind of writes we |
162 |
163 |
* should do. */ |
* should do. */ |
163 |
|
static TitleKind |
|
|
164 |
|
TSTATIC TitleKind |
164 |
165 |
get_title_kind(const char term[]) |
get_title_kind(const char term[]) |
165 |
166 |
{ |
{ |
166 |
167 |
#ifdef _WIN32 |
#ifdef _WIN32 |
File src/int/term_title.h changed (mode: 100644) (index 62169b219..2c9873284) |
19 |
19 |
#ifndef VIFM__INT__TERM_TITLE_H__ |
#ifndef VIFM__INT__TERM_TITLE_H__ |
20 |
20 |
#define VIFM__INT__TERM_TITLE_H__ |
#define VIFM__INT__TERM_TITLE_H__ |
21 |
21 |
|
|
|
22 |
|
#include "../utils/test_helpers.h" |
|
23 |
|
|
22 |
24 |
/* Determines whether terminal title can be restored. Returns non-zero if so, |
/* Determines whether terminal title can be restored. Returns non-zero if so, |
23 |
25 |
* otherwise zero is returned. */ |
* otherwise zero is returned. */ |
24 |
26 |
int term_title_restorable(void); |
int term_title_restorable(void); |
|
... |
... |
int term_title_restorable(void); |
26 |
28 |
/* Updates terminal title. If title_part is NULL, resets terminal title. */ |
/* Updates terminal title. If title_part is NULL, resets terminal title. */ |
27 |
29 |
void term_title_update(const char title_part[]); |
void term_title_update(const char title_part[]); |
28 |
30 |
|
|
|
31 |
|
#ifdef TEST |
|
32 |
|
/* Kind of title we're working with. */ |
|
33 |
|
typedef enum |
|
34 |
|
{ |
|
35 |
|
TK_ABSENT, /* No title support. */ |
|
36 |
|
TK_REGULAR, /* Normal for the platform (xterm for *nix). */ |
|
37 |
|
TK_SCREEN, /* GNU screen compatible. */ |
|
38 |
|
} |
|
39 |
|
TitleKind; |
|
40 |
|
#endif |
|
41 |
|
TSTATIC_DEFS( |
|
42 |
|
TitleKind get_title_kind(const char term[]); |
|
43 |
|
) |
|
44 |
|
|
29 |
45 |
#endif /* VIFM__INT__TERM_TITLE_H__ */ |
#endif /* VIFM__INT__TERM_TITLE_H__ */ |
30 |
46 |
|
|
31 |
47 |
/* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ |
/* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ |