From c1a7ae2cc680b2f2533e6ba2c190a7fca05eb2e3 Mon Sep 17 00:00:00 2001
From: Alexander Golubev <fatzer2@gmail.com>
Date: Wed, 8 Apr 2026 19:20:03 +0300
Subject: q => tq rebranding: rename qt_* symbols in src/kernel (part 1/2)

All the symbols are internal and shouldn't affect API/ABI.

The rename was done with next script:

  grep -horE '\<qt_\w*' src/kernel/tq[a-e]* | sort -u | \
      sed 's!.*!s/\\<&\\>/t&/g'! > /tmp/qt-rename.sed
  find * -type f -exec sed -i -f /tmp/qt-rename.sed '{}' \+

Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
---
 src/kernel/tqaccel.cpp               |   8 +-
 src/kernel/tqclipboard_x11.cpp       | 112 +++----
 src/kernel/tqdnd_x11.cpp             | 598 +++++++++++++++++------------------
 src/kernel/tqdragobject.cpp          |   8 +-
 src/kernel/tqeventloop_unix.cpp      |  18 +-
 src/kernel/tqeventloop_unix_glib.cpp |  18 +-
 src/kernel/tqeventloop_x11.cpp       |  66 ++--
 src/kernel/tqeventloop_x11_glib.cpp  |  92 +++---
 src/kernel/tqmotifdnd_x11.cpp        |  40 +--
 src/kernel/tqwidget_x11.cpp          |   8 +-
 10 files changed, 484 insertions(+), 484 deletions(-)

diff --git a/src/kernel/tqaccel.cpp b/src/kernel/tqaccel.cpp
index af5b354f5..34b15a5bf 100644
--- a/src/kernel/tqaccel.cpp
+++ b/src/kernel/tqaccel.cpp
@@ -206,11 +206,11 @@ bool TQ_EXPORT tqt_tryComposeUnicode( TQWidget* w, TQKeyEvent*  e){
 }
 
 #ifdef TQ_WS_MAC
-static bool qt_accel_no_shortcuts = true;
+static bool tqt_accel_no_shortcuts = true;
 #else
-static bool qt_accel_no_shortcuts = false;
+static bool tqt_accel_no_shortcuts = false;
 #endif
-void TQ_EXPORT tqt_setAccelAutoShortcuts(bool b) { qt_accel_no_shortcuts = b; }
+void TQ_EXPORT tqt_setAccelAutoShortcuts(bool b) { tqt_accel_no_shortcuts = b; }
 
 /*
     \internal
@@ -865,7 +865,7 @@ void TQAccelPrivate::activateAmbiguously( TQAccelItem* item )
 
 TQKeySequence TQAccel::shortcutKey( const TQString &str )
 {
-    if(qt_accel_no_shortcuts)
+    if(tqt_accel_no_shortcuts)
 	return TQKeySequence();
 
     int p = 0;
diff --git a/src/kernel/tqclipboard_x11.cpp b/src/kernel/tqclipboard_x11.cpp
index 24146be0b..0e7796506 100644
--- a/src/kernel/tqclipboard_x11.cpp
+++ b/src/kernel/tqclipboard_x11.cpp
@@ -96,8 +96,8 @@ extern Atom tqt_selection_sentinel;
 extern Atom tqt_utf8_string;
 
 // from qdnd_x11.cpp
-extern Atom* qt_xdnd_str_to_atom( const char *mimeType );
-extern const char* qt_xdnd_atom_to_str( Atom );
+extern Atom* tqt_xdnd_str_to_atom( const char *mimeType );
+extern const char* tqt_xdnd_atom_to_str( Atom );
 
 
 static int clipboard_timeout = 5000; // 5s timeout on clipboard operations
@@ -114,7 +114,7 @@ static bool pending_selection_changed = false;
 
 TQ_EXPORT bool tqt_qclipboard_bailout_hack = false;
 
-// event capture mechanism for qt_xclb_wait_for_event
+// event capture mechanism for tqt_xclb_wait_for_event
 static bool waiting_for_data = false;
 static bool has_captured_event = false;
 static Window capture_event_win = None;
@@ -287,7 +287,7 @@ static TransactionMap *transactions = 0;
 static QX11EventFilter prev_x11_event_filter = 0;
 static int incr_timer_id = 0;
 
-static int qt_xclb_transation_event_handler(XEvent *event)
+static int tqt_xclb_transation_event_handler(XEvent *event)
 {
     TransactionMap::Iterator it = transactions->find(event->xany.window);
     if (it != transactions->end()) {
@@ -304,7 +304,7 @@ static int qt_xclb_transation_event_handler(XEvent *event)
   milliseconds... we assume that all unfinished transactions have
   timed out and remove everything from the transaction map
 */
