Commit 117ea13f authored by Oleg.Korshul's avatar Oleg.Korshul Committed by Alexander Trofimov

linux print

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@64395 954022d7-b5bf-4e40-9824-e11837661b57
parent 2c630fe1
......@@ -13,6 +13,10 @@
#include <QStandardPaths>
#include <QApplication>
#include <QAbstractEventDispatcher>
#include <QAbstractNativeEventFilter>
#include <QDebug>
static std::wstring GetAppDataPath()
{
......@@ -76,6 +80,39 @@ public:
}
};
class QNativeEventFilter : public QAbstractNativeEventFilter
{
public:
CAscApplicationManager* m_pManager;
public:
QNativeEventFilter(CAscApplicationManager* pManager) : QAbstractNativeEventFilter()
{
m_pManager = pManager;
}
virtual ~QNativeEventFilter() {}
virtual bool nativeEventFilter(const QByteArray &eventType, void *message, long *result)
{
//qDebug() << "EventFilter";
//qDebug() << rand();
m_pManager->GetApplication()->DoMessageLoopEvent();
return false;
}
};
class QApplicationEL : public QApplication
{
public:
QApplicationEL(int &argc, char **argv) : QApplication(argc, argv)
{
}
public:
void InitMessageLoop(CAscApplicationManager* pManager)
{
this->installNativeEventFilter(new QNativeEventFilter(pManager));
}
};
static int AscEditor_Main( int argc, char *argv[] )
{
......@@ -138,12 +175,6 @@ static int AscEditor_Main( int argc, char *argv[] )
pApplicationManager->CheckFonts();
a.setStyleSheet("#mainPanel { margin: 0; padding: 0; }\
#systemPanel { margin: 0; padding: 0; } \
#centralWidget { background: #313437; } \
QPushButton:focus{border:none;outline:none;}\
QWidget {border:none;outline:none;}");
// Font
QFont mainFont = a.font();
mainFont.setStyleStrategy( QFont::PreferAntialias );
......@@ -151,6 +182,13 @@ QWidget {border:none;outline:none;}");
// Create window
QAscMainWindow w(NULL, pApplicationManager);
w.setStyleSheet("#mainPanel { margin: 0; padding: 0; }\
#systemPanel { margin: 0; padding: 0; } \
#centralWidget { background: #313437; } \
QPushButton:focus{border:none;outline:none;}\
QWidget {border:none;outline:none;}");
w.show();
w.setWindowTitle("ASCDesktopEditor");
......
......@@ -390,7 +390,7 @@ void QAscMainPanel::slot_Print(int id, int pagesCount)
QPrintDialog *dialog = new QPrintDialog(pContext->getPrinter(), NULL);
dialog->setWindowTitle(tr("Print Document"));
dialog->show();
dialog->exec();
CCefView* pView = m_pManager->GetViewById(id);
......
......@@ -19,6 +19,7 @@ public:
void Close();
int RunMessageLoop(bool& is_runned);
void DoMessageLoopEvent();
bool ExitMessageLoop();
};
......
......@@ -252,6 +252,11 @@ int CApplicationCEF::RunMessageLoop(bool& is_runned)
#endif
}
void CApplicationCEF::DoMessageLoopEvent()
{
CefDoMessageLoopWork();
}
bool CApplicationCEF::ExitMessageLoop()
{
#if defined(_LINUX) && !defined(_MAC)
......
......@@ -5,20 +5,8 @@
#include <string>
#ifdef max
#undef max
#endif
#include <vector>
#ifndef max
#define max(a,b) (((a) > (b)) ? (a) : (b))
#endif
#ifndef min
#define min(a,b) (((a) < (b)) ? (a) : (b))
#endif
namespace NSEditorApi
{
class IMenuEventDataBase
......
......@@ -511,11 +511,11 @@ namespace NSFile
}
else
{
*pWCurrent = (wchar_t)((((pShort[0]) & 0x03FF) << 10) | ((pShort[1]) & 0x03FF));
*pWCurrent = (wchar_t)((((pShort[0]) & 0x03FF) << 10) | ((pShort[1]) & 0x03FF));
pShort += 2;
nCurrent += 2;
}
pShort += 2;
nCurrent += 2;
++pWCurrent;
}
std::wstring sRet(pWChar, pWCurrent - pWChar);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment