70 lines
1.9 KiB
C
Executable File
70 lines
1.9 KiB
C
Executable File
|
|
#include "PrjCfg.h"
|
|
#include "UIWnd/UIFlow.h"
|
|
#include "AppControl/AppControl.h"
|
|
#include <kwrap/sxcmd.h>
|
|
#include <kwrap/stdio.h>
|
|
#include "kwrap/cmdsys.h"
|
|
|
|
//local debug level: THIS_DBGLVL
|
|
#define THIS_DBGLVL 2 // 0=FATAL, 1=ERR, 2=WRN, 3=UNIT, 4=FUNC, 5=IND, 6=MSG, 7=VALUE, 8=USER
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
#define __MODULE__ UiAppPlayCmd
|
|
#define __DBGLVL__ ((THIS_DBGLVL>=PRJ_DBG_LVL)?THIS_DBGLVL:PRJ_DBG_LVL)
|
|
#define __DBGFLT__ "*" //*=All, [mark]=CustomClass
|
|
#include <kwrap/debug.h>
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
static BOOL cmd_play_test(unsigned char argc, char **argv)
|
|
{
|
|
|
|
DBG_DUMP("play test\r\n");
|
|
|
|
if(argc > 2)
|
|
Ux_SendEvent(&CustomPlayObjCtrl, NVTEVT_EXE_PLAY_ZOOM, 3,
|
|
strtoul(argv[0], NULL, 10), strtoul(argv[1], NULL, 10), strtoul(argv[2], NULL, 10));
|
|
|
|
return TRUE;
|
|
}
|
|
|
|
static SXCMD_BEGIN(uiplay_cmd_tbl, "uiplay_cmd_tbl")
|
|
SXCMD_ITEM("zoom % % %", cmd_play_test, "ratio x_ofs y_ofs")
|
|
SXCMD_END()
|
|
|
|
static int uiplay_cmd_showhelp(int (*dump)(const char *fmt, ...))
|
|
{
|
|
UINT32 cmd_num = SXCMD_NUM(uiplay_cmd_tbl);
|
|
UINT32 loop = 1;
|
|
|
|
dump("---------------------------------------------------------------------\r\n");
|
|
dump(" %s\n", "uiplay");
|
|
dump("---------------------------------------------------------------------\r\n");
|
|
|
|
for (loop = 1 ; loop <= cmd_num ; loop++) {
|
|
dump("%15s : %s\r\n", uiplay_cmd_tbl[loop].p_name, uiplay_cmd_tbl[loop].p_desc);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
MAINFUNC_ENTRY(uiplay, argc, argv)
|
|
{
|
|
UINT32 cmd_num = SXCMD_NUM(uiplay_cmd_tbl);
|
|
UINT32 loop;
|
|
int ret;
|
|
|
|
if (argc < 2) {
|
|
return -1;
|
|
}
|
|
if (strncmp(argv[1], "?", 2) == 0) {
|
|
uiplay_cmd_showhelp(vk_printk);
|
|
return 0;
|
|
}
|
|
for (loop = 1 ; loop <= cmd_num ; loop++) {
|
|
if (strncmp(argv[1], uiplay_cmd_tbl[loop].p_name, strlen(argv[1])) == 0) {
|
|
ret = uiplay_cmd_tbl[loop].p_func(argc-2, &argv[2]);
|
|
return ret;
|
|
}
|
|
}
|
|
return 0;
|
|
}
|