@@ -58,6 +58,17 @@ typedef struct LCUI_WidgetStyle {
5858 int pointer_events ; /**< 事件的处理方式 */
5959} LCUI_WidgetStyle ;
6060
61+ typedef struct LCUI_WidgetActualStyleRec_ {
62+ float x , y ;
63+ LCUI_Rect canvas_box ;
64+ LCUI_Rect border_box ;
65+ LCUI_Rect padding_box ;
66+ LCUI_Rect content_box ;
67+ LCUI_Border border ;
68+ LCUI_BoxShadow shadow ;
69+ LCUI_Background background ;
70+ } LCUI_WidgetActualStyleRec , * LCUI_WidgetActualStyle ;
71+
6172/** 部件任务类型,按照任务的依赖顺序排列 */
6273typedef enum LCUI_WidgetTaskType {
6374 LCUI_WTASK_REFRESH_STYLE , /**< 刷新部件全部样式 */
@@ -116,7 +127,8 @@ typedef void( *LCUI_WidgetFunction )(LCUI_Widget);
116127typedef void ( * LCUI_WidgetResizer )(LCUI_Widget , float * , float * );
117128typedef void ( * LCUI_WidgetAttrSetter )(LCUI_Widget , const char * , const char * );
118129typedef void ( * LCUI_WidgetTextSetter )(LCUI_Widget , const char * );
119- typedef void ( * LCUI_WidgetPainter )(LCUI_Widget , LCUI_PaintContext );
130+ typedef void ( * LCUI_WidgetPainter )(LCUI_Widget , LCUI_PaintContext ,
131+ LCUI_WidgetActualStyle );
120132
121133/** 部件原型数据结构 */
122134typedef struct LCUI_WidgetPrototypeRec_ {
@@ -285,13 +297,21 @@ LCUI_API void Widget_DestroyBackground( LCUI_Widget w );
285297LCUI_API void Widget_UpdateBackground ( LCUI_Widget widget );
286298
287299/** 绘制部件背景 */
288- LCUI_API void Widget_PaintBakcground ( LCUI_Widget w , LCUI_PaintContext paint );
300+ LCUI_API void Widget_PaintBakcground ( LCUI_Widget w , LCUI_PaintContext paint ,
301+ LCUI_WidgetActualStyle style );
302+
303+ /** 计算部件背景样式的实际值 */
304+ LCUI_API void Widget_ComputeBackground ( LCUI_Widget w , LCUI_Background * out );
289305
290306/** 更新部件边框样式 */
291307LCUI_API void Widget_UpdateBorder ( LCUI_Widget w );
292308
309+ /** 计算部件边框样式的实际值 */
310+ LCUI_API void Widget_ComputeBorder ( LCUI_Widget w , LCUI_Border * out );
311+
293312/** 绘制部件边框 */
294- LCUI_API void Widget_PaintBorder ( LCUI_Widget w , LCUI_PaintContext paint );
313+ LCUI_API void Widget_PaintBorder ( LCUI_Widget w , LCUI_PaintContext paint ,
314+ LCUI_WidgetActualStyle style );
295315
296316LCUI_API float Widget_GetGraphWidth ( LCUI_Widget widget );
297317
@@ -312,8 +332,12 @@ LCUI_API float Widget_GetGraphWidth( LCUI_Widget w );
312332/** 更新部件矩形阴影样式 */
313333LCUI_API void Widget_UpdateBoxShadow ( LCUI_Widget w );
314334
335+ /** 计算部件阴影样式的实际值 */
336+ LCUI_API void Widget_ComputeBoxShadow ( LCUI_Widget w , LCUI_BoxShadow * out );
337+
315338/** 绘制部件阴影 */
316- LCUI_API void Widget_PaintBoxShadow ( LCUI_Widget w , LCUI_PaintContext paint );
339+ LCUI_API void Widget_PaintBoxShadow ( LCUI_Widget w , LCUI_PaintContext paint ,
340+ LCUI_WidgetActualStyle style );
317341
318342/** 更新可见性 */
319343LCUI_API void Widget_UpdateVisibility ( LCUI_Widget w );
0 commit comments