2005-01-20 23:22:22 +00:00
|
|
|
// Berkeley Open Infrastructure for Network Computing
|
|
|
|
// http://boinc.berkeley.edu
|
|
|
|
// Copyright (C) 2005 University of California
|
2004-07-13 13:54:09 +00:00
|
|
|
//
|
2005-01-20 23:22:22 +00:00
|
|
|
// This is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU Lesser General Public
|
|
|
|
// License as published by the Free Software Foundation;
|
|
|
|
// either version 2.1 of the License, or (at your option) any later version.
|
2004-07-13 13:54:09 +00:00
|
|
|
//
|
2005-01-20 23:22:22 +00:00
|
|
|
// This software is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
// See the GNU Lesser General Public License for more details.
|
2003-05-15 17:10:26 +00:00
|
|
|
//
|
2005-01-20 23:22:22 +00:00
|
|
|
// To view the GNU Lesser General Public License visit
|
|
|
|
// http://www.gnu.org/copyleft/lesser.html
|
|
|
|
// or write to the Free Software Foundation, Inc.,
|
|
|
|
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
2003-05-15 17:10:26 +00:00
|
|
|
|
2003-05-09 00:00:39 +00:00
|
|
|
#ifndef _SS_LOGIC_
|
|
|
|
#define _SS_LOGIC_
|
|
|
|
|
2004-03-04 11:41:43 +00:00
|
|
|
#ifndef _WIN32
|
2004-07-13 13:54:09 +00:00
|
|
|
#include <ctime>
|
2004-03-04 11:41:43 +00:00
|
|
|
#endif
|
2003-05-08 18:11:05 +00:00
|
|
|
|
|
|
|
class SS_LOGIC {
|
|
|
|
public:
|
|
|
|
|
2004-11-16 08:04:57 +00:00
|
|
|
SS_LOGIC();
|
2003-05-09 21:54:23 +00:00
|
|
|
|
2004-11-17 19:19:26 +00:00
|
|
|
void start_ss(GRAPHICS_MSG&, double blank_time);
|
2003-05-08 18:11:05 +00:00
|
|
|
void stop_ss();
|
2005-06-07 19:22:50 +00:00
|
|
|
void poll();
|
2004-07-19 20:37:45 +00:00
|
|
|
void reset();
|
2004-11-16 08:04:57 +00:00
|
|
|
int get_ss_status() { return ss_status; };
|
2005-04-05 00:32:24 +00:00
|
|
|
void ask_app(ACTIVE_TASK*, GRAPHICS_MSG&);
|
2004-11-16 08:04:57 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
double blank_time; // 0 or time to blank screen
|
|
|
|
double ack_deadline; // when to give up on graphics app
|
|
|
|
int ss_status; // the status of the screensaver from the core
|
|
|
|
// client perspective.
|
2003-05-08 18:11:05 +00:00
|
|
|
bool do_ss; // true if we're acting like a screensaver
|
2005-04-05 00:32:24 +00:00
|
|
|
GRAPHICS_MSG saved_graphics_msg;
|
2003-05-08 18:11:05 +00:00
|
|
|
|
|
|
|
// invariants
|
|
|
|
//
|
|
|
|
// at most one app has request_mode = FULLSCREEN
|
|
|
|
// pre-ss mode of all apps is not FULLSCREEN
|
|
|
|
};
|
2003-05-09 00:00:39 +00:00
|
|
|
|
|
|
|
#endif
|