-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Compiles on my machine ππππ
- Loading branch information
Showing
22 changed files
with
339 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#pragma once | ||
|
||
namespace spaic::css::prop | ||
{ | ||
template <typename T> | ||
class AssignedCssProperty | ||
{ | ||
}; | ||
|
||
template <typename T> | ||
class CssProperty | ||
{ | ||
public: | ||
AssignedCssProperty<T> operator=(T value); | ||
}; | ||
} // namespace spaic::css::prop | ||
|
||
#include <spaic-css/detail/CssProperty.hpp> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#pragma once | ||
|
||
#include <spaic-css/CssProperty.hpp> | ||
#include <spaic-css/Unit.hpp> | ||
|
||
namespace spaic::css::prop | ||
{ | ||
using namespace spaic::css::unit; | ||
// TODO: Strong type check, can we use Length type? | ||
CssProperty<CssUnit<CssUnitType::px>> width; | ||
} // namespace spaic::css::prop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#pragma once | ||
|
||
#include <spaic-css/PredefinedCssProperty.hpp> | ||
#include <spaic-css/CSS.hpp> | ||
#include <spaic-css/Unit.hpp> | ||
|
||
using namespace spaic::css::prop; | ||
using spaic::css::css; | ||
using namespace spaic::css::unit; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
#pragma once | ||
|
||
#include <string> | ||
|
||
namespace spaic::css | ||
{ | ||
class Stylesheet | ||
{ | ||
std::string compile(); | ||
}; | ||
} // namespace spaic::css |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
#pragma once | ||
|
||
#define defineUnitUDLRaw(underscore, unitType) \ | ||
CssUnit<CssUnitType::unitType> operator"" underscore##unitType(long double v) noexcept \ | ||
{ \ | ||
return CssUnit<CssUnitType::unitType>(v); \ | ||
} \ | ||
CssUnit<CssUnitType::unitType> operator"" underscore##unitType(unsigned long long v) noexcept \ | ||
{ \ | ||
return CssUnit<CssUnitType::unitType>(v); \ | ||
} | ||
#define defineUnitUDL(unitType) defineUnitUDLRaw(_, unitType) | ||
|
||
#include <string> | ||
|
||
namespace spaic::css::unit | ||
{ | ||
enum class CssUnitType | ||
{ | ||
em, | ||
ex, | ||
cap, | ||
ch, | ||
ic, | ||
rem, | ||
lh, | ||
rlh, | ||
vw, | ||
vh, | ||
vi, | ||
vb, | ||
vmin, | ||
vmax, | ||
cm, | ||
mm, | ||
q, | ||
in, | ||
pc, | ||
pt, | ||
px, | ||
deg, | ||
grad, | ||
rad, | ||
turn, | ||
s, | ||
ms, | ||
hz, | ||
khz, | ||
dpi, | ||
dpcm, | ||
dppx, | ||
percent | ||
}; | ||
template <CssUnitType T> | ||
class CssUnit | ||
{ | ||
private: | ||
long double value; | ||
|
||
public: | ||
CssUnit(long double value) noexcept : value(value) {} | ||
|
||
std::string toCssValue(); | ||
}; | ||
|
||
defineUnitUDL(em); | ||
defineUnitUDL(ex); | ||
defineUnitUDL(cap); | ||
defineUnitUDL(ch); | ||
defineUnitUDL(ic); | ||
defineUnitUDL(rem); | ||
defineUnitUDL(lh); | ||
defineUnitUDL(rlh); | ||
defineUnitUDL(vw); | ||
defineUnitUDL(vh); | ||
defineUnitUDL(vi); | ||
defineUnitUDL(vb); | ||
defineUnitUDL(vmin); | ||
defineUnitUDL(vmax); | ||
defineUnitUDL(cm); | ||
defineUnitUDL(mm); | ||
defineUnitUDL(q); | ||
defineUnitUDL(in); | ||
defineUnitUDL(pc); | ||
defineUnitUDL(pt); | ||
defineUnitUDL(px); | ||
defineUnitUDL(deg); | ||
defineUnitUDL(grad); | ||
defineUnitUDL(rad); | ||
defineUnitUDL(turn); | ||
defineUnitUDL(s); | ||
defineUnitUDL(ms); | ||
defineUnitUDL(hz); | ||
defineUnitUDL(khz); | ||
defineUnitUDL(dpi); | ||
defineUnitUDL(dpcm); | ||
defineUnitUDL(dppx); | ||
defineUnitUDL(percent); | ||
} // namespace spaic::css::unit | ||
|
||
#undef defineUnitUDLRaw | ||
#undef defineUnitUDL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#pragma once | ||
|
||
#include <spaic-css/CSS.hpp> | ||
|
||
namespace spaic::css | ||
{ | ||
template <typename... T> | ||
spaic::css::Stylesheet css(T... params) | ||
{ | ||
throw "TODO"; | ||
} | ||
} // namespace spaic::css |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#pragma once | ||
|
||
#include <spaic-css/CssProperty.hpp> | ||
|
||
namespace spaic::css::prop | ||
{ | ||
|
||
template <typename T> | ||
AssignedCssProperty<T> CssProperty<T>::operator=(T value) | ||
{ | ||
return AssignedCssProperty<T>(); | ||
} | ||
|
||
} // namespace spaic::css::prop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,3 +17,5 @@ class Message | |
}; | ||
|
||
} // namespace spaic::msg | ||
|
||
#include <spaic/detail/Message.hpp> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#pragma once | ||
|
||
#include <functional> | ||
#include <variant> | ||
#include <spaic/VNode.hpp> | ||
#include <spaic/Property.hpp> | ||
#include <spaic/State.hpp> | ||
|
||
namespace spaic::comp | ||
{ | ||
spaic::vnode::VNode ComponentBody::operator()(spaic::vnode::VNode children...) noexcept | ||
{ | ||
throw "TODO: ComponentBody::operator()(children)"; | ||
} | ||
|
||
template <typename Props> | ||
template <typename... T> | ||
ComponentBody Component<Props>::operator()(T... args) noexcept | ||
{ | ||
throw "TODO: Component::operator()(args)"; | ||
} | ||
template <typename Props, typename StateSet> | ||
Component<Props> create_component(Props props, StateSet state, Update update, Render render) | ||
{ | ||
throw "TODO: create_component(props, state, update, render)"; | ||
} | ||
} // namespace spaic::comp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#pragma once | ||
|
||
#include <tuple> | ||
#include <spaic/Message.hpp> | ||
|
||
namespace spaic::msg | ||
{ | ||
|
||
template <typename... T> | ||
Message<T...>::operator bool() | ||
{ | ||
throw "TODO: Message::operator bool()"; | ||
} | ||
|
||
template <typename... T> | ||
template <size_t I> | ||
typename std::tuple_element<I, std::tuple<T...>>::type Message<T...>::get() | ||
{ | ||
throw "TODO: Message::get<I>()"; | ||
} | ||
|
||
} // namespace spaic::msg |
Oops, something went wrong.