-static void qt_xclb_incr_timeout(void)
+static void tqt_xclb_incr_timeout(void)
 {
     tqWarning("TQClipboard: timed out while sending data");
 
@@ -323,7 +323,7 @@ TQClipboardINCRTransaction::TQClipboardINCRTransaction(Window w, Atom p, Atom t,
     if (! transactions) {
 	VTQDEBUG("TQClipboard: created INCR transaction map");
 	transactions = new TransactionMap;
-	prev_x11_event_filter = tqt_set_x11_event_filter(qt_xclb_transation_event_handler);
+	prev_x11_event_filter = tqt_set_x11_event_filter(tqt_xclb_transation_event_handler);
 
 	incr_timer_id = TQApplication::clipboard()->startTimer(clipboard_timeout);
     }
@@ -443,8 +443,8 @@ bool TQClipboard::selectionModeEnabled() const
 
 
 // event filter function... captures interesting events while
-// qt_xclb_wait_for_event is running the event loop
-static int qt_xclb_event_filter(XEvent *event)
+// tqt_xclb_wait_for_event is running the event loop
+static int tqt_xclb_event_filter(XEvent *event)
 {
     if (event->xany.type == capture_event_type &&
 	event->xany.window == capture_event_win) {
@@ -474,7 +474,7 @@ static Bool check_selection_request_pending( Display*, XEvent* e, XPointer )
     return False;
     }
 
-bool qt_xclb_wait_for_event( Display *dpy, Window win, int type, XEvent *event,
+bool tqt_xclb_wait_for_event( Display *dpy, Window win, int type, XEvent *event,
 			     int timeout )
 {
     TQTime started = TQTime::currentTime();
@@ -482,14 +482,14 @@ bool qt_xclb_wait_for_event( Display *dpy, Window win, int type, XEvent *event,
 
     if (tqApp->eventLoop()->inherits("TQMotif")) { // yes yes, evil hack, we know
         if ( waiting_for_data )
-            tqFatal( "TQClipboard: internal error, qt_xclb_wait_for_event recursed" );
+            tqFatal( "TQClipboard: internal error, tqt_xclb_wait_for_event recursed" );
 
         waiting_for_data = true;
         has_captured_event = false;
         capture_event_win = win;
         capture_event_type = type;
 
-        QX11EventFilter old_event_filter = tqt_set_x11_event_filter(qt_xclb_event_filter);
+        QX11EventFilter old_event_filter = tqt_set_x11_event_filter(tqt_xclb_event_filter);
 
         do {
             if ( XCheckTypedWindowEvent(dpy,win,type,event) ) {
@@ -564,7 +564,7 @@ static inline int maxSelectionIncr( Display *dpy )
 
 // uglyhack: externed into tqdnd_x11.cpp. qt is really not designed for
 // single-platform, multi-purpose blocks of code...
-bool qt_xclb_read_property( Display *dpy, Window win, Atom property,
+bool tqt_xclb_read_property( Display *dpy, Window win, Atom property,
 			   bool deleteProperty,
 			   TQByteArray *buffer, int *size, Atom *type,
 			   int *format, bool nullterm )
@@ -648,7 +648,7 @@ bool qt_xclb_read_property( Display *dpy, Window win, Atom property,
 	    XFree( (char*)data );
 	}
 
- 	static Atom xa_compound_text = *qt_xdnd_str_to_atom( "COMPOUND_TEXT" );
+	static Atom xa_compound_text = *tqt_xdnd_str_to_atom( "COMPOUND_TEXT" );
  	if ( *format == 8 && *type == xa_compound_text ) {
 	    // convert COMPOUND_TEXT to a multibyte string
  	    XTextProperty textprop;
@@ -691,9 +691,9 @@ bool qt_xclb_read_property( Display *dpy, Window win, Atom property,
 
 
 // this is externed into tqdnd_x11.cpp too.
-TQByteArray qt_xclb_read_incremental_property( Display *dpy, Window win,
-					      Atom property, int nbytes,
-					      bool nullterm )
+TQByteArray tqt_xclb_read_incremental_property( Display *dpy, Window win,
+					        Atom property, int nbytes,
+					        bool nullterm )
 {
     XEvent event;
 
@@ -712,12 +712,12 @@ TQByteArray qt_xclb_read_incremental_property( Display *dpy, Window win,
 
     for (;;) {
 	XFlush( dpy );
-	if ( !qt_xclb_wait_for_event(dpy,win,PropertyNotify,&event,clipboard_timeout) )
+	if ( !tqt_xclb_wait_for_event(dpy,win,PropertyNotify,&event,clipboard_timeout) )
 	    break;
 	if ( event.xproperty.atom != property ||
 	     event.xproperty.state != PropertyNewValue )
 	    continue;
-	if ( qt_xclb_read_property(dpy, win, property, true, &tmp_buf,
+	if ( tqt_xclb_read_property(dpy, win, property, true, &tmp_buf,
 				   &length,0, 0, false) ) {
 	    if ( length == 0 ) {		// no more data, we're done
 		if ( nullterm ) {
@@ -771,13 +771,13 @@ static Atom send_targets_selection(TQClipboardData *d, Window window, Atom prope
     const char *fmt;
     int n = 0;
     while ((fmt=d->source()->format(n)) && n < atoms)
-	atarget[n++] = *qt_xdnd_str_to_atom(fmt);
+	atarget[n++] = *tqt_xdnd_str_to_atom(fmt);
 
-    static Atom xa_text = *qt_xdnd_str_to_atom("TEXT");
-    static Atom xa_compound_text = *qt_xdnd_str_to_atom("COMPOUND_TEXT");
-    static Atom xa_targets = *qt_xdnd_str_to_atom("TARGETS");
-    static Atom xa_multiple = *qt_xdnd_str_to_atom("MULTIPLE");
-    static Atom xa_timestamp = *qt_xdnd_str_to_atom("TIMESTAMP");
+    static Atom xa_text = *tqt_xdnd_str_to_atom("TEXT");
+    static Atom xa_compound_text = *tqt_xdnd_str_to_atom("COMPOUND_TEXT");
+    static Atom xa_targets = *tqt_xdnd_str_to_atom("TARGETS");
+    static Atom xa_multiple = *tqt_xdnd_str_to_atom("MULTIPLE");
+    static Atom xa_timestamp = *tqt_xdnd_str_to_atom("TIMESTAMP");
 
     if (d->source()->provides("image/ppm"))
 	atarget[n++] = XA_PIXMAP;
@@ -797,7 +797,7 @@ static Atom send_targets_selection(TQClipboardData *d, Window window, Atom prope
 #if defined(TQCLIPBOARD_DEBUG_VERBOSE)
     for (int index = 0; index < n; index++) {
 	VTQDEBUG("    atom %d: 0x%lx (%s)", index, atarget[index],
-	       qt_xdnd_atom_to_str(atarget[index]));
+	       tqt_xdnd_atom_to_str(atarget[index]));
     }
 #endif
 
@@ -808,13 +808,13 @@ static Atom send_targets_selection(TQClipboardData *d, Window window, Atom prope
 
 static Atom send_string_selection(TQClipboardData *d, Atom target, Window window, Atom property)
 {
-    static Atom xa_text = *qt_xdnd_str_to_atom("TEXT");
-    static Atom xa_compound_text = *qt_xdnd_str_to_atom("COMPOUND_TEXT");
+    static Atom xa_text = *tqt_xdnd_str_to_atom("TEXT");
+    static Atom xa_compound_text = *tqt_xdnd_str_to_atom("COMPOUND_TEXT");
 
     TQDEBUG("TQClipboard: send_string_selection():\n"
 	  "    property type %lx\n"
 	  "    property name '%s'",
-	  target, qt_xdnd_atom_to_str(target));
+	  target, tqt_xdnd_atom_to_str(target));
 
     if (target == xa_text || target == xa_compound_text) {
 	// the ICCCM states that TEXT and COMPOUND_TEXT are in the
@@ -834,7 +834,7 @@ static Atom send_string_selection(TQClipboardData *d, Atom target, Window window
 		  "    textprop name '%s'\n"
 		  "    format %d\n"
 		  "    %ld items",
-		  textprop.encoding, qt_xdnd_atom_to_str(textprop.encoding),
+		  textprop.encoding, tqt_xdnd_atom_to_str(textprop.encoding),
 		  textprop.format, textprop.nitems);
 
 	    int sz = sizeof_format(textprop.format);
@@ -903,7 +903,7 @@ static Atom send_selection(TQClipboardData *d, Atom target, Window window, Atom
     if (format == 0) format = 8;
 
     if (data.isEmpty()) {
-	const char *fmt = qt_xdnd_atom_to_str(target);
+	const char *fmt = tqt_xdnd_atom_to_str(target);
 	TQDEBUG("TQClipboard: send_selection(): converting to type '%s'", fmt);
 	if (fmt && !d->source()->provides(fmt)) // Not a MIME type we can produce
 	    return None;
@@ -915,11 +915,11 @@ static Atom send_selection(TQClipboardData *d, Atom target, Window window, Atom
 	  "    property name '%s'\n"
 	  "    format %d\n"
 	  "    %d bytes",
-	  target, qt_xdnd_atom_to_str(target), format, data.size());
+	  target, tqt_xdnd_atom_to_str(target), format, data.size());
 
     // don't allow INCR transfers when using MULTIPLE or to
     // Motif clients (since Motif doesn't support INCR)
-    static Atom motif_clip_temporary = *qt_xdnd_str_to_atom("CLIP_TEMPORARY");
+    static Atom motif_clip_temporary = *tqt_xdnd_str_to_atom("CLIP_TEMPORARY");
     bool allow_incr = property != motif_clip_temporary;
 
     // X_ChangeProperty protocol request is 24 bytes
@@ -1001,7 +1001,7 @@ bool TQClipboard::event( TQEvent *e )
 	    killTimer(incr_timer_id);
 	    incr_timer_id = 0;
 
-	    qt_xclb_incr_timeout();
+	    tqt_xclb_incr_timeout();
 
 	    return true;
 	} else {
@@ -1098,9 +1098,9 @@ bool TQClipboard::event( TQEvent *e )
 		  "    selection 0x%lx (%s) target 0x%lx (%s)",
 		  req->requestor,
 		  req->selection,
-		  qt_xdnd_atom_to_str(req->selection),
+		  tqt_xdnd_atom_to_str(req->selection),
 		  req->target,
-		  qt_xdnd_atom_to_str(req->target));
+		  tqt_xdnd_atom_to_str(req->target));
 
 	    TQClipboardData *d;
 
@@ -1136,11 +1136,11 @@ bool TQClipboard::event( TQEvent *e )
 		break;
 	    }
 
-	    static Atom xa_text = *qt_xdnd_str_to_atom("TEXT");
-	    static Atom xa_compound_text = *qt_xdnd_str_to_atom("COMPOUND_TEXT");
-	    static Atom xa_targets = *qt_xdnd_str_to_atom("TARGETS");
-	    static Atom xa_multiple = *qt_xdnd_str_to_atom("MULTIPLE");
-	    static Atom xa_timestamp = *qt_xdnd_str_to_atom("TIMESTAMP");
+	    static Atom xa_text = *tqt_xdnd_str_to_atom("TEXT");
+	    static Atom xa_compound_text = *tqt_xdnd_str_to_atom("COMPOUND_TEXT");
+	    static Atom xa_targets = *tqt_xdnd_str_to_atom("TARGETS");
+	    static Atom xa_multiple = *tqt_xdnd_str_to_atom("MULTIPLE");
+	    static Atom xa_timestamp = *tqt_xdnd_str_to_atom("TIMESTAMP");
 
 	    struct AtomPair { Atom target; Atom property; } *multi = 0;
 	    Atom multi_type = None;
@@ -1152,7 +1152,7 @@ bool TQClipboard::event( TQEvent *e )
 	    if ( req->target == xa_multiple ) {
 		TQByteArray multi_data;
 		if (req->property == None
-		    || !qt_xclb_read_property(dpy, req->requestor, req->property,
+		    || !tqt_xclb_read_property(dpy, req->requestor, req->property,
 					      false, &multi_data, 0, &multi_type, &multi_format, 0)
 		    || multi_format != 32) {
 		    // MULTIPLE property not formatted correctly
@@ -1236,7 +1236,7 @@ bool TQClipboard::event( TQEvent *e )
 	    TQDEBUG("TQClipboard: SelectionNotify to 0x%lx\n"
 		  "    property 0x%lx (%s)",
 		  req->requestor, event.xselection.property,
-		  qt_xdnd_atom_to_str(event.xselection.property));
+		  tqt_xdnd_atom_to_str(event.xselection.property));
 	}
 	break;
     }
@@ -1302,13 +1302,13 @@ const char* TQClipboardWatcher::format( int n ) const
 	// get the list of targets from the current clipboard owner - we do this
 	// once so that multiple calls to this function don't require multiple
 	// server round trips...
-	static Atom xa_targets = *qt_xdnd_str_to_atom( "TARGETS" );
+	static Atom xa_targets = *tqt_xdnd_str_to_atom( "TARGETS" );
 
 	TQByteArray ba = getDataInFormat(xa_targets);
 	if (ba.size() > 0) {
 	    Atom *unsorted_target = (Atom *) ba.data();
-	    static Atom xa_text = *qt_xdnd_str_to_atom( "TEXT" );
-	    static Atom xa_compound_text = *qt_xdnd_str_to_atom( "COMPOUND_TEXT" );
+	    static Atom xa_text = *tqt_xdnd_str_to_atom( "TEXT" );
+	    static Atom xa_compound_text = *tqt_xdnd_str_to_atom( "COMPOUND_TEXT" );
 	    int i, size = ba.size() / sizeof(Atom);
 
 	    // sort TARGETS to prefer some types over others.  some apps
@@ -1333,7 +1333,7 @@ const char* TQClipboardWatcher::format( int n ) const
 	    for (i = 0; i < size + 4; ++i) {
 		if ( target[i] == 0 ) continue;
 
-		VTQDEBUG("    format: %s", qt_xdnd_atom_to_str(target[i]));
+		VTQDEBUG("    format: %s", tqt_xdnd_atom_to_str(target[i]));
 
 		if ( target[i] == XA_PIXMAP )
 		    formatList.append("image/ppm");
@@ -1345,7 +1345,7 @@ const char* TQClipboardWatcher::format( int n ) const
 			  target[i] == xa_compound_text )
 		    formatList.append( "text/plain" );
 		else
-		    formatList.append(qt_xdnd_atom_to_str(target[i]));
+		    formatList.append(tqt_xdnd_atom_to_str(target[i]));
 	    }
 	    delete []target;
 
@@ -1375,9 +1375,9 @@ TQByteArray TQClipboardWatcher::encodedData( const char* fmt ) const
 	fmtatom = XA_STRING;
     } else if ( 0==tqstricmp(fmt,"text/plain;charset=utf-8") ) {
 	// proprosed UTF8_STRING conversion type
-	fmtatom = *qt_xdnd_str_to_atom( "UTF8_STRING" );
+	fmtatom = *tqt_xdnd_str_to_atom( "UTF8_STRING" );
     } else if ( 0==qstrcmp(fmt,"text/plain") ) {
-   	fmtatom = *qt_xdnd_str_to_atom( "COMPOUND_TEXT" );
+	fmtatom = *tqt_xdnd_str_to_atom( "COMPOUND_TEXT" );
     } else if ( 0==qstrcmp(fmt,"image/ppm") ) {
 	fmtatom = XA_PIXMAP;
 	TQByteArray pmd = getDataInFormat(fmtatom);
@@ -1410,10 +1410,10 @@ TQByteArray TQClipboardWatcher::encodedData( const char* fmt ) const
 	    iio.write();
 	    return buf.buffer();
 	} else {
-	    fmtatom = *qt_xdnd_str_to_atom(fmt);
+	    fmtatom = *tqt_xdnd_str_to_atom(fmt);
 	}
     } else {
-	fmtatom = *qt_xdnd_str_to_atom(fmt);
+	fmtatom = *tqt_xdnd_str_to_atom(fmt);
     }
     return getDataInFormat(fmtatom);
 }
@@ -1426,7 +1426,7 @@ TQByteArray TQClipboardWatcher::getDataInFormat(Atom fmtatom) const
     Window   win = requestor->winId();
 
     TQDEBUG("TQClipboardWatcher::getDataInFormat: selection '%s' format '%s'",
-	  qt_xdnd_atom_to_str(atom), qt_xdnd_atom_to_str(fmtatom));
+	  tqt_xdnd_atom_to_str(atom), tqt_xdnd_atom_to_str(fmtatom));
 
     XSelectInput(dpy, win, NoEventMask); // don't listen for any events
 
@@ -1437,7 +1437,7 @@ TQByteArray TQClipboardWatcher::getDataInFormat(Atom fmtatom) const
     VTQDEBUG("TQClipboardWatcher::getDataInFormat: waiting for SelectionNotify event");
 
     XEvent xevent;
-    if ( !qt_xclb_wait_for_event(dpy,win,SelectionNotify,&xevent,clipboard_timeout) ||
+    if ( !tqt_xclb_wait_for_event(dpy,win,SelectionNotify,&xevent,clipboard_timeout) ||
 	 xevent.xselection.property == None ) {
 	TQDEBUG("TQClipboardWatcher::getDataInFormat: format not available");
 	return buf;
@@ -1448,11 +1448,11 @@ TQByteArray TQClipboardWatcher::getDataInFormat(Atom fmtatom) const
     Atom   type;
     XSelectInput(dpy, win, PropertyChangeMask);
 
-    if ( qt_xclb_read_property(dpy,win,tqt_selection_property,true,
+    if ( tqt_xclb_read_property(dpy,win,tqt_selection_property,true,
 			       &buf,0,&type,0,false) ) {
 	if ( type == tqt_x_incr ) {
 	    int nbytes = buf.size() >= 4 ? *((int*)buf.data()) : 0;
-	    buf = qt_xclb_read_incremental_property( dpy, win,
+	    buf = tqt_xclb_read_incremental_property( dpy, win,
 						     tqt_selection_property,
 						     nbytes, false );
 	}
@@ -1557,7 +1557,7 @@ void TQClipboard::setData( TQMimeSource* src, Mode mode )
     if (XGetSelectionOwner(dpy, atom) != newOwner) {
 #ifdef QT_CHECK_STATE
 	tqWarning("TQClipboard::setData: Cannot set X11 selection owner for %s",
-		 qt_xdnd_atom_to_str(atom));
+		 tqt_xdnd_atom_to_str(atom));
 #endif // QT_CHECK_STATE
 
 	d->clear();
diff --git a/src/kernel/tqdnd_x11.cpp b/src/kernel/tqdnd_x11.cpp
index 4214616df..fcddda85e 100644
--- a/src/kernel/tqdnd_x11.cpp
+++ b/src/kernel/tqdnd_x11.cpp
@@ -88,15 +88,15 @@ extern Time tqt_x_user_time;
 
 // this stuff is copied from qclb_x11.cpp
 
-extern bool qt_xclb_wait_for_event( Display *dpy, Window win, int type,
-				    XEvent *event, int timeout );
-extern bool qt_xclb_read_property( Display *dpy, Window win, Atom property,
-				   bool deleteProperty,
-				   TQByteArray *buffer, int *size, Atom *type,
-				   int *format, bool nullterm );
-extern TQByteArray qt_xclb_read_incremental_property( Display *dpy, Window win,
-						     Atom property,
-						     int nbytes, bool nullterm );
+extern bool tqt_xclb_wait_for_event( Display *dpy, Window win, int type,
+				     XEvent *event, int timeout );
+extern bool tqt_xclb_read_property( Display *dpy, Window win, Atom property,
+				    bool deleteProperty,
+				    TQByteArray *buffer, int *size, Atom *type,
+				    int *format, bool nullterm );
+extern TQByteArray tqt_xclb_read_incremental_property( Display *dpy, Window win,
+						       Atom property,
+						       int nbytes, bool nullterm );
 // and all this stuff is copied -into- qapp_x11.cpp
 
 void tqt_xdnd_setup();
@@ -115,8 +115,8 @@ Atom tqt_xdnd_status;
 Atom tqt_xdnd_leave;
 Atom tqt_xdnd_drop;
 Atom tqt_xdnd_finished;
-Atom qt_xdnd_type_list;
-const int qt_xdnd_version = 4;
+Atom tqt_xdnd_type_list;
+const int tqt_xdnd_version = 4;
 
 extern int tqt_x11_translateButtonState( int s );
 
@@ -125,18 +125,18 @@ extern int tqt_x11_translateButtonState( int s );
 // The Xdnd spec allows for user-defined actions. This could be implemented
 // with a registration process in TQt. WE SHOULD do that later.
 //
-Atom qt_xdnd_action_copy;
-Atom qt_xdnd_action_link;
-Atom qt_xdnd_action_move;
-Atom qt_xdnd_action_private;
+Atom tqt_xdnd_action_copy;
+Atom tqt_xdnd_action_link;
+Atom tqt_xdnd_action_move;
+Atom tqt_xdnd_action_private;
 static
 TQDropEvent::Action xdndaction_to_qtaction(Atom atom)
 {
-    if ( atom == qt_xdnd_action_copy || atom == 0 )
+    if ( atom == tqt_xdnd_action_copy || atom == 0 )
 	return TQDropEvent::Copy;
-    if ( atom == qt_xdnd_action_link )
+    if ( atom == tqt_xdnd_action_link )
 	return TQDropEvent::Link;
-    if ( atom == qt_xdnd_action_move )
+    if ( atom == tqt_xdnd_action_move )
 	return TQDropEvent::Move;
     return TQDropEvent::Private;
 }
@@ -145,81 +145,81 @@ int qtaction_to_xdndaction(TQDropEvent::Action a)
 {
     switch ( a ) {
       case TQDropEvent::Copy:
-	return qt_xdnd_action_copy;
+	return tqt_xdnd_action_copy;
       case TQDropEvent::Link:
-	return qt_xdnd_action_link;
+	return tqt_xdnd_action_link;
       case TQDropEvent::Move:
-	return qt_xdnd_action_move;
+	return tqt_xdnd_action_move;
       case TQDropEvent::Private:
-	return qt_xdnd_action_private;
+	return tqt_xdnd_action_private;
       default:
-	return qt_xdnd_action_copy;
+	return tqt_xdnd_action_copy;
     }
 }
 
 // clean up the stuff used.
-static void qt_xdnd_cleanup();
+static void tqt_xdnd_cleanup();
 
-static void qt_xdnd_send_leave();
+static void tqt_xdnd_send_leave();
 
 // XDND selection
 Atom tqt_xdnd_selection;
 // other selection
 static Atom tqt_selection_property;
 // INCR
-static Atom qt_incr_atom;
+static Atom tqt_incr_atom;
 
 // properties for XDND drop sites
-Atom qt_xdnd_aware;
-Atom qt_xdnd_proxy;
+Atom tqt_xdnd_aware;
+Atom tqt_xdnd_proxy;
 
 // real variables:
 // xid of current drag source
-static Atom qt_xdnd_dragsource_xid = 0;
+static Atom tqt_xdnd_dragsource_xid = 0;
 
 // the types in this drop. 100 is no good, but at least it's big.
-const int qt_xdnd_max_type = 100;
-static Atom qt_xdnd_types[qt_xdnd_max_type];
+const int tqt_xdnd_max_type = 100;
+static Atom tqt_xdnd_types[tqt_xdnd_max_type];
 
-static TQIntDict<TQCString> * qt_xdnd_drag_types = 0;
-static TQDict<Atom> * qt_xdnd_atom_numbers = 0;
+static TQIntDict<TQCString> * tqt_xdnd_drag_types = 0;
+static TQDict<Atom> * tqt_xdnd_atom_numbers = 0;
 
 // timer used when target wants "continuous" move messages (eg. scroll)
 static int heartbeat = -1;
 // rectangle in which the answer will be the same
-static TQRect qt_xdnd_source_sameanswer;
-//static TQRect qt_xdnd_target_sameanswer;
-static bool qt_xdnd_target_answerwas;
+static TQRect tqt_xdnd_source_sameanswer;
+//static TQRect tqt_xdnd_target_sameanswer;
+static bool tqt_xdnd_target_answerwas;
 // top-level window we sent position to last.
-static Window qt_xdnd_current_target;
-// window to send events to (always valid if qt_xdnd_current_target)
-static Window qt_xdnd_current_proxy_target;
+static Window tqt_xdnd_current_target;
+// window to send events to (always valid if tqt_xdnd_current_target)
+static Window tqt_xdnd_current_proxy_target;
 // widget we forwarded position to last, and local position
-static TQGuardedPtr<TQWidget> qt_xdnd_current_widget;
-static TQPoint qt_xdnd_current_position;
+static TQGuardedPtr<TQWidget> tqt_xdnd_current_widget;
+static TQPoint tqt_xdnd_current_position;
 // time of this drop, as type Atom to save on casts
-static Atom qt_xdnd_source_current_time;
+static Atom tqt_xdnd_source_current_time;
 // timestamp from the XdndPosition and XdndDrop
-static Time qt_xdnd_target_current_time;
+static Time tqt_xdnd_target_current_time;
 // screen number containing the pointer... -1 means default
-static int qt_xdnd_current_screen = -1;
+static int tqt_xdnd_current_screen = -1;
 // state of dragging... true if dragging, false if not
 bool tqt_xdnd_dragging = false;
 // need to check state of keyboard modifiers
 static bool need_modifiers_check = false;
 
 // dict of payload data, sorted by type atom
-static TQIntDict<TQByteArray> * qt_xdnd_target_data = 0;
+static TQIntDict<TQByteArray> * tqt_xdnd_target_data = 0;
 
 // first drag object, or 0
-static TQDragObject * qt_xdnd_source_object = 0;
+static TQDragObject * tqt_xdnd_source_object = 0;
 
 // Motif dnd
-extern void qt_motifdnd_enable( TQWidget *, bool );
-extern TQByteArray qt_motifdnd_obtain_data( const char *format );
-extern const char *qt_motifdnd_format( int n );
+extern void tqt_motifdnd_enable( TQWidget *, bool );
+extern TQByteArray tqt_motifdnd_obtain_data( const char *format );
+extern const char *tqt_motifdnd_format( int n );
 
-bool qt_motifdnd_active = false;
+bool tqt_motifdnd_active = false;
 static bool dndCancelled = false;
 
 // Shift/Ctrl handling, and final drop status
@@ -306,7 +306,7 @@ private:
     TQPoint oldhot;
 };
 
-static TQShapedPixmapWidget * qt_xdnd_deco = 0;
+static TQShapedPixmapWidget * tqt_xdnd_deco = 0;
 
 static TQWidget* desktop_proxy = 0;
 
@@ -318,7 +318,7 @@ public:
 };
 
 
-static bool qt_xdnd_enable( TQWidget* w, bool on )
+static bool tqt_xdnd_enable( TQWidget* w, bool on )
 {
     if ( on ) {
 	TQWidget * xdnd_widget = 0;
@@ -333,7 +333,7 @@ static bool qt_xdnd_enable( TQWidget* w, bool on )
 	    unsigned long n, a;
 	    WId *proxy_id_ptr;
 	    XGetWindowProperty( w->x11Display(), w->winId(),
-		qt_xdnd_proxy, 0, 1, False,
+		tqt_xdnd_proxy, 0, 1, False,
 		XA_WINDOW, &type, &f,&n,&a,(uchar**)&proxy_id_ptr );
 	    WId proxy_id = 0;
 	    if ( type == XA_WINDOW && proxy_id_ptr ) {
@@ -343,7 +343,7 @@ static bool qt_xdnd_enable( TQWidget* w, bool on )
 		// Already exists. Real?
 		tqt_ignore_badwindow();
 		XGetWindowProperty( w->x11Display(), proxy_id,
-		    qt_xdnd_proxy, 0, 1, False,
+		    tqt_xdnd_proxy, 0, 1, False,
 		    XA_WINDOW, &type, &f,&n,&a,(uchar**)&proxy_id_ptr );
 		if ( tqt_badwindow() || type != XA_WINDOW || !proxy_id_ptr || *proxy_id_ptr != proxy_id ) {
 		    // Bogus - we will overwrite.
@@ -357,11 +357,11 @@ static bool qt_xdnd_enable( TQWidget* w, bool on )
 		xdnd_widget = desktop_proxy = new TQWidget;
 		proxy_id = desktop_proxy->winId();
 		XChangeProperty ( w->x11Display(),
-		    w->winId(), qt_xdnd_proxy,
+		    w->winId(), tqt_xdnd_proxy,
 		    XA_WINDOW, 32, PropModeReplace,
 		    (unsigned char *)&proxy_id, 1 );
 		XChangeProperty ( w->x11Display(),
-		    proxy_id, qt_xdnd_proxy,
+		    proxy_id, tqt_xdnd_proxy,
 		    XA_WINDOW, 32, PropModeReplace,
 		    (unsigned char *)&proxy_id, 1 );
 	    }
@@ -371,9 +371,9 @@ static bool qt_xdnd_enable( TQWidget* w, bool on )
 	    xdnd_widget = w->topLevelWidget();
 	}
 	if ( xdnd_widget ) {
-	    Atom atm = (Atom)qt_xdnd_version;
+	    Atom atm = (Atom)tqt_xdnd_version;
 	    XChangeProperty ( xdnd_widget->x11Display(), xdnd_widget->winId(),
-			      qt_xdnd_aware, XA_ATOM, 32, PropModeReplace,
+			      tqt_xdnd_aware, XA_ATOM, 32, PropModeReplace,
 			      (unsigned char *)&atm, 1 );
 	    return true;
 	} else {
@@ -382,7 +382,7 @@ static bool qt_xdnd_enable( TQWidget* w, bool on )
     } else {
 	if ( w->isDesktop() ) {
 	    XDeleteProperty( w->x11Display(), w->winId(),
-			     qt_xdnd_proxy );
+			     tqt_xdnd_proxy );
 	    delete desktop_proxy;
 	    desktop_proxy = 0;
 	}
@@ -390,47 +390,47 @@ static bool qt_xdnd_enable( TQWidget* w, bool on )
     }
 }
 
-const char* qt_xdnd_atom_to_str( Atom a )
+const char* tqt_xdnd_atom_to_str( Atom a )
 {
     if ( !a ) return 0;
 
     if ( a == XA_STRING )
 	return "text/plain"; // some Xdnd clients are dumb
 
-    if ( !qt_xdnd_drag_types ) {
-	qt_xdnd_drag_types = new TQIntDict<TQCString>( 17 );
-	qt_xdnd_drag_types->setAutoDelete( true );
+    if ( !tqt_xdnd_drag_types ) {
+	tqt_xdnd_drag_types = new TQIntDict<TQCString>( 17 );
+	tqt_xdnd_drag_types->setAutoDelete( true );
     }
     TQCString* result;
-    if ( !(result=qt_xdnd_drag_types->find( a )) ) {
+    if ( !(result=tqt_xdnd_drag_types->find( a )) ) {
 	const char* mimeType = XGetAtomName( TQPaintDevice::x11AppDisplay(), a );
 	if ( !mimeType )
 	    return 0; // only happens on protocol error
 	result = new TQCString( mimeType );
-	qt_xdnd_drag_types->insert( (long)a, result );
+	tqt_xdnd_drag_types->insert( (long)a, result );
 	XFree((void*)mimeType);
     }
     return *result;
 }
 
-Atom* qt_xdnd_str_to_atom( const char *mimeType )
+Atom* tqt_xdnd_str_to_atom( const char *mimeType )
 {
     if ( !mimeType || !*mimeType )
 	return 0;
-    if ( !qt_xdnd_atom_numbers ) {
-	qt_xdnd_atom_numbers = new TQDict<Atom>( 17 );
-	qt_xdnd_atom_numbers->setAutoDelete( true );
+    if ( !tqt_xdnd_atom_numbers ) {
+	tqt_xdnd_atom_numbers = new TQDict<Atom>( 17 );
+	tqt_xdnd_atom_numbers->setAutoDelete( true );
     }
 
     Atom * result;
-    if ( (result = qt_xdnd_atom_numbers->find( mimeType )) )
+    if ( (result = tqt_xdnd_atom_numbers->find( mimeType )) )
 	return result;
 
     result = new Atom;
     *result = 0;
     tqt_x11_intern_atom( mimeType, result );
-    qt_xdnd_atom_numbers->insert( mimeType, result );
-    qt_xdnd_atom_to_str( *result );
+    tqt_xdnd_atom_numbers->insert( mimeType, result );
+    tqt_xdnd_atom_to_str( *result );
 
     return result;
 }
@@ -444,34 +444,34 @@ void tqt_xdnd_setup() {
     tqt_x11_intern_atom( "XdndLeave", &tqt_xdnd_leave );
     tqt_x11_intern_atom( "XdndDrop", &tqt_xdnd_drop );
     tqt_x11_intern_atom( "XdndFinished", &tqt_xdnd_finished );
-    tqt_x11_intern_atom( "XdndTypeList", &qt_xdnd_type_list );
+    tqt_x11_intern_atom( "XdndTypeList", &tqt_xdnd_type_list );
 
     tqt_x11_intern_atom( "XdndSelection", &tqt_xdnd_selection );
 
-    tqt_x11_intern_atom( "XdndAware", &qt_xdnd_aware );
-    tqt_x11_intern_atom( "XdndProxy", &qt_xdnd_proxy );
+    tqt_x11_intern_atom( "XdndAware", &tqt_xdnd_aware );
+    tqt_x11_intern_atom( "XdndProxy", &tqt_xdnd_proxy );
 
 
-    tqt_x11_intern_atom( "XdndActionCopy", &qt_xdnd_action_copy );
-    tqt_x11_intern_atom( "XdndActionLink", &qt_xdnd_action_link );
-    tqt_x11_intern_atom( "XdndActionMove", &qt_xdnd_action_move );
-    tqt_x11_intern_atom( "XdndActionPrivate", &qt_xdnd_action_private );
+    tqt_x11_intern_atom( "XdndActionCopy", &tqt_xdnd_action_copy );
+    tqt_x11_intern_atom( "XdndActionLink", &tqt_xdnd_action_link );
+    tqt_x11_intern_atom( "XdndActionMove", &tqt_xdnd_action_move );
+    tqt_x11_intern_atom( "XdndActionPrivate", &tqt_xdnd_action_private );
 
     tqt_x11_intern_atom( "QT_SELECTION", &tqt_selection_property );
-    tqt_x11_intern_atom( "INCR", &qt_incr_atom );
+    tqt_x11_intern_atom( "INCR", &tqt_incr_atom );
 
-    tqAddPostRoutine( qt_xdnd_cleanup );
+    tqAddPostRoutine( tqt_xdnd_cleanup );
 }
 
 
-void qt_xdnd_cleanup()
+void tqt_xdnd_cleanup()
 {
-    delete qt_xdnd_drag_types;
-    qt_xdnd_drag_types = 0;
-    delete qt_xdnd_atom_numbers;
-    qt_xdnd_atom_numbers = 0;
-    delete qt_xdnd_target_data;
-    qt_xdnd_target_data = 0;
+    delete tqt_xdnd_drag_types;
+    tqt_xdnd_drag_types = 0;
+    delete tqt_xdnd_atom_numbers;
+    tqt_xdnd_atom_numbers = 0;
+    delete tqt_xdnd_target_data;
+    tqt_xdnd_target_data = 0;
     delete noDropCursor;
     noDropCursor = 0;
     delete copyCursor;
@@ -526,11 +526,11 @@ static bool checkEmbedded(TQWidget* w, const XEvent* xe)
 	return false;
 
     if (current_embedding_widget != 0 && current_embedding_widget != w) {
-	qt_xdnd_current_target = ((TQExtraWidget*)current_embedding_widget)->extraData()->xDndProxy;
-	qt_xdnd_current_proxy_target = qt_xdnd_current_target;
-	qt_xdnd_send_leave();
-	qt_xdnd_current_target = 0;
-	qt_xdnd_current_proxy_target = 0;
+	tqt_xdnd_current_target = ((TQExtraWidget*)current_embedding_widget)->extraData()->xDndProxy;
+	tqt_xdnd_current_proxy_target = tqt_xdnd_current_target;
+	tqt_xdnd_send_leave();
+	tqt_xdnd_current_target = 0;
+	tqt_xdnd_current_proxy_target = 0;
 	current_embedding_widget = 0;
     }
 
@@ -548,7 +548,7 @@ static bool checkEmbedded(TQWidget* w, const XEvent* xe)
 	((XEvent*)xe)->xany.window = extra->xDndProxy;
 	XSendEvent( TQPaintDevice::x11AppDisplay(), extra->xDndProxy, False, NoEventMask,
 		    (XEvent*)xe );
-	qt_xdnd_current_widget = w;
+	tqt_xdnd_current_widget = w;
 	return true;
     }
     current_embedding_widget = 0;
@@ -560,19 +560,19 @@ void tqt_handle_xdnd_enter( TQWidget *, const XEvent * xe, bool /*passive*/ )
     //if ( !w->neveHadAChildWithDropEventsOn() )
 	//return; // haven't been set up for dnd
 
-    qt_motifdnd_active = false;
+    tqt_motifdnd_active = false;
 
     last_enter_event.xclient = xe->xclient;
 
-    qt_xdnd_target_answerwas = false;
+    tqt_xdnd_target_answerwas = false;
 
     const long *l = xe->xclient.data.l;
     int version = (int)(((unsigned long)(l[1])) >> 24);
 
-    if ( version > qt_xdnd_version )
+    if ( version > tqt_xdnd_version )
 	return;
 
-    qt_xdnd_dragsource_xid = l[0];
+    tqt_xdnd_dragsource_xid = l[0];
 
     int j = 0;
     if ( l[1] & 1 ) {
@@ -581,11 +581,11 @@ void tqt_handle_xdnd_enter( TQWidget *, const XEvent * xe, bool /*passive*/ )
 	int f;
 	unsigned long n, a;
 	Atom *data;
-	XGetWindowProperty( TQPaintDevice::x11AppDisplay(), qt_xdnd_dragsource_xid,
-		    qt_xdnd_type_list, 0,
-		    qt_xdnd_max_type, False, XA_ATOM, &type, &f,&n,&a,(uchar**)&data );
-	for ( ; j<qt_xdnd_max_type && j < (int)n; j++ ) {
-	    qt_xdnd_types[j] = data[j];
+	XGetWindowProperty( TQPaintDevice::x11AppDisplay(), tqt_xdnd_dragsource_xid,
+		    tqt_xdnd_type_list, 0,
+		    tqt_xdnd_max_type, False, XA_ATOM, &type, &f,&n,&a,(uchar**)&data );
+	for ( ; j<tqt_xdnd_max_type && j < (int)n; j++ ) {
+	    tqt_xdnd_types[j] = data[j];
 	}
 	if ( data )
 	    XFree( (uchar*)data );
@@ -593,10 +593,10 @@ void tqt_handle_xdnd_enter( TQWidget *, const XEvent * xe, bool /*passive*/ )
 	// get the types from the message
 	int i;
 	for( i=2; i < 5; i++ ) {
-	    qt_xdnd_types[j++] = l[i];
+	    tqt_xdnd_types[j++] = l[i];
 	}
     }
-    qt_xdnd_types[j] = 0;
+    tqt_xdnd_types[j] = 0;
 }
 
 
@@ -615,20 +615,20 @@ void tqt_handle_xdnd_position( TQWidget *w, const XEvent * xe, bool passive )
 	return;
     }
 
-    if ( l[0] != qt_xdnd_dragsource_xid ) {
+    if ( l[0] != tqt_xdnd_dragsource_xid ) {
 	//tqDebug( "xdnd drag position from unexpected source (%08lx not %08lx)",
-	//     l[0], qt_xdnd_dragsource_xid );
+	//     l[0], tqt_xdnd_dragsource_xid );
 	return;
     }
 
     if (l[3] != 0) {
         // timestamp from the source
-        qt_xdnd_target_current_time = tqt_x_user_time = l[3];
+        tqt_xdnd_target_current_time = tqt_x_user_time = l[3];
     }
 
     XClientMessageEvent response;
     response.type = ClientMessage;
-    response.window = qt_xdnd_dragsource_xid;
+    response.window = tqt_xdnd_dragsource_xid;
     response.format = 32;
     response.message_type = tqt_xdnd_status;
     response.data.l[0] = w->winId();
@@ -649,15 +649,15 @@ void tqt_handle_xdnd_position( TQWidget *w, const XEvent * xe, bool passive )
 	TQDropEvent::Action accepted_action = xdndaction_to_qtaction(l[4]);
 	me.setAction(accepted_action);
 
-	if ( c != qt_xdnd_current_widget ) {
-	    qt_xdnd_target_answerwas = false;
-	    if ( qt_xdnd_current_widget ) {
+	if ( c != tqt_xdnd_current_widget ) {
+	    tqt_xdnd_target_answerwas = false;
+	    if ( tqt_xdnd_current_widget ) {
 		TQDragLeaveEvent e;
-		TQApplication::sendEvent( qt_xdnd_current_widget, &e );
+		TQApplication::sendEvent( tqt_xdnd_current_widget, &e );
 	    }
 	    if ( c->acceptDrops() ) {
-		qt_xdnd_current_widget = c;
-		qt_xdnd_current_position = p;
+		tqt_xdnd_current_widget = c;
+		tqt_xdnd_current_position = p;
 
 		TQDragEnterEvent de( p );
 		de.setAction(accepted_action);
@@ -673,21 +673,21 @@ void tqt_handle_xdnd_position( TQWidget *w, const XEvent * xe, bool passive )
 		}
 	    }
 	} else {
-	    if ( qt_xdnd_target_answerwas ) {
+	    if ( tqt_xdnd_target_answerwas ) {
 		me.accept();
 		me.acceptAction(global_requested_action == global_accepted_action);
 	    }
 	}
 
 	if ( !c->acceptDrops() ) {
-	    qt_xdnd_current_widget = 0;
+	    tqt_xdnd_current_widget = 0;
 	    answerRect = TQRect( p, TQSize( 1, 1 ) );
 	} else if ( xdndaction_to_qtaction(l[4]) < TQDropEvent::Private ) {
-	    qt_xdnd_current_widget = c;
-	    qt_xdnd_current_position = p;
+	    tqt_xdnd_current_widget = c;
+	    tqt_xdnd_current_position = p;
 
 	    TQApplication::sendEvent( c, &me );
-	    qt_xdnd_target_answerwas = me.isAccepted();
+	    tqt_xdnd_target_answerwas = me.isAccepted();
 	    if ( me.isAccepted() ) {
 		response.data.l[1] = 1; // yes
 		if ( !me.isActionAccepted() ) // only as a copy (move if we del)
@@ -723,9 +723,9 @@ void tqt_handle_xdnd_position( TQWidget *w, const XEvent * xe, bool passive )
     }
 
     // reset
-    qt_xdnd_target_current_time = CurrentTime;
+    tqt_xdnd_target_current_time = CurrentTime;
 
-    TQWidget * source = TQWidget::find( qt_xdnd_dragsource_xid );
+    TQWidget * source = TQWidget::find( tqt_xdnd_dragsource_xid );
 
     if ( source && source->isDesktop() && !source->acceptDrops() )
 	source = 0;
@@ -733,7 +733,7 @@ void tqt_handle_xdnd_position( TQWidget *w, const XEvent * xe, bool passive )
     if ( source )
 	tqt_handle_xdnd_status( source, (const XEvent *)&response, passive );
     else
-	XSendEvent( TQPaintDevice::x11AppDisplay(), qt_xdnd_dragsource_xid, False,
+	XSendEvent( TQPaintDevice::x11AppDisplay(), tqt_xdnd_dragsource_xid, False,
 		    NoEventMask, (XEvent*)&response );
 }
 
@@ -749,12 +749,12 @@ void tqt_handle_xdnd_status( TQWidget * w, const XEvent * xe, bool /*passive*/ )
     if ( (int)(l[1] & 2) == 0 ) {
 	TQPoint p( (l[2] & 0xffff0000) >> 16, l[2] & 0x0000ffff );
 	TQSize s( (l[3] & 0xffff0000) >> 16, l[3] & 0x0000ffff );
-	qt_xdnd_source_sameanswer = TQRect( p, s );
-	if ( qt_xdnd_source_sameanswer.isNull() ) {
+	tqt_xdnd_source_sameanswer = TQRect( p, s );
+	if ( tqt_xdnd_source_sameanswer.isNull() ) {
 	    // Application wants "coninutous" move events
 	}
     } else {
-	qt_xdnd_source_sameanswer = TQRect();
+	tqt_xdnd_source_sameanswer = TQRect();
     }
 }
 
@@ -762,53 +762,53 @@ void tqt_handle_xdnd_status( TQWidget * w, const XEvent * xe, bool /*passive*/ )
 void tqt_handle_xdnd_leave( TQWidget *w, const XEvent * xe, bool /*passive*/ )
 {
     //tqDebug( "xdnd leave" );
-    if ( !qt_xdnd_current_widget ||
-	 w->topLevelWidget() != qt_xdnd_current_widget->topLevelWidget() ) {
+    if ( !tqt_xdnd_current_widget ||
+	 w->topLevelWidget() != tqt_xdnd_current_widget->topLevelWidget() ) {
 	return; // sanity
     }
 
     if (checkEmbedded(current_embedding_widget, xe)) {
 	current_embedding_widget = 0;
-	qt_xdnd_current_widget = 0;
+	tqt_xdnd_current_widget = 0;
 	return;
     }
 
     const unsigned long *l = (const unsigned long *)xe->xclient.data.l;
 
     TQDragLeaveEvent e;
-    TQApplication::sendEvent( qt_xdnd_current_widget, &e );
+    TQApplication::sendEvent( tqt_xdnd_current_widget, &e );
 
-    if ( l[0] != qt_xdnd_dragsource_xid ) {
+    if ( l[0] != tqt_xdnd_dragsource_xid ) {
 	// This often happens - leave other-process window quickly
 	//tqDebug( "xdnd drag leave from unexpected source (%08lx not %08lx",
-	       //l[0], qt_xdnd_dragsource_xid );
-	qt_xdnd_current_widget = 0;
+	       //l[0], tqt_xdnd_dragsource_xid );
+	tqt_xdnd_current_widget = 0;
 	return;
     }
 
-    qt_xdnd_dragsource_xid = 0;
-    qt_xdnd_types[0] = 0;
-    qt_xdnd_current_widget = 0;
+    tqt_xdnd_dragsource_xid = 0;
+    tqt_xdnd_types[0] = 0;
+    tqt_xdnd_current_widget = 0;
 }
 
 
-void qt_xdnd_send_leave()
+void tqt_xdnd_send_leave()
 {
-    if ( !qt_xdnd_current_target )
+    if ( !tqt_xdnd_current_target )
 	return;
 
     XClientMessageEvent leave;
     leave.type = ClientMessage;
-    leave.window = qt_xdnd_current_target;
+    leave.window = tqt_xdnd_current_target;
     leave.format = 32;
     leave.message_type = tqt_xdnd_leave;
-    leave.data.l[0] = qt_xdnd_dragsource_xid;
+    leave.data.l[0] = tqt_xdnd_dragsource_xid;
     leave.data.l[1] = 0; // flags
     leave.data.l[2] = 0; // x, y
     leave.data.l[3] = 0; // w, h
     leave.data.l[4] = 0; // just null
 
-    TQWidget * w = TQWidget::find( qt_xdnd_current_proxy_target );
+    TQWidget * w = TQWidget::find( tqt_xdnd_current_proxy_target );
 
     if ( w && w->isDesktop() && !w->acceptDrops() )
 	w = 0;
@@ -816,49 +816,49 @@ void qt_xdnd_send_leave()
     if ( w )
 	tqt_handle_xdnd_leave( w, (const XEvent *)&leave, false );
     else
-	XSendEvent( TQPaintDevice::x11AppDisplay(), qt_xdnd_current_proxy_target, False,
+	XSendEvent( TQPaintDevice::x11AppDisplay(), tqt_xdnd_current_proxy_target, False,
 		    NoEventMask, (XEvent*)&leave );
-    qt_xdnd_current_target = 0;
-    qt_xdnd_current_proxy_target = 0;
+    tqt_xdnd_current_target = 0;
+    tqt_xdnd_current_proxy_target = 0;
 }
 
 
 
 void tqt_handle_xdnd_drop( TQWidget *, const XEvent * xe, bool passive )
 {
-    if ( !qt_xdnd_current_widget ) {
-	qt_xdnd_dragsource_xid = 0;
+    if ( !tqt_xdnd_current_widget ) {
+	tqt_xdnd_dragsource_xid = 0;
 	return; // sanity
     }
 
-    if (!passive && checkEmbedded(qt_xdnd_current_widget, xe)){
+    if (!passive && checkEmbedded(tqt_xdnd_current_widget, xe)){
 	current_embedding_widget = 0;
-	qt_xdnd_dragsource_xid = 0;
-	qt_xdnd_current_widget = 0;
+	tqt_xdnd_dragsource_xid = 0;
+	tqt_xdnd_current_widget = 0;
 	return;
     }
     const unsigned long *l = (const unsigned long *)xe->xclient.data.l;
 
     //tqDebug( "xdnd drop" );
 
-    if ( l[0] != qt_xdnd_dragsource_xid ) {
+    if ( l[0] != tqt_xdnd_dragsource_xid ) {
 	//tqDebug( "xdnd drop from unexpected source (%08lx not %08lx",
-	//       l[0], qt_xdnd_dragsource_xid );
+	//       l[0], tqt_xdnd_dragsource_xid );
 	return;
     }
 
     if (l[2] != 0) {
         // update the "user time" from the timestamp in the event.
-        qt_xdnd_target_current_time = tqt_x_user_time = l[2];
+        tqt_xdnd_target_current_time = tqt_x_user_time = l[2];
     }
 
-    if ( qt_xdnd_source_object )
-	qt_xdnd_source_object->setTarget( qt_xdnd_current_widget );
+    if ( tqt_xdnd_source_object )
+	tqt_xdnd_source_object->setTarget( tqt_xdnd_current_widget );
 
     if ( !passive ) {
-	TQDropEvent de( qt_xdnd_current_position );
+	TQDropEvent de( tqt_xdnd_current_position );
 	de.setAction( global_accepted_action );
-	TQApplication::sendEvent( qt_xdnd_current_widget, &de );
+	TQApplication::sendEvent( tqt_xdnd_current_widget, &de );
 	if ( !de.isAccepted() ) {
 	    // Ignore a failed drag
 	    global_accepted_action = TQDropEvent::Copy;
@@ -866,22 +866,22 @@ void tqt_handle_xdnd_drop( TQWidget *, const XEvent * xe, bool passive )
 	}
 	XClientMessageEvent finished;
 	finished.type = ClientMessage;
-	finished.window = qt_xdnd_dragsource_xid;
+	finished.window = tqt_xdnd_dragsource_xid;
 	finished.format = 32;
 	finished.message_type = tqt_xdnd_finished;
-	finished.data.l[0] = qt_xdnd_current_widget?qt_xdnd_current_widget->topLevelWidget()->winId():0;
+	finished.data.l[0] = tqt_xdnd_current_widget?tqt_xdnd_current_widget->topLevelWidget()->winId():0;
 	finished.data.l[1] = 0; // flags
-	XSendEvent( TQPaintDevice::x11AppDisplay(), qt_xdnd_dragsource_xid, False,
+	XSendEvent( TQPaintDevice::x11AppDisplay(), tqt_xdnd_dragsource_xid, False,
 		    NoEventMask, (XEvent*)&finished );
     } else {
 	TQDragLeaveEvent e;
-	TQApplication::sendEvent( qt_xdnd_current_widget, &e );
+	TQApplication::sendEvent( tqt_xdnd_current_widget, &e );
     }
-    qt_xdnd_dragsource_xid = 0;
-    qt_xdnd_current_widget = 0;
+    tqt_xdnd_dragsource_xid = 0;
+    tqt_xdnd_current_widget = 0;
 
     // reset
-    qt_xdnd_target_current_time = CurrentTime;
+    tqt_xdnd_target_current_time = CurrentTime;
 }
 
 
@@ -889,16 +889,16 @@ void tqt_handle_xdnd_finished( TQWidget *, const XEvent * xe, bool passive )
 {
     const unsigned long *l = (const unsigned long *)xe->xclient.data.l;
 
-    if ( l[0] && (l[0] == qt_xdnd_current_target
-	    || l[0] == qt_xdnd_current_proxy_target) ) {
+    if ( l[0] && (l[0] == tqt_xdnd_current_target
+	    || l[0] == tqt_xdnd_current_proxy_target) ) {
 	//
 	if ( !passive )
-	    (void ) checkEmbedded( qt_xdnd_current_widget, xe);
+	    (void ) checkEmbedded( tqt_xdnd_current_widget, xe);
 	current_embedding_widget = 0;
-	qt_xdnd_current_target = 0;
-	qt_xdnd_current_proxy_target = 0;
-	delete qt_xdnd_source_object;
-	qt_xdnd_source_object = 0;
+	tqt_xdnd_current_target = 0;
+	tqt_xdnd_current_proxy_target = 0;
+	delete tqt_xdnd_source_object;
+	tqt_xdnd_source_object = 0;
     }
 }
 
@@ -910,19 +910,19 @@ void TQDragManager::timerEvent( TQTimerEvent* e )
             Window root, child;
             int root_x, root_y, win_x, win_y;
             unsigned int mask;
-            XQueryPointer( tqt_xdisplay(), tqt_xrootwin( qt_xdnd_current_screen ),
+            XQueryPointer( tqt_xdisplay(), tqt_xrootwin( tqt_xdnd_current_screen ),
                 &root, &child, &root_x, &root_y, &win_x, &win_y, &mask );
             if( updateMode( (ButtonState)tqt_x11_translateButtonState( mask )))
-                qt_xdnd_source_sameanswer = TQRect(); // force move
+                tqt_xdnd_source_sameanswer = TQRect(); // force move
         }
         need_modifiers_check = true;
-        if( qt_xdnd_source_sameanswer.isNull() )
+        if( tqt_xdnd_source_sameanswer.isNull() )
 	    move( TQCursor::pos() );
     }
 }
 
-static bool qt_xdnd_was_move = false;
-static bool qt_xdnd_found = false;
+static bool tqt_xdnd_was_move = false;
+static bool tqt_xdnd_found = false;
 // check whole incoming X queue for move events
 // checking whole queue is done by always returning False in the predicate
 // if there's another move event in the queue, and there's not a mouse button
@@ -931,33 +931,33 @@ static bool qt_xdnd_found = false;
 // this helps avoiding being overloaded by being flooded from many events
 // from the XServer
 static
-Bool qt_xdnd_predicate( Display*, XEvent* ev, XPointer )
+Bool tqt_xdnd_predicate( Display*, XEvent* ev, XPointer )
 {
-    if( qt_xdnd_found )
+    if( tqt_xdnd_found )
 	return False;
     if( ev->type == MotionNotify )
     {
-	qt_xdnd_was_move = true;
-	qt_xdnd_found = true;
+	tqt_xdnd_was_move = true;
+	tqt_xdnd_found = true;
     }
     if( ev->type == ButtonPress || ev->type == ButtonRelease
 	|| ev->type == XKeyPress || ev->type == XKeyRelease
 	|| ev->type == ClientMessage )
     {
-	qt_xdnd_was_move = false;
-	qt_xdnd_found = true;
+	tqt_xdnd_was_move = false;
+	tqt_xdnd_found = true;
     }
     return False;
 }
 
 static
-bool qt_xdnd_another_movement()
+bool tqt_xdnd_another_movement()
 {
-    qt_xdnd_was_move = false;
-    qt_xdnd_found = false;
+    tqt_xdnd_was_move = false;
+    tqt_xdnd_found = false;
     XEvent dummy;
-    XCheckIfEvent( tqt_xdisplay(), &dummy, qt_xdnd_predicate, NULL );
-    return qt_xdnd_was_move;
+    XCheckIfEvent( tqt_xdisplay(), &dummy, tqt_xdnd_predicate, NULL );
+    return tqt_xdnd_was_move;
 }
 
 bool TQDragManager::eventFilter( TQObject * o, TQEvent * e)
@@ -982,7 +982,7 @@ bool TQDragManager::eventFilter( TQObject * o, TQEvent * e)
 
     if ( e->type() == TQEvent::MouseMove ) {
 	TQMouseEvent* me = (TQMouseEvent *)e;
-	if( !qt_xdnd_another_movement()) {
+	if( !tqt_xdnd_another_movement()) {
 	    updateMode(me->stateAfter());
 	    move( me->globalPos() );
 	}
@@ -1026,7 +1026,7 @@ bool TQDragManager::eventFilter( TQObject * o, TQEvent * e)
 	    tqApp->exit_loop();
 	} else {
 	    if( updateMode(ke->stateAfter())) {
-	        qt_xdnd_source_sameanswer = TQRect(); // force move
+	        tqt_xdnd_source_sameanswer = TQRect(); // force move
 	        move( TQCursor::pos() );
             }
             need_modifiers_check = false;
@@ -1064,7 +1064,7 @@ bool TQDragManager::updateMode( ButtonState newstate )
     if ( (newstate & both) == both ) {
 	global_requested_action = TQDropEvent::Link;
     } else {
-	bool local = qt_xdnd_source_object != 0;
+	bool local = tqt_xdnd_source_object != 0;
 	if ( drag_mode == TQDragObject::DragMove )
 	    global_requested_action = TQDropEvent::Move;
 	else if ( drag_mode == TQDragObject::DragCopy )
@@ -1114,14 +1114,14 @@ void TQDragManager::updateCursor()
 	} else {
 	    c = moveCursor;
 	}
-	if ( qt_xdnd_deco ) {
-	    qt_xdnd_deco->show();
-	    qt_xdnd_deco->raise();
+	if ( tqt_xdnd_deco ) {
+	    tqt_xdnd_deco->show();
+	    tqt_xdnd_deco->raise();
 	}
     } else {
 	c = noDropCursor;
-	//if ( qt_xdnd_deco )
-	//    qt_xdnd_deco->hide();
+	//if ( tqt_xdnd_deco )
+	//    tqt_xdnd_deco->hide();
     }
 #ifndef TQT_NO_CURSOR
     if ( c )
@@ -1139,8 +1139,8 @@ void TQDragManager::cancel( bool deleteSource )
 	object = 0;
     }
 
-    if ( qt_xdnd_current_target ) {
-	qt_xdnd_send_leave();
+    if ( tqt_xdnd_current_target ) {
+	tqt_xdnd_send_leave();
     }
 
 #ifndef TQT_NO_CURSOR
@@ -1151,10 +1151,10 @@ void TQDragManager::cancel( bool deleteSource )
 #endif
 
     if ( deleteSource )
-	delete qt_xdnd_source_object;
-    qt_xdnd_source_object = 0;
-    delete qt_xdnd_deco;
-    qt_xdnd_deco = 0;
+	delete tqt_xdnd_source_object;
+    tqt_xdnd_source_object = 0;
+    delete tqt_xdnd_deco;
+    tqt_xdnd_deco = 0;
 
     dndCancelled = true;
 }
@@ -1162,7 +1162,7 @@ void TQDragManager::cancel( bool deleteSource )
 static
 Window findRealWindow( const TQPoint & pos, Window w, int md )
 {
-    if ( qt_xdnd_deco && w == qt_xdnd_deco->winId() )
+    if ( tqt_xdnd_deco && w == tqt_xdnd_deco->winId() )
 	return 0;
 
     if ( md ) {
@@ -1182,7 +1182,7 @@ Window findRealWindow( const TQPoint & pos, Window w, int md )
 		unsigned long n, a;
 		unsigned char *data;
 
-		XGetWindowProperty( TQPaintDevice::x11AppDisplay(), w, qt_xdnd_aware, 0,
+		XGetWindowProperty( TQPaintDevice::x11AppDisplay(), w, tqt_xdnd_aware, 0,
 		    0, False, AnyPropertyType, &type, &f,&n,&a,&data );
 		if ( data ) XFree(data);
 		if ( type ) return w;
@@ -1220,26 +1220,26 @@ void TQDragManager::move( const TQPoint & globalPos )
     }
 
     int screen = TQCursor::x11Screen();
-    if ( ( qt_xdnd_current_screen == -1 && screen != TQPaintDevice::x11AppScreen() ) ||
-	 ( screen != qt_xdnd_current_screen ) ) {
+    if ( ( tqt_xdnd_current_screen == -1 && screen != TQPaintDevice::x11AppScreen() ) ||
+	 ( screen != tqt_xdnd_current_screen ) ) {
 	// recreate the pixmap on the new screen...
-	delete qt_xdnd_deco;
-	qt_xdnd_deco = new TQShapedPixmapWidget( screen );
-        qt_xdnd_deco->x11SetWindowTransient( dragSource->topLevelWidget());
+	delete tqt_xdnd_deco;
+	tqt_xdnd_deco = new TQShapedPixmapWidget( screen );
+        tqt_xdnd_deco->x11SetWindowTransient( dragSource->topLevelWidget());
 	if (!TQWidget::mouseGrabber()) {
 	    updatePixmap();
-	    qt_xdnd_deco->grabMouse();
+	    tqt_xdnd_deco->grabMouse();
 	}
     }
     updatePixmap( globalPos );
 
-    if ( qt_xdnd_source_sameanswer.contains( globalPos ) &&
-	 qt_xdnd_source_sameanswer.isValid() ) {
+    if ( tqt_xdnd_source_sameanswer.contains( globalPos ) &&
+	 tqt_xdnd_source_sameanswer.isValid() ) {
 	return;
     }
 
-    qt_xdnd_current_screen = screen;
-    Window rootwin = TQPaintDevice::x11AppRootWindow( qt_xdnd_current_screen );
+    tqt_xdnd_current_screen = screen;
+    Window rootwin = TQPaintDevice::x11AppRootWindow( tqt_xdnd_current_screen );
     Window target = 0;
     int lx = 0, ly = 0;
     if ( !XTranslateCoordinates( TQPaintDevice::x11AppDisplay(), rootwin, rootwin,
@@ -1271,7 +1271,7 @@ void TQDragManager::move( const TQPoint & globalPos )
 	    int f;
 	    unsigned long n, a;
 	    unsigned char *data = 0;
-	    XGetWindowProperty(TQPaintDevice::x11AppDisplay(), target, qt_xdnd_aware, 0, 0, False,
+	    XGetWindowProperty(TQPaintDevice::x11AppDisplay(), target, tqt_xdnd_aware, 0, 0, False,
                                AnyPropertyType, &type, &f,&n,&a,&data);
 	    if (data)
                 XFree(data);
@@ -1285,7 +1285,7 @@ void TQDragManager::move( const TQPoint & globalPos )
                 break;
             }
         }
-	if ( qt_xdnd_deco && (!target || target == qt_xdnd_deco->winId()) ) {
+	if ( tqt_xdnd_deco && (!target || target == tqt_xdnd_deco->winId()) ) {
 	    target = findRealWindow(globalPos,rootwin,6);
 	}
     }
@@ -1309,7 +1309,7 @@ void TQDragManager::move( const TQPoint & globalPos )
 	unsigned long n, a;
 	WId *proxy_id;
 	tqt_ignore_badwindow();
-	r = XGetWindowProperty( tqt_xdisplay(), target, qt_xdnd_proxy, 0,
+	r = XGetWindowProperty( tqt_xdisplay(), target, tqt_xdnd_proxy, 0,
 				1, False, XA_WINDOW, &type, &f,&n,&a,(uchar**)&proxy_id );
 	if ( ( r != Success ) || tqt_badwindow() ) {
 	    proxy_target = target = 0;
@@ -1317,7 +1317,7 @@ void TQDragManager::move( const TQPoint & globalPos )
 	    proxy_target = *proxy_id;
 	    XFree(proxy_id);
 	    proxy_id = 0;
-	    r = XGetWindowProperty( tqt_xdisplay(), proxy_target, qt_xdnd_proxy, 0,
+	    r = XGetWindowProperty( tqt_xdisplay(), proxy_target, tqt_xdnd_proxy, 0,
 				    1, False, XA_WINDOW, &type, &f,&n,&a,(uchar**)&proxy_id );
 	    if ( ( r != Success ) || tqt_badwindow() || !type || !proxy_id || *proxy_id != proxy_target ) {
 		// Bogus
@@ -1330,12 +1330,12 @@ void TQDragManager::move( const TQPoint & globalPos )
 	if ( proxy_target ) {
 	    int *tv;
 	    tqt_ignore_badwindow();
-	    r = XGetWindowProperty( tqt_xdisplay(), proxy_target, qt_xdnd_aware, 0,
+	    r = XGetWindowProperty( tqt_xdisplay(), proxy_target, tqt_xdnd_aware, 0,
 				    1, False, AnyPropertyType, &type, &f,&n,&a,(uchar**)&tv );
 	    if ( r != Success ) {
 		target = 0;
 	    } else {
-		target_version = TQMIN(qt_xdnd_version,tv ? *tv : 1);
+		target_version = TQMIN(tqt_xdnd_version,tv ? *tv : 1);
 		if ( tv )
 		    XFree( tv );
 		if (!(!tqt_badwindow() && type))
@@ -1344,12 +1344,12 @@ void TQDragManager::move( const TQPoint & globalPos )
 	}
     }
 
-    if ( target != qt_xdnd_current_target ) {
-	if ( qt_xdnd_current_target )
-	    qt_xdnd_send_leave();
+    if ( target != tqt_xdnd_current_target ) {
+	if ( tqt_xdnd_current_target )
+	    tqt_xdnd_send_leave();
 
-	qt_xdnd_current_target = target;
-	qt_xdnd_current_proxy_target = proxy_target;
+	tqt_xdnd_current_target = target;
+	tqt_xdnd_current_proxy_target = proxy_target;
 	if ( target ) {
 	    TQMemArray<Atom> type;
 	    int flags = target_version << 24;
@@ -1357,11 +1357,11 @@ void TQDragManager::move( const TQPoint & globalPos )
 	    int nfmt=0;
 	    for (nfmt=0; (fmt=object->format(nfmt)); nfmt++) {
 		type.resize(nfmt+1);
-		type[nfmt] = *qt_xdnd_str_to_atom( fmt );
+		type[nfmt] = *tqt_xdnd_str_to_atom( fmt );
 	    }
 	    if ( nfmt >= 3 ) {
 		XChangeProperty( TQPaintDevice::x11AppDisplay(),
-				 object->source()->winId(), qt_xdnd_type_list,
+				 object->source()->winId(), tqt_xdnd_type_list,
 				 XA_ATOM, 32, PropModeReplace,
 				 (unsigned char *)type.data(),
 				 type.size() );
@@ -1378,7 +1378,7 @@ void TQDragManager::move( const TQPoint & globalPos )
 	    enter.data.l[3] = type.size()>1 ? type[1] : 0;
 	    enter.data.l[4] = type.size()>2 ? type[2] : 0;
 	    // provisionally set the rectangle to 5x5 pixels...
-	    qt_xdnd_source_sameanswer = TQRect( globalPos.x() - 2,
+	    tqt_xdnd_source_sameanswer = TQRect( globalPos.x() - 2,
 					       globalPos.y() -2 , 5, 5 );
 
 	    if ( w ) {
@@ -1421,15 +1421,15 @@ void TQDragManager::drop()
 {
     killTimer( heartbeat );
     heartbeat = -1;
-    if ( !qt_xdnd_current_target )
+    if ( !tqt_xdnd_current_target )
 	return;
 
-    delete qt_xdnd_deco;
-    qt_xdnd_deco = 0;
+    delete tqt_xdnd_deco;
+    tqt_xdnd_deco = 0;
 
     XClientMessageEvent drop;
     drop.type = ClientMessage;
-    drop.window = qt_xdnd_current_target;
+    drop.window = tqt_xdnd_current_target;
     drop.format = 32;
     drop.message_type = tqt_xdnd_drop;
     drop.data.l[0] = object->source()->winId();
@@ -1438,7 +1438,7 @@ void TQDragManager::drop()
     drop.data.l[3] = 0;
     drop.data.l[4] = 0;
 
-    TQWidget * w = TQWidget::find( qt_xdnd_current_proxy_target );
+    TQWidget * w = TQWidget::find( tqt_xdnd_current_proxy_target );
 
     if ( w && w->isDesktop() && !w->acceptDrops() )
 	w = 0;
@@ -1446,7 +1446,7 @@ void TQDragManager::drop()
     if ( w )
 	tqt_handle_xdnd_drop( w, (const XEvent *)&drop, false );
     else
-	XSendEvent( TQPaintDevice::x11AppDisplay(), qt_xdnd_current_proxy_target, False,
+	XSendEvent( TQPaintDevice::x11AppDisplay(), tqt_xdnd_current_proxy_target, False,
 		    NoEventMask, (XEvent*)&drop );
 
 #ifndef TQT_NO_CURSOR
@@ -1461,21 +1461,21 @@ void TQDragManager::drop()
 
 bool tqt_xdnd_handle_badwindow()
 {
-    if ( qt_xdnd_source_object && qt_xdnd_current_target ) {
-	qt_xdnd_current_target = 0;
-	qt_xdnd_current_proxy_target = 0;
-	delete qt_xdnd_source_object;
-	qt_xdnd_source_object = 0;
-	delete qt_xdnd_deco;
-	qt_xdnd_deco = 0;
+    if ( tqt_xdnd_source_object && tqt_xdnd_current_target ) {
+	tqt_xdnd_current_target = 0;
+	tqt_xdnd_current_proxy_target = 0;
+	delete tqt_xdnd_source_object;
+	tqt_xdnd_source_object = 0;
+	delete tqt_xdnd_deco;
+	tqt_xdnd_deco = 0;
 	return true;
     }
-    if ( qt_xdnd_dragsource_xid ) {
-	qt_xdnd_dragsource_xid = 0;
-	if ( qt_xdnd_current_widget ) {
+    if ( tqt_xdnd_dragsource_xid ) {
+	tqt_xdnd_dragsource_xid = 0;
+	if ( tqt_xdnd_current_widget ) {
 	    TQDragLeaveEvent e;
-	    TQApplication::sendEvent( qt_xdnd_current_widget, &e );
-	    qt_xdnd_current_widget = 0;
+	    TQApplication::sendEvent( tqt_xdnd_current_widget, &e );
+	    tqt_xdnd_current_widget = 0;
 	}
 	return true;
     }
@@ -1509,7 +1509,7 @@ bool tqt_xdnd_handle_badwindow()
 
 bool TQDropEvent::provides( const char *mimeType ) const
 {
-    if ( qt_motifdnd_active && tqstrnicmp( mimeType, "text/", 5 ) == 0 )
+    if ( tqt_motifdnd_active && tqstrnicmp( mimeType, "text/", 5 ) == 0 )
 	return true;
 
     int n=0;
@@ -1535,10 +1535,10 @@ void tqt_xdnd_handle_selection_request( const XSelectionRequestEvent * req )
     evt.xselection.target = req->target;
     evt.xselection.property = None;
     evt.xselection.time = req->time;
-    const char* format = qt_xdnd_atom_to_str( req->target );
-    if ( format && qt_xdnd_source_object &&
-	 qt_xdnd_source_object->provides( format ) ) {
-	TQByteArray a = qt_xdnd_source_object->encodedData(format);
+    const char* format = tqt_xdnd_atom_to_str( req->target );
+    if ( format && tqt_xdnd_source_object &&
+	 tqt_xdnd_source_object->provides( format ) ) {
+	TQByteArray a = tqt_xdnd_source_object->encodedData(format);
 	XChangeProperty ( TQPaintDevice::x11AppDisplay(), req->requestor, req->property,
 			  req->target, 8, PropModeReplace,
 			  (unsigned char *)a.data(), a.size() );
@@ -1557,38 +1557,38 @@ void tqt_xdnd_handle_selection_request( const XSelectionRequestEvent * req )
 	evt.xselection.property = req->property;
 */
 
-static TQByteArray qt_xdnd_obtain_data( const char *format )
+static TQByteArray tqt_xdnd_obtain_data( const char *format )
 {
     TQByteArray result;
 
     TQWidget* w;
-    if ( qt_xdnd_dragsource_xid && qt_xdnd_source_object &&
-	 (w=TQWidget::find( qt_xdnd_dragsource_xid ))
+    if ( tqt_xdnd_dragsource_xid && tqt_xdnd_source_object &&
+	 (w=TQWidget::find( tqt_xdnd_dragsource_xid ))
 	   && (!w->isDesktop() || w->acceptDrops()) )
     {
-	TQDragObject * o = qt_xdnd_source_object;
+	TQDragObject * o = tqt_xdnd_source_object;
 	if ( o->provides( format ) )
 	    result = o->encodedData(format);
 	return result;
     }
 
-    Atom * a = qt_xdnd_str_to_atom( format );
+    Atom * a = tqt_xdnd_str_to_atom( format );
     if ( !a || !*a )
 	return result;
 
-    if ( !qt_xdnd_target_data )
-	qt_xdnd_target_data = new TQIntDict<TQByteArray>( 17 );
+    if ( !tqt_xdnd_target_data )
+	tqt_xdnd_target_data = new TQIntDict<TQByteArray>( 17 );
 
-    if ( qt_xdnd_target_data->find( (int)*a ) ) {
-	result = *(qt_xdnd_target_data->find( (int)*a ));
+    if ( tqt_xdnd_target_data->find( (int)*a ) ) {
+	result = *(tqt_xdnd_target_data->find( (int)*a ));
     } else {
 	if ( XGetSelectionOwner( TQPaintDevice::x11AppDisplay(),
 				 tqt_xdnd_selection ) == None )
 	    return result; // should never happen?
 
-	TQWidget* tw = qt_xdnd_current_widget;
-	if ( !qt_xdnd_current_widget ||
-	     qt_xdnd_current_widget->isDesktop() ) {
+	TQWidget* tw = tqt_xdnd_current_widget;
+	if ( !tqt_xdnd_current_widget ||
+	     tqt_xdnd_current_widget->isDesktop() ) {
 	    tw = new TQWidget;
 	}
 	XConvertSelection( TQPaintDevice::x11AppDisplay(),
@@ -1596,23 +1596,23 @@ static TQByteArray qt_xdnd_obtain_data( const char *format )
                            *a,
 			   tqt_xdnd_selection,
 			   tw->winId(),
-                           qt_xdnd_target_current_time );
+                           tqt_xdnd_target_current_time );
 	XFlush( TQPaintDevice::x11AppDisplay() );
 
 	XEvent xevent;
-	bool got=qt_xclb_wait_for_event( TQPaintDevice::x11AppDisplay(),
+	bool got=tqt_xclb_wait_for_event( TQPaintDevice::x11AppDisplay(),
 				      tw->winId(),
 				      SelectionNotify, &xevent, 5000);
 	if ( got ) {
 	    Atom type;
 
-	    if ( qt_xclb_read_property( TQPaintDevice::x11AppDisplay(),
+	    if ( tqt_xclb_read_property( TQPaintDevice::x11AppDisplay(),
 					tw->winId(),
 					tqt_xdnd_selection, true,
 					&result, 0, &type, 0, false ) ) {
-		if ( type == qt_incr_atom ) {
+		if ( type == tqt_incr_atom ) {
 		    int nbytes = result.size() >= 4 ? *((int*)result.data()) : 0;
-		    result = qt_xclb_read_incremental_property( TQPaintDevice::x11AppDisplay(),
+		    result = tqt_xclb_read_incremental_property( TQPaintDevice::x11AppDisplay(),
 								tw->winId(),
 								tqt_xdnd_selection,
 								nbytes, false );
@@ -1620,16 +1620,16 @@ static TQByteArray qt_xdnd_obtain_data( const char *format )
 		    // (includes None) tqDebug( "TQt clipboard: unknown atom %ld", type);
 		}
 #if 0
-		// this needs to be matched by a qt_xdnd_target_data->clear()
+		// this needs to be matched by a tqt_xdnd_target_data->clear()
 		// when each drag is finished. for 2.0, we do the safe thing
 		// and disable the entire caching.
 		if ( type != None )
-		    qt_xdnd_target_data->insert( (int)((long)a), new TQByteArray(result) );
+		    tqt_xdnd_target_data->insert( (int)((long)a), new TQByteArray(result) );
 #endif
 	    }
 	}
-	if ( !qt_xdnd_current_widget ||
-	     qt_xdnd_current_widget->isDesktop() ) {
+	if ( !tqt_xdnd_current_widget ||
+	     tqt_xdnd_current_widget->isDesktop() ) {
 	    delete tw;
 	}
     }
@@ -1642,7 +1642,7 @@ static TQByteArray qt_xdnd_obtain_data( const char *format )
   Enable drag and drop for widget w by installing the proper
   properties on w's toplevel widget.
 */
-bool qt_dnd_enable( TQWidget* w, bool on )
+bool tqt_dnd_enable( TQWidget* w, bool on )
 {
     w = w->topLevelWidget();
 
@@ -1652,8 +1652,8 @@ bool qt_dnd_enable( TQWidget* w, bool on )
 	((TQExtraWidget*)w)->topData()->dnd  = 1;
     }
 
-    qt_motifdnd_enable( w, on );
-    return qt_xdnd_enable( w, on );
+    tqt_motifdnd_enable( w, on );
+    return tqt_xdnd_enable( w, on );
 }
 
 
@@ -1696,9 +1696,9 @@ bool qt_dnd_enable( TQWidget* w, bool on )
 
 TQByteArray TQDropEvent::encodedData( const char *format ) const
 {
-    if ( qt_motifdnd_active )
-	return qt_motifdnd_obtain_data( format );
-    return qt_xdnd_obtain_data( format );
+    if ( tqt_motifdnd_active )
+	return tqt_motifdnd_obtain_data( format );
+    return tqt_xdnd_obtain_data( format );
 }
 
 /*!
@@ -1715,16 +1715,16 @@ TQByteArray TQDropEvent::encodedData( const char *format ) const
 
 const char* TQDropEvent::format( int n ) const
 {
-    if ( qt_motifdnd_active )
-	return qt_motifdnd_format( n );
+    if ( tqt_motifdnd_active )
+	return tqt_motifdnd_format( n );
 
     int i = 0;
-    while( i<n && qt_xdnd_types[i] )
+    while( i<n && tqt_xdnd_types[i] )
 	i++;
     if ( i < n )
 	return 0;
 
-    const char* name = qt_xdnd_atom_to_str( qt_xdnd_types[i] );
+    const char* name = tqt_xdnd_atom_to_str( tqt_xdnd_types[i] );
     if ( !name )
 	return 0; // should never happen
 
@@ -1742,7 +1742,7 @@ bool TQDragManager::drag( TQDragObject * o, TQDragObject::DragMode mode )
 	beingCancelled = false;
     }
 
-    if ( qt_xdnd_source_object ) {
+    if ( tqt_xdnd_source_object ) {
 	// the last drag and drop operation hasn't finished, so we are going to wait
 	// for one second to see if it does... if the finish message comes after this,
 	// then we could still have problems, but this is highly unlikely
@@ -1765,12 +1765,12 @@ bool TQDragManager::drag( TQDragObject * o, TQDragObject::DragMode mode )
 	    usleep_tv.tv_sec = 0;
 	    usleep_tv.tv_usec = 50000;
 	    select(0, 0, 0, 0, &usleep_tv);
-	} while ( qt_xdnd_source_object && started.msecsTo(now) < 1000 );
+	} while ( tqt_xdnd_source_object && started.msecsTo(now) < 1000 );
     }
 
-    qt_xdnd_source_object = o;
-    qt_xdnd_source_object->setTarget( 0 );
-    qt_xdnd_deco = new TQShapedPixmapWidget();
+    tqt_xdnd_source_object = o;
+    tqt_xdnd_source_object->setTarget( 0 );
+    tqt_xdnd_deco = new TQShapedPixmapWidget();
 
     willDrop = false;
 
@@ -1779,17 +1779,17 @@ bool TQDragManager::drag( TQDragObject * o, TQDragObject::DragMode mode )
 
     dragSource = (TQWidget *)(object->parent());
 
-    qt_xdnd_deco->x11SetWindowTransient( dragSource->topLevelWidget());
+    tqt_xdnd_deco->x11SetWindowTransient( dragSource->topLevelWidget());
     tqApp->installEventFilter( this );
-    qt_xdnd_source_current_time = tqt_x_time;
+    tqt_xdnd_source_current_time = tqt_x_time;
     XSetSelectionOwner( TQPaintDevice::x11AppDisplay(), tqt_xdnd_selection,
 			dragSource->topLevelWidget()->winId(),
-			qt_xdnd_source_current_time );
+			tqt_xdnd_source_current_time );
     oldstate = ButtonState(-1); // #### Should use state that caused the drag
     drag_mode = mode;
     global_accepted_action = TQDropEvent::Copy;
     updateMode(ButtonState(0));
-    qt_xdnd_source_sameanswer = TQRect();
+    tqt_xdnd_source_sameanswer = TQRect();
     move(TQCursor::pos());
     heartbeat = startTimer(200);
     need_modifiers_check = false;
@@ -1804,7 +1804,7 @@ bool TQDragManager::drag( TQDragObject * o, TQDragObject::DragMode mode )
     tqt_xdnd_dragging = true;
 
     if (!TQWidget::mouseGrabber())
-	qt_xdnd_deco->grabMouse();
+	tqt_xdnd_deco->grabMouse();
 
     tqApp->enter_loop(); // Do the DND.
 
@@ -1812,23 +1812,23 @@ bool TQDragManager::drag( TQDragObject * o, TQDragObject::DragMode mode )
     tqApp->restoreOverrideCursor();
 #endif
 
-    delete qt_xdnd_deco;
-    qt_xdnd_deco = 0;
+    delete tqt_xdnd_deco;
+    tqt_xdnd_deco = 0;
     killTimer( heartbeat );
     heartbeat = -1;
-    qt_xdnd_current_screen = -1;
+    tqt_xdnd_current_screen = -1;
     tqt_xdnd_dragging = false;
 
     return ((! dndCancelled) && // source del?
 	    (global_accepted_action == TQDropEvent::Copy &&
 	     global_requested_action == TQDropEvent::Move));
 
-    // qt_xdnd_source_object persists until we get an xdnd_finish message
+    // tqt_xdnd_source_object persists until we get an xdnd_finish message
 }
 
 void TQDragManager::updatePixmap( const TQPoint& cursorPos )
 {
-    if ( qt_xdnd_deco ) {
+    if ( tqt_xdnd_deco ) {
 	TQPixmap pm;
 	TQPoint pm_hot(default_pm_hotx,default_pm_hoty);
 	if ( object ) {
@@ -1841,12 +1841,12 @@ void TQDragManager::updatePixmap( const TQPoint& cursorPos )
 		defaultPm = new TQPixmap(default_pm);
 	    pm = *defaultPm;
 	}
-	qt_xdnd_deco->setPixmap(pm, pm_hot);
-	qt_xdnd_deco->move(cursorPos-pm_hot);
+	tqt_xdnd_deco->setPixmap(pm, pm_hot);
+	tqt_xdnd_deco->move(cursorPos-pm_hot);
 	    //if ( willDrop ) {
-	    qt_xdnd_deco->show();
+	    tqt_xdnd_deco->show();
 	    //} else {
-	    //    qt_xdnd_deco->hide();
+	    //    tqt_xdnd_deco->hide();
 	    //}
     }
 }
diff --git a/src/kernel/tqdragobject.cpp b/src/kernel/tqdragobject.cpp
index 82547934d..9444caf8b 100644
--- a/src/kernel/tqdragobject.cpp
+++ b/src/kernel/tqdragobject.cpp
@@ -749,7 +749,7 @@ const char * TQTextDrag::format(int i) const
     return d->fmt[i];
 }
 
-TQTextCodec* qt_findcharset(const TQCString& mimetype)
+TQTextCodec* tqt_findcharset(const TQCString& mimetype)
 {
     int i=mimetype.find("charset=");
     if ( i >= 0 ) {
@@ -818,7 +818,7 @@ TQTextCodec* findcodec(const TQMimeSource* e)
 	if (html)
 	    r = codecForHTML(TQCString(e->encodedData(f)));
 	if (!r)
-	    r = qt_findcharset(TQCString(f).lower());
+	    r = tqt_findcharset(TQCString(f).lower());
 	if (r)
 	    return r;
     }
@@ -836,7 +836,7 @@ TQByteArray TQTextDrag::encodedData(const char* mime) const
     if ( 0==tqstrnicmp(mime,"text/",5) ) {
 	TQCString m(mime);
 	m = m.lower();
-	TQTextCodec *codec = qt_findcharset(m);
+	TQTextCodec *codec = tqt_findcharset(m);
 	if ( !codec )
 	    return r;
 	TQString text( d->txt );
@@ -928,7 +928,7 @@ bool TQTextDrag::decode( const TQMimeSource* e, TQString& str, TQCString& subtyp
 		    codec = codecForHTML(TQCString(bytes.data(), bytes.size()));
                 }
 		if (!codec)
-		    codec = qt_findcharset(m);
+		    codec = tqt_findcharset(m);
 		if ( codec ) {
 		    TQByteArray payload;
 
diff --git a/src/kernel/tqeventloop_unix.cpp b/src/kernel/tqeventloop_unix.cpp
index 00bb78ae3..9c2c2fb43 100644
--- a/src/kernel/tqeventloop_unix.cpp
+++ b/src/kernel/tqeventloop_unix.cpp
@@ -96,8 +96,8 @@ static TimerList *timerList	= 0;		// timer list
 static void	initTimers();
 void cleanupTimers();
 static timeval	watchtime;			// watch if time is turned back
-timeval		*qt_wait_timer();
-timeval	*qt_wait_timer_max = 0;
+timeval		*tqt_wait_timer();
+timeval	*tqt_wait_timer_max = 0;
 
 //
 // Internal operator functions for timevals
@@ -226,10 +226,10 @@ static void repairTimer( const timeval &time )	// repair broken timer
   Returns the time to wait for the next timer, or null if no timers are
   waiting.
 
-  The result is bounded to qt_wait_timer_max if this exists.
+  The result is bounded to tqt_wait_timer_max if this exists.
 */
 
-timeval *qt_wait_timer()
+timeval *tqt_wait_timer()
 {
     static timeval tm;
     bool first = true;
@@ -249,12 +249,12 @@ timeval *qt_wait_timer()
 	    tm.tv_sec  = 0;			// no time to wait
 	    tm.tv_usec = 0;
 	}
-	if ( qt_wait_timer_max && *qt_wait_timer_max < tm )
-	    tm = *qt_wait_timer_max;
+	if ( tqt_wait_timer_max && *tqt_wait_timer_max < tm )
+	    tm = *tqt_wait_timer_max;
 	return &tm;
     }
-    if ( qt_wait_timer_max ) {
-	tm = *qt_wait_timer_max;
+    if ( tqt_wait_timer_max ) {
+	tm = *tqt_wait_timer_max;
 	return &tm;
     }
     return 0;					// no timers
@@ -516,7 +516,7 @@ void TQEventLoop::wakeUp()
 
 int TQEventLoop::timeToWait() const
 {
-    timeval *tm = qt_wait_timer();
+    timeval *tm = tqt_wait_timer();
     if ( ! tm )	// no active timers
 	return -1;
     return (tm->tv_sec*1000) + (tm->tv_usec/1000);
diff --git a/src/kernel/tqeventloop_unix_glib.cpp b/src/kernel/tqeventloop_unix_glib.cpp
index 93182ded5..405723ad5 100644
--- a/src/kernel/tqeventloop_unix_glib.cpp
+++ b/src/kernel/tqeventloop_unix_glib.cpp
@@ -108,8 +108,8 @@ static TimerList  *timerList = 0;		// timer list
 static void initTimers();
 void cleanupTimers();
 static timeval watchtime;			// watch if time is turned back
-timeval *qt_wait_timer();
-timeval *qt_wait_timer_max = 0;
+timeval *tqt_wait_timer();
+timeval *tqt_wait_timer_max = 0;
 
 //
 // Internal operator functions for timevals
@@ -253,10 +253,10 @@ static void repairTimer( const timeval &time )				// repair broken timer
   Returns the time to wait for the next timer, or null if no timers are
   waiting.
 
-  The result is bounded to qt_wait_timer_max if this exists.
+  The result is bounded to tqt_wait_timer_max if this exists.
 */
 
-timeval *qt_wait_timer()
+timeval *tqt_wait_timer()
 {
 #if defined(TQT_THREAD_SUPPORT)
 	tqt_timerListMutex->lock();
@@ -281,16 +281,16 @@ timeval *qt_wait_timer()
 			tm.tv_sec  = 0;					// no time to wait
 			tm.tv_usec = 0;
 		}
-		if ( qt_wait_timer_max && *qt_wait_timer_max < tm ) {
-			tm = *qt_wait_timer_max;
+		if ( tqt_wait_timer_max && *tqt_wait_timer_max < tm ) {
+			tm = *tqt_wait_timer_max;
 		}
 #if defined(TQT_THREAD_SUPPORT)
 		tqt_timerListMutex->unlock();
 #endif
 		return &tm;
 	}
-	if ( qt_wait_timer_max ) {
-		tm = *qt_wait_timer_max;
+	if ( tqt_wait_timer_max ) {
+		tm = *tqt_wait_timer_max;
 #if defined(TQT_THREAD_SUPPORT)
 		tqt_timerListMutex->unlock();
 #endif
@@ -621,7 +621,7 @@ void TQEventLoop::wakeUp()
 
 int TQEventLoop::timeToWait() const
 {
-	timeval *tm = qt_wait_timer();
+	timeval *tm = tqt_wait_timer();
 	if ( !tm ) {			// no active timers
 		return -1;
 	}
diff --git a/src/kernel/tqeventloop_x11.cpp b/src/kernel/tqeventloop_x11.cpp
index 1d4c6529e..ae6d636d9 100644
--- a/src/kernel/tqeventloop_x11.cpp
+++ b/src/kernel/tqeventloop_x11.cpp
@@ -63,45 +63,45 @@ static const int XKeyRelease = KeyRelease;
 extern bool tqt_is_gui_used;
 
 // from tqeventloop_unix.cpp
-extern timeval *qt_wait_timer();
+extern timeval *tqt_wait_timer();
 extern void cleanupTimers();
 
 // ### this needs to go away at some point...
 typedef void (*VFPTR)();
 typedef TQValueList<VFPTR> TQVFuncList;
-void qt_install_preselect_handler( VFPTR );
-void qt_remove_preselect_handler( VFPTR );
-static TQVFuncList *qt_preselect_handler = 0;
-void qt_install_postselect_handler( VFPTR );
-void qt_remove_postselect_handler( VFPTR );
-static TQVFuncList *qt_postselect_handler = 0;
-
-void qt_install_preselect_handler( VFPTR handler )
+void tqt_install_preselect_handler( VFPTR );
+void tqt_remove_preselect_handler( VFPTR );
+static TQVFuncList *tqt_preselect_handler = 0;
+void tqt_install_postselect_handler( VFPTR );
+void tqt_remove_postselect_handler( VFPTR );
+static TQVFuncList *tqt_postselect_handler = 0;
+
+void tqt_install_preselect_handler( VFPTR handler )
 {
-    if ( !qt_preselect_handler )
-	qt_preselect_handler = new TQVFuncList;
-    qt_preselect_handler->append( handler );
+    if ( !tqt_preselect_handler )
+	tqt_preselect_handler = new TQVFuncList;
+    tqt_preselect_handler->append( handler );
 }
-void qt_remove_preselect_handler( VFPTR handler )
+void tqt_remove_preselect_handler( VFPTR handler )
 {
-    if ( qt_preselect_handler ) {
-	TQVFuncList::Iterator it = qt_preselect_handler->find( handler );
-	if ( it != qt_preselect_handler->end() )
-		qt_preselect_handler->remove( it );
+    if ( tqt_preselect_handler ) {
+	TQVFuncList::Iterator it = tqt_preselect_handler->find( handler );
+	if ( it != tqt_preselect_handler->end() )
+		tqt_preselect_handler->remove( it );
     }
 }
-void qt_install_postselect_handler( VFPTR handler )
+void tqt_install_postselect_handler( VFPTR handler )
 {
-    if ( !qt_postselect_handler )
-	qt_postselect_handler = new TQVFuncList;
-    qt_postselect_handler->prepend( handler );
+    if ( !tqt_postselect_handler )
+	tqt_postselect_handler = new TQVFuncList;
+    tqt_postselect_handler->prepend( handler );
 }
-void qt_remove_postselect_handler( VFPTR handler )
+void tqt_remove_postselect_handler( VFPTR handler )
 {
-    if ( qt_postselect_handler ) {
-	TQVFuncList::Iterator it = qt_postselect_handler->find( handler );
-	if ( it != qt_postselect_handler->end() )
-		qt_postselect_handler->remove( it );
+    if ( tqt_postselect_handler ) {
+	TQVFuncList::Iterator it = tqt_postselect_handler->find( handler );
+	if ( it != tqt_postselect_handler->end() )
+		tqt_postselect_handler->remove( it );
     }
 }
 
@@ -221,7 +221,7 @@ bool TQEventLoop::processEvents( ProcessEventsFlags flags )
     timeval *tm = 0;
     if ( ! ( flags & ExcludeTimers ) ) {
 	if (TQApplication::isCoreThread()) {
-	    tm = qt_wait_timer();			// wait for TQt timers
+	    tm = tqt_wait_timer();			// wait for TQt timers
 	    if ( !canWait ) {
 		if ( !tm )
 		    tm = &zerotm;
@@ -278,9 +278,9 @@ bool TQEventLoop::processEvents( ProcessEventsFlags flags )
     if ( canWait )
 	emit aboutToBlock();
 
-    if ( qt_preselect_handler ) {
-	TQVFuncList::Iterator it, end = qt_preselect_handler->end();
-	for ( it = qt_preselect_handler->begin(); it != end; ++it )
+    if ( tqt_preselect_handler ) {
+	TQVFuncList::Iterator it, end = tqt_preselect_handler->end();
+	for ( it = tqt_preselect_handler->begin(); it != end; ++it )
 	    (**it)();
     }
 
@@ -366,9 +366,9 @@ bool TQEventLoop::processEvents( ProcessEventsFlags flags )
 	::read( d->thread_pipe[0], &c, 1 );
     }
 
-    if ( qt_postselect_handler ) {
-	TQVFuncList::Iterator it, end = qt_postselect_handler->end();
-	for ( it = qt_postselect_handler->begin(); it != end; ++it )
+    if ( tqt_postselect_handler ) {
+	TQVFuncList::Iterator it, end = tqt_postselect_handler->end();
+	for ( it = tqt_postselect_handler->begin(); it != end; ++it )
 	    (**it)();
     }
 
diff --git a/src/kernel/tqeventloop_x11_glib.cpp b/src/kernel/tqeventloop_x11_glib.cpp
index 1c744d43c..4dd8fad58 100644
--- a/src/kernel/tqeventloop_x11_glib.cpp
+++ b/src/kernel/tqeventloop_x11_glib.cpp
@@ -65,14 +65,14 @@ typedef struct {
 	TQEventLoop * tqeventLoop;
 } TQtGSource;
 
-static gboolean qt_gsource_prepare  ( GSource *source, gint *timeout );
-static gboolean qt_gsource_check    ( GSource *source );
-static gboolean qt_gsource_dispatch ( GSource *source, GSourceFunc  callback, gpointer user_data );
-
-static GSourceFuncs qt_gsource_funcs = {
-	qt_gsource_prepare,
-	qt_gsource_check,
-	qt_gsource_dispatch,
+static gboolean tqt_gsource_prepare  ( GSource *source, gint *timeout );
+static gboolean tqt_gsource_check    ( GSource *source );
+static gboolean tqt_gsource_dispatch ( GSource *source, GSourceFunc  callback, gpointer user_data );
+
+static GSourceFuncs tqt_gsource_funcs = {
+	tqt_gsource_prepare,
+	tqt_gsource_check,
+	tqt_gsource_dispatch,
 	NULL,
 	NULL,
 	NULL
@@ -80,7 +80,7 @@ static GSourceFuncs qt_gsource_funcs = {
 
 // forward main loop callbacks to TQEventLoop methods!
 
-static gboolean qt_gsource_prepare ( GSource *source, gint *timeout )
+static gboolean tqt_gsource_prepare ( GSource *source, gint *timeout )
 {
 	TQtGSource * qtGSource = (TQtGSource*) source;
 	TQEventLoop* candidateEventLoop = qtGSource->tqeventLoop;
@@ -95,7 +95,7 @@ static gboolean qt_gsource_prepare ( GSource *source, gint *timeout )
 	}
 }
 
-static gboolean qt_gsource_check ( GSource *source )
+static gboolean tqt_gsource_check ( GSource *source )
 {
 	TQtGSource * qtGSource = (TQtGSource*) source;
 	TQEventLoop* candidateEventLoop = qtGSource->tqeventLoop;
@@ -110,7 +110,7 @@ static gboolean qt_gsource_check ( GSource *source )
 	}
 }
 
-static gboolean qt_gsource_dispatch ( GSource *source, GSourceFunc callback, gpointer user_data )
+static gboolean tqt_gsource_dispatch ( GSource *source, GSourceFunc callback, gpointer user_data )
 {
 	Q_UNUSED(callback);
 	Q_UNUSED(user_data);
@@ -144,51 +144,51 @@ static const int XKeyRelease = KeyRelease;
 extern bool tqt_is_gui_used;
 
 // from tqeventloop_unix.cpp
-extern timeval *qt_wait_timer();
+extern timeval *tqt_wait_timer();
 extern void cleanupTimers();
 
 // ### this needs to go away at some point...
 typedef void (*VFPTR)();
 typedef TQValueList<VFPTR> TQVFuncList;
-void qt_install_preselect_handler( VFPTR );
-void qt_remove_preselect_handler( VFPTR );
-static TQVFuncList *qt_preselect_handler = 0;
-void qt_install_postselect_handler( VFPTR );
-void qt_remove_postselect_handler( VFPTR );
-static TQVFuncList *qt_postselect_handler = 0;
-
-void qt_install_preselect_handler( VFPTR handler )
+void tqt_install_preselect_handler( VFPTR );
+void tqt_remove_preselect_handler( VFPTR );
+static TQVFuncList *tqt_preselect_handler = 0;
+void tqt_install_postselect_handler( VFPTR );
+void tqt_remove_postselect_handler( VFPTR );
+static TQVFuncList *tqt_postselect_handler = 0;
+
+void tqt_install_preselect_handler( VFPTR handler )
 {
-	if ( !qt_preselect_handler ) {
-		qt_preselect_handler = new TQVFuncList;
+	if ( !tqt_preselect_handler ) {
+		tqt_preselect_handler = new TQVFuncList;
 	}
-	qt_preselect_handler->append( handler );
+	tqt_preselect_handler->append( handler );
 }
 
-void qt_remove_preselect_handler( VFPTR handler )
+void tqt_remove_preselect_handler( VFPTR handler )
 {
-	if ( qt_preselect_handler ) {
-		TQVFuncList::Iterator it = qt_preselect_handler->find( handler );
-		if ( it != qt_preselect_handler->end() ) {
-			qt_preselect_handler->remove( it );
+	if ( tqt_preselect_handler ) {
+		TQVFuncList::Iterator it = tqt_preselect_handler->find( handler );
+		if ( it != tqt_preselect_handler->end() ) {
+			tqt_preselect_handler->remove( it );
 		}
 	}
 }
 
-void qt_install_postselect_handler( VFPTR handler )
+void tqt_install_postselect_handler( VFPTR handler )
 {
-	if ( !qt_postselect_handler ) {
-		qt_postselect_handler = new TQVFuncList;
+	if ( !tqt_postselect_handler ) {
+		tqt_postselect_handler = new TQVFuncList;
 	}
-	qt_postselect_handler->prepend( handler );
+	tqt_postselect_handler->prepend( handler );
 }
 
-void qt_remove_postselect_handler( VFPTR handler )
+void tqt_remove_postselect_handler( VFPTR handler )
 {
-	if ( qt_postselect_handler ) {
-		TQVFuncList::Iterator it = qt_postselect_handler->find( handler );
-		if ( it != qt_postselect_handler->end() ) {
-			qt_postselect_handler->remove( it );
+	if ( tqt_postselect_handler ) {
+		TQVFuncList::Iterator it = tqt_postselect_handler->find( handler );
+		if ( it != tqt_postselect_handler->end() ) {
+			tqt_postselect_handler->remove( it );
 		}
 	}
 }
@@ -217,7 +217,7 @@ void TQEventLoop::init()
 	d->ctx_is_default = true;
 
 	// new GSource
-	TQtGSource * qtGSource = (TQtGSource*) g_source_new(&qt_gsource_funcs, sizeof(TQtGSource));
+	TQtGSource * qtGSource = (TQtGSource*) g_source_new(&tqt_gsource_funcs, sizeof(TQtGSource));
 	g_source_set_can_recurse ((GSource*)qtGSource, TRUE);
 	qtGSource->tqeventLoop = this;
 
@@ -408,7 +408,7 @@ bool TQEventLoop::gsourcePrepare(GSource *gs, int * timeout)
 	timeval *tm = 0;
 	if ( ! ( flags & ExcludeTimers ) ) {
 		if (TQApplication::isCoreThread()) {
-			tm = qt_wait_timer();				// wait for TQt timers
+			tm = tqt_wait_timer();				// wait for TQt timers
 			if ( !canWait ) {
 				if ( !tm ) {
 					tm = &zerotm;
@@ -447,9 +447,9 @@ bool TQEventLoop::gsourcePrepare(GSource *gs, int * timeout)
 		emit aboutToBlock();
 	}
 
-	if ( qt_preselect_handler ) {
-		TQVFuncList::Iterator it, end = qt_preselect_handler->end();
-		for ( it = qt_preselect_handler->begin(); it != end; ++it )
+	if ( tqt_preselect_handler ) {
+		TQVFuncList::Iterator it, end = tqt_preselect_handler->end();
+		for ( it = tqt_preselect_handler->begin(); it != end; ++it )
 			(**it)();
 	}
 
@@ -532,7 +532,7 @@ bool TQEventLoop::gsourceCheck(GSource *gs) {
 
 	// check if we have timers to activate?
 	if (TQApplication::isCoreThread()) {
-		timeval *tm = qt_wait_timer();
+		timeval *tm = tqt_wait_timer();
 		if (tm && (tm->tv_sec == 0 && tm->tv_usec == 0 )) {
 #ifdef DEBUG_QT_GLIBMAINLOOP
 			printf("inside gsourceCheck(2) qtwaittimer!\n");
@@ -583,9 +583,9 @@ bool TQEventLoop::gsourceDispatch(GSource *gs) {
 		}
 	}
 
-	if ( qt_postselect_handler ) {
-		TQVFuncList::Iterator it, end = qt_postselect_handler->end();
-		for ( it = qt_postselect_handler->begin(); it != end; ++it )
+	if ( tqt_postselect_handler ) {
+		TQVFuncList::Iterator it, end = tqt_postselect_handler->end();
+		for ( it = tqt_postselect_handler->begin(); it != end; ++it )
 			(**it)();
 	}
 
diff --git a/src/kernel/tqmotifdnd_x11.cpp b/src/kernel/tqmotifdnd_x11.cpp
index 9435579f9..15bae236f 100644
--- a/src/kernel/tqmotifdnd_x11.cpp
+++ b/src/kernel/tqmotifdnd_x11.cpp
@@ -93,19 +93,19 @@ static Time Dnd_selection_time;
 static Atom * src_targets ;
 static ushort num_src_targets ;
 
-extern bool qt_motifdnd_active;
+extern bool tqt_motifdnd_active;
 
 // this stuff is copied from tqclipboard_x11.cpp
 
-extern bool qt_xclb_wait_for_event( Display *dpy, Window win, int type,
+extern bool tqt_xclb_wait_for_event( Display *dpy, Window win, int type,
 				    XEvent *event, int timeout );
-extern bool qt_xclb_read_property( Display *dpy, Window win, Atom property,
+extern bool tqt_xclb_read_property( Display *dpy, Window win, Atom property,
 				   bool deleteProperty,
 				   TQByteArray *buffer, int *size, Atom *type,
 				   int *format, bool nullterm );
 
-extern Atom* qt_xdnd_str_to_atom( const char *mimeType );
-extern const char* qt_xdnd_atom_to_str( Atom );
+extern Atom* tqt_xdnd_str_to_atom( const char *mimeType );
+extern const char* tqt_xdnd_atom_to_str( Atom );
 
 
 // Motif definitions
@@ -688,9 +688,9 @@ static int _DndIndexToTargets(Display * display,
 }
 
 
-const char *qt_motifdnd_format( int n )
+const char *tqt_motifdnd_format( int n )
 {
-    if ( ! qt_motifdnd_active )
+    if ( ! tqt_motifdnd_active )
 	return 0; // should not happen
 
     if ( n == 0 )
@@ -705,9 +705,9 @@ const char *qt_motifdnd_format( int n )
     Atom target = src_targets[n];
 
     // duplicated from tqclipboard_x11.cpp - not the best solution
-    static Atom xa_utf8_string = *qt_xdnd_str_to_atom( "UTF8_STRING" );
-    static Atom xa_text = *qt_xdnd_str_to_atom( "TEXT" );
-    static Atom xa_compound_text = *qt_xdnd_str_to_atom( "COMPOUND_TEXT" );
+    static Atom xa_utf8_string = *tqt_xdnd_str_to_atom( "UTF8_STRING" );
+    static Atom xa_text = *tqt_xdnd_str_to_atom( "TEXT" );
+    static Atom xa_compound_text = *tqt_xdnd_str_to_atom( "COMPOUND_TEXT" );
 
     if ( target == XA_STRING )
 	return "text/plain;charset=ISO-8859-1";
@@ -717,11 +717,11 @@ const char *qt_motifdnd_format( int n )
 	 target == xa_compound_text )
 	return "text/plain";
 
-    return qt_xdnd_atom_to_str( target );
+    return tqt_xdnd_atom_to_str( target );
 }
 
 
-TQByteArray qt_motifdnd_obtain_data( const char *mimeType )
+TQByteArray tqt_motifdnd_obtain_data( const char *mimeType )
 {
     TQByteArray result;
 
@@ -731,7 +731,7 @@ TQByteArray qt_motifdnd_obtain_data( const char *mimeType )
     int n=0;
     const char* f;
     do {
-	f = qt_motifdnd_format( n );
+	f = tqt_motifdnd_format( n );
 	if ( !f )
 	    return result;
 	n++;
@@ -745,9 +745,9 @@ TQByteArray qt_motifdnd_obtain_data( const char *mimeType )
 	// prior TQt versions
 	conversion_type = XA_STRING;
     } else {
-	conversion_type = *qt_xdnd_str_to_atom( f );
+	conversion_type = *tqt_xdnd_str_to_atom( f );
 	// tqDebug( "found format '%s' 0x%lx '%s'", f, conversion_type,
-	// qt_xdnd_atom_to_str( conversion_type ) );
+	// tqt_xdnd_atom_to_str( conversion_type ) );
     }
 
     if ( XGetSelectionOwner( tqt_xdisplay(),
@@ -767,13 +767,13 @@ TQByteArray qt_motifdnd_obtain_data( const char *mimeType )
     XFlush( tqt_xdisplay() );
 
     XEvent xevent;
-    bool got=qt_xclb_wait_for_event( tqt_xdisplay(),
+    bool got=tqt_xclb_wait_for_event( tqt_xdisplay(),
 				     tw->winId(),
 				     SelectionNotify, &xevent, 5000);
     if ( got ) {
 	Atom type;
 
-	if ( qt_xclb_read_property( tqt_xdisplay(),
+	if ( tqt_xclb_read_property( tqt_xdisplay(),
 				    tw->winId(),
 				    Dnd_selection, true,
 				    &result, 0, &type, 0, true ) ) {
@@ -785,7 +785,7 @@ TQByteArray qt_motifdnd_obtain_data( const char *mimeType )
 		       Dnd_selection, tw->winId(), Dnd_selection_time);
 
     // wait again for SelectionNotify event
-    qt_xclb_wait_for_event( tqt_xdisplay(),
+    tqt_xclb_wait_for_event( tqt_xdisplay(),
 			    tw->winId(),
 			    SelectionNotify, &xevent, 5000);
 
@@ -797,7 +797,7 @@ TQByteArray qt_motifdnd_obtain_data( const char *mimeType )
 }
 
 
-void qt_motifdnd_enable( TQWidget *widget, bool )
+void tqt_motifdnd_enable( TQWidget *widget, bool )
 {
     DndWriteReceiverProperty( widget->x11Display(), widget->winId(),
 			      DND_DRAG_DYNAMIC);
@@ -918,7 +918,7 @@ void tqt_motifdnd_handle_msg( TQWidget * /* w */ , const XEvent * xe, bool /* pa
 	/* get the size of our drop site for later use */
 
 	cur_window = dnd_data.src_window ;
-	qt_motifdnd_active = true;
+	tqt_motifdnd_active = true;
 
 	/* no answer needed, just read source property */
 	DndReadSourceProperty (event.xclient.display,
diff --git a/src/kernel/tqwidget_x11.cpp b/src/kernel/tqwidget_x11.cpp
index 7521ff657..ab56678e1 100644
--- a/src/kernel/tqwidget_x11.cpp
+++ b/src/kernel/tqwidget_x11.cpp
@@ -74,7 +74,7 @@ void tqt_updated_rootinfo();
 extern void tqt_set_paintevent_clipping( TQPaintDevice* dev, const TQRegion& region);
 extern void tqt_clear_paintevent_clipping();
 
-extern bool qt_dnd_enable( TQWidget* w, bool on );
+extern bool tqt_dnd_enable( TQWidget* w, bool on );
 extern bool tqt_nograb();
 
 // defined in tqapplication_x11.cpp
@@ -825,7 +825,7 @@ void TQWidget::destroy( bool destroyWindow, bool destroySubWindows )
 
 	if ( testWFlags(WType_Desktop) ) {
 	    if ( acceptDrops() )
-		qt_dnd_enable( this, false );
+		tqt_dnd_enable( this, false );
 	} else {
 	    if ( destroyWindow )
 		qt_XDestroyWindow( this, x11Display(), winid );
@@ -991,7 +991,7 @@ void TQWidget::reparentSys( TQWidget *parent, WFlags f, const TQPoint &p, bool s
     else {
 	checkChildrenDnd();
 	topData()->dnd = 0;
-	qt_dnd_enable(this, (extra && extra->children_use_dnd));
+	tqt_dnd_enable(this, (extra && extra->children_use_dnd));
     }
 
     // re-enable mouse tracking
@@ -2736,7 +2736,7 @@ bool TQWidget::acceptDrops() const
 void TQWidget::setAcceptDrops( bool on )
 {
     if ( testWState(WState_DND) != on ) {
-	if ( qt_dnd_enable( this, on ) ) {
+	if ( tqt_dnd_enable( this, on ) ) {
 	    if ( on )
 		setWState( WState_DND );
 	    else
-- 
cgit v1.2.3

