diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-02-28 22:31:39 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-02-28 22:31:39 -0600 |
commit | 41bb408dde90e755b07cd2ab8a9bdec7548c84b0 (patch) | |
tree | 6d4d5407c000add30aa78630e009c0e5d633e440 /src/kernel/qapplication_x11.cpp | |
parent | 1740cd279522c060e738bbbffacab83355d2b794 (diff) | |
download | tqt3-41bb408dde90e755b07cd2ab8a9bdec7548c84b0.tar.gz tqt3-41bb408dde90e755b07cd2ab8a9bdec7548c84b0.zip |
Automated conversion from qt3
Diffstat (limited to 'src/kernel/qapplication_x11.cpp')
-rw-r--r-- | src/kernel/qapplication_x11.cpp | 172 |
1 files changed, 86 insertions, 86 deletions
diff --git a/src/kernel/qapplication_x11.cpp b/src/kernel/qapplication_x11.cpp index 72e29b148..ccb02c735 100644 --- a/src/kernel/qapplication_x11.cpp +++ b/src/kernel/qapplication_x11.cpp @@ -131,7 +131,7 @@ extern "C" Bool XftInitFtLibrary(void); extern "C" char *_Xsetlocale(int category, const char *locale); char *_Xsetlocale(int category, const char *locale) { - //qDebug("_Xsetlocale(%d,%s),category,locale"); + //tqDebug("_Xsetlocale(%d,%s),category,locale"); return setlocale(category,locale); } # endif // setlocale @@ -217,9 +217,9 @@ static GC* app_gc_tmp = 0; // temporary GC static GC* app_gc_ro_m = 0; // read-only GC (monochrome) static GC* app_gc_tmp_m = 0; // temporary GC (monochrome) // symbols needed by extern TQXEmbed class -Q_EXPORT Atom qt_wm_protocols = 0; // window manager protocols -Q_EXPORT Atom qt_wm_delete_window = 0; // delete window protocol -Q_EXPORT Atom qt_wm_take_focus = 0; // take focus window protocol +Q_EXPORT Atom tqt_wm_protocols = 0; // window manager protocols +Q_EXPORT Atom tqt_wm_delete_window = 0; // delete window protocol +Q_EXPORT Atom tqt_wm_take_focus = 0; // take focus window protocol Atom qt_qt_scrolldone = 0; // scroll synchronization Atom qt_net_wm_context_help = 0; // context help @@ -230,15 +230,15 @@ Atom qt_xa_clipboard = 0; Atom qt_selection_property = 0; Atom qt_clipboard_sentinel = 0; Atom qt_selection_sentinel = 0; -Q_EXPORT Atom qt_wm_state = 0; +Q_EXPORT Atom tqt_wm_state = 0; Atom qt_wm_change_state = 0; static Atom qt_settings_timestamp = 0; // TQt >=3 settings timestamp static Atom qt_input_encoding = 0; // TQt desktop properties static Atom qt_resource_manager = 0; // X11 Resource manager Atom qt_sizegrip = 0; // sizegrip Atom qt_wm_client_leader = 0; -Q_EXPORT Atom qt_window_role = 0; -Q_EXPORT Atom qt_sm_client_id = 0; +Q_EXPORT Atom tqt_window_role = 0; +Q_EXPORT Atom tqt_sm_client_id = 0; Atom qt_xa_motif_wm_hints = 0; Atom qt_cde_running = 0; Atom qt_twin_running = 0; @@ -331,7 +331,7 @@ static int xrandr_eventbase; // TRUE if TQt is compiled w/ XRender support and XRender exists on the connected // Display -Q_EXPORT bool qt_use_xrender = FALSE; +Q_EXPORT bool tqt_use_xrender = FALSE; #ifndef QT_NO_XSYNC // True if SYNC extension exists on the connected display @@ -350,7 +350,7 @@ static long qt_mode_switch_remove_mask = 0; // flags for extensions for special Languages, currently only for RTL languages static bool qt_use_rtl_extensions = FALSE; -Q_EXPORT bool qt_hebrew_keyboard_hack = FALSE; +Q_EXPORT bool tqt_hebrew_keyboard_hack = FALSE; static Window mouseActWindow = 0; // window where mouse is static int mouseButtonPressed = 0; // last mouse button pressed @@ -406,10 +406,10 @@ static uint appliedstamp = 0; typedef int (*QX11EventFilter) (XEvent*); -QX11EventFilter qt_set_x11_event_filter(QX11EventFilter filter); +QX11EventFilter tqt_set_x11_event_filter(QX11EventFilter filter); static QX11EventFilter qt_x11_event_filter = 0; -Q_EXPORT QX11EventFilter qt_set_x11_event_filter(QX11EventFilter filter) +Q_EXPORT QX11EventFilter tqt_set_x11_event_filter(QX11EventFilter filter) { QX11EventFilter old_filter = qt_x11_event_filter; qt_x11_event_filter = filter; @@ -436,8 +436,8 @@ static XIMStyle xim_default_style = XIMPreeditCallbacks | XIMStatusNothing; int qt_ximComposingKeycode=0; TQTextCodec * qt_input_mapper = 0; -Q_EXPORT Time qt_x_time = CurrentTime; -Q_EXPORT Time qt_x_user_time = CurrentTime; +Q_EXPORT Time tqt_x_time = CurrentTime; +Q_EXPORT Time tqt_x_user_time = CurrentTime; extern bool qt_check_clipboard_sentinel(); //def in qclipboard_x11.cpp extern bool qt_check_selection_sentinel(); //def in qclipboard_x11.cpp @@ -497,7 +497,7 @@ extern bool qt_app_has_font; static bool qt_x11_cmdline_font = false; -extern bool qt_resolve_symlinks; // from qapplication.cpp +extern bool tqt_resolve_symlinks; // from qapplication.cpp // Paint event clipping magic extern void qt_set_paintevent_clipping( TQPaintDevice* dev, const TQRegion& region); @@ -520,7 +520,7 @@ void qt_deferred_map_add( TQWidget* w) { if ( !deferred_map_list ) { deferred_map_list = new TQPtrList<TQWidget>; - qAddPostRoutine( qt_deferred_map_cleanup ); + tqAddPostRoutine( qt_deferred_map_cleanup ); } deferred_map_list->append( w ); } @@ -788,7 +788,7 @@ static int qt_x_errhandler( Display *dpy, XErrorEvent *err ) char errstr[256]; XGetErrorText( dpy, err->error_code, errstr, 256 ); - qWarning( "X Error: %s %d\n" + tqWarning( "X Error: %s %d\n" " Major opcode: %d\n" " Minor opcode: %d\n" " Resource id: 0x%lx", @@ -806,7 +806,7 @@ static int qt_x_errhandler( Display *dpy, XErrorEvent *err ) static int qt_xio_errhandler( Display * ) { - qWarning( "%s: Fatal IO error: client killed", appName ); + tqWarning( "%s: Fatal IO error: client killed", appName ); tqApp = 0; exit( 1 ); //### give the application a chance for a proper shutdown instead, @@ -866,7 +866,7 @@ static void qt_x11_process_intern_atoms() while( it.current() ) { res[i] = 0; resp[i] = it.current(); - names[i] = qstrdup(it.currentKey()); + names[i] = tqstrdup(it.currentKey()); i++; ++it; } @@ -1105,7 +1105,7 @@ bool TQApplication::x11_apply_settings() qt_broken_wm = settings.readBoolEntry("/qt/brokenWindowManager", qt_broken_wm); - qt_resolve_symlinks = + tqt_resolve_symlinks = settings.readBoolEntry("/qt/resolveSymlinks", TRUE); qt_use_rtl_extensions = @@ -1184,7 +1184,7 @@ static void qt_set_input_encoding() qt_input_mapper = TQTextCodec::codecForLocale(); } else { - if ( !qstricmp( data, "locale" ) ) + if ( !tqstricmp( data, "locale" ) ) qt_input_mapper = TQTextCodec::codecForLocale(); else qt_input_mapper = TQTextCodec::codecForName( data ); @@ -1562,7 +1562,7 @@ void qt_x11_create_wm_client_leader() TQCString session = tqApp->sessionId().latin1(); if ( !session.isEmpty() ) { XChangeProperty( TQPaintDevice::x11AppDisplay(), - qt_x11_wm_client_leader, qt_sm_client_id, + qt_x11_wm_client_leader, tqt_sm_client_id, XA_STRING, 8, PropModeReplace, (unsigned char *)session.data(), session.length() ); } @@ -1658,11 +1658,11 @@ void qt_init_internal( int *argcptr, char **argv, appDpy = display; // Set application name and class - appName = qstrdup( "TQt-subapplication" ); + appName = tqstrdup( "TQt-subapplication" ); char *app_class = 0; if (argv) { const char* p = strrchr( argv[0], '/' ); - app_class = qstrdup(p ? p + 1 : argv[0]); + app_class = tqstrdup(p ? p + 1 : argv[0]); if (app_class[0]) app_class[0] = toupper(app_class[0]); } @@ -1686,7 +1686,7 @@ void qt_init_internal( int *argcptr, char **argv, if (argv) { const char *p = strrchr( argv[0], '/' ); appName = p ? p + 1 : argv[0]; - app_class = qstrdup(appName); + app_class = tqstrdup(appName); if (app_class[0]) app_class[0] = toupper(app_class[0]); } @@ -1795,7 +1795,7 @@ void qt_init_internal( int *argcptr, char **argv, } if ( s == "gdb" ) { appNoGrab = TRUE; - qDebug( "TQt: gdb: -nograb added to command-line options.\n" + tqDebug( "TQt: gdb: -nograb added to command-line options.\n" "\t Use the -dograb option to enforce grabbing." ); } f.close(); @@ -1806,7 +1806,7 @@ void qt_init_internal( int *argcptr, char **argv, if( qt_is_gui_used ) { if ( ( appDpy = XOpenDisplay(appDpyName) ) == 0 ) { - qWarning( "%s: cannot connect to X server %s", appName, + tqWarning( "%s: cannot connect to X server %s", appName, XDisplayName(appDpyName) ); tqApp = 0; exit( 1 ); @@ -1846,7 +1846,7 @@ void qt_init_internal( int *argcptr, char **argv, int screen; TQString serverVendor( ServerVendor( appDpy) ); if (serverVendor.contains("XFree86") && VendorRelease(appDpy) < 40300000) - qt_hebrew_keyboard_hack = TRUE; + tqt_hebrew_keyboard_hack = TRUE; for ( screen = 0; screen < appScreenCount; ++screen ) { TQPaintDevice::x_appdepth_arr[ screen ] = DefaultDepth(appDpy, screen); @@ -2091,7 +2091,7 @@ void qt_init_internal( int *argcptr, char **argv, XRenderPictFormat *format = XRenderFindVisualFormat(appDpy, (Visual *) TQPaintDevice::x_appvisual); - qt_use_xrender = (format != 0) && (TQPaintDevice::x_appdepth != 8); + tqt_use_xrender = (format != 0) && (TQPaintDevice::x_appdepth != 8); } #endif // QT_NO_XRENDER @@ -2113,15 +2113,15 @@ void qt_init_internal( int *argcptr, char **argv, #if !defined(QT_NO_XFTFREETYPE) // defined in qfont_x11.cpp - extern bool qt_has_xft; + extern bool tqt_has_xft; #ifndef QT_XFT2 - if (!qt_use_xrender) - qt_has_xft = FALSE; + if (!tqt_use_xrender) + tqt_has_xft = FALSE; else #endif - qt_has_xft = XftInit(0) && XftInitFtLibrary(); + tqt_has_xft = XftInit(0) && XftInitFtLibrary(); - if (qt_has_xft) { + if (tqt_has_xft) { char *dpi_str = XGetDefault(appDpy, "Xft", "dpi"); if (dpi_str) { // use a custom DPI @@ -2272,7 +2272,7 @@ void qt_init_internal( int *argcptr, char **argv, devices = XListInputDevices( appDpy, &ndev); if ( devices == NULL ) { - qWarning( "Failed to get list of devices" ); + tqWarning( "Failed to get list of devices" ); ndev = -1; } dev = NULL; @@ -2305,7 +2305,7 @@ void qt_init_internal( int *argcptr, char **argv, ev_class = event_list_eraser; } if ( dev == NULL ) { - qWarning( "Failed to open device" ); + tqWarning( "Failed to open device" ); } else { if ( dev->num_classes > 0 ) { for ( ip = dev->classes, j = 0; j < devs->num_classes; @@ -2401,7 +2401,7 @@ void qt_init_internal( int *argcptr, char **argv, tqApp->setDefaultCodec(codec); } - qt_resolve_symlinks = + tqt_resolve_symlinks = settings.readBoolEntry("/qt/resolveSymlinks", TRUE); } } @@ -2605,7 +2605,7 @@ bool qt_wstate_iconified( WId winid ) int format; unsigned long length, after; uchar *data; - int r = XGetWindowProperty( appDpy, winid, qt_wm_state, 0, 2, + int r = XGetWindowProperty( appDpy, winid, tqt_wm_state, 0, 2, False, AnyPropertyType, &type, &format, &length, &after, &data ); bool iconic = FALSE; @@ -2628,23 +2628,23 @@ const char *tqAppClass() // get application class return appClass; } -Display *qt_xdisplay() // get current X display +Display *tqt_xdisplay() // get current X display { return appDpy; } -int qt_xscreen() // get current X screen +int tqt_xscreen() // get current X screen { return appScreen; } // ### REMOVE 4.0 -WId qt_xrootwin() // get X root window +WId tqt_xrootwin() // get X root window { return TQPaintDevice::x11AppRootWindow(); } -WId qt_xrootwin( int scrn ) // get X root window for screen +WId tqt_xrootwin( int scrn ) // get X root window for screen { return TQPaintDevice::x11AppRootWindow( scrn ); } @@ -2686,10 +2686,10 @@ static GC create_gc( int scrn, bool monochrome ) return gc; } -GC qt_xget_readonly_gc( int scrn, bool monochrome ) // get read-only GC +GC tqt_xget_readonly_gc( int scrn, bool monochrome ) // get read-only GC { if ( scrn < 0 || scrn >= appScreenCount ) { - qDebug("invalid screen %d %d", scrn, appScreenCount ); + tqDebug("invalid screen %d %d", scrn, appScreenCount ); TQWidget* bla = 0; bla->setName("hello"); } @@ -2710,10 +2710,10 @@ GC qt_xget_readonly_gc( int scrn, bool monochrome ) // get read-only GC return gc; } -GC qt_xget_temp_gc( int scrn, bool monochrome ) // get temporary GC +GC tqt_xget_temp_gc( int scrn, bool monochrome ) // get temporary GC { if ( scrn < 0 || scrn >= appScreenCount ) { - qDebug("invalid screen (tmp) %d %d", scrn, appScreenCount ); + tqDebug("invalid screen (tmp) %d %d", scrn, appScreenCount ); TQWidget* bla = 0; bla->setName("hello"); } @@ -2773,7 +2773,7 @@ void TQApplication::setMainWidget( TQWidget *mainWidget ) #if defined(QT_CHECK_STATE) if ( mainWidget && mainWidget->parentWidget() && ! mainWidget->parentWidget()->isDesktop() ) - qWarning( "TQApplication::setMainWidget(): New main widget (%s/%s) " + tqWarning( "TQApplication::setMainWidget(): New main widget (%s/%s) " "has a parent!", mainWidget->className(), mainWidget->name() ); #endif @@ -3058,7 +3058,7 @@ TQWidget *TQApplication::widgetAt( int x, int y, bool child ) if ( !w ) { qt_ignore_badwindow(); - target = qt_x11_findClientWindow( target, qt_wm_state, TRUE ); + target = qt_x11_findClientWindow( target, tqt_wm_state, TRUE ); if (qt_badwindow() ) return 0; w = TQWidget::find( (WId)target ); @@ -3217,16 +3217,16 @@ int TQApplication::x11ClientMessage(TQWidget* w, XEvent* event, bool passive_onl { TQETWidget *widget = (TQETWidget*)w; if ( event->xclient.format == 32 && event->xclient.message_type ) { - if ( event->xclient.message_type == qt_wm_protocols ) { + if ( event->xclient.message_type == tqt_wm_protocols ) { Atom a = event->xclient.data.l[0]; - if ( a == qt_wm_delete_window ) { + if ( a == tqt_wm_delete_window ) { if ( passive_only ) return 0; widget->translateCloseEvent(event); } - else if ( a == qt_wm_take_focus ) { + else if ( a == tqt_wm_take_focus ) { TQWidget * amw = activeModalWidget(); - if ( (ulong) event->xclient.data.l[1] > qt_x_time ) - qt_x_time = event->xclient.data.l[1]; + if ( (ulong) event->xclient.data.l[1] > tqt_x_time ) + tqt_x_time = event->xclient.data.l[1]; if ( amw && amw != widget ) { TQWidget* groupLeader = widget; while ( groupLeader && !groupLeader->testWFlags( TQt::WGroupLeader ) @@ -3299,29 +3299,29 @@ int TQApplication::x11ProcessEvent( XEvent* event ) switch ( event->type ) { case ButtonPress: ignoreNextMouseReleaseEvent = FALSE; - qt_x_user_time = event->xbutton.time; + tqt_x_user_time = event->xbutton.time; // fallthrough intended case ButtonRelease: - qt_x_time = event->xbutton.time; + tqt_x_time = event->xbutton.time; break; case MotionNotify: - qt_x_time = event->xmotion.time; + tqt_x_time = event->xmotion.time; break; case XKeyPress: - qt_x_user_time = event->xkey.time; + tqt_x_user_time = event->xkey.time; // fallthrough intended case XKeyRelease: - qt_x_time = event->xkey.time; + tqt_x_time = event->xkey.time; break; case PropertyNotify: - qt_x_time = event->xproperty.time; + tqt_x_time = event->xproperty.time; break; case EnterNotify: case LeaveNotify: - qt_x_time = event->xcrossing.time; + tqt_x_time = event->xcrossing.time; break; case SelectionClear: - qt_x_time = event->xselectionclear.time; + tqt_x_time = event->xselectionclear.time; break; default: break; @@ -3567,7 +3567,7 @@ int TQApplication::x11ProcessEvent( XEvent* event ) case XKeyRelease: { if ( keywidget && keywidget->isEnabled() ) { // should always exist - // qDebug( "sending key event" ); + // tqDebug( "sending key event" ); keywidget->translateKeyEvent( event, grabbed ); } break; @@ -3837,7 +3837,7 @@ bool TQApplication::x11EventFilter( XEvent * ) TQWidget *widget A modal widget *****************************************************************************/ -bool qt_modal_state() +bool tqt_modal_state() { return app_do_modal; } @@ -4474,22 +4474,22 @@ bool TQETWidget::translateXinputEvent( const XEvent *ev ) } button = (XDeviceButtonEvent*)ev; /* - qDebug( "\n\nXInput Button Event" ); - qDebug( "serial:\t%d", button->serial ); - qDebug( "send_event:\t%d", button->send_event ); - qDebug( "display:\t%p", button->display ); - qDebug( "window:\t%d", button->window ); - qDebug( "deviceID:\t%d", button->deviceid ); - qDebug( "root:\t%d", button->root ); - qDebug( "subwindot:\t%d", button->subwindow ); - qDebug( "x:\t%d", button->x ); - qDebug( "y:\t%d", button->y ); - qDebug( "x_root:\t%d", button->x_root ); - qDebug( "y_root:\t%d", button->y_root ); - qDebug( "state:\t%d", button->state ); - qDebug( "button:\t%d", button->button ); - qDebug( "same_screen:\t%d", button->same_screen ); - qDebug( "time:\t%d", button->time ); + tqDebug( "\n\nXInput Button Event" ); + tqDebug( "serial:\t%d", button->serial ); + tqDebug( "send_event:\t%d", button->send_event ); + tqDebug( "display:\t%p", button->display ); + tqDebug( "window:\t%d", button->window ); + tqDebug( "deviceID:\t%d", button->deviceid ); + tqDebug( "root:\t%d", button->root ); + tqDebug( "subwindot:\t%d", button->subwindow ); + tqDebug( "x:\t%d", button->x ); + tqDebug( "y:\t%d", button->y ); + tqDebug( "x_root:\t%d", button->x_root ); + tqDebug( "y_root:\t%d", button->y_root ); + tqDebug( "state:\t%d", button->state ); + tqDebug( "button:\t%d", button->button ); + tqDebug( "same_screen:\t%d", button->same_screen ); + tqDebug( "time:\t%d", button->time ); */ curr = TQPoint( button->x, button->y ); } @@ -4675,7 +4675,7 @@ bool TQETWidget::translatePropertyEvent(const XEvent *event) TQEvent e(TQEvent::WindowStateChange); TQApplication::sendSpontaneousEvent(this, &e); } - } else if (event->xproperty.atom == qt_wm_state) { + } else if (event->xproperty.atom == tqt_wm_state) { // the widget frame strut should also be invalidated topData()->fleft = topData()->fright = topData()->ftop = topData()->fbottom = 0; fstrut_dirty = 1; @@ -4699,17 +4699,17 @@ bool TQETWidget::translatePropertyEvent(const XEvent *event) // TQPaintDevice::x11AppRootWindow(x11Screen())) check // above - e = XGetWindowProperty(appDpy, winId(), qt_wm_state, 0, 2, False, qt_wm_state, + e = XGetWindowProperty(appDpy, winId(), tqt_wm_state, 0, 2, False, tqt_wm_state, &ret, &format, &nitems, &after, &data ); - if (e == Success && ret == qt_wm_state && format == 32 && nitems > 0) { + if (e == Success && ret == tqt_wm_state && format == 32 && nitems > 0) { long *state = (long *) data; switch (state[0]) { case WithdrawnState: // if we are in the withdrawn state, we are free // to reuse this window provided we remove the // WM_STATE property (ICCCM 4.1.3.1) - XDeleteProperty(appDpy, winId(), qt_wm_state); + XDeleteProperty(appDpy, winId(), tqt_wm_state); // set the parent id to zero, so that show() will // work again @@ -5181,7 +5181,7 @@ bool TQETWidget::translateKeyEventInternal( const XEvent *event, int& count, keyDict->setAutoDelete( FALSE ); textDict = new TQIntDict<void>( 13 ); textDict->setAutoDelete( FALSE ); - qAddPostRoutine( deleteKeyDicts ); + tqAddPostRoutine( deleteKeyDicts ); } TQWidget* tlw = topLevelWidget(); @@ -5891,7 +5891,7 @@ extern "C" { static Bool qt_net_wm_sync_request_scanner(Display*, XEvent* event, XPointer arg) { return (event->type == ClientMessage && event->xclient.window == *(Window*)arg - && event->xclient.message_type == qt_wm_protocols + && event->xclient.message_type == tqt_wm_protocols && event->xclient.data.l[ 0 ] == qt_net_wm_sync_request ); } #endif @@ -6375,7 +6375,7 @@ static void sm_performSaveYourself( TQSessionManagerData* smd ) // generate a restart and discard command that makes sense TQStringList restart; restart << tqApp->argv()[0] << "-session" << smd->sessionId + "_" + smd->sessionKey; - if (qstricmp(tqAppName(), tqAppClass()) != 0) + if (tqstricmp(tqAppName(), tqAppClass()) != 0) restart << "-name" << tqAppName(); sm->setRestartCommand( restart ); TQStringList discard; @@ -6524,7 +6524,7 @@ TQSessionManager::TQSessionManager( TQApplication * app, TQString &id, TQString& TQString error = cerror; if (!smcConnection ) { - qWarning("Session management error: %s", error.latin1() ); + tqWarning("Session management error: %s", error.latin1() ); } else { sm_receiver = new TQSmSocketReceiver( IceConnectionNumber( SmcGetIceConnection( smcConnection ) ) ); |