Move platform-dependent implementations of fl_clipboard_notify_changes() to the Fl_System_Driver class

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11617 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Manolo Gouy 2016-04-15 15:01:27 +00:00
parent b1f8f3e2aa
commit 397a3b83bf
7 changed files with 10 additions and 10 deletions

View File

@ -200,6 +200,8 @@ public:
virtual void paste(Fl_Widget &receiver, int clipboard, const char *type) {}
// implement to support paste-from-clipboard
virtual int clipboard_contains(const char *type) {return 0;}
// implement to support paste-from-clipboard
virtual void clipboard_notify_change() {}
};
#endif // FL_SYSTEM_DRIVER_H

View File

@ -447,8 +447,6 @@ struct Clipboard_Notify {
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;
@ -462,7 +460,7 @@ void Fl::add_clipboard_notify(Fl_Clipboard_Notify_Handler h, void *data) {
clip_notify_list = node;
fl_clipboard_notify_change();
Fl::system_driver()->clipboard_notify_change();
}
void Fl::remove_clipboard_notify(Fl_Clipboard_Notify_Handler h) {
@ -475,7 +473,7 @@ void Fl::remove_clipboard_notify(Fl_Clipboard_Notify_Handler h) {
*prev = node->next;
delete node;
fl_clipboard_notify_change();
Fl::system_driver()->clipboard_notify_change();
return;
}

View File

@ -3352,10 +3352,6 @@ static int fl_selection_buffer_length[2];
extern void fl_trigger_clipboard_notify(int source);
void fl_clipboard_notify_change() {
// No need to do anything here...
}
static void clipboard_check(void)
{
static NSInteger oldcount = -1;

View File

@ -892,7 +892,7 @@ void fl_clipboard_notify_retarget(HWND wnd) {
fl_clipboard_notify_target(fl_xid(Fl::first_window()));
}
void fl_clipboard_notify_change() {
void Fl_WinAPI_System_Driver::clipboard_notify_change() {
// untarget clipboard monitor if no handlers are registered
if (clipboard_wnd != NULL && fl_clipboard_notify_empty()) {
fl_clipboard_notify_untarget(clipboard_wnd);

View File

@ -1116,7 +1116,7 @@ static void handle_clipboard_timestamp(int clipboard, Time time)
fl_trigger_clipboard_notify(clipboard);
}
void fl_clipboard_notify_change() {
void Fl_X11_System_Driver::clipboard_notify_change() {
// Reset the timestamps if we've going idle so that you don't
// get a bogus immediate trigger next time they're activated.
if (fl_clipboard_notify_empty()) {

View File

@ -110,6 +110,8 @@ public:
virtual void paste(Fl_Widget &receiver, int clipboard, const char *type);
// this one is implemented in Fl_win32.cxx
virtual int clipboard_contains(const char *type);
// this one is implemented in Fl_win32.cxx
virtual void clipboard_notify_change();
};
#endif // FL_WINAPI_SYSTEM_DRIVER_H

View File

@ -53,6 +53,8 @@ public:
virtual void paste(Fl_Widget &receiver, int clipboard, const char *type);
// this one is in Fl_x.cxx
virtual int clipboard_contains(const char *type);
// this one is in Fl_x.cxx
virtual void clipboard_notify_change();
};
#endif /* FL_X11_SYSTEM_DRIVER_H */