| 1 |
/* font-manager-font-info.c |
| 2 |
* |
| 3 |
* Copyright (C) 2009-2023 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 |
#include "font-manager-font-info.h" |
| 22 |
|
| 23 |
/** |
| 24 |
* SECTION: font-manager-font-info |
| 25 |
* @short_description: Font metadata |
| 26 |
* @title: Font Info |
| 27 |
* @include: font-manager-font-info.h |
| 28 |
* @see_also: #FontManagerJsonProxy |
| 29 |
* |
| 30 |
* #FontManagerFontInfo holds detailed metadata for a single font. |
| 31 |
* |
| 32 |
* The #JsonObject backing this class should have the following structure: |
| 33 |
* |
| 34 |
* |[ |
| 35 |
* { |
| 36 |
* "filepath" : string, |
| 37 |
* "findex" : int, |
| 38 |
* "family" : string, |
| 39 |
* "style" : string, |
| 40 |
* "owner" : int, |
| 41 |
* "psname" : string, |
| 42 |
* "filetype" : string, |
| 43 |
* "n-glyphs" : int, |
| 44 |
* "copyright" : string, |
| 45 |
* "version" : string, |
| 46 |
* "description" : string, |
| 47 |
* "license-data" : string, |
| 48 |
* "license-url" : string, |
| 49 |
* "vendor" : string, |
| 50 |
* "designer" : string, |
| 51 |
* "designer-url" : string, |
| 52 |
* "license-type" : string, |
| 53 |
* "fsType" : int, |
| 54 |
* "filesize" : string, |
| 55 |
* "checksum" : string, |
| 56 |
* "panose": [ ], |
| 57 |
* } |
| 58 |
* ]| |
| 59 |
* |
| 60 |
* panose is a #JsonArray of integers |
| 61 |
*/ |
| 62 |
|
| 63 |
struct _FontManagerFontInfo |
| 64 |
{ |
| 65 |
FontManagerJsonProxy parent; |
| 66 |
}; |
| 67 |
|
| 68 |
G_DEFINE_TYPE(FontManagerFontInfo, font_manager_font_info, FONT_MANAGER_TYPE_JSON_PROXY) |
| 69 |
|
| 70 |
static void |
| 71 |
font_manager_font_info_class_init (FontManagerFontInfoClass *klass) |
| 72 |
{ |
| 73 |
GObjectClass *object_class = G_OBJECT_CLASS(klass); |
| 74 |
GObjectClass *parent_class = G_OBJECT_CLASS(font_manager_font_info_parent_class); |
| 75 |
FontManagerJsonProxyClass *proxy_class = FONT_MANAGER_JSON_PROXY_CLASS(klass); |
| 76 |
object_class->get_property = parent_class->get_property; |
| 77 |
object_class->set_property = parent_class->set_property; |
| 78 |
proxy_class->properties = InfoProperties; |
| 79 |
proxy_class->n_properties = G_N_ELEMENTS(InfoProperties); |
| 80 |
font_manager_json_proxy_install_properties(proxy_class); |
| 81 |
return; |
| 82 |
} |
| 83 |
|
| 84 |
static void |
| 85 |
font_manager_font_info_init (FontManagerFontInfo *self) |
| 86 |
{ |
| 87 |
g_return_if_fail(self != NULL); |
| 88 |
} |
| 89 |
|
| 90 |
/** |
| 91 |
* font_manager_font_info_new: |
| 92 |
* |
| 93 |
* Returns: (transfer full): A newly created #FontManagerFontInfo. |
| 94 |
* Free the returned object using #g_object_unref(). |
| 95 |
*/ |
| 96 |
FontManagerFontInfo * |
| 97 |
font_manager_font_info_new (void) |
| 98 |
{ |
| 99 |
return g_object_new(FONT_MANAGER_TYPE_FONT_INFO, NULL); |
| 100 |
} |