91 lines
1.7 KiB
C++
Executable File
91 lines
1.7 KiB
C++
Executable File
/*
|
|
* This file is a part of Winix
|
|
* and is not publicly distributed
|
|
*
|
|
* Copyright (c) 2011, Tomasz Sowa
|
|
* All rights reserved.
|
|
*
|
|
*/
|
|
|
|
#include "gallery.h"
|
|
#include "core/log.h"
|
|
#include "core/plugin.h"
|
|
|
|
|
|
|
|
extern "C" void Init(PluginInfo &);
|
|
|
|
|
|
|
|
|
|
namespace Gallery
|
|
{
|
|
Gallery fun_gallery;
|
|
GalleryInfo gallery_info;
|
|
|
|
|
|
const wchar_t plugin_name[] = L"gallery";
|
|
|
|
|
|
|
|
|
|
void AddFunctions(PluginInfo & info)
|
|
{
|
|
info.functions->Add(fun_gallery);
|
|
}
|
|
|
|
|
|
void SelectDefaultFunction(PluginInfo & info)
|
|
{
|
|
if( !info.cur->request->is_item && info.system->mounts.pmount->type == gallery_info.mount_type_gallery )
|
|
info.cur->request->function = &fun_gallery;
|
|
}
|
|
|
|
|
|
void AddMounts(PluginInfo & info)
|
|
{
|
|
Mounts & m = info.system->mounts;
|
|
|
|
gallery_info.mount_type_gallery = m.AddMountType(L"gallery");
|
|
|
|
gallery_info.mount_par_gallery = m.AddMountPar(L"gallery");
|
|
gallery_info.mount_par_gallery_size = m.AddMountPar(L"gallery_size");
|
|
gallery_info.mount_par_gallery_type = m.AddMountPar(L"gallery_type");
|
|
gallery_info.mount_par_gallery_theme = m.AddMountPar(L"gallery_theme");
|
|
}
|
|
|
|
|
|
void EndRequest(PluginInfo & info)
|
|
{
|
|
gallery_info.Clear();
|
|
}
|
|
|
|
|
|
|
|
void AddEzcFunctions(PluginInfo & info);
|
|
|
|
} // namespace
|
|
|
|
|
|
|
|
|
|
|
|
void Init(PluginInfo & info)
|
|
{
|
|
using namespace Gallery;
|
|
|
|
plugin.Assign(WINIX_CREATE_FUNCTIONS, AddFunctions);
|
|
plugin.Assign(WINIX_SELECT_DEFAULT_FUNCTION, SelectDefaultFunction);
|
|
plugin.Assign(WINIX_ADD_MOUNTS, AddMounts);
|
|
plugin.Assign(WINIX_TEMPLATES_CREATEFUNCTIONS, AddEzcFunctions);
|
|
plugin.Assign(WINIX_END_REQUEST, EndRequest);
|
|
|
|
gallery_info.plugin_id = info.plugin_id;
|
|
|
|
fun_gallery.SetGalleryInfo(&gallery_info);
|
|
|
|
info.p1 = (void*)(plugin_name);
|
|
}
|
|
|
|
|