2016-05-01 22:29:21 -07: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-05 01:11:39 +10:00
|
|
|
#ifndef FISH_OUTPUT_H
|
|
|
|
#define FISH_OUTPUT_H
|
|
|
|
|
2023-05-28 16:13:54 -07:00
|
|
|
#include <stdint.h>
|
2016-04-20 23:00:54 -07:00
|
|
|
|
2016-05-01 22:29:21 -07:00
|
|
|
#include "color.h"
|
2005-10-05 01:11:39 +10:00
|
|
|
|
2023-05-28 16:13:54 -07: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 23:26:39 +10:00
|
|
|
|
2023-10-08 23:22:27 +02:00
|
|
|
#include "env.h"
|
|
|
|
|
2019-11-18 16:54:36 -08:00
|
|
|
rgb_color_t parse_color(const env_var_t &var, bool is_background);
|
2005-09-20 23:26:39 +10:00
|
|
|
|
2016-05-01 22:29:21 -07:00
|
|
|
/// Sets what colors are supported.
|
|
|
|
enum { color_support_term256 = 1 << 0, color_support_term24bit = 1 << 1 };
|
2023-05-28 16:13:54 -07:00
|
|
|
using color_support_t = uint8_t;
|
2023-05-16 14:46:16 -05:00
|
|
|
extern "C" {
|
2023-05-28 16:13:54 -07:00
|
|
|
color_support_t output_get_color_support();
|
|
|
|
void output_set_color_support(color_support_t val);
|
2023-05-16 14:46:16 -05:00
|
|
|
}
|
2012-02-13 09:52:17 -08:00
|
|
|
|
2019-11-18 16:54:36 -08:00
|
|
|
rgb_color_t best_color(const std::vector<rgb_color_t> &candidates, color_support_t support);
|
2014-11-09 16:42:35 -08:00
|
|
|
|
2023-05-28 16:13:54 -07: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 15:50:24 -08:00
|
|
|
|
2005-10-05 01:11:39 +10:00
|
|
|
#endif
|