diff options
| author | Manolo Gouy <Manolo> | 2016-04-15 14:32:13 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2016-04-15 14:32:13 +0000 |
| commit | d683841f9f1932f871862096619cff486272528e (patch) | |
| tree | 1b8aeba9351e56612553b95e13c18f6637e228eb /src | |
| parent | 7508a033c508bb05b315bcb701941f35f8f9a764 (diff) | |
Move the platform-dependent implementations of Fl::paste() to the Fl_System_Driver class.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11615 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
| -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 |
7 files changed, 16 insertions, 5 deletions
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 */ |
