13 #include "msdevstudio/MSconfig.h"
19 #if QT_VERSION < 0x040000
22 #include <QtGui/QFileOpenEvent>
34 using namespace hippodraw;
60 char * tmp_dir(std::getenv(
"TMP"));
70 #if QT_VERSION < 0x040000
73 qRegisterMetaType < std::string > (
"std::string" );
80 #if QT_VERSION < 0x040000
81 AEInstallEventHandler ( kCoreEventClass,
83 appleEventHandler, 0,
false );
96 system(command.c_str());
105 #if QT_VERSION < 0x040000
106 AERemoveEventHandler ( kCoreEventClass,
108 appleEventHandler,
false );
129 #if QT_VERSION < 0x040000
133 QFileOpenEvent * oe = dynamic_cast < QFileOpenEvent * > ( event );
138 const string filename = fn.
latin1();
143 #if QT_VERSION < 0x040000
146 appleEventHandler (
const AppleEvent * event,
151 if ( AEGetParamDesc ( event,
153 typeAEList, & docs) == noErr) {
155 AECountItems ( &docs, &cnt );
156 UInt8 strBuffer[256];
157 for (
int i = 0;
i < cnt;
i++ ) {
159 if ( AEGetNthPtr( & docs,
i+1,
161 & ref,
sizeof(ref), 0 ) != noErr )
continue;
162 if ( FSRefMakePath ( &ref, strBuffer, 256) == noErr ) {
178 bool hasWindow =
false;
181 #if QT_VERSION < 0x040000
183 char ** args =
argv ();
186 int count = args.count();
194 wc -> createInspector();
199 for (
int i = 1;
i < count;
i++ ) {
213 string::size_type pos = arg.find_last_of (
'.' );
214 if ( pos == string::npos )
return false;
216 string suffix = arg.substr ( pos );
221 window -> initFromFile ( arg );
hippodraw::QtFileDialog class interface
void openRootTuple(const std::string &filename, QWidget *parent)
Opens a ROOT DataSource file.
hippodraw::CanvasWindow class interface.
void setFirstWindow()
Sets up the first CanvasWindow object.
A singleton class for keeping track the window components of HippoDraw.
static QtApp * s_instance
The instance of the application.
static bool isFitsSuffix(const std::string &suffix)
Returns true if suffix is one corresponding to FITS DataSource file.
bool tryOpenFile(const std::string &name)
The Apple event handler.
CanvasWindow * currentCanvas()
Returns a pointer to the current CanvasWindow.
hippodraw::QtApp class interface
hippodraw::WindowController class interface
static void resetFontSize()
Resets the font size to be no larger than 10.
A derived class of QApplication that instantiates the components of HippoDraw.
void init()
Method called by constructors to initialize the application.
QtApp(int &argc, char **argv)
A Constructor that always enables the GUI.
fromUtf8(const char *utf8, int len=-1)
rmdir(const QString &dirName, bool acceptAbsPath=TRUE) const
static bool isTextSuffix(const std::string &suffix)
Returns true if suffix is one corresponding to text NTuple file.
static WindowController * instance()
Returns the application instance.
A class to handle various file types.
void openFitsTuple(const std::string &filename, QWidget *parent)
Opens a FITS DataSource file.
static bool isDocSuffix(const std::string &suffix)
Returns true if suffix is one corresponding to document file.
mkdir(const QString &dirName, bool acceptAbsPath=TRUE) const
void setFirstWindow()
Sets up the first application main window.
hippodraw::FileOpenEvent class interface
static bool isRootSuffix(const std::string &suffix)
Returns true if suffix is one corresponding to ROOT DataSource files.
A concrete window class that contains the canvas and responds to menu item and tool bar events from t...
sendEvent(QObject *receiver, QEvent *event)
static QtApp * instance()
Returns the application instance.
static void openTextTuple(const std::string &filename)
Opens a text NTuple file.