diff options
| -rw-r--r-- | FL/Fl_System_Driver.H | 5 | ||||
| -rw-r--r-- | src/Fl.cxx | 8 | ||||
| -rw-r--r-- | src/Fl_cocoa.mm | 2 | ||||
| -rw-r--r-- | src/Fl_win32.cxx | 2 | ||||
| -rw-r--r-- | src/Fl_x.cxx | 2 | ||||
| -rw-r--r-- | src/drivers/Darwin/Fl_Darwin_System_Driver.H | 1 | ||||
| -rw-r--r-- | src/drivers/WinAPI/Fl_WinAPI_System_Driver.H | 4 | ||||
| -rw-r--r-- | src/drivers/X11/Fl_X11_System_Driver.H | 2 |
8 files changed, 20 insertions, 6 deletions
diff --git a/FL/Fl_System_Driver.H b/FL/Fl_System_Driver.H index 0c1ff5b90..ca5145108 100644 --- a/FL/Fl_System_Driver.H +++ b/FL/Fl_System_Driver.H @@ -36,6 +36,7 @@ class Fl_File_Icon; class Fl_File_Browser; class Fl_Pixmap; +class Fl_Widget; /** \brief A base class for platform-specific system operations. @@ -193,8 +194,10 @@ public: static const char * const tree_close_xpm[]; // used by tree_closepixmap() // the default implementation of tree_connector_style() is in Fl_Tree_Prefs.cxx and can be enough virtual int tree_connector_style(); - //implement to support copy-to-clipboard + // implement to support copy-to-clipboard virtual void copy(const char *stuff, int len, int clipboard, const char *type) {} + // implement to support paste-from-clipboard + virtual void paste(Fl_Widget &receiver, int clipboard, const char *type) {} }; #endif // FL_SYSTEM_DRIVER_H diff --git a/src/Fl.cxx b/src/Fl.cxx index 9a4dda794..4fd93e474 100644 --- a/src/Fl.cxx +++ b/src/Fl.cxx @@ -1414,8 +1414,14 @@ void Fl::selection(Fl_Widget &owner, const char* text, int len) { \see Fl::paste(Fl_Widget &receiver, int clipboard, const char* type) */ void Fl::paste(Fl_Widget &receiver) { - Fl::paste(receiver, 0); + Fl::system_driver()->paste(receiver, 0, Fl::clipboard_plain_text); } + +void Fl::paste(Fl_Widget &receiver, int clipboard, const char *type) +{ + Fl::system_driver()->paste(receiver, clipboard, type); +} + //////////////////////////////////////////////////////////////// void Fl_Widget::redraw() { diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index dfc28741f..edd7d8820 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -3482,7 +3482,7 @@ static Fl_Image* get_image_from_clipboard(Fl_Widget *receiver) } // Call this when a "paste" operation happens: -void Fl::paste(Fl_Widget &receiver, int clipboard, const char *type) { +void Fl_Darwin_System_Driver::paste(Fl_Widget &receiver, int clipboard, const char *type) { if (type[0] == 0) type = Fl::clipboard_plain_text; if (clipboard) { Fl::e_clipboard_type = ""; diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx index 974d2e22d..32e7b83e4 100644 --- a/src/Fl_win32.cxx +++ b/src/Fl_win32.cxx @@ -691,7 +691,7 @@ void Fl_WinAPI_System_Driver::copy(const char *stuff, int len, int clipboard, co } // Call this when a "paste" operation happens: -void Fl::paste(Fl_Widget &receiver, int clipboard, const char *type) { +void Fl_WinAPI_System_Driver::paste(Fl_Widget &receiver, int clipboard, const char *type) { if (!clipboard || (fl_i_own_selection[clipboard] && strcmp(type, Fl::clipboard_plain_text) == 0)) { // We already have it, do it quickly without window server. // Notice that the text is clobbered if set_selection is diff --git a/src/Fl_x.cxx b/src/Fl_x.cxx index 3c7245efc..8adc37999 100644 --- a/src/Fl_x.cxx +++ b/src/Fl_x.cxx @@ -807,7 +807,7 @@ int fl_selection_buffer_length[2]; char fl_i_own_selection[2] = {0,0}; // Call this when a "paste" operation happens: -void Fl::paste(Fl_Widget &receiver, int clipboard, const char *type) { +void Fl_X11_System_Driver::paste(Fl_Widget &receiver, int clipboard, const char *type) { if (fl_i_own_selection[clipboard]) { // We already have it, do it quickly without window server. // Notice that the text is clobbered if set_selection is diff --git a/src/drivers/Darwin/Fl_Darwin_System_Driver.H b/src/drivers/Darwin/Fl_Darwin_System_Driver.H index 9f9f7f5b0..43aef846f 100644 --- a/src/drivers/Darwin/Fl_Darwin_System_Driver.H +++ b/src/drivers/Darwin/Fl_Darwin_System_Driver.H @@ -70,6 +70,7 @@ public: virtual int tree_connector_style(); virtual const char *filename_name(const char *buf); virtual void copy(const char *stuff, int len, int clipboard, const char *type); + virtual void paste(Fl_Widget &receiver, int clipboard, const char *type); }; #endif // FL_DARWIN_SYSTEM_DRIVER_H diff --git a/src/drivers/WinAPI/Fl_WinAPI_System_Driver.H b/src/drivers/WinAPI/Fl_WinAPI_System_Driver.H index d544b239c..2950efa14 100644 --- a/src/drivers/WinAPI/Fl_WinAPI_System_Driver.H +++ b/src/drivers/WinAPI/Fl_WinAPI_System_Driver.H @@ -104,8 +104,10 @@ public: virtual int case_insensitive_filenames() {return 1;} // this one is implemented in Fl_win32.cxx virtual const char *filename_name(const char *buf); - // this one is in Fl_win32.cxx + // this one is implemented in Fl_win32.cxx virtual void copy(const char *stuff, int len, int clipboard, const char *type); + // this one is implemented in Fl_win32.cxx + virtual void paste(Fl_Widget &receiver, int clipboard, const char *type); }; #endif // FL_WINAPI_SYSTEM_DRIVER_H diff --git a/src/drivers/X11/Fl_X11_System_Driver.H b/src/drivers/X11/Fl_X11_System_Driver.H index b6e87922d..c0a790917 100644 --- a/src/drivers/X11/Fl_X11_System_Driver.H +++ b/src/drivers/X11/Fl_X11_System_Driver.H @@ -49,6 +49,8 @@ public: virtual const char *filename_name(const char *buf); // this one is in Fl_x.cxx virtual void copy(const char *stuff, int len, int clipboard, const char *type); + // this one is in Fl_x.cxx + virtual void paste(Fl_Widget &receiver, int clipboard, const char *type); }; #endif /* FL_X11_SYSTEM_DRIVER_H */ |
