CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
Loading...
Searching...
No Matches
MarkdownView.cpp File Reference
#include "cdc_views/MarkdownView.h"
#include "cdc_views/Fonts.h"
#include "cdc_views/KeyCodes.h"
#include "cdc_views/LayoutConstants.h"
#include "cdc_views/HtmlViewerHook.h"
#include "cdc_views/MarkdownParser.h"
#include "cdc_views/RenderHelpers.h"
#include "cdc_ui/I18n.h"
#include "cdc_ui/ViewStack.h"
#include "cdc_hal/IDisplay.h"
#include "cdc_log.h"
#include <goodisplay/gdey029T94.h>
#include <cstring>
#include <cstdio>

Go to the source code of this file.

Namespaces

namespace  cdc
namespace  cdc::ui
 Centralized key-code constants for cdc_views.

Functions

MarkdownViewcdc::ui::showMarkdown (const char *title, const char *src, size_t len)
 Parses and shows a Markdown source on the view stack.
MarkdownViewcdc::ui::showPlainText (const char *title, const char *src, size_t len)
 Shows a source as plain, unrendered text on the view stack.

Variables

static const char * TAG = "MarkdownView"
static constexpr int TITLE_Y = 5
static constexpr int TEXT_START_Y = 28
static constexpr int TEXT_MARGIN = 8
static constexpr int INDENT_PX = 10
static constexpr int BLANK_HEIGHT = 6
static constexpr int RULE_HEIGHT = 10
static MarkdownView cdc::ui::s_sharedMarkdownView
constexpr int FOOTER_HEIGHT
 Footer bar height in pixels (used by drawFooterBar).
constexpr int SCROLL_INDICATOR_WIDTH
 Scroll indicator column width in pixels.

Variable Documentation

◆ BLANK_HEIGHT

int BLANK_HEIGHT = 6
staticconstexpr

Definition at line 31 of file MarkdownView.cpp.

Referenced by cdc::ui::MarkdownView::render().

◆ FOOTER_HEIGHT

Footer bar height in pixels (used by drawFooterBar).

Definition at line 21 of file LayoutConstants.h.

◆ INDENT_PX

int INDENT_PX = 10
staticconstexpr

◆ RULE_HEIGHT

int RULE_HEIGHT = 10
staticconstexpr

Definition at line 32 of file MarkdownView.cpp.

Referenced by cdc::ui::MarkdownView::render().

◆ SCROLL_INDICATOR_WIDTH

Scroll indicator column width in pixels.

Definition at line 26 of file LayoutConstants.h.

◆ TAG

const char* TAG = "MarkdownView"
static

MarkdownView Implementation

Renders a parsed Markdown source as scrollable, multi-font visual rows.

Definition at line 25 of file MarkdownView.cpp.

◆ TEXT_MARGIN

int TEXT_MARGIN = 8
staticconstexpr

Definition at line 29 of file MarkdownView.cpp.

◆ TEXT_START_Y

int TEXT_START_Y = 28
staticconstexpr

Definition at line 28 of file MarkdownView.cpp.

◆ TITLE_Y

int TITLE_Y = 5
staticconstexpr

Definition at line 27 of file MarkdownView.cpp.