aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <nyamatongwe@gmail.com>2011-08-11 14:22:16 +1000
committernyamatongwe <nyamatongwe@gmail.com>2011-08-11 14:22:16 +1000
commit7acd4a48bda9045a51218a533d507b1af4d80b9c (patch)
tree2cc6ca4c21bd4791f8f17f6656c266878dd8edfd
parent418b4a0ab5ba38e060a9c843845a944b23ef86c6 (diff)
downloadscintilla-mirror-7acd4a48bda9045a51218a533d507b1af4d80b9c.tar.gz
Implement new APIs defined for technology choice on Windows.
-rw-r--r--cocoa/PlatCocoa.mm15
-rw-r--r--cocoa/ScintillaCocoa.mm4
2 files changed, 9 insertions, 10 deletions
diff --git a/cocoa/PlatCocoa.mm b/cocoa/PlatCocoa.mm
index 0965409c1..9b4455237 100644
--- a/cocoa/PlatCocoa.mm
+++ b/cocoa/PlatCocoa.mm
@@ -156,8 +156,7 @@ static int FontCharacterSet(Font &f) {
/**
* Creates a CTFontRef with the given properties.
*/
-void Font::Create(const char *faceName, int characterSet, float size, int weight, bool italic,
- int /* extraFontFlag */)
+void Font::Create(const FontParameters &fp)
{
Release();
@@ -165,9 +164,9 @@ void Font::Create(const char *faceName, int characterSet, float size, int weight
fid = style;
// Create the font with attributes
- QuartzFont font(faceName, strlen(faceName), size, bold, italic);
+ QuartzFont font(fp.faceName, strlen(fp.faceName), fp.size, fp.weight, fp.italic);
CTFontRef fontRef = font.getFontID();
- style->setFontRef(fontRef, characterSet);
+ style->setFontRef(fontRef, fp.characterSet);
}
//--------------------------------------------------------------------------------------------------
@@ -1095,7 +1094,7 @@ void SurfaceImpl::SetDBCSMode(int codePage_) {
codePage = codePage_;
}
-Surface *Surface::Allocate()
+Surface *Surface::Allocate(int)
{
return new SurfaceImpl();
}
@@ -1374,7 +1373,7 @@ static NSImage* ImageFromXPM(XPM* pxpm)
const int width = pxpm->GetWidth();
const int height = pxpm->GetHeight();
PRectangle rcxpm(0, 0, width, height);
- Surface* surfaceXPM = Surface::Allocate();
+ Surface* surfaceXPM = Surface::Allocate(SC_TECHNOLOGY_DEFAULT);
if (surfaceXPM)
{
surfaceXPM->InitPixMap(width, height, NULL, NULL);
@@ -1510,7 +1509,7 @@ public:
// ListBox methods
void SetFont(Font& font);
- void Create(Window& parent, int ctrlID, Scintilla::Point pt, int lineHeight_, bool unicodeMode_);
+ void Create(Window& parent, int ctrlID, Scintilla::Point pt, int lineHeight_, bool unicodeMode_, int technology_);
void SetAverageCharWidth(int width);
void SetVisibleRows(int rows);
int GetVisibleRows() const;
@@ -1595,7 +1594,7 @@ ListBox* ListBox::Allocate()
}
void ListBoxImpl::Create(Window& /*parent*/, int /*ctrlID*/, Scintilla::Point pt,
- int lineHeight_, bool unicodeMode_)
+ int lineHeight_, bool unicodeMode_, int)
{
lineHeight = lineHeight_;
unicodeMode = unicodeMode_;
diff --git a/cocoa/ScintillaCocoa.mm b/cocoa/ScintillaCocoa.mm
index 089568d66..7927652a7 100644
--- a/cocoa/ScintillaCocoa.mm
+++ b/cocoa/ScintillaCocoa.mm
@@ -702,7 +702,7 @@ void ScintillaCocoa::Paste(bool forceRectangular)
void ScintillaCocoa::CTPaint(void* gc, NSRect rc) {
#pragma unused(rc)
- Surface *surfaceWindow = Surface::Allocate();
+ Surface *surfaceWindow = Surface::Allocate(SC_TECHNOLOGY_DEFAULT);
if (surfaceWindow) {
surfaceWindow->Init(gc, wMain.GetID());
surfaceWindow->SetUnicodeMode(SC_CP_UTF8 == ct.codePage);
@@ -1251,7 +1251,7 @@ void ScintillaCocoa::SyncPaint(void* gc, PRectangle rc)
rcPaint = rc;
PRectangle rcText = GetTextRectangle();
paintingAllText = rcPaint.Contains(rcText);
- Surface *sw = Surface::Allocate();
+ Surface *sw = Surface::Allocate(SC_TECHNOLOGY_DEFAULT);
if (sw)
{
sw->Init(gc, wMain.GetID());