-
Notifications
You must be signed in to change notification settings - Fork 12
/
switchres.h
70 lines (49 loc) · 1.79 KB
/
switchres.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/**************************************************************
switchres.h - SwichRes general header
---------------------------------------------------------
Switchres Modeline generation engine for emulation
License GPL-2.0+
Copyright 2010-2021 Chris Kennedy, Antonio Giner,
Alexandre Wodarczyk, Gil Delescluse
**************************************************************/
#ifndef __SWITCHRES_H__
#define __SWITCHRES_H__
#include <cstring>
#include <vector>
#include "monitor.h"
#include "modeline.h"
#include "display.h"
#include "edid.h"
//============================================================
// CONSTANTS
//============================================================
#ifndef SWITCHRES_VERSION
#define SWITCHRES_VERSION "2.2.1"
#endif
class switchres_manager
{
public:
switchres_manager();
~switchres_manager();
// getters
display_manager *display() const { return m_current_display; }
display_manager *display(int i) const { return i < (int)displays.size()? displays[i] : nullptr; }
display_manager *display_factory() const { return m_display_factory; }
static char* get_version() { return (char*) SWITCHRES_VERSION; };
// setters (log manager)
void set_log_level(int log_level);
void set_log_verbose_fn(void *func_ptr);
void set_log_info_fn(void *func_ptr);
void set_log_error_fn(void *func_ptr);
void set_current_display(int index);
void set_option(const char* key, const char* value);
// interface
display_manager* add_display(bool parse_options = true);
bool parse_config(const char *file_name);
// display list
std::vector<display_manager *> displays;
private:
display_manager *m_display_factory = 0;
display_manager *m_current_display = 0;
};
#endif