2025-04-09 15:30:35 +02:00

54 lines
1.6 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//FILE MODIFIED BY AzaharPlus APRIL 2025
// Copyright Citra Emulator Project / Azahar Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#pragma once
#include <filesystem>
#include <QFont>
#include <QString>
#include "common/common_types.h"
/// Returns a QFont object appropriate to use as a monospace font for debugging widgets, etc.
QFont GetMonospaceFont();
/// Convert a size in bytes into a readable format (KiB, MiB, etc.)
QString ReadableByteSize(qulonglong size);
/**
* Creates a circle pixmap from a specified color
* @param color The color the pixmap shall have
* @return QPixmap circle pixmap
*/
QPixmap CreateCirclePixmapFromColor(const QColor& color);
/**
* Gets the game icon from SMDH data.
* @param smdh_data SMDH data
* @return QPixmap game icon
*/
QPixmap GetQPixmapFromSMDH(const std::vector<u8>& smdh_data);
/**
* Saves a windows icon to a file
* @param path The icons path
* @param image The image to save
* @return bool If the operation succeeded
*/
[[nodiscard]] bool SaveIconToFile(const std::filesystem::path& icon_path, const QImage& image);
/**
* @return The users applications directory
*/
[[nodiscard]] const std::string GetApplicationsDirectory();
/**
* Imitates the deprecated `QImage::mirrored` function in a forwards-compatible manner
* @param flip_horizontal Whether the image should be flipped horizontally
* @param flip_vertical Whether the image should be flipped vertically
* @return QImage The mirrored image
*/
QImage GetMirroredImage(QImage source_image, bool flip_horizontal, bool flip_vertical);