
This directory contains code related to input and output.

A comment about filenames/paths:

Gtk internally uses utf8 strings. All GUI elements take/return utf8
strings (i.e. Glib::ustring).  However, externally, utf8 may not be
used by the operating system. This requires that filenames/paths be
converted between utf8 and the local encoding. For example, a user
types in a utf8 filename into a file dialog. This needs to be
converted to a std::string in the locale encoding before using it to
open a file. Glib provides functions to handle translating the utf8
encoded strings to/from the locally used encoding (e.g.
Glib::filename_from_utf8()).

Gtk4 file dialogs do not use filenames directly. Instead they use
Gio::File's. Gio::File's handle string type conversions for you. You
can directly obtain the correct string for system use (get_path()) or
for GUI use (get_parse_name()).

SVG files generally contain utf8 encoded strings. So constructing a
filename for opening a file from an 'id' would require converting the
'id' to the local encoding.


Note that input and output to particular file formats may be implemented elsewhere:

1. Internal extensions. See src/extensions/internal

   Input:  CDR, EMF, WMF VSD WPG
   Output: SVG, PNG (via Cairo), PS, EPS, PDF, POV, ODF, EMF, WMF, XAML, LaTex.

2. External extensions (Python). See share/extensions

   Input: PS, EPS, PDF, SK, XAML, DXF, DIA, AI, ?
   Output: SVG (Layers/Optimized), SK1, XCF, HTML5, SIF, PTL, HPGL, DXF, FXG, XAML(?), CANVAS, ?

3. SVG (XML) low level code: src/xml/repr-io.h


To do:

1. Move all file related code here (other than extensions).
2. Move extension input/output code into subdirectories within src/extensions/internal and share/extensions.
3. Separate out creating a document and creating a document window. The former belongs here, the later in src/ui.
4. Use std::string for all file names and use glibmm file utilities.
5. Use Glib::ustring for URI's and use Inkscape's URI utilities (if not available in glibmm).
6. Rewrite file export code to share a common base and to allow easy export of objects. Should be Gio::Action based.
   Things like cropping, selecting an object, hiding other objects, etc. should be done before the document is passed
   to the file type specific export code. This way, we can use the same export options for all file types (where they
   make sense). Only type specific options (e.g. PS Level) should be handled by the type specific code.


Files to move here:
  src/util/ziptool.h     (used by ODF, note SVG uses Inkscape::IO::GzipInputStream, can that be used instead?).
  src/helper/png-write.h
