In this commit, the following files are updated:

main.cpp : Added a command argument. If 'stest' is set, then a testing
environment is setup which is used to test scripting for kwin.
Currently, the test setup only consists of loading a default script, but
in the feature it is expected to run a small text editor kind of thing
for testing.
       Usage:
         kwin --stest

CMakeLists.txt : Add the files corresponding to kwin_scripting the main
intention of which is to provide scripting support for kwin.

kwintabbox.desktop : An unintentional edit. Mostly harmless.


svn path=/trunk/KDE/kdebase/workspace/; revision=1133002
master
Rohan Ramdas Prabhu 15 years ago
parent 50f52101cc
commit d8daff5162

@ -110,6 +110,11 @@ set(kwin_KDEINIT_SRCS
tiling.cpp
tilinglayout.cpp
tilinglayoutfactory.cpp
#load the scripting related functions
scripttesting.cpp
scripting/scripting.cpp
scripting/workspace.cpp
# tiling layouts
# spiral
@ -130,7 +135,7 @@ qt4_add_dbus_adaptor( kwin_KDEINIT_SRCS org.kde.KWin.xml workspace.h KWin::Works
kde4_add_kdeinit_executable( kwin ${kwin_KDEINIT_SRCS})
target_link_libraries(kdeinit_kwin ${KDE4_KDEUI_LIBS} ${KDE4_PLASMA_LIBS} ${QT_QTXML_LIBRARY} kephal kworkspace kdecorations kwineffects ${X11_LIBRARIES})
target_link_libraries(kdeinit_kwin ${KDE4_KDEUI_LIBS} ${KDE4_PLASMA_LIBS} ${QT_QTXML_LIBRARY} ${QT_QTSCRIPT_LIBRARY} kephal kworkspace kdecorations kwineffects ${X11_LIBRARIES})
if(OPENGL_FOUND)
add_subdirectory(opengltest)

@ -40,6 +40,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <kdefakes.h>
#include <QtDBus/QtDBus>
#include <QMessageBox>
#include <QEvent>
#include "scripttesting.h"
#include "scripting/scripting.h"
#include <kdialog.h>
#include <kstandarddirs.h>
#include <kdebug.h>
@ -53,6 +58,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "sm.h"
#include "utils.h"
#include "effects.h"
#include <stdlib.h>
#define INT8 _X11INT8
#define INT32 _X11INT32
@ -487,8 +493,11 @@ KDE_EXPORT int kdemain( int argc, char * argv[] )
args.add( "lock", ki18n( "Disable configuration options" ));
args.add( "replace", ki18n( "Replace already-running ICCCM2.0-compliant window manager" ));
args.add( "crashes <n>", ki18n( "Indicate that KWin has recently crashed n times" ));
args.add( "stest", ki18n( "Load the script testing dialog" ));
KCmdLineArgs::addCmdLineOptions( args );
ScriptTesting* stestWindow;
if( KDE_signal( SIGTERM, KWin::sighandler ) == SIG_IGN )
KDE_signal( SIGTERM, SIG_IGN );
if( KDE_signal( SIGINT, KWin::sighandler ) == SIG_IGN )
@ -503,6 +512,7 @@ KDE_EXPORT int kdemain( int argc, char * argv[] )
KWin::SessionManager weAreIndeed;
KWin::SessionSaveDoneHelper helper;
KGlobal::locale()->insertCatalog( "kwin_effects" );
KWin::Scripting scripting;
// Announce when KWIN_DIRECT_GL is set for above HACK
if( qstrcmp( qgetenv( "KWIN_DIRECT_GL" ), "1" ) == 0 )
@ -518,8 +528,18 @@ KDE_EXPORT int kdemain( int argc, char * argv[] )
QDBusConnection::sessionBus().interface()->registerService(
appname, QDBusConnectionInterface::DontQueueService );
KCmdLineArgs* sargs = KCmdLineArgs::parsedArgs();
if(sargs->isSet("stest")) {
stestWindow = new ScriptTesting();
stestWindow->setEngine(&scripting);
stestWindow->runDefault();
//QEvent* showSTest = new QEvent(QEvent::Type(QEvent::User + 7));
//a.postEvent(stestWindow, showSTest, INT_MIN);
}
return a.exec();
}
}
#include "main.moc"

Loading…
Cancel
Save