* add ReactOS Console configuration DLL

svn path=/trunk/; revision=22693
This commit is contained in:
Johannes Anderwald 2006-06-29 18:10:15 +00:00
parent ec719832c0
commit de285c4081
13 changed files with 479 additions and 0 deletions

View file

@ -19,6 +19,7 @@
<property name="BASEADDRESS_NCPL" value="0x64ea0000" />
<property name="BASEADDRESS_MAIN" value="0x64f40000" />
<property name="BASEADDRESS_INTL" value="0x64fb0000" />
<property name="BASEADDRESS_CONSOLE" value="0x6E4D0000" />
<property name="BASEADDRESS_DESK" value="0x65080000" />
<property name="BASEADDRESS_APPWIZ" value="0x65100000" />
<property name="BASEADDRESS_ACCESS" value="0x65180000" />

View file

@ -0,0 +1,37 @@
/* $Id$
*
* PROJECT: ReactOS Console Configuration DLL
* LICENSE: GPL - See COPYING in the top level directory
* FILE: dll/win32/console/colors.c
* PURPOSE: displays colors dialog
* PROGRAMMERS: Johannes Anderwald (johannes.anderwald@student.tugraz.at)
*/
#include "ntstatus.h"
#define WIN32_NO_STATUS
#include <windows.h>
#include <commctrl.h>
#include <cpl.h>
#include "resource.h"
INT_PTR
CALLBACK
ColorsProc(
HWND hwndDlg,
UINT uMsg,
WPARAM wParam,
LPARAM lParam
)
{
switch(uMsg)
{
case WM_INITDIALOG:
return TRUE;
default:
break;
}
return FALSE;
}

View file

@ -0,0 +1,171 @@
/* $Id$
*
* PROJECT: ReactOS Console Configuration DLL
* LICENSE: GPL - See COPYING in the top level directory
* FILE: dll/win32/console/console.c
* PURPOSE: initialization of DLL
* PROGRAMMERS: Johannes Anderwald (johannes.anderwald@student.tugraz.at)
*/
#include <windows.h>
#include <commctrl.h>
#include <cpl.h>
#include "resource.h"
#include "console.h"
#define NUM_APPLETS (1)
LONG APIENTRY InitApplet(HWND hwnd, UINT uMsg, LONG wParam, LONG lParam);
INT_PTR CALLBACK OptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
INT_PTR CALLBACK FontProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
INT_PTR CALLBACK LayoutProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
INT_PTR CALLBACK ColorsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
HINSTANCE hApplet = 0;
/* Applets */
APPLET Applets[NUM_APPLETS] =
{
{IDC_CPLICON, IDS_CPLNAME, IDS_CPLDESCRIPTION, InitApplet}
};
static void
InitPropSheetPage(PROPSHEETPAGE *psp, WORD idDlg, DLGPROC DlgProc)
{
ZeroMemory(psp, sizeof(PROPSHEETPAGE));
psp->dwSize = sizeof(PROPSHEETPAGE);
psp->dwFlags = PSP_DEFAULT;
psp->hInstance = hApplet;
psp->pszTemplate = MAKEINTRESOURCE(idDlg);
psp->pfnDlgProc = DlgProc;
}
/* Property Sheet Callback */
int CALLBACK
PropSheetProc(
HWND hwndDlg,
UINT uMsg,
LPARAM lParam
)
{
UNREFERENCED_PARAMETER(hwndDlg)
switch(uMsg)
{
case PSCB_BUTTONPRESSED:
switch(lParam)
{
case PSBTN_OK: /* OK */
break;
case PSBTN_CANCEL: /* Cancel */
break;
case PSBTN_APPLYNOW: /* Apply now */
break;
case PSBTN_FINISH: /* Close */
break;
default:
return FALSE;
}
break;
case PSCB_INITIALIZED:
break;
}
return TRUE;
}
/* First Applet */
LONG APIENTRY
InitApplet(HWND hwnd, UINT uMsg, LONG wParam, LONG lParam)
{
PROPSHEETPAGE psp[5];
PROPSHEETHEADER psh;
TCHAR Caption[1024];
INT i=0;
UNREFERENCED_PARAMETER(hwnd)
UNREFERENCED_PARAMETER(uMsg)
UNREFERENCED_PARAMETER(wParam)
UNREFERENCED_PARAMETER(lParam)
memset(Caption, 0x0, sizeof(Caption));
LoadString(hApplet, IDS_CPLNAME, Caption, sizeof(Caption) / sizeof(TCHAR));
ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
psh.dwSize = sizeof(PROPSHEETHEADER);
psh.dwFlags = PSH_PROPSHEETPAGE | PSH_USECALLBACK | PSH_PROPTITLE;
psh.hwndParent = NULL;
psh.hInstance = hApplet;
psh.hIcon = LoadIcon(hApplet, MAKEINTRESOURCE(IDC_CPLICON));
psh.pszCaption = Caption;
psh.nPages = 4;
psh.nStartPage = 0;
psh.ppsp = psp;
psh.pfnCallback = PropSheetProc;
InitPropSheetPage(&psp[i++], IDD_PROPPAGEOPTIONS, (DLGPROC) OptionsProc);
InitPropSheetPage(&psp[i++], IDD_PROPPAGEFONT, (DLGPROC) FontProc);
InitPropSheetPage(&psp[i++], IDD_PROPPAGELAYOUT, (DLGPROC) LayoutProc);
InitPropSheetPage(&psp[i++], IDD_PROPPAGECOLORS, (DLGPROC) ColorsProc);
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(hwndCPl, uMsg, lParam1, lParam2);
break;
}
}
return FALSE;
}
BOOLEAN
WINAPI
DllMain(
HINSTANCE hinstDLL,
DWORD dwReason,
LPVOID lpvReserved)
{
UNREFERENCED_PARAMETER(lpvReserved)
switch(dwReason)
{
case DLL_PROCESS_ATTACH:
case DLL_THREAD_ATTACH:
hApplet = hinstDLL;
break;
}
return TRUE;
}

