Пример #1
0
 public static void Init(string[] argv, KAboutData about, uint stdargs)
 {
     string[] args = new string[argv.Length + 1];
     args[0] = System.Reflection.Assembly.GetExecutingAssembly().Location;
     argv.CopyTo(args, 1);
     staticInterceptor.Invoke("init$?#$", "init(int, char**, const KAboutData*, KCmdLineArgs::StdCmdLineArgs)", typeof(void), false, typeof(string), args, typeof(KAboutData), about, typeof(uint), stdargs);
 }
Пример #2
0
Файл: p8.cs Проект: KDE/kimono
    public static int Main(String[] args)
    {
        KAboutData about = new KAboutData("p8", "Tutorial - p8", KDE.Ki18n(""), "0.1");
        KCmdLineArgs.Init(args, about);
        KUniqueApplication a = new KUniqueApplication();

        if (!QDBusConnection.SessionBus().IsConnected()) {
            Console.Error.WriteLine("Cannot connect to the D-BUS session bus.\n" +
                                     "To start it, run:\n" +
                                     "\teval `dbus-launch --auto-syntax`\n");
            return 1;
        }

        if (!QDBusConnection.SessionBus().RegisterService("org.kde.BookMarkList")) {
            Console.Error.WriteLine("{0}", QDBusConnection.SessionBus().LastError().Message());
            return 1;
        }

        BookMarkList mylist = new BookMarkList("Tutorial - p8");
        mylist.Resize(300, 200);
        a.SetTopWidget(mylist);
        mylist.Show();

        QDBusConnection.SessionBus().RegisterObject("/", mylist, (uint) QDBusConnection.RegisterOption.ExportAllSlots);

        return KApplication.Exec();
    }
Пример #3
0
 public static void Init(string[] argv, KAboutData about)
 {
     string[] args = new string[argv.Length + 1];
     args[0] = System.Reflection.Assembly.GetExecutingAssembly().Location;
     argv.CopyTo(args, 1);
     staticInterceptor.Invoke("init$?#", "init(int, char**, const KAboutData*)", typeof(void), false, typeof(int), args.Length, typeof(string[]), args, typeof(KAboutData), about);
 }
Пример #4
0
Файл: p3.cs Проект: KDE/kimono
    public static int Main(String[] args)
    {
        KAboutData about = new KAboutData("p3", "Tutorial - p3", KDE.Ki18n(""), "0.1");
        KCmdLineArgs.Init(args, about);
        KApplication a = new KApplication();
        MainWindow window = new MainWindow("Tutorial - p3");
        window.Resize(400, 300);
        window.Show();

        return KApplication.Exec();
    }
Пример #5
0
Файл: p2.cs Проект: KDE/kimono
    public static int Main(String[] args)
    {
        KAboutData about = new KAboutData("p2", "Hello World", KDE.Ki18n(""), "0.1");
        KCmdLineArgs.Init(args, about);
        KApplication a = new KApplication();
        QPushButton hello = new QPushButton(KDE.I18n("Hello World !"), null);

        a.SetTopWidget(hello);
        hello.Show();

        return KApplication.Exec();
    }
Пример #6
0
    public static int Main(String[] args)
    {
        KAboutData about = new KAboutData("editor", "Text Editor Example", KDE.Ki18n(""), "0.1");
        KCmdLineArgs.Init(args, about);
        KApplication a = new KApplication();

        KParts.MainWindow w = new KParts.MainWindow(null, 0);

        KTextEditor.Editor editor = KTextEditor.Global.Editor("katepart");

        //      other possibility
        //      KTextEditor.Editor editor = KTextEditor.EditorChooser.Editor();
        editor.SetSimpleMode(true);
        KTextEditor.Document doc = editor.CreateDocument(w);
        KTextEditor.View view = doc.CreateView(w);
        w.SetCentralWidget(view);
        doc.SetText("Here is some text..");
        w.Show();

        return KApplication.Exec();
    }
Пример #7
0
 public KHelpMenu(QWidget parent, KAboutData aboutData)
     : this((Type) null)
 {
     CreateProxy();
     interceptor.Invoke("KHelpMenu##", "KHelpMenu(QWidget*, const KAboutData*)", typeof(void), typeof(QWidget), parent, typeof(KAboutData), aboutData);
 }
Пример #8
0
 public KHelpMenu(QWidget parent, KAboutData aboutData, bool showWhatsThis)
     : this((Type) null)
 {
     CreateProxy();
     interceptor.Invoke("KHelpMenu##$", "KHelpMenu(QWidget*, const KAboutData*, bool)", typeof(void), typeof(QWidget), parent, typeof(KAboutData), aboutData, typeof(bool), showWhatsThis);
 }
