My favorites | Sign in
Project Home Downloads Issues Source
Checkout   Browse   Changes    
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
#ifndef AFX_ONFIGMANAGER_H__9243DE9D_0F70_40F8_8F90_55436B952B37__INCLUDED_
#define AFX_ONFIGMANAGER_H__9243DE9D_0F70_40F8_8F90_55436B952B37__INCLUDED_
#include "editwing/editwing.h"
#include "OpenSaveDlg.h"



// ƒAƒvƒŠƒP[ƒVƒ‡ƒ“ƒƒbƒZ[ƒW
#define GPM_MRUCHANGED WM_APP+0

//=========================================================================
//@{ @pkg Gp.Main //@}
//@{
// Ý’è‚̈ꌳŠÇ—
//
// SetDocType‚Ő؂è‘Ö‚¦‚邯A•¶‘ƒ^ƒCƒvˆË‘¶‚̍€–Ú‚ð“à•”‚Å
// “KØ‚ɐ؂è‘Ö‚¦‚½‚èFX‚µ‚Ü‚·B
//@}
//=========================================================================

class ConfigManager : public ki::Object
{
public:

ConfigManager();
~ConfigManager();

//@{ Žw’肵‚½–¼‘O‚̃tƒ@ƒCƒ‹—p‚Ì•¶‘ƒ^ƒCƒv‚ðƒ[ƒh //@}
int SetDocType( const ki::Path& fname );

//@{ Žw’肵‚½”ԍ†‚Ì•¶‘ƒ^ƒCƒv‚ðƒ[ƒh //@}
void SetDocTypeByMenu( int pos, HMENU m );

//@{ Žw’肵‚½–¼‘O‚Ì•¶‘ƒ^ƒCƒv‚ðƒ[ƒh //@}
void SetDocTypeByName( const ki::String& nam );

//@{ ƒƒjƒ…[€–ڍ쐬 //@}
void SetDocTypeMenu( HMENU m, UINT idstart );

//@{ ƒƒjƒ…[€–ڂ̃`ƒFƒbƒNC³ //@}
void CheckMenu( HMENU m, int pos );

//@{ Ý’èƒ_ƒCƒAƒƒO•\ަ //@}
bool DoDialog( const ki::Window& parent );

//@{ ¶‚Ìiniƒtƒ@ƒCƒ‹‘€ìƒIƒuƒWƒFƒNƒg‚ðŽæ“¾ //@}
ki::IniFile& getImpl();

public:

//@{ Undo‰ñ”§ŒÀ’l //@}
int undoLimit() const;

//@{ •¶Žš”‚̃JƒEƒ“ƒg•û–@ //@}
bool countByUnicode() const;

//@{ ŠJ‚­/•Û‘¶ƒ_ƒCƒAƒƒO‚ɏo‚·ƒtƒBƒ‹ƒ^‚̐ݒè //@}
const ki::String& txtFileFilter() const;

//@{ •¶Žš”Žw’莞‚̐܂è•Ô‚µ•¶Žš” //@}
int wrapWidth() const;

//@{ Ü‚è•Ô‚µ•û–@ //@}
int wrapType() const;

//@{ s”ԍ†•\ަ‚·‚éH //@}
bool showLN() const;

//@{ •\ަFEƒtƒHƒ“ƒg‚È‚Ç //@}
const editwing::VConfig& vConfig() const;

//@{ ƒL[ƒ[ƒhƒtƒ@ƒCƒ‹–¼(ƒtƒ‹ƒpƒX) //@}
ki::Path kwdFile() const;

//@{ Grep—pŠO•”ŽÀsƒtƒ@ƒCƒ‹–¼ //@}
const ki::Path& grepExe() const;

//@{ “¯‚¶ƒEƒCƒ“ƒhƒE‚ÅŠJ‚­ƒ‚[ƒh //@}
bool openSame() const;

//@{ ƒXƒe[ƒ^ƒXƒo[•\ަ //@}
bool showStatusBar() const;
void ShowStatusBarSwitch();

//@{ “ú•t //@}
const ki::String& dateFormat() const;

public:
//@{ V‹Kƒtƒ@ƒCƒ‹‚Ì•¶ŽšƒR[ƒhindex //@}
int GetNewfileCsi() const;

//@{ V‹Kƒtƒ@ƒCƒ‹‚̉üsƒR[ƒh //@}
ki::lbcode GetNewfileLB() const;

public:
//@{ [Å‹ßŽg‚Á‚½ƒtƒ@ƒCƒ‹]‚֒ljÁ //@}
void AddMRU( const ki::Path& fname );

//@{ [Å‹ßŽg‚Á‚½ƒtƒ@ƒCƒ‹]ƒƒjƒ…[‚̍\’z //@}
void SetUpMRUMenu( HMENU m, UINT id );

//@{ [Å‹ßŽg‚Á‚½ƒtƒ@ƒCƒ‹]Žæ“¾ //@}
ki::Path GetMRU( int no ) const;

//@{ ‘Ήž•¶ŽšƒZƒbƒgƒŠƒXƒgŽæ“¾ //@}
CharSetList& GetCharSetList();

public:
//@{ ƒEƒCƒ“ƒhƒEˆÊ’uEƒTƒCƒY•œŒ³ˆ— //@}
int GetWndX() const;
int GetWndY() const;
int GetWndW() const;
int GetWndH() const;
bool GetWndM() const;
void RememberWnd( ki::Window* wnd );

private:

ki::IniFile ini_;
bool sharedConfigMode_;
CharSetList charSets_;

// ‘S‘Ì“I‚Ȑݒè
int undoLimit_;
ki::String txtFilter_;
ki::Path grepExe_;
bool openSame_;
bool countbyunicode_;
bool showStatusBar_;
bool rememberWindowSize_;
bool rememberWindowPlace_;

ki::String dateFormat_;
// ki::String timeFormat_;
// bool datePrior_;

// ƒEƒCƒ“ƒhƒEƒTƒCƒY‹L‰¯
bool wndM_; // maximized?
int wndX_, wndY_, wndW_, wndH_;

// •¶‘ƒ^ƒCƒv‚ÌƒŠƒXƒg
struct DocType
{
// ’è‹`ƒtƒ@ƒCƒ‹–¼‚È‚Ç
ki::String name;
ki::String pattern;
ki::String kwdfile;
ki::String layfile;

// Ý’荀–Ú
editwing::VConfig vc;
int wrapType;
int wrapWidth;
bool showLN;
char fontCS;
};
typedef ki::olist<DocType> DtList;

DtList dtList_;
DtList::iterator curDt_;

// Å‹ßŽg‚Á‚½ƒtƒ@ƒCƒ‹‚ÌƒŠƒXƒg
int mrus_;
ki::Path mru_[20];

// V‹Kƒtƒ@ƒCƒ‹ŠÖŒW
int newfileCharset_;
ki::String newfileDoctype_;
ki::lbcode newfileLB_;

private:

void LoadIni();
void SaveIni();
void LoadLayout( DocType* dt );
bool MatchDocType( const unicode* fname, const unicode* pat );

private:

friend struct ConfigDlg;
NOCOPY(ConfigManager);
};



