FlatImage
A configurable Linux containerization system
Loading...
Searching...
No Matches
ns_desktop::anonymous_namespace{desktop.hpp} Namespace Reference

Functions

Value< std::pair< fs::path, fs::path > > get_path_file_icon_png (std::string_view name_app, uint32_t size)
 Constructs the path to the png icon file.
 
Value< std::pair< fs::path, fs::path > > get_path_file_icon_svg (std::string_view name_app)
 Constructs the path to the svg icon file.
 
Value< fs::path > get_path_file_desktop (ns_db::ns_desktop::Desktop const &desktop)
 Get the file path to the desktop entry.
 
Value< fs::path > get_path_file_mimetype (ns_db::ns_desktop::Desktop const &desktop)
 Get the file path to the application specific mimetype file.
 
Value< fs::path > get_path_file_mimetype_generic ()
 Get the file path to the generic mimetype file.
 
Value< void > generate_desktop_entry (ns_db::ns_desktop::Desktop const &desktop, fs::path const &path_file_binary, std::ostream &os)
 Generates the desktop entry.
 
Value< void > integrate_desktop_entry (ns_db::ns_desktop::Desktop const &desktop, fs::path const &path_file_binary)
 Integrates the desktop entry '.desktop'.
 
bool is_update_mime_database (fs::path const &path_file_binary, fs::path const &path_entry_mimetype)
 Checks if the mime database should be updated based on <glob pattern=
 
Value< void > update_mime_database ()
 Runs update-mime-database on the current XDG_DATA_HOME diretory.
 
Value< void > integrate_mime_database_generic ()
 Generates the flatimage generic mime package.
 
Value< void > generate_mime_database (ns_db::ns_desktop::Desktop const &desktop, fs::path const &path_file_binary, std::ostream &os)
 Generates the flatimage app specific mime package.
 
Value< void > integrate_mime_database (ns_db::ns_desktop::Desktop const &desktop, fs::path const &path_file_binary)
 Generates the flatimage app specific mime package.
 
Value< void > integrate_icons_svg (ns_db::ns_desktop::Desktop const &desktop, fs::path const &path_file_icon)
 Integrates an svg icon for the flatimage mimetype.
 
Value< void > integrate_icons_png (ns_db::ns_desktop::Desktop const &desktop, fs::path const &path_file_icon)
 Integrates PNG icons for the flatimage mimetype.
 
Value< void > integrate_icon_flatimage ()
 Integrates the svg icon for the 'flatimage' mimetype.
 
Value< void > integrate_icons (ns_config::FlatImage const &fim, ns_db::ns_desktop::Desktop const &desktop)
 Integrate flatimage icons in the current $HOME directory.
 

Variables

constexpr std::string_view const template_dir_mimetype = "icons/hicolor/{}x{}/mimetypes"
 
constexpr std::string_view const template_file_mime = "application-flatimage_{}.png"
 
constexpr std::string_view const template_dir_apps = "icons/hicolor/{}x{}/apps"
 
constexpr std::string_view const template_file_app = "flatimage_{}.png"
 
constexpr std::string_view const template_dir_mime_scalable = "icons/hicolor/scalable/mimetypes"
 
constexpr std::string_view const template_file_mime_scalable = "application-flatimage_{}.svg"
 
constexpr std::string_view const template_dir_apps_scalable = "icons/hicolor/scalable/apps"
 
constexpr std::string_view const template_file_app_scalable = "flatimage_{}.svg"
 
constexpr const std::array< uint32_t, 9 > arr_sizes {16,22,24,32,48,64,96,128,256}
 

Function Documentation

◆ generate_desktop_entry()

Value< void > ns_desktop::anonymous_namespace{desktop.hpp}::generate_desktop_entry ( ns_db::ns_desktop::Desktop const & desktop,
fs::path const & path_file_binary,
std::ostream & os )
nodiscard

Generates the desktop entry.

Parameters
desktopDesktop integration class
path_file_binaryPath to the flatimage binary
osThe output stream in which to write the desktop entry
Returns
Value<void> Nothing on success, or the respective error

