source410: literal 4.10 source reconstruction + BC++ 4.52 fleet toolchain archived
- BORLAND/: Borland C++ 4.52 (chosen over 4.5 by byte-match: CODE/RP/CW32.LIB
is identical to 4.52's install lib). BCC32/TLINK32/TLIB/MAKE run natively on
Win11; CODE/BT/OPT.MAK is the shipped BTL4OPT.EXE's exact flag recipe
(extender = Borland PowerPack DPMI32, not Phar Lap TNT).
- restoration/source410/: the literal 1995-form reconstruction of the missing
BT game source (never mixed into CODE/). Round 1-3 state:
* 6 of 10 surviving original TUs COMPILE CLEAN under the period toolchain
(BTMSSN, BTCNSL, BTSCNRL, BTTEAM, BTL4MODE, BTL4ARND) - first builds
since 1996.
* BT_L4/BTL4APP.CPP pilot reconstruction: 12/12 functions, Fail() lands on
its binary-recorded line 400 exactly.
* BT/BTCNSL.HPP: console wire IDs recovered from the binary's ctors
(Killed=9, Damaged=10, ScoreUpdate=13, DeathWithoutHonor=15 [T1];
TeamScore=12 flagged [T4]).
* MUNGA/: 8 engine-header backfills back-dated from the BT412 WinTesla tree
(VDATA numbering decomp-verified; AUDREND's OpenAL-era virtual removed -
the period compiler is the drift detector).
* Tooling: backdate.py (WinTesla->1995 header transform), compile410.sh
(per-TU verification sweep under authentic OPT.MAK flags).
* README: corrected roadmap - MECH.HPP is the capstone grown with the mech
TU reconstructions; BTREG.CPP green = the header-family milestone.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,778 @@
|
||||
///////////////////////////////////////////////////////////////
|
||||
// IDE Demo Program //
|
||||
// Delivery.cpp //
|
||||
// Copyright (c) 1993 by Borland International //
|
||||
///////////////////////////////////////////////////////////////
|
||||
#include <stdio.h>
|
||||
#include <dir.h>
|
||||
#include <classlib\arrays.h>
|
||||
#include <cstring.h>
|
||||
#include <fstream.h>
|
||||
|
||||
|
||||
// //
|
||||
// To take advantage of the tracing, attach the //
|
||||
// 'Diagnostics' StyleSheet to this node by //
|
||||
// selecting 'Edit node attributes' from the //
|
||||
// node's SpeedMenu and selecting it from the //
|
||||
// StyleSheets dropdown //
|
||||
// //
|
||||
|
||||
DIAG_DEFINE_GROUP( IdeDeliver, 1, 1 );
|
||||
|
||||
|
||||
// //
|
||||
// class Delivery //
|
||||
// //
|
||||
// class Delivery for reading command line and executing //
|
||||
// appropriate actions. If you wish to extend the //
|
||||
// functionality of this program, add a method to the //
|
||||
// to the Delivery class with the same prototype as //
|
||||
// Delivery::Copy and a corresponding entry to the static //
|
||||
// data member Delivery::_commands[] //
|
||||
// //
|
||||
|
||||
class Arguments;
|
||||
|
||||
class Delivery
|
||||
{
|
||||
public:
|
||||
|
||||
// Parser/Dispatcher //
|
||||
|
||||
void Execute( Arguments & );
|
||||
|
||||
protected:
|
||||
|
||||
// Commands //
|
||||
|
||||
void Copy ( Arguments & );
|
||||
void Move ( Arguments & );
|
||||
void MkDir ( Arguments & );
|
||||
void Clean ( Arguments & );
|
||||
void Rename ( Arguments & );
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// Array of command methods and there text equivalents //
|
||||
|
||||
typedef void (Delivery::*commandMethod)( Arguments & );
|
||||
|
||||
struct Commands
|
||||
{
|
||||
commandMethod parser;
|
||||
const char *cmdName;
|
||||
};
|
||||
|
||||
static Commands _commands[];
|
||||
|
||||
// low-level helpers.. //
|
||||
|
||||
enum FileCmd
|
||||
{
|
||||
fcCopy,
|
||||
fcMove
|
||||
};
|
||||
|
||||
void FilesCopyMove( Arguments &, FileCmd );
|
||||
void FilesCopyMove( const char *, const char *, FileCmd );
|
||||
|
||||
void FileCopy ( const char *, const char *);
|
||||
void FileMove ( const char *, const char *, int );
|
||||
void FileRename( const char *, const char *);
|
||||
void FileDelete( const char *, int okToFail = 1 );
|
||||
|
||||
};
|
||||
|
||||
|
||||
// //
|
||||
// class Arguments //
|
||||
// Array for holding command line arguments //
|
||||
// //
|
||||
|
||||
class _BIDSCLASS Arguments : public TArray<string>
|
||||
{
|
||||
public:
|
||||
Arguments( int argc, char * * argv );
|
||||
|
||||
// Return the Deliver command text found on command line //
|
||||
|
||||
const char * command();
|
||||
|
||||
// Return the last filename on the command line. (This has //
|
||||
// the side-effect of limiting the number of valid source //
|
||||
// filenames by one.) //
|
||||
|
||||
const char * destination();
|
||||
|
||||
// Return the filename at 'index'. Valid values for index //
|
||||
// start at 1 (one) and this method will return 0 when there //
|
||||
// are no more source filenames. //
|
||||
|
||||
const char * source( int index );
|
||||
|
||||
private:
|
||||
|
||||
void expandFile( char * );
|
||||
const char * arg(int i);
|
||||
|
||||
int _destinationAt;
|
||||
|
||||
};
|
||||
|
||||
inline const char *
|
||||
Arguments::arg( int i )
|
||||
{
|
||||
return( ((*this)[i]).c_str() );
|
||||
}
|
||||
|
||||
// PrintProgramSignature will output the program signature //
|
||||
|
||||
void PrintProgramSignature()
|
||||
{
|
||||
static int headerHasBeenPut = 0;
|
||||
|
||||
if( !headerHasBeenPut )
|
||||
{
|
||||
cout << "Deliver:"
|
||||
<< endl;
|
||||
|
||||
headerHasBeenPut = 1;
|
||||
}
|
||||
}
|
||||
|
||||
// //
|
||||
// main() //
|
||||
// //
|
||||
|
||||
int main (int argc, char * argv[])
|
||||
{
|
||||
int returnCode;
|
||||
|
||||
try
|
||||
{
|
||||
Arguments args( argc, argv );
|
||||
|
||||
Delivery parser;
|
||||
|
||||
parser.Execute( args );
|
||||
|
||||
returnCode = 0;
|
||||
|
||||
}
|
||||
catch ( xmsg & x )
|
||||
{
|
||||
PrintProgramSignature();
|
||||
|
||||
cout << "Fatal Error: "
|
||||
<< x.why()
|
||||
<< endl;
|
||||
|
||||
returnCode = 2;
|
||||
}
|
||||
|
||||
return returnCode;
|
||||
|
||||
}
|
||||
|
||||
// //
|
||||
// class FileSpec for manipulation file paths //
|
||||
// //
|
||||
|
||||
class FileSpec
|
||||
{
|
||||
public:
|
||||
// ctor //
|
||||
|
||||
FileSpec( const char * = "" );
|
||||
|
||||
// accessors //
|
||||
|
||||
const char * path();
|
||||
const char * drive();
|
||||
const char * dir();
|
||||
const char * file();
|
||||
const char * ext();
|
||||
|
||||
void path(const char *);
|
||||
void drive(const char *);
|
||||
void dir(const char *);
|
||||
void file(const char *);
|
||||
void ext(const char *);
|
||||
void fileext( const char * );
|
||||
|
||||
long age();
|
||||
|
||||
// flags() returns FILENAME, WILDCARDS etc. flags found in dir.h //
|
||||
|
||||
int flags();
|
||||
|
||||
// explicit splitter/merger //
|
||||
|
||||
int split();
|
||||
void merge();
|
||||
|
||||
// disk manipulation and polling //
|
||||
|
||||
int exists();
|
||||
int first();
|
||||
int next();
|
||||
|
||||
// Are this and another FileSpec referring to the same drive? //
|
||||
|
||||
int sameDrive( FileSpec & );
|
||||
|
||||
// Is this FileSpec really representing a directory? //
|
||||
|
||||
int isDirectory();
|
||||
|
||||
void addTrailingSlash();
|
||||
|
||||
// Strip the trailing slash from the path() element and return //
|
||||
// the path(). (Calling this invalidates the use dir(), file() //
|
||||
// and ext()). //
|
||||
|
||||
char * stripTrailingSlash();
|
||||
|
||||
private:
|
||||
|
||||
char _path [ MAXPATH ];
|
||||
char _drive[ MAXDRIVE ];
|
||||
char _dir [ MAXDIR ];
|
||||
char _file [ MAXFILE ];
|
||||
char _ext [ MAXEXT ];
|
||||
int _flags;
|
||||
|
||||
struct ffblk _dta;
|
||||
};
|
||||
|
||||
inline
|
||||
FileSpec::FileSpec( const char * apath )
|
||||
{
|
||||
path( apath );
|
||||
}
|
||||
|
||||
inline const char *
|
||||
FileSpec::path()
|
||||
{
|
||||
return( _path );
|
||||
}
|
||||
|
||||
inline const char *
|
||||
FileSpec::drive()
|
||||
{
|
||||
return( _drive );
|
||||
}
|
||||
|
||||
inline const char *
|
||||
FileSpec::dir()
|
||||
{
|
||||
return( _dir );
|
||||
}
|
||||
|
||||
inline const char *
|
||||
FileSpec::file()
|
||||
{
|
||||
return( _file );
|
||||
}
|
||||
|
||||
inline const char *
|
||||
FileSpec::ext()
|
||||
{
|
||||
return( _ext );
|
||||
}
|
||||
|
||||
inline int
|
||||
FileSpec::flags()
|
||||
{
|
||||
return( _flags );
|
||||
}
|
||||
|
||||
inline int
|
||||
FileSpec::exists()
|
||||
{
|
||||
return( first() );
|
||||
}
|
||||
|
||||
inline long
|
||||
FileSpec::age()
|
||||
{
|
||||
if( exists() )
|
||||
{
|
||||
unsigned long date = _dta.ff_fdate;
|
||||
unsigned long time = _dta.ff_ftime;
|
||||
|
||||
return( (long)( (date << 16) | time ) );
|
||||
}
|
||||
return( -1L );
|
||||
}
|
||||
|
||||
// //
|
||||
// class Delivery implemenation //
|
||||
// //
|
||||
|
||||
Delivery::Commands Delivery::_commands[] =
|
||||
{
|
||||
{ &Delivery::Copy, "COPY" },
|
||||
{ &Delivery::Move, "MOVE" },
|
||||
{ &Delivery::MkDir, "MKDIR" },
|
||||
{ &Delivery::Clean, "CLEAN" },
|
||||
{ &Delivery::Rename,"RENAME" },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
void
|
||||
Delivery::Execute( Arguments & args )
|
||||
{
|
||||
const char * cmdName = args.command();
|
||||
|
||||
int cmdNo = -1;
|
||||
|
||||
for( int i = 0; _commands[i].cmdName; i++ )
|
||||
{
|
||||
if( !stricmp( cmdName, _commands[i].cmdName ) )
|
||||
{
|
||||
cmdNo = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if( cmdNo == -1 )
|
||||
throw xmsg( "Unknown command!" );
|
||||
|
||||
(this->*_commands[cmdNo].parser)( args );
|
||||
}
|
||||
|
||||
void
|
||||
Delivery::FileCopy( const char * source, const char * destination )
|
||||
{
|
||||
TRACEX( IdeDeliver, 0,
|
||||
"Copy source: \""
|
||||
<< source
|
||||
<< "\" => \""
|
||||
<< destination
|
||||
<< "\"" );
|
||||
|
||||
FILE * in;
|
||||
FILE * out;
|
||||
|
||||
if( (in = fopen(source, "rb")) == 0 )
|
||||
throw xmsg( "Error opening source" );
|
||||
|
||||
if( (out = fopen(destination, "wb")) == 0 )
|
||||
throw xmsg( "Error opening destination" );
|
||||
|
||||
register int c;
|
||||
|
||||
while( (c = fgetc(in)) != EOF )
|
||||
fputc(c,out);
|
||||
|
||||
fclose(in);
|
||||
fclose(out);
|
||||
}
|
||||
|
||||
void
|
||||
Delivery::FileMove
|
||||
( const char * source, const char * destination, int sameDrive )
|
||||
{
|
||||
if( sameDrive )
|
||||
{
|
||||
// '1' here means it's ok for Delete to fail... //
|
||||
|
||||
FileDelete( destination, 1 );
|
||||
FileRename( source, destination );
|
||||
}
|
||||
else
|
||||
{
|
||||
FileCopy( source, destination );
|
||||
FileDelete( source );
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Delivery::FileDelete( const char * fileName, int okToFail )
|
||||
{
|
||||
if( ::unlink( fileName ) && !okToFail )
|
||||
throw xmsg( "Error deleting file" );
|
||||
}
|
||||
|
||||
void
|
||||
Delivery::FileRename( const char * oldName, const char * newName )
|
||||
{
|
||||
if( ::rename( oldName, newName ) )
|
||||
throw xmsg( "Error renaming file" );
|
||||
}
|
||||
|
||||
void
|
||||
Delivery::FilesCopyMove
|
||||
( const char * sourceFile, const char * destinationFile, FileCmd cmd )
|
||||
{
|
||||
FileSpec source ( sourceFile );
|
||||
FileSpec destination( destinationFile );
|
||||
|
||||
if( !source.first() )
|
||||
throw xmsg( "Can\'t find source" );
|
||||
|
||||
int useSourceFileName;
|
||||
|
||||
if( destination.isDirectory() )
|
||||
{
|
||||
destination.addTrailingSlash();
|
||||
useSourceFileName = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
useSourceFileName = 0;
|
||||
}
|
||||
|
||||
do
|
||||
{
|
||||
if( useSourceFileName )
|
||||
{
|
||||
destination.file( source.file() );
|
||||
destination.ext ( source.ext() );
|
||||
}
|
||||
|
||||
if( cmd == fcCopy )
|
||||
{
|
||||
// Future: there could be a check here for the ages //
|
||||
// of the FileSpecs if the user had requested //
|
||||
// 'update' copy //
|
||||
|
||||
FileCopy( source.path(), destination.path() );
|
||||
}
|
||||
else
|
||||
{
|
||||
FileMove( source.path(),
|
||||
destination.path(),
|
||||
destination.sameDrive( source ) );
|
||||
}
|
||||
|
||||
} while( source.next() );
|
||||
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Delivery::FilesCopyMove( Arguments & args, FileCmd cmd )
|
||||
{
|
||||
const char * destination = args.destination();
|
||||
|
||||
const char * source;
|
||||
|
||||
int i = 1;
|
||||
|
||||
while( (source = args.source(i++)) != 0 )
|
||||
{
|
||||
FilesCopyMove( source, destination, cmd );
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Delivery::Copy ( Arguments & args )
|
||||
{
|
||||
FilesCopyMove( args, fcCopy );
|
||||
}
|
||||
|
||||
void
|
||||
Delivery::Move ( Arguments & args )
|
||||
{
|
||||
FilesCopyMove( args, fcMove );
|
||||
}
|
||||
|
||||
void
|
||||
Delivery::MkDir( Arguments & args )
|
||||
{
|
||||
const char * source;
|
||||
|
||||
int i = 1;
|
||||
|
||||
while( (source = args.source(i++)) != 0 )
|
||||
{
|
||||
FileSpec dirName( source );
|
||||
|
||||
// Future: it would be nice if this did a recursive //
|
||||
// makedir like XCOPY //
|
||||
|
||||
if( ::mkdir( dirName.stripTrailingSlash() ) )
|
||||
throw xmsg( "Error making directory" );
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Delivery::Clean( Arguments & args )
|
||||
{
|
||||
const char * sourceFile;
|
||||
FileSpec source;
|
||||
|
||||
int i = 1;
|
||||
|
||||
while( (sourceFile = args.source(i++)) != 0 )
|
||||
{
|
||||
source.path( sourceFile );
|
||||
|
||||
if( !source.exists() )
|
||||
{
|
||||
PrintProgramSignature();
|
||||
cout << "Warning DELIVER : Can\'t find "
|
||||
<< source.path()
|
||||
<< endl;
|
||||
continue;
|
||||
}
|
||||
|
||||
do FileDelete( source.path() );
|
||||
while( source.next() );
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Delivery::Rename( Arguments & args )
|
||||
{
|
||||
if( args.GetItemsInContainer() != 3 )
|
||||
throw xmsg( "Wrong number of arguments for renaming" );
|
||||
|
||||
FileRename( args.source(1), args.destination() );
|
||||
}
|
||||
|
||||
|
||||
// //
|
||||
// class Arguments implementation //
|
||||
// //
|
||||
|
||||
Arguments::Arguments( int argc, char * * argv )
|
||||
: TArray<string>( 10 )
|
||||
{
|
||||
for( int i = 1; i < argc; i++ )
|
||||
{
|
||||
char * arg = argv[i];
|
||||
|
||||
if( *arg == '+' )
|
||||
expandFile( arg+1 );
|
||||
else
|
||||
Add( arg );
|
||||
}
|
||||
|
||||
// Initialize to one past the last item on the command line, if //
|
||||
// the caller calls the destination() method, we'll crank this //
|
||||
// back by one. //
|
||||
|
||||
_destinationAt = GetItemsInContainer();
|
||||
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Arguments::expandFile( char * fileName )
|
||||
{
|
||||
// This method will open a response file and treat every text //
|
||||
// word found in the file as an entry on the command line //
|
||||
|
||||
ifstream in( fileName );
|
||||
|
||||
if( !in.good() )
|
||||
throw xmsg( "Can't open response file" );
|
||||
|
||||
string nextString;
|
||||
|
||||
while( in.good() )
|
||||
{
|
||||
in >> nextString;
|
||||
nextString.strip( string::Both, ' ' );
|
||||
if( nextString.length() )
|
||||
Add( nextString );
|
||||
}
|
||||
}
|
||||
|
||||
const char *
|
||||
Arguments::source( int index )
|
||||
{
|
||||
if( index < 1 )
|
||||
throw xmsg( "Missing source operand" );
|
||||
|
||||
return( index >= _destinationAt ? 0 : arg(index) );
|
||||
}
|
||||
|
||||
const char *
|
||||
Arguments::command()
|
||||
{
|
||||
if( !GetItemsInContainer() )
|
||||
throw xmsg( "Missing command" );
|
||||
|
||||
return( arg(0) );
|
||||
}
|
||||
|
||||
const char *
|
||||
Arguments::destination()
|
||||
{
|
||||
if( GetItemsInContainer() < 3 )
|
||||
throw xmsg( "Missing destination operand" );
|
||||
|
||||
// This controls the effictiveness of the method source() //
|
||||
|
||||
--_destinationAt;
|
||||
|
||||
return( arg(_destinationAt) );
|
||||
}
|
||||
|
||||
// //
|
||||
// class FileSpec implementation //
|
||||
// //
|
||||
|
||||
int
|
||||
FileSpec::split()
|
||||
{
|
||||
return( _flags = ::fnsplit( _path, _drive, _dir, _file, _ext ) );
|
||||
}
|
||||
|
||||
void
|
||||
FileSpec::merge()
|
||||
{
|
||||
::fnmerge( _path, _drive, _dir, _file, _ext );
|
||||
}
|
||||
|
||||
void
|
||||
FileSpec::path(const char *path)
|
||||
{
|
||||
strcpy( _path, path );
|
||||
split();
|
||||
}
|
||||
|
||||
void
|
||||
FileSpec::drive(const char *drive)
|
||||
{
|
||||
strcpy( _drive, drive );
|
||||
merge();
|
||||
}
|
||||
|
||||
void
|
||||
FileSpec::dir(const char *dir)
|
||||
{
|
||||
strcpy( _dir, dir );
|
||||
merge();
|
||||
}
|
||||
|
||||
void
|
||||
FileSpec::file(const char *file)
|
||||
{
|
||||
strcpy( _file, file );
|
||||
merge();
|
||||
}
|
||||
|
||||
void
|
||||
FileSpec::ext(const char *ext)
|
||||
{
|
||||
strcpy( _ext, ext );
|
||||
merge();
|
||||
}
|
||||
|
||||
void
|
||||
FileSpec::fileext( const char *fileExt )
|
||||
{
|
||||
char * p = (char *)(strchr(fileExt,'.'));
|
||||
|
||||
if( !p )
|
||||
p = "";
|
||||
|
||||
ext( p );
|
||||
*p = 0;
|
||||
|
||||
file( fileExt );
|
||||
}
|
||||
|
||||
int
|
||||
FileSpec::first()
|
||||
{
|
||||
if( ::findfirst( _path, &_dta, 0 ) == -1 )
|
||||
return(0);
|
||||
|
||||
fileext( _dta.ff_name );
|
||||
return( 1 );
|
||||
}
|
||||
|
||||
int
|
||||
FileSpec::next()
|
||||
{
|
||||
if( ::findnext( &_dta ) == -1 )
|
||||
return( 0 );
|
||||
|
||||
fileext( _dta.ff_name );
|
||||
return( 1 );
|
||||
}
|
||||
|
||||
int
|
||||
FileSpec::sameDrive( FileSpec & other )
|
||||
{
|
||||
if( *_drive == *other._drive )
|
||||
return(1);
|
||||
|
||||
if( !*_drive )
|
||||
{
|
||||
_drive[0] = ::getdisk() + 'A' - 1;
|
||||
_drive[1] = ':';
|
||||
_drive[2] = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( !*other._drive )
|
||||
{
|
||||
other._drive[0] = ::getdisk() + 'A' - 1;
|
||||
other._drive[1] = ':';
|
||||
other._drive[2] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
char s[3];
|
||||
|
||||
s[0] = *_drive;
|
||||
s[1] = *other._drive;
|
||||
s[2] = 0;
|
||||
|
||||
strlwr( s );
|
||||
|
||||
return( s[0] == s[1] );
|
||||
}
|
||||
|
||||
int
|
||||
FileSpec::isDirectory()
|
||||
{
|
||||
int lastCharPos = strlen( _path ) - 1;
|
||||
|
||||
char lastChar;
|
||||
|
||||
if(((lastChar = _path[lastCharPos]) == '\\') || (lastChar == '/'))
|
||||
_path[lastCharPos] = 0;
|
||||
|
||||
int ret = (::findfirst( _path, &_dta, FA_DIREC ) != -1 ) &&
|
||||
( _dta.ff_attrib & FA_DIREC );
|
||||
|
||||
_path[ lastCharPos ] = lastChar;
|
||||
|
||||
return( ret );
|
||||
}
|
||||
|
||||
char *
|
||||
FileSpec::stripTrailingSlash()
|
||||
{
|
||||
int lastCharPos = strlen( _path ) - 1;
|
||||
|
||||
if( (_path[lastCharPos] == '\\') || (_path[lastCharPos] == '/') )
|
||||
_path[lastCharPos] = 0;
|
||||
|
||||
return( _path );
|
||||
}
|
||||
|
||||
void
|
||||
FileSpec::addTrailingSlash()
|
||||
{
|
||||
int lastCharPos = strlen( _path ) - 1;
|
||||
|
||||
if( (_path[lastCharPos] != '\\') && (_path[lastCharPos] != '/') )
|
||||
{
|
||||
strcat( _path, "\\" );
|
||||
split();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// End of file //
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,185 @@
|
||||
Instructions for the ide example DELIVER.IDE.
|
||||
//
|
||||
// Instructions for Deliver.ide
|
||||
// Copyright Borland International, 1993
|
||||
//
|
||||
|
||||
PLEASE read this entire explanation before venturing off to use the
|
||||
Deliver utilities. It is important to understand this program reads and
|
||||
*writes* to you disk so be careful.
|
||||
|
||||
Deliver and Deliverd are tools for basic file manipulation during the
|
||||
making of a project. They are called Deliver because their main purpose
|
||||
is intented to be used as moving project targets (.exe,.lib, etc.) from
|
||||
an intermediate area to a final 'delivery' area, however having the
|
||||
source code to these programs allows you to extend and enhance their
|
||||
functionality. It can be used as 'Tool' menu item to do general house-
|
||||
cleaning.
|
||||
|
||||
The Deliver.exe is the Windows16 version of the program. It will run
|
||||
fast but does not provide feedback of what's it's doing and being a
|
||||
Windows app it's 'return code' cannot be used to stop a build. The
|
||||
Deliverd.exe is the DOS16 version and can be used in make file scripts
|
||||
or in the IDE in conjunction with the $CAP MSG(BORL2MSG) filter to pump
|
||||
status but it will run slower since it has to invoke a 'DOS box' to run.
|
||||
Also, because it is a DOS app, it's return code can be used to stop
|
||||
a build in progress in case of mishap.
|
||||
|
||||
Deliver currently recognises the following commands:
|
||||
|
||||
COPY <source> [<source> ...] <destination>
|
||||
MOVE <source> [<source> ...] <destination>
|
||||
MKDIR <newdir> [<newdir> ...]
|
||||
CLEAN <filespec> [<filespec> ... ]
|
||||
RENAME <oldname> <newname>
|
||||
|
||||
Of these commands COPY, MOVE, and CLEAN take wildcards in the first
|
||||
argument(s).
|
||||
|
||||
Any piece of a command line (incuding the command) can be placed into
|
||||
a response file. The response file name must be preceded with the '+'
|
||||
(plus) character. For example:
|
||||
|
||||
deliverd move +mydeps.rsp c:\deliver
|
||||
|
||||
Where mydeps.rsp contains "c:\myproj\libs\*.lib c:\myproj\final\*.dll".
|
||||
|
||||
NOTE: Do not think that because some command names correspond to DOS
|
||||
commands with similar names and functionality, that they perform the
|
||||
same way. In many cases they do, but in many cases they do not (e.g.
|
||||
the RENAME command does not handle wildcards).
|
||||
|
||||
|
||||
USING DELIVERW/D IN THE IDE:
|
||||
------------------------------
|
||||
|
||||
Deliver/d tools can be used in one of several ways:
|
||||
1. Create a 'generic' utility to be used from the 'Tool' menu
|
||||
that prompts for command line
|
||||
2. Create a tool for every general combination you use it for
|
||||
3. Create one tool and use the 'Command line options' local
|
||||
override field of every node you apply to tool to
|
||||
4. Some combination of 2 and 3
|
||||
|
||||
To install Deliver in the 1. case, do the following:
|
||||
Select Options|Tools from the main menu.
|
||||
Add a NEW tool and fill in the fields as follows:
|
||||
Name: HouseCleaner
|
||||
Path: deliver.exe
|
||||
Command: $PROMPT
|
||||
Menu: &File utility
|
||||
Help Hint: General house cleaning tool
|
||||
OK, Close
|
||||
|
||||
For examples of number 2. see examples\windows\makeall.ide for Deliver's
|
||||
use on the targets chelp, deliver, and helpex.
|
||||
|
||||
We will proceed assuming number 3. above since it is the most involved,
|
||||
however you will most likely experiment until you find the right balance
|
||||
for your projects. In any event, Deliver is most useful when attached
|
||||
to a SourcePool nodes (but even that is not strict policy).
|
||||
|
||||
First you must add one (or both) of the Deliver .exe's as a tool:
|
||||
|
||||
Select Options|Tools from the main menu.
|
||||
Add a NEW tool and fill in the fields as follows:
|
||||
Name: Deliver
|
||||
Path: deliver.exe
|
||||
Command:
|
||||
Menu: &Deliver
|
||||
Help Hint: Node's file deliver utility
|
||||
|
||||
Select the Advanced button:
|
||||
check Translator,
|
||||
check Place on SpeedMenu,
|
||||
uncheck Place on Tools menu
|
||||
Translate from: SourcePool;
|
||||
(Spelling counts, so does case!!)
|
||||
OK, OK, Close.
|
||||
|
||||
Now you are ready to apply the tool to a node in your project:
|
||||
|
||||
Select Project|New Target
|
||||
Fill in the 'Target name:' field
|
||||
Select 'Source Pool' from the 'Target type' dropdown
|
||||
OK (this will create a new [SourcePool] node in your project)
|
||||
Select 'Edit node attributes' from the node's SpeedMenu
|
||||
Select 'Deliver' from the 'Translators:' dropdown
|
||||
OK
|
||||
Select 'Edit local options' from the node's SpeedMenu
|
||||
Select 'Tool' from the 'Topics list'
|
||||
Enter the deliver command line in the 'Command line options' field
|
||||
OK
|
||||
|
||||
NOTE: If you are using deliverd.exe, you will want to precede all
|
||||
local command lines with:
|
||||
$NOSWAP $CAP MSG(BOR2MSG.DLL)
|
||||
|
||||
|
||||
EXAMPLES:
|
||||
----------
|
||||
|
||||
1. To deliver an [.hlp] target to delivery area "Q:\PRODUCT":
|
||||
Add a SourcePool called "q:\product\myproj.hlp" with this local
|
||||
command line:
|
||||
COPY $NAME($EDNAME)$EXT($EDNAME) $DRIVE($EDNAME)$DIR($EDNAME)
|
||||
|
||||
This will expand to:
|
||||
COPY myproj.hlp q:\product\
|
||||
|
||||
and will copy myproj.hlp from the current directory to q:\product.
|
||||
|
||||
2. To make a tree of directories for a project:
|
||||
Add a SourcePool called "Tree Maker" with this local command line:
|
||||
MKDIR OBJS OBJS\S OBJS\M OBJS\L OBJS\H
|
||||
|
||||
3. To clean the tree of directories for a project:
|
||||
Add a SourcePool called "Tree Cleaner" with this local command line:
|
||||
CLEAN OBJS\S\*.* OBJS\M\*.* OBJS\L\*.* OBJS\H\*.*
|
||||
|
||||
4. To copy sources to a safe area after an edit session:
|
||||
Add a SourcePool called "Copy to safe"
|
||||
Move all sources nodes you wish to copy under "Copy to safe"
|
||||
Reference copy "Copy to safe" back to the target
|
||||
On the original (bold) "Copy to safe" make 'Deliver' it's
|
||||
translator and put this local command line:
|
||||
COPY +$RSP($DEPLIST) c:\safe\haven
|
||||
|
||||
|
||||
TIPS AND CAVEATS
|
||||
-----------------
|
||||
|
||||
1. REMEMBER: This tool deletes and copies over files on disk.
|
||||
|
||||
2. Do *not* experiment with this tool on projects you like. Make
|
||||
sure that a given piece of functionality you are trying to test
|
||||
works and works well in a testbed situation.
|
||||
|
||||
3. If you are not sure what a given set of transfer macros will expand
|
||||
out to be, place a $PROMPT at the beginning of the command line and
|
||||
run the tool. In the prompt box you get a preview of the command
|
||||
line that would be passed to the tool. You should *CANCEL* from
|
||||
this box if you have doubts about it's validity.
|
||||
|
||||
4. If you find yourself typing in the same local command more than a few
|
||||
times, consider copying the original 'Deliver' tool. You do this
|
||||
by:
|
||||
Select Options|Tools from the main menu
|
||||
Select 'DeliverWin'
|
||||
Push 'Copy' button
|
||||
Change the name
|
||||
Enter a command line
|
||||
Change the menu text
|
||||
OK, DONE
|
||||
|
||||
5. There is no law that says this tool can only apply to [SourcePool]
|
||||
node types, you apply the tool to .exe, .dll, AppExpert etc. by:
|
||||
Select Options|Tools from the main menu
|
||||
Select 'DeliverWin'
|
||||
Push 'Edit' button
|
||||
Push 'Advanced' button
|
||||
In 'Translate from' field add ".exe;.dll" to what's there
|
||||
OK, OK, DONE
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,332 @@
|
||||
/*
|
||||
borl2Msg.C copyright (c) 1993 Borland International
|
||||
*/
|
||||
|
||||
#include "ToolApi.H"
|
||||
#include "filtrc.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <mem.h>
|
||||
#include <dos.h>
|
||||
#include <dir.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
// Name the intermediate "PIPE" through which output will be captured
|
||||
#define PIPEID "c:\\$$PIPE$$.TC$"
|
||||
|
||||
int posted = 0;
|
||||
|
||||
/* Declare an array of function pointers to store the IDE tool API */
|
||||
IDE_ToolAPIFunc IDE_ToolAPI[IDE_NumFunctions];
|
||||
|
||||
/* Global variables use to parse program output */
|
||||
HINSTANCE globInst;
|
||||
|
||||
FileHandle Pipefh;
|
||||
|
||||
HMEM hBuffer;
|
||||
LPSTR Buffer;
|
||||
WORD curpos;
|
||||
WORD bufLen;
|
||||
|
||||
char inLine[133];
|
||||
LPSTR lineptr;
|
||||
|
||||
unsigned errorCount = 0;
|
||||
unsigned fatalCount = 0;
|
||||
unsigned warnCount = 0;
|
||||
|
||||
/*
|
||||
InitBuffer - allocate memory for filtering the piped output to the IDE
|
||||
*/
|
||||
void InitBuffer( void )
|
||||
{
|
||||
hBuffer = IDE_memalloc( MEM_MOVEABLE, 8192 );
|
||||
Buffer = IDE_memlock( hBuffer );
|
||||
bufLen = 0;
|
||||
curpos = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
ReleaseBuffer - cleanup allocated buffers and open file handles
|
||||
*/
|
||||
void ReleaseBuffer( void )
|
||||
{
|
||||
/* cleanup allocated buffers */
|
||||
IDE_memunlock( hBuffer );
|
||||
IDE_memfree( hBuffer );
|
||||
IDE_Close( Pipefh );
|
||||
|
||||
/* delete the pipe */
|
||||
IDE_Delete( PIPEID );
|
||||
}
|
||||
|
||||
/*
|
||||
nextchar - returns the next character from the pipe input
|
||||
|
||||
returns: next character from the pipe associated with handle Pipefh
|
||||
*/
|
||||
char nextchar( void )
|
||||
{
|
||||
if (curpos < bufLen)
|
||||
{
|
||||
return Buffer[curpos++];
|
||||
}
|
||||
Buffer[0] = '\0';
|
||||
bufLen = IDE_Read( Pipefh, Buffer, 7000 );
|
||||
if (bufLen == 0)
|
||||
return 0;
|
||||
curpos = 0;
|
||||
return nextchar();
|
||||
}
|
||||
|
||||
/*
|
||||
GetLine - get the next line of text from the pipe
|
||||
|
||||
returns: far pointer to string containing next line of text from the current opened
|
||||
pipe file
|
||||
*/
|
||||
LPSTR GetLine( void )
|
||||
{
|
||||
char ch;
|
||||
int count;
|
||||
|
||||
lineptr = inLine;
|
||||
count = 0;
|
||||
while (((ch = nextchar()) != '\x0D') && (ch != '\x0A') && (ch != 0) && (count<133))
|
||||
{
|
||||
*lineptr = ch;
|
||||
lineptr++;
|
||||
count++;
|
||||
}
|
||||
if (count == 133)
|
||||
{
|
||||
strcpy( &inLine[125], "....." );
|
||||
}
|
||||
if ((lineptr == inLine) && (ch == 0))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
*lineptr = '\0';
|
||||
return inLine;
|
||||
}
|
||||
|
||||
/*
|
||||
ProcessLine - dissect line of input and post it as a message to the IDE
|
||||
|
||||
Input: LPSTR line the line to dissect and post
|
||||
*/
|
||||
char CurFile[MAXPATH];
|
||||
|
||||
void ProcessLine( LPSTR Line )
|
||||
{
|
||||
unsigned i;
|
||||
char *s, *file, *lineno;
|
||||
|
||||
int haveALine = 0;
|
||||
|
||||
Msg M;
|
||||
|
||||
/* if blank line, return */
|
||||
while( *Line && ( (*Line == '\r') || (*Line == '\n') ) )\
|
||||
{
|
||||
Line++;
|
||||
}
|
||||
|
||||
if( *Line == '\0' )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (strncmp( Line, " WINDPMI.386", 14 ) == 0)
|
||||
{
|
||||
M.message = Line;
|
||||
M.filename = NULL;
|
||||
M.column = 1;
|
||||
M.line = 1;
|
||||
IDE_PostMessage( CUR_MSG_GROUP, &M );
|
||||
s = GetLine();
|
||||
s = GetLine();
|
||||
if (s != NULL)
|
||||
{
|
||||
M.message = s;
|
||||
IDE_PostMessage( CUR_MSG_GROUP, &M );
|
||||
}
|
||||
fatalCount++;
|
||||
return;
|
||||
}
|
||||
|
||||
// If line begins with Error or Warning or Fatal we want it
|
||||
if (!strncmp( Line, "Error", 5 ))
|
||||
{
|
||||
errorCount++;
|
||||
haveALine = 1;
|
||||
}
|
||||
|
||||
if (!strncmp( Line, "Fatal", 5 ))
|
||||
{
|
||||
fatalCount++;
|
||||
haveALine = 1;
|
||||
}
|
||||
if (!strncmp( Line, "Warning", 7 ))
|
||||
{
|
||||
warnCount++;
|
||||
haveALine = 1;
|
||||
}
|
||||
|
||||
if (haveALine)
|
||||
{
|
||||
// get by the beginning
|
||||
s = Line;
|
||||
while ((*s != '\0') &&
|
||||
(*s != ' '))
|
||||
{
|
||||
s++;
|
||||
}
|
||||
if (!*s)
|
||||
{
|
||||
return; // no file name
|
||||
}
|
||||
if (*(s-1) == ':')
|
||||
{
|
||||
file = NULL;
|
||||
i = 0;
|
||||
s++;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
s++;
|
||||
// should be pointing at a filename
|
||||
file = s;
|
||||
|
||||
// get to next space
|
||||
while ((*s != '\0') &&
|
||||
(*s != ' '))
|
||||
{
|
||||
s++;
|
||||
}
|
||||
if (*s==' ')
|
||||
{
|
||||
// found end of name
|
||||
*s = '\0'; // delimit filename
|
||||
s++;
|
||||
|
||||
// should be line number
|
||||
lineno = s;
|
||||
}
|
||||
|
||||
// find end of number
|
||||
while ((*s != '\0') &&
|
||||
(*s != ':'))
|
||||
{
|
||||
s++;
|
||||
}
|
||||
if (*s == ':')
|
||||
{
|
||||
// found end of number
|
||||
*s='\0'; // delimit line number
|
||||
s++;
|
||||
// set the line number
|
||||
i = atoi( lineno );
|
||||
}
|
||||
else
|
||||
{
|
||||
// didn't find a number, send 0
|
||||
i=0;
|
||||
// and reset message to lineno
|
||||
s = lineno;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// whatever is left must be the error
|
||||
M.message = s;
|
||||
M.filename = file;
|
||||
M.column = 1;
|
||||
M.line = i;
|
||||
|
||||
IDE_PostMessage( CUR_MSG_GROUP, &M );
|
||||
posted++;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
FilterToIDE - Open the pipe output from the program, read and post each line
|
||||
to the IDE
|
||||
*/
|
||||
void FilterToIDE( void )
|
||||
{
|
||||
LPSTR line;
|
||||
|
||||
Pipefh = IDE_Open( PIPEID, 0 );
|
||||
if (Pipefh < 0)
|
||||
{
|
||||
char error[100];
|
||||
LoadString( globInst, IDS_CANNOTFILTER, error, sizeof(error));
|
||||
IDE_ErrorBox( error );
|
||||
fatalCount++;
|
||||
return;
|
||||
}
|
||||
|
||||
InitBuffer();
|
||||
|
||||
while ((line = GetLine()) != NULL)
|
||||
{
|
||||
ProcessLine( line );
|
||||
}
|
||||
|
||||
ReleaseBuffer();
|
||||
}
|
||||
|
||||
/*
|
||||
Run - exported entry point to the filter DLL
|
||||
|
||||
Input: pTransferBlock TransBlock contains information about the program to
|
||||
be run, its command line, and the IDE tool API
|
||||
*/
|
||||
int far pascal _export Run( pTransferBlock TransBlock )
|
||||
{
|
||||
// Store the IDE tool API
|
||||
memcpy( IDE_ToolAPI, TransBlock->IDE_ToolAPI, sizeof(IDE_ToolAPI) );
|
||||
|
||||
// Try to run program capturing output to an intermediate file
|
||||
IDE_CaptureToPipe( TransBlock->program,
|
||||
TransBlock->cmdline,
|
||||
PIPEID );
|
||||
|
||||
// post the captured output to the IDE
|
||||
FilterToIDE();
|
||||
|
||||
// return appropriate code for
|
||||
if (fatalCount)
|
||||
{
|
||||
return toolFatalError;
|
||||
}
|
||||
if (errorCount)
|
||||
{
|
||||
return toolErrors;
|
||||
}
|
||||
if (warnCount)
|
||||
{
|
||||
return toolWarnings;
|
||||
}
|
||||
return toolSuccess;
|
||||
}
|
||||
|
||||
#pragma argsused
|
||||
int far pascal LibMain( HINSTANCE hInstance, WORD wDataSegment,
|
||||
WORD wHeapSize, LPSTR lpszCmdLine )
|
||||
{
|
||||
globInst = hInstance;
|
||||
return 1;
|
||||
}
|
||||
|
||||
#pragma argsused
|
||||
int FAR PASCAL WEP ( int bSystemExit )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,6 @@
|
||||
#include "filtrc.h"
|
||||
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
IDS_CANNOTFILTER "Transfer error: unable to process tool output."
|
||||
END
|
||||
@@ -0,0 +1 @@
|
||||
#define IDS_CANNOTFILTER 100
|
||||
@@ -0,0 +1,264 @@
|
||||
/*
|
||||
Grep2Msg.C copyright (c) 1993 Borland International
|
||||
*/
|
||||
|
||||
#include "ToolApi.H"
|
||||
#include "filtrc.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <mem.h>
|
||||
#include <dos.h>
|
||||
#include <dir.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
// Name the intermediate "PIPE" through which output will be captured
|
||||
#define PIPEID "c:\\$$PIPE$$.TC$"
|
||||
|
||||
char NewFileText[] = "File ";
|
||||
|
||||
int posted = 0;
|
||||
|
||||
/* Declare an array of function pointers to store the IDE tool API */
|
||||
IDE_ToolAPIFunc IDE_ToolAPI[IDE_NumFunctions];
|
||||
|
||||
/* Global variables use to parse program output */
|
||||
HINSTANCE globInst;
|
||||
|
||||
FileHandle Pipefh;
|
||||
|
||||
HMEM hBuffer;
|
||||
LPSTR Buffer;
|
||||
WORD curpos;
|
||||
WORD bufLen;
|
||||
|
||||
char inLine[255];
|
||||
LPSTR lineptr;
|
||||
|
||||
/*
|
||||
InitBuffer - allocate memory for filtering the piped output from grep to the IDE
|
||||
*/
|
||||
void InitBuffer( void )
|
||||
{
|
||||
hBuffer = IDE_memalloc( MEM_MOVEABLE, 8192 );
|
||||
Buffer = IDE_memlock( hBuffer );
|
||||
bufLen = 0;
|
||||
curpos = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
ReleaseBuffer - cleanup allocated buffers and open file handles
|
||||
*/
|
||||
void ReleaseBuffer( void )
|
||||
{
|
||||
/* cleanup allocated buffers */
|
||||
IDE_memunlock( hBuffer );
|
||||
IDE_memfree( hBuffer );
|
||||
IDE_Close( Pipefh );
|
||||
|
||||
/* delete the pipe */
|
||||
IDE_Delete( PIPEID );
|
||||
}
|
||||
|
||||
/*
|
||||
nextchar - returns the next character from the pipe input
|
||||
|
||||
returns: next character from the pipe associated with handle Pipefh
|
||||
*/
|
||||
char nextchar( void )
|
||||
{
|
||||
if (curpos < bufLen)
|
||||
{
|
||||
return Buffer[curpos++];
|
||||
}
|
||||
Buffer[0] = '\0';
|
||||
bufLen = IDE_Read( Pipefh, Buffer, 7000 );
|
||||
if (bufLen == 0)
|
||||
return 0;
|
||||
curpos = 0;
|
||||
return nextchar();
|
||||
}
|
||||
|
||||
/*
|
||||
GetLine - get the next line of text from the pipe
|
||||
|
||||
returns: far pointer to string containing next line of text from the current opened
|
||||
pipe file
|
||||
*/
|
||||
LPSTR GetLine( void )
|
||||
{
|
||||
char ch;
|
||||
int count;
|
||||
|
||||
lineptr = inLine;
|
||||
count = 0;
|
||||
while ( ((ch = nextchar()) != '\x0D') &&
|
||||
(ch != '\x0A') &&
|
||||
(ch != 0) &&
|
||||
(count < 133))
|
||||
{
|
||||
*lineptr = ch;
|
||||
lineptr++;
|
||||
count++;
|
||||
}
|
||||
if (count >= 133)
|
||||
{
|
||||
strcpy( &inLine[125], "......" );
|
||||
lineptr = &inLine[133];
|
||||
|
||||
// strip remainder of long line
|
||||
while ( ((ch = nextchar()) != '\x0D') &&
|
||||
(ch != '\x0A') &&
|
||||
(ch != 0))
|
||||
{
|
||||
}
|
||||
}
|
||||
if ((lineptr == inLine) && (ch == 0))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
*lineptr = '\0';
|
||||
return inLine;
|
||||
}
|
||||
|
||||
/*
|
||||
ProcessLine - dissect line of input and post it as a message to the IDE
|
||||
|
||||
Input: LPSTR line the line to dissect and post
|
||||
*/
|
||||
char curFile[MAXPATH];
|
||||
|
||||
void ProcessLine( LPSTR Line )
|
||||
{
|
||||
unsigned i;
|
||||
char *s;
|
||||
Msg M;
|
||||
|
||||
if (Line[0] == '\0') /* ignore blank line */
|
||||
return;
|
||||
|
||||
if (Line[0] == '\x0A')
|
||||
return;
|
||||
|
||||
/* check for new file name */
|
||||
if (strncmp(Line,NewFileText,strlen(NewFileText)) == 0)
|
||||
{
|
||||
Line[strlen(Line)-1] = 0; /* remove ":" */
|
||||
memmove(curFile,&Line[strlen(NewFileText)],strlen(Line));
|
||||
}
|
||||
else
|
||||
{
|
||||
s = strchr(Line,' ');
|
||||
if (s != NULL)
|
||||
{
|
||||
s++;
|
||||
if (strncmp(s,"lines match",11) == 0) /* special case lines matching */
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
s--;
|
||||
*s = 0;
|
||||
i = atoi(Line);
|
||||
*s = ' ';
|
||||
if (i != 0)
|
||||
{
|
||||
s++;
|
||||
memmove(Line,s,strlen(s)+1);
|
||||
while (Line[0] == ' ' && Line[0] != 0) /* strip leading spaces */
|
||||
memmove(Line,&Line[1],strlen(Line)); /* from remaining line */
|
||||
|
||||
M.message = Line;
|
||||
M.filename = curFile;
|
||||
M.column = 1;
|
||||
M.line = i;
|
||||
|
||||
IDE_PostMessage( CUR_MSG_GROUP, &M );
|
||||
posted++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
FilterToIDE - Open the pipe output from the program, read and post each line
|
||||
to the IDE
|
||||
*/
|
||||
void FilterToIDE( void )
|
||||
{
|
||||
LPSTR line;
|
||||
|
||||
Pipefh = IDE_Open( PIPEID, READ_WRITE );
|
||||
if (Pipefh < 0)
|
||||
{
|
||||
char error[100];
|
||||
LoadString( globInst, IDS_CANNOTFILTER, error, sizeof(error));
|
||||
IDE_ErrorBox( error );
|
||||
return;
|
||||
}
|
||||
|
||||
InitBuffer();
|
||||
|
||||
while ((line = GetLine()) != NULL)
|
||||
{
|
||||
ProcessLine( line );
|
||||
}
|
||||
|
||||
ReleaseBuffer();
|
||||
}
|
||||
|
||||
/*
|
||||
CheckVersion - Check IDE version
|
||||
*/
|
||||
BOOL CheckVersion( void )
|
||||
{
|
||||
// If the DLL is specific to a particular version of the IDE
|
||||
// or if it only works for DOS platform or Windows Platform
|
||||
// this is the place to check.
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
Run - exported entry point to the filter DLL
|
||||
|
||||
Input: pTransferBlock TransBlock contains information about the program to
|
||||
be run, its command line, and the IDE tool API
|
||||
*/
|
||||
int far pascal _export Run( pTransferBlock TransBlock )
|
||||
{
|
||||
// Store the IDE tool API
|
||||
memcpy( IDE_ToolAPI, TransBlock->IDE_ToolAPI, sizeof(IDE_ToolAPI) );
|
||||
|
||||
if (!CheckVersion())
|
||||
{
|
||||
return NO_TASK;
|
||||
}
|
||||
|
||||
// Try to run Grep.COM capturing output to an intermediate file
|
||||
IDE_CaptureToPipe( TransBlock->program,
|
||||
TransBlock->cmdline,
|
||||
PIPEID );
|
||||
|
||||
// post the captured output to the IDE
|
||||
FilterToIDE();
|
||||
|
||||
return 1; // always bring up message window
|
||||
}
|
||||
|
||||
#pragma argsused
|
||||
int far pascal LibMain( HINSTANCE hInstance, WORD wDataSegment,
|
||||
WORD wHeapSize, LPSTR lpszCmdLine )
|
||||
{
|
||||
globInst = hInstance;
|
||||
return 1;
|
||||
}
|
||||
|
||||
#pragma argsused
|
||||
int FAR PASCAL WEP ( int bSystemExit )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,271 @@
|
||||
/*
|
||||
HC312Msg.C copyright (c) 1993 Borland International
|
||||
*/
|
||||
|
||||
#include "ToolApi.H" // Borland IDE tool dll interface
|
||||
#include "filtrc.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#include <mem.h>
|
||||
#include <dos.h>
|
||||
#include <dir.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
// Name the intermediate "PIPE" through which output will be captured
|
||||
#define PIPEID "C:\\$$PIPE$$.TC$"
|
||||
|
||||
/* Declare an array of function pointers to store the IDE tool API */
|
||||
IDE_ToolAPIFunc IDE_ToolAPI[IDE_NumFunctions];
|
||||
|
||||
/* Global variables use to parse program output */
|
||||
HINSTANCE globInst;
|
||||
|
||||
char WarningText[] = "Warning";
|
||||
char ErrorText[] = "Error";
|
||||
|
||||
char CurFile[MAXPATH]; /* Current file in message window */
|
||||
|
||||
FileHandle Pipefh;
|
||||
|
||||
HMEM hBuffer;
|
||||
LPSTR Buffer;
|
||||
WORD curpos;
|
||||
WORD bufLen;
|
||||
|
||||
char inLine[150];
|
||||
LPSTR lineptr;
|
||||
|
||||
int numFatals = 0;
|
||||
int numErrors = 0;
|
||||
int numWarnings = 0;
|
||||
|
||||
/*
|
||||
InitBuffer - allocate memory for filtering the piped output to the IDE
|
||||
*/
|
||||
void InitBuffer( void )
|
||||
{
|
||||
hBuffer = IDE_memalloc( MEM_MOVEABLE, 8192 );
|
||||
Buffer = IDE_memlock( hBuffer );
|
||||
bufLen = 0;
|
||||
curpos = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
ReleaseBuffer - cleanup allocated buffers and open file handles
|
||||
*/
|
||||
void ReleaseBuffer( void )
|
||||
{
|
||||
IDE_memunlock( hBuffer );
|
||||
IDE_memfree( hBuffer );
|
||||
IDE_Close( Pipefh );
|
||||
IDE_Delete( PIPEID );
|
||||
}
|
||||
|
||||
/*
|
||||
nextchar - returns the next character from the pipe input
|
||||
|
||||
returns: next character from the pipe associated with handle Pipefh
|
||||
*/
|
||||
char nextchar( void )
|
||||
{
|
||||
if (curpos < bufLen)
|
||||
{
|
||||
return Buffer[curpos++];
|
||||
}
|
||||
Buffer[0] = '\0';
|
||||
bufLen = IDE_Read( Pipefh, Buffer, 7000 );
|
||||
if (bufLen == 0)
|
||||
return 0;
|
||||
curpos = 0;
|
||||
return nextchar();
|
||||
}
|
||||
|
||||
/*
|
||||
GetLine - get the next line of text from the pipe
|
||||
|
||||
returns: far pointer to string containing next line of text from the current opened
|
||||
pipe file
|
||||
*/
|
||||
LPSTR GetLine( void )
|
||||
{
|
||||
char ch;
|
||||
int count;
|
||||
|
||||
lineptr = inLine;
|
||||
count = 0;
|
||||
while (((ch = nextchar()) != '\x0D') && (ch != '\x0A') && (ch != 0) && (count<133))
|
||||
{
|
||||
*lineptr = ch;
|
||||
lineptr++;
|
||||
count++;
|
||||
}
|
||||
if (count == 133)
|
||||
{
|
||||
strcpy( &inLine[125], "......" );
|
||||
}
|
||||
if ((lineptr == inLine) && (ch == 0))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
*lineptr = '\0';
|
||||
return inLine;
|
||||
}
|
||||
|
||||
/*
|
||||
HC31 error and warning lines are of the form:
|
||||
|
||||
Warning: ####: line...## of file.nam : Message text
|
||||
|
||||
*/
|
||||
void ProcessLine( LPSTR Line )
|
||||
{
|
||||
char *s;
|
||||
char *p;
|
||||
int havePost = 0;
|
||||
long lineno;
|
||||
Msg M;
|
||||
|
||||
// first trick is that the output is garbled due to conio type output
|
||||
// being captured. Problems can be fixed if null terminate at the text
|
||||
// "Microsoft"
|
||||
if ((s = strstr(Line, "Microsoft")) != NULL)
|
||||
{
|
||||
*s='\0';
|
||||
}
|
||||
if (strncmp( Line, ErrorText, strlen(ErrorText)) == 0)
|
||||
{
|
||||
// it is an error
|
||||
numErrors++;
|
||||
havePost = 1;
|
||||
}
|
||||
if (strncmp( Line, WarningText, strlen(WarningText)) == 0)
|
||||
{
|
||||
// it is a warning
|
||||
|
||||
numWarnings++;
|
||||
havePost = 1;
|
||||
}
|
||||
if (havePost)
|
||||
{
|
||||
// have a line to parse
|
||||
if ((s = strchr(Line, ':')) != NULL)
|
||||
{
|
||||
s++;
|
||||
// located : following error number
|
||||
if (!strncmp( s, " line", 5 ))
|
||||
{
|
||||
// found the " line " text
|
||||
s+=5;
|
||||
while (*s == '.')
|
||||
{
|
||||
// get past any .'s
|
||||
s++;
|
||||
}
|
||||
if ((p = strstr(s, " of")) != NULL)
|
||||
{
|
||||
// found the " of" text, now s points to line number text
|
||||
*p = '\0';
|
||||
// convert to long
|
||||
lineno = atol( s );
|
||||
p+=4;
|
||||
s = strstr(p, " : ");
|
||||
*s = '\0';
|
||||
s+=2;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// error or warning, but no line and fname
|
||||
p = NULL; // set fname ptr to NULL
|
||||
lineno = 0; // line to 0
|
||||
}
|
||||
// OK, now lineno == line
|
||||
// p == filename
|
||||
// s == error
|
||||
M.message = s;
|
||||
M.filename = p;
|
||||
M.column = 1;
|
||||
M.line = (unsigned)lineno;
|
||||
IDE_PostMessage(CUR_MSG_GROUP, &M);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
FilterToIDE - Open the pipe output from the program, read and post each line
|
||||
to the IDE
|
||||
*/
|
||||
void FilterToIDE( void )
|
||||
{
|
||||
LPSTR line;
|
||||
|
||||
Pipefh = IDE_Open( PIPEID, READ_WRITE );
|
||||
if (Pipefh < 0)
|
||||
{
|
||||
char error[100];
|
||||
LoadString( globInst, IDS_CANNOTFILTER, error, sizeof(error));
|
||||
IDE_ErrorBox( error );
|
||||
return;
|
||||
}
|
||||
|
||||
InitBuffer();
|
||||
|
||||
while ((line = GetLine()) != NULL)
|
||||
{
|
||||
ProcessLine( line );
|
||||
}
|
||||
ReleaseBuffer();
|
||||
}
|
||||
|
||||
/*
|
||||
Run - exported entry point to the filter DLL
|
||||
|
||||
Input: pTransferBlock TransBlock contains information about the program to
|
||||
be run, its command line, and the IDE tool API
|
||||
*/
|
||||
int far pascal _export Run( pTransferBlock TransBlock )
|
||||
{
|
||||
// Store the IDE tool API
|
||||
memcpy( IDE_ToolAPI, TransBlock->IDE_ToolAPI, sizeof(IDE_ToolAPI) );
|
||||
|
||||
// Try to run program capturing output to an intermediate file
|
||||
IDE_CaptureToPipe( TransBlock->program,
|
||||
TransBlock->cmdline,
|
||||
PIPEID );
|
||||
|
||||
// post the captured output to the IDE
|
||||
FilterToIDE();
|
||||
|
||||
// return appropriate code for
|
||||
if (numFatals)
|
||||
{
|
||||
return toolFatalError;
|
||||
}
|
||||
if (numErrors)
|
||||
{
|
||||
return toolErrors;
|
||||
}
|
||||
if (numWarnings)
|
||||
{
|
||||
return toolWarnings;
|
||||
}
|
||||
return toolSuccess;
|
||||
}
|
||||
|
||||
#pragma argsused
|
||||
int far pascal LibMain( HINSTANCE hInstance, WORD wDataSegment,
|
||||
WORD wHeapSize, LPSTR lpszCmdLine )
|
||||
{
|
||||
globInst = hInstance;
|
||||
return 1;
|
||||
}
|
||||
|
||||
#pragma argsused
|
||||
int FAR PASCAL WEP ( int bSystemExit )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,307 @@
|
||||
/*
|
||||
Impl2Msg.C copyright (c) 1993 Borland International
|
||||
*/
|
||||
|
||||
#include "ToolApi.H"
|
||||
#include "filtrc.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <mem.h>
|
||||
#include <dos.h>
|
||||
#include <dir.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
// Name the intermediate "PIPE" through which output will be captured
|
||||
#define PIPEID "c:\\$$PIPE$$.TC$"
|
||||
|
||||
char NewFileText[] = "File ";
|
||||
|
||||
int WarnCount = 0;
|
||||
int ErrorCount = 0;
|
||||
int FatalCount = 0;
|
||||
|
||||
int posted = 0;
|
||||
|
||||
/* Declare an array of function pointers to store the IDE tool API */
|
||||
IDE_ToolAPIFunc IDE_ToolAPI[IDE_NumFunctions];
|
||||
|
||||
/* Global variables use to parse program output */
|
||||
HINSTANCE globInst;
|
||||
|
||||
FileHandle Pipefh;
|
||||
|
||||
HMEM hBuffer;
|
||||
LPSTR Buffer;
|
||||
WORD curpos;
|
||||
WORD bufLen;
|
||||
|
||||
char inLine[133];
|
||||
LPSTR lineptr;
|
||||
|
||||
/*
|
||||
InitBuffer - allocate memory for filtering the piped output to the IDE
|
||||
*/
|
||||
void InitBuffer( void )
|
||||
{
|
||||
hBuffer = IDE_memalloc( MEM_MOVEABLE, 8192 );
|
||||
Buffer = IDE_memlock( hBuffer );
|
||||
bufLen = 0;
|
||||
curpos = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
ReleaseBuffer - cleanup allocated buffers and open file handles
|
||||
*/
|
||||
void ReleaseBuffer( void )
|
||||
{
|
||||
/* cleanup allocated buffers */
|
||||
IDE_memunlock( hBuffer );
|
||||
IDE_memfree( hBuffer );
|
||||
IDE_Close( Pipefh );
|
||||
|
||||
/* delete the pipe */
|
||||
IDE_Delete( PIPEID );
|
||||
}
|
||||
|
||||
/*
|
||||
nextchar - returns the next character from the pipe input
|
||||
|
||||
returns: next character from the pipe associated with handle Pipefh
|
||||
*/
|
||||
char nextchar( void )
|
||||
{
|
||||
if (curpos < bufLen)
|
||||
{
|
||||
return Buffer[curpos++];
|
||||
}
|
||||
Buffer[0] = '\0';
|
||||
bufLen = IDE_Read( Pipefh, Buffer, 7000 );
|
||||
if (bufLen == 0)
|
||||
return 0;
|
||||
curpos = 0;
|
||||
return nextchar();
|
||||
}
|
||||
|
||||
/*
|
||||
GetLine - get the next line of text from the pipe
|
||||
|
||||
returns: far pointer to string containing next line of text from the current opened
|
||||
pipe file
|
||||
*/
|
||||
LPSTR GetLine( void )
|
||||
{
|
||||
char ch;
|
||||
int count;
|
||||
|
||||
lineptr = inLine;
|
||||
count = 0;
|
||||
while (((ch = nextchar()) != '\x0D') && (ch != '\x0A') && (ch != 0) && (count<133))
|
||||
{
|
||||
*lineptr = ch;
|
||||
lineptr++;
|
||||
count++;
|
||||
}
|
||||
if (count == 133)
|
||||
{
|
||||
strcpy( &inLine[125], "......" );
|
||||
}
|
||||
if ((lineptr == inLine) && (ch == 0))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
*lineptr = '\0';
|
||||
return inLine;
|
||||
}
|
||||
|
||||
/*
|
||||
ProcessLine - dissect line of input and post it as a message to the IDE
|
||||
|
||||
Input: LPSTR line the line to dissect and post
|
||||
*/
|
||||
char CurFile[MAXPATH];
|
||||
|
||||
void ProcessLine( LPSTR Line )
|
||||
{
|
||||
static int HavePutFile = FALSE;
|
||||
unsigned HasFileAndLineNumber = FALSE;
|
||||
char *s;
|
||||
unsigned i;
|
||||
Msg M;
|
||||
|
||||
if (Line[0] == '\0') /* ignore blank line */
|
||||
return;
|
||||
|
||||
if (Line[0] == '\x0A')
|
||||
return;
|
||||
|
||||
if( strncmp( Line, "Warning", 7 ) == 0 )
|
||||
{ /* we have a warning line */
|
||||
Line += 7; /* flush "Warning" */
|
||||
if( *Line != ':' ) /* ':' doesn't follow */
|
||||
HasFileAndLineNumber = TRUE; /* so file, line present */
|
||||
|
||||
WarnCount++;
|
||||
}
|
||||
else if( strncmp( Line, "Error", 5 ) == 0 )
|
||||
{ /* we have an error line */
|
||||
Line += 5; /* flush "Error" */
|
||||
if( *Line != ':' ) /* ':' doesn't follow */
|
||||
HasFileAndLineNumber = TRUE; /* so file, line present */
|
||||
|
||||
ErrorCount++;
|
||||
}
|
||||
else if( strncmp( Line, "Fatal error", 11 ) == 0 )
|
||||
{ /* we have a fatal line */
|
||||
Line += 11; /* just post */
|
||||
M.message = Line;
|
||||
M.filename = NULL;
|
||||
M.column = 1;
|
||||
M.line = 1;
|
||||
IDE_PostMessage( CUR_MSG_GROUP, &M );
|
||||
FatalCount++;
|
||||
return;
|
||||
}
|
||||
else /* not an error line */
|
||||
return;
|
||||
|
||||
if( HasFileAndLineNumber )
|
||||
{ /* need to process them */
|
||||
while( *Line == ' ' ) /* flush white-space until */
|
||||
Line++; /* Line points to the filename */
|
||||
|
||||
s = Line;
|
||||
while( *s != ' ' ) /* s points to space after */
|
||||
s++; /* filename */
|
||||
*s = '\0'; /* Replace space with null */
|
||||
|
||||
if (strcmp(Line,CurFile) != 0) /* if new filename */
|
||||
{
|
||||
strcpy(CurFile,Line);
|
||||
HavePutFile = TRUE;
|
||||
}
|
||||
|
||||
s++; /* flush white space until */
|
||||
while( *s == ' ' ) /* s points to line number */
|
||||
s++;
|
||||
Line = s; /* Line points to line number too */
|
||||
while( *s != ':' ) /* position s at ':' after */
|
||||
s++; /* line number */
|
||||
*s = '\0'; /* replace ':' with null */
|
||||
i = atoi(Line); /* convert line number to int */
|
||||
|
||||
s++; /* bump past null */
|
||||
while( *s == ' ' ) /* flush white space until */
|
||||
s++; /* s points to message */
|
||||
|
||||
M.message = s;
|
||||
M.filename = CurFile;
|
||||
M.column = 1;
|
||||
M.line = i;
|
||||
IDE_PostMessage( CUR_MSG_GROUP, &M );
|
||||
posted++;
|
||||
}
|
||||
else /* no file or line number */
|
||||
{
|
||||
Line++; /* position Line past ':' */
|
||||
while( *Line == ' ' ) /* and at start of message */
|
||||
Line++;
|
||||
|
||||
if( !HavePutFile )
|
||||
{
|
||||
/* IDE expects the first message to
|
||||
be preceded by a filename. Since
|
||||
we don't have one, fake it by
|
||||
sending a NULL file before the
|
||||
message.
|
||||
*/
|
||||
CurFile[0] = '\0';
|
||||
}
|
||||
|
||||
M.message = Line;
|
||||
M.filename = CurFile;
|
||||
M.column = 1;
|
||||
M.line = 1;
|
||||
IDE_PostMessage( CUR_MSG_GROUP, &M );
|
||||
posted++;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
FilterToIDE - Open the pipe output from the program, read and post each line
|
||||
to the IDE
|
||||
*/
|
||||
void FilterToIDE( void )
|
||||
{
|
||||
LPSTR line;
|
||||
|
||||
Pipefh = IDE_Open( PIPEID, READ_WRITE );
|
||||
if (Pipefh < 0)
|
||||
{
|
||||
char error[100];
|
||||
LoadString( globInst, IDS_CANNOTFILTER, error, sizeof(error));
|
||||
IDE_ErrorBox( error );
|
||||
return;
|
||||
}
|
||||
|
||||
InitBuffer();
|
||||
|
||||
while ((line = GetLine()) != NULL)
|
||||
{
|
||||
ProcessLine( line );
|
||||
}
|
||||
|
||||
ReleaseBuffer();
|
||||
}
|
||||
|
||||
/*
|
||||
Run - exported entry point to the filter DLL
|
||||
|
||||
Input: pTransferBlock TransBlock contains information about the program to
|
||||
be run, its command line, and the IDE tool API
|
||||
*/
|
||||
int far pascal _export Run( pTransferBlock TransBlock )
|
||||
{
|
||||
// Store the IDE tool API
|
||||
memcpy( IDE_ToolAPI, TransBlock->IDE_ToolAPI, sizeof(IDE_ToolAPI) );
|
||||
|
||||
// Try to run program capturing output to an intermediate file
|
||||
IDE_CaptureToPipe( TransBlock->program,
|
||||
TransBlock->cmdline,
|
||||
PIPEID );
|
||||
|
||||
// post the captured output to the IDE
|
||||
FilterToIDE();
|
||||
|
||||
// return appropriate code for
|
||||
if (FatalCount)
|
||||
{
|
||||
return toolFatalError;
|
||||
}
|
||||
if (ErrorCount)
|
||||
{
|
||||
return toolErrors;
|
||||
}
|
||||
if (WarnCount)
|
||||
{
|
||||
return toolWarnings;
|
||||
}
|
||||
return toolSuccess;
|
||||
}
|
||||
|
||||
#pragma argsused
|
||||
int far pascal LibMain( HINSTANCE hInstance, WORD wDataSegment,
|
||||
WORD wHeapSize, LPSTR lpszCmdLine )
|
||||
{
|
||||
globInst = hInstance;
|
||||
return 1;
|
||||
}
|
||||
|
||||
#if 0
|
||||
#pragma argsused
|
||||
int FAR PASCAL WEP ( int bSystemExit )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
Binary file not shown.
@@ -0,0 +1,285 @@
|
||||
/*
|
||||
ovct2Msg.C copyright (c) 1992 Borland International
|
||||
*/
|
||||
|
||||
#include "StdTypes.H"
|
||||
#include "TranType.H"
|
||||
#include "ToolApi.H"
|
||||
#include "filtrc.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <mem.h>
|
||||
#include <dos.h>
|
||||
#include <dir.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
// Name the intermediate "PIPE" through which output will be captured
|
||||
#define PIPEID "c:\\$$PIPE$$.TC$"
|
||||
|
||||
int posted = 0;
|
||||
|
||||
/* Declare an array of function pointers to store the IDE tool API */
|
||||
IDE_ToolAPIFunc IDE_ToolAPI[IDE_NumFunctions];
|
||||
|
||||
/* Global variables use to parse program output */
|
||||
HINSTANCE globInst;
|
||||
|
||||
FileHandle Pipefh;
|
||||
|
||||
HMEM hBuffer;
|
||||
LPSTR Buffer;
|
||||
WORD curpos;
|
||||
WORD bufLen;
|
||||
|
||||
char inLine[133];
|
||||
LPSTR lineptr;
|
||||
|
||||
/*
|
||||
InitBuffer - allocate memory for filtering the piped output from ovct to the IDE
|
||||
*/
|
||||
void InitBuffer( void )
|
||||
{
|
||||
hBuffer = IDE_memalloc( MEM_MOVEABLE, 8192 );
|
||||
Buffer = IDE_memlock( hBuffer );
|
||||
bufLen = 0;
|
||||
curpos = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
ReleaseBuffer - cleanup allocated buffers and open file handles
|
||||
*/
|
||||
void ReleaseBuffer( void )
|
||||
{
|
||||
/* cleanup allocated buffers */
|
||||
IDE_memunlock( hBuffer );
|
||||
IDE_memfree( hBuffer );
|
||||
IDE_Close( Pipefh );
|
||||
|
||||
/* delete the pipe */
|
||||
IDE_Delete( PIPEID );
|
||||
}
|
||||
|
||||
/*
|
||||
nextchar - returns the next character from the pipe input
|
||||
|
||||
returns: next character from the pipe associated with handle Pipefh
|
||||
*/
|
||||
char nextchar( void )
|
||||
{
|
||||
if (curpos < bufLen)
|
||||
{
|
||||
return Buffer[curpos++];
|
||||
}
|
||||
Buffer[0] = '\0';
|
||||
bufLen = IDE_Read( Pipefh, Buffer, 7000 );
|
||||
if (bufLen == 0)
|
||||
return 0;
|
||||
curpos = 0;
|
||||
return nextchar();
|
||||
}
|
||||
|
||||
/*
|
||||
GetLine - get the next line of text from the pipe
|
||||
|
||||
returns: far pointer to string containing next line of text from the current opened
|
||||
pipe file
|
||||
*/
|
||||
LPSTR GetLine( void )
|
||||
{
|
||||
char ch;
|
||||
int count;
|
||||
|
||||
lineptr = inLine;
|
||||
count = 0;
|
||||
while (((ch = nextchar()) != '\x0D') && (ch != '\x0A') && (ch != 0) && (count<133))
|
||||
{
|
||||
*lineptr = ch;
|
||||
lineptr++;
|
||||
count++;
|
||||
}
|
||||
if (count == 133)
|
||||
{
|
||||
strcpy( &inLine[129], "......" );
|
||||
}
|
||||
if ((lineptr == inLine) && (ch == 0))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
*lineptr = '\0';
|
||||
return inLine;
|
||||
}
|
||||
|
||||
/*
|
||||
ProcessLine - dissect line of input and post it as a message to the IDE
|
||||
|
||||
Input: LPSTR line the line to dissect and post
|
||||
*/
|
||||
char CurFile[MAXPATH];
|
||||
|
||||
void ProcessLine( LPSTR Line )
|
||||
{
|
||||
unsigned i;
|
||||
char *s, *file, *lineno;
|
||||
|
||||
Msg M;
|
||||
|
||||
/* if blank line, return */
|
||||
while( *Line && ( (*Line == '\r') || (*Line == '\n') ) )\
|
||||
{
|
||||
Line++;
|
||||
}
|
||||
|
||||
if( *Line == '\0' )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// If line begins with Error or Warning or Fatal we want it
|
||||
if (!strncmp( Line, "Error", 5 ) ||
|
||||
!strncmp( Line, "Fatal", 5 ) ||
|
||||
!strncmp( Line, "Warning", 7 ))
|
||||
{
|
||||
// get by the beginning
|
||||
s = Line;
|
||||
while ((*s != '\0') &&
|
||||
(*s != ' '))
|
||||
{
|
||||
s++;
|
||||
}
|
||||
if (!*s)
|
||||
{
|
||||
return; // no file name
|
||||
}
|
||||
s++;
|
||||
// should be pointing at a filename
|
||||
file = s;
|
||||
|
||||
// get to next space
|
||||
while ((*s != '\0') &&
|
||||
(*s != ' '))
|
||||
{
|
||||
s++;
|
||||
}
|
||||
if (*s==' ')
|
||||
{
|
||||
// found end of name
|
||||
*s = '\0'; // delimit filename
|
||||
s++;
|
||||
|
||||
// should be line number
|
||||
lineno = s;
|
||||
|
||||
// find end of number
|
||||
while ((*s != '\0') &&
|
||||
(*s != ':'))
|
||||
{
|
||||
s++;
|
||||
}
|
||||
if (*s == ':')
|
||||
{
|
||||
// found end of number
|
||||
*s='\0'; // delimit line number
|
||||
s++;
|
||||
// set the line number
|
||||
i = atoi( lineno );
|
||||
}
|
||||
else
|
||||
{
|
||||
// didn't find a number, send 0
|
||||
i=0;
|
||||
}
|
||||
}
|
||||
|
||||
// whatever is left must be the error
|
||||
M.message = s;
|
||||
M.filename = file;
|
||||
M.column = 1;
|
||||
M.line = i;
|
||||
|
||||
IDE_PostMessage( CUR_MSG_GROUP, &M );
|
||||
posted++;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
FilterToIDE - Open the pipe output from the program, read and post each line
|
||||
to the IDE
|
||||
*/
|
||||
void FilterToIDE( void )
|
||||
{
|
||||
LPSTR line;
|
||||
|
||||
Pipefh = IDE_Open( PIPEID, READ_WRITE );
|
||||
if (Pipefh < 0)
|
||||
{
|
||||
char error[100];
|
||||
LoadString( globInst, IDS_CANNOTFILTER, error, sizeof(error));
|
||||
IDE_ErrorBox( error );
|
||||
return;
|
||||
}
|
||||
|
||||
InitBuffer();
|
||||
|
||||
while ((line = GetLine()) != NULL)
|
||||
{
|
||||
ProcessLine( line );
|
||||
}
|
||||
|
||||
ReleaseBuffer();
|
||||
}
|
||||
|
||||
/*
|
||||
CheckVersion - Check IDE version
|
||||
*/
|
||||
BOOL CheckVersion( void )
|
||||
{
|
||||
// If the DLL is specific to a particular version of the IDE
|
||||
// or if it only works for DOS platform or Windows Platform
|
||||
// this is the place to check.
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
Run - exported entry point to the filter DLL
|
||||
|
||||
Input: pTransferBlock TransBlock contains information about the program to
|
||||
be run, its command line, and the IDE tool API
|
||||
*/
|
||||
int far pascal _export Run( pTransferBlock TransBlock )
|
||||
{
|
||||
// Store the IDE tool API
|
||||
memcpy( IDE_ToolAPI, TransBlock->IDE_ToolAPI, sizeof(IDE_ToolAPI) );
|
||||
|
||||
if (!CheckVersion())
|
||||
{
|
||||
return NO_TASK;
|
||||
}
|
||||
|
||||
// Try to run ovct.COM capturing output to an intermediate file
|
||||
IDE_CaptureToPipe( TransBlock->program,
|
||||
TransBlock->cmdline,
|
||||
PIPEID );
|
||||
|
||||
// post the captured output to the IDE
|
||||
FilterToIDE();
|
||||
|
||||
return posted;
|
||||
}
|
||||
|
||||
#pragma argsused
|
||||
int far pascal LibMain( HINSTANCE hInstance, WORD wDataSegment,
|
||||
WORD wHeapSize, LPSTR lpszCmdLine )
|
||||
{
|
||||
globInst = hInstance;
|
||||
return 1;
|
||||
}
|
||||
|
||||
#pragma argsused
|
||||
int FAR PASCAL WEP ( int bSystemExit )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,273 @@
|
||||
/*
|
||||
rc2Msg.C copyright (c) 1993 Borland International
|
||||
*/
|
||||
|
||||
#include "ToolApi.H"
|
||||
#include "filtrc.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <mem.h>
|
||||
#include <dos.h>
|
||||
#include <dir.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
// Name the intermediate "PIPE" through which output will be captured
|
||||
#define PIPEID "c:\\$$PIPE$$.TC$"
|
||||
|
||||
int posted = 0;
|
||||
|
||||
/* Declare an array of function pointers to store the IDE tool API */
|
||||
IDE_ToolAPIFunc IDE_ToolAPI[IDE_NumFunctions];
|
||||
|
||||
/* Global variables use to parse program output */
|
||||
HINSTANCE globInst;
|
||||
|
||||
FileHandle Pipefh;
|
||||
|
||||
HMEM hBuffer;
|
||||
LPSTR Buffer;
|
||||
WORD curpos;
|
||||
WORD bufLen;
|
||||
|
||||
char inLine[133];
|
||||
LPSTR lineptr;
|
||||
|
||||
/*
|
||||
InitBuffer - allocate memory for filtering the piped output to the IDE
|
||||
*/
|
||||
void InitBuffer( void )
|
||||
{
|
||||
hBuffer = IDE_memalloc( MEM_MOVEABLE, 8192 );
|
||||
Buffer = IDE_memlock( hBuffer );
|
||||
bufLen = 0;
|
||||
curpos = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
ReleaseBuffer - cleanup allocated buffers and open file handles
|
||||
*/
|
||||
void ReleaseBuffer( void )
|
||||
{
|
||||
/* cleanup allocated buffers */
|
||||
IDE_memunlock( hBuffer );
|
||||
IDE_memfree( hBuffer );
|
||||
IDE_Close( Pipefh );
|
||||
|
||||
/* delete the pipe */
|
||||
IDE_Delete( PIPEID );
|
||||
}
|
||||
|
||||
/*
|
||||
nextchar - returns the next character from the pipe input
|
||||
|
||||
returns: next character from the pipe associated with handle Pipefh
|
||||
*/
|
||||
char nextchar( void )
|
||||
{
|
||||
if (curpos < bufLen)
|
||||
{
|
||||
return Buffer[curpos++];
|
||||
}
|
||||
Buffer[0] = '\0';
|
||||
bufLen = IDE_Read( Pipefh, Buffer, 7000 );
|
||||
if (bufLen == 0)
|
||||
return 0;
|
||||
curpos = 0;
|
||||
return nextchar();
|
||||
}
|
||||
|
||||
/*
|
||||
GetLine - get the next line of text from the pipe
|
||||
|
||||
returns: far pointer to string containing next line of text from the current opened
|
||||
pipe file
|
||||
*/
|
||||
LPSTR GetLine( void )
|
||||
{
|
||||
char ch;
|
||||
int count;
|
||||
|
||||
lineptr = inLine;
|
||||
count = 0;
|
||||
while (((ch = nextchar()) != '\x0D') && (ch != '\x0A') && (ch != 0) && (count<133))
|
||||
{
|
||||
*lineptr = ch;
|
||||
lineptr++;
|
||||
count++;
|
||||
}
|
||||
if (count == 133)
|
||||
{
|
||||
strcpy( &inLine[125], "......" );
|
||||
}
|
||||
if ((lineptr == inLine) && (ch == 0))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
*lineptr = '\0';
|
||||
return inLine;
|
||||
}
|
||||
|
||||
/*
|
||||
ProcessLine - dissect line of input and post it as a message to the IDE
|
||||
|
||||
Input: LPSTR line the line to dissect and post
|
||||
*/
|
||||
char CurFile[MAXPATH];
|
||||
|
||||
void ProcessLine( LPSTR Line )
|
||||
{
|
||||
static int HavePutFile = FALSE;
|
||||
int HasLineNumber;
|
||||
// char Type;
|
||||
unsigned i;
|
||||
char *s, *LeftParen, *Colon;
|
||||
Msg M;
|
||||
|
||||
/* if blank line, return */
|
||||
while( *Line && ( (*Line == '\r') || (*Line == '\n') ) )
|
||||
Line++;
|
||||
if( *Line == '\0' )
|
||||
return;
|
||||
|
||||
/* if line starts with "Microsoft" or "Copyright", it's not
|
||||
an error line */
|
||||
|
||||
/* also include "RLINK32" */
|
||||
|
||||
if( strncmp( Line, "Microsoft", 9 ) == 0 ||
|
||||
strncmp( Line, "Copyright", 9 ) == 0 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
HasLineNumber = FALSE;
|
||||
LeftParen = strchr( Line, '(' ); /* if '(' in the line */
|
||||
if( LeftParen != NULL ) /* Line may contain line number */
|
||||
HasLineNumber = TRUE;
|
||||
|
||||
if( HasLineNumber ) {
|
||||
Colon = strchr(LeftParen, ':' ); /* if no ':' following the '(' */
|
||||
if( Colon == NULL ) /* Line doesn't contain line number */
|
||||
HasLineNumber = FALSE;
|
||||
}
|
||||
|
||||
if( HasLineNumber ) {
|
||||
s = LeftParen-1; /* position s after last char */
|
||||
while( *s == ' ' ) /* in filename */
|
||||
s--;
|
||||
s++;
|
||||
*s = 0; /* and null-terminate */
|
||||
|
||||
if( strcmp(Line,CurFile) != 0 ) /* if new filename */
|
||||
{
|
||||
strcpy(CurFile,Line);
|
||||
HavePutFile = TRUE;
|
||||
}
|
||||
|
||||
s = strchr(LeftParen+1,')'); /* find the right paren */
|
||||
*s = 0; /* and null-terminate line# */
|
||||
i = atoi(LeftParen+1); /* line# starts after ( */
|
||||
/* convert line# to integer */
|
||||
|
||||
s = Colon+1; /* position s at first */
|
||||
while( *s == ' ' ) /* non-blank char after : */
|
||||
s++; /* Rest of line is message */
|
||||
|
||||
M.message = s;
|
||||
M.filename = CurFile;
|
||||
M.column = 1;
|
||||
M.line = i;
|
||||
|
||||
IDE_PostMessage( CUR_MSG_GROUP, &M );
|
||||
posted++;
|
||||
}
|
||||
else { /* no line number */
|
||||
if( !HavePutFile )
|
||||
{
|
||||
/* IDE expects the first message to
|
||||
be preceded by a filename. Since
|
||||
we don't have one, fake it by
|
||||
sending a NULL file before the
|
||||
message.
|
||||
*/
|
||||
CurFile[0] = '\0';
|
||||
HavePutFile = TRUE;
|
||||
}
|
||||
|
||||
M.message = Line;
|
||||
M.filename = CurFile;
|
||||
M.column = 1;
|
||||
M.line = 1;
|
||||
|
||||
IDE_PostMessage( CUR_MSG_GROUP, &M );
|
||||
posted++;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
FilterToIDE - Open the pipe output from the program, read and post each line
|
||||
to the IDE
|
||||
*/
|
||||
void FilterToIDE( void )
|
||||
{
|
||||
LPSTR line;
|
||||
|
||||
Pipefh = IDE_Open( PIPEID, READ_WRITE );
|
||||
if (Pipefh < 0)
|
||||
{
|
||||
char error[100];
|
||||
LoadString( globInst, IDS_CANNOTFILTER, error, sizeof(error));
|
||||
IDE_ErrorBox( error );
|
||||
return;
|
||||
}
|
||||
|
||||
InitBuffer();
|
||||
|
||||
while ((line = GetLine()) != NULL)
|
||||
{
|
||||
ProcessLine( line );
|
||||
}
|
||||
|
||||
ReleaseBuffer();
|
||||
}
|
||||
|
||||
/*
|
||||
Run - exported entry point to the filter DLL
|
||||
|
||||
Input: pTransferBlock TransBlock contains information about the program to
|
||||
be run, its command line, and the IDE tool API
|
||||
*/
|
||||
int far pascal _export Run( pTransferBlock TransBlock )
|
||||
{
|
||||
// Store the IDE tool API
|
||||
memcpy( IDE_ToolAPI, TransBlock->IDE_ToolAPI, sizeof(IDE_ToolAPI) );
|
||||
|
||||
// Try to run program capturing output to an intermediate file
|
||||
IDE_CaptureToPipe( TransBlock->program,
|
||||
TransBlock->cmdline,
|
||||
PIPEID );
|
||||
|
||||
// post the captured output to the IDE
|
||||
FilterToIDE();
|
||||
|
||||
return posted;
|
||||
}
|
||||
|
||||
#pragma argsused
|
||||
int far pascal LibMain( HINSTANCE hInstance, WORD wDataSegment,
|
||||
WORD wHeapSize, LPSTR lpszCmdLine )
|
||||
{
|
||||
globInst = hInstance;
|
||||
return 1;
|
||||
}
|
||||
|
||||
#pragma argsused
|
||||
int FAR PASCAL WEP ( int bSystemExit )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,439 @@
|
||||
/*
|
||||
Tasm2Msg.C copyright (c) 1993 Borland International
|
||||
*/
|
||||
|
||||
#include "ToolApi.H" // Borland IDE tool dll interface
|
||||
#include "filtrc.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#include <mem.h>
|
||||
#include <dos.h>
|
||||
#include <dir.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
// Name the intermediate "PIPE" through which output will be captured
|
||||
#define PIPEID "C:\\$$PIPE$$.TC$"
|
||||
|
||||
/* Declare an array of function pointers to store the IDE tool API */
|
||||
IDE_ToolAPIFunc IDE_ToolAPI[IDE_NumFunctions];
|
||||
|
||||
/* Global variables use to parse program output */
|
||||
HINSTANCE globInst;
|
||||
|
||||
/* Turbo Assembler text for conversion */
|
||||
char TasmWarningTxt[] = "*Warning* ";
|
||||
char TasmErrorTxt[] = "**Error** ";
|
||||
char TasmFatalTxt[] = "**Fatal** ";
|
||||
|
||||
/* Microsoft Assembler and OPTASM text for conversion */
|
||||
char MasmWarningText[] = "warning";
|
||||
char MasmErrorText[] = "error";
|
||||
|
||||
char CurFile[MAXPATH]; /* Current file in message window */
|
||||
|
||||
FileHandle Pipefh;
|
||||
|
||||
HMEM hBuffer;
|
||||
LPSTR Buffer;
|
||||
WORD curpos;
|
||||
WORD bufLen;
|
||||
|
||||
char inLine[133];
|
||||
LPSTR lineptr;
|
||||
|
||||
int (*processor)(char *); /* function pointer used to call the
|
||||
appropriate conversion routine */
|
||||
|
||||
int numFatals = 0;
|
||||
int numErrors = 0;
|
||||
int numWarnings = 0;
|
||||
|
||||
/*
|
||||
InitBuffer - allocate memory for filtering the piped output to the IDE
|
||||
*/
|
||||
void InitBuffer( void )
|
||||
{
|
||||
hBuffer = IDE_memalloc( MEM_MOVEABLE, 8192 );
|
||||
Buffer = IDE_memlock( hBuffer );
|
||||
bufLen = 0;
|
||||
curpos = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
ReleaseBuffer - cleanup allocated buffers and open file handles
|
||||
*/
|
||||
void ReleaseBuffer( void )
|
||||
{
|
||||
IDE_memunlock( hBuffer );
|
||||
IDE_memfree( hBuffer );
|
||||
IDE_Close( Pipefh );
|
||||
IDE_Delete( PIPEID );
|
||||
}
|
||||
|
||||
/*
|
||||
nextchar - returns the next character from the pipe input
|
||||
|
||||
returns: next character from the pipe associated with handle Pipefh
|
||||
*/
|
||||
char nextchar( void )
|
||||
{
|
||||
if (curpos < bufLen)
|
||||
{
|
||||
return Buffer[curpos++];
|
||||
}
|
||||
Buffer[0] = '\0';
|
||||
bufLen = IDE_Read( Pipefh, Buffer, 7000 );
|
||||
if (bufLen == 0)
|
||||
return 0;
|
||||
curpos = 0;
|
||||
return nextchar();
|
||||
}
|
||||
|
||||
/*
|
||||
GetLine - get the next line of text from the pipe
|
||||
|
||||
returns: far pointer to string containing next line of text from the current opened
|
||||
pipe file
|
||||
*/
|
||||
LPSTR GetLine( void )
|
||||
{
|
||||
char ch;
|
||||
int count;
|
||||
|
||||
lineptr = inLine;
|
||||
count = 0;
|
||||
while (((ch = nextchar()) != '\x0D') && (ch != '\x0A') && (ch != 0) && (count<133))
|
||||
{
|
||||
*lineptr = ch;
|
||||
lineptr++;
|
||||
count++;
|
||||
}
|
||||
if (count == 133)
|
||||
{
|
||||
strcpy( &inLine[125], "......" );
|
||||
}
|
||||
if ((lineptr == inLine) && (ch == 0))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
*lineptr = '\0';
|
||||
return inLine;
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
Function : ProcessNonTasmLine
|
||||
Parameters: Line a pointer to the current line of characters to process
|
||||
Returns : 1 if line is Microsoft Assembler line
|
||||
0 if line is not
|
||||
|
||||
Analyze line to determine if it is output from a MASM or OPTASM compatible
|
||||
assembler. In the case of a recognizable line, output relevant information
|
||||
to the message window indicating message and line number.
|
||||
-*----------------------------------------------------------------------*-
|
||||
Microsoft assembler lines which are in need of conversion are of the form:
|
||||
|
||||
source-file(LINE #): message-kind message-num : message text
|
||||
|
||||
where message-kind is one of: warning, error
|
||||
-*----------------------------------------------------------------------*-
|
||||
OPTASM assembler lines which are in need of conversion are of the form:
|
||||
|
||||
source-file(LINE #) : message-kind message-num : message text
|
||||
|
||||
where message-kind is one of: Warning, Error
|
||||
-*----------------------------------------------------------------------*-
|
||||
Masm and Optasm lines differ from Tasm lines in that half the line must be
|
||||
scanned in order to determine if the line is valid. For this reason all
|
||||
output information is stored and sent at the end when the determination of
|
||||
a valid line is made.
|
||||
************************************************************************/
|
||||
int ProcessNonTasmLine(char *Line)
|
||||
{
|
||||
unsigned i;
|
||||
char *s;
|
||||
char fn[MAXPATH];
|
||||
Msg M;
|
||||
|
||||
if (Line[0] == 0) /* Empty line, no action */
|
||||
return 0;
|
||||
|
||||
s = strchr(Line,'('); /* find ( */
|
||||
if (s != NULL) /* if no (, invalid line */
|
||||
{
|
||||
memmove(fn,Line,(unsigned)(s-Line)); /* store filename */
|
||||
fn[(unsigned)(s-Line)] = 0; /* null terminate name */
|
||||
memmove(Line,++s,strlen(Line)); /* shift line left */
|
||||
if (strcmp(fn,CurFile) != 0) /* if new filename */
|
||||
{
|
||||
strcpy(CurFile,fn); /* store new name */
|
||||
}
|
||||
s = strchr(Line,')'); /* find the close paren */
|
||||
if (s != NULL) /* if no ) invalid line */
|
||||
{
|
||||
*s = 0; /* isolate the line number */
|
||||
i = atoi(Line); /* if number is found convert
|
||||
string to integer */
|
||||
if (i != 0)
|
||||
{
|
||||
s++;
|
||||
while (*s == ' ') /* optasm has space here */
|
||||
s++;
|
||||
if (*s != ':') /* strip : from line */
|
||||
return 0; /* no :, not MASM line */
|
||||
s++;
|
||||
memmove(Line,s,strlen(s)+1); /* shift line */
|
||||
while (Line[0] == ' ' && Line[0] != 0) /* strip spaces from line */
|
||||
memmove(Line,&Line[1],strlen(Line));
|
||||
Line[0] = tolower(Line[0]); /* optasm uses upper case */
|
||||
/* check for warning or error text from MASM, shift line if
|
||||
needed. */
|
||||
if (strncmp(Line, MasmWarningText, strlen(MasmWarningText)) != 0)
|
||||
{
|
||||
if (strncmp(Line, MasmErrorText, strlen(MasmErrorText)) != 0)
|
||||
{
|
||||
return 0; /* not error or warning, not MASM line */
|
||||
}
|
||||
else
|
||||
{
|
||||
numErrors++; // increase number of numErrors posted
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
numWarnings++;
|
||||
}
|
||||
|
||||
/* strip spaces from beginning of line */
|
||||
while (Line[0] == ' ' && Line[0] != 0) /* strip spaces from line */
|
||||
memmove(Line,&Line[1],strlen(Line));
|
||||
}
|
||||
else return 0; /* no line number, not MASM line */
|
||||
}
|
||||
else return 0; /* no ), not MASM line */
|
||||
|
||||
M.message = Line;
|
||||
M.filename = CurFile;
|
||||
M.column = 1;
|
||||
M.line = i;
|
||||
|
||||
IDE_PostMessage( CUR_MSG_GROUP, &M );
|
||||
}
|
||||
else return 0; /* no ( on line, not MASM line */
|
||||
|
||||
return 1; /* MASM line */
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Function : ProcessTasmLine
|
||||
Parameters: Line a pointer to the current line of characters to process
|
||||
Returns : 1 if line is a Turbo Assembler line
|
||||
0 if line is not
|
||||
|
||||
Process through a line of input to determine if it is a Turbo Assembler
|
||||
output line and convert it to information for the Turbo C++ message window.
|
||||
|
||||
Turbo Assembler lines which are in need of conversion are of the form:
|
||||
|
||||
message-type source-file(LINE #) message-text
|
||||
|
||||
where type is one of: *Warning*, **Error**, **Fatal**
|
||||
|
||||
TASM lines are identified by the first portion of text. If warning,
|
||||
error or fatal is determined at the outset, text is output from there
|
||||
as it is scanned. Any incorrect configuration will simply abort the
|
||||
scanning of the rest of the line.
|
||||
*************************************************************************/
|
||||
int ProcessTasmLine(char *Line)
|
||||
{
|
||||
unsigned i;
|
||||
char *s;
|
||||
char fn[MAXPATH];
|
||||
Msg M;
|
||||
int lineHasErrorText = FALSE;
|
||||
|
||||
/* don't try to process a NULL line */
|
||||
if (Line[0] == 0)
|
||||
return 0;
|
||||
|
||||
/* check for tasm type tags */
|
||||
if (strncmp(Line,TasmFatalTxt, strlen(TasmFatalTxt)) == 0)
|
||||
{
|
||||
lineHasErrorText = TRUE;
|
||||
numFatals++;
|
||||
}
|
||||
|
||||
if (strncmp(Line,TasmErrorTxt, strlen(TasmErrorTxt)) == 0)
|
||||
{
|
||||
lineHasErrorText = TRUE;
|
||||
numErrors++;
|
||||
}
|
||||
|
||||
if (strncmp(Line,TasmWarningTxt,strlen(TasmWarningTxt)) == 0)
|
||||
{
|
||||
numWarnings++;
|
||||
lineHasErrorText = TRUE;
|
||||
}
|
||||
|
||||
if ( lineHasErrorText )
|
||||
{
|
||||
/* set fn to something */
|
||||
fn[0] = '\0';
|
||||
|
||||
/* skip over type by moving string left */
|
||||
memmove(Line,&Line[strlen(TasmFatalTxt)],strlen(Line));
|
||||
|
||||
/* locate the first open paren '(' filename will be characters to
|
||||
to the left, line number will be characters to the right up to the
|
||||
close paren ')' */
|
||||
s = strchr(Line,'('); /* find ( */
|
||||
if (s != NULL) /* if no (, invalid line */
|
||||
{
|
||||
memmove(fn,Line,(unsigned)(s-Line)); /* save filename */
|
||||
fn[(unsigned)(s-Line)] = 0; /* null terminate name */
|
||||
memmove(Line,++s,strlen(Line)); /* shift line left */
|
||||
if (strcmp(fn,CurFile) != 0) /* if new filename */
|
||||
{
|
||||
strcpy(CurFile,fn);
|
||||
}
|
||||
s = strchr(Line,')'); /* find the close paren */
|
||||
if (s != NULL)
|
||||
{
|
||||
*s = 0; /* isolate number in string */
|
||||
i = atoi(Line); /* if number is found convert
|
||||
string to integer */
|
||||
if (i != 0)
|
||||
{
|
||||
s++;
|
||||
memmove(Line,s,strlen(s)+1); /* shift line */
|
||||
while (Line[0] == ' ' && Line[0] != 0) /* strip spaces from line */
|
||||
memmove(Line,&Line[1],strlen(Line));
|
||||
M.message = Line;
|
||||
M.filename = CurFile;
|
||||
M.column = 1;
|
||||
M.line = i;
|
||||
|
||||
IDE_PostMessage( CUR_MSG_GROUP, &M );
|
||||
return 1; /* TASM line */
|
||||
}
|
||||
return 0; /* invalid line number, not TASM line */
|
||||
}
|
||||
return 0; /* no ) in line, not TASM line */
|
||||
}
|
||||
else /* Fatal error, no line # or filename */
|
||||
{
|
||||
CurFile[0] = '\0';
|
||||
while (Line[0] == ' ' && Line[0] != 0)
|
||||
memmove(Line,&Line[1],strlen(Line));
|
||||
M.message = Line;
|
||||
M.filename = CurFile;
|
||||
M.column = 1;
|
||||
M.line = 1;
|
||||
|
||||
IDE_PostMessage( CUR_MSG_GROUP, &M );
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else return 0; /* no line start message, not TASM line */
|
||||
}
|
||||
|
||||
/*
|
||||
ProcessLine - dissect line of input and post it as a message to the IDE
|
||||
|
||||
Input: LPSTR line the line to dissect and post
|
||||
*/
|
||||
void ProcessLine( LPSTR Line )
|
||||
{
|
||||
if (processor == NULL)
|
||||
{
|
||||
if (ProcessTasmLine(Line)) /* check for TASM line */
|
||||
processor = ProcessTasmLine;
|
||||
else
|
||||
if (ProcessNonTasmLine(Line)) /* check MASM or OPTASM style */
|
||||
processor = ProcessNonTasmLine;
|
||||
}
|
||||
else
|
||||
processor(Line); /* type already determined */
|
||||
}
|
||||
|
||||
/*
|
||||
FilterToIDE - Open the pipe output from the program, read and post each line
|
||||
to the IDE
|
||||
*/
|
||||
void FilterToIDE( void )
|
||||
{
|
||||
LPSTR line;
|
||||
|
||||
Pipefh = IDE_Open( PIPEID, 0 );
|
||||
|
||||
if (Pipefh < 0)
|
||||
{
|
||||
char error[100];
|
||||
LoadString( globInst, IDS_CANNOTFILTER, error, sizeof(error));
|
||||
IDE_ErrorBox( error );
|
||||
numFatals++;
|
||||
return;
|
||||
}
|
||||
|
||||
InitBuffer();
|
||||
|
||||
while ((line = GetLine()) != NULL)
|
||||
{
|
||||
ProcessLine( line );
|
||||
}
|
||||
|
||||
ReleaseBuffer();
|
||||
}
|
||||
|
||||
/*
|
||||
Run - exported entry point to the filter DLL
|
||||
|
||||
Input: pTransferBlock TransBlock contains information about the program to
|
||||
be run, its command line, and the IDE tool API
|
||||
*/
|
||||
int far pascal _export Run( pTransferBlock TransBlock )
|
||||
{
|
||||
// Store the IDE tool API
|
||||
memcpy( IDE_ToolAPI, TransBlock->IDE_ToolAPI, sizeof(IDE_ToolAPI) );
|
||||
|
||||
// Try to run program capturing output to an intermediate file
|
||||
IDE_CaptureToPipe( TransBlock->program,
|
||||
TransBlock->cmdline,
|
||||
PIPEID );
|
||||
|
||||
// post the captured output to the IDE
|
||||
FilterToIDE();
|
||||
|
||||
// return appropriate code for
|
||||
if (numFatals)
|
||||
{
|
||||
return toolFatalError;
|
||||
}
|
||||
if (numErrors)
|
||||
{
|
||||
return toolErrors;
|
||||
}
|
||||
if (numWarnings)
|
||||
{
|
||||
return toolWarnings;
|
||||
}
|
||||
|
||||
return toolSuccess;
|
||||
}
|
||||
|
||||
#pragma argsused
|
||||
int far pascal LibMain( HINSTANCE hInstance, WORD wDataSegment,
|
||||
WORD wHeapSize, LPSTR lpszCmdLine )
|
||||
{
|
||||
globInst = hInstance;
|
||||
return 1;
|
||||
}
|
||||
|
||||
#pragma argsused
|
||||
int FAR PASCAL WEP ( int bSystemExit )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,260 @@
|
||||
/*
|
||||
ToolAPI.H copyright (c) Borland International 1993
|
||||
|
||||
Borland IDE external tool API definitions
|
||||
|
||||
*/
|
||||
|
||||
#if !defined( _TOOLAPI_H )
|
||||
#define _TOOLAPI_H
|
||||
|
||||
#if !defined( _TRANTYPE_H )
|
||||
#include "TranType.h"
|
||||
#endif // _TRANTYPE_H
|
||||
|
||||
// All of the functions exported from the IDE are C callable
|
||||
// to allow the use of both C and C++ for tool development
|
||||
#if defined( __cplusplus )
|
||||
extern "C" {
|
||||
#endif // __cplusplus
|
||||
|
||||
/*
|
||||
This first section of the ToolAPI header file show prototypes for functions
|
||||
which reside in the IDE. These functions are passed to the tool DLL as a
|
||||
parameter to the Run function in the form of an array of void (*func)(void)
|
||||
pointers. Detailed below are macros which correspond to the prototypes which
|
||||
allow the tool DLL to use the functions from the pointer array directly as
|
||||
they are defined.
|
||||
*/
|
||||
|
||||
/************************************************/
|
||||
/* function which must be defined by transfer DLL */
|
||||
/************************************************/
|
||||
int far pascal Run( pTransferBlock TransBlock );
|
||||
|
||||
#if 0
|
||||
/***********************************/
|
||||
/* functions exported by Borland IDE */
|
||||
/***********************************/
|
||||
/*** IDE versioning functions ***/
|
||||
// IDE_Version() fills the tVersion structure with necessary information
|
||||
// for the DLL to determine if it is compatible with the caller.
|
||||
void IDE_Version( tVersion *version );
|
||||
|
||||
// IDE_Exec() attempts to launch the program identified by Path. If
|
||||
// searchpath is set, the IDE will look in the current working directory
|
||||
// and then look along the path for the program.
|
||||
// Returns: exit code of executed program or -1 on failure
|
||||
int IDE_Exec( const char *Path, BOOL searchpath );
|
||||
|
||||
/*** File I/O oriented functions ***/
|
||||
// File I/O maps as closely as possible to standard RTL IO.H functions
|
||||
FileHandle IDE_Open ( LPSTR file, mode_t Mode );
|
||||
FileHandle IDE_SOpen ( LPSTR file, mode_t Mode, share_t Share );
|
||||
FileHandle IDE_Create( LPSTR file );
|
||||
WORD IDE_Read ( FileHandle fh, LPSTR buffer, WORD len );
|
||||
WORD IDE_Write ( FileHandle fh, LPSTR buffer, WORD len );
|
||||
WORD32 IDE_Seek ( FileHandle fh, WORD32 offset, WORD whence );
|
||||
void IDE_Close ( FileHandle fh );
|
||||
|
||||
void IDE_Delete( LPSTR file );
|
||||
|
||||
|
||||
/*** Memory management oriented functions ***/
|
||||
// The memory management functions parallel windows functions as closely
|
||||
// as possible. A tool DLL can allocate memory via the native environment
|
||||
// if that is preferred.
|
||||
HMEM IDE_memalloc ( memflags_t memflags, WORD32 size );
|
||||
LPSTR IDE_memlock ( HMEM hMemory );
|
||||
void IDE_memunlock ( HMEM hMemory );
|
||||
HMEM IDE_memhandle ( LPSTR location );
|
||||
void IDE_memfree ( HMEM hMemory );
|
||||
WORD32 IDE_memsize ( HMEM hMemory );
|
||||
HMEM IDE_memrealloc( HMEM hMemory, WORD32 size, memflags_t memflags );
|
||||
memflags_t IDE_memflags ( HMEM hMemory );
|
||||
WORD32 IDE_freespace( void );
|
||||
|
||||
/*** Message system oriented functions ***/
|
||||
// IDE_NewMessageGroup() checks for a group of messages tagged with the
|
||||
// group name provided. If it exists, it is cleared if the clear==TRUE.
|
||||
// The current message group is set to the MsgGroupID for that tag and
|
||||
// the message group ID is returned to caller.
|
||||
MsgGroupID IDE_NewMessageGroup( LPSTR GroupName, BOOL clear );
|
||||
|
||||
// IDE_SetMessageGroup() sets the current message group to MsgGrpID.
|
||||
// if clear==TRUE, the group is cleared
|
||||
void IDE_SetMessageGroup( MsgGroupID MsgGrpID, BOOL clear );
|
||||
|
||||
// IDE_PostMessage() posts a new message to the MsgGroupID indicated
|
||||
void IDE_PostMessage ( MsgGroupID MsgGrpID, lpMsg Msg );
|
||||
|
||||
// IDE_ClearMessages() clears all messages in all message groups
|
||||
void IDE_ClearMessages ( void );
|
||||
|
||||
|
||||
/*** Message Box posting functions ***/
|
||||
// IDE_ErrorBox() is used to put a message box onto the screen for purposes
|
||||
// of notifying the user that something has happened. The box has a singe OK
|
||||
// button. The IDE box has an exclamation point and a single ok button
|
||||
void IDE_ErrorBox( const char *message );
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
The remaining section of this header file details macros which allow calling
|
||||
of functions in the IDE's ToolAPI function pointer array without having to
|
||||
typecast or concider array locations or parameters. The macros cause the
|
||||
entries in the IDE_ToolAPI array of void (*func)(void) function pointers to
|
||||
be accessed as the corresponding prototypes listed above detail.
|
||||
*/
|
||||
|
||||
extern _pascal IDE_ToolAPIFunc IDE_ToolAPI[];
|
||||
|
||||
|
||||
// enumeration for the tool api array of functions
|
||||
typedef enum
|
||||
{
|
||||
// Version functions
|
||||
IDEVersion,
|
||||
|
||||
// Task functions
|
||||
IDEMonitor,
|
||||
IDEExec,
|
||||
IDEGetTaskID,
|
||||
|
||||
// File I/O functions
|
||||
IDEOpen,
|
||||
IDESOpen,
|
||||
IDECreate,
|
||||
IDERead,
|
||||
IDEWrite,
|
||||
IDEClose,
|
||||
IDESeek,
|
||||
IDEDelete,
|
||||
IDECapture,
|
||||
|
||||
// Memory management functions
|
||||
IDEMemAlloc,
|
||||
IDEMemLock,
|
||||
IDEMemUnlock,
|
||||
IDEMemHandle,
|
||||
IDEMemFree,
|
||||
IDEMemSize,
|
||||
IDEMemRealloc,
|
||||
IDEMemFlags,
|
||||
IDEFreeSpace,
|
||||
|
||||
// Message system functions
|
||||
IDENewMessageGroup,
|
||||
IDESetMessageGroup,
|
||||
IDEPostMessage,
|
||||
IDEClearMessages,
|
||||
|
||||
// Error Box functions
|
||||
IDEErrorBox,
|
||||
|
||||
// End of list, indicate size of array
|
||||
IDE_NumFunctions,
|
||||
} ToolApi;
|
||||
|
||||
// typedef pointer for the run function exported from the tool DLL
|
||||
typedef int far pascal (*runFuncPtr)( pTransferBlock );
|
||||
|
||||
// Typedefs allow convertion from void (*func)( void ) function pointers
|
||||
// to functions of the correct type
|
||||
typedef void far pascal (*versionptr) ( tVersion * );
|
||||
|
||||
typedef monitor_t far pascal (*monitorptr)( TaskID );
|
||||
typedef TaskID far pascal (*taskptr) ( const char *, BOOL );
|
||||
|
||||
typedef FileHandle far pascal (*openptr) ( LPSTR, mode_t );
|
||||
typedef FileHandle far pascal (*sopenptr) ( LPSTR, mode_t, share_t );
|
||||
typedef FileHandle far pascal (*creatptr) ( LPSTR );
|
||||
typedef WORD far pascal (*rdwrptr) ( FileHandle , LPSTR, WORD );
|
||||
typedef void far pascal (*closeptr) ( FileHandle );
|
||||
typedef WORD32 far pascal (*seekptr) ( FileHandle, WORD32, WORD );
|
||||
typedef void far pascal (*deleteptr) ( LPSTR );
|
||||
typedef int far pascal (*captureptr) ( const char *, LPSTR, LPSTR );
|
||||
|
||||
|
||||
typedef WORD32 far pascal (*memsizeptr) ( HMEM );
|
||||
typedef HMEM far pascal (*memallocptr) ( memflags_t, WORD32 );
|
||||
typedef HMEM far pascal (*memreallocptr)( HMEM, WORD32, memflags_t );
|
||||
typedef void far pascal (*memunlockptr) ( HMEM );
|
||||
typedef LPSTR far pascal (*memlockptr) ( HMEM );
|
||||
typedef HMEM far pascal (*memhandleptr) ( LPSTR );
|
||||
typedef memflags_t far pascal (*memflagsptr) ( HMEM );
|
||||
typedef WORD32 far pascal (*memfreeptr)( void );
|
||||
|
||||
typedef MsgGroupID far pascal (*newgroupptr) ( LPSTR, BOOL );
|
||||
typedef void far pascal (*setmsgptr) ( MsgGroupID, BOOL );
|
||||
typedef void far pascal (*postmsgptr) ( MsgGroupID, lpMsg );
|
||||
typedef void far pascal (*clearmsgptr) ( void );
|
||||
|
||||
typedef void far pascal (*errboxptr) ( const char * );
|
||||
|
||||
/*
|
||||
For the following, the single letters translate as:
|
||||
V pointer to version structure ( tVersion * )
|
||||
T TaskID
|
||||
S Search? (boolean)
|
||||
CR Create (boolean)
|
||||
FN FileName
|
||||
FH FileHandle
|
||||
M File open Mode
|
||||
SH Share flags
|
||||
H Handle to memory
|
||||
SZ Size of block (unsigned LONG)
|
||||
F Memory Flags (Type memflags_t )
|
||||
L Lenght (unsigned LONG)
|
||||
B Buffer (LPSTR)
|
||||
CB const string (const char *)
|
||||
P Path (LPSTR)
|
||||
C Clear (boolean)
|
||||
G Message Group (MsgGroupID)
|
||||
M pointer to a Message structure ( lpMsg )
|
||||
*/
|
||||
|
||||
// IDE version
|
||||
#define IDE_Version( V ) ((versionptr)(*IDE_ToolAPI[IDEVersion]))( V )
|
||||
|
||||
// Task functions
|
||||
#define IDE_Monitor( T ) ((monitorptr)(*IDE_ToolAPI[IDEMonitor]))( T )
|
||||
#define IDE_Exec( P, S ) ((taskptr)(*IDE_ToolAPI[IDEExec]))( P, S )
|
||||
#define IDE_GetTaskID( P, CR ) ((taskptr)(*IDE_ToolAPI[IDEExec]))( P, CR )
|
||||
|
||||
// File I/O functions
|
||||
#define IDE_Open( FN, M ) ((openptr)(*IDE_ToolAPI[IDEOpen]))( FN, M )
|
||||
#define IDE_SOpen( FN, M, SH ) ((sopenptr)(*IDE_ToolAPI[IDESOpen]))( FN, M, SH )
|
||||
#define IDE_Create( FN ) ((creatptr)(*IDE_ToolAPI[IDECreate]))( FN )
|
||||
#define IDE_Read( FH, B, L ) ((rdwrptr)(*IDE_ToolAPI[IDERead]))( FH, B, L )
|
||||
#define IDE_Write( FH, B, L ) ((rdwrptr)(*IDE_ToolAPI[IDEWrite]))( FH, B, L )
|
||||
#define IDE_Close( FH ) ((closeptr)(*IDE_ToolAPI[IDEClose]))( FH )
|
||||
#define IDE_Delete( FN ) ((deleteptr)(*IDE_ToolAPI[IDEDelete]))( FN )
|
||||
#define IDE_Seek( FH, O, Wh ) ((seekptr)(*IDE_ToolAPI[IDESeek]))( FH, O, Wh )
|
||||
#define IDE_CaptureToPipe( P, CT, PF ) ((captureptr)(*IDE_ToolAPI[IDECapture]))( P, CT, PF )
|
||||
|
||||
// Memory management functions
|
||||
#define IDE_memalloc( F, SZ ) ((memallocptr)(*IDE_ToolAPI[IDEMemAlloc]))( F, SZ )
|
||||
#define IDE_memlock( H ) ((memlockptr)(*IDE_ToolAPI[IDEMemLock]))( H )
|
||||
#define IDE_memunlock( H ) ((memunlockptr)(*IDE_ToolAPI[IDEMemUnlock]))( H )
|
||||
#define IDE_memhandle( B ) ((memhandleptr)(*IDE_ToolAPI[IDEMemHandle]))( B )
|
||||
#define IDE_memfree( H ) ((memunlockptr)(*IDE_ToolAPI[IDEMemFree]))( H )
|
||||
#define IDE_memsize( H ) ((memsizeptr)(*IDE_ToolAPI[IDEMemSize]))( H )
|
||||
#define IDE_memrealloc( H, SZ, F )((memreallocptr)(*IDE_ToolAPI[IDEMemRealloc]))( H, SZ, F )
|
||||
#define IDE_memflags ( H ) ((memflagsptr)(*IDE_ToolAPI[IDEMemFlags]))( H )
|
||||
#define IDE_freespace (*IDE_ToolAPI[IDEFreeSpace])
|
||||
|
||||
// message system functions
|
||||
#define IDE_NewMessageGroup( B, C ) ((newgroupptr)(*IDE_ToolAPI[IDENewMessageGroup]))( B, C )
|
||||
#define IDE_SetMessageGroup( G, C ) ((setmsgptr)(*IDE_ToolAPI[IDESetMessageGroup]))( G, C )
|
||||
#define IDE_PostMessage( G, M ) ((postmsgptr)(*IDE_ToolAPI[IDEPostMessage]))( G, M )
|
||||
#define IDE_ClearMessages (*IDE_ToolAPI[IDEClearMessages])
|
||||
|
||||
#define IDE_ErrorBox( CB ) ((errboxptr)(*IDE_ToolAPI[IDEErrorBox]))( CB )
|
||||
|
||||
#if defined( __cplusplus )
|
||||
} // matches extern "C" {
|
||||
#endif // __cplusplus
|
||||
|
||||
#endif // _TOOLAPI_H
|
||||
@@ -0,0 +1,146 @@
|
||||
/*
|
||||
TranType.H copyright (c) Borland International 1993
|
||||
|
||||
IDE defined types for various tranfer tool types
|
||||
*/
|
||||
|
||||
#if !defined( __TRANTYPE_H )
|
||||
#define __TRANTYPE_H
|
||||
|
||||
typedef unsigned char BYTE;
|
||||
|
||||
typedef unsigned long WORD32;
|
||||
typedef unsigned WORD16;
|
||||
|
||||
#if !defined( LPSTR )
|
||||
typedef char *LPSTR;
|
||||
#endif
|
||||
|
||||
typedef int BOOL; // matches Windows.H
|
||||
#define FALSE 0
|
||||
#define TRUE 1
|
||||
|
||||
#if !defined( __FLAT__ )
|
||||
#define FAR _far
|
||||
#endif
|
||||
|
||||
#if !defined( WORD )
|
||||
typedef unsigned short WORD;
|
||||
#endif
|
||||
|
||||
#if !defined( NULL )
|
||||
#define NULL 0
|
||||
#endif
|
||||
|
||||
/********************/
|
||||
/* Type definitions */
|
||||
/********************/
|
||||
// tool return codes
|
||||
enum
|
||||
{
|
||||
toolUnknownProblem = -1,
|
||||
toolSuccess,
|
||||
toolWarnings,
|
||||
toolErrors,
|
||||
toolFatalError,
|
||||
};
|
||||
|
||||
// task montitor type
|
||||
typedef enum
|
||||
{
|
||||
TSK_NOTLOADED,
|
||||
TSK_COMPLETE,
|
||||
TSK_RUNNING,
|
||||
TSK_IDLE,
|
||||
} monitor_t;
|
||||
|
||||
typedef WORD32 TaskID;
|
||||
#define NO_TASK 0l
|
||||
|
||||
typedef WORD16 HMEM;
|
||||
|
||||
typedef void far pascal (*IDE_ToolAPIFunc)( void );
|
||||
typedef IDE_ToolAPIFunc *lpIDE_ToolAPIFunc;
|
||||
|
||||
#define SAVE_NONE 0x0000
|
||||
#define SAVE_EDIT 0x0001
|
||||
#define SAVE_CUR 0x0002
|
||||
#define SAVE_PRJ 0x0004
|
||||
#define SAVE_PROMPT 0x0008
|
||||
|
||||
#define SAVE_ALL (SAVE_EDIT | SAVE_CUR | SAVE_PRJ)
|
||||
|
||||
typedef struct tag_TransferBlock
|
||||
{
|
||||
LPSTR program;
|
||||
LPSTR cmdline;
|
||||
LPSTR filter;
|
||||
lpIDE_ToolAPIFunc IDE_ToolAPI;
|
||||
} TransferBlock;
|
||||
typedef TransferBlock *pTransferBlock;
|
||||
|
||||
// Values of memflags_t directly map to WINDOWS 3.1 GMEM_ flags
|
||||
typedef enum
|
||||
{
|
||||
MEM_FIXED = 0x0000,
|
||||
MEM_MOVEABLE = 0x0002,
|
||||
MEM_NOCOMPACT = 0x0010,
|
||||
MEM_NODISCARD = 0x0020,
|
||||
MEM_ZEROINIT = 0x0040,
|
||||
MEM_MODIFY = 0x0080,
|
||||
MEM_DISCARDABLE = 0x0100,
|
||||
MEM_NOT_BANKED = 0x1000,
|
||||
MEM_SHARE = 0x2000,
|
||||
MEM_DDESHARE = 0x2000,
|
||||
MEM_NOTIFY = 0x4000,
|
||||
MEM_LOWER = MEM_NOT_BANKED,
|
||||
} memflags_t;
|
||||
|
||||
// File open and share flags
|
||||
typedef enum
|
||||
{ // Windows.H equivalents
|
||||
O_RDONLY = 0x01, // OF_READ
|
||||
O_WRONLY = 0x02, // OF_WRITE
|
||||
O_RDWR = 0x04, //
|
||||
O_DENYALL = 0x10, // OF_SHARE_EXCLUSIVE
|
||||
O_DENYWRITE = 0x20, // OF_SHARE_DENY_WRITE
|
||||
O_DENYREAD = 0x30, // OF_SHARE_DENY_READ
|
||||
O_DENYNONE = 0x40, // OF_SHARE_DENY_NONE
|
||||
} mode_t;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
SH_DENYALL = 0x10, // OF_SHARE_EXCLUSIVE
|
||||
SH_DENYWRITE = 0x20, // OF_SHARE_DENY_WRITE
|
||||
SH_DENYREAD = 0x30, // OF_SHARE_DENY_READ
|
||||
SH_DENYNONE = 0x40, // OF_SHARE_DENY_NONE
|
||||
} share_t;
|
||||
|
||||
typedef int FileHandle;
|
||||
|
||||
// message system message structure
|
||||
typedef WORD16 MsgGroupID;
|
||||
typedef struct Message_tag
|
||||
{
|
||||
LPSTR message;
|
||||
LPSTR filename;
|
||||
WORD16 column;
|
||||
WORD16 line;
|
||||
} Msg;
|
||||
typedef Msg *lpMsg;
|
||||
|
||||
#define CUR_MSG_GROUP -1
|
||||
|
||||
// IDE version structure
|
||||
typedef struct IDEversion_tag
|
||||
{
|
||||
BYTE IDEMajor;
|
||||
BYTE IDEMinor;
|
||||
BYTE IDEPlatform;
|
||||
} tVersion;
|
||||
|
||||
#define DosPlatform 1
|
||||
#define WinPlatform 2
|
||||
|
||||
|
||||
#endif // _TRANTYPE_H
|
||||
@@ -0,0 +1,198 @@
|
||||
//----------------------------------------------------------------------------
|
||||
// IdeHook - (C) Copyright 1994 by Borland International
|
||||
//----------------------------------------------------------------------------
|
||||
#pragma hdrstop
|
||||
|
||||
#include "idehook.h"
|
||||
#include <string.h>
|
||||
#include <windows.h>
|
||||
|
||||
static char realCppPreprocess[] = "CppPreprocessor";
|
||||
static char myPreprocessorName[] = "CppPreprocessAndSee";
|
||||
|
||||
|
||||
class _HOOKCLASS LocalToolClient : public ToolClient
|
||||
{
|
||||
public:
|
||||
ToolReturn _HOOKEP RunPreprocessor( ToolInvokeArgs * );
|
||||
|
||||
void RegisterMyCallBacks( ToolServer * );
|
||||
|
||||
private:
|
||||
|
||||
int registered;
|
||||
static ToolRegisterPack entryPoints[];
|
||||
|
||||
};
|
||||
|
||||
static LocalToolClient localToolClient;
|
||||
|
||||
ToolRegisterPack LocalToolClient::entryPoints[] =
|
||||
{
|
||||
{ myPreprocessorName, (ToolMethod)&LocalToolClient::RunPreprocessor },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
void
|
||||
LocalToolClient::RegisterMyCallBacks( ToolServer * ts )
|
||||
{
|
||||
if( !registered )
|
||||
{
|
||||
registered = 1;
|
||||
ts->ToolRegisterImplementor( this, entryPoints );
|
||||
}
|
||||
}
|
||||
|
||||
ToolReturn _HOOKEP
|
||||
LocalToolClient::RunPreprocessor( ToolInvokeArgs * args )
|
||||
{
|
||||
ToolReq server;
|
||||
|
||||
ProjectNode node = args->numNodes ? *args->nodeArray : 0;
|
||||
|
||||
ToolObj preprocessor = server->ToolFind( realCppPreprocess );
|
||||
ToolObj editTool = 0;
|
||||
|
||||
if( preprocessor )
|
||||
{
|
||||
if( server->ToolInvoke( preprocessor, node, 0 ) == Success )
|
||||
{
|
||||
if( (editTool = server->ToolFind( "EditText" )) == 0 )
|
||||
{
|
||||
::MessageBox( ::GetActiveWindow(),
|
||||
"Can't find editor!",
|
||||
"Error!",
|
||||
MB_ICONEXCLAMATION | MB_OK );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
::MessageBox( ::GetActiveWindow(),
|
||||
"CppPreprocess did not complete ok!",
|
||||
"Error!",
|
||||
MB_ICONEXCLAMATION | MB_OK );
|
||||
}
|
||||
}
|
||||
|
||||
if( editTool )
|
||||
{
|
||||
ProjectNodeInfo nodeInfo;
|
||||
ProjectReq projectServer;
|
||||
|
||||
projectServer->QueryNodeInfo( node, nodeInfo );
|
||||
|
||||
char * str = new char [ strlen( nodeInfo.outputLocation ) + 3 ];
|
||||
|
||||
strcpy( str, nodeInfo.outputLocation );
|
||||
|
||||
char * pdot = strrchr( str, '.' );
|
||||
|
||||
if( pdot )
|
||||
*pdot = 0;
|
||||
|
||||
strcat( str, ".i" );
|
||||
|
||||
return( server->ToolInvoke( editTool, str ) );
|
||||
}
|
||||
|
||||
return( Errors );
|
||||
|
||||
}
|
||||
|
||||
//
|
||||
// Project stuff
|
||||
//
|
||||
class _HOOKCLASS LocalProjClient : public ProjectClient
|
||||
{
|
||||
public:
|
||||
LocalProjClient();
|
||||
|
||||
virtual void _HOOKEP OpenNotify
|
||||
(
|
||||
const char * name
|
||||
);
|
||||
|
||||
virtual void _HOOKEP CloseNotify();
|
||||
|
||||
virtual void _HOOKEP NodeDeleteNotify
|
||||
(
|
||||
ProjectNode
|
||||
);
|
||||
|
||||
virtual void _HOOKEP DependencyQueryResponder
|
||||
(
|
||||
ProjectNode ,
|
||||
const char *
|
||||
);
|
||||
|
||||
};
|
||||
|
||||
static LocalProjClient LocalProjClient;
|
||||
|
||||
LocalProjClient::LocalProjClient()
|
||||
{
|
||||
ProjectReq ps;
|
||||
|
||||
ps->RegisterProjectClient(this);
|
||||
}
|
||||
|
||||
|
||||
void _HOOKEP
|
||||
LocalProjClient::OpenNotify
|
||||
(
|
||||
const char * // name
|
||||
)
|
||||
{
|
||||
ToolReq ts;
|
||||
|
||||
localToolClient.RegisterMyCallBacks( ts );
|
||||
|
||||
if( !ts->ToolFind( myPreprocessorName ) )
|
||||
{
|
||||
ToolObj realPreProcessor;
|
||||
|
||||
if( (realPreProcessor = ts->ToolFind( realCppPreprocess )) != 0 )
|
||||
{
|
||||
ToolInfo toolInfo;
|
||||
|
||||
ts->QueryToolInfo( realPreProcessor, toolInfo );
|
||||
|
||||
toolInfo.toolType = Viewer;
|
||||
toolInfo.name = myPreprocessorName;
|
||||
toolInfo.menuName = "&Preprocess and see";
|
||||
toolInfo.defCmdLine = 0;
|
||||
toolInfo.helpHint = "Preprocess a c/c++ file and dump"
|
||||
" into editor";
|
||||
toolInfo.launchId = CALLBACK_LAUNCH_ID;
|
||||
|
||||
ts->ToolAdd( &toolInfo );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void _HOOKEP
|
||||
LocalProjClient::CloseNotify()
|
||||
{
|
||||
}
|
||||
|
||||
void _HOOKEP
|
||||
LocalProjClient::NodeDeleteNotify
|
||||
(
|
||||
ProjectNode
|
||||
)
|
||||
{
|
||||
}
|
||||
|
||||
void _HOOKEP
|
||||
LocalProjClient::DependencyQueryResponder
|
||||
(
|
||||
ProjectNode ,
|
||||
const char *
|
||||
)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
// End of file
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
LIBRARY CPPNSEE
|
||||
DESCRIPTION 'Frank Borland'
|
||||
EXETYPE WINDOWS
|
||||
CODE LOADONCALL MOVEABLE DISCARDABLE
|
||||
DATA PRELOAD MOVEABLE SINGLE
|
||||
HEAPSIZE 4096
|
||||
SEGMENTS
|
||||
_TEXT PRELOAD MOVEABLE
|
||||
|
||||
EXPORTS
|
||||
WEP @1 RESIDENTNAME
|
||||
IDELIBMAIN @2
|
||||
|
||||
@@ -0,0 +1,113 @@
|
||||
//----------------------------------------------------------------------------
|
||||
// IdeHook - (C) Copyright 1994 by Borland International
|
||||
//----------------------------------------------------------------------------
|
||||
#pragma hdrstop
|
||||
|
||||
#include "idehook.h"
|
||||
#include <windows.h>
|
||||
|
||||
|
||||
// Editor addon
|
||||
|
||||
static char szClassHeader[] =
|
||||
{
|
||||
"//\n"
|
||||
"// Class:\n"
|
||||
"//\n"
|
||||
"// Description:\n"
|
||||
"//\n"
|
||||
"// Last modified date:\n"
|
||||
"// Last modified by: \n"
|
||||
"//\n"
|
||||
};
|
||||
|
||||
|
||||
int KeyStrokeTest2( KeyStroke * )
|
||||
{
|
||||
EditorReq editor;
|
||||
|
||||
long line;
|
||||
long col;
|
||||
|
||||
editor->inq_position( &line, &col );
|
||||
while( col-- )
|
||||
editor->left();
|
||||
editor->down();
|
||||
|
||||
editor->insert( szClassHeader );
|
||||
|
||||
return(1);
|
||||
}
|
||||
|
||||
int KeyStrokeTest1( KeyStroke * )
|
||||
{
|
||||
EditorReq editor;
|
||||
|
||||
long line;
|
||||
long col;
|
||||
|
||||
editor->inq_position( &line, &col );
|
||||
while( col-- )
|
||||
editor->left();
|
||||
editor->drop_anchor();
|
||||
editor->end_of_line();
|
||||
editor->raise_anchor();
|
||||
|
||||
return(1);
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Project stuff
|
||||
//
|
||||
|
||||
class _HOOKCLASS LocalProjClient : public ProjectClient
|
||||
{
|
||||
public:
|
||||
LocalProjClient();
|
||||
|
||||
virtual void _HOOKEP OpenNotify( const char * name );
|
||||
virtual void _HOOKEP CloseNotify() {}
|
||||
virtual void _HOOKEP NodeDeleteNotify(ProjectNode) {}
|
||||
virtual void _HOOKEP DependencyQueryResponder(ProjectNode,const char*) {}
|
||||
|
||||
int _registered;
|
||||
|
||||
};
|
||||
|
||||
LocalProjClient::LocalProjClient()
|
||||
{
|
||||
ProjectReq ps;
|
||||
|
||||
ps->RegisterProjectClient(this);
|
||||
}
|
||||
|
||||
static LocalProjClient LocalProjClient;
|
||||
|
||||
|
||||
#define NUM_KEYSTROKES (sizeof(keyStrokes)/sizeof(keyStrokes[0]))
|
||||
|
||||
static KeyStroke keyStrokes[] =
|
||||
{
|
||||
{ WM_KEYDOWN, VK_F11, NoModifier, KeyStrokeTest2 },
|
||||
{ WM_KEYDOWN, VK_F11, Shift, KeyStrokeTest1 }
|
||||
};
|
||||
|
||||
void _HOOKEP
|
||||
LocalProjClient::OpenNotify
|
||||
(
|
||||
const char * // name
|
||||
)
|
||||
{
|
||||
if( !_registered )
|
||||
{
|
||||
EditorReq editor;
|
||||
|
||||
editor->register_keyhit_handlers( keyStrokes, NUM_KEYSTROKES );
|
||||
|
||||
_registered = 1;
|
||||
}
|
||||
}
|
||||
|
||||
// End of file
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
LIBRARY EDHOOK
|
||||
DESCRIPTION 'Frank Borland'
|
||||
EXETYPE WINDOWS
|
||||
CODE LOADONCALL MOVEABLE DISCARDABLE
|
||||
DATA PRELOAD MOVEABLE SINGLE
|
||||
HEAPSIZE 4096
|
||||
SEGMENTS
|
||||
_TEXT PRELOAD MOVEABLE
|
||||
|
||||
EXPORTS
|
||||
WEP @1 RESIDENTNAME
|
||||
IDELIBMAIN @2
|
||||
|
||||
@@ -0,0 +1,208 @@
|
||||
//----------------------------------------------------------------------------
|
||||
// IdeHook - (C) Copyright 1994 by Borland International
|
||||
//----------------------------------------------------------------------------
|
||||
#pragma hdrstop
|
||||
|
||||
#include "idehook.h"
|
||||
#include "pathspec.h"
|
||||
#include <cstring.h>
|
||||
|
||||
static char genVbxTransferName[] = "VbxHeaderGen";
|
||||
static char genVbxViewerName[] = "VbxHeaderNodeGen";
|
||||
static char genVbxTranslatorName[] = "VbxTranslator";
|
||||
static char genVbxPath[] = "vbxgen.exe";
|
||||
static char genVbxMenuName[] = "&Generate VBX Header";
|
||||
static char genVbxHelpHint[] = "Generate header files for VBX controls";
|
||||
|
||||
|
||||
static char VBXFilter[] = "VBX Controls (*.vbx)|*.vbx|"
|
||||
"All Files (*.*)|*.*|";
|
||||
static char DotHFilter[] = "Header File (*.h)|*.h|"
|
||||
"All Files (*.*)|*.*|";
|
||||
|
||||
|
||||
|
||||
class _HOOKCLASS LocalToolClient : public ToolClient
|
||||
{
|
||||
public:
|
||||
ToolReturn _HOOKEP RunVbxHeaderGen( ToolInvokeArgs * );
|
||||
|
||||
void RegisterMyCallBacks( ToolServer * );
|
||||
|
||||
private:
|
||||
int registered;
|
||||
static ToolRegisterPack entryPoints[];
|
||||
|
||||
};
|
||||
|
||||
static LocalToolClient localToolClient;
|
||||
|
||||
ToolRegisterPack LocalToolClient::entryPoints[] =
|
||||
{
|
||||
{ genVbxViewerName, (ToolMethod)&LocalToolClient::RunVbxHeaderGen },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
void
|
||||
LocalToolClient::RegisterMyCallBacks( ToolServer * ts )
|
||||
{
|
||||
if( !registered )
|
||||
{
|
||||
registered = 1;
|
||||
ts->ToolRegisterImplementor( this, entryPoints );
|
||||
}
|
||||
}
|
||||
|
||||
ToolReturn _HOOKEP
|
||||
LocalToolClient::RunVbxHeaderGen( ToolInvokeArgs * args )
|
||||
{
|
||||
PathSpec vbxPath;
|
||||
PathSpec headerPath;
|
||||
|
||||
if( vbxPath.openFileDialog( VBXFilter ) )
|
||||
{
|
||||
headerPath.path( vbxPath.path() );
|
||||
headerPath.ext( ".h" );
|
||||
|
||||
if( headerPath.newFileDialog( DotHFilter ) )
|
||||
{
|
||||
ToolReq ts;
|
||||
|
||||
ToolObj vbxGenner = ts->ToolFind( genVbxTransferName );
|
||||
|
||||
string cmdLine;
|
||||
|
||||
cmdLine = vbxPath.path();
|
||||
cmdLine += " ";
|
||||
cmdLine += headerPath.path();
|
||||
|
||||
if
|
||||
(
|
||||
( ts->ToolInvoke( vbxGenner, (const char *)0, cmdLine.c_str() ) )
|
||||
== Success
|
||||
)
|
||||
{
|
||||
ProjectReq project;
|
||||
|
||||
int count = args->numNodes;
|
||||
|
||||
for( int i = 0; i < count; i++ )
|
||||
{
|
||||
ProjectNode parent = args->nodeArray[i];
|
||||
|
||||
project->NodeAdd( parent, headerPath.path() );
|
||||
}
|
||||
|
||||
ts->ToolInvoke( ts->ToolFind( "EditText" ), headerPath.path() );
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return( Success );
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Project stuff
|
||||
//
|
||||
|
||||
class _HOOKCLASS LocalProjClient : public ProjectClient
|
||||
{
|
||||
public:
|
||||
LocalProjClient();
|
||||
|
||||
virtual void _HOOKEP OpenNotify ( const char * name );
|
||||
virtual void _HOOKEP CloseNotify() {}
|
||||
virtual void _HOOKEP NodeDeleteNotify( ProjectNode ) {}
|
||||
virtual void _HOOKEP DependencyQueryResponder(ProjectNode,const char *) {}
|
||||
};
|
||||
|
||||
static LocalProjClient LocalProjClient;
|
||||
|
||||
LocalProjClient::LocalProjClient()
|
||||
{
|
||||
ProjectReq ps;
|
||||
|
||||
ps->RegisterProjectClient(this);
|
||||
}
|
||||
|
||||
|
||||
void _HOOKEP
|
||||
LocalProjClient::OpenNotify
|
||||
(
|
||||
const char * // name
|
||||
)
|
||||
{
|
||||
ToolReq ts;
|
||||
|
||||
localToolClient.RegisterMyCallBacks( ts );
|
||||
|
||||
if( !ts->ToolFind( genVbxTransferName ) )
|
||||
{
|
||||
ToolInfo toolInfo;
|
||||
|
||||
// //
|
||||
// Install this as simple 'Tool' menu transfer //
|
||||
// It will run the tool 'straight' //
|
||||
// //
|
||||
|
||||
toolInfo.toolType = Transfer;
|
||||
toolInfo.name = genVbxTransferName;
|
||||
toolInfo.path = genVbxPath;
|
||||
toolInfo.flags = OnToolsMenu;
|
||||
toolInfo.menuName = genVbxMenuName;
|
||||
toolInfo.helpHint = genVbxHelpHint;
|
||||
toolInfo.defCmdLine = "$PROMPT";
|
||||
toolInfo.appliesTo = 0;
|
||||
toolInfo.defaultFor = 0;
|
||||
toolInfo.translateTo = 0;
|
||||
toolInfo.launchId = DEFAULT_LAUNCH_ID;
|
||||
|
||||
ts->ToolAdd( &toolInfo );
|
||||
|
||||
// //
|
||||
// Install this as a Viewer on [.c] and [.cpp] //
|
||||
// We will implement the tool here (above) by //
|
||||
// putting put our own FileOpen dialogs and //
|
||||
// adding the results into tree. //
|
||||
// //
|
||||
|
||||
toolInfo.toolType = Viewer;
|
||||
toolInfo.name = genVbxViewerName;
|
||||
toolInfo.path = 0;
|
||||
toolInfo.flags = OnLocalMenu;
|
||||
toolInfo.menuName = genVbxMenuName;
|
||||
toolInfo.helpHint = genVbxHelpHint;
|
||||
toolInfo.defCmdLine = 0;
|
||||
toolInfo.appliesTo = ".cpp;.c;";
|
||||
toolInfo.defaultFor = 0;
|
||||
toolInfo.translateTo = 0;
|
||||
toolInfo.launchId = CALLBACK_LAUNCH_ID;
|
||||
|
||||
ts->ToolAdd( &toolInfo );
|
||||
|
||||
// //
|
||||
// Install this as a translator on [.vbx] nodes //
|
||||
// with the output being a [.h] //
|
||||
// //
|
||||
|
||||
toolInfo.toolType = Translator;
|
||||
toolInfo.name = genVbxTranslatorName;
|
||||
toolInfo.path = genVbxPath;
|
||||
toolInfo.flags = OnLocalMenu;
|
||||
toolInfo.menuName = genVbxMenuName;
|
||||
toolInfo.helpHint = genVbxHelpHint;
|
||||
toolInfo.defCmdLine = "$EDNAME $OUTNAME";
|
||||
toolInfo.appliesTo = ".vbx";
|
||||
toolInfo.defaultFor = ".vbx";
|
||||
toolInfo.translateTo = ".h";
|
||||
toolInfo.launchId = DEFAULT_LAUNCH_ID;
|
||||
|
||||
ts->ToolAdd( &toolInfo );
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// End of file
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
LIBRARY GENVBXH
|
||||
DESCRIPTION 'Frank Borland'
|
||||
EXETYPE WINDOWS
|
||||
CODE LOADONCALL MOVEABLE DISCARDABLE
|
||||
DATA PRELOAD MOVEABLE SINGLE
|
||||
HEAPSIZE 4096
|
||||
SEGMENTS
|
||||
_TEXT PRELOAD MOVEABLE
|
||||
|
||||
EXPORTS
|
||||
WEP @1 RESIDENTNAME
|
||||
IDELIBMAIN @2
|
||||
|
||||
@@ -0,0 +1,919 @@
|
||||
//----------------------------------------------------------------------------
|
||||
// IdeHook - (C) Copyright 1994 by Borland International
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
// IdeHook can be used to customize and enhance the functionality
|
||||
// of the Borland C++ Integrated Development Environment.
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
// FEATURE OVERVIEW:
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// With IdeHook.h (and the accompanying .obj file) users can
|
||||
// incorporate many powerful features seamlessly into the IDE.
|
||||
// For example:
|
||||
// 1) Install tools onto the 'Tools' menu
|
||||
// 2) Install tools onto the SpeedMenu of specific node types
|
||||
// 3) Provide an implementation of tools through call-backs into a .DLL
|
||||
// 4) Monitor IDE events (such as Project Open and Close) and
|
||||
// perform customized actions on these events
|
||||
//
|
||||
// IdeHook gives users access to the following areas of the IDE:
|
||||
//
|
||||
// 1) Tool Server Lets you install, query and invoke
|
||||
// any tool in the IDE.
|
||||
// 2) Project Manager Gives you full access to the dependency tree
|
||||
// of the currently open project, including the
|
||||
// ability to add new nodes, query the tree, and
|
||||
// get and set persistent properties in the project.
|
||||
// 3) TargetExpert Allows callers to create and query targets
|
||||
// on any platform.
|
||||
// 4) StyleSheets Gives access to the setting and getting of
|
||||
// options on any node in the project tree.
|
||||
// 5) Make Gives access to the make engine, including
|
||||
// make notifications.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
// HOW TO USE IDEHOOK:
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// IdeHook is easy to use:
|
||||
//
|
||||
// 1) Create one or more .CPP modules that include a customized
|
||||
// version IDEHOOK.H to perform your specific functionality.
|
||||
// 2) Create a .DLL module using you own modules and the IDEHOOK.OBJ
|
||||
// file provided with IDEHOOK.
|
||||
// 3) In the end-users Windows directory, modify BCW.INI to
|
||||
// add the following section and key-value(s):
|
||||
// [AddOns]
|
||||
// addon000=<yourdll.dll>
|
||||
// In this section, <yourdll.dll> is the name of the .DLL you
|
||||
// created in Step 2 of this procedure.
|
||||
//
|
||||
// There are a few examples included to help you get on your way.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
// TIPS AND CAVEATS
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// It is important to remember some things when using IdeHook:
|
||||
//
|
||||
// 1) You can use the IDE to make your addon (the examples were
|
||||
// done that way). However, you must modify your BCW.INI whenever
|
||||
// you test the addon. Because of this, you must remember to
|
||||
// *remove* the addon item when you are not testing.
|
||||
//
|
||||
// 2) To debug your addon, you must use the standalone debugger (TDW.EXE)
|
||||
// on BCW.EXE, then load your addon into the debugger using the 'name'
|
||||
// field in the Load Modules dialog box (press F3 in TDW).
|
||||
//
|
||||
// 3) Link order is *very* important when making the .DLL. Always
|
||||
// use the following order:
|
||||
// <yourLibMainModule>
|
||||
// idehook.obj
|
||||
// <your modules...>
|
||||
//
|
||||
// 4) If you GP the IDE, the IDE will *not* unload your .DLL. You
|
||||
// must either use a .DLL unloader program or restart Windows.
|
||||
//
|
||||
// 5) The IDE expects the key/value pairs of the [addons] section of
|
||||
// BCW.INI to be in numeric sequential order. It important that you
|
||||
// respect other addon vendors in this regard. For example, by the
|
||||
// time your addon is installed at an end-user sight, there might be
|
||||
// several addons already installed; BCW.INI might have the following:
|
||||
// [AddOns]
|
||||
// addon000=somedll.dll
|
||||
// addon001=another.dll
|
||||
// addon002=evenmore.dll
|
||||
// It is *your* responsibility to install your addon at the end of
|
||||
// this list (as 'addon003'). It is even more important to keep the
|
||||
// addons sequential when you uninstall your addon. If there have
|
||||
// been other addons installed after yours, you must decrement the
|
||||
// numbers back to maintain a non-interrupted numeric sequence.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
#ifndef __IDEHOOK_H
|
||||
#define __IDEHOOK_H
|
||||
|
||||
#ifndef __IDEHOOKT_H
|
||||
# include "idehookt.h"
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
// CLIENTS AND SERVERS
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// The IDE is built on an API exchange architecture. The APIs are
|
||||
// well defined and understood by all parties; the implementors
|
||||
// of these APIs are responsible for registering themselves as
|
||||
// such and servicing requests for the given API.
|
||||
//
|
||||
// IdeHook exposes serveral IDE servers:
|
||||
//
|
||||
// ToolServer
|
||||
// ProjectServer
|
||||
// TargetExpert
|
||||
// OptionSetServer
|
||||
// MakeServer
|
||||
//
|
||||
// In order to gain access to these servers, each one comes with a
|
||||
// 'requestor' that implements the proper request and release sequence:
|
||||
//
|
||||
// Server Requestor
|
||||
// ---------------- ------------------
|
||||
// ToolServer ToolReq
|
||||
// ProjectServer ProjectReq
|
||||
// TargetExpert TargetExpertReq
|
||||
// OptionSetServer OptionSetReq
|
||||
// MakeServer MakeReq
|
||||
//
|
||||
// To get a service, just instantiate its requestor:
|
||||
//
|
||||
// {
|
||||
// ToolReq toolServer; // This gets a ToolServer
|
||||
//
|
||||
// toolServer->ToolInvoke( ... ); // Call the server
|
||||
//
|
||||
// } // Release the tool server
|
||||
//
|
||||
//
|
||||
// NOTE: Some servers provide a 'client' class which you must implement
|
||||
// and register with the server in order to get call backs for event
|
||||
// notifications, tool invocations, or query responders.
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
// //
|
||||
// TOOL CLIENT/SERVER //
|
||||
// //
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
//
|
||||
// ToolClient
|
||||
//
|
||||
// Use this class as a shell for your implementation of tool call-backs.
|
||||
//
|
||||
class _HOOKCLASS ToolClient
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
//
|
||||
// ToolServer
|
||||
//
|
||||
// This is the IDE's tool server, use it to query, add, remove,
|
||||
// and invoke any tool in the IDE.
|
||||
//
|
||||
// There are two types of tool installing:
|
||||
//
|
||||
// 1) 'Installing' a tool into the user's project. Tools
|
||||
// installed in this manner appear on either the IDE Tool
|
||||
// menu or on the SpeedMenu of a specific node type. These
|
||||
// tools are implemented as either standalone .EXEs or as
|
||||
// call-backs into your addon .DLLs. Tools installed like
|
||||
// this are done on a project-by-project basis.
|
||||
//
|
||||
// 2) 'Registering' the implementor of a call-back style tool that
|
||||
// was installed in Step 1). This only needs to be done
|
||||
// once per instance of BCW.EXE.
|
||||
//
|
||||
class _HOOKCLASS ToolServer
|
||||
{
|
||||
public:
|
||||
|
||||
//
|
||||
// Register one or many tool call-back implementors
|
||||
//
|
||||
virtual void _HOOKEP ToolRegisterImplementor
|
||||
(
|
||||
ToolClient *,
|
||||
ToolRegisterPack *
|
||||
) = 0;
|
||||
|
||||
//
|
||||
// Install a tool into the user's project
|
||||
//
|
||||
virtual ToolObj _HOOKEP ToolAdd
|
||||
(
|
||||
ToolInfo *
|
||||
) = 0;
|
||||
|
||||
//
|
||||
// Query the existance of a tool in the current project
|
||||
//
|
||||
virtual ToolObj _HOOKEP ToolFind
|
||||
(
|
||||
const char * name
|
||||
) = 0;
|
||||
|
||||
//
|
||||
// Remove a tool from the current project
|
||||
//
|
||||
virtual void _HOOKEP ToolRemove
|
||||
(
|
||||
const char * name
|
||||
) = 0;
|
||||
|
||||
//
|
||||
// Query the detailed information of a tool
|
||||
//
|
||||
virtual void _HOOKEP QueryToolInfo
|
||||
(
|
||||
ToolObj,
|
||||
ToolInfo &
|
||||
) = 0;
|
||||
|
||||
// //
|
||||
// Invoke any tool in the IDE. If 'ProjectNode' is zero, the //
|
||||
// tool is invoked on the 'currently selected object' in the //
|
||||
// IDE, as determined by the IDE. //
|
||||
// //
|
||||
virtual ToolReturn _HOOKEP ToolInvoke
|
||||
(
|
||||
ToolObj,
|
||||
ProjectNode = 0,
|
||||
const char * cmdLineOverride = 0
|
||||
) = 0;
|
||||
|
||||
virtual ToolReturn _HOOKEP ToolInvoke
|
||||
(
|
||||
ToolObj,
|
||||
const char * edName,
|
||||
const char * cmdLineOverride = 0
|
||||
) = 0;
|
||||
|
||||
};
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
// //
|
||||
// PROJECT SERVER/CLIENT //
|
||||
// //
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
//
|
||||
// ProjectClient
|
||||
//
|
||||
// Client class for notification of project events and
|
||||
// query call-backs.
|
||||
//
|
||||
// For example, if you wish to get notified of every
|
||||
// Project Open event, derive and implement this class,
|
||||
// then register by calling the method
|
||||
// ProjectServer::RegisterProjectClient.
|
||||
//
|
||||
|
||||
class _HOOKCLASS ProjectClient
|
||||
{
|
||||
public:
|
||||
|
||||
//
|
||||
// Project Open notify event: This is called every time
|
||||
// a user successfully opens a project.
|
||||
//
|
||||
virtual void _HOOKEP OpenNotify
|
||||
(
|
||||
const char * name
|
||||
) = 0;
|
||||
|
||||
//
|
||||
// Project Close notify event: This is called every time
|
||||
// a user closes a project (either explicitly using
|
||||
// Project|Close Project, or by opening another project).
|
||||
//
|
||||
virtual void _HOOKEP CloseNotify() = 0;
|
||||
|
||||
//
|
||||
// Node delete event: This is called every time the
|
||||
// user explicitly deletes a node.
|
||||
//
|
||||
virtual void _HOOKEP NodeDeleteNotify
|
||||
(
|
||||
ProjectNode
|
||||
) = 0;
|
||||
|
||||
//
|
||||
// This is used as a call back to the method
|
||||
// ProjectServer::QueryDependencies.
|
||||
//
|
||||
virtual void _HOOKEP DependencyQueryResponder
|
||||
(
|
||||
ProjectNode ,
|
||||
const char * outputName
|
||||
) = 0;
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// ProjectServer
|
||||
//
|
||||
// Provides access to the current project's dependency tree.
|
||||
//
|
||||
// The 'ProjectNode' cookie passed around in this (and others)
|
||||
// is a persistent 32-bit entity across sessions. You can safely
|
||||
// store this value in your own supplemental files, then refer to
|
||||
// the value during later sessions.
|
||||
//
|
||||
class _HOOKCLASS ProjectServer
|
||||
{
|
||||
public:
|
||||
|
||||
//
|
||||
// Register your implementation of a project client
|
||||
//
|
||||
virtual void _HOOKEP RegisterProjectClient
|
||||
(
|
||||
ProjectClient *
|
||||
) = 0;
|
||||
|
||||
//
|
||||
// Release your implementation of a project client
|
||||
//
|
||||
virtual void _HOOKEP UnregisterProjectClient
|
||||
(
|
||||
ProjectClient *
|
||||
) = 0;
|
||||
|
||||
//
|
||||
// Add a node to the project tree. If 'parent' is 0, then the node
|
||||
// is added as a second level node (as a dependent of the [.ide]
|
||||
// node). If 'type' is 0, then 'name' is assumed to be a file name,
|
||||
// and the extension is used as the node type. For example:
|
||||
//
|
||||
// To add a file:
|
||||
// NodeAdd( parent, "foo.cpp" ); // OR:
|
||||
// NodeAdd( parent, "foo", ".cpp" );
|
||||
//
|
||||
// To add a SourcePool:
|
||||
// NodeAdd( parent, "The Shared Sources", "SourcePool" );
|
||||
//
|
||||
virtual ProjectNode _HOOKEP NodeAdd
|
||||
(
|
||||
ProjectNode parent,
|
||||
const char * name,
|
||||
const char * type = 0
|
||||
) = 0;
|
||||
|
||||
//
|
||||
// Find any instance of a node in the tree
|
||||
//
|
||||
virtual ProjectNode _HOOKEP NodeFind
|
||||
(
|
||||
const char * name
|
||||
) = 0;
|
||||
|
||||
//
|
||||
// Remove a node and all its dependencies from the tree
|
||||
//
|
||||
virtual ProjectNode _HOOKEP NodeRemove
|
||||
(
|
||||
ProjectNode
|
||||
) = 0;
|
||||
|
||||
//
|
||||
// Return the top level [.ide] node from the tree
|
||||
//
|
||||
virtual ProjectNode _HOOKEP QueryTopNode() = 0;
|
||||
|
||||
//
|
||||
// Query detailed information about a given node in the tree
|
||||
//
|
||||
virtual void _HOOKEP QueryNodeInfo
|
||||
(
|
||||
ProjectNode,
|
||||
ProjectNodeInfo &
|
||||
) = 0;
|
||||
|
||||
//
|
||||
// Query the dependencies of a given node in the tree. (This
|
||||
// method 'collapses' SourcePool nodes by recursing into
|
||||
// them as if they were not there.) This function calls every
|
||||
// dependency found with the ProjectClient::DependencyQueryResponder()
|
||||
// method when it's called with both the 'ProjectNode' and output
|
||||
// location for that node.
|
||||
//
|
||||
virtual void _HOOKEP QueryDependencies
|
||||
(
|
||||
ProjectNode,
|
||||
ProjectClient *
|
||||
) = 0;
|
||||
|
||||
|
||||
//
|
||||
// NodePropertySet/Get/Remove lets you create and maintain
|
||||
// persistent named properties on any node in any project. The
|
||||
// 'propertyName' field must be unique to every property on a
|
||||
// given node. Because of this, it's recommended you use some
|
||||
// kind of trademark (such as a name or initials) so as to not
|
||||
// conflict with other addon vendors.
|
||||
//
|
||||
virtual void _HOOKEP NodePropertySet
|
||||
(
|
||||
ProjectNode node,
|
||||
const char * propertyName,
|
||||
void * data,
|
||||
size_t dataSize
|
||||
) = 0;
|
||||
|
||||
virtual size_t _HOOKEP NodePropertyFind
|
||||
(
|
||||
ProjectNode node,
|
||||
const char * propertyName,
|
||||
const void * & data
|
||||
) = 0;
|
||||
|
||||
virtual void _HOOKEP NodePropertyRemove
|
||||
(
|
||||
ProjectNode node,
|
||||
const char * propertyName
|
||||
) = 0;
|
||||
|
||||
|
||||
//
|
||||
// Return the user's currently selected nodes in the project
|
||||
//
|
||||
virtual int _HOOKEP QuerySelectedNodes
|
||||
(
|
||||
ProjectNode * & nodeArray,
|
||||
int & numNodes
|
||||
) = 0;
|
||||
|
||||
};
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
// //
|
||||
// OPTIONSET SERVER //
|
||||
// //
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
//
|
||||
// OptionSetServer
|
||||
//
|
||||
// Access certain local overrides on node's project options.
|
||||
// The options available are given in an enum in IDEHOOKT.H
|
||||
// called OptionsStringIds.
|
||||
//
|
||||
class _HOOKCLASS OptionSetServer
|
||||
{
|
||||
public:
|
||||
|
||||
//
|
||||
// Set the node's local override for the given option
|
||||
//
|
||||
virtual void _HOOKEP OptionApply
|
||||
(
|
||||
ProjectNode node,
|
||||
OptionsStringIds oid,
|
||||
const char * value
|
||||
) = 0;
|
||||
|
||||
//
|
||||
// Get the node's local override for the given option
|
||||
//
|
||||
virtual size_t _HOOKEP OptionGet
|
||||
(
|
||||
ProjectNode node,
|
||||
OptionsStringIds oid,
|
||||
const char * & value
|
||||
) = 0;
|
||||
|
||||
//
|
||||
// Remove the node's local override for the given option. This
|
||||
// removes *all* local overrides if oid == OID_RemoveAll.
|
||||
//
|
||||
virtual void _HOOKEP OptionRemove
|
||||
(
|
||||
ProjectNode node,
|
||||
OptionsStringIds oid
|
||||
) = 0;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
// //
|
||||
// TARGET EXPERT //
|
||||
// //
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
//
|
||||
// TargetExpert
|
||||
//
|
||||
// Allows for adding and querying target nodes in the
|
||||
// dependency tree. The TargetExpert expert automatically
|
||||
// creates the proper library skeleton and sets the proper
|
||||
// options for the given platform, memory model, and so on.
|
||||
//
|
||||
class _HOOKCLASS TargetExpert
|
||||
{
|
||||
public:
|
||||
|
||||
//
|
||||
// Add a target into the project dependency tree
|
||||
//
|
||||
virtual ProjectNode _HOOKEP TargetAdd
|
||||
(
|
||||
const char * name,
|
||||
TargetPlatforms platform,
|
||||
TargetStdLibs libs,
|
||||
TargetModel image,
|
||||
ProjectNode parent = 0,
|
||||
const char * type = 0
|
||||
) = 0;
|
||||
|
||||
//
|
||||
// Query if a ProjectNode is actually a target
|
||||
//
|
||||
virtual int _HOOKEP NodeIsTarget
|
||||
(
|
||||
ProjectNode
|
||||
) = 0;
|
||||
|
||||
//
|
||||
// Climb 'up' the dependency tree and return the node's target
|
||||
//
|
||||
virtual ProjectNode _HOOKEP FindNodesTarget
|
||||
(
|
||||
ProjectNode
|
||||
) = 0;
|
||||
|
||||
//
|
||||
// Query whether a given node (target or not) supports the
|
||||
// given platform, libraries and/or image. If any of the
|
||||
// query parameters are 0, then that attribute is not part
|
||||
// of the query. For example:
|
||||
//
|
||||
// To see if a node is a Win32 compile:
|
||||
// QuerySupports( node, Win32, 0, 0 );
|
||||
//
|
||||
// To see if a node is an OWL node:
|
||||
// QuerySupports( node, 0, OWL, 0 );
|
||||
//
|
||||
// To see if a node is a large model Dos overly with BGI:
|
||||
// QuerySupports( node, DosOverlay, BGI, Large );
|
||||
//
|
||||
virtual int _HOOKEP QuerySupports
|
||||
(
|
||||
ProjectNode node,
|
||||
TargetPlatforms platform,
|
||||
TargetStdLibs libs,
|
||||
TargetModel image
|
||||
) = 0;
|
||||
|
||||
};
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
// //
|
||||
// MAKE //
|
||||
// //
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
class _HOOKCLASS MakeClient
|
||||
{
|
||||
public:
|
||||
virtual void MakeBeginNotify() = 0;
|
||||
virtual void MakeEndNotify() = 0;
|
||||
};
|
||||
|
||||
class _HOOKCLASS MakeServer
|
||||
{
|
||||
public:
|
||||
virtual void _HOOKEP RegisterMakeClient
|
||||
(
|
||||
MakeClient *
|
||||
) = 0;
|
||||
|
||||
virtual void _HOOKEP UnRegisterMakeClient
|
||||
(
|
||||
MakeClient *
|
||||
) = 0;
|
||||
|
||||
virtual void _HOOKEP MakeNodes
|
||||
(
|
||||
MakeMode,
|
||||
ProjectNode *,
|
||||
int numNodes = 1
|
||||
) = 0;
|
||||
|
||||
virtual long _HOOKEP NodeInputAge
|
||||
(
|
||||
ProjectNode
|
||||
) = 0;
|
||||
|
||||
virtual long _HOOKEP NodeOutputAge
|
||||
(
|
||||
ProjectNode
|
||||
) = 0;
|
||||
|
||||
};
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
// //
|
||||
// EDITOR //
|
||||
// //
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
class _HOOKCLASS EditorServer
|
||||
{
|
||||
public:
|
||||
|
||||
//
|
||||
// This first section is taken from the BRIEF macro language guide,
|
||||
// where these routines are documented. The few differences from
|
||||
// those semantics are listed here. String manipulation routines
|
||||
// are not listed because the caller may use RTL functions.
|
||||
//
|
||||
|
||||
virtual int _HOOKEP beginning_of_line() = 0;
|
||||
|
||||
virtual int _HOOKEP backspace() = 0;
|
||||
|
||||
//
|
||||
// This version ignores buffer_name and system
|
||||
//
|
||||
virtual BufferId _HOOKEP create_buffer
|
||||
(
|
||||
char * buffer_name,
|
||||
char * file_name,
|
||||
int system = 0
|
||||
) = 0;
|
||||
|
||||
virtual int _HOOKEP delete_block() = 0;
|
||||
|
||||
//
|
||||
// Delete a buffer from memory if there are no windows containing
|
||||
// views on the buffer
|
||||
//
|
||||
virtual int _HOOKEP delete_buffer
|
||||
(
|
||||
BufferId buffer_id
|
||||
) = 0;
|
||||
|
||||
virtual int _HOOKEP delete_char
|
||||
(
|
||||
int num_to_delete = 1
|
||||
) = 0;
|
||||
|
||||
virtual void _HOOKEP delete_line() = 0;
|
||||
|
||||
virtual void _HOOKEP delete_to_eol() = 0;
|
||||
|
||||
virtual long _HOOKEP distance_to_tab() = 0;
|
||||
|
||||
virtual int _HOOKEP down() = 0;
|
||||
|
||||
virtual void _HOOKEP drop_anchor
|
||||
(
|
||||
char mark_type = 1
|
||||
) = 0;
|
||||
|
||||
virtual int _HOOKEP end_of_buffer() = 0;
|
||||
|
||||
virtual int _HOOKEP end_of_line() = 0;
|
||||
|
||||
virtual int _HOOKEP end_of_window() = 0;
|
||||
|
||||
virtual int _HOOKEP goto_line
|
||||
(
|
||||
long line
|
||||
) = 0;
|
||||
|
||||
virtual int _HOOKEP goto_old_line
|
||||
(
|
||||
long line
|
||||
) = 0;
|
||||
|
||||
virtual BufferId _HOOKEP inq_buffer
|
||||
(
|
||||
char * fileName = 0
|
||||
) = 0;
|
||||
|
||||
//
|
||||
// Returns the length of the current line in characters
|
||||
//
|
||||
virtual int _HOOKEP inq_line_length() = 0;
|
||||
|
||||
virtual int _HOOKEP inq_modified() = 0;
|
||||
|
||||
virtual void _HOOKEP inq_names
|
||||
(
|
||||
char * full_name = 0,
|
||||
char * extension = 0,
|
||||
char * buffer_name = 0
|
||||
) = 0;
|
||||
|
||||
virtual int _HOOKEP inq_position
|
||||
(
|
||||
long * line = 0,
|
||||
long * col = 0
|
||||
) = 0;
|
||||
|
||||
virtual int _HOOKEP inq_views
|
||||
(
|
||||
BufferId buffer_id = 0
|
||||
) = 0;
|
||||
|
||||
//
|
||||
// Add only the control string
|
||||
//
|
||||
virtual void _HOOKEP insert
|
||||
(
|
||||
char * control_string
|
||||
) = 0;
|
||||
|
||||
virtual int _HOOKEP left() = 0;
|
||||
|
||||
virtual int _HOOKEP move_abs
|
||||
(
|
||||
long line = 0,
|
||||
long column = 0
|
||||
) = 0;
|
||||
|
||||
virtual int _HOOKEP move_rel
|
||||
(
|
||||
long num_lines = 0,
|
||||
long num_columns = 0
|
||||
) = 0;
|
||||
|
||||
virtual BufferId _HOOKEP next_buffer
|
||||
(
|
||||
int system_too = 0
|
||||
) = 0;
|
||||
|
||||
virtual int _HOOKEP next_char
|
||||
(
|
||||
int num_chars = 1
|
||||
) = 0;
|
||||
|
||||
virtual int _HOOKEP page_down() = 0;
|
||||
|
||||
virtual int _HOOKEP page_up() = 0;
|
||||
|
||||
virtual int _HOOKEP prev_char
|
||||
(
|
||||
int num_chars = 1
|
||||
) = 0;
|
||||
|
||||
virtual void _HOOKEP raise_anchor() = 0;
|
||||
|
||||
//
|
||||
// NOTE: Be sure to call free_string() with the value returned here.
|
||||
//
|
||||
virtual char * _HOOKEP read
|
||||
(
|
||||
int length = 0
|
||||
) = 0;
|
||||
|
||||
virtual int _HOOKEP read_file
|
||||
(
|
||||
char * filename
|
||||
) = 0;
|
||||
|
||||
virtual void _HOOKEP refresh() = 0;
|
||||
|
||||
virtual int _HOOKEP right() = 0;
|
||||
|
||||
virtual int _HOOKEP search_back
|
||||
(
|
||||
const char* pattern,
|
||||
int regex = 1,
|
||||
int caseSen = 1,
|
||||
int block = 0,
|
||||
long * total_length = 0,
|
||||
int grep = 0
|
||||
) = 0;
|
||||
|
||||
virtual int _HOOKEP search_fwd
|
||||
(
|
||||
const char * pattern,
|
||||
int regex = 1,
|
||||
int caseSen = 1,
|
||||
int block = 0,
|
||||
long * total_length = 0,
|
||||
int grep = 0
|
||||
) = 0;
|
||||
|
||||
virtual BufferId _HOOKEP set_buffer
|
||||
(
|
||||
BufferId buffer_id
|
||||
) = 0;
|
||||
|
||||
virtual void _HOOKEP set_top_left
|
||||
(
|
||||
long top_line = 0,
|
||||
long left_col = 0,
|
||||
ViewId window_id = 0,
|
||||
long line = 0,
|
||||
long col = 0,
|
||||
BufferId buffer_id = 0
|
||||
) = 0;
|
||||
|
||||
virtual int _HOOKEP top_of_buffer() = 0;
|
||||
|
||||
virtual int _HOOKEP top_of_window() = 0;
|
||||
|
||||
virtual int _HOOKEP translate
|
||||
(
|
||||
char * pattern,
|
||||
char * replacment,
|
||||
int global_flag,
|
||||
int regex = 1,
|
||||
int caseSen = 1,
|
||||
int block = 0,
|
||||
int forward = 1,
|
||||
int grep = 0
|
||||
) = 0;
|
||||
|
||||
virtual int _HOOKEP up() = 0;
|
||||
|
||||
virtual int _HOOKEP write_buffer() = 0;
|
||||
|
||||
//----------------------------------------------------------------
|
||||
// This section consists of additional routines that cannot
|
||||
// be built with the BRIEF primitives.
|
||||
//
|
||||
|
||||
//
|
||||
// Free storage allocated by calls to read
|
||||
//
|
||||
virtual void _HOOKEP free_string
|
||||
(
|
||||
char * str // string to free
|
||||
) = 0;
|
||||
|
||||
//
|
||||
// show_buffer moves an MDI window on the current buffer to the
|
||||
// top of the window stack. If no such window exists, one is created.
|
||||
//
|
||||
virtual void _HOOKEP show_buffer() = 0;
|
||||
|
||||
virtual int _HOOKEP save_buffer() = 0;
|
||||
|
||||
virtual int _HOOKEP register_keyhit_handlers
|
||||
(
|
||||
KeyStroke * keyStrokes,
|
||||
int numKeyStrokes
|
||||
) = 0;
|
||||
};
|
||||
|
||||
|
||||
////////////////////////////////////////////////////
|
||||
// Service implementation //
|
||||
// //
|
||||
// See the notes above for usage information. //
|
||||
////////////////////////////////////////////////////
|
||||
|
||||
extern void * QueryService( int );
|
||||
extern void ReleaseService( int, void * );
|
||||
|
||||
template <class T, int id>
|
||||
class __Req
|
||||
{
|
||||
public:
|
||||
__Req() : _id( id ) { _server = (T *)QueryService( id ); }
|
||||
~__Req() { if( _server )
|
||||
ReleaseService( id, (void *)_server ); }
|
||||
operator T * () { return( _server ); }
|
||||
T * operator -> () { return( _server ); }
|
||||
int operator ! () { return( !_server ); }
|
||||
|
||||
private:
|
||||
T * _server;
|
||||
int _id;
|
||||
};
|
||||
|
||||
|
||||
#define SRVR_PROJECT 1
|
||||
#define SRVR_TOOL 2
|
||||
#define SRVR_OPTIONSET 3
|
||||
#define SRVR_TARGETEXPERT 4
|
||||
#define SRVR_MAKE 5
|
||||
#define SRVR_EDITOR 6
|
||||
|
||||
////////////////////////////////////////////////////
|
||||
// Service usage... //
|
||||
// //
|
||||
// Use the following typedefs when you are //
|
||||
// accessing a service, when you are coming into //
|
||||
// the scope the __Req where the service is //
|
||||
// made, or when going out of the scope where //
|
||||
// the service is released. //
|
||||
////////////////////////////////////////////////////
|
||||
|
||||
typedef __Req<ProjectServer, SRVR_PROJECT > ProjectReq;
|
||||
typedef __Req<ToolServer, SRVR_TOOL > ToolReq;
|
||||
typedef __Req<OptionSetServer,SRVR_OPTIONSET > OptionSetReq;
|
||||
typedef __Req<TargetExpert, SRVR_TARGETEXPERT> TargetExpertReq;
|
||||
typedef __Req<MakeServer, SRVR_MAKE > MakeReq;
|
||||
typedef __Req<EditorServer, SRVR_EDITOR > EditorReq;
|
||||
|
||||
|
||||
#endif __IDEHOOK_H
|
||||
|
||||
// End of file
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,207 @@
|
||||
//----------------------------------------------------------------------------
|
||||
// IdeHook - (C) Copyright 1994 by Borland International
|
||||
//----------------------------------------------------------------------------
|
||||
#ifndef __IDEHOOKT_H
|
||||
#define __IDEHOOKT_H
|
||||
|
||||
#ifndef __STDDEF_H
|
||||
# include <stddef.h>
|
||||
#endif
|
||||
|
||||
|
||||
// Some generic defines and types
|
||||
|
||||
#ifndef _UNIQUE_COOKIE
|
||||
# define _UNIQUE_COOKIE(name) typedef const struct name##__ _near* name
|
||||
# define _UNIQUE_COOKIE32(name) typedef const struct name##__ _far* name
|
||||
#endif
|
||||
|
||||
#define _HOOKCLASS _huge
|
||||
#define _HOOKEP _pascal _loadds
|
||||
|
||||
|
||||
// Tool enums and helper structs
|
||||
|
||||
_UNIQUE_COOKIE32( ToolObj ); // ToolObj is not persistent
|
||||
_UNIQUE_COOKIE32( ToolLaunchId );
|
||||
_UNIQUE_COOKIE32( ProjectNode ); // ProjectNode is persistent
|
||||
|
||||
#define DEFAULT_LAUNCH_ID ToolLaunchId(0)
|
||||
#define CALLBACK_LAUNCH_ID ToolLaunchId(-1)
|
||||
|
||||
enum ToolTypes
|
||||
{
|
||||
Transfer = -4,
|
||||
Viewer,
|
||||
Translator,
|
||||
};
|
||||
|
||||
enum ToolFlags
|
||||
{
|
||||
TargetTranslator = 0x0001,
|
||||
OnLocalMenu = 0x1000,
|
||||
OnToolsMenu = 0x2000,
|
||||
};
|
||||
|
||||
struct ToolInfo
|
||||
{
|
||||
ToolTypes toolType;
|
||||
const char * name;
|
||||
const char * path;
|
||||
ToolFlags flags;
|
||||
const char * menuName;
|
||||
const char * helpHint;
|
||||
const char * defCmdLine;
|
||||
union {
|
||||
const char *appliesTo;
|
||||
const char *translateFrom;
|
||||
};
|
||||
const char * defaultFor;
|
||||
const char * translateTo;
|
||||
ToolLaunchId launchId;
|
||||
};
|
||||
|
||||
enum ToolReturn
|
||||
{
|
||||
NotHandled = -1,
|
||||
Success,
|
||||
Warnings,
|
||||
Errors,
|
||||
FatalError
|
||||
};
|
||||
|
||||
class _HOOKCLASS ToolClient;
|
||||
|
||||
struct ToolInvokeArgs
|
||||
{
|
||||
const char * cmdLine;
|
||||
ProjectNode *nodeArray;
|
||||
int numNodes;
|
||||
};
|
||||
|
||||
typedef ToolReturn _HOOKEP
|
||||
(ToolClient::*ToolMethod)( ToolInvokeArgs * );
|
||||
|
||||
struct ToolRegisterPack
|
||||
{
|
||||
const char * toolName;
|
||||
ToolMethod toolMethod;
|
||||
unsigned long resv1;
|
||||
};
|
||||
|
||||
|
||||
// Project helper types
|
||||
|
||||
struct ProjectNodeInfo
|
||||
{
|
||||
const char * name;
|
||||
const char * nodeType;
|
||||
const char * description;
|
||||
const char * inputLocation;
|
||||
const char * outputLocation;
|
||||
ProjectNode parent;
|
||||
ProjectNode firstChild;
|
||||
ProjectNode nextSibling;
|
||||
};
|
||||
|
||||
// Option set ids
|
||||
|
||||
enum OptionsStringIds
|
||||
{
|
||||
OID_null,
|
||||
OID_RemoveAll = OID_null,
|
||||
OID_Include,
|
||||
OID_Library,
|
||||
OID_Source,
|
||||
OID_Intermediate,
|
||||
OID_Final,
|
||||
OID_Defines,
|
||||
OID_CmdlineOverride,
|
||||
|
||||
OID_Invalid
|
||||
};
|
||||
|
||||
|
||||
// Target expert types
|
||||
|
||||
enum TargetPlatforms
|
||||
{
|
||||
Win16 = 0x0001,
|
||||
Win32 = 0x0002,
|
||||
Dos16 = 0x0008,
|
||||
DosOverlay = 0x0010,
|
||||
};
|
||||
|
||||
enum TargetStdLibs
|
||||
{
|
||||
Framework = 0x0001,
|
||||
RTL = 0x0004,
|
||||
BIDS = 0x0002,
|
||||
OWL = Framework,
|
||||
BWCC = 0x0008,
|
||||
BGI = BWCC,
|
||||
|
||||
FloatingMath = 0x0010,
|
||||
FloatingEmu = 0x0020,
|
||||
FloatingStartup = 0x0040,
|
||||
|
||||
Static = 0x0100,
|
||||
Dynamic = 0x0200,
|
||||
|
||||
MultiThread = 0x2000,
|
||||
|
||||
Diagnostic = 0x8000,
|
||||
};
|
||||
|
||||
enum TargetModel
|
||||
{
|
||||
Tiny = 0x01,
|
||||
Small = 0x02,
|
||||
Medium = 0x04,
|
||||
Compact = 0x08,
|
||||
Large = 0x10,
|
||||
Huge = 0x20,
|
||||
|
||||
GUI = 0x0100,
|
||||
Console = 0x0200
|
||||
};
|
||||
|
||||
|
||||
// Make stuff
|
||||
|
||||
enum MakeMode
|
||||
{
|
||||
Make,
|
||||
Build,
|
||||
Translate
|
||||
};
|
||||
|
||||
// Editor stuff
|
||||
|
||||
_UNIQUE_COOKIE32( BufferId );
|
||||
_UNIQUE_COOKIE32( ViewId );
|
||||
|
||||
struct KeyStroke;
|
||||
|
||||
typedef int (*KeyHitHandler)(KeyStroke *);
|
||||
|
||||
enum KeyModifier
|
||||
{
|
||||
NoModifier,
|
||||
Shift = 0x0001,
|
||||
Control = 0x0002,
|
||||
Alt = 0x0004
|
||||
};
|
||||
|
||||
struct KeyStroke
|
||||
{
|
||||
unsigned short msg;
|
||||
unsigned short key;
|
||||
KeyModifier modifier;
|
||||
KeyHitHandler handler;
|
||||
};
|
||||
|
||||
#endif __IDEHOOKT_H
|
||||
|
||||
// End of file
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
//----------------------------------------------------------------------------
|
||||
// IdeHook - (C) Copyright 1994 by Borland International
|
||||
//----------------------------------------------------------------------------
|
||||
#include "windows.h"
|
||||
|
||||
int FAR PASCAL LibMain( HINSTANCE , WORD ,WORD wHeapSize, LPSTR )
|
||||
{
|
||||
if ( wHeapSize )
|
||||
UnlockData( 0 );
|
||||
return 1;
|
||||
}
|
||||
|
||||
// End of file
|
||||
|
||||
@@ -0,0 +1,580 @@
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright <c> Borland International, 1994
|
||||
//
|
||||
// Example Tools added for common OLE development.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// To enable the tools:
|
||||
// --------------------
|
||||
// 1) Build the OLETOOLS.DLL target.
|
||||
// 2) Add the following to the [AddOns] section of your BCW.INI file:
|
||||
// Addon000=Drive:Path\OLETOOLS.DLL
|
||||
// Note: The 000 must actually be the next numeric value in sequence.
|
||||
// That is, if you already have an entry with 000, use 001 etc...
|
||||
// If the [AddOns] section doesn't exist you may create it.
|
||||
// 3) On certain environments you will need to verify that the STDOLE.DLL
|
||||
// resides in your windows system directory.
|
||||
//
|
||||
// Tools Descriptions:
|
||||
// ------------------
|
||||
// translateODLtoTLB
|
||||
// Convert .odl to .tlb files.
|
||||
// (Requires Non-Borland distributed MkTypLib.exe)
|
||||
// msMKTypLib
|
||||
// Internal (to example) tool used for converting from ODL to TLB files.
|
||||
// extractAndBindTLB
|
||||
// Create .tlb from .exe/.dll bind .tlb back into .dll/.exe
|
||||
// oleRegister
|
||||
// Internal (to example) tool used to invoke register.exe
|
||||
// oleExtractTLB
|
||||
// Extract TypeLib Information
|
||||
// oleExtractReg
|
||||
// Create a .reg file from .exe/.dll
|
||||
// oleRegEditAdvanced
|
||||
// Tools Menu option to invoke regedit with /v parameter.
|
||||
// generateAndAddSource
|
||||
// Create nodes (.cxx [.cpp] /.hxx [.h] ) in your target from .exe/.dll
|
||||
// oleAutoGen
|
||||
// Internal (to example) tool used to invoke Autogen.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
#pragma hdrstop
|
||||
// Standard include files.
|
||||
#include <string.h>
|
||||
#include <windows.h>
|
||||
#include <dir.h>
|
||||
|
||||
// IDEHOOK include file.
|
||||
#include "idehook.h"
|
||||
|
||||
// OLE Tool names.
|
||||
static char translateODLtoTLB[] = "OLE_ODLtoTLB";
|
||||
static char msMkTypLib[] = "OLE_IMkTypeLib";
|
||||
static char extractAndBindTLB[] = "OLE_ExtractAndBindTypeInfo";
|
||||
static char oleRegister[] = "OLE_IRegister";
|
||||
static char oleExtractTLB[] = "OLE_ExtractTypeInfo";
|
||||
static char oleExtractReg[] = "OLE_ExtractReg";
|
||||
static char oleRegEditAdvanced[] = "OLE_RegEditAdvanced";
|
||||
static char generateAndAddSource[] = "OLE_GenerateAndAddSource";
|
||||
static char oleAutoGen[] = "OLE_IAutoGen";
|
||||
|
||||
// Existing tool names provided by BCW
|
||||
static char realLinker[] = "LinkTarget";
|
||||
static char realResCompiler[] = "CompileResources";
|
||||
static char realCppPreprocess[] = "CppPreprocessor";
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
// LocalToolClient ctor
|
||||
// Encapsulates the callback routines for tools.
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
class _HOOKCLASS LocalToolClient : public ToolClient
|
||||
{
|
||||
public:
|
||||
|
||||
// Callback routines.
|
||||
ToolReturn _HOOKEP RunGenerateAndAddSource( ToolInvokeArgs * );
|
||||
ToolReturn _HOOKEP RunExtractAndBind( ToolInvokeArgs * );
|
||||
ToolReturn _HOOKEP RunTypeLibrary( ToolInvokeArgs * );
|
||||
|
||||
// Registers Callback routines
|
||||
void RegisterMyCallBacks( ToolServer * );
|
||||
|
||||
private:
|
||||
|
||||
int registered;
|
||||
static ToolRegisterPack entryPoints[];
|
||||
};
|
||||
|
||||
// Instantiated LocalToolClient object.
|
||||
static LocalToolClient localToolClient;
|
||||
|
||||
// Static ToolRegisterPack object.
|
||||
ToolRegisterPack LocalToolClient::entryPoints[] =
|
||||
{
|
||||
{ ::generateAndAddSource, (ToolMethod)&LocalToolClient::RunGenerateAndAddSource },
|
||||
{ ::extractAndBindTLB, (ToolMethod)&LocalToolClient::RunExtractAndBind },
|
||||
{ ::translateODLtoTLB, (ToolMethod)&LocalToolClient::RunTypeLibrary },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// LocalToolClient::RegisterMyCallBacks
|
||||
// Register tool callback routines.
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
void
|
||||
LocalToolClient::RegisterMyCallBacks( ToolServer * ts )
|
||||
{
|
||||
// Have these been registered before?
|
||||
if (!registered)
|
||||
{
|
||||
registered = 1;
|
||||
ts->ToolRegisterImplementor( this, entryPoints );
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// LocalToolClient::generateAndAddSource
|
||||
// Create nodes (.cxx [.cpp] /.hxx [.h] ) in your target from .exe/.dll
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
ToolReturn _HOOKEP
|
||||
LocalToolClient::RunGenerateAndAddSource(ToolInvokeArgs * args)
|
||||
{
|
||||
ToolReq trTool; // Tool Requestor.
|
||||
ProjectReq prProject; // Project Requestor
|
||||
ToolReturn trReturn = FatalError; // Return Value.
|
||||
|
||||
ProjectNode pnParent = args->numNodes ? *args->nodeArray : 0;
|
||||
|
||||
if (pnParent)
|
||||
{
|
||||
// Obtain code generation tool.
|
||||
ToolObj toAutoGen = trTool->ToolFind(::oleAutoGen);
|
||||
|
||||
if (toAutoGen)
|
||||
{
|
||||
// Base used for new file names.
|
||||
char acBaseName[10];
|
||||
|
||||
// Project Node Information.
|
||||
ProjectNodeInfo pniParent;
|
||||
|
||||
// Get filename from node information.
|
||||
prProject->QueryNodeInfo(pnParent,pniParent);
|
||||
|
||||
// Extract base file name.
|
||||
fnsplit(pniParent.name,NULL,NULL,acBaseName,NULL);
|
||||
|
||||
// Check for valid name.
|
||||
if (acBaseName[0] != 0)
|
||||
{
|
||||
char acNodeNameCXX[14];
|
||||
char acNodeNameHXX[14];
|
||||
|
||||
// Create New Node Names
|
||||
wsprintf(acNodeNameCXX,"%s.cxx",acBaseName);
|
||||
wsprintf(acNodeNameHXX,"%s.hxx",acBaseName);
|
||||
|
||||
ToolObj regServer = trTool->ToolFind( oleRegister );
|
||||
|
||||
if (regServer)
|
||||
{
|
||||
// Create needed .olb file.
|
||||
if (trTool->ToolInvoke( regServer, pnParent, "$TARGET -TypeLib=$NAME($TARGET).olb") == Success)
|
||||
{
|
||||
// Invoke tool and generate new source modules.
|
||||
// upon success, add new source modules to the project.
|
||||
if (trTool->ToolInvoke( toAutoGen, (const char *)0, "$NAME($TARGET).olb" ) == Success )
|
||||
{
|
||||
// Add generated source code to project.
|
||||
ProjectNode pnCpp = prProject->NodeAdd(pnParent,acNodeNameCXX,".cpp");
|
||||
prProject->NodeAdd(pnCpp,acNodeNameHXX,".h");
|
||||
trReturn = Success;
|
||||
}
|
||||
else
|
||||
::MessageBox(::GetActiveWindow(),"AutoGen Reported Failure","Error",MB_ICONEXCLAMATION | MB_OK);
|
||||
}
|
||||
else
|
||||
::MessageBox(::GetActiveWindow(),"Register Reported Failure","Error",MB_ICONEXCLAMATION | MB_OK);
|
||||
}
|
||||
else
|
||||
::MessageBox(::GetActiveWindow(),"REGISTER.EXE Not Found","Error",MB_ICONEXCLAMATION | MB_OK);
|
||||
}
|
||||
else
|
||||
::MessageBox(::GetActiveWindow(),"Base File Name Not Found","Error",MB_ICONEXCLAMATION | MB_OK);
|
||||
}
|
||||
else
|
||||
::MessageBox(::GetActiveWindow(),"AUTOGEN.EXE Not Found","Error",MB_ICONEXCLAMATION | MB_OK);
|
||||
}
|
||||
else
|
||||
::MessageBox(::GetActiveWindow(),"Parent Node Invalid","Error",MB_ICONEXCLAMATION | MB_OK);
|
||||
|
||||
return (trReturn);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// extractAndBindTLB
|
||||
// Create .tlb from .exe/.dll bind .tlb back into .dll/.exe
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
ToolReturn _HOOKEP
|
||||
LocalToolClient::RunExtractAndBind( ToolInvokeArgs * args )
|
||||
{
|
||||
ProjectReq ps;
|
||||
EditorReq editor;
|
||||
ToolReq server;
|
||||
|
||||
ToolReturn trReturn = FatalError;
|
||||
|
||||
ProjectNode targetNode = args->numNodes ? *args->nodeArray : 0;
|
||||
|
||||
if (targetNode)
|
||||
{
|
||||
// Extract the .tlb from the .dll/.exe
|
||||
ToolObj regServer = server->ToolFind( oleRegister );
|
||||
|
||||
if (regServer)
|
||||
{
|
||||
server->ToolInvoke( regServer, targetNode, "$TARGET -TypeLib=__temp.tlb" );
|
||||
|
||||
// Create a .rc node
|
||||
static char rcNodeName[] = "__temp.rc";
|
||||
|
||||
ProjectNode rcNode = ps->NodeAdd( targetNode, rcNodeName );
|
||||
|
||||
if (rcNode)
|
||||
{
|
||||
// Create a edit buffer for the .rc script
|
||||
static char rcStatement[] = "TYPELIB 1 __temp.tlb";
|
||||
|
||||
BufferId newBuffer_id = editor->create_buffer( 0, rcNodeName, 0 );
|
||||
BufferId currBuffer_id = editor->set_buffer(newBuffer_id);
|
||||
|
||||
editor->insert( rcStatement );
|
||||
|
||||
// Resource compile the .rc script
|
||||
ToolObj resCompiler = server->ToolFind( realResCompiler );
|
||||
|
||||
if (resCompiler)
|
||||
{
|
||||
server->ToolInvoke( resCompiler, rcNode, 0);
|
||||
|
||||
// Run the linker (this re-bind the .dll with the new .res)
|
||||
ToolObj linker = server->ToolFind( realLinker );
|
||||
|
||||
if (linker)
|
||||
{
|
||||
server->ToolInvoke( linker, targetNode, 0 );
|
||||
trReturn = Success;
|
||||
}
|
||||
else
|
||||
::MessageBox(::GetActiveWindow(),"Internal Linker Not Found","Error!",MB_ICONEXCLAMATION | MB_OK);
|
||||
|
||||
// Re-register now that the .tlb is inside the .dll/.exe
|
||||
server->ToolInvoke( regServer, targetNode, "$TARGET -RegServer" );
|
||||
}
|
||||
else
|
||||
::MessageBox(::GetActiveWindow(),"Internal Resource Compiler Not Found","Error!",MB_ICONEXCLAMATION | MB_OK);
|
||||
|
||||
// Restore the user's editor state
|
||||
editor->set_buffer( currBuffer_id );
|
||||
editor->delete_buffer( newBuffer_id );
|
||||
|
||||
// Remove temporary node.
|
||||
ps->NodeRemove(rcNode);
|
||||
}
|
||||
else
|
||||
::MessageBox(::GetActiveWindow(),"Unable to create a temporary node.","Error!",MB_ICONEXCLAMATION | MB_OK);
|
||||
}
|
||||
else
|
||||
::MessageBox(::GetActiveWindow(),"REGISTER.EXE Not Found","Error!",MB_ICONEXCLAMATION | MB_OK);
|
||||
}
|
||||
else
|
||||
::MessageBox(::GetActiveWindow(),"Target Node Not Found","Error!",MB_ICONEXCLAMATION | MB_OK);
|
||||
|
||||
return( trReturn );
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// translateODLtoTLB
|
||||
// Convert .odl to .tlb files. (Requires Non-Borland distributed MkTypLib.exe?)
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
ToolReturn _HOOKEP
|
||||
LocalToolClient::RunTypeLibrary( ToolInvokeArgs * args )
|
||||
{
|
||||
static char cppCmdLine[]
|
||||
= "+$RSP(-D__MKTYPLIB__;$DEF -I$INC -P- -otlbt@@@.tm~) $EDNAME";
|
||||
|
||||
ToolReq server;
|
||||
|
||||
ProjectNode node = args->numNodes ? *args->nodeArray : 0;
|
||||
|
||||
ToolObj preprocessor = server->ToolFind( realCppPreprocess );
|
||||
ToolObj msTool = 0;
|
||||
|
||||
if ( preprocessor )
|
||||
{
|
||||
if ( server->ToolInvoke( preprocessor, node, cppCmdLine) == Success )
|
||||
{
|
||||
if ((msTool = server->ToolFind( ::msMkTypLib )) == 0)
|
||||
::MessageBox(::GetActiveWindow(),"Can't find mktyplib.exe tool", "Error!",MB_ICONEXCLAMATION | MB_OK);
|
||||
}
|
||||
else
|
||||
::MessageBox(::GetActiveWindow(),"CppPreprocess did not complete ok!","Error!",MB_ICONEXCLAMATION | MB_OK);
|
||||
}
|
||||
|
||||
if ( msTool )
|
||||
return( server->ToolInvoke( msTool, node, args->cmdLine ) );
|
||||
|
||||
return( Errors );
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
// Project Client Implementation
|
||||
// Encapsulates Project Manager Notifications
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
class _HOOKCLASS LocalProjClient : public ProjectClient
|
||||
{
|
||||
public:
|
||||
|
||||
// Ctor
|
||||
LocalProjClient();
|
||||
|
||||
// Required pure virtual implementations.
|
||||
virtual void _HOOKEP OpenNotify(const char * name);
|
||||
virtual void _HOOKEP CloseNotify();
|
||||
virtual void _HOOKEP NodeDeleteNotify(ProjectNode);
|
||||
virtual void _HOOKEP DependencyQueryResponder(ProjectNode ,const char *);
|
||||
|
||||
};
|
||||
|
||||
// Instantiated LocalProjectClient object.
|
||||
static LocalProjClient LocalProjClient;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
// LocalProjectClient Ctor
|
||||
// Register Project Client with IDE using a Project requestor.
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
LocalProjClient::LocalProjClient()
|
||||
{
|
||||
ProjectReq ps;
|
||||
ps->RegisterProjectClient(this);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
// LocalProjectClient::OpenNotify
|
||||
// Register Callbacks.
|
||||
// Add Tools to Project Manager.
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
void _HOOKEP
|
||||
LocalProjClient::OpenNotify(const char * /*name */)
|
||||
{
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
// Register Callbacks
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Obtain a ToolRequestor.
|
||||
ToolReq ts;
|
||||
|
||||
// Register callbacks for tools.
|
||||
localToolClient.RegisterMyCallBacks( ts );
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
// Add Tools
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
|
||||
// translateODLtoTLB
|
||||
// Convert .odl to .tlb files.
|
||||
if ( !ts->ToolFind( ::translateODLtoTLB ) )
|
||||
{
|
||||
ToolInfo toolInfo;
|
||||
|
||||
toolInfo.toolType = Translator;
|
||||
toolInfo.name = ::translateODLtoTLB;
|
||||
toolInfo.path = 0;
|
||||
toolInfo.flags = OnLocalMenu;
|
||||
toolInfo.menuName = "OLE Compile to .TLB";
|
||||
toolInfo.helpHint = "Translate an ODL script to automation type library";
|
||||
toolInfo.defCmdLine = 0;
|
||||
toolInfo.translateFrom = ".odl";
|
||||
toolInfo.defaultFor = ".odl";
|
||||
toolInfo.translateTo = ".tlb";
|
||||
toolInfo.launchId = CALLBACK_LAUNCH_ID;
|
||||
|
||||
ts->ToolAdd( &toolInfo );
|
||||
}
|
||||
|
||||
// msMKTypLib
|
||||
// Internal (to example) tool used for converting from ODL to TLB files.
|
||||
if (!ts->ToolFind( ::msMkTypLib ) )
|
||||
{
|
||||
ToolInfo toolInfo;
|
||||
|
||||
toolInfo.toolType = Transfer;
|
||||
toolInfo.name = ::msMkTypLib;
|
||||
toolInfo.path = "mktyplib.exe";
|
||||
toolInfo.flags = ToolFlags(0);
|
||||
toolInfo.menuName = 0;
|
||||
toolInfo.helpHint = 0;
|
||||
toolInfo.defCmdLine = "/W0 /nocpp /nologo /tlb $OUTNAME tlbt@@@.tm~ ";
|
||||
toolInfo.translateFrom = 0;
|
||||
toolInfo.defaultFor = 0;
|
||||
toolInfo.translateTo = 0;
|
||||
toolInfo.launchId = DEFAULT_LAUNCH_ID;
|
||||
|
||||
ts->ToolAdd( &toolInfo );
|
||||
}
|
||||
|
||||
// oleRegister
|
||||
// Internal (to example) tool used to invoke register.exe
|
||||
if ( !ts->ToolFind( oleRegister ) )
|
||||
{
|
||||
ToolInfo toolInfo;
|
||||
|
||||
toolInfo.toolType = Transfer;
|
||||
toolInfo.name = ::oleRegister;
|
||||
toolInfo.path = "register.exe";
|
||||
toolInfo.flags = ToolFlags(0);
|
||||
toolInfo.menuName = 0;
|
||||
toolInfo.helpHint = 0;
|
||||
toolInfo.defCmdLine = 0;
|
||||
toolInfo.translateFrom = 0;
|
||||
toolInfo.defaultFor = 0;
|
||||
toolInfo.translateTo = 0;
|
||||
toolInfo.launchId = DEFAULT_LAUNCH_ID;
|
||||
|
||||
ts->ToolAdd( &toolInfo );
|
||||
}
|
||||
|
||||
// extractAndBindTLB
|
||||
// Create .tlb from .exe/.dll bind .tlb back into .dll/.exe
|
||||
if ( !ts->ToolFind( ::extractAndBindTLB ) )
|
||||
{
|
||||
ToolInfo toolInfo;
|
||||
|
||||
toolInfo.toolType = Translator;
|
||||
toolInfo.name = ::extractAndBindTLB;
|
||||
toolInfo.path = 0;
|
||||
toolInfo.flags = TargetTranslator | OnLocalMenu;
|
||||
toolInfo.menuName = "OLE Bind TypeLib";
|
||||
toolInfo.helpHint = "Extract Typelibrary and re-link target with .tlb";
|
||||
toolInfo.defCmdLine = "$TARGET";
|
||||
toolInfo.translateFrom = ".dll;.exe;AppExpert;AppExpertDLL;";
|
||||
toolInfo.defaultFor = 0;
|
||||
toolInfo.translateTo = 0;
|
||||
toolInfo.launchId = CALLBACK_LAUNCH_ID;
|
||||
|
||||
ts->ToolAdd( &toolInfo );
|
||||
}
|
||||
|
||||
// oleExtractTLB
|
||||
// Extract TypeLib Information
|
||||
if ( !ts->ToolFind( ::oleExtractTLB) )
|
||||
{
|
||||
ToolInfo toolInfo;
|
||||
|
||||
toolInfo.toolType = Translator;
|
||||
toolInfo.name = ::oleExtractTLB;
|
||||
toolInfo.path = "register.exe";
|
||||
toolInfo.flags = OnLocalMenu;
|
||||
toolInfo.menuName = "OLE Extract TypeLib";
|
||||
toolInfo.helpHint = "Extract automation type library from module";
|
||||
toolInfo.defCmdLine = "$TARGET -TypeLib=$NAME($TARGET).olb";
|
||||
toolInfo.translateFrom = ".exe;.dll;AppExpert;AppExpertDLL;";
|
||||
toolInfo.defaultFor = 0;
|
||||
toolInfo.translateTo = ".olb";
|
||||
toolInfo.launchId = DEFAULT_LAUNCH_ID;
|
||||
|
||||
ts->ToolAdd( &toolInfo );
|
||||
}
|
||||
|
||||
// oleExtractReg
|
||||
// Create a .reg file from .exe/.dll
|
||||
if ( !ts->ToolFind( ::oleExtractReg) )
|
||||
{
|
||||
ToolInfo toolInfo;
|
||||
|
||||
toolInfo.toolType = Translator;
|
||||
toolInfo.name = ::oleExtractReg;
|
||||
toolInfo.path = "register.exe";
|
||||
toolInfo.flags = OnLocalMenu;
|
||||
toolInfo.menuName = "OLE Extract Register";
|
||||
toolInfo.helpHint = "Extract Registry database script from module";
|
||||
toolInfo.defCmdLine = "$TARGET -RegServer=$NAME($TARGET).reg";
|
||||
toolInfo.translateFrom = ".exe;.dll;AppExpert;AppExpertDLL;";
|
||||
toolInfo.defaultFor = 0;
|
||||
toolInfo.translateTo = ".reg";
|
||||
toolInfo.launchId = DEFAULT_LAUNCH_ID;
|
||||
|
||||
ts->ToolAdd( &toolInfo );
|
||||
}
|
||||
|
||||
// oleRegEditAdvanced
|
||||
// Tools Menu option to invoke regedit with /v parameter.
|
||||
if ( !ts->ToolFind(::oleRegEditAdvanced))
|
||||
{
|
||||
ToolInfo toolInfo;
|
||||
|
||||
toolInfo.toolType = Transfer;
|
||||
toolInfo.name = ::oleRegEditAdvanced;
|
||||
toolInfo.path = "RegEdit.exe";
|
||||
toolInfo.flags = OnToolsMenu | OnLocalMenu;
|
||||
toolInfo.menuName = "OLE RegEdit Advanced";
|
||||
toolInfo.helpHint = "Invoke RegEdit using advanced display";
|
||||
toolInfo.defCmdLine = "/v";
|
||||
toolInfo.translateFrom = 0;
|
||||
toolInfo.defaultFor = 0;
|
||||
toolInfo.translateTo = 0;
|
||||
toolInfo.launchId = DEFAULT_LAUNCH_ID;
|
||||
|
||||
ts->ToolAdd( &toolInfo );
|
||||
}
|
||||
|
||||
// generateAndAddSource
|
||||
// Create nodes (.cxx [.cpp] /.hxx [.h] ) in your target from .exe/.dll
|
||||
if ( !ts->ToolFind(::generateAndAddSource))
|
||||
{
|
||||
ToolInfo toolInfo;
|
||||
|
||||
toolInfo.toolType = Translator;
|
||||
toolInfo.name = ::generateAndAddSource;
|
||||
toolInfo.path = 0;
|
||||
toolInfo.flags = OnLocalMenu;
|
||||
toolInfo.menuName = "OLE Generate Source";
|
||||
toolInfo.helpHint = "Generate class interface source";
|
||||
toolInfo.defCmdLine = 0;
|
||||
toolInfo.translateFrom = ".exe;.dll;AppExpert;AppExpertDLL;";
|
||||
toolInfo.defaultFor = 0;
|
||||
toolInfo.translateTo = 0;
|
||||
toolInfo.launchId = CALLBACK_LAUNCH_ID;
|
||||
|
||||
ts->ToolAdd( &toolInfo );
|
||||
}
|
||||
|
||||
// oleAutoGen
|
||||
// Internal (to example) tool used to invoke Autogen.
|
||||
if ( !ts->ToolFind( ::oleAutoGen ) )
|
||||
{
|
||||
ToolInfo toolInfo;
|
||||
|
||||
toolInfo.toolType = Transfer;
|
||||
toolInfo.name = ::oleAutoGen;
|
||||
toolInfo.path = "autogen.exe";
|
||||
toolInfo.flags = ToolFlags(0);
|
||||
toolInfo.menuName = 0;
|
||||
toolInfo.helpHint = 0;
|
||||
toolInfo.defCmdLine = 0;
|
||||
toolInfo.translateFrom = 0;
|
||||
toolInfo.defaultFor = 0;
|
||||
toolInfo.translateTo = 0;
|
||||
toolInfo.launchId = DEFAULT_LAUNCH_ID;
|
||||
|
||||
ts->ToolAdd( &toolInfo );
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
// LocalProjectClient::CloseNotify, forced pure virtual implementation.
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
void _HOOKEP
|
||||
LocalProjClient::CloseNotify()
|
||||
{
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// LocalProjectClient::NodeDeleteNotify, forced pure virtual implementation.
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
void _HOOKEP
|
||||
LocalProjClient::NodeDeleteNotify(ProjectNode)
|
||||
{
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////
|
||||
// LocalProjectClient::DependencyQueryResponder, forced pure virtual implementation.
|
||||
////////////////////////////////////////////////////////////////////////////////////
|
||||
void _HOOKEP
|
||||
LocalProjClient::DependencyQueryResponder(ProjectNode ,const char *)
|
||||
{
|
||||
}
|
||||
|
||||
// End of file
|
||||
@@ -0,0 +1,13 @@
|
||||
LIBRARY OLETOOLS
|
||||
DESCRIPTION 'Common tools used in OLE development'
|
||||
EXETYPE WINDOWS
|
||||
CODE LOADONCALL MOVEABLE DISCARDABLE
|
||||
DATA PRELOAD MOVEABLE SINGLE
|
||||
HEAPSIZE 4096
|
||||
SEGMENTS
|
||||
_TEXT PRELOAD MOVEABLE
|
||||
|
||||
EXPORTS
|
||||
WEP @1 RESIDENTNAME
|
||||
IDELIBMAIN @2
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,280 @@
|
||||
//----------------------------------------------------------------------------
|
||||
// IdeHook - (C) Copyright 1994 by Borland International
|
||||
//----------------------------------------------------------------------------
|
||||
#pragma hdrstop
|
||||
#include <string.h>
|
||||
#include <dos.h>
|
||||
#include <commdlg.h>
|
||||
#include "pathspec.h"
|
||||
|
||||
|
||||
// //
|
||||
// class PathSpec implementation //
|
||||
// //
|
||||
|
||||
int
|
||||
PathSpec::split()
|
||||
{
|
||||
return( _flags = ::fnsplit( _path, _drive, _dir, _file, _ext ) );
|
||||
}
|
||||
|
||||
void
|
||||
PathSpec::merge()
|
||||
{
|
||||
::fnmerge( _path, _drive, _dir, _file, _ext );
|
||||
}
|
||||
|
||||
void
|
||||
PathSpec::path(const char *path)
|
||||
{
|
||||
strcpy( _path, path );
|
||||
split();
|
||||
}
|
||||
|
||||
void
|
||||
PathSpec::drive(const char *drive)
|
||||
{
|
||||
strcpy( _drive, drive );
|
||||
merge();
|
||||
}
|
||||
|
||||
void
|
||||
PathSpec::dir(const char *dir)
|
||||
{
|
||||
strcpy( _dir, dir );
|
||||
merge();
|
||||
}
|
||||
|
||||
void
|
||||
PathSpec::file(const char *file)
|
||||
{
|
||||
strcpy( _file, file );
|
||||
merge();
|
||||
}
|
||||
|
||||
void
|
||||
PathSpec::ext(const char *ext)
|
||||
{
|
||||
strcpy( _ext, ext );
|
||||
merge();
|
||||
}
|
||||
|
||||
void
|
||||
PathSpec::fileext( const char *fileExt )
|
||||
{
|
||||
char * p = (char *)(strchr(fileExt,'.'));
|
||||
|
||||
if( !p )
|
||||
p = "";
|
||||
|
||||
ext( p );
|
||||
*p = 0;
|
||||
|
||||
file( fileExt );
|
||||
}
|
||||
|
||||
int
|
||||
PathSpec::first()
|
||||
{
|
||||
if( ::findfirst( _path, &_dta, 0 ) == -1 )
|
||||
return(0);
|
||||
|
||||
fileext( _dta.ff_name );
|
||||
return( 1 );
|
||||
}
|
||||
|
||||
int
|
||||
PathSpec::next()
|
||||
{
|
||||
if( ::findnext( &_dta ) == -1 )
|
||||
return( 0 );
|
||||
|
||||
fileext( _dta.ff_name );
|
||||
return( 1 );
|
||||
}
|
||||
|
||||
int
|
||||
PathSpec::sameDrive( PathSpec & other )
|
||||
{
|
||||
if( *_drive == *other._drive )
|
||||
return(1);
|
||||
|
||||
if( !*_drive )
|
||||
{
|
||||
_drive[0] = ::getdisk() + 'A' - 1;
|
||||
_drive[1] = ':';
|
||||
_drive[2] = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( !*other._drive )
|
||||
{
|
||||
other._drive[0] = ::getdisk() + 'A' - 1;
|
||||
other._drive[1] = ':';
|
||||
other._drive[2] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
char s[3];
|
||||
|
||||
s[0] = *_drive;
|
||||
s[1] = *other._drive;
|
||||
s[2] = 0;
|
||||
|
||||
strlwr( s );
|
||||
|
||||
return( s[0] == s[1] );
|
||||
}
|
||||
|
||||
int
|
||||
PathSpec::isDirectory()
|
||||
{
|
||||
int lastCharPos = strlen( _path ) - 1;
|
||||
|
||||
char lastChar;
|
||||
|
||||
if(((lastChar = _path[lastCharPos]) == '\\') || (lastChar == '/'))
|
||||
_path[lastCharPos] = 0;
|
||||
|
||||
int ret = (::findfirst( _path, &_dta, FA_DIREC ) != -1 ) &&
|
||||
( _dta.ff_attrib & FA_DIREC );
|
||||
|
||||
_path[ lastCharPos ] = lastChar;
|
||||
|
||||
return( ret );
|
||||
}
|
||||
|
||||
char *
|
||||
PathSpec::stripTrailingSlash()
|
||||
{
|
||||
int lastCharPos = strlen( _path ) - 1;
|
||||
|
||||
if( (_path[lastCharPos] == '\\') || (_path[lastCharPos] == '/') )
|
||||
_path[lastCharPos] = 0;
|
||||
|
||||
return( _path );
|
||||
}
|
||||
|
||||
void
|
||||
PathSpec::addTrailingSlash()
|
||||
{
|
||||
int lastCharPos = strlen( _path ) - 1;
|
||||
|
||||
if( (_path[lastCharPos] != '\\') && (_path[lastCharPos] != '/') )
|
||||
{
|
||||
strcat( _path, "\\" );
|
||||
split();
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
PathSpec::newFileDialog
|
||||
(
|
||||
const char * filter,
|
||||
const char * initialDir,
|
||||
unsigned long hwndParent
|
||||
)
|
||||
{
|
||||
return(
|
||||
fileDialog
|
||||
(
|
||||
filter,
|
||||
initialDir,
|
||||
hwndParent,
|
||||
OFN_HIDEREADONLY |
|
||||
OFN_PATHMUSTEXIST
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
int
|
||||
PathSpec::openFileDialog
|
||||
(
|
||||
const char * filter,
|
||||
const char * initialDir,
|
||||
unsigned long hwndParent
|
||||
)
|
||||
{
|
||||
return(
|
||||
fileDialog
|
||||
(
|
||||
filter,
|
||||
initialDir,
|
||||
hwndParent,
|
||||
OFN_HIDEREADONLY |
|
||||
OFN_PATHMUSTEXIST |
|
||||
OFN_FILEMUSTEXIST
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
int
|
||||
PathSpec::fileDialog
|
||||
(
|
||||
const char * filter,
|
||||
const char * initialDir,
|
||||
unsigned long hwndParent,
|
||||
unsigned long flags
|
||||
)
|
||||
{
|
||||
char szFile[256];
|
||||
char *szFilter;
|
||||
|
||||
strcpy( szFile, file() );
|
||||
if( *szFile )
|
||||
strcat( szFile, ext() );
|
||||
|
||||
if( !filter )
|
||||
filter = "All files (*.*)|(*.*)|";
|
||||
szFilter = new char[ strlen(filter) + 1 ];
|
||||
strcpy( szFilter, filter );
|
||||
|
||||
for ( unsigned short i = 0; szFilter[i] != 0; i++)
|
||||
{
|
||||
if (szFilter[i] == '|' )
|
||||
szFilter[i] = 0;
|
||||
}
|
||||
|
||||
/* Set all structure members to zero. */
|
||||
|
||||
OPENFILENAME ofn;
|
||||
|
||||
memset( &ofn, 0, sizeof(ofn) );
|
||||
|
||||
ofn.lStructSize = sizeof(OPENFILENAME);
|
||||
ofn.hwndOwner = (HWND)(hwndParent);
|
||||
ofn.lpstrFilter = szFilter;
|
||||
ofn.nFilterIndex = 1;
|
||||
ofn.lpstrFile = szFile;
|
||||
ofn.nMaxFile = sizeof(szFile);
|
||||
ofn.lpstrInitialDir = initialDir;
|
||||
ofn.Flags = flags;
|
||||
|
||||
|
||||
int ret;
|
||||
|
||||
if ( (ret = GetOpenFileName(&ofn)) == 0 )
|
||||
{
|
||||
DWORD Errval = ::CommDlgExtendedError();
|
||||
|
||||
if (Errval != 0) // 0 value means user selected Cancel
|
||||
{
|
||||
char szErr[80];
|
||||
|
||||
wsprintf( szErr, "GetOpenFile error: %ld", Errval );
|
||||
::MessageBox( ::GetActiveWindow(),szErr,"OpenFile",
|
||||
MB_ICONEXCLAMATION | MB_OK );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
path( ofn.lpstrFile );
|
||||
}
|
||||
|
||||
delete szFilter;
|
||||
|
||||
return( ret );
|
||||
}
|
||||
|
||||
// End of file
|
||||
|
||||
@@ -0,0 +1,176 @@
|
||||
//----------------------------------------------------------------------------
|
||||
// IdeHook - (C) Copyright 1994 by Borland International
|
||||
//----------------------------------------------------------------------------
|
||||
#ifndef __PATHSPEC_H
|
||||
#define __PATHSPEC_H
|
||||
|
||||
#ifndef __DIR_H
|
||||
# include <dir.h>
|
||||
#endif
|
||||
|
||||
// //
|
||||
// class PathSpec for manipulation file paths //
|
||||
// //
|
||||
|
||||
class PathSpec
|
||||
{
|
||||
public:
|
||||
// ctor //
|
||||
|
||||
PathSpec( const char * = "" );
|
||||
|
||||
// accessors //
|
||||
|
||||
const char * path();
|
||||
const char * drive();
|
||||
const char * dir();
|
||||
const char * file();
|
||||
const char * ext();
|
||||
|
||||
void path(const char *);
|
||||
void drive(const char *);
|
||||
void dir(const char *);
|
||||
void file(const char *);
|
||||
void ext(const char *);
|
||||
void fileext( const char * );
|
||||
|
||||
long age();
|
||||
|
||||
// flags() returns FILENAME, WILDCARDS etc. flags found in dir.h //
|
||||
|
||||
int flags();
|
||||
|
||||
// explicit splitter/merger //
|
||||
|
||||
int split();
|
||||
void merge();
|
||||
|
||||
// disk manipulation and polling //
|
||||
|
||||
int exists();
|
||||
int first();
|
||||
int next();
|
||||
|
||||
// Are this and another PathSpec referring to the same drive? //
|
||||
|
||||
int sameDrive( PathSpec & );
|
||||
|
||||
// Is this PathSpec really representing a directory? //
|
||||
|
||||
int isDirectory();
|
||||
|
||||
void addTrailingSlash();
|
||||
|
||||
// Strip the trailing slash from the path() element and return //
|
||||
// the path(). (Calling this invalidates the use dir(), file() //
|
||||
// and ext()). //
|
||||
|
||||
char * stripTrailingSlash();
|
||||
|
||||
// //
|
||||
// Do a FileOpen dialog on this pathSpec... //
|
||||
// 'filter' should use the pipe character ('|')//
|
||||
// as a separator //
|
||||
// (e.g. "All files (*.*)|*.*|") //
|
||||
// NOTE: In this implementation 'hwndParent' //
|
||||
// is a Windows' HWND. //
|
||||
// //
|
||||
|
||||
int openFileDialog
|
||||
(
|
||||
const char * filter = 0,
|
||||
const char * initialDir = 0,
|
||||
unsigned long hwndParent = 0
|
||||
);
|
||||
|
||||
int newFileDialog
|
||||
(
|
||||
const char * filter = 0,
|
||||
const char * initialDir = 0,
|
||||
unsigned long hwndParent = 0
|
||||
);
|
||||
|
||||
int fileDialog
|
||||
(
|
||||
const char * filter = 0,
|
||||
const char * initialDir = 0,
|
||||
unsigned long hwndParent = 0,
|
||||
unsigned long flags = 0
|
||||
);
|
||||
private:
|
||||
|
||||
char _path [ MAXPATH ];
|
||||
char _drive[ MAXDRIVE ];
|
||||
char _dir [ MAXDIR ];
|
||||
char _file [ MAXFILE ];
|
||||
char _ext [ MAXEXT ];
|
||||
int _flags;
|
||||
|
||||
struct ffblk _dta;
|
||||
};
|
||||
|
||||
inline
|
||||
PathSpec::PathSpec( const char * apath )
|
||||
{
|
||||
path( apath );
|
||||
}
|
||||
|
||||
inline const char *
|
||||
PathSpec::path()
|
||||
{
|
||||
return( _path );
|
||||
}
|
||||
|
||||
inline const char *
|
||||
PathSpec::drive()
|
||||
{
|
||||
return( _drive );
|
||||
}
|
||||
|
||||
inline const char *
|
||||
PathSpec::dir()
|
||||
{
|
||||
return( _dir );
|
||||
}
|
||||
|
||||
inline const char *
|
||||
PathSpec::file()
|
||||
{
|
||||
return( _file );
|
||||
}
|
||||
|
||||
inline const char *
|
||||
PathSpec::ext()
|
||||
{
|
||||
return( _ext );
|
||||
}
|
||||
|
||||
inline int
|
||||
PathSpec::flags()
|
||||
{
|
||||
return( _flags );
|
||||
}
|
||||
|
||||
inline int
|
||||
PathSpec::exists()
|
||||
{
|
||||
return( first() );
|
||||
}
|
||||
|
||||
inline long
|
||||
PathSpec::age()
|
||||
{
|
||||
if( exists() )
|
||||
{
|
||||
unsigned long date = _dta.ff_fdate;
|
||||
unsigned long time = _dta.ff_ftime;
|
||||
|
||||
return( (long)( (date << 16) | time ) );
|
||||
}
|
||||
return( -1L );
|
||||
}
|
||||
|
||||
#endif __PATHSPEC_H
|
||||
|
||||
// End of file
|
||||
|
||||
@@ -0,0 +1,193 @@
|
||||
//----------------------------------------------------------------------------
|
||||
// IdeHook - (C) Copyright 1994 by Borland International
|
||||
//----------------------------------------------------------------------------
|
||||
#pragma hdrstop
|
||||
|
||||
#include "idehook.h"
|
||||
#include "pathspec.h"
|
||||
#include <string.h>
|
||||
|
||||
static char realCppCompileName[] = "CppCompile";
|
||||
static char sectionCppCompileName[] = "SectionCppCompile";
|
||||
|
||||
|
||||
class _HOOKCLASS LocalToolClient : public ToolClient
|
||||
{
|
||||
public:
|
||||
ToolReturn _HOOKEP RunSectionCompiler( ToolInvokeArgs * );
|
||||
|
||||
void RegisterMyCallBacks( ToolServer * );
|
||||
|
||||
private:
|
||||
|
||||
int registered;
|
||||
static ToolRegisterPack entryPoints[];
|
||||
|
||||
};
|
||||
|
||||
static LocalToolClient localToolClient;
|
||||
|
||||
ToolRegisterPack LocalToolClient::entryPoints[] =
|
||||
{
|
||||
{ sectionCppCompileName, (ToolMethod)&LocalToolClient::RunSectionCompiler },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
void
|
||||
LocalToolClient::RegisterMyCallBacks( ToolServer * ts )
|
||||
{
|
||||
if( !registered )
|
||||
{
|
||||
registered = 1;
|
||||
ts->ToolRegisterImplementor( this, entryPoints );
|
||||
}
|
||||
}
|
||||
|
||||
ToolReturn _HOOKEP
|
||||
LocalToolClient::RunSectionCompiler( ToolInvokeArgs * args )
|
||||
{
|
||||
ProjectNode node = args->numNodes ? *args->nodeArray : 0;
|
||||
|
||||
if( node )
|
||||
{
|
||||
OptionSetReq optSetServer;
|
||||
const char * defines;
|
||||
|
||||
optSetServer->OptionGet( node, OID_Defines, defines );
|
||||
|
||||
const char * pSectionText;
|
||||
static char szSection[] = "SECTION=";
|
||||
|
||||
if( (pSectionText = strstr( defines, szSection)) != 0 )
|
||||
{
|
||||
ProjectNodeInfo nodeInfo;
|
||||
ProjectReq projectServer;
|
||||
|
||||
projectServer->QueryNodeInfo( node, nodeInfo );
|
||||
|
||||
PathSpec outPath( nodeInfo.outputLocation );
|
||||
|
||||
char newName[ MAXFILE + 2 ];
|
||||
|
||||
strcpy( newName, outPath.file() );
|
||||
|
||||
int numberIndex = strlen(newName);
|
||||
|
||||
if( numberIndex == 8 )
|
||||
--numberIndex;
|
||||
|
||||
newName[ numberIndex++ ] = *(pSectionText + (sizeof(szSection)-1));
|
||||
newName[ numberIndex ] = 0;
|
||||
|
||||
outPath.file( newName );
|
||||
|
||||
optSetServer->OptionApply( node, OID_Intermediate, outPath.path() );
|
||||
|
||||
}
|
||||
|
||||
ToolReq server;
|
||||
ToolObj realCompiler = server->ToolFind( realCppCompileName );
|
||||
|
||||
return( server->ToolInvoke( realCompiler, node ) );
|
||||
|
||||
}
|
||||
|
||||
return( NotHandled );
|
||||
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Project stuff
|
||||
//
|
||||
|
||||
class _HOOKCLASS LocalProjClient : public ProjectClient
|
||||
{
|
||||
public:
|
||||
LocalProjClient();
|
||||
|
||||
virtual void _HOOKEP OpenNotify
|
||||
(
|
||||
const char * name
|
||||
);
|
||||
|
||||
virtual void _HOOKEP CloseNotify();
|
||||
|
||||
virtual void _HOOKEP NodeDeleteNotify
|
||||
(
|
||||
ProjectNode
|
||||
);
|
||||
|
||||
virtual void _HOOKEP DependencyQueryResponder
|
||||
(
|
||||
ProjectNode ,
|
||||
const char *
|
||||
);
|
||||
|
||||
};
|
||||
|
||||
static LocalProjClient LocalProjClient;
|
||||
|
||||
LocalProjClient::LocalProjClient()
|
||||
{
|
||||
ProjectReq ps;
|
||||
|
||||
ps->RegisterProjectClient(this);
|
||||
}
|
||||
|
||||
|
||||
void _HOOKEP
|
||||
LocalProjClient::OpenNotify
|
||||
(
|
||||
const char * // name
|
||||
)
|
||||
{
|
||||
ToolReq ts;
|
||||
|
||||
localToolClient.RegisterMyCallBacks( ts );
|
||||
|
||||
if( !ts->ToolFind( sectionCppCompileName ) )
|
||||
{
|
||||
ToolObj realCppCompiler;
|
||||
|
||||
if( (realCppCompiler = ts->ToolFind( realCppCompileName )) != 0 )
|
||||
{
|
||||
ToolInfo toolInfo;
|
||||
|
||||
ts->QueryToolInfo( realCppCompiler, toolInfo );
|
||||
|
||||
toolInfo.name = sectionCppCompileName;
|
||||
toolInfo.menuName = "&Section Compiler";
|
||||
toolInfo.helpHint = "Munge outname of node then C++ Compile";
|
||||
toolInfo.launchId = CALLBACK_LAUNCH_ID;
|
||||
|
||||
ts->ToolAdd( &toolInfo );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void _HOOKEP
|
||||
LocalProjClient::CloseNotify()
|
||||
{
|
||||
}
|
||||
|
||||
void _HOOKEP
|
||||
LocalProjClient::NodeDeleteNotify
|
||||
(
|
||||
ProjectNode
|
||||
)
|
||||
{
|
||||
}
|
||||
|
||||
void _HOOKEP
|
||||
LocalProjClient::DependencyQueryResponder
|
||||
(
|
||||
ProjectNode ,
|
||||
const char *
|
||||
)
|
||||
{
|
||||
}
|
||||
|
||||
// End of file
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
LIBRARY SECTCOMP
|
||||
DESCRIPTION 'Frank Borland'
|
||||
EXETYPE WINDOWS
|
||||
CODE LOADONCALL MOVEABLE DISCARDABLE
|
||||
DATA PRELOAD MOVEABLE SINGLE
|
||||
HEAPSIZE 4096
|
||||
SEGMENTS
|
||||
_TEXT PRELOAD MOVEABLE
|
||||
|
||||
EXPORTS
|
||||
WEP @1 RESIDENTNAME
|
||||
IDELIBMAIN @2
|
||||
|
||||
@@ -0,0 +1,204 @@
|
||||
//----------------------------------------------------------------------------
|
||||
// IdeHook - (C) Copyright 1994 by Borland International
|
||||
//----------------------------------------------------------------------------
|
||||
#pragma hdrstop
|
||||
|
||||
#include "idehook.h"
|
||||
#include "pathspec.h"
|
||||
#include <string.h>
|
||||
#include <windows.h>
|
||||
|
||||
static char targetExeSnipName[] = "TargetExeSnippets";
|
||||
static char targetDllSnipName[] = "TargetDllSnippets";
|
||||
|
||||
#define CRLF "\n"
|
||||
|
||||
static char szExeWinMain[] =
|
||||
"//" CRLF
|
||||
"// This is the WinMain snippet" CRLF
|
||||
"//" CRLF
|
||||
"#include <windows.h>" CRLF
|
||||
CRLF
|
||||
"int WINAPI WinMain" CRLF
|
||||
"(" CRLF
|
||||
" HINSTANCE /* hInstance */," CRLF
|
||||
" HINSTANCE /* hPrevInstance */, " CRLF
|
||||
" LPSTR /* lpCmdLine */," CRLF
|
||||
" int /* howShow */" CRLF
|
||||
")" CRLF
|
||||
"{" CRLF
|
||||
" return(0);" CRLF
|
||||
"}" CRLF
|
||||
;
|
||||
|
||||
static char szExeOwlMain[] =
|
||||
"//" CRLF
|
||||
"// This is the OwlMain snippet" CRLF
|
||||
"//" CRLF
|
||||
"#include <owl/applicat.h>" CRLF
|
||||
CRLF
|
||||
"int OwlMain( int /* argc */ , char ** /* argv */ )" CRLF
|
||||
"{" CRLF
|
||||
" return( TApplication().Run() );" CRLF
|
||||
"}" CRLF
|
||||
;
|
||||
|
||||
static char szExeDefSnip[] =
|
||||
"EXETYPE WINDOWS" CRLF
|
||||
"CODE PRELOAD MOVEABLE DISCARDABLE" CRLF
|
||||
"DATA PRELOAD MOVEABLE MULTIPLE" CRLF
|
||||
"HEAPSIZE 4096" CRLF
|
||||
"STACKSIZE 8192" CRLF
|
||||
;
|
||||
|
||||
class _HOOKCLASS LocalToolClient : public ToolClient
|
||||
{
|
||||
public:
|
||||
ToolReturn _HOOKEP RunTargetExeSnips( ToolInvokeArgs * );
|
||||
ToolReturn _HOOKEP RunTargetDllSnips( ToolInvokeArgs * );
|
||||
|
||||
void RegisterMyCallBacks( ToolServer * );
|
||||
|
||||
private:
|
||||
int registered;
|
||||
static ToolRegisterPack entryPoints[];
|
||||
|
||||
};
|
||||
|
||||
static LocalToolClient localToolClient;
|
||||
|
||||
ToolRegisterPack LocalToolClient::entryPoints[] =
|
||||
{
|
||||
{ targetExeSnipName, (ToolMethod)&LocalToolClient::RunTargetExeSnips },
|
||||
// { targetDllSnipName, (ToolMethod)&LocalToolClient::RunTargetDllSnips },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
void
|
||||
LocalToolClient::RegisterMyCallBacks( ToolServer * ts )
|
||||
{
|
||||
if( !registered )
|
||||
{
|
||||
registered = 1;
|
||||
ts->ToolRegisterImplementor( this, entryPoints );
|
||||
}
|
||||
}
|
||||
|
||||
ToolReturn _HOOKEP
|
||||
LocalToolClient::RunTargetExeSnips( ToolInvokeArgs * args )
|
||||
{
|
||||
ToolReq server;
|
||||
|
||||
ProjectNode node = args->numNodes ? *args->nodeArray : 0;
|
||||
|
||||
if( node )
|
||||
{
|
||||
ProjectNodeInfo nodeInfo;
|
||||
ProjectReq project;
|
||||
PathSpec nodePath;
|
||||
EditorReq editor;
|
||||
|
||||
project->QueryNodeInfo( node, nodeInfo );
|
||||
|
||||
nodePath.path( nodeInfo.outputLocation );
|
||||
|
||||
// //
|
||||
// Do the [.cpp] main source node //
|
||||
// //
|
||||
|
||||
nodePath.ext( ".cpp" );
|
||||
|
||||
project->NodeAdd( node, nodePath.path() );
|
||||
|
||||
editor->set_buffer( editor->create_buffer( 0,
|
||||
(char *)nodePath.path(),
|
||||
0 ) );
|
||||
|
||||
TargetExpertReq targetExpert;
|
||||
|
||||
const char * mainSnip;
|
||||
|
||||
if( targetExpert->QuerySupports( node, 0, OWL, 0 ) )
|
||||
mainSnip = szExeOwlMain;
|
||||
else
|
||||
mainSnip = szExeWinMain;
|
||||
|
||||
editor->insert( (char *)mainSnip );
|
||||
|
||||
editor->show_buffer();
|
||||
|
||||
// //
|
||||
// Do the [.def] main source node //
|
||||
// //
|
||||
|
||||
nodePath.ext( ".def" );
|
||||
project->NodeAdd( node, nodePath.path() );
|
||||
editor->set_buffer( editor->create_buffer( 0,
|
||||
(char *)nodePath.path(),
|
||||
0 ) );
|
||||
editor->insert( szExeDefSnip );
|
||||
}
|
||||
|
||||
return( Success );
|
||||
|
||||
}
|
||||
|
||||
// //
|
||||
// Project stuff //
|
||||
// //
|
||||
|
||||
class _HOOKCLASS LocalProjClient : public ProjectClient
|
||||
{
|
||||
public:
|
||||
LocalProjClient();
|
||||
|
||||
virtual void _HOOKEP OpenNotify( const char * name );
|
||||
virtual void _HOOKEP CloseNotify() {}
|
||||
virtual void _HOOKEP NodeDeleteNotify( ProjectNode ) {}
|
||||
virtual void _HOOKEP DependencyQueryResponder(ProjectNode,const char *) {}
|
||||
|
||||
};
|
||||
|
||||
static LocalProjClient LocalProjClient;
|
||||
|
||||
LocalProjClient::LocalProjClient()
|
||||
{
|
||||
ProjectReq ps;
|
||||
|
||||
ps->RegisterProjectClient(this);
|
||||
}
|
||||
|
||||
|
||||
void _HOOKEP
|
||||
LocalProjClient::OpenNotify
|
||||
(
|
||||
const char * // name
|
||||
)
|
||||
{
|
||||
ToolReq ts;
|
||||
|
||||
localToolClient.RegisterMyCallBacks( ts );
|
||||
|
||||
if( !ts->ToolFind( targetExeSnipName ) )
|
||||
{
|
||||
ToolInfo toolInfo;
|
||||
|
||||
toolInfo.toolType = Viewer;
|
||||
toolInfo.name = targetExeSnipName;
|
||||
toolInfo.path = 0;
|
||||
toolInfo.flags = OnLocalMenu;
|
||||
toolInfo.menuName = "&Target snippets";
|
||||
toolInfo.helpHint = "Generate a skeleton for a target";
|
||||
toolInfo.defCmdLine = 0;
|
||||
toolInfo.appliesTo = ".exe;";
|
||||
toolInfo.defaultFor = 0;
|
||||
toolInfo.translateTo = 0;
|
||||
toolInfo.launchId = CALLBACK_LAUNCH_ID;
|
||||
|
||||
ts->ToolAdd( &toolInfo );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// End of file
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
LIBRARY trgsnps
|
||||
DESCRIPTION 'Frank Borland'
|
||||
EXETYPE WINDOWS
|
||||
CODE LOADONCALL MOVEABLE DISCARDABLE
|
||||
DATA PRELOAD MOVEABLE SINGLE
|
||||
HEAPSIZE 4096
|
||||
SEGMENTS
|
||||
_TEXT PRELOAD MOVEABLE
|
||||
|
||||
EXPORTS
|
||||
WEP @1 RESIDENTNAME
|
||||
IDELIBMAIN @2
|
||||
|
||||
@@ -0,0 +1,182 @@
|
||||
//----------------------------------------------------------------------------
|
||||
// IdeHook - (C) Copyright 1994 by Borland International
|
||||
//----------------------------------------------------------------------------
|
||||
#pragma hdrstop
|
||||
|
||||
#include "idehook.h"
|
||||
#include <string.h>
|
||||
|
||||
static char wipeOptsName[] = "OptionsWiper";
|
||||
|
||||
|
||||
class _HOOKCLASS LocalToolClient : public ToolClient
|
||||
{
|
||||
public:
|
||||
ToolReturn _HOOKEP RunOptionWiper( ToolInvokeArgs * );
|
||||
|
||||
void RegisterMyCallBacks( ToolServer * );
|
||||
|
||||
private:
|
||||
|
||||
void WipeNodeOptions( ProjectNode, ProjectServer *, OptionSetServer * );
|
||||
|
||||
int registered;
|
||||
static ToolRegisterPack entryPoints[];
|
||||
|
||||
};
|
||||
|
||||
static LocalToolClient localToolClient;
|
||||
|
||||
ToolRegisterPack LocalToolClient::entryPoints[] =
|
||||
{
|
||||
{ wipeOptsName, (ToolMethod)&LocalToolClient::RunOptionWiper },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
void
|
||||
LocalToolClient::RegisterMyCallBacks( ToolServer * ts )
|
||||
{
|
||||
if( !registered )
|
||||
{
|
||||
registered = 1;
|
||||
ts->ToolRegisterImplementor( this, entryPoints );
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
LocalToolClient::WipeNodeOptions
|
||||
(
|
||||
ProjectNode node,
|
||||
ProjectServer * projectServer,
|
||||
OptionSetServer * optSetServer
|
||||
)
|
||||
{
|
||||
optSetServer->OptionRemove( node, OID_RemoveAll );
|
||||
|
||||
ProjectNodeInfo nodeInfo;
|
||||
|
||||
projectServer->QueryNodeInfo( node, nodeInfo );
|
||||
|
||||
node = nodeInfo.firstChild;
|
||||
|
||||
while( node )
|
||||
{
|
||||
WipeNodeOptions( node, projectServer, optSetServer );
|
||||
|
||||
projectServer->QueryNodeInfo( node, nodeInfo );
|
||||
|
||||
node = nodeInfo.nextSibling;
|
||||
}
|
||||
}
|
||||
|
||||
ToolReturn _HOOKEP
|
||||
LocalToolClient::RunOptionWiper( ToolInvokeArgs * args )
|
||||
{
|
||||
int count = args->numNodes;
|
||||
|
||||
ProjectReq projectServer;
|
||||
OptionSetReq optSetServer;
|
||||
|
||||
for( int i = 0; i < count; i++ )
|
||||
{
|
||||
ProjectNode node = args->nodeArray[i];
|
||||
|
||||
WipeNodeOptions( node, projectServer, optSetServer );
|
||||
}
|
||||
|
||||
return( Success );
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Project stuff
|
||||
//
|
||||
|
||||
class _HOOKCLASS LocalProjClient : public ProjectClient
|
||||
{
|
||||
public:
|
||||
LocalProjClient();
|
||||
|
||||
virtual void _HOOKEP OpenNotify
|
||||
(
|
||||
const char * name
|
||||
);
|
||||
|
||||
virtual void _HOOKEP CloseNotify();
|
||||
|
||||
virtual void _HOOKEP NodeDeleteNotify
|
||||
(
|
||||
ProjectNode
|
||||
);
|
||||
|
||||
virtual void _HOOKEP DependencyQueryResponder
|
||||
(
|
||||
ProjectNode ,
|
||||
const char *
|
||||
);
|
||||
};
|
||||
|
||||
static LocalProjClient LocalProjClient;
|
||||
|
||||
LocalProjClient::LocalProjClient()
|
||||
{
|
||||
ProjectReq ps;
|
||||
|
||||
ps->RegisterProjectClient(this);
|
||||
}
|
||||
|
||||
|
||||
void _HOOKEP
|
||||
LocalProjClient::OpenNotify
|
||||
(
|
||||
const char * // name
|
||||
)
|
||||
{
|
||||
ToolReq ts;
|
||||
|
||||
localToolClient.RegisterMyCallBacks( ts );
|
||||
|
||||
if( !ts->ToolFind( wipeOptsName ) )
|
||||
{
|
||||
ToolInfo toolInfo;
|
||||
|
||||
toolInfo.toolType = Transfer;
|
||||
toolInfo.name = wipeOptsName;
|
||||
toolInfo.path = 0;
|
||||
toolInfo.flags = OnToolsMenu;
|
||||
toolInfo.menuName = "&Options Wiper";
|
||||
toolInfo.helpHint = "Delete the local overrides for node(s)";
|
||||
toolInfo.defCmdLine = 0;
|
||||
toolInfo.appliesTo = 0;
|
||||
toolInfo.defaultFor = 0;
|
||||
toolInfo.translateTo = 0;
|
||||
toolInfo.launchId = CALLBACK_LAUNCH_ID;
|
||||
|
||||
ts->ToolAdd( &toolInfo );
|
||||
}
|
||||
}
|
||||
|
||||
void _HOOKEP
|
||||
LocalProjClient::CloseNotify()
|
||||
{
|
||||
}
|
||||
|
||||
void _HOOKEP
|
||||
LocalProjClient::NodeDeleteNotify
|
||||
(
|
||||
ProjectNode
|
||||
)
|
||||
{
|
||||
}
|
||||
|
||||
void _HOOKEP
|
||||
LocalProjClient::DependencyQueryResponder
|
||||
(
|
||||
ProjectNode ,
|
||||
const char *
|
||||
)
|
||||
{
|
||||
}
|
||||
|
||||
// End of file
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
LIBRARY WIPEOPTS
|
||||
DESCRIPTION 'Frank Borland'
|
||||
EXETYPE WINDOWS
|
||||
CODE LOADONCALL MOVEABLE DISCARDABLE
|
||||
DATA PRELOAD MOVEABLE SINGLE
|
||||
HEAPSIZE 4096
|
||||
SEGMENTS
|
||||
_TEXT PRELOAD MOVEABLE
|
||||
|
||||
EXPORTS
|
||||
WEP @1 RESIDENTNAME
|
||||
IDELIBMAIN @2
|
||||
|
||||
@@ -0,0 +1,279 @@
|
||||
// Borland C++ - (C) Copyright 1991, 1992 by Borland International
|
||||
//
|
||||
// Windows Multi-target
|
||||
|
||||
#define STRICT
|
||||
#include <windows.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
LRESULT CALLBACK _export WndProc( HWND hWnd, UINT iMessage,
|
||||
WPARAM wParam, LPARAM lParam );
|
||||
|
||||
class Main
|
||||
{
|
||||
public:
|
||||
static HINSTANCE hInstance;
|
||||
static HINSTANCE hPrevInstance;
|
||||
static int nCmdShow;
|
||||
static int MessageLoop( void );
|
||||
};
|
||||
|
||||
class Window
|
||||
{
|
||||
protected:
|
||||
HWND hWnd;
|
||||
public:
|
||||
// Provide (read) access to the window's handle in case it is needed
|
||||
// elsewhere.
|
||||
HWND GetHandle( void ) { return hWnd; }
|
||||
|
||||
BOOL Show( int nCmdShow ) { return ShowWindow( hWnd, nCmdShow ); }
|
||||
void Update( void ) { UpdateWindow( hWnd ); }
|
||||
// Pure virtual function makes Window an abstract class.
|
||||
virtual LRESULT WndProc( UINT iMessage, WPARAM wParam, LPARAM lParam ) = 0;
|
||||
};
|
||||
|
||||
class MainWindow : public Window
|
||||
{
|
||||
private:
|
||||
static char szClassName[];
|
||||
// Helper function used by Paint function; it is used as a
|
||||
// callback function by LineDDA.
|
||||
static void FAR PASCAL LineFunc( int X, int Y, LPSTR lpData );
|
||||
public:
|
||||
// Register the class only AFTER WinMain assigns appropriate
|
||||
// values to static members of Main and only if no previous
|
||||
// instances of the program exist (a previous instance would
|
||||
// have already performed the registration).
|
||||
static void Register( void )
|
||||
{
|
||||
WNDCLASS wndclass; // Structure used to register Windows class.
|
||||
|
||||
wndclass.style = CS_HREDRAW | CS_VREDRAW;
|
||||
wndclass.lpfnWndProc = ::WndProc;
|
||||
wndclass.cbClsExtra = 0;
|
||||
// Reserve extra bytes for each instance of the window;
|
||||
// we will use these bytes to store a pointer to the C++
|
||||
// (MainWindow) object corresponding to the window.
|
||||
// the size of a 'this' pointer depends on the memory model.
|
||||
wndclass.cbWndExtra = sizeof( MainWindow * );
|
||||
wndclass.hInstance = Main::hInstance;
|
||||
wndclass.hIcon = LoadIcon( Main::hInstance, "multitrg" );
|
||||
wndclass.hCursor = LoadCursor( NULL, IDC_ARROW );
|
||||
wndclass.hbrBackground = (HBRUSH)GetStockObject( WHITE_BRUSH );
|
||||
wndclass.lpszMenuName = NULL;
|
||||
wndclass.lpszClassName = szClassName;
|
||||
|
||||
if ( ! RegisterClass( &wndclass ) )
|
||||
exit( FALSE );
|
||||
}
|
||||
|
||||
// Do not create unless previously registered.
|
||||
MainWindow( void )
|
||||
{
|
||||
// Pass 'this' pointer in lpParam of CreateWindow().
|
||||
hWnd = CreateWindow( szClassName,
|
||||
szClassName,
|
||||
WS_OVERLAPPEDWINDOW,
|
||||
CW_USEDEFAULT,
|
||||
0,
|
||||
CW_USEDEFAULT,
|
||||
0,
|
||||
NULL,
|
||||
NULL,
|
||||
Main::hInstance,
|
||||
(LPSTR) this );
|
||||
if ( ! hWnd )
|
||||
exit( FALSE );
|
||||
|
||||
Show( Main::nCmdShow );
|
||||
Update();
|
||||
}
|
||||
LRESULT WndProc( UINT iMessage, WPARAM wParam, LPARAM lParam );
|
||||
|
||||
// Print a message in the client rectangle.
|
||||
void Paint( void );
|
||||
// Struct used by Paint to pass information to callback function
|
||||
// used by LineDDA
|
||||
struct LINEFUNCDATA
|
||||
{
|
||||
HDC hDC;
|
||||
char FAR *LineMessage;
|
||||
int MessageLength;
|
||||
LINEFUNCDATA( char *Message )
|
||||
{
|
||||
hDC = 0;
|
||||
MessageLength = strlen( Message );
|
||||
LineMessage = new far char [MessageLength+1];
|
||||
lstrcpy( LineMessage, Message );
|
||||
};
|
||||
~LINEFUNCDATA( void ) { delete LineMessage; }
|
||||
};
|
||||
};
|
||||
|
||||
HINSTANCE Main::hInstance = 0;
|
||||
HINSTANCE Main::hPrevInstance = 0;
|
||||
int Main::nCmdShow = 0;
|
||||
|
||||
int Main::MessageLoop( void )
|
||||
{
|
||||
MSG msg;
|
||||
|
||||
while( GetMessage( &msg, NULL, 0, 0 ) )
|
||||
{
|
||||
TranslateMessage( &msg );
|
||||
DispatchMessage( &msg );
|
||||
}
|
||||
return msg.wParam;
|
||||
}
|
||||
|
||||
#ifdef __FLAT__
|
||||
char MainWindow::szClassName[] = "Hello, Flat World!";
|
||||
#else
|
||||
char MainWindow::szClassName[] = "Hello, Segmented World!";
|
||||
#endif
|
||||
|
||||
void MainWindow::Paint( void )
|
||||
{
|
||||
PAINTSTRUCT ps;
|
||||
RECT rect;
|
||||
FARPROC lpLineFunc;
|
||||
LINEFUNCDATA LineFuncData( "Borland C++ welcomes you to the "
|
||||
"Wonderful World of Windows Programming!" );
|
||||
|
||||
lpLineFunc = MakeProcInstance( (FARPROC) MainWindow::LineFunc, (HINSTANCE)Main::hInstance );
|
||||
BeginPaint( hWnd, &ps );
|
||||
GetClientRect( hWnd, (LPRECT) &rect );
|
||||
LineFuncData.hDC = ps.hdc;
|
||||
SetTextAlign( ps.hdc, TA_BOTTOM );
|
||||
LineDDA( 0, 0, 0,
|
||||
rect.bottom / 2, (LINEDDAPROC)lpLineFunc, (LPARAM) &LineFuncData );
|
||||
EndPaint( hWnd, &ps );
|
||||
FreeProcInstance( lpLineFunc );
|
||||
}
|
||||
|
||||
void FAR PASCAL _export MainWindow::LineFunc( int X, int Y, LPSTR lpData )
|
||||
{
|
||||
LINEFUNCDATA FAR * lpLineFuncData = (LINEFUNCDATA FAR *) lpData;
|
||||
TextOut( lpLineFuncData->hDC, X, Y,
|
||||
lpLineFuncData->LineMessage, lpLineFuncData->MessageLength );
|
||||
}
|
||||
|
||||
LRESULT MainWindow::WndProc( UINT iMessage, WPARAM wParam, LPARAM lParam )
|
||||
{
|
||||
switch (iMessage)
|
||||
{
|
||||
case WM_CREATE:
|
||||
break;
|
||||
case WM_PAINT:
|
||||
Paint();
|
||||
break;
|
||||
case WM_DESTROY:
|
||||
PostQuitMessage( 0 );
|
||||
break;
|
||||
default:
|
||||
return DefWindowProc( hWnd, iMessage, wParam, lParam );
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// If data pointers are near pointers
|
||||
#if defined(__SMALL__) || defined(__MEDIUM__)
|
||||
inline Window *GetPointer( HWND hWnd )
|
||||
{
|
||||
return (Window *) GetWindowWord( hWnd, 0 );
|
||||
}
|
||||
inline void SetPointer( HWND hWnd, Window *pWindow )
|
||||
{
|
||||
SetWindowWord( hWnd, 0, (WORD) pWindow );
|
||||
}
|
||||
|
||||
// else pointers are far
|
||||
#elif defined(__LARGE__) || defined(__COMPACT__) || defined(__FLAT__)
|
||||
inline Window *GetPointer( HWND hWnd )
|
||||
{
|
||||
return (Window *) GetWindowLong( hWnd, 0 );
|
||||
}
|
||||
inline void SetPointer( HWND hWnd, Window *pWindow )
|
||||
{
|
||||
SetWindowLong( hWnd, 0, (LONG) pWindow );
|
||||
}
|
||||
|
||||
#else
|
||||
#error Choose another memory model!
|
||||
#endif
|
||||
|
||||
LRESULT CALLBACK _export WndProc( HWND hWnd, UINT iMessage, WPARAM wParam,
|
||||
LPARAM lParam )
|
||||
{
|
||||
// Pointer to the (C++ object that is the) window.
|
||||
Window *pWindow = GetPointer( hWnd );
|
||||
|
||||
// The pointer pWindow will have an invalid value if the WM_CREATE
|
||||
// message has not yet been processed (we respond to the WM_CREATE
|
||||
// message by setting the extra bytes to be a pointer to the
|
||||
// (C++) object corresponding to the Window identified
|
||||
// by hWnd). The messages that
|
||||
// precede WM_CREATE must be processed without using pWindow so we
|
||||
// pass them to DefWindowProc.
|
||||
// How do we know in general if the pointer pWindow is invalid?
|
||||
// Simple: Windows allocates the window extra bytes using LocalAlloc
|
||||
// which zero initializes memory; thus, pWindow will have a value of
|
||||
// zero before we set the window extra bytes to the 'this' pointer.
|
||||
// Caveat emptor: the fact that LocalAlloc will zero initialize the
|
||||
// window extra bytes is not documented; therefore, it could change
|
||||
// in the future.
|
||||
|
||||
if ( pWindow == 0 )
|
||||
{
|
||||
if ( iMessage == WM_CREATE )
|
||||
{
|
||||
LPCREATESTRUCT lpcs;
|
||||
|
||||
lpcs = (LPCREATESTRUCT) lParam;
|
||||
pWindow = (Window *) lpcs->lpCreateParams;
|
||||
|
||||
// Store a pointer to this object in the window's extra bytes;
|
||||
// this will enable us to access this object (and its member
|
||||
// functions) in WndProc where we are
|
||||
// given only a handle to identify the window.
|
||||
SetPointer( hWnd, pWindow );
|
||||
// Now let the object perform whatever
|
||||
// initialization it needs for WM_CREATE in its own
|
||||
// WndProc.
|
||||
return pWindow->WndProc( iMessage, wParam, lParam );
|
||||
}
|
||||
else
|
||||
return DefWindowProc( hWnd, iMessage, wParam, lParam );
|
||||
}
|
||||
else
|
||||
return pWindow->WndProc( iMessage, wParam, lParam );
|
||||
}
|
||||
|
||||
// Turn off warning: Parameter 'lpszCmdLine' is never used in function WinMain(unsigned int,unsigned int,char far*,int)
|
||||
#pragma argsused
|
||||
|
||||
// Turn off warning: 'MainWnd' is assigned a value that is never used in function WinMain(unsigned int,unsigned int,char far*,int)
|
||||
#pragma option -w-aus
|
||||
|
||||
int PASCAL WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLine,
|
||||
int nCmdShow )
|
||||
{
|
||||
Main::hInstance = hInstance;
|
||||
Main::hPrevInstance = hPrevInstance;
|
||||
Main::nCmdShow = nCmdShow;
|
||||
|
||||
// A Windows class should be registered with Windows before any windows
|
||||
// of that type are created.
|
||||
// Register here all Windows classes that will be used in the program.
|
||||
// Windows classes should not be registered if an instance of
|
||||
// the program is already running.
|
||||
if ( ! Main::hPrevInstance ) {
|
||||
MainWindow::Register();
|
||||
}
|
||||
|
||||
MainWindow MainWnd;
|
||||
|
||||
return Main::MessageLoop();
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 766 B |
Binary file not shown.
@@ -0,0 +1 @@
|
||||
multitrg ICON multitrg.ico
|
||||
@@ -0,0 +1,46 @@
|
||||
Instructions for the ide example MULTITRG.IDE.
|
||||
//
|
||||
// Instructions for MultiTrg.ide
|
||||
// Copyright Borland International, 1993
|
||||
//
|
||||
|
||||
|
||||
This project is an example of multi-targeting in the new project manager.
|
||||
|
||||
The two multitrg.exe targets in the project are mostly similar with two major
|
||||
differences: The local options for the first target specifies output
|
||||
directories to point to .\out16 and is tagged as Win3.x (16 bit)
|
||||
applictation in TargetExpert. The second target has local options specifying
|
||||
output directories to point to .\out32 and is tagged as a Win32 appliction
|
||||
in TargetExpert.
|
||||
|
||||
The targets were created by
|
||||
1) selecting Project|New Target,
|
||||
2) typing "multitrg" in the 'Target Name' field,
|
||||
3) selecting 'Standard' from the 'Target Type' list,
|
||||
4) selecting 'Ok'
|
||||
|
||||
This leads to TargetExpert where:
|
||||
5) selecting "Windows 3.x (16 bit)" from the 'Platforms' list
|
||||
6) selecting 'Ok'
|
||||
|
||||
Repeating steps 1-6 for the second target with the exception of step (5)
|
||||
where "Win32" was selected from the 'Platforms' list.
|
||||
|
||||
To redirect output on the first target to the 'out16' directory
|
||||
6) Right click on the first target
|
||||
7) Select 'Local Options' with brings up the Multi-Page-Dialog
|
||||
8) In the 'Directories' section entering 'out16' in the 'Intermediate'
|
||||
and 'Final output' fields.
|
||||
9) Select 'Ok'
|
||||
|
||||
Repeating steps 6-9 for the second target replacing 'out16' with 'out32'
|
||||
completes the process.
|
||||
|
||||
You should note that the source nodes under both executables are copied
|
||||
under each target. If you wanted to add a source module you would have to
|
||||
do so (in this project) in two places to keep you 16bit and 32bit targets
|
||||
in synch. To get relief see the example in the SrcPool directory.
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,17 @@
|
||||
// Borland C++ - (C) Copyright 1991, 1992 by Borland International
|
||||
//
|
||||
// IDE SourcePool Example
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#ifdef __FLAT__
|
||||
static char szName[] = "SrcPool32";
|
||||
#else
|
||||
static char szName[] = "SrcPool16";
|
||||
#endif
|
||||
|
||||
int WINAPI WinMain( HINSTANCE, HINSTANCE, LPSTR, int )
|
||||
{
|
||||
return( ::MessageBox( 0, "IDE SourcePool example", szName, MB_OK ) );
|
||||
}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 766 B |
Binary file not shown.
@@ -0,0 +1 @@
|
||||
SourcePool ICON srcpool.ico
|
||||
@@ -0,0 +1,50 @@
|
||||
Instructions for the IDE example SRCPOOL.IDE.
|
||||
//
|
||||
// Instructions for SrcPool.IDE
|
||||
// Copyright Borland International, 1994
|
||||
//
|
||||
|
||||
This project demonstrates the use of a simple Source Pool by "reference
|
||||
copying" a set of source nodes within a project.
|
||||
|
||||
Source Pools are abstract container objects that hold dependencies.
|
||||
Although Source Pools are not buildable and runnable by themselves,
|
||||
they can be moved or copied (usually by reference) to real targets. When
|
||||
copied, they take on the options and target attributes of the context
|
||||
in which they are copied. When the project make facility is checking
|
||||
dependencies, or building a response table for linkers and librarians,
|
||||
the Source Pool itself becomes invisible and the nodes referenced by
|
||||
the Source Pool are seen as a direct dependency of the target.
|
||||
|
||||
Reference copying allows one node (and all of it's dependencies) to be
|
||||
referenced in many different places within the Project Tree. In this
|
||||
example we copy a Source Pool by reference to two different targets (a
|
||||
16-bit target and a 32-bit target, both called WHELLO.EXE). When you copy
|
||||
Source Pool by reference, all referenced copies are automatically updated
|
||||
whenever you add, delete, or modify the original Source Pool nodes.
|
||||
|
||||
NOTE: The example here assumes that you've looked at the example in the
|
||||
'MultiTrg' directory and are familiar with creating several targets in a
|
||||
single project and setting local options on a target node.
|
||||
|
||||
To create a Source Pool in an existing project:
|
||||
1) Select Project|New Target from the main menu
|
||||
2) Type a Target Name
|
||||
3) Select 'SourcePool' from the Target Type list
|
||||
4) Press OK to confirm your settings and create a SourcePool node
|
||||
5) Select that node in the Project window
|
||||
6) Press the Insert key to access the Add Item dialog box
|
||||
7) Select the files you want to add to the Source Pool
|
||||
8) Press OK to confirm your selections and add the dependencies under
|
||||
the SourcePool node
|
||||
|
||||
Once you've created your SourcePool node and dependencies, you can
|
||||
copy the node by reference to anywhere in your project:
|
||||
While holding down the Alt key, drag the SourcePool node to
|
||||
the target node where the Source Pool is needed.
|
||||
|
||||
More advanced uses of Source Pools include nesting them, which allows
|
||||
you to logically group source files without changing their location on
|
||||
disk. All nested Source Pools are 'flattened' during target dependency
|
||||
checking and creation time.
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,273 @@
|
||||
// Borland C++ - (C) Copyright 1991, 1992 by Borland International
|
||||
//
|
||||
// IDE Style Sheet example
|
||||
|
||||
#define STRICT
|
||||
#include <windows.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
LRESULT CALLBACK _export WndProc( HWND hWnd, UINT iMessage,
|
||||
WPARAM wParam, LPARAM lParam );
|
||||
|
||||
class Main
|
||||
{
|
||||
public:
|
||||
static HINSTANCE hInstance;
|
||||
static HINSTANCE hPrevInstance;
|
||||
static int nCmdShow;
|
||||
static int MessageLoop( void );
|
||||
};
|
||||
|
||||
class Window
|
||||
{
|
||||
protected:
|
||||
HWND hWnd;
|
||||
public:
|
||||
// Provide (read) access to the window's handle in case it is needed
|
||||
// elsewhere.
|
||||
HWND GetHandle( void ) { return hWnd; }
|
||||
|
||||
BOOL Show( int nCmdShow ) { return ShowWindow( hWnd, nCmdShow ); }
|
||||
void Update( void ) { UpdateWindow( hWnd ); }
|
||||
// Pure virtual function makes Window an abstract class.
|
||||
virtual LRESULT WndProc( UINT iMessage, WPARAM wParam, LPARAM lParam ) = 0;
|
||||
};
|
||||
|
||||
class MainWindow : public Window
|
||||
{
|
||||
private:
|
||||
static char szClassName[];
|
||||
|
||||
public:
|
||||
// Register the class only AFTER WinMain assigns appropriate
|
||||
// values to static members of Main and only if no previous
|
||||
// instances of the program exist (a previous instance would
|
||||
// have already performed the registration).
|
||||
static void Register( void )
|
||||
{
|
||||
WNDCLASS wndclass; // Structure used to register Windows class.
|
||||
|
||||
wndclass.style = CS_HREDRAW | CS_VREDRAW;
|
||||
wndclass.lpfnWndProc = ::WndProc;
|
||||
wndclass.cbClsExtra = 0;
|
||||
// Reserve extra bytes for each instance of the window;
|
||||
// we will use these bytes to store a pointer to the C++
|
||||
// (MainWindow) object corresponding to the window.
|
||||
// the size of a 'this' pointer depends on the memory model.
|
||||
wndclass.cbWndExtra = sizeof( MainWindow * );
|
||||
wndclass.hInstance = Main::hInstance;
|
||||
wndclass.hIcon = LoadIcon( Main::hInstance, "stylesht" );
|
||||
wndclass.hCursor = LoadCursor( NULL, IDC_ARROW );
|
||||
wndclass.hbrBackground = (HBRUSH)GetStockObject( WHITE_BRUSH );
|
||||
wndclass.lpszMenuName = NULL;
|
||||
wndclass.lpszClassName = szClassName;
|
||||
|
||||
if ( ! RegisterClass( &wndclass ) )
|
||||
exit( FALSE );
|
||||
}
|
||||
|
||||
// Do not create unless previously registered.
|
||||
MainWindow( void )
|
||||
{
|
||||
// Pass 'this' pointer in lpParam of CreateWindow().
|
||||
hWnd = CreateWindow( szClassName,
|
||||
szClassName,
|
||||
WS_OVERLAPPEDWINDOW,
|
||||
CW_USEDEFAULT,
|
||||
0,
|
||||
CW_USEDEFAULT,
|
||||
0,
|
||||
NULL,
|
||||
NULL,
|
||||
Main::hInstance,
|
||||
(LPSTR) this );
|
||||
if ( ! hWnd )
|
||||
exit( FALSE );
|
||||
|
||||
Show( Main::nCmdShow );
|
||||
Update();
|
||||
}
|
||||
LRESULT WndProc( UINT iMessage, WPARAM wParam, LPARAM lParam );
|
||||
|
||||
// Print a message in the client rectangle.
|
||||
void Paint( void );
|
||||
|
||||
};
|
||||
|
||||
HINSTANCE Main::hInstance = 0;
|
||||
HINSTANCE Main::hPrevInstance = 0;
|
||||
int Main::nCmdShow = 0;
|
||||
|
||||
int Main::MessageLoop( void )
|
||||
{
|
||||
MSG msg;
|
||||
|
||||
while( GetMessage( &msg, NULL, 0, 0 ) )
|
||||
{
|
||||
TranslateMessage( &msg );
|
||||
DispatchMessage( &msg );
|
||||
}
|
||||
return msg.wParam;
|
||||
}
|
||||
|
||||
char MainWindow::szClassName[] = "Hello, Style Sheets!";
|
||||
|
||||
static char szMessage[] =
|
||||
{
|
||||
"The graph above represents the way that"
|
||||
" project options, StyleSheets and local"
|
||||
" options on a node all interact to form"
|
||||
" the options that will be passed to tools"
|
||||
" at various stages of building the project."
|
||||
" Note that the Options|Project menu item"
|
||||
" behaves slightly different when your project"
|
||||
" has a single top-level target."
|
||||
" Always refer to the 'View options hierarchy'"
|
||||
" menu option on any node's SpeedMenu. The"
|
||||
" order of precedence always starts at the"
|
||||
" node you are compiling or linking, working"
|
||||
" your way up to the tool defaults."
|
||||
};
|
||||
|
||||
void MainWindow::Paint( void )
|
||||
{
|
||||
PAINTSTRUCT ps;
|
||||
|
||||
HDC hDC = BeginPaint( hWnd, &ps );
|
||||
|
||||
HBITMAP bitmap = LoadBitmap( Main::hInstance, "StyleSht" );
|
||||
HDC memDC = CreateCompatibleDC( hDC );
|
||||
HBITMAP oldBitmap = (HBITMAP)SelectObject( memDC, bitmap );
|
||||
BitBlt( hDC, 0, 0, 400, 200, memDC, 0, 0, SRCCOPY );
|
||||
SelectObject( memDC, oldBitmap );
|
||||
DeleteDC( memDC );
|
||||
FreeResource( bitmap );
|
||||
|
||||
HFONT oldFont = (HFONT)( SelectObject( hDC,
|
||||
GetStockObject( ANSI_VAR_FONT ) ) );
|
||||
RECT rc = { 0, 205, 400, 405 };
|
||||
DrawText( hDC, szMessage, sizeof(szMessage) - 1, &rc,
|
||||
DT_CENTER | DT_VCENTER | DT_WORDBREAK );
|
||||
SelectObject( hDC, oldFont );
|
||||
|
||||
EndPaint( hWnd, &ps );
|
||||
}
|
||||
|
||||
LRESULT MainWindow::WndProc( UINT iMessage, WPARAM wParam, LPARAM lParam )
|
||||
{
|
||||
switch (iMessage)
|
||||
{
|
||||
case WM_CREATE:
|
||||
break;
|
||||
case WM_PAINT:
|
||||
Paint();
|
||||
break;
|
||||
case WM_DESTROY:
|
||||
PostQuitMessage( 0 );
|
||||
break;
|
||||
default:
|
||||
return DefWindowProc( hWnd, iMessage, wParam, lParam );
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// If data pointers are near pointers
|
||||
#if defined(__SMALL__) || defined(__MEDIUM__)
|
||||
inline Window *GetPointer( HWND hWnd )
|
||||
{
|
||||
return (Window *) GetWindowWord( hWnd, 0 );
|
||||
}
|
||||
inline void SetPointer( HWND hWnd, Window *pWindow )
|
||||
{
|
||||
SetWindowWord( hWnd, 0, (WORD) pWindow );
|
||||
}
|
||||
|
||||
// else pointers are far
|
||||
#elif defined(__LARGE__) || defined(__COMPACT__) || defined(__FLAT__)
|
||||
inline Window *GetPointer( HWND hWnd )
|
||||
{
|
||||
return (Window *) GetWindowLong( hWnd, 0 );
|
||||
}
|
||||
inline void SetPointer( HWND hWnd, Window *pWindow )
|
||||
{
|
||||
SetWindowLong( hWnd, 0, (LONG) pWindow );
|
||||
}
|
||||
|
||||
#else
|
||||
#error Choose another memory model!
|
||||
#endif
|
||||
|
||||
LRESULT CALLBACK _export WndProc( HWND hWnd, UINT iMessage, WPARAM wParam,
|
||||
LPARAM lParam )
|
||||
{
|
||||
// Pointer to the (C++ object that is the) window.
|
||||
Window *pWindow = GetPointer( hWnd );
|
||||
|
||||
// The pointer pWindow will have an invalid value if the WM_CREATE
|
||||
// message has not yet been processed (we respond to the WM_CREATE
|
||||
// message by setting the extra bytes to be a pointer to the
|
||||
// (C++) object corresponding to the Window identified
|
||||
// by hWnd). The messages that
|
||||
// precede WM_CREATE must be processed without using pWindow so we
|
||||
// pass them to DefWindowProc.
|
||||
// How do we know in general if the pointer pWindow is invalid?
|
||||
// Simple: Windows allocates the window extra bytes using LocalAlloc
|
||||
// which zero initializes memory; thus, pWindow will have a value of
|
||||
// zero before we set the window extra bytes to the 'this' pointer.
|
||||
// Caveat emptor: the fact that LocalAlloc will zero initialize the
|
||||
// window extra bytes is not documented; therefore, it could change
|
||||
// in the future.
|
||||
|
||||
if ( pWindow == 0 )
|
||||
{
|
||||
if ( iMessage == WM_CREATE )
|
||||
{
|
||||
LPCREATESTRUCT lpcs;
|
||||
|
||||
lpcs = (LPCREATESTRUCT) lParam;
|
||||
pWindow = (Window *) lpcs->lpCreateParams;
|
||||
|
||||
// Store a pointer to this object in the window's extra bytes;
|
||||
// this will enable us to access this object (and its member
|
||||
// functions) in WndProc where we are
|
||||
// given only a handle to identify the window.
|
||||
SetPointer( hWnd, pWindow );
|
||||
// Now let the object perform whatever
|
||||
// initialization it needs for WM_CREATE in its own
|
||||
// WndProc.
|
||||
return pWindow->WndProc( iMessage, wParam, lParam );
|
||||
}
|
||||
else
|
||||
return DefWindowProc( hWnd, iMessage, wParam, lParam );
|
||||
}
|
||||
else
|
||||
return pWindow->WndProc( iMessage, wParam, lParam );
|
||||
}
|
||||
|
||||
// Turn off warning: Parameter 'lpszCmdLine' is never used in function WinMain(unsigned int,unsigned int,char far*,int)
|
||||
#pragma argsused
|
||||
|
||||
// Turn off warning: 'MainWnd' is assigned a value that is never used in function WinMain(unsigned int,unsigned int,char far*,int)
|
||||
#pragma option -w-aus
|
||||
|
||||
int PASCAL WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLine,
|
||||
int nCmdShow )
|
||||
{
|
||||
Main::hInstance = hInstance;
|
||||
Main::hPrevInstance = hPrevInstance;
|
||||
Main::nCmdShow = nCmdShow;
|
||||
|
||||
// A Windows class should be registered with Windows before any windows
|
||||
// of that type are created.
|
||||
// Register here all Windows classes that will be used in the program.
|
||||
// Windows classes should not be registered if an instance of
|
||||
// the program is already running.
|
||||
if ( ! Main::hPrevInstance ) {
|
||||
MainWindow::Register();
|
||||
}
|
||||
|
||||
MainWindow MainWnd;
|
||||
|
||||
return Main::MessageLoop();
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 766 B |
Binary file not shown.
@@ -0,0 +1,672 @@
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
|
||||
STYLESHT.RC
|
||||
|
||||
produced by Borland Resource Workshop
|
||||
|
||||
|
||||
*****************************************************************************/
|
||||
|
||||
StyleSht ICON stylesht.ico
|
||||
|
||||
StyleSht BITMAP
|
||||
{
|
||||
'42 4D DE 28 00 00 00 00 00 00 3E 00 00 00 28 00'
|
||||
'00 00 90 01 00 00 C8 00 00 00 01 00 01 00 00 00'
|
||||
'00 00 A0 28 00 00 00 00 00 00 00 00 00 00 00 00'
|
||||
'00 00 02 00 00 00 00 00 00 00 FF FF FF 00 FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF 00 00 FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF 00 00 FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF 00 00 FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'00 00 FF FF FF FF 7F FF FF FE FF FF 9F FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF 00 00 FF FF FF FF 7F FF FF FE FF FF'
|
||||
'EF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF 00 00 FF FF FF C7 AE 5C'
|
||||
'6D C6 DF BC 6E 79 CF 9E B6 63 E5 B7 1F FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF 00 00 FF FF'
|
||||
'FF B9 96 DB 6D BA DF BB 6D B6 DF 6D 36 DD ED B6'
|
||||
'EF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'00 00 FF F8 1F 7D BA EB B6 F2 EF BB B5 F7 DF 7D'
|
||||
'DA F9 EE DB CF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF 00 00 FF FC 3F 7E BA EB B6 CE E0 DB'
|
||||
'B4 17 DF 05 DA E7 EE DB 3F FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF 00 00 FF F0 0F 7E CB 6D'
|
||||
'B2 DA EF 4D B6 DB 6F B6 9B 6D F6 5B 6F FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF 00 00 FF FC'
|
||||
'3F BE D6 2C 75 E6 EF 54 77 3C C7 CF 5A 33 E2 BB'
|
||||
'9F FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF EF FF FF FF FF FF FF FF FF'
|
||||
'00 00 FF F8 1F 9D FF 7F FF FE F7 7F FF FF EF FF'
|
||||
'EF 7F F7 7F FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF EF FF FF FF FF'
|
||||
'FF FF FF FF 00 00 FF FF FF E3 FF 77 FF FE F0 FF'
|
||||
'FB FF EF FF ED 7F F7 7D FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF 06 38 E5 7C 69'
|
||||
'96 37 63 FF FF FF FF FF 00 00 FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF BF 7D'
|
||||
'D7 59 7B A6 B5 D7 5D FF FF FF FF FF 00 00 FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF BF 7D D7 DD 7B AE B5 D7 7B FF FF FF FF FF'
|
||||
'00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FE 0F 7D D7 E1 7B AE B5 D7 67 FF'
|
||||
'FF FF FF FF 00 00 FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF BF 7D D7 5D 7B A6'
|
||||
'B5 D3 5D FF FF FF FF FF 00 00 FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF BF 7E'
|
||||
'38 E3 7C 69 16 34 E3 FF FF FF FF FF 00 00 FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF 7F FF FF 7F FF BF FF FF FF FF FF FF FF'
|
||||
'00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF 7F FF FF 7F FF B7 FF FF FF'
|
||||
'FF FF FF FF 00 00 FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF 00 00 FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF 00 00 FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF 00 00 FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF C7 FE 7C F8 FF E7 FF BF FF FF FF FF'
|
||||
'E7 FF FF FF FF FF FF FF 00 00 FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF CF FE 7C FC FF EF FF DF'
|
||||
'FF FF FF FF F7 FF FF FF FF FF FF FF 00 00 FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF CC C6 0C 1C'
|
||||
'FF EE 19 DD 8E 1B B1 C6 77 FF FF FF FF FF FF FF'
|
||||
'00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'CC 92 64 CC FF ED EB DD 75 EB AE BA F7 FF FF FF'
|
||||
'FF FF FF FF 00 00 FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF CF 9E 64 CC FF EF EB AD 7F EB AF BE'
|
||||
'F7 FF FF FF FF FF FF FF 00 00 FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF CF 9E 64 CC FF EF 9B AD'
|
||||
'07 9B A0 82 F7 FF FF FF FF FF FF FF 00 00 FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF CF 92 64 CC'
|
||||
'FF EE 7B 75 76 79 AE BA F7 FF FF FF FF FF FF FF'
|
||||
'00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'CF C6 0C 1C FF ED F1 75 8D FA 71 C4 77 FF FF FF'
|
||||
'FF FF FF FF 00 00 FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF F7 FF FF'
|
||||
'FF FF FF FF CF FF FF FC FF ED EB FD FD EB FF FE'
|
||||
'F7 FF FF FF FF FF FF FF 00 00 FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF F7 FF FF FF FF FF FF C7 FF FF F8 FF E6 1B FD'
|
||||
'FE 1B FF FE E7 FF FF FF FF FF FF FF 00 00 FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF F7 FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF F7 FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF 00 00 FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF F7 FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF 00 00 FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF F7 FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF 00 00 FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF F7 FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF F7 FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF 00 00 FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF F7 FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF F7 FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF 00 00 FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF F7 FF FF FF FF FF FF FF FF FF FF FF FF FF F7'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF 00 00 FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF F7 FF FF FF FF FF FF FF FF FF 83'
|
||||
'1C 72 BE 34 CB 1B B1 FF FF FF FF FF FF FF FF FF'
|
||||
'00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF F7 FF FF FF FF FF FF'
|
||||
'FF FF DF BE EB AC BD D3 5A EB AE FF FF FF FF FF'
|
||||
'FF FF FF FF 00 00 FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF F7 FF FF'
|
||||
'FF FF FF FF FF FF DF BE EB EE BD D7 5A EB BD FF'
|
||||
'FF FF FF FF FF FF FF FF 00 00 FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF F7 FF FF FF FF FF FF FF FF 07 BE EB F0 BD D7'
|
||||
'5A EB B3 FF FF FF FF FF FF FF FF FF 00 00 FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF F7 FF FF FF FF FF FF FF FF DF BE'
|
||||
'EB AE BD D3 5A E9 AE FF FF FF FF FF FF FF FF FF'
|
||||
'00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF F7 FF FF FF FF FF FF'
|
||||
'FF FF DF BF 1C 71 BE 34 8B 1A 71 FF FF FF FF FF'
|
||||
'FF FF FF FF 00 00 FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF F7 FF FF'
|
||||
'FF FF FF FF FF FF FF BF FF FF BF FF DF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF 00 00 FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF EF FF FF FF FF FF'
|
||||
'FF F7 FF FF FF FF FF FF FF FF FF BF FF FF BF FF'
|
||||
'DB FF FF FF FF FF FF FF FF FF FF FF 00 00 FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF EF FF'
|
||||
'FF FF FF FF FF F7 FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'00 00 FF FF FF FF FF FF FF FF FF FF FF FF 06 38'
|
||||
'E5 7C 69 96 37 63 FF FF FF F7 FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF 00 00 FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF BF 7D D7 59 7B A6 B5 D7 5D FF FF FF F7 FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF 00 00 FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF BF 7D D7 DD 7B AE B5 D7 7B FF FF'
|
||||
'FF F7 FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF 00 00 FF FF'
|
||||
'FF FF FF FF FF FF FF FF FE 0F 7D D7 E1 7B AE B5'
|
||||
'D7 67 FF FF FF F7 FF FF FF FF FF FF FF F9 FF EF'
|
||||
'FF FF FF FF F9 FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'00 00 FF FF FF FF FF FF FF FF FF FF FF BF 7D D7'
|
||||
'5D 7B A6 B5 D3 5D FF FF FF F7 FF FF 1F FF FF E3'
|
||||
'FF FB FF F7 FF FF FF FF FD FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF 00 00 FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF BF 7E 38 E3 7C 69 16 34 E3 FF FF FF F7 FF FF'
|
||||
'3F FF FF F3 FF FB 86 77 63 86 EC 71 9D FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF 00 00 FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF 7F FF FF 7F FF BF FF FF FF FF'
|
||||
'FF F7 FF FF 33 0C 98 73 FF FB 7A F7 5D 7A EB AE'
|
||||
'BD FF FF FF FF FF FF FF FF FF FF FF 00 00 FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF 7F FF FF 7F FF B7'
|
||||
'FF FF FF FF FF F7 FF FF 32 64 93 33 FF FB FA EB'
|
||||
'5F FA EB EF BD FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF F7 FF FF 3E 7E 33 F3'
|
||||
'FF FB E6 EB 41 E6 E8 20 BD FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF 00 00 FF FF FF FF FF C7 FE 7C F8 FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF F7 FF FF'
|
||||
'3E 06 30 33 FF FB 9E DD 5D 9E 6B AE BD FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF 00 00 FF FF FF FF FF CF'
|
||||
'FE 7C FC FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF F7 FF FF 3E 64 93 33 FF FB 7C 5D 63 7E 9C 71'
|
||||
'1D FF FF FF FF FF FF FF FF FF FF FF 00 00 FF FF'
|
||||
'FF FF FF CC C6 0C 1C FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF F7 FF FF 3F 0C 98 73 FF FB 7A FF'
|
||||
'7F 7A FF FF BD FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'00 00 FF FF FF FF FF CC 92 64 CC FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF F7 FF FF 3F FF FF F3'
|
||||
'FF F9 86 FF 7F 86 FF FF B9 FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF 00 00 FF FF FF FF FF CF 9E 64 CC FF'
|
||||
'FF FF 9F FE FF FF FF FF FF 3F FF FF FF F7 FF FF'
|
||||
'1F FF FF E3 FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF 00 00 FF FF FF FF FF CF'
|
||||
'9E 64 CC FF FF FF BF FF 7F FF FF FF FF BF FF FF'
|
||||
'FF F7 FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF 00 00 FF FF'
|
||||
'FF FF FF CF 92 64 CC FF FF FF B8 67 76 38 6E C7'
|
||||
'19 BF FF FF FF F7 FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'00 00 FF FF FF FF FF CF C6 0C 1C FF FF FF B7 AF'
|
||||
'75 D7 AE BA EB BF FF FF FF F7 FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF 00 00 FF FF FF FF FF CF FF FF FC FF'
|
||||
'FF FF BF AE B5 FF AE BE FB BF FF FF FF F7 FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF 00 00 FF FF FF FF FF C7'
|
||||
'FF FF F8 FF FF FF BE 6E B4 1E 6E 82 0B BF FF FF'
|
||||
'FF F7 FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF BF FF FF FF FF FF FF FF FF 00 00 FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF B9 ED D5 D9 E6 BA'
|
||||
'EB BF FF FF FF F7 FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF BF FF FF FF FF FF FF FF FF'
|
||||
'00 00 FF FF FF FF FF FF FF FF FF FF FF FF B7 C5'
|
||||
'D6 37 E9 C7 11 BF FF FF FF F7 FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FC 18 E3 95 F1 A6 58 DD 8F FF'
|
||||
'FF FF FF FF 00 00 FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF B7 AF F7 F7 AF FF FB BF FF FF FF F7 FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FE FD F7 5D 65 EE 9A'
|
||||
'D7 5D 77 FF FF FF FF FF 00 00 FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF 98 6F F7 F8 6F FF FB 3F FF FF'
|
||||
'FF F7 FF FF FF FF FF FF FF FF FF FF FF FE FD F7'
|
||||
'5F 75 EE BA D7 5D EF FF FF FF FF FF 00 00 FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF F7 FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF F8 3D F7 5F 85 EE BA D7 5D 9F FF FF FF FF FF'
|
||||
'00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF F7 FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FE FD F7 5D 75 EE 9A D7 4D 77 FF'
|
||||
'FF FF FF FF 00 00 FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF F7 FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FE FD F8 E3 8D F1 A4'
|
||||
'58 D3 8F FF FF FF FF FF 00 00 FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF F7 FF FF FF FF FF FF FF FF FF FF FF FF FD FF'
|
||||
'FF FD FF FE FF FF FF FF FF FF FF FF 00 00 FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF F7 FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FD FF FF FD FF FE DF FF FF FF FF FF FF FF'
|
||||
'00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF F7 FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF 00 00 FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF F7 FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF 00 00 FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF F7 FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF 00 00 FF FF'
|
||||
'FF 1F FF FF E3 FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF F7 FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'00 00 FF FF FF 3F FF FF F3 FF C3 FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF F7 FF FF FF FF FF FF'
|
||||
'1F F9 F3 E3 FF 9F FE FF FF FF FF FF 9F FF FF FF'
|
||||
'FF FF FF FF 00 00 FF FF FF 33 0C 98 73 FF C1 FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF F7 FF FF'
|
||||
'FF FF FF FF 3F F9 F3 F3 FF BF FF 7F FF FF FF FF'
|
||||
'DF FF FF FF FF FF FF FF 00 00 FF FF FF 32 64 93'
|
||||
'33 FF C0 FF FF FF FF FF FF BF FF FF FF FF FF FF'
|
||||
'FF F7 FF FF FF FF FF FF 33 18 30 73 FF B8 67 76'
|
||||
'38 6E C7 19 DF FF FF FF FF FF FF FF 00 00 FF FF'
|
||||
'FF 3E 7E 33 F3 FF F0 FF FF FF FF FF FF BF FF FF'
|
||||
'FF FF FF FF FF F7 FF FF FF FF FF FF 32 49 93 33'
|
||||
'FF B7 AF 75 D7 AE BA EB DF FF FF FF FF FF FF FF'
|
||||
'00 00 FF FF FF 3E 06 30 33 FF F8 FF FC 18 E3 95'
|
||||
'F1 A6 58 DD 8F FF FF FF FF F7 FF FF FF FF FF FF'
|
||||
'3E 79 93 33 FF BF AE B5 FF AE BE FB DF FF FF FF'
|
||||
'FF FF FF FF 00 00 FF FF FF 3E 64 93 33 FF F8 FE'
|
||||
'FD F7 5D 65 EE 9A D7 5D 77 FC 0F FF FF F7 FF FF'
|
||||
'FF FF FF FF 3E 79 93 33 FF BE 6E B4 1E 6E 82 0B'
|
||||
'DF FF FF FF FF FF FF FF 00 00 FF FF FF 3F 0C 98'
|
||||
'73 FF F8 FE FD F7 5F 75 EE BA D7 5D EF FE 1F FF'
|
||||
'FF F7 FF FF FF FF FF FF 3E 49 93 33 FF B9 ED D5'
|
||||
'D9 E6 BA EB DF FF FF FF FF FF FF FF 00 00 FF FF'
|
||||
'FF 3F FF FF F3 FF F8 F8 3D F7 5F 85 EE BA D7 5D'
|
||||
'9F F8 07 FF FF F7 FF FF FF FF FF FF 3F 18 30 73'
|
||||
'FF B7 C5 D6 37 E9 C7 11 DF FF FF FF FF FF FF FF'
|
||||
'00 00 FF FF FF 1F FF FF E3 FF F8 FE FD F7 5D 75'
|
||||
'EE 9A D7 4D 77 FE 1F FF FF F7 FF FF FF FF FF FF'
|
||||
'3F FF FF F3 FF B7 AF F7 F7 AF FF FB DF FF FF FF'
|
||||
'FF FF FF FF 00 00 FF FF FF FF FF FF FF FF F8 FE'
|
||||
'FD F8 E3 8D F1 A4 58 D3 8F FC 0F FF FF F7 FF FF'
|
||||
'FF FF FF FF 1F FF FF E3 FF 98 6F F7 F8 6F FF FB'
|
||||
'9F FF FF FF FF FF FF FF 00 00 FF FF FF FF FF FF'
|
||||
'FF FF F8 FF FD FF FF FD FF FE FF FF FF FF FF FF'
|
||||
'FF F7 FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF 00 00 FF FF'
|
||||
'FF FF FF FF FF FF F8 7F FD FF FF FD FF FE DF FF'
|
||||
'FF FF FF FF FF F7 FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'00 00 FF FF FF FF FF FF FF FF FC 7F FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF F7 FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF 00 00 FF FF FF FF FF FF FF FF FE 1F'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF F7 FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF 00 00 FF FF FF FF FF FF'
|
||||
'FF FF FF 9F FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF F7 FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF 00 00 FF FF'
|
||||
'FF FF FF FF FF FF FE 1F CF FF 7F FF FF FF FF 9F'
|
||||
'FF FF FF FF FF F7 FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'00 00 FF FF FF FF FF FF FF FF FC 7F DF FF BF FF'
|
||||
'FF FF FF DF FF FF FF FF FF F7 FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF DF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF 00 00 FF FF FF FF FF FF FF FF F8 7F'
|
||||
'DC 33 BB 1C 37 63 8C DF FF FF FF FF FF F7 FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF DF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF 00 00 FF FF FF FF FF FF'
|
||||
'FF FF F8 FF DB D7 BA EB D7 5D 75 DF FF FF FF FF'
|
||||
'FF F7 FF FF FF FF FF FF FF FF FE 0C 71 CA F8 D3'
|
||||
'2C 6E C7 FF FF FF FF FF FF FF FF FF 00 00 FF FF'
|
||||
'FF FF FF FF FF FF F8 FF DF D7 5A FF D7 5F 7D DF'
|
||||
'FF FF FF FF FF F7 FF FF FF FF FF FF FF FF 7E FB'
|
||||
'AE B2 F7 4D 6B AE BB FF FF FF FF FF FF FF FF FF'
|
||||
'00 00 FF 8F FF FF 8F FF FF FF F8 FF DF 37 5A 0F'
|
||||
'37 41 05 DF FF FF FF FF FF F7 FF FF FF FF FF FF'
|
||||
'FF FF 7E FB AF BA F7 5D 6B AE F7 FF FF FF FF FF'
|
||||
'FF FF FF FF 00 00 FF 9F FF FF CF FF FF FF F8 FF'
|
||||
'DC F6 EA EC F3 5D 75 DF FF FF FF FF FF F7 FF FF'
|
||||
'FF FF FF FF FF FC 1E FB AF C2 F7 5D 6B AE CF FF'
|
||||
'FF FF FF FF FF FF FF FF 00 00 FF 99 30 61 CF FF'
|
||||
'FF FF F8 FF DB E2 EB 1B F4 E3 88 DF FF FF FF FF'
|
||||
'FF F7 FF FF FF FF FF FF FF FF 7E FB AE BA F7 4D'
|
||||
'6B A6 BB FF FF FF FF FF FF FF FF FF 00 00 FF 99'
|
||||
'26 4C CF FF FF FF F8 FF DB D7 FB FB D7 FF FD DF'
|
||||
'FF FF FF FF FF F7 FF FF FF FF FF FF FF FF 7E FC'
|
||||
'71 C6 F8 D2 2C 69 C7 FF FF FF FF FF FF FF FF FF'
|
||||
'00 00 FF 9F 26 4F CF FF FF FF F8 FF CC 37 FB FC'
|
||||
'37 FF FD 9F FF FF FF FF FF F7 FF FF FF FF FF FF'
|
||||
'FF FF FE FF FF FE FF FF 7F FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF 00 00 FF 9F 26 40 CF FF FF FF F0 FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF F7 FF FF'
|
||||
'FF FF FF FF FF FF FE FF FF FE FF FF 6F FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF 00 00 FF 9F 26 4C CF FF'
|
||||
'FF FF C0 FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF F7 FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF 00 00 FF 9F'
|
||||
'30 61 CF FF FF FF C1 FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF F7 FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'00 00 FF 9F FE 7F CF FF FF FF C3 FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF F7 FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF 00 00 FF 8F 3E 7F 8F FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF F7 FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF 00 00 FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF F7 FF FF FF FF FF FF FF E7 FF BF FF FF FF FF'
|
||||
'E7 FF FF FF FF FF FF FF FF FF FF FF 00 00 FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF F7 FF FC 7F FF FF 8F FF EF FF DF'
|
||||
'FF FF FF FF F7 FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF F7 FF FC FF FF FF CF'
|
||||
'FF EE 19 DD 8E 1B B1 C6 77 FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF 00 00 FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF F7 FF FC'
|
||||
'CC 32 61 CF FF ED EB DD 75 EB AE BA F7 FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF 00 00 FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF F7 FF FC C9 92 4C CF FF EF EB AD 7F EB AF BE'
|
||||
'F7 FF FF FF FF FF FF FF FF FF FF FF 00 00 FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF F7 FF FC F9 F8 CF CF FF EF 9B AD'
|
||||
'07 9B A0 82 F7 FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF F7 FF FC F8 18 C0 CF'
|
||||
'FF EE 7B 75 76 79 AE BA F7 FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF 00 00 FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF F7 FF FC'
|
||||
'F9 92 4C CF FF ED F1 75 8D FA 71 C4 77 FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF 00 00 FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF F7 FF FC FC 32 61 CF FF ED EB FD FD EB FF FE'
|
||||
'F7 FF FF FF FF FF FF FF FF FF FF FF 00 00 FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF F7 FF FC FF FF FF CF FF E6 1B FD'
|
||||
'FE 1B FF FE E7 FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF F7 FF FC 7F FF FF 8F'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF 00 00 FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF F7 FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF 00 00 FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF F7 FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF 00 00 FF FF'
|
||||
'FF C3 C3 C3 C3 C3 C3 C3 C3 C3 C3 C3 C3 C3 C3 C3'
|
||||
'C3 7F FF FF FF F7 FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF F7 FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF 00 00 FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF F7 FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF 00 00 FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF F7 FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF 00 00 FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF F7 E3 FF FF E3 FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF F7 E7 FF FF F3 FF F3'
|
||||
'FF FF FF FF FF FF EF FF FF FF 7F FF FF F9 FF FF'
|
||||
'FF FF FF FF 00 00 FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF F7 E6 4C'
|
||||
'18 73 FF F7 FF FF FF FF FF FF F7 FF FF FF 7F FF'
|
||||
'FF FD FF FF FF FF FF FF 00 00 FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF F7 E6 49 93 33 FF F6 1E 3B 96 54 F7 DE 36 38'
|
||||
'CF C7 4C B1 BB 1D FF FF FF FF FF FF 00 00 FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF F7 E7 C9 93 F3 FF F6 ED DB 65 95'
|
||||
'F7 DD D5 D7 5F BB 35 AE BA ED FF FF FF FF FF FF'
|
||||
'00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF F7 E7 C9 90 33 FF F6'
|
||||
'F5 FB 75 D5 F7 DD D5 F7 DF 7D 75 AE BB DD FF FF'
|
||||
'FF FF FF FF 00 00 FF 9F FF FF FF FF FF FF 7F FF'
|
||||
'FF FB FF FF FF CF FF FD FF FF FF FF FF F7 E7 C9'
|
||||
'93 33 FF F6 F4 1B 85 D5 F0 DD D4 17 DF 7D 75 AE'
|
||||
'BB 3D FF FF FF FF FF FF 00 00 FF BF FF FF FF FF'
|
||||
'FF FF BF FF FF FB FF FF FF EF FF FE FF FF FF FF'
|
||||
'FF F7 E7 CC 18 73 FF F6 F5 DB 75 D5 F7 4D D5 D7'
|
||||
'5F 7D 35 AE 9A ED FF FF FF FF FF FF 00 00 FF B0'
|
||||
'F1 DC B2 A7 BE F1 B1 C6 7E 3A 65 8D D8 EF F0 CE'
|
||||
'EC 70 DD 8E 33 F7 E7 FF 9F F3 FF F6 F6 31 8D D0'
|
||||
'F7 56 36 38 8F 7D 48 B1 A7 1D F0 3F FF FF FF FF'
|
||||
'00 00 FF B7 6E DB 2C AF BE EE AE BA FD D9 AD 75'
|
||||
'D7 6F EF 5E EB AF 5D 75 D7 F7 E3 CF 9F E3 FF F6'
|
||||
'EF FB FF F5 F7 7F FF FF DF BB FD FF FF FD F8 7F'
|
||||
'FF FF FF FF 00 00 FF B7 AF DB AE AF BE EE AF BE'
|
||||
'FB EB AD 75 DE EF FF 5D 6B FF 5D 7D F7 F7 FF FF'
|
||||
'FF FF FF F2 1F FD FF F5 F0 FF F7 FF DF C7 FD BF'
|
||||
'FF F9 E0 1F FF FF FF FF 00 00 FF B7 A0 DC 2E AF'
|
||||
'86 EE A0 BE FB EB AD 75 D9 EF FC DD 68 3C DD 04'
|
||||
'17 F7 FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF F8 7F FF FF FF FF 00 00 FF B7'
|
||||
'AE DB AE AF BA 6E AE BA FB E9 AD 74 D7 6F F3 DB'
|
||||
'AB B3 CD 75 D7 F7 FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF F0 3F FF FF FF FF'
|
||||
'00 00 FF B7 B1 8C 6E 87 BA B1 B1 C4 7B EA 45 8D'
|
||||
'38 EF EF 8B AC 6F D3 8E 23 F7 FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF 00 00 FF B7 7F DF FF AF BB FF FF FE'
|
||||
'FD DF EF FF FF EF EF 5F EF EF 5F FF F7 F7 FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF 00 00 FF 90 FF EF FF AF'
|
||||
'87 FF BF FE FE 3F ED FF FF CF F0 DF EF F0 DF FF'
|
||||
'F7 F7 FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF 00 00 FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF F7 FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF F7 FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF 00 00 FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF F7 FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF 00 00 FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF F7 FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF 00 00 FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF F7 FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF F7 FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF 00 00 FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF F7 FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF 00 00 FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF F7 FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF 00 00 FF FF'
|
||||
'FF 87 87 87 87 87 87 87 87 87 87 87 87 87 87 87'
|
||||
'86 FF FF FF FF F7 FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF F7 FF FF FF E1 E1 E1'
|
||||
'E1 E1 E1 E1 E1 E1 E1 E1 E1 E1 E1 E1 E1 BF FF FF'
|
||||
'FF FF FF FF 00 00 FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF F7 FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF 00 00 FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF F7 FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF 00 00 FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF F7 FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF F7 FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF 00 00 FF FF FF FF FF FF FE F1 C6 F0'
|
||||
'F1 DC B2 A6 3F FF FF FF FF FF FF FF FF F7 FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF 00 00 FF FF FF FF FF FF'
|
||||
'FE EE BA F7 6E DB 2C AD DF FF FF FF FF FF FF FF'
|
||||
'FF F7 FF FF FF FF FF FF FF BC 71 BC 3C 77 2C A9'
|
||||
'8F FF FF FF FF FF FF FF FF FF FF FF 00 00 FF FF'
|
||||
'FF FF FF FF FE EE BA F7 AF DB AE AF BF FF FF FF'
|
||||
'FF FF FF FF FF F7 FF FF FF FF FF FF FF BB AE BD'
|
||||
'DB B6 CB 2B 77 FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'00 00 FF FF FF FF FF FF FE EE BA F7 A0 DC 2E AE'
|
||||
'7F FF FF FF FF FF FF FF FF F7 FF FF FF FF FF FF'
|
||||
'FF BB AE BD EB F6 EB AB EF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF 00 00 FF FF FF FF FF FF FE EE BA F7'
|
||||
'AE DB AE AD DF FF FF FF FF FF FF FF FF F7 FF FF'
|
||||
'FF FF FF FF FF BB AE BD E8 37 0B AB 9F FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF 00 00 FF FF FF FF FF FF'
|
||||
'FE F1 C6 F7 B1 8C 6E 86 3F FF FF FF FF FF FF FF'
|
||||
'FF F7 FF FF FF FF FF FF FF BB AE BD EB B6 EB AB'
|
||||
'77 FF FF FF FF FF FF FF FF FF FF FF 00 00 FF FF'
|
||||
'FF FF FF FF FE FF FE F7 7F DF FF AF FF FF FF FF'
|
||||
'FF FF FF FF FF F7 FF FF FF FF FF FF FF BC 71 BD'
|
||||
'EC 63 1B A1 8F FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'00 00 FF FF FF FF FF FF F8 3F FE F0 FF EF FF AF'
|
||||
'FF FF FF FF FF FF FF FF FF F7 FF FF FF FF FF FF'
|
||||
'FF BF FF BD DF F7 FF EB FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF 00 00 FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF F7 FF FF'
|
||||
'FF FF FF FF FE 0F FF BC 3F FB FF EB FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF 00 00 FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF F7 FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF 00 00 FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF F7 FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF F7 FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF 00 00 FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF F7 FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF 00 00 FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF F7 FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF 00 00 FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF F7 FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF F7 FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF 00 00 FF F8 00 00 00 00 00 00 00 00'
|
||||
'00 00 00 00 00 00 00 00 00 00 00 0F FF F7 E0 00'
|
||||
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
|
||||
'00 00 00 00 7F FF FF FF 00 00 FF F8 00 00 00 00'
|
||||
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0F'
|
||||
'FF F7 E0 00 00 00 00 00 00 00 00 00 00 00 00 00'
|
||||
'00 00 00 00 00 00 00 00 7F FF FF FF 00 00 FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF F7 FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF F7 FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF 00 00 FF FF FF FF E1 FF FF FF FC 3F'
|
||||
'FF FF FF FF FC 3F FF FF FF FF FF FF FF F7 FF FF'
|
||||
'FF FF F3 FF FF FF FF 0F FF FF FF FF FF 0F FF FF'
|
||||
'FF FF FF FF FF FF FF FF 00 00 FF FF FF FF DC FF'
|
||||
'FF FF FB 9F FF FF FF FF FB 9F FF FF FF FF FF FF'
|
||||
'FF F7 FF FF FF FF F3 FF FF FF FE E7 FF FF FF FF'
|
||||
'FE E7 FF FF FF FF FF FF FF FF FF FF 00 00 FF FF'
|
||||
'C3 26 60 98 7E 61 3C 18 73 E3 86 64 CC 18 27 86'
|
||||
'4C 33 3F FF FF F7 FF 9B 30 4C 90 66 1F 98 4F 06'
|
||||
'1C F8 E1 99 33 06 09 E1 93 0C CF FF FF FF FF FF'
|
||||
'00 00 FF FF 99 26 4C 93 3C C9 39 93 27 C9 32 64'
|
||||
'C9 93 27 24 C9 93 3F FF FF F7 FF 91 26 49 93 24'
|
||||
'CF 32 4E 64 C9 F2 4C 99 32 64 C9 C9 32 64 CF FF'
|
||||
'FF FF FF FF 00 00 FF FF F9 26 4C 93 FC C9 39 93'
|
||||
'E7 CF 32 64 C9 93 27 24 C9 93 3F FF FF F7 FF 91'
|
||||
'26 49 93 24 FF 32 4E 64 F9 F3 CC 99 32 64 C9 C9'
|
||||
'32 64 CF FF FF FF FF FF 00 00 FF FF E1 26 4C 90'
|
||||
'3C E1 39 90 27 CF 32 64 C9 93 27 84 C9 93 3F FF'
|
||||
'FF F7 FF 95 26 49 93 24 0F 38 4E 64 09 F3 CC 99'
|
||||
'32 64 C9 E1 32 64 CF FF FF FF FF FF 00 00 FF FF'
|
||||
'C7 26 4C 93 3C D9 39 93 27 C9 32 64 C9 93 27 64'
|
||||
'C9 93 3F FF FF F7 FF 84 26 49 93 24 CF 36 4E 64'
|
||||
'C9 F2 4C 99 32 64 C9 D9 32 64 CF FF FF FF FF FF'
|
||||
'00 00 FF FF 9F 20 E0 98 78 63 0C 18 43 E3 86 08'
|
||||
'4C 13 21 88 4C 30 7F FF FF F7 FF 84 26 40 90 66'
|
||||
'1E 18 C3 06 10 F8 E1 82 13 04 C8 62 13 0C 1F FF'
|
||||
'FF FF FF FF 00 00 FF FF 99 FF FF 9F FC FF FF FF'
|
||||
'E7 FF FF FC FF FF FF FC FF FF FF FF FF F7 FF 8E'
|
||||
'3F C9 FF E7 FF 3F FF FF F9 FF FF FF 3F FF FF FF'
|
||||
'3F FF FF FF FF FF FF FF 00 00 FF FF C3 3F FF 9F'
|
||||
'FE FF FF FF F7 FF FF FE 0F FF FF FE CF FF FF FF'
|
||||
'FF F7 FF 8E 3F CD 9F E7 FF BF FF FF FD FF FF FF'
|
||||
'83 FF FF FF B3 FF FF FF FF FF FF FF 00 00 FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF F7 FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF F7 FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF 00 00 FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF F7 FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF 00 00 FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF F7 FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF 00 00 FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF 00 00 FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF 00 00 FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF'
|
||||
'FF FF FF FF FF FF FF FF FF FF FF FF 00 00'
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
Instructions for the ide example STYLESHT.IDE.
|
||||
//
|
||||
// Instructions for StyleSht.ide
|
||||
// Copyright Borland International, 1993
|
||||
//
|
||||
|
||||
Note:
|
||||
[This example builds on another example in the 'SrcPool' directory that
|
||||
walks throught how build a multi-target project using abstract SourcePools
|
||||
and reference-copies. A general understanding of that example is assumed
|
||||
here. Although SourcePools and reference copying are used in this example,
|
||||
they are by no means necessary for using StyleSheets.]
|
||||
|
||||
|
||||
This example shows how applying StyleSheets can dramatically ease the
|
||||
process of creating multiple targets based on the same source code with
|
||||
completely different results: one target is designed for debugging and
|
||||
pre-production, while the other target, using the exact same pool of
|
||||
source code creates a 'delivery' edition with no debugging symbols and
|
||||
fully optimized for a different platform.
|
||||
|
||||
Anywhere along the way you can inspect the impact of setting options
|
||||
and assigning StyleSheets by using the Options Inspector. You can reach
|
||||
the Inspector by:
|
||||
|
||||
1) Bring up the SpeedMenu for node in the Project View by hitting
|
||||
the right-button while the cursor is over that node.
|
||||
2) Select 'View options hierarchy'
|
||||
|
||||
To see the full effect of this example select:
|
||||
|
||||
Options|Environment|Project View|Style Sheet
|
||||
|
||||
This will allow you see the Style Sheets assigned throughout the tree
|
||||
while in the Project View.
|
||||
|
||||
As you can now see, the styles16 [.exe] will be created with full debugging
|
||||
on, whereas the styles32 [.exe] will be created with debugging off and
|
||||
optimized for speed. Please note that even though the "My Styles Source"
|
||||
SourcePool is reference copied, applying these StyleSheets (or any
|
||||
local overrides) at the reference nodes, has no effect on the other copies
|
||||
and allows maximum flexibility for creating the right targets.
|
||||
|
||||
This is accomplished with the following steps:
|
||||
1) Bring up the SpeedMenu for the SourcePool under stylesht16 by hitting
|
||||
the right-button while the cursor is over that node.
|
||||
2) Select 'Edit node attributes'
|
||||
3) Select from the drop-list called StyleSheets one of pre-existing
|
||||
StyleSheets to apply to the node.
|
||||
4) Optionally you can create your own StyleSheet (either based on a
|
||||
pre-existing one, or from scratch) by pushing the 'Styles...'
|
||||
button in this dialog or from Option|Style Sheets from the main
|
||||
menu.
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user