32 explicit FileDrop(std::shared_ptr<Window> window =
nullptr);
71 std::vector<FileDroppedFunc> mRegisteredFuncs;
72 char* mPath =
nullptr;
73 bool mFileDropped =
false;
74 std::shared_ptr<Window> mWindow;
77 std::shared_ptr<Window> GetWindow()
const;
bool(* FileDroppedFunc)(char *)
Callback type for file-drop event handlers.
Definition FileDrop.h:13
A named Part with a parent/child hierarchy and optional thread safety.
Definition Component.h:34
Handles drag-and-drop file events for the application window.
Definition FileDrop.h:29
void ClearDroppedFile()
Clears the current dropped-file state.
void SetDroppedFile(char *path)
Records a file path as having been dropped onto the window.
bool RegisterDropHandler(FileDroppedFunc func)
Registers a callback to be invoked when a file is dropped.
FileDrop(std::shared_ptr< Window > window=nullptr)
Constructs the FileDrop component.
bool FileDropped() const
Returns true if a file has been dropped and not yet cleared.
bool UnregisterDropHandler(FileDroppedFunc func)
Removes a previously registered drop handler.
void CallHandlers()
Invokes all registered drop handlers with the current dropped file.
char * GetDroppedFile() const
Returns the path of the most recently dropped file.
Core namespace for the libultraship engine framework.
Definition gfx_direct3d_common.h:14