cgv
Loading...
Searching...
No Matches
cgv::gui::application Class Reference

the application class is only a container for static methods that give access to the windows of the application More...

#include <application.h>

Static Public Member Functions

static bool enumerate_monitors (std::vector< monitor_description > &monitor_descriptions)
 fill the passed vector with a list of all monitors descriptions; returns false if no gui driver is available
 
static window_ptr create_window (int w, int h, const std::string &title, const std::string &window_type="viewer")
 create a window of the given type, where all gui implementations must support the type "viewer"
 
static bool remove_window (window_ptr w)
 remove a window from the application's list of windows
 
static bool set_focus (const_window_ptr)
 set the input focus to the given window
 
static unsigned int get_nr_windows ()
 return the number of created windows
 
static window_ptr get_window (unsigned int i)
 return the i-th created window
 
static bool run ()
 run the main loop of the window system
 
static void quit (int exit_code=0)
 quit the application by closing all windows
 
static void copy_to_clipboard (const std::string &s)
 copy text to the clipboard
 
static std::string paste_from_clipboard ()
 retreive text from clipboard
 

Detailed Description

the application class is only a container for static methods that give access to the windows of the application

Definition at line 23 of file application.h.

Member Function Documentation

◆ copy_to_clipboard()

void cgv::gui::application::copy_to_clipboard ( const std::string &  s)
static

copy text to the clipboard

Definition at line 77 of file application.cxx.

References cgv::data::ref_ptr< T, is_ref_counted >::empty(), and cgv::gui::get_gui_driver().

◆ create_window()

window_ptr cgv::gui::application::create_window ( int  w,
int  h,
const std::string &  title,
const std::string &  window_type = "viewer" 
)
static

create a window of the given type, where all gui implementations must support the type "viewer"

Definition at line 16 of file application.cxx.

References cgv::gui::get_gui_driver().

Referenced by cgv::gui::dialog::dialog(), and cgv::gui::dialog::dialog().

◆ enumerate_monitors()

bool cgv::gui::application::enumerate_monitors ( std::vector< monitor_description > &  monitor_descriptions)
static

fill the passed vector with a list of all monitors descriptions; returns false if no gui driver is available

Definition at line 9 of file application.cxx.

References cgv::gui::get_gui_driver().

◆ get_nr_windows()

unsigned int cgv::gui::application::get_nr_windows ( )
static

return the number of created windows

Definition at line 39 of file application.cxx.

References cgv::data::ref_ptr< T, is_ref_counted >::empty(), and cgv::gui::get_gui_driver().

◆ get_window()

window_ptr cgv::gui::application::get_window ( unsigned int  i)
static

return the i-th created window

Definition at line 47 of file application.cxx.

References cgv::gui::get_gui_driver().

Referenced by cgv::gui::connect_gamepad_server(), and cgv::gui::connect_vr_server().

◆ paste_from_clipboard()

std::string cgv::gui::application::paste_from_clipboard ( )
static

retreive text from clipboard

Definition at line 86 of file application.cxx.

References cgv::data::ref_ptr< T, is_ref_counted >::empty(), and cgv::gui::get_gui_driver().

◆ quit()

void cgv::gui::application::quit ( int  exit_code = 0)
static

quit the application by closing all windows

Definition at line 68 of file application.cxx.

References cgv::data::ref_ptr< T, is_ref_counted >::empty(), and cgv::gui::get_gui_driver().

◆ remove_window()

bool cgv::gui::application::remove_window ( window_ptr  w)
static

remove a window from the application's list of windows

Definition at line 23 of file application.cxx.

References cgv::gui::get_gui_driver().

◆ run()

bool cgv::gui::application::run ( )
static

run the main loop of the window system

Definition at line 54 of file application.cxx.

References cgv::data::ref_ptr< T, is_ref_counted >::empty(), and cgv::gui::get_gui_driver().

◆ set_focus()

bool cgv::gui::application::set_focus ( const_window_ptr  w)
static

set the input focus to the given window

Definition at line 31 of file application.cxx.

References cgv::data::ref_ptr< T, is_ref_counted >::empty(), and cgv::gui::get_gui_driver().


The documentation for this class was generated from the following files: