otk::Timer-ng!! thanks ManMower for this shizznit!
This commit is contained in:
parent
0afb431644
commit
96a9196cbb
16 changed files with 239 additions and 285 deletions
|
@ -10,7 +10,7 @@ noinst_LTLIBRARIES=libotk.la
|
||||||
|
|
||||||
libotk_la_SOURCES= color.cc display.cc font.cc gccache.cc image.cc \
|
libotk_la_SOURCES= color.cc display.cc font.cc gccache.cc image.cc \
|
||||||
property.cc imagecontrol.cc rect.cc screeninfo.cc \
|
property.cc imagecontrol.cc rect.cc screeninfo.cc \
|
||||||
texture.cc timer.cc timerqueuemanager.cc style.cc \
|
texture.cc timer.cc style.cc \
|
||||||
configuration.cc util.cc widget.cc focuswidget.cc \
|
configuration.cc util.cc widget.cc focuswidget.cc \
|
||||||
button.cc eventhandler.cc eventdispatcher.cc ustring.cc \
|
button.cc eventhandler.cc eventdispatcher.cc ustring.cc \
|
||||||
label.cc focuslabel.cc application.cc appwidget.cc
|
label.cc focuslabel.cc application.cc appwidget.cc
|
||||||
|
@ -34,18 +34,17 @@ otk_test: libotk.a otk_test.cc
|
||||||
|
|
||||||
# local dependencies
|
# local dependencies
|
||||||
application.o: application.cc application.hh eventdispatcher.hh \
|
application.o: application.cc application.hh eventdispatcher.hh \
|
||||||
eventhandler.hh display.hh configuration.hh timerqueuemanager.hh \
|
eventhandler.hh display.hh configuration.hh \
|
||||||
timerqueue.hh timer.hh image.hh color.hh screeninfo.hh rect.hh \
|
timer.hh image.hh color.hh screeninfo.hh rect.hh \
|
||||||
point.hh style.hh font.hh texture.hh util.hh widget.hh
|
point.hh style.hh font.hh texture.hh util.hh widget.hh
|
||||||
appwidget.o: appwidget.cc appwidget.hh widget.hh rect.hh point.hh \
|
appwidget.o: appwidget.cc appwidget.hh widget.hh rect.hh point.hh \
|
||||||
texture.hh color.hh util.hh style.hh font.hh image.hh screeninfo.hh \
|
texture.hh color.hh util.hh style.hh font.hh image.hh screeninfo.hh \
|
||||||
timer.hh configuration.hh eventdispatcher.hh eventhandler.hh \
|
timer.hh configuration.hh eventdispatcher.hh eventhandler.hh \
|
||||||
application.hh display.hh timerqueuemanager.hh timerqueue.hh
|
application.hh display.hh
|
||||||
button.o: button.cc button.hh focuslabel.hh focuswidget.hh widget.hh \
|
button.o: button.cc button.hh focuslabel.hh focuswidget.hh widget.hh \
|
||||||
rect.hh point.hh texture.hh color.hh util.hh style.hh font.hh \
|
rect.hh point.hh texture.hh color.hh util.hh style.hh font.hh \
|
||||||
image.hh screeninfo.hh timer.hh configuration.hh eventdispatcher.hh \
|
image.hh screeninfo.hh timer.hh configuration.hh eventdispatcher.hh \
|
||||||
eventhandler.hh application.hh display.hh timerqueuemanager.hh \
|
eventhandler.hh application.hh display.hh
|
||||||
timerqueue.hh
|
|
||||||
color.o: color.cc color.hh display.hh screeninfo.hh rect.hh point.hh
|
color.o: color.cc color.hh display.hh screeninfo.hh rect.hh point.hh
|
||||||
configuration.o: configuration.cc configuration.hh util.hh
|
configuration.o: configuration.cc configuration.hh util.hh
|
||||||
eventdispatcher.o: eventdispatcher.cc eventdispatcher.hh \
|
eventdispatcher.o: eventdispatcher.cc eventdispatcher.hh \
|
||||||
|
@ -54,13 +53,11 @@ eventhandler.o: eventhandler.cc eventhandler.hh
|
||||||
focuslabel.o: focuslabel.cc focuslabel.hh focuswidget.hh widget.hh \
|
focuslabel.o: focuslabel.cc focuslabel.hh focuswidget.hh widget.hh \
|
||||||
rect.hh point.hh texture.hh color.hh util.hh style.hh font.hh \
|
rect.hh point.hh texture.hh color.hh util.hh style.hh font.hh \
|
||||||
image.hh screeninfo.hh timer.hh configuration.hh eventdispatcher.hh \
|
image.hh screeninfo.hh timer.hh configuration.hh eventdispatcher.hh \
|
||||||
eventhandler.hh application.hh display.hh timerqueuemanager.hh \
|
eventhandler.hh application.hh display.hh
|
||||||
timerqueue.hh
|
|
||||||
focuswidget.o: focuswidget.cc focuswidget.hh widget.hh rect.hh \
|
focuswidget.o: focuswidget.cc focuswidget.hh widget.hh rect.hh \
|
||||||
point.hh texture.hh color.hh util.hh style.hh font.hh image.hh \
|
point.hh texture.hh color.hh util.hh style.hh font.hh image.hh \
|
||||||
screeninfo.hh timer.hh configuration.hh eventdispatcher.hh \
|
screeninfo.hh timer.hh configuration.hh eventdispatcher.hh \
|
||||||
eventhandler.hh application.hh display.hh timerqueuemanager.hh \
|
eventhandler.hh application.hh display.hh
|
||||||
timerqueue.hh
|
|
||||||
font.o: font.cc font.hh util.hh display.hh color.hh screeninfo.hh \
|
font.o: font.cc font.hh util.hh display.hh color.hh screeninfo.hh \
|
||||||
rect.hh point.hh
|
rect.hh point.hh
|
||||||
gccache.o: gccache.cc gccache.hh display.hh color.hh assassin.hh \
|
gccache.o: gccache.cc gccache.hh display.hh color.hh assassin.hh \
|
||||||
|
@ -72,10 +69,10 @@ imagecontrol.o: imagecontrol.cc display.hh color.hh image.hh \
|
||||||
label.o: label.cc label.hh widget.hh rect.hh point.hh texture.hh \
|
label.o: label.cc label.hh widget.hh rect.hh point.hh texture.hh \
|
||||||
color.hh util.hh style.hh font.hh image.hh screeninfo.hh timer.hh \
|
color.hh util.hh style.hh font.hh image.hh screeninfo.hh timer.hh \
|
||||||
configuration.hh eventdispatcher.hh eventhandler.hh application.hh \
|
configuration.hh eventdispatcher.hh eventhandler.hh application.hh \
|
||||||
display.hh timerqueuemanager.hh timerqueue.hh
|
display.hh
|
||||||
otk_test.o: otk_test.cc application.hh eventdispatcher.hh \
|
otk_test.o: otk_test.cc application.hh eventdispatcher.hh \
|
||||||
eventhandler.hh display.hh configuration.hh timerqueuemanager.hh \
|
eventhandler.hh display.hh configuration.hh \
|
||||||
timerqueue.hh timer.hh image.hh color.hh screeninfo.hh rect.hh \
|
timer.hh image.hh color.hh screeninfo.hh rect.hh \
|
||||||
point.hh style.hh font.hh texture.hh util.hh focuswidget.hh widget.hh \
|
point.hh style.hh font.hh texture.hh util.hh focuswidget.hh widget.hh \
|
||||||
appwidget.hh button.hh focuslabel.hh
|
appwidget.hh button.hh focuslabel.hh
|
||||||
property.o: property.cc property.hh screeninfo.hh rect.hh point.hh \
|
property.o: property.cc property.hh screeninfo.hh rect.hh point.hh \
|
||||||
|
@ -88,11 +85,9 @@ style.o: style.cc display.hh util.hh style.hh color.hh font.hh \
|
||||||
configuration.hh
|
configuration.hh
|
||||||
texture.o: texture.cc texture.hh color.hh util.hh display.hh image.hh \
|
texture.o: texture.cc texture.hh color.hh util.hh display.hh image.hh \
|
||||||
screeninfo.hh rect.hh point.hh timer.hh
|
screeninfo.hh rect.hh point.hh timer.hh
|
||||||
timer.o: timer.cc timer.hh timerqueuemanager.hh timerqueue.hh
|
timer.o: timer.cc timer.hh
|
||||||
timerqueuemanager.o: timerqueuemanager.cc timerqueuemanager.hh \
|
|
||||||
timerqueue.hh timer.hh display.hh
|
|
||||||
util.o: util.cc util.hh
|
util.o: util.cc util.hh
|
||||||
widget.o: widget.cc widget.hh rect.hh point.hh texture.hh color.hh \
|
widget.o: widget.cc widget.hh rect.hh point.hh texture.hh color.hh \
|
||||||
util.hh style.hh font.hh image.hh screeninfo.hh timer.hh \
|
util.hh style.hh font.hh image.hh screeninfo.hh timer.hh \
|
||||||
configuration.hh eventdispatcher.hh eventhandler.hh application.hh \
|
configuration.hh eventdispatcher.hh eventhandler.hh application.hh \
|
||||||
display.hh timerqueuemanager.hh timerqueue.hh assassin.hh
|
display.hh assassin.hh
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
#include "application.hh"
|
#include "application.hh"
|
||||||
#include "eventhandler.hh"
|
#include "eventhandler.hh"
|
||||||
#include "widget.hh"
|
#include "widget.hh"
|
||||||
|
#include "timer.hh"
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#ifdef HAVE_STDLIB_H
|
#ifdef HAVE_STDLIB_H
|
||||||
|
@ -29,8 +30,8 @@ Application::Application(int argc, char **argv)
|
||||||
|
|
||||||
const ScreenInfo *s_info = _display.screenInfo(DefaultScreen(*_display));
|
const ScreenInfo *s_info = _display.screenInfo(DefaultScreen(*_display));
|
||||||
|
|
||||||
_timer_manager = new TimerQueueManager();
|
Timer::initialize();
|
||||||
_img_ctrl = new ImageControl(_timer_manager, s_info, True, 4, 5, 200);
|
_img_ctrl = new ImageControl(s_info, True, 4, 5, 200);
|
||||||
_style_conf = new Configuration(False);
|
_style_conf = new Configuration(False);
|
||||||
_style = new Style(_img_ctrl);
|
_style = new Style(_img_ctrl);
|
||||||
|
|
||||||
|
@ -41,8 +42,8 @@ Application::~Application()
|
||||||
{
|
{
|
||||||
delete _style_conf;
|
delete _style_conf;
|
||||||
delete _img_ctrl;
|
delete _img_ctrl;
|
||||||
delete _timer_manager;
|
|
||||||
delete _style;
|
delete _style;
|
||||||
|
Timer::destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::loadStyle(void)
|
void Application::loadStyle(void)
|
||||||
|
@ -68,7 +69,7 @@ void Application::run(void)
|
||||||
|
|
||||||
while (_appwidget_count > 0) {
|
while (_appwidget_count > 0) {
|
||||||
dispatchEvents();
|
dispatchEvents();
|
||||||
_timer_manager->fire(); // fire pending events
|
Timer::dispatchTimers(); // fire pending events
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
#include "eventdispatcher.hh"
|
#include "eventdispatcher.hh"
|
||||||
#include "display.hh"
|
#include "display.hh"
|
||||||
#include "configuration.hh"
|
#include "configuration.hh"
|
||||||
#include "timerqueuemanager.hh"
|
|
||||||
#include "image.hh"
|
#include "image.hh"
|
||||||
#include "style.hh"
|
#include "style.hh"
|
||||||
|
|
||||||
|
@ -33,7 +32,6 @@ private:
|
||||||
void loadStyle(void);
|
void loadStyle(void);
|
||||||
|
|
||||||
Display _display;
|
Display _display;
|
||||||
TimerQueueManager *_timer_manager;
|
|
||||||
ImageControl *_img_ctrl;
|
ImageControl *_img_ctrl;
|
||||||
Configuration *_style_conf;
|
Configuration *_style_conf;
|
||||||
Style *_style;
|
Style *_style;
|
||||||
|
|
|
@ -77,11 +77,10 @@ public:
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ImageControl(otk::TimerQueueManager *timermanager,
|
ImageControl(const otk::ScreenInfo *scrn,
|
||||||
const otk::ScreenInfo *scrn,
|
bool _dither= False, int _cpc = 4,
|
||||||
bool _dither= False, int _cpc = 4,
|
unsigned long cache_timeout = 300000l,
|
||||||
unsigned long cache_timeout = 300000l,
|
unsigned long cmax = 200l);
|
||||||
unsigned long cmax = 200l);
|
|
||||||
virtual ~ImageControl(void);
|
virtual ~ImageControl(void);
|
||||||
|
|
||||||
inline bool doDither(void) { return dither; }
|
inline bool doDither(void) { return dither; }
|
||||||
|
|
|
@ -41,11 +41,10 @@ static unsigned long bsqrt(unsigned long x) {
|
||||||
|
|
||||||
ImageControl *ctrl = 0;
|
ImageControl *ctrl = 0;
|
||||||
|
|
||||||
ImageControl::ImageControl(TimerQueueManager *timermanager,
|
ImageControl::ImageControl(const ScreenInfo *scrn,
|
||||||
const ScreenInfo *scrn,
|
bool _dither, int _cpc,
|
||||||
bool _dither, int _cpc,
|
unsigned long cache_timeout,
|
||||||
unsigned long cache_timeout,
|
unsigned long cmax) {
|
||||||
unsigned long cmax) {
|
|
||||||
if (! ctrl) ctrl = this;
|
if (! ctrl) ctrl = this;
|
||||||
|
|
||||||
screeninfo = scrn;
|
screeninfo = scrn;
|
||||||
|
@ -53,13 +52,10 @@ ImageControl::ImageControl(TimerQueueManager *timermanager,
|
||||||
setColorsPerChannel(_cpc);
|
setColorsPerChannel(_cpc);
|
||||||
|
|
||||||
cache_max = cmax;
|
cache_max = cmax;
|
||||||
if (cache_timeout) {
|
if (cache_timeout)
|
||||||
timer = new Timer(timermanager, (TimeoutHandler)timeout, this);
|
timer = new Timer(cache_timeout, (Timer::TimeoutHandler)timeout, this);
|
||||||
timer->setTimeout(cache_timeout);
|
else
|
||||||
timer->start();
|
|
||||||
} else {
|
|
||||||
timer = (Timer *) 0;
|
timer = (Timer *) 0;
|
||||||
}
|
|
||||||
|
|
||||||
colors = (XColor *) 0;
|
colors = (XColor *) 0;
|
||||||
ncolors = 0;
|
ncolors = 0;
|
||||||
|
@ -350,10 +346,8 @@ ImageControl::~ImageControl(void) {
|
||||||
for (; it != end; ++it)
|
for (; it != end; ++it)
|
||||||
XFreePixmap(**display, it->pixmap);
|
XFreePixmap(**display, it->pixmap);
|
||||||
}
|
}
|
||||||
if (timer) {
|
if (timer)
|
||||||
timer->stop();
|
|
||||||
delete timer;
|
delete timer;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -26,8 +26,6 @@
|
||||||
#include "style.hh"
|
#include "style.hh"
|
||||||
#include "texture.hh"
|
#include "texture.hh"
|
||||||
#include "timer.hh"
|
#include "timer.hh"
|
||||||
#include "timerqueue.hh"
|
|
||||||
#include "timerqueuemanager.hh"
|
|
||||||
#include "util.hh"
|
#include "util.hh"
|
||||||
#include "ustring.hh"
|
#include "ustring.hh"
|
||||||
#include "widget.hh"
|
#include "widget.hh"
|
||||||
|
|
|
@ -76,8 +76,6 @@ namespace otk {
|
||||||
%include "style.hh"
|
%include "style.hh"
|
||||||
%include "texture.hh"
|
%include "texture.hh"
|
||||||
%include "timer.hh"
|
%include "timer.hh"
|
||||||
%include "timerqueue.hh"
|
|
||||||
%include "timerqueuemanager.hh"
|
|
||||||
%include "util.hh"
|
%include "util.hh"
|
||||||
%include "widget.hh"
|
%include "widget.hh"
|
||||||
|
|
||||||
|
|
210
otk/timer.cc
210
otk/timer.cc
|
@ -5,121 +5,127 @@
|
||||||
#endif // HAVE_CONFIG_H
|
#endif // HAVE_CONFIG_H
|
||||||
|
|
||||||
#include "timer.hh"
|
#include "timer.hh"
|
||||||
#include "timerqueuemanager.hh"
|
#include "display.hh"
|
||||||
|
|
||||||
namespace otk {
|
namespace otk {
|
||||||
|
|
||||||
static timeval normalizeTimeval(const timeval &tm)
|
timeval Timer::_nearest_timeout, Timer::_now;
|
||||||
{
|
Timer::TimerQ Timer::_q;
|
||||||
timeval ret = tm;
|
|
||||||
|
|
||||||
while (ret.tv_usec < 0) {
|
void Timer::timevalAdd(timeval &a, long msec)
|
||||||
if (ret.tv_sec > 0) {
|
{
|
||||||
--ret.tv_sec;
|
a.tv_sec += msec / 1000;
|
||||||
ret.tv_usec += 1000000;
|
a.tv_usec += (msec % 1000) * 1000;
|
||||||
} else {
|
a.tv_sec += a.tv_usec / 1000000;
|
||||||
ret.tv_usec = 0;
|
a.tv_usec %= 1000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Timer::nearestTimeout(struct timeval &tm)
|
||||||
|
{
|
||||||
|
if (_q.empty())
|
||||||
|
return false;
|
||||||
|
tm.tv_sec = _nearest_timeout.tv_sec - _now.tv_sec;
|
||||||
|
tm.tv_usec = _nearest_timeout.tv_usec - _now.tv_usec;
|
||||||
|
|
||||||
|
while (tm.tv_usec < 0) {
|
||||||
|
tm.tv_usec += 1000000;
|
||||||
|
tm.tv_sec--;
|
||||||
|
}
|
||||||
|
tm.tv_sec += tm.tv_usec / 1000000;
|
||||||
|
tm.tv_usec %= 1000000;
|
||||||
|
if (tm.tv_sec < 0)
|
||||||
|
tm.tv_sec = 0;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Timer::dispatchTimers(bool wait)
|
||||||
|
{
|
||||||
|
fd_set selset;
|
||||||
|
int fd;
|
||||||
|
timeval next;
|
||||||
|
Timer *curr;
|
||||||
|
|
||||||
|
gettimeofday(&_now, NULL);
|
||||||
|
_nearest_timeout = _now;
|
||||||
|
_nearest_timeout.tv_sec += 10000;
|
||||||
|
|
||||||
|
while (!_q.empty()) {
|
||||||
|
curr = _q.top();
|
||||||
|
/* since we overload the destructor to keep from removing from the middle of
|
||||||
|
the priority queue, set _del_me, we have to do our real delete in here.
|
||||||
|
*/
|
||||||
|
if (curr->_del_me) {
|
||||||
|
_q.pop();
|
||||||
|
realDelete(curr);
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// the queue is sorted, so if this timer shouldn't fire, none are ready
|
||||||
|
_nearest_timeout = curr->_timeout;
|
||||||
|
if (!timercmp(&_now, &_nearest_timeout, >))
|
||||||
|
break;
|
||||||
|
|
||||||
|
/* we set the last fired time to delay msec after the previous firing, then
|
||||||
|
re-insert. timers maintain their order and may trigger more than once if
|
||||||
|
they've waited more than one delay's worth of time.
|
||||||
|
*/
|
||||||
|
_q.pop();
|
||||||
|
timevalAdd(curr->_last, curr->_delay);
|
||||||
|
curr->_action(curr->_data);
|
||||||
|
timevalAdd(curr->_timeout, curr->_delay);
|
||||||
|
_q.push(curr);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ret.tv_usec >= 1000000) {
|
if (wait) {
|
||||||
ret.tv_sec += ret.tv_usec / 1000000;
|
// wait for the nearest trigger, or for X to do something interesting
|
||||||
ret.tv_usec %= 1000000;
|
fd = ConnectionNumber(**display);
|
||||||
}
|
FD_ZERO(&selset);
|
||||||
|
FD_SET(fd, &selset);
|
||||||
if (ret.tv_sec < 0) ret.tv_sec = 0;
|
if (nearestTimeout(next))
|
||||||
|
select(fd + 1, &selset, NULL, NULL, &next);
|
||||||
return ret;
|
else
|
||||||
}
|
select(fd + 1, &selset, NULL, NULL, NULL);
|
||||||
|
|
||||||
|
|
||||||
Timer::Timer(TimerQueueManager *m, TimeoutHandler h, TimeoutData d)
|
|
||||||
{
|
|
||||||
_manager = m;
|
|
||||||
_handler = h;
|
|
||||||
_data = d;
|
|
||||||
|
|
||||||
_recur = _timing = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Timer::~Timer(void)
|
|
||||||
{
|
|
||||||
if (_timing) stop();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Timer::setTimeout(long t)
|
|
||||||
{
|
|
||||||
_timeout.tv_sec = t / 1000;
|
|
||||||
_timeout.tv_usec = t % 1000;
|
|
||||||
_timeout.tv_usec *= 1000;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Timer::setTimeout(const timeval &t)
|
|
||||||
{
|
|
||||||
_timeout.tv_sec = t.tv_sec;
|
|
||||||
_timeout.tv_usec = t.tv_usec;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Timer::start(void)
|
|
||||||
{
|
|
||||||
gettimeofday(&_start, 0);
|
|
||||||
|
|
||||||
if (! _timing) {
|
|
||||||
_timing = true;
|
|
||||||
_manager->addTimer(this);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Timer::Timer(long delay, Timer::TimeoutHandler action, void *data)
|
||||||
void Timer::stop(void)
|
: _delay(delay),
|
||||||
|
_action(action),
|
||||||
|
_data(data),
|
||||||
|
_del_me(false),
|
||||||
|
_last(_now),
|
||||||
|
_timeout(_now)
|
||||||
{
|
{
|
||||||
if (_timing) {
|
timevalAdd(_timeout, delay);
|
||||||
_timing = false;
|
_q.push(this);
|
||||||
|
}
|
||||||
|
|
||||||
_manager->removeTimer(this);
|
void Timer::operator delete(void *self)
|
||||||
|
{
|
||||||
|
Timer *t;
|
||||||
|
t = (Timer *)self;
|
||||||
|
t->_del_me = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Timer::realDelete(Timer *me)
|
||||||
|
{
|
||||||
|
::delete me;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Timer::initialize(void)
|
||||||
|
{
|
||||||
|
gettimeofday(&_now, NULL);
|
||||||
|
_nearest_timeout.tv_sec = 100000;
|
||||||
|
_nearest_timeout.tv_usec = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Timer::destroy(void)
|
||||||
|
{
|
||||||
|
while(!_q.empty()) {
|
||||||
|
realDelete(_q.top());
|
||||||
|
_q.pop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Timer::fire(void)
|
|
||||||
{
|
|
||||||
if (_handler)
|
|
||||||
_handler(_data);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
timeval Timer::remainingTime(const timeval &tm) const
|
|
||||||
{
|
|
||||||
timeval ret = endTime();
|
|
||||||
|
|
||||||
ret.tv_sec -= tm.tv_sec;
|
|
||||||
ret.tv_usec -= tm.tv_usec;
|
|
||||||
|
|
||||||
return normalizeTimeval(ret);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
timeval Timer::endTime(void) const
|
|
||||||
{
|
|
||||||
timeval ret;
|
|
||||||
|
|
||||||
ret.tv_sec = _start.tv_sec + _timeout.tv_sec;
|
|
||||||
ret.tv_usec = _start.tv_usec + _timeout.tv_usec;
|
|
||||||
|
|
||||||
return normalizeTimeval(ret);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool Timer::shouldFire(const timeval &tm) const
|
|
||||||
{
|
|
||||||
timeval end = endTime();
|
|
||||||
|
|
||||||
return ! ((tm.tv_sec < end.tv_sec) ||
|
|
||||||
(tm.tv_sec == end.tv_sec && tm.tv_usec < end.tv_usec));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
171
otk/timer.hh
171
otk/timer.hh
|
@ -2,6 +2,10 @@
|
||||||
#ifndef __timer_hh
|
#ifndef __timer_hh
|
||||||
#define __timer_hh
|
#define __timer_hh
|
||||||
|
|
||||||
|
/*! @file timer.hh
|
||||||
|
@brief Contains the Timer class, used for timed callbacks.
|
||||||
|
*/
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#ifdef TIME_WITH_SYS_TIME
|
#ifdef TIME_WITH_SYS_TIME
|
||||||
# include <sys/time.h>
|
# include <sys/time.h>
|
||||||
|
@ -13,120 +17,109 @@ extern "C" {
|
||||||
# include <time.h>
|
# include <time.h>
|
||||||
# endif // HAVE_SYS_TIME_H
|
# endif // HAVE_SYS_TIME_H
|
||||||
#endif // TIME_WITH_SYS_TIME
|
#endif // TIME_WITH_SYS_TIME
|
||||||
|
|
||||||
|
#ifdef HAVE_UNISTD_H
|
||||||
|
# include <sys/types.h>
|
||||||
|
# include <unistd.h>
|
||||||
|
#endif // HAVE_UNISTD_H
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#include <queue>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
namespace otk {
|
namespace otk {
|
||||||
|
|
||||||
class TimerQueueManager;
|
//! The Timer class implements timed callbacks.
|
||||||
|
|
||||||
//! The data passed to the TimeoutHandler function.
|
|
||||||
/*!
|
/*!
|
||||||
Note: this is a very useful place to put an object instance, and set the
|
The Timer class can be used to have a callback fire after a given time
|
||||||
event handler to a static function in the same class.
|
interval. A created Timer will fire repetitively until it is destroyed.
|
||||||
*/
|
*/
|
||||||
typedef void *TimeoutData;
|
|
||||||
//! The type of function which can be set as the callback for a Timer firing
|
|
||||||
typedef void (*TimeoutHandler)(TimeoutData);
|
|
||||||
|
|
||||||
//! A Timer class which will fire a function when its time elapses
|
|
||||||
class Timer {
|
class Timer {
|
||||||
|
public:
|
||||||
|
//! Data type of Timer callback
|
||||||
|
typedef void (*TimeoutHandler)(void *data);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
//! The manager which to add ourself to and remove ourself after we are done
|
//! Compares two timeval structs
|
||||||
TimerQueueManager *_manager;
|
struct TimerCompare {
|
||||||
//! The function to call when the time elapses
|
//! Compares two timeval structs
|
||||||
TimeoutHandler _handler;
|
inline bool operator()(const Timer *a, const Timer *b) const {
|
||||||
//! The data which gets passed along to the TimeoutHandler
|
return timercmp(&a->_timeout, &b->_timeout, >);
|
||||||
TimeoutData _data;
|
}
|
||||||
//! Determines if the timer is currently started
|
};
|
||||||
bool _timing;
|
|
||||||
//! When this is true, the timer will reset itself to fire again every time
|
|
||||||
bool _recur;
|
|
||||||
|
|
||||||
//! The time at which the timer started
|
typedef
|
||||||
timeval _start;
|
std::priority_queue<Timer*, std::vector<Timer*>, TimerCompare> TimerQ;
|
||||||
//! The time at which the timer is going to fire
|
|
||||||
timeval _timeout;
|
|
||||||
|
|
||||||
//! Disallows copying of Timer objects
|
//! Milliseconds between timer firings
|
||||||
Timer(const Timer&);
|
long _delay;
|
||||||
//! Disallows copying of Timer objects
|
//! Callback for timer expiry
|
||||||
Timer& operator=(const Timer&);
|
TimeoutHandler _action;
|
||||||
|
//! Data sent to callback
|
||||||
|
void *_data;
|
||||||
|
//! We overload the delete operator to just set this to true
|
||||||
|
bool _del_me;
|
||||||
|
//! The time the last fire should've been at
|
||||||
|
struct timeval _last;
|
||||||
|
//! When this timer will next trigger
|
||||||
|
struct timeval _timeout;
|
||||||
|
|
||||||
|
//! Queue of pending timers
|
||||||
|
static TimerQ _q;
|
||||||
|
//! Time next timer will expire
|
||||||
|
static timeval _nearest_timeout;
|
||||||
|
//! Time at start of current processing loop
|
||||||
|
static timeval _now;
|
||||||
|
|
||||||
|
//! Really delete something (not just flag for later)
|
||||||
|
/*!
|
||||||
|
@param self Timer to be deleted.
|
||||||
|
*/
|
||||||
|
static void realDelete(Timer *self);
|
||||||
|
|
||||||
|
//! Adds a millisecond delay to a timeval structure
|
||||||
|
/*!
|
||||||
|
@param a Amount of time to increment.
|
||||||
|
@param msec Number of milliseconds to increment by.
|
||||||
|
*/
|
||||||
|
static void timevalAdd(timeval &a, long msec);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
//! Constructs a new Timer object
|
//! Constructs a new running timer and queues it
|
||||||
/*!
|
/*!
|
||||||
@param m The TimerQueueManager with which to associate. The manager
|
@param delay Time in milliseconds between firings
|
||||||
specified will be resposible for making this timer fire.
|
@param cb The function to be called on fire.
|
||||||
@param h The function to call when the timer fires
|
@param data Data to be passed to the callback on fire.
|
||||||
@param d The data to pass along to the function call when the timer fires
|
|
||||||
*/
|
*/
|
||||||
Timer(TimerQueueManager *m, TimeoutHandler h, TimeoutData d);
|
Timer(long delay, TimeoutHandler cb, void *data);
|
||||||
//! Destroys the Timer object
|
|
||||||
virtual ~Timer();
|
|
||||||
|
|
||||||
//! Fires the timer, calling its TimeoutHandler
|
//! Overloaded delete so we can leave deleted objects in queue for later reap
|
||||||
void fire();
|
|
||||||
|
|
||||||
//! Returns if the Timer is started and timing
|
|
||||||
inline bool timing() const { return _timing; }
|
|
||||||
//! Returns if the Timer is going to repeat
|
|
||||||
inline bool recurring() const { return _recur; }
|
|
||||||
|
|
||||||
//! Gets the amount of time the Timer should last before firing
|
|
||||||
inline const timeval &timeout() const { return _timeout; }
|
|
||||||
//! Gets the time at which the Timer started
|
|
||||||
inline const timeval &startTime() const { return _start; }
|
|
||||||
|
|
||||||
//! Gets the amount of time left before the Timer fires
|
|
||||||
timeval remainingTime(const timeval &tm) const;
|
|
||||||
//! Returns if the Timer is past its timeout time, and should fire
|
|
||||||
bool shouldFire(const timeval &tm) const;
|
|
||||||
|
|
||||||
//! Gets the time at which the Timer will fire
|
|
||||||
timeval endTime() const;
|
|
||||||
|
|
||||||
//! Sets the Timer to repeat or not
|
|
||||||
/*!
|
/*!
|
||||||
@param b If true, the timer is set to repeat; otherwise, it will fire only
|
@param self Pointer to current instance of Timer.
|
||||||
once
|
|
||||||
*/
|
*/
|
||||||
inline void setRecurring(bool b) { _recur = b; }
|
void operator delete(void *self);
|
||||||
|
|
||||||
//! Sets the amount of time for the Timer to last in milliseconds
|
//! Dispatches all elligible timers, then optionally waits for X events
|
||||||
/*!
|
/*!
|
||||||
@param t The number of milliseconds the timer should last
|
@param wait Whether to wait for X events after processing timers.
|
||||||
*/
|
*/
|
||||||
void setTimeout(long t);
|
static void dispatchTimers(bool wait = true);
|
||||||
//! Sets the amount of time the Timer should last before firing
|
|
||||||
/*!
|
|
||||||
@param t The amount of time the timer should last
|
|
||||||
*/
|
|
||||||
void setTimeout(const timeval &t);
|
|
||||||
|
|
||||||
//! Causes the timer to begin
|
//! Returns a relative timeval (to pass select) of the next timer
|
||||||
/*!
|
/*!
|
||||||
The timer fires after the time in Timer::getTimeout has passed since this
|
@param tm Changed to hold the time until next timer.
|
||||||
function was called.
|
@return true if there are any timers queued, and the timeout is being
|
||||||
Calling this function while the timer is already started will cause it to
|
returned in 'tm'. false if there are no timers queued.
|
||||||
restart its countdown.
|
|
||||||
*/
|
*/
|
||||||
void start(); // manager acquires timer
|
static bool nearestTimeout(struct timeval &tm);
|
||||||
//! Causes the timer to stop
|
|
||||||
/*!
|
|
||||||
The timer will no longer fire once this function has been called.
|
|
||||||
Calling this function more than once does not have any effect.
|
|
||||||
*/
|
|
||||||
void stop(); // manager releases timer
|
|
||||||
|
|
||||||
//! Determines if this Timer will fire before a second Timer object
|
//! Initializes internal data before use
|
||||||
/*!
|
static void initialize(void);
|
||||||
@param other The second Timer with which to compare
|
|
||||||
@return true if this Timer will fire before 'other'; otherwise, false
|
//! Deletes all waiting timers
|
||||||
*/
|
static void destroy(void);
|
||||||
bool operator<(const Timer& other) const
|
|
||||||
{ return shouldFire(other.endTime()); }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // __timer_hh
|
#endif // __timer.hh
|
||||||
|
|
|
@ -145,17 +145,17 @@ KeyBindingTree *Bindings::buildtree(const StringVect &keylist,
|
||||||
Bindings::Bindings()
|
Bindings::Bindings()
|
||||||
: _curpos(&_keytree),
|
: _curpos(&_keytree),
|
||||||
_resetkey(0,0),
|
_resetkey(0,0),
|
||||||
_timer(openbox->timerManager(),
|
_timer((otk::Timer *) 0)
|
||||||
(otk::TimeoutHandler)resetChains, this)
|
|
||||||
{
|
{
|
||||||
_timer.setTimeout(5000); // chains reset after 5 seconds
|
|
||||||
|
|
||||||
// setResetKey("C-g"); // set the default reset key
|
// setResetKey("C-g"); // set the default reset key
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Bindings::~Bindings()
|
Bindings::~Bindings()
|
||||||
{
|
{
|
||||||
|
if (_timer)
|
||||||
|
delete _timer;
|
||||||
|
|
||||||
grabKeys(false);
|
grabKeys(false);
|
||||||
removeAllKeys();
|
removeAllKeys();
|
||||||
// removeAllButtons(); XXX
|
// removeAllButtons(); XXX
|
||||||
|
@ -379,7 +379,11 @@ void Bindings::fireKey(int screen, unsigned int modifiers, unsigned int key,
|
||||||
while (p) {
|
while (p) {
|
||||||
if (p->binding.key == key && p->binding.modifiers == modifiers) {
|
if (p->binding.key == key && p->binding.modifiers == modifiers) {
|
||||||
if (p->chain) {
|
if (p->chain) {
|
||||||
_timer.start(); // start/restart the timer
|
if (_timer)
|
||||||
|
delete _timer;
|
||||||
|
_timer = new otk::Timer(5000, // 5 second timeout
|
||||||
|
(otk::Timer::TimeoutHandler)resetChains,
|
||||||
|
this);
|
||||||
// grab the server here to make sure no key pressed go missed
|
// grab the server here to make sure no key pressed go missed
|
||||||
otk::display->grab();
|
otk::display->grab();
|
||||||
grabKeys(false);
|
grabKeys(false);
|
||||||
|
@ -403,7 +407,10 @@ void Bindings::fireKey(int screen, unsigned int modifiers, unsigned int key,
|
||||||
|
|
||||||
void Bindings::resetChains(Bindings *self)
|
void Bindings::resetChains(Bindings *self)
|
||||||
{
|
{
|
||||||
self->_timer.stop();
|
if (self->_timer) {
|
||||||
|
delete self->_timer;
|
||||||
|
self->_timer = (otk::Timer *) 0;
|
||||||
|
}
|
||||||
// grab the server here to make sure no key pressed go missed
|
// grab the server here to make sure no key pressed go missed
|
||||||
otk::display->grab();
|
otk::display->grab();
|
||||||
self->grabKeys(false);
|
self->grabKeys(false);
|
||||||
|
|
|
@ -67,7 +67,7 @@ private:
|
||||||
|
|
||||||
Binding _resetkey; // the key which resets the key chain status
|
Binding _resetkey; // the key which resets the key chain status
|
||||||
|
|
||||||
otk::Timer _timer;
|
otk::Timer *_timer;
|
||||||
|
|
||||||
KeyBindingTree *find(KeyBindingTree *search, bool *conflict) const;
|
KeyBindingTree *find(KeyBindingTree *search, bool *conflict) const;
|
||||||
KeyBindingTree *buildtree(const StringVect &keylist,
|
KeyBindingTree *buildtree(const StringVect &keylist,
|
||||||
|
|
|
@ -113,6 +113,7 @@ Openbox::Openbox(int argc, char **argv)
|
||||||
sigaction(SIGINT, &action, (struct sigaction *) 0);
|
sigaction(SIGINT, &action, (struct sigaction *) 0);
|
||||||
sigaction(SIGHUP, &action, (struct sigaction *) 0);
|
sigaction(SIGHUP, &action, (struct sigaction *) 0);
|
||||||
|
|
||||||
|
otk::Timer::initialize();
|
||||||
_property = new otk::Property();
|
_property = new otk::Property();
|
||||||
_actions = new Actions();
|
_actions = new Actions();
|
||||||
_bindings = new Bindings();
|
_bindings = new Bindings();
|
||||||
|
@ -194,6 +195,8 @@ Openbox::~Openbox()
|
||||||
// all im gunna do is the same.
|
// all im gunna do is the same.
|
||||||
//otk::display->destroy();
|
//otk::display->destroy();
|
||||||
|
|
||||||
|
otk::Timer::destroy();
|
||||||
|
|
||||||
if (_restart) {
|
if (_restart) {
|
||||||
if (!_restart_prog.empty()) {
|
if (!_restart_prog.empty()) {
|
||||||
const std::string &dstr =
|
const std::string &dstr =
|
||||||
|
@ -320,7 +323,7 @@ void Openbox::eventLoop()
|
||||||
XFlush(**otk::display); // flush here before we go wait for timers
|
XFlush(**otk::display); // flush here before we go wait for timers
|
||||||
// don't wait if we're to shutdown
|
// don't wait if we're to shutdown
|
||||||
if (_shutdown) break;
|
if (_shutdown) break;
|
||||||
_timermanager.fire(!_sync); // wait if not in sync mode
|
otk::Timer::dispatchTimers(!_sync); // wait if not in sync mode
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,6 @@ extern "C" {
|
||||||
|
|
||||||
#include "otk/display.hh"
|
#include "otk/display.hh"
|
||||||
#include "otk/screeninfo.hh"
|
#include "otk/screeninfo.hh"
|
||||||
#include "otk/timerqueuemanager.hh"
|
|
||||||
#include "otk/property.hh"
|
#include "otk/property.hh"
|
||||||
#include "otk/configuration.hh"
|
#include "otk/configuration.hh"
|
||||||
#include "otk/eventdispatcher.hh"
|
#include "otk/eventdispatcher.hh"
|
||||||
|
@ -109,13 +108,6 @@ private:
|
||||||
//! A list of all the managed screens
|
//! A list of all the managed screens
|
||||||
ScreenList _screens;
|
ScreenList _screens;
|
||||||
|
|
||||||
//! Manages all timers for the application
|
|
||||||
/*!
|
|
||||||
Use of the otk::TimerQueueManager::fire funtion in this object ensures
|
|
||||||
that all timers fire when their times elapse.
|
|
||||||
*/
|
|
||||||
otk::TimerQueueManager _timermanager;
|
|
||||||
|
|
||||||
//! Cached atoms on the display
|
//! Cached atoms on the display
|
||||||
/*!
|
/*!
|
||||||
This is a pointer because the Property class uses otk::Display::display
|
This is a pointer because the Property class uses otk::Display::display
|
||||||
|
@ -185,13 +177,6 @@ public:
|
||||||
//! Returns the state of the window manager (starting, exiting, etc)
|
//! Returns the state of the window manager (starting, exiting, etc)
|
||||||
inline RunState state() const { return _state; }
|
inline RunState state() const { return _state; }
|
||||||
|
|
||||||
//! Returns the otk::TimerQueueManager for the application
|
|
||||||
/*!
|
|
||||||
All otk::Timer objects used in the application should be made to use this
|
|
||||||
otk::TimerQueueManager.
|
|
||||||
*/
|
|
||||||
inline otk::TimerQueueManager *timerManager() { return &_timermanager; }
|
|
||||||
|
|
||||||
//! Returns the otk::Property instance for the window manager
|
//! Returns the otk::Property instance for the window manager
|
||||||
inline const otk::Property *property() const { return _property; }
|
inline const otk::Property *property() const { return _property; }
|
||||||
|
|
||||||
|
|
|
@ -446,7 +446,6 @@ class Openbox(EventDispatcher,EventHandler):
|
||||||
State_Normal = _openbox.Openbox_State_Normal
|
State_Normal = _openbox.Openbox_State_Normal
|
||||||
State_Exiting = _openbox.Openbox_State_Exiting
|
State_Exiting = _openbox.Openbox_State_Exiting
|
||||||
def state(*args): return apply(_openbox.Openbox_state,args)
|
def state(*args): return apply(_openbox.Openbox_state,args)
|
||||||
def timerManager(*args): return apply(_openbox.Openbox_timerManager,args)
|
|
||||||
def property(*args): return apply(_openbox.Openbox_property,args)
|
def property(*args): return apply(_openbox.Openbox_property,args)
|
||||||
def actions(*args): return apply(_openbox.Openbox_actions,args)
|
def actions(*args): return apply(_openbox.Openbox_actions,args)
|
||||||
def bindings(*args): return apply(_openbox.Openbox_bindings,args)
|
def bindings(*args): return apply(_openbox.Openbox_bindings,args)
|
||||||
|
|
|
@ -706,8 +706,7 @@ SWIG_InstallConstants(PyObject *d, swig_const_info constants[]) {
|
||||||
#define SWIGTYPE_p_XMotionEvent swig_types[58]
|
#define SWIGTYPE_p_XMotionEvent swig_types[58]
|
||||||
#define SWIGTYPE_p_XButtonEvent swig_types[59]
|
#define SWIGTYPE_p_XButtonEvent swig_types[59]
|
||||||
#define SWIGTYPE_p_XSelectionEvent swig_types[60]
|
#define SWIGTYPE_p_XSelectionEvent swig_types[60]
|
||||||
#define SWIGTYPE_p_otk__TimerQueueManager swig_types[61]
|
static swig_type_info *swig_types[62];
|
||||||
static swig_type_info *swig_types[63];
|
|
||||||
|
|
||||||
/* -------- TYPES TABLE (END) -------- */
|
/* -------- TYPES TABLE (END) -------- */
|
||||||
|
|
||||||
|
@ -5073,23 +5072,6 @@ static PyObject *_wrap_Openbox_state(PyObject *self, PyObject *args) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static PyObject *_wrap_Openbox_timerManager(PyObject *self, PyObject *args) {
|
|
||||||
PyObject *resultobj;
|
|
||||||
ob::Openbox *arg1 = (ob::Openbox *) 0 ;
|
|
||||||
otk::TimerQueueManager *result;
|
|
||||||
PyObject * obj0 = 0 ;
|
|
||||||
|
|
||||||
if(!PyArg_ParseTuple(args,(char *)"O:Openbox_timerManager",&obj0)) goto fail;
|
|
||||||
if ((SWIG_ConvertPtr(obj0,(void **) &arg1, SWIGTYPE_p_ob__Openbox,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail;
|
|
||||||
result = (otk::TimerQueueManager *)(arg1)->timerManager();
|
|
||||||
|
|
||||||
resultobj = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_otk__TimerQueueManager, 0);
|
|
||||||
return resultobj;
|
|
||||||
fail:
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static PyObject *_wrap_Openbox_property(PyObject *self, PyObject *args) {
|
static PyObject *_wrap_Openbox_property(PyObject *self, PyObject *args) {
|
||||||
PyObject *resultobj;
|
PyObject *resultobj;
|
||||||
ob::Openbox *arg1 = (ob::Openbox *) 0 ;
|
ob::Openbox *arg1 = (ob::Openbox *) 0 ;
|
||||||
|
@ -8117,7 +8099,6 @@ static PyMethodDef SwigMethods[] = {
|
||||||
{ (char *)"Cursors_ur_angle_get", _wrap_Cursors_ur_angle_get, METH_VARARGS },
|
{ (char *)"Cursors_ur_angle_get", _wrap_Cursors_ur_angle_get, METH_VARARGS },
|
||||||
{ (char *)"Cursors_swigregister", Cursors_swigregister, METH_VARARGS },
|
{ (char *)"Cursors_swigregister", Cursors_swigregister, METH_VARARGS },
|
||||||
{ (char *)"Openbox_state", _wrap_Openbox_state, METH_VARARGS },
|
{ (char *)"Openbox_state", _wrap_Openbox_state, METH_VARARGS },
|
||||||
{ (char *)"Openbox_timerManager", _wrap_Openbox_timerManager, METH_VARARGS },
|
|
||||||
{ (char *)"Openbox_property", _wrap_Openbox_property, METH_VARARGS },
|
{ (char *)"Openbox_property", _wrap_Openbox_property, METH_VARARGS },
|
||||||
{ (char *)"Openbox_actions", _wrap_Openbox_actions, METH_VARARGS },
|
{ (char *)"Openbox_actions", _wrap_Openbox_actions, METH_VARARGS },
|
||||||
{ (char *)"Openbox_bindings", _wrap_Openbox_bindings, METH_VARARGS },
|
{ (char *)"Openbox_bindings", _wrap_Openbox_bindings, METH_VARARGS },
|
||||||
|
@ -8353,7 +8334,6 @@ static swig_type_info _swigt__p_p_unsigned_long[] = {{"_p_p_unsigned_long", 0, "
|
||||||
static swig_type_info _swigt__p_XMotionEvent[] = {{"_p_XMotionEvent", 0, "XMotionEvent *", 0},{"_p_XMotionEvent"},{0}};
|
static swig_type_info _swigt__p_XMotionEvent[] = {{"_p_XMotionEvent", 0, "XMotionEvent *", 0},{"_p_XMotionEvent"},{0}};
|
||||||
static swig_type_info _swigt__p_XButtonEvent[] = {{"_p_XButtonEvent", 0, "XButtonEvent *", 0},{"_p_XButtonEvent"},{0}};
|
static swig_type_info _swigt__p_XButtonEvent[] = {{"_p_XButtonEvent", 0, "XButtonEvent *", 0},{"_p_XButtonEvent"},{0}};
|
||||||
static swig_type_info _swigt__p_XSelectionEvent[] = {{"_p_XSelectionEvent", 0, "XSelectionEvent *", 0},{"_p_XSelectionEvent"},{0}};
|
static swig_type_info _swigt__p_XSelectionEvent[] = {{"_p_XSelectionEvent", 0, "XSelectionEvent *", 0},{"_p_XSelectionEvent"},{0}};
|
||||||
static swig_type_info _swigt__p_otk__TimerQueueManager[] = {{"_p_otk__TimerQueueManager", 0, "otk::TimerQueueManager *", 0},{"_p_otk__TimerQueueManager"},{0}};
|
|
||||||
|
|
||||||
static swig_type_info *swig_types_initial[] = {
|
static swig_type_info *swig_types_initial[] = {
|
||||||
_swigt__p_otk__Point,
|
_swigt__p_otk__Point,
|
||||||
|
@ -8417,7 +8397,6 @@ _swigt__p_p_unsigned_long,
|
||||||
_swigt__p_XMotionEvent,
|
_swigt__p_XMotionEvent,
|
||||||
_swigt__p_XButtonEvent,
|
_swigt__p_XButtonEvent,
|
||||||
_swigt__p_XSelectionEvent,
|
_swigt__p_XSelectionEvent,
|
||||||
_swigt__p_otk__TimerQueueManager,
|
|
||||||
0
|
0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -75,8 +75,7 @@ Screen::Screen(int screen)
|
||||||
openbox->cursors().session);
|
openbox->cursors().session);
|
||||||
|
|
||||||
// initialize the shit that is used for all drawing on the screen
|
// initialize the shit that is used for all drawing on the screen
|
||||||
_image_control = new otk::ImageControl(openbox->timerManager(),
|
_image_control = new otk::ImageControl(_info, true);
|
||||||
_info, true);
|
|
||||||
_image_control->installRootColormap();
|
_image_control->installRootColormap();
|
||||||
_root_cmap_installed = True;
|
_root_cmap_installed = True;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue