Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

WinGraphicsWindow Class Reference

#include <winGraphicsWindow.h>

Inheritance diagram for WinGraphicsWindow:

GraphicsWindow TypedReferenceCount ClearableRegion TypedObject ReferenceCount wdxGraphicsWindow7 wdxGraphicsWindow8 wglGraphicsWindow List of all members.

Public Member Functions

 WinGraphicsWindow (GraphicsPipe *pipe, GraphicsStateGuardian *gsg)
virtual ~WinGraphicsWindow ()
virtual void begin_flip ()
virtual void process_events ()
virtual void set_properties_now (WindowProperties &properties)
virtual LONG window_proc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
virtual bool handle_mouse_motion (int x, int y)
virtual void handle_mouse_exit (void)
virtual TypeHandle get_type () const
virtual TypeHandle force_init_type ()

Static Public Member Functions

LONG WINAPI static_window_proc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
TypeHandle get_class_type ()
void init_type ()

Protected Member Functions

virtual void close_window ()
virtual bool open_window ()
virtual void fullscreen_minimized (WindowProperties &properties)
virtual void fullscreen_restored (WindowProperties &properties)
virtual bool do_reshape_request (int x_origin, int y_origin, int x_size, int y_size)
virtual void handle_reshape ()
virtual bool do_fullscreen_resize (int x_size, int y_size)
virtual void reconsider_fullscreen_size (DWORD &x_size, DWORD &y_size, DWORD &bitdepth)

Protected Attributes

HWND _hWnd

Static Protected Attributes

bool _loaded_custom_cursor
HCURSOR _mouse_cursor
const char *const _window_class_name = "WinGraphicsWindow"
bool _window_class_registered = false

Private Types

typedef map< HWND, WinGraphicsWindow * > WindowHandles

Private Member Functions

bool open_fullscreen_window ()
bool open_regular_window ()
void track_mouse_leaving (HWND hwnd)
INLINE void handle_keypress (ButtonHandle key, int x, int y)
INLINE void handle_keyresume (ButtonHandle key)
INLINE void handle_keyrelease (ButtonHandle key)
ButtonHandle lookup_key (WPARAM wparam) const
INLINE int translate_mouse (int pos) const
INLINE void set_cursor_in_window ()
INLINE void set_cursor_out_of_window ()

Static Private Member Functions

void process_1_event ()
void update_cursor_window (WinGraphicsWindow *to_window)
void register_window_class ()
bool find_acceptable_display_mode (DWORD dwWidth, DWORD dwHeight, DWORD bpp, DEVMODE &dm)
void show_error_message (DWORD message_id=0)

Private Attributes

bool _ime_open
bool _ime_active
bool _ime_composition_w
bool _tracking_mouse_leaving
bool _maximized
bool _bCursor_in_WindowClientArea
DEVMODE _fullscreen_display_mode
BYTE _keyboard_state [num_virtual_keys]

Static Private Attributes

const int num_virtual_keys = 256
WindowHandles _window_handles
WinGraphicsWindow * _creating_window = NULL
WinGraphicsWindow * _cursor_window = NULL
bool _cursor_hidden = false
bool _got_saved_params = false
int _saved_mouse_trails
BOOL _saved_cursor_shadow
BOOL _saved_mouse_vanish
TypeHandle _type_handle

Member Typedef Documentation

typedef map<HWND, WinGraphicsWindow *> WinGraphicsWindow::WindowHandles [private]
 

Definition at line 125 of file winGraphicsWindow.h.


Constructor & Destructor Documentation

WinGraphicsWindow::WinGraphicsWindow GraphicsPipe pipe,
GraphicsStateGuardian gsg
 

Definition at line 59 of file winGraphicsWindow.cxx.

References _hWnd, _ime_active, _ime_composition_w, _ime_open, GraphicsWindow::_input_devices, _keyboard_state, _maximized, _tracking_mouse_leaving, num_virtual_keys, and GraphicsWindowInputDevice::pointer_and_keyboard().

WinGraphicsWindow::~WinGraphicsWindow  )  [virtual]
 

Definition at line 80 of file winGraphicsWindow.cxx.


Member Function Documentation

void WinGraphicsWindow::begin_flip  )  [virtual]
 

Reimplemented from GraphicsWindow.

Reimplemented in wglGraphicsWindow.

Definition at line 98 of file winGraphicsWindow.cxx.

void WinGraphicsWindow::close_window  )  [protected, virtual]
 

Reimplemented from GraphicsWindow.

Reimplemented in wglGraphicsWindow.

Definition at line 175 of file winGraphicsWindow.cxx.

