mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
theide: Add to include path package file option, Sql tutorial finished
git-svn-id: svn://ultimatepp.org/upp/trunk@1321 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
032cb38422
commit
a9150962fe
22 changed files with 223 additions and 144 deletions
|
|
@ -23,11 +23,14 @@ CONSOLE_APP_MAIN
|
|||
SqlPerformScript(sch.Attributes());
|
||||
SQL.ClearError();
|
||||
|
||||
for(int i = 0; i < 10; i++)
|
||||
SQL * Insert(TEST)(A, i)(B, AsString(3 * i));
|
||||
S_TEST x;
|
||||
for(int i = 0; i < 10; i++) {
|
||||
x.A = i;
|
||||
x.B = AsString(3 * i);
|
||||
SQL * Insert(x);
|
||||
}
|
||||
|
||||
Sql sql;
|
||||
S_TEST x;
|
||||
sql * Select(x).From(TEST);
|
||||
while(sql.Fetch(x))
|
||||
Cout() << x.A << " \'" << x.B << "\'\n";
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ uses
|
|||
|
||||
file
|
||||
app.tpp,
|
||||
ArrayCtrl.h,
|
||||
main.cpp,
|
||||
ArrayCtrl.h include_path,
|
||||
main.cpp optimize_speed,
|
||||
src.tpp,
|
||||
srcimp.tpp;
|
||||
|
||||
|
|
|
|||
|
|
@ -178,7 +178,12 @@ in examples].&]
|
|||
to retrieve particular columns of result`-set.&]
|
||||
[s0; &]
|
||||
[s3; 4. Schema file&]
|
||||
[s7; &]
|
||||
[s5; Schema files can be used to describe the database schema. Such
|
||||
schema files can be used to upload the schema to the database,
|
||||
to defined SqlId constants and also to work with database records
|
||||
as C`+`+ structures.&]
|
||||
[s5; Following example demonstrates using schema file to create database
|
||||
schema in SQL database server.&]
|
||||
[s5; MyApp.sch:&]
|
||||
[s7; &]
|
||||
[s7; [* TABLE(TEST)]&]
|
||||
|
|
@ -242,7 +247,11 @@ to retrieve particular columns of result`-set.&]
|
|||
[s7;* &]
|
||||
[s5; &]
|
||||
[s3; 5. Using schema file to define SqlId constants&]
|
||||
[s5; &]
|
||||
[s5; As names of columns are present in the database schema, it is
|
||||
natural to recycle them to create SqlId constants.&]
|
||||
[s5; However, due to C`+`+ one definition rule (.sch files are interpreted
|
||||
as C`+`+ sources, using changing set of macros), you have to
|
||||
mark identifiers using underscore:&]
|
||||
[s5; MyApp.sch:&]
|
||||
[s7; [* TABLE`_](TEST)&]
|
||||
[s7; -|[* INT`_] (A)&]
|
||||
|
|
@ -307,7 +316,9 @@ to retrieve particular columns of result`-set.&]
|
|||
[s7; &]
|
||||
[s5; &]
|
||||
[s3; 6. Using structures defined by schema files&]
|
||||
[s5; &]
|
||||
[s5; Schema files also define structures that can be used to fetch,
|
||||
insert or update database records. Names of such structures are
|
||||
identical to the names of tables, with [* S`_] prefix:&]
|
||||
[s7; #include `"MyApp.h`"&]
|
||||
[s7; &]
|
||||
[s7; #include <Sql/sch`_schema.h>&]
|
||||
|
|
@ -333,14 +344,16 @@ to retrieve particular columns of result`-set.&]
|
|||
[s7; -|SqlPerformScript(sch.Attributes());&]
|
||||
[s7; -|SQL.ClearError();&]
|
||||
[s7; &]
|
||||
[s7; -|for(int i `= 0; i < 10; i`+`+)&]
|
||||
[s7; -|-|SQL `* Insert(TEST)(A, i)(B, AsString(3 `* i));&]
|
||||
[s7; -|[* S`_TEST] x;&]
|
||||
[s7; -|for(int i `= 0; i < 10; i`+`+) `{&]
|
||||
[s7; -|-|[* x.A `= i;]&]
|
||||
[s7; -|-|[* x.B `= AsString(3 `* i);]&]
|
||||
[s7; -|-|[* SQL `* Insert(x);]&]
|
||||
[s7; -|`}&]
|
||||
[s7; &]
|
||||
[s7; -|Sql sql;&]
|
||||
[s7; -|[* S`_TEST ]x;&]
|
||||
[s7; -|sql `* Select([* x]).From(TEST);&]
|
||||
[s7; -|while(sql.Fetch([* x]))&]
|
||||
[s7; -|-|Cout() << [* x.A] << `" `\`'`" << [* x.B] << `"`\`'`\n`";&]
|
||||
[s7; `}&]
|
||||
[s7; &]
|
||||
[s0; ]
|
||||
|
|
@ -47,7 +47,7 @@ struct CppBuilder : Builder {
|
|||
|
||||
String Includes(const char *sep);
|
||||
String IncludesShort(const char *sep);
|
||||
String IncludesDefinesTargetTime();
|
||||
String IncludesDefinesTargetTime(const String& package, const Package& pkg);
|
||||
|
||||
String GetMakePath(String fn) const;
|
||||
Point ExtractVersion();
|
||||
|
|
@ -72,8 +72,8 @@ struct GccBuilder : CppBuilder {
|
|||
virtual bool Preprocess(const String& package, const String& file, const String& target, bool asmout);
|
||||
|
||||
String CompilerName() const;
|
||||
String CmdLine();
|
||||
void BinaryToObject(String objfile, CParser& binscript, String basedir);
|
||||
String CmdLine(const String& package, const Package& pkg);
|
||||
void BinaryToObject(String objfile, CParser& binscript, String basedir, const String& package, const Package& pkg);
|
||||
};
|
||||
|
||||
struct MscBuilder : CppBuilder {
|
||||
|
|
@ -85,7 +85,7 @@ struct MscBuilder : CppBuilder {
|
|||
virtual bool Link(const Vector<String>& linkfile, const String& linkoptions, bool createmap);
|
||||
virtual bool Preprocess(const String& package, const String& file, const String& target, bool asmout);
|
||||
|
||||
String CmdLine();
|
||||
String CmdLine(const String& package, const Package& pkg);
|
||||
String MachineName() const;
|
||||
String LinkerName() const;
|
||||
String PdbPch(String package, int slot, bool do_pch) const;
|
||||
|
|
@ -103,7 +103,7 @@ struct JavaBuilder : CppBuilder {
|
|||
virtual bool Link(const Vector<String>& linkfile, const String& linkoptions, bool createmap);
|
||||
virtual bool Preprocess(const String& package, const String& file, const String& target, bool asmout);
|
||||
|
||||
bool PreprocessJava(String file, String target, String options);
|
||||
bool PreprocessJava(String file, String target, String options, String package, const Package& pkg);
|
||||
Time AddClassDeep(String& link, String dir, String reldir);
|
||||
|
||||
String JavaLine();
|
||||
|
|
|
|||
|
|
@ -346,9 +346,14 @@ String CppBuilder::IncludesShort(const char *sep)
|
|||
return cc;
|
||||
}
|
||||
|
||||
String CppBuilder::IncludesDefinesTargetTime()
|
||||
String CppBuilder::IncludesDefinesTargetTime(const String& package, const Package& pkg)
|
||||
{
|
||||
String cc = Includes(" -I");
|
||||
for(int i = 0; i < pkg.GetCount(); i++) {
|
||||
const Package::File& f = pkg[i];
|
||||
if(f.include_path)
|
||||
cc << " -I" << GetHostPathQ(GetFileFolder(SourcePath(package, f)));
|
||||
}
|
||||
for(int i = 0; i < config.GetCount(); i++)
|
||||
cc << " -Dflag" << config[i];
|
||||
Time t = GetSysTime();
|
||||
|
|
|
|||
|
|
@ -13,17 +13,18 @@ String GccBuilder::CompilerName() const
|
|||
return HasFlag("GCC_ARM") ? "arm-wince-pe-c++" : "c++";
|
||||
}
|
||||
|
||||
String GccBuilder::CmdLine()
|
||||
String GccBuilder::CmdLine(const String& package, const Package& pkg)
|
||||
{
|
||||
String cc = CompilerName();
|
||||
cc << " -c ";
|
||||
cc << IncludesDefinesTargetTime();
|
||||
cc << IncludesDefinesTargetTime(package, pkg);
|
||||
if(HasFlag("GCC32"))
|
||||
cc << " -m32";
|
||||
return cc;
|
||||
}
|
||||
|
||||
void GccBuilder::BinaryToObject(String objfile, CParser& binscript, String basedir)
|
||||
void GccBuilder::BinaryToObject(String objfile, CParser& binscript, String basedir,
|
||||
const String& package, const Package& pkg)
|
||||
{
|
||||
BinObjInfo info;
|
||||
info.Parse(binscript, basedir);
|
||||
|
|
@ -99,7 +100,7 @@ void GccBuilder::BinaryToObject(String objfile, CParser& binscript, String based
|
|||
|
||||
String tmpfile = ForceExt(objfile, ".c");
|
||||
SaveFile(tmpfile, fo);
|
||||
String cc = CmdLine();
|
||||
String cc = CmdLine(package, pkg);
|
||||
cc << " -c -o " << GetHostPathQ(objfile) << " -x c " << GetHostPathQ(tmpfile);
|
||||
int slot = AllocSlot();
|
||||
if(slot < 0 || !Run(cc, slot, objfile, 1))
|
||||
|
|
@ -123,7 +124,7 @@ bool GccBuilder::BuildPackage(const String& package, Vector<String>& linkfile,
|
|||
bool is_shared = HasFlag("SO");
|
||||
String shared_ext = (HasFlag("WIN32") ? ".dll" : ".so");
|
||||
|
||||
String cc = CmdLine();
|
||||
String cc = CmdLine(package, pkg);
|
||||
if(HasFlag("WIN32") && HasFlag("MT"))
|
||||
cc << " -mthreads";
|
||||
if(HasFlag("DEBUG_MINIMAL"))
|
||||
|
|
@ -249,7 +250,7 @@ bool GccBuilder::BuildPackage(const String& package, Vector<String>& linkfile,
|
|||
if(brcdata.IsVoid())
|
||||
throw Exc(NFormat("error reading file '%s'", fn));
|
||||
CParser parser(brcdata, fn);
|
||||
BinaryToObject(GetHostPath(objfile), parser, GetFileDirectory(fn));
|
||||
BinaryToObject(GetHostPath(objfile), parser, GetFileDirectory(fn), package, pkg);
|
||||
}
|
||||
catch(Exc e) {
|
||||
PutConsole(e);
|
||||
|
|
@ -457,7 +458,7 @@ bool GccBuilder::Preprocess(const String& package, const String& file, const Str
|
|||
ChDir(packagedir);
|
||||
PutVerbose("cd " + packagedir);
|
||||
|
||||
String cmd = CmdLine();
|
||||
String cmd = CmdLine(package, pkg);
|
||||
cmd << " " << Gather(pkg.option, config.GetKeys());
|
||||
cmd << " -o " << target;
|
||||
cmd << (asmout ? " -S " : " -E ") << GetHostPathQ(file);
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ bool JavaBuilder::BuildPackage(const String& package, Vector<String>& linkfile,
|
|||
return false;
|
||||
if(HdependFileTime(sfile[i]) > sobjinfo[i]) {
|
||||
ccount++;
|
||||
if(!PreprocessJava(sfile[i], sobjfile[i], soptions[i]))
|
||||
if(!PreprocessJava(sfile[i], sobjfile[i], soptions[i], package, pkg))
|
||||
error = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -178,7 +178,8 @@ bool JavaBuilder::Preprocess(const String& package, const String& file, const St
|
|||
return Preprocess(file, target, Null, false);
|
||||
}
|
||||
|
||||
bool JavaBuilder::PreprocessJava(String file, String target, String options)
|
||||
bool JavaBuilder::PreprocessJava(String file, String target, String options,
|
||||
String package, const Package& pkg)
|
||||
{
|
||||
String mscpp = GetVar("MSCPP_JDK");
|
||||
String cc;
|
||||
|
|
@ -186,7 +187,7 @@ bool JavaBuilder::PreprocessJava(String file, String target, String options)
|
|||
cc = mscpp + " /C /TP /P /nologo ";
|
||||
else
|
||||
cc = "cpp -C ";
|
||||
cc << IncludesDefinesTargetTime();
|
||||
cc << IncludesDefinesTargetTime(package, pkg);
|
||||
int time = GetTickCount();
|
||||
RealizePath(target);
|
||||
String execpath;
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ void MscBuilder::AddFlags(Index<String>& cfg)
|
|||
cfg.FindAdd("MSC");
|
||||
}
|
||||
|
||||
String MscBuilder::CmdLine()
|
||||
String MscBuilder::CmdLine(const String& package, const Package& pkg)
|
||||
{
|
||||
String cc;
|
||||
if(HasFlag("ARM"))
|
||||
|
|
@ -79,7 +79,7 @@ String MscBuilder::CmdLine()
|
|||
// TRC 080605-documentation says Wp64 works in 32-bit compilation only
|
||||
// cc << (IsMsc64() ? " -nologo -Wp64 -W3 -GR -c" : " -nologo -W3 -GR -c");
|
||||
cc << " -nologo -W3 -GR -c";
|
||||
cc << IncludesDefinesTargetTime();
|
||||
cc << IncludesDefinesTargetTime(package, pkg);
|
||||
return cc;
|
||||
}
|
||||
|
||||
|
|
@ -162,7 +162,7 @@ bool MscBuilder::BuildPackage(const String& package, Vector<String>& linkfile, S
|
|||
|
||||
bool is_shared = HasFlag("SO");
|
||||
|
||||
String cc = CmdLine();
|
||||
String cc = CmdLine(package, pkg);
|
||||
if(HasFlag("EVC")) {
|
||||
if(!HasFlag("SH3") && !HasFlag("SH4"))
|
||||
cc << " -Gs8192"; // disable stack checking
|
||||
|
|
@ -529,7 +529,10 @@ bool MscBuilder::Link(const Vector<String>& linkfile, const String& linkoptions,
|
|||
bool MscBuilder::Preprocess(const String& package, const String& file, const String& target, bool)
|
||||
{
|
||||
FileOut out(target);
|
||||
return Execute(CmdLine() + " -E " + file, out);
|
||||
String packagepath = PackagePath(package);
|
||||
Package pkg;
|
||||
pkg.Load(packagepath);
|
||||
return Execute(CmdLine(package, pkg) + " -E " + file, out);
|
||||
}
|
||||
|
||||
Builder *CreateMscBuilder()
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
#define IMAGEFILE <ide/Common/common.iml>
|
||||
#include <Draw/iml_source.h>
|
||||
|
||||
void IdeFileIcon0(bool dir, const String& filename, Image& img, bool fast = false)
|
||||
void IdeFileIcon0(bool dir, const String& filename, Image& img)
|
||||
{
|
||||
if(dir) return;
|
||||
String ext = ToLower(GetFileExt(filename));
|
||||
|
|
@ -21,12 +21,10 @@ void IdeFileIcon0(bool dir, const String& filename, Image& img, bool fast = fals
|
|||
img = IdeCommonImg::Script();
|
||||
if(ext == ".lng" || ext == ".lngj" || ext == ".t" || ext == ".jt")
|
||||
img = IdeCommonImg::Language();
|
||||
if(fast)
|
||||
img = IdeCommonImg::Fast();
|
||||
if(ext == ".icpp")
|
||||
img = fast ? IdeCommonImg::FastISource() : IdeCommonImg::ISource();
|
||||
img = IdeCommonImg::ISource();
|
||||
if(ext == ".c" || ext == ".cpp" || ext == ".cc" || ext == ".cxx")
|
||||
img = fast ? IdeCommonImg::FastSource() : IdeCommonImg::Source();
|
||||
img = IdeCommonImg::Source();
|
||||
if(ext == ".sch")
|
||||
img = IdeCommonImg::Sch();
|
||||
if(ext == ".sql")
|
||||
|
|
@ -35,10 +33,44 @@ void IdeFileIcon0(bool dir, const String& filename, Image& img, bool fast = fals
|
|||
img = IdeCommonImg::License();
|
||||
}
|
||||
|
||||
Image IdeFileImage(const String& filename, bool fast)
|
||||
struct sImageAdd : ImageMaker {
|
||||
Image i1, i2;
|
||||
|
||||
virtual String Key() const;
|
||||
virtual Image Make() const;
|
||||
};
|
||||
|
||||
String sImageAdd::Key() const
|
||||
{
|
||||
int64 a[2];
|
||||
a[0] = i1.GetSerialId();
|
||||
a[1] = i2.GetSerialId();
|
||||
return String((const char *)&a, 2 * sizeof(int64));
|
||||
}
|
||||
|
||||
Image sImageAdd::Make() const
|
||||
{
|
||||
Image dest = i1;
|
||||
Over(dest, Point(0, 0), i2, i2.GetSize());
|
||||
return dest;
|
||||
}
|
||||
|
||||
Image ImageOver(const Image& back, const Image& over)
|
||||
{
|
||||
sImageAdd h;
|
||||
h.i1 = back;
|
||||
h.i2 = over;
|
||||
return MakeImage(h);
|
||||
}
|
||||
|
||||
Image IdeFileImage(const String& filename, bool fast, bool include_path)
|
||||
{
|
||||
Image img = CtrlImg::File();
|
||||
IdeFileIcon0(false, filename, img, fast);
|
||||
IdeFileIcon0(false, filename, img);
|
||||
if(fast)
|
||||
img = ImageOver(img, IdeCommonImg::Fast());
|
||||
if(include_path)
|
||||
img = ImageOver(img, IdeCommonImg::IncludePath());
|
||||
return img;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ FileSel& AnyPackageFs();
|
|||
FileSel& BasedSourceFs();
|
||||
FileSel& OutputFs();
|
||||
|
||||
Image IdeFileImage(const String& filename, bool fast = false);
|
||||
Image IdeFileImage(const String& filename, bool fast = false, bool include_path = false);
|
||||
|
||||
bool FinishSave(String tmpfile, String outfile);
|
||||
bool FinishSave(String outfile);
|
||||
|
|
|
|||
|
|
@ -178,42 +178,24 @@ IMAGE_BEGIN(Source)
|
|||
IMAGE_SCAN("Ð")
|
||||
IMAGE_SCAN("Ð")
|
||||
IMAGE_PACKED(Source, "\2\20\0\0\0\20\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0")
|
||||
IMAGE_BEGIN(FastSource)
|
||||
IMAGE_SCAN("Ð")
|
||||
IMAGE_SCAN("Ð")
|
||||
IMAGE_SCAN("Æ„\0\0\0Æ")
|
||||
IMAGE_SCAN("Ä\2€€€\0\0\0‚\377\377\377‚\0\0\377‚\0\0\0Ä")
|
||||
IMAGE_SCAN("Ã\1€€€‚\377\377\377†\0\0\377\1€€€Ã")
|
||||
IMAGE_SCAN("Ã\2\0\0\0\377\377\377‚\0\0\377‚€€€ƒ\0\0\377\1\0\0\0Ã")
|
||||
IMAGE_SCAN("Â\2\0\0\0\377\377\377‚\0\0\377\1ÀÀÀÂ\1€€€‚\0\0€\1\0\0\0Ã")
|
||||
IMAGE_SCAN("Â\1\0\0\0‚\0\0\377\1€€€Å…\0\0\0")
|
||||
IMAGE_SCAN("Â\1\0\0\0‚\0\0\377\1ÀÀÀÅ\1\0\0\0ƒ\0\377\377\1\0\0\0")
|
||||
IMAGE_SCAN("Â\1\0\0\0ƒ\0\0\377\1ÀÀÀÂ\4€€€\377\377\377\0\0\0\0\377\377ƒ\0\0\0")
|
||||
IMAGE_SCAN("Ã\1\0\0\0ƒ\0\0\377‚ÀÀÀ\3\377\377\377\0\0\377\0\0\0ƒ\0\377\377\1\0\0\0")
|
||||
IMAGE_SCAN("Ã\1\0\0\0‡\0\0\377\2\0\0\0\0\377\377ƒ\0\0\0")
|
||||
IMAGE_SCAN("Ä‚\0\0\0„\0\0\377‚\0\0\0\2\0\377\377\0\0\0Â")
|
||||
IMAGE_SCAN("Æ„\0\0\0Áƒ\0\0\0Â")
|
||||
IMAGE_SCAN("Ð")
|
||||
IMAGE_SCAN("Ð")
|
||||
IMAGE_PACKED(FastSource, "\2\20\0\0\0\20\0\0\0\377\377\377\377\0\0\0\0\0\0\0\0")
|
||||
IMAGE_BEGIN(Fast)
|
||||
IMAGE_SCAN("Ð")
|
||||
IMAGE_SCAN("‰\0\0\0Å")
|
||||
IMAGE_SCAN("Â\1\0\0\0‡\0\377\377\1\0\0\0Å")
|
||||
IMAGE_SCAN("Â\1\0\0\0‡\0\377\377\1\0\0\0Å")
|
||||
IMAGE_SCAN("Â\1\0\0\0‚\0\377\377†\0\0\0Å")
|
||||
IMAGE_SCAN("Â\1\0\0\0‚\0\377\377\1\0\0\0Ê")
|
||||
IMAGE_SCAN("Â\1\0\0\0‚\0\377\377…\0\0\0Æ")
|
||||
IMAGE_SCAN("Â\1\0\0\0†\0\377\377\1\0\0\0Æ")
|
||||
IMAGE_SCAN("Â\1\0\0\0†\0\377\377\1\0\0\0Ã\1\0\0\0Â")
|
||||
IMAGE_SCAN("Â\1\0\0\0‚\0\377\377…\0\0\0Â\1\0\0\0Á\1\0\0\0Á")
|
||||
IMAGE_SCAN("Â\1\0\0\0‚\0\377\377\1\0\0\0È\1\0\0\0Á")
|
||||
IMAGE_SCAN("Â\1\0\0\0‚\0\377\377\1\0\0\0Ç\1\0\0\0Â")
|
||||
IMAGE_SCAN("Â\1\0\0\0‚\0\377\377\1\0\0\0Ç\1\0\0\0Â")
|
||||
IMAGE_SCAN("Â\1\0\0\0‚\0\377\377\1\0\0\0Ê")
|
||||
IMAGE_SCAN("„\0\0\0Ç\1\0\0\0Â")
|
||||
IMAGE_SCAN("Ð")
|
||||
IMAGE_PACKED(Fast, "\2\20\0\0\0\20\0\0\0\377\377\377\377\0\0\0\0\0\0\0\0")
|
||||
IMAGE_SCAN("Ð")
|
||||
IMAGE_SCAN("Ð")
|
||||
IMAGE_SCAN("Ì\1€€€Ã")
|
||||
IMAGE_SCAN("Ð")
|
||||
IMAGE_SCAN("Ð")
|
||||
IMAGE_SCAN("Ë…\0\0\0")
|
||||
IMAGE_SCAN("Ë\1\0\0\0ƒ\0\377\377\1\0\0\0")
|
||||
IMAGE_SCAN("Ë\2\0\0\0\0\377\377ƒ\0\0\0")
|
||||
IMAGE_SCAN("Ë\1\0\0\0ƒ\0\377\377\1\0\0\0")
|
||||
IMAGE_SCAN("Ë\2\0\0\0\0\377\377ƒ\0\0\0")
|
||||
IMAGE_SCAN("Ë\3\0\0\0\0\377\377\0\0\0Â")
|
||||
IMAGE_SCAN("˃\0\0\0Â")
|
||||
IMAGE_SCAN("Ð")
|
||||
IMAGE_SCAN("Ð")
|
||||
IMAGE_PACKED(Fast, "\2\20\0\0\0\20\0\0\0\377\177\0\0\0\0\0\0\0\0\0\0")
|
||||
IMAGE_BEGIN(ISource)
|
||||
IMAGE_SCAN("Ð")
|
||||
IMAGE_SCAN("Ð")
|
||||
|
|
@ -232,24 +214,6 @@ IMAGE_BEGIN(ISource)
|
|||
IMAGE_SCAN("Ð")
|
||||
IMAGE_SCAN("Ð")
|
||||
IMAGE_PACKED(ISource, "\2\20\0\0\0\20\0\0\0\377\377\377\377\0\0\0\0\0\0\0\0")
|
||||
IMAGE_BEGIN(FastISource)
|
||||
IMAGE_SCAN("Ð")
|
||||
IMAGE_SCAN("Ð")
|
||||
IMAGE_SCAN("Æ„\0\0\0Æ")
|
||||
IMAGE_SCAN("Ä\2€€€\0\0\0‚\377\377\377‚€€\0‚\0\0\0Ä")
|
||||
IMAGE_SCAN("Ã\1€€€‚\377\377\377†€€\0\1€€€Ã")
|
||||
IMAGE_SCAN("Ã\2\0\0\0\377\377\377‚€€\0‚€€€ƒ€€\0\1\0\0\0Ã")
|
||||
IMAGE_SCAN("Â\2\0\0\0\377\377\377‚€€\0\1ÀÀÀÂ\1€€€‚\0\0€\1\0\0\0Ã")
|
||||
IMAGE_SCAN("Â\1\0\0\0‚€€\0\1€€€Å…\0\0\0")
|
||||
IMAGE_SCAN("Â\1\0\0\0‚€€\0\1ÀÀÀÅ\1\0\0\0ƒ\0\377\377\1\0\0\0")
|
||||
IMAGE_SCAN("Â\1\0\0\0ƒ€€\0\1ÀÀÀÂ\4€€€\377\377\377\0\0\0\0\377\377ƒ\0\0\0")
|
||||
IMAGE_SCAN("Ã\1\0\0\0ƒ€€\0‚ÀÀÀ\3\377\377\377€€\0\0\0\0ƒ\0\377\377\1\0\0\0")
|
||||
IMAGE_SCAN("Ã\1\0\0\0‡€€\0\2\0\0\0\0\377\377ƒ\0\0\0")
|
||||
IMAGE_SCAN("Ä‚\0\0\0„€€\0‚\0\0\0\2\0\377\377\0\0\0Â")
|
||||
IMAGE_SCAN("Æ„\0\0\0Áƒ\0\0\0Â")
|
||||
IMAGE_SCAN("Ð")
|
||||
IMAGE_SCAN("Ð")
|
||||
IMAGE_PACKED(FastISource, "\2\20\0\0\0\20\0\0\0\377\377\377\377\0\0\0\0\0\0\0\0")
|
||||
IMAGE_BEGIN(Script)
|
||||
IMAGE_SCAN("Ð")
|
||||
IMAGE_SCAN("Ð")
|
||||
|
|
@ -304,3 +268,21 @@ IMAGE_BEGIN(Language)
|
|||
IMAGE_SCAN("Æ\2\0\0\0\377xK‡\0\0\377\1\0\0\0")
|
||||
IMAGE_SCAN("ÆŠ\0\0\0")
|
||||
IMAGE_PACKED(Language, "\2\20\0\0\0\20\0\0\0\377\377\377\377\0\0\0\0\0\0\0\0")
|
||||
IMAGE_BEGIN(IncludePath)
|
||||
IMAGE_SCAN("Ð")
|
||||
IMAGE_SCAN("Ð")
|
||||
IMAGE_SCAN("Ã\1\0\0\0Ì")
|
||||
IMAGE_SCAN("Â\3\0\0\0\0\377\377\0\0\0Ë")
|
||||
IMAGE_SCAN("Á\1\0\0\0ƒ\0\377\377\1\0\0\0Ê")
|
||||
IMAGE_SCAN("\1\0\0\0…\0\377\377\1\0\0\0É")
|
||||
IMAGE_SCAN("Á\1\0\0\0ƒ\0\377\377\1\0\0\0Ê")
|
||||
IMAGE_SCAN("Â\3\0\0\0\0\377\377\0\0\0Ë")
|
||||
IMAGE_SCAN("Ã\1\0\0\0Ì")
|
||||
IMAGE_SCAN("Ð")
|
||||
IMAGE_SCAN("Ð")
|
||||
IMAGE_SCAN("Ð")
|
||||
IMAGE_SCAN("Ð")
|
||||
IMAGE_SCAN("Ð")
|
||||
IMAGE_SCAN("Ð")
|
||||
IMAGE_SCAN("Ð")
|
||||
IMAGE_PACKED(IncludePath, "\2\20\0\0\0\20\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0")
|
||||
|
|
|
|||
|
|
@ -242,10 +242,11 @@ public:
|
|||
int font;
|
||||
String highlight;
|
||||
int optimize_speed;
|
||||
bool include_path;
|
||||
|
||||
void operator=(const String& s) { String::operator=(s); readonly = separator = false; }
|
||||
void Init() { readonly = separator = false; tabsize = Null; charset = 0; font = 0;
|
||||
optimize_speed = false; }
|
||||
optimize_speed = include_path = false; }
|
||||
|
||||
File() { Init(); }
|
||||
File(const String& s) : String(s) { Init(); }
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ file
|
|||
usc.cpp,
|
||||
Host.h,
|
||||
Host.cpp,
|
||||
common.iml,
|
||||
Info readonly separator,
|
||||
Copying;
|
||||
|
||||
|
|
|
|||
|
|
@ -264,6 +264,9 @@ void Package::Load(const char *path)
|
|||
if(p.Id("optimize_size"))
|
||||
file.Top().optimize_speed = false;
|
||||
else
|
||||
if(p.Id("include_path"))
|
||||
file.Top().include_path = true;
|
||||
else
|
||||
if(p.Id("readonly"))
|
||||
file.Top().readonly = true;
|
||||
else
|
||||
|
|
@ -365,6 +368,7 @@ void putfopt(Stream& out, const char *key, const Array<OptItem>& m)
|
|||
}
|
||||
|
||||
bool Package::Save(const char *path) const {
|
||||
DDUMP(path);
|
||||
StringStream out;
|
||||
if(description.GetCount() || italic || bold || !IsNull(ink)) {
|
||||
String d = description;
|
||||
|
|
@ -407,6 +411,10 @@ bool Package::Save(const char *path) const {
|
|||
out << " font " << f.font;
|
||||
if(f.optimize_speed)
|
||||
out << " optimize_speed";
|
||||
DDUMP(f);
|
||||
DDUMP(f.include_path);
|
||||
if(f.include_path)
|
||||
out << " include_path";
|
||||
if(f.charset > 0 && f.charset < CharsetCount() || f.charset == CHARSET_UTF8)
|
||||
out << " charset " << AsCString(CharsetName(f.charset));
|
||||
if(!IsNull(f.highlight))
|
||||
|
|
|
|||
1
uppsrc/ide/Core/common.iml
Normal file
1
uppsrc/ide/Core/common.iml
Normal file
|
|
@ -0,0 +1 @@
|
|||
PREMULTIPLIED
|
||||
|
|
@ -93,8 +93,12 @@ void PackageEditor::SaveOptions() {
|
|||
actual.accepts = Split(accepts.GetText().ToString(), ' ');
|
||||
actual.optimize_speed = optimize_speed;
|
||||
actual.noblitz = noblitz;
|
||||
if(IsActiveFile())
|
||||
if(IsActiveFile()) {
|
||||
ActiveFile().optimize_speed = optimize_speed_file;
|
||||
DDUMP(~include_path_file);
|
||||
ActiveFile().include_path = include_path_file;
|
||||
DDUMP(ActiveFile().include_path);
|
||||
}
|
||||
SavePackage();
|
||||
}
|
||||
}
|
||||
|
|
@ -130,6 +134,10 @@ void PackageEditor::FileEmpty()
|
|||
fileoption.Disable();
|
||||
optimize_speed_file = false;
|
||||
optimize_speed_file.Disable();
|
||||
include_path_file = false;
|
||||
include_path_file.Disable();
|
||||
includeable_file = false;
|
||||
includeable_file.Disable();
|
||||
}
|
||||
|
||||
void PackageEditor::OptionAdd(ArrayCtrl& option, int type, const char *title, const Array<OptItem>& o)
|
||||
|
|
@ -346,8 +354,14 @@ void PackageEditor::FileCursor()
|
|||
if(IsActiveFile()) {
|
||||
Package::File& f = ActiveFile();
|
||||
if(!f.separator) {
|
||||
optimize_speed_file.Enable();
|
||||
optimize_speed_file = actual.file[actualfileindex].optimize_speed;
|
||||
String p = GetActiveFilePath();
|
||||
bool tpp = GetFileExt(p) == ".tpp" && IsFolder(p);
|
||||
optimize_speed_file.Enable(!tpp);
|
||||
optimize_speed_file <<= actual.file[actualfileindex].optimize_speed;
|
||||
include_path_file.Enable(!tpp);
|
||||
include_path_file <<= actual.file[actualfileindex].include_path;
|
||||
includeable_file.Enable(tpp);
|
||||
includeable_file <<= FileExists(AppendFileName(p, "all.i"));
|
||||
fileoption.Enable();
|
||||
fileoption.Clear();
|
||||
OptionAdd(fileoption, FILEOPTION, "Additional compiler options for the file",
|
||||
|
|
@ -557,7 +571,10 @@ PackageEditor::PackageEditor()
|
|||
charset <<= THISBACK(SaveOptions);
|
||||
noblitz <<=
|
||||
optimize_speed <<=
|
||||
optimize_speed_file <<= THISBACK(SaveOptionsLoad);
|
||||
optimize_speed_file <<=
|
||||
include_path_file <<= THISBACK(SaveOptionsLoad);
|
||||
|
||||
includeable_file <<= THISBACK(ToggleIncludeable);
|
||||
|
||||
Add("Add/remove flags", actual.flag);
|
||||
Add("Uses", actual.uses);
|
||||
|
|
|
|||
|
|
@ -216,6 +216,7 @@ struct WorkspaceWork {
|
|||
void DelFile();
|
||||
void RenameFile();
|
||||
void ToggleFileSpeed();
|
||||
void ToggleAddInclude();
|
||||
void ToggleIncludeable();
|
||||
|
||||
void AddNormalUses();
|
||||
|
|
|
|||
|
|
@ -182,7 +182,7 @@ void WorkspaceWork::LoadActualPackage()
|
|||
}
|
||||
}
|
||||
}
|
||||
Image m = IdeFileImage(f, f.optimize_speed);
|
||||
Image m = IdeFileImage(f, f.optimize_speed, f.include_path);
|
||||
if(GetFileExt(p) == ".tpp" && IsFolder(p))
|
||||
if(FileExists(AppendFileName(p, "all.i")))
|
||||
m = TopicImg::IGroup();
|
||||
|
|
@ -712,7 +712,7 @@ void WorkspaceWork::FileMenu(Bar& menu)
|
|||
menu.Separator();
|
||||
String p = GetActiveFilePath();
|
||||
if(GetFileExt(p) == ".tpp" && IsFolder(p)) {
|
||||
menu.Add("Includeable", THISBACK(ToggleIncludeable))
|
||||
menu.Add("Includeable topic group", THISBACK(ToggleIncludeable))
|
||||
.Check(FileExists(AppendFileName(p, "all.i")));
|
||||
if(IsSvnDir(p))
|
||||
menu.Add("Svn Synchronize " + p, THISBACK1(SyncSvnDir, p));
|
||||
|
|
@ -720,10 +720,20 @@ void WorkspaceWork::FileMenu(Bar& menu)
|
|||
else
|
||||
menu.Add("Optimize for speed", THISBACK(ToggleFileSpeed))
|
||||
.Check(ActiveFile().optimize_speed);
|
||||
menu.Add("Add to include path", THISBACK(ToggleAddInclude))
|
||||
.Check(ActiveFile().include_path);
|
||||
}
|
||||
FilePropertiesMenu(menu);
|
||||
}
|
||||
|
||||
void WorkspaceWork::ToggleAddInclude()
|
||||
{
|
||||
if(IsActiveFile()) {
|
||||
ActiveFile().include_path = !ActiveFile().include_path;
|
||||
SaveLoadPackageNS();
|
||||
}
|
||||
}
|
||||
|
||||
void WorkspaceWork::ToggleFileSpeed()
|
||||
{
|
||||
if(IsActiveFile()) {
|
||||
|
|
|
|||
|
|
@ -1,57 +1,25 @@
|
|||
TOPIC("Files$en-us")
|
||||
#include "Files$en-us.tppi"
|
||||
END_TOPIC
|
||||
|
||||
TOPIC("Sponsor$en-us")
|
||||
#include "Sponsor$en-us.tppi"
|
||||
TOPIC("Flags$en-us")
|
||||
#include "Flags$en-us.tppi"
|
||||
END_TOPIC
|
||||
|
||||
TOPIC("Assist$en-us")
|
||||
#include "Assist$en-us.tppi"
|
||||
END_TOPIC
|
||||
|
||||
TOPIC("install$en-us")
|
||||
#include "install$en-us.tppi"
|
||||
END_TOPIC
|
||||
|
||||
TOPIC("index$en-us")
|
||||
#include "index$en-us.tppi"
|
||||
END_TOPIC
|
||||
|
||||
TOPIC("BSD$en-us")
|
||||
#include "BSD$en-us.tppi"
|
||||
END_TOPIC
|
||||
|
||||
TOPIC("IntroductionToUPP$en-us")
|
||||
#include "IntroductionToUPP$en-us.tppi"
|
||||
END_TOPIC
|
||||
|
||||
TOPIC("CrossComp$en-gb")
|
||||
#include "CrossComp$en-gb.tppi"
|
||||
END_TOPIC
|
||||
|
||||
TOPIC("PackageTemplates$en-us")
|
||||
#include "PackageTemplates$en-us.tppi"
|
||||
END_TOPIC
|
||||
|
||||
TOPIC("About$en-us")
|
||||
#include "About$en-us.tppi"
|
||||
END_TOPIC
|
||||
|
||||
TOPIC("esc$en-us")
|
||||
#include "esc$en-us.tppi"
|
||||
END_TOPIC
|
||||
|
||||
TOPIC("Keys$en-us")
|
||||
#include "Keys$en-us.tppi"
|
||||
END_TOPIC
|
||||
|
||||
TOPIC("Topic$en-us")
|
||||
#include "Topic$en-us.tppi"
|
||||
END_TOPIC
|
||||
|
||||
TOPIC("NewProject$en-us")
|
||||
#include "NewProject$en-us.tppi"
|
||||
TOPIC("cmdline$en-us")
|
||||
#include "cmdline$en-us.tppi"
|
||||
END_TOPIC
|
||||
|
||||
TOPIC("ConfiguringPackagesAssemblies$en-us")
|
||||
|
|
@ -66,10 +34,6 @@ TOPIC("IconDes$en-us")
|
|||
#include "IconDes$en-us.tppi"
|
||||
END_TOPIC
|
||||
|
||||
TOPIC("Blitz$en-us")
|
||||
#include "Blitz$en-us.tppi"
|
||||
END_TOPIC
|
||||
|
||||
TOPIC("macros$en-us")
|
||||
#include "macros$en-us.tppi"
|
||||
END_TOPIC
|
||||
|
|
@ -86,11 +50,47 @@ TOPIC("Contact$en-us")
|
|||
#include "Contact$en-us.tppi"
|
||||
END_TOPIC
|
||||
|
||||
TOPIC("Flags$en-us")
|
||||
#include "Flags$en-us.tppi"
|
||||
TOPIC("Files$en-us")
|
||||
#include "Files$en-us.tppi"
|
||||
END_TOPIC
|
||||
|
||||
TOPIC("cmdline$en-us")
|
||||
#include "cmdline$en-us.tppi"
|
||||
TOPIC("Sponsor$en-us")
|
||||
#include "Sponsor$en-us.tppi"
|
||||
END_TOPIC
|
||||
|
||||
TOPIC("BSD$en-us")
|
||||
#include "BSD$en-us.tppi"
|
||||
END_TOPIC
|
||||
|
||||
TOPIC("IntroductionToUPP$en-us")
|
||||
#include "IntroductionToUPP$en-us.tppi"
|
||||
END_TOPIC
|
||||
|
||||
TOPIC("CrossComp$en-gb")
|
||||
#include "CrossComp$en-gb.tppi"
|
||||
END_TOPIC
|
||||
|
||||
TOPIC("Keys$en-us")
|
||||
#include "Keys$en-us.tppi"
|
||||
END_TOPIC
|
||||
|
||||
TOPIC("Topic$en-us")
|
||||
#include "Topic$en-us.tppi"
|
||||
END_TOPIC
|
||||
|
||||
TOPIC("NewProject$en-us")
|
||||
#include "NewProject$en-us.tppi"
|
||||
END_TOPIC
|
||||
|
||||
TOPIC("Blitz$en-us")
|
||||
#include "Blitz$en-us.tppi"
|
||||
END_TOPIC
|
||||
|
||||
TOPIC("install$en-us")
|
||||
#include "install$en-us.tppi"
|
||||
END_TOPIC
|
||||
|
||||
TOPIC("About$en-us")
|
||||
#include "About$en-us.tppi"
|
||||
END_TOPIC
|
||||
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
|
|
@ -111,9 +111,11 @@ LAYOUT(UppLayout, 800, 576)
|
|||
UNTYPED(filelist, LeftPosZ(4, 240).VSizePosZ(384, 4))
|
||||
ITEM(ArrayCtrl, fileoption, HSizePosZ(248, 4).BottomPosZ(32, 92))
|
||||
ITEM(Option, optimize_speed_file, SetLabel(t_("Optimize the file for speed")).LeftPosZ(248, 152).BottomPosZ(9, 19))
|
||||
ITEM(Option, include_path_file, SetLabel(t_("Add to include path")).LeftPosZ(408, 124).BottomPosZ(9, 19))
|
||||
ITEM(Option, includeable_file, SetLabel(t_("Includeable group")).LeftPosZ(540, 112).BottomPosZ(9, 19))
|
||||
ITEM(Button, ok, SetLabel(t_("OK")).RightPosZ(76, 64).BottomPosZ(6, 22))
|
||||
ITEM(Button, cancel, SetLabel(t_("Cancel")).RightPosZ(8, 64).BottomPosZ(6, 22))
|
||||
ITEM(Label, dv___15, SetLabel(t_("Highlight")).LeftPosZ(596, 48).TopPosZ(4, 19))
|
||||
ITEM(Label, dv___17, SetLabel(t_("Highlight")).LeftPosZ(596, 48).TopPosZ(4, 19))
|
||||
ITEM(ColorPusher, ink, LeftPosZ(644, 52).TopPosZ(4, 20))
|
||||
ITEM(Option, bold, SetLabel(t_("Bold")).LeftPosZ(700, 44).TopPosZ(4, 20))
|
||||
ITEM(Option, italic, SetLabel(t_("Italic")).LeftPosZ(748, 44).TopPosZ(4, 20))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue