Changeset View
Changeset View
Standalone View
Standalone View
src/server/plasmashell_interface.cpp
Show First 20 Lines • Show All 70 Lines • ▼ Show 20 Line(s) | 70 | public: | |||
---|---|---|---|---|---|
71 | Private(PlasmaShellSurfaceInterface *q, PlasmaShellInterface *shell, SurfaceInterface *surface, wl_resource *parentResource); | 71 | Private(PlasmaShellSurfaceInterface *q, PlasmaShellInterface *shell, SurfaceInterface *surface, wl_resource *parentResource); | ||
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 panelTakesFocus = false; | ||||
79 | 80 | | |||
80 | private: | 81 | private: | ||
81 | // interface callbacks | 82 | // interface callbacks | ||
82 | static void setOutputCallback(wl_client *client, wl_resource *resource, wl_resource *output); | 83 | static void setOutputCallback(wl_client *client, wl_resource *resource, wl_resource *output); | ||
83 | static void setPositionCallback(wl_client *client, wl_resource *resource, int32_t x, int32_t y); | 84 | static void setPositionCallback(wl_client *client, wl_resource *resource, int32_t x, int32_t y); | ||
84 | static void setRoleCallback(wl_client *client, wl_resource *resource, uint32_t role); | 85 | static void setRoleCallback(wl_client *client, wl_resource *resource, uint32_t role); | ||
85 | static void setPanelBehaviorCallback(wl_client *client, wl_resource *resource, uint32_t flag); | 86 | static void setPanelBehaviorCallback(wl_client *client, wl_resource *resource, uint32_t flag); | ||
86 | static void setSkipTaskbarCallback(wl_client *client, wl_resource *resource, uint32_t skip); | 87 | static void setSkipTaskbarCallback(wl_client *client, wl_resource *resource, uint32_t skip); | ||
87 | static void panelAutoHideHideCallback(wl_client *client, wl_resource *resource); | 88 | static void panelAutoHideHideCallback(wl_client *client, wl_resource *resource); | ||
88 | static void panelAutoHideShowCallback(wl_client *client, wl_resource *resource); | 89 | static void panelAutoHideShowCallback(wl_client *client, wl_resource *resource); | ||
90 | static void panelTakesFocusCallback(wl_client *client, wl_resource *resource, uint32_t takesFocus); | ||||
romangg: Name "skip" of argument like in line 373. | |||||
89 | 91 | | |||
90 | void setPosition(const QPoint &globalPos); | 92 | void setPosition(const QPoint &globalPos); | ||
91 | void setRole(uint32_t role); | 93 | void setRole(uint32_t role); | ||
92 | void setPanelBehavior(org_kde_plasma_surface_panel_behavior behavior); | 94 | void setPanelBehavior(org_kde_plasma_surface_panel_behavior behavior); | ||
93 | 95 | | |||
94 | PlasmaShellSurfaceInterface *q_func() { | 96 | PlasmaShellSurfaceInterface *q_func() { | ||
95 | return reinterpret_cast<PlasmaShellSurfaceInterface *>(q); | 97 | return reinterpret_cast<PlasmaShellSurfaceInterface *>(q); | ||
96 | } | 98 | } | ||
▲ Show 20 Lines • Show All 60 Lines • ▼ Show 20 Line(s) | |||||
157 | const struct org_kde_plasma_surface_interface PlasmaShellSurfaceInterface::Private::s_interface = { | 159 | const struct org_kde_plasma_surface_interface PlasmaShellSurfaceInterface::Private::s_interface = { | ||
158 | resourceDestroyedCallback, | 160 | resourceDestroyedCallback, | ||
159 | setOutputCallback, | 161 | setOutputCallback, | ||
160 | setPositionCallback, | 162 | setPositionCallback, | ||
161 | setRoleCallback, | 163 | setRoleCallback, | ||
162 | setPanelBehaviorCallback, | 164 | setPanelBehaviorCallback, | ||
163 | setSkipTaskbarCallback, | 165 | setSkipTaskbarCallback, | ||
164 | panelAutoHideHideCallback, | 166 | panelAutoHideHideCallback, | ||
165 | panelAutoHideShowCallback | 167 | panelAutoHideShowCallback, | ||
168 | panelTakesFocusCallback | ||||
166 | }; | 169 | }; | ||
167 | #endif | 170 | #endif | ||
168 | 171 | | |||
169 | PlasmaShellSurfaceInterface::PlasmaShellSurfaceInterface(PlasmaShellInterface *shell, SurfaceInterface *parent, wl_resource *parentResource) | 172 | PlasmaShellSurfaceInterface::PlasmaShellSurfaceInterface(PlasmaShellInterface *shell, SurfaceInterface *parent, wl_resource *parentResource) | ||
170 | : Resource(new Private(this, shell, parent, parentResource)) | 173 | : Resource(new Private(this, shell, parent, parentResource)) | ||
171 | { | 174 | { | ||
172 | auto unsetSurface = [this] { | 175 | auto unsetSurface = [this] { | ||
173 | Q_D(); | 176 | Q_D(); | ||
▲ Show 20 Lines • Show All 117 Lines • ▼ Show 20 Line(s) | 292 | { | |||
291 | Q_ASSERT(client == *s->client); | 294 | Q_ASSERT(client == *s->client); | ||
292 | if (s->m_role != Role::Panel || s->m_panelBehavior != PanelBehavior::AutoHide) { | 295 | if (s->m_role != Role::Panel || s->m_panelBehavior != PanelBehavior::AutoHide) { | ||
293 | wl_resource_post_error(s->resource, ORG_KDE_PLASMA_SURFACE_ERROR_PANEL_NOT_AUTO_HIDE, "Not an auto hide panel"); | 296 | wl_resource_post_error(s->resource, ORG_KDE_PLASMA_SURFACE_ERROR_PANEL_NOT_AUTO_HIDE, "Not an auto hide panel"); | ||
294 | return; | 297 | return; | ||
295 | } | 298 | } | ||
296 | emit s->q_func()->panelAutoHideShowRequested(); | 299 | emit s->q_func()->panelAutoHideShowRequested(); | ||
297 | } | 300 | } | ||
298 | 301 | | |||
302 | void PlasmaShellSurfaceInterface::Private::panelTakesFocusCallback(wl_client *client, wl_resource *resource, uint32_t takesFocus) | ||||
303 | { | ||||
304 | auto s = cast<Private>(resource); | ||||
305 | Q_ASSERT(client == *s->client); | ||||
306 | s->panelTakesFocus = takesFocus; | ||||
307 | } | ||||
308 | | ||||
299 | void PlasmaShellSurfaceInterface::Private::setPanelBehavior(org_kde_plasma_surface_panel_behavior behavior) | 309 | void PlasmaShellSurfaceInterface::Private::setPanelBehavior(org_kde_plasma_surface_panel_behavior behavior) | ||
300 | { | 310 | { | ||
301 | PanelBehavior newBehavior = PanelBehavior::AlwaysVisible; | 311 | PanelBehavior newBehavior = PanelBehavior::AlwaysVisible; | ||
302 | switch (behavior) { | 312 | switch (behavior) { | ||
303 | case ORG_KDE_PLASMA_SURFACE_PANEL_BEHAVIOR_AUTO_HIDE: | 313 | case ORG_KDE_PLASMA_SURFACE_PANEL_BEHAVIOR_AUTO_HIDE: | ||
304 | newBehavior = PanelBehavior::AutoHide; | 314 | newBehavior = PanelBehavior::AutoHide; | ||
305 | break; | 315 | break; | ||
306 | case ORG_KDE_PLASMA_SURFACE_PANEL_BEHAVIOR_WINDOWS_CAN_COVER: | 316 | case ORG_KDE_PLASMA_SURFACE_PANEL_BEHAVIOR_WINDOWS_CAN_COVER: | ||
▲ Show 20 Lines • Show All 57 Lines • ▼ Show 20 Line(s) | |||||
364 | { | 374 | { | ||
365 | Q_D(); | 375 | Q_D(); | ||
366 | if (!d->resource) { | 376 | if (!d->resource) { | ||
367 | return; | 377 | return; | ||
368 | } | 378 | } | ||
369 | org_kde_plasma_surface_send_auto_hidden_panel_shown(d->resource); | 379 | org_kde_plasma_surface_send_auto_hidden_panel_shown(d->resource); | ||
370 | } | 380 | } | ||
371 | 381 | | |||
382 | bool PlasmaShellSurfaceInterface::panelTakesFocus() const | ||||
383 | { | ||||
384 | Q_D(); | ||||
385 | return d->panelTakesFocus; | ||||
386 | } | ||||
387 | | ||||
372 | PlasmaShellSurfaceInterface *PlasmaShellSurfaceInterface::get(wl_resource *native) | 388 | PlasmaShellSurfaceInterface *PlasmaShellSurfaceInterface::get(wl_resource *native) | ||
373 | { | 389 | { | ||
374 | return Private::get<PlasmaShellSurfaceInterface>(native); | 390 | return Private::get<PlasmaShellSurfaceInterface>(native); | ||
375 | } | 391 | } | ||
376 | 392 | | |||
377 | } | 393 | } | ||
378 | } | 394 | } |
Name "skip" of argument like in line 373.