added display properties skeleton

svn path=/trunk/; revision=10407
This commit is contained in:
Gero Kuehn 2004-08-07 00:05:23 +00:00
parent 956358275c
commit 17fbcf5e93
12 changed files with 579 additions and 1 deletions

View file

@ -6,7 +6,7 @@ PATH_TO_TOP = ../..
include $(PATH_TO_TOP)/rules.mak
CONTROL_PANELS = access appwiz ncpa sysdm control
CONTROL_PANELS = access appwiz desk ncpa sysdm control
all: $(CONTROL_PANELS)

View file

@ -0,0 +1,14 @@
*.coff
*.cpl
*.d
*.a
*.o
*.sym
*.map
*.tmp
*.ncb
*.opt
*.plg
Debug
Release

View file

@ -0,0 +1,47 @@
# $Id: Makefile,v 1.1 2004/08/07 00:05:23 kuehng Exp $
PATH_TO_TOP = ../../..
TARGET_TYPE = dynlink
TARGET_EXTENSION = .cpl
TARGET_NAME = desk
TARGET_INSTALLDIR = system32
TARGET_BASE = $(TARGET_BASE_LIB_CPL_SYSDM)
TARGET_CFLAGS = \
-I./include \
-DUNICODE \
-D_UNICODE \
-D__REACTOS__ \
-Wall \
-Werror \
-fno-builtin
TARGET_LFLAGS = -nostartfiles
TARGET_SDKLIBS = kernel32.a user32.a comctl32.a
TARGET_GCCLIBS = gcc
TARGET_PCH =
TARGET_CLEAN =
TARGET_OBJECTS = desk.o
DEP_OBJECTS = $(TARGET_OBJECTS)
include $(PATH_TO_TOP)/rules.mak
include $(TOOLS_PATH)/helper.mk
include $(TOOLS_PATH)/depend.mk
%/TAGS:
etags -o $(@D)/TAGS $(@D)/\*.c
etags: ./TAGS

216
reactos/lib/cpl/desk/desk.c Normal file
View file

