GtexUtils

GtexUtils — Utility functions

Functions

Includes

#include <gtex.h>

Description

Various utility functions.

Functions

gtex_utils_char_is_escaped ()

gboolean
gtex_utils_char_is_escaped (const gchar *str,
                            gsize char_index);

Parameters

str

a UTF-8 string.

 

char_index

index of the character within str .

 

Returns

whether the character is escaped according to the TeX rules.


gtex_utils_get_relative_path ()

gchar *
gtex_utils_get_relative_path (GFile *origin,
                              gboolean origin_is_a_directory,
                              GFile *target);

Parameters

origin

a GFile.

 

origin_is_a_directory

whether origin is a directory.

 

target

a GFile.

 

Returns

the relative path that goes from origin to target . Can be NULL if the two files do not belong to the same filesystem hierarchy.

[transfer full][nullable]


gtex_utils_file_is_a_tex_file ()

gboolean
gtex_utils_file_is_a_tex_file (GFile *file);

Parameters

file

a GFile.

 

Returns

whether file has the ".tex" extension.


gtex_utils_show_uri ()

void
gtex_utils_show_uri (GtkWidget *widget,
                     const gchar *uri,
                     guint32 timestamp,
                     GError **error);

Shows the uri . If the URI is a PDF file and if Evince is the default document viewer, this function also connects the Evince window so the backward search works (switch from the PDF to the source file).

Parameters

widget

the associated GtkWidget, or NULL.

[nullable]

uri

the URI to show.

 

timestamp

a timestamp.

 

error

a NULL GError, or NULL.

[out][optional]

gtex_utils_migrate_settings ()

void
gtex_utils_migrate_settings (void);

Migrates the GSettings values and user data/config files from LaTeXila and GNOME LaTeX to Enter TeX, so that users don't lose all their settings.

TODO in >= 2032: delete this code.