Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

GLUI_Main Class Reference

#include <glui.h>

Inheritance diagram for GLUI_Main:

GLUI_Node GLUI List of all members.

Detailed Description

A GLUI_Main handles GLUT events for one window, routing them to the appropriate controls. The central user-visible "GLUI" class inherits from this class; users should not allocate GLUT_Main objects.

There's a separate GLUI_Main object for:

All the GLUI_Main objects are listed in GLUI_Master.gluis. A better name for this class might be "GLUI_Environment"; this class provides the window-level context for every control.


Public Member Functions

void adjust_glut_xy (int &x, int &y)
void activate_control (GLUI_Control *control, int how)
void align_controls (GLUI_Control *control)
void deactivate_current_control (void)
void draw_raised_box (int x, int y, int w, int h)
void draw_lowered_box (int x, int y, int w, int h)
bool should_redraw_now (GLUI_Control *ctl)
int set_current_draw_buffer ()
void restore_draw_buffer (int buffer_state)
void refresh ()
void post_update_main_gfx ()
void pack_controls ()
void close_internal ()
void check_subwindow_position ()
void set_ortho_projection ()
void set_viewport ()
int get_glut_window_id (void)

Public Attributes

GLUI_StdBitmaps std_bitmaps
GLUI_String window_name
RGBc bkgd_color
float bkgd_color_f [3]
void * font
int curr_modifiers

Protected Types

enum  buffer_mode_t { buffer_front = 1, buffer_back = 2 }

Protected Member Functions

GLUI_Controlfind_control (int x, int y)
GLUI_Controlfind_next_control (GLUI_Control *control)
GLUI_Controlfind_next_control_rec (GLUI_Control *control)
GLUI_Controlfind_next_control_ (GLUI_Control *control)
GLUI_Controlfind_prev_control (GLUI_Control *control)
void create_standalone_window (const char *name, int x=-1, int y=-1)
void create_subwindow (int parent, int window_alignment)
void setup_default_glut_callbacks (void)
void mouse (int button, int state, int x, int y)
void keyboard (unsigned char key, int x, int y)
void special (int key, int x, int y)
void passive_motion (int x, int y)
void reshape (int w, int h)
void visibility (int state)
void motion (int x, int y)
void entry (int state)
void display (void)
void idle (void)
int needs_idle (void)
virtual int add_control (GLUI_Node *parent, GLUI_Control *control)
 GLUI_Main (void)

Protected Attributes

int main_gfx_window_id
int mouse_button_down
int glut_window_id
int top_level_glut_window_id
GLUI_Controlactive_control
GLUI_Controlmouse_over_control
GLUI_Panelmain_panel
buffer_mode_t buffer_mode
 Current drawing mode.

int curr_cursor
int w
int h
long flags
bool closing
int parent_window
int glui_id
void(* glut_mouse_CB )(int, int, int, int)
void(* glut_keyboard_CB )(unsigned char, int, int)
void(* glut_special_CB )(int, int, int)
void(* glut_reshape_CB )(int, int)

Friends

void glui_mouse_func (int button, int state, int x, int y)
void glui_keyboard_func (unsigned char key, int x, int y)
void glui_special_func (int key, int x, int y)
void glui_passive_motion_func (int x, int y)
void glui_reshape_func (int w, int h)
void glui_visibility_func (int state)
void glui_motion_func (int x, int y)
void glui_entry_func (int state)
void glui_display_func (void)
void glui_idle_func (void)
void glui_parent_window_reshape_func (int w, int h)
void glui_parent_window_keyboard_func (unsigned char, int, int)
void glui_parent_window_special_func (int, int, int)
void glui_parent_window_mouse_func (int, int, int, int)


Member Enumeration Documentation

enum GLUI_Main::buffer_mode_t [protected]
 

Enumeration values:
buffer_front  Draw updated controls directly to screen.
buffer_back  Double buffering: postpone updates until next redraw.


Constructor & Destructor Documentation

GLUI_Main::GLUI_Main void   )  [protected]
 


Member Function Documentation

void GLUI_Main::activate_control GLUI_Control control,
int  how
 

int GLUI_Main::add_control GLUI_Node parent,
GLUI_Control control
[protected, virtual]
 

Reimplemented in GLUI.

void GLUI_Main::adjust_glut_xy int &  x,
int &  y
[inline]
 

void GLUI_Main::align_controls GLUI_Control control  ) 
 

void GLUI_Main::check_subwindow_position  ) 
 

void GLUI_Main::close_internal  ) 
 

void GLUI_Main::create_standalone_window const char *  name,
int  x = -1,
int  y = -1
[protected]
 

void GLUI_Main::create_subwindow int  parent,
int  window_alignment
[protected]
 

void GLUI_Main::deactivate_current_control void   ) 
 

void GLUI_Main::display void   )  [protected]
 

void GLUI_Main::draw_lowered_box int  x,
int  y,
int  w,
int  h
 

Draw a 3D-look pushed-in box around this rectangle

void GLUI_Main::draw_raised_box int  x,
int  y,
int  w,
int  h
 

Draw a 3D-look pushed-out box around this rectangle