Пример #9
0
 public KComponentData(KAboutData aboutData)
     : this((Type) null)
 {
     CreateProxy();
     interceptor.Invoke("KComponentData#", "KComponentData(const KAboutData&)", typeof(void), typeof(KAboutData), aboutData);
 }
Пример #10
0
 /// <remarks>
 ///  Creates a bug-report dialog.
 ///  Note that you shouldn't have to do this manually,
 ///  since KHelpMenu takes care of the menu item
 ///  for "Report Bug..." and of creating a KBugReport dialog.
 ///    </remarks>        <short>    Creates a bug-report dialog.</short>
 public KBugReport(QWidget parent, bool modal, KAboutData aboutData)
     : this((Type) null)
 {
     CreateProxy();
     interceptor.Invoke("KBugReport#$#", "KBugReport(QWidget*, bool, const KAboutData*)", typeof(void), typeof(QWidget), parent, typeof(bool), modal, typeof(KAboutData), aboutData);
 }
Пример #11
0
Файл: p5.cs Проект: KDE/kimono
    public static int Main(String[] args)
    {
        KAboutData about = new KAboutData("p5", "Tutorial - p5", KDE.Ki18n(""), "0.1");
        KCmdLineArgs.Init(args, about);
        KApplication a = new KApplication();

        if (!QDBusConnection.SessionBus().IsConnected()) {
            Console.Error.WriteLine("Cannot connect to the D-BUS session bus.\n" +
                                     "To start it, run:\n" +
                                     "\teval `dbus-launch --auto-syntax`\n");
            return 1;
        }

        MainWindow window = new MainWindow("Tutorial - p5");
        window.Resize(300, 200);
        window.Show();

        return KApplication.Exec();
    }
Пример #12
0
 public KAboutData(QByteArray appName, QByteArray catalogName, KLocalizedString programName, QByteArray version, KLocalizedString shortDescription, KAboutData.LicenseKey licenseType, KLocalizedString copyrightStatement)
     : this((Type) null)
 {
     CreateProxy();
     interceptor.Invoke("KAboutData#####$#", "KAboutData(const QByteArray&, const QByteArray&, const KLocalizedString&, const QByteArray&, const KLocalizedString&, KAboutData::LicenseKey, const KLocalizedString&)", typeof(void), typeof(QByteArray), appName, typeof(QByteArray), catalogName, typeof(KLocalizedString), programName, typeof(QByteArray), version, typeof(KLocalizedString), shortDescription, typeof(KAboutData.LicenseKey), licenseType, typeof(KLocalizedString), copyrightStatement);
 }
Пример #13
0
 /// <remarks>
 ///  Defines the license identifier.
 /// <param> name="licenseKey" The license identifier.
 /// </param></remarks>        <short>    Defines the license identifier.</short>
 ///         <see> addLicenseText</see>
 ///         <see> setLicenseText</see>
 ///         <see> setLicenseTextFile</see>
 public KAboutData SetLicense(KAboutData.LicenseKey licenseKey)
 {
     return (KAboutData) interceptor.Invoke("setLicense$", "setLicense(KAboutData::LicenseKey)", typeof(KAboutData), typeof(KAboutData.LicenseKey), licenseKey);
 }
Пример #14
0
 /// <remarks>
 ///  Copy constructor.  Performs a deep copy.
 /// <param> name="other" object to copy
 ///      </param></remarks>        <short>    Copy constructor.</short>
 public KAboutData(KAboutData other)
     : this((Type) null)
 {
     CreateProxy();
     interceptor.Invoke("KAboutData#", "KAboutData(const KAboutData&)", typeof(void), typeof(KAboutData), other);
 }
Пример #15
0
 public KAboutApplicationDialog(KAboutData aboutData)
     : this((Type) null)
 {
     CreateProxy();
     interceptor.Invoke("KAboutApplicationDialog#", "KAboutApplicationDialog(const KAboutData*)", typeof(void), typeof(KAboutData), aboutData);
 }
Пример #16
0
 /// <remarks>
 ///  Constructor. Creates a fully featured "About Application" dialog box.
 /// <param> name="aboutData" A pointer to a KAboutData object which data
 ///         will be used for filling the dialog.
 /// </param><param> name="parent" The parent of the dialog box. You should use the
 ///         toplevel window so that the dialog becomes centered.
 ///          </param></remarks>        <short>    Constructor.</short>
 public KAboutApplicationDialog(KAboutData aboutData, QWidget parent)
     : this((Type) null)
 {
     CreateProxy();
     interceptor.Invoke("KAboutApplicationDialog##", "KAboutApplicationDialog(const KAboutData*, QWidget*)", typeof(void), typeof(KAboutData), aboutData, typeof(QWidget), parent);
 }
