Top |
LatexilaTemplatesDefault implements GtkTreeModel, GtkTreeDragSource, GtkTreeDragDest, GtkTreeSortable and GtkBuildable.
LatexilaTemplatesDefault is a singleton class that stores information about default templates. In GNOME LaTeX, new documents are created from templates. There are a few default templates available, and personal templates can be created (see LatexilaTemplatesPersonal).
Each LaTeX user has probably different needs, and has a different set of templates. So it's better to keep a short list of default templates. It would be useless to have a hundred default templates, since anyway they would most probably not fit many users. For example each user has a different preamble, with different packages, configured differently, etc.
In the git repository, default templates are located in the data/templates/ directory. The templates are stored in XML format, with some chunks that are translatable or not. For example the babel package (or equivalent) is added to the preamble when GNOME LaTeX is run in another language than English (and if a translation is available for that other language). Also, the letter template can be completely translated, using even a different document class that is more suitable for the target language.
LatexilaTemplatesDefault *
latexila_templates_default_get_instance
(void
);
Gets the instance of the LatexilaTemplatesDefault singleton.
gchar * latexila_templates_default_get_contents (LatexilaTemplatesDefault *templates
,GtkTreePath *path
);
Gets the contents of a default template.
TODO load contents asynchronously.
templates |
the LatexilaTemplatesDefault instance. |
|
path |
the GtkTreePath of a default template. |