void GLUI_Main::entry int  state  )  [protected]
 

GLUI_Control * GLUI_Main::find_control int  x,
int  y
[protected]
 

GLUI_Control * GLUI_Main::find_next_control GLUI_Control control  )  [protected]
 

GLUI_Control * GLUI_Main::find_next_control_ GLUI_Control control  )  [protected]
 

GLUI_Control * GLUI_Main::find_next_control_rec GLUI_Control control  )  [protected]
 

GLUI_Control * GLUI_Main::find_prev_control GLUI_Control control  )  [protected]
 

int GLUI_Main::get_glut_window_id void   )  [inline]
 

Reimplemented in GLUI.

void GLUI_Main::idle void   )  [protected]
 

void GLUI_Main::keyboard unsigned char  key,
int  x,
int  y
[protected]
 

void GLUI_Main::motion int  x,
int  y
[protected]
 

void GLUI_Main::mouse int  button,
int  state,
int  x,
int  y
[protected]
 

int GLUI_Main::needs_idle void   )  [protected]
 

void GLUI_Main::pack_controls  ) 
 

Recompute the sizes and positions of all controls

void GLUI_Main::passive_motion int  x,
int  y
[protected]
 

void GLUI_Main::post_update_main_gfx  ) 
 

Redraw the main graphics window

void GLUI_Main::refresh  ) 
 

Pack, resize the window, and redraw all the controls.

void GLUI_Main::reshape int  w,
int  h
[protected]
 

void GLUI_Main::restore_draw_buffer int  buffer_state  ) 
 

Go back to using this draw buffer. Undoes set_current_draw_buffer.

int GLUI_Main::set_current_draw_buffer  ) 
 

Switch to the appropriate draw buffer now. Returns the old draw buffer. This routine should probably only be called from inside the GLUI_DrawingSentinal, in glui_internal_control.h

void GLUI_Main::set_ortho_projection  ) 
 

void GLUI_Main::set_viewport  ) 
 

void GLUI_Main::setup_default_glut_callbacks void   )  [protected]
 

bool GLUI_Main::should_redraw_now GLUI_Control ctl  ) 
 

Return true if this control should redraw itself immediately (front buffer); Or queue up a redraw and return false if it shouldn't (back buffer).

void GLUI_Main::special int  key,
int  x,
int  y
[protected]
 

void GLUI_Main::visibility int  state  )  [protected]
 


Friends And Related Function Documentation

void glui_display_func void   )  [friend]
 

void glui_entry_func int  state  )  [friend]
 

void glui_idle_func void   )  [friend]
 

void glui_keyboard_func unsigned char  key,
int  x,
int  y
[friend]
 

void glui_motion_func int  x,
int  y
[friend]
 

void glui_mouse_func int  button,
int  state,
int  x,
int  y
[friend]
 

void glui_parent_window_keyboard_func unsigned  char,
int  ,
int 
[friend]
 

void glui_parent_window_mouse_func int  ,
int  ,
int  ,
int 
[friend]
 

void glui_parent_window_reshape_func int  w,
int  h
[friend]
 

void glui_parent_window_special_func int  ,
int  ,
int 
[friend]
 

void glui_passive_motion_func int  x,
int  y
[friend]
 

void glui_reshape_func int  w,
int  h
[friend]
 

void glui_special_func int  key,
int  x,
int  y
[friend]
 

void glui_visibility_func int  state  )  [friend]
 


Member Data Documentation

GLUI_Control* GLUI_Main::active_control [protected]
 

RGBc GLUI_Main::bkgd_color
 

float GLUI_Main::bkgd_color_f[3]
 

buffer_mode_t GLUI_Main::buffer_mode [protected]
 

Current drawing mode.

bool GLUI_Main::closing [protected]
 

int GLUI_Main::curr_cursor [protected]
 

int GLUI_Main::curr_modifiers
 

long GLUI_Main::flags [protected]
 

void* GLUI_Main::font
 

int GLUI_Main::glui_id [protected]
 

void(* GLUI_Main::glut_keyboard_CB)(unsigned char, int, int) [protected]
 

void(* GLUI_Main::glut_mouse_CB)(int, int, int, int) [protected]
 

void(* GLUI_Main::glut_reshape_CB)(int, int) [protected]
 

void(* GLUI_Main::glut_special_CB)(int, int, int) [protected]
 

int GLUI_Main::glut_window_id [protected]
 

int GLUI_Main::h [protected]
 

int GLUI_Main::main_gfx_window_id [protected]
 

GLUI_Panel* GLUI_Main::main_panel [protected]
 

int GLUI_Main::mouse_button_down [protected]
 

GLUI_Control* GLUI_Main::mouse_over_control [protected]
 

int GLUI_Main::parent_window [protected]
 

GLUI_StdBitmaps GLUI_Main::std_bitmaps
 

int GLUI_Main::top_level_glut_window_id [protected]
 

int GLUI_Main::w [protected]
 

GLUI_String GLUI_Main::window_name
 


The documentation for this class was generated from the following files:
Generated on Fri Sep 15 17:51:57 2006 for GLUI by doxygen 1.3.6