Struct renga_api_rs::Application
source · pub struct Application { /* private fields */ }Expand description
Represents entire Renga application.
Currently, you can obtain instance of this struct only by using Application::new or Application::new_hidden methods. Accessing running instances of Renga is still in development.
Implementations§
source§impl Application
impl Application
sourcepub fn new() -> Result<Self>
pub fn new() -> Result<Self>
Creates new instance of Renga application1.
./RengaProfessional.exe /regserver
If your Renga distribution comes from official installer, you can skip this step - Renga will be automatically registered.
Renga must be registered in Windows registry for this method to work. You can do it by launching powershell as administrator in Renga folder and running the following command: ↩
Creates new headless instance of Renga application.
The ability to launch Renga without a GUI is advantageous for testing purposes. Actually, this crate using this feature for self-testing!
See Application::new
sourcepub fn quit(&mut self)
pub fn quit(&mut self)
Closes Renga application.
This method will not fail. If any error occurs, it will be logged.
sourcepub fn visible(&self) -> Result<bool>
pub fn visible(&self) -> Result<bool>
Returns true, if user interface is visible in this instance.
sourcepub fn set_enabled(&mut self, value: bool) -> Result<&mut Self>
pub fn set_enabled(&mut self, value: bool) -> Result<&mut Self>
Sets user input to be enabled or disabled in this instance.
sourcepub fn set_visible(&mut self, value: bool) -> Result<&mut Self>
pub fn set_visible(&mut self, value: bool) -> Result<&mut Self>
Sets user interface to be visible or hidden in this instance.
sourcepub fn project(&mut self) -> Result<Option<Project>>
pub fn project(&mut self) -> Result<Option<Project>>
Returns currently active project.
Can be None if there is no active project opened.
You can create new project by calling Application::new_project or open existing project by calling Application::open_project.
sourcepub fn new_project(&mut self) -> Result<Project>
pub fn new_project(&mut self) -> Result<Project>
Creates new project.
Can return error in the following cases:
- crate::Error::AlreadyOpened: Project is already opened;
- crate::Error::Internal: Internal error happened;
sourcepub fn open_project(&mut self, path: &Path) -> Result<Project>
pub fn open_project(&mut self, path: &Path) -> Result<Project>
Opens existing project from given path.
Can return error in the following cases:
- crate::Error::NonexistentPath: Project path is invalid;
- crate::Error::AlreadyOpened: Project is already opened;
- crate::Error::Internal: Internal error happened;
sourcepub fn native_window_handle(&self) -> Result<HWND>
pub fn native_window_handle(&self) -> Result<HWND>
Returns native handle of the main window.