References _hWnd, _window_handles, GraphicsWindow::is_fullscreen(), NULL, and set_cursor_out_of_window().

Referenced by wglGraphicsWindow::close_window().

bool WinGraphicsWindow::do_fullscreen_resize int  x_size,
int  y_size
[protected, virtual]
 

Reimplemented in wdxGraphicsWindow7, and wdxGraphicsWindow8.

Definition at line 384 of file winGraphicsWindow.cxx.

References _fullscreen_display_mode, _hWnd, find_acceptable_display_mode(), HDC(), and NULL.

Referenced by do_reshape_request().

bool WinGraphicsWindow::do_reshape_request int  x_origin,
int  y_origin,
int  x_size,
int  y_size
[protected, virtual]
 

Reimplemented from GraphicsWindow.

Definition at line 315 of file winGraphicsWindow.cxx.

References _hWnd, do_fullscreen_resize(), handle_reshape(), GraphicsWindow::is_fullscreen(), and NULL.

bool WinGraphicsWindow::find_acceptable_display_mode DWORD  dwWidth,
DWORD  dwHeight,
DWORD  bpp,
DEVMODE &  dm
[static, private]
 

Definition at line 1244 of file winGraphicsWindow.cxx.

References ACCEPTABLE_REFRESH_RATE, and NULL.

Referenced by do_fullscreen_resize(), and open_fullscreen_window().

virtual TypeHandle WinGraphicsWindow::force_init_type void   )  [inline, virtual]
 

Reimplemented from GraphicsWindow.

Reimplemented in wdxGraphicsWindow7, wdxGraphicsWindow8, and wglGraphicsWindow.

Definition at line 160 of file winGraphicsWindow.h.

References GraphicsWindow::get_class_type(), and GraphicsWindow::init_type().

void WinGraphicsWindow::fullscreen_minimized WindowProperties properties  )  [protected, virtual]
 

Definition at line 289 of file winGraphicsWindow.cxx.

Referenced by window_proc().

void WinGraphicsWindow::fullscreen_restored WindowProperties properties  )  [protected, virtual]
 

Reimplemented in wdxGraphicsWindow7, and wdxGraphicsWindow8.

Definition at line 302 of file winGraphicsWindow.cxx.

Referenced by window_proc().

TypeHandle WinGraphicsWindow::get_class_type void   )  [inline, static]
 

Reimplemented from GraphicsWindow.

Reimplemented in wdxGraphicsWindow7, wdxGraphicsWindow8, and wglGraphicsWindow.

Definition at line 149 of file winGraphicsWindow.h.

Referenced by wglGraphicsWindow::force_init_type(), wdxGraphicsWindow8::force_init_type(), wdxGraphicsWindow7::force_init_type(), wglGraphicsWindow::get_type(), wdxGraphicsWindow8::get_type(), wdxGraphicsWindow7::get_type(), wglGraphicsWindow::init_type(), wdxGraphicsWindow8::init_type(), and wdxGraphicsWindow7::init_type().

virtual TypeHandle WinGraphicsWindow::get_type void   )  const [inline, virtual]
 

Reimplemented from GraphicsWindow.

Reimplemented in wdxGraphicsWindow7, wdxGraphicsWindow8, and wglGraphicsWindow.

Definition at line 157 of file winGraphicsWindow.h.

References GraphicsWindow::get_class_type().

INLINE void WinGraphicsWindow::handle_keypress ButtonHandle  key,
int  x,
int  y
[private]
 

Referenced by window_proc().

INLINE void WinGraphicsWindow::handle_keyrelease ButtonHandle  key  )  [private]
 

Referenced by window_proc().

INLINE void WinGraphicsWindow::handle_keyresume ButtonHandle  key  )  [private]
 

Referenced by window_proc().

void WinGraphicsWindow::handle_mouse_exit void   )  [virtual]
 

Definition at line 1396 of file winGraphicsWindow.cxx.

References GraphicsWindow::_input_devices.

Referenced by window_proc().

bool WinGraphicsWindow::handle_mouse_motion int  x,
int  y
[virtual]
 

Reimplemented in wdxGraphicsWindow8.

Definition at line 1385 of file winGraphicsWindow.cxx.

References GraphicsWindow::_input_devices, x, and y.

Referenced by wdxGraphicsWindow8::handle_mouse_motion(), and window_proc().

void WinGraphicsWindow::handle_reshape  )  [protected, virtual]
 

Reimplemented in wdxGraphicsWindow7, and wdxGraphicsWindow8.

Definition at line 354 of file winGraphicsWindow.cxx.

