Changeset View
Changeset View
Standalone View
Standalone View
src/server/plasmashell_interface.cpp
Show First 20 Lines • Show All 71 Lines • ▼ Show 20 Line(s) | 70 | public: | |||
---|---|---|---|---|---|
72 | 72 | | |||
73 | SurfaceInterface *surface; | 73 | SurfaceInterface *surface; | ||
74 | QPoint m_globalPos; | 74 | QPoint m_globalPos; | ||
75 | Role m_role = Role::Normal; | 75 | Role m_role = Role::Normal; | ||
76 | bool m_positionSet = false; | 76 | bool m_positionSet = false; | ||
77 | PanelBehavior m_panelBehavior = PanelBehavior::AlwaysVisible; | 77 | PanelBehavior m_panelBehavior = PanelBehavior::AlwaysVisible; | ||
78 | bool m_skipTaskbar = false; | 78 | bool m_skipTaskbar = false; | ||
79 | bool m_skipSwitcher = false; | 79 | bool m_skipSwitcher = false; | ||
80 | bool m_skipPager = false; | ||||
80 | bool panelTakesFocus = false; | 81 | bool panelTakesFocus = false; | ||
81 | 82 | | |||
82 | private: | 83 | private: | ||
83 | // interface callbacks | 84 | // interface callbacks | ||
84 | static void setOutputCallback(wl_client *client, wl_resource *resource, wl_resource *output); | 85 | static void setOutputCallback(wl_client *client, wl_resource *resource, wl_resource *output); | ||
85 | static void setPositionCallback(wl_client *client, wl_resource *resource, int32_t x, int32_t y); | 86 | static void setPositionCallback(wl_client *client, wl_resource *resource, int32_t x, int32_t y); | ||
86 | static void setRoleCallback(wl_client *client, wl_resource *resource, uint32_t role); | 87 | static void setRoleCallback(wl_client *client, wl_resource *resource, uint32_t role); | ||
87 | static void setPanelBehaviorCallback(wl_client *client, wl_resource *resource, uint32_t flag); | 88 | static void setPanelBehaviorCallback(wl_client *client, wl_resource *resource, uint32_t flag); | ||
88 | static void setSkipTaskbarCallback(wl_client *client, wl_resource *resource, uint32_t skip); | 89 | static void setSkipTaskbarCallback(wl_client *client, wl_resource *resource, uint32_t skip); | ||
89 | static void setSkipSwitcherCallback(wl_client *client, wl_resource *resource, uint32_t skip); | 90 | static void setSkipSwitcherCallback(wl_client *client, wl_resource *resource, uint32_t skip); | ||
91 | static void setSkipPagerCallback(wl_client *client, wl_resource *resource, uint32_t skip); | ||||
90 | static void panelAutoHideHideCallback(wl_client *client, wl_resource *resource); | 92 | static void panelAutoHideHideCallback(wl_client *client, wl_resource *resource); | ||
91 | static void panelAutoHideShowCallback(wl_client *client, wl_resource *resource); | 93 | static void panelAutoHideShowCallback(wl_client *client, wl_resource *resource); | ||
92 | static void panelTakesFocusCallback(wl_client *client, wl_resource *resource, uint32_t takesFocus); | 94 | static void panelTakesFocusCallback(wl_client *client, wl_resource *resource, uint32_t takesFocus); | ||
93 | 95 | | |||
94 | void setPosition(const QPoint &globalPos); | 96 | void setPosition(const QPoint &globalPos); | ||
95 | void setRole(uint32_t role); | 97 | void setRole(uint32_t role); | ||
96 | void setPanelBehavior(org_kde_plasma_surface_panel_behavior behavior); | 98 | void setPanelBehavior(org_kde_plasma_surface_panel_behavior behavior); | ||
97 | 99 | | |||
▲ Show 20 Lines • Show All 65 Lines • ▼ Show 20 Line(s) | 163 | const struct org_kde_plasma_surface_interface PlasmaShellSurfaceInterface::Private::s_interface = { | |||
163 | setOutputCallback, | 165 | setOutputCallback, | ||
164 | setPositionCallback, | 166 | setPositionCallback, | ||
165 | setRoleCallback, | 167 | setRoleCallback, | ||
166 | setPanelBehaviorCallback, | 168 | setPanelBehaviorCallback, | ||
167 | setSkipTaskbarCallback, | 169 | setSkipTaskbarCallback, | ||
168 | panelAutoHideHideCallback, | 170 | panelAutoHideHideCallback, | ||
169 | panelAutoHideShowCallback, | 171 | panelAutoHideShowCallback, | ||
170 | panelTakesFocusCallback, | 172 | panelTakesFocusCallback, | ||
171 | setSkipSwitcherCallback | 173 | setSkipSwitcherCallback, | ||
174 | setSkipPagerCallback | ||||
172 | }; | 175 | }; | ||
173 | #endif | 176 | #endif | ||
174 | 177 | | |||
175 | PlasmaShellSurfaceInterface::PlasmaShellSurfaceInterface(PlasmaShellInterface *shell, SurfaceInterface *parent, wl_resource *parentResource) | 178 | PlasmaShellSurfaceInterface::PlasmaShellSurfaceInterface(PlasmaShellInterface *shell, SurfaceInterface *parent, wl_resource *parentResource) | ||
176 | : Resource(new Private(this, shell, parent, parentResource)) | 179 | : Resource(new Private(this, shell, parent, parentResource)) | ||
177 | { | 180 | { | ||
178 | auto unsetSurface = [this] { | 181 | auto unsetSurface = [this] { | ||
179 | Q_D(); | 182 | Q_D(); | ||
▲ Show 20 Lines • Show All 103 Lines • ▼ Show 20 Line(s) | |||||
283 | void PlasmaShellSurfaceInterface::Private::setSkipSwitcherCallback(wl_client *client, wl_resource *resource, uint32_t skip) | 286 | void PlasmaShellSurfaceInterface::Private::setSkipSwitcherCallback(wl_client *client, wl_resource *resource, uint32_t skip) | ||
284 | { | 287 | { | ||
285 | auto s = cast<Private>(resource); | 288 | auto s = cast<Private>(resource); | ||
286 | Q_ASSERT(client == *s->client); | 289 | Q_ASSERT(client == *s->client); | ||
287 | s->m_skipSwitcher = (bool)skip; | 290 | s->m_skipSwitcher = (bool)skip; | ||
288 | emit s->q_func()->skipSwitcherChanged(); | 291 | emit s->q_func()->skipSwitcherChanged(); | ||
289 | } | 292 | } | ||
290 | 293 | | |||
294 | void PlasmaShellSurfaceInterface::Private::setSkipPagerCallback(wl_client *client, wl_resource *resource, uint32_t skip) | ||||
295 | { | ||||
296 | auto s = cast<Private>(resource); | ||||
297 | Q_ASSERT(client == *s->client); | ||||
298 | s->m_skipPager = (bool)skip; | ||||
299 | emit s->q_func()->skipPagerChanged(); | ||||
300 | } | ||||
301 | | ||||
291 | void PlasmaShellSurfaceInterface::Private::panelAutoHideHideCallback(wl_client *client, wl_resource *resource) | 302 | void PlasmaShellSurfaceInterface::Private::panelAutoHideHideCallback(wl_client *client, wl_resource *resource) | ||
292 | { | 303 | { | ||
293 | auto s = cast<Private>(resource); | 304 | auto s = cast<Private>(resource); | ||
294 | Q_ASSERT(client == *s->client); | 305 | Q_ASSERT(client == *s->client); | ||
295 | if (s->m_role != Role::Panel || s->m_panelBehavior != PanelBehavior::AutoHide) { | 306 | if (s->m_role != Role::Panel || s->m_panelBehavior != PanelBehavior::AutoHide) { | ||
296 | wl_resource_post_error(s->resource, ORG_KDE_PLASMA_SURFACE_ERROR_PANEL_NOT_AUTO_HIDE, "Not an auto hide panel"); | 307 | wl_resource_post_error(s->resource, ORG_KDE_PLASMA_SURFACE_ERROR_PANEL_NOT_AUTO_HIDE, "Not an auto hide panel"); | ||
297 | return; | 308 | return; | ||
298 | } | 309 | } | ||
▲ Show 20 Lines • Show All 74 Lines • ▼ Show 20 Line(s) | |||||
373 | } | 384 | } | ||
374 | 385 | | |||
375 | bool PlasmaShellSurfaceInterface::skipSwitcher() const | 386 | bool PlasmaShellSurfaceInterface::skipSwitcher() const | ||
376 | { | 387 | { | ||
377 | Q_D(); | 388 | Q_D(); | ||
378 | return d->m_skipSwitcher; | 389 | return d->m_skipSwitcher; | ||
379 | } | 390 | } | ||
380 | 391 | | |||
392 | bool PlasmaShellSurfaceInterface::skipPager() const | ||||
393 | { | ||||
394 | Q_D(); | ||||
395 | return d->m_skipPager; | ||||
396 | } | ||||
397 | | ||||
381 | void PlasmaShellSurfaceInterface::hideAutoHidingPanel() | 398 | void PlasmaShellSurfaceInterface::hideAutoHidingPanel() | ||
382 | { | 399 | { | ||
383 | Q_D(); | 400 | Q_D(); | ||
384 | if (!d->resource) { | 401 | if (!d->resource) { | ||
385 | return; | 402 | return; | ||
386 | } | 403 | } | ||
387 | org_kde_plasma_surface_send_auto_hidden_panel_hidden(d->resource); | 404 | org_kde_plasma_surface_send_auto_hidden_panel_hidden(d->resource); | ||
388 | } | 405 | } | ||
Show All 23 Lines |