/*
* This is where Inkscape connects to the DBus when it starts and
* registers the main interface.
*
* Also where new interfaces are registered when a new document is created.
* (Not called directly by application-interface but called indirectly.)
*
* Authors:
* Soren Berg <Glimmer07@gmail.com>
*
* Copyright (C) 2009 Soren Berg
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include <dbus/dbus-glib.h>
// this is reguired so that giomm headers won't barf
#include "dbus-init.h"
#include "application-interface.h"
#include "application-server-glue.h"
#include "document-interface.h"
#include "document-server-glue.h"
#include "inkscape.h"
#include "document.h"
#include "desktop.h"
#include "file.h"
#include "verbs.h"
#include <algorithm>
#include <iostream>
#include <sstream>
namespace
{
// This stores the bus name to use for this app instance. By default, it
// will be set to org.inkscape. However, users may provide other names by
// setting command-line parameters when starting Inkscape, so that more
// than one instance of Inkscape may be used by external scripts.
}
namespace Inkscape {
namespace Extension {
namespace Dbus {
/* PRIVATE get a connection to the session bus */
if (error) {
return NULL;
}
else
return connection;
}
/* PRIVATE create a proxy object for a bus.*/
return dbus_g_proxy_new_for_name (connection,
}
/* PRIVATE register an object on a bus */
static gpointer
const DBusGObjectInfo *info,
{
return object;
}
/*
* PRIVATE register a document interface for the document in the given ActionContext, if none exists.
* Return the DBus path to the interface (something like /org/inkscape/document_0).
* Note that while a DocumentInterface could be used either for a document with no desktop, or a
* document with a desktop, this function is only used for creating interfaces in the former case.
* FIXME: This state of affairs probably needs tidying up at some point in the future.
*/
static gchar *
{
// Document name is not suitable for DBus name, as it might contain invalid chars
// Has the document already been registered?
// No - register it
// Set the document info for this interface
}
}
/* Initialize a Dbus service */
void
init (void)
{
if (instance_bus_name == NULL) {
// Set the bus name to the default
}
//create interface for application
}
gchar *
init_document (void)
{
// This is for command-line use only
// Create a blank document and get its selection model etc in an ActionContext
}
gchar *
{
if (!doc) {
return NULL;
}
}
gchar *
{
//printf("DKEY: %d\n, NUMBER %d\n NAME: %s\n", dt->dkey, dt->number, name.c_str());
}
gchar *
init_desktop (void) {
//this function will create a new desktop and call
//dbus_init_desktop_interface.
}
void
{
}
gchar *
{
return instance_bus_name;
}
} } } /* namespace Inkscape::Extension::Dbus */