1
/* The GIMP -- an image manipulation program
2
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
5
* Copyright (C) 2003 Michael Natterer <mitch@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 "widgets-types.h"
28
#include "core/gimpcontext.h"
29
#include "core/gimpmarshal.h"
31
#include "gimpdocked.h"
41
static void gimp_docked_iface_base_init (GimpDockedInterface *docked_iface);
44
static guint docked_signals[LAST_SIGNAL] = { 0 };
48
gimp_docked_interface_get_type (void)
50
static GType docked_iface_type = 0;
52
if (!docked_iface_type)
54
static const GTypeInfo docked_iface_info =
56
sizeof (GimpDockedInterface),
57
(GBaseInitFunc) gimp_docked_iface_base_init,
58
(GBaseFinalizeFunc) NULL,
61
docked_iface_type = g_type_register_static (G_TYPE_INTERFACE,
62
"GimpDockedInterface",
66
g_type_interface_add_prerequisite (docked_iface_type, GTK_TYPE_WIDGET);
69
return docked_iface_type;
73
gimp_docked_iface_base_init (GimpDockedInterface *docked_iface)
75
static gboolean initialized = FALSE;
79
docked_signals[TITLE_CHANGED] =
80
g_signal_new ("title_changed",
83
G_STRUCT_OFFSET (GimpDockedInterface, title_changed),
85
gimp_marshal_VOID__VOID,
93
gimp_docked_title_changed (GimpDocked *docked)
95
g_return_if_fail (GIMP_IS_DOCKED (docked));
97
g_signal_emit (docked, docked_signals[TITLE_CHANGED], 0);
101
gimp_docked_set_aux_info (GimpDocked *docked,
104
GimpDockedInterface *docked_iface;
106
g_return_if_fail (GIMP_IS_DOCKED (docked));
108
docked_iface = GIMP_DOCKED_GET_INTERFACE (docked);
110
if (docked_iface->set_aux_info)
111
docked_iface->set_aux_info (docked, aux_info);
115
gimp_docked_get_aux_info (GimpDocked *docked)
117
GimpDockedInterface *docked_iface;
119
g_return_val_if_fail (GIMP_IS_DOCKED (docked), NULL);
121
docked_iface = GIMP_DOCKED_GET_INTERFACE (docked);
123
if (docked_iface->get_aux_info)
124
return docked_iface->get_aux_info (docked);
130
gimp_docked_get_preview (GimpDocked *docked,
131
GimpContext *context,
134
GimpDockedInterface *docked_iface;
136
g_return_val_if_fail (GIMP_IS_DOCKED (docked), NULL);
138
docked_iface = GIMP_DOCKED_GET_INTERFACE (docked);
140
if (docked_iface->get_preview)
141
return docked_iface->get_preview (docked, context, size);
147
gimp_docked_get_menu (GimpDocked *docked,
148
const gchar **ui_path,
149
gpointer *popup_data)
151
GimpDockedInterface *docked_iface;
153
g_return_val_if_fail (GIMP_IS_DOCKED (docked), NULL);
154
g_return_val_if_fail (ui_path != NULL, NULL);
155
g_return_val_if_fail (popup_data != NULL, NULL);
157
docked_iface = GIMP_DOCKED_GET_INTERFACE (docked);
159
if (docked_iface->get_menu)
160
return docked_iface->get_menu (docked, ui_path, popup_data);
166
gimp_docked_get_title (GimpDocked *docked)
168
GimpDockedInterface *docked_iface;
170
g_return_val_if_fail (GIMP_IS_DOCKED (docked), NULL);
172
docked_iface = GIMP_DOCKED_GET_INTERFACE (docked);
174
if (docked_iface->get_title)
175
return docked_iface->get_title (docked);
181
gimp_docked_set_context (GimpDocked *docked,
182
GimpContext *context)
184
GimpDockedInterface *docked_iface;
186
g_return_if_fail (GIMP_IS_DOCKED (docked));
187
g_return_if_fail (context == NULL || GIMP_IS_CONTEXT (context));
189
docked_iface = GIMP_DOCKED_GET_INTERFACE (docked);
191
if (docked_iface->set_context)
192
docked_iface->set_context (docked, context);