suwako / UnixWallpaper アーカイブ

このリポジトリはアーカイブされています。読むだけで、プッシュやイシューの変更は出来ません。

master
ブランチ master
UnixWallpaper / src / uw / background.cc
500 B、27行 生 Blame 履歴
1#include <X11/Xlib.h>
2
3#include "background.hh"
4
5namespace uw {
6 Background::Background(const std::string &filename)
7 : filename(filename), i(s, filename), o(s, i) {
8 }
9
10 Background::~Background() {}
11
12 bool Background::setWallpaper(Mode mode) {
13 if (mode == Mode::FILL) {
14 o.fill();
15 } else if (mode == Mode::CENTER) {
16 o.center();
17 } else if (mode == Mode::TILE) {
18 o.tile();
19 } else {
20 return false;
21 }
22
23 XFlush(s.getDisplay());
24
25 return true;
26 }
27}