Mercurial > hg > orthanc-stone
comparison Applications/Generic/NativeStoneApplicationContext.h @ 334:c34784e5f299 am-2
compatibility fixes
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 18 Oct 2018 09:02:24 +0200 |
parents | 87376a645ee1 |
children | 6cc3ce74dc05 |
comparison
equal
deleted
inserted
replaced
333:08683537a227 | 334:c34784e5f299 |
---|---|
35 { | 35 { |
36 private: | 36 private: |
37 | 37 |
38 static void UpdateThread(NativeStoneApplicationContext* that); | 38 static void UpdateThread(NativeStoneApplicationContext* that); |
39 | 39 |
40 boost::mutex globalMutex_; | 40 boost::mutex globalMutex_; |
41 std::unique_ptr<WidgetViewport> centralViewport_; | 41 std::auto_ptr<WidgetViewport> centralViewport_; |
42 boost::thread updateThread_; | 42 boost::thread updateThread_; |
43 bool stopped_; | 43 bool stopped_; |
44 unsigned int updateDelayInMs_; | 44 unsigned int updateDelayInMs_; |
45 | 45 |
46 public: | 46 public: |
47 class GlobalMutexLocker: public boost::noncopyable | 47 class GlobalMutexLocker: public boost::noncopyable |
48 { | 48 { |
49 boost::mutex::scoped_lock lock_; | 49 boost::mutex::scoped_lock lock_; |
50 public: | 50 public: |
51 GlobalMutexLocker(NativeStoneApplicationContext& that): | 51 GlobalMutexLocker(NativeStoneApplicationContext& that): |
52 lock_(that.globalMutex_) | 52 lock_(that.globalMutex_) |
53 {} | 53 { |
54 } | |
54 }; | 55 }; |
55 | 56 |
56 NativeStoneApplicationContext(); | 57 NativeStoneApplicationContext(); |
57 | 58 |
58 virtual ~NativeStoneApplicationContext() {} | 59 virtual ~NativeStoneApplicationContext() |
60 { | |
61 } | |
59 | 62 |
60 virtual IWidget& SetCentralWidget(IWidget* widget); // Takes ownership | 63 virtual IWidget& SetCentralWidget(IWidget* widget); // Takes ownership |
61 IViewport& GetCentralViewport() {return *(centralViewport_.get());} | 64 |
65 IViewport& GetCentralViewport() | |
66 { | |
67 return *(centralViewport_.get()); | |
68 } | |
62 | 69 |
63 void Start(); | 70 void Start(); |
64 | 71 |
65 void Stop(); | 72 void Stop(); |
66 | 73 |
67 void SetUpdateDelay(unsigned int delayInMs) | 74 void SetUpdateDelay(unsigned int delayInMs) |
68 { | 75 { |
69 updateDelayInMs_ = delayInMs; | 76 updateDelayInMs_ = delayInMs; |
70 } | 77 } |
71 | |
72 }; | 78 }; |
73 } | 79 } |