From 427979f64cf14981d63a43c746b7a6e2ea56b60f Mon Sep 17 00:00:00 2001 From: nisikimi Date: Fri, 30 Apr 2004 02:21:31 +0000 Subject: [PATCH] *** empty log message *** --- src/draw.c | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ src/m17n-gui.h | 18 +++++++++--------- 2 files changed, 62 insertions(+), 9 deletions(-) diff --git a/src/draw.c b/src/draw.c index e0921f8..87b3f59 100644 --- a/src/draw.c +++ b/src/draw.c @@ -2648,6 +2648,39 @@ mdraw_text_items (MFrame *frame, MDrawWindow win, int x, int y, } /*=*/ +/***en + @brief calculate a line breaking position. + + The function mdraw_default_line_break () calculates a line + breaking position based on the line number $LINE and the + coordinate $Y, when a line is too long to fit within the width + limit. $POS is the position of the character next to the last + one that fits within the limit. $FROM is the position of the + first character of the line, and TO is the position of the last + character displayed on the line if there were not width limit. + LINE and Y are reset to 0 when a line is broken by a newline + character, and incremented each time when a long line is broken + because of the width limit. + + @return + This function returns a character position to break the + line. + +*/ +/***ja + @brief ²þ¹Ô°ÌÃÖ¤ò·×»»¤¹¤ë. + + ´Ø¿ô mdraw_default_line_break () ¤Ï¡¢¹Ô¤¬ºÇÂçÉýÃæ¤Ë¼ý¤Þ¤é¤Ê¤¤¾ì + ¹ç¤Ë¹Ô¤ò²þ¤á¤ë°ÌÃÖ¤ò¡¢¹ÔÈÖ¹æ LINE ¤ÈºÂɸ Y ¤Ë´ð¤Å¤¤¤Æ·×»»¤¹¤ë¡£ + $POS ¤ÏºÇÂçÉý¤Ë¼ý¤Þ¤ëºÇ¸å¤Îʸ»ú¤Î¼¡¤Îʸ»ú¤Î°ÌÃ֤Ǥ¢¤ë¡£$FROM ¤Ï + ¹Ô¤ÎºÇ½é¤Îʸ»ú¤Î°ÌÃÖ¡¢$TO ¤ÏºÇÂçÉý¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¤½¤Î¹Ô¤Ë + ɽ¼¨¤µ¤ì¤ëºÇ¸å¤Îʸ»ú¤Î°ÌÃ֤Ǥ¢¤ë¡£ LINE ¤È Y ¤Ï²þ¹Ôʸ»ú¤Ë¤è¤Ã¤Æ + ¹Ô¤¬²þ¤Þ¤Ã¤¿ºÝ¤Ë¤Ï 0 ¤Ë¥ê¥»¥Ã¥È¤µ¤ì¡¢ºÇÂçÉý¤Ë¤è¤Ã¤Æ¹Ô¤¬²þ¤Þ¤Ã¤¿ + ¾ì¹ç¤Ë¤Ï 1 ¤Å¤ÄÁý¤ä¤µ¤ì¤ë¡£ + + @return + ¤³¤Î´Ø¿ô¤Ï¹Ô¤ò²þ¤á¤ëʸ»ú°ÌÃÖ¤òÊÖ¤¹¡£ +*/ int mdraw_default_line_break (MText *mt, int pos, @@ -2723,6 +2756,26 @@ mdraw_per_char_extents (MFrame *frame, MText *mt, { } +/***en + @brief clear cached information. + + The mdraw_clear_cache () function clear cached information + on M-text $MT that was attached by any of the drawing functions. + When the behaviour of `format' or `line_break' + member functions of MDrawControl is changed, the cache must be cleared. + + @seealso + MDrawControl */ +/***ja + @brief ¥­¥ã¥Ã¥·¥å¾ðÊó¤ò¾Ã¤¹. + + ´Ø¿ô mdraw_clear_cache () ¤ÏÉÁ²è´Ø¿ô¤Ë¤è¤Ã¤Æ M-text $MT ¤ËÉղà + ¤µ¤ì¤¿¥­¥ã¥Ã¥·¥å¾ðÊó¤ò¤¹¤Ù¤Æ¾Ãµî¤¹¤ë¡£MDrawControl ¤Î `format' ¤¢ + ¤ë¤¤¤Ï `line_break' ¥á¥ó¥Ð´Ø¿ô¤Î¿¶Éñ¤¤¤¬ÊѤï¤Ã¤¿¾ì¹ç¤Ë¤Ï¥­¥ã¥Ã¥·¥å + ¤ò¾Ãµî¤·¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£ + @seealso + MDrawControl */ + void mdraw_clear_cache (MText *mt) { diff --git a/src/m17n-gui.h b/src/m17n-gui.h index c2b43ca..9b117f2 100644 --- a/src/m17n-gui.h +++ b/src/m17n-gui.h @@ -68,10 +68,10 @@ extern void m17n_fini_win (void); #MFrame ¤Ï¡¢@e ¥Õ¥ì¡¼¥à ¥ª¥Ö¥¸¥§¥¯¥ÈÍѤη¿¤Ç¤¢¤ë¡£¸Ä¡¹¤Î¥Õ¥ì¡¼¥à¤Ï¡¢ ¤½¤ì¤¬Âбþ¤¹¤ëʪÍýŪ¤Êɽ¼¨¡¿ÆþÎϥǥХ¤¥¹¤Î³Æ¼ï¾ðÊó¤òÊÝ»ý¤¹¤ë¡£ - #MFrame ·¿¤ÎÆâÉô¹½Â¤¤Ï¡¢»ÈÍѤ¹¤ë¥¦¥£¥ó¥É¥¦¥·¥¹¥Æ¥à¤Ë°Í¸¤·¡¢¤Þ¤¿¥¢ - ¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤«¤é¤Ï¸«¤¨¤Ê¤¤¡£m17n-X ¥é¥¤¥Ö¥é¥ê¤Ë¤ª¤±¤ë - ¥Õ¥ì¡¼¥à¤Ï¡¢X ¥¦¥£¥ó¥É¥¦¤Î @e display ¤È @e screen ¤Ë´Ø¤¹¤ë¾ðÊó¤ò - »ý¤Ä¡£ + #MFrame ·¿¤ÎÆâÉô¹½Â¤¤Ï¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤«¤é¤Ï¸«¤¨¤Ê¤¤¡£ + ¤Þ¤¿¤½¤ÎÆâÍƤϻÈÍѤ¹¤ë¥¦¥£¥ó¥É¥¦¥·¥¹¥Æ¥à¤Ë°Í¸¤¹¤ë¡£¤Þ¤¿m17n-X ¥é + ¥¤¥Ö¥é¥ê¤Ë¤ª¤±¤ë¥Õ¥ì¡¼¥à¤Ï¡¢X ¥¦¥£¥ó¥É¥¦¤Î @e display ¤È @e screen + ¤Ë´Ø¤¹¤ë¾ðÊó¤ò»ý¤Ä¡£ */ typedef struct MFrame MFrame; @@ -114,7 +114,7 @@ extern void *mframe_get_prop (MFrame *frame, MSymbol key); @brief ¥Õ¥©¥ó¥È¤Î·¿Àë¸À. #MFont ·¿¤Ï¥Õ¥©¥ó¥È»ØÄêÍѤι½Â¤ÂΤǤ¢¤ê¡¢¥Õ¥©¥ó¥È¤Î¥×¥í¥Ñ¥Æ¥£¤Ç¤¢ - ¤ë fondry, family, weight, style, stretch, adstyle, registry, + ¤ë foundry, family, weight, style, stretch, adstyle, registry, size, resolution ¤Ë´Ø¤¹¤ë¾ðÊó¤ò´Þ¤à¡£ ¤³¤Î¹½Â¤ÂΤϥե©¥ó¥È¥»¥Ã¥ÈÆâ¤Î¥Õ¥©¥ó¥È¤ò»ØÄꤹ¤ëºÝ¤È¡¢»ÈÍѲÄǽ¤Ê¥· @@ -450,7 +450,7 @@ typedef void *MDrawRegion; The type #MDrawControl is the structure that controls how to draw an M-text. */ /***ja - @brief ¥Æ¥­¥¹¥Èɽ¼¨¤Î¥³¥ó¥È¥í¡¼¥ë¤Î·¿Àë¸À. + @brief ¥Æ¥­¥¹¥Èɽ¼¨À©¸æ¤Î·¿Àë¸À. #MDrawControl ·¿¤Ï¡¢M-text ¤ò¤É¤¦É½¼¨¤¹¤ë¤«¤òÀ©¸æ¤¹¤ë¹½Â¤ÂΤǤ¢¤ë¡£ */ @@ -580,9 +580,9 @@ typedef struct /***en If non-NULL, the value is a function that calculates a line breaking position when a line is too long to fit within the - width limit. POS is a position of the character next to the - last one that fits within the limit. FROM is a position of the - first character of the line, and TO is a position of the last + width limit. POS is the position of the character next to the + last one that fits within the limit. FROM is the position of the + first character of the line, and TO is the position of the last character displayed on the line if there were not width limit. LINE and Y are the same as the arguments to . -- 1.7.10.4