awtk/demos/demo_desktop.c

55 lines
1.2 KiB
C
Raw Normal View History

2018-08-17 12:01:38 +08:00
/**
* File: demo_main.c
* Author: AWTK Develop Team
* Brief: demo main
*
2019-01-07 10:58:36 +08:00
* Copyright (c) 2018 - 2019 Guangzhou ZHIYUAN Electronics Co.,Ltd.
2018-08-17 12:01:38 +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-02-16 Li XianJing <xianjimli@hotmail.com> created
*
*/
#include "awtk.h"
2018-08-24 07:45:37 +08:00
#include "assets.h"
2019-05-10 07:11:33 +08:00
#include "ext_widgets.h"
2018-08-17 12:01:38 +08:00
ret_t application_init(void) {
2019-05-10 07:11:33 +08:00
tk_ext_widgets_init();
window_open("edit");
2018-08-17 12:01:38 +08:00
return RET_OK;
}
#if defined(WIN32)
#include <windows.h>
int WINAPI WinMain(HINSTANCE hinstance, HINSTANCE hprevinstance, LPSTR lpcmdline, int ncmdshow) {
#else
int main(void) {
#endif
2018-11-08 17:15:26 +08:00
char res_root[MAX_PATH + 1];
char app_root[MAX_PATH + 1];
path_app_root(app_root);
memset(res_root, 0x00, sizeof(res_root));
2018-08-17 12:01:38 +08:00
2018-11-08 17:15:26 +08:00
path_build(res_root, MAX_PATH, app_root, "demos", NULL);
tk_init(800, 480, APP_DESKTOP, "AWTK Demo", res_root);
2019-07-01 17:40:15 +08:00
system_info_set_default_font(system_info(), "default_full");
2018-08-17 12:01:38 +08:00
2018-08-24 07:45:37 +08:00
assets_init();
2018-08-17 12:01:38 +08:00
application_init();
tk_run();
return 0;
}