style: 更新 .clang-format 规则并重新格式化所有源文件
- 重构模块使用新的代码风格 - 老代码 (src 目录下的代码) 继续使用之前的代码风格 通过在需要不同代码风格的目录下放对应 .clang-format 配置文件实现
This commit is contained in:
@@ -1,28 +1,45 @@
|
||||
#include <zdwm/config.h>
|
||||
|
||||
static bool fixture_layout(const zdwm_layout_ctx_t *ctx,
|
||||
zdwm_layout_result_t *out) {
|
||||
static bool
|
||||
fixture_layout(const zdwm_layout_ctx_t *ctx, zdwm_layout_result_t *out) {
|
||||
if (!ctx || !out) return false;
|
||||
|
||||
zdwm_layout_result_reset(out);
|
||||
if (!ctx->window_ids || ctx->window_count == 0) return true;
|
||||
|
||||
zdwm_layout_result_push(out, (zdwm_layout_item_t){
|
||||
.window_id = ctx->window_ids[0],
|
||||
.rect = ctx->workarea,
|
||||
});
|
||||
zdwm_layout_result_push(
|
||||
out,
|
||||
(zdwm_layout_item_t){
|
||||
.window_id = ctx->window_ids[0],
|
||||
.rect = ctx->workarea,
|
||||
}
|
||||
);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool setup(const zdwm_api_t *api, zdwm_config_builder_t *builder,
|
||||
const zdwm_output_info_t *outputs, size_t output_count) {
|
||||
bool setup(
|
||||
const zdwm_api_t *api,
|
||||
zdwm_config_builder_t *builder,
|
||||
const zdwm_output_info_t *outputs,
|
||||
size_t output_count
|
||||
) {
|
||||
if (!api || !builder || !outputs || output_count == 0) return false;
|
||||
|
||||
zdwm_layout_id_t layout_id =
|
||||
api->register_layout(builder, "test-only", "[T]", "fixture layout",
|
||||
fixture_layout);
|
||||
zdwm_layout_id_t layout_id = api->register_layout(
|
||||
builder,
|
||||
"test-only",
|
||||
"[T]",
|
||||
"fixture layout",
|
||||
fixture_layout
|
||||
);
|
||||
if (layout_id == ZDWM_LAYOUT_ID_INVALID) return false;
|
||||
|
||||
return api->define_workspace(builder, 0, "from-so", &layout_id, 1,
|
||||
layout_id) != ZDWM_WORKSPACE_ID_INVALID;
|
||||
return api->define_workspace(
|
||||
builder,
|
||||
0,
|
||||
"from-so",
|
||||
&layout_id,
|
||||
1,
|
||||
layout_id
|
||||
) != ZDWM_WORKSPACE_ID_INVALID;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user