/* Copyright (C) 2003 The gtkmm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser 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 GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see .
*/
#include
#include //For gtk_icon_theme_error_get_type().
namespace Gtk
{
void IconTheme::set_search_path(const std::vector& path)
{
gtk_icon_theme_set_search_path(gobj(), const_cast(Glib::ArrayHandler::vector_to_array(path).data ()), path.size());
}
std::vector IconTheme::get_search_path() const
{
int temp_int = 0;
gchar** temp_path = nullptr;
gtk_icon_theme_get_search_path(const_cast(gobj()), &temp_path, &temp_int);
return Glib::ArrayHandler::array_to_vector(temp_path, temp_int, Glib::OWNERSHIP_DEEP);
}
std::vector IconTheme::get_icon_sizes(const Glib::ustring& icon_name) const
{
int* pArrayInts = gtk_icon_theme_get_icon_sizes(const_cast(gobj()), icon_name.c_str());
//pArrayInts is null-terminated.
return Glib::ArrayHandler::array_to_vector(pArrayInts, Glib::OWNERSHIP_SHALLOW);
}
std::vector IconTheme::list_icons() const
{
return Glib::ListHandler::list_to_vector(gtk_icon_theme_list_icons(const_cast(gobj()), nullptr /* means all icons according to the C documentation. */ ), Glib::OWNERSHIP_DEEP);
}
} // namespace Gtk