Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

#ClimateAction

22 views
Skip to first unread message

Mr Flibble

unread,
May 2, 2020, 9:35:53 PM5/2/20
to
Hi,

Doing my bit to fight climate change:

#pragma once

#include <neogfx/neogfx.hpp>
#include <chrono>
#include <neogfx/core/i_event.hpp>

namespace neogfx
{
class i_power
{
public:
declare_event(activity_registered)
declare_event(green_mode_enabled)
declare_event(green_mode_disabled)
declare_event(green_mode_entered)
declare_event(green_mode_left)
declare_event(turbo_mode_enabled)
declare_event(turbo_mode_disabled)
declare_event(turbo_mode_entered)
declare_event(turbo_mode_left)
public:
virtual ~i_power() = default;
public:
virtual void register_activity() = 0;
virtual std::chrono::seconds activity_timeout() const = 0;
virtual void set_activity_timeout(std::chrono::seconds aTimeout) = 0;
virtual bool is_green_mode_enabled() const = 0;
virtual void enable_green_mode() = 0;
virtual void disable_green_mode() = 0;
public:
bool is_turbo_mode_enabled() const
{
return !is_green_mode_enabled();
}
void enable_turbo_mode()
{
disable_green_mode();
}
void disable_turbo_mode()
{
enable_green_mode();
}
};
}

/Flibble

--
"Snakes didn't evolve, instead talking snakes with legs changed into snakes." - Rick C. Hodgin

“You won’t burn in hell. But be nice anyway.” – Ricky Gervais

“I see Atheists are fighting and killing each other again, over who doesn’t believe in any God the most. Oh, no..wait.. that never happens.” – Ricky Gervais

"Suppose it's all true, and you walk up to the pearly gates, and are confronted by God," Byrne asked on his show The Meaning of Life. "What will Stephen Fry say to him, her, or it?"
"I'd say, bone cancer in children? What's that about?" Fry replied.
"How dare you? How dare you create a world to which there is such misery that is not our fault. It's not right, it's utterly, utterly evil."
"Why should I respect a capricious, mean-minded, stupid God who creates a world that is so full of injustice and pain. That's what I would say."

Mr Flibble

unread,
May 3, 2020, 8:41:16 AM5/3/20
to
On 03/05/2020 09:06, Dave Henderson wrote:
> Did your brain fell out?

Did yours?

Chris M. Thomasson

unread,
May 3, 2020, 4:57:16 PM5/3/20
to
A timeout that triggers a pause? Say 30 seconds of no activity detected,
pause everything. requestAnimationFrame seems to do this automatically
in browsers. If I go to a different tab, animations are paused.

Mr Flibble

unread,
May 3, 2020, 6:34:36 PM5/3/20
to
More or less. You get it shame that fucktard "Dave Henderson" didn't.

Final version of the abstraction can be found here: https://github.com/i42output/neoGFX/blob/master/include/neogfx/core/i_power.hpp
0 new messages