mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-29 17:22:56 +08:00
update to v1.10.3, add lvgl
This commit is contained in:
parent
7eac26873d
commit
2e8a0b8864
@ -1,6 +1,20 @@
|
||||
class TinyObj:...
|
||||
class BaseObj(TinyObj):...
|
||||
class pointer:...
|
||||
class any:...
|
||||
def printNoEnd(val: any):
|
||||
pass
|
||||
class TinyObj:
|
||||
...
|
||||
|
||||
|
||||
class BaseObj(TinyObj):
|
||||
...
|
||||
|
||||
|
||||
class pointer:
|
||||
...
|
||||
|
||||
|
||||
class any:
|
||||
...
|
||||
|
||||
|
||||
def printNoEnd(val: any): ...
|
||||
def abstractmethod(fn): ...
|
||||
def PIKA_C_MACRO_IF(fn): ...
|
||||
def PIKA_C_MACRO_IFDEF(fn): ...
|
||||
|
@ -1,15 +1,21 @@
|
||||
class Tuple:
|
||||
def __init__(self): ...
|
||||
# get an arg by the index
|
||||
def get(self, i: int) -> any: ...
|
||||
# get the length of list
|
||||
def len(self) -> int: ...
|
||||
# support for loop
|
||||
def __iter__(self) -> any: ...
|
||||
# support for loop
|
||||
def __next__(self) -> any: ...
|
||||
# support val = list[]
|
||||
def __getitem__(self, __key: any) -> any: ...
|
||||
|
||||
def get(self, i: int) -> any:
|
||||
"""get an arg by the index"""
|
||||
|
||||
def len(self) -> int:
|
||||
"""get the length of list"""
|
||||
|
||||
def __iter__(self) -> any:
|
||||
"""support for loop"""
|
||||
|
||||
def __next__(self) -> any:
|
||||
"""support for loop"""
|
||||
|
||||
def __getitem__(self, __key: any) -> any:
|
||||
"""support val = list[]"""
|
||||
|
||||
def __del__(self): ...
|
||||
def __str__(self) -> str: ...
|
||||
def __len__(self) -> int: ...
|
||||
@ -17,14 +23,24 @@ class Tuple:
|
||||
|
||||
class List(Tuple):
|
||||
def __init__(self): ...
|
||||
# add an arg after the end of list
|
||||
def append(self, arg: any): ...
|
||||
# set an arg by the index
|
||||
def set(self, i: int, arg: any): ...
|
||||
# support list[] = val
|
||||
def __setitem__(self, __key: any, __val: any): ...
|
||||
|
||||
def append(self, arg: any):
|
||||
"""add an arg after the end of list"""
|
||||
|
||||
def set(self, i: int, arg: any):
|
||||
"""set an arg by the index"""
|
||||
|
||||
def reverse(self):
|
||||
"""reverse the list"""
|
||||
|
||||
def __setitem__(self, __key: any, __val: any):
|
||||
"""support list[] = val"""
|
||||
|
||||
def __str__(self) -> str: ...
|
||||
|
||||
def __add__(self, others: List) -> List:
|
||||
""" support list + list"""
|
||||
|
||||
|
||||
class Dict:
|
||||
def __init__(self): ...
|
||||
@ -67,9 +83,8 @@ class String:
|
||||
def __str__(self) -> str: ...
|
||||
def __len__(self) -> int: ...
|
||||
def encode(self) -> bytes: ...
|
||||
|
||||
def startwith(self, prefix: str) -> int: ...
|
||||
def endwith(self, suffix: str) -> int: ...
|
||||
def startswith(self, prefix: str) -> int: ...
|
||||
def endswith(self, suffix: str) -> int: ...
|
||||
def isdigit(self) -> int: ...
|
||||
def islower(self) -> int: ...
|
||||
def isalnum(self) -> int: ...
|
||||
@ -95,7 +110,7 @@ class ByteArray:
|
||||
|
||||
|
||||
class FILEIO:
|
||||
def init(self, path: str, mode: str): ...
|
||||
def init(self, path: str, mode: str) -> int: ...
|
||||
def read(self, size: int) -> any: ...
|
||||
def write(self, s: any) -> int: ...
|
||||
def close(self): ...
|
||||
|
@ -1,65 +1,117 @@
|
||||
from PikaObj import *
|
||||
|
||||
class MemChecker:
|
||||
def max(self): ...
|
||||
def now(self): ...
|
||||
|
||||
@PIKA_C_MACRO_IF("!PIKA_NANO_ENABLE")
|
||||
def getMax(self) -> float: ...
|
||||
|
||||
@PIKA_C_MACRO_IF("!PIKA_NANO_ENABLE")
|
||||
def getNow(self) -> float: ...
|
||||
|
||||
@PIKA_C_MACRO_IF("!PIKA_NANO_ENABLE")
|
||||
def resetMax(self): ...
|
||||
|
||||
|
||||
class SysObj:
|
||||
@staticmethod
|
||||
def type(arg: any) -> any: ...
|
||||
@staticmethod
|
||||
def remove(argPath: str): ...
|
||||
|
||||
@staticmethod
|
||||
def int(arg: any) -> int: ...
|
||||
|
||||
@staticmethod
|
||||
def float(arg: any) -> float: ...
|
||||
|
||||
@staticmethod
|
||||
def str(arg: any) -> str: ...
|
||||
|
||||
@staticmethod
|
||||
def iter(arg: any) -> any: ...
|
||||
|
||||
@staticmethod
|
||||
def range(a1: int, a2: int) -> any: ...
|
||||
|
||||
@staticmethod
|
||||
def print(*val): ...
|
||||
|
||||
@staticmethod
|
||||
@PIKA_C_MACRO_IF("!PIKA_NANO_ENABLE")
|
||||
def printNoEnd(val: any): ...
|
||||
|
||||
@staticmethod
|
||||
def __setitem__(obj: any, key: any, val: any) -> any: ...
|
||||
|
||||
@staticmethod
|
||||
def __getitem__(obj: any, key: any) -> any: ...
|
||||
|
||||
@staticmethod
|
||||
@PIKA_C_MACRO_IF("PIKA_BUILTIN_STRUCT_ENABLE")
|
||||
def __slice__(obj: any, start: any, end: any, step: int) -> any: ...
|
||||
|
||||
@staticmethod
|
||||
def len(arg: any) -> int: ...
|
||||
|
||||
@staticmethod
|
||||
@PIKA_C_MACRO_IF("PIKA_BUILTIN_STRUCT_ENABLE")
|
||||
def list() -> any: ...
|
||||
|
||||
@staticmethod
|
||||
@PIKA_C_MACRO_IF("PIKA_BUILTIN_STRUCT_ENABLE")
|
||||
def dict() -> any: ...
|
||||
|
||||
@staticmethod
|
||||
@PIKA_C_MACRO_IF("!PIKA_NANO_ENABLE")
|
||||
def hex(val: int) -> str: ...
|
||||
|
||||
@staticmethod
|
||||
@PIKA_C_MACRO_IF("!PIKA_NANO_ENABLE")
|
||||
def ord(val: str) -> int: ...
|
||||
|
||||
@staticmethod
|
||||
@PIKA_C_MACRO_IF("!PIKA_NANO_ENABLE")
|
||||
def chr(val: int) -> str: ...
|
||||
|
||||
@staticmethod
|
||||
@PIKA_C_MACRO_IF("!PIKA_NANO_ENABLE")
|
||||
def bytes(val: any) -> bytes: ...
|
||||
|
||||
@staticmethod
|
||||
@PIKA_C_MACRO_IF("PIKA_SYNTAX_FORMAT_ENABLE")
|
||||
def cformat(fmt: str, *var) -> str: ...
|
||||
|
||||
@staticmethod
|
||||
@PIKA_C_MACRO_IF("!PIKA_NANO_ENABLE")
|
||||
def id(obj: any) -> int: ...
|
||||
|
||||
@staticmethod
|
||||
@PIKA_C_MACRO_IF("PIKA_FILEIO_ENABLE")
|
||||
def open(path: str, mode: str) -> object: ...
|
||||
|
||||
@staticmethod
|
||||
@PIKA_C_MACRO_IF("!PIKA_NANO_ENABLE")
|
||||
def dir(obj: object) -> list: ...
|
||||
|
||||
@staticmethod
|
||||
@PIKA_C_MACRO_IF("PIKA_EXEC_ENABLE")
|
||||
def exec(code: str): ...
|
||||
|
||||
@staticmethod
|
||||
@PIKA_C_MACRO_IF("!PIKA_NANO_ENABLE")
|
||||
def getattr(obj: object, name: str) -> any: ...
|
||||
|
||||
@staticmethod
|
||||
@PIKA_C_MACRO_IF("!PIKA_NANO_ENABLE")
|
||||
def setattr(obj: object, name: str, val: any): ...
|
||||
|
||||
|
||||
@PIKA_C_MACRO_IF("0")
|
||||
class RangeObj:
|
||||
def __next__(self) -> any: ...
|
||||
|
||||
|
||||
@PIKA_C_MACRO_IF("0")
|
||||
class StringObj:
|
||||
def __next__(self) -> any: ...
|
||||
|
||||
|
||||
class PikaObj:
|
||||
...
|
||||
|
@ -16,8 +16,8 @@
|
||||
<repository type="git">https://github.com/pikasTech/pikascript.git</repository>
|
||||
|
||||
<releases>
|
||||
<release date="2022-08-08" version="1.10.0" url="https://gitee.com/Lyon1998/pikascript/attach_files/1151246/download">
|
||||
- PikaScript v1.10.0
|
||||
<release date="@DATE" version="1.10.3" url="https://gitee.com/Lyon1998/pikascript/attach_files/1151246/download">
|
||||
- PikaScript v1.10.3
|
||||
</release>
|
||||
|
||||
</releases>
|
||||
@ -136,54 +136,54 @@
|
||||
-->
|
||||
|
||||
<components>
|
||||
<bundle Cbundle="PikaScript" Cclass="PikaScript" Cversion="1.10.0">
|
||||
<bundle Cbundle="PikaScript" Cclass="PikaScript" Cversion="1.10.3">
|
||||
<description>an ultra-lightweight Python engine</description>
|
||||
<doc>https://pikadoc.readthedocs.io/en/latest/index.html</doc>
|
||||
|
||||
<component Cgroup="PikaScript" Csub="Core" Cversion="1.10.0">
|
||||
<component Cgroup="PikaScript" Csub="Core" Cversion="1.10.3">
|
||||
<description>PikaScript Kernel</description>
|
||||
<files>
|
||||
<!-- kernal begin -->
|
||||
<file attr="config" category="sourceC" name="pikascript-core/BaseObj.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-core/dataArg.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-core/dataArgs.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-core/dataLink.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-core/dataLinkNode.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-core/dataMemory.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-core/dataQueue.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-core/dataQueueObj.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-core/dataStack.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-core/dataString.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-core/dataStrs.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-core/PikaCompiler.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-core/PikaObj.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-core/PikaParser.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-core/PikaPlatform.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-core/PikaVM.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-core/TinyObj.c" />
|
||||
<file attr="config" category="header" name="pikascript-core/BaseObj.h" />
|
||||
<file attr="config" category="header" name="pikascript-core/dataArg.h" />
|
||||
<file attr="config" category="header" name="pikascript-core/dataArgs.h" />
|
||||
<file attr="config" category="header" name="pikascript-core/dataLink.h" />
|
||||
<file attr="config" category="header" name="pikascript-core/dataLinkNode.h" />
|
||||
<file attr="config" category="header" name="pikascript-core/dataMemory.h" />
|
||||
<file attr="config" category="header" name="pikascript-core/dataQueue.h" />
|
||||
<file attr="config" category="header" name="pikascript-core/dataQueueObj.h" />
|
||||
<file attr="config" category="header" name="pikascript-core/dataStack.h" />
|
||||
<file attr="config" category="header" name="pikascript-core/dataString.h" />
|
||||
<file attr="config" category="header" name="pikascript-core/dataStrs.h" />
|
||||
<file attr="config" category="header" name="pikascript-core/PikaCompiler.h" />
|
||||
<file attr="config" category="header" name="pikascript-core/PikaObj.h" />
|
||||
<file attr="config" category="header" name="pikascript-core/PikaParser.h" />
|
||||
<file attr="config" category="header" name="pikascript-core/PikaPlatform.h" />
|
||||
<file attr="config" category="header" name="pikascript-core/PikaVersion.h" />
|
||||
<file attr="config" category="header" name="pikascript-core/PikaVM.h" />
|
||||
<file attr="config" category="header" name="pikascript-core/pika_config_valid.h" />
|
||||
<file attr="config" category="header" name="pikascript-core/TinyObj.h" />
|
||||
<file attr="config" category="header" name="pikascript-core/__instruction_def.h" />
|
||||
<file attr="config" category="header" name="pikascript-core/__pika_ooc.h" />
|
||||
<file attr="config" category="source" name="pikascript-core/__instruction_table.cfg" />
|
||||
<!-- kernal end -->
|
||||
|
||||
<file attr="config" category="sourceC" name="pikascript-core/BaseObj.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-core/dataArg.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-core/dataArgs.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-core/dataLink.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-core/dataLinkNode.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-core/dataMemory.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-core/dataQueue.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-core/dataQueueObj.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-core/dataStack.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-core/dataString.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-core/dataStrs.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-core/PikaCompiler.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-core/PikaObj.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-core/PikaParser.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-core/PikaPlatform.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-core/PikaVM.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-core/TinyObj.c" />
|
||||
<file attr="config" category="header" name="pikascript-core/BaseObj.h" />
|
||||
<file attr="config" category="header" name="pikascript-core/dataArg.h" />
|
||||
<file attr="config" category="header" name="pikascript-core/dataArgs.h" />
|
||||
<file attr="config" category="header" name="pikascript-core/dataLink.h" />
|
||||
<file attr="config" category="header" name="pikascript-core/dataLinkNode.h" />
|
||||
<file attr="config" category="header" name="pikascript-core/dataMemory.h" />
|
||||
<file attr="config" category="header" name="pikascript-core/dataQueue.h" />
|
||||
<file attr="config" category="header" name="pikascript-core/dataQueueObj.h" />
|
||||
<file attr="config" category="header" name="pikascript-core/dataStack.h" />
|
||||
<file attr="config" category="header" name="pikascript-core/dataString.h" />
|
||||
<file attr="config" category="header" name="pikascript-core/dataStrs.h" />
|
||||
<file attr="config" category="header" name="pikascript-core/PikaCompiler.h" />
|
||||
<file attr="config" category="header" name="pikascript-core/PikaObj.h" />
|
||||
<file attr="config" category="header" name="pikascript-core/PikaParser.h" />
|
||||
<file attr="config" category="header" name="pikascript-core/PikaPlatform.h" />
|
||||
<file attr="config" category="header" name="pikascript-core/PikaVersion.h" />
|
||||
<file attr="config" category="header" name="pikascript-core/PikaVM.h" />
|
||||
<file attr="config" category="header" name="pikascript-core/pika_config_valid.h" />
|
||||
<file attr="config" category="header" name="pikascript-core/TinyObj.h" />
|
||||
<file attr="config" category="header" name="pikascript-core/__instruction_def.h" />
|
||||
<file attr="config" category="header" name="pikascript-core/__pika_ooc.h" />
|
||||
<file attr="config" category="source" name="pikascript-core/__instruction_table.cfg" />
|
||||
|
||||
|
||||
<file attr="config" category="header" name="__pika_ooc.h" />
|
||||
<file category="header" name="PLOOC/plooc_class.h" condition="NO_PLOOC_Pack" />
|
||||
@ -207,69 +207,80 @@
|
||||
</RTE_Components_h>
|
||||
</component>
|
||||
|
||||
<component Cgroup="PikaScript" Csub="PikaStdLib" Cversion="1.10.0" condition="Kernel">
|
||||
<component Cgroup="PikaScript" Csub="PikaStdLib" Cversion="1.10.3" condition="Kernel">
|
||||
<description>The standard library for PikaScript</description>
|
||||
<files>
|
||||
<!-- lib begin -->
|
||||
<file attr="config" category="sourceC" name="pikascript-lib/PikaStdLib/PikaDebuger_Debuger.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-lib/PikaStdLib/PikaStdData_ByteArray.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-lib/PikaStdLib/PikaStdData_Dict.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-lib/PikaStdLib/PikaStdData_FILEIO.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-lib/PikaStdLib/PikaStdData_List.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-lib/PikaStdLib/PikaStdData_String.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-lib/PikaStdLib/PikaStdData_Tuple.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-lib/PikaStdLib/PikaStdData_Utils.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-lib/PikaStdLib/PikaStdLib_MemChecker.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-lib/PikaStdLib/PikaStdLib_RangeObj.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-lib/PikaStdLib/PikaStdLib_StringObj.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-lib/PikaStdLib/PikaStdLib_SysObj.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-lib/PikaStdLib/PikaStdTask_Task.c" />
|
||||
<file attr="config" category="header" name="pikascript-lib/PikaStdLib/PikaStdData_String_Util.h" />
|
||||
<file attr="config" category="sourceC" name="pikascript-api/PikaDebug-api.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-api/PikaDebug_Debuger-api.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-api/PikaMain-api.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-api/pikaScript.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-api/PikaStdData-api.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-api/PikaStdData_ByteArray-api.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-api/PikaStdData_Dict-api.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-api/PikaStdData_dict_keys-api.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-api/PikaStdData_FILEIO-api.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-api/PikaStdData_List-api.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-api/PikaStdData_String-api.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-api/PikaStdData_Tuple-api.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-api/PikaStdData_Utils-api.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-api/PikaStdLib-api.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-api/PikaStdLib_MemChecker-api.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-api/PikaStdLib_PikaObj-api.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-api/PikaStdLib_RangeObj-api.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-api/PikaStdLib_StringObj-api.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-api/PikaStdLib_SysObj-api.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-api/PikaStdTask-api.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-api/PikaStdTask_Task-api.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-api/__asset_pikaModules_py_a.c" />
|
||||
<file attr="config" category="header" name="pikascript-api/PikaDebug.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/PikaDebug_Debuger.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/PikaMain.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/pikaScript.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/PikaStdData.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/PikaStdData_ByteArray.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/PikaStdData_Dict.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/PikaStdData_dict_keys.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/PikaStdData_FILEIO.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/PikaStdData_List.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/PikaStdData_String.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/PikaStdData_Tuple.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/PikaStdData_Utils.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/PikaStdLib.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/PikaStdLib_MemChecker.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/PikaStdLib_PikaObj.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/PikaStdLib_RangeObj.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/PikaStdLib_StringObj.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/PikaStdLib_SysObj.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/PikaStdTask.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/PikaStdTask_Task.h" />
|
||||
<file attr="config" category="sourceC" name="pikascript-lib/PikaStdLib/PikaDebuger_Debuger.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-lib/PikaStdLib/PikaStdData_ByteArray.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-lib/PikaStdLib/PikaStdData_Dict.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-lib/PikaStdLib/PikaStdData_FILEIO.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-lib/PikaStdLib/PikaStdData_List.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-lib/PikaStdLib/PikaStdData_String.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-lib/PikaStdLib/PikaStdData_Tuple.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-lib/PikaStdLib/PikaStdData_Utils.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-lib/PikaStdLib/PikaStdLib_MemChecker.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-lib/PikaStdLib/PikaStdLib_RangeObj.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-lib/PikaStdLib/PikaStdLib_StringObj.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-lib/PikaStdLib/PikaStdLib_SysObj.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-lib/PikaStdLib/PikaStdTask_Task.c" />
|
||||
<file attr="config" category="header" name="pikascript-lib/PikaStdLib/PikaStdData_String_Util.h" />
|
||||
<file attr="config" category="sourceC" name="pikascript-api/pikaScript.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-api/__asset_pikaModules_py_a.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-api/__pikaBinding.c" />
|
||||
<file attr="config" category="header" name="pikascript-api/PikaDebug.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/PikaDebug_Debuger.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/PikaMain.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/pikaScript.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/PikaStdData.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/PikaStdData_ByteArray.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/PikaStdData_Dict.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/PikaStdData_dict_keys.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/PikaStdData_FILEIO.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/PikaStdData_List.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/PikaStdData_String.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/PikaStdData_Tuple.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/PikaStdData_Utils.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/PikaStdLib.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/PikaStdLib_MemChecker.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/PikaStdLib_RangeObj.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/PikaStdLib_StringObj.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/PikaStdLib_SysObj.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/PikaStdTask.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/PikaStdTask_Task.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/pika_lvgl.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/pika_lvgl_ALIGN.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/pika_lvgl_ANIM.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/pika_lvgl_arc.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/pika_lvgl_bar.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/pika_lvgl_btn.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/pika_lvgl_checkbox.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/pika_lvgl_dropdown.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/pika_lvgl_EVENT.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/pika_lvgl_indev_t.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/pika_lvgl_label.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/pika_lvgl_lv_color_t.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/pika_lvgl_lv_event.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/pika_lvgl_lv_obj.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/pika_lvgl_lv_timer_t.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/pika_lvgl_OPA.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/pika_lvgl_PALETTE.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/pika_lvgl_point_t.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/pika_lvgl_roller.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/pika_lvgl_slider.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/pika_lvgl_STATE.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/pika_lvgl_style_t.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/pika_lvgl_switch.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/pika_lvgl_table.h" />
|
||||
<file attr="config" category="header" name="pikascript-api/pika_lvgl_textarea.h" />
|
||||
<file attr="config" category="sourceC" name="pikascript-lib/pika_lvgl/pika_lvgl.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-lib/pika_lvgl/pika_lvgl_indev_t.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-lib/pika_lvgl/pika_lvgl_lv_event.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-lib/pika_lvgl/pika_lvgl_lv_obj.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-lib/pika_lvgl/pika_lvgl_lv_style_t.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-lib/pika_lvgl/pika_lv_point_t.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-lib/pika_lvgl/pika_lv_timer_t.c" />
|
||||
<file attr="config" category="sourceC" name="pikascript-lib/pika_lvgl/pika_lv_wegit.c" />
|
||||
|
||||
<!-- lib end -->
|
||||
</files>
|
||||
</component>
|
||||
|
||||
|
187
port/cmsis-pack/pikascript/PikaTech.PikaScript.xml
Normal file
187
port/cmsis-pack/pikascript/PikaTech.PikaScript.xml
Normal file
@ -0,0 +1,187 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<package schemaVersion="1.4" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="PACK.xsd">
|
||||
<vendor>PikaTech</vendor>
|
||||
<name>PikaScript</name>
|
||||
<description>PikaScript is an ultra-lightweight Python engine with zero dependencies and zero-configuration, that can run with 4KB of RAM and 32KB of flash. It's very easy to bind C function to python module with the help of Pika Pre-compiler.Only write the API of python in .pyi and the bindings are autoly generated by Pre-compiler.</description>
|
||||
<url>https://gitee.com/Lyon1998/pikascript/raw/master/port/cmsis-pack/</url>
|
||||
<supportContact>https://github.com/pikasTech/pikascript/issues</supportContact>
|
||||
<license>LICENSE</license>
|
||||
<!-- optional license file -->
|
||||
<!--
|
||||
<license>
|
||||
</license>
|
||||
-->
|
||||
|
||||
<repository type="git">https://github.com/pikasTech/pikascript.git</repository>
|
||||
|
||||
<releases>
|
||||
<release date="@DATE" version="@VERSION" url="https://gitee.com/Lyon1998/pikascript/attach_files/1151246/download">
|
||||
- PikaScript v@VERSION
|
||||
</release>
|
||||
|
||||
</releases>
|
||||
|
||||
<keywords>
|
||||
<!-- keywords for indexing -->
|
||||
<keyword>Python</keyword>
|
||||
<keyword>MCU</keyword>
|
||||
</keywords>
|
||||
|
||||
<conditions>
|
||||
<condition id="Arm Compiler">
|
||||
<description>Arm Compiler 5 (armcc) or Arm Compiler 6 (armclang).</description>
|
||||
<accept Tcompiler="ARMCC" Toptions="AC6" />
|
||||
<accept Tcompiler="ARMCC" Toptions="AC6LTO" />
|
||||
<accept Tcompiler="ARMCC" Toptions="AC5" />
|
||||
</condition>
|
||||
<condition id="Arm GCC">
|
||||
<description>GNU Tools for Arm Embedded Processors.</description>
|
||||
<accept Tcompiler="GCC" />
|
||||
</condition>
|
||||
<condition id="Cortex-M Processors">
|
||||
<description>Support All Cortex-M based processors</description>
|
||||
<accept Dcore="Cortex-M0" />
|
||||
<accept Dcore="Cortex-M0+" />
|
||||
<accept Dcore="Cortex-M1" />
|
||||
<accept Dcore="Cortex-M3" />
|
||||
<accept Dcore="Cortex-M4" />
|
||||
<accept Dcore="Cortex-M7" />
|
||||
<accept Dcore="Cortex-M23" />
|
||||
<accept Dcore="Cortex-M33" />
|
||||
<accept Dcore="Cortex-M35P" />
|
||||
<accept Dcore="Cortex-M55" />
|
||||
<accept Dcore="Cortex-M85" />
|
||||
<accept Dcore="Star-MC1" />
|
||||
<accept Dcore="SC000" />
|
||||
<accept Dcore="SC300" />
|
||||
<accept Dcore="ARMV8MBL" />
|
||||
<accept Dcore="ARMV8MML" />
|
||||
<accept Dcore="ARMV81MML" />
|
||||
</condition>
|
||||
|
||||
<condition id="CMSIS-CORE">
|
||||
<description>Require CMSIS-CORE Support</description>
|
||||
<require Cclass="CMSIS" Cgroup="CORE" />
|
||||
</condition>
|
||||
|
||||
<condition id="Cortex-M Arm GCC">
|
||||
<description>Compile Cortex-M Processors with GNU Tools for Arm Embedded Processors.</description>
|
||||
<require condition="Arm GCC" />
|
||||
<require condition="Cortex-M Processors" />
|
||||
</condition>
|
||||
<condition id="Cortex-M Arm Compiler">
|
||||
<description>Compile Cortex-M Processors with GNU Tools for Arm Embedded Processors.</description>
|
||||
<require condition="Arm Compiler" />
|
||||
<require condition="Cortex-M Processors" />
|
||||
</condition>
|
||||
|
||||
<condition id="Cortex-M Arm GCC CMSIS-CORE">
|
||||
<description>Compile Cortex-M Processors with GNU Tools for Arm Embedded Processors.</description>
|
||||
<require condition="Arm GCC" />
|
||||
<require condition="Cortex-M Processors" />
|
||||
<require condition="CMSIS-CORE" />
|
||||
</condition>
|
||||
<condition id="Cortex-M Arm Compiler CMSIS-CORE">
|
||||
<description>Compile Cortex-M Processors with GNU Tools for Arm Embedded Processors.</description>
|
||||
<require condition="Arm Compiler" />
|
||||
<require condition="Cortex-M Processors" />
|
||||
<require condition="CMSIS-CORE" />
|
||||
</condition>
|
||||
|
||||
<condition id="Kernel">
|
||||
<description>The Kernel of the PikaScript</description>
|
||||
<require Cclass="PikaScript" Cgroup="PikaScript" Csub="Core" Cversion="1.8.6" />
|
||||
</condition>
|
||||
|
||||
<condition id="PLOOC_Pack">
|
||||
<description>The Kernel of the PikaScript</description>
|
||||
<require Cclass="Language Extension" Cgroup="PLOOC" />
|
||||
</condition>
|
||||
|
||||
<condition id="NO_PLOOC_Pack">
|
||||
<description>The Kernel of the PikaScript</description>
|
||||
<deny Cclass="Language Extension" Cgroup="PLOOC" />
|
||||
</condition>
|
||||
|
||||
</conditions>
|
||||
<!-- apis section (optional - for Application Programming Interface descriptions) -->
|
||||
<!--
|
||||
<apis>
|
||||
</apis>
|
||||
-->
|
||||
|
||||
<!-- boards section (mandatory for Board Support Packs) -->
|
||||
<!--
|
||||
<boards>
|
||||
</boards>
|
||||
-->
|
||||
|
||||
<!-- devices section (mandatory for Device Family Packs) -->
|
||||
<!--
|
||||
<devices>
|
||||
</devices>
|
||||
-->
|
||||
|
||||
<!-- examples section (optional for all Software Packs)-->
|
||||
<!--
|
||||
<examples>
|
||||
</examples>
|
||||
-->
|
||||
|
||||
<!-- conditions section (optional for all Software Packs)-->
|
||||
<!--
|
||||
<conditions>
|
||||
</conditions>
|
||||
-->
|
||||
|
||||
<components>
|
||||
<bundle Cbundle="PikaScript" Cclass="PikaScript" Cversion="@VERSION">
|
||||
<description>an ultra-lightweight Python engine</description>
|
||||
<doc>https://pikadoc.readthedocs.io/en/latest/index.html</doc>
|
||||
|
||||
<component Cgroup="PikaScript" Csub="Core" Cversion="@VERSION">
|
||||
<description>PikaScript Kernel</description>
|
||||
<files>
|
||||
|
||||
@KERNAL
|
||||
|
||||
<file attr="config" category="header" name="__pika_ooc.h" />
|
||||
<file category="header" name="PLOOC/plooc_class.h" condition="NO_PLOOC_Pack" />
|
||||
<file category="header" name="PLOOC/plooc.h" condition="NO_PLOOC_Pack" />
|
||||
<file category="header" name="PLOOC/plooc_class_simple.h" condition="NO_PLOOC_Pack" />
|
||||
<file category="header" name="PLOOC/plooc_class_simple_c90.h" condition="NO_PLOOC_Pack" />
|
||||
<file category="header" name="PLOOC/plooc_class_strict.h" condition="NO_PLOOC_Pack" />
|
||||
<file category="header" name="PLOOC/plooc_class_black_box.h" condition="NO_PLOOC_Pack" />
|
||||
|
||||
<file attr="config" category="utility" name="rust-msc-latest-win10.exe" version="1.0.0" />
|
||||
<file attr="config" category="utility" name="pikaPackage.exe" version="1.0.0" />
|
||||
<file attr="config" category="utility" name="pikaBeforBuild-keil.bat" version="1.1.0" />
|
||||
<file attr="config" category="utility" name="clean.bat" version="1.0.1" />
|
||||
<file attr="config" category="source" name="requestment.txt" version="1.1.0" />
|
||||
<file attr="config" category="source" name="main.py" />
|
||||
|
||||
</files>
|
||||
<RTE_Components_h>
|
||||
|
||||
#define RTE_Script_PikaScript
|
||||
</RTE_Components_h>
|
||||
</component>
|
||||
|
||||
<component Cgroup="PikaScript" Csub="PikaStdLib" Cversion="@VERSION" condition="Kernel">
|
||||
<description>The standard library for PikaScript</description>
|
||||
<files>
|
||||
@LIB
|
||||
</files>
|
||||
</component>
|
||||
|
||||
</bundle>
|
||||
</components>
|
||||
|
||||
<!-- optional taxonomy section for defining new component Class and Group names -->
|
||||
<!--
|
||||
<taxonomy>
|
||||
</taxonomy>
|
||||
-->
|
||||
|
||||
</package>
|
1
port/cmsis-pack/pikascript/README.md
Normal file
1
port/cmsis-pack/pikascript/README.md
Normal file
@ -0,0 +1 @@
|
||||
python3 makepdsc.py
|
@ -1,46 +1,50 @@
|
||||
@del "pikascript-api\PikaStdLib_PikaObj-api.c"
|
||||
@del "pikascript-api\PikaStdData.h"
|
||||
@del "pikascript-api\PikaStdTask.h"
|
||||
@del "pikascript-api\PikaStdLib_SysObj.h"
|
||||
@del "pikascript-api\PikaStdTask-api.c"
|
||||
@del "pikascript-api\PikaMain-api.c"
|
||||
@del "pikascript-api\PikaStdLib-api.c"
|
||||
@del "pikascript-api\PikaStdLib_StringObj.h"
|
||||
@del "pikascript-api\PikaStdData_Tuple.h"
|
||||
@del "pikascript-api\PikaStdData_dict_keys-api.c"
|
||||
@del "pikascript-api\PikaStdData_dict_keys.h"
|
||||
@del "pikascript-api\PikaStdData_Dict-api.c"
|
||||
@del "pikascript-api\PikaStdData_Utils.h"
|
||||
@del "pikascript-api\__asset_pikaModules_py_a.c"
|
||||
@del "pikascript-api\PikaStdLib_RangeObj.h"
|
||||
@del "pikascript-api\PikaStdLib_SysObj-api.c"
|
||||
@del "pikascript-api\PikaStdLib_StringObj-api.c"
|
||||
@del "pikascript-api\PikaStdData_FILEIO-api.c"
|
||||
@del "pikascript-api\PikaStdData_Tuple-api.c"
|
||||
@del "pikascript-api\PikaStdLib_PikaObj.h"
|
||||
@del "pikascript-api\PikaStdData_String-api.c"
|
||||
@del "pikascript-api\main.py.o"
|
||||
@del "pikascript-api\PikaStdData_Dict.h"
|
||||
@del "pikascript-api\PikaDebug_Debuger-api.c"
|
||||
@del "pikascript-api\PikaStdData_ByteArray-api.c"
|
||||
@del "pikascript-api\PikaDebug.h"
|
||||
@del "pikascript-api\PikaDebug_Debuger.h"
|
||||
@del "pikascript-api\PikaStdLib_MemChecker-api.c"
|
||||
@del "pikascript-api\PikaMain.h"
|
||||
@del "pikascript-api\pikaScript.h"
|
||||
@del "pikascript-api\PikaStdData_List-api.c"
|
||||
@del "pikascript-api\PikaDebug-api.c"
|
||||
@del "pikascript-api\PikaStdData-api.c"
|
||||
@del "pikascript-api\pikaModules.py.a"
|
||||
@del "pikascript-api\PikaStdLib.h"
|
||||
@del "pikascript-api\PikaStdData_Utils-api.c"
|
||||
@del "pikascript-api\PikaStdData_String.h"
|
||||
@del "pikascript-api\pikaScript.c"
|
||||
@del "pikascript-api\pikaScript.h"
|
||||
@del "pikascript-api\PikaStdData.h"
|
||||
@del "pikascript-api\PikaStdData_ByteArray.h"
|
||||
@del "pikascript-api\PikaStdData_Dict.h"
|
||||
@del "pikascript-api\PikaStdData_dict_keys.h"
|
||||
@del "pikascript-api\PikaStdData_FILEIO.h"
|
||||
@del "pikascript-api\PikaStdData_List.h"
|
||||
@del "pikascript-api\PikaStdData_String.h"
|
||||
@del "pikascript-api\PikaStdData_Tuple.h"
|
||||
@del "pikascript-api\PikaStdData_Utils.h"
|
||||
@del "pikascript-api\PikaStdLib.h"
|
||||
@del "pikascript-api\PikaStdLib_MemChecker.h"
|
||||
@del "pikascript-api\PikaStdLib_RangeObj-api.c"
|
||||
@del "pikascript-api\compiler-info.txt"
|
||||
@del "pikascript-api\PikaStdData_ByteArray.h"
|
||||
@del "pikascript-api\pikaScript.c"
|
||||
@del "pikascript-api\PikaStdLib_RangeObj.h"
|
||||
@del "pikascript-api\PikaStdLib_StringObj.h"
|
||||
@del "pikascript-api\PikaStdLib_SysObj.h"
|
||||
@del "pikascript-api\PikaStdTask.h"
|
||||
@del "pikascript-api\PikaStdTask_Task.h"
|
||||
@del "pikascript-api\PikaDebug.h"
|
||||
@del "pikascript-api\PikaStdTask_Task-api.c"
|
||||
@del "pikascript-api\pika_lvgl.h"
|
||||
@del "pikascript-api\pika_lvgl_ALIGN.h"
|
||||
@del "pikascript-api\pika_lvgl_ANIM.h"
|
||||
@del "pikascript-api\pika_lvgl_arc.h"
|
||||
@del "pikascript-api\pika_lvgl_bar.h"
|
||||
@del "pikascript-api\pika_lvgl_btn.h"
|
||||
@del "pikascript-api\pika_lvgl_checkbox.h"
|
||||
@del "pikascript-api\pika_lvgl_dropdown.h"
|
||||
@del "pikascript-api\pika_lvgl_EVENT.h"
|
||||
@del "pikascript-api\pika_lvgl_indev_t.h"
|
||||
@del "pikascript-api\pika_lvgl_label.h"
|
||||
@del "pikascript-api\pika_lvgl_lv_color_t.h"
|
||||
@del "pikascript-api\pika_lvgl_lv_event.h"
|
||||
@del "pikascript-api\pika_lvgl_lv_obj.h"
|
||||
@del "pikascript-api\pika_lvgl_lv_timer_t.h"
|
||||
@del "pikascript-api\pika_lvgl_OPA.h"
|
||||
@del "pikascript-api\pika_lvgl_PALETTE.h"
|
||||
@del "pikascript-api\pika_lvgl_point_t.h"
|
||||
@del "pikascript-api\pika_lvgl_roller.h"
|
||||
@del "pikascript-api\pika_lvgl_slider.h"
|
||||
@del "pikascript-api\pika_lvgl_STATE.h"
|
||||
@del "pikascript-api\pika_lvgl_style_t.h"
|
||||
@del "pikascript-api\pika_lvgl_switch.h"
|
||||
@del "pikascript-api\pika_lvgl_table.h"
|
||||
@del "pikascript-api\pika_lvgl_textarea.h"
|
||||
@del "pikascript-api\__asset_pikaModules_py_a.c"
|
||||
@del "pikascript-api\__pikaBinding.c"
|
||||
|
@ -1,7 +1,7 @@
|
||||
import os
|
||||
from sys import prefix
|
||||
from xmlrpc.server import list_public_methods
|
||||
|
||||
version = "1.10.3"
|
||||
date = "2022-08-26"
|
||||
|
||||
class Group:
|
||||
path: str
|
||||
@ -54,6 +54,8 @@ kernal_cfg = Group("kernalCfg", "pikascript-core", ".cfg",
|
||||
format=formatcfg)
|
||||
lib_c = Group("libC", "pikascript-lib/PikaStdLib", ".c", format=formatc)
|
||||
lib_h = Group("libH", "pikascript-lib/PikaStdLib", ".h", format=formath)
|
||||
lvgl_c = Group("libC", "pikascript-lib/pika_lvgl", ".c", format=formatc)
|
||||
lvgl_h = Group("libH", "pikascript-lib/pika_lvgl", ".h", format=formath)
|
||||
|
||||
api_c = Group("apiC", "pikascript-api", ".c", format=formatc)
|
||||
api_h = Group("apiH", "pikascript-api", ".h", format=formath)
|
||||
@ -61,5 +63,19 @@ api_h = Group("apiH", "pikascript-api", ".h", format=formath)
|
||||
api_bat = Group("apiBat", "pikascript-api", "", format='@del "%s"', dvd="\\")
|
||||
|
||||
collect("kernal", [kernal_c, kernal_h, kernal_cfg])
|
||||
collect("lib", [lib_c, lib_h, api_c, api_h])
|
||||
collect("lib", [lib_c, lib_h, api_c, api_h, lvgl_c, lvgl_h])
|
||||
collect("clean", [api_bat], subfix=".bat")
|
||||
|
||||
pdsc_xml_str = open('PikaTech.PikaScript.xml', 'r').read()
|
||||
kernal_xml_str = open('kernal.xml', 'r').read()
|
||||
lib_xml_str = open('lib.xml', 'r').read()
|
||||
|
||||
pdsc_gen_str = pdsc_xml_str.replace('@KERNAL', kernal_xml_str).replace('@LIB', lib_xml_str).replace('@VERSION', version)
|
||||
|
||||
with open('PikaTech.PikaScript.pdsc', 'w') as f:
|
||||
f.write(pdsc_gen_str)
|
||||
|
||||
# rm kernal.xml
|
||||
# rm lib.xml
|
||||
os.remove('kernal.xml')
|
||||
os.remove('lib.xml')
|
||||
|
@ -8,6 +8,7 @@
|
||||
@copy /B "pikascript-api\*.*"
|
||||
@copy /B "pikascript-core\*.*"
|
||||
@copy /B "pikascript-lib\PikaStdLib\*.*"
|
||||
@copy /B "pikascript-lib\pika_lvgl\*.*"
|
||||
|
||||
@echo clean up...
|
||||
@clean.bat
|
263
port/cmsis-pack/pikascript/pika_lvgl.pyi
Normal file
263
port/cmsis-pack/pikascript/pika_lvgl.pyi
Normal file
@ -0,0 +1,263 @@
|
||||
from PikaObj import *
|
||||
|
||||
def __init__(): ...
|
||||
|
||||
class EVENT:
|
||||
ALL: int
|
||||
PRESSED: int
|
||||
PRESSING: int
|
||||
PRESS_LOST: int
|
||||
SHORT_CLICKED: int
|
||||
LONG_PRESSED: int
|
||||
LONG_PRESSED_REPEAT: int
|
||||
CLICKED: int
|
||||
RELEASED: int
|
||||
SCROLL_BEGIN: int
|
||||
SCROLL_END: int
|
||||
SCROLL: int
|
||||
GESTURE: int
|
||||
KEY: int
|
||||
FOCUSED: int
|
||||
DEFOCUSED: int
|
||||
LEAVE: int
|
||||
HIT_TEST: int
|
||||
COVER_CHECK: int
|
||||
REFR_EXT_DRAW_SIZE: int
|
||||
DRAW_MAIN_BEGIN: int
|
||||
DRAW_MAIN: int
|
||||
DRAW_MAIN_END: int
|
||||
DRAW_POST_BEGIN: int
|
||||
DRAW_POST: int
|
||||
DRAW_POST_END: int
|
||||
DRAW_PART_BEGIN: int
|
||||
DRAW_PART_END: int
|
||||
VALUE_CHANGED: int
|
||||
INSERT: int
|
||||
REFRESH: int
|
||||
READY: int
|
||||
CANCEL: int
|
||||
DELETE: int
|
||||
CHILD_CHANGED: int
|
||||
CHILD_CREATED: int
|
||||
CHILD_DELETED: int
|
||||
SCREEN_UNLOAD_START: int
|
||||
SCREEN_LOAD_START: int
|
||||
SCREEN_LOADED: int
|
||||
SCREEN_UNLOADED: int
|
||||
SIZE_CHANGED: int
|
||||
STYLE_CHANGED: int
|
||||
LAYOUT_CHANGED: int
|
||||
GET_SELF_SIZE: int
|
||||
PREPROCESS: int
|
||||
def __init__(self): ...
|
||||
|
||||
class ALIGN:
|
||||
DEFAULT: int
|
||||
TOP_LEFT: int
|
||||
TOP_MID: int
|
||||
TOP_RIGHT: int
|
||||
BOTTOM_LEFT: int
|
||||
BOTTOM_MID: int
|
||||
BOTTOM_RIGHT: int
|
||||
LEFT_MID: int
|
||||
RIGHT_MID: int
|
||||
CENTER: int
|
||||
OUT_TOP_LEFT: int
|
||||
OUT_TOP_MID: int
|
||||
OUT_TOP_RIGHT: int
|
||||
OUT_BOTTOM_LEFT: int
|
||||
OUT_BOTTOM_MID: int
|
||||
OUT_BOTTOM_RIGHT: int
|
||||
OUT_LEFT_TOP: int
|
||||
OUT_LEFT_MID: int
|
||||
OUT_LEFT_BOTTOM: int
|
||||
OUT_RIGHT_TOP: int
|
||||
OUT_RIGHT_MID: int
|
||||
OUT_RIGHT_BOTTOM: int
|
||||
def __init__(self): ...
|
||||
|
||||
class PALETTE:
|
||||
RED: int
|
||||
PINK: int
|
||||
PURPLE: int
|
||||
DEEP_PURPLE: int
|
||||
INDIGO: int
|
||||
BLUE: int
|
||||
LIGHT_BLUE: int
|
||||
CYAN: int
|
||||
TEAL: int
|
||||
GREEN: int
|
||||
LIGHT_GREEN: int
|
||||
LIME: int
|
||||
YELLOW: int
|
||||
AMBER: int
|
||||
ORANGE: int
|
||||
DEEP_ORANGE: int
|
||||
BROWN: int
|
||||
BLUE_GREY: int
|
||||
GREY: int
|
||||
NONE: int
|
||||
def __init__(self): ...
|
||||
|
||||
class OPA:
|
||||
TRANSP: int
|
||||
COVER: int
|
||||
def __init__(self): ...
|
||||
|
||||
class ANIM:
|
||||
OFF: int
|
||||
ON: int
|
||||
def __init__(self): ...
|
||||
|
||||
class STATE:
|
||||
def __init__(self): ...
|
||||
|
||||
class lv_event:
|
||||
def get_code(self) -> int: ...
|
||||
def get_target(self) -> lv_obj: ...
|
||||
|
||||
class lv_color_t: ...
|
||||
|
||||
class lv_timer_t:
|
||||
def set_period(period: int): ...
|
||||
def set_cb(cb: any): ...
|
||||
def _del(self): ...
|
||||
|
||||
def palette_lighten(p: int, lvl: int) -> lv_color_t: ...
|
||||
def palette_main(p: int) -> lv_color_t: ...
|
||||
|
||||
class style_t:
|
||||
def __init__(self): ...
|
||||
def init(self): ...
|
||||
def set_radius(self, radius: int): ...
|
||||
def set_bg_opa(self, opa: int): ...
|
||||
def set_bg_color(self, color: lv_color_t): ...
|
||||
def set_outline_width(self, w: int): ...
|
||||
def set_outline_color(self, color: lv_color_t): ...
|
||||
def set_outline_pad(self, pad: int): ...
|
||||
def set_shadow_width(self, w: int): ...
|
||||
def set_shadow_spread(self, s: int): ...
|
||||
def set_shadow_color(self, color: lv_color_t): ...
|
||||
|
||||
class lv_obj:
|
||||
def center(self): ...
|
||||
def set_size(self, size_x: int, size_y: int): ...
|
||||
def align(self, align: int, x_ofs: int, y_ofs: int): ...
|
||||
def set_hight(self, h: int): ...
|
||||
def update_layout(self): ...
|
||||
def set_width(self, w: int): ...
|
||||
def add_state(self, state: int): ...
|
||||
def add_event_cb(self, event_cb: any, filter: int, user_data: pointer): ...
|
||||
def add_style(self, style: style_t, selector: int): ...
|
||||
def get_x(self) -> int: ...
|
||||
def get_y(self) -> int: ...
|
||||
def set_pos(self, x: int, y: int): ...
|
||||
|
||||
class indev_t:
|
||||
def get_vect(self, point: point_t): ...
|
||||
|
||||
def obj(parent: lv_obj) -> lv_obj: ...
|
||||
def indev_get_act() -> indev_t: ...
|
||||
|
||||
class point_t:
|
||||
def __init__(self): ...
|
||||
|
||||
class arc(lv_obj):
|
||||
MODE_NORMAL: int
|
||||
MODE_SYMMETRICAL: int
|
||||
MODE_REVERSE: int
|
||||
def __init__(self, parent: lv_obj): ...
|
||||
def set_start_angle(self, start: int): ...
|
||||
def set_end_angle(self, angle: int): ...
|
||||
def set_angles(self, start: int, end: int): ...
|
||||
def set_bg_start_angle(self, start: int): ...
|
||||
def set_bg_end_angle(self, angle: int): ...
|
||||
def set_bg_angles(self, start: int, end: int): ...
|
||||
def set_rotation(self, rotation: int): ...
|
||||
def set_mode(self, mode: int): ...
|
||||
def set_value(self, value: int): ...
|
||||
def set_range(self, min: int, max: int): ...
|
||||
def set_change_rate(self, rate: int): ...
|
||||
def get_angle_start(self) -> int: ...
|
||||
def get_angle_end(self) -> int: ...
|
||||
def get_bg_angle_start(self) -> int: ...
|
||||
def get_bg_angle_end(self) -> int: ...
|
||||
def get_value(self) -> int: ...
|
||||
def get_min_value(self) -> int: ...
|
||||
def get_max_value(self) -> int: ...
|
||||
def get_mode(self) -> int: ...
|
||||
# def get_rotation(self) -> int: ...
|
||||
|
||||
class bar(lv_obj):
|
||||
def __init__(self, parent: lv_obj): ...
|
||||
def set_value(self, value: int, anim: int): ...
|
||||
def set_start_value(self, start_value: int, anim: int): ...
|
||||
def set_range(self, min: int, max: int): ...
|
||||
def set_mode(self, mode: int): ...
|
||||
def get_value(self) -> int: ...
|
||||
def get_start_value(self) -> int: ...
|
||||
def get_min_value(self) -> int: ...
|
||||
def get_max_value(self) -> int: ...
|
||||
def get_mode(self) -> int: ...
|
||||
|
||||
class btn(lv_obj):
|
||||
def __init__(self, parent: lv_obj): ...
|
||||
|
||||
class checkbox(lv_obj):
|
||||
def __init__(self, parent: lv_obj): ...
|
||||
def set_text(self, txt: str): ...
|
||||
def set_text_static(self, txt: str): ...
|
||||
def get_text(self) -> str: ...
|
||||
|
||||
class dropdown(lv_obj):
|
||||
def __init__(self, parent: lv_obj): ...
|
||||
def set_text(self, txt: str): ...
|
||||
def set_options(self, options: str): ...
|
||||
def add_option(self, option: str, pos:int): ...
|
||||
def clear_options(self): ...
|
||||
def set_selected(self, sel_opt: int): ...
|
||||
def set_dir(self, dir: int): ...
|
||||
def set_symbol(self, symbol: str): ...
|
||||
def set_selected_hightlight(self, en: int): ...
|
||||
# def get_list(self) -> lv_obj: ...
|
||||
def get_text(self) -> str: ...
|
||||
def get_options(self) -> str: ...
|
||||
def get_selected(self) -> int: ...
|
||||
def get_option_cnt(self) -> int: ...
|
||||
def get_selected_str(self) -> str: ...
|
||||
def get_option_index(self, option: str) -> int: ...
|
||||
def get_symbol(self) -> int: ...
|
||||
def get_selected_highlight(self) -> int: ...
|
||||
def get_dir(self) -> int: ...
|
||||
def open(self): ...
|
||||
def close(self): ...
|
||||
def is_open(self) -> int: ...
|
||||
|
||||
class label(lv_obj):
|
||||
def __init__(self, parent: lv_obj): ...
|
||||
def set_text(self, txt: str): ...
|
||||
def set_long_mode(self, mode: int): ...
|
||||
def set_recolor(self, en: int): ...
|
||||
def set_style_text_align(self, value: int, selector: int): ...
|
||||
|
||||
class roller(lv_obj):
|
||||
def __init__(self, parent: lv_obj): ...
|
||||
def set_options(self, options: str, mode: int): ...
|
||||
def set_visible_row_count(self, row_cnt: int): ...
|
||||
|
||||
class slider(lv_obj):
|
||||
def __init__(self, parent: lv_obj): ...
|
||||
|
||||
class switch(lv_obj):
|
||||
def __init__(self, parent: lv_obj): ...
|
||||
|
||||
class table(lv_obj):
|
||||
def __init__(self, parent: lv_obj): ...
|
||||
def set_cell_value(self, row: int, col: int, txt: str): ...
|
||||
|
||||
class textarea(lv_obj):
|
||||
def __init__(self, parent: lv_obj): ...
|
||||
def set_one_line(en: int): ...
|
||||
|
||||
def scr_act() -> lv_obj: ...
|
||||
def timer_create_basic() -> lv_timer_t: ...
|
@ -1,20 +0,0 @@
|
||||
/* ******************************** */
|
||||
/* Warning! Don't modify this file! */
|
||||
/* ******************************** */
|
||||
#include "PikaDebug.h"
|
||||
#include "TinyObj.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "BaseObj.h"
|
||||
|
||||
void PikaDebug_DebugerMethod(PikaObj *self, Args *args){
|
||||
Arg* res = PikaDebug_Debuger(self);
|
||||
method_returnArg(args, res);
|
||||
}
|
||||
|
||||
PikaObj *New_PikaDebug(Args *args){
|
||||
PikaObj *self = New_TinyObj(args);
|
||||
class_defineConstructor(self, "Debuger()->any", PikaDebug_DebugerMethod);
|
||||
return self;
|
||||
}
|
||||
|
@ -1,27 +0,0 @@
|
||||
/* ******************************** */
|
||||
/* Warning! Don't modify this file! */
|
||||
/* ******************************** */
|
||||
#include "PikaDebug_Debuger.h"
|
||||
#include "TinyObj.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "BaseObj.h"
|
||||
|
||||
void PikaDebug_Debuger___init__Method(PikaObj *self, Args *args){
|
||||
PikaDebug_Debuger___init__(self);
|
||||
}
|
||||
|
||||
void PikaDebug_Debuger_set_traceMethod(PikaObj *self, Args *args){
|
||||
PikaDebug_Debuger_set_trace(self);
|
||||
}
|
||||
|
||||
PikaObj *New_PikaDebug_Debuger(Args *args){
|
||||
PikaObj *self = New_TinyObj(args);
|
||||
class_defineMethod(self, "__init__()", PikaDebug_Debuger___init__Method);
|
||||
class_defineMethod(self, "set_trace()", PikaDebug_Debuger_set_traceMethod);
|
||||
return self;
|
||||
}
|
||||
|
||||
Arg *PikaDebug_Debuger(PikaObj *self){
|
||||
return obj_newObjInPackage(New_PikaDebug_Debuger);
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
/* ******************************** */
|
||||
/* Warning! Don't modify this file! */
|
||||
/* ******************************** */
|
||||
#include "PikaMain.h"
|
||||
#include "PikaStdLib_SysObj.h"
|
||||
#include "PikaStdLib.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "BaseObj.h"
|
||||
|
||||
PikaObj *New_PikaMain(Args *args){
|
||||
PikaObj *self = New_PikaStdLib_SysObj(args);
|
||||
obj_newObj(self, "PikaStdLib", "PikaStdLib", New_PikaStdLib);
|
||||
return self;
|
||||
}
|
||||
|
||||
Arg *PikaMain(PikaObj *self){
|
||||
return obj_newObjInPackage(New_PikaMain);
|
||||
}
|
@ -1,62 +0,0 @@
|
||||
/* ******************************** */
|
||||
/* Warning! Don't modify this file! */
|
||||
/* ******************************** */
|
||||
#include "PikaStdData.h"
|
||||
#include "TinyObj.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "BaseObj.h"
|
||||
|
||||
void PikaStdData_ByteArrayMethod(PikaObj *self, Args *args){
|
||||
Arg* res = PikaStdData_ByteArray(self);
|
||||
method_returnArg(args, res);
|
||||
}
|
||||
|
||||
void PikaStdData_DictMethod(PikaObj *self, Args *args){
|
||||
Arg* res = PikaStdData_Dict(self);
|
||||
method_returnArg(args, res);
|
||||
}
|
||||
|
||||
void PikaStdData_FILEIOMethod(PikaObj *self, Args *args){
|
||||
Arg* res = PikaStdData_FILEIO(self);
|
||||
method_returnArg(args, res);
|
||||
}
|
||||
|
||||
void PikaStdData_ListMethod(PikaObj *self, Args *args){
|
||||
Arg* res = PikaStdData_List(self);
|
||||
method_returnArg(args, res);
|
||||
}
|
||||
|
||||
void PikaStdData_StringMethod(PikaObj *self, Args *args){
|
||||
Arg* res = PikaStdData_String(self);
|
||||
method_returnArg(args, res);
|
||||
}
|
||||
|
||||
void PikaStdData_TupleMethod(PikaObj *self, Args *args){
|
||||
Arg* res = PikaStdData_Tuple(self);
|
||||
method_returnArg(args, res);
|
||||
}
|
||||
|
||||
void PikaStdData_UtilsMethod(PikaObj *self, Args *args){
|
||||
Arg* res = PikaStdData_Utils(self);
|
||||
method_returnArg(args, res);
|
||||
}
|
||||
|
||||
void PikaStdData_dict_keysMethod(PikaObj *self, Args *args){
|
||||
Arg* res = PikaStdData_dict_keys(self);
|
||||
method_returnArg(args, res);
|
||||
}
|
||||
|
||||
PikaObj *New_PikaStdData(Args *args){
|
||||
PikaObj *self = New_TinyObj(args);
|
||||
class_defineConstructor(self, "ByteArray()->any", PikaStdData_ByteArrayMethod);
|
||||
class_defineConstructor(self, "Dict()->any", PikaStdData_DictMethod);
|
||||
class_defineConstructor(self, "FILEIO()->any", PikaStdData_FILEIOMethod);
|
||||
class_defineConstructor(self, "List()->any", PikaStdData_ListMethod);
|
||||
class_defineConstructor(self, "String()->any", PikaStdData_StringMethod);
|
||||
class_defineConstructor(self, "Tuple()->any", PikaStdData_TupleMethod);
|
||||
class_defineConstructor(self, "Utils()->any", PikaStdData_UtilsMethod);
|
||||
class_defineConstructor(self, "dict_keys()->any", PikaStdData_dict_keysMethod);
|
||||
return self;
|
||||
}
|
||||
|
@ -1,61 +0,0 @@
|
||||
/* ******************************** */
|
||||
/* Warning! Don't modify this file! */
|
||||
/* ******************************** */
|
||||
#include "PikaStdData_ByteArray.h"
|
||||
#include "TinyObj.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "BaseObj.h"
|
||||
|
||||
void PikaStdData_ByteArray___getitem__Method(PikaObj *self, Args *args){
|
||||
int __key = args_getInt(args, "__key");
|
||||
int res = PikaStdData_ByteArray___getitem__(self, __key);
|
||||
method_returnInt(args, res);
|
||||
}
|
||||
|
||||
void PikaStdData_ByteArray___init__Method(PikaObj *self, Args *args){
|
||||
Arg* bytes = args_getArg(args, "bytes");
|
||||
PikaStdData_ByteArray___init__(self, bytes);
|
||||
}
|
||||
|
||||
void PikaStdData_ByteArray___iter__Method(PikaObj *self, Args *args){
|
||||
Arg* res = PikaStdData_ByteArray___iter__(self);
|
||||
method_returnArg(args, res);
|
||||
}
|
||||
|
||||
void PikaStdData_ByteArray___next__Method(PikaObj *self, Args *args){
|
||||
Arg* res = PikaStdData_ByteArray___next__(self);
|
||||
method_returnArg(args, res);
|
||||
}
|
||||
|
||||
void PikaStdData_ByteArray___setitem__Method(PikaObj *self, Args *args){
|
||||
int __key = args_getInt(args, "__key");
|
||||
int __val = args_getInt(args, "__val");
|
||||
PikaStdData_ByteArray___setitem__(self, __key, __val);
|
||||
}
|
||||
|
||||
void PikaStdData_ByteArray___str__Method(PikaObj *self, Args *args){
|
||||
char* res = PikaStdData_ByteArray___str__(self);
|
||||
method_returnStr(args, res);
|
||||
}
|
||||
|
||||
void PikaStdData_ByteArray_decodeMethod(PikaObj *self, Args *args){
|
||||
char* res = PikaStdData_ByteArray_decode(self);
|
||||
method_returnStr(args, res);
|
||||
}
|
||||
|
||||
PikaObj *New_PikaStdData_ByteArray(Args *args){
|
||||
PikaObj *self = New_TinyObj(args);
|
||||
class_defineMethod(self, "__getitem__(__key:int)->int", PikaStdData_ByteArray___getitem__Method);
|
||||
class_defineMethod(self, "__init__(bytes:any)", PikaStdData_ByteArray___init__Method);
|
||||
class_defineMethod(self, "__iter__()->any", PikaStdData_ByteArray___iter__Method);
|
||||
class_defineMethod(self, "__next__()->any", PikaStdData_ByteArray___next__Method);
|
||||
class_defineMethod(self, "__setitem__(__key:int,__val:int)", PikaStdData_ByteArray___setitem__Method);
|
||||
class_defineMethod(self, "__str__()->str", PikaStdData_ByteArray___str__Method);
|
||||
class_defineMethod(self, "decode()->str", PikaStdData_ByteArray_decodeMethod);
|
||||
return self;
|
||||
}
|
||||
|
||||
Arg *PikaStdData_ByteArray(PikaObj *self){
|
||||
return obj_newObjInPackage(New_PikaStdData_ByteArray);
|
||||
}
|
@ -1,91 +0,0 @@
|
||||
/* ******************************** */
|
||||
/* Warning! Don't modify this file! */
|
||||
/* ******************************** */
|
||||
#include "PikaStdData_Dict.h"
|
||||
#include "TinyObj.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "BaseObj.h"
|
||||
|
||||
void PikaStdData_Dict___del__Method(PikaObj *self, Args *args){
|
||||
PikaStdData_Dict___del__(self);
|
||||
}
|
||||
|
||||
void PikaStdData_Dict___getitem__Method(PikaObj *self, Args *args){
|
||||
Arg* __key = args_getArg(args, "__key");
|
||||
Arg* res = PikaStdData_Dict___getitem__(self, __key);
|
||||
method_returnArg(args, res);
|
||||
}
|
||||
|
||||
void PikaStdData_Dict___init__Method(PikaObj *self, Args *args){
|
||||
PikaStdData_Dict___init__(self);
|
||||
}
|
||||
|
||||
void PikaStdData_Dict___iter__Method(PikaObj *self, Args *args){
|
||||
Arg* res = PikaStdData_Dict___iter__(self);
|
||||
method_returnArg(args, res);
|
||||
}
|
||||
|
||||
void PikaStdData_Dict___len__Method(PikaObj *self, Args *args){
|
||||
int res = PikaStdData_Dict___len__(self);
|
||||
method_returnInt(args, res);
|
||||
}
|
||||
|
||||
void PikaStdData_Dict___next__Method(PikaObj *self, Args *args){
|
||||
Arg* res = PikaStdData_Dict___next__(self);
|
||||
method_returnArg(args, res);
|
||||
}
|
||||
|
||||
void PikaStdData_Dict___setitem__Method(PikaObj *self, Args *args){
|
||||
Arg* __key = args_getArg(args, "__key");
|
||||
Arg* __val = args_getArg(args, "__val");
|
||||
PikaStdData_Dict___setitem__(self, __key, __val);
|
||||
}
|
||||
|
||||
void PikaStdData_Dict___str__Method(PikaObj *self, Args *args){
|
||||
char* res = PikaStdData_Dict___str__(self);
|
||||
method_returnStr(args, res);
|
||||
}
|
||||
|
||||
void PikaStdData_Dict_getMethod(PikaObj *self, Args *args){
|
||||
char* key = args_getStr(args, "key");
|
||||
Arg* res = PikaStdData_Dict_get(self, key);
|
||||
method_returnArg(args, res);
|
||||
}
|
||||
|
||||
void PikaStdData_Dict_keysMethod(PikaObj *self, Args *args){
|
||||
PikaObj* res = PikaStdData_Dict_keys(self);
|
||||
method_returnObj(args, res);
|
||||
}
|
||||
|
||||
void PikaStdData_Dict_removeMethod(PikaObj *self, Args *args){
|
||||
char* key = args_getStr(args, "key");
|
||||
PikaStdData_Dict_remove(self, key);
|
||||
}
|
||||
|
||||
void PikaStdData_Dict_setMethod(PikaObj *self, Args *args){
|
||||
char* key = args_getStr(args, "key");
|
||||
Arg* arg = args_getArg(args, "arg");
|
||||
PikaStdData_Dict_set(self, key, arg);
|
||||
}
|
||||
|
||||
PikaObj *New_PikaStdData_Dict(Args *args){
|
||||
PikaObj *self = New_TinyObj(args);
|
||||
class_defineMethod(self, "__del__()", PikaStdData_Dict___del__Method);
|
||||
class_defineMethod(self, "__getitem__(__key:any)->any", PikaStdData_Dict___getitem__Method);
|
||||
class_defineMethod(self, "__init__()", PikaStdData_Dict___init__Method);
|
||||
class_defineMethod(self, "__iter__()->any", PikaStdData_Dict___iter__Method);
|
||||
class_defineMethod(self, "__len__()->int", PikaStdData_Dict___len__Method);
|
||||
class_defineMethod(self, "__next__()->any", PikaStdData_Dict___next__Method);
|
||||
class_defineMethod(self, "__setitem__(__key:any,__val:any)", PikaStdData_Dict___setitem__Method);
|
||||
class_defineMethod(self, "__str__()->str", PikaStdData_Dict___str__Method);
|
||||
class_defineMethod(self, "get(key:str)->any", PikaStdData_Dict_getMethod);
|
||||
class_defineMethod(self, "keys()->dict_keys", PikaStdData_Dict_keysMethod);
|
||||
class_defineMethod(self, "remove(key:str)", PikaStdData_Dict_removeMethod);
|
||||
class_defineMethod(self, "set(key:str,arg:any)", PikaStdData_Dict_setMethod);
|
||||
return self;
|
||||
}
|
||||
|
||||
Arg *PikaStdData_Dict(PikaObj *self){
|
||||
return obj_newObjInPackage(New_PikaStdData_Dict);
|
||||
}
|
@ -1,75 +0,0 @@
|
||||
/* ******************************** */
|
||||
/* Warning! Don't modify this file! */
|
||||
/* ******************************** */
|
||||
#include "PikaStdData_FILEIO.h"
|
||||
#include "TinyObj.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "BaseObj.h"
|
||||
|
||||
void PikaStdData_FILEIO_closeMethod(PikaObj *self, Args *args){
|
||||
PikaStdData_FILEIO_close(self);
|
||||
}
|
||||
|
||||
void PikaStdData_FILEIO_initMethod(PikaObj *self, Args *args){
|
||||
char* path = args_getStr(args, "path");
|
||||
char* mode = args_getStr(args, "mode");
|
||||
PikaStdData_FILEIO_init(self, path, mode);
|
||||
}
|
||||
|
||||
void PikaStdData_FILEIO_readMethod(PikaObj *self, Args *args){
|
||||
int size = args_getInt(args, "size");
|
||||
Arg* res = PikaStdData_FILEIO_read(self, size);
|
||||
method_returnArg(args, res);
|
||||
}
|
||||
|
||||
void PikaStdData_FILEIO_readlineMethod(PikaObj *self, Args *args){
|
||||
char* res = PikaStdData_FILEIO_readline(self);
|
||||
method_returnStr(args, res);
|
||||
}
|
||||
|
||||
void PikaStdData_FILEIO_readlinesMethod(PikaObj *self, Args *args){
|
||||
PikaObj* res = PikaStdData_FILEIO_readlines(self);
|
||||
method_returnObj(args, res);
|
||||
}
|
||||
|
||||
void PikaStdData_FILEIO_seekMethod(PikaObj *self, Args *args){
|
||||
int offset = args_getInt(args, "offset");
|
||||
PikaTuple* fromwhere = args_getPtr(args, "fromwhere");
|
||||
int res = PikaStdData_FILEIO_seek(self, offset, fromwhere);
|
||||
method_returnInt(args, res);
|
||||
}
|
||||
|
||||
void PikaStdData_FILEIO_tellMethod(PikaObj *self, Args *args){
|
||||
int res = PikaStdData_FILEIO_tell(self);
|
||||
method_returnInt(args, res);
|
||||
}
|
||||
|
||||
void PikaStdData_FILEIO_writeMethod(PikaObj *self, Args *args){
|
||||
Arg* s = args_getArg(args, "s");
|
||||
int res = PikaStdData_FILEIO_write(self, s);
|
||||
method_returnInt(args, res);
|
||||
}
|
||||
|
||||
void PikaStdData_FILEIO_writelinesMethod(PikaObj *self, Args *args){
|
||||
PikaObj* lines = args_getPtr(args, "lines");
|
||||
PikaStdData_FILEIO_writelines(self, lines);
|
||||
}
|
||||
|
||||
PikaObj *New_PikaStdData_FILEIO(Args *args){
|
||||
PikaObj *self = New_TinyObj(args);
|
||||
class_defineMethod(self, "close()", PikaStdData_FILEIO_closeMethod);
|
||||
class_defineMethod(self, "init(path:str,mode:str)", PikaStdData_FILEIO_initMethod);
|
||||
class_defineMethod(self, "read(size:int)->any", PikaStdData_FILEIO_readMethod);
|
||||
class_defineMethod(self, "readline()->str", PikaStdData_FILEIO_readlineMethod);
|
||||
class_defineMethod(self, "readlines()->List", PikaStdData_FILEIO_readlinesMethod);
|
||||
class_defineMethod(self, "seek(offset:int,*fromwhere)->int", PikaStdData_FILEIO_seekMethod);
|
||||
class_defineMethod(self, "tell()->int", PikaStdData_FILEIO_tellMethod);
|
||||
class_defineMethod(self, "write(s:any)->int", PikaStdData_FILEIO_writeMethod);
|
||||
class_defineMethod(self, "writelines(lines:List)", PikaStdData_FILEIO_writelinesMethod);
|
||||
return self;
|
||||
}
|
||||
|
||||
Arg *PikaStdData_FILEIO(PikaObj *self){
|
||||
return obj_newObjInPackage(New_PikaStdData_FILEIO);
|
||||
}
|
@ -10,7 +10,7 @@
|
||||
PikaObj *New_PikaStdData_FILEIO(Args *args);
|
||||
|
||||
void PikaStdData_FILEIO_close(PikaObj *self);
|
||||
void PikaStdData_FILEIO_init(PikaObj *self, char* path, char* mode);
|
||||
int PikaStdData_FILEIO_init(PikaObj *self, char* path, char* mode);
|
||||
Arg* PikaStdData_FILEIO_read(PikaObj *self, int size);
|
||||
char* PikaStdData_FILEIO_readline(PikaObj *self);
|
||||
PikaObj* PikaStdData_FILEIO_readlines(PikaObj *self);
|
||||
|
@ -1,48 +0,0 @@
|
||||
/* ******************************** */
|
||||
/* Warning! Don't modify this file! */
|
||||
/* ******************************** */
|
||||
#include "PikaStdData_List.h"
|
||||
#include "PikaStdData_Tuple.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "BaseObj.h"
|
||||
|
||||
void PikaStdData_List___init__Method(PikaObj *self, Args *args){
|
||||
PikaStdData_List___init__(self);
|
||||
}
|
||||
|
||||
void PikaStdData_List___setitem__Method(PikaObj *self, Args *args){
|
||||
Arg* __key = args_getArg(args, "__key");
|
||||
Arg* __val = args_getArg(args, "__val");
|
||||
PikaStdData_List___setitem__(self, __key, __val);
|
||||
}
|
||||
|
||||
void PikaStdData_List___str__Method(PikaObj *self, Args *args){
|
||||
char* res = PikaStdData_List___str__(self);
|
||||
method_returnStr(args, res);
|
||||
}
|
||||
|
||||
void PikaStdData_List_appendMethod(PikaObj *self, Args *args){
|
||||
Arg* arg = args_getArg(args, "arg");
|
||||
PikaStdData_List_append(self, arg);
|
||||
}
|
||||
|
||||
void PikaStdData_List_setMethod(PikaObj *self, Args *args){
|
||||
int i = args_getInt(args, "i");
|
||||
Arg* arg = args_getArg(args, "arg");
|
||||
PikaStdData_List_set(self, i, arg);
|
||||
}
|
||||
|
||||
PikaObj *New_PikaStdData_List(Args *args){
|
||||
PikaObj *self = New_PikaStdData_Tuple(args);
|
||||
class_defineMethod(self, "__init__()", PikaStdData_List___init__Method);
|
||||
class_defineMethod(self, "__setitem__(__key:any,__val:any)", PikaStdData_List___setitem__Method);
|
||||
class_defineMethod(self, "__str__()->str", PikaStdData_List___str__Method);
|
||||
class_defineMethod(self, "append(arg:any)", PikaStdData_List_appendMethod);
|
||||
class_defineMethod(self, "set(i:int,arg:any)", PikaStdData_List_setMethod);
|
||||
return self;
|
||||
}
|
||||
|
||||
Arg *PikaStdData_List(PikaObj *self){
|
||||
return obj_newObjInPackage(New_PikaStdData_List);
|
||||
}
|
@ -9,10 +9,12 @@
|
||||
|
||||
PikaObj *New_PikaStdData_List(Args *args);
|
||||
|
||||
PikaObj* PikaStdData_List___add__(PikaObj *self, PikaObj* others);
|
||||
void PikaStdData_List___init__(PikaObj *self);
|
||||
void PikaStdData_List___setitem__(PikaObj *self, Arg* __key, Arg* __val);
|
||||
char* PikaStdData_List___str__(PikaObj *self);
|
||||
void PikaStdData_List_append(PikaObj *self, Arg* arg);
|
||||
void PikaStdData_List_reverse(PikaObj *self);
|
||||
void PikaStdData_List_set(PikaObj *self, int i, Arg* arg);
|
||||
|
||||
#endif
|
||||
|
@ -1,144 +0,0 @@
|
||||
/* ******************************** */
|
||||
/* Warning! Don't modify this file! */
|
||||
/* ******************************** */
|
||||
#include "PikaStdData_String.h"
|
||||
#include "TinyObj.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "BaseObj.h"
|
||||
|
||||
void PikaStdData_String___getitem__Method(PikaObj *self, Args *args){
|
||||
Arg* __key = args_getArg(args, "__key");
|
||||
Arg* res = PikaStdData_String___getitem__(self, __key);
|
||||
method_returnArg(args, res);
|
||||
}
|
||||
|
||||
void PikaStdData_String___init__Method(PikaObj *self, Args *args){
|
||||
char* s = args_getStr(args, "s");
|
||||
PikaStdData_String___init__(self, s);
|
||||
}
|
||||
|
||||
void PikaStdData_String___iter__Method(PikaObj *self, Args *args){
|
||||
Arg* res = PikaStdData_String___iter__(self);
|
||||
method_returnArg(args, res);
|
||||
}
|
||||
|
||||
void PikaStdData_String___len__Method(PikaObj *self, Args *args){
|
||||
int res = PikaStdData_String___len__(self);
|
||||
method_returnInt(args, res);
|
||||
}
|
||||
|
||||
void PikaStdData_String___next__Method(PikaObj *self, Args *args){
|
||||
Arg* res = PikaStdData_String___next__(self);
|
||||
method_returnArg(args, res);
|
||||
}
|
||||
|
||||
void PikaStdData_String___setitem__Method(PikaObj *self, Args *args){
|
||||
Arg* __key = args_getArg(args, "__key");
|
||||
Arg* __val = args_getArg(args, "__val");
|
||||
PikaStdData_String___setitem__(self, __key, __val);
|
||||
}
|
||||
|
||||
void PikaStdData_String___str__Method(PikaObj *self, Args *args){
|
||||
char* res = PikaStdData_String___str__(self);
|
||||
method_returnStr(args, res);
|
||||
}
|
||||
|
||||
void PikaStdData_String_encodeMethod(PikaObj *self, Args *args){
|
||||
Arg* res = PikaStdData_String_encode(self);
|
||||
method_returnArg(args, res);
|
||||
}
|
||||
|
||||
void PikaStdData_String_endwithMethod(PikaObj *self, Args *args){
|
||||
char* suffix = args_getStr(args, "suffix");
|
||||
int res = PikaStdData_String_endwith(self, suffix);
|
||||
method_returnInt(args, res);
|
||||
}
|
||||
|
||||
void PikaStdData_String_getMethod(PikaObj *self, Args *args){
|
||||
char* res = PikaStdData_String_get(self);
|
||||
method_returnStr(args, res);
|
||||
}
|
||||
|
||||
void PikaStdData_String_isalnumMethod(PikaObj *self, Args *args){
|
||||
int res = PikaStdData_String_isalnum(self);
|
||||
method_returnInt(args, res);
|
||||
}
|
||||
|
||||
void PikaStdData_String_isalphaMethod(PikaObj *self, Args *args){
|
||||
int res = PikaStdData_String_isalpha(self);
|
||||
method_returnInt(args, res);
|
||||
}
|
||||
|
||||
void PikaStdData_String_isdigitMethod(PikaObj *self, Args *args){
|
||||
int res = PikaStdData_String_isdigit(self);
|
||||
method_returnInt(args, res);
|
||||
}
|
||||
|
||||
void PikaStdData_String_islowerMethod(PikaObj *self, Args *args){
|
||||
int res = PikaStdData_String_islower(self);
|
||||
method_returnInt(args, res);
|
||||
}
|
||||
|
||||
void PikaStdData_String_isspaceMethod(PikaObj *self, Args *args){
|
||||
int res = PikaStdData_String_isspace(self);
|
||||
method_returnInt(args, res);
|
||||
}
|
||||
|
||||
void PikaStdData_String_replaceMethod(PikaObj *self, Args *args){
|
||||
char* old = args_getStr(args, "old");
|
||||
char* new = args_getStr(args, "new");
|
||||
char* res = PikaStdData_String_replace(self, old, new);
|
||||
method_returnStr(args, res);
|
||||
}
|
||||
|
||||
void PikaStdData_String_setMethod(PikaObj *self, Args *args){
|
||||
char* s = args_getStr(args, "s");
|
||||
PikaStdData_String_set(self, s);
|
||||
}
|
||||
|
||||
void PikaStdData_String_splitMethod(PikaObj *self, Args *args){
|
||||
char* s = args_getStr(args, "s");
|
||||
PikaObj* res = PikaStdData_String_split(self, s);
|
||||
method_returnObj(args, res);
|
||||
}
|
||||
|
||||
void PikaStdData_String_startwithMethod(PikaObj *self, Args *args){
|
||||
char* prefix = args_getStr(args, "prefix");
|
||||
int res = PikaStdData_String_startwith(self, prefix);
|
||||
method_returnInt(args, res);
|
||||
}
|
||||
|
||||
void PikaStdData_String_stripMethod(PikaObj *self, Args *args){
|
||||
char* res = PikaStdData_String_strip(self);
|
||||
method_returnStr(args, res);
|
||||
}
|
||||
|
||||
PikaObj *New_PikaStdData_String(Args *args){
|
||||
PikaObj *self = New_TinyObj(args);
|
||||
class_defineMethod(self, "__getitem__(__key:any)->any", PikaStdData_String___getitem__Method);
|
||||
class_defineMethod(self, "__init__(s:str)", PikaStdData_String___init__Method);
|
||||
class_defineMethod(self, "__iter__()->any", PikaStdData_String___iter__Method);
|
||||
class_defineMethod(self, "__len__()->int", PikaStdData_String___len__Method);
|
||||
class_defineMethod(self, "__next__()->any", PikaStdData_String___next__Method);
|
||||
class_defineMethod(self, "__setitem__(__key:any,__val:any)", PikaStdData_String___setitem__Method);
|
||||
class_defineMethod(self, "__str__()->str", PikaStdData_String___str__Method);
|
||||
class_defineMethod(self, "encode()->bytes", PikaStdData_String_encodeMethod);
|
||||
class_defineMethod(self, "endwith(suffix:str)->int", PikaStdData_String_endwithMethod);
|
||||
class_defineMethod(self, "get()->str", PikaStdData_String_getMethod);
|
||||
class_defineMethod(self, "isalnum()->int", PikaStdData_String_isalnumMethod);
|
||||
class_defineMethod(self, "isalpha()->int", PikaStdData_String_isalphaMethod);
|
||||
class_defineMethod(self, "isdigit()->int", PikaStdData_String_isdigitMethod);
|
||||
class_defineMethod(self, "islower()->int", PikaStdData_String_islowerMethod);
|
||||
class_defineMethod(self, "isspace()->int", PikaStdData_String_isspaceMethod);
|
||||
class_defineMethod(self, "replace(old:str,new:str)->str", PikaStdData_String_replaceMethod);
|
||||
class_defineMethod(self, "set(s:str)", PikaStdData_String_setMethod);
|
||||
class_defineMethod(self, "split(s:str)->List", PikaStdData_String_splitMethod);
|
||||
class_defineMethod(self, "startwith(prefix:str)->int", PikaStdData_String_startwithMethod);
|
||||
class_defineMethod(self, "strip()->str", PikaStdData_String_stripMethod);
|
||||
return self;
|
||||
}
|
||||
|
||||
Arg *PikaStdData_String(PikaObj *self){
|
||||
return obj_newObjInPackage(New_PikaStdData_String);
|
||||
}
|
@ -17,7 +17,7 @@ Arg* PikaStdData_String___next__(PikaObj *self);
|
||||
void PikaStdData_String___setitem__(PikaObj *self, Arg* __key, Arg* __val);
|
||||
char* PikaStdData_String___str__(PikaObj *self);
|
||||
Arg* PikaStdData_String_encode(PikaObj *self);
|
||||
int PikaStdData_String_endwith(PikaObj *self, char* suffix);
|
||||
int PikaStdData_String_endswith(PikaObj *self, char* suffix);
|
||||
char* PikaStdData_String_get(PikaObj *self);
|
||||
int PikaStdData_String_isalnum(PikaObj *self);
|
||||
int PikaStdData_String_isalpha(PikaObj *self);
|
||||
@ -27,7 +27,7 @@ int PikaStdData_String_isspace(PikaObj *self);
|
||||
char* PikaStdData_String_replace(PikaObj *self, char* old, char* new);
|
||||
void PikaStdData_String_set(PikaObj *self, char* s);
|
||||
PikaObj* PikaStdData_String_split(PikaObj *self, char* s);
|
||||
int PikaStdData_String_startwith(PikaObj *self, char* prefix);
|
||||
int PikaStdData_String_startswith(PikaObj *self, char* prefix);
|
||||
char* PikaStdData_String_strip(PikaObj *self);
|
||||
|
||||
#endif
|
||||
|
@ -1,71 +0,0 @@
|
||||
/* ******************************** */
|
||||
/* Warning! Don't modify this file! */
|
||||
/* ******************************** */
|
||||
#include "PikaStdData_Tuple.h"
|
||||
#include "TinyObj.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "BaseObj.h"
|
||||
|
||||
void PikaStdData_Tuple___del__Method(PikaObj *self, Args *args){
|
||||
PikaStdData_Tuple___del__(self);
|
||||
}
|
||||
|
||||
void PikaStdData_Tuple___getitem__Method(PikaObj *self, Args *args){
|
||||
Arg* __key = args_getArg(args, "__key");
|
||||
Arg* res = PikaStdData_Tuple___getitem__(self, __key);
|
||||
method_returnArg(args, res);
|
||||
}
|
||||
|
||||
void PikaStdData_Tuple___init__Method(PikaObj *self, Args *args){
|
||||
PikaStdData_Tuple___init__(self);
|
||||
}
|
||||
|
||||
void PikaStdData_Tuple___iter__Method(PikaObj *self, Args *args){
|
||||
Arg* res = PikaStdData_Tuple___iter__(self);
|
||||
method_returnArg(args, res);
|
||||
}
|
||||
|
||||
void PikaStdData_Tuple___len__Method(PikaObj *self, Args *args){
|
||||
int res = PikaStdData_Tuple___len__(self);
|
||||
method_returnInt(args, res);
|
||||
}
|
||||
|
||||
void PikaStdData_Tuple___next__Method(PikaObj *self, Args *args){
|
||||
Arg* res = PikaStdData_Tuple___next__(self);
|
||||
method_returnArg(args, res);
|
||||
}
|
||||
|
||||
void PikaStdData_Tuple___str__Method(PikaObj *self, Args *args){
|
||||
char* res = PikaStdData_Tuple___str__(self);
|
||||
method_returnStr(args, res);
|
||||
}
|
||||
|
||||
void PikaStdData_Tuple_getMethod(PikaObj *self, Args *args){
|
||||
int i = args_getInt(args, "i");
|
||||
Arg* res = PikaStdData_Tuple_get(self, i);
|
||||
method_returnArg(args, res);
|
||||
}
|
||||
|
||||
void PikaStdData_Tuple_lenMethod(PikaObj *self, Args *args){
|
||||
int res = PikaStdData_Tuple_len(self);
|
||||
method_returnInt(args, res);
|
||||
}
|
||||
|
||||
PikaObj *New_PikaStdData_Tuple(Args *args){
|
||||
PikaObj *self = New_TinyObj(args);
|
||||
class_defineMethod(self, "__del__()", PikaStdData_Tuple___del__Method);
|
||||
class_defineMethod(self, "__getitem__(__key:any)->any", PikaStdData_Tuple___getitem__Method);
|
||||
class_defineMethod(self, "__init__()", PikaStdData_Tuple___init__Method);
|
||||
class_defineMethod(self, "__iter__()->any", PikaStdData_Tuple___iter__Method);
|
||||
class_defineMethod(self, "__len__()->int", PikaStdData_Tuple___len__Method);
|
||||
class_defineMethod(self, "__next__()->any", PikaStdData_Tuple___next__Method);
|
||||
class_defineMethod(self, "__str__()->str", PikaStdData_Tuple___str__Method);
|
||||
class_defineMethod(self, "get(i:int)->any", PikaStdData_Tuple_getMethod);
|
||||
class_defineMethod(self, "len()->int", PikaStdData_Tuple_lenMethod);
|
||||
return self;
|
||||
}
|
||||
|
||||
Arg *PikaStdData_Tuple(PikaObj *self){
|
||||
return obj_newObjInPackage(New_PikaStdData_Tuple);
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
/* ******************************** */
|
||||
/* Warning! Don't modify this file! */
|
||||
/* ******************************** */
|
||||
#include "PikaStdData_Utils.h"
|
||||
#include "TinyObj.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "BaseObj.h"
|
||||
|
||||
void PikaStdData_Utils_int_to_bytesMethod(PikaObj *self, Args *args){
|
||||
int val = args_getInt(args, "val");
|
||||
Arg* res = PikaStdData_Utils_int_to_bytes(self, val);
|
||||
method_returnArg(args, res);
|
||||
}
|
||||
|
||||
PikaObj *New_PikaStdData_Utils(Args *args){
|
||||
PikaObj *self = New_TinyObj(args);
|
||||
class_defineMethod(self, "int_to_bytes(val:int)->bytes", PikaStdData_Utils_int_to_bytesMethod);
|
||||
return self;
|
||||
}
|
||||
|
||||
Arg *PikaStdData_Utils(PikaObj *self){
|
||||
return obj_newObjInPackage(New_PikaStdData_Utils);
|
||||
}
|
@ -1,41 +0,0 @@
|
||||
/* ******************************** */
|
||||
/* Warning! Don't modify this file! */
|
||||
/* ******************************** */
|
||||
#include "PikaStdData_dict_keys.h"
|
||||
#include "TinyObj.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "BaseObj.h"
|
||||
|
||||
void PikaStdData_dict_keys___iter__Method(PikaObj *self, Args *args){
|
||||
Arg* res = PikaStdData_dict_keys___iter__(self);
|
||||
method_returnArg(args, res);
|
||||
}
|
||||
|
||||
void PikaStdData_dict_keys___len__Method(PikaObj *self, Args *args){
|
||||
int res = PikaStdData_dict_keys___len__(self);
|
||||
method_returnInt(args, res);
|
||||
}
|
||||
|
||||
void PikaStdData_dict_keys___next__Method(PikaObj *self, Args *args){
|
||||
Arg* res = PikaStdData_dict_keys___next__(self);
|
||||
method_returnArg(args, res);
|
||||
}
|
||||
|
||||
void PikaStdData_dict_keys___str__Method(PikaObj *self, Args *args){
|
||||
char* res = PikaStdData_dict_keys___str__(self);
|
||||
method_returnStr(args, res);
|
||||
}
|
||||
|
||||
PikaObj *New_PikaStdData_dict_keys(Args *args){
|
||||
PikaObj *self = New_TinyObj(args);
|
||||
class_defineMethod(self, "__iter__()->any", PikaStdData_dict_keys___iter__Method);
|
||||
class_defineMethod(self, "__len__()->int", PikaStdData_dict_keys___len__Method);
|
||||
class_defineMethod(self, "__next__()->any", PikaStdData_dict_keys___next__Method);
|
||||
class_defineMethod(self, "__str__()->str", PikaStdData_dict_keys___str__Method);
|
||||
return self;
|
||||
}
|
||||
|
||||
Arg *PikaStdData_dict_keys(PikaObj *self){
|
||||
return obj_newObjInPackage(New_PikaStdData_dict_keys);
|
||||
}
|
@ -1,44 +0,0 @@
|
||||
/* ******************************** */
|
||||
/* Warning! Don't modify this file! */
|
||||
/* ******************************** */
|
||||
#include "PikaStdLib.h"
|
||||
#include "TinyObj.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "BaseObj.h"
|
||||
|
||||
void PikaStdLib_MemCheckerMethod(PikaObj *self, Args *args){
|
||||
Arg* res = PikaStdLib_MemChecker(self);
|
||||
method_returnArg(args, res);
|
||||
}
|
||||
|
||||
void PikaStdLib_PikaObjMethod(PikaObj *self, Args *args){
|
||||
Arg* res = PikaStdLib_PikaObj(self);
|
||||
method_returnArg(args, res);
|
||||
}
|
||||
|
||||
void PikaStdLib_RangeObjMethod(PikaObj *self, Args *args){
|
||||
Arg* res = PikaStdLib_RangeObj(self);
|
||||
method_returnArg(args, res);
|
||||
}
|
||||
|
||||
void PikaStdLib_StringObjMethod(PikaObj *self, Args *args){
|
||||
Arg* res = PikaStdLib_StringObj(self);
|
||||
method_returnArg(args, res);
|
||||
}
|
||||
|
||||
void PikaStdLib_SysObjMethod(PikaObj *self, Args *args){
|
||||
Arg* res = PikaStdLib_SysObj(self);
|
||||
method_returnArg(args, res);
|
||||
}
|
||||
|
||||
PikaObj *New_PikaStdLib(Args *args){
|
||||
PikaObj *self = New_TinyObj(args);
|
||||
class_defineConstructor(self, "MemChecker()->any", PikaStdLib_MemCheckerMethod);
|
||||
class_defineConstructor(self, "PikaObj()->any", PikaStdLib_PikaObjMethod);
|
||||
class_defineConstructor(self, "RangeObj()->any", PikaStdLib_RangeObjMethod);
|
||||
class_defineConstructor(self, "StringObj()->any", PikaStdLib_StringObjMethod);
|
||||
class_defineConstructor(self, "SysObj()->any", PikaStdLib_SysObjMethod);
|
||||
return self;
|
||||
}
|
||||
|
@ -10,7 +10,6 @@
|
||||
PikaObj *New_PikaStdLib(Args *args);
|
||||
|
||||
Arg* PikaStdLib_MemChecker(PikaObj *self);
|
||||
Arg* PikaStdLib_PikaObj(PikaObj *self);
|
||||
Arg* PikaStdLib_RangeObj(PikaObj *self);
|
||||
Arg* PikaStdLib_StringObj(PikaObj *self);
|
||||
Arg* PikaStdLib_SysObj(PikaObj *self);
|
||||
|
@ -1,44 +0,0 @@
|
||||
/* ******************************** */
|
||||
/* Warning! Don't modify this file! */
|
||||
/* ******************************** */
|
||||
#include "PikaStdLib_MemChecker.h"
|
||||
#include "TinyObj.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "BaseObj.h"
|
||||
|
||||
void PikaStdLib_MemChecker_getMaxMethod(PikaObj *self, Args *args){
|
||||
double res = PikaStdLib_MemChecker_getMax(self);
|
||||
method_returnFloat(args, res);
|
||||
}
|
||||
|
||||
void PikaStdLib_MemChecker_getNowMethod(PikaObj *self, Args *args){
|
||||
double res = PikaStdLib_MemChecker_getNow(self);
|
||||
method_returnFloat(args, res);
|
||||
}
|
||||
|
||||
void PikaStdLib_MemChecker_maxMethod(PikaObj *self, Args *args){
|
||||
PikaStdLib_MemChecker_max(self);
|
||||
}
|
||||
|
||||
void PikaStdLib_MemChecker_nowMethod(PikaObj *self, Args *args){
|
||||
PikaStdLib_MemChecker_now(self);
|
||||
}
|
||||
|
||||
void PikaStdLib_MemChecker_resetMaxMethod(PikaObj *self, Args *args){
|
||||
PikaStdLib_MemChecker_resetMax(self);
|
||||
}
|
||||
|
||||
PikaObj *New_PikaStdLib_MemChecker(Args *args){
|
||||
PikaObj *self = New_TinyObj(args);
|
||||
class_defineMethod(self, "getMax()->float", PikaStdLib_MemChecker_getMaxMethod);
|
||||
class_defineMethod(self, "getNow()->float", PikaStdLib_MemChecker_getNowMethod);
|
||||
class_defineMethod(self, "max()", PikaStdLib_MemChecker_maxMethod);
|
||||
class_defineMethod(self, "now()", PikaStdLib_MemChecker_nowMethod);
|
||||
class_defineMethod(self, "resetMax()", PikaStdLib_MemChecker_resetMaxMethod);
|
||||
return self;
|
||||
}
|
||||
|
||||
Arg *PikaStdLib_MemChecker(PikaObj *self){
|
||||
return obj_newObjInPackage(New_PikaStdLib_MemChecker);
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
/* ******************************** */
|
||||
/* Warning! Don't modify this file! */
|
||||
/* ******************************** */
|
||||
#include "PikaStdLib_PikaObj.h"
|
||||
#include "TinyObj.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "BaseObj.h"
|
||||
|
||||
PikaObj *New_PikaStdLib_PikaObj(Args *args){
|
||||
PikaObj *self = New_TinyObj(args);
|
||||
return self;
|
||||
}
|
||||
|
||||
Arg *PikaStdLib_PikaObj(PikaObj *self){
|
||||
return obj_newObjInPackage(New_PikaStdLib_PikaObj);
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
/* ******************************** */
|
||||
/* Warning! Don't modify this file! */
|
||||
/* ******************************** */
|
||||
#include "PikaStdLib_RangeObj.h"
|
||||
#include "TinyObj.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "BaseObj.h"
|
||||
|
||||
void PikaStdLib_RangeObj___next__Method(PikaObj *self, Args *args){
|
||||
Arg* res = PikaStdLib_RangeObj___next__(self);
|
||||
method_returnArg(args, res);
|
||||
}
|
||||
|
||||
PikaObj *New_PikaStdLib_RangeObj(Args *args){
|
||||
PikaObj *self = New_TinyObj(args);
|
||||
class_defineMethod(self, "__next__()->any", PikaStdLib_RangeObj___next__Method);
|
||||
return self;
|
||||
}
|
||||
|
||||
Arg *PikaStdLib_RangeObj(PikaObj *self){
|
||||
return obj_newObjInPackage(New_PikaStdLib_RangeObj);
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
/* ******************************** */
|
||||
/* Warning! Don't modify this file! */
|
||||
/* ******************************** */
|
||||
#include "PikaStdLib_StringObj.h"
|
||||
#include "TinyObj.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "BaseObj.h"
|
||||
|
||||
void PikaStdLib_StringObj___next__Method(PikaObj *self, Args *args){
|
||||
Arg* res = PikaStdLib_StringObj___next__(self);
|
||||
method_returnArg(args, res);
|
||||
}
|
||||
|
||||
PikaObj *New_PikaStdLib_StringObj(Args *args){
|
||||
PikaObj *self = New_TinyObj(args);
|
||||
class_defineMethod(self, "__next__()->any", PikaStdLib_StringObj___next__Method);
|
||||
return self;
|
||||
}
|
||||
|
||||
Arg *PikaStdLib_StringObj(PikaObj *self){
|
||||
return obj_newObjInPackage(New_PikaStdLib_StringObj);
|
||||
}
|
@ -1,175 +0,0 @@
|
||||
/* ******************************** */
|
||||
/* Warning! Don't modify this file! */
|
||||
/* ******************************** */
|
||||
#include "PikaStdLib_SysObj.h"
|
||||
#include "TinyObj.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "BaseObj.h"
|
||||
|
||||
void PikaStdLib_SysObj___getitem__Method(PikaObj *self, Args *args){
|
||||
Arg* obj = args_getArg(args, "obj");
|
||||
Arg* key = args_getArg(args, "key");
|
||||
Arg* res = PikaStdLib_SysObj___getitem__(self, obj, key);
|
||||
method_returnArg(args, res);
|
||||
}
|
||||
|
||||
void PikaStdLib_SysObj___setitem__Method(PikaObj *self, Args *args){
|
||||
Arg* obj = args_getArg(args, "obj");
|
||||
Arg* key = args_getArg(args, "key");
|
||||
Arg* val = args_getArg(args, "val");
|
||||
Arg* res = PikaStdLib_SysObj___setitem__(self, obj, key, val);
|
||||
method_returnArg(args, res);
|
||||
}
|
||||
|
||||
void PikaStdLib_SysObj___slice__Method(PikaObj *self, Args *args){
|
||||
Arg* obj = args_getArg(args, "obj");
|
||||
Arg* start = args_getArg(args, "start");
|
||||
Arg* end = args_getArg(args, "end");
|
||||
int step = args_getInt(args, "step");
|
||||
Arg* res = PikaStdLib_SysObj___slice__(self, obj, start, end, step);
|
||||
method_returnArg(args, res);
|
||||
}
|
||||
|
||||
void PikaStdLib_SysObj_bytesMethod(PikaObj *self, Args *args){
|
||||
Arg* val = args_getArg(args, "val");
|
||||
Arg* res = PikaStdLib_SysObj_bytes(self, val);
|
||||
method_returnArg(args, res);
|
||||
}
|
||||
|
||||
void PikaStdLib_SysObj_cformatMethod(PikaObj *self, Args *args){
|
||||
char* fmt = args_getStr(args, "fmt");
|
||||
PikaTuple* var = args_getPtr(args, "var");
|
||||
char* res = PikaStdLib_SysObj_cformat(self, fmt, var);
|
||||
method_returnStr(args, res);
|
||||
}
|
||||
|
||||
void PikaStdLib_SysObj_chrMethod(PikaObj *self, Args *args){
|
||||
int val = args_getInt(args, "val");
|
||||
char* res = PikaStdLib_SysObj_chr(self, val);
|
||||
method_returnStr(args, res);
|
||||
}
|
||||
|
||||
void PikaStdLib_SysObj_dictMethod(PikaObj *self, Args *args){
|
||||
Arg* res = PikaStdLib_SysObj_dict(self);
|
||||
method_returnArg(args, res);
|
||||
}
|
||||
|
||||
void PikaStdLib_SysObj_floatMethod(PikaObj *self, Args *args){
|
||||
Arg* arg = args_getArg(args, "arg");
|
||||
double res = PikaStdLib_SysObj_float(self, arg);
|
||||
method_returnFloat(args, res);
|
||||
}
|
||||
|
||||
void PikaStdLib_SysObj_hexMethod(PikaObj *self, Args *args){
|
||||
int val = args_getInt(args, "val");
|
||||
char* res = PikaStdLib_SysObj_hex(self, val);
|
||||
method_returnStr(args, res);
|
||||
}
|
||||
|
||||
void PikaStdLib_SysObj_idMethod(PikaObj *self, Args *args){
|
||||
Arg* obj = args_getArg(args, "obj");
|
||||
int res = PikaStdLib_SysObj_id(self, obj);
|
||||
method_returnInt(args, res);
|
||||
}
|
||||
|
||||
void PikaStdLib_SysObj_intMethod(PikaObj *self, Args *args){
|
||||
Arg* arg = args_getArg(args, "arg");
|
||||
int res = PikaStdLib_SysObj_int(self, arg);
|
||||
method_returnInt(args, res);
|
||||
}
|
||||
|
||||
void PikaStdLib_SysObj_iterMethod(PikaObj *self, Args *args){
|
||||
Arg* arg = args_getArg(args, "arg");
|
||||
Arg* res = PikaStdLib_SysObj_iter(self, arg);
|
||||
method_returnArg(args, res);
|
||||
}
|
||||
|
||||
void PikaStdLib_SysObj_lenMethod(PikaObj *self, Args *args){
|
||||
Arg* arg = args_getArg(args, "arg");
|
||||
int res = PikaStdLib_SysObj_len(self, arg);
|
||||
method_returnInt(args, res);
|
||||
}
|
||||
|
||||
void PikaStdLib_SysObj_listMethod(PikaObj *self, Args *args){
|
||||
Arg* res = PikaStdLib_SysObj_list(self);
|
||||
method_returnArg(args, res);
|
||||
}
|
||||
|
||||
void PikaStdLib_SysObj_openMethod(PikaObj *self, Args *args){
|
||||
char* path = args_getStr(args, "path");
|
||||
char* mode = args_getStr(args, "mode");
|
||||
PikaObj* res = PikaStdLib_SysObj_open(self, path, mode);
|
||||
method_returnObj(args, res);
|
||||
}
|
||||
|
||||
void PikaStdLib_SysObj_ordMethod(PikaObj *self, Args *args){
|
||||
char* val = args_getStr(args, "val");
|
||||
int res = PikaStdLib_SysObj_ord(self, val);
|
||||
method_returnInt(args, res);
|
||||
}
|
||||
|
||||
void PikaStdLib_SysObj_printMethod(PikaObj *self, Args *args){
|
||||
PikaTuple* val = args_getPtr(args, "val");
|
||||
PikaStdLib_SysObj_print(self, val);
|
||||
}
|
||||
|
||||
void PikaStdLib_SysObj_printNoEndMethod(PikaObj *self, Args *args){
|
||||
Arg* val = args_getArg(args, "val");
|
||||
PikaStdLib_SysObj_printNoEnd(self, val);
|
||||
}
|
||||
|
||||
void PikaStdLib_SysObj_rangeMethod(PikaObj *self, Args *args){
|
||||
int a1 = args_getInt(args, "a1");
|
||||
int a2 = args_getInt(args, "a2");
|
||||
Arg* res = PikaStdLib_SysObj_range(self, a1, a2);
|
||||
method_returnArg(args, res);
|
||||
}
|
||||
|
||||
void PikaStdLib_SysObj_removeMethod(PikaObj *self, Args *args){
|
||||
char* argPath = args_getStr(args, "argPath");
|
||||
PikaStdLib_SysObj_remove(self, argPath);
|
||||
}
|
||||
|
||||
void PikaStdLib_SysObj_strMethod(PikaObj *self, Args *args){
|
||||
Arg* arg = args_getArg(args, "arg");
|
||||
char* res = PikaStdLib_SysObj_str(self, arg);
|
||||
method_returnStr(args, res);
|
||||
}
|
||||
|
||||
void PikaStdLib_SysObj_typeMethod(PikaObj *self, Args *args){
|
||||
Arg* arg = args_getArg(args, "arg");
|
||||
Arg* res = PikaStdLib_SysObj_type(self, arg);
|
||||
method_returnArg(args, res);
|
||||
}
|
||||
|
||||
PikaObj *New_PikaStdLib_SysObj(Args *args){
|
||||
PikaObj *self = New_TinyObj(args);
|
||||
class_defineMethod(self, "__getitem__(obj:any,key:any)->any", PikaStdLib_SysObj___getitem__Method);
|
||||
class_defineMethod(self, "__setitem__(obj:any,key:any,val:any)->any", PikaStdLib_SysObj___setitem__Method);
|
||||
class_defineMethod(self, "__slice__(obj:any,start:any,end:any,step:int)->any", PikaStdLib_SysObj___slice__Method);
|
||||
class_defineMethod(self, "bytes(val:any)->bytes", PikaStdLib_SysObj_bytesMethod);
|
||||
class_defineMethod(self, "cformat(fmt:str,*var)->str", PikaStdLib_SysObj_cformatMethod);
|
||||
class_defineMethod(self, "chr(val:int)->str", PikaStdLib_SysObj_chrMethod);
|
||||
class_defineMethod(self, "dict()->any", PikaStdLib_SysObj_dictMethod);
|
||||
class_defineMethod(self, "float(arg:any)->float", PikaStdLib_SysObj_floatMethod);
|
||||
class_defineMethod(self, "hex(val:int)->str", PikaStdLib_SysObj_hexMethod);
|
||||
class_defineMethod(self, "id(obj:any)->int", PikaStdLib_SysObj_idMethod);
|
||||
class_defineMethod(self, "int(arg:any)->int", PikaStdLib_SysObj_intMethod);
|
||||
class_defineMethod(self, "iter(arg:any)->any", PikaStdLib_SysObj_iterMethod);
|
||||
class_defineMethod(self, "len(arg:any)->int", PikaStdLib_SysObj_lenMethod);
|
||||
class_defineMethod(self, "list()->any", PikaStdLib_SysObj_listMethod);
|
||||
class_defineMethod(self, "open(path:str,mode:str)->object", PikaStdLib_SysObj_openMethod);
|
||||
class_defineMethod(self, "ord(val:str)->int", PikaStdLib_SysObj_ordMethod);
|
||||
class_defineMethod(self, "print(*val)", PikaStdLib_SysObj_printMethod);
|
||||
class_defineMethod(self, "printNoEnd(val:any)", PikaStdLib_SysObj_printNoEndMethod);
|
||||
class_defineMethod(self, "range(a1:int,a2:int)->any", PikaStdLib_SysObj_rangeMethod);
|
||||
class_defineMethod(self, "remove(argPath:str)", PikaStdLib_SysObj_removeMethod);
|
||||
class_defineMethod(self, "str(arg:any)->str", PikaStdLib_SysObj_strMethod);
|
||||
class_defineMethod(self, "type(arg:any)->any", PikaStdLib_SysObj_typeMethod);
|
||||
return self;
|
||||
}
|
||||
|
||||
Arg *PikaStdLib_SysObj(PikaObj *self){
|
||||
return obj_newObjInPackage(New_PikaStdLib_SysObj);
|
||||
}
|
@ -16,7 +16,10 @@ Arg* PikaStdLib_SysObj_bytes(PikaObj *self, Arg* val);
|
||||
char* PikaStdLib_SysObj_cformat(PikaObj *self, char* fmt, PikaTuple* var);
|
||||
char* PikaStdLib_SysObj_chr(PikaObj *self, int val);
|
||||
Arg* PikaStdLib_SysObj_dict(PikaObj *self);
|
||||
PikaObj* PikaStdLib_SysObj_dir(PikaObj *self, PikaObj* obj);
|
||||
void PikaStdLib_SysObj_exec(PikaObj *self, char* code);
|
||||
double PikaStdLib_SysObj_float(PikaObj *self, Arg* arg);
|
||||
Arg* PikaStdLib_SysObj_getattr(PikaObj *self, PikaObj* obj, char* name);
|
||||
char* PikaStdLib_SysObj_hex(PikaObj *self, int val);
|
||||
int PikaStdLib_SysObj_id(PikaObj *self, Arg* obj);
|
||||
int PikaStdLib_SysObj_int(PikaObj *self, Arg* arg);
|
||||
@ -28,7 +31,7 @@ int PikaStdLib_SysObj_ord(PikaObj *self, char* val);
|
||||
void PikaStdLib_SysObj_print(PikaObj *self, PikaTuple* val);
|
||||
void PikaStdLib_SysObj_printNoEnd(PikaObj *self, Arg* val);
|
||||
Arg* PikaStdLib_SysObj_range(PikaObj *self, int a1, int a2);
|
||||
void PikaStdLib_SysObj_remove(PikaObj *self, char* argPath);
|
||||
void PikaStdLib_SysObj_setattr(PikaObj *self, PikaObj* obj, char* name, Arg* val);
|
||||
char* PikaStdLib_SysObj_str(PikaObj *self, Arg* arg);
|
||||
Arg* PikaStdLib_SysObj_type(PikaObj *self, Arg* arg);
|
||||
|
||||
|
@ -1,20 +0,0 @@
|
||||
/* ******************************** */
|
||||
/* Warning! Don't modify this file! */
|
||||
/* ******************************** */
|
||||
#include "PikaStdTask.h"
|
||||
#include "TinyObj.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "BaseObj.h"
|
||||
|
||||
void PikaStdTask_TaskMethod(PikaObj *self, Args *args){
|
||||
Arg* res = PikaStdTask_Task(self);
|
||||
method_returnArg(args, res);
|
||||
}
|
||||
|
||||
PikaObj *New_PikaStdTask(Args *args){
|
||||
PikaObj *self = New_TinyObj(args);
|
||||
class_defineConstructor(self, "Task()->any", PikaStdTask_TaskMethod);
|
||||
return self;
|
||||
}
|
||||
|
@ -1,65 +0,0 @@
|
||||
/* ******************************** */
|
||||
/* Warning! Don't modify this file! */
|
||||
/* ******************************** */
|
||||
#include "PikaStdTask_Task.h"
|
||||
#include "PikaStdLib_SysObj.h"
|
||||
#include "PikaStdData_List.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "BaseObj.h"
|
||||
|
||||
void PikaStdTask_Task___init__Method(PikaObj *self, Args *args){
|
||||
PikaStdTask_Task___init__(self);
|
||||
}
|
||||
|
||||
void PikaStdTask_Task_call_alwaysMethod(PikaObj *self, Args *args){
|
||||
Arg* fun_todo = args_getArg(args, "fun_todo");
|
||||
PikaStdTask_Task_call_always(self, fun_todo);
|
||||
}
|
||||
|
||||
void PikaStdTask_Task_call_period_msMethod(PikaObj *self, Args *args){
|
||||
Arg* fun_todo = args_getArg(args, "fun_todo");
|
||||
int period_ms = args_getInt(args, "period_ms");
|
||||
PikaStdTask_Task_call_period_ms(self, fun_todo, period_ms);
|
||||
}
|
||||
|
||||
void PikaStdTask_Task_call_whenMethod(PikaObj *self, Args *args){
|
||||
Arg* fun_todo = args_getArg(args, "fun_todo");
|
||||
Arg* fun_when = args_getArg(args, "fun_when");
|
||||
PikaStdTask_Task_call_when(self, fun_todo, fun_when);
|
||||
}
|
||||
|
||||
void PikaStdTask_Task_platformGetTickMethod(PikaObj *self, Args *args){
|
||||
PikaStdTask_Task_platformGetTick(self);
|
||||
}
|
||||
|
||||
void PikaStdTask_Task_run_foreverMethod(PikaObj *self, Args *args){
|
||||
PikaStdTask_Task_run_forever(self);
|
||||
}
|
||||
|
||||
void PikaStdTask_Task_run_onceMethod(PikaObj *self, Args *args){
|
||||
PikaStdTask_Task_run_once(self);
|
||||
}
|
||||
|
||||
void PikaStdTask_Task_run_until_msMethod(PikaObj *self, Args *args){
|
||||
int until_ms = args_getInt(args, "until_ms");
|
||||
PikaStdTask_Task_run_until_ms(self, until_ms);
|
||||
}
|
||||
|
||||
PikaObj *New_PikaStdTask_Task(Args *args){
|
||||
PikaObj *self = New_PikaStdLib_SysObj(args);
|
||||
obj_newObj(self, "calls", "PikaStdData_List", New_PikaStdData_List);
|
||||
class_defineMethod(self, "__init__()", PikaStdTask_Task___init__Method);
|
||||
class_defineMethod(self, "call_always(fun_todo:any)", PikaStdTask_Task_call_alwaysMethod);
|
||||
class_defineMethod(self, "call_period_ms(fun_todo:any,period_ms:int)", PikaStdTask_Task_call_period_msMethod);
|
||||
class_defineMethod(self, "call_when(fun_todo:any,fun_when:any)", PikaStdTask_Task_call_whenMethod);
|
||||
class_defineMethod(self, "platformGetTick()", PikaStdTask_Task_platformGetTickMethod);
|
||||
class_defineMethod(self, "run_forever()", PikaStdTask_Task_run_foreverMethod);
|
||||
class_defineMethod(self, "run_once()", PikaStdTask_Task_run_onceMethod);
|
||||
class_defineMethod(self, "run_until_ms(until_ms:int)", PikaStdTask_Task_run_until_msMethod);
|
||||
return self;
|
||||
}
|
||||
|
||||
Arg *PikaStdTask_Task(PikaObj *self){
|
||||
return obj_newObjInPackage(New_PikaStdTask_Task);
|
||||
}
|
2097
port/cmsis-pack/pikascript/pikascript-api/__pikaBinding.c
Normal file
2097
port/cmsis-pack/pikascript/pikascript-api/__pikaBinding.c
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@ -9,7 +9,8 @@ PikaObj *__pikaMain;
|
||||
PikaObj *pikaScriptInit(void){
|
||||
__platform_printf("======[pikascript packages installed]======\r\n");
|
||||
pks_printVersion();
|
||||
__platform_printf("PikaStdLib==v1.10.0\r\n");
|
||||
__platform_printf("PikaStdLib==v1.10.3\r\n");
|
||||
__platform_printf("pika_lvgl==v0.2.0\r\n");
|
||||
__platform_printf("===========================================\r\n");
|
||||
__pikaMain = newRootObj("pikaMain", New_PikaMain);
|
||||
extern unsigned char pikaModules_py_a[];
|
||||
|
44
port/cmsis-pack/pikascript/pikascript-api/pika_lvgl.h
Normal file
44
port/cmsis-pack/pikascript/pikascript-api/pika_lvgl.h
Normal file
@ -0,0 +1,44 @@
|
||||
/* ******************************** */
|
||||
/* Warning! Don't modify this file! */
|
||||
/* ******************************** */
|
||||
#ifndef __pika_lvgl__H
|
||||
#define __pika_lvgl__H
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "PikaObj.h"
|
||||
|
||||
PikaObj *New_pika_lvgl(Args *args);
|
||||
|
||||
Arg* pika_lvgl_ALIGN(PikaObj *self);
|
||||
Arg* pika_lvgl_ANIM(PikaObj *self);
|
||||
Arg* pika_lvgl_EVENT(PikaObj *self);
|
||||
Arg* pika_lvgl_OPA(PikaObj *self);
|
||||
Arg* pika_lvgl_PALETTE(PikaObj *self);
|
||||
Arg* pika_lvgl_STATE(PikaObj *self);
|
||||
void pika_lvgl___init__(PikaObj *self);
|
||||
Arg* pika_lvgl_arc(PikaObj *self);
|
||||
Arg* pika_lvgl_bar(PikaObj *self);
|
||||
Arg* pika_lvgl_btn(PikaObj *self);
|
||||
Arg* pika_lvgl_checkbox(PikaObj *self);
|
||||
Arg* pika_lvgl_dropdown(PikaObj *self);
|
||||
PikaObj* pika_lvgl_indev_get_act(PikaObj *self);
|
||||
Arg* pika_lvgl_indev_t(PikaObj *self);
|
||||
Arg* pika_lvgl_label(PikaObj *self);
|
||||
Arg* pika_lvgl_lv_color_t(PikaObj *self);
|
||||
Arg* pika_lvgl_lv_event(PikaObj *self);
|
||||
Arg* pika_lvgl_lv_obj(PikaObj *self);
|
||||
Arg* pika_lvgl_lv_timer_t(PikaObj *self);
|
||||
PikaObj* pika_lvgl_obj(PikaObj *self, PikaObj* parent);
|
||||
PikaObj* pika_lvgl_palette_lighten(PikaObj *self, int p, int lvl);
|
||||
PikaObj* pika_lvgl_palette_main(PikaObj *self, int p);
|
||||
Arg* pika_lvgl_point_t(PikaObj *self);
|
||||
Arg* pika_lvgl_roller(PikaObj *self);
|
||||
PikaObj* pika_lvgl_scr_act(PikaObj *self);
|
||||
Arg* pika_lvgl_slider(PikaObj *self);
|
||||
Arg* pika_lvgl_style_t(PikaObj *self);
|
||||
Arg* pika_lvgl_switch(PikaObj *self);
|
||||
Arg* pika_lvgl_table(PikaObj *self);
|
||||
Arg* pika_lvgl_textarea(PikaObj *self);
|
||||
PikaObj* pika_lvgl_timer_create_basic(PikaObj *self);
|
||||
|
||||
#endif
|
14
port/cmsis-pack/pikascript/pikascript-api/pika_lvgl_ALIGN.h
Normal file
14
port/cmsis-pack/pikascript/pikascript-api/pika_lvgl_ALIGN.h
Normal file
@ -0,0 +1,14 @@
|
||||
/* ******************************** */
|
||||
/* Warning! Don't modify this file! */
|
||||
/* ******************************** */
|
||||
#ifndef __pika_lvgl_ALIGN__H
|
||||
#define __pika_lvgl_ALIGN__H
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "PikaObj.h"
|
||||
|
||||
PikaObj *New_pika_lvgl_ALIGN(Args *args);
|
||||
|
||||
void pika_lvgl_ALIGN___init__(PikaObj *self);
|
||||
|
||||
#endif
|
14
port/cmsis-pack/pikascript/pikascript-api/pika_lvgl_ANIM.h
Normal file
14
port/cmsis-pack/pikascript/pikascript-api/pika_lvgl_ANIM.h
Normal file
@ -0,0 +1,14 @@
|
||||
/* ******************************** */
|
||||
/* Warning! Don't modify this file! */
|
||||
/* ******************************** */
|
||||
#ifndef __pika_lvgl_ANIM__H
|
||||
#define __pika_lvgl_ANIM__H
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "PikaObj.h"
|
||||
|
||||
PikaObj *New_pika_lvgl_ANIM(Args *args);
|
||||
|
||||
void pika_lvgl_ANIM___init__(PikaObj *self);
|
||||
|
||||
#endif
|
14
port/cmsis-pack/pikascript/pikascript-api/pika_lvgl_EVENT.h
Normal file
14
port/cmsis-pack/pikascript/pikascript-api/pika_lvgl_EVENT.h
Normal file
@ -0,0 +1,14 @@
|
||||
/* ******************************** */
|
||||
/* Warning! Don't modify this file! */
|
||||
/* ******************************** */
|
||||
#ifndef __pika_lvgl_EVENT__H
|
||||
#define __pika_lvgl_EVENT__H
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "PikaObj.h"
|
||||
|
||||
PikaObj *New_pika_lvgl_EVENT(Args *args);
|
||||
|
||||
void pika_lvgl_EVENT___init__(PikaObj *self);
|
||||
|
||||
#endif
|
14
port/cmsis-pack/pikascript/pikascript-api/pika_lvgl_OPA.h
Normal file
14
port/cmsis-pack/pikascript/pikascript-api/pika_lvgl_OPA.h
Normal file
@ -0,0 +1,14 @@
|
||||
/* ******************************** */
|
||||
/* Warning! Don't modify this file! */
|
||||
/* ******************************** */
|
||||
#ifndef __pika_lvgl_OPA__H
|
||||
#define __pika_lvgl_OPA__H
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "PikaObj.h"
|
||||
|
||||
PikaObj *New_pika_lvgl_OPA(Args *args);
|
||||
|
||||
void pika_lvgl_OPA___init__(PikaObj *self);
|
||||
|
||||
#endif
|
@ -0,0 +1,14 @@
|
||||
/* ******************************** */
|
||||
/* Warning! Don't modify this file! */
|
||||
/* ******************************** */
|
||||
#ifndef __pika_lvgl_PALETTE__H
|
||||
#define __pika_lvgl_PALETTE__H
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "PikaObj.h"
|
||||
|
||||
PikaObj *New_pika_lvgl_PALETTE(Args *args);
|
||||
|
||||
void pika_lvgl_PALETTE___init__(PikaObj *self);
|
||||
|
||||
#endif
|
14
port/cmsis-pack/pikascript/pikascript-api/pika_lvgl_STATE.h
Normal file
14
port/cmsis-pack/pikascript/pikascript-api/pika_lvgl_STATE.h
Normal file
@ -0,0 +1,14 @@
|
||||
/* ******************************** */
|
||||
/* Warning! Don't modify this file! */
|
||||
/* ******************************** */
|
||||
#ifndef __pika_lvgl_STATE__H
|
||||
#define __pika_lvgl_STATE__H
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "PikaObj.h"
|
||||
|
||||
PikaObj *New_pika_lvgl_STATE(Args *args);
|
||||
|
||||
void pika_lvgl_STATE___init__(PikaObj *self);
|
||||
|
||||
#endif
|
33
port/cmsis-pack/pikascript/pikascript-api/pika_lvgl_arc.h
Normal file
33
port/cmsis-pack/pikascript/pikascript-api/pika_lvgl_arc.h
Normal file
@ -0,0 +1,33 @@
|
||||
/* ******************************** */
|
||||
/* Warning! Don't modify this file! */
|
||||
/* ******************************** */
|
||||
#ifndef __pika_lvgl_arc__H
|
||||
#define __pika_lvgl_arc__H
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "PikaObj.h"
|
||||
|
||||
PikaObj *New_pika_lvgl_arc(Args *args);
|
||||
|
||||
void pika_lvgl_arc___init__(PikaObj *self, PikaObj* parent);
|
||||
int pika_lvgl_arc_get_angle_end(PikaObj *self);
|
||||
int pika_lvgl_arc_get_angle_start(PikaObj *self);
|
||||
int pika_lvgl_arc_get_bg_angle_end(PikaObj *self);
|
||||
int pika_lvgl_arc_get_bg_angle_start(PikaObj *self);
|
||||
int pika_lvgl_arc_get_max_value(PikaObj *self);
|
||||
int pika_lvgl_arc_get_min_value(PikaObj *self);
|
||||
int pika_lvgl_arc_get_mode(PikaObj *self);
|
||||
int pika_lvgl_arc_get_value(PikaObj *self);
|
||||
void pika_lvgl_arc_set_angles(PikaObj *self, int start, int end);
|
||||
void pika_lvgl_arc_set_bg_angles(PikaObj *self, int start, int end);
|
||||
void pika_lvgl_arc_set_bg_end_angle(PikaObj *self, int angle);
|
||||
void pika_lvgl_arc_set_bg_start_angle(PikaObj *self, int start);
|
||||
void pika_lvgl_arc_set_change_rate(PikaObj *self, int rate);
|
||||
void pika_lvgl_arc_set_end_angle(PikaObj *self, int angle);
|
||||
void pika_lvgl_arc_set_mode(PikaObj *self, int mode);
|
||||
void pika_lvgl_arc_set_range(PikaObj *self, int min, int max);
|
||||
void pika_lvgl_arc_set_rotation(PikaObj *self, int rotation);
|
||||
void pika_lvgl_arc_set_start_angle(PikaObj *self, int start);
|
||||
void pika_lvgl_arc_set_value(PikaObj *self, int value);
|
||||
|
||||
#endif
|
23
port/cmsis-pack/pikascript/pikascript-api/pika_lvgl_bar.h
Normal file
23
port/cmsis-pack/pikascript/pikascript-api/pika_lvgl_bar.h
Normal file
@ -0,0 +1,23 @@
|
||||
/* ******************************** */
|
||||
/* Warning! Don't modify this file! */
|
||||
/* ******************************** */
|
||||
#ifndef __pika_lvgl_bar__H
|
||||
#define __pika_lvgl_bar__H
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "PikaObj.h"
|
||||
|
||||
PikaObj *New_pika_lvgl_bar(Args *args);
|
||||
|
||||
void pika_lvgl_bar___init__(PikaObj *self, PikaObj* parent);
|
||||
int pika_lvgl_bar_get_max_value(PikaObj *self);
|
||||
int pika_lvgl_bar_get_min_value(PikaObj *self);
|
||||
int pika_lvgl_bar_get_mode(PikaObj *self);
|
||||
int pika_lvgl_bar_get_start_value(PikaObj *self);
|
||||
int pika_lvgl_bar_get_value(PikaObj *self);
|
||||
void pika_lvgl_bar_set_mode(PikaObj *self, int mode);
|
||||
void pika_lvgl_bar_set_range(PikaObj *self, int min, int max);
|
||||
void pika_lvgl_bar_set_start_value(PikaObj *self, int start_value, int anim);
|
||||
void pika_lvgl_bar_set_value(PikaObj *self, int value, int anim);
|
||||
|
||||
#endif
|
14
port/cmsis-pack/pikascript/pikascript-api/pika_lvgl_btn.h
Normal file
14
port/cmsis-pack/pikascript/pikascript-api/pika_lvgl_btn.h
Normal file
@ -0,0 +1,14 @@
|
||||
/* ******************************** */
|
||||
/* Warning! Don't modify this file! */
|
||||
/* ******************************** */
|
||||
#ifndef __pika_lvgl_btn__H
|
||||
#define __pika_lvgl_btn__H
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "PikaObj.h"
|
||||
|
||||
PikaObj *New_pika_lvgl_btn(Args *args);
|
||||
|
||||
void pika_lvgl_btn___init__(PikaObj *self, PikaObj* parent);
|
||||
|
||||
#endif
|
@ -0,0 +1,17 @@
|
||||
/* ******************************** */
|
||||
/* Warning! Don't modify this file! */
|
||||
/* ******************************** */
|
||||
#ifndef __pika_lvgl_checkbox__H
|
||||
#define __pika_lvgl_checkbox__H
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "PikaObj.h"
|
||||
|
||||
PikaObj *New_pika_lvgl_checkbox(Args *args);
|
||||
|
||||
void pika_lvgl_checkbox___init__(PikaObj *self, PikaObj* parent);
|
||||
char* pika_lvgl_checkbox_get_text(PikaObj *self);
|
||||
void pika_lvgl_checkbox_set_text(PikaObj *self, char* txt);
|
||||
void pika_lvgl_checkbox_set_text_static(PikaObj *self, char* txt);
|
||||
|
||||
#endif
|
@ -0,0 +1,34 @@
|
||||
/* ******************************** */
|
||||
/* Warning! Don't modify this file! */
|
||||
/* ******************************** */
|
||||
#ifndef __pika_lvgl_dropdown__H
|
||||
#define __pika_lvgl_dropdown__H
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "PikaObj.h"
|
||||
|
||||
PikaObj *New_pika_lvgl_dropdown(Args *args);
|
||||
|
||||
void pika_lvgl_dropdown___init__(PikaObj *self, PikaObj* parent);
|
||||
void pika_lvgl_dropdown_add_option(PikaObj *self, char* option, int pos);
|
||||
void pika_lvgl_dropdown_clear_options(PikaObj *self);
|
||||
void pika_lvgl_dropdown_close(PikaObj *self);
|
||||
int pika_lvgl_dropdown_get_dir(PikaObj *self);
|
||||
int pika_lvgl_dropdown_get_option_cnt(PikaObj *self);
|
||||
int pika_lvgl_dropdown_get_option_index(PikaObj *self, char* option);
|
||||
char* pika_lvgl_dropdown_get_options(PikaObj *self);
|
||||
int pika_lvgl_dropdown_get_selected(PikaObj *self);
|
||||
int pika_lvgl_dropdown_get_selected_highlight(PikaObj *self);
|
||||
char* pika_lvgl_dropdown_get_selected_str(PikaObj *self);
|
||||
int pika_lvgl_dropdown_get_symbol(PikaObj *self);
|
||||
char* pika_lvgl_dropdown_get_text(PikaObj *self);
|
||||
int pika_lvgl_dropdown_is_open(PikaObj *self);
|
||||
void pika_lvgl_dropdown_open(PikaObj *self);
|
||||
void pika_lvgl_dropdown_set_dir(PikaObj *self, int dir);
|
||||
void pika_lvgl_dropdown_set_options(PikaObj *self, char* options);
|
||||
void pika_lvgl_dropdown_set_selected(PikaObj *self, int sel_opt);
|
||||
void pika_lvgl_dropdown_set_selected_hightlight(PikaObj *self, int en);
|
||||
void pika_lvgl_dropdown_set_symbol(PikaObj *self, char* symbol);
|
||||
void pika_lvgl_dropdown_set_text(PikaObj *self, char* txt);
|
||||
|
||||
#endif
|
@ -0,0 +1,14 @@
|
||||
/* ******************************** */
|
||||
/* Warning! Don't modify this file! */
|
||||
/* ******************************** */
|
||||
#ifndef __pika_lvgl_indev_t__H
|
||||
#define __pika_lvgl_indev_t__H
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "PikaObj.h"
|
||||
|
||||
PikaObj *New_pika_lvgl_indev_t(Args *args);
|
||||
|
||||
void pika_lvgl_indev_t_get_vect(PikaObj *self, PikaObj* point);
|
||||
|
||||
#endif
|
18
port/cmsis-pack/pikascript/pikascript-api/pika_lvgl_label.h
Normal file
18
port/cmsis-pack/pikascript/pikascript-api/pika_lvgl_label.h
Normal file
@ -0,0 +1,18 @@
|
||||
/* ******************************** */
|
||||
/* Warning! Don't modify this file! */
|
||||
/* ******************************** */
|
||||
#ifndef __pika_lvgl_label__H
|
||||
#define __pika_lvgl_label__H
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "PikaObj.h"
|
||||
|
||||
PikaObj *New_pika_lvgl_label(Args *args);
|
||||
|
||||
void pika_lvgl_label___init__(PikaObj *self, PikaObj* parent);
|
||||
void pika_lvgl_label_set_long_mode(PikaObj *self, int mode);
|
||||
void pika_lvgl_label_set_recolor(PikaObj *self, int en);
|
||||
void pika_lvgl_label_set_style_text_align(PikaObj *self, int value, int selector);
|
||||
void pika_lvgl_label_set_text(PikaObj *self, char* txt);
|
||||
|
||||
#endif
|
@ -1,13 +1,13 @@
|
||||
/* ******************************** */
|
||||
/* Warning! Don't modify this file! */
|
||||
/* ******************************** */
|
||||
#ifndef __PikaStdLib_PikaObj__H
|
||||
#define __PikaStdLib_PikaObj__H
|
||||
#ifndef __pika_lvgl_lv_color_t__H
|
||||
#define __pika_lvgl_lv_color_t__H
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "PikaObj.h"
|
||||
|
||||
PikaObj *New_PikaStdLib_PikaObj(Args *args);
|
||||
PikaObj *New_pika_lvgl_lv_color_t(Args *args);
|
||||
|
||||
|
||||
#endif
|
@ -0,0 +1,15 @@
|
||||
/* ******************************** */
|
||||
/* Warning! Don't modify this file! */
|
||||
/* ******************************** */
|
||||
#ifndef __pika_lvgl_lv_event__H
|
||||
#define __pika_lvgl_lv_event__H
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "PikaObj.h"
|
||||
|
||||
PikaObj *New_pika_lvgl_lv_event(Args *args);
|
||||
|
||||
int pika_lvgl_lv_event_get_code(PikaObj *self);
|
||||
PikaObj* pika_lvgl_lv_event_get_target(PikaObj *self);
|
||||
|
||||
#endif
|
25
port/cmsis-pack/pikascript/pikascript-api/pika_lvgl_lv_obj.h
Normal file
25
port/cmsis-pack/pikascript/pikascript-api/pika_lvgl_lv_obj.h
Normal file
@ -0,0 +1,25 @@
|
||||
/* ******************************** */
|
||||
/* Warning! Don't modify this file! */
|
||||
/* ******************************** */
|
||||
#ifndef __pika_lvgl_lv_obj__H
|
||||
#define __pika_lvgl_lv_obj__H
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "PikaObj.h"
|
||||
|
||||
PikaObj *New_pika_lvgl_lv_obj(Args *args);
|
||||
|
||||
void pika_lvgl_lv_obj_add_event_cb(PikaObj *self, Arg* event_cb, int filter, void* user_data);
|
||||
void pika_lvgl_lv_obj_add_state(PikaObj *self, int state);
|
||||
void pika_lvgl_lv_obj_add_style(PikaObj *self, PikaObj* style, int selector);
|
||||
void pika_lvgl_lv_obj_align(PikaObj *self, int align, int x_ofs, int y_ofs);
|
||||
void pika_lvgl_lv_obj_center(PikaObj *self);
|
||||
int pika_lvgl_lv_obj_get_x(PikaObj *self);
|
||||
int pika_lvgl_lv_obj_get_y(PikaObj *self);
|
||||
void pika_lvgl_lv_obj_set_hight(PikaObj *self, int h);
|
||||
void pika_lvgl_lv_obj_set_pos(PikaObj *self, int x, int y);
|
||||
void pika_lvgl_lv_obj_set_size(PikaObj *self, int size_x, int size_y);
|
||||
void pika_lvgl_lv_obj_set_width(PikaObj *self, int w);
|
||||
void pika_lvgl_lv_obj_update_layout(PikaObj *self);
|
||||
|
||||
#endif
|
@ -0,0 +1,16 @@
|
||||
/* ******************************** */
|
||||
/* Warning! Don't modify this file! */
|
||||
/* ******************************** */
|
||||
#ifndef __pika_lvgl_lv_timer_t__H
|
||||
#define __pika_lvgl_lv_timer_t__H
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "PikaObj.h"
|
||||
|
||||
PikaObj *New_pika_lvgl_lv_timer_t(Args *args);
|
||||
|
||||
void pika_lvgl_lv_timer_t__del(PikaObj *self);
|
||||
void pika_lvgl_lv_timer_t_set_cb(PikaObj *self, Arg* cb);
|
||||
void pika_lvgl_lv_timer_t_set_period(PikaObj *self, int period);
|
||||
|
||||
#endif
|
@ -0,0 +1,14 @@
|
||||
/* ******************************** */
|
||||
/* Warning! Don't modify this file! */
|
||||
/* ******************************** */
|
||||
#ifndef __pika_lvgl_point_t__H
|
||||
#define __pika_lvgl_point_t__H
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "PikaObj.h"
|
||||
|
||||
PikaObj *New_pika_lvgl_point_t(Args *args);
|
||||
|
||||
void pika_lvgl_point_t___init__(PikaObj *self);
|
||||
|
||||
#endif
|
16
port/cmsis-pack/pikascript/pikascript-api/pika_lvgl_roller.h
Normal file
16
port/cmsis-pack/pikascript/pikascript-api/pika_lvgl_roller.h
Normal file
@ -0,0 +1,16 @@
|
||||
/* ******************************** */
|
||||
/* Warning! Don't modify this file! */
|
||||
/* ******************************** */
|
||||
#ifndef __pika_lvgl_roller__H
|
||||
#define __pika_lvgl_roller__H
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "PikaObj.h"
|
||||
|
||||
PikaObj *New_pika_lvgl_roller(Args *args);
|
||||
|
||||
void pika_lvgl_roller___init__(PikaObj *self, PikaObj* parent);
|
||||
void pika_lvgl_roller_set_options(PikaObj *self, char* options, int mode);
|
||||
void pika_lvgl_roller_set_visible_row_count(PikaObj *self, int row_cnt);
|
||||
|
||||
#endif
|
14
port/cmsis-pack/pikascript/pikascript-api/pika_lvgl_slider.h
Normal file
14
port/cmsis-pack/pikascript/pikascript-api/pika_lvgl_slider.h
Normal file
@ -0,0 +1,14 @@
|
||||
/* ******************************** */
|
||||
/* Warning! Don't modify this file! */
|
||||
/* ******************************** */
|
||||
#ifndef __pika_lvgl_slider__H
|
||||
#define __pika_lvgl_slider__H
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "PikaObj.h"
|
||||
|
||||
PikaObj *New_pika_lvgl_slider(Args *args);
|
||||
|
||||
void pika_lvgl_slider___init__(PikaObj *self, PikaObj* parent);
|
||||
|
||||
#endif
|
@ -0,0 +1,24 @@
|
||||
/* ******************************** */
|
||||
/* Warning! Don't modify this file! */
|
||||
/* ******************************** */
|
||||
#ifndef __pika_lvgl_style_t__H
|
||||
#define __pika_lvgl_style_t__H
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "PikaObj.h"
|
||||
|
||||
PikaObj *New_pika_lvgl_style_t(Args *args);
|
||||
|
||||
void pika_lvgl_style_t___init__(PikaObj *self);
|
||||
void pika_lvgl_style_t_init(PikaObj *self);
|
||||
void pika_lvgl_style_t_set_bg_color(PikaObj *self, PikaObj* color);
|
||||
void pika_lvgl_style_t_set_bg_opa(PikaObj *self, int opa);
|
||||
void pika_lvgl_style_t_set_outline_color(PikaObj *self, PikaObj* color);
|
||||
void pika_lvgl_style_t_set_outline_pad(PikaObj *self, int pad);
|
||||
void pika_lvgl_style_t_set_outline_width(PikaObj *self, int w);
|
||||
void pika_lvgl_style_t_set_radius(PikaObj *self, int radius);
|
||||
void pika_lvgl_style_t_set_shadow_color(PikaObj *self, PikaObj* color);
|
||||
void pika_lvgl_style_t_set_shadow_spread(PikaObj *self, int s);
|
||||
void pika_lvgl_style_t_set_shadow_width(PikaObj *self, int w);
|
||||
|
||||
#endif
|
14
port/cmsis-pack/pikascript/pikascript-api/pika_lvgl_switch.h
Normal file
14
port/cmsis-pack/pikascript/pikascript-api/pika_lvgl_switch.h
Normal file
@ -0,0 +1,14 @@
|
||||
/* ******************************** */
|
||||
/* Warning! Don't modify this file! */
|
||||
/* ******************************** */
|
||||
#ifndef __pika_lvgl_switch__H
|
||||
#define __pika_lvgl_switch__H
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "PikaObj.h"
|
||||
|
||||
PikaObj *New_pika_lvgl_switch(Args *args);
|
||||
|
||||
void pika_lvgl_switch___init__(PikaObj *self, PikaObj* parent);
|
||||
|
||||
#endif
|
15
port/cmsis-pack/pikascript/pikascript-api/pika_lvgl_table.h
Normal file
15
port/cmsis-pack/pikascript/pikascript-api/pika_lvgl_table.h
Normal file
@ -0,0 +1,15 @@
|
||||
/* ******************************** */
|
||||
/* Warning! Don't modify this file! */
|
||||
/* ******************************** */
|
||||
#ifndef __pika_lvgl_table__H
|
||||
#define __pika_lvgl_table__H
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "PikaObj.h"
|
||||
|
||||
PikaObj *New_pika_lvgl_table(Args *args);
|
||||
|
||||
void pika_lvgl_table___init__(PikaObj *self, PikaObj* parent);
|
||||
void pika_lvgl_table_set_cell_value(PikaObj *self, int row, int col, char* txt);
|
||||
|
||||
#endif
|
@ -0,0 +1,15 @@
|
||||
/* ******************************** */
|
||||
/* Warning! Don't modify this file! */
|
||||
/* ******************************** */
|
||||
#ifndef __pika_lvgl_textarea__H
|
||||
#define __pika_lvgl_textarea__H
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "PikaObj.h"
|
||||
|
||||
PikaObj *New_pika_lvgl_textarea(Args *args);
|
||||
|
||||
void pika_lvgl_textarea___init__(PikaObj *self, PikaObj* parent);
|
||||
void pika_lvgl_textarea_set_one_line(PikaObj *self, int en);
|
||||
|
||||
#endif
|
@ -73,7 +73,7 @@ int pikaCompile(char* output_file_name, char* py_lines) {
|
||||
bytecode_frame.instruct_array.output_f = bytecode_f;
|
||||
bytecode_frame.instruct_array.output_redirect_fun =
|
||||
__handler_instructArray_output_none;
|
||||
Parser_parsePyLines(NULL, &bytecode_frame, py_lines);
|
||||
Parser_linesToBytes(&bytecode_frame, py_lines);
|
||||
uint16_t const_pool_size = bytecode_frame.const_pool.size;
|
||||
uint16_t instruct_array_size = bytecode_frame.instruct_array.size;
|
||||
byteCodeFrame_deinit(&bytecode_frame);
|
||||
@ -86,7 +86,7 @@ int pikaCompile(char* output_file_name, char* py_lines) {
|
||||
/* instruct array to file */
|
||||
bytecode_frame.instruct_array.output_redirect_fun =
|
||||
__handler_instructArray_output_file;
|
||||
Parser_parsePyLines(NULL, &bytecode_frame, py_lines);
|
||||
Parser_linesToBytes(&bytecode_frame, py_lines);
|
||||
byteCodeFrame_deinit(&bytecode_frame);
|
||||
|
||||
/* step 3, write const pool to file */
|
||||
@ -103,7 +103,7 @@ int pikaCompile(char* output_file_name, char* py_lines) {
|
||||
/* instruct array to none */
|
||||
bytecode_frame.instruct_array.output_redirect_fun =
|
||||
__handler_instructArray_output_none;
|
||||
Parser_parsePyLines(NULL, &bytecode_frame, py_lines);
|
||||
Parser_linesToBytes(&bytecode_frame, py_lines);
|
||||
byteCodeFrame_deinit(&bytecode_frame);
|
||||
|
||||
/* deinit */
|
||||
|
@ -244,9 +244,9 @@ size_t obj_loadBytes(PikaObj* self, char* argPath, uint8_t* out_buff) {
|
||||
}
|
||||
|
||||
static PIKA_RES __obj_setArg(PikaObj* self,
|
||||
char* argPath,
|
||||
Arg* arg,
|
||||
uint8_t is_copy) {
|
||||
char* argPath,
|
||||
Arg* arg,
|
||||
uint8_t is_copy) {
|
||||
/* setArg would copy arg */
|
||||
PikaObj* obj = obj_getHostObj(self, argPath);
|
||||
if (NULL == obj) {
|
||||
@ -522,6 +522,17 @@ char* methodArg_getTypeList(Arg* method_arg, char* buffs, size_t size) {
|
||||
return strCut(buffs, method_dec, '(', ')');
|
||||
}
|
||||
|
||||
char* methodArg_getName(Arg* method_arg, char* buffs, size_t size) {
|
||||
char* method_dec = strCopy(buffs, methodArg_getDec(method_arg));
|
||||
char res[PIKA_NAME_BUFF_SIZE] = {0};
|
||||
if (strGetSize(method_dec) > size) {
|
||||
return NULL;
|
||||
}
|
||||
strPopToken(res, method_dec, '(');
|
||||
strCopy(buffs, res);
|
||||
return buffs;
|
||||
}
|
||||
|
||||
Method obj_getNativeMethod(PikaObj* self, char* method_name) {
|
||||
Arg* method_arg = obj_getMethodArg(self, method_name);
|
||||
if (NULL == method_arg) {
|
||||
@ -556,10 +567,9 @@ PikaObj* methodArg_getDefContext(Arg* method_arg) {
|
||||
|
||||
static void obj_saveMethodInfo(PikaObj* self, MethodInfo* method_info) {
|
||||
Args buffs = {0};
|
||||
char* pars = strsRemovePrefix(&buffs, method_info->dec, method_info->name);
|
||||
method_info->pars = pars;
|
||||
method_info->pars = method_info->dec;
|
||||
Arg* arg = New_arg(NULL);
|
||||
uint32_t size_pars = strGetSize(pars);
|
||||
uint32_t size_pars = strGetSize(method_info->pars);
|
||||
uintptr_t method_info_bytecode_frame =
|
||||
(uintptr_t)method_info->bytecode_frame;
|
||||
uintptr_t method_info_def_context = (uintptr_t)method_info->def_context;
|
||||
@ -1109,6 +1119,14 @@ void pks_eventLicener_registEvent(PikaEventListener* self,
|
||||
strsDeinit(&buffs);
|
||||
}
|
||||
|
||||
void pks_eventLicener_removeEvent(PikaEventListener* self, uint32_t eventId) {
|
||||
Args buffs = {0};
|
||||
char* event_name =
|
||||
strsFormat(&buffs, PIKA_SPRINTF_BUFF_SIZE, "%ld", eventId);
|
||||
obj_removeArg(self, event_name);
|
||||
strsDeinit(&buffs);
|
||||
}
|
||||
|
||||
PikaObj* pks_eventLisener_getEventHandleObj(PikaEventListener* self,
|
||||
uint32_t eventId) {
|
||||
Args buffs = {0};
|
||||
@ -1163,6 +1181,11 @@ void pks_printVersion(void) {
|
||||
PIKA_VERSION_MINOR, PIKA_VERSION_MICRO, PIKA_EDIT_TIME);
|
||||
}
|
||||
|
||||
void pks_getVersion(char *buff)
|
||||
{
|
||||
__platform_sprintf(buff, "%d.%d.%d", PIKA_VERSION_MAJOR, PIKA_VERSION_MINOR, PIKA_VERSION_MICRO);
|
||||
}
|
||||
|
||||
void* obj_getStruct(PikaObj* self, char* name) {
|
||||
return args_getStruct(self->list, name);
|
||||
}
|
||||
|
@ -192,6 +192,7 @@ char* method_getStr(Args* args, char* argName);
|
||||
void method_returnArg(Args* args, Arg* arg);
|
||||
char* methodArg_getDec(Arg* method_arg);
|
||||
char* methodArg_getTypeList(Arg* method_arg, char* buffs, size_t size);
|
||||
char* methodArg_getName(Arg* method_arg, char* buffs, size_t size);
|
||||
ByteCodeFrame* methodArg_getBytecodeFrame(Arg* method_arg);
|
||||
Method methodArg_getPtr(Arg* method_arg);
|
||||
|
||||
@ -273,6 +274,11 @@ void pks_eventLicener_registEvent(PikaEventListener* self,
|
||||
uint32_t eventId,
|
||||
PikaObj* eventHandleObj);
|
||||
|
||||
void pks_eventLicener_removeEvent(PikaEventListener* self, uint32_t eventId);
|
||||
|
||||
PikaObj* pks_eventLisener_getEventHandleObj(PikaEventListener* self,
|
||||
uint32_t eventId);
|
||||
|
||||
void pks_eventLisener_init(PikaEventListener** p_self);
|
||||
void pks_eventLisener_deinit(PikaEventListener** p_self);
|
||||
PikaObj* methodArg_getDefContext(Arg* method_arg);
|
||||
@ -280,9 +286,8 @@ PikaObj* Obj_linkLibraryFile(PikaObj* self, char* input_file_name);
|
||||
NewFun obj_getClass(PikaObj* obj);
|
||||
|
||||
void pks_printVersion(void);
|
||||
void pks_getVersion(char *buff);
|
||||
void* obj_getStruct(PikaObj* self, char* name);
|
||||
PikaObj* pks_eventLisener_getEventHandleObj(PikaEventListener* self,
|
||||
uint32_t eventId);
|
||||
|
||||
#define obj_refcntDec(self) (((self)->refcnt--))
|
||||
#define obj_refcntInc(self) (((self)->refcnt)++)
|
||||
@ -291,4 +296,9 @@ PikaObj* pks_eventLisener_getEventHandleObj(PikaEventListener* self,
|
||||
#define obj_setStruct(PikaObj_p_self, char_p_name, struct_) \
|
||||
args_setStruct(((PikaObj_p_self)->list), char_p_name, struct_)
|
||||
|
||||
#define ABSTRACT_METHOD_DECLARE(x) \
|
||||
obj_setErrorCode(self, 1); \
|
||||
__platform_printf("Error: abstract method `%s()` need override.\r\n", \
|
||||
__FUNCTION__)
|
||||
|
||||
#endif
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -63,11 +63,18 @@ struct Asmer {
|
||||
char* line_pointer;
|
||||
};
|
||||
|
||||
typedef struct SyntaxItem {
|
||||
char* astNodeName;
|
||||
char* asmCode;
|
||||
PIKA_BOOL isUseNodeValue;
|
||||
} SyntaxItem;
|
||||
typedef enum _GenRuleValType {
|
||||
VAL_NONEVAL,
|
||||
VAL_DYNAMIC,
|
||||
VAL_STATIC_,
|
||||
} GenRuleValType;
|
||||
|
||||
typedef struct GenRule {
|
||||
char* ins;
|
||||
GenRuleValType type;
|
||||
char* ast;
|
||||
char* val;
|
||||
} GenRule;
|
||||
|
||||
typedef struct LexToken LexToken;
|
||||
struct LexToken {
|
||||
@ -76,12 +83,12 @@ struct LexToken {
|
||||
char* pyload;
|
||||
};
|
||||
|
||||
typedef struct ParserState ParsetState;
|
||||
struct ParserState {
|
||||
typedef struct Cursor ParsetState;
|
||||
struct Cursor {
|
||||
char* tokens;
|
||||
uint16_t length;
|
||||
uint16_t iter_index;
|
||||
uint8_t branket_deepth;
|
||||
int8_t branket_deepth;
|
||||
struct LexToken token1;
|
||||
struct LexToken token2;
|
||||
Arg* last_token;
|
||||
@ -90,31 +97,29 @@ struct ParserState {
|
||||
PIKA_RES result;
|
||||
};
|
||||
|
||||
char* Parser_multiLineToAsm(Args* outBuffs, char* multiLine);
|
||||
char* Parser_fileToAsm(Args* outBuffs, char* filename);
|
||||
char* Parser_linesToAsm(Args* outBuffs, char* multiLine);
|
||||
char* Parser_linesToBytes(ByteCodeFrame* bf, char* py_lines);
|
||||
char* Parser_linesToArray(char* lines);
|
||||
|
||||
char* instructUnit_fromAsmLine(Args* outBuffs, char* pikaAsm);
|
||||
char* Parser_byteCodeToAsm(Args* outBuffs, char* pikaByteCode);
|
||||
ByteCodeFrame* byteCodeFrame_appendFromAsm(ByteCodeFrame* bf, char* pikaAsm);
|
||||
int bytecodeFrame_fromMultiLine(ByteCodeFrame* bytecode_frame,
|
||||
char* python_lines);
|
||||
void Parser_compilePyToBytecodeArray(char* lines);
|
||||
char* Parser_parsePyLines(Args* outBuffs,
|
||||
ByteCodeFrame* bytecode_frame,
|
||||
char* py_lines);
|
||||
#define ParserState_forEach(parseState) \
|
||||
ParserState_beforeIter(&parseState); \
|
||||
for (int __i = 0; __i < parseState.length; __i++)
|
||||
int bytecodeFrame_fromLines(ByteCodeFrame* bytecode_frame, char* python_lines);
|
||||
|
||||
#define ParserState_forEachTokenExistPs(parseState, tokens) \
|
||||
/* init parserStage */ \
|
||||
ParserState_init(&parseState); \
|
||||
ParserState_parse(&parseState, tokens); \
|
||||
ParserState_forEach(parseState)
|
||||
#define Cursor_forEach(cursor) \
|
||||
Cursor_beforeIter(&cursor); \
|
||||
for (int __i = 0; __i < cursor.length; __i++)
|
||||
|
||||
#define ParserState_forEachToken(parseState, tokens) \
|
||||
struct ParserState parseState; \
|
||||
ParserState_forEachTokenExistPs(parseState, tokens)
|
||||
#define Cursor_forEachTokenExistPs(cursor, tokens) \
|
||||
/* init parserStage */ \
|
||||
Cursor_init(&cursor); \
|
||||
Cursor_parse(&cursor, tokens); \
|
||||
Cursor_forEach(cursor)
|
||||
|
||||
#define Cursor_forEachToken(cursor, tokens) \
|
||||
struct Cursor cursor; \
|
||||
Cursor_forEachTokenExistPs(cursor, tokens)
|
||||
|
||||
uint16_t Tokens_getSize(char* tokens);
|
||||
char* Parser_fileToAsm(Args* outBuffs, char* filename);
|
||||
|
||||
#endif
|
||||
|
@ -114,7 +114,7 @@ PIKA_WEAK char __platform_getchar(void) {
|
||||
#if defined(__linux) || defined(_WIN32)
|
||||
return getchar();
|
||||
#else
|
||||
__platform_printf("[error]: __platform_getchar need implementation!\r\n");
|
||||
__platform_printf("Error: __platform_getchar need implementation!\r\n");
|
||||
while (1) {
|
||||
}
|
||||
#endif
|
||||
@ -125,7 +125,7 @@ PIKA_WEAK FILE* __platform_fopen(const char* filename, const char* modes) {
|
||||
#if defined(__linux) || defined(_WIN32)
|
||||
return fopen(filename, modes);
|
||||
#else
|
||||
__platform_printf("[error]: __platform_fopen need implementation!\r\n");
|
||||
__platform_printf("Error: __platform_fopen need implementation!\r\n");
|
||||
while (1) {
|
||||
}
|
||||
#endif
|
||||
@ -136,7 +136,7 @@ PIKA_WEAK int __platform_fclose(FILE* stream) {
|
||||
#if defined(__linux) || defined(_WIN32)
|
||||
return fclose(stream);
|
||||
#else
|
||||
__platform_printf("[error]: __platform_fclose need implementation!\r\n");
|
||||
__platform_printf("Error: __platform_fclose need implementation!\r\n");
|
||||
while (1) {
|
||||
}
|
||||
#endif
|
||||
@ -150,7 +150,7 @@ PIKA_WEAK size_t __platform_fwrite(const void* ptr,
|
||||
#if defined(__linux) || defined(_WIN32)
|
||||
return fwrite(ptr, size, n, stream);
|
||||
#else
|
||||
__platform_printf("[error]: __platform_fwrite need implementation!\r\n");
|
||||
__platform_printf("Error: __platform_fwrite need implementation!\r\n");
|
||||
while (1) {
|
||||
}
|
||||
#endif
|
||||
@ -164,7 +164,7 @@ PIKA_WEAK size_t __platform_fread(void* ptr,
|
||||
#if defined(__linux) || defined(_WIN32)
|
||||
return fread(ptr, size, n, stream);
|
||||
#else
|
||||
__platform_printf("[error]: __platform_fread need implementation!\r\n");
|
||||
__platform_printf("Error: __platform_fread need implementation!\r\n");
|
||||
while (1) {
|
||||
}
|
||||
#endif
|
||||
@ -175,7 +175,7 @@ PIKA_WEAK int __platform_fseek(FILE* stream, long offset, int whence) {
|
||||
#if defined(__linux) || defined(_WIN32)
|
||||
return fseek(stream, offset, whence);
|
||||
#else
|
||||
__platform_printf("[error]: __platform_fseek need implementation!\r\n");
|
||||
__platform_printf("Error: __platform_fseek need implementation!\r\n");
|
||||
while (1) {
|
||||
}
|
||||
#endif
|
||||
@ -186,8 +186,12 @@ PIKA_WEAK long __platform_ftell(FILE* stream) {
|
||||
#if defined(__linux) || defined(_WIN32)
|
||||
return ftell(stream);
|
||||
#else
|
||||
__platform_printf("[error]: __platform_ftell need implementation!\r\n");
|
||||
__platform_printf("Error: __platform_ftell need implementation!\r\n");
|
||||
while (1) {
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
PIKA_WEAK void __pks_hook_instruct(void) {
|
||||
return;
|
||||
}
|
||||
|
@ -94,6 +94,7 @@ typedef enum {
|
||||
PIKA_RES_ERR_UNKNOWN,
|
||||
PIKA_RES_ERR_SYNTAX_ERROR,
|
||||
PIKA_RES_ERR_IO,
|
||||
PIKA_RES_ERR_ASSERT,
|
||||
} PIKA_RES;
|
||||
|
||||
/* clang-format off */
|
||||
@ -158,4 +159,6 @@ long __platform_ftell(FILE* stream);
|
||||
/* error */
|
||||
void __platform_error_handle(void);
|
||||
|
||||
void __pks_hook_instruct(void);
|
||||
|
||||
#endif
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -76,11 +76,27 @@ struct VMState {
|
||||
uint8_t error_code;
|
||||
uint8_t line_error_code;
|
||||
uint8_t try_error_code;
|
||||
uint32_t ins_cnt;
|
||||
PikaObj* lreg[PIKA_REGIST_SIZE];
|
||||
PIKA_BOOL ireg[PIKA_REGIST_SIZE];
|
||||
TryInfo* try_info;
|
||||
};
|
||||
|
||||
typedef struct OperatorInfo OperatorInfo;
|
||||
struct OperatorInfo {
|
||||
char* opt;
|
||||
ArgType t1;
|
||||
ArgType t2;
|
||||
Arg* a1;
|
||||
Arg* a2;
|
||||
double f1;
|
||||
double f2;
|
||||
int i1;
|
||||
int i2;
|
||||
Arg* res;
|
||||
int num;
|
||||
VMState* vm;
|
||||
};
|
||||
|
||||
VMParameters* pikaVM_run(PikaObj* self, char* pyLine);
|
||||
VMParameters* pikaVM_runAsm(PikaObj* self, char* pikaAsm);
|
||||
|
@ -1,5 +1,5 @@
|
||||
#define PIKA_VERSION_MAJOR 1
|
||||
#define PIKA_VERSION_MINOR 10
|
||||
#define PIKA_VERSION_MICRO 0
|
||||
#define PIKA_VERSION_MICRO 3
|
||||
|
||||
#define PIKA_EDIT_TIME "2022/08/05 15:00:46"
|
||||
#define PIKA_EDIT_TIME "2022/08/25 11:23:27"
|
||||
|
@ -90,3 +90,7 @@ def_ins(SER)
|
||||
def_ins(DCT)
|
||||
/* slice */
|
||||
def_ins(SLC)
|
||||
/* assert */
|
||||
def_ins(ASS)
|
||||
/* expect */
|
||||
def_ins(EXP)
|
||||
|
@ -269,7 +269,7 @@ Arg* arg_setStr(Arg* self, char* name, char* string) {
|
||||
}
|
||||
|
||||
int64_t arg_getInt(Arg* self) {
|
||||
pika_assert(NULL!=self);
|
||||
pika_assert(NULL != self);
|
||||
if (NULL == arg_getContent(self)) {
|
||||
return -999999;
|
||||
}
|
||||
@ -328,7 +328,7 @@ Arg* arg_copy_noalloc(Arg* arg_src, Arg* arg_dict) {
|
||||
if (NULL == arg_src) {
|
||||
return NULL;
|
||||
}
|
||||
if (NULL == arg_dict){
|
||||
if (NULL == arg_dict) {
|
||||
return arg_copy(arg_src);
|
||||
}
|
||||
/* size is too big to be copied by noalloc */
|
||||
|
@ -139,6 +139,12 @@ uint8_t argType_isObject(ArgType type);
|
||||
#define argType_isObject(type) \
|
||||
((type) == ARG_TYPE_OBJECT || (type) == ARG_TYPE_OBJECT_NEW)
|
||||
|
||||
#define argType_isCallable(type) \
|
||||
((type) == ARG_TYPE_METHOD_CONSTRUCTOR || \
|
||||
(type) == ARG_TYPE_METHOD_OBJECT || (type) == ARG_TYPE_METHOD_STATIC || \
|
||||
(type) == ARG_TYPE_METHOD_NATIVE || \
|
||||
(type) == ARG_TYPE_METHOD_NATIVE_CONSTRUCTOR)
|
||||
|
||||
#endif
|
||||
|
||||
#define arg_newReg(__name, __size) \
|
||||
|
@ -596,6 +596,18 @@ size_t list_getSize(PikaList* self) {
|
||||
return args_getInt(&self->super, "top");
|
||||
}
|
||||
|
||||
void list_reverse(PikaList* self) {
|
||||
int top = list_getSize(self);
|
||||
for (int i = 0; i < top / 2; i++) {
|
||||
Arg* arg_i = arg_copy(list_getArg(self, i));
|
||||
Arg* arg_top = arg_copy(list_getArg(self, top - i - 1));
|
||||
list_setArg(self, i, arg_top);
|
||||
list_setArg(self, top - i - 1, arg_i);
|
||||
arg_deinit(arg_i);
|
||||
arg_deinit(arg_top);
|
||||
}
|
||||
}
|
||||
|
||||
PikaTuple* New_tuple(void) {
|
||||
PikaTuple* self = (PikaTuple*)New_list();
|
||||
return self;
|
||||
@ -605,6 +617,28 @@ char* strsFormatArg(Args* out_buffs, char* fmt, Arg* arg) {
|
||||
Args buffs = {0};
|
||||
char* res = NULL;
|
||||
ArgType type = arg_getType(arg);
|
||||
const char* syms[] = {"%s", "%r"};
|
||||
for (size_t i = 0; i < sizeof(syms) / sizeof(char*); i++) {
|
||||
char* sym = (char*)syms[i];
|
||||
if (strstr(fmt, sym)) {
|
||||
if (type == ARG_TYPE_STRING) {
|
||||
fmt = strsReplace(&buffs, fmt, sym, "%s");
|
||||
break;
|
||||
}
|
||||
if (type == ARG_TYPE_INT) {
|
||||
fmt = strsReplace(&buffs, fmt, sym, "%d");
|
||||
break;
|
||||
}
|
||||
if (type == ARG_TYPE_FLOAT) {
|
||||
fmt = strsReplace(&buffs, fmt, sym, "%f");
|
||||
break;
|
||||
}
|
||||
if (type == ARG_TYPE_POINTER) {
|
||||
fmt = strsReplace(&buffs, fmt, sym, "%p");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ARG_TYPE_INT == type) {
|
||||
int val = arg_getInt(arg);
|
||||
res = strsFormat(&buffs, PIKA_SPRINTF_BUFF_SIZE, fmt, val);
|
||||
@ -660,3 +694,8 @@ exit:
|
||||
arg_deinit(res_buff);
|
||||
return res;
|
||||
}
|
||||
|
||||
PikaTuple* args_getTuple(Args* self, char* name) {
|
||||
PikaObj* tuple_obj = args_getPtr(self, name);
|
||||
return obj_getPtr(tuple_obj, "list");
|
||||
}
|
||||
|
@ -168,6 +168,7 @@ char* list_getStr(PikaList* self, int index);
|
||||
void* list_getPtr(PikaList* self, int index);
|
||||
Arg* list_getArg(PikaList* self, int index);
|
||||
size_t list_getSize(PikaList* self);
|
||||
void list_reverse(PikaList* self);
|
||||
char* strsFormatArg(Args* out_buffs, char* fmt, Arg* arg);
|
||||
|
||||
/* tuple api */
|
||||
@ -183,6 +184,7 @@ char* strsFormatArg(Args* out_buffs, char* fmt, Arg* arg);
|
||||
|
||||
PikaList* New_list(void);
|
||||
PikaTuple* New_tuple(void);
|
||||
PikaTuple* args_getTuple(Args* self, char* name);
|
||||
|
||||
char* strsFormatList(Args* out_buffs, char* fmt, PikaList* list);
|
||||
|
||||
|
@ -52,7 +52,7 @@ void* pikaMalloc(uint32_t size) {
|
||||
__platform_enable_irq_handle();
|
||||
if (NULL == mem) {
|
||||
__platform_printf(
|
||||
"[error]: No heap space! Please reset the device.\r\n");
|
||||
"Error: No heap space! Please reset the device.\r\n");
|
||||
while (1) {
|
||||
}
|
||||
}
|
||||
|
@ -115,6 +115,7 @@ static int32_t _stack_pushArg(Stack* stack, Arg* arg, PIKA_BOOL is_alloc) {
|
||||
}
|
||||
|
||||
int32_t stack_pushArg(Stack* stack, Arg* arg) {
|
||||
pika_assert(arg != NULL);
|
||||
if (arg->serialized) {
|
||||
return _stack_pushArg(stack, arg, PIKA_TRUE);
|
||||
}
|
||||
|
@ -233,7 +233,7 @@ int32_t strIsContain(char* str, char ch) {
|
||||
}
|
||||
|
||||
char* strCopy(char* strBuff, char* strIn) {
|
||||
__platform_memcpy(strBuff, strIn, strGetSize(strIn));
|
||||
__platform_memcpy(strBuff, strIn, strGetSize(strIn) + 1);
|
||||
return strBuff;
|
||||
}
|
||||
|
||||
|
@ -50,6 +50,22 @@
|
||||
#include "pika_config.h"
|
||||
#endif
|
||||
|
||||
/* default pika_nano_enabled */
|
||||
#ifndef PIKA_NANO_ENABLE
|
||||
#define PIKA_NANO_ENABLE 0
|
||||
#endif
|
||||
|
||||
#if PIKA_NANO_ENABLE
|
||||
#ifndef PIKA_OPTIMIZE
|
||||
#define PIKA_OPTIMIZE PIKA_OPTIMIZE_SIZE
|
||||
#endif
|
||||
|
||||
/* default syntax support level */
|
||||
#ifndef PIKA_SYNTAX_LEVEL
|
||||
#define PIKA_SYNTAX_LEVEL PIKA_SYNTAX_LEVEL_MINIMAL
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* default optimize */
|
||||
#ifndef PIKA_OPTIMIZE
|
||||
#define PIKA_OPTIMIZE PIKA_OPTIMIZE_SIZE
|
||||
@ -106,6 +122,10 @@
|
||||
#define PIKA_FILEIO_ENABLE 0
|
||||
#endif
|
||||
|
||||
#ifndef PIKA_EXEC_ENABLE
|
||||
#define PIKA_EXEC_ENABLE 0
|
||||
#endif
|
||||
|
||||
#elif PIKA_SYNTAX_LEVEL == PIKA_SYNTAX_LEVEL_MAXIMAL
|
||||
#ifndef PIKA_SYNTAX_SLICE_ENABLE
|
||||
#define PIKA_SYNTAX_SLICE_ENABLE 1
|
||||
@ -139,6 +159,10 @@
|
||||
#define PIKA_FILEIO_ENABLE 1
|
||||
#endif
|
||||
|
||||
#ifndef PIKA_EXEC_ENABLE
|
||||
#define PIKA_EXEC_ENABLE 1
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
/* default configuration */
|
||||
@ -254,6 +278,18 @@
|
||||
#define PIKA_ARG_BUFF_SIZE 8
|
||||
#endif
|
||||
|
||||
#ifndef PIKA_INSTRUCT_HOOK_ENABLE
|
||||
#define PIKA_INSTRUCT_HOOK_ENABLE 0
|
||||
#endif
|
||||
|
||||
#ifndef PIKA_INSTRUCT_HOOK_PERIOD
|
||||
#define PIKA_INSTRUCT_HOOK_PERIOD 50
|
||||
#endif
|
||||
|
||||
#ifndef PIKA_EXEC_ENABLE
|
||||
#define PIKA_EXEC_ENABLE 1
|
||||
#endif
|
||||
|
||||
/* configuration validation */
|
||||
|
||||
#endif
|
||||
|
@ -100,7 +100,13 @@ char* PikaStdData_dict_keys___str__(PikaObj* self) {
|
||||
str_arg = arg_strAppend(str_arg, ", ");
|
||||
}
|
||||
char* item_str = PikaStdLib_SysObj_str(self, item);
|
||||
if (arg_getType(item) == ARG_TYPE_STRING) {
|
||||
str_arg = arg_strAppend(str_arg, "'");
|
||||
}
|
||||
str_arg = arg_strAppend(str_arg, item_str);
|
||||
if (arg_getType(item) == ARG_TYPE_STRING) {
|
||||
str_arg = arg_strAppend(str_arg, "'");
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
@ -133,7 +139,13 @@ char* PikaStdData_Dict___str__(PikaObj* self) {
|
||||
str_arg = arg_strAppend(str_arg, ": ");
|
||||
|
||||
char* val_str = PikaStdLib_SysObj_str(self, item_val);
|
||||
if (arg_getType(item_val) == ARG_TYPE_STRING) {
|
||||
str_arg = arg_strAppend(str_arg, "'");
|
||||
}
|
||||
str_arg = arg_strAppend(str_arg, val_str);
|
||||
if (arg_getType(item_val) == ARG_TYPE_STRING) {
|
||||
str_arg = arg_strAppend(str_arg, "'");
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
|
@ -2,18 +2,18 @@
|
||||
#include <stdio.h>
|
||||
#include "PikaStdData_List.h"
|
||||
|
||||
void PikaStdData_FILEIO_init(PikaObj* self, char* mode, char* path) {
|
||||
int PikaStdData_FILEIO_init(PikaObj* self, char* path, char* mode) {
|
||||
if (obj_isArgExist(self, "_f")) {
|
||||
/* already initialized */
|
||||
return;
|
||||
return 0;
|
||||
}
|
||||
FILE* f = __platform_fopen(path, mode);
|
||||
if (f == NULL) {
|
||||
printf("Error: can't open file %s\n", path);
|
||||
return;
|
||||
return 1;
|
||||
}
|
||||
obj_setPtr(self, "_f", f);
|
||||
obj_setStr(self, "_mode", mode);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void PikaStdData_FILEIO_close(PikaObj* self) {
|
||||
@ -76,7 +76,7 @@ int PikaStdData_FILEIO_write(PikaObj* self, Arg* s) {
|
||||
return res;
|
||||
}
|
||||
|
||||
int PikaStdData_FILEIO_seek(PikaObj *self, int offset, PikaTuple* fromwhere){
|
||||
int PikaStdData_FILEIO_seek(PikaObj* self, int offset, PikaTuple* fromwhere) {
|
||||
FILE* f = obj_getPtr(self, "_f");
|
||||
if (f == NULL) {
|
||||
obj_setErrorCode(self, PIKA_RES_ERR_IO);
|
||||
|
@ -12,7 +12,7 @@ void PikaStdData_List_set(PikaObj* self, int i, Arg* arg) {
|
||||
PikaList* list = obj_getPtr(self, "list");
|
||||
if (PIKA_RES_OK != list_setArg(list, i, arg)) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error]: index exceeded lengh of list.");
|
||||
obj_setSysOut(self, "Error: index exceeded lengh of list.");
|
||||
}
|
||||
}
|
||||
|
||||
@ -40,7 +40,13 @@ char* PikaStdData_List___str__(PikaObj* self) {
|
||||
str_arg = arg_strAppend(str_arg, ", ");
|
||||
}
|
||||
char* item_str = PikaStdLib_SysObj_str(self, item);
|
||||
if (arg_getType(item) == ARG_TYPE_STRING) {
|
||||
str_arg = arg_strAppend(str_arg, "'");
|
||||
}
|
||||
str_arg = arg_strAppend(str_arg, item_str);
|
||||
if (arg_getType(item) == ARG_TYPE_STRING) {
|
||||
str_arg = arg_strAppend(str_arg, "'");
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
@ -49,3 +55,25 @@ char* PikaStdData_List___str__(PikaObj* self) {
|
||||
arg_deinit(str_arg);
|
||||
return obj_getStr(self, "_buf");
|
||||
}
|
||||
|
||||
void PikaStdData_List_reverse(PikaObj* self) {
|
||||
PikaList* list = obj_getPtr(self, "list");
|
||||
list_reverse(list);
|
||||
}
|
||||
|
||||
PikaObj* PikaStdData_List___add__(PikaObj* self, PikaObj* others) {
|
||||
PikaObj* res = newNormalObj(New_PikaStdData_List);
|
||||
PikaStdData_List___init__(res);
|
||||
PikaList* list_res = obj_getPtr(res, "list");
|
||||
PikaList* list1 = obj_getPtr(self, "list");
|
||||
PikaList* list2 = obj_getPtr(others, "list");
|
||||
for (size_t i = 0; i < list_getSize(list1); i++) {
|
||||
Arg* arg = list_getArg(list1, i);
|
||||
list_append(list_res, arg);
|
||||
}
|
||||
for (size_t i = 0; i < list_getSize(list2); i++) {
|
||||
Arg* arg = list_getArg(list2, i);
|
||||
list_append(list_res, arg);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
@ -66,7 +66,7 @@ char* PikaStdData_String___str__(PikaObj* self) {
|
||||
return obj_getStr(self, "str");
|
||||
}
|
||||
|
||||
int PikaStdData_String_startwith(PikaObj* self, char* prefix) {
|
||||
int PikaStdData_String_startswith(PikaObj* self, char* prefix) {
|
||||
char* str = obj_getStr(self, "str");
|
||||
char* p = prefix;
|
||||
int i = 0;
|
||||
@ -79,7 +79,7 @@ int PikaStdData_String_startwith(PikaObj* self, char* prefix) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
int PikaStdData_String_endwith(PikaObj* self, char* suffix) {
|
||||
int PikaStdData_String_endswith(PikaObj* self, char* suffix) {
|
||||
char* str = obj_getStr(self, "str");
|
||||
int len1 = strlen(str);
|
||||
int len2 = strlen(suffix);
|
||||
|
@ -55,7 +55,13 @@ char* PikaStdData_Tuple___str__(PikaObj* self) {
|
||||
str_arg = arg_strAppend(str_arg, ", ");
|
||||
}
|
||||
char* item_str = PikaStdLib_SysObj_str(self, item);
|
||||
if (arg_getType(item) == ARG_TYPE_STRING) {
|
||||
str_arg = arg_strAppend(str_arg, "'");
|
||||
}
|
||||
str_arg = arg_strAppend(str_arg, item_str);
|
||||
if (arg_getType(item) == ARG_TYPE_STRING) {
|
||||
str_arg = arg_strAppend(str_arg, "'");
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
|
@ -461,7 +461,12 @@ int PikaStdLib_SysObj_id(PikaObj* self, Arg* obj) {
|
||||
PikaObj* PikaStdLib_SysObj_open(PikaObj* self, char* path, char* mode) {
|
||||
#if PIKA_FILEIO_ENABLE
|
||||
PikaObj* file = newNormalObj(New_PikaStdData_FILEIO);
|
||||
PikaStdData_FILEIO_init(file, mode, path);
|
||||
if (0 != PikaStdData_FILEIO_init(file, path, mode)) {
|
||||
obj_setErrorCode(self, 1);
|
||||
__platform_printf("[Error] open: can not open file.\r\n");
|
||||
obj_deinit(file);
|
||||
return NULL;
|
||||
}
|
||||
return file;
|
||||
#else
|
||||
obj_setErrorCode(self, 1);
|
||||
@ -469,3 +474,62 @@ PikaObj* PikaStdLib_SysObj_open(PikaObj* self, char* path, char* mode) {
|
||||
return NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* __dir_each */
|
||||
int32_t __dir_each(Arg* argEach, Args* context) {
|
||||
PikaObj* list = args_getPtr(context, "list");
|
||||
if (argType_isCallable(arg_getType(argEach))) {
|
||||
char name_buff[PIKA_LINE_BUFF_SIZE / 2] = {0};
|
||||
char* method_name =
|
||||
methodArg_getName(argEach, name_buff, sizeof(name_buff));
|
||||
Arg* arg_str = arg_newStr(method_name);
|
||||
__vm_List_append(list, arg_str);
|
||||
arg_deinit(arg_str);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
PikaObj* PikaStdLib_SysObj_dir(PikaObj* self, PikaObj* obj) {
|
||||
PikaObj* New_PikaStdData_List(Args * args);
|
||||
PikaObj* list = newNormalObj(New_PikaStdData_List);
|
||||
__vm_List___init__(list);
|
||||
Args* context = New_args(NULL);
|
||||
args_setPtr(context, "list", list);
|
||||
args_foreach(obj->list, __dir_each, context);
|
||||
args_deinit(context);
|
||||
return list;
|
||||
}
|
||||
|
||||
void PikaStdLib_SysObj_exec(PikaObj* self, char* code) {
|
||||
#if PIKA_EXEC_ENABLE
|
||||
obj_run(self, code);
|
||||
#else
|
||||
obj_setErrorCode(self, 1);
|
||||
__platform_printf("[Error] PIKA_EXEC_ENABLE is not enabled.\r\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
Arg* PikaStdLib_SysObj_getattr(PikaObj* self, PikaObj* obj, char* name) {
|
||||
Arg* res = NULL;
|
||||
if (NULL == obj) {
|
||||
obj_setErrorCode(self, 1);
|
||||
__platform_printf("[Error] getattr: can not get attr of NULL.\r\n");
|
||||
return NULL;
|
||||
}
|
||||
res = arg_copy(obj_getArg(obj, name));
|
||||
return res;
|
||||
}
|
||||
|
||||
void PikaStdLib_SysObj_setattr(PikaObj* self,
|
||||
PikaObj* obj,
|
||||
char* name,
|
||||
Arg* val) {
|
||||
if (NULL == obj) {
|
||||
obj_setErrorCode(self, 1);
|
||||
__platform_printf("[Error] setattr: obj is null.\r\n");
|
||||
goto exit;
|
||||
}
|
||||
obj_setArg(obj, name, val);
|
||||
exit:
|
||||
return;
|
||||
}
|
||||
|
@ -213,5 +213,5 @@ void PikaStdTask_Task_run_until_ms(PikaObj* self, int until_ms) {
|
||||
|
||||
void PikaStdTask_Task_platformGetTick(PikaObj* self) {
|
||||
obj_setErrorCode(self, 1);
|
||||
obj_setSysOut(self, "[error] platform method need to be override.");
|
||||
__platform_printf("Error: abstract method %s need implament", __FUNCTION__);
|
||||
}
|
||||
|
@ -0,0 +1,8 @@
|
||||
#include "lvgl.h"
|
||||
#include "pika_lvgl_point_t.h"
|
||||
|
||||
void pika_lvgl_point_t___init__(PikaObj* self) {
|
||||
lv_point_t lv_point = {0};
|
||||
args_setStruct(self->list, "lv_point_struct", lv_point);
|
||||
obj_setPtr(self, "lv_point", args_getStruct(self->list, "lv_point_struct"));
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
#include "lvgl.h"
|
||||
#include "pika_lvgl_lv_timer_t.h"
|
||||
|
||||
PikaEventListener* g_pika_lv_timer_event_listener;
|
||||
|
||||
void __pika_timer_cb(lv_timer_t* timer) {
|
||||
PikaObj* eventHandleObj = pks_eventLisener_getEventHandleObj(
|
||||
g_pika_lv_timer_event_listener, (uint32_t)timer);
|
||||
obj_newDirectObj(eventHandleObj, "timer", New_pika_lvgl_lv_timer_t);
|
||||
obj_setPtr(obj_getPtr(eventHandleObj, "timer"), "lv_timer", timer);
|
||||
obj_run(eventHandleObj, "eventCallBack(timer)");
|
||||
}
|
||||
|
||||
void pika_lvgl_lv_timer_t_set_period(PikaObj* self, int period) {
|
||||
lv_timer_t* lv_timer = obj_getPtr(self, "lv_timer");
|
||||
lv_timer_set_period(lv_timer, period);
|
||||
}
|
||||
|
||||
void pika_lvgl_lv_timer_t_set_cb(PikaObj* self, Arg* cb) {
|
||||
lv_timer_t* lv_timer = obj_getPtr(self, "lv_timer");
|
||||
lv_timer_set_cb(lv_timer, __pika_timer_cb);
|
||||
|
||||
obj_setArg(self, "eventCallBack", cb);
|
||||
/* init event_listener for the first time */
|
||||
if (NULL == g_pika_lv_timer_event_listener) {
|
||||
pks_eventLisener_init(&g_pika_lv_timer_event_listener);
|
||||
}
|
||||
pks_eventLicener_registEvent(g_pika_lv_timer_event_listener,
|
||||
(uint32_t)lv_timer, self);
|
||||
|
||||
}
|
||||
|
||||
void pika_lvgl_lv_timer_t__del(PikaObj* self) {
|
||||
lv_timer_t* lv_timer = obj_getPtr(self, "lv_timer");
|
||||
lv_timer_del(lv_timer);
|
||||
}
|
@ -0,0 +1,357 @@
|
||||
#include "BaseObj.h"
|
||||
#include "lvgl.h"
|
||||
#include "pika_lvgl.h"
|
||||
#include "pika_lvgl_arc.h"
|
||||
#include "pika_lvgl_bar.h"
|
||||
#include "pika_lvgl_btn.h"
|
||||
#include "pika_lvgl_checkbox.h"
|
||||
#include "pika_lvgl_dropdown.h"
|
||||
#include "pika_lvgl_label.h"
|
||||
#include "pika_lvgl_lv_obj.h"
|
||||
#include "pika_lvgl_roller.h"
|
||||
#include "pika_lvgl_slider.h"
|
||||
#include "pika_lvgl_switch.h"
|
||||
#include "pika_lvgl_table.h"
|
||||
#include "pika_lvgl_textarea.h"
|
||||
|
||||
void pika_lvgl_arc___init__(PikaObj* self, PikaObj* parent) {
|
||||
lv_obj_t* lv_parent = obj_getPtr(parent, "lv_obj");
|
||||
lv_obj_t* lv_obj = lv_arc_create(lv_parent);
|
||||
obj_setPtr(self, "lv_obj", lv_obj);
|
||||
obj_setInt(self, "MODE_NORMAL", LV_ARC_MODE_NORMAL);
|
||||
obj_setInt(self, "MODE_SYMMETRICAL", LV_ARC_MODE_SYMMETRICAL);
|
||||
obj_setInt(self, "MODE_REVERSE", LV_ARC_MODE_REVERSE);
|
||||
}
|
||||
|
||||
void pika_lvgl_arc_set_end_angle(PikaObj* self, int angle) {
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
lv_arc_set_end_angle(lv_obj, angle);
|
||||
}
|
||||
|
||||
void pika_lvgl_arc_set_bg_angles(PikaObj* self, int start, int end) {
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
lv_arc_set_bg_angles(lv_obj, start, end);
|
||||
}
|
||||
|
||||
void pika_lvgl_arc_set_angles(PikaObj* self, int start, int end) {
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
lv_arc_set_angles(lv_obj, start, end);
|
||||
}
|
||||
|
||||
int pika_lvgl_arc_get_angle_end(PikaObj *self){
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
return lv_arc_get_angle_end(lv_obj);
|
||||
}
|
||||
int pika_lvgl_arc_get_angle_start(PikaObj *self){
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
return lv_arc_get_angle_start(lv_obj);
|
||||
}
|
||||
int pika_lvgl_arc_get_bg_angle_end(PikaObj *self){
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
return lv_arc_get_bg_angle_end(lv_obj);
|
||||
}
|
||||
int pika_lvgl_arc_get_bg_angle_start(PikaObj *self){
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
return lv_arc_get_bg_angle_start(lv_obj);
|
||||
}
|
||||
int pika_lvgl_arc_get_max_value(PikaObj *self){
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
return lv_arc_get_max_value(lv_obj);
|
||||
}
|
||||
int pika_lvgl_arc_get_min_value(PikaObj *self){
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
return lv_arc_get_min_value(lv_obj);
|
||||
}
|
||||
int pika_lvgl_arc_get_mode(PikaObj *self){
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
return lv_arc_get_mode(lv_obj);
|
||||
}
|
||||
// int pika_lvgl_arc_get_rotation(PikaObj *self){
|
||||
// lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
// return lv_arc_get_rotation(lv_obj);
|
||||
// }
|
||||
int pika_lvgl_arc_get_value(PikaObj *self){
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
return lv_arc_get_value(lv_obj);
|
||||
}
|
||||
void pika_lvgl_arc_set_mode(PikaObj *self, int mode){
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
lv_arc_set_mode(lv_obj, mode);
|
||||
}
|
||||
void pika_lvgl_arc_set_range(PikaObj *self, int min, int max){
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
lv_arc_set_range(lv_obj, min, max);
|
||||
}
|
||||
void pika_lvgl_arc_set_rotation(PikaObj *self, int rotation){
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
lv_arc_set_rotation(lv_obj, rotation);
|
||||
}
|
||||
void pika_lvgl_arc_set_start_angle(PikaObj *self, int start){
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
lv_arc_set_start_angle(lv_obj, start);
|
||||
}
|
||||
void pika_lvgl_arc_set_value(PikaObj *self, int value){
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
lv_arc_set_value(lv_obj, value);
|
||||
}
|
||||
void pika_lvgl_arc_set_bg_end_angle(PikaObj *self, int angle){
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
lv_arc_set_bg_end_angle(lv_obj, angle);
|
||||
}
|
||||
void pika_lvgl_arc_set_bg_start_angle(PikaObj *self, int start){
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
lv_arc_set_bg_start_angle(lv_obj, start);
|
||||
}
|
||||
|
||||
void pika_lvgl_arc_set_change_rate(PikaObj *self, int rate){
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
lv_arc_set_change_rate(lv_obj, rate);
|
||||
}
|
||||
|
||||
void pika_lvgl_bar___init__(PikaObj* self, PikaObj* parent) {
|
||||
lv_obj_t* lv_parent = obj_getPtr(parent, "lv_obj");
|
||||
lv_obj_t* lv_obj = lv_bar_create(lv_parent);
|
||||
obj_setPtr(self, "lv_obj", lv_obj);
|
||||
}
|
||||
|
||||
void pika_lvgl_bar_set_value(PikaObj* self, int value, int anim) {
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
lv_bar_set_value(lv_obj, value, value);
|
||||
}
|
||||
|
||||
int pika_lvgl_bar_get_max_value(PikaObj *self){
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
return lv_bar_get_max_value(lv_obj);
|
||||
}
|
||||
int pika_lvgl_bar_get_min_value(PikaObj *self){
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
return lv_bar_get_min_value(lv_obj);
|
||||
}
|
||||
int pika_lvgl_bar_get_mode(PikaObj *self){
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
return lv_bar_get_mode(lv_obj);
|
||||
}
|
||||
int pika_lvgl_bar_get_start_value(PikaObj *self){
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
return lv_bar_get_start_value(lv_obj);
|
||||
}
|
||||
int pika_lvgl_bar_get_value(PikaObj *self){
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
return lv_bar_get_value(lv_obj);
|
||||
}
|
||||
void pika_lvgl_bar_set_mode(PikaObj *self, int mode){
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
lv_bar_set_mode(lv_obj, mode);
|
||||
}
|
||||
void pika_lvgl_bar_set_range(PikaObj *self, int min, int max){
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
lv_bar_set_range(lv_obj, min, max);
|
||||
}
|
||||
void pika_lvgl_bar_set_start_value(PikaObj *self, int start_value, int anim){
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
lv_bar_set_start_value(lv_obj, start_value, anim);
|
||||
}
|
||||
|
||||
void pika_lvgl_btn___init__(PikaObj* self, PikaObj* parent) {
|
||||
lv_obj_t* lv_parent = obj_getPtr(parent, "lv_obj");
|
||||
lv_obj_t* lv_obj = lv_btn_create(lv_parent);
|
||||
obj_setPtr(self, "lv_obj", lv_obj);
|
||||
}
|
||||
|
||||
void pika_lvgl_checkbox___init__(PikaObj* self, PikaObj* parent) {
|
||||
lv_obj_t* lv_parent = obj_getPtr(parent, "lv_obj");
|
||||
lv_obj_t* lv_obj = lv_checkbox_create(lv_parent);
|
||||
obj_setPtr(self, "lv_obj", lv_obj);
|
||||
}
|
||||
|
||||
void pika_lvgl_checkbox_set_text(PikaObj* self, char* txt) {
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
lv_checkbox_set_text(lv_obj, txt);
|
||||
}
|
||||
|
||||
void pika_lvgl_checkbox_set_text_static(PikaObj *self, char* txt){
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
lv_checkbox_set_text_static(lv_obj, txt);
|
||||
}
|
||||
|
||||
char* pika_lvgl_checkbox_get_text(PikaObj *self){
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
return lv_checkbox_get_text(lv_obj);
|
||||
}
|
||||
|
||||
void pika_lvgl_dropdown___init__(PikaObj* self, PikaObj* parent) {
|
||||
lv_obj_t* lv_parent = obj_getPtr(parent, "lv_obj");
|
||||
lv_obj_t* lv_obj = lv_dropdown_create(lv_parent);
|
||||
obj_setPtr(self, "lv_obj", lv_obj);
|
||||
}
|
||||
|
||||
void pika_lvgl_dropdown_set_options(PikaObj* self, char* options) {
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
lv_dropdown_set_options(lv_obj, options);
|
||||
}
|
||||
|
||||
void pika_lvgl_dropdown_add_option(PikaObj *self, char* options, int pos){
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
lv_dropdown_add_option(lv_obj, options, pos);
|
||||
}
|
||||
void pika_lvgl_dropdown_clear_options(PikaObj *self){
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
lv_dropdown_clear_options(lv_obj);
|
||||
}
|
||||
void pika_lvgl_dropdown_close(PikaObj *self){
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
lv_dropdown_close(lv_obj);
|
||||
}
|
||||
int pika_lvgl_dropdown_get_dir(PikaObj *self){
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
return lv_dropdown_get_dir(lv_obj);
|
||||
}
|
||||
// PikaObj* pika_lvgl_dropdown_get_list(PikaObj *self){
|
||||
// lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
// return obj_getObj(lv_dropdown_get_list(lv_obj));
|
||||
// }
|
||||
int pika_lvgl_dropdown_get_option_cnt(PikaObj *self){
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
return lv_dropdown_get_option_cnt(lv_obj);
|
||||
}
|
||||
int pika_lvgl_dropdown_get_option_index(PikaObj *self, char* txt){
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
return lv_dropdown_get_option_index(lv_obj, txt);
|
||||
}
|
||||
char* pika_lvgl_dropdown_get_options(PikaObj *self){
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
return lv_dropdown_get_options(lv_obj);
|
||||
}
|
||||
int pika_lvgl_dropdown_get_selected(PikaObj *self){
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
return lv_dropdown_get_selected(lv_obj);
|
||||
}
|
||||
int pika_lvgl_dropdown_get_selected_highlight(PikaObj *self){
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
return lv_dropdown_get_selected_highlight(lv_obj);
|
||||
}
|
||||
|
||||
char* pika_lvgl_dropdown_get_selected_str(PikaObj *self){
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
obj_setBytes(self, "_buff",NULL, 128);
|
||||
char* _buff = obj_getBytes(self, "_buff");
|
||||
lv_dropdown_get_selected_str(lv_obj, _buff, 128);
|
||||
return _buff;
|
||||
}
|
||||
int pika_lvgl_dropdown_get_symbol(PikaObj *self){
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
return lv_dropdown_get_symbol(lv_obj);
|
||||
}
|
||||
char* pika_lvgl_dropdown_get_text(PikaObj *self){
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
return lv_dropdown_get_text(lv_obj);
|
||||
}
|
||||
int pika_lvgl_dropdown_is_open(PikaObj *self){
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
return lv_dropdown_is_open(lv_obj);
|
||||
}
|
||||
void pika_lvgl_dropdown_open(PikaObj *self){
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
lv_dropdown_open(lv_obj);
|
||||
}
|
||||
void pika_lvgl_dropdown_set_dir(PikaObj *self, int dir){
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
lv_dropdown_set_dir(lv_obj, dir);
|
||||
}
|
||||
void pika_lvgl_dropdown_set_selected(PikaObj *self, int sel_opt){
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
lv_dropdown_set_selected(lv_obj, sel_opt);
|
||||
}
|
||||
void pika_lvgl_dropdown_set_selected_hightlight(PikaObj *self, int en){
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
lv_dropdown_set_selected_highlight(lv_obj, en);
|
||||
}
|
||||
void pika_lvgl_dropdown_set_symbol(PikaObj *self, char* symbol){
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
lv_dropdown_set_symbol(lv_obj, symbol);
|
||||
}
|
||||
void pika_lvgl_dropdown_set_text(PikaObj *self, char* txt){
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
lv_dropdown_set_text(lv_obj, txt);
|
||||
}
|
||||
|
||||
void pika_lvgl_label___init__(PikaObj* self, PikaObj* parent) {
|
||||
lv_obj_t* lv_parent = obj_getPtr(parent, "lv_obj");
|
||||
lv_obj_t* lv_obj = lv_label_create(lv_parent);
|
||||
obj_setPtr(self, "lv_obj", lv_obj);
|
||||
}
|
||||
|
||||
void pika_lvgl_label_set_long_mode(PikaObj* self, int mode) {
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
lv_label_set_long_mode(lv_obj, mode);
|
||||
}
|
||||
|
||||
void pika_lvgl_label_set_recolor(PikaObj* self, int en) {
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
lv_label_set_recolor(lv_obj, en);
|
||||
}
|
||||
|
||||
void pika_lvgl_label_set_text(PikaObj* self, char* txt) {
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
lv_label_set_text(lv_obj, txt);
|
||||
}
|
||||
|
||||
void pika_lvgl_label_set_style_text_align(PikaObj* self,
|
||||
int value,
|
||||
int selector) {
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
lv_obj_set_style_text_align(lv_obj, value, selector);
|
||||
}
|
||||
|
||||
void pika_lvgl_roller___init__(PikaObj* self, PikaObj* parent) {
|
||||
lv_obj_t* lv_parent = obj_getPtr(parent, "lv_obj");
|
||||
lv_obj_t* lv_obj = lv_roller_create(lv_parent);
|
||||
obj_setPtr(self, "lv_obj", lv_obj);
|
||||
}
|
||||
|
||||
void pika_lvgl_roller_set_options(PikaObj* self, char* options, int mode) {
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
lv_roller_set_options(lv_obj, options, mode);
|
||||
}
|
||||
|
||||
void pika_lvgl_roller_set_visible_row_count(PikaObj* self, int row_cnt) {
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
lv_roller_set_visible_row_count(lv_obj, row_cnt);
|
||||
}
|
||||
|
||||
void pika_lvgl_slider___init__(PikaObj* self, PikaObj* parent) {
|
||||
lv_obj_t* lv_parent = obj_getPtr(parent, "lv_obj");
|
||||
lv_obj_t* lv_obj = lv_slider_create(lv_parent);
|
||||
obj_setPtr(self, "lv_obj", lv_obj);
|
||||
}
|
||||
|
||||
void pika_lvgl_switch___init__(PikaObj* self, PikaObj* parent) {
|
||||
lv_obj_t* lv_parent = obj_getPtr(parent, "lv_obj");
|
||||
lv_obj_t* lv_obj = lv_switch_create(lv_parent);
|
||||
obj_setPtr(self, "lv_obj", lv_obj);
|
||||
}
|
||||
|
||||
void pika_lvgl_table___init__(PikaObj* self, PikaObj* parent) {
|
||||
lv_obj_t* lv_parent = obj_getPtr(parent, "lv_obj");
|
||||
lv_obj_t* lv_obj = lv_table_create(lv_parent);
|
||||
obj_setPtr(self, "lv_obj", lv_obj);
|
||||
}
|
||||
|
||||
void pika_lvgl_table_set_cell_value(PikaObj* self,
|
||||
int row,
|
||||
int col,
|
||||
char* txt) {
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
lv_table_set_cell_value(lv_obj, row, col, txt);
|
||||
}
|
||||
|
||||
void pika_lvgl_textarea___init__(PikaObj* self, PikaObj* parent) {
|
||||
lv_obj_t* lv_parent = obj_getPtr(parent, "lv_obj");
|
||||
lv_obj_t* lv_obj = lv_textarea_create(lv_parent);
|
||||
obj_setPtr(self, "lv_obj", lv_obj);
|
||||
}
|
||||
|
||||
void pika_lvgl_textarea_set_one_line(PikaObj* self, int en) {
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
lv_textarea_set_one_line(lv_obj, en);
|
||||
}
|
193
port/cmsis-pack/pikascript/pikascript-lib/pika_lvgl/pika_lvgl.c
Normal file
193
port/cmsis-pack/pikascript/pikascript-lib/pika_lvgl/pika_lvgl.c
Normal file
@ -0,0 +1,193 @@
|
||||
#include "pika_lvgl.h"
|
||||
#include "BaseObj.h"
|
||||
#include "lvgl.h"
|
||||
#include "pika_lvgl_ALIGN.h"
|
||||
#include "pika_lvgl_ANIM.h"
|
||||
#include "pika_lvgl_EVENT.h"
|
||||
#include "pika_lvgl_OPA.h"
|
||||
#include "pika_lvgl_PALETTE.h"
|
||||
#include "pika_lvgl_STATE.h"
|
||||
#include "pika_lvgl_arc.h"
|
||||
#include "pika_lvgl_lv_color_t.h"
|
||||
#include "pika_lvgl_lv_obj.h"
|
||||
#include "pika_lvgl_indev_t.h"
|
||||
#include "pika_lvgl_lv_timer_t.h"
|
||||
|
||||
PikaObj* pika_lv_event_listener_g;
|
||||
|
||||
void pika_lvgl_STATE___init__(PikaObj* self) {
|
||||
obj_setInt(self, "DEFAULT", LV_STATE_DEFAULT);
|
||||
obj_setInt(self, "CHECKED", LV_STATE_CHECKED);
|
||||
obj_setInt(self, "FOCUSED", LV_STATE_FOCUSED);
|
||||
obj_setInt(self, "FOCUS_KEY", LV_STATE_FOCUS_KEY);
|
||||
obj_setInt(self, "EDITED", LV_STATE_EDITED);
|
||||
obj_setInt(self, "HOVERED", LV_STATE_HOVERED);
|
||||
obj_setInt(self, "PRESSED", LV_STATE_PRESSED);
|
||||
obj_setInt(self, "SCROLLED", LV_STATE_SCROLLED);
|
||||
obj_setInt(self, "DISABLED", LV_STATE_DISABLED);
|
||||
obj_setInt(self, "USER_1", LV_STATE_USER_1);
|
||||
obj_setInt(self, "USER_2", LV_STATE_USER_2);
|
||||
obj_setInt(self, "USER_3", LV_STATE_USER_3);
|
||||
obj_setInt(self, "USER_4", LV_STATE_USER_4);
|
||||
obj_setInt(self, "ANY", LV_STATE_ANY);
|
||||
}
|
||||
|
||||
void pika_lvgl_ANIM___init__(PikaObj* self) {
|
||||
obj_setInt(self, "ON", LV_ANIM_OFF);
|
||||
obj_setInt(self, "OFF", LV_ANIM_ON);
|
||||
}
|
||||
|
||||
void pika_lvgl_ALIGN___init__(PikaObj* self) {
|
||||
obj_setInt(self, "CENTER", LV_ALIGN_CENTER);
|
||||
obj_setInt(self, "DEFAULT", LV_ALIGN_DEFAULT);
|
||||
obj_setInt(self, "TOP_LEFT", LV_ALIGN_TOP_LEFT);
|
||||
obj_setInt(self, "TOP_MID", LV_ALIGN_TOP_MID);
|
||||
obj_setInt(self, "TOP_RIGHT", LV_ALIGN_TOP_RIGHT);
|
||||
obj_setInt(self, "BOTTOM_LEFT", LV_ALIGN_BOTTOM_LEFT);
|
||||
obj_setInt(self, "BOTTOM_MID", LV_ALIGN_BOTTOM_MID);
|
||||
obj_setInt(self, "BOTTOM_RIGHT", LV_ALIGN_BOTTOM_RIGHT);
|
||||
obj_setInt(self, "LEFT_MID", LV_ALIGN_LEFT_MID);
|
||||
obj_setInt(self, "RIGHT_MID", LV_ALIGN_RIGHT_MID);
|
||||
obj_setInt(self, "OUT_TOP_LEFT", LV_ALIGN_OUT_TOP_LEFT);
|
||||
obj_setInt(self, "OUT_TOP_MID", LV_ALIGN_OUT_TOP_MID);
|
||||
obj_setInt(self, "OUT_TOP_RIGHT", LV_ALIGN_OUT_TOP_RIGHT);
|
||||
obj_setInt(self, "OUT_BOTTOM_LEFT", LV_ALIGN_OUT_BOTTOM_LEFT);
|
||||
obj_setInt(self, "OUT_BOTTOM_MID", LV_ALIGN_OUT_BOTTOM_MID);
|
||||
obj_setInt(self, "OUT_BOTTOM_RIGHT", LV_ALIGN_OUT_BOTTOM_RIGHT);
|
||||
obj_setInt(self, "OUT_LEFT_TOP", LV_ALIGN_OUT_LEFT_TOP);
|
||||
obj_setInt(self, "OUT_LEFT_MID", LV_ALIGN_OUT_LEFT_MID);
|
||||
obj_setInt(self, "OUT_LEFT_BOTTOM", LV_ALIGN_OUT_LEFT_BOTTOM);
|
||||
obj_setInt(self, "OUT_RIGHT_TOP", LV_ALIGN_OUT_RIGHT_TOP);
|
||||
obj_setInt(self, "OUT_RIGHT_MID", LV_ALIGN_OUT_RIGHT_MID);
|
||||
obj_setInt(self, "OUT_RIGHT_BOTTOM", LV_ALIGN_OUT_RIGHT_BOTTOM);
|
||||
}
|
||||
|
||||
void pika_lvgl_EVENT___init__(PikaObj* self) {
|
||||
obj_setInt(self, "ALL", LV_EVENT_ALL);
|
||||
obj_setInt(self, "PRESSED", LV_EVENT_PRESSED);
|
||||
obj_setInt(self, "PRESSING", LV_EVENT_PRESSING);
|
||||
obj_setInt(self, "PRESS_LOST", LV_EVENT_PRESS_LOST);
|
||||
obj_setInt(self, "SHORT_CLICKED", LV_EVENT_SHORT_CLICKED);
|
||||
obj_setInt(self, "LONG_PRESSED", LV_EVENT_LONG_PRESSED);
|
||||
obj_setInt(self, "LONG_PRESSED_REPEAT", LV_EVENT_LONG_PRESSED_REPEAT);
|
||||
obj_setInt(self, "CLICKED", LV_EVENT_CLICKED);
|
||||
obj_setInt(self, "RELEASED", LV_EVENT_RELEASED);
|
||||
obj_setInt(self, "SCROLL_BEGIN", LV_EVENT_SCROLL_BEGIN);
|
||||
obj_setInt(self, "SCROLL_END", LV_EVENT_SCROLL_END);
|
||||
obj_setInt(self, "SCROLL", LV_EVENT_SCROLL);
|
||||
obj_setInt(self, "GESTURE", LV_EVENT_GESTURE);
|
||||
obj_setInt(self, "KEY", LV_EVENT_KEY);
|
||||
obj_setInt(self, "FOCUSED", LV_EVENT_FOCUSED);
|
||||
obj_setInt(self, "DEFOCUSED", LV_EVENT_DEFOCUSED);
|
||||
obj_setInt(self, "LEAVE", LV_EVENT_LEAVE);
|
||||
obj_setInt(self, "HIT_TEST", LV_EVENT_HIT_TEST);
|
||||
obj_setInt(self, "COVER_CHECK", LV_EVENT_COVER_CHECK);
|
||||
obj_setInt(self, "REFR_EXT_DRAW_SIZE", LV_EVENT_REFR_EXT_DRAW_SIZE);
|
||||
obj_setInt(self, "DRAW_MAIN_BEGIN", LV_EVENT_DRAW_MAIN_BEGIN);
|
||||
obj_setInt(self, "DRAW_MAIN", LV_EVENT_DRAW_MAIN);
|
||||
obj_setInt(self, "DRAW_MAIN_END", LV_EVENT_DRAW_MAIN_END);
|
||||
obj_setInt(self, "DRAW_POST_BEGIN", LV_EVENT_DRAW_POST_BEGIN);
|
||||
obj_setInt(self, "DRAW_POST", LV_EVENT_DRAW_POST);
|
||||
obj_setInt(self, "DRAW_POST_END", LV_EVENT_DRAW_POST_END);
|
||||
obj_setInt(self, "DRAW_PART_BEGIN", LV_EVENT_DRAW_PART_BEGIN);
|
||||
obj_setInt(self, "DRAW_PART_END", LV_EVENT_DRAW_PART_END);
|
||||
obj_setInt(self, "VALUE_CHANGED", LV_EVENT_VALUE_CHANGED);
|
||||
obj_setInt(self, "INSERT", LV_EVENT_INSERT);
|
||||
obj_setInt(self, "REFRESH", LV_EVENT_REFRESH);
|
||||
obj_setInt(self, "READY", LV_EVENT_READY);
|
||||
obj_setInt(self, "CANCEL", LV_EVENT_CANCEL);
|
||||
obj_setInt(self, "DELETE", LV_EVENT_DELETE);
|
||||
obj_setInt(self, "CHILD_CHANGED", LV_EVENT_CHILD_CHANGED);
|
||||
obj_setInt(self, "CHILD_CREATED", LV_EVENT_CHILD_CREATED);
|
||||
obj_setInt(self, "CHILD_DELETED", LV_EVENT_CHILD_DELETED);
|
||||
obj_setInt(self, "SCREEN_UNLOAD_START", LV_EVENT_SCREEN_UNLOAD_START);
|
||||
obj_setInt(self, "SCREEN_LOAD_START", LV_EVENT_SCREEN_LOAD_START);
|
||||
obj_setInt(self, "SCREEN_LOADED", LV_EVENT_SCREEN_LOADED);
|
||||
obj_setInt(self, "SCREEN_UNLOADED", LV_EVENT_SCREEN_UNLOADED);
|
||||
obj_setInt(self, "SIZE_CHANGED", LV_EVENT_SIZE_CHANGED);
|
||||
obj_setInt(self, "STYLE_CHANGED", LV_EVENT_STYLE_CHANGED);
|
||||
obj_setInt(self, "LAYOUT_CHANGED", LV_EVENT_LAYOUT_CHANGED);
|
||||
obj_setInt(self, "GET_SELF_SIZE", LV_EVENT_GET_SELF_SIZE);
|
||||
obj_setInt(self, "PREPROCESS", LV_EVENT_PREPROCESS);
|
||||
}
|
||||
|
||||
void pika_lvgl_OPA___init__(PikaObj* self) {
|
||||
obj_setInt(self, "TRANSP", LV_OPA_TRANSP);
|
||||
obj_setInt(self, "COVER", LV_OPA_COVER);
|
||||
}
|
||||
|
||||
void pika_lvgl_PALETTE___init__(PikaObj* self) {
|
||||
obj_setInt(self, "RED", LV_PALETTE_RED);
|
||||
obj_setInt(self, "PINK", LV_PALETTE_PINK);
|
||||
obj_setInt(self, "PURPLE", LV_PALETTE_PURPLE);
|
||||
obj_setInt(self, "DEEP_PURPLE", LV_PALETTE_DEEP_PURPLE);
|
||||
obj_setInt(self, "INDIGO", LV_PALETTE_INDIGO);
|
||||
obj_setInt(self, "BLUE", LV_PALETTE_BLUE);
|
||||
obj_setInt(self, "LIGHT_BLUE", LV_PALETTE_LIGHT_BLUE);
|
||||
obj_setInt(self, "CYAN", LV_PALETTE_CYAN);
|
||||
obj_setInt(self, "TEAL", LV_PALETTE_TEAL);
|
||||
obj_setInt(self, "GREEN", LV_PALETTE_GREEN);
|
||||
obj_setInt(self, "LIGHT_GREEN", LV_PALETTE_LIGHT_GREEN);
|
||||
obj_setInt(self, "LIME", LV_PALETTE_LIME);
|
||||
obj_setInt(self, "YELLOW", LV_PALETTE_YELLOW);
|
||||
obj_setInt(self, "AMBER", LV_PALETTE_AMBER);
|
||||
obj_setInt(self, "ORANGE", LV_PALETTE_ORANGE);
|
||||
obj_setInt(self, "DEEP_ORANGE", LV_PALETTE_DEEP_ORANGE);
|
||||
obj_setInt(self, "BROWN", LV_PALETTE_BROWN);
|
||||
obj_setInt(self, "BLUE_GREY", LV_PALETTE_BLUE_GREY);
|
||||
obj_setInt(self, "GREY", LV_PALETTE_GREY);
|
||||
obj_setInt(self, "NONE", LV_PALETTE_NONE);
|
||||
}
|
||||
|
||||
PikaObj* pika_lvgl_scr_act(PikaObj* self) {
|
||||
PikaObj* new_obj = newNormalObj(New_TinyObj);
|
||||
lv_obj_t* lv_obj = lv_scr_act();
|
||||
obj_setPtr(new_obj, "lv_obj", lv_obj);
|
||||
return new_obj;
|
||||
}
|
||||
|
||||
void pika_lvgl___init__(PikaObj* self) {
|
||||
obj_newDirectObj(self, "lv_event_listener", New_TinyObj);
|
||||
pika_lv_event_listener_g = obj_getObj(self, "lv_event_listener");
|
||||
}
|
||||
|
||||
PikaObj* pika_lvgl_obj(PikaObj* self, PikaObj* parent) {
|
||||
lv_obj_t* lv_parent = obj_getPtr(parent, "lv_obj");
|
||||
lv_obj_t* lv_obj = lv_obj_create(lv_parent);
|
||||
PikaObj* new_obj = newNormalObj(New_pika_lvgl_lv_obj);
|
||||
obj_setPtr(new_obj, "lv_obj", lv_obj);
|
||||
return new_obj;
|
||||
}
|
||||
|
||||
PikaObj* pika_lvgl_palette_lighten(PikaObj *self, int p, int lvl){
|
||||
PikaObj* new_obj = newNormalObj(New_pika_lvgl_lv_color_t);
|
||||
lv_color_t lv_color = lv_palette_lighten(p, lvl);
|
||||
args_setStruct(new_obj->list, "lv_color_struct", lv_color);
|
||||
lv_color_t* plv_color = args_getStruct(new_obj->list, "lv_color_struct");
|
||||
obj_setPtr(new_obj, "lv_color", plv_color);
|
||||
return new_obj;
|
||||
}
|
||||
|
||||
PikaObj* pika_lvgl_palette_main(PikaObj* self, int p) {
|
||||
PikaObj* new_obj = newNormalObj(New_pika_lvgl_lv_color_t);
|
||||
lv_color_t lv_color = lv_palette_main(p);
|
||||
args_setStruct(new_obj->list, "lv_color_struct", lv_color);
|
||||
obj_setPtr(new_obj, "lv_color",
|
||||
args_getStruct(new_obj->list, "lv_color_struct"));
|
||||
return new_obj;
|
||||
}
|
||||
|
||||
PikaObj* pika_lvgl_indev_get_act(PikaObj *self){
|
||||
PikaObj* new_obj = newNormalObj(New_pika_lvgl_indev_t);
|
||||
lv_indev_t *lv_indev = lv_indev_get_act();
|
||||
obj_setPtr(new_obj,"lv_indev", lv_indev);
|
||||
return new_obj;
|
||||
}
|
||||
|
||||
PikaObj* pika_lvgl_timer_create_basic(PikaObj *self){
|
||||
PikaObj* new_obj = newNormalObj(New_pika_lvgl_lv_timer_t);
|
||||
lv_timer_t *lv_timer = lv_timer_create_basic();
|
||||
obj_setPtr(new_obj,"lv_timer", lv_timer);
|
||||
return new_obj;
|
||||
}
|
||||
|
@ -0,0 +1,10 @@
|
||||
#include "pika_lvgl_indev_t.h"
|
||||
#include "lvgl.h"
|
||||
|
||||
void pika_lvgl_indev_t_get_vect(PikaObj* self, PikaObj* point) {
|
||||
lv_indev_t* lv_indev = obj_getPtr(self, "lv_indev");
|
||||
lv_point_t* lv_point = obj_getPtr(point, "lv_point");
|
||||
lv_indev_get_vect(lv_indev, lv_point);
|
||||
obj_setInt(point, "x", lv_point->x);
|
||||
obj_setInt(point, "y", lv_point->y);
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
#include "lvgl.h"
|
||||
#include "pika_lvgl_lv_event.h"
|
||||
|
||||
int pika_lvgl_lv_event_get_code(PikaObj *self){
|
||||
lv_event_t *lv_event = obj_getPtr(self, "lv_event");
|
||||
return lv_event_get_code(lv_event);
|
||||
}
|
||||
|
||||
PikaObj *New_pika_lvgl_lv_obj(Args *args);
|
||||
PikaObj* pika_lvgl_lv_event_get_target(PikaObj *self){
|
||||
lv_event_t *lv_event = obj_getPtr(self, "lv_event");
|
||||
lv_obj_t* lv_obj = lv_event_get_target(lv_event);
|
||||
PikaObj* new_obj = newNormalObj(New_pika_lvgl_lv_obj);
|
||||
obj_setPtr(new_obj, "lv_obj", lv_obj);
|
||||
return new_obj;
|
||||
}
|
@ -0,0 +1,108 @@
|
||||
#include "pika_lvgl_lv_obj.h"
|
||||
#include "BaseObj.h"
|
||||
#include "dataStrs.h"
|
||||
#include "lvgl.h"
|
||||
#include "pika_lvgl.h"
|
||||
#include "pika_lvgl_arc.h"
|
||||
#include "pika_lvgl_lv_event.h"
|
||||
|
||||
extern PikaObj* pika_lv_event_listener_g;
|
||||
|
||||
void pika_lvgl_lv_obj_center(PikaObj* self) {
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
lv_obj_center(lv_obj);
|
||||
}
|
||||
|
||||
void pika_lvgl_lv_obj_set_size(PikaObj* self, int size_x, int size_y) {
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
lv_obj_set_size(lv_obj, size_x, size_y);
|
||||
}
|
||||
|
||||
void pika_lvgl_lv_obj_align(PikaObj* self, int align, int x_ofs, int y_ofs) {
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
lv_obj_align(lv_obj, align, x_ofs, y_ofs);
|
||||
}
|
||||
|
||||
void pika_lvgl_lv_obj_set_hight(PikaObj* self, int h) {
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
lv_obj_set_height(lv_obj, h);
|
||||
}
|
||||
|
||||
void pika_lvgl_lv_obj_update_layout(PikaObj* self) {
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
lv_obj_update_layout(lv_obj);
|
||||
}
|
||||
|
||||
void pika_lvgl_lv_obj_set_width(PikaObj* self, int w) {
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
lv_obj_set_width(lv_obj, w);
|
||||
}
|
||||
|
||||
void pika_lvgl_lv_obj_add_state(PikaObj* self, int state) {
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
lv_obj_add_state(lv_obj, state);
|
||||
}
|
||||
|
||||
PikaObj* eventLisener_getHandler(PikaObj* self, uintptr_t event_id) {
|
||||
Args buffs = {0};
|
||||
char* event_name =
|
||||
strsFormat(&buffs, PIKA_SPRINTF_BUFF_SIZE, "%d", event_id);
|
||||
PikaObj* event_item = obj_getObj(self, event_name);
|
||||
PikaObj* event_handler = obj_getPtr(event_item, "handler");
|
||||
strsDeinit(&buffs);
|
||||
return event_handler;
|
||||
}
|
||||
|
||||
static void __pika_event_cb(lv_event_t* e) {
|
||||
lv_obj_t* target = lv_event_get_target(e);
|
||||
PikaObj* event_handler =
|
||||
eventLisener_getHandler(pika_lv_event_listener_g, (uintptr_t)target);
|
||||
PikaObj* evt = obj_getObj(event_handler, "_event_evt");
|
||||
obj_setPtr(evt, "lv_event", e);
|
||||
obj_run(event_handler, "_event_cb(_event_evt)");
|
||||
}
|
||||
|
||||
void eventLicener_registEvent(PikaObj* self,
|
||||
uintptr_t event_id,
|
||||
PikaObj* event_handler) {
|
||||
Args buffs = {0};
|
||||
char* event_name =
|
||||
strsFormat(&buffs, PIKA_SPRINTF_BUFF_SIZE, "%d", event_id);
|
||||
obj_newDirectObj(self, event_name, New_TinyObj);
|
||||
PikaObj* event_item = obj_getObj(self, event_name);
|
||||
obj_setRef(event_item, "handler", event_handler);
|
||||
strsDeinit(&buffs);
|
||||
}
|
||||
|
||||
void pika_lvgl_lv_obj_add_event_cb(PikaObj* self,
|
||||
Arg* event_cb,
|
||||
int filter,
|
||||
void* user_data) {
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
lv_obj_add_event_cb(lv_obj, __pika_event_cb, filter, NULL);
|
||||
obj_setArg(self, "_event_cb", event_cb);
|
||||
obj_setPtr(self, "_event_user_data", user_data);
|
||||
obj_newDirectObj(self, "_event_evt", New_pika_lvgl_lv_event);
|
||||
eventLicener_registEvent(pika_lv_event_listener_g, (uintptr_t)lv_obj, self);
|
||||
}
|
||||
|
||||
void pika_lvgl_lv_obj_add_style(PikaObj *self, PikaObj* style, int selector){
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
lv_state_t* lv_style = obj_getPtr(style, "lv_style");
|
||||
lv_obj_add_style(lv_obj, lv_style, selector);
|
||||
}
|
||||
|
||||
int pika_lvgl_lv_obj_get_x(PikaObj *self){
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
return lv_obj_get_x(lv_obj);
|
||||
}
|
||||
|
||||
int pika_lvgl_lv_obj_get_y(PikaObj *self){
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
return lv_obj_get_y(lv_obj);
|
||||
}
|
||||
|
||||
void pika_lvgl_lv_obj_set_pos(PikaObj *self, int x, int y){
|
||||
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
||||
lv_obj_set_pos(lv_obj, x, y);
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
#include "lvgl.h"
|
||||
#include "pika_lvgl_style_t.h"
|
||||
|
||||
void pika_lvgl_style_t_init(PikaObj* self) {
|
||||
lv_style_t* lv_style = obj_getPtr(self, "lv_style");
|
||||
lv_style_init(lv_style);
|
||||
}
|
||||
|
||||
void pika_lvgl_style_t_set_bg_color(PikaObj* self, PikaObj* color) {
|
||||
lv_style_t* lv_style = obj_getPtr(self, "lv_style");
|
||||
lv_color_t* lv_color = obj_getPtr(color, "lv_color");
|
||||
lv_style_set_bg_color(lv_style, *lv_color);
|
||||
}
|
||||
|
||||
void pika_lvgl_style_t_set_bg_opa(PikaObj* self, int opa) {
|
||||
lv_style_t* lv_style = obj_getPtr(self, "lv_style");
|
||||
lv_style_set_bg_opa(lv_style, opa);
|
||||
}
|
||||
|
||||
void pika_lvgl_style_t_set_outline_color(PikaObj* self, PikaObj* color) {
|
||||
lv_style_t* lv_style = obj_getPtr(self, "lv_style");
|
||||
lv_color_t* lv_color = obj_getPtr(color, "lv_color");
|
||||
lv_style_set_outline_color(lv_style, *lv_color);
|
||||
}
|
||||
|
||||
void pika_lvgl_style_t_set_outline_pad(PikaObj* self, int pad) {
|
||||
lv_style_t* lv_style = obj_getPtr(self, "lv_style");
|
||||
lv_style_set_outline_pad(lv_style, pad);
|
||||
}
|
||||
|
||||
void pika_lvgl_style_t_set_outline_width(PikaObj* self, int w) {
|
||||
lv_style_t* lv_style = obj_getPtr(self, "lv_style");
|
||||
lv_style_set_outline_width(lv_style, w);
|
||||
}
|
||||
|
||||
void pika_lvgl_style_t_set_radius(PikaObj* self, int radius) {
|
||||
lv_style_t* lv_style = obj_getPtr(self, "lv_style");
|
||||
lv_style_set_radius(lv_style, radius);
|
||||
}
|
||||
|
||||
void pika_lvgl_style_t___init__(PikaObj* self) {
|
||||
lv_style_t lv_style_stack = {0};
|
||||
args_setStruct(self->list, "lv_style_struct", lv_style_stack);
|
||||
lv_style_t* lv_style = args_getStruct(self->list, "lv_style_struct");
|
||||
obj_setPtr(self, "lv_style", lv_style);
|
||||
}
|
||||
|
||||
void pika_lvgl_style_t_set_shadow_color(PikaObj *self, PikaObj* color){
|
||||
lv_style_t* lv_style = obj_getPtr(self, "lv_style");
|
||||
lv_color_t* lv_color = obj_getPtr(color, "lv_color");
|
||||
lv_style_set_shadow_color(lv_style, *lv_color);
|
||||
}
|
||||
|
||||
void pika_lvgl_style_t_set_shadow_spread(PikaObj *self, int s){
|
||||
lv_style_t* lv_style = obj_getPtr(self, "lv_style");
|
||||
lv_style_set_shadow_spread(lv_style, s);
|
||||
}
|
||||
|
||||
void pika_lvgl_style_t_set_shadow_width(PikaObj *self, int w){
|
||||
lv_style_t* lv_style = obj_getPtr(self, "lv_style");
|
||||
lv_style_set_shadow_width(lv_style, w);
|
||||
}
|
@ -1,2 +1,3 @@
|
||||
pikascript-core==v1.10.0
|
||||
PikaStdLib==v1.10.0
|
||||
pikascript-core==v1.10.3
|
||||
PikaStdLib==v1.10.3
|
||||
pika_lvgl==v0.2.0
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user