[nautilus/menial-but-very-rewarding-work-that-made-my-fingers-numb: 6/7] general: Clean up headers and their inclusions
- From: Carlos Soriano <csoriano src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/menial-but-very-rewarding-work-that-made-my-fingers-numb: 6/7] general: Clean up headers and their inclusions
- Date: Fri, 18 May 2018 14:41:06 +0000 (UTC)
commit e686c29779ec8505da6e2550763d369f2c829890
Author: Ernestas Kulik <ernestask gnome org>
Date: Fri May 18 14:24:11 2018 +0300
general: Clean up headers and their inclusions
This commit removes redundant header inclusions and tries to optimize
headers by using forward declarations of types in headers. Such
optimization should generally make builds speedier in that changes in
certain headers will not cause unrelated sources to be rebuilt.
src/meson.build | 7 +--
src/nautilus-application.c | 60 ++++++++++-----------
src/nautilus-application.h | 5 +-
src/nautilus-canvas-container.c | 24 ++++-----
src/nautilus-canvas-container.h | 12 +++--
src/nautilus-canvas-view-container.c | 11 ++--
src/nautilus-canvas-view-container.h | 2 -
src/nautilus-canvas-view.h | 5 +-
src/nautilus-directory-async.c | 17 +++---
src/nautilus-directory-notify.h | 5 +-
src/nautilus-directory-private.h | 8 ++-
src/nautilus-directory.c | 23 ++++----
src/nautilus-directory.h | 10 ++--
src/nautilus-enums.h | 84 ++++++++++++++++++++++++++++++
src/nautilus-file-attributes.h | 37 -------------
src/nautilus-file.c | 65 ++++++++++++-----------
src/nautilus-file.h | 4 +-
src/nautilus-files-view.c | 81 ++++++++++++++--------------
src/nautilus-freedesktop-dbus.c | 7 ++-
src/nautilus-icon-info.c | 5 +-
src/nautilus-icon-info.h | 32 ------------
src/nautilus-keyfile-metadata.h | 4 +-
src/nautilus-list-view.c | 37 ++++++-------
src/nautilus-mime-actions.c | 23 ++++----
src/nautilus-mime-actions.h | 5 +-
src/nautilus-other-locations-window-slot.c | 3 ++
src/nautilus-other-locations-window-slot.h | 5 +-
src/nautilus-places-view.c | 8 ++-
src/nautilus-places-view.h | 4 +-
src/nautilus-properties-window.c | 27 ++++------
src/nautilus-query-editor.c | 16 +++---
src/nautilus-query.c | 9 ++--
src/nautilus-recent.c | 3 +-
src/nautilus-recent.h | 6 +--
src/nautilus-search-directory-file.c | 13 ++---
src/nautilus-search-directory.c | 22 ++++----
src/nautilus-search-directory.h | 5 +-
src/nautilus-toolbar.c | 30 +++++------
src/nautilus-trash-monitor.c | 6 ---
src/nautilus-types.h | 48 +++++++++++++++++
src/nautilus-window-slot.c | 5 +-
src/nautilus-window-slot.h | 8 +--
src/nautilus-window.c | 46 ++++++++--------
src/nautilus-window.h | 21 ++------
44 files changed, 444 insertions(+), 414 deletions(-)
---
diff --git a/src/meson.build b/src/meson.build
index 16ec5fd53..a947a05f2 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -165,7 +165,6 @@ libnautilus_sources = [
'nautilus-directory.h',
'nautilus-dnd.c',
'nautilus-dnd.h',
- 'nautilus-file-attributes.h',
'nautilus-file-changes-queue.c',
'nautilus-file-changes-queue.h',
'nautilus-file-conflict-dialog.c',
@@ -261,7 +260,9 @@ libnautilus_sources = [
'nautilus-tag-manager.c',
'nautilus-tag-manager.h',
'nautilus-starred-directory.c',
- 'nautilus-starred-directory.h'
+ 'nautilus-starred-directory.h',
+ 'nautilus-enums.h',
+ 'nautilus-types.h'
]
nautilus_deps = [
@@ -333,4 +334,4 @@ executable(
gtk
],
install: true
-)
\ No newline at end of file
+)
diff --git a/src/nautilus-application.c b/src/nautilus-application.c
index f38340e24..9f0542288 100644
--- a/src/nautilus-application.c
+++ b/src/nautilus-application.c
@@ -24,47 +24,47 @@
*
*/
-#include <config.h>
-
#include "nautilus-application.h"
-#include "nautilus-dbus-manager.h"
-#include "nautilus-file-undo-manager.h"
-#include "nautilus-freedesktop-dbus.h"
-#include "nautilus-previewer.h"
-#include "nautilus-progress-persistence-handler.h"
-#include "nautilus-self-check-functions.h"
-#include "nautilus-shell-search-provider.h"
-#include "nautilus-window.h"
-#include "nautilus-window-slot.h"
-#include "nautilus-preferences-window.h"
-#include "nautilus-tag-manager.h"
+#include <eel/eel-gtk-extensions.h>
+#include <eel/eel-stock-dialogs.h>
+#include <fcntl.h>
+#include <gdk/gdkx.h>
+#include <gio/gio.h>
+#include <glib/gi18n.h>
+#include <glib/gstdio.h>
+#include <gtk/gtk.h>
+#include <nautilus-extension.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#define DEBUG_FLAG NAUTILUS_DEBUG_APPLICATION
+#include "nautilus-debug.h"
+
+#include "nautilus-bookmark-list.h"
+#include "nautilus-dbus-manager.h"
#include "nautilus-directory-private.h"
-#include "nautilus-file-utilities.h"
+#include "nautilus-file.h"
#include "nautilus-file-operations.h"
+#include "nautilus-file-undo-manager.h"
+#include "nautilus-file-utilities.h"
+#include "nautilus-freedesktop-dbus.h"
#include "nautilus-global-preferences.h"
+#include "nautilus-icon-info.h"
#include "nautilus-lib-self-check-functions.h"
#include "nautilus-module.h"
+#include "nautilus-preferences-window.h"
+#include "nautilus-previewer.h"
#include "nautilus-profile.h"
+#include "nautilus-progress-persistence-handler.h"
+#include "nautilus-self-check-functions.h"
+#include "nautilus-shell-search-provider.h"
#include "nautilus-signaller.h"
+#include "nautilus-tag-manager.h"
#include "nautilus-ui-utilities.h"
-
-#include <nautilus-extension.h>
-
-#define DEBUG_FLAG NAUTILUS_DEBUG_APPLICATION
-#include "nautilus-debug.h"
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <glib/gstdio.h>
-#include <glib/gi18n.h>
-#include <gio/gio.h>
-#include <eel/eel-gtk-extensions.h>
-#include <eel/eel-stock-dialogs.h>
-#include <gdk/gdkx.h>
-#include <gtk/gtk.h>
+#include "nautilus-view.h"
+#include "nautilus-window-slot.h"
+#include "nautilus-window.h"
typedef struct
{
diff --git a/src/nautilus-application.h b/src/nautilus-application.h
index 0f0a2391c..946c3eee1 100644
--- a/src/nautilus-application.h
+++ b/src/nautilus-application.h
@@ -24,8 +24,7 @@
#include <gio/gio.h>
#include <gtk/gtk.h>
-#include "nautilus-bookmark-list.h"
-#include "nautilus-window.h"
+#include "nautilus-types.h"
G_BEGIN_DECLS
#define NAUTILUS_TYPE_APPLICATION (nautilus_application_get_type())
@@ -88,4 +87,4 @@ void nautilus_application_search (NautilusApplication *application,
const gchar *uri,
const gchar *text);
void nautilus_application_startup_common (NautilusApplication *application);
-G_END_DECLS
\ No newline at end of file
+G_END_DECLS
diff --git a/src/nautilus-canvas-container.c b/src/nautilus-canvas-container.c
index 56a0d984a..3cb4b9b07 100644
--- a/src/nautilus-canvas-container.c
+++ b/src/nautilus-canvas-container.c
@@ -22,32 +22,32 @@
* Darin Adler <darin bentspoon com>
*/
-#include <config.h>
-#include <X11/Xlib.h>
-#include <X11/Xatom.h>
-#include <math.h>
#include "nautilus-canvas-container.h"
-#include "nautilus-global-preferences.h"
-#include "nautilus-canvas-private.h"
-#include "nautilus-lib-self-check-functions.h"
-#include "nautilus-selection-canvas-item.h"
#include <atk/atkaction.h>
#include <eel/eel-accessibility.h>
-#include <eel/eel-vfs-extensions.h>
-#include <eel/eel-gtk-extensions.h>
#include <eel/eel-art-extensions.h>
-
+#include <eel/eel-gtk-extensions.h>
+#include <eel/eel-vfs-extensions.h>
#include <gdk/gdkkeysyms.h>
-#include <gtk/gtk.h>
#include <gdk/gdkx.h>
#include <glib/gi18n.h>
+#include <gtk/gtk.h>
+#include <math.h>
#include <stdio.h>
#include <string.h>
+#include <X11/Xlib.h>
+#include <X11/Xatom.h>
#define DEBUG_FLAG NAUTILUS_DEBUG_CANVAS_CONTAINER
#include "nautilus-debug.h"
+#include "nautilus-canvas-private.h"
+#include "nautilus-global-preferences.h"
+#include "nautilus-icon-info.h"
+#include "nautilus-lib-self-check-functions.h"
+#include "nautilus-selection-canvas-item.h"
+
/* Interval for updating the rubberband selection, in milliseconds. */
#define RUBBERBAND_TIMEOUT_INTERVAL 10
diff --git a/src/nautilus-canvas-container.h b/src/nautilus-canvas-container.h
index d27de7186..a370bba26 100644
--- a/src/nautilus-canvas-container.h
+++ b/src/nautilus-canvas-container.h
@@ -24,7 +24,8 @@
#pragma once
#include <eel/eel-canvas.h>
-#include "nautilus-icon-info.h"
+
+#include "nautilus-types.h"
#define NAUTILUS_TYPE_CANVAS_CONTAINER nautilus_canvas_container_get_type()
#define NAUTILUS_CANVAS_CONTAINER(obj) \
@@ -55,12 +56,15 @@ typedef struct {
#define NAUTILUS_CANVAS_CONTAINER_TYPESELECT_FLUSH_DELAY 1000000
-typedef struct NautilusCanvasContainerDetails NautilusCanvasContainerDetails;
+typedef struct _NautilusCanvasContainer NautilusCanvasContainer;
+typedef struct NautilusCanvasContainerDetails NautilusCanvasContainerDetails;
-typedef struct {
+struct _NautilusCanvasContainer {
EelCanvas canvas;
NautilusCanvasContainerDetails *details;
-} NautilusCanvasContainer;
+};
+
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (NautilusCanvasContainer, g_object_unref)
typedef struct {
EelCanvasClass parent_slot;
diff --git a/src/nautilus-canvas-view-container.c b/src/nautilus-canvas-view-container.c
index 9b7063be2..a8b1f8ad6 100644
--- a/src/nautilus-canvas-view-container.c
+++ b/src/nautilus-canvas-view-container.c
@@ -18,16 +18,17 @@
*
* Author: Michael Meeks <michael ximian com>
*/
-#include <config.h>
#include "nautilus-canvas-view-container.h"
-#include <string.h>
-#include <glib/gi18n.h>
-#include <gio/gio.h>
#include <eel/eel-glib-extensions.h>
+#include <gio/gio.h>
+#include <glib/gi18n.h>
+#include <string.h>
+
+#include "nautilus-canvas-view.h"
+#include "nautilus-enums.h"
#include "nautilus-global-preferences.h"
-#include "nautilus-file-attributes.h"
#include "nautilus-thumbnails.h"
struct _NautilusCanvasViewContainer
diff --git a/src/nautilus-canvas-view-container.h b/src/nautilus-canvas-view-container.h
index 5c431531c..b0e103181 100644
--- a/src/nautilus-canvas-view-container.h
+++ b/src/nautilus-canvas-view-container.h
@@ -22,8 +22,6 @@
#pragma once
-#include "nautilus-canvas-view.h"
-
#include "nautilus-canvas-container.h"
#define NAUTILUS_TYPE_CANVAS_VIEW_CONTAINER nautilus_canvas_view_container_get_type()
diff --git a/src/nautilus-canvas-view.h b/src/nautilus-canvas-view.h
index 390d565da..4e8f1ac8b 100644
--- a/src/nautilus-canvas-view.h
+++ b/src/nautilus-canvas-view.h
@@ -25,7 +25,8 @@
#pragma once
#include "nautilus-files-view.h"
-#include "nautilus-canvas-container.h"
+
+#include "nautilus-types.h"
G_BEGIN_DECLS
@@ -41,4 +42,4 @@ NautilusFilesView * nautilus_canvas_view_new (NautilusWindowSlot *slot);
NautilusCanvasContainer * nautilus_canvas_view_get_canvas_container (NautilusCanvasView *view);
-G_END_DECLS
\ No newline at end of file
+G_END_DECLS
diff --git a/src/nautilus-directory-async.c b/src/nautilus-directory-async.c
index c3d236cf4..e18ca4026 100644
--- a/src/nautilus-directory-async.c
+++ b/src/nautilus-directory-async.c
@@ -19,25 +19,22 @@
* Author: Darin Adler <darin bentspoon com>
*/
-#include <config.h>
+#include <libxml/parser.h>
+#include <stdio.h>
+#include <stdlib.h>
#define DEBUG_FLAG NAUTILUS_DEBUG_ASYNC_JOBS
#include "nautilus-debug.h"
#include "nautilus-directory-notify.h"
#include "nautilus-directory-private.h"
-#include "nautilus-file-attributes.h"
+#include "nautilus-enums.h"
#include "nautilus-file-private.h"
-#include "nautilus-file-utilities.h"
-#include "nautilus-signaller.h"
+#include "nautilus-file-queue.h"
#include "nautilus-global-preferences.h"
-#include "nautilus-profile.h"
#include "nautilus-metadata.h"
-#include <eel/eel-glib-extensions.h>
-#include <gtk/gtk.h>
-#include <libxml/parser.h>
-#include <stdio.h>
-#include <stdlib.h>
+#include "nautilus-profile.h"
+#include "nautilus-signaller.h"
/* turn this on to check if async. job calls are balanced */
#if 0
diff --git a/src/nautilus-directory-notify.h b/src/nautilus-directory-notify.h
index 48a559a60..4b5030dcf 100644
--- a/src/nautilus-directory-notify.h
+++ b/src/nautilus-directory-notify.h
@@ -21,8 +21,9 @@
#pragma once
-#include <gdk/gdk.h>
-#include "nautilus-file.h"
+#include <gio/gio.h>
+
+#include "nautilus-types.h"
typedef struct {
char *from_uri;
diff --git a/src/nautilus-directory-private.h b/src/nautilus-directory-private.h
index fca16f4fc..54d3f0465 100644
--- a/src/nautilus-directory-private.h
+++ b/src/nautilus-directory-private.h
@@ -21,14 +21,12 @@
#pragma once
-#include <gio/gio.h>
#include <eel/eel-vfs-extensions.h>
+#include <gio/gio.h>
+#include <nautilus-extension.h>
+
#include "nautilus-directory.h"
-#include "nautilus-file-queue.h"
#include "nautilus-file.h"
-#include "nautilus-monitor.h"
-#include <nautilus-extension.h>
-#include <libxml/tree.h>
typedef struct FileMonitors FileMonitors;
typedef struct DirectoryLoadState DirectoryLoadState;
diff --git a/src/nautilus-directory.c b/src/nautilus-directory.c
index 959371fea..56750365c 100644
--- a/src/nautilus-directory.c
+++ b/src/nautilus-directory.c
@@ -19,26 +19,28 @@
* Author: Darin Adler <darin bentspoon com>
*/
-#include <config.h>
#include "nautilus-directory-private.h"
+#include <eel/eel-glib-extensions.h>
+#include <eel/eel-string.h>
+#include <glib/gi18n.h>
+#include <gtk/gtk.h>
+
#include "nautilus-directory-notify.h"
-#include "nautilus-file-attributes.h"
+#include "nautilus-directory-private.h"
+#include "nautilus-enums.h"
#include "nautilus-file-private.h"
+#include "nautilus-file-queue.h"
#include "nautilus-file-utilities.h"
-#include "nautilus-search-directory.h"
-#include "nautilus-starred-directory.h"
-#include "nautilus-search-directory-file.h"
-#include "nautilus-vfs-file.h"
#include "nautilus-global-preferences.h"
#include "nautilus-lib-self-check-functions.h"
#include "nautilus-metadata.h"
#include "nautilus-profile.h"
+#include "nautilus-search-directory-file.h"
+#include "nautilus-search-directory.h"
+#include "nautilus-starred-directory.h"
#include "nautilus-vfs-directory.h"
-#include <eel/eel-glib-extensions.h>
-#include <eel/eel-string.h>
-#include <glib/gi18n.h>
-#include <gtk/gtk.h>
+#include "nautilus-vfs-file.h"
enum
{
@@ -1958,7 +1960,6 @@ nautilus_directory_list_sort_by_uri (GList *list)
#if !defined (NAUTILUS_OMIT_SELF_CHECK)
#include <eel/eel-debug.h>
-#include "nautilus-file-attributes.h"
static int data_dummy;
static gboolean got_files_flag;
diff --git a/src/nautilus-directory.h b/src/nautilus-directory.h
index 9f41945d0..b9220c8e2 100644
--- a/src/nautilus-directory.h
+++ b/src/nautilus-directory.h
@@ -23,7 +23,8 @@
#include <gtk/gtk.h>
#include <gio/gio.h>
-#include "nautilus-file-attributes.h"
+
+#include "nautilus-enums.h"
/* NautilusDirectory is a class that manages the model for a directory,
real or virtual, for Nautilus, mainly the file-manager component. The directory is
@@ -57,13 +58,14 @@
typedef struct NautilusFile NautilusFile;
#endif
-typedef struct NautilusDirectoryDetails NautilusDirectoryDetails;
+typedef struct _NautilusDirectory NautilusDirectory;
+typedef struct NautilusDirectoryDetails NautilusDirectoryDetails;
-typedef struct
+struct _NautilusDirectory
{
GObject object;
NautilusDirectoryDetails *details;
-} NautilusDirectory;
+};
typedef void (*NautilusDirectoryCallback) (NautilusDirectory *directory,
GList *files,
diff --git a/src/nautilus-enums.h b/src/nautilus-enums.h
new file mode 100644
index 000000000..62c268330
--- /dev/null
+++ b/src/nautilus-enums.h
@@ -0,0 +1,84 @@
+/* Copyright (C) 2018 Ernestas Kulik <ernestask gnome org>
+ *
+ * This file is part of Nautilus.
+ *
+ * Nautilus 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Nautilus 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 Nautilus. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+/* This is the little brother of nautilus-types.h and only contains enumerations.
+ *
+ * Now that you’ve familiarized yourself with it, the reason for its existence
+ * is similar, and the split is purely for convenience reasons. Include this
+ * when you only need a certain enumeration and not the whole header that might
+ * have had it originally. Otherwise, include both!
+ */
+
+#pragma once
+
+/* Keep sorted alphabetically. */
+
+typedef enum
+{
+ NAUTILUS_CANVAS_ICON_SIZE_SMALL = 48,
+ NAUTILUS_CANVAS_ICON_SIZE_STANDARD = 64,
+ NAUTILUS_CANVAS_ICON_SIZE_LARGE = 96,
+ NAUTILUS_CANVAS_ICON_SIZE_LARGER = 128,
+ NAUTILUS_CANVAS_ICON_SIZE_LARGEST = 256,
+} NautilusCanvasIconSize;
+
+typedef enum
+{
+ NAUTILUS_CANVAS_ZOOM_LEVEL_SMALL,
+ NAUTILUS_CANVAS_ZOOM_LEVEL_STANDARD,
+ NAUTILUS_CANVAS_ZOOM_LEVEL_LARGE,
+ NAUTILUS_CANVAS_ZOOM_LEVEL_LARGER,
+ NAUTILUS_CANVAS_ZOOM_LEVEL_LARGEST,
+} NautilusCanvasZoomLevel;
+
+typedef enum
+{
+ NAUTILUS_LIST_ICON_SIZE_SMALL = 16,
+ NAUTILUS_LIST_ICON_SIZE_STANDARD = 32,
+ NAUTILUS_LIST_ICON_SIZE_LARGE = 48,
+ NAUTILUS_LIST_ICON_SIZE_LARGER = 64,
+} NautilusListIconSize;
+
+typedef enum
+{
+ NAUTILUS_LIST_ZOOM_LEVEL_SMALL,
+ NAUTILUS_LIST_ZOOM_LEVEL_STANDARD,
+ NAUTILUS_LIST_ZOOM_LEVEL_LARGE,
+ NAUTILUS_LIST_ZOOM_LEVEL_LARGER,
+} NautilusListZoomLevel;
+
+typedef enum
+{
+ NAUTILUS_FILE_ATTRIBUTE_INFO = 1 << 0, /* All standard info */
+ NAUTILUS_FILE_ATTRIBUTE_DEEP_COUNTS = 1 << 1,
+ NAUTILUS_FILE_ATTRIBUTE_DIRECTORY_ITEM_COUNT = 1 << 2,
+ NAUTILUS_FILE_ATTRIBUTE_DIRECTORY_ITEM_MIME_TYPES = 1 << 3,
+ NAUTILUS_FILE_ATTRIBUTE_EXTENSION_INFO = 1 << 4,
+ NAUTILUS_FILE_ATTRIBUTE_THUMBNAIL = 1 << 5,
+ NAUTILUS_FILE_ATTRIBUTE_MOUNT = 1 << 6,
+ NAUTILUS_FILE_ATTRIBUTE_FILESYSTEM_INFO = 1 << 7,
+} NautilusFileAttributes;
+
+typedef enum
+{
+ NAUTILUS_WINDOW_OPEN_FLAG_CLOSE_BEHIND = 1 << 0,
+ NAUTILUS_WINDOW_OPEN_FLAG_NEW_WINDOW = 1 << 1,
+ NAUTILUS_WINDOW_OPEN_FLAG_NEW_TAB = 1 << 2,
+ NAUTILUS_WINDOW_OPEN_SLOT_APPEND = 1 << 3,
+ NAUTILUS_WINDOW_OPEN_FLAG_DONT_MAKE_ACTIVE = 1 << 4
+} NautilusWindowOpenFlags;
diff --git a/src/nautilus-file.c b/src/nautilus-file.c
index a735fc0f0..08ffc7291 100644
--- a/src/nautilus-file.c
+++ b/src/nautilus-file.c
@@ -19,56 +19,61 @@
* Author: Darin Adler <darin bentspoon com>
*/
-#include <config.h>
#include "nautilus-file.h"
-#include "nautilus-directory-notify.h"
-#include "nautilus-directory-private.h"
-#include "nautilus-signaller.h"
-#include "nautilus-file-attributes.h"
-#include "nautilus-file-private.h"
-#include "nautilus-file-operations.h"
-#include "nautilus-file-utilities.h"
-#include "nautilus-global-preferences.h"
-#include "nautilus-lib-self-check-functions.h"
-#include "nautilus-metadata.h"
-#include "nautilus-module.h"
-#include "nautilus-thumbnails.h"
-#include "nautilus-ui-utilities.h"
-#include "nautilus-video-mime-types.h"
-#include "nautilus-vfs-file.h"
-#include "nautilus-file-undo-operations.h"
-#include "nautilus-file-undo-manager.h"
-#include "nautilus-tag-manager.h"
+#ifndef NAUTILUS_COMPILATION
+#define NAUTILUS_COMPILATION
+#endif
+#include <libnautilus-extension/nautilus-extension-private.h>
+
#include <eel/eel-debug.h>
#include <eel/eel-glib-extensions.h>
#include <eel/eel-gtk-extensions.h>
-#include <eel/eel-vfs-extensions.h>
#include <eel/eel-string.h>
-#include <grp.h>
-#include <gtk/gtk.h>
-#include <glib/gi18n.h>
-#include <glib/gstdio.h>
+#include <eel/eel-vfs-extensions.h>
+#include <gdesktop-enums.h>
#include <gio/gio.h>
#include <glib.h>
+#include <glib/gi18n.h>
+#include <glib/gstdio.h>
#include <gnome-autoar/gnome-autoar.h>
-#include <gdesktop-enums.h>
+#include <grp.h>
+#include <gtk/gtk.h>
#include <libxml/parser.h>
-#include <libnautilus-extension/nautilus-extension-private.h>
#include <pwd.h>
#include <stdlib.h>
+#include <sys/stat.h>
#include <sys/time.h>
#include <time.h>
#include <unistd.h>
-#include <sys/stat.h>
+
+#define DEBUG_FLAG NAUTILUS_DEBUG_FILE
+#include "nautilus-debug.h"
+
+#include "nautilus-directory-notify.h"
+#include "nautilus-directory-private.h"
+#include "nautilus-enums.h"
+#include "nautilus-file-operations.h"
+#include "nautilus-file-private.h"
+#include "nautilus-file-undo-manager.h"
+#include "nautilus-file-undo-operations.h"
+#include "nautilus-file-utilities.h"
+#include "nautilus-global-preferences.h"
+#include "nautilus-icon-info.h"
+#include "nautilus-lib-self-check-functions.h"
+#include "nautilus-metadata.h"
+#include "nautilus-module.h"
+#include "nautilus-signaller.h"
+#include "nautilus-tag-manager.h"
+#include "nautilus-thumbnails.h"
+#include "nautilus-ui-utilities.h"
+#include "nautilus-vfs-file.h"
+#include "nautilus-video-mime-types.h"
#ifdef HAVE_SELINUX
#include <selinux/selinux.h>
#endif
-#define DEBUG_FLAG NAUTILUS_DEBUG_FILE
-#include "nautilus-debug.h"
-
/* Time in seconds to cache getpwuid results */
#define GETPWUID_CACHE_TIME (5 * 60)
diff --git a/src/nautilus-file.h b/src/nautilus-file.h
index 0e22efd0e..3d803214f 100644
--- a/src/nautilus-file.h
+++ b/src/nautilus-file.h
@@ -23,8 +23,8 @@
#include <gtk/gtk.h>
#include <gio/gio.h>
-#include "nautilus-file-attributes.h"
-#include "nautilus-icon-info.h"
+
+#include "nautilus-types.h"
/* NautilusFile is an object used to represent a single element of a
* NautilusDirectory. It's lightweight and relies on NautilusDirectory
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
index 9f6eabde7..76ccfeb8d 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -23,73 +23,70 @@
* David Emory Watson <dwatson cs ucr edu>
*/
-#include <config.h>
-
#include "nautilus-files-view.h"
-#include "nautilus-application.h"
-#include "nautilus-batch-rename-dialog.h"
-#include "nautilus-batch-rename-utilities.h"
-#include "nautilus-error-reporting.h"
-#include "nautilus-file-undo-manager.h"
-#include "nautilus-floating-bar.h"
-#include "nautilus-view-icon-controller.h"
-#include "nautilus-list-view.h"
-#include "nautilus-canvas-view.h"
-#include "nautilus-mime-actions.h"
-#include "nautilus-previewer.h"
-#include "nautilus-properties-window.h"
-#include "nautilus-window.h"
-#include "nautilus-toolbar.h"
-#include "nautilus-view.h"
-#include "nautilus-tag-manager.h"
-#include <gdk/gdkx.h>
+#include <eel/eel-glib-extensions.h>
+#include <eel/eel-gtk-extensions.h>
+#include <eel/eel-stock-dialogs.h>
+#include <eel/eel-string.h>
+#include <eel/eel-vfs-extensions.h>
+#include <fcntl.h>
+#include <gdesktop-enums.h>
#include <gdk/gdkkeysyms.h>
-#include <gtk/gtk.h>
+#include <gdk/gdkx.h>
+#include <gio/gio.h>
#include <glib/gi18n.h>
#include <glib/gstdio.h>
-#include <gio/gio.h>
+#include <gtk/gtk.h>
#include <gnome-autoar/gnome-autoar.h>
#include <math.h>
+#include <nautilus-extension.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
-#include <fcntl.h>
-#include <eel/eel-glib-extensions.h>
-#include <eel/eel-gtk-extensions.h>
-#include <eel/eel-stock-dialogs.h>
-#include <eel/eel-string.h>
-#include <eel/eel-vfs-extensions.h>
+#define DEBUG_FLAG NAUTILUS_DEBUG_DIRECTORY_VIEW
+#include "nautilus-debug.h"
-#include <nautilus-extension.h>
+#include "nautilus-application.h"
+#include "nautilus-batch-rename-dialog.h"
+#include "nautilus-batch-rename-utilities.h"
+#include "nautilus-canvas-view.h"
#include "nautilus-clipboard.h"
-#include "nautilus-search-directory.h"
+#include "nautilus-compress-dialog-controller.h"
#include "nautilus-directory.h"
#include "nautilus-dnd.h"
-#include "nautilus-file-attributes.h"
+#include "nautilus-enums.h"
+#include "nautilus-error-reporting.h"
#include "nautilus-file-changes-queue.h"
+#include "nautilus-file-name-widget-controller.h"
#include "nautilus-file-operations.h"
-#include "nautilus-file-utilities.h"
#include "nautilus-file-private.h"
-#include "nautilus-file-name-widget-controller.h"
-#include "nautilus-rename-file-popover-controller.h"
-#include "nautilus-new-folder-dialog-controller.h"
-#include "nautilus-compress-dialog-controller.h"
+#include "nautilus-file-undo-manager.h"
+#include "nautilus-file-utilities.h"
+#include "nautilus-floating-bar.h"
#include "nautilus-global-preferences.h"
+#include "nautilus-icon-info.h"
+#include "nautilus-icon-names.h"
+#include "nautilus-list-view.h"
#include "nautilus-metadata.h"
+#include "nautilus-mime-actions.h"
#include "nautilus-module.h"
+#include "nautilus-new-folder-dialog-controller.h"
+#include "nautilus-previewer.h"
#include "nautilus-profile.h"
#include "nautilus-program-choosing.h"
+#include "nautilus-properties-window.h"
+#include "nautilus-rename-file-popover-controller.h"
+#include "nautilus-search-directory.h"
+#include "nautilus-signaller.h"
+#include "nautilus-tag-manager.h"
+#include "nautilus-toolbar.h"
#include "nautilus-trash-monitor.h"
#include "nautilus-ui-utilities.h"
-#include "nautilus-signaller.h"
-#include "nautilus-icon-names.h"
-
-#include <gdesktop-enums.h>
-
-#define DEBUG_FLAG NAUTILUS_DEBUG_DIRECTORY_VIEW
-#include "nautilus-debug.h"
+#include "nautilus-view.h"
+#include "nautilus-view-icon-controller.h"
+#include "nautilus-window.h"
/* Minimum starting update inverval */
#define UPDATE_INTERVAL_MIN 100
diff --git a/src/nautilus-freedesktop-dbus.c b/src/nautilus-freedesktop-dbus.c
index 554b1bc3d..ac34662e3 100644
--- a/src/nautilus-freedesktop-dbus.c
+++ b/src/nautilus-freedesktop-dbus.c
@@ -18,16 +18,15 @@
* Federico Mena Quintero <federico gnome org>
*/
-#include <config.h>
-
-#include "nautilus-application.h"
#include "nautilus-freedesktop-dbus.h"
-#include "nautilus-freedesktop-generated.h"
/* We share the same debug domain as nautilus-dbus-manager */
#define DEBUG_FLAG NAUTILUS_DEBUG_DBUS
#include "nautilus-debug.h"
+#include "nautilus-application.h"
+#include "nautilus-file.h"
+#include "nautilus-freedesktop-generated.h"
#include "nautilus-properties-window.h"
#include <gio/gio.h>
diff --git a/src/nautilus-icon-info.c b/src/nautilus-icon-info.c
index 412eb0f32..5bd8b0119 100644
--- a/src/nautilus-icon-info.c
+++ b/src/nautilus-icon-info.c
@@ -15,10 +15,9 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
-#include <string.h>
#include "nautilus-icon-info.h"
-#include <gtk/gtk.h>
-#include <gio/gio.h>
+
+#include "nautilus-enums.h"
struct _NautilusIconInfo
{
diff --git a/src/nautilus-icon-info.h b/src/nautilus-icon-info.h
index e4f40ba67..506acecde 100644
--- a/src/nautilus-icon-info.h
+++ b/src/nautilus-icon-info.h
@@ -8,41 +8,9 @@
G_BEGIN_DECLS
-/* Names for Nautilus's different zoom levels, from tiniest items to largest items */
-typedef enum {
- NAUTILUS_CANVAS_ZOOM_LEVEL_SMALL,
- NAUTILUS_CANVAS_ZOOM_LEVEL_STANDARD,
- NAUTILUS_CANVAS_ZOOM_LEVEL_LARGE,
- NAUTILUS_CANVAS_ZOOM_LEVEL_LARGER,
- NAUTILUS_CANVAS_ZOOM_LEVEL_LARGEST,
-} NautilusCanvasZoomLevel;
-
-typedef enum {
- NAUTILUS_LIST_ZOOM_LEVEL_SMALL,
- NAUTILUS_LIST_ZOOM_LEVEL_STANDARD,
- NAUTILUS_LIST_ZOOM_LEVEL_LARGE,
- NAUTILUS_LIST_ZOOM_LEVEL_LARGER,
-} NautilusListZoomLevel;
-
#define NAUTILUS_LIST_ZOOM_LEVEL_N_ENTRIES (NAUTILUS_LIST_ZOOM_LEVEL_LARGER + 1)
#define NAUTILUS_CANVAS_ZOOM_LEVEL_N_ENTRIES (NAUTILUS_CANVAS_ZOOM_LEVEL_LARGEST + 1)
-/* Nominal icon sizes for each Nautilus zoom level.
- * This scheme assumes that icons are designed to
- * fit in a square space, though each image needn't
- * be square.
- */
-#define NAUTILUS_LIST_ICON_SIZE_SMALL 16
-#define NAUTILUS_LIST_ICON_SIZE_STANDARD 32
-#define NAUTILUS_LIST_ICON_SIZE_LARGE 48
-#define NAUTILUS_LIST_ICON_SIZE_LARGER 64
-
-#define NAUTILUS_CANVAS_ICON_SIZE_SMALL 48
-#define NAUTILUS_CANVAS_ICON_SIZE_STANDARD 64
-#define NAUTILUS_CANVAS_ICON_SIZE_LARGE 96
-#define NAUTILUS_CANVAS_ICON_SIZE_LARGER 128
-#define NAUTILUS_CANVAS_ICON_SIZE_LARGEST 256
-
/* Maximum size of an icon that the icon factory will ever produce */
#define NAUTILUS_ICON_MAXIMUM_SIZE 320
diff --git a/src/nautilus-keyfile-metadata.h b/src/nautilus-keyfile-metadata.h
index c09f132e2..9f471ca22 100644
--- a/src/nautilus-keyfile-metadata.h
+++ b/src/nautilus-keyfile-metadata.h
@@ -24,7 +24,7 @@
#include <glib.h>
-#include "nautilus-file.h"
+#include "nautilus-types.h"
void nautilus_keyfile_metadata_set_string (NautilusFile *file,
const char *keyfile_filename,
@@ -40,4 +40,4 @@ void nautilus_keyfile_metadata_set_stringv (NautilusFile *file,
gboolean nautilus_keyfile_metadata_update_from_keyfile (NautilusFile *file,
const char *keyfile_filename,
- const gchar *name);
\ No newline at end of file
+ const gchar *name);
diff --git a/src/nautilus-list-view.c b/src/nautilus-list-view.c
index 012bfd6b3..4e51dffb3 100644
--- a/src/nautilus-list-view.c
+++ b/src/nautilus-list-view.c
@@ -22,41 +22,38 @@
* David Emory Watson <dwatson cs ucr edu>
*/
-#include <config.h>
#include "nautilus-list-view.h"
#include "nautilus-list-view-private.h"
-#include "nautilus-list-model.h"
-#include "nautilus-error-reporting.h"
-#include "nautilus-files-view-dnd.h"
-#include "nautilus-toolbar.h"
-#include "nautilus-list-view-dnd.h"
-#include "nautilus-view.h"
-#include "nautilus-tag-manager.h"
-
-#include <string.h>
#include <eel/eel-vfs-extensions.h>
-#include <eel/eel-glib-extensions.h>
-#include <eel/eel-string.h>
#include <gdk/gdk.h>
#include <gdk/gdkkeysyms.h>
-#include <gtk/gtk.h>
#include <glib/gi18n.h>
-#include <glib-object.h>
+#include <gtk/gtk.h>
#include <libgd/gd.h>
+#include <string.h>
+
+#define DEBUG_FLAG NAUTILUS_DEBUG_LIST_VIEW
+#include "nautilus-debug.h"
+
+#include "nautilus-clipboard.h"
#include "nautilus-column-chooser.h"
#include "nautilus-column-utilities.h"
#include "nautilus-dnd.h"
+#include "nautilus-enums.h"
+#include "nautilus-error-reporting.h"
#include "nautilus-file-utilities.h"
-#include "nautilus-ui-utilities.h"
+#include "nautilus-files-view-dnd.h"
#include "nautilus-global-preferences.h"
+#include "nautilus-list-model.h"
+#include "nautilus-list-view-dnd.h"
#include "nautilus-metadata.h"
-#include "nautilus-module.h"
+#include "nautilus-search-directory.h"
+#include "nautilus-tag-manager.h"
+#include "nautilus-toolbar.h"
#include "nautilus-tree-view-drag-dest.h"
-#include "nautilus-clipboard.h"
-
-#define DEBUG_FLAG NAUTILUS_DEBUG_LIST_VIEW
-#include "nautilus-debug.h"
+#include "nautilus-ui-utilities.h"
+#include "nautilus-view.h"
struct SelectionForeachData
{
diff --git a/src/nautilus-mime-actions.c b/src/nautilus-mime-actions.c
index f83253e95..494d6dab2 100644
--- a/src/nautilus-mime-actions.c
+++ b/src/nautilus-mime-actions.c
@@ -19,36 +19,31 @@
* Authors: Maciej Stachowiak <mjs eazel com>
*/
-#include <config.h>
-
#include "nautilus-mime-actions.h"
-#include "nautilus-window-slot.h"
-#include "nautilus-application.h"
-
-#include <eel/eel-glib-extensions.h>
#include <eel/eel-stock-dialogs.h>
#include <eel/eel-string.h>
+#include <gdk/gdkx.h>
#include <glib.h>
#include <glib/gi18n.h>
#include <glib/gstdio.h>
#include <string.h>
-#include <gdk/gdkx.h>
-#include "nautilus-file-attributes.h"
+#define DEBUG_FLAG NAUTILUS_DEBUG_MIME
+#include "nautilus-debug.h"
+
+#include "nautilus-application.h"
+#include "nautilus-enums.h"
#include "nautilus-file.h"
#include "nautilus-file-utilities.h"
#include "nautilus-file-operations.h"
+#include "nautilus-global-preferences.h"
#include "nautilus-metadata.h"
#include "nautilus-program-choosing.h"
-#include "nautilus-global-preferences.h"
#include "nautilus-signaller.h"
-#include "nautilus-metadata.h"
#include "nautilus-ui-utilities.h"
-
-
-#define DEBUG_FLAG NAUTILUS_DEBUG_MIME
-#include "nautilus-debug.h"
+#include "nautilus-window.h"
+#include "nautilus-window-slot.h"
typedef enum
{
diff --git a/src/nautilus-mime-actions.h b/src/nautilus-mime-actions.h
index 41016d86f..1725b8c1d 100644
--- a/src/nautilus-mime-actions.h
+++ b/src/nautilus-mime-actions.h
@@ -24,10 +24,9 @@
#include <gio/gio.h>
#include <glib/gi18n.h>
+#include <gtk/gtk.h>
-#include "nautilus-file.h"
-
-#include "nautilus-window.h"
+#include "nautilus-types.h"
NautilusFileAttributes nautilus_mime_actions_get_required_file_attributes (void);
diff --git a/src/nautilus-other-locations-window-slot.c b/src/nautilus-other-locations-window-slot.c
index f08e12a77..0c6bf2fdc 100644
--- a/src/nautilus-other-locations-window-slot.c
+++ b/src/nautilus-other-locations-window-slot.c
@@ -17,7 +17,10 @@
*/
#include "nautilus-other-locations-window-slot.h"
+
+#include "nautilus-file.h"
#include "nautilus-places-view.h"
+#include "nautilus-view.h"
struct _NautilusOtherLocationsWindowSlot
{
diff --git a/src/nautilus-other-locations-window-slot.h b/src/nautilus-other-locations-window-slot.h
index abd7dcfd6..70136d181 100644
--- a/src/nautilus-other-locations-window-slot.h
+++ b/src/nautilus-other-locations-window-slot.h
@@ -19,7 +19,8 @@
#pragma once
#include "nautilus-window-slot.h"
-#include "nautilus-window.h"
+
+#include "nautilus-types.h"
G_BEGIN_DECLS
@@ -29,4 +30,4 @@ G_DECLARE_FINAL_TYPE (NautilusOtherLocationsWindowSlot, nautilus_other_locations
NautilusOtherLocationsWindowSlot *nautilus_other_locations_window_slot_new (NautilusWindow *window);
-G_END_DECLS
\ No newline at end of file
+G_END_DECLS
diff --git a/src/nautilus-places-view.c b/src/nautilus-places-view.c
index 49ec23947..c1e8b397a 100644
--- a/src/nautilus-places-view.c
+++ b/src/nautilus-places-view.c
@@ -18,10 +18,14 @@
#include "nautilus-mime-actions.h"
#include "nautilus-places-view.h"
-#include "nautilus-window-slot.h"
+
+#include "gtk/nautilusgtkplacesviewprivate.h"
+
#include "nautilus-application.h"
+#include "nautilus-file.h"
#include "nautilus-toolbar-menu-sections.h"
-#include "gtk/nautilusgtkplacesviewprivate.h"
+#include "nautilus-view.h"
+#include "nautilus-window-slot.h"
typedef struct
{
diff --git a/src/nautilus-places-view.h b/src/nautilus-places-view.h
index fe7888611..e961d3995 100644
--- a/src/nautilus-places-view.h
+++ b/src/nautilus-places-view.h
@@ -18,11 +18,9 @@
#pragma once
-#include <glib.h>
+#include <glib-object.h>
#include <gtk/gtk.h>
-#include "nautilus-view.h"
-
G_BEGIN_DECLS
#define NAUTILUS_TYPE_PLACES_VIEW (nautilus_places_view_get_type())
diff --git a/src/nautilus-properties-window.c b/src/nautilus-properties-window.c
index 4b51f8bad..1d54dbaca 100644
--- a/src/nautilus-properties-window.c
+++ b/src/nautilus-properties-window.c
@@ -19,37 +19,32 @@
* Authors: Darin Adler <darin bentspoon com>
*/
-#include <config.h>
-
#include "nautilus-properties-window.h"
-#include "nautilus-ui-utilities.h"
-#include "nautilus-error-reporting.h"
-#include "nautilus-mime-actions.h"
-
+#include <cairo.h>
+#include <eel/eel-accessibility.h>
+#include <eel/eel-gtk-extensions.h>
+#include <eel/eel-stock-dialogs.h>
+#include <eel/eel-string.h>
+#include <eel/eel-vfs-extensions.h>
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
#include <glib/gi18n.h>
+#include <nautilus-extension.h>
#include <string.h>
#include <sys/stat.h>
-#include <cairo.h>
#define GNOME_DESKTOP_USE_UNSTABLE_API
#include <libgnome-desktop/gnome-desktop-thumbnail.h>
-#include <eel/eel-accessibility.h>
-#include <eel/eel-glib-extensions.h>
-#include <eel/eel-gtk-extensions.h>
-#include <eel/eel-stock-dialogs.h>
-#include <eel/eel-string.h>
-#include <eel/eel-vfs-extensions.h>
-
-#include <nautilus-extension.h>
-#include "nautilus-file-attributes.h"
+#include "nautilus-enums.h"
+#include "nautilus-error-reporting.h"
#include "nautilus-file-operations.h"
#include "nautilus-file-utilities.h"
#include "nautilus-global-preferences.h"
+#include "nautilus-icon-info.h"
#include "nautilus-metadata.h"
+#include "nautilus-mime-actions.h"
#include "nautilus-mime-application-chooser.h"
#include "nautilus-module.h"
#include "nautilus-ui-utilities.h"
diff --git a/src/nautilus-query-editor.c b/src/nautilus-query-editor.c
index a5dfd9a62..7e594b90f 100644
--- a/src/nautilus-query-editor.c
+++ b/src/nautilus-query-editor.c
@@ -20,22 +20,22 @@
*
*/
-#include <config.h>
#include "nautilus-query-editor.h"
-#include "nautilus-search-popover.h"
-#include "nautilus-mime-actions.h"
-#include <string.h>
-#include <glib/gi18n.h>
-#include <gio/gio.h>
#include <gdk/gdkkeysyms.h>
+#include <gio/gio.h>
+#include <glib/gi18n.h>
#include <gtk/gtk.h>
#include <libgd/gd.h>
+#include <string.h>
-#include <eel/eel-glib-extensions.h>
+#include "nautilus-file.h"
#include "nautilus-file-utilities.h"
-#include "nautilus-ui-utilities.h"
#include "nautilus-global-preferences.h"
+#include "nautilus-search-directory.h"
+#include "nautilus-search-popover.h"
+#include "nautilus-mime-actions.h"
+#include "nautilus-ui-utilities.h"
typedef struct
{
diff --git a/src/nautilus-query.c b/src/nautilus-query.c
index 59600d195..05e29b90e 100644
--- a/src/nautilus-query.c
+++ b/src/nautilus-query.c
@@ -19,17 +19,14 @@
*
*/
-#include <config.h>
-#include <string.h>
+#include "nautilus-query.h"
#include <eel/eel-glib-extensions.h>
#include <glib/gi18n.h>
-#include "nautilus-global-preferences.h"
-
-#include "nautilus-file-utilities.h"
-#include "nautilus-query.h"
#include "nautilus-enum-types.h"
+#include "nautilus-file-utilities.h"
+#include "nautilus-global-preferences.h"
#define RANK_SCALE_FACTOR 100
#define MIN_RANK 10.0
diff --git a/src/nautilus-recent.c b/src/nautilus-recent.c
index 08253e01f..da938f700 100644
--- a/src/nautilus-recent.c
+++ b/src/nautilus-recent.c
@@ -15,11 +15,12 @@
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
-#include "config.h"
#include "nautilus-recent.h"
#include <eel/eel-vfs-extensions.h>
+#include "nautilus-file.h"
+
#define DEFAULT_APP_EXEC "gnome-open %u"
static GtkRecentManager *
diff --git a/src/nautilus-recent.h b/src/nautilus-recent.h
index 2567e83f9..4386a9e85 100644
--- a/src/nautilus-recent.h
+++ b/src/nautilus-recent.h
@@ -1,8 +1,8 @@
#pragma once
-#include <gtk/gtk.h>
-#include "nautilus-file.h"
#include <gio/gio.h>
+#include "nautilus-types.h"
+
void nautilus_recent_add_file (NautilusFile *file,
- GAppInfo *application);
\ No newline at end of file
+ GAppInfo *application);
diff --git a/src/nautilus-search-directory-file.c b/src/nautilus-search-directory-file.c
index 48b74dec6..38dc18504 100644
--- a/src/nautilus-search-directory-file.c
+++ b/src/nautilus-search-directory-file.c
@@ -20,20 +20,21 @@
* Author: Anders Carlsson <andersca imendio com>
*/
-#include <config.h>
#include "nautilus-search-directory-file.h"
+#include <eel/eel-glib-extensions.h>
+#include <glib/gi18n.h>
+#include <gtk/gtk.h>
+#include <string.h>
+
#include "nautilus-directory-notify.h"
#include "nautilus-directory-private.h"
-#include "nautilus-file-attributes.h"
+#include "nautilus-enums.h"
#include "nautilus-file-private.h"
#include "nautilus-file-utilities.h"
#include "nautilus-keyfile-metadata.h"
-#include <eel/eel-glib-extensions.h>
+#include "nautilus-query.h"
#include "nautilus-search-directory.h"
-#include <gtk/gtk.h>
-#include <glib/gi18n.h>
-#include <string.h>
struct NautilusSearchDirectoryFileDetails
{
diff --git a/src/nautilus-search-directory.c b/src/nautilus-search-directory.c
index c70915d53..c3a845820 100644
--- a/src/nautilus-search-directory.c
+++ b/src/nautilus-search-directory.c
@@ -17,24 +17,24 @@
* Author: Anders Carlsson <andersca imendio com>
*/
-#include <config.h>
#include "nautilus-search-directory.h"
-#include "nautilus-search-directory-file.h"
-
-#include "nautilus-directory-private.h"
-#include "nautilus-file.h"
-#include "nautilus-file-private.h"
-#include "nautilus-file-utilities.h"
-#include "nautilus-search-provider.h"
-#include "nautilus-search-engine.h"
-#include "nautilus-search-engine-model.h"
#include <eel/eel-glib-extensions.h>
-#include <gtk/gtk.h>
#include <gio/gio.h>
+#include <gtk/gtk.h>
#include <string.h>
#include <sys/time.h>
+#include "nautilus-directory-private.h"
+#include "nautilus-file-private.h"
+#include "nautilus-file-utilities.h"
+#include "nautilus-file.h"
+#include "nautilus-query.h"
+#include "nautilus-search-directory-file.h"
+#include "nautilus-search-engine-model.h"
+#include "nautilus-search-engine.h"
+#include "nautilus-search-provider.h"
+
struct _NautilusSearchDirectory
{
NautilusDirectory parent_instance;
diff --git a/src/nautilus-search-directory.h b/src/nautilus-search-directory.h
index 9328a1202..abd5b0b10 100644
--- a/src/nautilus-search-directory.h
+++ b/src/nautilus-search-directory.h
@@ -22,7 +22,8 @@
#pragma once
#include "nautilus-directory.h"
-#include "nautilus-query.h"
+
+#include "nautilus-types.h"
#define NAUTILUS_SEARCH_DIRECTORY_PROVIDER_NAME "search-directory-provider"
#define NAUTILUS_TYPE_SEARCH_DIRECTORY (nautilus_search_directory_get_type ())
@@ -39,4 +40,4 @@ void nautilus_search_directory_set_query (NautilusSearchDirector
NautilusDirectory *
nautilus_search_directory_get_base_model (NautilusSearchDirectory *self);
void nautilus_search_directory_set_base_model (NautilusSearchDirectory *self,
- NautilusDirectory *base_model);
\ No newline at end of file
+ NautilusDirectory *base_model);
diff --git a/src/nautilus-toolbar.c b/src/nautilus-toolbar.c
index 442abd800..23e25aa70 100644
--- a/src/nautilus-toolbar.c
+++ b/src/nautilus-toolbar.c
@@ -20,28 +20,26 @@
*
*/
-#include <config.h>
-
#include "nautilus-toolbar.h"
-#include "nautilus-location-entry.h"
-#include "nautilus-pathbar.h"
-#include "nautilus-window.h"
-#include "nautilus-progress-info-widget.h"
-#include "nautilus-application.h"
-
-#include "nautilus-global-preferences.h"
-#include "nautilus-ui-utilities.h"
-#include "nautilus-progress-info-manager.h"
-#include "nautilus-file-operations.h"
-#include "nautilus-file-undo-manager.h"
-#include "nautilus-toolbar-menu-sections.h"
+#include <glib/gi18n.h>
+#include <math.h>
#include "animation/ide-box-theatric.h"
#include "animation/egg-animation.h"
-#include <glib/gi18n.h>
-#include <math.h>
+#include "nautilus-application.h"
+#include "nautilus-bookmark.h"
+#include "nautilus-file-operations.h"
+#include "nautilus-file-undo-manager.h"
+#include "nautilus-global-preferences.h"
+#include "nautilus-location-entry.h"
+#include "nautilus-pathbar.h"
+#include "nautilus-progress-info-manager.h"
+#include "nautilus-progress-info-widget.h"
+#include "nautilus-toolbar-menu-sections.h"
+#include "nautilus-ui-utilities.h"
+#include "nautilus-window.h"
#define OPERATION_MINIMUM_TIME 2 /*s */
#define NEEDS_ATTENTION_ANIMATION_TIMEOUT 2000 /*ms */
diff --git a/src/nautilus-trash-monitor.c b/src/nautilus-trash-monitor.c
index f3beaf1e0..1c34ec11f 100644
--- a/src/nautilus-trash-monitor.c
+++ b/src/nautilus-trash-monitor.c
@@ -19,15 +19,9 @@
* Author: Pavel Cisler <pavel eazel com>
*/
-#include <config.h>
#include "nautilus-trash-monitor.h"
-#include "nautilus-directory-notify.h"
-#include "nautilus-directory.h"
-#include "nautilus-file-attributes.h"
#include <eel/eel-debug.h>
-#include <gio/gio.h>
-#include <string.h>
#define UPDATE_RATE_SECONDS 1
diff --git a/src/nautilus-types.h b/src/nautilus-types.h
new file mode 100644
index 000000000..3c2979a67
--- /dev/null
+++ b/src/nautilus-types.h
@@ -0,0 +1,48 @@
+/* Copyright (C) 2018 Ernestas Kulik <ernestask gnome org>
+ *
+ * This file is part of Nautilus.
+ *
+ * Nautilus 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Nautilus 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 Nautilus. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+/* This here header contains Nautilus type definitions.
+ *
+ * It is advisable to include this in headers or when you
+ * only need the name of a type (i.e. not calling any functions from the
+ * associated header). Doing so will help avoid circular inclusions and
+ * pointless rebuilds should the header ever change.
+ */
+
+#pragma once
+
+#include "nautilus-enums.h"
+
+/* Keep sorted alphabetically. */
+
+typedef struct _NautilusBookmark NautilusBookmark;
+typedef struct _NautilusBookmarkList NautilusBookmarkList;
+typedef struct _NautilusCanvasContainer NautilusCanvasContainer;
+typedef struct _NautilusCanvasView NautilusCanvasView;
+typedef struct _NautilusDirectory NautilusDirectory;
+typedef struct NautilusFile NautilusFile;
+typedef struct NautilusFileQueue NautilusFileQueue;
+typedef struct _NautilusFilesView NautilusFilesView;
+typedef struct _NautilusIconInfo NautilusIconInfo;
+typedef struct NautilusMonitor NautilusMonitor;
+typedef struct _NautilusQuery NautilusQuery;
+typedef struct _NautilusQueryEditor NautilusQueryEditor;
+typedef struct _NautilusToolbarMenuSections NautilusToolbarMenuSections;
+typedef struct _NautilusView NautilusView;
+typedef struct _NautilusWindow NautilusWindow;
+typedef struct _NautilusWindowSlot NautilusWindowSlot;
diff --git a/src/nautilus-window-slot.c b/src/nautilus-window-slot.c
index 1b5dd1a90..57504bd94 100644
--- a/src/nautilus-window-slot.c
+++ b/src/nautilus-window-slot.c
@@ -24,9 +24,10 @@
#include "nautilus-window-slot.h"
#include "nautilus-application.h"
-#include "nautilus-canvas-view.h"
-#include "nautilus-list-view.h"
+#include "nautilus-bookmark.h"
+#include "nautilus-bookmark-list.h"
#include "nautilus-mime-actions.h"
+#include "nautilus-query-editor.h"
#include "nautilus-special-location-bar.h"
#include "nautilus-toolbar.h"
#include "nautilus-trash-bar.h"
diff --git a/src/nautilus-window-slot.h b/src/nautilus-window-slot.h
index 4cf323027..6f1813062 100644
--- a/src/nautilus-window-slot.h
+++ b/src/nautilus-window-slot.h
@@ -25,6 +25,8 @@
#include <gio/gio.h>
#include <gtk/gtk.h>
+#include "nautilus-types.h"
+
typedef enum {
NAUTILUS_LOCATION_CHANGE_STANDARD,
NAUTILUS_LOCATION_CHANGE_BACK,
@@ -35,12 +37,6 @@ typedef enum {
#define NAUTILUS_TYPE_WINDOW_SLOT (nautilus_window_slot_get_type ())
G_DECLARE_DERIVABLE_TYPE (NautilusWindowSlot, nautilus_window_slot, NAUTILUS, WINDOW_SLOT, GtkBox)
-#include "nautilus-query-editor.h"
-#include "nautilus-files-view.h"
-#include "nautilus-view.h"
-#include "nautilus-window.h"
-#include "nautilus-toolbar-menu-sections.h"
-
typedef struct
{
NautilusFile *file;
diff --git a/src/nautilus-window.c b/src/nautilus-window.c
index c5e55191f..e33f0ae1a 100644
--- a/src/nautilus-window.c
+++ b/src/nautilus-window.c
@@ -26,45 +26,43 @@
#include "nautilus-window.h"
-#include <config.h>
-
-#include "nautilus-application.h"
-#include "nautilus-location-entry.h"
-#include "nautilus-mime-actions.h"
-#include "nautilus-notebook.h"
-#include "nautilus-pathbar.h"
-#include "nautilus-properties-window.h"
-#include "nautilus-toolbar.h"
-#include "nautilus-window-slot.h"
-#include "nautilus-list-view.h"
-#include "nautilus-other-locations-window-slot.h"
-
#include <eel/eel-debug.h>
#include <eel/eel-gtk-extensions.h>
#include <eel/eel-vfs-extensions.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
-#include <gdk/gdkx.h>
#include <gdk/gdkkeysyms.h>
-#include <gtk/gtk.h>
+#include <gdk/gdkx.h>
#include <glib/gi18n.h>
+#include <gtk/gtk.h>
+#include <math.h>
+#include <sys/time.h>
+
+#define DEBUG_FLAG NAUTILUS_DEBUG_WINDOW
+#include "nautilus-debug.h"
+
+#include "nautilus-application.h"
+#include "nautilus-bookmark-list.h"
+#include "nautilus-clipboard.h"
#include "nautilus-dnd.h"
-#include "nautilus-file-utilities.h"
-#include "nautilus-file-attributes.h"
+#include "nautilus-enums.h"
#include "nautilus-file-operations.h"
#include "nautilus-file-undo-manager.h"
+#include "nautilus-file-utilities.h"
#include "nautilus-global-preferences.h"
+#include "nautilus-list-view.h"
+#include "nautilus-location-entry.h"
#include "nautilus-metadata.h"
+#include "nautilus-mime-actions.h"
+#include "nautilus-notebook.h"
+#include "nautilus-other-locations-window-slot.h"
+#include "nautilus-pathbar.h"
#include "nautilus-profile.h"
-#include "nautilus-clipboard.h"
+#include "nautilus-properties-window.h"
#include "nautilus-signaller.h"
+#include "nautilus-toolbar.h"
#include "nautilus-trash-monitor.h"
#include "nautilus-ui-utilities.h"
-
-#define DEBUG_FLAG NAUTILUS_DEBUG_WINDOW
-#include "nautilus-debug.h"
-
-#include <math.h>
-#include <sys/time.h>
+#include "nautilus-window-slot.h"
/* Forward and back buttons on the mouse */
static gboolean mouse_extra_buttons = TRUE;
diff --git a/src/nautilus-window.h b/src/nautilus-window.h
index 2a218278a..2787a57ab 100644
--- a/src/nautilus-window.h
+++ b/src/nautilus-window.h
@@ -27,19 +27,10 @@
#pragma once
#include <gtk/gtk.h>
-#include <eel/eel-glib-extensions.h>
-#include "nautilus-bookmark.h"
-#include "nautilus-search-directory.h"
-G_BEGIN_DECLS
+#include "nautilus-types.h"
-typedef enum {
- NAUTILUS_WINDOW_OPEN_FLAG_CLOSE_BEHIND = 1 << 0,
- NAUTILUS_WINDOW_OPEN_FLAG_NEW_WINDOW = 1 << 1,
- NAUTILUS_WINDOW_OPEN_FLAG_NEW_TAB = 1 << 2,
- NAUTILUS_WINDOW_OPEN_SLOT_APPEND = 1 << 3,
- NAUTILUS_WINDOW_OPEN_FLAG_DONT_MAKE_ACTIVE = 1 << 4
-} NautilusWindowOpenFlags;
+G_BEGIN_DECLS
#define NAUTILUS_TYPE_WINDOW (nautilus_window_get_type ())
G_DECLARE_DERIVABLE_TYPE (NautilusWindow, nautilus_window, NAUTILUS, WINDOW, GtkApplicationWindow);
@@ -49,12 +40,6 @@ typedef gboolean (* NautilusWindowGoToCallback) (NautilusWindow *window,
GError *error,
gpointer user_data);
-#include "nautilus-files-view.h"
-#include "nautilus-window-slot.h"
-
-#define NAUTILUS_WINDOW_SIDEBAR_PLACES "places"
-#define NAUTILUS_WINDOW_SIDEBAR_TREE "tree"
-
/* window geometry */
/* Min values are very small, and a Nautilus window at this tiny size is *almost*
* completely unusable. However, if all the extra bits (sidebar, location bar, etc)
@@ -140,4 +125,4 @@ void nautilus_window_initialize_slot (NautilusWindow *window,
NautilusWindowSlot *slot,
NautilusWindowOpenFlags flags);
-G_END_DECLS
\ No newline at end of file
+G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]