DCOP
Encyclopedia
DCOP, which stands for Desktop COmmunication Protocol, is a light-weight interprocess
and software componentry communication system. The main point of this system is to allow applications
to interoperate, and to share complex tasks. Essentially, DCOP is a ‘remote control’ system, which allows an application or a script to enlist the help of other applications. It is built on top of the X Window System
’s Inter-Client Exchange protocol.
The use of DCOP provides extensive new capabilities, without requiring entirely new applications to be written, as might otherwise be the case. KDE
applications and the KDE libraries
make heavy use of DCOP and most of the KDE applications can be controlled by scripts via the DCOP mechanism. DCOP was replaced by D-Bus
in KDE Software Compilation 4.
In modern KDE systems, every KDE application supports a basic set of DCOP interfaces, even if the programmer of the application did not explicitly code in such support. For instance, every application automatically supports the “quit” command to close the application.
There is a command-line tool called ‘dcop’ (note the lower-case letters) that can be used for communication with the applications from the shell. ‘kdcop’ is a GUI
tool to explore the interfaces
of an application.
For example, the KDE desktop provides a way to display different wallpapers at timed intervals. However, it does not directly provide an interface for changing to the next wallpaper, if the current one does not fit your mood. Neither does it provide a way of permanently removing desktop wallpapers that you decide you do not like, after seeing them as actual wallpaper on your screen.
These features can be added in a few moments, however, using dcop. The command:
$ dcop kdesktop KBackgroundIface changeWallpaper
will switch to the next wallpaper from a shell, and the command:
$ dcop kdesktop KBackgroundIface currentWallpaper 1
will get the filename of the wallpaper on desktop 1. (KDE, and most X environments, support multiple ‘virtual’ desktops for organizing work.) By combining the two in a short shell script
, you can switch to the next wallpaper, then delete the previous wallpaper, like so:
OLDWALLPAPER=`dcop kdesktop KBackgroundIface currentWallpaper 1`
dcop kdesktop KBackgroundIface changeWallpaper
rm "$OLDWALLPAPER"
As you can see, DCOP makes it possible to add new features that were never envisaged when an application was first created.
Two types of actions are possible with DCOP: "send and forget" messages, which do not block, and "calls," which block waiting for some data to be returned.
Any data that will be sent is serialized (also referred to as marshalling in CORBA
speak) using the built-in QDataStream operators available in all of the Qt
classes
. There is also a simple IDL-like compiler available (dcopidl and dcopidl2cpp) that generates stubs and skeletons. Using the dcopidl compiler has the additional benefit of type safety
.
D-Bus
, a message bus system standardized by freedesktop.org
, was heavily influenced by the DCOP system and replaces DCOP in KDE Software Compilation 4.
Inter-process communication
In computing, Inter-process communication is a set of methods for the exchange of data among multiple threads in one or more processes. Processes may be running on one or more computers connected by a network. IPC methods are divided into methods for message passing, synchronization, shared...
and software componentry communication system. The main point of this system is to allow applications
Application software
Application software, also known as an application or an "app", is computer software designed to help the user to perform specific tasks. Examples include enterprise software, accounting software, office suites, graphics software and media players. Many application programs deal principally with...
to interoperate, and to share complex tasks. Essentially, DCOP is a ‘remote control’ system, which allows an application or a script to enlist the help of other applications. It is built on top of the X Window System
X Window System
The X window system is a computer software system and network protocol that provides a basis for graphical user interfaces and rich input device capability for networked computers...
’s Inter-Client Exchange protocol.
The use of DCOP provides extensive new capabilities, without requiring entirely new applications to be written, as might otherwise be the case. KDE
KDE
KDE is an international free software community producing an integrated set of cross-platform applications designed to run on Linux, FreeBSD, Microsoft Windows, Solaris and Mac OS X systems...
applications and the KDE libraries
Library (computer science)
In computer science, a library is a collection of resources used to develop software. These may include pre-written code and subroutines, classes, values or type specifications....
make heavy use of DCOP and most of the KDE applications can be controlled by scripts via the DCOP mechanism. DCOP was replaced by D-Bus
D-Bus
In computing, D-Bus is a simple inter-process communication open-source system for software applications to communicate with one another. Heavily influenced by KDE2–3's DCOP system, D-Bus has replaced DCOP in the KDE 4 release. An implementation of D-Bus supports most POSIX operating...
in KDE Software Compilation 4.
In modern KDE systems, every KDE application supports a basic set of DCOP interfaces, even if the programmer of the application did not explicitly code in such support. For instance, every application automatically supports the “quit” command to close the application.
There is a command-line tool called ‘dcop’ (note the lower-case letters) that can be used for communication with the applications from the shell. ‘kdcop’ is a GUI
Graphical user interface
In computing, a graphical user interface is a type of user interface that allows users to interact with electronic devices with images rather than text commands. GUIs can be used in computers, hand-held devices such as MP3 players, portable media players or gaming devices, household appliances and...
tool to explore the interfaces
Interface (computer science)
In the field of computer science, an interface is a tool and concept that refers to a point of interaction between components, and is applicable at the level of both hardware and software...
of an application.
For example, the KDE desktop provides a way to display different wallpapers at timed intervals. However, it does not directly provide an interface for changing to the next wallpaper, if the current one does not fit your mood. Neither does it provide a way of permanently removing desktop wallpapers that you decide you do not like, after seeing them as actual wallpaper on your screen.
These features can be added in a few moments, however, using dcop. The command:
$ dcop kdesktop KBackgroundIface changeWallpaper
will switch to the next wallpaper from a shell, and the command:
$ dcop kdesktop KBackgroundIface currentWallpaper 1
will get the filename of the wallpaper on desktop 1. (KDE, and most X environments, support multiple ‘virtual’ desktops for organizing work.) By combining the two in a short shell script
Shell script
A shell script is a script written for the shell, or command line interpreter, of an operating system. It is often considered a simple domain-specific programming language...
, you can switch to the next wallpaper, then delete the previous wallpaper, like so:
OLDWALLPAPER=`dcop kdesktop KBackgroundIface currentWallpaper 1`
dcop kdesktop KBackgroundIface changeWallpaper
rm "$OLDWALLPAPER"
As you can see, DCOP makes it possible to add new features that were never envisaged when an application was first created.
DCOP model
The model is simple. Each application using DCOP is a client. They communicate to each other through a DCOP server, which functions like a traffic director, dispatching messages/calls to the proper destinations. All clients are peers of each other.Two types of actions are possible with DCOP: "send and forget" messages, which do not block, and "calls," which block waiting for some data to be returned.
Any data that will be sent is serialized (also referred to as marshalling in CORBA
Çorba
Chorba , ciorbă , shurpa , shorpo , or sorpa is one of various kinds of soup or stew found in national cuisines across Middle East...
speak) using the built-in QDataStream operators available in all of the Qt
Qt (toolkit)
Qt is a cross-platform application framework that is widely used for developing application software with a graphical user interface , and also used for developing non-GUI programs such as command-line tools and consoles for servers...
classes
Class (computer science)
In object-oriented programming, a class is a construct that is used as a blueprint to create instances of itself – referred to as class instances, class objects, instance objects or simply objects. A class defines constituent members which enable these class instances to have state and behavior...
. There is also a simple IDL-like compiler available (dcopidl and dcopidl2cpp) that generates stubs and skeletons. Using the dcopidl compiler has the additional benefit of type safety
Type safety
In computer science, type safety is the extent to which a programming language discourages or prevents type errors. A type error is erroneous or undesirable program behaviour caused by a discrepancy between differing data types...
.
D-Bus
D-Bus
In computing, D-Bus is a simple inter-process communication open-source system for software applications to communicate with one another. Heavily influenced by KDE2–3's DCOP system, D-Bus has replaced DCOP in the KDE 4 release. An implementation of D-Bus supports most POSIX operating...
, a message bus system standardized by freedesktop.org
Freedesktop.org
freedesktop.org is a project to work on interoperability and shared base technology for free software desktop environments for the X Window System on Linux and other Unix-like operating systems. It was founded by Havoc Pennington from Red Hat in March 2000.The organisation focuses on the user....
, was heavily influenced by the DCOP system and replaces DCOP in KDE Software Compilation 4.
See also
- Portable objectPortable object (computing)In distributed programming, a portable object is an object which can be accessed through a normal method call while possibly residing in memory on another computer. It is portable in the sense that it moves from machine to machine, irrespective of operating system or computer architecture...
cross language cross platform Object Model definition - CORBAÇorbaChorba , ciorbă , shurpa , shorpo , or sorpa is one of various kinds of soup or stew found in national cuisines across Middle East...
Common Object Request Broker Architecture, cross language cross platform object model - Freedesktop.orgFreedesktop.orgfreedesktop.org is a project to work on interoperability and shared base technology for free software desktop environments for the X Window System on Linux and other Unix-like operating systems. It was founded by Havoc Pennington from Red Hat in March 2000.The organisation focuses on the user....
D-BusD-BusIn computing, D-Bus is a simple inter-process communication open-source system for software applications to communicate with one another. Heavily influenced by KDE2–3's DCOP system, D-Bus has replaced DCOP in the KDE 4 release. An implementation of D-Bus supports most POSIX operating...
current open cross language cross platform Object Model - GNOMEGNOMEGNOME is a desktop environment and graphical user interface that runs on top of a computer operating system. It is composed entirely of free and open source software...
BonoboBonobo (computing)Bonobo is a component model for creating reusable software components and compound documents. It was created by the company Ximian for compound documents used in GNOME....
deprecated GNOME cross language Object Model - KDEKDEKDE is an international free software community producing an integrated set of cross-platform applications designed to run on Linux, FreeBSD, Microsoft Windows, Solaris and Mac OS X systems...
KPart KDE component framework - XPCOMXPCOMXPCOM is a cross-platform component model from Mozilla. It is similar to Microsoft COM and CORBA. It has multiple language bindings and IDL descriptions so programmers can plug their custom functionality into the framework and connect it with other components.-The model:XPCOM is one of the main...
Mozilla applications cross Platform Component Object Model - COMCOMCOM is the original, yet still common, name of the serial port interface on IBM PC-compatible computers. It might not only refer to physical ports, but also to virtual ports, such as ports created by bluetooth or USB-to-Serial adapters....
Microsoft Windows only cross language Object Model - DCOM Distributed COM, extension making COM able to work in networks
- Common Language InfrastructureCommon Language InfrastructureThe Common Language Infrastructure is an open specification developed by Microsoft and standardized by ISO and ECMA that describes the executable code and runtime environment that form the core of the Microsoft .NET Framework and the free and open source implementations Mono and Portable.NET...
current .Net cross language cross platform Object Model - IBM System Object Model SOM, a component system from IBM used in OS/2
- Java Beans
- Java Remote Method InvocationJava remote method invocationThe Java Remote Method Invocation Application Programming Interface , or Java RMI, is a Java application programming interface that performs the object-oriented equivalent of remote procedure calls ....
(Java RMI) - Internet Communications EngineInternet Communications EngineThe Internet Communications Engine, or Ice, is an object-oriented middleware that provides object-oriented Remote Procedure Call, grid computing and Publish/subscribe functionality developed by ZeroC and dual-licensed under the GNU GPL and a proprietary license...
- Language bindingLanguage bindingIn computing, a binding from a programming language to a library or OS service is an API providing that service in the language.Many software libraries are written in systems programming languages such as C or C++...
- Foreign function interfaceForeign function interfaceA foreign function interface is a mechanism by which a program written in one programming language can call routines or make use of services written in another. The term comes from the specification for Common Lisp, which explicitly refers to the language features for inter-language calls as...
- Calling conventionCalling conventionIn computer science, a calling convention is a scheme for how subroutines receive parameters from their caller and how they return a result; calling conventions can differ in:...
- Name manglingName manglingIn compiler construction, name mangling is a technique used to solve various problems caused by the need to resolve unique names for programming entities in many modern programming languages....
- Application programming interfaceApplication programming interfaceAn application programming interface is a source code based specification intended to be used as an interface by software components to communicate with each other...
- API - Application Binary InterfaceApplication binary interfaceIn computer software, an application binary interface describes the low-level interface between an application program and the operating system or another application.- Description :...
- ABI - Comparison of application virtual machinesComparison of Application Virtual MachinesThis article lists some software virtual machines that are typically used for allowing application bytecode to be portably run on many different computer architectures and operating systems. The application is usually run on the computer using an interpreter or just-in-time compilation...
- SWIGSWIGSWIG is an open source software tool used to connect computer programs or libraries written in C or C++ with scripting languages such as Lua, Perl, PHP, Python, R, Ruby, Tcl, and other languages like C#, Java, Modula-3, Objective Caml, Octave, and Scheme...
opensource automatic interfaces bindings generator from many languages to many languages