aboutsummaryrefslogtreecommitdiffhomepage
path: root/macosx
diff options
context:
space:
mode:
Diffstat (limited to 'macosx')
-rw-r--r--macosx/PlatMacOSX.cxx33
1 files changed, 15 insertions, 18 deletions
diff --git a/macosx/PlatMacOSX.cxx b/macosx/PlatMacOSX.cxx
index 8392b97cf..56c9d32c2 100644
--- a/macosx/PlatMacOSX.cxx
+++ b/macosx/PlatMacOSX.cxx
@@ -315,7 +315,6 @@ void SurfaceImpl::Polygon(Scintilla::Point *pts, int npts, ColourAllocated fore,
// Draw the polygon
CGContextAddLines( gc, points, npts );
- // TODO: Should the path be automatically closed, or is that the caller's responsability?
// Explicitly close the path, so it is closed for stroking AND filling (implicit close = filling only)
CGContextClosePath( gc );
CGContextDrawPath( gc, kCGPathFillStroke );
@@ -334,7 +333,6 @@ void SurfaceImpl::RectangleDraw(PRectangle rc, ColourAllocated fore, ColourAlloc
// Quartz integer -> float point conversion fun (see comment in SurfaceImpl::LineTo)
// We subtract 1 from the Width() and Height() so that all our drawing is within the area defined
// by the PRectangle. Otherwise, we draw one pixel too far to the right and bottom.
- // TODO: Create some version of PRectangleToCGRect to do this conversion for us?
CGContextAddRect( gc, CGRectMake( rc.left + 0.5, rc.top + 0.5, rc.Width() - 1, rc.Height() - 1 ) );
CGContextDrawPath( gc, kCGPathFillStroke );
}
@@ -407,8 +405,12 @@ void SurfaceImpl::FillRectangle(PRectangle rc, Surface &surfacePattern) {
}
void SurfaceImpl::RoundedRectangle(PRectangle rc, ColourAllocated fore, ColourAllocated back) {
- // TODO: Look at the Win32 API to determine what this is supposed to do:
+ // This is only called from the margin marker drawing code for SC_MARK_ROUNDRECT
+ // The Win32 version does
// ::RoundRect(hdc, rc.left + 1, rc.top, rc.right - 1, rc.bottom, 8, 8 );
+ // which is a rectangle with rounded corners each having a radius of 4 pixels.
+ // It would be almost as good just cutting off the corners with lines at
+ // 45 degrees as is done on GTK+.
// Create a rectangle with semicircles at the corners
const int MAX_RADIUS = 4;
@@ -442,7 +444,6 @@ void SurfaceImpl::RoundedRectangle(PRectangle rc, ColourAllocated fore, ColourAl
};
// Align the points in the middle of the pixels
- // TODO: Should I include these +0.5 in the array creation code above?
for( int i = 0; i < 4*3; ++ i )
{
CGPoint* c = (CGPoint*) corners;
@@ -629,15 +630,15 @@ void SurfaceImpl::MeasureWidths(Font &font_, const char *s, int len, int *positi
// OSX systems. We should expand to using that on older systems as well.
for (int i = 0; i < len; i++)
positions [i] = 0;
-
+
// We need the right X coords, so we have to append a char to get the left coord of thast extra char
char* buf = (char*) malloc (len+1);
if (!buf)
return;
-
+
memcpy (buf, s, len);
buf [len] = '.';
-
+
textLayout->setText (reinterpret_cast<const UInt8*>(buf), len+1, *reinterpret_cast<QuartzTextStyle*>(font_.GetID()));
ATSUGlyphInfoArray* theGlyphInfoArrayPtr;
ByteCount theArraySize;
@@ -663,12 +664,12 @@ void SurfaceImpl::MeasureWidths(Font &font_, const char *s, int len, int *positi
// as 1 unicode character can map to multiple UTF8 characters.
// See: http://www.tbray.org/ongoing/When/200x/2003/04/26/UTF
// Or: http://www.cl.cam.ac.uk/~mgk25/unicode.html
- if ( unicodeMode )
+ if ( unicodeMode )
{
unsigned char mask = 0xc0;
int count = 1;
// Add one additonal byte for each extra high order one in the byte
- while ( uch >= mask && count < 8 )
+ while ( uch >= mask && count < 8 )
{
positions[i++] = position;
count ++;
@@ -1126,7 +1127,6 @@ public:
int GetSelection();
int Find(const char *prefix);
void GetValue(int n, char *value, int len);
- void Sort();
void RegisterImage(int type, const char *xpm_data);
void ClearRegisteredImages();
void SetDoubleClickAction(CallBackAction action, void *data) {
@@ -1482,7 +1482,7 @@ PRectangle ListBoxImpl::GetDesiredRect() {
rcDesired.bottom = itemHeight * rows;
rcDesired.right = rcDesired.left + maxItemWidth + aveCharWidth;
- if (Length() > rows)
+ if (Length() > rows)
rcDesired.right += kScrollBarWidth;
rcDesired.right += IconWidth();
@@ -1631,11 +1631,6 @@ void ListBoxImpl::GetValue(int n, char *value, int len) {
delete []text;
}
-void ListBoxImpl::Sort() {
- // TODO: Implement this
- fprintf(stderr, "ListBox::Sort\n");
-}
-
void ListBoxImpl::RegisterImage(int type, const char *xpm_data) {
xset.Add(type, xpm_data);
}
@@ -1679,7 +1674,9 @@ void Menu::Show(Point pt, Window &) {
);
}
-// TODO: Consider if I should be using GetCurrentEventTime instead of gettimeoday
+// ElapsedTime is used for precise performance measurements during development
+// and not for anything a user sees.
+
ElapsedTime::ElapsedTime() {
struct timeval curTime;
int retVal;
@@ -1837,7 +1834,7 @@ void Platform::Assert(const char *c, const char *file, int line) {
sprintf(buffer, "Assertion [%s] failed at %s %d", c, file, line);
strcat(buffer, "\r\n");
Platform::DebugDisplay(buffer);
-#ifdef DEBUG
+#ifdef DEBUG
// Jump into debugger in assert on Mac (CL269835)
::Debugger();
#endif