From 1d6cc80d591568fb05dcd0373b53f108ef06326f Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Wed, 11 Sep 2013 12:54:40 +0000 Subject: STR 2636. Add ability to get notifications whenever the clipboard changes. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9974 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- FL/Fl.H | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'FL') diff --git a/FL/Fl.H b/FL/Fl.H index 4cd7a0b3f..3ca7b7068 100644 --- a/FL/Fl.H +++ b/FL/Fl.H @@ -109,6 +109,9 @@ typedef int (*Fl_Args_Handler)(int argc, char **argv, int &i); \see Fl::event_dispatch(Fl_Event_Dispatch) */ typedef int (*Fl_Event_Dispatch)(int event, Fl_Window *w); +/** Signature of add_clipboard_notify functions passed as parameters */ +typedef void (*Fl_Clipboard_Notify_Handler)(int source, void *data); + /** @} */ /* group callback_functions */ @@ -749,6 +752,19 @@ public: copy/cut/paste operations. */ static void paste(Fl_Widget &receiver, int source /*=0*/); // platform dependent + /** + FLTK will call the registered callback whenever there is a change to the + selection buffer or the clipboard. The source argument indicates which + of the two has changed. Only changes by other applications are reported. + \note Some systems require polling to monitor the clipboard and may + therefore have some delay in detecting changes. + */ + static void add_clipboard_notify(Fl_Clipboard_Notify_Handler h, void *data = 0); + /** + Stop calling the specified callback when there are changes to the selection + buffer or the clipboard. + */ + static void remove_clipboard_notify(Fl_Clipboard_Notify_Handler h); /** Initiate a Drag And Drop operation. The selection buffer should be filled with relevant data before calling this method. FLTK will -- cgit v1.2.3