mirror of
https://github.com/hyprwm/hyprlock.git
synced 2025-12-20 08:50:03 +01:00
* widgets: move references to hyprutils atomic shared * core: move std::shared_pointers to hyprutils atomic shared pointers * Nix: bump hyprutils input * clang-format * cmake: bump hyprutils to v0.8.0 * and bump nix again
26 lines
757 B
C++
26 lines
757 B
C++
#pragma once
|
|
|
|
#include <chrono>
|
|
#include <functional>
|
|
#include "../defines.hpp"
|
|
|
|
class CTimer {
|
|
public:
|
|
CTimer(std::chrono::system_clock::duration timeout, std::function<void(ASP<CTimer> self, void* data)> cb_, void* data_, bool force);
|
|
|
|
void cancel();
|
|
bool passed();
|
|
bool canForceUpdate();
|
|
|
|
float leftMs();
|
|
|
|
bool cancelled();
|
|
void call(ASP<CTimer> self);
|
|
|
|
private:
|
|
std::function<void(ASP<CTimer> self, void* data)> cb;
|
|
void* data = nullptr;
|
|
std::chrono::system_clock::time_point expires;
|
|
bool wasCancelled = false;
|
|
bool allowForceUpdate = false;
|
|
};
|