-
Notifications
You must be signed in to change notification settings - Fork 964
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'xhandlers' of https://github.com/CendioOssman/tigervnc
- Loading branch information
Showing
33 changed files
with
6,112 additions
and
244 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
diff -up fltk-1.3.x-r8659/FL/Fl.H.orig fltk-1.3.x-r8659/FL/Fl.H | ||
--- fltk-1.3.x-r8659/FL/Fl.H.orig 2011-05-17 16:25:56.671744548 +0200 | ||
+++ fltk-1.3.x-r8659/FL/Fl.H 2011-05-17 16:26:05.709101536 +0200 | ||
@@ -108,6 +108,9 @@ typedef int (*Fl_Args_Handler)(int argc, | ||
\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 */ | ||
|
||
|
||
@@ -744,6 +747,19 @@ public: | ||
*/ | ||
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); | ||
+ /** | ||
+ 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 | ||
then initiate the system wide drag and drop handling. Dropped data | ||
diff -up fltk-1.3.x-r8659/src/Fl.cxx.orig fltk-1.3.x-r8659/src/Fl.cxx | ||
--- fltk-1.3.x-r8659/src/Fl.cxx.orig 2011-05-18 15:20:26.667291459 +0200 | ||
+++ fltk-1.3.x-r8659/src/Fl.cxx 2011-05-18 16:31:15.522026086 +0200 | ||
@@ -430,6 +430,69 @@ static char in_idle; | ||
#endif | ||
|
||
//////////////////////////////////////////////////////////////// | ||
+// Clipboard notifications | ||
+ | ||
+struct Clipboard_Notify { | ||
+ Fl_Clipboard_Notify_Handler handler; | ||
+ void *data; | ||
+ struct Clipboard_Notify *next; | ||
+}; | ||
+ | ||
+static struct Clipboard_Notify *clip_notify_list = NULL; | ||
+ | ||
+extern void fl_clipboard_notify_change(); // in Fl_<platform>.cxx | ||
+ | ||
+void Fl::add_clipboard_notify(Fl_Clipboard_Notify_Handler h, void *data) { | ||
+ struct Clipboard_Notify *node; | ||
+ | ||
+ remove_clipboard_notify(h); | ||
+ | ||
+ node = new Clipboard_Notify; | ||
+ | ||
+ node->handler = h; | ||
+ node->data = data; | ||
+ node->next = clip_notify_list; | ||
+ | ||
+ clip_notify_list = node; | ||
+ | ||
+ fl_clipboard_notify_change(); | ||
+} | ||
+ | ||
+void Fl::remove_clipboard_notify(Fl_Clipboard_Notify_Handler h) { | ||
+ struct Clipboard_Notify *node, **prev; | ||
+ | ||
+ node = clip_notify_list; | ||
+ prev = &clip_notify_list; | ||
+ while (node != NULL) { | ||
+ if (node->handler == h) { | ||
+ *prev = node->next; | ||
+ delete node; | ||
+ | ||
+ fl_clipboard_notify_change(); | ||
+ | ||
+ return; | ||
+ } | ||
+ | ||
+ prev = &node->next; | ||
+ node = node->next; | ||
+ } | ||
+} | ||
+ | ||
+bool fl_clipboard_notify_empty(void) { | ||
+ return clip_notify_list == NULL; | ||
+} | ||
+ | ||
+void fl_trigger_clipboard_notify(int source) { | ||
+ struct Clipboard_Notify *node; | ||
+ | ||
+ node = clip_notify_list; | ||
+ while (node != NULL) { | ||
+ node->handler(source, node->data); | ||
+ node = node->next; | ||
+ } | ||
+} | ||
+ | ||
+//////////////////////////////////////////////////////////////// | ||
// wait/run/check/ready: | ||
|
||
void (*Fl::idle)(); // see Fl::add_idle.cxx for the add/remove functions |
Oops, something went wrong.
bf65abb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Patch #12 does not apply cleanly (I can't look into why until later tonight):
...
patching file FL/Fl.H
patching file src/Fl_cocoa.mm
patching file src/Fl.cxx
patching file src/Fl_win32.cxx
Hunk #1 succeeded at 335 (offset -1 lines).
Hunk #2 FAILED at 403.
1 out of 2 hunks FAILED -- saving rejects to file src/Fl_win32.cxx.rej
...
bf65abb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in c550e6f.