Back to index

kdeartwork  4.3.2
Functions | Variables
kxsconfig.cpp File Reference
#include <config-kxsconfig.h>
#include <stdlib.h>
#include <qlayout.h>
#include <qtimer.h>
#include <kvbox.h>
#include <qlabel.h>
#include <qfileinfo.h>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QBoxLayout>
#include <kdebug.h>
#include <kapplication.h>
#include <kconfig.h>
#include <kstandarddirs.h>
#include <klocale.h>
#include <kcmdlineargs.h>
#include <kshell.h>
#include <kmessagebox.h>
#include "kxsconfig.h"
#include "kxscontrol.h"
#include "kxsxml.h"
#include <X11/Xlib.h>
#include <X11/Xatom.h>
#include <X11/IntrinsicP.h>
#include <X11/ShellP.h>
#include "XScreenSaver_ad.h"
#include "kxsconfig.moc"

Go to the source code of this file.


int ignoreXError (Display *, XErrorEvent *)
int main (int argc, char *argv[])


const uint widgetEventMask
static const char appName [] = "kxsconfig"
static const char description [] = I18N_NOOP("KDE X Screen Saver Configuration tool")
static const char version [] = "3.0.0"
static const char * defaults []
const char * progname = 0
const char * progclass = "XScreenSaver"
XrmDatabase db

Function Documentation

int ignoreXError ( Display *  ,
XErrorEvent *   
int main ( int  argc,
char *  argv[] 

Definition at line 339 of file kxsconfig.cpp.

  KCmdLineArgs::init(argc, argv, appName, 0, ki18n("KXSConfig"), version, ki18n(description));

  KCmdLineOptions options;

  options.add("+screensaver", ki18n("Filename of the screen saver to configure"));

  options.add("+[savername]", ki18n("Optional screen saver name used in messages"));


  KApplication app;

  KCmdLineArgs *args = KCmdLineArgs::parsedArgs();

  /* We must read exactly the same resources as xscreensaver.
     That means we must have both the same progclass *and* progname,
     at least as far as the resource database is concerned.  So,
     put "xscreensaver" in argv[0] while initializing Xt.
  const char *dummyargs[] = { "xscreensaver" };
  int dummyargc = 1;
  progname = dummyargs[0];

  // Teach Xt to use the Display that Qt has already opened.
  XtToolkitInitialize ();
  XtAppContext xtApp = XtCreateApplicationContext ();
  Display *dpy = QX11Info::display();
  XtAppSetFallbackResources (xtApp, const_cast<char**>(defaults));
  XtDisplayInitialize (xtApp, dpy, progname, progclass, 0, 0,
  Widget toplevel_shell = XtAppCreateShell (progname, progclass,
         dpy, 0, 0);
  dpy = XtDisplay (toplevel_shell);
  db = XtDatabase (dpy);
  XtGetApplicationNameAndClass (dpy, const_cast<char**>(&progname),

  QString name = args->arg(args->count() - 1);
  KXSConfigDialog *dialog=new KXSConfigDialog(args->arg(0), name);
  if ( dialog->create() ) {
  } else {
             i18n("No configuration available for %1", name),
             name );

  delete dialog;

Here is the call graph for this function:

Variable Documentation

const char appName[] = "kxsconfig" [static]

Definition at line 324 of file kxsconfig.cpp.

XrmDatabase db

Definition at line 337 of file kxsconfig.cpp.

const char* defaults[] [static]

Definition at line 330 of file kxsconfig.cpp.

const char description[] = I18N_NOOP("KDE X Screen Saver Configuration tool") [static]

Definition at line 326 of file kxsconfig.cpp.

const char* progclass = "XScreenSaver"

Definition at line 336 of file kxsconfig.cpp.

const char* progname = 0

Definition at line 335 of file kxsconfig.cpp.

const char version[] = "3.0.0" [static]

Definition at line 328 of file kxsconfig.cpp.

const uint widgetEventMask
Initial value:
       ExposureMask |
       PropertyChangeMask |

Definition at line 70 of file kxsconfig.cpp.