Struct · ui::hooks

ui::hooks::Hooks

On this page
aurore/cadran/ui/hooks.hpp
#include <aurore/cadran/ui/hooks.hpp>

struct ui::hooks::Hooks

Description

What Cadran asks of the app, filled in once at start-up (get()). Each hook left empty does nothing.

Attributes 25

std::function< bool(aurore::Activity *activity)> is_main

The main screen.

activity is it

hooks.hpp:24
std::function< void(aurore::Activity *main, int position, const std::string &row)> open_tab
std::function< void(aurore::Activity *main)> update_title
std::function< void(int position, const std::string &row)> push_main

A new main screen, pushed, on tab position, the focus on row.

hooks.hpp:28
std::function< void()> refresh_shown

The tabs: re-read the one shown, the name of the screen shown and of the main screen's tab ("tab/about"), and whether a view is a tab.

hooks.hpp:32
std::function< std::string()> shown_screen
std::function< std::string()> main_screen
std::function< bool(aurore::View *view)> is_tab
std::function< int(const std::string &screen)> tab_position

The sidebar position of the tab whose screen name is screen, -1 when there is none; and the position to fall back on.

hooks.hpp:39
std::function< int()> settings_tab
std::function< std::vector< std::string >()> rail_icons

The rail's icons (cadran/view/cadran_icon), one per sidebar position, "" for a separator.

hooks.hpp:43
std::function< std::string()> version

The app: its version and commit (the header's badge), whether it is a release, and whether it writes nothing for now (a read-only mode: the header's pill says so).

hooks.hpp:48
std::function< std::string()> commit
std::function< bool()> is_release
std::function< bool()> read_only
std::function< void(NVGcontext *vg, float w, float h)> mark

The app's logo, drawn in a w × h box at (0, 0) (CadranIcon "mark": the header's, the about screen's). Unset: Aurore's.

hooks.hpp:54
std::function< bool(cadran::PillMode &mode)> pill

A mode of the app the main screen's pill says over every screen: fills mode in and returns true while it lasts (parental controls paused, unlocked…). Unset or false: the screen's own words, or read-only.

hooks.hpp:58
std::function< std::vector< std::pair< const char *, const char * > >()> screen_icons

The icons of the lines of the app's own screens that Cadran dresses (a DetailCell's id, a CadranIcon's name), besides Aurore's.

hooks.hpp:61
std::function< std::string(const std::string &screen)> tab_title

The title of the main screen's tab screen ("tab/about"), for the crumb of a screen opened from it. Unset: none.

hooks.hpp:64
std::function< bool(aurore::View *frame)> standalone_screen

Whether frame (a screen's root view) is a screen of its own, not a step from the one under it: a child's screen, a lock screen. It gets no crumb and no version badge (cadran::is_standalone_screen). Unset: the screens holding a view with the id "cadran/standalone".

hooks.hpp:69
std::function< std::string()> today

Today, "2026-10-08", by the app's own clock (the console's user clock). Unset: the system's local date.

hooks.hpp:72
std::function< std::string()> themes_dir

The folder of the user's own theme files (*.theme, docs/themes.md), listed by the theme picker after Aurore's presets: the app's, such as "sdmc:/config/<app>/themes". Unset: the presets only.

hooks.hpp:77
std::function< bool()> save_prefs

Saves ui::prefs() (the language, theme, text size and effects chosen): false when it cannot be saved at all. Unset: the choice lasts until the app quits.

hooks.hpp:82
std::function< void()> send_report

Send a report, offered by a failure's dialog. Unset: not offered.

hooks.hpp:84
std::function< bool(const char *name)> env_flag

A flag of the app's environment, for its tests (name: "STILL_FOCUS", "CADRAN_NOGLOW", "FOCUS_LOG", "CUT_TEXT", "DOCKED", "BATTERY"). Unset: the process environment's AURORE_<name> ("1", "true" or "yes"), in a build with AURORE_DEV_TOOLS (not a release one, by default), never on the console.

hooks.hpp:91

Read from Aurore's headers by Doxygen at each build · library/include