]> git.saurik.com Git - wxWidgets.git/blame - include/wx/unix/private/fswatcher_inotify.h
wxMessageBox off the main thread lost result code.
[wxWidgets.git] / include / wx / unix / private / fswatcher_inotify.h
CommitLineData
6b8ef0b3
VZ
1/////////////////////////////////////////////////////////////////////////////
2// Name: wx/unix/private/fswatcher_inotify.h
3// Purpose: File system watcher impl classes
4// Author: Bartosz Bekier
5// Created: 2009-05-26
6b8ef0b3
VZ
6// Copyright: (c) 2009 Bartosz Bekier <bartosz.bekier@gmail.com>
7// Licence: wxWindows licence
8/////////////////////////////////////////////////////////////////////////////
9
10#ifndef WX_UNIX_PRIVATE_FSWATCHER_INOTIFY_H_
11#define WX_UNIX_PRIVATE_FSWATCHER_INOTIFY_H_
12
13#include "wx/filename.h"
5cd99866 14#include "wx/evtloopsrc.h"
6b8ef0b3
VZ
15
16// ============================================================================
17// wxFSWatcherEntry implementation & helper declarations
18// ============================================================================
19
20class wxFSWatcherImplUNIX;
21
22class wxFSWatchEntry : public wxFSWatchInfo
23{
24public:
25 wxFSWatchEntry(const wxFSWatchInfo& winfo) :
26 wxFSWatchInfo(winfo)
27 {
28 }
29
30 int GetWatchDescriptor() const
31 {
32 return m_wd;
33 }
34
35 void SetWatchDescriptor(int wd)
36 {
37 m_wd = wd;
38 }
39
40private:
41 int m_wd;
42
43 wxDECLARE_NO_COPY_CLASS(wxFSWatchEntry);
44};
45
46
47// ============================================================================
48// wxFSWSourceHandler helper class
49// ============================================================================
50
51class wxFSWatcherImplUnix;
52
53/**
54 * Handler for handling i/o from inotify descriptor
55 */
56class wxFSWSourceHandler : public wxEventLoopSourceHandler
57{
58public:
59 wxFSWSourceHandler(wxFSWatcherImplUnix* service) :
60 m_service(service)
61 { }
62
63 virtual void OnReadWaiting();
64 virtual void OnWriteWaiting();
65 virtual void OnExceptionWaiting();
66
67protected:
68 wxFSWatcherImplUnix* m_service;
69};
70
71#endif /* WX_UNIX_PRIVATE_FSWATCHER_INOTIFY_H_ */