diff options
Diffstat (limited to 'src/kernel/tqdragobject.cpp')
| -rw-r--r-- | src/kernel/tqdragobject.cpp | 116 |
1 files changed, 58 insertions, 58 deletions
diff --git a/src/kernel/tqdragobject.cpp b/src/kernel/tqdragobject.cpp index 04b9f43a1..7cb9c09aa 100644 --- a/src/kernel/tqdragobject.cpp +++ b/src/kernel/tqdragobject.cpp @@ -279,9 +279,9 @@ TQDragManager::TQDragManager() dropWidget = 0; if ( !qt_dnd_manager ) qt_dnd_manager = this; - beingCancelled = FALSE; - restoreCursor = FALSE; - willDrop = FALSE; + beingCancelled = false; + restoreCursor = false; + willDrop = false; } @@ -327,7 +327,7 @@ TQDragObject::~TQDragObject() { #ifndef TQT_NO_DRAGANDDROP if ( qt_dnd_manager && qt_dnd_manager->object == this ) - qt_dnd_manager->cancel( FALSE ); + qt_dnd_manager->cancel( false ); if ( d->pm_cursor ) { for ( int i = 0; i < qt_dnd_manager->n_cursor; i++ ) qt_dnd_manager->pm_cursor[i] = d->pm_cursor[i]; @@ -455,9 +455,9 @@ TQPixmap *TQDragObject::cursor( DragMode m ) const Starts a drag operation using the contents of this object, using DragDefault mode. - The function returns TRUE if the caller should delete the original + The function returns true if the caller should delete the original copy of the dragged data (but see target()); otherwise returns - FALSE. + false. If the drag contains \e references to information (e.g. file names in a TQUriDrag are references) then the return value should always @@ -535,10 +535,10 @@ void TQDragObject::dragLink() will be done during future event processing - after that time the drag object will be deleted. - Returns TRUE if the dragged data was dragged as a \e move, + Returns true if the dragged data was dragged as a \e move, indicating that the caller should remove the original source of the data (the drag object must continue to have a copy); otherwise - returns FALSE. + returns false. The \a mode specifies the drag mode (see \l{TQDragObject::DragMode}.) Normally one of the simpler drag(), @@ -549,7 +549,7 @@ bool TQDragObject::drag( DragMode mode ) if ( qt_dnd_manager ) return qt_dnd_manager->drag( this, mode ); else - return FALSE; + return false; } #endif @@ -786,11 +786,11 @@ static TQTextCodec *codecForHTML(const TQCString &ba) mib = 106; // utf-8 } else { pos = 0; - while ((pos = ba.find("<meta http-equiv=", pos, FALSE)) != -1) { + while ((pos = ba.find("<meta http-equiv=", pos, false)) != -1) { int end = ba.find('>', pos+1); if (end == -1) break; - pos = ba.find("charset=", pos, FALSE) + (int)strlen("charset="); + pos = ba.find("charset=", pos, false) + (int)strlen("charset="); if (pos != -1 && pos < end) { int pos2 = ba.find('\"', pos+1); TQCString cs = ba.mid(pos, pos2-pos); @@ -863,8 +863,8 @@ TQByteArray TQTextDrag::encodedData(const char* mime) const } /*! - Returns TRUE if the information in \a e can be decoded into a - TQString; otherwise returns FALSE. + Returns true if the information in \a e can be decoded into a + TQString; otherwise returns false. \sa decode() */ @@ -883,7 +883,7 @@ bool TQTextDrag::canDecode( const TQMimeSource* e ) \overload Attempts to decode the dropped information in \a e into \a str. - Returns TRUE if successful; otherwise returns FALSE. If \a subtype + Returns true if successful; otherwise returns false. If \a subtype is null, any text subtype is accepted; otherwise only the specified \a subtype is accepted. @@ -892,7 +892,7 @@ bool TQTextDrag::canDecode( const TQMimeSource* e ) bool TQTextDrag::decode( const TQMimeSource* e, TQString& str, TQCString& subtype ) { if(!e) - return FALSE; + return false; // when subtype is not specified, try text/plain first, otherwise this may read // things like text/x-moz-url even though better targets are available @@ -907,7 +907,7 @@ bool TQTextDrag::decode( const TQMimeSource* e, TQString& str, TQCString& subtyp if ( e->cacheType == TQMimeSource::Text ) { str = *e->cache.txt.str; subtype = *e->cache.txt.subtype; - return TRUE; + return true; } const char* mime; @@ -955,18 +955,18 @@ bool TQTextDrag::decode( const TQMimeSource* e, TQString& str, TQCString& subtyp m->cache.txt.str = new TQString( str ); m->cache.txt.subtype = new TQCString( subtype ); - return TRUE; + return true; } } } } } - return FALSE; + return false; } /*! Attempts to decode the dropped information in \a e into \a str. - Returns TRUE if successful; otherwise returns FALSE. + Returns true if successful; otherwise returns false. \sa canDecode() */ @@ -1104,8 +1104,8 @@ TQByteArray TQImageDrag::encodedData(const char* fmt) const } /*! - Returns TRUE if the information in mime source \a e can be decoded - into an image; otherwise returns FALSE. + Returns true if the information in mime source \a e can be decoded + into an image; otherwise returns false. \sa decode() */ @@ -1117,26 +1117,26 @@ bool TQImageDrag::canDecode( const TQMimeSource* e ) { TQCString format = fileFormats.current(); TQCString type = "image/" + format.lower(); if ( e->provides(type.data())) - return TRUE; + return true; fileFormats.next(); } - return FALSE; + return false; } /*! Attempts to decode the dropped information in mime source \a e - into \a img. Returns TRUE if successful; otherwise returns FALSE. + into \a img. Returns true if successful; otherwise returns false. \sa canDecode() */ bool TQImageDrag::decode( const TQMimeSource* e, TQImage& img ) { if ( !e ) - return FALSE; + return false; if ( e->cacheType == TQMimeSource::Graphics ) { img = *e->cache.gfx.img; - return TRUE; + return true; } TQByteArray payload; @@ -1157,25 +1157,25 @@ bool TQImageDrag::decode( const TQMimeSource* e, TQImage& img ) } if ( payload.isEmpty() ) - return FALSE; + return false; img.loadFromData(payload); if ( img.isNull() ) - return FALSE; + return false; TQMimeSource *m = (TQMimeSource*)e; m->clearCache(); m->cacheType = TQMimeSource::Graphics; m->cache.gfx.img = new TQImage( img ); m->cache.gfx.pix = 0; - return TRUE; + return true; } /*! \overload Attempts to decode the dropped information in mime source \a e - into pixmap \a pm. Returns TRUE if successful; otherwise returns - FALSE. + into pixmap \a pm. Returns true if successful; otherwise returns + false. This is a convenience function that converts to a TQPixmap via a TQImage. @@ -1185,25 +1185,25 @@ bool TQImageDrag::decode( const TQMimeSource* e, TQImage& img ) bool TQImageDrag::decode( const TQMimeSource* e, TQPixmap& pm ) { if ( !e ) - return FALSE; + return false; if ( e->cacheType == TQMimeSource::Graphics && e->cache.gfx.pix) { pm = *e->cache.gfx.pix; - return TRUE; + return true; } TQImage img; // We avoid dither, since the image probably came from this display if ( decode( e, img ) ) { if ( !pm.convertFromImage( img, AvoidDither ) ) - return FALSE; + return false; // decode initialized the cache for us TQMimeSource *m = (TQMimeSource*)e; m->cache.gfx.pix = new TQPixmap( pm ); - return TRUE; + return true; } - return FALSE; + return false; } @@ -1363,8 +1363,8 @@ void TQUriDrag::setUris( TQStrList uris ) /*! - Returns TRUE if decode() would be able to decode \a e; otherwise - returns FALSE. + Returns true if decode() would be able to decode \a e; otherwise + returns false. */ bool TQUriDrag::canDecode( const TQMimeSource* e ) { @@ -1375,15 +1375,15 @@ bool TQUriDrag::canDecode( const TQMimeSource* e ) Decodes URIs from \a e, placing the result in \a l (which is first cleared). - Returns TRUE if \a e contained a valid list of URIs; otherwise - returns FALSE. + Returns true if \a e contained a valid list of URIs; otherwise + returns false. */ bool TQUriDrag::decode( const TQMimeSource* e, TQStrList& l ) { TQByteArray payload = e->encodedData( "text/uri-list" ); if ( payload.size() ) { l.clear(); - l.setAutoDelete(TRUE); + l.setAutoDelete(true); uint c=0; const char* d = payload.data(); while (c < payload.size() && d[c]) { @@ -1400,9 +1400,9 @@ bool TQUriDrag::decode( const TQMimeSource* e, TQStrList& l ) (d[c]=='\n' || d[c]=='\r')) c++; } - return TRUE; + return true; } - return FALSE; + return false; } static uint htod( int h ) @@ -1511,11 +1511,11 @@ TQCString TQUriDrag::localFileToUri(const TQString& filename) #ifdef TQ_WS_WIN - bool hasHost = FALSE; + bool hasHost = false; // convert form network path if (r.left(2) == "\\\\" || r.left(2) == "//") { r.remove(0, 2); - hasHost = TRUE; + hasHost = true; } // Slosh -> Slash @@ -1605,7 +1605,7 @@ TQString TQUriDrag::uriToLocalFile(const char* uri) hostname[ 256 ] = '\0'; if ( tqstrncmp( uri+1, hostname, hostname_end - ( uri+1 )) == 0 ) { uri = hostname_end + 1; // point after the slash - local = TRUE; + local = true; } } } @@ -1644,14 +1644,14 @@ TQString TQUriDrag::uriToLocalFile(const char* uri) local files if they refer to local files, and places them in \a l (which is first cleared). - Returns TRUE if \e contained a valid list of URIs; otherwise - returns FALSE. The list will be empty if no URIs were local files. + Returns true if \e contained a valid list of URIs; otherwise + returns false. The list will be empty if no URIs were local files. */ bool TQUriDrag::decodeLocalFiles( const TQMimeSource* e, TQStringList& l ) { TQStrList u; if ( !decode( e, u ) ) - return FALSE; + return false; l.clear(); for (const char* s=u.first(); s; s=u.next()) { @@ -1659,7 +1659,7 @@ bool TQUriDrag::decodeLocalFiles( const TQMimeSource* e, TQStringList& l ) if ( !lf.isNull() ) l.append( lf ); } - return TRUE; + return true; } /*! @@ -1667,20 +1667,20 @@ bool TQUriDrag::decodeLocalFiles( const TQMimeSource* e, TQStringList& l ) Unicode URIs (only useful for displaying to humans), placing them in \a l (which is first cleared). - Returns TRUE if \e contained a valid list of URIs; otherwise - returns FALSE. + Returns true if \e contained a valid list of URIs; otherwise + returns false. */ bool TQUriDrag::decodeToUnicodeUris( const TQMimeSource* e, TQStringList& l ) { TQStrList u; if ( !decode( e, u ) ) - return FALSE; + return false; l.clear(); for (const char* s=u.first(); s; s=u.next()) l.append( uriToUnicodeUri(s) ); - return TRUE; + return true; } @@ -1768,8 +1768,8 @@ void TQColorDrag::setColor( const TQColor &col ) } /*! - Returns TRUE if the color drag object can decode the mime source - \a e; otherwise returns FALSE. + Returns true if the color drag object can decode the mime source + \a e; otherwise returns false. */ bool TQColorDrag::canDecode( TQMimeSource *e ) @@ -1787,7 +1787,7 @@ bool TQColorDrag::decode( TQMimeSource *e, TQColor &col ) TQByteArray data = e->encodedData("application/x-color"); ushort rgba[4]; if (data.size() != sizeof(rgba)) - return FALSE; + return false; memcpy(rgba, data.data(), sizeof(rgba)); @@ -1805,7 +1805,7 @@ bool TQColorDrag::decode( TQMimeSource *e, TQColor &col ) b = (b >> 8) & 0xff; col.setRgb(r, g, b); - return TRUE; + return true; } #endif // TQT_NO_MIME |
