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

Public Member Functions

 session (std::ostream &a_out, int &a_argc, char **a_argv)
 
virtual ~session ()
 
std::ostream & out () const
 
bool is_valid ()
 
bool steer ()
 
bool sync ()
 
Widget get_app_widget ()
 

Protected Member Functions

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

Protected Attributes

std::ostream & m_out
 
bool m_app_owner
 
XtAppContext m_app_context
 
Widget m_app_widget
 

Detailed Description

Definition at line 16 of file session.

Constructor & Destructor Documentation

◆ session() [1/2]

tools::Xt::session::session ( std::ostream &  a_out,
int &  a_argc,
char **  a_argv 
)
inline

Definition at line 18 of file session.

19  :m_out(a_out),m_app_context(0),m_app_widget(0)
20  {
21  //LookDSM_Problem();
22  Arg args[1];
23  XtSetArg(args[0],XtNgeometry,XtNewString("100x100"));
24  m_app_widget = ::XtAppInitialize(&m_app_context,"tools::Xt::session",NULL,(Cardinal)0,&a_argc,a_argv,NULL,args,1);
25  if(!m_app_context || !m_app_widget) {
26  m_app_context = 0;
27  m_app_widget = 0;
28  }
29  }

◆ ~session()

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

Definition at line 30 of file session.

30  {
31  if(m_app_widget) {::XtDestroyWidget(m_app_widget);m_app_widget = 0;}
32  if(m_app_context) {::XtDestroyApplicationContext(m_app_context);m_app_context = 0;}
33  }

◆ session() [2/2]

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

Definition at line 35 of file session.

36  :m_out(a_from.m_out),m_app_context(0),m_app_widget(0)
37  {}

Member Function Documentation

◆ get_app_widget()

Widget tools::Xt::session::get_app_widget ( )
inline

Definition at line 67 of file session.

67 {return m_app_widget;}

◆ is_valid()

bool tools::Xt::session::is_valid ( )
inline

Definition at line 41 of file session.

41 {return m_app_context && m_app_widget?true:false;}

◆ operator=()

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

Definition at line 38 of file session.

38 {return *this;}

◆ out()

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

Definition at line 40 of file session.

40 {return m_out;}

◆ steer()

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

Definition at line 42 of file session.

42  {
43  if(!m_app_context) return false;
44  while(true) {
45  XEvent event;
46  ::XtAppNextEvent(m_app_context,&event);
47  ::XtDispatchEvent(&event);
48  //if(m_exit) break;
49  }
50  return true;
51  }

◆ sync()

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

Definition at line 52 of file session.

52  {
53  //if(!m_app_widget) return false;
54  //Display* display = XtDisplay(m_app_widget);
55  //::XSync(display,False);
56  if(!m_app_context) return false;
57  while(true) {
58  XtInputMask input = ::XtAppPending(m_app_context);
59  if(input==0) break;
60  XEvent event;
61  ::XtAppNextEvent(m_app_context,&event);
62  ::XtDispatchEvent(&event);
63  }
64  return true;
65  }

Member Data Documentation

◆ m_app_context

XtAppContext tools::Xt::session::m_app_context
protected

Definition at line 71 of file session.

◆ m_app_owner

bool tools::Xt::session::m_app_owner
protected

Definition at line 70 of file session.

◆ m_app_widget

Widget tools::Xt::session::m_app_widget
protected

Definition at line 72 of file session.

◆ m_out

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

Definition at line 69 of file session.


The documentation for this class was generated from the following file:
tools::Xt::session::m_app_widget
Widget m_app_widget
Definition: session:72
tools::Xt::session::m_app_context
XtAppContext m_app_context
Definition: session:71
tools::Xt::session::m_out
std::ostream & m_out
Definition: session:69