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

KUtils

  • 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
32class XSyncBasedPoller : public AbstractSystemPoller
33{
34 Q_OBJECT
35
36public:
37 static XSyncBasedPoller *instance();
38
39 virtual ~XSyncBasedPoller();
40
41 bool isAvailable();
42 bool setUpPoller();
43 void unloadPoller();
44
45protected:
46 bool x11Event(XEvent *event);
47 XSyncBasedPoller(QWidget *parent = 0);
48
49public 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
58private slots:
59 int poll();
60 void reloadAlarms();
61
62private:
63 void setAlarm(Display *dpy, XSyncAlarm *alarm, XSyncCounter counter,
64 XSyncTestType test, XSyncValue value);
65
66private:
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
abstractsystempoller.h
AbstractSystemPoller
Definition: abstractsystempoller.h:25
QHash
QList
QWidget
XSyncBasedPoller
Definition: xsyncbasedpoller.h:33
XSyncBasedPoller::timeouts
QList< int > timeouts() const
Definition: xsyncbasedpoller.cpp:172
XSyncBasedPoller::isAvailable
bool isAvailable()
Definition: xsyncbasedpoller.cpp:104
XSyncBasedPoller::~XSyncBasedPoller
virtual ~XSyncBasedPoller()
Definition: xsyncbasedpoller.cpp:100
XSyncBasedPoller::simulateUserActivity
void simulateUserActivity()
Definition: xsyncbasedpoller.cpp:277
XSyncBasedPoller::instance
static XSyncBasedPoller * instance()
Definition: xsyncbasedpoller.cpp:40
XSyncBasedPoller::forcePollRequest
int forcePollRequest()
Definition: xsyncbasedpoller.cpp:150
XSyncBasedPoller::removeTimeout
void removeTimeout(int nextTimeout)
Definition: xsyncbasedpoller.cpp:163
XSyncBasedPoller::setUpPoller
bool setUpPoller()
Definition: xsyncbasedpoller.cpp:109
XSyncBasedPoller::unloadPoller
void unloadPoller()
Definition: xsyncbasedpoller.cpp:124
XSyncBasedPoller::x11Event
bool x11Event(XEvent *event)
Definition: xsyncbasedpoller.cpp:218
XSyncBasedPoller::stopCatchingIdleEvents
void stopCatchingIdleEvents()
Definition: xsyncbasedpoller.cpp:177
XSyncBasedPoller::addTimeout
void addTimeout(int nextTimeout)
Definition: xsyncbasedpoller.cpp:128
XSyncBasedPoller::catchIdleEvent
void catchIdleEvent()
Definition: xsyncbasedpoller.cpp:185
kapplication.h
kdebug.h
test
KGuiItem test()
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 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-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 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
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