/* Copyright (C) 1998-2002 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 #include namespace Gtk { Gdk::RGBA StyleContext::get_color(StateFlags state) const { GdkRGBA crgba; gtk_style_context_get_color(const_cast(gobj()), ((GtkStateFlags)(state)), &crgba); return Gdk::RGBA(&crgba, true); } _DEPRECATE_IFDEF_START G_GNUC_BEGIN_IGNORE_DEPRECATIONS Gdk::RGBA StyleContext::get_background_color(StateFlags state) const { GdkRGBA crgba; gtk_style_context_get_background_color(const_cast(gobj()), ((GtkStateFlags)(state)), &crgba); return Gdk::RGBA(&crgba, true); } Gdk::RGBA StyleContext::get_border_color(StateFlags state) const { GdkRGBA crgba; gtk_style_context_get_border_color(const_cast(gobj()), ((GtkStateFlags)(state)), &crgba); return Gdk::RGBA(&crgba, true); } G_GNUC_END_IGNORE_DEPRECATIONS _DEPRECATE_IFDEF_END Pango::FontDescription StyleContext::get_font(StateFlags state) const { // gtk_style_context_get_font() is deprecated. PangoFontDescription* description = nullptr; gtk_style_context_get(const_cast(gobj()), (GtkStateFlags)state, "font", &description, NULL); // gtk_style_context_get() returns a newly allocated font description, owned by the caller. return Glib::wrap(description, false); } Border StyleContext::get_border(StateFlags state) const { GtkBorder cborder; gtk_style_context_get_border(const_cast(gobj()), ((GtkStateFlags)(state)), &cborder); return Border(&cborder, true); } Border StyleContext::get_padding(StateFlags state) const { GtkBorder cborder; gtk_style_context_get_padding(const_cast(gobj()), ((GtkStateFlags)(state)), &cborder); return Border(&cborder, true); } Border StyleContext::get_margin(StateFlags state) const { GtkBorder cborder; gtk_style_context_get_margin(const_cast(gobj()), ((GtkStateFlags)(state)), &cborder); return Border(&cborder, true); } void StyleContext::unset_parent() { gtk_style_context_set_parent(gobj(), nullptr); } } // namespace Gtk