diff options
author | Po Lu <luangruo@yahoo.com> | 2022-04-19 04:39:37 +0000 |
---|---|---|
committer | Po Lu <luangruo@yahoo.com> | 2022-04-19 04:39:37 +0000 |
commit | d78e4460727c348fb5a5a62b774797c4374a1190 (patch) | |
tree | 77be56944b16623f14cc77b463a9ac1c7baf8ddb /src/haikufont.c | |
parent | 92667cc2fb17af947c202d2de765d8736679e858 (diff) | |
download | emacs-d78e4460727c348fb5a5a62b774797c4374a1190.tar.gz |
Minor cleanups to Haiku menu code
* src/haiku_draw_support.cc (BView_SetHighColorForVisibleBell):
Delete function.
* src/haiku_font_support.cc (BFont_dat): Rename to
`BFont_metrics'.
* src/haiku_support.cc (DrawContent): Use correct UI color for
control text.
* src/haiku_support.h (HAIKU_MODIFIER_ALT): Turn into enum.
(enum haiku_modifier_specification): New enum.
* src/haikufont.c (haikufont_open, haikufont_close): Fix coding
style.
Diffstat (limited to 'src/haikufont.c')
-rw-r--r-- | src/haikufont.c | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/src/haikufont.c b/src/haikufont.c index 4e81e577039..960ca466bc0 100644 --- a/src/haikufont.c +++ b/src/haikufont.c @@ -727,10 +727,10 @@ haikufont_open (struct frame *f, Lisp_Object font_entity, int x) avg_width, height, space_width, ascent, descent, underline_pos, underline_thickness; - BFont_dat (be_font, &px_size, &min_width, - &max_width, &avg_width, &height, - &space_width, &ascent, &descent, - &underline_pos, &underline_thickness); + BFont_metrics (be_font, &px_size, &min_width, + &max_width, &avg_width, &height, + &space_width, &ascent, &descent, + &underline_pos, &underline_thickness); font->pixel_size = px_size; font->min_width = min_width; @@ -757,22 +757,31 @@ haikufont_open (struct frame *f, Lisp_Object font_entity, int x) static void haikufont_close (struct font *font) { + struct haikufont_info *info = (struct haikufont_info *) font; + int i; + if (font_data_structures_may_be_ill_formed ()) return; - struct haikufont_info *info = (struct haikufont_info *) font; block_input (); if (info && info->be_font) BFont_close (info->be_font); - for (int i = 0; i < info->metrics_nrows; i++) - if (info->metrics[i]) - xfree (info->metrics[i]); + for (i = 0; i < info->metrics_nrows; i++) + { + if (info->metrics[i]) + xfree (info->metrics[i]); + } + if (info->metrics) xfree (info->metrics); - for (int i = 0; i < 0x100; ++i) - if (info->glyphs[i]) - xfree (info->glyphs[i]); + + for (i = 0; i < 0x100; ++i) + { + if (info->glyphs[i]) + xfree (info->glyphs[i]); + } + xfree (info->glyphs); unblock_input (); } |