|
|
@ -95,7 +95,7 @@
|
|
|
|
#include <kmdcodec.h>
|
|
|
|
#include <kmdcodec.h>
|
|
|
|
#include <kglobalaccel.h>
|
|
|
|
#include <kglobalaccel.h>
|
|
|
|
|
|
|
|
|
|
|
|
#if defined Q_WS_X11
|
|
|
|
#if defined TQ_WS_X11
|
|
|
|
#include <tdestartupinfo.h>
|
|
|
|
#include <tdestartupinfo.h>
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
@ -110,7 +110,7 @@
|
|
|
|
#include <grp.h>
|
|
|
|
#include <grp.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef Q_WS_WIN
|
|
|
|
#ifndef TQ_WS_WIN
|
|
|
|
#include "twin.h"
|
|
|
|
#include "twin.h"
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
@ -123,8 +123,8 @@
|
|
|
|
#include <errno.h>
|
|
|
|
#include <errno.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <netdb.h>
|
|
|
|
#include <netdb.h>
|
|
|
|
#if defined Q_WS_X11
|
|
|
|
#if defined TQ_WS_X11
|
|
|
|
//#ifndef Q_WS_QWS //FIXME(E): NetWM should talk to QWS...
|
|
|
|
//#ifndef TQ_WS_QWS //FIXME(E): NetWM should talk to QWS...
|
|
|
|
#include <netwm.h>
|
|
|
|
#include <netwm.h>
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
@ -134,7 +134,7 @@
|
|
|
|
#include <paths.h>
|
|
|
|
#include <paths.h>
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef Q_WS_X11
|
|
|
|
#ifdef TQ_WS_X11
|
|
|
|
#include <X11/Xlib.h>
|
|
|
|
#include <X11/Xlib.h>
|
|
|
|
#ifdef COMPOSITE
|
|
|
|
#ifdef COMPOSITE
|
|
|
|
#include <X11/extensions/Xrender.h>
|
|
|
|
#include <X11/extensions/Xrender.h>
|
|
|
@ -149,7 +149,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
#include <pwd.h>
|
|
|
|
#include <pwd.h>
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef Q_WS_WIN
|
|
|
|
#ifndef TQ_WS_WIN
|
|
|
|
#include <KDE-ICE/ICElib.h>
|
|
|
|
#include <KDE-ICE/ICElib.h>
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
typedef void* IceIOErrorHandler;
|
|
|
|
typedef void* IceIOErrorHandler;
|
|
|
@ -160,22 +160,22 @@ typedef void* IceIOErrorHandler;
|
|
|
|
#define Button3Mask (1<<10)
|
|
|
|
#define Button3Mask (1<<10)
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef Q_WS_X11
|
|
|
|
#ifdef TQ_WS_X11
|
|
|
|
#define DISPLAY "DISPLAY"
|
|
|
|
#define DISPLAY "DISPLAY"
|
|
|
|
#elif defined(Q_WS_QWS)
|
|
|
|
#elif defined(TQ_WS_QWS)
|
|
|
|
#define DISPLAY "QWS_DISPLAY"
|
|
|
|
#define DISPLAY "QWS_DISPLAY"
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if defined Q_WS_X11
|
|
|
|
#if defined TQ_WS_X11
|
|
|
|
#include <kipc.h>
|
|
|
|
#include <kipc.h>
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef Q_WS_MACX
|
|
|
|
#ifdef TQ_WS_MACX
|
|
|
|
#include <Carbon/Carbon.h>
|
|
|
|
#include <Carbon/Carbon.h>
|
|
|
|
#include <tqimage.h>
|
|
|
|
#include <tqimage.h>
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if defined Q_WS_X11
|
|
|
|
#if defined TQ_WS_X11
|
|
|
|
#include <sys/ioctl.h>
|
|
|
|
#include <sys/ioctl.h>
|
|
|
|
#ifdef __linux__
|
|
|
|
#ifdef __linux__
|
|
|
|
#include <linux/vt.h>
|
|
|
|
#include <linux/vt.h>
|
|
|
@ -197,12 +197,12 @@ bool TDEApplication::loadedByKdeinit = false;
|
|
|
|
DCOPClient *TDEApplication::s_DCOPClient = 0L;
|
|
|
|
DCOPClient *TDEApplication::s_DCOPClient = 0L;
|
|
|
|
bool TDEApplication::s_dcopClientNeedsPostInit = false;
|
|
|
|
bool TDEApplication::s_dcopClientNeedsPostInit = false;
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef Q_WS_X11
|
|
|
|
#ifdef TQ_WS_X11
|
|
|
|
static Atom atom_DesktopWindow;
|
|
|
|
static Atom atom_DesktopWindow;
|
|
|
|
static Atom atom_NetSupported;
|
|
|
|
static Atom atom_NetSupported;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if defined(Q_WS_X11) && defined(COMPOSITE)
|
|
|
|
#if defined(TQ_WS_X11) && defined(COMPOSITE)
|
|
|
|
static int composite_event, composite_error, composite_opcode;
|
|
|
|
static int composite_event, composite_error, composite_opcode;
|
|
|
|
static bool x11_composite_error_generated;
|
|
|
|
static bool x11_composite_error_generated;
|
|
|
|
static int x11_error(Display *dpy, XErrorEvent *ev) {
|
|
|
|
static int x11_error(Display *dpy, XErrorEvent *ev) {
|
|
|
@ -221,7 +221,7 @@ TDECORE_EXPORT bool tqt_qclipboard_bailout_hack = false;
|
|
|
|
|
|
|
|
|
|
|
|
template class TQPtrList<KSessionManaged>;
|
|
|
|
template class TQPtrList<KSessionManaged>;
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef Q_WS_X11
|
|
|
|
#ifdef TQ_WS_X11
|
|
|
|
extern "C" {
|
|
|
|
extern "C" {
|
|
|
|
static int kde_xio_errhandler( Display * dpy )
|
|
|
|
static int kde_xio_errhandler( Display * dpy )
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -245,13 +245,13 @@ static void kde_ice_ioerrorhandler( IceConn conn )
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef Q_WS_WIN
|
|
|
|
#ifdef TQ_WS_WIN
|
|
|
|
void TDEApplication_init_windows(bool GUIenabled);
|
|
|
|
void TDEApplication_init_windows(bool GUIenabled);
|
|
|
|
|
|
|
|
|
|
|
|
class QAssistantClient;
|
|
|
|
class QAssistantClient;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef Q_WS_X11
|
|
|
|
#ifdef TQ_WS_X11
|
|
|
|
// --------------------------------------------------------------------------------------
|
|
|
|
// --------------------------------------------------------------------------------------
|
|
|
|
// Get the VT number X is running on
|
|
|
|
// Get the VT number X is running on
|
|
|
|
// (code taken from GDM, daemon/getvt.c, GPLv2+)
|
|
|
|
// (code taken from GDM, daemon/getvt.c, GPLv2+)
|
|
|
@ -310,7 +310,7 @@ int get_x_vtnum(Display *dpy)
|
|
|
|
return num;
|
|
|
|
return num;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// --------------------------------------------------------------------------------------
|
|
|
|
// --------------------------------------------------------------------------------------
|
|
|
|
#endif // Q_WS_X11
|
|
|
|
#endif // TQ_WS_X11
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
Private data to make keeping binary compatibility easier
|
|
|
|
Private data to make keeping binary compatibility easier
|
|
|
@ -328,10 +328,10 @@ public:
|
|
|
|
app_started_timer( NULL ),
|
|
|
|
app_started_timer( NULL ),
|
|
|
|
m_KAppDCOPInterface( 0L ),
|
|
|
|
m_KAppDCOPInterface( 0L ),
|
|
|
|
session_save( false )
|
|
|
|
session_save( false )
|
|
|
|
#ifdef Q_WS_X11
|
|
|
|
#ifdef TQ_WS_X11
|
|
|
|
,oldXErrorHandler( NULL )
|
|
|
|
,oldXErrorHandler( NULL )
|
|
|
|
,oldXIOErrorHandler( NULL )
|
|
|
|
,oldXIOErrorHandler( NULL )
|
|
|
|
#elif defined Q_WS_WIN
|
|
|
|
#elif defined TQ_WS_WIN
|
|
|
|
,qassistantclient( 0 )
|
|
|
|
,qassistantclient( 0 )
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -339,7 +339,7 @@ public:
|
|
|
|
|
|
|
|
|
|
|
|
~TDEApplicationPrivate()
|
|
|
|
~TDEApplicationPrivate()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#ifdef Q_WS_WIN
|
|
|
|
#ifdef TQ_WS_WIN
|
|
|
|
delete qassistantclient;
|
|
|
|
delete qassistantclient;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -362,10 +362,10 @@ public:
|
|
|
|
TQTimer* app_started_timer;
|
|
|
|
TQTimer* app_started_timer;
|
|
|
|
KAppDCOPInterface *m_KAppDCOPInterface;
|
|
|
|
KAppDCOPInterface *m_KAppDCOPInterface;
|
|
|
|
bool session_save;
|
|
|
|
bool session_save;
|
|
|
|
#ifdef Q_WS_X11
|
|
|
|
#ifdef TQ_WS_X11
|
|
|
|
int (*oldXErrorHandler)(Display*,XErrorEvent*);
|
|
|
|
int (*oldXErrorHandler)(Display*,XErrorEvent*);
|
|
|
|
int (*oldXIOErrorHandler)(Display*);
|
|
|
|
int (*oldXIOErrorHandler)(Display*);
|
|
|
|
#elif defined Q_WS_WIN
|
|
|
|
#elif defined TQ_WS_WIN
|
|
|
|
QAssistantClient* qassistantclient;
|
|
|
|
QAssistantClient* qassistantclient;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
@ -627,7 +627,7 @@ bool TDEApplication::notify(TQObject *receiver, TQEvent *event)
|
|
|
|
if( t == TQEvent::Show && receiver->isWidgetType())
|
|
|
|
if( t == TQEvent::Show && receiver->isWidgetType())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TQWidget* w = static_cast<TQWidget*>( receiver );
|
|
|
|
TQWidget* w = static_cast<TQWidget*>( receiver );
|
|
|
|
#if defined Q_WS_X11
|
|
|
|
#if defined TQ_WS_X11
|
|
|
|
if( w->isTopLevel() && !startupId().isEmpty() && !static_cast<TQShowEvent*>(event)->spontaneous()) // TODO better done using window group leader?
|
|
|
|
if( w->isTopLevel() && !startupId().isEmpty() && !static_cast<TQShowEvent*>(event)->spontaneous()) // TODO better done using window group leader?
|
|
|
|
TDEStartupInfo::setWindowStartupId( w->winId(), startupId());
|
|
|
|
TDEStartupInfo::setWindowStartupId( w->winId(), startupId());
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
@ -651,7 +651,7 @@ bool TDEApplication::notify(TQObject *receiver, TQEvent *event)
|
|
|
|
if( !ic->isNull())
|
|
|
|
if( !ic->isNull())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
w->setIcon( *ic );
|
|
|
|
w->setIcon( *ic );
|
|
|
|
#if defined Q_WS_X11
|
|
|
|
#if defined TQ_WS_X11
|
|
|
|
KWin::setIcons( w->winId(), *ic, miniIcon());
|
|
|
|
KWin::setIcons( w->winId(), *ic, miniIcon());
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -662,7 +662,7 @@ bool TDEApplication::notify(TQObject *receiver, TQEvent *event)
|
|
|
|
|
|
|
|
|
|
|
|
void TDEApplication::checkAppStartedSlot()
|
|
|
|
void TDEApplication::checkAppStartedSlot()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#if defined Q_WS_X11
|
|
|
|
#if defined TQ_WS_X11
|
|
|
|
TDEStartupInfo::handleAutoAppStartedSending();
|
|
|
|
TDEStartupInfo::handleAutoAppStartedSending();
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -689,7 +689,7 @@ TQString TDEApplication::sessionConfigName() const
|
|
|
|
return TQString("session/%1_%2_%3").arg(name()).arg(sessionId()).arg(sessKey);
|
|
|
|
return TQString("session/%1_%2_%3").arg(name()).arg(sessionId()).arg(sessKey);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef Q_WS_X11
|
|
|
|
#ifdef TQ_WS_X11
|
|
|
|
static SmcConn mySmcConnection = 0;
|
|
|
|
static SmcConn mySmcConnection = 0;
|
|
|
|
static SmcConn tmpSmcConnection = 0;
|
|
|
|
static SmcConn tmpSmcConnection = 0;
|
|
|
|
#else
|
|
|
|
#else
|
|
|
@ -701,7 +701,7 @@ static TQTime* smModificationTime = 0;
|
|
|
|
TDEApplication::TDEApplication( int& argc, char** argv, const TQCString& rAppName,
|
|
|
|
TDEApplication::TDEApplication( int& argc, char** argv, const TQCString& rAppName,
|
|
|
|
bool allowStyles, bool GUIenabled, bool SMenabled ) :
|
|
|
|
bool allowStyles, bool GUIenabled, bool SMenabled ) :
|
|
|
|
TQApplication( argc, argv, GUIenabled, SMenabled ), TDEInstance(rAppName),
|
|
|
|
TQApplication( argc, argv, GUIenabled, SMenabled ), TDEInstance(rAppName),
|
|
|
|
#ifdef Q_WS_X11
|
|
|
|
#ifdef TQ_WS_X11
|
|
|
|
display(0L),
|
|
|
|
display(0L),
|
|
|
|
argb_visual(false),
|
|
|
|
argb_visual(false),
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
@ -729,7 +729,7 @@ TDEApplication::TDEApplication( int& argc, char** argv, const TQCString& rAppNam
|
|
|
|
TDEApplication::TDEApplication( int& argc, char** argv, const TQCString& rAppName,
|
|
|
|
TDEApplication::TDEApplication( int& argc, char** argv, const TQCString& rAppName,
|
|
|
|
bool allowStyles, bool GUIenabled ) :
|
|
|
|
bool allowStyles, bool GUIenabled ) :
|
|
|
|
TQApplication( argc, argv, GUIenabled ), TDEInstance(rAppName),
|
|
|
|
TQApplication( argc, argv, GUIenabled ), TDEInstance(rAppName),
|
|
|
|
#ifdef Q_WS_X11
|
|
|
|
#ifdef TQ_WS_X11
|
|
|
|
display(0L),
|
|
|
|
display(0L),
|
|
|
|
argb_visual(false),
|
|
|
|
argb_visual(false),
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
@ -754,7 +754,7 @@ TDEApplication::TDEApplication( int& argc, char** argv, const TQCString& rAppNam
|
|
|
|
TDEApplication::TDEApplication( bool allowStyles, bool GUIenabled, bool SMenabled ) :
|
|
|
|
TDEApplication::TDEApplication( bool allowStyles, bool GUIenabled, bool SMenabled ) :
|
|
|
|
TQApplication( *TDECmdLineArgs::tqt_argc(), *TDECmdLineArgs::tqt_argv(), GUIenabled, SMenabled ), // We need to be able to run command line apps
|
|
|
|
TQApplication( *TDECmdLineArgs::tqt_argc(), *TDECmdLineArgs::tqt_argv(), GUIenabled, SMenabled ), // We need to be able to run command line apps
|
|
|
|
TDEInstance( TDECmdLineArgs::about),
|
|
|
|
TDEInstance( TDECmdLineArgs::about),
|
|
|
|
#ifdef Q_WS_X11
|
|
|
|
#ifdef TQ_WS_X11
|
|
|
|
display(0L),
|
|
|
|
display(0L),
|
|
|
|
argb_visual(false),
|
|
|
|
argb_visual(false),
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
@ -780,7 +780,7 @@ TDEApplication::TDEApplication( bool allowStyles, bool GUIenabled, bool SMenable
|
|
|
|
TDEApplication::TDEApplication( bool allowStyles, bool GUIenabled ) :
|
|
|
|
TDEApplication::TDEApplication( bool allowStyles, bool GUIenabled ) :
|
|
|
|
TQApplication( *TDECmdLineArgs::tqt_argc(), *TDECmdLineArgs::tqt_argv(), GUIenabled ), // We need to be able to run command line apps
|
|
|
|
TQApplication( *TDECmdLineArgs::tqt_argc(), *TDECmdLineArgs::tqt_argv(), GUIenabled ), // We need to be able to run command line apps
|
|
|
|
TDEInstance( TDECmdLineArgs::about),
|
|
|
|
TDEInstance( TDECmdLineArgs::about),
|
|
|
|
#ifdef Q_WS_X11
|
|
|
|
#ifdef TQ_WS_X11
|
|
|
|
display(0L),
|
|
|
|
display(0L),
|
|
|
|
argb_visual(false),
|
|
|
|
argb_visual(false),
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
@ -800,7 +800,7 @@ TDEApplication::TDEApplication( bool allowStyles, bool GUIenabled ) :
|
|
|
|
d->m_KAppDCOPInterface = new KAppDCOPInterface(this);
|
|
|
|
d->m_KAppDCOPInterface = new KAppDCOPInterface(this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef Q_WS_X11
|
|
|
|
#ifdef TQ_WS_X11
|
|
|
|
TDEApplication::TDEApplication( Display *dpy, bool allowStyles ) :
|
|
|
|
TDEApplication::TDEApplication( Display *dpy, bool allowStyles ) :
|
|
|
|
TQApplication( dpy, *TDECmdLineArgs::tqt_argc(), *TDECmdLineArgs::tqt_argv(),
|
|
|
|
TQApplication( dpy, *TDECmdLineArgs::tqt_argc(), *TDECmdLineArgs::tqt_argv(),
|
|
|
|
getX11RGBAVisual(dpy), getX11RGBAColormap(dpy) ),
|
|
|
|
getX11RGBAVisual(dpy), getX11RGBAColormap(dpy) ),
|
|
|
@ -877,7 +877,7 @@ TDEApplication::TDEApplication( bool allowStyles, bool GUIenabled, TDEInstance*
|
|
|
|
TQApplication( *TDECmdLineArgs::tqt_argc(), *TDECmdLineArgs::tqt_argv(),
|
|
|
|
TQApplication( *TDECmdLineArgs::tqt_argc(), *TDECmdLineArgs::tqt_argv(),
|
|
|
|
GUIenabled ),
|
|
|
|
GUIenabled ),
|
|
|
|
TDEInstance( _instance ),
|
|
|
|
TDEInstance( _instance ),
|
|
|
|
#ifdef Q_WS_X11
|
|
|
|
#ifdef TQ_WS_X11
|
|
|
|
display(0L),
|
|
|
|
display(0L),
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
argb_visual(false),
|
|
|
|
argb_visual(false),
|
|
|
@ -897,7 +897,7 @@ TDEApplication::TDEApplication( bool allowStyles, bool GUIenabled, TDEInstance*
|
|
|
|
d->m_KAppDCOPInterface = new KAppDCOPInterface(this);
|
|
|
|
d->m_KAppDCOPInterface = new KAppDCOPInterface(this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef Q_WS_X11
|
|
|
|
#ifdef TQ_WS_X11
|
|
|
|
TDEApplication::TDEApplication(Display *display, int& argc, char** argv, const TQCString& rAppName,
|
|
|
|
TDEApplication::TDEApplication(Display *display, int& argc, char** argv, const TQCString& rAppName,
|
|
|
|
bool allowStyles, bool GUIenabled ) :
|
|
|
|
bool allowStyles, bool GUIenabled ) :
|
|
|
|
TQApplication( display ), TDEInstance(rAppName),
|
|
|
|
TQApplication( display ), TDEInstance(rAppName),
|
|
|
@ -928,7 +928,7 @@ int TDEApplication::xioErrhandler( Display* dpy )
|
|
|
|
if(kapp)
|
|
|
|
if(kapp)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
emit shutDown();
|
|
|
|
emit shutDown();
|
|
|
|
#ifdef Q_WS_X11
|
|
|
|
#ifdef TQ_WS_X11
|
|
|
|
d->oldXIOErrorHandler( dpy );
|
|
|
|
d->oldXIOErrorHandler( dpy );
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
Q_UNUSED(dpy);
|
|
|
|
Q_UNUSED(dpy);
|
|
|
@ -940,7 +940,7 @@ int TDEApplication::xioErrhandler( Display* dpy )
|
|
|
|
|
|
|
|
|
|
|
|
int TDEApplication::xErrhandler( Display* dpy, void* err_ )
|
|
|
|
int TDEApplication::xErrhandler( Display* dpy, void* err_ )
|
|
|
|
{ // no idea how to make forward decl. for XErrorEvent
|
|
|
|
{ // no idea how to make forward decl. for XErrorEvent
|
|
|
|
#ifdef Q_WS_X11
|
|
|
|
#ifdef TQ_WS_X11
|
|
|
|
XErrorEvent* err = static_cast< XErrorEvent* >( err_ );
|
|
|
|
XErrorEvent* err = static_cast< XErrorEvent* >( err_ );
|
|
|
|
if(kapp)
|
|
|
|
if(kapp)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -955,7 +955,7 @@ void TDEApplication::iceIOErrorHandler( _IceConn *conn )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
emit shutDown();
|
|
|
|
emit shutDown();
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef Q_WS_X11
|
|
|
|
#ifdef TQ_WS_X11
|
|
|
|
if ( d->oldIceIOErrorHandler != NULL )
|
|
|
|
if ( d->oldIceIOErrorHandler != NULL )
|
|
|
|
(*d->oldIceIOErrorHandler)( conn );
|
|
|
|
(*d->oldIceIOErrorHandler)( conn );
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
@ -1000,7 +1000,7 @@ void TDEApplication::init(bool GUIenabled)
|
|
|
|
KApp = this;
|
|
|
|
KApp = this;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef Q_WS_X11 //FIXME(E)
|
|
|
|
#ifdef TQ_WS_X11 //FIXME(E)
|
|
|
|
// create all required atoms in _one_ roundtrip to the X server
|
|
|
|
// create all required atoms in _one_ roundtrip to the X server
|
|
|
|
if ( GUIenabled ) {
|
|
|
|
if ( GUIenabled ) {
|
|
|
|
const int max = 20;
|
|
|
|
const int max = 20;
|
|
|
@ -1031,7 +1031,7 @@ void TDEApplication::init(bool GUIenabled)
|
|
|
|
smw = 0;
|
|
|
|
smw = 0;
|
|
|
|
|
|
|
|
|
|
|
|
// Initial KIPC event mask.
|
|
|
|
// Initial KIPC event mask.
|
|
|
|
#if defined Q_WS_X11
|
|
|
|
#if defined TQ_WS_X11
|
|
|
|
kipcEventMask = (1 << KIPC::StyleChanged) | (1 << KIPC::PaletteChanged) |
|
|
|
|
kipcEventMask = (1 << KIPC::StyleChanged) | (1 << KIPC::PaletteChanged) |
|
|
|
|
(1 << KIPC::FontChanged) | (1 << KIPC::BackgroundChanged) |
|
|
|
|
(1 << KIPC::FontChanged) | (1 << KIPC::BackgroundChanged) |
|
|
|
|
(1 << KIPC::ToolbarStyleChanged) | (1 << KIPC::SettingsChanged) |
|
|
|
|
(1 << KIPC::ToolbarStyleChanged) | (1 << KIPC::SettingsChanged) |
|
|
|
@ -1057,7 +1057,7 @@ void TDEApplication::init(bool GUIenabled)
|
|
|
|
|
|
|
|
|
|
|
|
if (GUIenabled)
|
|
|
|
if (GUIenabled)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#ifdef Q_WS_X11
|
|
|
|
#ifdef TQ_WS_X11
|
|
|
|
// this is important since we fork() to launch the help (Matthias)
|
|
|
|
// this is important since we fork() to launch the help (Matthias)
|
|
|
|
fcntl(ConnectionNumber(tqt_xdisplay()), F_SETFD, FD_CLOEXEC);
|
|
|
|
fcntl(ConnectionNumber(tqt_xdisplay()), F_SETFD, FD_CLOEXEC);
|
|
|
|
// set up the fancy (=robust and error ignoring ) KDE xio error handlers (Matthias)
|
|
|
|
// set up the fancy (=robust and error ignoring ) KDE xio error handlers (Matthias)
|
|
|
@ -1067,7 +1067,7 @@ void TDEApplication::init(bool GUIenabled)
|
|
|
|
|
|
|
|
|
|
|
|
connect( this, TQ_SIGNAL( aboutToQuit() ), this, TQ_SIGNAL( shutDown() ) );
|
|
|
|
connect( this, TQ_SIGNAL( aboutToQuit() ), this, TQ_SIGNAL( shutDown() ) );
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef Q_WS_X11 //FIXME(E)
|
|
|
|
#ifdef TQ_WS_X11 //FIXME(E)
|
|
|
|
display = desktop()->x11Display();
|
|
|
|
display = desktop()->x11Display();
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
@ -1102,7 +1102,7 @@ void TDEApplication::init(bool GUIenabled)
|
|
|
|
d->checkAccelerators = new KCheckAccelerators( this );
|
|
|
|
d->checkAccelerators = new KCheckAccelerators( this );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef Q_WS_MACX
|
|
|
|
#ifdef TQ_WS_MACX
|
|
|
|
if (GUIenabled) {
|
|
|
|
if (GUIenabled) {
|
|
|
|
TQPixmap pixmap = TDEGlobal::iconLoader()->loadIcon( TDECmdLineArgs::appName(),
|
|
|
|
TQPixmap pixmap = TDEGlobal::iconLoader()->loadIcon( TDECmdLineArgs::appName(),
|
|
|
|
TDEIcon::NoGroup, TDEIcon::SizeLarge, TDEIcon::DefaultState, 0L, false );
|
|
|
|
TDEIcon::NoGroup, TDEIcon::SizeLarge, TDEIcon::DefaultState, 0L, false );
|
|
|
@ -1145,7 +1145,7 @@ void TDEApplication::init(bool GUIenabled)
|
|
|
|
pSessionConfig = 0L;
|
|
|
|
pSessionConfig = 0L;
|
|
|
|
bSessionManagement = true;
|
|
|
|
bSessionManagement = true;
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef Q_WS_X11
|
|
|
|
#ifdef TQ_WS_X11
|
|
|
|
// register a communication window for desktop changes (Matthias)
|
|
|
|
// register a communication window for desktop changes (Matthias)
|
|
|
|
if (GUIenabled && kde_have_kipc )
|
|
|
|
if (GUIenabled && kde_have_kipc )
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1156,7 +1156,7 @@ void TDEApplication::init(bool GUIenabled)
|
|
|
|
32, PropModeReplace, (unsigned char *)&data, 1);
|
|
|
|
32, PropModeReplace, (unsigned char *)&data, 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
d->oldIceIOErrorHandler = IceSetIOErrorHandler( kde_ice_ioerrorhandler );
|
|
|
|
d->oldIceIOErrorHandler = IceSetIOErrorHandler( kde_ice_ioerrorhandler );
|
|
|
|
#elif defined(Q_WS_WIN)
|
|
|
|
#elif defined(TQ_WS_WIN)
|
|
|
|
TDEApplication_init_windows(GUIenabled);
|
|
|
|
TDEApplication_init_windows(GUIenabled);
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
// FIXME(E): Implement for Qt Embedded
|
|
|
|
// FIXME(E): Implement for Qt Embedded
|
|
|
@ -1286,7 +1286,7 @@ void TDEApplication::disableSessionManagement() {
|
|
|
|
|
|
|
|
|
|
|
|
void TDEApplication::enableSessionManagement() {
|
|
|
|
void TDEApplication::enableSessionManagement() {
|
|
|
|
bSessionManagement = true;
|
|
|
|
bSessionManagement = true;
|
|
|
|
#ifdef Q_WS_X11
|
|
|
|
#ifdef TQ_WS_X11
|
|
|
|
// Session management support in Qt/TDE is awfully broken.
|
|
|
|
// Session management support in Qt/TDE is awfully broken.
|
|
|
|
// If konqueror disables session management right after its startup,
|
|
|
|
// If konqueror disables session management right after its startup,
|
|
|
|
// and enables it later (preloading stuff), it won't be properly
|
|
|
|
// and enables it later (preloading stuff), it won't be properly
|
|
|
@ -1311,7 +1311,7 @@ void TDEApplication::enableSessionManagement() {
|
|
|
|
bool TDEApplication::requestShutDown(
|
|
|
|
bool TDEApplication::requestShutDown(
|
|
|
|
ShutdownConfirm confirm, ShutdownType sdtype, ShutdownMode sdmode )
|
|
|
|
ShutdownConfirm confirm, ShutdownType sdtype, ShutdownMode sdmode )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#ifdef Q_WS_X11
|
|
|
|
#ifdef TQ_WS_X11
|
|
|
|
TQApplication::syncX();
|
|
|
|
TQApplication::syncX();
|
|
|
|
/* use ksmserver's dcop interface if necessary */
|
|
|
|
/* use ksmserver's dcop interface if necessary */
|
|
|
|
if ( confirm == ShutdownConfirmYes ||
|
|
|
|
if ( confirm == ShutdownConfirmYes ||
|
|
|
@ -1373,7 +1373,7 @@ bool TDEApplication::requestShutDown(
|
|
|
|
|
|
|
|
|
|
|
|
void TDEApplication::propagateSessionManager()
|
|
|
|
void TDEApplication::propagateSessionManager()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#ifdef Q_WS_X11
|
|
|
|
#ifdef TQ_WS_X11
|
|
|
|
TQCString fName = TQFile::encodeName(locateLocal("socket", "KSMserver"));
|
|
|
|
TQCString fName = TQFile::encodeName(locateLocal("socket", "KSMserver"));
|
|
|
|
TQCString display = ::getenv(DISPLAY);
|
|
|
|
TQCString display = ::getenv(DISPLAY);
|
|
|
|
// strip the screen number from the display
|
|
|
|
// strip the screen number from the display
|
|
|
@ -1482,7 +1482,7 @@ static void checkRestartVersion( TQSessionManager& sm )
|
|
|
|
void TDEApplication::saveState( TQSessionManager& sm )
|
|
|
|
void TDEApplication::saveState( TQSessionManager& sm )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
d->session_save = true;
|
|
|
|
d->session_save = true;
|
|
|
|
#ifdef Q_WS_X11
|
|
|
|
#ifdef TQ_WS_X11
|
|
|
|
static bool firstTime = true;
|
|
|
|
static bool firstTime = true;
|
|
|
|
mySmcConnection = (SmcConn) sm.handle();
|
|
|
|
mySmcConnection = (SmcConn) sm.handle();
|
|
|
|
|
|
|
|
|
|
|
@ -1568,7 +1568,7 @@ bool TDEApplication::sessionSaving() const
|
|
|
|
|
|
|
|
|
|
|
|
void TDEApplication::startKdeinit()
|
|
|
|
void TDEApplication::startKdeinit()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#ifndef Q_WS_WIN //TODO
|
|
|
|
#ifndef TQ_WS_WIN //TODO
|
|
|
|
TDEInstance inst( "starttdeinitlock" );
|
|
|
|
TDEInstance inst( "starttdeinitlock" );
|
|
|
|
TDELockFile lock( locateLocal( "tmp", "starttdeinitlock", &inst ));
|
|
|
|
TDELockFile lock( locateLocal( "tmp", "starttdeinitlock", &inst ));
|
|
|
|
if( lock.lock( TDELockFile::LockNoBlock ) != TDELockFile::LockOK ) {
|
|
|
|
if( lock.lock( TDELockFile::LockNoBlock ) != TDELockFile::LockOK ) {
|
|
|
@ -1602,7 +1602,7 @@ void TDEApplication::dcopFailure(const TQString &msg)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (failureCount == 2)
|
|
|
|
if (failureCount == 2)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#ifdef Q_WS_WIN
|
|
|
|
#ifdef TQ_WS_WIN
|
|
|
|
TDEGlobal::config()->setGroup("General");
|
|
|
|
TDEGlobal::config()->setGroup("General");
|
|
|
|
if (TDEGlobal::config()->readBoolEntry("ignoreDCOPFailures", false))
|
|
|
|
if (TDEGlobal::config()->readBoolEntry("ignoreDCOPFailures", false))
|
|
|
|
return;
|
|
|
|
return;
|
|
|
@ -1635,7 +1635,7 @@ void TDEApplication::dcopFailure(const TQString &msg)
|
|
|
|
static const TDECmdLineOptions qt_options[] =
|
|
|
|
static const TDECmdLineOptions qt_options[] =
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//FIXME: Check if other options are specific to Qt/X11
|
|
|
|
//FIXME: Check if other options are specific to Qt/X11
|
|
|
|
#ifdef Q_WS_X11
|
|
|
|
#ifdef TQ_WS_X11
|
|
|
|
{ "display <displayname>", I18N_NOOP("Use the X-server display 'displayname'"), 0},
|
|
|
|
{ "display <displayname>", I18N_NOOP("Use the X-server display 'displayname'"), 0},
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
{ "display <displayname>", I18N_NOOP("Use the QWS display 'displayname'"), 0},
|
|
|
|
{ "display <displayname>", I18N_NOOP("Use the QWS display 'displayname'"), 0},
|
|
|
@ -1656,13 +1656,13 @@ static const TDECmdLineOptions qt_options[] =
|
|
|
|
{ "button <color>", I18N_NOOP("sets the default button color"), 0},
|
|
|
|
{ "button <color>", I18N_NOOP("sets the default button color"), 0},
|
|
|
|
{ "name <name>", I18N_NOOP("sets the application name"), 0},
|
|
|
|
{ "name <name>", I18N_NOOP("sets the application name"), 0},
|
|
|
|
{ "title <title>", I18N_NOOP("sets the application title (caption)"), 0},
|
|
|
|
{ "title <title>", I18N_NOOP("sets the application title (caption)"), 0},
|
|
|
|
#ifdef Q_WS_X11
|
|
|
|
#ifdef TQ_WS_X11
|
|
|
|
{ "visual TrueColor", I18N_NOOP("forces the application to use a TrueColor visual on\nan 8-bit display"), 0},
|
|
|
|
{ "visual TrueColor", I18N_NOOP("forces the application to use a TrueColor visual on\nan 8-bit display"), 0},
|
|
|
|
{ "inputstyle <inputstyle>", I18N_NOOP("sets XIM (X Input Method) input style. Possible\nvalues are onthespot, overthespot, offthespot and\nroot"), 0 },
|
|
|
|
{ "inputstyle <inputstyle>", I18N_NOOP("sets XIM (X Input Method) input style. Possible\nvalues are onthespot, overthespot, offthespot and\nroot"), 0 },
|
|
|
|
{ "im <XIM server>", I18N_NOOP("set XIM server"),0},
|
|
|
|
{ "im <XIM server>", I18N_NOOP("set XIM server"),0},
|
|
|
|
{ "noxim", I18N_NOOP("disable XIM"), 0 },
|
|
|
|
{ "noxim", I18N_NOOP("disable XIM"), 0 },
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#ifdef Q_WS_QWS
|
|
|
|
#ifdef TQ_WS_QWS
|
|
|
|
{ "qws", I18N_NOOP("forces the application to run as QWS Server"), 0},
|
|
|
|
{ "qws", I18N_NOOP("forces the application to run as QWS Server"), 0},
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
{ "reverse", I18N_NOOP("mirrors the whole layout of widgets"), 0},
|
|
|
|
{ "reverse", I18N_NOOP("mirrors the whole layout of widgets"), 0},
|
|
|
@ -1779,7 +1779,7 @@ void TDEApplication::parseCommandLine( )
|
|
|
|
TDECrash::setApplicationName(TQString(args->appName()));
|
|
|
|
TDECrash::setApplicationName(TQString(args->appName()));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef Q_WS_X11
|
|
|
|
#ifdef TQ_WS_X11
|
|
|
|
if ( args->isSet( "waitforwm" ) ) {
|
|
|
|
if ( args->isSet( "waitforwm" ) ) {
|
|
|
|
Atom type;
|
|
|
|
Atom type;
|
|
|
|
(void) desktop(); // trigger desktop creation, we need PropertyNotify events for the root window
|
|
|
|
(void) desktop(); // trigger desktop creation, we need PropertyNotify events for the root window
|
|
|
@ -1874,7 +1874,7 @@ TDEApplication::~TDEApplication()
|
|
|
|
|
|
|
|
|
|
|
|
TDEProcessController::deref();
|
|
|
|
TDEProcessController::deref();
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef Q_WS_X11
|
|
|
|
#ifdef TQ_WS_X11
|
|
|
|
if ( d->oldXErrorHandler != NULL )
|
|
|
|
if ( d->oldXErrorHandler != NULL )
|
|
|
|
XSetErrorHandler( d->oldXErrorHandler );
|
|
|
|
XSetErrorHandler( d->oldXErrorHandler );
|
|
|
|
if ( d->oldXIOErrorHandler != NULL )
|
|
|
|
if ( d->oldXIOErrorHandler != NULL )
|
|
|
@ -1886,7 +1886,7 @@ TDEApplication::~TDEApplication()
|
|
|
|
delete d;
|
|
|
|
delete d;
|
|
|
|
KApp = 0;
|
|
|
|
KApp = 0;
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef Q_WS_X11
|
|
|
|
#ifdef TQ_WS_X11
|
|
|
|
mySmcConnection = 0;
|
|
|
|
mySmcConnection = 0;
|
|
|
|
delete smModificationTime;
|
|
|
|
delete smModificationTime;
|
|
|
|
smModificationTime = 0;
|
|
|
|
smModificationTime = 0;
|
|
|
@ -1902,7 +1902,7 @@ TDEApplication::~TDEApplication()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef Q_WS_X11
|
|
|
|
#ifdef TQ_WS_X11
|
|
|
|
class KAppX11HackWidget: public TQWidget
|
|
|
|
class KAppX11HackWidget: public TQWidget
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
public:
|
|
|
@ -1910,7 +1910,7 @@ public:
|
|
|
|
};
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if defined(Q_WS_X11) && defined(COMPOSITE)
|
|
|
|
#if defined(TQ_WS_X11) && defined(COMPOSITE)
|
|
|
|
bool TDEApplication::isCompositionManagerAvailable() {
|
|
|
|
bool TDEApplication::isCompositionManagerAvailable() {
|
|
|
|
bool have_manager = false;
|
|
|
|
bool have_manager = false;
|
|
|
|
|
|
|
|
|
|
|
@ -2164,7 +2164,7 @@ void TDEApplication::dcopBlockUserInput( bool b )
|
|
|
|
kapp_block_user_input = b;
|
|
|
|
kapp_block_user_input = b;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef Q_WS_X11
|
|
|
|
#ifdef TQ_WS_X11
|
|
|
|
bool TDEApplication::x11EventFilter( XEvent *_event )
|
|
|
|
bool TDEApplication::x11EventFilter( XEvent *_event )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if ( kapp_block_user_input ) {
|
|
|
|
if ( kapp_block_user_input ) {
|
|
|
@ -2261,11 +2261,11 @@ bool TDEApplication::x11EventFilter( XEvent *_event )
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif // Q_WS_X11
|
|
|
|
#endif // TQ_WS_X11
|
|
|
|
|
|
|
|
|
|
|
|
void TDEApplication::updateUserTimestamp( unsigned long time )
|
|
|
|
void TDEApplication::updateUserTimestamp( unsigned long time )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#if defined Q_WS_X11
|
|
|
|
#if defined TQ_WS_X11
|
|
|
|
Display *display = tqt_xdisplay();
|
|
|
|
Display *display = tqt_xdisplay();
|
|
|
|
if (!display) {
|
|
|
|
if (!display) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
@ -2289,7 +2289,7 @@ void TDEApplication::updateUserTimestamp( unsigned long time )
|
|
|
|
|
|
|
|
|
|
|
|
unsigned long TDEApplication::userTimestamp() const
|
|
|
|
unsigned long TDEApplication::userTimestamp() const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#if defined Q_WS_X11
|
|
|
|
#if defined TQ_WS_X11
|
|
|
|
return get_tqt_x_user_time();
|
|
|
|
return get_tqt_x_user_time();
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
@ -2298,7 +2298,7 @@ unsigned long TDEApplication::userTimestamp() const
|
|
|
|
|
|
|
|
|
|
|
|
void TDEApplication::updateRemoteUserTimestamp( const TQCString& dcopId, unsigned long time )
|
|
|
|
void TDEApplication::updateRemoteUserTimestamp( const TQCString& dcopId, unsigned long time )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#if defined Q_WS_X11
|
|
|
|
#if defined TQ_WS_X11
|
|
|
|
if( time == 0 )
|
|
|
|
if( time == 0 )
|
|
|
|
time = get_tqt_x_user_time();
|
|
|
|
time = get_tqt_x_user_time();
|
|
|
|
DCOPRef( dcopId, "MainApplication-Interface" ).call( "updateUserTimestamp", time );
|
|
|
|
DCOPRef( dcopId, "MainApplication-Interface" ).call( "updateUserTimestamp", time );
|
|
|
@ -2519,7 +2519,7 @@ TQPalette TDEApplication::createApplicationPalette( TDEConfig *config, int contr
|
|
|
|
|
|
|
|
|
|
|
|
void TDEApplication::tdedisplaySetPalette()
|
|
|
|
void TDEApplication::tdedisplaySetPalette()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#ifdef Q_WS_MACX
|
|
|
|
#ifdef TQ_WS_MACX
|
|
|
|
//Can I have this on other platforms, please!? --Sam
|
|
|
|
//Can I have this on other platforms, please!? --Sam
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TDEConfig *config = TDEGlobal::config();
|
|
|
|
TDEConfig *config = TDEGlobal::config();
|
|
|
@ -2654,7 +2654,7 @@ void TDEApplication::invokeHelp( const TQString& anchor,
|
|
|
|
return invokeHelp( anchor, _appname, "" );
|
|
|
|
return invokeHelp( anchor, _appname, "" );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef Q_WS_WIN
|
|
|
|
#ifndef TQ_WS_WIN
|
|
|
|
// for win32 we're using simple help tools like Qt Assistant,
|
|
|
|
// for win32 we're using simple help tools like Qt Assistant,
|
|
|
|
// see kapplication_win.cpp
|
|
|
|
// see kapplication_win.cpp
|
|
|
|
void TDEApplication::invokeHelp( const TQString& anchor,
|
|
|
|
void TDEApplication::invokeHelp( const TQString& anchor,
|
|
|
@ -2787,7 +2787,7 @@ void TDEApplication::invokeMailer(const TQString &to, const TQString &cc, const
|
|
|
|
return invokeMailer(to,cc,bcc,subject,body,messageFile,attachURLs,"");
|
|
|
|
return invokeMailer(to,cc,bcc,subject,body,messageFile,attachURLs,"");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef Q_WS_WIN
|
|
|
|
#ifndef TQ_WS_WIN
|
|
|
|
// on win32, for invoking browser we're using win32 API
|
|
|
|
// on win32, for invoking browser we're using win32 API
|
|
|
|
// see kapplication_win.cpp
|
|
|
|
// see kapplication_win.cpp
|
|
|
|
|
|
|
|
|
|
|
@ -3000,7 +3000,7 @@ void TDEApplication::invokeBrowser( const TQString &url )
|
|
|
|
return invokeBrowser( url, "" );
|
|
|
|
return invokeBrowser( url, "" );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef Q_WS_WIN
|
|
|
|
#ifndef TQ_WS_WIN
|
|
|
|
// on win32, for invoking browser we're using win32 API
|
|
|
|
// on win32, for invoking browser we're using win32 API
|
|
|
|
// see kapplication_win.cpp
|
|
|
|
// see kapplication_win.cpp
|
|
|
|
void TDEApplication::invokeBrowser( const TQString &url, const TQCString& startup_id )
|
|
|
|
void TDEApplication::invokeBrowser( const TQString &url, const TQCString& startup_id )
|
|
|
@ -3094,7 +3094,7 @@ startServiceInternal( const TQCString &function,
|
|
|
|
TQByteArray replyData;
|
|
|
|
TQByteArray replyData;
|
|
|
|
TQCString _launcher = TDEApplication::launcher();
|
|
|
|
TQCString _launcher = TDEApplication::launcher();
|
|
|
|
TQValueList<TQCString> envs;
|
|
|
|
TQValueList<TQCString> envs;
|
|
|
|
#ifdef Q_WS_X11
|
|
|
|
#ifdef TQ_WS_X11
|
|
|
|
if (tqt_xdisplay()) {
|
|
|
|
if (tqt_xdisplay()) {
|
|
|
|
TQCString dpystring(XDisplayString(tqt_xdisplay()));
|
|
|
|
TQCString dpystring(XDisplayString(tqt_xdisplay()));
|
|
|
|
envs.append( TQCString("DISPLAY=") + dpystring );
|
|
|
|
envs.append( TQCString("DISPLAY=") + dpystring );
|
|
|
@ -3104,7 +3104,7 @@ startServiceInternal( const TQCString &function,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
stream << envs;
|
|
|
|
stream << envs;
|
|
|
|
#if defined Q_WS_X11
|
|
|
|
#if defined TQ_WS_X11
|
|
|
|
// make sure there is id, so that user timestamp exists
|
|
|
|
// make sure there is id, so that user timestamp exists
|
|
|
|
stream << ( startup_id.isEmpty() ? TDEStartupInfo::createNewStartupId() : startup_id );
|
|
|
|
stream << ( startup_id.isEmpty() ? TDEStartupInfo::createNewStartupId() : startup_id );
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
@ -3343,8 +3343,8 @@ void TDEApplication::setTopWidget( TQWidget *topWidget )
|
|
|
|
|
|
|
|
|
|
|
|
// set the specified icons
|
|
|
|
// set the specified icons
|
|
|
|
topWidget->setIcon( icon() ); //standard X11
|
|
|
|
topWidget->setIcon( icon() ); //standard X11
|
|
|
|
#if defined Q_WS_X11
|
|
|
|
#if defined TQ_WS_X11
|
|
|
|
//#ifdef Q_WS_X11 // FIXME(E): Implement for Qt/Embedded
|
|
|
|
//#ifdef TQ_WS_X11 // FIXME(E): Implement for Qt/Embedded
|
|
|
|
KWin::setIcons(topWidget->winId(), icon(), miniIcon() ); // NET_WM hints for KWin
|
|
|
|
KWin::setIcons(topWidget->winId(), icon(), miniIcon() ); // NET_WM hints for KWin
|
|
|
|
|
|
|
|
|
|
|
|
// set the app startup notification window property
|
|
|
|
// set the app startup notification window property
|
|
|
@ -3361,7 +3361,7 @@ void TDEApplication::setStartupId( const TQCString& startup_id )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if( startup_id == d->startup_id )
|
|
|
|
if( startup_id == d->startup_id )
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
#if defined Q_WS_X11
|
|
|
|
#if defined TQ_WS_X11
|
|
|
|
TDEStartupInfo::handleAutoAppStartedSending(); // finish old startup notification if needed
|
|
|
|
TDEStartupInfo::handleAutoAppStartedSending(); // finish old startup notification if needed
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
if( startup_id.isEmpty())
|
|
|
|
if( startup_id.isEmpty())
|
|
|
@ -3369,7 +3369,7 @@ void TDEApplication::setStartupId( const TQCString& startup_id )
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
d->startup_id = startup_id;
|
|
|
|
d->startup_id = startup_id;
|
|
|
|
#if defined Q_WS_X11
|
|
|
|
#if defined TQ_WS_X11
|
|
|
|
TDEStartupInfoId id;
|
|
|
|
TDEStartupInfoId id;
|
|
|
|
id.initId( startup_id );
|
|
|
|
id.initId( startup_id );
|
|
|
|
long timestamp = id.timestamp();
|
|
|
|
long timestamp = id.timestamp();
|
|
|
@ -3383,7 +3383,7 @@ void TDEApplication::setStartupId( const TQCString& startup_id )
|
|
|
|
// not to propagate it to processes started from this app
|
|
|
|
// not to propagate it to processes started from this app
|
|
|
|
void TDEApplication::read_app_startup_id()
|
|
|
|
void TDEApplication::read_app_startup_id()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#if defined Q_WS_X11
|
|
|
|
#if defined TQ_WS_X11
|
|
|
|
TDEStartupInfoId id = TDEStartupInfo::currentStartupIdEnv();
|
|
|
|
TDEStartupInfoId id = TDEStartupInfo::currentStartupIdEnv();
|
|
|
|
TDEStartupInfo::resetStartupEnv();
|
|
|
|
TDEStartupInfo::resetStartupEnv();
|
|
|
|
d->startup_id = id.id();
|
|
|
|
d->startup_id = id.id();
|
|
|
@ -3591,7 +3591,7 @@ bool TDEApplication::authorizeURLAction(const TQString &action, const KURL &_bas
|
|
|
|
|
|
|
|
|
|
|
|
uint TDEApplication::keyboardModifiers()
|
|
|
|
uint TDEApplication::keyboardModifiers()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#ifdef Q_WS_X11
|
|
|
|
#ifdef TQ_WS_X11
|
|
|
|
Window root;
|
|
|
|
Window root;
|
|
|
|
Window child;
|
|
|
|
Window child;
|
|
|
|
int root_x, root_y, win_x, win_y;
|
|
|
|
int root_x, root_y, win_x, win_y;
|
|
|
@ -3610,13 +3610,13 @@ uint TDEApplication::keyboardModifiers()
|
|
|
|
uint TDEApplication::mouseState()
|
|
|
|
uint TDEApplication::mouseState()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
uint mousestate;
|
|
|
|
uint mousestate;
|
|
|
|
#ifdef Q_WS_X11
|
|
|
|
#ifdef TQ_WS_X11
|
|
|
|
Window root;
|
|
|
|
Window root;
|
|
|
|
Window child;
|
|
|
|
Window child;
|
|
|
|
int root_x, root_y, win_x, win_y;
|
|
|
|
int root_x, root_y, win_x, win_y;
|
|
|
|
XQueryPointer( tqt_xdisplay(), tqt_xrootwin(), &root, &child,
|
|
|
|
XQueryPointer( tqt_xdisplay(), tqt_xrootwin(), &root, &child,
|
|
|
|
&root_x, &root_y, &win_x, &win_y, &mousestate );
|
|
|
|
&root_x, &root_y, &win_x, &win_y, &mousestate );
|
|
|
|
#elif defined(Q_WS_WIN)
|
|
|
|
#elif defined(TQ_WS_WIN)
|
|
|
|
const bool mousebtn_swapped = GetSystemMetrics(SM_SWAPBUTTON);
|
|
|
|
const bool mousebtn_swapped = GetSystemMetrics(SM_SWAPBUTTON);
|
|
|
|
if (GetAsyncKeyState(VK_LBUTTON))
|
|
|
|
if (GetAsyncKeyState(VK_LBUTTON))
|
|
|
|
mousestate |= (mousebtn_swapped ? Button3Mask : Button1Mask);
|
|
|
|
mousestate |= (mousebtn_swapped ? Button3Mask : Button1Mask);
|
|
|
@ -3624,7 +3624,7 @@ uint TDEApplication::mouseState()
|
|
|
|
mousestate |= Button2Mask;
|
|
|
|
mousestate |= Button2Mask;
|
|
|
|
if (GetAsyncKeyState(VK_RBUTTON))
|
|
|
|
if (GetAsyncKeyState(VK_RBUTTON))
|
|
|
|
mousestate |= (mousebtn_swapped ? Button1Mask : Button3Mask);
|
|
|
|
mousestate |= (mousebtn_swapped ? Button1Mask : Button3Mask);
|
|
|
|
#elif defined(Q_WS_MACX)
|
|
|
|
#elif defined(TQ_WS_MACX)
|
|
|
|
mousestate = GetCurrentEventButtonState();
|
|
|
|
mousestate = GetCurrentEventButtonState();
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
//TODO: other platforms
|
|
|
|
//TODO: other platforms
|
|
|
@ -3635,7 +3635,7 @@ uint TDEApplication::mouseState()
|
|
|
|
TQt::ButtonState TDEApplication::keyboardMouseState()
|
|
|
|
TQt::ButtonState TDEApplication::keyboardMouseState()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int ret = 0;
|
|
|
|
int ret = 0;
|
|
|
|
#ifdef Q_WS_X11
|
|
|
|
#ifdef TQ_WS_X11
|
|
|
|
Window root;
|
|
|
|
Window root;
|
|
|
|
Window child;
|
|
|
|
Window child;
|
|
|
|
int root_x, root_y, win_x, win_y;
|
|
|
|
int root_x, root_y, win_x, win_y;
|
|
|
@ -3657,7 +3657,7 @@ TQt::ButtonState TDEApplication::keyboardMouseState()
|
|
|
|
ret |= AltButton;
|
|
|
|
ret |= AltButton;
|
|
|
|
if( state & KKeyNative::modX( KKey::WIN ))
|
|
|
|
if( state & KKeyNative::modX( KKey::WIN ))
|
|
|
|
ret |= MetaButton;
|
|
|
|
ret |= MetaButton;
|
|
|
|
#elif defined(Q_WS_WIN)
|
|
|
|
#elif defined(TQ_WS_WIN)
|
|
|
|
const bool mousebtn_swapped = GetSystemMetrics(SM_SWAPBUTTON);
|
|
|
|
const bool mousebtn_swapped = GetSystemMetrics(SM_SWAPBUTTON);
|
|
|
|
if (GetAsyncKeyState(VK_LBUTTON))
|
|
|
|
if (GetAsyncKeyState(VK_LBUTTON))
|
|
|
|
ret |= (mousebtn_swapped ? RightButton : LeftButton);
|
|
|
|
ret |= (mousebtn_swapped ? RightButton : LeftButton);
|
|
|
@ -3679,17 +3679,17 @@ TQt::ButtonState TDEApplication::keyboardMouseState()
|
|
|
|
return static_cast< ButtonState >( ret );
|
|
|
|
return static_cast< ButtonState >( ret );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#if defined Q_WS_X11
|
|
|
|
#if defined TQ_WS_X11
|
|
|
|
int TDEApplication::currentX11VT()
|
|
|
|
int TDEApplication::currentX11VT()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return get_x_vtnum(TQPaintDevice::x11AppDisplay());
|
|
|
|
return get_x_vtnum(TQPaintDevice::x11AppDisplay());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#else // Q_WS_X11
|
|
|
|
#else // TQ_WS_X11
|
|
|
|
int TDEApplication::currentX11VT()
|
|
|
|
int TDEApplication::currentX11VT()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return -1;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif // Q_WS_X11
|
|
|
|
#endif // TQ_WS_X11
|
|
|
|
|
|
|
|
|
|
|
|
void TDEApplication::installSigpipeHandler()
|
|
|
|
void TDEApplication::installSigpipeHandler()
|
|
|
|
{
|
|
|
|
{
|
|
|
|