1
// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
3
* Copyright (C) 2012 Canonical Ltd
5
* This program is free software: you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License version 3 as
7
* published by the Free Software Foundation.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
* Authored by: Jason Smith <jason.smith@canonical.com>
18
* Authored by: Jay Taoko <jay.taoko@canonical.com>
21
const char* movie_list[] = {
78
#include "Nux/HLayout.h"
80
#include "NuxGraphics/GraphicsDisplay.h"
81
#include "NuxGraphics/GLShader.h"
82
#include "NuxGraphics/GpuDevice.h"
83
#include "NuxGraphics/GLDeviceObjects.h"
84
#include "NuxGraphics/GLShader.h"
85
#include "NuxGraphics/GraphicsEngine.h"
87
#include "Nux/Coverflow.h"
88
#include "Nux/CoverflowItem.h"
94
class BasicCoverflowItem : public CoverflowItem
97
BasicCoverflowItem(std::string const& name, std::string const& filename);
98
ObjectPtr<BaseTexture> GetTexture() const;
101
ObjectPtr<BaseTexture> texture_;
104
BasicCoverflowItem::BasicCoverflowItem(std::string const& name,
105
std::string const& filename)
106
: CoverflowItem(name)
108
texture_.Adopt(LoadTextureFromFile(filename));
111
ObjectPtr<BaseTexture> BasicCoverflowItem::GetTexture() const
118
void CoverflowThread(nux::NThread* thread, void* InitData)
120
nux::Coverflow* coverflow = new nux::Coverflow();
122
coverflow->true_perspective = false;
123
coverflow->folding_angle = 45;
124
coverflow->reflection_size = 0.5f;
125
coverflow->show_reflection = true;
126
nux::HLayout* main_layout(new nux::HLayout(NUX_TRACKER_LOCATION));
127
main_layout->AddView(coverflow, 1, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FULL);
129
static_cast<nux::WindowThread*>(thread)->SetLayout(main_layout);
132
nux::CoverflowModel::Ptr model = coverflow->model();
133
std::string base_path = PKGDATADIR"/UITextures/";
134
while(movie_list[i] != NULL)
136
std::string name = "Nux The Movie";
137
std::string movie_path = base_path + movie_list[i];
138
nux::CoverflowItem::Ptr item(new nux::BasicCoverflowItem(name, movie_path));
139
model->AddItem(item);
146
nux::NuxInitialize(0);
148
std::unique_ptr<nux::WindowThread> wt(nux::CreateGUIThread("CoverFlow", 1100, 480, 0, &CoverflowThread, 0));