From f6fa010403cb2badd88ce096ae91f664418508d1 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sat, 30 Sep 2006 19:38:34 +0000 Subject: * configure.in: add DBUS_BINDIR as a #define to C source code. * tools/dbus-launch.c * tools/dbus-launch.h * tools/dbus-launch-x11.c: * tools/dbus-launch.1: Add the --autolaunch option to dbus-launch, which makes it scan for an existing session started with --autolaunch. With that option, it also creates an X11 window and saves the bus address and PID to it. * dbus/dbus-sysdeps.h: * dbus/dbus-sysdeps-unix.c (_dbus_get_autolaunch_address): Add a function that runs "dbus-launch --autolaunch" to retrieve the running D-Bus session address (or start one if none was running) * dbus/dbus-transport.c: Add the handler for the "autolaunch:" address protocol, which tries to get the running session from dbus-launch. * dbus/dbus-bus.c: * dbus/dbus-internals.h: Make "autolaunch:" be the default D-Bus session bus address. * dbus/dbus-connection.c: Fix horrible typo in error message. --- tools/dbus-launch.h | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 tools/dbus-launch.h (limited to 'tools/dbus-launch.h') diff --git a/tools/dbus-launch.h b/tools/dbus-launch.h new file mode 100644 index 00000000..1b22f3df --- /dev/null +++ b/tools/dbus-launch.h @@ -0,0 +1,56 @@ +/* -*- mode: C; c-file-style: "gnu" -*- */ +/* dbus-launch.h dbus-launch utility + * + * Copyright (C) 2006 Thiago Macieira + * + * Licensed under the Academic Free License version 2.1 + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#ifndef DBUS_LAUNCH_H +#define DBUS_LAUNCH_H + +#include +#include + +#ifndef TRUE +#define TRUE (1) +#endif + +#ifndef FALSE +#define FALSE (0) +#endif + +#undef MAX +#define MAX(a, b) (((a) > (b)) ? (a) : (b)) + +#define MAX_ADDR_LEN 512 + +/* defined in dbus-launch.c */ +void verbose (const char *format, ...); +char *xstrdup (const char *str); +void kill_bus_and_exit (int exitcode); + +#ifdef DBUS_BUILD_X11 +/* defined in dbus-launch-x11.c */ +int x11_init (void); +int x11_get_address (char **paddress, pid_t *pid, long *wid); +int x11_save_address (char *address, pid_t pid, long *wid); +void x11_handle_event (void); +#endif + +#endif -- cgit