• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

ut_unixTimer.h

Go to the documentation of this file.
00001 /* AbiSource Program Utilities
00002  * Copyright (C) 1998 AbiSource, Inc.
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License
00006  * as published by the Free Software Foundation; either version 2
00007  * of the License, or (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
00017  * 02111-1307, USA.
00018  */
00019 
00020 
00021 
00022 #ifndef UT_UNIXTIMER_H
00023 #define UT_UNIXTIMER_H
00024 
00025 #ifdef HAVE_CONFIG_H
00026 #include "config.h"
00027 #endif
00028 
00029 #include "ut_timer.h"
00030 
00031 #ifdef TOOLKIT_COCOA
00032 typedef struct NSMutableDictionary;
00033 typedef struct NSLock;
00034 #endif
00035 
00036 
00037 class UT_UNIXTimer : public UT_Timer
00038 {
00039 public:
00040     UT_UNIXTimer(UT_WorkerCallback pCallback, void* pData);
00041     virtual ~UT_UNIXTimer();
00042 
00043     virtual UT_sint32 set(UT_uint32 iMilliseconds);
00044     virtual void stop();
00045     virtual void start();
00046 private:
00047     UT_sint32 m_iMilliseconds;
00048     UT_uint32 m_iGtkTimerId;
00049 #ifdef TOOLKIT_COCOA
00050     /* these are here for Cocoa timer */
00051     static NSLock* s_timerMutex;
00052     static NSMutableDictionary* s_timerIds;
00053     static int s_lastTimerId;
00054 
00055     friend void _checkLock(void);
00056     friend void XAP_stopCocoaTimer (UT_uint32 timerId);
00057     friend UT_uint32 XAP_newCocoaTimer (UT_uint32 time, int (*proc)(void *), void *p);
00058 #endif
00059 };
00060 
00061 #endif /* UT_UNIXTIMER_H */
00062 

Generated on Mon May 28 2012 for AbiWord by  doxygen 1.7.1