mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-09-01 15:52:41 -06:00
Syncing uppdev
git-svn-id: svn://ultimatepp.org/upp/trunk@1809 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
8d7cd39bb2
commit
fcfe4a5a37
16 changed files with 171 additions and 29 deletions
10
uppdev/CheckDomain/CheckDomain.upp
Normal file
10
uppdev/CheckDomain/CheckDomain.upp
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
uses
|
||||
Core,
|
||||
Web;
|
||||
|
||||
file
|
||||
CheckDomain.cpp;
|
||||
|
||||
mainconfig
|
||||
"" = "";
|
||||
|
||||
5
uppdev/CheckDomain/init
Normal file
5
uppdev/CheckDomain/init
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
#ifndef _CheckDomain_icpp_init_stub
|
||||
#define _CheckDomain_icpp_init_stub
|
||||
#include "Core/init"
|
||||
#include "Web/init"
|
||||
#endif
|
||||
|
|
@ -1,14 +1,16 @@
|
|||
#include <Core/Core.h>
|
||||
#include <plugin/z/z.h>
|
||||
|
||||
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);
|
||||
|
|
|
|||
11
uppdev/DrawText697/DrawText697.upp
Normal file
11
uppdev/DrawText697/DrawText697.upp
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
charset "UTF-8";
|
||||
|
||||
uses
|
||||
CtrlLib;
|
||||
|
||||
file
|
||||
main.cpp;
|
||||
|
||||
mainconfig
|
||||
"" = "GUI";
|
||||
|
||||
4
uppdev/DrawText697/init
Normal file
4
uppdev/DrawText697/init
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef _DrawText697_icpp_init_stub
|
||||
#define _DrawText697_icpp_init_stub
|
||||
#include "CtrlLib/init"
|
||||
#endif
|
||||
26
uppdev/DrawText697/main.cpp
Normal file
26
uppdev/DrawText697/main.cpp
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
#include <CtrlLib/CtrlLib.h>
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
struct Test : TopWindow {
|
||||
virtual void Paint(Draw& w) {
|
||||
WString s;
|
||||
s << "Napishite zdesʹ tekst dlya perevoda";
|
||||
Buffer<int> 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();
|
||||
}
|
||||
9
uppdev/LangInfo/LangInfo.h
Normal file
9
uppdev/LangInfo/LangInfo.h
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
#ifndef _LangInfo_LangInfo_h_
|
||||
#define _LangInfo_LangInfo_h_
|
||||
|
||||
#include <Core/Core.h>
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
|
||||
#endif
|
||||
|
|
@ -2,7 +2,8 @@ uses
|
|||
Core;
|
||||
|
||||
file
|
||||
LangInfo.cpp;
|
||||
LangInfo.h,
|
||||
main.cpp;
|
||||
|
||||
mainconfig
|
||||
"" = "";
|
||||
|
|
|
|||
4
uppdev/LangInfo/init
Normal file
4
uppdev/LangInfo/init
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef _LangInfo_icpp_init_stub
|
||||
#define _LangInfo_icpp_init_stub
|
||||
#include "Core/init"
|
||||
#endif
|
||||
52
uppdev/LangInfo/main.cpp
Normal file
52
uppdev/LangInfo/main.cpp
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
#include <Core/Core.h>
|
||||
|
||||
#include <winnls.h>
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
/*
|
||||
Vector<int> 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"));
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
LAYOUT(PDFLayout, 200, 100)
|
||||
|
||||
END_LAYOUT
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
"" = "";
|
||||
|
||||
|
|
|
|||
13
uppdev/PDF/app.iml
Normal file
13
uppdev/PDF/app.iml
Normal file
|
|
@ -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)
|
||||
4
uppdev/PDF/init
Normal file
4
uppdev/PDF/init
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef _PDF_icpp_init_stub
|
||||
#define _PDF_icpp_init_stub
|
||||
#include "PdfDraw/init"
|
||||
#endif
|
||||
|
|
@ -1,16 +1,20 @@
|
|||
#include "PDF.h"
|
||||
|
||||
#include <PdfDraw/PdfDraw.h>
|
||||
|
||||
GUI_APP_MAIN
|
||||
using namespace Upp;
|
||||
|
||||
#define IMAGECLASS AppImg
|
||||
#define IMAGEFILE <PDF/app.iml>
|
||||
#include <Draw/iml.h>
|
||||
|
||||
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");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue