1
/* GIMP - The GNU Image Manipulation Program
2
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
5
* Copyright (C) 2007 Sven Neumann <sven@gimp.org>
7
* This program is free software; you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation; either version 2 of the License, or
10
* (at your option) any later version.
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
17
* You should have received a copy of the GNU General Public License
18
* along with this program; if not, write to the Free Software
19
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26
#include <dbus/dbus-glib.h>
28
#include "core/core-types.h"
30
#include "core/gimp.h"
32
#include "file/file-open.h"
34
#include "gimpdbusservice.h"
35
#include "gimpdbusservice-glue.h"
36
#include "gimpuimanager.c"
39
static void gimp_dbus_service_class_init (GimpDBusServiceClass *klass);
40
static void gimp_dbus_service_init (GimpDBusService *service);
42
G_DEFINE_TYPE (GimpDBusService, gimp_dbus_service, G_TYPE_OBJECT)
46
gimp_dbus_service_class_init (GimpDBusServiceClass *klass)
48
dbus_g_object_type_install_info (G_TYPE_FROM_CLASS (klass),
49
&dbus_glib_gimp_object_info);
53
gimp_dbus_service_init (GimpDBusService *service)
58
gimp_dbus_service_new (Gimp *gimp)
60
GimpDBusService *service;
62
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
64
service = g_object_new (GIMP_TYPE_DBUS_SERVICE, NULL);
68
return G_OBJECT (service);
72
gimp_dbus_service_open (GimpDBusService *service,
77
g_return_val_if_fail (GIMP_IS_DBUS_SERVICE (service), FALSE);
78
g_return_val_if_fail (uri != NULL, FALSE);
79
g_return_val_if_fail (success != NULL, FALSE);
81
*success = file_open_from_command_line (service->gimp, uri, FALSE);
87
gimp_dbus_service_open_as_new (GimpDBusService *service,
92
g_return_val_if_fail (GIMP_IS_DBUS_SERVICE (service), FALSE);
93
g_return_val_if_fail (uri != NULL, FALSE);
94
g_return_val_if_fail (success != NULL, FALSE);
96
*success = file_open_from_command_line (service->gimp, uri, TRUE);
102
gimp_dbus_service_activate (GimpDBusService *service,
105
const GList *managers;
107
g_return_val_if_fail (GIMP_IS_DBUS_SERVICE (service), FALSE);
109
/* raise the toolbox */
110
managers = gimp_ui_managers_from_name ("<Image>");
113
gimp_ui_manager_activate_action (managers->data,
114
"dialogs", "dialogs-toolbox");
119
#endif /* HAVE_DBUS_GLIB */