Mercurial > projects > dwt-linux
comparison dwt/graphics/GC.d @ 242:448eacc3a526
Change behaviour of dwt.graphics.GC textExtend(): allow null for string argument
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sat, 17 May 2008 23:21:33 +0200 |
parents | ce446666f5a2 |
children | 5a30aa9820f3 |
comparison
equal
deleted
inserted
replaced
241:4653e99936cf | 242:448eacc3a526 |
---|---|
3938 * </p> | 3938 * </p> |
3939 * | 3939 * |
3940 * @param str the str to measure | 3940 * @param str the str to measure |
3941 * @return a point containing the extent of the str | 3941 * @return a point containing the extent of the str |
3942 * | 3942 * |
3943 * @exception IllegalArgumentException <ul> | |
3944 * <li>ERROR_NULL_ARGUMENT - if the str is null</li> | |
3945 * </ul> | |
3946 * @exception DWTException <ul> | 3943 * @exception DWTException <ul> |
3947 * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> | 3944 * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> |
3948 * </ul> | 3945 * </ul> |
3949 */ | 3946 */ |
3950 public Point stringExtent(String str) { | 3947 public Point stringExtent(String str) { |
3961 * </p> | 3958 * </p> |
3962 * | 3959 * |
3963 * @param str the str to measure | 3960 * @param str the str to measure |
3964 * @return a point containing the extent of the str | 3961 * @return a point containing the extent of the str |
3965 * | 3962 * |
3966 * @exception IllegalArgumentException <ul> | |
3967 * <li>ERROR_NULL_ARGUMENT - if the str is null</li> | |
3968 * </ul> | |
3969 * @exception DWTException <ul> | 3963 * @exception DWTException <ul> |
3970 * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> | 3964 * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> |
3971 * </ul> | 3965 * </ul> |
3972 */ | 3966 */ |
3973 public Point textExtent(String str) { | 3967 public Point textExtent(String str) { |
3996 * | 3990 * |
3997 * @param str the str to measure | 3991 * @param str the str to measure |
3998 * @param flags the flags specifying how to process the text | 3992 * @param flags the flags specifying how to process the text |
3999 * @return a point containing the extent of the str | 3993 * @return a point containing the extent of the str |
4000 * | 3994 * |
4001 * @exception IllegalArgumentException <ul> | |
4002 * <li>ERROR_NULL_ARGUMENT - if the str is null</li> | |
4003 * </ul> | |
4004 * @exception DWTException <ul> | 3995 * @exception DWTException <ul> |
4005 * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> | 3996 * <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li> |
4006 * </ul> | 3997 * </ul> |
4007 */ | 3998 */ |
4008 public Point textExtent(String str, int flags) { | 3999 public Point textExtent(String str, int flags) { |
4009 if (handle is null) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED); | 4000 if (handle is null) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED); |
4010 if (str is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); | 4001 //DWT_CHANGE: allow null for string |
4002 //if (str is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); | |
4011 auto cairo = data.cairo; | 4003 auto cairo = data.cairo; |
4012 if (cairo !is null) { | 4004 if (cairo !is null) { |
4013 if (OS.GTK_VERSION < OS.buildVERSION(2, 8, 0)) { | 4005 if (OS.GTK_VERSION < OS.buildVERSION(2, 8, 0)) { |
4014 //TODO - honor flags | 4006 //TODO - honor flags |
4015 checkGC(FONT); | 4007 checkGC(FONT); |