File: PangoFontset.xs

package info (click to toggle)
libpango-perl 1.227-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 572 kB
  • sloc: perl: 1,116; ansic: 35; makefile: 9
file content (87 lines) | stat: -rw-r--r-- 2,552 bytes parent folder | download | duplicates (4)
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/*
 * Copyright (c) 2003, 2014 by the gtk2-perl team (see the AUTHORS
 * file for a full list of authors)
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 *
 * See the LICENSE file in the top-level directory of this distribution for
 * the full license terms.
 *
 */

#include "pango-perl.h"

#if PANGO_CHECK_VERSION (1, 4, 0)

static GPerlCallback *
gtk2perl_pango_fontset_foreach_func_create (SV *func, SV *data)
{
	GType param_types[2];
	param_types[0] = PANGO_TYPE_FONTSET;
	param_types[1] = PANGO_TYPE_FONT;
	return gperl_callback_new (func, data, G_N_ELEMENTS (param_types),
	                           param_types, G_TYPE_BOOLEAN);
}

static gboolean
gtk2perl_pango_fontset_foreach_func (PangoFontset *fontset, PangoFont *font, GPerlCallback *callback)
{
	GValue value = {0,};
	gboolean retval;

	g_value_init (&value, callback->return_type);
	gperl_callback_invoke (callback, &value, fontset, font);
	retval = g_value_get_boolean (&value);
	g_value_unset (&value);

	return retval;
}

#endif /* 1.4.0 */

MODULE = Pango::Fontset	PACKAGE = Pango::Fontset	PREFIX = pango_fontset_

=for object Pango::Fontset - object containing a set of Pango::Font objects

=cut

BOOT:
	gperl_object_set_no_warn_unreg_subclass (PANGO_TYPE_FONTSET, TRUE);

##  PangoFont * pango_fontset_get_font (PangoFontset *fontset, guint wc) 
PangoFont *
pango_fontset_get_font (fontset, wc)
	PangoFontset *fontset
	guint wc

##  PangoFontMetrics *pango_fontset_get_metrics (PangoFontset *fontset) 
PangoFontMetrics *
pango_fontset_get_metrics (fontset)
	PangoFontset *fontset

#if PANGO_CHECK_VERSION (1, 4, 0)

##  void pango_fontset_foreach (PangoFontset *fontset, PangoFontsetForeachFunc func, gpointer data) 
void
pango_fontset_foreach (fontset, func, data=NULL)
	PangoFontset *fontset
	SV *func
	SV *data
    PREINIT:
	GPerlCallback *callback;
    CODE:
	callback = gtk2perl_pango_fontset_foreach_func_create (func, data);
	pango_fontset_foreach (fontset,
	                       (PangoFontsetForeachFunc)
	                         gtk2perl_pango_fontset_foreach_func,
	                       callback);
	gperl_callback_destroy (callback);

#endif /* 1.4.0 */