View file

@ -0,0 +1,6 @@
LIBRARY console.dll
EXPORTS
CPlApplet@16
; EOF

View file

@ -0,0 +1,12 @@
#ifndef CONSOLE_H__
#define CONSOLE_H__
typedef struct
{
int idIcon;
int idName;
int idDescription;
APPLET_PROC AppletProc;
} APPLET, *PAPPLET;
#endif /* CONSOLE_H__ */

View file

@ -0,0 +1,19 @@
<module name="console" type="win32dll" baseaddress="${BASEADDRESS_CONSOLE}" installbase="system32" installname="console.dll">
<importlibrary definition="console.def" />
<include base="console">.</include>
<define name="UNICODE" />
<define name="_UNICODE" />
<define name="__REACTOS__" />
<define name="__USE_W32API" />
<define name="_WIN32_IE">0x600</define>
<define name="_WIN32_WINNT">0x501</define>
<library>kernel32</library>
<library>user32</library>
<library>comctl32</library>
<file>console.c</file>
<file>options.c</file>
<file>font.c</file>
<file>layout.c</file>
<file>colors.c</file>
<file>console.rc</file>
</module>

View file

@ -0,0 +1,20 @@
/* $Id$
*
* PROJECT: ReactOS Console Configuration DLL
* LICENSE: GPL - See COPYING in the top level directory
* FILE: dll/win32/console/console.rc
* PURPOSE: main resource file
* PROGRAMMERS: Johannes Anderwald (johannes.anderwald@student.tugraz.at)
*/
#include <windows.h>
#include "resource.h"
#define REACTOS_VERSION_DLL
#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Control Panel Console Applet\0"
#define REACTOS_STR_INTERNAL_NAME "powercfg\0"
#define REACTOS_STR_ORIGINAL_FILENAME "console.dll\0"
#include <reactos/version.rc>
#include "en.rc"

