Skip to content

Commit

Permalink
- Remove dead code related to v5 graphics applications from the
Browse files Browse the repository at this point in the history
      client software.
    
    client/
        boinc_cmd.cpp
    clientgui/
        AsyncRPC.cpp, .h
        BOINCGUIApp.cpp, .h
        MainDocument.cpp
    clientgui/gtk/
        taskbarex.cpp
    clientscr/
        screensaver.cpp
    lib/
        gui_rpc_client.h
        gui_rpc_client_ops.cpp
    win_build/
        win-config.h

svn path=/trunk/boinc/; revision=24398
  • Loading branch information
romw committed Oct 14, 2011
1 parent f93c8d4 commit afb727e
Show file tree
Hide file tree
Showing 12 changed files with 361 additions and 584 deletions.
20 changes: 20 additions & 0 deletions checkin_notes
Original file line number Diff line number Diff line change
Expand Up @@ -7222,3 +7222,23 @@ Rom 13 Oct 2011
clientgui/
BOINCGUIApp.cpp
AdvancedFrame.cpp

Rom 14 Oct 2011
- Remove dead code related to v5 graphics applications from the
client software.

client/
boinc_cmd.cpp
clientgui/
AsyncRPC.cpp, .h
BOINCGUIApp.cpp, .h
MainDocument.cpp
clientgui/gtk/
taskbarex.cpp
clientscr/
screensaver.cpp
lib/
gui_rpc_client.h
gui_rpc_client_ops.cpp
win_build/
win-config.h
26 changes: 1 addition & 25 deletions client/boinc_cmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,29 +92,13 @@ Commands:\n\
--set_run_mode mode duration set run mode for given duration\n\
mode = always | auto | never\n\
--task url task_name op task operation\n\
op = suspend | resume | abort | graphics_window | graphics_fullscreen\n\
op = suspend | resume | abort\n\
--version, -V show core client version\n\
"
);
exit(1);
}

void parse_display_args(char** argv, int& i, DISPLAY_INFO& di) {
strcpy(di.window_station, "winsta0");
strcpy(di.desktop, "default");
strcpy(di.display, "");
while (argv[i]) {
if (!strcmp(argv[i], "--window_station")) {
strlcpy(di.window_station, argv[++i], sizeof(di.window_station));
} else if (!strcpy(argv[i], "--desktop")) {
strlcpy(di.desktop, argv[++i], sizeof(di.desktop));
} else if (!strcpy(argv[i], "--display")) {
strlcpy(di.display, argv[++i], sizeof(di.display));
}
i++;
}
}

