This commit is contained in:
2025-10-27 18:35:53 +01:00
parent b1dca32a5b
commit 3179a08dac
63 changed files with 686 additions and 693 deletions

View File

@@ -28,50 +28,36 @@ class Notifier {
// [SINGLETON] Objeto notifier
static Notifier* notifier;
enum class NotificationStatus {
enum class Status {
RISING,
STAY,
VANISHING,
FINISHED,
};
enum class NotificationShape {
enum class Shape {
ROUNDED,
SQUARED,
};
struct Notification {
std::shared_ptr<Surface> surface; // Superficie asociada a la notificación
std::shared_ptr<SurfaceSprite> sprite; // Sprite asociado para gráficos o animaciones
std::vector<std::string> texts; // Lista de textos incluidos en la notificación
NotificationStatus state; // Estado actual de la notificación (RISING, SHOWING, etc.)
NotificationShape shape; // Forma de la notificación (ej. SQUARED o ROUNDED)
SDL_FRect rect; // Dimensiones y posición de la notificación en pantalla
int y; // Posición actual en el eje Y
int travel_dist; // Distancia a recorrer (por ejemplo, en animaciones)
std::string code; // Código identificador único para esta notificación
bool can_be_removed; // Indica si la notificación puede ser eliminada
int height; // Altura de la notificación
Uint32 start_time; // Momento en que se creó la notificación
Uint32 elapsed_time; // Tiempo transcurrido desde la creación
Uint32 display_duration; // Duración total para mostrar la notificación
std::shared_ptr<Surface> surface{nullptr}; // Superficie asociada a la notificación
std::shared_ptr<SurfaceSprite> sprite{nullptr}; // Sprite asociado para gráficos o animaciones
std::vector<std::string> texts; // Lista de textos incluidos en la notificación
Status state{Status::RISING}; // Estado actual de la notificación (RISING, SHOWING, etc.)
Shape shape{Shape::SQUARED}; // Forma de la notificación (ej. SQUARED o ROUNDED)
SDL_FRect rect{0, 0, 0, 0}; // Dimensiones y posición de la notificación en pantalla
int y{0}; // Posición actual en el eje Y
int travel_dist{0}; // Distancia a recorrer (por ejemplo, en animaciones)
std::string code; // Código identificador único para esta notificación
bool can_be_removed{true}; // Indica si la notificación puede ser eliminada
int height{0}; // Altura de la notificación
Uint32 start_time{0}; // Momento en que se creó la notificación
Uint32 elapsed_time{0}; // Tiempo transcurrido desde la creación
Uint32 display_duration{0}; // Duración total para mostrar la notificación
// Constructor
explicit Notification()
: surface(nullptr), // Inicializar superficie como nula
sprite(nullptr), // Inicializar lista de textos vacía
state(NotificationStatus::RISING), // Estado inicial como "RISING"
shape(NotificationShape::SQUARED), // Forma inicial como "SQUARED"
rect{0, 0, 0, 0}, // Rectángulo inicial vacío
y(0), // Posición Y inicializada a 0
travel_dist(0), // Código identificador vacío
can_be_removed(true), // Inicialmente se puede eliminar
height(0), // Altura inicializada a 0
start_time(0), // Tiempo de creación inicializado a 0
elapsed_time(0), // Tiempo transcurrido inicializado a 0
display_duration(0) // Duración inicializada a 0
{
}
explicit Notification() = default;
};
std::shared_ptr<Surface> icon_surface_; // Textura para los iconos de las notificaciones