From 009828beac9bfe9c36d336a4de0d297f90aece52 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Mon, 28 Sep 2015 01:13:34 +0300 Subject: Initial version --- libkms++/property.cpp | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 libkms++/property.cpp (limited to 'libkms++/property.cpp') diff --git a/libkms++/property.cpp b/libkms++/property.cpp new file mode 100644 index 0000000..af6a0ae --- /dev/null +++ b/libkms++/property.cpp @@ -0,0 +1,36 @@ +#include +#include + +#include "kms++.h" + +namespace kms +{ + +struct PropertyPriv +{ + drmModePropertyPtr drm_prop; +}; + +Property::Property(Card& card, uint32_t id) + : DrmObject(card, id, DRM_MODE_OBJECT_PROPERTY) +{ + m_priv = new PropertyPriv(); + m_priv->drm_prop = drmModeGetProperty(card.fd(), id); +} + +Property::~Property() +{ + drmModeFreeProperty(m_priv->drm_prop); + delete m_priv; +} + +void Property::print_short() const +{ + printf("Property %d, %s\n", id(), name()); +} + +const char *Property::name() const +{ + return m_priv->drm_prop->name; +} +} -- cgit v1.2.3