feat(config): 添加配置窗口边框 API

This commit is contained in:
2026-05-01 19:07:21 +08:00
parent 3a830e864a
commit 1cfa2c4505
10 changed files with 179 additions and 15 deletions

View File

@@ -3,6 +3,7 @@
#include <stddef.h>
#include <stdint.h>
#include "base/color.h"
#include "core/types.h"
typedef enum effect_type_t {

View File

@@ -59,6 +59,7 @@ bool runtime_init(runtime_t *runtime, runtime_init_desc_t *desc) {
runtime->backend = desc->backend;
layout_registry_move(&desc->layouts, &runtime->layouts);
rules_move(&desc->rules, &runtime->rules);
runtime->border = desc->border;
runtime->config_module_handle = desc->config_module_handle;
runtime->binding_table = desc->binding_table;
desc->backend = nullptr;

View File

@@ -1,7 +1,9 @@
#pragma once
#include <stddef.h>
#include <stdint.h>
#include "base/color.h"
#include "core/backend.h"
#include "core/binding.h"
#include "core/command_buffer.h"
@@ -9,6 +11,13 @@
#include "core/plan.h"
#include "core/rules.h"
#include "core/state.h"
#include "core/types.h"
typedef struct border_config_t {
uint32_t width;
color_t normal_color;
color_t focused_color;
} border_config_t;
typedef struct runtime_init_desc_t {
backend_t *backend;
@@ -17,6 +26,7 @@ typedef struct runtime_init_desc_t {
layout_registry_t layouts;
rules_t rules;
border_config_t border;
workspace_desc_t *workspaces;
size_t workspace_count;
void *config_module_handle;
@@ -33,6 +43,7 @@ typedef struct runtime_t {
layout_result_t layout_result;
layout_registry_t layouts;
rules_t rules;
border_config_t border;
backend_t *backend;
void *config_module_handle;
binding_table_t *binding_table;

View File

@@ -27,14 +27,6 @@ typedef struct point_t {
int32_t y;
} point_t;
typedef struct color_t {
uint32_t rgba;
uint32_t argb;
/* RGBA color channels for Cairo, each channel in the range [0, 1] */
double red, green, blue, alpha;
} color_t;
typedef enum window_geometry_mode_t {
ZDWM_GEOMETRY_NORMAL,
ZDWM_GEOMETRY_MAXIMIZED,