From b90558a9a967ddd076ba5ed5fa02f0a6160760bd Mon Sep 17 00:00:00 2001 From: fluxgen Date: Sun, 18 May 2003 22:01:14 +0000 Subject: moved Resource to FbTk and change name of DirHelper to FbTk Directory --- src/Screen.cc | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/src/Screen.cc b/src/Screen.cc index 4a243ff..d3eb39e 100644 --- a/src/Screen.cc +++ b/src/Screen.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Screen.cc,v 1.170 2003/05/17 11:05:33 fluxgen Exp $ +// $Id: Screen.cc,v 1.171 2003/05/18 22:01:14 fluxgen Exp $ #include "Screen.hh" @@ -35,7 +35,7 @@ #include "Workspace.hh" #include "StringUtil.hh" #include "Netizen.hh" -#include "DirHelper.hh" +#include "Directory.hh" #include "WinButton.hh" #include "SimpleCommand.hh" #include "FbWinFrameTheme.hh" @@ -165,7 +165,7 @@ private: template<> -void Resource:: +void FbTk::Resource:: setFromString(const char *strval) { if (strcasecmp(strval, "TopLeft")==0) m_value = Toolbar::TOPLEFT; @@ -197,7 +197,7 @@ setFromString(const char *strval) { template<> -void Resource:: +void FbTk::Resource:: setFromString(const char *strval) { if (strcasecmp(strval, "Off") == 0) m_value = ToolbarHandler::OFF; @@ -216,7 +216,7 @@ setFromString(const char *strval) { } -string Resource:: +string FbTk::Resource:: getString() { switch (m_value) { case Toolbar::TOPLEFT: @@ -263,7 +263,7 @@ getString() { template<> -string Resource:: +string FbTk::Resource:: getString() { switch (m_value) { case ToolbarHandler::OFF: @@ -342,7 +342,7 @@ void setupWorkspacemenu(BScreen &scr, FbTk::Menu &menu) { template<> -void Resource::setFromString(const char *strval) { +void FbTk::Resource::setFromString(const char *strval) { if (strcasecmp(strval, "TopLeft")==0) m_value = Slit::TOPLEFT; else if (strcasecmp(strval, "CenterLeft")==0) @@ -364,7 +364,7 @@ void Resource::setFromString(const char *strval) { } template<> -void Resource::setFromString(const char *strval) { +void FbTk::Resource::setFromString(const char *strval) { if (strcasecmp(strval, "Vertical") == 0) m_value = Slit::VERTICAL; else if (strcasecmp(strval, "Horizontal") == 0) @@ -373,7 +373,7 @@ void Resource::setFromString(const char *strval) { setDefaultValue(); } -string Resource::getString() { +string FbTk::Resource::getString() { switch (m_value) { case Slit::TOPLEFT: return string("TopLeft"); @@ -405,7 +405,7 @@ string Resource::getString() { } template<> -string Resource::getString() { +string FbTk::Resource::getString() { switch (m_value) { case Slit::VERTICAL: return string("Vertical"); @@ -447,7 +447,7 @@ void FbTk::ThemeItem::setFromString(const char *str) { sscanf(str, "%d", &m_value); } -BScreen::ScreenResource::ScreenResource(ResourceManager &rm, +BScreen::ScreenResource::ScreenResource(FbTk::ResourceManager &rm, const std::string &scrname, const std::string &altscrname): toolbar_auto_hide(rm, false, scrname+".toolbar.autoHide", altscrname+".Toolbar.AutoHide"), @@ -490,7 +490,7 @@ BScreen::ScreenResource::ScreenResource(ResourceManager &rm, }; -BScreen::BScreen(ResourceManager &rm, +BScreen::BScreen(FbTk::ResourceManager &rm, const string &screenname, const string &altscreenname, int scrn, int num_layers) : m_clientlist_sig(*this), // client signal @@ -2267,18 +2267,19 @@ void BScreen::createStyleMenu(FbTk::Menu &menu, if (! stat(stylesdir.c_str(), &statbuf)) { if (S_ISDIR(statbuf.st_mode)) { // is a directory? - DirHelper d(stylesdir.c_str()); + FbTk::Directory dir(stylesdir.c_str()); // create a vector of all the filenames in the directory // add sort it - std::vector filelist(d.entries()); - for (size_t file_index = 0; file_index < d.entries(); ++file_index) - filelist[file_index] = d.readFilename(); + std::vector filelist(dir.entries()); + for (size_t file_index = 0; file_index < dir.entries(); ++file_index) + filelist[file_index] = dir.readFilename(); + std::sort(filelist.begin(), filelist.end(), less()); int slen = stylesdir.size(); // for each file in directory add filename and path to menu - for (size_t file_index = 0; file_index < d.entries(); file_index++) { + for (size_t file_index = 0; file_index < dir.entries(); file_index++) { int nlen = filelist[file_index].size(); char style[MAXPATHLEN + 1]; -- cgit v0.11.2