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:
87
plugins/gallery/init.cpp
Executable file
87
plugins/gallery/init.cpp
Executable file
@@ -0,0 +1,87 @@
|
||||
/*
|
||||
* 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.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");
|
||||
}
|
||||
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user