~alan-griffiths/mir/move-miral-to-mir-no-more-miral-packages

« back to all changes in this revision

Viewing changes to examples/miral-shell/titlebar_config.cpp

  • Committer: Tarmac
  • Author(s): Alan Griffiths
  • Date: 2017-08-30 15:19:51 UTC
  • mfrom: (4232.2.18 mir2)
  • Revision ID: tarmac-20170830151951-jizxlto07otfslu1
Incorporate miral project into mir source tree - part 1.

Approved by mir-ci-bot, Gerry Boland, Brandon Schaefer.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright © 2016 Canonical Ltd.
 
3
 *
 
4
 * This program is free software: you can redistribute it and/or modify it
 
5
 * under the terms of the GNU General Public License version 2 or 3 as
 
6
 * published by the Free Software Foundation.
 
7
 *
 
8
 * This program is distributed in the hope that it will be useful,
 
9
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
 * GNU General Public License for more details.
 
12
 *
 
13
 * You should have received a copy of the GNU General Public License
 
14
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
15
 *
 
16
 * Authored by: Alan Griffiths <alan@octopull.co.uk>
 
17
 */
 
18
 
 
19
#include "titlebar_config.h"
 
20
#include <mutex>
 
21
 
 
22
namespace
 
23
{
 
24
std::mutex mutex;
 
25
std::string font_file{"/usr/share/fonts/truetype/ubuntu-font-family/Ubuntu-B.ttf"};
 
26
}
 
27
 
 
28
void titlebar::font_file(std::string const& font_file)
 
29
{
 
30
    std::lock_guard<decltype(mutex)> lock{mutex};
 
31
    ::font_file = font_file;
 
32
}
 
33
 
 
34
auto titlebar::font_file() -> std::string
 
35
{
 
36
    std::lock_guard<decltype(mutex)> lock{mutex};
 
37
    return ::font_file;
 
38
}