📄 api.h
字号:
#define _fnum_graphicClearArea 11018#define _fnum_graphicRenderBuffer 11019// Windowing system functions. All are in the 12000-12999 range#define _fnum_windowLogin 12000#define _fnum_windowLogout 12001#define _fnum_windowNew 12002#define _fnum_windowNewDialog 12003#define _fnum_windowDestroy 12004#define _fnum_windowUpdateBuffer 12005#define _fnum_windowSetTitle 12006#define _fnum_windowGetSize 12007#define _fnum_windowSetSize 12008#define _fnum_windowGetLocation 12009#define _fnum_windowSetLocation 12010#define _fnum_windowCenter 12011#define _fnum_windowSnapIcons 12012#define _fnum_windowSetHasBorder 12013#define _fnum_windowSetHasTitleBar 12014#define _fnum_windowSetMovable 12015#define _fnum_windowSetResizable 12016#define _fnum_windowRemoveMinimizeButton 12017#define _fnum_windowRemoveCloseButton 12018#define _fnum_windowSetColors 12019#define _fnum_windowSetVisible 12020#define _fnum_windowSetMinimized 12021 #define _fnum_windowAddConsoleTextArea 12022#define _fnum_windowRedrawArea 12023#define _fnum_windowDrawAll 12024#define _fnum_windowResetColors 12025#define _fnum_windowProcessEvent 12026#define _fnum_windowComponentEventGet 12027#define _fnum_windowTileBackground 12028#define _fnum_windowCenterBackground 12029#define _fnum_windowScreenShot 12030#define _fnum_windowSaveScreenShot 12031#define _fnum_windowSetTextOutput 12032#define _fnum_windowLayout 12033#define _fnum_windowDebugLayout 12034#define _fnum_windowContextAdd 12035#define _fnum_windowContextSet 12036#define _fnum_windowSwitchPointer 12037#define _fnum_windowComponentDestroy 12038#define _fnum_windowComponentSetVisible 12039#define _fnum_windowComponentSetEnabled 12040#define _fnum_windowComponentGetWidth 12041#define _fnum_windowComponentSetWidth 12042#define _fnum_windowComponentGetHeight 12043#define _fnum_windowComponentSetHeight 12044#define _fnum_windowComponentFocus 12045#define _fnum_windowComponentDraw 12046#define _fnum_windowComponentGetData 12047#define _fnum_windowComponentSetData 12048#define _fnum_windowComponentGetSelected 12049#define _fnum_windowComponentSetSelected 12050#define _fnum_windowNewButton 12051#define _fnum_windowNewCanvas 12052#define _fnum_windowNewCheckbox 12053#define _fnum_windowNewContainer 12054#define _fnum_windowNewIcon 12055#define _fnum_windowNewImage 12056#define _fnum_windowNewList 12057#define _fnum_windowNewListItem 12058#define _fnum_windowNewMenu 12059#define _fnum_windowNewMenuBar 12060#define _fnum_windowNewMenuItem 12061#define _fnum_windowNewPasswordField 12062#define _fnum_windowNewProgressBar 12063#define _fnum_windowNewRadioButton 12064#define _fnum_windowNewScrollBar 12065#define _fnum_windowNewSlider 12066#define _fnum_windowNewTextArea 12067#define _fnum_windowNewTextField 12068#define _fnum_windowNewTextLabel 12069// User functions. All are in the 13000-13999 range#define _fnum_userAuthenticate 13000#define _fnum_userLogin 13001#define _fnum_userLogout 13002#define _fnum_userGetNames 13003#define _fnum_userAdd 13004#define _fnum_userDelete 13005#define _fnum_userSetPassword 13006#define _fnum_userGetPrivilege 13007#define _fnum_userGetPid 13008#define _fnum_userSetPid 13009#define _fnum_userFileAdd 13010#define _fnum_userFileDelete 13011#define _fnum_userFileSetPassword 13012// Network functions. All are in the 14000-14999 range#define _fnum_networkDeviceGetCount 14000#define _fnum_networkDeviceGet 14001#define _fnum_networkInitialized 14002#define _fnum_networkInitialize 14003#define _fnum_networkShutdown 14004#define _fnum_networkOpen 14005#define _fnum_networkClose 14006#define _fnum_networkCount 14007#define _fnum_networkRead 14008#define _fnum_networkWrite 14009#define _fnum_networkPing 14010#define _fnum_networkGetHostName 14011#define _fnum_networkSetHostName 14012#define _fnum_networkGetDomainName 14013#define _fnum_networkSetDomainName 14014// Miscellaneous functions. All are in the 99000-99999 range#define _fnum_fontGetDefault 99000#define _fnum_fontSetDefault 99001#define _fnum_fontLoad 99002#define _fnum_fontGetPrintedWidth 99003#define _fnum_fontGetWidth 99004#define _fnum_fontGetHeight 99005#define _fnum_imageLoad 99006#define _fnum_imageSave 99007#define _fnum_shutdown 99008#define _fnum_getVersion 99009#define _fnum_systemInfo 99010#define _fnum_encryptMD5 99011#define _fnum_lockGet 99012#define _fnum_lockRelease 99013#define _fnum_lockVerify 99014#define _fnum_variableListCreate 99015#define _fnum_variableListDestroy 99016#define _fnum_variableListGet 99017#define _fnum_variableListSet 99018#define _fnum_variableListUnset 99019#define _fnum_configurationReader 99020#define _fnum_configurationWriter 99021#define _fnum_keyboardGetMaps 99022#define _fnum_keyboardSetMap 99023#define _fnum_deviceTreeGetCount 99024#define _fnum_deviceTreeGetRoot 99025#define _fnum_deviceTreeGetChild 99026#define _fnum_deviceTreeGetNext 99027#define _fnum_mouseLoadPointer 99028// For convenience#define syscall_0(fnum, arg...) _syscall(fnum, 0, ##arg)#define syscall_1(fnum, arg...) _syscall(fnum, 1, ##arg)#define syscall_2(fnum, arg...) _syscall(fnum, 2, ##arg)#define syscall_3(fnum, arg...) _syscall(fnum, 3, ##arg)#define syscall_4(fnum, arg...) _syscall(fnum, 4, ##arg)#define syscall_5(fnum, arg...) _syscall(fnum, 5, ##arg)#define syscall_6(fnum, arg...) _syscall(fnum, 6, ##arg)#define syscall_7(fnum, arg...) _syscall(fnum, 7, ##arg)#define syscall_8(fnum, arg...) _syscall(fnum, 8, ##arg)#define syscall_9(fnum, arg...) _syscall(fnum, 9, ##arg)// These inline functions are used to call specific kernel functions. // There will be one of these for every API function.//// Text input/output functions//_X_ static inline objectKey textGetConsoleInput(void){ // Proto: kernelTextInputStream *kernelTextGetConsoleInput(void); // Desc : Returns a reference to the console input stream. This is where keyboard input goes by default. return ((objectKey) syscall_0(_fnum_textGetConsoleInput));}_X_ static inline int textSetConsoleInput(objectKey newStream){ // Proto: int kernelTextSetConsoleInput(kernelTextInputStream *); // Desc : Changes the console input stream. GUI programs can use this function to redirect input to a text area or text field, for example. return (syscall_1(_fnum_textSetConsoleInput, newStream));}_X_ static inline objectKey textGetConsoleOutput(void){ // Proto: kernelTextOutputStream *kernelTextGetConsoleOutput(void); // Desc : Returns a reference to the console output stream. This is where kernel logging output goes by default. return ((objectKey) syscall_0(_fnum_textGetConsoleOutput));}_X_ static inline int textSetConsoleOutput(objectKey newStream){ // Proto: int kernelTextSetConsoleOutput(kernelTextOutputStream *); // Desc : Changes the console output stream. GUI programs can use this function to redirect output to a text area or text field, for example. return (syscall_1(_fnum_textSetConsoleOutput, newStream));}_X_ static inline objectKey textGetCurrentInput(void){ // Proto: kernelTextInputStream *kernelTextGetCurrentInput(void); // Desc : Returns a reference to the input stream of the current process. This is where standard input (for example, from a getc() call) is received. return ((objectKey) syscall_0(_fnum_textGetCurrentInput));}_X_ static inline int textSetCurrentInput(objectKey newStream){ // Proto: int kernelTextSetCurrentInput(kernelTextInputStream *); // Desc : Changes the current input stream. GUI programs can use this function to redirect input to a text area or text field, for example. return (syscall_1(_fnum_textSetCurrentInput, newStream));}_X_ static inline objectKey textGetCurrentOutput(void){ // Proto: kernelTextOutputStream *kernelTextGetCurrentOutput(void); // Desc : Returns a reference to the console output stream. return ((objectKey) syscall_0(_fnum_textGetCurrentOutput));}_X_ static inline int textSetCurrentOutput(objectKey newStream){ // Proto: int kernelTextSetCurrentOutput(kernelTextOutputStream *); // Desc : Changes the current output stream. This is where standard output (for example, from a putc() call) goes. return (syscall_1(_fnum_textSetCurrentOutput, newStream));}_X_ static inline int textGetForeground(color *foreground){ // Proto: int kernelTextGetForeground(color *); // Desc : Return the current foreground color in the color structure 'foreground'. return (syscall_1(_fnum_textGetForeground, foreground));}_X_ static inline int textSetForeground(color *foreground){ // Proto: int kernelTextSetForeground(color *); // Desc : Set the current foreground color to the one represented in the color structure 'foreground'. Some standard color values (as in PC text-mode values) can be found in <sys/color.h>. return (syscall_1(_fnum_textSetForeground, foreground));}_X_ static inline int textGetBackground(color *background){ // Proto: int kernelTextGetBackground(color *); // Desc : Return the current background color in the color structure 'background'. return (syscall_1(_fnum_textGetBackground, background));}_X_ static inline int textSetBackground(color *background){ // Proto: int kernelTextSetBackground(color *); // Desc : Set the current background color to the one represented in the color structure 'background'. Some standard color values (as in PC text-mode values) can be found in <sys/color.h>. return (syscall_1(_fnum_textSetBackground, background));}_X_ static inline int textPutc(int ascii){ // Proto: int kernelTextPutc(int); // Desc : Print a single character return (syscall_1(_fnum_textPutc, (void*)ascii));}_X_ static inline int textPrint(const char *str){ // Proto: int kernelTextPrint(const char *); // Desc : Print a string return (syscall_1(_fnum_textPrint, (void *) str));}_X_ static inline int textPrintAttrs(textAttrs *attrs, const char *str){ // Proto: int kernelTextPrintAttrs(textAttrs *, const char *, ...); // Desc : Print a string, with attributes. See <sys/text.h> for the definition of the textAttrs structure. return (syscall_2(_fnum_textPrintAttrs, attrs, (void *) str));}_X_ static inline int textPrintLine(const char *str){ // Proto: int kernelTextPrintLine(const char *); // Desc : Print a string with a newline at the end return (syscall_1(_fnum_textPrintLine, (void *) str));}_X_ static inline void textNewline(void){ // Proto: void kernelTextNewline(void); // Desc : Print a newline syscall_0(_fnum_textNewline);}_X_ static inline int textBackSpace(void){ // Proto: void kernelTextBackSpace(void);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -