diff options
Diffstat (limited to 'src/kernel/qapplication.cpp')
-rw-r--r-- | src/kernel/qapplication.cpp | 200 |
1 files changed, 100 insertions, 100 deletions
diff --git a/src/kernel/qapplication.cpp b/src/kernel/qapplication.cpp index 8cc05071f..3dc3db748 100644 --- a/src/kernel/qapplication.cpp +++ b/src/kernel/qapplication.cpp @@ -312,28 +312,28 @@ */ /* - The qt_init() and qt_cleanup() functions are implemented in the + The tqt_init() and tqt_cleanup() functions are implemented in the qapplication_xyz.cpp file. */ -void qt_init( int *, char **, TQApplication::Type ); -void qt_cleanup(); +void tqt_init( int *, char **, TQApplication::Type ); +void tqt_cleanup(); #if defined(Q_WS_X11) -void qt_init( Display* dpy, TQt::HANDLE, TQt::HANDLE ); +void tqt_init( Display* dpy, TQt::HANDLE, TQt::HANDLE ); #endif -Q_EXPORT bool qt_tryModalHelper( TQWidget *widget, TQWidget **rettop ); +Q_EXPORT bool tqt_tryModalHelper( TQWidget *widget, TQWidget **rettop ); TQApplication *tqApp = 0; // global application object TQStyle *TQApplication::app_style = 0; // default application style -bool qt_explicit_app_style = FALSE; // style explicitly set by programmer +bool tqt_explicit_app_style = FALSE; // style explicitly set by programmer int TQApplication::app_cspec = TQApplication::NormalColor; #ifndef QT_NO_PALETTE TQPalette *TQApplication::app_pal = 0; // default application palette #endif TQFont *TQApplication::app_font = 0; // default application font -bool qt_app_has_font = FALSE; +bool tqt_app_has_font = FALSE; #ifndef QT_NO_CURSOR TQCursor *TQApplication::app_cursor = 0; // default application cursor #endif @@ -350,10 +350,10 @@ int TQApplication::mouse_double_click_time = 400; // mouse dbl click limit #ifndef QT_NO_WHEELEVENT int TQApplication::wheel_scroll_lines = 3; // number of lines to scroll #endif -bool qt_is_gui_used; +bool tqt_is_gui_used; bool Q_EXPORT tqt_resolve_symlinks = TRUE; bool Q_EXPORT tqt_tab_all_widgets = TRUE; -TQRect qt_maxWindowRect; +TQRect tqt_maxWindowRect; static int drag_time = 500; static int drag_distance = 4; static bool reverse_layout = FALSE; @@ -366,7 +366,7 @@ bool TQApplication::animate_tooltip = FALSE; bool TQApplication::fade_tooltip = FALSE; bool TQApplication::animate_toolbox = FALSE; bool TQApplication::widgetCount = FALSE; -TQApplication::Type qt_appType=TQApplication::Tty; +TQApplication::Type tqt_appType=TQApplication::Tty; #ifndef QT_NO_COMPONENT TQStringList *TQApplication::app_libpaths = 0; #endif @@ -374,29 +374,29 @@ bool TQApplication::metaComposeUnicode = FALSE; int TQApplication::composedUnicode = 0; #ifdef QT_THREAD_SUPPORT -TQMutex *TQApplication::qt_mutex = 0; +TQMutex *TQApplication::tqt_mutex = 0; static TQMutex *postevent_mutex = 0; -static TQt::HANDLE qt_application_thread_id = 0; +static TQt::HANDLE tqt_application_thread_id = 0; Q_EXPORT TQt::HANDLE tqt_get_application_thread_id() { - return qt_application_thread_id; + return tqt_application_thread_id; } #endif // QT_THREAD_SUPPORT TQEventLoop *TQApplication::eventloop = 0; // application event loop #ifndef QT_NO_ACCEL -extern bool qt_dispatchAccelEvent( TQWidget*, TQKeyEvent* ); // def in qaccel.cpp -extern bool qt_tryComposeUnicode( TQWidget*, TQKeyEvent* ); // def in qaccel.cpp +extern bool tqt_dispatchAccelEvent( TQWidget*, TQKeyEvent* ); // def in qaccel.cpp +extern bool tqt_tryComposeUnicode( TQWidget*, TQKeyEvent* ); // def in qaccel.cpp #endif #if defined(QT_TABLET_SUPPORT) bool chokeMouse = FALSE; #endif -void qt_setMaxWindowRect(const TQRect& r) +void tqt_setMaxWindowRect(const TQRect& r) { - qt_maxWindowRect = r; + tqt_maxWindowRect = r; // Re-resize any maximized windows TQWidgetList* l = TQApplication::topLevelWidgets(); if ( l ) { @@ -510,11 +510,11 @@ TQString *TQApplication::session_key = 0; // ## session key. Should be a member #endif TQWidgetList *TQApplication::popupWidgets = 0; // has keyboard input focus -TQDesktopWidget *qt_desktopWidget = 0; // root window widgets +TQDesktopWidget *tqt_desktopWidget = 0; // root window widgets #ifndef QT_NO_CLIPBOARD -TQClipboard *qt_clipboard = 0; // global clipboard object +TQClipboard *tqt_clipboard = 0; // global clipboard object #endif -TQWidgetList * qt_modal_stack=0; // stack of modal widgets +TQWidgetList * tqt_modal_stack=0; // stack of modal widgets // Definitions for posted events struct TQPostEvent { @@ -553,12 +553,12 @@ uint qGlobalPostedEventsCount() static TQSingleCleanupHandler<TQPostEventList> qapp_cleanup_events; #ifndef QT_NO_PALETTE -TQPalette *qt_std_pal = 0; +TQPalette *tqt_std_pal = 0; -void qt_create_std_palette() +void tqt_create_std_palette() { - if ( qt_std_pal ) - delete qt_std_pal; + if ( tqt_std_pal ) + delete tqt_std_pal; TQColor standardLightGray( 192, 192, 192 ); TQColor light( 255, 255, 255 ); @@ -572,10 +572,10 @@ void qt_create_std_palette() TQColorGroup std_inact( TQt::black, standardLightGray, light, dark, TQt::gray, TQt::black, TQt::white ); - qt_std_pal = new TQPalette( std_act, std_dis, std_inact ); + tqt_std_pal = new TQPalette( std_act, std_dis, std_inact ); } -static void qt_fix_tooltips() +static void tqt_fix_tooltips() { // No resources for this yet (unlike on Windows). TQColorGroup cg( TQt::black, TQColor(255,255,220), @@ -589,7 +589,7 @@ static void qt_fix_tooltips() void TQApplication::process_cmdline( int* argcptr, char ** argv ) { // process platform-indep command line - if ( !qt_is_gui_used || !*argcptr) + if ( !tqt_is_gui_used || !*argcptr) return; int argc = *argcptr; @@ -789,7 +789,7 @@ TQApplication::TQApplication( int &argc, char **argv, Type type ) construct( argc, argv, type ); } -Q_EXPORT void qt_ucm_initialize( TQApplication *theApp ) +Q_EXPORT void tqt_ucm_initialize( TQApplication *theApp ) { if ( tqApp ) return; @@ -802,8 +802,8 @@ Q_EXPORT void qt_ucm_initialize( TQApplication *theApp ) void TQApplication::construct( int &argc, char **argv, Type type ) { - qt_appType = type; - qt_is_gui_used = (type != Tty); + tqt_appType = type; + tqt_is_gui_used = (type != Tty); init_precmdline(); static const char *empty = ""; if ( argc == 0 || argv == 0 ) { @@ -813,11 +813,11 @@ void TQApplication::construct( int &argc, char **argv, Type type ) app_argc = argc; app_argv = argv; - qt_init( &argc, argv, type ); // Must be called before initialize() + tqt_init( &argc, argv, type ); // Must be called before initialize() process_cmdline( &argc, argv ); initialize( argc, argv ); - if ( qt_is_gui_used ) - qt_maxWindowRect = desktop()->rect(); + if ( tqt_is_gui_used ) + tqt_maxWindowRect = desktop()->rect(); if ( eventloop ) eventloop->appStartingUp(); } @@ -828,7 +828,7 @@ void TQApplication::construct( int &argc, char **argv, Type type ) TQApplication::Type TQApplication::type() const { - return qt_appType; + return tqt_appType; } #if defined(Q_WS_X11) @@ -854,9 +854,9 @@ TQApplication::TQApplication( Display* dpy, HANDLE visual, HANDLE colormap ) app_argc = aargc; app_argv = aargv; - qt_appType = GuiClient; - qt_is_gui_used = TRUE; - qt_appType = GuiClient; + tqt_appType = GuiClient; + tqt_is_gui_used = TRUE; + tqt_appType = GuiClient; init_precmdline(); // ... no command line. @@ -865,15 +865,15 @@ TQApplication::TQApplication( Display* dpy, HANDLE visual, HANDLE colormap ) tqWarning( "TQApplication: invalid Display* argument." ); #endif // QT_CHECK_STATE - qt_init( &aargc, aargv, GuiClient ); + tqt_init( &aargc, aargv, GuiClient ); } else { - qt_init( dpy, visual, colormap ); + tqt_init( dpy, visual, colormap ); } initialize( aargc, aargv ); - if ( qt_is_gui_used ) - qt_maxWindowRect = desktop()->rect(); + if ( tqt_is_gui_used ) + tqt_maxWindowRect = desktop()->rect(); if ( eventloop ) eventloop->appStartingUp(); } @@ -893,9 +893,9 @@ TQApplication::TQApplication( Display* dpy, HANDLE visual, HANDLE colormap ) TQApplication::TQApplication(Display *dpy, int argc, char **argv, HANDLE visual, HANDLE colormap) { - qt_appType = GuiClient; - qt_is_gui_used = TRUE; - qt_appType = GuiClient; + tqt_appType = GuiClient; + tqt_is_gui_used = TRUE; + tqt_appType = GuiClient; init_precmdline(); app_argc = argc; @@ -906,16 +906,16 @@ TQApplication::TQApplication(Display *dpy, int argc, char **argv, tqWarning( "TQApplication: invalid Display* argument." ); #endif // QT_CHECK_STATE - qt_init( &argc, argv, GuiClient ); + tqt_init( &argc, argv, GuiClient ); } else { - qt_init(dpy, visual, colormap); + tqt_init(dpy, visual, colormap); } process_cmdline( &argc, argv ); initialize(argc, argv); - if ( qt_is_gui_used ) - qt_maxWindowRect = desktop()->rect(); + if ( tqt_is_gui_used ) + tqt_maxWindowRect = desktop()->rect(); if ( eventloop ) eventloop->appStartingUp(); } @@ -945,9 +945,9 @@ void TQApplication::init_precmdline() void TQApplication::initialize( int argc, char **argv ) { #ifdef QT_THREAD_SUPPORT - qt_mutex = new TQMutex( TRUE ); + tqt_mutex = new TQMutex( TRUE ); postevent_mutex = new TQMutex( TRUE ); - qt_application_thread_id = TQThread::currentThread(); + tqt_application_thread_id = TQThread::currentThread(); #endif // QT_THREAD_SUPPORT app_argc = argc; @@ -1012,7 +1012,7 @@ TQWidget *TQApplication::activePopupWidget() TQWidget *TQApplication::activeModalWidget() { - return qt_modal_stack ? qt_modal_stack->getFirst() : 0; + return tqt_modal_stack ? tqt_modal_stack->getFirst() : 0; } /*! @@ -1024,9 +1024,9 @@ TQApplication::~TQApplication() { #ifndef QT_NO_CLIPBOARD // flush clipboard contents - if ( qt_clipboard ) { + if ( tqt_clipboard ) { TQCustomEvent event( TQEvent::Clipboard ); - TQApplication::sendEvent( qt_clipboard, &event ); + TQApplication::sendEvent( tqt_clipboard, &event ); } #endif @@ -1046,18 +1046,18 @@ TQApplication::~TQApplication() TQObject *tipmanager = child( "toolTipManager", "TQTipManager", FALSE ); delete tipmanager; - delete qt_desktopWidget; - qt_desktopWidget = 0; + delete tqt_desktopWidget; + tqt_desktopWidget = 0; is_app_closing = TRUE; #ifndef QT_NO_CLIPBOARD - delete qt_clipboard; - qt_clipboard = 0; + delete tqt_clipboard; + tqt_clipboard = 0; #endif TQWidget::destroyMapper(); #ifndef QT_NO_PALETTE - delete qt_std_pal; - qt_std_pal = 0; + delete tqt_std_pal; + tqt_std_pal = 0; delete app_pal; app_pal = 0; delete app_palettes; @@ -1084,7 +1084,7 @@ TQApplication::~TQApplication() delete qt_dnd_manager; #endif - qt_cleanup(); + tqt_cleanup(); #ifndef QT_NO_COMPONENT delete app_libpaths; @@ -1092,8 +1092,8 @@ TQApplication::~TQApplication() #endif #ifdef QT_THREAD_SUPPORT - delete qt_mutex; - qt_mutex = 0; + delete tqt_mutex; + tqt_mutex = 0; delete postevent_mutex; postevent_mutex = 0; #endif // QT_THREAD_SUPPORT @@ -1115,8 +1115,8 @@ TQApplication::~TQApplication() session_key = 0; #endif //QT_NO_SESSIONMANAGER - qt_explicit_app_style = FALSE; - qt_app_has_font = FALSE; + tqt_explicit_app_style = FALSE; + tqt_app_has_font = FALSE; app_tracking = 0; obey_desktop_settings = TRUE; cursor_flash_time = 1000; @@ -1213,7 +1213,7 @@ TQStyle& TQApplication::style() #ifndef QT_NO_STYLE if ( app_style ) return *app_style; - if ( !qt_is_gui_used ) + if ( !tqt_is_gui_used ) tqFatal( "No style available in non-gui applications!" ); #if defined(Q_WS_X11) @@ -1305,7 +1305,7 @@ void TQApplication::setStyle( TQStyle *style ) TQStyle* old = app_style; app_style = style; #ifdef Q_WS_X11 - qt_explicit_app_style = TRUE; + tqt_explicit_app_style = TRUE; #endif // Q_WS_X11 if ( startingUp() ) { @@ -1332,9 +1332,9 @@ void TQApplication::setStyle( TQStyle *style ) // take care of possible palette requirements of certain gui // styles. Do it before polishing the application since the style // might call TQApplication::setStyle() itself - if ( !qt_std_pal ) - qt_create_std_palette(); - TQPalette tmpPal = *qt_std_pal; + if ( !tqt_std_pal ) + tqt_create_std_palette(); + TQPalette tmpPal = *tqt_std_pal; setPalette( tmpPal, TRUE ); // initialize the application with the new style @@ -1381,7 +1381,7 @@ void TQApplication::setStyle( TQStyle *style ) TQStyle* TQApplication::setStyle( const TQString& style ) { #ifdef Q_WS_X11 - qt_explicit_app_style = TRUE; + tqt_explicit_app_style = TRUE; #endif // Q_WS_X11 if ( startingUp() ) { @@ -1826,10 +1826,10 @@ TQPalette TQApplication::palette(const TQWidget* w) "called after the TQApplication object has been created" ); #endif if ( !app_pal ) { - if ( !qt_std_pal ) - qt_create_std_palette(); - app_pal = new TQPalette( *qt_std_pal ); - qt_fix_tooltips(); + if ( !tqt_std_pal ) + tqt_create_std_palette(); + app_pal = new TQPalette( *tqt_std_pal ); + tqt_fix_tooltips(); } if ( w && app_palettes ) { @@ -1885,7 +1885,7 @@ void TQApplication::setPalette( const TQPalette &palette, bool informWidgets, all = app_palettes != 0; delete app_palettes; app_palettes = 0; - qt_fix_tooltips(); + tqt_fix_tooltips(); } else { if ( !app_palettes ) { app_palettes = new TQAsciiDict<TQPalette>; @@ -1961,7 +1961,7 @@ void TQApplication::setFont( const TQFont &font, bool informWidgets, { bool all = FALSE; if ( !className ) { - qt_app_has_font = TRUE; + tqt_app_has_font = TRUE; if ( !app_font ) { app_font = new TQFont( font ); TQ_CHECK_PTR( app_font ); @@ -2367,7 +2367,7 @@ bool TQApplication::notify( TQObject *receiver, TQEvent *e ) res = internalNotify( receiver, e ); if ( !res && !key->isAccepted() ) - res = qt_dispatchAccelEvent( (TQWidget*)receiver, key ); + res = tqt_dispatchAccelEvent( (TQWidget*)receiver, key ); // next lines are for compatibility with TQt <= 3.0.x: old // TQAccel was listening on toplevel widgets @@ -2383,7 +2383,7 @@ bool TQApplication::notify( TQObject *receiver, TQEvent *e ) TQWidget* w = (TQWidget*)receiver; TQKeyEvent* key = (TQKeyEvent*) e; #ifndef QT_NO_ACCEL - if ( qt_tryComposeUnicode( w, key ) ) + if ( tqt_tryComposeUnicode( w, key ) ) break; #endif bool def = key->isAccepted(); @@ -3596,7 +3596,7 @@ void TQApplication::setActiveWindow( TQWidget* act ) Creates the proper Enter/Leave event when widget \a enter is entered and widget \a leave is left. */ -Q_EXPORT void qt_dispatchEnterLeave( TQWidget* enter, TQWidget* leave ) { +Q_EXPORT void tqt_dispatchEnterLeave( TQWidget* enter, TQWidget* leave ) { #if 0 if ( leave ) { TQEvent e( TQEvent::Leave ); @@ -3666,19 +3666,19 @@ Q_EXPORT void qt_dispatchEnterLeave( TQWidget* enter, TQWidget* leave ) { TQEvent leaveEvent( TQEvent::Leave ); for ( w = leaveList.first(); w; w = leaveList.next() ) { - if ( !tqApp->activeModalWidget() || qt_tryModalHelper( w, 0 )) + if ( !tqApp->activeModalWidget() || tqt_tryModalHelper( w, 0 )) TQApplication::sendEvent( w, &leaveEvent ); } TQEvent enterEvent( TQEvent::Enter ); for ( w = enterList.first(); w; w = enterList.next() ) { - if ( !tqApp->activeModalWidget() || qt_tryModalHelper( w, 0 )) + if ( !tqApp->activeModalWidget() || tqt_tryModalHelper( w, 0 )) TQApplication::sendEvent( w, &enterEvent ); } } #ifdef Q_WS_MACX -extern TQWidget *qt_tryModalHelperMac( TQWidget * top ); //qapplication_mac.cpp +extern TQWidget *tqt_tryModalHelperMac( TQWidget * top ); //qapplication_mac.cpp #endif @@ -3687,7 +3687,7 @@ extern TQWidget *qt_tryModalHelperMac( TQWidget * top ); //qapplication_mac.cpp Called from qapplication_<platform>.cpp, returns TRUE if the widget should accept the event. */ -Q_EXPORT bool qt_tryModalHelper( TQWidget *widget, TQWidget **rettop ) { +Q_EXPORT bool tqt_tryModalHelper( TQWidget *widget, TQWidget **rettop ) { TQWidget *modal=0, *top=TQApplication::activeModalWidget(); if ( rettop ) *rettop = top; @@ -3695,7 +3695,7 @@ Q_EXPORT bool qt_tryModalHelper( TQWidget *widget, TQWidget **rettop ) { return TRUE; #ifdef Q_WS_MACX - top = qt_tryModalHelperMac( top ); + top = tqt_tryModalHelperMac( top ); if ( rettop ) *rettop = top; #endif @@ -3718,15 +3718,15 @@ Q_EXPORT bool qt_tryModalHelper( TQWidget *widget, TQWidget **rettop ) { groupLeader = groupLeader->parentWidget(); if ( groupLeader ) { - // Does groupLeader have a child in qt_modal_stack? + // Does groupLeader have a child in tqt_modal_stack? bool unrelated = TRUE; - modal = qt_modal_stack->first(); + modal = tqt_modal_stack->first(); while (modal && unrelated) { TQWidget* p = modal->parentWidget(); while ( p && p != groupLeader && !p->testWFlags( TQt::WGroupLeader) ) { p = p->parentWidget(); } - modal = qt_modal_stack->next(); + modal = tqt_modal_stack->next(); if ( p == groupLeader ) unrelated = FALSE; } @@ -3754,12 +3754,12 @@ Q_EXPORT bool qt_tryModalHelper( TQWidget *widget, TQWidget **rettop ) { TQDesktopWidget *TQApplication::desktop() { - if ( !qt_desktopWidget || // not created yet - !qt_desktopWidget->isDesktop() ) { // reparented away - qt_desktopWidget = new TQDesktopWidget(); - TQ_CHECK_PTR( qt_desktopWidget ); + if ( !tqt_desktopWidget || // not created yet + !tqt_desktopWidget->isDesktop() ) { // reparented away + tqt_desktopWidget = new TQDesktopWidget(); + TQ_CHECK_PTR( tqt_desktopWidget ); } - return qt_desktopWidget; + return tqt_desktopWidget; } #ifndef QT_NO_CLIPBOARD @@ -3768,11 +3768,11 @@ TQDesktopWidget *TQApplication::desktop() */ TQClipboard *TQApplication::clipboard() { - if ( qt_clipboard == 0 ) { - qt_clipboard = new TQClipboard; - TQ_CHECK_PTR( qt_clipboard ); + if ( tqt_clipboard == 0 ) { + tqt_clipboard = new TQClipboard; + TQ_CHECK_PTR( tqt_clipboard ); } - return qt_clipboard; + return tqt_clipboard; } #endif // QT_NO_CLIPBOARD @@ -3859,12 +3859,12 @@ bool TQApplication::desktopSettingsAware() #if defined(QT_THREAD_SUPPORT) void TQApplication::lock() { - qt_mutex->lock(); + tqt_mutex->lock(); } void TQApplication::unlock(bool wakeUpGui) { - qt_mutex->unlock(); + tqt_mutex->unlock(); if (wakeUpGui) wakeUpGuiThread(); @@ -3872,12 +3872,12 @@ void TQApplication::unlock(bool wakeUpGui) bool TQApplication::locked() { - return qt_mutex->locked(); + return tqt_mutex->locked(); } bool TQApplication::tryLock() { - return qt_mutex->tryLock(); + return tqt_mutex->tryLock(); } #endif |