Commit 07cf7db4 authored by Christian Neumair's avatar Christian Neumair Committed by Christian Neumair

Merge "multiview" tab branch. Fixes #48034.

2008-07-08  Christian Neumair  <cneumair@gnome.org>

	* libnautilus-private/*.c:
	* src/*.c:
	Merge "multiview" tab branch. Fixes #48034.

svn path=/trunk/; revision=14328
parent dc8f0ba5
2008-07-08 Christian Neumair <cneumair@gnome.org>
* libnautilus-private/*.c:
* src/*.c:
Merge "multiview" tab branch. Fixes #48034.
2008-07-07 Christian Neumair <cneumair@gnome.org>
* libnautilus-private/nautilus-ui-utilities.c
......
......@@ -194,6 +194,8 @@ libnautilus_private_la_SOURCES = \
nautilus-view.h \
nautilus-window-info.c \
nautilus-window-info.h \
nautilus-window-slot-info.c \
nautilus-window-slot-info.h \
$(NULL)
BEAGLE_SOURCES = \
......
......@@ -68,6 +68,36 @@
</locale>
</schema>
<schema>
<key>/schemas/desktop/gnome/file_views/tabs_enable</key>
<applyto>/desktop/gnome/file_views/tabs_enable</applyto>
<owner>nautilus</owner>
<type>bool</type>
<default>true</default>
<locale name="C">
<short>Whether to enable tabs in Nautilus browser windows</short>
<long>
If set to true, then multiple views can be opened in one browser window,
each in a separate tab.
</long>
</locale>
</schema>
<schema>
<key>/schemas/desktop/gnome/file_views/tabs_open_position</key>
<applyto>/desktop/gnome/file_views/tabs_open_position</applyto>
<owner>nautilus</owner>
<type>string</type>
<default>after_current_tab</default>
<locale name="C">
<short>Where to position newly open tabs in browser windows.</short>
<long>
If set to "after_current_tab", then new tabs are inserted after the current tab.
If set to "end", then new tabs are appended to the end of the tab list.
</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/nautilus/preferences/media_automount</key>
<applyto>/apps/nautilus/preferences/media_automount</applyto>
......
......@@ -171,6 +171,11 @@ static EelEnumerationEntry date_format_entries[] = {
{ "informal", "Informal", NAUTILUS_DATE_FORMAT_INFORMAL }
};
static EelEnumerationEntry new_tab_position_entries[] = {
{ "after_current_tab", "After Current Tab", NAUTILUS_NEW_TAB_POSITION_AFTER_CURRENT_TAB },
{ "end", "End", NAUTILUS_NEW_TAB_POSITION_END }
};
/*
* A callback which can be used to fetch dynamic fallback values.
* For example, values that are dependent on the environment (such as user name)
......@@ -333,6 +338,16 @@ static const PreferenceDefault preference_defaults[] = {
PREFERENCE_BOOLEAN,
GINT_TO_POINTER (FALSE)
},
{ NAUTILUS_PREFERENCES_ENABLE_TABS,
PREFERENCE_BOOLEAN,
GINT_TO_POINTER (TRUE)
},
{ NAUTILUS_PREFERENCES_NEW_TAB_POSITION,
PREFERENCE_STRING,
"after_current_tab",
NULL, NULL,
"new_tab_position"
},
{ NAUTILUS_PREFERENCES_START_WITH_TOOLBAR,
PREFERENCE_BOOLEAN,
GINT_TO_POINTER (TRUE)
......@@ -604,6 +619,9 @@ global_preferences_register_enumerations (void)
eel_enumeration_register ("date_format",
date_format_entries,
G_N_ELEMENTS (date_format_entries));
eel_enumeration_register ("new_tab_position",
new_tab_position_entries,
G_N_ELEMENTS (new_tab_position_entries));
/* Set the enumeration ids for preferences that need them */
for (i = 0; preference_defaults[i].name != NULL; i++) {
......
......@@ -78,6 +78,12 @@ typedef enum
NAUTILUS_DATE_FORMAT_INFORMAL
} NautilusDateFormat;
typedef enum
{
NAUTILUS_NEW_TAB_POSITION_AFTER_CURRENT_TAB,
NAUTILUS_NEW_TAB_POSITION_END,
} NautilusNewTabPosition;
/* Sidebar panels */
#define NAUTILUS_PREFERENCES_TREE_SHOW_ONLY_DIRECTORIES "sidebar_panels/tree/show_only_directories"
......@@ -89,6 +95,8 @@ typedef enum
/* Spatial or browser mode */
#define NAUTILUS_PREFERENCES_ALWAYS_USE_BROWSER "preferences/always_use_browser"
#define NAUTILUS_PREFERENCES_ENABLE_TABS "preferences/tabs_enable"
#define NAUTILUS_PREFERENCES_NEW_TAB_POSITION "preferences/tabs_open_position"
/* Which views should be displayed for new windows */
#define NAUTILUS_PREFERENCES_START_WITH_LOCATION_BAR "preferences/start_with_location_bar"
......
......@@ -3365,7 +3365,8 @@ keyboard_space (NautilusIconContainer *container,
keyboard_move_to (container,
container->details->keyboard_focus,
NULL, NULL);
} else if ((event->state & GDK_CONTROL_MASK) != 0) {
} else if ((event->state & GDK_CONTROL_MASK) != 0 &&
(event->state & GDK_SHIFT_MASK) == 0) {
/* Control-space toggles the selection state of the current icon. */
if (container->details->keyboard_focus != NULL) {
icon_toggle_selected (container, container->details->keyboard_focus);
......
......@@ -1660,7 +1660,7 @@ drag_drop_callback (GtkWidget *widget,
get_data_on_first_target_we_support (widget, context, time, x, y);
return FALSE;
return TRUE;
}
void
......
......@@ -59,7 +59,8 @@ typedef struct {
} ApplicationLaunchParameters;
typedef struct {
NautilusWindowInfo *window_info;
NautilusWindowSlotInfo *slot_info;
gpointer window_info;
GtkWindow *parent_window;
GCancellable *cancellable;
GList *files;
......@@ -72,6 +73,7 @@ typedef struct {
NautilusFileListHandle *files_handle;
gboolean tried_mounting;
char *activation_directory;
gboolean user_confirmation;
} ActivateParameters;
/* Number of seconds until cancel dialog shows up */
......@@ -910,8 +912,8 @@ activation_parameters_free (ActivateParameters *parameters)
eel_timed_wait_stop (cancel_activate_callback, parameters);
}
if (parameters->window_info) {
g_object_remove_weak_pointer (G_OBJECT (parameters->window_info), (gpointer *)&parameters->window_info);
if (parameters->slot_info) {
g_object_remove_weak_pointer (G_OBJECT (parameters->slot_info), (gpointer *)&parameters->slot_info);
}
if (parameters->parent_window) {
g_object_remove_weak_pointer (G_OBJECT (parameters->parent_window), (gpointer *)&parameters->parent_window);
......@@ -972,7 +974,9 @@ activate_mount_op_active (EelMountOperation *operation,
}
static gboolean
confirm_multiple_windows (GtkWindow *parent_window, int count)
confirm_multiple_windows (GtkWindow *parent_window,
int count,
gboolean use_tabs)
{
GtkDialog *dialog;
char *prompt;
......@@ -984,8 +988,13 @@ confirm_multiple_windows (GtkWindow *parent_window, int count)
}
prompt = _("Are you sure you want to open all files?");
detail = g_strdup_printf (ngettext("This will open %d separate window.",
"This will open %d separate windows.", count), count);
if (use_tabs) {
detail = g_strdup_printf (ngettext("This will open %d separate tab.",
"This will open %d separate tabs.", count), count);
} else {
detail = g_strdup_printf (ngettext("This will open %d separate window.",
"This will open %d separate windows.", count), count);
}
dialog = eel_show_yes_no_dialog (prompt, detail,
GTK_STOCK_OK, GTK_STOCK_CANCEL,
parent_window);
......@@ -1000,6 +1009,8 @@ confirm_multiple_windows (GtkWindow *parent_window, int count)
static void
activate_files (ActivateParameters *parameters)
{
NautilusWindowInfo *window_info;
NautilusWindowOpenFlags flags;
NautilusFile *file;
GList *launch_desktop_files;
GList *launch_files;
......@@ -1133,14 +1144,33 @@ activate_files (ActivateParameters *parameters)
open_in_view_files = g_list_reverse (open_in_view_files);
count = g_list_length (open_in_view_files);
if (parameters->window_info != NULL &&
confirm_multiple_windows (parameters->parent_window, count)) {
NautilusWindowOpenFlags flags;
flags = parameters->flags;
if (count > 1) {
flags = parameters->flags;
if (count > 1) {
if (eel_preferences_get_boolean (NAUTILUS_PREFERENCES_ENABLE_TABS) &&
(parameters->flags & NAUTILUS_WINDOW_OPEN_FLAG_NEW_WINDOW) == 0) {
flags |= NAUTILUS_WINDOW_OPEN_FLAG_NEW_TAB;
} else {
flags |= NAUTILUS_WINDOW_OPEN_FLAG_NEW_WINDOW;
}
}
if (parameters->slot_info != NULL &&
(!parameters->user_confirmation ||
confirm_multiple_windows (parameters->parent_window, count,
(flags & NAUTILUS_WINDOW_OPEN_FLAG_NEW_TAB) != 0))) {
if ((flags & NAUTILUS_WINDOW_OPEN_FLAG_NEW_TAB) != 0 &&
eel_preferences_get_enum (NAUTILUS_PREFERENCES_NEW_TAB_POSITION) ==
NAUTILUS_NEW_TAB_POSITION_AFTER_CURRENT_TAB) {
/* When inserting N tabs after the current one,
* we first open tab N, then tab N-1, ..., then tab 0.
* Each of them is appended to the current tab, i.e.
* prepended to the list of tabs to open.
*/
open_in_view_files = g_list_reverse (open_in_view_files);
}
for (l = open_in_view_files; l != NULL; l = l->next) {
GFile *f;
......@@ -1150,8 +1180,8 @@ activate_files (ActivateParameters *parameters)
uri = nautilus_file_get_activation_uri (file);
f = g_file_new_for_uri (uri);
nautilus_window_info_open_location (parameters->window_info,
f, parameters->mode, flags, NULL);
nautilus_window_slot_info_open_location (parameters->slot_info,
f, parameters->mode, flags, NULL);
g_object_unref (f);
g_free (uri);
}
......@@ -1207,12 +1237,17 @@ activate_files (ActivateParameters *parameters)
g_free (error_message);
}
window_info = NULL;
if (parameters->slot_info != NULL) {
window_info = nautilus_window_slot_info_get_window (parameters->slot_info);
}
if (open_in_app_parameters != NULL ||
unhandled_open_in_app_files != NULL) {
if ((parameters->flags & NAUTILUS_WINDOW_OPEN_FLAG_CLOSE_BEHIND) != 0 &&
parameters->window_info != NULL &&
nautilus_window_info_get_window_type (parameters->window_info) == NAUTILUS_WINDOW_SPATIAL) {
nautilus_window_info_close (parameters->window_info);
window_info != NULL &&
nautilus_window_info_get_window_type (window_info) == NAUTILUS_WINDOW_SPATIAL) {
nautilus_window_info_close (window_info);
}
}
......@@ -1460,6 +1495,7 @@ activation_mountable_mounted (NautilusFile *file,
{
ActivateParameters *parameters = callback_data;
NautilusFile *target_file;
int position;
/* Remove from list of files that have to be mounted */
parameters->mountables = g_list_remove (parameters->mountables, file);
......@@ -1467,13 +1503,16 @@ activation_mountable_mounted (NautilusFile *file,
if (error == NULL) {
/* Replace file with the result of the mount */
target_file = nautilus_file_get (result_location);
position = g_list_index (parameters->files, file);
parameters->files = g_list_remove (parameters->files, file);
nautilus_file_unref (file);
parameters->files = g_list_prepend (parameters->files, target_file);
parameters->files = g_list_insert (parameters->files,
target_file,
position);
} else {
/* Remove failed file */
......@@ -1537,11 +1576,12 @@ activation_mount_mountables (ActivateParameters *parameters)
**/
void
nautilus_mime_activate_files (GtkWindow *parent_window,
NautilusWindowInfo *window_info,
NautilusWindowSlotInfo *slot_info,
GList *files,
const char *launch_directory,
NautilusWindowOpenMode mode,
NautilusWindowOpenFlags flags)
NautilusWindowOpenFlags flags,
gboolean user_confirmation)
{
ActivateParameters *parameters;
char *file_name;
......@@ -1558,8 +1598,8 @@ nautilus_mime_activate_files (GtkWindow *parent_window,
parent_window);
parameters = g_new0 (ActivateParameters, 1);
parameters->window_info = window_info;
g_object_add_weak_pointer (G_OBJECT (parameters->window_info), (gpointer *)&parameters->window_info);
parameters->slot_info = slot_info;
g_object_add_weak_pointer (G_OBJECT (parameters->slot_info), (gpointer *)&parameters->slot_info);
if (parent_window) {
parameters->parent_window = parent_window;
g_object_add_weak_pointer (G_OBJECT (parameters->parent_window), (gpointer *)&parameters->parent_window);
......@@ -1569,6 +1609,7 @@ nautilus_mime_activate_files (GtkWindow *parent_window,
parameters->files = nautilus_file_list_copy (files);
parameters->mode = mode;
parameters->flags = flags;
parameters->user_confirmation = user_confirmation;
file_count = g_list_length (files);
if (file_count == 1) {
......@@ -1610,7 +1651,7 @@ nautilus_mime_activate_files (GtkWindow *parent_window,
void
nautilus_mime_activate_file (GtkWindow *parent_window,
NautilusWindowInfo *window_info,
NautilusWindowSlotInfo *slot_info,
NautilusFile *file,
const char *launch_directory,
NautilusWindowOpenMode mode,
......@@ -1621,6 +1662,6 @@ nautilus_mime_activate_file (GtkWindow *parent_window,
g_return_if_fail (NAUTILUS_IS_FILE (file));
files = g_list_prepend (NULL, file);
nautilus_mime_activate_files (parent_window, window_info, files, launch_directory, mode, flags);
nautilus_mime_activate_files (parent_window, slot_info, files, launch_directory, mode, flags, FALSE);
g_list_free (files);
}
......@@ -29,6 +29,7 @@
#include <libnautilus-private/nautilus-file.h>
#include <libnautilus-private/nautilus-window-info.h>
#include <libnautilus-private/nautilus-window-slot-info.h>
NautilusFileAttributes nautilus_mime_actions_get_required_file_attributes (void);
......@@ -44,13 +45,14 @@ gboolean nautilus_mime_has_any_applications_for_files (GList
gboolean nautilus_mime_file_opens_in_view (NautilusFile *file);
gboolean nautilus_mime_file_opens_in_external_app (NautilusFile *file);
void nautilus_mime_activate_files (GtkWindow *parent_window,
NautilusWindowInfo *window_info,
NautilusWindowSlotInfo *slot_info,
GList *files,
const char *launch_directory,
NautilusWindowOpenMode mode,
NautilusWindowOpenFlags flags);
NautilusWindowOpenFlags flags,
gboolean user_confirmation);
void nautilus_mime_activate_file (GtkWindow *parent_window,
NautilusWindowInfo *window_info,
NautilusWindowSlotInfo *slot_info,
NautilusFile *file,
const char *launch_directory,
NautilusWindowOpenMode mode,
......
......@@ -57,7 +57,7 @@ nautilus_view_factory_lookup (const char *id)
NautilusView *
nautilus_view_factory_create (const char *id,
NautilusWindowInfo *window)
NautilusWindowSlotInfo *slot)
{
const NautilusViewInfo *view_info;
......@@ -66,7 +66,7 @@ nautilus_view_factory_create (const char *id,
return NULL;
}
return view_info->create (window);
return view_info->create (slot);
}
gboolean
......
......@@ -28,7 +28,7 @@
#include <string.h>
#include <libnautilus-private/nautilus-view.h>
#include <libnautilus-private/nautilus-window-info.h>
#include <libnautilus-private/nautilus-window-slot-info.h>
#include <gio/gio.h>
G_BEGIN_DECLS
......@@ -42,7 +42,7 @@ struct _NautilusViewInfo {
char *error_label; /* The foo view encountered an error. */
char *startup_error_label; /* The foo view encountered an error while starting up. */
char *display_location_label; /* Display this location with the foo view. */
NautilusView * (*create) (NautilusWindowInfo *window);
NautilusView * (*create) (NautilusWindowSlotInfo *slot);
/* BONOBOTODO: More args here */
gboolean (*supports_uri) (const char *uri,
GFileType file_type,
......@@ -53,7 +53,7 @@ struct _NautilusViewInfo {
void nautilus_view_factory_register (NautilusViewInfo *view_info);
const NautilusViewInfo *nautilus_view_factory_lookup (const char *id);
NautilusView * nautilus_view_factory_create (const char *id,
NautilusWindowInfo *window);
NautilusWindowSlotInfo *slot);
gboolean nautilus_view_factory_view_supports_uri (const char *id,
GFile *location,
GFileType file_type,
......
......@@ -278,3 +278,17 @@ nautilus_view_pop_up_location_context_menu (NautilusView *view,
(* NAUTILUS_VIEW_GET_IFACE (view)->pop_up_location_context_menu) (view, event, location);
}
}
void
nautilus_view_drop_proxy_received_uris (NautilusView *view,
GList *uris,
const char *target_location,
GdkDragAction action)
{
g_return_if_fail (NAUTILUS_IS_VIEW (view));
if (NAUTILUS_VIEW_GET_IFACE (view)->drop_proxy_received_uris != NULL) {
(* NAUTILUS_VIEW_GET_IFACE (view)->drop_proxy_received_uris) (view, uris, target_location, action);
}
}
......@@ -123,6 +123,11 @@ struct _NautilusViewIface
GdkEventButton *event,
const char *location);
void (* drop_proxy_received_uris) (NautilusView *view,
GList *uris,
const char *target_location,
GdkDragAction action);
/* Padding for future expansion */
void (*_reserved1) (void);
void (*_reserved2) (void);
......@@ -162,6 +167,10 @@ void nautilus_view_pop_up_location_context_menu (NautilusView *v
GdkEventButton *event,
const char *location);
void nautilus_view_grab_focus (NautilusView *view);
void nautilus_view_drop_proxy_received_uris (NautilusView *view,
GList *uris,
const char *target_location,
GdkDragAction action);
G_END_DECLS
......
......@@ -151,22 +151,6 @@ nautilus_window_info_report_selection_changed (NautilusWindowInfo *window)
(* NAUTILUS_WINDOW_INFO_GET_IFACE (window)->report_selection_changed) (window);
}
void
nautilus_window_info_open_location (NautilusWindowInfo *window,
GFile *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)
{
......@@ -184,13 +168,13 @@ nautilus_window_info_close (NautilusWindowInfo *window)
}
void
nautilus_window_info_set_status (NautilusWindowInfo *window,
const char *status)
nautilus_window_info_push_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);
(* NAUTILUS_WINDOW_INFO_GET_IFACE (window)->push_status) (window,
status);
}
NautilusWindowType
......@@ -276,3 +260,11 @@ nautilus_window_info_get_ui_manager (NautilusWindowInfo *window)
return (* NAUTILUS_WINDOW_INFO_GET_IFACE (window)->get_ui_manager) (window);
}
NautilusWindowSlotInfo *
nautilus_window_info_get_active_slot (NautilusWindowInfo *window)
{
g_return_val_if_fail (NAUTILUS_IS_WINDOW_INFO (window), NULL);
return (* NAUTILUS_WINDOW_INFO_GET_IFACE (window)->get_active_slot) (window);
}
......@@ -50,7 +50,8 @@ typedef enum {
/* used in spatial mode */
NAUTILUS_WINDOW_OPEN_FLAG_CLOSE_BEHIND = 1<<0,
/* used in navigation mode */
NAUTILUS_WINDOW_OPEN_FLAG_NEW_WINDOW = 1<<1
NAUTILUS_WINDOW_OPEN_FLAG_NEW_WINDOW = 1<<1,
NAUTILUS_WINDOW_OPEN_FLAG_NEW_TAB = 1<<2
} NautilusWindowOpenFlags;
typedef enum {
......@@ -71,6 +72,13 @@ typedef enum {
typedef struct NautilusWindow NautilusWindow;
#endif
#ifndef NAUTILUS_WINDOW_SLOT_DEFINED
#define NAUTILUS_WINDOW_SLOT_DEFINED
typedef struct NautilusWindowSlot NautilusWindowSlot;
#endif
typedef NautilusWindowSlot NautilusWindowSlotInfo;
typedef NautilusWindow NautilusWindowInfo;
typedef struct _NautilusWindowInfoIface NautilusWindowInfoIface;
......@@ -115,7 +123,7 @@ struct _NautilusWindowInfoIface
GList *(* get_selection) (NautilusWindowInfo *window);
char * (* get_current_location) (NautilusWindowInfo *window);
void (* set_status) (NautilusWindowInfo *window,
void (* push_status) (NautilusWindowInfo *window,
const char *status);
char * (* get_title) (NautilusWindowInfo *window);
GList *(* get_history) (NautilusWindowInfo *window);
......@@ -128,11 +136,8 @@ struct _NautilusWindowInfoIface
void (* set_hidden_files_mode) (NautilusWindowInfo *window,
NautilusWindowShowHiddenFilesMode mode);
void (* open_location) (NautilusWindowInfo *window,
GFile *location,
NautilusWindowOpenMode mode,
NautilusWindowOpenFlags flags,
GList *selection);
NautilusWindowSlotInfo * (* get_active_slot) (NautilusWindowInfo *window);
void (* show_window) (NautilusWindowInfo *window);
void (* close_window) (NautilusWindowInfo *window);
GtkUIManager * (* get_ui_manager) (NautilusWindowInfo *window);
......@@ -146,14 +151,10 @@ void nautilus_window_info_report_load_complete
void nautilus_window_info_report_view_failed (NautilusWindowInfo *window,
NautilusView *view);
void nautilus_window_info_report_selection_changed (NautilusWindowInfo *window);
void nautilus_window_info_open_location (NautilusWindowInfo *window,
GFile *location,
NautilusWindowOpenMode mode,
NautilusWindowOpenFlags flags,
GList *selection);
NautilusWindowSlotInfo * nautilus_window_info_get_active_slot (NautilusWindowInfo *window);
void nautilus_window_info_show_window (NautilusWindowInfo *window);
void nautilus_window_info_close (NautilusWindowInfo *window);
void nautilus_window_info_set_status (NautilusWindowInfo *window,
void nautilus_window_info_push_status (NautilusWindowInfo *window,
const char *status);
NautilusWindowType nautilus_window_info_get_window_type (NautilusWindowInfo *window);
char * nautilus_window_info_get_title (NautilusWindowInfo *window);
......
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*-
nautilus-window-slot-info.c: Interface for nautilus window slots
Copyright (C) 2008 Free Software Foundation, 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: Christian Neumair <cneumair@gnome.org>
*/
#include "nautilus-window-slot-info.h"
enum {
ACTIVE,
INACTIVE,
LAST_SIGNAL
};
static guint nautilus_window_slot_info_signals[LAST_SIGNAL] = { 0 };
static void
nautilus_window_slot_info_base_init (gpointer g_class)
{
static gboolean initialized = FALSE;
if (!initialized) {
nautilus_window_slot_info_signals[ACTIVE] =
g_signal_new ("active",
NAUTILUS_TYPE_WINDOW_SLOT_INFO,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (NautilusWindowSlotInfoIface, active),
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
nautilus_window_slot_info_signals[INACTIVE] =
g_signal_new ("inactive",
NAUTILUS_TYPE_WINDOW_SLOT_INFO,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (NautilusWindowSlotInfoIface, inactive),
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
initialized = TRUE;
}
}
GType
nautilus_window_slot_info_get_type (void)
{
static GType type = 0;
if (!type) {
const GTypeInfo info = {
sizeof (NautilusWindowSlotInfoIface),
nautilus_window_slot_info_base_init,
NULL,
NULL,
NULL,
NULL,
0,
0,
NULL
};
type = g_type_register_static (G_TYPE_INTERFACE,
"NautilusWindowSlotInfo",
&info, 0);
g_type_interface_add_prerequisite (type, G_TYPE_OBJECT);
}
return type;
}
void
nautilus_window_slot_info_set_status (NautilusWindowSlotInfo *slot,
const char *status)
{
g_assert (NAUTILUS_IS_WINDOW_SLOT_INFO (slot));
(* NAUTILUS_WINDOW_SLOT_INFO_GET_IFACE (slot)->set_status) (slot,
status);
}
void
nautilus_window_slot_info_open_location (NautilusWindowSlotInfo *slot,
GFile *location,
NautilusWindowOpenMode mode,
NautilusWindowOpenFlags flags,
GList *selection)
{
g_assert (NAUTILUS_IS_WINDOW_SLOT_INFO (slot));
(* NAUTILUS_WINDOW_SLOT_INFO_GET_IFACE (slot)->open_location) (slot,
location,
mode,
flags,
selection);
}
char *
nautilus_window_slot_info_get_title (NautilusWindowSlotInfo *slot)
{
g_assert (NAUTILUS_IS_WINDOW_SLOT_INFO (slot));
return (* NAUTILUS_WINDOW_SLOT_INFO_GET_IFACE (slot)->get_title) (slot);
}
char *
nautilus_window_slot_info_get_current_location (NautilusWindowSlotInfo *slot)
{