References _hWnd, WindowProperties::get_x_origin(), WindowProperties::get_x_size(), WindowProperties::get_y_origin(), WindowProperties::get_y_size(), WindowProperties::set_origin(), WindowProperties::set_size(), and GraphicsWindow::system_changed_properties().

Referenced by do_reshape_request(), wdxGraphicsWindow8::handle_reshape(), wdxGraphicsWindow7::handle_reshape(), and window_proc().

void WinGraphicsWindow::init_type void   )  [inline, static]
 

Reimplemented from GraphicsWindow.

Reimplemented in wdxGraphicsWindow7, wdxGraphicsWindow8, and wglGraphicsWindow.

Definition at line 152 of file winGraphicsWindow.h.

References GraphicsWindow::get_class_type(), GraphicsWindow::init_type(), and register_type().

Referenced by wglGraphicsWindow::force_init_type(), wdxGraphicsWindow8::force_init_type(), wdxGraphicsWindow7::force_init_type(), init_libwindisplay(), wglGraphicsWindow::init_type(), wdxGraphicsWindow8::init_type(), and wdxGraphicsWindow7::init_type().

ButtonHandle WinGraphicsWindow::lookup_key WPARAM  wparam  )  const [private]
 

Definition at line 1299 of file winGraphicsWindow.cxx.

References _ime_active, KeyboardButton::alt(), KeyboardButton::ascii_key(), KeyboardButton::backspace(), KeyboardButton::caps_lock(), KeyboardButton::control(), KeyboardButton::del(), KeyboardButton::down(), KeyboardButton::end(), KeyboardButton::escape(), KeyboardButton::f1(), KeyboardButton::f10(), KeyboardButton::f11(), KeyboardButton::f12(), KeyboardButton::f2(), KeyboardButton::f3(), KeyboardButton::f4(), KeyboardButton::f5(), KeyboardButton::f6(), KeyboardButton::f7(), KeyboardButton::f8(), KeyboardButton::f9(), KeyboardButton::home(), KeyboardButton::insert(), KeyboardButton::left(), ButtonHandle::none(), KeyboardButton::num_lock(), KeyboardButton::page_down(), KeyboardButton::page_up(), KeyboardButton::print_screen(), KeyboardButton::right(), KeyboardButton::scroll_lock(), KeyboardButton::shift(), KeyboardButton::space(), KeyboardButton::tab(), and KeyboardButton::up().

Referenced by window_proc().

bool WinGraphicsWindow::open_fullscreen_window  )  [private]
 

Definition at line 446 of file winGraphicsWindow.cxx.

References _fullscreen_display_mode, _hWnd, GraphicsWindow::_properties, _window_class_name, find_acceptable_display_mode(), WindowProperties::get_title(), WindowProperties::get_x_size(), WindowProperties::get_y_size(), WindowProperties::has_size(), WindowProperties::has_title(), HDC(), NULL, reconsider_fullscreen_size(), register_window_class(), WindowProperties::set_origin(), WindowProperties::set_size(), and show_error_message().

Referenced by open_window().

bool WinGraphicsWindow::open_regular_window  )  [private]
 

Definition at line 525 of file winGraphicsWindow.cxx.

References _hWnd, GraphicsWindow::_properties, _window_class_name, WindowProperties::get_title(), WindowProperties::get_undecorated(), WindowProperties::get_x_origin(), WindowProperties::get_x_size(), WindowProperties::get_y_origin(), WindowProperties::get_y_size(), WindowProperties::has_origin(), WindowProperties::has_size(), WindowProperties::has_title(), WindowProperties::has_undecorated(), NULL, register_window_class(), WindowProperties::set_origin(), WindowProperties::set_size(), and show_error_message().

Referenced by open_window().

bool WinGraphicsWindow::open_window  )  [protected, virtual]
 

Reimplemented from GraphicsWindow.

Reimplemented in wdxGraphicsWindow7, wdxGraphicsWindow8, and wglGraphicsWindow.

Definition at line 197 of file winGraphicsWindow.cxx.

References _creating_window, _hWnd, _ime_active, _ime_composition_w, _ime_open, _window_handles, ime_composition_w, GraphicsWindow::is_fullscreen(), NULL, open_fullscreen_window(), and open_regular_window().

Referenced by wglGraphicsWindow::open_window(), wdxGraphicsWindow8::open_window(), and wdxGraphicsWindow7::open_window().

void WinGraphicsWindow::process_1_event  )  [static, private]
 

Definition at line 1054 of file winGraphicsWindow.cxx.

References NULL.

Referenced by process_events().

void WinGraphicsWindow::process_events  )  [virtual]
 

Reimplemented from GraphicsWindow.

Definition at line 112 of file winGraphicsWindow.cxx.

References NULL, process_1_event(), and GraphicsWindow::process_events().

void WinGraphicsWindow::reconsider_fullscreen_size DWORD &  x_size,
DWORD &  y_size,
DWORD &  bitdepth
[protected, virtual]
 

Reimplemented in wglGraphicsWindow.

Definition at line 437 of file winGraphicsWindow.cxx.

Referenced by open_fullscreen_window().

void WinGraphicsWindow::register_window_class  )  [static, private]
 

Definition at line 1141 of file winGraphicsWindow.cxx.

References _loaded_custom_cursor, _mouse_cursor, _window_class_name, _window_class_registered, get_icon_filename(), get_mono_cursor_filename(), NULL, and static_window_proc().

Referenced by open_fullscreen_window(), and open_regular_window().

INLINE void WinGraphicsWindow::set_cursor_in_window  )  [private]
 

Referenced by window_proc().

INLINE void WinGraphicsWindow::set_cursor_out_of_window  )  [private]
 

Referenced by close_window(), and window_proc().

void WinGraphicsWindow::set_properties_now WindowProperties properties  )  [virtual]
 

Reimplemented from GraphicsWindow.

Definition at line 160 of file winGraphicsWindow.cxx.

References WindowProperties::is_any_specified(), and GraphicsWindow::set_properties_now().

void WinGraphicsWindow::show_error_message DWORD  message_id = 0  )  [static, private]
 

Definition at line 1275 of file winGraphicsWindow.cxx.

References errorbox_title, and NULL.

Referenced by open_fullscreen_window(), open_regular_window(), and window_proc().

LONG WINAPI WinGraphicsWindow::static_window_proc HWND  hwnd,
UINT  msg,
WPARAM  wparam,
LPARAM  lparam
[static]
 

Definition at line 1029 of file winGraphicsWindow.cxx.

References _creating_window, _window_handles, NULL, and window_proc().

Referenced by register_window_class().

void WinGraphicsWindow::track_mouse_leaving HWND  hwnd  )  [private]
 

Definition at line 603 of file winGraphicsWindow.cxx.

References WinGraphicsPipe::_pfnTrackMouseEvent, _tracking_mouse_leaving, BOOL(), DCAST_INTO_V, and NULL.

Referenced by window_proc().

INLINE int WinGraphicsWindow::translate_mouse int  pos  )  const [private]
 

Referenced by window_proc().

void WinGraphicsWindow::update_cursor_window WinGraphicsWindow *  to_window  )  [static, private]
 

Definition at line 1077 of file winGraphicsWindow.cxx.

References _cursor_hidden, _cursor_window, _got_saved_params, _saved_cursor_shadow, _saved_mouse_trails, _saved_mouse_vanish, WindowProperties::get_cursor_hidden(), and NULL.

LONG WinGraphicsWindow::window_proc HWND  hwnd,
UINT  msg,
WPARAM  wparam,
LPARAM  lparam
[virtual]
 

Reimplemented in wdxGraphicsWindow8.

Definition at line 639 of file winGraphicsWindow.cxx.

References _bCursor_in_WindowClientArea, _fullscreen_display_mode, _hWnd, _ime_active, _ime_open, GraphicsWindow::_input_devices, _keyboard_state, _maximized, GraphicsWindow::_properties, _tracking_mouse_leaving, ClearToBlack(), fullscreen_minimized(), fullscreen_restored(), WindowProperties::get_cursor_hidden(), handle_keypress(), handle_keyrelease(), handle_keyresume(), handle_mouse_exit(), handle_mouse_motion(), handle_reshape(), GraphicsWindow::is_fullscreen(), lookup_key(), NULL, num_virtual_keys, set_cursor_in_window(), set_cursor_out_of_window(), WindowProperties::set_foreground(), WindowProperties::set_minimized(), WindowProperties::set_open(), show_error_message(), GraphicsWindow::system_changed_properties(), track_mouse_leaving(), translate_mouse(), and uchar.

Referenced by static_window_proc(), and wdxGraphicsWindow8::window_proc().


Member Data Documentation

bool WinGraphicsWindow::_bCursor_in_WindowClientArea [private]
 

Definition at line 109 of file winGraphicsWindow.h.

Referenced by window_proc().

WinGraphicsWindow * WinGraphicsWindow::_creating_window = NULL [static, private]
 

Definition at line 38 of file winGraphicsWindow.cxx.

Referenced by open_window(), and static_window_proc().

bool WinGraphicsWindow::_cursor_hidden = false [static, private]
 

Definition at line 41 of file winGraphicsWindow.cxx.

Referenced by update_cursor_window().

