Changeset View
Changeset View
Standalone View
Standalone View
tests/plasmasurfacetest.cpp
Show First 20 Lines • Show All 47 Lines • ▼ Show 20 Line(s) | 39 | public: | |||
---|---|---|---|---|---|
48 | void setSkipTaskbar(bool set) { | 48 | void setSkipTaskbar(bool set) { | ||
49 | m_skipTaskbar = set; | 49 | m_skipTaskbar = set; | ||
50 | } | 50 | } | ||
51 | 51 | | |||
52 | void setSkipSwitcher(bool set) { | 52 | void setSkipSwitcher(bool set) { | ||
53 | m_skipSwitcher = set; | 53 | m_skipSwitcher = set; | ||
54 | } | 54 | } | ||
55 | 55 | | |||
56 | void setSkipPager(bool set) { | ||||
57 | m_skipPager = set; | ||||
58 | } | ||||
59 | | ||||
56 | private: | 60 | private: | ||
57 | void setupRegistry(Registry *registry); | 61 | void setupRegistry(Registry *registry); | ||
58 | void render(); | 62 | void render(); | ||
59 | QThread *m_connectionThread; | 63 | QThread *m_connectionThread; | ||
60 | ConnectionThread *m_connectionThreadObject; | 64 | ConnectionThread *m_connectionThreadObject; | ||
61 | EventQueue *m_eventQueue = nullptr; | 65 | EventQueue *m_eventQueue = nullptr; | ||
62 | Compositor *m_compositor = nullptr; | 66 | Compositor *m_compositor = nullptr; | ||
63 | Shell *m_shell = nullptr; | 67 | Shell *m_shell = nullptr; | ||
64 | ShellSurface *m_shellSurface = nullptr; | 68 | ShellSurface *m_shellSurface = nullptr; | ||
65 | ShmPool *m_shm = nullptr; | 69 | ShmPool *m_shm = nullptr; | ||
66 | Surface *m_surface = nullptr; | 70 | Surface *m_surface = nullptr; | ||
67 | PlasmaShell *m_plasmaShell = nullptr; | 71 | PlasmaShell *m_plasmaShell = nullptr; | ||
68 | PlasmaShellSurface *m_plasmaShellSurface = nullptr; | 72 | PlasmaShellSurface *m_plasmaShellSurface = nullptr; | ||
69 | PlasmaShellSurface::Role m_role = PlasmaShellSurface::Role::Normal; | 73 | PlasmaShellSurface::Role m_role = PlasmaShellSurface::Role::Normal; | ||
70 | bool m_skipTaskbar = false; | 74 | bool m_skipTaskbar = false; | ||
71 | bool m_skipSwitcher = false; | 75 | bool m_skipSwitcher = false; | ||
76 | bool m_skipPager = false; | ||||
72 | }; | 77 | }; | ||
73 | 78 | | |||
74 | PlasmaSurfaceTest::PlasmaSurfaceTest(QObject *parent) | 79 | PlasmaSurfaceTest::PlasmaSurfaceTest(QObject *parent) | ||
75 | : QObject(parent) | 80 | : QObject(parent) | ||
76 | , m_connectionThread(new QThread(this)) | 81 | , m_connectionThread(new QThread(this)) | ||
77 | , m_connectionThreadObject(new ConnectionThread()) | 82 | , m_connectionThreadObject(new ConnectionThread()) | ||
78 | { | 83 | { | ||
79 | } | 84 | } | ||
▲ Show 20 Lines • Show All 57 Lines • ▼ Show 20 Line(s) | 135 | [this] { | |||
137 | m_shellSurface = m_shell->createSurface(m_surface, this); | 142 | m_shellSurface = m_shell->createSurface(m_surface, this); | ||
138 | Q_ASSERT(m_shellSurface); | 143 | Q_ASSERT(m_shellSurface); | ||
139 | m_shellSurface->setToplevel(); | 144 | m_shellSurface->setToplevel(); | ||
140 | connect(m_shellSurface, &ShellSurface::sizeChanged, this, &PlasmaSurfaceTest::render); | 145 | connect(m_shellSurface, &ShellSurface::sizeChanged, this, &PlasmaSurfaceTest::render); | ||
141 | m_plasmaShellSurface = m_plasmaShell->createSurface(m_surface, this); | 146 | m_plasmaShellSurface = m_plasmaShell->createSurface(m_surface, this); | ||
142 | Q_ASSERT(m_plasmaShellSurface); | 147 | Q_ASSERT(m_plasmaShellSurface); | ||
143 | m_plasmaShellSurface->setSkipTaskbar(m_skipTaskbar); | 148 | m_plasmaShellSurface->setSkipTaskbar(m_skipTaskbar); | ||
144 | m_plasmaShellSurface->setSkipSwitcher(m_skipSwitcher); | 149 | m_plasmaShellSurface->setSkipSwitcher(m_skipSwitcher); | ||
150 | m_plasmaShellSurface->setSkipPager(m_skipPager); | ||||
145 | m_plasmaShellSurface->setRole(m_role); | 151 | m_plasmaShellSurface->setRole(m_role); | ||
146 | render(); | 152 | render(); | ||
147 | } | 153 | } | ||
148 | ); | 154 | ); | ||
149 | registry->setEventQueue(m_eventQueue); | 155 | registry->setEventQueue(m_eventQueue); | ||
150 | registry->create(m_connectionThreadObject); | 156 | registry->create(m_connectionThreadObject); | ||
151 | registry->setup(); | 157 | registry->setup(); | ||
152 | } | 158 | } | ||
Show All 28 Lines | 175 | { | |||
181 | QCommandLineOption tooltipOption(QStringLiteral("tooltip")); | 187 | QCommandLineOption tooltipOption(QStringLiteral("tooltip")); | ||
182 | parser.addOption(tooltipOption); | 188 | parser.addOption(tooltipOption); | ||
183 | QCommandLineOption skipTaskbarOption(QStringLiteral("skipTaskbar")); | 189 | QCommandLineOption skipTaskbarOption(QStringLiteral("skipTaskbar")); | ||
184 | parser.addOption(skipTaskbarOption); | 190 | parser.addOption(skipTaskbarOption); | ||
185 | parser.process(app); | 191 | parser.process(app); | ||
186 | QCommandLineOption skipSwitcherOption(QStringLiteral("skipSwitcher")); | 192 | QCommandLineOption skipSwitcherOption(QStringLiteral("skipSwitcher")); | ||
187 | parser.addOption(skipSwitcherOption); | 193 | parser.addOption(skipSwitcherOption); | ||
188 | parser.process(app); | 194 | parser.process(app); | ||
195 | QCommandLineOption skipPagerOption(QStringLiteral("skipPager")); | ||||
196 | parser.addOption(skipPagerOption); | ||||
197 | parser.process(app); | ||||
189 | 198 | | |||
190 | PlasmaSurfaceTest client; | 199 | PlasmaSurfaceTest client; | ||
191 | 200 | | |||
192 | if (parser.isSet(notificationOption)) { | 201 | if (parser.isSet(notificationOption)) { | ||
193 | client.setRole(PlasmaShellSurface::Role::Notification); | 202 | client.setRole(PlasmaShellSurface::Role::Notification); | ||
194 | } else if (parser.isSet(panelOption)) { | 203 | } else if (parser.isSet(panelOption)) { | ||
195 | client.setRole(PlasmaShellSurface::Role::Panel); | 204 | client.setRole(PlasmaShellSurface::Role::Panel); | ||
196 | } else if (parser.isSet(desktopOption)) { | 205 | } else if (parser.isSet(desktopOption)) { | ||
197 | client.setRole(PlasmaShellSurface::Role::Desktop); | 206 | client.setRole(PlasmaShellSurface::Role::Desktop); | ||
198 | } else if (parser.isSet(osdOption)) { | 207 | } else if (parser.isSet(osdOption)) { | ||
199 | client.setRole(PlasmaShellSurface::Role::OnScreenDisplay); | 208 | client.setRole(PlasmaShellSurface::Role::OnScreenDisplay); | ||
200 | } else if (parser.isSet(tooltipOption)) { | 209 | } else if (parser.isSet(tooltipOption)) { | ||
201 | client.setRole(PlasmaShellSurface::Role::ToolTip); | 210 | client.setRole(PlasmaShellSurface::Role::ToolTip); | ||
202 | } | 211 | } | ||
203 | client.setSkipTaskbar(parser.isSet(skipTaskbarOption)); | 212 | client.setSkipTaskbar(parser.isSet(skipTaskbarOption)); | ||
204 | client.setSkipSwitcher(parser.isSet(skipSwitcherOption)); | 213 | client.setSkipSwitcher(parser.isSet(skipSwitcherOption)); | ||
214 | client.setSkipPager(parser.isSet(skipPagerOption)); | ||||
205 | 215 | | |||
206 | client.init(); | 216 | client.init(); | ||
207 | 217 | | |||
208 | return app.exec(); | 218 | return app.exec(); | ||
209 | } | 219 | } | ||
210 | 220 | | |||
211 | #include "plasmasurfacetest.moc" | 221 | #include "plasmasurfacetest.moc" |