awtk/demos/demo_vg_app.c

41 lines
1.0 KiB
C
Raw Normal View History

2018-03-19 07:19:12 +08:00
/**
* File: demo2_app.c
2018-05-15 09:31:58 +08:00
* Author: AWTK Develop Team
2018-03-19 07:19:12 +08:00
* Brief: demo paint
*
2019-01-07 10:58:36 +08:00
* Copyright (c) 2018 - 2019 Guangzhou ZHIYUAN Electronics Co.,Ltd.
2018-03-19 07:19:12 +08:00
*
* 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:
* ================================================================
* 2018-03-18 Li XianJing <xianjimli@hotmail.com> created
*
*/
2018-10-13 18:40:00 +08:00
#include "base/timer.h"
#include "widgets/window.h"
2018-03-19 12:03:19 +08:00
#include "base/image_manager.h"
2018-12-01 11:41:23 +08:00
#include "canvas_widget/canvas_widget.h"
2018-03-19 07:19:12 +08:00
2018-12-07 12:42:54 +08:00
#include "vg_common.inc"
2018-04-25 17:38:51 +08:00
2018-03-19 07:19:12 +08:00
ret_t application_init() {
widget_t* win = window_create(NULL, 0, 0, 0, 0);
2018-12-01 11:41:23 +08:00
widget_t* canvas = canvas_widget_create(win, 0, 0, win->w, win->h);
2018-03-19 07:19:12 +08:00
2018-10-13 18:40:00 +08:00
widget_on(canvas, EVT_PAINT, on_paint_vg, NULL);
2019-07-05 07:13:23 +08:00
// widget_on(canvas, EVT_PAINT, on_paint_vg_simple, NULL);
2019-06-26 09:52:58 +08:00
// widget_on(canvas, EVT_PAINT, on_paint_global_alpha, NULL);
2018-10-13 18:40:00 +08:00
timer_add(on_timer, win, 500);
2018-03-19 07:19:12 +08:00
return RET_OK;
}