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_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_get_dialog_component ()

GtkWidget *
gtex_utils_get_dialog_component (const gchar *title,
                                 GtkWidget *widget);

Like tepl_utils_get_titled_component() but with an additional overall margin on all sides.

TODO: migrate everything to tepl_utils_get_titled_component().

Parameters

title

the title of the dialog component.

 

widget

the widget displayed below the title.

 

Returns

the dialog component containing the title and the widget .

[transfer floating]


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.