Changes between Initial Version and Version 1 of ScreensaverLogic


Ignore:
Timestamp:
Apr 25, 2007, 1:19:36 PM (17 years ago)
Author:
Nicolas
Comment:

Converted by an automatic script

Legend:

Unmodified
Added
Removed
Modified
  • ScreensaverLogic

    v1 v1  
     1= Screensaver Logic =
     2
     3The screensaver supports:
     4
     5
     6 1. Fullscreen graphics from project applications
     7 1. A default BOINC logo screensaver when no running applications support graphics
     8 1. Screen blanking after a given time
     9
     10If the screensaver is running, the core client will try to devote screen time to a different project each time the CPUs are rescheduled.
     11
     12
     13{{{
     14request_ss_app():
     15    choose some app that can do graphics
     16    if app exists:
     17        request app (from a different project if possible)
     18            to do fullscreen graphics
     19        ACK deadline = now + 5 sec
     20    else:
     21        do_boinc_logo_ss = true
     22
     23// called to force poll function to request another app to do graphics
     24//
     25// this is called by schedule_cpus() whenever CPUs are rescheduled
     26//
     27reset():
     28    tell any fullscreen app to hide
     29    do_boinc_logo_ss = false
     30
     31// called when core client receives a message from the screensaver module
     32//
     33start_ss(new_blank_time):
     34    save all apps' modes
     35    hide all apps
     36    blank_time = new_blank_time
     37    if activities not suspended:
     38        request_ss_app()
     39
     40// called when screensaver module quits
     41//
     42stop_ss():
     43    clean up stuff
     44    restore apps' modes
     45
     46// called once a second
     47//
     48poll():
     49    if activities not suspended:
     50        if doing screensaver:
     51            if blank_time != 0 && now > blank_time:
     52                if not screen not already blanked:
     53                    tell any fullscreen app to hide
     54                    blank screen
     55                do_boinc_logo_ss = false
     56            else:
     57                get the fullscreen app
     58                if app exists:
     59                    if app has sent ACK:
     60                        do_boinc_logo_ss = false
     61                    else if ACK deadline has passed:
     62                        tell app to hide
     63                        do_boinc_logo_ss = true
     64                else:
     65                    request_ss_app()
     66    else:
     67        do_boinc_logo_ss = true
     68
     69
     70/////////////////////////
     71logic of screensaver program:
     72screensaver starts
     73    creates blank windows on every screen
     74    show "screensaver loading" in all windows
     75
     76    if core client not running and not set to run on startup
     77        show "boinc not running, auto startup not detected
     78            please reinstall and select this option"
     79    10 times, every 1 sec, then once every 30 sec
     80        set_screensaver_mode RPC to core client
     81            pass desktop/windowstation, blank time
     82        get_screensaver_mode
     83            returns:
     84                - some app is doing fullscreen
     85                - no graphics-capable app
     86                - BOINC suspended
     87                - time to blank
     88
     89    after each get_screensaver_mode (beyond initial 10 sec):
     90        if no app is doing graphics,
     91        do get_results RPC
     92        show string on all windows
     93
     94}}}