awtk/demos/demo_vg_app.c
2019-12-31 19:27:36 -08:00

41 lines
1.0 KiB
C

/**
* File: demo2_app.c
* Author: AWTK Develop Team
* Brief: demo paint
*
* Copyright (c) 2018 - 2020 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:
* ================================================================
* 2018-03-18 Li XianJing <xianjimli@hotmail.com> created
*
*/
#include "base/timer.h"
#include "base/window.h"
#include "base/image_manager.h"
#include "canvas_widget/canvas_widget.h"
#include "vg_common.inc"
ret_t application_init() {
widget_t* win = window_create(NULL, 0, 0, 0, 0);
widget_t* canvas = canvas_widget_create(win, 0, 0, win->w, win->h);
widget_on(canvas, EVT_PAINT, on_paint_vg, NULL);
// widget_on(canvas, EVT_PAINT, on_paint_vg_simple, NULL);
// widget_on(canvas, EVT_PAINT, on_paint_global_alpha, NULL);
timer_add(on_timer, win, 500);
return RET_OK;
}