2016-05-02 05:29:21 +00:00
|
|
|
// Generic output functions.
|
|
|
|
//
|
|
|
|
// Constants for various character classifications. Each character of a command string can be
|
|
|
|
// classified as one of the following types.
|
2005-10-04 15:11:39 +00:00
|
|
|
#ifndef FISH_OUTPUT_H
|
|
|
|
#define FISH_OUTPUT_H
|
|
|
|
|
2023-05-28 23:13:54 +00:00
|
|
|
#include <stdint.h>
|
2016-04-21 06:00:54 +00:00
|
|
|
|
2016-05-02 05:29:21 +00:00
|
|
|
#include "color.h"
|
2005-10-04 15:11:39 +00:00
|
|
|
|
2023-05-28 23:13:54 +00:00
|
|
|
#if INCLUDE_RUST_HEADERS
|
|
|
|
#include "output.rs.h"
|
|
|
|
#else
|
|
|
|
// Hacks to allow us to compile without Rust headers.
|
|
|
|
struct outputter_t;
|
|
|
|
#endif
|
2005-09-20 13:26:39 +00:00
|
|
|
|
2023-10-08 21:22:27 +00:00
|
|
|
#include "env.h"
|
|
|
|
|
2019-11-19 00:54:36 +00:00
|
|
|
rgb_color_t parse_color(const env_var_t &var, bool is_background);
|
2005-09-20 13:26:39 +00:00
|
|
|
|
2016-05-02 05:29:21 +00:00
|
|
|
/// Sets what colors are supported.
|
|
|
|
enum { color_support_term256 = 1 << 0, color_support_term24bit = 1 << 1 };
|
2023-05-28 23:13:54 +00:00
|
|
|
using color_support_t = uint8_t;
|
2023-05-16 19:46:16 +00:00
|
|
|
extern "C" {
|
2023-05-28 23:13:54 +00:00
|
|
|
color_support_t output_get_color_support();
|
|
|
|
void output_set_color_support(color_support_t val);
|
2023-05-16 19:46:16 +00:00
|
|
|
}
|
2012-02-13 17:52:17 +00:00
|
|
|
|
2019-11-19 00:54:36 +00:00
|
|
|
rgb_color_t best_color(const std::vector<rgb_color_t> &candidates, color_support_t support);
|
2014-11-10 00:42:35 +00:00
|
|
|
|
2023-05-28 23:13:54 +00:00
|
|
|
// Temporary to support builtin set_color.
|
|
|
|
void writembs_nofail(outputter_t &outp, const char *str);
|
|
|
|
void writembs(outputter_t &outp, const char *str);
|
2013-02-14 23:50:24 +00:00
|
|
|
|
2005-10-04 15:11:39 +00:00
|
|
|
#endif
|