diff options
| author | Matthias Melcher <fltk@matthiasm.com> | 2002-02-26 00:34:55 +0000 |
|---|---|---|
| committer | Matthias Melcher <fltk@matthiasm.com> | 2002-02-26 00:34:55 +0000 |
| commit | 7a6ed8c9419b914644936c7e25a2f1eb10d7c28e (patch) | |
| tree | 8fc202fc77c5897558c2c997e87dba625b841791 /src/Fl_cutpaste_mac.cxx | |
| parent | 5dd2625d0365b81093481b74e563e65f29666ef4 (diff) | |
- added DDrag'N'Drop support for MacOS
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1976 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_cutpaste_mac.cxx')
| -rw-r--r-- | src/Fl_cutpaste_mac.cxx | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/Fl_cutpaste_mac.cxx b/src/Fl_cutpaste_mac.cxx index 99e7cb892..7633ac6f3 100644 --- a/src/Fl_cutpaste_mac.cxx +++ b/src/Fl_cutpaste_mac.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_cutpaste_mac.cxx,v 1.1.2.3 2002/01/01 15:11:31 easysw Exp $" +// "$Id: Fl_cutpaste_mac.cxx,v 1.1.2.4 2002/02/26 00:34:55 matthiaswm Exp $" // // MacOS cut/paste code for the Fast Light Tool Kit (FLTK). // @@ -30,8 +30,8 @@ #include <FL/Fl_Window.H> #include <string.h> -static char *selection_buffer = 0L; -static int selection_length = 0; +char *fl_selection_buffer = 0L; +int fl_selection_length = 0; static int selection_buffer_length = 0; static ScrapRef myScrap = 0; @@ -56,17 +56,17 @@ void Fl::paste( Fl_Widget &receiver ) if ( len > selection_buffer_length ) { selection_buffer_length = len + 32; - delete[] selection_buffer; - selection_buffer = new char[len]; + delete[] fl_selection_buffer; + fl_selection_buffer = new char[len]; selection_buffer_length = len; } - GetScrapFlavorData( scrap, kScrapFlavorTypeText, &len, selection_buffer ); - selection_length = len; + GetScrapFlavorData( scrap, kScrapFlavorTypeText, &len, fl_selection_buffer ); + fl_selection_length = len; } - for ( char *s = selection_buffer+selection_length; s >= selection_buffer; s-- ) // this will fail on PC line endings (CR+LF) + for ( char *s = fl_selection_buffer+fl_selection_length; s >= fl_selection_buffer; s-- ) // this will fail on PC line endings (CR+LF) if ( *s == 0x0d ) *s = 0x0a; - Fl::e_text = selection_buffer; - Fl::e_length = selection_length; + Fl::e_text = fl_selection_buffer; + Fl::e_length = fl_selection_length; receiver.handle( FL_PASTE ); return; } @@ -82,15 +82,15 @@ void Fl::selection( Fl_Widget &owner, const char *stuff, int len ) { if ( !stuff || len<0 ) return; if ( len+1 > selection_buffer_length ) { - delete[] selection_buffer; - selection_buffer = new char[len+100]; + delete[] fl_selection_buffer; + fl_selection_buffer = new char[len+100]; selection_buffer_length = len+100; } - memcpy( selection_buffer, stuff, len ); - for ( char *s = selection_buffer+len; s >= selection_buffer; s-- ) // this will fail on PC line endings (CR+LF) + memcpy( fl_selection_buffer, stuff, len ); + for ( char *s = fl_selection_buffer+len; s >= fl_selection_buffer; s-- ) // this will fail on PC line endings (CR+LF) if ( *s == 0x0a ) *s = 0x0d; - selection_buffer[len] = 0; - selection_length = len; + fl_selection_buffer[len] = 0; + fl_selection_length = len; selection_owner( &owner ); ClearCurrentScrap(); @@ -100,10 +100,10 @@ void Fl::selection( Fl_Widget &owner, const char *stuff, int len ) { myScrap = 0; return; } - PutScrapFlavor( myScrap, kScrapFlavorTypeText, 0, selection_length, selection_buffer ); + PutScrapFlavor( myScrap, kScrapFlavorTypeText, 0, fl_selection_length, fl_selection_buffer ); } // -// End of "$Id: Fl_cutpaste_mac.cxx,v 1.1.2.3 2002/01/01 15:11:31 easysw Exp $". +// End of "$Id: Fl_cutpaste_mac.cxx,v 1.1.2.4 2002/02/26 00:34:55 matthiaswm Exp $". // |
