int main(int argc, char **argv) { KAboutData aboutData( "ksnapshot", I18N_NOOP("KSnapshot"), KSNAPVERSION, description, KAboutData::License_GPL, "(c) 1997-2004, Richard J. Moore,\n(c) 2000, Matthias Ettrich,\n(c) 2002-2003 Aaron J. Seigo"); aboutData.addAuthor("Richard J. Moore",0, "*****@*****.**"); aboutData.addAuthor("Matthias Ettrich",0, "*****@*****.**"); aboutData.addAuthor("Aaron J. Seigo", 0, "*****@*****.**"); aboutData.addCredit( "Nadeem Hasan", I18N_NOOP("Region Grabbing\nReworked GUI"), "*****@*****.**" ); KCmdLineArgs::init( argc, argv, &aboutData ); KCmdLineArgs::addCmdLineOptions( options ); // Add our own options. KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); KApplication app; KImageIO::registerFormats(); // Create top level window KSnapshot *toplevel; if ( args->isSet( "current" ) ) toplevel = new KSnapshot( 0, 0, true ); else toplevel = new KSnapshot(); args->clear(); app.dcopClient()->setDefaultObject( toplevel->objId() ); toplevel->setCaption( app.makeStdCaption("") ); app.setMainWidget(toplevel); toplevel->show(); return app.exec(); }
int main(int argc, char **argv) { KAboutData aboutData( "ksnapshot", 0, ki18n("KSnapshot"), KSNAPVERSION, ki18n(description), KAboutData::License_GPL, ki18n("(c) 1997-2008, Richard J. Moore,\n(c) 2000, Matthias Ettrich,\n(c) 2002-2003 Aaron J. Seigo")); aboutData.addAuthor(ki18n("Richard J. Moore"),KLocalizedString(), "*****@*****.**"); aboutData.addAuthor(ki18n("Matthias Ettrich"),KLocalizedString(), "*****@*****.**"); aboutData.addAuthor(ki18n("Aaron J. Seigo"), KLocalizedString(), "*****@*****.**"); aboutData.addCredit( ki18n("Nadeem Hasan"), ki18n("Region Grabbing\nReworked GUI"), "*****@*****.**" ); aboutData.addCredit( ki18n("Marcus Hufgard"), ki18n("\"Open With\" function"), "*****@*****.**" ); aboutData.addCredit( ki18n("Pau Garcia i Quiles"), ki18n("Free region grabbing, KIPI plugins support, port to Windows"), "*****@*****.**" ); KCmdLineArgs::init( argc, argv, &aboutData ); KCmdLineArgs::addCmdLineOptions( ksnapshot_options() ); // Add our own options. KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); // This is one of the applications that requires the "native" / X11 graphics backend to work. QApplication::setGraphicsSystem("native"); KApplication app; // Create top level window KSnapshot *toplevel; bool showTopLevel = false; if ( args->isSet( "current" ) ) toplevel = new KSnapshot( 0, KSnapshotObject::WindowUnderCursor ); else if(args->isSet( "fullscreen" )) { //we grad directly desktop => show dialogbox showTopLevel = true; toplevel = new KSnapshot( 0, KSnapshotObject::FullScreen ); } else if(args->isSet( "region" )) toplevel = new KSnapshot( 0, KSnapshotObject::Region ); else if(args->isSet( "freeregion" )) toplevel = new KSnapshot( 0, KSnapshotObject::FreeRegion ); else if(args->isSet( "child" )) toplevel = new KSnapshot( 0, KSnapshotObject::ChildWindow ); else { showTopLevel = true; toplevel = new KSnapshot(); } args->clear(); new KsnapshotAdaptor(toplevel); QDBusConnection::sessionBus().registerObject("/KSnapshot", toplevel); if(showTopLevel) toplevel->show(); return app.exec(); }