View file

@ -0,0 +1,71 @@
/* $Id$
*
* PROJECT: ReactOS Console Configuration DLL
* LICENSE: GPL - See COPYING in the top level directory
* FILE: dll/win32/console/en.rc
* PURPOSE: English resource file
* PROGRAMMERS: Johannes Anderwald (johannes.anderwald@student.tugraz.at)
*/
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
IDD_PROPPAGEOPTIONS DIALOGEX 0, 0, 250, 220
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION
CAPTION "Options"
FONT 8, "MS Shell Dlg"
EXSTYLE DS_SHELLFONT
BEGIN
GROUPBOX "Cursor Size", -1, 15, 15, 120, 70
CONTROL "&Small", IDC_RADIO_SMALL_CURSOR, "Button", 0x50010009, 25, 25, 90, 10
CONTROL "&Medium", IDC_RADIO_MEDIUM_CURSOR, "Button", 0x50010009, 25, 40, 90, 10
CONTROL "&Large", IDC_RADIO_LARGE_CURSOR, "Button", 0x50010009, 25, 55, 90, 10
GROUPBOX "Display Options", -1, 140, 15, 100, 70
CONTROL "&Window", IDC_RADIO_DISPLAY_WINDOW, "Button", 0x50010009, 150, 35, 70, 10
CONTROL "F&ull Screen", IDC_RADIO_DISPLAY_FULL, "Button", 0x50010009, 150, 50, 70, 10
GROUPBOX "Command History:", -1, 15, 90, 120, 70
LTEXT "&Buffer Size", -1, 25, 100, 60, 15
EDITTEXT IDC_EDIT_BUFFER_SIZE, 90, 100, 30, 15, ES_RIGHT | WS_GROUP
CONTROL "", IDC_UPDOWN_BUFFER_SIZE, UPDOWN_CLASS,UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_BORDER | WS_GROUP, 115, 100, 12, 12
LTEXT "&Number of Buffers:", -1, 25, 120, 80, 15
EDITTEXT IDC_EDIT_NUM_BUFFER, 90, 120, 30, 15, ES_RIGHT | WS_GROUP
CONTROL "", IDC_UPDOWN_NUM_BUFFER, UPDOWN_CLASS,UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_BORDER | WS_GROUP, 115, 120, 12, 12
CHECKBOX "&Discard Old Duplicates", IDC_CHECK_DISCARD_DUPLICATES, 25, 140, 100, 15
GROUPBOX "Edit Options", -1, 140, 90, 100, 70
CHECKBOX "&QuickEdit Mode", IDC_CHECK_QUICK_EDIT, 150, 100, 60, 15
CHECKBOX "&Insert Mode", IDC_CHECK_INSERT_MODE, 150, 120, 60, 15
END
IDD_PROPPAGEFONT DIALOGEX 0, 0, 220, 220
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION
CAPTION "Font"
FONT 8, "MS Shell Dlg"
EXSTYLE DS_SHELLFONT
BEGIN
LTEXT "This space is intentionally left blank", -1, 55, 103, 120, 10
END
IDD_PROPPAGELAYOUT DIALOGEX 0, 0, 220, 220
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION
CAPTION "Layout"
FONT 8, "MS Shell Dlg"
EXSTYLE DS_SHELLFONT
BEGIN
LTEXT "This space is intentionally left blank", -1, 55, 103, 120, 10
END
IDD_PROPPAGECOLORS DIALOGEX 0, 0, 220, 220
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION
CAPTION "Colors"
FONT 8, "MS Shell Dlg"
EXSTYLE DS_SHELLFONT
BEGIN
LTEXT "This space is intentionally left blank", -1, 55, 103, 120, 10
END
STRINGTABLE
BEGIN
IDS_CPLNAME "Console"
IDS_CPLDESCRIPTION "Configures console properties."
END

View file

