added a new plugin: "gallery"
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@716 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
90
plugins/gallery/gallery.cpp
Executable file
90
plugins/gallery/gallery.cpp
Executable file
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
* This file is a part of Winix
|
||||
* and is not publicly distributed
|
||||
*
|
||||
* Copyright (c) 2011, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "gallery.h"
|
||||
|
||||
|
||||
|
||||
namespace Gallery
|
||||
{
|
||||
|
||||
Gallery::Gallery()
|
||||
{
|
||||
fun.url = L"gallery";
|
||||
}
|
||||
|
||||
|
||||
void Gallery::SetGalleryInfo(GalleryInfo * pinfo)
|
||||
{
|
||||
gallery_info = pinfo;
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool Gallery::HasAccess()
|
||||
{
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Gallery::CreatePointers()
|
||||
{
|
||||
gallery_info->item_sort_tab.resize(gallery_info->item_tab.size());
|
||||
|
||||
for(size_t i=0 ; i<gallery_info->item_tab.size() ; ++i)
|
||||
gallery_info->item_sort_tab[i] = &gallery_info->item_tab[i];
|
||||
}
|
||||
|
||||
|
||||
void Gallery::SortPointers()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
void Gallery::MakeGetDir()
|
||||
{
|
||||
iq.SetAll(false, false);
|
||||
iq.sel_parent_id = true;
|
||||
iq.sel_subject = true;
|
||||
iq.sel_url = true;
|
||||
iq.sel_type = true;
|
||||
iq.sel_file = true;
|
||||
|
||||
iq.WhereParentId(cur->request->dir_tab.back()->id);
|
||||
iq.WhereFileType(WINIX_ITEM_FILETYPE_IMAGE);
|
||||
|
||||
db->GetItems(gallery_info->item_tab, iq);
|
||||
CreatePointers();
|
||||
}
|
||||
|
||||
|
||||
void Gallery::MakeGetFile()
|
||||
{
|
||||
gallery_info->item_sort_tab.resize(1);
|
||||
gallery_info->item_sort_tab[0] = &cur->request->item;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Gallery::MakeGet()
|
||||
{
|
||||
if( cur->request->is_item )
|
||||
MakeGetFile();
|
||||
else
|
||||
MakeGetDir();
|
||||
|
||||
SortPointers();
|
||||
}
|
||||
|
||||
|
||||
|
||||
} // namespace
|
||||
Reference in New Issue
Block a user