Пример #17
0
Файл: p9.cs Проект: KDE/kimono
    public static int Main(String[] args)
    {
        KAboutData aboutdata = new KAboutData(  "p9",
                                                "Tutorial - p9", KDE.Ki18n(""),
                                                "1.0",
                                                KDE.Ki18n("Step 9 of a simple tutorial"),
                                                KAboutData.LicenseKey.License_GPL,
                                                KDE.Ki18n("(C) 2000, 2001 Antonio Larrosa Jimenez"),
                                                KDE.Ki18n(""),
                                                "http://devel-home.kde.org/~larrosa/tutorial.html" );
        aboutdata.AddAuthor(    KDE.Ki18n("Antonio Larrosa Jimenez"),
                                KDE.Ki18n("Original Developer/Maintainer"),
                                "*****@*****.**",
                                "http://devel-home.kde.org/~larrosa/index.html" );
        aboutdata.AddAuthor(    KDE.Ki18n("Richard Dale"),
                                KDE.Ki18n("C# port"),
                                "*****@*****.**",
                                "" );

        KCmdLineArgs.Init(args, aboutdata);
        KUniqueApplication a = new KUniqueApplication();

        if (!QDBusConnection.SessionBus().IsConnected()) {
            Console.Error.WriteLine("Cannot connect to the D-BUS session bus.\n" +
                                     "To start it, run:\n" +
                                     "\teval `dbus-launch --auto-syntax`\n");
            return 1;
        }

        if (!QDBusConnection.SessionBus().RegisterService("org.kde.Browser")) {
            Console.Error.WriteLine("{0}",  QDBusConnection.SessionBus().LastError().Message());
            return 1;
        }

        Browser window = new Browser("Tutorial - p9");
        window.Resize(300, 200);
        window.Show();

        QDBusConnection.SessionBus().RegisterObject("/", window, (uint) QDBusConnection.RegisterOption.ExportAllSlots);

        return KApplication.Exec();
    }
Пример #18
0
 /// <remarks>
 ///  Initialize Class
 ///  This function should be called as the very first thing in your
 ///  application. This method will rarely be used, since it doesn't
 ///  provide any argument parsing. It does provide access to the
 ///  KAboutData information.
 ///  This method is exactly the same as calling
 ///  init(0,0, const KAboutData about, CmdLineArgNone).
 /// <param> name="about" the about data.
 /// </param></remarks>        <short>    Initialize Class </short>
 ///         <see> KAboutData</see>
 public static void Init(KAboutData about)
 {
     staticInterceptor.Invoke("init#", "init(const KAboutData*)", typeof(void), typeof(KAboutData), about);
 }
Пример #19
0
 /// <remarks>
 ///  This constructor creates a factory for a plugin with the given KAboutData object. This object is
 ///  used to initialize a KComponentData object for the plugin. You can later access it with
 ///  componentData().
 ///  KPluginFactory takes ownership of the <pre>aboutData</pre> object, so don't delete it yourself!
 ///  \param aboutData the KAboutData for the plugin
 ///  \param parent a parent object
 ///      </remarks>        <short>    This constructor creates a factory for a plugin with the given KAboutData object.</short>
 public KPluginFactory(KAboutData aboutData, QObject parent)
     : this((Type) null)
 {
     CreateProxy();
     interceptor.Invoke("KPluginFactory##", "KPluginFactory(const KAboutData&, QObject*)", typeof(void), typeof(KAboutData), aboutData, typeof(QObject), parent);
 }
Пример #20
0
 /// <remarks>
 ///  Returns the license name.
 /// </remarks>        <return> The license name as a string.
 ///      </return>
 ///         <short>    Returns the license name.</short>
 public string Name(KAboutData.NameFormat formatName)
 {
     return (string) interceptor.Invoke("name$", "name(KAboutData::NameFormat) const", typeof(string), typeof(KAboutData.NameFormat), formatName);
 }
Пример #21
0
 public KPluginFactory(KAboutData aboutData)
     : this((Type) null)
 {
     CreateProxy();
     interceptor.Invoke("KPluginFactory#", "KPluginFactory(const KAboutData&)", typeof(void), typeof(KAboutData), aboutData);
 }
