2 /* $Id: fontset.ccg,v 1.5 2006/05/11 11:40:24 murrayc Exp $ */
6 * Copyright 2001 The gtkmm Development Team
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Library General Public License for more details.
18 * You should have received a copy of the GNU Library General Public
19 * License along with this library; if not, write to the Free
20 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 static gboolean fontset_foreach_callback(PangoFontset* /* fontset */, PangoFont* font, gpointer data)
25 #ifdef GLIBMM_EXCEPTIONS_ENABLED
28 #endif //GLIBMM_EXCEPTIONS_ENABLED
29 Pango::Fontset::ForeachSlot& slot = *static_cast<Pango::Fontset::ForeachSlot*>(data);
30 Glib::RefPtr<Pango::Font> cppFont = Glib::wrap(font, true /* take_copy */);
33 #ifdef GLIBMM_EXCEPTIONS_ENABLED
37 Glib::exception_handlers_invoke();
40 return false; //arbitrary default
41 #endif //GLIBMM_EXCEPTIONS_ENABLED
48 void Fontset::foreach(const ForeachSlot& slot)
50 pango_fontset_foreach(gobj(), &fontset_foreach_callback, (void*)&slot);