1 /* 2 * Copyright 2005-2008 Stephan Aßmus <superstippi@gmx.de>. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef UPDATE_QUEUE_H 6 #define UPDATE_QUEUE_H 7 8 #include <List.h> 9 #include <Locker.h> 10 #include <OS.h> 11 #include <Region.h> 12 13 #include "HWInterface.h" 14 15 16 class UpdateQueue : public BLocker, public HWInterfaceListener { 17 public: 18 UpdateQueue(HWInterface* interface); 19 virtual ~UpdateQueue(); 20 21 virtual void FrameBufferChanged(); 22 23 status_t Init(); 24 void Shutdown(); 25 26 void AddRect(const BRect& rect); 27 28 private: 29 static int32 _ExecuteUpdatesEntry(void *cookie); 30 int32 _ExecuteUpdates(); 31 32 volatile bool fQuitting; 33 HWInterface* fInterface; 34 35 BRegion fUpdateRegion; 36 thread_id fUpdateExecutor; 37 sem_id fRetraceSem; 38 bigtime_t fRefreshDuration; 39 }; 40 41 #endif // UPDATE_QUEUE_H 42