--- a/build/common/bld.inf Sat Jul 31 21:32:20 2010 +0100
+++ b/build/common/bld.inf Wed Aug 25 21:19:19 2010 +0100
@@ -25,17 +25,6 @@
#include "..\..\libraries\spcre\group\bld.inf"
#endif
#include "..\..\plugins\consoles\common\bld.inf"
-#include "..\..\plugins\consoles\consoleproxy\group\bld.inf"
-#include "..\..\plugins\consoles\defcons\group\bld.inf"
-#include "..\..\plugins\consoles\guicons\group\bld.inf"
-#include "..\..\plugins\consoles\iocons\group\bld.inf"
-#include "..\..\plugins\consoles\nullcons\group\bld.inf"
-#include "..\..\plugins\consoles\rcons\group\bld.inf"
-#include "..\..\plugins\consoles\vt100cons\group\bld.inf"
-#include "..\..\plugins\consoles\win32cons\group\bld.inf"
-#ifdef FSHELL_TESTEXECUTE_SUPPORT
-#include "..\..\plugins\consoles\tefcons\bld.inf"
-#endif
#include "..\..\plugins\networking\nullnif\group\bld.inf"
#include "..\..\plugins\networking\tcpcsy\group\bld.inf"
#include "..\..\plugins\networking\winsockprt\group\bld.inf"
@@ -59,5 +48,4 @@
PRJ_MMPFILES
-//TODO figure out why SBS doesn't like this...
-//gnumakefile ..\..\tools\export_templates.mk
+gnumakefile ..\..\tools\export_templates.mk
--- a/build/common/common.mmh Sat Jul 31 21:32:20 2010 +0100
+++ b/build/common/common.mmh Wed Aug 25 21:19:19 2010 +0100
@@ -523,6 +523,7 @@
#define FSHELL_UID_MEMSPY 0x10286F70
#define FSHELL_UID_EXTRABTRACEK 0x10286F71
#define FSHELL_UID_TESTEXECUTE 0x10286F72
+#define FSHELL_UID_CONSOLEEXTENSIONS 0x10286F73
#else // Not FSHELL_PROTECTED_UIDS
@@ -654,6 +655,7 @@
#define FSHELL_UID_MEMSPY 0xE0286F70
#define FSHELL_UID_EXTRABTRACEK 0xE0286F71
#define FSHELL_UID_TESTEXECUTE 0xE0286F72
+#define FSHELL_UID_CONSOLEEXTENSIONS 0xE0286F73
#endif // FSHELL_PROTECTED_UIDS
--- a/build/common/fsh_buildsis.mk Sat Jul 31 21:32:20 2010 +0100
+++ b/build/common/fsh_buildsis.mk Wed Aug 25 21:19:19 2010 +0100
@@ -16,7 +16,7 @@
RELEASABLES :
ifneq ($(PLATFORM), WINSCW)
- echo $(EPOCROOT)epoc32\fshell\fshell.unsigned.sis
+ @echo $(EPOCROOT)epoc32\fshell\fshell.unsigned.sis
endif
MAKMAKE BLD FREEZE LIB CLEANLIB RESOURCE CLEAN SAVESPACE :
--- a/build/ncp/platform.mmh Sat Jul 31 21:32:20 2010 +0100
+++ b/build/ncp/platform.mmh Wed Aug 25 21:19:19 2010 +0100
@@ -20,5 +20,6 @@
#define FSHELL_NO_APPARC_SUPPORT
#define FSHELL_FLEXIBLEMM_AWARE
#define FSHELL_ARM11XX_SUPPORT
+#define FSHELL_TRACECORE_SUPPORT
#endif // FSHELL_PLATFORM_MMH
--- a/build/s60/tb92/platform.mmh Sat Jul 31 21:32:20 2010 +0100
+++ b/build/s60/tb92/platform.mmh Wed Aug 25 21:19:19 2010 +0100
@@ -29,5 +29,6 @@
#define FSHELL_DYNAMICSTARTUP_SUPPORT
#define FSHELL_TESTEXECUTE_SUPPORT
+#define FSHELL_TRACECORE_SUPPORT
#endif // FSHELL_PLATFORM_MMH
--- a/commands/fzip/fzip.cpp Sat Jul 31 21:32:20 2010 +0100
+++ b/commands/fzip/fzip.cpp Wed Aug 25 21:19:19 2010 +0100
@@ -62,7 +62,7 @@
PrintWarning(_L("Ignoring \'-r\' recurse option."));
}
}
- TRAPL(ExpandArchiveL(), _L("Couldn't expand archive"));
+ ExpandArchiveL();
}
else
{
@@ -323,7 +323,8 @@
{
Printf(_L("Opening\t\t\'%S\'\r\n"), &iArchive);
}
- CZipFile* zip = CZipFile::NewL(Fs(), iArchive);
+ CZipFile* zip = NULL;
+ TRAPL(zip = CZipFile::NewL(Fs(), iArchive), _L("Couldn't create CZipFile for %S"), &iArchive);
CleanupStack::PushL(zip);
CZipFileMemberIterator* zipIterator = zip->GetMembersL();
CleanupStack::PushL(zipIterator);
@@ -344,10 +345,6 @@
//
void CCmdZip::ExtractZipFileL(CZipFile& aZip, const CZipFileMember& aMember)
{
- // prep. the stream
- RZipFileMemberReaderStream* readStream;
- aZip.GetInputStreamL(&aMember, readStream);
- CleanupStack::PushL(readStream);
// prep. the destination file.
// note if iUnzipPath is not specified, it'll stuff the extracted file in the current directory from which fzip.exe runs
RFile newFile;
@@ -356,9 +353,16 @@
TInt err = Fs().MkDirAll(dest);
if ((err != KErrNone) && (err != KErrAlreadyExists))
{
- User::Leave(err);
+ LeaveIfErr(err, _L("Couldn't create directory for file %S"), &dest);
}
- User::LeaveIfError(newFile.Replace(Fs(), dest, EFileShareExclusive));
+ if (aMember.Name()->Right(1) == _L("\\")) return; // It's a directory entry, nothing more to be done
+
+ // prep. the stream
+ RZipFileMemberReaderStream* readStream;
+ aZip.GetInputStreamL(&aMember, readStream);
+ CleanupStack::PushL(readStream);
+
+ LeaveIfErr(newFile.Replace(Fs(), dest, EFileShareExclusive), _L("Couldn't create file %S"), &dest);
CleanupClosePushL(newFile);
if (iVerbose)
{
@@ -376,8 +380,8 @@
TPtr8 ptr = data->Des();
do
{
- User::LeaveIfError(readStream->Read(ptr, length));
- User::LeaveIfError(newFile.Write(ptr));
+ LeaveIfErr(readStream->Read(ptr, length), _L("Error reading from zip stream"));
+ LeaveIfErr(newFile.Write(ptr), _L("Error writing to file %S"), &dest);
bytesRead += length;
if ((aMember.UncompressedSize() - bytesRead) < KDefaultZipBufferLength)
{
--- a/commands/grabscreen/grabscreen.cpp Sat Jul 31 21:32:20 2010 +0100
+++ b/commands/grabscreen/grabscreen.cpp Wed Aug 25 21:19:19 2010 +0100
@@ -166,8 +166,8 @@
CleanupStack::PushL(imageData);
imageData->iSampleScheme = iGreyscale ? TJpegImageData::EMonochrome : TJpegImageData::EColor444;
imageData->iQualityFactor = iQuality;
- iFrameImageData = CFrameImageData::NewL();
- User::LeaveIfError(iFrameImageData->AppendImageData(imageData));
+ TRAPL(iFrameImageData = CFrameImageData::NewL(), _L("Couldn't create CFrameImageData"));
+ LeaveIfErr(iFrameImageData->AppendImageData(imageData), _L("Failed to write image data to TJpegImageData"));
CleanupStack::Pop(imageData);
}
else if (aEncodingUid == KImageTypeGIFUid)
@@ -225,7 +225,7 @@
void CCmdGrabscreen::RunL()
{
- User::LeaveIfError(iStatus.Int());
+ LeaveIfErr(iStatus.Int(), _L("Error returned from CImageEncoder::Convert"));
if (!iArguments.IsPresent(0))
{
User::LeaveIfNull(iImageData);
--- a/commands/leak/leak.cif Sat Jul 31 21:32:20 2010 +0100
+++ b/commands/leak/leak.cif Wed Aug 25 21:19:19 2010 +0100
@@ -52,6 +52,10 @@
If specified, when an allocation fails retry using a smaller increment amount.
+==option bool l logging-allocator
+
+If specified, install the logging allocator before starting to leak memory. Assumes the C<--heap> option.
+
==copyright
Copyright (c) 2007-2010 Accenture. All rights reserved.
--- a/commands/leak/leak.cpp Sat Jul 31 21:32:20 2010 +0100
+++ b/commands/leak/leak.cpp Wed Aug 25 21:19:19 2010 +0100
@@ -12,6 +12,9 @@
#include "leak.h"
#include <fshell/common.mmh>
+#ifdef FSHELL_QR3_SUPPORT_LOGGINGALLOCATOR
+#include <fshell/loggingallocator.h>
+#endif
const TInt KMinChunkSize = 4 * 1024;
const TInt KMaxChunkSize = 512 * 1024 * 1024;
@@ -26,6 +29,12 @@
CCmdLeak::~CCmdLeak()
{
+#ifdef FSHELL_QR3_SUPPORT_LOGGINGALLOCATOR
+ if (iLoggingAllocator)
+ {
+ // Hmm how do I clean up a logging allocator created with RLoggingAllocator::New()?
+ }
+#endif
iChunk.Close();
if (iChunkHeap)
{
@@ -67,10 +76,21 @@
}
}
+ if (iUseLoggingAllocator) iUseHeap = ETrue; // Using the logging allocator implies the --heap option
+
if (iUseHeap)
{
iChunkHeap = UserHeap::ChunkHeap(NULL, KMinChunkSize, 256*1024*1024);
if (!iChunkHeap) LeaveIfErr(KErrNoMemory, _L("Couldn't create chunk heap"));
+ iAllocatorToUse = iChunkHeap;
+
+#ifdef FSHELL_QR3_SUPPORT_LOGGINGALLOCATOR
+ if (iUseLoggingAllocator)
+ {
+ LeaveIfErr(RLoggingAllocator::New(0, iChunkHeap, iLoggingAllocator), _L("Couldn't create logging allocator"));
+ iAllocatorToUse = iLoggingAllocator;
+ }
+#endif
}
else
{
@@ -137,6 +157,11 @@
_LIT(KOptRetry, "retry");
aOptions.AppendBoolL(iRetry, KOptRetry);
+
+#ifdef FSHELL_QR3_SUPPORT_LOGGINGALLOCATOR
+ _LIT(KOptUseLoggingAllocator, "logging-allocator");
+ aOptions.AppendBoolL(iUseLoggingAllocator, KOptUseLoggingAllocator);
+#endif
}
void CCmdLeak::ArgumentsL(RCommandArgumentList& aArguments)
@@ -153,9 +178,9 @@
TInt CCmdLeak::LeakStep(TInt aAmount)
{
TInt err = KErrNone;
- if (iChunkHeap)
+ if (iAllocatorToUse)
{
- TAny* cell = iChunkHeap->Alloc(aAmount);
+ TAny* cell = iAllocatorToUse->Alloc(aAmount);
if (!cell) err = KErrNoMemory;
}
else
--- a/commands/leak/leak.h Sat Jul 31 21:32:20 2010 +0100
+++ b/commands/leak/leak.h Wed Aug 25 21:19:19 2010 +0100
@@ -12,6 +12,8 @@
#include <fshell/ioutils.h>
+class RLoggingAllocator;
+
using namespace IoUtils;
class CCmdLeak : public CCommandBase
@@ -37,9 +39,12 @@
TUint iHeapAddr;
TBool iUseHeap;
TBool iRetry;
+ TBool iUseLoggingAllocator;
RChunk iChunk;
RAllocator* iChunkHeap;
+ RLoggingAllocator* iLoggingAllocator;
+ RAllocator* iAllocatorToUse;
TInt iCurrentLeak;
};
--- a/commands/leak/leak.mmp Sat Jul 31 21:32:20 2010 +0100
+++ b/commands/leak/leak.mmp Wed Aug 25 21:19:19 2010 +0100
@@ -30,4 +30,8 @@
library am-eikclient.lib
#endif
+#ifdef FSHELL_QR3_SUPPORT_LOGGINGALLOCATOR
+library loggingallocator.lib
+#endif
+
macro EXE_BUILD
--- a/commands/localdrive/localdrive.cpp Sat Jul 31 21:32:20 2010 +0100
+++ b/commands/localdrive/localdrive.cpp Wed Aug 25 21:19:19 2010 +0100
@@ -84,7 +84,7 @@
// More GCC issues (see qresources3\src\utils.cpp). Happily the compiler is happier with SLitC and DESC than it is with TLitC and _LIT
#include <fshell/descriptorutils.h>
-#define CASE_LIT(x) case x: { LtkUtils::SLitC KName = DESC(#x); return &KName; }
+#define CASE_LIT(x) case x: { static const LtkUtils::SLitC KName = DESC(#x); return &KName; }
const TDesC* MediaTypeDesc(TMediaType aType)
{
--- a/core/builtins/ls.cif Sat Jul 31 21:32:20 2010 +0100
+++ b/core/builtins/ls.cif Wed Aug 25 21:19:19 2010 +0100
@@ -18,6 +18,8 @@
==long-description
+By default ls will columnize the output list. On very large directory listings this may cause the ls command to run out of memory. If this happens, try using the C<-1>/C<--one> option, which will not attempt to format the output.
+
Note, C<cd> can be used to navigate between drives, but the DOS approach of switching between drives with commands like C<c:> and C<e:> is also supported.
==argument filename dir_name optional
--- a/core/builtins/rm.cif Sat Jul 31 21:32:20 2010 +0100
+++ b/core/builtins/rm.cif Wed Aug 25 21:19:19 2010 +0100
@@ -28,6 +28,10 @@
Force delete the file even if it is read-only (won't allow you to delete a directory containing read-only files).
+==option string n noexpand multiple
+
+This option takes a filename similar to the C<filename> argument. The difference is that it doesn't attempt to expand wildcards and instead passes them straight through to CFileMan. This can be useful when a directory has a huge number of files and C<rm *> fails with KErrNoMemory. In this case, try doing C<rm --noexpand *> instead.
+
==copyright
Copyright (c) 2006-2010 Accenture. All rights reserved.
--- a/core/group/bld.inf Sat Jul 31 21:32:20 2010 +0100
+++ b/core/group/bld.inf Wed Aug 25 21:19:19 2010 +0100
@@ -98,6 +98,7 @@
.\autostart.script z:\system\console\scripts\autostart.script
.\comm.script z:\system\console\scripts\comm.script
+.\fshell_autoexec.bat z:\fshell_autoexec.bat
PRJ_MMPFILES
gnumakefile .\fshell_version.mk
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/core/group/fshell_autoexec.bat Wed Aug 25 21:19:19 2010 +0100
@@ -0,0 +1,1 @@
+fshell autostart
--- a/core/group/fshell_core.iby Sat Jul 31 21:32:20 2010 +0100
+++ b/core/group/fshell_core.iby Wed Aug 25 21:19:19 2010 +0100
@@ -69,9 +69,6 @@
#endif // FSHELL_CORE_SUPPORT_SERIAL_ICON
FSHELL_DATA_FILE(ZSYSTEM\console\scripts\comm.script, system\console\scripts\comm.script)
-#ifdef FSHELL_AUTOEXEC
-FSHELL_DATA_FILE(DATAZ_\autoexec.bat.comm, autoexec.bat)
-#endif
FSHELL_EXECUTABLE_FILE(iosrv.exe)
FSHELL_EXECUTABLE_FILE(iocli.dll)
@@ -81,11 +78,21 @@
FSHELL_ECOM_PLUGIN(sbrec.dll, sbrec.rsc)
FSHELL_DATA_FILE(ZPRIVATE\10003a3f\apps\sbapp_reg.RSC, Private\10003a3f\import\Apps\sbapp_reg.RSC)
FSHELL_DATA_FILE(ZRESOURCE\Apps\sbapp_loc.rsc, Resource\Apps\sbapp_loc.rsc)
+#endif
+
#ifdef FSHELL_AUTOSTART
-patchdata sbrec.dll@KAutoStartFshell 1
FSHELL_DATA_FILE(ZSYSTEM\console\scripts\autostart.script, system\console\scripts\autostart.script)
+#if defined(FSHELL_CORE_SUPPORT_SHEBANG)
+patchdata sbrec.dll@KAutoStartFshell 1
+#elif !defined(FSHELL_WSERV_SUPPORT)
+// Do it the eshell way
+FSHELL_DATA_FILE(DATAZ_\fshell_autoexec.bat, autoexec.bat)
+#else
+// If we don't support a recogniser but aren't textshell, we're not a configuration worth worrying about
#endif
-#endif
+#endif // FSHELL_AUTOSTART
+
+
#ifdef FSHELL_CORE_SUPPORT_PIPSRUN
FSHELL_EXECUTABLE_FILE(pipsrun.exe)
#endif
--- a/core/group/fshell_version.mk Sat Jul 31 21:32:20 2010 +0100
+++ b/core/group/fshell_version.mk Wed Aug 25 21:19:19 2010 +0100
@@ -9,7 +9,7 @@
# Initial Contributors:
# Accenture - Initial contribution
#
-GENERATED_SOURCE_DIR = $(EPOCROOT)epoc32\build\fshell\core\generated
+GENERATED_SOURCE_DIR = $(EPOCROOT)epoc32\build\fshell\core\generated\platform_$(PLATFORM)
GENERATED_SOURCE = $(GENERATED_SOURCE_DIR)\fshell_version.cpp
MAKMAKE :
--- a/core/group/genver.pl Sat Jul 31 21:32:20 2010 +0100
+++ b/core/group/genver.pl Wed Aug 25 21:19:19 2010 +0100
@@ -81,5 +81,16 @@
}
close (COMPILER);
}
+ elsif ($platform =~ /^winscw$/i) {
+ open (COMPILER, "mwccsym2.exe 2>&1 |") or die "Couldn't run \"mwccsym2.exe\": $!\n";
+ while (my $line = <COMPILER>) {
+ if ($line =~ /^Version/) {
+ chomp $line;
+ $version = "mwccsym2 $line";
+ last;
+ }
+ }
+ close (COMPILER);
+ }
return $version;
}
--- a/core/src/commands.cpp Sat Jul 31 21:32:20 2010 +0100
+++ b/core/src/commands.cpp Wed Aug 25 21:19:19 2010 +0100
@@ -698,6 +698,7 @@
{
delete iFileMan;
iFileNames.Close();
+ iNonExpandedFilenames.ResetAndDestroy();
}
CCmdRm::CCmdRm()
@@ -748,7 +749,13 @@
err = DoDelete(fileName);
}
}
- User::LeaveIfError(err);
+ LeaveIfErr(err, _L("Couldn't delete '%S'"), &fileName);
+ }
+
+ for (TInt i = 0; i < iNonExpandedFilenames.Count(); i++)
+ {
+ TInt err = DoDelete(*iNonExpandedFilenames[i]);
+ LeaveIfErr(err, _L("Couldn't delete '%S'"), iNonExpandedFilenames[i]);
}
}
@@ -770,8 +777,10 @@
{
_LIT(KCmdRmOptRecurse, "recurse");
_LIT(KCmdRmOptForce, "force");
+ _LIT(KCmdRmOptNoexpand, "noexpand");
aOptions.AppendBoolL(iRecurse, KCmdRmOptRecurse);
aOptions.AppendBoolL(iForce, KCmdRmOptForce);
+ aOptions.AppendStringL(iNonExpandedFilenames, KCmdRmOptNoexpand);
}
void CCmdRm::ArgumentsL(RCommandArgumentList& aArguments)
--- a/core/src/commands.h Sat Jul 31 21:32:20 2010 +0100
+++ b/core/src/commands.h Wed Aug 25 21:19:19 2010 +0100
@@ -196,6 +196,7 @@
CFileMan* iFileMan;
TBool iRecurse;
TBool iForce;
+ RPointerArray<HBufC> iNonExpandedFilenames; // This is to prevent the normal behaviour of fshell expanding a '*' in iFileNames, in the case where the number of matches would be huge
};
--- a/core/src/fshell.mmp Sat Jul 31 21:32:20 2010 +0100
+++ b/core/src/fshell.mmp Wed Aug 25 21:19:19 2010 +0100
@@ -78,9 +78,26 @@
source ymodem.cpp
source version.cpp
-sourcepath \epoc32\build\fshell\core\generated
+// There doesn't seem to be a nice way of turning the platform into a string, like you have $(PLATFORM) in extension makefiles, sigh.
+#if defined(WINSCW)
+#define PLAT platform_WINSCW
+#elif defined(GCCE)
+#define PLAT platform_GCCE
+#elif defined(MARM_ARM4)
+#define PLAT platform_ARM4
+#elif defined(MARM_ARMV5)
+#define PLAT platform_ARMV5
+#endif
+
+#ifdef SBSV2
+sourcepath /epoc32/build/fshell/core/generated/PLAT
+#else
+sourcepath \epoc32\build\fshell\core\generated\ ## PLAT
+#endif
source fshell_version.cpp
+
#ifdef FSHELL_CORE_SUPPORT_LICENSE
+sourcepath \epoc32\build\fshell\core\generated
source license.cpp
#endif
@@ -90,7 +107,3 @@
library iocli.lib
library lineeditor.lib
library ltkutils-tcb.lib
-
-START WINS
-win32_library kernel32.lib
-END
--- a/documentation/change_history.pod Sat Jul 31 21:32:20 2010 +0100
+++ b/documentation/change_history.pod Wed Aug 25 21:19:19 2010 +0100
@@ -14,12 +14,16 @@
=head1 FShell Change History
-=head2 Release 000.4
+=head2 Release 001 [Not yet officially made]
=over 5
=item *
+Added L<terminal keyboard|terminalkeyboardcons> console, for platforms that support Terminal Keyboard and Trace Core.
+
+=item *
+
Fixed a defect in iosrv.exe that caused a panic if a foreground read object was attached to a different end point. This was due to the read object being notified of a change in foreground before its iEndPoint member was updated. This member is now updated before attempting the attach, and is set to NULL in the event of a leave (resulting in the read object being left in an unattached state).
=item *
@@ -28,11 +32,7 @@
=item *
-Added C<--codesegs> option to C<ps>.
-
-=head2 Release 000.2, 000.3
-
-Build fixes.
+Added C<--codesegs> option to L<ps|commands::ps>.
=head2 Release 000.1
--- a/documentation/common_mmh.pod Sat Jul 31 21:32:20 2010 +0100
+++ b/documentation/common_mmh.pod Wed Aug 25 21:19:19 2010 +0100
@@ -218,6 +218,10 @@
The TestExecute APIs are available.
+=item FSHELL_TRACECORE_SUPPORT
+
+The TraceCore APIs are available.
+
=back
A couple of further macros follow - these are specifically for platforms that provide an custom implementation of the relevant command rather than using fshell's built-in version.
--- a/documentation/fshell_builddocs.mk Sat Jul 31 21:32:20 2010 +0100
+++ b/documentation/fshell_builddocs.mk Wed Aug 25 21:19:19 2010 +0100
@@ -13,7 +13,7 @@
..\tools\fsh-builddocs -i epoc32/include pod-list.txt
RELEASABLES :
- ..\tools\fsh-builddocs -i epoc32/include pod-list.txt -w
+ @..\tools\fsh-builddocs -i epoc32/include pod-list.txt -w
CLEAN :
..\tools\fsh-builddocs -i epoc32/include pod-list.txt -c
--- a/documentation/getting_started.pod Sat Jul 31 21:32:20 2010 +0100
+++ b/documentation/getting_started.pod Wed Aug 25 21:19:19 2010 +0100
@@ -16,9 +16,15 @@
=head1 Getting started with FShell
+B< I<Note:> > This guide is in the process of being migrated to the wiki, here: http://developer.symbian.org/wiki/index.php/Fshell/Getting_Started
+
=head1 Retreiving the FShell Source Code
-I<Todo - add instructions for accessing the Mercurial repository.>
+fshell is hosted on the Symbian Foundation here: http://developer.symbian.org/main/source/packages/fshell
+
+To clone the MCL repository, do:
+
+ hg clone https://developer.symbian.org/oss/MCL/sf/os/fshell/
=head1 Building FShell
@@ -34,7 +40,7 @@
=back
-Each of these platforms have a separate directory with F<\fshell\build>. In some platforms there may be further separate sub-directories for specific variants of the platform. You need to identify a suitable directory (that contains a file named F<bld.inf>) from which to build from. For example to build for the Symbian^3 release you need to build from F<\fshell\build\sf\3>. Open a command prompt and C<cd> to this directory.
+Each of these platforms have a separate directory within F<\fshell\build>. For some platforms there may be further separate sub-directories for specific variants of the platform. You need to identify a suitable directory (that contains a file named F<bld.inf>) from which to build from. For example to build for the Symbian^3 release you need to build from F<\fshell\build\sf\3>. Open a command prompt and C<cd> to this directory.
You also need to identify the type of binaries you want to build. Common ones are:
--- a/documentation/pod-list.txt Sat Jul 31 21:32:20 2010 +0100
+++ b/documentation/pod-list.txt Wed Aug 25 21:19:19 2010 +0100
@@ -25,6 +25,7 @@
pod ..\plugins\consoles\rcons\documentation\rcons.exe.pod fshell\plugins\consoles\rcons.exe.html
pod ..\plugins\consoles\rcons\documentation\rcons.pod fshell\plugins\consoles\rcons.html
pod ..\plugins\consoles\vt100cons\doc\vt100cons.pod fshell\plugins\consoles\vt100cons.html
+pod ..\plugins\consoles\terminalkeyboardcons\terminalkeyboardcons.pod fshell\plugins\consoles\terminalkeyboardcons.html
index fshell\plugins\networking
pod ..\plugins\networking\tcpcsy\doc\tcpcsy.pod fshell\plugins\networking\tcpcsy.html
--- a/libraries/btserial/group/bld.inf Sat Jul 31 21:32:20 2010 +0100
+++ b/libraries/btserial/group/bld.inf Wed Aug 25 21:19:19 2010 +0100
@@ -17,11 +17,11 @@
PRJ_EXPORTS
FSHELL_ROM_INCLUDE(btincomingserial.iby)
-#ifdef FSHELL_COMMS_SUPPORT
+#ifdef FSHELL_BLUETOOTH_SUPPORT
..\inc\btincomingserial.h +\include\fshell\btincomingserial.h
..\inc\btserialclient.h +\include\fshell\btserialclient.h
PRJ_MMPFILES
-BtSerial
+BtSerial.mmp
#endif
--- a/libraries/btserial/group/btincomingserial.iby Sat Jul 31 21:32:20 2010 +0100
+++ b/libraries/btserial/group/btincomingserial.iby Wed Aug 25 21:19:19 2010 +0100
@@ -16,7 +16,7 @@
#include <fsh_config.iby>
#include <vt100.iby>
-#ifdef FSHELL_COMMS_SUPPORT
+#ifdef FSHELL_BLUETOOTH_SUPPORT
FSHELL_EXECUTABLE_FILE(btincomingserial.dll)
#endif
--- a/plugins/consoles/common/bld.inf Sat Jul 31 21:32:20 2010 +0100
+++ b/plugins/consoles/common/bld.inf Wed Aug 25 21:19:19 2010 +0100
@@ -14,6 +14,42 @@
#endif
PRJ_EXPORTS
-.\consoleextensions.h \epoc32\include\fshell\consoleextensions.h
-.\consoleextensions.inl \epoc32\include\fshell\consoleextensions.inl
+consoleextensions.h \epoc32\include\fshell\consoleextensions.h
+consoleextensions.inl \epoc32\include\fshell\consoleextensions.inl
+..\consoleproxy\inc\consoleproxy.h \epoc32\include\fshell\consoleproxy.h
+..\rcons\server\win32\rcons.exe \epoc32\tools\rcons.exe
+..\rcons\client\data\rcons.idf z:\resource\rcons.idf
+..\rcons\client\data\rcons.ini.emulator \epoc32\winscw\c\system\console\rcons.ini
+..\win32cons\group\fshell.bat \epoc32\tools\fshell.bat
+..\win32cons\group\fshellconsole.ini \epoc32\data\fshellconsole.ini
+
+FSHELL_ROM_INCLUDE2(..\consoleproxy\group\consoleproxy.iby, consoleproxy.iby)
+FSHELL_ROM_INCLUDE2(..\defcons\group\defcons.iby, defcons.iby)
+FSHELL_ROM_INCLUDE2(..\nullcons\group\nullcons.iby, nullcons.iby)
+FSHELL_ROM_INCLUDE2(..\rcons\client\group\rcons.iby, rcons.iby)
+
+PRJ_MMPFILES
+.\consoleextensions.mmp
+..\consoleproxy\group\consoleproxy.mmp
+..\defcons\src\defcons.mmp
+..\iocons\group\iocons.mmp
+..\nullcons\src\nullcons.mmp
+..\rcons\client\group\remote_console.mmp
+
+#if defined(WINS)
+gnumakefile ..\win32cons\group\os_ver.mk
+..\win32cons\group\win32cons.mmp
+#endif
+
+#include "../guicons/group/bld.inf"
+#include "../vt100cons/group/bld.inf"
+
+#ifdef FSHELL_TESTEXECUTE_SUPPORT
+PRJ_MMPFILES
+..\tefcons\tefcons.mmp
+#endif
+
+#ifdef FSHELL_TRACECORE_SUPPORT
+..\terminalkeyboardcons\terminalkeyboardcons.mmp
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/plugins/consoles/common/bwins/consoleextensions.def Wed Aug 25 21:19:19 2010 +0100
@@ -0,0 +1,10 @@
+EXPORTS
+ ?WriteStdErr@MIosrvConsoleHelper@@MAEHABVTDesC16@@@Z @ 1 NONAME ; int MIosrvConsoleHelper::WriteStdErr(class TDesC16 const &)
+ ?Message@MIosrvConsoleHelper@@IAAXW4TVerbosity@1@V?$TRefByValue@$$CBVTDesC16@@@@ZZ @ 2 NONAME ; void MIosrvConsoleHelper::Message(enum MIosrvConsoleHelper::TVerbosity, class TRefByValue<class TDesC16 const >, ...)
+ ?Debug@MIosrvConsoleHelper@@IBEHXZ @ 3 NONAME ; int MIosrvConsoleHelper::Debug(void) const
+ ?SetDebug@MIosrvConsoleHelper@@IAEXH@Z @ 4 NONAME ; void MIosrvConsoleHelper::SetDebug(int)
+ ?HandleConsoleCreationError@MIosrvConsoleHelper@@IAEXABVTDesC16@@H@Z @ 5 NONAME ; void MIosrvConsoleHelper::HandleConsoleCreationError(class TDesC16 const &, int)
+ ?MIosrvConsoleHelper_Extension@MIosrvConsoleHelper@@IAEHIAAPAXPAX@Z @ 6 NONAME ; int MIosrvConsoleHelper::MIosrvConsoleHelper_Extension(unsigned int, void * &, void *)
+ ?CleanupUnderlyingConsole@MIosrvConsoleHelper@@IAEXXZ @ 7 NONAME ; void MIosrvConsoleHelper::CleanupUnderlyingConsole(void)
+ ?UnderlyingConsole@MIosrvConsoleHelper@@IBEPAVCConsoleBase@@XZ @ 8 NONAME ; class CConsoleBase * MIosrvConsoleHelper::UnderlyingConsole(void) const
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/plugins/consoles/common/consoleextensions.cpp Wed Aug 25 21:19:19 2010 +0100
@@ -0,0 +1,121 @@
+// consoleextensions.cpp
+//
+// Copyright (c) 2010 Accenture. All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Accenture - Initial contribution
+//
+
+#include <fshell/consoleextensions.h>
+#include <e32debug.h>
+#include <e32cons.h>
+
+class TOverflowTruncate : public TDes16Overflow
+ {
+public:
+ virtual void Overflow(TDes16&) {}
+ };
+_LIT(KNewLine, "\r\n");
+
+
+EXPORT_C void MIosrvConsoleHelper::Message(TVerbosity aVerbosity, TRefByValue<const TDesC> aFmt, ...)
+ {
+ if (Debug() || (aVerbosity == EInformation) || (aVerbosity == EError))
+ {
+ TOverflowTruncate overflow;
+ VA_LIST list;
+ VA_START(list, aFmt);
+ TBuf<0x100> buf;
+ buf.AppendFormatList(aFmt, list, &overflow);
+
+ if (iUnderlyingConsole)
+ {
+ iUnderlyingConsole->Write(buf);
+ iUnderlyingConsole->Write(KNewLine);
+ }
+ else
+ {
+ // Cover all the bases as best we can
+ User::InfoPrint(buf);
+ RDebug::Print(buf);
+ }
+ }
+ }
+
+EXPORT_C TBool MIosrvConsoleHelper::Debug() const
+ {
+ return iDebug;
+ }
+
+EXPORT_C void MIosrvConsoleHelper::SetDebug(TBool aDebug)
+ {
+ iDebug = aDebug;
+ }
+
+EXPORT_C TInt MIosrvConsoleHelper::WriteStdErr(const TDesC& /*aDes*/)
+ {
+ return KErrExtensionNotSupported;
+ }
+
+EXPORT_C TInt MIosrvConsoleHelper::MIosrvConsoleHelper_Extension(TUint aExtensionId, TAny*& /*a0*/, TAny* a1)
+ {
+ if (aExtensionId == UnderlyingConsole::KSetUnderlyingConsoleExtension)
+ {
+ iUnderlyingConsole = (CConsoleBase*)a1;
+ return KErrNone;
+ }
+ else if (aExtensionId == ConsoleStdErr::KWriteStdErrConsoleExtension)
+ {
+ const TDesC* des = (const TDesC*)a1;
+ return WriteStdErr(*des);
+ }
+ else
+ {
+ return KErrExtensionNotSupported;
+ }
+ }
+
+EXPORT_C void MIosrvConsoleHelper::HandleConsoleCreationError(const TDesC& aConsoleName, TInt aError)
+ {
+ if (aError)
+ {
+ TBuf<512> message;
+ message.Format(_L("Failed to create console %S (%d)."), &aConsoleName, aError);
+
+ if (iUnderlyingConsole && (LazyConsole::IsConstructed(iUnderlyingConsole) || !LazyConsole::IsLazy(iUnderlyingConsole)))
+ // if we have an underlyconsole, which is either not lazy or is lazy but already constructed, then print the error to it.
+ {
+ iUnderlyingConsole->Write(message);
+ iUnderlyingConsole->Write(KNewLine);
+ }
+ else
+ // else display a dialog
+ {
+ RNotifier notifier;
+ if (notifier.Connect() == KErrNone)
+ {
+ TInt buttonVal;
+ TRequestStatus notifierStatus;
+ notifier.Notify(aConsoleName, message, _L("OK"), KNullDesC, buttonVal, notifierStatus);
+ User::WaitForRequest(notifierStatus);
+ notifier.Close();
+ }
+ }
+ }
+ Message(EDebug, _L("%S console create completed with err=%d"), &aConsoleName, aError);
+ }
+
+EXPORT_C void MIosrvConsoleHelper::CleanupUnderlyingConsole()
+ {
+ delete iUnderlyingConsole; // In case of leave during construction, this might still be non-null
+ iUnderlyingConsole = NULL;
+ }
+
+EXPORT_C CConsoleBase* MIosrvConsoleHelper::UnderlyingConsole() const
+ {
+ return iUnderlyingConsole;
+ }
--- a/plugins/consoles/common/consoleextensions.h Sat Jul 31 21:32:20 2010 +0100
+++ b/plugins/consoles/common/consoleextensions.h Wed Aug 25 21:19:19 2010 +0100
@@ -119,7 +119,33 @@
*/
static inline TInt Write(CBase* aConsole, const TDesC& aDes);
};
+
+// BC on this interface is not guaranteed - only for use by things inside /fshell/plugins/consoles
+class MIosrvConsoleHelper
+ {
+protected:
+ enum TVerbosity
+ {
+ EInformation,
+ EError,
+ EDebug,
+ };
+ IMPORT_C void Message(TVerbosity aVerbosity, TRefByValue<const TDesC> aFmt, ...);
+ IMPORT_C TBool Debug() const;
+ IMPORT_C void SetDebug(TBool aDebug);
+ IMPORT_C void HandleConsoleCreationError(const TDesC& aConsoleName, TInt aError);
+ IMPORT_C void CleanupUnderlyingConsole();
+ IMPORT_C CConsoleBase* UnderlyingConsole() const;
+
+ IMPORT_C TInt MIosrvConsoleHelper_Extension(TUint aExtensionId, TAny*& a0, TAny* a1);
+ IMPORT_C virtual TInt WriteStdErr(const TDesC& aDes); // Default returns KErrExtensionNotSupported
+
+private:
+ TBool iDebug;
+ CConsoleBase* iUnderlyingConsole;
+ };
+
#include <fshell/consoleextensions.inl>
#endif //__CONSOLEEXTENSIONS_H__
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/plugins/consoles/common/consoleextensions.mmp Wed Aug 25 21:19:19 2010 +0100
@@ -0,0 +1,30 @@
+// consoleextensions.mmp
+//
+// Copyright (c) 2010 Accenture. All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Accenture - Initial contribution
+//
+
+#include <fshell/common.mmh>
+
+target consoleextensions.dll
+targettype DLL
+uid 0x1000008d FSHELL_UID_CONSOLEEXTENSIONS
+capability FSHELL_CAP_MMP_NORMAL
+
+sourcepath .
+userinclude .
+#include <fshell/fsh_system_include.mmh>
+
+source consoleextensions.cpp
+
+library euser.lib
+library econs.lib
+
+nostrictdef
+deffile .\~\consoleextensions.def
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/plugins/consoles/common/eabi/consoleextensions.def Wed Aug 25 21:19:19 2010 +0100
@@ -0,0 +1,12 @@
+EXPORTS
+ _ZN19MIosrvConsoleHelper11WriteStdErrERK7TDesC16 @ 1 NONAME
+ _ZN19MIosrvConsoleHelper24CleanupUnderlyingConsoleEv @ 2 NONAME
+ _ZN19MIosrvConsoleHelper26HandleConsoleCreationErrorERK7TDesC16i @ 3 NONAME
+ _ZN19MIosrvConsoleHelper29MIosrvConsoleHelper_ExtensionEjRPvS0_ @ 4 NONAME
+ _ZN19MIosrvConsoleHelper7MessageENS_10TVerbosityE11TRefByValueIK7TDesC16Ez @ 5 NONAME
+ _ZN19MIosrvConsoleHelper8SetDebugEi @ 6 NONAME
+ _ZNK19MIosrvConsoleHelper5DebugEv @ 7 NONAME
+ _ZTI19MIosrvConsoleHelper @ 8 NONAME
+ _ZTV19MIosrvConsoleHelper @ 9 NONAME
+ _ZNK19MIosrvConsoleHelper17UnderlyingConsoleEv @ 10 NONAME
+
--- a/plugins/consoles/consoleproxy/group/bld.inf Sat Jul 31 21:32:20 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-// bld.inf
-//
-// Copyright (c) 2009 - 2010 Accenture. All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of the "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Accenture - Initial contribution
-//
-
-#ifndef FSHELL_COMMON_MMH
-#include <fshell/common.mmh>
-#endif
-
-PRJ_EXPORTS
-..\inc\consoleproxy.h \epoc32\include\fshell\consoleproxy.h
-FSHELL_ROM_INCLUDE(consoleproxy.iby)
-
-PRJ_MMPFILES
-.\consoleproxy.mmp
-
--- a/plugins/consoles/defcons/group/bld.inf Sat Jul 31 21:32:20 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-// bld.inf
-//
-// Copyright (c) 2010 Accenture. All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of the "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Accenture - Initial contribution
-//
-#ifndef FSHELL_COMMON_MMH
-#include <fshell/common.mmh>
-#endif
-
-PRJ_EXPORTS
-FSHELL_ROM_INCLUDE(defcons.iby)
-
-PRJ_MMPFILES
-..\src\defcons
-
--- a/plugins/consoles/docs/consoles.pod Sat Jul 31 21:32:20 2010 +0100
+++ b/plugins/consoles/docs/consoles.pod Wed Aug 25 21:19:19 2010 +0100
@@ -164,7 +164,7 @@
This is the console of choice for running on a handset with a full graphical ROM, if remote connectivity is not available.
-=head3 L<vt100cons.dll|vt100cons>
+=head3 L<vt100cons|vt100cons>
A console implementation that will communicate with a VT100 compatible terminal (or terminal emulator such as HyperTerminal) via a serial connection. There are variants that work over TCP connnections (F<vt100tcpcons.dll>), Bluetooth (F<vt100btcons.dll>) and USB (F<vt100usbcons.dll>).
@@ -202,7 +202,37 @@
This is the remote console of choice when running on target (i.e. non-emulated) hardware.
-=head3 L<rcons.dll|rcons>
+=head3 L<terminalkeyboardcons|terminalkeyboardcons>
+
+On platforms that support the Terminal Keyboard and Trace Core, this console allows the Carbide Terminal Keyboard plugin to be used directly with fshell, even in gui environments when the normal eshell terminalkeyboard plugin won't work.
+
+Pros:
+
+=over 5
+
+=item *
+
+Works over whatever transport that TraceCore can use (so will work over XTI even when no physical serial ports are available).
+
+=item *
+
+Works in GUI (DFS) builds - unlike the standard eshell plugin.
+
+=back
+
+Cons:
+
+=item *
+
+Requires Carbide and the Carbide Terminal Keyboard plugin to be installed.
+
+=item *
+
+Limited by what the Carbide Terminal Keyboard plugin allows - so no ymodem support.
+
+=back
+
+=head3 L<rcons|rcons>
A console implementation that connects via TCP to a Win32 executable (called L<rcons.exe|rcons.exe>) that hosts console windows remotely.
@@ -240,7 +270,7 @@
This console has been largely superceded by L<vt100cons|vt100cons> (or one of its variants) for target use. However, it is still useful on the emulator because a) it is easy to get up an running, and b) new windows automatically appear (rather than needing to explicitly connect a terminal emulator).
-=head3 win32cons.dll
+=head3 win32cons
A specialized console for running the WINSCW emulator directly in a DOS box. A batch file F<\epoc32\tools\fshell.bat> is provided for convenience.
--- a/plugins/consoles/guicons/group/guicons_makefont.mk Sat Jul 31 21:32:20 2010 +0100
+++ b/plugins/consoles/guicons/group/guicons_makefont.mk Wed Aug 25 21:19:19 2010 +0100
@@ -9,14 +9,13 @@
# Initial Contributors:
# Accenture - Initial contribution
#
-GENERATED_SOURCE_DIR = $(EPOCROOT)epoc32\build\fshell/guicons\generated
+GENERATED_SOURCE_DIR = $(EPOCROOT)epoc32\build\fshell\guicons\generated
GENERATED_SOURCE = $(GENERATED_SOURCE_DIR)\defaultfontdata.inl
MAKMAKE : $(GENERATED_SOURCE)
$(GENERATED_SOURCE) : ..\data\font_6x10.PNG
perl $(EPOCROOT)epoc32\tools\emkdir.pl $(GENERATED_SOURCE_DIR)
- echo perl .\bin2lit.pl KDefaultFontImageData ^< ..\data\font_6x10.PNG ^> $(GENERATED_SOURCE)
perl .\bin2lit.pl KDefaultFontImageData < ..\data\font_6x10.PNG > $(GENERATED_SOURCE)
CLEAN :
--- a/plugins/consoles/iocons/group/bld.inf Sat Jul 31 21:32:20 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-// bld.inf
-//
-// Copyright (c) 2010 Accenture. All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of the "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Accenture - Initial contribution
-//
-#ifndef FSHELL_COMMON_MMH
-#include <fshell/common.mmh>
-#endif
-
-PRJ_MMPFILES
-.\iocons.mmp
-
--- a/plugins/consoles/nullcons/group/bld.inf Sat Jul 31 21:32:20 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-// bld.inf
-//
-// Copyright (c) 2010 Accenture. All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of the "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Accenture - Initial contribution
-//
-#ifndef FSHELL_COMMON_MMH
-#include <fshell/common.mmh>
-#endif
-
-PRJ_EXPORTS
-FSHELL_ROM_INCLUDE(nullcons.iby)
-
-PRJ_MMPFILES
-..\src\nullcons
-
--- a/plugins/consoles/rcons/group/bld.inf Sat Jul 31 21:32:20 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-// bld.inf
-//
-// Copyright (c) 2010 Accenture. All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of the "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Accenture - Initial contribution
-//
-#ifndef FSHELL_COMMON_MMH
-#include <fshell/common.mmh>
-#endif
-
-PRJ_EXPORTS
-FSHELL_ROM_INCLUDE2(..\client\group\rcons.iby, rcons.iby)
-..\server\win32\rcons.exe \epoc32\tools\rcons.exe
-..\client\data\rcons.ini.emulator \epoc32\winscw\c\system\console\rcons.ini
-..\client\data\rcons.idf Z:\resource\rcons.idf
-
-PRJ_MMPFILES
-..\client\group\remote_console.mmp
-
--- a/plugins/consoles/tefcons/bld.inf Sat Jul 31 21:32:20 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-// bld.inf
-//
-// Copyright (c) 2010 Accenture. All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of the "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Accenture - Initial contribution
-//
-#ifndef FSHELL_COMMON_MMH
-#include <fshell/common.mmh>
-#endif
-
-PRJ_EXPORTS
-//TODO sort this FSHELL_ROM_INCLUDE(tefcons.iby)
-
-PRJ_MMPFILES
-tefcons.mmp
-
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/plugins/consoles/terminalkeyboardcons/terminalkeyboardcons.cpp Wed Aug 25 21:19:19 2010 +0100
@@ -0,0 +1,415 @@
+// terminalkeyboardcons.cpp
+//
+// Copyright (c) 2010 Accenture. All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Accenture - Initial contribution
+//
+#include "terminalkeyboardcons.h"
+#include <fshell/common.mmh>
+#include <e32debug.h>
+#include <fshell/memoryaccess.h>
+
+const TInt KTkbdMessageId = 0xD6;
+// These are the defaults unless overridden by --console-size
+const TInt KWidth = 80;
+const TInt KHeight = 24;
+
+class CMessageWatcher : public CActive
+ {
+public:
+ CMessageWatcher(CTerminalKeyboardCons& aConsole)
+ : CActive(CActive::EPriorityStandard), iConsole(aConsole)
+ {
+ CActiveScheduler::Add(this);
+ iConsole.iDriver.RequestMessage(iStatus);
+ SetActive();
+ }
+
+ void DoCancel()
+ {
+ iConsole.iDriver.CancelMessage();
+ }
+
+ void RunL()
+ {
+ iConsole.MessageReceived(iStatus.Int());
+ if (iStatus.Int() == KErrNone)
+ {
+ iConsole.iDriver.RequestMessage(iStatus);
+ SetActive();
+ }
+ }
+
+ ~CMessageWatcher()
+ {
+ Cancel();
+ }
+
+private:
+ CTerminalKeyboardCons& iConsole;
+ };
+
+
+CTerminalKeyboardCons::CTerminalKeyboardCons()
+ : iTracker(TSize(KWidth, KHeight), this)
+ {
+ }
+
+CTerminalKeyboardCons::~CTerminalKeyboardCons()
+ {
+ delete iIdleUpdateTimer;
+ CleanupUnderlyingConsole();
+ delete iWatcher;
+ iDriver.Close();
+ iTextBuffer.Close();
+ iMungedTextBuffer.Close();
+ }
+
+TInt CTerminalKeyboardCons::Create(const TDesC& aTitle, TSize aSize)
+ {
+ TRAPD(err, ConstructL(aTitle, aSize));
+ HandleConsoleCreationError(_L("TerminalKeyboard"), err);
+ return err;
+ }
+
+void CTerminalKeyboardCons::ConstructL(const TDesC& aTitle, const TSize& aSize)
+ {
+ if (aTitle == _L("debug")) SetDebug(ETrue);
+ if (aSize.iWidth > 10 && aSize.iHeight > 10)
+ {
+ // Override size now we know it, checking that it's sane-ish - be sure to do this before anything that uses the console size!
+ new (&iTracker) TCursorTracker(aSize, this);
+ }
+
+ iTextBuffer.CreateMaxL(ScreenSize().iWidth * ScreenSize().iHeight);
+#ifdef SHOW_TEXTSHELL_BORDERS
+ iMungedTextBuffer.CreateL((ScreenSize().iWidth + 2) * (ScreenSize().iHeight + 2));
+#endif
+
+ iIdleUpdateTimer = CPeriodic::NewL(CActive::EPriorityLow); // Lower priority than the message watcher
+
+ TInt err = User::LoadLogicalDevice(KTcLddDriverName);
+ if (err && err != KErrAlreadyExists)
+ {
+ Message(EError, _L("Couldn't load LDD %S: %d"), &KTcLddDriverName, err);
+ User::Leave(err);
+ }
+
+ // Idiotic driver only accepts connections from processes with nokia vid - like that will stop us
+ TUint originalVid = RProcess().VendorId();
+ RMemoryAccess memAccess;
+ User::LeaveIfError(memAccess.Open());
+ TProcessProperties props;
+ props.iVid = 0x101FB657;
+ RProcess me; me.Open(RProcess().Id());
+ memAccess.SetProcessProperties(me, props);
+
+ err = iDriver.Open();
+
+ props.iVid = originalVid;
+ memAccess.SetProcessProperties(me, props);
+ me.Close();
+ memAccess.Close();
+
+ if (err)
+ {
+ Message(EError, _L("Couldn't open RTcDriver: %d"), err);
+ User::Leave(err);
+ }
+
+ err = iDriver.Subscribe(KTkbdMessageId);
+ if (err)
+ {
+ Message(EError, _L("Couldn't subscribe: %d"), err);
+ User::Leave(err);
+ }
+
+ iWatcher = new(ELeave) CMessageWatcher(*this);
+ CleanupUnderlyingConsole();
+
+ ClearScreen();
+ }
+
+
+TInt CTerminalKeyboardCons::Extension_(TUint aExtensionId, TAny*& a0, TAny* a1)
+ {
+ /*if (aExtensionId == ConsoleMode::KSetConsoleModeExtension)
+ {
+ ConsoleMode::TMode mode = (ConsoleMode::TMode)(TInt)a1;
+ iInputController->SetMode(mode);
+ iOutputController->SetMode(mode);
+ return KErrNone;
+ }
+ else*/
+ /*else if (aExtensionId == ConsoleAttributes::KSetConsoleAttributesExtension)
+ {
+ ConsoleAttributes::TAttributes* attributes = (ConsoleAttributes::TAttributes*)a1;
+ return iOutputController->SetAttributes(attributes->iAttributes, attributes->iForegroundColor, attributes->iBackgroundColor);
+ }*/
+
+ TInt ret = MIosrvConsoleHelper_Extension(aExtensionId, a0, a1);
+ if (ret == KErrExtensionNotSupported) ret = CConsoleBase::Extension_(aExtensionId, a0, a1);
+ return ret;
+ }
+
+void CTerminalKeyboardCons::MessageReceived(TInt aError)
+ {
+ Message(EDebug, _L("MessageReceived err=%d"), aError);
+ TInt err = aError;
+ if (err == KErrNone)
+ {
+ TPtrC8 data;
+ err = iDriver.GetMessageData(data);
+ if (!err && data.Length() < 1) err = KErrCorrupt;
+ if (!err && !iGotKey)
+ {
+ TUint16 rawkey = data[0];
+ Message(EDebug, _L("CTerminalKeyboardCons got key %d"), (TInt)rawkey);
+
+ // Terminal keyboard doesn't support control keys or cursor keys so we use our own two-stage sticky modifier (like unix meta key I think?)
+ if (iBacktickModifierDown)
+ {
+ // Terminal keyboard sends 2,4,6,8 for cursors, so we translate backtick-2 (ie backtick-leftarrow) as meaning left arrow
+ if (rawkey == '2') rawkey = (TUint16)EKeyUpArrow;
+ else if (rawkey == '4') rawkey = (TUint16)EKeyLeftArrow;
+ else if (rawkey == '6') rawkey = (TUint16)EKeyRightArrow;
+ else if (rawkey == '8') rawkey = (TUint16)EKeyDownArrow;
+ else if (rawkey >= 'a' && rawkey <= 'z')
+ {
+ // backtick-c means CTRL-C
+ rawkey = rawkey - 'a'+1;
+ }
+ else if (rawkey == ' ') rawkey = '`'; // backtick-space is how you do a backtick
+ else if (rawkey == '`') rawkey = (TUint16)EKeyEscape; // backtick-backtick is 'escape'
+ else if (rawkey == '1') rawkey = (TUint16)EKeyTab; // backtick-1 is 'tab'
+ iBacktickModifierDown = EFalse;
+ Message(EDebug, _L("Backtick escape converted to %d"), (TInt)rawkey);
+ }
+ else if (rawkey == '`')
+ {
+ iBacktickModifierDown = ETrue;
+ return;
+ }
+
+ iKeyCode = (TKeyCode)rawkey; // Close enough for now!
+ iGotKey = ETrue;
+ }
+ }
+ if (iClientStatus)
+ {
+ User::RequestComplete(iClientStatus, err);
+ if (err == KErrNone) iGotKey = EFalse;
+ }
+ }
+
+void CTerminalKeyboardCons::Read(TRequestStatus& aStatus)
+ {
+ /*if (iClientStatus)
+ {
+ TRequestStatus* stat = &aStatus;
+ User::RequestComplete(stat, KErrInUse);
+ }
+ else*/
+ {
+ aStatus = KRequestPending;
+ iClientStatus = &aStatus;
+ if (iGotKey)
+ {
+ iGotKey = EFalse;
+ User::RequestComplete(iClientStatus, KErrNone);
+ }
+ }
+ }
+
+void CTerminalKeyboardCons::ReadCancel()
+ {
+ if (iClientStatus)
+ {
+ User::RequestComplete(iClientStatus, KErrCancel);
+ }
+ }
+
+void CTerminalKeyboardCons::Write(const TDesC& aDes)
+ {
+ for (TInt i = 0; i < aDes.Length(); i++)
+ {
+ TInt textBufPos = CursorPos().iY * ScreenSize().iWidth + CursorPos().iX;
+ TChar ch(aDes[i]);
+ iTracker.WriteChar(ch);
+ if (ch.IsPrint()) iTextBuffer[textBufPos] = aDes[i];
+ }
+
+ Update();
+ }
+
+TPoint CTerminalKeyboardCons::CursorPos() const
+ {
+ return iTracker.CursorPos();
+ }
+
+void CTerminalKeyboardCons::SetCursorPosAbs(const TPoint& aPoint)
+ {
+ iTracker.SetCursorPosAbs(aPoint);
+ }
+
+void CTerminalKeyboardCons::SetCursorPosRel(const TPoint& aPoint)
+ {
+ iTracker.SetCursorPosRel(aPoint);
+ }
+
+void CTerminalKeyboardCons::SetCursorHeight(TInt /*aPercentage*/)
+ {
+ //iOutputController->SetCursorHeight(aPercentage);
+ }
+
+void CTerminalKeyboardCons::SetTitle(const TDesC& /*aDes*/)
+ {
+ //iOutputController->SetTitle(aDes);
+ }
+
+void CTerminalKeyboardCons::ClearScreen()
+ {
+ SetCursorPosAbs(TPoint(0,0));
+ iTextBuffer.Fill(' ');
+ Update();
+ }
+
+void CTerminalKeyboardCons::ClearToEndOfLine()
+ {
+ iTextBuffer.MidTPtr(CursorPos().iY * ScreenSize().iWidth + CursorPos().iX, ScreenSize().iWidth - CursorPos().iX).Fill(' ');
+ Update();
+ }
+
+TSize CTerminalKeyboardCons::ScreenSize() const
+ {
+ return iTracker.ConsoleSize();
+ }
+
+TKeyCode CTerminalKeyboardCons::KeyCode() const
+ {
+ return iKeyCode;
+ }
+
+TUint CTerminalKeyboardCons::KeyModifiers() const
+ {
+ return iKeyModifiers;
+ }
+
+// All these magic vals are as per the DOS 437 codepage http://en.wikipedia.org/wiki/CP437 and not Windows-1252 like the ws_win.cpp source incorrectly states
+// See also http://en.wikipedia.org/wiki/Box_drawing_characters
+enum
+ {
+ EBoxHorizontalBar = 0xCD,
+ EBoxVerticalBar = 0xBA,
+ EBoxTopLeft = 0xC9,
+ EBoxTopRight = 0xBB,
+ EBoxBottomLeft = 0xC8,
+ EBoxBottomRight = 0xBC,
+ };
+
+void CTerminalKeyboardCons::Update()
+ {
+ // Delay updates to the screen, to improve performance
+ static const TInt KDelay = 100000; // 0.1s
+ if (!iIdleUpdateTimer->IsActive())
+ {
+ // Don't reset timer if we're already running - otherwise constant typing will never show up until you stop pressing keys
+ iIdleUpdateTimer->Start(KDelay, KDelay, TCallBack(&UpdateCallback, this));
+ }
+ }
+
+TInt CTerminalKeyboardCons::UpdateCallback(TAny* aSelf)
+ {
+ static_cast<CTerminalKeyboardCons*>(aSelf)->DoUpdate();
+ return 0;
+ }
+
+void CTerminalKeyboardCons::DoUpdate()
+ {
+ iIdleUpdateTimer->Cancel(); // Stop any further updates
+
+#ifdef SHOW_TEXTSHELL_BORDERS
+ // Update munged buffer
+ const TInt contentWidth = ScreenSize().iWidth;
+ const TInt width = contentWidth + 2;
+ iMungedTextBuffer.SetLength(width);
+ iMungedTextBuffer.Fill(TChar(EBoxHorizontalBar));
+ iMungedTextBuffer[0] = EBoxTopLeft;
+ iMungedTextBuffer[width-1] = EBoxTopRight;
+
+ for (TInt i = 0; i < ScreenSize().iHeight; i++)
+ {
+ TPtrC line(iTextBuffer.Mid(i*contentWidth, contentWidth));
+ iMungedTextBuffer.AppendFormat(_L("%c%S%c"), EBoxVerticalBar, &line, EBoxVerticalBar);
+ }
+
+ iMungedTextBuffer.Append(EBoxBottomLeft);
+ iMungedTextBuffer.SetLength(iMungedTextBuffer.Length() + contentWidth);
+ iMungedTextBuffer.RightTPtr(contentWidth).Fill(EBoxHorizontalBar);
+ iMungedTextBuffer.Append(EBoxBottomRight);
+
+ // And send the munged buffer
+ Transmit(iMungedTextBuffer, width, ScreenSize().iHeight + 2);
+#else
+ // Just send it straight
+ Transmit(iTextBuffer, ScreenSize().iWidth, ScreenSize().iHeight);
+#endif
+ }
+
+void CTerminalKeyboardCons::Transmit(const TDesC& aBuf, TInt aWidth, TInt aHeight)
+ {
+ // This is how terminal keyboard does it - pretty horrible really
+
+ static const TInt KMaxLen = 200; // This is what terminal keyboard uses - technically you could go as far as a total of 256
+ TInt numLinesPerPrint = KMaxLen / aWidth;
+
+ TBuf<256> line;
+ TInt startLine = 0;
+ while (startLine < aHeight)
+ {
+ if (startLine == 0)
+ {
+ // First line has extra info
+ line.Format(_L("#$STIConsole#$%02d%02X%02X"), startLine, aWidth, aHeight);
+ }
+ else
+ {
+ line.Format(_L("#$STIConsole#$%02d"), startLine);
+ }
+
+ for (TInt i = 0; i < numLinesPerPrint; i++)
+ {
+ TPtrC theContents(aBuf.Mid((startLine+i)*aWidth, aWidth));
+ //RDebug::Printf("line len=%d theContents len=%d", line.Length(), theContents.Length());
+ line.Append(theContents);
+ }
+
+ RDebug::Print(line);
+ startLine += numLinesPerPrint;
+ }
+ }
+
+void CTerminalKeyboardCons::ConsoleScrolled(TInt aNumberOfLines)
+ {
+ TInt numChars = Abs(aNumberOfLines) * ScreenSize().iWidth;
+ if (aNumberOfLines > 0)
+ {
+ iTextBuffer.Delete(0, numChars);
+ iTextBuffer.AppendFill(' ', numChars);
+ }
+ else if (aNumberOfLines < 0)
+ {
+ iTextBuffer.SetLength(iTextBuffer.Length() - numChars);
+ while (numChars--) iTextBuffer.Insert(0, _L(" "));
+ }
+ }
+
+extern "C" EXPORT_C TAny* NewConsole()
+ {
+ return new CTerminalKeyboardCons;
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/plugins/consoles/terminalkeyboardcons/terminalkeyboardcons.h Wed Aug 25 21:19:19 2010 +0100
@@ -0,0 +1,75 @@
+// terminalkeyboardcons.h
+//
+// Copyright (c) 2010 Accenture. All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Accenture - Initial contribution
+//
+#ifndef TERMINALKEYBOARDCONS_H
+#define TERMINALKEYBOARDCONS_H
+
+#include <e32std.h>
+#include <e32cons.h>
+#include <TcDriverIf.h>
+#include <fshell/consoleextensions.h>
+#include "vtc_cursor_tracker.h"
+class CMessageWatcher;
+
+//#define SHOW_TEXTSHELL_BORDERS
+
+NONSHARABLE_CLASS(CTerminalKeyboardCons) : public CConsoleBase, public MIosrvConsoleHelper, public MConsoleScrollHandler
+ {
+public:
+ CTerminalKeyboardCons();
+ virtual ~CTerminalKeyboardCons();
+
+public: // From CConsoleBase
+ virtual TInt Create(const TDesC& aTitle, TSize aSize);
+ virtual void Read(TRequestStatus& aStatus);
+ virtual void ReadCancel();
+ virtual void Write(const TDesC& aDes);
+ virtual TPoint CursorPos() const;
+ virtual void SetCursorPosAbs(const TPoint& aPoint);
+ virtual void SetCursorPosRel(const TPoint& aPoint);
+ virtual void SetCursorHeight(TInt aPercentage);
+ virtual void SetTitle(const TDesC& aTitle);
+ virtual void ClearScreen();
+ virtual void ClearToEndOfLine();
+ virtual TSize ScreenSize() const;
+ virtual TKeyCode KeyCode() const;
+ virtual TUint KeyModifiers() const;
+ virtual TInt Extension_(TUint aExtensionId, TAny*& a0, TAny* a1);
+
+private: // From MConsoleScrollHandler
+ void ConsoleScrolled(TInt aNumberOfLines);
+
+private:
+ virtual void ConstructL(const TDesC& aTitle, const TSize& aSize);
+ void Update();
+ void DoUpdate();
+ void MessageReceived(TInt aError);
+ void Transmit(const TDesC& aBuf, TInt aWidth, TInt aHeight);
+ static TInt UpdateCallback(TAny* aSelf);
+
+protected:
+ TRequestStatus* iClientStatus;
+ TBool iGotKey;
+ TKeyCode iKeyCode;
+ TUint iKeyModifiers;
+ CConsoleBase* iUnderlyingConsole;
+ RTcDriver iDriver;
+
+ RBuf iTextBuffer;
+ RBuf iMungedTextBuffer; // With the borders
+ TCursorTracker iTracker;
+ CMessageWatcher* iWatcher;
+ friend class CMessageWatcher;
+ TBool iBacktickModifierDown;
+ CPeriodic* iIdleUpdateTimer;
+ };
+
+#endif // TERMINALKEYBOARDCONS_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/plugins/consoles/terminalkeyboardcons/terminalkeyboardcons.mmp Wed Aug 25 21:19:19 2010 +0100
@@ -0,0 +1,33 @@
+// terminalkeyboardcons.mmp
+//
+// Copyright (c) 2010 Accenture. All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of the "Eclipse Public License v1.0"
+// which accompanies this distribution, and is available
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
+//
+// Initial Contributors:
+// Accenture - Initial contribution
+//
+#include <fshell/common.mmh>
+
+target terminalkeyboardcons.dll
+targettype DLL
+uid 0x1000008d 0x100039e7 // Note this MUST be set to 0x100039e7
+capability FSHELL_CAP_MMP_NORMAL
+
+sourcepath .
+userinclude .
+userinclude ..\vt100cons\src\vt100 // For vtc_cursor_tracker.h
+#include <fshell/fsh_system_include.mmh>
+
+source terminalkeyboardcons.cpp
+sourcepath ..\vt100cons\src\vt100
+source vtc_cursor_tracker.cpp
+
+library euser.lib
+library econs.lib
+library consoleextensions.lib
+
+nostrictdef
+deffile ..\common\~\console.def
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/plugins/consoles/terminalkeyboardcons/terminalkeyboardcons.pod Wed Aug 25 21:19:19 2010 +0100
@@ -0,0 +1,69 @@
+# terminalkeyboardcons.pod
+#
+# Copyright (c) 2010 Accenture. All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of the "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Accenture - Initial contribution
+#
+
+__END__
+
+=head1 terminalkeyboardcons
+
+=head2 Introduction
+
+On platforms that support the Terminal Keyboard and Trace Core, this console allows the Carbide Terminal Keyboard plugin to be used directly with fshell via the tracecore connection, even in gui environments when the normal eshell terminalkeyboard plugin won't work. See the L<main consoles page|consoles> for a comparison of the various consoles.
+
+=head2 Usage
+
+There are no major configuration options to use terminalkeyboardcons. If it is supported on your platform, you just need to launch:
+
+ fshell --console terminalkeyboardcons
+
+And start the Carbide Terminal Keyboard plugin. Assuming tracing is set up correctly fshell should sucessfully piggyback the tracecore connection. You shouldn't specify any of the terminalkeyboard rombuild macros, they may interfere with fshell's implementation.
+
+You can specify the size of the terminal keyboard window using the C<--console-size> option (the default size is 80x24). There is a debug option which prints additional logging, although this won't be of interest to anyone except the fshell maintainers.
+
+ fshell --console terminalkeyboardcons [--console-size WIDTH,HEIGHT] [--console-title debug]
+
+=head2 Custom escape sequences
+
+The Carbide Terminal Keyboard (at the time of writing) does not pass through certain keypresses such as control keys, which limits the usefulness of the shell. Therefore this console supports a set of custom escape sequences using the backtick C<`> key as a modifier. The sequence C<backtick-space> means press and release the backtick key, then press and release the space bar.
+
+=over 5
+
+=item C<backtick-backtick>
+
+The escape key.
+
+=item C<backtick-1>
+
+Tab.
+
+=item C<backtick-uparrow>
+
+Up arrow (normally pressing the up cursor key just sends a numeric '2' to fshell, so technically this sequence is C<backtick-2>.)
+
+=item C<backtick-downarrow>, C<backtick-leftarrow>, C<backtick-rightarrow>
+
+Down, left, right.
+
+=item C<backtick-space>
+
+The literal backtick character C<`>.
+
+=item C<backtick-a> through C<backtick-z>
+
+The control keys CTRL-A through CTRL-Z.
+
+=back
+
+=head1 Copyright
+
+Copyright (c) 2008-2010 Accenture. All rights reserved.
+
+=cut
--- a/plugins/consoles/vt100cons/bwins/vt100u.def Sat Jul 31 21:32:20 2010 +0100
+++ b/plugins/consoles/vt100cons/bwins/vt100u.def Wed Aug 25 21:19:19 2010 +0100
@@ -31,10 +31,11 @@
?NewL@CVtConsoleInputController@@SAPAV1@AAVMConsoleInputObserver@@@Z @ 30 NONAME ABSENT ; class CVtConsoleInputController * CVtConsoleInputController::NewL(class MConsoleInputObserver &)
?NewLC@CVtConsoleInputController@@SAPAV1@AAVMConsoleInputObserver@@@Z @ 31 NONAME ABSENT ; class CVtConsoleInputController * CVtConsoleInputController::NewLC(class MConsoleInputObserver &)
?QueueBufL@CVtConsoleInputController@@QAEXABVTDesC8@@@Z @ 32 NONAME ABSENT ; void CVtConsoleInputController::QueueBufL(class TDesC8 const &)
- ?Debug@CVtcConsoleBase@@IAEHXZ @ 33 NONAME ; int CVtcConsoleBase::Debug(void)
- ?Message@CVtcConsoleBase@@IAAXW4TVerbosity@1@V?$TRefByValue@$$CBVTDesC16@@@@ZZ @ 34 NONAME ; void CVtcConsoleBase::Message(enum CVtcConsoleBase::TVerbosity, class TRefByValue<class TDesC16 const >, ...)
- ?SetDebug@CVtcConsoleBase@@IAEXH@Z @ 35 NONAME ; void CVtcConsoleBase::SetDebug(int)
+ ?Debug@CVtcConsoleBase@@IAEHXZ @ 33 NONAME ABSENT; int CVtcConsoleBase::Debug(void)
+ ?Message@CVtcConsoleBase@@IAAXW4TVerbosity@1@V?$TRefByValue@$$CBVTDesC16@@@@ZZ @ 34 NONAME ABSENT ; void CVtcConsoleBase::Message(enum CVtcConsoleBase::TVerbosity, class TRefByValue<class TDesC16 const >, ...)
+ ?SetDebug@CVtcConsoleBase@@IAEXH@Z @ 35 NONAME ABSENT ; void CVtcConsoleBase::SetDebug(int)
?SetAttributes@CVtConsoleOutputController@@QAEHIW4TColor@ConsoleAttributes@@0@Z @ 36 NONAME ; int CVtConsoleOutputController::SetAttributes(unsigned int, enum ConsoleAttributes::TColor, enum ConsoleAttributes::TColor)
?ResetAttributes@CVtConsoleOutputController@@QAEHXZ @ 37 NONAME ; int CVtConsoleOutputController::ResetAttributes(void)
?ReadKeywordValuePair@CVtcConsoleBase@@KAHAAVTLex16@@AAVTPtrC16@@1@Z @ 38 NONAME ; int CVtcConsoleBase::ReadKeywordValuePair(class TLex16 &, class TPtrC16 &, class TPtrC16 &)
+ ?ConstructL@CVtcConsoleBase@@IAEXABVTDesC16@@H@Z @ 39 NONAME ; void CVtcConsoleBase::ConstructL(class TDesC16 const &, int)
--- a/plugins/consoles/vt100cons/doc/vt100cons.pod Sat Jul 31 21:32:20 2010 +0100
+++ b/plugins/consoles/vt100cons/doc/vt100cons.pod Wed Aug 25 21:19:19 2010 +0100
@@ -16,7 +16,7 @@
=head2 Introduction
-A Symbian console implementation (sub-class of C<CConsoleBase>) for communicating with a VT100 terminal (or, more likely, a terminal emulator such as the Windows HyperTerminal program) over a C32 hosted serial connection. This console makes it possible to run console based tools on any handset that can be connected to via a serial connection.
+A Symbian console implementation (sub-class of C<CConsoleBase>) for communicating with a VT100 terminal (or, more likely, a terminal emulator such as the Windows HyperTerminal program) over a C32 hosted serial connection. This console makes it possible to run console based tools on any handset that can be connected to via a serial connection. See the L<main consoles page|consoles> for a comparison of the various consoles.
Note, the console provides no mechanism for remote clients to automatically connect and launch console tools. The launching of the required console tool must be initiated on the handset, causing F<vt100cons.dll> to be loaded. It will then attempt to establish a serial connection to the terminal that is expected to be listening on the other end of the connection.
@@ -78,6 +78,10 @@
If present, set the baud rate of the serial port. Allowed values are: 115200, 57600, 19200, 9600. If specified, the port is configured with the following settings: rate as specified; data bits 8; stop bits 1; parity none; handshake 0, terminator count 0. For virtual serial ports (eg USB ACMs or Bluetooth serial ports) it is generally not necessary to configure hardware attributes so the rate parameter should not be specified.
+=item * C<debug>
+
+If present, the console will print out some debugging diagnostics to the underlying console during construction.
+
=back
Each keyword and value must be separated by an equals ('=') character. There may be whitespace either side of this. Each keword / value pair must be separated by a comma (',') character. Again, there may be whitespace either side of this. The name values may not contain either equals or comma characters as no form of escaping is currently supported.
@@ -242,7 +246,7 @@
=item *
-Console size detection is not supported, and must be disabled in vt100.ini and iosrv.ini (eg by including vt100.ini.noautodetect and iosrv.ini.noautodetect). The console will always be assumed to be 80x24.
+Console size detection is not supported, and must be disabled in iosrv.ini (eg by including iosrv.ini.noautodetect). The console will always be assumed to be 80x24.
=item *
@@ -256,7 +260,9 @@
There are no C<--console-title> options for vt100debugport.dll. Usage:
- fshell --console vt100debugport.dll
+ fshell --console vt100debugport
+
+Note that use of vt100debugport is incompatible with using the C<FSHELL_REPLACE_ECONS> macro. If you intend to use vt100debugport you must not specify the replace econs macro.
=head2 RBusDevComm variant
@@ -264,7 +270,7 @@
fshell --console vt100busdevcons.dll --console-title port=2
-If an option isn't specified, the following are assumed: pdd=euart, ldd=ecomm, rate=115200.
+If an option isn't specified, the following are assumed: pdd=euart (ecdrv on emulator), ldd=ecomm, rate=EBpsAutobaud.
=head1 Copyright
--- a/plugins/consoles/vt100cons/eabi/vt100u.def Sat Jul 31 21:32:20 2010 +0100
+++ b/plugins/consoles/vt100cons/eabi/vt100u.def Wed Aug 25 21:19:19 2010 +0100
@@ -39,10 +39,11 @@
_ZN25CVtConsoleInputController4NewLER21MConsoleInputObserver @ 38 NONAME ABSENT
_ZN25CVtConsoleInputController5NewLCER21MConsoleInputObserver @ 39 NONAME ABSENT
_ZN25CVtConsoleInputController9QueueBufLERK6TDesC8 @ 40 NONAME ABSENT
- _ZN15CVtcConsoleBase5DebugEv @ 41 NONAME
- _ZN15CVtcConsoleBase7MessageENS_10TVerbosityE11TRefByValueIK7TDesC16Ez @ 42 NONAME
- _ZN15CVtcConsoleBase8SetDebugEi @ 43 NONAME
+ _ZN15CVtcConsoleBase5DebugEv @ 41 NONAME ABSENT
+ _ZN15CVtcConsoleBase7MessageENS_10TVerbosityE11TRefByValueIK7TDesC16Ez @ 42 NONAME ABSENT
+ _ZN15CVtcConsoleBase8SetDebugEi @ 43 NONAME ABSENT
_ZN26CVtConsoleOutputController13SetAttributesEjN17ConsoleAttributes6TColorES1_ @ 44 NONAME
_ZN26CVtConsoleOutputController15ResetAttributesEv @ 45 NONAME
_ZN15CVtcConsoleBase20ReadKeywordValuePairER6TLex16R7TPtrC16S3_ @ 46 NONAME
+ _ZN15CVtcConsoleBase10ConstructLERK7TDesC16i @ 47 NONAME
--- a/plugins/consoles/vt100cons/group/bld.inf Sat Jul 31 21:32:20 2010 +0100
+++ b/plugins/consoles/vt100cons/group/bld.inf Wed Aug 25 21:19:19 2010 +0100
@@ -29,7 +29,9 @@
#ifdef FSHELL_COMMS_SUPPORT
.\vt100serial.mmp
.\vt100cons.mmp
+#ifdef FSHELL_BLUETOOTH_SUPPORT
.\vt100btcons.mmp
+#endif
.\vt100tcpcons.mmp
.\vt100usbcons.mmp
#endif
--- a/plugins/consoles/vt100cons/group/vt100.mmp Sat Jul 31 21:32:20 2010 +0100
+++ b/plugins/consoles/vt100cons/group/vt100.mmp Wed Aug 25 21:19:19 2010 +0100
@@ -28,5 +28,6 @@
library euser.lib
library ltkutils.lib
+library consoleextensions.lib
deffile vt100.def
--- a/plugins/consoles/vt100cons/group/vt100btcons.mmp Sat Jul 31 21:32:20 2010 +0100
+++ b/plugins/consoles/vt100cons/group/vt100btcons.mmp Wed Aug 25 21:19:19 2010 +0100
@@ -27,5 +27,6 @@
library euser.lib
library btincomingserial.lib bluetooth.lib
library vt100.lib
+library consoleextensions.lib
deffile vt100btcons.def
--- a/plugins/consoles/vt100cons/group/vt100busdevcons.mmp Sat Jul 31 21:32:20 2010 +0100
+++ b/plugins/consoles/vt100cons/group/vt100busdevcons.mmp Wed Aug 25 21:19:19 2010 +0100
@@ -26,5 +26,6 @@
library euser.lib
library econs.lib
library vt100.lib
+library consoleextensions.lib
deffile vt100cons.def
--- a/plugins/consoles/vt100cons/group/vt100cons.iby Sat Jul 31 21:32:20 2010 +0100
+++ b/plugins/consoles/vt100cons/group/vt100cons.iby Wed Aug 25 21:19:19 2010 +0100
@@ -21,7 +21,9 @@
#ifdef FSHELL_COMMS_SUPPORT
FSHELL_EXECUTABLE_FILE(vt100serial.dll)
FSHELL_EXECUTABLE_FILE(vt100cons.dll)
+#ifdef FSHELL_BLUETOOTH_SUPPORT
FSHELL_EXECUTABLE_FILE(vt100btcons.dll)
+#endif
FSHELL_EXECUTABLE_FILE(vt100tcpcons.dll)
FSHELL_EXECUTABLE_FILE(vt100usbcons.dll)
#endif
@@ -30,12 +32,4 @@
FSHELL_EXECUTABLE_FILE(vt100debugport.dll)
#endif
-// Note, not #including loopback.iby because its doesn't use the
-// tool-kit's .iby file macros, and so breaks SIS file generation
-// via .iby files.
-//#ifndef __LOOPBACK_IBY__
-//#define __LOOPBACK_IBY__
-//FSHELL_EXECUTABLE_FILE(LOOPBACK.CSY)
-//#endif
-
#endif
--- a/plugins/consoles/vt100cons/group/vt100cons.mmp Sat Jul 31 21:32:20 2010 +0100
+++ b/plugins/consoles/vt100cons/group/vt100cons.mmp Wed Aug 25 21:19:19 2010 +0100
@@ -27,5 +27,6 @@
library euser.lib
library vt100serial.lib
library vt100.lib
+library consoleextensions.lib
deffile vt100cons.def
--- a/plugins/consoles/vt100cons/group/vt100serial.mmp Sat Jul 31 21:32:20 2010 +0100
+++ b/plugins/consoles/vt100cons/group/vt100serial.mmp Wed Aug 25 21:19:19 2010 +0100
@@ -27,5 +27,6 @@
library euser.lib
library c32.lib
library vt100.lib
+library consoleextensions.lib
deffile vt100serial.def
--- a/plugins/consoles/vt100cons/group/vt100tcpcons.mmp Sat Jul 31 21:32:20 2010 +0100
+++ b/plugins/consoles/vt100cons/group/vt100tcpcons.mmp Wed Aug 25 21:19:19 2010 +0100
@@ -29,5 +29,6 @@
library vt100.lib
library insock.lib
library commdb.lib
+library consoleextensions.lib
deffile vt100cons.def
--- a/plugins/consoles/vt100cons/group/vt100usbcons.mmp Sat Jul 31 21:32:20 2010 +0100
+++ b/plugins/consoles/vt100cons/group/vt100usbcons.mmp Wed Aug 25 21:19:19 2010 +0100
@@ -28,5 +28,6 @@
library usbman.lib
library vt100.lib
library vt100serial.lib
+library consoleextensions.lib
deffile vt100usbcons.def
--- a/plugins/consoles/vt100cons/inc/vtc_base.h Sat Jul 31 21:32:20 2010 +0100
+++ b/plugins/consoles/vt100cons/inc/vtc_base.h Wed Aug 25 21:19:19 2010 +0100
@@ -17,8 +17,9 @@
#include <e32cons.h>
#include <fshell/settings.h>
#include <fshell/vtc_controller.h>
+#include <fshell/consoleextensions.h>
-class CVtcConsoleBase : public CConsoleBase, public MConsoleOutput, public MConsoleInput
+class CVtcConsoleBase : public CConsoleBase, public MConsoleOutput, public MConsoleInput, public MIosrvConsoleHelper
{
public:
IMPORT_C virtual ~CVtcConsoleBase();
@@ -38,19 +39,9 @@
IMPORT_C virtual TUint KeyModifiers() const;
IMPORT_C virtual TInt Extension_(TUint aExtensionId, TAny*& a0, TAny* a1);
protected:
- enum TVerbosity
- {
- EInformation,
- EError,
- EDebug,
- };
-protected:
- IMPORT_C void Message(TVerbosity aVerbosity, TRefByValue<const TDesC> aFmt, ...);
- IMPORT_C TBool Debug();
- IMPORT_C void SetDebug(TBool aDebug);
-protected:
IMPORT_C CVtcConsoleBase();
IMPORT_C virtual void ConstructL(const TDesC& aTitle);
+ IMPORT_C void ConstructL(const TDesC& aTitle, TBool aConsoleSupportsSizeDetect); // Note this is NOT virtual, only used for baseclasses to call up to from their overload of ConstructL(const TDesC&) if they explicitly don't support console size detect
IMPORT_C static TInt ReadKeywordValuePair(TLex& aLex, TPtrC& aKeyword, TPtrC& aValue);
private:
@@ -62,9 +53,6 @@
CVtConsoleOutputController* iOutputController;
CVtConsoleInputController* iInputController;
LtkUtils::CIniFile* iIniFile;
- TInt iDebug;
-protected:
- CConsoleBase* iUnderlyingConsole;
};
--- a/plugins/consoles/vt100cons/inc/vtc_serial.h Sat Jul 31 21:32:20 2010 +0100
+++ b/plugins/consoles/vt100cons/inc/vtc_serial.h Wed Aug 25 21:19:19 2010 +0100
@@ -24,13 +24,14 @@
class TPortConfig
{
public:
- TPortConfig() : iRate(EBpsAutobaud) {}
+ TPortConfig() : iRate(EBpsAutobaud), iDebug(EFalse) {}
TPtrC iPdd;
TPtrC iLdd;
TPtrC iCsy;
TPtrC iPort;
TBps iRate;
+ TBool iDebug;
};
--- a/plugins/consoles/vt100cons/src/serial/vtc_serial.cpp Sat Jul 31 21:32:20 2010 +0100
+++ b/plugins/consoles/vt100cons/src/serial/vtc_serial.cpp Wed Aug 25 21:19:19 2010 +0100
@@ -15,7 +15,7 @@
const TInt KMaxWriteLength = 2 * 1024; // Some serial drivers fail with KErrNoMemory if writes are too big, so they have to be broken up.
-#define LEAVE_IF_ERROR_ALLOW_ALREADY_EXISTS(_x) { TInt _err = _x; if ((_err < 0) && (_err != KErrAlreadyExists)) { User::Leave(_err); } }
+#define ErrOrDebug(err) (((err) < 0 && (err) != KErrAlreadyExists) ? EError : EDebug)
EXPORT_C CVtcSerialConsole::CVtcSerialConsole()
{
@@ -34,6 +34,7 @@
_LIT(KKeywordCsy, "csy");
_LIT(KKeywordPort, "port");
_LIT(KKeywordRate, "rate");
+ _LIT(KKeywordDebug, "debug");
TBool keywordFound(EFalse);
TLex lex(aConfigDes);
@@ -89,6 +90,11 @@
}
keywordFound = ETrue;
}
+ else if (keyword == KKeywordDebug)
+ {
+ aConfig.iDebug = ETrue;
+ keywordFound = ETrue;
+ }
}
if (!keywordFound)
@@ -103,18 +109,29 @@
EXPORT_C void CVtcSerialConsole::ConstructL(const TDesC& aTitle)
{
TPortConfig portConfig;
- User::LeaveIfError(ReadConfig(aTitle, portConfig));
+ TInt err = ReadConfig(aTitle, portConfig);
+ if (err)
+ {
+ Message(EError, _L("Error reading config: %d"), err);
+ User::LeaveIfError(err);
+ }
+
if (portConfig.iPort.Length() == 0)
{
User::Leave(KErrArgument);
}
+
+ if (portConfig.iDebug) SetDebug(ETrue);
+
if (portConfig.iPdd.Length())
{
- LEAVE_IF_ERROR_ALLOW_ALREADY_EXISTS(User::LoadPhysicalDevice(portConfig.iPdd));
+ err = User::LoadPhysicalDevice(portConfig.iPdd);
+ Message(ErrOrDebug(err), _L("Loading PDD %S returned %d"), &portConfig.iPdd, err);
+ if (err != KErrAlreadyExists) User::LeaveIfError(err);
}
else
{
- // If not specified, assume they probably intended the standard ones (but don't error if they fail, since the user might actually know what they're doing
+ // If not specified, assume they probably intended the standard ones (but don't error if they fail, since the user might actually know what they're doing)
#ifdef __WINS__
User::LoadPhysicalDevice(_L("ecdrv"));
#else
@@ -124,23 +141,31 @@
if (portConfig.iLdd.Length())
{
- LEAVE_IF_ERROR_ALLOW_ALREADY_EXISTS(User::LoadLogicalDevice(portConfig.iLdd));
+ err = User::LoadLogicalDevice(portConfig.iLdd);
+ Message(ErrOrDebug(err), _L("Loading LDD %S returned %d"), &portConfig.iLdd, err);
+ if (err != KErrAlreadyExists) User::LeaveIfError(err);
}
else
{
User::LoadLogicalDevice(_L("ecomm"));
}
- User::LeaveIfError(iCommServ.Connect());
+ err = iCommServ.Connect();
+ Message(ErrOrDebug(err), _L("Connecting to RCommServ returned %d"), err);
+ User::LeaveIfError(err);
if (portConfig.iCsy.Length())
{
- LEAVE_IF_ERROR_ALLOW_ALREADY_EXISTS(iCommServ.LoadCommModule(portConfig.iCsy));
+ err = iCommServ.LoadCommModule(portConfig.iCsy);
+ Message(ErrOrDebug(err), _L("Loading CSY %S returned %d"), &portConfig.iCsy, err);
+ if (err != KErrAlreadyExists) User::LeaveIfError(err);
}
else
{
iCommServ.LoadCommModule(_L("ecuart"));
}
- User::LeaveIfError(iCommPort.Open(iCommServ, portConfig.iPort, ECommExclusive));
+ err = iCommPort.Open(iCommServ, portConfig.iPort, ECommExclusive);
+ Message(ErrOrDebug(err), _L("Opening port %S returned %d"), &portConfig.iPort, err);
+ User::LeaveIfError(err);
#ifdef __WINS__
// For BC reasons, we always set rate on WINS
@@ -160,7 +185,9 @@
cfg().iSpecialRate = 0;
cfg().iTerminatorCount = 0;
cfg().iSIREnable = ESIRDisable;
- User::LeaveIfError(iCommPort.SetConfig(cfg));
+ err = iCommPort.SetConfig(cfg);
+ Message(ErrOrDebug(err), _L("Setting port config returned %d"), err);
+ User::LeaveIfError(err);
}
User::LeaveIfError(iCommPort.ResetBuffers());
--- a/plugins/consoles/vt100cons/src/tcp/vtc_tcp.cpp Sat Jul 31 21:32:20 2010 +0100
+++ b/plugins/consoles/vt100cons/src/tcp/vtc_tcp.cpp Wed Aug 25 21:19:19 2010 +0100
@@ -102,7 +102,7 @@
TBuf<0x100> buf;
buf.AppendFormatList(aFmt, list, &overflow);
- if (iUnderlyingConsole)
+ if (UnderlyingConsole())
{
Message(EInformation, buf);
// when using a console, the accept can be cancelled by hitting ctrl-c
--- a/plugins/consoles/vt100cons/src/vt100/vtc_base.cpp Sat Jul 31 21:32:20 2010 +0100
+++ b/plugins/consoles/vt100cons/src/vt100/vtc_base.cpp Wed Aug 25 21:19:19 2010 +0100
@@ -17,17 +17,8 @@
_LIT(KIniDesciptionFile, "\\resource\\vt100.idf");
_LIT(KAttConsoleSizeDetect, "console_size_detect");
-_LIT(KNewLine, "\r\n");
-
-class TOverflowTruncate : public TDes16Overflow
- {
-public:
- virtual void Overflow(TDes16&) {}
- };
-
EXPORT_C CVtcConsoleBase::CVtcConsoleBase()
{
- //SetDebug(ETrue); // debug
}
EXPORT_C CVtcConsoleBase::~CVtcConsoleBase()
@@ -35,55 +26,34 @@
delete iIniFile;
delete iInputController;
delete iOutputController;
- delete iUnderlyingConsole; // In case of leave during construction, this might still be non-null
+ CleanupUnderlyingConsole();
}
EXPORT_C TInt CVtcConsoleBase::Create(const TDesC& aTitle, TSize /*aSize*/)
{
TRAPD(err, ConstructL(aTitle));
- if (err)
- {
- TBuf<512> message;
- message.Format(_L("Failed to create console (%d)."), err);
-
- if (iUnderlyingConsole && (LazyConsole::IsConstructed(iUnderlyingConsole) || !LazyConsole::IsLazy(iUnderlyingConsole)))
- // if we have an underlyconsole, which is either not lazy or is lazy but already constructed, then print the error to it.
- {
- iUnderlyingConsole->Write(message);
- iUnderlyingConsole->Write(KNewLine);
- }
- else
- // else display a dialog
- {
- RNotifier notifier;
- if (notifier.Connect() == KErrNone)
- {
- TInt buttonVal;
- TRequestStatus notifierStatus;
- notifier.Notify(_L("vt100"), message, _L("OK"), KNullDesC, buttonVal, notifierStatus);
- User::WaitForRequest(notifierStatus);
- notifier.Close();
- }
- }
- }
- Message(EDebug, _L("VT100 console create completed with err=%d"), err);
+ HandleConsoleCreationError(_L("VT100"), err);
return err;
}
-EXPORT_C void CVtcConsoleBase::ConstructL(const TDesC&)
+EXPORT_C void CVtcConsoleBase::ConstructL(const TDesC& aTitle)
+ {
+ ConstructL(aTitle, ETrue);
+ }
+
+EXPORT_C void CVtcConsoleBase::ConstructL(const TDesC&, TBool aConsoleSupportsSizeDetect)
{
iIniFile = LtkUtils::CIniFile::NewL(KIniFileName, KIniDesciptionFile);
TSize screenSize(80, 24); // If sizeDetect is not specified, we default to (and only support) 80x24
- if (iIniFile->GetBool(KAttConsoleSizeDetect))
+ if (aConsoleSupportsSizeDetect && iIniFile->GetBool(KAttConsoleSizeDetect))
{
DetectScreenSizeL(screenSize);
}
iOutputController = CVtConsoleOutputController::NewL(*this, *iIniFile, screenSize);
iInputController = CVtConsoleInputController::NewL(*this, *iIniFile);
ClearScreen();
- delete iUnderlyingConsole;
- iUnderlyingConsole = NULL;
+ CleanupUnderlyingConsole();
}
EXPORT_C TInt CVtcConsoleBase::Extension_(TUint aExtensionId, TAny*& a0, TAny* a1)
@@ -95,11 +65,6 @@
iOutputController->SetMode(mode);
return KErrNone;
}
- else if (aExtensionId == UnderlyingConsole::KSetUnderlyingConsoleExtension)
- {
- iUnderlyingConsole = (CConsoleBase*)a1;
- return KErrNone;
- }
else if (aExtensionId == ConsoleAttributes::KSetConsoleAttributesExtension)
{
ConsoleAttributes::TAttributes* attributes = (ConsoleAttributes::TAttributes*)a1;
@@ -107,41 +72,14 @@
}
else
{
- return CConsoleBase::Extension_(aExtensionId, a0, a1);
- }
- }
-
-EXPORT_C void CVtcConsoleBase::Message(TVerbosity aVerbosity, TRefByValue<const TDesC> aFmt, ...)
- {
- if (Debug() || (aVerbosity == EInformation) || (aVerbosity == EError))
- {
- TOverflowTruncate overflow;
- VA_LIST list;
- VA_START(list, aFmt);
- TBuf<0x100> buf;
- buf.AppendFormatList(aFmt, list, &overflow);
-
- if (iUnderlyingConsole)
+ TInt ret = MIosrvConsoleHelper_Extension(aExtensionId, a0, a1);
+ if (ret == KErrExtensionNotSupported)
{
- iUnderlyingConsole->Write(buf);
- iUnderlyingConsole->Write(KNewLine);
+ ret = CConsoleBase::Extension_(aExtensionId, a0, a1);
}
- else
- {
- User::InfoPrint(buf);
- }
+ return ret;
}
}
-
-EXPORT_C TBool CVtcConsoleBase::Debug()
- {
- return iDebug;
- }
-
-EXPORT_C void CVtcConsoleBase::SetDebug(TBool aDebug)
- {
- iDebug = aDebug;
- }
EXPORT_C void CVtcConsoleBase::Read(TRequestStatus& aStatus)
{
--- a/plugins/consoles/vt100cons/src/vt100/vtc_cursor_tracker.cpp Sat Jul 31 21:32:20 2010 +0100
+++ b/plugins/consoles/vt100cons/src/vt100/vtc_cursor_tracker.cpp Wed Aug 25 21:19:19 2010 +0100
@@ -17,15 +17,15 @@
// Constants.
//
-const TInt KTabSize = 8;
+const TInt KTabSize = 4;
//
// TCursorTracker.
//
-TCursorTracker::TCursorTracker(TSize aConsoleSize)
- : iConsoleSize(aConsoleSize), iCursorPos(TPoint(0, 0))
+TCursorTracker::TCursorTracker(TSize aConsoleSize, MConsoleScrollHandler* aScrollHander)
+ : iConsoleSize(aConsoleSize), iCursorPos(TPoint(0, 0)), iScrollHandler(aScrollHander)
{
}
@@ -135,6 +135,7 @@
{
// Reached the end of the line and there's no space below - console will scroll up a line and jump to the beginning of the newly exposed line.
iCursorPos.iX = 0;
+ if (iScrollHandler) iScrollHandler->ConsoleScrolled(1);
}
}
@@ -148,6 +149,7 @@
else
{
iCursorPos.iX = 0;
+ if (iScrollHandler) iScrollHandler->ConsoleScrolled(1);
}
}
--- a/plugins/consoles/vt100cons/src/vt100/vtc_cursor_tracker.h Sat Jul 31 21:32:20 2010 +0100
+++ b/plugins/consoles/vt100cons/src/vt100/vtc_cursor_tracker.h Wed Aug 25 21:19:19 2010 +0100
@@ -16,6 +16,12 @@
#include <e32std.h>
+class MConsoleScrollHandler
+ {
+public:
+ virtual void ConsoleScrolled(TInt aNumberOfLines) = 0; // Positive aNumberOfLines means scrolled off the bottom. Negative means scrolled up
+ };
+
/**
* This class is responsible for tracking the cursor position within the console
* window based on the data that is written to it. The cursor position is tracked
@@ -26,9 +32,10 @@
class TCursorTracker
{
public:
- TCursorTracker(TSize aConsoleSize);
+ TCursorTracker(TSize aConsoleSize, MConsoleScrollHandler* aScrollHander = NULL);
void Write(const TDesC& aDes);
void Write(const TDesC8& aDes);
+ void WriteChar(TChar aChar);
void SetCursorPosAbs(const TPoint& aPoint);
void SetCursorPosRel(const TPoint& aPoint);
void Reset();
@@ -39,11 +46,10 @@
void CursorRight();
void LineFeed();
void CarriageReturn();
- void WriteChar(TChar aChar);
private:
const TSize iConsoleSize;
TPoint iCursorPos;
+ MConsoleScrollHandler* iScrollHandler;
};
-
#endif // VTC_CURSOR_TRACKER_H
--- a/plugins/consoles/vt100cons/src/vtc_busdevcons.cpp Sat Jul 31 21:32:20 2010 +0100
+++ b/plugins/consoles/vt100cons/src/vtc_busdevcons.cpp Wed Aug 25 21:19:19 2010 +0100
@@ -23,8 +23,10 @@
TPtrC iLdd;
TInt iPort;
TBps iRate;
+ TBool iDebug;
};
+#define ErrOrDebug(err) (((err) < 0 && (err) != KErrAlreadyExists) ? EError : EDebug)
NONSHARABLE_CLASS(CVtcBusDevCommConsole) : public CVtcConsoleBase
{
@@ -67,7 +69,7 @@
_LIT(KLdd, "ecomm");
TPortConfig::TPortConfig()
- :iPdd(KNullDesC), iLdd(KNullDesC), iPort(-1), iRate(EBpsAutobaud)
+ :iPdd(KNullDesC), iLdd(KNullDesC), iPort(-1), iRate(EBpsAutobaud), iDebug(EFalse)
{
}
@@ -77,6 +79,7 @@
_LIT(KKeywordLdd, "ldd");
_LIT(KKeywordPort, "port");
_LIT(KKeywordRate, "rate");
+ _LIT(KKeywordDebug, "debug");
TBool keywordFound(EFalse);
TLex lex(aConfigDes);
@@ -128,6 +131,11 @@
}
keywordFound = ETrue;
}
+ else if (keyword == KKeywordDebug)
+ {
+ aConfig.iDebug = ETrue;
+ keywordFound = ETrue;
+ }
}
if (!keywordFound)
@@ -146,20 +154,22 @@
User::LeaveIfError(ReadConfig(aTitle, portConfig));
if (portConfig.iPort < 0) User::Leave(KErrArgument);
+ if (portConfig.iDebug) SetDebug(ETrue);
+
TPtrC pdd(portConfig.iPdd);
if (pdd.Length() == 0) pdd.Set(KPdd());
TPtrC ldd(portConfig.iLdd);
if (ldd.Length() == 0) ldd.Set(KLdd());
TInt err = User::LoadPhysicalDevice(pdd);
- Message(EDebug, _L("Loading %S returned %d"), &pdd, err);
+ Message(ErrOrDebug(err), _L("Loading PDD %S returned %d"), &pdd, err);
if (err != KErrAlreadyExists && portConfig.iPdd.Length()) User::LeaveIfError(err); // Don't error if we failed to load the default PDD
err = User::LoadLogicalDevice(ldd);
- Message(EDebug, _L("Loading %S returned %d"), &ldd, err);
+ Message(ErrOrDebug(err), _L("Loading LDD %S returned %d"), &ldd, err);
if (err != KErrAlreadyExists && portConfig.iLdd.Length()) User::LeaveIfError(err); // Don't error if we failed to load the default LDD
err = iComm.Open(portConfig.iPort);
- Message(EDebug, _L("Opening port %d returned %d"), portConfig.iPort, err);
+ Message(ErrOrDebug(err), _L("Opening port %d returned %d"), portConfig.iPort, err);
User::LeaveIfError(err);
if (portConfig.iRate != EBpsAutobaud)
@@ -176,7 +186,7 @@
cfg().iTerminatorCount = 0;
cfg().iSIREnable = ESIRDisable;
err = iComm.SetConfig(cfg);
- Message(EDebug, _L("RBusDevComm::SetConfig returned %d"), err);
+ Message(ErrOrDebug(err), _L("RBusDevComm::SetConfig returned %d"), err);
User::LeaveIfError(err);
}
iComm.ResetBuffers();
--- a/plugins/consoles/vt100cons/src/vtc_debugport.cpp Sat Jul 31 21:32:20 2010 +0100
+++ b/plugins/consoles/vt100cons/src/vtc_debugport.cpp Wed Aug 25 21:19:19 2010 +0100
@@ -82,7 +82,7 @@
iReader = new(ELeave) CReaderObject(this);
User::LeaveIfError(iConsole.Create());
User::LeaveIfError(iConsole.Init(_L("fshell"), TSize(KConsFullScreen,KConsFullScreen)));
- CVtcConsoleBase::ConstructL(aTitle);
+ CVtcConsoleBase::ConstructL(aTitle, EFalse);
}
TInt CVtcDebugPortConsole::Output(const TDesC8& aDes)
--- a/plugins/consoles/win32cons/group/bld.inf Sat Jul 31 21:32:20 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-// bld.inf
-//
-// Copyright (c) 2010 Accenture. All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of the "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Accenture - Initial contribution
-//
-#ifndef FSHELL_COMMON_MMH
-#include <fshell/common.mmh>
-#endif
-
-PRJ_EXPORTS
-
-.\fshell.bat \epoc32\tools\fshell.bat
-.\fshellconsole.ini \epoc32\data\fshellconsole.ini
-
-PRJ_MMPFILES
-
-#if defined(WINS)
-
-gnumakefile .\os_ver.mk
-.\win32cons.mmp
-
-#endif
\ No newline at end of file
--- a/plugins/consoles/win32cons/group/win32cons.mmp Sat Jul 31 21:32:20 2010 +0100
+++ b/plugins/consoles/win32cons/group/win32cons.mmp Wed Aug 25 21:19:19 2010 +0100
@@ -20,12 +20,13 @@
sourcepath ..\src
userinclude ..\src
#include <fshell/fsh_system_include.mmh>
-systeminclude \epoc32\build\fshell/win32cons\generated
+systeminclude \epoc32\build\fshell\win32cons\generated
source console.cpp win32cons.cpp keymappings.cpp
library euser.lib
library emulator.lib
+library consoleextensions.lib
deffile win32cons.def
--- a/plugins/consoles/win32cons/src/console.cpp Sat Jul 31 21:32:20 2010 +0100
+++ b/plugins/consoles/win32cons/src/console.cpp Wed Aug 25 21:19:19 2010 +0100
@@ -81,9 +81,10 @@
iWin32.Write(aDes.Ptr(), aDes.Length());
}
-void CWin32Console::WriteStdErr(const TDesC& aDes)
+TInt CWin32Console::WriteStdErr(const TDesC& aDes)
{
iWin32.WriteStdErr(aDes.Ptr(), aDes.Length());
+ return KErrNone;
}
TPoint CWin32Console::CursorPos() const
@@ -159,13 +160,7 @@
TInt CWin32Console::Extension_(TUint aExtensionId, TAny*& a0, TAny* a1)
{
- if (aExtensionId == ConsoleStdErr::KWriteStdErrConsoleExtension)
- {
- TDesC* des = (TDesC*)a1;
- WriteStdErr(*des);
- return KErrNone;
- }
- else if (aExtensionId == ConsoleAttributes::KSetConsoleAttributesExtension)
+ if (aExtensionId == ConsoleAttributes::KSetConsoleAttributesExtension)
{
ConsoleAttributes::TAttributes* attributes = (ConsoleAttributes::TAttributes*)a1;
int res = iWin32.SetAttributes(attributes->iAttributes, (TWin32Console::TColor)attributes->iForegroundColor, (TWin32Console::TColor)attributes->iBackgroundColor);
@@ -173,7 +168,12 @@
}
else
{
- return CConsoleBase::Extension_(aExtensionId, a0, a1);
+ TInt ret = MIosrvConsoleHelper_Extension(aExtensionId, a0, a1);
+ if (ret == KErrExtensionNotSupported)
+ {
+ ret = CConsoleBase::Extension_(aExtensionId, a0, a1);
+ }
+ return ret;
}
}
--- a/plugins/consoles/win32cons/src/console.h Sat Jul 31 21:32:20 2010 +0100
+++ b/plugins/consoles/win32cons/src/console.h Wed Aug 25 21:19:19 2010 +0100
@@ -49,12 +49,7 @@
Piping into the emulator process via this console is as yet untested.
*/
-#ifdef EKA2
-NONSHARABLE_CLASS(CWin32Console)
-#else
-class CWin32Console
-#endif
- : public CConsoleBase
+NONSHARABLE_CLASS(CWin32Console) : public CConsoleBase, public MIosrvConsoleHelper
{
public:
CWin32Console();
@@ -76,7 +71,9 @@
virtual TUint KeyModifiers() const;
virtual TInt Extension_(TUint aExtensionId, TAny*& a0, TAny* a1);
- virtual void WriteStdErr(const TDesC& aDes);
+private: // From MIosrvConsoleHelper
+ TInt WriteStdErr(const TDesC& aDes);
+
private:
TInt CreateNewConsole(const TDesC& aTitle, TSize aSize);
TInt FindClientThreadId(TThreadId& aThreadId);
--- a/tools/export_templates.mk Sat Jul 31 21:32:20 2010 +0100
+++ b/tools/export_templates.mk Wed Aug 25 21:19:19 2010 +0100
@@ -11,17 +11,17 @@
#
BLD :
ifeq ($(PLATFORM), WINSCW)
- .\exportall .\createsrc-templates %EPOCROOT%epoc32\tools\createsrc-templates
+ .\exportall .\createsrc-templates $(EPOCROOT)epoc32\tools\createsrc-templates
endif
RELEASABLES :
ifeq ($(PLATFORM), WINSCW)
- .\exportall -w .\createsrc-templates %EPOCROOT%epoc32\tools\createsrc-templates
+ @.\exportall -w .\createsrc-templates $(EPOCROOT)epoc32\tools\createsrc-templates
endif
CLEAN :
ifeq ($(PLATFORM), WINSCW)
- .\exportall -c .\createsrc-templates %EPOCROOT%epoc32\tools\createsrc-templates
+ .\exportall -c .\createsrc-templates $(EPOCROOT)epoc32\tools\createsrc-templates
endif
-MAKMAKE FINAL FREEZE LIB CLEANLIB RESOURCE SAVESPACE :
\ No newline at end of file
+MAKMAKE FINAL FREEZE LIB CLEANLIB RESOURCE SAVESPACE :
\ No newline at end of file