Add FileSystemWatcher wrapping wxFileSystemWatcher - #191
Open
trypsynth wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Design notes
wxFileSystemWatcherBase defaults its own event handler as the owner unless SetOwner() is called, so FileSystemWatcher implements WxEvtHandler directly (casting the watcher's own pointer to wxd_EvtHandler_t) and events are bound straight on the watcher object, no separate owner argument needed (unlike Timer, which really does require one on the wx side). SetOwner() itself is not exposed since the default behavior covers the common case; happy to add it if there's a use case for redirecting events elsewhere.
Motivation
Watching a file or directory for external changes (an open document being edited by another program, a config file, a directory listing) is a common desktop app need with no cross-platform story otherwise. wxWidgets already provides this with native backends per platform, it just was not wrapped by wxDragon yet.
Test plan