Kross (KDE)
   HOME

TheInfoList



OR:

Kross is a scripting framework for
KDE Frameworks KDE Frameworks is a collection of libraries and software frameworks readily available to any Qt-based software stacks or applications on multiple operating systems. Featuring frequently needed functionality solutions like hardware integration, fi ...
. Originally Kross was designed for use in
KOffice KOffice is a free and open source office and graphics suite developed by KDE for Unix-like and Windows systems. KOffice contains a word processor ( KWord), a spreadsheet (KSpread), a presentation program ( KPresenter), and a number of other comp ...
but eventually became the official scripting framework in
KDE Software Compilation 4 KDE Software Compilation 4 (KDE SC 4) was the only series of the so-called KDE Software Compilation (short: KDE SC), first released in January 2008 and the last release being 4.14.3 released in November 2014. It was the follow-up to K Desktop En ...
. Kross is designed to provide full scripting power for users of KDE applications, with a language of ''their own choice''; and make it easy for developers targeting the KDE platform to enable their application with support for ''multiple scripting languages'' (without themselves needing to be proficient in any of them). The Kross scripting framework is not a
scripting language A scripting language or script language is a programming language that is used to manipulate, customize, and automate the facilities of an existing system. Scripting languages are usually interpreted at runtime rather than compiled. A scripting ...
itself. It merely serves to plug into KDE the support for other, already existing scripting languages. Currently supported are: Python,
Ruby A ruby is a pinkish red to blood-red colored gemstone, a variety of the mineral corundum ( aluminium oxide). Ruby is one of the most popular traditional jewelry gems and is very durable. Other varieties of gem-quality corundum are called ...
, and
JavaScript JavaScript (), often abbreviated as JS, is a programming language that is one of the core technologies of the World Wide Web, alongside HTML and CSS. As of 2022, 98% of websites use JavaScript on the client side for webpage behavior, of ...
and the Falcon Programming Language. Addition of other scripting languages is made easy by the modular architecture of the framework. Kross provides the following advantages over other approaches to enable scripting for desktop applications or desktop environments: * The user is free to pick and use their favorite language for the scripting efforts * The application developer does not need to know the specifics about a scripting language * Other scripting languages can be easily added by writing a module/ plugin for Kross.


Comparison with other scripting frameworks


SWIG: Simplified Wrapper and Interface Generator

* Kross currently has fewer supported scripting languages. * Kross is built on top of Qt/KDE. This allows access to Qt/KDE things without needing extra effort to wrap them. * Applications supporting Kross do not require as much code as to support SWIG. * With SWIG, the set of supported scripting languages is determined at the time of compiling the application: each supported language must either have code in the application to invoke that language's interpreter, and/or have a shared library specific to that application–language pair whereas Kross doesn't need to know until runtime.


AppleScript

Compared to AppleScript's Open Scripting Architecture (OSA): * OSA can be used with IPC ( Apple events), allowing a script to be in a separate process, whereas Kross scripts always run in the same process as the main application. In practical terms, using IPC allows a script to interface between several already-running applications; Kross does not. :(IPC is not technically necessary for one script to access code from many applications at once: a script can link against library forms of those applications, such as the libraries produced by SWIG.) * While Kross allows the scripter to write scripts in a language of their choice, AppleScript is one given language, though it can be called from within other (scripting) languages. * Kross always requires code added to the application explicitly for Kross, whereas many
macOS macOS (; previously OS X and originally Mac OS X) is a Unix operating system developed and marketed by Apple Inc. since 2001. It is the primary operating system for Apple's Mac computers. Within the market of desktop and la ...
applications have basic scriptability just because of their choice of GUI toolkit (
Cocoa Cocoa may refer to: Chocolate * Chocolate * ''Theobroma cacao'', the cocoa tree * Cocoa bean, seed of ''Theobroma cacao'' * Chocolate liquor, or cocoa liquor, pure, liquid chocolate extracted from the cocoa bean, including both cocoa butter an ...
) (see
AppleScript AppleScript is a scripting language created by Apple Inc. that facilitates automated control over scriptable Mac applications. First introduced in System 7, it is currently included in all versions of macOS as part of a package of system aut ...
in macOS). ( Dogtail and other GUI testing/automation tools also have this property.) “Basic scriptability” here means at least being able to click on buttons and menus and access information provided to
accessibility Accessibility is the design of products, devices, services, vehicles, or environments so as to be usable by people with disabilities. The concept of accessible design and practice of accessible development ensures both "direct access" (i. ...
software such as
Screen reader A screen reader is a form of assistive technology (AT) that renders text and image content as speech or braille output. Screen readers are essential to people who are blind, and are useful to people who are visually impaired, illiterate, or ...
s. Kross does not currently have any provision for running untrusted scripts, i.e. does not allow restricting what scripts can do. Kross developer SauerThe Road to KDE 4: New KOffice Technologies
/ref> suggests either using a language with good sandbox support (such as by using the experimental Java plugin) or using approaches to increase the trust in scripts, such as using signed scripts.


Applications using Kross

*
Calligra Suite Calligra Suite is a graphic art and office suite by KDE. It is available for desktop PCs, tablet computers, and smartphones. It contains applications for word processing, spreadsheets, presentation, databases, vector graphics, and digital paintin ...
*
Kexi Kexi is a visual database applications creator tool by KDE, designed to fill the gap between spreadsheets and database solutions requiring more sophisticated development. Kexi can be used for designing and implementing databases, data inserting ...
*
Krita Krita ( ) is a free and open-source raster graphics editor designed primarily for digital art and 2D animation. The software runs on Windows, macOS, Linux, Android, and ChromeOS, and features an OpenGL-accelerated canvas, colour management su ...
*
KDevelop KDevelop is a free and open-source integrated development environment (IDE) for Unix-like computer operating systems and Windows. It provides editing, navigation and debugging features for several programming languages, and integration with buil ...
*
KTorrent KTorrent is a BitTorrent client that is part of the KDE Gear. Features KTorrent is often received as a client intended to be feature rich. Features include: *Upload and download speed capping / throttling & scheduling *Internet searching with ...
*
Kopete Kopete is a multi-protocol, free software instant messaging client released as part of the KDE Software Compilation. Although it can run in numerous environments, it was designed for and integrates with the KDE Plasma Workspaces. Kopete was star ...
* Plasma


References


External links


Kross home page (documentation for developers)Interview with Kross developerKross tutorialaKademy 2006 conference talk on Kross
{{KDE Calligra Suite KDE Frameworks KDE Platform