source: smplayer/trunk/src/hdpisupport.h@ 181

Last change on this file since 181 was 181, checked in by Silvan Scherrer, 9 years ago

smplayer: update trunk to version 16.8.0

File size: 1.8 KB
Line 
1/* smplayer, GUI front-end for mplayer.
2 Copyright (C) 2006-2016 Ricardo Villalba <rvm@users.sourceforge.net>
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17*/
18
19#ifndef HDPISUPPORT_H
20#define HDPISUPPORT_H
21
22#ifndef PORTABLE_APP
23#define HDPI_STORE_DATA
24#endif
25
26#include <QString>
27
28class QSettings;
29
30class HDPISupport {
31
32public:
33 HDPISupport(const QString & config_path = QString::null);
34 ~HDPISupport();
35
36#ifdef HDPI_STORE_DATA
37 void setConfigPath(const QString & config_path);
38
39 bool load();
40 bool save();
41#endif
42
43 void apply();
44
45 void setHDPIEnabled(bool b) { enabled = b; };
46 bool isHDPIEnabled() { return enabled; };
47
48 void setAutoScale(bool b) { auto_scale = b; };
49 bool autoScale() { return auto_scale; };
50
51 void setScaleFactor(double v) { scale_factor = v; };
52 double scaleFactor() { return scale_factor; };
53
54 void setPixelRatio(int v) { pixel_ratio = v; };
55 int pixelRatio() { return pixel_ratio; };
56
57 static HDPISupport * instance();
58
59private:
60 static HDPISupport * instance_obj;
61#ifdef HDPI_STORE_DATA
62 QSettings * set;
63#endif
64 bool enabled;
65 bool auto_scale;
66 double scale_factor;
67 int pixel_ratio;
68};
69
70#endif
71
Note: See TracBrowser for help on using the repository browser.