[Ttssh2-commit] [3666] ・EnableBoldをFontFlagに改称し、フォント関連の設定を表すようにした。

svnno****@sourc***** svnno****@sourc*****
2009年 10月 28日 (水) 18:44:14 JST


Revision: 3666
          http://sourceforge.jp/projects/ttssh2/svn/view?view=rev&revision=3666
Author:   doda
Date:     2009-10-28 18:44:14 +0900 (Wed, 28 Oct 2009)

Log Message:
-----------
・EnableBoldをFontFlagに改称し、フォント関連の設定を表すようにした。
・URLUnderlineをColorFlagからFontFlagに移動。

Modified Paths:
--------------
    trunk/teraterm/common/tttypes.h
    trunk/teraterm/teraterm/teraprn.cpp
    trunk/teraterm/teraterm/vtdisp.c
    trunk/teraterm/ttpdlg/ttdlg.c
    trunk/teraterm/ttpset/ttset.c


-------------- next part --------------
Modified: trunk/teraterm/common/tttypes.h
===================================================================
--- trunk/teraterm/common/tttypes.h	2009-10-28 09:22:44 UTC (rev 3665)
+++ trunk/teraterm/common/tttypes.h	2009-10-28 09:44:14 UTC (rev 3666)
@@ -196,8 +196,19 @@
 
 #define CF_USETEXTCOLOR 256
 #define CF_REVERSEVIDEO 512
-#define CF_URLUNDERLINE 1024
 
+// Font flags (used in ts.FontFlag)
+#define FF_BOLD         1
+#define FF_FAINT        2   // Not used
+#define FF_ITALIC       4   // Not used
+#define FF_UNDERLINE    8   // Not used
+#define FF_BLINK        16  // Not used
+#define FF_RAPIDBLINK   32  // Not used
+#define FF_REVERSE      64  // Not used
+#define FF_INVISIBLE    128 // Not used
+#define FF_STRIKEOUT    256 // Not used
+#define FF_URLUNDERLINE 512
+
 // port flags (used in ts.PortFlag)
 #define PF_CONFIRMDISCONN 1
 #define PF_BEEPONCONNECT  2
@@ -270,7 +281,7 @@
 	char PrnDev[80];
 	WORD PassThruDelay;
 	WORD PrnConvFF;
-	WORD EnableBold;
+	WORD FontFlag;
 	WORD RussFont;
 	int ScrollThreshold;
 	WORD Debug;

Modified: trunk/teraterm/teraterm/teraprn.cpp
===================================================================
--- trunk/teraterm/teraterm/teraprn.cpp	2009-10-28 09:22:44 UTC (rev 3665)
+++ trunk/teraterm/teraterm/teraprn.cpp	2009-10-28 09:44:14 UTC (rev 3666)
@@ -281,7 +281,7 @@
 	Prnlf.lfUnderline = 1;
 	PrnFont[AttrUnder] = CreateFontIndirect(&Prnlf);
 
