3 #include <cgv/base/base.h>
4 #include <cgv/signal/signal.h>
5 #include <cgv/data/ref_counted.h>
11 #include "application.h"
12 #include "text_editor.h"
13 #include "lib_begin.h"
24 virtual bool enumerate_monitors(std::vector<monitor_description>& monitor_descriptions);
37 virtual bool run() = 0;
39 virtual void quit(
int exit_code) = 0;
48 virtual int question(
const std::string& _question,
const std::vector<std::string>& answers,
int default_answer = -1) = 0;
52 virtual bool query(
const std::string&
question, std::string& text,
bool password =
false) = 0;
56 virtual std::string
files_open_dialog(std::vector<std::string>& file_names,
const std::string& title,
const std::string& filter,
const std::string& path) = 0;
58 virtual std::string
file_open_dialog(
const std::string& title,
const std::string& filter,
const std::string& path) = 0;
60 virtual std::string
file_save_dialog(
const std::string& title,
const std::string& filter,
const std::string& path) = 0;
78 virtual void sleep(
float time_in_seconds) = 0;
83 virtual bool process_gui_file(
const std::string& file_name) = 0;
88 virtual base_ptr
add_decorator(
gui_group_ptr parent,
const std::string& label,
const std::string& decorator_type,
const std::string& options,
const std::string& align) = 0;
92 virtual view_ptr add_view(
gui_group_ptr parent,
const std::string& label,
const void* value_ptr,
const std::string& value_type,
const std::string& gui_type,
const std::string& options,
const std::string& align) = 0;
103 virtual base_ptr add_menu_separator(
const std::string& menu_path) = 0;
137 #include <cgv/config/lib_end.h>
virtual std::string get_wakeup_message()=0
return the message send by the thread that woke up the main thread with wake()
virtual void copy_to_clipboard(const std::string &s)=0
copy text to the clipboard
virtual void wake(const std::string &message="")=0
wake main thread.
virtual unsigned int get_nr_windows()=0
return the number of created windows
virtual std::string paste_from_clipboard()=0
retreive text from clipboard
type independent base class of control provider interface
Definition: control.h:37
int question(const std::string &_question, const std::vector< std::string > &answers, int default_answer)
ask the user with question to select one of the answers, where default_answer specifies index of defa...
Definition: dialog.cxx:24
gui_driver_ptr get_gui_driver()
return the currently registered gui driver or an empty pointer if non has been registered
Definition: gui_driver.cxx:18
virtual button_ptr add_button(gui_group_ptr parent, const std::string &label, const std::string &options, const std::string &align)=0
add new button to the parent group
virtual bool set_focus(const_window_ptr)=0
set the input focus to the given window
virtual void sleep(float time_in_seconds)=0
let the main thread sleep for the given number of seconds
virtual void lock()=0
lock the main thread of the gui from a child thread before any gui specific call.
virtual control_ptr add_control(gui_group_ptr parent, const std::string &label, void *value_ptr, abst_control_provider *acp, const std::string &value_type, const std::string &gui_type, const std::string &options, const std::string &align)=0
add new control to the parent group
abstract base class for gui drivers
Definition: gui_driver.h:20
virtual base_ptr find_menu_element(const std::string &menu_path) const =0
return the element of the given menu path
virtual window_ptr get_window(unsigned int i)=0
return the i-th created window
virtual view_ptr find_view(gui_group_ptr parent, const void *value_ptr, int *idx_ptr)=0
find a view in the group
virtual void remove_window(window_ptr w)=0
remove a window that has been destroyed
virtual bool run()=0
run the main loop of the window system
void message(const std::string &_message)
tell the user something with a message box
Definition: dialog.cxx:14
void register_gui_driver(gui_driver_ptr _driver)
register a new gui driver.
Definition: gui_driver.cxx:23
virtual std::string file_save_dialog(const std::string &title, const std::string &filter, const std::string &path)=0
ask user for a file to save
virtual text_editor_ptr create_text_editor(unsigned int w, unsigned int h, const std::string &title, int x, int y)=0
create a text editor
cgv::signal::signal< gui_driver_ptr > & on_gui_driver_registration()
a signal that is emitted when a gui driver is registered
Definition: gui_driver.cxx:30
virtual std::string file_open_dialog(const std::string &title, const std::string &filter, const std::string &path)=0
ask user for a file to open
virtual void unlock()=0
unlock the main thread
virtual void remove_menu_element(base_ptr)=0
remove a single element from the gui
interfaces that add several listeners and objects.
Definition: register.h:208
virtual void quit(int exit_code)=0
quit the application by closing all windows
virtual bool query(const std::string &question, std::string &text, bool password=false)=0
query the user for a text, where the second parameter is the default text as well as the returned tex...
virtual std::string files_open_dialog(std::vector< std::string > &file_names, const std::string &title, const std::string &filter, const std::string &path)=0
ask user for an open dialog that can select multiple files, return common path prefix and fill field ...
virtual button_ptr add_menu_button(const std::string &menu_path, const std::string &options)=0
use the current gui driver to append a new button in the menu, where menu path is a '/' separated pat...
virtual control_ptr find_control(gui_group_ptr parent, void *value_ptr, int *idx_ptr)=0
find a control in a group
virtual base_ptr add_decorator(gui_group_ptr parent, const std::string &label, const std::string &decorator_type, const std::string &options, const std::string &align)=0
add a newly created decorator to the parent group
virtual data::ref_ptr< control< bool > > add_menu_bool_control(const std::string &menu_path, bool &value, const std::string &options)=0
use this to add a new control to the gui with a given value type, gui type and init options
data::ref_ptr< gui_driver > gui_driver_ptr
ref counted pointer to driver
Definition: gui_driver.h:117
virtual view_ptr add_view(gui_group_ptr parent, const std::string &label, const void *value_ptr, const std::string &value_type, const std::string &gui_type, const std::string &options, const std::string &align)=0
add new view to the parent group
the cgv namespace
Definition: vr_calib.cxx:9
virtual gui_group_ptr add_group(gui_group_ptr parent, const std::string &label, const std::string &group_type, const std::string &options, const std::string &align)=0
add a new gui group to the given parent group
virtual window_ptr create_window(int w, int h, const std::string &title, const std::string &window_type)=0
create a window of the given type. Currently only the types "viewer with gui", "viewer" and "gui" are...