Merge lp:~alan-griffiths/miral/0.4 into lp:miral/release
- 0.4
- Merge into release
Proposed by
Alan Griffiths
Status: | Merged |
---|---|
Approved by: | Alan Griffiths |
Approved revision: | 334 |
Merged at revision: | 339 |
Proposed branch: | lp:~alan-griffiths/miral/0.4 |
Merge into: | lp:miral/release |
Diff against target: |
1590 lines (+853/-178) 32 files modified
CMakeLists.txt (+1/-1) debian/changelog (+17/-0) debian/control (+1/-0) debian/libmiral1.symbols (+30/-0) include/miral/application.h (+6/-0) include/miral/application_info.h (+2/-1) include/miral/command_line_option.h (+100/-0) include/miral/keymap.h (+2/-1) include/miral/window_manager_tools.h (+4/-0) miral-shell/CMakeLists.txt (+6/-0) miral-shell/shell_main.cpp (+5/-1) miral-shell/titlebar_config.cpp (+38/-0) miral-shell/titlebar_config.h (+30/-0) miral-shell/titlebar_provider.cpp (+123/-8) miral-shell/titlebar_provider.h (+4/-2) miral-shell/titlebar_window_manager.cpp (+6/-6) miral/CMakeLists.txt (+9/-0) miral/application.cpp (+15/-0) miral/application_info.cpp (+7/-0) miral/basic_window_manager.cpp (+9/-1) miral/basic_window_manager.h (+2/-0) miral/command_line_option.cpp (+199/-0) miral/display_configuration_option.cpp (+2/-2) miral/keymap.cpp (+17/-8) miral/symbols.map (+16/-0) miral/window_management_trace.cpp (+8/-0) miral/window_management_trace.h (+1/-0) miral/window_manager_tools.cpp (+3/-0) miral/window_manager_tools_implementation.h (+1/-0) scripts/filter_symbols_diff.sh (+2/-0) scripts/process_doxygen_xml.py (+187/-141) tasks_for_the_interested_reader.md (+0/-6) |
To merge this branch: | bzr merge lp:~alan-griffiths/miral/0.4 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alan Griffiths | Approve | ||
Review via email: mp+310083@code.launchpad.net |
Commit message
Release 0.4.0
Description of the change
To post a comment you must log in.
Revision history for this message
Alan Griffiths (alan-griffiths) wrote : | # |
Weird can't reproduce
Revision history for this message
Alan Griffiths (alan-griffiths) : | # |
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'CMakeLists.txt' | |||
2 | --- CMakeLists.txt 2016-10-16 16:14:18 +0000 | |||
3 | +++ CMakeLists.txt 2016-11-04 16:34:03 +0000 | |||
4 | @@ -37,7 +37,7 @@ | |||
5 | 37 | include_directories(include SYSTEM ${MIRCLIENT_INCLUDE_DIRS}) | 37 | include_directories(include SYSTEM ${MIRCLIENT_INCLUDE_DIRS}) |
6 | 38 | 38 | ||
7 | 39 | set(MIRAL_VERSION_MAJOR 0) | 39 | set(MIRAL_VERSION_MAJOR 0) |
9 | 40 | set(MIRAL_VERSION_MINOR 3) | 40 | set(MIRAL_VERSION_MINOR 4) |
10 | 41 | set(MIRAL_VERSION_PATCH 0) | 41 | set(MIRAL_VERSION_PATCH 0) |
11 | 42 | 42 | ||
12 | 43 | set(MIRAL_VERSION ${MIRAL_VERSION_MAJOR}.${MIRAL_VERSION_MINOR}.${MIRAL_VERSION_PATCH}) | 43 | set(MIRAL_VERSION ${MIRAL_VERSION_MAJOR}.${MIRAL_VERSION_MINOR}.${MIRAL_VERSION_PATCH}) |
13 | 44 | 44 | ||
14 | === modified file 'debian/changelog' | |||
15 | --- debian/changelog 2016-10-28 16:03:16 +0000 | |||
16 | +++ debian/changelog 2016-11-04 16:34:03 +0000 | |||
17 | @@ -1,3 +1,20 @@ | |||
18 | 1 | miral (0.4.0) UNRELEASED; urgency=medium | ||
19 | 2 | |||
20 | 3 | * New upstream release 0.4.0 (https://launchpad.net/miral/+milestone/0.4) | ||
21 | 4 | - ABI summary: | ||
22 | 5 | . miral ABI unchanged at 1 | ||
23 | 6 | - Enhancements: | ||
24 | 7 | . Add miral::WindowManagerTools::force_close(window) to forcefully close | ||
25 | 8 | a window (i.e. without a close request to the client) | ||
26 | 9 | . Add functions to manage Applications | ||
27 | 10 | . Add miral::CommandLineOption - enables the setting and processing of | ||
28 | 11 | configuration options. These may be supplied on the commandline, as | ||
29 | 12 | MIR_SERVER_XXX environment variables or in a config file. | ||
30 | 13 | . Add +options to the keymap configuration | ||
31 | 14 | . [miral-shell] Add window name to titlebars | ||
32 | 15 | |||
33 | 16 | -- Alan Griffiths <alan.griffiths@canonical.com> Fri, 28 Oct 2016 12:14:59 +0100 | ||
34 | 17 | |||
35 | 1 | miral (0.3.0+17.04.20161028-0ubuntu1) zesty; urgency=medium | 18 | miral (0.3.0+17.04.20161028-0ubuntu1) zesty; urgency=medium |
36 | 2 | 19 | ||
37 | 3 | * No change rebuild to target Xenial+Overlay | 20 | * No change rebuild to target Xenial+Overlay |
38 | 4 | 21 | ||
39 | === modified file 'debian/control' | |||
40 | --- debian/control 2016-09-19 13:27:49 +0000 | |||
41 | +++ debian/control 2016-11-04 16:34:03 +0000 | |||
42 | @@ -19,6 +19,7 @@ | |||
43 | 19 | mirtest-dev, | 19 | mirtest-dev, |
44 | 20 | libglib2.0-dev, | 20 | libglib2.0-dev, |
45 | 21 | libgles2-mesa-dev, | 21 | libgles2-mesa-dev, |
46 | 22 | libfreetype6-dev, | ||
47 | 22 | # The following workaround missing dependencies in Mir packages | 23 | # The following workaround missing dependencies in Mir packages |
48 | 23 | uuid-dev, | 24 | uuid-dev, |
49 | 24 | libboost-system-dev, | 25 | libboost-system-dev, |
50 | 25 | 26 | ||
51 | === modified file 'debian/libmiral1.symbols' | |||
52 | --- debian/libmiral1.symbols 2016-10-11 13:28:07 +0000 | |||
53 | +++ debian/libmiral1.symbols 2016-11-04 16:34:03 +0000 | |||
54 | @@ -2,6 +2,7 @@ | |||
55 | 2 | MIRAL_0.1@MIRAL_0.1 0.1.0 | 2 | MIRAL_0.1@MIRAL_0.1 0.1.0 |
56 | 3 | MIRAL_0.2@MIRAL_0.2 0.2.0 | 3 | MIRAL_0.2@MIRAL_0.2 0.2.0 |
57 | 4 | MIRAL_0.3@MIRAL_0.3 0.3.0 | 4 | MIRAL_0.3@MIRAL_0.3 0.3.0 |
58 | 5 | MIRAL_0.4@MIRAL_0.4 0.3.0 | ||
59 | 5 | (c++)"miral::ActiveOutputsListener::advise_output_begin()@MIRAL_0.1" 0.1.0 | 6 | (c++)"miral::ActiveOutputsListener::advise_output_begin()@MIRAL_0.1" 0.1.0 |
60 | 6 | (c++)"miral::ActiveOutputsListener::advise_output_create(miral::Output const&)@MIRAL_0.1" 0.1.0 | 7 | (c++)"miral::ActiveOutputsListener::advise_output_create(miral::Output const&)@MIRAL_0.1" 0.1.0 |
61 | 7 | (c++)"miral::ActiveOutputsListener::advise_output_delete(miral::Output const&)@MIRAL_0.1" 0.1.0 | 8 | (c++)"miral::ActiveOutputsListener::advise_output_delete(miral::Output const&)@MIRAL_0.1" 0.1.0 |
62 | @@ -275,3 +276,32 @@ | |||
63 | 275 | (c++)"miral::Keymap::~Keymap()@MIRAL_0.3" 0.3.0 | 276 | (c++)"miral::Keymap::~Keymap()@MIRAL_0.3" 0.3.0 |
64 | 276 | (c++)"miral::Keymap::operator=(miral::Keymap const&)@MIRAL_0.3" 0.3.0 | 277 | (c++)"miral::Keymap::operator=(miral::Keymap const&)@MIRAL_0.3" 0.3.0 |
65 | 277 | (c++)"miral::Keymap::operator()(mir::Server&) const@MIRAL_0.3" 0.3.0 | 278 | (c++)"miral::Keymap::operator()(mir::Server&) const@MIRAL_0.3" 0.3.0 |
66 | 279 | (c++)"miral::ApplicationInfo::name[abi:cxx11]() const@MIRAL_0.4" 0.4.0 | ||
67 | 280 | (c++)"miral::CommandLineOption::CommandLineOption(miral::CommandLineOption const&)@MIRAL_0.4" 0.4.0 | ||
68 | 281 | (c++)"miral::CommandLineOption::CommandLineOption(std::function<void (mir::optional_value<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > const&)>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@MIRAL_0.4" 0.4.0 | ||
69 | 282 | (c++)"miral::CommandLineOption::CommandLineOption(std::function<void (mir::optional_value<bool> const&)>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@MIRAL_0.4" 0.4.0 | ||
70 | 283 | (c++)"miral::CommandLineOption::CommandLineOption(std::function<void (mir::optional_value<int> const&)>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@MIRAL_0.4" 0.4.0 | ||
71 | 284 | (c++)"miral::CommandLineOption::CommandLineOption(std::function<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, char const*)@MIRAL_0.4" 0.4.0 | ||
72 | 285 | (c++)"miral::CommandLineOption::CommandLineOption(std::function<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@MIRAL_0.4" 0.4.0 | ||
73 | 286 | (c++)"miral::CommandLineOption::CommandLineOption(std::function<void (bool)>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@MIRAL_0.4" 0.4.0 | ||
74 | 287 | (c++)"miral::CommandLineOption::CommandLineOption(std::function<void (bool)>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)@MIRAL_0.4" 0.4.0 | ||
75 | 288 | (c++)"miral::CommandLineOption::CommandLineOption(std::function<void (double)>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, double)@MIRAL_0.4" 0.4.0 | ||
76 | 289 | (c++)"miral::CommandLineOption::CommandLineOption(std::function<void (int)>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)@MIRAL_0.4" 0.4.0 | ||
77 | 290 | (c++)"miral::CommandLineOption::CommandLineOption(miral::CommandLineOption const&)@MIRAL_0.4" 0.4.0 | ||
78 | 291 | (c++)"miral::CommandLineOption::CommandLineOption(std::function<void (mir::optional_value<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > const&)>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@MIRAL_0.4" 0.4.0 | ||
79 | 292 | (c++)"miral::CommandLineOption::CommandLineOption(std::function<void (mir::optional_value<bool> const&)>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@MIRAL_0.4" 0.4.0 | ||
80 | 293 | (c++)"miral::CommandLineOption::CommandLineOption(std::function<void (mir::optional_value<int> const&)>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@MIRAL_0.4" 0.4.0 | ||
81 | 294 | (c++)"miral::CommandLineOption::CommandLineOption(std::function<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, char const*)@MIRAL_0.4" 0.4.0 | ||
82 | 295 | (c++)"miral::CommandLineOption::CommandLineOption(std::function<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@MIRAL_0.4" 0.4.0 | ||
83 | 296 | (c++)"miral::CommandLineOption::CommandLineOption(std::function<void (bool)>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@MIRAL_0.4" 0.4.0 | ||
84 | 297 | (c++)"miral::CommandLineOption::CommandLineOption(std::function<void (bool)>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)@MIRAL_0.4" 0.4.0 | ||
85 | 298 | (c++)"miral::CommandLineOption::CommandLineOption(std::function<void (double)>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, double)@MIRAL_0.4" 0.4.0 | ||
86 | 299 | (c++)"miral::CommandLineOption::CommandLineOption(std::function<void (int)>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)@MIRAL_0.4" 0.4.0 | ||
87 | 300 | (c++)"miral::CommandLineOption::~CommandLineOption()@MIRAL_0.4" 0.4.0 | ||
88 | 301 | (c++)"miral::CommandLineOption::~CommandLineOption()@MIRAL_0.4" 0.4.0 | ||
89 | 302 | (c++)"miral::CommandLineOption::operator=(miral::CommandLineOption const&)@MIRAL_0.4" 0.4.0 | ||
90 | 303 | (c++)"miral::CommandLineOption::operator()(mir::Server&) const@MIRAL_0.4" 0.4.0 | ||
91 | 304 | (c++)"miral::WindowManagerTools::force_close(miral::Window const&)@MIRAL_0.4" 0.4.0 | ||
92 | 305 | (c++)"miral::apply_lifecycle_state_to(std::shared_ptr<mir::scene::Session> const&, MirLifecycleState)@MIRAL_0.4" 0.4.0 | ||
93 | 306 | (c++)"miral::pid_of(std::shared_ptr<mir::scene::Session> const&)@MIRAL_0.4" 0.4.0 | ||
94 | 307 | (c++)"miral::name_of[abi:cxx11](std::shared_ptr<mir::scene::Session> const&)@MIRAL_0.4" 0.4.0 | ||
95 | 278 | 308 | ||
96 | === added directory 'debian/tmp' | |||
97 | === modified file 'include/miral/application.h' | |||
98 | --- include/miral/application.h 2016-04-22 09:24:24 +0000 | |||
99 | +++ include/miral/application.h 2016-11-04 16:34:03 +0000 | |||
100 | @@ -19,7 +19,10 @@ | |||
101 | 19 | #ifndef MIRAL_APPLICATION_H | 19 | #ifndef MIRAL_APPLICATION_H |
102 | 20 | #define MIRAL_APPLICATION_H | 20 | #define MIRAL_APPLICATION_H |
103 | 21 | 21 | ||
104 | 22 | #include <mir_toolkit/common.h> | ||
105 | 23 | |||
106 | 22 | #include <memory> | 24 | #include <memory> |
107 | 25 | #include <string> | ||
108 | 23 | 26 | ||
109 | 24 | namespace mir | 27 | namespace mir |
110 | 25 | { | 28 | { |
111 | @@ -30,7 +33,10 @@ | |||
112 | 30 | { | 33 | { |
113 | 31 | using Application = std::shared_ptr<mir::scene::Session>; | 34 | using Application = std::shared_ptr<mir::scene::Session>; |
114 | 32 | 35 | ||
115 | 36 | void apply_lifecycle_state_to(Application const& application, MirLifecycleState state); | ||
116 | 33 | void kill(Application const& application, int sig); | 37 | void kill(Application const& application, int sig); |
117 | 38 | auto name_of(Application const& application) -> std::string; | ||
118 | 39 | auto pid_of(Application const& application) -> pid_t; | ||
119 | 34 | } | 40 | } |
120 | 35 | 41 | ||
121 | 36 | #endif //MIRAL_APPLICATION_H | 42 | #endif //MIRAL_APPLICATION_H |
122 | 37 | 43 | ||
123 | === modified file 'include/miral/application_info.h' | |||
124 | --- include/miral/application_info.h 2016-06-07 16:26:40 +0000 | |||
125 | +++ include/miral/application_info.h 2016-11-04 16:34:03 +0000 | |||
126 | @@ -21,9 +21,9 @@ | |||
127 | 21 | 21 | ||
128 | 22 | #include "miral/application.h" | 22 | #include "miral/application.h" |
129 | 23 | 23 | ||
130 | 24 | #include <string> | ||
131 | 24 | #include <vector> | 25 | #include <vector> |
132 | 25 | 26 | ||
133 | 26 | |||
134 | 27 | namespace miral | 27 | namespace miral |
135 | 28 | { | 28 | { |
136 | 29 | class Window; | 29 | class Window; |
137 | @@ -36,6 +36,7 @@ | |||
138 | 36 | ApplicationInfo(ApplicationInfo const& that); | 36 | ApplicationInfo(ApplicationInfo const& that); |
139 | 37 | auto operator=(ApplicationInfo const& that) -> miral::ApplicationInfo&; | 37 | auto operator=(ApplicationInfo const& that) -> miral::ApplicationInfo&; |
140 | 38 | 38 | ||
141 | 39 | auto name() const -> std::string; | ||
142 | 39 | auto application() const -> Application; | 40 | auto application() const -> Application; |
143 | 40 | auto windows() const -> std::vector <Window>&; | 41 | auto windows() const -> std::vector <Window>&; |
144 | 41 | void add_window(Window const& window); | 42 | void add_window(Window const& window); |
145 | 42 | 43 | ||
146 | === added file 'include/miral/command_line_option.h' | |||
147 | --- include/miral/command_line_option.h 1970-01-01 00:00:00 +0000 | |||
148 | +++ include/miral/command_line_option.h 2016-11-04 16:34:03 +0000 | |||
149 | @@ -0,0 +1,100 @@ | |||
150 | 1 | /* | ||
151 | 2 | * Copyright © 2016 Canonical Ltd. | ||
152 | 3 | * | ||
153 | 4 | * This program is free software: you can redistribute it and/or modify it | ||
154 | 5 | * under the terms of the GNU General Public License version 3, | ||
155 | 6 | * as published by the Free Software Foundation. | ||
156 | 7 | * | ||
157 | 8 | * This program is distributed in the hope that it will be useful, | ||
158 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
159 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
160 | 11 | * GNU General Public License for more details. | ||
161 | 12 | * | ||
162 | 13 | * You should have received a copy of the GNU General Public License | ||
163 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
164 | 15 | * | ||
165 | 16 | * Authored by: Alan Griffiths <alan@octopull.co.uk> | ||
166 | 17 | */ | ||
167 | 18 | |||
168 | 19 | #ifndef MIRAL_COMMAND_LINE_OPTION_H | ||
169 | 20 | #define MIRAL_COMMAND_LINE_OPTION_H | ||
170 | 21 | |||
171 | 22 | #include <mir/optional_value.h> | ||
172 | 23 | |||
173 | 24 | #include <functional> | ||
174 | 25 | #include <memory> | ||
175 | 26 | #include <string> | ||
176 | 27 | |||
177 | 28 | namespace mir { class Server; } | ||
178 | 29 | |||
179 | 30 | namespace miral | ||
180 | 31 | { | ||
181 | 32 | /// Add a user configuration option to Mir's option handling. | ||
182 | 33 | /// The callback will be invoked during initialisation with a value supplied | ||
183 | 34 | /// from the command line, environment variable, config file or the default. | ||
184 | 35 | class CommandLineOption | ||
185 | 36 | { | ||
186 | 37 | public: | ||
187 | 38 | CommandLineOption( | ||
188 | 39 | std::function<void(int value)> callback, | ||
189 | 40 | std::string const& option, | ||
190 | 41 | std::string const& description, | ||
191 | 42 | int default_value); | ||
192 | 43 | |||
193 | 44 | CommandLineOption( | ||
194 | 45 | std::function<void(double value)> callback, | ||
195 | 46 | std::string const& option, | ||
196 | 47 | std::string const& description, | ||
197 | 48 | double default_value); | ||
198 | 49 | |||
199 | 50 | CommandLineOption( | ||
200 | 51 | std::function<void(std::string const& value)> callback, | ||
201 | 52 | std::string const& option, | ||
202 | 53 | std::string const& description, | ||
203 | 54 | std::string const& default_value); | ||
204 | 55 | |||
205 | 56 | CommandLineOption( | ||
206 | 57 | std::function<void(std::string const& value)> callback, | ||
207 | 58 | std::string const& option, | ||
208 | 59 | std::string const& description, | ||
209 | 60 | char const* default_value); | ||
210 | 61 | |||
211 | 62 | CommandLineOption( | ||
212 | 63 | std::function<void(bool value)> callback, | ||
213 | 64 | std::string const& option, | ||
214 | 65 | std::string const& description, | ||
215 | 66 | bool default_value); | ||
216 | 67 | |||
217 | 68 | CommandLineOption( | ||
218 | 69 | std::function<void(mir::optional_value<int> const& value)> callback, | ||
219 | 70 | std::string const& option, | ||
220 | 71 | std::string const& description); | ||
221 | 72 | |||
222 | 73 | CommandLineOption( | ||
223 | 74 | std::function<void(mir::optional_value<std::string> const& value)> callback, | ||
224 | 75 | std::string const& option, | ||
225 | 76 | std::string const& description); | ||
226 | 77 | |||
227 | 78 | CommandLineOption( | ||
228 | 79 | std::function<void(mir::optional_value<bool> const& value)> callback, | ||
229 | 80 | std::string const& option, | ||
230 | 81 | std::string const& description); | ||
231 | 82 | |||
232 | 83 | CommandLineOption( | ||
233 | 84 | std::function<void(bool is_set)> callback, | ||
234 | 85 | std::string const& option, | ||
235 | 86 | std::string const& description); | ||
236 | 87 | |||
237 | 88 | void operator()(mir::Server& server) const; | ||
238 | 89 | |||
239 | 90 | ~CommandLineOption(); | ||
240 | 91 | CommandLineOption(CommandLineOption const&); | ||
241 | 92 | auto operator=(CommandLineOption const&) -> CommandLineOption&; | ||
242 | 93 | |||
243 | 94 | private: | ||
244 | 95 | struct Self; | ||
245 | 96 | std::shared_ptr<Self> self; | ||
246 | 97 | }; | ||
247 | 98 | } | ||
248 | 99 | |||
249 | 100 | #endif //MIRAL_COMMAND_LINE_OPTION_H | ||
250 | 0 | 101 | ||
251 | === modified file 'include/miral/keymap.h' | |||
252 | --- include/miral/keymap.h 2016-10-11 13:09:35 +0000 | |||
253 | +++ include/miral/keymap.h 2016-11-04 16:34:03 +0000 | |||
254 | @@ -35,7 +35,8 @@ | |||
255 | 35 | Keymap(); | 35 | Keymap(); |
256 | 36 | 36 | ||
257 | 37 | /// Specify a keymap. | 37 | /// Specify a keymap. |
259 | 38 | /// Format is <language>[+<variant>] | 38 | /// Format is <language>[+<variant>[+<options>]] |
260 | 39 | /// Options is a comma separated list. | ||
261 | 39 | /// e.g. "uk" or "us+dvorak" | 40 | /// e.g. "uk" or "us+dvorak" |
262 | 40 | explicit Keymap(std::string const& keymap); | 41 | explicit Keymap(std::string const& keymap); |
263 | 41 | ~Keymap(); | 42 | ~Keymap(); |
264 | 42 | 43 | ||
265 | === modified file 'include/miral/window_manager_tools.h' | |||
266 | --- include/miral/window_manager_tools.h 2016-10-05 16:54:07 +0000 | |||
267 | +++ include/miral/window_manager_tools.h 2016-11-04 16:34:03 +0000 | |||
268 | @@ -115,6 +115,10 @@ | |||
269 | 115 | /// Send close request to the window | 115 | /// Send close request to the window |
270 | 116 | void ask_client_to_close(Window const& window); | 116 | void ask_client_to_close(Window const& window); |
271 | 117 | 117 | ||
272 | 118 | /// Close the window by force | ||
273 | 119 | /// \note ask_client_to_close() is the polite way | ||
274 | 120 | void force_close(Window const& window); | ||
275 | 121 | |||
276 | 118 | /// retrieve the active window | 122 | /// retrieve the active window |
277 | 119 | auto active_window() const -> Window; | 123 | auto active_window() const -> Window; |
278 | 120 | 124 | ||
279 | 121 | 125 | ||
280 | === modified file 'miral-shell/CMakeLists.txt' | |||
281 | --- miral-shell/CMakeLists.txt 2016-10-06 15:36:15 +0000 | |||
282 | +++ miral-shell/CMakeLists.txt 2016-11-04 16:34:03 +0000 | |||
283 | @@ -22,8 +22,14 @@ | |||
284 | 22 | tiling_window_manager.cpp tiling_window_manager.h | 22 | tiling_window_manager.cpp tiling_window_manager.h |
285 | 23 | titlebar_window_manager.cpp titlebar_window_manager.h | 23 | titlebar_window_manager.cpp titlebar_window_manager.h |
286 | 24 | titlebar_provider.cpp titlebar_provider.h | 24 | titlebar_provider.cpp titlebar_provider.h |
287 | 25 | titlebar_config.cpp titlebar_config.h | ||
288 | 25 | ) | 26 | ) |
289 | 26 | 27 | ||
290 | 28 | pkg_check_modules(FREETYPE freetype2 REQUIRED) | ||
291 | 29 | target_include_directories(miral-shell PUBLIC ${FREETYPE_INCLUDE_DIRS}) | ||
292 | 30 | target_compile_definitions(miral-shell PUBLIC -DTYPO_SUPPORTS_FREETYPE) | ||
293 | 31 | target_link_libraries(miral-shell ${FREETYPE_LIBRARIES}) | ||
294 | 32 | |||
295 | 27 | target_link_libraries(miral-shell | 33 | target_link_libraries(miral-shell |
296 | 28 | miral-spinner | 34 | miral-spinner |
297 | 29 | miral | 35 | miral |
298 | 30 | 36 | ||
299 | === modified file 'miral-shell/shell_main.cpp' | |||
300 | --- miral-shell/shell_main.cpp 2016-10-11 13:09:35 +0000 | |||
301 | +++ miral-shell/shell_main.cpp 2016-11-04 16:34:03 +0000 | |||
302 | @@ -18,6 +18,7 @@ | |||
303 | 18 | 18 | ||
304 | 19 | #include "tiling_window_manager.h" | 19 | #include "tiling_window_manager.h" |
305 | 20 | #include "titlebar_window_manager.h" | 20 | #include "titlebar_window_manager.h" |
306 | 21 | #include "titlebar_config.h" | ||
307 | 21 | #include "spinner/splash.h" | 22 | #include "spinner/splash.h" |
308 | 22 | 23 | ||
309 | 23 | #include <miral/display_configuration_option.h> | 24 | #include <miral/display_configuration_option.h> |
310 | @@ -25,6 +26,7 @@ | |||
311 | 25 | #include <miral/window_management_options.h> | 26 | #include <miral/window_management_options.h> |
312 | 26 | #include <miral/append_event_filter.h> | 27 | #include <miral/append_event_filter.h> |
313 | 27 | #include <miral/internal_client.h> | 28 | #include <miral/internal_client.h> |
314 | 29 | #include <miral/command_line_option.h> | ||
315 | 28 | #include <miral/cursor_theme.h> | 30 | #include <miral/cursor_theme.h> |
316 | 29 | #include <miral/keymap.h> | 31 | #include <miral/keymap.h> |
317 | 30 | 32 | ||
318 | @@ -80,6 +82,8 @@ | |||
319 | 80 | outputs_monitor, | 82 | outputs_monitor, |
320 | 81 | config_keymap, | 83 | config_keymap, |
321 | 82 | AppendEventFilter{quit_on_ctrl_alt_bksp}, | 84 | AppendEventFilter{quit_on_ctrl_alt_bksp}, |
323 | 83 | StartupInternalClient{"Intro", spinner} | 85 | StartupInternalClient{"Intro", spinner}, |
324 | 86 | CommandLineOption{[&](std::string const& typeface) { ::titlebar::font_file(typeface); }, | ||
325 | 87 | "shell-titlebar-font", "font file to use for titlebars", ::titlebar::font_file()} | ||
326 | 84 | }); | 88 | }); |
327 | 85 | } | 89 | } |
328 | 86 | 90 | ||
329 | === added file 'miral-shell/titlebar_config.cpp' | |||
330 | --- miral-shell/titlebar_config.cpp 1970-01-01 00:00:00 +0000 | |||
331 | +++ miral-shell/titlebar_config.cpp 2016-11-04 16:34:03 +0000 | |||
332 | @@ -0,0 +1,38 @@ | |||
333 | 1 | /* | ||
334 | 2 | * Copyright © 2016 Canonical Ltd. | ||
335 | 3 | * | ||
336 | 4 | * This program is free software: you can redistribute it and/or modify it | ||
337 | 5 | * under the terms of the GNU General Public License version 3, | ||
338 | 6 | * as published by the Free Software Foundation. | ||
339 | 7 | * | ||
340 | 8 | * This program is distributed in the hope that it will be useful, | ||
341 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
342 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
343 | 11 | * GNU General Public License for more details. | ||
344 | 12 | * | ||
345 | 13 | * You should have received a copy of the GNU General Public License | ||
346 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
347 | 15 | * | ||
348 | 16 | * Authored by: Alan Griffiths <alan@octopull.co.uk> | ||
349 | 17 | */ | ||
350 | 18 | |||
351 | 19 | #include "titlebar_config.h" | ||
352 | 20 | #include <mutex> | ||
353 | 21 | |||
354 | 22 | namespace | ||
355 | 23 | { | ||
356 | 24 | std::mutex mutex; | ||
357 | 25 | std::string font_file{"/usr/share/fonts/truetype/ubuntu-font-family/Ubuntu-B.ttf"}; | ||
358 | 26 | } | ||
359 | 27 | |||
360 | 28 | void titlebar::font_file(std::string const& font_file) | ||
361 | 29 | { | ||
362 | 30 | std::lock_guard<decltype(mutex)> lock{mutex}; | ||
363 | 31 | ::font_file = font_file; | ||
364 | 32 | } | ||
365 | 33 | |||
366 | 34 | auto titlebar::font_file() -> std::string | ||
367 | 35 | { | ||
368 | 36 | std::lock_guard<decltype(mutex)> lock{mutex}; | ||
369 | 37 | return ::font_file; | ||
370 | 38 | } | ||
371 | 0 | 39 | ||
372 | === added file 'miral-shell/titlebar_config.h' | |||
373 | --- miral-shell/titlebar_config.h 1970-01-01 00:00:00 +0000 | |||
374 | +++ miral-shell/titlebar_config.h 2016-11-04 16:34:03 +0000 | |||
375 | @@ -0,0 +1,30 @@ | |||
376 | 1 | /* | ||
377 | 2 | * Copyright © 2016 Canonical Ltd. | ||
378 | 3 | * | ||
379 | 4 | * This program is free software: you can redistribute it and/or modify it | ||
380 | 5 | * under the terms of the GNU General Public License version 3, | ||
381 | 6 | * as published by the Free Software Foundation. | ||
382 | 7 | * | ||
383 | 8 | * This program is distributed in the hope that it will be useful, | ||
384 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
385 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
386 | 11 | * GNU General Public License for more details. | ||
387 | 12 | * | ||
388 | 13 | * You should have received a copy of the GNU General Public License | ||
389 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
390 | 15 | * | ||
391 | 16 | * Authored by: Alan Griffiths <alan@octopull.co.uk> | ||
392 | 17 | */ | ||
393 | 18 | |||
394 | 19 | #ifndef MIRAL_TITLEBAR_CONFIG_H | ||
395 | 20 | #define MIRAL_TITLEBAR_CONFIG_H | ||
396 | 21 | |||
397 | 22 | #include <string> | ||
398 | 23 | |||
399 | 24 | namespace titlebar | ||
400 | 25 | { | ||
401 | 26 | void font_file(std::string const& font_file); | ||
402 | 27 | auto font_file() -> std::string; | ||
403 | 28 | } | ||
404 | 29 | |||
405 | 30 | #endif //MIRAL_TITLEBAR_CONFIG_H | ||
406 | 0 | 31 | ||
407 | === modified file 'miral-shell/titlebar_provider.cpp' | |||
408 | --- miral-shell/titlebar_provider.cpp 2016-10-05 16:54:07 +0000 | |||
409 | +++ miral-shell/titlebar_provider.cpp 2016-11-04 16:34:03 +0000 | |||
410 | @@ -17,21 +17,47 @@ | |||
411 | 17 | */ | 17 | */ |
412 | 18 | 18 | ||
413 | 19 | #include "titlebar_provider.h" | 19 | #include "titlebar_provider.h" |
414 | 20 | #include "titlebar_config.h" | ||
415 | 20 | 21 | ||
416 | 21 | #include <miral/toolkit/surface_spec.h> | 22 | #include <miral/toolkit/surface_spec.h> |
417 | 22 | 23 | ||
418 | 23 | #include <mir_toolkit/mir_buffer_stream.h> | 24 | #include <mir_toolkit/mir_buffer_stream.h> |
419 | 24 | 25 | ||
420 | 26 | #include <ft2build.h> | ||
421 | 27 | #include FT_FREETYPE_H | ||
422 | 28 | |||
423 | 29 | #include <locale> | ||
424 | 30 | #include <codecvt> | ||
425 | 31 | #include <string> | ||
426 | 25 | #include <cstring> | 32 | #include <cstring> |
427 | 26 | #include <sstream> | 33 | #include <sstream> |
428 | 27 | 34 | ||
429 | 35 | #include <iostream> | ||
430 | 36 | |||
431 | 28 | namespace | 37 | namespace |
432 | 29 | { | 38 | { |
434 | 30 | int const title_bar_height = 10; | 39 | int const title_bar_height = 12; |
435 | 31 | 40 | ||
436 | 32 | void null_surface_callback(MirSurface*, void*) {} | 41 | void null_surface_callback(MirSurface*, void*) {} |
437 | 33 | 42 | ||
439 | 34 | void paint_surface(MirSurface* surface, int const intensity) | 43 | struct Printer |
440 | 44 | { | ||
441 | 45 | Printer(); | ||
442 | 46 | ~Printer(); | ||
443 | 47 | Printer(Printer const&) = delete; | ||
444 | 48 | Printer& operator=(Printer const&) = delete; | ||
445 | 49 | |||
446 | 50 | void print(MirGraphicsRegion const& region, std::string const& title, int const intensity); | ||
447 | 51 | |||
448 | 52 | private: | ||
449 | 53 | std::wstring_convert<std::codecvt_utf16<wchar_t>> converter; | ||
450 | 54 | |||
451 | 55 | bool working = false; | ||
452 | 56 | FT_Library lib; | ||
453 | 57 | FT_Face face; | ||
454 | 58 | }; | ||
455 | 59 | |||
456 | 60 | void paint_surface(MirSurface* surface, std::string const& title, int const intensity) | ||
457 | 35 | { | 61 | { |
458 | 36 | MirBufferStream* buffer_stream = mir_surface_get_buffer_stream(surface); | 62 | MirBufferStream* buffer_stream = mir_surface_get_buffer_stream(surface); |
459 | 37 | 63 | ||
460 | @@ -51,8 +77,77 @@ | |||
461 | 51 | row += region.stride; | 77 | row += region.stride; |
462 | 52 | } | 78 | } |
463 | 53 | 79 | ||
464 | 80 | static Printer printer; | ||
465 | 81 | printer.print(region, title, intensity); | ||
466 | 82 | |||
467 | 54 | mir_buffer_stream_swap_buffers_sync(buffer_stream); | 83 | mir_buffer_stream_swap_buffers_sync(buffer_stream); |
468 | 55 | } | 84 | } |
469 | 85 | |||
470 | 86 | Printer::Printer() | ||
471 | 87 | { | ||
472 | 88 | if (FT_Init_FreeType(&lib)) | ||
473 | 89 | return; | ||
474 | 90 | |||
475 | 91 | if (FT_New_Face(lib, titlebar::font_file().c_str(), 0, &face)) | ||
476 | 92 | { | ||
477 | 93 | std::cerr << "WARNING: failed to load titlebar font: \"" << titlebar::font_file() << "\"\n"; | ||
478 | 94 | FT_Done_FreeType(lib); | ||
479 | 95 | return; | ||
480 | 96 | } | ||
481 | 97 | |||
482 | 98 | FT_Set_Pixel_Sizes(face, 0, 10); | ||
483 | 99 | working = true; | ||
484 | 100 | } | ||
485 | 101 | |||
486 | 102 | Printer::~Printer() | ||
487 | 103 | { | ||
488 | 104 | if (working) | ||
489 | 105 | { | ||
490 | 106 | FT_Done_Face(face); | ||
491 | 107 | FT_Done_FreeType(lib); | ||
492 | 108 | } | ||
493 | 109 | } | ||
494 | 110 | |||
495 | 111 | void Printer::print(MirGraphicsRegion const& region, std::string const& title_, int const intensity) | ||
496 | 112 | { | ||
497 | 113 | if (!working) | ||
498 | 114 | return; | ||
499 | 115 | |||
500 | 116 | auto title = converter.from_bytes(title_); | ||
501 | 117 | |||
502 | 118 | int base_x = 2; | ||
503 | 119 | int base_y = region.height-2; | ||
504 | 120 | |||
505 | 121 | for (auto const& ch : title) | ||
506 | 122 | { | ||
507 | 123 | FT_Load_Glyph(face, FT_Get_Char_Index(face, ch), FT_LOAD_DEFAULT); | ||
508 | 124 | auto const glyph = face->glyph; | ||
509 | 125 | FT_Render_Glyph(glyph, FT_RENDER_MODE_NORMAL); | ||
510 | 126 | |||
511 | 127 | auto const& bitmap = glyph->bitmap; | ||
512 | 128 | auto const x = base_x + glyph->bitmap_left; | ||
513 | 129 | |||
514 | 130 | if (static_cast<int>(x + bitmap.width) <= region.width) | ||
515 | 131 | { | ||
516 | 132 | unsigned char* src = bitmap.buffer; | ||
517 | 133 | |||
518 | 134 | auto const y = base_y - glyph->bitmap_top; | ||
519 | 135 | char* dest = region.vaddr + y*region.stride + 4*x; | ||
520 | 136 | |||
521 | 137 | for (auto row = 0u; row != std::min(bitmap.rows, glyph->bitmap_top+2u); ++row) | ||
522 | 138 | { | ||
523 | 139 | for (auto col = 0u; col != bitmap.width; ++col) | ||
524 | 140 | memset(dest+ 4*col, (intensity*(0xff^src[col]))/0xff, 4); | ||
525 | 141 | |||
526 | 142 | src += bitmap.pitch; | ||
527 | 143 | dest += region.stride; | ||
528 | 144 | } | ||
529 | 145 | } | ||
530 | 146 | |||
531 | 147 | base_x += glyph->advance.x >> 6; | ||
532 | 148 | base_y += glyph->advance.y >> 6; | ||
533 | 149 | } | ||
534 | 150 | } | ||
535 | 56 | } | 151 | } |
536 | 57 | 152 | ||
537 | 58 | using namespace miral::toolkit; | 153 | using namespace miral::toolkit; |
538 | @@ -121,18 +216,22 @@ | |||
539 | 121 | }); | 216 | }); |
540 | 122 | } | 217 | } |
541 | 123 | 218 | ||
543 | 124 | void TitlebarProvider::paint_titlebar_for(miral::Window const& window, int intensity) | 219 | void TitlebarProvider::paint_titlebar_for(miral::WindowInfo const& info, int intensity) |
544 | 125 | { | 220 | { |
546 | 126 | if (auto data = find_titlebar_data(window)) | 221 | this->intensity = intensity; |
547 | 222 | |||
548 | 223 | if (auto data = find_titlebar_data(info.window())) | ||
549 | 127 | { | 224 | { |
550 | 225 | auto const title = info.name(); | ||
551 | 226 | |||
552 | 128 | if (auto surface = data->titlebar.load()) | 227 | if (auto surface = data->titlebar.load()) |
553 | 129 | { | 228 | { |
555 | 130 | enqueue_work([this, surface, intensity]{ paint_surface(surface, intensity); }); | 229 | enqueue_work([this, surface, title, intensity]{ paint_surface(surface, title, intensity); }); |
556 | 131 | } | 230 | } |
557 | 132 | else | 231 | else |
558 | 133 | { | 232 | { |
561 | 134 | data->on_create = [this, intensity](MirSurface* surface) | 233 | data->on_create = [this, title, intensity](MirSurface* surface) |
562 | 135 | { enqueue_work([this, surface, intensity]{ paint_surface(surface, intensity); }); }; | 234 | { enqueue_work([this, surface, title, intensity]{ paint_surface(surface, title, intensity); }); }; |
563 | 136 | } | 235 | } |
564 | 137 | } | 236 | } |
565 | 138 | } | 237 | } |
566 | @@ -157,14 +256,18 @@ | |||
567 | 157 | } | 256 | } |
568 | 158 | } | 257 | } |
569 | 159 | 258 | ||
571 | 160 | void TitlebarProvider::resize_titlebar_for(miral::Window const& window, Size const& size) | 259 | void TitlebarProvider::resize_titlebar_for(miral::WindowInfo const& window_info, Size const& size) |
572 | 161 | { | 260 | { |
573 | 261 | auto const window = window_info.window(); | ||
574 | 262 | |||
575 | 162 | if (window.size().width == size.width) | 263 | if (window.size().width == size.width) |
576 | 163 | return; | 264 | return; |
577 | 164 | 265 | ||
578 | 165 | if (auto titlebar_window = find_titlebar_window(window)) | 266 | if (auto titlebar_window = find_titlebar_window(window)) |
579 | 166 | { | 267 | { |
580 | 167 | titlebar_window.resize({size.width, title_bar_height}); | 268 | titlebar_window.resize({size.width, title_bar_height}); |
581 | 269 | |||
582 | 270 | repaint_titlebar_for(window_info); | ||
583 | 168 | } | 271 | } |
584 | 169 | } | 272 | } |
585 | 170 | 273 | ||
586 | @@ -217,6 +320,18 @@ | |||
587 | 217 | } | 320 | } |
588 | 218 | 321 | ||
589 | 219 | tools.modify_window(titlebar, modifications); | 322 | tools.modify_window(titlebar, modifications); |
590 | 323 | repaint_titlebar_for(window_info); | ||
591 | 324 | } | ||
592 | 325 | } | ||
593 | 326 | |||
594 | 327 | void TitlebarProvider::repaint_titlebar_for(miral::WindowInfo const& window_info) | ||
595 | 328 | { | ||
596 | 329 | if (auto data = find_titlebar_data(window_info.window())) | ||
597 | 330 | { | ||
598 | 331 | auto const title = window_info.name(); | ||
599 | 332 | |||
600 | 333 | if (auto surface = data->titlebar.load()) | ||
601 | 334 | enqueue_work([this, surface, title]{ paint_surface(surface, title, intensity); }); | ||
602 | 220 | } | 335 | } |
603 | 221 | } | 336 | } |
604 | 222 | 337 | ||
605 | 223 | 338 | ||
606 | === modified file 'miral-shell/titlebar_provider.h' | |||
607 | --- miral-shell/titlebar_provider.h 2016-08-10 11:48:02 +0000 | |||
608 | +++ miral-shell/titlebar_provider.h 2016-11-04 16:34:03 +0000 | |||
609 | @@ -67,9 +67,9 @@ | |||
610 | 67 | 67 | ||
611 | 68 | void create_titlebar_for(miral::Window const& window); | 68 | void create_titlebar_for(miral::Window const& window); |
612 | 69 | void place_new_titlebar(miral::WindowSpecification& window_spec); | 69 | void place_new_titlebar(miral::WindowSpecification& window_spec); |
614 | 70 | void paint_titlebar_for(miral::Window const& window, int intensity); | 70 | void paint_titlebar_for(miral::WindowInfo const& window, int intensity); |
615 | 71 | void destroy_titlebar_for(miral::Window const& window); | 71 | void destroy_titlebar_for(miral::Window const& window); |
617 | 72 | void resize_titlebar_for(miral::Window const& window, mir::geometry::Size const& size); | 72 | void resize_titlebar_for(miral::WindowInfo const& window_info, mir::geometry::Size const& size); |
618 | 73 | void advise_new_titlebar(miral::WindowInfo const& window_info); | 73 | void advise_new_titlebar(miral::WindowInfo const& window_info); |
619 | 74 | void advise_state_change(miral::WindowInfo const& window_info, MirSurfaceState state); | 74 | void advise_state_change(miral::WindowInfo const& window_info, MirSurfaceState state); |
620 | 75 | 75 | ||
621 | @@ -92,6 +92,7 @@ | |||
622 | 92 | std::mutex mutable mutex; | 92 | std::mutex mutable mutex; |
623 | 93 | miral::toolkit::Connection connection; | 93 | miral::toolkit::Connection connection; |
624 | 94 | std::weak_ptr<mir::scene::Session> weak_session; | 94 | std::weak_ptr<mir::scene::Session> weak_session; |
625 | 95 | std::atomic<int> intensity{0xff}; | ||
626 | 95 | 96 | ||
627 | 96 | SurfaceMap window_to_titlebar; | 97 | SurfaceMap window_to_titlebar; |
628 | 97 | TitleMap windows_awaiting_titlebar; | 98 | TitleMap windows_awaiting_titlebar; |
629 | @@ -99,6 +100,7 @@ | |||
630 | 99 | static void insert(MirSurface* surface, Data* data); | 100 | static void insert(MirSurface* surface, Data* data); |
631 | 100 | Data* find_titlebar_data(miral::Window const& window); | 101 | Data* find_titlebar_data(miral::Window const& window); |
632 | 101 | miral::Window find_titlebar_window(miral::Window const& window) const; | 102 | miral::Window find_titlebar_window(miral::Window const& window) const; |
633 | 103 | void repaint_titlebar_for(miral::WindowInfo const& window_info); | ||
634 | 102 | }; | 104 | }; |
635 | 103 | 105 | ||
636 | 104 | 106 | ||
637 | 105 | 107 | ||
638 | === modified file 'miral-shell/titlebar_window_manager.cpp' | |||
639 | --- miral-shell/titlebar_window_manager.cpp 2016-10-06 08:31:39 +0000 | |||
640 | +++ miral-shell/titlebar_window_manager.cpp 2016-11-04 16:34:03 +0000 | |||
641 | @@ -31,7 +31,7 @@ | |||
642 | 31 | 31 | ||
643 | 32 | namespace | 32 | namespace |
644 | 33 | { | 33 | { |
646 | 34 | int const title_bar_height = 10; | 34 | int const title_bar_height = 12; |
647 | 35 | } | 35 | } |
648 | 36 | 36 | ||
649 | 37 | TitlebarWindowManagerPolicy::TitlebarWindowManagerPolicy( | 37 | TitlebarWindowManagerPolicy::TitlebarWindowManagerPolicy( |
650 | @@ -275,9 +275,9 @@ | |||
651 | 275 | auto const parent = window_info.parent(); | 275 | auto const parent = window_info.parent(); |
652 | 276 | 276 | ||
653 | 277 | if (tools.active_window() == parent) | 277 | if (tools.active_window() == parent) |
655 | 278 | titlebar_provider->paint_titlebar_for(parent, 0xFF); | 278 | titlebar_provider->paint_titlebar_for(tools.info_for(parent), 0xFF); |
656 | 279 | else | 279 | else |
658 | 280 | titlebar_provider->paint_titlebar_for(parent, 0x3F); | 280 | titlebar_provider->paint_titlebar_for(tools.info_for(parent), 0x3F); |
659 | 281 | } | 281 | } |
660 | 282 | } | 282 | } |
661 | 283 | 283 | ||
662 | @@ -293,14 +293,14 @@ | |||
663 | 293 | { | 293 | { |
664 | 294 | CanonicalWindowManagerPolicy::advise_focus_lost(info); | 294 | CanonicalWindowManagerPolicy::advise_focus_lost(info); |
665 | 295 | 295 | ||
667 | 296 | titlebar_provider->paint_titlebar_for(info.window(), 0x3F); | 296 | titlebar_provider->paint_titlebar_for(info, 0x3F); |
668 | 297 | } | 297 | } |
669 | 298 | 298 | ||
670 | 299 | void TitlebarWindowManagerPolicy::advise_focus_gained(WindowInfo const& info) | 299 | void TitlebarWindowManagerPolicy::advise_focus_gained(WindowInfo const& info) |
671 | 300 | { | 300 | { |
672 | 301 | CanonicalWindowManagerPolicy::advise_focus_gained(info); | 301 | CanonicalWindowManagerPolicy::advise_focus_gained(info); |
673 | 302 | 302 | ||
675 | 303 | titlebar_provider->paint_titlebar_for(info.window(), 0xFF); | 303 | titlebar_provider->paint_titlebar_for(info, 0xFF); |
676 | 304 | 304 | ||
677 | 305 | // Frig to force the spinner to the top | 305 | // Frig to force the spinner to the top |
678 | 306 | if (auto const spinner_session = spinner.session()) | 306 | if (auto const spinner_session = spinner.session()) |
679 | @@ -323,7 +323,7 @@ | |||
680 | 323 | { | 323 | { |
681 | 324 | CanonicalWindowManagerPolicy::advise_resize(window_info, new_size); | 324 | CanonicalWindowManagerPolicy::advise_resize(window_info, new_size); |
682 | 325 | 325 | ||
684 | 326 | titlebar_provider->resize_titlebar_for(window_info.window(), new_size); | 326 | titlebar_provider->resize_titlebar_for(window_info, new_size); |
685 | 327 | } | 327 | } |
686 | 328 | 328 | ||
687 | 329 | void TitlebarWindowManagerPolicy::advise_delete_window(WindowInfo const& window_info) | 329 | void TitlebarWindowManagerPolicy::advise_delete_window(WindowInfo const& window_info) |
688 | 330 | 330 | ||
689 | === modified file 'miral/CMakeLists.txt' | |||
690 | --- miral/CMakeLists.txt 2016-10-16 16:14:18 +0000 | |||
691 | +++ miral/CMakeLists.txt 2016-11-04 16:34:03 +0000 | |||
692 | @@ -31,6 +31,7 @@ | |||
693 | 31 | application_authorizer.cpp ${CMAKE_SOURCE_DIR}/include/miral/application_authorizer.h | 31 | application_authorizer.cpp ${CMAKE_SOURCE_DIR}/include/miral/application_authorizer.h |
694 | 32 | application_info.cpp ${CMAKE_SOURCE_DIR}/include/miral/application_info.h | 32 | application_info.cpp ${CMAKE_SOURCE_DIR}/include/miral/application_info.h |
695 | 33 | canonical_window_manager.cpp ${CMAKE_SOURCE_DIR}/include/miral/canonical_window_manager.h | 33 | canonical_window_manager.cpp ${CMAKE_SOURCE_DIR}/include/miral/canonical_window_manager.h |
696 | 34 | command_line_option.cpp ${CMAKE_SOURCE_DIR}/include/miral/command_line_option.h | ||
697 | 34 | cursor_theme.cpp ${CMAKE_SOURCE_DIR}/include/miral/cursor_theme.h | 35 | cursor_theme.cpp ${CMAKE_SOURCE_DIR}/include/miral/cursor_theme.h |
698 | 35 | keymap.cpp ${CMAKE_SOURCE_DIR}/include/miral/keymap.h | 36 | keymap.cpp ${CMAKE_SOURCE_DIR}/include/miral/keymap.h |
699 | 36 | runner.cpp ${CMAKE_SOURCE_DIR}/include/miral/runner.h | 37 | runner.cpp ${CMAKE_SOURCE_DIR}/include/miral/runner.h |
700 | @@ -70,6 +71,14 @@ | |||
701 | 70 | LINK_DEPENDS ${symbol_map} | 71 | LINK_DEPENDS ${symbol_map} |
702 | 71 | ) | 72 | ) |
703 | 72 | 73 | ||
704 | 74 | |||
705 | 75 | add_custom_target(check-symbols ALL | ||
706 | 76 | DEPENDS miral ${PROJECT_SOURCE_DIR}/debian/libmiral1.symbols | ||
707 | 77 | COMMAND dpkg-gensymbols -e${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libmiral.so.1 -plibmiral1 | scripts/filter_symbols_diff.sh | ||
708 | 78 | WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}" | ||
709 | 79 | VERBATIM | ||
710 | 80 | ) | ||
711 | 81 | |||
712 | 73 | set(LIBDIR "${CMAKE_INSTALL_FULL_LIBDIR}") | 82 | set(LIBDIR "${CMAKE_INSTALL_FULL_LIBDIR}") |
713 | 74 | set(INCLUDEDIR "${CMAKE_INSTALL_PREFIX}/include/miral") | 83 | set(INCLUDEDIR "${CMAKE_INSTALL_PREFIX}/include/miral") |
714 | 75 | 84 | ||
715 | 76 | 85 | ||
716 | === modified file 'miral/application.cpp' | |||
717 | --- miral/application.cpp 2016-07-07 14:24:32 +0000 | |||
718 | +++ miral/application.cpp 2016-11-04 16:34:03 +0000 | |||
719 | @@ -34,3 +34,18 @@ | |||
720 | 34 | ::kill(pid, sig); | 34 | ::kill(pid, sig); |
721 | 35 | } | 35 | } |
722 | 36 | } | 36 | } |
723 | 37 | |||
724 | 38 | auto miral::name_of(Application const& application) -> std::string | ||
725 | 39 | { | ||
726 | 40 | return application->name(); | ||
727 | 41 | } | ||
728 | 42 | |||
729 | 43 | auto miral::pid_of(Application const& application) -> pid_t | ||
730 | 44 | { | ||
731 | 45 | return application->process_id(); | ||
732 | 46 | } | ||
733 | 47 | |||
734 | 48 | void miral::apply_lifecycle_state_to(Application const& application, MirLifecycleState state) | ||
735 | 49 | { | ||
736 | 50 | application->set_lifecycle_state(state); | ||
737 | 51 | } | ||
738 | 37 | 52 | ||
739 | === modified file 'miral/application_info.cpp' | |||
740 | --- miral/application_info.cpp 2016-06-08 21:20:40 +0000 | |||
741 | +++ miral/application_info.cpp 2016-11-04 16:34:03 +0000 | |||
742 | @@ -19,6 +19,8 @@ | |||
743 | 19 | #include "miral/application_info.h" | 19 | #include "miral/application_info.h" |
744 | 20 | #include "miral/window.h" | 20 | #include "miral/window.h" |
745 | 21 | 21 | ||
746 | 22 | #include <mir/scene/session.h> | ||
747 | 23 | |||
748 | 22 | struct miral::ApplicationInfo::Self | 24 | struct miral::ApplicationInfo::Self |
749 | 23 | { | 25 | { |
750 | 24 | Self() = default; | 26 | Self() = default; |
751 | @@ -52,6 +54,11 @@ | |||
752 | 52 | return *this; | 54 | return *this; |
753 | 53 | } | 55 | } |
754 | 54 | 56 | ||
755 | 57 | auto miral::ApplicationInfo::name() const -> std::string | ||
756 | 58 | { | ||
757 | 59 | return self->app ? self->app->name() : std::string{}; | ||
758 | 60 | } | ||
759 | 61 | |||
760 | 55 | auto miral::ApplicationInfo::application() const -> Application | 62 | auto miral::ApplicationInfo::application() const -> Application |
761 | 56 | { | 63 | { |
762 | 57 | return self->app; | 64 | return self->app; |
763 | 58 | 65 | ||
764 | === modified file 'miral/basic_window_manager.cpp' | |||
765 | --- miral/basic_window_manager.cpp 2016-10-10 14:53:39 +0000 | |||
766 | +++ miral/basic_window_manager.cpp 2016-11-04 16:34:03 +0000 | |||
767 | @@ -36,7 +36,7 @@ | |||
768 | 36 | 36 | ||
769 | 37 | namespace | 37 | namespace |
770 | 38 | { | 38 | { |
772 | 39 | int const title_bar_height = 10; | 39 | int const title_bar_height = 12; |
773 | 40 | 40 | ||
774 | 41 | struct Locker | 41 | struct Locker |
775 | 42 | { | 42 | { |
776 | @@ -400,6 +400,14 @@ | |||
777 | 400 | mir_surface->request_client_surface_close(); | 400 | mir_surface->request_client_surface_close(); |
778 | 401 | } | 401 | } |
779 | 402 | 402 | ||
780 | 403 | void miral::BasicWindowManager::force_close(Window const& window) | ||
781 | 404 | { | ||
782 | 405 | auto application = window.application(); | ||
783 | 406 | |||
784 | 407 | if (application && window) | ||
785 | 408 | remove_surface(application, window); | ||
786 | 409 | } | ||
787 | 410 | |||
788 | 403 | auto miral::BasicWindowManager::active_window() const -> Window | 411 | auto miral::BasicWindowManager::active_window() const -> Window |
789 | 404 | { | 412 | { |
790 | 405 | return mru_active_windows.top(); | 413 | return mru_active_windows.top(); |
791 | 406 | 414 | ||
792 | === modified file 'miral/basic_window_manager.h' | |||
793 | --- miral/basic_window_manager.h 2016-09-29 14:41:11 +0000 | |||
794 | +++ miral/basic_window_manager.h 2016-11-04 16:34:03 +0000 | |||
795 | @@ -112,6 +112,8 @@ | |||
796 | 112 | 112 | ||
797 | 113 | void ask_client_to_close(Window const& window) override; | 113 | void ask_client_to_close(Window const& window) override; |
798 | 114 | 114 | ||
799 | 115 | void force_close(Window const& window) override; | ||
800 | 116 | |||
801 | 115 | auto active_window() const -> Window override; | 117 | auto active_window() const -> Window override; |
802 | 116 | 118 | ||
803 | 117 | auto select_active_window(Window const& hint) -> Window override; | 119 | auto select_active_window(Window const& hint) -> Window override; |
804 | 118 | 120 | ||
805 | === added file 'miral/command_line_option.cpp' | |||
806 | --- miral/command_line_option.cpp 1970-01-01 00:00:00 +0000 | |||
807 | +++ miral/command_line_option.cpp 2016-11-04 16:34:03 +0000 | |||
808 | @@ -0,0 +1,199 @@ | |||
809 | 1 | /* | ||
810 | 2 | * Copyright © 2016 Canonical Ltd. | ||
811 | 3 | * | ||
812 | 4 | * This program is free software: you can redistribute it and/or modify it | ||
813 | 5 | * under the terms of the GNU General Public License version 3, | ||
814 | 6 | * as published by the Free Software Foundation. | ||
815 | 7 | * | ||
816 | 8 | * This program is distributed in the hope that it will be useful, | ||
817 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
818 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
819 | 11 | * GNU General Public License for more details. | ||
820 | 12 | * | ||
821 | 13 | * You should have received a copy of the GNU General Public License | ||
822 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
823 | 15 | * | ||
824 | 16 | * Authored by: Alan Griffiths <alan@octopull.co.uk> | ||
825 | 17 | */ | ||
826 | 18 | |||
827 | 19 | #include "miral/command_line_option.h" | ||
828 | 20 | |||
829 | 21 | #include <mir/server.h> | ||
830 | 22 | #include <mir/options/option.h> | ||
831 | 23 | |||
832 | 24 | namespace | ||
833 | 25 | { | ||
834 | 26 | template<typename Type> | ||
835 | 27 | struct OptionType; | ||
836 | 28 | |||
837 | 29 | template<> | ||
838 | 30 | struct OptionType<bool> | ||
839 | 31 | { | ||
840 | 32 | auto static constexpr value = mir::OptionType::boolean; | ||
841 | 33 | }; | ||
842 | 34 | |||
843 | 35 | template<> | ||
844 | 36 | struct OptionType<void> | ||
845 | 37 | { | ||
846 | 38 | auto static constexpr value = mir::OptionType::null; | ||
847 | 39 | }; | ||
848 | 40 | |||
849 | 41 | template<> | ||
850 | 42 | struct OptionType<std::string> | ||
851 | 43 | { | ||
852 | 44 | auto static constexpr value = mir::OptionType::string; | ||
853 | 45 | }; | ||
854 | 46 | |||
855 | 47 | template<> | ||
856 | 48 | struct OptionType<int> | ||
857 | 49 | { | ||
858 | 50 | auto static constexpr value = mir::OptionType::integer; | ||
859 | 51 | }; | ||
860 | 52 | } | ||
861 | 53 | |||
862 | 54 | struct miral::CommandLineOption::Self | ||
863 | 55 | { | ||
864 | 56 | template<typename Value_t> | ||
865 | 57 | Self(std::function<void(Value_t value)> callback, | ||
866 | 58 | std::string const& option, | ||
867 | 59 | std::string const& description, | ||
868 | 60 | Value_t default_value) : | ||
869 | 61 | setup{[=](mir::Server& server) | ||
870 | 62 | { server.add_configuration_option(option, description, default_value); }}, | ||
871 | 63 | callback{[=](mir::Server& server) | ||
872 | 64 | { callback(server.get_options()->get<Value_t>(option.c_str())); }} | ||
873 | 65 | { | ||
874 | 66 | } | ||
875 | 67 | |||
876 | 68 | template<typename Value_t> | ||
877 | 69 | Self(std::function<void(Value_t const& value)> callback, | ||
878 | 70 | std::string const& option, | ||
879 | 71 | std::string const& description, | ||
880 | 72 | Value_t const& default_value) : | ||
881 | 73 | setup{[=](mir::Server& server) | ||
882 | 74 | { server.add_configuration_option(option, description, default_value); }}, | ||
883 | 75 | callback{[=](mir::Server& server) | ||
884 | 76 | { callback(server.get_options()->get<Value_t>(option.c_str())); }} | ||
885 | 77 | { | ||
886 | 78 | } | ||
887 | 79 | |||
888 | 80 | template<typename Value_t> | ||
889 | 81 | Self(std::function<void(mir::optional_value<Value_t> const& value)> callback, | ||
890 | 82 | std::string const& option, | ||
891 | 83 | std::string const& description) : | ||
892 | 84 | setup{[=](mir::Server& server) | ||
893 | 85 | { server.add_configuration_option(option, description, OptionType<Value_t>::value); }}, | ||
894 | 86 | callback{[=](mir::Server& server) | ||
895 | 87 | { | ||
896 | 88 | mir::optional_value<Value_t> optional_value; | ||
897 | 89 | auto const options = server.get_options(); | ||
898 | 90 | if (options->is_set(option.c_str())) | ||
899 | 91 | optional_value = server.get_options()->get<Value_t>(option.c_str()); | ||
900 | 92 | callback(optional_value); | ||
901 | 93 | }} | ||
902 | 94 | { | ||
903 | 95 | } | ||
904 | 96 | |||
905 | 97 | Self(std::function<void(bool is_set)> callback, | ||
906 | 98 | std::string const& option, | ||
907 | 99 | std::string const& description) : | ||
908 | 100 | setup{[=](mir::Server& server) | ||
909 | 101 | { server.add_configuration_option(option, description, OptionType<void>::value); }}, | ||
910 | 102 | callback{[=](mir::Server& server) | ||
911 | 103 | { | ||
912 | 104 | auto const options = server.get_options(); | ||
913 | 105 | callback(options->is_set(option.c_str())); | ||
914 | 106 | }} | ||
915 | 107 | { | ||
916 | 108 | } | ||
917 | 109 | |||
918 | 110 | std::function<void(mir::Server& server)> setup; | ||
919 | 111 | std::function<void(mir::Server& server)> callback; | ||
920 | 112 | }; | ||
921 | 113 | |||
922 | 114 | miral::CommandLineOption::CommandLineOption( | ||
923 | 115 | std::function<void(int value)> callback, | ||
924 | 116 | std::string const& option, | ||
925 | 117 | std::string const& description, | ||
926 | 118 | int default_value) : | ||
927 | 119 | self{std::make_shared<Self>(callback, option, description, default_value)} | ||
928 | 120 | { | ||
929 | 121 | } | ||
930 | 122 | |||
931 | 123 | miral::CommandLineOption::CommandLineOption( | ||
932 | 124 | std::function<void(double value)> callback, | ||
933 | 125 | std::string const& option, | ||
934 | 126 | std::string const& description, | ||
935 | 127 | double default_value) : | ||
936 | 128 | self{std::make_shared<Self>(callback, option, description, default_value)} | ||
937 | 129 | { | ||
938 | 130 | } | ||
939 | 131 | |||
940 | 132 | miral::CommandLineOption::CommandLineOption( | ||
941 | 133 | std::function<void(std::string const& value)> callback, | ||
942 | 134 | std::string const& option, | ||
943 | 135 | std::string const& description, | ||
944 | 136 | std::string const& default_value) : | ||
945 | 137 | self{std::make_shared<Self>(callback, option, description, default_value)} | ||
946 | 138 | { | ||
947 | 139 | } | ||
948 | 140 | |||
949 | 141 | miral::CommandLineOption::CommandLineOption( | ||
950 | 142 | std::function<void(std::string const& value)> callback, | ||
951 | 143 | std::string const& option, | ||
952 | 144 | std::string const& description, | ||
953 | 145 | char const* default_value) : | ||
954 | 146 | self{std::make_shared<Self>(callback, option, description, std::string{default_value})} | ||
955 | 147 | { | ||
956 | 148 | } | ||
957 | 149 | |||
958 | 150 | miral::CommandLineOption::CommandLineOption( | ||
959 | 151 | std::function<void(bool value)> callback, | ||
960 | 152 | std::string const& option, | ||
961 | 153 | std::string const& description, | ||
962 | 154 | bool default_value) : | ||
963 | 155 | self{std::make_shared<Self>(callback, option, description, default_value)} | ||
964 | 156 | { | ||
965 | 157 | } | ||
966 | 158 | |||
967 | 159 | miral::CommandLineOption::CommandLineOption( | ||
968 | 160 | std::function<void(mir::optional_value<int> const& value)> callback, | ||
969 | 161 | std::string const& option, | ||
970 | 162 | std::string const& description) : | ||
971 | 163 | self{std::make_shared<Self>(callback, option, description)} | ||
972 | 164 | { | ||
973 | 165 | } | ||
974 | 166 | |||
975 | 167 | miral::CommandLineOption::CommandLineOption( | ||
976 | 168 | std::function<void(mir::optional_value<std::string> const& value)> callback, | ||
977 | 169 | std::string const& option, | ||
978 | 170 | std::string const& description) : | ||
979 | 171 | self{std::make_shared<Self>(callback, option, description)} | ||
980 | 172 | { | ||
981 | 173 | } | ||
982 | 174 | |||
983 | 175 | miral::CommandLineOption::CommandLineOption( | ||
984 | 176 | std::function<void(mir::optional_value<bool> const& value)> callback, | ||
985 | 177 | std::string const& option, | ||
986 | 178 | std::string const& description) : | ||
987 | 179 | self{std::make_shared<Self>(callback, option, description)} | ||
988 | 180 | { | ||
989 | 181 | } | ||
990 | 182 | |||
991 | 183 | miral::CommandLineOption::CommandLineOption( | ||
992 | 184 | std::function<void(bool is_set)> callback, | ||
993 | 185 | std::string const& option, | ||
994 | 186 | std::string const& description) : | ||
995 | 187 | self{std::make_shared<Self>(callback, option, description)} | ||
996 | 188 | { | ||
997 | 189 | } | ||
998 | 190 | |||
999 | 191 | void miral::CommandLineOption::operator()(mir::Server& server) const | ||
1000 | 192 | { | ||
1001 | 193 | self->setup(server); | ||
1002 | 194 | server.add_init_callback([&]{ self->callback(server); }); | ||
1003 | 195 | } | ||
1004 | 196 | |||
1005 | 197 | miral::CommandLineOption::~CommandLineOption() = default; | ||
1006 | 198 | miral::CommandLineOption::CommandLineOption(CommandLineOption const&) = default; | ||
1007 | 199 | auto miral::CommandLineOption::operator=(CommandLineOption const&) -> CommandLineOption& = default; | ||
1008 | 0 | 200 | ||
1009 | === modified file 'miral/display_configuration_option.cpp' | |||
1010 | --- miral/display_configuration_option.cpp 2016-04-05 11:10:11 +0000 | |||
1011 | +++ miral/display_configuration_option.cpp 2016-11-04 16:34:03 +0000 | |||
1012 | @@ -58,13 +58,13 @@ | |||
1013 | 58 | } | 58 | } |
1014 | 59 | 59 | ||
1015 | 60 | PixelFormatSelector::PixelFormatSelector( | 60 | PixelFormatSelector::PixelFormatSelector( |
1017 | 61 | std::shared_ptr<DisplayConfigurationPolicy> const& base_policy, | 61 | std::shared_ptr<mg::DisplayConfigurationPolicy> const& base_policy, |
1018 | 62 | bool with_alpha) : | 62 | bool with_alpha) : |
1019 | 63 | base_policy{base_policy}, | 63 | base_policy{base_policy}, |
1020 | 64 | with_alpha{with_alpha} | 64 | with_alpha{with_alpha} |
1021 | 65 | {} | 65 | {} |
1022 | 66 | 66 | ||
1024 | 67 | void PixelFormatSelector::apply_to(mg::DisplayConfiguration & conf) | 67 | void PixelFormatSelector::apply_to(mg::DisplayConfiguration& conf) |
1025 | 68 | { | 68 | { |
1026 | 69 | base_policy->apply_to(conf); | 69 | base_policy->apply_to(conf); |
1027 | 70 | conf.for_each_output( | 70 | conf.for_each_output( |
1028 | 71 | 71 | ||
1029 | === modified file 'miral/keymap.cpp' | |||
1030 | --- miral/keymap.cpp 2016-10-12 10:30:01 +0000 | |||
1031 | +++ miral/keymap.cpp 2016-11-04 16:34:03 +0000 | |||
1032 | @@ -53,13 +53,20 @@ | |||
1033 | 53 | void set_keymap(std::string const& keymap) | 53 | void set_keymap(std::string const& keymap) |
1034 | 54 | { | 54 | { |
1035 | 55 | std::lock_guard<decltype(mutex)> lock{mutex}; | 55 | std::lock_guard<decltype(mutex)> lock{mutex}; |
1043 | 56 | 56 | auto get_next_token = [km = keymap]() mutable | |
1044 | 57 | auto const i = keymap.find('+'); | 57 | { |
1045 | 58 | 58 | auto const i = km.find('+'); | |
1046 | 59 | layout = keymap.substr(0, i); | 59 | auto ret = km.substr(0,i); |
1047 | 60 | 60 | if (i != std::string::npos) | |
1048 | 61 | if (i != std::string::npos) | 61 | km = km.substr(i+1, std::string::npos); |
1049 | 62 | variant = keymap.substr(i + 1); | 62 | else |
1050 | 63 | km = ""; | ||
1051 | 64 | return ret; | ||
1052 | 65 | }; | ||
1053 | 66 | |||
1054 | 67 | layout = get_next_token(); | ||
1055 | 68 | variant = get_next_token(); | ||
1056 | 69 | options = get_next_token(); | ||
1057 | 63 | 70 | ||
1058 | 64 | for (auto const& keyboard : keyboards) | 71 | for (auto const& keyboard : keyboards) |
1059 | 65 | apply_keymap(keyboard); | 72 | apply_keymap(keyboard); |
1060 | @@ -110,6 +117,7 @@ | |||
1061 | 110 | 117 | ||
1062 | 111 | keymap.layout = layout; | 118 | keymap.layout = layout; |
1063 | 112 | keymap.variant = variant; | 119 | keymap.variant = variant; |
1064 | 120 | keymap.options = options; | ||
1065 | 113 | keyboard->apply_keyboard_configuration(std::move(keymap)); | 121 | keyboard->apply_keyboard_configuration(std::move(keymap)); |
1066 | 114 | } | 122 | } |
1067 | 115 | #else | 123 | #else |
1068 | @@ -134,6 +142,7 @@ | |||
1069 | 134 | std::mutex mutable mutex; | 142 | std::mutex mutable mutex; |
1070 | 135 | std::string layout; | 143 | std::string layout; |
1071 | 136 | std::string variant; | 144 | std::string variant; |
1072 | 145 | std::string options; | ||
1073 | 137 | std::vector<std::shared_ptr<mir::input::Device>> keyboards; | 146 | std::vector<std::shared_ptr<mir::input::Device>> keyboards; |
1074 | 138 | }; | 147 | }; |
1075 | 139 | 148 | ||
1076 | @@ -156,7 +165,7 @@ | |||
1077 | 156 | void miral::Keymap::operator()(mir::Server& server) const | 165 | void miral::Keymap::operator()(mir::Server& server) const |
1078 | 157 | { | 166 | { |
1079 | 158 | if (self->layout.empty()) | 167 | if (self->layout.empty()) |
1081 | 159 | server.add_configuration_option(keymap_option, "keymap <layout>[+<variant>], e,g, \"gb\" or \"cz+qwerty\"", keymap_default); | 168 | server.add_configuration_option(keymap_option, "keymap <layout>[+<variant>[+<options>]], e,g, \"gb\" or \"cz+qwerty\" or \"de++compose:caps\"", keymap_default); |
1082 | 160 | 169 | ||
1083 | 161 | server.add_init_callback([this, &server] | 170 | server.add_init_callback([this, &server] |
1084 | 162 | { | 171 | { |
1085 | 163 | 172 | ||
1086 | === modified file 'miral/symbols.map' | |||
1087 | --- miral/symbols.map 2016-10-11 11:51:49 +0000 | |||
1088 | +++ miral/symbols.map 2016-11-04 16:34:03 +0000 | |||
1089 | @@ -313,3 +313,19 @@ | |||
1090 | 313 | vtable?for?miral::Keymap; | 313 | vtable?for?miral::Keymap; |
1091 | 314 | }; | 314 | }; |
1092 | 315 | } MIRAL_0.2; | 315 | } MIRAL_0.2; |
1093 | 316 | |||
1094 | 317 | MIRAL_0.4 { | ||
1095 | 318 | global: | ||
1096 | 319 | extern "C++" { | ||
1097 | 320 | miral::ApplicationInfo::name*; | ||
1098 | 321 | miral::CommandLineOption::?CommandLineOption*; | ||
1099 | 322 | miral::CommandLineOption::CommandLineOption*; | ||
1100 | 323 | miral::CommandLineOption::operator*; | ||
1101 | 324 | miral::WindowManagerTools::force_close*; | ||
1102 | 325 | miral::apply_lifecycle_state_to*; | ||
1103 | 326 | miral::name_of*; | ||
1104 | 327 | miral::pid_of*; | ||
1105 | 328 | typeinfo?for?miral::CommandLineOption; | ||
1106 | 329 | vtable?for?miral::CommandLineOption; | ||
1107 | 330 | }; | ||
1108 | 331 | } MIRAL_0.3; | ||
1109 | 316 | 332 | ||
1110 | === modified file 'miral/window_management_trace.cpp' | |||
1111 | --- miral/window_management_trace.cpp 2016-10-04 13:58:00 +0000 | |||
1112 | +++ miral/window_management_trace.cpp 2016-11-04 16:34:03 +0000 | |||
1113 | @@ -363,6 +363,14 @@ | |||
1114 | 363 | wrapped.ask_client_to_close(window); | 363 | wrapped.ask_client_to_close(window); |
1115 | 364 | } | 364 | } |
1116 | 365 | 365 | ||
1117 | 366 | void miral::WindowManagementTrace::force_close(miral::Window const& window) | ||
1118 | 367 | { | ||
1119 | 368 | log_input(); | ||
1120 | 369 | mir::log_info("%s -> %s", __func__, dump_of(window).c_str()); | ||
1121 | 370 | trace_count++; | ||
1122 | 371 | wrapped.force_close(window); | ||
1123 | 372 | } | ||
1124 | 373 | |||
1125 | 366 | auto miral::WindowManagementTrace::active_window() const -> Window | 374 | auto miral::WindowManagementTrace::active_window() const -> Window |
1126 | 367 | { | 375 | { |
1127 | 368 | log_input(); | 376 | log_input(); |
1128 | 369 | 377 | ||
1129 | === modified file 'miral/window_management_trace.h' | |||
1130 | --- miral/window_management_trace.h 2016-09-29 14:41:11 +0000 | |||
1131 | +++ miral/window_management_trace.h 2016-11-04 16:34:03 +0000 | |||
1132 | @@ -49,6 +49,7 @@ | |||
1133 | 49 | virtual auto info_for(Window const& window) const -> WindowInfo& override; | 49 | virtual auto info_for(Window const& window) const -> WindowInfo& override; |
1134 | 50 | 50 | ||
1135 | 51 | virtual void ask_client_to_close(Window const& window) override; | 51 | virtual void ask_client_to_close(Window const& window) override; |
1136 | 52 | virtual void force_close(Window const& window) override; | ||
1137 | 52 | 53 | ||
1138 | 53 | virtual auto active_window() const -> Window override; | 54 | virtual auto active_window() const -> Window override; |
1139 | 54 | virtual auto select_active_window(Window const& hint) -> Window override; | 55 | virtual auto select_active_window(Window const& hint) -> Window override; |
1140 | 55 | 56 | ||
1141 | === modified file 'miral/window_manager_tools.cpp' | |||
1142 | --- miral/window_manager_tools.cpp 2016-10-05 16:54:07 +0000 | |||
1143 | +++ miral/window_manager_tools.cpp 2016-11-04 16:34:03 +0000 | |||
1144 | @@ -50,6 +50,9 @@ | |||
1145 | 50 | void miral::WindowManagerTools::ask_client_to_close(Window const& window) | 50 | void miral::WindowManagerTools::ask_client_to_close(Window const& window) |
1146 | 51 | { tools->ask_client_to_close(window); } | 51 | { tools->ask_client_to_close(window); } |
1147 | 52 | 52 | ||
1148 | 53 | void miral::WindowManagerTools::force_close(Window const& window) | ||
1149 | 54 | { tools->force_close(window); } | ||
1150 | 55 | |||
1151 | 53 | auto miral::WindowManagerTools::active_window() const -> Window | 56 | auto miral::WindowManagerTools::active_window() const -> Window |
1152 | 54 | { return tools->active_window(); } | 57 | { return tools->active_window(); } |
1153 | 55 | 58 | ||
1154 | 56 | 59 | ||
1155 | === modified file 'miral/window_manager_tools_implementation.h' | |||
1156 | --- miral/window_manager_tools_implementation.h 2016-09-29 14:41:11 +0000 | |||
1157 | +++ miral/window_manager_tools_implementation.h 2016-11-04 16:34:03 +0000 | |||
1158 | @@ -54,6 +54,7 @@ | |||
1159 | 54 | virtual auto info_for(Window const& window) const -> WindowInfo& = 0; | 54 | virtual auto info_for(Window const& window) const -> WindowInfo& = 0; |
1160 | 55 | 55 | ||
1161 | 56 | virtual void ask_client_to_close(Window const& window) = 0; | 56 | virtual void ask_client_to_close(Window const& window) = 0; |
1162 | 57 | virtual void force_close(Window const& window) = 0; | ||
1163 | 57 | virtual auto active_window() const -> Window = 0; | 58 | virtual auto active_window() const -> Window = 0; |
1164 | 58 | virtual auto select_active_window(Window const& hint) -> Window = 0; | 59 | virtual auto select_active_window(Window const& hint) -> Window = 0; |
1165 | 59 | virtual void drag_active_window(mir::geometry::Displacement movement) = 0; | 60 | virtual void drag_active_window(mir::geometry::Displacement movement) = 0; |
1166 | 60 | 61 | ||
1167 | === added file 'scripts/filter_symbols_diff.sh' | |||
1168 | --- scripts/filter_symbols_diff.sh 1970-01-01 00:00:00 +0000 | |||
1169 | +++ scripts/filter_symbols_diff.sh 2016-11-04 16:34:03 +0000 | |||
1170 | @@ -0,0 +1,2 @@ | |||
1171 | 1 | #!/bin/sh | ||
1172 | 2 | c++filt | sed 's/+ \([^@]*[^[:space:]]*\)\(.*\)/+ (c++)"\1"\2/' | ||
1173 | 0 | 3 | ||
1174 | === modified file 'scripts/process_doxygen_xml.py' | |||
1175 | --- scripts/process_doxygen_xml.py 2016-10-06 08:26:40 +0000 | |||
1176 | +++ scripts/process_doxygen_xml.py 2016-11-04 16:34:03 +0000 | |||
1177 | @@ -1,79 +1,87 @@ | |||
1178 | 1 | #! /usr/bin/python | 1 | #! /usr/bin/python |
1179 | 2 | from xml.dom import minidom | ||
1180 | 3 | from sys import argv | ||
1181 | 4 | |||
1182 | 5 | helptext = \ | ||
1183 | 6 | """This script processes the XML generated by "make doc" and produces summary information | 2 | """This script processes the XML generated by "make doc" and produces summary information |
1184 | 7 | on symbols that libmiral intends to make public. | 3 | on symbols that libmiral intends to make public. |
1185 | 8 | 4 | ||
1186 | 9 | To use: Go to your build folder and run "make symbols""""" | 5 | To use: Go to your build folder and run "make symbols""""" |
1187 | 10 | 6 | ||
1192 | 11 | debug = False | 7 | from xml.dom import minidom |
1193 | 12 | 8 | from sys import argv | |
1194 | 13 | def get_text(node): | 9 | |
1195 | 14 | rc = [] | 10 | HELPTEXT = __doc__ |
1196 | 11 | DEBUG = False | ||
1197 | 12 | |||
1198 | 13 | def _get_text(node): | ||
1199 | 14 | substrings = [] | ||
1200 | 15 | for node in node.childNodes: | 15 | for node in node.childNodes: |
1201 | 16 | if node.nodeType == node.TEXT_NODE: | 16 | if node.nodeType == node.TEXT_NODE: |
1203 | 17 | rc.append(node.data) | 17 | substrings.append(node.data) |
1204 | 18 | elif node.nodeType == node.ELEMENT_NODE: | 18 | elif node.nodeType == node.ELEMENT_NODE: |
1215 | 19 | rc.append(get_text(node)) | 19 | substrings.append(_get_text(node)) |
1216 | 20 | return ''.join(rc) | 20 | return ''.join(substrings) |
1217 | 21 | 21 | ||
1218 | 22 | def get_text_for_element(parent, tagname): | 22 | def _get_text_for_element(parent, tagname): |
1219 | 23 | rc = [] | 23 | substrings = [] |
1220 | 24 | nodes = parent.getElementsByTagName(tagname); | 24 | |
1221 | 25 | for node in nodes : rc.append(get_text(node)) | 25 | for node in parent.getElementsByTagName(tagname): |
1222 | 26 | return ''.join(rc) | 26 | substrings.append(_get_text(node)) |
1223 | 27 | 27 | ||
1224 | 28 | def get_file_location(node): | 28 | return ''.join(substrings) |
1225 | 29 | |||
1226 | 30 | def _get_file_location(node): | ||
1227 | 29 | for node in node.childNodes: | 31 | for node in node.childNodes: |
1228 | 30 | if node.nodeType == node.ELEMENT_NODE and node.tagName == 'location': | 32 | if node.nodeType == node.ELEMENT_NODE and node.tagName == 'location': |
1229 | 31 | return node.attributes['file'].value | 33 | return node.attributes['file'].value |
1231 | 32 | if debug: print 'no location in:', node | 34 | if DEBUG: |
1232 | 35 | print 'no location in:', node | ||
1233 | 33 | return None | 36 | return None |
1236 | 34 | 37 | ||
1237 | 35 | def has_element(node, tagname): | 38 | def _has_element(node, tagname): |
1238 | 36 | for node in node.childNodes: | 39 | for node in node.childNodes: |
1239 | 37 | if node.nodeType == node.ELEMENT_NODE and node.tagName in tagname: | 40 | if node.nodeType == node.ELEMENT_NODE and node.tagName in tagname: |
1240 | 38 | return True | 41 | return True |
1241 | 39 | return False | 42 | return False |
1242 | 40 | 43 | ||
1255 | 41 | def print_attribs(node, attribs): | 44 | def _print_attribs(node, attribs): |
1256 | 42 | for attrib in attribs : print ' ', attrib, '=', node.attributes[attrib].value | 45 | for attrib in attribs: |
1257 | 43 | 46 | print ' ', attrib, '=', node.attributes[attrib].value | |
1258 | 44 | def concat_text_from_tags(parent, tagnames): | 47 | |
1259 | 45 | rc = [] | 48 | def _concat_text_from_tags(parent, tagnames): |
1260 | 46 | for tag in tagnames : rc.append(get_text_for_element(parent, tag)) | 49 | substrings = [] |
1261 | 47 | return ''.join(rc) | 50 | |
1262 | 48 | 51 | for tag in tagnames: | |
1263 | 49 | def print_location(node): | 52 | substrings.append(_get_text_for_element(parent, tag)) |
1264 | 50 | print ' ', 'location', '=', get_file_location(node) | 53 | |
1265 | 51 | 54 | return ''.join(substrings) | |
1266 | 52 | def get_attribs(node): | 55 | |
1267 | 56 | def _print_location(node): | ||
1268 | 57 | print ' ', 'location', '=', _get_file_location(node) | ||
1269 | 58 | |||
1270 | 59 | def _get_attribs(node): | ||
1271 | 53 | kind = node.attributes['kind'].value | 60 | kind = node.attributes['kind'].value |
1272 | 54 | static = node.attributes['static'].value | 61 | static = node.attributes['static'].value |
1283 | 55 | prot = node.attributes['prot'].value | 62 | prot = node.attributes['prot'].value |
1284 | 56 | return (kind, static, prot) | 63 | return kind, static, prot |
1285 | 57 | 64 | ||
1286 | 58 | # Special cases for publishing anyway: | 65 | COMPONENT_MAP = {} |
1287 | 59 | publish_special_cases = {} | 66 | SYMBOLS = {'public' : set(), 'private' : set()} |
1288 | 60 | 67 | ||
1289 | 61 | component_map = {} | 68 | def _report(publish, symbol): |
1280 | 62 | symbols = {'public' : set(), 'private' : set()} | ||
1281 | 63 | |||
1282 | 64 | def report(publish, symbol): | ||
1290 | 65 | symbol = symbol.replace('~', '?') | 69 | symbol = symbol.replace('~', '?') |
1291 | 66 | 70 | ||
1302 | 67 | if symbol in publish_special_cases: publish = True | 71 | if publish: |
1303 | 68 | 72 | SYMBOLS['public'].add(symbol) | |
1304 | 69 | if publish: symbols['public'].add(symbol) | 73 | else: |
1305 | 70 | else: symbols['private'].add(symbol) | 74 | SYMBOLS['private'].add(symbol) |
1306 | 71 | 75 | ||
1307 | 72 | if not debug: return | 76 | if not DEBUG: |
1308 | 73 | if publish: print ' PUBLISH: {}'.format(symbol) | 77 | return |
1309 | 74 | else : print 'NOPUBLISH: {}'.format(symbol) | 78 | |
1310 | 75 | 79 | if publish: | |
1311 | 76 | old_stanzas = '''MIRAL_0.1 { | 80 | print ' PUBLISH: {}'.format(symbol) |
1312 | 81 | else: | ||
1313 | 82 | print 'NOPUBLISH: {}'.format(symbol) | ||
1314 | 83 | |||
1315 | 84 | OLD_STANZAS = '''MIRAL_0.1 { | ||
1316 | 77 | global: | 85 | global: |
1317 | 78 | # We need to specify the overload of miral::WindowManagerTools::modify_window | 86 | # We need to specify the overload of miral::WindowManagerTools::modify_window |
1318 | 79 | _ZN5miral18WindowManagerTools13modify_windowERNS_10WindowInfoERKNS_19WindowSpecificationE; | 87 | _ZN5miral18WindowManagerTools13modify_windowERNS_10WindowInfoERKNS_19WindowSpecificationE; |
1319 | @@ -378,123 +386,161 @@ | |||
1320 | 378 | global: | 386 | global: |
1321 | 379 | # We need to specify the overload of miral::WindowManagerTools::modify_window | 387 | # We need to specify the overload of miral::WindowManagerTools::modify_window |
1322 | 380 | _ZN5miral18WindowManagerTools13modify_windowERKNS_6WindowERKNS_19WindowSpecificationE; | 388 | _ZN5miral18WindowManagerTools13modify_windowERKNS_6WindowERKNS_19WindowSpecificationE; |
1323 | 389 | extern "C++" { | ||
1324 | 390 | miral::Keymap::?Keymap*; | ||
1325 | 391 | miral::Keymap::Keymap*; | ||
1326 | 392 | miral::Keymap::operator*; | ||
1327 | 393 | miral::Keymap::set_keymap*; | ||
1328 | 394 | miral::WindowSpecification::userdata*; | ||
1329 | 395 | typeinfo?for?miral::Keymap; | ||
1330 | 396 | vtable?for?miral::Keymap; | ||
1331 | 397 | }; | ||
1332 | 398 | } MIRAL_0.2; | ||
1333 | 399 | |||
1334 | 400 | MIRAL_0.4 { | ||
1335 | 401 | global: | ||
1336 | 381 | extern "C++" {''' | 402 | extern "C++" {''' |
1337 | 382 | 403 | ||
1340 | 383 | end_new_stanza = ''' }; | 404 | END_NEW_STANZA = ''' }; |
1341 | 384 | } MIRAL_0.2;''' | 405 | } MIRAL_0.3;''' |
1342 | 385 | 406 | ||
1346 | 386 | def print_report(): | 407 | def _print_report(): |
1347 | 387 | print old_stanzas | 408 | print OLD_STANZAS |
1348 | 388 | for symbol in sorted(symbols['public']): | 409 | for symbol in sorted(SYMBOLS['public']): |
1349 | 389 | formatted_symbol = ' {};'.format(symbol) | 410 | formatted_symbol = ' {};'.format(symbol) |
1351 | 390 | if not formatted_symbol in old_stanzas: | 411 | if formatted_symbol not in OLD_STANZAS: |
1352 | 391 | print formatted_symbol | 412 | print formatted_symbol |
1354 | 392 | print end_new_stanza | 413 | print END_NEW_STANZA |
1355 | 393 | 414 | ||
1358 | 394 | def print_debug_info(node, attributes): | 415 | def _print_debug_info(node, attributes): |
1359 | 395 | if not debug: return | 416 | if not DEBUG: |
1360 | 417 | return | ||
1361 | 396 | 418 | ||
1382 | 397 | print_attribs(node, attributes) | 419 | _print_attribs(node, attributes) |
1383 | 398 | print_location(node) | 420 | _print_location(node) |
1384 | 399 | 421 | ||
1385 | 400 | def find_physical_component(location_file): | 422 | def _parse_member_def(context_name, node, is_class): |
1386 | 401 | path_elements = location_file.split('/') | 423 | kind = node.attributes['kind'].value |
1387 | 402 | found = False | 424 | |
1388 | 403 | for element in path_elements: | 425 | if (kind in ['enum', 'typedef'] |
1389 | 404 | if found: return element | 426 | or _has_element(node, ['templateparamlist']) |
1390 | 405 | found = element in ['include', 'src'] | 427 | or kind in ['function'] and node.attributes['inline'].value == 'yes'): |
1391 | 406 | if debug: print 'no component in:', location_file | 428 | return |
1392 | 407 | return None | 429 | |
1393 | 408 | 430 | name = _concat_text_from_tags(node, ['name']) | |
1394 | 409 | def parse_member_def(context_name, node, is_class): | 431 | |
1375 | 410 | (kind, static, prot) = get_attribs(node) | ||
1376 | 411 | |||
1377 | 412 | if kind in ['enum', 'typedef']: return | ||
1378 | 413 | if has_element(node, ['templateparamlist']): return | ||
1379 | 414 | if kind in ['function'] and node.attributes['inline'].value == 'yes': return | ||
1380 | 415 | |||
1381 | 416 | name = concat_text_from_tags(node, ['name']) | ||
1395 | 417 | if name in ['__attribute__']: | 432 | if name in ['__attribute__']: |
1397 | 418 | if debug: print ' ignoring doxygen mis-parsing:', concat_text_from_tags(node, ['argsstring']) | 433 | if DEBUG: |
1398 | 434 | print ' ignoring doxygen mis-parsing:', _concat_text_from_tags(node, ['argsstring']) | ||
1399 | 419 | return | 435 | return |
1400 | 420 | 436 | ||
1404 | 421 | if name.startswith('operator'): name = 'operator' | 437 | if name.startswith('operator'): |
1405 | 422 | if not context_name == None: symbol = context_name + '::' + name | 438 | name = 'operator' |
1406 | 423 | else: symbol = name | 439 | |
1407 | 440 | if not context_name is None: | ||
1408 | 441 | symbol = context_name + '::' + name | ||
1409 | 442 | else: | ||
1410 | 443 | symbol = name | ||
1411 | 444 | |||
1412 | 445 | is_function = kind == 'function' | ||
1413 | 446 | |||
1414 | 447 | if is_function: | ||
1415 | 448 | _print_debug_info(node, ['kind', 'prot', 'static', 'virt']) | ||
1416 | 449 | else: | ||
1417 | 450 | _print_debug_info(node, ['kind', 'prot', 'static']) | ||
1418 | 451 | |||
1419 | 452 | if DEBUG: | ||
1420 | 453 | print ' is_class:', is_class | ||
1421 | 454 | |||
1422 | 455 | publish = _should_publish(is_class, is_function, node) | ||
1423 | 456 | |||
1424 | 457 | _report(publish, symbol + '*') | ||
1425 | 458 | |||
1426 | 459 | if is_function and node.attributes['virt'].value == 'virtual': | ||
1427 | 460 | _report(publish, 'non-virtual?thunk?to?' + symbol + '*') | ||
1428 | 461 | |||
1429 | 462 | |||
1430 | 463 | def _should_publish(is_class, is_function, node): | ||
1431 | 464 | (kind, static, prot) = _get_attribs(node) | ||
1432 | 424 | 465 | ||
1433 | 425 | publish = True | 466 | publish = True |
1434 | 426 | 467 | ||
1438 | 427 | is_function = kind == 'function' | 468 | if publish: |
1439 | 428 | if publish: publish = kind != 'define' | 469 | publish = kind != 'define' |
1440 | 429 | if publish and is_class: publish = is_function or static == 'yes' | 470 | |
1441 | 471 | if publish and is_class: | ||
1442 | 472 | publish = is_function or static == 'yes' | ||
1443 | 473 | |||
1444 | 430 | if publish and prot == 'private': | 474 | if publish and prot == 'private': |
1460 | 431 | if is_function: publish = node.attributes['virt'].value == 'virtual' | 475 | if is_function: |
1461 | 432 | else: publish = False | 476 | publish = node.attributes['virt'].value == 'virtual' |
1462 | 433 | 477 | else: | |
1463 | 434 | if publish and has_element(node, ['argsstring']): | 478 | publish = False |
1464 | 435 | publish = not get_text_for_element(node, 'argsstring').endswith('=0') | 479 | |
1465 | 436 | 480 | if publish and _has_element(node, ['argsstring']): | |
1466 | 437 | if is_function: print_debug_info(node, ['kind', 'prot', 'static', 'virt']) | 481 | publish = not _get_text_for_element(node, 'argsstring').endswith('=0') |
1467 | 438 | else: print_debug_info(node, ['kind', 'prot', 'static']) | 482 | |
1468 | 439 | if debug: print ' is_class:', is_class | 483 | return publish |
1469 | 440 | report(publish, symbol + '*') | 484 | |
1470 | 441 | if is_function and node.attributes['virt'].value == 'virtual': report(publish, | 485 | |
1471 | 442 | 'non-virtual?thunk?to?' + symbol + '*') | 486 | def _parse_compound_defs(xmldoc): |
1472 | 443 | 487 | compounddefs = xmldoc.getElementsByTagName('compounddef') | |
1458 | 444 | def parse_compound_defs(xmldoc): | ||
1459 | 445 | compounddefs = xmldoc.getElementsByTagName('compounddef') | ||
1473 | 446 | for node in compounddefs: | 488 | for node in compounddefs: |
1474 | 447 | kind = node.attributes['kind'].value | 489 | kind = node.attributes['kind'].value |
1475 | 448 | 490 | ||
1498 | 449 | if kind in ['page', 'file', 'example', 'union']: continue | 491 | if kind in ['page', 'file', 'example', 'union']: |
1499 | 450 | 492 | continue | |
1500 | 451 | if kind in ['group']: | 493 | |
1501 | 452 | for member in node.getElementsByTagName('memberdef') : | 494 | if kind in ['group']: |
1502 | 453 | parse_member_def(None, member, False) | 495 | for member in node.getElementsByTagName('memberdef'): |
1503 | 454 | continue | 496 | _parse_member_def(None, member, False) |
1504 | 455 | 497 | continue | |
1505 | 456 | if kind in ['namespace']: | 498 | |
1506 | 457 | symbol = concat_text_from_tags(node, ['compoundname']) | 499 | if kind in ['namespace']: |
1507 | 458 | for member in node.getElementsByTagName('memberdef') : | 500 | symbol = _concat_text_from_tags(node, ['compoundname']) |
1508 | 459 | parse_member_def(symbol, member, False) | 501 | for member in node.getElementsByTagName('memberdef'): |
1509 | 460 | continue | 502 | _parse_member_def(symbol, member, False) |
1510 | 461 | 503 | continue | |
1511 | 462 | file = get_file_location(node) | 504 | |
1512 | 463 | if debug: print ' from file:', file | 505 | filename = _get_file_location(node) |
1513 | 464 | if '/examples/' in file or '/test/' in file or '[generated]' in file or '[STL]' in file: | 506 | |
1514 | 465 | continue | 507 | if DEBUG: |
1515 | 466 | 508 | print ' from file:', filename | |
1516 | 467 | if has_element(node, ['templateparamlist']): continue | 509 | |
1517 | 468 | 510 | if ('/examples/' in filename or '/test/' in filename or '[generated]' in filename | |
1518 | 469 | symbol = concat_text_from_tags(node, ['compoundname']) | 511 | or '[STL]' in filename or _has_element(node, ['templateparamlist'])): |
1519 | 470 | 512 | continue | |
1520 | 513 | |||
1521 | 514 | symbol = _concat_text_from_tags(node, ['compoundname']) | ||
1522 | 515 | |||
1523 | 471 | publish = True | 516 | publish = True |
1524 | 472 | 517 | ||
1526 | 473 | if publish: | 518 | if publish: |
1527 | 474 | if kind in ['class', 'struct']: | 519 | if kind in ['class', 'struct']: |
1529 | 475 | prot = node.attributes['prot'].value | 520 | prot = node.attributes['prot'].value |
1530 | 476 | publish = prot != 'private' | 521 | publish = prot != 'private' |
1534 | 477 | print_debug_info(node, ['kind', 'prot']) | 522 | _print_debug_info(node, ['kind', 'prot']) |
1535 | 478 | report(publish, 'vtable?for?' + symbol) | 523 | _report(publish, 'vtable?for?' + symbol) |
1536 | 479 | report(publish, 'typeinfo?for?' + symbol) | 524 | _report(publish, 'typeinfo?for?' + symbol) |
1537 | 480 | 525 | ||
1541 | 481 | if publish: | 526 | if publish: |
1542 | 482 | for member in node.getElementsByTagName('memberdef') : | 527 | for member in node.getElementsByTagName('memberdef'): |
1543 | 483 | parse_member_def(symbol, member, kind in ['class', 'struct']) | 528 | _parse_member_def(symbol, member, kind in ['class', 'struct']) |
1544 | 484 | 529 | ||
1545 | 485 | if __name__ == "__main__": | 530 | if __name__ == "__main__": |
1546 | 486 | if len(argv) == 1 or '-h' in argv or '--help' in argv: | 531 | if len(argv) == 1 or '-h' in argv or '--help' in argv: |
1548 | 487 | print helptext | 532 | print HELPTEXT |
1549 | 488 | exit() | 533 | exit() |
1550 | 489 | 534 | ||
1551 | 490 | for arg in argv[1:]: | 535 | for arg in argv[1:]: |
1552 | 491 | try: | 536 | try: |
1556 | 492 | if debug: print 'Processing:', arg | 537 | if DEBUG: |
1557 | 493 | xmldoc = minidom.parse(arg) | 538 | print 'Processing:', arg |
1558 | 494 | parse_compound_defs(xmldoc) | 539 | _parse_compound_defs(minidom.parse(arg)) |
1559 | 495 | except Exception as error: | 540 | except Exception as error: |
1560 | 496 | print 'Error:', arg, error | 541 | print 'Error:', arg, error |
1561 | 497 | 542 | ||
1563 | 498 | if debug: print 'Processing complete' | 543 | if DEBUG: |
1564 | 544 | print 'Processing complete' | ||
1565 | 499 | 545 | ||
1567 | 500 | print_report() | 546 | _print_report() |
1568 | 501 | 547 | ||
1569 | === modified file 'tasks_for_the_interested_reader.md' | |||
1570 | --- tasks_for_the_interested_reader.md 2016-09-21 16:36:56 +0000 | |||
1571 | +++ tasks_for_the_interested_reader.md 2016-11-04 16:34:03 +0000 | |||
1572 | @@ -37,9 +37,6 @@ | |||
1573 | 37 | - Titlebars. GTK+ apps provide their own titlebars, better integration is | 37 | - Titlebars. GTK+ apps provide their own titlebars, better integration is |
1574 | 38 | needed. | 38 | needed. |
1575 | 39 | 39 | ||
1576 | 40 | - Keyboard layouts. It should be possible to configure and use non-US keyboard | ||
1577 | 41 | layouts. | ||
1578 | 42 | |||
1579 | 43 | - Better integration of startup animation. A short animation is played on | 40 | - Better integration of startup animation. A short animation is played on |
1580 | 44 | startup. Ideally this should remain visible until a client is launched, | 41 | startup. Ideally this should remain visible until a client is launched, |
1581 | 45 | fade out over the top of the client and resume when the last client exits. | 42 | fade out over the top of the client and resume when the last client exits. |
1582 | @@ -72,9 +69,6 @@ | |||
1583 | 72 | - ability to track connected input devices | 69 | - ability to track connected input devices |
1584 | 73 | - ability to control cursor visibility | 70 | - ability to control cursor visibility |
1585 | 74 | 71 | ||
1586 | 75 | - Cursor images. lp:qtmir stubs the cursor images and paints the cursor in its | ||
1587 | 76 | compositor. Need to consider what ought to be supported here. | ||
1588 | 77 | |||
1589 | 78 | - Cut&Paste/Drag&Drop toolkits expect this functionality, but it isn't | 72 | - Cut&Paste/Drag&Drop toolkits expect this functionality, but it isn't |
1590 | 79 | provided by Mir. We ought to find a way to provide this. | 73 | provided by Mir. We ought to find a way to provide this. |
1591 | 80 | 74 |
lp:1639567