g4tools  5.4.0
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
tools::Windows::session Class Reference

Public Member Functions

 session (std::ostream &a_out)
 
virtual ~session ()
 
std::ostream & out () const
 
bool is_valid () const
 
bool steer ()
 
bool sync ()
 
void show_window (HWND a_hwnd)
 
void set_size (HWND a_hwnd, unsigned int a_width, unsigned int a_height)
 

Protected Member Functions

 session (const session &a_from)
 
sessionoperator= (const session &)
 

Protected Attributes

std::ostream & m_out
 

Detailed Description

Definition at line 15 of file session.

Constructor & Destructor Documentation

◆ session() [1/2]

tools::Windows::session::session ( std::ostream &  a_out)
inline

Definition at line 17 of file session.

17 :m_out(a_out){}

◆ ~session()

virtual tools::Windows::session::~session ( )
inlinevirtual

Definition at line 18 of file session.

18 {}

◆ session() [2/2]

tools::Windows::session::session ( const session a_from)
inlineprotected

Definition at line 20 of file session.

20 :m_out(a_from.m_out){}

Member Function Documentation

◆ is_valid()

bool tools::Windows::session::is_valid ( ) const
inline

Definition at line 25 of file session.

25 {return true;}

◆ operator=()

session& tools::Windows::session::operator= ( const session )
inlineprotected

Definition at line 21 of file session.

21 {return *this;}

◆ out()

std::ostream& tools::Windows::session::out ( ) const
inline

Definition at line 23 of file session.

23 {return m_out;}

◆ set_size()

void tools::Windows::session::set_size ( HWND  a_hwnd,
unsigned int  a_width,
unsigned int  a_height 
)
inline

Definition at line 60 of file session.

60  {
61  ::MoveWindow(a_hwnd,0,0,a_width,a_height,TRUE);
62  }

◆ show_window()

void tools::Windows::session::show_window ( HWND  a_hwnd)
inline

Definition at line 53 of file session.

53  {
54  ::SetForegroundWindow(a_hwnd);
55  ::ShowWindow(a_hwnd,SW_SHOWDEFAULT);
56  ::UpdateWindow(a_hwnd);
57  ::DrawMenuBar(a_hwnd);
58  }

◆ steer()

bool tools::Windows::session::steer ( )
inline

Definition at line 27 of file session.

27  {
28  while(true) {
29  MSG event;
30  BOOL status = ::GetMessage(&event,NULL,0,0);
31  if(status == -1) { // This may happen (dixit Microsoft doc).
32  break;
33  } else if(status == 0) { //WM_QUIT
34  break;
35  } else {
36  ::TranslateMessage(&event);
37  ::DispatchMessage (&event);
38  }
39  }
40  return true;
41  }

◆ sync()

bool tools::Windows::session::sync ( )
inline

Definition at line 43 of file session.

43  {
44  MSG event;
45  while(::PeekMessage(&event,NULL,0,0,PM_REMOVE)) {
46  if(event.message==WM_QUIT) return false;
47  ::TranslateMessage(&event);
48  ::DispatchMessage(&event);
49  }
50  return true;
51  }

Member Data Documentation

◆ m_out

std::ostream& tools::Windows::session::m_out
protected

Definition at line 68 of file session.


The documentation for this class was generated from the following file:
tools::Windows::session::m_out
std::ostream & m_out
Definition: session:68
tools::wroot::streamer__info::BOOL
@ BOOL
Definition: element:32