From 59d86e71692a62c365446025c0b20a1589e242ea Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Sun, 19 Oct 2025 18:09:34 +0800 Subject: [PATCH] project: merge mmsg meson.build file into mango meson.build --- format.sh | 2 +- meson.build | 34 +++- mmsg/{src => }/arg.h | 0 mmsg/{src => }/dynarr.h | 0 mmsg/meson.build | 33 ---- mmsg/{src => }/mmsg.c | 0 mmsg/protocols/dwl-ipc-unstable-v2.xml | 246 ------------------------- 7 files changed, 32 insertions(+), 283 deletions(-) rename mmsg/{src => }/arg.h (100%) rename mmsg/{src => }/dynarr.h (100%) delete mode 100644 mmsg/meson.build rename mmsg/{src => }/mmsg.c (100%) delete mode 100644 mmsg/protocols/dwl-ipc-unstable-v2.xml diff --git a/format.sh b/format.sh index af4a82a..1291ff8 100644 --- a/format.sh +++ b/format.sh @@ -1,3 +1,3 @@ #!/usr/bin/bash -clang-format -i src/*/*.h -i src/*/*.c -i src/mango.c -i mmsg/src/mmsg.c -i mmsg/src/arg.h -i mmsg/src/dynarr.h +clang-format -i src/*/*.h -i src/*/*.c -i src/mango.c -i mmsg/mmsg.c -i mmsg/arg.h -i mmsg/dynarr.h diff --git a/meson.build b/meson.build index 0d2853a..1204872 100644 --- a/meson.build +++ b/meson.build @@ -3,7 +3,6 @@ project('mango', ['c', 'cpp'], ) subdir('protocols') -subdir('mmsg') is_nixos = false os_release = run_command('cat', '/etc/os-release', check: false) @@ -117,8 +116,37 @@ executable('mango', link_args : link_args, ) +# build mmsg +dwl_ipc_protocol = 'protocols/dwl-ipc-unstable-v2.xml' +dwl_ipc_header = custom_target( + 'dwl-ipc-header', + input: dwl_ipc_protocol, + output: 'dwl-ipc-unstable-v2-protocol.h', + command: [wayland_scanner, 'client-header', '@INPUT@', '@OUTPUT@'], + build_by_default: true, +) +dwl_ipc_source = custom_target( + 'dwl-ipc-source', + input: dwl_ipc_protocol, + output: 'dwl-ipc-unstable-v2-protocol.c', + command: [wayland_scanner, 'private-code', '@INPUT@', '@OUTPUT@'], + build_by_default: true, +) + +executable('mmsg', + 'mmsg/mmsg.c', + dwl_ipc_source, + dependencies: [ + libwayland_client_dep + ], + install: true, + c_args: [ + '-g', + '-Wno-unused-function', + ], +) + + desktop_install_dir = join_paths(prefix, 'share/wayland-sessions') install_data('mango.desktop', install_dir : desktop_install_dir) - -# 安装 config.conf install_data('config.conf', install_dir : join_paths(sysconfdir, 'mango')) diff --git a/mmsg/src/arg.h b/mmsg/arg.h similarity index 100% rename from mmsg/src/arg.h rename to mmsg/arg.h diff --git a/mmsg/src/dynarr.h b/mmsg/dynarr.h similarity index 100% rename from mmsg/src/dynarr.h rename to mmsg/dynarr.h diff --git a/mmsg/meson.build b/mmsg/meson.build deleted file mode 100644 index 6d0b1e8..0000000 --- a/mmsg/meson.build +++ /dev/null @@ -1,33 +0,0 @@ -wayland_scanner = find_program('wayland-scanner') - -dwl_ipc_protocol = 'protocols/dwl-ipc-unstable-v2.xml' - -dwl_ipc_header = custom_target( - 'dwl-ipc-header', - input: dwl_ipc_protocol, - output: 'dwl-ipc-unstable-v2-protocol.h', - command: [wayland_scanner, 'client-header', '@INPUT@', '@OUTPUT@'], - build_by_default: true, -) - -dwl_ipc_source = custom_target( - 'dwl-ipc-source', - input: dwl_ipc_protocol, - output: 'dwl-ipc-unstable-v2-protocol.c', - command: [wayland_scanner, 'private-code', '@INPUT@', '@OUTPUT@'], - build_by_default: true, -) - -executable('mmsg', - 'src/mmsg.c', - dwl_ipc_source, - dependencies: [ - dependency('wayland-client'), - ], - include_directories: include_directories('.'), - install: true, - c_args: [ - '-g', - '-Wno-unused-function', - ], -) \ No newline at end of file diff --git a/mmsg/src/mmsg.c b/mmsg/mmsg.c similarity index 100% rename from mmsg/src/mmsg.c rename to mmsg/mmsg.c diff --git a/mmsg/protocols/dwl-ipc-unstable-v2.xml b/mmsg/protocols/dwl-ipc-unstable-v2.xml deleted file mode 100644 index a43a7f0..0000000 --- a/mmsg/protocols/dwl-ipc-unstable-v2.xml +++ /dev/null @@ -1,246 +0,0 @@ - - - - - This protocol allows clients to update and get updates from dwl. - - Warning! The protocol described in this file is experimental and - backward incompatible changes may be made. Backward compatible - changes may be added together with the corresponding interface - version bump. - Backward incompatible changes are done by bumping the version - number in the protocol and interface names and resetting the - interface version. Once the protocol is to be declared stable, - the 'z' prefix and the version number in the protocol and - interface names are removed and the interface version number is - reset. - - - - - This interface is exposed as a global in wl_registry. - - Clients can use this interface to get a dwl_ipc_output. - After binding the client will recieve the dwl_ipc_manager.tags and dwl_ipc_manager.layout events. - The dwl_ipc_manager.tags and dwl_ipc_manager.layout events expose tags and layouts to the client. - - - - - Indicates that the client will not the dwl_ipc_manager object anymore. - Objects created through this instance are not affected. - - - - - - Get a dwl_ipc_outout for the specified wl_output. - - - - - - - - This event is sent after binding. - A roundtrip after binding guarantees the client recieved all tags. - - - - - - - This event is sent after binding. - A roundtrip after binding guarantees the client recieved all layouts. - - - - - - - - Observe and control a dwl output. - - Events are double-buffered: - Clients should cache events and redraw when a dwl_ipc_output.frame event is sent. - - Request are not double-buffered: - The compositor will update immediately upon request. - - - - - - - - - - - Indicates to that the client no longer needs this dwl_ipc_output. - - - - - - Indicates the client should hide or show themselves. - If the client is visible then hide, if hidden then show. - - - - - - Indicates if the output is active. Zero is invalid, nonzero is valid. - - - - - - - Indicates that a tag has been updated. - - - - - - - - - - Indicates a new layout is selected. - - - - - - - Indicates the title has changed. - - - - - - - Indicates the appid has changed. - - - - - - - Indicates the layout has changed. Since layout symbols are dynamic. - As opposed to the zdwl_ipc_manager.layout event, this should take precendence when displaying. - You can ignore the zdwl_ipc_output.layout event. - - - - - - - Indicates that a sequence of status updates have finished and the client should redraw. - - - - - - - - - - - - The tags are updated as follows: - new_tags = (current_tags AND and_tags) XOR xor_tags - - - - - - - - - - - - This request allows clients to instruct the compositor to quit mango. - - - - - - - - - - - - - - - - Indicates if the selected client on this output is fullscreen. - - - - - - - Indicates if the selected client on this output is floating. - - - - - - - Indicates if x coordinates of the selected client. - - - - - - - Indicates if y coordinates of the selected client. - - - - - - - Indicates if width of the selected client. - - - - - - - Indicates if height of the selected client. - - - - - - - last map layer. - - - - - - - current keyboard layout. - - - - - - - current keybind mode. - - - - - - -