Back to index

nux  3.0.0
Coverflow.h
Go to the documentation of this file.
00001 // -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
00002 /*
00003  * Copyright (C) 2012 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 #ifndef COVERFLOWVIEW_H
00021 #define COVERFLOWVIEW_H
00022 
00023 #include "Nux/ClientArea.h"
00024 #include "NuxCore/Math/Vector4.h"
00025 #include "CoverflowModel.h"
00026 
00027 #if defined(NUX_OS_WINDOWS)
00028   #define PKGDATADIR "../../data/"
00029 #endif
00030 
00031 namespace nux
00032 {
00033   class Coverflow: public nux::ClientArea
00034   {
00035     NUX_DECLARE_OBJECT_TYPE(Coverflow, ClientArea);
00036   public:
00037     Coverflow();
00038     ~Coverflow();
00039 
00040     Property<unsigned int> animation_length;
00041 
00042     Property<float> camera_motion_drift_angle;
00043     
00044     Property<bool> camera_motion_drift_enabled;
00045 
00046     Property<float> edge_fade;
00047 
00048     Property<int> flat_icons;
00049     
00050     Property<float> folding_angle;
00051 
00052     Property<float> folding_depth;
00053 
00054     Property<float> folding_rate;
00055 
00056     Property<float> fov;
00057 
00058     Property<float> kinetic_scroll_rate;
00059 
00060     Property<float> mouse_drag_rate;
00061 
00062     Property<float> pinching;
00063 
00064     Property<bool> pop_out_selected;
00065 
00066     Property<float> reflection_fadeout_distance;
00067     
00068     Property<float> reflection_strength;
00069 
00070     Property<float> space_between_icons;
00071 
00072     Property<CoverflowModel::Ptr> model;
00073 
00074     Property<bool> show_labels;
00075 
00076     Property<bool> show_drop_shadow;
00077     
00078     Property<bool> show_reflection;
00079 
00080     Property<bool> true_perspective;
00081 
00082     Property<float> y_offset;
00083 
00084     Property<float> reflection_size;
00085 
00086     bool AcceptKeyNavFocus();
00087 
00088     void SetCameraDistance(float distance);
00089 
00090     float ViewportWidthAtDepth(float depth);
00091     float ViewportHeightAtDepth(float depth);
00092   protected:
00093     virtual bool InspectKeyEvent(unsigned int eventType, unsigned int keysym, const char* character);
00094     virtual void ClientDraw(nux::GraphicsEngine& graphics_engine, nux::DrawAreaContext &ctx, bool force_draw);
00095 
00096   private:
00097     struct Impl;
00098     Impl* pimpl;
00099   };
00100 }
00101 
00102 #endif // COVERFLOWVIEW_H
00103