Back to index

unity  6.0.0
HudIcon.h
Go to the documentation of this file.
00001 // -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
00002 /*
00003  * Copyright (C) 2010 Canonical Ltd
00004  *
00005  * This program is free software: you can redistribute it and/or modify
00006  * it under the terms of the GNU General Public License version 3 as
00007  * published by the Free Software Foundation.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00016  *
00017  * Authored by: Gord Allott <gord.allott@canonical.com>
00018  *
00019  */
00020 
00021 #ifndef HUDICON_H
00022 #define HUDICON_H
00023 
00024 #include "unity-shared/IconTexture.h"
00025 #include "HudIconTextureSource.h"
00026 #include "unity-shared/IconRenderer.h"
00027 #include "unity-shared/Introspectable.h"
00028 
00029 namespace unity
00030 {
00031 namespace hud
00032 {
00033 
00034 class Icon : public unity::IconTexture
00035 {
00036 public:
00037   typedef nux::ObjectPtr<Icon> Ptr;
00038   Icon();
00039 
00040   void SetIcon(std::string const& icon_name, unsigned int icon_size, unsigned int tile_size);
00041 
00042 protected:
00043   void Draw(nux::GraphicsEngine& GfxContext, bool force_draw);
00044 
00045   std::string GetName() const;
00046 
00047 private:
00048   nux::ObjectPtr<nux::BaseTexture> background_;
00049   nux::ObjectPtr<nux::BaseTexture> gloss_;
00050   nux::ObjectPtr<nux::BaseTexture> edge_;
00051   nux::ObjectPtr<HudIconTextureSource> icon_texture_source_;
00052   unity::ui::IconRenderer icon_renderer_;
00053 };
00054 
00055 }
00056 
00057 }
00058 
00059 #endif /* HUDICON_H */