File: shell_surface_util.h

package info (click to toggle)
chromium 139.0.7258.127-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 6,122,068 kB
  • sloc: cpp: 35,100,771; ansic: 7,163,530; javascript: 4,103,002; python: 1,436,920; asm: 946,517; xml: 746,709; pascal: 187,653; perl: 88,691; sh: 88,436; objc: 79,953; sql: 51,488; cs: 44,583; fortran: 24,137; makefile: 22,147; tcl: 15,277; php: 13,980; yacc: 8,984; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (119 lines) | stat: -rw-r--r-- 4,469 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
// Copyright 2018 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef COMPONENTS_EXO_SHELL_SURFACE_UTIL_H_
#define COMPONENTS_EXO_SHELL_SURFACE_UTIL_H_

#include <stdint.h>

#include <memory>
#include <optional>
#include <string>

namespace ui {
class PropertyHandler;
}

namespace aura {
class Window;
}

namespace base {
class TimeDelta;
}

namespace ui {
class LocatedEvent;
class KeyEvent;
}  // namespace ui

namespace exo {

class ClientControlledShellSurface;
class Surface;
class ShellSurfaceBase;

// Sets the application ID to the property_handler. The application ID
// identifies the general class of applications to which the window belongs.
void SetShellApplicationId(ui::PropertyHandler* property_handler,
                           const std::optional<std::string>& id);
const std::string* GetShellApplicationId(const aura::Window* window);

// Sets the startup ID to the property handler. The startup ID identifies the
// application using startup notification protocol.
void SetShellStartupId(ui::PropertyHandler* property_handler,
                       const std::optional<std::string>& id);
const std::string* GetShellStartupId(const aura::Window* window);

// Shows/hides the shelf when fullscreen. If true, titlebar/shelf will show when
// the mouse moves to the top/bottom of the screen. If false (plain fullscreen),
// the titlebar and shelf are always hidden.
void SetShellUseImmersiveForFullscreen(aura::Window* window, bool value);

// Sets the client accessibility ID for the window. The accessibility ID
// identifies the accessibility tree provided by client.
void SetShellClientAccessibilityId(aura::Window* window,
                                   const std::optional<int32_t>& id);
const std::optional<int32_t> GetShellClientAccessibilityId(
    aura::Window* window);

// Sets the ClientControlledShellSurface to the property handler.
void SetShellClientControlledShellSurface(
    ui::PropertyHandler* property_handler,
    const std::optional<ClientControlledShellSurface*>& shell_surface);
ClientControlledShellSurface* GetShellClientControlledShellSurface(
    ui::PropertyHandler* property_handler);

// Returns |index| for the window.
// Returns -1 for |index| when window is visible on all workspaces,
// otherwise, 0-based indexing for desk index.
int GetWindowDeskStateChanged(const aura::Window* window);

// Sets the root surface to the property handler.
void SetShellRootSurface(ui::PropertyHandler* property_handler,
                         Surface* surface);

// Returns the main Surface instance or nullptr if it is not set.
// |window| must not be nullptr.
Surface* GetShellRootSurface(const aura::Window* window);

// Returns the ShellSurfaceBase for the given |window|, or nullptr if no such
// surface exists.
ShellSurfaceBase* GetShellSurfaceBaseForWindow(const aura::Window* window);

// Returns the target surface for the located event |event|.  If an
// event handling is grabbed by an window, it'll first examine that
// window, then traverse to its transient parent if the parent also
// requested grab.
Surface* GetTargetSurfaceForLocatedEvent(const ui::LocatedEvent* event);

// Returns the focused surface for given 'focused_window'.  If a surface is
// attached to the window, this will return that surface.  If the window is
// either the shell surface's window, or host window, it will return the root
// surface, otherwise returns nullptr.
Surface* GetTargetSurfaceForKeyboardFocus(aura::Window* focused_window);

// Allows the |window| to activate itself for the duration of |timeout|. Revokes
// any existing permission.
void GrantPermissionToActivate(aura::Window* window, base::TimeDelta timeout);

// Allows the |window| to activate itself indefinitely. Revokes any existing
// permission.
void GrantPermissionToActivateIndefinitely(aura::Window* window);

// Revokes the permission for |window| to activate itself.
void RevokePermissionToActivate(aura::Window* window);

// Returns true if the |window| has permission to activate itself.
bool HasPermissionToActivate(aura::Window* window);

// Returns true if event is/will be consumed by IME.
bool ConsumedByIme(const ui::KeyEvent& event);

// Set aura::client::kSkipImeProcessing to all Surface descendants.
void SetSkipImeProcessingToDescendentSurfaces(aura::Window* window, bool value);

}  // namespace exo

#endif  // COMPONENTS_EXO_SHELL_SURFACE_UTIL_H_