KWayland

outputdevice_interface.cpp
1 /*
2  SPDX-FileCopyrightText: 2014 Martin Gräßlin <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5 */
6 #include "outputdevice_interface.h"
7 #include "global_p.h"
8 #include "display.h"
9 #include "logging.h"
10 
11 #include <wayland-server.h>
12 #include "wayland-org_kde_kwin_outputdevice-server-protocol.h"
13 #include <QDebug>
14 
15 namespace KWayland
16 {
17 namespace Server
18 {
19 
20 class OutputDeviceInterface::Private : public Global::Private
21 {
22 public:
23  struct ResourceData {
24  wl_resource *resource;
25  uint32_t version;
26  };
27  Private(OutputDeviceInterface *q, Display *d);
28  ~Private();
29 
30 
31  void updateGeometry();
32  void updateUuid();
33  void updateEdid();
34  void updateEnabled();
35  void updateScale();
36  void updateColorCurves();
37  void updateEisaId();
38  void updateSerialNumber();
39 
40  void sendGeometry(wl_resource *resource);
41  void sendMode(wl_resource *resource, const Mode &mode);
42  void sendDone(const ResourceData &data);
43  void sendUuid(const ResourceData &data);
44  void sendEdid(const ResourceData &data);
45  void sendEnabled(const ResourceData &data);
46  void sendScale(const ResourceData &data);
47  void sendColorCurves(const ResourceData &data);
48  void sendEisaId(const ResourceData &data);
49  void sendSerialNumber(const ResourceData &data);
50 
51  QSize physicalSize;
52  QPoint globalPosition;
53  QString manufacturer = QStringLiteral("org.kde.kwin");
54  QString model = QStringLiteral("none");
55  qreal scale = 1.0;
56  QString serialNumber;
57  QString eisaId;
58  SubPixel subPixel = SubPixel::Unknown;
59  Transform transform = Transform::Normal;
60  ColorCurves colorCurves;
61  QList<Mode> modes;
62  Mode currentMode;
63  QList<ResourceData> resources;
64 
65  QByteArray edid;
66  Enablement enabled = Enablement::Enabled;
67  QByteArray uuid;
68 
69  static OutputDeviceInterface *get(wl_resource *native);
70 
71 private:
72  static Private *cast(wl_resource *native);
73  static void unbind(wl_resource *resource);
74  void bind(wl_client *client, uint32_t version, uint32_t id) override;
75  int32_t toTransform() const;
76  int32_t toSubPixel() const;
77 
78  static const quint32 s_version;
79  OutputDeviceInterface *q;
80  static QVector<Private*> s_privates;
81 };
82 
83 const quint32 OutputDeviceInterface::Private::s_version = 2;
84 
85 QVector<OutputDeviceInterface::Private*> OutputDeviceInterface::Private::s_privates;
86 
87 OutputDeviceInterface::Private::Private(OutputDeviceInterface *q, Display *d)
88  : Global::Private(d, &org_kde_kwin_outputdevice_interface, s_version)
89  , q(q)
90 {
91  s_privates << this;
92 }
93 
94 OutputDeviceInterface::Private::~Private()
95 {
96  s_privates.removeAll(this);
97 }
98 
99 OutputDeviceInterface *OutputDeviceInterface::Private::get(wl_resource *native)
100 {
101  if (Private *p = cast(native)) {
102  return p->q;
103  }
104  return nullptr;
105 }
106 
107 OutputDeviceInterface::Private *OutputDeviceInterface::Private::cast(wl_resource *native)
108 {
109  for (auto it = s_privates.constBegin(); it != s_privates.constEnd(); ++it) {
110  const auto &resources = (*it)->resources;
111  auto rit = std::find_if(resources.begin(), resources.end(), [native] (const ResourceData &data) { return data.resource == native; });
112  if (rit != resources.end()) {
113  return (*it);
114  }
115  }
116  return nullptr;
117 }
118 
119 OutputDeviceInterface::OutputDeviceInterface(Display *display, QObject *parent)
120  : Global(new Private(this, display), parent)
121 {
122  Q_D();
123  connect(this, &OutputDeviceInterface::currentModeChanged, this,
124  [d] {
125  Q_ASSERT(d->currentMode.id >= 0);
126  for (auto it = d->resources.constBegin(); it != d->resources.constEnd(); ++it) {
127  d->sendMode((*it).resource, d->currentMode);
128  d->sendDone(*it);
129  }
130  wl_display_flush_clients(*(d->display));
131  }
132  );
133  connect(this, &OutputDeviceInterface::subPixelChanged, this, [d] { d->updateGeometry(); });
134  connect(this, &OutputDeviceInterface::transformChanged, this, [d] { d->updateGeometry(); });
135  connect(this, &OutputDeviceInterface::globalPositionChanged, this, [d] { d->updateGeometry(); });
136  connect(this, &OutputDeviceInterface::modelChanged, this, [d] { d->updateGeometry(); });
137  connect(this, &OutputDeviceInterface::manufacturerChanged, this, [d] { d->updateGeometry(); });
138  connect(this, &OutputDeviceInterface::scaleFChanged, this, [d] { d->updateScale(); });
139  connect(this, &OutputDeviceInterface::scaleChanged, this, [d] { d->updateScale(); });
140  connect(this, &OutputDeviceInterface::colorCurvesChanged, this, [d] { d->updateColorCurves(); });
141 }
142 
143 OutputDeviceInterface::~OutputDeviceInterface() = default;
144 
145 QSize OutputDeviceInterface::pixelSize() const
146 {
147  Q_D();
148 
149  if (d->currentMode.id == -1) {
150  return QSize();
151  }
152  return d->currentMode.size;
153 }
154 
155 OutputDeviceInterface *OutputDeviceInterface::get(wl_resource* native)
156 {
157  return Private::get(native);
158 }
159 
160 int OutputDeviceInterface::refreshRate() const
161 {
162  Q_D();
163 
164  if (d->currentMode.id == -1) {
165  return 60000;
166  }
167  return d->currentMode.refreshRate;
168 }
169 
170 void OutputDeviceInterface::addMode(Mode &mode)
171 {
172  Q_ASSERT(!isValid());
173  Q_ASSERT(mode.id >= 0);
174  Q_ASSERT(mode.size.isValid());
175  Q_D();
176 
177  auto currentModeIt = std::find_if(d->modes.begin(), d->modes.end(),
178  [](const Mode &mode) {
179  return mode.flags.testFlag(ModeFlag::Current);
180  }
181  );
182  if (currentModeIt == d->modes.end() && !mode.flags.testFlag(ModeFlag::Current)) {
183  // no mode with current flag - enforce
184  mode.flags |= ModeFlag::Current;
185  }
186  if (currentModeIt != d->modes.end() && mode.flags.testFlag(ModeFlag::Current)) {
187  // another mode has the current flag - remove
188  (*currentModeIt).flags &= ~uint(ModeFlag::Current);
189  }
190 
191  if (mode.flags.testFlag(ModeFlag::Preferred)) {
192  // remove from existing Preferred mode
193  auto preferredIt = std::find_if(d->modes.begin(), d->modes.end(),
194  [](const Mode &mode) {
195  return mode.flags.testFlag(ModeFlag::Preferred);
196  }
197  );
198  if (preferredIt != d->modes.end()) {
199  (*preferredIt).flags &= ~uint(ModeFlag::Preferred);
200  }
201  }
202 
203  auto existingModeIt = std::find_if(d->modes.begin(), d->modes.end(),
204  [mode](const Mode &mode_it) {
205  return mode.size == mode_it.size &&
206  mode.refreshRate == mode_it.refreshRate &&
207  mode.id == mode_it.id;
208  }
209  );
210  auto emitChanges = [this, d, mode] {
211  emit modesChanged();
212  if (mode.flags.testFlag(ModeFlag::Current)) {
213  d->currentMode = mode;
214  emit refreshRateChanged(mode.refreshRate);
215  emit pixelSizeChanged(mode.size);
216  emit currentModeChanged();
217  }
218  };
219  if (existingModeIt != d->modes.end()) {
220  if ((*existingModeIt).flags == mode.flags) {
221  // nothing to do
222  return;
223  }
224  (*existingModeIt).flags = mode.flags;
225  emitChanges();
226  return;
227  } else {
228  auto idIt = std::find_if(d->modes.constBegin(), d->modes.constEnd(),
229  [mode](const Mode &mode_it) {
230  return mode.id == mode_it.id;
231  }
232  );
233  if (idIt != d->modes.constEnd()) {
234  qCWarning(KWAYLAND_SERVER) << "Duplicate Mode id" << mode.id << ": not adding mode" << mode.size << mode.refreshRate;
235  return;
236  }
237 
238  }
239  d->modes << mode;
240  emitChanges();
241 }
242 
243 void OutputDeviceInterface::setCurrentMode(const int modeId)
244 {
245  Q_D();
246  auto currentModeIt = std::find_if(d->modes.begin(), d->modes.end(),
247  [](const Mode &mode) {
248  return mode.flags.testFlag(ModeFlag::Current);
249  }
250  );
251  if (currentModeIt != d->modes.end()) {
252  // another mode has the current flag - remove
253  (*currentModeIt).flags &= ~uint(ModeFlag::Current);
254  }
255 
256  auto existingModeIt = std::find_if(d->modes.begin(), d->modes.end(),
257  [modeId](const Mode &mode) {
258  return mode.id == modeId;
259  }
260  );
261 
262  Q_ASSERT(existingModeIt != d->modes.end());
263  (*existingModeIt).flags |= ModeFlag::Current;
264  d->currentMode = *existingModeIt;
265  emit modesChanged();
266  emit refreshRateChanged((*existingModeIt).refreshRate);
267  emit pixelSizeChanged((*existingModeIt).size);
268  emit currentModeChanged();
269 }
270 
271 int32_t OutputDeviceInterface::Private::toTransform() const
272 {
273  switch (transform) {
274  case Transform::Normal:
275  return WL_OUTPUT_TRANSFORM_NORMAL;
276  case Transform::Rotated90:
277  return WL_OUTPUT_TRANSFORM_90;
278  case Transform::Rotated180:
279  return WL_OUTPUT_TRANSFORM_180;
280  case Transform::Rotated270:
281  return WL_OUTPUT_TRANSFORM_270;
282  case Transform::Flipped:
283  return WL_OUTPUT_TRANSFORM_FLIPPED;
284  case Transform::Flipped90:
285  return WL_OUTPUT_TRANSFORM_FLIPPED_90;
286  case Transform::Flipped180:
287  return WL_OUTPUT_TRANSFORM_FLIPPED_180;
288  case Transform::Flipped270:
289  return WL_OUTPUT_TRANSFORM_FLIPPED_270;
290  }
291  abort();
292 }
293 
294 int32_t OutputDeviceInterface::Private::toSubPixel() const
295 {
296  switch (subPixel) {
297  case SubPixel::Unknown:
298  return WL_OUTPUT_SUBPIXEL_UNKNOWN;
299  case SubPixel::None:
300  return WL_OUTPUT_SUBPIXEL_NONE;
301  case SubPixel::HorizontalRGB:
302  return WL_OUTPUT_SUBPIXEL_HORIZONTAL_RGB;
303  case SubPixel::HorizontalBGR:
304  return WL_OUTPUT_SUBPIXEL_HORIZONTAL_BGR;
305  case SubPixel::VerticalRGB:
306  return WL_OUTPUT_SUBPIXEL_VERTICAL_RGB;
307  case SubPixel::VerticalBGR:
308  return WL_OUTPUT_SUBPIXEL_VERTICAL_BGR;
309  }
310  abort();
311 }
312 
313 void OutputDeviceInterface::Private::bind(wl_client *client, uint32_t version, uint32_t id)
314 {
315  auto c = display->getConnection(client);
316  wl_resource *resource = c->createResource(&org_kde_kwin_outputdevice_interface, qMin(version, s_version), id);
317  if (!resource) {
318  wl_client_post_no_memory(client);
319  return;
320  }
321  wl_resource_set_user_data(resource, this);
322  wl_resource_set_destructor(resource, unbind);
323  ResourceData r;
324  r.resource = resource;
325  r.version = version;
326  resources << r;
327 
328  sendGeometry(resource);
329  sendScale(r);
330  sendColorCurves(r);
331  sendEisaId(r);
332  sendSerialNumber(r);
333 
334  auto currentModeIt = modes.constEnd();
335  for (auto it = modes.constBegin(); it != modes.constEnd(); ++it) {
336  const Mode &mode = *it;
337  if (mode.flags.testFlag(ModeFlag::Current)) {
338  // needs to be sent as last mode
339  currentModeIt = it;
340  continue;
341  }
342  sendMode(resource, mode);
343  }
344 
345  if (currentModeIt != modes.constEnd()) {
346  sendMode(resource, *currentModeIt);
347  }
348 
349  sendUuid(r);
350  sendEdid(r);
351  sendEnabled(r);
352 
353  sendDone(r);
354  c->flush();
355 }
356 
357 void OutputDeviceInterface::Private::unbind(wl_resource *resource)
358 {
359  Private *o = cast(resource);
360  if (!o) {
361  return;
362  }
363  auto it = std::find_if(o->resources.begin(), o->resources.end(), [resource](const ResourceData &r) { return r.resource == resource; });
364  if (it != o->resources.end()) {
365  o->resources.erase(it);
366  }
367 }
368 
369 void OutputDeviceInterface::Private::sendMode(wl_resource *resource, const Mode &mode)
370 {
371  int32_t flags = 0;
372  if (mode.flags.testFlag(ModeFlag::Current)) {
373  flags |= WL_OUTPUT_MODE_CURRENT;
374  }
375  if (mode.flags.testFlag(ModeFlag::Preferred)) {
376  flags |= WL_OUTPUT_MODE_PREFERRED;
377  }
378  org_kde_kwin_outputdevice_send_mode(resource,
379  flags,
380  mode.size.width(),
381  mode.size.height(),
382  mode.refreshRate,
383  mode.id);
384 
385 }
386 
387 void OutputDeviceInterface::Private::sendGeometry(wl_resource *resource)
388 {
389  org_kde_kwin_outputdevice_send_geometry(resource,
390  globalPosition.x(),
391  globalPosition.y(),
394  toSubPixel(),
395  qPrintable(manufacturer),
396  qPrintable(model),
397  toTransform());
398 }
399 
400 void OutputDeviceInterface::Private::sendScale(const ResourceData &data)
401 {
402  if (wl_resource_get_version(data.resource) < ORG_KDE_KWIN_OUTPUTDEVICE_SCALEF_SINCE_VERSION) {
403  org_kde_kwin_outputdevice_send_scale(data.resource, qRound(scale));
404  } else {
405  org_kde_kwin_outputdevice_send_scalef(data.resource, wl_fixed_from_double(scale));
406  }
407 }
408 
409 void OutputDeviceInterface::Private::sendColorCurves(const ResourceData &data)
410 {
411  if (data.version < ORG_KDE_KWIN_OUTPUTDEVICE_COLORCURVES_SINCE_VERSION) {
412  return;
413  }
414 
415  wl_array wlRed, wlGreen, wlBlue;
416 
417  auto fillArray = [](const QVector<quint16> &origin, wl_array *dest) {
418  wl_array_init(dest);
419  const size_t memLength = sizeof(uint16_t) * origin.size();
420  void *s = wl_array_add(dest, memLength);
421  memcpy(s, origin.data(), memLength);
422  };
423  fillArray(colorCurves.red, &wlRed);
424  fillArray(colorCurves.green, &wlGreen);
425  fillArray(colorCurves.blue, &wlBlue);
426 
427  org_kde_kwin_outputdevice_send_colorcurves(data.resource, &wlRed, &wlGreen, &wlBlue);
428 
429  wl_array_release(&wlRed);
430  wl_array_release(&wlGreen);
431  wl_array_release(&wlBlue);
432 }
433 
434 void KWayland::Server::OutputDeviceInterface::Private::sendSerialNumber(const ResourceData &data)
435 {
436  if (wl_resource_get_version(data.resource) >= ORG_KDE_KWIN_OUTPUTDEVICE_SERIAL_NUMBER_SINCE_VERSION) {
437  org_kde_kwin_outputdevice_send_serial_number(data.resource,
438  qPrintable(serialNumber));
439  }
440 }
441 
442 void KWayland::Server::OutputDeviceInterface::Private::sendEisaId(const ResourceData &data)
443 {
444  if (wl_resource_get_version(data.resource) >= ORG_KDE_KWIN_OUTPUTDEVICE_EISA_ID_SINCE_VERSION) {
445  org_kde_kwin_outputdevice_send_eisa_id(data.resource,
446  qPrintable(eisaId));
447  }
448 }
449 
450 
451 void OutputDeviceInterface::Private::sendDone(const ResourceData &data)
452 {
453  org_kde_kwin_outputdevice_send_done(data.resource);
454 }
455 
456 void OutputDeviceInterface::Private::updateGeometry()
457 {
458  for (auto it = resources.constBegin(); it != resources.constEnd(); ++it) {
459  sendGeometry((*it).resource);
460  sendDone(*it);
461  }
462 }
463 
464 void OutputDeviceInterface::Private::updateScale()
465 {
466  for (auto it = resources.constBegin(); it != resources.constEnd(); ++it) {
467  sendScale(*it);
468  sendDone(*it);
469  }
470 }
471 
472 void OutputDeviceInterface::Private::updateColorCurves()
473 {
474  for (auto it = resources.constBegin(); it != resources.constEnd(); ++it) {
475  sendColorCurves(*it);
476  sendDone(*it);
477  }
478 }
479 
480 bool OutputDeviceInterface::ColorCurves::operator==(const ColorCurves &cc) const
481 {
482  return red == cc.red && green == cc.green && blue == cc.blue;
483 }
484 bool OutputDeviceInterface::ColorCurves::operator!=(const ColorCurves &cc) const {
485  return !operator==(cc);
486 }
487 
488 #define SETTER(setterName, type, argumentName) \
489  void OutputDeviceInterface::setterName(type arg) \
490  { \
491  Q_D(); \
492  if (d->argumentName == arg) { \
493  return; \
494  } \
495  d->argumentName = arg; \
496  emit argumentName##Changed(d->argumentName); \
497  }
498 
499 SETTER(setPhysicalSize, const QSize&, physicalSize)
500 SETTER(setGlobalPosition, const QPoint&, globalPosition)
501 SETTER(setManufacturer, const QString&, manufacturer)
502 SETTER(setModel, const QString&, model)
503 SETTER(setSerialNumber, const QString&, serialNumber)
504 SETTER(setEisaId, const QString&, eisaId)
505 SETTER(setSubPixel, SubPixel, subPixel)
506 SETTER(setTransform, Transform, transform)
507 
508 #undef SETTER
509 
510 void OutputDeviceInterface::setScale(int scale)
511 {
512  Q_D();
513  if (d->scale == scale) {
514  return;
515  }
516  d->scale = scale;
517  emit scaleChanged(d->scale);
518  emit scaleFChanged(d->scale);
519 }
520 
521 void OutputDeviceInterface::setScaleF(qreal scale)
522 {
523  Q_D();
524  if (qFuzzyCompare(d->scale, scale)) {
525  return;
526  }
527  d->scale = scale;
528  emit scaleChanged(qRound(d->scale));
529  emit scaleFChanged(d->scale);
530 }
531 
532 QSize OutputDeviceInterface::physicalSize() const
533 {
534  Q_D();
535  return d->physicalSize;
536 }
537 
538 QPoint OutputDeviceInterface::globalPosition() const
539 {
540  Q_D();
541  return d->globalPosition;
542 }
543 
544 QString OutputDeviceInterface::manufacturer() const
545 {
546  Q_D();
547  return d->manufacturer;
548 }
549 
550 QString OutputDeviceInterface::model() const
551 {
552  Q_D();
553  return d->model;
554 }
555 
556 QString OutputDeviceInterface::serialNumber() const
557 {
558  Q_D();
559  return d->serialNumber;
560 }
561 
562 QString OutputDeviceInterface::eisaId() const
563 {
564  Q_D();
565  return d->eisaId;
566 }
567 
568 int OutputDeviceInterface::scale() const
569 {
570  Q_D();
571  return qRound(d->scale);
572 }
573 
574 qreal OutputDeviceInterface::scaleF() const
575 {
576  Q_D();
577  return d->scale;
578 }
579 
580 
581 OutputDeviceInterface::SubPixel OutputDeviceInterface::subPixel() const
582 {
583  Q_D();
584  return d->subPixel;
585 }
586 
587 OutputDeviceInterface::Transform OutputDeviceInterface::transform() const
588 {
589  Q_D();
590  return d->transform;
591 }
592 
593 OutputDeviceInterface::ColorCurves OutputDeviceInterface::colorCurves() const
594 {
595  Q_D();
596  return d->colorCurves;
597 }
598 
599 QList< OutputDeviceInterface::Mode > OutputDeviceInterface::modes() const
600 {
601  Q_D();
602  return d->modes;
603 }
604 
605 int OutputDeviceInterface::currentModeId() const
606 {
607  Q_D();
608  for (const Mode &m: d->modes) {
609  if (m.flags.testFlag(OutputDeviceInterface::ModeFlag::Current)) {
610  return m.id;
611  }
612  }
613  return -1;
614 }
615 
616 OutputDeviceInterface::Private *OutputDeviceInterface::d_func() const
617 {
618  return reinterpret_cast<Private*>(d.data());
619 }
620 
621 void OutputDeviceInterface::setColorCurves(const ColorCurves &colorCurves)
622 {
623  Q_D();
624 
625  if (d->colorCurves == colorCurves) {
626  return;
627  }
628  d->colorCurves = colorCurves;
629  emit colorCurvesChanged(d->colorCurves);
630 }
631 
632 void OutputDeviceInterface::setEdid(const QByteArray &edid)
633 {
634  Q_D();
635  d->edid = edid;
636  d->updateEdid();
637  emit edidChanged();
638 }
639 
640 QByteArray OutputDeviceInterface::edid() const
641 {
642  Q_D();
643  return d->edid;
644 }
645 
646 void OutputDeviceInterface::setEnabled(OutputDeviceInterface::Enablement enabled)
647 {
648  Q_D();
649  if (d->enabled != enabled) {
650  d->enabled = enabled;
651  d->updateEnabled();
652  emit enabledChanged();
653  }
654 }
655 
656 OutputDeviceInterface::Enablement OutputDeviceInterface::enabled() const
657 {
658  Q_D();
659  return d->enabled;
660 }
661 
662 void OutputDeviceInterface::setUuid(const QByteArray &uuid)
663 {
664  Q_D();
665  if (d->uuid != uuid) {
666  d->uuid = uuid;
667  d->updateUuid();
668  emit uuidChanged();
669  }
670 }
671 
672 QByteArray OutputDeviceInterface::uuid() const
673 {
674  Q_D();
675  return d->uuid;
676 }
677 
678 void KWayland::Server::OutputDeviceInterface::Private::sendEdid(const ResourceData &data)
679 {
680  org_kde_kwin_outputdevice_send_edid(data.resource,
681  edid.toBase64().constData());
682 }
683 
684 void KWayland::Server::OutputDeviceInterface::Private::sendEnabled(const ResourceData &data)
685 {
686  int _enabled = 0;
687  if (enabled == OutputDeviceInterface::Enablement::Enabled) {
688  _enabled = 1;
689  }
690  org_kde_kwin_outputdevice_send_enabled(data.resource, _enabled);
691 }
692 
693 void OutputDeviceInterface::Private::sendUuid(const ResourceData &data)
694 {
695  org_kde_kwin_outputdevice_send_uuid(data.resource, uuid.constData());
696 }
697 
698 void KWayland::Server::OutputDeviceInterface::Private::updateEnabled()
699 {
700  for (auto it = resources.constBegin(); it != resources.constEnd(); ++it) {
701  sendEnabled(*it);
702  }
703 }
704 
705 void KWayland::Server::OutputDeviceInterface::Private::updateEdid()
706 {
707  for (auto it = resources.constBegin(); it != resources.constEnd(); ++it) {
708  sendEdid(*it);
709  }
710 }
711 
712 void KWayland::Server::OutputDeviceInterface::Private::updateUuid()
713 {
714  for (auto it = resources.constBegin(); it != resources.constEnd(); ++it) {
715  sendUuid(*it);
716  }
717 }
718 
719 void KWayland::Server::OutputDeviceInterface::Private::updateEisaId()
720 {
721  for (auto it = resources.constBegin(); it != resources.constEnd(); ++it) {
722  sendEisaId(*it);
723  }
724 }
725 
726 
727 }
728 }
QList< Mode > modes() const
QSize physicalSize() const
Size in millimeters.
void uuidChanged(const QByteArray &uuid)
Emitted whenever the id property changes.
int width() const const
int scale() const
Scaling factor of this output.
QString serialNumber() const
Textual representation of serial number.
Transform transform() const
Transform that maps framebuffer to OutputDevice.
void enabledChanged(OutputDevice::Enablement enabled)
Emitted whenever the enabled property changes.
KDOCTOOLS_EXPORT QString transform(const QString &file, const QString &stylesheet, const QVector< const char * > &params=QVector< const char * >())
int x() const const
int y() const const
QString manufacturer() const
Textual description of the manufacturer.
T * data()
QString eisaId() const
Textual representation of EISA identifier.
const char * constData() const const
void colorCurvesChanged()
Emitted whenever the color curves changed.
SubPixel subPixel() const
Subpixel orientation of this OutputDevice.
T * data() const const
int height() const const
QPoint globalPosition() const
Position within the global compositor space.
QList::const_iterator constEnd() const const
QList::const_iterator constBegin() const const
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QObject * parent() const const
int size() const const
ColorCurves colorCurves() const
Color curves.
OutputDevice::Enablement enabled() const
QByteArray toBase64(QByteArray::Base64Options options) const const
QString model() const
Textual description of the model.
KDB_EXPORT KDbVersionInfo version()
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Fri Aug 7 2020 22:48:18 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.