~ubuntu-branches/ubuntu/lucid/boinc/lucid

« back to all changes in this revision

Viewing changes to clientscr/Mac_Saver_Module.h

  • Committer: Bazaar Package Importer
  • Author(s): Frank S. Thomas, Frank S. Thomas
  • Date: 2008-05-31 08:02:47 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20080531080247-4ce890lp2rc768cr
Tags: 6.2.7-1
[ Frank S. Thomas ]
* New upstream release.
  - BOINC Manager: Redraw disk usage charts immediately after connecting to
    a (different) client. (closes: 463823)
* debian/copyright:
  - Added the instructions from debian/README.Debian-source about how
    repackaged BOINC tarballs can be reproduced because DevRef now
    recommends to put this here instead of in the afore-mentioned file.
  - Updated for the new release.
* Removed the obsolete debian/README.Debian-source.
* For consistency upstream renamed the core client and the command tool
  ("boinc_client" to "boinc" and "boinc_cmd" to "boinccmd"). Done the same
  in all packages and created symlinks with the old names for the binaries
  and man pages. Also added an entry in debian/boinc-client.NEWS explaining
  this change.
* debian/rules: Do not list Makefile.ins in the clean target individually,
  just remove all that can be found.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Berkeley Open Infrastructure for Network Computing
 
2
// http://boinc.berkeley.edu
 
3
// Copyright (C) 2005 University of California
 
4
//
 
5
// This is free software; you can redistribute it and/or
 
6
// modify it under the terms of the GNU Lesser General Public
 
7
// License as published by the Free Software Foundation;
 
8
// either version 2.1 of the License, or (at your option) any later version.
 
9
//
 
10
// This software is distributed in the hope that it will be useful,
 
11
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
13
// See the GNU Lesser General Public License for more details.
 
14
//
 
15
// To view the GNU Lesser General Public License visit
 
16
// http://www.gnu.org/copyleft/lesser.html
 
17
// or write to the Free Software Foundation, Inc.,
 
18
// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 
19
 
 
20
//  Mac_Saver_Module.h
 
21
//  BOINC_Saver_Module
 
22
//
 
23
 
 
24
#ifndef _SCREENSAVER_MAC_H
 
25
#define _SCREENSAVER_MAC_H
 
26
 
 
27
#include <Carbon/Carbon.h>
 
28
 
 
29
 
 
30
 
 
31
#ifdef __cplusplus
 
32
extern "C" {
 
33
#endif
 
34
 
 
35
int initBOINCSaver(Boolean ispreview);
 
36
int getSSMessage(char **theMessage, int* coveredFreq);
 
37
void drawPreview(CGContextRef myContext);
 
38
void closeBOINCSaver(void);
 
39
void print_to_log_file(const char *format, ...);
 
40
void strip_cr(char *buf);
 
41
 
 
42
#ifdef __cplusplus
 
43
}       // extern "C"
 
44
#endif
 
45
 
 
46
 
 
47
//-----------------------------------------------------------------------------
 
48
// Name: class CScreensaver
 
49
// Desc: Screensaver class
 
50
//-----------------------------------------------------------------------------
 
51
class CScreensaver
 
52
{
 
53
public:
 
54
    CScreensaver();
 
55
 
 
56
    int             Create();
 
57
    int             Run();
 
58
 
 
59
 
 
60
    //
 
61
    // Infrastructure layer 
 
62
    //
 
63
protected:
 
64
    OSStatus        initBOINCApp(void);
 
65
    int             GetBrandID(void);
 
66
    char*           PersistentFGets(char *buf, size_t buflen, FILE *f);
 
67
    pid_t           FindProcessPID(char* name, pid_t thePID);
 
68
    OSErr           GetpathToBOINCManagerApp(char* path, int maxLen);
 
69
    bool            SetError( bool bErrorMode, unsigned int hrError );
 
70
    void            UpdateProgressText(unsigned int hrError);
 
71
    void            setSSMessageText(const char *msg);
 
72
    void            updateSSMessageText(char *msg);
 
73
    void            strip_cr(char *buf);
 
74
    char            m_gfx_Switcher_Path[MAXPATHLEN];
 
75
    bool            m_bErrorMode;        // Whether to display an error
 
76
    unsigned int    m_hrError;           // Error code to display
 
77
 
 
78
    bool            m_wasAlreadyRunning;
 
79
    pid_t           m_CoreClientPID;
 
80
    int             m_dwBlankScreen;
 
81
    time_t          m_dwBlankTime;
 
82
    int             m_iStatusUpdateCounter;
 
83
    int             m_iGraphicsStartingMsgCounter;
 
84
    int             m_iLastResultShown;
 
85
    int             m_tLastResultChangeCounter;
 
86
    bool            m_StatusMessageUpdated;
 
87
 
 
88
    //
 
89
    // Data management layer
 
90
    //
 
91
protected:
 
92
    bool            CreateDataManagementThread();
 
93
    bool            DestroyDataManagementThread();
 
94
 
 
95
    void*           DataManagementProc();
 
96
    static void*    DataManagementProcStub( void* param );
 
97
    int             terminate_screensaver(int& graphics_application, RESULT *worker_app);
 
98
    int             launch_screensaver(RESULT* rp, int& graphics_application);
 
99
    void            HandleRPCError(void);
 
100
    OSErr           KillScreenSaver(void);
 
101
    pthread_t       m_hDataManagementThread;
 
102
    pid_t           m_hGraphicsApplication;
 
103
 
 
104
// Determine if two RESULT pointers refer to the same task
 
105
    bool            is_same_task(RESULT* taska, RESULT* taskb);
 
106
 
 
107
// Count the number of active graphics-capable apps
 
108
    int             count_active_graphic_apps(RESULTS& results, RESULT* exclude = NULL);
 
109
 
 
110
// Choose a ramdom graphics application from the vector that
 
111
//   was passed in.
 
112
 
 
113
    RESULT*         get_random_graphics_app(RESULTS& results, RESULT* exclude = NULL);
 
114
 
 
115
    RPC_CLIENT      *rpc;
 
116
    CC_STATE        state;
 
117
    RESULTS         results;
 
118
    RESULT          m_running_result;
 
119
    bool            m_updating_results;
 
120
 
 
121
    bool            m_bResetCoreState;
 
122
    bool            m_QuitDataManagementProc;
 
123
    bool            m_bV5_GFX_app_is_running;
 
124
 
 
125
 
 
126
    //
 
127
    // Presentation layer
 
128
    //
 
129
protected:
 
130
    char            m_MsgBuf[2048];
 
131
    char            m_MessageText[2048];
 
132
    char*           m_CurrentBannerMessage;
 
133
    char*           m_BrandText;
 
134
public:
 
135
    int             getSSMessage(char **theMessage, int* coveredFreq);
 
136
    void            drawPreview(CGContextRef myContext);
 
137
    void            ShutdownSaver();
 
138
 
 
139
protected:
 
140
};
 
141
 
 
142
#endif