[Thunar-dev] D-Bus interface

Benedikt Meurer benedikt.meurer at unix-ag.uni-siegen.de
Tue Jan 31 23:27:19 CET 2006


I'd like to discuss the D-Bus interface(s) for Thunar, in order to fix
bug #1384 for the alpha2 release. My initial idea was to put everything
in one interface, but that's not a very good idea. So, there'll be
several interfaces implemented by Thunar.


Interface: org.xfce.FileManager
===============================

This is the basic interface implemented by Xfce file managers (Thunar
and Xffm, and whatever other file managers). Other applications can
communicate with the active file manager using this interface. The file
manager will request the name "org.xfce.FileManager" on startup (without
replacing any previously bound name), and applications use this name (as
destination) when communicating with the file manager. This way, Xfce
applications don't need to depend on Thunar or Xffm directly, but can
use whatever file manager is running.

To make sure all file managers can easily support this interface, it
contains only the most basic methods required by a file manager:

  /* Display the folder at uri in a (new) window, returns error if
   * uri is not supported, does not exist or does not refer to a
   * folder.
   */
  VOID DisplayFolder (STRING uri)
  VOID DisplayFolderOnDisplay (STRING uri, STRING display)

  /* Opens the file properties dialog for the file at uri, returns
   * error if uri is not supported or does not exist.
   */
  VOID DisplayFileProperties (STRING uri)
  VOID DisplayFilePropertiesOnDisplay (STRING uri, STRING display)

  /* Opens the uri with the preferred application. If uri is a folder
   * a (new) file manager window should be opened, else if uri refers
   * to an executable file, that file should be run. Otherwise the
   * preferred application for uri will be determined and run with
   * uri. Returns error if uri is not support or does not exist.
   */
  VOID Launch (STRING uri)
  VOID LaunchOnDisplay (STRING uri, STRING display)


Interface: org.xfce.thunar.FileManager
======================================

This interface will include methods specific to Thunar, but available to
other applications as well (but applications will depend on Thunar, if
they use any of these methods). Dunno yet, what should be included here,
open for suggestions.


Interface: org.xfce.RunDialog
=============================

This would be implemented by the file managers (or whatever other
application) and xfrun4 would just invoke OpenDialog(), falling back to
a simple(!) run dialog if no service is registered. This way the "Run
Application" dialog will appear instantly in the future (I doubt that
time permits us to implement this properly in Thunar/Xffm, but
nevertheless we can change xfrun4, so all we need to do afterwards is to
change Thunar/Xffm, and people won't have to wait for Xfce 4.6).

  /* Requests to display the run dialog using the specified
   * working_directory as base directory for applications run
   * from the dialog.
   */
  VOID OpenDialog (STRING working_directory)
  VOID OpenDialogOnDisplay (STRING working_directory, STRING display)


Comments/suggestions welcome.

Benedikt



More information about the Thunar-dev mailing list