/* * Copyright (C) 2006 Nikolas Zimmermann * * 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 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 * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. * */ #include "config.h" #include "Icon.h" #include "GraphicsContext.h" #include "DeprecatedString.h" #include "PlatformString.h" #include "IntRect.h" #include "NotImplemented.h" #include #include #include #include namespace WebCore { Icon::Icon() { } Icon::~Icon() { } PassRefPtr Icon::newIconForFile(const String& filename) { Icon *i = new Icon; i->m_icon = QIcon(filename); return PassRefPtr(i); } void Icon::paint(GraphicsContext* ctx, const IntRect& rect) { QPixmap px = m_icon.pixmap(rect.size()); QPainter *p = static_cast(ctx->platformContext()); if (p && !px.isNull()) { p->drawPixmap(rect.x(), rect.y(), px); } } } // vim: ts=4 sw=4 et