KJsEmbed

application.cpp
1 /* This file is part of the KDE libraries
2  Copyright (C) 2005, 2006 Ian Reinhart Geiser <[email protected]>
3  Copyright (C) 2005, 2006 Matt Broadstone <[email protected]>
4  Copyright (C) 2005, 2006 Richard J. Moore <[email protected]>
5  Copyright (C) 2005, 2006 Erik L. Bunce <[email protected]>
6 
7  This library is free software; you can redistribute it and/or
8  modify it under the terms of the GNU Library General Public
9  License as published by the Free Software Foundation; either
10  version 2 of the License, or (at your option) any later version.
11 
12  This library is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  Library General Public License for more details.
16 
17  You should have received a copy of the GNU Library General Public License
18  along with this library; see the file COPYING.LIB. If not, write to
19  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20  Boston, MA 02110-1301, USA.
21 */
22 #include "application.h"
23 
24 #include <QDebug>
25 #include <QStringList>
26 using namespace KJSEmbed;
27 
28 namespace CoreApplicationNS
29 {
30 START_STATIC_OBJECT_METHOD(callExit)
31 int exitCode = KJSEmbed::extractInt(exec, args, 0);
32 QCoreApplication::exit(exitCode);
33 END_STATIC_OBJECT_METHOD
34 }
35 
36 START_STATIC_METHOD_LUT(CoreApplicationBinding)
37 {"exit", 0, KJS::DontDelete | KJS::ReadOnly, &CoreApplicationNS::callExit
38 }
39 END_METHOD_LUT
40 
41 NO_ENUMS(CoreApplicationBinding)
42 NO_METHODS(CoreApplicationBinding)
43 
44 KJSO_START_BINDING_CTOR(CoreApplicationBinding, QCoreApplication, QObjectBinding)
45 setOwnership(CPPOwned);
46 KJSO_END_BINDING_CTOR
47 KJSO_QOBJECT_BIND(CoreApplicationBinding, QCoreApplication)
48 
49 KJSO_START_CTOR(CoreApplicationBinding, QCoreApplication, 0)
50 return new KJSEmbed::CoreApplicationBinding(exec, QCoreApplication::instance());
51 KJSO_END_CTOR
52 
53 namespace ApplicationNS
54 {
55 START_STATIC_OBJECT_METHOD(callBeep)
57 END_STATIC_OBJECT_METHOD
58 }
59 
60 START_STATIC_METHOD_LUT(ApplicationBinding)
61 {"beep", 0, KJS::DontDelete | KJS::ReadOnly, &ApplicationNS::callBeep
62 }
63 END_METHOD_LUT
64 
65 NO_ENUMS(ApplicationBinding)
66 NO_METHODS(ApplicationBinding)
67 
68 KJSO_START_BINDING_CTOR(ApplicationBinding, QApplication, CoreApplicationBinding)
69 setOwnership(CPPOwned);
70 KJSO_END_BINDING_CTOR
71 KJSO_QOBJECT_BIND(ApplicationBinding, QApplication)
72 
73 KJSO_START_CTOR(ApplicationBinding, QApplication, 0)
74 return new KJSEmbed::ApplicationBinding(exec, ::qobject_cast<QApplication *>(QCoreApplication::instance()));
75 KJSO_END_CTOR
76 
void exit(int returnCode)
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sun Dec 10 2023 03:59:19 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.