Develop and Download Open Source Software

Browse Subversion Repository

Diff of /trunk/teraterm/ttpset/ttset.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2496 by doda, Fri May 2 15:21:14 2008 UTC revision 2497 by doda, Fri May 2 20:01:40 2008 UTC
# Line 14  Line 14 
14  #include <string.h>  #include <string.h>
15  #include <direct.h>  #include <direct.h>
16  #include "ttlib.h"  #include "ttlib.h"
17    #include "tt_res.h"
18    
19  #define Section "Tera Term"  #define Section "Tera Term"
20    
# Line 61  void id2str(PCHAR far * List, WORD Id, W Line 62  void id2str(PCHAR far * List, WORD Id, W
62          strncpy_s(str, destlen, List[i], _TRUNCATE);          strncpy_s(str, destlen, List[i], _TRUNCATE);
63  }  }
64    
65    int IconName2IconId(const char *name) {
66            int id;
67    
68            if (_stricmp(name, "tterm") == 0) {
69                    id = IDI_TTERM;
70            }
71            else if (_stricmp(name, "vt") == 0) {
72                    id = IDI_VT;
73            }
74            else if (_stricmp(name, "tek") == 0) {
75                    id = IDI_TEK;
76            }
77            else if (_stricmp(name, "tterm_classic") == 0) {
78                    id = IDI_TTERM_CLASSIC;
79            }
80            else if (_stricmp(name, "vt_classic") == 0) {
81                    id = IDI_VT_CLASSIC;
82            }
83            else if (_stricmp(name, "cygterm") == 0) {
84                    id = IDI_CYGTERM;
85            }
86            else {
87                    id = IdIconDefault;
88            }
89            return id;
90    }
91    
92    void IconId2IconName(char *name, int len, int id) {
93            char *icon;
94            switch (id) {
95                    case IDI_TTERM:
96                            icon = "tterm";
97                            break;
98                    case IDI_VT:
99                            icon = "vt";
100                            break;
101                    case IDI_TEK:
102                            icon = "tek";
103                            break;
104                    case IDI_TTERM_CLASSIC:
105                            icon = "tterm_classic";
106                            break;
107                    case IDI_VT_CLASSIC:
108                            icon = "vt_classic";
109                            break;
110                    case IDI_CYGTERM:
111                            icon = "cygterm";
112                            break;
113                    default:
114                            icon = "Default";
115            }
116            strncpy_s(name, len, icon, _TRUNCATE);
117    }
118    
119  WORD GetOnOff(PCHAR Sect, PCHAR Key, PCHAR FName, BOOL Default)  WORD GetOnOff(PCHAR Sect, PCHAR Key, PCHAR FName, BOOL Default)
120  {  {
121          char Temp[4];          char Temp[4];
# Line 1093  void FAR PASCAL ReadIniFile(PCHAR FName, Line 1148  void FAR PASCAL ReadIniFile(PCHAR FName,
1148          ts->UTF8BoxDrawing =          ts->UTF8BoxDrawing =
1149                  GetOnOff(Section, "UTF8BoxDrawing", FName, TRUE);                  GetOnOff(Section, "UTF8BoxDrawing", FName, TRUE);
1150    
1151            // VT Window Icon
1152            GetPrivateProfileString(Section, "VTIcon", "Default",
1153                                    Temp, sizeof(Temp), FName);
1154            ts->VTIcon = IconName2IconId(Temp);
1155    
1156            // Tek Window Icon
1157            GetPrivateProfileString(Section, "TekIcon", "Default",
1158                                    Temp, sizeof(Temp), FName);
1159            ts->TekIcon = IconName2IconId(Temp);
1160    
1161  #ifdef USE_NORMAL_BGCOLOR  #ifdef USE_NORMAL_BGCOLOR
1162          // UseNormalBGColor          // UseNormalBGColor
1163          ts->UseNormalBGColor =          ts->UseNormalBGColor =
# Line 1871  void FAR PASCAL WriteIniFile(PCHAR FName Line 1936  void FAR PASCAL WriteIniFile(PCHAR FName
1936    
1937          // Convert UTF-8 BoxDrawing to DEC Special characters          // Convert UTF-8 BoxDrawing to DEC Special characters
1938          WriteOnOff(Section, "UTF8BoxDrawing", FName, ts->UTF8BoxDrawing);          WriteOnOff(Section, "UTF8BoxDrawing", FName, ts->UTF8BoxDrawing);
1939    
1940            // VT Window Icon
1941            IconId2IconName(Temp, sizeof(Temp), ts->VTIcon);
1942            WritePrivateProfileString(Section, "VTIcon", Temp, FName);
1943    
1944            // Tek Window Icon
1945            IconId2IconName(Temp, sizeof(Temp), ts->TekIcon);
1946            WritePrivateProfileString(Section, "TekIcon", Temp, FName);
1947  }  }
1948    
1949  #define VTEditor "VT editor keypad"  #define VTEditor "VT editor keypad"
# Line 2563  void FAR PASCAL ParseParam(PCHAR Param, Line 2636  void FAR PASCAL ParseParam(PCHAR Param,
2636                          ParamPort = IdTCPIP;                          ParamPort = IdTCPIP;
2637                          ParamTel = 1;                          ParamTel = 1;
2638                  }                  }
2639                  else if (_strnicmp(Temp, "/V=", 2) == 0) {      /* invisible */                  else if (_strnicmp(Temp, "/TEKICON=", 9) == 0) { /* Tek window icon */
2640                            ts->TekIcon = IconName2IconId(&Temp[9]);
2641                    }
2642                    else if (_strnicmp(Temp, "/VTICON=", 8) == 0) { /* VT window icon */
2643                            ts->VTIcon = IconName2IconId(&Temp[8]);
2644                    }
2645                    else if (_strnicmp(Temp, "/V", 2) == 0) {       /* invisible */
2646                          ts->HideWindow = 1;                          ts->HideWindow = 1;
2647                  }                  }
2648                  else if (_strnicmp(Temp, "/W=", 3) == 0) {      /* Window title */                  else if (_strnicmp(Temp, "/W=", 3) == 0) {      /* Window title */

Legend:
Removed from v.2496  
changed lines
  Added in v.2497

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26