diff --git a/modules/users/SCsub b/modules/users/SCsub new file mode 100644 index 000000000..8ef7da90a --- /dev/null +++ b/modules/users/SCsub @@ -0,0 +1,24 @@ +import os + +Import('env') + +module_env = env.Clone() + +sources = [ + "register_types.cpp", + + "users/user.cpp", +] + +if ARGUMENTS.get('custom_modules_shared', 'no') == 'yes': + # Shared lib compilation + module_env.Append(CCFLAGS=['-fPIC']) + module_env['LIBS'] = [] + shared_lib = module_env.SharedLibrary(target='#bin/users', source=sources) + shared_lib_shim = shared_lib[0].name.rsplit('.', 1)[0] + env.Append(LIBS=[shared_lib_shim]) + env.Append(LIBPATH=['#bin']) +else: + # Static compilation + module_env.add_source_files(env.modules_sources, sources) + diff --git a/modules/users/config.py b/modules/users/config.py new file mode 100644 index 000000000..3da340e80 --- /dev/null +++ b/modules/users/config.py @@ -0,0 +1,18 @@ + + +def can_build(env, platform): + return True + + +def configure(env): + pass + + +def get_doc_classes(): + return [ + "User", + ] + + +def get_doc_path(): + return "doc_classes" diff --git a/modules/users/register_types.cpp b/modules/users/register_types.cpp new file mode 100644 index 000000000..65d1a0cc6 --- /dev/null +++ b/modules/users/register_types.cpp @@ -0,0 +1,34 @@ +/* +Copyright (c) 2022 Péter Magyar + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#include "register_types.h" + +//#include "core/engine.h" + +#include "users/user.h" + +void register_users_types() { + ClassDB::register_class(); +} + +void unregister_users_types() { +} diff --git a/modules/users/register_types.h b/modules/users/register_types.h new file mode 100644 index 000000000..4fbdbbb6c --- /dev/null +++ b/modules/users/register_types.h @@ -0,0 +1,28 @@ +#ifndef USERS_REGISTER_TYPES_H +#define USERS_REGISTER_TYPES_H +/* +Copyright (c) 2022 Péter Magyar + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +void register_users_types(); +void unregister_users_types(); + +#endif diff --git a/modules/web/nodes/users/user.cpp b/modules/users/users/user.cpp similarity index 100% rename from modules/web/nodes/users/user.cpp rename to modules/users/users/user.cpp diff --git a/modules/web/nodes/users/user.h b/modules/users/users/user.h similarity index 100% rename from modules/web/nodes/users/user.h rename to modules/users/users/user.h diff --git a/modules/web/nodes/users/user_controller.cpp b/modules/users/users/user_controller.cpp similarity index 100% rename from modules/web/nodes/users/user_controller.cpp rename to modules/users/users/user_controller.cpp diff --git a/modules/web/nodes/users/user_controller.h b/modules/users/users/user_controller.h similarity index 100% rename from modules/web/nodes/users/user_controller.h rename to modules/users/users/user_controller.h diff --git a/modules/web/SCsub b/modules/web/SCsub index 0ef74c7d8..d393611c3 100644 --- a/modules/web/SCsub +++ b/modules/web/SCsub @@ -48,8 +48,6 @@ sources = [ "nodes/paged_article/paged_article.cpp", "nodes/paged_article/paged_articles.cpp", #"nodes/paged_article/paged_articles_md_index.cpp", - - "nodes/users/user.cpp", ] if ARGUMENTS.get('custom_modules_shared', 'no') == 'yes': diff --git a/modules/web/config.py b/modules/web/config.py index 2d6720aa3..632a302f1 100644 --- a/modules/web/config.py +++ b/modules/web/config.py @@ -64,8 +64,6 @@ def get_doc_classes(): "PagedArticle", "PagedArticles", "PagedArticlesMDIndex", - - "User", ] diff --git a/modules/web/register_types.cpp b/modules/web/register_types.cpp index c4e96b8d4..e67703435 100644 --- a/modules/web/register_types.cpp +++ b/modules/web/register_types.cpp @@ -57,8 +57,6 @@ SOFTWARE. #include "nodes/paged_article/paged_articles.h" //#include "nodes/paged_article/paged_articles_md_index.h" -#include "nodes/users/user.h" - void register_web_types() { ClassDB::register_class<_HTMLBuilder>(); ClassDB::register_class<_HTMLTag>(); @@ -111,8 +109,6 @@ void register_web_types() { ClassDB::register_class(); ClassDB::register_class(); //ClassDB::register_class(); - - ClassDB::register_class(); } void unregister_web_types() {