• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KUtils

  • sources
  • kde-4.14
  • kdelibs
  • kutils
  • kidletime
xsyncbasedpoller.h
Go to the documentation of this file.
1 /* This file is part of the KDE libraries
2  Copyright (C) 2009 Dario Freddi <drf at kde.org>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License version 2 as published by the Free Software Foundation.
7 
8  This library is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  Library General Public License for more details.
12 
13  You should have received a copy of the GNU Library General Public License
14  along with this library; see the file COPYING.LIB. If not, write to
15  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16  Boston, MA 02110-1301, USA.
17 */
18 
19 #ifndef XSYNCBASEDPOLLER_H
20 #define XSYNCBASEDPOLLER_H
21 
22 #include "abstractsystempoller.h"
23 
24 #include <kdebug.h>
25 #include <kapplication.h>
26 
27 #include <config-kidletime.h>
28 
29 #include <X11/Xlib.h>
30 #include <X11/extensions/sync.h>
31 
32 class XSyncBasedPoller : public AbstractSystemPoller
33 {
34  Q_OBJECT
35 
36 public:
37  static XSyncBasedPoller *instance();
38 
39  virtual ~XSyncBasedPoller();
40 
41  bool isAvailable();
42  bool setUpPoller();
43  void unloadPoller();
44 
45 protected:
46  bool x11Event(XEvent *event);
47  XSyncBasedPoller(QWidget *parent = 0);
48 
49 public slots:
50  void addTimeout(int nextTimeout);
51  void removeTimeout(int nextTimeout);
52  QList<int> timeouts() const;
53  int forcePollRequest();
54  void catchIdleEvent();
55  void stopCatchingIdleEvents();
56  void simulateUserActivity();
57 
58 private slots:
59  int poll();
60  void reloadAlarms();
61 
62 private:
63  void setAlarm(Display *dpy, XSyncAlarm *alarm, XSyncCounter counter,
64  XSyncTestType test, XSyncValue value);
65 
66 private:
67  Display * m_display;
68  int m_sync_event, m_sync_error;
69  XSyncCounter m_idleCounter;
70  QHash<int, XSyncAlarm> m_timeoutAlarm;
71  XSyncAlarm m_resetAlarm;
72  bool m_available;
73 };
74 
75 #endif /* XSYNCBASEDPOLLER_H */
76 
77 
QWidget
XSyncBasedPoller::addTimeout
void addTimeout(int nextTimeout)
Definition: xsyncbasedpoller.cpp:128
kdebug.h
kapplication.h
XSyncBasedPoller
Definition: xsyncbasedpoller.h:32
XSyncBasedPoller::catchIdleEvent
void catchIdleEvent()
Definition: xsyncbasedpoller.cpp:185
abstractsystempoller.h
XSyncBasedPoller::~XSyncBasedPoller
virtual ~XSyncBasedPoller()
Definition: xsyncbasedpoller.cpp:100
XSyncBasedPoller::stopCatchingIdleEvents
void stopCatchingIdleEvents()
Definition: xsyncbasedpoller.cpp:177
XSyncBasedPoller::unloadPoller
void unloadPoller()
Definition: xsyncbasedpoller.cpp:124
XSyncBasedPoller::removeTimeout
void removeTimeout(int nextTimeout)
Definition: xsyncbasedpoller.cpp:163
QHash< int, XSyncAlarm >
test
KGuiItem test()
XSyncBasedPoller::instance
static XSyncBasedPoller * instance()
Definition: xsyncbasedpoller.cpp:40
XSyncBasedPoller::XSyncBasedPoller
XSyncBasedPoller(QWidget *parent=0)
Definition: xsyncbasedpoller.cpp:49
QList< int >
XSyncBasedPoller::setUpPoller
bool setUpPoller()
Definition: xsyncbasedpoller.cpp:109
AbstractSystemPoller
Definition: abstractsystempoller.h:24
XSyncBasedPoller::timeouts
QList< int > timeouts() const
Definition: xsyncbasedpoller.cpp:172
XSyncBasedPoller::isAvailable
bool isAvailable()
Definition: xsyncbasedpoller.cpp:104
XSyncBasedPoller::forcePollRequest
int forcePollRequest()
Definition: xsyncbasedpoller.cpp:150
QObject::parent
QObject * parent() const
XSyncBasedPoller::simulateUserActivity
void simulateUserActivity()
Definition: xsyncbasedpoller.cpp:277
QWidget::event
virtual bool event(QEvent *event)
XSyncBasedPoller::x11Event
bool x11Event(XEvent *event)
Definition: xsyncbasedpoller.cpp:218
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:25:27 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KUtils

Skip menu "KUtils"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal