Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

444 lines
18 KiB

  1. #ifndef __PREVIEWWND_H_
  2. #define __PREVIEWWND_H_
  3. #include "resource.h" // main symbols
  4. #include "annotlib.h"
  5. #include "tasks.h"
  6. #include "ZoomWnd.h"
  7. #include "SelTrack.h"
  8. #include "Events.h"
  9. // forward declaration
  10. class CPreview;
  11. #define NEWTOOLBAR_TOPMARGIN 8
  12. #define NEWTOOLBAR_BOTTOMMARGIN 8
  13. #define NEWTOOLBAR_BOTTOMMARGIN_CTRLMODE 12
  14. #define TIMER_ANIMATION 42
  15. #define TIMER_SLIDESHOW 43
  16. #define TIMER_TOOLBAR 44
  17. #define TIMER_DATAOBJECT 45
  18. #define TIMER_BUSYCURSOR 46
  19. #define TIMER_RESETSCREENSAVER 47
  20. #define DEFAULT_SHIMGVW_TIMEOUT 5000 // five seconds
  21. // IV_SCROLL message parameters
  22. #define IVS_LEFT (SB_LEFT)
  23. #define IVS_RIGHT (SB_RIGHT)
  24. #define IVS_LINELEFT (SB_LINELEFT)
  25. #define IVS_LINERIGHT (SB_LINERIGHT)
  26. #define IVS_PAGELEFT (SB_PAGELEFT)
  27. #define IVS_PAGERIGHT (SB_PAGERIGHT)
  28. #define IVS_UP (SB_LEFT<<16)
  29. #define IVS_DOWN (SB_RIGHT<<16)
  30. #define IVS_LINEUP (SB_LINELEFT<<16)
  31. #define IVS_LINEDOWN (SB_LINERIGHT<<16)
  32. #define IVS_PAGEUP (SB_PAGELEFT<<16)
  33. #define IVS_PAGEDOWN (SB_PAGERIGHT<<16)
  34. // IV_ZOOM messages
  35. #define IVZ_CENTER 0
  36. #define IVZ_POINT 1
  37. #define IVZ_RECT 2
  38. #define IVZ_ZOOMIN 0x00000000
  39. #define IVZ_ZOOMOUT 0x00010000
  40. // IV_SETOPTIONS and IV_GETOPTIONS messages
  41. #define IVO_TOOLBAR 0
  42. #define IVO_PRINTBTN 1
  43. #define IVO_FULLSCREENBTN 2
  44. #define IVO_CONTEXTMENU 3
  45. #define IVO_PRINTABLE 4
  46. #define IVO_ALLOWGOONLINE 5
  47. #define IVO_DISABLEEDIT 6
  48. // three modes of preview control
  49. #define CONTROL_MODE 0 // embedded in an activeX control
  50. #define WINDOW_MODE 1 // regular window app window
  51. #define SLIDESHOW_MODE 2 // full screen, no menu/title/hides tray
  52. // priority levels for the various tasks
  53. #define PRIORITY_PRIMARYDECODE 0x40000000
  54. #define PRIORITY_FRAMECACHE 0x30000000
  55. #define PRIORITY_LOOKAHEADCACHE 0x20000000
  56. #define PRIORITY_SLIDESHOWENUM 0x10000000
  57. // these values determine which buttons are hidden, enabled, or disabled based on multi-page state
  58. #define MPCMD_HIDDEN 0
  59. #define MPCMD_FIRSTPAGE 1
  60. #define MPCMD_MIDDLEPAGE 2
  61. #define MPCMD_LASTPAGE 3
  62. #define MPCMD_DISABLED 4
  63. #define GTIDFM_DECODE 0
  64. #define GTIDFM_DRAW 1
  65. void GetTaskIDFromMode(DWORD dwTask, DWORD dwMode, TASKOWNERID *ptoid);
  66. enum EViewerToolbarButtons;
  67. class CPreviewWnd : public INamespaceWalkCB, public IDropTarget, public CWindowImpl<CPreviewWnd>,
  68. public IServiceProvider, public IImgCmdTarget
  69. {
  70. public:
  71. // IUnknown
  72. STDMETHODIMP QueryInterface(REFIID riid, void **ppv);
  73. STDMETHODIMP_(ULONG) AddRef(void);
  74. STDMETHODIMP_(ULONG) Release(void);
  75. // INamespaceWalkCB
  76. STDMETHODIMP FoundItem(IShellFolder *psf, LPCITEMIDLIST pidl);
  77. STDMETHODIMP EnterFolder(IShellFolder *psf, LPCITEMIDLIST pidl);
  78. STDMETHODIMP LeaveFolder(IShellFolder *psf, LPCITEMIDLIST pidl);
  79. STDMETHOD(InitializeProgressDialog)(LPWSTR *ppszTitle, LPWSTR *ppszCancel)
  80. { *ppszTitle = NULL; *ppszCancel = NULL; return E_NOTIMPL; }
  81. // IDropTarget
  82. STDMETHODIMP DragEnter(IDataObject *pdtobj, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect);
  83. STDMETHODIMP DragOver(DWORD grfKeyState, POINTL pt, DWORD *pdwEffect);
  84. STDMETHODIMP DragLeave();
  85. STDMETHODIMP Drop(IDataObject *pdtobj, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect);
  86. // IServiceProvider
  87. STDMETHODIMP QueryService(REFGUID guidService, REFIID riid, void **ppv);
  88. // IImgCmdTarget
  89. STDMETHODIMP GetMode(DWORD * pdw);
  90. STDMETHODIMP GetPageFlags(DWORD * pdw);
  91. STDMETHODIMP ZoomIn();
  92. STDMETHODIMP ZoomOut();
  93. STDMETHODIMP ActualSize();
  94. STDMETHODIMP BestFit();
  95. STDMETHODIMP Rotate(DWORD dwAngle);
  96. STDMETHODIMP NextPage();
  97. STDMETHODIMP PreviousPage();
  98. CGraphicsInit m_cgi; // we call gdi+ directly -- make sure GDI+ is ready for us
  99. CContainedWindow m_ctlToolbar;
  100. CZoomWnd m_ctlPreview;
  101. CContainedWindow m_ctlEdit;
  102. CPreviewWnd *m_pcwndSlideShow;
  103. CPreviewWnd();
  104. ~CPreviewWnd();
  105. HRESULT Initialize(CPreviewWnd* pother, DWORD dwMode, BOOL bExitApp);
  106. BOOL TryWindowReuse(IDataObject *pdtobj);
  107. BOOL TryWindowReuse(LPCTSTR pszFilename);
  108. void OpenFile(HWND hwnd, LPCTSTR pszFile);
  109. void OpenFileList(HWND hwnd, IDataObject *pdtobj);
  110. LRESULT ShowFile(LPCTSTR pszFile, UINT cItems, BOOL fReshow = false);
  111. HRESULT WalkItemsToPreview(IUnknown* punk);
  112. void PreviewItems();
  113. HRESULT PreviewItemsFromUnk(IUnknown *punk);
  114. BOOL CreateViewerWindow();
  115. BOOL CreateSlideshowWindow(UINT cWalkDepth);
  116. void SetNotify(CEvents * pEvents);
  117. void SetPalette(HPALETTE hpal);
  118. BOOL GetPrintable();
  119. int TranslateAccelerator(LPMSG lpmsg);
  120. HRESULT SetSite(IUnknown *punk);
  121. HRESULT SaveAs(BSTR bstrPath);
  122. IUnknown *GetSite() {return m_punkSite;};
  123. HRESULT SetWallpaper(BSTR bstrPath);
  124. HRESULT StartSlideShow(IUnknown *punk);
  125. void StatusUpdate(int iStatus); // used to set m_ctlPreview.m_iStrID to display correct status message
  126. void SetCaptionInfo(LPCTSTR szPath);
  127. // The following functions are called from the ZoomWnd
  128. BOOL OnMouseMove(UINT uMsg, WPARAM wParam, LPARAM lParam);
  129. BOOL OnMouseDown(UINT uMsg, WPARAM wParam, LPARAM lParam);
  130. BOOL OnSetCursor(UINT uMsg, WPARAM wParam, LPARAM lParam);
  131. BOOL OnSetColor(HDC hdc);
  132. BOOL GetColor(COLORREF * pref);
  133. void OnDraw(HDC hdc); // called after the Zoomwnd has painted but before calling EndPaint
  134. void OnDrawComplete();
  135. DECLARE_WND_CLASS(TEXT("ShImgVw:CPreviewWnd"));
  136. BEGIN_MSG_MAP(CPreviewWnd)
  137. MESSAGE_HANDLER(WM_CREATE, OnCreate)
  138. MESSAGE_HANDLER(WM_CLOSE, OnClose)
  139. MESSAGE_HANDLER(WM_ERASEBKGND, OnEraseBkgnd)
  140. MESSAGE_HANDLER(WM_SIZE, OnSize)
  141. MESSAGE_HANDLER(WM_APPCOMMAND, OnAppCommand)
  142. MESSAGE_HANDLER(WM_MEASUREITEM, OnMenuMessage);
  143. MESSAGE_HANDLER(WM_DRAWITEM, OnMenuMessage);
  144. MESSAGE_HANDLER(WM_INITMENUPOPUP, OnMenuMessage);
  145. COMMAND_RANGE_HANDLER(ID_FIRSTTOOLBARCMD, ID_LASTTOOLBARCMD, OnToolbarCommand)
  146. COMMAND_RANGE_HANDLER(ID_FIRSTEDITCMD, ID_LASTEDITCMD, OnEditCommand)
  147. COMMAND_RANGE_HANDLER(ID_FIRSTPOSITIONCMD, ID_LASTPOSITIONCMD, OnPositionCommand)
  148. COMMAND_RANGE_HANDLER(ID_FIRSTSLIDESHOWCMD, ID_LASTSLIDESHOWCMD, OnSlideshowCommand)
  149. NOTIFY_CODE_HANDLER(TTN_NEEDTEXT, OnNeedText)
  150. NOTIFY_CODE_HANDLER(TBN_DROPDOWN, OnDropDown)
  151. MESSAGE_HANDLER(WM_MOUSEWHEEL, OnWheelTurn)
  152. MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
  153. MESSAGE_HANDLER(WM_CONTEXTMENU, OnContextMenu)
  154. MESSAGE_HANDLER(WM_TIMER, OnTimer)
  155. MESSAGE_HANDLER(IV_SETIMAGEDATA, IV_OnSetImageData)
  156. MESSAGE_HANDLER(IV_SCROLL, IV_OnIVScroll)
  157. MESSAGE_HANDLER(IV_SETOPTIONS, IV_OnSetOptions)
  158. MESSAGE_HANDLER(WM_COPYDATA, OnCopyData)
  159. MESSAGE_HANDLER(WM_KEYDOWN, OnKeyEvent)
  160. MESSAGE_HANDLER(WM_CHAR, OnKeyEvent)
  161. MESSAGE_HANDLER(WM_ENTERMENULOOP, OnKeyEvent)
  162. MESSAGE_HANDLER(WM_PRINTCLIENT, OnPrintClient)
  163. MESSAGE_HANDLER(IV_ONCHANGENOTIFY, OnChangeNotify)
  164. MESSAGE_HANDLER(WM_SYSCOMMAND, OnSysCommand)
  165. MESSAGE_HANDLER(IV_ISAVAILABLE, OnIsAvailable)
  166. ALT_MSG_MAP(1)
  167. // messages for the toolbar
  168. MESSAGE_HANDLER(WM_KEYDOWN, OnTBKeyEvent)
  169. MESSAGE_HANDLER(WM_KEYUP, OnTBKeyEvent)
  170. MESSAGE_HANDLER(WM_MOUSEMOVE, OnTBMouseMove)
  171. MESSAGE_HANDLER(WM_MOUSELEAVE, OnTBMouseLeave)
  172. ALT_MSG_MAP(2)
  173. MESSAGE_HANDLER(WM_KEYDOWN, OnEditKeyEvent)
  174. END_MSG_MAP()
  175. LRESULT IV_OnSetOptions(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  176. protected:
  177. LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  178. LRESULT OnClose(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  179. LRESULT OnEraseBkgnd(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  180. LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  181. LRESULT OnWheelTurn(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  182. LRESULT OnNeedText(int idCtrl, LPNMHDR pnmh, BOOL& bHandled);
  183. LRESULT OnDropDown(int idCtrl, LPNMHDR pnmh, BOOL& bHandled);
  184. LRESULT OnToolbarCommand(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
  185. LRESULT OnEditCommand(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
  186. LRESULT OnPositionCommand(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
  187. LRESULT OnSlideshowCommand(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
  188. LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  189. LRESULT OnContextMenu(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  190. LRESULT OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  191. LRESULT OnAppCommand(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  192. LRESULT OnMenuMessage(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  193. LRESULT OnCopyData(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  194. LRESULT OnKeyEvent(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  195. LRESULT OnSysCommand(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& fHandled);
  196. LRESULT OnChangeNotify(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  197. LRESULT OnIsAvailable(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  198. BOOL OnNonSlideShowTab();
  199. // Image generation message handlers and functions
  200. LRESULT IV_OnSetImageData(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  201. LRESULT OnShowFileMsg(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  202. LRESULT IV_OnIVScroll(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  203. // Toolbar message handlers (both toolbars)
  204. LRESULT OnPrintClient(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  205. LRESULT OnTBKeyEvent(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  206. LRESULT OnTBMouseMove(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  207. LRESULT OnTBMouseLeave(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  208. // Edit control message handlers
  209. LRESULT OnEditKeyEvent(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  210. // DropDown handlers for the various dropdown buttons
  211. VOID _DropDownPageList(LPNMTOOLBAR pnmTB);
  212. BOOL CreateToolbar();
  213. BOOL _CreateViewerToolbar();
  214. void _InitializeViewerToolbarButtons(HWND hwndToolbar, const TBBUTTON c_tbbuttons[], size_t c_nButtons, TBBUTTON tbbuttons[], size_t nButtons);
  215. inline UINT _IndexOfViewerToolbarButton(EViewerToolbarButtons eButton);
  216. BOOL _CreateSlideshowToolbar();
  217. void _InitializeToolbar(HWND hwndTB, int idLow, int idLowHot, int idHigh, int idHighHot);
  218. void _UpdatePageNumber();
  219. void _SetMultipageCommands();
  220. void _SetMultiImagesCommands();
  221. void _SetEditCommands();
  222. void _ResetScreensaver();
  223. HRESULT _SaveAsCmd();
  224. void _PropertiesCmd();
  225. void _OpenCmd();
  226. BOOL _ReShowingSameFile(LPCTSTR pszFile);
  227. BOOL _VerbExists(LPCTSTR pszVerb);
  228. HRESULT _InvokeVerb(LPCTSTR pszVerb, LPCTSTR pszParameters=NULL);
  229. void _InvokePrintWizard();
  230. // void _InvokeVerbOnPidlArray(LPCSTR pszVerb);
  231. // Shared functions for Annotation and Cropping
  232. void _RefreshSelection(BOOL fDeselect = false);
  233. void _UpdateButtons(WORD wID);
  234. // Annotation Functions
  235. BOOL _CanAnnotate(CDecodeTask * pImageData);
  236. void _SetAnnotatingCommands(BOOL fEnableAnnotations);
  237. void _SetupAnnotatingTracker(CSelectionTracker& tracker, BOOL bEditing=FALSE);
  238. void _UpdateAnnotatingSelection(BOOL fDeselect = false);
  239. void _RemoveAnnotatingSelection();
  240. BOOL _OnMouseDownForAnnotating(UINT uMsg, WPARAM wParam, LPARAM lParam);
  241. void _OnMouseDownForAnnotatingHelper(CPoint ptMouse, CRect rectImage);
  242. void _CreateAnnotation(CRect rect);
  243. void _CreateFreeHandAnnotation(CPoint ptMouse);
  244. void _StartEditing(BOOL bUpdateText = TRUE);
  245. void _HideEditing();
  246. void _StopEditing();
  247. static BOOL_PTR CALLBACK _AnnoPropsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
  248. //Cropping Functions
  249. BOOL _CanCrop(CDecodeTask * pImageData);
  250. void _SetCroppingCommands(BOOL fEnableCropping);
  251. void _SetupCroppingTracker(CSelectionTracker& tracker);
  252. void _UpdateCroppingSelection();
  253. BOOL _OnMouseDownForCropping(UINT uMsg, WPARAM wParam, LPARAM lParam);
  254. // Other functions
  255. void _SetNewImage(CDecodeTask * pImageData);
  256. void _UpdateImage();
  257. // Private methods to create the webviewer
  258. HRESULT _CreateWebViewer();
  259. BOOL _IsThumbnail(LPCTSTR pszPath);
  260. HRESULT _CopyImages(IStorage* pstgSrc, IStorage* pstgDest, UINT cItems, HDPA hdpaItems);
  261. HRESULT _CopyImages_SetupProgress(IProgressDialog** ppProgress, LPWSTR pwszBanner);
  262. HRESULT _CopyThumbnails(LPITEMIDLIST pidlDest, UINT cItems, HDPA hdpaItems, BOOL* fThumbWritten);
  263. HRESULT _WriteThumbs(IStream* pstrm, UINT uiTemplateResource, UINT cItems, HDPA hdpaItems);
  264. LPSTR _GetImageList(UINT cItems, HDPA hdpaItems, BOOL fAddSuffix);
  265. HRESULT _GetSelectedImages(HDPA* phdpaItems);
  266. HRESULT _FormatHTML(UINT cItems, HDPA hdpaItems, LPSTR pszTemplate, DWORD cbTemplateSize, LPSTR psz1, LPSTR psz2, UINT ui1, LPSTR* ppszOut);
  267. HRESULT _FormatHTMLNet(UINT cItems, HDPA hdpaItems, LPSTR pszTemplate, DWORD cbTemplateSize, LPSTR psz1, UINT ui1, LPSTR* ppszOut);
  268. HRESULT _WriteHTML(IStorage* pStgDest, UINT cItems, HDPA hdpaItems);
  269. DWORD _GetFilterStringForSave(LPTSTR szFilter, size_t cbFilter, LPTSTR szExt);
  270. HRESULT _SaveIfDirty(BOOL fCanCancel = false);
  271. HRESULT _PreviewFromStream(IStream * pSteam, UINT iItem, BOOL fUpdateCaption);
  272. HRESULT _PreviewFromFile(LPCTSTR pszFilename, UINT iItem, BOOL fUpdateCaption);
  273. void FlushBitmapMessages();
  274. HRESULT _ShowNextSlide(BOOL bGoBack);
  275. HRESULT _StartDecode(UINT iIndex, BOOL fUpdateCaption);
  276. HRESULT _PreLoadItem(UINT iIndex);
  277. HRESULT _PreviewItem(UINT iIndex);
  278. BOOL _TrySetImage();
  279. void _RemoveFromArray(UINT iItem);
  280. HRESULT _DeleteCurrentSlide();
  281. BOOL _CloseSlideshowWindow();
  282. void SetCursorState(DWORD dwType);
  283. void ShowSSToolbar(BOOL bShow, BOOL bForce = FALSE);
  284. void TogglePlayState();
  285. void _ClearDPA();
  286. HRESULT _GetItem(UINT iItem, LPITEMIDLIST *ppidl);
  287. HRESULT GetCurrentIDList(LPITEMIDLIST *ppidl); // gets the dynamically generated title for this window
  288. HRESULT PathFromImageData(LPTSTR pszFile, UINT cch);
  289. HRESULT ImageDataSave(LPCTSTR pszFile, BOOL bShowUI);
  290. void MenuPoint(LPARAM lParam, int *px, int *py);
  291. BOOL _IsImageFile(LPCTSTR pszFileName);
  292. BOOL _BuildDecoderList();
  293. HRESULT _PrevNextPage(BOOL fForward);
  294. Image *_BurnAnnotations(IShellImageData *pSID);
  295. void _RegisterForChangeNotify(BOOL fRegister);
  296. BOOL _ShouldDisplayAnimations();
  297. BOOL m_fHidePrintBtn;
  298. BOOL m_fAllowContextMenu;
  299. BOOL m_fDisableEdit; // if true, editing is disabled, defaults to FALSE.
  300. BOOL m_fCanSave;
  301. BOOL m_fShowToolbar;
  302. BOOL m_fWarnQuietSave;
  303. BOOL m_fWarnNoSave;
  304. BOOL m_fCanAnnotate; // if true, allows annotation, defaults to FALSE.
  305. BOOL m_fAnnotating; // if true, we are in annotating mode, default to false
  306. HDPA m_hdpaSelectedAnnotations;
  307. BOOL m_fDirty;
  308. WORD m_wNewAnnotation;
  309. HFONT m_hFont;
  310. BOOL m_fEditingAnnotation;
  311. BOOL m_fCanCrop;
  312. BOOL m_fCropping;
  313. CRect m_rectCropping; // Cropping Rectangle in Image Coordinates.
  314. BOOL m_fBusy; // we are displaying the hourglass-and-pointer cursor
  315. HCURSOR m_hCurOld;
  316. HCURSOR m_hCurrent;
  317. BOOL m_fClosed;
  318. BOOL m_fPrintable;
  319. BOOL m_fExitApp;
  320. DWORD m_dwMode; // three modes: CONTROL_MODE, WINDOW_MODE, SLIDESHOW_MODE
  321. BOOL m_fIgnoreUITimers; // should we ignore timer messages (used when context menu is up, don't hide toolbar)
  322. HACCEL m_haccel;
  323. CEvents * m_pEvents; // pointer to our parent control event object. NULL if we aren't running as a control.
  324. LPITEMIDLIST* m_ppidls; // pidls of already shown items
  325. UINT m_cItems; // # of items in m_ppidls
  326. UINT m_iCurSlide; // index into m_ppidls
  327. CDecodeTask* m_pImageData; // The image data for the decoded image to be viewed
  328. HDPA m_hdpaItems; // pidls of already shown items
  329. BOOL m_fPaused; // slide show paused
  330. BOOL m_fToolbarHidden; // toolbar hidden in slide show mode
  331. BOOL m_fGoBack; // direction of the slide show
  332. BOOL m_fTBTrack; // true if we're tracking mouse for toolbar
  333. BOOL m_fWasEdited; // true if we edited the image
  334. UINT m_uTimeout;
  335. int m_iSSToolbarSelect; // selection in toolbar (used for keyboard support in Whistler)
  336. IUnknown* m_punkSite;
  337. HPALETTE m_hpal; // the palette to use if in palette mode.
  338. IShellImageDataFactory * m_pImageFactory; // for decoding images
  339. DWORD m_dwMultiPageMode; // for remembering the state of the prev/next page commands
  340. EXECUTION_STATE m_esFlags; // execution flags, stored to restore after we re-enable monitor's power saving mode
  341. HWND _hWndPageList;
  342. IContextMenu3 *_pcm3;
  343. IShellTaskScheduler * m_pTaskScheduler; // for managing a worker thread
  344. CDecodeTask * m_pNextImageData;
  345. UINT m_iDecodingNextImage;
  346. ImageCodecInfo *m_pici;
  347. UINT m_cDecoders;
  348. IDataObject *_pdtobj; // reused data object for passing data from oncopydata to ontimer
  349. BOOL m_fPromptingUser;
  350. BOOL m_fFirstTime;
  351. BOOL m_fFirstItem;
  352. DWORD m_dwEffect;
  353. BOOL m_fIgnoreNextNotify;
  354. ULONG m_uRegister;
  355. BOOL m_fNoRestore;
  356. private:
  357. BOOL m_bRTLMirrored; // true if m_hWnd is RTL mirrored
  358. UINT m_cWalkDepth;
  359. };
  360. #define REGSTR_SHIMGVW TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\ShellImageView")
  361. #define REGSTR_MAXIMIZED TEXT("Maximize")
  362. #define REGSTR_BOUNDS TEXT("Bounds")
  363. #define REGSTR_FONT TEXT("Font")
  364. #define REGSTR_BACKCOLOR TEXT("BackColor")
  365. #define REGSTR_LINECOLOR TEXT("LineColor")
  366. #define REGSTR_TEXTCOLOR TEXT("TextColor")
  367. #define REGSTR_LINEWIDTH TEXT("LineWidth")
  368. #define REGSTR_TIMEOUT TEXT("Timeout")
  369. #define REGSTR_DONTSHOWME TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\DontShowMeThisDialogAgain")
  370. #define REGSTR_SAVELESS TEXT("ShellImageViewWarnOnSavelessRotate")
  371. #define REGSTR_LOSSYROTATE TEXT("ShellImageViewWarnOnLossyRotate")
  372. #endif