linuxOS_D21X/source/artinchip/awtk-ui/awtk/src/widgets/clip_view.h

95 lines
2.6 KiB
C
Raw Normal View History

2024-11-29 08:23:11 +00:00
/*
* File: clip_view.h
* Author: AWTK Develop Team
* Brief: clip view
*
* Copyright (c) 2018 - 2023 Guangzhou ZHIYUAN Electronics Co.,Ltd.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* License file for more details.
*
*/
/**
* History:
* ================================================================
* 2019-12-12 Lou ZhiMing <louzhiming@zlg.cn> created
*
*/
#ifndef TK_CLIP_VIEW_H
#define TK_CLIP_VIEW_H
#include "base/widget.h"
BEGIN_C_DECLS
/**
* @class clip_view_t
* @parent widget_t
* @annotation ["scriptable","design","widget"]
*
*
* xml更具有可读性
* layout\_children属性指定
* [](https://github.com/zlgopen/awtk/blob/master/docs/layout.md)。
*
* clip\_view\_t是[widget\_t](widget_t.md)widget\_t的函数均适用于clip\_view\_t控件
*
* xml中使用"clip_view"clip_viewclip_view控件下的所有子控件都会被裁剪button控件会被裁剪clip_view控件
*
* ```xml
* <clip_view x="0" y="0" w="100" h="100">
* <button x="50" y="10" w="100" h="50" />
* </clip_view>
* ```
*
* clip_view控件下的所有子控件都会被裁剪scroll_view控件的scroll_view_on_paint_children函数
*
* style来设置控件的显示风格
*
* ```xml
* <style name="default" border_color="#a0a0a0">
* <normal bg_color="#f0f0f0" />
* </style>
* ```
*/
typedef struct _clip_view_t {
widget_t widget;
} clip_view_t;
/**
* @method clip_view_create
* clip_view对象
* @annotation ["constructor", "scriptable"]
* @param {widget_t*} parent
* @param {xy_t} x x坐标
* @param {xy_t} y y坐标
* @param {wh_t} w
* @param {wh_t} h
*
* @return {widget_t*}
*/
widget_t* clip_view_create(widget_t* parent, xy_t x, xy_t y, wh_t w, wh_t h);
/**
* @method clip_view_cast
* clip_view对象(使)
* @annotation ["cast", "scriptable"]
* @param {widget_t*} widget clip_view对象
*
* @return {widget_t*} clip_view对象
*/
widget_t* clip_view_cast(widget_t* widget);
#define WIDGET_TYPE_CLIP_VIEW "clip_view"
#define CLIP_VIEW(widget) ((clip_view_t*)(widget))
END_C_DECLS
#endif /*TK_CLIP_VIEW_H*/