From a9150962fe3b8a7e05e4e09b46a4ed996b11e8c4 Mon Sep 17 00:00:00 2001 From: cxl Date: Sun, 21 Jun 2009 16:25:39 +0000 Subject: [PATCH] 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 --- tutorial/Sql06/main.cpp | 9 ++- uppdev/ArrayCtrl/ArrayCtrl.upp | 4 +- uppdev/ArrayCtrl/app.tpp/all.i | 0 uppsrc/Sql/srcdoc.tpp/tutorial$en-us.tpp | 27 +++++-- uppsrc/ide/Builders/Builders.h | 10 +-- uppsrc/ide/Builders/CppBuilder.cpp | 7 +- uppsrc/ide/Builders/GccBuilder.cpp | 15 ++-- uppsrc/ide/Builders/JavaBuilder.cpp | 7 +- uppsrc/ide/Builders/MscBuilder.cpp | 11 +-- uppsrc/ide/Common/ComDlg.cpp | 46 ++++++++++-- uppsrc/ide/Common/Common.h | 2 +- uppsrc/ide/Common/common.iml | 84 +++++++++------------- uppsrc/ide/Core/Core.h | 3 +- uppsrc/ide/Core/Core.upp | 1 - uppsrc/ide/Core/Package.cpp | 8 +++ uppsrc/ide/Core/common.iml | 1 + uppsrc/ide/UppDlg.cpp | 25 +++++-- uppsrc/ide/UppDlg.h | 1 + uppsrc/ide/UppWspc.cpp | 14 +++- uppsrc/ide/app.tpp/all.i | 88 +++++++++++------------ uppsrc/ide/icon.ico | Bin 2862 -> 2862 bytes uppsrc/ide/ide.lay | 4 +- 22 files changed, 223 insertions(+), 144 deletions(-) delete mode 100644 uppdev/ArrayCtrl/app.tpp/all.i create mode 100644 uppsrc/ide/Core/common.iml diff --git a/tutorial/Sql06/main.cpp b/tutorial/Sql06/main.cpp index 9a78a7731..b7e3e99f8 100644 --- a/tutorial/Sql06/main.cpp +++ b/tutorial/Sql06/main.cpp @@ -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"; diff --git a/uppdev/ArrayCtrl/ArrayCtrl.upp b/uppdev/ArrayCtrl/ArrayCtrl.upp index a4f404cce..2af767c87 100644 --- a/uppdev/ArrayCtrl/ArrayCtrl.upp +++ b/uppdev/ArrayCtrl/ArrayCtrl.upp @@ -6,8 +6,8 @@ uses file app.tpp, - ArrayCtrl.h, - main.cpp, + ArrayCtrl.h include_path, + main.cpp optimize_speed, src.tpp, srcimp.tpp; diff --git a/uppdev/ArrayCtrl/app.tpp/all.i b/uppdev/ArrayCtrl/app.tpp/all.i deleted file mode 100644 index e69de29bb..000000000 diff --git a/uppsrc/Sql/srcdoc.tpp/tutorial$en-us.tpp b/uppsrc/Sql/srcdoc.tpp/tutorial$en-us.tpp index eff86a1d9..f57e745eb 100644 --- a/uppsrc/Sql/srcdoc.tpp/tutorial$en-us.tpp +++ b/uppsrc/Sql/srcdoc.tpp/tutorial$en-us.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 &] @@ -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; ] \ No newline at end of file diff --git a/uppsrc/ide/Builders/Builders.h b/uppsrc/ide/Builders/Builders.h index acb12b09d..ee160c47e 100644 --- a/uppsrc/ide/Builders/Builders.h +++ b/uppsrc/ide/Builders/Builders.h @@ -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& 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& 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(); diff --git a/uppsrc/ide/Builders/CppBuilder.cpp b/uppsrc/ide/Builders/CppBuilder.cpp index 5e7110ed4..46e3ff94d 100644 --- a/uppsrc/ide/Builders/CppBuilder.cpp +++ b/uppsrc/ide/Builders/CppBuilder.cpp @@ -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(); diff --git a/uppsrc/ide/Builders/GccBuilder.cpp b/uppsrc/ide/Builders/GccBuilder.cpp index 941c76433..eb63e0c5b 100644 --- a/uppsrc/ide/Builders/GccBuilder.cpp +++ b/uppsrc/ide/Builders/GccBuilder.cpp @@ -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& 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& 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); diff --git a/uppsrc/ide/Builders/JavaBuilder.cpp b/uppsrc/ide/Builders/JavaBuilder.cpp index 1a5f51188..63825daab 100644 --- a/uppsrc/ide/Builders/JavaBuilder.cpp +++ b/uppsrc/ide/Builders/JavaBuilder.cpp @@ -127,7 +127,7 @@ bool JavaBuilder::BuildPackage(const String& package, Vector& 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; diff --git a/uppsrc/ide/Builders/MscBuilder.cpp b/uppsrc/ide/Builders/MscBuilder.cpp index b99fd53a4..a1d514c13 100644 --- a/uppsrc/ide/Builders/MscBuilder.cpp +++ b/uppsrc/ide/Builders/MscBuilder.cpp @@ -57,7 +57,7 @@ void MscBuilder::AddFlags(Index& 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& 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& 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() diff --git a/uppsrc/ide/Common/ComDlg.cpp b/uppsrc/ide/Common/ComDlg.cpp index b1f074b46..c0133a158 100644 --- a/uppsrc/ide/Common/ComDlg.cpp +++ b/uppsrc/ide/Common/ComDlg.cpp @@ -4,7 +4,7 @@ #define IMAGEFILE #include -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; } diff --git a/uppsrc/ide/Common/Common.h b/uppsrc/ide/Common/Common.h index c234eb551..87e50918a 100644 --- a/uppsrc/ide/Common/Common.h +++ b/uppsrc/ide/Common/Common.h @@ -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); diff --git a/uppsrc/ide/Common/common.iml b/uppsrc/ide/Common/common.iml index 80f80a6d6..3130e98ee 100644 --- a/uppsrc/ide/Common/common.iml +++ b/uppsrc/ide/Common/common.iml @@ -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") diff --git a/uppsrc/ide/Core/Core.h b/uppsrc/ide/Core/Core.h index 7a49e8c53..e016345ec 100644 --- a/uppsrc/ide/Core/Core.h +++ b/uppsrc/ide/Core/Core.h @@ -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(); } diff --git a/uppsrc/ide/Core/Core.upp b/uppsrc/ide/Core/Core.upp index b42cc3db4..659340c32 100644 --- a/uppsrc/ide/Core/Core.upp +++ b/uppsrc/ide/Core/Core.upp @@ -13,7 +13,6 @@ file usc.cpp, Host.h, Host.cpp, - common.iml, Info readonly separator, Copying; diff --git a/uppsrc/ide/Core/Package.cpp b/uppsrc/ide/Core/Package.cpp index b2bcc5590..5d3fb692d 100644 --- a/uppsrc/ide/Core/Package.cpp +++ b/uppsrc/ide/Core/Package.cpp @@ -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& 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)) diff --git a/uppsrc/ide/Core/common.iml b/uppsrc/ide/Core/common.iml new file mode 100644 index 000000000..a5b0ccf38 --- /dev/null +++ b/uppsrc/ide/Core/common.iml @@ -0,0 +1 @@ +PREMULTIPLIED diff --git a/uppsrc/ide/UppDlg.cpp b/uppsrc/ide/UppDlg.cpp index d6096f625..5cc4c855e 100644 --- a/uppsrc/ide/UppDlg.cpp +++ b/uppsrc/ide/UppDlg.cpp @@ -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& 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); diff --git a/uppsrc/ide/UppDlg.h b/uppsrc/ide/UppDlg.h index e4669f37d..063c108b5 100644 --- a/uppsrc/ide/UppDlg.h +++ b/uppsrc/ide/UppDlg.h @@ -216,6 +216,7 @@ struct WorkspaceWork { void DelFile(); void RenameFile(); void ToggleFileSpeed(); + void ToggleAddInclude(); void ToggleIncludeable(); void AddNormalUses(); diff --git a/uppsrc/ide/UppWspc.cpp b/uppsrc/ide/UppWspc.cpp index 79d7b0777..0f92f439b 100644 --- a/uppsrc/ide/UppWspc.cpp +++ b/uppsrc/ide/UppWspc.cpp @@ -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()) { diff --git a/uppsrc/ide/app.tpp/all.i b/uppsrc/ide/app.tpp/all.i index 4a9eb6876..e63417618 100644 --- a/uppsrc/ide/app.tpp/all.i +++ b/uppsrc/ide/app.tpp/all.i @@ -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 diff --git a/uppsrc/ide/icon.ico b/uppsrc/ide/icon.ico index 54590179a79cad732c4d9525e192c6914f87a836..a8a942b9fdf7478e707b058724070cccc9db220c 100644 GIT binary patch delta 1254 zcmcJOe@xVM7{_05cN|4Un+`1q*b135MMj7T90e}M55dX;L_9PPVrLyFaHPk5)rMrk z7@`y^(5B2mb=WUid0I&dR35`26KKHrC3sx?(BO_=7e8XzKlNAd?elq_*Yn=L}GT&KLEso?lSjhAcv8gp|0x3=hIJVb->~=Mgano$J1oMdh6%1*QWBGUo+1~eXXj{wjpe}a0iU>{L zMS`Z5oJuW{_;@ZHZYOH&H0q=+1dp!gWU2~nelg>1VRZJt!+^jF#8~&hN-8vNUR=$- z?C%L}G%~9mA%3(6tLt$N-1wB-y?UIgD@f7zGILbM8}dOyr+lekbBd9GJR3OKfUBd25Q92#CXPZ4c`Db`l)6qwm-2f%1GeM9EfUtE&+jbi6bZ&h>@?@)|SoDQHJurpB|t1*N8v7wiNN zI;@$rniEJ2JjkA|aNd-k;`|pY2|n~4?qgfY+Z2R-Wi58^O_BYr6;pB#`c-#m%*y1c z6F*Xy7RM=dKGJuciJ7r*A*=>n$NgQXB$bru4uJ-K=J zBT7R$*%lMaH}`*M((6Nf+vC~a`U-Z+&nb*(qOSf3-8a1m@Gn9w6_^-Q^YE4l|M!|H z{$0Y7trUrtQiaIIMxj)S6mwxg_7aIgs#Gc@fAM@#Dpf9;3WaD+3R|gkKAEpAvh6=v zVr#qPFZ4+yw)1iK0?ZE(&z+?K3oL$!?d=sJu~=dM_aEmT6EF1s=T)>*9QD=mN1wL& E6Q%3g+5i9m delta 1270 zcmaKoeN5DK9LHbW{q6t}iH0YNLe^4rq_PtbD$oU}XjY>62!wJF2182^D0V*;i)7e| zP7x?@ZeR}v2BA`?h!4XMBnhTY6cBt0AK>VI4mqF$qU;~v+jsAW&pr?P7O9FTnkJ0sR7O8oKL~FG?IOT&j`Z!(3 zQ@GpJi|%nBx&STVNtw7r+~k`tZ!>nvc|04dFFU8|e1EP5J93 z+;lx568p%WyAdI5cDv4{<_x?iw)1=U2IhI^qxaD9UH%_5XJ+7M7~nVc94aas*c(tv zwjq~InjVzrmJ!lbj()z8+Q(1Oq$LvZ#Fi)v>&_mbZ>EvfFn_YAq;sXIlZanEF_vG$ z?2yX!P|=RQHLEf9ZlTA;pCzRtCJ#pj2DIc(R??nf%kt(2)Vu8>-p&pmr=_HQ;lxyZ z2mw`XbeOi_9eI&pk3PnY^P*@$AUS#O^J;%14v7oMRjb*z(-w2*Q7Wc7;~uJ}aM@Rc zJkc|+HjN$P(>>S?tR?y5S{5~#I9;rxZKsUZ2pN69q_C8A)Yndm<< zo?7QI6jWa#A-Ec`eHZsv8i^Y3&5h_N)Ct9$f5VH~3wf-qDrI($3PrjL=7nPryfWFS z>11ERTDHd&lc&qVuriJsXVHV=^{cs%uP5fNih#a2x;MXu-Y%K`+a0v_Pve&Te!~1K zDBC+5!;Ns})z_eJ2_^5Ox8)lR6q;Y4#4m@f<{knPoau1zB-(i+_Yy>UW71IR|6+Y= zB4*VU>Sx&?EL7vR{2-kVyf`Z=>o|X>j!I(*CDQ{*`8uD`fhH6V(R3!oGg0-3Ny==} zHA&PZyvNL|-OS)^<_ASE0xOGnNoWB(-B6S?HiKCX!+J1~o&)ijno=(R*U7D{B&AX= zS!f703Wa2?R7#3}{9tHptsE{&lH3AGW^Fwv2D4!=`@dJnWFz&VK7~RiX+|atE)Xnl kWWkUZp7Ay|l3WlZoBwXK3=>A$pU->4g(am