diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-03-06 20:38:40 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-03-06 20:38:40 -0600 |
commit | eb1d1e0dec5720ace27395e290b7093cd68b150d (patch) | |
tree | 04a199ef5ea853d86a6f9a44716c0874d41c20f6 /src/kernel/qapplication_x11.cpp | |
parent | ae8aba1e0f17943046e6bfa889b169f7fc41da0d (diff) | |
download | tqt3-eb1d1e0dec5720ace27395e290b7093cd68b150d.tar.gz tqt3-eb1d1e0dec5720ace27395e290b7093cd68b150d.zip |
Automated update from qt3
Diffstat (limited to 'src/kernel/qapplication_x11.cpp')
-rw-r--r-- | src/kernel/qapplication_x11.cpp | 152 |
1 files changed, 76 insertions, 76 deletions
diff --git a/src/kernel/qapplication_x11.cpp b/src/kernel/qapplication_x11.cpp index 44ff475c8..874afe060 100644 --- a/src/kernel/qapplication_x11.cpp +++ b/src/kernel/qapplication_x11.cpp @@ -228,7 +228,7 @@ Atom qt_net_wm_ping = 0; // _NET_WM_PING protocol static Atom qt_xsetroot_id = 0; Atom qt_xa_clipboard = 0; Atom qt_selection_property = 0; -Atom qt_clipboard_sentinel = 0; +Atom tqt_clipboard_sentinel = 0; Atom qt_selection_sentinel = 0; Q_EXPORT Atom tqt_wm_state = 0; Atom qt_wm_change_state = 0; @@ -359,7 +359,7 @@ static Time mouseButtonPressTime = 0; // when was a button pressed static short mouseXPos, mouseYPos; // mouse pres position in act window static short mouseGlobalXPos, mouseGlobalYPos; // global mouse press position -extern TQWidgetList *qt_modal_stack; // stack of modal widgets +extern TQWidgetList *tqt_modal_stack; // stack of modal widgets static bool ignoreNextMouseReleaseEvent = FALSE; // ignore the next mouse release // event if return from a modal // widget @@ -442,14 +442,14 @@ extern bool qt_check_clipboard_sentinel(); //def in qclipboard_x11.cpp extern bool qt_check_selection_sentinel(); //def in qclipboard_x11.cpp static void qt_save_rootinfo(); -bool qt_try_modal( TQWidget *, XEvent * ); +bool tqt_try_modal( TQWidget *, XEvent * ); int qt_ncols_option = 216; // used in qcolor_x11.cpp int qt_visual_option = -1; bool qt_cmap_option = FALSE; TQWidget *qt_button_down = 0; // widget got last button-down -extern bool qt_tryAccelEvent( TQWidget*, TQKeyEvent* ); // def in qaccel.cpp +extern bool tqt_tryAccelEvent( TQWidget*, TQKeyEvent* ); // def in qaccel.cpp struct TQScrollInProgress { static long serial; @@ -491,8 +491,8 @@ extern Atom qt_xdnd_selection; extern bool qt_xdnd_dragging; // gui or non-gui from qapplication.cpp -extern bool qt_is_gui_used; -extern bool qt_app_has_font; +extern bool tqt_is_gui_used; +extern bool tqt_app_has_font; static bool qt_x11_cmdline_font = false; @@ -505,8 +505,8 @@ extern void qt_clear_paintevent_clipping(); // Palette handling -extern TQPalette *qt_std_pal; -extern void qt_create_std_palette(); +extern TQPalette *tqt_std_pal; +extern void tqt_create_std_palette(); void qt_x11_intern_atom( const char *, Atom * ); @@ -819,7 +819,7 @@ static int qt_xio_errhandler( Display * ) #endif -// Memory leak: if the app exits before qt_init_internal(), this dict +// Memory leak: if the app exits before tqt_init_internal(), this dict // isn't released correctly. static TQAsciiDict<Atom> *atoms_to_be_created = 0; static bool create_atoms_now = 0; @@ -828,7 +828,7 @@ static bool create_atoms_now = 0; qt_x11_intern_atom() - efficiently interns an atom, now or later. If the application is being initialized, this function stores the - adddress of the atom and qt_init_internal will do the actual work + adddress of the atom and tqt_init_internal will do the actual work tquickly. If the application is running, the atom is created here. Neither argument may point to temporary variables. @@ -902,8 +902,8 @@ static void qt_x11_process_intern_atoms() */ bool TQApplication::x11_apply_settings() { - if (! qt_std_pal) - qt_create_std_palette(); + if (! tqt_std_pal) + tqt_create_std_palette(); Atom type; int format; @@ -1000,13 +1000,13 @@ bool TQApplication::x11_apply_settings() pal.disabled().foreground() ); } - if (pal != *qt_std_pal && pal != TQApplication::palette()) { + if (pal != *tqt_std_pal && pal != TQApplication::palette()) { TQApplication::setPalette(pal, TRUE); - *qt_std_pal = pal; + *tqt_std_pal = pal; } TQFont font(TQApplication::font()); - if ( !qt_app_has_font && !qt_x11_cmdline_font ) { + if ( !tqt_app_has_font && !qt_x11_cmdline_font ) { // read new font str = settings.readEntry("/qt/font"); if (! str.isNull() && ! str.isEmpty()) { @@ -1028,12 +1028,12 @@ bool TQApplication::x11_apply_settings() } // read new TQStyle - extern bool qt_explicit_app_style; // defined in qapplication.cpp + extern bool tqt_explicit_app_style; // defined in qapplication.cpp TQString stylename = settings.readEntry( "/qt/style" ); - if ( !stylename.isEmpty() && !qt_explicit_app_style ) { + if ( !stylename.isEmpty() && !tqt_explicit_app_style ) { TQApplication::setStyle( stylename ); // took the style from the user settings, so mark the explicit flag FALSE - qt_explicit_app_style = FALSE; + tqt_explicit_app_style = FALSE; } num = @@ -1203,8 +1203,8 @@ static void qt_set_input_encoding() static void qt_set_x11_resources( const char* font = 0, const char* fg = 0, const char* bg = 0, const char* button = 0 ) { - if ( !qt_std_pal ) - qt_create_std_palette(); + if ( !tqt_std_pal ) + tqt_create_std_palette(); TQCString resFont, resFG, resBG, resEF, sysFont; @@ -1303,7 +1303,7 @@ static void qt_set_x11_resources( const char* font = 0, const char* fg = 0, resFG = fg; if ( resBG.isEmpty() ) resBG = bg; - if ( (!qt_app_has_font || qt_x11_cmdline_font) && !resFont.isEmpty() ) { // set application font + if ( (!tqt_app_has_font || qt_x11_cmdline_font) && !resFont.isEmpty() ) { // set application font TQFont fnt; fnt.setRawName( resFont ); @@ -1341,17 +1341,17 @@ static void qt_set_x11_resources( const char* font = 0, const char* fg = 0, if ( !resBG.isEmpty() ) bg = TQColor(TQString(resBG)); else - bg = qt_std_pal->active().background(); + bg = tqt_std_pal->active().background(); if ( !resFG.isEmpty() ) fg = TQColor(TQString(resFG)); else - fg = qt_std_pal->active().foreground(); + fg = tqt_std_pal->active().foreground(); if ( button ) btn = TQColor( button ); else if ( !resBG.isEmpty() ) btn = bg; else - btn = qt_std_pal->active().button(); + btn = tqt_std_pal->active().button(); int h,s,v; fg.hsv(&h,&s,&v); @@ -1384,9 +1384,9 @@ static void qt_set_x11_resources( const char* font = 0, const char* fg = 0, dcg.setColor( TQColorGroup::Highlight, TQt::darkBlue ); } TQPalette pal( cg, dcg, cg ); - if ( pal != *qt_std_pal && pal != TQApplication::palette() ) + if ( pal != *tqt_std_pal && pal != TQApplication::palette() ) TQApplication::setPalette( pal, TRUE ); - *qt_std_pal = pal; + *tqt_std_pal = pal; } if ( !resEF.isEmpty() ) { @@ -1626,7 +1626,7 @@ static Visual *find_truecolor_visual( Display *dpy, int scr, int *depth, int *nc /***************************************************************************** - qt_init() - initializes TQt for X11 + tqt_init() - initializes TQt for X11 *****************************************************************************/ #define XK_MISCELLANY @@ -1639,14 +1639,14 @@ static Visual *find_truecolor_visual( Display *dpy, int scr, int *depth, int *nc // ### in ntqpaintdevice.h which then should have a static too but can't have // ### it because "storage class specifiers invalid in friend function // ### declarations" :-) Ideas anyone? -void qt_init_internal( int *argcptr, char **argv, +void tqt_init_internal( int *argcptr, char **argv, Display *display, TQt::HANDLE visual, TQt::HANDLE colormap ) { setlocale( LC_ALL, "" ); // use correct char set mapping setlocale( LC_NUMERIC, "C" ); // make sprintf()/scanf() work #if defined(QT_THREAD_SUPPORT) - if ( qt_is_gui_used ) { + if ( tqt_is_gui_used ) { XInitThreads(); } #endif @@ -1804,7 +1804,7 @@ void qt_init_internal( int *argcptr, char **argv, #endif // Connect to X server - if( qt_is_gui_used ) { + if( tqt_is_gui_used ) { if ( ( appDpy = XOpenDisplay(appDpyName) ) == 0 ) { tqWarning( "%s: cannot connect to X server %s", appName, XDisplayName(appDpyName) ); @@ -1820,7 +1820,7 @@ void qt_init_internal( int *argcptr, char **argv, // Get X parameters - if( qt_is_gui_used ) { + if( tqt_is_gui_used ) { appScreen = DefaultScreen(appDpy); appScreenCount = ScreenCount(appDpy); @@ -1990,7 +1990,7 @@ void qt_init_internal( int *argcptr, char **argv, qt_x11_intern_atom( "INCR", &qt_x_incr ); qt_x11_intern_atom( "_XSETROOT_ID", &qt_xsetroot_id ); qt_x11_intern_atom( "_QT_SELECTION", &qt_selection_property ); - qt_x11_intern_atom( "_QT_CLIPBOARD_SENTINEL", &qt_clipboard_sentinel ); + qt_x11_intern_atom( "_QT_CLIPBOARD_SENTINEL", &tqt_clipboard_sentinel ); qt_x11_intern_atom( "_QT_SELECTION_SENTINEL", &qt_selection_sentinel ); qt_x11_intern_atom( "_QT_SCROLL_DONE", &qt_qt_scrolldone ); qt_x11_intern_atom( "_QT_INPUT_ENCODING", &qt_input_encoding ); @@ -2205,7 +2205,7 @@ void qt_init_internal( int *argcptr, char **argv, TQThread::initialize(); #endif - if( qt_is_gui_used ) { + if( tqt_is_gui_used ) { tqApp->setName( appName ); int screen; @@ -2221,7 +2221,7 @@ void qt_init_internal( int *argcptr, char **argv, } } - if ( qt_is_gui_used ) { + if ( tqt_is_gui_used ) { qt_set_input_encoding(); qt_set_x11_resources( appFont, appFGCol, appBGCol, appBTNCol); @@ -2235,7 +2235,7 @@ void qt_init_internal( int *argcptr, char **argv, (int) ( ( ( TQPaintDevice::x11AppDpiY() >= 95 ? 17. : 12. ) * 72. / (float) TQPaintDevice::x11AppDpiY() ) + 0.5 ); - if ( !qt_app_has_font && !qt_x11_cmdline_font ) { + if ( !tqt_app_has_font && !qt_x11_cmdline_font ) { TQFont f( "Helvetica", ptsz ); TQApplication::setFont( f ); } @@ -2454,29 +2454,29 @@ void TQApplication::x11_initialize_style() } #endif -void qt_init( int *argcptr, char **argv, TQApplication::Type ) +void tqt_init( int *argcptr, char **argv, TQApplication::Type ) { - qt_init_internal( argcptr, argv, 0, 0, 0 ); + tqt_init_internal( argcptr, argv, 0, 0, 0 ); } -void qt_init( Display *display, TQt::HANDLE visual, TQt::HANDLE colormap ) +void tqt_init( Display *display, TQt::HANDLE visual, TQt::HANDLE colormap ) { - qt_init_internal( 0, 0, display, visual, colormap ); + tqt_init_internal( 0, 0, display, visual, colormap ); } /***************************************************************************** - qt_cleanup() - cleans up when the application is finished + tqt_cleanup() - cleans up when the application is finished *****************************************************************************/ -void qt_cleanup() +void tqt_cleanup() { appliedstamp = 0; if ( app_save_rootinfo ) // root window must keep state qt_save_rootinfo(); - if ( qt_is_gui_used ) { + if ( tqt_is_gui_used ) { TQPixmapCache::clear(); TQPainter::cleanup(); TQCursor::cleanup(); @@ -2503,7 +2503,7 @@ void qt_cleanup() #endif #endif - if ( qt_is_gui_used ) { + if ( tqt_is_gui_used ) { int screen; for ( screen = 0; screen < appScreenCount; screen++ ) { if ( ! TQPaintDevice::x11AppDefaultColormap( screen ) ) @@ -2526,7 +2526,7 @@ void qt_cleanup() XSetErrorHandler( original_x_errhandler ); XSetIOErrorHandler( original_xio_errhandler ); - if ( qt_is_gui_used && !appForeignDpy ) + if ( tqt_is_gui_used && !appForeignDpy ) XCloseDisplay( appDpy ); // close X display appDpy = 0; @@ -2820,7 +2820,7 @@ void TQApplication::setMainWidget( TQWidget *mainWidget ) TQApplication cursor stack *****************************************************************************/ -extern void qt_x11_enforce_cursor( TQWidget * w ); +extern void tqt_x11_enforce_cursor( TQWidget * w ); typedef TQPtrList<TQCursor> TQCursorList; @@ -2886,7 +2886,7 @@ void TQApplication::setOverrideCursor( const TQCursor &cursor, bool replace ) register TQWidget *w; while ( (w=it.current()) ) { // for all widgets that have if ( w->testWState( WState_OwnCursor ) ) - qt_x11_enforce_cursor( w ); + tqt_x11_enforce_cursor( w ); ++it; } XFlush( appDpy ); // make X execute it NOW @@ -2914,7 +2914,7 @@ void TQApplication::restoreOverrideCursor() register TQWidget *w; while ( (w=it.current()) ) { // set back to original cursors if ( w->testWState( WState_OwnCursor ) ) - qt_x11_enforce_cursor( w ); + tqt_x11_enforce_cursor( w ); ++it; } XFlush( appDpy ); @@ -3429,7 +3429,7 @@ int TQApplication::x11ProcessEvent( XEvent* event ) if ( event->type == PropertyNotify ) { // some properties changed if ( event->xproperty.window == TQPaintDevice::x11AppRootWindow( 0 ) ) { // root properties for the first screen - if ( event->xproperty.atom == qt_clipboard_sentinel ) { + if ( event->xproperty.atom == tqt_clipboard_sentinel ) { if (qt_check_clipboard_sentinel() ) emit clipboard()->dataChanged(); } else if ( event->xproperty.atom == qt_selection_sentinel ) { @@ -3493,7 +3493,7 @@ int TQApplication::x11ProcessEvent( XEvent* event ) widget = keywidget; // send XKeyEvents through keywidget->x11Event() if ( app_do_modal ) // modal event handling - if ( !qt_try_modal(widget, event) ) { + if ( !tqt_try_modal(widget, event) ) { if ( event->type == ClientMessage ) x11ClientMessage( widget, event, TRUE ); return 1; @@ -3638,7 +3638,7 @@ int TQApplication::x11ProcessEvent( XEvent* event ) if ( qt_focus_model == FocusModel_PointerRoot ) // PointerRoot mode setActiveWindow( widget ); } - qt_dispatchEnterLeave( widget, TQWidget::find( curWin ) ); + tqt_dispatchEnterLeave( widget, TQWidget::find( curWin ) ); curWin = widget->winId(); widget->translateMouseEvent( event ); //we don't get MotionNotify, emulate it } @@ -3689,9 +3689,9 @@ int TQApplication::x11ProcessEvent( XEvent* event ) } if ( !curWin ) - qt_dispatchEnterLeave( widget, 0 ); + tqt_dispatchEnterLeave( widget, 0 ); - qt_dispatchEnterLeave( enter, widget ); + tqt_dispatchEnterLeave( enter, widget ); curWin = enter ? enter->winId() : 0; } break; @@ -3761,9 +3761,9 @@ int TQApplication::x11ProcessEvent( XEvent* event ) if ( qt_xdnd_selection && req->selection == qt_xdnd_selection ) { qt_xdnd_handle_selection_request( req ); - } else if (qt_clipboard) { + } else if (tqt_clipboard) { TQCustomEvent e( TQEvent::Clipboard, event ); - TQApplication::sendSpontaneousEvent( qt_clipboard, &e ); + TQApplication::sendSpontaneousEvent( tqt_clipboard, &e ); } break; } @@ -3773,9 +3773,9 @@ int TQApplication::x11ProcessEvent( XEvent* event ) if (! req || qt_xdnd_selection && req->selection == qt_xdnd_selection) break; - if (qt_clipboard) { + if (tqt_clipboard) { TQCustomEvent e( TQEvent::Clipboard, event ); - TQApplication::sendSpontaneousEvent( qt_clipboard, &e ); + TQApplication::sendSpontaneousEvent( tqt_clipboard, &e ); } break; } @@ -3786,9 +3786,9 @@ int TQApplication::x11ProcessEvent( XEvent* event ) if (! req || qt_xdnd_selection && req->selection == qt_xdnd_selection) break; - if (qt_clipboard) { + if (tqt_clipboard) { TQCustomEvent e( TQEvent::Clipboard, event ); - TQApplication::sendSpontaneousEvent( qt_clipboard, &e ); + TQApplication::sendSpontaneousEvent( tqt_clipboard, &e ); } break; } @@ -3826,12 +3826,12 @@ bool TQApplication::x11EventFilter( XEvent * ) A modal widget without a parent becomes application-modal. A modal widget with a parent becomes modal to its parent and grandparents.. - qt_enter_modal() + tqt_enter_modal() Enters modal state Arguments: TQWidget *widget A modal widget - qt_leave_modal() + tqt_leave_modal() Leaves modal state for a widget Arguments: TQWidget *widget A modal widget @@ -3842,38 +3842,38 @@ bool tqt_modal_state() return app_do_modal; } -void qt_enter_modal( TQWidget *widget ) +void tqt_enter_modal( TQWidget *widget ) { - if ( !qt_modal_stack ) { // create modal stack - qt_modal_stack = new TQWidgetList; - TQ_CHECK_PTR( qt_modal_stack ); + if ( !tqt_modal_stack ) { // create modal stack + tqt_modal_stack = new TQWidgetList; + TQ_CHECK_PTR( tqt_modal_stack ); } if (widget->parentWidget()) { TQEvent e(TQEvent::WindowBlocked); TQApplication::sendEvent(widget->parentWidget(), &e); } - qt_dispatchEnterLeave( 0, TQWidget::find((WId)curWin) ); - qt_modal_stack->insert( 0, widget ); + tqt_dispatchEnterLeave( 0, TQWidget::find((WId)curWin) ); + tqt_modal_stack->insert( 0, widget ); app_do_modal = TRUE; curWin = 0; ignoreNextMouseReleaseEvent = FALSE; } -void qt_leave_modal( TQWidget *widget ) +void tqt_leave_modal( TQWidget *widget ) { - if ( qt_modal_stack && qt_modal_stack->removeRef(widget) ) { - if ( qt_modal_stack->isEmpty() ) { - delete qt_modal_stack; - qt_modal_stack = 0; + if ( tqt_modal_stack && tqt_modal_stack->removeRef(widget) ) { + if ( tqt_modal_stack->isEmpty() ) { + delete tqt_modal_stack; + tqt_modal_stack = 0; TQPoint p( TQCursor::pos() ); TQWidget* w = TQApplication::widgetAt( p.x(), p.y(), TRUE ); - qt_dispatchEnterLeave( w, TQWidget::find( curWin ) ); // send synthetic enter event + tqt_dispatchEnterLeave( w, TQWidget::find( curWin ) ); // send synthetic enter event curWin = w? w->winId() : 0; } } - app_do_modal = qt_modal_stack != 0; + app_do_modal = tqt_modal_stack != 0; ignoreNextMouseReleaseEvent = TRUE; if (widget->parentWidget()) { @@ -3883,7 +3883,7 @@ void qt_leave_modal( TQWidget *widget ) } -Q_EXPORT bool qt_try_modal( TQWidget *widget, XEvent *event ) +Q_EXPORT bool tqt_try_modal( TQWidget *widget, XEvent *event ) { if (qt_xdnd_dragging) { // allow mouse events while DnD is active @@ -3897,7 +3897,7 @@ Q_EXPORT bool qt_try_modal( TQWidget *widget, XEvent *event ) } } - if ( qt_tryModalHelper( widget ) ) + if ( tqt_tryModalHelper( widget ) ) return TRUE; bool block_event = FALSE; @@ -5571,7 +5571,7 @@ bool TQETWidget::translateKeyEvent( const XEvent *event, bool grab ) // send accel events if the keyboard is not grabbed TQKeyEvent a( type, code, ascii, state, text, autor, TQMAX( TQMAX(count,1), int(text.length())) ); - if ( qt_tryAccelEvent( this, &a ) ) + if ( tqt_tryAccelEvent( this, &a ) ) return TRUE; } |