mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 07:42:04 +00:00
remove a lot of unused win16 and AWT1.0 support stuff
This commit is contained in:
parent
6e8ab19846
commit
f3aa237f55
@ -17,221 +17,4 @@
|
||||
*/
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------
|
||||
// Unicode Virtual Font Manager used for Unicode rendering
|
||||
//--------------------------------------------------------------------------------------------------------
|
||||
#include "stdafx.h"
|
||||
#include "cuvfm.h"
|
||||
//------------------------------------------------------------------------------------------------
|
||||
//
|
||||
// CUnicodeVirtualFontMgr
|
||||
//
|
||||
//------------------------------------------------------------------------------------------------
|
||||
#ifdef XP_WIN
|
||||
#ifndef XP_WIN32
|
||||
#define GDI_ERROR NULL
|
||||
#endif
|
||||
#endif
|
||||
|
||||
CUnicodeVirtualFontMgr::CUnicodeVirtualFontMgr(HDC in_hdc)
|
||||
{
|
||||
TEXTMETRIC tm;
|
||||
::GetTextMetrics(in_hdc, &tm);
|
||||
m_DC = in_hdc;
|
||||
m_OrigFont = (HFONT)::SelectObject(in_hdc, ::GetStockObject(SYSTEM_FONT));
|
||||
if(m_OrigFont != (HGDIOBJ)GDI_ERROR)
|
||||
{
|
||||
CFont *pFont = CFont::FromHandle(m_OrigFont);
|
||||
if( (pFont) &&
|
||||
#ifdef XP_WIN32
|
||||
(pFont->GetLogFont(& (this->m_lf))))
|
||||
#else
|
||||
(::GetObject(pFont->m_hObject ,sizeof(LOGFONT), &(this->m_lf))))
|
||||
#endif
|
||||
{
|
||||
m_bFixed = ( m_lf.lfPitchAndFamily & FIXED_PITCH );
|
||||
m_iOrigAscent = tm.tmAscent;
|
||||
}
|
||||
::SelectObject(in_hdc, m_OrigFont);
|
||||
}
|
||||
|
||||
}
|
||||
//------------------------------------------------------------------------------------------------
|
||||
//
|
||||
// ~CUnicodeVirtualFontMgr()
|
||||
//
|
||||
//------------------------------------------------------------------------------------------------
|
||||
CUnicodeVirtualFontMgr::~CUnicodeVirtualFontMgr()
|
||||
{
|
||||
// restore the original font when we destroy.
|
||||
if(m_OrigFont != (HGDIOBJ)GDI_ERROR)
|
||||
{
|
||||
::SelectObject(m_DC, m_OrigFont);
|
||||
}
|
||||
}
|
||||
//------------------------------------------------------------------------------------------------
|
||||
//
|
||||
// CacularAscentDelta()
|
||||
//
|
||||
//------------------------------------------------------------------------------------------------
|
||||
int CUnicodeVirtualFontMgr::CacularAscentDelta(HDC hDC)
|
||||
{
|
||||
// restore the original font when we destroy.
|
||||
if(m_OrigFont != (HGDIOBJ)GDI_ERROR)
|
||||
{
|
||||
TEXTMETRIC tm;
|
||||
::GetTextMetrics(hDC, &tm);
|
||||
return m_iOrigAscent - tm.tmAscent;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
//------------------------------------------------------------------------------------------------
|
||||
//
|
||||
// CUnicodeVirtualFontMgr::GetCsidFont
|
||||
//
|
||||
//------------------------------------------------------------------------------------------------
|
||||
CFont* CUnicodeVirtualFontMgr::GetCsidFont(int16 encoding)
|
||||
{
|
||||
if(m_OrigFont != (HGDIOBJ)GDI_ERROR)
|
||||
{
|
||||
|
||||
CFont *pFont;
|
||||
if(! GetFontFromCache(encoding, pFont))
|
||||
{
|
||||
VERIFY(pFont = CreateFont(encoding));
|
||||
if(pFont != NULL)
|
||||
{
|
||||
if(AddFontToCache(encoding, pFont) == FALSE)
|
||||
{
|
||||
delete pFont;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
return pFont;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
CyaFont *CUnicodeVirtualFontMgr::GetCsidCyaFont(HDC hdc, int16 encoding)
|
||||
{
|
||||
if(m_OrigFont != (HGDIOBJ)GDI_ERROR)
|
||||
{
|
||||
|
||||
CyaFont *pFont;
|
||||
if(! GetCyaFontFromCache(encoding, pFont))
|
||||
{
|
||||
VERIFY(pFont = CreateCyaFont(hdc, encoding));
|
||||
if(pFont != NULL)
|
||||
{
|
||||
if(AddCyaFontToCache(encoding, pFont) == FALSE)
|
||||
{
|
||||
delete pFont;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
return pFont;
|
||||
}
|
||||
return NULL;
|
||||
} // GetCsidCyaFont
|
||||
|
||||
//------------------------------------------------------------------------------------------------
|
||||
//
|
||||
// CUnicodeVirtualFontMgr::CreateFont
|
||||
//
|
||||
//------------------------------------------------------------------------------------------------
|
||||
void CUnicodeVirtualFontMgr::UpdateLOGFONTForEncoding(int16 encoding)
|
||||
{
|
||||
m_lf.lfCharSet = DEFAULT_CHARSET;
|
||||
m_lf.lfPitchAndFamily = DEFAULT_PITCH;
|
||||
switch(encoding)
|
||||
{
|
||||
case CS_DINGBATS:
|
||||
{
|
||||
strcpy(m_lf.lfFaceName, "Wingdings");
|
||||
if( (! theApp.m_bUseUnicodeFont) )
|
||||
m_lf.lfCharSet = SYMBOL_CHARSET;
|
||||
}
|
||||
break;
|
||||
case CS_SYMBOL:
|
||||
{
|
||||
strcpy(m_lf.lfFaceName, "Symbol");
|
||||
if( (! theApp.m_bUseUnicodeFont) )
|
||||
m_lf.lfCharSet = SYMBOL_CHARSET;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
EncodingInfo *pEncoding = theApp.m_pIntlFont->GetEncodingInfo(theApp.m_pIntlFont->DocCSIDtoID(encoding & ~CS_AUTO));
|
||||
XP_ASSERT(pEncoding);
|
||||
if(pEncoding)
|
||||
{
|
||||
strcpy(m_lf.lfFaceName, ((m_bFixed) ? pEncoding->szFixName : pEncoding->szPropName ));
|
||||
if(sysInfo.m_bWin4)
|
||||
{
|
||||
if( (! theApp.m_bUseUnicodeFont) )
|
||||
{
|
||||
m_lf.lfCharSet = ((m_bFixed) ?
|
||||
pEncoding->iFixCharset : pEncoding->iPropCharset);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
CFont* CUnicodeVirtualFontMgr::CreateFont(int16 encoding)
|
||||
{
|
||||
UpdateLOGFONTForEncoding(encoding);
|
||||
CFont *pSelectThis = new CFont();
|
||||
VERIFY(pSelectThis->CreateFontIndirect(&m_lf));
|
||||
return pSelectThis;
|
||||
}
|
||||
|
||||
CyaFont* CUnicodeVirtualFontMgr::CreateCyaFont(HDC hdc, int16 encoding)
|
||||
{
|
||||
int isUnicode;
|
||||
if ( CIntlWin::UseUnicodeFontAPI( encoding ))
|
||||
{
|
||||
isUnicode = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
isUnicode = 0;
|
||||
}
|
||||
UpdateLOGFONTForEncoding(encoding);
|
||||
CyaFont *pSelectThis = new CyaFont();
|
||||
// todo: pass in context as first paramer, it will be used
|
||||
// to get current URL, for webfont security.
|
||||
VERIFY(pSelectThis->CreateNetscapeFontWithLOGFONT(NULL,hdc, &m_lf, isUnicode) == FONTERR_OK );
|
||||
return pSelectThis;
|
||||
}
|
||||
|
||||
BOOL CUnicodeVirtualFontMgr::GetFontFromCache(int16 encoding, CFont*& pFont)
|
||||
{
|
||||
return CVirtualFontFontCache::Get(encoding,
|
||||
m_lf.lfHeight, m_bFixed, (m_lf.lfWeight == FW_BOLD),
|
||||
m_lf.lfItalic, m_lf.lfUnderline ,pFont);
|
||||
}
|
||||
BOOL CUnicodeVirtualFontMgr::AddFontToCache(int16 encoding, CFont* pFont)
|
||||
{
|
||||
return CVirtualFontFontCache::Add(encoding,
|
||||
m_lf.lfHeight, m_bFixed, (m_lf.lfWeight == FW_BOLD),
|
||||
m_lf.lfItalic, m_lf.lfUnderline ,pFont);
|
||||
}
|
||||
|
||||
BOOL CUnicodeVirtualFontMgr::GetCyaFontFromCache(int16 encoding, CyaFont*& pFont)
|
||||
{
|
||||
return CVirtualFontFontCache::Get(encoding,
|
||||
m_lf.lfHeight, m_bFixed, (m_lf.lfWeight == FW_BOLD),
|
||||
m_lf.lfItalic, m_lf.lfUnderline ,pFont);
|
||||
}
|
||||
BOOL CUnicodeVirtualFontMgr::AddCyaFontToCache(int16 encoding, CyaFont* pFont)
|
||||
{
|
||||
return CVirtualFontFontCache::Add(encoding,
|
||||
m_lf.lfHeight, m_bFixed, (m_lf.lfWeight == FW_BOLD),
|
||||
m_lf.lfItalic, m_lf.lfUnderline ,pFont);
|
||||
}
|
||||
|
||||
|
||||
|
@ -15,49 +15,3 @@
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
/* , 1997 */
|
||||
//--------------------------------------------------------------------------------------------------------
|
||||
// Author: Frank Tang ftang@netscape.com x2913
|
||||
//
|
||||
// Unicode Virtual Font Manager used for Unicode rendering
|
||||
//--------------------------------------------------------------------------------------------------------
|
||||
#ifndef __CUVFM_H
|
||||
#define __CUVFM_H
|
||||
#include "stdafx.h"
|
||||
#include "cvffc.h"
|
||||
//------------------------------------------------------------------------------------------------
|
||||
//
|
||||
// CUnicodeVirtualFontMgr
|
||||
//
|
||||
// The constructor save the font on dc
|
||||
// The destructor restore the font on dc
|
||||
//
|
||||
//------------------------------------------------------------------------------------------------
|
||||
class CUnicodeVirtualFontMgr {
|
||||
public:
|
||||
CUnicodeVirtualFontMgr(HDC in_hdc);
|
||||
~CUnicodeVirtualFontMgr();
|
||||
//#ifdef netscape_font_module
|
||||
CyaFont *CUnicodeVirtualFontMgr::GetCsidCyaFont(HDC hdc, int16 encoding);
|
||||
//#endif //netscape_font_module
|
||||
CFont* GetCsidFont(int16 encoding);
|
||||
static void ExitInstance();
|
||||
int CacularAscentDelta(HDC hDC);
|
||||
private:
|
||||
CFont* CreateFont(int16 encoding);
|
||||
//#ifdef netscape_font_module
|
||||
CyaFont* CreateCyaFont(HDC hdc, int16 encoding);
|
||||
BOOL GetCyaFontFromCache(int16 encoding, CyaFont*& pFont);
|
||||
BOOL AddCyaFontToCache(int16 encoding, CyaFont* pFont);
|
||||
//#endif //netscape_font_module
|
||||
void UpdateLOGFONTForEncoding(int16 encoding);
|
||||
BOOL GetFontFromCache(int16 encoding, CFont*& pFont);
|
||||
BOOL AddFontToCache(int16 encoding, CFont* pFont);
|
||||
private:
|
||||
HDC m_DC;
|
||||
HFONT m_OrigFont;
|
||||
LOGFONT m_lf;
|
||||
BOOL m_bFixed;
|
||||
int m_iOrigAscent;
|
||||
};
|
||||
#endif
|
||||
|
@ -16,168 +16,4 @@
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------
|
||||
// Author: Frank Tang ftang@netscape.com x2913
|
||||
//
|
||||
// Text Handlering Routien for Unicode rendering
|
||||
//--------------------------------------------------------------------------------------------------------
|
||||
#include "stdafx.h"
|
||||
#include "cuvfs.h"
|
||||
#include "cuvfm.h"
|
||||
#include "libi18n.h"
|
||||
|
||||
//------------------------------------------------------------------------------------------------
|
||||
// INTL_CompoundStrFromUTF8
|
||||
//------------------------------------------------------------------------------------------------
|
||||
static INTL_CompoundStr* INTL_CompoundStrFromUTF8(LPCSTR pString, int length)
|
||||
{
|
||||
WCHAR ucs2[512];
|
||||
int ulen;
|
||||
INTL_CompoundStr *This = NULL;
|
||||
ulen = CASTINT(INTL_TextToUnicode(CS_UTF8, (unsigned char*)pString, length, ucs2, 512));
|
||||
This = INTL_CompoundStrFromUnicode(ucs2, ulen);
|
||||
return This;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------
|
||||
//
|
||||
// CIntlUnicodeVirtualFontStrategy::GetTextExtentPoint
|
||||
//
|
||||
//------------------------------------------------------------------------------------------------
|
||||
BOOL CIntlUnicodeVirtualFontStrategy::GetTextExtentPoint(HDC hDC, LPCSTR pString, int iLength, LPSIZE pSize)
|
||||
{
|
||||
pSize->cx = 0;
|
||||
pSize->cy = 0;
|
||||
|
||||
CUnicodeVirtualFontMgr ufm(hDC);
|
||||
INTL_CompoundStr *str = INTL_CompoundStrFromUTF8(pString, iLength);
|
||||
if(str)
|
||||
{
|
||||
CDC * pDC = CDC::FromHandle(hDC);
|
||||
INTL_Encoding_ID encoding;
|
||||
unsigned char *text;
|
||||
INTL_CompoundStrIterator iter;
|
||||
for(iter = INTL_CompoundStrFirstStr((INTL_CompoundStrIterator) str, &encoding, &text);
|
||||
iter != NULL;
|
||||
iter = INTL_CompoundStrNextStr(iter, &encoding, &text))
|
||||
{
|
||||
SIZE textsize;
|
||||
pDC->SelectObject(ufm.GetCsidFont(encoding));
|
||||
int textlength = XP_STRLEN((char*)text);
|
||||
VERIFY(CIntlWin::GetTextExtentPoint(encoding, hDC, (char*)text, textlength, &textsize));
|
||||
pSize->cx += textsize.cx;
|
||||
if(textsize.cy > pSize->cy)
|
||||
pSize->cy = textsize.cy;
|
||||
}
|
||||
INTL_CompoundStrDestroy(str);
|
||||
}
|
||||
// The destructor of CUnicodeVirtualFontMgr will reset the font.
|
||||
return TRUE;
|
||||
}
|
||||
//------------------------------------------------------------------------------------------------
|
||||
//
|
||||
// CIntlUnicodeVirtualFontStrategy::TextOut
|
||||
//
|
||||
//------------------------------------------------------------------------------------------------
|
||||
BOOL CIntlUnicodeVirtualFontStrategy::TextOut(HDC hDC, int nXStart, int nYStart, LPCSTR pString, int iLength)
|
||||
{
|
||||
// Save the current font on stack
|
||||
CUnicodeVirtualFontMgr ufm(hDC);
|
||||
INTL_CompoundStr *str = INTL_CompoundStrFromUTF8(pString, iLength);
|
||||
if(str)
|
||||
{
|
||||
CDC * pDC = CDC::FromHandle(hDC);
|
||||
INTL_Encoding_ID encoding;
|
||||
unsigned char *text;
|
||||
INTL_CompoundStrIterator iter;
|
||||
for(iter = INTL_CompoundStrFirstStr((INTL_CompoundStrIterator) str, &encoding, &text);
|
||||
iter != NULL;
|
||||
iter = INTL_CompoundStrNextStr(iter, &encoding, &text))
|
||||
{
|
||||
SIZE textsize;
|
||||
pDC->SelectObject(ufm.GetCsidFont(encoding));
|
||||
int textlength = XP_STRLEN((char*)text);
|
||||
VERIFY(CIntlWin::TextOut(encoding, hDC, nXStart, nYStart + ufm.CacularAscentDelta(hDC), (char*)text, textlength));
|
||||
VERIFY(CIntlWin::GetTextExtentPoint(encoding, hDC, (char*)text, textlength, &textsize));
|
||||
nXStart += textsize.cx;
|
||||
}
|
||||
INTL_CompoundStrDestroy(str);
|
||||
}
|
||||
// The destructor of CUnicodeVirtualFontMgr will reset the font.
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL CIntlUnicodeVirtualFontStrategy::GetTextExtentPointWithCyaFont(CyaFont *theNSFont, HDC hDC, LPCSTR pString, int iLength, LPSIZE pSize)
|
||||
{
|
||||
|
||||
pSize->cx = 0;
|
||||
pSize->cy = 0;
|
||||
|
||||
CUnicodeVirtualFontMgr ufm(hDC); // Change this to get attribute from CyaFont instead of hDC
|
||||
INTL_CompoundStr *str = INTL_CompoundStrFromUTF8(pString, iLength);
|
||||
if(str)
|
||||
{
|
||||
CDC * pDC = CDC::FromHandle(hDC);
|
||||
INTL_Encoding_ID encoding;
|
||||
unsigned char *text;
|
||||
INTL_CompoundStrIterator iter;
|
||||
for(iter = INTL_CompoundStrFirstStr((INTL_CompoundStrIterator) str, &encoding, &text);
|
||||
iter != NULL;
|
||||
iter = INTL_CompoundStrNextStr(iter, &encoding, &text))
|
||||
{
|
||||
SIZE textsize;
|
||||
CyaFont *encodingFont = ufm.GetCsidCyaFont(hDC, encoding);
|
||||
|
||||
encodingFont->PrepareDrawText( hDC ); // Select the Font in the DC
|
||||
|
||||
int textlength = XP_STRLEN((char*)text);
|
||||
VERIFY(CIntlWin::GetTextExtentPointWithCyaFont(encodingFont ,encoding, hDC, (char*)text, textlength, &textsize));
|
||||
|
||||
encodingFont->EndDrawText( hDC ); // Restore the old Font in the DC
|
||||
|
||||
pSize->cx += textsize.cx;
|
||||
if(textsize.cy > pSize->cy)
|
||||
pSize->cy = textsize.cy;
|
||||
}
|
||||
INTL_CompoundStrDestroy(str);
|
||||
}
|
||||
|
||||
// The destructor of CUnicodeVirtualFontMgr will reset the font.
|
||||
return TRUE;
|
||||
|
||||
} // GetTextExtentPointWithCyaFont
|
||||
|
||||
BOOL CIntlUnicodeVirtualFontStrategy::TextOutWithCyaFont(CyaFont *theNSFont, HDC hDC, int nXStart, int nYStart, LPCSTR lpString, int iLength)
|
||||
{
|
||||
// Save the current font on stack
|
||||
CUnicodeVirtualFontMgr ufm(hDC); /* May be we should pass theNSFont instead */
|
||||
INTL_CompoundStr *str = INTL_CompoundStrFromUTF8(lpString, iLength);
|
||||
if(str)
|
||||
{
|
||||
CDC * pDC = CDC::FromHandle(hDC);
|
||||
INTL_Encoding_ID encoding;
|
||||
unsigned char *text;
|
||||
INTL_CompoundStrIterator iter;
|
||||
for(iter = INTL_CompoundStrFirstStr((INTL_CompoundStrIterator) str, &encoding, &text);
|
||||
iter != NULL;
|
||||
iter = INTL_CompoundStrNextStr(iter, &encoding, &text))
|
||||
{
|
||||
CyaFont *encodingFont = ufm.GetCsidCyaFont(hDC, encoding);
|
||||
SIZE textsize;
|
||||
int textlength = XP_STRLEN((char*)text);
|
||||
|
||||
encodingFont->PrepareDrawText( hDC ); // Select the Font in the DC
|
||||
|
||||
VERIFY(CIntlWin::TextOutWithCyaFont(encodingFont,encoding, hDC, nXStart, nYStart + ufm.CacularAscentDelta(hDC), (char*)text, textlength));
|
||||
VERIFY(CIntlWin::GetTextExtentPoint(encoding, hDC, (char*)text, textlength, &textsize));
|
||||
|
||||
encodingFont->EndDrawText( hDC ); // Restore the old Font in the DC
|
||||
|
||||
nXStart += textsize.cx;
|
||||
}
|
||||
INTL_CompoundStrDestroy(str);
|
||||
}
|
||||
// The destructor of CUnicodeVirtualFontMgr will reset the font.
|
||||
return TRUE;
|
||||
} // TextOutWithCyaFont
|
||||
|
||||
|
@ -16,26 +16,3 @@
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#ifndef __CUVFS_H
|
||||
#define __CUVFS_H
|
||||
#include "stdafx.h"
|
||||
//------------------------------------------------------------------------------------------------
|
||||
//
|
||||
// CIntlUnicodeVirtualFontStrategy
|
||||
//
|
||||
//------------------------------------------------------------------------------------------------
|
||||
//
|
||||
// CIntlUnicodeVirtualFontStrategy class is a static class that handles UTF8 Virtual Font
|
||||
// text rendering.
|
||||
// The implementation of CIntlUnicodeVirtualFontStrategy will switch the font and
|
||||
// call the member of CIntlWin to do the actual drawing
|
||||
//
|
||||
class CIntlUnicodeVirtualFontStrategy {
|
||||
public:
|
||||
static BOOL GetTextExtentPoint(HDC hDC, LPCSTR pString, int iLength, LPSIZE lpSize);
|
||||
static BOOL TextOut(HDC hDC, int nXStart, int nYStart, LPCSTR lpString, int iLength);
|
||||
static BOOL GetTextExtentPointWithCyaFont(CyaFont *theNSFont, HDC hDC, LPCSTR pString, int iLength, LPSIZE lpSize);
|
||||
static BOOL TextOutWithCyaFont(CyaFont *theNSFont, HDC hDC, int nXStart, int nYStart, LPCSTR lpString, int iLength);
|
||||
|
||||
};
|
||||
#endif
|
||||
|
@ -15,278 +15,3 @@
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
/* , 1997 */
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------
|
||||
// Author: Frank Tang ftang@netscape.com x2913
|
||||
//
|
||||
// Virtual Font Cacahe used for Unicode rendering
|
||||
//--------------------------------------------------------------------------------------------------------
|
||||
#include "stdafx.h"
|
||||
#include "cvffc.h"
|
||||
//------------------------------------------------------------------------------------------------
|
||||
//
|
||||
// CVirtualFontFontCache
|
||||
//
|
||||
//------------------------------------------------------------------------------------------------
|
||||
CMapWordToOb* CVirtualFontFontCache::m_cache = NULL;
|
||||
//#ifdef netscape_font_module
|
||||
CMapWordToOb* CVirtualFontFontCache::m_Cyacache = NULL;
|
||||
//#endif //netscape_font_module
|
||||
void CVirtualFontFontCache::Init()
|
||||
{
|
||||
CVirtualFontFontCache::m_cache = NULL;
|
||||
// CVirtualFontFontCache::m_Cyacache = NULL;
|
||||
}
|
||||
void CVirtualFontFontCache::Exit()
|
||||
{
|
||||
CVirtualFontFontCache::Reset();
|
||||
}
|
||||
//------------------------------------------------------------------------------------------------
|
||||
//
|
||||
// CVirtualFontFontCache::Get
|
||||
//
|
||||
//------------------------------------------------------------------------------------------------
|
||||
#define STYLEKEY(f,b,i,u) ( ((f) ? 8 : 0) | ((b) ? 4 : 0) | ((i) ? 2 : 0) | ((u) ? 1 : 0) )
|
||||
BOOL CVirtualFontFontCache::Get(int16 encoding, int size, BOOL fixed, BOOL bold, BOOL italic, BOOL underline, CFont*& pFont )
|
||||
{
|
||||
if(CVirtualFontFontCache::m_cache)
|
||||
{
|
||||
CMapWordToOb* pSizecache;
|
||||
if(CVirtualFontFontCache::m_cache->Lookup(encoding, (CObject*&)pSizecache))
|
||||
{
|
||||
CMapWordToOb* pStylecache;
|
||||
if(pSizecache->Lookup(size, (CObject*&)pStylecache))
|
||||
{
|
||||
BOOL ret = pStylecache->Lookup( STYLEKEY(fixed,bold,italic,underline), (CObject*&)pFont);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
//#ifdef netscape_font_module
|
||||
BOOL CVirtualFontFontCache::Get(int16 encoding, int size, BOOL fixed, BOOL bold,
|
||||
BOOL italic, BOOL underline, CyaFont*& pFont )
|
||||
{
|
||||
if(CVirtualFontFontCache::m_Cyacache)
|
||||
{
|
||||
CMapWordToOb* pSizecache;
|
||||
if(CVirtualFontFontCache::m_Cyacache->Lookup(encoding, (CObject*&)pSizecache))
|
||||
{
|
||||
CMapWordToOb* pStylecache;
|
||||
if(pSizecache->Lookup(size, (CObject*&)pStylecache))
|
||||
{
|
||||
BOOL ret = pStylecache->Lookup( STYLEKEY(fixed,bold,italic,underline), (CObject*&)pFont);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
//#endif //netscape_font_module
|
||||
|
||||
//------------------------------------------------------------------------------------------------
|
||||
//
|
||||
// CVirtualFontFontCache::Add
|
||||
//
|
||||
//------------------------------------------------------------------------------------------------
|
||||
BOOL CVirtualFontFontCache::Add(int16 encoding, int size, BOOL fixed, BOOL bold, BOOL italic, BOOL underline, CFont*& pFont )
|
||||
{
|
||||
ASSERT(pFont);
|
||||
if(! CVirtualFontFontCache::m_cache)
|
||||
{
|
||||
// *** Fix me, we better tune the init of pSizecache
|
||||
VERIFY(CVirtualFontFontCache::m_cache = new CMapWordToOb);
|
||||
if(CVirtualFontFontCache::m_cache == NULL )
|
||||
return FALSE;
|
||||
}
|
||||
CMapWordToOb* pSizecache;
|
||||
if(! CVirtualFontFontCache::m_cache->Lookup(encoding, (CObject*&)pSizecache))
|
||||
{
|
||||
// *** Fix me, we better tune the init of pSizecache
|
||||
VERIFY(pSizecache = new CMapWordToOb);
|
||||
if(pSizecache == NULL)
|
||||
return FALSE;
|
||||
CVirtualFontFontCache::m_cache->SetAt(encoding, (CObject*&)pSizecache);
|
||||
}
|
||||
CMapWordToOb* pStylecache;
|
||||
if(! pSizecache->Lookup(size, (CObject*&)pStylecache))
|
||||
{
|
||||
// *** Fix me, we better tune the init of pSizecache
|
||||
VERIFY(pStylecache = new CMapWordToOb);
|
||||
if(pStylecache == NULL )
|
||||
return FALSE;
|
||||
pSizecache->SetAt(size, (CObject*&)pStylecache);
|
||||
}
|
||||
pStylecache->SetAt(STYLEKEY(fixed,bold,italic,underline), (CObject*&)pFont);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
//#ifdef netscape_font_module
|
||||
BOOL CVirtualFontFontCache::Add(int16 encoding, int size, BOOL fixed, BOOL bold,
|
||||
BOOL italic, BOOL underline, CyaFont*& pFont )
|
||||
{
|
||||
ASSERT(pFont);
|
||||
if(! CVirtualFontFontCache::m_Cyacache)
|
||||
{
|
||||
// *** Fix me, we better tune the init of pSizecache
|
||||
VERIFY(CVirtualFontFontCache::m_Cyacache = new CMapWordToOb);
|
||||
if(CVirtualFontFontCache::m_Cyacache == NULL )
|
||||
return FALSE;
|
||||
}
|
||||
CMapWordToOb* pSizecache;
|
||||
if(! CVirtualFontFontCache::m_Cyacache->Lookup(encoding, (CObject*&)pSizecache))
|
||||
{
|
||||
// *** Fix me, we better tune the init of pSizecache
|
||||
VERIFY(pSizecache = new CMapWordToOb);
|
||||
if(pSizecache == NULL)
|
||||
return FALSE;
|
||||
CVirtualFontFontCache::m_Cyacache->SetAt(encoding, (CObject*&)pSizecache);
|
||||
}
|
||||
CMapWordToOb* pStylecache;
|
||||
if(! pSizecache->Lookup(size, (CObject*&)pStylecache))
|
||||
{
|
||||
// *** Fix me, we better tune the init of pSizecache
|
||||
VERIFY(pStylecache = new CMapWordToOb);
|
||||
if(pStylecache == NULL )
|
||||
return FALSE;
|
||||
pSizecache->SetAt(size, (CObject*&)pStylecache);
|
||||
}
|
||||
pStylecache->SetAt(STYLEKEY(fixed,bold,italic,underline), (CObject*&)pFont);
|
||||
return TRUE;
|
||||
}
|
||||
//#endif //netscape_font_module
|
||||
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------------------------
|
||||
//
|
||||
// CVirtualFontFontCache::Reset
|
||||
//
|
||||
//------------------------------------------------------------------------------------------------
|
||||
|
||||
void CVirtualFontFontCache::Reset()
|
||||
{
|
||||
CMapWordToOb* pEncodingcache = CVirtualFontFontCache::m_cache;
|
||||
CVirtualFontFontCache::m_cache = NULL;
|
||||
// we should really lock this function
|
||||
if(pEncodingcache)
|
||||
{
|
||||
int16 encoding;
|
||||
CMapWordToOb* pSizecache;
|
||||
POSITION i;
|
||||
for(i = pEncodingcache->GetStartPosition(); i != NULL;)
|
||||
{
|
||||
pEncodingcache->GetNextAssoc(i, (WORD&)encoding, (CObject*&)pSizecache);
|
||||
// pEncodingcache->RemoveKey(encoding);
|
||||
ASSERT(pSizecache);
|
||||
if(pSizecache)
|
||||
{
|
||||
POSITION j;
|
||||
for(j = pSizecache->GetStartPosition(); j != NULL;)
|
||||
{
|
||||
int size;
|
||||
CMapWordToOb* pStylecache;
|
||||
pSizecache->GetNextAssoc(j, (WORD&)size, (CObject*&)pStylecache);
|
||||
// pSizecache->RemoveKey(size);
|
||||
ASSERT(pStylecache);
|
||||
if(pStylecache)
|
||||
{
|
||||
POSITION k;
|
||||
for(k = pStylecache->GetStartPosition(); k != NULL;)
|
||||
{
|
||||
WORD style;
|
||||
CFont* pFont = NULL;
|
||||
pStylecache->GetNextAssoc(k, style, (CObject*&)pFont);
|
||||
// pStylecache->RemoveKey(style);
|
||||
ASSERT(pFont);
|
||||
if(pFont)
|
||||
{
|
||||
delete pFont;
|
||||
}
|
||||
} // for each style
|
||||
pStylecache->RemoveAll();
|
||||
ASSERT( pStylecache->GetCount() == 0);
|
||||
ASSERT( pStylecache->IsEmpty());
|
||||
delete pStylecache;
|
||||
}
|
||||
} // for each size
|
||||
pSizecache->RemoveAll();
|
||||
ASSERT( pSizecache->GetCount() == 0);
|
||||
ASSERT( pSizecache->IsEmpty());
|
||||
delete pSizecache;
|
||||
}
|
||||
} // for each encoding
|
||||
pEncodingcache->RemoveAll();
|
||||
ASSERT( pEncodingcache->GetCount() == 0);
|
||||
ASSERT( pEncodingcache->IsEmpty());
|
||||
delete pEncodingcache;
|
||||
}
|
||||
|
||||
//#ifdef netscape_font_module
|
||||
CVirtualFontFontCache::ResetCyacache();
|
||||
//#endif //netscape_font_module
|
||||
}
|
||||
|
||||
//#ifdef netscape_font_module
|
||||
void CVirtualFontFontCache::ResetCyacache()
|
||||
{
|
||||
CMapWordToOb* pEncodingcache = CVirtualFontFontCache::m_Cyacache;
|
||||
CVirtualFontFontCache::m_Cyacache = NULL;
|
||||
// we should really lock this function
|
||||
if(pEncodingcache)
|
||||
{
|
||||
int16 encoding;
|
||||
CMapWordToOb* pSizecache;
|
||||
POSITION i;
|
||||
for(i = pEncodingcache->GetStartPosition(); i != NULL;)
|
||||
{
|
||||
pEncodingcache->GetNextAssoc(i, (WORD&)encoding, (CObject*&)pSizecache);
|
||||
// pEncodingcache->RemoveKey(encoding);
|
||||
ASSERT(pSizecache);
|
||||
if(pSizecache)
|
||||
{
|
||||
POSITION j;
|
||||
for(j = pSizecache->GetStartPosition(); j != NULL;)
|
||||
{
|
||||
int size;
|
||||
CMapWordToOb* pStylecache;
|
||||
pSizecache->GetNextAssoc(j, (WORD&)size, (CObject*&)pStylecache);
|
||||
// pSizecache->RemoveKey(size);
|
||||
ASSERT(pStylecache);
|
||||
if(pStylecache)
|
||||
{
|
||||
POSITION k;
|
||||
for(k = pStylecache->GetStartPosition(); k != NULL;)
|
||||
{
|
||||
WORD style;
|
||||
CyaFont* pFont = NULL;
|
||||
pStylecache->GetNextAssoc(k, style, (CObject*&)pFont);
|
||||
// pStylecache->RemoveKey(style);
|
||||
ASSERT(pFont);
|
||||
if(pFont)
|
||||
{
|
||||
delete pFont;
|
||||
}
|
||||
} // for each style
|
||||
pStylecache->RemoveAll();
|
||||
ASSERT( pStylecache->GetCount() == 0);
|
||||
ASSERT( pStylecache->IsEmpty());
|
||||
delete pStylecache;
|
||||
}
|
||||
} // for each size
|
||||
pSizecache->RemoveAll();
|
||||
ASSERT( pSizecache->GetCount() == 0);
|
||||
ASSERT( pSizecache->IsEmpty());
|
||||
delete pSizecache;
|
||||
}
|
||||
} // for each encoding
|
||||
pEncodingcache->RemoveAll();
|
||||
ASSERT( pEncodingcache->GetCount() == 0);
|
||||
ASSERT( pEncodingcache->IsEmpty());
|
||||
delete pEncodingcache;
|
||||
}
|
||||
}
|
||||
//#endif //netscape_font_module
|
||||
|
@ -16,36 +16,3 @@
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Author: Frank Tang ftang@netscape.com x2913
|
||||
//
|
||||
// Virtual Font Cacahe used for Unicode rendering
|
||||
//------------------------------------------------------------------------------
|
||||
#ifndef __CVFFC_H
|
||||
#define __CVFFC_H
|
||||
#include "stdafx.h"
|
||||
|
||||
class CVirtualFontFontCache {
|
||||
public:
|
||||
static void Init();
|
||||
static void Exit();
|
||||
static void Reset();
|
||||
|
||||
static void ResetCyacache();
|
||||
static BOOL Get( int16 encoding, int size, BOOL fixed, BOOL bold,
|
||||
BOOL italic, BOOL underline, CyaFont*& pFont );
|
||||
static BOOL Add( int16 encoding, int size, BOOL fixed, BOOL bold,
|
||||
BOOL italic, BOOL underline, CyaFont*& pFont );
|
||||
|
||||
static BOOL Get( int16 encoding, int size, BOOL fixed, BOOL bold,
|
||||
BOOL italic, BOOL underline, CFont*& pFont );
|
||||
static BOOL Add( int16 encoding, int size, BOOL fixed, BOOL bold,
|
||||
BOOL italic, BOOL underline, CFont*& pFont );
|
||||
|
||||
|
||||
private:
|
||||
static CMapWordToOb* m_cache;
|
||||
|
||||
static CMapWordToOb* m_Cyacache;
|
||||
};
|
||||
#endif
|
||||
|
@ -761,7 +761,7 @@ int CDCCX::SelectNetscapeFont( HDC hdc, LO_TextAttr *pAttr, CyaFont *& pMyFont )
|
||||
int isUnicode = 0;
|
||||
#ifdef XP_WIN32
|
||||
if ( CIntlWin::UseUnicodeFontAPI( pEncoding->iCSID ) &&
|
||||
! ( pEncoding->iCSID == CS_UTF8 && CIntlWin::UseVirtualFont()) ) {
|
||||
! ( pEncoding->iCSID == CS_UTF8 ) ) {
|
||||
// set the encording to use ::TextOutW()
|
||||
pEncordingStr = "Unicode";
|
||||
isUnicode = 1;
|
||||
|
@ -58,46 +58,6 @@ BOOL CIntlWin::flagTable[MAX_FLAG_TABLE_NUM];
|
||||
|
||||
extern int INTL_DocCharSetID(MWContext *context);
|
||||
|
||||
enum { // just to ignore unnecessary strcomp
|
||||
javaFontHelvetica = 0,
|
||||
javaFontTimesRoman,
|
||||
javaFontCourier,
|
||||
javaFontDialog,
|
||||
javaFontDialogInput,
|
||||
javaFontZapfDingbats
|
||||
};
|
||||
|
||||
extern "C" {
|
||||
const char* IntlGetJavaFaceName(int csid, int javaFontID);
|
||||
BYTE IntlGetJavaCharset(int csid, int javaFontID);
|
||||
jref *intl_makeJavaString(int16 encoding, char *str, int len);
|
||||
|
||||
};
|
||||
|
||||
extern "C" {
|
||||
PR_PUBLIC_API(BOOL ) CINTLWIN_TEXTOUT_E(int16 wincsid, HDC hdc, int nXStart, int nYStart, LPCSTR lpString,int iLength);
|
||||
PR_PUBLIC_API(BOOL ) CINTLWIN_GETTEXTEXTENTPOINT_E(int wincsid, HDC hDC, LPCSTR lpString, int cbString, LPSIZE lpSize);
|
||||
|
||||
PR_PUBLIC_API(const char*) INTLGETJAVAFACENAME_E(int csid, int javaFontID);
|
||||
PR_PUBLIC_API(BYTE ) INTLGETJAVACHARSET_E(int csid, int javaFontID);
|
||||
|
||||
#ifdef JAVA
|
||||
PR_PUBLIC_API(jref* ) INTL_MAKEJAVASTRING_E(int16 encoding, char *str, int len);
|
||||
#endif // JAVA
|
||||
|
||||
PR_PUBLIC_API(int16* ) INTL_GETUNICODECSIDLIST_E(int16 * outnum);
|
||||
PR_PUBLIC_API(int32 ) INTL_UNICODELEN_E(uint16* ustr);
|
||||
PR_PUBLIC_API(INTL_CompoundStr* ) INTL_COMPOUNDSTRFROMUNICODE_E(uint16* inunicode, uint32 inlen);
|
||||
PR_PUBLIC_API(void ) INTL_COMPOUNDSTRDESTROY_E(INTL_CompoundStr* This);
|
||||
PR_PUBLIC_API(INTL_CompoundStrIterator ) INTL_COMPOUNDSTRFIRSTSTR_E(INTL_CompoundStr* This, INTL_Encoding_ID *outencoding, unsigned char** outtext);
|
||||
PR_PUBLIC_API(INTL_CompoundStrIterator ) INTL_COMPOUNDSTRNEXTSTR_E(INTL_CompoundStrIterator iterator, INTL_Encoding_ID *outencoding, unsigned char** outtext);
|
||||
PR_PUBLIC_API(INTL_CompoundStr* ) INTL_COMPOUNDSTRCLONE_E(INTL_CompoundStr* s1);
|
||||
PR_PUBLIC_API(int16 ) INTL_DEFAULTWINCHARSETID_E(MWContext *context);
|
||||
PR_PUBLIC_API(int32 ) INTL_TEXTBYTECOUNTTOCHARLEN_E(int16 csid, unsigned char* text, uint32 byteCount);
|
||||
PR_PUBLIC_API(int32 ) INTL_TEXTCHARLENTOBYTECOUNT_E(int16 csid, unsigned char* text, uint32 charLen);
|
||||
PR_PUBLIC_API(uint32 ) INTL_UNICODETOSTRLEN_E(INTL_Encoding_ID encoding,INTL_Unicode* ustr, uint32 ustrlen);
|
||||
PR_PUBLIC_API(void ) INTL_UNICODETOSTR_E(INTL_Encoding_ID encoding,INTL_Unicode* ustr,uint32 ustrlen,unsigned char* dest, uint32 destbuflen);
|
||||
};
|
||||
|
||||
//
|
||||
// Data type use for Unicode table loader
|
||||
@ -290,7 +250,6 @@ CIntlFont::CIntlFont()
|
||||
}
|
||||
|
||||
nEncoding = MAXLANGNUM;
|
||||
intl_ReadUnicodeConvList();
|
||||
}
|
||||
|
||||
EncodingInfo * CIntlFont::GetEncodingInfo(int id)
|
||||
@ -873,10 +832,6 @@ static BOOL intlUnicodeFlag(int16 wincsid)
|
||||
#endif
|
||||
|
||||
|
||||
BOOL CIntlWin::UseVirtualFont()
|
||||
{
|
||||
return theApp.m_bUseVirtualFont;
|
||||
}
|
||||
BOOL CIntlWin::GetTextExtentPoint(int wincsid, HDC hDC, LPCSTR pString, int iLength, LPSIZE lpSize)
|
||||
{
|
||||
#ifdef MOZ_NGLAYOUT
|
||||
@ -1148,218 +1103,3 @@ extern "C" INTLCharSetID FE_GetCharSetID(INTL_CharSetID_Selector selector)
|
||||
}
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
#define MAXNUMOFCSIDLIST 64
|
||||
#define UNICODECONVERSIONCHARTLIST "UnicodeConversionCharsetList"
|
||||
|
||||
|
||||
#ifdef XP_WIN32
|
||||
#define UNICODEDLL "UNI3200.DLL"
|
||||
#define LIBRARYLOADOK(l) (l != NULL)
|
||||
#define UNICODE_VERIFYCSIDLIST_SYM "UNICODE_VERIFYCSIDLIST"
|
||||
#else
|
||||
#define UNICODEDLL "UNI1600.DLL"
|
||||
#define LIBRARYLOADOK(l) (l > HINSTANCE_ERROR)
|
||||
#define UNICODE_VERIFYCSIDLIST_SYM "_UNICODE_VERIFYCSIDLIST"
|
||||
#endif
|
||||
|
||||
static int intl_VerifyCsidList(int inNumOfItem, int16 *csidlist)
|
||||
{
|
||||
int iRetval = 0;
|
||||
HINSTANCE hUniLib = LoadLibrary(UNICODEDLL);
|
||||
if(LIBRARYLOADOK(hUniLib)) {
|
||||
typedef int (*func)(int, int16 *);
|
||||
func VerifyProc = (func)GetProcAddress(hUniLib, UNICODE_VERIFYCSIDLIST_SYM);
|
||||
ASSERT(VerifyProc);
|
||||
if(VerifyProc) {
|
||||
iRetval = VerifyProc(inNumOfItem, csidlist);
|
||||
VerifyProc = NULL;
|
||||
}
|
||||
|
||||
FreeLibrary(hUniLib);
|
||||
hUniLib = NULL;
|
||||
}
|
||||
return(iRetval);
|
||||
}
|
||||
|
||||
//
|
||||
// Read and Write charset List for Unicode conversion
|
||||
//
|
||||
static void intl_ReadUnicodeConvList()
|
||||
{
|
||||
CString charsetlist;
|
||||
int16 csidlist[MAXNUMOFCSIDLIST];
|
||||
int num_of_csid;
|
||||
|
||||
// Find the charsetlist from preference
|
||||
charsetlist = theApp.GetProfileString("INTL", UNICODECONVERSIONCHARTLIST, "");
|
||||
|
||||
// If we cannot find it from preference , find it from resource
|
||||
if(strlen((const char*)charsetlist) == 0)
|
||||
charsetlist = szLoadString(IDS_CHARSET_LIST_FOR_UNICODE);
|
||||
|
||||
// Otherwise, it is very wrong, however, we still give it
|
||||
// CS_LATIN1 , CS_SYMBOL, and CS_DINGBATS
|
||||
if(strlen((const char*)charsetlist) == 0)
|
||||
charsetlist =
|
||||
"iso-8859-1,x-cp1250,x-cp1251,x-cp1253,iso-8859-9,Shift_JIS,euc-kr,gb2312,big5,adobe-symbol-encoding,x-dingbats";
|
||||
|
||||
for(num_of_csid=0; num_of_csid < MAXNUMOFCSIDLIST; )
|
||||
{
|
||||
int duplicate;
|
||||
int csid;
|
||||
int i;
|
||||
int lastone = 0;
|
||||
int len = charsetlist.GetLength();
|
||||
int thislen = charsetlist.Find(',');
|
||||
if(thislen == -1)
|
||||
{
|
||||
lastone = 1;
|
||||
thislen = len;
|
||||
}
|
||||
|
||||
csid=INTL_CharSetNameToID((char *)(const char *)charsetlist.Left(thislen));
|
||||
// Check to see is that duplicate ?
|
||||
for(i=0, duplicate=0;i < num_of_csid; i ++)
|
||||
{
|
||||
if(csid == csidlist[i])
|
||||
duplicate = 1;
|
||||
}
|
||||
// If not duplicate, add it to the list
|
||||
if(duplicate == 0 )
|
||||
csidlist[num_of_csid++] = csid;
|
||||
|
||||
if(lastone == 0 )
|
||||
charsetlist = charsetlist.Right(len - thislen - 1);
|
||||
else
|
||||
break;
|
||||
}
|
||||
// Write it to the Prefs
|
||||
intl_WriteUnicodeConvList(num_of_csid, csidlist);
|
||||
|
||||
// Filter through our csid checking code - intl_VerifyCsidList()
|
||||
num_of_csid = intl_VerifyCsidList(num_of_csid, csidlist);
|
||||
|
||||
// OK, now we have the list. Call the xp function to initialize
|
||||
// Unicode Converter
|
||||
INTL_SetUnicodeCSIDList(num_of_csid, csidlist);
|
||||
|
||||
}
|
||||
static void intl_WriteUnicodeConvList(int num_of_csid, int16* csidlist)
|
||||
{
|
||||
char str[512];
|
||||
int first, i;
|
||||
char * cur;
|
||||
// Now, convert those csid to string
|
||||
for(first=1,i=0,cur=str;i < num_of_csid;i++)
|
||||
{
|
||||
if(first)
|
||||
first = 0;
|
||||
else
|
||||
*cur++ = ',';
|
||||
INTL_CharSetIDToName(csidlist[i], cur);
|
||||
cur += strlen(cur);
|
||||
}
|
||||
// And write to the Profile
|
||||
theApp.WriteProfileString("INTL", UNICODECONVERSIONCHARTLIST, str);
|
||||
}
|
||||
|
||||
|
||||
extern "C" {
|
||||
|
||||
BYTE IntlGetJavaCharset(int csid, int javaFontID)
|
||||
{
|
||||
// currently, we ignore javaFontID. We may need to use it later
|
||||
switch(csid)
|
||||
{
|
||||
case CS_DINGBATS:
|
||||
case CS_SYMBOL:
|
||||
return SYMBOL_CHARSET;
|
||||
default:
|
||||
return IntlGetLfCharset(csid);
|
||||
}
|
||||
}
|
||||
const char* IntlGetJavaFaceName(int csid, int javaFontID)
|
||||
{
|
||||
switch(csid)
|
||||
{
|
||||
case CS_DINGBATS:
|
||||
return "Wingdings";
|
||||
case CS_SYMBOL:
|
||||
return "Symbol";
|
||||
default:
|
||||
switch(javaFontID)
|
||||
{
|
||||
case javaFontTimesRoman:
|
||||
case javaFontDialog:
|
||||
case javaFontHelvetica:
|
||||
return IntlGetUIPropFaceName(csid);
|
||||
case javaFontDialogInput:
|
||||
case javaFontCourier:
|
||||
return IntlGetUIFixFaceName(csid);
|
||||
default:
|
||||
return IntlGetUIPropFaceName(csid);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
extern "C" {
|
||||
|
||||
PR_PUBLIC_API(const char* )
|
||||
INTLGETJAVAFACENAME_E(int csid, int javaFontID)
|
||||
{ return IntlGetJavaFaceName(csid, javaFontID); }
|
||||
PR_PUBLIC_API(BYTE )
|
||||
INTLGETJAVACHARSET_E(int csid, int javaFontID)
|
||||
{ return IntlGetJavaCharset(csid, javaFontID); }
|
||||
PR_PUBLIC_API(int16* )
|
||||
INTL_GETUNICODECSIDLIST_E(int16 * outnum)
|
||||
{ return INTL_GetUnicodeCSIDList(outnum); }
|
||||
PR_PUBLIC_API(int32 )
|
||||
INTL_UNICODELEN_E(uint16* ustr)
|
||||
{ return INTL_UnicodeLen(ustr); }
|
||||
PR_PUBLIC_API(INTL_CompoundStr* )
|
||||
INTL_COMPOUNDSTRFROMUNICODE_E(uint16* inunicode, uint32 inlen)
|
||||
{ return INTL_CompoundStrFromUnicode(inunicode, inlen); }
|
||||
PR_PUBLIC_API(void )
|
||||
INTL_COMPOUNDSTRDESTROY_E(INTL_CompoundStr* This)
|
||||
{ INTL_CompoundStrDestroy(This); }
|
||||
PR_PUBLIC_API(INTL_CompoundStrIterator )
|
||||
INTL_COMPOUNDSTRFIRSTSTR_E(INTL_CompoundStr* This, INTL_Encoding_ID *outencoding, unsigned char** outtext)
|
||||
{ return INTL_CompoundStrFirstStr(This, outencoding,outtext); }
|
||||
PR_PUBLIC_API(INTL_CompoundStrIterator )
|
||||
INTL_COMPOUNDSTRNEXTSTR_E(INTL_CompoundStrIterator iterator, INTL_Encoding_ID *outencoding, unsigned char** outtext)
|
||||
{ return INTL_CompoundStrNextStr(iterator, outencoding, outtext); }
|
||||
PR_PUBLIC_API(INTL_CompoundStr* )
|
||||
INTL_COMPOUNDSTRCLONE_E(INTL_CompoundStr* s1)
|
||||
{ return INTL_CompoundStrClone(s1); }
|
||||
PR_PUBLIC_API(int16 )
|
||||
INTL_DEFAULTWINCHARSETID_E(MWContext *context)
|
||||
{ return INTL_DefaultWinCharSetID(context); }
|
||||
PR_PUBLIC_API(int32 )
|
||||
INTL_TEXTBYTECOUNTTOCHARLEN_E(int16 csid, unsigned char* text, uint32 byteCount)
|
||||
{ return INTL_TextByteCountToCharLen(csid, text, byteCount); }
|
||||
PR_PUBLIC_API(int32 )
|
||||
INTL_TEXTCHARLENTOBYTECOUNT_E(int16 csid, unsigned char* text, uint32 charLen)
|
||||
{ return INTL_TextCharLenToByteCount(csid, text, charLen); }
|
||||
PR_PUBLIC_API(uint32 )
|
||||
INTL_UNICODETOSTRLEN_E(INTL_Encoding_ID encoding,INTL_Unicode* ustr, uint32 ustrlen)
|
||||
{ return INTL_UnicodeToStrLen(encoding,ustr,ustrlen); }
|
||||
PR_PUBLIC_API(void )
|
||||
INTL_UNICODETOSTR_E(INTL_Encoding_ID encoding,INTL_Unicode* ustr,uint32 ustrlen,unsigned char* dest, uint32 destbuflen)
|
||||
{ INTL_UnicodeToStr(encoding,ustr,ustrlen,dest,destbuflen); }
|
||||
|
||||
#ifdef JAVA
|
||||
PR_PUBLIC_API(jref * )
|
||||
INTL_MAKEJAVASTRING_E(int16 encoding, char *str, int len)
|
||||
{ return intl_makeJavaString(encoding, str, len); }
|
||||
#endif // JAVA
|
||||
|
||||
PR_PUBLIC_API(BOOL )
|
||||
CINTLWIN_TEXTOUT_E(int16 wincsid, HDC hdc, int nXStart, int nYStart, LPCSTR lpString,int iLength)
|
||||
{ return CIntlWin::TextOut( wincsid, hdc, nXStart, nYStart, lpString, iLength); }
|
||||
PR_PUBLIC_API(BOOL )
|
||||
CINTLWIN_GETTEXTEXTENTPOINT_E(int wincsid, HDC hDC, LPCSTR lpString, int cbString, LPSIZE lpSize)
|
||||
{ return CIntlWin::GetTextExtentPoint( wincsid, hDC, lpString, cbString, lpSize); }
|
||||
|
||||
}; // extern "C"
|
||||
|
@ -102,7 +102,6 @@ public:
|
||||
#else
|
||||
inline static BOOL UseUnicodeFontAPI(int16 wincsid) { return FALSE; };
|
||||
#endif
|
||||
static BOOL UseVirtualFont();
|
||||
|
||||
static int16 GetSystemLocaleCsid();
|
||||
static int16 CodePageToCsid(UINT cp);
|
||||
|
@ -1294,9 +1294,6 @@ $(OUTDIR)\mozilla.dep: $(DEPTH)\cmd\winfe\mkfiles32\mozilla.mak
|
||||
$(DEPTH)\cmd\winfe\csttlbr2.cpp
|
||||
!ifndef MOZ_NGLAYOUT
|
||||
$(DEPTH)\cmd\winfe\custom.cpp
|
||||
$(DEPTH)\cmd\winfe\cuvfm.cpp
|
||||
$(DEPTH)\cmd\winfe\cuvfs.cpp
|
||||
$(DEPTH)\cmd\winfe\cvffc.cpp
|
||||
!endif
|
||||
$(DEPTH)\cmd\winfe\cxabstra.cpp
|
||||
$(DEPTH)\cmd\winfe\cxdc.cpp
|
||||
|
@ -21,8 +21,6 @@
|
||||
// Various startup/shutdown functions.
|
||||
void STARTUP_np(void);
|
||||
void SHUTDOWN_np(void);
|
||||
void STARTUP_cvffc(void);
|
||||
void SHUTDOWN_cvffc(void);
|
||||
#ifdef MOZ_LOC_INDEP
|
||||
void STARTUP_li(void);
|
||||
void SHUTDOWN_li(void);
|
||||
@ -877,7 +875,6 @@ BOOL CNetscapeApp::InitInstance()
|
||||
theApp.m_bUseVirtualFont = TRUE;
|
||||
#endif
|
||||
|
||||
STARTUP_cvffc();
|
||||
|
||||
// Set version and application names
|
||||
// We have to get around it's const status.
|
||||
@ -1000,7 +997,6 @@ BOOL CNetscapeApp::InitInstance()
|
||||
INTL_ChangeDefaultCharSetID((int16)csid);
|
||||
|
||||
#ifndef MOZ_NGLAYOUT
|
||||
STARTUP_cvffc();
|
||||
|
||||
VERIFY( FONTERR_OK == theGlobalNSFont.InitFontModule() );
|
||||
#endif /* MOZ_NGLAYOUT */
|
||||
@ -2341,9 +2337,6 @@ int CNetscapeApp::ExitInstance()
|
||||
Ctl3dUnregister(m_hInstance);
|
||||
#endif
|
||||
|
||||
#ifndef MOZ_NGLAYOUT
|
||||
SHUTDOWN_cvffc();
|
||||
#endif /* MOZ_NGLAYOUT */
|
||||
// Free off various allocated memory.
|
||||
if(XP_AppName) {
|
||||
XP_FREE(XP_AppName);
|
||||
|
@ -25,7 +25,6 @@
|
||||
|
||||
// XP Includes
|
||||
#include "np.h"
|
||||
#include "cvffc.h"
|
||||
|
||||
#include "prefapi.h"
|
||||
|
||||
|
@ -42,7 +42,6 @@
|
||||
#include "winprefs/ibrprefs.h"
|
||||
#include "winprefs/prefuiid.h"
|
||||
#include "winprefs/prefui.h"
|
||||
#include "cvffc.h"
|
||||
#ifdef EDITOR
|
||||
#include "edt.h"
|
||||
#endif // EDITOR
|
||||
@ -847,8 +846,6 @@ CAppearancePrefs::SetEncodingFonts(DWORD dwCharsetNum, LPENCODINGINFO lpInfo)
|
||||
CDCCX::ClearAllFontCaches();
|
||||
#ifdef MOZ_NGLAYOUT
|
||||
XP_ASSERT(0);
|
||||
#else
|
||||
CVirtualFontFontCache::Reset();
|
||||
#endif /* MOZ_NGLAYOUT */
|
||||
theApp.m_pIntlFont->WriteToIniFile();
|
||||
|
||||
|
@ -18,14 +18,4 @@
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "cvffc.h"
|
||||
|
||||
void STARTUP_cvffc(void)
|
||||
{
|
||||
CVirtualFontFontCache::Init();
|
||||
}
|
||||
|
||||
void SHUTDOWN_cvffc(void)
|
||||
{
|
||||
CVirtualFontFontCache::Reset();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user