diff --git a/uppdev/AccessKey/main.cpp b/uppdev/AccessKey/main.cpp index 3d17491ee..1009c785e 100644 --- a/uppdev/AccessKey/main.cpp +++ b/uppdev/AccessKey/main.cpp @@ -1,35 +1,5 @@ #include "AccessKey.h" -#define KEYGROUPNAME "Ide" -#define KEYNAMESPACE IdeKeys -#define KEYFILE -#include - -#define KEYGROUPNAME "Ide" -#define KEYNAMESPACE IdeKeys -#define KEYFILE -#include - -AccessKey::AccessKey() -{ - CtrlLayoutOKCancel(*this, "Window title"); -} - -struct Test { - Test(); -}; - - -void Test::Ahoj() -{ -} - -12234523.234 -1234 -123456789000000000.124124 - -1000000000 -10000000000000000000000000000000000000000000.234234234 GUI_APP_MAIN { Ctrl::AddFlags(Ctrl::AKD_CONSERVATIVE); diff --git a/uppsrc/ide/Browser/Base.cpp b/uppsrc/ide/Browser/Base.cpp index 4a46cc2cf..b78d1bd79 100644 --- a/uppsrc/ide/Browser/Base.cpp +++ b/uppsrc/ide/Browser/Base.cpp @@ -181,7 +181,7 @@ void UpdateCodeBase(Progress& pi) String ext = ToUpper(GetFileExt(path)); if(ext == ".C" || ext == ".CPP" || ext == ".CC" || ext == ".CXX" || ext == ".ICPP" || ext == ".H" || ext == ".HPP" || ext == ".HH" || ext == ".HXX" || - ext == ".LAY" || ext == ".SCH") { + ext == ".LAY" || ext == ".SCH" || ext == ".IML") { fp.Add(path); int q = set.Find(path); Time tm = FileGetTime(path); @@ -219,6 +219,9 @@ void UpdateCodeBase(Progress& pi) if(ext == ".LAY") ScanLayFile(s_file); else + if(ext == ".IML") + ScanImlFile(s_file); + else if(ext == ".SCH") ScanSchFile(s_file); else { @@ -241,6 +244,9 @@ void CodeBaseScan(Stream& s, const String& fn) LLOG("Scan3 " << tm); if(ToUpper(GetFileExt(fn)) == ".SCH") ScanSchFile(fn); + else + if(ToUpper(GetFileExt(fn)) == ".IML") + ScanImlFile(fn); else Parse(s, IgnoreList(), base, fn, CNULL); LLOG("Scan4 " << tm); diff --git a/uppsrc/ide/Browser/Browser.h b/uppsrc/ide/Browser/Browser.h index a9f9df65d..181423cb1 100644 --- a/uppsrc/ide/Browser/Browser.h +++ b/uppsrc/ide/Browser/Browser.h @@ -31,6 +31,7 @@ void ReQualifyCodeBase(); void CodeBaseScanLay(const String& fn); void ScanLayFile(const char *fn); void ScanSchFile(const char *fn); +void ScanImlFile(const char *fn); String MakeCodeRef(const String& scope, const String& item); void SplitCodeRef(const String& ref, String& scope, String& item); diff --git a/uppsrc/ide/Browser/Browser.upp b/uppsrc/ide/Browser/Browser.upp index bb9acfc25..75c73b0df 100644 --- a/uppsrc/ide/Browser/Browser.upp +++ b/uppsrc/ide/Browser/Browser.upp @@ -10,6 +10,7 @@ file Browser.h, Browser readonly separator, Lay.cpp, + Iml.cpp, Sch.cpp, Base.cpp optimize_speed, Util.cpp, diff --git a/uppsrc/ide/Browser/Iml.cpp b/uppsrc/ide/Browser/Iml.cpp new file mode 100644 index 000000000..75ef1b0ff --- /dev/null +++ b/uppsrc/ide/Browser/Iml.cpp @@ -0,0 +1,56 @@ +#include "Browser.h" + +#define LDUMP(x) // DDUMP(x) + +void ScanImlFile(const char *fn) +{ + String s = LoadFile(fn); + + CParser p(s); + String iml, i_ml; + try { + p.PassId("PREMULTIPLIED"); + for(;;) { + if(p.Id("IMAGE_ID")) { + p.Char('('); + String id = p.ReadId(); + i_ml << "I_" << id << ",\n"; + iml << "static Image " << id << "();\n"; + p.Char(')'); + } + else + if(p.Id("IMAGE_META")) { + p.Char('('); + p.ReadString(); + p.Char(','); + p.ReadString(); + p.Char(')'); + } + else + break; + } + } + catch(CParser::Error) {} + + String r; + r << "struct " << GetFileTitle(fn) << "Img {\n"; + if(iml.GetCount()) + r << "enum {" << i_ml << "};\n" << iml; + r << + "static Iml& Iml();" + "static int Find(const UPP::String& s);" + "static int Find(const char *s);" + "static int GetCount();" + "static String GetId(int i);" + "static Image Get(int i);" + "static Image Get(const char *s);" + "static Image Get(const UPP::String& s);" + "static void Set(int i, const UPP::Image& m);" + "static void Set(const char *s, const UPP::Image& m);" + "static void Reset();" + "};\n"; + LDUMP(r); + StringStream ss(r); + CppBase& base = CodeBase(); + Parse(ss, IgnoreList(), base, fn, CNULL); +}