//-------------------------------------------------------------------------
#ifndef __ccdoc__

inline int ConfigManager::undoLimit() const
{ return undoLimit_; }

inline const ki::String& ConfigManager::txtFileFilter() const
{ return txtFilter_; }

inline int ConfigManager::wrapWidth() const
{ return curDt_->wrapWidth; }

inline int ConfigManager::wrapType() const
{ return curDt_->wrapType>0 ? wrapWidth() : curDt_->wrapType; }

inline bool ConfigManager::showLN() const
{ return curDt_->showLN; }

inline const editwing::VConfig& ConfigManager::vConfig() const
{ return curDt_->vc; }

inline ki::Path ConfigManager::kwdFile() const
{ return ki::Path(ki::Path::Exe)+TEXT("type\\")+curDt_->kwdfile; }

inline const ki::Path& ConfigManager::grepExe() const
{ return grepExe_; }

inline bool ConfigManager::openSame() const
{ return openSame_; }

inline bool ConfigManager::showStatusBar() const
{ return showStatusBar_; }

inline void ConfigManager::ShowStatusBarSwitch()
{ showStatusBar_ = !showStatusBar_; SaveIni(); }

inline bool ConfigManager::countByUnicode() const
{ return countbyunicode_; }

inline ki::IniFile& ConfigManager::getImpl()
{ return ini_; }

inline CharSetList& ConfigManager::GetCharSetList()
{ return charSets_; }

inline int ConfigManager::GetNewfileCsi() const
{ return charSets_.findCsi( newfileCharset_ ); }

inline ki::lbcode ConfigManager::GetNewfileLB() const
{ return newfileLB_; }

inline const ki::String& ConfigManager::dateFormat() const
{ return dateFormat_; }

inline int ConfigManager::GetWndX() const
{ return rememberWindowPlace_ ? wndX_ : CW_USEDEFAULT; }

inline int ConfigManager::GetWndY() const
{ return rememberWindowPlace_ ? wndY_ : CW_USEDEFAULT; }

inline int ConfigManager::GetWndW() const
{ return rememberWindowSize_ ? wndW_ : CW_USEDEFAULT; }

inline int ConfigManager::GetWndH() const
{ return rememberWindowSize_ ? wndH_ : CW_USEDEFAULT; }

inline bool ConfigManager::GetWndM() const
{ return rememberWindowSize_ & wndM_; }

//=========================================================================

#endif // __ccdoc__
#endif // AFX_ONFIGMANAGER_H__9243DE9D_0F70_40F8_8F90_55436B952B37__INCLUDED_

Change log

r109 by roytam on May 10, 2010   Diff
- [GreenPad] add "cs=" .lay font charset
entry support.

Charset Name       Charset Value
--------------------------------
DEFAULT_CHARSET           1
SYMBOL_CHARSET            2
OEM_CHARSET             255
ANSI_CHARSET              0
RUSSIAN_CHARSET         204
EE_CHARSET              238
GREEK_CHARSET           161
...
Go to: 
Project members, sign in to write a code review

Older revisions

r94 by roytam on May 5, 2010   Diff
- [GreenPad] import kinaba's bbs #9776
patch: gcc support, DateFormat
r89 by roytam on Apr 29, 2010   Diff
- [GreenPad] import GreenPad with NT
3.51 fix.
All revisions of this file

File info

Size: 6180 bytes, 258 lines

File properties

svn:mime-type
text/plain; charset=shift_jis
svn:eol-style
native
Powered by Google Project Hosting