fbtext.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /* Framebuffer text: draw characters into VESA LFB. 8x16 font, VGA attribute colors. */
  2. #ifndef FBTEXT_H
  3. #define FBTEXT_H
  4. void fbtext_init(void);
  5. int fbtext_active(void); /* 1 if using LFB, 0 if VGA text path */
  6. unsigned int fbtext_get_cols(void);
  7. unsigned int fbtext_get_rows(void);
  8. void fbtext_clear(void);
  9. void fbtext_put_char_at(unsigned int col, unsigned int row, unsigned char c, unsigned char attr);
  10. /* Blit a cell buffer (cells of (attr<<8)|ch) into the shadow buffer at pixel
  11. origin (x0, y0). 8 px per column, 10 px per row. */
  12. void fbtext_draw_cells(const unsigned short *cells, unsigned int cols, unsigned int rows,
  13. unsigned int x0, unsigned int y0);
  14. /* Same, but only cells whose (cell-aligned) bounds intersect the clip rect
  15. (cx, cy, cw, ch). */
  16. void fbtext_draw_cells_clip(const unsigned short *cells, unsigned int cols, unsigned int rows,
  17. unsigned int x0, unsigned int y0,
  18. unsigned int cx, unsigned int cy, unsigned int cw, unsigned int ch);
  19. void fbtext_scroll_up_one_line(void);
  20. void fbtext_set_cursor(unsigned int col, unsigned int row);
  21. void fbtext_show_cursor(void);
  22. /* Hide cursor and redraw cell with (c, attr) so the character is restored. */
  23. void fbtext_hide_cursor(unsigned char c, unsigned char attr);
  24. /* Draw string at pixel (x0, y0) with fg RGB. transparent_bg 1 = only fg pixels (overlays). */
  25. void fbtext_draw_string_xy(unsigned int x0, unsigned int y0, const char *str,
  26. unsigned int r_fg, unsigned int g_fg, unsigned int b_fg, int transparent_bg);
  27. /* Same, but per-pixel clipped to (cx, cy, cw, ch): pixels outside the clip
  28. * are never written (used by the window manager's damage-rect repaints). */
  29. void fbtext_draw_string_xy_clip(unsigned int x0, unsigned int y0, const char *str,
  30. unsigned int r_fg, unsigned int g_fg, unsigned int b_fg,
  31. unsigned int cx, unsigned int cy, unsigned int cw, unsigned int ch);
  32. /* Draw a rainbow gradient line just below the header row (between header and content). No-op if not LFB. */
  33. void fbtext_draw_rainbow_separator(void);
  34. #endif