From 43db106db004d508bc866d8ba611ab77b0ca5fe6 Mon Sep 17 00:00:00 2001
From: David Capello <davidcapello@gmail.com>
Date: Fri, 22 Sep 2017 15:57:38 -0300
Subject: [PATCH] Rename docio to dio

---
 src/CMakeLists.txt                    |  2 +-
 src/README.md                         |  4 ++--
 src/app/CMakeLists.txt                |  2 +-
 src/app/file/ase_format.cpp           |  2 +-
 src/app/file/bmp_format.cpp           |  4 ++--
 src/app/file/file.cpp                 |  8 +++----
 src/app/file/file_format.cpp          |  6 ++---
 src/app/file/file_format.h            |  8 +++----
 src/app/file/file_formats_manager.cpp |  6 ++---
 src/app/file/file_formats_manager.h   |  6 ++---
 src/app/file/fli_format.cpp           |  4 ++--
 src/app/file/gif_format.cpp           |  2 +-
 src/app/file/ico_format.cpp           |  2 +-
 src/app/file/jpeg_format.cpp          |  4 ++--
 src/app/file/palette_file.cpp         | 32 +++++++++++++--------------
 src/app/file/pcx_format.cpp           |  4 ++--
 src/app/file/png_format.cpp           |  4 ++--
 src/app/file/tga_format.cpp           |  4 ++--
 src/app/file/webp_format.cpp          |  4 ++--
 src/dio/CMakeLists.txt                |  9 ++++++++
 src/{docio => dio}/LICENSE.txt        |  2 +-
 src/{docio => dio}/README.md          |  2 +-
 src/{docio => dio}/detect_format.cpp  |  6 ++---
 src/{docio => dio}/detect_format.h    | 12 +++++-----
 src/{docio => dio}/file_format.h      |  8 +++----
 src/docio/CMakeLists.txt              |  9 --------
 26 files changed, 78 insertions(+), 78 deletions(-)
 create mode 100644 src/dio/CMakeLists.txt
 rename src/{docio => dio}/LICENSE.txt (96%)
 rename src/{docio => dio}/README.md (66%)
 rename src/{docio => dio}/detect_format.cpp (97%)
 rename src/{docio => dio}/detect_format.h (67%)
 rename src/{docio => dio}/file_format.h (83%)
 delete mode 100644 src/docio/CMakeLists.txt

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index d65f4df9d..554e6e575 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -95,7 +95,7 @@ add_subdirectory(gen)
 add_subdirectory(gfx)
 add_subdirectory(net)
 add_subdirectory(render)
-add_subdirectory(docio)
+add_subdirectory(dio)
 add_subdirectory(ft)
 add_subdirectory(she)
 add_subdirectory(ui)
diff --git a/src/README.md b/src/README.md
index 29fa93b7e..d9e86293e 100644
--- a/src/README.md
+++ b/src/README.md
@@ -46,11 +46,11 @@ because they don't depend on any other component.
 
 ## Level 4
 
-  * [docio](docio/) (base, flic): Load/save documents.
+  * [dio](dio/) (base, flic): Load/save documents.
 
 ## Level 5
 
-  * [app](app/) (allegro, base, doc, docio, filters, fixmath, flic, gfx, pen, render, scripting, she, ui, undo, updater, webserver)
+  * [app](app/) (allegro, base, doc, dio, filters, fixmath, flic, gfx, pen, render, scripting, she, ui, undo, updater, webserver)
 
 ## Level 6
 
