/*****************************************************************************/ /* Allow the caller to be notified on X server failure Specifiedcallbackcandoanycleanupthatneedstobedoneonexit, likeremovingtemporaryfiles.Thisisthelastfunctioncalled.
Don't worry about memory leaks */ void
xcommon_set_x_server_fatal_handler(x_server_fatal_cb_type handler)
{
x_server_fatal_handler = handler;
}
/*****************************************************************************/ /* The X server had an internal error */ staticint
xcommon_fatal_handler(Display *dis)
{ if (x_server_fatal_handler)
{
x_server_fatal_handler();
} return0;
}
/*****************************************************************************/ /* returns time in milliseconds thisislikeg_time2inos_calls,butnotmillisecondssincemachinewas up,somethingelse
this is a time value similar to what the xserver uses */ int
xcommon_get_local_time(void)
{ return g_time3();
}
/******************************************************************************/ /* this should be called first */ int
xcommon_init(void)
{ if (g_display != 0)
{
LOG_DEVEL(LOG_LEVEL_DEBUG, "xcommon_init: xcommon_init already called"); return0;
}
LOG_DEVEL(LOG_LEVEL_INFO, "xcommon_init: connected to display ok");
/* setting the error handlers can cause problem when shutting down
chansrv on some xlibs */
XSetErrorHandler(xcommon_error_handler);
XSetIOErrorHandler(xcommon_fatal_handler);
/*****************************************************************************/ /* returns error thisiscalledtogetanywaitobjectsforthemainloop
timeout can be nil */ int
xcommon_get_wait_objs(tbus *objs, int *count, int *timeout)
{ int lcount;
/*****************************************************************************/ int
xcommon_check_wait_objs(void)
{
XEvent xevent; int clip_rv; int rail_rv;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.