mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
uppsrc: .icpp files replaced by INITIALIZE/INITIALIZER
git-svn-id: svn://ultimatepp.org/upp/trunk@10424 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
b857fe8e7b
commit
7710948f88
72 changed files with 535 additions and 489 deletions
|
|
@ -525,6 +525,8 @@ public:
|
|||
String ReadList(WithDropChoice<EditString>& e);
|
||||
void WriteList(WithDropChoice<EditString>& e, const String& data);
|
||||
|
||||
INITIALIZE(RegisterSyntax)
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ file
|
|||
CInit.cpp,
|
||||
CHighlight.cpp,
|
||||
CLogic.cpp,
|
||||
CRegister.icpp,
|
||||
RegisterSyntax.cpp,
|
||||
DiffSyntax readonly separator,
|
||||
DiffSyntax.h,
|
||||
DiffSyntax.cpp,
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ void CreateLogSyntax(One<EditorSyntax>& e)
|
|||
e.Create<LogSyntax>();
|
||||
}
|
||||
|
||||
INITBLOCK
|
||||
INITIALIZER(RegisterSyntax)
|
||||
{
|
||||
RegisterCSyntax("cpp", CSyntax::HIGHLIGHT_CPP,
|
||||
"*.c *.cpp *.cc *.cxx *.h *.hpp *.hh *.hxx *.m *.mm *.icpp *.conf",
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
#include "Core.h"
|
||||
|
||||
#define TFILE <Core/Core.t>
|
||||
#include <Core/t.h>
|
||||
1
uppsrc/Core/SSL/Init.icpp
Normal file
1
uppsrc/Core/SSL/Init.icpp
Normal file
|
|
@ -0,0 +1 @@
|
|||
#include "SSL.h"
|
||||
|
|
@ -53,7 +53,7 @@ static void *SslRealloc(void *ptr, size_t size)
|
|||
|
||||
void TcpSocketInit();
|
||||
|
||||
INITBLOCK
|
||||
INITIALIZER(SSL)
|
||||
{
|
||||
LLOG("SSL init");
|
||||
TcpSocketInit();
|
||||
|
|
@ -37,7 +37,8 @@ String GetP7Signature_imp(const void *data, int length, const String& cert_pem,
|
|||
|
||||
extern String (*GetP7Signature__)(const void *data, int length, const String& cert_pem, const String& pkey_pem);
|
||||
|
||||
INITBLOCK {
|
||||
INITIALIZER(P7S)
|
||||
{
|
||||
GetP7Signature__ = GetP7Signature_imp;
|
||||
}
|
||||
|
||||
|
|
@ -6,6 +6,10 @@
|
|||
#include <openssl/engine.h>
|
||||
|
||||
namespace Upp {
|
||||
|
||||
INITIALIZE(SSL);
|
||||
INITIALIZE(SSLSocket);
|
||||
INITIALIZE(P7S);
|
||||
|
||||
void SslInitThread();
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,8 @@ link(WIN32 MSC SO) /nodefaultlib:libc;
|
|||
file
|
||||
SSL.h,
|
||||
Util.cpp,
|
||||
InitExit.icpp,
|
||||
Socket.icpp,
|
||||
P7S.icpp;
|
||||
InitExit.cpp,
|
||||
Socket.cpp,
|
||||
P7S.cpp,
|
||||
Init.icpp;
|
||||
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ void InitCreateSSL()
|
|||
TcpSocket::CreateSSL = TcpSocket::CreateSSLImp;
|
||||
}
|
||||
|
||||
INITBLOCK {
|
||||
INITIALIZER(SSLSocket) {
|
||||
InitCreateSSL();
|
||||
}
|
||||
|
||||
|
|
@ -38,6 +38,8 @@
|
|||
|
||||
namespace Upp {
|
||||
|
||||
INITIALIZE(CtrlCore)
|
||||
|
||||
#ifdef _MULTITHREADED
|
||||
void EnterGuiMutex();
|
||||
void LeaveGuiMutex();
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ file
|
|||
CtrlTimer.cpp,
|
||||
CtrlClip.cpp,
|
||||
LocalLoop.cpp,
|
||||
CtrlCore.icpp,
|
||||
CtrlCoreInit.cpp,
|
||||
TopWindow.h,
|
||||
TopWindow.cpp,
|
||||
lay.h,
|
||||
|
|
|
|||
|
|
@ -1,22 +1,22 @@
|
|||
#include "CtrlCore.h"
|
||||
|
||||
namespace Upp {
|
||||
|
||||
#define TFILE <CtrlCore/CtrlCore.t>
|
||||
#include <Core/t.h>
|
||||
|
||||
static Image sRenderGlyph(int cx, int x, Font font, int chr, int py, int pcy)
|
||||
{
|
||||
ImageDraw iw(cx, pcy);
|
||||
iw.DrawRect(0, 0, cx, pcy, White);
|
||||
iw.DrawText(x, -py, WString(chr, 1), font, Black);
|
||||
return iw;
|
||||
}
|
||||
|
||||
void SetRenderGlyph(Image (*f)(int cx, int x, Font font, int chr, int py, int pcy));
|
||||
|
||||
INITBLOCK {
|
||||
SetRenderGlyph(sRenderGlyph);
|
||||
}
|
||||
|
||||
}
|
||||
#include "CtrlCore.h"
|
||||
|
||||
namespace Upp {
|
||||
|
||||
#define TFILE <CtrlCore/CtrlCore.t>
|
||||
#include <Core/t.h>
|
||||
|
||||
static Image sRenderGlyph(int cx, int x, Font font, int chr, int py, int pcy)
|
||||
{
|
||||
ImageDraw iw(cx, pcy);
|
||||
iw.DrawRect(0, 0, cx, pcy, White);
|
||||
iw.DrawText(x, -py, WString(chr, 1), font, Black);
|
||||
return iw;
|
||||
}
|
||||
|
||||
void SetRenderGlyph(Image (*f)(int cx, int x, Font font, int chr, int py, int pcy));
|
||||
|
||||
INITIALIZER(CtrlCore) {
|
||||
SetRenderGlyph(sRenderGlyph);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -9,6 +9,8 @@
|
|||
|
||||
namespace Upp {
|
||||
|
||||
INITIALIZE(CtrlLib);
|
||||
|
||||
#define IMAGECLASS CtrlImg
|
||||
#define IMAGEFILE <CtrlLib/Ctrl.iml>
|
||||
#include <Draw/iml_header.h>
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ file
|
|||
Ctrl.iml,
|
||||
Ctrl.lay,
|
||||
CtrlLib.t charset "UTF-8",
|
||||
CtrlLib.icpp,
|
||||
CtrlLibInit.cpp,
|
||||
Lang readonly separator,
|
||||
Lang.h,
|
||||
LNGCtrl.cpp,
|
||||
|
|
|
|||
|
|
@ -1,20 +1,18 @@
|
|||
#include "CtrlLib.h"
|
||||
|
||||
namespace Upp {
|
||||
|
||||
#define TFILE <CtrlLib/CtrlLib.t>
|
||||
#include <Core/t.h>
|
||||
|
||||
void CtrlSetDefaultSkin(void (*fn1)(), void (*fn2)());
|
||||
|
||||
#if defined(GUI_WIN) || defined(PLATFORM_X11)
|
||||
INITBLOCK {
|
||||
CtrlSetDefaultSkin(ChStdSkin, ChHostSkin);
|
||||
};
|
||||
#else
|
||||
INITBLOCK {
|
||||
CtrlSetDefaultSkin(ChStdSkin, ChStdSkin);
|
||||
};
|
||||
#endif
|
||||
|
||||
}
|
||||
#include "CtrlLib.h"
|
||||
|
||||
namespace Upp {
|
||||
|
||||
#define TFILE <CtrlLib/CtrlLib.t>
|
||||
#include <Core/t.h>
|
||||
|
||||
void CtrlSetDefaultSkin(void (*fn1)(), void (*fn2)());
|
||||
|
||||
INITIALIZER(CtrlLib) {
|
||||
#if defined(GUI_WIN) || defined(PLATFORM_X11)
|
||||
CtrlSetDefaultSkin(ChStdSkin, ChHostSkin);
|
||||
#else
|
||||
CtrlSetDefaultSkin(ChStdSkin, ChStdSkin);
|
||||
#endif
|
||||
};
|
||||
|
||||
}
|
||||
|
|
@ -292,4 +292,6 @@ typedef sb4 (*OCICallbackOutBind)(dvoid *octxp, UPP::OCIBind *bindp, ub4 iter,
|
|||
ub1 *piecep, dvoid **indp,
|
||||
ub2 **rcodep);
|
||||
|
||||
INITIALIZE(Oracle)
|
||||
|
||||
#endif//__Oracle_OciCommon__
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ link(SOLARIS SPARC) "-Wl,-R -Wl,/usr/local/bin";
|
|||
file
|
||||
OciCommon.h,
|
||||
Oracle.t charset "UTF-8",
|
||||
Oracle_init.icpp,
|
||||
Oracle_init.cpp,
|
||||
OracleSchema.h,
|
||||
OraCommon.h,
|
||||
OraCommon.cpp,
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
#include <Sql/Sql.h>
|
||||
|
||||
namespace Upp {
|
||||
|
||||
#define TFILE <Oracle/Oracle.t>
|
||||
#include <Core/t.h>
|
||||
|
||||
}
|
||||
#include <Sql/Sql.h>
|
||||
|
||||
namespace Upp {
|
||||
|
||||
#define TFILE <Oracle/Oracle.t>
|
||||
#include <Core/t.h>
|
||||
|
||||
INITIALIZER(Oracle)
|
||||
|
||||
}
|
||||
|
|
@ -320,7 +320,7 @@ static Image sRenderGlyph(Point at, int angle, int chr, Font fnt, Color color, S
|
|||
return ib;
|
||||
}
|
||||
|
||||
INITBLOCK
|
||||
INITIALIZER(PaintPainting)
|
||||
{
|
||||
RegisterPaintingFns__(PaintImageBufferPaintingFn, PaintImageBufferDrawingFn, sRenderGlyph);
|
||||
ImageAnyDrawPainter(sCP, sEP);
|
||||
|
|
@ -7,6 +7,8 @@
|
|||
|
||||
namespace Upp {
|
||||
|
||||
INITIALIZE(PaintPainting)
|
||||
|
||||
struct Xform2D {
|
||||
Pointf x, y, t;
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,8 @@ file
|
|||
DrawOp.cpp,
|
||||
Painting.h,
|
||||
Painting.cpp,
|
||||
PaintPainting.icpp,
|
||||
PaintPainting.cpp,
|
||||
PainterInit.icpp,
|
||||
BufferPainter.h,
|
||||
Xform2D.cpp,
|
||||
Approximate.cpp,
|
||||
|
|
|
|||
1
uppsrc/Painter/PainterInit.icpp
Normal file
1
uppsrc/Painter/PainterInit.icpp
Normal file
|
|
@ -0,0 +1 @@
|
|||
#include "Painter.h"
|
||||
|
|
@ -7,6 +7,8 @@
|
|||
|
||||
namespace Upp {
|
||||
|
||||
INITIALIZE(PdfDraw);
|
||||
|
||||
class TTFReader {
|
||||
struct TTFStream {
|
||||
struct Fail {};
|
||||
|
|
|
|||
|
|
@ -11,7 +11,8 @@ file
|
|||
TTFSubset.cpp,
|
||||
ICCColorSpace.i,
|
||||
PdfDraw.cpp,
|
||||
PdfReport.icpp,
|
||||
PdfReport.cpp,
|
||||
PdfInit.icpp,
|
||||
Info readonly separator,
|
||||
Copying;
|
||||
|
||||
|
|
|
|||
2
uppsrc/PdfDraw/PdfInit.icpp
Normal file
2
uppsrc/PdfDraw/PdfInit.icpp
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
#include "PdfDraw.h"
|
||||
|
||||
|
|
@ -14,7 +14,7 @@ String Pdf(const Array<Drawing>& report, Size sz, int margin, bool pdfa,
|
|||
return w.Finish(sign);
|
||||
}
|
||||
|
||||
INITBLOCK
|
||||
INITIALIZER(PdfDraw)
|
||||
{
|
||||
SetDrawingToPdfFn(Pdf);
|
||||
}
|
||||
|
|
@ -8,7 +8,6 @@ file
|
|||
Report.h options(BUILDER_OPTION) PCH,
|
||||
Report.cpp,
|
||||
ReportDlg.cpp,
|
||||
ReportI.icpp,
|
||||
Report.lay,
|
||||
Report.t charset "UTF-8",
|
||||
srcdoc.tpp;
|
||||
|
|
|
|||
|
|
@ -4,6 +4,9 @@ namespace Upp {
|
|||
|
||||
#define LLOG(x) // LOG(x)
|
||||
|
||||
#define TFILE <Report/Report.t>
|
||||
#include <Core/t.h>
|
||||
|
||||
void Print(Report& r, PrinterJob& pd)
|
||||
{
|
||||
Draw& w = pd;
|
||||
|
|
|
|||
|
|
@ -1,8 +0,0 @@
|
|||
#include "Report.h"
|
||||
|
||||
namespace Upp {
|
||||
|
||||
#define TFILE <Report/Report.t>
|
||||
#include <Core/t.h>
|
||||
|
||||
}
|
||||
|
|
@ -2,6 +2,9 @@
|
|||
|
||||
namespace Upp {
|
||||
|
||||
#define TFILE <RichEdit/RichEdit.t>
|
||||
#include <Core/t.h>
|
||||
|
||||
bool FontHeight::Key(dword key, int count)
|
||||
{
|
||||
if(key == K_ENTER) {
|
||||
|
|
|
|||
|
|
@ -1,8 +0,0 @@
|
|||
#include "RichEdit.h"
|
||||
|
||||
namespace Upp {
|
||||
|
||||
#define TFILE <RichEdit/RichEdit.t>
|
||||
#include <Core/t.h>
|
||||
|
||||
}
|
||||
|
|
@ -25,7 +25,6 @@ file
|
|||
StyleKeys.cpp,
|
||||
HeaderFooter.cpp,
|
||||
RichEdit.t charset "UTF-8",
|
||||
RichEdit.icpp,
|
||||
RichEdit.lay,
|
||||
RichEdit.iml,
|
||||
Info readonly separator,
|
||||
|
|
|
|||
|
|
@ -1,316 +1,318 @@
|
|||
#include "RichText.h"
|
||||
|
||||
namespace Upp {
|
||||
|
||||
#ifdef NEWIMAGE
|
||||
|
||||
struct RichImage : public RichObjectType {
|
||||
virtual String GetTypeName(const Value& v) const;
|
||||
virtual Size GetPhysicalSize(const Value& data) const;
|
||||
virtual Size GetPixelSize(const Value& data) const;
|
||||
virtual void Paint(const Value& data, Draw& w, Size sz, void *) const;
|
||||
virtual Image ToImage(const Value& data, Size sz, void *) const;
|
||||
|
||||
virtual bool Accept(PasteClip& clip);
|
||||
virtual Value Read(PasteClip& clip);
|
||||
virtual String GetClipFmts() const;
|
||||
virtual String GetClip(const Value& data, const String& fmt) const;
|
||||
|
||||
typedef RichImage CLASSNAME;
|
||||
};
|
||||
|
||||
String RichImage::GetTypeName(const Value& v) const
|
||||
{
|
||||
return "image";
|
||||
}
|
||||
|
||||
static String (*sGetImageClip)(const Image& img, const String& fmt);
|
||||
static bool (*sAcceptImage)(PasteClip& clip);
|
||||
static Image (*sGetImage)(PasteClip& clip);
|
||||
static const char *(*sClipFmtsImage)();
|
||||
|
||||
void InitRichImage(String (*fGetImageClip)(const Image& img, const String& fmt),
|
||||
bool (*fAcceptImage)(PasteClip& clip),
|
||||
Image (*fGetImage)(PasteClip& clip),
|
||||
const char *(*fClipFmtsImage)())
|
||||
{
|
||||
sGetImageClip = fGetImageClip;
|
||||
sAcceptImage = fAcceptImage;
|
||||
sGetImage = fGetImage;
|
||||
sClipFmtsImage = fClipFmtsImage;
|
||||
}
|
||||
|
||||
bool RichImage::Accept(PasteClip& clip)
|
||||
{
|
||||
return sAcceptImage ? sAcceptImage(clip) : false;
|
||||
}
|
||||
|
||||
Value RichImage::Read(PasteClip& clip)
|
||||
{
|
||||
if(sGetImage)
|
||||
return StoreImageAsString(sGetImage(clip));
|
||||
return Null;
|
||||
}
|
||||
|
||||
String RichImage::GetClipFmts() const
|
||||
{
|
||||
if(sClipFmtsImage)
|
||||
return sClipFmtsImage();
|
||||
return Null;
|
||||
}
|
||||
|
||||
String RichImage::GetClip(const Value& data, const String& fmt) const
|
||||
{
|
||||
if(sGetImageClip)
|
||||
return sGetImageClip(LoadImageFromString(data), fmt);
|
||||
return Null;
|
||||
}
|
||||
|
||||
Size RichImage::GetPixelSize(const Value& data) const
|
||||
{
|
||||
return GetImageStringSize(data);
|
||||
}
|
||||
|
||||
Size RichImage::GetPhysicalSize(const Value& data) const
|
||||
{
|
||||
Size sz = GetImageStringDots(data);
|
||||
if(sz.cx == 0 || sz.cy == 0)
|
||||
sz = 600 * GetPixelSize(data) / 96;
|
||||
return sz;
|
||||
}
|
||||
|
||||
void RichImage::Paint(const Value& data, Draw& w, Size sz, void *) const
|
||||
{
|
||||
Image x = LoadImageFromString(data);
|
||||
// Size outsz(min(sz.cx, 4 * x.GetWidth()), min(sz.cy, 4 * x.GetHeight()));
|
||||
w.DrawImage(0, 0, sz.cx, sz.cy, x);
|
||||
}
|
||||
|
||||
Image RichImage::ToImage(const Value& data, Size sz, void *) const
|
||||
{
|
||||
return Rescale(LoadImageFromString(data), sz);
|
||||
}
|
||||
|
||||
INITBLOCK {
|
||||
RichObject::Register("image", &Single<RichImage>());
|
||||
};
|
||||
|
||||
RichObject CreateImageObject(const Image& img, int cx, int cy)
|
||||
{
|
||||
RichObject o = RichObject("image", StoreImageAsString(img));
|
||||
if(cx || cy)
|
||||
o.SetSize(GetRatioSize(o.GetPixelSize(), cx, cy));
|
||||
return o;
|
||||
}
|
||||
|
||||
struct RichPNG : public RichObjectType {
|
||||
virtual String GetTypeName(const Value& v) const;
|
||||
virtual Value Read(const String& s) const;
|
||||
virtual String Write(const Value& v) const;
|
||||
virtual Size GetPhysicalSize(const Value& data) const;
|
||||
virtual Size GetPixelSize(const Value& data) const;
|
||||
virtual void Paint(const Value& data, Draw& w, Size sz) const;
|
||||
virtual Image ToImage(const Value& data, Size sz, void *) const;
|
||||
};
|
||||
|
||||
String RichPNG::GetTypeName(const Value& v) const
|
||||
{
|
||||
return IsString(v) ? "PNG" : "image";
|
||||
}
|
||||
|
||||
Value RichPNG::Read(const String& s) const
|
||||
{
|
||||
Image img = StreamRaster::LoadStringAny(s);
|
||||
if(img)
|
||||
return img;
|
||||
return s;
|
||||
}
|
||||
|
||||
String RichPNG::Write(const Value& v) const
|
||||
{
|
||||
if(IsString(v))
|
||||
return v;
|
||||
return StoreImageAsString(v);
|
||||
}
|
||||
|
||||
Size RichPNG::GetPhysicalSize(const Value& data) const
|
||||
{
|
||||
if(IsString(data))
|
||||
return Size(0, 0);
|
||||
return Image(data).GetDots();
|
||||
}
|
||||
|
||||
Size RichPNG::GetPixelSize(const Value& data) const
|
||||
{
|
||||
if(IsString(data))
|
||||
return Size(0, 0);
|
||||
return Image(data).GetDots();
|
||||
}
|
||||
|
||||
void RichPNG::Paint(const Value& data, Draw& w, Size sz) const
|
||||
{
|
||||
if(IsString(data)) {
|
||||
w.DrawRect(sz, SColorFace());
|
||||
DrawFrame(w, sz, SColorText());
|
||||
w.DrawText(2, 2, "plugin/png missing!");
|
||||
return;
|
||||
}
|
||||
Image x = Image(data);
|
||||
Size outsz(min(sz.cx, 4 * x.GetWidth()), min(sz.cy, 4 * x.GetHeight()));
|
||||
w.DrawImage(0, 0, outsz.cx, outsz.cy, x);
|
||||
}
|
||||
|
||||
Image RichPNG::ToImage(const Value& data, Size sz, void *) const
|
||||
{
|
||||
if(IsString(data)) {
|
||||
ImageAnyDraw iw(sz);
|
||||
Paint(data, iw, sz);
|
||||
return iw;
|
||||
}
|
||||
Image x = Image(data);
|
||||
Size outsz(min(sz.cx, 4 * x.GetWidth()), min(sz.cy, 4 * x.GetHeight()));
|
||||
return Rescale(x, outsz);
|
||||
}
|
||||
|
||||
INITBLOCK {
|
||||
RichObject::Register("PNG", &Single<RichPNG>());
|
||||
};
|
||||
|
||||
struct RichRawImage : public RichObjectType {
|
||||
virtual String GetTypeName(const Value& v) const;
|
||||
virtual Value Read(const String& s) const;
|
||||
virtual String Write(const Value& v) const;
|
||||
virtual Size GetPhysicalSize(const Value& data) const;
|
||||
virtual Size GetPixelSize(const Value& data) const;
|
||||
virtual void Paint(const Value& data, Draw& w, Size sz, void *) const;
|
||||
virtual Image ToImage(const Value& data, Size sz, void *) const;
|
||||
};
|
||||
|
||||
String RichRawImage::GetTypeName(const Value& v) const
|
||||
{
|
||||
return "rawimage";
|
||||
}
|
||||
|
||||
Value RichRawImage::Read(const String& s) const
|
||||
{
|
||||
return s;
|
||||
}
|
||||
|
||||
String RichRawImage::Write(const Value& v) const
|
||||
{
|
||||
return v;
|
||||
}
|
||||
|
||||
Size RichRawImage::GetPhysicalSize(const Value& data) const
|
||||
{
|
||||
String s = data;
|
||||
StringStream ss(s);
|
||||
One<StreamRaster> r = StreamRaster::OpenAny(ss);
|
||||
if(r)
|
||||
return r->GetInfo().dots;
|
||||
return Size(0, 0);
|
||||
}
|
||||
|
||||
Size RichRawImage::GetPixelSize(const Value& data) const
|
||||
{
|
||||
String s = data;
|
||||
StringStream ss(s);
|
||||
One<StreamRaster> r = StreamRaster::OpenAny(ss);
|
||||
if(r)
|
||||
return r->GetSize();
|
||||
return Size(0, 0);
|
||||
}
|
||||
|
||||
void RichRawImage::Paint(const Value& data, Draw& w, Size sz, void *) const
|
||||
{
|
||||
String s = data;
|
||||
StringStream ss(s);
|
||||
One<StreamRaster> r = StreamRaster::OpenAny(ss);
|
||||
if(r) {
|
||||
Size isz = r->GetSize();
|
||||
if(isz.cx * isz.cy > sz.cx * sz.cy) { // conserve memory by scaling down from source
|
||||
ImageEncoder m;
|
||||
Rescale(m, sz, *r, r->GetSize());
|
||||
w.DrawImage(0, 0, sz.cx, sz.cy, m);
|
||||
}
|
||||
else
|
||||
w.DrawImage(0, 0, sz.cx, sz.cy, r->GetImage()); // scale up by Draw to give e.g. PDF chance to store unscaled
|
||||
}
|
||||
}
|
||||
|
||||
Image RichRawImage::ToImage(const Value& data, Size sz, void *) const
|
||||
{
|
||||
String s = data;
|
||||
StringStream ss(s);
|
||||
One<StreamRaster> r = StreamRaster::OpenAny(ss);
|
||||
if(r) {
|
||||
Image x = r->GetImage();
|
||||
return Rescale(x, sz);
|
||||
}
|
||||
return Null;
|
||||
}
|
||||
|
||||
INITBLOCK {
|
||||
RichObject::Register("rawimage", &Single<RichRawImage>());
|
||||
};
|
||||
|
||||
RichObject CreateRawImageObject(const String& s, int cx, int cy)
|
||||
{
|
||||
RichObject o = RichObject("rawimage", s);
|
||||
o.InitSize(cx, cy);
|
||||
return o;
|
||||
}
|
||||
|
||||
struct RichImlImage : public RichObjectType {
|
||||
virtual String GetTypeName(const Value& v) const;
|
||||
virtual Size GetPhysicalSize(const Value& data) const;
|
||||
virtual Size GetPixelSize(const Value& data) const;
|
||||
virtual void Paint(const Value& data, Draw& w, Size sz) const;
|
||||
virtual Image ToImage(const Value& data, Size sz, void *) const;
|
||||
virtual bool IsText() const;
|
||||
|
||||
Image Get(const Value& v) const;
|
||||
};
|
||||
|
||||
Image RichImlImage::Get(const Value& v) const
|
||||
{
|
||||
return GetImlImage((String)v);
|
||||
}
|
||||
|
||||
String RichImlImage::GetTypeName(const Value& v) const
|
||||
{
|
||||
return "iml";
|
||||
}
|
||||
|
||||
bool RichImlImage::IsText() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
Size RichImlImage::GetPhysicalSize(const Value& data) const
|
||||
{
|
||||
return Get(data).GetSize();
|
||||
}
|
||||
|
||||
Size RichImlImage::GetPixelSize(const Value& data) const
|
||||
{
|
||||
return Get(data).GetSize();
|
||||
}
|
||||
|
||||
void RichImlImage::Paint(const Value& data, Draw& w, Size sz) const
|
||||
{
|
||||
w.DrawImage(0, 0, sz.cx, sz.cy, Get(data));
|
||||
}
|
||||
|
||||
Image RichImlImage::ToImage(const Value& data, Size sz, void *) const
|
||||
{
|
||||
return Rescale(Get(data), sz);
|
||||
}
|
||||
|
||||
INITBLOCK {
|
||||
RichObject::Register("iml", &Single<RichImlImage>());
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
#include "RichText.h"
|
||||
|
||||
namespace Upp {
|
||||
|
||||
#ifdef NEWIMAGE
|
||||
|
||||
struct RichImage : public RichObjectType {
|
||||
virtual String GetTypeName(const Value& v) const;
|
||||
virtual Size GetPhysicalSize(const Value& data) const;
|
||||
virtual Size GetPixelSize(const Value& data) const;
|
||||
virtual void Paint(const Value& data, Draw& w, Size sz, void *) const;
|
||||
virtual Image ToImage(const Value& data, Size sz, void *) const;
|
||||
|
||||
virtual bool Accept(PasteClip& clip);
|
||||
virtual Value Read(PasteClip& clip);
|
||||
virtual String GetClipFmts() const;
|
||||
virtual String GetClip(const Value& data, const String& fmt) const;
|
||||
|
||||
typedef RichImage CLASSNAME;
|
||||
};
|
||||
|
||||
String RichImage::GetTypeName(const Value& v) const
|
||||
{
|
||||
return "image";
|
||||
}
|
||||
|
||||
static String (*sGetImageClip)(const Image& img, const String& fmt);
|
||||
static bool (*sAcceptImage)(PasteClip& clip);
|
||||
static Image (*sGetImage)(PasteClip& clip);
|
||||
static const char *(*sClipFmtsImage)();
|
||||
|
||||
void InitRichImage(String (*fGetImageClip)(const Image& img, const String& fmt),
|
||||
bool (*fAcceptImage)(PasteClip& clip),
|
||||
Image (*fGetImage)(PasteClip& clip),
|
||||
const char *(*fClipFmtsImage)())
|
||||
{
|
||||
sGetImageClip = fGetImageClip;
|
||||
sAcceptImage = fAcceptImage;
|
||||
sGetImage = fGetImage;
|
||||
sClipFmtsImage = fClipFmtsImage;
|
||||
}
|
||||
|
||||
bool RichImage::Accept(PasteClip& clip)
|
||||
{
|
||||
return sAcceptImage ? sAcceptImage(clip) : false;
|
||||
}
|
||||
|
||||
Value RichImage::Read(PasteClip& clip)
|
||||
{
|
||||
if(sGetImage)
|
||||
return StoreImageAsString(sGetImage(clip));
|
||||
return Null;
|
||||
}
|
||||
|
||||
String RichImage::GetClipFmts() const
|
||||
{
|
||||
if(sClipFmtsImage)
|
||||
return sClipFmtsImage();
|
||||
return Null;
|
||||
}
|
||||
|
||||
String RichImage::GetClip(const Value& data, const String& fmt) const
|
||||
{
|
||||
if(sGetImageClip)
|
||||
return sGetImageClip(LoadImageFromString(data), fmt);
|
||||
return Null;
|
||||
}
|
||||
|
||||
Size RichImage::GetPixelSize(const Value& data) const
|
||||
{
|
||||
return GetImageStringSize(data);
|
||||
}
|
||||
|
||||
Size RichImage::GetPhysicalSize(const Value& data) const
|
||||
{
|
||||
Size sz = GetImageStringDots(data);
|
||||
if(sz.cx == 0 || sz.cy == 0)
|
||||
sz = 600 * GetPixelSize(data) / 96;
|
||||
return sz;
|
||||
}
|
||||
|
||||
void RichImage::Paint(const Value& data, Draw& w, Size sz, void *) const
|
||||
{
|
||||
Image x = LoadImageFromString(data);
|
||||
// Size outsz(min(sz.cx, 4 * x.GetWidth()), min(sz.cy, 4 * x.GetHeight()));
|
||||
w.DrawImage(0, 0, sz.cx, sz.cy, x);
|
||||
}
|
||||
|
||||
Image RichImage::ToImage(const Value& data, Size sz, void *) const
|
||||
{
|
||||
return Rescale(LoadImageFromString(data), sz);
|
||||
}
|
||||
|
||||
INITBLOCK {
|
||||
RichObject::Register("image", &Single<RichImage>());
|
||||
};
|
||||
|
||||
RichObject CreateImageObject(const Image& img, int cx, int cy)
|
||||
{
|
||||
RichObject o = RichObject("image", StoreImageAsString(img));
|
||||
if(cx || cy)
|
||||
o.SetSize(GetRatioSize(o.GetPixelSize(), cx, cy));
|
||||
return o;
|
||||
}
|
||||
|
||||
struct RichPNG : public RichObjectType {
|
||||
virtual String GetTypeName(const Value& v) const;
|
||||
virtual Value Read(const String& s) const;
|
||||
virtual String Write(const Value& v) const;
|
||||
virtual Size GetPhysicalSize(const Value& data) const;
|
||||
virtual Size GetPixelSize(const Value& data) const;
|
||||
virtual void Paint(const Value& data, Draw& w, Size sz) const;
|
||||
virtual Image ToImage(const Value& data, Size sz, void *) const;
|
||||
};
|
||||
|
||||
String RichPNG::GetTypeName(const Value& v) const
|
||||
{
|
||||
return IsString(v) ? "PNG" : "image";
|
||||
}
|
||||
|
||||
Value RichPNG::Read(const String& s) const
|
||||
{
|
||||
Image img = StreamRaster::LoadStringAny(s);
|
||||
if(img)
|
||||
return img;
|
||||
return s;
|
||||
}
|
||||
|
||||
String RichPNG::Write(const Value& v) const
|
||||
{
|
||||
if(IsString(v))
|
||||
return v;
|
||||
return StoreImageAsString(v);
|
||||
}
|
||||
|
||||
Size RichPNG::GetPhysicalSize(const Value& data) const
|
||||
{
|
||||
if(IsString(data))
|
||||
return Size(0, 0);
|
||||
return Image(data).GetDots();
|
||||
}
|
||||
|
||||
Size RichPNG::GetPixelSize(const Value& data) const
|
||||
{
|
||||
if(IsString(data))
|
||||
return Size(0, 0);
|
||||
return Image(data).GetDots();
|
||||
}
|
||||
|
||||
void RichPNG::Paint(const Value& data, Draw& w, Size sz) const
|
||||
{
|
||||
if(IsString(data)) {
|
||||
w.DrawRect(sz, SColorFace());
|
||||
DrawFrame(w, sz, SColorText());
|
||||
w.DrawText(2, 2, "plugin/png missing!");
|
||||
return;
|
||||
}
|
||||
Image x = Image(data);
|
||||
Size outsz(min(sz.cx, 4 * x.GetWidth()), min(sz.cy, 4 * x.GetHeight()));
|
||||
w.DrawImage(0, 0, outsz.cx, outsz.cy, x);
|
||||
}
|
||||
|
||||
Image RichPNG::ToImage(const Value& data, Size sz, void *) const
|
||||
{
|
||||
if(IsString(data)) {
|
||||
ImageAnyDraw iw(sz);
|
||||
Paint(data, iw, sz);
|
||||
return iw;
|
||||
}
|
||||
Image x = Image(data);
|
||||
Size outsz(min(sz.cx, 4 * x.GetWidth()), min(sz.cy, 4 * x.GetHeight()));
|
||||
return Rescale(x, outsz);
|
||||
}
|
||||
|
||||
INITBLOCK {
|
||||
RichObject::Register("PNG", &Single<RichPNG>());
|
||||
};
|
||||
|
||||
struct RichRawImage : public RichObjectType {
|
||||
virtual String GetTypeName(const Value& v) const;
|
||||
virtual Value Read(const String& s) const;
|
||||
virtual String Write(const Value& v) const;
|
||||
virtual Size GetPhysicalSize(const Value& data) const;
|
||||
virtual Size GetPixelSize(const Value& data) const;
|
||||
virtual void Paint(const Value& data, Draw& w, Size sz, void *) const;
|
||||
virtual Image ToImage(const Value& data, Size sz, void *) const;
|
||||
};
|
||||
|
||||
String RichRawImage::GetTypeName(const Value& v) const
|
||||
{
|
||||
return "rawimage";
|
||||
}
|
||||
|
||||
Value RichRawImage::Read(const String& s) const
|
||||
{
|
||||
return s;
|
||||
}
|
||||
|
||||
String RichRawImage::Write(const Value& v) const
|
||||
{
|
||||
return v;
|
||||
}
|
||||
|
||||
Size RichRawImage::GetPhysicalSize(const Value& data) const
|
||||
{
|
||||
String s = data;
|
||||
StringStream ss(s);
|
||||
One<StreamRaster> r = StreamRaster::OpenAny(ss);
|
||||
if(r)
|
||||
return r->GetInfo().dots;
|
||||
return Size(0, 0);
|
||||
}
|
||||
|
||||
Size RichRawImage::GetPixelSize(const Value& data) const
|
||||
{
|
||||
String s = data;
|
||||
StringStream ss(s);
|
||||
One<StreamRaster> r = StreamRaster::OpenAny(ss);
|
||||
if(r)
|
||||
return r->GetSize();
|
||||
return Size(0, 0);
|
||||
}
|
||||
|
||||
void RichRawImage::Paint(const Value& data, Draw& w, Size sz, void *) const
|
||||
{
|
||||
String s = data;
|
||||
StringStream ss(s);
|
||||
One<StreamRaster> r = StreamRaster::OpenAny(ss);
|
||||
if(r) {
|
||||
Size isz = r->GetSize();
|
||||
if(isz.cx * isz.cy > sz.cx * sz.cy) { // conserve memory by scaling down from source
|
||||
ImageEncoder m;
|
||||
Rescale(m, sz, *r, r->GetSize());
|
||||
w.DrawImage(0, 0, sz.cx, sz.cy, m);
|
||||
}
|
||||
else
|
||||
w.DrawImage(0, 0, sz.cx, sz.cy, r->GetImage()); // scale up by Draw to give e.g. PDF chance to store unscaled
|
||||
}
|
||||
}
|
||||
|
||||
Image RichRawImage::ToImage(const Value& data, Size sz, void *) const
|
||||
{
|
||||
String s = data;
|
||||
StringStream ss(s);
|
||||
One<StreamRaster> r = StreamRaster::OpenAny(ss);
|
||||
if(r) {
|
||||
Image x = r->GetImage();
|
||||
return Rescale(x, sz);
|
||||
}
|
||||
return Null;
|
||||
}
|
||||
|
||||
INITBLOCK {
|
||||
RichObject::Register("rawimage", &Single<RichRawImage>());
|
||||
};
|
||||
|
||||
RichObject CreateRawImageObject(const String& s, int cx, int cy)
|
||||
{
|
||||
RichObject o = RichObject("rawimage", s);
|
||||
o.InitSize(cx, cy);
|
||||
return o;
|
||||
}
|
||||
|
||||
struct RichImlImage : public RichObjectType {
|
||||
virtual String GetTypeName(const Value& v) const;
|
||||
virtual Size GetPhysicalSize(const Value& data) const;
|
||||
virtual Size GetPixelSize(const Value& data) const;
|
||||
virtual void Paint(const Value& data, Draw& w, Size sz) const;
|
||||
virtual Image ToImage(const Value& data, Size sz, void *) const;
|
||||
virtual bool IsText() const;
|
||||
|
||||
Image Get(const Value& v) const;
|
||||
};
|
||||
|
||||
Image RichImlImage::Get(const Value& v) const
|
||||
{
|
||||
return GetImlImage((String)v);
|
||||
}
|
||||
|
||||
String RichImlImage::GetTypeName(const Value& v) const
|
||||
{
|
||||
return "iml";
|
||||
}
|
||||
|
||||
bool RichImlImage::IsText() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
Size RichImlImage::GetPhysicalSize(const Value& data) const
|
||||
{
|
||||
return Get(data).GetSize();
|
||||
}
|
||||
|
||||
Size RichImlImage::GetPixelSize(const Value& data) const
|
||||
{
|
||||
return Get(data).GetSize();
|
||||
}
|
||||
|
||||
void RichImlImage::Paint(const Value& data, Draw& w, Size sz) const
|
||||
{
|
||||
w.DrawImage(0, 0, sz.cx, sz.cy, Get(data));
|
||||
}
|
||||
|
||||
Image RichImlImage::ToImage(const Value& data, Size sz, void *) const
|
||||
{
|
||||
return Rescale(Get(data), sz);
|
||||
}
|
||||
|
||||
INITBLOCK {
|
||||
RichObject::Register("iml", &Single<RichImlImage>());
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
INITIALIZER(RichImage) {}
|
||||
|
||||
}
|
||||
|
|
@ -6,6 +6,8 @@
|
|||
|
||||
namespace Upp {
|
||||
|
||||
INITIALIZE(RichImage)
|
||||
|
||||
class PasteClip;
|
||||
struct RichPara;
|
||||
class RichTable;
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ uses
|
|||
file
|
||||
RichText.h options(BUILDER_OPTION) PCH,
|
||||
Object.cpp,
|
||||
RichImage.icpp,
|
||||
RichImage.cpp,
|
||||
Para.h,
|
||||
ParaData.cpp,
|
||||
ParaType.cpp,
|
||||
|
|
|
|||
|
|
@ -245,4 +245,6 @@ void SQLObjectTree(SqlSession& session APPSQLSESSION);
|
|||
|
||||
}
|
||||
|
||||
INITIALIZE(SqlCtrl)
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ uses
|
|||
file
|
||||
SqlCtrl.h options(BUILDER_OPTION) PCH,
|
||||
SqlCtrl.t charset "UTF-8",
|
||||
SqlCtrl_init.icpp,
|
||||
SqlCtrl_init.cpp,
|
||||
SqlCtrl.cpp,
|
||||
SqlArray.cpp,
|
||||
SqlDetail.cpp,
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
#include "SqlCtrl.h"
|
||||
|
||||
namespace Upp {
|
||||
|
||||
#define TFILE <SqlCtrl/SqlCtrl.t>
|
||||
#include <Core/t.h>
|
||||
|
||||
}
|
||||
#include "SqlCtrl.h"
|
||||
|
||||
namespace Upp {
|
||||
|
||||
#define TFILE <SqlCtrl/SqlCtrl.t>
|
||||
#include <Core/t.h>
|
||||
|
||||
INITIALIZER(SqlCtrl)
|
||||
|
||||
}
|
||||
|
|
@ -14,6 +14,8 @@
|
|||
#define IMAGEFILE <ide/Browser/Browser.iml>
|
||||
#include <Draw/iml_header.h>
|
||||
|
||||
INITIALIZE(TopicModule)
|
||||
|
||||
class Browser;
|
||||
|
||||
CppBase& CodeBase();
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ file
|
|||
TopicWin.cpp,
|
||||
Move.cpp,
|
||||
CodeRef.cpp,
|
||||
TopicI.icpp,
|
||||
TopicI.cpp,
|
||||
Topic.lay,
|
||||
Topic.iml,
|
||||
Info readonly separator,
|
||||
|
|
|
|||
|
|
@ -1,30 +1,31 @@
|
|||
#include "Browser.h"
|
||||
|
||||
bool IsTopicGroup(const char *path)
|
||||
{
|
||||
return ToLower(GetFileExt(path)) == ".tpp" && (!IsFullPath(path) || !FileExists(path));
|
||||
}
|
||||
|
||||
struct TopicModule : public IdeModule {
|
||||
virtual String GetID() { return "TopicModule"; }
|
||||
|
||||
virtual Image FileIcon(const char *path) {
|
||||
return IsTopicGroup(path) ? TopicImg::Group() : Null;
|
||||
}
|
||||
virtual IdeDesigner *CreateDesigner(const char *path, byte cs) {
|
||||
if(IsTopicGroup(path)) {
|
||||
TopicEditor *d = new TopicEditor;
|
||||
d->PersistentFindReplace(TheIde()->IsPersistentFindReplace());
|
||||
d->Open(path);
|
||||
return d;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
virtual void Serialize(Stream& s) {
|
||||
TopicEditor::SerializeEditPos(s);
|
||||
}
|
||||
};
|
||||
|
||||
INITBLOCK {
|
||||
RegisterIdeModule(Single<TopicModule>());
|
||||
}
|
||||
#include "Browser.h"
|
||||
|
||||
bool IsTopicGroup(const char *path)
|
||||
{
|
||||
return ToLower(GetFileExt(path)) == ".tpp" && (!IsFullPath(path) || !FileExists(path));
|
||||
}
|
||||
|
||||
struct TopicModule : public IdeModule {
|
||||
virtual String GetID() { return "TopicModule"; }
|
||||
|
||||
virtual Image FileIcon(const char *path) {
|
||||
return IsTopicGroup(path) ? TopicImg::Group() : Null;
|
||||
}
|
||||
virtual IdeDesigner *CreateDesigner(const char *path, byte cs) {
|
||||
if(IsTopicGroup(path)) {
|
||||
TopicEditor *d = new TopicEditor;
|
||||
d->PersistentFindReplace(TheIde()->IsPersistentFindReplace());
|
||||
d->Open(path);
|
||||
return d;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
virtual void Serialize(Stream& s) {
|
||||
TopicEditor::SerializeEditPos(s);
|
||||
}
|
||||
};
|
||||
|
||||
INITIALIZER(TopicModule)
|
||||
{
|
||||
RegisterIdeModule(Single<TopicModule>());
|
||||
}
|
||||
|
|
@ -874,7 +874,7 @@ Builder *CreateAndroidBuilder()
|
|||
return new AndroidBuilder();
|
||||
}
|
||||
|
||||
INITBLOCK
|
||||
INITIALIZER(AndroidBuilder)
|
||||
{
|
||||
Index<String> builders = AndroidBuilder::GetBuildersNames();
|
||||
for(int i = 0; i < builders.GetCount(); i++)
|
||||
|
|
@ -248,4 +248,10 @@ private:
|
|||
|
||||
void DeletePCHFile(const String& pch_file);
|
||||
|
||||
INITIALIZE(GccBuilder)
|
||||
INITIALIZE(MscBuilder)
|
||||
INITIALIZE(JavaBuilder)
|
||||
INITIALIZE(AndroidBuilder)
|
||||
INITIALIZE(ScriptBuilder)
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -14,11 +14,11 @@ file
|
|||
MakeFile.cpp,
|
||||
coff.h,
|
||||
Builders readonly separator,
|
||||
GccBuilder.icpp,
|
||||
MscBuilder.icpp,
|
||||
JavaBuilder.icpp,
|
||||
AndroidBuilder.icpp,
|
||||
ScriptBuilder.icpp,
|
||||
GccBuilder.cpp,
|
||||
MscBuilder.cpp,
|
||||
JavaBuilder.cpp,
|
||||
AndroidBuilder.cpp,
|
||||
ScriptBuilder.cpp,
|
||||
Android readonly separator,
|
||||
Android.h,
|
||||
AndroidProject.cpp,
|
||||
|
|
|
|||
|
|
@ -583,7 +583,7 @@ Builder *CreateGccBuilder()
|
|||
return new GccBuilder;
|
||||
}
|
||||
|
||||
INITBLOCK
|
||||
INITIALIZER(GccBuilder)
|
||||
{
|
||||
RegisterBuilder("GCC", CreateGccBuilder);
|
||||
RegisterBuilder("CLANG", CreateGccBuilder);
|
||||
|
|
@ -311,7 +311,7 @@ static Builder *CreateJavaBuilder()
|
|||
return new JavaBuilder;
|
||||
}
|
||||
|
||||
INITBLOCK
|
||||
INITIALIZER(JavaBuilder)
|
||||
{
|
||||
RegisterBuilder("JDK", &CreateJavaBuilder);
|
||||
}
|
||||
|
|
@ -703,7 +703,7 @@ Builder *CreateMscBuilder()
|
|||
return new MscBuilder;
|
||||
}
|
||||
|
||||
INITBLOCK
|
||||
INITIALIZER(MscBuilder)
|
||||
{
|
||||
RegisterBuilder("MSC71", CreateMscBuilder);
|
||||
RegisterBuilder("MSC8", CreateMscBuilder);
|
||||
|
|
@ -283,7 +283,7 @@ Builder *CreateScriptBuilder()
|
|||
return new ScriptBuilder;
|
||||
}
|
||||
|
||||
INITBLOCK
|
||||
INITIALIZER(ScriptBuilder)
|
||||
{
|
||||
RegisterBuilder("SCRIPT", CreateScriptBuilder);
|
||||
}
|
||||
|
|
@ -224,4 +224,6 @@ struct Gdb : Debugger, ParentCtrl {
|
|||
#include "Pdb.h"
|
||||
#endif
|
||||
|
||||
INITIALIZE(UppSimplifiers)
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ file
|
|||
Gdb_MI2Explore.cpp,
|
||||
Gdb_MI2Gdb.cpp,
|
||||
Gdb_MI2.cpp,
|
||||
UppSimplifiers.icpp,
|
||||
UppSimplifiers.cpp,
|
||||
PDB readonly separator,
|
||||
Pdb.h,
|
||||
cvconst.h,
|
||||
|
|
|
|||
|
|
@ -654,6 +654,8 @@ static int UppValueSimplify(VarItem &varItem, int step)
|
|||
|
||||
}
|
||||
|
||||
INITIALIZER(UppSimplifiers) {}
|
||||
|
||||
// Register the simplifiers
|
||||
REGISTERSIMPLIFIER("Upp::String" , UppStringSimplify);
|
||||
REGISTERSIMPLIFIER("Upp::Vector<" , UppVectorSimplify);
|
||||
|
|
@ -61,4 +61,8 @@ public:
|
|||
|
||||
bool FileIsBinary(const char *path);
|
||||
|
||||
INITIALIZE(Img)
|
||||
INITIALIZE(Qtf)
|
||||
INITIALIZE(HexView)
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ uses
|
|||
file
|
||||
Designers.h,
|
||||
Png.cpp,
|
||||
Img.icpp,
|
||||
Qtf.icpp,
|
||||
HexView.icpp;
|
||||
Img.cpp,
|
||||
Qtf.cpp,
|
||||
HexView.cpp;
|
||||
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@ FileHexView::~FileHexView()
|
|||
StoreToGlobal(*this, "FileHexView");
|
||||
}
|
||||
|
||||
INITBLOCK {
|
||||
INITIALIZER(HexView)
|
||||
{
|
||||
RegisterGlobalConfig("FileHexView");
|
||||
}
|
||||
|
|
@ -74,7 +74,7 @@ struct ImageViewModule : public IdeModule {
|
|||
}
|
||||
};
|
||||
|
||||
INITBLOCK
|
||||
INITIALIZER(Img)
|
||||
{
|
||||
RegisterIdeModule(Single<ImageViewModule>());
|
||||
}
|
||||
|
|
@ -144,7 +144,7 @@ struct QtfDesModule : public IdeModule {
|
|||
}
|
||||
};
|
||||
|
||||
INITBLOCK
|
||||
INITIALIZER(Qtf)
|
||||
{
|
||||
RegisterIdeModule(Single<QtfDesModule>());
|
||||
RegisterGlobalConfig("qtfdes-ctrl");
|
||||
|
|
@ -37,4 +37,6 @@ struct IdeIconEditPos : IconDes::EditPos, Moveable<IdeIconEditPos> {
|
|||
IdeIconEditPos() { filetime = Null; }
|
||||
};
|
||||
|
||||
INITIALIZE(IconDes);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ uses
|
|||
file
|
||||
IconDes.h,
|
||||
IconDes.cpp,
|
||||
IdeDes.icpp,
|
||||
IdeDes.cpp,
|
||||
Info readonly separator,
|
||||
Copying;
|
||||
|
||||
|
|
|
|||
|
|
@ -114,6 +114,6 @@ void IdeIconDes::ListMenuEx(Bar& bar)
|
|||
bar.Add(n.GetCount(), "Copy '" + c + '\'', CtrlImg::copy(), THISBACK1(CopyId, c));
|
||||
}
|
||||
|
||||
INITBLOCK {
|
||||
INITIALIZER(IconDes) {
|
||||
RegisterGlobalConfig("icondes-ctrl");
|
||||
}
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
namespace Upp {
|
||||
|
||||
INITBLOCK {
|
||||
INITIALIZER(DroidFonts) {
|
||||
SetMemoryFont(Font::SANSSERIF, Font_DroidSans, Font_DroidSans_length);
|
||||
SetMemoryFont(Font::SANSSERIF, Font_DroidSans_Bold, Font_DroidSans_Bold_length, FtBOLD);
|
||||
SetMemoryFont(Font::SERIF, Font_DroidSerif, Font_DroidSerif_length);
|
||||
12
uppsrc/plugin/DroidFonts/DroidFonts.h
Normal file
12
uppsrc/plugin/DroidFonts/DroidFonts.h
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
#ifndef _plugin_DroidFonts_DroidFonts_h_
|
||||
#define _plugin_DroidFonts_DroidFonts_h_
|
||||
|
||||
#include <plugin/FT_fontsys/FT_fontsys.h>
|
||||
|
||||
namespace Upp {
|
||||
|
||||
INITIALIZE(DroidFonts)
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
@ -4,7 +4,9 @@ uses
|
|||
plugin/FT_fontsys;
|
||||
|
||||
file
|
||||
DroidFonts.icpp,
|
||||
DroidFonts.h,
|
||||
DroidFonts.cpp,
|
||||
DroidFontsInit.icpp,
|
||||
DroidFonts.brc,
|
||||
Info readonly separator,
|
||||
Copying;
|
||||
|
|
|
|||
|
|
@ -284,4 +284,9 @@ BMPRaster::~BMPRaster()
|
|||
{
|
||||
}
|
||||
|
||||
INITIALIZER(BMPRaster)
|
||||
{
|
||||
StreamRaster::Register<BMPRaster>();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1 @@
|
|||
#include "bmp.h"
|
||||
|
||||
namespace Upp {
|
||||
|
||||
INITBLOCK {
|
||||
StreamRaster::Register<BMPRaster>();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@
|
|||
#include <Draw/Draw.h>
|
||||
|
||||
namespace Upp {
|
||||
|
||||
INITIALIZE(BMPRaster);
|
||||
|
||||
class BMPRaster : public StreamRaster {
|
||||
Size size;
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@
|
|||
#include <Draw/Draw.h>
|
||||
|
||||
namespace Upp {
|
||||
|
||||
INITIALIZE(PNGRaster);
|
||||
|
||||
class PNGRaster : public StreamRaster {
|
||||
class Data;
|
||||
|
|
|
|||
|
|
@ -1,9 +1 @@
|
|||
#include "png.h"
|
||||
|
||||
namespace Upp {
|
||||
|
||||
INITBLOCK {
|
||||
StreamRaster::Register<PNGRaster>();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -514,4 +514,8 @@ void PNGEncoder::WriteLineRaw(const byte *s)
|
|||
data->WriteLineRaw(s);
|
||||
}
|
||||
|
||||
INITIALIZER(PNGRaster) {
|
||||
StreamRaster::Register<PNGRaster>();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,6 +31,8 @@ struct tiff *TIFFFileStreamOpen(const char *filename, const char *mode);
|
|||
//struct tiff* TIFFWrapOpen(const char*, const char*);
|
||||
//int TIFFWrapGetField(::tiff* tif_data, uint32 tag, ...);
|
||||
|
||||
INITIALIZE(TIFRaster);
|
||||
|
||||
class TIFRaster : public StreamRaster {
|
||||
public:
|
||||
struct Data;
|
||||
|
|
|
|||
|
|
@ -1,9 +1 @@
|
|||
#include "tif.h"
|
||||
|
||||
namespace Upp {
|
||||
|
||||
INITBLOCK {
|
||||
StreamRaster::Register<TIFRaster>();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1314,4 +1314,9 @@ void TIFEncoder::WriteLineRaw(const byte *s)
|
|||
data->WriteLineRaw(s);
|
||||
}
|
||||
|
||||
|
||||
INITIALIZER(TIFRaster) {
|
||||
StreamRaster::Register<TIFRaster>();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue