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"
25 virtual bool enumerate_monitors(std::vector<monitor_description>& monitor_descriptions);
39 virtual bool run() = 0;
41 virtual void quit(
int exit_code) = 0;
51 virtual void message(
const std::string& _message) = 0;
53 virtual int question(
const std::string& _question,
const std::vector<std::string>& answers,
int default_answer = -1) = 0;
56 virtual bool query(
const std::string&
question, std::string& text,
bool password =
false) = 0;
60 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;
62 virtual std::string
file_open_dialog(
const std::string& title,
const std::string& filter,
const std::string& path) = 0;
64 virtual std::string
file_save_dialog(
const std::string& title,
const std::string& filter,
const std::string& path) = 0;
82 virtual void sleep(
float time_in_seconds) = 0;
96 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;
141#include <cgv/config/lib_end.h>
base class for all classes that can be registered with support for dynamic properties (see also secti...
reference counted pointer, which can work together with types that are derived from ref_counted,...
abstract base class for gui drivers
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...
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
virtual void unlock()=0
unlock the main thread
virtual void copy_to_clipboard(const std::string &s)=0
copy text to the clipboard
virtual void remove_menu_element(cgv::base::base_ptr)=0
remove a single element from the gui
virtual void lock()=0
lock the main thread of the gui from a child thread before any gui specific call.
virtual int question(const std::string &_question, const std::vector< std::string > &answers, int default_answer=-1)=0
ask the user with _question to select one of the answers, where default_answer specifies index of def...
virtual cgv::base::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 unsigned int get_nr_windows()=0
return the number of created windows
virtual void remove_window(window_ptr w)=0
remove a window that has been destroyed
virtual std::string get_wakeup_message()=0
return the message send by the thread that woke up the main thread with wake()
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
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 window_ptr get_window(unsigned int i)=0
return the i-th created window
virtual void destroy_all_windows()=0
destroy every window, releasing all their resources.
virtual cgv::base::base_ptr add_menu_separator(const std::string &menu_path)=0
add a newly created decorator to the menu
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 control_ptr find_control(gui_group_ptr parent, void *value_ptr, int *idx_ptr)=0
find a control in a group
virtual void wake(const std::string &message="")=0
wake main thread.
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 cgv::base::base_ptr find_menu_element(const std::string &menu_path) const =0
return the element of the given menu path
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
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
virtual bool process_gui_file(const std::string &file_name)=0
process the gui declarations in the given gui file
virtual bool set_focus(const_window_ptr)=0
set the input focus to the given window
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 void sleep(float time_in_seconds)=0
let the main thread sleep for the given number of seconds
virtual void quit(int exit_code)=0
quit the application by closing all windows
virtual void message(const std::string &_message)=0
show the user a _message that can be dismissed with the answer
virtual bool enumerate_monitors(std::vector< monitor_description > &monitor_descriptions)
fill list of monitor descriptions
virtual bool run()=0
run the main loop of the window system
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 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 std::string paste_from_clipboard()=0
retreive text from clipboard
virtual view_ptr find_view(gui_group_ptr parent, const void *value_ptr, int *idx_ptr)=0
find a view in the group
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...
data::ref_ptr< base, true > base_ptr
ref counted pointer to base
namespace that holds the abstract gui interface
data::ref_ptr< window > window_ptr
ref counted pointer to &window
data::ref_ptr< gui_group, true > gui_group_ptr
ref counted pointer to a gui group
cgv::signal::signal< gui_driver_ptr > & on_gui_driver_registration()
a signal that is emitted when a gui driver is registered
gui_driver_ptr get_gui_driver()
return the currently registered gui driver or an empty pointer if non has been registered
void register_gui_driver(gui_driver_ptr _driver)
register a new gui driver.
data::ref_ptr< text_editor > text_editor_ptr
ref counted pointer to abst control
data::ref_ptr< const window > const_window_ptr
ref counted pointer to const window
data::ref_ptr< button > button_ptr
ref counted pointer to button
data::ref_ptr< abst_view > view_ptr
ref counted pointer to abst view
data::ref_ptr< gui_driver > gui_driver_ptr
ref counted pointer to driver
data::ref_ptr< abst_control > control_ptr
ref counted pointer to abst control
this header is dependency free
interfaces that add several listeners and objects.
type independent base class of control provider interface