Back to index

unity  6.0.0
IconTextureSource.h
Go to the documentation of this file.
00001 // -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
00002 /*
00003  * Copyright (C) 2011 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: Jason Smith <jason.smith@canonical.com>
00018  *
00019  */
00020 
00021 #ifndef ICONTEXTURESOURCE_H
00022 #define ICONTEXTURESOURCE_H
00023 
00024 #include <Nux/Nux.h>
00025 #include <NuxCore/Property.h>
00026 #include <NuxCore/Math/MathInc.h>
00027 
00028 namespace unity
00029 {
00030 namespace ui
00031 {
00032 
00033 class IconTextureSource : public nux::InitiallyUnownedObject
00034 {
00035   NUX_DECLARE_OBJECT_TYPE(IconTextureSource, nux::InitiallyUnownedObject);
00036 public:
00037   typedef nux::ObjectPtr<IconTextureSource> Ptr;
00038 
00039   enum TransformIndex
00040   {
00041     TRANSFORM_TILE,
00042     TRANSFORM_IMAGE,
00043     TRANSFORM_HIT_AREA,
00044     TRANSFORM_GLOW,
00045     TRANSFORM_EMBLEM,
00046   };
00047 
00048   IconTextureSource();
00049 
00050   std::vector<nux::Vector4> & GetTransform(TransformIndex index, int monitor);
00051 
00052   virtual nux::Color BackgroundColor() const = 0;
00053 
00054   virtual nux::Color GlowColor() = 0;
00055 
00056   virtual nux::BaseTexture* TextureForSize(int size) = 0;
00057 
00058   virtual nux::BaseTexture* Emblem() = 0;
00059 
00060 private:
00061   std::vector<std::map<TransformIndex, std::vector<nux::Vector4> > > transform_map;
00062 };
00063 
00064 }
00065 }
00066 
00067 #endif // LAUNCHERICON_H
00068