summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/core_bind.cpp5
-rw-r--r--core/core_bind.h1
-rw-r--r--core/extension/gdnative_interface.h1
-rw-r--r--core/extension/native_extension.cpp1
-rw-r--r--core/extension/native_extension.h9
-rw-r--r--core/os/os.h1
6 files changed, 11 insertions, 7 deletions
diff --git a/core/core_bind.cpp b/core/core_bind.cpp
index 0f0b8ed63f..7c3cbfe48d 100644
--- a/core/core_bind.cpp
+++ b/core/core_bind.cpp
@@ -269,6 +269,10 @@ Error OS::kill(int p_pid) {
return ::OS::get_singleton()->kill(p_pid);
}
+bool OS::is_process_running(int p_pid) const {
+ return ::OS::get_singleton()->is_process_running(p_pid);
+}
+
int OS::get_process_id() const {
return ::OS::get_singleton()->get_process_id();
}
@@ -571,6 +575,7 @@ void OS::_bind_methods() {
ClassDB::bind_method(D_METHOD("create_instance", "arguments"), &OS::create_instance);
ClassDB::bind_method(D_METHOD("kill", "pid"), &OS::kill);
ClassDB::bind_method(D_METHOD("shell_open", "uri"), &OS::shell_open);
+ ClassDB::bind_method(D_METHOD("is_process_running", "pid"), &OS::is_process_running);
ClassDB::bind_method(D_METHOD("get_process_id"), &OS::get_process_id);
ClassDB::bind_method(D_METHOD("get_environment", "variable"), &OS::get_environment);
diff --git a/core/core_bind.h b/core/core_bind.h
index f6f2791006..76313dc1a8 100644
--- a/core/core_bind.h
+++ b/core/core_bind.h
@@ -173,6 +173,7 @@ public:
Error kill(int p_pid);
Error shell_open(String p_uri);
+ bool is_process_running(int p_pid) const;
int get_process_id() const;
bool has_environment(const String &p_var) const;
diff --git a/core/extension/gdnative_interface.h b/core/extension/gdnative_interface.h
index ad4c8917df..4d2682b253 100644
--- a/core/extension/gdnative_interface.h
+++ b/core/extension/gdnative_interface.h
@@ -556,7 +556,6 @@ typedef enum {
GDNATIVE_INITIALIZATION_CORE,
GDNATIVE_INITIALIZATION_SERVERS,
GDNATIVE_INITIALIZATION_SCENE,
- GDNATIVE_INITIALIZATION_DRIVER,
GDNATIVE_INITIALIZATION_EDITOR,
GDNATIVE_MAX_INITIALIZATION_LEVEL,
} GDNativeInitializationLevel;
diff --git a/core/extension/native_extension.cpp b/core/extension/native_extension.cpp
index 5c02cb9190..441bdd2ac4 100644
--- a/core/extension/native_extension.cpp
+++ b/core/extension/native_extension.cpp
@@ -334,7 +334,6 @@ void NativeExtension::_bind_methods() {
BIND_ENUM_CONSTANT(INITIALIZATION_LEVEL_CORE);
BIND_ENUM_CONSTANT(INITIALIZATION_LEVEL_SERVERS);
BIND_ENUM_CONSTANT(INITIALIZATION_LEVEL_SCENE);
- BIND_ENUM_CONSTANT(INITIALIZATION_LEVEL_DRIVER);
BIND_ENUM_CONSTANT(INITIALIZATION_LEVEL_EDITOR);
}
diff --git a/core/extension/native_extension.h b/core/extension/native_extension.h
index 028a627b2e..af5a474e79 100644
--- a/core/extension/native_extension.h
+++ b/core/extension/native_extension.h
@@ -70,11 +70,10 @@ public:
void close_library();
enum InitializationLevel {
- INITIALIZATION_LEVEL_CORE,
- INITIALIZATION_LEVEL_SERVERS,
- INITIALIZATION_LEVEL_SCENE,
- INITIALIZATION_LEVEL_DRIVER,
- INITIALIZATION_LEVEL_EDITOR,
+ INITIALIZATION_LEVEL_CORE = GDNATIVE_INITIALIZATION_CORE,
+ INITIALIZATION_LEVEL_SERVERS = GDNATIVE_INITIALIZATION_SERVERS,
+ INITIALIZATION_LEVEL_SCENE = GDNATIVE_INITIALIZATION_SCENE,
+ INITIALIZATION_LEVEL_EDITOR = GDNATIVE_INITIALIZATION_EDITOR
};
bool is_library_open() const;
diff --git a/core/os/os.h b/core/os/os.h
index a7cf3f1679..5eac77d634 100644
--- a/core/os/os.h
+++ b/core/os/os.h
@@ -152,6 +152,7 @@ public:
virtual Error create_instance(const List<String> &p_arguments, ProcessID *r_child_id = nullptr) { return create_process(get_executable_path(), p_arguments, r_child_id); };
virtual Error kill(const ProcessID &p_pid) = 0;
virtual int get_process_id() const;
+ virtual bool is_process_running(const ProcessID &p_pid) const = 0;
virtual void vibrate_handheld(int p_duration_ms = 500);
virtual Error shell_open(String p_uri);