1 /* 2 * Copyright 2003-2010, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Fernando Francisco de Oliveira 7 * Michael Wilber 8 * Michael Pfeiffer 9 */ 10 #ifndef SHOW_IMAGE_APP_H 11 #define SHOW_IMAGE_APP_H 12 13 14 #include "ShowImageSettings.h" 15 16 #include <Application.h> 17 #include <FilePanel.h> 18 19 20 enum { 21 MSG_FILE_OPEN = 'mFOP', 22 }; 23 24 25 class ShowImageApp : public BApplication { 26 public: 27 ShowImageApp(); 28 virtual ~ShowImageApp(); 29 30 virtual void ArgvReceived(int32 argc, char** argv); 31 virtual void ReadyToRun(); 32 virtual void MessageReceived(BMessage* message); 33 virtual void Pulse(); 34 virtual void RefsReceived(BMessage* message); 35 virtual bool QuitRequested(); 36 37 ShowImageSettings* Settings() { return &fSettings; } 38 39 private: 40 void _StartPulse(); 41 void _Open(const entry_ref& ref, 42 const BMessenger& trackerMessenger); 43 void _BroadcastToWindows(BMessage* message); 44 void _CheckClipboard(); 45 void _UpdateLastWindowFrame(); 46 47 private: 48 BFilePanel* fOpenPanel; 49 bool fPulseStarted; 50 ShowImageSettings fSettings; 51 BRect fLastWindowFrame; 52 }; 53 54 55 extern const char* kApplicationSignature; 56 57 #define my_app dynamic_cast<ShowImageApp*>(be_app) 58 59 60 #endif // SHOW_IMAGE_APP_H 61