diff --git a/build/VS2012/LCUI/LCUI.vcxproj b/build/VS2012/LCUI/LCUI.vcxproj index a2e7346a..c343109d 100644 --- a/build/VS2012/LCUI/LCUI.vcxproj +++ b/build/VS2012/LCUI/LCUI.vcxproj @@ -129,6 +129,7 @@ + @@ -191,6 +192,7 @@ + diff --git a/build/VS2012/LCUI/LCUI.vcxproj.filters b/build/VS2012/LCUI/LCUI.vcxproj.filters index b654626f..6233e8c4 100644 --- a/build/VS2012/LCUI/LCUI.vcxproj.filters +++ b/build/VS2012/LCUI/LCUI.vcxproj.filters @@ -243,6 +243,9 @@ 头文件\LCUI + + 头文件\LCUI\draw + @@ -434,6 +437,9 @@ 源文件\gui + + 源文件\draw + diff --git a/include/LCUI/draw.h b/include/LCUI/draw.h index c3559d49..5c5cd3a5 100644 --- a/include/LCUI/draw.h +++ b/include/LCUI/draw.h @@ -54,6 +54,7 @@ LCUI_BEGIN_HEADER #include #include #include +#include LCUI_API int Graph_Rotate(LCUI_Graph *src, int rotate_angle, LCUI_Graph *des); diff --git a/include/LCUI/draw/background.h b/include/LCUI/draw/background.h new file mode 100644 index 00000000..4f37daad --- /dev/null +++ b/include/LCUI/draw/background.h @@ -0,0 +1,74 @@ +/* *************************************************************************** + * background.h -- graph background image draw support. + * + * Copyright (C) 2015 by Liu Chao + * + * This file is part of the LCUI project, and may only be used, modified, and + * distributed under the terms of the GPLv2. + * + * (GPLv2 is abbreviation of GNU General Public License Version 2) + * + * By continuing to use, modify, or distribute this file you indicate that you + * have read the license and understand and accept it fully. + * + * The LCUI project 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 GPL v2 for more details. + * + * You should have received a copy of the GPLv2 along with this file. It is + * usually in the LICENSE.TXT file, If not, see . + * ***************************************************************************/ + +/* **************************************************************************** + * background.h -- 背景图像绘制支持 + * + * 版权所有 (C) 2015 归属于 刘超 + * + * 这个文件是LCUI项目的一部分,并且只可以根据GPLv2许可协议来使用、更改和发布。 + * + * (GPLv2 是 GNU通用公共许可证第二版 的英文缩写) + * + * 继续使用、修改或发布本文件,表明您已经阅读并完全理解和接受这个许可协议。 + * + * LCUI 项目是基于使用目的而加以散布的,但不负任何担保责任,甚至没有适销性或特 + * 定用途的隐含担保,详情请参照GPLv2许可协议。 + * + * 您应已收到附随于本文件的GPLv2许可协议的副本,它通常在LICENSE.TXT文件中,如果 + * 没有,请查看:. + * ***************************************************************************/ + +#ifndef __LCUI_DRAW_BACKGROUND_H__ +#define __LCUI_DRAW_BACKGROUND_H__ + +LCUI_BEGIN_HEADER + +typedef struct LCUI_Background { + LCUI_Graph image; /**< 背景图 */ + LCUI_Color color; /**< 背景色 */ + int clip; /**< 背景图的裁剪方式 */ + int origin; /**< 相对于何种位置进行定位 */ + + struct { + LCUI_BOOL x, y; + } repeat; /**< 背景图是否重复 */ + struct { + LCUI_StyleVar x, y; + } position; /**< 定位方式 */ + struct { + LCUI_StyleVar w, h; + } size; +} LCUI_Background; + +/** 初始化背景绘制参数 */ +LCUI_API void Background_Init( LCUI_Background *bg ); + +/** 在图层上绘制背景 */ +LCUI_API void Graph_DrawBackground( + LCUI_Graph *graph, + LCUI_Background *bg, + LCUI_Rect *area +); + +LCUI_END_HEADER + +#endif \ No newline at end of file diff --git a/src/draw/background.c b/src/draw/background.c new file mode 100644 index 00000000..29df0416 --- /dev/null +++ b/src/draw/background.c @@ -0,0 +1,58 @@ +/* *************************************************************************** + * background.c -- graph background image draw support. + * + * Copyright (C) 2015 by Liu Chao + * + * This file is part of the LCUI project, and may only be used, modified, and + * distributed under the terms of the GPLv2. + * + * (GPLv2 is abbreviation of GNU General Public License Version 2) + * + * By continuing to use, modify, or distribute this file you indicate that you + * have read the license and understand and accept it fully. + * + * The LCUI project 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 GPL v2 for more details. + * + * You should have received a copy of the GPLv2 along with this file. It is + * usually in the LICENSE.TXT file, If not, see . + * ***************************************************************************/ + +/* **************************************************************************** + * background.c -- 背景图像绘制支持 + * + * 版权所有 (C) 2015 归属于 刘超 + * + * 这个文件是LCUI项目的一部分,并且只可以根据GPLv2许可协议来使用、更改和发布。 + * + * (GPLv2 是 GNU通用公共许可证第二版 的英文缩写) + * + * 继续使用、修改或发布本文件,表明您已经阅读并完全理解和接受这个许可协议。 + * + * LCUI 项目是基于使用目的而加以散布的,但不负任何担保责任,甚至没有适销性或特 + * 定用途的隐含担保,详情请参照GPLv2许可协议。 + * + * 您应已收到附随于本文件的GPLv2许可协议的副本,它通常在LICENSE.TXT文件中,如果 + * 没有,请查看:. + * ***************************************************************************/ + +#include +#include +#include + +/** 初始化背景绘制参数 */ +void Background_Init( LCUI_Background *bg ) +{ + +} + +/** 在图层上绘制背景 */ +void Graph_DrawBackground( + LCUI_Graph *graph, + LCUI_Background *bg, + LCUI_Rect *area +) +{ + +}