<?xml version="1.0" encoding="UTF-8" ?>
<!--
 * This is the master description of the DBus application interface.
 * The interface is mostly just for creating new document instances.
 *
 * This file is used to generate both glue code and documentation.
 * The methods are in the same order as the .cpp/.h and the sections are labeled.
 *
 * Any change to method prototypes in application-interface.cpp MUST be reflected here.
 *
 * This file is the proverbial gold standard for the application interface. 
 *
 * Authors:
 *   Soren Berg <Glimmer07@gmail.com>
 *
 * Copyright (C) 2009 Soren Berg
 *
 * Released under GNU GPL, read the file 'COPYING' for more information
-->
<node name="/org/inkscape/application"
  xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd"
>
  <interface name="org.inkscape.application">

    <!-- DESKTOP FUNCTIONS -->
    <method name="desktop_new">
      <arg type="s" name="desktop_name" direction="out" >
        <annotation name="org.freedesktop.DBus.GLib.ReturnVal" value="error"/>
        <doc:doc>
          <doc:summary>This string can be used to connect to the new interface that was created.</doc:summary>
        </doc:doc>
      </arg>
      <doc:doc>
        <doc:description>
          <doc:para>Create a new document interface and return it's location.</doc:para>
        </doc:description>
      </doc:doc>
    </method>
    <method name="get_desktop_list">
      <arg type="as" name="document_list" direction="out" >
        <annotation name="org.freedesktop.DBus.GLib.ReturnVal" value=""/>
        <doc:doc>
          <doc:summary>A list of interfaces being provided by Inkscape.</doc:summary>
        </doc:doc>
      </arg>
      <doc:doc>
        <doc:description>
          <doc:para>List all the interfaces that it is possible to connect to.</doc:para>
        </doc:description>
      </doc:doc>
    </method>
    <method name="desktop_close_all">
      <doc:doc>
        <doc:description>
          <doc:para>Close all document interfaces without saving.</doc:para>
        </doc:description>
      </doc:doc>
    </method>
    <method name="exit">
      <doc:doc>
        <doc:description>
          <doc:para>Exit Inkscape without saving.  Fairly straightforward. </doc:para>
        </doc:description>
      </doc:doc>
    </method>

    <!-- DOCUMENT FUNCTIONS -->
    <method name="document_new">
      <arg type="s" name="document_name" direction="out" >
        <annotation name="org.freedesktop.DBus.GLib.ReturnVal" value="error"/>
        <doc:doc>
          <doc:summary>This string can be used to connect to the new interface that was created.</doc:summary>
        </doc:doc>
      </arg>
      <doc:doc>
        <doc:description>
          <doc:para>Originally, there were going to be two interfaces.  A desktop and a document.  Desktops would be used when the user wanted to see the result of their code and documents would be used when less overhead was desired.  Unfortunately as more and more of the code can to rely on the desktop and it's associated support code (including selections and verbs) the document interface was looking more and more limited.  Ultimately I decided to just go with the desktop interface since I didn't have a compelling reason for keeping the other one and having two similar interfaces could be very confusing.  The desktop interface inherited the document name because I believe it's more familiar to people.</doc:para>
          <doc:para>Perhaps it would be best to have an option as to whether or not to create a window and fail with a good error message when they call a function that requires one.  Or have a second interface for different use cases but have it be completely different, rather than a subset of the first if there are use cases that support it.</doc:para>
        </doc:description>
      </doc:doc>
    </method>
  </interface>
</node>
