26 #define AW_FONTINFO_CHAR_ASCII_MIN 32
27 #define AW_FONTINFO_CHAR_ASCII_MAX 127
29 #define GC_DEFAULT_LINE_WIDTH 1
54 grey_level = grey_level_;
82 short width_of_chars[256];
83 short ascent_of_chars[256];
84 short descent_of_chars[256];
89 void init_char_widths() {
90 memset(width_of_chars, 0,
ARRAY_ELEMS(width_of_chars)*
sizeof(*width_of_chars));
91 memset(ascent_of_chars, 0,
ARRAY_ELEMS(ascent_of_chars)*
sizeof(*ascent_of_chars));
92 memset(descent_of_chars, 0,
ARRAY_ELEMS(descent_of_chars)*
sizeof(*descent_of_chars));
95 void set_effective_color();
97 virtual void wm_set_foreground_color(
AW_rgb col) = 0;
99 virtual void wm_set_lineattributes(
short lwidth,
AW_linestyle lstyle) = 0;
100 virtual void wm_set_font(
AW_font font_nr,
int size,
int *found_size) = 0;
105 ascent_of_chars[i] = ascent;
106 descent_of_chars[i] = descent;
107 width_of_chars[i] = width;
108 font_limits.
notify(ascent, descent, width);
111 ascent_of_chars[i] = 0;
112 descent_of_chars[i] = 0;
113 width_of_chars[i] = 0;
119 default_config(
NULp),
127 virtual ~AW_GC() {
delete default_config; }
155 if (
function != mode) {
156 wm_set_function(mode);
158 set_effective_color();
197 for (
int i = 0; i<count; ++i)
delete gcs[i];
201 for (
int i = 0; i<count; ++i) {
202 if (gcs[i]) gcs[i]->
reset();
205 bool gc_mapable(
int gc)
const {
return gc<count && gcs[gc]; }
216 long& data_colors_size;
222 virtual AW_GC *create_gc() = 0;
228 : frame_colors(fcolors),
229 data_colors(dcolors),
230 data_colors_size(dcolors_count)
255 return color>=
AW_DATA_BG ? data_colors[color] : frame_colors[color];
278 inline void AW_GC::set_effective_color() {
280 if (col != last_fg_color) {
282 wm_set_foreground_color(col);
287 #error aw_common.hxx included twice
288 #endif // AW_COMMON_HXX
AW_rgb get_last_fg_color() const
AW_linestyle get_line_style() const
short get_width_of_char(char c) const
const AW_screen_area & get_screen() const
int get_string_size(long textlen) const
void set_line_attributes(short new_width, AW_linestyle new_style)
CONSTEXPR_INLINE unsigned char safeCharIndex(char c)
short get_line_width() const
void set_screen_size(unsigned int width, unsigned int height)
void set_font(AW_font font_nr, int size, int *found_size)
bool gc_mapable(int gc) const
AW_GC(AW_common *common_)
int find_data_color_idx(AW_rgb color) const
AW_GC * map_mod_gc(int gc)
int get_data_color_size() const
virtual int get_available_fontsizes(AW_font font_nr, int *available_sizes) const =0
void add_gc(int gi, AW_GC *agc)
void apply_config(const AW_GC_config &conf)
#define ARRAY_ELEMS(array)
bool operator==(const AW_GC_config &other) const
void set_screen(const AW_screen_area &screen_)
short get_ascent_of_char(char c) const
AW_GC * map_mod_gc(int gc)
void notify(short ascent_, short descent_, short width_)
AW_font get_fontnr() const
void set_grey_level(AW_grey_level grey_level_)
AW_rgb get_fg_color() const
void set_char_size(int i, int ascent, int descent, int width)
const AW_GC * map_gc(int gc) const
AW_grey_level get_grey_level() const
short get_fontsize() const
AW_common * get_common() const
AW_common(AW_rgb *&fcolors, AW_rgb *&dcolors, long &dcolors_count)
bool gc_mapable(int gc) const
const AW_font_limits & get_font_limits(int gc, char c) const
void set_fg_color(AW_rgb col)
const AW_font_limits & get_font_limits(char c) const
const AW_GC * map_gc(int gc) const
AW_function get_function() const
void set_function(AW_function mode)
#define GC_DEFAULT_LINE_WIDTH
const AW_font_limits & get_font_limits() const
short get_descent_of_char(char c) const
AW_rgb get_data_color(int i) const
void set_no_char_size(int i)
AW_rgb get_XOR_color() const
AW_rgb get_color(AW_color_idx color) const