File: pps-document-fonts.c

package info (click to toggle)
papers 49.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 21,044 kB
  • sloc: ansic: 37,728; sh: 197; xml: 127; makefile: 113
file content (63 lines) | stat: -rw-r--r-- 1,628 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// SPDX-License-Identifier: GPL-2.0-or-later
/* pps-document-fonts.h
 *  this file is part of papers, a gnome document_fonts viewer
 *
 * Copyright (C) 2004 Red Hat, Inc.
 *
 * Author:
 *   Marco Pesenti Gritti <mpg@redhat.com>
 */

#include "config.h"

#include "pps-document-fonts.h"

G_DEFINE_INTERFACE (PpsDocumentFonts, pps_document_fonts, 0)

static void
pps_document_fonts_default_init (PpsDocumentFontsInterface *klass)
{
}

/**
 * pps_document_fonts_scan:
 * @document_fonts: a #PpsDocument which implements the #PpsDocumentFonts
 * interface
 *
 * Runs through the slow process of finding the fonts being used in a document.
 * To get the results of the scan, use pps_document_fonts_fill_model and
 * pps_document_fonts_get_fonts_summary
 */
void
pps_document_fonts_scan (PpsDocumentFonts *document_fonts)
{
	PpsDocumentFontsInterface *iface = PPS_DOCUMENT_FONTS_GET_IFACE (document_fonts);

	iface->scan (document_fonts);
}

/**
 * pps_document_fonts_get_model:
 * @document_fonts: a #PpsDocument which implements the #PpsDocumentFonts
 * interface
 *
 * Returns: (transfer full): A #GListModel holding #PpsFontDescription objects
 */
GListModel *
pps_document_fonts_get_model (PpsDocumentFonts *document_fonts)
{
	PpsDocumentFontsInterface *iface = PPS_DOCUMENT_FONTS_GET_IFACE (document_fonts);

	return iface->get_model (document_fonts);
}

const gchar *
pps_document_fonts_get_fonts_summary (PpsDocumentFonts *document_fonts)
{
	PpsDocumentFontsInterface *iface = PPS_DOCUMENT_FONTS_GET_IFACE (document_fonts);

	if (!iface->get_fonts_summary)
		return NULL;

	return iface->get_fonts_summary (document_fonts);
}