"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/aguix/stringgadget.cc" between
worker-4.7.0.tar.bz2 and worker-4.8.0.tar.bz2

About: Worker is a file manager for the X Window System with the classical two panel interface.

stringgadget.cc  (worker-4.7.0.tar.bz2):stringgadget.cc  (worker-4.8.0.tar.bz2)
skipping to change at line 27 skipping to change at line 27
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#include "stringgadget.h" #include "stringgadget.h"
#include "awindow.h" #include "awindow.h"
#include "guielement.h" #include "guielement.h"
#include "utf8.hh" #include "utf8.hh"
#include "drawablecont.hh" #include "drawablecont.hh"
#include "util.h"
const char *StringGadget::type="StringGadget"; const char *StringGadget::type="StringGadget";
StringGadget::~StringGadget() StringGadget::~StringGadget()
{ {
_aguix->cancelCutPaste( this ); _aguix->cancelCutPaste( this );
destroy(); destroy();
} }
StringGadget::StringGadget(AGUIX *taguix,int tx,int ty,int width,int height,cons t char *ttext,int tdata):GUIElement(taguix) StringGadget::StringGadget(AGUIX *taguix,int tx,int ty,int width,int height,cons t char *ttext,int tdata):GUIElement(taguix)
skipping to change at line 840 skipping to change at line 841
content.setCursorPos( x1 ); content.setCursorPos( x1 );
content.setSelStart( x1 ); content.setSelStart( x1 );
content.setSelEnd( x1 ); content.setSelEnd( x1 );
if ( content.getCursorPos() < content.getXOffset() ) content.setXOffset( conte nt.getCursorPos() ); if ( content.getCursorPos() < content.getXOffset() ) content.setXOffset( conte nt.getCursorPos() );
} }
void StringGadget::insertSelection() void StringGadget::insertSelection()
{ {
if ( isCreated() == false ) return; if ( isCreated() == false ) return;
char *bytes_return;
if ( _aguix->amiOwner() == true ) { if ( _aguix->amiOwner() == true ) {
bytes_return = dupstring( _aguix->getCutBuffer() ); std::string s2 = AGUIXUtils::remove_char( _aguix->getCutBuffer(), '\n' );
content.insertAtCursor( bytes_return ); content.insertAtCursor( s2.c_str() );
_freesafe( bytes_return );
} else { } else {
_aguix->requestCut(getWindow()); _aguix->requestCut(getWindow());
_aguix->startPaste(this); _aguix->startPaste(this);
wantpaste=true; wantpaste=true;
pasterequest=time(NULL); pasterequest=time(NULL);
} }
} }
int StringGadget::setFont( const char *fontname ) int StringGadget::setFont( const char *fontname )
{ {
skipping to change at line 959 skipping to change at line 958
strongkeycapture=nv; strongkeycapture=nv;
} }
void StringGadget::paste(unsigned char*buf) void StringGadget::paste(unsigned char*buf)
{ {
if((wantpaste==true)&&(difftime(time(NULL),pasterequest)<10.0)) { if((wantpaste==true)&&(difftime(time(NULL),pasterequest)<10.0)) {
if(forbidPosChange==false) { if(forbidPosChange==false) {
content.setSelStart( content.getCursorPos() ); content.setSelStart( content.getCursorPos() );
content.setSelEnd( content.getCursorPos() ); content.setSelEnd( content.getCursorPos() );
content.insertAtCursor( (char*)buf ); std::string s2 = AGUIXUtils::remove_char( (const char *)buf, '\n' );
content.insertAtCursor( s2.c_str() );
redraw(); redraw();
} }
} }
} }
void StringGadget::cancelpaste() void StringGadget::cancelpaste()
{ {
wantpaste=false; wantpaste=false;
pasterequest=0; pasterequest=0;
 End of changes. 4 change blocks. 
5 lines changed or deleted 5 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)