diff options
Diffstat (limited to 'src/kernel/qdnd_x11.cpp')
| -rw-r--r-- | src/kernel/qdnd_x11.cpp | 136 |
1 files changed, 68 insertions, 68 deletions
diff --git a/src/kernel/qdnd_x11.cpp b/src/kernel/qdnd_x11.cpp index 57bdcffd4..4f6b54ba7 100644 --- a/src/kernel/qdnd_x11.cpp +++ b/src/kernel/qdnd_x11.cpp @@ -204,9 +204,9 @@ static Time qt_xdnd_target_current_time; // screen number containing the pointer... -1 means default static int qt_xdnd_current_screen = -1; // state of dragging... true if dragging, false if not -bool qt_xdnd_dragging = FALSE; +bool qt_xdnd_dragging = false; // need to check state of keyboard modifiers -static bool need_modifiers_check = FALSE; +static bool need_modifiers_check = false; // dict of payload data, sorted by type atom static TQIntDict<TQByteArray> * qt_xdnd_target_data = 0; @@ -219,8 +219,8 @@ extern void qt_motifdnd_enable( TQWidget *, bool ); extern TQByteArray qt_motifdnd_obtain_data( const char *format ); extern const char *qt_motifdnd_format( int n ); -bool qt_motifdnd_active = FALSE; -static bool dndCancelled = FALSE; +bool qt_motifdnd_active = false; +static bool dndCancelled = false; // Shift/Ctrl handling, and final drop status static TQDragObject::DragMode drag_mode; @@ -324,7 +324,7 @@ static bool qt_xdnd_enable( TQWidget* w, bool on ) TQWidget * xdnd_widget = 0; if ( w->isDesktop() ) { if ( desktop_proxy ) // *WE* already have one. - return FALSE; + return false; // As per Xdnd4, use XdndProxy XGrabServer( w->x11Display() ); @@ -375,9 +375,9 @@ static bool qt_xdnd_enable( TQWidget* w, bool on ) XChangeProperty ( xdnd_widget->x11Display(), xdnd_widget->winId(), qt_xdnd_aware, XA_ATOM, 32, PropModeReplace, (unsigned char *)&atm, 1 ); - return TRUE; + return true; } else { - return FALSE; + return false; } } else { if ( w->isDesktop() ) { @@ -386,7 +386,7 @@ static bool qt_xdnd_enable( TQWidget* w, bool on ) delete desktop_proxy; desktop_proxy = 0; } - return TRUE; + return true; } } @@ -399,7 +399,7 @@ const char* qt_xdnd_atom_to_str( Atom a ) if ( !qt_xdnd_drag_types ) { qt_xdnd_drag_types = new TQIntDict<TQCString>( 17 ); - qt_xdnd_drag_types->setAutoDelete( TRUE ); + qt_xdnd_drag_types->setAutoDelete( true ); } TQCString* result; if ( !(result=qt_xdnd_drag_types->find( a )) ) { @@ -419,7 +419,7 @@ Atom* qt_xdnd_str_to_atom( const char *mimeType ) return 0; if ( !qt_xdnd_atom_numbers ) { qt_xdnd_atom_numbers = new TQDict<Atom>( 17 ); - qt_xdnd_atom_numbers->setAutoDelete( TRUE ); + qt_xdnd_atom_numbers->setAutoDelete( true ); } Atom * result; @@ -492,9 +492,9 @@ static TQWidget * find_child( TQWidget * tlw, TQPoint & p ) TQWidget * w = tlw; p = w->mapFromGlobal( p ); - bool done = FALSE; + bool done = false; while ( !done ) { - done = TRUE; + done = true; if ( ((TQExtraWidget*)w)->extraData() && ((TQExtraWidget*)w)->extraData()->xDndProxy != 0 ) break; // stop searching for widgets under the mouse cursor if found widget is a proxy. @@ -509,7 +509,7 @@ static TQWidget * find_child( TQWidget * tlw, TQPoint & p ) ((TQWidget*)o)->geometry().contains( p ) && !((TQWidget*)o)->isTopLevel()) { w = (TQWidget *)o; - done = FALSE; + done = false; p = w->mapFromParent( p ); break; } @@ -523,7 +523,7 @@ static TQWidget * find_child( TQWidget * tlw, TQPoint & p ) static bool checkEmbedded(TQWidget* w, const XEvent* xe) { if (!w) - return FALSE; + return false; if (current_embedding_widget != 0 && current_embedding_widget != w) { qt_xdnd_current_target = ((TQExtraWidget*)current_embedding_widget)->extraData()->xDndProxy; @@ -549,10 +549,10 @@ static bool checkEmbedded(TQWidget* w, const XEvent* xe) XSendEvent( TQPaintDevice::x11AppDisplay(), extra->xDndProxy, False, NoEventMask, (XEvent*)xe ); qt_xdnd_current_widget = w; - return TRUE; + return true; } current_embedding_widget = 0; - return FALSE; + return false; } void qt_handle_xdnd_enter( TQWidget *, const XEvent * xe, bool /*passive*/ ) @@ -560,11 +560,11 @@ void qt_handle_xdnd_enter( TQWidget *, const XEvent * xe, bool /*passive*/ ) //if ( !w->neveHadAChildWithDropEventsOn() ) //return; // haven't been set up for dnd - qt_motifdnd_active = FALSE; + qt_motifdnd_active = false; last_enter_event.xclient = xe->xclient; - qt_xdnd_target_answerwas = FALSE; + qt_xdnd_target_answerwas = false; const long *l = xe->xclient.data.l; int version = (int)(((unsigned long)(l[1])) >> 24); @@ -650,7 +650,7 @@ void qt_handle_xdnd_position( TQWidget *w, const XEvent * xe, bool passive ) me.setAction(accepted_action); if ( c != qt_xdnd_current_widget ) { - qt_xdnd_target_answerwas = FALSE; + qt_xdnd_target_answerwas = false; if ( qt_xdnd_current_widget ) { TQDragLeaveEvent e; TQApplication::sendEvent( qt_xdnd_current_widget, &e ); @@ -667,7 +667,7 @@ void qt_handle_xdnd_position( TQWidget *w, const XEvent * xe, bool passive ) if ( !de.isActionAccepted() ) // only as a copy (move if we del) accepted_action = TQDropEvent::Copy; else - me.acceptAction(TRUE); + me.acceptAction(true); } else { me.ignore( de.answerRect() ); } @@ -814,7 +814,7 @@ void qt_xdnd_send_leave() w = 0; if ( w ) - qt_handle_xdnd_leave( w, (const XEvent *)&leave, FALSE ); + qt_handle_xdnd_leave( w, (const XEvent *)&leave, false ); else XSendEvent( TQPaintDevice::x11AppDisplay(), qt_xdnd_current_proxy_target, False, NoEventMask, (XEvent*)&leave ); @@ -862,7 +862,7 @@ void qt_handle_xdnd_drop( TQWidget *, const XEvent * xe, bool passive ) if ( !de.isAccepted() ) { // Ignore a failed drag global_accepted_action = TQDropEvent::Copy; - dndCancelled = TRUE; + dndCancelled = true; } XClientMessageEvent finished; finished.type = ClientMessage; @@ -915,7 +915,7 @@ void TQDragManager::timerEvent( TQTimerEvent* e ) if( updateMode( (ButtonState)qt_x11_translateButtonState( mask ))) qt_xdnd_source_sameanswer = TQRect(); // force move } - need_modifiers_check = TRUE; + need_modifiers_check = true; if( qt_xdnd_source_sameanswer.isNull() ) move( TQCursor::pos() ); } @@ -968,17 +968,17 @@ bool TQDragManager::eventFilter( TQObject * o, TQEvent * e) tqApp->removeEventFilter( this ); object = 0; dragSource = 0; - beingCancelled = FALSE; + beingCancelled = false; tqApp->exit_loop(); - return TRUE; // block the key release + return true; // block the key release } - return FALSE; + return false; } Q_ASSERT( object != 0 ); if ( !o->isWidgetType() ) - return FALSE; + return false; if ( e->type() == TQEvent::MouseMove ) { TQMouseEvent* me = (TQMouseEvent *)e; @@ -986,8 +986,8 @@ bool TQDragManager::eventFilter( TQObject * o, TQEvent * e) updateMode(me->stateAfter()); move( me->globalPos() ); } - need_modifiers_check = FALSE; - return TRUE; + need_modifiers_check = false; + return true; } else if ( e->type() == TQEvent::MouseButtonRelease ) { tqApp->removeEventFilter( this ); if ( willDrop ) @@ -996,21 +996,21 @@ bool TQDragManager::eventFilter( TQObject * o, TQEvent * e) cancel(); object = 0; dragSource = 0; - beingCancelled = FALSE; + beingCancelled = false; tqApp->exit_loop(); - return TRUE; + return true; } else if ( e->type() == TQEvent::DragResponse ) { if ( ((TQDragResponseEvent *)e)->dragAccepted() ) { if ( !willDrop ) { - willDrop = TRUE; + willDrop = true; } } else { if ( willDrop ) { - willDrop = FALSE; + willDrop = false; } } updateCursor(); - return TRUE; + return true; } if ( e->type() == TQEvent::KeyPress @@ -1022,16 +1022,16 @@ bool TQDragManager::eventFilter( TQObject * o, TQEvent * e) tqApp->removeEventFilter( this ); object = 0; dragSource = 0; - beingCancelled = FALSE; + beingCancelled = false; tqApp->exit_loop(); } else { if( updateMode(ke->stateAfter())) { qt_xdnd_source_sameanswer = TQRect(); // force move move( TQCursor::pos() ); } - need_modifiers_check = FALSE; + need_modifiers_check = false; } - return TRUE; // Eat all key events + return true; // Eat all key events } // ### We bind modality to widgets, so we have to do this @@ -1048,9 +1048,9 @@ bool TQDragManager::eventFilter( TQObject * o, TQEvent * e) case TQEvent::Accel: case TQEvent::AccelAvailable: case TQEvent::AccelOverride: - return TRUE; + return true; default: - return FALSE; + return false; } } @@ -1125,7 +1125,7 @@ void TQDragManager::updateCursor() } #ifndef TQT_NO_CURSOR if ( c ) - tqApp->setOverrideCursor( *c, TRUE ); + tqApp->setOverrideCursor( *c, true ); #endif } @@ -1135,7 +1135,7 @@ void TQDragManager::cancel( bool deleteSource ) killTimer( heartbeat ); heartbeat = -1; if ( object ) { - beingCancelled = TRUE; + beingCancelled = true; object = 0; } @@ -1146,7 +1146,7 @@ void TQDragManager::cancel( bool deleteSource ) #ifndef TQT_NO_CURSOR if ( restoreCursor ) { TQApplication::restoreOverrideCursor(); - restoreCursor = FALSE; + restoreCursor = false; } #endif @@ -1156,7 +1156,7 @@ void TQDragManager::cancel( bool deleteSource ) delete qt_xdnd_deco; qt_xdnd_deco = 0; - dndCancelled = TRUE; + dndCancelled = true; } static @@ -1382,7 +1382,7 @@ void TQDragManager::move( const TQPoint & globalPos ) globalPos.y() -2 , 5, 5 ); if ( w ) { - qt_handle_xdnd_enter( w, (const XEvent *)&enter, FALSE ); + qt_handle_xdnd_enter( w, (const XEvent *)&enter, false ); } else if ( target ) { XSendEvent( TQPaintDevice::x11AppDisplay(), proxy_target, False, NoEventMask, (XEvent*)&enter ); @@ -1404,13 +1404,13 @@ void TQDragManager::move( const TQPoint & globalPos ) move.data.l[4] = qtaction_to_xdndaction( global_requested_action ); if ( w ) - qt_handle_xdnd_position( w, (const XEvent *)&move, FALSE ); + qt_handle_xdnd_position( w, (const XEvent *)&move, false ); else XSendEvent( TQPaintDevice::x11AppDisplay(), proxy_target, False, NoEventMask, (XEvent*)&move ); } else { if ( willDrop ) { - willDrop = FALSE; + willDrop = false; updateCursor(); } } @@ -1444,7 +1444,7 @@ void TQDragManager::drop() w = 0; if ( w ) - qt_handle_xdnd_drop( w, (const XEvent *)&drop, FALSE ); + qt_handle_xdnd_drop( w, (const XEvent *)&drop, false ); else XSendEvent( TQPaintDevice::x11AppDisplay(), qt_xdnd_current_proxy_target, False, NoEventMask, (XEvent*)&drop ); @@ -1452,7 +1452,7 @@ void TQDragManager::drop() #ifndef TQT_NO_CURSOR if ( restoreCursor ) { TQApplication::restoreOverrideCursor(); - restoreCursor = FALSE; + restoreCursor = false; } #endif } @@ -1468,7 +1468,7 @@ bool qt_xdnd_handle_badwindow() qt_xdnd_source_object = 0; delete qt_xdnd_deco; qt_xdnd_deco = 0; - return TRUE; + return true; } if ( qt_xdnd_dragsource_xid ) { qt_xdnd_dragsource_xid = 0; @@ -1477,9 +1477,9 @@ bool qt_xdnd_handle_badwindow() TQApplication::sendEvent( qt_xdnd_current_widget, &e ); qt_xdnd_current_widget = 0; } - return TRUE; + return true; } - return FALSE; + return false; } @@ -1501,8 +1501,8 @@ bool qt_xdnd_handle_badwindow() /*! - Returns TRUE if this event provides format \a mimeType; otherwise - returns FALSE. + Returns true if this event provides format \a mimeType; otherwise + returns false. \sa data() */ @@ -1510,17 +1510,17 @@ bool qt_xdnd_handle_badwindow() bool TQDropEvent::provides( const char *mimeType ) const { if ( qt_motifdnd_active && tqstrnicmp( mimeType, "text/", 5 ) == 0 ) - return TRUE; + return true; int n=0; const char* f; do { f = format( n ); if ( !f ) - return FALSE; + return false; n++; } while( tqstricmp( mimeType, f ) ); - return TRUE; + return true; } void qt_xdnd_handle_selection_request( const XSelectionRequestEvent * req ) @@ -1608,14 +1608,14 @@ static TQByteArray qt_xdnd_obtain_data( const char *format ) if ( qt_xclb_read_property( TQPaintDevice::x11AppDisplay(), tw->winId(), - qt_xdnd_selection, TRUE, - &result, 0, &type, 0, FALSE ) ) { + qt_xdnd_selection, true, + &result, 0, &type, 0, false ) ) { if ( type == qt_incr_atom ) { int nbytes = result.size() >= 4 ? *((int*)result.data()) : 0; result = qt_xclb_read_incremental_property( TQPaintDevice::x11AppDisplay(), tw->winId(), qt_xdnd_selection, - nbytes, FALSE ); + nbytes, false ); } else if ( type != *a ) { // (includes None) tqDebug( "TQt clipboard: unknown atom %ld", type); } @@ -1648,7 +1648,7 @@ bool qt_dnd_enable( TQWidget* w, bool on ) if ( on ) { if ( ( (TQExtraWidget*)w)->topData()->dnd ) - return TRUE; // been there, done that + return true; // been there, done that ((TQExtraWidget*)w)->topData()->dnd = 1; } @@ -1734,12 +1734,12 @@ const char* TQDropEvent::format( int n ) const bool TQDragManager::drag( TQDragObject * o, TQDragObject::DragMode mode ) { if ( object == o || !o || !o->parent() ) - return FALSE; + return false; if ( object ) { cancel(); tqApp->removeEventFilter( this ); - beingCancelled = FALSE; + beingCancelled = false; } if ( qt_xdnd_source_object ) { @@ -1772,7 +1772,7 @@ bool TQDragManager::drag( TQDragObject * o, TQDragObject::DragMode mode ) qt_xdnd_source_object->setTarget( 0 ); qt_xdnd_deco = new TQShapedPixmapWidget(); - willDrop = FALSE; + willDrop = false; object = o; updatePixmap(); @@ -1792,16 +1792,16 @@ bool TQDragManager::drag( TQDragObject * o, TQDragObject::DragMode mode ) qt_xdnd_source_sameanswer = TQRect(); move(TQCursor::pos()); heartbeat = startTimer(200); - need_modifiers_check = FALSE; + need_modifiers_check = false; #ifndef TQT_NO_CURSOR tqApp->setOverrideCursor( arrowCursor ); - restoreCursor = TRUE; + restoreCursor = true; updateCursor(); #endif - dndCancelled = FALSE; - qt_xdnd_dragging = TRUE; + dndCancelled = false; + qt_xdnd_dragging = true; if (!TQWidget::mouseGrabber()) qt_xdnd_deco->grabMouse(); @@ -1817,7 +1817,7 @@ bool TQDragManager::drag( TQDragObject * o, TQDragObject::DragMode mode ) killTimer( heartbeat ); heartbeat = -1; qt_xdnd_current_screen = -1; - qt_xdnd_dragging = FALSE; + qt_xdnd_dragging = false; return ((! dndCancelled) && // source del? (global_accepted_action == TQDropEvent::Copy && |
