Changeset View
Changeset View
Standalone View
Standalone View
plugins/platforms/drm/drm_object.h
Show First 20 Lines • Show All 55 Lines • ▼ Show 20 Line(s) | 38 | public: | |||
---|---|---|---|---|---|
56 | 56 | | |||
57 | uint32_t propId(int prop) { | 57 | uint32_t propId(int prop) { | ||
58 | return m_props[prop]->propId(); | 58 | return m_props[prop]->propId(); | ||
59 | } | 59 | } | ||
60 | uint64_t value(int prop) { | 60 | uint64_t value(int prop) { | ||
61 | return m_props[prop]->value(); | 61 | return m_props[prop]->value(); | ||
62 | } | 62 | } | ||
63 | 63 | | |||
64 | bool propHasEnum(int prop, uint64_t value) const { | ||||
broulik: Const | |||||
65 | return m_props[prop]->hasEnum(value); | ||||
66 | } | ||||
67 | | ||||
64 | void setValue(int prop, uint64_t new_value) | 68 | void setValue(int prop, uint64_t new_value) | ||
65 | { | 69 | { | ||
66 | Q_ASSERT(prop < m_props.size()); | 70 | Q_ASSERT(prop < m_props.size()); | ||
67 | m_props[prop]->setValue(new_value); | 71 | m_props[prop]->setValue(new_value); | ||
68 | } | 72 | } | ||
69 | 73 | | |||
70 | virtual bool atomicPopulate(drmModeAtomicReq *req); | 74 | virtual bool atomicPopulate(drmModeAtomicReq *req); | ||
71 | 75 | | |||
Show All 17 Lines | 92 | public: | |||
89 | Property(drmModePropertyRes *prop, uint64_t val, QVector<QByteArray> enumNames); | 93 | Property(drmModePropertyRes *prop, uint64_t val, QVector<QByteArray> enumNames); | ||
90 | virtual ~Property(); | 94 | virtual ~Property(); | ||
91 | 95 | | |||
92 | void initEnumMap(drmModePropertyRes *prop); | 96 | void initEnumMap(drmModePropertyRes *prop); | ||
93 | 97 | | |||
94 | uint64_t enumMap(int n) { | 98 | uint64_t enumMap(int n) { | ||
95 | return m_enumMap[n]; // TODO: test on index out of bounds? | 99 | return m_enumMap[n]; // TODO: test on index out of bounds? | ||
96 | } | 100 | } | ||
101 | bool hasEnum(uint64_t value) const { | ||||
102 | return m_enumMap.contains(value); | ||||
103 | } | ||||
97 | 104 | | |||
98 | uint32_t propId() { | 105 | uint32_t propId() { | ||
99 | return m_propId; | 106 | return m_propId; | ||
100 | } | 107 | } | ||
101 | uint64_t value() { | 108 | uint64_t value() { | ||
102 | return m_value; | 109 | return m_value; | ||
103 | } | 110 | } | ||
104 | void setValue(uint64_t new_value) { | 111 | void setValue(uint64_t new_value) { | ||
Show All 18 Lines |
Const