Debian Codegraph @

lib/common/font-manager-utils.h

raw
1 /* font-manager-utils.h
2 *
3 * Copyright (C) 2009-2025 Jerry Casiano
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program.
17 *
18 * If not, see <http://www.gnu.org/licenses/gpl-3.0.txt>.
19 */
20
21 #pragma once
22
23 #include "config.h"
24
25 #include <glib/gi18n-lib.h>
26 #include <locale.h>
27 #include <unistd.h>
28 #include <glib.h>
29 #include <glib/gprintf.h>
30 #include <glib/gstdio.h>
31 #include <gio/gio.h>
32
33 #include <fontconfig/fontconfig.h>
34 #include <freetype/freetype.h>
35 #include <gtk/gtk.h>
36 #include <hb.h>
37 #include <json-glib/json-glib.h>
38 #include <pango/pango.h>
39 #include <libxml/xmlversion.h>
40 #include <sqlite3.h>
41
42 #include "font-manager-freetype.h"
43 #include "font-manager-string-set.h"
44
45 #define FONT_MANAGER_TMP_TMPL "font-manager_XXXXXX"
46
47 /**
48 * FontManagerObjectProperty:
49 * @name: Property name
50 * @type: #GType of property
51 * @desc: Description of property
52 *
53 * This struct contains the bare minimum amount of information necessary to
54 * programmatically construct a GObject property.
55 */
56 typedef struct _ObjectProperty
57 {
58 const gchar *name;
59 const GType type;
60 const gchar *desc;
61 }
62 FontManagerObjectProperty;
63
64 void font_manager_setup_i18n (void);
65 void font_manager_print_os_info (void);
66 void font_manager_print_library_versions (void);
67 gint font_manager_get_file_owner (const gchar *filepath);
68 gint font_manager_natural_sort (const gchar *str1, const gchar *str2) G_GNUC_PURE;
69 gint font_manager_timecmp (GFile *file_a, GFile *file_b);
70 gboolean font_manager_exists (const gchar *filepath);
71 gboolean font_manager_is_dir (const gchar *filepath);
72 gboolean font_manager_install_file (GFile *file, GFile *directory, GError **error);
73 gchar * font_manager_get_file_extension (const gchar *filepath) G_GNUC_PURE;
74 gchar * font_manager_get_local_time (void);
75 gchar * font_manager_get_user_font_directory (void);
76 gchar * font_manager_get_package_cache_directory (void);
77 gchar * font_manager_get_package_config_directory (void);
78 gchar * font_manager_get_user_fontconfig_directory (void);
79 gchar * font_manager_str_replace (const gchar *str, const gchar *target, const gchar *replacement) G_GNUC_PURE;
80 gchar * font_manager_to_filename (const gchar *str) G_GNUC_PURE;
81 GSettings * font_manager_get_gsettings (const gchar *schema_id);
82 void font_manager_free_gsettings ();
83 FontManagerStringSet * font_manager_get_command_line_files (GApplicationCommandLine *cmdline);
84