]> git.sesse.net Git - ccbs/blobdiff - bigscreen/theme.cpp
Support different backgrounds per-screen.
[ccbs] / bigscreen / theme.cpp
index eb5d54989fbb0b0c7f664abb35cddff40f24c566..fb6f7707b450de93bedf9bc97cc91ad905dc0e19 100644 (file)
@@ -46,7 +46,6 @@ void read_config(const char *filename)
                        continue;
                }
 
-               fprintf(stderr, "%s = %s\n", key, value);
                config[key] = value;
        }
        fclose(fp);
@@ -79,11 +78,12 @@ std::string get_theme_config(const std::string &key, const std::string subkey)
        return config["default." + subkey];
 }
 
-void fill_background(unsigned char *buf, unsigned width, unsigned height)
+void fill_background(unsigned char *buf, const std::string &screen_name, unsigned width, unsigned height)
 {
-       int bg_r = atoi(get_theme_config("background", "red").c_str());
-       int bg_g = atoi(get_theme_config("background", "green").c_str());
-       int bg_b = atoi(get_theme_config("background", "blue").c_str());
+       std::string key = "background." + screen_name;
+       int bg_r = atoi(get_theme_config(key, "red").c_str());
+       int bg_g = atoi(get_theme_config(key, "green").c_str());
+       int bg_b = atoi(get_theme_config(key, "blue").c_str());
 
        unsigned char *ptr = buf;
        for (unsigned i = 0; i < width * height; ++i) {