summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generic/tkInt.decls2
-rw-r--r--generic/tkInt.h4
-rw-r--r--generic/tkIntDecls.h6
-rw-r--r--macosx/tkMacOSXFont.c10
-rw-r--r--unix/tkUnixFont.c19
-rw-r--r--unix/tkUnixRFont.c22
-rw-r--r--win/tkWinFont.c17
7 files changed, 39 insertions, 41 deletions
diff --git a/generic/tkInt.decls b/generic/tkInt.decls
index 4926f15..5a8fddc 100644
--- a/generic/tkInt.decls
+++ b/generic/tkInt.decls
@@ -631,7 +631,7 @@ declare 183 {
}
declare 184 {
void TkDrawAngledChars(Display *display,Drawable drawable, GC gc,
- Tk_Font tkfont, const char *source, int numBytes, double x,
+ Tk_Font tkfont, const char *source, Tcl_Size numBytes, double x,
double y, double angle)
}
diff --git a/generic/tkInt.h b/generic/tkInt.h
index f67a70f..5d00c5a 100644
--- a/generic/tkInt.h
+++ b/generic/tkInt.h
@@ -1364,8 +1364,8 @@ MODULE_SCOPE void TkFocusSplit(TkWindow *winPtr);
MODULE_SCOPE void TkFocusJoin(TkWindow *winPtr);
MODULE_SCOPE void TkpDrawCharsInContext(Display * display,
Drawable drawable, GC gc, Tk_Font tkfont,
- const char *source, int numBytes, int rangeStart,
- int rangeLength, int x, int y);
+ const char *source, Tcl_Size numBytes, Tcl_Size rangeStart,
+ Tcl_Size rangeLength, int x, int y);
MODULE_SCOPE void TkpDrawAngledCharsInContext(Display * display,
Drawable drawable, GC gc, Tk_Font tkfont,
const char *source, Tcl_Size numBytes, Tcl_Size rangeStart,
diff --git a/generic/tkIntDecls.h b/generic/tkIntDecls.h
index e5dcd9b..ba87749 100644
--- a/generic/tkIntDecls.h
+++ b/generic/tkIntDecls.h
@@ -562,8 +562,8 @@ EXTERN int TkIntersectAngledTextLayout(Tk_TextLayout layout,
/* 184 */
EXTERN void TkDrawAngledChars(Display *display,
Drawable drawable, GC gc, Tk_Font tkfont,
- const char *source, int numBytes, double x,
- double y, double angle);
+ const char *source, Tcl_Size numBytes,
+ double x, double y, double angle);
/* 185 */
EXTERN void TkpRedrawWidget(Tk_Window tkwin);
/* 186 */
@@ -788,7 +788,7 @@ typedef struct TkIntStubs {
void (*tkDrawAngledTextLayout) (Display *display, Drawable drawable, GC gc, Tk_TextLayout layout, int x, int y, double angle, int firstChar, int lastChar); /* 181 */
void (*tkUnderlineAngledTextLayout) (Display *display, Drawable drawable, GC gc, Tk_TextLayout layout, int x, int y, double angle, int underline); /* 182 */
int (*tkIntersectAngledTextLayout) (Tk_TextLayout layout, int x, int y, int width, int height, double angle); /* 183 */
- void (*tkDrawAngledChars) (Display *display, Drawable drawable, GC gc, Tk_Font tkfont, const char *source, int numBytes, double x, double y, double angle); /* 184 */
+ void (*tkDrawAngledChars) (Display *display, Drawable drawable, GC gc, Tk_Font tkfont, const char *source, Tcl_Size numBytes, double x, double y, double angle); /* 184 */
void (*tkpRedrawWidget) (Tk_Window tkwin); /* 185 */
int (*tkpWillDrawWidget) (Tk_Window tkwin); /* 186 */
int (*tkDebugPhotoStringMatchDef) (Tcl_Interp *inter, Tcl_Obj *data, Tcl_Obj *formatString, int *widthPtr, int *heightPtr); /* 187 */
diff --git a/macosx/tkMacOSXFont.c b/macosx/tkMacOSXFont.c
index f384d9c..238f808 100644
--- a/macosx/tkMacOSXFont.c
+++ b/macosx/tkMacOSXFont.c
@@ -1012,7 +1012,7 @@ TkpMeasureCharsInContext(
double width;
int length, fit;
- if (rangeStart < 0 || rangeLength <= 0 ||
+ if (rangeStart == TCL_INDEX_NONE || rangeStart < 0 || rangeLength <= 0 ||
rangeStart + rangeLength > numBytes ||
(maxLength == 0 && !(flags & TK_AT_LEAST_ONE))) {
*lengthPtr = 0;
@@ -1204,7 +1204,7 @@ TkDrawAngledChars(
* passed to this function. If they are not
* stripped out, they will be displayed as
* regular printing characters. */
- int numBytes, /* Number of bytes in string. */
+ Tcl_Size numBytes, /* Number of bytes in string. */
double x, double y, /* Coordinates at which to place origin of
* string when drawing. */
double angle) /* What angle to put text at, in degrees. */
@@ -1247,9 +1247,9 @@ TkpDrawCharsInContext(
* passed to this function. If they are not
* stripped out, they will be displayed as
* regular printing characters. */
- int numBytes, /* Number of bytes in string. */
- int rangeStart, /* Index of first byte to draw. */
- int rangeLength, /* Length of range to draw in bytes. */
+ Tcl_Size numBytes, /* Number of bytes in string. */
+ Tcl_Size rangeStart, /* Index of first byte to draw. */
+ Tcl_Size rangeLength, /* Length of range to draw in bytes. */
int x, int y) /* Coordinates at which to place origin of the
* whole (not just the range) string when
* drawing. */
diff --git a/unix/tkUnixFont.c b/unix/tkUnixFont.c
index da10e31..6a1be65 100644
--- a/unix/tkUnixFont.c
+++ b/unix/tkUnixFont.c
@@ -1007,7 +1007,7 @@ Tk_MeasureChars(
Tk_Font tkfont, /* Font in which characters will be drawn. */
const char *source, /* UTF-8 string to be displayed. Need not be
* '\0' terminated. */
- Tcl_Size numBytes, /* Maximum number of bytes to consider from
+ Tcl_Size numBytes1, /* Maximum number of bytes to consider from
* source string. */
int maxLength, /* If >= 0, maxLength specifies the longest
* permissible line length in pixels; don't
@@ -1025,6 +1025,7 @@ Tk_MeasureChars(
int *lengthPtr) /* Filled with x-location just after the
* terminating character. */
{
+ int numBytes = numBytes1;
UnixFont *fontPtr;
SubFont *lastSubFontPtr;
int curX, curByte, ch;
@@ -1415,9 +1416,9 @@ TkpDrawCharsInContext(
* is passed to this function. If they are not
* stripped out, they will be displayed as
* regular printing characters. */
- TCL_UNUSED(int), /* Number of bytes in string. */
- int rangeStart, /* Index of first byte to draw. */
- int rangeLength, /* Length of range to draw in bytes. */
+ TCL_UNUSED(Tcl_Size), /* Number of bytes in string. */
+ Tcl_Size rangeStart, /* Index of first byte to draw. */
+ Tcl_Size rangeLength, /* Length of range to draw in bytes. */
int x, int y) /* Coordinates at which to place origin of the
* whole (not just the range) string when
* drawing. */
@@ -1443,19 +1444,18 @@ TkpDrawAngledCharsInContext(
* passed to this function. If they are not
* stripped out, they will be displayed as
* regular printing characters. */
- Tcl_Size numBytes, /* Number of bytes in string. */
+ TCL_UNUSED(Tcl_Size), /* Number of bytes in string. */
Tcl_Size rangeStart, /* Index of first byte to draw. */
- Tcl_Size rangeLength, /* Length of range to draw in bytes. */
+ Tcl_Size rangeLength1, /* Length of range to draw in bytes. */
double x, double y, /* Coordinates at which to place origin of the
* whole (not just the range) string when
* drawing. */
double angle) /* What angle to put text at, in degrees. */
{
+ int rangeLength = rangeLength1;
int widthUntilStart;
double sinA = sin(angle * PI/180.0), cosA = cos(angle * PI/180.0);
- (void) numBytes; /*unused*/
-
Tk_MeasureChars(tkfont, source, rangeStart, -1, 0, &widthUntilStart);
TkDrawAngledChars(display, drawable, gc, tkfont, source + rangeStart,
rangeLength, x+cosA*widthUntilStart, y-sinA*widthUntilStart, angle);
@@ -3188,10 +3188,11 @@ TkDrawAngledChars(
* is passed to this function. If they are not
* stripped out, they will be displayed as
* regular printing characters. */
- int numBytes, /* Number of bytes in string. */
+ Tcl_Size numBytes1, /* Number of bytes in string. */
double x, double y,
double angle)
{
+ int numBytes = numBytes1;
if (angle == 0.0) {
Tk_DrawChars(display, drawable, gc, tkfont, source, numBytes, x, y);
} else {
diff --git a/unix/tkUnixRFont.c b/unix/tkUnixRFont.c
index 136506d..863fae9 100644
--- a/unix/tkUnixRFont.c
+++ b/unix/tkUnixRFont.c
@@ -706,7 +706,7 @@ Tk_MeasureChars(
Tk_Font tkfont, /* Font in which characters will be drawn. */
const char *source, /* UTF-8 string to be displayed. Need not be
* '\0' terminated. */
- Tcl_Size numBytes, /* Maximum number of bytes to consider from
+ Tcl_Size numBytes1, /* Maximum number of bytes to consider from
* source string. */
int maxLength, /* If >= 0, maxLength specifies the longest
* permissible line length in pixels; don't
@@ -724,6 +724,7 @@ Tk_MeasureChars(
int *lengthPtr) /* Filled with x-location just after the
* terminating character. */
{
+ int numBytes = numBytes1;
UnixFtFont *fontPtr = (UnixFtFont *) tkfont;
XftFont *ftFont;
FcChar32 c;
@@ -822,15 +823,13 @@ int
TkpMeasureCharsInContext(
Tk_Font tkfont,
const char *source,
- Tcl_Size numBytes,
+ TCL_UNUSED(Tcl_Size),
Tcl_Size rangeStart,
Tcl_Size rangeLength,
int maxLength,
int flags,
int *lengthPtr)
{
- (void) numBytes; /*unused*/
-
return Tk_MeasureChars(tkfont, source + rangeStart, rangeLength,
maxLength, flags, lengthPtr);
}
@@ -1070,11 +1069,12 @@ TkDrawAngledChars(
* is passed to this function. If they are not
* stripped out, they will be displayed as
* regular printing characters. */
- int numBytes, /* Number of bytes in string. */
+ Tcl_Size numBytes1, /* Number of bytes in string. */
double x, double y, /* Coordinates at which to place origin of
* string when drawing. */
double angle) /* What angle to put text at, in degrees. */
{
+ int numBytes = numBytes1;
const int maxCoord = 0x7FFF;/* Xft coordinates are 16 bit values */
const int minCoord = -maxCoord-1;
UnixFtFont *fontPtr = (UnixFtFont *) tkfont;
@@ -1376,17 +1376,15 @@ TkpDrawCharsInContext(
* is passed to this function. If they are not
* stripped out, they will be displayed as
* regular printing characters. */
- int numBytes, /* Number of bytes in string. */
- int rangeStart, /* Index of first byte to draw. */
- int rangeLength, /* Length of range to draw in bytes. */
+ TCL_UNUSED(Tcl_Size), /* Number of bytes in string. */
+ Tcl_Size rangeStart, /* Index of first byte to draw. */
+ Tcl_Size rangeLength, /* Length of range to draw in bytes. */
int x, int y) /* Coordinates at which to place origin of the
* whole (not just the range) string when
* drawing. */
{
int widthUntilStart;
- (void) numBytes; /*unused*/
-
Tk_MeasureChars(tkfont, source, rangeStart, -1, 0, &widthUntilStart);
Tk_DrawChars(display, drawable, gc, tkfont, source + rangeStart,
rangeLength, x+widthUntilStart, y);
@@ -1406,7 +1404,7 @@ TkpDrawAngledCharsInContext(
* passed to this function. If they are not
* stripped out, they will be displayed as
* regular printing characters. */
- Tcl_Size numBytes, /* Number of bytes in string. */
+ TCL_UNUSED(Tcl_Size), /* Number of bytes in string. */
Tcl_Size rangeStart, /* Index of first byte to draw. */
Tcl_Size rangeLength, /* Length of range to draw in bytes. */
double x, double y, /* Coordinates at which to place origin of the
@@ -1417,8 +1415,6 @@ TkpDrawAngledCharsInContext(
int widthUntilStart;
double sinA = sin(angle * PI/180.0), cosA = cos(angle * PI/180.0);
- (void) numBytes; /*unused*/
-
Tk_MeasureChars(tkfont, source, rangeStart, -1, 0, &widthUntilStart);
TkDrawAngledChars(display, drawable, gc, tkfont, source + rangeStart,
rangeLength, x+cosA*widthUntilStart, y-sinA*widthUntilStart, angle);
diff --git a/win/tkWinFont.c b/win/tkWinFont.c
index d7de783..1862989 100644
--- a/win/tkWinFont.c
+++ b/win/tkWinFont.c
@@ -790,9 +790,9 @@ Tk_MeasureChars(
Tk_Font tkfont, /* Font in which characters will be drawn. */
const char *source, /* UTF-8 string to be displayed. Need not be
* '\0' terminated. */
- Tcl_Size numBytes, /* Maximum number of bytes to consider from
+ Tcl_Size numBytes1, /* Maximum number of bytes to consider from
* source string. */
- int maxLength, /* If >= 0, maxLength specifies the longest
+ int maxLength, /* If >= 0, maxLength specifies the longest
* permissible line length in pixels; don't
* consider any character that would cross
* this x-position. If < 0, then line length
@@ -810,6 +810,7 @@ Tk_MeasureChars(
int *lengthPtr) /* Filled with x-location just after the
* terminating character. */
{
+ int numBytes = numBytes1;
HDC hdc;
HFONT oldFont;
WinFont *fontPtr;
@@ -1219,11 +1220,12 @@ TkDrawAngledChars(
* is passed to this function. If they are not
* stripped out, they will be displayed as
* regular printing characters. */
- int numBytes, /* Number of bytes in string. */
+ Tcl_Size numBytes1, /* Number of bytes in string. */
double x, double y, /* Coordinates at which to place origin of
* string when drawing. */
double angle)
{
+ int numBytes = numBytes1;
HDC dc;
WinFont *fontPtr;
TkWinDCState state;
@@ -1388,9 +1390,9 @@ TkpDrawCharsInContext(
* is passed to this function. If they are not
* stripped out, they will be displayed as
* regular printing characters. */
- TCL_UNUSED(int), /* Number of bytes in string. */
- int rangeStart, /* Index of first byte to draw. */
- int rangeLength, /* Length of range to draw in bytes. */
+ TCL_UNUSED(Tcl_Size), /* Number of bytes in string. */
+ Tcl_Size rangeStart, /* Index of first byte to draw. */
+ Tcl_Size rangeLength, /* Length of range to draw in bytes. */
int x, int y) /* Coordinates at which to place origin of the
* whole (not just the range) string when
* drawing. */
@@ -1416,7 +1418,7 @@ TkpDrawAngledCharsInContext(
* passed to this function. If they are not
* stripped out, they will be displayed as
* regular printing characters. */
- Tcl_Size numBytes, /* Number of bytes in string. */
+ TCL_UNUSED(Tcl_Size), /* Number of bytes in string. */
Tcl_Size rangeStart, /* Index of first byte to draw. */
Tcl_Size rangeLength, /* Length of range to draw in bytes. */
double x, double y, /* Coordinates at which to place origin of the
@@ -1426,7 +1428,6 @@ TkpDrawAngledCharsInContext(
{
int widthUntilStart;
double sinA = sin(angle * PI/180.0), cosA = cos(angle * PI/180.0);
- (void) numBytes; /*unused*/
Tk_MeasureChars(tkfont, source, rangeStart, -1, 0, &widthUntilStart);
TkDrawAngledChars(display, drawable, gc, tkfont, source + rangeStart,