X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flayout.cpp;h=917d47a7cbc9e2f5b0c2184f0e4fd7bfe6cea85f;hb=b30edd979e6e9c7acfaaf3a90903814a7e62a71e;hp=c41dcb87b68172236b1bb67155b48990ca79609e;hpb=8c24649c40829dd1ce78ca4bbcae0913574ab292;p=libs%2Fgltk.git diff --git a/source/layout.cpp b/source/layout.cpp index c41dcb8..917d47a 100644 --- a/source/layout.cpp +++ b/source/layout.cpp @@ -1,5 +1,6 @@ #include #include +#include #include "arrangement.h" #include "container.h" #include "layout.h" @@ -480,6 +481,42 @@ void Layout::Slot::visibility_changed(bool v) } +void operator>>(const LexicalConverter &conv, Layout::ConstraintType &ctype) +{ + const string &str = conv.get(); + if(str=="ABOVE") + ctype = Layout::ABOVE; + else if(str=="BELOW") + ctype = Layout::BELOW; + else if(str=="RIGHT_OF") + ctype = Layout::RIGHT_OF; + else if(str=="LEFT_OF") + ctype = Layout::LEFT_OF; + else if(str=="FAR_ABOVE") + ctype = Layout::FAR_ABOVE; + else if(str=="FAR_BELOW") + ctype = Layout::FAR_BELOW; + else if(str=="FAR_RIGHT_OF") + ctype = Layout::FAR_RIGHT_OF; + else if(str=="FAR_LEFT_OF") + ctype = Layout::FAR_LEFT_OF; + else if(str=="ALIGN_TOP") + ctype = Layout::ALIGN_TOP; + else if(str=="ALIGN_BOTTOM") + ctype = Layout::ALIGN_BOTTOM; + else if(str=="ALIGN_RIGHT") + ctype = Layout::ALIGN_RIGHT; + else if(str=="ALIGN_LEFT") + ctype = Layout::ALIGN_LEFT; + else if(str=="COPY_WIDTH") + ctype = Layout::COPY_WIDTH; + else if(str=="COPY_HEIGHT") + ctype = Layout::COPY_HEIGHT; + else + throw lexical_error(format("conversion of '%s' to ConstraintType", str)); +} + + Layout::LinearProgram::LinearProgram(unsigned s): n_columns(s), n_rows(1),