Changeset 238:380bad9f6852 for dwt/graphics/GC.d
- Timestamp:
- 05/04/08 18:42:55 (4 years ago)
- Files:
-
- dwt/graphics/GC.d (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
dwt/graphics/GC.d
r202 r238 185 185 } 186 186 187 static void addCairoString(cairo_t* cairo, char[]str, float x, float y, Font font) {187 static void addCairoString(cairo_t* cairo, String str, float x, float y, Font font) { 188 188 char* buffer = toStringz( str ); 189 189 if (OS.GTK_VERSION >= OS.buildVERSION(2, 8, 0)) { … … 377 377 if (dashes !is null) { 378 378 if ((state & LINE_STYLE) !is 0) { 379 char[]dash_list = new char[dashes.length];379 String dash_list = new char[dashes.length]; 380 380 for (int i = 0; i < dash_list.length; i++) { 381 381 dash_list[i] = cast(char)(width is 0 || data.lineStyle is DWT.LINE_CUSTOM ? dashes[i] : dashes[i] * width); … … 1017 1017 int newHeight = srcY + srcHeight; 1018 1018 int bytesPerLine = (newWidth + 7) / 8; 1019 char[]maskData = new char[bytesPerLine * newHeight];1019 String maskData = new char[bytesPerLine * newHeight]; 1020 1020 auto mask = cast(GdkDrawable *) OS.gdk_bitmap_create_from_data(null, maskData.ptr, newWidth, newHeight); 1021 1021 if (mask !is null) { … … 1516 1516 * </ul> 1517 1517 */ 1518 public void drawString ( char[]str, int x, int y) {1518 public void drawString (String str, int x, int y) { 1519 1519 drawString(str, x, y, false); 1520 1520 } … … 1539 1539 * </ul> 1540 1540 */ 1541 public void drawString( char[]str, int x, int y, bool isTransparent) {1541 public void drawString(String str, int x, int y, bool isTransparent) { 1542 1542 drawText(str, x, y, isTransparent ? DWT.DRAW_TRANSPARENT : 0); 1543 1543 } … … 1561 1561 * </ul> 1562 1562 */ 1563 public void drawText( char[]str, int x, int y) {1563 public void drawText(String str, int x, int y) { 1564 1564 drawText(str, x, y, DWT.DRAW_DELIMITER | DWT.DRAW_TAB); 1565 1565 } … … 1585 1585 * </ul> 1586 1586 */ 1587 public void drawText( char[]str, int x, int y, bool isTransparent) {1587 public void drawText(String str, int x, int y, bool isTransparent) { 1588 1588 int flags = DWT.DRAW_DELIMITER | DWT.DRAW_TAB; 1589 1589 if (isTransparent) flags |= DWT.DRAW_TRANSPARENT; … … 1625 1625 * </ul> 1626 1626 */ 1627 public void drawText ( char[]str, int x, int y, int flags) {1627 public void drawText (String str, int x, int y, int flags) { 1628 1628 if (handle is null) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED); 1629 1629 if (str is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); … … 3056 3056 auto family = OS.pango_font_description_get_family(font); 3057 3057 int len = /*OS.*/strlen(family); 3058 char[]buffer = new char[len + 1];3058 String buffer = new char[len + 1]; 3059 3059 memmove(buffer.ptr, family, len); 3060 3060 //TODO - convert font height from pango to cairo … … 3689 3689 } 3690 3690 3691 void setString( char[]str, int flags) {3691 void setString(String str, int flags) { 3692 3692 if (data.layout is null) createLayout(); 3693 3693 if (str is data.str && (flags & ~DWT.DRAW_TRANSPARENT) is (data.drawFlags & ~DWT.DRAW_TRANSPARENT)) { 3694 3694 return; 3695 3695 } 3696 char[]buffer;3696 String buffer; 3697 3697 int mnemonic, len = str.length ; 3698 3698 auto layout = data.layout; … … 3865 3865 * </ul> 3866 3866 */ 3867 public Point stringExtent( char[]str) {3867 public Point stringExtent(String str) { 3868 3868 return textExtent(str, 0); 3869 3869 } … … 3888 3888 * </ul> 3889 3889 */ 3890 public Point textExtent( char[]str) {3890 public Point textExtent(String str) { 3891 3891 return textExtent(str, DWT.DRAW_DELIMITER | DWT.DRAW_TAB); 3892 3892 } … … 3923 3923 * </ul> 3924 3924 */ 3925 public Point textExtent( char[]str, int flags) {3925 public Point textExtent(String str, int flags) { 3926 3926 if (handle is null) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED); 3927 3927 if (str is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); … … 3953 3953 * @return a str representation of the receiver 3954 3954 */ 3955 public override char[]toString () {3955 public override String toString () { 3956 3956 if (isDisposed()) return "GC {*DISPOSED*}"; 3957 3957 return Format( "GC {{{}}", handle );
