|
| base_session (std::ostream &a_out, unsigned int a_monitor=0) |
|
virtual | ~base_session () |
|
std::ostream & | out () const |
|
Atom | WM_DELETE_WINDOW_atom () const |
|
Atom | SESSION_EXIT_STEER_atom () const |
|
bool | is_valid () const |
|
Display * | display () const |
|
bool | steer () |
|
bool | sync () |
|
bool | event_pending (bool &a_is) |
|
bool | next_event (bool &a_to_exit) |
|
bool | flush () |
|
Window | create_window (const char *a_title, int a_x, int a_y, unsigned int a_width, unsigned int a_height) |
|
void | map_raise_window (Window a_window) const |
|
void | show_window (Window a_window) const |
|
void | hide_window (Window a_window) const |
|
void | resize_window (Window a_window, unsigned int a_width, unsigned int a_height) const |
|
bool | window_size (Window a_window, int &a_width, int &a_height) const |
|
void | delete_window (Window a_window) const |
|
void | set_override_redirect (Window a_window) const |
|
void | set_wm_no_decorations (Window a_window) const |
|
bool | post (Window a_win, long a_0=0, long a_1=0, long a_2=0, long a_3=0, long a_4=0) const |
|
bool | post_EXIT_STEER (Window a_win) |
|
void | add_dispatcher (dispatcher *a_dispatcher) |
|
void | invalidate_dispatchers_with_window (Window a_win) |
|
void | remove_dispatchers_with_window (Window a_win) |
|
bool | dispatch (XEvent &a_event) |
|
Definition at line 22 of file base_session.
◆ base_session() [1/2]
tools::X11::base_session::base_session |
( |
std::ostream & |
a_out, |
|
|
unsigned int |
a_monitor = 0 |
|
) |
| |
|
inline |
Definition at line 33 of file base_session.
43 m_out <<
"tools::X11::base_session::base_session : can't open display." << std::endl;
49 m_out <<
"tools::X11::base_session::base_session : bad monitor index "
50 <<
m_monitor <<
". (#monitors " << monitors <<
")." << std::endl;
58 m_out <<
"tools::X11::base_session::base_session : can't create WM_DELETE_WINDOW Atom." << std::endl;
66 m_out <<
"tools::X11::base_session::base_session :"
67 <<
" can't create TOOLS_X11_SESSION_EXIT_STEER Atom." << std::endl;
◆ ~base_session()
virtual tools::X11::base_session::~base_session |
( |
| ) |
|
|
inlinevirtual |
◆ base_session() [2/2]
tools::X11::base_session::base_session |
( |
const base_session & |
a_from | ) |
|
|
inlineprotected |
◆ add_dispatcher()
void tools::X11::base_session::add_dispatcher |
( |
dispatcher * |
a_dispatcher | ) |
|
|
inline |
◆ clear_dispatchers()
void tools::X11::base_session::clear_dispatchers |
( |
| ) |
|
|
inlineprotected |
◆ create_window()
Window tools::X11::base_session::create_window |
( |
const char * |
a_title, |
|
|
int |
a_x, |
|
|
int |
a_y, |
|
|
unsigned int |
a_width, |
|
|
unsigned int |
a_height |
|
) |
| |
|
inline |
Definition at line 166 of file base_session.
169 XSetWindowAttributes swa;
170 swa.event_mask = StructureNotifyMask | ExposureMask
171 | ButtonPressMask | ButtonReleaseMask | ButtonMotionMask
177 Window window = ::XCreateWindow(
m_display,
179 a_x,a_y,a_width,a_height,
183 (Visual*)CopyFromParent,
184 CWEventMask|CWBackPixel,&swa);
186 m_out <<
"tools::X11::base_session::create_window : can't create a X11 window." << std::endl;
191 ::XStringListToTextProperty((
char**)&a_title,1,&tp);
193 sh.flags = USPosition | USSize;
194 ::XSetWMProperties(
m_display,window,&tp,&tp,0,0,&sh,0,0);
◆ delete_window()
void tools::X11::base_session::delete_window |
( |
Window |
a_window | ) |
const |
|
inline |
◆ dispatch()
bool tools::X11::base_session::dispatch |
( |
XEvent & |
a_event | ) |
|
|
inline |
Definition at line 335 of file base_session.
337 if(!(*it)->is_valid()) {
338 dispatcher* obj = *it;
346 if((*it)->is_valid()) {
347 if((*it)->dispatch(a_event))
return true;
◆ display()
Display* tools::X11::base_session::display |
( |
| ) |
const |
|
inline |
◆ event_pending()
bool tools::X11::base_session::event_pending |
( |
bool & |
a_is | ) |
|
|
inline |
◆ flush()
bool tools::X11::base_session::flush |
( |
| ) |
|
|
inline |
◆ hide_window()
void tools::X11::base_session::hide_window |
( |
Window |
a_window | ) |
const |
|
inline |
◆ invalidate_dispatchers_with_window()
void tools::X11::base_session::invalidate_dispatchers_with_window |
( |
Window |
a_win | ) |
|
|
inline |
Definition at line 317 of file base_session.
319 if((*it)->window()==a_win) (*it)->invalidate();
◆ is_valid()
bool tools::X11::base_session::is_valid |
( |
| ) |
const |
|
inline |
◆ map_raise_window()
void tools::X11::base_session::map_raise_window |
( |
Window |
a_window | ) |
const |
|
inline |
◆ next_event()
bool tools::X11::base_session::next_event |
( |
bool & |
a_to_exit | ) |
|
|
inline |
Definition at line 141 of file base_session.
142 if(!
m_display) {a_to_exit =
false;
return false;}
145 if(xevent.type==ClientMessage) {
◆ operator=()
Definition at line 87 of file base_session.
88 if(&a_from==
this)
return *
this;
◆ out()
std::ostream& tools::X11::base_session::out |
( |
| ) |
const |
|
inline |
◆ post()
bool tools::X11::base_session::post |
( |
Window |
a_win, |
|
|
long |
a_0 = 0 , |
|
|
long |
a_1 = 0 , |
|
|
long |
a_2 = 0 , |
|
|
long |
a_3 = 0 , |
|
|
long |
a_4 = 0 |
|
) |
| const |
|
inline |
Definition at line 283 of file base_session.
289 event.type = ClientMessage;
291 event.xclient.window = a_win;
292 event.xclient.message_type = XA_INTEGER;
293 event.xclient.format = 8;
294 event.xclient.data.l[0] = a_0;
295 event.xclient.data.l[1] = a_1;
296 event.xclient.data.l[2] = a_2;
297 event.xclient.data.l[3] = a_3;
298 event.xclient.data.l[4] = a_4;
300 Status stat = ::XSendEvent(
m_display,a_win,False,0L,&event);
303 return (stat==0?
false:
true);
◆ post_EXIT_STEER()
bool tools::X11::base_session::post_EXIT_STEER |
( |
Window |
a_win | ) |
|
|
inline |
◆ remove_dispatchers_with_window()
void tools::X11::base_session::remove_dispatchers_with_window |
( |
Window |
a_win | ) |
|
|
inline |
Definition at line 323 of file base_session.
325 if((*it)->window()==a_win) {
326 dispatcher* obj = *it;
◆ resize_window()
void tools::X11::base_session::resize_window |
( |
Window |
a_window, |
|
|
unsigned int |
a_width, |
|
|
unsigned int |
a_height |
|
) |
| const |
|
inline |
Definition at line 223 of file base_session.
225 unsigned int mask = CWWidth | CWHeight | CWBorderWidth;
226 XWindowChanges changes;
227 changes.border_width = 0;
228 changes.width = a_width;
229 changes.height = a_height;
230 ::XConfigureWindow(
m_display,a_window,mask,&changes);
◆ SESSION_EXIT_STEER_atom()
Atom tools::X11::base_session::SESSION_EXIT_STEER_atom |
( |
| ) |
const |
|
inline |
◆ set_override_redirect()
void tools::X11::base_session::set_override_redirect |
( |
Window |
a_window | ) |
const |
|
inline |
Definition at line 247 of file base_session.
250 XSetWindowAttributes swa;
251 swa.override_redirect = True;
252 ::XChangeWindowAttributes(
m_display,a_window,CWOverrideRedirect,&swa);
◆ set_wm_no_decorations()
void tools::X11::base_session::set_wm_no_decorations |
( |
Window |
a_window | ) |
const |
|
inline |
Definition at line 255 of file base_session.
262 unsigned long functions;
263 unsigned long decorations;
265 unsigned long status;
269 unsigned long mwm_hints_decorations = 1L << 1;
271 Atom atom = ::XInternAtom(
m_display,
"_MOTIF_WM_HINTS",False);
273 m_out <<
"tools::X11::base_session::set_wm_no_decorations : can't create/get _MOTIF_WM_HINTS Atom." << std::endl;
276 prop.flags = mwm_hints_decorations;
278 prop.decorations = 0;
280 ::XChangeProperty(
m_display,a_window,atom,atom,32,PropModeReplace,(
unsigned char*)&prop,5);
◆ show_window()
void tools::X11::base_session::show_window |
( |
Window |
a_window | ) |
const |
|
inline |
◆ steer()
bool tools::X11::base_session::steer |
( |
| ) |
|
|
inline |
Definition at line 101 of file base_session.
107 if(xevent.type==ClientMessage) {
◆ sync()
bool tools::X11::base_session::sync |
( |
| ) |
|
|
inline |
Definition at line 116 of file base_session.
124 if(xevent.type==ClientMessage) {
◆ wait_map_notify()
static Bool tools::X11::base_session::wait_map_notify |
( |
Display * |
, |
|
|
XEvent * |
a_event, |
|
|
char * |
a_arg |
|
) |
| |
|
inlinestaticprotected |
Definition at line 353 of file base_session.
354 return (a_event->type == MapNotify) && (a_event->xmap.window == (Window)a_arg);
◆ wait_unmap_notify()
static Bool tools::X11::base_session::wait_unmap_notify |
( |
Display * |
, |
|
|
XEvent * |
a_event, |
|
|
char * |
a_arg |
|
) |
| |
|
inlinestaticprotected |
Definition at line 356 of file base_session.
357 return (a_event->type == UnmapNotify) && (a_event->xmap.window == (Window)a_arg);
◆ window_size()
bool tools::X11::base_session::window_size |
( |
Window |
a_window, |
|
|
int & |
a_width, |
|
|
int & |
a_height |
|
) |
| const |
|
inline |
Definition at line 233 of file base_session.
234 if(!
m_display) {a_width = 0;a_height = 0;
return false;}
235 XWindowAttributes watbs;
236 if(!XGetWindowAttributes(
m_display,a_window,&watbs)) {a_width = 0;a_height = 0;
return false;}
237 a_width = watbs.width;
238 a_height = watbs.height;
◆ WM_DELETE_WINDOW_atom()
Atom tools::X11::base_session::WM_DELETE_WINDOW_atom |
( |
| ) |
const |
|
inline |
◆ m_dispatchers
std::vector<dispatcher*> tools::X11::base_session::m_dispatchers |
|
protected |
◆ m_display
Display* tools::X11::base_session::m_display |
|
protected |
◆ m_monitor
unsigned int tools::X11::base_session::m_monitor |
|
protected |
◆ m_out
std::ostream& tools::X11::base_session::m_out |
|
protected |
◆ m_SESSION_EXIT_STEER_atom
Atom tools::X11::base_session::m_SESSION_EXIT_STEER_atom |
|
protected |
◆ m_WM_DELETE_WINDOW_atom
Atom tools::X11::base_session::m_WM_DELETE_WINDOW_atom |
|
protected |
The documentation for this class was generated from the following file:
- /Users/barrand/private/dev/softinex/g4tools/g4tools/tools/X11/base_session