Desktop communication protocol: Difference between revisions

Content deleted Content added
SyntaxPC (talk | contribs)
Added a link to the other use for the acronym DCOP.
Replaced by D-Bus
 
(48 intermediate revisions by 43 users not shown)
Line 1:
{{dablinkfor|For the use of this acronym as it pertains to [[Artificialartificial Intelligence]], see [[intelligence|Distributed constraint optimization]].}}
{{Infobox software
| name =
[[de:| title = Desktop Communication Protocol]]
| logo = <!-- Image name is enough -->
| logo caption =
| logo_size =
| logo_alt =
| screenshot = <!-- Image name is enough -->
| caption =
| screenshot_size =
| screenshot_alt =
| collapsible =
| author = [[KDE]]
| developer = [[KDE]]
| released = <!-- {{Start date and age|YYYY|MM|DD|df=yes/no}} -->
| discontinued = yes
| latest release version =
| latest release date = <!-- {{Start date and age|YYYY|MM|DD|df=yes/no}} -->
| latest preview version =
| latest preview date = <!-- {{Start date and age|YYYY|MM|DD|df=yes/no}} -->
| status =
| programming language =
| operating system = [[Linux]]
| replaced_by = [[D-Bus]]
| genre = [[Inter-process communication|IPC daemon]]
| license = [[GNU LGPL]]
| website =
}}
[[Image:KDE_logo.svg|left|50px]]'''Desktop''DCOP''''', which stands for '' '''DCommunication'''esktop '''COProtocol'''mmunication ('''PDCOP'''rotocol'',) iswas a light-weightan [[inter-process communication|interprocess]] and(IPC) [[softwareDaemon componentry(computing)|daemon]] communicationby system[[KDE]] used in [[K Desktop Environment 3]]. The maindesign pointgoal offor thisthe systemprotocol iswas to allow [[Application software|applications]] to interoperate, and to share complex tasks. Essentially, DCOP iswas a ‘remote control’ system, which allowsallowed an applicationapplications or a scriptscripts to enlist the help of other applications. ItDCOP is built on top of the [[X Window System]]’s [[X_Window_System_protocols_and_architectureprotocols and architecture#Inter-client_communicationclient communication|X11 Inter-Client Exchange]] protocol.
 
DCOP continues to be used by the K Desktop Environment 3-fork [[Trinity Desktop Environment]]. DCOP was replaced by [[D-Bus]], a message bus system heavily influenced by the DCOP and standardized by [[freedesktop.org]], in [[KDE Software Compilation 4]] and later.
 
== DCOP Modelmodel ==
[[Image:KDE_logo.svg|left|50px]]'''''DCOP''''', which stands for '' '''D'''esktop '''CO'''mmunication '''P'''rotocol'', is a light-weight [[inter-process communication|interprocess]] and [[software componentry]] communication system. The main point of this system is to allow [[Application software|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 [[X_Window_System_protocols_and_architecture#Inter-client_communication|Inter-Client Exchange]] protocol.
TheDCOP modelimplements isthe simple.[[client–server Eachmodel]], where each application using DCOP is a client. Theyand communicatecommunicates to eachwith other clients through athe DCOP server,. whichDCOP server 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.
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 [[library (computer science)|libraries]] make heavy use of DCOP and most of the KDE applications can be controlled by [[Scripting programming language|scripts]] via the DCOP mechanism.
 
Any data that will be sent is serialized (also referred to as ''[[Marshalling (computer science)|marshalling]]'' in [[CORBA]] speak) using the built-in QDataStream operators available in all of the [[Qt classes.(software)|Qt]] This[[Class is(computer fast and easyscience)|classes]]. InThere factis it's so little work that you can easily write the marshalling code by hand. In addition, there'salso a simple IDL-like compiler available (dcopidl and dcopidl2cpp) that generates stubs and skeletons for you. Using the dcopidl compiler has the additional benefit of [[type safety]].
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 [[Graphical user interface|GUI]] tool to explore the [[Interface (computer science)|interfaces]] of an application.
 
==See also==
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.
{{Portal|Free and open-source software}}
 
* [[KDELibs]] – predecessor of KDE Platform 4
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.
 
== 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 speak) using the built-in QDataStream operators available in all of the Qt classes. This is fast and easy. In fact it's so little work that you can easily write the marshalling code by hand. In addition, there's a simple IDL-like compiler available (dcopidl and dcopidl2cpp) that generates stubs and skeletons for you. 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 will replace DCOP in the upcoming [[KDE4|KDE 4]] release.
 
== External links ==
{{portal|Free software|Floss draft.png}}
 
== External links ==
* [http://api.kde.org/3.5-api/kdelibs-apidocs/dcop/html/index.html DCOP Documentation]
* [http://developer.kde.org/documentation/tutorials/dot/dcopiface/dcop-interface.html Tutorial for creating a DCOP Interface]
 
{{Inter-process communication}}
{{KDE}}
 
[[Category:Inter-process communication]]
[[Category:KDE Platform]]
[[Category:Software that uses Qt]]
 
[[ca:DCOP]]
[[de:Desktop Communication Protocol]]
[[es:DCOP]]
[[it:DCOP]]
[[pl:DCOP]]
[[pt:DCOP]]