Commit 3022af4b authored by Oleg.Korshul's avatar Oleg.Korshul Committed by Alexander Trofimov

git-svn-id:...

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@55336 954022d7-b5bf-4e40-9824-e11837661b57
parent 15bfb4a6
......@@ -60,7 +60,7 @@ public:
return m_nSize;
}
BOOL SetCount(int nAllocSize)
INT SetCount(int nAllocSize)
{
RemoveAll();
if (nAllocSize != m_nAllocSize)
......@@ -78,7 +78,7 @@ public:
return TRUE;
}
BOOL Add()
INT Add()
{
if (m_nSize == m_nAllocSize)
{
......@@ -105,7 +105,7 @@ public:
return TRUE;
}
BOOL Add(const T& t)
INT Add(const T& t)
{
if (m_nSize == m_nAllocSize)
{
......@@ -131,7 +131,7 @@ public:
m_aT[m_nSize++] = t;
return TRUE;
}
BOOL RemoveAt(int nIndex)
INT RemoveAt(int nIndex)
{
if (nIndex < 0 || nIndex >= m_nSize)
return FALSE;
......@@ -148,7 +148,7 @@ public:
return TRUE;
}
BOOL RemoveAt(int nIndex, int nCount)
INT RemoveAt(int nIndex, int nCount)
{
if (nIndex < 0 || nIndex >= m_nSize || nCount < 1)
return FALSE;
......
......@@ -21,7 +21,7 @@ namespace NSFile
class CUtf8Converter
{
public:
static std::wstring GetUnicodeFromCharPtr(const char* pData, LONG lCount, BOOL bIsUtf8 = FALSE)
static std::wstring GetUnicodeFromCharPtr(const char* pData, LONG lCount, INT bIsUtf8 = FALSE)
{
if (bIsUtf8)
return GetUnicodeStringFromUTF8((BYTE*)pData, lCount);
......@@ -37,7 +37,7 @@ namespace NSFile
return s;
}
static std::wstring GetUnicodeFromCharPtr(std::string& sParam, BOOL bIsUtf8 = FALSE)
static std::wstring GetUnicodeFromCharPtr(std::string& sParam, INT bIsUtf8 = FALSE)
{
return GetUnicodeFromCharPtr(sParam.c_str(), (LONG)sParam.length(), bIsUtf8);
}
......
......@@ -18,7 +18,9 @@
#endif
typedef unsigned long DWORD;
#ifndef _XCODE
typedef int BOOL;
#endif
typedef unsigned char BYTE;
typedef unsigned short WORD;
typedef float REAL, FLOAT, *PFLOAT;
......
......@@ -112,6 +112,17 @@ extern char* realloc();
#include <malloc.h>
#endif
#ifndef UNICODE
#define DbgPrint wvsprintf
#define DbgPrint2 wsprintf
#define DbgMsgBox MessageBox
#else
#define DbgPrint wvsprintfA
#define DbgPrint2 wsprintfA
#define DbgMsgBox MessageBoxA
#endif
#ifndef _IOS
tdata_t
_TIFFmalloc(tsize_t s)
{
......@@ -148,16 +159,6 @@ _TIFFmemcmp(const tdata_t p1, const tdata_t p2, tsize_t c)
return (memcmp(p1, p2, (size_t) c));
}
#ifndef UNICODE
#define DbgPrint wvsprintf
#define DbgPrint2 wsprintf
#define DbgMsgBox MessageBox
#else
#define DbgPrint wvsprintfA
#define DbgPrint2 wsprintfA
#define DbgMsgBox MessageBoxA
#endif
static void
Win32WarningHandler(const char* module, const char* fmt, va_list ap)
{
......@@ -219,3 +220,5 @@ TIFFErrorHandler _TIFFerrorHandler = Win32ErrorHandler;
#endif
#endif
......@@ -322,7 +322,7 @@ bool CxImageICO::Encode(CxFile * hFile, bool bAppend, int32_t nPageCount)
int32_t nPages = nPageCount;
if (nPages<1) nPages = 1;
ICONHEADER icon_header={0,1,nPages};
ICONHEADER icon_header={0,1,(uint16_t)nPages};
if (!bAppend)
m_dwImageOffset = sizeof(ICONHEADER) + nPages * sizeof(ICONDIRENTRY);
......@@ -345,7 +345,7 @@ bool CxImageICO::Encode(CxFile * hFile, bool bAppend, int32_t nPageCount)
2*head.biHeight,
1,
(uint16_t)bitcount,
0, imagesize,
0, (uint32_t)imagesize,
0, 0, 0, 0
};
......
......@@ -121,10 +121,14 @@ void jpc_tsfb_destroy(jpc_tsfb_t *tsfb)
int jpc_tsfb_analyze(jpc_tsfb_t *tsfb, jas_seq2d_t *a)
{
#ifndef _IOS
return (tsfb->numlvls > 0) ? jpc_tsfb_analyze2(tsfb, jas_seq2d_getref(a,
jas_seq2d_xstart(a), jas_seq2d_ystart(a)), jas_seq2d_xstart(a),
jas_seq2d_ystart(a), jas_seq2d_width(a),
jas_seq2d_height(a), jas_seq2d_rowstep(a), tsfb->numlvls - 1) : 0;
#else
return 0;
#endif
}
int jpc_tsfb_analyze2(jpc_tsfb_t *tsfb, int *a, int xstart, int ystart,
......@@ -148,10 +152,14 @@ int jpc_tsfb_analyze2(jpc_tsfb_t *tsfb, int *a, int xstart, int ystart,
int jpc_tsfb_synthesize(jpc_tsfb_t *tsfb, jas_seq2d_t *a)
{
#ifndef _IOS
return (tsfb->numlvls > 0) ? jpc_tsfb_synthesize2(tsfb,
jas_seq2d_getref(a, jas_seq2d_xstart(a), jas_seq2d_ystart(a)),
jas_seq2d_xstart(a), jas_seq2d_ystart(a), jas_seq2d_width(a),
jas_seq2d_height(a), jas_seq2d_rowstep(a), tsfb->numlvls - 1) : 0;
#else
return 0;
#endif
}
int jpc_tsfb_synthesize2(jpc_tsfb_t *tsfb, int *a, int xstart, int ystart,
......
......@@ -485,6 +485,7 @@ parse_switches (j_compress_ptr cinfo, int argc, char **argv,
return argn; /* return index of next arg (file name) */
}
#ifndef _IOS
/*
* The main program.
......@@ -637,3 +638,5 @@ main (int argc, char **argv)
exit(jerr.num_warnings ? EXIT_WARNING : EXIT_SUCCESS);
return 0; /* suppress no-return-value warnings */
}
#endif
......@@ -281,6 +281,7 @@ int is_shifting_signed (arg)
return 0; /* try it with unsigned anyway */
}
#ifndef _IOS
#ifdef HAVE_PROTOTYPES
int main (int argc, char ** argv)
......@@ -400,3 +401,5 @@ int main (argc, argv)
return 0;
}
#endif
......@@ -416,6 +416,7 @@ print_text_marker (j_decompress_ptr cinfo)
return TRUE;
}
#ifndef _IOS
/*
* The main program.
......@@ -615,3 +616,5 @@ main (int argc, char **argv)
exit(jerr.num_warnings ? EXIT_WARNING : EXIT_SUCCESS);
return 0; /* suppress no-return-value warnings */
}
#endif
......@@ -360,6 +360,7 @@ parse_switches (j_compress_ptr cinfo, int argc, char **argv,
return argn; /* return index of next arg (file name) */
}
#ifndef _IOS
/*
* The main program.
......@@ -558,3 +559,5 @@ main (int argc, char **argv)
exit(jsrcerr.num_warnings + jdsterr.num_warnings ?EXIT_WARNING:EXIT_SUCCESS);
return 0; /* suppress no-return-value warnings */
}
#endif
......@@ -449,6 +449,7 @@ keymatch (char * arg, const char * keyword, int minchars)
/*
* The main program.
*/
#ifndef _IOS
int
main (int argc, char **argv)
......@@ -513,3 +514,5 @@ main (int argc, char **argv)
exit(EXIT_SUCCESS);
return 0; /* suppress no-return-value warnings */
}
#endif
......@@ -404,6 +404,7 @@ keymatch (char * arg, const char * keyword, int minchars)
return 1; /* A-OK */
}
#ifndef _IOS
/*
* The main program.
......@@ -581,3 +582,5 @@ main (int argc, char **argv)
exit(EXIT_SUCCESS);
return 0; /* suppress no-return-value warnings */
}
#endif
......@@ -281,6 +281,15 @@
#endif
#endif
//!!!
#define MNG_SUPPORT_DISPLAY
#define MNG_SUPPORT_READ
#define MNG_SUPPORT_WRITE
#define MNG_ACCESS_CHUNKS
#define MNG_STORE_CHUNKS
#define MNG_ERROR_TELLTALE
/* ************************************************************************** */
/* * * */
/* * End of user-selectable compile-time options * */
......
......@@ -85,9 +85,9 @@ CFontInfo::CFontInfo(const std::wstring& wsFontName,
const std::wstring& wsStyle,
const std::wstring& wsFontPath,
long lIndex,
BOOL bBold,
BOOL bItalic,
BOOL bFixedWidth,
INT bBold,
INT bItalic,
INT bFixedWidth,
BYTE* pPanose,
ULONG ulRange1,
ULONG ulRange2,
......@@ -145,7 +145,7 @@ CFontInfo::~CFontInfo()
{
}
BOOL CFontInfo::Equals(const CFontInfo *pFontInfo)
INT CFontInfo::Equals(const CFontInfo *pFontInfo)
{
return (m_wsFontName == pFontInfo->m_wsFontName &&
m_wsStyle == pFontInfo->m_wsStyle &&
......@@ -209,16 +209,16 @@ CFontInfo* CFontInfo::FromBuffer(BYTE*& pBuffer, std::wstring strDir)
pBuffer += sizeof(int);
// italic
BOOL bItalic = *((BOOL*)pBuffer);
pBuffer += sizeof(BOOL);
INT bItalic = *((INT*)pBuffer);
pBuffer += sizeof(INT);
// bold
BOOL bBold = *((BOOL*)pBuffer);
pBuffer += sizeof(BOOL);
INT bBold = *((INT*)pBuffer);
pBuffer += sizeof(INT);
// FixedWidth
BOOL bFixedWidth = *((BOOL*)pBuffer);
pBuffer += sizeof(BOOL);
INT bFixedWidth = *((INT*)pBuffer);
pBuffer += sizeof(INT);
// Panose
lLen = *((int*)pBuffer); // должно быть равно 10
......@@ -391,7 +391,7 @@ namespace NSCharsets
}
}
}
static int GetDefaultCharset(BOOL bUseDefCharset)
static int GetDefaultCharset(INT bUseDefCharset)
{
if ( !bUseDefCharset )
return UNKNOWN_CHARSET;
......@@ -480,7 +480,7 @@ int CFontList::GetSigPenalty(ULONG ulCandRanges[6], ULONG ulReqRanges[6], double
{
for ( unsigned long nBitCount = 0, nBit = 1; nBitCount < 32; nBitCount++, nBit *= 2 )
{
BOOL bReqAdd = FALSE;
INT bReqAdd = FALSE;
if ( ulReqRanges[nIndex] & nBit )
{
......@@ -513,7 +513,7 @@ int CFontList::GetSigPenalty(ULONG ulCandRanges[6], ULONG ulReqRanges[6], double
return (int)dPenalty;
}
int CFontList::GetFixedPitchPenalty(BOOL bCandFixed, BOOL bReqFixed)
int CFontList::GetFixedPitchPenalty(INT bCandFixed, INT bReqFixed)
{
int nPenalty = 0;
......@@ -610,7 +610,7 @@ int CFontList::GetWeightPenalty(USHORT usCandWeight, USHORT usReqWeight)
return (3 * ( abs( (int)usCandWeight - (int)usReqWeight ) / 10 ));
}
int CFontList::GetItalicPenalty(BOOL bCandItalic, BOOL bReqItalic)
int CFontList::GetItalicPenalty(INT bCandItalic, INT bReqItalic)
{
// Penalty = 4
......@@ -620,7 +620,7 @@ int CFontList::GetItalicPenalty(BOOL bCandItalic, BOOL bReqItalic)
return 0;
}
int CFontList::GetBoldPenalty(BOOL bCandBold, BOOL bReqBold)
int CFontList::GetBoldPenalty(INT bCandBold, INT bReqBold)
{
// SmallPenalty
// Penalty = 1
......@@ -904,8 +904,8 @@ void CFontList::LoadFromFolder(const std::wstring& strDirectory)
if (FT_Open_Face( pLibrary, &oOpenArgs, nIndexFace, &pFace))
continue;
BOOL bBold = (pFace->style_flags & FT_STYLE_FLAG_BOLD ? 1 : 0);
BOOL bItalic = pFace->style_flags & FT_STYLE_FLAG_ITALIC;
INT bBold = (pFace->style_flags & FT_STYLE_FLAG_BOLD ? 1 : 0);
INT bItalic = pFace->style_flags & FT_STYLE_FLAG_ITALIC;
const char* pPostName = FT_Get_Postscript_Name(pFace);
std::string sPostscriptName = "";
......@@ -931,7 +931,7 @@ void CFontList::LoadFromFolder(const std::wstring& strDirectory)
}
}
BOOL bFixedWidth = FT_IS_FIXED_WIDTH( pFace );
INT bFixedWidth = FT_IS_FIXED_WIDTH( pFace );
TT_OS2 *pOs2 = (TT_OS2 *)FT_Get_Sfnt_Table( pFace, ft_sfnt_os2 );
......
......@@ -15,10 +15,10 @@ public:
std::wstring* wsFamilyClass;
SHORT* sFamilyClass;
BOOL* bBold;
BOOL* bItalic;
INT* bBold;
INT* bItalic;
BOOL* bFixedWidth;
INT* bFixedWidth;
BYTE* pPanose;
......@@ -65,9 +65,9 @@ public:
const std::wstring& wsStyle,
const std::wstring& wsFontPath,
long lIndex,
BOOL bBold,
BOOL bItalic,
BOOL bFixedWidth,
INT bBold,
INT bItalic,
INT bFixedWidth,
BYTE *pPanose,
ULONG ulRange1,
ULONG ulRange2,
......@@ -87,7 +87,7 @@ public:
SHORT shCapHeight);
~CFontInfo();
BOOL Equals(const CFontInfo *pFontInfo);
INT Equals(const CFontInfo *pFontInfo);
static CFontInfo* FromBuffer(BYTE*& pBuffer, std::wstring strDir);
public:
......@@ -96,9 +96,9 @@ public:
long m_lIndex; // Номер шрифта в файле(если в файле больше 1 шрифта)
std::wstring m_wsStyle;
BOOL m_bBold; // Bold text
BOOL m_bItalic; // Italic text
BOOL m_bIsFixed; // Моноширинный шрифт?
INT m_bBold; // Bold text
INT m_bItalic; // Italic text
INT m_bIsFixed; // Моноширинный шрифт?
BYTE m_aPanose[10];
ULONG m_ulUnicodeRange1; // Bits 0-31
......@@ -126,7 +126,7 @@ public:
namespace NSCharsets
{
static void GetCodePageByCharset(unsigned char unCharset, unsigned long *pulBit, unsigned int *punLongIndex);
static int GetDefaultCharset(BOOL bUseDefCharset = TRUE);
static int GetDefaultCharset(INT bUseDefCharset = TRUE);
}
class CFontList
......@@ -139,14 +139,14 @@ private:
private:
int GetCharsetPenalty(ULONG ulCandRanges[6], unsigned char unReqCharset);
int GetSigPenalty(ULONG ulCandRanges[6], ULONG ulReqRanges[6], double dRangeWeight = 1, bool bPenaltyForSuperflouous = false);
int GetFixedPitchPenalty(BOOL bCandFixed, BOOL bReqFixed);
int GetFixedPitchPenalty(INT bCandFixed, INT bReqFixed);
int GetFaceNamePenalty(std::wstring sCandName, std::wstring sReqName);
int GetFamilyUnlikelyPenalty(SHORT nCandFamilyClass, SHORT nReqFamilyClass);
int GetFamilyUnlikelyPenalty(int nCandFamilyClass, std::wstring sReqFamilyClass);
int GetWidthPenalty(USHORT usCandWidth, USHORT usReqWidth);
int GetWeightPenalty(USHORT usCandWeight, USHORT usReqWeight);
int GetItalicPenalty(BOOL bCandItalic, BOOL bReqItalic);
int GetBoldPenalty(BOOL bCandBold, BOOL bReqBold);
int GetItalicPenalty(INT bCandItalic, INT bReqItalic);
int GetBoldPenalty(INT bCandBold, INT bReqBold);
int GetFontFormatPenalty(EFontFormat eCandFormat, EFontFormat eReqFormat);
int GetPanosePenalty(BYTE *pCandPanose, BYTE *pReqPanose);
int GetAvgWidthPenalty(SHORT shCandWidth, SHORT shReqWidth);
......
......@@ -367,7 +367,7 @@ int CFontFile::GetKerning(UINT unPrevGID, UINT unGID)
return (delta.x >> 6);
}
void CFontFile::SetStringGID(const BOOL& bGID)
void CFontFile::SetStringGID(const INT& bGID)
{
if (m_bStringGID == bGID)
return;
......@@ -375,15 +375,15 @@ void CFontFile::SetStringGID(const BOOL& bGID)
//ClearCache();
m_bStringGID = bGID;
}
BOOL CFontFile::GetStringGID()
INT CFontFile::GetStringGID()
{
return m_bStringGID;
}
void CFontFile::SetUseDefaultFont(const BOOL& bUse)
void CFontFile::SetUseDefaultFont(const INT& bUse)
{
m_bUseDefaultFont = bUse;
}
BOOL CFontFile::GetUseDefaultFont()
INT CFontFile::GetUseDefaultFont()
{
return m_bUseDefaultFont;
}
......@@ -402,13 +402,13 @@ std::string CFontFile::GetStyleName()
return s;
}
void CFontFile::UpdateStyles(const BOOL& bBold, const BOOL& bItalic)
void CFontFile::UpdateStyles(const INT& bBold, const INT& bItalic)
{
std::string sStyle = GetStyleName();
// Смотрим какой стиль у исходного шрифта
BOOL bSrcBold = (-1 != sStyle.find("Bold"));
BOOL bSrcItalic = (-1 != sStyle.find("Italic"));
INT bSrcBold = (-1 != sStyle.find("Bold"));
INT bSrcItalic = (-1 != sStyle.find("Italic"));
if (!bBold) // Нам нужен не жирный шрифт
{
......@@ -447,7 +447,7 @@ void CFontFile::UpdateStyles(const BOOL& bBold, const BOOL& bItalic)
}
}
void CFontFile::SetItalic(const BOOL& value)
void CFontFile::SetItalic(const INT& value)
{
if (m_bNeedDoItalic != value)
{
......@@ -456,7 +456,7 @@ void CFontFile::SetItalic(const BOOL& value)
ResetFontMatrix();
}
}
void CFontFile::SetNeedBold(const BOOL& value)
void CFontFile::SetNeedBold(const INT& value)
{
if (m_bNeedDoBold != value)
ClearCache();
......@@ -714,7 +714,7 @@ TFontCacheSizes CFontFile::GetChar(LONG lUnicode)
return oSizes;
}
BOOL CFontFile::GetString2(CGlyphString& oString)
INT CFontFile::GetString2(CGlyphString& oString)
{
int nCountGlyph = oString.GetLength();
if (nCountGlyph <= 0)
......@@ -992,7 +992,7 @@ BOOL CFontFile::GetString2(CGlyphString& oString)
return TRUE;
}
BOOL CFontFile::GetString2C(CGlyphString& oString)
INT CFontFile::GetString2C(CGlyphString& oString)
{
unsigned int unPrevGID = 0;
float fPenX = 0, fPenY = 0;
......
......@@ -117,8 +117,8 @@ public:
UINT m_unHorDpi; // Горизонтальное разрешение
UINT m_unVerDpi; // Вертикальное разрешение
BOOL m_bNeedDoItalic;
BOOL m_bNeedDoBold;
INT m_bNeedDoItalic;
INT m_bNeedDoBold;
double m_dCharSpacing;
......@@ -138,7 +138,7 @@ public:
int m_nSymbolic;
double m_dTextScale;
BOOL m_bStringGID;
INT m_bStringGID;
FT_Matrix m_oFontMatrix;
FT_Matrix m_oTextMatrix;
......@@ -155,13 +155,13 @@ public:
// вот так экономим память. нету пока таких шрифтов, в которых глифов больше 0xFFFF
USHORT m_arrCacheSizesIndexs[FONT_CACHE_SIZES_INDEXES_SIZE];
BOOL m_bUseDefaultFont;
INT m_bUseDefaultFont;
CFontFile* m_pDefaultFont;
BOOL m_bIsNeedUpdateMatrix12;
INT m_bIsNeedUpdateMatrix12;
CFontManager* m_pFontManager;
BOOL m_bHintsSupport;
INT m_bHintsSupport;
public:
......@@ -189,8 +189,8 @@ public:
bool SetTextMatrix(const double& fA, const double& fB, const double& fC, const double fD, double fE, double fF);
void SetFontMatrix(const double& fA, const double& fB, const double& fC, const double fD, double fE, double fF);
BOOL GetString2(CGlyphString& oString);
BOOL GetString2C(CGlyphString& oString);
INT GetString2(CGlyphString& oString);
INT GetString2C(CGlyphString& oString);
TFontCacheSizes GetChar(LONG lUnicode);
void AddToSizesCache(const TFontCacheSizes& oSizes);
......@@ -199,18 +199,18 @@ public:
int SetCMapForCharCode2(long lUnicode);
int GetKerning(FT_UInt unPrevGID, FT_UInt unGID);
void SetStringGID(const BOOL& bGID);
BOOL GetStringGID();
void SetUseDefaultFont(const BOOL& bUse);
BOOL GetUseDefaultFont();
void SetStringGID(const INT& bGID);
INT GetStringGID();
void SetUseDefaultFont(const INT& bUse);
INT GetUseDefaultFont();
void SetCharSpacing(const double& dCharSpacing);
double GetCharSpacing();
std::string GetStyleName();
void UpdateStyles(const BOOL& bBold, const BOOL& bItalic);
void UpdateStyles(const INT& bBold, const INT& bItalic);
void SetItalic(const BOOL& value);
void SetNeedBold(const BOOL& value);
void SetItalic(const INT& value);
void SetNeedBold(const INT& value);
int GetAscender();
int GetDescender();
......@@ -227,7 +227,7 @@ public:
struct TFreeTypeFontPath
{
CFontPath* pPath;
BOOL bNeedClose;
INT bNeedClose;
};
static int GlyphPathMoveTo(const FT_Vector *pPoint, void *pPath);
......
......@@ -26,7 +26,7 @@ int CFontStream::Release()
return ret;
}
BOOL CFontStream::CreateFromFile(const std::wstring& strFileName)
INT CFontStream::CreateFromFile(const std::wstring& strFileName)
{
NSFile::CFileBinary oFile;
if (!oFile.OpenFile(strFileName))
......@@ -214,7 +214,7 @@ double CFontManager::UpdateSize(const double &dOldSize, const double &dDpi, cons
return dOldSize * dDpi / dNewDpi;
}
BOOL CFontManager::LoadString(const std::wstring &wsBuffer, const float &fX, const float &fY)
INT CFontManager::LoadString(const std::wstring &wsBuffer, const float &fX, const float &fY)
{
if (NULL == m_pFont)
return FALSE;
......@@ -226,7 +226,7 @@ BOOL CFontManager::LoadString(const std::wstring &wsBuffer, const float &fX, con
return TRUE;
}
BOOL CFontManager::LoadString2(const std::wstring &wsBuffer, const float &fX, const float &fY)
INT CFontManager::LoadString2(const std::wstring &wsBuffer, const float &fX, const float &fY)
{
if (NULL == m_pFont)
return FALSE;
......@@ -236,7 +236,7 @@ BOOL CFontManager::LoadString2(const std::wstring &wsBuffer, const float &fX, co
return TRUE;
}
BOOL CFontManager::LoadString3(const LONG& gid, const float &fX, const float &fY)
INT CFontManager::LoadString3(const LONG& gid, const float &fX, const float &fY)
{
if (NULL == m_pFont)
return FALSE;
......@@ -249,7 +249,7 @@ BOOL CFontManager::LoadString3(const LONG& gid, const float &fX, const float &fY
return TRUE;
}
BOOL CFontManager::LoadString3C(const LONG& gid, const float &fX, const float &fY)
INT CFontManager::LoadString3C(const LONG& gid, const float &fX, const float &fY)
{
if (NULL == m_pFont)
return FALSE;
......@@ -262,7 +262,7 @@ BOOL CFontManager::LoadString3C(const LONG& gid, const float &fX, const float &f
return TRUE;
}
BOOL CFontManager::LoadString2C(const LONG& code, const float &fX, const float &fY)
INT CFontManager::LoadString2C(const LONG& code, const float &fX, const float &fY)
{
if (NULL == m_pFont)
return FALSE;
......@@ -340,7 +340,7 @@ TBBox CFontManager::MeasureString2()
return oBox;
}
BOOL CFontManager::GetNextChar2(TGlyph*& pGlyph, float& fX, float& fY)
INT CFontManager::GetNextChar2(TGlyph*& pGlyph, float& fX, float& fY)
{
if (!m_oString.GetNext(pGlyph))
return FALSE;
......@@ -358,7 +358,7 @@ BOOL CFontManager::GetNextChar2(TGlyph*& pGlyph, float& fX, float& fY)
return TRUE;
}
BOOL CFontManager::SetTextMatrix(const double &fA, const double &fB, const double &fC, const double &fD, const double &fE, const double &fF)
INT CFontManager::SetTextMatrix(const double &fA, const double &fB, const double &fC, const double &fD, const double &fE, const double &fF)
{
if (NULL == m_pFont)
return FALSE;
......@@ -370,7 +370,7 @@ BOOL CFontManager::SetTextMatrix(const double &fA, const double &fB, const doubl
return TRUE;
}
BOOL CFontManager::SetTextMatrix2(const double &fA, const double &fB, const double &fC, const double &fD, const double &fE, const double &fF)
INT CFontManager::SetTextMatrix2(const double &fA, const double &fB, const double &fC, const double &fD, const double &fE, const double &fF)
{
if (NULL == m_pFont)
return FALSE;
......@@ -382,7 +382,7 @@ BOOL CFontManager::SetTextMatrix2(const double &fA, const double &fB, const doub
return TRUE;
}
void CFontManager::SetStringGID(const BOOL &bStringGID)
void CFontManager::SetStringGID(const INT &bStringGID)
{
m_bStringGID = bStringGID;
......@@ -392,7 +392,7 @@ void CFontManager::SetStringGID(const BOOL &bStringGID)
m_pFont->SetStringGID(m_bStringGID);
}
BOOL CFontManager::GetStringPath(ISimpleGraphicsPath* pInterface)
INT CFontManager::GetStringPath(ISimpleGraphicsPath* pInterface)
{
if (NULL == pInterface)
return FALSE;
......@@ -453,7 +453,7 @@ int CFontManager::Release()
return ret;
}
BOOL CFontManager::LoadFontByName(const std::wstring& sName, const double& dSize, const LONG& lStyle, const double& dDpiX, const double& dDpiY)
INT CFontManager::LoadFontByName(const std::wstring& sName, const double& dSize, const LONG& lStyle, const double& dDpiX, const double& dDpiY)
{
if (NULL == m_pApplication)
return FALSE;
......@@ -461,8 +461,8 @@ BOOL CFontManager::LoadFontByName(const std::wstring& sName, const double& dSize
CFontSelectFormat oFormat;
oFormat.wsName = new std::wstring(sName);
oFormat.bBold = new BOOL(FALSE);
oFormat.bItalic = new BOOL(FALSE);
oFormat.bBold = new INT(FALSE);
oFormat.bItalic = new INT(FALSE);
if (lStyle & 0x01)
*oFormat.bBold = TRUE;
......@@ -476,7 +476,7 @@ BOOL CFontManager::LoadFontByName(const std::wstring& sName, const double& dSize
return LoadFontFromFile(pInfo->m_wsFontPath, pInfo->m_lIndex, dSize, dDpiX, dDpiY);
}
BOOL CFontManager::LoadFontFromFile(const std::wstring& sPath, const int& lFaceIndex, const double& dSize, const double& dDpiX, const double& dDpiY)
INT CFontManager::LoadFontFromFile(const std::wstring& sPath, const int& lFaceIndex, const double& dSize, const double& dDpiX, const double& dDpiY)
{
if (NULL == m_pApplication)
return FALSE;
......@@ -490,7 +490,7 @@ BOOL CFontManager::LoadFontFromFile(const std::wstring& sPath, const int& lFaceI
return TRUE;
}
BOOL CFontManager::LoadFontFromFile2(CFontsCache* pCache, const std::wstring& sPath, const int& lFaceIndex, const double& dSize, const double& dDpiX, const double& dDpiY)
INT CFontManager::LoadFontFromFile2(CFontsCache* pCache, const std::wstring& sPath, const int& lFaceIndex, const double& dSize, const double& dDpiX, const double& dDpiY)
{
if (NULL == pCache)
return FALSE;
......
......@@ -22,7 +22,7 @@ public:
public:
virtual BOOL CreateFromFile(const std::wstring& strFileName);
virtual INT CreateFromFile(const std::wstring& strFileName);
};
class CApplicationFontStreams
......@@ -67,9 +67,9 @@ public:
std::wstring m_sName;
BOOL m_bUseDefaultFont;
INT m_bUseDefaultFont;
double m_fCharSpacing;
BOOL m_bStringGID;
INT m_bStringGID;
int m_lUnits_Per_Em;
int m_lAscender;
......@@ -93,11 +93,11 @@ public:
double UpdateSize(const double& dOldSize, const double& dDpi, const double& dNewDpi);
BOOL LoadString(const std::wstring& wsBuffer, const float& fX, const float& fY);
BOOL LoadString2(const std::wstring& wsBuffer, const float& fX, const float& fY);
BOOL LoadString3(const LONG& gid, const float& fX, const float& fY);
BOOL LoadString3C(const LONG& gid, const float& fX, const float& fY);
BOOL LoadString2C(const LONG& wsBuffer, const float& fX, const float& fY);
INT LoadString(const std::wstring& wsBuffer, const float& fX, const float& fY);
INT LoadString2(const std::wstring& wsBuffer, const float& fX, const float& fY);
INT LoadString3(const LONG& gid, const float& fX, const float& fY);
INT LoadString3C(const LONG& gid, const float& fX, const float& fY);
INT LoadString2C(const LONG& wsBuffer, const float& fX, const float& fY);
int GetKerning(UINT unPrevGID, UINT unGID);
......@@ -105,21 +105,21 @@ public:
TBBox MeasureString();
TBBox MeasureString2();
BOOL GetNextChar2(TGlyph*& pGlyph, float& fX, float& fY);
INT GetNextChar2(TGlyph*& pGlyph, float& fX, float& fY);
BOOL SetTextMatrix(const double& fA, const double& fB, const double& fC, const double& fD, const double& fE, const double& fF);
BOOL SetTextMatrix2(const double& fA, const double& fB, const double& fC, const double& fD, const double& fE, const double& fF);
void SetStringGID(const BOOL& bStringGID);
INT SetTextMatrix(const double& fA, const double& fB, const double& fC, const double& fD, const double& fE, const double& fF);
INT SetTextMatrix2(const double& fA, const double& fB, const double& fC, const double& fD, const double& fE, const double& fF);
void SetStringGID(const INT& bStringGID);
BOOL GetStringPath(ISimpleGraphicsPath* pPath);
INT GetStringPath(ISimpleGraphicsPath* pPath);
// addref/release
virtual int AddRef();
virtual int Release();
BOOL LoadFontByName(const std::wstring& sName, const double& dSize, const LONG& lStyle, const double& dDpiX, const double& dDpiY);
BOOL LoadFontFromFile(const std::wstring& sPath, const int& lFaceIndex, const double& dSize, const double& dDpiX, const double& dDpiY);
BOOL LoadFontFromFile2(CFontsCache* pCache, const std::wstring& sPath, const int& lFaceIndex, const double& dSize, const double& dDpiX, const double& dDpiY);
INT LoadFontByName(const std::wstring& sName, const double& dSize, const LONG& lStyle, const double& dDpiX, const double& dDpiY);
INT LoadFontFromFile(const std::wstring& sPath, const int& lFaceIndex, const double& dSize, const double& dDpiX, const double& dDpiY);
INT LoadFontFromFile2(CFontsCache* pCache, const std::wstring& sPath, const int& lFaceIndex, const double& dSize, const double& dDpiX, const double& dDpiY);
public:
static CFontFile* LoadFontFile(FT_Library library, CFontStream* pStream, LONG lFaceIndex);
......
......@@ -206,7 +206,7 @@ void CFontPath::ToMM(double dHorDpi, double dVerDpi)
}
}
BOOL CFontPath::GetCurPoint(double *pdX, double *pdY)
INT CFontPath::GetCurPoint(double *pdX, double *pdY)
{
if ( NoCurrentPoint() )
{
......@@ -217,7 +217,7 @@ BOOL CFontPath::GetCurPoint(double *pdX, double *pdY)
return TRUE;
}
BOOL CFontPath::ToInterface(ISimpleGraphicsPath* pPath)
INT CFontPath::ToInterface(ISimpleGraphicsPath* pPath)
{
if ( !pPath )
return FALSE;
......
......@@ -92,26 +92,26 @@ public:
*punFlag = m_pFlags[nIndex];
}
BOOL GetCurPoint(double *pdX, double *pdY);
INT GetCurPoint(double *pdX, double *pdY);
// Добавляем флаг StrokeAdjust.
void AddStrokeAdjustHint(int nFirstControl, int nSecondControl, int nFirstPoint, int nLastPoint);
BOOL ToInterface(ISimpleGraphicsPath* pPath);
INT ToInterface(ISimpleGraphicsPath* pPath);
private:
CFontPath(CFontPath *pPath);
void Resize(int nPointsCount);
BOOL NoCurrentPoint()
INT NoCurrentPoint()
{
return m_nCurSubpath == m_nPointsCount;
}
BOOL OnePointSubpath()
INT OnePointSubpath()
{
return m_nCurSubpath == m_nPointsCount - 1;
}
BOOL OpenSubpath()
INT OpenSubpath()
{
return m_nCurSubpath < m_nPointsCount - 1;
}
......
......@@ -450,7 +450,7 @@ TGlyph* CGlyphString::GetAt(int nIndex)
return &(m_pGlyphsBuffer[nCurIndex]);
}
BOOL CGlyphString::GetNext(TGlyph*& pGlyph)
INT CGlyphString::GetNext(TGlyph*& pGlyph)
{
if ( m_nGlyphIndex >= m_nGlyphsCount || m_nGlyphIndex < 0 )
{
......
......@@ -17,9 +17,9 @@ public:
int nY; // Сдвиг по Y начальной точки для рисования символа
int nWidth; // Ширина символа
int nHeight; // Высота символа
BOOL bAA; // Anti-aliased: True означает, что Bitmap 8-битный(т.е. с альфой); False - Bitmap 1-битный
INT bAA; // Anti-aliased: True означает, что Bitmap 8-битный(т.е. с альфой); False - Bitmap 1-битный
BYTE* pData; // Bitmap data(картинка с символом)
BOOL bFreeData; // True, если память в pData нужно освободить
INT bFreeData; // True, если память в pData нужно освободить
TGlyphBitmap();
~TGlyphBitmap();
......@@ -149,7 +149,7 @@ public:
void Transform(float *pfX, float *pfY);
void SetTrans(float fX, float fY);
TGlyph* GetAt(int nIndex);
BOOL GetNext(TGlyph*& pGlyph);
INT GetNext(TGlyph*& pGlyph);
public:
float m_fTransX;
float m_fTransY;
......
......@@ -42,8 +42,8 @@ namespace NSThreads
{
protected:
CThreadDescriptor* m_hThread;
BOOL m_bRunThread;
BOOL m_bSuspend;
INT m_bRunThread;
INT m_bSuspend;
long m_lError;
long m_lThreadPriority;
......@@ -100,8 +100,8 @@ namespace NSThreads
RELEASEOBJECT(m_hThread);
}
inline BOOL IsSuspended() { return m_bSuspend; }
inline BOOL IsRunned() { return m_bRunThread; }
inline INT IsSuspended() { return m_bSuspend; }
inline INT IsRunned() { return m_bRunThread; }
inline long GetError() { return m_lError; }
inline CThreadDescriptor* GetDescriptor() { return m_hThread; }
inline int GetPriority() { return m_lThreadPriority; }
......@@ -159,6 +159,7 @@ namespace NSThreads
CBaseThread* pThis = (CBaseThread*)pv;
pThis->ThreadProc();
return NULL;
}
class __native_thread : public NSThreads::CThreadDescriptor
{
......
......@@ -89,7 +89,7 @@ namespace Aggplus
m_bRelativeCoords = FALSE;
}
CBrushLinearGradient::CBrushLinearGradient( const RectF& rect, const CColor& c1, const CColor& c2, float angle, BOOL isAngleScalable )
CBrushLinearGradient::CBrushLinearGradient( const RectF& rect, const CColor& c1, const CColor& c2, float angle, INT isAngleScalable )
: CBrush(BrushTypeLinearGradient)
{
m_points[0].X = rect.GetLeft();
......@@ -109,7 +109,7 @@ namespace Aggplus
m_bRelativeCoords = FALSE;
}
CBrushLinearGradient::CBrushLinearGradient( const Rect& rect, const CColor& c1, const CColor& c2, float angle, BOOL isAngleScalable )
CBrushLinearGradient::CBrushLinearGradient( const Rect& rect, const CColor& c1, const CColor& c2, float angle, INT isAngleScalable )
: CBrush(BrushTypeLinearGradient)
{
m_points[0].X = (float)rect.GetLeft();
......@@ -358,20 +358,20 @@ namespace Aggplus
*pPosition = m_subcolors[nIndex].position;
}
void CBrushLinearGradient::SetRelativeCoords( BOOL bRelative )
void CBrushLinearGradient::SetRelativeCoords( INT bRelative )
{
m_bRelativeCoords = bRelative;
}
BOOL CBrushLinearGradient::IsRelativeCoords() const
INT CBrushLinearGradient::IsRelativeCoords() const
{
return m_bRelativeCoords;
}
BOOL CBrushLinearGradient::IsAngleScalable() const
INT CBrushLinearGradient::IsAngleScalable() const
{
return m_bAngleScalable;
}
BOOL CBrushLinearGradient::IsRectable() const
INT CBrushLinearGradient::IsRectable() const
{
return m_bRectable;
}
......
......@@ -70,8 +70,8 @@ class CBrushLinearGradient : public CBrush
public:
CBrushLinearGradient( const PointF& p1, const PointF& p2, const CColor& c1, const CColor& c2 );
CBrushLinearGradient( const Point& p1, const Point& p2, const CColor& c1, const CColor& c2 );
CBrushLinearGradient( const RectF& rect, const CColor& c1, const CColor& c2, float angle, BOOL isAngleScalable );
CBrushLinearGradient( const Rect& rect, const CColor& c1, const CColor& c2, float angle, BOOL isAngleScalable );
CBrushLinearGradient( const RectF& rect, const CColor& c1, const CColor& c2, float angle, INT isAngleScalable );
CBrushLinearGradient( const Rect& rect, const CColor& c1, const CColor& c2, float angle, INT isAngleScalable );
CBrushLinearGradient( const RectF& rect, const CColor& c1, const CColor& c2, Aggplus::LinearGradientMode mode );
CBrushLinearGradient( const Rect& rect, const CColor& c1, const CColor& c2, Aggplus::LinearGradientMode mode );
CBrushLinearGradient( const CBrushLinearGradient& out );
......@@ -98,10 +98,10 @@ public:
// additional methods
void GetSubColor( int nIndex, CColor* pColor, float* pPosition ) const;
void SetRelativeCoords( BOOL bRelative );
BOOL IsRelativeCoords() const;
BOOL IsAngleScalable() const;
BOOL IsRectable() const;
void SetRelativeCoords( INT bRelative );
INT IsRelativeCoords() const;
INT IsAngleScalable() const;
INT IsRectable() const;
float GetAngle() const;
inline void SetBounds(const CDoubleRect& oRect) { Bounds = oRect; }
inline CDoubleRect& GetBounds() { return Bounds; }
......@@ -125,9 +125,9 @@ protected:
Aggplus::WrapMode m_wrap;
BOOL m_bAngleScalable; // масштабировать угол поворота относительно заданных точек b = arctan( width / height * tan(angle) );
BOOL m_bRectable; // в качестве направляющей используется диагональ прямоугольника
BOOL m_bRelativeCoords; // координаты точек считаются относительно рисуемого примитива
INT m_bAngleScalable; // масштабировать угол поворота относительно заданных точек b = arctan( width / height * tan(angle) );
INT m_bRectable; // в качестве направляющей используется диагональ прямоугольника
INT m_bRelativeCoords; // координаты точек считаются относительно рисуемого примитива
};
class CBrushTexture : public CBrush
......@@ -161,12 +161,12 @@ public:
public:
CImage* m_pImage;
BOOL m_bReleaseImage;
INT m_bReleaseImage;
WrapMode m_wrapMode;
CMatrix m_mtx;
BOOL m_bUsePattern;
INT m_bUsePattern;
CColor m_colors[2];
};
}
......
......@@ -6,7 +6,7 @@ typedef unsigned int UINT, *PUINT;
typedef unsigned long ARGB;
typedef unsigned char BYTE;
typedef int BOOL;
typedef int INT;
typedef unsigned long DWORD;
typedef long LONG;
......
......@@ -111,7 +111,7 @@ namespace Aggplus
#endif
}
BOOL CGraphics::IsDib()
INT CGraphics::IsDib()
{
return (NULL != m_pDib);
}
......@@ -451,7 +451,7 @@ namespace Aggplus
return Ok;
}
BOOL CGraphics::MeasureString(const std::wstring& strText, CFontManager* pManager, double* lWidth, double* lHeight)
INT CGraphics::MeasureString(const std::wstring& strText, CFontManager* pManager, double* lWidth, double* lHeight)
{
if (NULL == pManager || NULL == lWidth || NULL == lHeight)
return FALSE;
......@@ -921,12 +921,12 @@ namespace Aggplus
}
#endif
BOOL CGraphics::DrawImageUnscaled(CImage* pImage, double x, double y)
INT CGraphics::DrawImageUnscaled(CImage* pImage, double x, double y)
{
return TRUE;
}
BOOL CGraphics::DrawString(const std::wstring& strText, CFontManager* pFont, CBrush* pBrush, double x, double y)
INT CGraphics::DrawString(const std::wstring& strText, CFontManager* pFont, CBrush* pBrush, double x, double y)
{
if (pBrush->GetType() != BrushTypeSolidColor)
return TRUE;
......@@ -950,7 +950,7 @@ namespace Aggplus
pFont->LoadString2(strText, (float)_x, (float)_y);
float fX = 0;
float fY = 0;
BOOL bRes = FALSE;
INT bRes = FALSE;
while (TRUE)
{
......@@ -970,7 +970,7 @@ namespace Aggplus
return TRUE;
}
BOOL CGraphics::DrawStringC(const LONG& lText, CFontManager* pFont, CBrush* pBrush, double x, double y)
INT CGraphics::DrawStringC(const LONG& lText, CFontManager* pFont, CBrush* pBrush, double x, double y)
{
if (pBrush->GetType() != BrushTypeSolidColor)
return TRUE;
......@@ -994,7 +994,7 @@ namespace Aggplus
pFont->LoadString2C(lText, (float)_x, (float)_y);
float fX = 0;
float fY = 0;
BOOL bRes = FALSE;
INT bRes = FALSE;
while (TRUE)
{
......@@ -1014,7 +1014,7 @@ namespace Aggplus
return TRUE;
}
BOOL CGraphics::DrawStringPath(const std::wstring& strText, CFontManager* pFont, CBrush* pBrush, double x, double y)
INT CGraphics::DrawStringPath(const std::wstring& strText, CFontManager* pFont, CBrush* pBrush, double x, double y)
{
if (pBrush->GetType() != BrushTypeSolidColor)
return TRUE;
......@@ -1032,7 +1032,7 @@ namespace Aggplus
return TRUE;
}
BOOL CGraphics::DrawStringPathC(const LONG& lText, CFontManager* pFont, CBrush* pBrush, double x, double y)
INT CGraphics::DrawStringPathC(const LONG& lText, CFontManager* pFont, CBrush* pBrush, double x, double y)
{
if (pBrush->GetType() != BrushTypeSolidColor)
return TRUE;
......
......@@ -137,7 +137,7 @@ public:
// delete all in system wrapper
}
virtual BOOL Create(LONG lWidth, LONG lHeight, double dDPIX, double dDPIY) = 0;
virtual INT Create(LONG lWidth, LONG lHeight, double dDPIX, double dDPIY) = 0;
};
......@@ -209,7 +209,7 @@ public:
CGraphics(CImage* pImage);
~CGraphics();
BOOL IsDib();
INT IsDib();
Status Create(BYTE* pPixels, int lWidth, int lHeight, int lStride, LONG lPitch);
Status Create2(BYTE* pPixels, int lWidth, int lHeight, int lStride, LONG lPitch, LONG x, LONG y, LONG w, LONG h, double dW, double dH, CDIB* pDib = NULL);
......@@ -247,7 +247,7 @@ public:
Status CombineClip(CGraphicsPath* pPath, agg::sbool_op_e op);
// измерение текста
BOOL MeasureString(const std::wstring& strText, CFontManager* pManager, double* lWidth, double* lHeight);
INT MeasureString(const std::wstring& strText, CFontManager* pManager, double* lWidth, double* lHeight);
Status Clear(CColor oColor);
Status DrawArc(NSStructures::CPen* pPen, double x, double y, double width, double height, double startAngle, double sweepAngle);
......@@ -275,13 +275,13 @@ public:
Status DrawGdiplusImage(Gdiplus::Bitmap* pImage, double x, double y, double width, double height);
#endif
BOOL DrawImageUnscaled(CImage* pImage, double x, double y);
INT DrawImageUnscaled(CImage* pImage, double x, double y);
// отрисовка текста
BOOL DrawString(const std::wstring& strText, CFontManager* pFont, CBrush* pBrush, double x, double y);
BOOL DrawStringC(const LONG& lText, CFontManager* pFont, CBrush* pBrush, double x, double y);
BOOL DrawStringPath(const std::wstring& strText, CFontManager* pFont, CBrush* pBrush, double x, double y);
BOOL DrawStringPathC(const LONG& lText, CFontManager* pFont, CBrush* pBrush, double x, double y);
INT DrawString(const std::wstring& strText, CFontManager* pFont, CBrush* pBrush, double x, double y);
INT DrawStringC(const LONG& lText, CFontManager* pFont, CBrush* pBrush, double x, double y);
INT DrawStringPath(const std::wstring& strText, CFontManager* pFont, CBrush* pBrush, double x, double y);
INT DrawStringPathC(const LONG& lText, CFontManager* pFont, CBrush* pBrush, double x, double y);
void CalculateFullTransform();
bool IsClip();
......
......@@ -480,7 +480,7 @@ namespace Aggplus
return &m_agg_ps;
}
int CGraphicsPath::EllipseArc(double fX, double fY, double fXRad, double fYRad, double fAngle1, double fAngle2, BOOL bClockDirection)
int CGraphicsPath::EllipseArc(double fX, double fY, double fXRad, double fYRad, double fAngle1, double fAngle2, INT bClockDirection)
{
int nRet = 0;
......@@ -527,7 +527,7 @@ namespace Aggplus
return atan2( sin( fAngle ) / fYRad, cos( fAngle ) / fXRad );
}
int CGraphicsPath::EllipseArc2(double fX, double fY, double fXRad, double fYRad, double fAngle1, double fAngle2, BOOL bClockDirection)
int CGraphicsPath::EllipseArc2(double fX, double fY, double fXRad, double fYRad, double fAngle1, double fAngle2, INT bClockDirection)
{
// переведем углы в радианы
int nRet = 0;
......@@ -588,7 +588,7 @@ namespace Aggplus
return nRet;
}
int CGraphicsPath::EllipseArc3(double fX, double fY, double fXRad, double fYRad, double dAngle1, double dAngle2, double *pfXCur, double *pfYCur, BOOL bClockDirection)
int CGraphicsPath::EllipseArc3(double fX, double fY, double fXRad, double fYRad, double dAngle1, double dAngle2, double *pfXCur, double *pfYCur, INT bClockDirection)
{
// Рассчитаем начальную, конечную и контрольные точки
double fX1 = 0.0, fX2 = 0.0, fY1 = 0.0, fY2 = 0.0;
......@@ -657,7 +657,7 @@ namespace Aggplus
return GenericError;
}
BOOL bClockDirection = FALSE;
INT bClockDirection = FALSE;
double fEndAngle = 360 - ( fSweepAngle + fStartAngle );
double fSrtAngle = 360 - fStartAngle;
if( fSweepAngle > 0 )
......@@ -696,7 +696,7 @@ namespace Aggplus
m_pRenderer = pRenderer;
ADDREFINTERFACE(m_pRenderer);
}
IRenderer* CGraphicsPathSimpleConverter::GetRenderer(BOOL bIsAddref)
IRenderer* CGraphicsPathSimpleConverter::GetRenderer(INT bIsAddref)
{
if (bIsAddref)
{
......@@ -960,7 +960,7 @@ namespace Aggplus
return (TRUE == pFont->GetStringPath(this)) ? true : false;
}
int CGraphicsPathSimpleConverter::EllipseArc(double fX, double fY, double fXRad, double fYRad, double fAngle1, double fAngle2, BOOL bClockDirection)
int CGraphicsPathSimpleConverter::EllipseArc(double fX, double fY, double fXRad, double fYRad, double fAngle1, double fAngle2, INT bClockDirection)
{
int nRet = 0;
......@@ -1007,7 +1007,7 @@ namespace Aggplus
return atan2( sin( fAngle ) / fYRad, cos( fAngle ) / fXRad );
}
int CGraphicsPathSimpleConverter::EllipseArc2(double fX, double fY, double fXRad, double fYRad, double fAngle1, double fAngle2, BOOL bClockDirection)
int CGraphicsPathSimpleConverter::EllipseArc2(double fX, double fY, double fXRad, double fYRad, double fAngle1, double fAngle2, INT bClockDirection)
{
// переведем углы в радианы
int nRet = 0;
......@@ -1068,7 +1068,7 @@ namespace Aggplus
return nRet;
}
int CGraphicsPathSimpleConverter::EllipseArc3(double fX, double fY, double fXRad, double fYRad, double dAngle1, double dAngle2, double *pfXCur, double *pfYCur, BOOL bClockDirection)
int CGraphicsPathSimpleConverter::EllipseArc3(double fX, double fY, double fXRad, double fYRad, double dAngle1, double dAngle2, double *pfXCur, double *pfYCur, INT bClockDirection)
{
// Рассчитаем начальную, конечную и контрольные точки
double fX1 = 0.0, fX2 = 0.0, fY1 = 0.0, fY2 = 0.0;
......@@ -1137,7 +1137,7 @@ namespace Aggplus
return false;
}
BOOL bClockDirection = FALSE;
INT bClockDirection = FALSE;
double fEndAngle = 360 - ( fSweepAngle + fStartAngle );
double fSrtAngle = 360 - fStartAngle;
if( fSweepAngle > 0 )
......
......@@ -83,10 +83,10 @@ public:
public:
int EllipseArc(double fX, double fY, double fXRad, double fYRad, double fAngle1, double fAngle2, BOOL bClockDirection);
int EllipseArc(double fX, double fY, double fXRad, double fYRad, double fAngle1, double fAngle2, INT bClockDirection);
double AngToEllPrm(double fAngle, double fXRad, double fYRad);
int EllipseArc2(double fX, double fY, double fXRad, double fYRad, double fAngle1, double fAngle2, BOOL bClockDirection);
int EllipseArc3(double fX, double fY, double fXRad, double fYRad, double dAngle1, double dAngle2, double *pfXCur, double *pfYCur, BOOL bClockDirection = FALSE);
int EllipseArc2(double fX, double fY, double fXRad, double fYRad, double fAngle1, double fAngle2, INT bClockDirection);
int EllipseArc3(double fX, double fY, double fXRad, double fYRad, double dAngle1, double dAngle2, double *pfXCur, double *pfYCur, INT bClockDirection = FALSE);
int Ellipse(double fX, double fY, double fXRad, double fYRad);
Status AddArc2(double fX, double fY, double fWidth, double fHeight, double fStartAngle, double fSweepAngle);
};
......@@ -110,7 +110,7 @@ public:
public:
void SetRenderer(IRenderer* pRenderer);
IRenderer* GetRenderer(BOOL bIsAddref = FALSE);
IRenderer* GetRenderer(INT bIsAddref = FALSE);
public:
bool PathCommandMoveTo(double fX, double fY);
......@@ -139,10 +139,10 @@ public:
protected:
bool AddString(std::wstring& bstrText, CFontManager* pFont, double x, double y);
int EllipseArc(double fX, double fY, double fXRad, double fYRad, double fAngle1, double fAngle2, BOOL bClockDirection);
int EllipseArc(double fX, double fY, double fXRad, double fYRad, double fAngle1, double fAngle2, INT bClockDirection);
double AngToEllPrm(double fAngle, double fXRad, double fYRad);
int EllipseArc2(double fX, double fY, double fXRad, double fYRad, double fAngle1, double fAngle2, BOOL bClockDirection);
int EllipseArc3(double fX, double fY, double fXRad, double fYRad, double dAngle1, double dAngle2, double *pfXCur, double *pfYCur, BOOL bClockDirection = FALSE);
int EllipseArc2(double fX, double fY, double fXRad, double fYRad, double fAngle1, double fAngle2, INT bClockDirection);
int EllipseArc3(double fX, double fY, double fXRad, double fYRad, double dAngle1, double dAngle2, double *pfXCur, double *pfYCur, INT bClockDirection = FALSE);
int Ellipse(double fX, double fY, double fXRad, double fYRad);
bool AddArc(double fX, double fY, double fWidth, double fHeight, double fStartAngle, double fSweepAngle);
......
......@@ -185,7 +185,7 @@ void CGraphicsRenderer::SetClipRect(double x, double y, double w, double h)
m_pRenderer->SetClipRect3(x, y, w, h);
}
BOOL CGraphicsRenderer::CheckValidate(BOOL bOnlyGraphics)
INT CGraphicsRenderer::CheckValidate(INT bOnlyGraphics)
{
if (NULL == m_pRenderer)
return FALSE;
......@@ -481,7 +481,7 @@ HRESULT CGraphicsRenderer::put_BrushLinearAngle(const double& dAngle)
m_oBrush.LinearAngle = dAngle;
return S_OK;
}
HRESULT CGraphicsRenderer::BrushRect(const BOOL& val, const double& left, const double& top, const double& width, const double& height)
HRESULT CGraphicsRenderer::BrushRect(const INT& val, const double& left, const double& top, const double& width, const double& height)
{
m_oBrush.Rectable = val;
m_oBrush.Rect.X = (float)left;
......@@ -552,12 +552,12 @@ HRESULT CGraphicsRenderer::put_FontStyle(const LONG& lStyle)
m_oFont.SetStyle(lStyle);
return S_OK;
}
HRESULT CGraphicsRenderer::get_FontStringGID(BOOL* bGID)
HRESULT CGraphicsRenderer::get_FontStringGID(INT* bGID)
{
*bGID = m_oFont.StringGID;
return S_OK;
}
HRESULT CGraphicsRenderer::put_FontStringGID(const BOOL& bGID)
HRESULT CGraphicsRenderer::put_FontStringGID(const INT& bGID)
{
m_oFont.StringGID = bGID;
return S_OK;
......@@ -663,11 +663,11 @@ HRESULT CGraphicsRenderer::EndCommand(const DWORD& lType)
{
case c_nClipType:
{
BOOL bIsIn = (c_nClipRegionTypeWinding == (0x0001 & m_lCurrentClipMode));
INT bIsIn = (c_nClipRegionTypeWinding == (0x0001 & m_lCurrentClipMode));
m_pPath->SetRuler(bIsIn ? false : true);
BOOL bIsIntersect = (c_nClipRegionIntersect == (0x0100 & m_lCurrentClipMode));
INT bIsIntersect = (c_nClipRegionIntersect == (0x0100 & m_lCurrentClipMode));
m_pRenderer->CombineClip(m_pPath, bIsIntersect ? agg::sbool_and : agg::sbool_or);
//m_pRenderer->SetClip(m_pPath);
......@@ -758,7 +758,7 @@ HRESULT CGraphicsRenderer::DrawPath(const LONG& nType)
return S_FALSE;
LONG lFillType = (nType & 0xFF00);
BOOL bIsStroke = (0x01 == (nType & 0x01));
INT bIsStroke = (0x01 == (nType & 0x01));
switch (lFillType)
{
......
......@@ -6,10 +6,6 @@
#include "ImageFilesCache.h"
#include "../raster/BgraFrame.h"
#ifdef BOOL
#undef BOOL
#endif
class CGraphicsRenderer : public IRenderer
{
private:
......@@ -31,7 +27,7 @@ private:
DWORD m_lCurrentCommandType;
LONG m_lCurrentClipMode;
BOOL m_bIsSetupClip;
INT m_bIsSetupClip;
// область отсечения
LONG m_lClipLeft;
......@@ -46,7 +42,7 @@ private:
CImageFilesCache* m_pCache;
double m_dGlobalAlpha;
BOOL m_bGlobalAlphaEnabled;
INT m_bGlobalAlphaEnabled;
public:
CGraphicsRenderer();
......@@ -64,7 +60,7 @@ public:
void SetClipRect(double x, double y, double w, double h);
protected:
BOOL CheckValidate(BOOL bOnlyGraphics = FALSE);
INT CheckValidate(INT bOnlyGraphics = FALSE);
void Clear();
void UpdateSize();
......@@ -130,7 +126,7 @@ public:
virtual HRESULT put_BrushTextureAlpha(const LONG& lTxAlpha);
virtual HRESULT get_BrushLinearAngle(double* dAngle);
virtual HRESULT put_BrushLinearAngle(const double& dAngle);
virtual HRESULT BrushRect(const BOOL& val, const double& left, const double& top, const double& width, const double& height);
virtual HRESULT BrushRect(const INT& val, const double& left, const double& top, const double& width, const double& height);
virtual HRESULT BrushBounds(const double& left, const double& top, const double& width, const double& height);
virtual HRESULT put_BrushGradientColors(LONG* lColors, double* pPositions, LONG nCount);
......@@ -143,8 +139,8 @@ public:
virtual HRESULT put_FontSize(const double& dSize);
virtual HRESULT get_FontStyle(LONG* lStyle);
virtual HRESULT put_FontStyle(const LONG& lStyle);
virtual HRESULT get_FontStringGID(BOOL* bGID);
virtual HRESULT put_FontStringGID(const BOOL& bGID);
virtual HRESULT get_FontStringGID(INT* bGID);
virtual HRESULT put_FontStringGID(const INT& bGID);
virtual HRESULT get_FontCharSpace(double* dSpace);
virtual HRESULT put_FontCharSpace(const double& dSpace);
virtual HRESULT get_FontFaceIndex(int* lFaceIndex);
......
......@@ -168,7 +168,7 @@ public:
virtual HRESULT put_BrushTextureAlpha(const LONG& lTxAlpha) = 0;
virtual HRESULT get_BrushLinearAngle(double* dAngle) = 0;
virtual HRESULT put_BrushLinearAngle(const double& dAngle) = 0;
virtual HRESULT BrushRect(const BOOL& val, const double& left, const double& top, const double& width, const double& height) = 0;
virtual HRESULT BrushRect(const INT& val, const double& left, const double& top, const double& width, const double& height) = 0;
virtual HRESULT BrushBounds(const double& left, const double& top, const double& width, const double& height) = 0;
virtual HRESULT put_BrushGradientColors(LONG* lColors, double* pPositions, LONG nCount) = 0;
......@@ -182,8 +182,8 @@ public:
virtual HRESULT put_FontSize(const double& dSize) = 0;
virtual HRESULT get_FontStyle(LONG* lStyle) = 0;
virtual HRESULT put_FontStyle(const LONG& lStyle) = 0;
virtual HRESULT get_FontStringGID(BOOL* bGID) = 0;
virtual HRESULT put_FontStringGID(const BOOL& bGID) = 0;
virtual HRESULT get_FontStringGID(INT* bGID) = 0;
virtual HRESULT put_FontStringGID(const INT& bGID) = 0;
virtual HRESULT get_FontCharSpace(double* dSpace) = 0;
virtual HRESULT put_FontCharSpace(const double& dSpace) = 0;
virtual HRESULT get_FontFaceIndex(int* lFaceIndex) = 0;
......
......@@ -2,8 +2,9 @@
#define _BUILD_TIMER_H_
#include "BaseThread.h"
#include "time.h"
#ifdef QT_MAC
#ifdef _MAC
#include "mach/mach.h"
#include "mach/mach_time.h"
#endif
......@@ -31,7 +32,7 @@ namespace NSTimers
{
private:
DWORD m_dwInterval;
BOOL m_bIsCOMNeed;
INT m_bIsCOMNeed;
public:
CTimer() : NSThreads::CBaseThread()
......@@ -44,7 +45,7 @@ namespace NSTimers
}
inline void SetInterval(const DWORD& dwInterval) { m_dwInterval = dwInterval; }
inline void SetCOMNeed(const BOOL& bIsCOM) { m_bIsCOMNeed = bIsCOM; }
inline void SetCOMNeed(const INT& bIsCOM) { m_bIsCOMNeed = bIsCOM; }
protected:
virtual DWORD ThreadProc()
......
......@@ -65,8 +65,8 @@ public:
SizeF_T operator+(const SizeF_T& sz) const { return SizeF_T(Width+sz.Width, Height+sz.Height); }
SizeF_T operator-(const SizeF_T& sz) const { return SizeF_T(Width-sz.Width, Height-sz.Height); }
BOOL Equals(const SizeF_T& sz) const { return((Width == sz.Width) && (Height == sz.Height)); }
BOOL Empty() const { return(Width == 0 && Height == 0); }
INT Equals(const SizeF_T& sz) const { return((Width == sz.Width) && (Height == sz.Height)); }
INT Empty() const { return(Width == 0 && Height == 0); }
public:
T Width, Height;
......@@ -84,7 +84,7 @@ public:
PointF_T(const SizeF_T<T> &size) : X(size.Width), Y(size.Height) { }
PointF_T(T x, T y) : X(x), Y(y) { }
//~PointF() { }
BOOL Equals(const PointF_T& point) const { return(X==point.X && Y==point.Y); }
INT Equals(const PointF_T& point) const { return(X==point.X && Y==point.Y); }
PointF_T operator+(const PointF_T& point) const { return PointF_T(X + point.X, Y + point.Y); }
PointF_T operator-(const PointF_T& point) const { return PointF_T(X - point.X, Y - point.Y); }
public:
......@@ -111,19 +111,19 @@ public:
inline T GetTop() const { return Y; }
inline T GetRight() const { return X+Width; }
inline T GetBottom() const { return Y+Height; }
BOOL IsEmptyArea() const { return (Width <= (T)REAL_EPSILON) || (Height <= (T)REAL_EPSILON); }
BOOL Equals(const RectF_T & rect) const
INT IsEmptyArea() const { return (Width <= (T)REAL_EPSILON) || (Height <= (T)REAL_EPSILON); }
INT Equals(const RectF_T & rect) const
{
return X == rect.X && Y == rect.Y &&
Width == rect.Width && Height == rect.Height;
}
BOOL Contains(T x, T y) const
INT Contains(T x, T y) const
{
return x >= X && x < X+Width &&
y >= Y && y < Y+Height;
}
BOOL Contains(const PointF_T<T>& pt) const { return Contains(pt.X, pt.Y); }
BOOL Contains(const RectF_T& rect) const
INT Contains(const PointF_T<T>& pt) const { return Contains(pt.X, pt.Y); }
INT Contains(const RectF_T& rect) const
{
return (X <= rect.X) && (rect.GetRight() <= GetRight()) &&
(Y <= rect.Y) && (rect.GetBottom() <= GetBottom());
......@@ -132,8 +132,8 @@ public:
void Inflate(T dx, T dy) { X -= dx; Y -= dy; Width += 2*dx; Height += 2*dy; }
void Inflate(const PointF_T<T>& point) { Inflate(point.X, point.Y); }
BOOL Intersect(const RectF_T& rect) { return Intersect(*this, *this, rect); }
static BOOL Intersect(RectF_T& c, const RectF_T& a, const RectF_T& b)
INT Intersect(const RectF_T& rect) { return Intersect(*this, *this, rect); }
static INT Intersect(RectF_T& c, const RectF_T& a, const RectF_T& b)
{
T right = min(a.GetRight(), b.GetRight());
T bottom = min(a.GetBottom(), b.GetBottom());
......@@ -147,7 +147,7 @@ public:
return !c.IsEmptyArea();
}
BOOL IntersectsWith(const RectF_T& rect) const
INT IntersectsWith(const RectF_T& rect) const
{
return (GetLeft() < rect.GetRight() &&
GetTop() < rect.GetBottom() &&
......@@ -155,7 +155,7 @@ public:
GetBottom() > rect.GetTop());
}
static BOOL Union(RectF_T& c, const RectF_T& a, const RectF_T& b)
static INT Union(RectF_T& c, const RectF_T& a, const RectF_T& b)
{
T right = max(a.GetRight(), b.GetRight());
T bottom = max(a.GetBottom(), b.GetBottom());
......@@ -265,11 +265,11 @@ public:
return (top + bottom) / 2.0;
}
inline BOOL IsPointInside(const CDoublePoint& oPoint)
inline INT IsPointInside(const CDoublePoint& oPoint)
{
return IsPointInside(oPoint.x, oPoint.y);
}
BOOL IsPointInside(const double& pointX, const double& pointY)
INT IsPointInside(const double& pointX, const double& pointY)
{
return ((left <= pointX) && (right >= pointX) &&
(top <= pointY) && (bottom >= pointY));
......
......@@ -135,7 +135,7 @@ namespace NSStructures
Alpha = dNewAlpha;
}
BOOL IsEqual(CPen* pPen)
INT IsEqual(CPen* pPen)
{
if (NULL == pPen)
return FALSE;
......@@ -319,7 +319,7 @@ namespace NSStructures
}
BOOL IsEqual(CBrush* pBrush)
INT IsEqual(CBrush* pBrush)
{
if (NULL == pBrush)
return FALSE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment