moved winix directories to winixdsubdirectory

git-svn-id: svn://ttmath.org/publicrep/winix/trunk@1028 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2016-03-17 08:26:02 +00:00
parent ed5adb3f23
commit 145efe937c
246 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
include Makefile.o.dep
name = gallery.so
all: $(name)
$(name): $(o)
$(CXX) -shared -Wl,-soname,$(name) -o $(name) $(CXXFLAGS) $(CXXWINIXINCLUDEFLAGS) $(LDFLAGS) *.o
%.o: %.cpp
$(CXX) -c $(CXXFLAGS) $(CXXWINIXINCLUDEFLAGS) $<
depend:
makedepend -Y. $(CXXWINIXINCLUDEFLAGS) -f- *.cpp > Makefile.dep
echo -n "o = " > Makefile.o.dep
ls -1 *.cpp | xargs -I foo echo -n foo " " | sed -E "s/([^\.]*)\.cpp[ ]/\1\.o/g" >> Makefile.o.dep
clean:
rm -f *.o
rm -f *.so
rm -f $(name)
include Makefile.dep

View File

@@ -0,0 +1,252 @@
# DO NOT DELETE
gallery.o: gallery.h ../../../winix/functions/functionbase.h
gallery.o: ../../../winix/core/item.h ../../../pikotools/space/space.h
gallery.o: ../../../pikotools/textstream/types.h
gallery.o: ../../../pikotools/date/date.h ../../../winix/db/db.h
gallery.o: ../../../winix/db/dbbase.h ../../../winix/db/dbconn.h
gallery.o: ../../../winix/db/dbtextstream.h ../../../winix/core/textstream.h
gallery.o: ../../../winix/core/misc.h ../../../winix/core/item.h
gallery.o: ../../../winix/core/requesttypes.h
gallery.o: ../../../pikotools/textstream/textstream.h
gallery.o: ../../../pikotools/convert/convert.h
gallery.o: ../../../pikotools/convert/inttostr.h
gallery.o: ../../../pikotools/membuffer/membuffer.h
gallery.o: ../../../pikotools/textstream/types.h
gallery.o: ../../../pikotools/utf8/utf8.h ../../../winix/core/winix_const.h
gallery.o: ../../../winix/core/error.h ../../../pikotools/space/spaceparser.h
gallery.o: ../../../pikotools/space/space.h ../../../winix/db/dbitemquery.h
gallery.o: ../../../winix/db/dbitemcolumns.h ../../../winix/core/user.h
gallery.o: ../../../winix/core/group.h ../../../winix/core/dircontainer.h
gallery.o: ../../../winix/core/ugcontainer.h ../../../winix/core/log.h
gallery.o: ../../../winix/core/textstream.h
gallery.o: ../../../winix/core/logmanipulators.h ../../../winix/core/slog.h
gallery.o: ../../../winix/core/cur.h ../../../winix/core/request.h
gallery.o: ../../../winix/core/error.h ../../../winix/core/config.h
gallery.o: ../../../winix/core/htmlfilter.h
gallery.o: ../../../winix/templates/htmltextstream.h
gallery.o: ../../../pikotools/space/spacetojson.h
gallery.o: ../../../ezc/src/outstreams.h ../../../winix/core/session.h
gallery.o: ../../../winix/core/user.h ../../../winix/core/plugindata.h
gallery.o: ../../../winix/core/rebus.h ../../../winix/core/ipban.h
gallery.o: ../../../winix/core/mount.h ../../../winix/templates/locale.h
gallery.o: ../../../winix/core/request.h ../../../winix/core/config.h
gallery.o: ../../../winix/core/system.h ../../../winix/core/job.h
gallery.o: ../../../winix/core/basethread.h ../../../winix/core/synchro.h
gallery.o: ../../../winix/core/dirs.h ../../../winix/core/dircontainer.h
gallery.o: ../../../winix/notify/notify.h ../../../winix/notify/notifypool.h
gallery.o: ../../../winix/templates/patterns.h
gallery.o: ../../../winix/templates/locale.h
gallery.o: ../../../winix/templates/localefilter.h ../../../ezc/src/ezc.h
gallery.o: ../../../ezc/src/generator.h ../../../ezc/src/blocks.h
gallery.o: ../../../ezc/src/cache.h ../../../ezc/src/functions.h
gallery.o: ../../../ezc/src/funinfo.h ../../../ezc/src/objects.h
gallery.o: ../../../ezc/src/pattern.h ../../../ezc/src/patternparser.h
gallery.o: ../../../winix/notify/notifythread.h
gallery.o: ../../../winix/core/basethread.h
gallery.o: ../../../winix/notify/templatesnotify.h
gallery.o: ../../../winix/core/users.h ../../../winix/core/ugcontainer.h
gallery.o: ../../../winix/core/lastcontainer.h ../../../winix/core/mounts.h
gallery.o: ../../../winix/core/mountparser.h ../../../winix/core/crypt.h
gallery.o: ../../../winix/core/run.h ../../../winix/core/users.h
gallery.o: ../../../winix/core/groups.h ../../../winix/core/group.h
gallery.o: ../../../winix/core/loadavg.h ../../../winix/core/image.h
gallery.o: ../../../winix/core/threadmanager.h
gallery.o: ../../../winix/core/timezones.h ../../../winix/core/timezone.h
gallery.o: ../../../winix/core/synchro.h galleryinfo.h
galleryinfo.o: galleryinfo.h ../../../winix/core/item.h
galleryinfo.o: ../../../pikotools/space/space.h
galleryinfo.o: ../../../pikotools/textstream/types.h
galleryinfo.o: ../../../pikotools/date/date.h
init.o: gallery.h ../../../winix/functions/functionbase.h
init.o: ../../../winix/core/item.h ../../../pikotools/space/space.h
init.o: ../../../pikotools/textstream/types.h ../../../pikotools/date/date.h
init.o: ../../../winix/db/db.h ../../../winix/db/dbbase.h
init.o: ../../../winix/db/dbconn.h ../../../winix/db/dbtextstream.h
init.o: ../../../winix/core/textstream.h ../../../winix/core/misc.h
init.o: ../../../winix/core/item.h ../../../winix/core/requesttypes.h
init.o: ../../../pikotools/textstream/textstream.h
init.o: ../../../pikotools/convert/convert.h
init.o: ../../../pikotools/convert/inttostr.h
init.o: ../../../pikotools/membuffer/membuffer.h
init.o: ../../../pikotools/textstream/types.h ../../../pikotools/utf8/utf8.h
init.o: ../../../winix/core/winix_const.h ../../../winix/core/error.h
init.o: ../../../pikotools/space/spaceparser.h
init.o: ../../../pikotools/space/space.h ../../../winix/db/dbitemquery.h
init.o: ../../../winix/db/dbitemcolumns.h ../../../winix/core/user.h
init.o: ../../../winix/core/group.h ../../../winix/core/dircontainer.h
init.o: ../../../winix/core/ugcontainer.h ../../../winix/core/log.h
init.o: ../../../winix/core/textstream.h
init.o: ../../../winix/core/logmanipulators.h ../../../winix/core/slog.h
init.o: ../../../winix/core/cur.h ../../../winix/core/request.h
init.o: ../../../winix/core/error.h ../../../winix/core/config.h
init.o: ../../../winix/core/htmlfilter.h
init.o: ../../../winix/templates/htmltextstream.h
init.o: ../../../pikotools/space/spacetojson.h ../../../ezc/src/outstreams.h
init.o: ../../../winix/core/session.h ../../../winix/core/user.h
init.o: ../../../winix/core/plugindata.h ../../../winix/core/rebus.h
init.o: ../../../winix/core/ipban.h ../../../winix/core/mount.h
init.o: ../../../winix/templates/locale.h ../../../winix/core/request.h
init.o: ../../../winix/core/config.h ../../../winix/core/system.h
init.o: ../../../winix/core/job.h ../../../winix/core/basethread.h
init.o: ../../../winix/core/synchro.h ../../../winix/core/dirs.h
init.o: ../../../winix/core/dircontainer.h ../../../winix/notify/notify.h
init.o: ../../../winix/notify/notifypool.h
init.o: ../../../winix/templates/patterns.h ../../../winix/templates/locale.h
init.o: ../../../winix/templates/localefilter.h ../../../ezc/src/ezc.h
init.o: ../../../ezc/src/generator.h ../../../ezc/src/blocks.h
init.o: ../../../ezc/src/cache.h ../../../ezc/src/functions.h
init.o: ../../../ezc/src/funinfo.h ../../../ezc/src/objects.h
init.o: ../../../ezc/src/pattern.h ../../../ezc/src/patternparser.h
init.o: ../../../winix/notify/notifythread.h ../../../winix/core/basethread.h
init.o: ../../../winix/notify/templatesnotify.h ../../../winix/core/users.h
init.o: ../../../winix/core/ugcontainer.h ../../../winix/core/lastcontainer.h
init.o: ../../../winix/core/mounts.h ../../../winix/core/mountparser.h
init.o: ../../../winix/core/crypt.h ../../../winix/core/run.h
init.o: ../../../winix/core/users.h ../../../winix/core/groups.h
init.o: ../../../winix/core/group.h ../../../winix/core/loadavg.h
init.o: ../../../winix/core/image.h ../../../winix/core/threadmanager.h
init.o: ../../../winix/core/timezones.h ../../../winix/core/timezone.h
init.o: ../../../winix/core/synchro.h galleryinfo.h ../../../winix/core/log.h
init.o: ../../../winix/core/plugin.h ../../../winix/core/pluginmsg.h
init.o: ../../../winix/core/system.h ../../../winix/core/sessionmanager.h
init.o: ../../../winix/core/sessioncontainer.h
init.o: ../../../winix/core/ipbancontainer.h
init.o: ../../../winix/core/sessionidmanager.h ../../../tito/src/base64.h
init.o: ../../../tito/src/aes.h ../../../winix/functions/functions.h
init.o: ../../../winix/functions/functionbase.h
init.o: ../../../winix/functions/functionparser.h ../../../winix/core/cur.h
init.o: ../../../winix/functions/account.h ../../../winix/functions/adduser.h
init.o: ../../../winix/functions/cat.h ../../../winix/functions/chmod.h
init.o: ../../../winix/functions/privchanger.h
init.o: ../../../winix/functions/chown.h ../../../winix/functions/ckeditor.h
init.o: ../../../winix/functions/cp.h ../../../winix/functions/default.h
init.o: ../../../winix/functions/download.h ../../../winix/functions/emacs.h
init.o: ../../../winix/functions/env.h ../../../winix/functions/imgcrop.h
init.o: ../../../winix/functions/last.h ../../../winix/functions/login.h
init.o: ../../../winix/functions/logout.h ../../../winix/functions/ln.h
init.o: ../../../winix/functions/ls.h ../../../winix/functions/man.h
init.o: ../../../winix/functions/meta.h ../../../winix/functions/mkdir.h
init.o: ../../../winix/functions/mv.h ../../../winix/functions/nicedit.h
init.o: ../../../winix/functions/node.h ../../../winix/functions/passwd.h
init.o: ../../../winix/functions/priv.h ../../../winix/functions/pw.h
init.o: ../../../winix/functions/reload.h ../../../winix/functions/rm.h
init.o: ../../../winix/functions/rmuser.h ../../../winix/functions/sort.h
init.o: ../../../winix/functions/specialdefault.h
init.o: ../../../winix/functions/stat.h ../../../winix/functions/subject.h
init.o: ../../../winix/functions/template.h
init.o: ../../../winix/functions/tinymce.h ../../../winix/functions/uname.h
init.o: ../../../winix/functions/upload.h ../../../winix/functions/uptime.h
init.o: ../../../winix/functions/who.h ../../../winix/functions/vim.h
init.o: ../../../winix/core/htmlfilter.h ../../../winix/templates/templates.h
init.o: ../../../winix/templates/patterncacher.h
init.o: ../../../winix/templates/indexpatterns.h
init.o: ../../../winix/templates/patterns.h
init.o: ../../../winix/templates/changepatterns.h
init.o: ../../../winix/templates/htmltextstream.h
init.o: ../../../winix/core/sessionmanager.h
templates.o: gallery.h ../../../winix/functions/functionbase.h
templates.o: ../../../winix/core/item.h ../../../pikotools/space/space.h
templates.o: ../../../pikotools/textstream/types.h
templates.o: ../../../pikotools/date/date.h ../../../winix/db/db.h
templates.o: ../../../winix/db/dbbase.h ../../../winix/db/dbconn.h
templates.o: ../../../winix/db/dbtextstream.h
templates.o: ../../../winix/core/textstream.h ../../../winix/core/misc.h
templates.o: ../../../winix/core/item.h ../../../winix/core/requesttypes.h
templates.o: ../../../pikotools/textstream/textstream.h
templates.o: ../../../pikotools/convert/convert.h
templates.o: ../../../pikotools/convert/inttostr.h
templates.o: ../../../pikotools/membuffer/membuffer.h
templates.o: ../../../pikotools/textstream/types.h
templates.o: ../../../pikotools/utf8/utf8.h ../../../winix/core/winix_const.h
templates.o: ../../../winix/core/error.h
templates.o: ../../../pikotools/space/spaceparser.h
templates.o: ../../../pikotools/space/space.h ../../../winix/db/dbitemquery.h
templates.o: ../../../winix/db/dbitemcolumns.h ../../../winix/core/user.h
templates.o: ../../../winix/core/group.h ../../../winix/core/dircontainer.h
templates.o: ../../../winix/core/ugcontainer.h ../../../winix/core/log.h
templates.o: ../../../winix/core/textstream.h
templates.o: ../../../winix/core/logmanipulators.h ../../../winix/core/slog.h
templates.o: ../../../winix/core/cur.h ../../../winix/core/request.h
templates.o: ../../../winix/core/error.h ../../../winix/core/config.h
templates.o: ../../../winix/core/htmlfilter.h
templates.o: ../../../winix/templates/htmltextstream.h
templates.o: ../../../pikotools/space/spacetojson.h
templates.o: ../../../ezc/src/outstreams.h ../../../winix/core/session.h
templates.o: ../../../winix/core/user.h ../../../winix/core/plugindata.h
templates.o: ../../../winix/core/rebus.h ../../../winix/core/ipban.h
templates.o: ../../../winix/core/mount.h ../../../winix/templates/locale.h
templates.o: ../../../winix/core/request.h ../../../winix/core/config.h
templates.o: ../../../winix/core/system.h ../../../winix/core/job.h
templates.o: ../../../winix/core/basethread.h ../../../winix/core/synchro.h
templates.o: ../../../winix/core/dirs.h ../../../winix/core/dircontainer.h
templates.o: ../../../winix/notify/notify.h
templates.o: ../../../winix/notify/notifypool.h
templates.o: ../../../winix/templates/patterns.h
templates.o: ../../../winix/templates/locale.h
templates.o: ../../../winix/templates/localefilter.h ../../../ezc/src/ezc.h
templates.o: ../../../ezc/src/generator.h ../../../ezc/src/blocks.h
templates.o: ../../../ezc/src/cache.h ../../../ezc/src/functions.h
templates.o: ../../../ezc/src/funinfo.h ../../../ezc/src/objects.h
templates.o: ../../../ezc/src/pattern.h ../../../ezc/src/patternparser.h
templates.o: ../../../winix/notify/notifythread.h
templates.o: ../../../winix/core/basethread.h
templates.o: ../../../winix/notify/templatesnotify.h
templates.o: ../../../winix/core/users.h ../../../winix/core/ugcontainer.h
templates.o: ../../../winix/core/lastcontainer.h ../../../winix/core/mounts.h
templates.o: ../../../winix/core/mountparser.h ../../../winix/core/crypt.h
templates.o: ../../../winix/core/run.h ../../../winix/core/users.h
templates.o: ../../../winix/core/groups.h ../../../winix/core/group.h
templates.o: ../../../winix/core/loadavg.h ../../../winix/core/image.h
templates.o: ../../../winix/core/threadmanager.h
templates.o: ../../../winix/core/timezones.h ../../../winix/core/timezone.h
templates.o: ../../../winix/core/synchro.h galleryinfo.h
templates.o: ../../../winix/core/misc.h ../../../winix/core/plugin.h
templates.o: ../../../winix/core/pluginmsg.h ../../../winix/core/system.h
templates.o: ../../../winix/core/sessionmanager.h
templates.o: ../../../winix/core/sessioncontainer.h
templates.o: ../../../winix/core/ipbancontainer.h
templates.o: ../../../winix/core/sessionidmanager.h
templates.o: ../../../tito/src/base64.h ../../../tito/src/aes.h
templates.o: ../../../winix/functions/functions.h
templates.o: ../../../winix/functions/functionbase.h
templates.o: ../../../winix/functions/functionparser.h
templates.o: ../../../winix/core/cur.h ../../../winix/functions/account.h
templates.o: ../../../winix/functions/adduser.h
templates.o: ../../../winix/functions/cat.h ../../../winix/functions/chmod.h
templates.o: ../../../winix/functions/privchanger.h
templates.o: ../../../winix/functions/chown.h
templates.o: ../../../winix/functions/ckeditor.h
templates.o: ../../../winix/functions/cp.h ../../../winix/functions/default.h
templates.o: ../../../winix/functions/download.h
templates.o: ../../../winix/functions/emacs.h ../../../winix/functions/env.h
templates.o: ../../../winix/functions/imgcrop.h
templates.o: ../../../winix/functions/last.h ../../../winix/functions/login.h
templates.o: ../../../winix/functions/logout.h ../../../winix/functions/ln.h
templates.o: ../../../winix/functions/ls.h ../../../winix/functions/man.h
templates.o: ../../../winix/functions/meta.h ../../../winix/functions/mkdir.h
templates.o: ../../../winix/functions/mv.h ../../../winix/functions/nicedit.h
templates.o: ../../../winix/functions/node.h
templates.o: ../../../winix/functions/passwd.h
templates.o: ../../../winix/functions/priv.h ../../../winix/functions/pw.h
templates.o: ../../../winix/functions/reload.h ../../../winix/functions/rm.h
templates.o: ../../../winix/functions/rmuser.h
templates.o: ../../../winix/functions/sort.h
templates.o: ../../../winix/functions/specialdefault.h
templates.o: ../../../winix/functions/stat.h
templates.o: ../../../winix/functions/subject.h
templates.o: ../../../winix/functions/template.h
templates.o: ../../../winix/functions/tinymce.h
templates.o: ../../../winix/functions/uname.h
templates.o: ../../../winix/functions/upload.h
templates.o: ../../../winix/functions/uptime.h ../../../winix/functions/who.h
templates.o: ../../../winix/functions/vim.h ../../../winix/core/htmlfilter.h
templates.o: ../../../winix/templates/templates.h
templates.o: ../../../winix/templates/patterncacher.h
templates.o: ../../../winix/templates/indexpatterns.h
templates.o: ../../../winix/templates/patterns.h
templates.o: ../../../winix/templates/changepatterns.h
templates.o: ../../../winix/templates/htmltextstream.h
templates.o: ../../../winix/core/sessionmanager.h
templates.o: ../../../winix/templates/miscspace.h
templates.o: ../../../winix/templates/templates.h

View File

@@ -0,0 +1 @@
o = gallery.o galleryinfo.o init.o templates.o

View File

@@ -0,0 +1,123 @@
/*
* This file is a part of Winix
* and is distributed under the 2-Clause BSD licence.
* Author: Tomasz Sowa <t.sowa@ttmath.org>
*/
/*
* Copyright (c) 2011-2014, Tomasz Sowa
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
#include "gallery.h"
namespace Winix
{
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.sel_sort_index = true;
iq.sel_meta = 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
} // namespace Winix

View File

@@ -0,0 +1,75 @@
/*
* This file is a part of Winix
* and is distributed under the 2-Clause BSD licence.
* Author: Tomasz Sowa <t.sowa@ttmath.org>
*/
/*
* Copyright (c) 2011-2014, Tomasz Sowa
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef headerfile_winix_plugins_gallery_gallery
#define headerfile_winix_plugins_gallery_gallery
#include "functions/functionbase.h"
#include "galleryinfo.h"
namespace Winix
{
namespace Gallery
{
class Gallery : public FunctionBase
{
public:
Gallery();
bool HasAccess();
void MakeGet();
void SetGalleryInfo(GalleryInfo * pinfo);
private:
GalleryInfo * gallery_info;
DbItemQuery iq;
void CreatePointers();
void SortPointers();
void MakeGetDir();
void MakeGetFile();
};
} // namespace
} // namespace Winix
#endif

View File

@@ -0,0 +1,65 @@
/*
* This file is a part of Winix
* and is distributed under the 2-Clause BSD licence.
* Author: Tomasz Sowa <t.sowa@ttmath.org>
*/
/*
* Copyright (c) 2011-2014, Tomasz Sowa
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
#include "galleryinfo.h"
namespace Winix
{
namespace Gallery
{
void GalleryInfo::Clear()
{
item_tab.clear();
item_sort_tab.clear();
}
} // namespace
} // namespace Winix

View File

@@ -0,0 +1,89 @@
/*
* This file is a part of Winix
* and is distributed under the 2-Clause BSD licence.
* Author: Tomasz Sowa <t.sowa@ttmath.org>
*/
/*
* Copyright (c) 2011-2014, Tomasz Sowa
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef headerfile_winix_plugins_gallery_galleryinfo
#define headerfile_winix_plugins_gallery_galleryinfo
#include <vector>
#include "core/item.h"
namespace Winix
{
namespace Gallery
{
class GalleryInfo
{
public:
// id of a mount type
int mount_type_gallery;
// enable a thread in a specific directory
// and set sort type (asc, desc)
int mount_par_gallery;
int mount_par_gallery_size;
int mount_par_gallery_theme;
// "lightbox" (default)
// "galleria" (http://galleria.aino.se/)
// "galleriathumb" (http://galleria.aino.se/)
int mount_par_gallery_type;
// id of the current plugin
int plugin_id;
void Clear();
std::vector<Item> item_tab;
std::vector<Item*> item_sort_tab;
private:
};
} // namespace
} // namespace Winix
#endif

View File

@@ -0,0 +1,121 @@
/*
* This file is a part of Winix
* and is distributed under the 2-Clause BSD licence.
* Author: Tomasz Sowa <t.sowa@ttmath.org>
*/
/*
* Copyright (c) 2011-2014, Tomasz Sowa
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
#include "gallery.h"
#include "core/log.h"
#include "core/plugin.h"
namespace Winix
{
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);
}
} // namespace Winix

View File

@@ -0,0 +1,263 @@
/*
* This file is a part of Winix
* and is distributed under the 2-Clause BSD licence.
* Author: Tomasz Sowa <t.sowa@ttmath.org>
*/
/*
* Copyright (c) 2011-2014, Tomasz Sowa
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
#include "gallery.h"
#include "core/request.h"
#include "core/misc.h"
#include "core/plugin.h"
#include "templates/templates.h"
#include "functions/functions.h"
#include "templates/miscspace.h"
namespace Winix
{
namespace Gallery
{
using namespace TemplatesFunctions;
using TemplatesFunctions::system;
extern GalleryInfo gallery_info;
extern Gallery fun_gallery;
static size_t gallery_index;
static std::wstring item_dir;
void gallery_tab(Info & i)
{
gallery_index = i.iter;
i.res = gallery_index < gallery_info.item_sort_tab.size();
}
void gallery_tab_index(Info & i)
{
i.out << gallery_index;
}
void gallery_tab_dir(Info & i)
{
if( gallery_index < gallery_info.item_sort_tab.size() )
{
Item & item = *gallery_info.item_sort_tab[gallery_index];
system->dirs.MakePath(item.parent_id, item_dir);
i.out << item_dir;
}
}
void gallery_tab_url(Info & i)
{
if( gallery_index < gallery_info.item_sort_tab.size() )
{
Item & item = *gallery_info.item_sort_tab[gallery_index];
i.out << item.url;
}
}
void gallery_tab_subject(Info & i)
{
if( gallery_index < gallery_info.item_sort_tab.size() )
{
Item & item = *gallery_info.item_sort_tab[gallery_index];
i.out << item.subject;
}
}
void gallery_tab_link(Info & i)
{
doc_proto(i);
i.out << config->base_url;// !! IMPROVE ME what about subdomains?
gallery_tab_dir(i);
gallery_tab_url(i);
}
void gallery_tab_meta_str(Info & i)
{
if( gallery_index < gallery_info.item_sort_tab.size() )
{
Item & item = *gallery_info.item_sort_tab[gallery_index];
item.meta.Serialize(i.out, true, false);
}
}
void gallery_tab_meta(Info & i)
{
if( gallery_index < gallery_info.item_sort_tab.size() )
{
Item & item = *gallery_info.item_sort_tab[gallery_index];
space(i, item.meta);
}
}
void gallery_tab_meta_tab(Info & i)
{
if( gallery_index < gallery_info.item_sort_tab.size() )
{
Item & item = *gallery_info.item_sort_tab[gallery_index];
spaces_tab(i, item.meta);
}
}
void gallery_tab_meta_tab_value(Info & i)
{
if( gallery_index < gallery_info.item_sort_tab.size() )
{
Item & item = *gallery_info.item_sort_tab[gallery_index];
spaces_tab_value(i, item.meta);
}
}
void gallery_tab_meta_tab_has_next(Info & i)
{
if( gallery_index < gallery_info.item_sort_tab.size() )
{
Item & item = *gallery_info.item_sort_tab[gallery_index];
spaces_tab_has_next(i, item.meta);
}
}
void gallery_width(Info & i)
{
if( !system->mounts.pmount )
return;
Mount & m = *system->mounts.pmount;
if( !m.param[gallery_info.mount_par_gallery_size].defined || m.param[gallery_info.mount_par_gallery_size].arg.size() != 2 )
{
i.out << "800px";
}
else
{
i.out << m.param[gallery_info.mount_par_gallery_size].arg[0];
}
}
void gallery_height(Info & i)
{
if( !system->mounts.pmount )
return;
Mount & m = *system->mounts.pmount;
if( !m.param[gallery_info.mount_par_gallery_size].defined || m.param[gallery_info.mount_par_gallery_size].arg.size() != 2 )
{
i.out << "500px";
}
else
{
i.out << m.param[gallery_info.mount_par_gallery_size].arg[1];
}
}
void gallery_has_not_mount_type(Info & i)
{
i.res = !system->mounts.pmount->IsPar(gallery_info.mount_par_gallery_type);
}
void gallery_mount_type_arg_is(Info & i)
{
i.res = system->mounts.pmount->IsArg(gallery_info.mount_par_gallery_type, i.par);
}
void gallery_mount_theme_arg_is(Info & i)
{
i.res = system->mounts.pmount->IsArg(gallery_info.mount_par_gallery_theme, i.par);
}
void AddEzcFunctions(PluginInfo & info)
{
using TemplatesFunctions::EzcFun;
EzcFun * fun = reinterpret_cast<EzcFun*>(info.p1);
fun->Insert("gallery_tab", gallery_tab);
fun->Insert("gallery_tab_index", gallery_tab_index);
fun->Insert("gallery_tab_dir", gallery_tab_dir);
fun->Insert("gallery_tab_url", gallery_tab_url);
fun->Insert("gallery_tab_subject", gallery_tab_subject);
fun->Insert("gallery_tab_link", gallery_tab_link);
fun->Insert("gallery_tab_meta_str", gallery_tab_meta_str);
fun->Insert("gallery_tab_meta", gallery_tab_meta);
fun->Insert("gallery_tab_meta_tab", gallery_tab_meta_tab);
fun->Insert("gallery_tab_meta_tab_value", gallery_tab_meta_tab_value);
fun->Insert("gallery_tab_meta_tab_has_next", gallery_tab_meta_tab_has_next);
fun->Insert("gallery_width", gallery_width);
fun->Insert("gallery_height", gallery_height);
fun->Insert("gallery_has_not_mount_type", gallery_has_not_mount_type);
fun->Insert("gallery_mount_type_arg_is", gallery_mount_type_arg_is);
fun->Insert("gallery_mount_theme_arg_is", gallery_mount_theme_arg_is);
}
} // namespace
} // namespace Winix