Commit 690909b8 authored by Cosimo Cecchi's avatar Cosimo Cecchi

Rename FMListModel/View -> NautilusListModel/View

And move them outside of src/file-manager
parent 757a5acf
......@@ -88,6 +88,11 @@ nautilus_SOURCES = \
nautilus-icon-view-container.h \
nautilus-image-properties-page.c \
nautilus-image-properties-page.h \
nautilus-list-model.c \
nautilus-list-model.h \
nautilus-list-view-private.h \
nautilus-list-view.c \
nautilus-list-view.h \
nautilus-location-bar.c \
nautilus-location-bar.h \
nautilus-location-dialog.c \
......
......@@ -18,11 +18,6 @@ INCLUDES = \
libnautilus_file_manager_la_SOURCES= \
fm-ditem-page.c \
fm-ditem-page.h \
fm-list-model.c \
fm-list-model.h \
fm-list-view-private.h \
fm-list-view.c \
fm-list-view.h \
fm-properties-window.c \
fm-properties-window.h \
$(NULL)
......
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* fm-list-model.h - a GtkTreeModel for file lists.
Copyright (C) 2001, 2002 Anders Carlsson
The Gnome Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The Gnome Library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the Gnome Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Authors: Anders Carlsson <andersca@gnu.org>
*/
#include <gtk/gtk.h>
#include <gdk/gdk.h>
#include <libnautilus-private/nautilus-file.h>
#include <libnautilus-private/nautilus-directory.h>
#include <libnautilus-extension/nautilus-column.h>
#ifndef FM_LIST_MODEL_H
#define FM_LIST_MODEL_H
#define FM_TYPE_LIST_MODEL fm_list_model_get_type()
#define FM_LIST_MODEL(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), FM_TYPE_LIST_MODEL, FMListModel))
#define FM_LIST_MODEL_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST ((klass), FM_TYPE_LIST_MODEL, FMListModelClass))
#define FM_IS_LIST_MODEL(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), FM_TYPE_LIST_MODEL))
#define FM_IS_LIST_MODEL_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), FM_TYPE_LIST_MODEL))
#define FM_LIST_MODEL_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), FM_TYPE_LIST_MODEL, FMListModelClass))
enum {
FM_LIST_MODEL_FILE_COLUMN,
FM_LIST_MODEL_SUBDIRECTORY_COLUMN,
FM_LIST_MODEL_SMALLEST_ICON_COLUMN,
FM_LIST_MODEL_SMALLER_ICON_COLUMN,
FM_LIST_MODEL_SMALL_ICON_COLUMN,
FM_LIST_MODEL_STANDARD_ICON_COLUMN,
FM_LIST_MODEL_LARGE_ICON_COLUMN,
FM_LIST_MODEL_LARGER_ICON_COLUMN,
FM_LIST_MODEL_LARGEST_ICON_COLUMN,
FM_LIST_MODEL_FILE_NAME_IS_EDITABLE_COLUMN,
FM_LIST_MODEL_NUM_COLUMNS
};
typedef struct FMListModelDetails FMListModelDetails;
typedef struct FMListModel {
GObject parent_instance;
FMListModelDetails *details;
} FMListModel;
typedef struct {
GObjectClass parent_class;
void (* subdirectory_unloaded)(FMListModel *model,
NautilusDirectory *subdirectory);
} FMListModelClass;
GType fm_list_model_get_type (void);
gboolean fm_list_model_add_file (FMListModel *model,
NautilusFile *file,
NautilusDirectory *directory);
void fm_list_model_file_changed (FMListModel *model,
NautilusFile *file,
NautilusDirectory *directory);
gboolean fm_list_model_is_empty (FMListModel *model);
guint fm_list_model_get_length (FMListModel *model);
void fm_list_model_remove_file (FMListModel *model,
NautilusFile *file,
NautilusDirectory *directory);
void fm_list_model_clear (FMListModel *model);
gboolean fm_list_model_get_tree_iter_from_file (FMListModel *model,
NautilusFile *file,
NautilusDirectory *directory,
GtkTreeIter *iter);
GList * fm_list_model_get_all_iters_for_file (FMListModel *model,
NautilusFile *file);
gboolean fm_list_model_get_first_iter_for_file (FMListModel *model,
NautilusFile *file,
GtkTreeIter *iter);
void fm_list_model_set_should_sort_directories_first (FMListModel *model,
gboolean sort_directories_first);
int fm_list_model_get_sort_column_id_from_attribute (FMListModel *model,
GQuark attribute);
GQuark fm_list_model_get_attribute_from_sort_column_id (FMListModel *model,
int sort_column_id);
void fm_list_model_sort_files (FMListModel *model,
GList **files);
NautilusZoomLevel fm_list_model_get_zoom_level_from_column_id (int column);
int fm_list_model_get_column_id_from_zoom_level (NautilusZoomLevel zoom_level);
NautilusFile * fm_list_model_file_for_path (FMListModel *model, GtkTreePath *path);
gboolean fm_list_model_load_subdirectory (FMListModel *model, GtkTreePath *path, NautilusDirectory **directory);
void fm_list_model_unload_subdirectory (FMListModel *model, GtkTreeIter *iter);
void fm_list_model_set_drag_view (FMListModel *model,
GtkTreeView *view,
int begin_x,
int begin_y);
GtkTargetList * fm_list_model_get_drag_target_list (void);
int fm_list_model_compare_func (FMListModel *model,
NautilusFile *file1,
NautilusFile *file2);
int fm_list_model_add_column (FMListModel *model,
NautilusColumn *column);
int fm_list_model_get_column_number (FMListModel *model,
const char *column_name);
void fm_list_model_subdirectory_done_loading (FMListModel *model,
NautilusDirectory *directory);
void fm_list_model_set_highlight_for_files (FMListModel *model,
GList *files);
#endif /* FM_LIST_MODEL_H */
......@@ -30,7 +30,6 @@
#include "nautilus-application.h"
#include "file-manager/fm-list-view.h"
#if ENABLE_EMPTY_VIEW
#include "file-manager/fm-empty-view.h"
#endif /* ENABLE_EMPTY_VIEW */
......@@ -39,6 +38,7 @@
#include "nautilus-desktop-window.h"
#include "nautilus-icon-view.h"
#include "nautilus-image-properties-page.h"
#include "nautilus-list-view.h"
#include "nautilus-navigation-window.h"
#include "nautilus-navigation-window-slot.h"
#include "nautilus-self-check-functions.h"
......@@ -1533,7 +1533,7 @@ nautilus_application_startup (GApplication *app)
/* register views */
nautilus_icon_view_register ();
nautilus_desktop_icon_view_register ();
fm_list_view_register ();
nautilus_list_view_register ();
nautilus_icon_view_compact_register ();
#if ENABLE_EMPTY_VIEW
fm_empty_view_register ();
......
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* fm-list-model.h - a GtkTreeModel for file lists.
Copyright (C) 2001, 2002 Anders Carlsson
The Gnome Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The Gnome Library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the Gnome Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Authors: Anders Carlsson <andersca@gnu.org>
*/
#include <gtk/gtk.h>
#include <gdk/gdk.h>
#include <libnautilus-private/nautilus-file.h>
#include <libnautilus-private/nautilus-directory.h>
#include <libnautilus-extension/nautilus-column.h>
#ifndef NAUTILUS_LIST_MODEL_H
#define NAUTILUS_LIST_MODEL_H
#define NAUTILUS_TYPE_LIST_MODEL nautilus_list_model_get_type()
#define NAUTILUS_LIST_MODEL(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), NAUTILUS_TYPE_LIST_MODEL, NautilusListModel))
#define NAUTILUS_LIST_MODEL_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_LIST_MODEL, NautilusListModelClass))
#define NAUTILUS_IS_LIST_MODEL(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), NAUTILUS_TYPE_LIST_MODEL))
#define NAUTILUS_IS_LIST_MODEL_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_LIST_MODEL))
#define NAUTILUS_LIST_MODEL_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), NAUTILUS_TYPE_LIST_MODEL, NautilusListModelClass))
enum {
NAUTILUS_LIST_MODEL_FILE_COLUMN,
NAUTILUS_LIST_MODEL_SUBDIRECTORY_COLUMN,
NAUTILUS_LIST_MODEL_SMALLEST_ICON_COLUMN,
NAUTILUS_LIST_MODEL_SMALLER_ICON_COLUMN,
NAUTILUS_LIST_MODEL_SMALL_ICON_COLUMN,
NAUTILUS_LIST_MODEL_STANDARD_ICON_COLUMN,
NAUTILUS_LIST_MODEL_LARGE_ICON_COLUMN,
NAUTILUS_LIST_MODEL_LARGER_ICON_COLUMN,
NAUTILUS_LIST_MODEL_LARGEST_ICON_COLUMN,
NAUTILUS_LIST_MODEL_FILE_NAME_IS_EDITABLE_COLUMN,
NAUTILUS_LIST_MODEL_NUM_COLUMNS
};
typedef struct NautilusListModelDetails NautilusListModelDetails;
typedef struct NautilusListModel {
GObject parent_instance;
NautilusListModelDetails *details;
} NautilusListModel;
typedef struct {
GObjectClass parent_class;
void (* subdirectory_unloaded)(NautilusListModel *model,
NautilusDirectory *subdirectory);
} NautilusListModelClass;
GType nautilus_list_model_get_type (void);
gboolean nautilus_list_model_add_file (NautilusListModel *model,
NautilusFile *file,
NautilusDirectory *directory);
void nautilus_list_model_file_changed (NautilusListModel *model,
NautilusFile *file,
NautilusDirectory *directory);
gboolean nautilus_list_model_is_empty (NautilusListModel *model);
guint nautilus_list_model_get_length (NautilusListModel *model);
void nautilus_list_model_remove_file (NautilusListModel *model,
NautilusFile *file,
NautilusDirectory *directory);
void nautilus_list_model_clear (NautilusListModel *model);
gboolean nautilus_list_model_get_tree_iter_from_file (NautilusListModel *model,
NautilusFile *file,
NautilusDirectory *directory,
GtkTreeIter *iter);
GList * nautilus_list_model_get_all_iters_for_file (NautilusListModel *model,
NautilusFile *file);
gboolean nautilus_list_model_get_first_iter_for_file (NautilusListModel *model,
NautilusFile *file,
GtkTreeIter *iter);
void nautilus_list_model_set_should_sort_directories_first (NautilusListModel *model,
gboolean sort_directories_first);
int nautilus_list_model_get_sort_column_id_from_attribute (NautilusListModel *model,
GQuark attribute);
GQuark nautilus_list_model_get_attribute_from_sort_column_id (NautilusListModel *model,
int sort_column_id);
void nautilus_list_model_sort_files (NautilusListModel *model,
GList **files);
NautilusZoomLevel nautilus_list_model_get_zoom_level_from_column_id (int column);
int nautilus_list_model_get_column_id_from_zoom_level (NautilusZoomLevel zoom_level);
NautilusFile * nautilus_list_model_file_for_path (NautilusListModel *model, GtkTreePath *path);
gboolean nautilus_list_model_load_subdirectory (NautilusListModel *model, GtkTreePath *path, NautilusDirectory **directory);
void nautilus_list_model_unload_subdirectory (NautilusListModel *model, GtkTreeIter *iter);
void nautilus_list_model_set_drag_view (NautilusListModel *model,
GtkTreeView *view,
int begin_x,
int begin_y);
GtkTargetList * nautilus_list_model_get_drag_target_list (void);
int nautilus_list_model_compare_func (NautilusListModel *model,
NautilusFile *file1,
NautilusFile *file2);
int nautilus_list_model_add_column (NautilusListModel *model,
NautilusColumn *column);
int nautilus_list_model_get_column_number (NautilusListModel *model,
const char *column_name);
void nautilus_list_model_subdirectory_done_loading (NautilusListModel *model,
NautilusDirectory *directory);
void nautilus_list_model_set_highlight_for_files (NautilusListModel *model,
GList *files);
#endif /* NAUTILUS_LIST_MODEL_H */
......@@ -24,38 +24,38 @@
Anders Carlsson <andersca@gnu.org>
*/
#ifndef FM_LIST_VIEW_H
#define FM_LIST_VIEW_H
#ifndef NAUTILUS_LIST_VIEW_H
#define NAUTILUS_LIST_VIEW_H
#include "nautilus-view.h"
#define FM_TYPE_LIST_VIEW fm_list_view_get_type()
#define FM_LIST_VIEW(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), FM_TYPE_LIST_VIEW, FMListView))
#define FM_LIST_VIEW_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST ((klass), FM_TYPE_LIST_VIEW, FMListViewClass))
#define FM_IS_LIST_VIEW(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), FM_TYPE_LIST_VIEW))
#define FM_IS_LIST_VIEW_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), FM_TYPE_LIST_VIEW))
#define FM_LIST_VIEW_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), FM_TYPE_LIST_VIEW, FMListViewClass))
#define NAUTILUS_TYPE_LIST_VIEW nautilus_list_view_get_type()
#define NAUTILUS_LIST_VIEW(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), NAUTILUS_TYPE_LIST_VIEW, NautilusListView))
#define NAUTILUS_LIST_VIEW_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_LIST_VIEW, NautilusListViewClass))
#define NAUTILUS_IS_LIST_VIEW(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), NAUTILUS_TYPE_LIST_VIEW))
#define NAUTILUS_IS_LIST_VIEW_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_LIST_VIEW))
#define NAUTILUS_LIST_VIEW_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), NAUTILUS_TYPE_LIST_VIEW, NautilusListViewClass))
#define FM_LIST_VIEW_ID "OAFIID:Nautilus_File_Manager_List_View"
#define NAUTILUS_LIST_VIEW_ID "OAFIID:Nautilus_File_Manager_List_View"
typedef struct FMListViewDetails FMListViewDetails;
typedef struct NautilusListViewDetails NautilusListViewDetails;
typedef struct {
NautilusView parent_instance;
FMListViewDetails *details;
} FMListView;
NautilusListViewDetails *details;
} NautilusListView;
typedef struct {
NautilusViewClass parent_class;
} FMListViewClass;
} NautilusListViewClass;
GType fm_list_view_get_type (void);
void fm_list_view_register (void);
GtkTreeView* fm_list_view_get_tree_view (FMListView *list_view);
GType nautilus_list_view_get_type (void);
void nautilus_list_view_register (void);
GtkTreeView* nautilus_list_view_get_tree_view (NautilusListView *list_view);
#endif /* FM_LIST_VIEW_H */
#endif /* NAUTILUS_LIST_VIEW_H */
......@@ -31,12 +31,12 @@
#include "nautilus-view.h"
#include "file-manager/fm-list-view.h"
#include "file-manager/fm-properties-window.h"
#include "nautilus-actions.h"
#include "nautilus-desktop-icon-view.h"
#include "nautilus-error-reporting.h"
#include "nautilus-list-view.h"
#include "nautilus-mime-actions.h"
#include "nautilus-src-marshal.h"
......@@ -1827,7 +1827,7 @@ rename_file (NautilusView *view, NautilusFile *new_file)
to load the slow mimetype for the file, which leads to a
file_changed. So, before we delay we select the row.
*/
if (FM_IS_LIST_VIEW (view)) {
if (NAUTILUS_IS_LIST_VIEW (view)) {
nautilus_view_select_file (view, new_file);
data = g_new (RenameData, 1);
......@@ -3016,7 +3016,7 @@ done_loading (NautilusView *view,
nautilus_view_call_set_selection (view, selection);
view->details->selection_change_is_due_to_shell = FALSE;
if (FM_IS_LIST_VIEW (view)) {
if (NAUTILUS_IS_LIST_VIEW (view)) {
/* HACK: We should be able to directly call reveal_selection here,
* but at this point the GtkTreeView hasn't allocated the new nodes
* yet, and it has a bug in the scroll calculation dealing with this
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment