summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--Comm/herror.hxx1
-rw-r--r--Comm/newstd.hxx105
-rw-r--r--Kernel/KernelKit/DebugOutput.hpp4
-rw-r--r--Kernel/KernelKit/HError.hpp1
-rw-r--r--Kernel/Sources/FS/NewFS.cxx2
5 files changed, 42 insertions, 71 deletions
diff --git a/Comm/herror.hxx b/Comm/herror.hxx
index 7138055a..bad6f50c 100644
--- a/Comm/herror.hxx
+++ b/Comm/herror.hxx
@@ -42,6 +42,7 @@ inline constexpr HError kErrorInvalidData = 56;
inline constexpr HError kErrorAsync = 57;
inline constexpr HError kErrorNonBlocking = 58;
inline constexpr HError kErrorIPC = 59;
+inline constexpr HError kErrorSign = 60;
inline constexpr HError kErrorUnimplemented = 0;
inline HError kLastError = 0;
diff --git a/Comm/newstd.hxx b/Comm/newstd.hxx
index 51216296..38190f2e 100644
--- a/Comm/newstd.hxx
+++ b/Comm/newstd.hxx
@@ -3,7 +3,7 @@
Copyright Zeta Electronics Corporation.
File: newstd.hxx.
-Purpose: NewOS standard system call interface.
+Purpose: System Call Interface.
------------------------------------------- */
@@ -44,95 +44,66 @@ typedef __INT32_TYPE__ SInt32;
typedef __INT16_TYPE__ SInt16;
typedef __INT8_TYPE__ SInt8;
-typedef char UTFChar;
+typedef char UTFChar;
/**
- @brief Standard library class.
+ @brief Application class.
*/
-class NUser final
+class NApplication
{
public:
- // THOSE REQUIRES PERMISSIONS FROM THE USER. //
+ explicit NApplication() = default;
+ virtual ~NApplication() = default;
- static UInt0 Poweroff();
- static UInt0 Reboot();
- static Bool IsWokeup();
+ typedef UInt32 MBCIType;
- // THOSE DOESNT REQUIRE PERMISSIONS FROM THE USER. //
-
- static UInt0 Terminate();
- static Bool Exit(OSType code);
- static UInt0* New(long long sz);
- static UInt0 Delete(void* ptr);
-
- // ASK FOR ELEVATION //
-
- static Bool RaiseUAC();
-
- // THOSE MAY REQUIRE PERMISSIONS FROM THE USER. //
-
- static OSType Open(const char* path, const char* restr);
- static UInt0 Close(OSType descriptorType);
- static NURL* Execute(const NURL* command);
- static UInt0* Read(const UTFChar* cmdNameOrData, SizeT cmdSize, OSType descriptorType);
- static UInt0* Write(const UTFChar* cmdNameOrData, SizeT cmdSize, OSType descriptorType);
-};
-
-/**
-@brief Class which exposes the app alert API.
-*/
-class NWindowAlert
-{
public:
- explicit NWindowAlert() = default;
- virtual ~NWindowAlert() = default;
+ /// @brief disable device.
+ UInt0 PowerOff(MBCIType);
-public:
- /// @brief Opens an alert dialog.
- virtual NWindowAlert* Alert(const char* message, const char* title) = 0;
+ /// @brief enable device.
+ UInt0 PowerOn(MBCIType);
- /// @brief Makes a prompt dialog.
- virtual NWindowAlert* Prompt(const char* message, const char* title) = 0;
+ /// @brief reboot device.
+ UInt0 PowerReboot(MBCIType);
- /// @brief Makes a prompt notification dialog.
- virtual NWindowAlert* PromptNotification(const char* message, const char* title) = 0;
+ /// @brief check if MBCI device is wokeup.
+ Bool PowerIsWokeup(MBCIType);
- /// @brief Makes a notification dialog.
- virtual NWindowAlert* Notification(const char* message, const char* title) = 0;
+ /// @brief probe MBCI device from phone.
+ MBCIType PowerProbeDevice(const char* namepace, const int index);
- /// Collect result of prompt/notification.
- virtual NWindowAlert* Collect(const char* resultBuf, long resultBufSz) = 0;
+ // THOSE DOESNT REQUIRE PERMISSIONS FROM THE USER. //
-public:
- Bool fAsyncOperationMode;
- NWindowCallback fAsyncOnComplete;
-};
+ /// @brief terminate app.
+ virtual UInt0 AppTerminate() = 0;
-/// @brief Window object.
-class NWindow
-{
-public:
- explicit NWindow() = default;
- virtual ~NWindow() = default;
+ /// @brief exit thread.
+ virtual Bool ThreadExit(OSType code) = 0;
-public:
- virtual NWindow* New(const char* pageName) = 0;
+ /// @brief alloc pointer.
+ virtual UInt0* ProcessNew(long long sz) = 0;
- virtual NWindow* Ref(NWindow* pagee) = 0;
+ /// @brief free pointer.
+ virtual UInt0 ProcessDelete(void* ptr) = 0;
- virtual NWindow* Text(const char* text) = 0;
+ // THOSE MAY REQUIRE PERMISSIONS FROM THE USER. //
- virtual NWindow* Button(const char* text, NWindowCallback onClick = nullptr, NWindowCallback onDblClick = nullptr) = 0;
+ /// @brief Open descriptor.
+ virtual OSType OpenStorage(const char* path, const char* restr) = 0;
- virtual NWindow* Checkbox(const char* text, NWindowCallback onSelect = nullptr, NWindowCallback onUnselect = nullptr) = 0;
+ /// @brief Close descriptor.
+ virtual UInt0 CloseStorage(OSType descriptorType) = 0;
- virtual NWindow* Radio(const char* text, NWindowCallback onSelect = nullptr, NWindowCallback onUnselect = nullptr) = 0;
+ /// @brief Execute from shell.
+ virtual NURL* URLExecute(const NURL* shell) = 0;
- virtual NWindow* Link(const char* where, const char* textIfAny = "", NWindowCallback onClick = nullptr, NWindowCallback onHover = nullptr) = 0;
+ /// @brief Read descriptor.
+ virtual UInt0* ReadStorage(const UTFChar* cmdNameOrData, SizeT cmdSize, OSType descriptorType) = 0;
+
+ /// @brief Write descriptor.
+ virtual UInt0* WriteStorage(const UTFChar* cmdNameOrData, SizeT cmdSize, OSType descriptorType) = 0;
-public:
- Bool fWindowEnabled;
- void* fWindowDataPtr;
};
/**
diff --git a/Kernel/KernelKit/DebugOutput.hpp b/Kernel/KernelKit/DebugOutput.hpp
index 05865661..a3c01341 100644
--- a/Kernel/KernelKit/DebugOutput.hpp
+++ b/Kernel/KernelKit/DebugOutput.hpp
@@ -42,9 +42,7 @@ namespace NewOS
{
}
- virtual ~TerminalDevice()
- {
- }
+ virtual ~TerminalDevice() = default;
TerminalDevice& Number(const Long Data) noexcept
{
diff --git a/Kernel/KernelKit/HError.hpp b/Kernel/KernelKit/HError.hpp
index 528c3542..e893f938 100644
--- a/Kernel/KernelKit/HError.hpp
+++ b/Kernel/KernelKit/HError.hpp
@@ -47,6 +47,7 @@ namespace NewOS
inline constexpr HError kErrorAsync = 57;
inline constexpr HError kErrorNonBlocking = 58;
inline constexpr HError kErrorIPC = 59;
+ inline constexpr HError kErrorSign = 60;
inline constexpr HError kErrorUnimplemented = 0;
Void err_bug_check_raise(void) noexcept;
diff --git a/Kernel/Sources/FS/NewFS.cxx b/Kernel/Sources/FS/NewFS.cxx
index 79121018..63aa598e 100644
--- a/Kernel/Sources/FS/NewFS.cxx
+++ b/Kernel/Sources/FS/NewFS.cxx
@@ -520,7 +520,7 @@ bool NewFSParser::Format(_Input _Output DriveTrait* drive)
return true;
}
- kcout << "newoskrnl: PartitionBlock already exists.\r";
+ kcout << "newoskrnl: partition block already exists.\r";
/// return success as well, do not ignore that partition.
return true;