Merge lp:~alan-griffiths/miral/add-symbols-map into lp:miral
- add-symbols-map
- Merge into trunk
Proposed by
Alan Griffiths
on 2016-08-02
| Status: | Merged |
|---|---|
| Approved by: | Alan Griffiths on 2016-08-03 |
| Approved revision: | 254 |
| Merged at revision: | 251 |
| Proposed branch: | lp:~alan-griffiths/miral/add-symbols-map |
| Merge into: | lp:miral |
| Diff against target: |
533 lines (+481/-2) 4 files modified
miral/CMakeLists.txt (+15/-2) miral/symbols.map (+271/-0) scripts/process_doxygen_xml.py (+194/-0) test/CMakeLists.txt (+1/-0) |
| To merge this branch: | bzr merge lp:~alan-griffiths/miral/add-symbols-map |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Alexandros Frantzis (community) | 2016-08-02 | Approve on 2016-08-02 | |
|
Review via email:
|
|||
Commit Message
Add symbols map to ensure we only publish public symbols from libmiral
Description of the Change
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
| 1 | === modified file 'miral/CMakeLists.txt' |
| 2 | --- miral/CMakeLists.txt 2016-07-28 08:33:19 +0000 |
| 3 | +++ miral/CMakeLists.txt 2016-08-02 09:11:08 +0000 |
| 4 | @@ -1,7 +1,15 @@ |
| 5 | pkg_check_modules(MIRSERVER mirserver>=0.20 REQUIRED) |
| 6 | |
| 7 | +set(MIRAL_ABI 1) |
| 8 | +set(symbol_map ${CMAKE_CURRENT_SOURCE_DIR}/symbols.map) |
| 9 | + |
| 10 | include_directories(include SYSTEM ${MIRSERVER_INCLUDE_DIRS}) |
| 11 | |
| 12 | +add_library(miral-internal STATIC |
| 13 | + basic_window_manager.cpp basic_window_manager.h window_manager_tools_implementation.h |
| 14 | + mru_window_list.cpp mru_window_list.h |
| 15 | +) |
| 16 | + |
| 17 | add_library(miral SHARED |
| 18 | active_outputs.cpp ${CMAKE_SOURCE_DIR}/include/miral/active_outputs.h |
| 19 | application.cpp ${CMAKE_SOURCE_DIR}/include/miral/application.h |
| 20 | @@ -17,9 +25,7 @@ |
| 21 | window_management_options.cpp ${CMAKE_SOURCE_DIR}/include/miral/window_management_options.h |
| 22 | window_specification.cpp ${CMAKE_SOURCE_DIR}/include/miral/window_specification.h |
| 23 | internal_client.cpp ${CMAKE_SOURCE_DIR}/include/miral/internal_client.h |
| 24 | - mru_window_list.cpp mru_window_list.h |
| 25 | set_window_managment_policy.cpp ${CMAKE_SOURCE_DIR}/include/miral/set_window_managment_policy.h |
| 26 | - basic_window_manager.cpp basic_window_manager.h window_manager_tools_implementation.h |
| 27 | window_management_policy.cpp ${CMAKE_SOURCE_DIR}/include/miral/window_management_policy.h |
| 28 | window_manager_tools.cpp ${CMAKE_SOURCE_DIR}/include/miral/window_manager_tools.h |
| 29 | ${CMAKE_SOURCE_DIR}/include/miral/stream_specification.h |
| 30 | @@ -32,9 +38,16 @@ |
| 31 | ${MIRCLIENT_LDFLAGS} |
| 32 | ${MIRCOMMON_LDFLAGS} |
| 33 | PRIVATE |
| 34 | + miral-internal |
| 35 | ${MIRSERVER_LDFLAGS} |
| 36 | ) |
| 37 | |
| 38 | +set_target_properties(miral |
| 39 | + PROPERTIES |
| 40 | + SOVERSION ${MIRAL_ABI} |
| 41 | + LINK_FLAGS "-Wl,--exclude-libs=ALL -Wl,--version-script,${symbol_map}" |
| 42 | +) |
| 43 | + |
| 44 | set(LIBDIR "${CMAKE_INSTALL_PREFIX}/lib") |
| 45 | set(INCLUDEDIR "${CMAKE_INSTALL_PREFIX}/include/miral") |
| 46 | |
| 47 | |
| 48 | === added file 'miral/symbols.map' |
| 49 | --- miral/symbols.map 1970-01-01 00:00:00 +0000 |
| 50 | +++ miral/symbols.map 2016-08-02 09:11:08 +0000 |
| 51 | @@ -0,0 +1,271 @@ |
| 52 | +MIRAL_0.1 { |
| 53 | +global: |
| 54 | + extern "C++" { |
| 55 | + miral::ActiveOutputsListener::?ActiveOutputsListener*; |
| 56 | + miral::ActiveOutputsListener::ActiveOutputsListener*; |
| 57 | + miral::ActiveOutputsListener::advise_output_begin*; |
| 58 | + miral::ActiveOutputsListener::advise_output_create*; |
| 59 | + miral::ActiveOutputsListener::advise_output_delete*; |
| 60 | + miral::ActiveOutputsListener::advise_output_end*; |
| 61 | + miral::ActiveOutputsListener::advise_output_update*; |
| 62 | + miral::ActiveOutputsListener::operator*; |
| 63 | + miral::ActiveOutputsMonitor::?ActiveOutputsMonitor*; |
| 64 | + miral::ActiveOutputsMonitor::ActiveOutputsMonitor*; |
| 65 | + miral::ActiveOutputsMonitor::add_listener*; |
| 66 | + miral::ActiveOutputsMonitor::delete_listener*; |
| 67 | + miral::ActiveOutputsMonitor::for_each_output*; |
| 68 | + miral::ActiveOutputsMonitor::operator*; |
| 69 | + miral::ApplicationAuthorizer::?ApplicationAuthorizer*; |
| 70 | + miral::ApplicationAuthorizer::ApplicationAuthorizer*; |
| 71 | + miral::ApplicationAuthorizer::operator*; |
| 72 | + miral::ApplicationCredentials::ApplicationCredentials*; |
| 73 | + miral::ApplicationCredentials::gid*; |
| 74 | + miral::ApplicationCredentials::pid*; |
| 75 | + miral::ApplicationCredentials::uid*; |
| 76 | + miral::ApplicationInfo::?ApplicationInfo*; |
| 77 | + miral::ApplicationInfo::ApplicationInfo*; |
| 78 | + miral::ApplicationInfo::add_window*; |
| 79 | + miral::ApplicationInfo::application*; |
| 80 | + miral::ApplicationInfo::operator*; |
| 81 | + miral::ApplicationInfo::remove_window*; |
| 82 | + miral::ApplicationInfo::userdata*; |
| 83 | + miral::ApplicationInfo::windows*; |
| 84 | + miral::BasicSetApplicationAuthorizer::?BasicSetApplicationAuthorizer*; |
| 85 | + miral::BasicSetApplicationAuthorizer::BasicSetApplicationAuthorizer*; |
| 86 | + miral::BasicSetApplicationAuthorizer::operator*; |
| 87 | + miral::BasicSetApplicationAuthorizer::the_application_authorizer*; |
| 88 | + miral::CanonicalWindowManagerPolicy::CanonicalWindowManagerPolicy*; |
| 89 | + miral::CanonicalWindowManagerPolicy::advise_focus_gained*; |
| 90 | + miral::CanonicalWindowManagerPolicy::handle_modify_window*; |
| 91 | + miral::CanonicalWindowManagerPolicy::handle_raise_window*; |
| 92 | + miral::CanonicalWindowManagerPolicy::handle_window_ready*; |
| 93 | + miral::CanonicalWindowManagerPolicy::place_new_surface*; |
| 94 | + miral::InternalClientLauncher::?InternalClientLauncher*; |
| 95 | + miral::InternalClientLauncher::InternalClientLauncher*; |
| 96 | + miral::InternalClientLauncher::launch*; |
| 97 | + miral::InternalClientLauncher::operator*; |
| 98 | + miral::MirRunner::MirRunner*; |
| 99 | + miral::MirRunner::run_with*; |
| 100 | + miral::Output::?Output*; |
| 101 | + miral::Output::Output*; |
| 102 | + miral::Output::connected*; |
| 103 | + miral::Output::extents*; |
| 104 | + miral::Output::form_factor*; |
| 105 | + miral::Output::is_same_output*; |
| 106 | + miral::Output::operator*; |
| 107 | + miral::Output::orientation*; |
| 108 | + miral::Output::physical_size_mm*; |
| 109 | + miral::Output::pixel_format*; |
| 110 | + miral::Output::power_mode*; |
| 111 | + miral::Output::refresh_rate*; |
| 112 | + miral::Output::scale*; |
| 113 | + miral::Output::type*; |
| 114 | + miral::Output::used*; |
| 115 | + miral::Output::valid*; |
| 116 | + miral::QuitOnCtrlAltBkSp::operator*; |
| 117 | + miral::SetWindowManagmentPolicy::?SetWindowManagmentPolicy*; |
| 118 | + miral::SetWindowManagmentPolicy::SetWindowManagmentPolicy*; |
| 119 | + miral::SetWindowManagmentPolicy::operator*; |
| 120 | + miral::StartupInternalClient::?StartupInternalClient*; |
| 121 | + miral::StartupInternalClient::StartupInternalClient*; |
| 122 | + miral::StartupInternalClient::operator*; |
| 123 | + miral::Window::?Window*; |
| 124 | + miral::Window::Window*; |
| 125 | + miral::Window::application*; |
| 126 | + miral::Window::hide*; |
| 127 | + miral::Window::input_area_contains*; |
| 128 | + miral::Window::move_to*; |
| 129 | + miral::Window::operator*; |
| 130 | + miral::Window::request_client_surface_close*; |
| 131 | + miral::Window::resize*; |
| 132 | + miral::Window::set_alpha*; |
| 133 | + miral::Window::set_state*; |
| 134 | + miral::Window::show*; |
| 135 | + miral::Window::size*; |
| 136 | + miral::Window::surface_id*; |
| 137 | + miral::Window::top_left*; |
| 138 | + miral::WindowInfo::?WindowInfo*; |
| 139 | + miral::WindowInfo::WindowInfo*; |
| 140 | + miral::WindowInfo::add_child*; |
| 141 | + miral::WindowInfo::can_be_active*; |
| 142 | + miral::WindowInfo::can_morph_to*; |
| 143 | + miral::WindowInfo::children*; |
| 144 | + miral::WindowInfo::constrain_resize*; |
| 145 | + miral::WindowInfo::has_height_inc*; |
| 146 | + miral::WindowInfo::has_max_aspect*; |
| 147 | + miral::WindowInfo::has_min_aspect*; |
| 148 | + miral::WindowInfo::has_name*; |
| 149 | + miral::WindowInfo::has_output_id*; |
| 150 | + miral::WindowInfo::has_width_inc*; |
| 151 | + miral::WindowInfo::height_inc*; |
| 152 | + miral::WindowInfo::is_visible*; |
| 153 | + miral::WindowInfo::max_aspect*; |
| 154 | + miral::WindowInfo::max_height*; |
| 155 | + miral::WindowInfo::max_width*; |
| 156 | + miral::WindowInfo::min_aspect*; |
| 157 | + miral::WindowInfo::min_height*; |
| 158 | + miral::WindowInfo::min_width*; |
| 159 | + miral::WindowInfo::must_have_parent*; |
| 160 | + miral::WindowInfo::must_not_have_parent*; |
| 161 | + miral::WindowInfo::name*; |
| 162 | + miral::WindowInfo::needs_titlebar*; |
| 163 | + miral::WindowInfo::operator*; |
| 164 | + miral::WindowInfo::output_id*; |
| 165 | + miral::WindowInfo::parent*; |
| 166 | + miral::WindowInfo::preferred_orientation*; |
| 167 | + miral::WindowInfo::remove_child*; |
| 168 | + miral::WindowInfo::restore_rect*; |
| 169 | + miral::WindowInfo::state*; |
| 170 | + miral::WindowInfo::type*; |
| 171 | + miral::WindowInfo::userdata*; |
| 172 | + miral::WindowInfo::width_inc*; |
| 173 | + miral::WindowInfo::window*; |
| 174 | + miral::WindowManagementPolicy::?WindowManagementPolicy*; |
| 175 | + miral::WindowManagementPolicy::WindowManagementPolicy*; |
| 176 | + miral::WindowManagementPolicy::advise_begin*; |
| 177 | + miral::WindowManagementPolicy::advise_delete_app*; |
| 178 | + miral::WindowManagementPolicy::advise_delete_window*; |
| 179 | + miral::WindowManagementPolicy::advise_end*; |
| 180 | + miral::WindowManagementPolicy::advise_focus_gained*; |
| 181 | + miral::WindowManagementPolicy::advise_focus_lost*; |
| 182 | + miral::WindowManagementPolicy::advise_move_to*; |
| 183 | + miral::WindowManagementPolicy::advise_new_app*; |
| 184 | + miral::WindowManagementPolicy::advise_new_window*; |
| 185 | + miral::WindowManagementPolicy::advise_raise*; |
| 186 | + miral::WindowManagementPolicy::advise_resize*; |
| 187 | + miral::WindowManagementPolicy::advise_state_change*; |
| 188 | + miral::WindowManagementPolicy::operator*; |
| 189 | + miral::WindowManagerOptions::WindowManagerOptions*; |
| 190 | + miral::WindowManagerOptions::operator*; |
| 191 | + miral::WindowManagerTools::?WindowManagerTools*; |
| 192 | + miral::WindowManagerTools::WindowManagerTools*; |
| 193 | + miral::WindowManagerTools::active_display*; |
| 194 | + miral::WindowManagerTools::active_window*; |
| 195 | + miral::WindowManagerTools::count_applications*; |
| 196 | + miral::WindowManagerTools::drag_active_window*; |
| 197 | + miral::WindowManagerTools::find_application*; |
| 198 | + miral::WindowManagerTools::focus_next_application*; |
| 199 | + miral::WindowManagerTools::focus_next_within_application*; |
| 200 | + miral::WindowManagerTools::for_each_application*; |
| 201 | + miral::WindowManagerTools::info_for*; |
| 202 | + miral::WindowManagerTools::invoke_under_lock*; |
| 203 | + miral::WindowManagerTools::kill_active_application*; |
| 204 | + miral::WindowManagerTools::modify_window*; |
| 205 | + miral::WindowManagerTools::operator*; |
| 206 | + miral::WindowManagerTools::place_and_size*; |
| 207 | + miral::WindowManagerTools::raise_tree*; |
| 208 | + miral::WindowManagerTools::select_active_window*; |
| 209 | + miral::WindowManagerTools::set_state*; |
| 210 | + miral::WindowManagerTools::window_at*; |
| 211 | + miral::WindowSpecification::?WindowSpecification*; |
| 212 | + miral::WindowSpecification::WindowSpecification*; |
| 213 | + miral::WindowSpecification::aux_rect*; |
| 214 | + miral::WindowSpecification::buffer_usage*; |
| 215 | + miral::WindowSpecification::content_id*; |
| 216 | + miral::WindowSpecification::edge_attachment*; |
| 217 | + miral::WindowSpecification::height_inc*; |
| 218 | + miral::WindowSpecification::input_mode*; |
| 219 | + miral::WindowSpecification::input_shape*; |
| 220 | + miral::WindowSpecification::max_aspect*; |
| 221 | + miral::WindowSpecification::max_height*; |
| 222 | + miral::WindowSpecification::max_width*; |
| 223 | + miral::WindowSpecification::min_aspect*; |
| 224 | + miral::WindowSpecification::min_height*; |
| 225 | + miral::WindowSpecification::min_width*; |
| 226 | + miral::WindowSpecification::name*; |
| 227 | + miral::WindowSpecification::operator*; |
| 228 | + miral::WindowSpecification::output_id*; |
| 229 | + miral::WindowSpecification::parent*; |
| 230 | + miral::WindowSpecification::pixel_format*; |
| 231 | + miral::WindowSpecification::preferred_orientation*; |
| 232 | + miral::WindowSpecification::shell_chrome*; |
| 233 | + miral::WindowSpecification::size*; |
| 234 | + miral::WindowSpecification::state*; |
| 235 | + miral::WindowSpecification::streams*; |
| 236 | + miral::WindowSpecification::top_left*; |
| 237 | + miral::WindowSpecification::type*; |
| 238 | + miral::WindowSpecification::update*; |
| 239 | + miral::WindowSpecification::width_inc*; |
| 240 | + miral::display_configuration_options*; |
| 241 | + miral::equivalent_display_area*; |
| 242 | + miral::kill*; |
| 243 | + miral::operator*; |
| 244 | + miral::toolkit::Connection::Connection*; |
| 245 | + non-virtual?thunk?to?miral::ActiveOutputsListener::?ActiveOutputsListener*; |
| 246 | + non-virtual?thunk?to?miral::ActiveOutputsListener::advise_output_begin*; |
| 247 | + non-virtual?thunk?to?miral::ActiveOutputsListener::advise_output_create*; |
| 248 | + non-virtual?thunk?to?miral::ActiveOutputsListener::advise_output_delete*; |
| 249 | + non-virtual?thunk?to?miral::ActiveOutputsListener::advise_output_end*; |
| 250 | + non-virtual?thunk?to?miral::ActiveOutputsListener::advise_output_update*; |
| 251 | + non-virtual?thunk?to?miral::ApplicationAuthorizer::?ApplicationAuthorizer*; |
| 252 | + non-virtual?thunk?to?miral::CanonicalWindowManagerPolicy::advise_focus_gained*; |
| 253 | + non-virtual?thunk?to?miral::CanonicalWindowManagerPolicy::handle_modify_window*; |
| 254 | + non-virtual?thunk?to?miral::CanonicalWindowManagerPolicy::handle_raise_window*; |
| 255 | + non-virtual?thunk?to?miral::CanonicalWindowManagerPolicy::handle_window_ready*; |
| 256 | + non-virtual?thunk?to?miral::CanonicalWindowManagerPolicy::place_new_surface*; |
| 257 | + non-virtual?thunk?to?miral::WindowManagementPolicy::?WindowManagementPolicy*; |
| 258 | + non-virtual?thunk?to?miral::WindowManagementPolicy::advise_begin*; |
| 259 | + non-virtual?thunk?to?miral::WindowManagementPolicy::advise_delete_app*; |
| 260 | + non-virtual?thunk?to?miral::WindowManagementPolicy::advise_delete_window*; |
| 261 | + non-virtual?thunk?to?miral::WindowManagementPolicy::advise_end*; |
| 262 | + non-virtual?thunk?to?miral::WindowManagementPolicy::advise_focus_gained*; |
| 263 | + non-virtual?thunk?to?miral::WindowManagementPolicy::advise_focus_lost*; |
| 264 | + non-virtual?thunk?to?miral::WindowManagementPolicy::advise_move_to*; |
| 265 | + non-virtual?thunk?to?miral::WindowManagementPolicy::advise_new_app*; |
| 266 | + non-virtual?thunk?to?miral::WindowManagementPolicy::advise_new_window*; |
| 267 | + non-virtual?thunk?to?miral::WindowManagementPolicy::advise_raise*; |
| 268 | + non-virtual?thunk?to?miral::WindowManagementPolicy::advise_resize*; |
| 269 | + non-virtual?thunk?to?miral::WindowManagementPolicy::advise_state_change*; |
| 270 | + typeinfo?for?miral::ActiveOutputsListener; |
| 271 | + typeinfo?for?miral::ActiveOutputsMonitor; |
| 272 | + typeinfo?for?miral::ApplicationAuthorizer; |
| 273 | + typeinfo?for?miral::ApplicationCredentials; |
| 274 | + typeinfo?for?miral::ApplicationInfo; |
| 275 | + typeinfo?for?miral::BasicSetApplicationAuthorizer; |
| 276 | + typeinfo?for?miral::CanonicalWindowManagerPolicy; |
| 277 | + typeinfo?for?miral::InternalClientLauncher; |
| 278 | + typeinfo?for?miral::MirRunner; |
| 279 | + typeinfo?for?miral::Output; |
| 280 | + typeinfo?for?miral::Output::PhysicalSizeMM; |
| 281 | + typeinfo?for?miral::QuitOnCtrlAltBkSp; |
| 282 | + typeinfo?for?miral::SetWindowManagmentPolicy; |
| 283 | + typeinfo?for?miral::StartupInternalClient; |
| 284 | + typeinfo?for?miral::StreamSpecification; |
| 285 | + typeinfo?for?miral::Window; |
| 286 | + typeinfo?for?miral::WindowInfo; |
| 287 | + typeinfo?for?miral::WindowManagementPolicy; |
| 288 | + typeinfo?for?miral::WindowManagerOption; |
| 289 | + typeinfo?for?miral::WindowManagerOptions; |
| 290 | + typeinfo?for?miral::WindowManagerTools; |
| 291 | + typeinfo?for?miral::WindowSpecification; |
| 292 | + typeinfo?for?miral::WindowSpecification::AspectRatio; |
| 293 | + typeinfo?for?miral::toolkit::Connection; |
| 294 | + typeinfo?for?miral::toolkit::SurfaceSpec; |
| 295 | + vtable?for?miral::ActiveOutputsListener; |
| 296 | + vtable?for?miral::ActiveOutputsMonitor; |
| 297 | + vtable?for?miral::ApplicationAuthorizer; |
| 298 | + vtable?for?miral::ApplicationCredentials; |
| 299 | + vtable?for?miral::ApplicationInfo; |
| 300 | + vtable?for?miral::BasicSetApplicationAuthorizer; |
| 301 | + vtable?for?miral::CanonicalWindowManagerPolicy; |
| 302 | + vtable?for?miral::InternalClientLauncher; |
| 303 | + vtable?for?miral::MirRunner; |
| 304 | + vtable?for?miral::Output; |
| 305 | + vtable?for?miral::Output::PhysicalSizeMM; |
| 306 | + vtable?for?miral::QuitOnCtrlAltBkSp; |
| 307 | + vtable?for?miral::SetWindowManagmentPolicy; |
| 308 | + vtable?for?miral::StartupInternalClient; |
| 309 | + vtable?for?miral::StreamSpecification; |
| 310 | + vtable?for?miral::Window; |
| 311 | + vtable?for?miral::WindowInfo; |
| 312 | + vtable?for?miral::WindowManagementPolicy; |
| 313 | + vtable?for?miral::WindowManagerOption; |
| 314 | + vtable?for?miral::WindowManagerOptions; |
| 315 | + vtable?for?miral::WindowManagerTools; |
| 316 | + vtable?for?miral::WindowSpecification; |
| 317 | + vtable?for?miral::WindowSpecification::AspectRatio; |
| 318 | + vtable?for?miral::toolkit::Connection; |
| 319 | + vtable?for?miral::toolkit::SurfaceSpec; |
| 320 | + }; |
| 321 | +local: *; |
| 322 | +}; |
| 323 | |
| 324 | === added file 'scripts/process_doxygen_xml.py' |
| 325 | --- scripts/process_doxygen_xml.py 1970-01-01 00:00:00 +0000 |
| 326 | +++ scripts/process_doxygen_xml.py 2016-08-02 09:11:08 +0000 |
| 327 | @@ -0,0 +1,194 @@ |
| 328 | +#! /usr/bin/python |
| 329 | +from xml.dom import minidom |
| 330 | +from sys import argv |
| 331 | + |
| 332 | +helptext = \ |
| 333 | +"""This script processes the XML generated by "make doc" and produces summary information |
| 334 | +on symbols that libmiral intends to make public. |
| 335 | + |
| 336 | +To use: |
| 337 | + |
| 338 | +1. Go to your build folder and run "make doc" |
| 339 | +2. Create symbols.map by running "../scripts/process_doxygen_xml.py doc/xml/*.xml > ../miral/symbols.map\"""" |
| 340 | + |
| 341 | +debug = False |
| 342 | + |
| 343 | +def get_text(node): |
| 344 | + rc = [] |
| 345 | + for node in node.childNodes: |
| 346 | + if node.nodeType == node.TEXT_NODE: |
| 347 | + rc.append(node.data) |
| 348 | + elif node.nodeType == node.ELEMENT_NODE: |
| 349 | + rc.append(get_text(node)) |
| 350 | + return ''.join(rc) |
| 351 | + |
| 352 | +def get_text_for_element(parent, tagname): |
| 353 | + rc = [] |
| 354 | + nodes = parent.getElementsByTagName(tagname); |
| 355 | + for node in nodes : rc.append(get_text(node)) |
| 356 | + return ''.join(rc) |
| 357 | + |
| 358 | +def get_file_location(node): |
| 359 | + for node in node.childNodes: |
| 360 | + if node.nodeType == node.ELEMENT_NODE and node.tagName == 'location': |
| 361 | + return node.attributes['file'].value |
| 362 | + if debug: print 'no location in:', node |
| 363 | + return None |
| 364 | + |
| 365 | +def has_element(node, tagname): |
| 366 | + for node in node.childNodes: |
| 367 | + if node.nodeType == node.ELEMENT_NODE and node.tagName in tagname: |
| 368 | + return True |
| 369 | + return False |
| 370 | + |
| 371 | +def print_attribs(node, attribs): |
| 372 | + for attrib in attribs : print ' ', attrib, '=', node.attributes[attrib].value |
| 373 | + |
| 374 | +def concat_text_from_tags(parent, tagnames): |
| 375 | + rc = [] |
| 376 | + for tag in tagnames : rc.append(get_text_for_element(parent, tag)) |
| 377 | + return ''.join(rc) |
| 378 | + |
| 379 | +def print_location(node): |
| 380 | + print ' ', 'location', '=', get_file_location(node) |
| 381 | + |
| 382 | +def get_attribs(node): |
| 383 | + kind = node.attributes['kind'].value |
| 384 | + static = node.attributes['static'].value |
| 385 | + prot = node.attributes['prot'].value |
| 386 | + return (kind, static, prot) |
| 387 | + |
| 388 | +# Special cases for publishing anyway: |
| 389 | +publish_special_cases = {} |
| 390 | + |
| 391 | +component_map = {} |
| 392 | +symbols = {'public' : set(), 'private' : set()} |
| 393 | + |
| 394 | +def report(publish, symbol): |
| 395 | + symbol = symbol.replace('~', '?') |
| 396 | + |
| 397 | + if symbol in publish_special_cases: publish = True |
| 398 | + |
| 399 | + if publish: symbols['public'].add(symbol) |
| 400 | + else: symbols['private'].add(symbol) |
| 401 | + |
| 402 | + if not debug: return |
| 403 | + if publish: print ' PUBLISH: {}'.format(symbol) |
| 404 | + else : print 'NOPUBLISH: {}'.format(symbol) |
| 405 | + |
| 406 | +def print_report(): |
| 407 | + print 'MIRAL_0.1 {' |
| 408 | + print 'global:' |
| 409 | + print ' extern "C++" {' |
| 410 | + for symbol in sorted(symbols['public']): print ' {};'.format(symbol) |
| 411 | + print ' };' |
| 412 | + print 'local: *;' |
| 413 | + print '};' |
| 414 | + |
| 415 | +def print_debug_info(node, attributes): |
| 416 | + if not debug: return |
| 417 | |
| 418 | + print_attribs(node, attributes) |
| 419 | + print_location(node) |
| 420 | + |
| 421 | +def find_physical_component(location_file): |
| 422 | + path_elements = location_file.split('/') |
| 423 | + found = False |
| 424 | + for element in path_elements: |
| 425 | + if found: return element |
| 426 | + found = element in ['include', 'src'] |
| 427 | + if debug: print 'no component in:', location_file |
| 428 | + return None |
| 429 | + |
| 430 | +def parse_member_def(context_name, node, is_class): |
| 431 | + (kind, static, prot) = get_attribs(node) |
| 432 | + |
| 433 | + if kind in ['enum', 'typedef']: return |
| 434 | + if has_element(node, ['templateparamlist']): return |
| 435 | + if kind in ['function'] and node.attributes['inline'].value == 'yes': return |
| 436 | + |
| 437 | + name = concat_text_from_tags(node, ['name']) |
| 438 | + if name in ['__attribute__']: |
| 439 | + if debug: print ' ignoring doxygen mis-parsing:', concat_text_from_tags(node, ['argsstring']) |
| 440 | + return |
| 441 | + |
| 442 | + if name.startswith('operator'): name = 'operator' |
| 443 | + if not context_name == None: symbol = context_name + '::' + name |
| 444 | + else: symbol = name |
| 445 | + |
| 446 | + publish = True |
| 447 | + |
| 448 | + is_function = kind == 'function' |
| 449 | + if publish: publish = kind != 'define' |
| 450 | + if publish and is_class: publish = is_function or static == 'yes' |
| 451 | + if publish and prot == 'private': |
| 452 | + if is_function: publish = node.attributes['virt'].value == 'virtual' |
| 453 | + else: publish = False |
| 454 | + |
| 455 | + if publish and has_element(node, ['argsstring']): |
| 456 | + publish = not get_text_for_element(node, 'argsstring').endswith('=0') |
| 457 | + |
| 458 | + if is_function: print_debug_info(node, ['kind', 'prot', 'static', 'virt']) |
| 459 | + else: print_debug_info(node, ['kind', 'prot', 'static']) |
| 460 | + if debug: print ' is_class:', is_class |
| 461 | + report(publish, symbol + '*') |
| 462 | + if is_function and node.attributes['virt'].value == 'virtual': report(publish, |
| 463 | + 'non-virtual?thunk?to?' + symbol + '*') |
| 464 | + |
| 465 | +def parse_compound_defs(xmldoc): |
| 466 | + compounddefs = xmldoc.getElementsByTagName('compounddef') |
| 467 | + for node in compounddefs: |
| 468 | + kind = node.attributes['kind'].value |
| 469 | + |
| 470 | + if kind in ['page', 'file', 'example', 'union']: continue |
| 471 | + |
| 472 | + if kind in ['group']: |
| 473 | + for member in node.getElementsByTagName('memberdef') : |
| 474 | + parse_member_def(None, member, False) |
| 475 | + continue |
| 476 | + |
| 477 | + if kind in ['namespace']: |
| 478 | + symbol = concat_text_from_tags(node, ['compoundname']) |
| 479 | + for member in node.getElementsByTagName('memberdef') : |
| 480 | + parse_member_def(symbol, member, False) |
| 481 | + continue |
| 482 | + |
| 483 | + file = get_file_location(node) |
| 484 | + if debug: print ' from file:', file |
| 485 | + if '/examples/' in file or '/test/' in file or '[generated]' in file or '[STL]' in file: |
| 486 | + continue |
| 487 | + |
| 488 | + if has_element(node, ['templateparamlist']): continue |
| 489 | + |
| 490 | + symbol = concat_text_from_tags(node, ['compoundname']) |
| 491 | + |
| 492 | + publish = True |
| 493 | + |
| 494 | + if publish: |
| 495 | + if kind in ['class', 'struct']: |
| 496 | + prot = node.attributes['prot'].value |
| 497 | + publish = prot != 'private' |
| 498 | + print_debug_info(node, ['kind', 'prot']) |
| 499 | + report(publish, 'vtable?for?' + symbol) |
| 500 | + report(publish, 'typeinfo?for?' + symbol) |
| 501 | + |
| 502 | + if publish: |
| 503 | + for member in node.getElementsByTagName('memberdef') : |
| 504 | + parse_member_def(symbol, member, kind in ['class', 'struct']) |
| 505 | + |
| 506 | +if __name__ == "__main__": |
| 507 | + if len(argv) == 1 or '-h' in argv or '--help' in argv: |
| 508 | + print helptext |
| 509 | + exit() |
| 510 | + |
| 511 | + for arg in argv[1:]: |
| 512 | + try: |
| 513 | + if debug: print 'Processing:', arg |
| 514 | + xmldoc = minidom.parse(arg) |
| 515 | + parse_compound_defs(xmldoc) |
| 516 | + except Exception as error: |
| 517 | + print 'Error:', arg, error |
| 518 | + |
| 519 | + if debug: print 'Processing complete' |
| 520 | + |
| 521 | + print_report() |
| 522 | |
| 523 | === modified file 'test/CMakeLists.txt' |
| 524 | --- test/CMakeLists.txt 2016-08-01 11:48:04 +0000 |
| 525 | +++ test/CMakeLists.txt 2016-08-02 09:11:08 +0000 |
| 526 | @@ -17,6 +17,7 @@ |
| 527 | ${GMOCK_LIBRARY} |
| 528 | ${GMOCK_MAIN_LIBRARY} |
| 529 | miral |
| 530 | + miral-internal |
| 531 | ) |
| 532 | |
| 533 | add_dependencies(miral-test GMock) |

Looks good.