diff --git a/src/app/CMakeLists.txt b/src/app/CMakeLists.txt
index d877ebf21..a9e80d73c 100644
--- a/src/app/CMakeLists.txt
+++ b/src/app/CMakeLists.txt
@@ -531,7 +531,7 @@ target_link_libraries(app-lib
   cfg-lib
   clip
   doc-lib
-  docio-lib
+  dio-lib
   filters-lib
   fixmath-lib
   flic-lib
diff --git a/src/app/file/ase_format.cpp b/src/app/file/ase_format.cpp
index cec4ef65b..cb28e5ca2 100644
--- a/src/app/file/ase_format.cpp
+++ b/src/app/file/ase_format.cpp
@@ -174,7 +174,7 @@ private:
 class AseFormat : public FileFormat {
   const char* onGetName() const override { return "ase"; }
   const char* onGetExtensions() const override { return "ase,aseprite"; }
-  docio::FileFormat onGetDocioFormat() const override { return docio::FileFormat::ASE_ANIMATION; }
+  dio::FileFormat onGetDioFormat() const override { return dio::FileFormat::ASE_ANIMATION; }
   int onGetFlags() const override {
     return
       FILE_SUPPORT_LOAD |
diff --git a/src/app/file/bmp_format.cpp b/src/app/file/bmp_format.cpp
index 7d1c05e34..117920a95 100644
--- a/src/app/file/bmp_format.cpp
+++ b/src/app/file/bmp_format.cpp
@@ -1,5 +1,5 @@
 // Aseprite
-// Copyright (C) 2001-2016  David Capello
+// Copyright (C) 2001-2017  David Capello
 //
 // This program is distributed under the terms of
 // the End-User License Agreement for Aseprite.
@@ -45,7 +45,7 @@ class BmpFormat : public FileFormat {
 
   const char* onGetName() const override { return "bmp"; }
   const char* onGetExtensions() const override { return "bmp"; }
-  docio::FileFormat onGetDocioFormat() const override { return docio::FileFormat::BMP_IMAGE; }
+  dio::FileFormat onGetDioFormat() const override { return dio::FileFormat::BMP_IMAGE; }
   int onGetFlags() const override {
     return
       FILE_SUPPORT_LOAD |
diff --git a/src/app/file/file.cpp b/src/app/file/file.cpp
index 0d8edb318..8be82f128 100644
--- a/src/app/file/file.cpp
+++ b/src/app/file/file.cpp
@@ -27,8 +27,8 @@
 #include "base/scoped_lock.h"
 #include "base/shared_ptr.h"
 #include "base/string.h"
+#include "dio/detect_format.h"
 #include "doc/doc.h"
-#include "docio/detect_format.h"
 #include "render/quantization.h"
 #include "render/render.h"
 #include "ui/alert.h"
@@ -128,7 +128,7 @@ bool is_static_image_format(const std::string& filename)
   // Get the format through the extension of the filename
   FileFormat* format =
     FileFormatsManager::instance()
-    ->getFileFormat(docio::detect_format_by_file_extension(filename));
+    ->getFileFormat(dio::detect_format_by_file_extension(filename));
 
   return (format && format->support(FILE_SUPPORT_SEQUENCES));
 }
@@ -188,7 +188,7 @@ FileOp* FileOp::createLoadDocumentOperation(Context* context, const std::string&
 
   // Get the format through the extension of the filename
   fop->m_format = FileFormatsManager::instance()->getFileFormat(
-    docio::detect_format(filename));
+    dio::detect_format(filename));
   if (!fop->m_format ||
       !fop->m_format->support(FILE_SUPPORT_LOAD)) {
     fop->setError("%s can't load \"%s\" file (\"%s\")\n", PACKAGE,
@@ -329,7 +329,7 @@ FileOp* FileOp::createSaveDocumentOperation(const Context* context,
 
   // Get the format through the extension of the filename
   fop->m_format = FileFormatsManager::instance()->getFileFormat(
-    docio::detect_format_by_file_extension(filename));
+    dio::detect_format_by_file_extension(filename));
   if (!fop->m_format ||
       !fop->m_format->support(FILE_SUPPORT_SAVE)) {
     fop->setError("%s can't save \"%s\" file (\"%s\")\n", PACKAGE,
diff --git a/src/app/file/file_format.cpp b/src/app/file/file_format.cpp
index 4c3a86632..1a3372750 100644
--- a/src/app/file/file_format.cpp
+++ b/src/app/file/file_format.cpp
@@ -1,5 +1,5 @@
 // Aseprite
-// Copyright (C) 2001-2016  David Capello
+// Copyright (C) 2001-2017  David Capello
 //
 // This program is distributed under the terms of
 // the End-User License Agreement for Aseprite.
@@ -33,9 +33,9 @@ const char* FileFormat::extensions() const
   return onGetExtensions();
 }
 
-docio::FileFormat FileFormat::docioFormat() const
+dio::FileFormat FileFormat::dioFormat() const
 {
-  return onGetDocioFormat();
+  return onGetDioFormat();
 }
 
 bool FileFormat::load(FileOp* fop)
diff --git a/src/app/file/file_format.h b/src/app/file/file_format.h
index f9cd4cd56..4b07c21ff 100644
--- a/src/app/file/file_format.h
+++ b/src/app/file/file_format.h
@@ -1,5 +1,5 @@
 // Aseprite
-// Copyright (C) 2001-2016  David Capello
+// Copyright (C) 2001-2017  David Capello
 //
 // This program is distributed under the terms of
 // the End-User License Agreement for Aseprite.
@@ -9,7 +9,7 @@
 #pragma once
 
 #include "base/shared_ptr.h"
-#include "docio/file_format.h"
+#include "dio/file_format.h"
 
 #include <vector>
 
@@ -45,7 +45,7 @@ namespace app {
 
     const char* name() const;       // File format name
     const char* extensions() const; // Extensions (e.g. "jpeg,jpg")
-    docio::FileFormat docioFormat() const;
+    dio::FileFormat dioFormat() const;
 
     bool load(FileOp* fop);
 #ifdef ENABLE_SAVE
@@ -73,7 +73,7 @@ namespace app {
   protected:
     virtual const char* onGetName() const = 0;
     virtual const char* onGetExtensions() const = 0;
-    virtual docio::FileFormat onGetDocioFormat() const = 0;
+    virtual dio::FileFormat onGetDioFormat() const = 0;
     virtual int onGetFlags() const = 0;
 
     virtual bool onLoad(FileOp* fop) = 0;
diff --git a/src/app/file/file_formats_manager.cpp b/src/app/file/file_formats_manager.cpp
index 4acd89055..de68d408a 100644
--- a/src/app/file/file_formats_manager.cpp
+++ b/src/app/file/file_formats_manager.cpp
@@ -13,7 +13,7 @@
 #include "app/file/file_format.h"
 #include "app/file/format_options.h"
 #include "base/string.h"
-#include "docio/detect_format.h"
+#include "dio/detect_format.h"
 
 #include <algorithm>
 #include <cstring>
@@ -92,10 +92,10 @@ FileFormatsList::iterator FileFormatsManager::end()
   return m_formats.end();
 }
 
-FileFormat* FileFormatsManager::getFileFormat(const docio::FileFormat docioFormat) const
+FileFormat* FileFormatsManager::getFileFormat(const dio::FileFormat dioFormat) const
 {
   for (FileFormat* ff : m_formats)
-    if (ff->docioFormat() == docioFormat)
+    if (ff->dioFormat() == dioFormat)
       return ff;
   return nullptr;
 }
diff --git a/src/app/file/file_formats_manager.h b/src/app/file/file_formats_manager.h
index 884303f5e..27e434411 100644
--- a/src/app/file/file_formats_manager.h
+++ b/src/app/file/file_formats_manager.h
@@ -1,5 +1,5 @@
 // Aseprite
-// Copyright (C) 2001-2016  David Capello
+// Copyright (C) 2001-2017  David Capello
 //
 // This program is distributed under the terms of
 // the End-User License Agreement for Aseprite.
@@ -8,7 +8,7 @@
 #define APP_FILE_FILE_FORMATS_MANAGER_H_INCLUDED
 #pragma once
 
-#include "docio/file_format.h"
+#include "dio/file_format.h"
 
 #include <vector>
 
@@ -34,7 +34,7 @@ namespace app {
     FileFormatsList::iterator begin();
     FileFormatsList::iterator end();
 
-    FileFormat* getFileFormat(const docio::FileFormat docioFormat) const;
+    FileFormat* getFileFormat(const dio::FileFormat dioFormat) const;
 
   private:
     FileFormatsManager();
diff --git a/src/app/file/fli_format.cpp b/src/app/file/fli_format.cpp
index 395877ddb..50d39f959 100644
--- a/src/app/file/fli_format.cpp
+++ b/src/app/file/fli_format.cpp
@@ -1,5 +1,5 @@
 // Aseprite
-// Copyright (C) 2001-2016  David Capello
+// Copyright (C) 2001-2017  David Capello
 //
 // This program is distributed under the terms of
 // the End-User License Agreement for Aseprite.
@@ -27,7 +27,7 @@ using namespace base;
 class FliFormat : public FileFormat {
   const char* onGetName() const override { return "flc"; }
   const char* onGetExtensions() const  override{ return "flc,fli"; }
-  docio::FileFormat onGetDocioFormat() const override { return docio::FileFormat::FLIC_ANIMATION; }
+  dio::FileFormat onGetDioFormat() const override { return dio::FileFormat::FLIC_ANIMATION; }
   int onGetFlags() const override {
     return
       FILE_SUPPORT_LOAD |
diff --git a/src/app/file/gif_format.cpp b/src/app/file/gif_format.cpp
index 7bc6f8bd1..3173cc0ce 100644
--- a/src/app/file/gif_format.cpp
+++ b/src/app/file/gif_format.cpp
@@ -64,7 +64,7 @@ class GifFormat : public FileFormat {
 
   const char* onGetName() const override { return "gif"; }
   const char* onGetExtensions() const override { return "gif"; }
-  docio::FileFormat onGetDocioFormat() const override { return docio::FileFormat::GIF_ANIMATION; }
+  dio::FileFormat onGetDioFormat() const override { return dio::FileFormat::GIF_ANIMATION; }
   int onGetFlags() const override {
     return
       FILE_SUPPORT_LOAD |
diff --git a/src/app/file/ico_format.cpp b/src/app/file/ico_format.cpp
index 03fbe311c..6374609ba 100644
--- a/src/app/file/ico_format.cpp
+++ b/src/app/file/ico_format.cpp
@@ -26,7 +26,7 @@ using namespace base;
 class IcoFormat : public FileFormat {
   const char* onGetName() const override { return "ico"; }
   const char* onGetExtensions() const override { return "ico"; }
-  docio::FileFormat onGetDocioFormat() const override { return docio::FileFormat::ICO_IMAGES; }
+  dio::FileFormat onGetDioFormat() const override { return dio::FileFormat::ICO_IMAGES; }
   int onGetFlags() const override {
     return
       FILE_SUPPORT_LOAD |
diff --git a/src/app/file/jpeg_format.cpp b/src/app/file/jpeg_format.cpp
index 12b9eb0ac..b38237a68 100644
--- a/src/app/file/jpeg_format.cpp
+++ b/src/app/file/jpeg_format.cpp
@@ -1,5 +1,5 @@
 // Aseprite
-// Copyright (C) 2001-2016  David Capello
+// Copyright (C) 2001-2017  David Capello
 //
 // This program is distributed under the terms of
 // the End-User License Agreement for Aseprite.
@@ -42,7 +42,7 @@ class JpegFormat : public FileFormat {
 
   const char* onGetName() const override { return "jpeg"; }
   const char* onGetExtensions() const override { return "jpeg,jpg"; }
-  docio::FileFormat onGetDocioFormat() const override { return docio::FileFormat::JPEG_IMAGE; }
+  dio::FileFormat onGetDioFormat() const override { return dio::FileFormat::JPEG_IMAGE; }
   int onGetFlags() const override {
     return
       FILE_SUPPORT_LOAD |
diff --git a/src/app/file/palette_file.cpp b/src/app/file/palette_file.cpp
index 9c039daab..6e1a04936 100644
--- a/src/app/file/palette_file.cpp
+++ b/src/app/file/palette_file.cpp
@@ -1,5 +1,5 @@
 // Aseprite
-// Copyright (C) 2001-2016  David Capello
+// Copyright (C) 2001-2017  David Capello
 //
 // This program is distributed under the terms of
 // the End-User License Agreement for Aseprite.
@@ -24,7 +24,7 @@
 #include "doc/layer.h"
 #include "doc/palette.h"
 #include "doc/sprite.h"
-#include "docio/detect_format.h"
+#include "dio/detect_format.h"
 
 #include <cstring>
 
@@ -48,29 +48,29 @@ std::string get_writable_palette_extensions()
 
 Palette* load_palette(const char* filename)
 {
-  docio::FileFormat docioFormat = docio::detect_format(filename);
+  dio::FileFormat dioFormat = dio::detect_format(filename);
   Palette* pal = nullptr;
 
-  switch (docioFormat) {
+  switch (dioFormat) {
 
-    case docio::FileFormat::COL_PALETTE:
+    case dio::FileFormat::COL_PALETTE:
       pal = doc::file::load_col_file(filename);
       break;
 
-    case docio::FileFormat::GPL_PALETTE:
+    case dio::FileFormat::GPL_PALETTE:
       pal = doc::file::load_gpl_file(filename);
       break;
 
-    case docio::FileFormat::HEX_PALETTE:
+    case dio::FileFormat::HEX_PALETTE:
       pal = doc::file::load_hex_file(filename);
       break;
 
-    case docio::FileFormat::PAL_PALETTE:
+    case dio::FileFormat::PAL_PALETTE:
       pal = doc::file::load_pal_file(filename);
       break;
 
     default: {
-      FileFormat* ff = FileFormatsManager::instance()->getFileFormat(docioFormat);
+      FileFormat* ff = FileFormatsManager::instance()->getFileFormat(dioFormat);
       if (!ff || !ff->support(FILE_SUPPORT_LOAD))
         break;
 
@@ -106,29 +106,29 @@ Palette* load_palette(const char* filename)
 
 bool save_palette(const char* filename, const Palette* pal, int columns)
 {
-  docio::FileFormat docioFormat = docio::detect_format_by_file_extension(filename);
+  dio::FileFormat dioFormat = dio::detect_format_by_file_extension(filename);
   bool success = false;
 
-  switch (docioFormat) {
+  switch (dioFormat) {
 
-    case docio::FileFormat::COL_PALETTE:
+    case dio::FileFormat::COL_PALETTE:
       success = doc::file::save_col_file(pal, filename);
       break;
 
-    case docio::FileFormat::GPL_PALETTE:
+    case dio::FileFormat::GPL_PALETTE:
       success = doc::file::save_gpl_file(pal, filename);
       break;
 
-    case docio::FileFormat::HEX_PALETTE:
+    case dio::FileFormat::HEX_PALETTE:
       success = doc::file::save_hex_file(pal, filename);
       break;
 
-    case docio::FileFormat::PAL_PALETTE:
+    case dio::FileFormat::PAL_PALETTE:
       success = doc::file::save_pal_file(pal, filename);
       break;
 
     default: {
-      FileFormat* ff = FileFormatsManager::instance()->getFileFormat(docioFormat);
+      FileFormat* ff = FileFormatsManager::instance()->getFileFormat(dioFormat);
       if (!ff || !ff->support(FILE_SUPPORT_SAVE))
         break;
 
diff --git a/src/app/file/pcx_format.cpp b/src/app/file/pcx_format.cpp
index c76351f2d..bc16f1f6e 100644
--- a/src/app/file/pcx_format.cpp
+++ b/src/app/file/pcx_format.cpp
@@ -1,5 +1,5 @@
 // Aseprite
-// Copyright (C) 2001-2016  David Capello
+// Copyright (C) 2001-2017  David Capello
 //
 // This program is distributed under the terms of
 // the End-User License Agreement for Aseprite.
@@ -24,7 +24,7 @@ using namespace base;
 class PcxFormat : public FileFormat {
   const char* onGetName() const override { return "pcx"; }
   const char* onGetExtensions() const override { return "pcx,pcc"; }
-  docio::FileFormat onGetDocioFormat() const override { return docio::FileFormat::PCX_IMAGE; }
+  dio::FileFormat onGetDioFormat() const override { return dio::FileFormat::PCX_IMAGE; }
   int onGetFlags() const override {
     return
       FILE_SUPPORT_LOAD |
diff --git a/src/app/file/png_format.cpp b/src/app/file/png_format.cpp
index dd4ed596e..797a597ee 100644
--- a/src/app/file/png_format.cpp
+++ b/src/app/file/png_format.cpp
@@ -1,5 +1,5 @@
 // Aseprite
-// Copyright (C) 2001-2016  David Capello
+// Copyright (C) 2001-2017  David Capello
 //
 // This program is distributed under the terms of
 // the End-User License Agreement for Aseprite.
@@ -29,7 +29,7 @@ using namespace base;
 class PngFormat : public FileFormat {
   const char* onGetName() const override { return "png"; }
   const char* onGetExtensions() const override { return "png"; }
-  docio::FileFormat onGetDocioFormat() const override { return docio::FileFormat::PNG_IMAGE; }
+  dio::FileFormat onGetDioFormat() const override { return dio::FileFormat::PNG_IMAGE; }
   int onGetFlags() const override {
     return
       FILE_SUPPORT_LOAD |
diff --git a/src/app/file/tga_format.cpp b/src/app/file/tga_format.cpp
index ee09ab4c2..fad657794 100644
--- a/src/app/file/tga_format.cpp
+++ b/src/app/file/tga_format.cpp
@@ -1,5 +1,5 @@
 // Aseprite
-// Copyright (C) 2001-2016  David Capello
+// Copyright (C) 2001-2017  David Capello
 //
 // This program is distributed under the terms of
 // the End-User License Agreement for Aseprite.
@@ -25,7 +25,7 @@ using namespace base;
 class TgaFormat : public FileFormat {
   const char* onGetName() const override { return "tga"; }
   const char* onGetExtensions() const override { return "tga"; }
-  docio::FileFormat onGetDocioFormat() const override { return docio::FileFormat::TARGA_IMAGE; }
+  dio::FileFormat onGetDioFormat() const override { return dio::FileFormat::TARGA_IMAGE; }
   int onGetFlags() const override {
     return
       FILE_SUPPORT_LOAD |
diff --git a/src/app/file/webp_format.cpp b/src/app/file/webp_format.cpp
index 255e3b38a..4764274a0 100644
--- a/src/app/file/webp_format.cpp
+++ b/src/app/file/webp_format.cpp
@@ -1,6 +1,6 @@
 // Aseprite
+// Copyright (C) 2015-2017 David Capello
 // Copyright (C) 2015 Gabriel Rauter
-// Copyright (C) 2015-2016 David Capello
 //
 // This program is distributed under the terms of
 // the End-User License Agreement for Aseprite.
@@ -41,7 +41,7 @@ class WebPFormat : public FileFormat {
 
   const char* onGetName() const override { return "webp"; }
   const char* onGetExtensions() const override { return "webp"; }
-  docio::FileFormat onGetDocioFormat() const override { return docio::FileFormat::WEBP_ANIMATION; }
+  dio::FileFormat onGetDioFormat() const override { return dio::FileFormat::WEBP_ANIMATION; }
   int onGetFlags() const override {
     return
       FILE_SUPPORT_LOAD |
diff --git a/src/dio/CMakeLists.txt b/src/dio/CMakeLists.txt
new file mode 100644
index 000000000..d4d0d64a5
--- /dev/null
+++ b/src/dio/CMakeLists.txt
@@ -0,0 +1,9 @@
+# Aseprite Document IO Library
+# Copyright (c) 2016-2017 David Capello
+
+add_library(dio-lib
+  detect_format.cpp)
+
+target_link_libraries(dio-lib
+  flic-lib
+  laf-base)
diff --git a/src/docio/LICENSE.txt b/src/dio/LICENSE.txt
similarity index 96%
rename from src/docio/LICENSE.txt
rename to src/dio/LICENSE.txt
index 9a182c0f3..7854a820d 100644
--- a/src/docio/LICENSE.txt
+++ b/src/dio/LICENSE.txt
@@ -1,4 +1,4 @@
-Copyright (c) 2016 David Capello
+Copyright (c) 2016-2017 David Capello
 
 Permission is hereby granted, free of charge, to any person obtaining
 a copy of this software and associated documentation files (the
diff --git a/src/docio/README.md b/src/dio/README.md
similarity index 66%
rename from src/docio/README.md
rename to src/dio/README.md
index 34e04c3c6..c112d344b 100644
--- a/src/docio/README.md
+++ b/src/dio/README.md
@@ -1,4 +1,4 @@
 # Aseprite Document IO Library
-*Copyright (C) 2016 David Capello*
+*Copyright (C) 2016-2017 David Capello*
 
 > Distributed under [MIT license](LICENSE.txt)
diff --git a/src/docio/detect_format.cpp b/src/dio/detect_format.cpp
similarity index 97%
rename from src/docio/detect_format.cpp
rename to src/dio/detect_format.cpp
index 0975e354c..db74a3b9d 100644
--- a/src/docio/detect_format.cpp
+++ b/src/dio/detect_format.cpp
@@ -4,7 +4,7 @@
 // This file is released under the terms of the MIT license.
 // Read LICENSE.txt for more information.
 
-#include "docio/detect_format.h"
+#include "dio/detect_format.h"
 
 #include "base/file_handle.h"
 #include "base/fs.h"
@@ -21,7 +21,7 @@
 #define PNG_MAGIC_DWORD1 0x474E5089
 #define PNG_MAGIC_DWORD2 0x0A1A0A0D
 
-namespace docio {
+namespace dio {
 
 FileFormat detect_format(const std::string& filename)
 {
@@ -135,4 +135,4 @@ FileFormat detect_format_by_file_extension(const std::string& filename)
   return FileFormat::UNKNOWN;
 }
 
-} // namespace docio
+} // namespace dio
diff --git a/src/docio/detect_format.h b/src/dio/detect_format.h
similarity index 67%
rename from src/docio/detect_format.h
rename to src/dio/detect_format.h
index d5a869164..7a7e01033 100644
--- a/src/docio/detect_format.h
+++ b/src/dio/detect_format.h
@@ -1,23 +1,23 @@
 // Aseprite Document IO Library
-// Copyright (c) 2016 David Capello
+// Copyright (c) 2016-2017 David Capello
 //
 // This file is released under the terms of the MIT license.
 // Read LICENSE.txt for more information.
 
-#ifndef DOCIO_DETECT_FORMAT_H_INCLUDED
-#define DOCIO_DETECT_FORMAT_H_INCLUDED
+#ifndef DIO_DETECT_FORMAT_H_INCLUDED
+#define DIO_DETECT_FORMAT_H_INCLUDED
 #pragma once
 
-#include "docio/file_format.h"
+#include "dio/file_format.h"
 
 #include <string>
 
-namespace docio {
+namespace dio {
 
 FileFormat detect_format(const std::string& filename);
 FileFormat detect_format_by_file_content(const std::string& filename);
 FileFormat detect_format_by_file_extension(const std::string& filename);
 
-} // namespace docio
+} // namespace dio
 
 #endif
diff --git a/src/docio/file_format.h b/src/dio/file_format.h
similarity index 83%
rename from src/docio/file_format.h
rename to src/dio/file_format.h
index f0666311c..6650efe2d 100644
--- a/src/docio/file_format.h
+++ b/src/dio/file_format.h
@@ -4,11 +4,11 @@
 // This file is released under the terms of the MIT license.
 // Read LICENSE.txt for more information.
 
-#ifndef DOCIO_FILE_FORMAT_H_INCLUDED
-#define DOCIO_FILE_FORMAT_H_INCLUDED
+#ifndef DIO_FILE_FORMAT_H_INCLUDED
+#define DIO_FILE_FORMAT_H_INCLUDED
 #pragma once
 
-namespace docio {
+namespace dio {
 
 enum class FileFormat {
   ERROR = -1,
@@ -31,6 +31,6 @@ enum class FileFormat {
   WEBP_ANIMATION,
 };
 
-} // namespace docio
+} // namespace dio
 
 #endif
diff --git a/src/docio/CMakeLists.txt b/src/docio/CMakeLists.txt
deleted file mode 100644
index d8cdbe7af..000000000
--- a/src/docio/CMakeLists.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-# Aseprite Document IO Library
-# Copyright (c) 2016 David Capello
-
-add_library(docio-lib
-  detect_format.cpp)
-
-target_link_libraries(docio-lib
-  flic-lib
-  laf-base)