Definition at line 140 of file desktop.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ generate_mime_database()

Value< void > ns_desktop::anonymous_namespace{desktop.hpp}::generate_mime_database ( ns_db::ns_desktop::Desktop const & desktop,
fs::path const & path_file_binary,
std::ostream & os )
inlinenodiscard

Generates the flatimage app specific mime package.

Parameters
desktopThe desktop object
path_file_binaryThe path to the flatimage binary
osThe output stream in which to write the mime package

Definition at line 254 of file desktop.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_path_file_desktop()

Value< fs::path > ns_desktop::anonymous_namespace{desktop.hpp}::get_path_file_desktop ( ns_db::ns_desktop::Desktop const & desktop)
nodiscard

Get the file path to the desktop entry.

Returns
Value<fs::path> The path to the desktop entry file, or the respective error

Definition at line 104 of file desktop.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_path_file_icon_png()

Value< std::pair< fs::path, fs::path > > ns_desktop::anonymous_namespace{desktop.hpp}::get_path_file_icon_png ( std::string_view name_app,
uint32_t size )
nodiscard

Constructs the path to the png icon file.

Parameters
name_appThe flatimage application name
sizeThe size of the icon, e.g., 32x32, 64x64
Returns
Value<std::pair<fs::path,fs::path>> Paths to the mime type and application icons, or the respective error

Definition at line 70 of file desktop.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_path_file_icon_svg()

Value< std::pair< fs::path, fs::path > > ns_desktop::anonymous_namespace{desktop.hpp}::get_path_file_icon_svg ( std::string_view name_app)
nodiscard

Constructs the path to the svg icon file.

Parameters
name_appThe flatimage application name
Returns
Value<std::pair<fs::path,fs::path>> Paths to the mime type and application icons, or the respective error

Definition at line 88 of file desktop.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_path_file_mimetype()

Value< fs::path > ns_desktop::anonymous_namespace{desktop.hpp}::get_path_file_mimetype ( ns_db::ns_desktop::Desktop const & desktop)
nodiscard

Get the file path to the application specific mimetype file.

Returns
Value<fs::path> The path to the mimetype file, or the respective error

Definition at line 115 of file desktop.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_path_file_mimetype_generic()

Value< fs::path > ns_desktop::anonymous_namespace{desktop.hpp}::get_path_file_mimetype_generic ( )
nodiscard

Get the file path to the generic mimetype file.

Returns
Value<fs::path> The path to the generic mimetype file, or the respective error

Definition at line 126 of file desktop.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ integrate_desktop_entry()

Value< void > ns_desktop::anonymous_namespace{desktop.hpp}::integrate_desktop_entry ( ns_db::ns_desktop::Desktop const & desktop,
fs::path const & path_file_binary )
nodiscard

Integrates the desktop entry '.desktop'.

Parameters
desktopDesktop integration class
path_file_binaryPath to the flatimage binary
Returns
Value<void> Nothing on success, or the respective error

Definition at line 163 of file desktop.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ integrate_icon_flatimage()

Value< void > ns_desktop::anonymous_namespace{desktop.hpp}::integrate_icon_flatimage ( )
inlinenodiscard

Integrates the svg icon for the 'flatimage' mimetype.

Returns
Value<void> Nothing on success or the respective error

Definition at line 378 of file desktop.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ integrate_icons()

Value< void > ns_desktop::anonymous_namespace{desktop.hpp}::integrate_icons ( ns_config::FlatImage const & fim,
ns_db::ns_desktop::Desktop const & desktop )
inlinenodiscard

Integrate flatimage icons in the current $HOME directory.

Parameters
configFlatImage configuration file
desktopDesktop object
Returns
Value<void> Nothing on success, or the respective error

Definition at line 406 of file desktop.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ integrate_icons_png()

Value< void > ns_desktop::anonymous_namespace{desktop.hpp}::integrate_icons_png ( ns_db::ns_desktop::Desktop const & desktop,
fs::path const & path_file_icon )
inlinenodiscard

Integrates PNG icons for the flatimage mimetype.

