From: Abdelrazak Younes Date: Mon, 26 Jun 2006 17:13:31 +0000 (+0000) Subject: Removed file because of conflict when merging the "younes" branch X-Git-Tag: 1.6.10~13061 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=33a6fc122c8b8f330421214af4adfd70ed8662eb;p=features.git Removed file because of conflict when merging the "younes" branch git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14232 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/qt4/Application.C b/src/frontends/qt4/Application.C deleted file mode 100644 index d8b4fdcea8..0000000000 --- a/src/frontends/qt4/Application.C +++ /dev/null @@ -1,174 +0,0 @@ -/** - * \file qt4/Application.C - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author unknown - * \author John Levon - * \author Abdelrazak Younes - * - * Full author contact details are available in file CREDITS. - */ - -#include "GuiWorkArea.h" -#include "Application.h" - -#include "qt_helpers.h" -#include "BufferView.h" -#include "debug.h" -#include "support/lstrings.h" - -#include -#include -#include -#include -#include - -#ifdef Q_WS_X11 -#include -#endif - -using lyx::support::subst; - -using std::string; -using std::endl; - -/////////////////////////////////////////////////////////////// -// You can find other X11 and MACX specific stuff -// at the end of this file... -/////////////////////////////////////////////////////////////// - -namespace lyx { -namespace frontend { - -Application::Application(int & argc, char ** argv) - : QApplication(argc, argv), work_area_(NULL) -{ -#ifdef Q_WS_X11 - // doubleClickInterval() is 400 ms on X11 witch is just too long. - // On Windows and Mac OS X, the operating system's value is used. - // On Microsoft Windows, calling this function sets the double - // click interval for all applications. So we don't! - QApplication::setDoubleClickInterval(300); -#endif - -#ifdef Q_WS_MACX - AEInstallEventHandler(kCoreEventClass, kAEOpenDocuments, - NewAEEventHandlerUPP(handleOpenDocuments), - 0, false); -#endif -} - -void Application::connect(GuiWorkArea * work_area) -{ - work_area_ = work_area; -} - - -//////////////////////////////////////////////////////////////////////// -// X11 specific stuff goes here... -#ifdef Q_WS_X11 -bool Application::x11EventFilter(XEvent * xev) -{ - switch (xev->type) { - case SelectionRequest: - lyxerr[Debug::GUI] << "X requested selection." << endl; - if (work_area_) - work_area_->view().view()->selectionRequested(); - break; - case SelectionClear: - lyxerr[Debug::GUI] << "Lost selection." << endl; - if (work_area_) - work_area_->view().view()->selectionLost(); - break; - } - return false; -} -#endif - - -//////////////////////////////////////////////////////////////////////// -// Mac OSX specific stuff goes here... - -#ifdef Q_WS_MACX -namespace{ -OSErr checkAppleEventForMissingParams(const AppleEvent& theAppleEvent) - { - DescType returnedType; - Size actualSize; - OSErr err = AEGetAttributePtr(&theAppleEvent, keyMissedKeywordAttr, - typeWildCard, &returnedType, nil, 0, - &actualSize); - switch (err) { - case errAEDescNotFound: - return noErr; - case noErr: - return errAEEventNotHandled; - default: - return err; - } - } -} // namespace - -OSErr Application::handleOpenDocuments(const AppleEvent* inEvent, - AppleEvent* /*reply*/, long /*refCon*/) -{ - QString s_arg; - AEDescList documentList; - OSErr err = AEGetParamDesc(inEvent, keyDirectObject, typeAEList, - &documentList); - if (err != noErr) - return err; - - err = checkAppleEventForMissingParams(*inEvent); - if (err == noErr) { - long documentCount; - err = AECountItems(&documentList, &documentCount); - for (long documentIndex = 1; - err == noErr && documentIndex <= documentCount; - documentIndex++) { - DescType returnedType; - Size actualSize; - AEKeyword keyword; - FSRef ref; - char qstr_buf[1024]; - err = AESizeOfNthItem(&documentList, documentIndex, - &returnedType, &actualSize); - if (err == noErr) { - err = AEGetNthPtr(&documentList, documentIndex, - typeFSRef, &keyword, - &returnedType, (Ptr)&ref, - sizeof(FSRef), &actualSize); - if (err == noErr) { - FSRefMakePath(&ref, (UInt8*)qstr_buf, - 1024); - s_arg=QString::fromUtf8(qstr_buf); - work_area_->view().view()->workAreaDispatch( - FuncRequest(LFUN_FILE_OPEN, - fromqstr(s_arg))); - break; - } - } - } // for ... - } - AEDisposeDesc(&documentList); - - return err; -} - -bool Application::macEventFilter(EventRef event) -{ - if (GetEventClass(event) == kEventClassAppleEvent) { - EventRecord eventrec; - ConvertEventRefToEventRecord(event, &eventrec); - AEProcessAppleEvent(&eventrec); - - return false; - } - return false; -} - -#endif // Q_WS_MACX - -} // namespace frontend -} // namespace lyx