summaryrefslogtreecommitdiff
path: root/libkms++/property.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libkms++/property.cpp')
-rw-r--r--libkms++/property.cpp36
1 files changed, 36 insertions, 0 deletions
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 <xf86drm.h>
+#include <xf86drmMode.h>
+
+#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;
+}
+}