aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/FbTk/Theme.cc13
-rw-r--r--src/FbTk/Theme.hh6
2 files changed, 12 insertions, 7 deletions
diff --git a/src/FbTk/Theme.cc b/src/FbTk/Theme.cc
index ca39620..ddc68ec 100644
--- a/src/FbTk/Theme.cc
+++ b/src/FbTk/Theme.cc
@@ -19,7 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: Theme.cc,v 1.22 2003/12/03 00:18:58 fluxgen Exp $ 22// $Id: Theme.cc,v 1.23 2003/12/29 11:04:09 fluxgen Exp $
23 23
24#include "Theme.hh" 24#include "Theme.hh"
25 25
@@ -73,7 +73,8 @@ bool ThemeManager::unregisterTheme(Theme &tm) {
73 return true; 73 return true;
74} 74}
75 75
76bool ThemeManager::load(const std::string &filename) { 76bool ThemeManager::load(const std::string &filename, int screen_num) {
77 cerr<<"Load Theme: "<<filename<<endl;
77 std::string location = FbTk::StringUtil::expandFilename(filename); 78 std::string location = FbTk::StringUtil::expandFilename(filename);
78 std::string prefix = ""; 79 std::string prefix = "";
79 80
@@ -107,11 +108,15 @@ bool ThemeManager::load(const std::string &filename) {
107 location.append("/pixmaps"); 108 location.append("/pixmaps");
108 Image::addSearchPath(location); 109 Image::addSearchPath(location);
109 110
110 //get list and go throu all the resources and load them 111 // get list and go throu all the resources and load them
111 ThemeList::iterator theme_it = m_themelist.begin(); 112 ThemeList::iterator theme_it = m_themelist.begin();
112 const ThemeList::iterator theme_it_end = m_themelist.end(); 113 const ThemeList::iterator theme_it_end = m_themelist.end();
113 for (; theme_it != theme_it_end; ++theme_it) { 114 for (; theme_it != theme_it_end; ++theme_it) {
114 loadTheme(**theme_it); 115 if (screen_num < 0)
116 loadTheme(**theme_it);
117 else if (screen_num == (*theme_it)->screenNum()) // specified screen
118 loadTheme(**theme_it);
119
115 } 120 }
116 // notify all themes that we reconfigured 121 // notify all themes that we reconfigured
117 theme_it = m_themelist.begin(); 122 theme_it = m_themelist.begin();
diff --git a/src/FbTk/Theme.hh b/src/FbTk/Theme.hh
index b0f422a..c9262f5 100644
--- a/src/FbTk/Theme.hh
+++ b/src/FbTk/Theme.hh
@@ -19,7 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: Theme.hh,v 1.13 2003/12/17 00:43:22 fluxgen Exp $ 22// $Id: Theme.hh,v 1.14 2003/12/29 11:04:09 fluxgen Exp $
23 23
24/** 24/**
25 @file holds ThemeItem<T>, Theme and ThemeManager which is the base for any theme 25 @file holds ThemeItem<T>, Theme and ThemeManager which is the base for any theme
@@ -124,8 +124,8 @@ private:
124class ThemeManager { 124class ThemeManager {
125public: 125public:
126 static ThemeManager &instance(); 126 static ThemeManager &instance();
127 127 /// load style file "filename" to screen
128 bool load(const std::string &filename); 128 bool load(const std::string &filename, int screen_num = -1);
129 std::string resourceValue(const std::string &name, const std::string &altname); 129 std::string resourceValue(const std::string &name, const std::string &altname);
130 void loadTheme(Theme &tm); 130 void loadTheme(Theme &tm);
131 bool loadItem(ThemeItem_base &resource); 131 bool loadItem(ThemeItem_base &resource);