void show_error(int retval) {
fprintf(stderr, "Error %d: %s\n", retval, boincerror(retval));
}
Expand Down Expand Up @@ -257,14 +241,6 @@ int main(int argc, char** argv) {
retval = rpc.result_op(result, "resume");
} else if (!strcmp(op, "abort")) {
retval = rpc.result_op(result, "abort");
} else if (!strcmp(op, "graphics_window")) {
DISPLAY_INFO di;
parse_display_args(argv, i, di);
retval = rpc.show_graphics(project_url, name, MODE_WINDOW, di);
} else if (!strcmp(op, "graphics_fullscreen")) {
DISPLAY_INFO di;
parse_display_args(argv, i, di);
retval = rpc.show_graphics(project_url, name, MODE_FULLSCREEN, di);
} else {
fprintf(stderr, "Unknown op %s\n", op);
}
Expand Down
8 changes: 0 additions & 8 deletions clientgui/AsyncRPC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -485,14 +485,6 @@ int RPCThread::ProcessRPCRequest() {
case RPC_GET_DISK_USAGE:
retval = (m_pDoc->rpcClient).get_disk_usage(*(DISK_USAGE*)(current_request->arg1));
break;
case RPC_SHOW_GRAPHICS:
retval = (m_pDoc->rpcClient).show_graphics(
(const char*)(current_request->arg1),
(const char*)(current_request->arg2),
*(int*)(current_request->arg3),
*(DISPLAY_INFO*)(current_request->arg4)
);
break;
case RPC_PROJECT_OP:
retval = (m_pDoc->rpcClient).project_op(
*(PROJECT*)(current_request->arg1),
Expand Down
4 changes: 0 additions & 4 deletions clientgui/AsyncRPC.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ enum RPC_SELECTOR {
RPC_GET_PROJECT_STATUS2,
RPC_GET_ALL_PROJECTS_LIST, // 10
RPC_GET_DISK_USAGE,
RPC_SHOW_GRAPHICS,
RPC_PROJECT_OP,
RPC_SET_RUN_MODE,
RPC_SET_GPU_MODE,
Expand Down Expand Up @@ -242,9 +241,6 @@ class AsyncRPC
{ return RPC_Wait(RPC_GET_ALL_PROJECTS_LIST, (void*)&arg1); }
int get_disk_usage(DISK_USAGE& arg1)
{ return RPC_Wait(RPC_GET_DISK_USAGE, (void*)&arg1); }
int show_graphics(
const char* project, const char* result_name, int graphics_mode, DISPLAY_INFO& di)
{ return RPC_Wait(RPC_SHOW_GRAPHICS, (void*)project, (void*)result_name, (void*)&graphics_mode, (void*)&di); }
int project_op(PROJECT& arg1, const char* op)
{ return RPC_Wait(RPC_PROJECT_OP, (void*)&arg1, (void*)op); }
int set_run_mode(int mode, double duration)
Expand Down
61 changes: 0 additions & 61 deletions clientgui/BOINCGUIApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,9 @@ bool CBOINCGUIApp::OnInit() {
m_strPasswordArg = wxEmptyString;
m_iRPCPortArg = GUI_RPC_PORT;
m_strBOINCArguments = wxEmptyString;
m_bAccessibilityEnabled = false;
m_bGUIVisible = true;
m_bDebugSkins = false;
m_bMultipleInstancesOK = false;
m_strDefaultWindowStation = wxEmptyString;
m_strDefaultDesktop = wxEmptyString;
m_strDefaultDisplay = wxEmptyString;
m_bBOINCMGRAutoStarted = false;
m_iBOINCMGRDisableAutoStart = 0;
m_iShutdownCoreClient = 0;
Expand Down Expand Up @@ -217,9 +213,6 @@ bool CBOINCGUIApp::OnInit() {
return false;
}

// Detect if a program that is defined as an accessibility aid is running
DetectAccessibilityEnabled();

// Detect where BOINC Manager executable name.
DetectExecutableName();

Expand Down Expand Up @@ -418,10 +411,6 @@ bool CBOINCGUIApp::OnInit() {
#endif


// Detect the display info and store for later use.
DetectDisplayInfo();


// Startup the System Idle Detection code
IdleTrackerAttach();

Expand Down Expand Up @@ -606,56 +595,6 @@ bool CBOINCGUIApp::OnCmdLineParsed(wxCmdLineParser &parser) {
}


///
/// Detect the desktop that BOINC Manager is running in.
///
void CBOINCGUIApp::DetectDisplayInfo() {
#ifdef __WXMSW__
wxChar szWindowStation[256];
memset(szWindowStation, 0, sizeof(szWindowStation)/sizeof(wxChar));
wxChar szDesktop[256];
memset(szDesktop, 0, sizeof(szDesktop)/sizeof(wxChar));

if (wxWIN95 != wxGetOsVersion(NULL, NULL)) {
// Retrieve the current window station and desktop names
GetUserObjectInformation(
GetProcessWindowStation(),
UOI_NAME,
szWindowStation,
(sizeof(szWindowStation) / sizeof(wxChar)),
NULL
);
GetUserObjectInformation(
GetThreadDesktop(GetCurrentThreadId()),
UOI_NAME,
szDesktop,
(sizeof(szDesktop) / sizeof(wxChar)),
NULL
);
m_strDefaultWindowStation = szWindowStation;
m_strDefaultDesktop = szDesktop;
}

#else
wxString p = wxString(getenv("DISPLAY"), wxConvUTF8);
if (p) m_strDefaultDisplay = p;
#endif

}


///
/// Detect if an acessibility aid is running on the system.
///
void CBOINCGUIApp::DetectAccessibilityEnabled() {
#ifdef __WXMSW__
BOOL bScreenReaderEnabled = false;
SystemParametersInfo(SPI_GETSCREENREADER, NULL, &bScreenReaderEnabled, NULL);
m_bAccessibilityEnabled = (bScreenReaderEnabled == TRUE);
#endif
}


///
/// Detect if another instance of this application is running.
// Returns true if there is, otherwise false
Expand Down
9 changes: 0 additions & 9 deletions clientgui/BOINCGUIApp.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ class CBOINCGUIApp : public wxApp {
void OnInitCmdLine(wxCmdLineParser &parser);
bool OnCmdLineParsed(wxCmdLineParser &parser);

void DetectDisplayInfo();
void DetectAccessibilityEnabled();
bool DetectDuplicateInstance();
void DetectExecutableName();
void DetectRootDirectory();
Expand Down Expand Up @@ -91,8 +89,6 @@ class CBOINCGUIApp : public wxApp {
wxString m_strBOINCArguments;
int m_iRPCPortArg;

bool m_bAccessibilityEnabled;

bool m_bBOINCMGRAutoStarted;
int m_iBOINCMGRDisableAutoStart;
int m_iShutdownCoreClient;
Expand Down Expand Up @@ -120,10 +116,6 @@ class CBOINCGUIApp : public wxApp {

public:

wxString m_strDefaultWindowStation;
wxString m_strDefaultDesktop;
wxString m_strDefaultDisplay;

bool OnInit();

wxLocale* GetLocale() { return m_pLocale; }
Expand All @@ -141,7 +133,6 @@ class CBOINCGUIApp : public wxApp {
CTaskBarIcon* GetTaskBarIcon() { return m_pTaskBarIcon; }
void DeleteTaskBarIcon();

bool IsAccessibilityEnabled() { return m_bAccessibilityEnabled; }
bool IsMgrMultipleInstance() { return m_bMultipleInstancesOK; }

#ifdef __WXMAC__
Expand Down
17 changes: 0 additions & 17 deletions clientgui/MainDocument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1746,31 +1746,14 @@ int CMainDocument::WorkShowGraphics(RESULT* result)
id
);
#endif

if (!iRetVal) {
gfx_app.slot = slot;
gfx_app.project_url = result->project_url;
gfx_app.name = result->name;
gfx_app.pid = id;
m_running_gfx_apps.push_back(gfx_app);
}

} else {
// V5 and Older
DISPLAY_INFO di;

strcpy(di.window_station, (const char*)wxGetApp().m_strDefaultWindowStation.mb_str());
strcpy(di.desktop, (const char*)wxGetApp().m_strDefaultDesktop.mb_str());
strcpy(di.display, (const char*)wxGetApp().m_strDefaultDisplay.mb_str());

iRetVal = rpc.show_graphics(
result->project_url,
result->name,
MODE_WINDOW,
di
);
}

return iRetVal;
}

Expand Down
Loading

0 comments on commit afb727e

Please sign in to comment.