2 * Copyright 2014, Stephan Aßmus <superstippi@gmx.de>.
3 * All rights reserved. Distributed under the terms of the MIT License.
5 #ifndef SCREENSHOT_WINDOW_H
6 #define SCREENSHOT_WINDOW_H
13 #include "PackageInfo.h"
22 MSG_NEXT_SCREENSHOT
= 'nscr',
23 MSG_PREVIOUS_SCREENSHOT
= 'pscr',
24 MSG_DOWNLOAD_START
= 'dlst',
25 MSG_DOWNLOAD_STOP
= 'dlsp',
29 class ScreenshotWindow
: public BWindow
{
31 ScreenshotWindow(BWindow
* parent
, BRect frame
);
32 virtual ~ScreenshotWindow();
34 virtual bool QuitRequested();
36 virtual void MessageReceived(BMessage
* message
);
38 void SetOnCloseMessage(
39 const BMessenger
& messenger
,
40 const BMessage
& message
);
42 void SetPackage(const PackageInfoRef
& package
);
44 static void CleanupIcons();
47 void _DownloadScreenshot();
49 void _SetWorkerThread(thread_id thread
);
51 static int32
_DownloadThreadEntry(void* data
);
52 void _DownloadThread();
54 void _ResizeToFitAndCenter();
55 void _UpdateToolBar();
59 kProgressIndicatorDelay
= 200000 // us
63 BMessenger fOnCloseTarget
;
64 BMessage fOnCloseMessage
;
67 BarberPole
* fBarberPole
;
68 bool fBarberPoleShown
;
69 BStringView
* fIndexView
;
71 BitmapRef fScreenshot
;
72 BitmapView
* fScreenshotView
;
74 int32 fCurrentScreenshotIndex
; // atomic
76 PackageInfoRef fPackage
;
77 bool fDownloadPending
;
80 thread_id fWorkerThread
;
84 #endif // SCREENSHOT_WINDOW_H