Provides an abstract interface to an OpenGL rendering state. More...
#include <vgui_adaptor.h>
Public Member Functions | |
vgui_adaptor () | |
Constructor - create a default adaptor. | |
virtual | ~vgui_adaptor () |
Destructor - quits application if all adaptors have been deleted. | |
vgui_tableau_sptr | get_tableau () const |
Get the vgui_tableau associated with this vgui_adaptor. | |
void | set_tableau (vgui_tableau_sptr const &t) |
Set the vgui_tableau associated with this vgui_adaptor. | |
void | set_double_buffering (bool b) |
True to use double buffering, false to not use it. | |
vgui_menu | get_total_popup (vgui_popup_params &) const |
Return the concatenation of the adaptor's menu with the tableau's menu. | |
void | config_dialog () |
Pop up a dialog for changing the popup modifier and button bindings. | |
vgui_menu & | get_popup () |
Return the popup menu for this adaptor. | |
void | set_popup (vgui_menu const &m) |
Set the popup menu for this adaptor. | |
void | include_in_popup (vgui_menu const &m) |
Add the given menu to the popup menu for this adaptor. | |
bool | dispatch_to_tableau (vgui_event const &) |
Dispatches the given event to the tableau. | |
virtual unsigned | get_width () const =0 |
Return width of rendering area. | |
virtual unsigned | get_height () const =0 |
Return height of rendering area. | |
virtual void | post_timer (float, int) |
int | post_timer (float) |
virtual void | post_redraw ()=0 |
Redraw the rendering area. | |
virtual void | post_overlay_redraw ()=0 |
virtual void | post_idle_request () |
virtual void | post_message (char const *, void const *) |
virtual void | post_destroy () |
virtual void | kill_timer (int) |
kill an existing timer. | |
virtual void | bind_popups (vgui_modifier=vgui_MODIFIER_NULL, vgui_button=vgui_RIGHT) |
Bind the given modifier/button combination to the popup menu. | |
virtual void | get_popup_bindings (vgui_modifier &, vgui_button &) const |
Return the modifier/button which pops up the popup menu. | |
virtual vgui_window * | get_window () const |
virtual void | swap_buffers () |
virtual void | make_current () |
Static Public Attributes | |
static vgui_DLLDATA vgui_adaptor * | current = 0 |
This static datum points to the adaptor that last received a mouse event. | |
Protected Attributes | |
bool | nested_popups |
Parameters controlling the popup menu style. | |
bool | default_items |
bool | use_double_buffering |
Whether or not to use double buffering. | |
Private Attributes | |
vgui_adaptor_tableau * | the_tableau |
vgui_menu | menu |
this menu is put before the tableau's popup menu. |
Provides an abstract interface to an OpenGL rendering state.
Provides an abstract interface to an OpenGL rendering state (context) producing events. Events from adaptor (eg. when someone presses a mouse button over the window) will be dispatched to the associated vgui_tableau in a vgui_event structure. Draw requests will be dispatched to the tableau as vgui_DRAW and vgui_DRAW_OVERLAY events.
Note. When the set_tableau() method is called, the adaptor will attach itself to the tableau as an observer. The tableau may detach that observer if it so chooses, but that would be a bad idea as it would stop post()s from tableaux reaching the adaptor.
Definition at line 50 of file vgui_adaptor.h.
vgui_adaptor::vgui_adaptor | ( | ) |
Constructor - create a default adaptor.
Definition at line 31 of file vgui_adaptor.cxx.
vgui_adaptor::~vgui_adaptor | ( | ) | [virtual] |
Destructor - quits application if all adaptors have been deleted.
Definition at line 49 of file vgui_adaptor.cxx.
void vgui_adaptor::bind_popups | ( | vgui_modifier | = vgui_MODIFIER_NULL , |
vgui_button | = vgui_RIGHT |
||
) | [virtual] |
Bind the given modifier/button combination to the popup menu.
Reimplemented in vgui_mfc_adaptor, vgui_wx_adaptor, vgui_win32_adaptor, vgui_qt_adaptor, vgui_gtk2_adaptor, vgui_qt_adaptor, vgui_gtk_adaptor, and vgui_glut_adaptor.
Definition at line 224 of file vgui_adaptor.cxx.
void vgui_adaptor::config_dialog | ( | ) |
Pop up a dialog for changing the popup modifier and button bindings.
Pops up a dialog for changing the popup modifier and button bindings.
Definition at line 102 of file vgui_adaptor.cxx.
bool vgui_adaptor::dispatch_to_tableau | ( | vgui_event const & | e | ) |
Dispatches the given event to the tableau.
This method performs various checks which can be performed generically for all tableaux. It is not the responsibility of this method to take care of overlay handling - the derived class must sort that out.
This method performs various checks which can be performed generically for all tableaux. It is not the responsibility of this method to take care of overlay handling - the derived class must sort that out. The derived class must also ensure that the correct draw buffer is set.
Reimplemented in vgui_qt_adaptor, and vgui_qt_adaptor.
Definition at line 182 of file vgui_adaptor.cxx.
virtual unsigned vgui_adaptor::get_height | ( | ) | const [pure virtual] |
Return height of rendering area.
*Not* the height of the viewport. There seems to be no OpenGL mechanism for doing this.
Implemented in vgui_mfc_adaptor, vgui_wx_adaptor, vgui_qt_adaptor, vgui_gtk2_adaptor, vgui_qt_adaptor, vgui_gtk_adaptor, vgui_win32_adaptor, and vgui_glut_adaptor.
vgui_menu& vgui_adaptor::get_popup | ( | ) | [inline] |
Return the popup menu for this adaptor.
Reimplemented in vgui_mfc_adaptor, vgui_qt_adaptor, vgui_qt_adaptor, vgui_gtk2_adaptor, and vgui_gtk_adaptor.
Definition at line 75 of file vgui_adaptor.h.
void vgui_adaptor::get_popup_bindings | ( | vgui_modifier & | , |
vgui_button & | |||
) | const [virtual] |
Return the modifier/button which pops up the popup menu.
Reimplemented in vgui_mfc_adaptor, vgui_wx_adaptor, vgui_win32_adaptor, vgui_qt_adaptor, vgui_gtk2_adaptor, vgui_qt_adaptor, vgui_gtk_adaptor, and vgui_glut_adaptor.
Definition at line 230 of file vgui_adaptor.cxx.
vgui_tableau_sptr vgui_adaptor::get_tableau | ( | ) | const |
Get the vgui_tableau associated with this vgui_adaptor.
Get the vgui_tableau associated with this adaptor.
Definition at line 64 of file vgui_adaptor.cxx.
vgui_menu vgui_adaptor::get_total_popup | ( | vgui_popup_params & | params | ) | const |
Return the concatenation of the adaptor's menu with the tableau's menu.
Returns concatenation of the adaptor's menu with the tableau's menu.
Definition at line 78 of file vgui_adaptor.cxx.
virtual unsigned vgui_adaptor::get_width | ( | ) | const [pure virtual] |
Return width of rendering area.
*Not* the width of the viewport. There seems to be no OpenGL mechanism for doing this.
Implemented in vgui_mfc_adaptor, vgui_wx_adaptor, vgui_qt_adaptor, vgui_gtk2_adaptor, vgui_qt_adaptor, vgui_gtk_adaptor, vgui_win32_adaptor, and vgui_glut_adaptor.
vgui_window * vgui_adaptor::get_window | ( | ) | const [virtual] |
Reimplemented in vgui_mfc_adaptor, vgui_wx_adaptor, vgui_gtk2_adaptor, vgui_win32_adaptor, vgui_gtk_adaptor, and vgui_glut_adaptor.
Definition at line 216 of file vgui_adaptor.cxx.
void vgui_adaptor::include_in_popup | ( | vgui_menu const & | m | ) | [inline] |
Add the given menu to the popup menu for this adaptor.
Definition at line 81 of file vgui_adaptor.h.
void vgui_adaptor::kill_timer | ( | int | ) | [virtual] |
kill an existing timer.
Reimplemented in vgui_mfc_adaptor, vgui_wx_adaptor, vgui_win32_adaptor, vgui_qt_adaptor, vgui_gtk2_adaptor, and vgui_gtk_adaptor.
Definition at line 260 of file vgui_adaptor.cxx.
void vgui_adaptor::make_current | ( | ) | [virtual] |
Reimplemented in vgui_wx_adaptor, vgui_mfc_adaptor, vgui_win32_adaptor, vgui_qt_adaptor, vgui_gtk2_adaptor, vgui_qt_adaptor, vgui_gtk_adaptor, and vgui_glut_adaptor.
Definition at line 248 of file vgui_adaptor.cxx.
void vgui_adaptor::post_destroy | ( | void | ) | [virtual] |
Reimplemented in vgui_wx_adaptor, vgui_win32_adaptor, vgui_gtk2_adaptor, vgui_gtk_adaptor, and vgui_glut_adaptor.
Definition at line 274 of file vgui_adaptor.cxx.
void vgui_adaptor::post_idle_request | ( | void | ) | [virtual] |
Reimplemented in vgui_mfc_adaptor, vgui_wx_adaptor, vgui_gtk2_adaptor, vgui_win32_adaptor, vgui_qt_adaptor, and vgui_qt_adaptor.
Definition at line 279 of file vgui_adaptor.cxx.
void vgui_adaptor::post_message | ( | char const * | , |
void const * | |||
) | [virtual] |
Reimplemented in vgui_wx_adaptor.
Definition at line 242 of file vgui_adaptor.cxx.
virtual void vgui_adaptor::post_overlay_redraw | ( | ) | [pure virtual] |
Implemented in vgui_mfc_adaptor, vgui_wx_adaptor, vgui_win32_adaptor, vgui_qt_adaptor, vgui_gtk2_adaptor, vgui_qt_adaptor, vgui_gtk_adaptor, and vgui_glut_adaptor.
virtual void vgui_adaptor::post_redraw | ( | ) | [pure virtual] |
Redraw the rendering area.
Implemented in vgui_mfc_adaptor, vgui_wx_adaptor, vgui_win32_adaptor, vgui_qt_adaptor, vgui_gtk2_adaptor, vgui_qt_adaptor, vgui_gtk_adaptor, and vgui_glut_adaptor.
void vgui_adaptor::post_timer | ( | float | , |
int | |||
) | [virtual] |
Reimplemented in vgui_mfc_adaptor, vgui_wx_adaptor, vgui_qt_adaptor, vgui_win32_adaptor, vgui_gtk2_adaptor, vgui_gtk_adaptor, and vgui_glut_adaptor.
Definition at line 254 of file vgui_adaptor.cxx.
int vgui_adaptor::post_timer | ( | float | t | ) |
Definition at line 266 of file vgui_adaptor.cxx.
void vgui_adaptor::set_double_buffering | ( | bool | b | ) | [inline] |
True to use double buffering, false to not use it.
Definition at line 66 of file vgui_adaptor.h.
void vgui_adaptor::set_popup | ( | vgui_menu const & | m | ) | [inline] |
Set the popup menu for this adaptor.
Definition at line 78 of file vgui_adaptor.h.
void vgui_adaptor::set_tableau | ( | vgui_tableau_sptr const & | t | ) |
Set the vgui_tableau associated with this vgui_adaptor.
Set the vgui_tableau associated with this adaptor.
Definition at line 71 of file vgui_adaptor.cxx.
void vgui_adaptor::swap_buffers | ( | ) | [virtual] |
Reimplemented in vgui_wx_adaptor, vgui_mfc_adaptor, vgui_win32_adaptor, vgui_qt_adaptor, vgui_gtk2_adaptor, vgui_qt_adaptor, vgui_gtk_adaptor, and vgui_glut_adaptor.
Definition at line 236 of file vgui_adaptor.cxx.
vgui_adaptor * vgui_adaptor::current = 0 [static] |
This static datum points to the adaptor that last received a mouse event.
It is set to zero if its pointer receives a LEAVE event. It will often point to the adaptor which was current when a popup menu was triggered, which is often what one wants it for.
Definition at line 93 of file vgui_adaptor.h.
bool vgui_adaptor::default_items [protected] |
Definition at line 143 of file vgui_adaptor.h.
vgui_menu vgui_adaptor::menu [private] |
this menu is put before the tableau's popup menu.
Definition at line 152 of file vgui_adaptor.h.
bool vgui_adaptor::nested_popups [protected] |
Parameters controlling the popup menu style.
These are put onto a popup_params object and passed to tableau::get_popup()
Definition at line 142 of file vgui_adaptor.h.
vgui_adaptor_tableau* vgui_adaptor::the_tableau [private] |
Definition at line 149 of file vgui_adaptor.h.
bool vgui_adaptor::use_double_buffering [protected] |
Whether or not to use double buffering.
Definition at line 146 of file vgui_adaptor.h.