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
|
|
|
|
*
|
2020-01-01 11:27:36 +08:00
|
|
|
* Copyright (c) 2018 - 2020 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"
|
2019-08-19 18:43:23 +08:00
|
|
|
#include "base/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);
|
|
|
|
|
|
|
|
timer_add(on_timer, win, 500);
|
2018-03-19 07:19:12 +08:00
|
|
|
|
|
|
|
return RET_OK;
|
|
|
|
}
|
2020-03-19 11:11:32 +08:00
|
|
|
|
|
|
|
ret_t application_exit() {
|
|
|
|
log_debug("application_exit\n");
|
|
|
|
return RET_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
#include "awtk_main.inc"
|