Kerberos: add kerberos_inject_longterm_key() helper function
[wireshark-sm.git] / ui / qt / glib_mainloop_on_qeventloop.h
blob9a641e047f6a4c8dd40c9bc775b969ed2a7e379a
1 /** @file
3 * Copyright 2022 Tomasz Mon <desowin@gmail.com>
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 */
8 #ifndef GLIB_MAINLOOP_ON_QEVENTLOOP_H
9 #define GLIB_MAINLOOP_ON_QEVENTLOOP_H
11 #include <QThread>
12 #include <QMutex>
13 #include <QWaitCondition>
15 class GLibPoller : public QThread
17 Q_OBJECT
19 protected:
20 explicit GLibPoller(GMainContext *context);
21 ~GLibPoller();
23 void run() override;
25 QMutex mutex_;
26 QWaitCondition dispatched_;
27 GMainContext *ctx_;
28 int priority_;
29 GPollFD *fds_;
30 int allocated_fds_, nfds_;
32 signals:
33 void polled(void);
35 friend class GLibMainloopOnQEventLoop;
38 class GLibMainloopOnQEventLoop : public QObject
40 Q_OBJECT
42 protected:
43 explicit GLibMainloopOnQEventLoop(QObject *parent);
44 ~GLibMainloopOnQEventLoop();
46 protected slots:
47 void checkAndDispatch();
49 public:
50 static void setup(QObject *parent);
52 protected:
53 GLibPoller poller_;
56 #endif /* GLIB_MAINLOOP_ON_QEVENTLOOP_H */