WinGraphicsWindow * WinGraphicsWindow::_cursor_window = NULL [static, private]
 

Definition at line 40 of file winGraphicsWindow.cxx.

Referenced by update_cursor_window().

DEVMODE WinGraphicsWindow::_fullscreen_display_mode [private]
 

Definition at line 110 of file winGraphicsWindow.h.

Referenced by do_fullscreen_resize(), open_fullscreen_window(), and window_proc().

bool WinGraphicsWindow::_got_saved_params = false [static, private]
 

Definition at line 46 of file winGraphicsWindow.cxx.

Referenced by update_cursor_window().

HWND WinGraphicsWindow::_hWnd [protected]
 

Definition at line 101 of file winGraphicsWindow.h.

Referenced by close_window(), wglGraphicsWindow::close_window(), wdxGraphicsWindow8::create_screen_buffers_and_device(), do_fullscreen_resize(), do_reshape_request(), handle_reshape(), open_fullscreen_window(), open_regular_window(), open_window(), wglGraphicsWindow::open_window(), wdxGraphicsWindow8::open_window(), wdxGraphicsWindow7::open_window(), wdxGraphicsWindow7::set_coop_levels_and_display_modes(), window_proc(), and WinGraphicsWindow().

bool WinGraphicsWindow::_ime_active [private]
 

Definition at line 105 of file winGraphicsWindow.h.

Referenced by lookup_key(), open_window(), window_proc(), and WinGraphicsWindow().

bool WinGraphicsWindow::_ime_composition_w [private]
 

Definition at line 106 of file winGraphicsWindow.h.

Referenced by open_window(), and WinGraphicsWindow().

bool WinGraphicsWindow::_ime_open [private]
 

Definition at line 104 of file winGraphicsWindow.h.

Referenced by open_window(), window_proc(), and WinGraphicsWindow().

BYTE WinGraphicsWindow::_keyboard_state[num_virtual_keys] [private]
 

Definition at line 115 of file winGraphicsWindow.h.

Referenced by window_proc(), and WinGraphicsWindow().

bool WinGraphicsWindow::_loaded_custom_cursor [static, protected]
 

Definition at line 32 of file winGraphicsWindow.cxx.

Referenced by register_window_class().

bool WinGraphicsWindow::_maximized [private]
 

Definition at line 108 of file winGraphicsWindow.h.

Referenced by window_proc(), and WinGraphicsWindow().

HCURSOR WinGraphicsWindow::_mouse_cursor [static, protected]
 

Definition at line 33 of file winGraphicsWindow.cxx.

Referenced by wdxGraphicsWindow8::init_resized_window(), and register_window_class().

BOOL WinGraphicsWindow::_saved_cursor_shadow [static, private]
 

Definition at line 48 of file winGraphicsWindow.cxx.

Referenced by update_cursor_window().

int WinGraphicsWindow::_saved_mouse_trails [static, private]
 

Definition at line 47 of file winGraphicsWindow.cxx.

Referenced by update_cursor_window().

BOOL WinGraphicsWindow::_saved_mouse_vanish [static, private]
 

Definition at line 49 of file winGraphicsWindow.cxx.

Referenced by update_cursor_window().

bool WinGraphicsWindow::_tracking_mouse_leaving [private]
 

Definition at line 107 of file winGraphicsWindow.h.

Referenced by track_mouse_leaving(), window_proc(), and WinGraphicsWindow().

TypeHandle WinGraphicsWindow::_type_handle [static, private]
 

Reimplemented from GraphicsWindow.

Reimplemented in wdxGraphicsWindow7, wdxGraphicsWindow8, and wglGraphicsWindow.

Definition at line 30 of file winGraphicsWindow.cxx.

const char *const WinGraphicsWindow::_window_class_name = "WinGraphicsWindow" [static, protected]
 

Definition at line 34 of file winGraphicsWindow.cxx.

Referenced by open_fullscreen_window(), open_regular_window(), and register_window_class().

bool WinGraphicsWindow::_window_class_registered = false [static, protected]
 

Definition at line 35 of file winGraphicsWindow.cxx.

Referenced by register_window_class().

WinGraphicsWindow::WindowHandles WinGraphicsWindow::_window_handles [static, private]
 

Definition at line 37 of file winGraphicsWindow.cxx.

Referenced by close_window(), open_window(), and static_window_proc().

const int WinGraphicsWindow::num_virtual_keys = 256 [static, private]
 

Definition at line 114 of file winGraphicsWindow.h.

Referenced by window_proc(), and WinGraphicsWindow().


The documentation for this class was generated from the following files:
Generated on Fri Apr 18 00:14:06 2003 for Panda by doxygen1.3