13 #include "msdevstudio/MSconfig.h"
19 #if QT_VERSION < 0x040000
22 #include <QtGui/QFileOpenEvent>
33 using namespace hippodraw;
59 current_dir.
mkdir(
"temp_latex");
64 #if QT_VERSION < 0x040000
67 qRegisterMetaType < std::string > (
"std::string" );
74 #if QT_VERSION < 0x040000
75 AEInstallEventHandler ( kCoreEventClass,
77 appleEventHandler, 0,
false );
89 system(
"rm -f temp_latex/*.*");
90 current_dir.
rmdir(
"temp_latex");
98 #if QT_VERSION < 0x040000
99 AERemoveEventHandler ( kCoreEventClass,
101 appleEventHandler,
false );
122 #if QT_VERSION < 0x040000
126 QFileOpenEvent * oe = dynamic_cast < QFileOpenEvent * > ( event );
131 const string filename = fn.
latin1();
136 #if QT_VERSION < 0x040000
139 appleEventHandler (
const AppleEvent * event,
144 if ( AEGetParamDesc ( event,
146 typeAEList, & docs) == noErr) {
148 AECountItems ( &docs, &cnt );
149 UInt8 strBuffer[256];
150 for (
int i = 0; i < cnt; i++ ) {
152 if ( AEGetNthPtr( & docs, i+1,
154 & ref,
sizeof(ref), 0 ) != noErr )
continue;
155 if ( FSRefMakePath ( &ref, strBuffer, 256) == noErr ) {
171 bool hasWindow =
false;
174 #if QT_VERSION < 0x040000
176 char ** args =
argv ();
179 int count = args.count();
187 wc -> createInspector();
192 for (
int i = 1; i < count; i++ ) {
206 string::size_type pos = arg.find_last_of (
'.' );
207 if ( pos == string::npos )
return false;
209 string suffix = arg.substr ( pos );
214 window -> initFromFile ( arg );