Back to index

unity  6.0.0
ResultRendererHorizontalTile.h
Go to the documentation of this file.
00001 // -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
00002 /*
00003  * Copyright 2011 Canonical Ltd.
00004  *
00005  * This program is free software: you can redistribute it and/or modify it
00006  * under the terms of the GNU Lesser 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, but
00010  * WITHOUT ANY WARRANTY; without even the implied warranties of
00011  * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
00012  * PURPOSE.  See the applicable version of the GNU Lesser General Public
00013  * License for more details.
00014  *
00015  * You should have received a copy of both the GNU Lesser General Public
00016  * License version 3 along with this program.  If not, see
00017  * <http://www.gnu.org/licenses/>
00018  *
00019  * Authored by: Gordon Allott <gord.allott@canonical.com>
00020  *
00021  */
00022 
00023 
00024 
00025 #ifndef RESULTRENDERERHORIZONTALTILE_H
00026 #define RESULTRENDERERHORIZONTALTILE_H
00027 
00028 #include <Nux/Nux.h>
00029 #include <NuxCore/Object.h>
00030 #include <NuxCore/Property.h>
00031 #include <Nux/TextureArea.h>
00032 #include <NuxGraphics/CairoGraphics.h>
00033 
00034 #include "ResultRendererTile.h"
00035 
00036 namespace unity
00037 {
00038 namespace dash
00039 {
00040 
00041 // Initially unowned object
00042 class ResultRendererHorizontalTile : public ResultRendererTile
00043 {
00044 public:
00045   NUX_DECLARE_OBJECT_TYPE(ResultRendererHorizontalTile, ResultRendererTile);
00046 
00047   ResultRendererHorizontalTile(NUX_FILE_LINE_PROTO);
00048   ~ResultRendererHorizontalTile();
00049 
00050   virtual void Render(nux::GraphicsEngine& GfxContext,
00051                       Result& row,
00052                       ResultRendererState state,
00053                       nux::Geometry& geometry,
00054                       int x_offset, int y_offset);
00055 
00056 protected:
00057   virtual void LoadText(Result& row);
00058 
00059 private:
00060   nux::BaseTexture* DrawHighlight(std::string const& texid,
00061                                   int width, int height);
00062   nux::BaseTexture* DrawNormal(std::string const& texid,
00063                                   int width, int height);
00064 };
00065 
00066 }
00067 }
00068 #endif // RESULTRENDERERHORIZONTALTILE_H