qeventdispatcher_glib.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/platformsupport/eventdispatchers/qeventdispatcher_glib.cpp
Source codeSwitch to Preprocessed file
LineSourceCount
1/****************************************************************************-
2**-
3** Copyright (C) 2015 The Qt Company Ltd.-
4** Contact: http://www.qt.io/licensing/-
5**-
6** This file is part of the plugins of the Qt Toolkit.-
7**-
8** $QT_BEGIN_LICENSE:LGPL21$-
9** Commercial License Usage-
10** Licensees holding valid commercial Qt licenses may use this file in-
11** accordance with the commercial license agreement provided with the-
12** Software or, alternatively, in accordance with the terms contained in-
13** a written agreement between you and The Qt Company. For licensing terms-
14** and conditions see http://www.qt.io/terms-conditions. For further-
15** information use the contact form at http://www.qt.io/contact-us.-
16**-
17** GNU Lesser General Public License Usage-
18** Alternatively, this file may be used under the terms of the GNU Lesser-
19** General Public License version 2.1 or version 3 as published by the Free-
20** Software Foundation and appearing in the file LICENSE.LGPLv21 and-
21** LICENSE.LGPLv3 included in the packaging of this file. Please review the-
22** following information to ensure the GNU Lesser General Public License-
23** requirements will be met: https://www.gnu.org/licenses/lgpl.html and-
24** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.-
25**-
26** As a special exception, The Qt Company gives you certain additional-
27** rights. These rights are described in The Qt Company LGPL Exception-
28** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.-
29**-
30** $QT_END_LICENSE$-
31**-
32****************************************************************************/-
33-
34#include "qeventdispatcher_glib_p.h"-
35-
36#include "qguiapplication.h"-
37-
38#include "qplatformdefs.h"-
39-
40#include <glib.h>-
41#include "private/qguiapplication_p.h"-
42-
43#include <qdebug.h>-
44-
45QT_BEGIN_NAMESPACE-
46-
47struct GUserEventSource-
48{-
49 GSource source;-
50 QPAEventDispatcherGlib *q;-
51};-
52-
53static gboolean userEventSourcePrepare(GSource *s, gint *timeout)-
54{-
55 Q_UNUSED(s)-
56 Q_UNUSED(timeout)-
57-
58 return QWindowSystemInterface::windowSystemEventsQueued() > 0;
executed 507471 times by 126 tests: return QWindowSystemInterface::windowSystemEventsQueued() > 0;
Executed by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QClipboard
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDesktopWidget
  • tst_QDialog
  • tst_QDialogButtonBox
  • tst_QDockWidget
  • ...
507471
59}-
60-
61static gboolean userEventSourceCheck(GSource *source)-
62{-
63 return userEventSourcePrepare(source, 0);
executed 249873 times by 126 tests: return userEventSourcePrepare(source, 0);
Executed by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QClipboard
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDesktopWidget
  • tst_QDialog
  • tst_QDialogButtonBox
  • tst_QDockWidget
  • ...
249873
64}-
65-
66static gboolean userEventSourceDispatch(GSource *source, GSourceFunc, gpointer)-
67{-
68 GUserEventSource *userEventSource = reinterpret_cast<GUserEventSource *>(source);-
69 QPAEventDispatcherGlib *dispatcher = userEventSource->q;-
70 QWindowSystemInterface::sendWindowSystemEvents(dispatcher->m_flags);-
71 return true;
executed 7725 times by 109 tests: return true;
Executed by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDesktopWidget
  • tst_QDialog
  • tst_QDialogButtonBox
  • tst_QDockWidget
  • tst_QDoubleSpinBox
  • tst_QFileDialog2
  • ...
7725
72}-
73-
74static GSourceFuncs userEventSourceFuncs = {-
75 userEventSourcePrepare,-
76 userEventSourceCheck,-
77 userEventSourceDispatch,-
78 NULL,-
79 NULL,-
80 NULL-
81};-
82-
83QPAEventDispatcherGlibPrivate::QPAEventDispatcherGlibPrivate(GMainContext *context)-
84 : QEventDispatcherGlibPrivate(context)-
85{-
86 Q_Q(QPAEventDispatcherGlib);-
87 userEventSource = reinterpret_cast<GUserEventSource *>(g_source_new(&userEventSourceFuncs,-
88 sizeof(GUserEventSource)));-
89 userEventSource->q = q;-
90 g_source_set_can_recurse(&userEventSource->source, true);-
91 g_source_attach(&userEventSource->source, mainContext);-
92}
executed 129 times by 5 tests: end of block
Executed by:
  • tst_QApplication
  • tst_QGuiApplication
  • tst_qapplication - unknown status
  • tst_qprocess - unknown status
  • tst_selftests - unknown status
129
93-
94-
95QPAEventDispatcherGlib::QPAEventDispatcherGlib(QObject *parent)-
96 : QEventDispatcherGlib(*new QPAEventDispatcherGlibPrivate, parent)-
97 , m_flags(QEventLoop::AllEvents)-
98{-
99 Q_D(QPAEventDispatcherGlib);-
100 d->userEventSource->q = this;-
101}
executed 129 times by 5 tests: end of block
Executed by:
  • tst_QApplication
  • tst_QGuiApplication
  • tst_qapplication - unknown status
  • tst_qprocess - unknown status
  • tst_selftests - unknown status
129
102-
103QPAEventDispatcherGlib::~QPAEventDispatcherGlib()-
104{-
105 Q_D(QPAEventDispatcherGlib);-
106-
107 g_source_destroy(&d->userEventSource->source);-
108 g_source_unref(&d->userEventSource->source);-
109 d->userEventSource = 0;-
110}
executed 341 times by 220 tests: end of block
Executed by:
  • tst_QApplication
  • tst_QGuiApplication
  • tst_gestures - unknown status
  • tst_lancelot - unknown status
  • tst_languagechange - unknown status
  • tst_modeltest - unknown status
  • tst_qabstractbutton - unknown status
  • tst_qabstractitemview - unknown status
  • tst_qabstractprintdialog - unknown status
  • tst_qabstractproxymodel - unknown status
  • tst_qabstractscrollarea - unknown status
  • tst_qabstractslider - unknown status
  • tst_qabstractspinbox - unknown status
  • tst_qabstracttextdocumentlayout - unknown status
  • tst_qaccessibility - unknown status
  • tst_qaction - unknown status
  • tst_qactiongroup - unknown status
  • tst_qapplication - unknown status
  • tst_qbackingstore - unknown status
  • tst_qboxlayout - unknown status
  • tst_qbrush - unknown status
  • tst_qbuttongroup - unknown status
  • tst_qcalendarwidget - unknown status
  • tst_qcheckbox - unknown status
  • tst_qclipboard - unknown status
  • ...
341
111-
112bool QPAEventDispatcherGlib::processEvents(QEventLoop::ProcessEventsFlags flags)-
113{-
114 m_flags = flags;-
115 return QEventDispatcherGlib::processEvents(m_flags);
executed 257375 times by 126 tests: return QEventDispatcherGlib::processEvents(m_flags);
Executed by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QClipboard
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDesktopWidget
  • tst_QDialog
  • tst_QDialogButtonBox
  • tst_QDockWidget
  • ...
257375
116}-
117-
118QT_END_NAMESPACE-
Source codeSwitch to Preprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9