1 /* GIMP - The GNU Image Manipulation Program
2 * Copyright (C) 1995 Spencer Kimball and Peter Mattis
3 *
4 * gimpsessionmanaged.c
5 * Copyright (C) 2011 Martin Nordholts <martinn@src.gnome.org>
6 *
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 3 of the License, or
10 * (at your option) any later version.
11 *
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.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 */
20
21 #include "config.h"
22
23 #include <gtk/gtk.h>
24
25 #include "widgets-types.h"
26
27 #include "gimpsessionmanaged.h"
28
29
G_DEFINE_INTERFACE(GimpSessionManaged,gimp_session_managed,GTK_TYPE_WIDGET)30 G_DEFINE_INTERFACE (GimpSessionManaged, gimp_session_managed, GTK_TYPE_WIDGET)
31
32
33 /* private functions */
34
35
36 static void
37 gimp_session_managed_default_init (GimpSessionManagedInterface *iface)
38 {
39 }
40
41
42 /* public functions */
43
44
45 /**
46 * gimp_session_managed_get_aux_info:
47 * @session_managed: A #GimpSessionManaged
48 *
49 * Returns: A list of #GimpSessionInfoAux created with
50 * gimp_session_info_aux_new().
51 **/
52 GList *
gimp_session_managed_get_aux_info(GimpSessionManaged * session_managed)53 gimp_session_managed_get_aux_info (GimpSessionManaged *session_managed)
54 {
55 GimpSessionManagedInterface *iface;
56
57 g_return_val_if_fail (GIMP_IS_SESSION_MANAGED (session_managed), NULL);
58
59 iface = GIMP_SESSION_MANAGED_GET_INTERFACE (session_managed);
60
61 if (iface->get_aux_info)
62 return iface->get_aux_info (session_managed);
63
64 return NULL;
65 }
66
67 /**
68 * gimp_session_managed_get_ui_manager:
69 * @session_managed: A #GimpSessionManaged
70 * @aux_info A list of #GimpSessionInfoAux
71 *
72 * Sets aux data previously returned from
73 * gimp_session_managed_get_aux_info().
74 **/
75 void
gimp_session_managed_set_aux_info(GimpSessionManaged * session_managed,GList * aux_info)76 gimp_session_managed_set_aux_info (GimpSessionManaged *session_managed,
77 GList *aux_info)
78 {
79 GimpSessionManagedInterface *iface;
80
81 g_return_if_fail (GIMP_IS_SESSION_MANAGED (session_managed));
82
83 iface = GIMP_SESSION_MANAGED_GET_INTERFACE (session_managed);
84
85 if (iface->set_aux_info)
86 iface->set_aux_info (session_managed, aux_info);
87 }
88