2
* Copyright (C) 2007 Andy Wingo <wingo at pobox dot com>
4
* pango-support.c: Support routines for the Pango wrapper
6
* This program is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU General Public License as
8
* published by the Free Software Foundation; either version 2 of
9
* the License, or (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, contact:
19
* Free Software Foundation Voice: +1-617-542-5942
20
* 59 Temple Place - Suite 330 Fax: +1-617-542-2652
21
* Boston, MA 02111-1307, USA gnu@gnu.org
25
#include "guile-gnome-gobject.h"
27
#include "pango-support.h"
30
scm_pango_rectangle_to_scm (PangoRectangle *rect)
32
SCM ret = scm_c_make_vector (4, SCM_BOOL_F);
34
scm_vector_set_x (ret, SCM_MAKINUM(0), scm_int2num (rect->x));
35
scm_vector_set_x (ret, SCM_MAKINUM(1), scm_int2num (rect->y));
36
scm_vector_set_x (ret, SCM_MAKINUM(2), scm_int2num (rect->width));
37
scm_vector_set_x (ret, SCM_MAKINUM(3), scm_int2num (rect->height));
43
scm_scm_to_pango_rectangle (SCM scm, PangoRectangle* rect)
44
#define FUNC_NAME "%scm->pango-rectangle"
46
#define GET_VINT(v,i) \
47
scm_num2int (scm_vector_ref (v, SCM_MAKINUM(i)), 0, FUNC_NAME)
49
rect->x = GET_VINT (scm, 0);
50
rect->y = GET_VINT (scm, 1);
51
rect->width = GET_VINT (scm, 2);
52
rect->height = GET_VINT (scm, 3);