From b752595aae22748fb5ec0e5a9b276aca51afa65f Mon Sep 17 00:00:00 2001 From: Freddie Witherden Date: Sun, 10 Aug 2008 12:43:45 +0000 Subject: [PATCH] Add the implementation-defined widgetGetTime() function (which returns the current time in ms). git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5789 4a71c877-e1ca-e34f-864e-861f7616d084 --- lib/betawidget/widget.c | 4 ++-- lib/betawidget/widget.h | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/lib/betawidget/widget.c b/lib/betawidget/widget.c index 09f91627b..6905ecb75 100644 --- a/lib/betawidget/widget.c +++ b/lib/betawidget/widget.c @@ -724,8 +724,8 @@ void widgetFocusImpl(widget *self) self->hasFocus = true; // Fire our on-focus callbacks - // FIXME: We need to set the timestamp of the event evt.event.type = EVT_FOCUS; + evt.event.time = widgetGetTime(); widgetFireCallbacks(self, (event *) &evt); } @@ -751,8 +751,8 @@ void widgetBlurImpl(widget *self) self->hasFocus = false; // Fire off the on-blur callbacks - // FIXME: We need to set the timestamp of the event evt.event.type = EVT_BLUR; + evt.event.time = widgetGetTime(); widgetFireCallbacks(self, (event *) &evt); } diff --git a/lib/betawidget/widget.h b/lib/betawidget/widget.h index d760e9b9b..4ffde75bc 100644 --- a/lib/betawidget/widget.h +++ b/lib/betawidget/widget.h @@ -404,6 +404,18 @@ void widgetCompositeImpl(widget *self); */ bool widgetIsA(widget *self, const classInfo *instanceOf); +/* + * Public static, implementation defined methods + */ + +/** + * This method should return the number of milliseconds since an undefined + * epoch. + * + * @return The number of milliseconds since the epoch. + */ +int widgetGetTime(void); + /* * Public methods */