SatCat5
file_display.h
1 // Copyright 2024-2025 The Aerospace Corporation.
3 // This file is a part of SatCat5, licensed under CERN-OHL-W v2 or later.
5 // Implement the gui::Display API using a temporary file.
6 
7 #pragma once
8 
9 #include <cstdio>
10 #include <satcat5/gui_display.h>
11 
12 namespace satcat5 {
13  namespace gui {
25  public:
27  FileDisplay(const char* filename,
28  u16 rows = 40, u16 cols = 80);
29  ~FileDisplay();
30 
33  static constexpr LogColors LOG_COLORS =
34  {' ', '*', ' ', 'E', ' ', 'W', ' ', 'I', ' ', 'D'};
35 
36  protected:
38  bool draw(
39  const satcat5::gui::Cursor& cursor,
40  const satcat5::gui::DrawCmd& cmd) override;
41 
42  // Current file object
43  FILE* m_file;
44  };
45  }
46 }
Required API for display devices.
Definition: gui_display.h:105
Each "draw command" updates a rectangular region of pixels.
Definition: gui_display.h:61
Implement the gui::Display API using a temporary file.
Definition: file_display.h:24
bool draw(const satcat5::gui::Cursor &cursor, const satcat5::gui::DrawCmd &cmd) override
Implement the required draw() method.
Definition: file_display.cc:41
static constexpr LogColors LOG_COLORS
"Color" parameters for this display are actually characters.
Definition: file_display.h:33
FileDisplay(const char *filename, u16 rows=40, u16 cols=80)
Create a "display" using the specified file.
Definition: file_display.cc:19
"Display" and "Canvas" API for rendering text and graphics
Cursor object tracks position and foreground/background colors.
Definition: gui_display.h:33
Color parameters for the LogToDisplay class.
Definition: gui_display.h:237