@ -0,0 +1,216 @@
/*
* ReactOS
* Copyright (C) 2004 ReactOS Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: desk.c,v 1.1 2004/08/07 00:05:23 kuehng Exp $
*
* PROJECT: ReactOS Display Control Panel
* FILE: lib/cpl/desk/desk.c
* PURPOSE: ReactOS Display Control Panel
* PROGRAMMER: Gero Kuehn (reactos.filter@gkware.com)
* UPDATE HISTORY:
* 06-17-2004 Created
* 08-07-2004 Initial Checkin
*/
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <tchar.h>
#include <windows.h>
#ifdef _MSC_VER
#include <commctrl.h>
#include <cpl.h>
#endif
#include <stdlib.h>
#include <tchar.h>
#include <process.h>
#include <stdio.h>
#include "resource.h"
#include "desk.h"
#define NUM_APPLETS (1)
LONG CALLBACK DisplayApplet(VOID);
BOOL CALLBACK BackgroundPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
BOOL CALLBACK ScreenSaverPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
BOOL CALLBACK AppearancePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
BOOL CALLBACK SettingsPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
HINSTANCE hApplet = 0;
/* Applets */
APPLET Applets[NUM_APPLETS] =
{
{IDI_CPLSYSTEM, IDS_CPLSYSTEMNAME, IDS_CPLSYSTEMDESCRIPTION, DisplayApplet}
};
/* Property page dialog callback */
BOOL CALLBACK BackgroundPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch(uMsg)
{
case WM_INITDIALOG:
break;
case WM_COMMAND:
break;
}
return FALSE;
}
/* Property page dialog callback */
BOOL CALLBACK ScreenSaverPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch(uMsg)
{
case WM_INITDIALOG:
break;
case WM_COMMAND:
break;
}
return FALSE;
}
/* Property page dialog callback */
BOOL CALLBACK AppearancePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch(uMsg)
{
case WM_INITDIALOG:
break;
case WM_COMMAND:
break;
}
return FALSE;
}
/* Property page dialog callback */
BOOL CALLBACK SettingsPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch(uMsg)
{
case WM_INITDIALOG:
break;
case WM_COMMAND:
break;
}
return FALSE;
}
static void InitPropSheetPage(PROPSHEETPAGE *psp, WORD idDlg, DLGPROC DlgProc)
{
ZeroMemory(psp, sizeof(PROPSHEETPAGE));
psp->dwSize = sizeof(PROPSHEETPAGE);
psp->dwFlags = PSP_DEFAULT;
psp->hInstance = hApplet;
#ifdef _MSC_VER
psp->pszTemplate = MAKEINTRESOURCE(idDlg);
#else
psp->u1.pszTemplate = MAKEINTRESOURCE(idDlg);
#endif
psp->pfnDlgProc = DlgProc;
}
/* First Applet */
LONG CALLBACK
DisplayApplet(VOID)
{
PROPSHEETPAGE psp[4];
PROPSHEETHEADER psh;
TCHAR Caption[1024];
LoadString(hApplet, IDS_CPLSYSTEMNAME, Caption, sizeof(Caption) / sizeof(TCHAR));
ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
psh.dwSize = sizeof(PROPSHEETHEADER);
psh.dwFlags = PSH_PROPSHEETPAGE | PSH_PROPTITLE;
psh.hwndParent = NULL;
psh.hInstance = hApplet;
#ifdef _MSC_VER
psh.hIcon = LoadIcon(hApplet, MAKEINTRESOURCE(IDI_CPLSYSTEM));
#else
psh.u1.hIcon = LoadIcon(hApplet, MAKEINTRESOURCE(IDI_CPLSYSTEM));
#endif
psh.pszCaption = Caption;
psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE);
#ifdef _MSC_VER
psh.nStartPage = 0;
psh.ppsp = psp;
#else
psh.u2.nStartPage = 0;
psh.u3.ppsp = psp;
#endif
psh.pfnCallback = NULL;
InitPropSheetPage(&psp[0], IDD_PROPPAGEBACKGROUND, BackgroundPageProc);
InitPropSheetPage(&psp[1], IDD_PROPPAGESCREENSAVER, ScreenSaverPageProc);
InitPropSheetPage(&psp[2], IDD_PROPPAGEAPPEARANCE, AppearancePageProc);
InitPropSheetPage(&psp[3], IDD_PROPPAGESETTINGS, SettingsPageProc);
return (LONG)(PropertySheet(&psh) != -1);
}
/* Control Panel Callback */
LONG CALLBACK CPlApplet(HWND hwndCPl, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
{
int i = (int)lParam1;
switch(uMsg)
{
case CPL_INIT:
{
return TRUE;
}
case CPL_GETCOUNT:
{
return NUM_APPLETS;
}
case CPL_INQUIRE:
{
CPLINFO *CPlInfo = (CPLINFO*)lParam2;
CPlInfo->lData = 0;
CPlInfo->idIcon = Applets[i].idIcon;
CPlInfo->idName = Applets[i].idName;
CPlInfo->idInfo = Applets[i].idDescription;
break;
}
case CPL_DBLCLK:
{
Applets[i].AppletProc();
break;
}
}
return FALSE;
}
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD dwReason, LPVOID lpvReserved)
{
switch(dwReason)
{
case DLL_PROCESS_ATTACH:
case DLL_THREAD_ATTACH:
hApplet = hinstDLL;
break;
}
return TRUE;
}

View file

@ -0,0 +1,6 @@
LIBRARY desk.cpl
EXPORTS
CPlApplet
; EOF

View file

@ -0,0 +1,124 @@
# Microsoft Developer Studio Project File - Name="desk" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
CFG=desk - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "desk.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "desk.mak" CFG="desk - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "desk - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "desk - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "desk - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 1
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "desk_EXPORTS" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /D "desk_EXPORTS" /D "_UNICODE" /D "UNICODE" /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x407 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG" /d "_MSC_VER"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib /nologo /dll /machine:I386 /out:"Release/desk.cpl"
!ELSEIF "$(CFG)" == "desk - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 1
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "desk_EXPORTS" /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /D "desk_EXPORTS" /D "_UNICODE" /D "UNICODE" /YX /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x407 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG" /d "_MSC_VER"
# SUBTRACT RSC /x
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib /nologo /dll /debug /machine:I386 /out:"Debug/desk.cpl" /pdbtype:sept
!ENDIF
# Begin Target
# Name "desk - Win32 Release"
# Name "desk - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\desk.c
# End Source File
# Begin Source File
SOURCE=.\desk.h
# End Source File
# Begin Source File
SOURCE=.\resource.h
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=.\desk.def
# End Source File
# Begin Source File
SOURCE=.\desk.rc
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project