@ -0,0 +1,38 @@
/* $Id$
*
* PROJECT: ReactOS Console Configuration DLL
* LICENSE: GPL - See COPYING in the top level directory
* FILE: dll/win32/console/font.c
* PURPOSE: displays font dialog
* PROGRAMMERS: Johannes Anderwald (johannes.anderwald@student.tugraz.at)
*/
#include "ntstatus.h"
#define WIN32_NO_STATUS
#include <windows.h>
#include <commctrl.h>
#include <cpl.h>
#include "resource.h"
INT_PTR
CALLBACK
FontProc(
HWND hwndDlg,
UINT uMsg,
WPARAM wParam,
LPARAM lParam
)
{
switch(uMsg)
{
case WM_INITDIALOG:
return TRUE;
default:
break;
}
return FALSE;
}

View file

@ -0,0 +1,37 @@
/* $Id$
*
* PROJECT: ReactOS Console Configuration DLL
* LICENSE: GPL - See COPYING in the top level directory
* FILE: dll/win32/console/layout.c
* PURPOSE: displays layout dialog
* PROGRAMMERS: Johannes Anderwald (johannes.anderwald@student.tugraz.at)
*/
#include "ntstatus.h"
#define WIN32_NO_STATUS
#include <windows.h>
#include <commctrl.h>
#include <cpl.h>
#include "resource.h"
INT_PTR
CALLBACK
LayoutProc(
HWND hwndDlg,
UINT uMsg,
WPARAM wParam,
LPARAM lParam
)
{
switch(uMsg)
{
case WM_INITDIALOG:
return TRUE;
default:
break;
}
return FALSE;
}

View file

@ -0,0 +1,38 @@
/* $Id$
*
* PROJECT: ReactOS Console Configuration DLL
* LICENSE: GPL - See COPYING in the top level directory
* FILE: dll/win32/console/options.c
* PURPOSE: displays options dialog
* PROGRAMMERS: Johannes Anderwald (johannes.anderwald@student.tugraz.at)
*/
#include "ntstatus.h"
#define WIN32_NO_STATUS
#include <windows.h>
#include <commctrl.h>
#include <cpl.h>
#include "resource.h"
INT_PTR
CALLBACK
OptionsProc(
HWND hwndDlg,
UINT uMsg,
WPARAM wParam,
LPARAM lParam
)
{
switch(uMsg)
{
case WM_INITDIALOG:
return TRUE;
default:
break;
}
return FALSE;
}

View file

@ -0,0 +1,26 @@
#ifndef RESOURCE_H__
#define RESOURCE_H__
#define IDC_CPLICON 40
#define IDS_CPLNAME 41
#define IDS_CPLDESCRIPTION 42
#define IDD_PROPPAGEOPTIONS 100
#define IDD_PROPPAGEFONT 101
#define IDD_PROPPAGELAYOUT 102
#define IDD_PROPPAGECOLORS 103
#define IDC_CHECK_QUICK_EDIT 200
#define IDC_CHECK_INSERT_MODE 201
#define IDC_CHECK_DISCARD_DUPLICATES 202
#define IDC_EDIT_BUFFER_SIZE 203
#define IDC_UPDOWN_BUFFER_SIZE 204
#define IDC_EDIT_NUM_BUFFER 205
#define IDC_UPDOWN_NUM_BUFFER 206
#define IDC_RADIO_SMALL_CURSOR 207
#define IDC_RADIO_MEDIUM_CURSOR 208
#define IDC_RADIO_LARGE_CURSOR 209
#define IDC_RADIO_DISPLAY_WINDOW 210
#define IDC_RADIO_DISPLAY_FULL 211
#endif

View file

@ -28,6 +28,9 @@
<directory name="cfgmgr32">
<xi:include href="cfgmgr32/cfgmgr32.rbuild" />
</directory>
<directory name="console">
<xi:include href="console/console.rbuild" />
</directory>
<directory name="comctl32">
<xi:include href="comctl32/comctl32.rbuild" />
</directory>