diff --git a/uppdev/LangInfo/LangInfo.cpp b/uppdev/CheckDomain/CheckDomain.cpp similarity index 100% rename from uppdev/LangInfo/LangInfo.cpp rename to uppdev/CheckDomain/CheckDomain.cpp diff --git a/uppdev/CheckDomain/CheckDomain.upp b/uppdev/CheckDomain/CheckDomain.upp new file mode 100644 index 000000000..332620e08 --- /dev/null +++ b/uppdev/CheckDomain/CheckDomain.upp @@ -0,0 +1,10 @@ +uses + Core, + Web; + +file + CheckDomain.cpp; + +mainconfig + "" = ""; + diff --git a/uppdev/CheckDomain/init b/uppdev/CheckDomain/init new file mode 100644 index 000000000..309f88595 --- /dev/null +++ b/uppdev/CheckDomain/init @@ -0,0 +1,5 @@ +#ifndef _CheckDomain_icpp_init_stub +#define _CheckDomain_icpp_init_stub +#include "Core/init" +#include "Web/init" +#endif diff --git a/uppdev/DecompressPDF/DecompressPDF.cpp b/uppdev/DecompressPDF/DecompressPDF.cpp index 48d2aa6b8..36973eb4d 100644 --- a/uppdev/DecompressPDF/DecompressPDF.cpp +++ b/uppdev/DecompressPDF/DecompressPDF.cpp @@ -1,14 +1,16 @@ #include #include +using namespace Upp; + CONSOLE_APP_MAIN { - FileIn in("D:/paper-600.pdf"); - FileOut out("D:/paper-600a.pdf"); + FileIn in("u:/Dokument-A.pdf"); + FileOut out("u:/out.pdf"); while(!in.IsEof()) { String s = in.GetLine(); int q = s.Find("stream"); - if(q >= 0) + if(q < 0) out << s << "\n"; else { out << s.Mid(0, q + 6); diff --git a/uppdev/DrawText697/DrawText697.upp b/uppdev/DrawText697/DrawText697.upp new file mode 100644 index 000000000..7417ce342 --- /dev/null +++ b/uppdev/DrawText697/DrawText697.upp @@ -0,0 +1,11 @@ +charset "UTF-8"; + +uses + CtrlLib; + +file + main.cpp; + +mainconfig + "" = "GUI"; + diff --git a/uppdev/DrawText697/init b/uppdev/DrawText697/init new file mode 100644 index 000000000..1b95890be --- /dev/null +++ b/uppdev/DrawText697/init @@ -0,0 +1,4 @@ +#ifndef _DrawText697_icpp_init_stub +#define _DrawText697_icpp_init_stub +#include "CtrlLib/init" +#endif diff --git a/uppdev/DrawText697/main.cpp b/uppdev/DrawText697/main.cpp new file mode 100644 index 000000000..ce0d9f79b --- /dev/null +++ b/uppdev/DrawText697/main.cpp @@ -0,0 +1,26 @@ +#include + +using namespace Upp; + +struct Test : TopWindow { + virtual void Paint(Draw& w) { + WString s; + s << "Napishite zdesʹ tekst dlya perevoda"; + Buffer wd(s.GetLength()); + for(int i = 0; i < s.GetCount(); i++) + wd[i] = StdFont()[s[i]]; + w.DrawRect(GetSize(), White); + w.DrawText(100, 100, ~s, StdFont(), Black, s.GetLength(), wd); + w.DrawText(50, 200, ~s, StdFont(), Black, s.GetLength(), wd); + } +}; + +GUI_APP_MAIN +{ + DDUMP("Here"); + DocEdit e; + e.Set(WString("Napishite zdesʹ tekst dlya perevoda")); + Test t; + t.Add(e.TopPos(0, 50).HSizePos()); + t.Run(); +} diff --git a/uppdev/LangInfo/LangInfo.h b/uppdev/LangInfo/LangInfo.h new file mode 100644 index 000000000..6bddfa512 --- /dev/null +++ b/uppdev/LangInfo/LangInfo.h @@ -0,0 +1,9 @@ +#ifndef _LangInfo_LangInfo_h_ +#define _LangInfo_LangInfo_h_ + +#include + +using namespace Upp; + + +#endif diff --git a/uppdev/LangInfo/LangInfo.upp b/uppdev/LangInfo/LangInfo.upp index aaabd8cb0..554df076d 100644 --- a/uppdev/LangInfo/LangInfo.upp +++ b/uppdev/LangInfo/LangInfo.upp @@ -2,7 +2,8 @@ uses Core; file - LangInfo.cpp; + LangInfo.h, + main.cpp; mainconfig "" = ""; diff --git a/uppdev/LangInfo/init b/uppdev/LangInfo/init new file mode 100644 index 000000000..dfeea389f --- /dev/null +++ b/uppdev/LangInfo/init @@ -0,0 +1,4 @@ +#ifndef _LangInfo_icpp_init_stub +#define _LangInfo_icpp_init_stub +#include "Core/init" +#endif diff --git a/uppdev/LangInfo/main.cpp b/uppdev/LangInfo/main.cpp new file mode 100644 index 000000000..4669f35c7 --- /dev/null +++ b/uppdev/LangInfo/main.cpp @@ -0,0 +1,52 @@ +#include + +#include + +using namespace Upp; + +/* +Vector lang; + +static BOOL CALLBACK sEnumLocale(char *locale_string) +{ + LCID lcid = stou(locale_string, NULL, 16); + char buffer1[10], buffer2[10]; + ::GetLocaleInfo(lcid, LOCALE_SISO639LANGNAME, buffer1, 10); + ::GetLocaleInfo(lcid, LOCALE_SISO3166CTRYNAME, buffer2, 10); + int language = LNG_(buffer1[0], buffer1[1], buffer2[0], buffer2[1]); + String english_name = GetLocaleInfoA(lcid, LOCALE_SENGLANGUAGE); + String native_name = GetLocaleInfoW(lcid, LOCALE_SNATIVELANGNAME).ToString(); + String s; + lang.Add(LNG_(buffer1[0], buffer1[1], buffer2[0], buffer2[1])); + s << english_name << '\t' << native_name << '\t'; + s.Cat(HIBYTE(lcid)); + s.Cat(LOBYTE(lcid)); + LOG(AsCString(s, INT_MAX, NULL, ASCSTRING_OCTALHI) << ","); +// DDUMP(FormatIntHex(lcid)); + return TRUE; +} + +extern int LanguageList[]; +extern const char *LanguageInfoList[]; +*/ + +CONSOLE_APP_MAIN +{ +// EnumSystemLocales(&sEnumLocale, LCID_SUPPORTED); +/* for(int i = 0; i < lang.GetCount(); i++) { + String s = LNGAsText(lang[i]); + LOG(Format("LNG_('%c','%c','%c','%c'),", s[0], s[1], s[3], s[4])); + } +*/ + LanguageInfo lf = GetLanguageInfo(LNG_ENGLISH); + lf.day[0] = "Bloody monday"; + SetLanguageInfo(LNG_ENGLISH, lf); + + const int *lng = GetAllLanguages(); + int q = 0; + while(*lng) { + const LanguageInfo& lf = GetLanguageInfo(*lng++); + LOG(lf.native_name << ' ' << lf.day[0]); + DUMP(lf.Compare("Hovno", "Chleba")); + } +} diff --git a/uppdev/PDF/PDF.lay b/uppdev/PDF/PDF.lay index 345253b08..a753050c0 100644 --- a/uppdev/PDF/PDF.lay +++ b/uppdev/PDF/PDF.lay @@ -1,4 +1,3 @@ - LAYOUT(PDFLayout, 200, 100) - END_LAYOUT + diff --git a/uppdev/PDF/PDF.upp b/uppdev/PDF/PDF.upp index e0bf16c22..14c249513 100644 --- a/uppdev/PDF/PDF.upp +++ b/uppdev/PDF/PDF.upp @@ -1,12 +1,10 @@ -uses - CtrlLib, - PdfDraw; - -file - PDF.h, - main.cpp, - PDF.lay, - iml.iml; - -mainconfig - "" = "GUI"; +uses + PdfDraw; + +file + main.cpp, + app.iml; + +mainconfig + "" = ""; + diff --git a/uppdev/PDF/app.iml b/uppdev/PDF/app.iml new file mode 100644 index 000000000..f4cdcb633 --- /dev/null +++ b/uppdev/PDF/app.iml @@ -0,0 +1,13 @@ +PREMULTIPLIED +IMAGE_ID(test) +IMAGE_ID(testbw) +IMAGE_ID(testg) + +IMAGE_BEGIN_DATA +IMAGE_DATA(120,156,237,148,193,13,192,32,8,69,29,193,177,220,202,105,156,172,131,208,83,19,3,31,65,161,55,73,254,173,239,21) +IMAGE_DATA(3,90,106,169,197,40,82,226,41,122,90,131,49,28,180,98,153,3,121,76,118,209,135,155,5,142,109,150,159,229,242,33) +IMAGE_DATA(62,58,191,140,253,201,216,95,179,15,131,19,189,128,200,250,251,49,208,202,112,208,138,101,14,56,12,111,1,222,205,2) +IMAGE_DATA(199,54,203,28,151,143,241,209,249,101,236,79,198,254,154,125,24,156,232,5,68,214,252,24,140,49,136,71,147,161,111,17) +IMAGE_DATA(219,123,135,89,57,190,127,104,236,236,64,30,15,171,245,177,195,114,199,9,203,207,114,249,115,62,58,191,140,253,201,216) +IMAGE_DATA(223,232,253,57,189,191,47,80,123,150,223,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) +IMAGE_END_DATA(192, 3) diff --git a/uppdev/PDF/init b/uppdev/PDF/init new file mode 100644 index 000000000..131a0280b --- /dev/null +++ b/uppdev/PDF/init @@ -0,0 +1,4 @@ +#ifndef _PDF_icpp_init_stub +#define _PDF_icpp_init_stub +#include "PdfDraw/init" +#endif diff --git a/uppdev/PDF/main.cpp b/uppdev/PDF/main.cpp index 35151e797..32a6cae7e 100644 --- a/uppdev/PDF/main.cpp +++ b/uppdev/PDF/main.cpp @@ -1,16 +1,20 @@ -#include "PDF.h" - #include -GUI_APP_MAIN +using namespace Upp; + +#define IMAGECLASS AppImg +#define IMAGEFILE +#include + +CONSOLE_APP_MAIN { PdfDraw pdf; -// pdf.DrawRect(100, 100, 500, 500, Blue); - FontInfo fi = ScreenInfo().GetFontInfo(Roman(100)); - pdf.DrawRect(100, 100, 100, fi.GetHeight(), LtGray); - pdf.DrawRect(100, 100 + fi.GetAscent(), 100, 1, Blue); - pdf.DrawText(100, 100, "Ahoj", Roman(100), Black); - pdf.DrawRect(1000, 1000, 100, 100, LtGray); - pdf.DrawText(1000, 1000, 300, "Angle!", Roman(100), Black); - SaveFile("d:\\pdf.pdf", pdf.Finish()); +// pdf.DrawRect(400, 400, 500, 500, Blue); +// pdf.DrawText(100, 100, "Ahoj", Roman(100), Black); +// pdf.DrawText(100, 200, "Ahoj", Arial(100), Black); + pdf.DrawImage(100, 500, 200, 200, AppImg::test()); + pdf.DrawImage(300, 500, 200, 200, AppImg::testbw()); + pdf.DrawImage(500, 500, 200, 200, AppImg::testg()); + SaveFile("u:\\pdf.pdf", pdf.Finish()); + LaunchWebBrowser("u:\\pdf.pdf"); }