diff options
author | Tomi Valkeinen <tomi.valkeinen@iki.fi> | 2015-09-28 01:13:34 +0300 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@iki.fi> | 2015-09-28 01:13:34 +0300 |
commit | 009828beac9bfe9c36d336a4de0d297f90aece52 (patch) | |
tree | 3ea6b22f2036dcc0c23c459ce53bfc2ad282e3e7 /libkms++/card.h |
Initial version
Diffstat (limited to 'libkms++/card.h')
-rw-r--r-- | libkms++/card.h | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/libkms++/card.h b/libkms++/card.h new file mode 100644 index 0000000..fb45d04 --- /dev/null +++ b/libkms++/card.h @@ -0,0 +1,49 @@ +#pragma once + +#include <cstdint> +#include <vector> +#include <map> + +#include "decls.h" + +namespace kms +{ + +class Card +{ +public: + Card(); + ~Card(); + + Card(const Card& other) = delete; + Card& operator=(const Card& other) = delete; + + int fd() const { return m_fd; } + + Connector* get_first_connected_connector() const; + + DrmObject* get_object(uint32_t id) const; + Crtc* get_crtc(uint32_t id) const; + Crtc* get_crtc_by_index(uint32_t idx) const; + Encoder* get_encoder(uint32_t id) const; + Property* get_prop(uint32_t id) const; + Property* get_prop(const char *name) const; + + bool master() const { return m_master; } + bool has_atomic() const { return m_has_atomic; } + + void print_short() const; + + std::vector<Connector*> get_connectors() const; + std::vector<DrmObject*> get_objects() const; + std::vector<Plane*> get_planes() const; + +private: + std::map<uint32_t, DrmObject*> m_obmap; + + int m_fd; + bool m_master; + + bool m_has_atomic; +}; +} |