1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
|
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*-
nautilus-window-info.c: Interface for nautilus window
Copyright (C) 2004 Red Hat Inc.
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.
Author: Alexander Larsson <alexl@redhat.com>
*/
#include <config.h>
#include "nautilus-window-info.h"
enum {
LOADING_URI,
SELECTION_CHANGED,
TITLE_CHANGED,
HIDDEN_FILES_MODE_CHANGED,
LAST_SIGNAL
};
static guint nautilus_window_info_signals[LAST_SIGNAL] = { 0 };
static void
nautilus_window_info_base_init (gpointer g_class)
{
static gboolean initialized = FALSE;
if (! initialized) {
nautilus_window_info_signals[LOADING_URI] =
g_signal_new ("loading_uri",
NAUTILUS_TYPE_WINDOW_INFO,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (NautilusWindowInfoIface, loading_uri),
NULL, NULL,
g_cclosure_marshal_VOID__STRING,
G_TYPE_NONE, 1,
G_TYPE_STRING);
nautilus_window_info_signals[SELECTION_CHANGED] =
g_signal_new ("selection_changed",
NAUTILUS_TYPE_WINDOW_INFO,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (NautilusWindowInfoIface, selection_changed),
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
nautilus_window_info_signals[TITLE_CHANGED] =
g_signal_new ("title_changed",
NAUTILUS_TYPE_WINDOW_INFO,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (NautilusWindowInfoIface, title_changed),
NULL, NULL,
g_cclosure_marshal_VOID__STRING,
G_TYPE_NONE, 1,
G_TYPE_STRING);
nautilus_window_info_signals[HIDDEN_FILES_MODE_CHANGED] =
g_signal_new ("hidden_files_mode_changed",
NAUTILUS_TYPE_WINDOW_INFO,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (NautilusWindowInfoIface, hidden_files_mode_changed),
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
initialized = TRUE;
}
}
GType
nautilus_window_info_get_type (void)
{
static GType type = 0;
if (!type) {
static const GTypeInfo info = {
sizeof (NautilusWindowInfoIface),
nautilus_window_info_base_init,
NULL,
NULL,
NULL,
NULL,
0,
0,
NULL
};
type = g_type_register_static (G_TYPE_INTERFACE,
"NautilusWindowInfo",
&info, 0);
g_type_interface_add_prerequisite (type, G_TYPE_OBJECT);
}
return type;
}
void
nautilus_window_info_report_load_underway (NautilusWindowInfo *window,
NautilusView *view)
{
g_return_if_fail (NAUTILUS_IS_WINDOW_INFO (window));
g_return_if_fail (NAUTILUS_IS_VIEW (view));
(* NAUTILUS_WINDOW_INFO_GET_IFACE (window)->report_load_underway) (window,
view);
}
void
nautilus_window_info_report_load_complete (NautilusWindowInfo *window,
NautilusView *view)
{
g_return_if_fail (NAUTILUS_IS_WINDOW_INFO (window));
g_return_if_fail (NAUTILUS_IS_VIEW (view));
(* NAUTILUS_WINDOW_INFO_GET_IFACE (window)->report_load_complete) (window,
view);
}
void
nautilus_window_info_report_view_failed (NautilusWindowInfo *window,
NautilusView *view)
{
g_return_if_fail (NAUTILUS_IS_WINDOW_INFO (window));
g_return_if_fail (NAUTILUS_IS_VIEW (view));
(* NAUTILUS_WINDOW_INFO_GET_IFACE (window)->report_view_failed) (window,
view);
}
void
nautilus_window_info_report_selection_changed (NautilusWindowInfo *window)
{
g_return_if_fail (NAUTILUS_IS_WINDOW_INFO (window));
(* NAUTILUS_WINDOW_INFO_GET_IFACE (window)->report_selection_changed) (window);
}
void
nautilus_window_info_open_location (NautilusWindowInfo *window,
const char *location,
NautilusWindowOpenMode mode,
NautilusWindowOpenFlags flags,
GList *selection)
{
g_return_if_fail (NAUTILUS_IS_WINDOW_INFO (window));
(* NAUTILUS_WINDOW_INFO_GET_IFACE (window)->open_location) (window,
location,
mode,
flags,
selection);
}
void
nautilus_window_info_show_window (NautilusWindowInfo *window)
{
g_return_if_fail (NAUTILUS_IS_WINDOW_INFO (window));
(* NAUTILUS_WINDOW_INFO_GET_IFACE (window)->show_window) (window);
}
void
nautilus_window_info_close (NautilusWindowInfo *window)
{
g_return_if_fail (NAUTILUS_IS_WINDOW_INFO (window));
(* NAUTILUS_WINDOW_INFO_GET_IFACE (window)->close_window) (window);
}
void
nautilus_window_info_set_status (NautilusWindowInfo *window,
const char *status)
{
g_return_if_fail (NAUTILUS_IS_WINDOW_INFO (window));
(* NAUTILUS_WINDOW_INFO_GET_IFACE (window)->set_status) (window,
status);
}
NautilusWindowType
nautilus_window_info_get_window_type (NautilusWindowInfo *window)
{
g_return_val_if_fail (NAUTILUS_IS_WINDOW_INFO (window), NAUTILUS_WINDOW_SPATIAL);
return (* NAUTILUS_WINDOW_INFO_GET_IFACE (window)->get_window_type) (window);
}
char *
nautilus_window_info_get_title (NautilusWindowInfo *window)
{
g_return_val_if_fail (NAUTILUS_IS_WINDOW_INFO (window), NULL);
return (* NAUTILUS_WINDOW_INFO_GET_IFACE (window)->get_title) (window);
}
GList *
nautilus_window_info_get_history (NautilusWindowInfo *window)
{
g_return_val_if_fail (NAUTILUS_IS_WINDOW_INFO (window), NULL);
return (* NAUTILUS_WINDOW_INFO_GET_IFACE (window)->get_history) (window);
}
NautilusBookmarkList *
nautilus_window_info_get_bookmark_list (NautilusWindowInfo *window)
{
g_return_val_if_fail (NAUTILUS_IS_WINDOW_INFO (window), NULL);
return (* NAUTILUS_WINDOW_INFO_GET_IFACE (window)->get_bookmark_list) (window);
}
char *
nautilus_window_info_get_current_location (NautilusWindowInfo *window)
{
g_return_val_if_fail (NAUTILUS_IS_WINDOW_INFO (window), NULL);
return (* NAUTILUS_WINDOW_INFO_GET_IFACE (window)->get_current_location) (window);
}
int
nautilus_window_info_get_selection_count (NautilusWindowInfo *window)
{
g_return_val_if_fail (NAUTILUS_IS_WINDOW_INFO (window), 0);
return (* NAUTILUS_WINDOW_INFO_GET_IFACE (window)->get_selection_count) (window);
}
GList *
nautilus_window_info_get_selection (NautilusWindowInfo *window)
{
g_return_val_if_fail (NAUTILUS_IS_WINDOW_INFO (window), NULL);
return (* NAUTILUS_WINDOW_INFO_GET_IFACE (window)->get_selection) (window);
}
NautilusWindowShowHiddenFilesMode
nautilus_window_info_get_hidden_files_mode (NautilusWindowInfo *window)
{
g_return_val_if_fail (NAUTILUS_IS_WINDOW_INFO (window), NAUTILUS_WINDOW_SHOW_HIDDEN_FILES_DEFAULT);
return (* NAUTILUS_WINDOW_INFO_GET_IFACE (window)->get_hidden_files_mode) (window);
}
void
nautilus_window_info_set_hidden_files_mode (NautilusWindowInfo *window,
NautilusWindowShowHiddenFilesMode mode)
{
g_return_if_fail (NAUTILUS_IS_WINDOW_INFO (window));
(* NAUTILUS_WINDOW_INFO_GET_IFACE (window)->set_hidden_files_mode) (window,
mode);
}
GtkUIManager *
nautilus_window_info_get_ui_manager (NautilusWindowInfo *window)
{
g_return_val_if_fail (NAUTILUS_IS_WINDOW_INFO (window), NULL);
return (* NAUTILUS_WINDOW_INFO_GET_IFACE (window)->get_ui_manager) (window);
}
|