1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*-
3 nautilus-window-info.c: Interface for nautilus window
5 Copyright (C) 2004 Red Hat Inc.
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License as
9 published by the Free Software Foundation; either version 2 of the
10 License, or (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 GNU
15 General Public License for more details.
17 You should have received a copy of the GNU General Public
18 License along with this program; if not, write to the
19 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA.
22 Author: Alexander Larsson <alexl@redhat.com>
26 #include "nautilus-window-info.h"
32 HIDDEN_FILES_MODE_CHANGED
,
36 static guint nautilus_window_info_signals
[LAST_SIGNAL
] = { 0 };
39 nautilus_window_info_base_init (gpointer g_class
)
41 static gboolean initialized
= FALSE
;
44 nautilus_window_info_signals
[LOADING_URI
] =
45 g_signal_new ("loading_uri",
46 NAUTILUS_TYPE_WINDOW_INFO
,
48 G_STRUCT_OFFSET (NautilusWindowInfoIface
, loading_uri
),
50 g_cclosure_marshal_VOID__STRING
,
54 nautilus_window_info_signals
[SELECTION_CHANGED
] =
55 g_signal_new ("selection_changed",
56 NAUTILUS_TYPE_WINDOW_INFO
,
58 G_STRUCT_OFFSET (NautilusWindowInfoIface
, selection_changed
),
60 g_cclosure_marshal_VOID__VOID
,
63 nautilus_window_info_signals
[TITLE_CHANGED
] =
64 g_signal_new ("title_changed",
65 NAUTILUS_TYPE_WINDOW_INFO
,
67 G_STRUCT_OFFSET (NautilusWindowInfoIface
, title_changed
),
69 g_cclosure_marshal_VOID__STRING
,
73 nautilus_window_info_signals
[HIDDEN_FILES_MODE_CHANGED
] =
74 g_signal_new ("hidden_files_mode_changed",
75 NAUTILUS_TYPE_WINDOW_INFO
,
77 G_STRUCT_OFFSET (NautilusWindowInfoIface
, hidden_files_mode_changed
),
79 g_cclosure_marshal_VOID__VOID
,
87 nautilus_window_info_get_type (void)
89 static GType type
= 0;
92 const GTypeInfo info
= {
93 sizeof (NautilusWindowInfoIface
),
94 nautilus_window_info_base_init
,
104 type
= g_type_register_static (G_TYPE_INTERFACE
,
105 "NautilusWindowInfo",
107 g_type_interface_add_prerequisite (type
, G_TYPE_OBJECT
);
114 nautilus_window_info_report_load_underway (NautilusWindowInfo
*window
,
117 g_return_if_fail (NAUTILUS_IS_WINDOW_INFO (window
));
118 g_return_if_fail (NAUTILUS_IS_VIEW (view
));
120 (* NAUTILUS_WINDOW_INFO_GET_IFACE (window
)->report_load_underway
) (window
,
125 nautilus_window_info_report_load_complete (NautilusWindowInfo
*window
,
128 g_return_if_fail (NAUTILUS_IS_WINDOW_INFO (window
));
129 g_return_if_fail (NAUTILUS_IS_VIEW (view
));
131 (* NAUTILUS_WINDOW_INFO_GET_IFACE (window
)->report_load_complete
) (window
,
136 nautilus_window_info_report_view_failed (NautilusWindowInfo
*window
,
139 g_return_if_fail (NAUTILUS_IS_WINDOW_INFO (window
));
140 g_return_if_fail (NAUTILUS_IS_VIEW (view
));
142 (* NAUTILUS_WINDOW_INFO_GET_IFACE (window
)->report_view_failed
) (window
,
147 nautilus_window_info_report_selection_changed (NautilusWindowInfo
*window
)
149 g_return_if_fail (NAUTILUS_IS_WINDOW_INFO (window
));
151 (* NAUTILUS_WINDOW_INFO_GET_IFACE (window
)->report_selection_changed
) (window
);
155 nautilus_window_info_open_location (NautilusWindowInfo
*window
,
157 NautilusWindowOpenMode mode
,
158 NautilusWindowOpenFlags flags
,
161 g_return_if_fail (NAUTILUS_IS_WINDOW_INFO (window
));
163 (* NAUTILUS_WINDOW_INFO_GET_IFACE (window
)->open_location
) (window
,
171 nautilus_window_info_show_window (NautilusWindowInfo
*window
)
173 g_return_if_fail (NAUTILUS_IS_WINDOW_INFO (window
));
175 (* NAUTILUS_WINDOW_INFO_GET_IFACE (window
)->show_window
) (window
);
179 nautilus_window_info_close (NautilusWindowInfo
*window
)
181 g_return_if_fail (NAUTILUS_IS_WINDOW_INFO (window
));
183 (* NAUTILUS_WINDOW_INFO_GET_IFACE (window
)->close_window
) (window
);
187 nautilus_window_info_set_status (NautilusWindowInfo
*window
,
190 g_return_if_fail (NAUTILUS_IS_WINDOW_INFO (window
));
192 (* NAUTILUS_WINDOW_INFO_GET_IFACE (window
)->set_status
) (window
,
197 nautilus_window_info_get_window_type (NautilusWindowInfo
*window
)
199 g_return_val_if_fail (NAUTILUS_IS_WINDOW_INFO (window
), NAUTILUS_WINDOW_SPATIAL
);
201 return (* NAUTILUS_WINDOW_INFO_GET_IFACE (window
)->get_window_type
) (window
);
205 nautilus_window_info_get_title (NautilusWindowInfo
*window
)
207 g_return_val_if_fail (NAUTILUS_IS_WINDOW_INFO (window
), NULL
);
209 return (* NAUTILUS_WINDOW_INFO_GET_IFACE (window
)->get_title
) (window
);
213 nautilus_window_info_get_history (NautilusWindowInfo
*window
)
215 g_return_val_if_fail (NAUTILUS_IS_WINDOW_INFO (window
), NULL
);
217 return (* NAUTILUS_WINDOW_INFO_GET_IFACE (window
)->get_history
) (window
);
220 NautilusBookmarkList
*
221 nautilus_window_info_get_bookmark_list (NautilusWindowInfo
*window
)
223 g_return_val_if_fail (NAUTILUS_IS_WINDOW_INFO (window
), NULL
);
225 return (* NAUTILUS_WINDOW_INFO_GET_IFACE (window
)->get_bookmark_list
) (window
);
230 nautilus_window_info_get_current_location (NautilusWindowInfo
*window
)
232 g_return_val_if_fail (NAUTILUS_IS_WINDOW_INFO (window
), NULL
);
234 return (* NAUTILUS_WINDOW_INFO_GET_IFACE (window
)->get_current_location
) (window
);
238 nautilus_window_info_get_selection_count (NautilusWindowInfo
*window
)
240 g_return_val_if_fail (NAUTILUS_IS_WINDOW_INFO (window
), 0);
242 return (* NAUTILUS_WINDOW_INFO_GET_IFACE (window
)->get_selection_count
) (window
);
246 nautilus_window_info_get_selection (NautilusWindowInfo
*window
)
248 g_return_val_if_fail (NAUTILUS_IS_WINDOW_INFO (window
), NULL
);
250 return (* NAUTILUS_WINDOW_INFO_GET_IFACE (window
)->get_selection
) (window
);
253 NautilusWindowShowHiddenFilesMode
254 nautilus_window_info_get_hidden_files_mode (NautilusWindowInfo
*window
)
256 g_return_val_if_fail (NAUTILUS_IS_WINDOW_INFO (window
), NAUTILUS_WINDOW_SHOW_HIDDEN_FILES_DEFAULT
);
258 return (* NAUTILUS_WINDOW_INFO_GET_IFACE (window
)->get_hidden_files_mode
) (window
);
262 nautilus_window_info_set_hidden_files_mode (NautilusWindowInfo
*window
,
263 NautilusWindowShowHiddenFilesMode mode
)
265 g_return_if_fail (NAUTILUS_IS_WINDOW_INFO (window
));
267 (* NAUTILUS_WINDOW_INFO_GET_IFACE (window
)->set_hidden_files_mode
) (window
,
272 nautilus_window_info_get_ui_manager (NautilusWindowInfo
*window
)
274 g_return_val_if_fail (NAUTILUS_IS_WINDOW_INFO (window
), NULL
);
276 return (* NAUTILUS_WINDOW_INFO_GET_IFACE (window
)->get_ui_manager
) (window
);