Пример #22
0
 /// <remarks>
 ///  Constructor.
 ///  A copy of the aboutData object is made.
 /// <param> name="aboutData" data about this component
 /// </param><param> name="registerAsMain" whether to register the component as the main component
 ///                        of the application. This has no effect, if the application
 ///                        already has a main component.
 /// </param></remarks>        <short>    Constructor.</short>
 ///         <see> KGlobal.MainComponent</see>
 ///         <see> KAboutData</see>
 public KComponentData(KAboutData aboutData, KComponentData.MainComponentRegistration registerAsMain)
     : this((Type) null)
 {
     CreateProxy();
     interceptor.Invoke("KComponentData#$", "KComponentData(const KAboutData&, KComponentData::MainComponentRegistration)", typeof(void), typeof(KAboutData), aboutData, typeof(KComponentData.MainComponentRegistration), registerAsMain);
 }
Пример #23
0
    public static int Main(String[] argv)
    {
        KAboutData aboutData = new KAboutData(  "kwrite-sharp", "Simple Text Editor",
                                                KDE.Ki18n("KWrite"),
                                                "4.1", // KDE.VersionString(),
                                                KDE.Ki18n("KWrite - Text Editor"),
                                                KAboutData.LicenseKey.License_LGPL_V2,
                                                KDE.Ki18n("(c) 2000-2005 The Kate Authors"),
                                                new KLocalizedString(),
                                                "http://www.kate-editor.org" );

        aboutData.AddAuthor(KDE.Ki18n("Christoph Cullmann"), KDE.Ki18n("Maintainer"), "*****@*****.**", "http://www.babylon2k.de");
        aboutData.AddAuthor(KDE.Ki18n("Anders Lund"), KDE.Ki18n("Core Developer"), "*****@*****.**", "http://www.alweb.dk");
        aboutData.AddAuthor(KDE.Ki18n("Joseph Wenninger"), KDE.Ki18n("Core Developer"), "*****@*****.**","http://stud3.tuwien.ac.at/~e9925371");
        aboutData.AddAuthor(KDE.Ki18n("Hamish Rodda"),KDE.Ki18n("Core Developer"), "*****@*****.**");
        aboutData.AddAuthor(KDE.Ki18n("Dominik Haumann"), KDE.Ki18n("Developer & Highlight wizard"), "*****@*****.**");
        aboutData.AddAuthor(KDE.Ki18n("Waldo Bastian"), KDE.Ki18n( "The cool buffersystem" ), "*****@*****.**" );
        aboutData.AddAuthor(KDE.Ki18n("Charles Samuels"), KDE.Ki18n("The Editing Commands"), "*****@*****.**");
        aboutData.AddAuthor(KDE.Ki18n("Matt Newell"), KDE.Ki18n("Testing, ..."), "*****@*****.**");
        aboutData.AddAuthor(KDE.Ki18n("Michael Bartl"), KDE.Ki18n("Former Core Developer"), "*****@*****.**");
        aboutData.AddAuthor(KDE.Ki18n("Michael McCallum"), KDE.Ki18n("Core Developer"), "*****@*****.**");
        aboutData.AddAuthor(KDE.Ki18n("Jochen Wilhemly"), KDE.Ki18n( "KWrite Author" ), "*****@*****.**" );
        aboutData.AddAuthor(KDE.Ki18n("Michael Koch"),KDE.Ki18n("KWrite port to KParts"), "*****@*****.**");
        aboutData.AddAuthor(KDE.Ki18n("Christian Gebauer"), new KLocalizedString(), "*****@*****.**" );
        aboutData.AddAuthor(KDE.Ki18n("Simon Hausmann"), new KLocalizedString(), "*****@*****.**" );
        aboutData.AddAuthor(KDE.Ki18n("Glen Parker"),KDE.Ki18n("KWrite Undo History, Kspell integration"), "*****@*****.**");
        aboutData.AddAuthor(KDE.Ki18n("Scott Manson"),KDE.Ki18n("KWrite XML Syntax highlighting support"), "*****@*****.**");
        aboutData.AddAuthor(KDE.Ki18n("John Firebaugh"),KDE.Ki18n("Patches and more"), "*****@*****.**");

        aboutData.AddCredit(KDE.Ki18n("Matteo Merli"),KDE.Ki18n("Highlighting for RPM Spec-Files, Perl, Diff and more"), "*****@*****.**");
        aboutData.AddCredit(KDE.Ki18n("Rocky Scaletta"),KDE.Ki18n("Highlighting for VHDL"), "*****@*****.**");
        aboutData.AddCredit(KDE.Ki18n("Yury Lebedev"),KDE.Ki18n("Highlighting for SQL"));
        aboutData.AddCredit(KDE.Ki18n("Chris Ross"),KDE.Ki18n("Highlighting for Ferite"));
        aboutData.AddCredit(KDE.Ki18n("Nick Roux"),KDE.Ki18n("Highlighting for ILERPG"));
        aboutData.AddCredit(KDE.Ki18n("Carsten Niehaus"), KDE.Ki18n("Highlighting for LaTeX"));
        aboutData.AddCredit(KDE.Ki18n("Per Wigren"), KDE.Ki18n("Highlighting for Makefiles, Python"));
        aboutData.AddCredit(KDE.Ki18n("Jan Fritz"), KDE.Ki18n("Highlighting for Python"));
        aboutData.AddCredit(KDE.Ki18n("Daniel Naber"));
        aboutData.AddCredit(KDE.Ki18n("Roland Pabel"),KDE.Ki18n("Highlighting for Scheme"));
        aboutData.AddCredit(KDE.Ki18n("Cristi Dumitrescu"),KDE.Ki18n("PHP Keyword/Datatype list"));
        aboutData.AddCredit(KDE.Ki18n("Carsten Pfeiffer"), KDE.Ki18n("Very nice help"));
        aboutData.AddCredit(KDE.Ki18n("Richard Dale"), KDE.Ki18n("C# port"));
        aboutData.AddCredit(KDE.Ki18n("All people who have contributed and I have forgotten to mention"));
        aboutData.SetProgramIconName("accessories-text-editor");

        KCmdLineArgs.Init(argv, aboutData);

        KCmdLineOptions options = new KCmdLineOptions();
        options.Add("stdin", KDE.Ki18n("Read the contents of stdin"));
        options.Add("encoding <argument>", KDE.Ki18n("Set encoding for the file to open"));
        options.Add("line <argument>", KDE.Ki18n("Navigate to this line"));
        options.Add("column <argument>", KDE.Ki18n("Navigate to this column"));
        options.Add("+[URL]", KDE.Ki18n("Document to open"));
        KCmdLineArgs.AddCmdLineOptions(options);

        KApplication kapp = new KApplication();

        KGlobal.Locale().InsertCatalog("katepart4");
        KCmdLineArgs args = KCmdLineArgs.ParsedArgs();

        if (kapp.IsSessionRestored()) {
            KWrite.Restore();
        } else {
            bool nav = false;
            int line = 0, column = 0;

            QTextCodec codec = args.IsSet("encoding") ? QTextCodec.CodecForName(args.GetOption("encoding")) : null;

            if (args.IsSet("line")) {
                line = System.Convert.ToInt32(args.GetOption("line")) - 1;
                nav = true;
            }

            if (args.IsSet("column")) {
                column = System.Convert.ToInt32(args.GetOption("column")) - 1;
                nav = true;
            }

            if (args.Count() == 0) {
                KWrite t = new KWrite((KTextEditor.Document) null);

                if (args.IsSet("stdin")) {
                    QTextStream input = new QTextStream(Console.OpenStandardInput());

                    // set chosen codec
                    if (codec != null)
                        input.SetCodec(codec);

                    string inputLine;
                    string text = "";

                    do {
                        inputLine = input.ReadLine();
                        text += (inputLine + "\n");
                    } while (inputLine != null);

                    KTextEditor.Document doc = t.View().Document();
                    if (doc != null)
                        doc.SetText(text);
                }

                if (nav && t.View() != null)
                    t.View().SetCursorPosition(new KTextEditor.Cursor(line, column));
            } else {
                int docs_opened = 0;
                for ( int z = 0; z < args.Count(); z++ ) {
                    // this file is no local dir, open it, else warn
                    bool noDir = !args.Url(z).IsLocalFile()  || !(new QDir(args.Url(z).Path())).Exists();
                    if (noDir) {
                        ++docs_opened;
                        KWrite t = new KWrite();
                        //if (codec != null)
                        //    t.View().Document().SetEncoding(codec.Name());
                        t.LoadURL(args.Url(z));
                        if (nav)
                            t.View().SetCursorPosition(new KTextEditor.Cursor(line, column));
                    } else {
                        KMessageBox.Sorry(null, KDE.I18n("The file " + args.Url(z).Url() + " could not be opened: it is not a normal file, it is a folder."));
                    }
                }
                if (docs_opened == 0) return 1; // see http://bugs.kde.org/show_bug.cgi?id=124708
            }
        }

        // no window there, uh, ohh, for example borked session config !!!
        // create at least one !!
        if (KWrite.NoWindows())
            new KWrite();
        return KApplication.Exec();
    }