View file

@ -0,0 +1,29 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "desk"=.\desk.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################

View file

@ -0,0 +1,6 @@
LIBRARY desk.cpl
EXPORTS
CPlApplet=CPlApplet@16
; EOF

View file

@ -0,0 +1,20 @@
#ifndef __CPL_APPWIZ_H
#define __CPL_APPWIZ_H
typedef LONG (CALLBACK *CPLAPPLET_PROC)(VOID);
typedef struct
{
int idIcon;
int idName;
int idDescription;
CPLAPPLET_PROC AppletProc;
} APPLET, *PAPPLET;
extern HINSTANCE hApplet;
void ShowLastWin32Error(HWND hWndOwner);
#endif /* __CPL_APPWIZ_H */
/* EOF */

View file

@ -0,0 +1,83 @@
#include "resource.h"
#ifdef _MSC_VER
#include <../../../include/reactos/resource.h>
#include <../../../include/defines.h>
#else
#include <reactos/resource.h>
#include <defines.h>
#endif
LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
VS_VERSION_INFO VERSIONINFO
FILEVERSION RES_UINT_FV_MAJOR,RES_UINT_FV_MINOR,RES_UINT_FV_REVISION,RES_UINT_FV_BUILD
PRODUCTVERSION RES_UINT_PV_MAJOR,RES_UINT_PV_MINOR,RES_UINT_PV_REVISION,RES_UINT_PV_BUILD
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x40004L
FILETYPE 0x2L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", RES_STR_COMPANY_NAME
VALUE "FileDescription", "ReactOS Display Control Panel\0"
VALUE "FileVersion", RES_STR_FILE_VERSION
VALUE "InternalName", "desk\0"
VALUE "LegalCopyright", RES_STR_LEGAL_COPYRIGHT
VALUE "OriginalFilename", "desk.cpl\0"
VALUE "ProductName", RES_STR_PRODUCT_NAME
VALUE "ProductVersion", RES_STR_PRODUCT_VERSION
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
IDI_CPLSYSTEM ICON "resources/applet.ico"
IDD_PROPPAGEBACKGROUND DIALOGEX 0, 0, PROPSHEETWIDTH, PROPSHEETHEIGHT
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION
CAPTION "Background"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
END
IDD_PROPPAGESCREENSAVER DIALOGEX 0, 0, PROPSHEETWIDTH, PROPSHEETHEIGHT
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION
CAPTION "Screen Saver"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
END
IDD_PROPPAGEAPPEARANCE DIALOGEX 0, 0, PROPSHEETWIDTH, PROPSHEETHEIGHT
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION
CAPTION "Appearance"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
END
IDD_PROPPAGESETTINGS DIALOGEX 0, 0, PROPSHEETWIDTH, PROPSHEETHEIGHT
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION
CAPTION "Settings"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
END
STRINGTABLE
BEGIN
IDS_CPLSYSTEMNAME "Display Properties"
IDS_CPLSYSTEMDESCRIPTION "Customizes your desktop display and screen saver."
END

View file

@ -0,0 +1,33 @@
#ifndef __CPL_RESOURCE_H
#define __CPL_RESOURCE_H
/* metrics */
#define PROPSHEETWIDTH 246
#define PROPSHEETHEIGHT 228
#define PROPSHEETPADDING 6
#define SYSTEM_COLUMN (0 * PROPSHEETPADDING)
// this is not supported by the MS Resource compiler:
//#define LABELLINE(x) 0 //(((PROPSHEETPADDING + 2) * x) + (x + 2))
#define ICONSIZE 16
/* ids */
#define IDI_CPLSYSTEM 100
#define IDD_PROPPAGEBACKGROUND 100
#define IDD_PROPPAGESCREENSAVER 101
#define IDD_PROPPAGEAPPEARANCE 102
#define IDD_PROPPAGESETTINGS 103
#define IDS_CPLSYSTEMNAME 1001
#define IDS_CPLSYSTEMDESCRIPTION 2001
/* controls */
#define IDC_INSTALL 101
#define IDC_SOFTWARELIST 102
#define IDC_ADDREMOVE 103
#endif /* __CPL_RESOURCE_H */
/* EOF */

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB