Public Member Functions | Static Public Attributes | Protected Attributes | Private Attributes
vgui_adaptor Class Reference

Provides an abstract interface to an OpenGL rendering state. More...

#include <vgui_adaptor.h>

Inheritance diagram for vgui_adaptor:
Inheritance graph
[legend]

List of all members.

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_menuget_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_windowget_window () const
virtual void swap_buffers ()
virtual void make_current ()

Static Public Attributes

static vgui_DLLDATA vgui_adaptorcurrent = 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_tableauthe_tableau
vgui_menu menu
 this menu is put before the tableau's popup menu.

Detailed Description

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.


Constructor & Destructor Documentation

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.


Member Function Documentation

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]
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]
void vgui_adaptor::post_destroy ( void  ) [virtual]
void vgui_adaptor::post_idle_request ( void  ) [virtual]
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]
virtual void vgui_adaptor::post_redraw ( ) [pure virtual]
void vgui_adaptor::post_timer ( float  ,
int   
) [virtual]
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]

Member Data Documentation

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.

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.

Definition at line 149 of file vgui_adaptor.h.

Whether or not to use double buffering.

Definition at line 146 of file vgui_adaptor.h.


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