const function Resource getString

This commit is contained in:
fluxgen 2005-11-22 21:09:14 +00:00
parent be1cbd4690
commit f7cfa81bbb
4 changed files with 18 additions and 18 deletions

View file

@ -87,7 +87,7 @@ void FbTk::Resource<IconbarTool::DeiconifyMode>::setFromString(const char* strva
} }
template<> template<>
std::string FbTk::Resource<IconbarTool::DeiconifyMode>::getString() { std::string FbTk::Resource<IconbarTool::DeiconifyMode>::getString() const {
switch (m_value) { switch (m_value) {
case IconbarTool::SEMIFOLLOW: case IconbarTool::SEMIFOLLOW:
return std::string("SemiFollow"); return std::string("SemiFollow");
@ -119,7 +119,7 @@ void FbTk::Resource<IconbarTool::WheelMode>::setFromString(const char* strval) {
template<> template<>
std::string FbTk::Resource<IconbarTool::WheelMode>::getString() { std::string FbTk::Resource<IconbarTool::WheelMode>::getString() const {
switch(m_value) { switch(m_value) {
case IconbarTool::ON: case IconbarTool::ON:
return std::string("On"); return std::string("On");
@ -137,7 +137,7 @@ void FbTk::Resource<Container::Alignment>::setDefaultValue() {
} }
template<> template<>
string FbTk::Resource<Container::Alignment>::getString() { string FbTk::Resource<Container::Alignment>::getString() const {
switch (m_value) { switch (m_value) {
case Container::LEFT: case Container::LEFT:
return string("Left"); return string("Left");
@ -162,7 +162,7 @@ void FbTk::Resource<Container::Alignment>::setFromString(const char *str) {
} }
template<> template<>
string FbTk::Resource<IconbarTool::Mode>::getString() { string FbTk::Resource<IconbarTool::Mode>::getString() const {
switch (m_value) { switch (m_value) {
case IconbarTool::NONE: case IconbarTool::NONE:

View file

@ -111,13 +111,13 @@ setFromString(const char *strval) {
//----------------------------------------------------------------- //-----------------------------------------------------------------
template<> template<>
std::string FbTk::Resource<bool>:: std::string FbTk::Resource<bool>::
getString() { getString() const {
return std::string(**this == true ? "true" : "false"); return std::string(**this == true ? "true" : "false");
} }
template<> template<>
std::string FbTk::Resource<int>:: std::string FbTk::Resource<int>::
getString() { getString() const {
char strval[256]; char strval[256];
sprintf(strval, "%d", **this); sprintf(strval, "%d", **this);
return std::string(strval); return std::string(strval);
@ -125,12 +125,12 @@ getString() {
template<> template<>
std::string FbTk::Resource<std::string>:: std::string FbTk::Resource<std::string>::
getString() { return **this; } getString() const { return **this; }
template<> template<>
std::string FbTk::Resource<Fluxbox::TitlebarList>:: std::string FbTk::Resource<Fluxbox::TitlebarList>::
getString() { getString() const {
string retval; string retval;
int size=m_value.size(); int size=m_value.size();
for (int i=0; i<size; i++) { for (int i=0; i<size; i++) {
@ -164,7 +164,7 @@ getString() {
template<> template<>
std::string FbTk::Resource<Fluxbox::TabsAttachArea>:: std::string FbTk::Resource<Fluxbox::TabsAttachArea>::
getString() { getString() const {
if (m_value == Fluxbox::ATTACH_AREA_TITLEBAR) if (m_value == Fluxbox::ATTACH_AREA_TITLEBAR)
return "Titlebar"; return "Titlebar";
else else
@ -173,7 +173,7 @@ getString() {
template<> template<>
string FbTk::Resource<unsigned int>:: string FbTk::Resource<unsigned int>::
getString() { getString() const {
char tmpstr[128]; char tmpstr[128];
sprintf(tmpstr, "%ul", m_value); sprintf(tmpstr, "%ul", m_value);
return string(tmpstr); return string(tmpstr);
@ -181,7 +181,7 @@ getString() {
template<> template<>
string FbTk::Resource<long long>:: string FbTk::Resource<long long>::
getString() { getString() const {
char tmpstr[128]; char tmpstr[128];
sprintf(tmpstr, "%llu", (unsigned long long) m_value); sprintf(tmpstr, "%llu", (unsigned long long) m_value);
return string(tmpstr); return string(tmpstr);
@ -214,7 +214,7 @@ setFromString(const char *strval) {
template<> template<>
string FbTk::Resource<Fluxbox::Layer>:: string FbTk::Resource<Fluxbox::Layer>::
getString() { getString() const {
if (m_value.getNum() == Fluxbox::instance()->getMenuLayer()) if (m_value.getNum() == Fluxbox::instance()->getMenuLayer())
return string("Menu"); return string("Menu");
@ -245,7 +245,7 @@ setFromString(const char *strval) {
template<> template<>
string FbTk::Resource<long>:: string FbTk::Resource<long>::
getString() { getString() const {
char tmpstr[128]; char tmpstr[128];
sprintf(tmpstr, "%ld", m_value); sprintf(tmpstr, "%ld", m_value);
return string(tmpstr); return string(tmpstr);

View file

@ -115,7 +115,7 @@ void FbTk::Resource<Slit::Direction>::setFromString(const char *strval) {
} }
template<> template<>
string FbTk::Resource<Slit::Placement>::getString() { string FbTk::Resource<Slit::Placement>::getString() const {
switch (m_value) { switch (m_value) {
case Slit::TOPLEFT: case Slit::TOPLEFT:
return string("TopLeft"); return string("TopLeft");
@ -147,7 +147,7 @@ string FbTk::Resource<Slit::Placement>::getString() {
} }
template<> template<>
string FbTk::Resource<Slit::Direction>::getString() { string FbTk::Resource<Slit::Direction>::getString() const {
switch (m_value) { switch (m_value) {
case Slit::VERTICAL: case Slit::VERTICAL:
return string("Vertical"); return string("Vertical");

View file

@ -106,7 +106,7 @@ setFromString(const char *strval) {
template<> template<>
string FbTk::Resource<Toolbar::Placement>:: string FbTk::Resource<Toolbar::Placement>::
getString() { getString() const {
switch (m_value) { switch (m_value) {
case Toolbar::TOPLEFT: case Toolbar::TOPLEFT:
return string("TopLeft"); return string("TopLeft");