-	if (ts.EnableBold > 0) {
+	if (ts.FontFlag & FF_BOLD) {
 		/* Bold */
 		Prnlf.lfUnderline = 0;
 		Prnlf.lfWeight = FW_BOLD;

Modified: trunk/teraterm/teraterm/vtdisp.c
===================================================================
--- trunk/teraterm/teraterm/vtdisp.c	2009-10-28 09:22:44 UTC (rev 3665)
+++ trunk/teraterm/teraterm/vtdisp.c	2009-10-28 09:44:14 UTC (rev 3666)
@@ -1889,8 +1889,7 @@
   VTlf.lfUnderline = 1;
   VTFont[AttrUnder] = CreateFontIndirect(&VTlf);
 
-  if (ts.EnableBold>0)
-  {
+  if (ts.FontFlag & FF_BOLD) {
     /* Bold */
     VTlf.lfUnderline = 0;
     VTlf.lfWeight = FW_BOLD;
@@ -2425,7 +2424,7 @@
 }
 
 #define isURLColored(x) ((ts.ColorFlag & CF_URLCOLOR) && ((x).Attr & AttrURL))
-#define isURLUnderlined(x) ((ts.ColorFlag & CF_URLUNDERLINE) && (ts.ColorFlag & CF_URLCOLOR) && ((x).Attr & AttrURL))
+#define isURLUnderlined(x) ((ts.FontFlag & FF_URLUNDERLINE) && (ts.ColorFlag & CF_URLCOLOR) && ((x).Attr & AttrURL))
 #define isBoldColored(x) ((ts.ColorFlag & CF_BOLDCOLOR) && ((x).Attr & AttrBold))
 #define isBlinkColored(x) ((ts.ColorFlag & CF_BLINKCOLOR) && ((x).Attr & AttrBlink))
 #define isReverseColored(x) ((ts.ColorFlag & CF_REVERSECOLOR) && ((x).Attr & AttrReverse))

Modified: trunk/teraterm/ttpdlg/ttdlg.c
===================================================================
--- trunk/teraterm/ttpdlg/ttdlg.c	2009-10-28 09:22:44 UTC (rev 3665)
+++ trunk/teraterm/ttpdlg/ttdlg.c	2009-10-28 09:44:14 UTC (rev 3666)
@@ -799,7 +799,7 @@
 				SetRB(Dialog,ts->UseNormalBGColor,IDC_WINUSENORMALBG,IDC_WINUSENORMALBG);
 #endif
 				ShowDlgItem(Dialog, IDC_FONTBOLD, IDC_FONTBOLD);
-				SetRB(Dialog, ts->EnableBold, IDC_FONTBOLD,IDC_FONTBOLD);
+				SetRB(Dialog, (ts->FontFlag & FF_BOLD) > 0, IDC_FONTBOLD,IDC_FONTBOLD);
 			}
 			else {
 				for (i = 0 ; i <=1 ; i++) {
@@ -984,7 +984,13 @@
 								}
 							}
 #endif
-							GetRB(Dialog,&ts->EnableBold,IDC_FONTBOLD,IDC_FONTBOLD);
+							GetRB(Dialog, &i, IDC_FONTBOLD, IDC_FONTBOLD);
+							if (i > 0) {
+								ts->FontFlag |= FF_BOLD;
+							}
+							else {
+								ts->FontFlag &= ~(WORD)FF_BOLD;
+							}
 						}
 						else {
 							for (i = 0 ; i <= 1 ; i++) {

Modified: trunk/teraterm/ttpset/ttset.c
===================================================================
--- trunk/teraterm/ttpset/ttset.c	2009-10-28 09:22:44 UTC (rev 3665)
+++ trunk/teraterm/ttpset/ttset.c	2009-10-28 09:44:14 UTC (rev 3666)
@@ -205,6 +205,7 @@
 	ts->MenuFlag = 0;			// Menu flags
 	ts->TermFlag = 0;			// Terminal flag
 	ts->ColorFlag = 0;			// ANSI/Attribute color flags
+	ts->FontFlag = 0;			// Font flag
 	ts->PortFlag = 0;			// Port flags
 	ts->WindowFlag = 0;			// Window flags
 	ts->TelPort = 23;
@@ -509,7 +510,7 @@
 		ts->ColorFlag |= CF_URLCOLOR;
 
 	if (GetOnOff(Section, "URLUnderline", FName, TRUE))
-		ts->ColorFlag |= CF_URLUNDERLINE;
+		ts->FontFlag |= FF_URLUNDERLINE;
 
 	/* TEK Color */
 	GetPrivateProfileString(Section, "TEKColor", "0,0,0,255,255,255",
@@ -597,7 +598,8 @@
 	GetNthNum(Temp, 4, &(ts->VTFontCharSet));
 
 	/* Bold font flag */
-	ts->EnableBold = GetOnOff(Section, "EnableBold", FName, TRUE);
+	if (GetOnOff(Section, "EnableBold", FName, TRUE))
+		ts->FontFlag |= FF_BOLD;
 
 	/* Russian character set (font) */
 	GetPrivateProfileString(Section, "RussFont", "",
@@ -1729,7 +1731,7 @@
 	           (WORD) (ts->ColorFlag & CF_URLCOLOR));
 
 	WriteOnOff(Section, "URLUnderline", FName,
-	           (WORD) (ts->ColorFlag & CF_URLUNDERLINE));
+	           (WORD) (ts->FontFlag & FF_URLUNDERLINE));
 
 	WriteOnOff(Section, "EnableANSIColor", FName,
 	           (WORD) (ts->ColorFlag & CF_ANSICOLOR));
@@ -1753,7 +1755,8 @@
 	          ts->VTFontCharSet);
 
 	/* Enable bold font flag */
-	WriteOnOff(Section, "EnableBold", FName, ts->EnableBold);
+	WriteOnOff(Section, "EnableBold", FName,
+		(WORD) (ts->FontFlag & FF_BOLD));
 
 	/* Russian character set (font) */
 	id2str(RussList, ts->RussFont, IdWindows, Temp, sizeof(Temp));



Ttssh2-commit メーリングリストの案内