Parameters
desktopThe desktop entry object
path_file_iconThe path to the icon file to integrate

Definition at line 346 of file desktop.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ integrate_icons_svg()

Value< void > ns_desktop::anonymous_namespace{desktop.hpp}::integrate_icons_svg ( ns_db::ns_desktop::Desktop const & desktop,
fs::path const & path_file_icon )
inlinenodiscard

Integrates an svg icon for the flatimage mimetype.

Parameters
desktopThe desktop entry object
path_file_iconThe path to the icon file to integrate

Definition at line 314 of file desktop.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ integrate_mime_database()

Value< void > ns_desktop::anonymous_namespace{desktop.hpp}::integrate_mime_database ( ns_db::ns_desktop::Desktop const & desktop,
fs::path const & path_file_binary )
inlinenodiscard

Generates the flatimage app specific mime package.

Parameters
desktopThe desktop object
path_file_binaryThe path to the flatimage binary

Definition at line 277 of file desktop.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ integrate_mime_database_generic()

Value< void > ns_desktop::anonymous_namespace{desktop.hpp}::integrate_mime_database_generic ( )
inlinenodiscard

Generates the flatimage generic mime package.

Definition at line 219 of file desktop.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_update_mime_database()

bool ns_desktop::anonymous_namespace{desktop.hpp}::is_update_mime_database ( fs::path const & path_file_binary,
fs::path const & path_entry_mimetype )
inlinenodiscard

Checks if the mime database should be updated based on <glob pattern=

Parameters
path_entry_mimetypeThe path to the mimetype entry
Returns
bool If the mime should be updated or not

Definition at line 183 of file desktop.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_mime_database()

Value< void > ns_desktop::anonymous_namespace{desktop.hpp}::update_mime_database ( )
inlinenodiscard

Runs update-mime-database on the current XDG_DATA_HOME diretory.

Returns
Value<void> Nothing on success, or the respective error

Definition at line 204 of file desktop.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ arr_sizes

const std::array<uint32_t, 9> ns_desktop::anonymous_namespace{desktop.hpp}::arr_sizes {16,22,24,32,48,64,96,128,256}
constexpr

Definition at line 57 of file desktop.hpp.

◆ template_dir_apps

std::string_view const ns_desktop::anonymous_namespace{desktop.hpp}::template_dir_apps = "icons/hicolor/{}x{}/apps"
constexpr

Definition at line 48 of file desktop.hpp.

◆ template_dir_apps_scalable

std::string_view const ns_desktop::anonymous_namespace{desktop.hpp}::template_dir_apps_scalable = "icons/hicolor/scalable/apps"
constexpr

Definition at line 54 of file desktop.hpp.

◆ template_dir_mime_scalable

std::string_view const ns_desktop::anonymous_namespace{desktop.hpp}::template_dir_mime_scalable = "icons/hicolor/scalable/mimetypes"
constexpr

Definition at line 51 of file desktop.hpp.

◆ template_dir_mimetype

std::string_view const ns_desktop::anonymous_namespace{desktop.hpp}::template_dir_mimetype = "icons/hicolor/{}x{}/mimetypes"
constexpr

Definition at line 45 of file desktop.hpp.

◆ template_file_app

std::string_view const ns_desktop::anonymous_namespace{desktop.hpp}::template_file_app = "flatimage_{}.png"
constexpr

Definition at line 49 of file desktop.hpp.

◆ template_file_app_scalable

std::string_view const ns_desktop::anonymous_namespace{desktop.hpp}::template_file_app_scalable = "flatimage_{}.svg"
constexpr

Definition at line 55 of file desktop.hpp.

◆ template_file_mime

std::string_view const ns_desktop::anonymous_namespace{desktop.hpp}::template_file_mime = "application-flatimage_{}.png"
constexpr

Definition at line 46 of file desktop.hpp.

◆ template_file_mime_scalable

std::string_view const ns_desktop::anonymous_namespace{desktop.hpp}::template_file_mime_scalable = "application-flatimage_{}.svg"
constexpr

Definition at line 52 of file desktop.hpp.