mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-04-07 13:55:33 +08:00
all functions
This commit is contained in:
@ -135,7 +135,7 @@ JSSmart<CJSValue> CGraphicsEmbed::reset()
|
||||
}
|
||||
JSSmart<CJSValue> CGraphicsEmbed::transform3(JSSmart<CJSValue> sx, JSSmart<CJSValue> shy, JSSmart<CJSValue> shx, JSSmart<CJSValue> sy, JSSmart<CJSValue> tx, JSSmart<CJSValue> ty, JSSmart<CJSValue> isNeedInvert)
|
||||
{
|
||||
m_pInternal->transform3(sx->toDouble(), shy->toDouble(), shx->toDouble(), sy->toDouble(), tx->toDouble(), ty->toDouble(), isNeedInvert->toBool());
|
||||
m_pInternal->transform3(sx->toDouble(), shy->toDouble(), shx->toDouble(), sy->toDouble(), tx->toDouble(), ty->toDouble());
|
||||
return NULL;
|
||||
}
|
||||
JSSmart<CJSValue> CGraphicsEmbed::FreeFont()
|
||||
@ -259,22 +259,22 @@ JSSmart<CJSValue> CGraphicsEmbed::DrawStringASCII2(JSSmart<CJSValue> name, JSSma
|
||||
}
|
||||
JSSmart<CJSValue> CGraphicsEmbed::DrawHeaderEdit(JSSmart<CJSValue> yPos, JSSmart<CJSValue> lock_type, JSSmart<CJSValue> sectionNum, JSSmart<CJSValue> bIsRepeat, JSSmart<CJSValue> type)
|
||||
{
|
||||
// m_pInternal->DrawHeaderEdit(yPos->toDouble(), lock_type->toObject(), sectionNum->toInt32(), bIsRepeat->toBool(), type->toObject());
|
||||
m_pInternal->DrawHeaderEdit(yPos->toDouble(), lock_type->toInt32());
|
||||
return NULL;
|
||||
}
|
||||
JSSmart<CJSValue> CGraphicsEmbed::DrawFooterEdit(JSSmart<CJSValue> yPos, JSSmart<CJSValue> lock_type, JSSmart<CJSValue> sectionNum, JSSmart<CJSValue> bIsRepeat, JSSmart<CJSValue> type)
|
||||
{
|
||||
// m_pInternal->DrawFooterEdit(yPos->toDouble(), lock_type->toObject(), sectionNum->toInt32(), bIsRepeat->toBool(), type->toObject());
|
||||
m_pInternal->DrawFooterEdit(yPos->toDouble(), lock_type->toInt32());
|
||||
return NULL;
|
||||
}
|
||||
JSSmart<CJSValue> CGraphicsEmbed::DrawLockParagraph (JSSmart<CJSValue> lock_type, JSSmart<CJSValue> x, JSSmart<CJSValue> y1, JSSmart<CJSValue> y2)
|
||||
{
|
||||
// m_pInternal->DrawLockParagraph(lock_type->toObject(), x->toDouble(), y1->toDouble(), y2->toDouble());
|
||||
m_pInternal->DrawLockParagraph(lock_type->toInt32(), x->toDouble(), y1->toDouble(), y2->toDouble());
|
||||
return NULL;
|
||||
}
|
||||
JSSmart<CJSValue> CGraphicsEmbed::DrawLockObjectRect(JSSmart<CJSValue> lock_type, JSSmart<CJSValue> x, JSSmart<CJSValue> y, JSSmart<CJSValue> w, JSSmart<CJSValue> h)
|
||||
{
|
||||
// m_pInternal->DrawLockObjectRect(lock_type->toObject(), x->toDouble(), y->toDouble(), w->toDouble(), h->toDouble());
|
||||
m_pInternal->DrawLockObjectRect(lock_type->toInt32(), x->toDouble(), y->toDouble(), w->toDouble(), h->toDouble());
|
||||
return NULL;
|
||||
}
|
||||
JSSmart<CJSValue> CGraphicsEmbed::DrawEmptyTableLine(JSSmart<CJSValue> x1, JSSmart<CJSValue> y1, JSSmart<CJSValue> x2, JSSmart<CJSValue> y2)
|
||||
@ -289,22 +289,22 @@ JSSmart<CJSValue> CGraphicsEmbed::DrawSpellingLine (JSSmart<CJSValue> y0, JSSma
|
||||
}
|
||||
JSSmart<CJSValue> CGraphicsEmbed::drawHorLine (JSSmart<CJSValue> align, JSSmart<CJSValue> y, JSSmart<CJSValue> x, JSSmart<CJSValue> r, JSSmart<CJSValue> penW)
|
||||
{
|
||||
m_pInternal->drawHorLine(align->toInt32(), y->toDouble(), x->toDouble(), r->toDouble(), penW->toInt32());
|
||||
m_pInternal->drawHorLine(align->toInt32(), y->toDouble(), x->toDouble(), r->toDouble(), penW->toDouble());
|
||||
return NULL;
|
||||
}
|
||||
JSSmart<CJSValue> CGraphicsEmbed::drawHorLine2(JSSmart<CJSValue> align, JSSmart<CJSValue> y, JSSmart<CJSValue> x, JSSmart<CJSValue> r, JSSmart<CJSValue> penW)
|
||||
{
|
||||
m_pInternal->drawHorLine2(align->toInt32(), y->toDouble(), x->toDouble(), r->toDouble(), penW->toInt32());
|
||||
m_pInternal->drawHorLine2(align->toInt32(), y->toDouble(), x->toDouble(), r->toDouble(), penW->toDouble());
|
||||
return NULL;
|
||||
}
|
||||
JSSmart<CJSValue> CGraphicsEmbed::drawVerLine (JSSmart<CJSValue> align, JSSmart<CJSValue> x, JSSmart<CJSValue> y, JSSmart<CJSValue> b, JSSmart<CJSValue> penW)
|
||||
{
|
||||
m_pInternal->drawVerLine(align->toInt32(), x->toDouble(), y->toDouble(), b->toDouble(), penW->toInt32());
|
||||
m_pInternal->drawVerLine(align->toInt32(), x->toDouble(), y->toDouble(), b->toDouble(), penW->toDouble());
|
||||
return NULL;
|
||||
}
|
||||
JSSmart<CJSValue> CGraphicsEmbed::drawHorLineExt(JSSmart<CJSValue> align, JSSmart<CJSValue> y, JSSmart<CJSValue> x, JSSmart<CJSValue> r, JSSmart<CJSValue> penW, JSSmart<CJSValue> leftMW, JSSmart<CJSValue> rightMW)
|
||||
{
|
||||
m_pInternal->drawHorLineExt(align->toInt32(), y->toDouble(), x->toDouble(), r->toDouble(), penW->toInt32(), leftMW->toDouble(), rightMW->toDouble());
|
||||
m_pInternal->drawHorLineExt(align->toInt32(), y->toDouble(), x->toDouble(), r->toDouble(), penW->toDouble(), leftMW->toDouble(), rightMW->toDouble());
|
||||
return NULL;
|
||||
}
|
||||
JSSmart<CJSValue> CGraphicsEmbed::rect (JSSmart<CJSValue> x, JSSmart<CJSValue> y, JSSmart<CJSValue> w, JSSmart<CJSValue> h)
|
||||
@ -327,9 +327,9 @@ JSSmart<CJSValue> CGraphicsEmbed::RemoveClipRect()
|
||||
m_pInternal->RemoveClipRect();
|
||||
return NULL;
|
||||
}
|
||||
JSSmart<CJSValue> CGraphicsEmbed::SetClip(JSSmart<CJSValue> r)
|
||||
JSSmart<CJSValue> CGraphicsEmbed::SetClip(JSSmart<CJSValue> x, JSSmart<CJSValue> y, JSSmart<CJSValue> w, JSSmart<CJSValue> h)
|
||||
{
|
||||
// m_pInternal->SetClip(r->toObject());
|
||||
m_pInternal->SetClip(x->toDouble(), y->toDouble(), w->toDouble(), h->toDouble());
|
||||
return NULL;
|
||||
}
|
||||
JSSmart<CJSValue> CGraphicsEmbed::RemoveClip()
|
||||
@ -337,9 +337,9 @@ JSSmart<CJSValue> CGraphicsEmbed::RemoveClip()
|
||||
m_pInternal->RemoveClip();
|
||||
return NULL;
|
||||
}
|
||||
JSSmart<CJSValue> CGraphicsEmbed::drawCollaborativeChanges(JSSmart<CJSValue> x, JSSmart<CJSValue> y, JSSmart<CJSValue> w, JSSmart<CJSValue> h, JSSmart<CJSValue> Color)
|
||||
JSSmart<CJSValue> CGraphicsEmbed::drawCollaborativeChanges(JSSmart<CJSValue> x, JSSmart<CJSValue> y, JSSmart<CJSValue> w, JSSmart<CJSValue> h, JSSmart<CJSValue> r, JSSmart<CJSValue> g, JSSmart<CJSValue> b, JSSmart<CJSValue> a)
|
||||
{
|
||||
// m_pInternal->drawCollaborativeChanges(x->toDouble(), y->toDouble(), w->toDouble(), h->toDouble(), Color->toObject());
|
||||
m_pInternal->drawCollaborativeChanges(x->toDouble(), y->toDouble(), w->toDouble(), h->toDouble(), r->toInt32(), g->toInt32(), b->toInt32(), a->toInt32());
|
||||
return NULL;
|
||||
}
|
||||
JSSmart<CJSValue> CGraphicsEmbed::drawMailMergeField(JSSmart<CJSValue> x, JSSmart<CJSValue> y, JSSmart<CJSValue> w, JSSmart<CJSValue> h)
|
||||
@ -424,12 +424,12 @@ JSSmart<CJSValue> CGraphicsEmbed::SetTextClipRect(JSSmart<CJSValue> _l, JSSmart<
|
||||
}
|
||||
JSSmart<CJSValue> CGraphicsEmbed::AddSmartRect (JSSmart<CJSValue> x, JSSmart<CJSValue> y, JSSmart<CJSValue> w, JSSmart<CJSValue> h, JSSmart<CJSValue> pen_w)
|
||||
{
|
||||
// m_pInternal->AddSmartRect(x->toDouble(), y->toDouble(), w->toDouble(), h->toDouble(), pen_w->toObject());
|
||||
m_pInternal->AddSmartRect(x->toDouble(), y->toDouble(), w->toDouble(), h->toDouble(), pen_w->toDouble());
|
||||
return NULL;
|
||||
}
|
||||
JSSmart<CJSValue> CGraphicsEmbed::CheckUseFonts2 (JSSmart<CJSValue> _transform)
|
||||
{
|
||||
// m_pInternal->CheckUseFonts2(_transform->toObject());
|
||||
m_pInternal->CheckUseFonts2();
|
||||
return NULL;
|
||||
}
|
||||
JSSmart<CJSValue> CGraphicsEmbed::UncheckUseFonts2()
|
||||
@ -439,7 +439,7 @@ JSSmart<CJSValue> CGraphicsEmbed::UncheckUseFonts2()
|
||||
}
|
||||
JSSmart<CJSValue> CGraphicsEmbed::Drawing_StartCheckBounds(JSSmart<CJSValue> x, JSSmart<CJSValue> y, JSSmart<CJSValue> w, JSSmart<CJSValue> h)
|
||||
{
|
||||
m_pInternal->Drawing_StartCheckBounds(x->toDouble(), y->toDouble(), w->toDouble(), h->toDouble());
|
||||
m_pInternal->Drawing_StartCheckBounds();
|
||||
return NULL;
|
||||
}
|
||||
JSSmart<CJSValue> CGraphicsEmbed::Drawing_EndCheckBounds()
|
||||
@ -449,16 +449,16 @@ JSSmart<CJSValue> CGraphicsEmbed::Drawing_EndCheckBounds()
|
||||
}
|
||||
JSSmart<CJSValue> CGraphicsEmbed::DrawPresentationComment(JSSmart<CJSValue> type, JSSmart<CJSValue> x, JSSmart<CJSValue> y, JSSmart<CJSValue> w, JSSmart<CJSValue> h)
|
||||
{
|
||||
// m_pInternal->DrawPresentationComment(type->toObject(), x->toDouble(), y->toDouble(), w->toDouble(), h->toDouble());
|
||||
m_pInternal->DrawPresentationComment();
|
||||
return NULL;
|
||||
}
|
||||
JSSmart<CJSValue> CGraphicsEmbed::DrawPolygon(JSSmart<CJSValue> oPath, JSSmart<CJSValue> lineWidth, JSSmart<CJSValue> shift)
|
||||
{
|
||||
// m_pInternal->DrawPolygon(oPath->toObject(), lineWidth->toInt32(), shift->toDouble());
|
||||
m_pInternal->DrawPolygon();
|
||||
return NULL;
|
||||
}
|
||||
JSSmart<CJSValue> CGraphicsEmbed::DrawFootnoteRect(JSSmart<CJSValue> x, JSSmart<CJSValue> y, JSSmart<CJSValue> w, JSSmart<CJSValue> h)
|
||||
{
|
||||
m_pInternal->DrawFootnoteRect(x->toDouble(), y->toDouble(), w->toDouble(), h->toDouble());
|
||||
m_pInternal->DrawFootnoteRect();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -91,9 +91,9 @@ public:
|
||||
// функции клиппирования
|
||||
JSSmart<CJSValue> AddClipRect(JSSmart<CJSValue> x, JSSmart<CJSValue> y, JSSmart<CJSValue> w, JSSmart<CJSValue> h);
|
||||
JSSmart<CJSValue> RemoveClipRect();
|
||||
JSSmart<CJSValue> SetClip(JSSmart<CJSValue> r);
|
||||
JSSmart<CJSValue> SetClip(JSSmart<CJSValue> x, JSSmart<CJSValue> y, JSSmart<CJSValue> w, JSSmart<CJSValue> h);
|
||||
JSSmart<CJSValue> RemoveClip();
|
||||
JSSmart<CJSValue> drawCollaborativeChanges(JSSmart<CJSValue> x, JSSmart<CJSValue> y, JSSmart<CJSValue> w, JSSmart<CJSValue> h, JSSmart<CJSValue> Color);
|
||||
JSSmart<CJSValue> drawCollaborativeChanges(JSSmart<CJSValue> x, JSSmart<CJSValue> y, JSSmart<CJSValue> w, JSSmart<CJSValue> h, JSSmart<CJSValue> r, JSSmart<CJSValue> g, JSSmart<CJSValue> b, JSSmart<CJSValue> a);
|
||||
JSSmart<CJSValue> drawMailMergeField(JSSmart<CJSValue> x, JSSmart<CJSValue> y, JSSmart<CJSValue> w, JSSmart<CJSValue> h);
|
||||
JSSmart<CJSValue> drawSearchResult (JSSmart<CJSValue> x, JSSmart<CJSValue> y, JSSmart<CJSValue> w, JSSmart<CJSValue> h);
|
||||
JSSmart<CJSValue> drawFlowAnchor (JSSmart<CJSValue> x, JSSmart<CJSValue> y);
|
||||
@ -119,7 +119,6 @@ public:
|
||||
JSSmart<CJSValue> DrawPolygon(JSSmart<CJSValue> oPath, JSSmart<CJSValue> lineWidth, JSSmart<CJSValue> shift);
|
||||
JSSmart<CJSValue> DrawFootnoteRect(JSSmart<CJSValue> x, JSSmart<CJSValue> y, JSSmart<CJSValue> w, JSSmart<CJSValue> h);
|
||||
|
||||
static void CreateNativeGraphics(const v8::FunctionCallbackInfo<v8::Value>& args);
|
||||
static void CreateObjectInContext(const std::string& name, JSSmart<CJSContext> context);
|
||||
};
|
||||
|
||||
|
||||
@ -1,57 +1,6 @@
|
||||
#include "../GraphicsEmbed.h"
|
||||
#include "../../js_internal/v8/v8_base.h"
|
||||
|
||||
#define PROPERTY_GET(NAME, NAME_EMBED, TYPE) \
|
||||
void NAME(v8::Local<v8::String> _name, const v8::PropertyCallbackInfo<v8::Value>& info) \
|
||||
{ \
|
||||
CURRENTWRAPPER* _this = (CURRENTWRAPPER*)unwrap_native(info.Holder()); \
|
||||
info.GetReturnValue().Set(TYPE::New(v8::Isolate::GetCurrent(), _this->m_pInternal->NAME_EMBED())); \
|
||||
}
|
||||
|
||||
#define PROPERTY_GET_OBJECT(NAME, NAME_EMBED) \
|
||||
void NAME(v8::Local<v8::String> _name, const v8::PropertyCallbackInfo<v8::Value>& info) \
|
||||
{ \
|
||||
CURRENTWRAPPER* _this = (CURRENTWRAPPER*)unwrap_native(info.Holder()); \
|
||||
v8::Local<v8::Value>* v = _this->m_pInternal->NAME_EMBED(); \
|
||||
if(v) info.GetReturnValue().Set(*v); \
|
||||
else info.GetReturnValue().Set(v8::Undefined(v8::Isolate::GetCurrent())); \
|
||||
}
|
||||
|
||||
#define PROPERTY_SET_DOUBLE(NAME, NAME_EMBED) \
|
||||
void NAME(v8::Local<v8::String> _name, v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<void>& info) \
|
||||
{ \
|
||||
CURRENTWRAPPER* _this = (CURRENTWRAPPER*)unwrap_native(info.Holder()); \
|
||||
JSSmart<NSJSBase::CJSValue> v = js_value(value); \
|
||||
_this->m_pInternal->NAME_EMBED(v->toDouble()); \
|
||||
info.GetReturnValue().Set(value); \
|
||||
}
|
||||
|
||||
#define PROPERTY_SET_INT(NAME, NAME_EMBED) \
|
||||
void NAME(v8::Local<v8::String> _name, v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<void>& info) \
|
||||
{ \
|
||||
CURRENTWRAPPER* _this = (CURRENTWRAPPER*)unwrap_native(info.Holder()); \
|
||||
JSSmart<NSJSBase::CJSValue> v = js_value(value); \
|
||||
_this->m_pInternal->NAME_EMBED(v->toInt32()); \
|
||||
info.GetReturnValue().Set(value); \
|
||||
}
|
||||
|
||||
#define PROPERTY_SET_BOOL(NAME, NAME_EMBED) \
|
||||
void NAME(v8::Local<v8::String> _name, v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<void>& info) \
|
||||
{ \
|
||||
CURRENTWRAPPER* _this = (CURRENTWRAPPER*)unwrap_native(info.Holder()); \
|
||||
JSSmart<NSJSBase::CJSValue> v = js_value(value); \
|
||||
_this->m_pInternal->NAME_EMBED(v->toBool()); \
|
||||
info.GetReturnValue().Set(value); \
|
||||
}
|
||||
|
||||
#define PROPERTY_SET_OBJECT(NAME, NAME_EMBED) \
|
||||
void NAME(v8::Local<v8::String> _name, v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<void>& info) \
|
||||
{ \
|
||||
CURRENTWRAPPER* _this = (CURRENTWRAPPER*)unwrap_native(info.Holder()); \
|
||||
_this->m_pInternal->NAME_EMBED(&value); \
|
||||
info.GetReturnValue().Set(value); \
|
||||
}
|
||||
|
||||
namespace NSGraphics
|
||||
{
|
||||
#define CURRENTWRAPPER CGraphicsEmbed
|
||||
@ -131,9 +80,9 @@ namespace NSGraphics
|
||||
// функции клиппирования
|
||||
FUNCTION_WRAPPER_V8_4(_AddClipRect, AddClipRect)
|
||||
FUNCTION_WRAPPER_V8 (_RemoveClipRect, RemoveClipRect)
|
||||
FUNCTION_WRAPPER_V8_1(_SetClip, SetClip)
|
||||
FUNCTION_WRAPPER_V8_4(_SetClip, SetClip)
|
||||
FUNCTION_WRAPPER_V8 (_RemoveClip, RemoveClip)
|
||||
FUNCTION_WRAPPER_V8_5(_drawCollaborativeChanges, drawCollaborativeChanges)
|
||||
FUNCTION_WRAPPER_V8_8(_drawCollaborativeChanges, drawCollaborativeChanges)
|
||||
FUNCTION_WRAPPER_V8_4(_drawMailMergeField, drawMailMergeField)
|
||||
FUNCTION_WRAPPER_V8_4(_drawSearchResult, drawSearchResult)
|
||||
FUNCTION_WRAPPER_V8_2(_drawFlowAnchor, drawFlowAnchor)
|
||||
@ -159,92 +108,6 @@ namespace NSGraphics
|
||||
FUNCTION_WRAPPER_V8_3(_DrawPolygon, DrawPolygon)
|
||||
FUNCTION_WRAPPER_V8_4(_DrawFootnoteRect, DrawFootnoteRect)
|
||||
|
||||
/*
|
||||
// PROPERTY GET
|
||||
PROPERTY_GET_OBJECT(_g_m_oContext, g_m_oContext)
|
||||
PROPERTY_GET_OBJECT(_g_m_oPen, g_m_oPen)
|
||||
PROPERTY_GET_OBJECT(_g_m_oBrush, g_m_oBrush)
|
||||
PROPERTY_GET_OBJECT(_g_m_oFontManager, g_m_oFontManager)
|
||||
PROPERTY_GET_OBJECT(_g_m_oCoordTransform, g_m_oCoordTransform)
|
||||
PROPERTY_GET_OBJECT(_g_m_oBaseTransform, g_m_oBaseTransform)
|
||||
PROPERTY_GET_OBJECT(_g_m_oTransform, g_m_oTransform)
|
||||
PROPERTY_GET_OBJECT(_g_m_oFullTransform, g_m_oFullTransform)
|
||||
PROPERTY_GET_OBJECT(_g_m_oInvertFullTransform, g_m_oInvertFullTransform)
|
||||
PROPERTY_GET_OBJECT(_g_ArrayPoints, g_ArrayPoints)
|
||||
PROPERTY_GET_OBJECT(_g_m_oTextPr, g_m_oTextPr)
|
||||
PROPERTY_GET_OBJECT(_g_m_oGrFonts, g_m_oGrFonts)
|
||||
PROPERTY_GET_OBJECT(_g_m_oLastFont, g_m_oLastFont)
|
||||
PROPERTY_GET_OBJECT(_g_ClipManager, g_ClipManager)
|
||||
PROPERTY_GET_OBJECT(_g_GrState, g_GrState)
|
||||
PROPERTY_GET_OBJECT(_g_TextClipRect, g_TextClipRect)
|
||||
PROPERTY_GET_OBJECT(_g_m_oFontManager2, g_m_oFontManager2)
|
||||
PROPERTY_GET_OBJECT(_g_m_oLastFont2, g_m_oLastFont2)
|
||||
PROPERTY_GET_OBJECT(_g_dash_no_smart, g_dash_no_smart)
|
||||
PROPERTY_GET(_g_m_dWidthMM, g_m_dWidthMM, v8::Number)
|
||||
PROPERTY_GET(_g_m_dHeightMM, g_m_dHeightMM, v8::Number)
|
||||
PROPERTY_GET(_g_m_lWidthPix, g_m_lWidthPix, v8::Number)
|
||||
PROPERTY_GET(_g_m_lHeightPix, g_m_lHeightPix, v8::Number)
|
||||
PROPERTY_GET(_g_m_dDpiX, g_m_dDpiX, v8::Number)
|
||||
PROPERTY_GET(_g_m_dDpiY, g_m_dDpiY, v8::Number)
|
||||
PROPERTY_GET(_g_m_bIsBreak, g_m_bIsBreak, v8::Boolean)
|
||||
PROPERTY_GET(_g_m_bPenColorInit, g_m_bPenColorInit, v8::Boolean)
|
||||
PROPERTY_GET(_g_m_bBrushColorInit, g_m_bBrushColorInit, v8::Boolean)
|
||||
PROPERTY_GET(_g_m_bIntegerGrid, g_m_bIntegerGrid, v8::Boolean)
|
||||
PROPERTY_GET(_g_IsThumbnail, g_IsThumbnail, v8::Boolean)
|
||||
PROPERTY_GET(_g_IsDemonstrationMode, g_IsDemonstrationMode, v8::Boolean)
|
||||
PROPERTY_GET(_g_IsClipContext, g_IsClipContext, v8::Boolean)
|
||||
PROPERTY_GET(_g_IsUseFonts2, g_IsUseFonts2, v8::Boolean)
|
||||
PROPERTY_GET(_g_ClearMode, g_ClearMode, v8::Boolean)
|
||||
PROPERTY_GET(_g_IsRetina, g_IsRetina, v8::Boolean)
|
||||
// PROPERTY_GET_OBJECT(_g_m_oCurFont, g_m_oCurFont)
|
||||
// PROPERTY_GET_OBJECT(_g_LastFontOriginInfo, g_LastFontOriginInfo)
|
||||
PROPERTY_GET(_g_TextureFillTransformScaleX, g_TextureFillTransformScaleX, v8::Int32)
|
||||
PROPERTY_GET(_g_TextureFillTransformScaleY, g_TextureFillTransformScaleY, v8::Int32)
|
||||
PROPERTY_GET(_g_globalAlpha, g_globalAlpha, v8::Int32)
|
||||
|
||||
// PROPERTY SET
|
||||
PROPERTY_SET_OBJECT(_s_m_oContext, s_m_oContext)
|
||||
PROPERTY_SET_OBJECT(_s_m_oPen, s_m_oPen)
|
||||
PROPERTY_SET_OBJECT(_s_m_oBrush, s_m_oBrush)
|
||||
PROPERTY_SET_OBJECT(_s_m_oFontManager, s_m_oFontManager)
|
||||
PROPERTY_SET_OBJECT(_s_m_oCoordTransform, s_m_oCoordTransform)
|
||||
PROPERTY_SET_OBJECT(_s_m_oBaseTransform, s_m_oBaseTransform)
|
||||
PROPERTY_SET_OBJECT(_s_m_oTransform, s_m_oTransform)
|
||||
PROPERTY_SET_OBJECT(_s_m_oFullTransform, s_m_oFullTransform)
|
||||
PROPERTY_SET_OBJECT(_s_m_oInvertFullTransform, s_m_oInvertFullTransform)
|
||||
PROPERTY_SET_OBJECT(_s_ArrayPoints, s_ArrayPoints)
|
||||
PROPERTY_SET_OBJECT(_s_m_oTextPr, s_m_oTextPr)
|
||||
PROPERTY_SET_OBJECT(_s_m_oGrFonts, s_m_oGrFonts)
|
||||
PROPERTY_SET_OBJECT(_s_m_oLastFont, s_m_oLastFont)
|
||||
PROPERTY_SET_OBJECT(_s_ClipManager, s_ClipManager)
|
||||
PROPERTY_SET_OBJECT(_s_GrState, s_GrState)
|
||||
PROPERTY_SET_OBJECT(_s_TextClipRect, s_TextClipRect)
|
||||
PROPERTY_SET_OBJECT(_s_m_oFontManager2, s_m_oFontManager2)
|
||||
PROPERTY_SET_OBJECT(_s_m_oLastFont2, s_m_oLastFont2)
|
||||
PROPERTY_SET_OBJECT(_s_dash_no_smart, s_dash_no_smart)
|
||||
PROPERTY_SET_DOUBLE(_s_m_dWidthMM, s_m_dWidthMM)
|
||||
PROPERTY_SET_DOUBLE(_s_m_dHeightMM, s_m_dHeightMM)
|
||||
PROPERTY_SET_DOUBLE(_s_m_lWidthPix, s_m_lWidthPix)
|
||||
PROPERTY_SET_DOUBLE(_s_m_lHeightPix, s_m_lHeightPix)
|
||||
PROPERTY_SET_DOUBLE(_s_m_dDpiX, s_m_dDpiX)
|
||||
PROPERTY_SET_DOUBLE(_s_m_dDpiY, s_m_dDpiY)
|
||||
PROPERTY_SET_BOOL(_s_m_bIsBreak, s_m_bIsBreak)
|
||||
PROPERTY_SET_BOOL(_s_m_bPenColorInit, s_m_bPenColorInit)
|
||||
PROPERTY_SET_BOOL(_s_m_bBrushColorInit, s_m_bBrushColorInit)
|
||||
PROPERTY_SET_BOOL(_s_m_bIntegerGrid, s_m_bIntegerGrid)
|
||||
PROPERTY_SET_BOOL(_s_IsThumbnail, s_IsThumbnail)
|
||||
PROPERTY_SET_BOOL(_s_IsDemonstrationMode, s_IsDemonstrationMode)
|
||||
PROPERTY_SET_BOOL(_s_IsClipContext, s_IsClipContext)
|
||||
PROPERTY_SET_BOOL(_s_IsUseFonts2, s_IsUseFonts2)
|
||||
PROPERTY_SET_BOOL(_s_ClearMode, s_ClearMode)
|
||||
PROPERTY_SET_BOOL(_s_IsRetina, s_IsRetina)
|
||||
// PROPERTY_SET_OBJECT(_s_m_oCurFont, s_m_oCurFont)
|
||||
// PROPERTY_SET_OBJECT(_s_LastFontOriginInfo, s_LastFontOriginInfo)
|
||||
PROPERTY_SET_INT(_s_TextureFillTransformScaleX, s_TextureFillTransformScaleX)
|
||||
PROPERTY_SET_INT(_s_TextureFillTransformScaleY, s_TextureFillTransformScaleY)
|
||||
PROPERTY_SET_INT(_s_globalAlpha, s_globalAlpha)
|
||||
*/
|
||||
|
||||
v8::Handle<v8::ObjectTemplate> CreateGraphicsTemplate(v8::Isolate* isolate)
|
||||
{
|
||||
v8::EscapableHandleScope handle_scope(isolate);
|
||||
@ -254,50 +117,6 @@ namespace NSGraphics
|
||||
|
||||
v8::Isolate* current = v8::Isolate::GetCurrent();
|
||||
|
||||
/*
|
||||
// свойства
|
||||
result->SetAccessor(v8::String::NewFromUtf8(current, "m_oContext"), _g_m_oContext, _s_m_oContext);
|
||||
result->SetAccessor(v8::String::NewFromUtf8(current, "m_dWidthMM"), _g_m_dWidthMM, _s_m_dWidthMM);
|
||||
result->SetAccessor(v8::String::NewFromUtf8(current, "m_dHeightMM"), _g_m_dHeightMM, _s_m_dHeightMM);
|
||||
result->SetAccessor(v8::String::NewFromUtf8(current, "m_lWidthPix"), _g_m_lWidthPix, _s_m_lWidthPix);
|
||||
result->SetAccessor(v8::String::NewFromUtf8(current, "m_lHeightPix"), _g_m_lHeightPix, _s_m_lHeightPix);
|
||||
result->SetAccessor(v8::String::NewFromUtf8(current, "m_dDpiX"), _g_m_dDpiX, _s_m_dDpiX);
|
||||
result->SetAccessor(v8::String::NewFromUtf8(current, "m_dDpiY"), _g_m_dDpiY, _s_m_dDpiY);
|
||||
result->SetAccessor(v8::String::NewFromUtf8(current, "m_bIsBreak"), _g_m_bIsBreak, _s_m_bIsBreak);
|
||||
result->SetAccessor(v8::String::NewFromUtf8(current, "m_oPen"), _g_m_oPen, _s_m_oPen);
|
||||
result->SetAccessor(v8::String::NewFromUtf8(current, "m_bPenColorInit"), _g_m_bPenColorInit, _s_m_bPenColorInit);
|
||||
result->SetAccessor(v8::String::NewFromUtf8(current, "m_oBrush"), _g_m_oBrush, _s_m_oBrush);
|
||||
result->SetAccessor(v8::String::NewFromUtf8(current, "m_bBrushColorInit"), _g_m_bBrushColorInit, _s_m_bBrushColorInit);
|
||||
result->SetAccessor(v8::String::NewFromUtf8(current, "m_oFontManager"), _g_m_oFontManager, _s_m_oFontManager);
|
||||
result->SetAccessor(v8::String::NewFromUtf8(current, "m_oCoordTransform"), _g_m_oCoordTransform, _s_m_oCoordTransform);
|
||||
result->SetAccessor(v8::String::NewFromUtf8(current, "m_oBaseTransform"), _g_m_oBaseTransform, _s_m_oBaseTransform);
|
||||
result->SetAccessor(v8::String::NewFromUtf8(current, "m_oFullTransform"), _g_m_oFullTransform, _s_m_oFullTransform);
|
||||
result->SetAccessor(v8::String::NewFromUtf8(current, "m_oInvertFullTransform"), _g_m_oInvertFullTransform, _s_m_oInvertFullTransform);
|
||||
result->SetAccessor(v8::String::NewFromUtf8(current, "ArrayPoints"), _g_ArrayPoints, _s_ArrayPoints);
|
||||
// result->SetAccessor(v8::String::NewFromUtf8(current, "m_oCurFont"), _g_m_oCurFont, _s_m_oCurFont);
|
||||
result->SetAccessor(v8::String::NewFromUtf8(current, "m_oTextPr"), _g_m_oTextPr, _s_m_oTextPr);
|
||||
result->SetAccessor(v8::String::NewFromUtf8(current, "m_oGrFonts"), _g_m_oGrFonts, _s_m_oGrFonts);
|
||||
result->SetAccessor(v8::String::NewFromUtf8(current, "m_oLastFont"), _g_m_oLastFont, _s_m_oLastFont);
|
||||
// result->SetAccessor(v8::String::NewFromUtf8(current, "LastFontOriginInfo"), _g_LastFontOriginInfo, _s_LastFontOriginInfo);
|
||||
result->SetAccessor(v8::String::NewFromUtf8(current, "m_bIntegerGrid"), _g_m_bIntegerGrid, _s_m_bIntegerGrid);
|
||||
result->SetAccessor(v8::String::NewFromUtf8(current, "ClipManager"), _g_ClipManager, _s_ClipManager);
|
||||
result->SetAccessor(v8::String::NewFromUtf8(current, "TextureFillTransformScaleX"), _g_TextureFillTransformScaleX, _s_TextureFillTransformScaleX);
|
||||
result->SetAccessor(v8::String::NewFromUtf8(current, "TextureFillTransformScaleY"), _g_TextureFillTransformScaleY, _s_TextureFillTransformScaleY);
|
||||
result->SetAccessor(v8::String::NewFromUtf8(current, "IsThumbnail"), _g_IsThumbnail, _s_IsThumbnail);
|
||||
result->SetAccessor(v8::String::NewFromUtf8(current, "IsDemonstrationMode"), _g_IsDemonstrationMode, _s_IsDemonstrationMode);
|
||||
result->SetAccessor(v8::String::NewFromUtf8(current, "IsDemonstrationMode"), _g_IsDemonstrationMode, _s_IsDemonstrationMode);
|
||||
result->SetAccessor(v8::String::NewFromUtf8(current, "GrState"), _g_GrState, _s_GrState);
|
||||
result->SetAccessor(v8::String::NewFromUtf8(current, "globalAlpha"), _g_globalAlpha, _s_globalAlpha);
|
||||
result->SetAccessor(v8::String::NewFromUtf8(current, "TextClipRect"), _g_TextClipRect, _s_TextClipRect);
|
||||
result->SetAccessor(v8::String::NewFromUtf8(current, "IsClipContext"), _g_IsClipContext, _s_IsClipContext);
|
||||
result->SetAccessor(v8::String::NewFromUtf8(current, "IsUseFonts2"), _g_IsUseFonts2, _s_IsUseFonts2);
|
||||
result->SetAccessor(v8::String::NewFromUtf8(current, "m_oFontManager2"), _g_m_oFontManager2, _s_m_oFontManager2);
|
||||
result->SetAccessor(v8::String::NewFromUtf8(current, "m_oLastFont2"), _g_m_oLastFont2, _s_m_oLastFont2);
|
||||
result->SetAccessor(v8::String::NewFromUtf8(current, "ClearMode"), _g_ClearMode, _s_ClearMode);
|
||||
result->SetAccessor(v8::String::NewFromUtf8(current, "IsRetina"), _g_IsRetina, _s_IsRetina);
|
||||
result->SetAccessor(v8::String::NewFromUtf8(current, "dash_no_smart"), _g_dash_no_smart, _s_dash_no_smart);
|
||||
*/
|
||||
|
||||
// методы
|
||||
NSV8Objects::Template_Set(result, "init", _init);
|
||||
NSV8Objects::Template_Set(result, "EndDraw", _EndDraw);
|
||||
@ -393,24 +212,26 @@ namespace NSGraphics
|
||||
|
||||
return handle_scope.Escape(result);
|
||||
}
|
||||
|
||||
void CreateNativeGraphics(const v8::FunctionCallbackInfo<v8::Value>& args)
|
||||
{
|
||||
v8::Isolate* isolate = args.GetIsolate();
|
||||
v8::HandleScope scope(isolate);
|
||||
|
||||
v8::Handle<v8::ObjectTemplate> GraphicsTemplate = NSGraphics::CreateGraphicsTemplate(isolate);
|
||||
CGraphicsEmbed* pGraphics = new CGraphicsEmbed();
|
||||
|
||||
v8::Local<v8::Object> obj = GraphicsTemplate->NewInstance(isolate->GetCurrentContext()).ToLocalChecked();
|
||||
obj->SetInternalField(0, v8::External::New(CV8Worker::GetCurrent(), pGraphics));
|
||||
|
||||
args.GetReturnValue().Set(obj);
|
||||
}
|
||||
}
|
||||
|
||||
void CGraphicsEmbed::CreateNativeGraphics(const v8::FunctionCallbackInfo<v8::Value>& args)
|
||||
{
|
||||
v8::Isolate* isolate = args.GetIsolate();
|
||||
v8::HandleScope scope(isolate);
|
||||
|
||||
v8::Handle<v8::ObjectTemplate> GraphicsTemplate = NSGraphics::CreateGraphicsTemplate(isolate);
|
||||
CGraphicsEmbed* pGraphics = new CGraphicsEmbed();
|
||||
|
||||
v8::Local<v8::Object> obj = GraphicsTemplate->NewInstance(isolate->GetCurrentContext()).ToLocalChecked();
|
||||
obj->SetInternalField(0, v8::External::New(CV8Worker::GetCurrent(), pGraphics));
|
||||
|
||||
args.GetReturnValue().Set(obj);
|
||||
}
|
||||
|
||||
void CGraphicsEmbed::CreateObjectInContext(const std::string& name, JSSmart<CJSContext> context)
|
||||
{
|
||||
v8::Isolate* current = CV8Worker::GetCurrent();
|
||||
context->m_internal->m_global->Set(current, name.c_str(), v8::FunctionTemplate::New(current, CreateNativeGraphics));
|
||||
context->m_internal->m_global->Set(current, name.c_str(), v8::FunctionTemplate::New(current, NSGraphics::CreateNativeGraphics));
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -7,269 +7,159 @@
|
||||
#include "../common/Types.h"
|
||||
#include "../graphics/pro/Graphics.h"
|
||||
|
||||
/*
|
||||
#define GRAPHICS_NATIVE_COMMAND_EndDraw 1
|
||||
#define GRAPHICS_NATIVE_COMMAND_put_GlobalAlpha 2
|
||||
#define GRAPHICS_NATIVE_COMMAND_Start_GlobalAlpha 3
|
||||
#define GRAPHICS_NATIVE_COMMAND_End_GlobalAlpha 4
|
||||
#define GRAPHICS_NATIVE_COMMAND_p_color 5
|
||||
#define GRAPHICS_NATIVE_COMMAND_p_width 6
|
||||
#define GRAPHICS_NATIVE_COMMAND_p_dash 7
|
||||
#define GRAPHICS_NATIVE_COMMAND_b_color1 8
|
||||
#define GRAPHICS_NATIVE_COMMAND_b_color2 9
|
||||
#define GRAPHICS_NATIVE_COMMAND_transform 10
|
||||
#define GRAPHICS_NATIVE_COMMAND_CalculateFullTransform 11
|
||||
#define GRAPHICS_NATIVE_COMMAND__s 12
|
||||
#define GRAPHICS_NATIVE_COMMAND__e 13
|
||||
#define GRAPHICS_NATIVE_COMMAND__z 14
|
||||
#define GRAPHICS_NATIVE_COMMAND__m 15
|
||||
#define GRAPHICS_NATIVE_COMMAND__l 16
|
||||
#define GRAPHICS_NATIVE_COMMAND__c 17
|
||||
#define GRAPHICS_NATIVE_COMMAND__c2 18
|
||||
#define GRAPHICS_NATIVE_COMMAND_ds 19
|
||||
#define GRAPHICS_NATIVE_COMMAND_df 20
|
||||
#define GRAPHICS_NATIVE_COMMAND_save 21
|
||||
#define GRAPHICS_NATIVE_COMMAND_restore 22
|
||||
#define GRAPHICS_NATIVE_COMMAND_clip 23
|
||||
#define GRAPHICS_NATIVE_COMMAND_reset 24
|
||||
#define GRAPHICS_NATIVE_COMMAND_transform3 25
|
||||
#define GRAPHICS_NATIVE_COMMAND_FreeFont 26
|
||||
#define GRAPHICS_NATIVE_COMMAND_ClearLastFont 27
|
||||
#define GRAPHICS_NATIVE_COMMAND_drawImage2 28
|
||||
#define GRAPHICS_NATIVE_COMMAND_drawImage 29
|
||||
#define GRAPHICS_NATIVE_COMMAND_GetFont 30
|
||||
#define GRAPHICS_NATIVE_COMMAND_font 31
|
||||
#define GRAPHICS_NATIVE_COMMAND_SetFont 32
|
||||
#define GRAPHICS_NATIVE_COMMAND_SetTextPr 33
|
||||
#define GRAPHICS_NATIVE_COMMAND_SetFontSlot 34
|
||||
#define GRAPHICS_NATIVE_COMMAND_GetTextPr 35
|
||||
#define GRAPHICS_NATIVE_COMMAND_FillText 36
|
||||
#define GRAPHICS_NATIVE_COMMAND_t 37
|
||||
#define GRAPHICS_NATIVE_COMMAND_FillText2 38
|
||||
#define GRAPHICS_NATIVE_COMMAND_t2 39
|
||||
#define GRAPHICS_NATIVE_COMMAND_FillTextCode 40
|
||||
#define GRAPHICS_NATIVE_COMMAND_tg 41
|
||||
#define GRAPHICS_NATIVE_COMMAND_charspace 42
|
||||
#define GRAPHICS_NATIVE_COMMAND_private_FillGlyph 43
|
||||
#define GRAPHICS_NATIVE_COMMAND_private_FillGlyphC 44
|
||||
#define GRAPHICS_NATIVE_COMMAND_private_FillGlyph2 45
|
||||
#define GRAPHICS_NATIVE_COMMAND_SetIntegerGrid 46
|
||||
#define GRAPHICS_NATIVE_COMMAND_GetIntegerGrid 47
|
||||
#define GRAPHICS_NATIVE_COMMAND_DrawStringASCII 48
|
||||
#define GRAPHICS_NATIVE_COMMAND_DrawStringASCII2 49
|
||||
#define GRAPHICS_NATIVE_COMMAND_DrawHeaderEdit 50
|
||||
#define GRAPHICS_NATIVE_COMMAND_DrawFooterEdit 51
|
||||
#define GRAPHICS_NATIVE_COMMAND_DrawLockParagraph 52
|
||||
#define GRAPHICS_NATIVE_COMMAND_DrawLockObjectRect 53
|
||||
#define GRAPHICS_NATIVE_COMMAND_DrawEmptyTableLine 54
|
||||
#define GRAPHICS_NATIVE_COMMAND_DrawSpellingLine 55
|
||||
#define GRAPHICS_NATIVE_COMMAND_drawHorLine 56
|
||||
#define GRAPHICS_NATIVE_COMMAND_drawHorLine2 57
|
||||
#define GRAPHICS_NATIVE_COMMAND_drawVerLine 58
|
||||
#define GRAPHICS_NATIVE_COMMAND_drawHorLineExt 59
|
||||
#define GRAPHICS_NATIVE_COMMAND_rect 60
|
||||
#define GRAPHICS_NATIVE_COMMAND_TableRect 61
|
||||
#define GRAPHICS_NATIVE_COMMAND_AddClipRect 62
|
||||
#define GRAPHICS_NATIVE_COMMAND_RemoveClipRect 63
|
||||
#define GRAPHICS_NATIVE_COMMAND_SetClip 64
|
||||
#define GRAPHICS_NATIVE_COMMAND_RemoveClip 65
|
||||
#define GRAPHICS_NATIVE_COMMAND_drawCollaborativeChanges 66
|
||||
#define GRAPHICS_NATIVE_COMMAND_drawMailMergeField 67
|
||||
#define GRAPHICS_NATIVE_COMMAND_drawSearchResult 68
|
||||
#define GRAPHICS_NATIVE_COMMAND_drawFlowAnchor 69
|
||||
#define GRAPHICS_NATIVE_COMMAND_SavePen 70
|
||||
#define GRAPHICS_NATIVE_COMMAND_RestorePen 71
|
||||
#define GRAPHICS_NATIVE_COMMAND_SaveBrush 72
|
||||
#define GRAPHICS_NATIVE_COMMAND_RestoreBrush 73
|
||||
#define GRAPHICS_NATIVE_COMMAND_SavePenBrush 74
|
||||
#define GRAPHICS_NATIVE_COMMAND_RestorePenBrush 75
|
||||
#define GRAPHICS_NATIVE_COMMAND_SaveGrState 76
|
||||
#define GRAPHICS_NATIVE_COMMAND_RestoreGrState 77
|
||||
#define GRAPHICS_NATIVE_COMMAND_StartClipPath 78
|
||||
#define GRAPHICS_NATIVE_COMMAND_EndClipPath 79
|
||||
#define GRAPHICS_NATIVE_COMMAND_StartCheckTableDraw 80
|
||||
#define GRAPHICS_NATIVE_COMMAND_EndCheckTableDraw 81
|
||||
#define GRAPHICS_NATIVE_COMMAND_SetTextClipRect 82
|
||||
#define GRAPHICS_NATIVE_COMMAND_AddSmartRect 83
|
||||
#define GRAPHICS_NATIVE_COMMAND_CheckUseFonts2 84
|
||||
#define GRAPHICS_NATIVE_COMMAND_UncheckUseFonts2 85
|
||||
#define GRAPHICS_NATIVE_COMMAND_Drawing_StartCheckBounds 86
|
||||
#define GRAPHICS_NATIVE_COMMAND_Drawing_EndCheckBounds 87
|
||||
#define GRAPHICS_NATIVE_COMMAND_DrawPresentationComment 88
|
||||
#define GRAPHICS_NATIVE_COMMAND_DrawPolygon 89
|
||||
#define GRAPHICS_NATIVE_COMMAND_DrawFootnoteRect 90
|
||||
*/
|
||||
|
||||
/*
|
||||
struct CFont
|
||||
{
|
||||
std::string Name;
|
||||
int FontSize;
|
||||
bool Bold;
|
||||
bool Italic;
|
||||
|
||||
CFont() : Name(""), FontSize(10), Bold(false), Italic(false) {}
|
||||
};
|
||||
|
||||
struct CLastFontOriginInfo
|
||||
{
|
||||
std::string Name;
|
||||
CLastFontOriginInfo() : Name(""), Replace(nullptr) {}
|
||||
};
|
||||
*/
|
||||
|
||||
namespace NSGraphics
|
||||
{
|
||||
enum EGrStateType
|
||||
{
|
||||
gstPen = 0,
|
||||
gstBrush = 1,
|
||||
gstPenBrush = 2,
|
||||
gstState = 3,
|
||||
gstNone = 4
|
||||
};
|
||||
|
||||
class IGrState
|
||||
{
|
||||
public:
|
||||
EGrStateType m_eType;
|
||||
IGrState() { m_eType = gstNone; }
|
||||
virtual ~IGrState() {}
|
||||
};
|
||||
|
||||
class CGrStatePen : public IGrState
|
||||
{
|
||||
public:
|
||||
NSStructures::CPen m_oPen;
|
||||
CGrStatePen() { m_eType = gstPen; }
|
||||
};
|
||||
|
||||
class CGrStateBrush : public IGrState
|
||||
{
|
||||
public:
|
||||
NSStructures::CBrush m_oBrush;
|
||||
CGrStateBrush() { m_eType = gstBrush; }
|
||||
};
|
||||
|
||||
class CGrStatePenBrush : public IGrState
|
||||
{
|
||||
public:
|
||||
NSStructures::CPen m_oPen;
|
||||
NSStructures::CBrush m_oBrush;
|
||||
CGrStatePenBrush() { m_eType = gstPenBrush; }
|
||||
};
|
||||
|
||||
class CGraphics;
|
||||
class CHist_Clip
|
||||
{
|
||||
public:
|
||||
bool IsPath;
|
||||
void* Path;
|
||||
|
||||
Aggplus::CDoubleRect Rect;
|
||||
bool IsIntegerGrid;
|
||||
Aggplus::CMatrix Transform;
|
||||
|
||||
public:
|
||||
CHist_Clip() : IsPath(false), Path(NULL), IsIntegerGrid(false) {}
|
||||
|
||||
void ToRenderer(CGraphics* pRenderer);
|
||||
};
|
||||
|
||||
class CGrStateState : public IGrState
|
||||
{
|
||||
public:
|
||||
Aggplus::CMatrix Transform;
|
||||
bool IsIntegerGrid;
|
||||
std::vector<CHist_Clip*> Clips;
|
||||
|
||||
public:
|
||||
CGrStateState()
|
||||
{
|
||||
m_eType = gstState;
|
||||
IsIntegerGrid = false;
|
||||
}
|
||||
~CGrStateState()
|
||||
{
|
||||
size_t nCount = Clips.size();
|
||||
for (size_t i = 0; i < nCount; ++i)
|
||||
{
|
||||
CHist_Clip* pClip = Clips[i];
|
||||
RELEASEOBJECT(pClip);
|
||||
}
|
||||
Clips.clear();
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void ApplyClips(T* pRenderer)
|
||||
{
|
||||
size_t nCount = Clips.size();
|
||||
for (size_t i = 0; i < nCount; ++i)
|
||||
{
|
||||
Clips[i]->ToRenderer(pRenderer);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
class CGrState
|
||||
{
|
||||
public:
|
||||
std::vector<IGrState*> States;
|
||||
std::vector<CHist_Clip*> Clips;
|
||||
|
||||
public:
|
||||
CGrState() {}
|
||||
~CGrState()
|
||||
{
|
||||
for(IGrState* pState : States)
|
||||
RELEASEOBJECT(pState);
|
||||
States.clear();
|
||||
|
||||
for(CHist_Clip* pState : Clips)
|
||||
RELEASEOBJECT(pState);
|
||||
Clips.clear();
|
||||
}
|
||||
|
||||
void Save()
|
||||
{
|
||||
SavePen();
|
||||
SaveBrush();
|
||||
SaveGrState();
|
||||
}
|
||||
void Restore()
|
||||
{
|
||||
RestoreGrState();
|
||||
RestoreBrush();
|
||||
RestorePen();
|
||||
}
|
||||
|
||||
void StartClipPath()
|
||||
{
|
||||
// реализовать, как понадобится
|
||||
}
|
||||
void EndClipPath()
|
||||
{
|
||||
// реализовать, как понадобится
|
||||
}
|
||||
};
|
||||
|
||||
class CGraphics
|
||||
{
|
||||
private:
|
||||
NSFonts::IApplicationFonts* m_pApplicationFonts; // этот объект - один на приложение
|
||||
NSFonts ::IApplicationFonts* m_pApplicationFonts; // этот объект - один на приложение
|
||||
NSGraphics::IGraphicsRenderer* m_pRenderer; // drawer interface
|
||||
CBgraFrame m_oFrame; // image data
|
||||
CGrState oGrState;
|
||||
|
||||
std::wstring m_sFontsDirectory;
|
||||
std::wstring m_sImagesDirectory;
|
||||
std::wstring m_sThemesDirectory;
|
||||
|
||||
private:
|
||||
double m_dWidthMM;
|
||||
double m_dHeightMM;
|
||||
double m_lWidthPix;
|
||||
double m_lHeightPix;
|
||||
double m_dDpiX;
|
||||
double m_dDpiY;
|
||||
|
||||
/*
|
||||
NSStructures::CPen* m_oPen;
|
||||
bool m_bPenColorInit;
|
||||
NSStructures::CBrush* m_oBrush;
|
||||
bool m_bBrushColorInit;
|
||||
|
||||
|
||||
Aggplus::CMatrix* m_oCoordTransform;
|
||||
Aggplus::CMatrix* m_oBaseTransform;
|
||||
Aggplus::CMatrix* m_oTransform;
|
||||
Aggplus::CMatrix* m_oFullTransform;
|
||||
Aggplus::CMatrix* m_oInvertFullTransform;
|
||||
|
||||
std::vector<std::pair<double, double>> ArrayPoints;
|
||||
|
||||
CFont m_oCurFont;
|
||||
|
||||
v8::Local<v8::Value>* m_oTextPr;
|
||||
v8::Local<v8::Value>* m_oGrFonts;
|
||||
v8::Local<v8::Value>* m_oLastFont;
|
||||
|
||||
CLastFontOriginInfo LastFontOriginInfo;
|
||||
|
||||
bool m_bIntegerGrid;
|
||||
|
||||
v8::Local<v8::Value>* ClipManager;
|
||||
|
||||
int TextureFillTransformScaleX;
|
||||
int TextureFillTransformScaleY;
|
||||
bool IsThumbnail;
|
||||
|
||||
bool IsDemonstrationMode;
|
||||
|
||||
v8::Local<v8::Value>* GrState;
|
||||
|
||||
double globalAlpha;
|
||||
|
||||
v8::Local<v8::Value>* TextClipRect;
|
||||
bool IsClipContext;
|
||||
|
||||
bool IsUseFonts2;
|
||||
v8::Local<v8::Value>* m_oFontManager2;
|
||||
v8::Local<v8::Value>* m_oLastFont2;
|
||||
|
||||
bool ClearMode;
|
||||
bool IsRetina;
|
||||
|
||||
v8::Local<v8::Value>* dash_no_smart;
|
||||
*/
|
||||
public:
|
||||
CGraphics()
|
||||
{
|
||||
m_dWidthMM = 0.0;
|
||||
m_dHeightMM = 0.0;
|
||||
m_lWidthPix = 0.0;
|
||||
m_lHeightPix = 0.0;
|
||||
m_dDpiX = 96.0;
|
||||
m_dDpiY = 96.0;
|
||||
|
||||
/*
|
||||
m_bIsBreak = false;
|
||||
|
||||
m_oPen = nullptr; // new AscCommon.CPen();
|
||||
m_bPenColorInit = false;
|
||||
m_oBrush = nullptr; // new AscCommon.CBrush();
|
||||
m_bBrushColorInit = false;
|
||||
|
||||
m_oFontManager = nullptr;
|
||||
|
||||
m_oCoordTransform = nullptr; // new CMatrixL();
|
||||
m_oBaseTransform = nullptr; // new CMatrixL();
|
||||
m_oTransform = nullptr; // new CMatrixL();
|
||||
m_oFullTransform = nullptr; // new CMatrixL();
|
||||
m_oInvertFullTransform = nullptr; // new CMatrixL();
|
||||
|
||||
m_oTextPr = nullptr;
|
||||
m_oGrFonts = nullptr; // new AscCommon.CGrRFonts();
|
||||
m_oLastFont = nullptr; // new AscCommon.CFontSetup();
|
||||
|
||||
m_bIntegerGrid = true;
|
||||
|
||||
ClipManager = nullptr; // new AscCommon.CClipManager();
|
||||
// ClipManager.BaseObject = this;
|
||||
|
||||
TextureFillTransformScaleX = 1;
|
||||
TextureFillTransformScaleY = 1;
|
||||
IsThumbnail = false;
|
||||
|
||||
IsDemonstrationMode = false;
|
||||
|
||||
GrState = nullptr; // new AscCommon.CGrState();
|
||||
// GrState.Parent = this;
|
||||
|
||||
globalAlpha = 1;
|
||||
|
||||
TextClipRect = nullptr;
|
||||
IsClipContext = false;
|
||||
|
||||
IsUseFonts2 = false;
|
||||
m_oFontManager2 = nullptr;
|
||||
m_oLastFont2 = nullptr;
|
||||
|
||||
ClearMode = false;
|
||||
IsRetina = false;
|
||||
|
||||
dash_no_smart = nullptr;
|
||||
*/
|
||||
}
|
||||
~CGraphics()
|
||||
{
|
||||
/*
|
||||
if(m_oContext) delete m_oContext;
|
||||
if(m_oPen) delete m_oPen;
|
||||
if(m_oBrush) delete m_oBrush;
|
||||
if(m_oFontManager) delete m_oFontManager;
|
||||
if(m_oCoordTransform) delete m_oCoordTransform;
|
||||
if(m_oBaseTransform) delete m_oBaseTransform;
|
||||
if(m_oTransform) delete m_oTransform;
|
||||
if(m_oFullTransform) delete m_oFullTransform;
|
||||
if(m_oInvertFullTransform) delete m_oInvertFullTransform;
|
||||
if(m_oTextPr) delete m_oTextPr;
|
||||
if(m_oGrFonts) delete m_oGrFonts;
|
||||
if(m_oLastFont) delete m_oLastFont;
|
||||
if(LastFontOriginInfo.Replace) delete LastFontOriginInfo.Replace;
|
||||
if(ClipManager) delete ClipManager;
|
||||
if(GrState) delete GrState;
|
||||
if(TextClipRect) delete TextClipRect;
|
||||
if(m_oFontManager2) delete m_oFontManager2;
|
||||
if(m_oLastFont2) delete m_oLastFont2;
|
||||
if(dash_no_smart) delete dash_no_smart;
|
||||
*/
|
||||
}
|
||||
|
||||
void init(double width_px, double height_px, double width_mm, double height_mm);
|
||||
@ -301,7 +191,7 @@ namespace NSGraphics
|
||||
void restore();
|
||||
void clip();
|
||||
void reset();
|
||||
void transform3(double sx, double shy, double shx, double sy, double tx, double ty, bool isNeedInvert);
|
||||
void transform3(double sx, double shy, double shx, double sy, double tx, double ty);
|
||||
void FreeFont() {}
|
||||
void ClearLastFont() {}
|
||||
// images
|
||||
@ -327,40 +217,29 @@ namespace NSGraphics
|
||||
bool GetIntegerGrid() {}
|
||||
void DrawStringASCII() {}
|
||||
void DrawStringASCII2() {}
|
||||
|
||||
/*
|
||||
void DrawHeaderEdit(double yPos, const int& lock_type, int sectionNum, bool bIsRepeat, const int& type);
|
||||
void DrawFooterEdit(double yPos, const int& lock_type, int sectionNum, bool bIsRepeat, const int& type);
|
||||
void DrawLockParagraph(const int& lock_type, double x, double y1, double y2);
|
||||
void DrawLockObjectRect(const int& lock_type, double x, double y, double w, double h);
|
||||
void DrawHeaderEdit(double yPos, BYTE lock_type);
|
||||
void DrawFooterEdit(double yPos, BYTE lock_type);
|
||||
void DrawLockParagraph (BYTE lock_type, double x, double y1, double y2) {}
|
||||
void DrawLockObjectRect(BYTE lock_type, double x, double y, double w, double h) {}
|
||||
void DrawEmptyTableLine(double x1, double y1, double x2, double y2);
|
||||
void DrawSpellingLine(double y0, double x0, double x1, double w);
|
||||
*/
|
||||
|
||||
// smart methods for horizontal / vertical lines
|
||||
void drawHorLine(int align, double y, double x, double r, int penW);
|
||||
void drawHorLine2(int align, double y, double x, double r, int penW);
|
||||
void drawVerLine(int align, double x, double y, double b, int penW);
|
||||
void drawHorLine (BYTE align, double y, double x, double r, double penW);
|
||||
void drawHorLine2(BYTE align, double y, double x, double r, double penW);
|
||||
void drawVerLine (BYTE align, double x, double y, double b, double penW);
|
||||
// мега крутые функции для таблиц
|
||||
void drawHorLineExt(int align, double y, double x, double r, int penW, double leftMW, double rightMW);
|
||||
void drawHorLineExt(BYTE align, double y, double x, double r, double penW, double leftMW, double rightMW);
|
||||
void rect(double x, double y, double w, double h);
|
||||
void TableRect(double x, double y, double w, double h);
|
||||
// функции клиппирования
|
||||
void AddClipRect(double x, double y, double w, double h);
|
||||
void RemoveClipRect() {}
|
||||
|
||||
/*
|
||||
void SetClip(const v8::Local<v8::Value>& r);
|
||||
void RemoveClip();
|
||||
*/
|
||||
|
||||
/*
|
||||
void drawCollaborativeChanges(double x, double y, double w, double h, const v8::Local<v8::Value>& Color);
|
||||
void SetClip(double x, double y, double w, double h) {}
|
||||
void RemoveClip() {}
|
||||
void drawCollaborativeChanges(double x, double y, double w, double h, int r, int g, int b, int a);
|
||||
void drawMailMergeField(double x, double y, double w, double h);
|
||||
void drawSearchResult(double x, double y, double w, double h);
|
||||
void drawFlowAnchor(double x, double y);
|
||||
*/
|
||||
|
||||
void drawFlowAnchor(double x, double y) {}
|
||||
void SavePen();
|
||||
void RestorePen();
|
||||
void SaveBrush();
|
||||
@ -369,111 +248,30 @@ namespace NSGraphics
|
||||
void RestorePenBrush();
|
||||
void SaveGrState();
|
||||
void RestoreGrState();
|
||||
void StartClipPath() {}
|
||||
void StartClipPath();
|
||||
void EndClipPath();
|
||||
void StartCheckTableDraw();
|
||||
void EndCheckTableDraw(bool bIsRestore);
|
||||
void SetTextClipRect(double _l, double _t, double _r, double _b);
|
||||
void AddSmartRect(double x, double y, double w, double h, int pen_w);
|
||||
|
||||
/*
|
||||
void CheckUseFonts2(const v8::Local<v8::Value>& _transform);
|
||||
void UncheckUseFonts2();
|
||||
*/
|
||||
|
||||
void Drawing_StartCheckBounds(double x, double y, double w, double h) {}
|
||||
void StartCheckTableDraw() {}
|
||||
void EndCheckTableDraw(bool bIsRestore) {}
|
||||
void SetTextClipRect(double _l, double _t, double _r, double _b) {}
|
||||
void AddSmartRect (double x, double y, double w, double h, double pen_w);
|
||||
void CheckUseFonts2() {}
|
||||
void UncheckUseFonts2() {}
|
||||
void Drawing_StartCheckBounds() {}
|
||||
void Drawing_EndCheckBounds() {}
|
||||
|
||||
/*
|
||||
void DrawPresentationComment(const v8::Local<v8::Value>& type, double x, double y, double w, double h);
|
||||
void DrawPolygon(const v8::Local<v8::Value>& oPath, int lineWidth, double shift);
|
||||
void DrawFootnoteRect(double x, double y, double w, double h);
|
||||
*/
|
||||
|
||||
/*
|
||||
v8::Local<v8::Value>* g_m_oContext() { return m_oContext; }
|
||||
v8::Local<v8::Value>* g_m_oPen() { return m_oPen; }
|
||||
v8::Local<v8::Value>* g_m_oBrush() { return m_oBrush; }
|
||||
v8::Local<v8::Value>* g_m_oFontManager() { return m_oFontManager; }
|
||||
v8::Local<v8::Value>* g_m_oCoordTransform() { return m_oCoordTransform; }
|
||||
v8::Local<v8::Value>* g_m_oBaseTransform() { return m_oBaseTransform; }
|
||||
v8::Local<v8::Value>* g_m_oTransform() { return m_oTransform; }
|
||||
v8::Local<v8::Value>* g_m_oFullTransform() { return m_oFullTransform; }
|
||||
v8::Local<v8::Value>* g_m_oInvertFullTransform() { return m_oInvertFullTransform; }
|
||||
v8::Local<v8::Value>* g_ArrayPoints() { return ArrayPoints; }
|
||||
v8::Local<v8::Value>* g_m_oTextPr() { return m_oTextPr; }
|
||||
v8::Local<v8::Value>* g_m_oGrFonts() { return m_oGrFonts; }
|
||||
v8::Local<v8::Value>* g_m_oLastFont() { return m_oLastFont; }
|
||||
v8::Local<v8::Value>* g_ClipManager() { return ClipManager; }
|
||||
v8::Local<v8::Value>* g_GrState() { return GrState; }
|
||||
v8::Local<v8::Value>* g_TextClipRect() { return TextClipRect; }
|
||||
v8::Local<v8::Value>* g_m_oFontManager2() { return m_oFontManager2; }
|
||||
v8::Local<v8::Value>* g_m_oLastFont2() { return m_oLastFont2; }
|
||||
v8::Local<v8::Value>* g_dash_no_smart() { return dash_no_smart; }
|
||||
double g_m_dWidthMM() { return m_dWidthMM; }
|
||||
double g_m_dHeightMM() { return m_dHeightMM; }
|
||||
double g_m_lWidthPix() { return m_lWidthPix; }
|
||||
double g_m_lHeightPix() { return m_lHeightPix; }
|
||||
double g_m_dDpiX() { return m_dDpiX; }
|
||||
double g_m_dDpiY() { return m_dDpiY; }
|
||||
bool g_m_bIsBreak() { return m_bIsBreak; }
|
||||
bool g_m_bPenColorInit() { return m_bPenColorInit; }
|
||||
bool g_m_bBrushColorInit() { return m_bBrushColorInit; }
|
||||
bool g_m_bIntegerGrid() { return m_bIntegerGrid; }
|
||||
bool g_IsThumbnail() { return IsThumbnail; }
|
||||
bool g_IsDemonstrationMode() { return IsDemonstrationMode; }
|
||||
bool g_IsClipContext() { return IsClipContext; }
|
||||
bool g_IsUseFonts2() { return IsUseFonts2; }
|
||||
bool g_ClearMode() { return ClearMode; }
|
||||
bool g_IsRetina() { return IsRetina; }
|
||||
CFont g_m_oCurFont() { return m_oCurFont; }
|
||||
CLastFontOriginInfo g_LastFontOriginInfo() { return LastFontOriginInfo; }
|
||||
int g_TextureFillTransformScaleX() { return TextureFillTransformScaleX; }
|
||||
int g_TextureFillTransformScaleY() { return TextureFillTransformScaleY; }
|
||||
int g_globalAlpha() { return globalAlpha; }
|
||||
|
||||
void s_m_oContext (v8::Local<v8::Value>* a) { m_oContext = a; }
|
||||
void s_m_oPen (v8::Local<v8::Value>* a) { m_oPen = a; }
|
||||
void s_m_oBrush (v8::Local<v8::Value>* a) { m_oBrush = a; }
|
||||
void s_m_oFontManager (v8::Local<v8::Value>* a) { m_oFontManager = a; }
|
||||
void s_m_oCoordTransform (v8::Local<v8::Value>* a) { m_oCoordTransform = a; }
|
||||
void s_m_oBaseTransform (v8::Local<v8::Value>* a) { m_oBaseTransform = a; }
|
||||
void s_m_oTransform (v8::Local<v8::Value>* a) { m_oTransform = a; }
|
||||
void s_m_oFullTransform (v8::Local<v8::Value>* a) { m_oFullTransform = a; }
|
||||
void s_m_oInvertFullTransform(v8::Local<v8::Value>* a) { m_oInvertFullTransform = a; }
|
||||
void s_ArrayPoints (v8::Local<v8::Value>* a) { ArrayPoints = a; }
|
||||
void s_m_oTextPr (v8::Local<v8::Value>* a) { m_oTextPr = a; }
|
||||
void s_m_oGrFonts (v8::Local<v8::Value>* a) { m_oGrFonts = a; }
|
||||
void s_m_oLastFont (v8::Local<v8::Value>* a) { m_oLastFont = a; }
|
||||
void s_ClipManager (v8::Local<v8::Value>* a) { ClipManager = a; }
|
||||
void s_GrState (v8::Local<v8::Value>* a) { GrState = a; }
|
||||
void s_TextClipRect (v8::Local<v8::Value>* a) { TextClipRect = a; }
|
||||
void s_m_oFontManager2 (v8::Local<v8::Value>* a) { m_oFontManager2 = a; }
|
||||
void s_m_oLastFont2 (v8::Local<v8::Value>* a) { m_oLastFont2 = a; }
|
||||
void s_dash_no_smart (v8::Local<v8::Value>* a) { dash_no_smart = a; }
|
||||
void s_m_dWidthMM (double a) { m_dWidthMM = a; }
|
||||
void s_m_dHeightMM (double a) { m_dHeightMM = a; }
|
||||
void s_m_lWidthPix (double a) { m_lWidthPix = a; }
|
||||
void s_m_lHeightPix (double a) { m_lHeightPix = a; }
|
||||
void s_m_dDpiX (double a) { m_dDpiX = a; }
|
||||
void s_m_dDpiY (double a) { m_dDpiY = a; }
|
||||
void s_m_bIsBreak (bool a) { m_bIsBreak = a; }
|
||||
void s_m_bPenColorInit (bool a) { m_bPenColorInit = a; }
|
||||
void s_m_bBrushColorInit (bool a) { m_bBrushColorInit = a; }
|
||||
void s_m_bIntegerGrid (bool a) { m_bIntegerGrid = a; }
|
||||
void s_IsThumbnail (bool a) { IsThumbnail = a; }
|
||||
void s_IsDemonstrationMode(bool a) { IsDemonstrationMode = a; }
|
||||
void s_IsClipContext (bool a) { IsClipContext = a; }
|
||||
void s_IsUseFonts2 (bool a) { IsUseFonts2 = a; }
|
||||
void s_ClearMode (bool a) { ClearMode = a; }
|
||||
void s_IsRetina (bool a) { IsRetina = a; }
|
||||
void s_m_oCurFont (CFont a) { m_oCurFont = a; }
|
||||
void s_LastFontOriginInfo(CLastFontOriginInfo a) { LastFontOriginInfo = a; }
|
||||
void s_TextureFillTransformScaleX(int a) { TextureFillTransformScaleX = a; }
|
||||
void s_TextureFillTransformScaleY(int a) { TextureFillTransformScaleY = a; }
|
||||
void s_globalAlpha (int a) { globalAlpha = a; }
|
||||
*/
|
||||
void DrawPresentationComment() {}
|
||||
void DrawPolygon() {}
|
||||
void DrawFootnoteRect() {}
|
||||
};
|
||||
|
||||
void CHist_Clip::ToRenderer(CGraphics* pRenderer)
|
||||
{
|
||||
if (!IsPath)
|
||||
{
|
||||
pRenderer->StartClipPath();
|
||||
pRenderer->rect(Rect.left, Rect.top, Rect.GetWidth(), Rect.GetHeight());
|
||||
pRenderer->EndClipPath();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // CGRAPHICS_H
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -756,6 +756,14 @@ void NAME(const v8::FunctionCallbackInfo<v8::Value>& args)
|
||||
js_value(args[5]), js_value(args[6]), js_value(args[7])); \
|
||||
js_return(args, ret); \
|
||||
}
|
||||
#define FUNCTION_WRAPPER_V8_9(NAME, NAME_EMBED) \
|
||||
void NAME(const v8::FunctionCallbackInfo<v8::Value>& args) \
|
||||
{ \
|
||||
CURRENTWRAPPER* _this = (CURRENTWRAPPER*)unwrap_native(args.This()); \
|
||||
JSSmart<CJSValue> ret = _this->NAME_EMBED(js_value(args[0]), js_value(args[1]), js_value(args[2]), js_value(args[3]), js_value(args[4]), \
|
||||
js_value(args[5]), js_value(args[6]), js_value(args[7]), js_value(args[8])); \
|
||||
js_return(args, ret); \
|
||||
}
|
||||
#define FUNCTION_WRAPPER_V8_10(NAME, NAME_EMBED) \
|
||||
void NAME(const v8::FunctionCallbackInfo<v8::Value>& args) \
|
||||
{ \
|
||||
|
||||
Reference in New Issue
Block a user