pcb 4.1.1
An interactive printed circuit board layout editor.

dbus.c File Reference

D-Bus IPC logic. More...

#include <dbus/dbus.h>
#include <string.h>
#include "dbus.h"
#include "dbus-pcbmain.h"
#include "dbus-introspect.h"
#include "global.h"
#include "data.h"
#include "lrealpath.h"
Include dependency graph for dbus.c:

Go to the source code of this file.

Defines

#define DBUS_API_SUBJECT_TO_CHANGE
#define PCB_DBUS_CANONICAL_NAME   "org.seul.geda.pcb"
#define PCB_DBUS_OBJECT_PATH   "/org/seul/geda/pcb"
#define PCB_DBUS_INTERFACE   "org.seul.geda.pcb"
#define PCB_DBUS_ACTIONS_INTERFACE   "org.seul.geda.pcb.actions"

Functions

static DBusHandlerResult handle_get_filename (DBusConnection *connection, DBusMessage *message, void *data)
static DBusHandlerResult handle_exec_action (DBusConnection *connection, DBusMessage *message, void *data)
static DBusHandlerResult handle_introspect (DBusConnection *connection, DBusMessage *message, void *data)
static void unregister_dbus_handler (DBusConnection *connection, void *data)
static DBusHandlerResult handle_dbus_message (DBusConnection *connection, DBusMessage *message, void *data)
void pcb_dbus_setup (void)
 Carry out all actions to setup the D-Bus and register appropriate callbacks.
void pcb_dbus_finish (void)
 Carry out all actions to finalise the D-Bus connection.

Variables

static DBusConnection * pcb_dbus_conn

Detailed Description

D-Bus IPC logic.

D-Bus code originally derrived from example-service.c in the dbus-glib bindings.

PCB, an interactive printed circuit board editor

Copyright (C) 2006 University of Cambridge

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

Definition in file dbus.c.


Define Documentation

#define DBUS_API_SUBJECT_TO_CHANGE

Definition at line 28 of file dbus.c.

#define PCB_DBUS_ACTIONS_INTERFACE   "org.seul.geda.pcb.actions"

Definition at line 45 of file dbus.c.

Referenced by handle_dbus_message().

#define PCB_DBUS_CANONICAL_NAME   "org.seul.geda.pcb"

Definition at line 42 of file dbus.c.

Referenced by pcb_dbus_finish(), and pcb_dbus_setup().

#define PCB_DBUS_INTERFACE   "org.seul.geda.pcb"

Definition at line 44 of file dbus.c.

Referenced by handle_dbus_message().

#define PCB_DBUS_OBJECT_PATH   "/org/seul/geda/pcb"

Definition at line 43 of file dbus.c.

Referenced by pcb_dbus_finish(), and pcb_dbus_setup().


Function Documentation

static DBusHandlerResult handle_dbus_message ( DBusConnection *  connection,
DBusMessage *  message,
void *  data 
) [static]

Definition at line 233 of file dbus.c.

References handle_exec_action(), handle_get_filename(), handle_introspect(), PCB_DBUS_ACTIONS_INTERFACE, and PCB_DBUS_INTERFACE.

Referenced by pcb_dbus_setup().

Here is the call graph for this function:

static DBusHandlerResult handle_exec_action ( DBusConnection *  connection,
DBusMessage *  message,
void *  data 
) [static]

Definition at line 112 of file dbus.c.

References hid_actionv().

Referenced by handle_dbus_message().

Here is the call graph for this function:

static DBusHandlerResult handle_get_filename ( DBusConnection *  connection,
DBusMessage *  message,
void *  data 
) [static]

Definition at line 51 of file dbus.c.

References PCBType::Filename, filename, lrealpath(), and PCB.

Referenced by handle_dbus_message().

Here is the call graph for this function:

static DBusHandlerResult handle_introspect ( DBusConnection *  connection,
DBusMessage *  message,
void *  data 
) [static]

Definition at line 192 of file dbus.c.

References pcb_dbus_conn.

Referenced by handle_dbus_message().

void pcb_dbus_finish ( void  )

Carry out all actions to finalise the D-Bus connection.

Definition at line 389 of file dbus.c.

References PCB_DBUS_CANONICAL_NAME, pcb_dbus_conn, pcb_dbus_connection_finish_with_mainloop(), and PCB_DBUS_OBJECT_PATH.

Referenced by main().

Here is the call graph for this function:

void pcb_dbus_setup ( void  )

Carry out all actions to setup the D-Bus and register appropriate callbacks.

Definition at line 329 of file dbus.c.

References handle_dbus_message(), PCB_DBUS_CANONICAL_NAME, pcb_dbus_conn, pcb_dbus_connection_setup_with_mainloop(), PCB_DBUS_OBJECT_PATH, and unregister_dbus_handler().

Referenced by main().

Here is the call graph for this function:

static void unregister_dbus_handler ( DBusConnection *  connection,
void *  data 
) [static]

Definition at line 227 of file dbus.c.

Referenced by pcb_dbus_setup().


Variable Documentation

DBusConnection* pcb_dbus_conn [static]

Definition at line 47 of file dbus.c.

Referenced by handle_introspect(), pcb_dbus_finish(), and pcb_dbus_setup().