Add constructor to KApplication that allows ARGB visuals to be manually disabled

This allows the GTK Qt theme engine to work with a KApplication object when a window compositor is enabled


git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1260463 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 13 years ago
parent 0d2336ffe0
commit 416a551e80

@ -685,6 +685,23 @@ KApplication::KApplication( Display *dpy, bool allowStyles ) :
d->m_KAppDCOPInterface = new KAppDCOPInterface(this);
}
KApplication::KApplication( Display *dpy, bool disable_argb, Qt::HANDLE visual, Qt::HANDLE colormap, bool allowStyles ) :
TQApplication( dpy, *KCmdLineArgs::qt_argc(), *KCmdLineArgs::qt_argv(),
disable_argb?visual:getX11RGBAVisual(dpy), disable_argb?colormap:getX11RGBAColormap(dpy) ),
KInstance( KCmdLineArgs::about), display(0L), d (new KApplicationPrivate)
{
aIconPixmap.pm.icon = 0L;
aIconPixmap.pm.miniIcon = 0L;
read_app_startup_id();
useStyles = allowStyles;
if (disable_argb) argb_visual = false;
setName( instanceName() );
installSigpipeHandler();
parseCommandLine( );
init( true );
d->m_KAppDCOPInterface = new KAppDCOPInterface(this);
}
KApplication::KApplication( Display *dpy, Qt::HANDLE visual, Qt::HANDLE colormap,
bool allowStyles ) :
TQApplication( dpy, *KCmdLineArgs::qt_argc(), *KCmdLineArgs::qt_argv(),
@ -728,10 +745,10 @@ KApplication::KApplication( bool allowStyles, bool GUIenabled, KInstance* _insta
TQApplication( *KCmdLineArgs::qt_argc(), *KCmdLineArgs::qt_argv(),
GUIenabled ),
KInstance( _instance ),
argb_visual(false),
#ifdef Q_WS_X11
display(0L),
#endif
argb_visual(false),
d (new KApplicationPrivate)
{
aIconPixmap.pm.icon = 0L;

@ -150,6 +150,35 @@ public:
*/
KApplication(Display *display, bool allowStyles);
/**
* Constructor. Parses command-line arguments. Use this constructor when you
* you want ARGB support to be automatically detected and enabled.
*
* @param display Will be passed to Qt as the X display. The display must be
* valid and already opened.
*
* @param disable_argb Set to true to disable ARGB visuals in this application.
*
* @param display Will be passed to Qt as the X display. The display must be
* valid and already opened.
*
* @param visual A pointer to the X11 visual that should be used by the
* appliction. Note that only TrueColor visuals are supported on depths
* greater than 8 bpp. If this parameter is NULL, the default visual will
* be used instead.
*
* @param allowStyles Set to false to disable the loading on plugin based
* styles. This is only useful to applications that do not display a GUI
* normally. If you do create an application with @p allowStyles set to false
* that normally runs in the background but under special circumstances
* displays widgets call enableStyles() before displaying any widgets.
*
* @since KDE 3.5
*
* @see RGBADisplay()
*/
KApplication(Display *display, bool disable_argb, Qt::HANDLE visual, Qt::HANDLE colormap, bool allowStyles);
/**
* Constructor. Parses command-line arguments. Use this constructor when you
* you need to use a non-default visual or colormap.

Loading…
Cancel
Save