mirror of
https://github.com/Relintai/rcpp_framework.git
synced 2025-05-06 17:51:36 +02:00
Experimental Theme implementation.
This commit is contained in:
parent
a5ba1413e0
commit
3f48c9be38
@ -1 +1,3 @@
|
|||||||
g++ -o3 -g main.cpp ./core/settings.cpp ./core/request.cpp ./core/http_server.cpp ./core/file_cache.cpp ./core/application.cpp ./rdn_application.cpp -o ./bin/server -Ilibs -lpthread -std=c++11
|
g++ -o3 -g main.cpp ./core/settings.cpp ./core/request.cpp ./core/http_server.cpp ./core/file_cache.cpp ./core/application.cpp ./rdn_application.cpp \
|
||||||
|
./themes/theme.cpp ./themes/theme_map.cpp \
|
||||||
|
-o ./bin/server -Ilibs -lpthread -std=c++11
|
||||||
|
9
themes/theme.cpp
Normal file
9
themes/theme.cpp
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#include "theme.h"
|
||||||
|
|
||||||
|
Theme::Theme() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Theme::~Theme() {
|
||||||
|
|
||||||
|
}
|
23
themes/theme.h
Normal file
23
themes/theme.h
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
#ifndef THEME_H
|
||||||
|
#define THEME_H
|
||||||
|
|
||||||
|
#include<map>
|
||||||
|
#include<string>
|
||||||
|
|
||||||
|
class Theme {
|
||||||
|
public:
|
||||||
|
|
||||||
|
|
||||||
|
Theme();
|
||||||
|
virtual ~Theme();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
//forumtheme
|
||||||
|
//sitetheme
|
||||||
|
//...
|
||||||
|
//all singleton
|
||||||
|
//not templated
|
||||||
|
//and a theme map
|
||||||
|
|
||||||
|
#endif
|
15
themes/theme_map.cpp
Normal file
15
themes/theme_map.cpp
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#include "theme_map.h"
|
||||||
|
|
||||||
|
ThemeMap::ThemeMap() {
|
||||||
|
_instance = this;
|
||||||
|
}
|
||||||
|
|
||||||
|
ThemeMap::~ThemeMap() {
|
||||||
|
_instance = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
ThemeMap *ThemeMap::get_singleton() {
|
||||||
|
return _instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
ThemeMap *ThemeMap::_instance = nullptr;
|
28
themes/theme_map.h
Normal file
28
themes/theme_map.h
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
#ifndef THEME_MAP_H
|
||||||
|
#define THEME_MAP_H
|
||||||
|
|
||||||
|
#ifndef THEME_CLASS_INCLUDE
|
||||||
|
#define THEME_CLASS_INCLUDE "theme.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef THEME_CLASS
|
||||||
|
#define THEME_CLASS Theme
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include THEME_CLASS_INCLUDE
|
||||||
|
|
||||||
|
class ThemeMap {
|
||||||
|
public:
|
||||||
|
THEME_CLASS *current_theme;
|
||||||
|
std::map<std::string, THEME_CLASS> theme_map;
|
||||||
|
|
||||||
|
ThemeMap();
|
||||||
|
~ThemeMap();
|
||||||
|
|
||||||
|
static ThemeMap *get_singleton();
|
||||||
|
|
||||||
|
private:
|
||||||
|
static ThemeMap *_instance;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
Loading…
Reference in New Issue
Block a user