*** empty log message ***

svn path=/trunk/boinc/; revision=2902
This commit is contained in:
David Anderson 2004-01-17 18:36:17 +00:00
parent b6aec4673f
commit 83e3cd509d
11 changed files with 315 additions and 334 deletions

View File

@ -15,8 +15,6 @@
*/
#include <afxwin.h>
#include <gl\gl.h> // Header File For The OpenGL32 Library
#include <gl\glu.h> // Header File For The GLu32 Library
#include <stdio.h>
#include <winuser.h>
@ -30,72 +28,63 @@
#define WIN32_LEAN_AND_MEAN // This trims down the windows libraries.
#define WIN32_EXTRA_LEAN // Trims even farther.
static HDC hDC;
static HGLRC hRC;
#define BOINC_WINDOW_CLASS_NAME "BOINC_app"
static HDC hDC=NULL;
static HGLRC hRC=NULL;
static HWND hWnd=NULL; // Holds Our Window Handle
static HINSTANCE hInstance; // Holds The Instance Of The Application
static RECT rect = {50, 50, 50+640, 50+480};
static int current_graphics_mode = MODE_HIDE_GRAPHICS;
static POINT mousePos;
static UINT m_uEndSSMsg;
static HDC myhDC;
BOOL win_loop_done;
void SetupPixelFormat(HDC hDC);
static bool visible = true;
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); // Declaration For WndProc
BOOL reg_win_class();
BOOL unreg_win_class();
void SetupPixelFormat(HDC hDC) {
int nPixelFormat;
bool KillWindow() {
//if(hDC) app_unload_gl();
static PIXELFORMATDESCRIPTOR pfd = {
sizeof(PIXELFORMATDESCRIPTOR), // size of structure.
1, // always 1.
PFD_DRAW_TO_WINDOW | // support window
PFD_SUPPORT_OPENGL | // support OpenGl
PFD_DOUBLEBUFFER, // support double buffering
PFD_TYPE_RGBA, // support RGBA
32, // 32 bit color mode
0, 0, 0, 0, 0, 0, // ignore color bits
0, // no alpha buffer
0, // ignore shift bit
0, // no accumulation buffer
0, 0, 0, 0, // ignore accumulation bits.
16, // number of depth buffer bits.
0, // number of stencil buffer bits.
0, // 0 means no auxiliary buffer
PFD_MAIN_PLANE, // The main drawing plane
0, // this is reserved
0, 0, 0 }; // layer masks ignored.
if (hRC) { // Do We Have A Rendering Context?
if (!wglMakeCurrent(NULL,NULL)) { // Are We Able To Release The DC And RC Contexts?
return false;
}
if (!wglDeleteContext(hRC)) { // Are We Able To Delete The RC?
return false;
}
hRC=NULL; // Set RC To NULL
}
if (hDC && !ReleaseDC(hWnd,hDC)) { // Are We Able To Release The DC
hDC=NULL; // Set DC To NULL
return false;
}
KillTimer(hWnd, 1);
// this chooses the best pixel format and returns index.
nPixelFormat = ChoosePixelFormat(hDC, &pfd);
if (hWnd && !DestroyWindow(hWnd)) { // Are We Able To Destroy The Window?
return false;
hWnd=NULL; // Set hWnd To NULL
}
return true;
// This set pixel format to device context.
SetPixelFormat(hDC, nPixelFormat, &pfd);
// Remember that its not important to fully understand the pixel format,
// just remember to include in all of your applications and you'll be
// good to go.
}
// switch to the given graphics mode. This is called:
// - on initialization
// - when get mode change msg (via shared mem)
// - when in SS mode and get user input
//
void SetMode(int mode) {
static void make_new_window(int mode) {
RECT WindowRect = {0,0,0,0};
int width, height;
DWORD dwExStyle;
DWORD dwStyle;
if (current_graphics_mode != MODE_FULLSCREEN) GetWindowRect(hWnd, &rect);
KillWindow();
current_graphics_mode = mode;
// ?? if mode is HIDE, can't we just return here?
if (current_graphics_mode == MODE_FULLSCREEN) {
HDC screenDC=GetDC(NULL);
WindowRect.left = WindowRect.top = 0;
@ -112,13 +101,10 @@ void SetMode(int mode) {
while(ShowCursor(true) < 0);
}
// Do not do AdjustWindowRectEx here, this will
// cause the window to creep upwards
APP_INIT_DATA aid;
boinc_get_init_data(aid);
if (!strlen(aid.app_name)) strcpy(aid.app_name, "BOINC Application");
hWnd = CreateWindowEx(dwExStyle, "BOINC_OpenGL", aid.app_name,
hWnd = CreateWindowEx(dwExStyle, BOINC_WINDOW_CLASS_NAME, aid.app_name,
dwStyle|WS_CLIPSIBLINGS|WS_CLIPCHILDREN, WindowRect.left, WindowRect.top,
WindowRect.right-WindowRect.left,WindowRect.bottom-WindowRect.top,
NULL, NULL, hInstance, NULL
@ -146,8 +132,6 @@ void SetMode(int mode) {
width = WindowRect.right-WindowRect.left;
height = WindowRect.bottom-WindowRect.top;
SetTimer(hWnd, 1, 100, NULL);
if(current_graphics_mode == MODE_FULLSCREEN || current_graphics_mode == MODE_WINDOW) {
ShowWindow(hWnd, SW_SHOW);
SetFocus(hWnd);
@ -155,10 +139,47 @@ void SetMode(int mode) {
ShowWindow(hWnd, SW_HIDE);
}
// do GL initialization every time, since we're creating a new window
//
InitGL();
app_graphics_init();
}
void KillWindow() {
wglMakeCurrent(NULL,NULL); // release GL rendering context
if (hRC) {
wglDeleteContext(hRC);
hRC=NULL;
}
if (hWnd && hDC) {
ReleaseDC(hWnd,hDC);
}
hDC = NULL;
if (hWnd) {
DestroyWindow(hWnd);
}
hWnd = NULL;
}
// switch to the given graphics mode. This is called:
// - on initialization
// - when get mode change msg (via shared mem)
// - when in SS mode and get user input
//
void SetMode(int mode) {
if (current_graphics_mode != MODE_FULLSCREEN) GetWindowRect(hWnd, &rect);
KillWindow();
FILE* f = fopen("setmode.txt", "a");
fprintf(f, "mode: %d\n", mode);
fclose(f);
current_graphics_mode = mode;
if (mode != MODE_HIDE_GRAPHICS) {
make_new_window(mode);
}
// tell the core client that we're entering new mode
//
@ -171,15 +192,12 @@ void SetMode(int mode) {
// message handler (includes timer, Windows msgs)
//
LRESULT CALLBACK WndProc( HWND hWnd, // Handle For This Window
UINT uMsg, // Message For This Window
WPARAM wParam, // Additional Message Information
LPARAM lParam) // Additional Message Information
{
RECT rt;
int width, height, new_mode, msg;
static bool visible = true;
LRESULT CALLBACK WndProc(
HWND hWnd, // Handle For This Window
UINT uMsg, // Message For This Window
WPARAM wParam, // Additional Message Information
LPARAM lParam // Additional Message Information
) {
switch(uMsg) {
case WM_ERASEBKGND: // Check To See If Windows Is Trying To Erase The Background
return 0;
@ -229,47 +247,84 @@ LRESULT CALLBACK WndProc( HWND hWnd, // Handle For This Window
case WM_SIZE:
ReSizeGLScene(LOWORD(lParam),HIWORD(lParam));
return 0;
case WM_TIMER:
if (app_client_shm) {
if (app_client_shm->get_graphics_msg(CORE_APP_GFX_SEG, msg, new_mode)) {
switch (msg) {
case GRAPHICS_MSG_SET_MODE:
SetMode(new_mode);
break;
case GRAPHICS_MSG_REREAD_PREFS:
app_graphics_reread_prefs();
break;
}
}
}
if (!visible) return 0;
if (current_graphics_mode == MODE_HIDE_GRAPHICS) return 0;
// TODO: remove width, height from API
//
GetClientRect(hWnd, &rt);
width = rt.right-rt.left;
height = rt.bottom-rt.top;
if (throttled_app_render(width, height, dtime())) {
SwapBuffers(hDC);
}
return 0;
}
// Pass All Unhandled Messages To DefWindowProc
return DefWindowProc(hWnd,uMsg,wParam,lParam);
}
BOOL reg_win_class() {
WNDCLASS wc; // Windows Class Structure
hInstance = GetModuleHandle(NULL); // Grab An Instance For Our Window
wc.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC; // Redraw On Size, And Own DC For Window.
wc.lpfnWndProc = (WNDPROC) WndProc; // WndProc Handles Messages
wc.cbClsExtra = 0; // No Extra Window Data
wc.cbWndExtra = 0; // No Extra Window Data
wc.hInstance = hInstance; // Set The Instance
wc.hIcon = LoadIcon(NULL, IDI_WINLOGO); // Load The Default Icon
wc.hCursor = LoadCursor(NULL, IDC_ARROW); // Load The Arrow Pointer
wc.hbrBackground = NULL; // No Background Required For GL
wc.lpszMenuName = NULL; // We Don't Want A Menu
wc.lpszClassName = BOINC_WINDOW_CLASS_NAME; // Set The Class Name
if (!RegisterClass(&wc)) // Attempt To Register The Window Class
{
MessageBox(NULL,"Failed To Register The Window Class.","ERROR",MB_OK|MB_ICONEXCLAMATION);
return FALSE; // Return FALSE
}
return TRUE;
}
BOOL unreg_win_class() {
if (!UnregisterClass(BOINC_WINDOW_CLASS_NAME,hInstance)) {
MessageBox(NULL,"Could Not Unregister Class.","SHUTDOWN ERROR",MB_OK | MB_ICONINFORMATION);
hInstance=NULL; // Set hInstance To NULL
}
return TRUE;
}
static VOID CALLBACK timer_handler(HWND, UINT, UINT, DWORD) {
RECT rt;
int width, height, new_mode, msg;
if (app_client_shm) {
if (app_client_shm->get_graphics_msg(CORE_APP_GFX_SEG, msg, new_mode)) {
switch (msg) {
case GRAPHICS_MSG_SET_MODE:
SetMode(new_mode);
break;
case GRAPHICS_MSG_REREAD_PREFS:
app_graphics_reread_prefs();
break;
}
}
}
if (!visible) return;
if (current_graphics_mode == MODE_HIDE_GRAPHICS) return;
if (!hWnd) return;
// TODO: remove width, height from API
//
GetClientRect(hWnd, &rt);
width = rt.right-rt.left;
height = rt.bottom-rt.top;
if (throttled_app_render(width, height, dtime())) {
SwapBuffers(hDC);
}
}
DWORD WINAPI win_graphics_event_loop( LPVOID gi ) {
MSG msg; // Windows Message Structure
double start = (double)time(0);
m_uEndSSMsg = RegisterWindowMessage(END_SS_MSG);
// Register window class and graphics mode message
reg_win_class();
SetTimer(NULL, 1, 100, &timer_handler);
if (boinc_is_standalone()) {
SetMode(MODE_WINDOW);
} else {
@ -312,119 +367,48 @@ BOOL VerifyPassword(HWND hwnd)
return bres;
}
BOOL reg_win_class() {
WNDCLASS wc; // Windows Class Structure
hInstance = GetModuleHandle(NULL); // Grab An Instance For Our Window
wc.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC; // Redraw On Size, And Own DC For Window.
wc.lpfnWndProc = (WNDPROC) WndProc; // WndProc Handles Messages
wc.cbClsExtra = 0; // No Extra Window Data
wc.cbWndExtra = 0; // No Extra Window Data
wc.hInstance = hInstance; // Set The Instance
wc.hIcon = LoadIcon(NULL, IDI_WINLOGO); // Load The Default Icon
wc.hCursor = LoadCursor(NULL, IDC_ARROW); // Load The Arrow Pointer
wc.hbrBackground = NULL; // No Background Required For GL
wc.lpszMenuName = NULL; // We Don't Want A Menu
wc.lpszClassName = "BOINC_OpenGL"; // Set The Class Name
if (!RegisterClass(&wc)) // Attempt To Register The Window Class
{
MessageBox(NULL,"Failed To Register The Window Class.","ERROR",MB_OK|MB_ICONEXCLAMATION);
return FALSE; // Return FALSE
}
return TRUE;
}
BOOL unreg_win_class() {
if (!UnregisterClass("BOINC_OpenGL",hInstance)) // Are We Able To Unregister Class
{
MessageBox(NULL,"Could Not Unregister Class.","SHUTDOWN ERROR",MB_OK | MB_ICONINFORMATION);
hInstance=NULL; // Set hInstance To NULL
}
return TRUE;
}
void SetupPixelFormat(HDC hDC)
{
int nPixelFormat;
static PIXELFORMATDESCRIPTOR pfd = {
sizeof(PIXELFORMATDESCRIPTOR), // size of structure.
1, // always 1.
PFD_DRAW_TO_WINDOW | // support window
PFD_SUPPORT_OPENGL | // support OpenGl
PFD_DOUBLEBUFFER, // support double buffering
PFD_TYPE_RGBA, // support RGBA
32, // 32 bit color mode
0, 0, 0, 0, 0, 0, // ignore color bits
0, // no alpha buffer
0, // ignore shift bit
0, // no accumulation buffer
0, 0, 0, 0, // ignore accumulation bits.
16, // number of depth buffer bits.
0, // number of stencil buffer bits.
0, // 0 means no auxiliary buffer
PFD_MAIN_PLANE, // The main drawing plane
0, // this is reserved
0, 0, 0 }; // layer masks ignored.
// this chooses the best pixel format and returns index.
nPixelFormat = ChoosePixelFormat(hDC, &pfd);
// This set pixel format to device context.
SetPixelFormat(hDC, nPixelFormat, &pfd);
// Remember that its not important to fully understand the pixel format,
// just remember to include in all of your applications and you'll be
// good to go.
}
float txt_widths[256];
unsigned int MyCreateFont(char *fontName, int Size, int weight) {
// windows font
HFONT hFont;
unsigned int mylistbase =0;
// windows font
HFONT hFont;
unsigned int mylistbase =0;
// Create space for 96 characters.
mylistbase= glGenLists(256);
// Create space for 96 characters.
mylistbase= glGenLists(256);
if(stricmp(fontName, "symbol")==0)
{
hFont = CreateFont(Size, 0, 0, 0, FW_BOLD, FALSE, FALSE, FALSE,
SYMBOL_CHARSET, OUT_TT_PRECIS, CLIP_DEFAULT_PRECIS,
ANTIALIASED_QUALITY, FF_DONTCARE | DEFAULT_PITCH, fontName);
}
else
{
hFont = CreateFont(Size, 0, 0, 0, FW_BOLD, FALSE, FALSE, FALSE,
ANSI_CHARSET, OUT_TT_PRECIS, CLIP_DEFAULT_PRECIS,
ANTIALIASED_QUALITY, FF_DONTCARE | DEFAULT_PITCH, fontName);
}
if(stricmp(fontName, "symbol")==0) {
hFont = CreateFont(
Size, 0, 0, 0, FW_BOLD, FALSE, FALSE, FALSE,
SYMBOL_CHARSET, OUT_TT_PRECIS, CLIP_DEFAULT_PRECIS,
ANTIALIASED_QUALITY, FF_DONTCARE | DEFAULT_PITCH, fontName
);
} else {
hFont = CreateFont(
Size, 0, 0, 0, FW_BOLD, FALSE, FALSE, FALSE,
ANSI_CHARSET, OUT_TT_PRECIS, CLIP_DEFAULT_PRECIS,
ANTIALIASED_QUALITY, FF_DONTCARE | DEFAULT_PITCH, fontName
);
}
if(!hFont)
return -1;
SelectObject(myhDC, hFont);
if(!hFont) return -1;
SelectObject(myhDC, hFont);
#if 1 //no idea why this has to be twice
wglUseFontBitmaps(myhDC, 0, 256, mylistbase);
wglUseFontBitmaps(myhDC, 0, 256, mylistbase);
wglUseFontBitmaps(myhDC, 0, 256, mylistbase);
wglUseFontBitmaps(myhDC, 0, 256, mylistbase);
#endif
#if 0
wglUseFontOutlines(hDC,0,255,mylistbase,0.0f,0.2f,WGL_FONT_POLYGONS,gmf);
wglUseFontOutlines(hDC,0,255,mylistbase,0.0f,0.2f,WGL_FONT_POLYGONS,gmf);
#endif
TEXTMETRIC met;
GetTextMetrics(myhDC,&met);
GetCharWidthFloat(myhDC,met.tmFirstChar,met.tmLastChar,txt_widths);
TEXTMETRIC met;
GetTextMetrics(myhDC,&met);
GetCharWidthFloat(myhDC,met.tmFirstChar,met.tmLastChar,txt_widths);
return mylistbase;
return mylistbase;
}
float get_char_width(unsigned char c)
{
float get_char_width(unsigned char c) {
return txt_widths[c];
}

View File

@ -9272,3 +9272,29 @@ Karl 2004-01-15
David Jan 16 2004
- released core client 2.18 for Windows
David Jan 19 2004
- change logic in windows_opengl.C so that an app has no window
when it doesn't need one.
In particular, it has no window when it initially runs,
so it won't wake up screensaver when an app starts.
This requires using a window-less timer
to poll for messages from core client.
api/
windows_opengl.C
David Jan 19 2004
- remove win_main.cpp
- if result exceeds disk, show both usage and limit
- change title of Attach to Project dialog
- change debugging symbol from DEBUG to SS_DEBUG
(since VC7.0 equates _DEBUG and DEBUG)
client/
app.C
win_main.cpp (removed)
win/
resource.rc
win_build/
boinc_gui.vcproj

View File

@ -746,8 +746,8 @@ bool ACTIVE_TASK::check_max_disk_exceeded() {
if (disk_usage > max_disk_usage) {
msg_printf(
result->project, MSG_INFO,
"Aborting result %s: exceeded disk limit %f\n",
result->name, max_disk_usage
"Aborting result %s: exceeded disk limit: %f > %f\n",
result->name, disk_usage, max_disk_usage
);
abort();
return true;

View File

@ -1,4 +1,4 @@
//Microsoft Developer Studio generated resource script.
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
@ -27,18 +27,18 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
// TEXTINCLUDE
//
1 TEXTINCLUDE MOVEABLE PURE
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE MOVEABLE PURE
2 TEXTINCLUDE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE MOVEABLE PURE
3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
@ -52,10 +52,10 @@ END
// Dialog
//
IDD_LOGIN DIALOG DISCARDABLE 0, 0, 283, 54
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Login to Project"
FONT 8, "MS Sans Serif"
IDD_LOGIN DIALOGEX 0, 0, 283, 54
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Attach to Project"
FONT 8, "MS Sans Serif", 0, 0, 0x0
BEGIN
DEFPUSHBUTTON "OK",IDOK,226,7,50,14
PUSHBUTTON "Cancel",IDCANCEL,226,24,50,14
@ -65,8 +65,8 @@ BEGIN
LTEXT "Account Key:",IDC_STATIC_AUTH,7,32,63,8
END
IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 300, 67
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
IDD_ABOUTBOX DIALOG 0, 0, 300, 67
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Boinc Beta version"
FONT 8, "MS Sans Serif"
BEGIN
@ -77,8 +77,8 @@ BEGIN
CTEXT "Open Beta",IDC_STATIC_BOTTOM,61,36,171,13
END
IDD_QUIT DIALOG DISCARDABLE 0, 0, 186, 70
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
IDD_QUIT DIALOG 0, 0, 186, 70
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Quit Project"
FONT 8, "MS Sans Serif"
BEGIN
@ -88,8 +88,8 @@ BEGIN
WS_VSCROLL | WS_TABSTOP
END
IDD_PROXY DIALOG DISCARDABLE 0, 0, 212, 278
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
IDD_PROXY DIALOG 0, 0, 212, 278
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "BOINC Proxy Server Setup"
FONT 8, "MS Sans Serif"
BEGIN
@ -122,8 +122,8 @@ BEGIN
ES_AUTOHSCROLL
END
IDD_CONNECT DIALOG DISCARDABLE 0, 0, 210, 46
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
IDD_CONNECT DIALOG 0, 0, 210, 46
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Connection"
FONT 8, "MS Sans Serif"
BEGIN
@ -140,7 +140,7 @@ END
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO MOVEABLE PURE
GUIDELINES DESIGNINFO
BEGIN
IDD_LOGIN, DIALOG
BEGIN
@ -190,7 +190,7 @@ END
// Menu
//
IDR_MAINFRAME MENU DISCARDABLE
IDR_MAINFRAME MENU
BEGIN
POPUP "&File"
BEGIN
@ -215,7 +215,7 @@ BEGIN
END
END
IDR_CONTEXT MENU DISCARDABLE
IDR_CONTEXT MENU
BEGIN
POPUP "StatusIcon"
BEGIN
@ -255,13 +255,13 @@ END
// Bitmap
//
IDB_LOGO BITMAP MOVEABLE PURE "res\\boinc.bmp"
IDB_LOGOSM BITMAP MOVEABLE PURE "res\\boincsm.bmp"
IDB_PROJ BITMAP MOVEABLE PURE "res\\proj.bmp"
IDB_RESULT BITMAP MOVEABLE PURE "res\\result.bmp"
IDB_USAGE BITMAP MOVEABLE PURE "res\\usage.bmp"
IDB_XFER BITMAP MOVEABLE PURE "res\\xfer.bmp"
IDB_MESS BITMAP MOVEABLE PURE "res\\mess.bmp"
IDB_LOGO BITMAP "res\\boinc.bmp"
IDB_LOGOSM BITMAP "res\\boincsm.bmp"
IDB_PROJ BITMAP "res\\proj.bmp"
IDB_RESULT BITMAP "res\\result.bmp"
IDB_USAGE BITMAP "res\\usage.bmp"
IDB_XFER BITMAP "res\\xfer.bmp"
IDB_MESS BITMAP "res\\mess.bmp"
/////////////////////////////////////////////////////////////////////////////
//
@ -270,15 +270,14 @@ IDB_MESS BITMAP MOVEABLE PURE "res\\mess.bmp"
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_ICON ICON DISCARDABLE "res\\icon.ico"
IDI_ICONHIGHLIGHT ICON DISCARDABLE "res\\iconhigh.ico"
IDI_ICONSMALL ICON DISCARDABLE "res\\iconsmall.ico"
IDI_ICONERROR ICON DISCARDABLE "res\\iconerror.ico"
IDI_ICONINFO ICON DISCARDABLE "res\\iconinfo.ico"
IDI_ICONNETWORK ICON DISCARDABLE "res\\iconnetwork.ico"
IDI_ICONWARNING ICON DISCARDABLE "res\\iconwarning.ico"
IDI_ICON ICON "res\\icon.ico"
IDI_ICONHIGHLIGHT ICON "res\\iconhigh.ico"
IDI_ICONSMALL ICON "res\\iconsmall.ico"
IDI_ICONERROR ICON "res\\iconerror.ico"
IDI_ICONINFO ICON "res\\iconinfo.ico"
IDI_ICONNETWORK ICON "res\\iconnetwork.ico"
IDI_ICONWARNING ICON "res\\iconwarning.ico"
#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
//
// Version
@ -301,14 +300,14 @@ BEGIN
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", "Space Sciences Laboratory\0"
VALUE "FileDescription", "boinc_gui\0"
VALUE "FileVersion", "2, 0, 18, 0\0"
VALUE "InternalName", "boinc_gui\0"
VALUE "LegalCopyright", "Copyright © 2003 SETI@home\0"
VALUE "OriginalFilename", "boinc_gui.exe\0"
VALUE "ProductName", "BOINC Core Client\0"
VALUE "ProductVersion", "2, 0, 18, 0\0"
VALUE "CompanyName", "Space Sciences Laboratory"
VALUE "FileDescription", "boinc_gui"
VALUE "FileVersion", "2, 0, 18, 0"
VALUE "InternalName", "boinc_gui"
VALUE "LegalCopyright", "Copyright © 2003 SETI@home"
VALUE "OriginalFilename", "boinc_gui.exe"
VALUE "ProductName", "BOINC Core Client"
VALUE "ProductVersion", "2, 0, 18, 0"
END
END
BLOCK "VarFileInfo"
@ -317,8 +316,6 @@ BEGIN
END
END
#endif // !_MAC
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////

View File

@ -7,8 +7,8 @@
#include "boinc_ss_res.h"
#include "win_util.h"
//#define DEBUG
#ifdef DEBUG
//#define SS_DEBUG
#ifdef SS_DEBUG
FILE* fout;
#endif
@ -29,7 +29,7 @@ int WINAPI WinMain(HINSTANCE h,HINSTANCE,LPSTR,int) {
cmd_line=GetCommandLine();
c = cmd_line;
#ifdef DEBUG
#ifdef SS_DEBUG
fout = fopen("C:/temp/boinc_scr.txt", "w");
fprintf(fout, "cmdline: %s\n", c);
#endif
@ -88,7 +88,7 @@ int WINAPI WinMain(HINSTANCE h,HINSTANCE,LPSTR,int) {
DialogBox(hInstance,MAKEINTRESOURCE(DLG_CONFIG),hwnd,ConfigDialogProc);
break;
}
#ifdef DEBUG
#ifdef SS_DEBUG
fprintf(fout, "screensaver exiting\n");
fflush(fout);
#endif
@ -119,7 +119,7 @@ void RunSaver( void ) {
startup_info.cb = sizeof(startup_info);
startup_info.lpReserved = NULL;
startup_info.lpDesktop = "";
#ifdef DEBUG
#ifdef SS_DEBUG
fprintf(fout, "launching core client: %s\n", client_path);
fprintf(fout, "dir: %s\n", client_dir);
#endif
@ -141,18 +141,18 @@ void RunSaver( void ) {
if (!flag) {
int retval = GetLastError();
#ifdef DEBUG
#ifdef SS_DEBUG
fprintf(fout, "Can't launch BOINC core client: error %d\n", retval);
#endif
} else {
#ifdef DEBUG
#ifdef SS_DEBUG
fprintf(fout, "Launched BOINC core client\n");
#endif
// wait up to 3 seconds for BOINC to start
//WaitForInputIdle(process_info.hProcess, 3000);
}
} else {
#ifdef DEBUG
#ifdef SS_DEBUG
fprintf(fout, "core client already running, sending msg\n");
#endif
BOINC_SS_START_MSG = RegisterWindowMessage( START_SS_MSG );
@ -179,7 +179,7 @@ void DoPreviewWindow(HWND hparwnd)
int cx=rc.right-rc.left, cy=rc.bottom-rc.top;
hScrWindow=CreateWindowEx(0,"ScrClass","SaverPreview",WS_CHILD|WS_VISIBLE,0,0,cx,cy,hparwnd,NULL,hInstance,NULL);
if (hScrWindow==NULL) return;
#ifdef DEBUG
#ifdef SS_DEBUG
fprintf(fout, "Doing preview window\n");
#endif
MSG msg;

View File

@ -45,20 +45,20 @@ CMainWindow* g_myWnd = NULL;
// returns: true if initialization is successful, otherwise false
// function: creates and shows the main window if boinc is not running,
// otherwise shows the currently running window
//#define DEBUG
#ifdef DEBUG
//#define SS_DEBUG
#ifdef SS_DEBUG
FILE* fout;
#endif
BOOL CMyApp::InitInstance()
{
#ifdef DEBUG
#ifdef SS_DEBUG
fout = fopen("c:/temp/core.txt", "w");
fprintf(fout, "starting\n");
fflush(fout);
#endif
HANDLE h = CreateMutex(NULL, true, RUN_MUTEX);
if ((h==0)|| GetLastError() == ERROR_ALREADY_EXISTS) {
#ifdef DEBUG
#ifdef SS_DEBUG
fprintf(fout, "couldn't create mutex; h=%x, e=%d\n", h, GetLastError());
fflush(fout);
#endif
@ -68,23 +68,23 @@ BOOL CMyApp::InitInstance()
}
m_pMainWnd = new CMainWindow();
#ifdef DEBUG
#ifdef SS_DEBUG
fprintf(fout, "not already running; %d projects\n", gstate.projects.size());
#endif
if(gstate.projects.size() == 0) {
#ifdef DEBUG
#ifdef SS_DEBUG
fprintf(fout, "sending login msg\n");
#endif
((CMainWindow*)m_pMainWnd)->SendMessage(WM_COMMAND, ID_SETTINGS_LOGIN);
}
if(gstate.started_by_screensaver) {
#ifdef DEBUG
#ifdef SS_DEBUG
fprintf(fout, "sending start_ss msg\n");
#endif
UINT nStartSaver = RegisterWindowMessage(START_SS_MSG);
((CMainWindow*)m_pMainWnd)->SendMessage(nStartSaver, 0);
}
#ifdef DEBUG
#ifdef SS_DEBUG
fprintf(fout, "returning from initInstance\n");
fflush(fout);
#endif
@ -98,7 +98,7 @@ int CMyApp::ExitInstance()
//gstate.free_mem();
#ifdef DEBUG
#ifdef SS_DEBUG
fprintf(fout, "exiting\n");
fclose(fout);
#endif
@ -237,7 +237,7 @@ CMainWindow::CMainWindow()
m_nNetActivityMsg = RegisterWindowMessage(NET_ACTIVITY_MSG);
m_uScreenSaverMsg = RegisterWindowMessage(START_SS_MSG);
m_uEndSSMsg = RegisterWindowMessage(END_SS_MSG);
#ifdef DEBUG
#ifdef SS_DEBUG
fprintf(fout, "CMainWIndow\n");
#endif
}
@ -303,8 +303,9 @@ void CMainWindow::ClearProjectItems(char *proj_url) {
void CMainWindow::UpdateGUI(CLIENT_STATE* pcs)
{
CString strBuf;
float totalres;
int i, n;
double totalres;
unsigned int ui;
int i, n;
string appname;
// If we failed to set the taskbar icon before, keep trying!
@ -319,8 +320,8 @@ void CMainWindow::UpdateGUI(CLIENT_STATE* pcs)
m_ProjectListCtrl.SetRedraw(FALSE);
totalres = 0;
Syncronize(&m_ProjectListCtrl, (vector<void*>*)(&pcs->projects));
for(i = 0; i < pcs->projects.size(); i ++) {
totalres += pcs->projects[i]->resource_share;
for(ui = 0; ui < pcs->projects.size(); ui ++) {
totalres += pcs->projects[ui]->resource_share;
}
for(i = 0; i < m_ProjectListCtrl.GetItemCount(); i ++) {
PROJECT* pr = (PROJECT*)m_ProjectListCtrl.GetItemData(i);
@ -618,23 +619,23 @@ void CMainWindow::UpdateGUI(CLIENT_STATE* pcs)
m_UsagePieCtrl.SetPiece(2, xDiskUsage); // Used space: BOINC
m_UsagePieCtrl.RedrawWindow(NULL, NULL, RDW_INVALIDATE|RDW_UPDATENOW|RDW_NOERASE|RDW_FRAME);
while(m_UsageBOINCPieCtrl.GetItemCount() - 1 < gstate.projects.size()) {
while(m_UsageBOINCPieCtrl.GetItemCount() - 1 < (int)gstate.projects.size()) {
m_UsageBOINCPieCtrl.AddPiece("", GetPieColor(m_UsageBOINCPieCtrl.GetItemCount()), 0);
}
while(m_UsageBOINCPieCtrl.GetItemCount() - 1 > gstate.projects.size()) {
while(m_UsageBOINCPieCtrl.GetItemCount() - 1 > (int)gstate.projects.size()) {
m_UsageBOINCPieCtrl.RemovePiece(m_UsageBOINCPieCtrl.GetItemCount() - 1);
}
m_UsageBOINCPieCtrl.SetTotal(xDiskUsage);
m_UsageBOINCPieCtrl.SetPiece(0, 1); // BOINC: core application
for(i = 0; i < gstate.projects.size(); i ++) {
for(ui = 0; ui < gstate.projects.size(); ui ++) {
double xUsage;
CString strLabel;
strLabel.Format("%s", gstate.projects[i]->project_name);
gstate.project_disk_usage(gstate.projects[i], xUsage);
m_UsageBOINCPieCtrl.SetPieceLabel(i + 1, strLabel.GetBuffer(0));
m_UsageBOINCPieCtrl.SetPiece(i + 1, xUsage);
strLabel.Format("%s", gstate.projects[ui]->project_name);
gstate.project_disk_usage(gstate.projects[ui], xUsage);
m_UsageBOINCPieCtrl.SetPieceLabel(ui + 1, strLabel.GetBuffer(0));
m_UsageBOINCPieCtrl.SetPiece(ui + 1, xUsage);
xDiskUsage -= xUsage;
}
m_UsageBOINCPieCtrl.SetPiece(0, xDiskUsage); // BOINC: core application
@ -983,7 +984,7 @@ void CMainWindow::SaveUserSettings()
static const int message_header_widths[] = {
DEF_COL_WIDTH,
DEF_COL_WIDTH*1.5,
(int)(DEF_COL_WIDTH*1.5),
DEF_COL_WIDTH*4
};
@ -1086,7 +1087,7 @@ void CMainWindow::LoadLanguage()
CString strItem, strItemNoAmp;
char szItem[256];
int i, is;
for(i = 0; i < m_MainMenu.GetMenuItemCount(); i ++) {
for(i = 0; i < (int)m_MainMenu.GetMenuItemCount(); i ++) {
m_MainMenu.GetMenuString(i, strItem, MF_BYPOSITION);
strItemNoAmp = strItem; strItemNoAmp.Remove('&');
strSection.Format("MENU-%s", strItemNoAmp);
@ -1094,14 +1095,14 @@ void CMainWindow::LoadLanguage()
m_MainMenu.ModifyMenu(i, MF_BYPOSITION|MF_STRING, 0, szItem);
CMenu* pSubMenu = m_MainMenu.GetSubMenu(i);
if(!pSubMenu) continue;
for(is = 0; is < pSubMenu->GetMenuItemCount(); is ++) {
for(is = 0; is < (int)pSubMenu->GetMenuItemCount(); is ++) {
pSubMenu->GetMenuString(is, strItem, MF_BYPOSITION);
if (UpdateLanguageString(strSection, strItem, strPath)) {
pSubMenu->ModifyMenu(is, MF_BYPOSITION|MF_STRING, pSubMenu->GetMenuItemID(is), strItem);
}
}
}
for(i = 0; i < m_ContextMenu.GetMenuItemCount(); i ++) {
for(i = 0; i < (int)m_ContextMenu.GetMenuItemCount(); i ++) {
m_ContextMenu.GetMenuString(i, strItem, MF_BYPOSITION);
strItemNoAmp = strItem; strItemNoAmp.Remove('&');
strSection.Format("MENU-%s", strItemNoAmp);
@ -1109,7 +1110,7 @@ void CMainWindow::LoadLanguage()
m_ContextMenu.ModifyMenu(i, MF_BYPOSITION|MF_STRING, 0, szItem);
CMenu* pSubMenu = m_ContextMenu.GetSubMenu(i);
if(!pSubMenu) continue;
for(is = 0; is < pSubMenu->GetMenuItemCount(); is ++) {
for(is = 0; is < (int)pSubMenu->GetMenuItemCount(); is ++) {
pSubMenu->GetMenuString(is, strItem, MF_BYPOSITION);
if (UpdateLanguageString(strSection, strItem, strPath)) {
pSubMenu->ModifyMenu(is, MF_BYPOSITION|MF_STRING, pSubMenu->GetMenuItemID(is), strItem);
@ -1162,10 +1163,10 @@ DWORD CMainWindow::GetUserIdleTime()
// vector does not contain.
void CMainWindow::Syncronize(CProgressListCtrl* pProg, vector<void*>* pVect)
{
int i, j;
int i, j;
// add items to list that are not already in it
for(i = 0; i < pVect->size(); i ++) {
for(i = 0; i < (int)pVect->size(); i ++) {
void* item = (*pVect)[i];
BOOL contained = false;
for(j = 0; j < pProg->GetItemCount(); j ++) {
@ -1185,7 +1186,7 @@ void CMainWindow::Syncronize(CProgressListCtrl* pProg, vector<void*>* pVect)
for(i = 0; i < pProg->GetItemCount(); i ++) {
DWORD item = pProg->GetItemData(i);
BOOL contained = false;
for(j = 0; j < pVect->size(); j ++) {
for(j = 0; j < (int)pVect->size(); j ++) {
if(item == (DWORD)(*pVect)[j]) {
contained = true;
break;
@ -1216,7 +1217,7 @@ void CMainWindow::PostNcDestroy()
// function: handles any messages not handled by the window previously
LRESULT CMainWindow::DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
#ifdef DEBUG
#ifdef SS_DEBUG
fprintf(fout, "message %d\n", message);
#endif
if(m_nShowMsg == message) {
@ -1593,7 +1594,7 @@ void CMainWindow::OnBenchmarksEnd()
void CMainWindow::OnCommandExit()
{
static bool already_exited = false;
#ifdef DEBUG
#ifdef SS_DEBUG
fprintf(fout, "CMainWindow::onCommandExit\n");
#endif
if (already_exited) return;
@ -1740,7 +1741,7 @@ int CMainWindow::OnCreate(LPCREATESTRUCT lpcs)
SetMenu(&m_MainMenu);
LoadLanguage();
#ifdef DEBUG
#ifdef SS_DEBUG
fprintf(fout, "CMainWIndow:OnCreate\n");
#endif
// create project list control
@ -1780,7 +1781,7 @@ int CMainWindow::OnCreate(LPCREATESTRUCT lpcs)
m_MessageListCtrl.SetMenuItems(szTitles, MESSAGE_COLS);
for(i = 0; i < MESSAGE_COLS; i ++) {
int width = DEF_COL_WIDTH;
if(i == 1) width *= 1.5;
if(i == 1) width = (int)(width*1.5);
if(i == 2) width *= 4;
m_MessageListCtrl.InsertColumn(i, g_szColumnTitles[MESSAGE_ID][i], LVCFMT_LEFT, width, -1);
}
@ -1872,7 +1873,7 @@ int CMainWindow::OnCreate(LPCREATESTRUCT lpcs)
command_line = GetCommandLine();
argc = parse_command_line( command_line, argv );
#ifdef DEBUG
#ifdef SS_DEBUG
for (i=0; i<argc; i++) {
fprintf(fout, "arg %d: %s\n", i, argv[i]);
}
@ -1923,7 +1924,7 @@ int CMainWindow::OnCreate(LPCREATESTRUCT lpcs)
}
UpdateRunRequestFileMenu();
#ifdef DEBUG
#ifdef SS_DEBUG
fprintf(fout, "returning from OnCreate\n");
#endif
return 0;
@ -2195,11 +2196,11 @@ void CMainWindow::OnTimer(UINT uEventID)
KillTimer(m_nGuiTimerID);
// update state and gui
#ifdef DEBUG
#ifdef SS_DEBUG
fprintf(fout, "calling do_something\n");
#endif
while(gstate.do_something());
#ifdef DEBUG
#ifdef SS_DEBUG
fprintf(fout, "return from do_something\n");
fflush(fout);
#endif

View File

@ -1428,18 +1428,18 @@
<Filter
Name="Resource Files"
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
<File
RelativePath="..\client\win\res\boinc.bmp">
</File>
<File
RelativePath="..\client\win\boinc.bmp">
</File>
<File
RelativePath="..\client\win\res\boincsm.bmp">
RelativePath="..\client\win\res\boinc.bmp">
</File>
<File
RelativePath="..\client\win\boincsm.bmp">
</File>
<File
RelativePath="..\client\win\res\boincsm.bmp">
</File>
<File
RelativePath="..\res\CoreClient.ico">
</File>
@ -1479,6 +1479,9 @@
<File
RelativePath="..\client\win\res\smallico.ico">
</File>
<File
RelativePath="..\client\win\res\usage.bmp">
</File>
<File
RelativePath="..\client\win\res\xfer.bmp">
</File>

View File

@ -1093,29 +1093,6 @@
CompileAs="2"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Client\win\Win_main.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
CompileAs="2"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
BrowseInformation="1"
CompileAs="2"/>
</FileConfiguration>
</File>
<File
RelativePath="..\Client\win\Win_net.cpp">
<FileConfiguration
@ -1428,18 +1405,18 @@
<Filter
Name="Resource Files"
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
<File
RelativePath="..\client\win\boinc.bmp">
</File>
<File
RelativePath="..\client\win\res\boinc.bmp">
</File>
<File
RelativePath="..\client\win\boincsm.bmp">
RelativePath="..\client\win\boinc.bmp">
</File>
<File
RelativePath="..\client\win\res\boincsm.bmp">
</File>
<File
RelativePath="..\client\win\boincsm.bmp">
</File>
<File
RelativePath="..\res\CoreClient.ico">
</File>

View File

@ -22,7 +22,7 @@ Department=
Type=Internet Application
Author=
HomeURL=
InstallRoot=C:\Documents and Settings\Dan Werthimer\Desktop\quarl\boinc\win_build\installer
InstallRoot=C:\Documents and Settings\davea\My Documents\boinc_build\boinc\win_build\installer
UpdateURL=http://
set_level=Level 3
InstallationGUID=85c8015b-ff0d-4395-ad2f-8b300b0a0171

View File

@ -14,7 +14,6 @@ Creating Package
File 'SETUP.INI' in package.
File 'setup.ins' in package.
File 'setup.lid' in package.
File 'Thumbs.db' in package.
File '_INST32I.EX_' in package.
File '_ISDel.exe' in package.
File '_Setup.dll' in package.
@ -26,6 +25,6 @@ Creating EXE
Creating data section
Appending data section
Appending file groups
C:\DOCUME~1\DANWER~1\LOCALS~1\Temp\pftw1.pkg
C:\DOCUME~1\davea\LOCALS~1\Temp\pftw1.pkg
Clean Up
Directory 'C:\DOCUME~1\DANWER~1\LOCALS~1\Temp\iftwTmp' removed.
Directory 'C:\DOCUME~1\davea\LOCALS~1\Temp\iftwTmp' removed.

View File

@ -13,15 +13,15 @@ SubFolders=1
ApplicationName=BOINC
Description=Berkeley Open Infrastructure for Network Computing
Comments=
Notice=Copyright 2002-2003 University of California, Berkeley
Version=2.14
OutputSpec=boinc_2.14_windows_intelx86.exe
Notice=Copyright 2002-2004 University of California, Berkeley
Version=2.18
OutputSpec=boinc_2.18_windows_intelx86.exe
GUIDs=0
Type=2
Compress=1
Sign=0
Transfer=0
Files=23
Files=22
[Engine]
Setup=Disk1\Setup.exe
@ -151,48 +151,42 @@ Flags=1
Disk=0
[File 16]
Name=Thumbs.db
Path=Media\Default\Disk Images\Disk1\
Flags=1
Disk=0
[File 17]
Name=_INST32I.EX_
Path=Media\Default\Disk Images\Disk1\
Flags=524289
Disk=0
[File 18]
[File 17]
Name=_ISDel.exe
Path=Media\Default\Disk Images\Disk1\
Flags=589825
Disk=0
[File 19]
[File 18]
Name=_Setup.dll
Path=Media\Default\Disk Images\Disk1\
Flags=655377
Disk=0
[File 20]
[File 19]
Name=_sys1.cab
Path=Media\Default\Disk Images\Disk1\
Flags=2097153
Disk=0
[File 21]
[File 20]
Name=_sys1.hdr
Path=Media\Default\Disk Images\Disk1\
Flags=2097153
Disk=0
[File 22]
[File 21]
Name=_user1.cab
Path=Media\Default\Disk Images\Disk1\
Flags=2097153
Disk=0
[File 23]
[File 22]
Name=_user1.hdr
Path=Media\Default\Disk Images\Disk1\
Flags=2097153