Author: mpiulachs
Date: Sun Nov 25 23:09:27 2007
New Revision: 30753
URL:
http://svn.reactos.org/svn/reactos?rev=30753&view=rev
Log:
- Modified butterflies screensaver registry key
- Updated scrnsave library reference name
- started removing MSVC resource stuff
- renamed scrnsave to blankscr to avoid name conflicts with scrnsave library
- modified scrnsave (aka blankscr) to use scrnsave library . simplified the code a lot!
- various other small changes
Added:
trunk/rosapps/applications/screensavers/scrnsave/scrnsave.def (with props)
Modified:
trunk/rosapps/applications/screensavers/butterflies/butterflies.c
trunk/rosapps/applications/screensavers/butterflies/butterflies.def
trunk/rosapps/applications/screensavers/butterflies/butterflies.rbuild
trunk/rosapps/applications/screensavers/butterflies/resource.h
trunk/rosapps/applications/screensavers/scrnsave/lang/bg-BG.rc
trunk/rosapps/applications/screensavers/scrnsave/lang/de-DE.rc
trunk/rosapps/applications/screensavers/scrnsave/lang/en-US.rc
trunk/rosapps/applications/screensavers/scrnsave/lang/fr-FR.rc
trunk/rosapps/applications/screensavers/scrnsave/lang/lt-LT.rc
trunk/rosapps/applications/screensavers/scrnsave/lang/nl-NL.rc
trunk/rosapps/applications/screensavers/scrnsave/lang/sk-SK.rc
trunk/rosapps/applications/screensavers/scrnsave/lang/uk-UA.rc
trunk/rosapps/applications/screensavers/scrnsave/scrnsave.c
trunk/rosapps/applications/screensavers/scrnsave/scrnsave.rbuild
Modified: trunk/rosapps/applications/screensavers/butterflies/butterflies.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/screensavers/…
==============================================================================
--- trunk/rosapps/applications/screensavers/butterflies/butterflies.c (original)
+++ trunk/rosapps/applications/screensavers/butterflies/butterflies.c Sun Nov 25 23:09:27
2007
@@ -14,7 +14,7 @@
GLuint texture[3]; //stores texture objects and display list
-LPCTSTR registryPath = ("Software\\tHaPuTeRProductions\\Lesson38Saver");
+LPCTSTR registryPath = ("Software\\Microsoft\\ScreenSavers\\Butterflies");
BOOL dRotate;
@@ -299,25 +299,25 @@
{
switch (message)
{
- case WM_INITDIALOG:
- ReadRegistry();
- CheckDlgButton(hDlg, ROTATE, dRotate);
- return TRUE;
- case WM_COMMAND:
- switch (LOWORD(wParam))
- {
- case IDOK:
- dRotate = (IsDlgButtonChecked(hDlg, ROTATE) == BST_CHECKED);
- WriteRegistry();
- EndDialog(hDlg, TRUE);
- return TRUE;
- case IDCANCEL:
- EndDialog(hDlg, TRUE);
- break;
- case IDABOUT:
- DialogBox(hInstance, MAKEINTRESOURCE(IDD_DLG_ABOUT), hDlg, (DLGPROC)AboutProc);
- break;
- }
+ case WM_INITDIALOG:
+ ReadRegistry();
+ CheckDlgButton(hDlg, ROTATE, dRotate);
+ return TRUE;
+ case WM_COMMAND:
+ switch (LOWORD(wParam))
+ {
+ case IDOK:
+ dRotate = (IsDlgButtonChecked(hDlg, ROTATE) == BST_CHECKED);
+ WriteRegistry();
+ EndDialog(hDlg, TRUE);
+ return TRUE;
+ case IDCANCEL:
+ EndDialog(hDlg, TRUE);
+ break;
+ case IDABOUT:
+ DialogBox(hInstance, MAKEINTRESOURCE(IDD_DLG_ABOUT), hDlg,
(DLGPROC)AboutProc);
+ break;
+ }
}
return FALSE;
Modified: trunk/rosapps/applications/screensavers/butterflies/butterflies.def
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/screensavers/…
==============================================================================
--- trunk/rosapps/applications/screensavers/butterflies/butterflies.def (original)
+++ trunk/rosapps/applications/screensavers/butterflies/butterflies.def Sun Nov 25
23:09:27 2007
@@ -1,6 +1,6 @@
-NAME LESSON38SAVER.SCR
+NAME butterflies.SCR
-DESCRIPTION 'Lesson38Saver screen saver'
+DESCRIPTION 'OpenGL Butterflies screen saver'
HEAPSIZE 1024
STACKSIZE 4096
Modified: trunk/rosapps/applications/screensavers/butterflies/butterflies.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/screensavers/…
==============================================================================
--- trunk/rosapps/applications/screensavers/butterflies/butterflies.rbuild (original)
+++ trunk/rosapps/applications/screensavers/butterflies/butterflies.rbuild Sun Nov 25
23:09:27 2007
@@ -3,7 +3,7 @@
<module name="butterflies" type="win32scr"
installbase="system32" installname="butterflies.scr"
allowwarnings="true">
<importlibrary definition="butterflies.def" />
<include base="butterflies">.</include>
- <library>scrnsavelib</library>
+ <library>scrnsave</library>
<library>kernel32</library>
<library>user32</library>
<library>gdi32</library>
@@ -12,7 +12,7 @@
<library>advapi32</library>
<library>shell32</library>
- <metadata description = "Butterflies screensaver" />
+ <metadata description = "OpenGL Butterflies screensaver" />
<file>butterflies.c</file>
<file>butterflies.rc</file>
Modified: trunk/rosapps/applications/screensavers/butterflies/resource.h
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/screensavers/…
==============================================================================
--- trunk/rosapps/applications/screensavers/butterflies/resource.h (original)
+++ trunk/rosapps/applications/screensavers/butterflies/resource.h Sun Nov 25 23:09:27
2007
@@ -1,7 +1,4 @@
-//{{NO_DEPENDENCIES}}
-// Microsoft Developer Studio generated include file.
-// Used by Lesson38Saver.rc
-//
+
#define IDS_STR_DESCRIP 1
#define IDABOUT 3
#define IDI_ICON_SCREEN 100
@@ -14,14 +11,3 @@
#define WEBPAGE1 1001
#define WEBPAGE2 1002
#define IDD_DLG_SCREEN 2003
-
-// Next default values for new objects
-//
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 108
-#define _APS_NEXT_COMMAND_VALUE 40001
-#define _APS_NEXT_CONTROL_VALUE 1003
-#define _APS_NEXT_SYMED_VALUE 106
-#endif
-#endif
Modified: trunk/rosapps/applications/screensavers/scrnsave/lang/bg-BG.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/screensavers/…
==============================================================================
--- trunk/rosapps/applications/screensavers/scrnsave/lang/bg-BG.rc (original)
+++ trunk/rosapps/applications/screensavers/scrnsave/lang/bg-BG.rc Sun Nov 25 23:09:27
2007
@@ -2,7 +2,7 @@
STRINGTABLE DISCARDABLE
BEGIN
- IDS_DESCRIPTION "Ïîäðàçáðàí åêðàíåí ïðåäïàçèòåë"
+ IDS_DESCRIPTION "Blank"
IDS_TITLE "Çà"
IDS_TEXT "Íÿìà âúçìîæíîñò çà íàñòðîéêè."
END
Modified: trunk/rosapps/applications/screensavers/scrnsave/lang/de-DE.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/screensavers/…
==============================================================================
--- trunk/rosapps/applications/screensavers/scrnsave/lang/de-DE.rc (original)
+++ trunk/rosapps/applications/screensavers/scrnsave/lang/de-DE.rc Sun Nov 25 23:09:27
2007
@@ -2,7 +2,7 @@
STRINGTABLE DISCARDABLE
BEGIN
- IDS_DESCRIPTION "Standard Bildschirmschoner"
+ IDS_DESCRIPTION "Blank"
IDS_TITLE "Über"
IDS_TEXT "Keinerlei Einstellungen notwendig."
END
Modified: trunk/rosapps/applications/screensavers/scrnsave/lang/en-US.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/screensavers/…
==============================================================================
--- trunk/rosapps/applications/screensavers/scrnsave/lang/en-US.rc (original)
+++ trunk/rosapps/applications/screensavers/scrnsave/lang/en-US.rc Sun Nov 25 23:09:27
2007
@@ -2,7 +2,7 @@
STRINGTABLE DISCARDABLE
BEGIN
- IDS_DESCRIPTION "Default ScreenSaver"
+ IDS_DESCRIPTION "Blank"
IDS_TITLE "About"
IDS_TEXT "No options need to be set."
END
Modified: trunk/rosapps/applications/screensavers/scrnsave/lang/fr-FR.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/screensavers/…
==============================================================================
--- trunk/rosapps/applications/screensavers/scrnsave/lang/fr-FR.rc (original)
+++ trunk/rosapps/applications/screensavers/scrnsave/lang/fr-FR.rc Sun Nov 25 23:09:27
2007
@@ -2,7 +2,7 @@
STRINGTABLE DISCARDABLE
BEGIN
- IDS_DESCRIPTION "Écran de veille par défaut"
+ IDS_DESCRIPTION "Blank"
IDS_TITLE "À propos de"
IDS_TEXT "Il n'y a aucune option à définir."
END
Modified: trunk/rosapps/applications/screensavers/scrnsave/lang/lt-LT.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/screensavers/…
==============================================================================
--- trunk/rosapps/applications/screensavers/scrnsave/lang/lt-LT.rc (original)
+++ trunk/rosapps/applications/screensavers/scrnsave/lang/lt-LT.rc Sun Nov 25 23:09:27
2007
@@ -11,7 +11,7 @@
STRINGTABLE DISCARDABLE
BEGIN
- IDS_DESCRIPTION "Standartinë ekrano uþsklanda"
+ IDS_DESCRIPTION "Blank"
IDS_TITLE "Apie"
IDS_TEXT "Nëra keièiamø parametrø."
END
Modified: trunk/rosapps/applications/screensavers/scrnsave/lang/nl-NL.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/screensavers/…
==============================================================================
--- trunk/rosapps/applications/screensavers/scrnsave/lang/nl-NL.rc (original)
+++ trunk/rosapps/applications/screensavers/scrnsave/lang/nl-NL.rc Sun Nov 25 23:09:27
2007
@@ -2,7 +2,7 @@
STRINGTABLE DISCARDABLE
BEGIN
- IDS_DESCRIPTION "Standaard Schermbeveiliging"
+ IDS_DESCRIPTION "Blank"
IDS_TITLE "Informatie"
IDS_TEXT "Geen dingen om in te stellen."
END
Modified: trunk/rosapps/applications/screensavers/scrnsave/lang/sk-SK.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/screensavers/…
==============================================================================
--- trunk/rosapps/applications/screensavers/scrnsave/lang/sk-SK.rc (original)
+++ trunk/rosapps/applications/screensavers/scrnsave/lang/sk-SK.rc Sun Nov 25 23:09:27
2007
@@ -6,7 +6,7 @@
STRINGTABLE DISCARDABLE
BEGIN
- IDS_DESCRIPTION "Predvolený etriè obrazovky"
+ IDS_DESCRIPTION "Blank"
IDS_TITLE "Èo je ..."
IDS_TEXT "Nie sú potrebné iadne nastavenia."
END
Modified: trunk/rosapps/applications/screensavers/scrnsave/lang/uk-UA.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/screensavers/…
==============================================================================
--- trunk/rosapps/applications/screensavers/scrnsave/lang/uk-UA.rc (original)
+++ trunk/rosapps/applications/screensavers/scrnsave/lang/uk-UA.rc Sun Nov 25 23:09:27
2007
@@ -10,7 +10,7 @@
STRINGTABLE DISCARDABLE
BEGIN
- IDS_DESCRIPTION "Çàñòàâêà çà çàìîâ÷óâàííÿì"
+ IDS_DESCRIPTION "Blank"
IDS_TITLE "Ïðî"
IDS_TEXT "Öÿ çàñòàâêà íå ìຠíàëàøòîâóâàíèõ ïàðàìåòð³â."
END
Modified: trunk/rosapps/applications/screensavers/scrnsave/scrnsave.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/screensavers/…
==============================================================================
--- trunk/rosapps/applications/screensavers/scrnsave/scrnsave.c (original)
+++ trunk/rosapps/applications/screensavers/scrnsave/scrnsave.c Sun Nov 25 23:09:27 2007
@@ -17,199 +17,42 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
-#include <windows.h>
-#include <tchar.h>
+#include <windows.h>
+#include <scrnsave.h>
#include "resource.h"
-#define APPNAME _T("Scrnsave")
+LRESULT WINAPI ScreenSaverProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
+{
+ static HDC hdc;
+ static RECT rc;
-
-HINSTANCE hInstance;
-
-BOOL fullscreen = FALSE;
-
-
-LRESULT WINAPI WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
-{
- static POINT ptLast;
- static POINT ptCursor;
- static BOOL fFirstTime = TRUE;
-
- switch (msg)
- {
- case WM_DESTROY:
- ShowCursor(TRUE);
- PostQuitMessage(0);
- break;
-
- // break out of screen-saver if any keyboard activity
- case WM_NOTIFY:
- case WM_SYSKEYDOWN:
- PostMessage(hwnd, WM_CLOSE, 0, 0);
- break;
-
- // break out of screen-saver if any mouse activity
- case WM_LBUTTONDOWN:
- case WM_LBUTTONUP:
- case WM_RBUTTONDOWN:
- case WM_RBUTTONUP:
- case WM_MBUTTONDOWN:
- case WM_MBUTTONUP:
- case WM_MOUSEMOVE:
- // If we've got a parent then we must be a preview
- if(GetParent(hwnd) != 0)
- return 0;
-
- if(fFirstTime)
- {
- GetCursorPos(&ptLast);
- fFirstTime = FALSE;
- }
-
- GetCursorPos(&ptCursor);
-
- // if the mouse has moved more than 3 pixels then exit
- if(abs(ptCursor.x - ptLast.x) >= 3 || abs(ptCursor.y - ptLast.y) >= 3)
- PostMessage(hwnd, WM_CLOSE, 0, 0);
-
- ptLast = ptCursor;
-
- return 0;
- }
-
- return DefWindowProc(hwnd, msg, wParam, lParam);
+ switch(message)
+ {
+ case WM_CREATE:
+ break;
+ case WM_DESTROY:
+ PostQuitMessage(0);
+ break;
+ case WM_ERASEBKGND:
+ hdc = GetDC(hwnd);
+ GetClientRect (hwnd, &rc);
+ FillRect (hdc, &rc, GetStockObject(BLACK_BRUSH));
+ ReleaseDC(hwnd,hdc);
+ break;
+ case WM_PAINT:
+ break;
+ default:
+ return DefScreenSaverProc(hwnd, message, wParam, lParam);
+ }
+ return 0;
}
-void InitSaver(HWND hwndParent)
-{
- WNDCLASS wc;
- ZeroMemory(&wc, sizeof(wc));
- wc.style = CS_HREDRAW | CS_VREDRAW;
- wc.lpfnWndProc = WndProc;
- wc.lpszClassName = APPNAME;
- wc.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
- RegisterClass(&wc);
-
- if (hwndParent != 0)
- {
- RECT rect;
- GetClientRect(hwndParent, &rect);
- CreateWindow(APPNAME, APPNAME,
- WS_VISIBLE | WS_CHILD,
- 0, 0,
- rect.right,
- rect.bottom,
- hwndParent, 0,
- hInstance, NULL);
- fullscreen = FALSE;
- }
- else
- {
- HWND hwnd;
- hwnd = CreateWindowEx(WS_EX_TOPMOST,
- APPNAME,
- APPNAME,
- WS_VISIBLE | WS_POPUP,
- 0, 0,
- GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN),
- HWND_DESKTOP, 0,
- hInstance, NULL);
-
- SetWindowPos(hwnd,
- 0, 0, 0, 0, 0,
- SWP_NOZORDER|SWP_NOACTIVATE|SWP_NOSIZE|SWP_SHOWWINDOW);
-
- ShowCursor(FALSE);
- fullscreen = TRUE;
- }
+BOOL WINAPI ScreenSaverConfigureDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM
lParam)
+{
+ return FALSE;
}
-VOID ParseCommandLine(LPWSTR szCmdLine, UCHAR *chOption, HWND *hwndParent)
+BOOL WINAPI RegisterDialogClasses(HANDLE hInst)
{
- UCHAR ch = *szCmdLine++;
-
- if(ch == '-' || ch == '/')
- ch = *szCmdLine++;
-
- if(ch >= 'A' && ch <= 'Z')
- ch += 'a' - 'A'; //convert to lower case
-
- *chOption = ch;
- ch = *szCmdLine++;
-
- if(ch == ':')
- ch = *szCmdLine++;
-
- while(ch == ' ' || ch == '\t')
- ch = *szCmdLine++;
-
- if(isdigit(ch))
- {
- unsigned int i = _wtoi(szCmdLine - 1);
- *hwndParent = (HWND)i;
- }
- else
- *hwndParent = NULL;
+ return TRUE;
}
-
-void Configure(void)
-{
- TCHAR szTitle[256];
- TCHAR szText[256];
-
- LoadString(hInstance,
- IDS_TITLE,
- szTitle,
- 256);
-
- LoadString(hInstance,
- IDS_TEXT,
- szText,
- 256);
-
- MessageBox(0,
- szText,
- szTitle,
- MB_OK | MB_ICONWARNING);
-}
-
-
-int CALLBACK wWinMain (HINSTANCE hInst,
- HINSTANCE hPrev,
- LPWSTR lpCmdLine,
- int iCmdShow)
-{
- HWND hwndParent;
- UINT nPreviousState;
- UCHAR chOption;
- MSG Message;
-
- hInstance = hInst;
-
- ParseCommandLine(lpCmdLine, &chOption, &hwndParent);
-
- SystemParametersInfo(SPI_SETSCREENSAVERRUNNING, TRUE, &nPreviousState, 0);
-
- switch (chOption)
- {
- case 's':
- InitSaver(0);
- break;
-
- case 'p':
- InitSaver(hwndParent);
- break;
-
- case 'c':
- default:
- Configure();
- return 0;
- }
-
- while (GetMessage(&Message, 0, 0, 0))
- DispatchMessage(&Message);
-
- SystemParametersInfo(SPI_SETSCREENSAVERRUNNING, FALSE, &nPreviousState, 0);
-
- return Message.wParam;
-}
Added: trunk/rosapps/applications/screensavers/scrnsave/scrnsave.def
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/screensavers/…
==============================================================================
--- trunk/rosapps/applications/screensavers/scrnsave/scrnsave.def (added)
+++ trunk/rosapps/applications/screensavers/scrnsave/scrnsave.def Sun Nov 25 23:09:27
2007
@@ -1,0 +1,7 @@
+NAME blankscr.SCR
+
+DESCRIPTION 'Blank screen saver'
+
+EXPORTS
+ ScreenSaverProc
+ ScreenSaverConfigureDialog
Propchange: trunk/rosapps/applications/screensavers/scrnsave/scrnsave.def
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/rosapps/applications/screensavers/scrnsave/scrnsave.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/screensavers/…
==============================================================================
--- trunk/rosapps/applications/screensavers/scrnsave/scrnsave.rbuild (original)
+++ trunk/rosapps/applications/screensavers/scrnsave/scrnsave.rbuild Sun Nov 25 23:09:27
2007
@@ -1,12 +1,15 @@
<?xml version="1.0"?>
<!DOCTYPE module SYSTEM "../../../../tools/rbuild/project.dtd">
-<module name="scrnsave" type="win32scr"
installbase="system32" installname="scrnsave.scr"
unicode="true">
+<module name="blankscr" type="win32scr"
installbase="system32" installname="scrnsave.scr">
+ <importlibrary definition="scrnsave.def" />
+ <library>scrnsave</library>
<library>kernel32</library>
<library>user32</library>
<library>gdi32</library>
<library>opengl32</library>
<library>glu32</library>
- <library>winmm</library>
+ <library>advapi32</library>
+ <library>shell32</library>
<file>scrnsave.c</file>
<file>scrnsave.rc</file>