|
diff --git a/KLogDlg.h b/KLogDlg.h index f6fed53..043fd30 100644 --- a/ KLogDlg.h+++ b/ KLogDlg.h |
|
@@ -1,198 +1,201 @@ |
1 | // KLogDlg.h : header file
|
1 | // KLogDlg.h : header file
|
2 | //
|
2 | //
|
3 |
|
3 |
|
4 | /////////////////////////////////////////////////////////////////////////////
|
4 | /////////////////////////////////////////////////////////////////////////////
|
5 | // CKLogDlg dialog
|
5 | // CKLogDlg dialog
|
6 |
|
6 |
|
7 | class CKLogDlg;
|
7 | class CKLogDlg;
|
8 | class CKLogSocket : public CSyslogSocket {
|
8 | class CKLogSocket : public CSyslogSocket {
|
9 | public:
|
9 | public:
|
10 | CKLogDlg* m_Daddy; |
10 | CKLogDlg* m_Daddy; |
11 | virtual void Log(UINT pri,UINT fac,LPCTSTR line,SOCKADDR_IN *sin);
|
11 | virtual void Log(UINT pri,UINT fac,LPCTSTR line,SOCKADDR_IN *sin);
|
12 | };
|
12 | };
|
13 |
|
13 |
|
14 | class CHostMask: public CObject{
|
14 | class CHostMask: public CObject{
|
15 | public:
|
15 | public:
|
16 | virtual void Serialize(CArchive& ar); |
16 | virtual void Serialize(CArchive& ar); |
17 | DWORDm_Host;
|
17 | DWORDm_Host;
|
18 | DWORDm_Mask;
|
18 | DWORDm_Mask;
|
19 | BOOL IsThis(DWORD host){ return (host&m_Mask)==(m_Host&m_Mask); }
|
19 | BOOL IsThis(DWORD host){ return (host&m_Mask)==(m_Host&m_Mask); }
|
20 | CHostMask(): m_Host(0), m_Mask(0) {}
|
20 | CHostMask(): m_Host(0), m_Mask(0) {}
|
21 | CHostMask(DWORD host,DWORD mask) : m_Host(host), m_Mask(mask) {}
|
21 | CHostMask(DWORD host,DWORD mask) : m_Host(host), m_Mask(mask) {}
|
22 | CString String(); |
22 | CString String(); |
23 |
|
23 |
|
24 | DECLARE_SERIAL( CHostMask )
|
24 | DECLARE_SERIAL( CHostMask )
|
25 | };
|
25 | };
|
26 | class CLogEntry: public CObject {
|
26 | class CLogEntry: public CObject {
|
27 | public:
|
27 | public:
|
28 | CLogEntry(CLogEntry& src); |
28 | CLogEntry(CLogEntry& src); |
29 | CLogEntry& operator=(CLogEntry& src); |
29 | CLogEntry& operator=(CLogEntry& src); |
30 | CTime m_Time;
|
30 | CTime m_Time;
|
31 | CString m_Source;
|
31 | CString m_Source;
|
32 | CString m_Data;
|
32 | CString m_Data;
|
33 | UINT m_Priority;
|
33 | UINT m_Priority;
|
34 | UINT m_Facility;
|
34 | UINT m_Facility;
|
35 | DECLARE_SERIAL( CLogEntry )
|
35 | DECLARE_SERIAL( CLogEntry )
|
36 | public:
|
36 | public:
|
37 | CLogEntry(); |
37 | CLogEntry(); |
38 | };
|
38 | };
|
39 |
|
39 |
|
40 | typedefCTypedPtrList<CObList,CHostMask*> CAccessList;
|
40 | typedefCTypedPtrList<CObList,CHostMask*> CAccessList;
|
41 | typedef CList<CLogEntry*,CLogEntry*> CLog;
|
41 | typedef CList<CLogEntry*,CLogEntry*> CLog;
|
42 |
|
42 |
|
43 | class CLogger : public CObject{
|
43 | class CLogger : public CObject{
|
44 | public:
|
44 | public:
|
45 | void LookupHost(CKLogDlg *daddy); |
45 | void LookupHost(CKLogDlg *daddy); |
46 | void LogLine(CKLogDlg *dad,UINT pri,UINT fac,LPCTSTR line,SOCKADDR_IN *sin); |
46 | void LogLine(CKLogDlg *dad,UINT pri,UINT fac,LPCTSTR line,SOCKADDR_IN *sin); |
47 | BOOL IsHostFine(DWORD saddr); |
47 | BOOL IsHostFine(DWORD saddr); |
48 | virtual void Serialize(CArchive& ar); |
48 | virtual void Serialize(CArchive& ar); |
49 | virtual ~CLogger(); |
49 | virtual ~CLogger(); |
50 | void PlayWave(); |
50 | void PlayWave(); |
51 | CLogger(BOOL bAll=FALSE); |
51 | CLogger(BOOL bAll=FALSE); |
52 | CStringm_Desc;
|
52 | CStringm_Desc;
|
53 | enum{
|
53 | enum{
|
54 | logToFile=0, logToHost=1, logToNone=2,
|
54 | logToFile=0, logToHost=1, logToNone=2,
|
55 | };
|
55 | };
|
56 | int m_LogTo;
|
56 | int m_LogTo;
|
57 | CStringm_LogToName;
|
57 | CStringm_LogToName;
|
58 | SOCKADDR_IN m_LogToHost;
|
58 | SOCKADDR_IN m_LogToHost;
|
59 | BOOL m_LogPattern[CSyslogSocket::totalFacilities][CSyslogSocket::totalPriorities];
|
59 | BOOL m_LogPattern[CSyslogSocket::totalFacilities][CSyslogSocket::totalPriorities];
|
60 | CAccessList m_Hosts;
|
60 | CAccessList m_Hosts;
|
61 | CStringm_Sound;
|
61 | CStringm_Sound;
|
62 | CLog m_Log;
|
62 | CLog m_Log;
|
63 | DECLARE_SERIAL( CLogger )
|
63 | DECLARE_SERIAL( CLogger )
|
64 | };
|
64 | };
|
65 |
|
65 |
|
66 | typedef CMap<CLogger*,CLogger*,CLogger*,CLogger*> CLoggers;
|
66 | typedef CMap<CLogger*,CLogger*,CLogger*,CLogger*> CLoggers;
|
67 |
|
67 |
|
68 | class CTrayer;
|
68 | class CTrayer;
|
69 | class CKLogDlg : public CDialog
|
69 | class CKLogDlg : public CDialog
|
70 | {
|
70 | {
|
71 | // Construction
|
71 | // Construction
|
72 | public:
|
72 | public:
|
73 | BOOL m_bDontWarn; |
73 | BOOL m_bDontWarn; |
74 | BOOL m_bWarnBlocking; |
74 | BOOL m_bWarnBlocking; |
75 | CSyslogSocket m_SLS; |
75 | CSyslogSocket m_SLS; |
76 | virtual ~CKLogDlg(); |
76 | virtual ~CKLogDlg(); |
77 | void SaveSettings(); |
77 | void SaveSettings(); |
78 | void LoadSettings(); |
78 | void LoadSettings(); |
79 | BOOL m_bExiting; |
79 | BOOL m_bExiting; |
80 | BOOL m_bShown; |
80 | BOOL m_bShown; |
81 | CTrayer* m_Trayer; |
81 | CTrayer* m_Trayer; |
82 | virtual BOOL PreTranslateMessage(MSG* pMsg); |
82 | virtual BOOL PreTranslateMessage(MSG* pMsg); |
83 | void AddLogLine(CLogEntry *le); |
83 | void AddLogLine(CLogEntry *le); |
84 | void LogMessage(UINT pri,UINT fac,LPCTSTR line,SOCKADDR_IN *sin); |
84 | void LogMessage(UINT pri,UINT fac,LPCTSTR line,SOCKADDR_IN *sin); |
85 | CKLogSocket m_KLS; |
85 | CKLogSocket m_KLS; |
86 | virtual void Serialize(CArchive& ar); |
86 | virtual void Serialize(CArchive& ar); |
87 | void TotalCleanUp(); |
87 | void TotalCleanUp(); |
88 | BITMAP m_bitmapBack;
|
88 | BITMAP m_bitmapBack;
|
89 | CBitmap m_bmpBack;
|
89 | CBitmap m_bmpBack;
|
90 | void UpdateLogLength(BOOL bSave=TRUE,BOOL update=FALSE); |
90 | void UpdateLogLength(BOOL bSave=TRUE,BOOL update=FALSE); |
91 | int m_LogItems; |
91 | int m_LogItems; |
92 | void UpdateLogto(BOOL bSave=TRUE,BOOL update=TRUE); |
92 | void UpdateLogto(BOOL bSave=TRUE,BOOL update=TRUE); |
93 | void UpdatePriface(BOOL bSave=TRUE,BOOL update=TRUE); |
93 | void UpdatePriface(BOOL bSave=TRUE,BOOL update=TRUE); |
94 | static UINT m_PriorityCtls[CSyslogSocket::totalPriorities]; |
94 | static UINT m_PriorityCtls[CSyslogSocket::totalPriorities]; |
95 | CLogger* m_Logger; |
95 | CLogger* m_Logger; |
96 | void SetTab(CLogger* l); |
96 | void SetTab(CLogger* l); |
97 | int m_iTriggered; |
97 | int m_iTriggered; |
98 | int m_iNormal; |
98 | int m_iNormal; |
99 | CImageList m_Images; |
99 | CImageList m_Images; |
100 | CLoggers m_Logs; |
100 | CLoggers m_Logs; |
101 | CKLogDlg(CWnd* pParent = NULL);// standard constructor
|
101 | CKLogDlg(CWnd* pParent = NULL);// standard constructor
|
102 |
|
102 |
|
103 | DECLARE_SERIAL( CKLogDlg )
|
103 | DECLARE_SERIAL( CKLogDlg )
|
104 |
|
104 |
|
105 | // Dialog Data
|
105 | // Dialog Data
|
106 | //{{AFX_DATA(CKLogDlg)
|
106 | //{{AFX_DATA(CKLogDlg)
|
107 | enum { IDD = IDD_KLOG_DIALOG };
|
107 | enum { IDD = IDD_KLOG_DIALOG };
|
| |
108 | CButtonm_CancelCtl;
|
108 | CButtonm_LogPatternCtl;
|
109 | CButtonm_LogPatternCtl;
|
109 | CButtonm_FilesCtl;
|
110 | CButtonm_FilesCtl;
|
110 | CSpinButtonCtrlm_LogLenSpinCtl;
|
111 | CSpinButtonCtrlm_LogLenSpinCtl;
|
111 | CStaticm_LogLengthCtl;
|
112 | CStaticm_LogLengthCtl;
|
112 | CButtonm_PriInvertCtl;
|
113 | CButtonm_PriInvertCtl;
|
113 | CButtonm_LogtoFileCtl;
|
114 | CButtonm_LogtoFileCtl;
|
114 | CButtonm_LogtoHostCtl;
|
115 | CButtonm_LogtoHostCtl;
|
115 | CButtonm_LogtoNoneCtl;
|
116 | CButtonm_LogtoNoneCtl;
|
116 | CStaticm_HFNameCaptionCtl;
|
117 | CStaticm_HFNameCaptionCtl;
|
117 | CListBoxm_hlCtl;
|
118 | CListBoxm_hlCtl;
|
118 | CButtonm_BrowseSoundCtl;
|
119 | CButtonm_BrowseSoundCtl;
|
119 | CButtonm_PriNoneCtl;
|
120 | CButtonm_PriNoneCtl;
|
120 | CButtonm_hlRemoveCtl;
|
121 | CButtonm_hlRemoveCtl;
|
121 | CEditm_hlMaskCtl;
|
122 | CEditm_hlMaskCtl;
|
122 | CEditm_hlIPCtl;
|
123 | CEditm_hlIPCtl;
|
123 | CButtonm_hlAddCtl;
|
124 | CButtonm_hlAddCtl;
|
124 | CButtonm_PriAllCtl;
|
125 | CButtonm_PriAllCtl;
|
125 | CComboBoxm_SoundCtl;
|
126 | CComboBoxm_SoundCtl;
|
126 | CButtonm_RemoveCtl;
|
127 | CButtonm_RemoveCtl;
|
127 | CButtonm_PlaySoundCtl;
|
128 | CButtonm_PlaySoundCtl;
|
128 | CListBoxm_Log;
|
129 | CListBoxm_Log;
|
129 | CEditm_HFNameCtl;
|
130 | CEditm_HFNameCtl;
|
130 | CComboBoxm_FacilityCtl;
|
131 | CComboBoxm_FacilityCtl;
|
131 | CButtonm_BrowseCtl;
|
132 | CButtonm_BrowseCtl;
|
132 | CEditm_DescCtl;
|
133 | CEditm_DescCtl;
|
133 | CTabCtrlm_Tabs;
|
134 | CTabCtrlm_Tabs;
|
134 | int m_Logto;
|
135 | int m_Logto;
|
135 | CStringm_Desc;
|
136 | CStringm_Desc;
|
136 | CStringm_Facility;
|
137 | CStringm_Facility;
|
137 | CStringm_HFName;
|
138 | CStringm_HFName;
|
138 | CStringm_HFNameCaption;
|
139 | CStringm_HFNameCaption;
|
139 | CStringm_hlIP;
|
140 | CStringm_hlIP;
|
140 | CStringm_hlMask;
|
141 | CStringm_hlMask;
|
141 | CStringm_Sound;
|
142 | CStringm_Sound;
|
142 | //}}AFX_DATA
|
143 | //}}AFX_DATA
|
143 |
|
144 |
|
144 | // ClassWizard generated virtual function overrides
|
145 | // ClassWizard generated virtual function overrides
|
145 | //{{AFX_VIRTUAL(CKLogDlg)
|
146 | //{{AFX_VIRTUAL(CKLogDlg)
|
146 | protected:
|
147 | protected:
|
147 | virtual void DoDataExchange(CDataExchange* pDX);// DDX/DDV support
|
148 | virtual void DoDataExchange(CDataExchange* pDX);// DDX/DDV support
|
148 | //}}AFX_VIRTUAL
|
149 | //}}AFX_VIRTUAL
|
149 |
|
150 |
|
150 | // Implementation
|
151 | // Implementation
|
151 | protected:
|
152 | protected:
|
152 | CToolTipCtrl m_tooltip; |
153 | CToolTipCtrl m_tooltip; |
153 | HICON m_hIcon;
|
154 | HICON m_hIcon;
|
154 |
|
155 |
|
155 | // Generated message map functions
|
156 | // Generated message map functions
|
156 | //{{AFX_MSG(CKLogDlg)
|
157 | //{{AFX_MSG(CKLogDlg)
|
157 | virtual BOOL OnInitDialog();
|
158 | virtual BOOL OnInitDialog();
|
158 | afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
|
159 | afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
|
159 | afx_msg void OnDestroy();
|
160 | afx_msg void OnDestroy();
|
160 | afx_msg void OnPaint();
|
161 | afx_msg void OnPaint();
|
161 | afx_msg HCURSOR OnQueryDragIcon();
|
162 | afx_msg HCURSOR OnQueryDragIcon();
|
162 | afx_msg void OnAdd();
|
163 | afx_msg void OnAdd();
|
163 | afx_msg void OnSelchangeTabs(NMHDR* pNMHDR, LRESULT* pResult);
|
164 | afx_msg void OnSelchangeTabs(NMHDR* pNMHDR, LRESULT* pResult);
|
164 | afx_msg void OnSelchangeFacility();
|
165 | afx_msg void OnSelchangeFacility();
|
165 | afx_msg void OnPriority();
|
166 | afx_msg void OnPriority();
|
166 | afx_msg void OnLogto();
|
167 | afx_msg void OnLogto();
|
167 | afx_msg void OnPriAll();
|
168 | afx_msg void OnPriAll();
|
168 | afx_msg void OnPriNone();
|
169 | afx_msg void OnPriNone();
|
169 | afx_msg void OnChangeDesc();
|
170 | afx_msg void OnChangeDesc();
|
170 | afx_msg void OnPriInvert();
|
171 | afx_msg void OnPriInvert();
|
171 | afx_msg void OnHlAdd();
|
172 | afx_msg void OnHlAdd();
|
172 | afx_msg void OnSelchangeHosts();
|
173 | afx_msg void OnSelchangeHosts();
|
173 | afx_msg void OnHlRemove();
|
174 | afx_msg void OnHlRemove();
|
174 | afx_msg void OnRemove();
|
175 | afx_msg void OnRemove();
|
175 | afx_msg void OnPlaysound();
|
176 | afx_msg void OnPlaysound();
|
176 | afx_msg void OnEditchangeSound();
|
177 | afx_msg void OnEditchangeSound();
|
177 | afx_msg void OnKillfocusSound();
|
178 | afx_msg void OnKillfocusSound();
|
178 | afx_msg void OnDeltaposLoglenspin(NMHDR* pNMHDR, LRESULT* pResult);
|
179 | afx_msg void OnDeltaposLoglenspin(NMHDR* pNMHDR, LRESULT* pResult);
|
179 | afx_msg void OnExit();
|
180 | afx_msg void OnExit();
|
180 | afx_msg void OnFiles();
|
181 | afx_msg void OnFiles();
|
181 | afx_msg void OnFilesExport();
|
182 | afx_msg void OnFilesExport();
|
182 | afx_msg void OnFilesImport();
|
183 | afx_msg void OnFilesImport();
|
183 | afx_msg void OnBrowsesound();
|
184 | afx_msg void OnBrowsesound();
|
184 | afx_msg void OnKillfocusHostfile();
|
185 | afx_msg void OnKillfocusHostfile();
|
185 | virtual void OnOK();
|
186 | virtual void OnOK();
|
186 | afx_msg void OnBrowse();
|
187 | afx_msg void OnBrowse();
|
187 | afx_msg void OnFilesReset();
|
188 | afx_msg void OnFilesReset();
|
188 | afx_msg void OnSelchangeLog();
|
189 | afx_msg void OnSelchangeLog();
|
189 | afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
|
190 | afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
|
190 | afx_msg void OnClose();
|
191 | afx_msg void OnClose();
|
191 | afx_msg void OnTrayAboutklog();
|
192 | afx_msg void OnTrayAboutklog();
|
192 | afx_msg void OnTrayExit();
|
193 | afx_msg void OnTrayExit();
|
193 | afx_msg void OnTrayShowklogwindow();
|
194 | afx_msg void OnTrayShowklogwindow();
|
194 | afx_msg void OnWindowPosChanging(WINDOWPOS FAR* lpwndpos);
|
195 | afx_msg void OnWindowPosChanging(WINDOWPOS FAR* lpwndpos);
|
195 | afx_msg void OnLogpattern();
|
196 | afx_msg void OnLogpattern();
|
| |
197 | afx_msg void OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI);
|
| |
198 | afx_msg void OnSize(UINT nType, int cx, int cy);
|
196 | //}}AFX_MSG
|
199 | //}}AFX_MSG
|
197 | DECLARE_MESSAGE_MAP()
|
200 | DECLARE_MESSAGE_MAP()
|
198 | };
|
201 | };
|
|